/* Metal Devs design tokens: one flat, neutral system for every page. */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #f6f6f8;
  --surface-2: #efeff3;
  --hover: #f1f1f4;
  --line: #e7e7ec;
  --line-strong: #d5d5dd;
  --border: var(--line);
  --ink: #17171c;
  --ink-hover: #2e2e35;
  --muted: #676772;
  --faint: #9b9ba6;
  --accent: #4f46e5;
  --accent-soft: #ecebff;
  --success: #15734d; --success-soft: #e8f5ee;
  --warning: #8a5a0c; --warning-soft: #fcf3e3;
  --danger: #b4261a; --danger-soft: #fdeeec;
  --info: #3a54a3; --info-soft: #edf1fb;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 7px;
  --control: 40px;
  --control-sm: 34px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "SF Mono", monospace;
  --text-xs: 12px; --text-sm: 13px; --text-base: 15px; --text-md: 17px; --text-lg: 20px; --text-xl: 30px; --text-2xl: 44px;
  font-family: var(--font);
  font-synthesis: none;
  font-size: 16px;
  color: var(--ink);
  background: var(--bg);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: var(--text-base); line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; color: inherit; }
button:disabled { opacity: .5; cursor: not-allowed; }
:is(button, a, input, textarea, select, summary):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
img { max-width: 100%; display: block; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 650; letter-spacing: -.02em; }
h1 { font-size: var(--text-xl); line-height: 1.2; }
h2 { font-size: var(--text-lg); line-height: 1.3; }
h3 { font-size: var(--text-md); line-height: 1.35; }
p { line-height: 1.6; }
[hidden] { display: none !important; }
.icon { width: 18px; height: 18px; flex-shrink: 0; vertical-align: middle; display: inline-block; }
.shell { max-width: 1120px; margin: auto; padding: 0 32px; }
body > .shell { min-height: 100svh; display: flex; flex-direction: column; }
.shell > main { flex: 1; min-width: 0; }
.skip { position: absolute; left: -9999px; top: 10px; padding: 10px 14px; background: var(--bg); border-radius: var(--radius-xs); z-index: 100; }
.skip:focus { left: 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Header and footer (shared by the app and the static policy pages) */
.header { min-height: 64px; display: flex; align-items: center; gap: 40px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; font-size: 18px; font-weight: 700; letter-spacing: -.03em; white-space: nowrap; }
.main-nav { display: flex; align-self: stretch; gap: 28px; font-size: 14px; }
.main-nav a { display: flex; align-items: center; position: relative; color: var(--muted); transition: color .15s; }
.main-nav a:hover, .main-nav a.active, .main-nav a[aria-current="page"] { color: var(--ink); }
.main-nav a.active::after, .main-nav a[aria-current="page"]::after { content: ''; position: absolute; bottom: -1px; left: 0; right: 0; height: 2px; background: var(--ink); }
.header-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.header-actions .button { min-height: 36px; padding: 0 14px; font-size: 13px; }
.header-actions .account-button { padding-left: 4px; }
.header-actions .account-button span:not(.avatar) { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-link { position: relative; border-color: transparent !important; background: transparent; }
.header-actions .inbox-link { width: auto; min-width: 36px; padding: 0 12px; }
.inbox-link:hover { background: var(--hover); }
.unread-dot { position: absolute; top: 6px; left: 24px; background: var(--accent); border: 2px solid var(--bg); width: 9px; height: 9px; border-radius: 50%; }
.avatar { display: inline-grid; place-items: center; flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); color: var(--ink); font-size: 12px; font-weight: 650; line-height: 1; }
.avatar-lg { width: 56px; height: 56px; font-size: 22px; }
.profile-menu { position: relative; border: 0 !important; margin: 0 !important; }
.profile-menu summary { list-style: none; cursor: pointer; padding: 0; font-size: 13px; }
.profile-menu summary::-webkit-details-marker { display: none; }
.profile-menu nav { position: absolute; right: 0; top: calc(100% + 6px); min-width: 180px; padding: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: 0 8px 24px #0000000f; z-index: 40; }
.profile-menu nav a, .profile-menu nav button { display: block; width: 100%; padding: 9px 12px; color: inherit; text-align: left; font: inherit; font-size: 13px; border: 0; background: transparent; border-radius: var(--radius-xs); text-decoration: none; cursor: pointer; }
.profile-menu nav a:hover, .profile-menu nav button:hover { background: var(--hover); }
.footer { margin-top: 72px; padding: 24px 0 32px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 24px; font-size: var(--text-xs); color: var(--muted); }
.footer nav { display: flex; align-items: center; gap: 20px; }
.footer nav a { display: inline-flex; gap: 4px; align-items: center; min-height: 28px; }
.footer nav a:hover, .footer nav a[aria-current="page"] { color: var(--ink); }
.footer nav .icon { width: 12px; height: 12px; opacity: .7; }
.copyright { color: var(--muted); }

/* Controls */
.button { min-height: var(--control); padding: 0 18px; border: 1px solid var(--line-strong); border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--bg); color: var(--ink); font-size: 14px; font-weight: 550; line-height: 1.2; text-align: center; white-space: nowrap; transition: background .15s, border-color .15s; }
.button:hover { background: var(--hover); }
.button .icon { width: 16px; height: 16px; }
.button-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.button-dark:hover { background: var(--ink-hover); border-color: var(--ink-hover); }
.button-dark .icon { filter: invert(1); }
.button-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.button-danger:hover { background: #961f15; border-color: #961f15; }
.button-icon { padding: 0; width: var(--control); min-width: var(--control); }
.button-small { min-height: var(--control-sm); padding: 0 13px; font-size: 13px; }
.button-small .icon { width: 15px; height: 15px; }
.button-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.text-link { font-size: var(--text-sm); font-weight: 500; display: inline-flex; align-items: center; gap: 6px; line-height: 1.5; min-height: 32px; color: var(--muted); }
.text-link:hover { color: var(--ink); }
.text-link .icon { width: 15px; height: 15px; }
.text-button { padding: 0; background: transparent; border: 0; color: var(--muted); font-size: var(--text-xs); text-decoration: underline; text-underline-offset: 3px; }
.text-button:hover { color: var(--danger); }
.eyebrow { font-size: var(--text-xs); font-weight: 400; color: var(--muted); line-height: 1.5; }
.lead { font-size: var(--text-base); color: var(--muted); line-height: 1.6; max-width: 540px; }
.quiet { color: var(--muted); font-size: 14px; }
.help { font-size: var(--text-xs); font-weight: 400; line-height: 1.6; color: var(--muted); display: block; margin-top: 8px; }
.help a { text-decoration: underline; text-underline-offset: 3px; }
.help .icon { width: 14px; height: 14px; }
code { font-family: var(--mono); font-size: .85em; background: var(--surface); border-radius: 5px; padding: 2px 6px; }
.panel { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
label { display: block; font-size: var(--text-sm); font-weight: 550; margin: 0 0 20px; }
label input, label textarea, label select { margin-top: 7px; }
input, textarea, select { width: 100%; background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); color: var(--ink); padding: 9px 12px; font-size: 14px; font-weight: 400; line-height: 1.45; min-height: var(--control); transition: border-color .15s, box-shadow .15s; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px #17171c14; }
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input[type=checkbox], input[type=radio] { accent-color: var(--ink); }
input[type=file] { font-size: var(--text-xs); line-height: 1.6; padding: 8px; background: var(--surface); border-color: var(--line); border-style: dashed; }
input[type=file]::file-selector-button { border: 1px solid var(--line-strong); padding: 5px 12px; border-radius: 999px; background: var(--bg); color: var(--ink); margin-right: 10px; cursor: pointer; font-weight: 550; }
.optional { font-size: var(--text-xs); color: var(--faint); font-weight: 400; margin-left: 4px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 24px; }
.file-label > .icon { width: 15px; height: 15px; margin-right: 4px; }
.honey { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
summary { cursor: pointer; font-size: var(--text-sm); font-weight: 550; padding: 14px 0; }
details { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.badge { display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; padding: 3px 9px; font-size: 11px; font-weight: 550; background: var(--surface-2); color: var(--muted); line-height: 1.4; white-space: nowrap; text-transform: capitalize; }
.badge[class*="status-"] { text-transform: none; }
.status-open { background: var(--surface-2); color: var(--ink); }
.status-in_progress { background: var(--info-soft); color: var(--info); }
.status-waiting_for_you { background: var(--warning-soft); color: var(--warning); }
.status-resolved { background: var(--success-soft); color: var(--success); }
.switch-input { appearance: none; -webkit-appearance: none; position: relative; flex: 0 0 36px; width: 36px; height: 22px; min-height: 0; margin: 0; padding: 0; border: 0; border-radius: 999px; background: var(--line-strong); cursor: pointer; transition: background .15s; }
.switch-input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px #0003; transition: transform .15s; }
.switch-input:checked { background: var(--ink); }
.switch-input:checked::after { transform: translateX(14px); }
.switch-input:focus { box-shadow: none; }
.site-dialog { width: min(440px,calc(100vw - 32px)); margin: auto; padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); box-shadow: 0 20px 60px #0000002e; animation: dialog-enter .15s ease-out; }
.site-dialog::backdrop { background: #17171c55; }
.site-dialog h2 { font-size: var(--text-lg); line-height: 1.3; margin: 0 24px 12px 0; }
.site-dialog p { font-size: 14px; line-height: 1.6; color: var(--muted); white-space: pre-line; }
.site-dialog-close { position: absolute; right: 14px; top: 12px; border: 0; background: transparent; width: 32px; height: 32px; border-radius: 50%; font-size: 22px; color: var(--muted); }
.site-dialog-close:hover { background: var(--hover); }
.site-dialog-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 24px; }
@keyframes dialog-enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .site-dialog { animation: none; } }
/* Notifications: stacked at the bottom, dismissable (ui.js). #toast is the fallback before ui.js loads. */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 120; width: max-content; max-width: calc(100vw - 32px); }
.toasts .toast, #toast { display: flex; align-items: center; gap: 10px; padding: 10px 8px 10px 14px; border-radius: 12px; background: #1f1f25; color: #f3f3f6; font-size: 14px; line-height: 1.45; box-shadow: 0 2px 6px #0000000f, 0 18px 44px #0000002e; animation: toast-in .2s ease-out; }
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); max-width: min(90vw, 560px); padding: 12px 16px; z-index: 120; }
.toast.error { background: #7f1d1d; }
.toast.leaving { opacity: 0; transform: translateY(6px); transition: opacity .18s, transform .18s; }
.toast-icon .icon, .toast-close .icon { filter: invert(1); opacity: .85; }
.toast-text { min-width: 0; overflow-wrap: anywhere; }
.toast-close { display: grid; place-items: center; width: 28px; height: 28px; flex: none; border: 0; border-radius: 8px; background: transparent; }
.toast-close:hover { background: #ffffff1a; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Dropdowns (ui.js replaces the browser's list; the native select stays in the form) */
select.select-native { position: absolute !important; width: 1px !important; height: 1px !important; min-height: 0 !important; padding: 0 !important; margin: 0 !important; opacity: 0; pointer-events: none; }
.select-button { width: 100%; min-height: var(--control); display: flex; align-items: center; gap: 8px; padding: 0 12px; background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); color: var(--ink); font-size: 14px; font-weight: 400; text-align: left; transition: border-color .15s, box-shadow .15s, background .15s; }
.select-button:hover { background: var(--surface); }
.select-button.open, .select-button:focus-visible { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px #17171c14; }
.select-button.invalid { border-color: var(--danger); }
.select-button .select-value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select-button .select-value.placeholder { color: var(--faint); }
.select-button .icon { opacity: .55; transition: transform .15s; }
.select-button.open .icon { transform: rotate(180deg); }
label .select-button { margin-top: 7px; }
.select-popover { position: fixed; z-index: 110; overflow-y: auto; padding: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: 0 2px 6px #0000000d, 0 16px 40px #0000001f; animation: fade-in .12s ease-out; outline: none; }
.select-option { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: var(--radius-xs); font-size: 14px; cursor: pointer; }
.select-option > span { min-width: 0; overflow-wrap: anywhere; }
.select-option.active { background: var(--hover); }
.select-option.selected { font-weight: 600; }
.select-option.disabled { color: var(--faint); cursor: not-allowed; }
.select-heading { padding: 10px 10px 4px; font-size: 11px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.select-filter { position: sticky; top: -6px; margin: -6px -6px 6px; width: calc(100% + 12px); border: 0; border-bottom: 1px solid var(--line); border-radius: 0; min-height: 40px; background: var(--bg); box-shadow: none !important; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* Scrollbars: thin and rounded, only as visible as needed */
:root { --scroll-thumb: #c9c9d3; --scroll-thumb-hover: #a6a6b2; }
* { scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 999px; border: 3px solid transparent; background-clip: padding-box; min-height: 40px; }
::-webkit-scrollbar-thumb:hover { background-color: var(--scroll-thumb-hover); }

/* Segmented filters (workspace lists, editor Write/Preview) */
.segmented { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; background: var(--surface-2); border-radius: 999px; }
.segmented > a, .segmented > button { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 550; white-space: nowrap; }
.segmented > a:hover, .segmented > button:hover { color: var(--ink); }
.segmented > .on { background: var(--bg); color: var(--ink); box-shadow: 0 1px 2px #00000014; }
.segmented .count { font-size: 11.5px; color: var(--faint); font-weight: 600; }
.segmented > .on .count { color: var(--muted); }

/* Page structure */
.page-heading { padding: 40px 0 28px; display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.page-heading .lead { margin-top: 8px; }
.page-heading > .button { flex-shrink: 0; }
.section { padding-bottom: 40px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 16px; }
.section-heading h2 { font-size: var(--text-md); }
.empty-state { padding: 56px 24px; text-align: center; }
.empty-state > .icon { width: 24px; height: 24px; opacity: .35; margin: 0 auto 14px; display: block; }
.empty-state h3 { font-size: var(--text-md); }
.empty-state p { max-width: 420px; margin: 8px auto 0; color: var(--muted); font-size: 14px; }
.empty-state > .button, .empty-state > .button-row { margin-top: 20px; }
.empty-state .button-row { justify-content: center; }
.loading { padding: 80px 20px; text-align: center; color: var(--muted); font-size: 14px; }

/* Home and games */
.hero { padding: 64px 0 48px; }
.hero h1 { max-width: 760px; font-size: var(--text-2xl); line-height: 1.1; letter-spacing: -.035em; font-weight: 700; }
.hero .lead { margin-top: 14px; font-size: var(--text-md); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.game-card { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--bg); }
.game-image { display: block; background: #111; overflow: hidden; aspect-ratio: 16/9; }
.game-image > img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.game-card:hover .game-image > img { transform: scale(1.015); }
.game-info { padding: 20px 22px 22px; display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.game-info h3 { font-size: var(--text-md); }
.game-info p { margin-top: 6px; font-size: 14px; color: var(--muted); white-space: pre-line; }
.game-info .button { margin-top: auto; }
.featured-game { display: grid; grid-template-columns: 1.6fr 1fr; }
.featured-game .game-image { height: 100%; min-height: 320px; }
.featured-game .game-info { justify-content: center; padding: 32px; gap: 22px; }
.featured-game .game-info h3 { font-size: 26px; letter-spacing: -.03em; }
.featured-game .button { margin-top: 0; }
.game-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.featured-game + .game-grid { margin-top: 20px; }
.news-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.news-card { border-top: 1px solid var(--line); padding: 18px 0 8px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.news-card h3 { font-size: var(--text-md); overflow-wrap: anywhere; }
.news-card:hover h3 { text-decoration: underline; text-underline-offset: 4px; }
.news-card > p:not(.eyebrow) { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }

/* Articles and documents (news posts, privacy, terms, verification) */
.article, .document { width: 100%; max-width: 680px; margin: 40px auto 0; }
.article > .text-link { margin-bottom: 20px; }
.article-date, .document .updated { display: block; margin: 0 0 10px; font-size: var(--text-sm); color: var(--muted); }
.article h1, .document h1 { font-size: 36px; line-height: 1.15; letter-spacing: -.03em; margin-bottom: 20px; overflow-wrap: anywhere; }
.prose { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 16px; line-height: 1.75; color: #3a3a42; }
.document { margin-bottom: 0; }
.document > p, .document section p { font-size: var(--text-base); line-height: 1.75; color: #3a3a42; margin: 0 0 14px; }
.document > .document-intro { font-size: var(--text-md); color: var(--muted); margin-bottom: 8px; }
.document section { padding-top: 28px; margin-top: 28px; border-top: 1px solid var(--line); }
.document h2 { font-size: var(--text-md); margin: 0 0 12px; }
.document a { text-decoration: underline; text-underline-offset: 3px; }
.document .button { text-decoration: none; }
.document .hero-actions { margin: 24px 0 0; }
.document video { display: block; width: 100%; height: auto; margin: 32px 0 0; border-radius: var(--radius); background: #111; }
.steps-list { margin: 24px 0 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 12px; }
.steps-list li { counter-increment: step; display: flex; gap: 14px; align-items: baseline; font-size: var(--text-base); color: #3a3a42; }
.steps-list li::before { content: counter(step); flex-shrink: 0; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); color: var(--ink); font-size: var(--text-xs); font-weight: 650; transform: translateY(-1px); }

/* Support intake */
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.choice-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: flex; align-items: center; gap: 16px; transition: background .15s, border-color .15s; }
.choice-card:hover { background: var(--surface); border-color: var(--line-strong); }
.choice-card > .icon:first-child { width: 20px; height: 20px; }
.choice-card h2 { font-size: var(--text-md); }
.choice-card p { font-size: var(--text-sm); color: var(--muted); margin-top: 4px; }
.choice-card > .icon:last-child { margin-left: auto; width: 16px; height: 16px; opacity: .6; }
.wizard-wrap { max-width: 600px; margin: 32px auto 0; }
.steps { list-style: none; display: flex; padding: 0; margin: 20px 0 32px; gap: 8px; }
.steps li { flex: 1; display: flex; flex-direction: column; gap: 8px; color: var(--faint); font-size: var(--text-xs); }
.steps li::before { content: ''; height: 3px; border-radius: 3px; background: var(--line); }
.steps li > span { display: none; }
.steps .current, .steps .complete { color: var(--ink); }
.steps .current { font-weight: 600; }
.steps .current::before, .steps .complete::before { background: var(--ink); }
.wizard-panel { border: 0; padding: 0; }
.wizard-panel > h2 { font-size: 24px; margin-bottom: 20px; }
.wizard-panel > .eyebrow { margin: -14px 0 20px; }
.category-grid { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.category-card { width: 100%; min-height: 60px; border: 0; border-bottom: 1px solid var(--line); padding: 14px 6px; background: transparent; display: flex; align-items: center; gap: 14px; text-align: left; transition: background .15s; }
.category-card:hover { background: var(--surface); }
.category-card > span { font-size: var(--text-base); font-weight: 500; }
.category-card > .icon:last-child { margin-left: auto; width: 16px; height: 16px; opacity: .5; }
.review-list { margin: 0 0 20px; border-top: 1px solid var(--line); }
.review-list > div { display: flex; border-bottom: 1px solid var(--line); padding: 12px 0; gap: 24px; font-size: 14px; }
.review-list dt { color: var(--muted); min-width: 90px; }
.review-list dd { margin: 0; overflow-wrap: anywhere; }
.review-message { border-radius: var(--radius-sm); background: var(--surface); padding: 18px; margin-bottom: 16px; }

/* Requests, conversations and inbox */
.ticket-list { border-top: 1px solid var(--line); }
.ticket-row { display: flex; padding: 16px 8px; gap: 16px; align-items: center; border-bottom: 1px solid var(--line); transition: background .15s; }
.ticket-row:hover { background: var(--surface); }
.ticket-row > div { min-width: 0; }
.ticket-row h3 { font-size: var(--text-base); font-weight: 600; letter-spacing: -.01em; overflow-wrap: anywhere; }
.ticket-row p { font-size: var(--text-xs); color: var(--muted); margin-top: 3px; }
.ticket-row > .icon:last-child { margin-left: auto; width: 16px; height: 16px; opacity: .5; }
.reference { color: var(--faint); font-size: 11px; display: block; margin-bottom: 2px; font-family: var(--mono); }
.row-end { margin-left: auto; display: flex; gap: 14px; align-items: center; }
.row-end > .icon { width: 16px; height: 16px; opacity: .5; }
.inbox-item-icon { display: grid; place-items: center; width: 36px; height: 36px; flex-shrink: 0; background: var(--surface); border-radius: 50%; }
.inbox-item-icon .icon { width: 16px; height: 16px; }
.ticket-row-main { min-width: 0; }
.row-time { font-size: var(--text-xs); color: var(--muted); white-space: nowrap; min-width: 64px; text-align: right; }
.badge.needs-reply { background: var(--accent-soft); color: var(--accent); }

/* A request: conversation on the left, details and status on the right */
.ticket-page { margin-top: 28px; }
.conversation-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin: 16px 0 20px; }
.conversation-heading h1 { font-size: 26px; line-height: 1.2; margin-top: 6px; overflow-wrap: anywhere; }
.ticket-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 32px; align-items: start; }
.ticket-side { position: sticky; top: 20px; }
.ticket-side .panel { padding: 20px; }
.ticket-side h3 { font-size: var(--text-sm); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 12px; }
.detail-list { margin: 0; display: grid; gap: 12px; }
.detail-list > div { display: grid; gap: 2px; }
.detail-list dt { font-size: var(--text-xs); color: var(--muted); }
.detail-list dd { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.detail-list dd small { color: var(--faint); font-size: var(--text-xs); margin-left: 4px; }
.detail-list dd a { text-decoration: underline; text-underline-offset: 3px; }
.detail-list dd a .icon { width: 13px; height: 13px; }
.quick-status { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.quick-status .help { margin: 0 0 8px; }
.notice { border-radius: var(--radius-sm); padding: 12px 16px; font-size: 14px; margin-bottom: 20px; background: var(--surface); }
.notice-warning { background: var(--warning-soft); color: var(--warning); }
.notice-success { background: var(--success-soft); color: var(--success); }
.notice-info { background: var(--info-soft); color: var(--info); }
.conversation { display: flex; flex-direction: column; gap: 16px; margin: 0 0 20px; }
.message { display: flex; gap: 12px; align-items: flex-start; }
.message > .avatar { width: 34px; height: 34px; font-size: 13px; margin-top: 2px; }
.avatar-team { background: var(--ink); color: #fff; }
.message-card { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px 16px; background: var(--bg); }
.staff-message .message-card { background: var(--surface); border-color: transparent; }
.message-meta { display: flex; align-items: center; gap: 8px; font-size: var(--text-sm); margin-bottom: 8px; }
.message-meta time { font-size: var(--text-xs); color: var(--muted); margin-left: auto; white-space: nowrap; }
.message-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.7; }
.message-event { display: flex; align-items: center; gap: 8px; padding: 0 0 0 46px; font-size: var(--text-xs); color: var(--muted); }
.message-event .icon { width: 14px; height: 14px; opacity: .6; }
.message-event strong { color: var(--ink); font-weight: 600; }
.message-event time { margin-left: auto; white-space: nowrap; }
.reply-box { border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 4px; transition: border-color .15s, box-shadow .15s; }
.reply-box:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px #17171c14; }
.reply-box textarea { border: 0; box-shadow: none !important; min-height: 96px; padding: 12px 14px; resize: vertical; }
.reply-box .file-list { padding: 0 10px; }
.reply-box > .help { padding: 0 12px 8px; margin-top: 0; }
.reply-actions { display: flex; align-items: center; gap: 10px; padding: 8px 8px 6px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.reply-actions > .button-dark { margin-left: auto; }
.attach-button { position: relative; margin: 0; cursor: pointer; font-weight: 550; }
.reply-status { display: flex; align-items: center; gap: 8px; margin: 0; font-size: var(--text-xs); font-weight: 400; color: var(--muted); white-space: nowrap; }
.reply-status .select-button { margin: 0; min-height: var(--control-sm); width: 200px; font-size: 13px; }

/* Files picked or kept on a form */
.file-list { display: grid; gap: 6px; }
.file-list:empty { display: none; }
.file-row { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 10px; border-radius: var(--radius-xs); background: var(--surface); font-size: var(--text-sm); }
.file-row > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row small { color: var(--muted); font-size: var(--text-xs); white-space: nowrap; }
.file-row .icon { width: 14px; height: 14px; }
.file-row.new { background: var(--accent-soft); }
.icon-button { display: grid; place-items: center; width: 28px; height: 28px; flex: none; border: 0; border-radius: 8px; background: transparent; }
.icon-button:hover { background: var(--hover); }
.icon-button .icon { width: 14px; height: 14px; }
.drop-zone { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; margin: 10px 0 0; padding: 18px 12px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); color: var(--muted); font-size: var(--text-sm); font-weight: 450; text-align: center; cursor: pointer; transition: background .15s, border-color .15s; }
.drop-zone:hover, .drop-zone:focus-within { background: var(--surface); border-color: var(--ink); color: var(--ink); }
.drop-zone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; min-height: 0; margin: 0; }
.drop-zone.full { display: none; }
.attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.attachments a { display: inline-flex; gap: 6px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); font-size: var(--text-xs); align-items: center; overflow-wrap: anywhere; max-width: 100%; }
.attachments a:hover { border-color: var(--line-strong); }
.attachments small { color: var(--muted); }
.attachments .icon { width: 14px; height: 14px; }
.tracking-panel { display: flex; gap: 14px; background: var(--success-soft); border-color: transparent; margin-bottom: 24px; }
.tracking-panel > .icon { width: 20px; height: 20px; margin-top: 2px; }
.tracking-panel h3 { font-size: var(--text-md); }
.tracking-panel p { font-size: 14px; margin: 4px 0 14px; }
.tracking-panel > div { min-width: 0; flex: 1; }
.tracking-panel label { margin: 0; }
.tracking-panel input { font-size: var(--text-xs); font-family: var(--mono); }
.search-field { position: relative; margin: 0 0 16px; }
.search-field > .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; opacity: .5; }
.search-field input { padding-left: 38px; margin: 0; }

/* Sign-in */
.signin-panel { text-align: center; max-width: 440px; margin: 56px auto 0; padding: 36px 32px; }
.signin-panel > .icon { width: 26px; height: 26px; margin: 0 auto 16px; display: block; }
.signin-panel h2 { font-size: var(--text-lg); }
.signin-panel > p:not(.help) { color: var(--muted); font-size: 14px; margin: 8px auto 0; max-width: 340px; }
.signin-panel .help { margin-top: 16px; }
.signin-actions { display: flex; flex-direction: column; align-items: stretch; gap: 8px; margin-top: 24px; }
.signin-actions .button { width: 100%; }
.signin-actions > .help { margin: 0; }

/* Account (profile) */
.account-page { max-width: 760px; margin: 0 auto; }
.profile-head { display: flex; align-items: center; gap: 16px; padding: 40px 0 32px; }
.profile-head > div { min-width: 0; flex: 1; }
.profile-head h1 { font-size: 26px; overflow-wrap: anywhere; }
.profile-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 6px; font-size: var(--text-sm); color: var(--muted); }
.profile-meta a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.profile-meta .icon { width: 13px; height: 13px; opacity: .7; }
.role-badges { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.account-shortcuts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-bottom: 36px; }
.account-tile { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--surface); font-size: 14px; font-weight: 550; transition: background .15s; }
.account-tile:hover { background: var(--surface-2); }
.account-tile > .icon { width: 17px; height: 17px; }
.account-tile > .icon:last-child { margin-left: auto; width: 15px; height: 15px; opacity: .45; }
.account-section { margin-bottom: 36px; }
.account-section > h2 { font-size: var(--text-sm); font-weight: 600; color: var(--muted); letter-spacing: 0; margin: 0 0 10px; }
.account-section > .panel { padding: 4px 20px; }
.account-notice { display: flex; gap: 12px; padding: 16px 18px; margin-bottom: 10px; border-radius: var(--radius); background: var(--info-soft); color: var(--ink); }
.account-notice > .icon { width: 18px; height: 18px; margin-top: 2px; }
.account-notice > div { min-width: 0; flex: 1; }
.account-notice p { font-size: 14px; overflow-wrap: anywhere; }
.account-notice .button-row { margin-top: 12px; }
.account-connection, .account-file-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.account-section .account-connection:last-child, .account-section .profile-email-flow:last-child { border-bottom: 0; }
.account-connection > div { min-width: 0; display: flex; align-items: center; gap: 14px; flex: 1; }
.account-connection strong { font-size: 14px; font-weight: 550; min-width: 72px; }
.account-connection .status { font-size: var(--text-sm); color: var(--muted); overflow-wrap: anywhere; min-width: 0; }
.account-connection .status.ok { color: var(--ink); }
.account-connection .status .icon { width: 14px; height: 14px; margin-right: 4px; vertical-align: -2px; }
.account-connection > .icon { width: 18px; height: 18px; opacity: .55; }
.account-file-row > span { display: flex; align-items: center; gap: 8px; min-width: 0; overflow-wrap: anywhere; }
.profile-email-flow { padding: 16px 0 18px; border-bottom: 1px solid var(--line); }
.profile-email-flow h3 { font-size: 14px; margin: 0 0 4px; }
.profile-email-flow > .help { margin: 0 0 12px; }
.profile-email-flow form { display: flex; gap: 8px; align-items: flex-end; margin-top: 10px; }
.profile-email-flow form label { flex: 1; margin: 0; }
.profile-email-flow input { min-width: 0; }
.profile-email-flow .button-row { margin-top: 10px; }
.profile-email-flow .text-button { margin-top: 14px; }
.preference-option { display: flex; align-items: center; gap: 16px; margin: 0; padding: 14px 0; border-bottom: 1px solid var(--line); font-weight: 400; cursor: pointer; }
.preference-option > span { flex: 1; min-width: 0; }
.preference-option strong { display: block; font-size: 14px; font-weight: 550; }
.preference-option small { display: block; margin-top: 2px; color: var(--muted); font-size: var(--text-sm); line-height: 1.5; }
.preference-option input[type="checkbox"]:not(.switch-input) { width: 18px; height: 18px; flex: 0 0 18px; min-height: 0; margin: 0; }
.account-settings-actions { display: flex; justify-content: flex-end; padding: 14px 0 16px; }
.test-email-panel > summary { display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; }
.test-email-panel[open] > summary { margin-bottom: 16px; }
.test-email-history { margin-top: 24px; }
.test-email-history h3 { font-size: var(--text-sm); color: var(--muted); margin-bottom: 4px; }
.test-email-history article { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.test-email-history p { margin: 2px 0 0; overflow-wrap: anywhere; }

/* Team workspace */
.admin-layout { display: grid; grid-template-columns: 200px 1fr; gap: 40px; }
.admin-nav { display: flex; flex-direction: column; gap: 2px; align-self: start; position: sticky; top: 20px; }
.admin-nav a { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-radius: var(--radius-sm); font-size: 14px; color: var(--muted); transition: background .15s, color .15s; }
.admin-nav a:hover { background: var(--hover); color: var(--ink); }
.admin-nav a.active { background: var(--surface-2); color: var(--ink); font-weight: 550; }
.admin-nav a .icon { width: 17px; height: 17px; }
.admin-content { min-width: 0; }
.admin-content > h2, .admin-content .section-heading h2 { font-size: var(--text-lg); margin-bottom: 16px; }
.admin-content .section-heading { align-items: center; margin-bottom: 16px; }
.admin-content .section-heading h2 { margin: 0; }
.admin-content .panel { margin: 16px 0 24px; }
.admin-content .panel h3 { font-size: var(--text-md); margin-bottom: 20px; }
.admin-section { margin-top: 40px; }
.admin-cards { margin-top: 0; border-top: 1px solid var(--line); }
.admin-cards:empty { display: none; }
.admin-item { border-bottom: 1px solid var(--line); padding: 12px 4px; display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.admin-item > div { min-width: 0; }
.admin-item strong { font-size: 14px; font-weight: 550; overflow-wrap: anywhere; }
.admin-item .help { margin-top: 2px; overflow-wrap: anywhere; }
.owner-note { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: var(--text-sm); margin: 0 0 16px; overflow-wrap: anywhere; }
.owner-note .icon { width: 16px; height: 16px; }
.code-input { font-family: var(--mono); font-size: var(--text-xs); }
.admin-content form > .help { margin: -8px 0 16px; }
.admin-content .preference-option { padding-top: 0; margin-bottom: 20px; }
.admin-content form > details { margin: 0; border-bottom: 0; }
.admin-content form > details:last-of-type { border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.admin-content form > details[open] > summary { margin-bottom: 4px; }
.list-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.list-toolbar .search-field { margin: 0; flex: 1; min-width: 220px; max-width: 320px; }
.admin-list { border-top: 1px solid var(--line); }
.admin-row { display: flex; align-items: center; gap: 16px; padding: 14px 8px; border-bottom: 1px solid var(--line); transition: background .15s; }
a.admin-row:hover { background: var(--surface); }
.admin-row > .icon:last-child { width: 16px; height: 16px; opacity: .45; flex: none; }
.admin-row-main { flex: 1; min-width: 0; }
.admin-row-main strong { display: block; font-size: var(--text-base); font-weight: 600; overflow-wrap: anywhere; }
.admin-row-main p { font-size: var(--text-sm); color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-row-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.admin-row-meta .help { margin: 0; white-space: nowrap; }
.admin-row-meta .help .icon { width: 12px; height: 12px; }
.game-thumb { width: 72px; aspect-ratio: 16/9; object-fit: cover; border-radius: 8px; background: var(--surface-2); flex: none; }
.game-row .button-row { flex: none; }
.button-icon-small { width: var(--control-sm); padding: 0; }
.text-button.danger-link { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-sm); text-decoration: none; padding: 4px 2px; }
.danger-link .icon { width: 14px; height: 14px; }

/* News editor: writing on the left, publishing and files on the right */
.editor-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 28px; align-items: start; }
.title-input { border: 0; padding: 0; min-height: 0; font-size: 28px; font-weight: 650; letter-spacing: -.02em; line-height: 1.25; box-shadow: none !important; }
.title-input::placeholder { color: var(--faint); }
.editor-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 18px 0 10px; }
.editor-toolbar .help { margin: 0; }
.editor-toolbar .segmented .icon { width: 14px; height: 14px; }
.body-input { min-height: 360px; font-size: 15px; line-height: 1.7; padding: 14px 16px; }
.editor-preview { min-height: 360px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 4px 24px 24px; }
.preview-article { margin-top: 20px; max-width: none; }
.preview-article h1 { font-size: 30px; }
.placeholder { color: var(--faint); }
.editor-side { display: grid; gap: 16px; position: sticky; top: 20px; }
.editor-side .panel { padding: 18px; margin: 0 !important; }
.editor-side .panel h3 { font-size: var(--text-base); margin-bottom: 6px !important; }
.editor-side .panel > .help { margin: 0 0 12px; }
.editor-side .preference-option { border-bottom: 0; padding: 4px 0 12px !important; margin: 0 !important; }
.editor-actions { display: grid; gap: 8px; }
.editor-actions .button { width: 100%; }
.editor-side .text-link { margin-top: 10px; }
.mail-status h3 { display: flex; gap: 10px; align-items: center; }
.mail-status > p { font-size: 14px; }
.mail-status .help { overflow-wrap: anywhere; }

@media (max-width: 1000px) {
  .header { gap: 28px; }
  .main-nav { gap: 22px; }
  .featured-game { grid-template-columns: 1.4fr 1fr; }
  .featured-game .game-image { min-height: 290px; }
  .featured-game .game-info { padding: 26px; }
  .news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-layout { grid-template-columns: 180px 1fr; gap: 28px; }
  .ticket-layout { grid-template-columns: minmax(0, 1fr) 240px; gap: 24px; }
  .editor-grid { grid-template-columns: minmax(0, 1fr) 230px; gap: 20px; }
  .header-actions .account-button span:not(.avatar) { max-width: 100px; }
  .header-actions .inbox-link { width: 36px; padding: 0; }
  .inbox-label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

@media (max-width: 760px) {
  body { font-size: 15px; }
  .shell { padding: 0 20px; }
  .header { display: grid; grid-template-columns: 1fr auto; gap: 0; min-height: 0; padding-top: 10px; }
  .brand { min-height: 44px; }
  .main-nav { grid-column: 1 / -1; grid-row: 2; gap: 24px; font-size: 14px; min-height: 44px; overflow-x: auto; scrollbar-width: none; }
  .main-nav::-webkit-scrollbar { display: none; }
  .main-nav a { white-space: nowrap; }
  .main-nav a.active::after, .main-nav a[aria-current="page"]::after { bottom: 0; }
  .header-actions { grid-column: 2; grid-row: 1; gap: 2px; }
  .header-actions .button { min-height: 36px; font-size: 13px; padding: 0 12px; }
  .header-actions .button-icon, .header-actions .inbox-link { padding: 0; width: 36px; min-width: 36px; }
  .header-actions .account-button { padding: 0; width: 36px; min-width: 36px; border-color: transparent; }
  .header-actions .account-button span:not(.avatar), .header-actions .inbox-label { display: none; }
  .hero { padding: 40px 0 32px; }
  .ticket-layout, .editor-grid { grid-template-columns: 1fr; gap: 20px; }
  .ticket-side, .editor-side { position: static; }
  .row-time { display: none; }
  .admin-row-meta .help { display: none; }
  .game-thumb { width: 56px; }
  .list-toolbar .search-field { max-width: none; }
  .reply-status > span { display: none; }
  .reply-status .select-button { width: 170px; }
  .message > .avatar { display: none; }
  .message-event { padding-left: 0; }
  .title-input { font-size: 24px; }
  .hero h1 { font-size: 34px; }
  .hero .lead { font-size: var(--text-base); }
  .hero-actions .button { flex: 1; }
  .section { padding-bottom: 32px; }
  .featured-game { display: block; }
  .featured-game .game-image { aspect-ratio: 16/9; min-height: 0; height: auto; }
  .featured-game .game-info, .game-info { padding: 20px; gap: 18px; }
  .featured-game .game-info h3 { font-size: 22px; }
  .game-info .button { width: 100%; }
  .game-grid, .news-grid, .choice-grid { grid-template-columns: 1fr; }
  .page-heading { padding: 28px 0 20px; flex-wrap: wrap; gap: 16px; }
  .page-heading h1 { font-size: 26px; }
  .choice-card { padding: 20px; }
  .wizard-wrap { margin-top: 24px; }
  .wizard-panel > h2 { font-size: 22px; }
  .panel { padding: 20px; }
  .wizard-panel { padding: 0; }
  .form-grid { grid-template-columns: 1fr; gap: 0; }
  .ticket-row { padding: 14px 4px; gap: 12px; }
  .row-end { gap: 10px; }
  .ticket-page { margin-top: 20px; }
  .conversation-heading { flex-direction: column; gap: 12px; }
  .conversation-heading h1 { font-size: 23px; }
  .message-card { padding: 12px 14px 14px; }
  .message-meta { flex-wrap: wrap; }
  .tracking-panel { padding: 18px; }
  .signin-panel { margin-top: 32px; padding: 28px 22px; }
  .profile-head { padding: 28px 0 24px; gap: 14px; }
  .profile-head h1 { font-size: 22px; }
  .profile-head > .button { padding: 0; width: var(--control); }
  .profile-head > .button span { display: none; }
  .account-shortcuts { grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 28px; }
  .account-section > .panel { padding: 2px 16px; }
  .account-connection > div { flex-direction: column; align-items: flex-start; gap: 2px; }
  .profile-email-flow form { flex-direction: column; align-items: stretch; }
  .admin-layout { grid-template-columns: 1fr; gap: 20px; }
  .admin-nav { position: static; flex-direction: row; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
  .admin-nav a { white-space: nowrap; padding: 8px 12px; font-size: var(--text-sm); }
  .admin-content .section-heading { flex-wrap: wrap; gap: 10px; }
  .article, .document { margin-top: 28px; }
  .article h1, .document h1 { font-size: 28px; }
  .prose, .document > p, .document section p { font-size: 15px; }
  .document section { padding-top: 22px; margin-top: 22px; }
  .footer { margin-top: 56px; padding: 20px 0 28px; flex-direction: column-reverse; align-items: flex-start; gap: 8px; }
  .footer nav { gap: 18px; flex-wrap: wrap; }
}

@media (max-width: 370px) {
  .shell { padding: 0 16px; }
  .main-nav { gap: 18px; }
  .account-shortcuts { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}

/* Finance */
.portal-finance-intro{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:24px}
.portal-finance-intro p{margin:0}
.portal-finance-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1px;background:var(--line);border:1px solid var(--line);border-radius:14px;overflow:hidden;margin-bottom:24px}
.portal-finance-stats article{display:flex;flex-direction:column;gap:9px;padding:24px;background:var(--bg)}
.portal-finance-stats article>span,.portal-finance-stats small{font-size:12px;color:var(--muted)}
.portal-finance-stats strong{font-size:clamp(23px,2.5vw,32px);font-weight:600;line-height:1.2;overflow-wrap:anywhere}
.portal-finance-details{margin-top:20px;border-top:1px solid var(--line);padding-top:16px;font-size:13px}
.portal-finance-details summary,.portal-finance-settings>summary{cursor:pointer;font-weight:600}
.portal-finance-details li{margin:8px 0;color:var(--muted)}
.portal-finance-metrics{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin-top:20px}
.portal-finance-metrics div{display:flex;justify-content:space-between;gap:12px}
.portal-finance-metrics dt{color:var(--muted)}.portal-finance-metrics dd{margin:0;font-variant-numeric:tabular-nums}
.portal-debt-timeline{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));padding:0;margin:20px 0;list-style:none;gap:14px}
.portal-debt-timeline li{border-top:2px solid var(--line-strong);padding-top:12px;display:flex;flex-direction:column;gap:6px;font-size:12px}
.portal-debt-timeline li:last-child{border-top-color:var(--danger)}.portal-debt-timeline strong{font-weight:500}.portal-debt-timeline span{color:var(--muted)}
.portal-finance-settings{margin-top:18px}.portal-finance-settings>summary{font-size:17px;list-style:none}.portal-finance-settings>summary:after{content:'+';float:right;color:var(--muted)}.portal-finance-settings[open]>summary:after{content:'−'}
.portal-finance-settings>.help{margin-top:12px}.portal-finance-settings .portal-fields{margin-top:18px}
.portal-tax-bracket-head,.portal-tax-bracket{display:grid;grid-template-columns:minmax(80px,1fr) minmax(65px,.6fr) 34px;gap:8px;align-items:center;margin-bottom:8px}
.portal-tax-bracket-head{color:var(--muted);font-size:11px}.portal-tax-bracket label{position:relative;margin:0}.portal-tax-bracket label>span:last-child{position:absolute;right:12px;top:50%;transform:translateY(-50%);color:var(--muted)}
.portal-tax-bracket input{min-width:0;width:100%;padding:10px}.portal-tax-bracket label input{padding-right:28px}.portal-tax-bracket button{padding:8px;min-width:0}.portal-tax-brackets>.help{font-size:11px}
@media(max-width:650px){.portal-finance-stats{grid-template-columns:1fr}.portal-finance-stats article{padding:20px}.portal-finance-metrics{grid-template-columns:1fr}.portal-debt-timeline{grid-template-columns:1fr}.portal-debt-timeline li{border-top:0;border-left:2px solid var(--line-strong);padding:0 0 10px 12px}.portal-debt-timeline li:last-child{border-left-color:var(--danger)}.portal-finance-intro{align-items:flex-start}.portal-finance-intro p{font-size:12px}}

/* Owner debug */
.debug-tabs { display: flex; gap: 8px; margin: 0 0 24px; }
.debug-search { padding: 24px; margin-bottom: 24px; }
.debug-search form { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.debug-search form label { margin: 0; flex: 1; min-width: 170px; }
.debug-search form label:nth-child(2) { flex: 2; }
.debug-search > .help { margin: 14px 0 0; }
.debug-games { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: start; gap: 24px; }
.debug-game { min-width: 0; padding: 26px; }
.debug-game h2 { font-size: 19px; }
.debug-game .section-heading { align-items: start; gap: 12px; }
.debug-game .section-heading .help { margin: 6px 0 0; }
.debug-stats { display: flex; flex-wrap: wrap; gap: 20px; padding: 6px 0 22px; }
.debug-stats div { display: flex; flex-direction: column; gap: 5px; min-width: 65px; }
.debug-stats span { font-size: 11px; color: var(--muted); }
.debug-stats strong { font-size: 15px; overflow-wrap: anywhere; }
.debug-grid { display: grid; gap: 6px; max-width: 450px; }
.debug-grid.cols-1 { grid-template-columns: 1fr; }.debug-grid.cols-2 { grid-template-columns: repeat(2,1fr); }.debug-grid.cols-3 { grid-template-columns: repeat(3,1fr); }.debug-grid.cols-4 { grid-template-columns: repeat(4,1fr); }.debug-grid.cols-5 { grid-template-columns: repeat(5,1fr); }.debug-grid.cols-6 { grid-template-columns: repeat(6,1fr); }.debug-grid.cols-7 { grid-template-columns: repeat(7,1fr); }.debug-grid.cols-8 { grid-template-columns: repeat(8,1fr); }.debug-grid.cols-9 { grid-template-columns: repeat(9,1fr); }.debug-grid.cols-10 { grid-template-columns: repeat(10,1fr); }
.debug-cell { aspect-ratio: 1; display: grid; place-items: center; position: relative; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 13px; font-variant-numeric: tabular-nums; min-width: 0; }
.debug-cell.is-mine { background: #fff3f3; color: #a43b3b; border-color: #e7bdbd; }
.debug-cell.is-safe { background: #f2f8f4; color: #3f6e50; border-color: #d5e5da; }
.debug-cell.is-draw { background: #eff4fb; color: #385f98; border-color: #d0def2; }
.debug-cell.is-picked { outline: 2px solid #566477; outline-offset: -3px; }
.debug-cell.is-revealed { background: #d7e9de; font-weight: 700; }
.debug-cell.is-revealed.is-mine { background: #f2d1d1; }
.debug-cell small { position: absolute; top: 2px; right: 6px; font-size: 12px; }
.debug-legend { font-size: 10px; margin: 12px 0 18px; }
.debug-hints { margin: 18px 0 0; border-top: 1px solid var(--line); }
.debug-hints div { padding: 14px 0; border-bottom: 1px solid var(--line); }
.debug-hints dt { font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.debug-hints dd { margin: 0; font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.debug-players { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.debug-players span { padding: 7px 10px; font-size: 11px; border-radius: 6px; background: var(--surface); }
.debug-game-meta { margin: 18px 0 0; font-size: 10px; overflow-wrap: anywhere; }
.debug-upcoming { margin-bottom: 24px; }
.debug-upcoming h2 { font-size: 19px; }
.debug-numbers { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0 18px; }
.debug-numbers span { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid #d0def2; background: #eff4fb; border-radius: 7px; color: #385f98; font-size: 12px; }
.debug-email-panel { max-width: 760px; }
.debug-search { padding: 20px; }
.debug-games { gap: 20px; }
.debug-games:has(> .debug-game:only-child) { grid-template-columns: minmax(0,1fr); max-width: 760px; }
.debug-players { display: block; font-size: 12px; color: var(--muted); margin: -12px 0 22px; }
.debug-upcoming { padding: 22px; }
.debug-upcoming .section-heading { margin-bottom: 12px; gap: 16px; }
.debug-upcoming h2,.debug-draw-editor h2 { font-size: 17px; }
.debug-upcoming .help { margin: 6px 0 0; overflow-wrap: anywhere; }
.debug-upcoming .debug-numbers { margin: 0; }
.debug-advice { border: 1px solid #d6e5db; background: #f6faf7; border-radius: 10px; padding: 18px; margin-bottom: 24px; }
.debug-advice > strong { display: block; font-size: 25px; margin-top: 6px; }
.debug-advice .help { margin: 6px 0 12px; }
.debug-advice summary,.debug-game-meta summary { cursor: pointer; font-size: 11px; color: var(--muted); }
.debug-moves { margin: 14px 0 0; }
.debug-moves > div { display: flex; justify-content: space-between; padding: 8px 0; font-size: 12px; border-top: 1px solid #d6e5db; }
.debug-moves dd { margin: 0; font-variant-numeric: tabular-nums; }
.debug-game-meta p { line-height: 1.8; }
.debug-recent { margin-top: 28px; }
.debug-recent > summary { cursor: pointer; padding: 18px 0; font-size: 14px; }
.debug-recent > summary span { color: var(--muted); margin-left: 6px; }
.debug-draw-editor { padding: 24px; margin-bottom: 24px; border-color: #b5c5d8; }
.debug-draw-editor form { max-width: 660px; }
.debug-draw-editor input[name=numbers] { font-variant-numeric: tabular-nums; letter-spacing: .06em; }
@media(max-width:540px){.debug-upcoming .section-heading{flex-wrap:wrap}.debug-upcoming,.debug-draw-editor{padding:18px}.debug-numbers span{width:28px;height:30px;font-size:11px}.debug-numbers{gap:4px}.debug-draw-editor .button-row{flex-wrap:wrap}}
@media (max-width: 850px) { .debug-games { grid-template-columns: 1fr; } }
@media (max-width: 540px) { .debug-search,.debug-game { padding: 18px; }.debug-search form label { min-width: 100%; }.debug-tabs .button { flex: 1; padding: 12px; font-size: 12px; }.debug-grid { gap: 4px; }.debug-grid.cols-10 .debug-cell { font-size: 10px; border-radius: 5px; }.debug-game .section-heading { flex-wrap: wrap; }.profile-menu nav { min-width: 160px; } }

/* A quiet workspace: one sidebar, one task, one save action. */
:root { --portal-accent: var(--ink); --portal-soft: var(--surface); }
.bot-portal { font-family: var(--font); font-size: 14px; }
.bot-portal h1 { font-size: var(--text-xl); letter-spacing: -.02em; }
.bot-portal h2 { font-size: var(--text-lg); }
.bot-portal h3 { font-size: 17px; }
.bot-portal .button { font-size: 14px; min-height: var(--control); }
.bot-portal input, .bot-portal select, .bot-portal textarea { font-size: 14px; min-height: var(--control); border-radius: var(--radius-sm); }
.bot-portal label { font-size: 13px; }
.bot-portal .button-dark { background: var(--ink); border-color: var(--ink); }
.bot-portal .button-dark:hover { background: var(--ink-hover); border-color: var(--ink-hover); }
.portal-loading { min-height: 350px; display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--muted); font-size: 13px; }
.portal-loader { width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--ink); border-radius: 100%; animation: portal-spin .7s linear infinite; }
@keyframes portal-spin { to { transform: rotate(360deg); } }
@keyframes portal-enter { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.portal-workspaces { margin: 40px 0 0; animation: portal-enter .2s ease-out; }
.portal-page-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 32px; }
.portal-page-head .eyebrow { font-size: var(--text-xs); margin-bottom: 6px; }
.portal-server-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.portal-server-card { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); display: flex; align-items: center; gap: 16px; transition: border-color .16s, transform .16s; }
.portal-server-card:hover { border-color: var(--line-strong); background: var(--surface); }
.portal-server-card > div { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.portal-server-card strong { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; }
.portal-server-card > div > span { color: var(--muted); font-size: 12px; }
.portal-server-card > .icon { margin-left: auto; width: 17px; height: 17px; }
.portal-server-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0; object-fit: cover; background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 600; }
.portal-caption { margin-top: 22px; font-size: 11px; color: var(--muted); line-height: 1.65; }
.portal-layout { display: grid; grid-template-columns: 200px minmax(0,1fr); min-height: calc(100svh - 175px); min-width: 0; max-width: 100%; }
.portal-sidebar { border-right: 1px solid var(--line); padding: 30px 18px 32px 0; display: flex; flex-direction: column; gap: 26px; position: sticky; top: 0; align-self: start; min-height: calc(100svh - 150px); min-width: 0; max-width: 100%; }
.portal-switcher { display: flex; align-items: center; gap: 10px; margin: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px; position: relative; }
.portal-switcher .portal-server-icon { width: 30px; height: 30px; border-radius: 8px; font-size: 10px; }
.portal-switcher select { border: 0; background: transparent; width: 100%; min-height: 30px; padding: 0 15px 0 0; margin: 0; font-size: 12px; font-weight: 600; appearance: none; text-overflow: ellipsis; cursor: pointer; }
.portal-switcher > .icon { position: absolute; right: 8px; width: 13px; height: 13px; pointer-events: none; }
.portal-sidebar nav { display: flex; flex-direction: column; gap: 5px; min-width: 0; max-width: 100%; }
.portal-advanced-nav { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.portal-advanced-nav > summary { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; color: var(--muted); font-size: 12px; cursor: pointer; list-style: none; }
.portal-advanced-nav > summary .icon { width: 14px; height: 14px; }
.portal-advanced-nav[open] > summary .icon { transform: rotate(180deg); }
.portal-section-title { margin: 32px 0 20px; }
.portal-page-intro { margin: 0 0 28px; }
.portal-page-intro .text-link { margin-top: 12px; }
.portal-subsettings { margin: 8px 0 24px; border-top: 1px solid var(--line); padding-top: 18px; }
.portal-subsettings > summary { cursor: pointer; font-size: 13px; margin-bottom: 20px; }
.portal-list { padding: 0 24px; }
.portal-list-row { display: flex; align-items: center; gap: 20px; justify-content: space-between; padding: 24px 0; border-bottom: 1px solid var(--line); }
.portal-list-row:last-child { border-bottom: 0; }
.portal-list-row > div:first-child { min-width: 0; }
.portal-list-row strong { font-size: 15px; overflow-wrap: anywhere; }
.portal-list-row p { color: var(--muted); font-size: 12px; margin-top: 7px; }
.portal-panel-role { display: grid; grid-template-columns: minmax(100px,1fr) minmax(100px,1fr) 80px 40px; align-items: start; gap: 10px; border-top: 1px solid var(--line); padding: 20px 0; }
.portal-panel-role > button { margin-top: 26px; }
.portal-panel-role > label { margin-bottom: 0; }
.portal-command-overrides > summary { cursor: pointer; display: flex; align-items: center; justify-content: space-between; padding: 22px 0; font-size: 14px; font-weight: 600; border-bottom: 1px solid var(--line); }
.portal-command-overrides > summary span { color: var(--muted); font-size: 12px; font-weight: 400; }
/* Members tab */
.portal-members-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 0 0 8px; }
.portal-members-toolbar .portal-search { flex: 1; min-width: 220px; margin: 0; }
.portal-members-sort { margin: 0; width: 170px; }
.portal-members-sort .select-button { margin: 0; }
.portal-members-note { margin: 4px 0 14px; }
.portal-member-list { border-top: 1px solid var(--line); }
.portal-member-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) 120px 64px 84px 16px; gap: 14px; align-items: center; padding: 11px 8px; border-bottom: 1px solid var(--line); transition: background .15s; }
.portal-member-row:hover { background: var(--surface); }
.portal-member-row > .icon { width: 15px; height: 15px; opacity: .4; }
.portal-member-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; display: inline-grid; place-items: center; background: var(--surface-2); font-size: 14px; font-weight: 650; flex: none; }
.portal-member-who { min-width: 0; display: grid; }
.portal-member-who strong { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.portal-member-who small, .portal-member-stat small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.portal-member-stat { display: grid; text-align: right; font-size: 14px; font-variant-numeric: tabular-nums; }
.portal-member-stat.warn { color: var(--danger); }
.portal-members-more { display: flex; justify-content: center; padding: 18px 0; }
.portal-member-head { display: flex; gap: 16px; align-items: flex-start; margin: 16px 0 20px; }
.portal-member-head .portal-member-avatar { width: 56px; height: 56px; font-size: 20px; }
.portal-member-head h2 { font-size: 22px; }
.portal-member-head .quiet { margin-top: 2px; font-size: 13px; }
.portal-member-head .help { margin-top: 8px; }
.portal-member-id { font-family: var(--mono); font-size: 12px; }
.portal-member-roles { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.portal-role-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 7px; border: 1px solid var(--line); border-radius: 999px; font-size: 12px; }
.portal-role-chip i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.portal-member-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.portal-member-stats article { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; display: grid; gap: 4px; }
.portal-member-stats span { font-size: 12px; color: var(--muted); }
.portal-member-stats strong { font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.portal-member-stats small { font-size: 12px; color: var(--muted); }
.portal-member-bar { display: block; height: 5px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-top: 4px; }
.portal-member-bar i { display: block; height: 100%; background: var(--ink); border-radius: inherit; }
.portal-member-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.portal-member-grid .portal-card { margin: 0; }
.portal-member-grid h3 { font-size: 15px; margin-bottom: 12px; }
.portal-member-grid .portal-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.portal-member-grid .portal-card-head h3 { margin: 0; }
.portal-member-wide { grid-column: 1 / -1; }
.portal-member-form label { margin-bottom: 12px; }
.portal-member-inline { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.portal-member-warn { display: flex; gap: 10px; align-items: flex-end; margin-top: 14px; }
.portal-member-warn label { flex: 1; margin: 0; }
.portal-member-history { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.portal-member-history li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.portal-member-history li > div { display: grid; min-width: 0; }
.portal-member-history strong { font-size: 14px; font-weight: 550; overflow-wrap: anywhere; }
.portal-member-history small { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.portal-member-items { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.portal-member-items li { display: inline-flex; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--surface); font-size: 13px; }
.portal-member-items span { color: var(--muted); }
@media (max-width: 760px) {
  .portal-member-row { grid-template-columns: 36px minmax(0, 1fr) auto 16px; }
  .portal-member-row .portal-member-stat:not(.balance) { display: none; }
  .portal-member-stats { grid-template-columns: 1fr 1fr; }
  .portal-member-grid { grid-template-columns: 1fr; }
  .portal-member-warn { flex-direction: column; align-items: stretch; }
}
/* Member page: header with standing and actions, tabs, timeline, action dialogs */
.portal-member-hero { display: flex; gap: 18px; align-items: flex-start; margin: 16px 0 18px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(180deg, var(--surface), var(--bg)); }
.portal-member-hero .portal-member-avatar { width: 64px; height: 64px; font-size: 24px; }
.portal-member-hero-main { flex: 1; min-width: 0; }
.portal-member-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.portal-member-title h2 { font-size: 22px; margin-right: 4px; overflow-wrap: anywhere; }
.portal-member-hero .quiet { margin-top: 4px; font-size: 13px; }
.portal-member-id { border: 0; background: var(--surface-2); border-radius: 6px; padding: 1px 6px; font-family: var(--mono); font-size: 12px; color: var(--muted); cursor: copy; }
.portal-member-id:hover { color: var(--ink); }
.portal-pill { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 550; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.portal-pill.ok { background: var(--success-soft); color: var(--success); }
.portal-pill.warn { background: var(--warning-soft); color: var(--warning); }
.portal-pill.danger { background: var(--danger-soft); color: var(--danger); }
.portal-pill.info { background: var(--info-soft); color: var(--info); }
.portal-member-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.portal-member-actions .button .icon { width: 14px; height: 14px; }
.portal-danger-button { border-color: var(--danger); color: var(--danger); }
.portal-danger-button:hover { background: var(--danger-soft); }
.portal-member-tabs { margin: 0 0 16px; }
.portal-member-panel > .portal-card, .portal-member-panel > .portal-standing { margin-bottom: 16px; }
.portal-standing { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; border-radius: var(--radius-sm); }
.portal-standing p { font-size: 13px; margin-top: 2px; }
.portal-standing.danger { background: var(--danger-soft); color: var(--danger); }
.portal-standing.warn { background: var(--warning-soft); color: var(--warning); }
.portal-standing .button { background: var(--bg); }
.portal-timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.portal-timeline li { display: flex; gap: 12px; padding: 10px 0; position: relative; }
.portal-timeline li:not(:last-child)::before { content: ''; position: absolute; left: 13px; top: 38px; bottom: -6px; width: 2px; background: var(--line); }
.portal-timeline-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); flex: none; }
.portal-timeline-icon .icon { width: 14px; height: 14px; }
.portal-timeline li.danger .portal-timeline-icon { background: var(--danger-soft); }
.portal-timeline li.warn .portal-timeline-icon { background: var(--warning-soft); }
.portal-timeline li.ok .portal-timeline-icon { background: var(--success-soft); }
.portal-timeline strong { font-size: 14px; font-weight: 600; }
.portal-timeline strong small { color: var(--faint); font-weight: 400; font-family: var(--mono); font-size: 11px; }
.portal-timeline p { font-size: 13px; margin: 2px 0; overflow-wrap: anywhere; }
.portal-timeline small { font-size: 12px; color: var(--muted); }
.portal-member-facts { margin: 0; display: grid; gap: 10px; }
.portal-member-facts > div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.portal-member-facts > div:last-child { border-bottom: 0; padding-bottom: 0; }
.portal-member-facts dt { color: var(--muted); }
.portal-member-facts dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.portal-member-facts a { text-decoration: underline; text-underline-offset: 3px; }
.portal-member-roles.large { margin: 0 0 14px; gap: 8px; }
.portal-member-roles.large .portal-role-chip { padding: 5px 6px 5px 10px; font-size: 13px; }
.portal-chip-remove { display: grid; place-items: center; width: 20px; height: 20px; margin-left: 2px; border: 0; border-radius: 50%; background: transparent; }
.portal-chip-remove:hover { background: var(--hover); }
.portal-chip-remove .icon { width: 12px; height: 12px; }
.portal-member-inline-form { display: flex; gap: 10px; align-items: center; }
.portal-member-inline-form > :not(button):not(.sr-only) { flex: 1; margin: 0; }
.portal-action-dialog { width: min(480px, calc(100vw - 32px)); }
.portal-action-dialog form { margin: 0; }
.portal-dialog-fields { display: grid; gap: 14px; margin-top: 16px; }
.portal-dialog-fields label, .portal-dialog-fields fieldset { margin: 0; }
.portal-dialog-fields fieldset { border: 0; padding: 0; }
.portal-dialog-fields legend { font-size: var(--text-sm); font-weight: 550; margin-bottom: 8px; padding: 0; }
.portal-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.portal-chip { margin: 0; cursor: pointer; }
.portal-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.portal-chip span { display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 13px; font-weight: 500; transition: background .15s, border-color .15s, color .15s; }
.portal-chip:hover span { background: var(--surface); }
.portal-chip input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.portal-chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.portal-dialog-switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; font-weight: 450; }
.portal-dialog-switch small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
@media (max-width: 760px) {
  .portal-member-hero { flex-direction: column; padding: 16px; }
  .portal-member-actions .button { flex: 1; }
  .portal-standing { flex-direction: column; align-items: stretch; }
}
/* Reply privacy: server default, then one row per category that opens to its commands */
.portal-reply-intro { margin: 0 0 18px; font-size: 13px; max-width: 640px; }
.portal-reply-intro strong { color: var(--ink); font-weight: 600; }
.portal-reply-table { margin-top: 14px; border-top: 1px solid var(--line); }
.portal-reply-category { border-top: 0; border-bottom: 1px solid var(--line); margin: 0; }
.portal-reply-category > summary { display: flex; align-items: center; gap: 12px; padding: 15px 4px; font-size: 14px; list-style: none; }
.portal-reply-category > summary::-webkit-details-marker { display: none; }
.portal-reply-category > summary strong { font-weight: 600; }
.portal-reply-category > summary span { margin-left: auto; color: var(--muted); font-size: 12px; font-weight: 400; }
.portal-reply-category > summary::after { content: ''; width: 7px; height: 7px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg) translateY(-2px); transition: transform .15s; }
.portal-reply-category[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
.portal-reply-category > .portal-field { background: var(--surface); border-radius: var(--radius-sm); padding: 12px 14px; margin: 0 0 6px; }
.portal-reply-commands { padding: 0 0 12px 14px; }
.portal-reply-fixed { display: inline-flex; align-items: center; min-height: var(--control-sm); font-size: 13px; color: var(--muted); }
.portal-automation-card { margin: 0 0 24px; }
.portal-automation-card summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; font-size: 15px; }
.portal-automation-card summary .portal-counter { font-size: 12px; }
.portal-automation-intro { font-size: 13px; color: var(--muted); margin: 20px 0; }
.portal-automation-fields { margin: 0; padding: 0; border: 0; min-width: 0; }
.portal-automation-row { padding: 20px 0; border-top: 1px solid var(--line); }
.portal-automation-row.form-grid,.portal-automation-forum > .form-grid { grid-template-columns: minmax(0,1fr) minmax(0,1fr) 40px; gap: 12px; }
.portal-automation-row.form-grid > button,.portal-automation-forum > .form-grid > button { margin-top: 25px; }
.portal-automation-row label { margin-bottom: 0; }
.portal-automation-forum > label { margin-top: 18px; }
.portal-checklist strong,.portal-quick-card strong { font-size: 14px; }
.portal-checklist > a > div > span,.portal-quick-card > span,.portal-empty p { font-size: 13px; }
@media(max-width:700px) {
 .portal-panel-role { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
 .portal-panel-role > button { align-self: end; justify-self: end; margin: 0; }
 .portal-list-row { align-items: flex-start; flex-direction: column; gap: 15px; }
 .portal-advanced-nav { width: 100%; }
 .site-dialog { padding: 26px; }
 .site-dialog-actions .button { flex: 1; }
}
.portal-workspace-group { margin: 0 0 36px; }
.portal-workspace-group .portal-card-head h2 { font-size: 18px; }
#portal-server-group-form fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.portal-network-members { margin: 22px 0; }
.portal-network-member { display: flex; gap: 14px; align-items: center; border-bottom: 1px solid var(--line); padding: 17px 0; }
.portal-network-member > div { flex: 1; min-width: 0; display: grid; gap: 6px; }
.portal-network-member strong { overflow-wrap: anywhere; }
.portal-network-member > div > span { font-size: 12px; color: var(--muted); }
.portal-sidebar a, .portal-sidebar-bottom button { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: var(--radius-sm); font-size: 13px; color: var(--muted); transition: background .15s, color .15s; }
.portal-sidebar a .icon, .portal-sidebar-bottom button .icon { width: 17px; height: 17px; opacity: .7; }
.portal-sidebar a:hover, .portal-sidebar-bottom button:hover { background: var(--hover); color: var(--ink); }
.portal-sidebar a.active { background: var(--surface-2); color: var(--ink); font-weight: 550; }
.portal-sidebar a.active .icon { opacity: 1; }
.portal-sidebar-bottom { display: flex; flex-direction: column; gap: 2px; margin-top: auto; padding-top: 50px; }
.portal-sidebar-bottom button { background: none; border: 0; width: 100%; text-align: left; }
.portal-sidebar-bottom button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.portal-content { min-width: 0; width: 100%; max-width: 1050px; padding: 38px 0 60px 32px; }
.portal-content #portal-section { animation: portal-enter .18s ease-out; }
.portal-channel-picker { position: relative; width: 100%; min-width: 0; }
.bot-portal .portal-channel-trigger { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 44px; margin: 0; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--bg); color: var(--ink); font: inherit; font-size: 14px; text-align: left; }
.portal-channel-trigger.has-selection { color: var(--ink); }
.portal-channel-summary { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.portal-channel-chevron { flex: 0 0 auto; display: flex; color: var(--faint); }
.portal-channel-chevron svg { width: 15px; height: 15px; }
.portal-channel-trigger:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.portal-channel-popover { position: absolute; top: calc(100% + 6px); left: 0; width: 100%; min-width: min(240px, 100%); z-index: 30; display: flex; flex-direction: column; padding: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: 0 8px 24px #0000000f; }
.portal-channel-picker.opens-above .portal-channel-popover { top: auto; bottom: calc(100% + 7px); }
.bot-portal .portal-channel-search { flex-shrink: 0; width: 100%; min-height: 38px; margin: 0 0 5px; padding: 8px 10px; background: var(--surface); border: 1px solid transparent; font-size: 12px; }
.portal-channel-options { overflow-y: auto; min-height: 0; overscroll-behavior: contain; }
.bot-portal .portal-channel-option { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 35px; border: 0; border-radius: 5px; padding: 8px 9px; margin: 0; background: white; color: var(--ink); font: inherit; font-size: 12px; text-align: left; }
.portal-channel-option > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.portal-channel-option:hover,.portal-channel-option:focus-visible { background: var(--hover); outline: none; }
.portal-channel-option[aria-selected=true] { background: var(--surface); color: var(--ink); }
.portal-channel-check { width: 15px; height: 15px; flex-shrink: 0; }
.portal-channel-check svg { width: 15px; height: 15px; }
.portal-channel-empty { margin: 10px; font-size: 12px; color: var(--faint); }
.portal-switcher .portal-channel-trigger { border: 0; padding: 0; min-height: 30px; font-weight: 600; background: transparent; }
.portal-switcher > .icon { display: none; }
.portal-switcher .portal-channel-popover { min-width: 220px; }
.portal-direction .portal-channel-trigger { min-height: 30px; padding: 5px 8px; font-size: 10px; }
.portal-channel-trigger[aria-invalid=true] { border-color: var(--danger); }
.portal-review-channels { margin-top: 20px; }
#portal-appeals-form .portal-card-head > label { margin: 0; display: flex; align-items: center; gap: 12px; font-size: 11px; }
#portal-appeals-form .portal-card-head .portal-toggle { margin: 0; }
.portal-unlink-confirm { margin-top: 20px; padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.portal-unlink-confirm > strong { font-size: 13px; }
.portal-unlink-confirm p { margin: 9px 0 16px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.portal-appeal-settings > summary { cursor: pointer; font-size: 14px; font-weight: 600; }
.portal-appeal-settings[open] > summary { margin-bottom: 22px; }
#portal-appeals-form fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
#portal-appeals-form .form-grid > label:has(textarea) { grid-column: 1 / -1; }
#portal-appeals-form .portal-toggle { display: flex; margin-top: 12px; }
.portal-mobile-context { display: none; }
.portal-live { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.portal-live > span { width: 6px; height: 6px; background: var(--success); border-radius: 50%; }
.portal-summary { background: var(--surface); border: 0; border-radius: var(--radius); padding: 28px; display: flex; justify-content: space-between; gap: 22px; }
.portal-summary > div > span { display: block; color: var(--muted); font-size: 11px; margin-bottom: 13px; }
.portal-summary strong { font-size: 23px; letter-spacing: -.035em; font-weight: 600; }
.portal-summary p { font-size: 12px; margin-top: 10px; color: var(--muted); max-width: 400px; }
.portal-summary .text-link { margin-top: 16px; font-size: 12px; }
.portal-summary-symbol { display: flex; justify-content: center; align-items: center; width: 50px; height: 50px; flex-shrink: 0; border-radius: 14px; background: var(--line); }
.portal-summary-symbol .icon { width: 25px; height: 25px; opacity: .7; }
.portal-stats { display: grid; grid-template-columns: 1.6fr 1fr 1fr; padding: 30px 0; margin-bottom: 2px; }
.portal-stats > div { padding: 0 24px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.portal-stats > div:first-child { padding-left: 0; }
.portal-stats > div:last-child { border: 0; }
.portal-stats span { font-size: 11px; color: var(--muted); }
.portal-stats strong { font-weight: 500; font-size: 22px; letter-spacing: -.035em; overflow: hidden; text-overflow: ellipsis; }
.portal-stats > div:first-child strong { font-size: 17px; line-height: 27px; }
.portal-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 25px; margin-bottom: 20px; }
.portal-card-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.portal-card-head > .icon { width: 18px; height: 18px; opacity: .6; }
.portal-card-head .text-link { min-height: 24px; font-size: 11px; }
.portal-counter { color: var(--muted); font-size: 11px; background: var(--surface-2); border-radius: 999px; padding: 3px 9px; }
.portal-checklist { margin: 0 -10px -5px; }
.portal-checklist > a { display: flex; align-items: center; gap: 13px; padding: 15px 10px; border-radius: 7px; }
.portal-checklist > a:hover { background: var(--surface); }
.portal-checklist > a + a { border-top: 1px solid var(--line); }
.portal-checklist > a > .icon { margin-left: auto; width: 15px; height: 15px; opacity: .6; }
.portal-check { width: 29px; height: 29px; flex-shrink: 0; border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center; }
.portal-check .icon { width: 13px; height: 13px; opacity: .5; }
.portal-check.complete { background: var(--success-soft); border-color: var(--success-soft); }
.portal-check.complete .icon { opacity: .8; }
.portal-checklist > a > div { display: flex; flex-direction: column; gap: 5px; }
.portal-checklist strong { font-size: 12px; font-weight: 500; }
.portal-checklist > a > div > span { color: var(--muted); font-size: 11px; }
.portal-quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.portal-quick-card { display: grid; grid-template-columns: 22px 1fr 14px; gap: 6px 12px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .15s, background .15s; }
.portal-quick-card:hover { border-color: var(--line-strong); background: var(--surface); }
.portal-quick-card > .icon { width: 18px; height: 18px; grid-row: 1/3; margin-top: 2px; }
.portal-quick-card strong { font-size: 13px; font-weight: 500; }
.portal-quick-card > span { grid-column: 2; font-size: 11px; color: var(--muted); line-height: 1.6; }
.portal-quick-card > .icon:last-child { grid-column: 3; grid-row: 1; width: 14px; height: 14px; }
.portal-empty { padding: 56px 24px; text-align: center; border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.portal-empty > .icon { width: 25px; height: 25px; opacity: .4; margin-bottom: 18px; }
.portal-empty h2, .portal-empty h3 { margin-bottom: 10px; }
.portal-empty p { font-size: 12px; color: var(--muted); max-width: 400px; margin: 0 auto; }
.portal-empty .button { margin-top: 22px; }
.portal-empty.compact { padding: 30px 15px; border: 0; }
.portal-notice { background: var(--surface); border: 0; padding: 14px 16px; font-size: 13px; color: var(--muted); border-radius: var(--radius-sm); line-height: 1.7; display: flex; align-items: flex-start; gap: 12px; margin-bottom: 22px; }
.portal-notice > .icon { width: 17px; height: 17px; margin-top: 2px; }
.portal-notice.error { background: var(--danger-soft); border-color: var(--danger-soft); color: var(--danger); }
.portal-inline-error { color: var(--danger); font-size: 12px; margin: 12px 0; }
.portal-settings-tools { display: flex; gap: 12px; margin-bottom: 30px; }
.portal-search { flex: 1; position: relative; display: flex; align-items: center; margin: 0; }
.portal-search > .icon { position: absolute; left: 13px; width: 17px; height: 17px; opacity: .5; }
.portal-search input { margin: 0; padding-left: 40px; padding-right: 36px; }
.portal-search kbd { font: inherit; font-size: 11px; color: var(--faint); border: 1px solid var(--line); padding: 1px 5px; border-radius: 3px; position: absolute; right: 13px; }
.portal-category-select { width: 165px; flex-shrink: 0; margin: 0; }
.portal-category-select select { margin: 0; }
.portal-setting-section { margin-bottom: 32px; }
.portal-setting-section > h2 { font-size: 13px; padding-bottom: 13px; margin-bottom: 0; color: var(--muted); font-weight: 500; }
.portal-setting-section > summary { font-size: 13px; padding: 4px 0 14px; color: var(--muted); font-weight: 500; cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; }
.portal-setting-section > summary::-webkit-details-marker { display: none; }
.portal-setting-section > summary::after { content: '+'; color: var(--faint); font-size: 16px; font-weight: 400; }
.portal-setting-section[open] > summary::after { content: '−'; }
.portal-fields { border-top: 1px solid var(--line); }
.portal-field { display: grid; grid-template-columns: minmax(0,1fr) minmax(190px,.9fr); align-items: center; gap: 24px; padding: 20px 8px; border-bottom: 1px solid var(--line); transition: background .15s; }
.portal-field.changed { background: var(--surface); }
.portal-field-label > label { font-size: 12px; margin: 0; line-height: 1.5; }
.portal-field-label > p { font-size: 11px; line-height: 1.6; color: var(--muted); margin-top: 6px; max-width: 340px; }
.portal-field-control { display: flex; align-items: center; gap: 8px; min-width: 0; }
.portal-field-control input, .portal-field-control select, .portal-field-control textarea { font-size: 12px; min-height: 39px; padding: 10px; margin: 0; }
.portal-field-control select[multiple] { min-height: 110px; }
.portal-field-toggle .portal-field-control { justify-content: flex-end; }
.portal-reset { border: 0; background: none; color: var(--faint); font-size: 10px; padding: 8px 0 8px 8px; line-height: 1.5; }
.portal-reset:hover { color: var(--ink); text-decoration: underline; }
.portal-toggle { display: inline-flex; flex-shrink: 0; position: relative; width: 34px; height: 21px; margin: 0; }
.portal-toggle input[type=checkbox] { width: 34px; height: 21px; min-height: 0; position: absolute; opacity: 0; margin: 0; inset: 0; cursor: pointer; z-index: 1; }
.portal-toggle > span { width: 34px; height: 21px; background: var(--line-strong); border-radius: 20px; display: block; transition: background .15s; }
.portal-toggle > span::after { content: ''; width: 15px; height: 15px; position: absolute; top: 3px; left: 3px; background: white; border-radius: 50%; box-shadow: 0 1px 2px #0002; transition: transform .15s; }
.portal-toggle input:checked + span { background: var(--ink); }
.portal-toggle input:checked + span::after { transform: translateX(13px); }
.portal-toggle input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 4px; }
.portal-savebar { position: sticky; bottom: 18px; margin-top: 22px; padding: 10px 12px 10px 18px; border: 1px solid var(--line); background: var(--bg); box-shadow: 0 6px 24px #0000000f; border-radius: 999px; display: flex; align-items: center; justify-content: space-between; gap: 16px; z-index: 3; animation: portal-enter .15s ease-out; }
.portal-savebar > div:first-child { display: flex; gap: 9px; align-items: center; }
.portal-savebar strong { font-size: 11px; font-weight: 500; }
.portal-unsaved-dot { width: 6px; height: 6px; background: var(--success); border-radius: 50%; }
.bot-portal .portal-savebar .button { min-height: 36px; padding: 8px 12px; font-size: 11px; }
.portal-inline-field { display: flex; align-items: flex-end; gap: 12px; }
.portal-inline-field label { flex: 1; max-width: 420px; margin-bottom: 0; }
.portal-inline-field .button { margin-bottom: 0; }
.portal-connected-label { margin-top: 18px; display: flex; align-items: center; gap: 9px; color: var(--success); font-size: 12px; }
.portal-connected-label > .icon { width: 16px; height: 16px; }
.portal-connected-label > span { margin-left: auto; color: var(--muted); font-size: 11px; }
.portal-sync-options { border-top: 1px solid var(--line); padding-top: 24px; margin-top: 24px; gap: 18px; }
.portal-sync-options label { margin-bottom: 4px; }
.portal-card .help { font-size: 11px; }
.portal-card-intro { margin: -7px 0 12px; }
.portal-role-row { display: grid; grid-template-columns: minmax(90px,1fr) 18px minmax(130px,1.2fr) 34px; align-items: center; gap: 14px; padding: 17px 0; border-top: 1px solid var(--line); }
.portal-role-row > div { display: flex; flex-direction: column; gap: 6px; }
.portal-role-row strong { font-size: 12px; font-weight: 500; }
.portal-role-row > div > span { font-size: 10px; color: var(--muted); }
.portal-role-row > label { margin: 0; }
.portal-role-row select { font-size: 12px; min-height: 39px; padding: 10px; margin: 0; }
.portal-map-arrow { font-size: 16px; color: var(--faint); }
.portal-role-row .portal-direction { grid-column: 3; margin-top: -3px; }
.portal-role-row .portal-direction select { font-size: 10px; padding: 4px 0; min-height: 24px; border: 0; color: var(--muted); }
.portal-form-end { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.portal-form-end .help { margin-top: 0; }
.portal-key-form { margin-top: 23px; max-width: 550px; }
.portal-key-form label { margin-bottom: 15px; }
.portal-key-help { margin-top: 20px; }
.portal-key-help summary { font-size: 11px; color: var(--muted); cursor: pointer; padding: 5px 0; }
.portal-key-help p { max-width: 620px; }
.portal-command-hint { display: flex; gap: 12px; color: var(--muted); padding: 9px 2px; align-items: flex-start; }
.portal-command-hint > .icon { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.portal-command-hint p { font-size: 11px; max-width: 560px; }
.portal-transfer-note { display: flex; gap: 20px; flex-wrap: wrap; font-size: 11px; color: var(--muted); margin: 22px 0; }
.portal-transfer-note > span { display: inline-flex; align-items: center; gap: 7px; }
.portal-transfer-note .icon { width: 14px; height: 14px; }
.portal-import-file { margin: 22px 0 0; max-width: 550px; }
.portal-import-file input { background: var(--surface); }
.portal-import-preview { padding: 20px 0 0; }
.portal-import-preview > div { display: flex; gap: 10px; align-items: center; font-size: 12px; }
.portal-import-preview .icon { width: 17px; height: 17px; }
.portal-confirm { display: flex; align-items: center; gap: 10px; line-height: 1.6; margin: 20px 0; font-size: 12px !important; }
.portal-confirm input { width: 16px; height: 16px; min-height: 0; margin: 0; accent-color: var(--ink); }
.portal-activity { border-top: 1px solid var(--line); }
.portal-activity article { display: flex; align-items: center; gap: 15px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.portal-activity-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--surface); flex-shrink: 0; }
.portal-activity-icon .icon { width: 15px; height: 15px; opacity: .6; }
.portal-activity strong { font-size: 12px; font-weight: 500; }
.portal-activity p { font-size: 11px; color: var(--muted); margin-top: 6px; overflow-wrap: anywhere; }
.portal-activity time { font-size: 10px; color: var(--muted); margin-left: auto; flex-shrink: 0; }
.portal-field-wide { grid-template-columns: 1fr; gap: 16px; }
.portal-field-wide .portal-field-control { align-items: flex-start; }
.portal-perks { min-width: 0; width: 100%; }
.portal-perks-enable { display: flex; align-items: center; gap: 9px; margin: 0 0 16px; font-size: 12px !important; }
.portal-perks-enable input[type=checkbox] { width: 15px; height: 15px; min-height: 0; padding: 0; margin: 0; accent-color: var(--ink); }
.portal-perk-scroll { overflow-x: auto; padding-bottom: 4px; }
.portal-perks table { border-collapse: collapse; width: 100%; min-width: 430px; }
.portal-perks th { text-align: left; font-size: 10px; font-weight: 500; color: var(--muted); padding: 8px 8px 8px 0; white-space: nowrap; }
.portal-perks td { padding: 5px 8px 5px 0; }
.portal-perks td input { width: 100%; min-width: 62px; padding: 8px; min-height: 34px; font-size: 11px; }
.portal-perk-remove { display: grid; place-items: center; border: 0; padding: 7px; background: transparent; border-radius: 5px; color: var(--muted); }
.portal-perk-remove:hover { background: var(--danger-soft); }
.portal-perk-remove .icon { width: 13px; height: 13px; }
.portal-add-perk { border: 0; background: transparent; color: var(--ink); font-size: 11px; margin-top: 9px; padding: 5px 0; }
.portal-add-perk .icon { width: 13px; height: 13px; }
.bot-portal input:disabled, .bot-portal select:disabled { opacity: .55; background: var(--surface); cursor: not-allowed; }
.portal-economy-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.portal-economy-toolbar .quiet { font-size: 12px; }
.portal-connection-picker { display: flex; align-items: flex-end; gap: 16px; }
.portal-connection-picker > label { flex: 1; margin-bottom: 0; }
.portal-connection-picker .button-row { padding-bottom: 1px; flex-wrap: nowrap; }
.portal-connection-summary { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 20px; font-size: 11px; color: var(--muted); }
.portal-connection-summary code { font-size: 11px; }
.portal-currency-list article { display: flex; align-items: center; gap: 15px; padding: 20px 0; border-top: 1px solid var(--line); }
.portal-currency-list article:last-child { padding-bottom: 0; }
.portal-currency-symbol { display: grid; place-items: center; background: var(--surface); width: 38px; height: 38px; border-radius: 10px; font-size: 15px; flex-shrink: 0; }
.portal-currency-list article > div:first-of-type { min-width: 0; }
.portal-currency-list strong { font-size: 13px; font-weight: 500; }
.portal-currency-list p { color: var(--muted); font-size: 11px; margin-top: 5px; }
.portal-currency-list article > div > span { color: var(--faint); font-size: 10px; line-height: 1.5; display: block; margin-top: 4px; }
.portal-currency-list .button-row { margin-left: auto; flex-wrap: nowrap; gap: 7px; }
.bot-portal .portal-currency-list .button { min-height: 34px; padding: 8px 10px; font-size: 10px; }
.portal-currency-list .button .icon { width: 13px; height: 13px; }
.portal-editor { background: var(--surface); border-color: var(--line); animation: portal-enter .16s ease-out; }
.portal-editor > .form-grid { gap: 0 18px; }
.portal-editor label { font-size: 12px; }
.portal-rate { display: grid; grid-template-columns: 1fr 20px 1fr; align-items: center; gap: 14px; }
.portal-rate > span { color: var(--faint); text-align: center; }
.portal-rate label { margin-bottom: 20px; }
.portal-currency-switches { display: flex; flex-wrap: wrap; gap: 10px 25px; margin: 10px 0 22px; }
.portal-currency-switches .portal-confirm { margin: 0; font-size: 11px !important; }
.portal-fees { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 0 0 25px; padding: 18px 0; }
.portal-fees > summary { cursor: pointer; font-size: 12px; color: var(--muted); }
.portal-fees > .help { margin-top: 13px; }
.portal-fees h3 { font-size: 12px; margin: 20px 0 13px; font-weight: 500; }
.portal-fees .form-grid { gap: 18px; }
.portal-fees .form-grid label { margin-bottom: 5px; }
.portal-ticket-picker { display: flex; gap: 14px; align-items: flex-end; }
.portal-ticket-picker > label { flex: 1; margin: 0; }
.portal-ticket-picker > .button-row { padding-bottom: 1px; flex-wrap: nowrap; }
#portal-ticket-form label { font-size: 12px; }
.portal-ticket-settings { border-top: 1px solid var(--line); }
.portal-ticket-settings > summary { cursor: pointer; font-size: 12px; padding: 15px 0; }
.portal-ticket-settings .portal-field { padding-left: 0; padding-right: 0; }
.portal-ticket-settings .portal-fields { border-top: 0; }
.portal-ticket-flow { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; margin-bottom: 32px; }
.portal-ticket-step { min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); }
.portal-ticket-step .portal-card-head { align-items: flex-start; gap: 10px; }
.portal-ticket-step h3 { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 500; }
.portal-ticket-step h3 > span { flex-shrink: 0; border: 1px solid var(--line); border-radius: 5px; padding: 4px 6px; font-size: 10px; color: var(--muted); }
.portal-ticket-step .help { font-size: 11px; line-height: 1.7; margin-top: 10px; }
.portal-ticket-step .text-link { flex-shrink: 0; font-size: 10px; }
.portal-ticket-step p, .portal-ticket-step strong, .portal-ticket-choices { overflow-wrap: anywhere; }
.portal-ticket-mock { margin-top: 13px; padding: 15px; border-left: 3px solid var(--line-strong); border-radius: 4px; background: var(--surface); font-size: 12px; }
.portal-ticket-mock p { white-space: pre-wrap; line-height: 1.7; margin-top: 5px; }
.portal-ticket-mock-button { display: inline-block; margin-top: 13px; padding: 8px 11px; background: var(--surface-2); border-radius: 5px; font-size: 11px; }
.portal-ticket-question { display: block; font-size: 12px; line-height: 1.6; font-weight: 500; margin: 12px 0 8px; }
.portal-ticket-topics { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.portal-ticket-topic { max-width: 100%; overflow-wrap: anywhere; border: 1px solid var(--line); background: white; border-radius: 6px; padding: 8px 10px; font: inherit; font-size: 11px; }
.portal-ticket-topic[aria-pressed=true] { border-color: var(--ink); background: var(--surface-2); }
.portal-ticket-topic-name { font-size: 11px; color: var(--muted); }
.portal-ticket-choices { padding-left: 18px; margin: 8px 0 16px; font-size: 12px; line-height: 1.8; }
.portal-ticket-textarea { border: 1px solid var(--line); border-radius: 6px; padding: 12px; min-height: 65px; font-size: 11px; color: var(--muted); }
.portal-ticket-textarea span { display: block; margin-top: 8px; font-size: 10px; }
.portal-ticket-file { display: flex; align-items: center; gap: 6px; padding: 11px 0; font-size: 11px; }
.portal-ticket-file .icon { width: 13px; height: 13px; }
@media (max-width: 1020px) { .portal-ticket-flow { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .portal-ticket-step { scroll-behavior: auto; } }

@media (min-width: 1200px) { .portal-content { padding-left: 50px; padding-right: 18px; } }
@media (max-width: 1020px) {
  .portal-layout { grid-template-columns: 190px minmax(0,1fr); }
  .portal-sidebar { padding-right: 14px; }
  .portal-content { padding-left: 28px; }
  .portal-quick-grid { grid-template-columns: 1fr; gap: 12px; }
  .portal-quick-card { padding: 20px; }
  .portal-field { grid-template-columns: minmax(0,1fr) minmax(150px,.9fr); gap: 18px; }
  .portal-card { padding: 21px; }
  .portal-role-row { gap: 9px; grid-template-columns: minmax(85px,1fr) 12px minmax(120px,1.2fr) 34px; }
}
@media (max-width: 760px) {
  .portal-layout { grid-template-columns: minmax(0,1fr); }
  .portal-sidebar { position: static; min-height: 0; border: 0; padding: 22px 0 0; gap: 18px; }
  .portal-switcher { max-width: 320px; }
  .portal-sidebar nav { flex-direction: row; overflow-x: auto; padding: 0 0 14px; border-bottom: 1px solid var(--line); gap: 6px; overscroll-behavior-x: contain; }
  .portal-sidebar nav a { white-space: nowrap; padding: 10px 12px; gap: 7px; font-size: 11px; }
  .portal-sidebar nav a .icon { width: 15px; height: 15px; }
  .portal-sidebar-bottom { display: none; }
  .portal-content { padding: 26px 0 45px; max-width: none; }
  .portal-content .portal-page-head .eyebrow { display: none; }
  .portal-page-head { margin-bottom: 26px; }
  .portal-summary { padding: 24px; }
  .portal-summary strong { font-size: 22px; }
  .portal-quick-grid { grid-template-columns: 1fr 1fr; }
  .portal-quick-card { padding: 20px 17px; }
  .portal-workspaces { margin-top: 34px; }
  .portal-server-card { padding: 20px; }
  .portal-field { grid-template-columns: minmax(0,1fr) minmax(160px,.9fr); }
}
@media (max-width: 540px) {
  .signin-actions { flex-direction: column; align-items: stretch; }
  .bot-portal h1 { font-size: 29px; }
  .portal-page-head { gap: 14px; align-items: flex-start; }
  .portal-page-head > .button-row { gap: 7px; }
  .portal-page-head > .button-row .button { font-size: 11px; padding: 10px; min-height: 38px; }
  .portal-server-grid { grid-template-columns: 1fr; }
  .portal-server-card { padding: 23px 20px; }
  .portal-summary { padding: 22px; }
  .portal-summary strong { font-size: 20px; }
  .portal-summary-symbol { display: none; }
  .portal-stats { grid-template-columns: 1.5fr 1fr 1fr; padding: 26px 0; }
  .portal-stats > div { padding: 0 14px; gap: 10px; }
  .portal-stats span { font-size: 10px; }
  .portal-stats > div:first-child strong { font-size: 14px; line-height: 24px; }
  .portal-stats strong { font-size: 20px; }
  .portal-quick-grid { grid-template-columns: 1fr; }
  .portal-card { padding: 20px; margin-bottom: 16px; }
  .portal-card-head { margin-bottom: 16px; }
  .portal-card-head h2 { font-size: 17px; }
  .portal-live { font-size: 10px; margin-top: 11px; }
  .portal-settings-tools { flex-wrap: wrap; gap: 10px; margin-bottom: 25px; }
  .portal-search { min-width: 100%; }
  .portal-category-select { width: 100%; }
  .portal-search kbd { display: none; }
  .portal-field { grid-template-columns: 1fr; padding: 20px 3px; gap: 12px; }
  .portal-field-toggle { grid-template-columns: minmax(0,1fr) 72px; gap: 15px; }
  .portal-field-control { width: 100%; }
  .portal-field-toggle .portal-reset { display: none; }
  .portal-field-control input, .portal-field-control select, .portal-field-control textarea { min-height: 42px; }
  .portal-savebar { bottom: 10px; gap: 10px; padding: 12px; }
  .portal-savebar strong { font-size: 10px; }
  .portal-savebar .button-row { gap: 6px; }
  .portal-savebar .portal-unsaved-dot { display: none; }
  .bot-portal .portal-savebar .button { font-size: 10px; padding: 8px 10px; }
  .portal-inline-field { flex-wrap: wrap; }
  .portal-inline-field label { flex: auto; width: 100%; max-width: none; }
  .portal-inline-field .button { width: 100%; }
  .portal-connected-label { flex-wrap: wrap; font-size: 11px; }
  .portal-connected-label > span { width: 100%; margin-left: 25px; }
  .portal-sync-options { gap: 15px; }
  .portal-role-row { grid-template-columns: minmax(0,1fr) 34px; gap: 12px; padding: 18px 0; }
  .portal-role-row > div { grid-column: 1; grid-row: 1; }
  .portal-role-row > .portal-map-arrow { display: none; }
  .portal-role-row > label:not(.portal-toggle):not(.portal-direction) { grid-column: 1/-1; grid-row: 2; }
  .portal-role-row > .portal-toggle { grid-column: 2; grid-row: 1; }
  .portal-role-row .portal-direction { grid-column: 1/-1; grid-row: 3; margin-top: -8px; }
  .portal-role-row .portal-direction select { min-height: 30px; }
  .portal-form-end { flex-direction: column-reverse; align-items: stretch; gap: 14px; }
  .portal-form-end .help { text-align: center; font-size: 10px; }
  .portal-activity article { gap: 12px; flex-wrap: wrap; }
  .portal-activity article > div { flex: 1; }
  .portal-activity time { width: 100%; margin-left: 44px; }
  .portal-economy-toolbar { align-items: flex-start; flex-direction: column; gap: 14px; }
  .portal-connection-picker { flex-wrap: wrap; }
  .portal-connection-picker > label { flex: auto; width: 100%; }
  .portal-connection-summary { gap: 12px; }
  .portal-currency-list article { flex-wrap: wrap; gap: 12px; }
  .portal-currency-list article > div:first-of-type { flex: 1; }
  .portal-currency-list .button-row { width: 100%; margin-left: 50px; }
  .portal-currency-list .button-row .button:first-child { flex: 1; }
  .portal-rate { gap: 9px; grid-template-columns: minmax(0,1fr) 15px minmax(0,1fr); }
  .portal-rate input { min-width: 0; }
  .portal-currency-switches { gap: 15px; }
  .portal-editor .form-grid { gap: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .bot-portal * { animation: none !important; transform: none !important; }
  .portal-loader { border-top-color: var(--ink); }
}
