/* =========================================================================
   AMICORTEX WEB — STYLES
   Gemini-style layout in the Amicortex palette (Theme.kt neutrals + the
   chosen accent). The accent is only for buttons, links, active chips and
   small highlights; surfaces stay neutral. Mobile first, then laptop.
   ========================================================================= */

:root {
  --font: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  --accent: #B9A5FF; --accent-end: #F9A8D4; --on-accent: #15151A; --accent-soft: #2C2642;
  --brand-a: #B9A5FF; --brand-b: #F9A8D4;
  --sb-w: 284px; --rail-w: 68px; --top-h: 60px; --content: 780px;
  --r-lg: 28px; --r-md: 18px; --r-sm: 12px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --tb-h: 0px;
}

:root[data-theme="dark"] {
  --bg: #101014; --bg-2: #0C0C10; --surface: #17171C; --surface-2: #1C1C22; --bubble: #1E1E25;
  --composer: #1D1D24; --border: #2A2A32; --border-2: #34343E;
  --text: #F0F0F3; --dim: #9B9BA6; --dim-2: #6F6F7A;
  --danger: #FF7A7A; --ok: #5FDDAE;
  --hover: rgba(255, 255, 255, .06); --press: rgba(255, 255, 255, .1);
  --shadow: 0 18px 50px rgba(0, 0, 0, .55), 0 2px 8px rgba(0, 0, 0, .4);
  --glow-a: 26%; --glow-b: 12%;
  --brand-ink: #F0F0F3;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #FFFFFF; --bg-2: #F7F7F9; --surface: #F4F4F7; --surface-2: #ECECF1; --bubble: #F1F1F5;
  --composer: #F2F2F6; --border: #E3E3E9; --border-2: #D6D6DE;
  --text: #15151A; --dim: #6B6B76; --dim-2: #9A9AA5;
  --danger: #D93B3B; --ok: #0F8A5F;
  --hover: rgba(20, 20, 30, .05); --press: rgba(20, 20, 30, .09);
  --shadow: 0 18px 50px rgba(30, 20, 60, .14), 0 2px 8px rgba(30, 20, 60, .08);
  --glow-a: 14%; --glow-b: 7%;
  --brand-ink: #241C33;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; overflow: hidden;
  text-rendering: optimizeLegibility;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
button:disabled { cursor: default; opacity: .5; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--border-2) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-track { background: transparent; }

.ic { width: 20px; height: 20px; flex: none; display: block; }
.grow { flex: 1; }

/* ---------------- installed-app title bar (Window Controls Overlay) ---------------- */
.titlebar { display: none; }
.wco { --tb-h: env(titlebar-area-height, 36px); }
.wco .titlebar {
  display: flex; align-items: center; gap: 8px; position: fixed; top: 0;
  left: env(titlebar-area-x, 0); width: env(titlebar-area-width, 100%); height: env(titlebar-area-height, 36px);
  padding: 0; background: linear-gradient(90deg, var(--surface) 0 calc(var(--sb-w) - env(titlebar-area-x, 0px)), var(--bg) calc(var(--sb-w) - env(titlebar-area-x, 0px)));
  -webkit-app-region: drag; app-region: drag; z-index: 5; user-select: none;
}
.wco .titlebar .logo-mark { width: 15px; height: 15px; }
.wco #app { padding-top: var(--tb-h); height: 100%; }

#app { height: 100%; }

/* ---------------- boot ---------------- */
.boot { height: 100%; display: grid; place-items: center; }
.boot-mark { width: 54px; height: 54px; animation: breathe 1.6s var(--ease) infinite; }
@keyframes breathe { 0%, 100% { transform: scale(.92); opacity: .65; } 50% { transform: scale(1); opacity: 1; } }

.logo-mark { width: 26px; height: 26px; flex: none; display: block; }
.logo-mark.lg { width: 40px; height: 40px; }

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 20px;
  border-radius: 999px; font-weight: 600; font-size: 14.5px; transition: background .15s, transform .1s, opacity .15s; white-space: nowrap;
}
.btn:active { transform: scale(.98); }
.btn.sm { height: 34px; padding: 0 14px; font-size: 13.5px; }
.btn.block { width: 100%; height: 48px; font-size: 15px; }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: var(--hover); color: var(--text); }
.btn.ghost:hover { background: var(--press); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger-ghost { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.btn.loading { opacity: .75; pointer-events: none; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 999px; display: inline-grid; place-items: center; color: var(--dim);
  transition: background .15s, color .15s; flex: none;
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn.sm { width: 32px; height: 32px; }
.icon-btn.sm .ic { width: 17px; height: 17px; }
.link-btn { color: var(--accent); font-weight: 600; }
.link-btn:hover { text-decoration: underline; }
.link-btn.right { align-self: flex-end; font-size: 13.5px; }

/* ---------------- fields ---------------- */
.field {
  width: 100%; height: 48px; padding: 0 16px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--border);
  outline: none; transition: border .15s, box-shadow .15s; font-size: 15px;
}
textarea.field { height: auto; padding: 12px 16px; resize: vertical; min-height: 84px; }
.field:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.field::placeholder { color: var(--dim-2); }

/* =========================================================================
   AUTH
   ========================================================================= */
.auth-page { position: relative; height: 100%; overflow: auto; display: grid; place-items: center; padding: 32px 16px; }
.glow {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(60% 50% at 50% 62%, color-mix(in srgb, var(--accent) var(--glow-a), transparent) 0%, transparent 70%),
    radial-gradient(40% 35% at 70% 75%, color-mix(in srgb, var(--accent-end) var(--glow-b), transparent) 0%, transparent 70%);
  filter: blur(10px);
}
.auth-wrap { position: relative; z-index: 1; width: 100%; max-width: 420px; display: flex; flex-direction: column; align-items: center; gap: 22px; }
.auth-brand { display: flex; align-items: center; gap: 12px; font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.auth-card {
  width: 100%; background: color-mix(in srgb, var(--surface) 88%, transparent); border: 1px solid var(--border); border-radius: 26px;
  padding: 30px 26px; box-shadow: var(--shadow); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.auth-title { margin: 0 0 6px; font-size: 24px; font-weight: 700; letter-spacing: -.02em; text-align: center; }
.auth-sub { margin: 0 0 22px; color: var(--dim); text-align: center; font-size: 14.5px; }
.auth-ic { width: 52px; height: 52px; border-radius: 16px; margin: 0 auto 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.auth-ic .ic { width: 26px; height: 26px; }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.f { position: relative; display: flex; flex-direction: column; gap: 6px; }
.f-label { font-size: 13px; font-weight: 600; color: var(--dim); padding-left: 4px; }
.f-eye { position: absolute; right: 10px; bottom: 9px; height: 30px; padding: 0 10px; border-radius: 10px; font-size: 12.5px; font-weight: 600; color: var(--dim); }
.f-eye:hover { background: var(--hover); color: var(--text); }
.f-hint { margin: -4px 0 0 4px; font-size: 12.5px; color: var(--dim-2); }
.code-field { text-align: center; font-size: 26px; letter-spacing: .5em; font-weight: 700; height: 60px; padding-left: calc(16px + .5em); }
.auth-error { color: var(--danger); font-size: 13.5px; padding: 2px 4px; }
.auth-switch { margin: 16px 0 0; text-align: center; font-size: 14px; color: var(--dim); }
.auth-legal { font-size: 12.5px; color: var(--dim-2); text-align: center; max-width: 340px; }
.auth-legal a { color: var(--dim); text-decoration: underline; }
.or { display: flex; align-items: center; gap: 12px; color: var(--dim-2); font-size: 12.5px; margin: 18px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.g-wrap { display: flex; justify-content: center; min-height: 44px; }
/* Google draws its button in a light-scheme iframe; matching the scheme stops the browser painting a white box behind it */
.g-btn { color-scheme: light; background: transparent; border-radius: 999px; overflow: hidden; }
.g-off { font-size: 13px; color: var(--dim); text-align: center; }

/* =========================================================================
   SHELL
   ========================================================================= */
.shell { display: flex; height: 100%; position: relative; }

.sidebar {
  width: var(--sb-w); flex: none; height: 100%; background: var(--surface); display: flex; flex-direction: column;
  padding: 10px 10px 10px; transition: width .25s var(--ease), transform .25s var(--ease); z-index: 30; overflow: hidden;
}
.sb-top { display: flex; align-items: center; gap: 4px; height: 48px; padding: 0 2px; }
.sb-brand { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; color: var(--text); font-weight: 700; font-size: 18px; letter-spacing: -.02em; padding: 6px 6px; border-radius: 12px; }
.sb-brand:hover { text-decoration: none; }
.sb-brand .logo-mark { width: 24px; height: 24px; }
.sb-name { white-space: nowrap; }
.stg-badge { font-size: 9.5px; font-weight: 700; letter-spacing: .06em; padding: 3px 6px; border-radius: 6px; background: #E0A526; color: #1a1300; }
.sb-toggle { order: 3; }
.sb-search { order: 2; }
.sb-nav { display: flex; flex-direction: column; gap: 2px; margin-top: 10px; }
.sb-item {
  display: flex; align-items: center; gap: 14px; height: 44px; padding: 0 14px; border-radius: 999px; color: var(--text);
  font-weight: 500; font-size: 14.5px; text-align: left; white-space: nowrap; transition: background .15s;
}
.sb-item:hover { background: var(--hover); }
.sb-item.active { background: var(--accent-soft); color: var(--text); }
.sb-item .sb-ic { color: var(--dim); display: grid; place-items: center; }
.sb-item.active .sb-ic { color: var(--accent); }
.sb-tx { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.sb-hint { font-size: 11.5px; color: var(--dim-2); opacity: 0; transition: opacity .15s; }
.sb-item:hover .sb-hint { opacity: 1; }
.sb-item.rail-only { display: none; }
.sb-label { margin: 20px 14px 6px; font-size: 12.5px; font-weight: 600; color: var(--dim); white-space: nowrap; }
.sb-list { flex: 1; overflow-y: auto; overflow-x: hidden; margin: 0 -4px; padding: 0 4px 8px; }
.sb-group { font-size: 11.5px; font-weight: 600; color: var(--dim-2); padding: 14px 14px 6px; letter-spacing: .02em; }
.sb-chat { display: flex; align-items: center; border-radius: 999px; position: relative; }
.sb-chat:hover { background: var(--hover); }
.sb-chat.active { background: var(--accent-soft); }
.sb-chat-link { flex: 1; min-width: 0; display: block; padding: 9px 6px 9px 14px; color: var(--text); font-size: 14px; }
.sb-chat-link:hover { text-decoration: none; }
.sb-chat-link span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-more { opacity: 0; margin-right: 4px; }
.sb-chat:hover .sb-more, .sb-chat.active .sb-more, .sb-more:focus-visible { opacity: 1; }
.sb-empty { padding: 14px; font-size: 13px; color: var(--dim-2); display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.sb-bottom { display: flex; align-items: center; gap: 4px; padding-top: 8px; border-top: 1px solid var(--border); margin-top: 6px; }
.sb-user { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 999px; text-align: left; }
.sb-user:hover { background: var(--hover); }
.sb-uname { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; font-size: 14.5px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; flex: none; object-fit: cover; }
.avatar.initials { display: grid; place-items: center; font-weight: 700; font-size: 13px; color: var(--on-accent); background: linear-gradient(135deg, var(--accent), var(--accent-end)); }
.avatar.lg { width: 56px; height: 56px; font-size: 19px; }

/* collapsed rail (laptop) */
.shell.collapsed .sidebar { width: var(--rail-w); padding: 10px 10px; }
.shell.collapsed .sb-top { flex-direction: column; height: auto; gap: 6px; }
.shell.collapsed .sb-brand, .shell.collapsed .sb-search { display: none; }
.shell.collapsed .sb-toggle { order: 0; }
.shell.collapsed .sb-item { width: 48px; padding: 0; justify-content: center; }
.shell.collapsed .sb-item .sb-tx, .shell.collapsed .sb-item .sb-hint { display: none; }
.shell.collapsed .sb-item.rail-only { display: flex; }
.shell.collapsed .sb-label, .shell.collapsed .sb-list { visibility: hidden; }
.shell.collapsed .sb-bottom { flex-direction: column-reverse; border-top: 0; gap: 8px; }
.shell.collapsed .sb-user { padding: 4px; flex: none; }
.shell.collapsed .sb-uname { display: none; }

.sb-scrim { display: none; }

/* ---------------- main ---------------- */
.main { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; position: relative; background: var(--bg); }
.topbar { height: var(--top-h); flex: none; display: flex; align-items: center; gap: 8px; padding: 0 16px; position: relative; z-index: 5; }
.top-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; }
.top-title .logo-mark { width: 22px; height: 22px; }
.top-pill {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: 999px; font-weight: 600; font-size: 14.5px;
  transition: filter .15s, background .15s, transform .1s;
}
.top-pill:active { transform: scale(.98); }
.top-pill .ic { width: 18px; height: 18px; }
.top-pill.ghost { background: var(--surface); color: var(--text); }
.top-pill.ghost:hover { background: var(--surface-2); }
.top-pill.upgrade { background: linear-gradient(135deg, var(--accent), var(--accent-end)); color: var(--on-accent); box-shadow: 0 6px 22px color-mix(in srgb, var(--accent) 30%, transparent); }
.top-pill.upgrade:hover { filter: brightness(1.06); }
.top-pill.plan { background: var(--accent-soft); color: var(--accent); }
.only-mobile { display: none !important; }

.view { flex: 1; min-height: 0; position: relative; }

/* =========================================================================
   CHAT
   ========================================================================= */
.chat { position: absolute; inset: 0; display: flex; flex-direction: column; }
.chat > .glow { opacity: 0; transition: opacity .5s; }
.chat.empty > .glow { opacity: 1; }
.thread-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; position: relative; z-index: 1; scroll-behavior: auto; }
.thread { max-width: var(--content); margin: 0 auto; padding: 8px 24px 28px; display: flex; flex-direction: column; gap: 26px; }
.hero { display: none; position: relative; z-index: 1; text-align: center; padding: 0 24px; }
.chat.empty { justify-content: center; }
.chat.empty .thread-scroll { display: none; }
.chat.empty .hero { display: block; margin-bottom: 28px; margin-top: -8vh; }
.hero-title { margin: 0; font-size: clamp(30px, 4.2vw, 46px); font-weight: 600; letter-spacing: -.03em; line-height: 1.15; }
.grad { background: linear-gradient(90deg, var(--accent) 0%, var(--accent-end) 55%, var(--accent) 100%); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: gradmove 8s linear infinite; }
@keyframes gradmove { to { background-position: -200% 0; } }
.hero-sub { margin: 10px 0 0; color: var(--dim); font-size: clamp(17px, 2vw, 21px); }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 26px; }
.chip {
  height: 40px; padding: 0 18px; border-radius: 999px; background: color-mix(in srgb, var(--surface) 80%, transparent); border: 1px solid var(--border);
  font-size: 14px; font-weight: 500; color: var(--text); transition: background .15s, border-color .15s, transform .1s;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.chip:hover { background: var(--surface-2); border-color: var(--border-2); }
.chip:active { transform: scale(.98); }

/* composer */
.composer-wrap { position: relative; z-index: 2; padding: 0 24px 10px; }
.composer {
  max-width: var(--content); margin: 0 auto; background: var(--composer); border-radius: var(--r-lg); padding: 10px 10px 8px 12px;
  border: 1px solid var(--border); box-shadow: 0 10px 40px rgba(0, 0, 0, .18); transition: border-color .15s, box-shadow .2s;
}
.composer:focus-within { border-color: var(--border-2); box-shadow: 0 10px 40px rgba(0, 0, 0, .22), 0 0 0 4px color-mix(in srgb, var(--accent) 10%, transparent); }
.chat.drag .composer { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.composer-input {
  width: 100%; border: 0; outline: none; background: transparent; resize: none; font-size: 16px; line-height: 1.55;
  padding: 8px 8px 6px; max-height: 35vh; min-height: 30px; display: block;
}
.composer-input::placeholder { color: var(--dim); }
.composer-row { display: flex; align-items: center; gap: 4px; }
.model-btn { display: inline-flex; align-items: center; gap: 4px; height: 38px; padding: 0 10px 0 14px; border-radius: 999px; font-weight: 600; font-size: 14px; color: var(--text); }
.model-btn:hover { background: var(--hover); }
.model-btn .mb-ic .ic { width: 17px; height: 17px; color: var(--dim); }
.mic-btn.on { color: var(--danger); background: color-mix(in srgb, var(--danger) 14%, transparent); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--danger) 10%, transparent); } }
.send-btn {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; margin-left: 2px;
  background: var(--hover); color: var(--dim-2); transition: background .15s, color .15s, transform .1s; pointer-events: none;
}
.send-btn.ready { background: var(--accent); color: var(--on-accent); pointer-events: auto; }
.send-btn.ready:active { transform: scale(.94); }
.send-btn.stop { background: var(--text); color: var(--bg); pointer-events: auto; }
.disclaimer { text-align: center; font-size: 12px; color: var(--dim-2); padding-top: 8px; }
.chat.empty .disclaimer { visibility: hidden; }
.attach-row { padding: 4px 4px 6px; display: flex; gap: 8px; }
.attach-chip { position: relative; width: 64px; height: 64px; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); }
.attach-chip img { width: 100%; height: 100%; object-fit: cover; display: block; }
.attach-x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; background: rgba(0, 0, 0, .65); color: #fff; display: grid; place-items: center; }
.attach-x .ic { width: 14px; height: 14px; }

.jump-btn {
  position: absolute; left: 50%; bottom: 120px; transform: translate(-50%, 10px); z-index: 3; width: 38px; height: 38px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--border); display: grid; place-items: center; color: var(--text); opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; box-shadow: var(--shadow);
}
.jump-btn.show { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.jump-btn .ic { width: 18px; height: 18px; }

/* messages */
.msg { display: flex; gap: 14px; animation: rise .28s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.msg.user { flex-direction: column; align-items: flex-end; gap: 4px; }
.bubble {
  max-width: min(78%, 620px); padding: 11px 18px; border-radius: 22px 22px 6px 22px; font-size: 15.5px; line-height: 1.6;
  border: 1px solid transparent;
  background: linear-gradient(var(--bubble), var(--bubble)) padding-box,
              linear-gradient(135deg, color-mix(in srgb, var(--accent) 45%, transparent), color-mix(in srgb, var(--accent-end) 35%, transparent)) border-box;
}
.bubble.card-bubble { padding: 0; background: none; border: 0; max-width: min(78%, 360px); }
.user-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-actions { display: flex; gap: 2px; opacity: 0; transition: opacity .15s; margin-top: 2px; }
.msg:hover .msg-actions, .msg-actions:focus-within { opacity: 1; }
.msg.ai { align-items: flex-start; }
.ai-avatar { width: 32px; height: 32px; flex: none; display: grid; place-items: center; margin-top: 1px; }
.ai-avatar .logo-mark { width: 24px; height: 24px; }
.ai-avatar.thinking .logo-mark { animation: think 1.6s var(--ease) infinite; }
@keyframes think { 0% { transform: rotate(0) scale(.9); } 50% { transform: rotate(180deg) scale(1.05); } 100% { transform: rotate(360deg) scale(.9); } }
.ai-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }
.msg.ai .msg-actions { margin-left: -6px; }
.msg.note { justify-content: center; }
.divider-note { display: flex; align-items: center; gap: 12px; width: 100%; color: var(--dim); font-size: 12.5px; font-weight: 600; }
.divider-note::before, .divider-note::after { content: ""; flex: 1; height: 1.5px; }
.divider-note::before { background: linear-gradient(90deg, transparent, var(--accent)); }
.divider-note::after { background: linear-gradient(90deg, var(--accent-end), transparent); }
.divider-note span { padding: 4px 12px; border-radius: 999px; background: var(--accent-soft); }

.status-line { display: flex; align-items: center; gap: 10px; color: var(--dim); font-size: 14.5px; min-height: 26px; }
.sl-ic .ic { width: 18px; height: 18px; color: var(--accent); }
.spin-soft { animation: spin 2.4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.sl-favs { display: flex; }
.sl-favs img { width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 2px solid var(--bg); margin-left: -6px; }
.sl-favs img:first-child { margin-left: 0; }
/* ★ 1.0.18 Gemini-style shimmer: a bright band sweeps across the words
   (the old gradient was too soft to notice on dark screens) */
.shimmer {
  background: linear-gradient(100deg, var(--dim) 0%, var(--dim) 38%, var(--text) 47%, #fff 50%, var(--text) 53%, var(--dim) 62%, var(--dim) 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
  animation: shimmer 1.8s linear infinite; font-weight: 500;
}
:root[data-theme="light"] .shimmer { background-image: linear-gradient(100deg, var(--dim) 0%, var(--dim) 38%, var(--text) 47%, #000 50%, var(--text) 53%, var(--dim) 62%, var(--dim) 100%); }
@media (prefers-reduced-motion: reduce) { .shimmer { animation: none; background: none; color: var(--dim); -webkit-text-fill-color: currentColor; } }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.img-forming {
  width: min(100%, 360px); aspect-ratio: 1; border-radius: 20px; position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--accent-soft), color-mix(in srgb, var(--accent-end) 18%, var(--surface)));
}
.img-forming::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, .22) 50%, transparent 80%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }

/* rich text */
.rich { font-size: 15.5px; line-height: 1.72; overflow-wrap: anywhere; }
.rich > :first-child { margin-top: 0; }
.rich > :last-child { margin-bottom: 0; }
.rich p { margin: 0 0 .85em; }
.rich h1, .rich h2, .rich h3, .rich h4 { line-height: 1.3; letter-spacing: -.015em; margin: 1.3em 0 .5em; font-weight: 700; }
.rich h1 { font-size: 1.45em; } .rich h2 { font-size: 1.28em; } .rich h3 { font-size: 1.12em; } .rich h4 { font-size: 1em; }
.rich ul, .rich ol { margin: 0 0 .85em; padding-left: 1.4em; }
.rich li { margin: .28em 0; }
.rich li::marker { color: var(--dim); }
.rich blockquote { margin: 0 0 .85em; padding: 4px 0 4px 16px; border-left: 3px solid var(--accent); color: var(--dim); }
.rich hr { border: 0; height: 1px; background: var(--border); margin: 1.4em 0; }
.rich strong { font-weight: 700; }
.rich a { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent); text-underline-offset: 3px; }
.rich :not(pre) > code { font-family: var(--mono); font-size: .87em; background: var(--surface-2); padding: .14em .42em; border-radius: 6px; }
.table-wrap { overflow-x: auto; margin: 0 0 1em; border: 1px solid var(--border); border-radius: 14px; }
.rich table { border-collapse: collapse; width: 100%; font-size: .94em; }
.rich th, .rich td { padding: 10px 14px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.rich th { background: var(--surface); font-weight: 600; }
.rich tr:last-child td { border-bottom: 0; }
.code-block { margin: 0 0 1em; border-radius: 16px; overflow: hidden; background: #0D0D12; border: 1px solid var(--border); }
:root[data-theme="light"] .code-block { border-color: #1f1f28; }
.code-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 6px 16px; background: #17171E; color: #9B9BA6; font-size: 12.5px; }
.code-lang { font-family: var(--mono); }
.code-copy { height: 28px; padding: 0 10px; border-radius: 8px; color: #C9C9D2; font-weight: 600; font-size: 12.5px; }
.code-copy:hover { background: rgba(255, 255, 255, .08); }
.code-block pre { margin: 0; padding: 14px 16px 16px; overflow-x: auto; }
.code-block code.hljs { font-family: var(--mono); font-size: 13.5px; line-height: 1.6; background: transparent; padding: 0; color: #E6E6EC; }
.math-display { overflow-x: auto; overflow-y: hidden; margin: .4em 0 1em; padding: 2px 0; }
.katex { font-size: 1.08em; }
.svg-card { background: #fff; border-radius: 16px; padding: 14px; margin: 0 0 1em; border: 1px solid var(--border); max-width: 520px; }
.svg-card svg { width: 100%; height: auto; display: block; }
.web-fig { margin: 0 0 1em; max-width: 460px; border-radius: 16px; overflow: hidden; border: 1px solid var(--border); background: var(--surface); }
.web-fig img { display: block; width: 100%; max-height: 420px; object-fit: contain; background: #fff; cursor: zoom-in; }
.web-fig figcaption { padding: 8px 12px; font-size: 12.5px; color: var(--dim); display: flex; gap: 8px; flex-wrap: wrap; }
.fig-title { color: var(--text); font-weight: 500; }
.gsearch { width: 100%; height: 64px; border: 0; border-radius: 14px; background: transparent; display: block; margin: 0 0 .6em; }

/* cards */
.card { border: 1px solid var(--border); background: var(--surface); border-radius: 18px; }
.image-card { margin: 0; overflow: hidden; max-width: 420px; }
.gen-img { display: block; width: 100%; cursor: zoom-in; background: var(--surface-2); min-height: 120px; }
.ic-bar { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 4px 14px; }
.ai-label { font-size: 12px; color: var(--dim); font-weight: 500; }
.failed-card { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; color: var(--text); background: color-mix(in srgb, var(--danger) 9%, var(--surface)); border-color: color-mix(in srgb, var(--danger) 30%, var(--border)); font-size: 14.5px; }
.failed-card .fc-ic { color: var(--danger); }
.upgrade-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, var(--surface)), color-mix(in srgb, var(--accent-end) 8%, var(--surface))); }
.uc-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--on-accent); background: linear-gradient(135deg, var(--accent), var(--accent-end)); flex: none; }
.uc-tx { flex: 1; min-width: 0; font-size: 14.5px; }
.uc-tx p { margin: 2px 0 0; color: var(--dim); font-size: 13.5px; }
.file-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; max-width: 420px; color: var(--text); }
.file-card.link:hover { background: var(--surface-2); text-decoration: none; }
.fc-ic { width: 38px; height: 38px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.fc-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 14px; }
.fc-tx strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc-tx span { color: var(--dim); font-size: 12.5px; }
.fc-go { color: var(--dim); }
.mc-thumb { width: 54px; height: 40px; border-radius: 8px; object-fit: cover; }
.media-card { padding: 14px; max-width: 440px; display: flex; flex-direction: column; gap: 10px; }
.mc-head { display: flex; align-items: center; gap: 12px; }
.mc-head > div { display: flex; flex-direction: column; }
.mc-ic { width: 38px; height: 38px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.media-card audio { width: 100%; }
.media-card video { width: 100%; border-radius: 12px; background: #000; max-height: 480px; }
.vc-state { color: var(--dim); font-size: 14px; }
.lyrics summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 13.5px; }
.lyrics pre { white-space: pre-wrap; font-family: var(--font); font-size: 14px; color: var(--dim); margin: 8px 0 0; }
.run-card { max-width: 100%; overflow: hidden; }
.run-card summary { display: flex; align-items: center; gap: 10px; padding: 11px 14px; cursor: pointer; font-size: 14px; font-weight: 600; list-style: none; }
.run-card summary::-webkit-details-marker { display: none; }
.rc-ic { color: var(--ok); display: grid; }
.run-card.failed .rc-ic { color: var(--danger); }
.rc-lang { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--dim); font-weight: 400; }
.rc-code, .rc-out pre { margin: 0; padding: 12px 14px; font-family: var(--mono); font-size: 12.5px; overflow-x: auto; background: var(--bg-2); border-top: 1px solid var(--border); white-space: pre; }
.rc-label { padding: 8px 14px 0; font-size: 12px; color: var(--dim); background: var(--bg-2); border-top: 1px solid var(--border); }
.rc-files { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--border); }
.rc-img { max-width: 220px; border-radius: 10px; cursor: zoom-in; background: #fff; }
.site-card { display: flex; align-items: center; gap: 14px; padding: 10px; max-width: 460px; color: var(--text); }
.site-card:hover { background: var(--surface-2); text-decoration: none; }
.sc-shot { width: 92px; height: 64px; border-radius: 10px; object-fit: cover; object-position: top; flex: none; background: var(--surface-2); }
.sc-shot.ph { display: grid; place-items: center; color: var(--accent); }
.sc-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 14px; }
.sc-tx span { color: var(--dim); font-size: 12.5px; }

.thread-loading { display: flex; flex-direction: column; gap: 14px; padding-top: 30px; }
.skel { height: 16px; border-radius: 8px; background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
.skel.short { width: 55%; }
.thread-empty { color: var(--dim); text-align: center; padding: 60px 0; display: flex; flex-direction: column; align-items: center; gap: 12px; }

/* =========================================================================
   PAGES (Library)
   ========================================================================= */
.page { position: absolute; inset: 0; overflow-y: auto; padding: 8px 32px 40px; }
.page-head { max-width: 1100px; margin: 0 auto 22px; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-title { margin: 0; font-size: 30px; font-weight: 700; letter-spacing: -.025em; }
.lib-count { color: var(--dim); font-size: 14px; }
.page-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--surface); border-radius: 999px; padding: 4px; gap: 2px; flex-wrap: wrap; }
.seg-btn { height: 34px; padding: 0 14px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--dim); display: inline-flex; align-items: center; gap: 6px; }
.seg-btn .ic { width: 16px; height: 16px; }
.seg-btn:hover { color: var(--text); }
.seg-btn.on { background: var(--bg); color: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, .18); }
:root[data-theme="dark"] .seg-btn.on { background: var(--surface-2); }
.lib-grid { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.lib-tile { position: relative; aspect-ratio: 1; border-radius: 18px; overflow: hidden; background: var(--surface); transition: transform .15s; }
.lib-tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s var(--ease); }
.lib-tile:hover img { transform: scale(1.04); }
.lib-tile.skel { animation: shimmer 1.3s linear infinite; }
.lib-tile.chosen { outline: 3px solid var(--accent); outline-offset: -3px; }
.lib-check { position: absolute; top: 10px; right: 10px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, .5); color: transparent; border: 2px solid #fff; }
.lib-tile.chosen .lib-check { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.lib-check .ic { width: 14px; height: 14px; }
.lib-empty { grid-column: 1 / -1; text-align: center; color: var(--dim); padding: 80px 0; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.le-ic { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--surface); color: var(--accent); }
.le-ic .ic { width: 30px; height: 30px; }

/* =========================================================================
   OVERLAYS
   ========================================================================= */
.modal-back {
  position: fixed; inset: 0; z-index: 100; background: rgba(5, 5, 10, .55); display: grid; place-items: center; padding: 20px;
  opacity: 0; transition: opacity .2s; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.modal-back.in { opacity: 1; }
.modal-panel {
  width: 100%; max-height: min(88vh, 860px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border);
  border-radius: 26px; box-shadow: var(--shadow); transform: translateY(10px) scale(.98); transition: transform .22s var(--ease); outline: none;
}
.modal-back.in .modal-panel { transform: none; }
.modal-panel.size-sm { max-width: 420px; }
.modal-panel.size-md { max-width: 560px; }
.modal-panel.size-lg { max-width: 900px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 16px 6px 24px; }
.modal-title { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -.015em; }
.modal-body { padding: 10px 24px 18px; overflow-y: auto; }
.modal-text { margin: 0 0 6px; color: var(--dim); line-height: 1.6; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 20px 20px; flex-wrap: wrap; }

.menu-shield { position: fixed; inset: 0; z-index: 110; }
.menu {
  position: fixed; z-index: 111; background: var(--surface-2); border: 1px solid var(--border); border-radius: 18px; padding: 6px; box-shadow: var(--shadow);
  opacity: 0; transform: translateY(-4px) scale(.98); transform-origin: top; transition: opacity .14s, transform .14s var(--ease); max-height: 70vh; overflow-y: auto;
}
.menu.in { opacity: 1; transform: none; }
.menu-head { padding: 8px 12px 6px; font-size: 12px; color: var(--dim); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-sep { height: 1px; background: var(--border); margin: 6px 4px; }
.menu-item { width: 100%; display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 12px; text-align: left; font-size: 14px; }
.menu-item:hover { background: var(--hover); }
.menu-item.danger { color: var(--danger); }
.menu-item .mi-ic { color: var(--dim); display: grid; }
.menu-item.danger .mi-ic { color: var(--danger); }
.menu-item .mi-ic .ic { width: 18px; height: 18px; }
.mi-tx { flex: 1; font-weight: 500; white-space: nowrap; }
.mi-hint { font-size: 12px; color: var(--dim-2); white-space: nowrap; }
.mi-check { color: var(--accent); display: grid; }
.mi-check .ic { width: 18px; height: 18px; }
.menu-item.active { background: var(--accent-soft); }

.toast-host { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 11px 18px 11px 14px; border-radius: 999px; background: var(--text); color: var(--bg);
  font-size: 14px; font-weight: 500; box-shadow: var(--shadow); opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s var(--ease); pointer-events: auto;
}
.toast.in { opacity: 1; transform: none; }
.toast-ic .ic { width: 18px; height: 18px; }
.toast.error .toast-ic { color: var(--danger); }
.toast.ok .toast-ic { color: var(--ok); }
:root[data-theme="dark"] .toast.error .toast-ic { color: #D93B3B; }
:root[data-theme="dark"] .toast.ok .toast-ic { color: #0F8A5F; }

.viewer { position: fixed; inset: 0; z-index: 150; background: rgba(0, 0, 0, .92); display: flex; flex-direction: column; align-items: center; justify-content: center; opacity: 0; transition: opacity .2s; }
.viewer.in { opacity: 1; }
.viewer-bar { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 6px; padding: 12px 12px 12px 20px; color: #fff; }
.viewer-bar .icon-btn { color: #ddd; }
.viewer-bar .icon-btn:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.viewer-cap { flex: 1; font-size: 14px; color: #ccc; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer-img { max-width: 92vw; max-height: 84vh; border-radius: 14px; object-fit: contain; }

.update-bar { position: fixed; left: 50%; top: 16px; transform: translateX(-50%); z-index: 210; display: flex; align-items: center; gap: 14px; padding: 8px 8px 8px 18px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); box-shadow: var(--shadow); font-size: 14px; }

/* search */
.search { display: flex; flex-direction: column; gap: 12px; }
.search-results { display: flex; flex-direction: column; gap: 2px; max-height: 50vh; overflow-y: auto; }
.sr-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; text-align: left; }
.sr-item:hover { background: var(--hover); }
.sr-ic { color: var(--dim); display: grid; }
.sr-ic .ic { width: 18px; height: 18px; }
.sr-tx { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14.5px; }
.sr-when { font-size: 12px; color: var(--dim-2); white-space: nowrap; }
.sr-empty { padding: 30px 0; text-align: center; color: var(--dim); }

/* report */
.radio-list { display: flex; flex-direction: column; gap: 2px; margin: 10px 0 12px; }
.radio { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; cursor: pointer; }
.radio:hover { background: var(--hover); }
.radio input { accent-color: var(--accent); width: 18px; height: 18px; }

/* settings */
.settings { display: grid; grid-template-columns: 200px 1fr; gap: 20px; min-height: 420px; }
.set-nav { display: flex; flex-direction: column; gap: 2px; }
.set-tab { display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 14px; border-radius: 999px; font-weight: 600; font-size: 14px; color: var(--dim); text-align: left; }
.set-tab:hover { background: var(--hover); color: var(--text); }
.set-tab.on { background: var(--accent-soft); color: var(--text); }
.set-tab.on .set-ic { color: var(--accent); }
.set-ic { display: grid; color: var(--dim); }
.set-ic .ic { width: 19px; height: 19px; }
.set-group { display: flex; flex-direction: column; gap: 4px; }
.set-row { display: flex; align-items: center; gap: 14px; padding: 14px 4px; border-bottom: 1px solid var(--border); cursor: default; }
label.set-row { cursor: pointer; }
.set-row.col { flex-direction: column; align-items: stretch; gap: 12px; }
.set-top { display: flex; align-items: center; gap: 14px; }
.set-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.set-tx strong { font-size: 14.5px; font-weight: 600; }
.set-tx span { font-size: 13px; color: var(--dim); }
.set-foot { font-size: 12.5px; color: var(--dim-2); margin: 14px 4px 0; line-height: 1.6; }
.switch { position: relative; width: 46px; height: 28px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch .knob { position: absolute; inset: 0; border-radius: 999px; background: var(--border-2); transition: background .2s; }
.switch .knob::after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.switch input:checked + .knob { background: var(--accent); }
.switch input:checked + .knob::after { transform: translateX(18px); }
.switch input:focus-visible + .knob { outline: 2px solid var(--accent); outline-offset: 2px; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; padding-left: 33px; }
.swatch { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--sw) 55%, var(--sw2)); border: 2px solid transparent; box-shadow: 0 0 0 1px var(--border); transition: transform .12s; }
.swatch:hover { transform: scale(1.08); }
.swatch.on { border-color: var(--bg); box-shadow: 0 0 0 2px var(--sw); }
.set-row.col .seg { margin-left: 33px; align-self: flex-start; }
.acct-card { display: flex; align-items: center; gap: 16px; padding: 6px 4px 18px; border-bottom: 1px solid var(--border); }
.acct-tx { display: flex; flex-direction: column; min-width: 0; }
.acct-tx strong { font-size: 17px; }
.acct-tx span { color: var(--dim); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; }
.about-brand { display: flex; flex-direction: column; padding: 4px 4px 14px; }
.about-brand span { color: var(--dim); font-size: 13px; }
.set-link { display: flex; align-items: center; justify-content: space-between; padding: 14px 4px; border-bottom: 1px solid var(--border); color: var(--text); font-weight: 500; }
.set-link:hover { text-decoration: none; color: var(--accent); }

/* upgrade */
.upgrade-reason { margin: 0 0 14px; padding: 10px 14px; border-radius: 12px; background: var(--accent-soft); font-size: 14px; }
.plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.plan-card { position: relative; border: 1px solid var(--border); border-radius: 22px; padding: 22px 20px; background: var(--bg-2); display: flex; flex-direction: column; gap: 6px; }
.plan-card.popular { border: 1.5px solid transparent; background: linear-gradient(var(--bg-2), var(--bg-2)) padding-box, linear-gradient(135deg, var(--accent), var(--accent-end)) border-box; }
.plan-card.current { box-shadow: inset 0 0 0 2px var(--accent); }
.plan-flag { position: absolute; top: -11px; left: 20px; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: linear-gradient(135deg, var(--accent), var(--accent-end)); color: var(--on-accent); letter-spacing: .02em; }
.plan-name { font-size: 18px; font-weight: 700; }
.plan-tag { font-size: 13px; color: var(--dim); min-height: 36px; }
.plan-price { display: flex; align-items: baseline; gap: 6px; margin: 6px 0 8px; }
.plan-price .now { font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.plan-price .per { color: var(--dim); font-size: 13px; }
.plan-price .was { color: var(--dim-2); font-size: 13px; margin-left: 4px; }
.feats { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
.feat { display: flex; align-items: flex-start; gap: 8px; }
.feat-ic { color: var(--ok); display: grid; margin-top: 1px; }
.feat-ic .ic { width: 16px; height: 16px; }
.feat.off { color: var(--dim-2); }
.feat.off .feat-ic { color: var(--dim-2); }
.plan-current { margin-top: 10px; font-size: 13px; font-weight: 700; color: var(--accent); }
.upgrade-note { display: flex; gap: 14px; align-items: flex-start; margin-top: 18px; padding: 16px; border-radius: 18px; background: var(--bg-2); border: 1px dashed var(--border-2); }
.upgrade-note p { margin: 4px 0 0; color: var(--dim); font-size: 13.5px; }
.un-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }

/* =========================================================================
   PHONE / SMALL WINDOW (≤ 860px)
   ========================================================================= */
@media (max-width: 860px) {
  .only-mobile { display: inline-grid !important; }
  .top-title.only-mobile { display: flex !important; }
  .sidebar {
    position: fixed; left: 0; top: var(--tb-h); bottom: 0; transform: translateX(-102%); width: min(86vw, 320px) !important;
    box-shadow: var(--shadow); padding-top: max(10px, env(safe-area-inset-top)); padding-bottom: max(10px, env(safe-area-inset-bottom));
  }
  .shell.collapsed .sidebar { width: min(86vw, 320px); }
  .shell.collapsed .sb-brand, .shell.collapsed .sb-search { display: flex; }
  .shell.collapsed .sb-top { flex-direction: row; }
  .shell.collapsed .sb-item { width: auto; padding: 0 14px; justify-content: flex-start; }
  .shell.collapsed .sb-item .sb-tx { display: block; }
  .shell.collapsed .sb-item.rail-only { display: none; }
  .shell.collapsed .sb-label, .shell.collapsed .sb-list { visibility: visible; }
  .shell.collapsed .sb-bottom { flex-direction: row; border-top: 1px solid var(--border); }
  .shell.collapsed .sb-uname { display: block; }
  .shell.collapsed .sb-user { flex: 1; padding: 6px 8px; }
  .shell.drawer .sidebar { transform: none; }
  .sb-scrim { display: block; position: fixed; inset: 0; z-index: 25; background: rgba(0, 0, 0, .5); opacity: 0; pointer-events: none; transition: opacity .25s; }
  .shell.drawer .sb-scrim { opacity: 1; pointer-events: auto; }
  .sb-more { opacity: 1; }
  .sb-hint { display: none; }
  .topbar { padding: 0 6px; padding-top: env(safe-area-inset-top); height: calc(var(--top-h) + env(safe-area-inset-top)); gap: 4px; }
  .top-pill { height: 36px; padding: 0 14px; font-size: 13.5px; }
  .top-pill.ghost { display: none; }
  .thread { padding: 4px 14px 20px; gap: 22px; }
  .composer-wrap { padding: 0 10px calc(8px + env(safe-area-inset-bottom)); }
  .composer { border-radius: 26px; }
  .composer-input { font-size: 16px; }
  .chat.empty { justify-content: flex-end; }
  .chat.empty .hero { flex: 1; display: flex; flex-direction: column; justify-content: center; margin: 0; padding: 0 18px; }
  .chat.empty .disclaimer { display: none; }
  .chips { margin-top: 22px; }
  .bubble { max-width: 88%; }
  .msg { gap: 10px; }
  .ai-avatar { width: 26px; height: 26px; }
  .ai-avatar .logo-mark { width: 20px; height: 20px; }
  .msg-actions { opacity: 1; }
  .jump-btn { bottom: 108px; }
  .page { padding: 4px 14px 30px; }
  .page-title { font-size: 26px; }
  .lib-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
  .lib-tile { border-radius: 14px; }
  .modal-back { align-items: end; padding: 0; }
  .modal-panel { border-radius: 26px 26px 0 0; max-height: 92vh; padding-bottom: env(safe-area-inset-bottom); }
  .modal-panel.size-sm, .modal-panel.size-md, .modal-panel.size-lg { max-width: 100%; }
  .settings { grid-template-columns: 1fr; gap: 10px; min-height: 0; }
  .set-nav { flex-direction: row; overflow-x: auto; }
  .set-tab { flex: none; }
  .plan-grid { grid-template-columns: 1fr; }
  .swatches, .set-row.col .seg { padding-left: 0; margin-left: 0; }
  .toast-host { bottom: calc(96px + env(safe-area-inset-bottom)); }
  .update-bar { top: calc(10px + env(safe-area-inset-top)); width: calc(100vw - 24px); justify-content: space-between; }
}

@media (max-width: 420px) {
  .hero-title { font-size: 30px; }
  .chip { height: 38px; padding: 0 14px; font-size: 13.5px; }
  .model-btn { padding: 0 6px 0 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

@media print {
  .sidebar, .topbar, .composer-wrap, .msg-actions, .jump-btn { display: none !important; }
  body { overflow: visible; }
  .chat, .thread-scroll { position: static; overflow: visible; }
}

/* =========================================================================
   v1.0.2 — Android parity: thinking dots, media cards, action rows, sidebar
   ========================================================================= */

/* thinking dots + shimmer words (Android GetplexThinking) */
.live-status { display: flex; flex-direction: column; gap: 6px; }
.think-row { display: flex; align-items: center; gap: 12px; min-height: 40px; }
.think-dots { display: block; flex: none; }
.think-label { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.web-line { display: flex; align-items: center; gap: 10px; color: var(--dim); font-size: 14px; padding-left: 4px; }
.wl-ic .ic { width: 17px; height: 17px; color: var(--accent); }

/* action row under every reply / card — always visible on AI replies, like Android */
.msg.ai .msg-actions { opacity: 1; }
.msg-actions .icon-btn.on { color: var(--accent); background: var(--accent-soft); }
.msg-actions .icon-btn.on svg path { fill: color-mix(in srgb, var(--accent) 28%, transparent); }

/* the AI mark on made pictures / songs / videos */
.ai-mark { position: absolute; right: 12px; bottom: 12px; width: 30px; height: 30px; border-radius: 50%; background: rgba(255, 255, 255, .88); display: grid; place-items: center; box-shadow: 0 2px 10px rgba(0, 0, 0, .25); z-index: 2; }
.ai-mark .logo-mark { width: 18px; height: 18px; --brand-ink: #241C33; }

/* picture card — the picture itself, rounded, no frame (Android) */
.image-card { position: relative; margin: 0; width: min(100%, 400px); border-radius: 24px; overflow: hidden; background: var(--surface); }
.image-card:not(.loaded) { aspect-ratio: 1; }
.image-card:not(.loaded)::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(100deg, transparent 20%, color-mix(in srgb, var(--text) 8%, transparent) 50%, transparent 80%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
.image-card .gen-img { display: block; width: 100%; height: auto; min-height: 0; cursor: zoom-in; background: transparent; }
.card-bubble .image-card { width: 100%; }

/* song card (Android SongCard) */
.song-card { width: min(100%, 360px); display: flex; flex-direction: column; gap: 8px; }
.song-cover {
  position: relative; aspect-ratio: 1; border-radius: 28px; overflow: hidden; color: #fff;
  background: linear-gradient(180deg, var(--deep), #07070A); display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.sc-orb { position: absolute; left: 50%; top: 42%; width: 124%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--glow) 62%, transparent) 0%, color-mix(in srgb, var(--glow) 12%, transparent) 45%, transparent 70%);
  transition: opacity .4s; opacity: .85; }
.sc-orb::after { content: ""; position: absolute; left: 50%; top: 50%; width: 21%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; background: var(--glow); opacity: .9; box-shadow: 0 0 40px var(--glow); }
.song-cover.playing .sc-orb { animation: orb 1.8s ease-in-out infinite alternate; }
@keyframes orb { from { opacity: .7; transform: translate(-50%, -50%) scale(.97); } to { opacity: 1; transform: translate(-50%, -50%) scale(1.04); } }
.sc-play { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); width: 64px; height: 64px; border-radius: 50%; background: #fff; color: #111114; display: grid; place-items: center; box-shadow: 0 8px 26px rgba(0, 0, 0, .35); transition: transform .12s; z-index: 2; }
.sc-play:hover { transform: translate(-50%, -50%) scale(1.05); }
.sc-play .ic { width: 22px; height: 22px; }
.song-cover.loading .sc-play { animation: pulse 1s infinite; }
.sc-meta { position: absolute; left: 22px; right: 22px; bottom: 22px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; z-index: 1; }
.sc-title { font-size: 24px; line-height: 1.2; font-weight: 700; color: #F3E6C8; letter-spacing: -.01em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; padding-right: 30px; padding-left: 30px; }
.sc-bar { position: relative; width: 100%; height: 18px; cursor: pointer; }
.sc-track, .sc-fill { position: absolute; left: 0; top: 50%; height: 3px; transform: translateY(-50%); border-radius: 2px; }
.sc-track { right: 0; background: rgba(255, 255, 255, .25); }
.sc-fill { width: 0; background: rgba(255, 255, 255, .92); }
.sc-time { font-size: 12px; color: rgba(255, 255, 255, .8); min-height: 16px; }

/* video card (Android VideoCard) */
.video-card { position: relative; border-radius: 24px; overflow: hidden; }
.video-card.tall { width: min(100%, 260px); aspect-ratio: 9 / 16; }
.video-card.wide { width: min(100%, 520px); aspect-ratio: 16 / 9; }
.video-card video { width: 100%; height: 100%; object-fit: cover; display: block; background: #000; }
.vc-shimmer { position: absolute; inset: 0; background: linear-gradient(100deg, var(--surface) 20%, var(--surface-2) 50%, var(--surface) 80%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
.video-card.making { aspect-ratio: auto; width: auto; overflow: visible; border-radius: 0; }
.vc-sub { color: var(--dim); font-size: 12.5px; padding: 2px 0 0 2px; }

/* sidebar: sub items, notebooks, pins */
.sb-label:first-child { margin-top: 14px; }
.sb-item.sb-sub { height: 40px; font-size: 14px; }
.sb-emoji { width: 20px; text-align: center; font-size: 16px; line-height: 1; }
.sb-pin { color: var(--dim-2); display: grid; margin-right: 2px; }
.sb-pin .ic { width: 15px; height: 15px; }
.shell.collapsed .sb-list { display: none; }

/* pages coming to the web */
.page.soon { display: grid; place-items: center; }
.soon-card { max-width: 520px; text-align: center; padding: 40px 28px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.soon-ic { width: 76px; height: 76px; border-radius: 24px; display: grid; place-items: center; color: var(--on-accent); background: linear-gradient(135deg, var(--accent), var(--accent-end)); box-shadow: 0 14px 40px color-mix(in srgb, var(--accent) 30%, transparent); }
.soon-ic .ic { width: 36px; height: 36px; }
.soon-title { margin: 10px 0 0; font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.soon-text { margin: 0; color: var(--dim); font-size: 15.5px; line-height: 1.6; }
.soon-badge { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; padding: 6px 14px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 13px; }
.soon-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: pulse 1.6s infinite; }
.soon-sub { margin: 0; color: var(--dim-2); font-size: 13px; }
.soon-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.soon-actions a:hover { text-decoration: none; }

@media (max-width: 860px) {
  .shell.collapsed .sb-list { display: block; }
  .sc-title { font-size: 21px; }
}

/* =========================================================================
   v1.0.3 — tooltips, bigger type, icon motion, Wave button, editor
   ========================================================================= */

/* bigger, Gemini-size reading type */
body { font-size: 16px; }
.rich { font-size: 16.5px; line-height: 1.78; }
.bubble { font-size: 16.5px; }
.composer-input { font-size: 17px; }
.sb-item { font-size: 15.5px; height: 46px; }
.sb-item.sb-sub { font-size: 15px; height: 42px; }
.sb-chat-link { font-size: 15px; padding-top: 10px; padding-bottom: 10px; }
.sb-label { font-size: 13px; }
.sb-uname { font-size: 15.5px; }
.menu-item { font-size: 15px; padding: 10px 14px; }
.model-btn { font-size: 15px; }
.think-label { font-size: 15.5px; }
.chip { font-size: 15px; height: 42px; }
.top-pill { font-size: 15.5px; }

/* tooltip pill (replaces the browser's white box) */
.tooltip {
  position: fixed; z-index: 300; pointer-events: none; padding: 7px 13px; border-radius: 12px;
  font: 500 13.5px/1.2 var(--font); letter-spacing: .01em; white-space: nowrap;
  background: #E9E9EE; color: #15151A; box-shadow: 0 6px 22px rgba(0, 0, 0, .35);
  opacity: 0; transform: translateY(3px) scale(.98); transition: opacity .14s, transform .14s var(--ease);
}
:root[data-theme="light"] .tooltip { background: #24242B; color: #F4F4F7; }
.tooltip.in { opacity: 1; transform: none; }

/* sidebar icon motion on hover (one short play, like Claude's sidebar) */
.sb-item:hover .sb-ic svg, .sb-item:focus-visible .sb-ic svg { animation-duration: .9s; animation-timing-function: cubic-bezier(.3, 1.4, .5, 1); animation-iteration-count: 1; }
.sb-item:hover .ic-newChat svg { animation-name: ic-write; transform-origin: 20% 80%; }
.sb-item:hover .ic-search svg { animation-name: ic-seek; }
.sb-item:hover .ic-photos svg { animation-name: ic-tilt; }
.sb-item:hover .ic-books svg { animation-name: ic-hop; }
.sb-item:hover .ic-clipboard svg { animation-name: ic-pop; }
.sb-item:hover .ic-mail svg { animation-name: ic-fly; }
.sb-item:hover .ic-camcorder svg { animation-name: ic-rec; }
.sb-item:hover .ic-clipPlus svg { animation-name: ic-spin-plus; }
.sb-item:hover .ic-notebook svg, .sb-item:hover .ic-bulb svg { animation-name: ic-pop; }
@keyframes ic-write { 0%, 100% { transform: none; } 20% { transform: rotate(-14deg); } 45% { transform: rotate(8deg) translateX(2px); } 70% { transform: rotate(-5deg); } }
@keyframes ic-seek { 0%, 100% { transform: none; } 30% { transform: translate(-2px, -2px) scale(1.12); } 60% { transform: translate(2px, 1px); } }
@keyframes ic-tilt { 0%, 100% { transform: none; } 35% { transform: rotate(-10deg) scale(1.1); } 70% { transform: rotate(6deg); } }
@keyframes ic-hop { 0%, 100% { transform: none; } 30% { transform: translateY(-4px); } 55% { transform: translateY(1px) scaleY(.94); } 75% { transform: translateY(-1px); } }
@keyframes ic-pop { 0%, 100% { transform: none; } 35% { transform: scale(1.2); } 65% { transform: scale(.94); } }
@keyframes ic-fly { 0%, 100% { transform: none; } 40% { transform: translate(4px, -3px) rotate(-8deg); opacity: .6; } 41% { transform: translate(-5px, 3px); opacity: .2; } 75% { transform: none; opacity: 1; } }
@keyframes ic-rec { 0%, 100% { transform: none; } 25% { transform: translateX(-2px) rotate(-4deg); } 50% { transform: translateX(2px) rotate(4deg); } 75% { transform: translateX(-1px); } }
@keyframes ic-spin-plus { 0%, 100% { transform: none; } 50% { transform: rotate(90deg) scale(1.1); } }

/* send / wave / stop */
.send-btn.wave { pointer-events: auto; background: var(--accent); color: var(--on-accent); }
.send-btn.wave:hover { background: color-mix(in srgb, var(--accent) 88%, #fff); }
.send-btn.wave:active { transform: scale(.94); }
.send-btn.wave svg { width: 24px; height: 24px; stroke-width: 2.6; }
@keyframes wave-bars { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(.6); } }
.wave-soon { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; }
.wave-orb { width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center; margin: 4px 0 10px;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%); }
.modal-text.small { font-size: 13.5px; color: var(--dim-2); }

/* scroll-to-latest: dots while out, arrow on hover; sits clear of the box */
.jump-btn { bottom: calc(100% - 100% + 150px); width: 42px; height: 42px; }
.chat .jump-btn { bottom: var(--jump-bottom, 150px); }
.jump-btn .jb-arrow { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; transform: translateY(-3px); transition: opacity .15s, transform .15s; }
.jump-btn .jb-dots { display: grid; place-items: center; transition: opacity .15s; }
.jump-btn:hover .jb-arrow, .jump-btn:focus-visible .jb-arrow { opacity: 1; transform: none; }
.jump-btn:hover .jb-dots, .jump-btn:focus-visible .jb-dots { opacity: 0; }
@media (hover: none) { .jump-btn .jb-arrow { opacity: 1; transform: none; } .jump-btn .jb-dots { opacity: 0; } }

/* picture: quick tools on hover (Gemini) */
.img-tools { position: absolute; top: 12px; right: 12px; display: flex; gap: 8px; opacity: 0; transform: translateY(-4px); transition: opacity .18s, transform .18s; z-index: 3; }
.image-card:hover .img-tools, .image-card:focus-within .img-tools { opacity: 1; transform: none; }
.it-btn { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: rgba(20, 20, 26, .55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: background .15s; }
.it-btn:hover { background: rgba(20, 20, 26, .8); }
.it-btn .ic { width: 18px; height: 18px; }
@media (hover: none) { .img-tools { display: none; } }

/* chat ⋮ in the top bar */
.chat-more .ic { width: 22px; height: 22px; }

/* image editor (full screen) */
.viewer.editor { background: #0B0B0F; display: block; }
.ed-bg { position: absolute; inset: -40px; background-size: cover; background-position: center; filter: blur(50px) brightness(.35); transform: scale(1.1); }
.ed-top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 6px; padding: 14px 16px; z-index: 2; }
.ed-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: #EDEDF2; transition: background .15s; }
.ed-btn:hover { background: rgba(255, 255, 255, .1); }
.ed-btn:disabled { opacity: .35; }
.ed-btn .ic { width: 22px; height: 22px; }
.ed-save { height: 44px; padding: 0 22px; border-radius: 999px; background: #EDEDF2; color: #15151A; font-weight: 600; font-size: 15px; margin-left: 8px; }
.ed-stage { position: absolute; left: 0; right: 0; top: 76px; bottom: 150px; display: grid; place-items: center; z-index: 1; }
.viewer.editor .ed-stage { touch-action: none; }
.ed-canvas { display: block; border-radius: 6px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); max-width: 100%; }
.ed-stage.drawing .ed-canvas { cursor: crosshair; }
.ed-stage.texting .ed-canvas { cursor: text; }
.ed-text { position: absolute; transform: translate(-50%, -50%); min-width: 120px; background: rgba(0, 0, 0, .45); border: 1.5px dashed rgba(255, 255, 255, .7); border-radius: 8px; padding: 6px 10px; font: 700 22px var(--font); text-align: center; outline: none; }
.ed-caption { flex: 0 1 auto; min-width: 0; margin-left: 6px; color: rgba(255, 255, 255, .7); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
@media (max-width: 860px) { .ed-caption { display: none; } }
.ed-bottom { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 0 16px max(18px, env(safe-area-inset-bottom)); z-index: 2; }
.ed-colors { display: flex; gap: 14px; }
.ed-color { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; box-shadow: 0 0 0 1px rgba(255, 255, 255, .15); transition: transform .12s; }
.ed-color:hover { transform: scale(1.1); }
.ed-color.on { transform: scale(1.18); border-color: #fff; box-shadow: 0 0 0 2px rgba(0, 0, 0, .4); }
.ed-tools { display: flex; gap: 22px; }
.ed-tool { display: flex; flex-direction: column; align-items: center; gap: 6px; color: #EDEDF2; font-size: 14px; font-weight: 600; }
.ed-tool-ic { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .1); transition: background .15s, color .15s; }
.ed-tool-ic .ic { width: 26px; height: 26px; }
.ed-tool:hover .ed-tool-ic { background: rgba(255, 255, 255, .18); }
.ed-tool.on .ed-tool-ic { background: #EDEDF2; color: #15151A; }
@media (max-width: 860px) {
  .ed-top { padding: max(10px, env(safe-area-inset-top)) 8px 8px; gap: 0; }
  .ed-btn { width: 40px; height: 40px; }
  .ed-save { padding: 0 16px; height: 40px; }
  .ed-stage { top: 64px; bottom: 170px; }
  .ed-colors { gap: 10px; }
}

/* Download PDF (browser print) — just the conversation */
@media print {
  .titlebar, .topbar, .composer-wrap, .msg-actions, .jump-btn, .img-tools, .sb-scrim, .toast-host, .chat > .glow { display: none !important; }
  .shell, .main, .view { display: block; height: auto; }
  .thread { max-width: none; padding: 0; }
  .msg { break-inside: avoid; }
  body { background: #fff; color: #000; }
}

.image-card.failed { aspect-ratio: auto; padding: 18px; display: flex; align-items: center; gap: 10px; color: var(--dim); font-size: 14px; }
.image-card.failed::before { display: none; }

/* =========================================================================
   v1.0.4 — Gemini-black surfaces, capsule box, tools, menus, edit, retry
   ========================================================================= */

/* pure neutral blacks (no blue tint) — like Gemini */
:root[data-theme="dark"] {
  --bg: #0E0E0F; --bg-2: #0A0A0B; --surface: #1B1B1C; --surface-2: #242426; --bubble: #262628;
  --composer: #1E1E20; --border: #2C2C2F; --border-2: #3A3A3E;
}
.sidebar { background: var(--surface); }
:root[data-theme="dark"] .menu, :root[data-theme="dark"] .menu.side { background: #242426; border-color: #313134; }

/* the message box: a soft capsule, no outline, no glow ring */
.composer { border-radius: 32px; border: 0; background: var(--composer); padding: 12px 12px 10px 14px; box-shadow: 0 8px 30px rgba(0, 0, 0, .28); }
.composer:focus-within { border: 0; box-shadow: 0 8px 30px rgba(0, 0, 0, .32); }
:root[data-theme="light"] .composer { box-shadow: 0 6px 24px rgba(20, 20, 40, .1); border: 1px solid var(--border); }
.composer-input { padding: 10px 10px 8px; }

/* photo waiting in the box — Gemini size, opens the editor */
.attach-row { padding: 2px 2px 4px; }
.attach-chip { width: 132px; height: 132px; border-radius: 22px; border: 0; cursor: zoom-in; background: var(--surface-2); }
.attach-chip:hover img { filter: brightness(.9); }
.attach-x { top: 8px; right: 8px; width: 26px; height: 26px; background: rgba(0, 0, 0, .7); }
@media (max-width: 860px) { .attach-chip { width: 104px; height: 104px; border-radius: 18px; } }

/* the tool chip beside + (e.g. "Image") */
.tool-slot { display: flex; }
.tool-chip { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px 0 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 14.5px; margin-left: 4px; }
.tool-chip .ic { width: 18px; height: 18px; }
.tool-chip .tc-x { opacity: .7; display: grid; }
.tool-chip .tc-x .ic { width: 15px; height: 15px; }
.tool-chip:hover .tc-x { opacity: 1; }

/* menus: two-line rows, side panels, switches */
.menu { border-radius: 22px; padding: 8px; }
.menu-item.two { align-items: center; padding: 9px 14px; }
.mi-tx { display: flex; flex-direction: column; min-width: 0; }
.mi-label { font-weight: 500; white-space: nowrap; }
.mi-sub { font-size: 13px; color: var(--dim); white-space: nowrap; margin-top: 1px; }
.menu-item .mi-ic:empty { width: 18px; }
.mi-more { margin-left: auto; color: var(--dim); display: grid; }
.mi-more .ic { width: 16px; height: 16px; }
.menu-item.has-sub.open { background: var(--hover); }
.menu-item .mi-check { margin-left: auto; }
.menu.side { position: fixed; z-index: 112; min-width: 230px; }
.mi-switch { margin-left: auto; position: relative; width: 40px; height: 24px; border-radius: 999px; background: var(--border-2); flex: none; transition: background .2s; }
.mi-switch .knob { position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); }
.mi-switch.on { background: var(--accent); }
.mi-switch.on .knob { transform: translateX(16px); }

/* your message: a clean capsule; edit + copy under it */
.bubble { border: 0; background: var(--bubble); border-radius: 26px; padding: 12px 20px; }
:root[data-theme="light"] .bubble { background: #EEF0F4; }
.bubble.card-bubble { background: none; padding: 0; border-radius: 22px; }
.edit-wrap { align-self: flex-end; width: min(100%, 640px); background: var(--bubble); border-radius: 24px; padding: 12px 14px 10px; display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--border-2); }
.edit-box { width: 100%; border: 0; outline: none; background: transparent; resize: none; font-size: 16.5px; line-height: 1.6; color: var(--text); }
.edit-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* failure card + Retry (Android) */
.failed-card { align-items: center; flex-wrap: wrap; }
.failed-card .fc-why { flex: 1; min-width: 180px; }
.retry-btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 999px; background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--text); font-weight: 600; font-size: 13.5px; }
.retry-btn:hover { background: color-mix(in srgb, var(--danger) 26%, transparent); }
.retry-btn .ic { width: 16px; height: 16px; }

/* scroll-to-latest: arrow normally; while a reply is being written it shows
   the dots, and the arrow on hover (Claude / Gemini) */
.jump-btn { background: var(--surface-2); border: 0; box-shadow: 0 6px 20px rgba(0, 0, 0, .35); }
.jump-btn .jb-arrow { opacity: 1; transform: none; }
.jump-btn .jb-dots { opacity: 0; position: absolute; inset: 0; display: grid; place-items: center; }
.jump-btn.busy .jb-dots { opacity: 1; }
.jump-btn.busy .jb-arrow { opacity: 0; }
.jump-btn.busy:hover .jb-dots { opacity: 0; }
.jump-btn.busy:hover .jb-arrow { opacity: 1; }
@media (hover: none) { .jump-btn.busy .jb-dots { opacity: 1; } .jump-btn.busy .jb-arrow { opacity: 0; } }

/* ================= v1.0.5 ================= */
/* Composer: no scrollbar until the text really overflows (JS sets overflow) */
.composer-input { overflow-y: hidden; scrollbar-width: thin; scrollbar-color: var(--border-2) transparent; }
.composer-input::-webkit-scrollbar { width: 6px; }
.composer-input::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 6px; }
.composer-input::-webkit-scrollbar-button { display: none; height: 0; }

/* Sidebar chat skeleton while the list loads */
.sb-skel { display: flex; flex-direction: column; gap: 14px; padding: 10px 14px; }
.sb-skel .skel { height: 12px; border-radius: 6px; }
.sb-skel .skel:nth-child(2n) { width: 72%; }
.sb-skel .skel:nth-child(3n) { width: 54%; }

/* Splash: refresh, sign in, sign out */
.boot { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: var(--bg); }
.boot-ring { position: relative; width: 84px; height: 84px; display: grid; place-items: center; }
.boot-ring::before { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid transparent;
  border-top-color: var(--accent); border-right-color: color-mix(in srgb, var(--accent) 35%, transparent); animation: boot-spin 1s linear infinite; }
.boot-ring .boot-mark { width: 44px; height: 44px; }
.boot-label { font-size: 14px; letter-spacing: .01em; }
@keyframes boot-spin { to { transform: rotate(360deg); } }
.view-enter { animation: view-in .32s var(--ease) both; }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .boot-ring::before, .boot-mark, .view-enter { animation: none; } }

/* =========================================================================
   ★ 1.0.6 — IMAGES + VIDEOS PAGES (js/studio.js). Gemini layout, Amicortex
   tokens. Cards zoom on hover like Gemini; phone = 3 / 2 columns, no hover.
   ========================================================================= */
.page.studio { padding: 0 24px 56px; }
.st-wrap { max-width: 860px; margin: 0 auto; }
.st-grow { flex: 1 1 auto; }

.st-hero { text-align: center; padding: 64px 0 26px; animation: rise .45s var(--ease) both; }
.st-badge { width: 44px; height: 44px; margin: 0 auto 14px; border-radius: 14px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); }
.st-badge .ic { width: 22px; height: 22px; }
.st-title { margin: 0; font-size: 32px; font-weight: 600; letter-spacing: -.025em; }
.st-sub { margin: 10px auto 0; max-width: 520px; color: var(--dim); font-size: 15.5px; line-height: 1.5; }

/* the box */
.st-box { position: relative; max-width: 680px; margin: 0 auto 34px; background: var(--composer); border-radius: 30px;
  padding: 12px 12px 10px 14px; box-shadow: 0 10px 34px rgba(0, 0, 0, .28); transition: box-shadow .2s, outline-color .2s;
  outline: 2px solid transparent; outline-offset: 2px; animation: rise .5s .05s var(--ease) both; }
.st-box:focus-within { box-shadow: 0 12px 40px rgba(0, 0, 0, .34), 0 0 0 1px var(--border-2); }
.st-box.drag { outline-color: var(--accent); }
.st-input { display: block; width: 100%; resize: none; border: 0; outline: 0; background: transparent; color: var(--text);
  font: inherit; font-size: 17px; line-height: 1.5; padding: 8px 6px 10px; max-height: 168px; overflow-y: hidden; }
.st-input::placeholder { color: var(--dim-2); }
.st-row { display: flex; align-items: center; gap: 8px; }
.st-row-pills { flex-wrap: wrap; }
.st-plus, .st-send { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto;
  transition: background .15s, transform .15s, opacity .15s; }
.st-plus { color: var(--text); }
.st-plus:hover { background: var(--hover); }
.st-send { background: var(--accent); color: var(--on-accent); }
.st-send:hover:not(:disabled) { transform: scale(1.05); }
.st-send:disabled { background: var(--hover); color: var(--dim-2); cursor: default; }
.st-plus .ic, .st-send .ic { width: 20px; height: 20px; }

.st-caps { display: flex; gap: 8px; flex-wrap: wrap; padding: 2px 2px 4px; }
.st-cap { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 6px 0 10px; border-radius: 999px;
  background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--text); font-size: 14px; font-weight: 600;
  max-width: 260px; animation: capIn .28s var(--ease) both; }
.st-cap-ic { display: grid; place-items: center; }
.st-cap-ic .ic { width: 17px; height: 17px; }
.st-cap-pic { position: relative; width: 24px; height: 24px; border-radius: 7px; overflow: hidden; flex: 0 0 auto; background: var(--surface-2); }
.st-cap-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.st-cap-tx { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-cap-x { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto;
  background: color-mix(in srgb, var(--text) 82%, transparent); color: var(--bg); transition: transform .15s; }
.st-cap-x:hover { transform: scale(1.1); }
.st-cap-x .ic { width: 12px; height: 12px; stroke-width: 2.6; }
@keyframes capIn { from { opacity: 0; transform: scale(.85); } }

.st-photo { position: relative; width: 112px; height: 112px; margin: 4px 0 4px 4px; border-radius: 18px; overflow: hidden; animation: capIn .28s var(--ease) both; }
.st-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.st-photo-x { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(0, 0, 0, .7); color: #fff; }
.st-photo-x .ic { width: 13px; height: 13px; }

.st-pill { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px 0 14px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--text); font-size: 13.5px; font-weight: 500; transition: background .15s; }
.st-pill:hover { background: var(--hover); }
.st-pill-k { color: var(--dim); }
.st-pill-v { display: grid; place-items: center; color: var(--dim); }
.st-pill-v .ic { width: 15px; height: 15px; }

/* tabs + chips */
.st-tabrow { display: flex; justify-content: center; margin: 0 0 18px; }
.st-chips { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 0 0 20px; }
.st-chip { height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--border); color: var(--text); font-size: 14px; transition: background .15s, border-color .15s; }
.st-chip:hover { background: var(--hover); }
.st-chip.on { background: color-mix(in srgb, var(--text) 12%, transparent); border-color: transparent; font-weight: 600; }

/* the cards — Gemini zoom on hover */
.st-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; padding: 6px 0; }
.st-grid-sq { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.st-card { position: relative; aspect-ratio: 3 / 4; border-radius: 22px; overflow: hidden; isolation: isolate; text-align: left;
  background: var(--surface); transform: translateZ(0); will-change: transform;
  transition: transform .42s cubic-bezier(.2, .9, .25, 1.15), box-shadow .3s var(--ease);
  animation: stIn .5s var(--ease) both; animation-delay: var(--d, 0ms); }
.st-card.st-sq { aspect-ratio: 1; border-radius: 24px; }
.st-card.seen { animation: none; }
.st-card[hidden] { display: none; }
.st-card .st-play { transition: background .2s, color .2s, transform .2s; }
.st-card.on .st-play { transform: scale(1.06); }
@keyframes stIn { from { opacity: 0; transform: translateY(10px) scale(.97); } }
.st-card-art { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255, 255, 255, .85); z-index: 0; }
.st-card-art .ic { width: 32px; height: 32px; }
.st-pic { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; z-index: 1; opacity: 0;
  transition: opacity .35s, transform .6s var(--ease); }
.st-pic.in { opacity: 1; }
.st-card-shade { position: absolute; inset: 0; z-index: 2; background: linear-gradient(180deg, transparent 52%, rgba(0, 0, 0, .62)); pointer-events: none; }
.st-card-label { position: absolute; left: 12px; right: 10px; bottom: 11px; z-index: 3; color: #fff; font-size: 14.5px; font-weight: 600;
  line-height: 1.22; text-shadow: 0 1px 8px rgba(0, 0, 0, .45); display: flex; align-items: center; gap: 8px;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.st-sq .st-card-label { display: flex; -webkit-line-clamp: unset; }
.st-sq .st-card-label > span:first-child { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-play { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; background: rgba(255, 255, 255, .92); color: #111114; }
.st-play .ic { width: 13px; height: 13px; }
.st-card.on { box-shadow: 0 0 0 3px var(--accent), 0 10px 30px rgba(0, 0, 0, .35); }
.st-card.on .st-play { background: var(--accent); color: var(--on-accent); }
.st-card:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (hover: hover) {
  .st-card:hover { transform: scale(1.09); z-index: 5; box-shadow: 0 22px 46px rgba(0, 0, 0, .5); }
  .st-card:hover .st-pic { transform: scale(1.05); }
  .st-card:active { transform: scale(1.04); }
}
.st-card.skel-card { animation: shimmer 1.3s linear infinite; background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; }

.st-more { background: var(--surface); display: flex; flex-direction: column; padding: 8px; gap: 8px; }
.st-more-grid { flex: 1; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 6px; }
.st-more-cell { position: relative; border-radius: 12px; overflow: hidden; }
.st-more-label { text-align: center; font-size: 14px; font-weight: 600; color: var(--text); padding-bottom: 2px; }
.st-close { background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  color: var(--dim); font-size: 14px; font-weight: 600; box-shadow: inset 0 0 0 1px var(--border); }
.st-close-ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--hover); color: var(--text); }
.st-close-ic .ic { width: 18px; height: 18px; }
.st-empty { grid-column: 1 / -1; color: var(--dim); font-size: 14.5px; margin: 6px 2px; }

/* My images */
.st-mine-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 44px 0 14px; }
.st-h2 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.st-mine { max-width: none; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

/* photo sheet (Gemini) */
.st-sheet-modal { max-width: 380px !important; border-radius: 30px; }
.st-sheet-modal .modal-body { padding: 14px 14px 4px; }
.st-sheet-pic { position: relative; aspect-ratio: 4 / 3; border-radius: 20px; overflow: hidden; }
.st-sheet-pic .st-pic { object-position: center 30%; }
.st-sheet-tx { margin: 16px 8px 2px; font-size: 16px; line-height: 1.45; color: var(--text); }
.st-sheet-sub { margin: 0 8px; font-size: 15px; color: var(--dim); }
.st-sheet-modal .modal-foot, .st-up-modal .modal-foot { flex-direction: column; align-items: stretch; gap: 6px; padding: 12px 14px 14px; }
.st-sheet-modal .modal-foot .btn, .st-up-modal .modal-foot .btn { width: 100%; height: 46px; border-radius: 999px; font-size: 15px; }
.st-sheet-modal .modal-foot .btn.ghost, .st-up-modal .modal-foot .btn.ghost { background: transparent; }
.st-sheet-modal .modal-foot .btn.ghost:hover, .st-up-modal .modal-foot .btn.ghost:hover { background: var(--hover); }

/* questions */
.st-wiz-modal { border-radius: 28px; }
.st-wiz-modal .modal-body { padding: 14px 18px 4px; }
.st-wiz-top { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.st-wiz-n { color: var(--dim); font-size: 14px; }
.st-wiz-q { margin: 0 0 14px; font-size: 19px; font-weight: 600; line-height: 1.3; }
.st-wiz-opts { max-height: 340px; overflow-y: auto; margin: 0 -4px; }
.st-wiz-opt { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 13px 12px; border-radius: 14px;
  font-size: 15.5px; color: var(--text); text-align: left; }
.st-wiz-opt:hover { background: var(--hover); }
.st-wiz-opt.on { font-weight: 600; }
.st-wiz-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.st-wiz-field { width: 100%; margin-top: 8px; resize: none; }
.st-wiz-tile { width: 100%; height: 120px; border-radius: 20px; border: 1.5px dashed var(--border-2); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px; color: var(--text); font-weight: 600; transition: background .15s; }
.st-wiz-tile:hover { background: var(--hover); }
.st-wiz-tile-ic .ic { width: 26px; height: 26px; }
.st-wiz-photo { position: relative; width: 132px; height: 132px; border-radius: 18px; overflow: hidden; }
.st-wiz-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.st-wiz-foot { display: flex; align-items: center; gap: 10px; padding: 18px 0 14px; }
.st-wiz-foot .btn { border-radius: 999px; }

/* upgrade (video on Free) */
.st-up { padding: 8px 6px 0; }
.st-up .st-badge { margin: 4px 0 14px; }
.st-up-title { margin: 0 0 16px; font-size: 22px; font-weight: 600; letter-spacing: -.015em; }
.st-up-row { display: flex; gap: 14px; align-items: flex-start; padding: 9px 0; }
.st-up-row b { display: block; font-size: 15px; font-weight: 600; }
.st-up-row span:not(.st-up-n) { display: block; color: var(--dim); font-size: 14px; margin-top: 2px; }
.st-up-n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; background: var(--accent-soft);
  color: var(--accent); font-size: 13px; font-weight: 700; }

@media (max-width: 1100px) { .st-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } .st-grid-sq { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .page.studio { padding: 0 16px 40px; }
  .st-hero { padding: 30px 0 20px; }
  .st-title { font-size: 26px; }
  .st-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .st-grid-sq { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .st-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .st-grid-sq { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .st-card { border-radius: 18px; }
  .st-card-label { font-size: 13px; left: 10px; bottom: 9px; }
  .st-box { margin-bottom: 26px; border-radius: 26px; }
  .st-input { font-size: 16px; }
  .st-mine { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .st-chips { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px 18px; padding: 0 16px; scrollbar-width: none; }
  .st-chips::-webkit-scrollbar { display: none; }
  .st-chip { flex: 0 0 auto; }
  .st-sheet-modal, .st-wiz-modal, .st-up-modal { max-width: 100% !important; }
  .st-pill-k { display: none; }
  .st-pill { padding: 0 8px 0 12px; }
  .st-row-pills { flex-wrap: nowrap; }
}
@media (max-width: 380px) { .st-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (prefers-reduced-motion: reduce) {
  .st-card, .st-hero, .st-box, .st-cap, .st-photo { animation: none; transition: none; }
  .st-card:hover { transform: none; }
}

/* =========================================================================
   ★ 1.0.8 — GMAIL PAGE + CHAT EMAIL CARD (js/gmail.js)
   ========================================================================= */
.page.gmail { padding: 0 28px 48px; }
.gm-wrap { max-width: 1180px; margin: 0 auto; }
.gm-grow { flex: 1 1 auto; }
.gm-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 26px 0 18px; animation: rise .4s var(--ease) both; }
.gm-head-l { display: flex; align-items: center; gap: 14px; }
.gm-logo { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); }
.gm-title { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -.02em; }
.gm-status { display: block; color: var(--dim); font-size: 14px; margin-top: 2px; }
.gm-new { gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px; }
.gm-new .ic { width: 17px; height: 17px; }

.gm-plan { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 16px; border-radius: 20px;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent); }
.gm-plan-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); flex: 0 0 auto; }
.gm-plan-tx { flex: 1; min-width: 0; }
.gm-plan-tx b { display: block; font-size: 15px; }
.gm-plan-tx span { color: var(--dim); font-size: 13.5px; }

.gm-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.gm-main { min-width: 0; }

/* composer */
.gm-compose { position: relative; background: var(--composer); border-radius: 28px; box-shadow: 0 12px 40px rgba(0, 0, 0, .28);
  padding: 8px 8px 10px; outline: 2px dashed transparent; outline-offset: -6px; transition: outline-color .15s; animation: rise .45s .04s var(--ease) both; }
.gm-compose.drag { outline-color: var(--accent); }
.gm-field { position: relative; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 4px 12px; border-bottom: 1px solid var(--border); }
.gm-lbl { width: 46px; flex: 0 0 auto; color: var(--dim); font-size: 14px; }
.gm-from-btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px 0 12px; border-radius: 999px; background: var(--hover); color: var(--text); font-size: 14.5px; max-width: 100%; }
.gm-from-btn:hover { background: var(--press); }
.gm-from-tx { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.gm-from-sub { color: var(--dim); font-size: 12.5px; white-space: nowrap; }
.gm-pill-v { display: grid; place-items: center; color: var(--dim); }
.gm-pill-v .ic { width: 15px; height: 15px; }

.gm-addr-box { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 0; cursor: text; }
.gm-chips { display: contents; }
.gm-addr-in { flex: 1; min-width: 160px; height: 34px; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 15px; }
.gm-addr-in::placeholder, .gm-subj::placeholder { color: var(--dim-2); }
.gm-chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 4px 0 4px; border-radius: 999px; background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--border); font-size: 14px; max-width: 100%; animation: capIn .22s var(--ease) both; }
.gm-chip.bad { background: color-mix(in srgb, var(--danger) 14%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--danger) 55%, transparent); color: var(--danger); }
.gm-chip-av { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; font-size: 12px; font-weight: 700;
  background: var(--accent-soft); color: var(--accent); }
.gm-chip-tx { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gm-chip-x { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: var(--dim); flex: 0 0 auto; }
.gm-chip-x:hover { background: var(--press); color: var(--text); }
.gm-chip-x .ic { width: 12px; height: 12px; }
.gm-cc-btns { display: flex; gap: 2px; flex: 0 0 auto; align-self: center; }
.gm-ccbtn { height: 30px; padding: 0 10px; border-radius: 999px; color: var(--dim); font-size: 14px; }
.gm-ccbtn:hover { background: var(--hover); color: var(--text); }
.gm-sugg { position: absolute; left: 58px; top: calc(100% - 4px); z-index: 20; min-width: 260px; max-width: calc(100% - 70px); padding: 6px; border-radius: 16px;
  background: var(--surface); box-shadow: var(--shadow), inset 0 0 0 1px var(--border); }
.gm-sugg-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; font-size: 14.5px; color: var(--text); text-align: left; }
.gm-sugg-item:hover { background: var(--hover); }

.gm-subj { flex: 1; min-width: 0; height: 44px; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 16px; font-weight: 500; }

.gm-toolbar { display: flex; align-items: center; gap: 2px; padding: 6px 6px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.gm-toolbar::-webkit-scrollbar { display: none; }
.gm-tb { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--dim); flex: 0 0 auto; transition: background .15s, color .15s; }
.gm-tb:hover { background: var(--hover); color: var(--text); }
.gm-tb.on { background: var(--accent-soft); color: var(--accent); }
.gm-tb .ic { width: 18px; height: 18px; }
.gm-tb-sep { width: 1px; height: 20px; background: var(--border); margin: 0 6px; flex: 0 0 auto; }

.gm-body { padding: 4px 18px 6px; }
.gm-editor { min-height: 300px; max-height: 58vh; overflow-y: auto; outline: 0; padding: 14px 0; font-size: 15.5px; line-height: 1.65; color: var(--text); word-wrap: break-word; transition: opacity .2s; }
.gm-editor.empty::before { content: attr(data-ph); color: var(--dim-2); pointer-events: none; position: absolute; }
.gm-editor a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.gm-editor p { margin: 0 0 .9em; }
.gm-editor ul, .gm-editor ol { margin: 0 0 .9em; padding-left: 1.4em; }
.gm-editor.gm-working { opacity: .45; pointer-events: none; }
.gm-sig { color: var(--dim); font-size: 14.5px; line-height: 1.5; white-space: pre-wrap; padding: 4px 0 8px; }
.gm-sig-dash { display: block; }

.gm-files { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 16px 10px; }
.gm-file { display: inline-flex; align-items: center; gap: 10px; height: 48px; padding: 0 6px 0 10px; border-radius: 14px; background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--border); max-width: 260px; animation: capIn .22s var(--ease) both; }
.gm-file.loading { opacity: .7; }
.gm-file-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: color-mix(in srgb, #EA4335 18%, transparent); color: #EA4335; flex: 0 0 auto; }
.gm-file-ic .ic { width: 16px; height: 16px; }
.gm-file-tx { display: flex; flex-direction: column; min-width: 0; }
.gm-file-n { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gm-file-s { font-size: 12px; color: var(--dim); }

.gm-ai { margin: 10px 10px 4px; padding: 14px; border-radius: 20px; background: linear-gradient(135deg, color-mix(in srgb, var(--brand-a) 14%, var(--surface)), color-mix(in srgb, var(--brand-b) 10%, var(--surface)));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 26%, transparent); animation: capIn .25s var(--ease) both; }
.gm-ai-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.gm-ai-badge { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); }
.gm-ai-badge .ic { width: 16px; height: 16px; }
.gm-starters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.gm-starter { height: 32px; padding: 0 12px; border-radius: 999px; font-size: 13.5px; color: var(--text); background: var(--bg); box-shadow: inset 0 0 0 1px var(--border); transition: background .15s; }
.gm-starter:hover { background: var(--hover); }
.gm-ai-in { width: 100%; resize: none; border: 0; outline: 0; border-radius: 14px; padding: 12px 14px; background: var(--bg); color: var(--text); font: inherit; font-size: 15px; line-height: 1.5;
  box-shadow: inset 0 0 0 1px var(--border); }
.gm-ai-in:focus { box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
.gm-ai-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.gm-ai-go { gap: 6px; border-radius: 999px; height: 38px; padding: 0 16px; }
.gm-ai-go .ic { width: 16px; height: 16px; }

.gm-undo { display: flex; align-items: center; gap: 12px; margin: 8px 10px 0; padding: 10px 12px 10px 14px; border-radius: 16px; background: var(--surface-2); font-size: 14.5px; animation: capIn .2s var(--ease) both; }
.gm-undo-ring { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--accent);
  box-shadow: inset 0 0 0 2px var(--accent); }
.gm-spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border-2); border-top-color: var(--accent); animation: spin .8s linear infinite; }

.gm-foot { display: flex; align-items: center; gap: 8px; padding: 10px 8px 2px; flex-wrap: wrap; }
.gm-send { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 20px 0 22px; border-radius: 999px; background: var(--accent); color: var(--on-accent);
  font-size: 15px; font-weight: 600; transition: transform .15s, filter .15s, opacity .15s; }
.gm-send:hover:not(:disabled) { filter: brightness(1.06); transform: translateY(-1px); }
.gm-send:disabled { opacity: .55; }
.gm-send .ic { width: 17px; height: 17px; }
.gm-pill { display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px; border-radius: 999px; color: var(--text); font-size: 14px; font-weight: 500;
  box-shadow: inset 0 0 0 1px var(--border); transition: background .15s; }
.gm-pill:hover { background: var(--hover); }
.gm-pill .ic { width: 16px; height: 16px; }
.gm-pill.loading { opacity: .6; pointer-events: none; }
.gm-saved { display: inline-flex; align-items: center; gap: 5px; color: var(--ok); font-size: 13px; margin-right: 4px; }
.gm-saved .ic { width: 14px; height: 14px; }

/* side */
.gm-side { display: flex; flex-direction: column; gap: 14px; animation: rise .5s .08s var(--ease) both; }
.gm-card { background: var(--surface); border-radius: 24px; padding: 18px; box-shadow: inset 0 0 0 1px var(--border); }
.gm-h2 { margin: 0 0 12px; font-size: 15.5px; font-weight: 600; }
.gm-acc-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.gm-acc-list .skel { height: 48px; border-radius: 14px; }
.gm-acc { display: flex; align-items: center; gap: 4px; border-radius: 16px; padding: 4px 4px 4px 0; transition: background .15s; }
.gm-acc.on { background: var(--accent-soft); }
.gm-acc-pick { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 6px 8px; text-align: left; border-radius: 14px; }
.gm-acc:not(.on) .gm-acc-pick:hover { background: var(--hover); }
.gm-acc-av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; background: linear-gradient(135deg, var(--brand-a), var(--brand-b)); color: #15151A; font-weight: 700; }
.gm-acc-tx { display: flex; flex-direction: column; min-width: 0; }
.gm-acc-mail { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gm-acc-sub { font-size: 12px; color: var(--dim); }
.gm-acc.on .gm-acc-sub { color: var(--accent); font-weight: 600; }
.gm-acc-add { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; height: 44px; border-radius: 999px; background: var(--bg); color: var(--text);
  font-size: 14.5px; font-weight: 600; box-shadow: inset 0 0 0 1px var(--border-2); transition: background .15s; }
.gm-acc-add:hover { background: var(--hover); }
.gm-acc-g { display: grid; place-items: center; }
.gm-note { color: var(--dim); font-size: 13px; line-height: 1.5; margin: 10px 2px 0; }
.gm-empty { color: var(--dim); font-size: 14px; margin: 2px 2px 6px; }
.gm-tip { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--dim); line-height: 1.45; padding: 6px 0; }
.gm-tip > span:first-child { color: var(--accent); flex: 0 0 auto; display: grid; }
.gm-tip .ic { width: 17px; height: 17px; }

/* sent */
.gm-sent { text-align: center; padding: 56px 24px; background: var(--composer); border-radius: 28px; animation: rise .4s var(--ease) both; }
.gm-sent-ic { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok);
  animation: capIn .45s cubic-bezier(.2, .9, .3, 1.4) both; }
.gm-sent-ic .ic { width: 30px; height: 30px; stroke-width: 2.4; }
.gm-sent h2 { margin: 0 0 6px; font-size: 22px; }
.gm-sent p { margin: 4px 0; color: var(--dim); }
.gm-sent-subj { color: var(--text) !important; font-weight: 600; }
.gm-sent-row { display: flex; justify-content: center; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.gm-sent-row .btn { border-radius: 999px; }

/* dialogs */
.gm-link-form, .gm-sig-form { display: flex; flex-direction: column; gap: 8px; }
.gm-flabel { font-size: 13px; color: var(--dim); margin-top: 4px; }
.gm-check { display: flex; align-items: center; gap: 10px; font-size: 14px; margin-top: 6px; cursor: pointer; }
.gm-check input { width: 18px; height: 18px; accent-color: var(--accent); }
.gm-prev-meta { display: grid; gap: 6px; font-size: 14px; margin-bottom: 12px; }
.gm-prev-meta > div { display: flex; gap: 10px; min-width: 0; }
.gm-prev-meta span { width: 42px; color: var(--dim); flex: 0 0 auto; }
.gm-prev-meta b { font-weight: 500; overflow-wrap: anywhere; }
.gm-prev-subj { font-size: 18px; font-weight: 600; margin-top: 6px; }
.gm-prev-frame { width: 100%; height: 46vh; border: 0; border-radius: 16px; background: #fff; box-shadow: inset 0 0 0 1px var(--border); }
.gm-prev .gm-files { padding: 10px 0 0; }

/* the chat card (Android MailDraftCard) */
.mail-card { max-width: 620px; background: var(--surface); border-radius: 22px; padding: 16px 16px 14px; box-shadow: inset 0 0 0 1px var(--border); animation: rise .35s var(--ease) both; }
.mc-top { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.mc-logo { display: grid; place-items: center; }
.mc-title { font-size: 15.5px; }
.mc-open { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; font-size: 13px; color: var(--accent); background: var(--accent-soft); }
.mc-open .ic { width: 14px; height: 14px; }
.mc-from { display: flex; align-items: center; gap: 10px; margin: 2px 0 8px; font-size: 13.5px; color: var(--dim); }
.mc-change { color: var(--accent); font-size: 13.5px; font-weight: 600; }
.mc-lbl { display: block; font-size: 12px; color: var(--dim); margin: 10px 2px 4px; }
.mc-in { width: 100%; border: 0; outline: 0; border-radius: 12px; padding: 10px 12px; background: var(--bg); color: var(--text); font: inherit; font-size: 14.5px;
  box-shadow: inset 0 0 0 1px var(--border); resize: vertical; }
.mc-in:focus { box-shadow: inset 0 0 0 1px var(--accent); }
.mc-body { line-height: 1.55; min-height: 180px; }
.mc-err { color: var(--danger); font-size: 13.5px; margin: 8px 2px 0; }
.mc-actions { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.mc-actions .btn { border-radius: 999px; }
.mc-send { gap: 8px; }
.mc-send .ic { width: 15px; height: 15px; }

@media (max-width: 1100px) {
  .gm-grid { grid-template-columns: minmax(0, 1fr); }
  .gm-side { order: -1; display: grid; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .page.gmail { padding: 0 16px 32px; }
  .gm-head { padding: 16px 0 14px; }
  .gm-side { grid-template-columns: 1fr; order: 1; }
  .gm-tips { display: none; }
  .gm-compose { border-radius: 24px; padding: 4px 4px 8px; }
  .gm-editor { min-height: 220px; max-height: none; }
  .gm-field { padding: 4px 8px; }
  .gm-lbl { width: 40px; }
  .gm-body { padding: 4px 12px 6px; }
  .gm-foot { position: sticky; bottom: 0; background: var(--composer); border-radius: 0 0 24px 24px; padding: 10px 6px 4px; }
}
@media (max-width: 600px) {
  .gm-new span:last-child { display: none; }
  .gm-new { padding: 0 12px; }
  .gm-title { font-size: 22px; }
  .gm-plan { flex-wrap: wrap; }
  .gm-pill span:not(:first-child):not(.gm-pill-v) { display: none; }
  .gm-pill { padding: 0 12px; }
  .gm-saved span:last-child { display: none; }
  .gm-addr-in { min-width: 120px; }
  .gm-sugg { left: 8px; max-width: calc(100% - 16px); min-width: 0; right: 8px; }
  .mail-card { padding: 14px 12px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .gm-head, .gm-compose, .gm-side, .gm-chip, .gm-file, .gm-ai, .gm-sent, .mail-card { animation: none; }
}

/* ★ 1.0.9 — empty chat like Gemini: question title, box, three ideas under it */
.hero-ideas { display: none; position: relative; z-index: 1; width: 100%; max-width: calc(var(--content) + 48px); margin: 0 auto; padding: 18px 24px 0 34px; flex-direction: column; align-items: flex-start; gap: 4px; }
.chat.empty .hero-ideas { display: flex; }
.chat.empty .hero .hero-title { font-weight: 500; letter-spacing: -.025em; }
.hero-idea { display: inline-flex; align-items: center; gap: 14px; min-height: 48px; padding: 8px 16px 8px 12px; border-radius: 16px; color: var(--text);
  font-size: 16.5px; text-align: left; transition: background .18s; animation: rise .45s var(--ease) both; animation-delay: var(--d, 0ms); }
.hero-idea:hover { background: var(--hover); }
.hero-idea:active { background: var(--press); }
.hi-ic { display: grid; place-items: center; color: var(--dim); flex: 0 0 auto; }
.hi-ic .ic { width: 20px; height: 20px; }
.hero-idea:hover .hi-ic { color: var(--accent); }
@media (max-width: 860px) {
  .chat.empty .hero-ideas { order: 1; padding: 0 16px 10px; gap: 2px; }
  .chat.empty .composer-wrap { order: 2; }
  .hero-idea { font-size: 15px; min-height: 44px; padding: 6px 12px 6px 10px; }
}
@media (prefers-reduced-motion: reduce) { .hero-idea { animation: none; } }

/* =========================================================================
   ★ 1.0.10 — NOTEBOOKS (js/notebooks.js) — Gemini web layout
   ========================================================================= */
.nb-brain { width: 20px; height: 20px; }
.sb-item .ic-brain .nb-brain g:last-child { display: none; }   /* the small curls only show on the big mark */
.nb-spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border-2); border-top-color: var(--accent); animation: spin .8s linear infinite; flex: 0 0 auto; display: inline-block; }
.nb-spin.sm { width: 14px; height: 14px; }

/* new notebook */
.page.nbn { display: flex; align-items: flex-start; justify-content: center; padding: 0 24px; }
.nbn-wrap { width: 100%; max-width: 640px; margin-top: 16vh; animation: rise .4s var(--ease) both; }
.nbn-mark { display: inline-grid; place-items: center; width: 34px; height: 34px; color: var(--text); }
.nbn-mark .ic { width: 24px; height: 24px; }
.nbn-q { margin: 14px 0 4px; font-size: 22px; font-weight: 500; color: var(--text); }
.nbn-row { display: flex; align-items: center; gap: 14px; }
.nbn-input { flex: 1; min-width: 0; height: 64px; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 40px; font-weight: 500; letter-spacing: -.02em; caret-color: var(--accent); }
.nbn-input::placeholder { color: var(--dim-2); opacity: .6; }
.nbn-go { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); flex: 0 0 auto; transition: transform .15s, opacity .15s; }
.nbn-go .ic { width: 20px; height: 20px; transform: rotate(-90deg); }
.nbn-go:disabled { background: var(--hover); color: var(--dim-2); }
.nbn-go:hover:not(:disabled) { transform: scale(1.06); }
.nbn-cards { display: flex; gap: 12px; margin-top: 26px; flex-wrap: wrap; }
.nbn-card { width: 220px; min-height: 132px; padding: 16px; border-radius: 22px; background: var(--surface); text-align: left; display: flex; flex-direction: column; gap: 6px; color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border); transition: background .2s, box-shadow .2s, transform .2s; }
.nbn-card:hover { transform: translateY(-2px); }
.nbn-card b { font-size: 16px; font-weight: 600; }
.nbn-desc { font-size: 13.5px; color: var(--dim); line-height: 1.45; max-height: 0; opacity: 0; overflow: hidden; transition: max-height .3s var(--ease), opacity .25s; }
.nbn-card.on { background: color-mix(in srgb, var(--accent) 22%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 50%, transparent); }
.nbn-card.on .nbn-desc, .nbn-card:hover .nbn-desc { max-height: 80px; opacity: 1; }
.nbn-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.nbn-card-ic .ic { width: 20px; height: 20px; }
.nbn-check { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--text); color: var(--bg); opacity: 0; transform: scale(.6); transition: opacity .2s, transform .2s; }
.nbn-check .ic { width: 13px; height: 13px; stroke-width: 2.6; }
.nbn-card.on .nbn-check { opacity: 1; transform: none; }
.page.nbn.creating .nbn-cards, .page.nbn.creating .nbn-input { opacity: .5; pointer-events: none; transition: opacity .2s; }

/* notebook home */
.page.nb { padding: 0 24px 48px; }
.nb-wrap { max-width: 760px; margin: 0 auto; padding-top: 9vh; animation: rise .35s var(--ease) both; position: relative; }
.nb-tools { position: absolute; top: 12px; right: -8px; }
.nb-mark { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: color-mix(in srgb, var(--accent) 20%, var(--surface)); color: var(--accent); --nb-cut: color-mix(in srgb, var(--accent) 20%, var(--surface)); }
.nb-mark .nb-brain { width: 32px; height: 32px; }
.nb-mark.sm { width: 32px; height: 32px; border-radius: 10px; }
.nb-mark.sm .nb-brain { width: 20px; height: 20px; }
.nb-titlerow { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 14px 0 18px; }
.nb-title { margin: 0; font-size: 34px; font-weight: 500; letter-spacing: -.025em; line-height: 1.2; cursor: text; border-radius: 10px; padding: 2px 6px; margin-left: -6px; min-width: 0; overflow-wrap: anywhere; }
.nb-title:hover { background: var(--hover); }
.nb-srcpill { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px 0 12px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); color: var(--text); font-size: 14px; font-weight: 500; white-space: nowrap; flex: 0 0 auto; transition: background .15s; }
.nb-srcpill:hover { background: var(--surface-2); }
.nb-srcpill .ic { width: 16px; height: 16px; }
.nb-pdf, .nb-tile-ic { display: inline-grid; place-items: center; height: 18px; padding: 0 5px; border-radius: 5px; background: #E5484D; color: #fff; font-size: 9.5px; font-weight: 800; letter-spacing: .04em; }
.nb-tile-ic.note { background: var(--accent); color: var(--on-accent); }
.nb-tile > .nb-tile-ic, .nb-tile > .nb-spin { align-self: flex-start; }

.nb-box { position: relative; display: flex; align-items: flex-end; gap: 8px; background: var(--composer); border-radius: 30px; padding: 10px 10px 10px 22px; box-shadow: 0 10px 34px rgba(0, 0, 0, .26); transition: box-shadow .2s; }
.nb-box:focus-within { box-shadow: 0 12px 40px rgba(0, 0, 0, .32), 0 0 0 1px var(--border-2); }
.nb-input { flex: 1; min-width: 0; resize: none; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 16.5px; line-height: 1.5; padding: 9px 0; max-height: 200px; overflow-y: hidden; }
.nb-input::placeholder { color: var(--dim-2); }
.nb-send { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); flex: 0 0 auto; transition: transform .15s, background .15s; }
.nb-send .ic { width: 19px; height: 19px; }
.nb-send:disabled { background: var(--hover); color: var(--dim-2); }
.nb-box.busy .nb-send { opacity: .5; pointer-events: none; }

.nb-ideas { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 16px 0 0 8px; }
.nb-empty { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 18px; padding: 18px 20px; border-radius: 22px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); }
.nb-empty b { font-size: 16px; }
.nb-empty span { color: var(--dim); font-size: 14px; line-height: 1.5; }
.nb-empty .btn { margin-top: 4px; border-radius: 999px; }
.nb-past { margin-top: 30px; }
.nb-h2 { margin: 0 0 8px 6px; font-size: 14px; font-weight: 500; color: var(--dim); }
.nb-pastrow { display: flex; align-items: center; gap: 4px; border-radius: 14px; transition: background .15s; }
.nb-pastrow:hover { background: var(--hover); }
.nb-pastitem { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 12px 10px; text-align: left; color: var(--text); font-size: 15px; }
.nb-past-tx { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nb-past-when { color: var(--dim); font-size: 13px; flex: 0 0 auto; }
.nb-past-empty { display: flex; align-items: center; gap: 10px; color: var(--dim); font-size: 14px; margin: 6px 6px; }
.nb-past-empty .ic { width: 16px; height: 16px; }

/* notebook chat */
.page.nb.chatview { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.nb-chatbar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; max-width: 900px; width: 100%; margin: 0 auto; }
.nb-chat-title { font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.nb-scroll { flex: 1; overflow-y: auto; }
.nb-thread { padding-top: 12px; }
.nb-chatfoot { max-width: var(--content); width: 100%; margin: 0 auto; padding: 0 24px 10px; }
.nb-chatfoot .disclaimer { text-align: center; color: var(--dim-2); font-size: 12px; margin: 8px 0 0; }
.nb-chat-empty { display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--dim); padding: 12vh 0 0; text-align: center; }
.nb-cite { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; margin: 0 2px; border-radius: 6px; vertical-align: 1px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border);
  color: var(--dim); font-size: 11.5px; font-weight: 600; line-height: 1; transition: background .15s, color .15s; }
.nb-cite:hover { background: var(--accent-soft); color: var(--accent); }
.nb-acts { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; opacity: 1; }
.nb-follow { height: 32px; padding: 0 12px; border-radius: 999px; font-size: 13px; color: var(--text); box-shadow: inset 0 0 0 1px var(--border); transition: background .15s; }
.nb-follow:hover { background: var(--hover); }

/* sources sheet (Gemini) */
.nb-src-modal.modal-panel { max-width: 860px; border-radius: 28px; }
.nb-src-sub { margin: -6px 0 16px; color: var(--dim); font-size: 14px; }
.nb-src-grid { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 16px; min-height: 300px; }
.nb-src-actions { display: flex; flex-direction: column; gap: 8px; }
.nb-src-btn { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 14px; border-radius: 14px; background: var(--surface-2); color: var(--text); font-size: 14px; font-weight: 500; text-align: left; transition: background .15s; }
.nb-src-btn:hover { background: var(--press); }
.nb-src-btn .ic { width: 17px; height: 17px; }
.nb-src-main { border-radius: 18px; padding: 4px; }
.nb-tiles { display: flex; flex-wrap: wrap; gap: 10px; align-content: flex-start; }
.nb-tile { position: relative; width: 132px; height: 112px; padding: 12px; border-radius: 16px; background: var(--surface-2); display: flex; flex-direction: column; gap: 6px; animation: capIn .25s var(--ease) both; }
.nb-tile.bad { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--danger) 50%, transparent); }
.nb-tile-n { font-size: 13px; font-weight: 500; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; margin-top: 4px; }
.nb-tile-s { font-size: 12px; color: var(--dim); margin-top: auto; }
.nb-tile.bad .nb-tile-s { color: var(--danger); }
.nb-tile-x { position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--text); color: var(--bg); opacity: 0; transition: opacity .15s; }
.nb-tile-x .ic { width: 12px; height: 12px; stroke-width: 2.6; }
.nb-tile:hover .nb-tile-x, .nb-tile-x:focus-visible { opacity: 1; }
@media (hover: none) { .nb-tile-x { opacity: 1; } }
.nb-src-empty { width: 100%; min-height: 260px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; color: var(--dim); font-size: 14px; }
.nb-src-empty-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.nb-tip { margin: 16px 0 0; font-size: 12.5px; color: var(--dim); }
.nb-lib { display: flex; flex-direction: column; gap: 4px; max-height: 50vh; overflow-y: auto; }
.nb-lib .skel { height: 44px; border-radius: 12px; }
.nb-lib-row { display: flex; align-items: center; gap: 12px; padding: 8px 4px; border-bottom: 1px solid var(--border); }
.nb-lib-n { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.nb-lib-n b { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nb-lib-n span { font-size: 12px; color: var(--dim); }

@media (max-width: 860px) {
  .page.nbn { padding: 0 16px; }
  .nbn-wrap { margin-top: 8vh; }
  .nbn-input { font-size: 30px; height: 52px; }
  .nbn-card { width: calc(50% - 6px); min-height: 120px; }
  .nbn-desc { max-height: 80px; opacity: 1; }
  .page.nb { padding: 0 16px 32px; }
  .nb-wrap { padding-top: 5vh; }
  .nb-title { font-size: 27px; }
  .nb-titlerow { flex-wrap: wrap; }
  .nb-chatbar { padding: 8px 10px; }
  .nb-chatfoot { padding: 0 10px calc(8px + env(safe-area-inset-bottom)); }
  .nb-src-grid { grid-template-columns: 1fr; min-height: 0; }
  .nb-src-actions { flex-direction: row; flex-wrap: wrap; }
  .nb-src-btn { flex: 1 1 140px; }
  .nb-tile { width: calc(50% - 5px); }
}
@media (prefers-reduced-motion: reduce) { .nbn-wrap, .nb-wrap, .nb-tile { animation: none; } }

/* ★ 1.0.11 sidebar toggle (Gemini): open = panel icon, arrow points in and
   slides on hover; folded = the Amicortex mark, hover = panel icon, arrow out */
.sb-toggle { position: relative; overflow: hidden; }
.sb-toggle .tg-logo, .sb-toggle .tg-panel { position: absolute; inset: 0; display: grid; place-items: center; transition: opacity .18s var(--ease), transform .22s var(--ease); }
.sb-toggle .tg-logo { opacity: 0; transform: scale(.8); pointer-events: none; }
.sb-toggle .tg-logo .logo-mark { width: 22px; height: 22px; }
.sb-toggle .tg-arrow { transition: transform .25s var(--ease); transform-box: fill-box; transform-origin: center; }
.sb-toggle:hover .tg-arrow, .sb-toggle:focus-visible .tg-arrow { transform: translateX(-1.6px); }
@media (min-width: 861px) {
  .shell.collapsed .sb-toggle .tg-logo { opacity: 1; transform: none; }
  .shell.collapsed .sb-toggle .tg-panel { opacity: 0; transform: scale(.8); }
  .shell.collapsed .sb-toggle:hover .tg-logo, .shell.collapsed .sb-toggle:focus-visible .tg-logo { opacity: 0; transform: scale(.8); }
  .shell.collapsed .sb-toggle:hover .tg-panel, .shell.collapsed .sb-toggle:focus-visible .tg-panel { opacity: 1; transform: none; }
  .shell.collapsed .sb-toggle .tg-arrow { transform: scaleX(-1); }
  .shell.collapsed .sb-toggle:hover .tg-arrow, .shell.collapsed .sb-toggle:focus-visible .tg-arrow { transform: scaleX(-1) translateX(-1.6px); }
  .shell.collapsed .sb-toggle:hover { background: var(--hover); }
}

/* =========================================================================
   ★ 1.0.11 — DOCUMENTS (pdfdoc.js): Gemini canvas card + A4 pages
   ========================================================================= */
.dk-card { width: 100%; max-width: 760px; border-radius: 26px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--border), 0 12px 36px rgba(0, 0, 0, .22); overflow: hidden; animation: rise .35s var(--ease) both; }
.dk-bar { display: flex; align-items: center; gap: 6px; height: 56px; padding: 0 12px 0 18px; }
.dk-ic { display: grid; place-items: center; color: var(--dim); }
.dk-ic .ic { width: 18px; height: 18px; }
.dk-bar-t { font-size: 15.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; margin-left: 4px; }
.dk-saving { display: inline-flex; align-items: center; gap: 6px; color: var(--dim); font-size: 12.5px; margin-left: 8px; }
.dk-export { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px 0 12px; border-radius: 999px; color: var(--text); font-size: 14px; font-weight: 500; transition: background .15s; }
.dk-export:hover { background: var(--hover); }
.dk-export .ic { width: 16px; height: 16px; }
.dk-v { display: grid; place-items: center; color: var(--dim); }
.dk-view { position: relative; max-height: 460px; overflow-y: auto; background: color-mix(in srgb, var(--surface) 70%, #000 30%); padding: 14px 14px 18px; transition: max-height .3s var(--ease), padding .3s; }
.dk-card.folded .dk-view { max-height: 0; padding-top: 0; padding-bottom: 0; overflow: hidden; }
.dk-ghost { height: 380px; border-radius: 6px; background: linear-gradient(90deg, #f3f3f5 0%, #fafafb 50%, #f3f3f5 100%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.dk-card.forming .dk-view { max-height: 200px; }
.dk-card.forming .dk-ghost { height: 170px; }
.dk-spark { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border-2); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.dk-fileonly { display: flex; align-items: center; gap: 12px; padding: 18px; border-radius: 16px; background: var(--surface); }
.dk-fileonly b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dk-fileonly span:not(.nb-pdf) { color: var(--dim); font-size: 13px; }

/* the pages */
.dk { display: flex; flex-direction: column; align-items: center; gap: 16px; transform-origin: top center; }
.dk-measure { position: fixed; left: -10000px; top: 0; width: 794px; visibility: hidden; pointer-events: none; }
.dk-print-holder { position: fixed; left: -10000px; top: 0; width: 794px; }
.dk-page { position: relative; width: 794px; height: 1123px; flex: 0 0 auto; background: #fff; color: #1f1d24; box-shadow: 0 2px 14px rgba(0, 0, 0, .25); border-radius: 4px; overflow: hidden;
  font-family: "Plus Jakarta Sans", "Noto Sans Devanagari", "Segoe UI", Arial, sans-serif; font-size: calc(13.2px * var(--dk-scale, 1)); line-height: 1.55; }
.dk-inner { position: absolute; left: 64px; right: 64px; top: 58px; bottom: 64px; overflow: hidden; }
.dk-head { margin-bottom: 18px; }
.dk-eyebrow { display: inline-block; padding: 3px 9px; border-radius: 4px; background: var(--dk-soft); color: var(--dk-accent); font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.dk-title { margin: 12px 0 4px; font-family: Georgia, "Times New Roman", serif; font-size: calc(30px * var(--dk-scale, 1)); line-height: 1.15; font-weight: 700; color: #16141c; letter-spacing: -.01em; }
.dk-sub { margin: 0; color: #5b5867; font-size: 1.02em; }
.dk-rule { height: 2px; margin-top: 14px; background: linear-gradient(90deg, var(--dk-accent), var(--dk-soft)); border-radius: 2px; }
.dk-h1 { margin: 18px 0 8px; font-family: Georgia, "Times New Roman", serif; font-size: 1.45em; color: var(--dk-accent); font-weight: 700; line-height: 1.25; }
.dk-h2 { margin: 14px 0 6px; font-size: 1.15em; color: #16141c; font-weight: 700; }
.dk-h3 { margin: 12px 0 4px; font-size: 1.02em; color: #2c2935; font-weight: 700; }
.dk-p { margin: 0 0 9px; }
.dk-list { margin: 0 0 10px; padding-left: 1.35em; }
.dk-list li { margin: 3px 0; }
.dk-list li::marker { color: var(--dk-accent); }
.dk-quote { margin: 10px 0; padding: 8px 14px; border-left: 3px solid var(--dk-accent); color: #3b3846; font-style: italic; background: #faf9fc; }
.dk-note { margin: 10px 0; padding: 10px 14px; border-radius: 6px; background: var(--dk-tint); border-left: 3px solid var(--dk-accent); }
.dk-hr { border: 0; height: 1px; background: #e6e4ec; margin: 14px 0; }
.dk-kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 18px; margin: 8px 0 12px; padding: 10px 14px; border-radius: 6px; background: #f7f6fa; }
.dk-kv-row { display: contents; }
.dk-kv-k { color: #6b6876; font-weight: 600; }
.dk-table { width: 100%; border-collapse: collapse; margin: 8px 0 12px; font-size: .95em; }
.dk-table th { text-align: left; background: var(--dk-soft); color: #16141c; font-weight: 700; padding: 7px 9px; border-bottom: 2px solid var(--dk-accent); }
.dk-table td { padding: 6px 9px; border-bottom: 1px solid #ebe9f0; vertical-align: top; }
.dk-table tr:nth-child(even) td { background: #fbfafd; }
.dk-math { margin: 10px 0; text-align: center; overflow: hidden; }
.dk-fig { margin: 10px 0 12px; text-align: center; }
.dk-fig-svg svg { max-width: 100%; height: auto; max-height: 300px; }
.dk-fig figcaption { font-size: .88em; color: #6b6876; margin-top: 4px; }
.dk-foot { position: absolute; left: 64px; right: 64px; bottom: 26px; display: flex; justify-content: space-between; font-size: 10px; color: #9a97a6; border-top: 1px solid #efedf3; padding-top: 7px; }
.dk-break { display: none; }

/* full screen */
.dk-full { position: fixed; inset: 0; z-index: 90; background: var(--bg); display: flex; flex-direction: column; opacity: 0; transition: opacity .2s; }
.dk-full.in { opacity: 1; }
.dk-full-bar { border-bottom: 1px solid var(--border); }
.dk-full-view { flex: 1; overflow-y: auto; padding: 24px 20px 60px; background: color-mix(in srgb, var(--bg) 60%, #000 40%); }

/* video / YouTube card (Android MediaCard, Gemini style) */
.md-card { display: flex; flex-direction: column; gap: 8px; width: min(320px, 78vw); }
.md-pic { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; background: var(--surface-2); }
.md-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.md-play { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, .55); color: #fff; backdrop-filter: blur(4px); }
.md-play .ic { width: 20px; height: 20px; }
.md-len { position: absolute; right: 8px; bottom: 8px; padding: 2px 6px; border-radius: 6px; background: rgba(0, 0, 0, .7); color: #fff; font-size: 12px; font-weight: 600; }
.md-name { font-size: 13.5px; color: var(--dim); align-self: flex-end; }

/* composer: a file being attached + the active source */
.file-chip { display: inline-flex; align-items: center; gap: 10px; height: 52px; padding: 0 6px 0 10px; margin: 4px 0 0 4px; border-radius: 16px; background: var(--surface-2); max-width: 320px; animation: capIn .22s var(--ease) both; }
.fch-ic { display: grid; place-items: center; flex: 0 0 auto; }
.fch-tx { display: flex; flex-direction: column; min-width: 0; }
.fch-tx b { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fch-tx span { font-size: 12px; color: var(--dim); }
.file-chip.ready .fch-tx span { color: var(--ok); }
.file-chip .attach-x { position: static; flex: 0 0 auto; }
.src-row { padding: 2px 4px 6px; }
.src-chip { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 4px 0 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 600; max-width: 100%; }
.src-chip .ic { width: 15px; height: 15px; }
.src-tx { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.src-x { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: var(--accent); }
.src-x:hover { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.src-x .ic { width: 12px; height: 12px; }

/* notebook: create notes */
.nb-notes-head { display: flex; align-items: center; justify-content: space-between; }
.nb-notes .nb-pastitem .nb-pdf { flex: 0 0 auto; }
.nb-partial { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; color: var(--dim); font-size: 13.5px; }
.nbx { display: flex; flex-direction: column; gap: 6px; }
.nbx-l { margin: 8px 0 2px; font-size: 13px; color: var(--dim); font-weight: 600; }
.nbx-list { display: flex; flex-direction: column; gap: 4px; max-height: 180px; overflow-y: auto; }
.nbx-opt { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; text-align: left; color: var(--text); box-shadow: inset 0 0 0 1px var(--border); }
.nbx-opt.on { box-shadow: inset 0 0 0 2px var(--accent); background: var(--accent-soft); }
.nbx-t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.nbx-s { color: var(--dim); font-size: 12px; }
.nbx-styles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.nbx-style { display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: 14px; text-align: left; color: var(--text); box-shadow: inset 0 0 0 1px var(--border); transition: background .15s; }
.nbx-style b { font-size: 14px; }
.nbx-style span { font-size: 12.5px; color: var(--dim); line-height: 1.4; }
.nbx-style.on { box-shadow: inset 0 0 0 2px var(--accent); background: var(--accent-soft); }
.nbx-view .modal-body { padding: 0 12px 14px; }
.nbx-view .dk-card { box-shadow: none; background: transparent; }

@media (max-width: 860px) {
  .dk-card { border-radius: 22px; }
  .dk-bar { padding: 0 6px 0 12px; height: 52px; }
  .dk-export span:nth-child(2) { display: none; }
  .dk-view { max-height: 380px; padding: 10px; }
  .nbx-styles { grid-template-columns: 1fr; }
}
@media print { .dk-full { position: static; } }

/* ★ 1.0.12 installed window: the title bar strip is the sidebar colour over the
   sidebar and the page colour over the page — one surface, like Gemini */
.wco.sb-folded .titlebar { background: linear-gradient(90deg, var(--surface) 0 calc(var(--rail-w) - env(titlebar-area-x, 0px)), var(--bg) calc(var(--rail-w) - env(titlebar-area-x, 0px))); }
@media (max-width: 860px) { .wco .titlebar { background: var(--bg); } }

/* ★ 1.0.12 notebook chat: how many questions it holds */
.nb-past-ic { display: grid; place-items: center; color: var(--dim); flex: 0 0 auto; }
.nb-past-ic .ic { width: 17px; height: 17px; }
.nb-past-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.nb-past-sub { font-size: 12.5px; color: var(--dim); }
.nb-chat-head { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.nb-chat-sub { font-size: 12px; color: var(--dim); }

/* =========================================================================
   ★ 1.0.13 — SETTINGS + PROFILE (settings.js), ChatGPT-style full window
   ========================================================================= */
.shell.in-settings .sidebar, .shell.in-settings .topbar, .shell.in-settings .sb-scrim { display: none !important; }
.shell.in-settings .main { margin: 0; }
.page.sx-page { display: grid; grid-template-columns: 280px minmax(0, 1fr); padding: 0; overflow: hidden; }
.sx-side { display: flex; flex-direction: column; gap: 6px; padding: 14px 12px; background: var(--surface); overflow-y: auto; }
.sx-back { display: inline-flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; border-radius: 12px; color: var(--text); font-size: 14.5px; font-weight: 500; transition: background .15s; }
.sx-back:hover { background: var(--hover); }
.sx-back .ic { width: 18px; height: 18px; }
.sx-searchwrap { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; margin: 4px 0 6px; border-radius: 12px; background: var(--bg); color: var(--dim); box-shadow: inset 0 0 0 1px var(--border); }
.sx-searchwrap .ic { width: 16px; height: 16px; }
.sx-search { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 14px; }
.sx-group { margin: 6px 12px 4px; font-size: 12.5px; color: var(--dim); font-weight: 600; }
.sx-list { display: flex; flex-direction: column; gap: 2px; }
.sx-nav { display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px; border-radius: 12px; color: var(--text); font-size: 14.5px; text-align: left; transition: background .15s; }
.sx-nav:hover { background: var(--hover); }
.sx-nav.on { background: var(--press); font-weight: 600; }
.sx-nav-ic { display: grid; place-items: center; color: var(--dim); }
.sx-nav.on .sx-nav-ic { color: var(--accent); }
.sx-nav-ic .ic { width: 18px; height: 18px; }
.sx-nav-ext { margin-left: auto; color: var(--dim-2); display: grid; }
.sx-nav-ext .ic { width: 14px; height: 14px; }
.sx-pane { overflow-y: auto; padding: 40px 32px 60px; }
.sx-pane-in { max-width: 720px; margin: 0 auto; }
.sx-anim { animation: rise .3s var(--ease) both; }
.sx-h { margin-bottom: 18px; }
.sx-h h2 { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -.02em; }
.sx-h p { margin: 6px 0 0; color: var(--dim); font-size: 14.5px; }
.sx-sub { margin: 26px 0 10px; font-size: 15px; font-weight: 600; }
.sx-card { border-radius: 20px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); margin-bottom: 14px; overflow: hidden; }
.sx-row { display: flex; align-items: center; gap: 16px; min-height: 60px; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.sx-card > .sx-row:last-child, .sx-card > :last-child.sx-row { border-bottom: 0; }
.sx-row.col { flex-direction: column; align-items: stretch; gap: 10px; }
.sx-row-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sx-row-tx b { font-size: 14.5px; font-weight: 500; }
.sx-row-tx span { font-size: 13px; color: var(--dim); line-height: 1.45; }
.sx-row-ctl { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; max-width: 60%; }
.sx-muted { color: var(--dim); font-size: 13.5px; }
.sx-pad { padding: 12px 18px; margin: 0; }
.sx-note { color: var(--dim); font-size: 13px; line-height: 1.5; margin: 6px 4px 0; }
.sx-lbl { display: block; font-size: 13px; color: var(--dim); margin: 10px 0 6px; }
.sx-switch { position: relative; width: 44px; height: 26px; flex: 0 0 auto; cursor: pointer; }
.sx-switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.sx-knob { position: absolute; inset: 0; border-radius: 999px; background: var(--border-2); transition: background .2s; }
.sx-knob::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.sx-switch input:checked + .sx-knob { background: var(--accent); }
.sx-switch input:checked + .sx-knob::after { transform: translateX(18px); }
.sx-switch input:focus-visible + .sx-knob { outline: 2px solid var(--accent); outline-offset: 2px; }
.sx-pill { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px 0 14px; border-radius: 999px; background: var(--hover); color: var(--text); font-size: 13.5px; font-weight: 500; }
.sx-pill:hover { background: var(--press); }
.sx-pill-v { display: grid; color: var(--dim); }
.sx-pill-v .ic { width: 14px; height: 14px; }
.sx-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.sx-chip { height: 32px; padding: 0 12px; border-radius: 999px; font-size: 13px; color: var(--text); box-shadow: inset 0 0 0 1px var(--border); transition: background .15s; }
.sx-chip:hover { background: var(--hover); }
.sx-chip.on { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent); font-weight: 600; }
.sx-fieldwrap { position: relative; width: 100%; min-width: 220px; }
.sx-field { width: 100%; resize: vertical; }
.sx-tick { position: absolute; right: 10px; top: 10px; color: var(--ok); display: grid; }
.sx-tick .ic { width: 15px; height: 15px; }
.sx-cards3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
.sx-choice { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 16px; text-align: left; color: var(--text); background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); transition: background .15s, box-shadow .15s; }
.sx-choice b { font-size: 14.5px; }
.sx-choice span { font-size: 12.5px; color: var(--dim); line-height: 1.45; }
.sx-choice:hover { background: var(--surface-2); }
.sx-choice.on { box-shadow: inset 0 0 0 2px var(--accent); background: var(--accent-soft); }
.sx-mixrow { display: flex; align-items: center; gap: 12px; padding: 0 18px 12px; }
.sx-range { flex: 1; accent-color: var(--accent); }
.sx-shortcuts { display: flex; flex-direction: column; gap: 6px; padding: 0 18px; }
.sx-sc { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--bg); }
.sx-sc code { font-family: var(--mono); font-size: 13px; padding: 2px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); }
.sx-sc-arrow { color: var(--dim); }
.sx-sc-t { flex: 1; min-width: 0; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sx-memory { width: 100%; }
.sx-memory .skel { height: 16px; margin: 6px 0; }
.sx-mem-text { margin: 0; white-space: pre-wrap; font: inherit; font-size: 13.5px; line-height: 1.6; color: var(--text); max-height: 260px; overflow-y: auto; padding: 12px 14px; border-radius: 12px; background: var(--bg); }
.sx-modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.sx-mode { display: flex; flex-direction: column; gap: 8px; padding: 8px; border-radius: 18px; text-align: center; color: var(--text); box-shadow: inset 0 0 0 1px var(--border); transition: box-shadow .15s; }
.sx-mode.on { box-shadow: inset 0 0 0 2px var(--accent); }
.sx-mode-t { font-size: 13.5px; font-weight: 500; padding-bottom: 4px; }
.sx-mode-pic { position: relative; display: flex; height: 92px; border-radius: 12px; overflow: hidden; }
.sx-mode-pic.light { background: #ffffff; } .sx-mode-pic.light .mp-side { background: #f1f1f4; }
.sx-mode-pic.dark, .sx-mode-pic.system { background: #101014; } .sx-mode-pic.dark .mp-side, .sx-mode-pic.system .mp-side { background: #1b1b21; }
.mp-side { width: 28%; }
.mp-main { flex: 1; padding: 14px 12px; display: flex; flex-direction: column; gap: 6px; }
.mp-l { height: 6px; width: 70%; border-radius: 4px; background: #8a8a96; opacity: .5; }
.mp-l.s { width: 45%; }
.mp-box { margin-top: auto; height: 16px; border-radius: 8px; background: var(--accent); opacity: .85; }
.mp-half { position: absolute; inset: 0 0 0 50%; background: #ffffff; }
.mp-half::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 14px; height: 16px; border-radius: 8px; background: var(--accent); opacity: .85; }
.sx-swatches { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 14px; }
.sx-swatch { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; color: var(--text); font-size: 13px; text-align: left; transition: background .15s; }
.sx-swatch:hover { background: var(--hover); }
.sx-swatch.on { background: var(--press); font-weight: 600; }
.sx-sw-dot { width: 24px; height: 24px; border-radius: 50%; flex: 0 0 auto; background: linear-gradient(135deg, var(--sw), var(--sw2)); box-shadow: 0 0 0 2px var(--bg); }
.sx-swatch.on .sx-sw-dot { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--sw); }
.sx-sw-t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sx-avatar-btn { position: relative; border-radius: 50%; }
.sx-avatar-cam, .pf-cam { position: absolute; right: -2px; bottom: -2px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--text); color: var(--bg); box-shadow: 0 0 0 2px var(--surface); }
.sx-avatar-cam .ic { width: 12px; height: 12px; }
.avatar.md { width: 44px; height: 44px; font-size: 16px; }
.avatar.xl { width: 104px; height: 104px; font-size: 36px; }
.sx-inline-wrap { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; }
.sx-inline { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 4px 8px; border-radius: 10px; color: var(--text); font-size: 14px; }
.sx-inline:hover { background: var(--hover); }
.sx-inline span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sx-inline-ic { display: grid; color: var(--dim); opacity: .7; }
.sx-inline-ic .ic { width: 14px; height: 14px; }
.sx-inline-in { height: 34px; padding: 0 10px; border-radius: 10px; border: 0; outline: 0; background: var(--bg); color: var(--text); font: inherit; font-size: 14px; box-shadow: inset 0 0 0 1px var(--accent); min-width: 180px; }
.sx-inline-state { font-size: 12px; color: var(--dim); }
.sx-keys { display: inline-flex; gap: 4px; }
.sx-keys kbd { min-width: 26px; height: 26px; padding: 0 7px; border-radius: 7px; display: inline-grid; place-items: center; background: var(--bg); box-shadow: inset 0 0 0 1px var(--border-2), 0 1px 0 var(--border-2); font: 600 12px var(--font); color: var(--text); }
.sx-plan { display: flex; align-items: center; gap: 14px; padding: 16px 18px; }
.sx-plan-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.sx-plan-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sx-plan-tx span { color: var(--dim); font-size: 13px; }
.sx-store { margin: 0 0 14px; }
.sx-store b { display: block; font-size: 14.5px; margin-bottom: 10px; }
.sx-bar { height: 6px; border-radius: 999px; background: var(--hover); overflow: hidden; }
.sx-bar.big { height: 8px; }
.sx-bar span { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.sx-danger-list { margin: 0 0 8px; padding-left: 1.2em; color: var(--text); font-size: 14px; line-height: 1.7; }

/* profile */
.page.pf-page { padding: 14px 24px 60px; }
.pf-top { display: flex; align-items: center; gap: 10px; max-width: 760px; margin: 0 auto; }
.pf-hero { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 36px auto 26px; text-align: center; animation: rise .35s var(--ease) both; }
.pf-photo { position: relative; border-radius: 50%; margin-bottom: 10px; }
.pf-photo .pf-cam { width: 30px; height: 30px; right: 2px; bottom: 2px; box-shadow: 0 0 0 3px var(--bg); }
.pf-photo .pf-cam .ic { width: 15px; height: 15px; }
.pf-photo:hover .avatar { filter: brightness(.9); }
.pf-hero .sx-inline-wrap { justify-content: center; }
.pf-hero .sx-inline.pf-name { font-size: 26px; font-weight: 600; letter-spacing: -.02em; }
.pf-hero .sx-inline.pf-user { color: var(--dim); font-size: 14.5px; }
.pf-mail { color: var(--dim-2); font-size: 13px; }
.pf-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; max-width: 640px; margin: 0 auto; }
.pf-stat { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px 8px; border-radius: 18px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); }
.pf-stat b { font-size: 20px; font-weight: 600; }
.pf-stat span { font-size: 12.5px; color: var(--dim); }
.pf-note { text-align: center; max-width: 640px; margin: 18px auto 0; }

@media (max-width: 860px) {
  .page.sx-page { grid-template-columns: 1fr; }
  .sx-page.has-section .sx-side { display: none; }
  .sx-page:not(.has-section) .sx-pane { display: none; }
  .sx-pane { padding: 14px 16px 40px; }
  .sx-back-pane { margin: 0 0 8px -6px; }
  .sx-row { flex-wrap: wrap; padding: 12px 14px; }
  .sx-row-ctl { max-width: 100%; width: 100%; justify-content: flex-start; }
  .sx-row-ctl:has(.sx-switch), .sx-row-ctl:has(.btn), .sx-row-ctl:has(.sx-pill) { width: auto; }
  .sx-chips { justify-content: flex-start; }
  .sx-cards3 { grid-template-columns: 1fr 1fr; }
  .sx-swatches { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sx-inline-wrap { justify-content: flex-start; }
  .pf-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page.pf-page { padding: 10px 16px 40px; }
}

/* ===================== ★ 1.0.15 LIBRARY FILES (PDF · Music · Video) ===================== */
.lib-subs { max-width: 1100px; margin: -6px auto 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.lib-sub { height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); color: var(--dim); font-size: 13.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 7px; transition: background .15s, color .15s, border-color .15s; }
.lib-sub .ic { width: 16px; height: 16px; }
.lib-sub:hover { color: var(--text); background: var(--hover); }
.lib-sub.on { background: var(--accent-soft); color: var(--text); border-color: transparent; }
.lib-warn { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; background: var(--surface); color: var(--dim); font-size: 14px; }
.lib-warn .ic { width: 18px; height: 18px; color: var(--danger); }
.lib-warn .btn { margin-left: auto; }
.lib-file { display: flex; flex-direction: column; text-align: left; border: 1px solid var(--border); background: var(--surface); }
.lf-top { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; overflow: hidden; }
.lf-top.pdf { background: var(--surface-2); }
.lf-top.song { background: radial-gradient(120% 120% at 20% 10%, var(--accent) 0%, var(--accent-end, var(--accent)) 55%, #120f1c 100%); }
.lf-top.video { background: #000; }
.lf-top video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; transition: transform .3s var(--ease); }
.lib-file:hover .lf-top video, .lib-file:hover .lf-big { transform: scale(1.06); }
.lf-big { width: 64px; height: 64px; display: grid; place-items: center; transition: transform .3s var(--ease); }
.lf-big .ic { width: 52px; height: 52px; }
.lf-top.pdf .lf-big { color: #e5484d; }
.lf-top.song .lf-big { color: #fff; filter: drop-shadow(0 6px 18px rgba(0, 0, 0, .35)); }
.lf-play { position: absolute; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, .55); color: #fff; backdrop-filter: blur(6px); }
.lf-play .ic { width: 22px; height: 22px; }
.lf-tx { display: flex; flex-direction: column; gap: 2px; padding: 9px 12px 11px; min-width: 0; }
.lf-tx b { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.lf-tx span { font-size: 12.5px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-label { position: absolute; top: 10px; left: 10px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: .02em; display: inline-flex; align-items: center; color: #fff; background: rgba(0, 0, 0, .55); backdrop-filter: blur(6px); }
.lib-label.pdf { background: #e5484d; }
.lib-label.song { background: rgba(0, 0, 0, .45); }
.lib-label.video { background: rgba(0, 0, 0, .55); }
.mv { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.mv-cover { width: 160px; height: 160px; border-radius: 28px; display: grid; place-items: center; color: #fff;
  background: radial-gradient(120% 120% at 20% 10%, var(--accent) 0%, var(--accent-end, var(--accent)) 55%, #120f1c 100%); box-shadow: 0 18px 50px rgba(0, 0, 0, .35); }
.mv-cover .ic { width: 70px; height: 70px; }
.mv-audio { width: 100%; }
.mv-video { width: 100%; max-height: 70vh; border-radius: 16px; background: #000; }
.mv-video:not(.wide) { width: auto; max-width: 100%; height: 66vh; }
.mv-meta { display: flex; align-items: center; gap: 10px; color: var(--dim); font-size: 13px; }
.mv-meta .lib-label { position: static; }
@media (max-width: 860px) {
  .lib-subs { margin: 0 0 10px; gap: 6px; }
  .lib-sub { height: 32px; padding: 0 11px; font-size: 13px; }
  .lf-tx { padding: 7px 9px 9px; }
  .lf-tx b { font-size: 13px; }
  .lf-big { width: 48px; height: 48px; }
  .lf-big .ic { width: 40px; height: 40px; }
  .mv-video:not(.wide) { height: 60vh; }
}

/* ===================== ★ 1.0.15 WAVE (live voice conversation) ===================== */
.wave-screen { position: fixed; inset: 0; z-index: 400; display: flex; flex-direction: column; align-items: center;
  background: radial-gradient(90% 70% at 50% 38%, color-mix(in srgb, var(--accent) 16%, var(--bg)) 0%, var(--bg) 70%);
  color: var(--text); opacity: 0; transition: opacity .24s var(--ease); --lv: 0; padding: env(safe-area-inset-top) 16px env(safe-area-inset-bottom); }
.wave-screen.in { opacity: 1; }
.wv-top { width: 100%; max-width: 900px; display: flex; align-items: center; gap: 12px; padding: 14px 0; }
.wv-brand { display: flex; align-items: center; gap: 8px; font-size: 17px; }
.wv-mark svg { width: 26px; height: 26px; display: block; }
.wv-chip { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 13px; border-radius: 999px; background: var(--surface); color: var(--dim); font-size: 13px; font-weight: 600; margin-left: auto; }
.wv-chip .ic { width: 16px; height: 16px; color: var(--accent); }
.wv-x { margin-left: 4px; }
.wv-mid { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; }
.wv-orb { position: relative; width: 210px; height: 210px; display: grid; place-items: center; }
.wv-orb-core { width: 150px; height: 150px; border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #fff 0%, var(--accent) 34%, var(--accent-end) 78%, transparent 100%);
  box-shadow: 0 0 calc(40px + var(--lv) * 90px) color-mix(in srgb, var(--accent) 55%, transparent);
  transform: scale(calc(.92 + var(--lv) * .32)); transition: transform .08s linear, box-shadow .08s linear; }
.wv-orb-ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); opacity: 0; }
.wave-screen[data-state="listening"] .wv-orb-ring { animation: wvRing 2.4s ease-out infinite; }
.wave-screen[data-state="listening"] .wv-orb-ring.r2 { animation-delay: 1.2s; }
.wave-screen[data-state="thinking"] .wv-orb-core { animation: wvThink 1.4s ease-in-out infinite; }
.wave-screen[data-state="starting"] .wv-orb-core, .wave-screen[data-state="failed"] .wv-orb-core { filter: grayscale(.7) brightness(.7); transform: scale(.85); }
@keyframes wvRing { 0% { transform: scale(.72); opacity: .7; } 100% { transform: scale(1.25); opacity: 0; } }
@keyframes wvThink { 0%, 100% { transform: scale(.9) rotate(0deg); filter: hue-rotate(0deg); } 50% { transform: scale(1.02) rotate(180deg); filter: hue-rotate(25deg); } }
.wv-status { font-size: 15px; color: var(--dim); font-weight: 600; letter-spacing: .01em; min-height: 20px; }
.wv-talk { width: 100%; max-width: 760px; min-height: 120px; max-height: 32vh; overflow-y: auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 4px 10px; }
.wv-you { margin: 0; color: var(--dim); font-size: 15px; }
.wv-you:not(:empty)::before { content: "You: "; font-weight: 600; }
.wv-ai { margin: 0; font-size: 20px; line-height: 1.5; font-weight: 500; white-space: pre-wrap; }
.wv-note { margin: 4px 0 0; font-size: 14px; color: var(--dim); background: var(--surface); padding: 8px 14px; border-radius: 12px; }
.wv-note.bad { color: var(--danger); }
.wv-bar { display: flex; align-items: center; gap: 18px; padding: 18px 0 28px; }
.wv-btn { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--text); transition: background .15s, transform .15s; }
.wv-btn .ic { width: 26px; height: 26px; }
.wv-btn:hover { background: var(--surface-2); }
.wv-btn.off { background: var(--text); color: var(--bg); }
.wv-end { height: 60px; padding: 0 28px; border-radius: 999px; display: inline-flex; align-items: center; gap: 8px; background: #e5484d; color: #fff; font-size: 16px; font-weight: 700; transition: filter .15s, transform .15s; }
.wv-end .ic { width: 22px; height: 22px; }
.wv-end:hover { filter: brightness(1.08); }
.wv-btn:active, .wv-end:active { transform: scale(.96); }
@media (max-width: 860px) {
  .wv-chip { height: 30px; font-size: 12.5px; }
  .wv-orb { width: 170px; height: 170px; }
  .wv-orb-core { width: 120px; height: 120px; }
  .wv-ai { font-size: 18px; }
  .wv-bar { padding-bottom: 22px; }
}
@media (prefers-reduced-motion: reduce) { .wv-orb-ring, .wv-orb-core { animation: none !important; } }

/* ★ 1.0.15 Razorpay on the Upgrade screen */
.plan-buy { margin-top: 12px; width: 100%; height: 42px; }
.plan-buy[disabled] { opacity: .7; cursor: progress; }
.upgrade-legal { margin: 14px 0 0; font-size: 12.5px; color: var(--dim); text-align: center; }
.upgrade-legal a { color: var(--text); text-decoration: underline; }

/* ===================== ★ 1.0.16 PDF VIEWER (in the app) ===================== */
.pdf-screen { position: fixed; inset: 0; z-index: 410; display: flex; flex-direction: column; background: var(--bg); color: var(--text); opacity: 0; transition: opacity .2s var(--ease); outline: none; }
.pdf-screen.in { opacity: 1; }
.pv-top { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--bg-2); padding-top: max(10px, env(safe-area-inset-top)); }
.pv-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; }
.pv-title b { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-badge { flex: none; height: 22px; padding: 0 8px; border-radius: 999px; background: #e5484d; color: #fff; font-size: 11.5px; font-weight: 700; display: inline-flex; align-items: center; }
.pv-tools { display: flex; align-items: center; gap: 2px; }
.pv-z { font-size: 20px; font-weight: 600; line-height: 1; }
.pv-count { min-width: 64px; text-align: center; font-size: 13px; color: var(--dim); font-variant-numeric: tabular-nums; }
.pv-scroll { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; background: var(--surface); }
.pv-pages { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 16px 12px 40px; min-width: min-content; }
.pv-page { background: #fff; border-radius: 4px; box-shadow: 0 2px 14px rgba(0, 0, 0, .28); display: grid; place-items: center; overflow: hidden; max-width: none; }
.pv-page canvas { display: block; }
.pv-ph { color: #9a9aa5; font-size: 14px; }
.pv-status { position: absolute; inset: 64px 0 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--dim); font-size: 15px; text-align: center; padding: 0 24px; }
.pv-spin { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--border-2); border-top-color: var(--accent); animation: pvSpin .8s linear infinite; }
@keyframes pvSpin { to { transform: rotate(360deg); } }
@media (max-width: 860px) {
  .pv-top { gap: 6px; padding: 8px 8px; }
  .pv-count { min-width: 50px; font-size: 12px; }
  .pv-z { display: none; }
  .pv-pages { gap: 10px; padding: 10px 6px 30px; }
}
.wv-you.live { color: var(--text); font-style: italic; }


/* ===================== ★ 1.0.18 WAVE — minimize · pop-out · rest ===================== */
.wv-min { margin-right: 2px; }
.wv-live { display: inline-flex; align-items: center; height: 18px; padding: 0 7px; border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: .08em;
  color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-end)); margin-left: 4px; }
.wv-bar { gap: 14px; }
.wave-screen[hidden] { display: none; }
.wave-screen[data-state="sleeping"] .wv-orb-core { filter: saturate(.35) brightness(.75); transform: scale(.86); animation: wvRest 3.2s ease-in-out infinite; }
.wave-screen[data-state="sleeping"] .wv-orb { cursor: pointer; }
@keyframes wvRest { 0%, 100% { opacity: .65; } 50% { opacity: 1; } }

.wave-pill { position: fixed; z-index: 380; left: 50%; bottom: 112px; transform: translate(-50%, 16px) scale(.96); opacity: 0;
  display: flex; align-items: center; gap: 6px; padding: 7px 8px 7px 7px; border-radius: 999px; --lv: 0;
  background: color-mix(in srgb, var(--bg-2) 86%, transparent); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid var(--border-2); box-shadow: 0 18px 50px rgba(0, 0, 0, .38), 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent);
  transition: transform .26s var(--ease), opacity .26s var(--ease); color: var(--text); max-width: calc(100vw - 24px); }
.wave-pill.in { transform: translate(-50%, 0) scale(1); opacity: 1; }
.wave-pill[hidden] { display: none; }
.wp-orb-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.wp-orb { width: 36px; height: 36px; border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #fff 0%, var(--accent) 36%, var(--accent-end) 80%, transparent 100%);
  box-shadow: 0 0 calc(8px + var(--lv) * 26px) color-mix(in srgb, var(--accent) 60%, transparent);
  transform: scale(calc(.9 + var(--lv) * .35)); transition: transform .08s linear, box-shadow .08s linear; }
.wave-pill[data-state="thinking"] .wp-orb { animation: wvThink 1.4s ease-in-out infinite; }
.wave-pill[data-state="sleeping"] .wp-orb, .wave-pill[data-state="failed"] .wp-orb { filter: saturate(.35) brightness(.75); }
.wp-tx { display: flex; flex-direction: column; min-width: 0; padding: 0 6px 0 2px; margin-right: 4px; }
.wp-tx b { font-size: 13.5px; display: flex; align-items: center; }
.wp-tx b .wv-live { height: 16px; font-size: 9px; padding: 0 6px; }
.wp-status { font-size: 12.5px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 190px; }
.wp-btn { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: var(--text); flex: none; transition: background .15s, transform .15s; }
.wp-btn .ic { width: 19px; height: 19px; }
.wp-btn:hover { background: var(--hover); }
.wp-btn.off { background: var(--text); color: var(--bg); }
.wp-end { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: #e5484d; color: #fff; flex: none; margin-left: 2px; transition: filter .15s, transform .15s; }
.wp-end .ic { width: 18px; height: 18px; }
.wp-end:hover { filter: brightness(1.1); }
.wp-btn:active, .wp-end:active, .wp-orb-btn:active { transform: scale(.94); }
/* in the pop-out window the pill IS the window */
body.pip-body { margin: 0; background: var(--bg); overflow: hidden; display: grid; place-items: center; min-height: 100vh; }
body.pip-body .wave-pill { position: static; transform: none; opacity: 1; width: calc(100% - 12px); box-shadow: none; justify-content: flex-start; }
body.pip-body .wp-tx { flex: 1; }
body.pip-body .wp-status { max-width: none; }
@media (max-width: 860px) {
  .wave-pill { bottom: 128px; padding: 6px; gap: 4px; }
  .wp-status { max-width: 120px; }
  .wp-btn, .wp-end { width: 36px; height: 36px; }
}

/* web-search line + upload progress shimmer too */
.web-line .wl-tx { font-weight: 500; }

/* ★ 1.0.18 bigger app-open logo (it looked tiny on a PC) */
.boot { background: radial-gradient(60% 50% at 50% 48%, color-mix(in srgb, var(--accent) 10%, var(--bg)) 0%, var(--bg) 70%); }
.boot > .boot-mark { width: 112px; height: 112px; filter: drop-shadow(0 12px 40px color-mix(in srgb, var(--accent) 45%, transparent)); }
@media (max-width: 860px) { .boot > .boot-mark { width: 84px; height: 84px; } }
.mic-btn.busy { animation: breathe 1s var(--ease) infinite; }
.wv-chip { white-space: nowrap; flex: none; }
@media (max-width: 860px) { .wv-chip { padding: 0 10px; } .wv-brand { font-size: 16px; } }

/* ===================== ★ 1.0.19 GEMINI-STYLE ANSWER TYPOGRAPHY ===================== */
.rich { font-size: 16.5px; line-height: 1.75; letter-spacing: .002em; }
.rich p { margin: 0 0 1em; }
.rich h1, .rich h2, .rich h3, .rich h4 { font-weight: 600; letter-spacing: -.012em; line-height: 1.32; margin: 1.6em 0 .6em; color: var(--text); }
.rich h1 { font-size: 1.5em; } .rich h2 { font-size: 1.32em; } .rich h3 { font-size: 1.2em; } .rich h4 { font-size: 1.04em; }
.rich > h1:first-child, .rich > h2:first-child, .rich > h3:first-child { margin-top: .2em; }
.rich ul, .rich ol { margin: 0 0 1.1em; padding-left: 1.55em; }
.rich ul { list-style: disc; } .rich ul ul { list-style: circle; } .rich ul ul ul { list-style: square; }
.rich li { margin: .5em 0; padding-left: .25em; }
.rich li > p { margin: .25em 0; }
.rich li > ul, .rich li > ol { margin: .35em 0 .2em; }
.rich ol > li::marker { font-weight: 600; color: var(--text); }
.rich ul > li::marker { color: var(--dim); font-size: 1.05em; }
.rich strong { font-weight: 650; color: var(--text); }
.rich em { color: var(--text); }
.rich hr { height: 1px; background: var(--border); margin: 1.7em 0 1.3em; }
.rich blockquote { margin: 0 0 1.1em; padding: 12px 16px; border-left: 3px solid var(--accent); background: var(--surface); border-radius: 0 12px 12px 0; color: var(--text); }
.rich blockquote > :last-child { margin-bottom: 0; }
.table-wrap { margin: .3em 0 1.2em; border-radius: 16px; border: 1px solid var(--border); background: var(--bg); }
.rich th { background: transparent; font-weight: 600; border-bottom: 1.5px solid var(--border-2); padding: 12px 16px; white-space: nowrap; }
.rich td { padding: 12px 16px; }
.rich tbody tr { transition: background .15s; }
.rich tbody tr:hover { background: var(--hover); }
.rich h3 + p, .rich h3 + ul, .rich h3 + ol { margin-top: 0; }
@media (max-width: 860px) {
  .rich { font-size: 16px; line-height: 1.72; }
  .rich h1 { font-size: 1.38em; } .rich h2 { font-size: 1.24em; } .rich h3 { font-size: 1.14em; }
  .rich th, .rich td { padding: 10px 12px; }
}

/* ===================== ★ 1.0.20 LIBRARY SHIMMER ===================== */
.lib-tile.skel, .lib-tile.loading, .lf-top.loading {
  background: linear-gradient(100deg, var(--surface) 20%, var(--surface-2) 50%, var(--surface) 80%) !important;
  background-size: 250% 100% !important; animation: shimmer 1.4s linear infinite; animation-delay: var(--d, 0ms);
}
.lib-tile.loading img, .lf-top.loading video { opacity: 0; }
.lib-tile img, .lf-top video { transition: opacity .35s var(--ease), transform .3s var(--ease); }
.lib-count-skel { display: inline-block; width: 70px; height: 12px; border-radius: 6px; vertical-align: middle; }

/* ===================== ★ 1.0.20 PLANS PAGE (ChatGPT-style) ===================== */
.plans-page { max-width: 1060px; margin: 0 auto; padding: 18px 24px 60px; }
.pp-top { display: flex; }
.pp-back { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px 0 10px; border-radius: 999px; color: var(--dim); font-weight: 600; font-size: 14px; }
.pp-back:hover { background: var(--hover); color: var(--text); }
.pp-back .ic { width: 18px; height: 18px; }
.pp-head { text-align: center; margin: 6px 0 28px; }
.pp-title { font-size: 34px; font-weight: 600; letter-spacing: -.02em; margin: 0 0 8px; }
.pp-sub { margin: 0; color: var(--dim); font-size: 15px; }
.pp-reason { display: inline-flex; align-items: center; gap: 8px; margin: 14px 0 0; padding: 8px 14px; border-radius: 12px; background: var(--accent-soft); font-size: 14px; }
.pp-reason .ic { width: 17px; height: 17px; color: var(--accent); }
.pp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.pp-card { position: relative; display: flex; flex-direction: column; padding: 26px 26px 24px; border-radius: 22px; background: var(--bg-2); border: 1px solid var(--border); }
.pp-card.blue { border-color: #3b6fe0; background: linear-gradient(180deg, #16305f 0%, #122444 46%, #0f1a30 100%); color: #f2f5ff;
  box-shadow: 0 24px 60px rgba(24, 66, 160, .28), inset 0 1px 0 rgba(255, 255, 255, .08); }
:root[data-theme="light"] .pp-card.blue { background: linear-gradient(180deg, #e8f0ff 0%, #f4f8ff 60%, #fff 100%); color: #0d1b3a; border-color: #8fb0f5; box-shadow: 0 20px 50px rgba(40, 90, 200, .14); }
.pp-card.mine { box-shadow: inset 0 0 0 2px var(--accent); }
.pp-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 26px; }
.pp-name { font-size: 14px; font-weight: 600; opacity: .92; }
.pp-badge { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 10.5px; font-weight: 800; letter-spacing: .07em;
  background: rgba(120, 165, 255, .16); color: #a9c6ff; border: 1px solid rgba(140, 180, 255, .35); }
:root[data-theme="light"] .pp-badge { color: #2456c9; background: #dfe9ff; border-color: #b9cdf8; }
.pp-badge .ic { width: 13px; height: 13px; }
.pp-h { font-size: 26px; font-weight: 600; letter-spacing: -.015em; margin: 14px 0 6px; }
.pp-desc { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--dim); min-height: 45px; }
.pp-card.blue .pp-desc { color: rgba(220, 230, 255, .78); }
:root[data-theme="light"] .pp-card.blue .pp-desc { color: #4a5a7a; }
.pp-price { display: flex; align-items: baseline; gap: 8px; margin: 20px 0 18px; }
.pp-now { font-size: 40px; font-weight: 600; letter-spacing: -.02em; line-height: 1; }
.pp-cur { font-size: 18px; font-weight: 600; align-self: flex-start; margin-top: 2px; margin-right: -6px; }
.pp-was { font-size: 22px; color: var(--dim); font-weight: 500; }
.pp-card.blue .pp-was { color: rgba(220, 230, 255, .55); }
.pp-per { font-size: 14px; color: var(--dim); }
.pp-card.blue .pp-per { color: rgba(220, 230, 255, .7); }
.pp-btn { height: 46px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 15px; font-weight: 600; width: 100%; transition: filter .15s, transform .15s, background .15s; }
.pp-btn .ic { width: 17px; height: 17px; }
.pp-btn.blue { background: linear-gradient(135deg, #3d7bff, #2a5fe0); color: #fff; box-shadow: 0 8px 24px rgba(48, 110, 255, .38); }
.pp-btn.white { background: var(--text); color: var(--bg); }
.pp-btn:not(div):hover { filter: brightness(1.08); }
.pp-btn:not(div):active { transform: scale(.985); }
.pp-btn.current { background: var(--surface); color: var(--dim); font-weight: 500; font-size: 14px; cursor: default; }
.pp-card.blue .pp-btn.current { background: rgba(255, 255, 255, .08); color: rgba(220, 230, 255, .7); }
.pp-btn.ghostline { border: 1px dashed var(--border-2); color: var(--dim); font-weight: 500; font-size: 14px; cursor: default; }
.pp-btn[disabled] { opacity: .7; cursor: progress; }
.pp-lead { margin: 22px 0 10px; font-size: 13.5px; font-weight: 600; opacity: .9; }
.pp-feats { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.pp-feats li { display: flex; align-items: flex-start; gap: 12px; font-size: 14.5px; line-height: 1.45; }
.pp-feats li.off { color: var(--dim); }
.pp-ic { width: 20px; height: 20px; flex: none; display: grid; place-items: center; margin-top: 1px; }
.pp-ic .ic { width: 18px; height: 18px; }
.pp-card.blue .pp-ic { color: #9cc0ff; }
:root[data-theme="light"] .pp-card.blue .pp-ic { color: #2456c9; }
.pp-feats li.off .pp-ic { opacity: .6; }
.pp-foot { margin-top: 30px; text-align: center; color: var(--dim); font-size: 13.5px; display: flex; flex-direction: column; gap: 8px; }
.pp-foot p { margin: 0; display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; }
.pp-foot .ic { width: 15px; height: 15px; }
.pp-foot a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 860px) {
  .plans-page { padding: 10px 16px 40px; }
  .pp-title { font-size: 26px; }
  .pp-grid { grid-template-columns: 1fr; gap: 14px; }
  .pp-card { padding: 22px 18px 20px; }
  .pp-card.blue { order: -1; }
  .pp-h { font-size: 22px; }
  .pp-now { font-size: 34px; }
  .pp-desc { min-height: 0; }
}

/* ★ 1.0.20 Billing */
.sx-badge { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; margin-left: 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: var(--surface-2); color: var(--dim); vertical-align: middle; }
.sx-badge.ok { background: color-mix(in srgb, var(--ok, #2fbf71) 18%, transparent); color: var(--ok, #2fbf71); }
.sx-badge.bad { background: color-mix(in srgb, var(--danger) 18%, transparent); color: var(--danger); }
.sx-pay { gap: 12px; }
.sx-pay-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); flex: none; }
.sx-pay-ic .ic { width: 18px; height: 18px; color: var(--dim); }
.sx-amt { font-size: 14.5px; font-variant-numeric: tabular-nums; }

/* ===================== ★ 1.0.21 Monthly / Yearly + premium plan badge ===================== */
.pp-seg { position: relative; display: inline-grid; grid-template-columns: 1fr 1fr; margin: 20px auto 0; padding: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); }
.pp-seg-thumb { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 999px; background: var(--bg-2);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .28), inset 0 0 0 1px var(--border-2); transition: transform .38s cubic-bezier(.2, .9, .25, 1); }
.pp-seg[data-p="year"] .pp-seg-thumb { transform: translateX(100%); }
:root[data-theme="light"] .pp-seg-thumb { background: #fff; }
.pp-seg-btn { position: relative; z-index: 1; height: 40px; padding: 0 20px; border-radius: 999px; font-size: 14.5px; font-weight: 600; color: var(--dim); display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: color .25s; white-space: nowrap; }
.pp-seg-btn.on { color: var(--text); }
.pp-save { font-size: 11px; font-weight: 800; letter-spacing: .02em; padding: 3px 8px; border-radius: 999px; color: #0b2a17; background: linear-gradient(135deg, #7ee2a8, #4fd18b); }
.pp-pricewrap { margin: 20px 0 18px; }
.pp-pricewrap .pp-price { margin: 0; }
.pp-pricewrap.flip .pp-price { animation: ppFlip .42s cubic-bezier(.2, .9, .25, 1); }
@keyframes ppFlip { 0% { opacity: .35; transform: translateY(6px); } 100% { opacity: 1; transform: none; } }
.pp-now { font-variant-numeric: tabular-nums; }
.pp-note { margin-top: 8px; font-size: 13px; color: var(--dim); min-height: 18px; transition: color .25s; }
.pp-note.save { color: #4fd18b; font-weight: 600; }
.pp-card.blue .pp-note { color: rgba(220, 230, 255, .7); }
.pp-card.blue .pp-note.save { color: #7ee2a8; }
:root[data-theme="light"] .pp-card.blue .pp-note.save, :root[data-theme="light"] .pp-note.save { color: #13914e; }
/* Max: the same blue, a touch deeper with a violet edge */
.pp-card.blue.max { border-color: #6a5cff; background: linear-gradient(180deg, #1d2466 0%, #161c4c 46%, #10142e 100%); box-shadow: 0 24px 60px rgba(70, 60, 200, .3), inset 0 1px 0 rgba(255, 255, 255, .08); }
.pp-card.blue.max .pp-btn.blue { background: linear-gradient(135deg, #6c63ff, #3d7bff); box-shadow: 0 8px 24px rgba(90, 90, 255, .4); }
.pp-card.blue.max .pp-badge { color: #c9c3ff; background: rgba(140, 125, 255, .16); border-color: rgba(160, 150, 255, .4); }
:root[data-theme="light"] .pp-card.blue.max { background: linear-gradient(180deg, #ecebff 0%, #f6f5ff 60%, #fff 100%); border-color: #b3acff; }
@media (prefers-reduced-motion: reduce) { .pp-seg-thumb { transition: none; } .pp-pricewrap.flip .pp-price { animation: none; } }
@media (max-width: 860px) { .pp-seg-btn { padding: 0 14px; font-size: 14px; } .pp-card.blue.max { order: 0; } }

/* premium plan badge in the top bar (no price) */
.top-pill.plan { gap: 7px; background: var(--bg-2); color: var(--text); padding: 0 16px 0 12px;
  border: 1px solid transparent; background: linear-gradient(var(--bg-2), var(--bg-2)) padding-box, linear-gradient(135deg, var(--accent), var(--accent-end)) border-box; box-shadow: 0 6px 22px color-mix(in srgb, var(--accent) 18%, transparent); }
.top-pill.plan .tp-ic .ic { color: var(--accent); }
.top-pill.plan .tp-brand { font-weight: 500; color: var(--dim); }
.top-pill.plan .tp-tier { font-weight: 800; letter-spacing: .08em; font-size: .86em; background: linear-gradient(135deg, var(--accent), var(--accent-end)); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
.top-pill.plan.tier-max .tp-tier, .top-pill.plan.tier-owner .tp-tier { background-image: linear-gradient(135deg, #f6d27a, #e8a33d); }
.top-pill.plan.tier-max .tp-ic .ic, .top-pill.plan.tier-owner .tp-ic .ic { color: #f0bd5a; }
@media (max-width: 860px) { .top-pill.plan .tp-brand { display: none; } }

/* ===================== ★ 1.0.22 EMAIL CARD (big) + REMINDERS + SCHEDULE ===================== */
.mail-card.mc-big { max-width: 760px; width: 100%; border-radius: 26px; padding: 18px 20px 16px; background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--border), 0 12px 36px rgba(0, 0, 0, .22); }
.mc-big .mc-top { margin-bottom: 12px; }
.mc-head { display: flex; flex-direction: column; min-width: 0; }
.mc-head .mc-title { font-size: 16px; }
.mc-status { font-size: 12.5px; color: var(--dim); min-height: 16px; }
.mc-sheet { background: var(--bg); border-radius: 18px; padding: 6px 16px 10px; box-shadow: inset 0 0 0 1px var(--border); }
.mc-big .mc-from { margin: 8px 0 4px; }
.mc-line { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--border); }
.mc-line .mc-lbl { margin: 0; width: 62px; flex: none; font-size: 13px; }
.mc-big .mc-in { background: transparent; border-radius: 0; padding: 12px 0; box-shadow: none !important; }
.mc-big .mc-subj { font-weight: 600; font-size: 15.5px; }
.mc-big .mc-body { padding: 14px 0 4px; min-height: 200px; resize: none; font-size: 15px; line-height: 1.65; }
.mc-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.mc-chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--text); background: var(--bg); box-shadow: inset 0 0 0 1px var(--border); transition: background .15s, transform .15s; }
.mc-chip .ic { width: 15px; height: 15px; color: var(--accent); }
.mc-chip:hover { background: var(--hover); }
.mc-chip:active { transform: scale(.97); }
.mc-working .mc-sheet { position: relative; overflow: hidden; }
.mc-working .mc-sheet::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(100deg, transparent 20%, color-mix(in srgb, var(--accent) 14%, transparent) 50%, transparent 80%); background-size: 250% 100%; animation: shimmer 1.3s linear infinite; }
.mc-sched { gap: 8px; }
.mc-sched .ic { width: 16px; height: 16px; }
@media (max-width: 860px) { .mail-card.mc-big { padding: 14px 12px 12px; border-radius: 22px; } .mc-sheet { padding: 4px 12px 8px; } .mc-line .mc-lbl { width: 54px; } .mc-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; } }

.tk-card { max-width: 620px; width: 100%; background: var(--surface); border-radius: 24px; padding: 18px 20px 16px; box-shadow: inset 0 0 0 1px var(--border), 0 12px 36px rgba(0, 0, 0, .2); animation: rise .35s var(--ease) both; }
.tk-top { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.tk-badge { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-end)); box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 35%, transparent); }
.tk-badge .ic { width: 21px; height: 21px; }
.tk-head { display: flex; flex-direction: column; }
.tk-head b { font-size: 16px; }
.tk-head span { font-size: 13px; color: var(--dim); }
.tk-lbl { display: block; font-size: 12.5px; color: var(--dim); margin: 14px 2px 6px; font-weight: 600; }
.tk-in { width: 100%; height: 44px; border: 0; outline: 0; border-radius: 12px; padding: 0 14px; background: var(--bg); color: var(--text); font: inherit; font-size: 14.5px; box-shadow: inset 0 0 0 1px var(--border); color-scheme: dark light; }
.tk-in:focus { box-shadow: inset 0 0 0 1.5px var(--accent); }
.tk-what { font-size: 15.5px; font-weight: 500; }
.tk-when { display: flex; flex-direction: column; gap: 10px; }
.tk-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tk-chip { height: 32px; padding: 0 13px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--bg); box-shadow: inset 0 0 0 1px var(--border); color: var(--text); transition: background .15s; }
.tk-chip:hover { background: var(--hover); }
.tk-when-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tk-when-row .tk-in { flex: 1; min-width: 190px; }
.tk-when-ic .ic { width: 20px; height: 20px; color: var(--accent); }
.tk-rep { display: inline-flex; align-items: center; gap: 7px; height: 44px; padding: 0 12px 0 14px; border-radius: 12px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--border); font-size: 13.5px; font-weight: 600; color: var(--text); }
.tk-rep .ic { width: 16px; height: 16px; }
.tk-rep .tk-v .ic { width: 14px; height: 14px; color: var(--dim); }
.tk-wd { display: flex; gap: 6px; flex-wrap: wrap; }
.tk-day { width: 40px; height: 36px; border-radius: 10px; font-size: 13px; font-weight: 700; background: var(--bg); box-shadow: inset 0 0 0 1px var(--border); color: var(--dim); }
.tk-day.on { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.tk-opts { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.tk-opt { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--dim); }
.tk-opt .ic { width: 17px; height: 17px; }
.tk-check { cursor: pointer; color: var(--text); padding: 10px 12px; border-radius: 12px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--border); }
.tk-check.off { cursor: default; color: var(--dim); }
.tk-check input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.tk-check small { display: block; color: var(--dim); font-size: 12.5px; margin-top: 2px; font-weight: 400; }
.tk-check b { font-weight: 600; }
.tk-err { color: var(--danger); font-size: 13.5px; margin: 10px 2px 0; }
.tk-actions { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.tk-actions .btn { border-radius: 999px; }
.tk-save { gap: 8px; }
.tk-save .ic { width: 16px; height: 16px; }
.tk-sched { margin-top: 14px; padding: 14px; border-radius: 18px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--border); animation: rise .25s var(--ease) both; display: flex; flex-direction: column; gap: 12px; }
.tk-sched .tk-in, .tk-sched .tk-rep, .tk-sched .tk-chip, .tk-sched .tk-check, .tk-sched .tk-day:not(.on) { background: var(--surface); }
.tk-sched-h { display: flex; align-items: center; gap: 8px; font-size: 14.5px; }
.tk-sched-h .ic { width: 18px; height: 18px; color: var(--accent); }
.tk-sched .tk-actions { margin-top: 0; }
.gm-sched-slot .tk-sched { margin: 0 0 12px; }
.tk-panel .gm-h2 { display: flex; align-items: center; gap: 8px; }
.tk-panel .gm-h2 .ic { width: 18px; height: 18px; color: var(--accent); }
.tk-list { display: flex; flex-direction: column; gap: 4px; }
.tk-row { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-radius: 12px; }
.tk-row:hover { background: var(--hover); }
.tk-row.paused { opacity: .6; }
.tk-row-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.tk-row-ic.mail { background: color-mix(in srgb, #ea4335 16%, transparent); color: #ea4335; }
.tk-row-ic .ic { width: 17px; height: 17px; }
.tk-row-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tk-row-tx b { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-row-tx span { font-size: 12.5px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; }
.tk-row-err { color: var(--danger) !important; }
@media (max-width: 860px) { .tk-card { padding: 14px 14px 12px; border-radius: 22px; } .tk-when-row .tk-in { min-width: 0; } }
.mc-chip, .tk-chip { white-space: nowrap; flex: none; }
@media (max-width: 860px) {
  .tk-when-row .tk-when-ic { display: none; }
  .tk-when-row .tk-in { flex: 1 1 100%; }
  .tk-when-row .tk-rep { flex: 1 1 100%; justify-content: flex-start; }
  .tk-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
}

/* ===================== ★ 1.0.23 SCHEDULE AN EMAIL WITH AI ===================== */
.tk-card.tk-ai { max-width: 720px; }
.tk-badge.mail { background: linear-gradient(135deg, #ea4335, #fbbc04); box-shadow: 0 8px 22px rgba(234, 67, 53, .3); }
.tk-grid2 { display: grid; grid-template-columns: 1.3fr 1fr; gap: 12px; }
.tk-topic { height: auto; min-height: 92px; padding: 12px 14px; line-height: 1.55; resize: vertical; }
.tk-ideas { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; }
.tk-idea { flex: none; height: 30px; padding: 0 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--dim); background: transparent; box-shadow: inset 0 0 0 1px var(--border); white-space: nowrap; transition: color .15s, background .15s; }
.tk-idea:hover { color: var(--text); background: var(--hover); }
.tk-tones { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--border); gap: 2px; flex-wrap: wrap; }
.tk-tone { height: 32px; padding: 0 14px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--dim); transition: background .2s, color .2s; }
.tk-tone.on { background: var(--surface-2); color: var(--text); box-shadow: 0 1px 6px rgba(0, 0, 0, .25); }
.tk-lock { display: flex; align-items: center; gap: 8px; margin: 12px 2px 0; font-size: 13.5px; color: var(--dim); }
.tk-lock .ic { width: 16px; height: 16px; }
.tk-new { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; height: 42px; margin: 2px 0 10px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--on-accent); background: linear-gradient(135deg, var(--accent), var(--accent-end)); box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 28%, transparent); transition: filter .15s, transform .15s; }
.tk-new:hover { filter: brightness(1.06); }
.tk-new:active { transform: scale(.98); }
.tk-new .ic { width: 17px; height: 17px; }
.tk-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 14px 8px 8px; }
.tk-empty-ic { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 4px; }
.tk-empty-ic .ic { width: 20px; height: 20px; }
.tk-empty b { font-size: 14.5px; }
.tk-empty span { font-size: 13px; color: var(--dim); line-height: 1.5; }
.tk-modal .modal-body { padding: 0; }
.tk-modal .tk-card { max-width: none; box-shadow: none; animation: none; }
@media (max-width: 860px) { .tk-grid2 { grid-template-columns: 1fr; gap: 0; } }
@media (max-width: 860px) { .tk-tones { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; } .tk-tone { flex: none; } }
