/* ============================================================
   Hale — self-hosted Inter + Baloo 2 (no third-party font CDN; privacy-first)
   ============================================================ */
/* Baloo 2 — the rounded, bubbly display face that matches the H mark (variable: 400–800). */
@font-face {
  font-family: 'Baloo 2';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(fonts/baloo2-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/inter-400-cyrillic-ext.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/inter-400-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/inter-400-greek-ext.woff2) format('woff2');
  unicode-range: U+1F00-1FFF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/inter-400-greek.woff2) format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/inter-400-vietnamese.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/inter-400-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/inter-400-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/inter-500-cyrillic-ext.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/inter-500-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/inter-500-greek-ext.woff2) format('woff2');
  unicode-range: U+1F00-1FFF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/inter-500-greek.woff2) format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/inter-500-vietnamese.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/inter-500-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/inter-500-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/inter-600-cyrillic-ext.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/inter-600-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/inter-600-greek-ext.woff2) format('woff2');
  unicode-range: U+1F00-1FFF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/inter-600-greek.woff2) format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/inter-600-vietnamese.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/inter-600-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/inter-600-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/inter-700-cyrillic-ext.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/inter-700-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/inter-700-greek-ext.woff2) format('woff2');
  unicode-range: U+1F00-1FFF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/inter-700-greek.woff2) format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/inter-700-vietnamese.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/inter-700-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/inter-700-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ============================================================
   Hale — design system
   ============================================================ */
:root {
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Baloo 2', 'Inter', system-ui, sans-serif;   /* bubbly display face — echoes the rounded H mark */
  --bg:        #0a0c0b;
  --bg-2:      #0e1110;
  --panel:     #11150f00;
  --panel-solid:#10140f;
  --elev:      #141813;
  --elev-2:    #19201a;

  --green:     #4ade80;
  --green-2:   #34d399;
  --green-3:   #86efac;
  --green-deep:#16a34a;
  --accent-rgb: 74 222 128;
  --on-accent: #04130a;
  --green-glow: rgb(var(--accent-rgb) / 0.35);
  --outline:   rgb(var(--accent-rgb) / 0.22);
  --outline-strong: rgb(var(--accent-rgb) / 0.42);

  --text:      #e8ece8;
  --text-dim:  #9aa69c;
  --text-faint:#69756b;

  --radius:    18px;
  --radius-sm: 12px;
  --radius-lg: 26px;

  --sidebar-w: 272px;
  --sidebar-collapsed: 76px;

  --hairline: rgba(255,255,255,0.05);
  --shadow: 0 12px 40px rgba(0,0,0,0.45);
  --ease: cubic-bezier(.22,.61,.36,1);
}

* { box-sizing: border-box; }
/* Form controls don't inherit font-family by default — force every one onto the single app font. */
button, input, textarea, select, optgroup { font-family: var(--font); }
html, body { height: 100%; overflow-x: hidden; overscroll-behavior-x: none; }   /* clip the off-canvas drawer at the viewport — no side-to-side scroll */
body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 70% -10%, rgb(var(--accent-rgb) / 0.06), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgb(var(--accent-rgb) / 0.05), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

svg.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ============================================================ LAYOUT */
.app { display: flex; height: 100vh; padding: 10px; gap: 10px; }

/* ============================================================ SIDEBAR */
.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 auto;
  background: linear-gradient(180deg, var(--elev), var(--bg-2));
  border: 1px solid var(--outline);
  border-radius: var(--radius-lg);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow);
  transition: width .28s var(--ease), padding .28s var(--ease), opacity .2s var(--ease);
  position: relative;
  z-index: 30;
}
/* open ↔ closed sidebar — docked, pushes the main pane aside (no overlay) */
.app.closed { gap: 0; }
.app.closed .sidebar { width: 0; min-width: 0; padding-left: 0; padding-right: 0; border-width: 0; opacity: 0; overflow: hidden; pointer-events: none; }
#openSidebar { display: none; }
.app.closed #openSidebar { display: grid; }

.sidebar-top { display: flex; align-items: center; gap: 8px; padding: 4px 6px 8px; }
.brand { display: flex; align-items: center; gap: 10px; overflow: hidden; }
.brand-mark { display: flex; flex: 0 0 auto; }
.brand-mark svg { width: 32px; height: 32px; display: block; }
.brand-name {
  font-family: var(--font);
  font-weight: 700; font-size: 1.3125rem; letter-spacing: .5px;
  background: linear-gradient(90deg, var(--green-3), var(--green)); -webkit-background-clip: text; background-clip: text; color: transparent;
}

.icon-btn {
  display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 11px;
  background: transparent; border: 1px solid transparent; color: var(--text-dim);
  cursor: pointer; transition: .18s var(--ease); flex: 0 0 auto;
}
.icon-btn:hover { background: var(--elev-2); color: var(--text); border-color: var(--outline); }
.icon-btn.listening { color: var(--green); border-color: var(--green); background: rgb(var(--accent-rgb) / 0.10); animation: micPulse 1.2s ease-in-out infinite; }
@keyframes micPulse { 0%,100% { box-shadow: 0 0 0 0 rgb(var(--accent-rgb) / 0.35); } 50% { box-shadow: 0 0 0 5px rgb(var(--accent-rgb) / 0); } }

.new-chat {
  display: flex; align-items: center; gap: 12px;
  margin: 6px 2px 10px;
  padding: 11px 14px; border-radius: 14px;
  background: linear-gradient(180deg, rgb(var(--accent-rgb) / 0.14), rgb(var(--accent-rgb) / 0.06));
  border: 1px solid var(--outline-strong);
  color: var(--text); font-weight: 600; font-size: 0.875rem; cursor: pointer;
  transition: .18s var(--ease);
}
.new-chat:hover { box-shadow: 0 0 0 3px rgb(var(--accent-rgb) / 0.10); border-color: var(--green); transform: translateY(-1px); }
.new-chat .ic { width: 18px; height: 18px; color: var(--green); }

.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item {
  display: flex; align-items: center; gap: 13px;
  padding: 10px 13px; border-radius: 12px;
  background: transparent; border: 1px solid transparent;
  color: var(--text-dim); font-size: 0.875rem; font-weight: 500;
  cursor: pointer; text-align: left; width: 100%;
  transition: .15s var(--ease);
}
.nav-item:hover { background: var(--elev-2); color: var(--text); }
.nav-item.active {
  background: linear-gradient(90deg, rgb(var(--accent-rgb) / 0.12), transparent);
  border-color: var(--outline); color: var(--text);
}
.nav-item.active .ic { color: var(--green); }
.nav-item .ic { flex: 0 0 auto; }

.nav-section-label { color: var(--text-faint); font-size: 0.6875rem; font-weight: 600; letter-spacing: .8px; text-transform: uppercase; padding: 14px 14px 6px; transition: .2s var(--ease); }

.recents { flex: 1 1 auto; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; min-height: 0; }
.recents::-webkit-scrollbar { width: 8px; }
.recents::-webkit-scrollbar-thumb { background: var(--elev-2); border-radius: 8px; }
.recent {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 13px; border-radius: 10px; cursor: pointer;
  color: var(--text-dim); font-size: 0.8125rem; border: 1px solid transparent;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: .15s var(--ease);
}
.recent:hover { background: var(--elev-2); color: var(--text); }
.recent .ic { width: 15px; height: 15px; flex: 0 0 auto; opacity: .7; }

.sidebar-bottom { border-top: 1px solid var(--outline); padding-top: 8px; margin-top: 4px; display: flex; flex-direction: column; gap: 3px; }
.user { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 12px; background: transparent; border: 1px solid transparent; cursor: pointer; transition: .15s var(--ease); }
.user:hover { background: var(--elev-2); border-color: var(--outline); }
.user-meta { display: flex; flex-direction: column; line-height: 1.25; text-align: left; }
.user-name { font-size: 0.8125rem; font-weight: 600; color: var(--text); }
.user-plan { font-size: 0.6875rem; color: var(--green-2); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto;
  background: linear-gradient(135deg, var(--green), var(--green-deep)); color: var(--on-accent); font-weight: 700; font-size: 0.875rem; border: none; cursor: pointer; }
.avatar.lg { width: 36px; height: 36px; }

/* ============================================================ MAIN */
.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; background: linear-gradient(180deg, var(--bg-2), var(--bg)); border: 1px solid var(--hairline); border-radius: var(--radius-lg); overflow: hidden; }

