/* Murr Mall: sign-in, dashboard, and profile */

  body.home { overflow:auto; -webkit-user-select:text; user-select:text; }
  body.home #app, body.home #fx { display:none; }
  body.mall-loading #home { display:none; }
  /* когда смонтирована уличная сценка, фон кабинета отдаём её небу */
  body.ods-active { background:#cfe3ec; }
  body.ods-active #home { background:none; }
  body.ods-active .home-shell { padding-bottom:190px; } /* контент не прячется за полосой улицы */

  /* ============ ЛИЧНЫЙ КАБИНЕТ ============ */
  #home {
    min-height:100vh; min-height:100dvh; color:#46392a;
    background:
      radial-gradient(900px 520px at 15% 0%, rgba(255,232,178,.68), transparent 70%),
      radial-gradient(720px 500px at 95% 20%, rgba(164,196,145,.26), transparent 70%),
      linear-gradient(145deg,#f9f0dd,#e8d7b8);
  }
  body:not(.home) #home { display:none; }
  .home-shell { width:min(1020px, calc(100% - 32px)); margin:0 auto; padding:36px 0 70px; }
  /* the same header as the landing pages, with the tagline under the wordmark */
  .home-top {
    display:flex; align-items:center; justify-content:space-between; gap:16px 24px;
    max-width:1240px; margin:0 auto; padding:26px 32px 0;
  }
  .home-top-brand { min-width:0; }
  /* The logo: the cats peeking over a ledge, then the name as outlines in the text colour.
     Both languages are in the markup and the page's lang shows one; the dark theme swaps
     in cats whose ledge is grey instead of dark brown. */
  .home-wordmark {
    display:inline-flex; align-items:flex-end; gap:10px;
    line-height:0; color:inherit; text-decoration:none;
  }
  .home-wordmark .brand-cats { display:block; width:auto; height:46px; }
  .home-wordmark .brand-name { display:block; width:auto; height:34px; }
  .home-wordmark .brand-cats-dark,
  .home-wordmark .brand-name-en,
  html[data-theme="dark"] .home-wordmark .brand-cats-light,
  html:lang(en) .home-wordmark .brand-name-ru { display:none; }
  html[data-theme="dark"] .home-wordmark .brand-cats-dark,
  html:lang(en) .home-wordmark .brand-name-en { display:block; }
  .home-tagline { display:block; margin-top:2px; font-size:13px; line-height:1.35; }
  .home-top-actions { display:flex; align-items:center; justify-content:flex-end; gap:20px; flex-shrink:0; }
  #profile-settings, #profile-appearance, #profile-account { padding:28px; }
  #profile-settings[hidden], #profile-appearance[hidden], #profile-account[hidden], #profile-form[hidden] { display:none; }
  #profile-settings p, #profile-appearance p, #profile-account p, #profile-form .profile-panel-intro { font-size:13px; overflow-wrap:anywhere; }
  #profile-account .danger-btn { margin-top:18px; }
  /* Telegram bot. Buttons set their own display, so [hidden] must win here. */
  #profile-telegram [hidden], #profile-telegram[hidden] { display:none !important; }
  #profile-telegram {
    margin-top:20px; padding:18px; border:1px solid var(--ui-border); border-radius:16px;
    background:var(--ui-surface-subtle);
  }
  .profile-telegram-head { display:flex; align-items:flex-start; gap:12px; }
  .profile-telegram-icon {
    display:grid; place-items:center; flex:none; width:40px; height:40px; border-radius:12px;
    background:#2aabee; color:#fff; font-size:22px;
  }
  .profile-telegram-heading { flex:1; min-width:0; }
  #profile-telegram h3 { margin:0; font-size:15px; font-weight:700; line-height:1.3; color:var(--ui-text); }
  #profile-account .profile-telegram-heading p { margin:3px 0 0; line-height:1.45; }
  .profile-telegram-title-row { display:flex; flex-wrap:wrap; align-items:center; gap:4px 8px; }
  #profile-telegram-badge {
    padding:2px 9px; border-radius:999px; font-size:12px; font-weight:700; line-height:1.5;
    background:var(--ui-success-soft); color:var(--ui-success);
  }
  #profile-telegram-steps {
    margin:14px 0 0; padding:0; list-style:none; counter-reset:tg-step; display:grid; gap:8px;
    font-size:13px; color:var(--ui-text-secondary);
  }
  #profile-telegram-steps li { counter-increment:tg-step; display:flex; align-items:center; gap:10px; }
  #profile-telegram-steps li::before {
    content:counter(tg-step); display:grid; place-items:center; flex:none; width:24px; height:24px;
    border-radius:50%; border:1px solid var(--ui-border); background:var(--ui-surface);
    font-size:12px; font-weight:700;
  }
  #profile-telegram-steps li.is-current { color:var(--ui-text); font-weight:650; }
  #profile-telegram-steps li.is-current::before {
    background:var(--ui-accent); border-color:var(--ui-accent); color:#fff;
  }
  #profile-telegram-steps li.is-done::before {
    content:'\f00c'; font:900 11px/1 "Font Awesome 6 Free";
    background:var(--ui-success-soft); border-color:transparent; color:var(--ui-success);
  }
  .profile-telegram-skeleton { display:none; }
  #profile-telegram.is-loading .profile-telegram-skeleton { display:grid; gap:14px; margin-top:14px; }
  .profile-telegram-skeleton span {
    display:block; height:14px; width:72%; border-radius:7px;
    background:linear-gradient(90deg, var(--ui-border) 0%, var(--ui-surface) 50%, var(--ui-border) 100%);
    background-size:200% 100%; animation:tg-shimmer 1.3s ease-in-out infinite;
  }
  .profile-telegram-skeleton span + span { width:168px; height:42px; border-radius:11px; }
  @keyframes tg-shimmer { from { background-position:100% 0; } to { background-position:-100% 0; } }
  @media (prefers-reduced-motion: reduce) { .profile-telegram-skeleton span { animation:none; } }
  #profile-account #profile-telegram-status { margin:14px 0 0; line-height:1.45; color:var(--ui-text); }
  #profile-account #profile-telegram-status:empty { display:none; }
  #profile-telegram-status.is-error { color:var(--ui-danger); }
  /* The switch sits inside the card, so it starts flush with the text. */
  #profile-telegram .profile-toggle { margin-top:14px; padding-top:14px; }
  #profile-telegram .profile-toggle-note { margin:14px 0 0; }
  #profile-telegram-actions { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-top:14px; }
  #profile-telegram-open { text-decoration:none; }
  .profile-telegram-unlink {
    margin-left:auto; padding:8px 4px; border:0; background:none; font:inherit; font-size:13px;
    color:var(--ui-text-secondary); text-decoration:underline; text-underline-offset:3px; cursor:pointer;
  }
  .profile-telegram-unlink:hover { color:var(--ui-danger); }
  /* Profile, settings, appearance and account as tabs under the heading. */
  /* A warm track with the open tab as a white pill, like the buttons. */
  #profile-tabs {
    display:flex; gap:3px; margin-bottom:14px; padding:4px; border:none;
    border-radius:999px; background:var(--card-tint);
  }
  #profile-tabs button {
    display:inline-flex; flex:1; align-items:center; justify-content:center; gap:8px;
    min-height:44px; padding:9px 14px; border:0; border-radius:999px;
    font:inherit; font-size:14px; font-weight:700; cursor:pointer;
    color:var(--card-soft); background:transparent;
    transition:background .16s ease, color .16s ease, box-shadow .16s ease;
  }
  #profile-tabs button:hover { color:var(--card-ink); }
  #profile-tabs button[aria-selected="true"] {
    background:var(--pill); color:var(--pill-text); box-shadow:var(--pill-ring);
  }
  #profile-tabs button[aria-selected="true"] i { color:var(--pill-primary); }
  #profile-tabs button:focus-visible { outline:2px solid var(--ui-accent); outline-offset:2px; }
  .profile-panel-status { min-height:20px; margin-top:14px; color:var(--ui-danger); font-size:13px; }
  .profile-panel-status:empty { display:none; }
  /* The app's version and «Что нового», quiet at the foot of Settings. */
  .app-version {
    display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin:22px 0 0;
    padding-top:16px; border-top:1px solid var(--ui-border);
    color:var(--ui-text-secondary); font-size:12px; line-height:1.4;
  }
  .whats-new-open {
    display:inline-flex; align-items:center; gap:6px; padding:2px 0; border:0; background:none;
    color:inherit; font:inherit; font-weight:700; cursor:pointer;
    text-decoration:underline; text-underline-offset:2px;
  }
  .whats-new-open:hover { color:var(--ui-accent); }
  .whats-new-open:focus-visible { outline:2px solid var(--ui-accent); outline-offset:2px; border-radius:4px; }
  .whats-new-tag {
    display:inline-flex; align-items:center; min-height:18px; padding:2px 7px; border-radius:999px;
    background:var(--ui-accent-soft); color:var(--ui-accent);
    font-size:10.5px; font-weight:800; letter-spacing:.06em; text-transform:uppercase; text-decoration:none;
  }
  .whats-new-tag[hidden] { display:none; }
  #whats-new-dlg { width:min(480px, calc(100vw - 24px)); }
  .whats-new-list { display:grid; gap:10px; max-height:min(60vh, 520px); overflow-y:auto; margin:4px 0 18px; }
  /* Every release sits in the same padded box; minor ones are tinted green, major ones orange. */
  .whats-new-release { padding:12px 14px; border-radius:14px; }
  .whats-new-minor { background:var(--ui-success-soft); }
  .whats-new-minor h3 { color:var(--ui-success); }
  .whats-new-major { background:var(--release-major-soft); }
  .whats-new-major h3 { color:var(--release-major); }
  .whats-new-release h3 {
    display:flex; align-items:baseline; gap:10px; margin:0 0 8px; color:var(--ui-text); font-size:16px;
  }
  .whats-new-release time { color:var(--ui-text-secondary); font-size:12.5px; font-weight:600; }
  .whats-new-release ul { display:grid; gap:6px; margin:0; padding-left:20px; color:var(--ui-text); font-size:14px; line-height:1.5; }
  /* Older patches fold like the landing FAQ, with a chevron that turns up when open. */
  .whats-new-release summary {
    display:flex; align-items:center; gap:10px; list-style:none; cursor:pointer; border-radius:8px;
  }
  .whats-new-release summary::-webkit-details-marker { display:none; }
  .whats-new-release summary h3 { margin:0; }
  .whats-new-release summary:hover h3 { color:var(--ui-accent); }
  .whats-new-release summary:focus-visible { outline:2px solid var(--ui-accent); outline-offset:4px; }
  .whats-new-chevron { margin-left:auto; color:var(--ui-text-secondary); font-size:12px; transition:transform .2s ease; }
  .whats-new-release[open] .whats-new-chevron { transform:rotate(180deg); }
  .whats-new-release[open] > :is(ul, .whats-new-run-list) { margin-top:8px; }
  .whats-new-release summary h3 { flex-wrap:wrap; row-gap:2px; }
  .whats-new-count { color:var(--ui-text-secondary); font-size:12.5px; font-weight:600; }
  /* Inside a run of patches: each one's number and day, then its notes, in a plain list. */
  .whats-new-run-list { display:grid; gap:10px; }
  .whats-new-run-head { margin:0 0 4px; color:var(--ui-text); font-size:13.5px; line-height:1.45; }
  .whats-new-run-head b { font-weight:800; }
  .whats-new-run-head time { margin-left:4px; color:var(--ui-text-secondary); font-size:12px; font-weight:600; }
  .whats-new-run-small { color:var(--ui-text-secondary); }
  .whats-new-run-item:has(.whats-new-run-small) .whats-new-run-head { margin:0; }
  @media (prefers-reduced-motion: reduce) { .whats-new-chevron { transition:none; } }
  #profile-account .profile-legal { margin-top:18px; font-size:12px; }
  .profile-legal a, #auth-legal a { color:inherit; text-underline-offset:2px; }
  /* Language, theme and city as radio cards, like the mall interiors in the new-wishlist dialog. */
  .choice-group { min-width:0; margin:20px 0 0; padding:0; border:0; }
  #profile-settings .choice-group { margin:0 0 6px; }
  .choice-group legend {
    margin-bottom:10px; padding:0; color:var(--ui-text); font-size:13px; line-height:1.3; font-weight:750;
  }
  .choice-options { display:grid; gap:10px; }
  .language-options { grid-template-columns:repeat(2, minmax(0, 220px)); }
  .theme-options { grid-template-columns:repeat(3, minmax(0, 1fr)); }
  .city-options { grid-template-columns:repeat(4, minmax(0, 1fr)); }
  .choice-option { position:relative; display:block; min-width:0; cursor:pointer; }
  .choice-option[hidden] { display:none; }
  .choice-option input {
    position:absolute; width:1px; height:1px; margin:0; opacity:0; pointer-events:none;
  }
  .choice-card {
    position:relative; display:block; height:100%; overflow:hidden;
    border:1px solid var(--ui-border); border-radius:13px;
    background:var(--ui-surface); color:var(--ui-text);
    transition:border-color .16s ease, box-shadow .16s ease, transform .16s ease;
  }
  .choice-option:hover .choice-card { transform:translateY(-2px); }
  .choice-option input:focus-visible + .choice-card {
    outline:2px solid color-mix(in srgb, var(--ui-accent) 58%, transparent); outline-offset:2px;
  }
  .choice-option input:checked + .choice-card {
    border-color:var(--ui-accent); box-shadow:0 0 0 2px var(--ui-accent-soft);
  }
  .choice-copy { display:block; padding:10px 32px 11px 11px; }
  .choice-copy strong { display:block; font-size:13px; line-height:1.25; font-weight:700; }
  .choice-copy small {
    display:block; margin-top:3px; color:var(--ui-text-secondary);
    font-size:11.5px; line-height:1.35; font-weight:500;
  }
  .choice-copy small i { font-size:10px; color:var(--ui-accent); }
  .choice-check {
    position:absolute; right:9px; bottom:11px; width:18px; height:18px;
    display:grid; place-items:center; border-radius:50%;
    background:var(--ui-accent); color:#fff; font-size:9px;
    opacity:0; transform:scale(.75); transition:opacity .16s ease, transform .16s ease;
  }
  .choice-option input:checked + .choice-card .choice-check { opacity:1; transform:scale(1); }
  @media (prefers-reduced-motion: reduce) {
    .choice-card, .choice-check { transition:none; }
    .choice-option:hover .choice-card { transform:none; }
  }
  /* Language: a letter badge and the name in one row. */
  .language-card { display:flex; align-items:center; gap:10px; min-height:52px; padding-left:10px; }
  .language-card .choice-copy { padding:0 34px 0 0; }
  .language-card .choice-copy strong { font-size:14px; }
  .language-card .choice-check { top:50%; bottom:auto; margin-top:-9px; }
  .language-badge {
    display:grid; place-items:center; flex:none; width:32px; height:32px; border-radius:9px;
    background:var(--ui-surface-subtle); color:var(--ui-text-secondary);
    font-size:12.5px; font-weight:800; letter-spacing:.02em;
    transition:background-color .16s ease, color .16s ease;
  }
  .choice-option input:checked + .language-card .language-badge { background:var(--ui-accent-soft); color:var(--ui-accent); }
  /* Theme: a tiny window of the app in each colour. */
  .theme-preview {
    position:relative; display:block; height:76px; overflow:hidden;
    border-bottom:1px solid var(--ui-border);
  }
  .theme-preview.light { background:linear-gradient(180deg, #cfe6f5, #f6efe2); }
  .theme-preview.dark { background:linear-gradient(180deg, #121a2c, #263048); }
  .theme-preview.system { background:linear-gradient(135deg, #cfe6f5 0 50%, #121a2c 50% 100%); }
  .theme-preview > span {
    position:absolute; left:16%; right:16%; top:20%; bottom:-8px; border-radius:8px 8px 0 0;
    box-shadow:0 4px 14px rgba(18,24,40,.18);
  }
  .theme-preview > span::before, .theme-preview > span::after {
    content:""; position:absolute; left:12%; height:6px; border-radius:3px;
  }
  .theme-preview > span::before { top:22%; width:46%; }
  .theme-preview > span::after { top:46%; width:70%; height:5px; opacity:.6; }
  .theme-preview.light > span { background:#fff; }
  .theme-preview.light > span::before { background:#76974E; }
  .theme-preview.light > span::after { background:#c9cfd8; }
  .theme-preview.dark > span { background:#181c23; }
  .theme-preview.dark > span::before { background:#9dbb76; }
  .theme-preview.dark > span::after { background:#3a4250; }
  .theme-preview.system > span { background:linear-gradient(135deg, #fff 0 50%, #181c23 50% 100%); }
  .theme-preview.system > span::before { background:linear-gradient(135deg, #76974E 0 50%, #9dbb76 50%); }
  .theme-preview.system > span::after { background:linear-gradient(90deg, #c9cfd8 0 50%, #3a4250 50%); }
  /* City: the skyline itself on its sky, day or night like the street behind. */
  .city-preview {
    display:block; aspect-ratio:16 / 10; overflow:hidden; border-bottom:1px solid var(--ui-border);
    background:linear-gradient(180deg, #bcdcf1 0%, #e9f1f2 70%, #f4ecdc 100%);
  }
  html[data-theme="dark"] .city-preview { background:linear-gradient(180deg, #0b1324 0%, #1b2742 70%, #2b3150 100%); }
  .choice-thumb { display:block; width:100%; height:100%; object-fit:cover; object-position:center bottom; }
  .home-card {
    background:rgba(255,252,245,.88); border:1px solid rgba(122,92,62,.15); border-radius:24px;
    box-shadow:0 18px 60px rgba(68,48,25,.13); backdrop-filter:blur(10px);
  }
  #signed-out { max-width:550px; margin:8vh auto 0; padding:36px; text-align:center; }
  #signed-out h1 { font-family:var(--ui-heading-font); font-size:34px; font-weight:var(--ui-heading-weight); }
  #signed-out p { color:#806d53; line-height:1.55; margin:12px auto 22px; max-width:430px; }
  #auth-form { display:flex; gap:9px; max-width:430px; margin:0 auto; }
  #auth-form input, #list-form input {
    flex:1; min-width:0; padding:12px 13px; border:1px solid #d7c4a3; border-radius:11px;
    background:#fff; color:#3c3226; font-size:15px;
  }
  #auth-form input:focus, #list-form input:focus { outline:2px solid rgba(217,165,78,.48); border-color:#d9a54e; }
  #auth-status { min-height:20px; margin-top:13px; color:#7a684f; font-size:13px; }
  /* Turnstile: hidden while the check passes by itself; a click only when Cloudflare asks. */
  #auth-captcha { max-width:430px; margin:0 auto; }
  #auth-captcha.is-asking { margin-top:12px; }
  #auth-status.error { color:#b14331; }
  #auth-status.sent, #auth-status.error,
  html[data-theme="dark"] #auth-status.sent, html[data-theme="dark"] #auth-status.error {
    display:flex; align-items:flex-start; gap:10px; max-width:430px; margin:16px auto 0; padding:13px 15px;
    border:1px solid; border-radius:13px; text-align:left; font-size:15px; font-weight:650; line-height:1.4;
  }
  #auth-status.sent::before, #auth-status.error::before {
    flex:none; margin-top:2px; font:900 16px/1 "Font Awesome 6 Free";
  }
  #auth-status.sent, html[data-theme="dark"] #auth-status.sent {
    background:var(--ui-success-soft); border-color:color-mix(in srgb, var(--ui-success) 30%, transparent);
    color:var(--ui-text);
  }
  #auth-status.sent::before { content:'\f0e0'; color:var(--ui-success); }
  #auth-status.sent span { min-width:0; overflow-wrap:anywhere; }
  #auth-status.sent b { font-weight:800; }
  #auth-status.error, html[data-theme="dark"] #auth-status.error {
    background:var(--ui-danger-soft); border-color:color-mix(in srgb, var(--ui-danger) 28%, transparent);
    color:var(--ui-danger);
  }
  #auth-status.error::before { content:'\f071'; }
  #file-warning {
    display:none; margin:18px auto 0; padding:10px 12px; max-width:450px; border-radius:10px;
    background:#fff0cd; color:#765523; font-size:12px; line-height:1.45;
  }
  #demo-link { display:inline-block; margin-top:12px; color:#887154; font-size:12px; }
  /* Where the email is asked for, so the terms and privacy policy are a click away. */
  #auth-legal { display:block; max-width:400px; margin:12px auto 0; color:var(--ui-text-secondary); font-size:12px; line-height:1.45; }
  .dash-head { display:flex; align-items:center; justify-content:space-between; gap:20px; margin:24px 0; }
  .dash-head h1 { font-family:var(--ui-heading-font); font-size:34px; font-weight:var(--ui-heading-weight); }
  .dash-head p { margin-top:5px; color:#947d60; font-size:13px; }
  .dash-actions { display:flex; align-items:center; gap:9px; }
  #dashboard-profile-link {
    min-width:0; min-height:48px; align-self:stretch; display:flex; align-items:center; gap:9px; padding:3px 3px 3px 12px;
    border:none; border-radius:24px; background:rgba(116,85,56,.08); color:#68543d; cursor:pointer;
  }
  #dashboard-profile-link[hidden] { display:none; }
  #dashboard-profile-link:hover { background:rgba(116,85,56,.15); }
  #dashboard-profile-label { max-width:190px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:12px; font-weight:700; }
  .dashboard-avatar {
    width:38px; height:38px; flex-shrink:0; display:grid; place-items:center; overflow:hidden;
    border-radius:50%; background:#e8dcc7; color:#8f7759; font-size:16px;
  }
  .dashboard-avatar img { width:100%; height:100%; display:block; object-fit:cover; }
  .dashboard-avatar img[hidden], .dashboard-avatar i[hidden] { display:none; }
  :is(#dashboard-empty, #archive-empty, .public-profile-message) { padding:58px 25px; text-align:center; }
  :is(#dashboard-empty, #archive-empty, .public-profile-message) .paw { font-size:38px; margin-bottom:10px; }
  :is(#dashboard-empty, #archive-empty, .public-profile-message) h2 { font-size:18px; }
  :is(#dashboard-empty, #archive-empty, .public-profile-message) p { color:#947d60; font-size:13px; margin-top:7px; }
  :is(#dashboard-status, #archive-status, #public-profile-status) { color:#806d53; font-size:13px; padding:18px 2px; }
  #profile-view { max-width:760px; margin:24px auto 0; }
  .profile-head { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:18px; }
  .profile-head-actions { display:flex; align-items:center; gap:8px; }
  .profile-head h1 { font-family:var(--ui-heading-font); font-size:34px; font-weight:var(--ui-heading-weight); }
  .profile-head p { margin-top:5px; color:#947d60; font-size:13px; }
  .profile-head button i, .dash-actions button i { margin-right:6px; }
  #profile-form { padding:28px; }
  .profile-layout { display:grid; grid-template-columns:180px minmax(0,1fr); gap:30px; align-items:start; }
  .profile-avatar-panel { display:flex; flex-direction:column; align-items:center; gap:10px; text-align:center; }
  .profile-avatar {
    width:136px; height:136px; display:grid; place-items:center; overflow:hidden; border-radius:50%;
    border:4px solid rgba(255,255,255,.86); background:#e8dac1; color:#9c866a; font-size:46px;
    box-shadow:0 10px 28px rgba(73,52,29,.17);
  }
  .profile-avatar img { width:100%; height:100%; display:block; object-fit:cover; }
  .profile-avatar img[hidden] { display:none; }
  .profile-avatar-actions { display:flex; flex-direction:column; gap:7px; width:100%; }
  .profile-avatar-actions label { display:block; }
  .profile-avatar-actions label.is-disabled { opacity:.5; cursor:not-allowed; pointer-events:none; }
  .profile-avatar-actions .quiet-btn, .profile-avatar-actions .danger-btn { width:100%; }
  #avatar-remove-btn[hidden] { display:none; }
  #avatar-input { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
  .avatar-hint { color:#9a8264; font-size:11px; line-height:1.4; }
  .profile-fields { display:grid; gap:17px; }
  .profile-field { display:grid; gap:7px; color:#65533e; font-size:13px; font-weight:700; }
  .profile-field input, .profile-field textarea {
    width:100%; padding:12px 13px; border:1px solid #d7c4a3; border-radius:11px;
    background:#fff; color:#3c3226; font:inherit; font-size:15px; font-weight:400;
  }
  .profile-field input:focus, .profile-field textarea:focus { outline:2px solid rgba(217,165,78,.48); border-color:#d9a54e; }
  .profile-field input[readonly] { background:rgba(232,220,198,.43); color:#806d53; cursor:default; }
  .profile-field textarea { min-height:116px; resize:vertical; line-height:1.5; }
  .profile-field-meta { display:flex; justify-content:space-between; gap:12px; color:#9a8264; font-size:11px; font-weight:400; }
  .profile-footer { display:flex; align-items:center; justify-content:flex-end; gap:16px; margin-top:24px; padding-top:21px; border-top:1px solid rgba(122,92,62,.13); }
  #profile-status { flex:1; min-height:20px; color:#6f805d; font-size:13px; }
  #profile-status.error { color:#b14331; }

  html[data-theme="dark"] #home {
    color:#f2eadc;
    background:
      radial-gradient(900px 520px at 15% 0%, rgba(93,119,158,.24), transparent 70%),
      radial-gradient(720px 500px at 95% 20%, rgba(76,112,91,.18), transparent 70%),
      linear-gradient(145deg,#111a28,#0b111b);
  }
  html[data-theme="dark"] body.ods-active #home { background:none; }
  html[data-theme="dark"] .dash-head p,
  html[data-theme="dark"] .profile-head p,
  html[data-theme="dark"] :is(#dashboard-empty, #archive-empty, .public-profile-message) p,
  html[data-theme="dark"] .avatar-hint,
  html[data-theme="dark"] .profile-field-meta { color:#b5a68f; }
  html[data-theme="dark"] #dashboard-profile-link {
    background:rgba(230,210,176,.09); color:#eee4d3; border:1px solid rgba(230,210,176,.08);
  }
  html[data-theme="dark"] #dashboard-profile-link:hover { background:rgba(230,210,176,.15); }
  html[data-theme="dark"] .dashboard-avatar {
    background:#2a3443; color:#c6b69d; box-shadow:inset 0 0 0 1px rgba(255,255,255,.07);
  }
  html[data-theme="dark"] .home-card {
    background:rgba(18,25,37,.9); border-color:rgba(232,206,162,.13);
    box-shadow:0 18px 60px rgba(0,0,0,.28);
  }
  html[data-theme="dark"] #signed-out p,
  html[data-theme="dark"] #auth-status,
  html[data-theme="dark"] :is(#dashboard-status, #archive-status, #public-profile-status) { color:#b9aa92; }
  html[data-theme="dark"] #demo-link { color:#d7bd8f; }
  html[data-theme="dark"] .profile-field { color:#d9cbb6; }
  html[data-theme="dark"] .profile-field input[readonly] { background:#192230; color:#aeb8c5; }
  html[data-theme="dark"] .profile-avatar {
    border-color:rgba(203,216,234,.2); background:#263244; color:#acb8c8;
    box-shadow:0 10px 28px rgba(0,0,0,.32);
  }
  html[data-theme="dark"] .profile-footer { border-top-color:rgba(230,210,176,.12); }
  html[data-theme="dark"] #file-warning { background:#3a2e18; color:#f0d9a7; }
@media (max-width: 880px) {
    .home-shell { width:min(100% - 22px, 720px); padding-top:18px; }
    #signed-out { margin-top:3vh; padding:27px 20px; }
    #signed-out h1, .dash-head h1 { font-size:28px; }
    #auth-form { flex-direction:column; }
    .dash-head { align-items:flex-start; flex-direction:column; }
    .dash-actions { width:100%; flex-wrap:wrap; }
    .dash-actions #create-list-btn { order:-1; flex:1; }
    .home-top { padding:20px 20px 0; }
    #dashboard-profile-label { max-width:90px; }
    #profile-view { margin-top:14px; }
    .profile-head { align-items:flex-start; flex-direction:column; }
    .profile-head-actions { width:100%; }
    .profile-head-actions button { flex:1; }
    .profile-head h1 { font-size:28px; }
    #profile-form { padding:22px 18px; }
    #profile-tabs button { gap:6px; padding:9px 8px; font-size:13px; }
    .profile-layout { grid-template-columns:1fr; gap:24px; }
    .profile-avatar-panel { max-width:220px; margin:0 auto; }
    .profile-field input, .profile-field textarea { font-size:16px; }
    .profile-footer { align-items:stretch; flex-direction:column; }
    .profile-footer .primary-btn { width:100%; }
}
  #home {
    color:var(--ui-text);
    background:
      radial-gradient(900px 540px at -5% -5%, rgba(118,151,78,.10), transparent 68%),
      radial-gradient(760px 520px at 105% 14%, rgba(107,126,164,.10), transparent 70%),
      var(--ui-bg);
  }
  body.home:not(.ods-active), html[data-theme="dark"] body { background:var(--ui-bg); }
  html[data-theme="dark"] #home {
    color:var(--ui-text);
    background:
      radial-gradient(880px 520px at -5% -5%, rgba(118,151,78,.12), transparent 68%),
      radial-gradient(760px 520px at 105% 14%, rgba(90,111,154,.13), transparent 70%),
      var(--ui-bg);
  }
  body.ods-active #home,
  html[data-theme="dark"] body.ods-active #home { background:none; }
  .home-shell { width:min(1080px, calc(100% - 40px)); padding:24px 0 80px; }
  .home-wordmark { color:var(--ui-text); }
  .home-tagline { color:var(--ui-text-secondary); }
  #profile-settings p, #profile-appearance p, #profile-account p, #profile-form .profile-panel-intro { color:var(--ui-text-secondary); }
  #profile-account b { color:var(--ui-text); font-weight:650; }
  /* An on/off switch for settings that are a yes or a no. */
  .profile-toggle {
    display:flex; align-items:flex-start; gap:12px; margin-top:20px; padding-top:18px;
    border-top:1px solid var(--ui-border); cursor:pointer;
  }
  .profile-toggle input {
    position:relative; flex:none; width:44px; height:26px; margin:1px 0 0; border-radius:99px;
    background:var(--ui-border); appearance:none; -webkit-appearance:none; cursor:pointer;
    transition:background .18s ease;
  }
  .profile-toggle input::after {
    content:''; position:absolute; top:3px; left:3px; width:20px; height:20px; border-radius:50%;
    background:#fff; box-shadow:0 1px 3px rgba(0,0,0,.25); transition:transform .18s ease;
  }
  .profile-toggle input:checked { background:var(--ui-accent); }
  .profile-toggle input:checked::after { transform:translateX(18px); }
  .profile-toggle input:focus-visible { outline:none; box-shadow:0 0 0 3px var(--ui-focus); }
  .profile-toggle input:disabled { opacity:.6; cursor:wait; }
  .profile-toggle[hidden] { display:none; }
  .profile-toggle-copy { display:grid; gap:3px; }
  .profile-toggle-copy b { color:var(--ui-text); font-size:14px; font-weight:700; }
  .profile-toggle-copy small { color:var(--ui-text-secondary); font-size:12.5px; line-height:1.4; }
  /* Under the public profile switch: open the page or share it. */
  .profile-public-actions { display:flex; flex-wrap:wrap; gap:8px; margin:12px 0 0 56px; }
  .profile-public-actions[hidden] { display:none; }
  .profile-public-actions a { text-decoration:none; }
  .profile-public-actions i { margin-right:6px; }
  /* Under the public profile switch: the page's nickname, murrmall.io/u/<nickname>. */
  .profile-nickname { display:grid; gap:7px; margin:14px 0 0 56px; }
  .profile-nickname[hidden] { display:none; }
  .profile-nickname > label { color:var(--ui-text); font-size:13px; font-weight:700; }
  .profile-nickname-row { display:flex; flex-wrap:wrap; gap:8px; }
  .profile-nickname-input {
    display:flex; align-items:center; flex:1 1 220px; min-width:0; padding:0 0 0 12px;
    border:1px solid var(--ui-border); border-radius:11px; background:var(--ui-surface);
  }
  /* The frame is the field: it takes the focus ring the other fields draw, the input none. */
  .profile-nickname-input:focus-within { border-color:var(--ui-accent); box-shadow:0 0 0 3px var(--ui-focus); }
  .profile-nickname-input input:focus, .profile-nickname-input input:focus-visible { outline:none; box-shadow:none; }
  .profile-nickname-prefix { flex:none; color:var(--ui-text-secondary); font-size:14px; }
  .profile-nickname-input input {
    flex:1; min-width:0; padding:11px 12px 11px 1px; border:0; background:none;
    color:var(--ui-text); font:inherit; font-size:14px; outline:none;
  }
  #profile-settings .profile-nickname-status { min-height:1.4em; margin:0; font-size:12.5px; }
  #profile-settings .profile-nickname-status[data-tone="ok"] { color:var(--ui-success); }
  #profile-settings .profile-nickname-status[data-tone="error"] { color:var(--ui-danger); }
  #profile-settings .profile-nickname-hint { margin:0; font-size:12px; line-height:1.4; }
  #profile-settings .profile-nickname-limit { margin:0; color:var(--ui-warning); font-size:12.5px; line-height:1.4; }
  .profile-nickname-limit[hidden] { display:none; }
  /* No room is kept for the check's answer until there is one: the empty line folds away
     with one of the gaps around it, and stays in place for screen readers to announce. */
  #profile-settings .profile-nickname-status:empty { min-height:0; margin-bottom:-7px; }
  .profile-nickname-input:has(input:disabled) { opacity:.6; }
  /* The same switch in the wishlist dialog, where the form's own input rules would
     otherwise draw it as a text field. */
  #list-form .list-profile-toggle {
    margin:4px 0 16px; padding:0; border:0; color:inherit; font-size:inherit; font-weight:400;
  }
  #list-form .list-profile-toggle input,
  html[data-theme="dark"] #list-form .list-profile-toggle input {
    flex:none; width:44px; height:26px; min-height:0; margin:1px 0 0; padding:0; border:0;
    border-radius:99px; background:var(--ui-border); box-shadow:none; appearance:none; -webkit-appearance:none;
  }
  #list-form .list-profile-toggle input:checked,
  html[data-theme="dark"] #list-form .list-profile-toggle input:checked { background:var(--ui-accent); }
  /* Under a switch that is waiting on something: why, and a way to sort it out. */
  .profile-toggle-note {
    display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 10px;
    margin:10px 0 0 56px; color:var(--ui-warning); font-size:12.5px; line-height:1.4;
  }
  .profile-toggle-note[hidden] { display:none; }
  #profile-settings .profile-toggle-note { margin-top:10px; font-size:12.5px; color:var(--ui-warning); }
  .profile-toggle-note button {
    padding:0; border:0; background:none; font:inherit; font-weight:700; color:var(--ui-accent);
    text-decoration:underline; text-underline-offset:2px; cursor:pointer;
  }
  .profile-toggle-note button:focus-visible { outline:2px solid var(--ui-accent); outline-offset:2px; border-radius:3px; }

  #dashboard-profile-link,
  html[data-theme="dark"] #dashboard-profile-link {
    min-height:46px; border:1px solid transparent; border-radius:999px;
    background:var(--pill); color:var(--pill-text); box-shadow:var(--pill-ring);
    transition:background .15s ease, transform .12s ease;
  }
  #dashboard-profile-link:hover,
  html[data-theme="dark"] #dashboard-profile-link:hover {
    background:var(--pill-hover); border-color:transparent; color:var(--pill-text);
  }
  #dashboard-profile-link:active { transform:scale(.97); }
  .profile-field option { background:var(--ui-surface); color:var(--ui-text); }
  #dashboard-profile-link { min-height:46px; padding:4px 5px 4px 15px; }
  #dashboard-profile-label { font-size:13px; font-weight:650; }
  .dashboard-avatar,
  html[data-theme="dark"] .dashboard-avatar {
    width:36px; height:36px; background:var(--ui-accent-soft); color:var(--ui-accent);
    box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--ui-accent) 15%, transparent);
  }

  .home-card,
  html[data-theme="dark"] .home-card {
    background:color-mix(in srgb, var(--ui-surface) 97%, transparent);
    border:1px solid var(--ui-border); border-radius:var(--ui-radius);
    box-shadow:var(--ui-shadow-sm); backdrop-filter:blur(14px);
  }
  #signed-out {
    max-width:590px; margin:7vh auto 0; padding:46px 48px 42px; position:relative; overflow:hidden;
  }
  #signed-out::before {
    content:""; position:absolute; box-sizing:border-box; width:150px; height:150px; top:-128px; right:-66px;
    border:28px solid var(--ui-accent-soft); border-radius:50%; pointer-events:none;
  }
  #signed-out h1,
  .dash-head h1,
  .profile-head h1 {
    color:var(--ui-text); font-family:var(--ui-heading-font);
    font-weight:var(--ui-heading-weight); letter-spacing:-.65px;
  }
  #signed-out h1 { font-size:38px; line-height:1.08; }
  #signed-out p,
  html[data-theme="dark"] #signed-out p {
    max-width:440px; margin:15px auto 27px; color:var(--ui-text-secondary);
    font-size:16px; line-height:1.6;
  }
  #auth-form { max-width:460px; gap:10px; }

  .dash-head { margin:24px 0 26px; align-items:flex-end; }
  .dash-head h1, .profile-head h1 { font-size:38px; line-height:1.08; }
  .dash-head p, .profile-head p,
  html[data-theme="dark"] .dash-head p,
  html[data-theme="dark"] .profile-head p {
    margin-top:8px; color:var(--ui-text-secondary); font-size:14px;
  }
  .dash-actions .primary-btn { min-height:44px; }
  /* ============ WISHLIST CARD: PHOTOS FIRST ============
     A mosaic of the wishes on top, the title under it on warm paper. No outline,
     no tint: the photos carry the colour, so the card reads on any street scene. */
  :is(#wishlists, #archived-lists, #public-profile-lists) {
    display:grid; grid-template-columns:repeat(auto-fill,minmax(292px,1fr)); gap:20px;
  }
  .wishlist-card,
  html[data-theme="dark"] .wishlist-card {
    display:flex; flex-direction:column; min-height:0; padding:8px 8px 12px;
    border:none; border-radius:16px; background:var(--card-surface); color:var(--card-ink);
    box-shadow:var(--card-rest); -webkit-backdrop-filter:none; backdrop-filter:none;
    transition:box-shadow .2s ease;
  }
  .wishlist-card:not(.archived):hover,
  html[data-theme="dark"] .wishlist-card:not(.archived):hover { box-shadow:var(--card-rest), var(--card-lift); }
  .wishlist-open,
  div.wishlist-open {
    width:100%; flex:1; display:flex; flex-direction:column; padding:0;
    border:none; border-radius:10px; background:none; color:inherit; text-align:left; cursor:pointer;
  }
  /* An archived card is not a link: its wishlist is closed until it is restored. */
  div.wishlist-open { cursor:default; }
  .wishlist-open h2,
  html[data-theme="dark"] .wishlist-open h2 {
    margin:14px 8px 0; color:var(--card-ink); overflow-wrap:anywhere;
    font-family:var(--card-font); font-size:21px; font-weight:600; line-height:1.2;
  }
  .wishlist-open p,
  html[data-theme="dark"] .wishlist-open p { margin:4px 8px 0; color:var(--card-soft); font-size:13px; }
  .wishlist-open .wishlist-description {
    display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden;
    line-height:1.45; overflow-wrap:anywhere;
  }

  /* Cover: one big photo and two small ones; one or two photos take the room. */
  .wishlist-preview {
    order:-1; width:100%; margin:0;
    display:grid; gap:4px;
    /* minmax(0, …) so a large photo can't stretch its track past the cover. */
    grid-template-columns:minmax(0, 2fr) minmax(0, 1fr); grid-template-rows:minmax(0, 1fr) minmax(0, 1fr);
    aspect-ratio:16 / 10; border-radius:10px; overflow:hidden; background:var(--card-cover);
  }
  /* No dark-theme twin here: the colours come from tokens, and a twin would outrank
     the :nth-child rule below and let tiles four to six back into the cover. */
  .wishlist-preview-tile {
    width:100%; height:100%; min-width:0; min-height:0; display:grid; place-items:center; overflow:hidden;
    background:var(--card-cover); color:var(--card-soft); font-size:18px;
  }
  .wishlist-preview-tile:first-child { grid-row:1 / 3; }
  .wishlist-preview-tile:only-child { grid-column:1 / -1; }
  .wishlist-preview-tile:nth-child(2):last-child { grid-row:1 / 3; }
  .wishlist-preview > .wishlist-preview-tile:nth-child(n+4) { display:none; }
  .wishlist-preview-tile img { width:100%; height:100%; display:block; object-fit:cover; transition:transform .5s ease; }
  .wishlist-card:not(.archived):hover .wishlist-preview-tile img { transform:scale(1.035); }
  /* Nothing pictured yet: a ginger cat asleep in the empty frame. */
  .wishlist-preview-empty {
    grid-template-columns:1fr; grid-template-rows:1fr; place-items:end center; background:var(--card-empty);
  }
  .wishlist-preview-empty img { width:58%; height:auto; transform:translateY(10%); }

  /* Actions: pills in the card's own warm tint rather than white on white. */
  .wishlist-card-actions {
    display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-top:12px; padding:0 4px; border-top:none;
  }
  .wishlist-card-actions :is(.quiet-btn, .danger-btn) { min-height:38px; padding:0 16px; font-size:13px; }
  .wishlist-card-actions .quiet-btn,
  html[data-theme="dark"] .wishlist-card-actions .quiet-btn {
    background:var(--card-tint); color:var(--card-ink); box-shadow:none;
  }
  .wishlist-card-actions .quiet-btn:hover,
  html[data-theme="dark"] .wishlist-card-actions .quiet-btn:hover {
    background:color-mix(in srgb, var(--card-ink) 11%, var(--card-surface)); color:var(--card-ink);
  }
  .wishlist-card-actions .icon-only { width:38px; min-width:38px; padding:0; }
  .wishlist-card-actions :is(.archive-list, .delete-list) { margin-left:auto; }
  .wishlist-card.archived .wishlist-preview { opacity:.75; filter:grayscale(.8); }
  /* ============ PUBLIC PROFILE (?u=) ============
     The owner's card on top, their marked wishlists under it. */
  #public-profile { max-width:1080px; margin:24px auto 0; }
  #public-profile[hidden] { display:none; }
  a.wishlist-open { text-decoration:none; }
  .public-profile-own {
    display:flex; flex-wrap:wrap; align-items:center; gap:6px 8px; margin:0 0 14px; padding:10px 14px;
    border-radius:12px; background:var(--ui-accent-soft, rgba(122,92,62,.1)); color:var(--ui-text, #46392a); font-size:13px;
  }
  .public-profile-own[hidden] { display:none; }
  .public-profile-own a { color:var(--ui-accent, #745538); font-weight:700; }
  .public-profile-card {
    display:grid; grid-template-columns:auto minmax(0, 1fr) auto; align-items:center; gap:22px;
    padding:24px 26px; margin-bottom:26px;
  }
  .public-profile-card[hidden] { display:none; }
  .public-profile-avatar {
    width:104px; height:104px; display:grid; place-items:center; overflow:hidden; border-radius:50%;
    border:4px solid rgba(255,255,255,.86); background:#e8dac1; color:#9c866a; font-size:38px;
    box-shadow:0 10px 28px rgba(73,52,29,.17);
  }
  .public-profile-avatar img { width:100%; height:100%; display:block; object-fit:cover; }
  .public-profile-avatar [hidden] { display:none; }
  .public-profile-copy { min-width:0; }
  #public-profile-name {
    margin:0; color:var(--ui-text); font-family:var(--ui-heading-font); font-size:32px;
    font-weight:var(--ui-heading-weight); line-height:1.1; overflow-wrap:anywhere;
  }
  .public-profile-birthday {
    display:inline-flex; align-items:center; gap:7px; margin-top:8px; padding:4px 12px 4px 6px;
    border-radius:999px; background:var(--ui-accent-soft, rgba(122,92,62,.1)); color:var(--ui-text);
    font-size:13px; font-weight:700;
  }
  .public-profile-birthday[hidden] { display:none; }
  .public-profile-birthday img { width:24px; height:24px; }
  .public-profile-bio {
    margin-top:10px; color:var(--ui-text-secondary, #806d53); font-size:14px; line-height:1.55;
    white-space:pre-line; overflow-wrap:anywhere;
  }
  .public-profile-bio[hidden] { display:none; }
  #public-profile-share { align-self:start; }
  #public-profile-share i { margin-right:6px; }
  .public-profile-lists-heading {
    margin:0 2px 14px; color:var(--ui-text); font-family:var(--ui-heading-font); font-size:22px;
    font-weight:var(--ui-heading-weight);
  }
  .public-profile-lists-heading[hidden], .public-profile-message[hidden] { display:none; }
  /* By id: the button styles would otherwise keep it inline at the left edge. */
  #public-profile-create { display:flex; width:max-content; margin:26px auto 0; text-decoration:none; }
  #public-profile-create[hidden] { display:none; }
  html[data-theme="dark"] .public-profile-avatar {
    border-color:rgba(203,216,234,.2); background:#263244; color:#acb8c8; box-shadow:0 10px 28px rgba(0,0,0,.32);
  }
  @media (max-width: 640px) {
    #public-profile { margin-top:16px; }
    .public-profile-card { grid-template-columns:auto minmax(0, 1fr); gap:14px 16px; padding:18px; }
    .public-profile-avatar { width:72px; height:72px; font-size:28px; }
    #public-profile-name { font-size:24px; }
    #public-profile-share { grid-column:1 / -1; justify-self:start; }
  }
  .dash-footer-actions { display:flex; flex-wrap:wrap; gap:10px; margin-top:22px; }
  /* The icons share the row as one pill, the height of the buttons beside them. */
  .dash-social { min-height:44px; padding:0 4px; border-radius:999px; background:var(--pill); box-shadow:var(--pill-ring); }
  /* The same version line at the far right of the «Оставить отзыв» row, so the «новое» tag
     is seen without opening Settings. */
  .dash-version {
    align-self:flex-start; margin:0 0 0 auto; padding:4px 12px; border-top:0; border-radius:999px;
    background:var(--pill); box-shadow:var(--pill-ring);
  }
  /* A phone has no room for it in the row: it wraps, and sits on the left under the buttons. */
  @media (max-width: 640px) { .dash-version { margin-left:0; } }
  #archive-link[hidden] { display:none; }
  /* The install offer is for a touch screen, where shops' apps have a share sheet. */
  #install-app { position:relative; margin-top:22px; padding:20px 52px 20px 20px; }
  #install-app[hidden], .profile-install[hidden] { display:none; }
  @media not (pointer: coarse) { #install-app, .profile-install { display:none; } }
  #install-app h2 { margin:0 0 6px; font-size:17px; }
  #install-app p { margin:0 0 14px; color:var(--ui-text-secondary); font-size:13.5px; line-height:1.45; }
  #install-app .install-app-btn { width:100%; }
  .install-app-close { position:absolute; top:12px; right:12px; }
  .profile-install { margin-top:20px; padding-top:18px; border-top:1px solid var(--ui-border); }
  .profile-install-row { display:grid; gap:12px; }
  /* The bookmark button needs a bookmarks bar and a mouse to drag it there. */
  #bookmarklet, #profile-bookmarklet { display:none; }
  @media (hover: hover) and (pointer: fine) and (min-width: 900px) {
    #bookmarklet {
      position:relative; display:flex; align-items:center; justify-content:space-between; gap:24px;
      margin-top:22px; padding:20px 64px 20px 24px;
    }
    #bookmarklet[hidden] { display:none; }
    #bookmarklet h2 { margin:0 0 6px; font-size:17px; }
    #bookmarklet p { margin:0; color:var(--ui-text-secondary); font-size:13.5px; line-height:1.45; }
    #bookmarklet .bookmarklet-hint { margin-top:4px; font-size:12.5px; }
    .bookmarklet-close { position:absolute; top:12px; right:12px; }
    #profile-bookmarklet { display:block; margin-top:20px; padding-top:18px; border-top:1px solid var(--ui-border); }
    .profile-bookmarklet-row { display:flex; align-items:center; justify-content:space-between; gap:20px; }
    .bookmarklet-status:not(:empty) { margin-top:8px; color:var(--ui-accent); font-weight:700; font-size:13px; }
    .bookmarklet-link { flex-shrink:0; cursor:grab; text-decoration:none; white-space:nowrap; }
  }
  #archive-empty .paw i { font-size:24px; }
  :is(#dashboard-empty, #archive-empty, .public-profile-message) { padding:66px 28px; }
  :is(#dashboard-empty, #archive-empty, .public-profile-message) .paw {
    width:60px; height:60px; display:grid; place-items:center; margin:0 auto 17px;
    border-radius:20px; background:var(--ui-accent-soft); color:var(--ui-accent); font-size:27px;
  }
  :is(#dashboard-empty, #archive-empty, .public-profile-message) h2 { color:var(--ui-text); font-family:var(--ui-subheading-font); font-size:24px; }
  :is(#dashboard-empty, #archive-empty, .public-profile-message) p,
  html[data-theme="dark"] :is(#dashboard-empty, #archive-empty, .public-profile-message) p { margin-top:8px; color:var(--ui-text-secondary); font-size:14px; }

  #profile-view { max-width:820px; }
  .profile-head { margin-bottom:22px; }
  #profile-form, #profile-settings, #profile-appearance, #profile-account { padding:34px; }
  .profile-layout { grid-template-columns:190px minmax(0,1fr); gap:38px; }
  .profile-avatar {
    width:142px; height:142px; border:5px solid var(--ui-surface);
    background:var(--ui-accent-soft); color:var(--ui-accent);
    box-shadow:0 0 0 1px var(--ui-border), 0 16px 34px rgba(18,24,40,.10);
  }
  html[data-theme="dark"] .profile-avatar {
    border-color:var(--ui-surface); background:var(--ui-accent-soft); color:var(--ui-accent);
    box-shadow:0 0 0 1px var(--ui-border), 0 16px 34px rgba(0,0,0,.28);
  }
  .avatar-hint,
  .profile-field-meta,
  html[data-theme="dark"] .avatar-hint,
  html[data-theme="dark"] .profile-field-meta { color:var(--ui-text-secondary); font-size:12px; }
  .profile-fields { gap:19px; }
  .profile-field,
  html[data-theme="dark"] .profile-field {
    gap:8px; color:var(--ui-text); font-size:13px; font-weight:700; letter-spacing:.1px;
  }
  .profile-footer {
    margin-top:28px; padding-top:22px; border-top-color:var(--ui-border);
  }
  html[data-theme="dark"] .profile-footer { border-top-color:var(--ui-border); }
  #auth-status, :is(#dashboard-status, #archive-status, #public-profile-status), #profile-status { font-size:14px; }
  #file-warning, #demo-link { font-size:13px; }
  #profile-status { color:var(--ui-success); }
@media (max-width: 880px) {
    .home-shell { width:min(100% - 28px, 760px); padding-top:20px; }
    #signed-out { margin-top:3vh; padding:36px 28px 32px; }
    #signed-out h1, .dash-head h1, .profile-head h1 { font-size:32px; }
    .dash-head { align-items:flex-start; }
    :is(#wishlists, #archived-lists, #public-profile-lists) { grid-template-columns:repeat(auto-fill,minmax(260px,1fr)); }
    .profile-layout { grid-template-columns:1fr; gap:28px; }
    .profile-avatar-panel { max-width:240px; }
    /* Safari on iPhone gives a date field its own minimum width, wider than a narrow
       card; without the native look it fits the column like the other fields. */
    .profile-fields, .profile-field { min-width:0; }
    .profile-field input[type="date"] {
      display:block; min-width:0; max-width:100%; min-height:46px;
      -webkit-appearance:none; appearance:none;
    }
    .profile-field input[type="date"]::-webkit-date-and-time-value { text-align:left; }
}
@media (max-width: 560px) {
    .home-shell { width:calc(100% - 20px); padding:14px 0 52px; }
    .home-top { padding:16px 14px 0; gap:12px; }
    .home-top-actions { gap:8px; }
    .home-wordmark .brand-cats { height:42px; }
    .home-wordmark .brand-name { height:31px; }
    .home-tagline { font-size:12px; }
    #dashboard-profile-link { min-height:42px; }
    #dashboard-profile-label { display:none; }
    #dashboard-profile-link, html[data-theme="dark"] #dashboard-profile-link { padding:3px; }
    #profile-settings, #profile-appearance, #profile-account { padding:22px 17px; }
    #profile-account .danger-btn { width:100%; }
    #profile-telegram { padding:16px; }
    #profile-telegram-actions .primary-btn, #profile-telegram-actions .quiet-btn { flex:1 1 100%; }
    .profile-nickname { margin-left:0; }
    .profile-nickname-input input, .profile-nickname-prefix { font-size:16px; }
    .profile-telegram-unlink { margin-inline:auto; }
    .language-options, .city-options { grid-template-columns:repeat(2, minmax(0, 1fr)); }
    .theme-preview { height:58px; }
    .theme-options .choice-copy { padding:9px 8px 10px; }
    .theme-options .choice-copy small { display:none; }
    .theme-options .choice-check { top:8px; right:8px; bottom:auto; }
    /* Four tabs don't fit side by side on a phone: stack the icon over its label. */
    #profile-tabs { border-radius:22px; }
    #profile-tabs button {
      flex-direction:column; gap:3px; min-height:52px; padding:7px 2px;
      border-radius:18px; font-size:12px; line-height:1.15;
    }
    #profile-tabs button i { font-size:15px; }
    .dashboard-avatar { width:34px; height:34px; }
    #signed-out { padding:33px 20px 28px; border-radius:17px; }
    #signed-out h1 { font-size:30px; }
    #signed-out p { font-size:15px; }
    #auth-form { gap:9px; }
    #auth-form .primary-btn { width:100%; min-height:46px; }
    .dash-head { margin:18px 0 22px; gap:17px; }
    .dash-actions .primary-btn { width:100%; }
    :is(#wishlists, #archived-lists, #public-profile-lists) { grid-template-columns:1fr; gap:12px; }
    :is(#wishlists, #archived-lists, #public-profile-lists) { gap:14px; }
    :is(#dashboard-empty, #archive-empty, .public-profile-message) { padding:52px 20px; }
    .profile-head-actions { gap:7px; }
    .profile-head-actions button { min-width:0; padding-inline:10px; }
    #profile-form { padding:22px 17px; }
    .profile-avatar { width:126px; height:126px; }
    .profile-footer { gap:10px; }
}
@media (max-width: 640px) {
    /* Mobile keeps a comfortable form rhythm while the translucent surface
       lets the landmark band remain visible beneath the card. */
    #signed-out {
      margin-top:0; padding:26px 20px 23px;
      background:color-mix(in srgb, var(--ui-surface) 32%, transparent);
      border-color:color-mix(in srgb, var(--ui-border) 54%, transparent);
      box-shadow:0 8px 26px rgba(18,24,40,.06);
      -webkit-backdrop-filter:blur(2px) saturate(.96);
      backdrop-filter:blur(2px) saturate(.96);
    }
    html[data-theme="dark"] #signed-out { box-shadow:0 8px 28px rgba(0,0,0,.12); }
    #signed-out::before { opacity:.32; }
    #signed-out h1 {
      max-width:310px; margin-inline:auto;
      font-size:clamp(24px, 7vw, 27px); line-height:1.04; letter-spacing:-.45px;
    }
    #signed-out h1,
    #signed-out p {
      text-shadow:0 1px 1px var(--ui-surface), 0 0 14px var(--ui-surface);
    }
    #signed-out p,
    html[data-theme="dark"] #signed-out p {
      margin:12px auto 18px; font-size:13px; line-height:1.38;
    }
    #auth-form { gap:12px; }
    #auth-status { min-height:18px; margin-top:9px; }
    #auth-status:empty { min-height:12px; margin-top:0; }
    #demo-link {
      margin-top:10px; padding:5px 10px; border-radius:999px;
      background:color-mix(in srgb, var(--ui-surface) 42%, transparent);
      font-size:12px;
    }
}
@media (max-width: 640px) and (max-height: 700px) {
    .home-shell { padding-top:8px; }
    #signed-out { padding:21px 17px 20px; }
    #signed-out h1 { max-width:280px; font-size:23px; }
    #signed-out p,
    html[data-theme="dark"] #signed-out p {
      display:block; margin:10px auto 15px;
      font-size:12.5px; line-height:1.35;
    }
    #auth-form { gap:10px; }
    #auth-form input { padding-block:11px; }
    #auth-form .primary-btn { min-height:45px; }
}
@media (max-width: 360px) {
    .home-wordmark .brand-cats { height:38px; }
    .home-wordmark .brand-name { height:28px; }
    #profile-tabs { gap:2px; padding:3px; }
    #profile-tabs button { font-size:11px; letter-spacing:-.01em; }
}

/* Followish import */
#import-dlg {
  width:min(820px, calc(100vw - 32px));
  max-height:min(900px, calc(100vh - 32px));
  overflow:auto;
  overscroll-behavior:contain;
}
/* The link step is a short form: fit the dialog to it. :where keeps the phone sheet rules winning. */
#import-dlg:where(:has(#import-source-step:not([hidden]))) { width:min(720px, calc(100vw - 32px)); }
#import-dlg [hidden] { display:none !important; }
#import-dlg h2 { margin:0; }
.import-head {
  display:flex; align-items:flex-start; justify-content:space-between; gap:22px;
  margin-bottom:22px;
}
.import-title-row { display:flex; align-items:center; gap:9px; }
.import-title-row h2 { font-size:24px; }
/* A feature still in testing: the Followish import, the Telegram bot. */
.beta-tag {
  display:inline-flex; align-items:center; min-height:22px; padding:3px 8px;
  border-radius:999px; background:var(--ui-warning-soft); color:var(--ui-warning);
  font-size:11px; line-height:1; font-weight:800; letter-spacing:.08em; text-transform:uppercase;
}
.import-head p {
  max-width:650px; margin-top:8px; color:var(--ui-text-secondary);
  font-size:14px; line-height:1.5;
}
.import-hint {
  margin:7px 0 0; color:var(--ui-text-secondary); font-size:12.5px; line-height:1.45;
}
.import-status {
  min-height:20px; margin-top:12px; color:var(--ui-text-secondary);
  font-size:13px; line-height:1.4;
}
.import-status.error { color:var(--ui-danger); }
.import-summary {
  display:flex; align-items:center; justify-content:space-between; gap:18px;
  margin-bottom:18px; padding:15px 17px; border:1px solid var(--ui-border);
  border-radius:14px; background:var(--ui-surface-subtle);
}
.import-summary > div { min-width:0; display:flex; flex-direction:column; gap:4px; }
.import-summary strong {
  overflow:hidden; color:var(--ui-text); font-size:16px; text-overflow:ellipsis; white-space:nowrap;
}
.import-summary span { color:var(--ui-text-secondary); font-size:12.5px; }
.import-provider {
  flex:0 0 auto; padding:5px 9px; border:1px solid var(--ui-border);
  border-radius:999px; background:var(--ui-surface); font-weight:750;
}
.import-destination {
  margin:0; padding:15px 16px 16px; border:1px solid var(--ui-border);
  border-radius:14px;
}
.import-destination legend {
  padding:0 6px; color:var(--ui-text); font-size:13px; font-weight:800;
}
.import-destination-options { display:flex; flex-wrap:wrap; gap:9px 20px; margin-bottom:13px; }
#import-dlg .import-radio,
#import-dlg .import-completed-toggle,
#import-dlg .import-item-select {
  display:flex; align-items:center; margin:0; color:var(--ui-text);
}
#import-dlg .import-radio { gap:8px; cursor:pointer; }
#import-dlg .import-radio.is-disabled { opacity:.46; cursor:not-allowed; }
#import-dlg input[type="checkbox"],
#import-dlg input[type="radio"] {
  appearance:auto; width:17px; height:17px; flex:0 0 auto;
  display:inline-block; margin:0; padding:0; box-shadow:none;
  accent-color:var(--ui-accent);
}
.import-destination-fields {
  display:grid; grid-template-columns:minmax(0, 1.5fr) minmax(180px, .7fr); gap:12px;
}
.import-destination-fields > label { margin:0; }
#import-existing-fields { grid-template-columns:1fr; }
.import-selection-bar {
  display:flex; align-items:center; justify-content:space-between; gap:14px;
  margin-top:17px;
}
#import-dlg .import-completed-toggle { gap:8px; cursor:pointer; }
.import-selection-actions { display:flex; gap:6px; }
.import-selection-actions button {
  padding:6px 9px; border:1px solid var(--ui-border); border-radius:9px;
  background:var(--ui-surface); color:var(--ui-text-secondary);
  font-size:12px; font-weight:700; cursor:pointer;
}
.import-selection-actions button:hover { background:var(--ui-surface-subtle); color:var(--ui-text); }
.import-selected-count {
  margin:10px 0 8px; color:var(--ui-text-secondary); font-size:12.5px; font-weight:650;
}
.import-items {
  display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:9px;
  max-height:330px; overflow:auto; padding:1px 4px 1px 1px;
}
.import-item {
  min-width:0; padding:11px; border:1px solid var(--ui-border); border-radius:13px;
  background:var(--ui-surface);
}
.import-item.is-completed { background:color-mix(in srgb, var(--ui-success-soft) 40%, var(--ui-surface)); }
#import-dlg .import-item-select {
  display:grid; grid-template-columns:17px 48px minmax(0, 1fr);
  gap:9px; cursor:pointer;
}
.import-item-image {
  width:48px; height:48px; display:grid; place-items:center; overflow:hidden;
  border:1px solid var(--ui-border); border-radius:10px; background:var(--ui-surface-subtle);
  font-size:20px;
}
.import-item-image img { width:100%; height:100%; object-fit:cover; }
.import-item-copy { min-width:0; display:flex; flex-direction:column; gap:5px; }
.import-item-copy strong {
  overflow:hidden; color:var(--ui-text); font-size:13px; line-height:1.25;
  text-overflow:ellipsis; white-space:nowrap;
}
.import-item-meta {
  display:flex; align-items:center; flex-wrap:wrap; gap:5px;
  color:var(--ui-text-secondary); font-size:11.5px; font-weight:550;
}
.import-item-meta em {
  padding:2px 5px; border-radius:999px; background:var(--ui-success-soft);
  color:var(--ui-success); font-size:10px; font-style:normal; font-weight:800;
}
#import-dlg .import-category {
  display:grid; grid-template-columns:auto minmax(0, 1fr); align-items:center;
  gap:7px; margin:9px 0 0 26px;
}
.import-category > span { font-size:10.5px; color:var(--ui-text-secondary); }
#import-dlg .import-category select {
  min-height:32px; margin:0; padding:5px 8px; font-size:11.5px;
}
.import-category-hint { margin-top:9px; }
#import-dlg .dlg-btns button { gap:7px; }
#import-dlg #import-cancel,
#import-dlg #import-back {
  background:var(--ui-surface); border-color:var(--ui-border); color:var(--ui-text);
}

@media (max-width: 880px) {
  .dash-actions #create-list-btn { order:0; flex:1; }
  .dash-actions #import-list-btn { flex:1; }
}
@media (max-width: 650px) {
  #import-dlg {
    width:calc(100vw - 18px); max-height:calc(100vh - 18px); padding:20px 16px;
    border-radius:17px;
  }
  .import-title-row h2 { font-size:21px; }
  .import-head { gap:12px; }
  .import-head p { font-size:13px; }
  .import-destination-fields { grid-template-columns:1fr; }
  .import-selection-bar { align-items:flex-start; flex-direction:column; }
  .import-items { grid-template-columns:1fr; max-height:360px; }
}
@media (max-width: 560px) {
  .dash-actions #import-list-btn,
  .dash-actions #create-list-btn { width:100%; }
  .import-summary { align-items:flex-start; }
  .import-summary strong { white-space:normal; }
  #import-dlg .dlg-btns { flex-direction:column-reverse; }
}

/* Панельки: в светлой теме за шапкой и заголовками стоит сиреневое
   закатное небо, на котором тёмный текст тонет. Только для этого фона
   текст прямо на небе светлый, с мягкой тёмно-сиреневой тенью. Карточки и
   кнопки остаются как есть: у них свой светлый фон. */
html[data-background-choice="panelki"]:not([data-theme="dark"]) body.ods-active {
  --panelki-sky-text: #fff8f3;
  --panelki-sky-text-secondary: rgba(255,238,242,.9);
  --panelki-sky-shadow: 0 1px 2px rgba(46,22,70,.5), 0 2px 18px rgba(46,22,70,.38);
  background:#7a5a9a;
}
html[data-background-choice="panelki"]:not([data-theme="dark"]) body.ods-active :is(
  .home-wordmark, .dash-head h1, .profile-head h1
) {
  color:var(--panelki-sky-text); text-shadow:var(--panelki-sky-shadow);
}
html[data-background-choice="panelki"]:not([data-theme="dark"]) body.ods-active :is(
  .home-tagline, .dash-head p, .profile-head p, #dashboard-status, #archive-status
) {
  color:var(--panelki-sky-text-secondary); text-shadow:var(--panelki-sky-shadow);
}

/* "Something wrong?" under the sign-in card, the profile and the archive. */
.home-feedback { margin:26px 0 0; text-align:center; }
/* The dashboard has its own button beside the archive. */
#home:has(#signed-in:not([hidden])) .home-feedback { display:none; }
.home-feedback .feedback-open {
  display:inline-flex; align-items:center; gap:7px; min-height:40px; padding:8px 16px; border:none;
  border-radius:999px; background:var(--pill); color:var(--pill-text);
  font:inherit; font-size:13px; font-weight:600; cursor:pointer; box-shadow:var(--pill-ring);
  transition:background .15s ease, transform .12s ease;
}
.home-feedback .feedback-open i { color:var(--pill-primary); }
.home-feedback .feedback-open:hover { background:var(--pill-hover); color:var(--pill-text); }
.home-feedback .feedback-open:active { transform:scale(.96); }

/* The dashboard over the street scene, like the profile: the heading stays on the
   sky and the wishlist grid sits on a white sheet. Each card takes its mall's
   palette so it stands apart from the white: the classic mall is cream and coffee
   brown (gold at night), Oceanic Dusk is night blue (a cyan glow at night), and
   the Warm Conservatory is sand and terracotta. The archive gets the same sheet. */
body.ods-active :is(#wishlists, #archived-lists, #public-profile-lists):has(.wishlist-card) {
  padding:20px; border:1px solid var(--ui-border); border-radius:var(--ui-radius);
  background:color-mix(in srgb, var(--ui-surface) 97%, transparent);
  box-shadow:var(--ui-shadow-sm); -webkit-backdrop-filter:blur(14px); backdrop-filter:blur(14px);
}
body.ods-active :is(#wishlists, #archived-lists, #public-profile-lists) .wishlist-card {
  --tint:#f2e9d6; --deep:#4d3d2f;
  --card-surface:var(--tint); --card-ink:var(--deep);
  --card-soft:color-mix(in srgb, var(--deep) 72%, var(--tint));
  --card-tint:rgba(255,255,255,.72);
  --card-cover:color-mix(in srgb, var(--deep) 10%, var(--tint));
  --card-empty:color-mix(in srgb, #fff 45%, var(--tint));
  --card-rest:none;
}
body.ods-active :is(#wishlists, #archived-lists, #public-profile-lists) .wishlist-card[data-mall-skin="oceanic-dusk"] { --tint:#e2eaf1; --deep:#1b4060; }
body.ods-active :is(#wishlists, #archived-lists, #public-profile-lists) .wishlist-card[data-mall-skin="warm-conservatory"] { --tint:#f6e0cb; --deep:#8a4a2a; }
/* In the light theme the dashboard cards take their mall colour lightened by a
   third with white, so the page reads lighter and the photos stand out. */
html:not([data-theme="dark"]) body.ods-active #wishlists .wishlist-card {
  --card-surface:color-mix(in srgb, var(--tint) 70%, #fff);
}
html[data-theme="dark"] body.ods-active :is(#wishlists, #archived-lists, #public-profile-lists) .wishlist-card {
  --tint:#25201a; --deep:#ecd193; --card-tint:rgba(255,255,255,.08);
}
html[data-theme="dark"] body.ods-active :is(#wishlists, #archived-lists, #public-profile-lists) .wishlist-card[data-mall-skin="oceanic-dusk"] { --tint:#0d1d2e; --deep:#9fd3e6; }
html[data-theme="dark"] body.ods-active :is(#wishlists, #archived-lists, #public-profile-lists) .wishlist-card[data-mall-skin="warm-conservatory"] { --tint:#2e1f16; --deep:#f0b48a; }
body.ods-active :is(#wishlists, #archived-lists, #public-profile-lists) .wishlist-card-actions .quiet-btn:hover { background:#fff; }
html[data-theme="dark"] body.ods-active :is(#wishlists, #archived-lists, #public-profile-lists) .wishlist-card-actions .quiet-btn:hover { background:rgba(255,255,255,.14); }
/* An archived list is closed, so its mall colour is muted like its faded photos. */
body.ods-active #archived-lists .wishlist-card.archived {
  --muted:color-mix(in srgb, var(--tint) 40%, #eeedea);
  --card-surface:var(--muted);
  --card-ink:color-mix(in srgb, var(--deep) 55%, #57544f);
  --card-soft:color-mix(in srgb, var(--deep) 40%, #77736c);
  --card-cover:color-mix(in srgb, var(--deep) 8%, var(--muted));
  --card-empty:color-mix(in srgb, #fff 40%, var(--muted));
}
/* The sheet's padding leaves the card a little narrower; slimmer pills keep
   "Restore" and "Delete forever" on one line. */
body.ods-active #archived-lists .wishlist-card-actions :is(.quiet-btn, .danger-btn) { padding:0 12px; }
html[data-theme="dark"] body.ods-active #archived-lists .wishlist-card.archived {
  --muted:color-mix(in srgb, var(--tint) 45%, #1d1e21);
  --card-ink:color-mix(in srgb, var(--deep) 55%, #aaa7a1);
  --card-soft:color-mix(in srgb, var(--deep) 35%, #8c8983);
}
@media (max-width: 560px) {
  body.ods-active :is(#wishlists, #archived-lists, #public-profile-lists):has(.wishlist-card) { padding:12px; }
}

/* ---------- «Посмотреть город» (js/city-view.js) ----------
   Кнопка с городом в шапке видна, только когда под страницей есть улица.
   По нажатию страница уходит вниз и гаснет, а сверху остаётся плашка
   «Вернуться»; прозрачный слой над улицей ловит тап (вернуться) и протяжку
   вбок (листать панораму). */
.city-view-btn {
  display:none; flex:none; place-items:center; width:46px; height:46px; padding:0;
  border:1px solid transparent; border-radius:50%;
  background:var(--pill); color:var(--pill-text); box-shadow:var(--pill-ring);
  font-size:17px; cursor:pointer; transition:background .15s ease, transform .12s ease;
}
body.ods-active .city-view-btn { display:grid; }
.city-view-btn:hover { background:var(--pill-hover); }
.city-view-btn:active { transform:scale(.95); }
.city-view-btn:focus-visible, .city-view-back:focus-visible { outline:2px solid var(--ui-accent); outline-offset:2px; }
body.ods-active #home { transition:opacity .35s ease, translate .35s ease, visibility 0s; }
body.city-view #home {
  opacity:0; translate:0 28px; visibility:hidden; pointer-events:none;
  transition:opacity .3s ease, translate .35s ease, visibility 0s .35s;
}
#city-view-layer {
  position:fixed; inset:0; z-index:2; touch-action:none;
  -webkit-tap-highlight-color:transparent; user-select:none; -webkit-user-select:none;
}
#city-view-layer[hidden], .city-view-back[hidden] { display:none; }
#city-view-layer[data-pan="1"] { cursor:grab; }
#city-view-layer[data-pan="1"]:active { cursor:grabbing; }
.city-view-back {
  position:fixed; z-index:3; top:max(16px, env(safe-area-inset-top)); left:50%; translate:-50% 0;
  display:inline-flex; align-items:center; gap:8px; min-height:44px; padding:0 18px;
  border:1px solid transparent; border-radius:999px;
  background:var(--pill); color:var(--pill-text); box-shadow:0 6px 24px rgba(0,0,0,.14), var(--pill-ring);
  font:inherit; font-size:14px; font-weight:650; cursor:pointer;
  animation:city-view-back-in .35s ease both;
}
.city-view-back:hover { background:var(--pill-hover); }
@keyframes city-view-back-in { from { opacity:0; translate:-50% -10px; } }
@media (max-width: 560px) {
  .city-view-btn { width:42px; height:42px; font-size:16px; }
}
@media (prefers-reduced-motion: reduce) {
  body.ods-active #home, body.city-view #home { transition:none; translate:none; }
  .city-view-back { animation:none; }
}
