/* Sigmatupang: graphite neutrals, one green signal for "live" and "new". Geist for text, Geist Mono for codes and numbers. */

:root {
  --bg: #f5f5f3;
  --surface: #ffffff;
  --surface-2: #f2f2ef;
  --line: #e6e6e2;
  --line-2: #d3d3ce;
  --ink: #17171a;
  --ink-2: #63636b;
  --ink-3: #9b9ba2;
  --primary: #17171a;
  --primary-ink: #ffffff;
  --accent: #0d7a5c;
  --accent-wash: #e2f1eb;
  --red: #c4352b;
  --red-wash: #fbebe9;
  --panel: #131315;
  --panel-2: #1d1d20;
  --panel-line: #2b2b30;
  --panel-ink: #f4f4f5;
  --panel-ink-2: #8f8f97;
  --signal: #3fcf9a;
  --shadow: 0 1px 2px rgba(23, 23, 26, .05), 0 12px 32px -14px rgba(23, 23, 26, .22);
  --focus: 0 0 0 2px var(--surface), 0 0 0 4px rgba(13, 122, 92, .45);
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0c0d;
    --surface: #131315;
    --surface-2: #1b1b1e;
    --line: #242428;
    --line-2: #34343a;
    --ink: #ececee;
    --ink-2: #9d9da5;
    --ink-3: #66666e;
    --primary: #ececee;
    --primary-ink: #0c0c0d;
    --accent: #3fcf9a;
    --accent-wash: #13302a;
    --red: #ff6f64;
    --red-wash: #3a1916;
    --panel: #18181b;
    --panel-2: #212125;
    --panel-line: #2e2e33;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 16px 40px -16px rgba(0, 0, 0, .7);
    --focus: 0 0 0 2px var(--surface), 0 0 0 4px rgba(63, 207, 154, .45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c0c0d;
  --surface: #131315;
  --surface-2: #1b1b1e;
  --line: #242428;
  --line-2: #34343a;
  --ink: #ececee;
  --ink-2: #9d9da5;
  --ink-3: #66666e;
  --primary: #ececee;
  --primary-ink: #0c0c0d;
  --accent: #3fcf9a;
  --accent-wash: #13302a;
  --red: #ff6f64;
  --red-wash: #3a1916;
  --panel: #18181b;
  --panel-2: #212125;
  --panel-line: #2e2e33;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 16px 40px -16px rgba(0, 0, 0, .7);
  --focus: 0 0 0 2px var(--surface), 0 0 0 4px rgba(63, 207, 154, .45);
  color-scheme: dark;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Geist", system-ui, sans-serif; font-size: 14px; line-height: 1.5;
  font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 14px; letter-spacing: -.01em; }
p { margin: 0; }
.muted { color: var(--ink-2); }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); }
.error { color: var(--red); margin-top: 10px; font-weight: 500; }
.spacer { flex: 1; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
::selection { background: var(--accent-wash); }
:focus-visible { outline: none; box-shadow: var(--focus); }
b { font-weight: 600; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 34px; padding: 0 13px; border-radius: 8px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink); font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background-color .12s, border-color .12s, opacity .12s;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.primary:hover { opacity: .88; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn.danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 35%, var(--line)); background: transparent; }
.btn.danger:hover { background: var(--red-wash); }
.btn.block { width: 100%; height: 36px; }
.btn.accent { background: var(--accent); border-color: var(--accent); color: var(--primary-ink); }
.btn.accent:hover { opacity: .9; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; gap: 6px; }
.btn.sm svg { width: 15px; height: 15px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; flex: none;
  border: 0; background: transparent; color: var(--ink-2); cursor: pointer; transition: background-color .12s, color .12s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn.small { width: 28px; height: 28px; }
.icon-btn.small svg { width: 16px; height: 16px; }
.spin svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* segmented control */
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); }
.seg button {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 28px; padding: 0 11px;
  border: 0; border-radius: 6px; background: transparent; color: var(--ink-2); font: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer; white-space: nowrap; transition: background-color .12s, color .12s;
}
.seg button:hover { color: var(--ink); }
.seg button.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 0 0 1px var(--line); }
.seg .n { font-size: 11.5px; font-weight: 600; color: var(--accent); }
.seg.fill { display: flex; }
.seg.fill button { height: 32px; font-size: 13.5px; }

.logo { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: var(--primary); color: var(--primary-ink); flex: none; }
.logo svg { width: 18px; height: 18px; stroke-width: 1.9; }
.logo .logo-line { stroke: var(--signal); }
.brand { display: flex; align-items: center; gap: 9px; }
.brand-name { font-size: 15px; font-weight: 600; letter-spacing: -.02em; }