.topbar { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--hairline); }
.model-pill { display: flex; align-items: center; gap: 9px; padding: 8px 14px; border-radius: 999px; background: var(--elev); border: 1px solid var(--outline); color: var(--text); font-size: 0.875rem; font-weight: 600; cursor: pointer; transition: .15s var(--ease); }
.model-pill:hover { border-color: var(--outline-strong); }
.model-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green-glow); }
.model-pill .chev { width: 16px; height: 16px; color: var(--text-dim); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.badge-privacy { display: flex; align-items: center; gap: 6px; font-size: 0.78125rem; font-weight: 600; color: var(--green-2); padding: 6px 12px; border-radius: 999px; border: 1px solid var(--outline); background: rgb(var(--accent-rgb) / 0.05); }
.badge-privacy .ic { width: 15px; height: 15px; }

.view { flex: 1 1 auto; overflow-y: auto; min-height: 0; }
.view::-webkit-scrollbar { width: 10px; }
.view::-webkit-scrollbar-thumb { background: var(--elev-2); border-radius: 8px; }

/* ============================================================ CHAT / HERO */
.chat-wrap { max-width: 820px; margin: 0 auto; padding: 24px 24px 0; height: 100%; display: flex; flex-direction: column; }
.hero { flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 30px 0 10px; }
.hero-tag {
  font-family: var(--font); font-weight: 600;
  font-size: clamp(28px, 4vw, 40px); line-height: 1.12; letter-spacing: -.4px; margin: 0;
  background: linear-gradient(100deg, var(--green-3) 0%, var(--green) 45%, var(--green-deep) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { color: var(--text-dim); font-size: 1rem; margin: 14px auto 0; max-width: 500px; line-height: 1.6; }

.suggestions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 28px; }
.suggestion {
  text-align: left; padding: 16px; border-radius: var(--radius); cursor: pointer;
  background: var(--panel-solid); border: 1px solid var(--hairline);
  color: var(--text); transition: .18s var(--ease); display: flex; flex-direction: column; gap: 10px; min-height: 104px;
}
.suggestion:hover { border-color: var(--outline-strong); transform: translateY(-2px); box-shadow: 0 0 0 3px rgb(var(--accent-rgb) / 0.06); }
.suggestion .s-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgb(var(--accent-rgb) / 0.10); color: var(--green); }
.suggestion .s-ic .ic { width: 18px; height: 18px; }
.suggestion .s-text { font-size: 0.84375rem; line-height: 1.45; color: var(--text); }
.suggestion .s-meta { margin-top: auto; font-size: 0.71875rem; color: var(--text-faint); }

/* messages */
.messages { display: flex; flex-direction: column; gap: 22px; padding: 16px 0 12px; flex: 1 1 auto; overflow-y: auto; min-height: 0; }
.messages::-webkit-scrollbar { width: 10px; }
.messages::-webkit-scrollbar-thumb { background: var(--elev-2); border-radius: 8px; }
.msg { display: flex; gap: 14px; align-items: flex-start; }
.msg .m-avatar { width: 32px; height: 32px; border-radius: 9px; flex: 0 0 auto; display: grid; place-items: center; font-size: 0.8125rem; font-weight: 700; }
.msg.user .m-avatar { background: var(--elev-2); color: var(--text-dim); }
.msg.bot .m-avatar { background: linear-gradient(135deg, var(--green), var(--green-deep)); color: var(--on-accent); }
.msg.bot .m-avatar svg { width: 18px; height: 18px; stroke: var(--on-accent); fill: none; stroke-width: 1.8; }
.m-body { padding-top: 4px; font-size: 0.9375rem; line-height: 1.65; color: var(--text); }
.m-body p { margin: 0 0 10px; }
.m-body p:last-child { margin-bottom: 0; }
.m-body strong { color: var(--green-3); font-weight: 600; }
.m-body em { color: var(--text); font-style: italic; }
.m-body ul { margin: 0 0 10px; padding-left: 20px; }
.m-body li { margin: 3px 0; }
.m-disclaimer { margin-top: 10px; font-size: 0.75rem; color: var(--text-faint); border-left: 2px solid var(--outline); padding-left: 10px; }
.typing { display: inline-flex; gap: 5px; align-items: center; padding: 6px 0; }
.typing span { width: 8px; height: 8px; border-radius: 50%; background: var(--green); animation: tdot 1.1s ease-in-out infinite; }
.typing span:nth-child(2){ animation-delay: .15s } .typing span:nth-child(3){ animation-delay: .3s }
@keyframes tdot { 0%,60%,100%{ transform: translateY(0) scale(.8); opacity: .4 } 30%{ transform: translateY(-5px) scale(1); opacity: 1 } }
.caret { display: inline-block; width: 2px; height: 1.05em; margin-left: 1px; vertical-align: -3px; border-radius: 1px; background: var(--green); box-shadow: 0 0 6px var(--green-glow); animation: caretBlink .9s steps(1) infinite; }
@keyframes caretBlink { 0%,50%{ opacity: 1 } 50.01%,100%{ opacity: 0 } }

/* composer */
.composer-wrap { flex: 0 0 auto; padding: 26px 0 18px; position: relative; }
.composer { display: flex; align-items: flex-end; gap: 8px; background: var(--elev); border: 1px solid var(--outline); border-radius: 26px; padding: 8px 8px 8px 8px; transition: .18s var(--ease); }
.composer:focus-within { border-color: var(--green); box-shadow: 0 0 0 4px rgb(var(--accent-rgb) / 0.08); }
.composer textarea { flex: 1 1 auto; resize: none; border: none; outline: none; background: transparent; color: var(--text); font: inherit; font-size: 0.9375rem; line-height: 1.5; padding: 9px 6px; max-height: 160px; }
.composer textarea::placeholder { color: var(--text-faint); }
.composer .icon-btn { width: 40px; height: 40px; }
.composer .send { background: linear-gradient(135deg, var(--green), var(--green-deep)); color: var(--on-accent); border: none; }
.composer .send:hover { box-shadow: 0 0 14px var(--green-glow); }
.composer .send .ic { stroke: var(--on-accent); }
.composer-hint { text-align: center; font-size: 0.71875rem; color: var(--text-faint); margin-top: 9px; }
.composer-hint b { color: var(--green-2); font-weight: 600; }
.attach-chip { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 8px; padding: 7px 12px; border-radius: 10px; background: rgb(var(--accent-rgb) / 0.08); border: 1px solid var(--outline); color: var(--green-3); font-size: 0.78125rem; }
.attach-chip .x { cursor: pointer; opacity: .7; } .attach-chip .x:hover { opacity: 1; }

/* ============================================================ GENERIC PAGE */
.page { max-width: 1080px; margin: 0 auto; padding: 30px 28px 60px; }
.page-head { margin-bottom: 26px; }
.page-eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--green-2); font-size: 0.78125rem; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; }
.page-eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: heartbeat 2.4s var(--ease) infinite; }
@keyframes heartbeat {
  0% { box-shadow: 0 0 0 0 rgb(var(--accent-rgb) / 0.45); transform: scale(1); }
  14% { transform: scale(1.25); }
  28% { transform: scale(1); }
  70% { box-shadow: 0 0 0 10px rgb(var(--accent-rgb) / 0); }
  100% { box-shadow: 0 0 0 0 rgb(var(--accent-rgb) / 0); transform: scale(1); }
}
.page-title { font-family: var(--font); font-size: 1.875rem; font-weight: 700; margin: 8px 0 8px; letter-spacing: -.4px; }
.page-desc { color: var(--text-dim); font-size: 0.9375rem; max-width: 640px; line-height: 1.6; }

.grid { display: grid; gap: 16px; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }

.card { background: var(--panel-solid); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 20px; transition: .18s var(--ease); }
.card:hover { border-color: var(--outline); }
.card.outline { border-color: var(--outline); }
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.card-ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: rgb(var(--accent-rgb) / 0.10); color: var(--green); flex: 0 0 auto; }
.card-title { font-weight: 600; font-size: 1rem; }
.card-sub { font-size: 0.78125rem; color: var(--text-faint); }

.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 0.75rem; font-weight: 600; padding: 5px 11px; border-radius: 999px; }
.pill.green { color: var(--green-2); background: rgb(var(--accent-rgb) / 0.10); border: 1px solid var(--outline); }
.pill.amber { color: #fbbf6c; background: rgba(251,191,108,0.10); border: 1px solid rgba(251,191,108,0.25); }
.pill.gray  { color: var(--text-dim); background: var(--elev-2); border: 1px solid var(--hairline); }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.metric { display: flex; flex-direction: column; gap: 4px; }
.metric .m-val { font-family: var(--font); font-size: 1.625rem; font-weight: 700; }
.metric .m-lab { font-size: 0.78125rem; color: var(--text-dim); }
.metric .m-trend { font-size: 0.75rem; font-weight: 600; }
.metric .m-trend.up { color: var(--green); } .metric .m-trend.down { color: #f87171; }

.bar { height: 8px; border-radius: 99px; background: var(--elev-2); overflow: hidden; margin-top: 10px; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--green-deep), var(--green)); }

.list-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--hairline); }
.list-row:last-child { border-bottom: none; }
.list-row .grow { flex: 1 1 auto; min-width: 0; }
.list-row .r-title { font-weight: 600; font-size: 0.90625rem; }
.list-row .r-sub { font-size: 0.78125rem; color: var(--text-dim); margin-top: 2px; }

.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 999px; font-family: var(--font-display); font-size: 0.875rem; font-weight: 600; cursor: pointer; border: 1px solid transparent; transition: .15s var(--ease); }
.btn.primary { background: linear-gradient(135deg, var(--green), var(--green-deep)); color: var(--on-accent); }
.btn.primary:hover { box-shadow: 0 0 16px var(--green-glow); }
.btn.ghost { background: transparent; border-color: var(--outline); color: var(--text); }
.btn.ghost:hover { border-color: var(--green); }
.btn .ic { width: 17px; height: 17px; }

.upload-zone { border: 1.5px dashed var(--outline-strong); border-radius: var(--radius); padding: 34px; text-align: center; color: var(--text-dim); cursor: pointer; transition: .18s var(--ease); }
.upload-zone:hover { background: rgb(var(--accent-rgb) / 0.04); border-color: var(--green); color: var(--text); }
.upload-zone .ic { width: 30px; height: 30px; color: var(--green); margin-bottom: 8px; }

/* sparkline */
.spark { width: 100%; height: 46px; margin-top: 12px; }
.spark path.line { fill: none; stroke: var(--green); stroke-width: 2; }
.spark path.area { fill: url(#sparkGrad); opacity: .25; stroke: none; }

/* Digital Twin — compact confidence gauge (in the markers card header) */
#twinModelCard { --cc: var(--green); }
#twinModelCard.conf-low { --cc: #fbbf6c; }
#twinModelCard.conf-moderate { --cc: var(--green-3); }
#twinModelCard.conf-high { --cc: var(--green); }
.twin-markers-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 14px; }
.twin-markers-intro { min-width: 200px; flex: 1 1 auto; }
.twin-gauge { display: flex; flex-direction: column; align-items: center; gap: 5px; flex: 0 0 auto; }
.twin-gauge svg { width: 88px; height: 88px; display: block; }
.twin-gauge .track { fill: none; stroke: var(--elev-2); stroke-width: 8; }
.twin-gauge .prog { fill: none; stroke: var(--cc); stroke-width: 8; stroke-linecap: round;
  stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset .6s var(--ease), stroke .3s; }
.twin-gauge .conf-pct { fill: var(--cc); font: 700 30px var(--font); transition: fill .3s; }
.twin-conf-cap { font-size: 0.75rem; color: var(--text-dim); }
.twin-conf-cap b { color: var(--cc); text-transform: capitalize; font-weight: 600; }

/* Digital Twin — what-if simulator */
.twin-inputs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.twin-field { display: flex; flex-direction: column; gap: 5px; }
.twin-field > span { font-size: 0.75rem; color: var(--text-dim); }
.twin-field .tf-unit { color: var(--text-faint); }
.twin-field input, #twinScenario {
  font: inherit; font-size: 0.875rem; color: var(--text);
  background: var(--elev); border: 1px solid var(--hairline); border-radius: 10px; padding: 9px 11px;
}
.twin-field input:focus, #twinScenario:focus { outline: none; border-color: var(--green); }
.scenario-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.scenario-chip { font: inherit; font-size: 0.8125rem; color: var(--text-dim); background: transparent; cursor: pointer;
  border: 1px solid var(--hairline); border-radius: 999px; padding: 7px 12px; transition: .15s var(--ease); }
