/* The active brand overrides the accent family through /brand/theme.css. */
:root {
  color-scheme: light dark;
  --ground: #f5f5f5;
  --surface: #ffffff;
  --surface-2: #f8f8f8;
  --hover: #eeeeee;
  --ink: #202124;
  --ink-2: #3c4043;
  --muted: #5f6368;
  --faint: #686d72;
  --line: #dadce0;
  --line-strong: #80868b;
  --accent: #0b57d0;
  --accent-hover: #094ab1;
  --accent-soft: #e2ebf9;
  --accent-ink: #ffffff;
  --accent-text: #0b57d0;
  --deep: #202124;
  --deep-ink: #ffffff;
  --success: #137333;
  --success-soft: #e6f4ea;
  --clay-text: #8a4b00;
  --clay-soft: #fef7e0;
  --clay-line: #ead9ad;
  --danger: #b3261e;
  --danger-soft: #fce8e6;
  --danger-line: #efc5c1;
  --focus: rgba(11, 87, 208, 0.32);
  --lift: 0 2px 8px rgba(0, 0, 0, 0.12);
  --font: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #141414;
    --surface: #202020;
    --surface-2: #292929;
    --hover: #303030;
    --ink: #e8eaed;
    --ink-2: #d2d5d9;
    --muted: #b0b3b8;
    --faint: #9aa0a6;
    --line: #3c4043;
    --line-strong: #80868b;
    --accent: #8ab4f8;
    --accent-hover: #9cbff9;
    --accent-soft: #333b47;
    --accent-ink: #000000;
    --accent-text: #8ab4f8;
    --deep: #e8eaed;
    --deep-ink: #202124;
    --success: #81c995;
    --success-soft: #1d3325;
    --clay-text: #fdd663;
    --clay-soft: #332c1c;
    --clay-line: #66512a;
    --danger: #f28b82;
    --danger-soft: #3b2424;
    --danger-line: #69403c;
    --focus: rgba(138, 180, 248, 0.4);
    --lift: 0 2px 8px rgba(0, 0, 0, 0.4);
  }
}

* { box-sizing: border-box; }
html, body, #__next { height: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent-text); }
h1, h2, h3 { text-wrap: balance; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
svg { flex: none; }
form { margin: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; max-width: 100%; padding: 9px 16px; border-radius: 6px; border: 1px solid transparent; font: 600 14px/18px var(--font); cursor: pointer; text-decoration: none; text-align: center; overflow-wrap: anywhere; transition: background-color .15s, border-color .15s; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-outline { background: transparent; color: var(--accent-text); border-color: var(--line-strong); }
.btn-outline:hover { background: var(--accent-soft); }
.btn-text { background: transparent; color: var(--accent-text); padding-inline: 14px; }
.btn-text:hover { background: var(--accent-soft); }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--danger-line); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-sm { min-height: 36px; padding-block: 8px; font-size: 13.5px; }

/* A real label remains visible when focus, a value or autofill replaces the placeholder. */
.field {
  position: relative;
  min-width: 0;
  margin-top: 22px;
}
.field input, .smtp-connection select {
  display: block;
  width: 100%;
  height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font: 16px/1.2 var(--font);
}
.field label {
  position: absolute;
  top: 50%;
  left: 9px;
  max-width: calc(100% - 24px);
  padding: 0 4px;
  transform: translateY(-50%);
  color: var(--ink-2);
  font: 400 14px/1.25 var(--font);
  cursor: text;
  transition: top .15s, font-size .15s, color .15s;
}
.field input:focus + label,
.smtp-connection select + label,
.field input:not(:placeholder-shown) + label,
.field input:autofill + label {
  top: 0;
  background: var(--surface);
  font-size: 12px;
}
.field input:focus, .smtp-connection select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
  outline: none;
}
.field input:focus + label, .smtp-connection select:focus + label { color: var(--accent-text); }
.field.code input {
  font: 500 20px/1 var(--mono);
  letter-spacing: .2em;
}
.hint { margin: 7px 16px 0; font-size: 12.5px; color: var(--muted); }
.err { display: flex; gap: 7px; align-items: flex-start; margin: 12px 4px 0; font-size: 13.5px; line-height: 1.45; color: var(--danger); }
.err svg { margin-top: 2px; }