.avatar, .me img {
  width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex: none;
  display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line);
  color: var(--ink-2); font-size: 11px; font-weight: 600;
}

/* ---------- login ---------- */
.login { min-height: 100%; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(380px, 1fr); }
.login-intro {
  display: flex; flex-direction: column; padding: 32px 48px; min-height: 100%;
  background: var(--panel); color: var(--panel-ink);
}
.login-intro .logo { background: var(--panel-ink); color: var(--panel); }
.intro-copy { margin: auto 0; padding: 48px 0; max-width: 520px; }
.intro-copy h1 { font-size: 34px; line-height: 1.12; letter-spacing: -.03em; font-weight: 600; text-wrap: balance; }
.facts { margin: 36px 0 0; display: grid; border-top: 1px solid var(--panel-line); }
.facts > div { display: grid; grid-template-columns: 96px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--panel-line); }
.facts dt { color: var(--panel-ink-2); font-size: 13px; padding-top: 1px; }
.facts dd { margin: 0; color: var(--panel-ink); font-size: 14.5px; }
.facts b { font-family: var(--mono); font-weight: 500; font-size: 13.5px; }
.intro-foot { color: var(--panel-ink-2); font-size: 12.5px; }

.login-side { position: relative; display: grid; place-items: center; padding: 48px 24px; background: var(--bg); }
.floating { position: absolute; top: 18px; right: 18px; }
.login-card { width: min(360px, 100%); }
.login-card h2 { font-size: 22px; margin-bottom: 6px; }
.tg-widget { min-height: 46px; margin: 28px 0 0; padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); display: grid; place-items: center; }

/* ---------- shell ---------- */
.app { height: 100%; display: grid; grid-template-columns: 252px minmax(0, 1fr); }
.sidebar { display: flex; flex-direction: column; min-height: 0; padding: 14px 12px 10px; gap: 2px; overflow-y: auto; }
.side-top { padding: 4px 8px 18px; }
.nav { display: flex; flex-direction: column; gap: 1px; margin-bottom: 18px; }
.nav button {
  display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border: 0; border-radius: 8px;
  background: transparent; color: var(--ink-2); font: inherit; font-weight: 500; cursor: pointer; text-align: left;
}
.nav button svg { width: 17px; height: 17px; }
.nav button span:first-of-type { flex: 1; }
.nav button:hover { background: var(--surface-2); color: var(--ink); }
.nav button.active { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(0, 0, 0, .04); }
.nav-count { font-size: 12px; font-weight: 600; color: var(--accent); }