.scenario-chip:hover { border-color: var(--green); color: var(--text); }
.twin-run-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
#twinScenario { flex: 1; min-width: 220px; resize: vertical; }
.twin-weeks { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: var(--radius-sm);
  border: 1px solid var(--outline); background: var(--panel-solid); color: var(--text-dim); white-space: nowrap; }
.twin-weeks input { width: 2.4em; padding: 0; background: transparent; border: none; outline: none; color: var(--text);
  font: inherit; font-size: 1rem; font-weight: 700; text-align: center; -moz-appearance: textfield; appearance: textfield; }
.twin-weeks input::-webkit-outer-spin-button, .twin-weeks input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }   /* hide native spinner — custom steppers below */
.twin-weeks .wk-unit { font-size: 0.78125rem; color: var(--text-dim); }
.wk-step { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--outline);
  background: var(--elev-2); color: var(--text); font-size: 1.1rem; line-height: 1; cursor: pointer; flex: 0 0 auto; transition: .15s var(--ease); }
.wk-step:hover { border-color: var(--green); color: var(--green); }
.twin-loading { color: var(--text-dim); padding: 4px 0; }

.verify-panel { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 20px;
  padding: 14px 16px; border-radius: var(--radius-sm); border: 1px solid var(--outline);
  background: rgb(var(--accent-rgb) / 0.06); }
.verify-panel.revised { border-color: rgba(251,191,108,0.4); background: rgba(251,191,108,0.07); }
.verify-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.verify-badge { font-size: 0.75rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.verify-badge.verified { color: var(--green-2); background: rgb(var(--accent-rgb) / 0.16); }
.verify-badge.revised { color: #fbbf6c; background: rgba(251,191,108,0.16); }
.twin-list { margin: 4px 0 0; padding-left: 18px; color: var(--text-dim); font-size: 0.8125rem; line-height: 1.55; }
.twin-list li { margin: 2px 0; }

.proj-vals { display: flex; align-items: center; gap: 8px; margin: 8px 0 4px; font-family: var(--font); }
.proj-cur { color: var(--text-faint); font-size: 0.875rem; }
.proj-new { color: var(--text); font-weight: 600; font-size: 1rem; }
.proj-vals .arrow { color: var(--text-faint); }
.proj-trend { font-size: 0.78125rem; font-weight: 600; color: var(--green-2); margin-bottom: 8px; }
.conf { display: inline-block; font-size: 0.6875rem; padding: 2px 9px; border-radius: 999px; text-transform: capitalize; }
.conf.high { color: var(--green-2); background: rgb(var(--accent-rgb) / 0.16); }
.conf.moderate { color: #fbbf6c; background: rgba(251,191,108,0.14); }
.conf.low { color: var(--text-faint); background: var(--elev-2); }

.disclaimer-banner { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-sm); background: rgb(var(--accent-rgb) / 0.04); border: 1px solid var(--outline); color: var(--text-dim); font-size: 0.78125rem; line-height: 1.55; margin-top: 22px; }
.disclaimer-banner .ic { color: var(--green); flex: 0 0 auto; margin-top: 1px; }

/* scrim for mobile */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.5); opacity: 0; pointer-events: none; transition: .2s; z-index: 25; }
.mobile-only { display: none; }

/* ============================================================ RESPONSIVE */
@media (max-width: 860px) {
  .suggestions { grid-template-columns: 1fr; }
  .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; }
}

/* ---- phones: the sidebar becomes an off-canvas drawer over full-width content ---- */
@media (max-width: 768px) {
  .app { padding: 0; gap: 0; }
  .main { border-radius: 0; border-width: 0; }
  .topbar { padding: 12px 14px; }

  .sidebar {                                   /* fixed drawer, slides in from the left */
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 84vw; max-width: 320px; min-width: 0;
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    transform: translateX(-100%);
    transition: transform .26s var(--ease);
    opacity: 1; overflow-y: auto;
  }
  .app:not(.closed) .sidebar { transform: translateX(0); }
  /* override the desktop "collapse to 0 width" — on phones we slide off-screen instead */
  .app.closed .sidebar {
    width: 84vw; max-width: 320px;
    padding: 14px 12px; border-width: 1px;
    opacity: 1; pointer-events: auto; overflow-y: auto;
    transform: translateX(-100%);
  }
  #openSidebar { display: grid; }              /* hamburger always available in the top bar */
  .app:not(.closed) .scrim { opacity: 1; pointer-events: auto; }   /* backdrop when the drawer is open */

  .page { padding: 18px 16px 0; }
  .chat-wrap, .chat-home { padding-left: 16px; padding-right: 16px; }
  .icon-btn { width: 40px; height: 40px; }

  /* compact, scannable intro on phones — short tiles, no long descriptions, so the home doesn't scroll forever */
  .intro-head { padding: 12px 0 0; }
  .hero-sub { font-size: 0.875rem; margin-top: 10px; }
  .intro { margin: 12px auto 16px; }
  .intro-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .intro-card { flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px; }
  .intro-card small { display: none; }
  .intro-ic svg { width: 20px; height: 20px; }
  .intro-txt b { font-size: 0.8125rem; gap: 6px; }
  .intro-pro { font-size: 0.5625rem; padding: 1px 5px; }
  .intro-note { font-size: 0.75rem; padding: 10px 12px; margin-top: 10px; }
  .intro-legal { font-size: 0.6875rem; padding: 11px 12px; margin-top: 12px; gap: 8px; }
  .intro-legal svg { width: 16px; height: 16px; }
}

@media (max-width: 480px) {
  .badge-privacy { display: none; }            /* declutter the top bar on small phones */
  .topbar { gap: 8px; }
}

/* ============================================================ MOTION POLISH */
@keyframes msgIn  { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px);  } to { opacity: 1; transform: none; } }
@keyframes popIn  { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

.msg { animation: msgIn .4s var(--ease) both; }
.chat-wrap, .page { animation: viewIn .32s var(--ease) both; }
.hero-tag { animation: viewIn .55s var(--ease) both; }
.hero-sub { animation: viewIn .55s var(--ease) .08s both; }

.suggestion { animation: popIn .45s var(--ease) both; }
.suggestion:nth-child(1){ animation-delay: .05s }
.suggestion:nth-child(2){ animation-delay: .11s }
.suggestion:nth-child(3){ animation-delay: .17s }
.suggestion:nth-child(4){ animation-delay: .23s }

/* respect users who prefer less motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; transition-duration: .001s !important; }
  .caret, .typing span { animation-duration: 1s !important; }
}

/* ============================================================ RESEARCH MODE */
.composer-tools { position: absolute; top: 26px; left: 16px; z-index: 3; display: flex; gap: 8px; margin: 0; transform: translateY(-72%); }
.tool-chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 999px; background: var(--elev); border: 1px solid var(--outline); color: var(--text-dim); font-size: 0.8125rem; font-weight: 600; cursor: pointer; transition: .16s var(--ease); }
.tool-chip:hover { color: var(--text); border-color: var(--outline-strong); }
.tool-chip .ic { width: 16px; height: 16px; }
.tool-chip.active { background: linear-gradient(180deg, rgb(var(--accent-rgb) / 0.16), rgb(var(--accent-rgb) / 0.06)); border-color: var(--green); color: var(--green-3); box-shadow: 0 0 0 3px rgb(var(--accent-rgb) / 0.08); }
.tool-chip.active .ic { color: var(--green); }
.composer.research { border-color: var(--outline-strong); }
.composer.research:focus-within { border-color: var(--green); box-shadow: 0 0 0 4px rgb(var(--accent-rgb) / 0.10); }

.typing-label { font-size: 0.8125rem; font-weight: 500; margin-right: 4px; background: linear-gradient(90deg, var(--text-faint), var(--green-3), var(--text-faint)); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 1.6s linear infinite; }
@keyframes shimmer { from { background-position: 200% 0 } to { background-position: -200% 0 } }

.m-body a { color: var(--green-2); text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--outline-strong); transition: color .15s var(--ease); }
.m-body a:hover { color: var(--green-3); text-decoration-color: var(--green); }

.model-pill.research { border-color: var(--green); }
.model-pill.research .dot { background: var(--green-3); box-shadow: 0 0 10px var(--green-glow); }

/* ============================================================ MESSAGE ACTIONS */
.m-col { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.msg-actions { display: flex; gap: 4px; margin-top: 4px; opacity: 0; transform: translateY(-2px); transition: .15s var(--ease); }
.msg:hover .msg-actions { opacity: 1; transform: none; }
.msg-action { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: transparent; border: 1px solid transparent; color: var(--text-faint); cursor: pointer; transition: .15s var(--ease); }
.msg-action:hover { background: var(--elev-2); color: var(--text); border-color: var(--outline); }
.msg-action .ic { width: 15px; height: 15px; }
.msg-action.ok { color: var(--green); border-color: var(--outline); }
.msg-action.speaking { color: var(--green); border-color: var(--green); background: rgb(var(--accent-rgb) / 0.10); }

/* inline message editing */
.edit-box { display: flex; flex-direction: column; gap: 8px; }
.edit-area { width: 100%; resize: none; background: var(--elev); border: 1px solid var(--outline); border-radius: 12px; color: var(--text); font: inherit; font-size: 0.9375rem; line-height: 1.5; padding: 10px 12px; outline: none; }
.edit-area:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgb(var(--accent-rgb) / 0.08); }
.edit-actions { display: flex; gap: 8px; justify-content: flex-end; }
.btn-sm { padding: 7px 14px; font-size: 0.78125rem; }