/* Notes */
.note { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 13px 15px; border-radius: 6px; font-size: 14px; line-height: 1.5; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); }
.note svg { margin-top: 2px; }
.note[hidden] { display: none; }
.note.ok { background: var(--success-soft); border-color: transparent; color: var(--success); }
.note.once { background: var(--clay-soft); border-color: var(--clay-line); color: var(--clay-text); }
.note.bad { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger); }
.note + .note { margin-top: 12px; }
.setup-owner-note { margin-top: 12px; }

.setup-mail {
  min-width: 0;
  margin-top: 20px;
  border-block: 1px solid var(--line);
}
.setup-mail summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 8px 4px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.setup-mail summary::-webkit-details-marker { display: none; }
.setup-mail summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  margin-inline-end: 4px;
  transform: rotate(45deg);
}
.setup-mail[open] summary::after { transform: rotate(225deg); }
.setup-mail[open] { padding-bottom: 16px; }
.setup-mail-opt-in { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.setup-mail-opt-in input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.smtp-fields { display: grid; gap: 18px; padding-top: 12px; }
.smtp-fields .field { margin: 0; }
.smtp-connection { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 155px), 1fr)); gap: 18px 12px; }
.smtp-connection select { cursor: pointer; }
.smtp-connection select + label { cursor: pointer; }
.setup-mail-hint { margin: 10px 0 0; }

/* Brand */
.mark { width: 44px; height: 44px; }
.logo { display: block; height: 40px; width: auto; max-width: 240px; }
.brand-name { font-size: 18px; font-weight: 600; color: var(--ink); }

/* The introduction and form share a row on desktop and one reading order on small screens. */
.auth {
  min-height: 100%;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 880px);
  grid-template-rows: 1fr auto 1fr;
  justify-items: center;
  align-items: start;
  justify-content: center;
  padding: 40px 16px;
}
.auth-card {
  grid-row: 2;
  width: 100%;
  max-width: 880px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 32px;
}
.auth-grid {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  gap: 40px;
  align-items: start;
}
.auth-content {
  display: grid;
  gap: 16px;
  min-width: 0;
}
.auth-brand {
  display: flex;
  align-items: center;
  width: fit-content;
  margin-bottom: 24px;
  text-decoration: none;
}
.sign-in-account { display: grid; gap: 8px; margin-top: 16px; font-size: 14px; overflow-wrap: anywhere; }
.sign-in-account .textlink { width: fit-content; }
.sign-in-methods { display: grid; gap: 10px; border-top: 1px solid var(--line); padding-top: 20px; margin-top: 4px; }
.sign-in-methods h2 { margin: 0 0 2px; font-size: 13px; font-weight: 500; color: var(--muted); }
.sign-in-methods .btn { width: 100%; }
.auth-brand .mark { width: 32px; height: 32px; }
.auth-brand .logo { height: 32px; max-width: 200px; }
.auth-brand .brand-name { font-size: 16px; }
.auth-intro h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -.015em;
}
.auth-intro .lead { margin: 16px 0 0; font-size: 16px; color: var(--ink-2); max-width: 36ch; }
.auth-intro .lead strong { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.auth-form { display: flex; flex-direction: column; min-width: 0; }
.auth-form > p { overflow-wrap: anywhere; }
.auth-form > p:empty { display: none; }
.auth-form > .btn-primary { align-self: flex-end; margin-top: 20px; }
.auth-content > .btn-primary { justify-self: end; }
.auth-form > .field:first-child,
.auth-form > input[type="hidden"] + .field,
.auth-form > .note:first-child { margin-top: 0; }
.auth-form .grow { min-height: 0; }
.auth-form p.body { flex: none; display: block; padding: 0; margin: 12px 0 0; color: var(--ink-2); }
.actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 28px; flex-wrap: wrap; }
.auth-form .actions { margin-top: 20px; }
.auth-content > .actions { margin-top: 0; }
.actions .left { margin-right: auto; }
.auth-content .actions .left { margin-right: 0; }
.auth-foot { grid-row: 3; width: 100%; max-width: 880px; display: flex; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap; margin-top: 8px; padding: 0 4px; font-size: 12.5px; color: var(--muted); }
.auth-foot nav, .auth-foot .foot-left { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.auth-foot a { color: var(--muted); }
.auth-compact .auth-card, .auth-compact .auth-foot { max-width: 440px; }
.auth-compact .auth-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
.auth-compact .auth-intro h1 { font-size: 24px; }

.auth.setup-page { grid-template-rows: auto auto; align-content: center; padding-block: clamp(16px, 3vw, 32px); }
.setup-page .auth-card, .setup-page .auth-foot { max-width: 780px; }
.setup-page .auth-card { grid-row: 1; }
.setup-page .auth-foot { grid-row: 2; }
.setup-page .auth-brand { margin-bottom: 12px; }
.setup-page .auth-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
.setup-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
}
.setup-steps li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 0 10px;
  border-bottom: 2px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}
