/* mail2api dashboard — design tokens */
:root {
  --bg: #f5f5f7; --surface: #ffffff; --surface-2: #f5f5f7; --line: #e5e5ea;
  --text: #1d1d1f; --muted: #6e6e73; --faint: #8e8e93;
  --accent: #007aff; --accent-ink: #ffffff; --accent-soft: #e6f1ff;
  --ok: #248a3d; --ok-soft: #e8f6ec; --warn: #b25000; --warn-soft: #fff3e0; --err: #d70015; --err-soft: #ffeaec;
  --gmail: #ea4335; --outlook: #0f6cbd; --qq: #12b7c3; --imap: #6b7a90;
  /* sender avatars, vendors and attachment tiles; every tone keeps >= 4.5:1 against white text */
  --tone-0: #2f5bea; --tone-1: #7c4ddb; --tone-2: #c2410c; --tone-3: #0f766e; --tone-4: #b91c1c; --tone-5: #4d7c0f; --tone-6: #be185d; --tone-7: #475569;
  --radius: 12px; --radius-sm: 10px; --shadow: 0 0 0 .5px rgba(0,0,0,.05), 0 4px 12px rgba(0,0,0,.06), 0 18px 40px -14px rgba(0,0,0,.16);
  /* controls (Apple HIG): filled fields and buttons, one height scale, a soft focus ring; --material is the translucent menu/toast/bar fill */
  --line-strong: #d2d2d7; --radius-control: 8px; --control-h: 34px; --control-fs: 13px; --shadow-xs: 0 1px 1px rgba(0,0,0,.04); --ring: color-mix(in srgb, var(--accent) 35%, transparent);
  --fill: rgba(118,118,128,.12); --fill-2: rgba(118,118,128,.2); --material: color-mix(in srgb, var(--surface) 76%, transparent);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Segoe UI Variable Text", "Segoe UI", "Microsoft YaHei UI", system-ui, sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, "Cascadia Mono", Consolas, monospace;
  /* one motion vocabulary: hover feedback, content entering, expand/collapse, attention */
  --ease: cubic-bezier(.32,.72,0,1); --dur-fast: .16s; --dur-enter: .3s; --dur: .34s; --dur-flash: 1.2s;
  --paper-h: clamp(360px, 64vh, 760px);
  --hover: color-mix(in srgb, var(--text) 5%, transparent); --row-hover: color-mix(in srgb, var(--text) 3.5%, transparent);
  --col-accounts: clamp(288px, 24vw, 340px); --col-subs: clamp(248px, 22vw, 320px);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bg:#141416; --surface:#1c1c1e; --surface-2:#242426; --line:#38383a; --text:#f5f5f7; --muted:#a1a1a6; --faint:#6e6e73; --accent:#0a84ff; --accent-soft:#0b2a4a; --ok:#30d158; --ok-soft:#0f3a1d; --warn:#ff9f0a; --warn-soft:#3d2a07; --err:#ff453a; --err-soft:#45140f; --line-strong:#48484a; --fill: rgba(118,118,128,.24); --fill-2: rgba(118,118,128,.32); --shadow-xs: 0 1px 1px rgba(0,0,0,.3); --shadow: 0 0 0 .5px rgba(255,255,255,.07), 0 8px 24px rgba(0,0,0,.4), 0 24px 48px -16px rgba(0,0,0,.6); } }
:root[data-theme="dark"] { --bg:#141416; --surface:#1c1c1e; --surface-2:#242426; --line:#38383a; --text:#f5f5f7; --muted:#a1a1a6; --faint:#6e6e73; --accent:#0a84ff; --accent-soft:#0b2a4a; --ok:#30d158; --ok-soft:#0f3a1d; --warn:#ff9f0a; --warn-soft:#3d2a07; --err:#ff453a; --err-soft:#45140f; --line-strong:#48484a; --fill: rgba(118,118,128,.24); --fill-2: rgba(118,118,128,.32); --shadow-xs: 0 1px 1px rgba(0,0,0,.3); --shadow: 0 0 0 .5px rgba(255,255,255,.07), 0 8px 24px rgba(0,0,0,.4), 0 24px 48px -16px rgba(0,0,0,.6); }

* { box-sizing: border-box; }
html { font: 14px/1.5 var(--font); color: var(--text); background: var(--bg); -webkit-text-size-adjust: 100%; }
body { margin: 0; }
button { font: inherit; color: inherit; }
button { cursor: pointer; }
.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); }
[hidden] { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* scrollbars: slim floating pill, transparent track; fades in while the area is hovered or scrolled.
   Chromium / WebView2 uses the ::-webkit-scrollbar parts, Firefox the standard thin bar. */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb { border: 3px solid transparent; border-radius: 999px; background: transparent padding-box; transition: background-color var(--dur-fast) var(--ease); }
:hover::-webkit-scrollbar-thumb, :focus-within::-webkit-scrollbar-thumb { background-color: color-mix(in srgb, var(--text) 22%, transparent); }
::-webkit-scrollbar-thumb:hover { background-color: color-mix(in srgb, var(--accent) 65%, transparent) !important; border-width: 2px; }
::-webkit-scrollbar-thumb:active { background-color: var(--accent) !important; }
::-webkit-scrollbar-button { display: none; }
@supports not selector(::-webkit-scrollbar) {
  * { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--text) 22%, transparent) transparent; }
}
.pane, .page { scrollbar-gutter: stable; }
code { font-family: var(--mono); font-size: .92em; background: var(--surface-2); padding: .1em .35em; border-radius: 5px; }
.spacer { flex: 1; }
.muted { color: var(--faint); font-size: 13px; padding: 4px 0; margin: 0; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
@keyframes glow { from { background-color: var(--accent-soft); } }
@keyframes flashok { from { box-shadow: 0 0 0 2px var(--ok); } }
@keyframes flasherr { from { box-shadow: 0 0 0 2px var(--err); } }
@keyframes slide { 0% { transform: translateX(-100%);} 100% { transform: translateX(260%);} }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes slidein { from { opacity: 0; transform: translateX(-8px);} }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-delay: 0s !important; } }