/* stop button (replaces send while generating) — green, with a filled square */
.icon-btn.send.stop { background: linear-gradient(135deg, var(--green), var(--green-deep)); }
.icon-btn.send.stop:hover { box-shadow: 0 0 14px var(--green-glow); }
.icon-btn.send.stop .ic { stroke: var(--on-accent); }
.icon-btn.send.stop .ic rect { fill: var(--on-accent); stroke: none; }

/* ============================================================ CHAT LIST */
.recent { display: flex; align-items: center; gap: 2px; padding: 0; border-radius: 10px; border: 1px solid transparent; transition: .15s var(--ease); overflow: hidden; }
.recent:hover { background: var(--elev-2); }
.recent.active { background: linear-gradient(90deg, rgb(var(--accent-rgb) / 0.10), transparent); border-color: var(--outline); }
.recent-main { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 11px; padding: 9px 11px; background: transparent; border: none; color: var(--text-dim); font-size: 0.8125rem; cursor: pointer; text-align: left; }
.recent:hover .recent-main, .recent.active .recent-main, .recent.pinned .recent-main { color: var(--text); }
.recent-main .ic { width: 15px; height: 15px; flex: 0 0 auto; opacity: .7; }
.recent-main .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-actions { display: flex; gap: 2px; padding-right: 6px; flex: 0 0 auto; opacity: 0; transition: .15s var(--ease); }
.recent:hover .recent-actions, .recent.pinned .recent-actions { opacity: 1; }
.r-act { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: transparent; border: none; color: var(--text-faint); cursor: pointer; transition: .15s var(--ease); }
.r-act:hover { background: var(--bg-2); color: var(--text); }
.r-act.active { color: var(--green); }
.r-act .ic { width: 14px; height: 14px; }
.app.collapsed .recent-actions { display: none; }
.rename-input { flex: 1 1 auto; min-width: 0; margin: 1px 4px; padding: 7px 10px; border-radius: 9px; border: 1px solid var(--green); background: var(--elev); color: var(--text); font: inherit; font-size: 0.8125rem; }
.rename-input:focus { outline: none; box-shadow: 0 0 0 3px rgb(var(--accent-rgb) / 0.12); }

/* "What Hale remembers" — memory list on the Privacy page */
.mem-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.mem-list { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.mem-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; border-radius: 10px; background: var(--elev); border: 1px solid var(--hairline); }
.mem-item span { font-size: 0.875rem; color: var(--text); line-height: 1.45; }
.mem-item .r-act { flex: 0 0 auto; opacity: .7; }
.mem-item .r-act:hover { opacity: 1; color: #f87171; background: var(--bg-2); }

/* My Data — trends & insights */
.data-sec-head { display: flex; align-items: center; justify-content: space-between; margin: 28px 0 12px; }
.mk-card { padding: 14px; }
.mk-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mk-name { font-size: 0.8125rem; color: var(--text-dim); }
.mk-top .r-act { opacity: .55; flex: 0 0 auto; }
.mk-top .r-act:hover { opacity: 1; color: #f87171; }
.mk-val { font-family: var(--font); font-weight: 700; font-size: 1.4rem; color: var(--text); margin: 3px 0 8px; }
.mk-spark { width: 100%; height: 36px; display: block; }
.mk-change { font-size: 0.75rem; color: var(--green-2); margin-top: 6px; }
.mk-trend-empty { font-size: 0.75rem; color: var(--text-faint); margin-top: 4px; }

/* Protocols generator */
.proto-gen { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
#protoGoal { flex: 1; min-width: 240px; font: inherit; font-size: 0.875rem; color: var(--text); background: var(--elev); border: 1px solid var(--hairline); border-radius: 10px; padding: 10px 12px; }
#protoGoal:focus { outline: none; border-color: var(--green); }
.proto-items { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 7px; }
.proto-items label { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; font-size: 0.875rem; color: var(--text); line-height: 1.45; }
.proto-items input { margin-top: 3px; flex: 0 0 auto; width: 15px; height: 15px; accent-color: var(--green); cursor: pointer; }
.proto-items input:checked + span { color: var(--text-faint); text-decoration: line-through; }
.proto-track { display: flex; align-items: flex-start; gap: 7px; margin-top: 10px; font-size: 0.8rem; color: var(--green-2); }
.proto-track .ic { width: 14px; height: 14px; flex: 0 0 auto; margin-top: 1px; }
.proto-progress { display: flex; align-items: center; gap: 12px; margin: 6px 0 14px; }
.proto-bar { flex: 1; height: 7px; border-radius: 999px; background: var(--elev-2); overflow: hidden; }
.proto-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--green-3), var(--green)); border-radius: 999px; transition: width .4s var(--ease); }
.proto-progress span { font-size: 0.78rem; color: var(--text-dim); flex: 0 0 auto; }
.proto-complete { border: 1px solid var(--outline); border-radius: var(--radius-sm); background: rgb(var(--accent-rgb) / 0.08); padding: 14px 16px; margin-bottom: 4px; }
.pc-head { font-weight: 600; color: var(--text); }

/* Legal documents */
.legal-body { text-align: left; max-height: 58vh; overflow-y: auto; color: var(--text-dim); font-size: 0.875rem; line-height: 1.6; margin: 6px 0 16px; }
.legal-body p { margin: 0 0 10px; }
.legal-body b { color: var(--text); }
.legal-note { font-size: 0.75rem; color: var(--text-faint); font-style: italic; }

/* "Verify your email" banner */
.verify-bar { display: flex; align-items: center; gap: 10px; margin: 10px 16px 0; padding: 9px 14px; border: 1px solid var(--outline); background: var(--elev-2); border-radius: 10px; font-size: 0.82rem; color: var(--text-dim); }
.verify-bar[hidden] { display: none; }
.vb-ic { display: inline-flex; color: var(--green-2); }
.vb-ic .ic { width: 16px; height: 16px; }
.vb-text { flex: 1; }
.vb-x { background: transparent; border: none; color: var(--text-faint); cursor: pointer; font-size: 0.8rem; padding: 2px 6px; line-height: 1; border-radius: 6px; }
.vb-x:hover { color: var(--text); background: var(--elev); }

/* Public landing page */
body[data-view="landing"] .sidebar,
body[data-view="landing"] .topbar,
body[data-view="landing"] .scrim,
body[data-view="landing"] #verifyBar,
body[data-view="landing"] #installBar { display: none !important; }
body[data-view="landing"] .main { margin: 0; width: 100%; }
body[data-view="landing"] .view { padding: 0; max-width: none; overflow-y: auto; }
.lp { max-width: 1000px; margin: 0 auto; padding: 0 20px 60px; }
.lp-top { display: flex; align-items: center; justify-content: space-between; padding: 18px 2px; }
.lp-brand { display: flex; align-items: center; gap: 8px; font-family: var(--font); font-weight: 700; font-size: 1.25rem; color: var(--text); }
.lp-brand svg { width: 26px; height: 26px; color: var(--green); }
.lp-top-cta { display: flex; gap: 8px; }
.lp-hero { text-align: center; padding: 44px 0 36px; }
.lp-eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; color: var(--green-2); border: 1px solid var(--outline); border-radius: 999px; padding: 5px 12px; margin-bottom: 18px; }
.lp-eyebrow svg { width: 14px; height: 14px; }
.lp-hero h1 { font-family: var(--font); font-size: clamp(2.2rem, 6vw, 3.6rem); font-weight: 800; line-height: 1.05; margin: 0 0 16px; background: linear-gradient(90deg, var(--green-3), var(--green)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lp-sub { max-width: 620px; margin: 0 auto 24px; color: var(--text-dim); font-size: 1.05rem; line-height: 1.6; }
.lp-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.lp-btn { padding: 12px 24px; font-size: 0.95rem; }
.lp-fine { margin-top: 14px; font-size: 0.8rem; color: var(--text-faint); }
.lp-feats { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 24px 0 48px; }
.lp-feat { background: var(--elev); border: 1px solid var(--outline); border-radius: 16px; padding: 22px; }
.lp-feat-ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--elev-2); color: var(--green-2); margin-bottom: 12px; }
.lp-feat-ic svg { width: 20px; height: 20px; }
.lp-feat h3 { font-family: var(--font); font-size: 1.05rem; font-weight: 650; margin: 0 0 6px; color: var(--text); }
.lp-feat p { margin: 0; color: var(--text-dim); font-size: 0.875rem; line-height: 1.55; }
.lp-pricing { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; max-width: 640px; margin: 0 auto 48px; }
.lp-plan { background: var(--elev); border: 1px solid var(--outline); border-radius: 18px; padding: 26px; }
.lp-plan.featured { border-color: var(--green); }
.lp-plan-name { font-weight: 650; color: var(--text); margin-bottom: 6px; }
.lp-plan-price { font-family: var(--font); font-size: 2.4rem; font-weight: 800; color: var(--text); margin-bottom: 16px; }
.lp-plan-price span { font-size: 1rem; font-weight: 400; color: var(--text-dim); }
.lp-plan ul { list-style: none; padding: 0; margin: 0 0 18px; }
.lp-plan li { display: flex; align-items: flex-start; gap: 8px; color: var(--text-dim); font-size: 0.9rem; padding: 6px 0; }
.lp-plan li svg { width: 16px; height: 16px; color: var(--green); flex: 0 0 16px; margin-top: 2px; }
.lp-plan li b { color: var(--text); }
.lp-plan .lp-btn { width: 100%; }
.lp-foot { text-align: center; color: var(--text-faint); font-size: 0.8rem; border-top: 1px solid var(--outline); padding-top: 24px; }
.lp-foot p { margin: 6px 0; display: inline-flex; align-items: center; gap: 6px; justify-content: center; flex-wrap: wrap; }
.lp-foot svg { width: 14px; height: 14px; flex: 0 0 14px; }
.lp-foot-links a { color: var(--green-2); }
.lp-copy { color: var(--text-faint); display: block; }

