:root {
  --surface: #ffffff;
  --surface-2: #fafafa;
  --on-accent: #ffffff;
  --line-soft: #efefef;
  --muted-fill: #ececec;
  --nav-bg: rgba(255, 255, 255, .92);
  color-scheme: light;
  --bg: #ffffff;
  --sidebar: #f9f9f9;
  --text: #0d0d0d;
  --text-2: #5d5d5d;
  --text-3: #8f8f8f;
  --border: #e5e5e5;
  --border-strong: #d4d4d4;
  --hover: #ececec;
  --active: #e3e3e3;
  --bubble: #f4f4f4;
  --accent: #0d0d0d;
  --danger: #d0302f;
  --ok: #10a37f;
  --shadow: 0 0 0 1px rgba(0, 0, 0, .06), 0 6px 24px rgba(0, 0, 0, .06);
  --shadow-menu: 0 0 0 1px rgba(0, 0, 0, .07), 0 10px 32px rgba(0, 0, 0, .12);
  --radius: 14px;
  --sidebar-w: 260px;
  --font: ui-sans-serif, -apple-system, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: default; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid #3b82f6; outline-offset: 2px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; padding: 0 18px; border-radius: 999px; font-size: 15px; font-weight: 500;
  border: 1px solid transparent; transition: background .15s, border-color .15s, opacity .15s;
  white-space: nowrap;
}
.btn-sm { height: 34px; padding: 0 12px; font-size: 14px; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: #2a2a2a; }
.btn-primary:disabled { opacity: .45; }
.btn-outline { border-color: var(--border-strong); background: var(--surface); }
.btn-outline:hover { background: var(--bubble); }
.btn-ghost:hover { background: var(--hover); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b42726; }
.btn-block { width: 100%; height: 52px; font-size: 16px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 8px; color: var(--text-2);
}
.icon-btn:hover { background: var(--hover); color: var(--text); }

/* ---------- login ---------- */
.login-body { display: flex; min-height: 100%; align-items: center; justify-content: center; padding: 24px 16px; }
.login { width: 100%; max-width: 360px; text-align: center; }
.login-logo { display: block; margin: 0 auto 28px; }
.login-title { font-size: 30px; font-weight: 600; margin: 0 0 6px; letter-spacing: -.01em; }
.login-sub { margin: 0 0 28px; color: var(--text-2); }
.login-form { display: flex; flex-direction: column; gap: 14px; text-align: left; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--text-2); }
.field input {
  height: 52px; padding: 0 16px; border: 1px solid var(--border-strong); border-radius: 999px;
  font-size: 16px; color: var(--text); background: var(--surface); outline: none; width: 100%;
}
.field input:focus { border-color: var(--text); box-shadow: 0 0 0 1px var(--text); }
.password-wrap { position: relative; display: block; }
.password-wrap input { padding-right: 52px; }
.password-toggle {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; border-radius: 999px; color: var(--text-2);
  display: inline-flex; align-items: center; justify-content: center;
}
.password-toggle:hover { background: var(--bubble); }
.login-error { margin: 0; color: var(--danger); font-size: 14px; }
.login-foot { margin-top: 28px; font-size: 13px; color: var(--text-3); }
.login-hint { margin: -6px 0 0 16px; font-size: 13px; color: var(--text-3); }
.login-switch { margin-top: 22px; font-size: 14px; color: var(--text-2); }
.link-btn { color: var(--text); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; margin-left: 4px; }