/* app shell: top bar, (view switcher), three panes, status bar; panes scroll independently */
/* named areas: the switcher row stays reserved (empty) while it is hidden, so panes keep the 1fr row */
.app { height: 100vh; height: 100dvh; display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; grid-template-areas: "top" "views" "panes" "status"; }
.topbar { grid-area: top; position: relative; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 10px 16px; background: var(--material); backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.01em; }
.brand__mark { width: 26px; height: 26px; border-radius: 8px; background: linear-gradient(135deg, var(--accent), #8a5cff); position: relative; }
.brand__mark::after { content: ""; position: absolute; inset: 7px 6px; border: 2px solid #fff; border-top: 0; border-radius: 0 0 4px 4px; }
.brand__mark::before { content: ""; position: absolute; left: 6px; right: 6px; top: 7px; height: 7px; border: 2px solid #fff; border-bottom: 0; border-radius: 4px 4px 0 0; clip-path: polygon(0 0,100% 0,50% 100%); }
.conn { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; font-size: 12px; color: var(--muted); margin-left: 6px; padding: 3px 8px; border-radius: 999px; background: var(--surface-2); }
.conn__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.conn.is-live .conn__dot { background: var(--ok); animation: pulse 2s infinite; }
.conn.is-down .conn__dot { background: var(--err); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 45%, transparent);} 70% { box-shadow: 0 0 0 7px transparent;} 100% { box-shadow: 0 0 0 0 transparent;} }
.topbar__tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
/* the top bar is one row of 38px controls: search, buttons and captioned icon buttons */
.topbar { --control-h: 38px; }
.topbar .search { min-width: 260px; }
/* dense toolbars, editor heads and inline tables use the compact control size */
.pool__bar, .sgrid__bar, .pa__ehead, .pa__efoot, .sb__shead, .sb__var, .px__table, .tok__new, .icl__kidbar, .pas__bar, .pas__list, .stbl { --control-h: 30px; --control-fs: 12.5px; }
/* top-bar icon buttons carry a short caption under the icon; same 37px footprint as before */
.topbar .btn--icon { flex-direction: column; gap: 1px; width: auto; min-width: 37px; padding: 3px 5px; }
.topbar .btn--icon .ico { width: 15px; height: 15px; }
.btn__cap { font-size: 10.5px; font-weight: 600; line-height: 13px; white-space: nowrap; }

.att:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* underline tabs (view switcher) */
.views { grid-area: views; display: none; gap: 2px; padding: 6px 8px; background: var(--surface); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }

/* panes */
.panes { grid-area: panes; display: grid; grid-template-columns: var(--col-accounts) minmax(0, 1fr) var(--col-subs); min-height: 0; }
.pane { --pane-bg: var(--surface); position: relative; min-height: 0; overflow: auto; overscroll-behavior: contain; background: var(--pane-bg); animation: rise var(--dur-enter) var(--ease) both; }
.pane--accounts { border-right: 1px solid var(--line); }
.pane--mail { --pane-bg: var(--surface); }
.pane--subs { border-left: 1px solid var(--line); }
.pane__head { position: sticky; top: 0; z-index: 3; padding: 12px 14px 10px; background: color-mix(in srgb, var(--pane-bg) 90%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.pane__bar { display: flex; align-items: center; gap: 8px; min-height: 30px; }
.pane__heading { flex: 1; min-width: 0; }
.pane__title { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pane__sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pane__n { flex: none; min-width: 18px; padding: 0 6px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; }
.pane__n:empty { display: none; }
.pane__av { width: 32px; height: 32px; border-radius: 9px; font-size: 13px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip__n { font-size: 11px; font-variant-numeric: tabular-nums; opacity: .8; }

/* skeletons share the row shapes they stand in for */
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 6px; }
.mskel { display: grid; grid-template-columns: 36px 1fr; grid-template-rows: 14px 14px; gap: 8px 12px; padding: 14px 16px; border-top: 1px solid var(--line); }
.mskel:first-child { border-top: 0; }
.mskel i:first-child { grid-row: 1 / 3; width: 36px; height: 36px; border-radius: 50%; }
.mskel i:nth-child(2) { width: 40%; } .mskel i:nth-child(3) { width: 78%; }
.mskel--acct { border-top: 0; padding: 10px 12px; }
.mskel--acct i:first-child { border-radius: 10px; }
.sskel { height: 86px; border-radius: var(--radius-sm); }

/* avatars: mailboxes and vendors are rounded squares, people are round */
.avatar { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; font-weight: 700; color: #fff; background: var(--pcolor, var(--imap)); font-size: 16px; line-height: 1; text-transform: uppercase; }
.avatar--person { width: 36px; height: 36px; border-radius: 50%; font-size: 14px; background: var(--tone, var(--tone-7)); }
[data-provider="gmail"] { --pcolor: var(--gmail); } [data-provider="outlook"] { --pcolor: var(--outlook); } [data-provider="qq"] { --pcolor: var(--qq); }
[data-tone="0"] { --tone: var(--tone-0); } [data-tone="1"] { --tone: var(--tone-1); } [data-tone="2"] { --tone: var(--tone-2); } [data-tone="3"] { --tone: var(--tone-3); }
[data-tone="4"] { --tone: var(--tone-4); } [data-tone="5"] { --tone: var(--tone-5); } [data-tone="6"] { --tone: var(--tone-6); } [data-tone="7"] { --tone: var(--tone-7); }
.state[data-s="ACTIVE_POLLING"] { --b: var(--ok); }
.state[data-s="PROVISIONED"], .state[data-s="AUTHENTICATING"] { --b: var(--accent); }
.state[data-s="REQUIRES_MANUAL_INTERVENTION"] { --b: var(--warn); }
.state[data-s="ERROR"] { --b: var(--err); }
.badge[data-s="connected"] { --b: var(--ok); } .badge[data-s="connecting"] { --b: var(--accent); } .badge[data-s="error"] { --b: var(--err); }
.provider { text-transform: capitalize; font-weight: 600; color: var(--pcolor, var(--muted)); }

/* disclosure: grid-rows transition keeps content in flow; padding and borders live behind the open
   state so a collapsed 0fr row contributes no min-content height */
.msg__detail { display: grid; grid-template-rows: 0fr; overflow: hidden; transition: grid-template-rows var(--dur) var(--ease); }
.msg.is-open > .msg__detail { grid-template-rows: 1fr; }
.msg__detail-inner { overflow: hidden; min-height: 0; }
.msg.is-open > .msg__detail > .msg__detail-inner > * { animation: rise var(--dur-enter) var(--ease) both; }

/* mailbox rows: address + state, then the three everyday actions; everything else is in the dialog */
.acct-list { display: flex; flex-direction: column; gap: 2px; padding: 6px; }
.acct { position: relative; padding: 0 10px 10px 12px; border-radius: var(--radius-sm); scroll-margin-top: 110px; transition: background-color var(--dur-fast) var(--ease), box-shadow var(--dur) var(--ease); animation: rise var(--dur-enter) var(--ease) both; }
.acct:hover { background: var(--hover); }
.acct::before { content: ""; position: absolute; z-index: 1; left: 0; top: 10px; height: 28px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); transform: scaleY(0); transition: transform var(--dur) var(--ease); }
.acct.is-selected { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.acct.is-selected::before { transform: none; }
.acct.flash-ok { animation: rise var(--dur-enter) var(--ease) both, flashok var(--dur-flash) var(--ease); }
.acct.flash-err { animation: rise var(--dur-enter) var(--ease) both, flasherr var(--dur-flash) var(--ease); }
.acct__head { display: flex; align-items: center; gap: 10px; }
.acct__main { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding: 10px 0 8px; border: 0; background: transparent; color: inherit; text-align: left; }
.acct__main:focus-visible, .acct__av:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.acct__av { width: 28px; height: 28px; border-radius: 8px; font-size: 12px; border: 0; padding: 0; cursor: pointer; }
.acct__av:hover:not(:disabled) { box-shadow: inset 0 0 0 2px var(--accent); }
.acct__av:disabled { cursor: default; opacity: .5; }
.acct__email { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 13.5px; }
.acct__ticker { margin: -2px 0 8px 38px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--muted); }
.acct__ticker[hidden] { display: none; }
.acct__ticker.is-swap { animation: rise .3s var(--ease); }
.acct__ticker[data-s="overdue"], .acct__ticker[data-s="expired"] { color: var(--err); font-weight: 600; }
.acct__ticker[data-s="active"] { color: var(--text); }
.acct__actions { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 6px; }
.acct__progress { position: absolute; left: 10px; right: 10px; top: 0; height: 2px; overflow: hidden; border-radius: 2px; pointer-events: none; }
.acct__progress span { display: block; height: 100%; width: 0; background: var(--accent); opacity: 0; transition: width .5s var(--ease), opacity .4s; }
.acct.is-syncing .acct__progress span { opacity: 1; }
.acct.is-syncing.is-indeterminate .acct__progress span { width: 40%; animation: slide 1.1s var(--ease) infinite; }

/* live 2FA code: click copies; the countdown turns warm in the last seconds */
.totp { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; height: 26px; padding: 0 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-2); color: var(--text); font-size: 12px; white-space: nowrap; transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
.totp:not(:disabled):hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: var(--accent-soft); }
.totp:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.totp:disabled { cursor: default; color: var(--faint); }
.totp__label { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; color: var(--muted); }
.totp__code { font-family: var(--mono); font-size: 13px; font-weight: 700; letter-spacing: .06em; font-variant-numeric: tabular-nums; }
.totp__left { min-width: 20px; text-align: right; font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; }
.totp.is-ending .totp__left, .totp.is-ending .totp__code { color: var(--warn); }
.totp.is-copied { border-color: var(--ok); background: var(--ok-soft); }
.totp.is-copied .totp__code { color: var(--ok); }
.tool__head .totp { margin: -4px 0; }

/* account dialog */
.dialog--acct { width: min(600px, 94vw); max-height: min(86vh, 860px); }
.dialog--acct[open] { display: flex; animation: rise var(--dur-enter) var(--ease); }
.adlg { display: flex; flex-direction: column; width: 100%; min-height: 0; }
.adlg__head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 12px 20px; border-bottom: 1px solid var(--line); }
.adlg__av { width: 40px; height: 40px; }
.adlg__heading { flex: 1; min-width: 0; }
.adlg__title { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; font-weight: 700; }
.adlg__meta { display: flex; align-items: center; gap: 6px; margin-top: 2px; min-width: 0; overflow: hidden; white-space: nowrap; font-size: 12px; color: var(--muted); }
.adlg__meta .host { overflow: hidden; text-overflow: ellipsis; }
.adlg__body { flex: 1; min-height: 0; overflow: auto; padding: 14px 20px 16px; }
.adlg__foot { display: flex; align-items: center; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); }
.acct__alert { margin: 0 0 12px; }
.tool { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.tool--first { margin-top: 0; padding-top: 0; border-top: 0; }
.tool__head { display: flex; align-items: center; gap: 6px; margin: 0 0 10px; font-size: 12px; font-weight: 600; color: var(--muted); }
.tool__head > .ico { width: 14px; height: 14px; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 12px; margin: 0; font-size: 12.5px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-family: var(--mono); font-size: 12px; overflow-wrap: anywhere; }
.kv .skeleton { height: 12px; }
.ticket { padding: 12px; border: 1px solid color-mix(in srgb, var(--warn) 40%, var(--line)); background: var(--warn-soft); border-radius: var(--radius-sm); font-size: 13px; }
.ticket + .ticket { margin-top: 8px; }
.ticket__reason { font-weight: 600; overflow-wrap: anywhere; }
.ticket__meta { color: var(--muted); font-size: 12px; }
.ticket__row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.ticket input, .app-pw input { flex: 1; min-width: 180px; font-family: var(--mono); }
.app-pw { margin-top: 12px; }
.app-pw__label { display: block; margin: 0 0 2px; color: var(--muted); font-size: 12px; font-weight: 600; }
.app-pw .ticket__row { margin-top: 0; }

/* mail rows */
.mrow { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; grid-template-areas: "av from meta" "av subj subj" "av snip snip"; column-gap: 12px; row-gap: 1px; align-items: center; width: 100%; padding: 12px 16px; border: 0; background: transparent; color: inherit; text-align: left; transition: background-color var(--dur-fast) var(--ease); }
.mrow__av { grid-area: av; align-self: start; margin-top: 2px; }
.mrow__from { grid-area: from; display: flex; align-items: baseline; gap: 6px; min-width: 0; overflow: hidden; white-space: nowrap; }
.mrow__name { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.mrow__addr { display: none; flex: 0 100 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: 12.5px; }
.mrow__meta { grid-area: meta; display: flex; align-items: center; gap: 8px; padding-left: 8px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.mrow__att { display: inline-flex; color: var(--faint); }
.mrow__date { font-variant-numeric: tabular-nums; }
.mrow__date-full { display: none; }
.mrow__subject { grid-area: subj; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.mrow__snippet, .mrow__to { grid-area: snip; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 13px; }
.mrow__to { display: none; }

/* message list and inline reader */
.msg { --indent: 64px; position: relative; border-bottom: 1px solid var(--line); scroll-margin-top: 72px; animation: rise var(--dur-enter) var(--ease) both; }
.msg::before { content: ""; position: absolute; z-index: 1; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); transform: scaleY(0); transform-origin: top; transition: transform var(--dur) var(--ease); }
.msg.is-open::before { transform: none; }
.msg.is-new { animation: rise var(--dur-enter) var(--ease) both, glow var(--dur-flash) var(--ease); }
.msg__head:hover { background: var(--hover); }
.msg.is-open > .msg__head:hover { background: color-mix(in srgb, var(--text) 2.5%, transparent); }
.msg__head:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
/* opening turns the row into the message header: full sender, wrapped subject, recipients, full date */
.msg.is-open .mrow__addr, .msg.is-open .mrow__date-full { display: inline; }
.msg.is-open .mrow__to { display: block; }
.msg.is-open .mrow__snippet, .msg.is-open .mrow__date-short { display: none; }
.msg.is-open .mrow__subject { white-space: normal; font-size: 16px; font-weight: 600; line-height: 1.35; margin: 2px 0; }
.msg__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 2px 16px 10px var(--indent); }
.msg__info { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.msg__paper { margin: 0 16px 14px var(--indent); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.msg__paper > * { animation: rise var(--dur-enter) var(--ease) both; }
/* HTML mail is authored for a white page in either theme */
.msg__frame { display: block; width: 100%; height: var(--paper-h); border: 0; background: #fff; }
.msg__text { margin: 0; padding: 16px 20px; min-height: 120px; max-height: var(--paper-h); overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font: 14px/1.65 var(--font); color: var(--text); }
.msg__guard { display: flex; align-items: center; gap: 8px; padding: 6px 10px 6px 12px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.msg__guard .ico { width: 14px; height: 14px; color: var(--ok); }
.msg__guard-text { flex: 1; min-width: 0; }
.tlink { color: var(--accent); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent); text-underline-offset: 2px; }
.tlink:hover { text-decoration-color: currentColor; }
/* verification codes in the text view: click copies */
.otp { display: inline; margin: 0 1px; padding: 0 5px; border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); border-radius: 5px; background: var(--accent-soft); color: var(--accent); font: 700 1.05em/1.35 var(--mono); letter-spacing: .06em; cursor: copy; transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
.otp:hover { border-color: var(--accent); }
.otp:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.otp.is-copied { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.link__host { font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }
.link__url { display: block; max-height: 140px; overflow: auto; padding: 8px 10px; border-radius: 8px; font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.link__notes { margin: 0; padding-left: 18px; font-size: 12.5px; color: var(--muted); }
.link__notes .is-warn { color: var(--warn); }
.link__notes .is-ok { color: var(--ok); }
.dialog--link .dialog__actions { flex-wrap: wrap; }
.msg__atts { padding: 0 16px 14px var(--indent); }
.msg__atts-head { margin: 0 0 8px; font-size: 12px; font-weight: 600; color: var(--muted); }
.atts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.att { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; grid-template-areas: "ic name dl" "ic meta dl"; column-gap: 10px; align-items: center; width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: inherit; text-align: left; transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease); }
.att:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); background: var(--surface-2); }
.att[disabled] { opacity: .6; cursor: progress; }
.att__icon { grid-area: ic; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; background: var(--tone, var(--tone-7)); color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .03em; }
.att__name { grid-area: name; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; }
.att__meta { grid-area: meta; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--muted); }
.att__dl { grid-area: dl; color: var(--faint); transition: color var(--dur-fast) var(--ease); }
.att:hover .att__dl { color: var(--accent); }

/* subscriptions (web/subs.js): pane cards, page table, original emails */
.subs { display: flex; flex-direction: column; gap: 10px; padding: 10px; }
.sub { position: relative; display: flex; flex-direction: column; gap: 9px; padding: 12px 12px 6px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); overflow: hidden; animation: rise var(--dur-enter) var(--ease) both; transition: border-color var(--dur-fast) var(--ease); }
.sub:hover { border-color: var(--line-strong); }
.sub.is-active { --state-c: var(--ok); } .sub.is-expired { --state-c: var(--err); } .sub.is-overdue { --state-c: var(--warn); } .sub.is-canceled { --state-c: var(--faint); }
.sub.is-canceled { opacity: .75; }
.sub__top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sub__av { width: 32px; height: 32px; border-radius: 9px; font-size: 13px; background: var(--tone, var(--tone-7)); }
.sub__id { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.sub__id b { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub__id span { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub__money { display: flex; align-items: baseline; flex-wrap: wrap; gap: 3px; font-variant-numeric: tabular-nums; }
.sub__money b { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.sub__money small { font-size: 12px; color: var(--muted); }
.sub__money .badge { align-self: center; margin-left: 4px; }
.sstate.is-active { --b: var(--ok); } .sstate.is-expired { --b: var(--err); }
.sstate.is-overdue { --b: var(--warn); } .sstate.is-canceled { --b: var(--faint); }
.sper { display: flex; flex-direction: column; gap: 5px; }
.sper__bar { height: 5px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.sper__bar i { display: block; height: 100%; border-radius: inherit; background: var(--ok); transition: width var(--dur) var(--ease); }
.sper.is-due .sper__bar i { background: var(--warn); } .sper.is-past .sper__bar i, .sub.is-expired .sper__bar i { background: var(--err); }
.sub.is-canceled .sper__bar i { background: var(--faint); }
.sper__dates { display: flex; align-items: baseline; gap: 6px; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sper__dates b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; text-align: center; font-weight: 600; color: var(--text); }
.sper.is-due .sper__dates b { color: var(--warn); } .sper.is-past .sper__dates b { color: var(--err); }
.sub__facts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); }
.sub__facts li { display: inline-flex; align-items: center; gap: 5px; min-width: 0; max-width: 100%; }
.sub__facts .ico { width: 13px; height: 13px; color: var(--faint); }
.sub__facts small { color: var(--faint); }
.sub__facts .sub__note { flex-basis: 100%; color: var(--text); }
.sub__note span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mono { font-family: var(--mono); font-size: .95em; font-variant-numeric: tabular-nums; }
.sfact, .sip { all: unset; display: inline-flex; align-items: center; gap: 5px; border-radius: 5px; cursor: copy; transition: color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease); }
.sfact:hover, .sip:hover { color: var(--accent); }
.sfact:focus-visible, .sip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.sub__foot { display: flex; align-items: center; gap: 2px; margin: 0 -6px; padding-top: 4px; border-top: 1px dashed var(--line); }
.sub__src { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; padding: 5px 6px; border: 0; border-radius: 6px; background: none; color: var(--muted); font-size: 12px; text-align: left; transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
.sub__src:hover, .sub.is-open .sub__src { background: var(--surface-2); color: var(--text); }
.sub__src:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.sub__src span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub__src time { flex: none; font-size: 11.5px; color: var(--faint); }
.sub__src .ico { flex: none; width: 14px; height: 14px; }
.sub__src .ico:last-child { color: var(--faint); transition: transform var(--dur-fast) var(--ease); }
.sub.is-open .sub__src .ico:last-child { transform: rotate(180deg); }
.sub__edit { flex: none; padding: 4px 6px; }
.sub__mail { margin: 2px -6px 6px; }
.smails { display: flex; flex-direction: column; gap: 8px; }
.smail { min-width: 0; padding: 10px 0 2px; border-top: 1px solid var(--line); font-size: 12.5px; animation: rise var(--dur-enter) var(--ease) both; }
.smail__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--faint); }
.smail--billing .smail__head .badge { --b: var(--accent); }
.smail__subj { margin-top: 6px; font-weight: 600; overflow-wrap: anywhere; }
.smail__from { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; } .smail__from span { color: var(--faint); }
.smail__kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px 12px; margin: 8px 0 0; }
.smail__kv div { min-width: 0; } .smail__kv dt { font-size: 11px; color: var(--faint); }
.smail__kv dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.smail__raw { margin-top: 8px; }
.smail__raw summary { width: max-content; font-size: 12px; font-weight: 600; color: var(--accent); cursor: pointer; }
.smail__raw pre { max-height: 280px; margin: 6px 0 0; padding: 10px; overflow: auto; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--text); font: 12px/1.6 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.smail__basis { margin: 6px 0 0; font-size: 11px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.smails__none { margin: 0; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 8px; font-size: 12px; color: var(--muted); white-space: normal; }
.smails__none.is-err { color: var(--err); }
.vaccts { padding: 4px 10px 14px; }
.vaccts__head { margin: 6px 2px 8px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.vaccts__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.vacct { display: grid; grid-template-columns: 24px minmax(0, 1fr); grid-template-areas: "av name" "av meta"; column-gap: 8px; align-items: center; padding: 7px 10px; border: 1px dashed var(--line); border-radius: var(--radius-sm); }
.vacct__av { grid-area: av; width: 24px; height: 24px; border-radius: 7px; font-size: 11px; background: var(--tone, var(--tone-7)); }
.vacct__name { grid-area: name; font-size: 12.5px; font-weight: 600; }
.vacct__meta { grid-area: meta; font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn--badge { position: relative; }
.topbadge { position: absolute; top: -4px; right: -4px; min-width: 16px; padding: 0 4px; border-radius: 999px; background: var(--warn); color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; }
.topbadge:empty { display: none; }
/* the subscriptions page: state tiles, filter bar, sortable table with the original emails under a row */
.app[data-view="subscriptions"] #page-subs { display: block; animation: rise var(--dur-enter) var(--ease) both; }
.app[data-view="subscriptions"] .panes { display: none; }
.subs__body { max-width: 1520px; }
.subs__help { margin: 0; font-size: 12.5px; color: var(--muted); }
.sstats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.sstat { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 14px 13px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-xs); color: var(--muted); text-align: left; overflow: hidden; transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease); }
.sstat b { font-size: 22px; font-weight: 700; line-height: 1.2; letter-spacing: -.01em; color: var(--text); font-variant-numeric: tabular-nums; }
.sstat span { font-size: 12px; font-weight: 600; white-space: nowrap; }
.sstat span::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--sc); vertical-align: 1px; }
.sstat:hover { border-color: color-mix(in srgb, var(--sc) 50%, var(--line)); }
.sstat.is-on { border-color: var(--sc); box-shadow: inset 0 0 0 1px var(--sc); }
.sstat:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sstat--all { --sc: var(--accent); } .sstat--active { --sc: var(--ok); } .sstat--due { --sc: var(--warn); }
.sstat--expired { --sc: var(--err); } .sstat--overdue { --sc: #e0663a; } .sstat--canceled { --sc: var(--faint); }
.card.sgrid { padding: 0; overflow: hidden; }
.sgrid__bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.sgrid__search { flex: 1 1 260px; min-width: 200px; }
.card .sgrid__bar select, .card .sgrid__bar input[type="date"] { width: auto; }
.sgrid__dates { display: inline-flex; align-items: center; gap: 4px; color: var(--faint); }
.sgrid__scroll { max-height: max(300px, calc(100dvh - 330px)); overflow: auto; overscroll-behavior: contain; }
.stbl { width: 100%; min-width: 1240px; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.stbl th { position: sticky; top: 0; z-index: 2; padding: 0; border-bottom: 1px solid var(--line); background: var(--surface); text-align: left; white-space: nowrap; }
.stbl th button { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 4px; width: 100%; padding: 9px 10px; font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer; }
.stbl th button::after { content: "↕"; font-size: 11px; opacity: .35; }
.stbl th[aria-sort="ascending"] button, .stbl th[aria-sort="descending"] button { color: var(--accent); }
.stbl th[aria-sort="ascending"] button::after { content: "↑"; opacity: 1; } .stbl th[aria-sort="descending"] button::after { content: "↓"; opacity: 1; }
.stbl th button:hover { color: var(--text); }
.stbl th button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.stbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); background: var(--surface); vertical-align: middle; white-space: nowrap; }
.stbl td small { display: block; margin-top: 1px; font-size: 11.5px; color: var(--muted); }
.stbl th:first-child, .stbl td.stbl__email { position: sticky; left: 0; z-index: 1; box-shadow: 1px 0 0 var(--line); }
.stbl th:first-child { z-index: 3; }
.stbl tr.srow td { transition: background-color var(--dur-fast) var(--ease); }
.stbl tr.srow:hover td { background: color-mix(in srgb, var(--text) 3%, var(--surface)); }
.stbl tr.srow.is-open td { background: color-mix(in srgb, var(--text) 3%, var(--surface)); border-bottom-color: transparent; }
.stbl tr.srow.is-canceled td:not(.stbl__acts) { color: var(--muted); }
.stbl__email { max-width: 250px; } .stbl__email span { display: block; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.stbl__date, .stbl__day { font-variant-numeric: tabular-nums; }
.stbl__plan b { font-weight: 600; }
.stbl__end.is-due small { color: var(--warn); font-weight: 600; }
.stbl__end.is-past span, .stbl__end.is-past small { color: var(--err); }
.stbl__state .badge { margin-left: 4px; }
.stbl__note { max-width: 220px; } .stbl__note span { display: block; overflow: hidden; text-overflow: ellipsis; }
.stbl__acts { width: 1%; text-align: right; }
.stbl__acts .btn { padding: 4px 6px; }
.stbl tr.srow.is-open [data-act="mail"] { background: var(--accent-soft); color: var(--accent); }
.stbl__more > td { padding: 2px 12px 14px; background: color-mix(in srgb, var(--text) 3%, var(--surface)); white-space: normal; }
.stbl__more .sub__mail { margin: 0; }
.stbl__more .smails { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); align-items: start; }
.stbl__empty td { white-space: normal; }
.svendor { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; }
.svendor__av { width: 22px; height: 22px; border-radius: 6px; font-size: 11px; background: var(--tone, var(--tone-7)); }
@media (max-width: 1099px) { .sstats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 559px) { .sstats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .sgrid__dates { flex-wrap: wrap; } }

/* status bar: live sync telemetry */
.statusbar { grid-area: status; display: flex; align-items: center; gap: 14px; height: 38px; padding: 0 14px; overflow: hidden; border-top: 1px solid var(--line); background: var(--surface); font-size: 12px; color: var(--muted); white-space: nowrap; }
.sb { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.sb + .sb { padding-left: 14px; border-left: 1px solid var(--line); }
.sb__num { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
.sb__num--ok { color: var(--ok); } .sb__num--err { color: var(--err); }
.sb__sub { max-width: 180px; overflow: hidden; text-overflow: ellipsis; color: var(--faint); }
.tele__ring { position: relative; width: 18px; height: 18px; flex: none; }
.tele__ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring__bg, .ring__fg { fill: none; stroke-width: 4; }
.ring__bg { stroke: var(--line); }
.ring__fg { stroke: var(--accent); stroke-dasharray: 97.4; stroke-dashoffset: 97.4; stroke-linecap: round; transition: stroke-dashoffset .4s var(--ease); }
#tele-inflight.is-busy .ring__fg { stroke-dashoffset: 60; animation: spin 1.1s linear infinite; transform-origin: 50% 50%; }
#tele-inflight.is-busy .sb__num { color: var(--accent); }
.spark { display: flex; align-items: flex-end; gap: 2px; width: 120px; height: 20px; }
.spark i { flex: 1; background: var(--accent-soft); border-radius: 2px 2px 0 0; min-height: 2px; transition: height .4s var(--ease); }
.spark i.ok { background: var(--accent); } .spark i.err { background: var(--err); }
.ticker { flex: 1; min-width: 0; display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; overflow: hidden; }
.sb--desk { padding-left: 14px; border-left: 1px solid var(--line); }
.ticker li { flex: none; font-size: 11.5px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); animation: slidein var(--dur-enter) var(--ease); }
.ticker li b { color: var(--text); font-weight: 600; }
.ticker li.ok { border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); } .ticker li.err { border-color: color-mix(in srgb, var(--err) 50%, var(--line)); }

/* dialogs, toasts */
.dialog__body :is(input:not([type="checkbox"], [type="radio"]), textarea, select), .card :is(input:not([type="checkbox"], [type="radio"]), textarea, select) { width: 100%; }
.import__result { font-family: var(--mono); font-size: 12px; background: var(--surface-2); padding: 10px; border-radius: 8px; max-height: 200px; overflow: auto; margin: 0; }
/* forwarding settings */
.dialog--fwd { width: min(640px, 94vw); max-height: min(90vh, 900px); }
.dialog--fwd .dialog__body { overflow: auto; max-height: inherit; }
.fwd__top { display: flex; align-items: center; gap: 8px; }
.fwd__row { display: flex; gap: 8px; } .fwd__row input { flex: 1; letter-spacing: .2em; }
.fwd__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
.fwd__foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.fwd__status { font-size: 12px; color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.kernel-note { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.kernel-note.is-ok { color: var(--ok); } .kernel-note.is-err { color: var(--err); }
.dialog__body .fwd__bot, .card .fwd__bot { margin-top: 8px; font-size: 12px; }
@media (max-width: 559px) { .fwd__grid { grid-template-columns: minmax(0, 1fr); } }
.bk__list { max-height: 260px; overflow: auto; }
.bk__list li { align-items: baseline; gap: 12px; }
.bk__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono, ui-monospace, monospace); }
.bk__meta { color: var(--muted); font-size: 12px; white-space: nowrap; }
.dialog__body .bk__empty, .dialog__body .bk__hint, .card .bk__empty, .card .bk__hint { margin-top: 8px; font-size: 12px; color: var(--muted); }
.env__wide { grid-column: 1 / -1; }
/* share-key dialog: the readonly value and its copy button stay on one line. */
.dialog--sk .ticket__row { margin-top: 0; }
.dialog--sk .ticket__row input { flex: 1; width: auto; min-width: 150px; }
.env input, .env select { width: 100%; }
.env__state { font-weight: 500; }
.env__hint { margin: 8px 0 0; font-size: 11.5px; color: var(--muted); }
.env__gate { margin-top: 8px; } .env__gate input { letter-spacing: .2em; }

/* full-width pages (settings center, proxy center) take the panes area while open */
.page { grid-area: panes; display: none; min-height: 0; overflow: auto; overscroll-behavior: contain; background: var(--bg); }
.app[data-view="settings"] #page-settings, .app[data-view="proxies"] #page-proxies { display: block; animation: rise var(--dur-enter) var(--ease) both; }
.app[data-view="settings"] .panes, .app[data-view="proxies"] .panes { display: none; }
.page__head { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 16px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.page__title { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.page__toc { display: flex; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.page__toc a { flex: none; padding: 4px 9px; border-radius: 7px; font-size: 12.5px; font-weight: 600; color: var(--muted); text-decoration: none; }
.page__toc a:hover { background: var(--surface-2); color: var(--text); }
.page__op { font-size: 12px; color: var(--muted); }
.page__body { max-width: 1180px; margin: 0 auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.page__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.gc-entry { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.gc-entry .tool__head { margin: 0; color: var(--text); font-size: 14px; }
.gc-entry .env__hint { margin: 4px 0 0; }
#dlg-gmail-check { width: min(440px, 94vw); }
#dlg-gmail-check .dialog__body { display: grid; gap: 12px; }
#dlg-gmail-check :is(.env__hint, .fwd__status) { margin: 0; overflow-wrap: anywhere; }
#dlg-gmail-check .dialog__actions { flex-wrap: wrap; }
.card { scroll-margin-top: 64px; }
.card--wide { grid-column: 1 / -1; }
.card > .tool__head { font-size: 14px; font-weight: 600; color: var(--text); }
.card p { margin: 0 0 10px; font-size: 12.5px; color: var(--muted); }
.card__sub { display: flex; align-items: center; gap: 6px; margin: 16px 0 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.fwd__gate.card { max-width: 460px; }
.tok__new { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, .8fr) minmax(0, 1fr) auto; gap: 6px; margin-top: 8px; }
.bk__list li .btn { flex: none; }
.audit li { font-size: 12px; } .audit .bk__name { font-family: inherit; }
.px__report { margin: 10px 0 0; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); font-size: 12.5px; color: var(--text); }
.px__front input { flex: 1; letter-spacing: normal; }
.px__list { margin-top: 8px; max-height: 300px; overflow: auto; }
.px__list code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.px__list .is-bad { color: var(--err); }
.px__table { display: grid; grid-template-columns: minmax(160px, 1.2fr) minmax(220px, 2fr) 70px minmax(90px, .6fr) auto; gap: 0 10px; align-items: center; font-size: 12.5px; }
.px__table > * { padding: 6px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.px__table .px__h { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.px__table .px__email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.px__acts { display: flex; gap: 4px; justify-content: flex-end; }
.px__table .px__empty { grid-column: 1 / -1; padding: 14px 0; }
.card .tool__head select { --control-h: 28px; --control-fs: 12px; width: auto; }
[data-subs="off"] .pane--subs, [data-subs="off"] .views__b[data-view="subs"], [data-subs="off"] #btn-subs { display: none !important; }

/* sign-in page: covers the dashboard until a token (and 2FA, when configured) is accepted */
.login { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 20px; background:
  radial-gradient(1200px 600px at 15% -10%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 60%),
  radial-gradient(900px 500px at 110% 110%, color-mix(in srgb, #8a5cff 14%, transparent), transparent 60%), var(--bg); }
.login__card { width: min(400px, 100%); display: flex; flex-direction: column; gap: 12px; padding: 26px 26px 22px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 24px 64px -28px rgba(0,0,0,.45); animation: rise var(--dur-enter) var(--ease) both; }
.login__brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.login__title { margin: 6px 0 0; font-size: 20px; letter-spacing: -.01em; }
.login__sub { margin: 0; font-size: 12.5px; color: var(--muted); }
.login .fwd__field input { --control-h: 38px; width: 100%; font-family: var(--mono); }
#login-code { letter-spacing: .3em; }
.login__err { font-weight: 600; }
.login__go { min-height: 38px; margin-top: 2px; }

/* 2FA generator */
.dialog--2fa { width: min(420px, 92vw); }
.g2fa__code { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 10px 10px; border: 1px dashed var(--line); border-radius: 12px; background: var(--surface-2); color: var(--text); cursor: copy; transition: border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
.g2fa__code b { font: 700 32px/1.1 var(--mono); letter-spacing: .12em; font-variant-numeric: tabular-nums; }
.g2fa__code:not([disabled]):hover { border-color: var(--accent); color: var(--accent); }
.g2fa__code[disabled] { cursor: default; color: var(--faint); }
.g2fa__code.is-low b { color: var(--warn); }
.g2fa__left { font-size: 11.5px; color: var(--muted); min-height: 1em; }
.g2fa__bar { height: 4px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.g2fa__bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 1s linear; }
.dialog__body .g2fa__msg { min-height: 1em; font-size: 12px; color: var(--err); }
.g2fa__bind { display: flex; gap: 8px; }
.g2fa__bind select { flex: 1; min-width: 0; }
@media (min-width: 1100px) { [data-subs="off"] .panes { grid-template-columns: var(--col-accounts) minmax(0, 1fr); } }
@media (max-width: 899px) {
  .page__grid { grid-template-columns: minmax(0, 1fr); }
  .tok__new { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .px__table { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; }
  .px__table .px__port, .px__table .px__route { display: none; }
}
/* a manual popover so toasts stay above modal dialogs (top layer); override the UA popover box */

/* mid widths: mailboxes stay; mail and subscriptions share the content column behind the switcher */
@media (max-width: 1099px) {
  .views { display: flex; padding-left: calc(var(--col-accounts) + 8px); }
  .views__b[data-view="accounts"] { display: none; }
  .app[data-view="accounts"] .views__b[data-view="mail"] { color: var(--accent); }
  .app[data-view="accounts"] .views__b[data-view="mail"]::after { transform: none; }
  .panes { grid-template-columns: var(--col-accounts) minmax(0, 1fr); }
  .pane--mail, .pane--subs { grid-column: 2; grid-row: 1; }
  .pane--subs { border-left: 0; }
  .app[data-view="subs"] .pane--mail, .app:not([data-view="subs"]) .pane--subs { display: none; }
  .sb--spark, .sb__sub { display: none; }
}
/* phones: one pane at a time */
@media (max-width: 759px) {
  :root { --paper-h: 60vh; }
  .topbar { flex-wrap: wrap; gap: 8px; padding: 8px 12px; }
  .brand { flex: 1; }
  .topbar__tools { margin-left: 0; width: 100%; }
  .topbar__tools .search { flex: 1; min-width: 0; }
  .views { padding-left: 8px; }
  .views__b[data-view="accounts"] { display: inline-flex; }
  .app[data-view="accounts"] .views__b[data-view="mail"] { color: var(--muted); }
  .app[data-view="accounts"] .views__b[data-view="mail"]::after { transform: scaleX(0); }
  .panes { grid-template-columns: minmax(0, 1fr); }
  .pane--accounts, .pane--mail, .pane--subs { grid-column: 1; grid-row: 1; border: 0; }
  .app:not([data-view="accounts"]) .pane--accounts, .app:not([data-view="mail"]) .pane--mail, .app[data-view="mail"] .pane--subs, .app[data-view="accounts"] .pane--subs { display: none; }
  .app[data-view="subs"] .pane--subs { display: block; }
  .msg { --indent: 12px; }
  .msg__head { grid-template-columns: 32px minmax(0, 1fr) auto; column-gap: 10px; padding: 10px 12px; }
  /* the full date would squeeze the sender to nothing; give it its own line under the recipients */
  .msg.is-open > .msg__head { grid-template-columns: 32px minmax(0, 1fr); grid-template-areas: "av from" "av subj" "av snip" "av meta"; }
  .msg.is-open .mrow__meta { padding: 2px 0 0; }
  .msg .avatar--person { width: 32px; height: 32px; font-size: 13px; }
  .msg__bar, .msg__atts { padding-right: 12px; }
  .msg__paper { margin-right: 12px; }
  .atts { grid-template-columns: 1fr; }
  .sb--polls, .ticker { display: none; }
  #btn-import { width: 37px; height: 37px; padding: 0; }
  #btn-import .btn__label { display: none; }
}

/* ---------- proxy pool, add proxy, window editor, extension center ---------- */
@font-face { font-family: "Twemoji Country Flags"; src: url("flags.woff2") format("woff2"); unicode-range: U+1F1E6-1F1FF, U+1F3F4, U+E0062-E0063, U+E0065, U+E0067, U+E006C, U+E006E, U+E0073-E0074, U+E0077, U+E007F; font-display: swap; }
.app[data-view="proxy-add"] #page-proxy-add, .app[data-view="mailboxes"] #page-mailboxes, .app[data-view="mailbox-add"] #page-mailbox-add, .app[data-view="window"] #page-window, .app[data-view="extensions"] #page-extensions, .app[data-view="platforms"] #page-platforms, .app[data-view="scripts"] #page-scripts { display: block; animation: rise var(--dur-enter) var(--ease) both; }
.app[data-view="proxy-add"] .panes, .app[data-view="mailboxes"] .panes, .app[data-view="mailbox-add"] .panes, .app[data-view="window"] .panes, .app[data-view="extensions"] .panes, .app[data-view="platforms"] .panes, .app[data-view="scripts"] .panes { display: none; }
/* Platform account center */
.pc { display: flex; flex-direction: column; gap: 14px; }
.pc__stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.pc__stat { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-xs); min-width: 0; }
.pc__stat > div { display: flex; flex-direction: column; min-width: 0; }
.pc__stat small { font-size: 12px; color: var(--muted); font-weight: 600; }
.pc__stat b { font-size: 22px; font-weight: 700; line-height: 1.2; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.pc__stat span:last-child { font-size: 11.5px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc__statico { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); }
.pc__statico .ico { width: 18px; height: 18px; }
.pc__panel { padding: 0; }
.pc__tabs { border-radius: var(--radius) var(--radius) 0 0; }
.pc__segn { font-size: 10.5px; font-weight: 700; color: var(--faint); font-variant-numeric: tabular-nums; }
.seg__b.is-active .pc__segn { color: var(--accent); }
.pc__bulk { display: flex; align-items: center; gap: 8px; padding: 8px 16px; border-bottom: 1px solid var(--line); font-size: 12.5px; color: var(--text); }
.pool__row.pc__row { grid-template-columns: 42px minmax(220px, 1.6fr) minmax(170px, 1fr) minmax(110px, .7fr) minmax(90px, .6fr) 120px; min-width: 820px; }
.pool__row.pc__prow { grid-template-columns: minmax(180px, 1.1fr) minmax(200px, 1.2fr) minmax(190px, 1.1fr) 230px; min-width: 820px; }
.pool__row.pc__row.is-sel { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.pc__who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pc__who > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.pc__who b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc__who small { color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc__mark, .pc__envico { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 9px; font-weight: 700; font-size: 13px; color: #fff; background: var(--imap); }
.pc__mark[data-p="openai"] { background: #10a37f; }
.pc__mark[data-p="google"] { background: #4285f4; }
.pc__mark[data-p="anthropic"] { background: #c96442; }
.pc__envico { background: var(--surface-2); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.pc__chips { display: flex; flex-wrap: wrap; gap: 4px; }
.pc__mbox, .pc__link { cursor: pointer; }
.pool__acts .btn.is-danger:not(:disabled):hover { color: var(--err); background: var(--err-soft); }
.pool__acts .btn--sm { padding: 5px 10px; font-size: 12px; white-space: nowrap; }
.is-warn { color: var(--warn); }
.pc__dlg { width: min(720px, 94vw); }
.pc__dlg--sm { width: min(480px, 94vw); }
.pc__dlg .pa__tabs { margin: 10px -2px 12px; padding: 0; background: transparent; }
.pc__dlg .pa__editor { margin-top: 10px; }
.pc__plat { flex-direction: row; align-items: center; gap: 10px; margin-bottom: 12px; }
.pc__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.pc__field--wide { grid-column: 1 / -1; }
.pc__stack { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
.pc__inline { display: flex; gap: 8px; align-items: center; }
.pc__inline select { flex: 1; }
.pc__fmt { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.pc__preview .pa__table { margin-top: 10px; max-height: 240px; overflow: auto; }
.pc__trow { grid-template-columns: 48px minmax(0, 1.6fr) minmax(0, 1fr) 150px; }
.pc__trow > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc__trow.is-bad, .ma__trow.is-bad, .pa__trow.is-bad { background: color-mix(in srgb, var(--err-soft) 50%, transparent); }
.pc__dlg .dialog__actions { margin-top: 16px; }
@media (max-width: 1000px) { .pc__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .pc__grid, .pc__fmt { grid-template-columns: 1fr; } .pc__stat b { font-size: 18px; } .page__op { display: none; } }
.flag { display: inline-grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 50%; overflow: hidden; font-family: "Twemoji Country Flags", var(--font); font-size: 34px; line-height: 1; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.flag--none { background: repeating-linear-gradient(45deg, var(--surface-2) 0 4px, var(--line) 4px 5px); }
.dot { display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: var(--faint); vertical-align: middle; }
.dot.is-ok { background: var(--ok); } .dot.is-err { background: var(--err); }
.is-bad { color: var(--err); }

.pool { padding: 0; overflow: hidden; }
.pool__bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.pool__bar select { width: auto !important; }
.pool__search { min-width: 200px; }
.pool__table { overflow-x: auto; }
.pool__row { grid-template-columns: 42px minmax(190px, 1.3fr) minmax(230px, 1.6fr) minmax(110px, .7fr) minmax(90px, .6fr) 128px; min-width: 860px; }
.pool__exit { display: flex; align-items: center; gap: 10px; }
.pool__exit > span:last-child, .pool__info { display: flex; flex-direction: column; min-width: 0; }
.pool__exit b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pool__exit small, .pool__info small, .pool__note small { color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pool__info code { background: none; padding: 0; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pool__note { display: flex; align-items: center; gap: 4px; }
.pool__note .btn--icon, .pool__acts .btn--icon { width: 30px; height: 30px; }
.pool__acts { display: flex; align-items: center; justify-content: flex-end; gap: 2px; padding-right: 12px !important; }
.pool__foot { margin: 0; padding: 10px 16px; }
.pl__list { margin-top: 10px; max-height: 50vh; overflow: auto; }
.pl__list li { justify-content: space-between; }

.pa__single { width: min(520px, 100%); margin: 0 auto; display: flex; flex-direction: column; gap: 6px; }
.pa__single input, .pa__single select, .pa__single textarea, .pa__batch select, .pa__code textarea, .win__form input, .win__form select { width: 100%; }
.mb__single { width: min(1100px, 100%); margin: 0 auto; display: flex; flex-direction: column; gap: 8px; }
.mb__single textarea, .mb__single input { width: 100%; }
.mb__single textarea { resize: vertical; }
.ml__row { grid-template-columns: 38px minmax(200px, 1.6fr) 110px minmax(100px, .7fr) 72px minmax(140px, 1fr) 72px; min-width: 800px; }
.ml__row > span.ml__pick { cursor: default; }
.pas__bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.pas__bar input[type="search"] { flex: 1; min-width: 140px; }
.pas__warn { margin: 8px 0 0; }
.pas__list { margin-top: 10px; max-height: 50vh; overflow: auto; }
.pas__list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; }
.pas__list li.is-on { background: var(--row-hover); }
.pas__list .fwd__check { min-width: 0; }
.pas__list .fwd__check span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pas__step { display: inline-flex; align-items: center; gap: 4px; }
.pas__step input { width: 56px; padding: 0 6px; text-align: center; }
.ml__row > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ml__row:not(.table-head) { cursor: pointer; }
.ma__table { margin-top: 8px; }
.ma__trow { grid-template-columns: minmax(180px, 1.6fr) 72px 64px 88px minmax(140px, 1.1fr) minmax(150px, 1.2fr) 88px minmax(88px, .7fr) 44px; min-width: 1000px; }
.ma__trow > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pa__label { margin: 10px 0 2px; font-size: 13px; font-weight: 600; color: var(--text); }
.pa__smart { resize: vertical; font-family: var(--mono); font-size: 12.5px !important; }
.pa__hr { width: 100%; border: 0; border-top: 1px solid var(--line); margin: 12px 0 4px; }
.pa__radios { display: flex; gap: 8px; }
.pa__radio { display: inline-flex; align-items: center; gap: 8px; width: 110px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); cursor: pointer; font-weight: 600; }
.pa__radio:has(input:checked) { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.pa__radio input { width: auto !important; }
.pa__addr { display: grid; grid-template-columns: 170px 1fr auto 1fr; align-items: center; border: 1px solid var(--line-strong); border-radius: var(--radius-control); background: var(--surface); box-shadow: var(--shadow-xs); overflow: hidden; transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease); }
.pa__addr > * { border: 0 !important; border-radius: 0 !important; box-shadow: none !important; }
/* composite controls focus as one */
.pa__addr:focus-within, .pa__editor:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.pa__addr select { border-right: 1px solid var(--line) !important; }
.pa__colon { padding: 0 2px; color: var(--muted); }
.pa__checkrow { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.pa__result { align-items: center; margin: 4px 0 0; }
.pa__result .flag { width: 20px; height: 20px; font-size: 26px; }
.pa__foot { display: flex; margin-top: 14px; } .pa__foot .btn { min-width: 72px; }
.pa__bgrid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 12px; }
.pa__editor { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow: hidden; }
.pa__ehead { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.pa__ehead .pa__label { margin: 0; } .pa__ehead select { width: auto; }
.pa__code { display: grid; grid-template-columns: 40px 1fr; height: 240px; }
.pa__gutter { margin: 0; padding: 10px 6px; overflow: hidden; text-align: right; font: 12.5px/1.6 var(--mono); color: var(--faint); background: var(--surface-2); border-right: 1px solid var(--line); user-select: none; }
.pa__code textarea { border: 0 !important; border-radius: 0 !important; box-shadow: none !important; resize: none; font: 12.5px/1.6 var(--mono) !important; padding: 10px !important; height: 100%; }
.pa__efoot { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-top: 1px solid var(--line); }
.pa__efoot select { width: auto; }
.pa__rules { padding: 2px 0; }
.pa__rules .pa__label { margin-top: 0; }
.pa__rulestext { margin: 6px 0 0; white-space: pre-wrap; font: 12.5px/1.75 var(--mono); color: var(--text); }
.pa__phead { display: flex; align-items: center; gap: 6px; margin: 18px 0 6px; }
.pa__phead .pa__label { margin: 0; }
.pa__table { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); overflow-x: auto; }
.pa__trow { grid-template-columns: 96px minmax(120px, 1.2fr) 74px minmax(90px, 1fr) 78px 72px minmax(70px, .8fr) minmax(120px, 1.1fr) 84px 52px; min-width: 980px; }
.pa__trow > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pa__exit { display: flex; align-items: center; gap: 6px; } .pa__exit .flag { width: 18px; height: 18px; font-size: 24px; }

.win__body { max-width: 1240px; }
.win { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.win__form { position: relative; padding: 22px 28px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-xs); }
.win__h { margin: 6px 0 14px; font-size: 14px; font-weight: 600; }
.win__h:not(:first-child) { margin-top: 22px; padding-top: 16px; border-top: 1px dashed var(--line); }
.win__row { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 14px; align-items: start; margin-bottom: 12px; }
.win__k { padding-top: 6px; text-align: right; font-size: 13px; color: var(--text); }
.win__v { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; max-width: 560px; }
.win__v > small, .win__note { flex-basis: 100%; color: var(--muted); font-size: 11.5px; }
.win__v .seg__b { height: 28px; padding: 0 14px; font-size: 12.5px; }
.win__box { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.win__box select { flex: 1; min-width: 200px; width: auto; }
.win__box small { flex-basis: 100%; color: var(--muted); font-size: 11.5px; }
.win__inline { font-size: 12.5px; color: var(--muted); }
.win__mini { width: 170px !important; font-family: var(--mono); }
.win__geo { display: inline-flex; align-items: center; gap: 6px; }
.win__geo input { width: 110px !important; }
.win__ua { display: flex; gap: 8px; flex-basis: 100%; } .win__ua input { flex: 1; font-family: var(--mono); font-size: 12px; }
.win__exts { flex-basis: 100%; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; }
.win__ext { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 12.5px; cursor: pointer; }
.win__ext input { width: auto !important; } .win__ext img { width: 18px; height: 18px; } .win__ext small { margin-left: auto; color: var(--muted); }
.win__foot { display: flex; gap: 8px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.win__summary { position: sticky; top: 70px; }
.win__summary.is-hidden { display: none; }
.win__summary .kv { grid-template-columns: 76px minmax(0, 1fr); }
.win:has(.win__summary.is-hidden) { grid-template-columns: minmax(0, 1fr); }

.ext__add { display: flex; gap: 8px; } .ext__add input { flex: 1; font-family: var(--mono); font-size: 12.5px; }
.ext__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
.ext { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 10px 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.ext__icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); object-fit: contain; }
.ext__main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ext__main b { font-size: 13.5px; } .ext__main small { color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ext__main code { background: none; padding: 0; }
.card .ext__main p { margin: 4px 0 0; font-size: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ext__tags { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.ext__acts { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; padding-top: 8px; border-top: 1px solid var(--line); }
.ext__acts .fwd__check { margin-right: auto; }

/* ---------- script builder ---------- */
.sb__body { max-width: 1480px; }
.sb__layout { display: grid; grid-template-columns: 220px minmax(0, 1.25fr) minmax(320px, 1fr); gap: 14px; align-items: start; }
.sb__lib, .sb__side { position: sticky; top: 64px; max-height: calc(100vh - 140px); overflow: auto; }
.sb__libbar { margin: 0 0 10px; }
.sb__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.sb__item { width: 100%; display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 8px 10px; border: 1px solid transparent; border-radius: 9px; background: none; color: var(--text); cursor: pointer; }
.sb__item:hover { background: var(--surface-2); }
.sb__item.is-active { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.sb__item b { font-size: 13px; } .sb__item small { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb__dirty { font-size: 11px; font-weight: 700; color: var(--warn); }
.sb__guide { margin: 0 0 12px; padding: 0 0 12px; border-bottom: 1px solid var(--line); }
.sb__guidehead { margin: 0; display: flex; gap: 8px; align-items: baseline; font-size: 12.5px; }
.sb__guidehead span, .sb__guide li span { color: var(--muted); font-weight: 500; }
.sb__guide ol { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sb__guide li { display: flex; flex-direction: column; gap: 1px; font-size: 12.5px; }
.sb__guide b { font-size: 12.5px; }
.sb__verdict { margin: 8px 0; }
.sb__livehelp { margin: 8px 0 0; min-height: 1.2em; font-size: 12.5px; color: var(--muted); }
.sb__meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; }
.sb__field--wide { grid-column: 1 / -1; }
.sb__vars small { font-weight: 500; }
.sb__var { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr) auto; gap: 6px; margin-bottom: 6px; }
.sb__steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sb__nostep { padding: 12px; border: 1px dashed var(--line); border-radius: 10px; }
.sb__step { padding: 10px 12px; border: 1px solid var(--line); border-left: 3px solid var(--line); border-radius: 10px; background: var(--surface); }
.sb__step.is-new { animation: glow 1.2s var(--ease); }
.sb__step[data-status="ok"] { border-left-color: var(--ok); }
.sb__step[data-status="failed"] { border-left-color: var(--err); background: color-mix(in srgb, var(--err-soft) 45%, var(--surface)); }
.sb__step[data-status="ignored"] { border-left-color: var(--warn); }
.sb__step.is-issue { border-color: var(--err); border-left-color: var(--err); }
.card .sb__field input.is-bad, .card .sb__field select.is-bad { border-color: var(--err); }
.sb__shead { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sb__n { flex: none; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); font-size: 11.5px; font-weight: 700; color: var(--muted); }
.card .sb__shead select { width: auto; max-width: 150px; }
.sb__doc { all: unset; cursor: pointer; flex: 1; min-width: 0; font-size: 11.5px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.sb__doc:hover, .sb__doc:focus-visible { color: var(--accent); }
.sb__ops { flex: none; display: flex; gap: 2px; }
.sb__sfields { display: flex; flex-wrap: wrap; gap: 6px 8px; margin-top: 8px; }
.sb__sfields > .sb__field { flex: 1 1 140px; } .sb__sfields > .sb__field--grow { flex: 3 1 220px; }
.sb__more { flex: 1 1 100%; font-size: 12px; color: var(--muted); }
.sb__more summary { cursor: pointer; width: max-content; }
.sb__more .sb__sfields { align-items: end; }
.sb__sres { margin-top: 6px; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.sb__err { color: var(--err); }
.sb__batch { list-style: none; margin: 6px 0 12px; padding: 0; max-height: 320px; overflow: auto; border-top: 1px solid var(--line); }
.sb__batchrow { display: flex; align-items: flex-start; gap: 8px; width: 100%; padding: 7px 6px; border: 0; border-bottom: 1px solid var(--line); background: none; color: inherit; font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.sb__batchrow:disabled { cursor: default; }
.sb__batchrow:not(:disabled):hover, .sb__batchrow.is-on { background: var(--hover); }
.sb__batchrow .badge { flex: none; }
.sb__batchmain { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.sb__run { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.sb__run .fwd__foot { margin-top: 8px; }
.sb__resline { overflow-wrap: anywhere; }
.sb__outputs { margin: 0 0 10px; }
.sb__copy { all: unset; cursor: copy; font-family: var(--mono); font-size: 12px; overflow-wrap: anywhere; }
.sb__copy:hover { color: var(--accent); }
.sb__shot { position: relative; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.sb__shot img { display: block; width: 100%; height: auto; }
.sb__hl { position: absolute; border: 2px solid var(--accent); border-radius: 3px; background: color-mix(in srgb, var(--accent) 18%, transparent); pointer-events: none; transition: all var(--dur-fast) var(--ease); }
.sb__shots { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.card .sb__filter { margin-bottom: 6px; }
.sb__els { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.sb__el { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.sb__el:hover { background: var(--surface-2); }
.sb__elmain { display: flex; flex-direction: column; min-width: 0; }
.sb__elmain b { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb__elmain code { background: none; padding: 0; font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb__elops { display: flex; gap: 3px; }
.sb__json { min-height: 320px; font-size: 12px; }
.sb__tabs { margin: 0 0 10px; }
.sb__simline { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.sb__simline b { display: block; font-size: 12px; margin-bottom: 2px; }
.sb__simline code { display: block; margin-top: 2px; }
.sb__simline.is-bad { color: var(--err); }
.sb__act { padding: 8px 0; border-bottom: 1px solid var(--line); }
.sb__act h4 { margin: 0 0 4px; font-size: 13px; display: flex; gap: 8px; align-items: baseline; }
.sb__act p { margin: 0 0 4px; font-size: 12.5px; }
.sb__act ul { margin: 0; padding-left: 1.1em; font-size: 12.5px; color: var(--muted); }
.sb__act.is-on { background: var(--accent-soft); border-radius: 8px; padding: 8px; }
@media (max-width: 1200px) { .sb__layout { grid-template-columns: minmax(0, 1fr) minmax(300px, .9fr); } .sb__lib { grid-column: 1 / -1; position: static; max-height: none; } }
@media (max-width: 900px) { .sb__layout { grid-template-columns: 1fr; } .sb__side { position: static; max-height: none; } }

@media (max-width: 900px) {
  .pa__bgrid, .win { grid-template-columns: 1fr; }
  .win__summary { position: static; }
  .win__row { grid-template-columns: 1fr; gap: 4px; } .win__k { text-align: left; padding-top: 0; }
  .win__form { padding: 16px; }
}

/* ---------- iCloud page (web/icloud.js) ---------- */
.icl { padding: 0; overflow: hidden; }
.icl__search { flex: 1; max-width: 420px; }
.icl__tbl { min-width: 900px; }
.icl__tbl td small.icl__bad { color: var(--err); }
.icl__kidtbl { min-width: 760px; }
.icl__kidtbl td { background: var(--surface); }
.icl__kids { padding: 6px 0 4px; }
.icl__kidbar { padding: 8px 0; border-bottom: 0; }
.icl__kidbar .icl__num { width: 72px !important; }
.icl__kidbar .icl__label { width: 180px !important; }
.icl__batch { margin: 0 0 8px !important; font-size: 12px; color: var(--muted); }
.icl__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 8px; }
.icl__pair { display: flex; gap: 6px; }
.icl__recv { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.icl__recv legend { padding: 0 4px; font-size: 12px; font-weight: 700; color: var(--muted); }
.icl__rounds { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 12px; }
.icl__rounds li { display: grid; gap: 2px; padding: 6px 8px; border-radius: 8px; background: var(--surface-2); }
.icl__rounds small { color: var(--muted); overflow-wrap: anywhere; }
.icl__maildlg { width: min(720px, 94vw); }
.icl__mails { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-height: 65vh; overflow: auto; }
.icl__mail { display: grid; gap: 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.icl__mailhead { display: flex; align-items: baseline; gap: 8px; }
.icl__mail small { color: var(--muted); font-size: 11.5px; }
.icl__mail p { margin: 0; font-size: 12.5px; color: var(--text); overflow-wrap: anywhere; }
.icl__code { justify-self: start; font-family: var(--mono); letter-spacing: .08em; }
@media (max-width: 759px) { .icl__grid { grid-template-columns: 1fr; } }
.app[data-view="icloud"] #page-icloud { display: block; animation: rise var(--dur-enter) var(--ease) both; }
.app[data-view="icloud"] .panes { display: none; }
.app[data-view="receivers"] #page-receivers { display: block; animation: rise var(--dur-enter) var(--ease) both; }
.app[data-view="receivers"] .panes { display: none; }

/* consolidated inbox workspace: every mailbox's mail, newest first */
.app[data-view="inbox"] #page-inbox { display: block; animation: rise var(--dur-enter) var(--ease) both; }
.app[data-view="inbox"] .panes { display: none; }
.ibx__body { max-width: 1280px; }
.ibx__list { background: var(--surface); }
.ibx__list .msg:last-child { border-bottom: 0; }
.mrow__box { --b: var(--accent); max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.ibx__more { display: flex; justify-content: center; padding: 10px; border-top: 1px solid var(--line); }
.ibx__more:has(> [hidden]) { display: none; }
/* wider screens: the mailbox column (with the hero) stays beside the open workspace */
@media (min-width: 760px) {
  .app[data-view="inbox"] .panes { display: grid; }
  .app[data-view="inbox"] .pane--mail, .app[data-view="inbox"] .pane--subs { display: none; }
  .app[data-view="inbox"] #page-inbox { margin-left: var(--col-accounts); border-left: 1px solid var(--line); position: relative; z-index: 1; }
}

/* workspace hero above the mailbox list: the newest mail of every mailbox, always in view */
.ibx-hero { position: relative; margin: 0 0 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); overflow: hidden; transition: border-color var(--dur) var(--ease); }
.ibx-hero.is-active { border-color: var(--accent); }
.ibx-hero.has-new { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.ibx-hero__head { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 10px 8px 14px; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.ibx-hero__head:focus-visible, .ibx-hero__item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 8px; }
.ibx-hero__icon { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); }
.ibx-hero__icon .ico { width: 18px; height: 18px; }
.ibx-hero__titles { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ibx-hero__title { font-size: 14px; font-weight: 600; color: var(--text); }
.ibx-hero__sub { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ibx-hero__n { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); }
.ibx-hero__new { flex: none; padding: 0 7px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; }
.ibx-hero__go { flex: none; width: 16px; height: 16px; color: var(--accent); transform: rotate(-90deg); }
.ibx-hero__list { list-style: none; margin: 0; padding: 0 6px 6px 10px; }
.ibx-hero__item { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "subj time" "who who"; gap: 0 8px; width: 100%; padding: 6px 8px; border: 0; border-radius: 8px; background: transparent; color: inherit; text-align: left; cursor: pointer; transition: background-color var(--dur-fast) var(--ease); }
.ibx-hero__item:hover { background: var(--hover); }
.ibx-hero__subj { grid-area: subj; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; font-weight: 600; }
.ibx-hero__time { grid-area: time; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ibx-hero__who { grid-area: who; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; color: var(--muted); }
.ibx-hero__item.is-new .ibx-hero__subj::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--accent); vertical-align: middle; }
.ibx-hero__empty { padding: 2px 8px 8px; font-size: 12px; color: var(--faint); }
/* while the workspace is open on the right, the hero is a compact header: no duplicate message list */
.app[data-view="inbox"] .ibx-hero__list { display: none; }
.app[data-view="inbox"] .ibx-hero__go { transform: none; opacity: .4; }
@media (prefers-reduced-motion: reduce) { .ibx-hero.has-new { animation: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); } }

/* mailbox filters: one compact, scrollable row each, state chips carry a colour dot */
.pane--accounts .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-top: 8px; padding-bottom: 2px; gap: 4px; }
.pane--accounts .chips::-webkit-scrollbar { display: none; }
.pane--accounts .chip { flex: none; height: 24px; padding: 0 8px; font-size: 11.5px; border-radius: 7px; border-color: transparent; background: transparent; box-shadow: none; }
.pane--accounts .chip:hover { background: var(--hover); }
.pane--accounts .chip.is-active { background: var(--accent-soft); }
.pane--accounts .chip[data-state]::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--faint); }
.pane--accounts .chip[data-state=""]::before { display: none; }
.chip[data-state="ACTIVE_POLLING"]::before { background: var(--ok) !important; }
.chip[data-state="PROVISIONED"]::before, .chip[data-state="AUTHENTICATING"]::before { background: var(--accent) !important; }
.chip[data-state="REQUIRES_MANUAL_INTERVENTION"]::before { background: var(--warn) !important; }
.chip[data-state="ERROR"]::before { background: var(--err) !important; }
.pane--accounts [data-f="group-chips"] { margin-top: 4px; }
.pane--accounts #sort { --control-h: 28px; --control-fs: 12px; }

/* workspace list: sticky search bar, mailbox tag with provider dot, one-click verification code */
.ibx__body { padding-top: 12px; }
/* the workspace is one flat surface: no card inside the page */
#page-inbox { background: var(--surface); }
.ibx__body .card.sgrid { overflow: visible; border: 0; border-radius: 0; box-shadow: none; }
.ibx__body .sgrid__bar { position: sticky; top: var(--ibx-head, 57px); z-index: 2; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(8px); border-radius: var(--radius) var(--radius) 0 0; }
.ibx__list .msg:hover > .msg__head { background: var(--hover); }
.mrow__box { display: inline-flex; align-items: center; gap: 5px; }
.mrow__box::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--pcolor, var(--accent)); }
.mrow__code { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border: 1px dashed color-mix(in srgb, var(--accent) 60%, transparent); border-radius: 6px; background: var(--accent-soft); color: var(--accent); font: 700 12px/1 var(--mono); letter-spacing: .06em; cursor: copy; transition: background-color var(--dur-fast) var(--ease); }
.mrow__code:hover { background: color-mix(in srgb, var(--accent) 18%, var(--surface)); }
.mrow__code.is-copied { border-style: solid; background: var(--ok-soft); color: var(--ok); border-color: var(--ok); }
.acct__icl { height: 18px; padding: 0 6px; font-size: 10.5px; }
.icl__rcform { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
/* Mailbox list sections: one divider head per group; iCloud is last and collapsed by default. */
.acct-group { display: flex; align-items: center; gap: 6px; width: 100%; margin: 8px 0 2px; padding: 8px 6px 4px; border: 0; border-top: 1px solid var(--line); background: none; color: var(--muted); font: inherit; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; cursor: pointer; text-align: left; }
.acct-group:first-child { margin-top: 0; border-top: 0; padding-top: 2px; }
.acct-group:hover { color: var(--text); }
.acct-group__label { flex: 1; }
.acct-group__n { font-weight: 600; font-variant-numeric: tabular-nums; padding: 0 6px; border-radius: 999px; background: var(--surface-2); }
.acct-group__chev { width: 12px; height: 12px; transition: transform var(--dur-fast) var(--ease); transform: rotate(-90deg); }
.acct-group[aria-expanded="true"] .acct-group__chev { transform: rotate(0deg); }
.acct-group:focus-visible { outline: 2px solid var(--accent, currentColor); outline-offset: 2px; border-radius: 6px; }

/* plan: activation overlay, plan dialog, locked features (web/plan.js) */
.activation { position: fixed; inset: 0; z-index: 41; display: grid; place-items: center; padding: 20px; background:
  radial-gradient(1200px 600px at 15% -10%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 60%), var(--bg); }
.act__code { display: flex; flex-direction: column; gap: 4px; padding: 12px; border: 1px dashed var(--line); border-radius: 10px; background: var(--surface-2); font-size: 12px; color: var(--muted); }
.act__code b { font: 700 26px/1.2 var(--mono); letter-spacing: .15em; color: var(--text); }
.act__code a { font-family: var(--mono); font-size: 11.5px; overflow-wrap: anywhere; color: var(--accent); }
.btn--plan[data-plan="pro"] .ico { color: var(--ok); }
.btn--plan[data-plan="max"] .ico { color: var(--accent); }
[data-feature].is-locked { opacity: .55; }
[data-feature].is-locked .ico { filter: grayscale(1); }
section[data-feature].is-locked { pointer-events: none; }
[data-plan-subs="off"] .pane--subs, [data-plan-subs="off"] .views__b[data-view="subs"] { display: none !important; }
@media (min-width: 1100px) { [data-plan-subs="off"] .panes { grid-template-columns: var(--col-accounts) minmax(0, 1fr); } }
.plan__need { font-weight: 600; }
.pfeats { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.pfeat { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; font-size: 12.5px; color: var(--faint); text-decoration: line-through; }
.pfeat.is-on { color: var(--text); text-decoration: none; }
.pfeat.is-focus { background: var(--warn-soft); }
.pfeat .badge { margin-left: auto; }