/* My Data — reference-range flags + per-marker goals */
.mk-range { margin-left: 7px; vertical-align: middle; }
.mk-goal { margin-top: 8px; font-size: 0.8rem; color: var(--green-2); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mk-goal-edit { background: none; border: none; font-size: 0.78rem; cursor: pointer; padding: 0; text-decoration: underline; color: var(--text-faint); }
.mk-goal-edit:hover { color: var(--text); }
.mk-goal-set { margin-top: 10px; background: none; font-size: 0.78rem; cursor: pointer; color: var(--green-2); border: 1px dashed var(--outline); border-radius: 999px; padding: 5px 12px; }
.mk-goal-set:hover { border-color: var(--green); color: var(--text); }
.mk-ranges-note { margin-top: 12px; font-size: 0.75rem; color: var(--text-faint); }

/* Digital Twin — reach-a-goal (reverse mode) */
.reach-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.reach-select, .reach-target { background: var(--bg-2); border: 1px solid var(--outline); border-radius: 10px; color: var(--text); font: inherit; font-size: 0.9rem; padding: 10px 12px; outline: none; }
.reach-select:focus, .reach-target:focus { border-color: var(--green); }
.reach-target { width: 96px; }
.reach-to { color: var(--text-dim); font-size: 0.9rem; }
.reach-steps { margin: 8px 0 0; padding-left: 20px; color: var(--text-dim); font-size: 0.9rem; line-height: 1.6; }
.reach-steps li { margin: 4px 0; }

/* Follow-up suggestion chips under a reply */
.followups { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 16px; padding-left: 50px; }
.followup-chip { background: var(--elev); border: 1px solid var(--outline); border-radius: 999px; padding: 7px 14px; font-size: 0.82rem; color: var(--text-dim); cursor: pointer; transition: .15s var(--ease); text-align: left; line-height: 1.3; }
.followup-chip:hover { border-color: var(--green); color: var(--text); }
@media (max-width: 640px) { .followups { padding-left: 0; } }

/* First-run onboarding (getting-started steps) */
.intro-welcome { margin-bottom: 18px; }
.intro-h { font-family: var(--font); font-size: 1.3rem; font-weight: 700; margin: 0 0 4px; color: var(--text); }
.intro-p { color: var(--text-dim); font-size: 0.9rem; margin: 0 0 14px; }
.intro-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.intro-step { display: flex; align-items: center; gap: 11px; text-align: left; background: var(--elev); border: 1px solid var(--outline); border-radius: 12px; padding: 13px 14px; cursor: pointer; transition: .15s var(--ease); }
.intro-step:hover { border-color: var(--green); background: var(--elev-2); }
.intro-step .is-n { flex: 0 0 26px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: rgb(var(--accent-rgb) / 0.14); color: var(--green-2); font-weight: 700; font-size: 0.85rem; }
.intro-step .is-t { display: flex; flex-direction: column; min-width: 0; }
.intro-step .is-t b { color: var(--text); font-size: 0.9rem; font-weight: 600; }
.intro-step .is-t small { color: var(--text-dim); font-size: 0.78rem; }

/* Accessibility polish */
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ============================================================
   Bubbly display type — headings & key numbers get the rounded
   Baloo 2 face so the whole app echoes the H mark.
   ============================================================ */
.brand-name, .page-title, .hero-tag, .modal-title, .locked-title, .pd-name, .pd-h,
.card-title, .intro-h, .help-row h4, .metric .m-val, .mk-val, .proj-vals, .p-price, .pd-price,
.lp-brand, .lp-hero h1, .lp-plan-name, .lp-plan-price, .lp-sec h2, .lp-how h2,
.new-chat .label, .nav-item .label, .tool-chip, .scenario-chip, .acc-name, .lp-step b {
  font-family: var(--font-display); letter-spacing: 0;
}
.page-title { letter-spacing: 0; }

/* In-app hero heartbeat — a living EKG under the greeting */
.hero-ekg { width: min(300px, 72%); height: 40px; margin: 6px auto 0; display: block; overflow: visible; animation: viewIn .55s var(--ease) .12s both; }
.hero-ekg path, .lp-ekg path { fill: none; stroke: var(--green); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 620; stroke-dashoffset: 620; animation: ekgDraw 3.8s linear infinite; filter: drop-shadow(0 0 7px rgb(var(--accent-rgb) / 0.55)); }
@keyframes ekgDraw { 0% { stroke-dashoffset: 620; opacity: 1; } 60% { stroke-dashoffset: 0; opacity: 1; } 82% { opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 0; } }
.lp-ekg { width: min(520px, 86%); height: 54px; margin: 18px auto 6px; display: block; overflow: visible; }

/* ============================================================
   Landing — immersive animated feature tour
   ============================================================ */
.lp-how { text-align: center; margin: 44px 0 8px; }
.lp-how h2, .lp-sec h2 { font-size: clamp(1.55rem, 3.6vw, 2.15rem); font-weight: 700; color: var(--text); margin: 0 0 10px; line-height: 1.15; }
.lp-how-sub { color: var(--text-dim); font-size: 0.95rem; max-width: 560px; margin: 0 auto 20px; line-height: 1.6; }
.lp-how-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; text-align: left; }
.lp-step { background: var(--elev); border: 1px solid var(--outline); border-radius: 20px; padding: 22px; }
.lp-step-n { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; color: #06130a; background: linear-gradient(135deg, var(--green-3), var(--green)); margin-bottom: 12px; animation: heartbeat 2.4s var(--ease) infinite; }
.lp-step:nth-child(2) .lp-step-n { animation-delay: .4s; }
.lp-step:nth-child(3) .lp-step-n { animation-delay: .8s; }
.lp-step b { display: block; color: var(--text); font-size: 1.05rem; margin-bottom: 4px; }
.lp-step p { margin: 0; color: var(--text-dim); font-size: 0.875rem; line-height: 1.55; }

.lp-sec { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; align-items: center; margin: 64px 0; opacity: 0; transform: translateY(28px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.lp-sec.seen { opacity: 1; transform: none; }
.lp-sec.rev .lp-viz { order: 2; }
@media (max-width: 760px) { .lp-sec { grid-template-columns: 1fr; gap: 18px; margin: 44px 0; } .lp-sec.rev .lp-viz { order: 0; } }
.lp-viz { background: linear-gradient(180deg, var(--elev), var(--bg-2)); border: 1px solid var(--outline); border-radius: 24px; padding: 20px; }
.lp-viz svg { width: 100%; height: auto; display: block; }
.lp-copy h2 { margin-top: 10px; }
.lp-copy > p { color: var(--text-dim); font-size: 0.95rem; line-height: 1.65; margin: 0; }
.lp-note { font-size: 0.82rem; color: var(--text-faint); border-left: 2px solid var(--green); padding-left: 12px; line-height: 1.6; margin: 14px 0 0; }
.lp-note b { color: var(--green-2); font-weight: 600; }

/* Shared viz vocabulary */
.vz-axis { stroke: rgba(255,255,255,0.14); stroke-width: 1.5; fill: none; }
.vz-band { fill: rgb(var(--accent-rgb) / 0.08); }
.vz-tag { fill: var(--text-faint); font: 600 11px var(--font); }
.vz-txt { fill: var(--text); font: 600 11px var(--font); }
.vz-txt.dim { fill: var(--text-dim); font-weight: 400; }
.vz-bub-u { fill: rgb(var(--accent-rgb) / 0.16); }
.vz-bub-b { fill: rgba(255,255,255,0.06); }

/* 1 · My Data — a marker drawing its trend, dots = readings */
.vz-trend { fill: none; stroke: var(--green); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 340; stroke-dashoffset: 340; animation: vzDraw 6s var(--ease) infinite; }
@keyframes vzDraw { 0%, 6% { stroke-dashoffset: 340; opacity: 1; } 55%, 88% { stroke-dashoffset: 0; opacity: 1; } 98%, 100% { stroke-dashoffset: 0; opacity: 0; } }
.vz-dot { fill: var(--green-3); transform-box: fill-box; transform-origin: center; animation: vzPop 6s var(--ease) infinite; }
@keyframes vzPop { 0%, 10% { transform: scale(0); } 16% { transform: scale(1.35); } 20%, 90% { transform: scale(1); } 98%, 100% { transform: scale(0); } }
.vz-dot.d2 { animation-delay: .9s; } .vz-dot.d3 { animation-delay: 1.9s; }

/* 2 · Chat — ask, typing, answer */
.vz-uMsg { animation: vzU 7s var(--ease) infinite; }
@keyframes vzU { 0%, 4% { opacity: 0; transform: translateY(7px); } 10%, 90% { opacity: 1; transform: none; } 97%, 100% { opacity: 0; } }
.vz-typing { animation: vzT 7s infinite; }
@keyframes vzT { 0%, 13% { opacity: 0; } 17%, 40% { opacity: 1; } 45%, 100% { opacity: 0; } }
.vz-tdot { fill: var(--text-dim); animation: vzTdot 1s infinite; }
.vz-tdot.t2 { animation-delay: .16s; } .vz-tdot.t3 { animation-delay: .32s; }
@keyframes vzTdot { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
.vz-bMsg { animation: vzB 7s var(--ease) infinite; }
@keyframes vzB { 0%, 44% { opacity: 0; transform: translateY(7px); } 51%, 90% { opacity: 1; transform: none; } 97%, 100% { opacity: 0; } }

/* 3 · Twin — two futures leave "today" */
.vz-cur { fill: none; stroke: rgba(255,255,255,0.22); stroke-width: 2.5; stroke-dasharray: 200; stroke-dashoffset: 200; animation: vzCur 7s var(--ease) infinite; }
@keyframes vzCur { 0%, 8% { stroke-dashoffset: 200; } 40%, 92% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 0; opacity: 0; } }
.vz-what { fill: none; stroke: var(--green); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 235; animation: vzWhat 7s var(--ease) infinite; }
@keyframes vzWhat { 0%, 18% { stroke-dashoffset: 235; opacity: 1; } 60%, 92% { stroke-dashoffset: 0; opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 0; } }
.vz-today { fill: var(--green-3); }
.vz-ring { fill: var(--green); transform-box: fill-box; transform-origin: center; animation: vzPop 7s var(--ease) infinite; animation-delay: 3.6s; }
.vz-ringWave { fill: none; stroke: var(--green); stroke-width: 2; transform-box: fill-box; transform-origin: center; animation: vzWave 7s var(--ease) infinite; animation-delay: 3.6s; }
@keyframes vzWave { 0%, 8% { transform: scale(1); opacity: .8; } 40% { transform: scale(2.6); opacity: 0; } 100% { transform: scale(2.6); opacity: 0; } }

/* 4 · Protocols — actions check off, then the plan re-tunes */
.vz-row rect.bg { fill: rgba(255,255,255,0.05); }
.vz-chkbox { fill: none; stroke: var(--outline-strong, rgba(255,255,255,0.25)); stroke-width: 1.6; }
.vz-chk { fill: none; stroke: var(--green); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 26; stroke-dashoffset: 26; animation: vzChk 7.5s var(--ease) infinite; }
@keyframes vzChk { 0%, 12% { stroke-dashoffset: 26; } 20%, 92% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 0; opacity: 0; } }
.vz-chk.c2 { animation-delay: .9s; } .vz-chk.c3 { animation-delay: 1.8s; }
.vz-retune { transform-box: fill-box; transform-origin: center; animation: vzSpin 7.5s var(--ease) infinite; }
@keyframes vzSpin { 0%, 48% { transform: rotate(0deg); opacity: .35; } 60% { opacity: 1; } 80%, 92% { transform: rotate(360deg); opacity: 1; } 100% { transform: rotate(360deg); opacity: .35; } }
.vz-retune path { fill: none; stroke: var(--green-2); stroke-width: 2.6; stroke-linecap: round; }

/* 5 · Modes — research sweeps sources; training loads the week */
.vz-doc { fill: rgba(255,255,255,0.08); }
.vz-scan { fill: rgb(var(--accent-rgb) / 0.22); animation: vzScan 4.5s var(--ease) infinite; }
@keyframes vzScan { 0% { transform: translateY(0); } 50% { transform: translateY(58px); } 100% { transform: translateY(0); } }
.vz-bar { fill: var(--green); opacity: .9; transform-box: fill-box; transform-origin: bottom; animation: vzBar 5s var(--ease) infinite; }
@keyframes vzBar { 0%, 8% { transform: scaleY(0.08); } 45%, 88% { transform: scaleY(1); } 100% { transform: scaleY(0.08); } }
.vz-bar.b2 { animation-delay: .35s; } .vz-bar.b3 { animation-delay: .7s; }

/* 6 · Marketplace — recommendations slide in */
.vz-card { animation: vzCard 6.5s var(--ease) infinite; }
@keyframes vzCard { 0%, 8% { opacity: 0; transform: translateY(16px); } 18%, 88% { opacity: 1; transform: none; } 97%, 100% { opacity: 0; } }
.vz-card.k2 { animation-delay: .5s; } .vz-card.k3 { animation-delay: 1s; }
.vz-card rect.face { fill: rgba(255,255,255,0.06); stroke: rgba(255,255,255,0.1); }

/* 7 · Privacy — the shield seals shut */
.vz-shield { fill: none; stroke: var(--green); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 470; stroke-dashoffset: 470; animation: vzShield 7s var(--ease) infinite; }
@keyframes vzShield { 0%, 6% { stroke-dashoffset: 470; } 42%, 90% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 0; opacity: 0; } }
.vz-lockchk { fill: none; stroke: var(--green-3); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 80; stroke-dashoffset: 80; animation: vzChk 7s var(--ease) infinite; animation-delay: 2.4s; }

/* ============================================================
   Bottom tab bar — app-style primary navigation
   ============================================================ */
.tabbar { display: flex; gap: 4px; flex: 0 0 auto; padding: 7px 10px calc(7px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--hairline); background: var(--bg-2); }
.tab-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 2px 6px;
  border-radius: 16px; background: none; border: none; color: var(--text-dim); cursor: pointer;
  font-family: var(--font-display); font-size: 0.72rem; font-weight: 600; line-height: 1; transition: .15s var(--ease); }
