  :root {
    box-sizing: border-box;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);

    --ink: #0B0F10;
    --paper: #FCF9E6;
    --paper-soft: #F5F0D8;
    --paper-line: #E4DCAF;
    --forest: #1B1F1B;
    --forest-deep: #0B0F10;
    --brass: #D6E50B;
    --brass-bright: #BFCC0A;
    --ribbon: #FF5B40;
    --ribbon-soft: #FF8A72;
    --sage: #045A6B;
    --ok: #007E94;
    --shadow: 0 1px 0 rgba(11,15,16,0.10);
    --fmt-carta: #00879F; --fmt-audio: #E8462B; --fmt-ebook: #7A4FD0;
  }
  html { scroll-padding-top: env(safe-area-inset-top, 0px); }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      --ink: #FBF8E6;
      --paper: #15191A;
      --paper-soft: #1E2324;
      --paper-line: #34393A;
      --forest: #FCF9E6;
      --forest-deep: #08090A;
      --brass: #E4F23A;
      --brass-bright: #D6E50B;
      --ribbon: #FF6E56;
      --ribbon-soft: #C94A34;
      --sage: #7FB8C6;
      --ok: #35A9C2;
      --fmt-carta: #1FA3BB; --fmt-audio: #F25C40; --fmt-ebook: #9575E8;
      --shadow: 0 1px 0 rgba(0,0,0,0.4);
    }
  }
  :root[data-theme="dark"] {
    --ink: #FBF8E6;
    --paper: #15191A;
    --paper-soft: #1E2324;
    --paper-line: #34393A;
    --forest: #FCF9E6;
    --forest-deep: #08090A;
    --brass: #E4F23A;
    --brass-bright: #D6E50B;
    --ribbon: #FF6E56;
    --ribbon-soft: #C94A34;
    --sage: #7FB8C6;
    --ok: #35A9C2;
    --fmt-carta: #1FA3BB; --fmt-audio: #F25C40; --fmt-ebook: #9575E8;
  }

  * { box-sizing: border-box; }
  body {
    margin: 0;
    background: var(--forest-deep);
    color: var(--ink);
    font-family: "Work Sans", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
    min-height: 100%;
  }
  html, body { height: 100%; }

  h1, h2, h3, .display {
    font-family: "Archivo Black", "Arial Black", Arial, sans-serif;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.005em;
    line-height: 1.08;
    margin: 0;
  }

  a { color: inherit; }
  button { font-family: inherit; }

  .app {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
  }

  /* ---------- Sidebar (the shelf) ---------- */
  .shelf {
    width: 250px;
    flex: 0 0 250px;
    background: var(--forest-deep);
    color: #FCF9E6;
    padding: 28px 20px calc(20px + env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
    gap: 28px;
    position: sticky;
    top: 0;
    top: env(safe-area-inset-top, 0px);
    height: 100vh;
    height: 100dvh;
  }
  .brand {
    display: flex;
    align-items: baseline;
    gap: 8px;
  }
  .brand-mark {
    font-family: "Archivo Black", "Arial Black", Arial, sans-serif;
    font-size: 22px;
    color: var(--brass);
    line-height: 1;
  }
  .brand-name {
    font-family: "Archivo Black", "Arial Black", Arial, sans-serif;
    font-size: 14.5px;
    text-transform: uppercase;
    letter-spacing: 0.01em;
    font-weight: 400;
    line-height: 1.22;
    color: #FCF9E6;
  }
  .shelf-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 4px;
  }
  .shelf-tab {
    display: flex;
    align-items: center;
    gap: 12px;
    background: none;
    border: none;
    color: #9BA098;
    text-align: left;
    padding: 11px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14.5px;
    border-left: 3px solid transparent;
    transition: background .15s ease, color .15s ease;
  }
  .shelf-tab .dot {
    width: 12px; height: 12px; flex: 0 0 auto;
    opacity: .55;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 13px; line-height: 1; color: var(--brass);
  }
  .shelf-tab .dot::before { content: "✱"; }
  .shelf-tab:hover { background: rgba(252,249,230,0.06); color: #FCF9E6; }
  .shelf-tab.active {
    color: #FCF9E6;
    background: rgba(252,249,230,0.09);
    border-left-color: var(--brass-bright);
  }
  .shelf-tab.active .dot { opacity: 1; color: var(--brass); }

  .shelf-stats {
    margin-top: auto;
    border-top: 1px solid rgba(252,249,230,0.14);
    padding-top: 16px;
    font-size: 12.5px;
    color: #868C83;
    line-height: 1.7;
  }
  .shelf-stats b { color: #FCF9E6; font-weight: 600; }

  .mobile-topbar { display: none; }

  /* ---------- Onboarding (pop) ---------- */
  #onboardModal .ob-card { position: relative; background: #D6E50B; color: #0B0F10; border: 3px solid #0B0F10; border-radius: 30px; box-shadow: 8px 8px 0 #0B0F10; padding: 30px 28px 24px; max-width: 540px; }
  #onboardModal .ob-card h2 { color: #0B0F10; font-size: clamp(26px, 4vw, 34px); line-height: 1; margin-top: 4px; padding-right: 70px; }
  #onboardModal .ob-tellme { position: absolute; top: 18px; right: 18px; width: 76px; height: 76px; border-radius: 50%; border: 3px solid #0B0F10; overflow: hidden; background: #007E94; box-shadow: 4px 4px 0 #0B0F10; animation: tmBob 3.2s ease-in-out infinite; }
  #onboardModal .ob-tellme img { width: 100%; height: 100%; object-fit: cover; display: block; }
  #onboardModal .ob-card .ob-progress { margin-right: 86px; }
  #onboardModal .ob-card .ob-progress span { height: 7px; background: rgba(11,15,16,.18); }
  #onboardModal .ob-card .ob-progress span.on { background: #0B0F10; }
  #onboardModal .ob-card .step-hint { color: #0B0F10; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; font-size: 11.5px; }
  #onboardModal .ob-emoji { font-size: 42px; line-height: 1; margin-top: 12px; }
  #onboardModal .ob-sub { font-size: 13.5px; font-weight: 600; margin: 10px 0 0; line-height: 1.45; color: #0B0F10; }
  #onboardModal .ob-card .chip { background: #FCF9E6; color: #0B0F10; border: 2px solid #0B0F10; padding: 10px 16px; font-size: 14px; font-weight: 700; box-shadow: 0 3px 0 #0B0F10; transition: transform .1s ease; }
  #onboardModal .ob-card .chip:hover { transform: translateY(-2px); }
  #onboardModal .ob-card .chip.selected { background: #0B0F10; color: #D6E50B; border-color: #0B0F10; }
  #onboardModal .ob-card .field label { color: #0B0F10; font-weight: 800; }
  #onboardModal .ob-card .field input[type=text], #onboardModal .ob-card .field input[type=email] { background: #FCF9E6; border: 2px solid #0B0F10; border-radius: 100px; padding: 12px 16px; color: #0B0F10; }
  #onboardModal .ob-card .field input:focus { border-color: #FF5B40; }
  #onboardModal .ob-card .consent { color: #0B0F10; font-weight: 600; }
  #onboardModal .ob-card .form-error { color: #8A1F10; background: #FCF9E6; border-radius: 10px; padding: 0 8px; min-height: 0; margin-top: 10px; }
  #onboardModal .ob-card .form-error:empty { display: none; }
  #onboardModal .ob-card .skip-link { color: #0B0F10; font-weight: 700; }
  #onboardModal .ob-btn { width: auto !important; padding: 12px 22px !important; font-size: 13.5px !important; }
  #onboardModal .ob-card .cta-second { border-color: #0B0F10; color: #0B0F10; }
  #onboardModal .ob-card .avatar-opt { border: 2px solid #0B0F10; }

  /* ---------- Account (pop) ---------- */
  #view-account { max-width: 880px; }
  #view-account .acc-head { position: relative; overflow: hidden; display: flex; gap: 22px; align-items: center; background: #D6E50B; color: #0B0F10; border: 3px solid #0B0F10; border-radius: 30px; box-shadow: 8px 8px 0 #0B0F10; padding: 28px; margin-top: 8px; }
  #view-account .acc-star { position: absolute; right: -10px; top: -30px; font-size: 170px; line-height: 1; opacity: .18; pointer-events: none; }
  #view-account .acc-head .avatar-lg { width: 104px; height: 104px; font-size: 36px; border: 3px solid #0B0F10; box-shadow: 4px 4px 0 #0B0F10; flex: 0 0 auto; }
  #view-account .acc-kicker { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
  #view-account .acc-head .nm { font-family: "Archivo Black", "Arial Black", Arial, sans-serif; text-transform: uppercase; font-size: clamp(26px, 4vw, 38px); line-height: 1; margin-top: 4px; }
  #view-account .acc-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
  #view-account .acc-pills .nick { background: #0B0F10; color: #D6E50B; border-radius: 100px; padding: 5px 12px; font-weight: 800; font-size: 13px; }
  #view-account .acc-pills .persona { background: #FCF9E6; color: #0B0F10; border: 2px solid #0B0F10; border-radius: 100px; padding: 3px 11px; font-weight: 700; font-size: 12.5px; }
  #view-account .acc-head .sub { font-size: 13px; color: #0B0F10; opacity: .8; margin-top: 10px; }
  #view-account .acc-section { margin-top: 34px; }
  #view-account .acc-section h2 { font-size: 22px; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
  #view-account .acc-section h2 span { font-family: initial; font-size: 24px; }
  #view-account .acc-sec-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
  #view-account .acc-sec-head h2 { margin-bottom: 0; }
  #view-account .acc-mini { width: auto !important; padding: 9px 16px !important; font-size: 12px !important; }
  #view-account .acc-card { background: var(--paper); border: 2px solid var(--ink); border-radius: 24px; padding: 22px; }
  #view-account .pref-grid { grid-template-columns: repeat(4, 1fr) !important; gap: 12px !important; }
  #view-account .pref-item { background: var(--pc) !important; color: var(--pf); border: 2px solid #0B0F10 !important; border-radius: 22px !important; padding: 16px !important; min-height: 140px; display: flex; flex-direction: column; }
  #view-account .pref-item .pe { font-size: 28px; line-height: 1; }
  #view-account .pref-item .k { color: inherit !important; opacity: .8; font-size: 11px !important; text-transform: uppercase; letter-spacing: .06em; margin-top: auto; }
  #view-account .pref-item .v { font-weight: 800; font-size: 14px !important; line-height: 1.3; }
  #view-account .acc-stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
  #view-account .acc-stat { background: var(--paper-soft); border: 2px solid var(--ink); border-radius: 20px; padding: 14px 10px; text-align: center; display: flex; flex-direction: column; gap: 4px; align-items: center; }
  #view-account .acc-stat .se { font-size: 24px; }
  #view-account .acc-stat .sn { font-family: "Archivo Black", "Arial Black", Arial, sans-serif; font-size: 24px; line-height: 1; }
  #view-account .acc-stat .sl { font-size: 11px; font-weight: 700; color: var(--sage); line-height: 1.25; }
  #view-account .acc-danger { border: 2px solid var(--ink); border-radius: 24px; overflow: hidden; }
  #view-account .acc-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 20px; }
  #view-account .acc-row + .acc-row { border-top: 2px dashed var(--paper-line); }
  #view-account .acc-row b { display: block; font-size: 14.5px; }
  #view-account .acc-row small { display: block; font-size: 12.5px; color: var(--sage); margin-top: 2px; line-height: 1.4; }
  #view-account .acc-row .danger-btn { border-radius: 100px; }

  /* ---------- Global header + hamburger menu ---------- */
  body { background: var(--paper); }
  .app { display: block; min-height: 100vh; min-height: 100dvh; }
  .app > .main { border-radius: 0 !important; padding: 0 32px calc(60px + env(safe-area-inset-bottom, 0px)); background: var(--paper); }
  body.is-landing .app > .main { padding: 0 !important; }
  .view { margin-left: auto; margin-right: auto; }
  .topbar { display: flex; justify-content: space-between; align-items: center; max-width: 920px; margin: 0 auto; padding: 18px 0 14px; background: transparent; color: var(--ink); }
  .tb-logo { background: none; border: none; padding: 4px 10px 4px 0; cursor: pointer; display: inline-flex; }
  .tb-logo img { height: 46px; width: auto; display: block; }
  .logo-w { display: none !important; }
  .logo-b { display: block; }
  .tb-right { display: flex; align-items: center; gap: 10px; }
  .tb-avatar { width: 46px; height: 46px; }
  .tb-me { display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 16px 0 3px; border: 2px solid var(--ink); border-radius: 100px; background: transparent; color: var(--ink); font-family: inherit; font-weight: 800; font-size: 13px; cursor: pointer; white-space: nowrap; transition: background .15s ease, color .15s ease; }
  .tb-me .tb-avatar { width: 36px; height: 36px; font-size: 13px; border-width: 0; cursor: pointer; }
  .tb-me:hover { background: #D6E50B; color: #0B0F10; }
  .tb-me:hover .tb-avatar { transform: none; }
  .tb-me.on { background: var(--ink); color: var(--paper); }
  @media (max-width: 380px) { .tb-me { padding: 0 3px; } .tb-me-l { display: none; } }
  .burger { width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--ink); background: transparent; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; padding: 0; transition: background .15s ease; }
  .burger span { display: block; width: 18px; height: 2.5px; border-radius: 2px; background: var(--ink); transition: background .15s ease; }
  .burger:hover { background: var(--ink); }
  .burger:hover span { background: var(--paper); }
  body.is-landing .topbar { display: none; }
  .nav-menu { position: fixed; inset: 0; z-index: 70; background: rgba(11,15,16,.45); display: flex; justify-content: flex-end; }
  .nav-menu[hidden] { display: none; }
  .nm-panel { width: min(420px, 100%); height: 100%; background: #0B0F10; color: #FCF9E6; display: flex; flex-direction: column; padding: calc(20px + env(safe-area-inset-top, 0px)) 24px calc(24px + env(safe-area-inset-bottom, 0px)); overflow-y: auto; animation: nmIn .25s ease both; }
  @keyframes nmIn { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
  .nm-top { display: flex; justify-content: space-between; align-items: center; }
  .nm-logo { display: block !important; height: 62px; }
  .nm-close { width: 46px; height: 46px; border-radius: 50%; border: 2px solid #FCF9E6; background: transparent; color: #FCF9E6; font-size: 16px; cursor: pointer; }
  .nm-close:hover { background: #FCF9E6; color: #0B0F10; }
  .nm-list { display: flex; flex-direction: column; gap: 4px; margin: 30px 0; }
  .nm-item { display: flex; align-items: center; gap: 14px; background: none; border: none; color: #FCF9E6; font-family: "Archivo Black", "Arial Black", Arial, sans-serif; text-transform: uppercase; font-size: 24px; padding: 12px 10px; border-radius: 16px; cursor: pointer; text-align: left; transition: background .12s ease, transform .12s ease; }
  .nm-item:hover { background: #1E2324; transform: translateX(4px); }
  .nm-item.on { color: #D6E50B; }
  .nm-e { width: 30px; text-align: center; font-size: 22px; font-family: initial; }
  .nm-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 2px dashed #34393A; padding-top: 18px; }
  .nm-me { display: flex; align-items: center; gap: 12px; background: none; border: none; color: #FCF9E6; cursor: pointer; text-align: left; font-family: inherit; padding: 0; }
  .nm-me .avatar-btn { width: 46px; height: 46px; border-color: #FCF9E6; }
  .nm-me b { display: block; font-size: 14px; }
  .nm-me small { font-size: 12px; color: #9BA098; }
  .nm-me-top { width: 100%; margin-top: 22px; padding: 14px 16px; border: 2px solid #D6E50B; border-radius: 20px; gap: 14px; }
  .nm-me-top:hover { background: rgba(214,229,11,.1); }
  .nm-me-top small { display: block; color: #D6E50B; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; font-size: 11px; }
  .nm-me-top b { font-size: 17px; margin: 2px 0; }
  .nm-me-top i { display: block; font-style: normal; font-size: 12.5px; color: #B9BCB2; }
  .nm-me-top .avatar-btn { width: 54px; height: 54px; flex: 0 0 auto; }
  .nm-me-top + .nm-list { margin-top: 18px; }
  .nm-out { background: #D6E50B; color: #0B0F10; border: none; border-radius: 100px; padding: 10px 18px; font-weight: 800; font-size: 12.5px; text-transform: uppercase; cursor: pointer; font-family: inherit; }
  .landing-logo img { height: 54px; width: auto; display: block; }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .topbar .logo-b, :root:not([data-theme="light"]) .login-wrap .logo-b { display: none !important; }
    :root:not([data-theme="light"]) .topbar .logo-w, :root:not([data-theme="light"]) .login-wrap .logo-w { display: block !important; }
  }
  :root[data-theme="dark"] .topbar .logo-b, :root[data-theme="dark"] .login-wrap .logo-b { display: none !important; }
  :root[data-theme="dark"] .topbar .logo-w, :root[data-theme="dark"] .login-wrap .logo-w { display: block !important; }

  /* Landing */
  body.logged-out .shelf, body.logged-out .main-top, body.logged-out .mobile-topbar { display: none !important; }
  body.logged-out .main, body.is-landing .main { border-radius: 0; padding: 0; }
  body.is-landing .main { padding: 0 !important; }
  body.is-landing .main-top { display: none; }
  body.is-landing .shelf, body.is-landing .mobile-topbar { display: none !important; }
  #view-home { max-width: none; }
  .landing {
    min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
    background: var(--paper); position: relative; overflow: hidden;
  }
  .landing-top {
    position: absolute; top: 0; left: 0; right: 0; z-index: 3;
    display: flex; justify-content: space-between; align-items: center;
    padding: 22px 28px; padding-top: calc(22px + env(safe-area-inset-top, 0px));
  }
  .landing-logo {
    background: none; border: none; cursor: pointer; color: #0B0F10; padding: 0;
    display: inline-flex; align-items: center; gap: 8px;
    font-family: "Archivo Black", "Arial Black", Arial, sans-serif; font-size: 22px; text-transform: uppercase;
  }
  .landing-logo span { font-size: 12.5px; line-height: 1.15; text-align: left; }
  .landing-login {
    background: none; border: 2px solid #0B0F10; color: #0B0F10; border-radius: 100px;
    padding: 8px 16px; font-weight: 700; font-size: 12.5px; text-transform: uppercase; letter-spacing: .03em; cursor: pointer;
  }
  .landing-login:hover { background: #0B0F10; color: #D6E50B; }
  .lbl-short { display: none; }
  .cloud-area { position: relative; flex: 1; min-height: 560px; }
  .cloud-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
  .cloud-svg path { fill: #D6E50B; }
  .cloud-content {
    position: relative; z-index: 2; text-align: center; color: #0B0F10;
    padding: 92px 24px 150px; max-width: 760px; margin: 0 auto;
    display: flex; flex-direction: column; align-items: center;
  }
  .cloud-star { font-size: 34px; line-height: 1; color: #0B0F10; margin-bottom: 14px; display: inline-block; }
  .landing-title {
    font-size: clamp(32px, 4.6vw, 56px); line-height: .98; color: #0B0F10; max-width: 17ch;
  }
  .landing-sub { font-size: 16px; line-height: 1.55; margin: 16px 0 26px; max-width: 42ch; color: #0B0F10; }
  .landing-ctas { display: flex; flex-direction: column; gap: 12px; align-items: center; width: 100%; max-width: 300px; }
  .cta-main, .cta-second {
    width: 100%; border-radius: 100px; padding: 15px 22px; cursor: pointer;
    font-family: "Archivo Black", "Arial Black", Arial, sans-serif; font-size: 15px; text-transform: uppercase; letter-spacing: .02em;
    transition: transform .12s ease, box-shadow .12s ease;
  }
  .cta-main { background: #FF5B40; color: #FCF9E6; border: 2px solid #FF5B40; box-shadow: 0 4px 0 #0B0F10; }
  .cta-main:hover { transform: translateY(-1px); box-shadow: 0 5px 0 #0B0F10; }
  .cta-main:active { transform: translateY(3px); box-shadow: 0 1px 0 #0B0F10; }
  .cta-second { background: transparent; color: #0B0F10; border: 2px solid #0B0F10; }
  .cta-second:hover { background: #0B0F10; color: #D6E50B; }
  .landing-foot { position: relative; z-index: 3; display: flex; justify-content: center; align-items: center; gap: 8px; flex-wrap: wrap;
    padding: 18px 20px calc(20px + env(safe-area-inset-bottom, 0px)); font-size: 12.5px; font-weight: 600; color: #0B0F10; opacity: .7; }
  .landing-foot a { color: inherit; text-decoration: underline; text-underline-offset: 3px; padding: 6px 2px; }
  .landing-foot a:hover { opacity: 1; }
  .book-stack { pointer-events: none; position: relative; z-index: 2; width: 300px; max-width: 78vw; margin: -86px auto 0; display: block; padding-bottom: env(safe-area-inset-bottom, 0px); }
  @keyframes floatIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
  .cloud-content > * { animation: floatIn .6s ease both; }
  .cloud-content > *:nth-child(2) { animation-delay: .08s; }
  .cloud-content > *:nth-child(3) { animation-delay: .16s; }
  .cloud-content > *:nth-child(4) { animation-delay: .24s; }
  @media (prefers-reduced-motion: reduce) { .cloud-content > * { animation: none; } }

  /* Login */
  #view-login { max-width: none; }
  .login-wrap { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px 20px; gap: 26px; background: var(--paper); }
  .login-card { width: 100%; max-width: 400px; background: var(--paper-soft); border: 2px solid var(--ink); border-radius: 16px; padding: 30px; text-align: left; }
  .login-card .field input { width: 100%; }
  .text-link { background: none; border: none; padding: 8px 2px; margin: -8px 0; color: var(--ok); font-weight: 700; text-decoration: underline; cursor: pointer; font-size: inherit; display: inline-flex; align-items: center; min-height: 36px; }

  /* Dashboard */
  .dash-links { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 22px; }
  .dash-link { background: var(--c); color: var(--f); border: none; border-radius: 12px; padding: 22px; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 6px; transition: transform .12s ease; }
  .dash-link:hover { transform: translateY(-2px); }
  .dash-link b { font-family: "Archivo Black", "Arial Black", Arial, sans-serif; text-transform: uppercase; font-weight: 400; font-size: 17px; }
  .dash-link span { font-size: 13px; opacity: .85; }

  /* Avatar + top bar */
  .main { position: relative; }
  .main-top { position: absolute; top: 24px; right: 32px; z-index: 4; }
  .avatar-btn {
    width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--ink);
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
    font-family: "Archivo Black", "Arial Black", Arial, sans-serif; font-size: 15px; text-transform: uppercase;
    transition: transform .12s ease;
  }
  .avatar-btn:hover { transform: scale(1.06); }
  .avatar-btn.active { outline: 3px solid var(--brass); outline-offset: 2px; }
  .avatar-lg { width: 84px; height: 84px; font-size: 30px; cursor: default; }
  .avatar-lg:hover { transform: none; }
  .avatar-pick { display: flex; gap: 10px; flex-wrap: wrap; }
  .avatar-opt { width: 40px; height: 40px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-family: "Archivo Black", "Arial Black", Arial, sans-serif; font-size: 13px; }
  .avatar-opt.on { border-color: var(--ink); outline: 2px solid var(--paper); outline-offset: -5px; }
  .reg-av { display: flex; gap: 16px; align-items: center; }
  .reg-av-prev { width: 76px; height: 76px; font-size: 26px; flex: 0 0 auto; border: 3px solid #0B0F10; }
  .reg-av-ctrl { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
  .reg-av-btns { display: flex; gap: 8px; flex-wrap: wrap; }
  .reg-av-btns label { display: inline-flex; align-items: center; }
  .reg-av-or { font-size: 12px; color: var(--sage); }
  .reg-av .avatar-opt { width: 32px; height: 32px; font-size: 11px; }
  .req { color: #FF5B40; font-weight: 800; }
  .consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.45; margin-bottom: 10px; cursor: pointer; }
  .consent input { margin-top: 3px; accent-color: var(--ok); }
  .form-error { color: var(--ribbon); font-size: 12.5px; font-weight: 600; min-height: 18px; margin-top: 4px; }
  .modal-card .field input[type=text], .modal-card .field input[type=email] {
    font-family: inherit; font-size: 14px; padding: 10px 11px; border-radius: 4px;
    border: 1px solid var(--paper-line); background: var(--paper-soft); color: var(--ink); outline: none; width: 100%;
  }
  .modal-card .field input:focus { border-color: var(--ok); }
  .ob-progress { display: flex; gap: 5px; margin-bottom: 14px; }
  .ob-progress span { flex: 1; height: 4px; border-radius: 4px; background: var(--paper-line); }
  .ob-progress span.on { background: var(--ink); }

  /* Account area */
  .acc-head { display: flex; gap: 20px; align-items: center; background: var(--forest-deep); color: #FCF9E6; border-radius: 12px; padding: 22px; }
  .acc-head .nm { font-family: "Archivo Black", "Arial Black", Arial, sans-serif; text-transform: uppercase; font-size: 22px; line-height: 1.1; }
  .acc-head .sub { font-size: 13px; color: #9BA098; margin-top: 4px; }
  .acc-head .nick { color: var(--brass); font-weight: 700; }
  .acc-section { margin-top: 26px; }
  .acc-section h2 { font-size: 16px; margin-bottom: 12px; }
  .pref-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .pref-item { background: var(--paper-soft); border: 1px solid var(--paper-line); border-radius: 8px; padding: 12px 14px; }
  .pref-item .k { font-size: 11.5px; color: var(--sage); font-weight: 700; }
  .pref-item .v { font-size: 14px; margin-top: 3px; }
  .btn.danger-btn { background: transparent; color: var(--ribbon); border: 2px solid var(--ribbon); }
  .btn.danger-btn:hover { background: var(--ribbon); color: #0B0F10; }
  .field input[type=email] { font-family: inherit; font-size: 14px; padding: 10px 11px; border-radius: 4px; border: 1px solid var(--paper-line); background: var(--paper); color: var(--ink); outline: none; }

  /* ---------- Main ---------- */
  .main {
    flex: 1;
    min-width: 0;
    background: var(--paper);
    border-top-left-radius: 18px;
    border-bottom-left-radius: 18px;
    padding: 40px 44px calc(60px + env(safe-area-inset-bottom, 0px));
    overflow-x: hidden;
  }
  .view { display: none; max-width: 880px; }
  .view.active { display: block; }

  .view-head { margin-bottom: 28px; }
  .view-head h1 { font-size: 30px; color: var(--ink); }
  .view-head p { margin: 8px 0 0; color: var(--sage); font-size: 14.5px; max-width: 60ch; line-height: 1.55; }

  /* Hero (home) */
  .hero {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 40px;
    align-items: center;
    padding: 10px 0 8px;
  }
  .hero h1 {
    font-size: 40px;
    line-height: 1.12;
    color: var(--ink);
  }
  .hero .lede {
    margin-top: 16px;
    font-size: 16px;
    line-height: 1.65;
    color: var(--ink);
    opacity: .82;
    max-width: 46ch;
  }
  .hero-cta { margin-top: 26px; display: flex; gap: 12px; flex-wrap: wrap; }
  .spine-stack {
    display: flex;
    gap: 8px;
    height: 220px;
    align-items: flex-end;
    justify-content: center;
  }
  .spine {
    width: 34px;
    border-radius: 3px 3px 0 0;
    box-shadow: var(--shadow);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10px;
    color: var(--ink);
    font-family: "Archivo Black", "Arial Black", Arial, sans-serif;
    font-size: 10px;
    text-transform: uppercase;
    writing-mode: vertical-rl;
  }

  /* Buttons */
  .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: 100px;
    border: 2px solid transparent;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: transform .12s ease, background .15s ease, border-color .15s ease;
  }
  .btn:active { transform: translateY(1px); }
  .btn-primary { background: var(--forest-deep); color: var(--paper); border-color: var(--forest-deep); }
  .btn-primary:hover { background: var(--ink); }
  .btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
  .btn-ghost:hover { background: var(--ink); color: var(--paper); }
  .btn-brass { background: var(--brass); color: var(--ink); border-color: var(--brass); }
  .btn-brass:hover { background: var(--brass-bright); border-color: var(--brass-bright); }
  .btn:disabled { opacity: .5; cursor: default; }
  .btn-sm { padding: 8px 14px; font-size: 11.5px; }

  /* Cards */
  .card {
    background: var(--paper-soft);
    border: 1px solid var(--paper-line);
    border-radius: 6px;
    padding: 18px;
  }
  .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

  /* Form */
  .field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
  .field label { font-size: 12.5px; font-weight: 600; color: var(--sage); }
  .field input[type=text], .field input[type=date], .field input[type=number], .field select, .field textarea {
    font-family: inherit;
    font-size: 14px;
    padding: 10px 11px;
    border-radius: 4px;
    border: 1px solid var(--paper-line);
    background: var(--paper);
    color: var(--ink);
    outline: none;
  }
  .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brass); }
  .field textarea { resize: vertical; min-height: 60px; }
  .chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
  .chip {
    border: 1px solid var(--paper-line);
    background: var(--paper);
    color: var(--ink);
    padding: 6px 12px;
    border-radius: 100px;
    font-size: 12.5px;
    cursor: pointer;
    user-select: none;
  }
  .chip.selected { background: var(--sage); border-color: var(--sage); color: #fff; }
  .chip-select { display: inline-flex; align-items: center; gap: 6px; cursor: default; }
  .chip-select select { font-family: inherit; font-size: 12.5px; border: none; background: transparent; color: inherit; cursor: pointer; max-width: 160px; }
  .rating { display: flex; gap: 4px; }
  .rating .star { cursor: pointer; font-size: 19px; color: var(--paper-line); }
  .rating .star.on { color: var(--brass); }

  /* Book list */
  .book-list { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
  .book-row {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background: var(--paper-soft);
    border: 1px solid var(--paper-line);
    border-radius: 6px;
    padding: 13px 15px;
  }
  .book-spine {
    flex: 0 0 8px;
    align-self: stretch;
    border-radius: 2px;
    background: var(--ribbon);
  }
  .book-row .meta { flex: 1; min-width: 0; }
  .book-row .title { font-family: "Archivo Black", "Arial Black", Arial, sans-serif; font-weight: 600; font-size: 15.5px; }
  .book-row .author { font-size: 13px; color: var(--sage); margin-top: 2px; }
  .book-row .tags { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
  .tag {
    font-size: 11px;
    padding: 3px 9px;
    border-radius: 100px;
    background: var(--paper);
    border: 1px solid var(--paper-line);
    color: var(--sage);
  }
  .row-actions { display: flex; gap: 8px; align-items: center; flex: 0 0 auto; }
  .icon-btn {
    background: none; border: none; cursor: pointer; color: var(--sage);
    font-size: 15px; padding: 4px;
  }
  .icon-btn:hover { color: var(--ribbon); }
  .empty {
    text-align: center;
    padding: 44px 20px;
    color: var(--sage);
    font-size: 14px;
    border: 1px dashed var(--paper-line);
    border-radius: 8px;
  }
  .empty .display { font-size: 17px; color: var(--ink); margin-bottom: 6px; }

  /* Recommendations */
  .filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 22px; }
  .rec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 14px; }
  .mood-title { font-size: clamp(28px, 4vw, 42px); line-height: 1; margin: 8px 0 16px; }
  .mood-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
  .mood-card { border: 2px solid var(--ink); background: var(--paper); color: var(--ink); border-radius: 20px; padding: 16px 14px; cursor: pointer; text-align: left; font-family: inherit; display: flex; flex-direction: column; gap: 8px; transition: transform .12s ease; }
  .mood-card:hover { transform: translateY(-2px); }
  .mood-card .me { font-size: 30px; line-height: 1; }
  .mood-card .mt { font-weight: 700; font-size: 13.5px; line-height: 1.3; }
  .mood-card .md { font-size: 11.5px; line-height: 1.35; opacity: .8; }
  .mood-card.on { background: var(--mc); color: var(--mf); border-color: var(--mc); box-shadow: 0 4px 0 #0B0F10; }
  .mix-box { margin: 26px 0 18px; background: var(--paper-soft); border: 1px solid var(--paper-line); border-radius: 18px; padding: 16px 18px; }
  .mix-labels { display: flex; justify-content: space-between; font-weight: 700; font-size: 13.5px; margin-bottom: 10px; }
  .mix-box input[type=range] { width: 100%; accent-color: #FF5B40; }
  .mix-hint { font-size: 12.5px; color: var(--sage); margin-top: 6px; text-align: center; }
  .gen-btn { width: auto; padding: 14px 28px; margin-top: 6px; }
  .rec-train { font-size: 12.5px; color: var(--sage); margin: 18px 0 0; }
  .rec-nota { font-size: 12.5px; font-weight: 600; color: var(--ok); background: var(--paper-soft); border: 1px dashed var(--paper-line); border-radius: 12px; padding: 10px 14px; margin: 14px 0 0; }
  .pop-card { position: relative; border-radius: 26px; padding: 20px; display: flex; flex-direction: column; gap: 10px; background: var(--pc); color: var(--pf); overflow: visible; min-height: 280px; }
  .pop-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
  .pop-emoji { width: 62px; height: 62px; border-radius: 50%; background: #FCF9E6; border: 2px solid #0B0F10; display: flex; align-items: center; justify-content: center; font-size: 32px; flex: 0 0 auto; }
  .pop-match { background: #0B0F10; color: #D6E50B; border-radius: 100px; padding: 6px 11px; font-size: 12px; font-weight: 700; white-space: nowrap; }
  .pop-warn { align-self: flex-start; background: #FCF9E6; color: #0B0F10; border: 2px solid #0B0F10; border-radius: 100px; padding: 3px 10px; font-size: 11px; font-weight: 800; }
  .pop-genre { align-self: flex-start; background: rgba(252,249,230,.92); color: #0B0F10; border-radius: 100px; padding: 4px 11px; font-size: 11.5px; font-weight: 700; }
  .pop-title { font-family: "Archivo Black", "Arial Black", Arial, sans-serif; text-transform: uppercase; font-size: 22px; line-height: 1.02; overflow-wrap: anywhere; }
  .pop-by { font-size: 13px; font-weight: 600; opacity: .9; margin-top: 6px; }
  .pop-card.dark .pop-match { background: #D6E50B; color: #0B0F10; }
  .pop-card.dark .pop-wl { background: #D6E50B; color: #0B0F10; border-color: #D6E50B; }
  .pop-card.dark .pop-wl.done { background: transparent; color: #D6E50B; }
  .pop-card.light .pop-genre { border: 1.5px solid #0B0F10; }
  .pop-by .pub { display: inline-block; margin-top: 3px; font-size: 12px; padding: 2px 9px; border: 1.5px solid currentColor; border-radius: 100px; opacity: .95; }
  .pop-why { font-size: 13.5px; line-height: 1.5; }
  .pop-letto { background: transparent; color: inherit; border: 2px solid currentColor; border-radius: 100px; padding: 7px 14px; font-family: inherit; font-weight: 800; font-size: 12.5px; cursor: pointer; }
  .pop-letto:hover { background: #0B0F10; color: #FCF9E6; border-color: #0B0F10; }
  .pop-letto.done { opacity: .6; cursor: default; }
  .pop-actions { display: flex; gap: 8px; align-items: center; margin-top: auto; padding-top: 6px; flex-wrap: wrap; }
  .pop-fb { background: rgba(252,249,230,.92); color: #0B0F10; border: 2px solid #0B0F10; border-radius: 100px; padding: 7px 11px; font-size: 12.5px; font-weight: 700; cursor: pointer; font-family: inherit; }
  .pop-fb.on-up { background: #0B0F10; color: #D6E50B; }
  .pop-fb.on-down { background: #0B0F10; color: #FF5B40; }
  .pop-wl { margin-left: auto; background: #0B0F10; color: #FCF9E6; border: 2px solid #0B0F10; border-radius: 100px; padding: 8px 14px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; cursor: pointer; font-family: inherit; }
  .pop-wl.done { background: transparent; color: inherit; border-color: currentColor; cursor: default; }
  .pop-deco { position: absolute; right: -10px; bottom: -22px; font-size: 110px; opacity: .12; pointer-events: none; line-height: 1; }
  .rec-card {
    background: var(--paper-soft);
    border: 1px solid var(--paper-line);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .rec-card .title { font-family: "Archivo Black", "Arial Black", Arial, sans-serif; font-size: 16.5px; font-weight: 600; }
  .rec-card .author { font-size: 13px; color: var(--sage); }
  .rec-card .why { font-size: 13.5px; line-height: 1.55; color: var(--ink); opacity: .88; }
  .rec-card .match { font-size: 11.5px; color: var(--brass); font-weight: 600; letter-spacing: .02em; }
  .rec-actions { display: flex; gap: 8px; margin-top: auto; align-items: center; }
  .fb-btn { background: none; border: 1px solid var(--paper-line); border-radius: 4px; padding: 5px 9px; cursor: pointer; font-size: 13px; color: var(--sage); }
  .fb-btn.active-up { background: var(--ok); border-color: var(--ok); color: #fff; }
  .fb-btn.active-down { background: var(--ribbon); border-color: var(--ribbon); color: #fff; }

  .loading-line { display: flex; align-items: center; gap: 10px; color: var(--sage); font-size: 13.5px; padding: 10px 0; }
  .spinner {
    width: 14px; height: 14px; border-radius: 50%;
    border: 2px solid var(--paper-line); border-top-color: var(--brass);
    animation: spin 0.8s linear infinite;
  }
  @keyframes spin { to { transform: rotate(360deg); } }

  /* Chat */
  .chat-wrap { display: flex; flex-direction: column; height: calc(100vh - 330px); height: calc(100dvh - 330px); min-height: 460px; }
  .chat-hero { display: flex; gap: 18px; align-items: center; margin-bottom: 18px; }
  .chat-hero h1 { font-size: clamp(30px, 4.4vw, 46px); line-height: .95; }
  .chat-hero p { font-size: 14px; color: var(--sage); margin: 8px 0 10px; max-width: 58ch; line-height: 1.5; }
  .chat-hero-av { flex: 0 0 auto; width: 104px; height: 104px; border-radius: 50%; border: 3px solid #0B0F10; overflow: hidden; background: #007E94; box-shadow: 5px 5px 0 #D6E50B; animation: tmBob 3.2s ease-in-out infinite; }
  .chat-hero-av img, .ai-av img { width: 100%; height: 100%; display: block; object-fit: cover; }
  @keyframes tmBob { 0%,100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-4px) rotate(2deg); } }
  .tm-online { display: inline-flex; align-items: center; gap: 7px; background: #0B0F10; color: #D6E50B; border-radius: 100px; padding: 6px 12px; font-size: 12px; font-weight: 700; }
  .tm-dot { width: 8px; height: 8px; border-radius: 50%; background: #D6E50B; animation: tmPulse 1.6s ease-in-out infinite; }
  @keyframes tmPulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }
  .ai-row { display: flex; gap: 10px; align-items: flex-end; align-self: flex-start; max-width: 88%; min-width: 0; }
  .ai-av { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%; border: 2px solid #0B0F10; overflow: hidden; background: #007E94; }
  .ai-body { min-width: 0; }
  .typing { display: inline-flex; gap: 5px; padding: 4px 2px; }
  .typing span { width: 8px; height: 8px; border-radius: 50%; background: var(--ink); animation: tmType 1s ease-in-out infinite; }
  .typing span:nth-child(2) { animation-delay: .15s; } .typing span:nth-child(3) { animation-delay: .3s; }
  @keyframes tmType { 0%,100% { transform: translateY(0); opacity: .4; } 50% { transform: translateY(-5px); opacity: 1; } }
  .chat-empty { display: flex; gap: 12px; align-items: flex-end; margin-top: 6px; }
  .chat-empty .bubble { background: #FCF9E6; border: 2px solid #0B0F10; border-radius: 22px 22px 22px 6px; padding: 16px 18px; max-width: 460px; font-size: 14.5px; line-height: 1.55; color: #0B0F10; }
  .chat-empty .bubble b { font-family: "Archivo Black", "Arial Black", Arial, sans-serif; text-transform: uppercase; font-weight: 400; font-size: 17px; display: block; margin-bottom: 4px; }
  .chat-chip { border: 2px solid #0B0F10; border-radius: 18px; padding: 12px 14px; background: var(--sc); color: var(--sf); font-family: inherit; font-weight: 700; font-size: 13px; text-align: left; cursor: pointer; display: flex; gap: 8px; align-items: center; transition: transform .12s ease; box-shadow: 0 3px 0 #0B0F10; }
  @media (hover: hover) { .chat-chip:hover { transform: translateY(-2px); } }
  .chat-chip .se { font-size: 20px; }
  .chat-send { flex: 0 0 auto; width: 50px; height: 50px; border-radius: 50%; border: 2px solid #0B0F10; background: #FF5B40; color: #FCF9E6; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 3px 0 #0B0F10; }
  .chat-send:active { transform: translateY(2px); box-shadow: 0 1px 0 #0B0F10; }
  .chat-mic { flex: 0 0 auto; width: 50px; height: 50px; border-radius: 50%; border: 2px solid #0B0F10; background: var(--paper); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 3px 0 #0B0F10; }
  .chat-mic:active { transform: translateY(2px); box-shadow: 0 1px 0 #0B0F10; }
  .chat-mic.ascolto { background: #D6E50B; color: #0B0F10; animation: micPulsa 1.2s ease-in-out infinite; }
  @keyframes micPulsa { 0%, 100% { box-shadow: 0 3px 0 #0B0F10, 0 0 0 0 rgba(214,229,11,.7); } 50% { box-shadow: 0 3px 0 #0B0F10, 0 0 0 10px rgba(214,229,11,0); } }
  @media (prefers-reduced-motion: reduce) { .chat-mic.ascolto { animation: none; } }
  .msg-books { display: flex; align-items: flex-start; gap: 14px; overflow-x: auto; overflow-y: hidden; padding: 16px 16px 10px 6px; margin: 0 -4px; scroll-snap-type: x proximity; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
  .flip { flex: 0 0 214px; width: 214px; height: 320px; perspective: 900px; scroll-snap-align: start; cursor: pointer; align-self: flex-start; }
  .flip-in { position: relative; width: 100%; height: 100%; transition: transform .5s cubic-bezier(.2,.8,.2,1); transform-style: preserve-3d; }
  .flip.flipped .flip-in { transform: rotateY(180deg); }
  .flip-face { position: absolute; inset: 0; border-radius: 22px; padding: 16px; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: flex; flex-direction: column; background: var(--fc); color: var(--ff); border: 2px solid #0B0F10; -webkit-transform: translateZ(1px); transform: translateZ(1px); transition: visibility 0s linear .25s; }
  .flip:not(.flipped) .flip-back, .flip.flipped .flip-front { visibility: hidden; }
  .flip-face.front { overflow: visible; }
  .flip-in { -webkit-transform-style: preserve-3d; }
  .flip-back { transform: rotateY(180deg) translateZ(1px); -webkit-transform: rotateY(180deg) translateZ(1px); overflow: hidden; padding: 14px; }
  .fc-label { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; margin-top: 34px; position: relative; z-index: 1; max-width: 78%; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .fc-title { font-family: "Archivo Black", "Arial Black", Arial, sans-serif; text-transform: uppercase; font-size: 23px; line-height: 1; margin-top: 6px; position: relative; z-index: 1; overflow-wrap: anywhere; hyphens: auto; max-width: 92%;
    display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
  .fc-title.lg { font-size: 19px; -webkit-line-clamp: 5; }
  .fc-title.xl { font-size: 16px; -webkit-line-clamp: 6; }
  .fc-author { font-size: 12.5px; font-weight: 600; margin-top: 8px; position: relative; z-index: 1; opacity: .9; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 92%; }
  .fc-more { margin-top: auto; font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; position: relative; z-index: 1; }
  .sticker { position: absolute; width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 26px; background: #FCF9E6; color: #0B0F10; border: 2px solid #0B0F10; box-shadow: 2px 2px 0 rgba(11,15,16,.25); z-index: 2; }
  .sticker.s1 { top: -12px; right: 16px; transform: rotate(12deg); }
  .sticker.s2 { bottom: 40px; right: -12px; width: 54px; height: 54px; font-size: 28px; transform: rotate(-10deg); }
  .sticker.s3 { top: 12px; left: 12px; width: 34px; height: 34px; font-size: 17px; }
  .fb-reason { font-size: 12.5px; line-height: 1.45; margin-top: 6px; flex: 1 1 auto; min-height: 0; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
  .fb-pub { align-self: flex-start; font-size: 11px; font-weight: 700; border: 1.5px solid currentColor; border-radius: 100px; padding: 2px 9px; margin-top: 8px; flex: 0 0 auto; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .fb-actions { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; flex: 0 0 auto; }
  .fb-wl { background: #0B0F10; color: #FCF9E6; border: 2px solid #0B0F10; border-radius: 100px; padding: 8px 10px; font-size: 11.5px; font-weight: 800; text-transform: uppercase; cursor: pointer; font-family: inherit; text-align: center; }
  .flip-face.dark .fb-wl { background: #D6E50B; color: #0B0F10; border-color: #D6E50B; }
  .fb-wl.done { background: transparent !important; color: inherit !important; border-color: currentColor !important; cursor: default; }
  .fb-back { font-size: 11.5px; font-weight: 700; opacity: .85; text-align: center; cursor: pointer; }
  @media (prefers-reduced-motion: reduce) { .flip-in { transition: none; } .chat-hero-av, .tm-dot, .typing span { animation: none; } }

  .chat-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 4px 2px 14px; }
  .msg { max-width: 74%; padding: 11px 14px; border-radius: 12px; font-size: 14px; line-height: 1.55; }
  .msg.user { align-self: flex-end; background: #D6E50B; color: #0B0F10; border: 2px solid #0B0F10; border-radius: 20px 20px 6px 20px; font-weight: 600; }
  .msg.ai { background: var(--paper-soft); border: 2px solid var(--ink); border-radius: 20px 20px 20px 6px; max-width: 100%; }
  .msg-modello { font-size: 11px; opacity: .55; margin-top: 6px; }
  .chat-suggestions { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin: 6px 0 14px; }
  .chat-suggestions:empty { display: none; }
  .chat-input-row { display: flex; gap: 10px; align-items: center; border-top: 2px dashed var(--paper-line); padding-top: 14px; }
  .chat-input-row input {
    flex: 1; font-family: inherit; font-size: 14px; padding: 12px 14px;
    border-radius: 100px; border: 1px solid var(--paper-line); background: var(--paper-soft); color: var(--ink); outline: none;
  }
  .chat-input-row input:focus { border-color: var(--brass); }
  .msg.ai .msg-text b { color: var(--ink); }
  .msg.ai .msg-text ul { margin: 6px 0 0; padding-left: 18px; }
  .msg.ai .msg-text li { margin-bottom: 3px; }
  .msg-book-card {
    background: var(--paper); border: 1px solid var(--paper-line); border-radius: 6px;
    padding: 10px 12px; display: flex; gap: 10px; align-items: flex-start;
  }
  .msg-book-card .spine-dot { width: 6px; align-self: stretch; border-radius: 2px; background: var(--ribbon); flex: 0 0 auto; }
  .msg-book-card .info { flex: 1; min-width: 0; }
  .msg-book-card .t { font-family: "Archivo Black", "Arial Black", Arial, sans-serif; font-weight: 600; font-size: 14px; }
  .msg-book-card .a { font-size: 12px; color: var(--sage); margin-top: 1px; }
  .msg-book-card .r { font-size: 12.5px; color: var(--ink); opacity: .82; margin-top: 5px; line-height: 1.45; }
  .msg-book-card .add-wl { flex: 0 0 auto; }

  /* Wishlist */
  .wl-tabs { display: flex; gap: 8px; margin-bottom: 18px; }
  .wl-tab { padding: 7px 14px; border-radius: 100px; border: 1px solid var(--paper-line); background: var(--paper-soft); font-size: 12.5px; cursor: pointer; color: var(--sage); }
  .wl-tab.active { background: var(--forest-deep); color: #FCF9E6; border-color: var(--forest-deep); }
  .status-select { font-family: inherit; font-size: 12px; padding: 5px 8px; border-radius: 4px; border: 1px solid var(--paper-line); background: var(--paper); color: var(--ink); }

  .stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 20px; }
  .stat-card { background: var(--paper-soft); border: 1px solid var(--paper-line); border-radius: 8px; padding: 16px; }
  .stat-card .num { font-family: "Archivo Black", "Arial Black", Arial, sans-serif; font-size: 26px; color: var(--ok); overflow-wrap: anywhere; }
  .stat-card .label { font-size: 12px; color: var(--sage); margin-top: 4px; }

  .status-banner {
    font-size: 12.5px; color: var(--sage); background: var(--paper-soft);
    border: 1px solid var(--paper-line); border-radius: 6px; padding: 9px 12px; margin-bottom: 18px;
  }

  /* Onboarding quiz modal */
  .modal-overlay {
    position: fixed; inset: 0; background: rgba(15,23,18,0.55);
    display: flex; align-items: center; justify-content: center;
    padding: 24px; z-index: 50;
  }
  .modal-overlay.hidden { display: none; }
  .modal-card {
    background: var(--paper); border: 1px solid var(--paper-line); border-radius: 10px;
    max-width: 520px; width: 100%; padding: 30px; max-height: 88vh; overflow-y: auto;
  }
  .modal-card h2 { font-size: 22px; color: var(--ink); }
  .modal-card .step-hint { font-size: 12px; color: var(--sage); margin-top: 4px; letter-spacing: .02em; }
  .modal-card .q-title { font-size: 15px; font-weight: 600; margin: 22px 0 10px; color: var(--ink); }
  .modal-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 26px; }
  .skip-link { background: none; border: none; color: var(--sage); font-size: 12.5px; cursor: pointer; text-decoration: underline; padding: 10px 4px; min-height: 40px; }

  /* Search-as-you-type suggestions */
  .search-wrap { position: relative; }
  .suggest-list {
    position: absolute; top: calc(100% + 4px); left: 0; right: 0;
    background: var(--paper); border: 1px solid var(--paper-line); border-radius: 6px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.12); z-index: 10; overflow: hidden;
    max-height: 260px; overflow-y: auto;
  }
  .suggest-item {
    padding: 10px 13px; cursor: pointer; font-size: 13.5px; border-bottom: 1px solid var(--paper-line);
  }
  .suggest-item:last-child { border-bottom: none; }
  .suggest-item:hover { background: var(--paper-soft); }
  .suggest-item .t { font-family: "Archivo Black", "Arial Black", Arial, sans-serif; font-weight: 600; }
  .suggest-item .a { color: var(--sage); font-size: 12px; }
  .suggest-hint { font-size: 11.5px; color: var(--sage); margin-top: 5px; }

  .mood-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
  .mix-row { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--sage); margin-bottom: 18px; }
  .mix-row input[type=range] { accent-color: var(--brass); width: 160px; }

  /* Journey */
  .streak-card {
    background: var(--forest-deep); color: #FCF9E6; border-radius: 10px;
    padding: 22px; display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: center;
  }
  .streak-num { font-family: "Archivo Black", "Arial Black", Arial, sans-serif; font-size: 58px; line-height: .9; color: var(--brass); }
  .streak-label { font-size: 12px; color: #9BA098; margin-top: 4px; }
  .streak-week { display: flex; gap: 6px; margin: 12px 0 14px; }
  .streak-day { width: 28px; height: 28px; border-radius: 50%; border: 2px solid #34393A; display: flex; align-items: center; justify-content: center; font-size: 10.5px; color: #9BA098; }
  .streak-day.on { background: var(--brass); border-color: var(--brass); color: #0B0F10; font-weight: 700; }
  .streak-day.today { border-color: #FCF9E6; }
  .checkin-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
  .checkin-row input { width: 90px; font-family: inherit; font-size: 13px; padding: 9px 11px; border-radius: 100px; border: 1px solid #34393A; background: #1E2324; color: #FCF9E6; }
  .section-title { font-size: 18px; margin: 34px 0 14px; }
  .badge-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
  .badge {
    border: 2px solid var(--paper-line); border-radius: 10px; padding: 14px 10px; text-align: center; background: var(--paper-soft);
  }
  .badge .ico { font-size: 26px; line-height: 1; filter: grayscale(1); opacity: .35; }
  .badge .nm { font-weight: 700; font-size: 12.5px; margin-top: 8px; }
  .badge .ds { font-size: 11px; color: var(--sage); margin-top: 3px; line-height: 1.35; }
  .badge.earned { border-color: var(--ink); background: var(--paper); }
  .badge.earned .ico { filter: none; opacity: 1; }

  /* Community */
  .list-card { background: var(--paper-soft); border: 1px solid var(--paper-line); border-radius: 10px; padding: 16px; }
  .list-card + .list-card { margin-top: 12px; }
  .list-card .lt { font-family: "Archivo Black", "Arial Black", Arial, sans-serif; text-transform: uppercase; font-size: 15px; }
  .list-card .lm { font-size: 12px; color: var(--sage); margin-top: 3px; }
  .list-card .ld { font-size: 13.5px; margin-top: 8px; line-height: 1.5; }
  .list-books { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
  .list-book { display: flex; align-items: center; gap: 10px; font-size: 13.5px; padding: 7px 10px; background: var(--paper); border-radius: 6px; }
  .list-book .lb-t { flex: 1; min-width: 0; }
  .list-book .lb-t b { font-weight: 700; }
  .list-book .lb-t span { color: var(--sage); font-size: 12px; }
  .pick-list { max-height: 220px; overflow-y: auto; border: 1px solid var(--paper-line); border-radius: 6px; background: var(--paper); }
  .pick-item { display: flex; gap: 10px; align-items: center; padding: 8px 11px; font-size: 13.5px; border-bottom: 1px solid var(--paper-line); cursor: pointer; }
  .pick-item:last-child { border-bottom: none; }
  .pick-item input { accent-color: var(--ok); }
  .field label.pick-item { font-size: 13.5px; font-weight: 400; color: var(--ink); }
  .seg { display: inline-flex; border: 2px solid var(--ink); border-radius: 100px; overflow: hidden; margin-bottom: 18px; }
  .seg button { background: none; border: none; padding: 8px 16px; font-size: 12.5px; font-weight: 700; cursor: pointer; color: var(--ink); }
  .seg button.on { background: var(--ink); color: var(--paper); }
  .cat-tabs { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
  .cat-tab {
    display: inline-flex; align-items: center; gap: 8px;
    border: 2px solid var(--ink); background: var(--paper); color: var(--ink);
    padding: 9px 16px; border-radius: 100px; cursor: pointer;
    font-family: "Archivo Black", "Arial Black", Arial, sans-serif; font-size: 12.5px; text-transform: uppercase;
  }
  .cat-tab .star { font-size: 15px; line-height: 1; }
  .cat-tab .count { font-family: "Work Sans", Arial, sans-serif; font-weight: 700; font-size: 11px; opacity: .7; }
  .cat-tab.on { color: var(--cat-fg); background: var(--cat-bg); border-color: var(--cat-bg); }
  .cat-desc { font-size: 13.5px; color: var(--sage); margin: 4px 0 20px; max-width: 60ch; line-height: 1.5; }
  .crec { background: var(--paper-soft); border: 1px solid var(--paper-line); border-left: 6px solid var(--cat-bg); border-radius: 8px; padding: 15px 16px; }
  .crec + .crec { margin-top: 10px; }
  .crec .ct { font-family: "Archivo Black", "Arial Black", Arial, sans-serif; text-transform: uppercase; font-size: 15px; }
  .crec .ca { font-size: 13px; color: var(--sage); margin-top: 2px; }
  .crec .cn { font-size: 14px; line-height: 1.55; margin-top: 9px; }
  .crec .cb { font-size: 12px; color: var(--sage); margin-top: 9px; }
  .crec-actions { display: flex; gap: 8px; margin-top: 12px; align-items: center; flex-wrap: wrap; }
  .vote-btn { background: var(--paper); border: 2px solid var(--ink); color: var(--ink); border-radius: 100px; padding: 6px 12px; font-size: 12px; font-weight: 700; cursor: pointer; }
  .vote-btn.on { background: var(--ink); color: var(--paper); }
  .toast {
    position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
    background: var(--forest-deep); color: #FCF9E6; padding: 12px 18px; border-radius: 100px; font-size: 13.5px;
    z-index: 60; box-shadow: 0 6px 18px rgba(0,0,0,.25); display: none;
  }
  .toast.show { display: block; }

  /* ---------- Reading archive (dashboard) ---------- */
  #view-dashboard { max-width: 920px; }
  body.on-dashboard .main-top { display: none; }
  .ra-head { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 14px; margin-bottom: 22px; }
  .ra-avatar { width: 52px; height: 52px; font-size: 17px; }
  .ra-hello { text-align: left; }
  .ra-hi { font-size: clamp(26px, 4vw, 38px) !important; }
  .ra-hi { font-family: "Archivo Black", "Arial Black", Arial, sans-serif; text-transform: uppercase; font-size: 20px; line-height: 1.1; }
  .ra-date { font-size: 13.5px; color: var(--sage); margin-top: 3px; }
  .ra-search { width: 50px; height: 50px; border-radius: 50%; border: 2px solid var(--paper-line); background: var(--paper); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
  .ra-search:hover { border-color: var(--ink); }
  .ra-kicker { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--sage); margin: 0 0 10px 4px; }

  .challenge {
    position: relative; overflow: hidden; border-radius: 26px; background: #D6E50B; color: #0B0F10;
    padding: 26px 26px 24px; display: grid; grid-template-columns: 1fr 200px; gap: 10px; min-height: 220px;
  }
  .challenge.done { background: #007E94; color: #FCF9E6; }
  .ch-title { font-family: "Archivo Black", "Arial Black", Arial, sans-serif; text-transform: uppercase; font-size: clamp(30px, 4.2vw, 44px); line-height: .95; }
  .ch-text { font-size: 15px; font-weight: 600; margin-top: 10px; max-width: 34ch; line-height: 1.4; }
  .ch-progress { margin-top: 16px; max-width: 340px; }
  .ch-bar { height: 10px; border-radius: 10px; background: rgba(11,15,16,.15); overflow: hidden; }
  .challenge.done .ch-bar { background: rgba(252,249,230,.25); }
  .ch-bar span { display: block; height: 100%; background: #0B0F10; border-radius: 10px; transition: width .4s ease; }
  .challenge.done .ch-bar span { background: #D6E50B; }
  .ch-meta { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; margin-top: 6px; }
  .ch-actions { display: flex; gap: 10px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
  .ch-pill { display: inline-flex; align-items: center; gap: 6px; background: #0B0F10; color: #D6E50B; border-radius: 100px; padding: 6px 12px; font-size: 12px; font-weight: 700; }
  .challenge.done .ch-pill { background: #FCF9E6; color: #0B0F10; }
  .ch-go { background: #0B0F10; color: #FCF9E6; border: none; border-radius: 100px; padding: 10px 18px; font-weight: 700; font-size: 12.5px; text-transform: uppercase; letter-spacing: .03em; cursor: pointer; }
  .ch-art { align-self: end; justify-self: end; width: 200px; }
  .ch-art svg { width: 100%; height: auto; display: block; }

  .week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-top: 18px; }
  .wday { border: 2px solid var(--paper-line); border-radius: 100px; padding: 10px 0 12px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 2px; background: var(--paper); color: var(--ink); }
  .wday .dot { width: 6px; height: 6px; border-radius: 50%; background: transparent; margin-bottom: 3px; }
  .wday.read .dot { background: #007E94; }
  .wday .wd { font-size: 12.5px; opacity: .65; }
  .wday .wn { font-size: 16px; font-weight: 700; }
  .wday.today { background: #0B0F10; border-color: #0B0F10; color: #FCF9E6; }
  .wday.today .wd { opacity: .8; }
  .wday.today.read .dot { background: #D6E50B; }
  .wday.future { opacity: .45; }
  .checkin-inline { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
  .ci-streak { font-size: 13.5px; font-weight: 600; }
  .ci-form { display: flex; gap: 8px; }
  .ci-form input { width: 150px; font-family: inherit; font-size: 13px; padding: 9px 14px; border-radius: 100px; border: 2px solid var(--paper-line); background: var(--paper); color: var(--ink); outline: none; }
  .ci-form input:focus { border-color: var(--ink); }

  .ra-title { font-size: 24px; margin: 34px 0 16px; }
  .bento { display: grid; grid-template-columns: 1.1fr 1fr; grid-template-rows: auto auto auto; gap: 14px; }
  .tile { border-radius: 24px; padding: 20px; position: relative; overflow: hidden; text-align: left; border: none; font-family: inherit; }
  .tile-count { grid-row: span 2; background: #FF5B40; color: #0B0F10; display: flex; flex-direction: column; min-height: 300px; }
  .tile-loved { background: #007E94; color: #FCF9E6; min-height: 150px; }
  .tile-badge { background: #0B0F10; color: #FCF9E6; cursor: pointer; }
  .t-big { font-family: "Archivo Black", "Arial Black", Arial, sans-serif; font-size: 96px; line-height: .85; margin-top: 6px; }
  .t-h { font-family: "Archivo Black", "Arial Black", Arial, sans-serif; text-transform: uppercase; font-size: 20px; line-height: 1.05; overflow-wrap: anywhere; }
  .t-s { font-size: 13px; margin-top: 6px; line-height: 1.45; opacity: .9; }
  .t-spines { display: flex; gap: 5px; align-items: flex-end; margin-top: auto; padding-top: 18px; height: 110px; }
  .t-spines span { width: 16px; border: 2px solid #0B0F10; border-radius: 3px 3px 0 0; }
  .t-stars { color: #D6E50B; letter-spacing: 2px; margin-top: 8px; font-size: 15px; }
  .t-bar { height: 8px; border-radius: 8px; background: #34393A; margin-top: 12px; overflow: hidden; }
  .t-bar span { display: block; height: 100%; background: #D6E50B; border-radius: 8px; }
  .t-link { font-size: 12px; font-weight: 700; margin-top: 10px; color: #D6E50B; }
  .t-ico { position: absolute; right: 16px; top: 14px; font-size: 30px; }
  .tile-badge .t-tag { display: block; padding-right: 40px; }

  .news-row { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
  .news-card { flex: 0 0 260px; scroll-snap-align: start; border-radius: 20px; padding: 18px; min-height: 170px; display: flex; flex-direction: column; gap: 8px; position: relative; }
  .news-card .nk { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
  .news-card .nt { font-family: "Archivo Black", "Arial Black", Arial, sans-serif; text-transform: uppercase; font-size: 16px; line-height: 1.1; }
  .news-card .nx { font-size: 13px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
  .news-leggi { align-self: flex-start; background: none; border: none; padding: 0; color: inherit; font-family: inherit; font-weight: 800; font-size: 12.5px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
  #nwText.nw-text { min-height: 180px; resize: vertical; }
  .news-art { max-width: 640px !important; position: relative; }
  .na-chiudi { position: absolute; top: 12px; right: 12px; z-index: 2; background: var(--paper); }
  .na-foto { margin: -30px -30px 18px; aspect-ratio: 16 / 9; overflow: hidden; border-bottom: 2px solid var(--ink); }
  .na-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .na-tipo { display: inline-block; border-radius: 100px; padding: 4px 12px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; border: 2px solid #0B0F10; }
  .news-art h2 { font-family: "Archivo Black", "Arial Black", Arial, sans-serif; font-weight: 400; text-transform: uppercase; font-size: clamp(22px, 4vw, 30px); line-height: 1.05; margin: 12px 0 6px; padding-right: 30px; }
  .na-data { font-size: 12.5px; color: var(--sage); margin-bottom: 18px; }
  .na-testo { font-size: 15.5px; line-height: 1.7; margin-bottom: 18px; }
  .na-testo p { margin: 0 0 14px; white-space: pre-line; overflow-wrap: anywhere; }
  @media (max-width: 640px) { .na-foto { margin: -30px -30px 16px; } }
  .news-card .nd { font-size: 11.5px; margin-top: auto; opacity: .75; }
  .news-card a { color: inherit; font-weight: 700; font-size: 12.5px; }
  .news-card .icon-btn { position: absolute; top: 10px; right: 10px; color: inherit; }
  .news-card.has-photo { padding-top: 0; overflow: hidden; }
  .news-photo { margin: 0 -18px 6px; aspect-ratio: 4 / 3; border-bottom: 2px solid #0B0F10; overflow: hidden; background: rgba(11,15,16,.1); }
  .news-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .news-tools { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; z-index: 2; }
  .news-tools button { width: 32px; height: 32px; border-radius: 50%; border: 2px solid #0B0F10; background: #FCF9E6; color: #0B0F10; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
  .news-tools button:hover { background: #D6E50B; }
  .news-card.admin:not(.has-photo) .nk { padding-right: 78px; min-height: 34px; display: flex; align-items: center; margin-top: -6px; }
  .nw-photo { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 4px; aspect-ratio: 4 / 3; max-width: 280px; margin-bottom: 14px; border: 2px dashed var(--ink); border-radius: 16px; background: var(--paper-soft); cursor: pointer; padding: 16px; overflow: hidden; color: var(--ink); }
  .nw-photo.has { border-style: solid; padding: 0; }
  .nw-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .nw-photo b { font-size: 14px; }
  .nw-photo span { font-size: 12px; color: var(--sage); }
  .news-admin { margin-top: 14px; border: 2px dashed var(--paper-line); border-radius: 16px; padding: 16px; }
  .news-admin summary { cursor: pointer; font-weight: 700; font-size: 13.5px; }

  /* ---------- Community feed (Instagram style) ---------- */
  #view-community, #view-communitypost { max-width: 620px; }
  .ig-stories { display: flex; gap: 14px; overflow-x: auto; padding: 4px 2px 12px; margin-bottom: 8px; }
  .ig-story { flex: 0 0 auto; background: none; border: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; width: 82px; font-family: inherit; color: var(--ink); padding: 0; }
  .ig-ring { width: 72px; height: 72px; border-radius: 50%; padding: 3px; background: conic-gradient(var(--rc), #D6E50B, #FF5B40, var(--rc)); display: flex; transition: transform .15s ease; }
  .ig-story.on .ig-ring { background: #0B0F10; transform: scale(1.06); }
  .ig-bubble { flex: 1; border-radius: 50%; border: 3px solid var(--paper); display: flex; align-items: center; justify-content: center; font-size: 30px; }
  .ig-sname { font-size: 11.5px; font-weight: 700; text-align: center; line-height: 1.2; }
  .ig-story.on .ig-sname { text-decoration: underline; text-underline-offset: 3px; }
  .ig-scount { font-size: 10.5px; color: var(--sage); margin-top: -4px; }
  .ig-new { width: 100%; margin: 6px 0 22px; }
  .ig-feed { display: flex; flex-direction: column; gap: 22px; }
  .avv-cit { margin: 0 0 12px; padding: 10px 14px; border-left: 3px solid #FF5B40; background: var(--paper-soft); font-style: italic; font-size: 13.5px; line-height: 1.5; overflow-wrap: anywhere; }
  .pp-card { max-width: 460px !important; }
  .pp-illo { width: 90px; margin-bottom: 6px; }
  .pp-card h2 { text-align: center; font-family: "Archivo Black", "Arial Black", Arial, sans-serif; font-weight: 400; text-transform: uppercase; font-size: 22px; }
  .pp-sub { text-align: center; font-size: 13.5px; color: var(--sage); line-height: 1.5; margin: 6px 0 10px; }
  .pp-lista .push-riga { justify-content: flex-start; }
  .pp-lista .push-riga > span:nth-child(2) { flex: 1; min-width: 0; }
  .pp-lista .ig-av { width: 44px; height: 44px; flex: 0 0 auto; font-size: 14px; }
  .sugg { background: #D6E50B; color: #0B0F10; border: 2px solid #0B0F10; border-radius: 22px; padding: 16px 0 16px 16px; box-shadow: 4px 4px 0 #0B0F10; min-width: 0; }
  .sugg-head { padding-right: 16px; margin-bottom: 12px; }
  .sugg-head b { display: block; font-family: "Archivo Black", "Arial Black", Arial, sans-serif; font-weight: 400; text-transform: uppercase; font-size: 17px; }
  .sugg-head span { font-size: 12.5px; font-weight: 600; opacity: .75; }
  .sugg-row { display: flex; gap: 10px; overflow-x: auto; padding: 2px 16px 6px 0; scroll-snap-type: x mandatory; }
  .sugg-card { position: relative; flex: 0 0 152px; scroll-snap-align: start; background: #FCF9E6; border: 2px solid #0B0F10; border-radius: 18px; padding: 14px 10px 12px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; }
  .sugg-av { width: 58px; height: 58px; font-size: 18px; }
  .sugg-nick { font-size: 13.5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sugg-why { font-size: 11.5px; line-height: 1.35; color: #34393A; min-height: 31px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .sugg-follow { margin-top: auto; width: 100%; background: #0B0F10; color: #FCF9E6; border: 2px solid #0B0F10; border-radius: 100px; padding: 7px 10px; font-family: inherit; font-weight: 800; font-size: 12.5px; cursor: pointer; }
  .sugg-follow:hover { background: #FF5B40; border-color: #FF5B40; color: #0B0F10; }
  .sugg-x { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border: none; background: none; color: #0B0F10; opacity: .45; cursor: pointer; font-size: 12px; border-radius: 50%; }
  .sugg-x:hover { opacity: 1; background: rgba(11,15,16,.08); }
  .ig-post { background: var(--paper); border: 2px solid var(--ink); border-radius: 22px; overflow: hidden; }
  .ig-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
  .ig-av { width: 38px; height: 38px; border-radius: 50%; border: 2px solid #0B0F10; display: flex; align-items: center; justify-content: center; font-family: "Archivo Black", "Arial Black", Arial, sans-serif; font-size: 13px; flex: 0 0 auto; }
  .ig-who { display: flex; flex-direction: column; min-width: 0; }
  .ig-who b { font-size: 14px; }
  .ig-who span { font-size: 12px; color: var(--sage); display: inline-flex; align-items: center; gap: 4px; }
  .ig-who .cat-ic { font-size: 14px; }
  .ig-own { margin-left: auto; display: flex; gap: 2px; }
  .ig-more { background: none; border: none; font-size: 17px; cursor: pointer; padding: 6px 8px; border-radius: 50%; color: var(--ink); }
  .ig-comments { padding: 8px 14px 0; display: flex; flex-direction: column; gap: 5px; }
  .ig-cmt { display: flex; justify-content: space-between; gap: 8px; font-size: 13.5px; line-height: 1.45; }
  .ig-cmt small { color: var(--sage); font-size: 11px; margin-left: 4px; }
  .ig-cmt-x { background: none; border: none; color: var(--sage); cursor: pointer; font-size: 12px; padding: 0 4px; flex: 0 0 auto; }
  .ig-cmt-x:hover { color: var(--ribbon); }
  .ig-cmt-more { background: none; border: none; color: var(--sage); font-size: 13px; padding: 0; cursor: pointer; text-align: left; font-family: inherit; }
  .ig-add-cmt { display: flex; align-items: center; gap: 10px; border-top: 2px dashed var(--paper-line); padding: 10px 14px 12px; }
  .ig-av.sm { width: 30px; height: 30px; font-size: 10.5px; }
  .ig-add-cmt input { flex: 1; min-width: 0; border: none; background: transparent; font-family: inherit; font-size: 14px; color: var(--ink); outline: none; padding: 6px 0; }
  .ig-add-cmt button { background: none; border: none; color: #007E94; font-weight: 800; font-size: 13.5px; cursor: pointer; font-family: inherit;  min-height: 38px; padding: 8px 14px; }
  .ig-add-cmt button:disabled { opacity: .35; cursor: default; }
  .ig-more:hover { background: var(--paper-soft); }
  .ig-photo { position: relative; aspect-ratio: 1 / 1; background: var(--paper-soft); border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); overflow: hidden; user-select: none; }
  .ig-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .ig-loading { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
  .ig-cover { width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; padding: 26px; position: relative; }
  .ig-cover-e { position: absolute; top: 18px; right: 22px; font-size: 96px; line-height: 0; transform: rotate(10deg); }
  .ig-cover-e .cat-ic { stroke-width: 1.6; }
  .ig-cover-k { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
  .ig-cover-t { font-family: "Archivo Black", "Arial Black", Arial, sans-serif; text-transform: uppercase; font-size: clamp(30px, 7vw, 46px); line-height: .95; margin-top: 8px; overflow-wrap: anywhere; }
  .ig-cover-a { font-size: 14px; font-weight: 600; margin-top: 10px; }
  .ig-heart { position: absolute; left: 50%; top: 50%; line-height: 0; transform: translate(-50%, -50%) scale(0); opacity: 0; pointer-events: none; filter: drop-shadow(0 4px 10px rgba(0,0,0,.3)); }
  .ig-heart.pop { animation: igHeart .8s ease; }
  @keyframes igHeart { 0% { transform: translate(-50%,-50%) scale(0); opacity: 0; } 20% { transform: translate(-50%,-50%) scale(1.15); opacity: 1; } 60% { transform: translate(-50%,-50%) scale(1); opacity: 1; } 100% { transform: translate(-50%,-50%) scale(1); opacity: 0; } }
  .ig-actions { display: flex; align-items: center; gap: 8px; padding: 10px 14px 2px; }
  .ig-act { background: none; border: none; cursor: pointer; padding: 2px; line-height: 0; transition: transform .12s ease; display: inline-flex; }
  .ig-act .hrt { width: 30px; height: 30px; fill: transparent; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; transition: fill .15s ease; }
  .ig-act:hover .hrt { fill: rgba(255,91,64,.18); }
  .ig-act.liked .hrt { fill: #FF5B40; stroke: #0B0F10; }
  .ig-act.own { cursor: default; opacity: .45; }
  .ig-share { color: var(--ink); margin-left: 2px; }
  .ig-share:hover { color: #FF5B40; }
  .invito-banner.condiviso { text-align: left; padding: 16px 18px; border: 2px solid #D6E50B; }
  .invito-banner.condiviso .cv-kick { display: block; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #D6E50B; margin-bottom: 4px; }
  .invito-banner.condiviso .cv-tit { display: block; font-family: "Archivo Black", "Arial Black", Arial, sans-serif; font-weight: 400; text-transform: uppercase; font-size: 18px; line-height: 1.1; color: #FCF9E6; margin: 2px 0 6px; }
  .invito-banner.condiviso .cv-sub { display: block; font-size: 13px; color: #B9BCB2; }
  .ig-heart .hrt { width: 110px; height: 110px; fill: #FF5B40; stroke: #0B0F10; stroke-width: 1.6; display: block; }
  .ig-act:active, .ig-act.liked { transform: scale(1.12); }
  .ig-tbr { margin-left: auto; background: #0B0F10; color: #FCF9E6; border: 2px solid #0B0F10; border-radius: 100px; padding: 7px 13px; font-size: 12px; font-weight: 800; cursor: pointer; font-family: inherit; }
  .ig-tbr.done { background: transparent; color: var(--ink); border-color: var(--ink); cursor: default; }
  .ig-likes { font-weight: 700; font-size: 13.5px; padding: 6px 14px 0; }
  .ig-caption { font-size: 14px; line-height: 1.5; padding: 6px 14px 0; }
  .ig-caption p { margin: 4px 0 0; }
  .ig-note { white-space: pre-line; overflow-wrap: anywhere; }
  .ig-altro { background: none; border: none; padding: 0; font: inherit; font-weight: 700; color: var(--sage); cursor: pointer; }
  .ig-altro:hover { color: var(--ink); text-decoration: underline; }
  .cr-note { min-height: 140px; resize: vertical; }
  .cr-count { display: block; text-align: right; font-size: 11.5px; color: var(--sage); margin-top: 4px; }
  .ig-pub { font-size: 11.5px; font-weight: 700; border: 1.5px solid currentColor; border-radius: 100px; padding: 1px 8px; margin-left: 4px; white-space: nowrap; }
  .ig-time { font-size: 11.5px; color: var(--sage); padding: 8px 14px 10px; text-transform: uppercase; letter-spacing: .04em; }
  .ig-empty { text-align: center; border: 2px dashed var(--paper-line); border-radius: 22px; padding: 40px 18px; color: var(--sage); font-size: 14px; }
  .ig-empty span { font-size: 42px; display: block; }
  .ig-empty b { display: block; font-family: "Archivo Black", "Arial Black", Arial, sans-serif; text-transform: uppercase; font-weight: 400; color: var(--ink); font-size: 19px; margin: 8px 0 4px; }

  .post-photo { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; aspect-ratio: 1 / 1; max-width: 360px; margin: 0 auto 18px; border: 2px dashed var(--ink); border-radius: 22px; background: var(--paper-soft); cursor: pointer; padding: 22px; overflow: hidden; color: var(--ink); }
  .post-photo:hover { background: #F0EACC; }
  .post-photo.has { border-style: solid; padding: 0; }
  .post-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .post-photo-e { font-size: 48px; line-height: 0; }
  .post-photo b { font-family: "Archivo Black", "Arial Black", Arial, sans-serif; text-transform: uppercase; font-weight: 400; font-size: 18px; }
  .post-photo span:last-child { font-size: 12.5px; color: var(--sage); max-width: 30ch; line-height: 1.45; }
  .post-photo-x { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 50%; border: 2px solid #0B0F10; background: #FCF9E6; color: #0B0F10; cursor: pointer; font-size: 14px; }
  .post-cats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .post-cat { border: 2px solid var(--ink); background: var(--paper); color: var(--ink); border-radius: 16px; padding: 11px 12px; font-family: inherit; font-weight: 700; font-size: 13px; cursor: pointer; display: flex; gap: 8px; align-items: center; text-align: left; }
  .post-cat span { font-size: 22px; line-height: 0; display: inline-flex; }
  .post-cat.on { background: var(--pc); color: var(--pf); border-color: var(--pc); box-shadow: 0 3px 0 #0B0F10; }

  .acc-summary { display: flex; flex-direction: column; gap: 10px; }
  .sg-bar { height: 12px; border-radius: 12px; background: var(--paper-line); overflow: hidden; }
  .sg-bar span { display: block; height: 100%; background: #D6E50B; border-right: 2px solid var(--ink); transition: width .4s ease; }
  .sg-label { font-size: 13px; font-weight: 700; margin-top: 8px; }
  .as-top { display: flex; gap: 14px; align-items: center; }
  .as-av { width: 58px; height: 58px; font-size: 19px; cursor: default; border: 3px solid #0B0F10; flex: 0 0 auto; }
  .as-av:hover { transform: none; }
  .as-id { display: flex; flex-direction: column; min-width: 0; }
  .as-id b { font-size: 16px; }
  .as-id span { font-size: 13px; color: var(--sage); overflow-wrap: anywhere; }
  .as-bio { margin: 0; font-size: 14.5px; line-height: 1.5; font-weight: 600; }
  .as-bio.as-empty { font-weight: 500; font-style: italic; color: var(--sage); }
  .as-news { font-size: 12.5px; font-weight: 700; color: var(--sage); }
  /* avatar photo + bio + inline follow */
  .acc-av-edit { display: flex; gap: 14px; align-items: center; }
  .acc-av-prev { width: 72px; height: 72px; font-size: 24px; flex: 0 0 auto; cursor: default; border: 3px solid #0B0F10; }
  .acc-av-prev:hover { transform: none; }
  .acc-av-ctrl { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
  .acc-av-btns { display: flex; gap: 6px; flex-wrap: wrap; }
  .avatar-opt { padding: 0; font-family: "Archivo Black", "Arial Black", Arial, sans-serif; }
  .avatar-add { background: transparent; border: 2px dashed var(--ink) !important; color: var(--ink); font-family: "Work Sans", Arial, sans-serif; }
  .avatar-add span { font-size: 24px; font-weight: 500; line-height: 1; margin-top: -2px; }
  .avatar-add:hover { background: #D6E50B; border-style: solid !important; }
  .avatar-add.has { border-style: solid !important; }
  #accBio { min-height: 70px; }
  .pf-bio { margin: 14px 0 0; font-size: 14px; line-height: 1.5; font-weight: 600; overflow-wrap: anywhere; }
  .pf-bio.empty { font-weight: 500; opacity: .65; font-style: italic; }
  .ig-nameline { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
  .ig-dot { color: var(--sage); font-weight: 800; }
  .ig-follow { background: none; border: none; padding: 10px 6px; margin: -10px -6px; font-family: inherit; font-weight: 800; font-size: 13px; color: #FF5B40; cursor: pointer; text-transform: uppercase; letter-spacing: .03em; }
  .ig-follow:hover { text-decoration: underline; }
  .ig-av, .pf-av, .avatar-btn { background-clip: padding-box; }

  /* ---------- Social: search, profile, follow, notifications ---------- */
  [hidden] { display: none !important; }
  .us-wrap { position: relative; margin-bottom: 14px; }
  .us-search { display: flex; align-items: center; gap: 10px; border: 2px solid var(--ink); border-radius: 100px; padding: 0 16px; background: var(--paper); color: var(--ink); }
  .us-search input { flex: 1; border: none; outline: none; background: transparent; font-family: inherit; font-size: 14.5px; padding: 12px 0; color: var(--ink); min-width: 0; }
  .us-search:focus-within { box-shadow: 0 0 0 3px var(--brass); }
  .us-results { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20; background: var(--paper); border: 2px solid var(--ink); border-radius: 20px; padding: 6px; box-shadow: 6px 6px 0 #D6E50B; max-height: 380px; overflow-y: auto; }
  .us-label { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--sage); padding: 8px 10px 4px; }
  .us-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 14px; cursor: pointer; }
  .us-row:hover { background: var(--paper-soft); }
  .us-who { display: flex; flex-direction: column; min-width: 0; flex: 1; }
  .us-who b { font-size: 14px; }
  .us-who span { font-size: 12px; color: var(--sage); }
  .us-who em { font-style: normal; font-weight: 700; color: var(--ok); }
  .us-empty { padding: 16px; text-align: center; color: var(--sage); font-size: 13.5px; }
  .fl-btn { flex: 0 0 auto; background: #0B0F10; color: #FCF9E6; border: 2px solid #0B0F10; border-radius: 100px; padding: 9px 18px; font-family: inherit; font-weight: 800; font-size: 13px; cursor: pointer; white-space: nowrap; }
  .fl-btn.sm { padding: 6px 12px; font-size: 12px; }
  .fl-btn.on { background: transparent; color: var(--ink); border-color: var(--ink); }
  .fl-btn:not(.on):hover { background: #FF5B40; border-color: #FF5B40; color: #0B0F10; }
  .ig-av.clickable, .ig-who b.clickable, .ig-cmt b.clickable { cursor: pointer; }
  .ig-who b.clickable:hover, .ig-cmt b.clickable:hover { text-decoration: underline; }
  .feed-tabs { display: inline-flex; border: 2px solid var(--ink); border-radius: 100px; overflow: hidden; margin: 0 0 16px; }
  .feed-tabs button { background: none; border: none; padding: 8px 18px; font-family: inherit; font-weight: 800; font-size: 13px; cursor: pointer; color: var(--ink); }
  .feed-tabs button.on { background: var(--ink); color: var(--paper); }
  .ig-post.flash { box-shadow: 0 0 0 4px #D6E50B; transition: box-shadow .3s ease; }

  #view-profile { max-width: 620px; }
  .pf-head { background: #D6E50B; color: #0B0F10; border: 2px solid #0B0F10; border-radius: 26px; padding: 20px; box-shadow: 6px 6px 0 #0B0F10; margin-bottom: 18px; }
  .pf-top { display: flex; gap: 18px; align-items: center; }
  .pf-av { width: 92px; height: 92px; border-radius: 50%; border: 3px solid #0B0F10; display: flex; align-items: center; justify-content: center; font-family: "Archivo Black", "Arial Black", Arial, sans-serif; font-size: 30px; flex: 0 0 auto; }
  .pf-main { min-width: 0; flex: 1; }
  .pf-nick { font-family: "Archivo Black", "Arial Black", Arial, sans-serif; font-size: 22px; overflow-wrap: anywhere; }
  .pf-follows { display: inline-block; margin-top: 4px; background: #0B0F10; color: #D6E50B; font-size: 11px; font-weight: 800; border-radius: 100px; padding: 3px 10px; }
  .pf-counts { display: flex; gap: 18px; margin-top: 10px; flex-wrap: wrap; }
  .pf-counts > * { background: none; border: none; padding: 0; font-family: inherit; color: inherit; text-align: left; display: flex; flex-direction: column; }
  .pf-counts button { cursor: pointer; }
  .pf-counts button:hover span { text-decoration: underline; }
  .pf-counts b { font-family: "Archivo Black", "Arial Black", Arial, sans-serif; font-size: 20px; font-weight: 400; line-height: 1.1; }
  .pf-counts span { font-size: 12px; font-weight: 700; }
  .pf-actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
  .pf-actions .fl-btn.on { border-color: #0B0F10; color: #0B0F10; }
  .pf-tabs { display: flex; margin-top: 16px; border-top: 2px solid rgba(11,15,16,.25); }
  .pf-tabs button { flex: 1; background: none; border: none; padding: 10px 0 0; cursor: pointer; color: rgba(11,15,16,.45); display: flex; justify-content: center; }
  .pf-tabs button.on { color: #0B0F10; }
  .pf-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
  .pg-thumb { position: relative; aspect-ratio: 1 / 1; border: none; padding: 10px; cursor: pointer; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; text-align: left; font-family: inherit; }
  .pg-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
  .pg-ic { position: absolute; top: 10px; right: 10px; font-size: 26px; line-height: 0; }
  .pg-t { font-family: "Archivo Black", "Arial Black", Arial, sans-serif; text-transform: uppercase; font-size: 13px; line-height: 1.05; overflow-wrap: anywhere; }
  .pg-likes { position: absolute; left: 8px; top: 8px; background: rgba(11,15,16,.8); color: #FCF9E6; font-size: 11px; font-weight: 800; border-radius: 100px; padding: 2px 8px; }
  .pg-thumb:hover { filter: brightness(.95); }

  .bell { position: relative; width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--ink); background: transparent; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
  .bell:hover, .bell[aria-expanded="true"] { background: var(--ink); color: var(--paper); }
  .bell-badge { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; border-radius: 100px; background: #FF5B40; color: #FCF9E6; border: 2px solid var(--paper); font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
  .tb-right { position: relative; }
  .notif-panel { position: absolute; right: 0; top: calc(100% + 10px); width: 380px; max-width: calc(100vw - 32px); max-height: min(520px, 75vh); overflow-y: auto; background: var(--paper); color: var(--ink); border: 2px solid #0B0F10; border-radius: 22px; box-shadow: 6px 6px 0 #D6E50B; z-index: 40; padding: 8px; }
  .notif-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px 10px; }
  .notif-head b { font-family: "Archivo Black", "Arial Black", Arial, sans-serif; text-transform: uppercase; font-size: 16px; font-weight: 400; }
  .nt-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; border: none; background: none; text-align: left; font-family: inherit; color: inherit; cursor: pointer; position: relative; }
  .nt-item:hover { background: var(--paper-soft); }
  .nt-item.unread { background: rgba(214,229,11,.22); }
  .nt-item.unread::after { content: ""; position: absolute; right: 10px; top: 14px; width: 8px; height: 8px; border-radius: 50%; background: #FF5B40; }
  .nt-ic { width: 38px; height: 38px; border-radius: 50%; border: 2px solid #0B0F10; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
  .nt-txt { font-size: 13px; line-height: 1.4; flex: 1; min-width: 0; padding-right: 10px; overflow-wrap: anywhere; }
  .nt-txt small { display: block; font-size: 11.5px; color: var(--sage); margin-top: 2px; }
  .nt-empty { text-align: center; padding: 26px 14px; color: var(--sage); font-size: 13px; line-height: 1.5; }
  .nt-empty b { display: block; color: var(--ink); font-size: 15px; margin: 6px 0 2px; }
  @media (max-width: 860px) {
    .bell { width: 40px; height: 40px; }
    .notif-panel { position: fixed; left: 12px; right: 12px; width: auto; max-width: none; top: calc(64px + env(safe-area-inset-top, 0px)); }
    .pf-top { gap: 12px; }
    .pf-av { width: 70px; height: 70px; font-size: 24px; }
    .pf-counts { gap: 12px; }
  }

  .quote { position: relative; margin: 26px 0 4px; background: var(--paper-soft); border: 2px solid var(--ink); border-radius: 24px; padding: 24px 26px; overflow: hidden; }
  .q-mark { position: absolute; right: 18px; top: -30px; font-family: "Archivo Black", Arial Black, Arial; font-size: 150px; color: var(--brass); opacity: .5; line-height: 1; }
  .q-kicker { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--sage); }
  .q-text { position: relative; font-family: "Archivo Black", "Arial Black", Arial, sans-serif; font-size: clamp(19px, 2.6vw, 26px); line-height: 1.22; margin: 10px 0 0; max-width: 34ch; }
  .q-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
  .q-author { font-size: 13px; font-weight: 700; color: var(--sage); }
  .q-share { background: var(--ink); color: var(--paper); border: 2px solid var(--ink); border-radius: 100px; padding: 9px 16px; font-family: inherit; font-weight: 800; font-size: 12.5px; cursor: pointer; }
  .q-share:hover { background: #FF5B40; border-color: #FF5B40; color: #0B0F10; }
  .tbr-head-right { display: flex; flex-direction: column; align-items: center; gap: 10px; flex: 0 0 auto; }
  .tbr-share { background: #D6E50B; color: #0B0F10; border: 2px solid #0B0F10; border-radius: 100px; padding: 8px 14px; font-family: inherit; font-weight: 800; font-size: 12px; cursor: pointer; white-space: nowrap; }
  .t-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
  .t-share { flex: 0 0 auto; background: rgba(252,249,230,.9); color: #0B0F10; border: 2px solid #0B0F10; border-radius: 100px; padding: 5px 11px; font-family: inherit; font-weight: 800; font-size: 11px; cursor: pointer; }
  .bg-share { margin-top: 8px; background: var(--ink); color: var(--paper); border: none; border-radius: 100px; padding: 6px 12px; font-family: inherit; font-weight: 800; font-size: 11px; cursor: pointer; }
  /* la card da condividere sta sopra ogni altra finestra */
  #cardModal { z-index: 80; }
  #finitoModal { z-index: 70; }
  .card-prev { display: flex; justify-content: center; align-items: center; min-height: 260px; background: var(--paper-soft); border-radius: 16px; padding: 12px; }
  .card-prev img { max-height: 46vh; max-width: 100%; border-radius: 10px; border: 2px solid var(--ink); }
  .card-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; justify-content: center; }

  .ig-flag { margin-left: auto; background: none; border: none; font-size: 17px; color: var(--sage); cursor: pointer; padding: 6px; border-radius: 50%; }
  .ig-flag:hover { color: #FF5B40; background: var(--paper-soft); }
  .cmt-flag { float: right; background: none; border: none; color: var(--sage); cursor: pointer; font-size: 13px; padding: 2px 6px; }
  .cmt-flag:hover { color: #FF5B40; }
  .seg-motivi { display: flex; flex-direction: column; gap: 8px; }
  .seg-motivo { text-align: left; background: var(--paper-soft); border: 2px solid var(--ink); border-radius: 14px; padding: 12px 14px; font-family: inherit; font-weight: 700; font-size: 13.5px; cursor: pointer; color: var(--ink); }
  .seg-motivo:hover { background: #FF5B40; border-color: #FF5B40; color: #0B0F10; }
  .mod-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 28px; border-radius: 100px; background: #FF5B40; color: #FCF9E6; font-family: "Work Sans", Arial, sans-serif; font-size: 14px; font-weight: 800; vertical-align: middle; margin-left: 8px; }
  .mod-top-section { margin-bottom: 8px; }
  .mod-top-section .ra-title { margin-top: 10px; }
  #decidiModal { z-index: 75; }
  .mod-card { background: var(--paper-soft); border: 2px solid var(--ink); border-radius: 18px; padding: 16px; margin-bottom: 12px; }
  .mod-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; }
  .mod-top span { color: var(--sage); font-size: 12px; }
  .mod-cont { font-size: 14.5px; font-weight: 700; margin-top: 8px; overflow-wrap: anywhere; }
  .mod-cont p { font-weight: 500; font-size: 13.5px; margin: 6px 0 0; }
  .mod-nota { font-size: 13px; font-style: italic; color: var(--sage); margin-top: 8px; }
  .mod-chi { font-size: 12.5px; color: var(--sage); margin-top: 8px; }
  .mod-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

  .invito-banner { position: relative; z-index: 3; background: #0B0F10; color: #FCF9E6; border-radius: 18px; padding: 14px 18px; margin: 0 auto 20px; max-width: 460px; font-size: 13.5px; line-height: 1.5; }
  .invito-banner b { color: #D6E50B; }
  .inv-link { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--paper-soft); border: 2px dashed var(--ink); border-radius: 14px; padding: 12px 14px; }
  .inv-link code { font-size: 13px; overflow-wrap: anywhere; flex: 1; min-width: 0; }
  .inv-conta { font-size: 13px; font-weight: 700; color: var(--sage); margin-top: 10px; }

  #tourModal { z-index: 85; }
  .tour-card { position: relative; max-width: 460px; background: var(--paper); border: 3px solid #0B0F10; border-radius: 28px; box-shadow: 10px 10px 0 #D6E50B; text-align: center; padding: 34px 26px 26px; }
  .tour-salta { position: absolute; top: 14px; right: 16px; background: none; border: none; color: var(--sage); font-family: inherit; font-weight: 700; font-size: 13px; cursor: pointer; padding: 8px; }
  .tour-salta:hover { color: var(--ink); }
  .tour-emoji { font-size: 54px; line-height: 1; margin-bottom: 12px; }
  .tour-card h2 { font-size: 26px; margin: 0 0 12px; }
  .tour-card p { font-size: 15px; line-height: 1.6; margin: 0 0 20px; }
  .tour-punti { display: flex; justify-content: center; gap: 7px; margin-bottom: 20px; }
  .tour-punto { width: 9px; height: 9px; border-radius: 50%; background: var(--paper-line); border: 1.5px solid var(--ink); }
  .tour-punto.on { background: #FF5B40; }
  .tour-azioni { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
  @media (max-width: 860px) {
    .tour-card { padding: 30px 20px 22px; }
    .tour-card h2 { font-size: 22px; }
    .tour-card p { font-size: 14px; }
  }

  .gr-app { border: 2px solid var(--paper-line); border-radius: 14px; padding: 10px 14px; margin-bottom: 8px; }
  .gr-app[open] { border-color: var(--ink); }
  .gr-app summary { cursor: pointer; font-weight: 800; font-size: 13.5px; }
  .gr-app .gr-passi { margin: 10px 0 4px; }
  #propostaModal { z-index: 84; }
  .gr-passi { margin: 0 0 16px; padding-left: 20px; font-size: 13.5px; line-height: 1.6; }
  .gr-passi li { margin-bottom: 6px; }
  .gr-file { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; border: 2px dashed var(--ink); border-radius: 16px; padding: 22px 16px; cursor: pointer; background: var(--paper-soft); }
  .gr-file:hover { background: #D6E50B; }
  .gr-file b { font-size: 15px; }
  .gr-file span { font-size: 12px; color: var(--sage); }
  .gr-esito { margin-top: 14px; background: var(--paper-soft); border-radius: 14px; padding: 14px 16px; font-size: 13.5px; }
  .gr-esito ul { margin: 8px 0; padding-left: 18px; line-height: 1.6; }
  .gr-esito small { color: var(--sage); }
  #importModal, #copertineModal { z-index: 78; }

  .chart-card { background: var(--paper-soft); border: 2px solid var(--ink); border-radius: 24px; padding: 20px 22px; margin-top: 18px; }
  .goal-card { background: #D6E50B; color: #0B0F10; border: 2px solid #0B0F10; border-radius: 24px; padding: 20px 22px; margin-top: 18px; box-shadow: 5px 5px 0 #0B0F10; }
  .goal-card .goal-ritmo, .goal-card .goal-vuoto span { color: rgba(11,15,16,.7); }
  .goal-card .fl-btn.on { border-color: #0B0F10; color: #0B0F10; }
  .goal-card .fl-btn.on:hover { background: #0B0F10; color: #D6E50B; }
  .ra-title + .goal-card { margin-top: 0; margin-bottom: 18px; }
  .chart-titolo { font-family: "Archivo Black", "Arial Black", Arial, sans-serif; font-weight: 400; font-size: 17px; text-transform: uppercase; margin: 0 0 14px; }
  .goal-vuoto { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
  .goal-vuoto b { display: block; font-size: 16px; margin-bottom: 4px; }
  .goal-vuoto span { font-size: 13.5px; color: var(--sage); }
  .goal-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; position: relative; }
  .goal-ring { width: 130px; height: 130px; flex: 0 0 auto; }
  .goal-num { position: absolute; left: 0; top: 0; width: 130px; height: 130px; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
  .goal-num b { font-family: "Archivo Black", "Arial Black", Arial, sans-serif; font-size: 30px; font-weight: 400; line-height: 1; }
  .goal-num span { font-size: 12px; font-weight: 700; color: var(--sage); }
  .goal-txt { flex: 1; min-width: 200px; }
  .goal-perc { font-family: "Archivo Black", "Arial Black", Arial, sans-serif; font-size: 22px; }
  .goal-frase { font-size: 15px; font-weight: 700; margin: 4px 0 6px; }
  .goal-ritmo { font-size: 13px; color: var(--sage); margin-bottom: 12px; }
  .chart-head { font-size: 13.5px; color: var(--sage); margin-bottom: 10px; }
  .chart-head b { color: var(--ink); font-size: 16px; }
  .chart-svg { width: 100%; height: auto; }
  .cal-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
  .cal-tile { background: var(--paper); border: 2px solid var(--ink); border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .cal-tile b { font-family: "Archivo Black", "Arial Black", Arial, sans-serif; font-weight: 400; font-size: 22px; line-height: 1.05; text-transform: lowercase; overflow-wrap: anywhere; }
  .cal-tile span { font-size: 12px; color: var(--sage); font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
  .cal-sez { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--sage); margin: 20px 0 10px; }
  .f-carta { background: var(--fmt-carta); } .f-ebook { background: var(--fmt-ebook); } .f-audio { background: var(--fmt-audio); }
  .cal-testa { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
  .cal-anno, .cal-anni b { font-family: "Archivo Black", "Arial Black", Arial, sans-serif; font-weight: 400; font-size: 20px; }
  .cal-anni { display: flex; align-items: center; gap: 8px; }
  .cal-freccia { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--ink); background: transparent; color: var(--ink); font-size: 18px; font-weight: 800; line-height: 1; cursor: pointer; }
  .cal-freccia:disabled { opacity: .3; cursor: default; }
  .cal-griglia { display: flex; flex-direction: column; gap: 8px; }
  .cal-riga { display: grid; grid-template-columns: 38px 1fr; align-items: center; gap: 8px; min-height: 30px; }
  .cal-mese { font-family: "Archivo Black", "Arial Black", Arial, sans-serif; font-size: 13px; text-transform: uppercase; color: var(--ink); }
  .cal-riga.vuota .cal-mese { opacity: .35; }
  .cal-cops { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
  .cal-niente { display: block; width: 100%; border-top: 2px dashed var(--paper-line); }
  .cal-cop { position: relative; width: 44px; height: 66px; border: 2px solid var(--ink); border-radius: 5px; overflow: hidden; cursor: pointer; outline: none; flex: 0 0 auto; }
  .cal-cop:focus-visible { box-shadow: 0 0 0 3px var(--teal, #007E94); }
  .cal-cop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
  .cal-dorso { position: absolute; inset: 0; padding: 3px; font-size: 7.5px; font-weight: 800; line-height: 1.15; overflow: hidden; overflow-wrap: anywhere; hyphens: auto; }
  .cal-badge { position: absolute; right: 1px; bottom: 1px; z-index: 2; width: 18px; height: 18px; border-radius: 50%; background: #FCF9E6; border: 1.5px solid #0B0F10; font-size: 10px; font-style: normal; display: flex; align-items: center; justify-content: center; }
  :where(.cop-ripiego) { width: 100%; height: 100%; }
  img[data-t] { opacity: 0; transition: opacity .25s ease; }
  img[data-t].ok { opacity: 1; }
  .lg-t small { display: block; margin-top: 6px; font-family: "Work Sans", Arial, sans-serif; font-weight: 700; font-size: 11px; text-transform: none; opacity: .8; }
  .lg-card::before, .ex-cover::before { content: "✱"; position: absolute; top: 10px; left: 12px; font-size: 14px; opacity: .55; }
  .cop-ripiego { display: flex; align-items: center; justify-content: center; text-align: center; overflow: hidden; background: #007E94; color: #FCF9E6; font-weight: 800; font-size: 11px; line-height: 1.2; padding: 6px; box-sizing: border-box; overflow-wrap: anywhere; hyphens: auto; border-radius: 6px; }
  .cop-ripiego.bc-cover { display: none; }
  .cal-nota { font-size: 12.5px; color: var(--sage); margin: 12px 0 0; line-height: 1.5; }
  #chartCalendario { position: relative; }
  .cal-tip { position: absolute; z-index: 5; background: var(--ink); color: var(--paper); font-size: 12px; line-height: 1.45; padding: 8px 10px; border-radius: 10px; white-space: pre-line; pointer-events: none; box-shadow: 0 6px 18px rgba(0,0,0,.18); }
  .c-line { fill: none; stroke: #0B0F10; stroke-width: 2.5; stroke-linejoin: round; }
  .c-area { fill: rgba(214,229,11,.55); stroke: none; }
  .c-dot { fill: #FF5B40; stroke: #0B0F10; stroke-width: 1.5; }
  .c-grid { stroke: rgba(11,15,16,.12); stroke-width: 1; }
  .c-axis { stroke: var(--ink); stroke-width: 2; }
  .c-lab { font-size: 11.5px; font-weight: 600; fill: var(--sage); font-family: "Work Sans", Arial, sans-serif; }
  .chart-vuoto { font-size: 13.5px; color: var(--sage); line-height: 1.5; }
  .torta-wrap { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
  .torta { width: 160px; height: 160px; flex: 0 0 auto; }
  .torta-num { font-family: "Archivo Black", "Arial Black", Arial, sans-serif; font-size: 20px; fill: var(--ink); }
  .torta-lab { font-size: 9px; fill: var(--sage); font-family: "Work Sans", Arial, sans-serif; font-weight: 700; }
  .torta-legenda { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 7px; }
  .torta-legenda li { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
  .torta-legenda .pallino { width: 13px; height: 13px; border-radius: 4px; border: 1.5px solid #0B0F10; flex: 0 0 auto; }
  .torta-legenda b { font-weight: 700; flex: 1; overflow-wrap: anywhere; }
  .torta-legenda .n { color: var(--sage); font-size: 12.5px; }
  @media (max-width: 860px) {
    .goal-card, .chart-card { padding: 18px 16px; }
    .goal-wrap { gap: 16px; }
    .torta-wrap { gap: 18px; justify-content: center; }
  }


  /* ---- Illustrazioni di Tellme ---- */
  .tm-illo { display: block; margin: 0 auto 14px; width: 190px; max-width: 70%; height: auto; }
  .tm-illo.plate { background: #FCF9E6; border: 2px solid #0B0F10; border-radius: 26px; padding: 12px; box-shadow: 4px 4px 0 #0B0F10; box-sizing: content-box; }
  .tm-illo.sm { width: 120px; }
  .empty .tm-illo, .tbr-empty .tm-illo { margin-bottom: 18px; }
  .goal-vuoto .tm-illo { margin: 0; width: 96px; flex: 0 0 auto; padding: 8px; border-radius: 20px; }
  .goal-vuoto .gv-testo { flex: 1; min-width: 180px; }
  .goal-fatto { width: 120px; flex: 0 0 auto; margin: 0; padding: 8px; border-radius: 20px; }
  @media (max-width: 640px) { .goal-fatto { position: absolute; right: 0; top: 0; width: 96px; } }
  .badges-hero { display: flex; align-items: center; gap: 16px; background: #D6E50B; color: #0B0F10; border: 2px solid #0B0F10; border-radius: 22px; padding: 12px 16px; margin-bottom: 18px; box-shadow: 4px 4px 0 #0B0F10; }
  .badges-hero .tm-illo { margin: 0; width: 88px; flex: 0 0 auto; padding: 6px; border-radius: 18px; box-shadow: none; }
  .badges-hero b { font-family: "Archivo Black", "Arial Black", Arial, sans-serif; font-weight: 400; font-size: 26px; display: block; line-height: 1; }
  .badges-hero span { font-size: 13.5px; font-weight: 600; }
  #festaModal { z-index: 60; }
  .push-intro { margin: 0 0 12px; font-size: 13.5px; line-height: 1.5; }
  .push-righe { display: flex; flex-direction: column; gap: 2px; margin: 4px 0 14px; }
  .push-riga { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px dashed var(--paper-line); cursor: pointer; }
  .push-riga:last-child { border-bottom: none; }
  .push-riga b { display: block; font-size: 14px; }
  .push-riga small { display: block; font-size: 12px; color: var(--sage); line-height: 1.4; }
  .interr { position: relative; flex: 0 0 auto; width: 46px; height: 26px; }
  .interr input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
  .interr span { position: absolute; inset: 0; border-radius: 100px; background: var(--paper-line); border: 2px solid var(--ink); transition: background .15s; }
  .interr span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--ink); transition: transform .15s; }
  .interr input:checked + span { background: #D6E50B; }
  .interr input:checked + span::after { transform: translateX(20px); background: #0B0F10; }
  .interr input:focus-visible + span { outline: 3px solid #007E94; outline-offset: 2px; }
  #onboardModal .interr span { background: #FCF9E6; border-color: #0B0F10; }
  #onboardModal .interr input:checked + span { background: #0B0F10; }
  #onboardModal .interr input:checked + span::after { background: #D6E50B; }
  #onboardModal .push-riga { border-bottom-color: rgba(11,15,16,.25); }
  .push-azioni { display: flex; gap: 8px; flex-wrap: wrap; }
  .push-passi { margin: 6px 0 12px; padding-left: 20px; font-size: 13.5px; line-height: 1.6; }
  .push-stato { font-size: 12.5px; font-weight: 700; color: var(--ok, #007E94); margin-bottom: 4px; }
  .cerca-card { max-width: 560px !important; }
  .cerca-input { width: 100%; box-sizing: border-box; font-family: inherit; font-size: 16px; padding: 13px 16px; border: 2px solid var(--ink); border-radius: 100px; background: var(--paper-soft); color: var(--ink); outline: none; margin: 12px 0 6px; }
  .cerca-input:focus { box-shadow: 3px 3px 0 var(--ink); }
  .cerca-ris { min-height: 60px; }
  .cerca-sez { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--sage); margin: 16px 0 4px; }
  .cerca-ris .suggest-item { cursor: pointer; border-radius: 12px; padding: 8px; }
  .cerca-ris .sg-txt { display: flex; flex-direction: column; min-width: 0; }
  .cerca-ris .sg-dove { font-size: 11px; font-weight: 700; color: var(--ok, #007E94); }
  .cerca-nota { font-size: 13.5px; color: var(--sage); padding: 10px 4px; line-height: 1.5; }
  .festa-card { text-align: center; max-width: 380px !important; }
  .festa-card .tm-illo { width: 210px; animation: festaSalto .7s ease-out; }
  .festa-card h2 { font-family: "Archivo Black", "Arial Black", Arial, sans-serif; font-weight: 400; text-transform: uppercase; font-size: 24px; margin-bottom: 6px; }
  .festa-card p { color: var(--sage); font-size: 14.5px; line-height: 1.5; margin: 0 0 18px; }
  .festa-card .festa-azioni { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
  @keyframes festaSalto { 0% { transform: scale(.6) translateY(20px); opacity: 0; } 60% { transform: scale(1.06); opacity: 1; } 100% { transform: scale(1); } }
  @media (prefers-reduced-motion: reduce) { .festa-card .tm-illo, .attesa-illo { animation: none !important; } }
  .attesa { position: fixed; inset: 0; background: rgba(252,249,230,.92); z-index: 90; display: flex; align-items: center; justify-content: center; padding: 24px; }
  .attesa.hidden { display: none; }
  .attesa-card { text-align: center; max-width: 340px; color: #0B0F10; }
  .attesa-libro .attesa-pagina { display: none; }
  .attesa-illo { width: 200px; height: auto; position: absolute; left: 0; top: 0; animation: attesaBob 2.6s ease-in-out infinite; }
  .attesa-libro { position: relative; width: 200px; height: 196px; margin: 0 auto 22px; }
  .attesa-avatar { width: 110px; height: 110px; border-radius: 50%; border: 3px solid #0B0F10; background: #007E94; position: absolute; left: 20px; top: 20px; animation: attesaBob 2.6s ease-in-out infinite; }
  .attesa-pagina { position: absolute; width: 26px; height: 34px; background: #FCF9E6; border: 2px solid #0B0F10; border-radius: 3px; opacity: 0; }
  .attesa-pagina.p1 { left: 0; top: 18px; animation: attesaSfoglia 2.4s ease-in-out infinite; }
  .attesa-pagina.p2 { right: 4px; top: 6px; animation: attesaSfoglia 2.4s ease-in-out .5s infinite; }
  .attesa-pagina.p3 { right: 16px; bottom: 6px; animation: attesaSfoglia 2.4s ease-in-out 1s infinite; }
  @keyframes attesaBob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-10px) rotate(2deg); } }
  @keyframes attesaSfoglia { 0% { opacity: 0; transform: translateY(6px) rotate(-8deg); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(-26px) rotate(14deg); } }
  .attesa-testo { font-family: "Archivo Black", "Arial Black", Arial, sans-serif; font-size: 19px; line-height: 1.25; margin-bottom: 18px; min-height: 48px; }
  .attesa-barra { height: 8px; border-radius: 10px; background: var(--paper-line); overflow: hidden; }
  .attesa-barra span { display: block; height: 100%; width: 40%; background: #FF5B40; border-radius: 10px; animation: attesaScorre 1.5s ease-in-out infinite; }
  @keyframes attesaScorre { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }

  .adm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 8px; }
  .adm-kpi { background: var(--paper-soft); border: 2px solid var(--ink); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 2px; }
  .adm-kpi b { font-family: "Archivo Black", "Arial Black", Arial, sans-serif; font-size: 28px; font-weight: 400; line-height: 1; }
  .adm-kpi span { font-size: 12.5px; font-weight: 700; color: var(--sage); }
  .adm-kpi.lime { background: #D6E50B; color: #0B0F10; } .adm-kpi.lime span { color: rgba(11,15,16,.7); }
  .adm-kpi.teal { background: #007E94; color: #FCF9E6; } .adm-kpi.teal span { color: rgba(252,249,230,.8); }
  .adm-kpi.coral { background: #FF5B40; color: #0B0F10; } .adm-kpi.coral span { color: rgba(11,15,16,.7); }
  .adm-kpi.nero { background: #0B0F10; color: #D6E50B; } .adm-kpi.nero span { color: rgba(252,249,230,.7); }
  .adm-tit { font-family: "Archivo Black", "Arial Black", Arial, sans-serif; font-weight: 400; text-transform: uppercase; font-size: 16px; margin: 26px 0 12px; }
  .adm-chart { display: flex; align-items: flex-end; gap: 8px; height: 150px; background: var(--paper-soft); border: 2px solid var(--ink); border-radius: 18px; padding: 14px; }
  .adm-bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 4px; }
  .adm-bar span { width: 100%; background: #D6E50B; border: 2px solid #0B0F10; border-radius: 6px 6px 0 0; min-height: 4px; }
  .adm-bar b { font-size: 13px; }
  .adm-bar small { font-size: 10.5px; color: var(--sage); }
  .adm-imbuto { display: flex; flex-direction: column; gap: 8px; background: var(--paper-soft); border: 2px solid var(--ink); border-radius: 18px; padding: 14px; }
  .adm-step { display: grid; grid-template-columns: minmax(120px, 190px) 1fr 34px 44px; align-items: center; gap: 10px; font-size: 13px; }
  .adm-step-l { font-weight: 700; }
  .adm-step-bar { height: 14px; background: var(--paper-line); border-radius: 8px; overflow: hidden; }
  .adm-step-bar span { display: block; height: 100%; background: #007E94; border-radius: 8px; }
  .adm-step b { text-align: right; }
  .adm-step small { color: #FF5B40; font-weight: 800; font-size: 12px; }
  @media (max-width: 520px) { .adm-step { grid-template-columns: 1fr 34px 40px; } .adm-step-l { grid-column: 1 / -1; } }
  .adm-err { display: flex; flex-direction: column; gap: 8px; }
  .adm-err-item { border: 2px solid var(--ink); border-radius: 14px; background: var(--paper-soft); padding: 10px 14px; }
  .adm-err-item summary { cursor: pointer; font-size: 13.5px; list-style: none; }
  .adm-err-item summary b { display: block; overflow-wrap: anywhere; }
  .adm-err-item summary span { display: block; font-size: 12px; color: var(--sage); margin-top: 2px; }
  .adm-err-det p { font-size: 12px; color: var(--sage); margin: 10px 0 6px; }
  .adm-err-det pre { font-size: 11px; background: #0B0F10; color: #D6E50B; border-radius: 10px; padding: 10px; overflow-x: auto; white-space: pre-wrap; word-break: break-word; max-height: 220px; margin: 0 0 10px; }
  .adm-avviso { background: #FFF1D6; border: 2px solid #FF5B40; border-radius: 14px; padding: 12px 14px; font-size: 13.5px; line-height: 1.6; color: #0B0F10; margin: 0; }
  .adm-nota { font-size: 13px; color: var(--sage); line-height: 1.5; margin: 10px 0 0; }
  .adm-tab-wrap { overflow-x: auto; border: 2px solid var(--ink); border-radius: 18px; }
  .adm-tab { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 520px; }
  .adm-tab th { text-align: left; background: var(--paper-soft); padding: 10px 12px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; }
  .adm-tab td { padding: 10px 12px; border-top: 1px solid var(--paper-line); }
  .adm-tab small { color: var(--sage); font-size: 11.5px; }

  /* ---------- Barra in basso ---------- */
  .tabbar { display: none; }
  @media (max-width: 860px) {
    .tabbar { position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); z-index: 45;
      display: flex; justify-content: space-between; gap: 2px; background: var(--ink); color: var(--paper);
      border-radius: 100px; padding: 8px 10px; box-shadow: 0 6px 20px rgba(11,15,16,.28); }
    .tabbar[hidden] { display: none; }
    .tab { flex: 1; background: none; border: none; color: rgba(252,249,230,.62); font-family: inherit; cursor: pointer;
      display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border-radius: 100px; min-width: 0; }
    .tab svg { width: 22px; height: 22px; }
    .tab span { font-size: 9.5px; font-weight: 700; letter-spacing: .01em; }
    .tab.on { color: #0B0F10; background: #D6E50B; }
    .main { padding-bottom: calc(132px + env(safe-area-inset-bottom, 0px)); }
    .modal-overlay { align-items: center; padding: 16px 16px calc(110px + env(safe-area-inset-bottom, 0px)); overflow-y: auto; }
    .modal-card { margin-top: auto; margin-bottom: auto; max-height: calc(100dvh - 210px); overflow-y: auto; }
    /* i bottoni di conferma restano sempre a portata di pollice */
    #esploraAdminModal .modal-card > div:last-of-type,
    #importModal .modal-card > div:last-of-type,
    #cancellaModal .modal-card > div:last-of-type {
      position: sticky; bottom: -1px; background: var(--paper); padding: 10px 0 2px; margin-top: 4px;
      box-shadow: 0 -10px 12px -8px rgba(11,15,16,.18);
    }
    .toast { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
    .attesa { padding-bottom: calc(110px + env(safe-area-inset-bottom, 0px)); }
    .chat-wrap { padding-bottom: 8px; }
  }

  /* ---------- Esplora ---------- */
  .ex-mese { background: #0B0F10; color: #FCF9E6; border-radius: 28px; padding: 26px; margin-bottom: 30px; }
  .ex-mese-tag { display: inline-block; background: #D6E50B; color: #0B0F10; border-radius: 100px; padding: 5px 14px; font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 16px; }
  .ex-mese-in { display: flex; gap: 22px; flex-wrap: wrap; }
  .ex-mese-cover { width: 130px; height: 195px; object-fit: cover; border-radius: 10px; border: 2px solid #FCF9E6; flex: 0 0 auto; }
  .ex-mese-txt { flex: 1; min-width: 220px; }
  .ex-mese-txt h2 { font-size: 28px; margin: 0 0 6px; }
  .ex-mese-by { font-size: 13.5px; color: #D6E50B; font-weight: 700; margin: 0 0 10px; }
  .ex-mese-nota { font-size: 14.5px; line-height: 1.55; margin: 0 0 16px; }
  .ex-mese-club { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
  .ex-club-si { display: inline-flex; align-items: center; background: rgba(252,249,230,.12); color: #D6E50B; border: 1.5px solid rgba(214,229,11,.6); border-radius: 100px; padding: 6px 12px; font-size: 12.5px; font-weight: 800; font-family: inherit; cursor: pointer; transition: background .15s, color .15s; }
  .ex-club-si:hover { background: rgba(252,249,230,.2); }
  .ex-club-si.armato { background: #FF5B40; border-color: #FF5B40; color: #0B0F10; }
  .ex-racconta { width: auto !important; padding: 14px 26px !important; }
  .ex-club-n { font-size: 13px; color: rgba(252,249,230,.75); }
  .ex-mese .fl-btn { border-color: #FCF9E6; color: #FCF9E6; background: transparent; }
  .ex-row { margin-bottom: 30px; }
  .ex-head h3 { font-family: "Archivo Black", "Arial Black", Arial, sans-serif; font-weight: 400; text-transform: uppercase; font-size: 18px; margin: 0; }
  .ex-head p { font-size: 13px; color: var(--sage); margin: 4px 0 12px; }
  .ex-scroll { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity; overscroll-behavior-x: contain; }
  .ex-card { flex: 0 0 132px; width: 132px; scroll-snap-align: start; }
  .ex-cover { position: relative; width: 132px; height: 198px; border: 2px solid #0B0F10; border-radius: 12px; overflow: hidden; cursor: pointer; padding: 12px; display: flex; align-items: flex-end; font-family: inherit; }
  .ex-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
  .ex-t { position: relative; font-family: "Archivo Black", "Arial Black", Arial, sans-serif; text-transform: uppercase; font-size: 12.5px; line-height: 1.05; text-align: left; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
  .ex-cuori { position: absolute; top: 8px; right: 8px; background: rgba(11,15,16,.85); color: #FCF9E6; border-radius: 100px; padding: 2px 8px; font-size: 11px; font-weight: 800; }
  .ex-cover:hover { transform: translateY(-3px); }
  .ex-info { margin-top: 8px; }
  .ex-info b { display: block; font-size: 13px; line-height: 1.25; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .ex-info span { font-size: 12px; color: var(--sage); }
  .ex-vuoto { font-size: 13px; color: var(--sage); background: var(--paper-soft); border: 1px dashed var(--paper-line); border-radius: 14px; padding: 14px 16px; line-height: 1.5; }
  .ex-admin { margin: 10px 0 30px; }
  .ex-cfg { width: 100%; min-height: 260px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; border: 2px solid var(--ink); border-radius: 14px; padding: 12px; background: var(--paper-soft); color: var(--ink); }
  .ex-modal-in { display: flex; gap: 16px; align-items: center; }
  .ex-modal-cover { width: 90px; height: 135px; object-fit: cover; border-radius: 8px; border: 2px solid var(--ink); }

  .cms-blocco { border: 2px solid var(--ink); border-radius: 18px; padding: 16px; margin-bottom: 14px; }
  .cms-blocco h3 { font-family: "Archivo Black", "Arial Black", Arial, sans-serif; font-weight: 400; text-transform: uppercase; font-size: 15px; margin: 0 0 12px; }
  .cms-libro { display: flex; align-items: center; gap: 12px; background: var(--paper-soft); border-radius: 14px; padding: 10px 12px; }
  .cms-libro img { width: 44px; height: 66px; object-fit: cover; border-radius: 6px; border: 1.5px solid var(--ink); }
  .cms-libro div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
  .cms-libro b { font-size: 14px; overflow-wrap: anywhere; }
  .cms-libro span { font-size: 12px; color: var(--sage); }
  .cms-nocover { width: 44px; height: 66px; display: flex; align-items: center; justify-content: center; background: var(--paper-line); border-radius: 6px; font-size: 20px; }
  .cms-x { background: none; border: none; color: var(--sage); font-size: 15px; cursor: pointer; padding: 6px; }
  .cms-x:hover { color: #FF5B40; }
  .cms-cerca { position: relative; margin-top: 10px; }
  .cms-cerca input { width: 100%; border: 2px solid var(--ink); border-radius: 100px; padding: 10px 16px; font-family: inherit; font-size: 13.5px; background: var(--paper); color: var(--ink); }
  .cms-risultati { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
  .cms-ris { display: flex; align-items: center; gap: 10px; text-align: left; background: var(--paper-soft); border: none; border-radius: 12px; padding: 8px 10px; cursor: pointer; font-family: inherit; color: var(--ink); }
  .cms-ris:hover { background: #D6E50B; }
  .cms-ris img { width: 30px; height: 44px; object-fit: cover; border-radius: 4px; }
  .cms-ris span { display: flex; flex-direction: column; min-width: 0; }
  .cms-ris b { font-size: 13px; overflow-wrap: anywhere; }
  .cms-ris small { font-size: 11.5px; color: var(--sage); }
  .cms-cerco { font-size: 12.5px; color: var(--sage); padding: 6px 4px; }
  .cms-sezione { border: 2px dashed var(--paper-line); border-radius: 14px; padding: 12px; margin-bottom: 12px; }
  .cms-sez-top { display: flex; gap: 8px; align-items: center; }
  .cms-sez-top input { flex: 1; border: 2px solid var(--ink); border-radius: 100px; padding: 9px 14px; font-family: inherit; font-weight: 700; font-size: 13.5px; background: var(--paper); color: var(--ink); }
  .cms-desc { width: 100%; border: 2px solid var(--paper-line); border-radius: 100px; padding: 8px 14px; margin-top: 8px; font-family: inherit; font-size: 12.5px; background: var(--paper); color: var(--ink); }
  .cms-libri { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
  .cms-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--paper-soft); border: 1.5px solid var(--ink); border-radius: 100px; padding: 5px 6px 5px 12px; font-size: 12.5px; }
  .cms-chip button { background: none; border: none; cursor: pointer; font-size: 12px; color: var(--sage); }
  .cms-vuoto { font-size: 12.5px; color: var(--sage); }
  .sc-usate { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 12px; }
  .sc-tag { border: 1.5px solid var(--ink); background: var(--paper); color: var(--ink); border-radius: 100px; padding: 4px 10px; font-family: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
  .sc-tag:hover { background: #D6E50B; color: #0B0F10; }
  .sc-mano { margin-top: 12px; font-size: 13px; }
  .sc-mano summary { cursor: pointer; font-weight: 700; color: var(--sage); margin-bottom: 8px; }
  .sc-lista { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
  .sc-voce { display: flex; gap: 12px; align-items: flex-start; text-align: left; background: var(--paper-soft); border: none; border-radius: 14px; padding: 10px 12px; cursor: pointer; font-family: inherit; color: var(--ink); width: 100%; }
  .sc-voce.in-modifica { flex-direction: column; align-items: stretch; cursor: default; border: 2px solid var(--ink); }
  .sc-voce > img { width: 40px; height: 60px; object-fit: cover; border-radius: 5px; border: 1.5px solid var(--ink); flex: 0 0 auto; }
  .sc-voce > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .sc-voce b { font-size: 14px; } .sc-voce small { font-size: 12px; color: var(--sage); }
  .sc-voce em { font-style: normal; font-size: 11.5px; font-weight: 700; color: var(--ink); }
  .sc-voce i { font-size: 12.5px; line-height: 1.4; color: var(--ink); opacity: .8; }
  .sc-voce i.manca { color: #C2361F; opacity: 1; }
  .sc-togli { margin-left: auto; }
  .sc-importa { width: 100%; min-height: 110px; border: 2px solid var(--ink); border-radius: 14px; padding: 10px 12px; font-family: inherit; font-size: 13px; background: var(--paper); color: var(--ink); margin-bottom: 10px; box-sizing: border-box; }
  .home-passi { margin: 6px 0 16px; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; counter-reset: passo; }
  .home-passi li { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 1.45; }
  .home-passi li::before { counter-increment: passo; content: counter(passo); flex: 0 0 26px; height: 26px; border-radius: 50%; background: #D6E50B; color: #0B0F10; font-weight: 800; display: flex; align-items: center; justify-content: center; border: 2px solid #0B0F10; }
  .home-ico { display: inline-flex; vertical-align: -3px; }
  .home-nota { font-size: 13px; color: var(--sage); line-height: 1.5; margin: 0 0 14px; }
  .home-azioni { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
  .home-mai { background: none; border: none; color: var(--sage); font-family: inherit; font-size: 12.5px; text-decoration: underline; cursor: pointer; padding: 6px; }
  .bk-search-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
  .bk-search-top label { margin: 0; }
  .tbr-scan { margin: 0 0 10px; }
  .scan-video { position: relative; width: 100%; aspect-ratio: 4 / 3; background: #0B0F10; border-radius: 16px; overflow: hidden; }
  .scan-video video { width: 100%; height: 100%; object-fit: cover; display: block; }
  .scan-mirino { position: absolute; left: 10%; right: 10%; top: 32%; bottom: 32%; border: 3px solid #D6E50B; border-radius: 12px; box-shadow: 0 0 0 999px rgba(11,15,16,.35); }
  .scan-mirino::after { content: ""; position: absolute; left: 6%; right: 6%; top: 50%; height: 2px; background: #FF5B40; animation: scanRiga 1.6s ease-in-out infinite; }
  @keyframes scanRiga { 0%, 100% { transform: translateY(-28px); } 50% { transform: translateY(28px); } }
  @media (prefers-reduced-motion: reduce) { .scan-mirino::after { animation: none; } }
  .scan-testo { font-size: 14px; line-height: 1.5; margin: 12px 0; }
  .scan-mano { display: flex; gap: 8px; margin-top: 8px; }
  .scan-mano input { flex: 1; min-width: 0; border: 2px solid var(--ink); border-radius: 100px; padding: 10px 14px; font-family: inherit; font-size: 15px; background: var(--paper); color: var(--ink); letter-spacing: .04em; }
  .scan-libro { display: flex; gap: 14px; align-items: center; background: var(--paper-soft); border: 2px solid var(--ink); border-radius: 18px; padding: 12px; margin: 4px 0 14px; }
  .scan-libro img, .scan-libro .cop-ripiego { width: 70px; height: 105px; object-fit: cover; border-radius: 6px; border: 2px solid var(--ink); flex: 0 0 auto; }
  .scan-libro .scan-nocover { width: 70px; height: 105px; display: flex; align-items: center; justify-content: center; font-size: 30px; background: var(--paper-line); border-radius: 6px; flex: 0 0 auto; }
  .scan-libro b { display: block; font-size: 16px; line-height: 1.25; overflow-wrap: anywhere; }
  .scan-libro span span { display: block; font-size: 13px; color: var(--sage); margin-top: 4px; }
  .scan-azioni { display: flex; gap: 10px; flex-wrap: wrap; }
  .scan-link { background: none; border: none; color: var(--sage); font-family: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; padding: 6px 0; }
  .cms-nota { font-size: 12.5px; color: var(--sage); margin: 10px 0 0; }

  /* ---------- To be read list ---------- */
  #view-wishlist { max-width: 920px; }
  .tbr-panel { background: #0B0F10; color: #FCF9E6; border-radius: 30px; padding: 30px 26px 26px; }
  .tbr-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; }
  .tbr-kicker { color: #D6E50B; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
  .tbr-head h1 { color: #FCF9E6; font-size: clamp(32px, 4.6vw, 50px); line-height: .95; margin-top: 8px; }
  .tbr-head p { color: #B9BCB2; font-size: 14px; line-height: 1.5; max-width: 52ch; margin: 10px 0 0; }
  .tbr-count { flex: 0 0 auto; width: 104px; height: 104px; border-radius: 50%; background: #D6E50B; color: #0B0F10; display: flex; flex-direction: column; align-items: center; justify-content: center; transform: rotate(-8deg); border: 3px solid #FCF9E6; }
  .tbr-count b { font-family: "Archivo Black", "Arial Black", Arial, sans-serif; font-size: 36px; line-height: 1; font-weight: 400; }
  .tbr-count span { font-size: 11px; font-weight: 800; text-transform: uppercase; }
  .tbr-tabs { display: flex; gap: 8px; margin: 24px 0 14px; overflow-x: auto; padding-bottom: 2px; }
  .tbr-tab { flex: 0 0 auto; background: #1E2324; color: #FCF9E6; border: 2px solid #34393A; border-radius: 100px; padding: 9px 15px; font-weight: 700; font-size: 13px; cursor: pointer; font-family: inherit; display: inline-flex; gap: 7px; align-items: center; }
  .tbr-tab .n { font-size: 11px; background: #34393A; border-radius: 100px; padding: 1px 7px; }
  .tbr-tab.on { background: #FCF9E6; color: #0B0F10; border-color: #FCF9E6; }
  .tbr-tab.on .n { background: #0B0F10; color: #FCF9E6; }
  .tbr-add { margin-bottom: 16px; }
  .tbr-add summary { cursor: pointer; color: #D6E50B; font-weight: 700; font-size: 13.5px; list-style: none; padding: 9px 4px; margin: -9px -4px; }
  .tbr-add summary::-webkit-details-marker { display: none; }
  .tbr-add-row { display: grid; grid-template-columns: 1.4fr 1fr 1fr auto; gap: 8px; margin-top: 12px; }
  .tbr-add-row input { font-family: inherit; font-size: 14px; padding: 11px 14px; border-radius: 100px; border: 2px solid #34393A; background: #1E2324; color: #FCF9E6; outline: none; min-width: 0; }
  .tbr-add-row input:focus { border-color: #D6E50B; }
  .tbr-list { display: flex; flex-direction: column; gap: 12px; }
  .tbr-card { background: var(--tc); color: var(--tf); border-radius: 26px; padding: 18px 18px 16px; position: relative; }
  .tbr-top { display: flex; align-items: center; gap: 12px; }
  .tbr-emoji { width: 46px; height: 46px; border-radius: 50%; background: #FCF9E6; border: 2px solid #0B0F10; display: flex; align-items: center; justify-content: center; font-size: 24px; flex: 0 0 auto; color: #0B0F10; }
  .tbr-who b { display: block; font-size: 14px; }
  .tbr-who span { font-size: 12px; opacity: .75; }
  .tbr-arrow { margin-left: auto; width: 44px; height: 44px; border-radius: 50%; background: #0B0F10; color: #FCF9E6; border: 2px solid #0B0F10; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 18px; transition: transform .2s ease; }
  .tbr-card.dark .tbr-arrow { background: #D6E50B; color: #0B0F10; border-color: #D6E50B; }
  .tbr-card.open .tbr-arrow { transform: rotate(90deg); }
  .tbr-label { font-size: 12px; font-weight: 700; opacity: .75; margin-top: 16px; }
  .tbr-title { font-family: "Archivo Black", "Arial Black", Arial, sans-serif; text-transform: uppercase; font-size: clamp(22px, 3.2vw, 30px); line-height: 1; margin-top: 4px; overflow-wrap: anywhere; }
  .tbr-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; margin-top: 10px; }
  .tbr-meta b { font-weight: 800; }
  .tbr-status { display: inline-flex; margin-top: 14px; background: rgba(11,15,16,.12); border-radius: 100px; padding: 3px; gap: 2px; flex-wrap: wrap; }
  .tbr-card.dark .tbr-status { background: rgba(252,249,230,.14); }
  .tbr-status button { border: none; background: transparent; color: inherit; font-family: inherit; font-weight: 700; font-size: 12px; padding: 7px 12px; border-radius: 100px; cursor: pointer; }
  .tbr-status button.on { background: #0B0F10; color: #FCF9E6; }
  .tbr-card.dark .tbr-status button.on { background: #D6E50B; color: #0B0F10; }
  .tbr-more { display: none; margin-top: 14px; padding-top: 14px; border-top: 2px dashed rgba(11,15,16,.25); gap: 8px; flex-wrap: wrap; }
  .tbr-card.dark .tbr-more { border-top-color: rgba(252,249,230,.25); }
  .tbr-card.open .tbr-more { display: flex; }
  .tbr-act { background: #0B0F10; color: #FCF9E6; border: 2px solid #0B0F10; border-radius: 100px; padding: 8px 14px; font-size: 12px; font-weight: 800; text-transform: uppercase; cursor: pointer; font-family: inherit; }
  .tbr-card.dark .tbr-act { background: #D6E50B; color: #0B0F10; border-color: #D6E50B; }
  .tbr-act.ghost { background: transparent !important; color: inherit !important; border-color: currentColor !important; }
  .tbr-nonfinito { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; background: transparent; color: inherit; border: none; padding: 4px 2px; font-family: inherit; font-size: 12.5px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; opacity: .85; }
  .tbr-nonfinito:hover { opacity: 1; }
  .tbr-nf-azioni { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
  .tbr-extra { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
  .tbr-formato { display: inline-flex; gap: 4px; background: rgba(11,15,16,.16); border-radius: 100px; padding: 3px; }
  .tbr-card.dark .tbr-formato { background: rgba(252,249,230,.18); }
  .tbr-formato button { border: none; background: rgba(252,249,230,.72); border-radius: 100px; padding: 4px 9px; font-size: 15px; line-height: 1; cursor: pointer; opacity: 1; }
  .tbr-formato button.on { background: #FCF9E6; box-shadow: 0 0 0 2px #0B0F10; }
  .tbr-data { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; }
  .tbr-data input { font-family: inherit; font-size: 12.5px; border: 1.5px solid currentColor; border-radius: 10px; padding: 4px 8px; background: transparent; color: inherit; }
  .tbr-done-note { font-size: 12.5px; font-weight: 600; margin-top: 10px; }
  .tbr-empty { text-align: center; padding: 36px 16px; border: 2px dashed #34393A; border-radius: 22px; color: #B9BCB2; font-size: 14px; }
  .tbr-empty b { display: block; font-family: "Archivo Black", "Arial Black", Arial, sans-serif; text-transform: uppercase; font-weight: 400; color: #FCF9E6; font-size: 20px; margin-bottom: 6px; }
  .tbr-empty .row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }

  /* Reading archive: numbers */
  .numbers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
  .num-tile { border-radius: 22px; padding: 16px; background: var(--nc); color: var(--nf); border: 2px solid #0B0F10; position: relative; overflow: hidden; min-height: 150px; display: flex; flex-direction: column; }
  .num-tile .ne { font-size: 28px; line-height: 1; }
  .num-tile .nl { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; margin-top: auto; opacity: .85; }
  .num-tile .nv { font-family: "Archivo Black", "Arial Black", Arial, sans-serif; text-transform: uppercase; font-size: 19px; line-height: 1.05; margin-top: 4px; overflow-wrap: anywhere; }
  .num-tile .nv.big { font-size: 34px; }


  /* Chat tools + history */
  .chat-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0 0 12px; }
  .ct-btn { display: inline-flex; align-items: center; gap: 7px; background: var(--paper); color: var(--ink); border: 2px solid var(--ink); border-radius: 100px; padding: 8px 14px; font-family: inherit; font-weight: 700; font-size: 13px; cursor: pointer; }
  .ct-btn:hover { background: var(--ink); color: var(--paper); }
  .ct-n { background: #D6E50B; color: #0B0F10; border-radius: 100px; padding: 1px 8px; font-size: 11.5px; }
  .ct-end { margin-left: auto; background: #FF5B40; color: #FCF9E6; border: 2px solid #0B0F10; border-radius: 100px; padding: 8px 16px; font-family: inherit; font-weight: 800; font-size: 12.5px; text-transform: uppercase; letter-spacing: .03em; cursor: pointer; box-shadow: 0 3px 0 #0B0F10; }
  .ct-end:active { transform: translateY(2px); box-shadow: 0 1px 0 #0B0F10; }
  .ct-end:disabled { opacity: .5; cursor: default; }
  .hist-card { max-width: 560px; background: var(--paper); border: 3px solid #0B0F10; border-radius: 26px; box-shadow: 8px 8px 0 #D6E50B; }
  .hist-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 10px; }
  .hist-top h2 { font-size: 24px; }
  .hist-list { display: flex; flex-direction: column; gap: 10px; }
  .hist-item { text-align: left; width: 100%; border: 2px solid #0B0F10; border-radius: 18px; padding: 14px 16px; background: var(--hc); color: var(--hf); cursor: pointer; font-family: inherit; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; }
  .hist-item:hover { transform: translateY(-2px); }
  .hist-item b { font-size: 14.5px; line-height: 1.3; overflow-wrap: anywhere; }
  .hist-item small { font-size: 12px; opacity: .8; grid-column: 1; }
  .hist-item .he { grid-row: span 2; font-size: 22px; letter-spacing: 2px; }
  .hist-empty { text-align: center; color: var(--sage); font-size: 14px; padding: 26px 10px; }
  .hist-empty span { font-size: 38px; display: block; margin-bottom: 6px; }
  .hist-back { background: none; border: none; color: var(--sage); font-weight: 700; font-size: 13px; cursor: pointer; padding: 8px 8px 8px 0; margin: -8px 0 4px; min-height: 38px; display: inline-flex; align-items: center; font-family: inherit; }
  .hist-transcript { display: flex; flex-direction: column; gap: 8px; max-height: 46vh; overflow-y: auto; padding: 4px 2px 10px; }
  .hist-transcript .msg { max-width: 90%; font-size: 13.5px; }
  .hist-books { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
  .hist-books span { font-size: 12px; font-weight: 700; background: #FCF9E6; color: #0B0F10; border: 1.5px solid #0B0F10; border-radius: 100px; padding: 3px 10px; }
  .hist-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

  /* Added-book popup */
  .added-card { max-width: 420px; text-align: center; background: #D6E50B; color: #0B0F10; border: 2px solid #0B0F10; border-radius: 26px; padding: 34px 28px 28px; }
  .added-card h2 { font-size: 28px; line-height: 1; color: #0B0F10; }
  .added-stars { font-size: 22px; letter-spacing: 8px; margin-bottom: 14px; }
  .added-book { font-size: 15px; margin: 14px 0 24px; line-height: 1.45; }
  .added-book b { font-weight: 700; }
  .added-actions { display: flex; flex-direction: column; gap: 10px; }
  @keyframes popIn { from { transform: scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
  #addedModal:not(.hidden) .added-card { animation: popIn .25s ease both; }
  @media (prefers-reduced-motion: reduce) { #addedModal:not(.hidden) .added-card { animation: none; } }

  .bk-cover-row { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
  .bk-cover-row img { width: 74px; height: 110px; object-fit: cover; border: 2px solid var(--ink); border-radius: 8px; background: var(--paper-soft); }
  .suggest-item { display: flex; gap: 12px; align-items: center; }
  .sg-cover { width: 38px; height: 56px; object-fit: cover; border-radius: 4px; border: 1px solid var(--paper-line); background: var(--paper-soft); flex: 0 0 auto; }
  .sg-none { display: flex; align-items: center; justify-content: center; font-size: 20px; }
  .sg-txt { display: flex; flex-direction: column; min-width: 0; }
  .bc-cover { position: absolute; right: 18px; bottom: 16px; width: 64px; height: 96px; object-fit: cover; border-radius: 6px; border: 2px solid #0B0F10; box-shadow: 3px 3px 0 rgba(11,15,16,.35); }
  .bcard.with-cover { padding-right: 96px; }
  .bcard.with-cover .bc-rate { margin-right: 74px; }
  .tbr-cover { width: 46px; height: 68px; object-fit: cover; border-radius: 6px; border: 2px solid #0B0F10; flex: 0 0 auto; }

  .lib-tools { display: flex; align-items: center; gap: 10px; margin: 16px 0 26px; }
  .lib-tools .add-book-btn { margin: 0; flex: 1; }
  .lib-view { display: inline-flex; border: 2px solid var(--ink); border-radius: 100px; overflow: hidden; flex: 0 0 auto; }
  .lib-view button { background: none; border: none; padding: 10px 12px; cursor: pointer; color: var(--ink); display: inline-flex; }
  .lib-view button.on { background: var(--ink); color: var(--paper); }
  .lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; }
  .lg-card { position: relative; aspect-ratio: 2 / 3; border: 2px solid #0B0F10; border-radius: 12px; overflow: hidden; cursor: pointer; padding: 12px; display: flex; align-items: flex-end; font-family: inherit; }
  .lg-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
  .lg-t { position: relative; font-family: "Archivo Black", "Arial Black", Arial, sans-serif; text-transform: uppercase; font-size: 13px; line-height: 1.05; text-align: left; overflow-wrap: anywhere; }
  .lg-rate { position: absolute; top: 8px; right: 8px; background: #0B0F10; color: #D6E50B; border-radius: 100px; padding: 2px 8px; font-size: 11px; font-weight: 800; }
  .lg-card:hover { transform: translateY(-2px); }

  /* ---------- Library ---------- */
  .lib-search {
    display: flex; align-items: center; gap: 10px; border: 2px solid var(--ink); border-radius: 100px;
    padding: 0 18px; background: var(--paper); color: var(--ink);
  }
  .lib-search input { flex: 1; border: none; outline: none; background: transparent; font-family: inherit; font-size: 15px; padding: 14px 0; color: var(--ink); min-width: 0; }
  .lib-search:focus-within { box-shadow: 0 0 0 3px var(--brass); }
  .lib-cats { display: flex; gap: 8px; overflow-x: auto; padding: 14px 0 4px; }
  .lib-cat { flex: 0 0 auto; border: none; background: var(--paper-soft); color: var(--ink); padding: 9px 16px; border-radius: 100px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; }
  .lib-cat.on { background: var(--ink); color: var(--paper); }
  .lib-mode { flex: 0 0 auto; display: inline-flex; border: 2px solid var(--ink); border-radius: 100px; overflow: hidden; margin-right: 4px; }
  .lib-mode button { background: none; border: none; padding: 7px 12px; font-size: 12px; font-weight: 700; cursor: pointer; color: var(--ink); font-family: inherit; }
  .lib-mode button.on { background: var(--ink); color: var(--paper); }
  .add-book-btn {
    width: 100%; margin: 16px 0 26px; display: flex; align-items: center; justify-content: center; gap: 10px;
    background: #FF5B40; color: #FCF9E6; border: 2px solid #FF5B40; border-radius: 100px; padding: 15px 20px; cursor: pointer;
    font-family: "Archivo Black", "Arial Black", Arial, sans-serif; text-transform: uppercase; font-size: 15px; letter-spacing: .02em;
    box-shadow: 0 4px 0 #0B0F10; transition: transform .12s ease, box-shadow .12s ease;
  }
  .add-book-btn span { font-size: 22px; line-height: 1; }
  .add-book-btn:hover { transform: translateY(-1px); box-shadow: 0 5px 0 #0B0F10; }
  .add-book-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #0B0F10; }
  .back-link { background: none; border: none; color: var(--sage); font-weight: 700; font-size: 13.5px; cursor: pointer; padding: 10px 8px 10px 0; margin: -10px 0 8px; min-height: 40px; display: inline-flex; align-items: center; font-family: inherit; }
  .back-link:hover { color: var(--ink); }

  .book-stack-list { display: flex; flex-direction: column; padding-top: 14px; }
  .bcard {
    --bg: #007E94; --fg: #FCF9E6;
    position: relative; background: var(--bg); color: var(--fg);
    border-radius: 26px; padding: 26px 24px 58px; min-height: 180px;
    display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: start;
    cursor: pointer; text-align: left; width: 100%; border: none; font-family: inherit;
    box-shadow: 0 -6px 18px rgba(11,15,16,.10);
    transition: transform .2s ease;
  }
  .bcard + .bcard { margin-top: -44px; }
  .bcard:hover { transform: translateY(-6px); }
  .bcard.open { padding-bottom: 26px; }
  .bcard.open + .bcard { margin-top: 14px; }
  .bcard::before {
    content: ""; position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
    width: 64px; height: 26px; background: var(--bg); border-radius: 14px 14px 0 0;
  }
  .bcard::after {
    content: ""; position: absolute; top: -4px; left: 50%; width: 8px; height: 8px;
    border-left: 2.5px solid var(--fg); border-top: 2.5px solid var(--fg); transform: translateX(-50%) rotate(45deg); opacity: .8;
  }
  .bcard:first-child::before, .bcard:first-child::after { display: none; }
  .bc-author { font-size: 12.5px; font-weight: 600; opacity: .8; }
  .bc-title { font-family: "Archivo Black", "Arial Black", Arial, sans-serif; text-transform: uppercase; font-size: clamp(24px, 3.4vw, 34px); line-height: 1; margin-top: 8px; overflow-wrap: anywhere; }
  .bc-rate { text-align: center; min-width: 64px; }
  .bc-rate .star { font-size: 26px; line-height: 1; }
  .bc-rate .num { font-family: "Archivo Black", "Arial Black", Arial, sans-serif; font-size: 30px; line-height: 1; margin-top: 4px; }
  .bc-rate .lbl { font-size: 11.5px; opacity: .8; margin-top: 3px; }
  .bc-more { grid-column: 1 / -1; display: none; }
  .bcard.open .bc-more { display: block; }
  .bc-more .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
  .bc-more .tg { font-size: 11.5px; font-weight: 600; padding: 4px 10px; border-radius: 100px; background: rgba(252,249,230,.9); color: #0B0F10; }
  .bc-more .note { font-size: 13.5px; line-height: 1.5; margin-top: 10px; opacity: .92; }
  .bc-more .bc-actions { display: flex; gap: 8px; margin-top: 14px; }
  .bc-date { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; margin-top: 6px; opacity: .85; }
  .bc-fmt { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: #FCF9E6; border: 1.5px solid #0B0F10; font-size: 13px; flex: 0 0 auto; }
  .lg-fmt { position: absolute; top: 6px; left: 6px; width: 28px; height: 28px; border-radius: 50%; background: #FCF9E6; border: 2px solid #0B0F10; display: flex; align-items: center; justify-content: center; font-size: 14px; z-index: 2; }
  .bc-edit { background: var(--fg); color: var(--bg); border: 2px solid var(--fg); border-radius: 100px; padding: 7px 14px; font-size: 12px; font-weight: 700; cursor: pointer; font-family: inherit; }
  .bc-del { background: transparent; color: var(--fg); border: 2px solid var(--fg); border-radius: 100px; padding: 7px 14px; font-size: 12px; font-weight: 700; cursor: pointer; font-family: inherit; }

  @media (max-width: 860px) {
    .app { flex-direction: column; }
    .shelf { display: none; }
    .mobile-topbar {
      display: flex; align-items: center; justify-content: space-between;
      background: var(--forest-deep); color: #FCF9E6; padding: 14px 16px;
      padding-top: calc(14px + env(safe-area-inset-top, 0px));
      position: sticky; top: 0; z-index: 5;
    }
    .mobile-topbar select { font-family: inherit; background: rgba(252,249,230,0.1); color: #FCF9E6; border: 1px solid rgba(252,249,230,0.25); border-radius: 100px; padding: 6px 12px; font-size: 13px; }
    .app > .main { padding: 0 16px calc(132px + env(safe-area-inset-bottom, 0px)); }
    .topbar { padding: 14px 0 10px; }
    .tb-logo img { height: 38px; }
    .nm-item { font-size: 21px; }
    .main-top { display: none; }
    .challenge { grid-template-columns: 1fr; padding: 22px; }
    .ch-art { position: absolute; right: -4px; bottom: -8px; width: 120px; opacity: .95; }
    body.on-dashboard .mobile-right .avatar-btn { display: none; }
    .ch-text, .ch-progress { max-width: 70%; }
    .bento { grid-template-columns: 1fr 1fr; }
    .tile-count { min-height: 260px; }
    .t-big { font-size: 72px; }
    .t-h { font-size: 16px; }
    .wday { padding: 8px 0 10px; }
    .wday .wn { font-size: 14px; }
    .tbr-head-right { flex-direction: column; }
    .tbr-share { font-size: 11.5px; padding: 8px 12px; }
    .card-prev img { max-height: 40vh; }
    .q-text { font-size: 19px; }
    .lib-tools { flex-wrap: wrap; }
    .lib-tools .add-book-btn { flex: 1 1 100%; }
    .lib-view { margin: 0 auto; }
    /* iOS zooms in on fields smaller than 16px: keep every field at 16px on phones */
    input, select, textarea { font-size: 16px !important; }
    .checkin-inline { flex-direction: column; align-items: stretch; gap: 10px; }
    .ci-form { display: flex; gap: 8px; }
    .ci-form input { flex: 1; width: auto; min-width: 0; }
    /* the illustration must never sit on top of the challenge buttons */
    .ch-art { width: 104px; right: -6px; bottom: -6px; }
    .ch-actions { padding-right: 96px; }
    .ch-text, .ch-progress { max-width: 100%; padding-right: 92px; }
    .ig-photo, .flip, .pg-thumb { touch-action: manipulation; }
    .tbr-card, .bcard, .pop-card, .ig-post { overflow-wrap: anywhere; }
    .tbr-status button, .wl-tab, .lib-cat, .lib-mode button { min-height: 38px; }
    .ct-end { margin-left: 0; }
    .chat-tools .ct-btn { padding: 7px 11px; font-size: 12.5px; }
    .tbr-panel { padding: 22px 16px 18px; border-radius: 24px; }
    #view-account .acc-head { flex-direction: column; align-items: flex-start; padding: 22px; }
    #view-account .pref-grid { grid-template-columns: 1fr 1fr !important; }
    #view-account .acc-stats { grid-template-columns: repeat(3, 1fr); }
    #view-account .acc-row { flex-direction: column; align-items: flex-start; }
    #onboardModal .ob-card { padding: 26px 18px 20px; }
    #onboardModal .modal-actions { flex-direction: column-reverse; align-items: stretch; gap: 12px; }
    #onboardModal .modal-actions > div { display: flex; gap: 8px; }
    #onboardModal .modal-actions > div > button { flex: 1; display: inline-flex; align-items: center; justify-content: center; text-align: center; }
    #onboardModal .modal-actions .skip-link { text-align: center; }
    #onboardModal .ob-tellme { width: 60px; height: 60px; top: 14px; right: 14px; }
    .tbr-head { padding-right: 0; }
    .tbr-head p { display: none; }
    .tbr-count { width: 82px; height: 82px; }
    .tbr-count b { font-size: 28px; }
    .tbr-add-row { grid-template-columns: 1fr; }
    .numbers { grid-template-columns: 1fr 1fr; }
    .bcard { padding: 22px 18px 54px; min-height: 160px; border-radius: 22px; }
    .bcard + .bcard { margin-top: -40px; }
    .bc-title { font-size: 23px; }
    .cloud-content { padding-top: 86px; padding-bottom: 170px; }
    .landing-title { max-width: 12ch; }
    .landing-sub { max-width: 27ch; font-size: 15px; }
    .landing-ctas { max-width: 250px; }
    .cloud-area { min-height: 600px; }
    .landing-top { padding: 18px 18px; padding-top: calc(18px + env(safe-area-inset-top, 0px)); }
    .lbl-long { display: none; }
    .lbl-short { display: inline; }
    .landing-login { padding: 9px 20px; font-size: 13px; }
    .cloud-content { padding-top: 122px; }
    .landing-title { line-height: 1.12; }
    .mobile-right { display: flex; gap: 10px; align-items: center; }
    .mobile-right .avatar-btn { width: 36px; height: 36px; font-size: 13px; border-color: #FCF9E6; order: 2; }
    .mobile-topbar .brand-mark { font-size: 16px; white-space: nowrap; }
    .mobile-right select { max-width: 52vw; }
    .view-head { padding-right: 0; }
    .pref-grid { grid-template-columns: 1fr; }
    .acc-head { flex-direction: column; align-items: flex-start; }
    .hero { grid-template-columns: 1fr; }
    .spine-stack { order: -1; height: 120px; }
    .hero h1 { font-size: 30px; }
    .grid-2, .rec-grid, .stats-grid { grid-template-columns: 1fr; }
    .mood-grid { grid-template-columns: 1fr 1fr; }
    .badge-grid { grid-template-columns: repeat(2, 1fr); }
    .streak-card { grid-template-columns: 1fr; }
    .msg { max-width: 88%; }
    .chat-hero { padding-right: 0; gap: 14px; }
    .chat-hero-av { width: 76px; height: 76px; }
    .chat-hero p { display: none; }
    .ai-row { max-width: 100%; }
    .chat-wrap { height: calc(100dvh - 305px); min-height: 320px; }   /* il campo di testo resta sopra la barra delle sezioni */
    body.tastiera-aperta .chat-wrap { height: calc(100dvh - 230px); }
  }

/* tastiera aperta sul telefono: via la barra delle sezioni, il campo di testo resta sopra i tasti */
body.tastiera-aperta .tabbar { display: none !important; }
body.tastiera-aperta .main { padding-bottom: 24px; }

/* riga della chat sul telefono: campo, microfono e invio stanno sempre nello schermo */
.chat-input-row input { min-width: 0; }
@media (max-width: 520px) {
  .chat-input-row { gap: 8px; }
  .chat-input-row .chat-mic, .chat-input-row .chat-send { width: 44px; height: 44px; }
  .chat-input-row input { font-size: 16px; padding: 11px 14px; }   /* 16px: su iPhone evita lo zoom automatico quando tocchi il campo */
}

/* proposte della chat sul telefono: una fila che scorre di lato, cosi' il messaggio di benvenuto resta tutto visibile */
@media (max-width: 520px) {
  .chat-suggestions { display: flex; overflow-x: auto; gap: 8px; margin: 6px -2px 12px; padding: 2px 2px 6px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
  .chat-suggestions .chat-chip { flex: 0 0 72%; scroll-snap-align: start; padding: 10px 12px; font-size: 13px; }
  body.tastiera-aperta .chat-suggestions { display: none; }
}

/* chat su mobile: il messaggio resta fermo, scorrono solo le card dei libri */
.chat-log { overflow-x: hidden; overscroll-behavior-x: none; touch-action: pan-y; }
.chat-log .ai-row, .chat-log .ai-body { max-width: 100%; }
.msg-books { touch-action: pan-x pan-y; overscroll-behavior-x: contain; }
@media (max-width: 520px) {
  html, body { overflow-x: clip; }
  .chat-log .ai-row { max-width: 100%; width: 100%; }
  .chat-log .ai-body { flex: 1 1 auto; min-width: 0; }
  .msg-books { margin: 0; padding-right: 6px; scroll-snap-type: x mandatory; }
}

/* verso il primo consiglio */
#primoConsiglio { margin: 4px 0 22px; }
.pc-card { background: #FF5B40; color: #0B0F10; border: 2px solid #0B0F10; border-radius: 24px; padding: 20px 22px; box-shadow: 5px 5px 0 #0B0F10; }
.pc-kicker { font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.pc-titolo { font-family: "Archivo Black", "Arial Black", Arial, sans-serif; text-transform: uppercase; font-weight: 400; font-size: clamp(20px, 3.2vw, 26px); line-height: 1.05; margin: 8px 0 6px; }
.pc-testo { font-size: 14px; line-height: 1.5; margin: 0 0 14px; }
.pc-tacche { display: flex; gap: 6px; margin-bottom: 16px; }
.pc-tacca { flex: 1; height: 8px; border-radius: 100px; background: rgba(11,15,16,.18); border: 1.5px solid #0B0F10; }
.pc-tacca.on { background: #D6E50B; }
.pc-azioni { display: flex; flex-wrap: wrap; gap: 8px; }
.pc-btn { border: 2px solid #0B0F10; background: #FCF9E6; color: #0B0F10; border-radius: 100px; padding: 10px 16px; font-family: inherit; font-weight: 800; font-size: 13px; cursor: pointer; box-shadow: 0 3px 0 #0B0F10; }
.pc-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #0B0F10; }
.pc-cta { width: auto !important; padding: 13px 24px !important; background: #0B0F10 !important; color: #D6E50B !important; }
#primoConsiglioModal { z-index: 86; }
@media (max-width: 520px) { .pc-azioni { flex-direction: column; } .pc-btn { width: 100%; text-align: left; } }
.consent-nota { font-size: 12px; color: var(--sage); margin: 6px 0 0; line-height: 1.45; }

/* date di fine mancanti */
#dateModal { z-index: 88; }
.dm-conta { font-size: 13.5px; line-height: 1.5; margin: 4px 0 12px; }
.dm-lista { max-height: 55vh; overflow-y: auto; display: grid; gap: 8px; padding-right: 2px; }
.dm-riga { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; border: 2px solid var(--ink); border-radius: 14px; padding: 9px 12px; background: var(--paper-soft); }
.dm-libro { min-width: 0; }
.dm-libro b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-libro small { display: block; font-size: 12px; color: var(--sage); }
.dm-riga input[type="date"] { font: inherit; font-size: 14px; border: 2px solid var(--ink); border-radius: 10px; padding: 6px 8px; background: var(--paper); max-width: 150px; }
.dm-vuoto { font-weight: 700; }
.goal-date { display: block; margin-top: 8px; background: none; border: 0; padding: 0; font: inherit; font-size: 12.5px; font-weight: 800; text-decoration: underline; cursor: pointer; color: #0B0F10; text-align: left; }
@media (max-width: 520px) { .dm-riga { grid-template-columns: 1fr; } .dm-riga input[type="date"] { max-width: none; width: 100%; } }