.setup-steps li[aria-current] { border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.setup-steps li span {
  display: grid;
  flex: none;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface-2);
  font-size: 12px;
}
.setup-steps li[aria-current] span { color: var(--accent-ink); background: var(--accent); }
.setup-fields, .setup-review, .setup-step-form .smtp-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 18px 16px;
}
.setup-full-width { grid-column: 1 / -1; }
.setup-fields .field { margin: 0; }
.setup-fields:empty { display: none; }
.setup-step-form .hint { margin-inline: 0; overflow-wrap: anywhere; }
.setup-review { margin: 0; }
.setup-review dt { color: var(--muted); font-size: 13px; }
.setup-review dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.setup-review + .setup-fields { margin-top: 20px; }
.setup-step-actions { display: flex; flex-direction: row-reverse; justify-content: space-between; gap: 8px; margin-top: 20px; }
.setup-step-actions > .btn { min-height: 44px; }

@media (max-width: 640px) {
  .setup-fields, .setup-review, .setup-step-form .smtp-fields { grid-template-columns: minmax(0, 1fr); }
  .setup-review { gap: 6px; }
  .setup-steps li { flex-direction: column; text-align: center; gap: 4px; font-size: 13px; }
}

.account-picker { display: grid; gap: 12px; }
.account-picker-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.account-picker-list .account-row { border-radius: 0; min-height: 62px; }
.account-picker-list .account-row + .account-row { border-top: 1px solid var(--line); }
.account-picker-list a.account-row { color: var(--accent-text); }
.language-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 6px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  cursor: pointer;
}
.language-picker svg { transform: rotate(90deg); }
.language-picker:hover,
.language-picker:has(+ .language-options:popover-open) { background: var(--hover); }
.language-options {
  position: fixed;
  min-width: 150px;
  margin: auto;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  box-shadow: var(--lift);
}
@supports (position-area: block-start span-inline-end) {
  .language-options {
    position-area: block-start span-inline-end;
    position-try-fallbacks: flip-block;
    justify-self: start;
    margin: 0;
    margin-block-end: 4px;
  }
}
.language-options button {
  display: block;
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  text-align: start;
  cursor: pointer;
}
.language-options button:hover { background: var(--hover); }
.language-options button[aria-pressed="true"] {
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 600;
}
.language-setting {
  display: grid;
  gap: 8px;
  max-width: 280px;
  margin-top: 16px;
}
.language-setting select {
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}
.textlink { color: var(--accent-text); font-weight: 600; font-size: 14px; text-decoration: none; }
.textlink:hover { text-decoration: underline; }
.address { margin: 4px 0 0; font: 500 15px/1.5 var(--mono); padding: 10px 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; overflow-wrap: anywhere; }

/* Account centre */
.shell { min-height: 100%; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 5; height: 64px; display: flex; align-items: center; gap: 12px; padding: 0 20px; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar .brand { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--ink); text-decoration: none; font-size: 18px; }
.topbar .brand .mark { width: 30px; height: 30px; }
.topbar .brand .logo { height: 30px; }
.topbar .brand .section { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spacer { flex: 1; }
.avatar { display: grid; place-items: center; border-radius: 50%; background: var(--deep); color: var(--deep-ink); font-weight: 600; flex: none; }
.avatar.sm { width: 36px; height: 36px; font-size: 13px; }
.avatar.lg { width: 48px; height: 48px; font-size: 20px; font-weight: 500; }
.topbar .icon-btn.me-trigger, .me-menu-header .icon-btn {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.topbar .icon-btn.me-trigger:hover, .topbar:has(.me-menu:popover-open) .me-trigger,
.me-menu-header .icon-btn:hover { background: var(--hover); }
.me-menu {
  position: fixed;
  inset: 58px 20px auto auto;
  width: min(400px, calc(100% - 40px));
  max-height: calc(100dvh - 74px);
  margin: 0;
  padding: 8px 15px 15px;
  overflow: auto;
  overscroll-behavior: contain;
  color: var(--ink);
  background: var(--accent-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--lift);
}
.me-menu-header { display: flex; justify-content: flex-end; margin-bottom: 4px; }
.me-menu-group { display: grid; gap: 2px; border-radius: 8px; overflow: hidden; }
.account-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 10px 16px;
  border: 0;
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  font: 500 14px/1.35 var(--font);
  text-align: start;
  text-decoration: none;
}
:is(a, button).account-row { cursor: pointer; }
:is(a, button).account-row:hover { background: var(--surface-2); }
.account-row:focus-visible { outline-offset: -4px; }
.me-current { gap: 16px; padding-block: 14px; }
.me-current .avatar { width: 56px; height: 56px; font-size: 20px; font-weight: 500; }
.account-identity { display: grid; flex: 1; min-width: 0; gap: 2px; overflow-wrap: anywhere; }
.me-current .account-name { font-size: 19px; }
.account-email { font-size: 13px; font-weight: 400; color: var(--muted); }
.me-current .account-email { font-size: 14px; }
.account-row-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--accent-text);
  background: var(--accent-soft);
}
.me-menu-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 20px; margin-top: 14px; font-size: 12px; }
.me-menu-links a { color: var(--ink-2); text-decoration: none; }
.me-menu-links a:hover { text-decoration: underline; }