.tab-item .ic { width: 21px; height: 21px; }
.tab-item:hover { color: var(--text); }
.tab-item.active { color: var(--green-2); background: rgb(var(--accent-rgb) / 0.12); }
.tab-item.locked { opacity: .55; }
body[data-view="landing"] .tabbar { display: none !important; }
/* Responsive split: desktop navigates with the sidebar; phones/tablets with the bottom tabs. */
@media (min-width: 901px) { .tabbar { display: none; } }
@media (max-width: 900px) { .sidebar .nav { display: none; } }

/* Quick "new chat" in the topbar — only where it makes sense (the Chat tab) */
#topNewChat { display: none; }
body[data-view="chat"] #topNewChat { display: inline-flex; }

/* Home tab — the dashboard */
.home-page { max-width: 1000px; margin: 0 auto; }
.home-page .intro-head { text-align: center; padding: 12px 0 4px; }
.home-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-top: 10px; }
.daily-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; margin: 0 -10px; border-radius: 12px; cursor: pointer; color: var(--text); font-size: 0.9rem; transition: background .15s var(--ease); }
.daily-item:hover { background: var(--elev); }
.daily-item input { display: none; }
.daily-item .dbox { width: 22px; height: 22px; flex: 0 0 22px; border-radius: 8px; border: 1.5px solid var(--outline-strong, rgba(255,255,255,0.25)); display: grid; place-items: center; color: transparent; transition: .15s var(--ease); }
.daily-item .dbox .ic { width: 14px; height: 14px; }
.daily-item.done .dbox { background: var(--green); border-color: var(--green); color: #06130a; }
.daily-item.done .dlab { color: var(--text-faint); text-decoration: line-through; }
.stat-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--hairline); }
.stat-row:first-child { border-top: none; }
.stat-name { flex: 1; color: var(--text-dim); font-size: 0.875rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-val { font-family: var(--font-display); font-weight: 700; color: var(--text); }
.stat-val small { color: var(--text-faint); font-weight: 400; }

/* Composer focus row — organized panel above the chat box (not fused to it) */
.composer-tools { position: static; transform: none; z-index: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 10px; padding: 10px 12px; border: 1px solid var(--hairline); border-radius: 18px; background: var(--bg-2); }
.mode-label { color: var(--text-faint); font-size: 0.72rem; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; margin-right: 4px; }

/* Digital Twin — collapsed data drawer (auto-filled, zero stress) */
.twin-data { margin: 14px 0 0; }
.twin-data summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; padding: 12px 16px; border: 1px solid var(--outline); border-radius: 14px; background: var(--elev); color: var(--text-dim); font-size: 0.875rem; transition: border-color .15s var(--ease); }
.twin-data summary:hover { border-color: var(--outline-strong, rgba(255,255,255,0.25)); }
.twin-data summary::-webkit-details-marker { display: none; }
.twin-data summary .ic { width: 16px; height: 16px; color: var(--green-2); flex: 0 0 16px; }
.twin-data summary b { color: var(--text); }
.twin-data-sub { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.twin-edit { color: var(--green-2); text-decoration: underline; font-size: 0.8rem; flex: 0 0 auto; }
.twin-data[open] summary { border-color: var(--green); }
.twin-data > .card { margin-top: 10px; }

/* Help & Guide modal */
.help-modal { max-width: 460px; }
.help-body { text-align: left; max-height: 64vh; overflow-y: auto; margin: 8px 0 16px; }
.help-intro { color: var(--text-dim); font-size: 0.875rem; line-height: 1.55; margin: 0 0 8px; }
.help-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--outline); }
.help-ic { flex: 0 0 30px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: var(--elev-2); color: var(--green-2); }
.help-ic .ic { width: 17px; height: 17px; }
.help-row h4 { margin: 1px 0 3px; font-size: 0.9rem; font-weight: 650; color: var(--text); }
.help-row p { margin: 0; font-size: 0.82rem; line-height: 1.5; color: var(--text-dim); }
.pro-tag { font-size: 0.62rem; font-weight: 700; letter-spacing: .04em; color: var(--green-2); border: 1px solid var(--green-2); border-radius: 6px; padding: 1px 5px; margin-left: 7px; vertical-align: middle; }
.help-foot { display: flex; gap: 9px; align-items: flex-start; margin-top: 14px; padding: 11px 12px; border-radius: 10px; background: var(--elev-2); color: var(--text-dim); font-size: 0.78rem; line-height: 1.5; }
.help-foot .ic { flex: 0 0 16px; width: 16px; height: 16px; color: var(--green-2); margin-top: 1px; }
.help-foot b { color: var(--text); }
.legal-link { color: var(--green-2); font-size: 0.875rem; cursor: pointer; }
.legal-link:hover { text-decoration: underline; }
.consent-list { display: flex; flex-direction: column; gap: 10px; margin: 8px 0 6px; text-align: left; }
.consent-item { border: 1px solid var(--hairline); border-radius: 12px; overflow: hidden; }
.consent-item .set-action { margin: 0; border-radius: 0; }
.consent-item .agree-row { padding: 2px 12px 10px; margin: 0; }
.consent-item .cChk:disabled { opacity: .5; }
.read-tag { font-size: 0.7rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--elev-2); color: var(--text-faint); flex: 0 0 auto; }
.consent-item.read .read-tag { background: rgb(var(--accent-rgb) / 0.16); color: var(--green-2); }
.legal-scrollhint { font-size: 0.75rem; color: var(--text-faint); text-align: center; margin: 8px 0 0; }

/* ============================================================ MARKETPLACE */
.mkt-search { display: flex; align-items: center; gap: 10px; background: var(--elev); border: 1px solid var(--outline); border-radius: 999px; padding: 11px 16px; margin-bottom: 14px; }
.mkt-search:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgb(var(--accent-rgb) / 0.08); }
.mkt-search input { flex: 1 1 auto; background: transparent; border: none; outline: none; color: var(--text); font: inherit; font-size: 0.90625rem; }
.mkt-search input::placeholder { color: var(--text-faint); }
.mkt-search .ic { color: var(--text-dim); flex: 0 0 auto; }

