/* 趣渡安全邮箱 · embedded UI. Warm paper, ink green, stamp red. */
:root {
  --paper: #f4efe3;
  --paper-2: #ece5d5;
  --surface: #fffdf7;
  --surface-2: #f8f4ea;
  --ink: #1b241e;
  --ink-2: #435046;
  --muted: #798277;
  --line: #ddd4c1;
  --line-strong: #c7bca5;
  --brand: #14543e;
  --brand-hover: #0e4231;
  --brand-ink: #0c3828;
  --brand-soft: #e3eee6;
  --stamp: #b0442c;
  --stamp-soft: #f6e5df;
  --ok: #2e7d5b;
  --ok-soft: #e7f2ec;
  --warn: #a46a1d;
  --warn-soft: #f8eeda;
  --danger: #a83a2a;
  --danger-soft: #f7e4df;
  --shadow: 0 18px 50px rgba(35, 45, 35, .07);
  --radius: 14px;
  --radius-sm: 9px;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", Georgia, serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--ink);
  font: 14px/1.65 var(--sans);
  background-color: var(--paper);
  background-image:
    radial-gradient(850px 520px at 6% -8%, #e5eee5 0, transparent 55%),
    radial-gradient(760px 480px at 102% -2%, #f7e7dd 0, transparent 48%);
  background-attachment: fixed;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { letter-spacing: -.02em; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--brand-soft); }

.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); font-size: 12px; word-break: break-all; }
.eyebrow { font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.lede { color: var(--ink-2); font-size: 14px; line-height: 1.8; }

/* topbar ------------------------------------------------------------------ */
.topbar { border-bottom: 1px solid var(--line); background: rgba(255, 253, 247, .72); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 20; }
.topbar-inner { padding: 0 26px; height: 68px; display: flex; align-items: center; gap: 26px; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px; display: grid; place-items: center;
  background: var(--ink); color: var(--paper); border-radius: 8px;
  font: 700 11px/1 var(--sans); letter-spacing: 0;
}
.brand-name { font: 700 15px/1.2 var(--sans); letter-spacing: .01em; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav a, .nav button { padding: 8px 11px; border-radius: 8px; color: var(--ink-2); font-size: 12.5px; font-weight: 600; background: none; border: 0; cursor: pointer; text-decoration: none; }
.nav a:hover, .nav button:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.nav .active { background: var(--brand-soft); color: var(--brand-ink); }
.user-chip { display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px 5px 5px; border: 1px solid var(--line); border-radius: 999px; font-size: 11.5px; color: var(--ink-2); background: rgba(255,253,247,.6); }
.avatar { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: 11px; }

.content { padding: 34px 26px 70px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { margin: 4px 0 4px; font: 700 32px/1.15 var(--serif); }
.page-head p { margin: 0; color: var(--muted); font-size: 12.5px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* buttons ----------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 40px; padding: 0 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-size: 12.5px; font-weight: 650; cursor: pointer; text-decoration: none;
  transition: background .15s ease, border-color .15s ease, transform .06s ease;
}
.btn:hover { background: var(--surface-2); border-color: var(--line-strong); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fffdf6; }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-stamp { background: var(--stamp); border-color: var(--stamp); color: #fff; }
.btn-stamp:hover { background: #983822; border-color: #983822; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--brand); }
.btn-ghost:hover { background: var(--brand-soft); }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 11.5px; border-radius: 7px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--brand-soft); outline-offset: 1px; }

/* forms ------------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.label { font-size: 12px; font-weight: 650; color: var(--ink); }
.input, .select, .textarea {
  width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); padding: 10px 12px; font-size: 13.5px; color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-strong); }
.input:focus, .select:focus, .textarea:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.textarea { min-height: 110px; resize: vertical; line-height: 1.7; }
.hint { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; }
.inline-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.checkbox-row { display: flex; align-items: flex-start; gap: 9px; font-size: 12px; color: var(--ink-2); line-height: 1.6; }
.checkbox-row input { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--brand); flex: 0 0 auto; }
.form-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 20px; }

/* alerts ------------------------------------------------------------------ */
.alert { border: 1px solid var(--line); border-left-width: 3px; background: var(--surface-2); border-radius: 10px; padding: 11px 14px; font-size: 12.5px; line-height: 1.7; margin: 0 0 16px; }
.alert-error { border-color: var(--danger); background: var(--danger-soft); color: #7b281c; }
.alert-ok { border-color: var(--ok); background: var(--ok-soft); color: #1f5e43; }
.alert-warn { border-color: var(--warn); background: var(--warn-soft); color: #74490e; }
.alert-info { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); }
.flash { margin-bottom: 20px; }

/* pills / badges ---------------------------------------------------------- */
.pill { display: inline-flex; align-items: center; gap: 5px; height: 23px; padding: 0 9px; border-radius: 999px; border: 1px solid var(--line); font-size: 10.5px; font-weight: 700; color: var(--muted); background: var(--surface); white-space: nowrap; }
.pill-ok { border-color: #b9d8c8; background: var(--ok-soft); color: var(--ok); }
.pill-warn { border-color: #e7cf9f; background: var(--warn-soft); color: var(--warn); }
.pill-off { border-color: #e8beb4; background: var(--danger-soft); color: var(--danger); }
.pill-info { border-color: #b9cec1; background: var(--brand-soft); color: var(--brand); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); display: inline-block; flex: 0 0 auto; }
.dot-on { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.dot-off { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.dot-warn { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }

/* cards ------------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; min-width: 0; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.card-title { margin: 0; font: 700 15px/1.3 var(--serif); }
.card-sub { margin: 4px 0 0; color: var(--muted); font-size: 11.5px; line-height: 1.65; }
.divider { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

.kv { display: flex; flex-direction: column; gap: 0; }
.kv-row { display: flex; justify-content: space-between; gap: 18px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 12.5px; }
.kv-row:last-child { border-bottom: 0; }
.kv-row > span { color: var(--muted); flex: 0 0 auto; }
.kv-row > strong { font-weight: 600; text-align: right; overflow-wrap: anywhere; }

/* setup (legacy two-column styles removed; the form now uses uikit) ---------- */
.section-title { display: flex; align-items: baseline; gap: 10px; margin-bottom: 15px; }
.section-title .no { font: 700 10px/1 var(--mono); color: var(--stamp); letter-spacing: .08em; }
.section-title h3 { margin: 0; font-size: 13.5px; font-weight: 700; }
.section-title p { margin: 0 0 0 auto; color: var(--muted); font-size: 11px; }

/* progress ---------------------------------------------------------------- */
.page-progress .topbar { display: none; }
.progress-wrap { max-width: 920px; margin: 0 auto; padding: 46px 26px 80px; }
.progress-brand { margin-bottom: 28px; }
.progress-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; }
.progress-head { padding: 28px 30px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.progress-head h1 { margin: 5px 0 6px; font: 700 28px/1.15 var(--serif); }
.progress-head p { margin: 0; color: var(--muted); font-size: 12px; }
.progress-body { display: grid; grid-template-columns: minmax(0, .88fr) minmax(0, 1.12fr); gap: 0; }
.timeline { padding: 24px 26px; border-right: 1px solid var(--line); }
.step { display: grid; grid-template-columns: 26px 1fr; gap: 12px; padding: 11px 0; position: relative; }
.step:not(:last-child)::before { content: ""; position: absolute; left: 12px; top: 38px; bottom: -10px; width: 1px; background: var(--line); }
.step-dot { width: 25px; height: 25px; border-radius: 50%; border: 1px solid var(--line-strong); display: grid; place-items: center; font: 700 10px/1 var(--mono); color: var(--muted); background: var(--surface); z-index: 1; }
.step-running .step-dot { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); animation: pulse 1.6s ease-in-out infinite; }
.step-done .step-dot { border-color: var(--brand); background: var(--brand); color: #fff; }
.step-error .step-dot { border-color: var(--danger); background: var(--danger); color: #fff; }
.step-title { font-size: 12.5px; font-weight: 700; padding-top: 3px; }
.step-detail { font-size: 11px; color: var(--muted); line-height: 1.6; margin-top: 2px; }
.step-error .step-detail { color: var(--danger); }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(20, 84, 62, .18); } 50% { box-shadow: 0 0 0 6px rgba(20, 84, 62, 0); } }
.console-wrap { background: #14201a; color: #d7e2d9; padding: 24px 26px; min-height: 320px; display: flex; flex-direction: column; }
.console-head { display: flex; align-items: center; justify-content: space-between; color: #8fa497; font: 700 9.5px/1 var(--sans); letter-spacing: .18em; text-transform: uppercase; margin-bottom: 14px; }
.console { font: 11.5px/1.75 var(--mono); white-space: pre-wrap; word-break: break-word; overflow-y: auto; max-height: 380px; flex: 1; }
.console-line { color: #c6d4c8; }
.console-line.err { color: #f0a08c; }
.progress-foot { border-top: 1px solid var(--line); padding: 18px 30px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; background: var(--surface-2); }
.progress-foot .muted { font-size: 11.5px; }
.success-box { text-align: center; padding: 34px 22px; }
.success-mark { width: 58px; height: 58px; margin: 0 auto 16px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-size: 26px; }
.success-box h2 { margin: 0 0 6px; font: 700 23px/1.2 var(--serif); }
.success-box p { margin: 0 0 20px; color: var(--muted); font-size: 12px; }

/* login ------------------------------------------------------------------- */
.page-login { min-height: 100vh; display: grid; place-items: center; padding: 30px; background-image:
  radial-gradient(900px 600px at 12% 8%, #dfece1 0, transparent 55%),
  radial-gradient(760px 500px at 92% 8%, #f5e3d8 0, transparent 48%); }
.login-shell { width: min(880px, 100%); display: grid; grid-template-columns: 1.02fr .98fr; border-radius: 20px; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 30px 80px rgba(30, 40, 30, .12); background: var(--surface); }
.login-aside { background: var(--brand); color: #f4f0e4; padding: 42px 38px; display: flex; flex-direction: column; justify-content: space-between; min-height: 480px; position: relative; overflow: hidden; }
.login-aside::after { content: ""; position: absolute; width: 260px; height: 260px; border: 1px dashed rgba(246,241,228,.28); border-radius: 50%; right: -100px; bottom: -110px; }
.login-aside h1 { font: 700 34px/1.2 var(--serif); letter-spacing: -.03em; margin: 30px 0 12px; }
.login-aside p { color: rgba(244,240,228,.72); font-size: 12.5px; line-height: 1.85; margin: 0; max-width: 21em; }
.login-aside .login-note { font-size: 10.5px; color: rgba(244,240,228,.5); letter-spacing: .06em; margin-top: 24px; }
.login-form { padding: 44px 38px; display: flex; flex-direction: column; justify-content: center; }
.login-form h2 { margin: 0 0 5px; font: 700 25px/1.2 var(--serif); }
.login-form .sub { margin: 0 0 24px; color: var(--muted); font-size: 12px; }
.login-form .btn { margin-top: 8px; height: 44px; }
.login-foot { margin-top: 18px; font-size: 11px; color: var(--muted); }

/* admin ------------------------------------------------------------------- */
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.span-2 { grid-column: span 2; }
.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.stat { border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); padding: 14px 16px; }
.stat .num { font: 700 25px/1.1 var(--serif); }
.stat .lbl { font-size: 11px; color: var(--muted); margin-top: 4px; }
.service-list { display: flex; flex-direction: column; gap: 0; }
.service-row { display: flex; align-items: center; gap: 11px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 12.5px; }
.service-row:last-child { border-bottom: 0; }
.service-row .addr { margin-left: auto; color: var(--muted); font-family: var(--mono); font-size: 10.5px; }
.service-row .detail { color: var(--danger); font-size: 10.5px; width: 100%; padding-left: 19px; }
.table-wrap { border: 1px solid var(--line); border-radius: 11px; overflow: auto; background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: 12px; min-width: 560px; }
.table th { text-align: left; font-size: 10.5px; letter-spacing: .04em; color: var(--muted); background: var(--surface-2); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: #fbf8f0; }
.table .right { text-align: right; }
.table .actions-cell { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.inline-form { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.input-compact { min-height: 32px; height: 32px; padding: 4px 9px; font-size: 12px; }
.dns-name { font-family: var(--mono); font-size: 10.5px; color: var(--ink-2); word-break: break-all; }
.dns-val { font-family: var(--mono); font-size: 10.5px; color: var(--muted); word-break: break-all; max-width: 320px; }
.empty { padding: 34px 20px; text-align: center; color: var(--muted); font-size: 12px; border: 1px dashed var(--line-strong); border-radius: 12px; background: var(--surface); }

/* mail -------------------------------------------------------------------- */
.mail-shell { padding: 24px 26px 60px; display: grid; grid-template-columns: 214px minmax(0, 1fr); gap: 20px; align-items: start; }
.mail-sidebar { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; position: sticky; top: 90px; }
.compose-btn { width: 100%; height: 42px; margin-bottom: 12px; }
.folder-list { display: flex; flex-direction: column; gap: 2px; }
.folder { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 8px; color: var(--ink-2); font-size: 12.5px; font-weight: 600; text-decoration: none; }
.folder:hover { background: var(--surface-2); text-decoration: none; }
.folder-active { background: var(--brand-soft); color: var(--brand-ink); }
.folder .count { margin-left: auto; font-size: 10.5px; font-weight: 700; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 1px 7px; }
.folder-active .count { background: rgba(20,84,62,.12); color: var(--brand); }
.sidebar-foot { border-top: 1px solid var(--line); margin-top: 12px; padding: 12px 10px 4px; font-size: 10.5px; color: var(--muted); line-height: 1.7; }
.mail-main { min-width: 0; }
.mail-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.mail-toolbar h1 { margin: 0; font: 700 25px/1.2 var(--serif); }
.mail-toolbar .sub { color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.mail-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.mail-row { display: grid; grid-template-columns: 190px minmax(0, 1fr) 92px; gap: 14px; align-items: center; padding: 13px 18px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.mail-row:last-child { border-bottom: 0; }
.mail-row:hover { background: #fbf8f1; text-decoration: none; }
.mail-row.unread { background: #fcfaf3; }
.mail-row.unread .mail-from, .mail-row.unread .mail-subject { font-weight: 750; color: var(--ink); }
.mail-from { display: flex; align-items: center; gap: 9px; min-width: 0; font-size: 12.5px; color: var(--ink-2); }
.mail-from span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unread-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--stamp); flex: 0 0 auto; }
.mail-subject { min-width: 0; font-size: 12.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-subject .clip { color: var(--muted); font-size: 10.5px; margin-left: 6px; }
.mail-date { text-align: right; font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.message-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.message-head { padding: 22px 26px 18px; border-bottom: 1px solid var(--line); }
.message-head h1 { margin: 0 0 14px; font: 700 24px/1.3 var(--serif); letter-spacing: -.02em; }
.message-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 12px; color: var(--muted); }
.message-meta strong { color: var(--ink-2); font-weight: 600; }
.message-actions { display: flex; align-items: center; gap: 8px; padding: 11px 26px; border-bottom: 1px solid var(--line); background: var(--surface-2); flex-wrap: wrap; }
.message-body { padding: 24px 26px; }
.mail-frame { width: 100%; min-height: 460px; height: 62vh; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.mail-text { white-space: pre-wrap; word-break: break-word; font: 13.5px/1.8 var(--sans); color: var(--ink); margin: 0; }
.attachments { margin-top: 20px; border-top: 1px dashed var(--line); padding-top: 16px; }
.attachments h3 { margin: 0 0 10px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.attachment-list { display: flex; flex-wrap: wrap; gap: 8px; }
.attachment { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface-2); border-radius: 8px; padding: 8px 11px; font-size: 11.5px; color: var(--ink-2); text-decoration: none; }
.attachment:hover { border-color: var(--line-strong); text-decoration: none; }
.compose-card .textarea { min-height: 260px; }
.compose-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.back-link { font-size: 11.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; margin-bottom: 12px; }
.back-link:hover { color: var(--brand); }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--stamp); color: #fff; font-size: 10px; font-weight: 700; }

/* error ------------------------------------------------------------------- */
.page-error .content { min-height: 60vh; display: grid; place-items: center; }
.error-card { max-width: 520px; width: 100%; text-align: center; }
.error-card h1 { font: 700 28px/1.2 var(--serif); margin: 8px 0 8px; }
.error-card p { color: var(--muted); font-size: 12.5px; }

/* footer ------------------------------------------------------------------ */
.foot { border-top: 1px solid var(--line); margin-top: 30px; padding-top: 18px; display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 10.5px; flex-wrap: wrap; }

@media (max-width: 960px) {
  .setup-shell { grid-template-columns: 1fr; gap: 30px; }
  .setup-hero { position: static; }
  .hero-stamp { margin: 22px 0; width: 96px; height: 96px; }
  .hero-stamp span { font-size: 38px; }
  .progress-body { grid-template-columns: 1fr; }
  .timeline { border-right: 0; border-bottom: 1px solid var(--line); }
  .console-wrap { min-height: 240px; }
  .admin-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .login-shell { grid-template-columns: 1fr; }
  .login-aside { min-height: auto; padding: 30px; }
  .login-aside h1 { font-size: 27px; margin: 18px 0 8px; }
  .login-form { padding: 30px; }
}
@media (max-width: 760px) {
  .topbar-inner { height: auto; padding: 12px 18px; flex-wrap: wrap; gap: 10px; }
  .nav { width: 100%; margin-left: 0; }
  .content { padding: 22px 16px 50px; }
  .setup-shell { padding: 22px 16px 50px; }
  .setup-card { padding: 22px 18px 26px; }
  .port-grid, .grid-2, .grid-3, .compose-grid { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 27px; }
  .mail-shell { grid-template-columns: 1fr; padding: 16px; }
  .mail-sidebar { position: static; }
  .folder-list { flex-direction: row; overflow-x: auto; }
  .folder { white-space: nowrap; }
  .mail-row { grid-template-columns: minmax(0, 1fr) 78px; gap: 8px 12px; }
  .mail-from { grid-column: 1; }
  .mail-subject { grid-column: 1; }
  .mail-date { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .message-head, .message-body, .message-actions { padding-left: 16px; padding-right: 16px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .progress-wrap { padding: 24px 14px 50px; }
  .progress-head { padding: 20px 18px; }
  .timeline { padding: 18px; }
  .console-wrap { padding: 18px; }
}

[hidden] { display: none !important; }

/* ---------------------------------------------------------------------------
   趣渡安全邮箱 · 官网与单列安装页（按 ../iqudoo-work uikit 规范）
   --------------------------------------------------------------------------- */

.page-home {
  background: var(--ui-bg);
  background-image:
    radial-gradient(980px 620px at 8% -10%, #e5efe8 0, transparent 58%),
    radial-gradient(820px 560px at 102% 0%, #f6e8df 0, transparent 50%);
  background-attachment: fixed;
  color: var(--ui-ink);
  font-family: var(--ui-font);
}
.home-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--ui-line);
  background: rgba(246, 244, 238, .82);
  backdrop-filter: blur(14px);
}
.home-nav-inner {
  max-width: 1180px;
  margin: 0 auto;
  min-height: 74px;
  padding: 0 26px;
  display: flex;
  align-items: center;
  gap: 30px;
}
.home-nav-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.home-link-strong { padding: 8px 10px; font-size: 12.5px; font-weight: 650; color: var(--ui-ink-2); text-decoration: none; }
.home-link-strong:hover { color: var(--ui-brand); }
.home-nav form { margin: 0; }

.home-main { max-width: 1180px; margin: 0 auto; padding: 0 26px; }
.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, .94fr);
  gap: 46px;
  align-items: center;
  padding: 74px 0 78px;
  min-width: 0;
}
.home-copy { min-width: 0; }
.home-kicker { display: flex; align-items: center; gap: 12px; color: var(--ui-muted); font-size: 10.5px; font-weight: 700; letter-spacing: .14em; }
.home-copy h1 {
  margin: 20px 0 20px;
  font-family: var(--ui-font);
  font-size: clamp(40px, 5vw, 62px);
  line-height: 1.08;
  letter-spacing: -.055em;
  font-weight: 760;
}
.home-copy h1 em { font-style: normal; color: var(--ui-brand); }
.home-lede { max-width: 34em; margin: 0; color: var(--ui-ink-2); font-size: 14px; line-height: 1.9; }
.home-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 28px; }
.home-btn-lg { height: 44px; padding: 0 20px; font-size: 13px; }
.home-trust { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 20px; }
.home-trust span { display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; border: 1px solid var(--ui-line); border-radius: 999px; background: rgba(255,255,255,.55); color: var(--ui-ink-2); font-size: 11px; font-weight: 600; }
.home-trust span::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ui-brand); }
.home-status { display: flex; align-items: center; gap: 8px; margin-top: 18px; color: var(--ui-muted); font-size: 11.5px; }
.home-alert { margin: 16px 0 0; max-width: 36em; }
.home-alert a { color: inherit; font-weight: 700; margin-left: 8px; text-decoration: underline; text-underline-offset: 3px; }

.home-art { position: relative; min-height: 430px; display: grid; place-items: center; min-width: 0; }
.mail-glow { position: absolute; width: 360px; height: 360px; border-radius: 50%; background: radial-gradient(circle, rgba(20,92,67,.16) 0, rgba(20,92,67,0) 67%); filter: blur(4px); }
.mail-card { position: absolute; background: var(--ui-surface); border: 1px solid var(--ui-line); border-radius: 18px; box-shadow: 0 24px 60px rgba(23,33,28,.13); }
.mail-card-b { width: 300px; height: 330px; transform: translate(30px, 24px) rotate(7deg); background: #efeade; }
.mail-card-c { width: 300px; height: 330px; transform: translate(-26px, 12px) rotate(-6deg); background: #f3eee4; }
.mail-card-a { width: min(348px, 88%); padding: 22px 22px 20px; transform: rotate(-2deg); }
.mail-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.mail-card-kicker { font-size: 10px; letter-spacing: .22em; font-weight: 750; color: var(--ui-muted); }
.mail-stamp { width: 42px; height: 42px; display: grid; place-items: center; border: 2px dashed var(--ui-danger); border-radius: 8px; color: var(--ui-danger); font: 700 16px/1 var(--ui-font); transform: rotate(6deg); opacity: .9; }
.mail-item { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--ui-line); }
.mail-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--ui-brand-soft); color: var(--ui-brand); display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.mail-avatar-2 { background: #f5e7df; color: var(--ui-danger); }
.mail-avatar-3 { background: var(--ui-surface-2); color: var(--ui-muted); }
.mail-lines { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.mail-lines b, .mail-lines i { display: block; height: 6px; border-radius: 999px; background: var(--ui-line); }
.mail-lines b { width: 52%; background: var(--ui-line-strong); }
.mail-lines i { width: 82%; }
.mail-time { font-size: 9.5px; color: var(--ui-muted); white-space: nowrap; }
.mail-card-foot { display: flex; gap: 6px; flex-wrap: wrap; padding-top: 16px; }
.mail-float { position: absolute; padding: 7px 11px; border-radius: 999px; border: 1px solid var(--ui-line); background: rgba(255,255,255,.88); box-shadow: 0 10px 24px rgba(23,33,28,.08); font: 650 10px/1 var(--ui-mono); color: var(--ui-ink-2); backdrop-filter: blur(6px); }
.mail-float-a { top: 34px; left: 4%; transform: rotate(-4deg); }
.mail-float-b { bottom: 40px; right: 3%; transform: rotate(4deg); }

.home-section { padding: 66px 0; border-top: 1px solid var(--ui-line); min-width: 0; }
.home-section-head { max-width: 580px; margin-bottom: 28px; }
.home-section-head h2 { margin: 7px 0 9px; font-size: 32px; line-height: 1.16; letter-spacing: -.035em; }
.home-section-head p { margin: 0; color: var(--ui-muted); font-size: 13px; line-height: 1.8; }
.home-security-panel { position: relative; overflow: hidden; padding: 36px; border-radius: 22px; background: #0E2E24; color: #F4EFE3; }
.home-security-panel::after { content: ""; position: absolute; width: 460px; height: 460px; right: -180px; top: -260px; border-radius: 50%; background: radial-gradient(circle, rgba(154,211,182,.2), transparent 68%); pointer-events: none; }
.home-security-head { position: relative; z-index: 1; max-width: 620px; }
.home-security-head .eyebrow { color: #9AD3B6; }
.home-security-head h2 { margin: 8px 0 10px; color: #F4EFE3; font-size: 32px; line-height: 1.16; letter-spacing: -.035em; }
.home-security-head p { margin: 0; color: rgba(244,239,227,.66); font-size: 13px; line-height: 1.8; }
.home-module { display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr); gap: 48px; align-items: center; }
.home-module-reverse .home-module-copy { order: 2; }
.home-module-reverse .home-module-visual { order: 1; }
.home-module-copy h2 { margin: 8px 0 14px; font-size: 38px; line-height: 1.18; letter-spacing: -.035em; }
.home-module-copy p { max-width: 520px; margin: 0; color: var(--ui-muted); font-size: 13px; line-height: 1.8; }
.home-module-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.home-module-visual { min-width: 0; }
.home-module-card { padding: 24px; }
.home-module-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; color: var(--ui-muted); font-size: 11px; }
.home-flow { display: flex; align-items: stretch; gap: 8px; margin: 0 0 16px; }
.home-flow-node { flex: 1; min-width: 0; padding: 14px 10px; border: 1px solid var(--ui-line); border-radius: 12px; background: var(--ui-surface-2); color: var(--ui-ink-2); font-size: 12px; font-weight: 600; text-align: center; }
.home-flow-arrow { display: flex; align-items: center; color: var(--ui-muted); font-size: 14px; }
.home-module-meta { margin-top: 10px; color: var(--ui-muted); font-size: 11px; }
.home-e2e-domains { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 8px 0 18px; }
.home-e2e-domain { padding: 12px 18px; border: 1px solid var(--ui-line); border-radius: 12px; background: var(--ui-surface-2); font-size: 13px; font-weight: 650; }
.home-e2e-link { color: var(--ui-brand); font-size: 20px; }
.home-module-steps { display: flex; flex-direction: column; gap: 8px; }
.home-module-step { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--ui-line); border-radius: 10px; color: var(--ui-ink-2); font-size: 12px; }
.home-module-step b { color: var(--ui-brand); font: 700 10px/1 var(--ui-mono); letter-spacing: .08em; }

.home-detail-list { display: flex; flex-direction: column; gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; }

.home-detail-list li { position: relative; padding-left: 20px; color: var(--ui-ink-2); font-size: 12px; line-height: 1.65; }

.home-detail-list li::before { content: ""; position: absolute; left: 2px; top: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--ui-brand); box-shadow: 0 0 0 3px var(--ui-brand-soft); }

.home-detail-code { margin-top: 18px; padding: 10px 12px; border: 1px solid var(--ui-line); border-radius: 10px; background: var(--ui-surface-2); color: var(--ui-muted); font: 10.5px/1.6 var(--ui-mono); overflow-wrap: anywhere; }


.home-security-grid { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 28px; }
.home-security-item { padding: 18px; border: 1px solid rgba(244,239,227,.14); border-radius: 14px; background: rgba(255,255,255,.035); }
.home-security-no { display: inline-block; color: #9AD3B6; font: 700 10px/1 var(--ui-mono); letter-spacing: .1em; }
.home-security-item h3 { margin: 10px 0 6px; color: #F4EFE3; font-size: 13.5px; }
.home-security-item p { margin: 0; color: rgba(244,239,227,.62); font-size: 11.5px; line-height: 1.75; }
.home-feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.home-feature { padding: 20px; min-width: 0; }
.home-feature h3 { margin: 13px 0 5px; font-size: 13.5px; }
.home-feature p { margin: 0; color: var(--ui-muted); font-size: 11.5px; line-height: 1.75; }
.home-icon { width: 36px; height: 36px; border-radius: 10px; background: var(--ui-brand-soft); color: var(--ui-brand); display: grid; place-items: center; }
.home-icon svg { width: 19px; height: 19px; }
.home-step-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.home-step { padding: 22px; }
.home-step-no { font: 700 11px/1 var(--ui-mono); color: var(--ui-danger); letter-spacing: .08em; }
.home-step h3 { margin: 14px 0 6px; font-size: 15px; }
.home-step p { margin: 0; color: var(--ui-muted); font-size: 12px; line-height: 1.8; }
.home-code { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--ui-line); font: 10px/1.6 var(--ui-mono); color: var(--ui-muted); overflow-wrap: anywhere; }
.home-band { margin-top: 22px; background: var(--ui-brand); color: #f6f1e4; border-radius: 20px; padding: 34px 36px; display: grid; grid-template-columns: 1.1fr .9fr; gap: 36px; align-items: center; }
.home-band .eyebrow { color: rgba(246,241,228,.58); }
.home-band h2 { margin: 7px 0 8px; font-size: 30px; letter-spacing: -.035em; }
.home-band-copy p { margin: 0; color: rgba(246,241,228,.72); font-size: 12.5px; line-height: 1.8; }
.home-cta-light { margin-top: 20px; }
.home-btn-light { background: #f6f1e4; border-color: #f6f1e4; color: var(--ui-brand); }
.home-btn-light:hover { background: #fffdf7; border-color: #fffdf7; color: var(--ui-brand); }
.home-band-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 13px; }
.home-band-list li { position: relative; padding-left: 24px; font-size: 12px; line-height: 1.7; color: rgba(246,241,228,.82); }
.home-band-list li::before { content: ""; position: absolute; left: 2px; top: 6px; width: 7px; height: 7px; border-radius: 50%; background: #a9d9bd; box-shadow: 0 0 0 4px rgba(169,217,189,.12); }

.home-clients { padding: 24px; }
.home-clients .ui-alert { margin-bottom: 16px; }
.home-clients .ui-table { min-width: 620px; }
.home-clients .ui-table td { font-size: 12px; }
.home-clients-note { margin: 16px 0 0; color: var(--ui-muted); font-size: 11.5px; line-height: 1.7; }

.home-footer { border-top: 1px solid var(--ui-line); margin-top: 20px; }
.home-footer-inner { max-width: 1180px; margin: 0 auto; padding: 34px 26px 20px; display: flex; justify-content: space-between; gap: 30px; }
.home-footer-brand p { margin: 12px 0 0; max-width: 28em; color: var(--ui-muted); font-size: 11.5px; line-height: 1.8; }
.home-footer-links { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; padding-top: 6px; }
.home-footer-links a { color: var(--ui-muted); font-size: 11.5px; text-decoration: none; }
.home-footer-links a:hover { color: var(--ui-ink); }
.home-footer-meta { max-width: 1180px; margin: 0 auto; padding: 0 26px 28px; display: flex; justify-content: space-between; gap: 12px; color: var(--ui-muted); font-size: 10.5px; }

/* 单列安装页 */
.site-mini { border-bottom: 1px solid var(--ui-line); background: rgba(246,244,238,.72); backdrop-filter: blur(12px); }
.site-mini .home-nav-inner { min-height: 68px; }
.setup-page { max-width: 760px; margin: 0 auto; padding: 42px 24px 84px; }
.setup-intro { margin-bottom: 22px; }
.setup-intro h1 { margin: 12px 0 8px; font-size: 36px; line-height: 1.12; letter-spacing: -.045em; }
.setup-intro p { margin: 0; color: var(--ui-muted); font-size: 13px; line-height: 1.8; }
.setup-alert { margin-bottom: 16px; }
.setup-single { display: flex; flex-direction: column; gap: 16px; }
.setup-section .ui-card-head { margin-bottom: 18px; }
.setup-section .ui-field:last-child { margin-bottom: 0; }
.setup-section .ui-check { margin-top: 4px; }
.page-home .home-btn-light { color: var(--ui-brand); }
.page-home .home-btn-light:hover { color: var(--ui-brand); }
.setup-advanced { padding: 18px 20px; }
.setup-advanced summary { cursor: pointer; font-size: 12.5px; font-weight: 650; color: var(--ui-ink-2); }
.setup-advanced summary::marker { color: var(--ui-muted); }
.setup-advanced[open] summary { margin-bottom: 16px; }
.setup-advanced .ui-field:last-of-type { margin-bottom: 14px; }
.setup-actions { margin-top: 4px; text-align: center; }
.setup-actions .ui-hint { margin-top: 10px; }
.page-setup { background: var(--ui-bg); background-image:
  radial-gradient(900px 560px at 10% -8%, #e5efe8 0, transparent 58%),
  radial-gradient(760px 480px at 100% 0%, #f6e8df 0, transparent 48%);
  color: var(--ui-ink); font-family: var(--ui-font);
}
.setup-page .ui-card { box-shadow: 0 1px 2px rgba(23,33,28,.04); }

@media (max-width: 960px) {
  .home-hero { grid-template-columns: 1fr; gap: 30px; padding: 44px 0 54px; }
  .home-art { min-height: 340px; }
  .home-feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-security-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-security-panel { padding: 28px; }
  .home-module { grid-template-columns: 1fr; gap: 26px; }
  .home-module-reverse .home-module-copy,
  .home-module-reverse .home-module-visual { order: initial; }
  .home-module-copy h2 { font-size: 30px; }
  .home-step-grid { grid-template-columns: 1fr; }
  .home-band { grid-template-columns: 1fr; gap: 24px; padding: 28px 24px; }
  .home-footer-inner { flex-direction: column; gap: 18px; }
}
@media (max-width: 760px) {
  .home-nav-inner { padding: 12px 16px; flex-wrap: wrap; gap: 10px; min-height: 0; }
  .home-nav-actions { margin-left: auto; }
  .home-main { padding: 0 16px; }
  .home-copy h1 { font-size: 41px; }
  .home-lede { font-size: 13px; }
  .home-feature-grid { grid-template-columns: 1fr; }
  .home-security-grid { grid-template-columns: 1fr; }
  .home-security-panel { padding: 24px 20px; border-radius: 16px; }
  .home-security-head h2 { font-size: 26px; }
  .home-module-card { padding: 20px; }
  .home-module-copy h2 { font-size: 26px; }
  .home-flow { flex-direction: column; }
  .home-flow-arrow { justify-content: center; }
  .home-e2e-domains { gap: 10px; }
  .home-section { padding: 46px 0; }
  .home-section-head h2 { font-size: 26px; }
  .home-footer-inner, .home-footer-meta { padding-left: 16px; padding-right: 16px; }
  .home-footer-meta { flex-direction: column; gap: 6px; }
  .mail-float-a { left: 0; }
  .mail-float-b { right: 0; }
  .setup-page { padding: 28px 16px 60px; }
  .setup-intro h1 { font-size: 30px; }
  .setup-advanced { padding: 16px; }
}

/* Keep uikit buttons and marketing navigation free of the global link underline. */
.ui-btn:hover, .btn:hover, .home-footer-links a:hover, .home-link-strong:hover { text-decoration: none; }

/* Immediate feedback for full-page navigations. */
.g-nav-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  z-index: 4000;
  transition: opacity .12s ease;
}
.g-nav-progress.is-active { opacity: 1; }
.g-nav-progress::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 38%;
  background: linear-gradient(90deg, transparent, var(--ui-brand), #7FC9A8);
  animation: g-nav-progress 1s ease-in-out infinite;
}
@keyframes g-nav-progress {
  from { transform: translateX(-100%); }
  to { transform: translateX(320%); }
}
@media (prefers-reduced-motion: reduce) {
  .g-nav-progress::before { animation: none; width: 100%; }
}

/* ---------------------------------------------------------------------------
   登录页 / 管理后台（参考 iqudoo-id-account 的 uikit 结构）
   --------------------------------------------------------------------------- */

.page-auth {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  background: #f1f4f1;
  color: var(--ui-ink);
  font-family: var(--ui-font);
}
.auth-shell { width: 100%; max-width: 448px; }
.auth-card { padding: 40px; border: 1px solid #dadce0; border-radius: 28px; background: #fff; box-shadow: none; }
.auth-card .brand { margin-bottom: 26px; }
.auth-card h1, .auth-title { margin: 0 0 8px; font-size: 24px; line-height: 1.3; font-weight: 400; letter-spacing: -.01em; }
.auth-sub { margin: 0 0 24px; color: var(--ui-muted); font-size: 13.5px; line-height: 1.65; }
.auth-submit { margin-top: 4px; min-height: 44px; border-radius: 4px; }
.auth-code { font-family: var(--ui-mono); font-size: 18px; letter-spacing: .18em; text-align: center; }
.auth-actions { display: flex; justify-content: flex-end; margin-top: 20px; }
.auth-submit-btn { min-width: 88px; min-height: 40px; border-radius: 4px; }
.auth-account {
  display: flex; align-items: center; gap: 10px; width: 100%;
  margin: 2px 0 20px; padding: 8px 0 10px;
  border: 0; border-bottom: 1px solid var(--ui-line); background: none;
  color: inherit; text-align: left; cursor: pointer;
}
.auth-account-dot {
  display: grid; place-items: center; width: 28px; height: 28px;
  flex: 0 0 auto; border-radius: 50%; background: var(--ui-brand-soft);
  color: var(--ui-brand); font-size: 12px; font-weight: 700;
}
.auth-account-copy { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 1px; }
.auth-account-copy strong { overflow: hidden; color: var(--ui-ink); font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.auth-account-copy span { color: var(--ui-muted); font-size: 11px; }
.auth-account-change { color: var(--ui-brand); font-size: 11.5px; font-weight: 650; }
.auth-links { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 24px; font-size: 12px; }
.auth-links a { color: var(--ui-muted); text-decoration: none; }
.auth-links a:hover { color: var(--ui-brand); text-decoration: none; }
.auth-foot { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 18px; color: var(--ui-muted); font-size: 11px; }
.consent-app { margin-bottom: 18px; }
.consent-app-icon { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 16px; border-radius: 12px; background: var(--ui-brand-soft); color: var(--ui-brand); }
.consent-app-icon svg { width: 22px; height: 22px; }
.consent-app .eyebrow { margin-bottom: 6px; }
.consent-app .auth-sub { margin-bottom: 0; }
.consent-account { cursor: default; margin: 18px 0; }
.consent-scopes { margin: 4px 0 18px; }
.consent-scopes h2 { margin: 0 0 10px; font-size: 13px; font-weight: 650; }
.consent-scopes ul { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.consent-scopes li { display: flex; gap: 10px; align-items: flex-start; color: var(--ui-ink-2); font-size: 12px; line-height: 1.6; }
.consent-check { display: grid; place-items: center; width: 20px; height: 20px; flex: 0 0 auto; border-radius: 50%; background: var(--ui-brand-soft); color: var(--ui-brand); }
.consent-check svg { width: 12px; height: 12px; }
.consent-scopes li > div { display: flex; flex-direction: column; gap: 1px; }
.consent-scopes li strong { font-weight: 600; }
.consent-scopes li span { color: var(--ui-muted); font-size: 11.5px; }
.oauth-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.oauth-actions .ui-btn { min-width: 80px; }
.auth-legal { margin: 18px 0 0; color: var(--ui-muted); font-size: 11px; line-height: 1.6; }
@media (max-width: 520px) {
  .page-auth { padding: 0; }
  .auth-shell { max-width: none; }
  .auth-card { min-height: 100vh; padding: 28px 24px; border: 0; border-radius: 0; }
  .auth-foot { margin: 0; padding: 14px 0; }
}

.page-admin-console {
  min-height: 100vh;
  background: var(--ui-bg);
  color: var(--ui-ink);
  font-family: var(--ui-font);
}
.adm-top {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--ui-line);
  background: rgba(246,244,238,.9);
  backdrop-filter: blur(12px);
}
.adm-top-inner {
  min-height: 66px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.adm-nav { display: flex; align-items: center; gap: 4px; margin-left: 16px; }
.adm-nav a {
  padding: 8px 13px;
  border-radius: 8px;
  color: var(--ui-muted);
  font-size: 12.5px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}
.adm-nav a:hover { color: var(--ui-ink); background: var(--ui-surface-2); text-decoration: none; }
.adm-nav a.active { color: var(--ui-brand); background: var(--ui-brand-soft); }
.adm-user { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 11.5px; color: var(--ui-muted); }
.adm-user form { margin: 0; }
.adm-user-email { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-shell { padding: 28px 24px 70px; }
.adm-shell > .ui-alert { margin-bottom: 14px; }
.adm-page-head { margin-bottom: 20px; }
.adm-page-head h1 { font-family: var(--ui-font); font-size: 30px; font-weight: 750; letter-spacing: -.035em; }
.adm-page-head .actions form { margin: 0; }

.domain-list {
  background: #fff;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius-lg);
  box-shadow: var(--ui-shadow-sm);
  padding: 2px 22px;
}
.domain-row { padding: 20px 0; }
.domain-row + .domain-row { border-top: 1px solid var(--ui-line); }
.domain-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.domain-name { margin: 0; font-size: 19px; letter-spacing: -.02em; }
.domain-host { margin: 4px 0 0; color: var(--ui-muted); font-size: 11.5px; font-family: var(--ui-mono); }
.domain-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.domain-meta > div { min-width: 0; }
.domain-meta span { display: block; color: var(--ui-muted); font-size: 10.5px; }
.domain-meta strong { display: block; margin-top: 3px; font-size: 12px; font-weight: 650; overflow-wrap: anywhere; }
.domain-meta strong a { color: var(--ui-brand); text-decoration: none; }
.domain-meta strong a:hover { text-decoration: underline; }
.domain-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.domain-actions form { margin: 0; }
.domain-error { margin-bottom: 14px; }
.domain-status-card { margin-bottom: 16px; }
.dns-table { table-layout: fixed; min-width: 760px; }
.domain-dns-value { min-width: 0; width: 100%; }
.dns-value { display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; }
.dns-value-text { display: block; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 10.5px/1.6 var(--ui-mono); color: var(--ui-muted); }
.dns-value-more { display: none; flex: 0 0 auto; min-height: 26px; padding: 0 8px; }
.dns-value.is-truncated .dns-value-more { display: inline-flex; }
.ui-modal.dns-value-modal { width: min(720px, 100%); }
.dns-value-full { margin: 0 0 16px; max-height: 50vh; overflow: auto; padding: 12px; border: 1px solid var(--ui-line); border-radius: var(--ui-radius-md); background: var(--ui-surface-2); color: var(--ui-ink-2); font: 11.5px/1.7 var(--ui-mono); white-space: pre-wrap; word-break: break-all; }

.adm-section { margin-top: 26px; }
.adm-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 12px; flex-wrap: wrap; }
.adm-section-head h2 { margin: 0 0 3px; font-size: 18px; letter-spacing: -.02em; }
.adm-section-head p { margin: 0; color: var(--ui-muted); font-size: 11.5px; }
.adm-filter { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.adm-filter .ui-select-wrap { width: 190px; }
.adm-filter .ui-select-trigger { min-height: 36px; }
.adm-filter-search { width: 220px; min-height: 36px; }
.adm-list-module {
  background: #fff;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius-lg);
  box-shadow: var(--ui-shadow-sm);
  overflow: hidden;
}

.e2e-steps { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--ui-line); }
.e2e-steps li { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--ui-line); }
.e2e-steps li:last-child { border-bottom: 0; }
.e2e-step-no { font: 700 11px/1 var(--ui-mono); color: var(--ui-brand); letter-spacing: .08em; }
.e2e-step-copy h3 { margin: 0 0 3px; font-size: 13px; font-weight: 650; }
.e2e-step-copy p { margin: 0; color: var(--ui-muted); font-size: 11.5px; line-height: 1.65; }
.e2e-steps .ui-btn { flex: 0 0 auto; }
.e2e-boundary { margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: var(--ui-surface-2); color: var(--ui-muted); font-size: 11.5px; line-height: 1.7; }
.e2e-boundary strong { color: var(--ui-ink-2); }
@media (max-width: 640px) {
  .e2e-steps li { grid-template-columns: 26px minmax(0, 1fr); align-items: start; }
  .e2e-steps li .ui-btn { grid-column: 2; justify-self: start; }
}

.adm-overview-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.adm-stat { padding: 18px 20px; }
.adm-stat-label { display: block; color: var(--ui-muted); font-size: 11.5px; font-weight: 600; }
.adm-stat-value { display: block; margin-top: 8px; color: var(--ui-ink); font: 750 28px/1.1 var(--ui-font); letter-spacing: -.03em; }
.adm-stat-note { display: block; margin-top: 6px; color: var(--ui-muted); font-size: 11px; }
.adm-overview-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: 14px; margin-top: 14px; align-items: stretch; }
.adm-overview-side { display: flex; flex-direction: column; gap: 14px; height: 100%; }
.adm-overview-side > .ui-card { flex: 1 1 0; }
.adm-service-list { display: flex; flex-direction: column; }
.adm-service-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--ui-line); }
.adm-service-row:last-child { border-bottom: 0; }
.adm-service-copy { flex: 1; min-width: 0; }
.adm-service-copy strong { display: block; font-size: 12.5px; }
.adm-service-copy span { display: block; margin-top: 2px; color: var(--ui-muted); font: 10.5px/1.5 var(--ui-mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-metric-list { display: flex; flex-direction: column; gap: 9px; }
.adm-metric-list > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; color: var(--ui-muted); font-size: 12px; }
.adm-metric-list strong { color: var(--ui-ink); font-size: 13px; font-weight: 650; text-align: right; }
.adm-metric-list small { color: var(--ui-muted); font-size: 10.5px; font-weight: 500; }
@media (max-width: 1100px) {
  .adm-overview-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .adm-overview-grid { grid-template-columns: 1fr; }
  .adm-overview-side { height: auto; }
}
@media (max-width: 640px) {
  .adm-overview-stats { grid-template-columns: 1fr; }
}

.adm-form-single { display: flex; flex-direction: column; gap: 14px; width: 100%; }
.adm-form-single.ui-card { padding: 22px; }
.adm-form-single .ui-field:last-child { margin-bottom: 0; }
.adm-form-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.adm-form-actions .ui-btn { min-height: 40px; }
.admin-meta-card { margin-bottom: 16px; }

.security-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.security-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.admin-name-line { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.admin-name-line a { color: var(--ui-brand); font-weight: 650; text-decoration: none; }
.admin-name-sub { color: var(--ui-muted); font-size: 10.5px; }
.row-actions { display: flex; align-items: center; justify-content: flex-start; gap: 10px; flex-wrap: wrap; }
.row-actions form { margin: 0; }
.row-actions a { color: var(--ui-brand); font-size: 11.5px; font-weight: 650; text-decoration: none; }
.row-actions button { border: 0; background: none; padding: 0; color: var(--ui-danger); font: inherit; font-size: 11.5px; font-weight: 650; cursor: pointer; }

.admin-mfa-setup { width: 100%; }
.mfa-setup-grid { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 34px; align-items: start; }
.mfa-setup-grid h2 { margin-bottom: 6px; }
.qr-wrap { width: 220px; margin: 16px auto; padding: 10px; border: 1px solid var(--ui-line); border-radius: 14px; background: #fff; }
.qr-wrap svg { display: block; width: 100%; height: auto; }
.admin-mfa-uri { margin-top: 18px; }
.admin-mfa-uri summary { cursor: pointer; color: var(--ui-muted); font-size: 11px; }
.admin-mfa-uri .ui-code { margin-top: 8px; }
.recovery-card { max-width: 660px; }
.recovery-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.recovery-grid .ui-code { text-align: center; font-size: 13.5px; letter-spacing: .06em; background: var(--ui-surface-2); }

@media (max-width: 960px) {
  .domain-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .security-grid { grid-template-columns: 1fr; }
  .mfa-setup-grid { grid-template-columns: 1fr; gap: 20px; }
}
@media (max-width: 760px) {
  .adm-top-inner { flex-wrap: wrap; height: auto; padding: 12px 16px; gap: 8px; }
  .adm-nav { order: 4; width: 100%; margin-left: 0; overflow-x: auto; }
  .adm-user { margin-left: auto; }
  .adm-user-email { display: none; }
  .adm-shell { padding: 18px 16px 50px; }
  .adm-page-head h1 { font-size: 26px; }
  .domain-meta { grid-template-columns: 1fr 1fr; }
  .recovery-grid { grid-template-columns: 1fr; }
}

.ui-empty-rich {
  padding: 34px 18px;
  color: var(--ui-muted);
  font-size: 12px;
  line-height: 1.7;
}
.ui-empty-rich strong { display: block; margin-bottom: 4px; color: var(--ui-ink); font-size: 13.5px; font-weight: 650; }
.ui-empty-rich p { max-width: 520px; margin: 0 auto 14px; }
.ui-empty-rich .ui-empty-icon { margin-bottom: 12px; }

/* ---------------------------------------------------------------------------
   Gmail-style webmail
   --------------------------------------------------------------------------- */
.page-mail {
  --g-bg: #f6f8fc;
  --g-surface: #ffffff;
  --g-ink: #202124;
  --g-muted: #5f6368;
  --g-line: #e8eaed;
  --g-line-strong: #dadce0;
  --g-blue: #0b57d0;
  --g-blue-soft: #d3e3fd;
  --g-hover: #f8fafd;
  background: var(--g-bg);
  background-image: none;
  color: var(--g-ink);
  font-family: "Google Sans", Roboto, -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC", sans-serif;
}
.page-mail .brand { color: var(--g-ink); }
.page-mail .brand-mark { background: var(--g-ink); color: #fff; }

.g-topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 18px;
  height: 64px; padding: 0 16px;
  background: var(--g-surface);
  border-bottom: 1px solid var(--g-line);
}
.g-topbar-left { flex: 0 0 auto; }
.g-topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.g-user-email { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--g-muted); font-size: 12px; }
.g-logout { margin: 0; }
.g-logout-btn {
  height: 32px; padding: 0 13px;
  border: 1px solid var(--g-line-strong); border-radius: 999px;
  background: var(--g-surface); color: var(--g-muted);
  font: 600 12px/1 var(--sans); cursor: pointer;
}
.g-logout-btn:hover { background: #f1f3f4; color: var(--g-ink); }
.g-avatar {
  width: 32px; height: 32px; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; background: #e8f0fe; color: var(--g-blue);
  font-size: 12px; font-weight: 700;
}
.g-icon-btn {
  width: 36px; height: 36px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%; background: transparent; color: var(--g-muted);
  cursor: pointer; text-decoration: none;
}
.g-icon-btn svg { width: 20px; height: 20px; }
.g-icon-btn:hover { background: #f0f2f5; color: var(--g-ink); text-decoration: none; }
.g-icon-btn.active { background: var(--g-blue-soft); color: var(--g-blue); }

.g-search {
  flex: 1 1 auto; max-width: 720px; height: 46px;
  margin: 0 auto; padding: 0 8px 0 16px;
  display: flex; align-items: center; gap: 10px;
  border-radius: 999px; background: #eaf1fb;
  transition: background .15s ease, box-shadow .15s ease;
}
.g-search:focus-within { background: #fff; box-shadow: 0 1px 1px rgba(60,64,67,.3), 0 4px 8px rgba(60,64,67,.15); }
.g-search-icon { width: 20px; height: 20px; flex: 0 0 auto; color: var(--g-muted); }
.g-search-input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--g-ink); font: 14px/1.4 var(--sans); }
.g-search-input::-webkit-search-cancel-button { display: none; }
.g-search-clear { flex: 0 0 auto; padding: 0 8px; color: var(--g-blue); font-size: 12px; font-weight: 600; text-decoration: none; }

.g-shell { display: grid; grid-template-columns: 256px minmax(0, 1fr); align-items: start; min-height: calc(100vh - 64px); }
.g-sidebar {
  position: sticky; top: 64px;
  min-width: 0; max-height: calc(100vh - 64px);
  overflow-y: auto; overscroll-behavior: contain;
  padding: 12px 8px 20px;
  display: flex; flex-direction: column; gap: 12px;
}
.g-compose {
  display: flex; align-items: center; gap: 14px;
  height: 56px; margin: 0 8px; padding: 0 22px;
  border-radius: 999px; background: var(--g-surface); color: #001d35;
  font-size: 14px; font-weight: 600; text-decoration: none;
  box-shadow: 0 1px 2px rgba(60,64,67,.3), 0 1px 3px 1px rgba(60,64,67,.15);
}
.g-compose svg { width: 20px; height: 20px; }
.g-compose:hover { background: var(--g-hover); box-shadow: 0 1px 3px rgba(60,64,67,.3), 0 4px 8px 3px rgba(60,64,67,.15); text-decoration: none; }
.g-folders { display: flex; flex-direction: column; gap: 2px; }
.g-folder {
  display: flex; align-items: center; gap: 16px;
  height: 34px; padding: 0 16px 0 26px;
  border-radius: 0 999px 999px 0;
  color: var(--g-ink); font-size: 13px; font-weight: 500; text-decoration: none;
  white-space: nowrap;
}
.g-folder:hover { background: #e8eaed; text-decoration: none; }
.g-folder.active { background: var(--g-blue-soft); color: #001d35; font-weight: 700; }
.g-folder-icon { width: 20px; height: 20px; flex: 0 0 auto; color: #444746; }
.g-folder-icon svg { display: block; width: 20px; height: 20px; }
.g-folder.active .g-folder-icon { color: var(--g-blue); }
.g-folder-label { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.g-count { color: var(--g-muted); font-size: 11.5px; font-weight: 600; }
.g-folder.active .g-count { color: #001d35; }

.g-main {
  min-width: 0; min-height: calc(100vh - 88px);
  margin: 8px 16px 16px 0;
  border-radius: 16px; background: var(--g-surface); overflow: hidden;
}
.g-list-top { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--g-line); }
.g-search-panel { flex: 1 1 auto; max-width: none; margin: 0; height: 44px; }
.g-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 20px; border-bottom: 1px solid var(--g-line); }
.g-toolbar h1 { margin: 0; color: var(--g-ink); font: 600 16px/1.4 var(--sans); }
.g-sub { margin-top: 2px; color: var(--g-muted); font-size: 12px; }
.g-toolbar-actions { display: flex; align-items: center; gap: 4px; }
.g-list { display: flex; flex-direction: column; }
.g-row-item { display: flex; align-items: center; border-bottom: 1px solid #f1f3f4; }
.g-row-item:hover { background: var(--g-hover); }
.g-row {
  display: grid; grid-template-columns: 32px 280px minmax(0, 1fr) 90px;
  align-items: center; gap: 12px; flex: 1; min-width: 0;
  height: 44px; padding: 0 20px;
  color: var(--g-muted); font-size: 13px; text-decoration: none;
}
.g-row:hover { background: transparent; text-decoration: none; }
.g-row-delete { flex: 0 0 auto; margin: 0; padding-right: 16px; }
.g-row-delete button { border: 0; background: none; padding: 0; color: #c5221f; font: 600 11.5px var(--sans); cursor: pointer; }
.g-row-delete button:hover { text-decoration: underline; }
.g-list-top form { margin: 0; }
.g-row.unread { color: var(--g-ink); font-weight: 600; }
.g-row.unread .g-sender, .g-row.unread .g-subject { font-weight: 700; }
.g-row .g-avatar { width: 28px; height: 28px; font-size: 11px; }
.g-sender, .g-subject { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-subject { display: flex; align-items: center; gap: 8px; }
.g-subject-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-clip { width: 15px; height: 15px; flex: 0 0 auto; color: var(--g-muted); }
.g-date { text-align: right; white-space: nowrap; font-size: 12px; }
.g-empty { padding: 80px 20px; text-align: center; color: var(--g-muted); font-size: 13px; }
.g-empty strong { display: block; margin-bottom: 4px; color: var(--g-ink); font-size: 16px; }
.g-empty p { margin: 0; }
.g-empty-link { display: inline-block; margin-top: 14px; color: var(--g-blue); font-weight: 600; }

.g-message-toolbar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--g-line); }
.g-message-folder { color: var(--g-muted); font-size: 12px; }
.page-mail .message-card { border: 0; border-radius: 0; box-shadow: none; background: var(--g-surface); }
.page-mail .message-head { padding: 20px 24px 14px; border-bottom: 0; }
.page-mail .message-head h1 { margin: 0 0 16px; color: var(--g-ink); font: 600 22px/1.35 var(--sans); letter-spacing: -.01em; }
.g-message-sender { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.g-message-from { display: flex; align-items: center; min-width: 0; }
.g-message-from strong { color: var(--g-ink); font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.g-message-date { margin-left: auto; color: var(--g-muted); font-size: 12px; }
.page-mail .message-meta { margin-top: 10px; color: var(--g-muted); font-size: 11.5px; }
.page-mail .message-meta strong { color: var(--g-ink); font-weight: 500; }
.page-mail .message-actions { padding: 8px 20px 16px; border-top: 0; border-bottom: 1px solid var(--g-line); background: var(--g-surface); }
.page-mail .message-actions form { margin: 0; }
.page-mail .message-body { padding: 22px 24px; }
.g-crypto-warning { margin: 14px 24px 0; }
.g-compose-warning { flex: 0 0 auto; margin: 0 0 14px; }
.page-mail .mail-frame {
  border: 0;
  border-radius: 12px;
  height: 360px;
  min-height: 140px;
}
.mail-inline { display: block; width: 100%; color: var(--g-ink); font: 14px/1.7 var(--sans); overflow-wrap: anywhere; contain: layout paint; }
.mail-inline-loading { padding: 20px 0; color: var(--g-muted); font-size: 12px; }
.mail-inline-fallback { display: inline-block; margin-top: 8px; color: var(--g-blue); font-size: 12px; }
.page-mail .mail-text { color: var(--g-ink); font-family: var(--sans); }
.page-mail .attachments { border-top-color: var(--g-line); }
.page-mail .attachment { border-color: var(--g-line); background: var(--g-hover); border-radius: 8px; color: var(--g-ink); }

.page-mail .btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 34px; padding: 0 14px;
  border: 1px solid var(--g-line-strong); border-radius: 18px;
  background: var(--g-surface); color: var(--g-ink);
  font-size: 12.5px; font-weight: 600; text-decoration: none; cursor: pointer;
}
.page-mail .btn:hover { background: var(--g-hover); text-decoration: none; }
.page-mail .btn-primary { border-color: var(--g-blue); background: var(--g-blue); color: #fff; }
.page-mail .btn-primary:hover { background: #0842a0; border-color: #0842a0; }
.page-mail .btn-danger { border-color: var(--g-line-strong); background: var(--g-surface); color: #c5221f; }
.page-mail .btn-danger:hover { background: #fce8e6; }
.page-mail .btn-sm { height: 30px; padding: 0 12px; font-size: 12px; }
.page-mail .btn-ghost { border-color: transparent; background: transparent; color: var(--g-blue); }

.g-compose-page { display: flex; flex-direction: column; min-height: calc(100vh - 88px); padding: 16px 20px 40px; }
.g-compose-head { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.g-compose-head h1 { margin: 0; color: var(--g-ink); font: 600 18px/1.4 var(--sans); }
.g-compose-form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow: hidden; border: 1px solid var(--g-line); border-radius: 12px; background: var(--g-surface); box-shadow: 0 8px 24px rgba(60,64,67,.12); }
.g-compose-field { display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--g-line); }
.g-compose-field label { width: 52px; flex: 0 0 auto; color: var(--g-muted); font-size: 12px; }
.g-compose-field input { flex: 1; min-width: 0; height: 52px; border: 0; outline: 0; background: transparent; color: var(--g-ink); font-size: 13.5px; }
.g-compose-field-split { display: grid; grid-template-columns: 1fr 1fr; gap: 0; padding: 0; }
.g-compose-field-split > div { display: flex; align-items: center; gap: 12px; padding: 0 18px; }
.g-compose-field-split > div + div { border-left: 1px solid var(--g-line); }
.g-compose-field-split label { width: 52px; }
.g-compose-body { display: block; width: 100%; min-height: clamp(180px, calc(100vh - 520px), 360px); padding: 18px; border: 0; outline: 0; resize: vertical; background: var(--g-surface); color: var(--g-ink); font: 13.5px/1.8 var(--sans); }
.g-compose-body::placeholder { color: #9aa0a6; }
.g-compose-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 18px; border-top: 1px solid var(--g-line); background: var(--g-surface); }
.g-compose-hint { color: var(--g-muted); font-size: 11px; }

@media (max-width: 960px) {
  .g-shell { grid-template-columns: 220px minmax(0, 1fr); }
  .g-row { grid-template-columns: 30px 220px minmax(0, 1fr) 78px; padding: 0 14px; }
  .g-user-email { display: none; }
}
@media (max-width: 760px) {
  .g-topbar { height: auto; min-height: 60px; flex-wrap: wrap; gap: 10px; padding: 10px 12px; }
  .g-topbar-left { order: 1; }
  .g-topbar-right { order: 2; margin-left: auto; }
  .g-list-top { padding: 10px 14px; gap: 8px; }
  .g-search-panel { height: 42px; }
  .g-shell { display: flex; flex-direction: column; min-height: 0; }
  .g-sidebar { position: static; max-height: none; flex-direction: row; align-items: center; gap: 8px; padding: 8px 12px; overflow-x: auto; overflow-y: visible; scrollbar-width: none; }
  .g-sidebar::-webkit-scrollbar { display: none; }
  .g-compose { flex: 0 0 auto; height: 38px; margin: 0; padding: 0 16px; border: 1px solid var(--g-line-strong); border-radius: 999px; box-shadow: none; font-size: 12px; gap: 8px; }
  .g-compose svg { width: 16px; height: 16px; }
  .g-folders { flex-direction: row; gap: 6px; }
  .g-folder { height: 36px; padding: 0 12px; border-radius: 999px; gap: 6px; font-size: 12px; }
  .g-folder-icon, .g-folder-icon svg { width: 16px; height: 16px; }
  .g-main { min-height: 0; margin: 0 10px 10px; border-radius: 12px; }
  .g-row { grid-template-columns: 28px minmax(0, 1fr) auto; grid-template-rows: auto auto; height: auto; padding: 10px 14px; row-gap: 1px; }
  .g-row .g-avatar { grid-row: 1 / span 2; }
  .g-sender { grid-column: 2; grid-row: 1; }
  .g-date { grid-column: 3; grid-row: 1; }
  .g-subject { grid-column: 2 / span 2; grid-row: 2; font-size: 12px; }
  .g-message-date { margin-left: 0; }
  .g-compose-field-split { grid-template-columns: 1fr; }
  .g-compose-field-split > div + div { border-left: 0; border-top: 1px solid var(--g-line); }
}

/* webmail settings */
.g-settings { padding: 24px 28px 60px; }
.g-settings-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 18px; }
.g-settings-head h1 { margin: 4px 0 4px; color: var(--g-ink); font: 700 28px/1.2 var(--sans); letter-spacing: -.02em; }
.g-settings-head p { margin: 0; color: var(--g-muted); font-size: 12.5px; }
.g-settings-head .actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.g-settings-form { display: flex; flex-direction: column; gap: 14px; }
.g-settings-card { padding: 22px; border: 1px solid var(--g-line); border-radius: 16px; background: var(--g-surface); }
.g-settings-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.g-settings-card h2 { margin: 0; color: var(--g-ink); font: 600 16px/1.4 var(--sans); }
.g-settings-sub { margin: 4px 0 0; color: var(--g-muted); font-size: 12px; line-height: 1.7; }
.g-settings-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; margin-top: 18px; }
.g-settings-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.g-settings-field label, .g-settings-label { color: var(--g-muted); font-size: 12px; font-weight: 600; }
.g-settings-field input { width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--g-line-strong); border-radius: 10px; background: #fff; color: var(--g-ink); font: 13.5px var(--sans); }
.g-settings-field input:focus { outline: 0; border-color: var(--g-blue); box-shadow: 0 0 0 3px var(--g-blue-soft); }
.g-settings-field input:disabled { background: var(--g-hover); color: var(--g-muted); }
.g-settings-signature { display: block; width: 100%; min-height: 180px; margin-top: 16px; padding: 14px; border: 1px solid var(--g-line-strong); border-radius: 10px; background: #fff; color: var(--g-ink); font: 13.5px/1.8 var(--ui-mono); resize: vertical; }
.g-settings-signature:focus { outline: 0; border-color: var(--g-blue); box-shadow: 0 0 0 3px var(--g-blue-soft); }
.g-settings-check { display: flex; align-items: center; gap: 8px; margin-top: 14px; color: var(--g-muted); font-size: 12.5px; }
.g-settings-template-field { margin-top: 18px; }
.g-settings-template-field .ui-select-wrap { width: 100%; }
.g-settings-preview { margin-top: 18px; }
.g-signature-preview { margin: 8px 0 0; padding: 16px; min-height: 100px; border: 1px dashed var(--g-line-strong); border-radius: 10px; background: var(--g-hover); color: var(--g-ink-2); font: 12.5px/1.8 var(--sans); white-space: pre-wrap; word-break: break-word; }
.g-signature-preview-html { margin-top: 8px; padding: 16px; min-height: 100px; border: 1px dashed var(--g-line-strong); border-radius: 10px; background: var(--g-hover); color: var(--g-ink-2); font: 13px/1.7 var(--sans); overflow: auto; }
.g-signature-preview-html[hidden], .g-signature-preview[hidden] { display: none; }
.g-settings-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.g-settings-link { margin-left: auto; color: var(--g-blue); font-size: 12px; font-weight: 600; }
@media (max-width: 760px) {
  .g-settings { padding: 18px 14px 50px; }
  .g-settings-head h1 { font-size: 24px; }
  .g-settings-grid { grid-template-columns: 1fr; }
  .g-settings-card { padding: 18px; }
  .g-settings-link { margin-left: 0; }
}

/* rich compose editor */
.g-compose-editor-wrap { background: #fff; }
.g-editor-toolbar { flex: 0 0 auto; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; padding: 8px 14px; border-bottom: 1px solid var(--g-line); background: var(--g-hover); }
.g-editor-btn { height: 30px; padding: 0 9px; border: 0; border-radius: 6px; background: transparent; color: var(--g-muted); font: 600 12px/1 var(--sans); cursor: pointer; }
.g-editor-btn:hover { background: #e8f0fe; color: var(--g-ink); }
.g-editor-btn:focus-visible { outline: 2px solid var(--g-blue-soft); outline-offset: 1px; }
.g-compose-editor-wrap { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.g-compose-editor { flex: 1 1 auto; min-height: 220px; padding: 18px; outline: 0; overflow-wrap: break-word; word-break: break-word; color: var(--g-ink); font: 14px/1.8 var(--sans); }
.g-compose-editor:empty::before { content: attr(data-placeholder); color: #9aa0a6; pointer-events: none; }
.g-compose-editor p, .g-compose-editor div { margin: 0 0 6px; }
.g-compose-editor blockquote { margin: 8px 0; padding: 6px 14px; border-left: 3px solid var(--g-line-strong); color: var(--g-muted); }
.g-compose-editor ul, .g-compose-editor ol { margin: 6px 0; padding-left: 24px; }
.g-compose-editor a { color: var(--g-blue); }
.g-compose-editor img { max-width: 100%; height: auto; }

/* webmail blacklist settings */
.g-blacklist-card { margin-top: 14px; }
.g-blacklist-add { display: flex; gap: 10px; margin-top: 16px; }
.g-blacklist-input { display: block; width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--g-line-strong); border-radius: 10px; background: #fff; color: var(--g-ink); font: 13.5px var(--ui-mono); }
.g-blacklist-input:focus { outline: 0; border-color: var(--g-blue); box-shadow: 0 0 0 3px var(--g-blue-soft); }
.g-blacklist-hint { margin: 8px 0 0; color: var(--g-muted); font-size: 11.5px; line-height: 1.7; }
.g-blacklist-hint code { padding: 1px 5px; border-radius: 4px; background: var(--g-hover); font-family: var(--ui-mono); }
.g-blacklist-list { margin-top: 14px; border-top: 1px solid var(--g-line); }
.g-blacklist-row { display: flex; align-items: center; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--g-line); }
.g-blacklist-row code { flex: 1; min-width: 0; color: var(--g-ink); font: 12.5px var(--ui-mono); overflow-wrap: anywhere; }
.g-blacklist-row > span { flex: 0 0 auto; color: var(--g-muted); font-size: 11px; }
.g-blacklist-row form { margin: 0; }
.g-blacklist-delete { border: 0; background: none; padding: 0; color: #c5221f; font: 600 11.5px var(--sans); cursor: pointer; }
.g-blacklist-empty { margin-top: 14px; color: var(--g-muted); font-size: 12px; }
@media (max-width: 760px) {
  .g-blacklist-add { flex-wrap: wrap; }
  .g-blacklist-row { align-items: flex-start; flex-wrap: wrap; gap: 6px 12px; }
  .g-blacklist-row code { flex-basis: 100%; }
}

.g-main-list { display: flex; flex-direction: column; }
.g-main-list > .ui-pagination { margin-top: auto; padding: 14px 20px; }

/* settings tabs */
.page-mail .ui-tabs { border-bottom: 0; gap: 6px; padding: 2px 0; }
.page-mail .ui-tab, .page-mail .ui-tab:hover { text-decoration: none; }
.page-mail .ui-tab { height: 34px; padding: 0 14px; border-bottom: 0; border-radius: 999px; color: var(--g-muted); }
.page-mail .ui-tab:hover { color: var(--g-ink); background: var(--g-hover); }
.page-mail .ui-tab.active { border-bottom: 0; background: var(--g-blue-soft); color: var(--g-blue); }

/* webmail pagination follows the mail palette */
.page-mail .ui-page { border-color: var(--g-line); background: var(--g-surface); color: var(--g-ink); }
.page-mail .ui-page:hover:not(.active):not(.disabled) { background: var(--g-hover); }
.page-mail .ui-page.active { border-color: var(--g-blue); background: var(--g-blue); color: #fff; }
.page-mail .ui-pagination-info { color: var(--g-muted); }
@media (max-width: 760px) {
  .g-main-list > .ui-pagination { padding: 12px 14px; }
}

/* client setup inside webmail settings */
.g-client-card { margin-top: 0; }
.g-client-card .ui-table { min-width: 620px; }
.g-client-card .ui-table td { font-size: 12.5px; }

/* ---------------------------------------------------------------------------
   技术文档
   --------------------------------------------------------------------------- */
.page-docs {
  background: var(--ui-bg);
  background-image:
    radial-gradient(980px 620px at 8% -10%, #e5efe8 0, transparent 58%),
    radial-gradient(820px 560px at 102% 0%, #f6e8df 0, transparent 50%);
  background-attachment: fixed;
  color: var(--ui-ink);
  font-family: var(--ui-font);
}
.docs-nav-label { padding: 5px 10px; border: 1px solid var(--ui-line); border-radius: 999px; background: var(--ui-surface); color: var(--ui-ink-2); font-size: 11px; font-weight: 650; }
.docs-shell { max-width: 1180px; min-width: 0; margin: 0 auto; padding: 0 26px 80px; display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 48px; align-items: start; }
.docs-side { min-width: 0; position: sticky; top: 74px; max-height: calc(100vh - 74px); overflow-y: auto; padding: 46px 0 30px; }
.docs-side-head { display: flex; flex-direction: column; gap: 6px; }
.docs-side-head strong { font-size: 15px; letter-spacing: -.02em; }
.docs-toc { display: flex; flex-direction: column; min-width: 0; max-width: 100%; margin-top: 16px; border-left: 1px solid var(--ui-line); }
.docs-toc a { padding: 6px 0 6px 14px; margin-left: -1px; border-left: 2px solid transparent; color: var(--ui-muted); font-size: 11.5px; font-weight: 550; text-decoration: none; }
.docs-toc a:hover { border-left-color: var(--ui-brand); color: var(--ui-ink); }
.docs-toc a:first-child { border-left-color: var(--ui-brand); color: var(--ui-brand); font-weight: 650; }
.docs-side-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--ui-line); color: var(--ui-muted); font-size: 10.5px; }
.docs-body { min-width: 0; max-width: 860px; padding-top: 46px; }
.docs-hero { padding-bottom: 30px; border-bottom: 1px solid var(--ui-line); }
.docs-hero h1 { margin: 16px 0 18px; font-size: clamp(38px, 5vw, 56px); line-height: 1.08; letter-spacing: -.055em; font-weight: 760; }
.docs-hero h1 em { font-style: normal; color: var(--ui-brand); }
.docs-hero p { max-width: 680px; margin: 0; color: var(--ui-ink-2); font-size: 14px; line-height: 1.95; }
.docs-hero-meta, .docs-hero-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.docs-hero-meta { margin-top: 20px; }
.docs-hero-actions { margin-top: 22px; }
.docs-lead-alert { margin-top: 24px; }
.docs-section { padding: 42px 0 40px; border-bottom: 1px solid var(--ui-line); scroll-margin-top: 96px; }
.docs-section:last-of-type { border-bottom: 0; }
.docs-kicker { color: var(--ui-muted); font: 700 9.5px/1 var(--ui-mono); letter-spacing: .16em; text-transform: uppercase; }
.docs-section h2 { margin: 9px 0 14px; font-size: 30px; line-height: 1.18; letter-spacing: -.04em; }
.docs-section h3 { margin: 28px 0 9px; font-size: 16px; line-height: 1.4; letter-spacing: -.01em; }
.docs-section p { margin: 0 0 14px; color: var(--ui-ink-2); font-size: 13px; line-height: 1.9; }
.docs-section > p:last-child { margin-bottom: 0; }
.docs-section code { padding: 1px 5px; border: 1px solid var(--ui-line); border-radius: 4px; background: var(--ui-surface-2); color: var(--ui-ink-2); font: 11px/1.6 var(--ui-mono); overflow-wrap: anywhere; }
.docs-list { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 18px; padding: 0; list-style: none; }
.docs-list li { position: relative; padding-left: 20px; color: var(--ui-ink-2); font-size: 12.5px; line-height: 1.8; }
.docs-list li::before { content: ""; position: absolute; left: 3px; top: 9px; width: 6px; height: 6px; border-radius: 50%; background: var(--ui-brand); box-shadow: 0 0 0 3px var(--ui-brand-soft); }
.docs-goals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 20px 0; }
.docs-goal { padding: 18px; border: 1px solid var(--ui-line); border-radius: var(--ui-radius-lg); background: var(--ui-surface); box-shadow: var(--ui-shadow-sm); }
.docs-goal strong { display: block; font-size: 13px; }
.docs-goal span { display: block; margin-top: 5px; color: var(--ui-muted); font-size: 11.5px; line-height: 1.75; }
.docs-sequence { display: flex; align-items: stretch; gap: 8px; margin: 22px 0; padding: 16px; border: 1px solid var(--ui-line); border-radius: var(--ui-radius-xl); background: var(--ui-surface); box-shadow: var(--ui-shadow-sm); }
.docs-sequence-step { flex: 1; min-width: 0; padding: 12px 10px; border: 1px solid var(--ui-line); border-radius: 11px; background: var(--ui-surface-2); color: var(--ui-ink-2); font-size: 11.5px; line-height: 1.55; }
.docs-sequence-step b { display: block; margin-bottom: 5px; color: var(--ui-brand); font: 700 9.5px/1 var(--ui-mono); letter-spacing: .1em; }
.docs-sequence-arrow { display: flex; align-items: center; color: var(--ui-muted); font-size: 14px; }
.docs-table-card { margin: 16px 0 20px; border: 1px solid var(--ui-line); border-radius: var(--ui-radius-lg); background: var(--ui-surface); box-shadow: var(--ui-shadow-sm); overflow: hidden; }
.docs-table { min-width: 560px; }
.docs-table th, .docs-table td { white-space: normal; vertical-align: top; }
.docs-table th { height: 38px; font-size: 11px; }
.docs-table td { height: auto; padding: 10px 12px; font-size: 11.5px; line-height: 1.7; }
.docs-table td:first-child { color: var(--ui-ink); font-weight: 600; }
.docs-table-normative td:nth-child(2) { color: var(--ui-brand); font-weight: 700; font-size: 10px; letter-spacing: .04em; }
.docs-two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 18px 0; }
.docs-note { padding: 18px; border: 1px solid var(--ui-line); border-radius: var(--ui-radius-lg); background: var(--ui-surface); }
.docs-note strong { display: block; font-size: 13px; }
.docs-note p { margin: 7px 0 0; color: var(--ui-muted); font-size: 11.5px; line-height: 1.8; }
.docs-inline-alert { margin: 18px 0; }
.docs-code { margin: 16px 0 20px; padding: 15px 18px 14px; border: 1px solid #173F31; border-radius: var(--ui-radius-lg); background: #0E2E24; color: #DCE9E0; overflow: auto; }
.docs-code-label { display: block; margin-bottom: 10px; color: #86B49E; font: 700 9px/1 var(--ui-mono); letter-spacing: .14em; text-transform: uppercase; }
.docs-code pre { margin: 0; font: 11px/1.75 var(--ui-mono); white-space: pre-wrap; word-break: break-word; }
.docs-code code { padding: 0; border: 0; background: none; color: inherit; font: inherit; overflow-wrap: normal; }
.docs-steps { counter-reset: docstep; display: flex; flex-direction: column; gap: 9px; margin: 16px 0 20px; padding: 0; list-style: none; }
.docs-steps li { counter-increment: docstep; position: relative; padding-left: 38px; color: var(--ui-ink-2); font-size: 12.5px; line-height: 1.8; }
.docs-steps li::before { content: counter(docstep, decimal-leading-zero); position: absolute; left: 0; top: 1px; width: 26px; height: 26px; border-radius: 50%; background: var(--ui-brand-soft); color: var(--ui-brand); font: 700 9px/26px var(--ui-mono); text-align: center; }
.docs-callout { margin: 18px 0; padding: 15px 18px; border: 1px solid var(--ui-line); border-left: 3px solid var(--ui-brand); border-radius: 0 var(--ui-radius-md) var(--ui-radius-md) 0; background: var(--ui-surface); }
.docs-callout strong { display: block; font-size: 12.5px; }
.docs-callout p { margin: 5px 0 0; font-size: 11.5px; line-height: 1.8; }
.docs-callout-warn { border-left-color: var(--ui-warning); }
.docs-handshake { display: grid; grid-template-columns: minmax(0, 1fr) 118px minmax(0, 1fr); gap: 12px; align-items: center; margin: 20px 0; }
.docs-handshake-side { padding: 18px; border: 1px solid var(--ui-line); border-radius: var(--ui-radius-lg); background: var(--ui-surface); box-shadow: var(--ui-shadow-sm); }
.docs-handshake-domain { display: block; margin-bottom: 9px; color: var(--ui-brand); font-size: 12.5px; font-weight: 700; }
.docs-handshake-side ol { margin: 0; padding-left: 17px; color: var(--ui-muted); font-size: 11px; line-height: 1.8; }
.docs-handshake-mid { display: flex; flex-direction: column; align-items: center; gap: 5px; color: var(--ui-muted); font-size: 10px; text-align: center; }
.docs-handshake-mid strong { color: var(--ui-brand); font-size: 22px; line-height: 1; }
.docs-security-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 20px 0; }
.docs-security-item { padding: 18px; border: 1px solid var(--ui-line); border-radius: var(--ui-radius-lg); background: var(--ui-surface); }
.docs-security-item strong { display: block; font-size: 12.5px; }
.docs-security-item p { margin: 6px 0 0; color: var(--ui-muted); font-size: 11.5px; line-height: 1.8; }
.docs-version-row { display: flex; align-items: flex-start; gap: 12px; margin-top: 18px; padding: 16px 18px; border: 1px solid var(--ui-line); border-radius: var(--ui-radius-lg); background: var(--ui-surface); }
.docs-version-row strong { display: block; font-size: 12.5px; }
.docs-version-row span:not(.ui-pill) { display: block; margin-top: 3px; color: var(--ui-muted); font-size: 11.5px; line-height: 1.75; }
.docs-checklist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 20px 0; }
.docs-check { display: flex; align-items: flex-start; gap: 12px; padding: 15px 16px; border: 1px solid var(--ui-line); border-radius: var(--ui-radius-md); background: var(--ui-surface); }
.docs-check-mark { flex: 0 0 auto; color: var(--ui-brand); font: 700 9.5px/1.6 var(--ui-mono); letter-spacing: .08em; }
.docs-check strong { display: block; font-size: 12px; }
.docs-check p { margin: 4px 0 0; color: var(--ui-muted); font-size: 11px; line-height: 1.7; }
.docs-related { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 28px; }
.docs-related-card { display: block; padding: 18px; color: inherit; text-decoration: none; transition: border-color .15s ease, box-shadow .15s ease; }
.docs-related-card:hover { border-color: var(--ui-line-strong); box-shadow: var(--ui-shadow-md); text-decoration: none; }
.docs-related-card strong { display: block; margin-top: 7px; font-size: 12.5px; }
.docs-related-card p { margin: 5px 0 0; color: var(--ui-muted); font-size: 11px; line-height: 1.7; }
.docs-end { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 10px; padding-top: 22px; color: var(--ui-muted); font-size: 10.5px; }

@media (max-width: 960px) {
  .docs-shell { grid-template-columns: 1fr; gap: 0; }
  .docs-side { position: static; max-height: none; overflow: visible; padding: 30px 0 0; }
  .docs-side-head { flex-direction: row; align-items: baseline; gap: 10px; }
  .docs-toc { flex-direction: row; gap: 6px; margin-top: 12px; border-left: 0; overflow-x: auto; padding-bottom: 4px; }
  .docs-toc a { flex: 0 0 auto; padding: 6px 10px; border: 1px solid var(--ui-line); border-radius: 999px; }
  .docs-toc a:hover, .docs-toc a:first-child { border-color: var(--ui-brand); background: var(--ui-brand-soft); }
  .docs-side-foot { display: none; }
  .docs-body { padding-top: 30px; }
}
@media (max-width: 760px) {
  .docs-shell { padding: 0 16px 52px; }
  .docs-nav-inner { min-height: 64px; }
  .docs-nav-inner .home-nav-actions { gap: 4px; }
  .docs-nav-label { display: none; }
  .docs-hero h1 { font-size: 34px; }
  .docs-goals, .docs-two-col, .docs-security-grid, .docs-checklist, .docs-related { grid-template-columns: 1fr; }
  .docs-sequence { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .docs-sequence-arrow { display: none; }
  .docs-handshake { grid-template-columns: 1fr; }
  .docs-handshake-mid { flex-direction: row; justify-content: center; gap: 8px; padding: 2px 0; }
  .docs-section { padding: 34px 0; }
  .docs-section h2 { font-size: 25px; }
}

/* MFA setup follows the reference account-security layout. */
.crumb { margin: 0 0 10px; color: var(--ui-muted); font-size: 10.5px; line-height: 1.5; }
.crumb a { color: var(--ui-muted); font-weight: 650; text-decoration: none; }
.crumb a:hover { color: var(--ui-brand); }
.mfa-setup-card { width: 100%; }
.mfa-setup-steps { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 0 0 24px; padding: 0; list-style: none; }
.mfa-setup-steps li { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--ui-line); border-radius: 10px; background: var(--ui-surface-2); }
.mfa-step-no { flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%; background: var(--ui-success-soft); border: 1px solid #bcdcc8; color: var(--ui-brand); display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.mfa-setup-steps strong { display: block; font-size: 12px; }
.mfa-setup-steps small { display: block; margin-top: 3px; color: var(--ui-muted); font-size: 10.5px; line-height: 1.5; }
.mfa-setup-grid { display: grid; grid-template-columns: minmax(250px, 320px) minmax(0, 1fr); gap: 32px; align-items: start; }
.mfa-setup-qr { width: 220px; margin: 0 auto; padding: 10px; border-radius: 16px; }
.mfa-qr-note { margin-top: 12px; text-align: center; }
.mfa-setup-col h2 { margin: 0 0 8px; font-size: 13px; }
.mfa-setup-col .ui-hint { max-width: 680px; margin: 0 0 10px; }
.mfa-setup-col details { margin-top: 12px; }
.mfa-setup-col summary { cursor: pointer; color: var(--ui-muted); font-size: 11px; }
.mfa-setup-col .ui-alert { margin-top: 12px; }
.doc-code { display: block; padding: 8px 10px; border: 1px solid var(--ui-line); border-radius: 6px; background: #fff; color: var(--ui-ink); font: 11px/1.6 var(--ui-mono); white-space: pre-wrap; word-break: break-all; }
.mfa-setup-col details .doc-code { margin-top: 8px; }
.mfa-setup-verify { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--ui-line); }
.mfa-setup-verify h2 { margin: 0 0 6px; font-size: 13px; }
.mfa-setup-verify .ui-hint { max-width: 680px; }
.mfa-setup-verify-row { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.mfa-setup-verify-row .ui-field { width: 320px; margin-bottom: 0; }
.mfa-setup-verify-row .adm-form-actions { margin-top: 0; }
@media (max-width: 900px) {
  .mfa-setup-grid { grid-template-columns: 1fr; gap: 20px; }
  .mfa-setup-qr { width: 200px; }
}
.docs-section p.ui-small.ui-muted { margin-top: -6px; font-size: 11.5px; color: var(--ui-muted); }

/* Webmail account security cards follow the client palette. */
.g-security-list { display: flex; flex-direction: column; gap: 14px; }
.g-badge { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; background: var(--g-hover); color: var(--g-muted); font-size: 10.5px; font-weight: 600; white-space: nowrap; }
.g-badge-ok { background: #e6f4ea; color: #137333; }
.g-badge-warn { background: #fef7e0; color: #b06000; }
.g-security-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--g-line); color: var(--g-ink); font-size: 12.5px; }
.g-security-row span { color: var(--g-muted); }
.g-security-row strong { font-weight: 600; }
.g-hint { margin: 0; color: var(--g-muted); font-size: 12px; line-height: 1.7; }
.g-alert { padding: 12px 14px; border: 1px solid var(--g-line); border-radius: 10px; font-size: 12px; line-height: 1.7; }
.g-alert-info { border-color: #c2d7fa; background: #e8f0fe; color: #174ea6; }
.g-alert-warn { border-color: #fde293; background: #fef7e0; color: #8a5a12; }
.page-mail .crumb { color: var(--g-muted); }
.page-mail .crumb a { color: var(--g-muted); }
.page-mail .crumb a:hover { color: var(--g-blue); }
.page-mail .mfa-setup-steps li { background: var(--g-hover); border-color: var(--g-line); }
.page-mail .mfa-step-no { background: var(--g-blue-soft); border-color: #c2d7fa; color: var(--g-blue); }
.page-mail .mfa-setup-steps strong, .page-mail .mfa-setup-col h2, .page-mail .mfa-setup-verify h2 { color: var(--g-ink); }
.page-mail .mfa-setup-steps small, .page-mail .mfa-setup-col summary, .page-mail .mfa-qr-note { color: var(--g-muted); }
.page-mail .mfa-setup-qr { border-color: var(--g-line); }
.page-mail .doc-code { border-color: var(--g-line-strong); background: #fff; color: var(--g-ink); }
.page-mail .mfa-setup-verify { border-top-color: var(--g-line); }
.page-mail .recovery-grid .ui-code { background: var(--g-hover); border-color: var(--g-line); color: var(--g-ink); }
.mfa-setup-verify-row .g-settings-field { width: 320px; max-width: 100%; }
.g-settings > .g-alert { margin-bottom: 14px; }
.g-settings-card .g-settings-field + .g-settings-field { margin-top: 14px; }
.g-settings-card > .g-settings-actions { margin-top: 16px; }

/* Documentation category tabs */
.docs-tabs-wrap { max-width: 1180px; margin: 0 auto; padding: 0 26px; }
.docs-tabs { display: flex; gap: 4px; padding-top: 10px; border-bottom: 1px solid var(--ui-line); overflow-x: auto; }
.docs-tabs a { flex: 0 0 auto; margin-bottom: -1px; padding: 10px 14px; border-bottom: 2px solid transparent; color: var(--ui-muted); font-size: 12.5px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.docs-tabs a:hover { color: var(--ui-ink); text-decoration: none; }
.docs-tabs a.active { border-bottom-color: var(--ui-brand); color: var(--ui-brand); }
@media (max-width: 760px) {
  .docs-tabs-wrap { padding: 0 16px; }
}

/* Form inputs and their action buttons share height and radius in webmail. */
.g-settings-form .btn,
.mfa-setup-verify-row .btn {
  height: 44px;
  border-radius: 10px;
  font-size: 13.5px;
}

/* Webmail recovery-code receipt */
.recovery-shell { width: 100%; }
.page-mail .recovery-card { width: 100%; max-width: none; margin: 0; }
.recovery-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.recovery-card-icon { width: 40px; height: 40px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 12px; background: var(--g-blue-soft); color: var(--g-blue); }
.recovery-card-icon svg { width: 20px; height: 20px; }
.recovery-card-head h2 { margin: 0; color: var(--g-ink); font: 600 16px/1.4 var(--sans); }
.recovery-card-head p { margin: 3px 0 0; color: var(--g-muted); font-size: 12px; }
.recovery-card-head .g-badge { margin-left: auto; }
.page-mail .recovery-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.page-mail .recovery-grid .ui-code { padding: 14px 16px; border: 1px solid var(--g-line); border-radius: 10px; background: var(--g-hover); color: var(--g-ink); font-size: 14px; letter-spacing: .08em; }
.recovery-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 14px; padding-top: 0; border-top: 0; }
.recovery-card-foot p { max-width: none; margin: 0; color: var(--g-muted); font-size: 11.5px; line-height: 1.7; white-space: nowrap; }
.recovery-download { gap: 7px; }
.recovery-download svg { width: 16px; height: 16px; }
@media (max-width: 760px) {
  .recovery-card-head { flex-wrap: wrap; }
  .recovery-card-head .g-badge { margin-left: 0; }
  .recovery-card-foot { align-items: flex-start; flex-direction: column; }
  .recovery-card-foot p { white-space: normal; }
  .admin-recovery-foot .ui-hint { white-space: normal; }
}
.recovery-shell > .g-alert { margin-bottom: 14px; }

/* Admin recovery-code receipt mirrors the webmail layout */
.admin-recovery-shell { width: 100%; }
.admin-recovery-shell > .ui-alert { margin-bottom: 14px; }
.admin-recovery-card { width: 100%; max-width: none; }
.admin-recovery-head { align-items: center; }
.admin-recovery-title { display: flex; align-items: center; gap: 12px; }
.admin-recovery-icon { width: 40px; height: 40px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 12px; background: var(--ui-brand-soft); color: var(--ui-brand); }
.admin-recovery-icon svg { width: 20px; height: 20px; }
.admin-recovery-title .ui-card-title { margin: 0; }
.admin-recovery-title .ui-card-sub { margin-top: 3px; }
.admin-recovery-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 18px; }
.admin-recovery-grid .ui-code { padding: 14px 16px; border-radius: 10px; font-size: 14px; letter-spacing: .08em; text-align: center; }
.admin-recovery-foot { margin-top: 14px; padding-top: 0; border-top: 0; }
.admin-recovery-foot .ui-hint { max-width: none; white-space: nowrap; }
@media (max-width: 760px) {
  .admin-recovery-foot .ui-hint { white-space: normal; }
}

/* Webmail security cues */
.g-toolbar { flex-wrap: wrap; }
.g-security-badges { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.g-sec-chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border: 1px solid var(--g-line); border-radius: 999px; background: #f1f3f4; color: var(--g-muted); font-size: 10.5px; font-weight: 600; white-space: nowrap; text-decoration: none; }
.g-sec-chip svg { width: 13px; height: 13px; flex: 0 0 auto; }
.g-sec-ok { border-color: #ceead6; background: #e6f4ea; color: #137333; }
.g-sec-warn { border-color: #fde293; background: #fef7e0; color: #b06000; }
.g-ext-badge { flex: 0 0 auto; padding: 1px 6px; border: 1px solid #fde293; border-radius: 4px; background: #fef7e0; color: #b06000; font-size: 9.5px; font-weight: 700; line-height: 1.5; }
.g-security-strip { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 14px; padding: 9px 12px; border: 1px solid var(--g-line); border-left: 3px solid var(--g-blue); border-radius: 9px; background: var(--g-hover); }
.g-security-title { display: inline-flex; align-items: center; gap: 6px; color: var(--g-ink); font-size: 11.5px; font-weight: 600; }
.g-security-title svg { width: 14px; height: 14px; color: var(--g-blue); }
@media (max-width: 760px) {
  .g-security-badges { justify-content: flex-start; width: 100%; margin-left: 0; }
}
.g-int-badge { flex: 0 0 auto; padding: 1px 6px; border: 1px solid #ceead6; border-radius: 4px; background: #e6f4ea; color: #137333; font-size: 9.5px; font-weight: 700; line-height: 1.5; }
.g-trust-icon { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; color: var(--g-muted); }
.g-trust-icon svg { width: 14px; height: 14px; }
.g-trust-trusted { color: #137333; }
.g-trust-suspicious { color: #c5221f; }
.g-trust-unverified { color: #80868b; }
.g-trust-chip-trusted { border-color: #ceead6 !important; background: #e6f4ea !important; color: #137333 !important; }
.g-trust-chip-suspicious { border-color: #f6aea9 !important; background: #fce8e6 !important; color: #c5221f !important; }
.g-trust-chip-unverified { border-color: var(--g-line) !important; background: var(--g-hover) !important; color: var(--g-muted) !important; }
.g-trust-chip-trusted svg, .g-trust-chip-suspicious svg, .g-trust-chip-unverified svg { width: 13px; height: 13px; }
.g-trust-warning { margin: 0; padding: 11px 24px; border: 0; border-bottom: 1px solid #f0d9a8; background: #fce8e6; color: #a50e0e; font-size: 11.5px; line-height: 1.7; overflow-wrap: anywhere; }
@media (max-width: 760px) { .g-trust-warning { padding-left: 14px; padding-right: 14px; } }
.g-delivery-icon { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; padding: 0; border: 0; background: none; color: var(--g-muted); cursor: default; }
.g-delivery-icon svg { display: block; width: 15px; height: 15px; }
.g-delivery-icon-ok { color: #137333; }
.g-delivery-icon-pending { color: #b06000; }
.g-delivery-icon-partial { color: #a50e0e; cursor: pointer; }
.g-delivery-icon-failed { color: #c5221f; cursor: pointer; }
.g-delivery-icon:focus-visible { outline: 2px solid var(--g-blue-soft); outline-offset: 2px; border-radius: 50%; }
.g-delivery-tip { position: fixed; z-index: 1300; max-width: 340px; padding: 10px 12px; border-radius: 8px; background: #202124; color: #fff; font-size: 11.5px; line-height: 1.6; box-shadow: 0 8px 24px rgba(0,0,0,.22); overflow-wrap: anywhere; }
.g-delivery-tip strong { display: block; margin-bottom: 3px; font-size: 12px; }
.g-delivery-panel { padding: 12px 24px; border-bottom: 1px solid var(--g-line); background: var(--g-hover); }
.g-delivery-panel-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--g-ink); font-size: 12px; }
.g-delivery-panel-detail { color: var(--g-muted); font-size: 11.5px; }
.g-delivery-recipients { margin-top: 9px; display: flex; flex-direction: column; gap: 7px; }
.g-delivery-recipient-row { display: flex; align-items: flex-start; gap: 10px; }
.g-delivery-recipient-main { flex: 1; min-width: 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; font-size: 11.5px; }
.g-delivery-recipient-main strong { color: var(--g-ink); font-weight: 600; overflow-wrap: anywhere; }
.g-delivery-recipient-label { color: var(--g-muted); }
.g-delivery-recipient-error { flex: 1 1 100%; color: #c5221f; font-size: 11px; line-height: 1.6; overflow-wrap: anywhere; }
@media (max-width: 760px) { .g-delivery-panel { padding-left: 14px; padding-right: 14px; } }

/* Sender origin badge sits next to the address */
.g-sender { display: flex; align-items: center; gap: 6px; }
.g-sender-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-message-from { gap: 8px; flex-wrap: wrap; }

/* Recipient details separated from the sender row */
.page-mail .g-recipient-block { display: flex; flex-direction: column; gap: 5px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--g-line-strong); }
.g-recipient-row { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.g-recipient-label { flex: 0 0 38px; color: var(--g-muted); font-size: 11.5px; line-height: 1.7; }
.g-recipient-value { min-width: 0; color: var(--g-ink); font-size: 11.5px; line-height: 1.7; overflow-wrap: anywhere; }

.g-encrypted-shield { flex: 0 0 auto; display: inline-flex; align-items: center; color: #137333; }
.g-encrypted-shield svg { width: 14px; height: 14px; }

/* Compose attachments: custom picker, chosen-file list and upload progress */
.g-compose-field .g-file-input { position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; border: 0; opacity: 0; overflow: hidden; }
.g-compose-field .g-attachment-add { display: inline-flex; align-items: center; width: auto; height: 32px; padding: 0 13px; border: 1px solid var(--g-line-strong); border-radius: 999px; background: var(--g-surface); color: var(--g-ink); font-size: 12px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.g-compose-field .g-attachment-add:hover { background: var(--g-hover); }
.g-compose-field .g-attachment-add:focus-visible { outline: 2px solid var(--g-blue-soft); outline-offset: 2px; }
.g-attachment-picked { display: flex; flex-direction: column; gap: 8px; padding: 10px 18px 12px; border-bottom: 1px solid var(--g-line); }
.g-attachment-picked[hidden] { display: none; }
.g-attachment-item { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 8px 10px; border: 1px solid var(--g-line); border-radius: 8px; background: var(--g-hover); }
.g-attachment-item-icon { flex: 0 0 auto; color: var(--g-muted); }
.g-attachment-item-icon svg { width: 15px; height: 15px; }
.g-attachment-item-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--g-ink); font-size: 12.5px; }
.g-attachment-item-size { flex: 0 0 auto; color: var(--g-muted); font-size: 11px; }
.g-attachment-remove { flex: 0 0 auto; margin-left: auto; border: 0; background: none; padding: 0 2px; color: #c5221f; font: 600 11.5px var(--sans); cursor: pointer; }
.g-attachment-remove:hover { text-decoration: underline; }
.g-upload-progress { padding: 12px 18px; border-top: 1px solid var(--g-line); background: var(--g-surface); }
.g-upload-progress[hidden] { display: none; }
.g-upload-progress-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--g-muted); font-size: 11.5px; }
.g-upload-progress-head span:last-child { color: var(--g-ink); font-weight: 600; }
.g-upload-track { height: 6px; margin-top: 8px; border-radius: 999px; background: #e8eaed; overflow: hidden; }
.g-upload-bar { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--g-blue); transition: width .15s ease; }
.g-compose-field.g-compose-file { min-height: 53px; }

/* Recipient chips and the contact picker drawer */
.g-address-field { min-height: 53px; }
.g-compose-field.g-address-field { align-items: flex-start; padding-top: 8px; padding-bottom: 8px; }
.g-compose-field-split > .g-address-field { align-items: flex-start; padding-top: 8px; padding-bottom: 8px; }
.g-address-field > label { padding-top: 8px; }
.g-address-control { flex: 1 1 auto; min-width: 0; min-height: 36px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 1px 0; }
.g-address-control .g-address-input { flex: 1 1 140px; width: auto; min-width: 120px; height: 32px; padding: 0; border: 0; outline: 0; background: transparent; color: var(--g-ink); font-size: 13.5px; }
.g-address-chip { display: inline-flex; align-items: center; gap: 3px; max-width: 100%; height: 27px; padding: 0 4px 0 9px; border: 1px solid var(--g-line-strong); border-radius: 999px; background: var(--g-hover); color: var(--g-ink); font-size: 12px; font-weight: 500; }
.g-address-chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-address-remove { border: 0; background: none; padding: 0 3px; color: var(--g-muted); font: 600 14px/1 var(--sans); cursor: pointer; }
.g-address-remove:hover { color: #c5221f; }
.g-address-suggest { position: fixed; z-index: 1400; padding: 6px; border: 1px solid var(--g-line); border-radius: 10px; background: var(--g-surface); box-shadow: 0 12px 32px rgba(32,33,36,.18); overflow-y: auto; overscroll-behavior: contain; }
.g-address-suggest-group { padding: 6px 8px 3px; color: var(--g-muted); font-size: 10.5px; font-weight: 600; }
.g-address-suggest-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 8px; border: 0; border-radius: 6px; background: none; text-align: left; cursor: pointer; }
.g-address-suggest-item:hover, .g-address-suggest-item.active { background: var(--g-hover); }
.g-address-suggest-avatar { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--g-hover); color: var(--g-ink); font-size: 10px; font-weight: 700; }
.g-address-suggest-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.g-address-suggest-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--g-ink); font-size: 12px; font-weight: 600; }
.g-address-suggest-main span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--g-muted); font-size: 10.5px; }
.g-address-pick { flex: 0 0 auto; align-self: flex-start; margin-top: 3px; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--g-muted); cursor: pointer; }
.g-address-pick:hover { background: var(--g-hover); color: var(--g-ink); }
.g-address-pick svg { width: 15px; height: 15px; }
.g-address-pick:focus-visible { outline: 2px solid var(--g-blue-soft); outline-offset: 2px; }

.g-contact-picker { display: flex; flex-direction: column; gap: 14px; min-height: 100%; }
.g-contact-sub { margin: 3px 0 0; color: var(--ui-muted); font-size: 11.5px; }
.g-contact-search { display: flex; align-items: center; gap: 10px; }
.g-contact-search .ui-input { flex: 1; min-width: 0; }
.g-contact-manage { flex: 0 0 auto; color: var(--ui-brand); font-size: 11.5px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.g-contact-manage:hover { text-decoration: underline; }
.g-contact-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--ui-line); }
.g-contact-tab { margin-bottom: -1px; padding: 8px 10px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--ui-muted); font: 600 12px var(--ui-font); cursor: pointer; }
.g-contact-tab:hover { color: var(--ui-ink); }
.g-contact-tab.active { color: var(--ui-brand); border-bottom-color: var(--ui-brand); }
.g-contact-list { flex: 1 1 auto; min-height: 220px; overflow: auto; display: flex; flex-direction: column; gap: 2px; }
.g-contact-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px; background: none; text-align: left; cursor: pointer; }
.g-contact-row:hover { background: var(--ui-surface-2); }
.g-contact-row.selected { background: var(--ui-brand-soft); }
.g-contact-row.added { opacity: .55; cursor: default; }
.g-contact-avatar { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--ui-surface-2); color: var(--ui-ink-2); font-size: 11px; font-weight: 700; }
.g-contact-main { flex: 1; min-width: 0; }
.g-contact-main strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ui-ink); font-size: 12.5px; }
.g-contact-main span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ui-muted); font-size: 11px; }
.g-contact-state { flex: 0 0 auto; color: var(--ui-muted); font-size: 10.5px; }
.g-contact-row.selected .g-contact-state { color: var(--ui-brand); font-weight: 600; }
.g-contact-empty { padding: 34px 10px; text-align: center; color: var(--ui-muted); font-size: 12px; }
.g-contact-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 10px; border-top: 1px solid var(--ui-line); }
.g-contact-selected { color: var(--ui-muted); font-size: 11.5px; }
.g-link-confirm-root { z-index: 1500; }
.g-link-confirm-url { max-height: 130px; margin: 0 0 18px; padding: 10px 12px; overflow: auto; border: 1px solid var(--ui-line); border-radius: 8px; background: var(--ui-surface-2); color: var(--ui-ink); font: 11.5px/1.6 var(--ui-mono); white-space: pre-wrap; word-break: break-all; }
.g-newmail-toast { position: fixed; top: 78px; right: 20px; z-index: 1400; width: min(360px, calc(100vw - 24px)); display: flex; align-items: flex-start; gap: 12px; padding: 13px 14px; border: 1px solid var(--g-line); border-radius: 14px; background: var(--g-surface); box-shadow: 0 12px 32px rgba(32,33,36,.18); animation: g-newmail-in .2s ease-out; }
@keyframes g-newmail-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.g-newmail-icon { flex: 0 0 auto; display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: #e6f4ea; color: #137333; }
.g-newmail-icon svg { width: 17px; height: 17px; }
.g-newmail-main { flex: 1; min-width: 0; }
.g-newmail-main strong { display: block; color: var(--g-ink); font-size: 12.5px; line-height: 1.5; }
.g-newmail-main span { display: block; margin-top: 2px; color: var(--g-muted); font-size: 11px; }
.g-newmail-view { flex: 0 0 auto; align-self: center; color: var(--g-blue); font-size: 12px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.g-newmail-view:hover { text-decoration: underline; }
.g-newmail-close { flex: 0 0 auto; width: 24px; height: 24px; border: 0; border-radius: 50%; background: none; color: var(--g-muted); font-size: 16px; line-height: 1; cursor: pointer; }
.g-newmail-close:hover { background: var(--g-hover); color: var(--g-ink); }
@media (max-width: 760px) { .g-newmail-toast { top: 72px; right: 12px; } }
.g-address-link { border: 0; background: none; padding: 0; color: inherit; font: inherit; cursor: pointer; text-align: left; }
.g-address-link:hover { color: var(--g-blue); text-decoration: underline; }
.g-address-sep { color: var(--g-muted); }
.g-address-pop { position: fixed; z-index: 1300; width: min(320px, calc(100vw - 24px)); padding: 14px; border: 1px solid var(--g-line); border-radius: 12px; background: var(--g-surface); box-shadow: 0 12px 32px rgba(32,33,36,.18); }
.g-address-pop-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.g-address-pop-avatar { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--g-hover); color: var(--g-ink); font-size: 13px; font-weight: 700; }
.g-address-pop-main { min-width: 0; }
.g-address-pop-main strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--g-ink); font-size: 13px; }
.g-address-pop-main span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--g-muted); font-size: 11.5px; }
.g-address-pop-actions { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.g-address-pop-status { margin-top: 8px; color: var(--g-muted); font-size: 11px; line-height: 1.5; }
.g-address-pop-status.error { color: #c5221f; }
.g-address-pop-status.ok { color: #137333; }
.g-contact-row-item { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 20px; border-bottom: 1px solid #f1f3f4; }
.g-contact-row-item:hover { background: var(--g-hover); }
.g-contact-row-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.g-contact-row-main .g-contact-name-link { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-contact-row-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--g-muted); font-size: 11.5px; }
.g-contact-row-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; }
.g-contact-row-actions form { margin: 0; }
@media (max-width: 760px) {
  .g-contact-row-item { flex-wrap: wrap; gap: 8px 10px; padding: 10px 14px; }
  .g-contact-row-main { flex-basis: calc(100% - 50px); }
  .g-contact-row-actions { width: 100%; padding-left: 40px; }
}
.g-contacts-search { padding: 12px 16px; border-bottom: 1px solid var(--g-line); }
.g-contacts-search .g-search { margin: 0; max-width: none; height: 42px; }
.g-contact-name-link { color: var(--g-ink); font-weight: 600; text-decoration: none; }
.g-contact-name-link:hover { color: var(--g-blue); text-decoration: underline; }
.g-contact-actions { display: flex; align-items: center; gap: 6px; }
.g-contact-actions form { margin: 0; }
@media (max-width: 760px) {
  .g-contact-search { flex-wrap: wrap; }
  .g-address-pick { padding: 0; width: 30px; justify-content: center; }
}

/* Full-width security band, flush with the divider above and below */
.page-mail .g-security-strip { margin: 0; padding: 10px 24px; border: 0; border-bottom: 1px solid var(--g-line); border-radius: 0; background: var(--g-hover); }
@media (max-width: 760px) {
  .page-mail .g-security-strip { padding-left: 14px; padding-right: 14px; }
}

/* Full-width decryption warning band, flush with the card dividers */
.page-mail .g-crypto-warning { margin: 0; padding: 11px 24px; border: 0; border-bottom: 1px solid #f0d9a8; border-radius: 0; background: #fef7e0; color: #8a5a12; font-size: 11.5px; line-height: 1.7; }
@media (max-width: 760px) {
  .page-mail .g-crypto-warning { padding-left: 14px; padding-right: 14px; }
}
.attachment-icon { width: 15px; height: 15px; flex: 0 0 auto; color: var(--g-muted); }
.attachment-icon svg { display: block; width: 15px; height: 15px; }
/* Subject trailing icons inherit the title color (read/unread). */
.g-subject .g-encrypted-shield,
.g-subject .g-clip { color: inherit; }

/* Keep the domain empty-state explanation on one line on desktop. */
.ui-empty-rich p.domain-empty-copy { max-width: 760px; white-space: nowrap; }
@media (max-width: 760px) {
  .ui-empty-rich p.domain-empty-copy { white-space: normal; }
}

/* Recent delivery problems on the admin overview */
.adm-queue-recent { margin-top: 14px; border-top: 1px solid var(--ui-line); }
.adm-queue-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--ui-line); }
.adm-queue-row:last-child { border-bottom: 0; padding-bottom: 0; }
.adm-queue-copy { min-width: 0; }
.adm-queue-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; }
.adm-queue-copy p { margin: 3px 0 0; color: var(--ui-muted); font-size: 10.5px; line-height: 1.55; overflow-wrap: anywhere; }
.adm-queue-hint { display: block; margin-top: 4px; color: var(--ui-warning); font-size: 10.5px; line-height: 1.55; }