.body { flex: 1; display: flex; gap: 32px; padding: 8px 20px 64px; }
.rail { width: 224px; flex: none; position: sticky; top: 72px; align-self: flex-start; display: flex; flex-direction: column; gap: 2px; }
.rail a { display: flex; align-items: center; gap: 16px; height: 44px; padding: 0 16px; border-radius: 6px; color: var(--ink-2); text-decoration: none; font-size: 14.5px; font-weight: 500; }
.rail a:hover { background: var(--hover); }
.rail a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-text); }
.topbar .mobile-nav-trigger, .mobile-account-nav { display: none; }
.main { flex: 1; min-width: 0; }
.content { max-width: 760px; margin: 0 auto; }

.page-head { margin: 8px 0 28px; }
.page-head h1 { margin: 0; font-size: 26px; line-height: 1.25; font-weight: 600; letter-spacing: -.01em; }
.page-head p { margin: 8px 0 0; color: var(--muted); max-width: 62ch; }
.sub-head { display: flex; align-items: center; gap: 8px; margin: 0 0 8px -12px; }
.sub-head h1 { margin: 0; font-size: 26px; font-weight: 400; letter-spacing: -.01em; }
.sub-lead { margin: 0 0 24px; color: var(--muted); max-width: 62ch; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-2); text-decoration: none; }
.icon-btn:hover { background: var(--hover); }

.hero { display: flex; flex-direction: column; align-items: flex-start; padding: 24px 0; }
.hero h1 { margin: 16px 0 2px; font-size: 26px; font-weight: 600; }
.hero p { margin: 0; color: var(--muted); overflow-wrap: anywhere; }