.mkt-row { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 20px; }
.mkt-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.mkt-sort { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.mkt-sort .lbl { font-size: 0.75rem; color: var(--text-faint); margin-right: 2px; }
.mkt-chip { padding: 8px 14px; border-radius: 999px; background: var(--elev); border: 1px solid var(--outline); color: var(--text-dim); font-size: 0.8125rem; font-weight: 600; cursor: pointer; transition: .15s var(--ease); }
.mkt-chip:hover { color: var(--text); border-color: var(--outline-strong); }
.mkt-chip.active { background: linear-gradient(180deg, rgb(var(--accent-rgb) / 0.16), rgb(var(--accent-rgb) / 0.06)); border-color: var(--green); color: var(--green-3); }

.product { width: 100%; text-align: left; font: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 5px; }
.product:hover { transform: translateY(-2px); border-color: var(--outline-strong); box-shadow: 0 0 0 3px rgb(var(--accent-rgb) / 0.05); }
.p-tile { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: rgb(var(--accent-rgb) / 0.10); color: var(--green); margin-bottom: 6px; }
.p-tile .ic { width: 24px; height: 24px; }
.p-tile.lg { width: 64px; height: 64px; border-radius: 16px; flex: 0 0 auto; }
.p-tile.lg .ic { width: 32px; height: 32px; }
.p-name { font-weight: 600; font-size: 0.9375rem; color: var(--text); line-height: 1.3; }
.p-brand { font-size: 0.78125rem; color: var(--text-faint); }
.p-meta { display: flex; align-items: center; gap: 8px; font-size: 0.78125rem; margin-top: 2px; }
.stars { color: #fbbf6c; font-weight: 600; }
.dim { color: var(--text-dim); }
.p-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.p-price { font-family: var(--font); font-weight: 700; font-size: 1.0625rem; color: var(--text); }
.p-badge { font-size: 0.6875rem; color: var(--green-2); background: rgb(var(--accent-rgb) / 0.08); border: 1px solid var(--outline); padding: 3px 9px; border-radius: 999px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 58%; }

/* product detail */
.back-btn { margin-bottom: 16px; }
.product-detail { padding: 26px; }
.pd-head { display: flex; gap: 18px; align-items: flex-start; }
.pd-headinfo { min-width: 0; }
.pd-name { font-family: var(--font); font-size: 1.625rem; font-weight: 700; margin: 8px 0 2px; letter-spacing: -.3px; }
.pd-brand { color: var(--text-dim); font-size: 0.875rem; }
.pd-meta { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 12px; font-size: 0.84375rem; }
.pd-price { font-family: var(--font); font-weight: 700; font-size: 1.25rem; color: var(--text); }
.pd-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.pd-desc { color: var(--text-dim); line-height: 1.65; margin: 20px 0; font-size: 0.9375rem; }
.pd-h { font-family: var(--font); font-size: 1.0625rem; margin: 6px 0 2px; }
.buy-row { display: flex; gap: 10px; flex-wrap: wrap; }
.buy { text-decoration: none; }
.buy .ic { width: 16px; height: 16px; }
@media (max-width: 860px) { .pd-head { flex-direction: column; } }

/* ============================================================ AUTH / SUBSCRIPTION */
.nav-item.locked { color: var(--text-faint); }
.nav-item .nav-lock { margin-left: auto; display: inline-grid; place-items: center; }
.nav-item .nav-lock .ic { width: 14px; height: 14px; opacity: .65; }
.app.closed .nav-lock { display: none; }
.tool-chip.locked { opacity: .5; }
.icon-btn.locked { opacity: .4; }

.locked-card { max-width: 460px; margin: 7vh auto 0; text-align: center; padding: 36px 28px; display: flex; flex-direction: column; align-items: center; }
.locked-ic { width: 62px; height: 62px; border-radius: 18px; display: grid; place-items: center; background: rgb(var(--accent-rgb) / 0.10); color: var(--green); margin-bottom: 14px; }
.locked-ic .ic { width: 30px; height: 30px; }
.locked-title { font-family: var(--font); font-size: 1.625rem; font-weight: 700; margin: 0 0 6px; }
.locked-sub { color: var(--text-dim); font-size: 0.9375rem; line-height: 1.6; max-width: 360px; margin: 0 0 18px; }

.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.55); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 100; padding: 20px; animation: viewIn .18s var(--ease) both; }
.modal { position: relative; width: 100%; max-width: 400px; background: linear-gradient(180deg, var(--elev), var(--bg-2)); border: 1px solid var(--outline); border-radius: var(--radius-lg); padding: 30px 26px 24px; box-shadow: var(--shadow); text-align: center; animation: popIn .24s var(--ease) both; }
.modal-x { position: absolute; top: 14px; right: 14px; width: 30px; height: 30px; border-radius: 9px; background: transparent; border: none; color: var(--text-dim); font-size: 0.875rem; cursor: pointer; transition: .15s var(--ease); }
.modal-x:hover { background: var(--elev-2); color: var(--text); }
.modal-mark { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; margin: 0 auto 14px; background: rgb(var(--accent-rgb) / 0.10); color: var(--green); }
.modal-mark svg { width: 28px; height: 28px; fill: none; stroke: var(--green); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.modal-mark.pro { background: linear-gradient(135deg, rgb(var(--accent-rgb) / 0.22), rgba(22,163,74,0.12)); }
.modal-title { font-family: var(--font); font-size: 1.375rem; font-weight: 700; margin: 0 0 6px; }
.modal-sub { color: var(--text-dim); font-size: 0.875rem; line-height: 1.55; margin: 0 0 18px; }
.modal-input { width: 100%; background: var(--bg-2); border: 1px solid var(--outline); border-radius: 12px; color: var(--text); font: inherit; font-size: 0.9375rem; padding: 12px 14px; margin-bottom: 10px; outline: none; }
.modal-input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgb(var(--accent-rgb) / 0.08); }
.modal-btn { width: 100%; justify-content: center; margin-top: 6px; }
.modal-btn.danger { border-color: rgba(248,113,113,0.4); color: #f87171; }
.modal-fine { color: var(--text-faint); font-size: 0.71875rem; margin: 12px 0 0; }
.modal-fine a, .agree-row a { color: var(--green-2); }
.agree-row { display: flex; align-items: flex-start; gap: 9px; text-align: left; font-size: 0.78rem; color: var(--text-dim); line-height: 1.45; margin: 4px 2px 2px; cursor: pointer; }
.agree-row input { margin-top: 2px; flex: 0 0 auto; width: 16px; height: 16px; accent-color: var(--green); cursor: pointer; }

/* OAuth providers + email validation */
.oauth-list { display: flex; flex-direction: column; gap: 8px; }
.oauth-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 11px 14px; border-radius: 12px; background: var(--elev); border: 1px solid var(--outline); color: var(--text); font: inherit; font-size: 0.875rem; font-weight: 600; cursor: pointer; transition: .15s var(--ease); }
.oauth-btn:hover { border-color: var(--outline-strong); background: var(--elev-2); }
.oauth-btn svg { width: 18px; height: 18px; flex: 0 0 auto; }
.oauth-divider { display: flex; align-items: center; gap: 12px; color: var(--text-faint); font-size: 0.75rem; margin: 14px 0; }
.oauth-divider::before, .oauth-divider::after { content: ""; flex: 1 1 auto; height: 1px; background: var(--outline); }
.modal-err { color: #f87171; font-size: 0.78125rem; text-align: left; margin: 2px 2px 6px; }
.modal-err:empty { display: none; }
.modal-input.invalid { border-color: rgba(248,113,113,0.6); box-shadow: 0 0 0 3px rgba(248,113,113,0.12); }
.modal-feats { list-style: none; padding: 0; margin: 0 0 16px; text-align: left; display: flex; flex-direction: column; gap: 11px; }
.modal-feats li { display: flex; gap: 10px; align-items: flex-start; font-size: 0.84375rem; color: var(--text); line-height: 1.45; }
.modal-feats .ic { width: 18px; height: 18px; color: var(--green); flex: 0 0 auto; margin-top: 1px; }
.modal-feats b { color: var(--green-3); font-weight: 600; }
.modal-price { display: flex; align-items: baseline; justify-content: center; gap: 5px; margin: 4px 0 14px; }
.mp-amt { font-family: var(--font); font-size: 2.125rem; font-weight: 700; }
.mp-per { color: var(--text-dim); font-size: 0.875rem; }

/* ============================================================ SETTINGS */
.user-row { display: flex; align-items: center; gap: 4px; }
.user-row .user { flex: 1 1 auto; min-width: 0; }
.user-row #settingsBtn { flex: 0 0 auto; }

.modal { max-height: 88vh; overflow-y: auto; }
.settings-modal { text-align: left; }

/* Paged settings: left section nav + scrolling content pane */
.modal:has(.settings-paged) { max-width: 660px; }
.settings-paged { display: flex; gap: 0; text-align: left; min-height: 380px; max-height: 70vh; }
.set-nav { flex: 0 0 150px; display: flex; flex-direction: column; gap: 2px; padding-right: 14px; border-right: 1px solid var(--hairline); }
.set-nav button { text-align: left; padding: 9px 12px; border-radius: 9px; background: transparent; border: none; color: var(--text-dim); font: inherit; font-size: 0.875rem; cursor: pointer; transition: .14s var(--ease); }
.set-nav button:hover { background: var(--elev-2); color: var(--text); }
.set-nav button.active { background: rgb(var(--accent-rgb) / 0.12); color: var(--text); font-weight: 600; }
.set-pane { flex: 1 1 auto; min-width: 0; overflow-y: auto; padding: 0 4px 4px 18px; }
.set-pane h2 { margin: 0 0 16px; font-size: 1.15rem; font-weight: 600; }
@media (max-width: 560px) {
  .settings-paged { flex-direction: column; max-height: 76vh; }
  .set-nav { flex: 0 0 auto; flex-direction: row; flex-wrap: wrap; gap: 6px; padding: 0 0 12px; border-right: none; border-bottom: 1px solid var(--hairline); }
  .set-pane { padding: 14px 2px 4px; }
}

.set-group { margin-bottom: 20px; }
.set-group:last-child { margin-bottom: 0; }
.set-label { color: var(--text-faint); font-size: 0.6875rem; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; margin-bottom: 4px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--hairline); cursor: pointer; }
.set-row:last-child { border-bottom: none; }
.set-row > span:first-child { font-size: 0.875rem; font-weight: 500; color: var(--text); }
.set-row small { display: block; color: var(--text-faint); font-size: 0.71875rem; font-weight: 400; margin-top: 3px; }
.set-action { display: block; width: 100%; text-align: left; padding: 11px 13px; border-radius: 11px; background: var(--elev); border: 1px solid var(--outline); color: var(--text); font: inherit; font-size: 0.84375rem; font-weight: 500; cursor: pointer; margin-top: 8px; transition: .15s var(--ease); }
.set-action:hover { border-color: var(--outline-strong); }
.set-action.danger { color: #f87171; border-color: rgba(248,113,113,0.3); }
.set-action.danger:hover { border-color: rgba(248,113,113,0.6); }

.toggle { position: relative; display: inline-block; width: 42px; height: 24px; flex: 0 0 auto; }
.toggle input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.toggle .track { position: absolute; inset: 0; background: var(--elev-2); border: 1px solid var(--outline); border-radius: 999px; transition: .18s var(--ease); }
.toggle .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--text-dim); transition: .18s var(--ease); }
.toggle input:checked + .track { background: linear-gradient(135deg, var(--green), var(--green-deep)); border-color: var(--green); }
.toggle input:checked + .track::after { transform: translateX(18px); background: var(--on-accent); }