/* ---------- shell ---------- */
.shell { display: flex; height: 100%; overflow: hidden; }
.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w); background: var(--sidebar);
  display: flex; flex-direction: column; height: 100%; border-right: 1px solid var(--line-soft);
  transition: margin-left .2s ease;
}
.shell.collapsed .sidebar { margin-left: calc(-1 * var(--sidebar-w)); }
.sidebar-top { display: flex; align-items: center; justify-content: space-between; padding: 10px 10px 4px 12px; }
.brand { display: inline-flex; padding: 5px; border-radius: 8px; }
.brand:hover { background: var(--hover); }
.sidebar-actions { padding: 6px 8px; display: flex; flex-direction: column; gap: 1px; }
.side-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 10px;
  font-size: 14px; text-align: left; color: var(--text);
}
.side-item:hover { background: var(--hover); }
.side-item svg { flex: 0 0 auto; color: var(--text); }
.sidebar-scroll { flex: 1; overflow-y: auto; padding: 4px 8px 12px; }
.side-search { padding: 2px 2px 8px; }
.side-search input {
  width: 100%; height: 36px; border-radius: 10px; border: 1px solid var(--border-strong);
  padding: 0 12px; font-size: 14px; background: var(--surface); outline: none;
}
.side-search input:focus { border-color: var(--text-2); }
.side-heading { font-size: 12px; font-weight: 500; color: var(--text-3); margin: 14px 10px 6px; }
.report-list { list-style: none; margin: 0; padding: 0; }
.report-item {
  position: relative; display: flex; align-items: center; border-radius: 10px;
}
.report-item:hover, .report-item.current { background: var(--hover); }
.report-item.current { background: var(--active); }
.report-link {
  flex: 1; min-width: 0; padding: 8px 10px; font-size: 14px; text-align: left;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.report-more {
  width: 30px; height: 30px; margin-right: 4px; border-radius: 8px; color: var(--text-2);
  display: none; align-items: center; justify-content: center;
}
.report-item:hover .report-more, .report-item.current .report-more, .report-more[aria-expanded="true"] { display: inline-flex; }
.report-more:hover { color: var(--text); }
.active-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; margin-top: 6px;
  border-radius: 10px; font-size: 14px; text-align: left; background: var(--surface); box-shadow: 0 0 0 1px var(--border);
}
.active-item:hover { background: var(--bubble); }
.active-item .t { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.side-empty { font-size: 13px; color: var(--text-3); margin: 6px 10px; }
.sidebar-bottom { padding: 8px; border-top: 1px solid var(--line-soft); }
.profile {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border-radius: 12px; text-align: left;
}
.profile:hover { background: var(--hover); }
.avatar {
  width: 32px; height: 32px; border-radius: 999px; background: #6d4aff; color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600;
  flex: 0 0 auto; text-transform: uppercase;
}
.profile-text { display: flex; flex-direction: column; min-width: 0; }
.profile-name { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-plan { font-size: 12px; color: var(--text-3); }
.scrim { display: none; }

/* ---------- main ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100%; position: relative; }
.topbar { height: 56px; flex: 0 0 56px; display: flex; align-items: center; gap: 4px; padding: 0 10px; }
.topbar-title { font-size: 18px; font-weight: 500; padding: 6px 10px; border-radius: 10px; color: var(--text); }
.topbar-right { margin-left: auto; display: flex; gap: 6px; }
.only-collapsed { display: none; }
.shell.collapsed .only-collapsed { display: inline-flex; }
.view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.disclaimer { margin: 0; padding: 6px 16px 10px; text-align: center; font-size: 12px; color: var(--text-3); }

/* home */
.view-home { justify-content: center; align-items: center; padding: 0 16px 8vh; }
.home-center { width: 100%; max-width: 768px; display: flex; flex-direction: column; align-items: center; gap: 26px; }
.home-title { font-size: 28px; font-weight: 500; margin: 0; text-align: center; letter-spacing: -.01em; }
#composer-home-slot { width: 100%; }
.suggestions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.chip {
  border: 1px solid var(--border); border-radius: 999px; padding: 8px 14px; font-size: 14px; color: var(--text-2);
  background: var(--surface); text-align: left;
}
.chip:hover { background: var(--bubble); color: var(--text); }

/* composer */
.composer {
  width: 100%; background: var(--surface); border-radius: 28px; box-shadow: var(--shadow);
  padding: 12px 12px 10px 20px; display: flex; flex-direction: column; gap: 6px;
}
.composer:focus-within { box-shadow: 0 0 0 1px rgba(0, 0, 0, .14), 0 6px 24px rgba(0, 0, 0, .07); }
.composer-input {
  width: 100%; border: 0; outline: none; resize: none; font-size: 16px; line-height: 1.5;
  min-height: 28px; max-height: 240px; padding: 6px 0 0; background: transparent;
}
.composer-input::placeholder { color: var(--text-3); }
.composer-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.composer-hint {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2);
  border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px;
}
.composer-hint::before {
  content: ""; width: 7px; height: 7px; border-radius: 999px; background: var(--ok);
}
.send-btn {
  width: 36px; height: 36px; border-radius: 999px; background: var(--accent); color: var(--on-accent);
  display: inline-flex; align-items: center; justify-content: center; transition: opacity .15s;
}
.send-btn:disabled { background: var(--border-strong); color: #fff; }

/* thread */
.thread-scroll { flex: 1; overflow-y: auto; }
.thread { max-width: 768px; margin: 0 auto; padding: 16px 16px 40px; display: flex; flex-direction: column; gap: 22px; }
.thread-composer { max-width: 800px; width: 100%; margin: 0 auto; padding: 0 16px 6px; }
.msg-user { align-self: flex-end; max-width: 80%; background: var(--bubble); border-radius: 20px 20px 6px 20px; padding: 10px 16px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-bot { display: flex; gap: 14px; align-items: flex-start; }
.msg-bot .bot-mark { flex: 0 0 28px; width: 28px; height: 28px; margin-top: 2px; }
.msg-bot .bot-body { flex: 1; min-width: 0; line-height: 1.7; overflow-wrap: anywhere; }
.bot-body p { margin: 0 0 10px; }
.bot-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.muted { color: var(--text-2); }
.small { font-size: 14px; }

/* research card */
.research {
  border: 1px solid var(--border); border-radius: 18px; overflow: hidden; background: var(--surface);
}
.research-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.pulse {
  position: relative; width: 22px; height: 22px; flex: 0 0 22px;
}
.pulse::before, .pulse::after {
  content: ""; position: absolute; inset: 0; border-radius: 999px; background: var(--text);
  animation: pulse 1.8s ease-out infinite;
}
.pulse::after { inset: 6px; animation: none; }
@keyframes pulse { 0% { transform: scale(.35); opacity: .45; } 100% { transform: scale(1); opacity: 0; } }
.shimmer {
  font-weight: 500;
  background: linear-gradient(90deg, var(--text) 0%, var(--text) 35%, var(--text-3) 50%, var(--text) 65%, var(--text) 100%);
  background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 2.4s linear infinite;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.research-title { flex: 1; min-width: 0; }
.research-phase { font-size: 15px; }
.research-thought { font-size: 13px; color: var(--text-2); min-height: 20px; transition: opacity .35s; }
.research-thought.fade { opacity: 0; }
.research-count { font-size: 13px; color: var(--text-2); white-space: nowrap; }
.research-body { border-top: 1px solid var(--border); display: grid; grid-template-columns: 220px 1fr; min-height: 220px; }
.steps { list-style: none; margin: 0; padding: 14px 10px 14px 16px; border-right: 1px solid var(--border); }
.step { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 13.5px; color: var(--text-3); }
.step .dot {
  width: 18px; height: 18px; flex: 0 0 18px; border-radius: 999px; border: 1.5px solid var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center;
}
.step.done { color: var(--text-2); }
.step.done .dot { border-color: var(--ok); background: var(--ok); }
.step.done .dot::after { content: ""; width: 7px; height: 4px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.step.now { color: var(--text); font-weight: 500; }
.step.now .dot { border-color: var(--text); border-top-color: transparent; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.sources { padding: 10px 12px; max-height: 340px; overflow-y: auto; }
.sources-empty { font-size: 13px; color: var(--text-3); padding: 8px 4px; }
.source {
  display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 10px; text-decoration: none;
  animation: slidein .35s ease both;
}
.source:hover { background: var(--bubble); }
@keyframes slidein { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.site-icon {
  width: 24px; height: 24px; flex: 0 0 24px; border-radius: 7px; color: #fff; font-size: 12px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; text-transform: uppercase;
}
.source-text { min-width: 0; display: flex; flex-direction: column; }
.source-title { font-size: 13.5px; color: var(--text); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.source-site { font-size: 12px; color: var(--text-3); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.research-foot {
  border-top: 1px solid var(--border); padding: 10px 16px; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; font-size: 13px; color: var(--text-2); background: var(--surface-2);
}
.research.finished .research-body { display: none; }

/* finished report card */
.report-card {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--border);
  border-radius: 16px; background: var(--surface);
}
.report-card .doc {
  width: 42px; height: 42px; border-radius: 10px; background: #eef4ff; color: #2f5bd3; flex: 0 0 42px;
  display: inline-flex; align-items: center; justify-content: center;
}
.report-card .meta { flex: 1; min-width: 0; }
.report-card .name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.report-card .sub { font-size: 13px; color: var(--text-2); }

/* report view */
.view-report { background: var(--bg); }
.report-bar {
  display: flex; align-items: center; gap: 10px; padding: 6px 12px; border-bottom: 1px solid var(--border);
}
.report-bar-title { flex: 1; min-width: 0; font-weight: 500; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.report-bar-actions { display: flex; gap: 6px; }
.report-frame { flex: 1; width: 100%; border: 0; background: #fff; }

/* menus, modal, toast */
.menu {
  position: fixed; z-index: 50; min-width: 220px; background: var(--surface); border-radius: 16px; padding: 6px;
  box-shadow: var(--shadow-menu);
}
.menu-head { padding: 8px 10px; font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 10px;
  font-size: 14px; text-align: left;
}
.menu-item:hover { background: var(--bubble); }
.menu-item.danger { color: var(--danger); }
.menu-sep { height: 1px; background: var(--border); margin: 4px 6px; }
.dl-menu { min-width: 180px; }

.modal-backdrop {
  position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .35);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal {
  width: 100%; max-width: 680px; max-height: min(640px, 90vh); background: var(--surface); border-radius: 18px;
  box-shadow: var(--shadow-menu); display: flex; flex-direction: column; overflow: hidden;
}
.modal-small { max-width: 420px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h2 { margin: 0; font-size: 18px; font-weight: 600; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 18px; }
.settings { display: grid; grid-template-columns: 190px 1fr; min-height: 380px; }
.settings-tabs { padding: 10px; border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; }
.settings-tab {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; font-size: 14px; text-align: left;
}
.settings-tab:hover { background: var(--bubble); }
.settings-tab.on { background: var(--hover); font-weight: 500; }
.settings-panel { padding: 6px 22px 18px; overflow-y: auto; }
.setting-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0;
  border-bottom: 1px solid var(--border); font-size: 14px;
}
.setting-row:last-child { border-bottom: 0; }
.setting-row .desc { font-size: 13px; color: var(--text-3); margin-top: 2px; }
.setting-row select {
  height: 34px; border-radius: 10px; border: 1px solid var(--border-strong); padding: 0 10px; background: var(--surface);
}
.pill { font-size: 12px; color: var(--text-3); border: 1px solid var(--border); border-radius: 999px; padding: 2px 8px; }
.switch { width: 38px; height: 22px; border-radius: 999px; background: var(--border-strong); position: relative; flex: 0 0 38px; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 999px; background: #fff; }
.switch[aria-disabled="true"] { opacity: .5; }
.help-list { margin: 0; padding-left: 18px; line-height: 1.7; font-size: 15px; }
.help-list li { margin-bottom: 8px; }
.input-text {
  width: 100%; height: 42px; border-radius: 12px; border: 1px solid var(--border-strong); padding: 0 12px; outline: none;
}
.input-text:focus { border-color: var(--text); }
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 70;
  background: var(--text); color: var(--on-accent); padding: 10px 16px; border-radius: 12px; font-size: 14px;
  box-shadow: var(--shadow-menu); max-width: calc(100% - 32px);
}
.tip { position: fixed; z-index: 80; background: var(--text); color: var(--on-accent); font-size: 12px; padding: 5px 8px; border-radius: 8px; pointer-events: none; }

/* credits */
.credit-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--border); font-size: 13.5px; color: var(--text); background: var(--surface);
}
.credit-chip:hover { background: var(--bubble); }
.credit-chip .coin {
  width: 16px; height: 16px; border-radius: 999px; background: linear-gradient(135deg, #f7c948, #e0a800);
  box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, .12);
}
.profile-credits { font-size: 12px; color: var(--text-2); }
.estimate { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 4px 0 2px; font-size: 13.5px; color: var(--text-2); }
.estimate b { color: var(--text); font-weight: 600; }
.notice { margin-top: 8px; padding: 10px 12px; border-radius: 12px; background: var(--surface)7e6; color: #7a4b00; font-size: 14px; }
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.plan { border: 1px solid var(--border); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.plan.best { border-color: var(--text); box-shadow: 0 0 0 1px var(--text); }
.plan .amount { font-size: 22px; font-weight: 600; }
.plan .price { font-size: 15px; color: var(--text-2); }
.plan .tag { align-self: flex-start; font-size: 11.5px; padding: 2px 8px; border-radius: 999px; background: var(--text); color: var(--on-accent); }
.history { list-style: none; margin: 0; padding: 0; }
.history li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.history li:last-child { border-bottom: 0; }
.history .when { font-size: 12px; color: var(--text-3); }
.history .plus { color: var(--ok); font-weight: 600; white-space: nowrap; }
.history .minus { color: var(--text); font-weight: 600; white-space: nowrap; }
.code-input { text-transform: uppercase; letter-spacing: .18em; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; text-align: center; font-size: 18px; }
.form-msg { margin: 10px 0 0; font-size: 14px; }
.form-msg.err { color: var(--danger); }
.form-msg.ok { color: var(--ok); }

/* ---------- small screens ---------- */
@media (max-width: 860px) {
  .research-body { grid-template-columns: 1fr; }
  .steps { border-right: 0; border-bottom: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 10px 14px; }
  .step { padding: 2px 0; }
  .settings { grid-template-columns: 1fr; }
  .settings-tabs { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  .settings-tab { white-space: nowrap; }
}
@media (max-width: 760px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 40; box-shadow: var(--shadow-menu); }
  .shell.collapsed .sidebar { margin-left: calc(-1 * var(--sidebar-w) - 20px); }
  .shell:not(.collapsed) .scrim { display: block; position: fixed; inset: 0; z-index: 39; background: rgba(0, 0, 0, .25); }
  .only-collapsed { display: inline-flex; }
  .home-title { font-size: 24px; }
  .msg-user { max-width: 90%; }
  .msg-bot { gap: 10px; }
  .msg-bot .bot-mark { display: none; }
  .report-bar-title { display: none; }
}

/* ---------- public pages: landing and legal (same black-and-white look) ---------- */
body.landing, body.legal-page { overflow-y: auto; height: auto; min-height: 100%; }
.lp-nav {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 24px; background: var(--nav-bg); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line-soft);
}
.lp-brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 18px; text-decoration: none; color: var(--text); }
.lp-links { display: flex; align-items: center; gap: 18px; font-size: 14.5px; }
.lp-links > a:not(.btn) { color: var(--text-2); text-decoration: none; }
.lp-links > a:not(.btn):hover { color: var(--text); }
.lp-hero { max-width: 900px; margin: 0 auto; padding: 72px 24px 40px; text-align: center; }
.lp-hero h1 { font-size: clamp(32px, 5.4vw, 54px); line-height: 1.08; letter-spacing: -.02em; margin: 0 0 18px; font-weight: 600; }
.lp-lead { font-size: clamp(16px, 2.1vw, 19px); color: var(--text-2); line-height: 1.6; max-width: 700px; margin: 0 auto 28px; }
.lp-cta { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.lp-cta .btn { height: 48px; padding: 0 22px; font-size: 16px; }
.lp-section { max-width: 1040px; margin: 0 auto; padding: 64px 24px; }
.lp-alt { max-width: none; background: var(--surface-2); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.lp-alt > * { max-width: 1040px; margin-left: auto; margin-right: auto; }
.lp-section h2 { font-size: clamp(26px, 3.6vw, 36px); text-align: center; margin: 0 0 12px; letter-spacing: -.01em; font-weight: 600; }
.lp-sub { text-align: center; color: var(--text-2); margin: 0 0 32px; }
.lp-grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 32px; }
.lp-grid2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 32px; }
.lp-card, .lp-feature { border: 1px solid var(--border); border-radius: 18px; padding: 22px; background: var(--surface); }
.lp-card h3, .lp-feature h3 { margin: 10px 0 8px; font-size: 17px; }
.lp-card p, .lp-feature p { margin: 0; color: var(--text-2); line-height: 1.6; font-size: 15px; }
.lp-num { width: 32px; height: 32px; border-radius: 999px; background: var(--text); color: var(--on-accent); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; }
.lp-feature h3 { margin-top: 0; }
.lp-plans { display: grid; grid-template-columns: repeat(2, minmax(0, 340px)); justify-content: center; gap: 18px; }
.lp-plan { position: relative; border: 1px solid var(--border); border-radius: 20px; padding: 26px; background: var(--surface); display: flex; flex-direction: column; gap: 6px; }
.lp-plan-best { border-color: var(--text); box-shadow: 0 0 0 1px var(--text); }
.lp-tag { position: absolute; top: -12px; left: 24px; background: var(--text); color: var(--on-accent); font-size: 12px; padding: 3px 10px; border-radius: 999px; }
.lp-plan-name { font-weight: 600; color: var(--text-2); }
.lp-price { font-size: 44px; font-weight: 600; letter-spacing: -.02em; }
.lp-credits { font-size: 16px; font-weight: 500; margin-bottom: 8px; }
.lp-plan ul { margin: 0 0 18px; padding-left: 18px; color: var(--text-2); line-height: 1.8; font-size: 15px; flex: 1; }
.lp-plan .btn-block { height: 46px; }
.lp-note { max-width: 680px; margin: 24px auto 0; text-align: center; color: var(--text-2); font-size: 14px; line-height: 1.6; }
.lp-faq { max-width: 760px; margin: 28px auto 0; }
.lp-faq details { border-bottom: 1px solid var(--border); padding: 16px 4px; }
.lp-faq summary { cursor: pointer; font-weight: 500; font-size: 16px; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.lp-faq summary::after { content: "+"; color: var(--text-3); font-size: 20px; line-height: 1; }
.lp-faq details[open] summary::after { content: "−"; }
.lp-faq summary::-webkit-details-marker { display: none; }
.lp-faq p { color: var(--text-2); line-height: 1.65; margin: 10px 0 0; }
.lp-final { text-align: center; padding: 72px 24px; }
.lp-final h2 { font-size: clamp(24px, 3.4vw, 34px); margin: 0 0 20px; font-weight: 600; }
.lp-final .btn { height: 48px; padding: 0 24px; font-size: 16px; }
.lp-footer { border-top: 1px solid var(--line-soft); padding: 28px 24px 36px; display: flex; flex-direction: column; align-items: center; gap: 12px; font-size: 13.5px; color: var(--text-2); }
.lp-foot-brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text); }
.lp-foot-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; }
.lp-foot-links a { color: var(--text-2); text-decoration: none; }
.lp-foot-links a:hover { color: var(--text); text-decoration: underline; }
.lp-copy { color: var(--text-3); font-size: 12.5px; }
.login-legal { margin-top: 30px; font-size: 12.5px; color: var(--text-3); display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; }
.login-legal a { color: var(--text-3); }
.login-home { position: absolute; top: 16px; left: 20px; display: inline-flex; align-items: center; gap: 8px; font-weight: 600; text-decoration: none; color: var(--text); }
.legal-wrap { max-width: 780px; margin: 0 auto; padding: 40px 24px 80px; line-height: 1.7; font-size: 15.5px; }
.legal-wrap h1 { font-size: 32px; letter-spacing: -.01em; margin: 0 0 6px; }
.legal-wrap .updated { color: var(--text-3); font-size: 13.5px; margin: 0 0 28px; }
.legal-wrap h2 { font-size: 19px; margin: 32px 0 8px; }
.legal-wrap p, .legal-wrap li { color: #2f2f2f; }
.legal-wrap ul, .legal-wrap ol { padding-left: 22px; }
.legal-wrap table { border-collapse: collapse; width: 100%; font-size: 14.5px; margin: 8px 0; }
.legal-wrap td, .legal-wrap th { border: 1px solid var(--border); padding: 8px 10px; text-align: left; vertical-align: top; }
.legal-wrap th { background: var(--surface-2); font-weight: 500; }
.legal-box { border: 1px solid var(--border); background: var(--surface-2); border-radius: 14px; padding: 14px 16px; margin: 16px 0; }
@media (max-width: 760px) {
  .lp-nav { padding: 10px 16px; }
  .lp-links > a:not(.btn), .lp-hide-sm { display: none; }
  .lp-hero { padding: 48px 16px 24px; }
  .lp-section { padding: 48px 16px; }
  .lp-grid3, .lp-grid2, .lp-plans { grid-template-columns: 1fr; }
  .login-body { padding-top: 64px; }
}
a.btn { text-decoration: none; }

/* ---------- sign-in options ---------- */
.oauth-box { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.oauth-btn { height: 50px; gap: 10px; font-size: 15.5px; color: var(--text); }
.oauth-btn svg { flex: 0 0 auto; }
.or-line { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 13px; margin: 6px 0 2px; }
.or-line::before, .or-line::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.hp-field { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.login-notice { margin: 0 0 16px; padding: 10px 12px; border-radius: 12px; background: var(--bubble); color: var(--text-2); font-size: 14px; text-align: center; }
.login-notice.ok { background: #e9f7f1; color: #0b6b50; }
.login-error.ok { color: #0b6b50; }
.forgot-link { align-self: flex-end; margin: -6px 4px 0 0; font-size: 13.5px; font-weight: 400; color: var(--text-2); }
.verify-banner {
  display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; margin: 0 16px 8px;
  padding: 10px 14px; border-radius: 12px; background: var(--surface)7e6; color: #7a4b00; font-size: 14px;
}
.verify-banner button { font-weight: 600; text-decoration: underline; color: inherit; }

/* ---------- language menu with flags ---------- */
.flag { display: inline-flex; flex: 0 0 auto; width: 20px; height: 14px; border-radius: 3px; overflow: hidden; box-shadow: 0 0 0 1px rgba(0, 0, 0, .1); }
.flag svg { display: block; width: 100%; height: 100%; }
.lang-picker { position: relative; display: inline-flex; }
.lang-current {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 10px; border: 1px solid var(--border);
  border-radius: 10px; font-size: 13px; font-weight: 600; color: var(--text-2); background: var(--surface);
}
.lang-current:hover { background: var(--bubble); color: var(--text); }
.lang-caret { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid currentColor; opacity: .6; }
.lang-list {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 190px; max-height: 380px; overflow: auto;
  margin: 0; padding: 6px; list-style: none; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-menu); text-align: left;
}
.lang-picker.up .lang-list { top: auto; bottom: calc(100% + 6px); }
.lang-picker.wide .lang-current { height: 36px; font-weight: 500; color: var(--text); }
.lang-picker.wide { flex-direction: column; align-items: flex-end; }
.lang-picker.wide .lang-list { position: static; margin-top: 6px; max-height: none; }
.lang-list li { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; font-size: 14px; color: var(--text); cursor: pointer; }
.lang-list li:hover, .lang-list li:focus { background: var(--bubble); outline: none; }
.lang-list li[aria-selected="true"] { font-weight: 600; }
.lang-list li[aria-selected="true"]::after { content: "✓"; margin-left: auto; font-size: 13px; }
.login-lang { position: absolute; top: 14px; right: 18px; }

/* ---------- landing: AI badge and the how-it-works film ---------- */
.ai-badge {
  display: inline-flex; align-items: center; gap: 7px; margin: 0 0 20px; padding: 6px 13px 6px 11px; border: 1px solid var(--border);
  border-radius: 999px; background: var(--surface); font-size: 13.5px; font-weight: 500; color: var(--text); box-shadow: 0 2px 10px rgba(0, 0, 0, .04);
}
.ai-badge svg { animation: twinkle 2.4s ease-in-out infinite; }
@keyframes twinkle { 0%, 100% { transform: scale(1) rotate(0); opacity: 1; } 50% { transform: scale(.82) rotate(18deg); opacity: .7; } }
.lp-ai-note { max-width: 620px; text-align: center; font-size: 12.5px; color: var(--text-3); line-height: 1.5; }

.hiw {
  max-width: 720px; margin: 52px auto 0; text-align: left; border: 1px solid var(--border); border-radius: 22px; background: var(--surface);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .07); overflow: hidden;
}
.hiw-bar { display: flex; align-items: center; gap: 12px; padding: 11px 14px 11px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.hiw-ai {
  display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; padding: 4px 10px; border-radius: 999px;
  background: var(--text); color: var(--on-accent); font-size: 12px; font-weight: 600;
}
.hiw-ai svg { animation: twinkle 1.6s ease-in-out infinite; }
.hiw-caption { flex: 1; min-width: 0; font-size: 14px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hiw-replay { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 8px; color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; }
.hiw-replay:hover { background: var(--hover); color: var(--text); }
.hiw-stage { position: relative; height: 330px; transition: opacity .5s; }
.hiw-stage.fade { opacity: 0; }
.hiw-q {
  position: absolute; top: 18px; right: 18px; max-width: 80%; background: var(--bubble); border-radius: 20px 20px 6px 20px;
  padding: 10px 16px; font-size: 15px; line-height: 1.45; opacity: 0; transform: translateY(8px); transition: opacity .45s, transform .45s;
}
.hiw-stage:not([data-scene="0"]) .hiw-q { opacity: 1; transform: none; }
.hiw-panels { position: absolute; left: 18px; right: 18px; top: 96px; bottom: 16px; }
.hiw-panel { position: absolute; inset: 0; opacity: 0; transform: translateY(10px); transition: opacity .5s, transform .5s; pointer-events: none; }
.hiw-stage[data-scene="0"] .hiw-compose, .hiw-stage[data-scene="1"] .hiw-plan, .hiw-stage[data-scene="2"] .hiw-search,
.hiw-stage[data-scene="3"] .hiw-search, .hiw-stage[data-scene="4"] .hiw-report { opacity: 1; transform: none; }
.hiw-compose { display: flex; align-items: center; top: -78px; }
.hiw-input {
  position: relative; width: 100%; min-height: 60px; padding: 18px 60px 18px 20px; border-radius: 28px; background: var(--surface);
  box-shadow: var(--shadow); font-size: 16px; line-height: 1.45;
}
.hiw-cursor { display: inline-block; width: 2px; height: 1.15em; margin-left: 1px; vertical-align: text-bottom; background: var(--text); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hiw-send {
  position: absolute; right: 12px; bottom: 12px; width: 36px; height: 36px; border-radius: 999px; background: var(--text); color: var(--on-accent);
  display: inline-flex; align-items: center; justify-content: center; transition: transform .2s;
}
.hiw-stage.sent .hiw-send { transform: scale(.82); }
.hiw-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.hiw-spark { width: 8px; height: 8px; border-radius: 999px; background: var(--text); animation: spark 1.2s ease-in-out infinite; }
@keyframes spark { 50% { transform: scale(.5); opacity: .45; } }
.hiw-count { margin-left: auto; font-size: 22px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.hiw-sq { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.hiw-sq li {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border: 1px solid var(--border); border-radius: 14px; font-size: 14.5px;
  opacity: 0; transform: translateX(-14px); transition: opacity .45s, transform .45s;
}
.hiw-sq li:nth-child(2) { transition-delay: .5s; }
.hiw-sq li:nth-child(3) { transition-delay: 1s; }
.hiw-stage[data-scene="1"] .hiw-sq li { opacity: 1; transform: none; }
.hiw-sq .n { flex: 0 0 24px; width: 24px; height: 24px; border-radius: 999px; border: 1.5px solid var(--text); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; }
.hiw-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.hiw-chip {
  position: relative; display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px 7px 12px; border: 1px solid var(--border); border-radius: 999px;
  font-size: 13px; color: var(--text); background: var(--surface); opacity: 0; transform: scale(.85);
  transition: opacity .3s, transform .3s, background .3s, border-color .3s; transition-delay: calc(var(--i) * 170ms);
}
.hiw-chip i { width: 8px; height: 8px; border-radius: 999px; }
.hiw-chip::after { content: "✓"; display: inline-block; width: 10px; font-size: 12px; font-weight: 700; opacity: 0; transition: opacity .3s; transition-delay: inherit; }
.hiw-chip.weak::after { content: "✕"; }
.hiw-stage[data-scene="2"] .hiw-chip, .hiw-stage[data-scene="3"] .hiw-chip { opacity: 1; transform: none; }
.hiw-stage[data-scene="3"] .hiw-chip { background: var(--bubble); border-color: transparent; }
.hiw-stage[data-scene="3"] .hiw-chip::after { opacity: 1; }
.hiw-stage[data-scene="3"] .hiw-chip.weak { opacity: .38; text-decoration: line-through; background: var(--surface); border-color: var(--border); transform: scale(.94); }
.hiw-doc { height: 100%; display: flex; flex-direction: column; gap: 14px; padding: 16px 18px; border: 1px solid var(--border); border-radius: 16px; }
.hiw-doc-title { font-size: 16px; font-weight: 600; }
.hiw-doc-body { flex: 1; display: grid; grid-template-columns: 1fr 120px; gap: 22px; min-height: 0; }
.hiw-line { position: relative; height: 9px; margin-bottom: 13px; width: 0; border-radius: 99px; background: var(--muted-fill); transition: width .7s ease; }
.hiw-line:nth-child(2) { transition-delay: .25s; }
.hiw-line:nth-child(3) { transition-delay: .5s; }
.hiw-line:nth-child(4) { transition-delay: .75s; }
.hiw-line:nth-child(5) { transition-delay: 1s; }
.hiw-stage[data-scene="4"] .hiw-line { width: var(--w); }
.hiw-cite {
  position: absolute; right: -9px; top: 50%; width: 18px; height: 18px; margin-top: -9px; border-radius: 6px; border: 1px solid var(--text);
  background: var(--surface); font-style: normal; font-size: 10.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
  opacity: 0; transform: scale(.5); transition: opacity .3s 1.5s, transform .3s 1.5s;
}
.hiw-stage[data-scene="4"] .hiw-cite { opacity: 1; transform: none; }
.hiw-chart { display: flex; align-items: flex-end; gap: 8px; padding: 0 4px; border-bottom: 1.5px solid var(--border-strong); }
.hiw-chart span { flex: 1; height: 0; border-radius: 5px 5px 0 0; background: var(--text); transition: height .8s cubic-bezier(.2, .8, .2, 1); }
.hiw-chart span:nth-child(1) { transition-delay: .9s; background: #c9c9c9; }
.hiw-chart span:nth-child(2) { transition-delay: 1.05s; background: #9a9a9a; }
.hiw-chart span:nth-child(3) { transition-delay: 1.2s; background: #5f5f5f; }
.hiw-chart span:nth-child(4) { transition-delay: 1.35s; }
.hiw-stage[data-scene="4"] .hiw-chart span { height: var(--h); }
.hiw-checked {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; background: #e9f7f1;
  color: #0b6b50; font-size: 13px; font-weight: 500; opacity: 0; transform: translateY(6px); transition: opacity .4s 2.3s, transform .4s 2.3s;
}
.hiw-stage[data-scene="4"] .hiw-checked { opacity: 1; transform: none; }
.hiw-steps { list-style: none; margin: 0; padding: 12px 16px 16px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; border-top: 1px solid var(--border); }
.hiw-steps li { position: relative; padding-top: 11px; font-size: 12.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hiw-steps li::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; border-radius: 99px; background: var(--border); transition: background .4s; }
.hiw-steps li.done { color: var(--text-2); }
.hiw-steps li.done::before { background: var(--text); }
.hiw-steps li.now { color: var(--text); font-weight: 600; }
.hiw-steps li.now::before { background: var(--text-2); animation: stepnow 1.2s ease-in-out infinite; }
@keyframes stepnow { 50% { opacity: .35; } }
@media (max-width: 760px) {
  .hiw { margin-top: 36px; border-radius: 18px; }
  .hiw-caption { white-space: normal; font-size: 13px; }
  .hiw-stage { height: 440px; }
  .hiw-chip { padding: 6px 10px; font-size: 12px; gap: 6px; }
  .hiw-sq li { padding: 9px 12px; font-size: 13.5px; }
  .hiw-q { top: 14px; right: 14px; max-width: 88%; font-size: 14px; }
  .hiw-panels { left: 14px; right: 14px; top: 118px; bottom: 14px; }
  .hiw-compose { top: -104px; }
  .hiw-doc-body { grid-template-columns: 1fr 72px; gap: 16px; }
  .hiw-steps { padding: 10px 12px 14px; gap: 5px; }
  .hiw-steps li { font-size: 11px; }
  .lp-links { gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .hiw *, .ai-badge svg { transition: none !important; animation: none !important; }
}

/* ---------- public home: the chat-style front page for visitors ---------- */
.pub-brand { display: inline-flex; align-items: center; gap: 10px; padding: 4px 6px; border-radius: 10px; font-weight: 600; font-size: 18px; color: var(--text); text-decoration: none; }
.pub-brand:hover { background: var(--hover); }
a.side-item { text-decoration: none; color: var(--text); }
.pub-side-bottom { padding: 10px; border-top: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 10px; }
.pub-cta { padding: 12px; border-radius: 14px; background: var(--surface); box-shadow: 0 0 0 1px var(--border); }
.pub-cta b { display: block; font-size: 14px; margin-bottom: 4px; }
.pub-cta p { margin: 0 0 10px; font-size: 13px; color: var(--text-2); line-height: 1.45; }
.pub-legal { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 0 4px 4px; font-size: 12px; }
.pub-legal a { color: var(--text-3); text-decoration: none; }
.pub-legal a:hover { color: var(--text); text-decoration: underline; }
.pub-main .topbar-right { align-items: center; gap: 8px; }
.pub-main .topbar .pub-brand { margin-left: 2px; }
.pub-brand.only-collapsed { display: none; }
.shell.collapsed .pub-brand.only-collapsed { display: inline-flex; }
.pub-center {
  flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  gap: 22px; padding: 11vh 16px 6vh;
}
.pub-center > * { width: 100%; max-width: 768px; }
.pub-title {
  margin: 0; display: flex; align-items: center; justify-content: center; gap: 12px; text-align: center;
  font-size: clamp(28px, 4.2vw, 44px); line-height: 1.12; font-weight: 600; letter-spacing: -.02em;
}
.pub-title svg { flex: 0 0 auto; width: .9em; height: .9em; animation: twinkle 2.4s ease-in-out infinite; }
.pub-sub { margin: -8px auto 4px; max-width: 620px !important; text-align: center; color: var(--text-2); font-size: 16px; line-height: 1.55; }
.pub-intro { margin: 10px auto 0; }
.pub-center .hiw { max-width: 720px; }
.pub-modal { max-width: 880px; max-height: min(760px, 92vh); }
.pub-modal .modal-body { padding: 20px 24px 26px; }
.pub-panel-lead { margin: 0 0 18px; color: var(--text-2); line-height: 1.6; }
.pub-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pub-steps > div, .pub-why > div { border: 1px solid var(--border); border-radius: 16px; padding: 16px; }
.pub-steps h3 { margin: 10px 0 6px; font-size: 16px; }
.pub-steps p, .pub-why p { margin: 0; color: var(--text-2); font-size: 14.5px; line-height: 1.55; }
.pub-h3 { margin: 24px 0 12px; font-size: 18px; }
.pub-why { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.pub-why b { display: block; margin-bottom: 6px; font-size: 15px; }
.pub-panel-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.pub-modal .lp-plans { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pub-modal .lp-faq { margin-top: 0; }
@media (max-width: 760px) {
  .pub-hide-xs { display: none; }
  .pub-steps, .pub-why, .pub-modal .lp-plans { grid-template-columns: 1fr; }
  .pub-center { justify-content: flex-start; padding-top: 8vh; }
  .pub-main .topbar .pub-brand span { display: none; }
  .pub-brand.only-collapsed { display: inline-flex; }
  .pub-title { font-size: 28px; }
}

/* ---------- compare page ---------- */
.cmp-wrap { max-width: 960px; margin: 0 auto; padding: 48px 24px 40px; }
.cmp-eyebrow { margin: 0 0 10px; font-size: 12.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); text-align: center; }
.cmp-wrap h1 { margin: 0 0 14px; text-align: center; font-size: clamp(30px, 4.6vw, 46px); line-height: 1.1; letter-spacing: -.02em; font-weight: 600; }
.cmp-lead { max-width: 680px; margin: 0 auto 30px; text-align: center; color: var(--text-2); font-size: 17px; line-height: 1.6; }
.cmp-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 22px; }
.cmp-tab { padding: 9px 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: 14.5px; color: var(--text-2); }
.cmp-tab:hover { background: var(--bubble); color: var(--text); }
.cmp-tab.on { background: var(--text); border-color: var(--text); color: var(--on-accent); }
.cmp-question { border: 1px solid var(--border); border-radius: 16px; padding: 14px 18px; background: var(--surface-2); margin-bottom: 16px; }
.cmp-q-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-3); margin-bottom: 4px; }
.cmp-question p { margin: 0; font-size: 15.5px; line-height: 1.55; }
.cmp-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 16px; }
.cmp-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.cmp-table th, .cmp-table td { padding: 11px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.cmp-table tbody tr:last-child th, .cmp-table tbody tr:last-child td { border-bottom: 0; }
.cmp-table thead th { background: var(--surface-2); font-size: 13px; color: var(--text-2); font-weight: 600; }
.cmp-table thead th.cmp-ours { color: var(--text); }
.cmp-table tbody th { font-weight: 500; color: var(--text-2); width: 36%; }
.cmp-table td.cmp-ours { background: var(--surface-2); font-weight: 600; }
.cmp-notes { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; }
.cmp-card { border: 1px solid var(--border); border-radius: 16px; padding: 16px 18px; }
.cmp-card h3 { margin: 0 0 8px; font-size: 15.5px; }
.cmp-card ul { margin: 0; padding-left: 18px; color: var(--text-2); line-height: 1.6; font-size: 14.5px; }
.cmp-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.cmp-method { margin-top: 44px; }
.cmp-method h2 { font-size: 22px; margin: 0 0 10px; }
.cmp-method ul { margin: 0; padding-left: 20px; color: var(--text-2); line-height: 1.7; }
.cmp-note { margin-top: 14px; font-size: 13px; color: var(--text-3); line-height: 1.55; }
.cmp-final { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 34px; }
@media (max-width: 760px) {
  .cmp-wrap { padding: 32px 16px 28px; }
  .cmp-notes { grid-template-columns: 1fr; }
  .cmp-table { font-size: 13.5px; }
  .cmp-table th, .cmp-table td { padding: 9px 10px; }
}
.guest-avatar { background: var(--bubble); color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; }
a.menu-item { text-decoration: none; color: var(--text); }
.menu-item.small { font-size: 13px; color: var(--text-2); padding-top: 6px; padding-bottom: 6px; }
#guest-menu { min-width: 236px; }
.pub-modal .setting-row { gap: 16px; }
.cmp-three tbody th { width: 30%; }
.cmp-three td, .cmp-three thead th { width: 23%; }
.cmp-card-main { border-color: var(--text); }
.cmp-fair { margin: 0; color: var(--text-2); line-height: 1.6; font-size: 14.5px; }

/* ---------- comparison teaser on the home screen ---------- */
.teaser-slot { width: 100%; max-width: 560px !important; margin: 4px auto 0; }
.teaser {
  display: block; position: relative; padding: 14px 16px 12px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface);
  color: var(--text); text-decoration: none; box-shadow: 0 8px 26px rgba(0, 0, 0, .06); transition: box-shadow .2s, transform .2s;
  animation: teaser-in .6s ease both;
}
.teaser:hover { box-shadow: 0 12px 32px rgba(0, 0, 0, .1); transform: translateY(-1px); }
@keyframes teaser-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.teaser-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.teaser-badge { font-size: 11.5px; font-weight: 600; letter-spacing: .02em; color: var(--text-2); text-transform: uppercase; }
.teaser-close { width: 28px; height: 28px; margin: -4px -6px -4px 0; border-radius: 8px; color: var(--text-3); display: inline-flex; align-items: center; justify-content: center; }
.teaser-close:hover { background: var(--hover); color: var(--text); }
.teaser-title { margin: 4px 0 2px; font-size: 16px; font-weight: 600; }
.teaser-metric { font-size: 13px; color: var(--text-2); margin-bottom: 8px; min-height: 18px; }
.teaser-bars { display: grid; gap: 7px; }
.teaser-row { display: grid; grid-template-columns: 150px 1fr 92px; align-items: center; gap: 10px; font-size: 13px; }
.teaser-name { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.teaser-row.ours .teaser-name { color: var(--text); font-weight: 600; }
.teaser-track { height: 9px; border-radius: 99px; background: var(--muted-fill); overflow: hidden; }
.teaser-fill { display: block; height: 100%; width: 0; border-radius: 99px; background: #b9b9b9; transition: width .9s cubic-bezier(.2, .8, .2, 1); }
.teaser-row.ours .teaser-fill { background: var(--text); }
.teaser-value { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.teaser-value.muted-value { font-weight: 400; color: var(--text-3); font-size: 12px; }
.teaser-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.teaser-cta { font-size: 13.5px; font-weight: 600; }
.teaser-dots { display: inline-flex; gap: 5px; }
.teaser-dots i { width: 6px; height: 6px; border-radius: 99px; background: var(--border-strong); transition: background .3s; }
.teaser-dots i.on { background: var(--text); }
.home-center .teaser-slot { margin-top: 0; }
@media (max-width: 760px) {
  .teaser-row { grid-template-columns: 96px 1fr 72px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) { .teaser, .teaser-fill { animation: none; transition: none; } }
.cmp-notes:has(> :only-child) { grid-template-columns: 1fr; }

/* ---------- dark theme: chosen in settings, or following the device when set to "system" ---------- */
:root[data-theme="dark"] {
  --bg: #212121; --sidebar: #171717; --text: #ececec; --text-2: #b4b4b4; --text-3: #8e8e8e;
  --border: #383838; --border-strong: #4a4a4a; --hover: #2c2c2c; --active: #343434; --bubble: #303030;
  --accent: #ececec; --on-accent: #171717; --surface: #2b2b2b; --surface-2: #262626; --line-soft: #2e2e2e;
  --muted-fill: #3a3a3a; --nav-bg: rgba(33, 33, 33, .92);
  --shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 6px 24px rgba(0, 0, 0, .35);
  --shadow-menu: 0 0 0 1px rgba(255, 255, 255, .09), 0 10px 32px rgba(0, 0, 0, .5);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #212121; --sidebar: #171717; --text: #ececec; --text-2: #b4b4b4; --text-3: #8e8e8e;
    --border: #383838; --border-strong: #4a4a4a; --hover: #2c2c2c; --active: #343434; --bubble: #303030;
    --accent: #ececec; --on-accent: #171717; --surface: #2b2b2b; --surface-2: #262626; --line-soft: #2e2e2e;
    --muted-fill: #3a3a3a; --nav-bg: rgba(33, 33, 33, .92);
    --shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 6px 24px rgba(0, 0, 0, .35);
    --shadow-menu: 0 0 0 1px rgba(255, 255, 255, .09), 0 10px 32px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] .verify-banner { background: #3a2f17; color: #f3d19c; }
:root[data-theme="dark"] .login-notice.ok, :root[data-theme="dark"] .hiw-checked { background: #173a2e; color: #8fe0c0; }
:root[data-theme="dark"] .hiw-chart span:nth-child(1) { background: #555; }
:root[data-theme="dark"] .hiw-chart span:nth-child(2) { background: #7a7a7a; }
:root[data-theme="dark"] .hiw-chart span:nth-child(3) { background: #a5a5a5; }
:root[data-theme="dark"] .teaser-fill { background: #6a6a6a; }
:root[data-theme="dark"] .teaser-row.ours .teaser-fill { background: var(--text); }
:root[data-theme="dark"] .lp-brand img, :root[data-theme="dark"] .pub-brand img, :root[data-theme="dark"] .brand img { filter: brightness(1.15); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .verify-banner { background: #3a2f17; color: #f3d19c; }
  :root:not([data-theme="light"]) .login-notice.ok, :root:not([data-theme="light"]) .hiw-checked { background: #173a2e; color: #8fe0c0; }
  :root:not([data-theme="light"]) .teaser-fill { background: #6a6a6a; }
  :root:not([data-theme="light"]) .teaser-row.ours .teaser-fill { background: var(--text); }
}
.theme-select { height: 34px; border-radius: 10px; border: 1px solid var(--border-strong); padding: 0 10px; background: var(--surface); color: var(--text); }
.help-contact { margin: 16px 0 0; font-size: 14px; color: var(--text-2); }
.help-contact a { color: var(--text); font-weight: 600; }
/* ---------- launch offer pop-up (public home) ---------- */
.offer-overlay { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(0, 0, 0, .55); animation: offer-fade .2s ease both; }
.offer-overlay.leaving { animation: offer-fade .2s ease reverse both; }
.offer-box { position: relative; width: 100%; max-width: 440px; padding: 34px 30px 22px; border-radius: 22px; text-align: center;
  background: var(--surface); color: var(--text); box-shadow: 0 24px 64px rgba(0, 0, 0, .35); animation: offer-pop .32s cubic-bezier(.2, .9, .3, 1.2) both; }
.offer-x { position: absolute; top: 12px; right: 14px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent;
  color: var(--text-2); font-size: 24px; line-height: 1; cursor: pointer; }
.offer-x:hover { background: var(--hover); color: var(--text); }
.offer-gift { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 18px; display: flex; align-items: center; justify-content: center;
  background: var(--text); color: var(--on-accent); }
.offer-badge { display: inline-block; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--border-strong);
  font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); }
.offer-title { margin: 14px 0 10px; font-size: 26px; line-height: 1.2; font-weight: 700; }
.offer-text { margin: 0 0 22px; color: var(--text-2); font-size: 15px; line-height: 1.55; }
.offer-cta { display: flex; justify-content: center; width: 100%; height: 46px; align-items: center; font-size: 16px; text-decoration: none; }
.offer-later { margin-top: 10px; border: 0; background: transparent; color: var(--text-3); font-size: 14px; cursor: pointer; padding: 6px 10px; }
.offer-later:hover { color: var(--text); }
@keyframes offer-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes offer-pop { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
@media (max-width: 480px) { .offer-box { padding: 30px 20px 18px; } .offer-title { font-size: 22px; } }
.featured-on { margin: 0; padding: 0 16px 12px; text-align: center; line-height: 0; opacity: .85; }
.featured-on:hover { opacity: 1; }