.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.card.wide { grid-column: 1 / -1; }
.card-top { display: flex; align-items: flex-start; gap: 16px; }
.card-top > div { flex: 1; min-width: 0; }
.card h2, .card-top h2 { margin: 0; font-size: 18px; font-weight: 500; line-height: 1.35; }
.card p, .card-top p { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.badge { width: 48px; height: 48px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); flex: none; }
.badge.warn { background: var(--clay-soft); color: var(--clay-text); }
.card .foot { margin-top: auto; padding-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.mini { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.mini li { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.mini .ic { color: var(--muted); }
.mini .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini .d { color: var(--muted); font-size: 13px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.panel h2 { font-size: 18px; font-weight: 500; line-height: 1.35; }
.panel + .panel, .panel + .note, .note + .panel, .panel + form, .panel + .small { margin-top: 20px; }
.note + .note, .content > .note { margin-bottom: 20px; }
.panel-head { padding: 22px 24px 8px; }
.panel-head h2 { margin: 0; font-size: 18px; font-weight: 500; }
.panel-head p { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.rows { list-style: none; margin: 0; padding: 4px 0 8px; }
.rows > li + li { border-top: 1px solid var(--line); }
.row { display: flex; align-items: center; gap: 16px; min-height: 68px; padding: 12px 24px; color: inherit; text-decoration: none; }
a.row:hover { background: var(--hover); }
.row .ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); flex: none; }
.row .k { width: 190px; flex: none; font-size: 14px; color: var(--muted); }
.row .v { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.row .t { font-size: 15px; font-weight: 500; }
.row .d { font-size: 13.5px; color: var(--muted); }
.row .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.row h2 { margin: 0 0 8px; }
.row p { margin: 8px 0 0; }
.chev { color: var(--faint); display: grid; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; }
.status.on { color: var(--success); }
.status.off { color: var(--clay-text); }
.pill { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-text); font-size: 12px; font-weight: 600; vertical-align: 2px; }
.small { font-size: 13px; color: var(--muted); }

.form-pad { padding: 8px 24px 24px; }
.panel > .form-pad + .form-pad { border-top: 1px solid var(--line); }
.form-pad p { overflow-wrap: anywhere; }
.form-pad > .card-top { margin-top: 16px; }
.form-pad .field { max-width: 440px; }
.form-pad .actions { justify-content: flex-start; }
.email-setting { padding: 16px 20px 4px; }
.email-setting + .email-setting { border-top: 1px solid var(--line); }
.email-setting-header { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 12px; }
.email-setting-header h2 { margin: 0; font-size: 16px; }
.email-setting-address { min-width: 0; overflow-wrap: anywhere; }
.email-setting-description { margin: 4px 0 0; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.email-settings-edit > summary {
  display: list-item;
  width: fit-content;
  max-width: 100%;
  min-height: 44px;
  padding-block: 10px;
  list-style-position: inside;
  color: var(--accent-text);
  cursor: pointer;
}
.email-settings-edit > summary:hover { text-decoration: underline; }
.email-settings-edit > form { padding-bottom: 12px; }
.email-settings-edit .field { max-width: 440px; margin-top: 12px; }
.email-settings-edit .actions { justify-content: flex-start; margin-top: 12px; }
.form-pad > p:first-child { margin-top: 16px; }
.choice-row { display: flex; align-items: center; gap: 12px; min-height: 48px; cursor: pointer; }
.choice-row input { width: 18px; height: 18px; accent-color: var(--accent); }

.setup { display: grid; grid-template-columns: 224px minmax(0, 1fr); gap: 32px 32px; padding: 16px 24px 24px; }
.setup .actions { justify-content: flex-start; }
.setup .cancel-setup { grid-column: 2; margin-top: -20px; }
@media (max-width: 860px) { .setup .cancel-setup { grid-column: 1; } }
/* A light ground in both themes: most phone cameras will not read a dark-on-dark code. */
.qr { width: 224px; height: 224px; max-width: 100%; padding: 12px; background: #ffffff; border: 1px solid var(--line); border-radius: 8px; display: block; }
code.key { display: block; margin: 6px 0 0; font: 500 15px/1.5 var(--mono); letter-spacing: .08em; padding: 10px 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; overflow-wrap: anywhere; }
.codes { list-style: none; margin: 16px 0 0; padding: 20px 24px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 32px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; }
.codes code { font: 500 16px/1.4 var(--mono); letter-spacing: .06em; font-variant-numeric: tabular-nums; }

details.more > summary { list-style: none; cursor: pointer; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary .chev { transition: transform .15s; }
details.more[open] > summary .chev { transform: rotate(90deg); }
details.more[open] > summary { background: var(--hover); }

@media (max-width: 860px) {
  .topbar { height: 60px; border-bottom: 0; }
  .shell > .body { flex-direction: column; gap: 12px; padding-block: 0 36px; }
  .rail {
    position: static;
    align-self: stretch;
    width: auto;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 4px;
    margin-inline: -20px;
    padding: 2px 20px 6px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
  }
  .rail a {
    position: relative;
    justify-content: center;
    min-width: 0;
    min-height: 44px;
    height: auto;
    padding: 4px 6px 6px;
    font-size: 14px;
    line-height: 1.25;
    text-align: center;
    overflow-wrap: anywhere;
  }
  .rail a svg { display: none; }
  .rail a:hover { background: var(--surface-2); }
  .rail a[aria-current="page"] { background: transparent; font-weight: 650; }
  .rail a[aria-current="page"]::after {
    content: "";
    position: absolute;
    inset-block-end: 0;
    inset-inline-start: calc(50% - 14px);
    width: 28px;
    border-block-end: 2px solid currentColor;
  }
  .rail a:focus-visible { outline: 2px solid var(--accent-text); outline-offset: -2px; }
  .content .page-head { margin: 8px 0 16px; }
  .content .page-head h1, .content .sub-head h1 { font-size: 23px; }
  .content .sub-lead { margin-bottom: 14px; }
  .content .panel + :is(.panel, .note, form, .small), .content .note + .panel { margin-top: 12px; }
  .content > .note { margin-bottom: 12px; }
  .content .panel-head { padding: 14px 16px 6px; }
  .content .rows { padding-block: 0; }
  .content .row { gap: 6px 10px; min-height: 56px; padding: 8px 16px; }
  .content .row .ic { width: 34px; height: 34px; }
  .content .row h2, .content .row p { margin-block: 4px; }
  .content .form-pad { padding: 8px 16px 16px; }
  .content .form-pad > p:first-child { margin-top: 8px; }
  .content .form-pad > .card-top { margin-top: 8px; }
  .content .field { margin-top: 14px; }
  .content .actions { margin-top: 14px; }
  .content .btn { min-height: 44px; }
  .content .codes { gap: 8px 16px; padding: 12px 16px; }
  .cards { gap: 12px; }
  .card { gap: 8px; padding: 14px 16px; }
  .card-top { align-items: center; gap: 10px; }
  .card-top h2 { font-size: 16px; }
  .card-top .badge { width: 36px; height: 36px; }
  .card-top .badge svg { width: 20px; height: 20px; }
  .card .foot { padding-top: 4px; }
  .email-setting { padding: 12px 16px 2px; }
  .setup { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .auth { padding-block: 16px; }
  .auth-card { padding: 24px; border-radius: 8px; }
  .auth-card, .auth-foot { max-width: 440px; }
  .auth-grid { grid-template-columns: 1fr; min-height: 0; gap: 16px; }
  .auth-intro h1 { font-size: 24px; }
  .auth-content .actions .left { margin-right: auto; padding-inline: 0; }
  .row .k { width: 120px; }
}
@media (max-width: 560px) {
  .rail { display: none; }
  .topbar { height: 56px; gap: 8px; border-bottom: 1px solid var(--line); }
  .topbar .brand { gap: 6px; font-size: 16px; }
  .topbar .brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar .brand picture { min-width: 0; }
  .topbar .brand .logo { max-width: 100%; object-fit: contain; }
  .topbar .mobile-nav-trigger {
    display: grid;
    flex: none;
    margin-inline-start: -8px;
    border: 0;
    background: transparent;
    cursor: pointer;
  }
  .topbar .mobile-nav-trigger:hover,
  .topbar:has(.mobile-account-nav:popover-open) .mobile-nav-trigger { background: var(--hover); }
  .mobile-account-nav:popover-open {
    display: grid;
    position: fixed;
    inset: 54px auto auto 12px;
    width: min(280px, calc(100% - 24px));
    max-height: calc(100dvh - 66px);
    margin: 0;
    padding: 6px;
    overflow: auto;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--lift);
  }
  .mobile-account-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 6px 12px;
    border-radius: 6px;
    color: var(--ink-2);
    font-size: 14px;
    text-decoration: none;
  }
  .mobile-account-nav a:hover { background: var(--hover); }
  .mobile-account-nav a[aria-current="page"] { color: var(--accent-text); background: var(--accent-soft); }
  .shell > .body { padding-top: 12px; }
  .hero { flex-direction: row; align-items: center; gap: 12px; padding: 4px 0 20px; }
  .hero .avatar { width: 40px; height: 40px; font-size: 16px; }
  .hero > div { min-width: 0; }
  .hero h1 { margin: 0; font-size: 21px; overflow-wrap: anywhere; }
  .hero p { margin-top: 2px; font-size: 14px; }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .mini li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 9px; }
  .mini .t { white-space: normal; overflow-wrap: anywhere; }
  .mini .d { grid-column: 2; }
}
@media (max-width: 520px) {
  .topbar, .shell > .body { padding-inline: 16px; }
  .me-menu { right: 16px; width: min(400px, calc(100% - 32px)); }
  .rail { margin-inline: -16px; padding-inline: 16px; }
  .content .row { padding-inline: 14px; flex-wrap: wrap; row-gap: 4px; }
  .row .k { width: 100%; }
  .row:has(> form) > .grow { flex-basis: 9rem; }
  .row > form { display: flex; justify-content: flex-end; margin-inline-start: auto; max-width: 100%; }
  .codes { grid-template-columns: 1fr; }
  .actions .left { margin-right: 0; order: 2; width: 100%; text-align: center; }
  .auth-content .actions .left { order: 0; width: auto; }
  .auth-content .actions .btn-primary { flex: 0 1 auto; }
}
@media (max-width: 360px) {
  .topbar .brand .section { display: none; }
  .auth-card { padding: 24px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .btn, .field input, .field label, details.more > summary .chev { transition: none; }
}