.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after { animation-duration: .001s !important; transition-duration: .001s !important; }
.reduce-motion .caret, .reduce-motion .typing span { animation-duration: 1s !important; }

/* personalization + appearance controls */
.set-hint { color: var(--text-faint); font-size: 0.75rem; margin: 0 0 10px; }
.set-area { width: 100%; resize: vertical; min-height: 64px; background: var(--bg-2); border: 1px solid var(--outline); border-radius: 12px; color: var(--text); font: inherit; font-size: 0.84375rem; line-height: 1.5; padding: 10px 12px; margin-bottom: 10px; outline: none; }
.set-area:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-glow); }
.acc-name { text-align: center; font-weight: 600; }
.swatches { display: flex; gap: 8px; }
.swatch { width: 22px; height: 22px; border-radius: 50%; background: var(--sw); border: 2px solid transparent; cursor: pointer; padding: 0; transition: .15s var(--ease); }
.swatch:hover { transform: scale(1.1); }
.swatch.active { border-color: var(--bg); box-shadow: 0 0 0 2px var(--sw); }
.seg { display: flex; border: 1px solid var(--outline); border-radius: 10px; overflow: hidden; }
.seg button { padding: 6px 12px; background: transparent; border: none; color: var(--text-dim); font: inherit; font-size: 0.78125rem; cursor: pointer; transition: .15s var(--ease); }
.seg button + button { border-left: 1px solid var(--outline); }
.seg button.active { background: var(--elev-2); color: var(--text); }

/* text size (scales the chat reading/writing surfaces) */
html { font-size: 16px; } /* text-scale */
html.text-small { font-size: 14.5px; } /* text-scale */
html.text-large { font-size: 18px; } /* text-scale */

/* accent themes — recolor the --green family */
html.accent-teal  { --green: #2dd4bf; --green-2: #5eead4; --green-3: #99f6e4; --green-deep: #0d9488; --accent-rgb: 45 212 191; }
html.accent-blue  { --green: #60a5fa; --green-2: #93c5fd; --green-3: #bfdbfe; --green-deep: #2563eb; --accent-rgb: 96 165 250; }
html.accent-tan   { --green: #d6b98c; --green-2: #e7d2ad; --green-3: #f0e2c8; --green-deep: #a8855c; --accent-rgb: 214 185 140; }
html.accent-clay  { --green: #9c6a3c; --green-2: #c89a6a; --green-3: #d9b189; --green-deep: #6e4827; --accent-rgb: 156 106 60; --on-accent: #fff; }
html.accent-stone { --green: #e8e6e1; --green-2: #cfcabf; --green-3: #f4f2ed; --green-deep: #b8b3a8; --accent-rgb: 232 230 225; }

/* ============================================================ LIGHT THEME */
html.light {
  --bg: #f5f4ef;
  --bg-2: #eceae3;
  --panel-solid: #ffffff;
  --elev: #ffffff;
  --elev-2: #ecebe4;
  --text: #1c241e;
  --text-dim: #586159;
  --text-faint: #8b938b;
  --hairline: rgba(0,0,0,0.10);
  --shadow: 0 14px 40px rgba(0,0,0,0.12);
}
/* accent-colored text needs to be darker on a light background */
html.light .m-body strong,
html.light .attach-chip,
html.light .tool-chip.active,
html.light .mkt-chip.active { color: var(--green-deep); }
html.light .brand-name { background-image: linear-gradient(90deg, var(--green-deep), var(--green)); }
html.light .hero-tag { background-image: linear-gradient(100deg, var(--green-deep), var(--green-2)); }
html.light .stars { color: #c8860a; }

/* ============================================================ ACCOUNT / SETTINGS EXTRAS */
.acct-head { display: flex; gap: 14px; align-items: center; margin-bottom: 20px; }
.acct-head .modal-mark { margin: 0; flex: 0 0 auto; }
.acct-id { flex: 1 1 auto; min-width: 0; }
.acct-head .acc-name { text-align: left; margin: 0 0 4px; }
.acct-head .modal-sub { margin: 0; }
.set-action small { display: block; color: var(--text-faint); font-size: 0.71875rem; font-weight: 400; margin-top: 3px; }
.set-action.hosted { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hosted-tag { font-size: 0.625rem; font-weight: 600; color: var(--text-faint); border: 1px solid var(--outline); border-radius: 6px; padding: 2px 6px; text-transform: uppercase; letter-spacing: .4px; flex: 0 0 auto; }

/* ============================================================ MODEL PICKER */
.model-wrap { position: relative; }
.model-menu { position: absolute; top: calc(100% + 8px); left: 0; min-width: 244px; background: var(--elev); border: 1px solid var(--outline); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; z-index: 60; display: flex; flex-direction: column; gap: 2px; animation: popIn .18s var(--ease) both; }
.model-opt { text-align: left; background: transparent; border: none; border-radius: 10px; padding: 9px 11px; cursor: pointer; color: var(--text); font: inherit; transition: .15s var(--ease); }
.model-opt:hover { background: var(--elev-2); }
.model-opt.active { background: linear-gradient(90deg, rgb(var(--accent-rgb) / 0.12), transparent); }
.mo-name { font-size: 0.84375rem; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.mo-name .ic { width: 15px; height: 15px; color: var(--green); margin-left: auto; }
.mo-desc { font-size: 0.71875rem; color: var(--text-dim); margin-top: 2px; }

/* ============================================================
   Usability: manual marker entry · cross-tool handoff · get-started
   ============================================================ */
.manual-add { margin-top: 12px; }
.manual-form { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.manual-form[hidden] { display: none; }   /* the hidden attribute must beat display:flex */
.manual-in { flex: 1 1 140px; min-width: 120px; padding: 9px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--outline); background: var(--panel-solid); color: var(--text); font: inherit; font-size: 0.84375rem; }
.manual-in:focus { outline: none; border-color: var(--green); }
.manual-msg { font-size: 0.78125rem; color: var(--text-faint); margin-top: 8px; min-height: 1em; }

.next-steps { margin: 28px 0 4px; }
.ns-label { font-size: 0.78125rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; }
.ns-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ns-btn { display: flex; align-items: center; gap: 12px; text-align: left; padding: 14px 16px; border-radius: var(--radius);
  border: 1px solid var(--outline); background: var(--panel-solid); color: var(--text); cursor: pointer; transition: .15s var(--ease); }
.ns-btn:hover { border-color: var(--green); background: rgb(var(--accent-rgb) / 0.04); }
.ns-btn svg { width: 22px; height: 22px; color: var(--green); flex-shrink: 0; }
.ns-btn span { display: flex; flex-direction: column; }
.ns-btn b { font-size: 0.875rem; }
.ns-btn small { color: var(--text-faint); font-size: 0.75rem; }

/* chat-home introduction (free preview + signed in) */
.chat-home { flex: 1 1 auto; overflow-y: auto; min-height: 0; }
.intro-head { text-align: center; padding: 20px 0 4px; }
.intro { max-width: 720px; margin: 18px auto 24px; }
.intro-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.intro-card { display: flex; align-items: flex-start; gap: 12px; text-align: left; padding: 16px; border-radius: var(--radius);
  border: 1px solid var(--outline); background: var(--panel-solid); color: var(--text); cursor: pointer; transition: .15s var(--ease); }
.intro-card:hover { border-color: var(--green); background: rgb(var(--accent-rgb) / 0.04); transform: translateY(-1px); }
.intro-ic { display: inline-flex; flex-shrink: 0; }
.intro-ic svg { width: 24px; height: 24px; color: var(--green); }
.intro-txt { display: flex; flex-direction: column; gap: 3px; }
.intro-txt b { font-size: 0.9rem; display: flex; align-items: center; gap: 8px; }
.intro-txt small { color: var(--text-dim); font-size: 0.78125rem; line-height: 1.5; }
.intro-pro { font-size: 0.625rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--green-deep);
  border: 1px solid var(--green-deep); border-radius: 999px; padding: 1px 7px; }
.intro-note { margin-top: 14px; padding: 12px 16px; border-radius: var(--radius-sm); text-align: center;
  border: 1px solid var(--outline); background: rgb(var(--accent-rgb) / 0.05); font-size: 0.8125rem; color: var(--text-dim); }
.intro-link { background: none; border: none; padding: 0; font: inherit; color: var(--green); font-weight: 600; cursor: pointer; text-decoration: underline; }
.intro-legal { display: flex; gap: 10px; margin-top: 16px; padding: 14px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--outline); background: rgb(var(--accent-rgb) / 0.03); font-size: 0.75rem; color: var(--text-dim); line-height: 1.55; }
.intro-legal svg { width: 18px; height: 18px; color: var(--green); flex-shrink: 0; margin-top: 1px; }
.intro-legal b { color: var(--text); }
.intro-dismiss { display: block; margin: 14px auto 0; background: none; border: none; padding: 4px 8px; font: inherit;
  font-size: 0.78125rem; color: var(--text-faint); cursor: pointer; }
.intro-dismiss:hover { color: var(--text); text-decoration: underline; }

@media (max-width: 560px) {
  .ns-row { grid-template-columns: 1fr; }
}
