/* Shared palette, header and settings from the supplied portal reference. Main host only. */
:root {
  --bg: #f1f3f6;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --text: #0f1419;
  --text-2: #6b7480;
  --header-link: #6b7480;
  --settings-surface: rgba(255, 255, 255, .86);
  --settings-active: color-mix(in srgb, var(--text) 9%, transparent);
  --settings-shadow: inset 0 1px 0 rgba(255,255,255,.75), inset 0 0 0 1px rgba(255,255,255,.3), 0 2px 6px rgba(16,24,40,.06), 0 18px 40px rgba(16,24,40,.16);
  --text-3: #9aa3ad;
  --external-link: #9aa3ad;
  --front-edge: rgba(0, 0, 0, .06);
  --front-rim: rgba(255, 255, 255, .75);
  --front-header: rgba(15, 20, 25, .1);
  --line: #e4e7eb;
  --side-divider: #d0d6de;
  --accent: #1d98dc;
  --accent-strong: #0e8ed4;
  --accent-hover: #0e8ed4;
  --accent-soft: #e8f5fd;
  --danger: #e5484d;
  --danger-strong: #d43a3f;
  --danger-soft: #fdecec;
  --success: #30a46c;
  --success-soft: #e9f6ef;
  --warn-soft: #fff6e0;
  --warn: #b97a00;
  --warn-callout-text: #483813;
  --danger-fg: var(--danger);
  --callout-text: var(--text-2);
  --radius: 16px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);
  --mono: "SF Mono", "JetBrains Mono", ui-monospace, Menlo, monospace;
  --win-glass: rgba(255, 255, 255, .42); --win-rim: rgba(255, 255, 255, .75); --win-edge: rgba(0, 0, 0, .06);
  --divider: rgba(0, 0, 0, .06);
  --bg-glass: rgba(255, 255, 255, .78);
  --icon-muted: #8e919b;
  --avatar-fg: var(--text-2); --avatar-bg: color-mix(in srgb, var(--text) 8%, transparent);
  --win-back: color-mix(in srgb, var(--text) 1.5%, var(--surface));
  --ico-fill: 14%; --ico-edge: 22%; --ico-rim: rgba(255, 255, 255, .5);
  --chat-in: color-mix(in srgb, var(--text) 18%, transparent);
  --art-chat-mask: none;
  --art-code-mask: none;
  --art-header-line: color-mix(in srgb, var(--text) 10%, transparent);
  color-scheme: light;
}