.search {
  display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; margin-bottom: 12px;
  border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink-3); cursor: text;
}
.search:focus-within { border-color: var(--line-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.search svg { width: 16px; height: 16px; }
.search input { padding: 0; font-size: 13.5px; }
.search input::-webkit-search-cancel-button { display: none; }
.search kbd { font-family: var(--mono); font-size: 11px; color: var(--ink-3); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; line-height: 16px; }
.search:focus-within kbd { display: none; }

.side-actions { display: grid; grid-template-columns: 1fr; gap: 6px; }
.side-actions .btn { width: 100%; height: 36px; }

.addr-box { margin-top: 20px; min-height: 0; display: flex; flex-direction: column; }
.side-head { display: flex; align-items: center; gap: 8px; padding: 0 4px 6px 10px; font-size: 13px; font-weight: 600; color: var(--ink); }
.addr-count { font-size: 12px; font-weight: 400; color: var(--ink-3); }
.link-btn { border: 0; background: none; padding: 2px 6px; border-radius: 6px; font: inherit; font-size: 12.5px; font-weight: 500; color: var(--ink-2); cursor: pointer; }
.link-btn:hover { color: var(--ink); background: var(--surface-2); }
.addr-list { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.group-head {
  display: flex; align-items: center; gap: 6px; width: 100%; height: 30px; padding: 0 8px 0 6px; border: 0; border-radius: 8px;
  background: transparent; color: var(--ink-2); font: inherit; font-size: 13px; cursor: pointer; text-align: left;
}
.group-head:hover { background: var(--surface-2); color: var(--ink); }
.group-head svg { width: 14px; height: 14px; color: var(--ink-3); transition: transform .15s; }
.addr-group.open .group-head svg { transform: rotate(90deg); }
.group-name { font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.group-kind { font-size: 11.5px; color: var(--ink-3); flex: none; }
.group-n { font-size: 12px; color: var(--ink-3); }
.group-head .count { font-size: 12px; font-weight: 600; color: var(--accent); }
.group-items { display: flex; flex-direction: column; gap: 1px; padding: 2px 0 8px 12px; }
.addr {
  display: flex; flex-direction: column; justify-content: center; gap: 3px; width: 100%; min-height: 36px; padding: 7px 10px; border-radius: 8px;
  border: 0; background: transparent; color: var(--ink-2); font: inherit; text-align: left; cursor: pointer;
}
.addr-main { display: flex; align-items: center; gap: 8px; width: 100%; }
.addr-main::before { content: "@"; font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.addr:hover { background: var(--surface-2); color: var(--ink); }
.addr.active { background: var(--surface); color: var(--ink); font-weight: 500; }
.addr.active .addr-main::before { color: var(--accent); }
.addr .local { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.addr .count { font-size: 12px; font-weight: 600; color: var(--accent); }
.addr-sub { display: flex; align-items: center; gap: 6px; padding-left: 18px; min-width: 0; font-size: 11.5px; font-weight: 400; color: var(--ink-3); }
.addr-sub .by { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.addr-none { padding: 6px 10px 8px; font-size: 12px; color: var(--ink-3); }
.addr-row { position: relative; }
.addr-tag {
  position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; display: grid; place-items: center;
  border: 0; border-radius: 7px; background: var(--surface-2); color: var(--ink-2); cursor: pointer; opacity: 0; transition: opacity .1s;
}
.addr-tag svg { width: 15px; height: 15px; }
.addr-tag:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 10%, var(--surface)); }
.addr-row:hover .addr-tag, .addr-tag:focus-visible, .addr-row.menu-on .addr-tag { opacity: 1; }
.addr-row:hover .count, .addr-row.menu-on .count { visibility: hidden; }
@media (hover: none) {
  .addr-tag { opacity: 1; background: transparent; }
  .addr-row .addr-main { padding-right: 26px; }
}

.menu {
  position: fixed; z-index: 60; min-width: 210px; max-width: 280px; max-height: 60vh; overflow-y: auto; padding: 4px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); animation: rise .12s ease-out;
}
.menu-title { padding: 6px 10px 6px; font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-item {
  display: flex; align-items: center; gap: 8px; width: 100%; height: 32px; padding: 0 10px 0 8px; border: 0; border-radius: 6px;
  background: transparent; color: var(--ink); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer;
}
.menu-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-2); box-shadow: none; }
.menu-item svg { width: 15px; height: 15px; visibility: hidden; color: var(--accent); }
.menu-item.on svg { visibility: visible; }
.menu-item.on { font-weight: 500; }
.menu-item.none { color: var(--ink-2); }
.menu-item.plain { padding-left: 33px; color: var(--ink-2); }
.menu-sep { height: 1px; margin: 4px 6px; background: var(--line); }
.chip {
  display: inline-flex; align-items: center; max-width: 140px; height: 18px; padding: 0 7px; border-radius: 5px; flex: none;
  background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink-2); font-size: 11.5px; font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.side-foot { margin-top: auto; padding-top: 14px; display: flex; align-items: center; gap: 2px; border-top: 1px solid var(--line); }
.me { flex: 1; display: flex; align-items: center; gap: 9px; min-width: 0; padding: 4px 6px; }
.me .who { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.me .name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me .role { font-size: 12px; color: var(--ink-3); }

.stage {
  min-width: 0; min-height: 0; margin: 8px 8px 8px 0; display: flex;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
}
.view { flex: 1; min-width: 0; min-height: 0; }
.mobile-bar { display: none; }
.scrim { display: none; }

/* ---------- mail ---------- */
.mail-view { display: flex; }
.empty-state { margin: auto; padding: 24px; max-width: 380px; text-align: center; }
.empty-icon { width: 44px; height: 44px; margin: 0 auto 16px; border-radius: 12px; display: grid; place-items: center; border: 1px solid var(--line); color: var(--ink-2); }
.empty-icon svg { width: 22px; height: 22px; }
.empty-state h2 { margin-bottom: 6px; }
.empty-state .btn { margin-top: 20px; }

.mailbox { flex: 1; min-width: 0; min-height: 0; display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); }
.list-pane { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); }
.pane-head { display: flex; align-items: center; gap: 4px; padding: 14px 12px 10px 18px; }
.mb-title { flex: 1; min-width: 0; }
.mb-meta { display: flex; align-items: center; gap: 8px; margin-top: 3px; font-size: 12px; color: var(--ink-3); min-width: 0; }
.mb-meta > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-head { border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.mb-address { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.mb-address span { color: var(--ink-3); font-weight: 400; }
.folders { padding: 0 14px 12px; border-bottom: 1px solid var(--line); }
.folders .seg { display: flex; }

.list { flex: 1; overflow-y: auto; }
.msg {
  display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line);
  background: transparent; color: var(--ink); font: inherit; padding: 12px 18px 13px 26px; cursor: pointer; position: relative;
}
.msg:hover { background: var(--surface-2); }
.msg.active { background: var(--surface-2); }
.msg .row1 { display: flex; gap: 10px; align-items: baseline; }
.msg .who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.msg .when { color: var(--ink-3); font-size: 12px; flex: none; }
.msg .subj { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; font-size: 13.5px; }
.msg .where { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 12px; color: var(--ink-3); }
.msg.unread::before { content: ""; position: absolute; left: 11px; top: 19px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.msg.unread .who { color: var(--ink); font-weight: 600; }
.msg.unread .subj { color: var(--ink); }
.list-note { padding: 48px 28px; color: var(--ink-2); max-width: 340px; font-size: 13.5px; }
.list-note svg { width: 22px; height: 22px; display: block; margin-bottom: 12px; color: var(--ink-3); }
.skeleton { height: 62px; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, transparent, var(--surface-2), transparent); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.reader { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.reader-empty { margin: auto; color: var(--ink-3); text-align: center; font-size: 13.5px; }
.reader-empty svg { width: 28px; height: 28px; display: block; margin: 0 auto 10px; }
.r-bar { display: flex; align-items: center; gap: 4px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.r-bar .btn.sm { color: var(--ink-2); }
.r-bar .btn.sm:hover { color: var(--ink); }
.r-bar .sep { width: 1px; height: 18px; background: var(--line); margin: 0 6px; }
.r-head { padding: 24px 32px 20px; }
.r-head h3 { font-size: 20px; font-weight: 600; letter-spacing: -.02em; margin-bottom: 18px; word-break: break-word; }
.r-meta { display: flex; gap: 12px; align-items: flex-start; }
.r-meta .avatar { width: 36px; height: 36px; font-size: 13px; }
.r-meta .lines { flex: 1; min-width: 0; font-size: 13px; }
.r-meta .lines > div { overflow: hidden; text-overflow: ellipsis; }
.r-meta .from b { font-size: 14px; }
.r-meta .date { color: var(--ink-3); font-size: 12.5px; white-space: nowrap; }
.back-btn { display: none !important; }
.atts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 16px; }
.att {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; border-radius: 8px;
  border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 500;
}
.att:hover { border-color: var(--line-2); background: var(--surface-2); }
.att svg { width: 14px; height: 14px; color: var(--ink-2); }
.att .muted { font-weight: 400; }
.r-body { flex: 1; min-height: 0; display: flex; border-top: 1px solid var(--line); }
.r-body iframe { flex: 1; border: 0; background: #fff; width: 100%; }
.r-body pre { flex: 1; margin: 0; padding: 24px 32px; white-space: pre-wrap; word-break: break-word; overflow: auto; font: inherit; font-size: 14.5px; line-height: 1.65; max-width: 78ch; }

/* ---------- numbers ---------- */
.numbers-view { overflow-y: auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 28px 32px 22px; border-bottom: 1px solid var(--line); }
.page-head p { margin-top: 4px; font-size: 13.5px; }
.stat { display: flex; flex-direction: column; align-items: flex-end; flex: none; }
.stat span { font-size: 12px; color: var(--ink-3); }
.stat b { font-family: var(--mono); font-size: 20px; font-weight: 500; letter-spacing: -.02em; }

.numbers-grid {
  display: grid; gap: 16px; padding: 24px 32px 32px; max-width: 1360px;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr); grid-template-areas: "buy codes" "nums nums"; align-items: start;
}
.panel { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); min-width: 0; }
.panel-title { font-size: 14px; }
.panel-head { display: flex; align-items: center; gap: 8px; padding: 14px 14px 12px 20px; }
.panel-head .panel-title { flex: 1; }

.buy-card { grid-area: buy; padding: 18px 20px 20px; }
.step { margin-top: 18px; }
.step-label { font-size: 12.5px; color: var(--ink-2); margin-bottom: 8px; }
.choice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.choice {
  height: 34px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink);
  font: inherit; font-size: 13px; cursor: pointer; transition: border-color .12s, background-color .12s;
}
.choice-grid .choice:hover { border-color: var(--line-2); background: var(--surface-2); }
.choice-grid .choice.active { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); font-weight: 500; }
.choice.wide { grid-column: 1 / -1; }
.quote { display: flex; align-items: flex-end; gap: 12px; justify-content: space-between; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.price { font-family: var(--mono); font-size: 26px; font-weight: 500; letter-spacing: -.03em; line-height: 1.1; margin-top: 2px; }
.price.loading { color: var(--ink-3); }
.quick-refund { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.qr-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.qr-row + .qr-row { border-top: 1px solid var(--line); }
.qr-info { flex: 1; min-width: 0; }
.qr-row .phone { font-family: var(--mono); font-size: 13.5px; font-weight: 500; }

.codes-card {
  grid-area: codes; height: 100%; max-height: 640px; border-radius: 12px; background: var(--panel); color: var(--panel-ink);
  border: 1px solid var(--panel); display: flex; flex-direction: column; min-width: 0;
}
:root[data-theme="dark"] .codes-card { border-color: var(--panel-line); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .codes-card { border-color: var(--panel-line); } }
.codes-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 12px; }
.live { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--panel-ink-2); }
.live i { width: 6px; height: 6px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 3px rgba(63, 207, 154, .18); }
.sms-list { display: flex; flex-direction: column; padding: 0 20px 8px; flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--panel-line) transparent; }
.sms-list::-webkit-scrollbar { width: 8px; }
.sms-list::-webkit-scrollbar-thumb { background: var(--panel-line); border-radius: 4px; }
.sms { display: grid; grid-template-columns: 140px 1fr; gap: 3px 20px; align-items: center; padding: 12px 0; border-top: 1px solid var(--panel-line); }
.sms .meta { font-size: 13px; display: flex; gap: 6px 14px; flex-wrap: wrap; align-items: baseline; color: var(--panel-ink-2); }
.sms .meta b { color: var(--panel-ink); font-family: var(--mono); font-size: 13px; font-weight: 500; }
.sms .text { grid-column: 2; font-size: 12.5px; color: var(--panel-ink-2); word-break: break-word; max-width: 70ch; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.code-btn {
  grid-row: 1 / span 2; display: inline-flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; justify-self: start;
  font-family: var(--mono); font-size: 22px; font-weight: 500; line-height: 1; letter-spacing: .06em; padding: 10px 12px; margin-left: -12px;
  color: var(--panel-ink); background: transparent; border: 1px solid transparent; border-radius: 8px;
  transition: border-color .12s, background-color .12s;
}
.code-btn:hover { background: var(--panel-2); border-color: var(--panel-line); }
.code-btn svg { width: 15px; height: 15px; color: var(--panel-ink-2); opacity: 0; transition: opacity .12s; }
.code-btn:hover svg, .sms.lead .code-btn svg { opacity: 1; }
.code-none { grid-row: 1 / span 2; font-family: var(--mono); font-size: 13px; color: var(--panel-ink-2); }

/* The newest code is the focal point of the page. */
.sms.lead { grid-template-columns: 1fr; padding: 8px 0 22px; border-top: 0; gap: 10px; }
.sms.lead .code-btn {
  grid-row: auto; font-size: 46px; letter-spacing: .08em; padding: 16px 18px; margin: 0; width: 100%;
  background: var(--panel-2); border-color: var(--panel-line); border-radius: 10px;
}
.sms.lead .code-btn:hover { border-color: color-mix(in srgb, var(--signal) 50%, var(--panel-line)); }
.sms.lead .code-none { grid-row: auto; padding: 22px 18px; border: 1px dashed var(--panel-line); border-radius: 10px; }
.sms.lead .text { grid-column: auto; -webkit-line-clamp: 3; }
.sms.fresh .code-btn { animation: arrive 1.8s ease-out; }
@keyframes arrive { from { border-color: var(--signal); background-color: rgba(63, 207, 154, .14); } }
.codes-card .list-note { color: var(--panel-ink-2); padding: 28px 0 32px; }
.codes-card .list-note svg { color: var(--panel-ink-2); opacity: .6; }

.nums-card { grid-area: nums; }
.num-row { display: grid; grid-template-columns: minmax(170px, 1.3fr) .8fr .9fr .9fr 1.1fr 140px; gap: 12px; align-items: center; padding: 0 20px; }
.num-cols:has(+ .num-list > .list-note) { display: none; }
.num .c-meta { display: contents; }
.num-cols { font-size: 12px; color: var(--ink-3); padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.num-list .num-row { min-height: 56px; padding-top: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.num-list .num-row:last-child { border-bottom: 0; }
.num-list .num-row:hover { background: color-mix(in srgb, var(--surface-2) 50%, transparent); }
.num .phone { display: flex; align-items: center; gap: 2px; font-family: var(--mono); font-size: 13.5px; font-weight: 500; }
.num .phone button { border: 0; background: none; color: var(--ink-3); cursor: pointer; padding: 4px; display: grid; border-radius: 6px; }
.num .phone button:hover { color: var(--ink); background: var(--surface-2); }
.num .phone button svg { width: 14px; height: 14px; }
.num .owner { font-size: 12px; color: var(--ink-3); }
.num .c-ends { color: var(--ink-2); font-size: 13px; }
.num .c-act { display: flex; justify-content: flex-end; }
.num .lbl { display: none; }
.tag { font-size: 13px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); }
.tag.ok { color: var(--ink); }
.tag.ok::before { background: var(--accent); }
.tag.bad { color: var(--red); }
.tag.bad::before { background: var(--red); }
.num-list .list-note, .num-list .skeleton { border-radius: 0; }
.num-list .list-note { padding: 32px 20px; }
.pager { display: flex; align-items: center; gap: 6px; padding: 12px 14px 12px 20px; border-top: 1px solid var(--line); }

/* addresses overview */
.addresses-view { overflow-y: auto; }
.stats { display: flex; gap: 28px; flex: none; }
.ov-wrap { padding: 24px 32px 32px; max-width: 1360px; }
.ov-filter { flex: 0 1 340px; margin: 0; height: 34px; }
.ov-row { display: grid; grid-template-columns: minmax(200px, 1.6fr) minmax(110px, 1fr) minmax(130px, 1.1fr) 1.2fr .8fr .9fr .5fr 70px; gap: 12px; align-items: center; padding: 0 20px; }
.ov-cols { padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.ov-sort { border: 0; background: none; padding: 0; font: inherit; font-size: 12px; color: var(--ink-3); cursor: pointer; text-align: left; display: inline-flex; gap: 4px; }
.ov-sort:hover, .ov-sort.on { color: var(--ink); }
.ov-sort .arrow { font-size: 11px; }
.ov-list .ov-row { min-height: 54px; padding-top: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.ov-list .ov-row:last-child { border-bottom: 0; }
.ov-list .ov-row:hover { background: color-mix(in srgb, var(--surface-2) 50%, transparent); }
.ov-link { border: 0; background: none; padding: 0; font: inherit; font-weight: 500; color: var(--ink); cursor: pointer; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.ov-link span { color: var(--ink-3); font-weight: 400; }
.ov-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.ov-label { border: 0; background: none; padding: 3px 4px; margin-left: -4px; border-radius: 6px; font: inherit; font-size: 13px; cursor: pointer; }
.ov-label:hover { background: var(--surface-2); }
.c-owner { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.c-owner .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-owner .muted { font-size: 12px; }
.c-created, .c-last { color: var(--ink-2); font-size: 13px; }
.c-inbox { display: flex; flex-direction: column; line-height: 1.3; }
.c-inbox .unread { font-size: 12px; color: var(--accent); font-weight: 500; }
.ov-row .c-act { display: flex; justify-content: flex-end; }
.ov-list .list-note { padding: 32px 20px; }

.receipt { border: 1px solid var(--line); border-radius: 10px; padding: 4px 16px; }
.receipt div { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }
.receipt div:last-child { border-bottom: 0; font-weight: 600; }
.receipt div:last-child b { font-family: var(--mono); font-size: 18px; font-weight: 500; }
.receipt span { color: var(--ink-2); }

/* ---------- dialogs ---------- */
dialog.sheet {
  width: min(460px, calc(100% - 24px)); border: 1px solid var(--line); border-radius: 14px; padding: 20px;
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow);
}
dialog.sheet.wide { width: min(680px, calc(100% - 24px)); }
dialog[open] { animation: rise .16s ease-out; }
@keyframes rise { from { transform: translateY(6px); opacity: 0; } }
dialog::backdrop { background: rgba(12, 12, 13, .45); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin: -4px -6px 14px 0; }
.sheet-head h3 { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-foot { display: flex; align-items: center; gap: 8px; margin-top: 18px; }
.fields { border: 1px solid var(--line); border-radius: 10px; }
.field { display: grid; grid-template-columns: 72px 1fr; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); padding: 2px 12px; }
.field:last-child { border-bottom: 0; }
.field > span { color: var(--ink-3); font-size: 13px; }
input, select, textarea { font: inherit; color: var(--ink); background: transparent; border: 0; outline: none; padding: 9px 0; width: 100%; min-width: 0; }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
input:focus-visible, select:focus-visible, textarea:focus-visible { box-shadow: none; }
.field:focus-within > span { color: var(--ink); }
.field:focus-within { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.field:first-child { border-radius: 9px 9px 0 0; }
.field:last-child { border-radius: 0 0 9px 9px; }
select { background: var(--surface); cursor: pointer; }
textarea { resize: vertical; padding: 16px 2px; min-height: 220px; display: block; line-height: 1.6; }
.from-row { display: flex; gap: 8px; }
.from-row input { flex: 1; }
.from-pick {
  flex: 1.3; min-width: 0; display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px; margin: 3px 0;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; text-align: left;
}
.from-pick:hover { background: var(--surface-2); }
.from-pick svg { width: 15px; height: 15px; color: var(--ink-3); }
.from-pick .ellipsis { flex: 1; }
.from-search { margin: 0 0 10px; }
.from-list { display: flex; flex-direction: column; gap: 1px; max-height: min(420px, 55vh); overflow-y: auto; margin: 0 -6px; }
.from-item {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px;
  background: transparent; color: var(--ink); font: inherit; text-align: left; cursor: pointer;
}
.from-item:hover, .from-item:focus-visible { background: var(--surface-2); box-shadow: none; }
.from-main { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.from-main b { font-weight: 500; }
.from-sub { grid-column: 1; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-3); min-width: 0; }
.from-item svg { grid-column: 2; grid-row: 1 / span 2; width: 16px; height: 16px; color: var(--accent); visibility: hidden; }
.from-item.on svg { visibility: visible; }
.file-btn { cursor: pointer; }
.addr-input { display: flex; align-items: center; border: 1px solid var(--line-2); border-radius: 10px; padding: 3px 14px; font-size: 15px; margin-bottom: 10px; }
.addr-input:focus-within { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.addr-input span { color: var(--ink-3); white-space: nowrap; }
.creds { display: grid; grid-template-columns: auto 1fr; gap: 0 16px; margin: 16px 0 18px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 4px 14px; }
.creds dt, .creds dd { padding: 9px 0; border-bottom: 1px solid var(--line); min-height: 48px; display: flex; align-items: center; }
.creds dt:nth-last-of-type(1), .creds dd:last-child { border-bottom: 0; }
.creds dt { color: var(--ink-3); font-size: 13px; }
.creds dd { margin: 0; font-size: 13px; word-break: break-all; gap: 6px; flex-wrap: wrap; }
.creds dd .v { font-family: var(--mono); font-size: 12.5px; flex: 1; min-width: 0; }
.section-label { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.section-label.spaced { margin-top: 18px; }
.label-pick { margin-bottom: 20px; }
.label-pick p.muted { margin-top: 10px; }
.label-options { display: flex; flex-wrap: wrap; gap: 6px; }
.lbl-opt {
  height: 30px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
  color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; transition: border-color .12s, background-color .12s;
}
.lbl-opt:hover { background: var(--surface-2); }
.lbl-opt.none { color: var(--ink-2); }
.lbl-opt.active { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); font-weight: 500; color: var(--ink); }
.lbl-opt.add { border-style: solid; border-color: transparent; color: var(--ink-2); }
.lbl-opt.add:hover { color: var(--ink); }
.label-add { display: flex; gap: 8px; align-items: center; margin-top: 14px; border: 1px solid var(--line-2); border-radius: 10px; padding: 3px 4px 3px 12px; }
.label-add:focus-within { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.label-add input { padding: 6px 0; }
.label-list { margin-top: 14px; display: flex; flex-direction: column; max-height: 50vh; overflow-y: auto; }
.label-item { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 0 0 2px; border-bottom: 1px solid var(--line); }
.label-item:last-child { border-bottom: 0; }
.label-item .name { flex: 1; min-width: 0; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.label-item .used { font-size: 12.5px; color: var(--ink-3); }
.label-item .btn { color: var(--ink-3); }
.label-item .btn:hover { color: var(--red); }
.label-empty { padding: 18px 2px; color: var(--ink-3); font-size: 13px; }
.danger-zone { display: flex; align-items: center; gap: 16px; justify-content: space-between; border: 1px solid color-mix(in srgb, var(--red) 25%, var(--line)); border-radius: 10px; padding: 12px 14px; }
.danger-zone p { margin-top: 2px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50;
  background: var(--primary); color: var(--primary-ink); padding: 9px 16px; border-radius: 10px; font-weight: 500; font-size: 13.5px;
  box-shadow: var(--shadow); max-width: calc(100% - 32px); animation: rise .16s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .num-cols { display: none; }
  .num-list .num-row {
    grid-template-columns: 1fr auto; grid-template-areas: "phone act" "meta act"; gap: 4px 12px; padding-top: 12px; padding-bottom: 12px;
  }
  .num .c-phone { grid-area: phone; }
  .num .c-act { grid-area: act; }
  .num .c-meta { grid-area: meta; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 14px; font-size: 12.5px; }
  .num .c-meta .tag, .num .c-ends { font-size: 12.5px; }
  .num .nil { display: none; }
}
@media (max-width: 1100px) {
  .ov-cols { display: none; }
  .ov-list .ov-row {
    grid-template-columns: 1fr auto; grid-template-areas: "addr act" "label act" "meta meta";
    gap: 4px 12px; padding-top: 12px; padding-bottom: 12px;
  }
  .ov-row .c-addr { grid-area: addr; }
  .ov-row .c-act { grid-area: act; }
  .ov-row .c-label { grid-area: label; }
  .ov-row .c-owner, .ov-row .c-created, .ov-row .c-inbox, .ov-row .c-last, .ov-row .c-sent { display: none; }
  .ov-row .c-meta-m { grid-area: meta; display: block !important; }
}
.c-meta-m { display: none; font-size: 12.5px; color: var(--ink-2); }
@media (max-width: 980px) {
  .ov-wrap { padding: 16px; }
  .numbers-grid { grid-template-columns: 1fr; grid-template-areas: "codes" "buy" "nums"; padding: 16px; }
  .codes-card { height: auto; max-height: 560px; }
  .page-head { padding: 22px 16px 18px; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .mobile-bar {
    display: flex; align-items: center; gap: 8px; height: 52px; padding: 0 10px 0 6px;
    background: var(--bg); border-bottom: 1px solid var(--line);
  }
  .mobile-switch button { padding: 0 12px; }
  #mb-address { cursor: pointer; }
  #mb-address::after { content: " ▾"; color: var(--ink-3); font-size: 12px; }
  .stage { margin: 0; border: 0; border-radius: 0; }
  .sidebar {
    position: fixed; z-index: 30; top: 0; bottom: 0; left: 0; width: 286px; background: var(--bg);
    transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow);
  }
  .menu-open .sidebar { transform: none; }
  .scrim { position: fixed; inset: 0; z-index: 20; background: rgba(12, 12, 13, .45); display: block; }
  .mailbox { grid-template-columns: 1fr; }
  .list-pane { border-right: 0; }
  .mailbox.reading .list-pane { display: none; }
  .mailbox:not(.reading) .reader { display: none; }
  .back-btn { display: inline-flex !important; }
  .r-bar { padding: 8px 10px; }
  .r-bar .lbl { display: none; }
  .r-head { padding: 18px 16px 16px; }
  .r-head h3 { font-size: 18px; }
  .r-meta { flex-wrap: wrap; }
  .r-meta .date { flex-basis: 100%; padding-left: 48px; margin-top: -6px; }
  .r-body pre { padding: 18px 16px; }
  .pane-head { padding: 12px 8px 10px 16px; }
  .folders { padding: 0 12px 10px; }
  .field { grid-template-columns: 56px 1fr; }
  .from-row { flex-direction: column; gap: 0; }
  dialog.sheet { padding: 16px; }
  dialog.sheet.wide { width: 100%; max-width: 100%; height: 100%; max-height: 100%; margin: 0; border-radius: 0; border: 0; }
  .sms.lead .code-btn { font-size: 38px; }
  .login { grid-template-columns: 1fr; }
  .login-intro { min-height: 0; padding: 24px 20px 28px; }
  .intro-copy { padding: 36px 0 8px; }
  .intro-copy h1 { font-size: 26px; }
  .intro-foot { display: none; }
  .login-side { place-items: start center; padding: 32px 20px 48px; }
}
@media (max-width: 600px) {
  .facts { display: none; }
  .intro-copy { padding: 28px 0 0; }
  .intro-copy h1 { font-size: 24px; }
}
@media (max-width: 480px) {
  .sms { grid-template-columns: 1fr; }
  .sms .text { grid-column: auto; }
  .code-btn { grid-row: auto; }
  .facts > div { grid-template-columns: 1fr; gap: 2px; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .stat { align-items: flex-start; }
}