@property --theme-hole-radius {
  syntax: '<percentage>';
  inherits: false;
  initial-value: 0%;
}
::view-transition-group(root) { isolation: isolate; overflow: hidden; }
::view-transition-image-pair(root) { isolation: auto; overflow: hidden; }
::view-transition-old(root),
::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-old(root) { z-index: 0; }
::view-transition-new(root) { z-index: 1; }
:root.theme-reveal::view-transition-old(root) {
  -webkit-mask-image: radial-gradient(circle farthest-corner at var(--theme-origin-x, 50%) var(--theme-origin-y, 50%),
    transparent 0, transparent var(--theme-hole-radius), #000 calc(var(--theme-hole-radius) + 1px));
  mask-image: radial-gradient(circle farthest-corner at var(--theme-origin-x, 50%) var(--theme-origin-y, 50%),
    transparent 0, transparent var(--theme-hole-radius), #000 calc(var(--theme-hole-radius) + 1px));
}
:root.theme-reveal::view-transition-new(root) { z-index: 1; }
:root.theme-collapse::view-transition-old(root) {
  -webkit-mask-image: radial-gradient(circle farthest-corner at var(--theme-origin-x, 50%) var(--theme-origin-y, 50%),
    #000 0, #000 var(--theme-hole-radius), transparent calc(var(--theme-hole-radius) + 1px));
  mask-image: radial-gradient(circle farthest-corner at var(--theme-origin-x, 50%) var(--theme-origin-y, 50%),
    #000 0, #000 var(--theme-hole-radius), transparent calc(var(--theme-hole-radius) + 1px));
}
:root.theme-collapse::view-transition-new(root) { z-index: 1; }
::view-transition { pointer-events: none; }
::view-transition-group(api-ink),
::view-transition-image-pair(api-ink),
::view-transition-new(api-ink) { animation: none; mix-blend-mode: normal; }
::view-transition-old(api-ink) { display: none; }

body.site-modern .back_to_top .icon-to-top { display:inline-block; width:16px; height:16px; margin:0 8px 0 0; vertical-align:-3px; background:none; -webkit-mask:none; mask:none; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
body.site-modern .back_to_top_wrap:focus-visible .back_to_top { box-shadow:inset 0 0 0 2px var(--accent); }
@media (prefers-reduced-motion: no-preference) {
  html.anim .page section > .head,
  html.anim .page section > .card,
  html.anim .home-head,
  html.anim .home-card > .opt-row,
  html.anim .auth > div > .hero-logo,
  html.anim .auth > div > h1,
  html.anim .auth > div > p,
  html.anim .auth > div > .card { opacity: 0; }
  html.anim body { overflow-anchor: none; }
}
/* held only for the frames around a colour change by the theme wipe: hovers and other
   transitions keep working during the wipe itself */
html.theme-switching *, html.theme-switching *::before, html.theme-switching *::after { transition: none !important; }

/* Animate each palette colour once at the root, rather than repeatedly on nested text. */
@property --bg { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --surface { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --surface-2 { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --text { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --text-2 { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --text-3 { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --line { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --side-divider { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --accent { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --accent-strong { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --accent-hover { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --accent-soft { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --danger-strong { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --danger-soft { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --success-soft { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --warn { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --warn-soft { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --win-glass { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --win-rim { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --win-edge { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --divider { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --bg-glass { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --icon-muted { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --ico-rim { syntax: '<color>'; inherits: true; initial-value: transparent; }
html.theme-color-fade { transition: --bg .22s ease,
    --surface .22s ease,
    --surface-2 .22s ease,
    --text .22s ease,
    --text-2 .22s ease,
    --text-3 .22s ease,
    --line .22s ease,
    --side-divider .22s ease,
    --accent-soft .22s ease,
    --danger-strong .22s ease,
    --danger-soft .22s ease,
    --success-soft .22s ease,
    --warn .22s ease,
    --warn-soft .22s ease,
    --win-glass .22s ease,
    --win-rim .22s ease,
    --win-edge .22s ease,
    --divider .22s ease,
    --bg-glass .22s ease,
    --icon-muted .22s ease,
    --ico-rim .22s ease !important; }
html.theme-color-fade body, html.theme-color-fade body *,
html.theme-color-fade body *::before, html.theme-color-fade body *::after {
  transition: opacity .22s ease, transform .28s cubic-bezier(.2, 0, 0, 1) !important;
}
html.theme-color-fade .header-links a { transition: color .22s ease !important; }
html.theme-color-fade .mob-back, html.theme-color-fade .sm-link-ico, html.theme-color-fade .sm-link-ext { transition: color .22s ease, opacity .15s ease !important; }
html.theme-color-fade .opt-sub { transition: color .22s ease !important; }
html.theme-color-fade .opt-art.front { transition: border-color .22s ease, box-shadow .22s ease, transform .8s cubic-bezier(.16, 1, .3, 1) !important; }
html.theme-color-fade .opt-art.front .art-bar { transition: border-color .22s ease !important; }


@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17212b; --surface: #232e3c; --surface-2: #2b3847; --settings-surface: rgba(35, 46, 60, .86); --text: #e9edf1; --text-2: #828d99; --header-link: #828d99; --text-3: #66717d;
    --line: rgba(255,255,255,.08); --side-divider: #2a333c; --accent: #3390ec; --accent-strong: #5eb0f3; --accent-hover: #5eb0f3; --accent-soft: rgba(51, 144, 236, .16);
    --external-link: #66717d;
    --settings-active: var(--surface-2);
    --front-edge: rgba(0, 0, 0, .3); --front-rim: rgba(255, 255, 255, .14); --front-header: rgba(255, 255, 255, .084);
    --settings-shadow: inset 0 1px 0 rgba(255,255,255,.14), inset 0 0 0 1px rgba(255,255,255,.056), 0 2px 6px transparent, 0 18px 40px rgba(0,0,0,.45);
    --danger-strong: #f06a6e; --danger-fg: #f27578; --danger-soft: #3a1d22;
    --success-soft: #16301f; --warn: #f0b54a; --warn-soft: rgba(240, 181, 74, .13);
    --callout-text: var(--text); --warn-callout-text: var(--text);
    --win-glass: rgba(33, 42, 51, .45); --win-rim: rgba(255, 255, 255, .14); --win-edge: rgba(0, 0, 0, .3);
  --divider: rgba(255, 255, 255, .08);
    --bg-glass: rgba(33, 42, 51, .78); --icon-muted: #c5cad2;
    --win-back: color-mix(in srgb, var(--text) 3%, var(--bg));
    --ico-fill: 20%; --ico-edge: 30%; --ico-rim: rgba(255, 255, 255, .12);
    --chat-in: color-mix(in srgb, var(--text) 10%, transparent);
    --art-chat-mask: linear-gradient(to bottom, transparent 0, #000 12px);
    --art-code-mask: linear-gradient(to bottom, transparent 0, #000 10px);
    --art-header-line: color-mix(in srgb, var(--win-rim) 60%, transparent);
    --avatar-fg: var(--icon-muted); --avatar-bg: color-mix(in srgb, var(--text) 12%, transparent);
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #17212b; --surface: #232e3c; --surface-2: #2b3847; --settings-surface: rgba(35, 46, 60, .86); --text: #e9edf1; --text-2: #828d99; --header-link: #828d99; --text-3: #66717d;
  --line: rgba(255,255,255,.08); --side-divider: #2a333c; --accent: #3390ec; --accent-strong: #5eb0f3; --accent-hover: #5eb0f3; --accent-soft: rgba(51, 144, 236, .16);
  --external-link: #66717d;
  --settings-active: var(--surface-2);
  --front-edge: rgba(0, 0, 0, .3); --front-rim: rgba(255, 255, 255, .14); --front-header: rgba(255, 255, 255, .084);
  --settings-shadow: inset 0 1px 0 rgba(255,255,255,.14), inset 0 0 0 1px rgba(255,255,255,.056), 0 2px 6px transparent, 0 18px 40px rgba(0,0,0,.45);
  --danger-strong: #f06a6e; --danger-fg: #f27578; --danger-soft: #3a1d22;
  --success-soft: #16301f; --warn: #f0b54a; --warn-soft: rgba(240, 181, 74, .13);
  --callout-text: var(--text); --warn-callout-text: var(--text);
  --win-glass: rgba(33, 42, 51, .45); --win-rim: rgba(255, 255, 255, .14); --win-edge: rgba(0, 0, 0, .3);
  --divider: rgba(255, 255, 255, .08);
  --bg-glass: rgba(33, 42, 51, .78); --icon-muted: #c5cad2;
  --win-back: color-mix(in srgb, var(--text) 3%, var(--bg));
  --ico-fill: 20%; --ico-edge: 30%; --ico-rim: rgba(255, 255, 255, .12);
  --chat-in: color-mix(in srgb, var(--text) 10%, transparent);
  --art-chat-mask: linear-gradient(to bottom, transparent 0, #000 12px);
  --art-code-mask: linear-gradient(to bottom, transparent 0, #000 10px);
  --art-header-line: color-mix(in srgb, var(--win-rim) 60%, transparent);
  --avatar-fg: var(--icon-muted); --avatar-bg: color-mix(in srgb, var(--text) 12%, transparent);
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25); color-scheme: dark;
}

/* ---------- top bar ---------- */
.topbar {
  transition: opacity .2s ease;
  position: sticky; top: 0; z-index: 10;
  height: 64px;
  background: var(--bg-glass);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--divider);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .topbar { background: var(--surface); }
}
.topbar-inner {
  max-width: 1040px; margin: 0 auto; padding: 0 24px; height: 100%;
  display: flex; align-items: center; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -.01em; color: var(--text); text-decoration: none; }
.brand-logo { width: 32px; height: 32px; display: block; overflow: visible; flex: none; }
.brand-logo .logo-plane { transform-box: fill-box; transform-origin: center; }
.header-links { display: flex; align-items: center; gap: 2px; margin-right: 4px; }
.header-links:has(+ .settings) { margin-right: -4px; }
.header-links a { padding: 7px 12px; border-radius: 10px; color: var(--header-link); text-decoration: none; font-size: 14px; font-weight: 500; transition: color .15s; }
.header-links a:hover { color: var(--text); }
.topbar .spacer { flex: 1; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--avatar-bg); color: var(--avatar-fg); text-align: center; line-height: 32px; font-weight: 600; font-size: 14px; letter-spacing: .02em; -webkit-user-select: none; user-select: none; flex: none; }
.avatar.two { font-size: 12.5px; letter-spacing: 0; }

/* ---------- settings menu (gear in the top bar) ---------- */
.settings { position: relative; flex: none; }
.gear-btn { width: 32px; height: 32px; border-radius: 9px; border: 0; background: transparent; color: var(--text-2); display: grid; place-items: center; cursor: pointer; transition: color .15s, background .15s; flex: none; }
.gear-btn:hover, .settings.open .gear-btn { background: var(--surface-2); color: var(--text); }
.settings.open .gear-btn { background: var(--settings-active); }
.gear-btn svg { width: 18px; height: 18px; transition: transform .35s cubic-bezier(.2, 0, 0, 1); }
@media (max-width: 640px) {
  .gear-btn { width: 44px; height: 44px; border-radius: 12px; margin-right: -6px; }
  .gear-btn svg { width: 24px; height: 24px; }
}
.settings-menu {
  position: fixed; right: 24px; top: 60px; width: 272px; z-index: 40; padding: 8px;
  background: var(--settings-surface); border-radius: 18px;
  -webkit-backdrop-filter: blur(30px) saturate(140%); backdrop-filter: blur(30px) saturate(140%);
  border: 1px solid var(--win-edge);
  box-shadow: var(--settings-shadow);
  opacity: 0; transform: translateY(-6px) scale(.97); transform-origin: top right; visibility: hidden;
  transition: opacity .16s ease, transform .2s cubic-bezier(.2, 0, 0, 1), visibility 0s .2s;
}
.settings-menu.open { opacity: 1; transform: none; visibility: visible; transition: opacity .16s ease, transform .2s cubic-bezier(.2, 0, 0, 1), visibility 0s; }
@media (min-width: 641px) {
  html.theme-color-fade .settings-menu { transition: background-color .22s ease, box-shadow .22s ease, opacity .16s ease, transform .2s cubic-bezier(.2, 0, 0, 1) !important; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .settings-menu, .settings-menu .theme-seg { background: var(--surface); }
}
.sm-account { display: flex; align-items: center; gap: 12px; padding: 6px 8px 12px; border-bottom: 1px solid color-mix(in srgb, var(--text) 10%, transparent); margin-bottom: 8px; }
.sm-account .avatar { width: 36px; height: 36px; line-height: 36px; flex: none; }
.sm-phone { font-size: 15px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sm-theme { display: flex; align-items: center; justify-content: space-between; padding: 2px 2px 0 8px; }
.sm-label { font-size: 13.5px; color: var(--text-2); }
.theme-seg { position: relative; display: flex; gap: 2px; padding: 2px; border-radius: 999px; }
.theme-seg {
  background: color-mix(in srgb, var(--text) 5%, var(--win-glass));
  -webkit-backdrop-filter: blur(12px) saturate(180%); backdrop-filter: blur(12px) saturate(180%);
  border: 1px solid var(--win-edge);
  box-shadow: inset 0 1px 0 var(--win-rim), inset 0 0 0 1px color-mix(in srgb, var(--win-rim) 40%, transparent);
}
.theme-seg button { width: 30px; height: 26px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 999px; background: transparent; color: var(--text-2); cursor: pointer; transition: background .15s, color .15s, box-shadow .15s; }
.theme-seg button:hover { color: var(--text); }
.theme-seg::before { content: ''; position: absolute; left: 2px; top: 2px; width: 30px; height: 26px; border-radius: 999px; background: var(--surface); box-shadow: 0 1px 2px rgba(16, 24, 40, .1); transform: translateX(calc(var(--i, 0) * 32px)); opacity: var(--on, 0); }
.theme-seg.ready::before { transition: transform .28s cubic-bezier(.2, 0, 0, 1), opacity .15s; }
.theme-seg button { position: relative; z-index: 1; }
.theme-seg button[aria-checked="true"] { color: var(--text); }
.theme-seg svg, .theme-seg .ti { width: 15px; height: 15px; display: block; }
.theme-seg .ti { background: currentColor; -webkit-mask: center / contain no-repeat; mask: center / contain no-repeat; }
:root[data-theme="dark"] .theme-seg::before { background: color-mix(in srgb, var(--text) 12%, transparent); box-shadow: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme-seg::before { background: color-mix(in srgb, var(--text) 12%, transparent); box-shadow: none; } }
.settings-menu:not(:has(.sm-account)) { width: 220px; padding: 6px 6px 6px 8px; border-radius: 16px; }
.settings-menu:not(:has(.sm-account)) .sm-theme { gap: 16px; padding: 0 0 0 4px; }
.sm-logout { position: relative; display: flex; align-items: center; gap: 10px; margin: 17px -2px 0; padding: 9px 12px; border-radius: 999px;
  color: var(--danger-fg); font-size: 14px; line-height: 18px; text-decoration: none; transition: background .15s; }
.sm-logout::before { content: ''; position: absolute; left: 2px; right: 2px; top: -9px; height: 1px; background: color-mix(in srgb, var(--text) 10%, transparent); }
.sm-logout svg { width: 18px; height: 18px; flex: none; }
.sm-logout:hover { background: color-mix(in srgb, var(--danger) 9%, transparent); text-decoration: none; }
.gear-btn:focus-visible, .theme-seg button:focus-visible { outline: 2px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 2px; }
.sm-logout:focus-visible { outline: 2px solid color-mix(in srgb, var(--danger) 50%, transparent); outline-offset: -2px; background: color-mix(in srgb, var(--danger) 9%, transparent); }
.sm-backdrop { display: none; }
.sm-links { display: none; }
@media (max-width: 640px) {
  .sm-backdrop {
    display: block; position: fixed; inset: 0; z-index: 39; background: rgba(0, 0, 0, .32);
    opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility 0s .25s;
  }
  .sm-backdrop.open { opacity: 1; visibility: visible; transition: opacity .25s ease, visibility 0s; }
  html.sheet-open { overflow: hidden; }
  .settings-menu, .settings-menu:not(:has(.sm-account)) {
    top: auto; right: 8px; left: 8px; bottom: 8px; width: auto; border-radius: 28px;
    padding: 22px 12px calc(12px + env(safe-area-inset-bottom)); touch-action: none;
    background: color-mix(in srgb, var(--surface) 97%, transparent);
    opacity: 1; transform: translateY(calc(100% + 16px)); transform-origin: bottom center;
    transition: transform .3s cubic-bezier(.32, .72, 0, 1), visibility 0s .3s;
  }
  .settings-menu.open { transform: none; transition: transform .38s cubic-bezier(.32, .72, 0, 1), visibility 0s; }
  .settings-menu.dragging { transition: none; }
  .settings-menu::after {
    content: ''; position: absolute; top: 8px; left: 50%; width: 36px; height: 5px; margin-left: -18px;
    border-radius: 3px; background: color-mix(in srgb, var(--text) 18%, transparent);
  }
  .settings-menu .sm-account { padding: 8px 8px 14px; gap: 14px; }
  .settings-menu .sm-account .avatar { width: 44px; height: 44px; line-height: 44px; font-size: 15px; }
  .settings-menu .sm-phone { font-size: 17px; font-weight: 600; }
  .settings-menu .sm-theme, .settings-menu:not(:has(.sm-account)) .sm-theme { padding: 4px 4px 0 8px; }
  .settings-menu .sm-label { font-size: 16px; color: var(--text); }
  .settings-menu .theme-seg button { width: 48px; height: 36px; }
  .settings-menu .theme-seg::before { width: 48px; height: 36px; transform: translateX(calc(var(--i, 0) * 50px)); }
  .settings-menu .theme-seg svg, .settings-menu .theme-seg .ti { width: 19px; height: 19px; }
  .settings-menu .theme-seg {
    background: color-mix(in srgb, var(--text) 8%, transparent); border-color: transparent; box-shadow: none;
    -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  .settings-menu .theme-seg button { color: color-mix(in srgb, var(--text) 70%, transparent); }
  .settings-menu .theme-seg button[aria-checked="true"] { color: var(--text); }
  .settings-menu .theme-seg::before { box-shadow: 0 1px 3px rgba(16, 24, 40, .14), 0 0 0 .5px rgba(16, 24, 40, .06); }
  :root[data-theme="dark"] .settings-menu .theme-seg::before { background: color-mix(in srgb, var(--text) 22%, transparent); box-shadow: none; }
  .settings-menu .sm-logout { font-size: 17px; padding: 13px 8px; margin: 21px 0 0; gap: 12px; border-radius: 999px; }
  .settings-menu .sm-logout:active { background: color-mix(in srgb, var(--danger) 9%, transparent); }
  .settings-menu .sm-logout::before { left: 0; right: 0; top: -11px; }
  .settings-menu .sm-logout svg { width: 22px; height: 22px; }
  .settings-menu .sm-links { display: block; position: relative; margin-top: 21px; }
  .settings-menu .sm-links::before { content: ''; position: absolute; left: 0; right: 0; top: -11px; height: 1px; background: color-mix(in srgb, var(--text) 10%, transparent); }
  .sm-link { display: flex; align-items: center; gap: 12px; padding: 12px 8px; border-radius: 999px; color: var(--text); text-decoration: none; font-size: 17px; transition: background .15s; }
  .sm-link:hover, .sm-link:active { background: color-mix(in srgb, var(--text) 6%, transparent); text-decoration: none; }
  .sm-link:focus-visible { outline: 2px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: -2px; }
  .sm-link span { flex: 1; }
  .sm-link-ico { width: 22px; height: 22px; flex: none; color: var(--header-link); }
  .sm-link-ext { width: 16px; height: 16px; flex: none; color: var(--external-link); }
}
@media (max-width: 640px) and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .settings-menu .theme-seg::before { background: color-mix(in srgb, var(--text) 22%, transparent); box-shadow: none; }
}


/* Tablet navigation uses the same links as the desktop header, in the menu. */
@media(min-width:641px) and (max-width:900px) {
  .header-links { display:none; }
  .settings-menu .sm-links { display:block; margin-top:14px; padding-top:12px; border-top:1px solid var(--line); }
  .settings-menu .sm-link { display:flex; align-items:center; gap:10px; padding:10px 8px; color:var(--text); font-size:14px; border-radius:10px; text-decoration:none; }
  .settings-menu .sm-link:hover, .settings-menu .sm-link[aria-current="page"] { background:var(--surface-2); }
  .sm-link span { flex:1; }
  .sm-link-ico { width:18px; height:18px; flex:none; }
  .sm-link-ext { width:14px; height:14px; flex:none; }
}
