@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/Manrope-Regular.ttf') format('truetype'); }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/Manrope-Medium.ttf') format('truetype'); }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/Manrope-Bold.ttf') format('truetype'); }
@font-face { font-family: 'Space Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/SpaceMono-Regular.woff2') format('woff2'); }
@font-face { font-family: 'Space Mono'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/SpaceMono-Bold.woff2') format('woff2'); }

:root {
  --bg: #000;
  --panel: #141414;
  --panel-2: #1f1f1f;
  --panel-3: #242424;
  --line: #222;
  --line-2: #303030;
  --text: #f6f6f6;
  --muted: #7a7a7a;
  --muted-2: #515151;
  --purple: rgba(237,100,50,.18);
  --brand: #ed6432;
  --brand-hover: #d4552a;
  --green: #53c93f;
  --green-bg: #13330f;
  --blue: #4788ff;
  --yellow: #f5b51b;
  --pink: #ed6432;
  --radius: 6px;
  --container: min(1546px, calc(100vw - 40px));
  --topbar-h: 64px;
  --font: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'Space Mono', monospace;
  --card-radius: 12px;
  --card-pad: 18px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; background: var(--bg); color: var(--text); }
body { position: relative; isolation: isolate; font-family: var(--font); font-size: 12px; font-weight: 700; line-height: 1.35; overflow-x: hidden; overflow-y: auto; }
body:before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 1; background-image: linear-gradient(rgba(255,255,255,.028) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px); background-size: 32px 32px, 32px 32px; mask-image: linear-gradient(to bottom, #000, transparent 78%); }
button, input, select, textarea { font: inherit; }
button { border: 0; background: none; color: inherit; cursor: pointer; }
button:disabled { opacity: .52; cursor: not-allowed; }
button[data-unavailable] { cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { display: block; }
[hidden] { display: none !important; }
.truncate { display: block; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mono-value { font-family: var(--mono); font-size: 11px; }

.auth-screen { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(420px, 100%); background: color-mix(in srgb, var(--panel) 94%, white); border: 1px solid var(--line-2); border-radius: 10px; padding: 28px; box-shadow: 0 20px 80px rgba(0,0,0,.42); }
.auth-card h1 { font-size: 24px; line-height: 1.1; margin: 22px 0 8px; text-wrap: balance; }
.auth-sub { color: var(--muted); font-weight: 500; margin-bottom: 20px; }
.auth-form { display: grid; gap: 14px; }

.topbar { position: sticky; top: 0; z-index: 50; min-height: var(--topbar-h); border-bottom: 1px solid #151515; background: rgba(2,2,2,.94); backdrop-filter: blur(16px); }
.topbar-inner { width: var(--container); min-height: var(--topbar-h); margin: 0 auto; display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 9px; min-width: max-content; }
.brand-box { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: #101010; color: #fff; overflow: hidden; border: 1px solid #242424; }
.brand-logo { width: 26px; height: 26px; object-fit: contain; display: block; }
.brand-name { font-size: 21px; font-weight: 800; letter-spacing: -.04em; }
.brand-name[data-brand-name] { white-space: nowrap; }
.brand-name .bn-cell {
  display: inline-block;
  color: currentColor;
  opacity: .55;
  transform: translateY(-1px);
  transition: opacity .18s ease, transform .18s ease, color .18s ease, text-shadow .25s ease;
  will-change: transform, opacity;
}
.brand-name .bn-cell--done {
  opacity: 1;
  transform: translateY(0);
  text-shadow: 0 0 12px rgba(255,255,255,.18);
}
.brand-name--inline,
h1 .brand-name,
h2 .brand-name {
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  line-height: inherit;
  color: inherit;
}
@media (prefers-reduced-motion: reduce) {
  .brand-name .bn-cell { transition: none; opacity: 1; transform: none; text-shadow: none; }
}
.nav { height: 100%; min-width: 0; display: flex; align-items: center; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav-btn { min-height: 38px; display: inline-flex; align-items: center; gap: 8px; padding: 0 12px; color: #8c8c8c; font-size: 12px; font-weight: 800; border: 1px solid transparent; border-radius: 999px; white-space: nowrap; transition: color .16s ease, background .16s ease, border-color .16s ease, transform .16s ease; }
.nav-btn svg { width: 15px; height: 15px; color: #686868; transition: color .16s ease; }
.nav-btn:hover { color: var(--text); background: #111; border-color: #202020; }
.nav-btn:hover svg, .nav-btn.is-active svg { color: var(--brand); }
.nav-btn.is-active { color: var(--text); background: var(--panel-2); border-color: #2a2a2a; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.top-pill { min-height: 34px; display: inline-flex; align-items: center; gap: 8px; padding: 0 13px; border: 1px solid #242424; border-radius: 999px; color: #d8d8d8; background: #050505; white-space: nowrap; }
.top-pill svg { width: 14px; height: 14px; color: #bfbfbf; }
.top-icon { width: 34px; height: 34px; display: grid; place-items: center; color: var(--pink); border: 1px solid #242424; border-radius: 999px; background: #050505; transition: transform .16s ease, border-color .16s ease; }
.top-icon svg { width: 16px; height: 16px; }
.top-icon:hover, .top-pill:hover { border-color: #3a3a3a; }
.top-icon:hover { transform: translateY(-1px); }
.top-icon.telegram { color: #22a8ff; }

.page { width: var(--container); margin: 20px auto 42px; animation: pageIn .18s ease-out both; }
.page.support-page { width: 100%; margin: 0; animation: none; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.grid-main { display: grid; grid-template-columns: minmax(330px, 464px) minmax(0, 1fr); gap: 18px; align-items: start; }
.stack { display: grid; gap: 18px; }
.panel { background: linear-gradient(180deg, rgba(255,255,255,.018), transparent 110px), var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; box-shadow: 0 18px 50px rgba(0,0,0,.18); }
.panel-head { min-height: 48px; display: flex; align-items: center; gap: 9px; padding: 0 16px; background: rgba(31,31,31,.78); border-bottom: 1px solid #202020; font-size: 15px; font-weight: 800; }
.panel-head svg { width: 16px; height: 16px; color: #d8d8d8; }
.panel-head svg:first-child { display: none; }
.panel-body { padding: 16px; }
.panel-title { display: flex; align-items: center; gap: 9px; font-size: 18px; font-weight: 800; margin-bottom: 18px; text-wrap: balance; }
.panel-title svg { width: 18px; height: 18px; color: #dcdcdc; }

.hero { min-height: 230px; position: relative; padding: 42px 40px; overflow: hidden; background: #151515; isolation: isolate; }
.hero-copy { position: relative; z-index: 5; width: min(440px, 56%); }
.hero h1 { color: #fff; font-size: clamp(28px, 3vw, 42px); line-height: 1.04; letter-spacing: -.04em; margin-bottom: 18px; text-wrap: balance; text-shadow: 0 2px 10px rgba(0,0,0,.28); }
.hero p { color: #fff; font-size: 13px; font-weight: 700; text-shadow: 0 1px 8px rgba(0,0,0,.3); }
.hero-visual { position: absolute; right: 0; bottom: 0; z-index: 1; width: 52%; height: 100%; object-fit: cover; object-position: center; opacity: .92; pointer-events: none; user-select: none; -webkit-user-drag: none; }
.hero:before { content: ""; position: absolute; inset: 0; z-index: 4; pointer-events: none; opacity: .05; mix-blend-mode: screen; background-image: radial-gradient(circle at 20% 30%, rgba(255,255,255,.75) 0 1px, transparent 1.4px), radial-gradient(circle at 70% 60%, rgba(255,255,255,.55) 0 .8px, transparent 1.2px); background-size: 7px 7px, 11px 11px; }
.hero:after { content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; background: linear-gradient(90deg, #151515 0%, #151515 44%, rgba(21,21,21,.82) 58%, rgba(21,21,21,.1) 100%); }
.hero-art { position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
.hero-art span { position: absolute; display: block; }
.hero-art span:nth-child(1) { right: -110px; bottom: -160px; width: 520px; height: 270px; border: 2px solid rgba(255,255,255,.07); border-radius: 50%; }
.hero-art span:nth-child(2) { right: 54px; top: -70px; width: 70px; height: 340px; transform: rotate(42deg); background: linear-gradient(180deg, transparent, rgba(255,255,255,.08), transparent); }
.hero-art span:nth-child(3) { right: 158px; top: 58px; width: 8px; height: 8px; transform: rotate(45deg); background: rgba(255,255,255,.72); box-shadow: 0 0 18px rgba(255,255,255,.4); }
.hero-money { min-height: 230px; display: grid; place-items: center; position: relative; overflow: hidden; text-align: center; }
.hero-money:before, .hero-money:after { content: ""; position: absolute; border: 2px solid #242424; border-radius: 50%; pointer-events: none; }
.hero-money:before { width: 760px; height: 380px; bottom: -300px; }
.hero-money:after { width: 430px; height: 210px; bottom: -160px; }
.hero-money strong { position: relative; z-index: 1; font-size: clamp(44px, 5vw, 66px); letter-spacing: -.04em; font-family: var(--mono); }
.hero-money span { position: relative; z-index: 1; color: var(--muted-2); margin-top: -22px; display: block; text-align: center; }

.online { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 20px; font-size: 18px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #09c767; box-shadow: 0 0 12px #09c767; display: inline-block; margin-right: 10px; }
.list-row { min-height: 42px; border-radius: 7px; background: var(--panel-3); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 13px; margin-bottom: 10px; border: 1px solid transparent; transition: background .16s ease, border-color .16s ease, transform .16s ease; }
.list-row:hover { background: #292929; border-color: #353535; transform: translateY(-1px); }
.list-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row time { color: var(--muted-2); font-weight: 500; white-space: nowrap; }

.chart { min-height: 307px; padding: 20px; display: flex; flex-direction: column; }
.chart-head { display: flex; align-items: start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.chart-canvas { height: 190px; position: relative; display: grid; grid-template-rows: repeat(5, 1fr); }
.chart-line { border-top: 1px solid #202020; position: relative; }
.chart-labels { display: flex; justify-content: space-between; gap: 10px; color: var(--muted-2); font-size: 11px; font-weight: 500; margin-left: 42px; overflow: hidden; }
.chart-labels span { white-space: nowrap; }
.chart-svg { position: absolute; inset: 0 0 20px 44px; width: calc(100% - 44px); height: calc(100% - 20px); overflow: visible; }
.chart-empty { position: absolute; inset: 0 0 20px 44px; display: grid; place-items: center; color: var(--muted-2); font-weight: 500; text-align: center; z-index: 1; }
.chart-path { stroke-dasharray: 720; stroke-dashoffset: 720; animation: drawChart .75s ease-out forwards; }
.chart-point { opacity: 0; animation: fadeIn .18s ease-out .55s forwards; }
.no-route-motion .panel,
.no-route-motion .mini-metric,
.no-route-motion .summary-card,
.no-route-motion .domain-cube,
.no-route-motion .kpi,
.no-route-motion .step-grid > div,
.no-route-motion .chart-path,
.no-route-motion .chart-point {
  animation: none !important;
}
.no-route-motion .chart-path { stroke-dashoffset: 0; }
.no-route-motion .chart-point { opacity: 1; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; color: var(--muted-2); font-size: 11px; font-weight: 500; }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }

/* Chart.js canvas host (Polymarket-style charts ported from the public site). */
.chart-cv { position: relative; height: 200px; width: 100%; }
.chart-cv canvas { display: block; width: 100% !important; height: 100% !important; }
.chart-cv[data-empty] .chart-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted-2); font-weight: 500; text-align: center; }
@media (prefers-reduced-motion: reduce) {
  .chart-cv canvas { animation: none !important; }
}

.top-domains { min-height: 202px; padding: 20px; }
.domain-cubes, .kpi-grid { display: grid; gap: 13px; }
.domain-cubes { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.domain-cube, .kpi { min-height: 124px; border: 1px solid var(--line-2); border-radius: 9px; padding: 14px; display: grid; align-content: center; text-align: center; background: rgba(255,255,255,.016); transition: transform .16s ease, border-color .16s ease, background .16s ease; }
.domain-cube:hover, .kpi:hover { transform: translateY(-2px); border-color: #3c3c3c; background: rgba(255,255,255,.03); }
.domain-cube.is-empty { opacity: .35; }
.domain-cube small { align-self: start; text-align: left; color: var(--muted-2); font-size: 12px; font-weight: 500; overflow-wrap: anywhere; }
.domain-cube strong, .kpi strong { font-size: 28px; line-height: 1.1; font-family: var(--mono); }
.domain-cube span, .kpi span { margin-top: 6px; color: #d9d9d9; }
.kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.tabs { min-height: 54px; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 10px; display: flex; align-items: center; gap: 4px; padding: 7px; margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { min-height: 38px; display: inline-flex; align-items: center; position: relative; padding: 0 13px; color: var(--muted); border-radius: 7px; white-space: nowrap; }
.tab.is-active { color: var(--text); background: #101010; }

.form-line { display: grid; grid-template-columns: minmax(0, 1fr) minmax(140px, 180px); gap: 14px; align-items: end; margin: 18px 0; }
.label { display: block; font-size: 12px; margin-bottom: 4px; }
.hint { display: block; color: var(--muted-2); font-size: 10px; font-weight: 500; line-height: 1.35; }
.input, .select { height: 34px; min-width: 0; background: #111; border: 1px solid #2a2a2a; border-radius: 7px; color: var(--text); padding: 0 11px; outline: 0; transition: border-color .16s ease, background .16s ease, box-shadow .16s ease; }
.input:focus, .select:focus, .textarea:focus { border-color: color-mix(in srgb, var(--brand) 68%, #2a2a2a); box-shadow: 0 0 0 3px rgba(237,100,50,.08); }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #555 50%), linear-gradient(135deg, #555 50%, transparent 50%); background-position: calc(100% - 14px) 13px, calc(100% - 9px) 13px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
.select-button { display: inline-flex; align-items: center; justify-content: space-between; text-align: left; width: 100%; background-image: none; }
.select-button:after { content: ""; width: 7px; height: 7px; border-right: 1px solid #666; border-bottom: 1px solid #666; transform: rotate(45deg) translateY(-2px); margin-left: 12px; flex: 0 0 auto; }
.segmented { height: 34px; display: grid; grid-template-columns: 1fr 1fr; border: 1px solid #2a2a2a; border-radius: 7px; overflow: hidden; background: #050505; }
.segmented button { transition: background .16s ease, color .16s ease; }
.segmented button.is-active { background: #252525; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid #202020; padding-top: 14px; margin-top: 14px; }
.btn { min-height: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 15px; border-radius: 7px; background: #fff; color: #111; transition: transform .16s ease, background .16s ease; }
.btn:hover { transform: translateY(-1px); }
.btn svg, .btn img { width: 14px; height: 14px; flex-shrink: 0; }
.btn-dark { background: var(--panel-3); color: var(--text); }
.toggle { width: 40px; height: 22px; border-radius: 999px; background: #3b3b3b; position: relative; transition: background .16s ease; }
.toggle:after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; background: #111; left: 2px; top: 2px; transition: transform .16s ease, background .16s ease; }

.table-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.table-toolbar .filters { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.table-wrap { width: 100%; overflow-x: auto; border: 1px solid #202020; border-radius: var(--card-radius); }
.table { width: 100%; min-width: 0; table-layout: fixed; border-collapse: collapse; }
.table th, .table td { height: 51px; padding: 0 13px; border-bottom: 1px solid #202020; border-right: 1px solid #202020; text-align: left; white-space: nowrap; }
.table th { height: 45px; background: #1a1a1a; font-size: 11px; color: #bdbdbd; text-transform: uppercase; letter-spacing: 0; }
.table td { font-size: 12px; }
.table td, .table th { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.table tr:last-child td { border-bottom: 0; }
.table th:last-child, .table td:last-child { border-right: 0; }
.status { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; color: var(--green); background: var(--green-bg); border: 1px solid #1b5f13; font-size: 10px; }
.ns-pill { display: inline-flex; align-items: center; gap: 9px; min-height: 32px; max-width: 210px; padding: 0 10px; border: 1px solid #2a2a2a; border-radius: 7px; font-family: var(--mono); overflow: hidden; vertical-align: middle; }
.ns-list { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.ns-pill svg { width: 13px; height: 13px; flex: 0 0 auto; color: var(--muted); }
.actions { display: inline-flex; align-items: center; gap: 4px; min-height: 30px; padding: 0 6px; background: var(--panel-3); border: 1px solid #2b2b2b; border-radius: 999px; color: #777; }
.actions svg { width: 13px; height: 13px; }
.actions button, .actions .icon-link { width: 24px; height: 24px; display: grid; place-items: center; color: inherit; border-radius: 50%; transition: color .16s ease, background .16s ease; text-decoration: none; }
.actions button:hover, .actions .icon-link:hover, .page-arrow:hover, .page-num:hover { color: var(--text); background: #333; }
/* NS just verified → pencil blinks + radiates a brand ring until the operator
   opens the domain editor (next workflow step). Cleared on click in JS. */
.actions button.domain-edit-pulse { color: var(--brand); background: color-mix(in srgb, var(--brand) 16%, transparent); animation: domain-edit-pulse 1.5s ease-out infinite; }
.actions button.domain-edit-pulse:hover { color: var(--brand); background: color-mix(in srgb, var(--brand) 26%, transparent); }
.actions button.domain-edit-pulse svg { animation: domain-edit-blink 1.5s ease-in-out infinite; }
@keyframes domain-edit-pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand) 55%, transparent); }
  70%  { box-shadow: 0 0 0 6px color-mix(in srgb, var(--brand) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand) 0%, transparent); }
}
@keyframes domain-edit-blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: .4; }
}
@media (prefers-reduced-motion: reduce) {
  .actions button.domain-edit-pulse, .actions button.domain-edit-pulse svg { animation: none; }
}
.pagination { min-height: 72px; display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 0 4px; color: var(--muted); flex-wrap: wrap; }
.page-num { width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: 7px; }
.page-num.is-active { border: 1px solid #fff; color: #fff; }
.page-arrow, .page-size { display: inline-grid; place-items: center; }
.page-size { width: auto; }

.side-stat { height: auto; min-height: 224px; }
.stat-line { display: grid; grid-template-columns: 1fr auto; align-items: center; min-height: 38px; padding: 0 10px; margin: 6px 0; border: 1px solid transparent; border-radius: 7px; }
.stat-line.is-active { background: var(--purple); border-color: rgba(237,100,50,.24); }
.divider { height: 1px; background: #202020; margin: 18px 0 14px; }
.side-value { float: right; font-family: var(--mono); }

.support-shell { height: calc(100dvh - var(--topbar-h)); display: grid; grid-template-columns: 300px minmax(0, 1fr) 286px; overflow: hidden; }
.support-left, .support-right { background: #151515; border-right: 1px solid #202020; padding: 16px 14px; overflow-y: auto; overflow-x: hidden; }
.support-right { border-left: 1px solid #202020; border-right: 0; }
.support-left h1 { font-size: 22px; margin-bottom: 14px; letter-spacing: -.03em; }
.support-tabs { height: 34px; display: grid; grid-template-columns: 1fr 1fr; background: #050505; border: 1px solid #242424; border-radius: 7px; overflow: hidden; margin-bottom: 12px; }
.support-tabs button.is-active { background: #202020; }
.support-search { width: 100%; margin-bottom: 16px; }
.support-right .support-search { margin: 14px 0; }
.chat-card, .preset { width: 100%; display: block; text-align: left; background: #242424; border: 1px solid #2c2c2c; border-radius: 8px; padding: 12px; margin-bottom: 8px; transition: transform .16s ease, background .16s ease; }
.chat-card:hover, .preset:hover { transform: translateY(-1px); background: #2b2b2b; }
.chat-card { min-height: 58px; position: relative; }
.unread { position: absolute; right: 14px; top: 14px; width: 19px; height: 19px; border-radius: 50%; background: var(--brand); display: grid; place-items: center; font-size: 10px; }
.support-main { display: grid; grid-template-rows: 58px 1fr 138px; min-width: 0; }
.chat-top { border-bottom: 1px solid #202020; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 20px; }
.chat-top span { display: flex; align-items: center; gap: 12px; min-width: 0; }
.chat-top span:last-child { gap: 16px; color: #777; }
.chat-empty { background: #000; background-image: radial-gradient(circle at 50% 35%, rgba(255,255,255,.04), transparent 28%); overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.message-row { max-width: 74%; padding: 10px 12px; border-radius: 8px; background: #202020; border: 1px solid #2a2a2a; }
.message-row.is-admin { align-self: flex-end; background: #1f2a1f; border-color: #2f4730; }
.message-row.is-user { align-self: flex-start; }
.message-row strong { display: block; margin-bottom: 4px; font-size: 12px; color: var(--muted); }
.message-row p { margin: 0; white-space: pre-wrap; word-break: break-word; }
.message-row small { display: block; margin-top: 6px; color: var(--muted-2); font-size: 11px; }
.composer { border-top: 1px solid #202020; padding: 18px 20px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: end; }
.composer-tools { display: flex; gap: 12px; color: #666; margin-bottom: 16px; }
.composer-tools button { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 7px; background: #101010; border: 1px solid #242424; }
.composer input { width: 100%; background: transparent; border: 0; color: var(--text); outline: 0; }
.send-help { color: #595959; margin-right: 14px; }

.empty { min-height: 180px; display: grid; place-items: center; color: var(--muted-2); font-weight: 500; text-align: center; padding: 20px; }
.money { font-family: var(--mono); }
.muted { color: var(--muted-2); font-weight: 500; }
.legend-blue { background: var(--blue); }
.legend-yellow { background: var(--yellow); }
.coin-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #f7931a; margin-right: 6px; }
.row-link { cursor: pointer; }
.row-link:hover td { background: rgba(237,100,50,.04); }
.toast-stack { position: fixed; right: max(24px, env(safe-area-inset-right)); bottom: max(24px, env(safe-area-inset-bottom)); z-index: 1000; display: grid; gap: 8px; pointer-events: none; }
.toast { min-width: 96px; min-height: 38px; display: grid; place-items: center; padding: 0 18px; border-radius: 8px; background: #faf9f5; color: #111; border: 1px solid rgba(255,255,255,.18); box-shadow: 0 10px 24px rgba(0,0,0,.35); font-weight: 800; transition: opacity .18s ease, transform .18s ease; }
.toast.is-out { opacity: 0; transform: translateY(6px); }

.user-page { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 18px; align-items: start; }
.user-card { overflow: hidden; }
.user-workspace { min-width: 0; }
.user-tabs { margin-bottom: 18px; }
.user-detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: 18px; align-items: start; }
.user-detail-grid > .udg-col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.settings-row strong { display: block; font-size: 12px; }
.settings-row small { display: block; margin-top: 4px; color: var(--muted-2); font-size: 10px; font-weight: 500; line-height: 1.35; }
.badge-negative { display: inline-flex; align-items: center; min-height: 22px; padding: 0 9px; border-radius: 999px; color: #ff4d7f; background: rgba(245,66,134,.16); border: 1px solid rgba(245,66,134,.45); font-size: 10px; }
.form-stack { display: grid; gap: 14px; }
.detail-field { grid-template-columns: minmax(0, 1fr) 190px; margin: 0; align-items: center; }
.detail-field .input, .detail-field .select { width: 100%; }
.input:disabled { opacity: .55; cursor: not-allowed; }
.input-wrap { position: relative; display: block; }
.input-wrap i { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--text); font-style: normal; }
.textarea { width: 100%; min-height: 72px; resize: vertical; background: #111; border: 1px solid #2a2a2a; border-radius: 7px; color: var(--text); padding: 12px; outline: 0; }
.settings-list { display: grid; gap: 14px; }
.settings-row { min-height: 48px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 16px; border-bottom: 1px solid #202020; }
.toggle.is-on { background: #f5f5f5; }
.toggle.is-on:after { transform: translateX(18px); background: #111; }
.inline-segment { width: 150px; margin-left: auto; }
.tx-segmented { width: auto; grid-template-columns: repeat(4, minmax(110px, 1fr)); margin: 0 0 12px; font-size: 12px; }
.tx-segmented button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 12px; color: var(--muted); }
.tx-segmented button.is-active { color: var(--text); }
.tx-segmented .tx-count { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 16px; padding: 0 5px; border-radius: 999px; background: #1d1d1d; color: #888; font-size: 10px; font-variant-numeric: tabular-nums; }
.tx-segmented button.is-active .tx-count { background: #333; color: var(--text); }
.wide-form .detail-field { grid-template-columns: minmax(0, 1fr) minmax(240px, 420px); }
.wallet-list { display: grid; gap: 14px; }
.wallet-row { min-height: 58px; display: grid; grid-template-columns: minmax(160px, 240px) minmax(280px, 1fr); gap: 16px; align-items: center; border-bottom: 1px solid #202020; }
.inline-link { color: var(--text); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.activity-console { display: grid; gap: 8px; font-family: var(--mono); }
.activity-row { display: grid; grid-template-columns: 156px minmax(0, 1fr) minmax(0, 1.2fr) 34px; gap: 12px; align-items: center; min-height: 46px; padding: 10px 12px; border: 1px solid #242424; border-radius: 8px; background: rgba(0,0,0,.18); }
.activity-row time, .activity-row small { color: var(--muted-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-row strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-link { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid #2a2a2a; border-radius: 7px; color: var(--text); }
.wallet-row strong, .wallet-row small { display: block; }
.wallet-row small { color: var(--muted-2); margin-top: 4px; font-weight: 500; }
.wallet-address { text-align: left; font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; }

.settings-domain-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.settings-domain-card { border: 1px solid #262626; border-radius: 10px; background: #151515; padding: 16px; }
.settings-domain-card header { display: flex; align-items: start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.settings-domain-card header span { font-size: 16px; overflow-wrap: anywhere; }
.settings-domain-card header small { color: var(--muted-2); font-weight: 500; text-align: right; }
.settings-locked-note { margin: 0 0 14px; padding: 10px 14px; border: 1px solid rgba(237,100,50,.32); background: rgba(237,100,50,.08); color: var(--muted); border-radius: 10px; font-size: 12px; line-height: 1.45; font-weight: 500; }
.settings-readonly-pill { display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px 5px 8px; border-radius: 999px; border: 1px solid #2a2a2a; background: #0c0c0c; color: var(--muted-2); font-family: var(--mono); font-size: 10px; letter-spacing: .04em; text-transform: lowercase; cursor: not-allowed; }
.settings-readonly-pill .settings-readonly-dot { width: 8px; height: 8px; border-radius: 50%; background: #3b3b3b; box-shadow: 0 0 0 2px #151515; }
.settings-readonly-pill.is-on { color: #f5f5f5; border-color: #3a3a3a; }
.settings-readonly-pill.is-on .settings-readonly-dot { background: #f5f5f5; box-shadow: 0 0 0 2px #151515, 0 0 8px rgba(245,245,245,.32); }
.settings-readonly-pill .api-sa-badge { margin-left: 2px; }

.support-desk { grid-template-columns: 330px minmax(0, 1fr) 330px; background: #080808; }
.support-side-head, .support-tools-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.support-side-head h1 { margin: 2px 0 0; }
.support-side-head strong { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid #2a2a2a; border-radius: 8px; background: #090909; font-family: var(--mono); }
.support-inbox { display: grid; gap: 8px; }
.support-desk .chat-card { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 10px; margin: 0; padding: 10px; }
.support-desk .chat-card.is-active { background: rgba(237,100,50,.13); border-color: rgba(237,100,50,.42); }
.chat-avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 9px; background: #0c0c0c; border: 1px solid #333; font-family: var(--mono); }
.chat-card-main { min-width: 0; display: grid; gap: 2px; }
.chat-card-main strong, .chat-card-main small, .chat-card-main em { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-card-main small { color: var(--muted-2); font-style: normal; font-weight: 500; }
.chat-card-main em { color: #858585; font-style: normal; font-weight: 500; }
.chat-meta { color: var(--muted); font-weight: 500; }
.support-thread { background: #050505; background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.015) 1px, transparent 1px); background-size: 28px 28px; }
.support-composer { min-height: 148px; align-items: stretch; }
.composer-field { min-width: 0; display: grid; grid-template-rows: auto 1fr auto; }
.support-textarea { width: 100%; min-height: 72px; resize: none; border: 0; outline: 0; background: transparent; color: var(--text); line-height: 1.45; }
.composer-send { display: flex; flex-direction: column; align-items: end; justify-content: end; gap: 12px; }
.attachment-strip { display: flex; flex-wrap: wrap; gap: 6px; min-height: 0; margin-top: 8px; }
.attachment-strip button { min-height: 26px; padding: 0 8px; border-radius: 999px; border: 1px solid #303030; background: #111; color: #d6d6d6; font-size: 11px; }
.message-attachments { display: grid; gap: 8px; margin-top: 8px; }
.message-attachments img { max-width: 220px; max-height: 180px; border-radius: 8px; object-fit: cover; border: 1px solid #333; }
.message-attachments a { color: #dcdcdc; text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.message-form { margin-top: 8px; padding: 10px; border: 1px solid #343434; border-radius: 8px; background: rgba(255,255,255,.035); display: grid; gap: 4px; }
.message-form b { color: #fff; }
.message-form small { margin: 0; color: #bdbdbd; }
.message-form.is-response { border-color: rgba(83,201,63,.35); background: rgba(83,201,63,.08); }
.preset-list { display: grid; gap: 8px; margin-bottom: 18px; }
.support-desk .preset { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; margin: 0; padding: 10px; border: 1px solid #252525; border-radius: 9px; background: #0c0c0c; }
.support-desk .preset:hover { border-color: #353535; }
.support-desk .preset .preset-main { min-width: 0; text-align: left; display: grid; gap: 3px; background: transparent; border: 0; padding: 0; color: var(--text); cursor: pointer; }
.support-desk .preset strong, .support-desk .preset small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.support-desk .preset small { color: var(--muted-2); font-weight: 500; }
.support-desk .preset-actions { display: flex; gap: 4px; }
.preset-edit, .preset-delete { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 7px; color: var(--muted); background: transparent; border: 0; cursor: pointer; }
.preset-edit:hover { background: #2a2a2a; color: var(--text); }
.preset-delete:hover { background: #3a1d1d; color: #ff6b6b; }
.support-tools { display: grid; gap: 8px; }
.support-tools-hint { color: var(--muted-2); font-size: 11px; line-height: 1.45; margin: -4px 0 6px; }
.support-tools-divider { position: relative; text-align: center; margin: 16px 0 12px; }
.support-tools-divider::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: linear-gradient(to right, transparent, #2a2a2a, transparent); }
.support-tools-divider span { position: relative; display: inline-block; padding: 0 10px; background: #0a0a0a; color: var(--muted); font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; }
.preset-builder { display: grid; gap: 14px; padding: 14px; border: 1px solid #2a2a2a; border-radius: 9px; background: #0b0b0b; }
.preset-builder-field { display: grid; gap: 5px; min-width: 0; }
.preset-builder-label { font-size: 12px; font-weight: 600; color: var(--text); line-height: 1.2; }
.preset-builder-hint { font-size: 10px; color: var(--muted-2); line-height: 1.4; margin-bottom: 2px; }
.preset-builder .input { width: 100%; height: 38px; font-size: 13px; }
.preset-builder .textarea { width: 100%; min-height: 120px; max-height: 280px; font-size: 13px; line-height: 1.5; padding: 10px 12px; }
.preset-builder-textarea { min-height: 140px !important; resize: vertical; }
.preset-builder .form-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.preset-builder .form-actions .btn { min-height: 34px; padding: 0 14px; font-size: 12px; }
/* Constrain ALL svgs/imgs inside composer tool buttons — prevents the default 300×150 SVG size */
.composer-tools button svg,
.composer-tools button img { width: 16px; height: 16px; flex-shrink: 0; display: block; }

.composer-preset-btn { display: inline-flex !important; align-items: center; gap: 5px; width: auto !important; height: 28px !important; padding: 0 10px !important; border-radius: 999px !important; border: 1px solid #2a2a2a !important; background: rgba(255,255,255,.07) !important; color: var(--text) !important; cursor: pointer; font-size: 12px; flex-shrink: 0; }
.composer-preset-btn:hover { background: rgba(255,255,255,.12) !important; }
.composer-preset-btn .preset-btn-label { font-weight: 600; }
.composer-preset-btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.support-preset-modal { max-width: 460px; }
.support-preset-row { display: grid; grid-template-columns: minmax(0, 1fr) 20px; align-items: center; gap: 8px; }
.support-preset-row span { min-width: 0; display: grid; gap: 3px; }
.support-preset-row strong, .support-preset-row small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.support-preset-row small { color: var(--muted-2); }
.support-preset-row i { display: flex; align-items: center; color: var(--muted); }
.support-preset-row i svg { width: 14px; height: 14px; }
/* Inline create form inside preset picker modal (mobile) */
.preset-picker-create-section { padding-top: 10px; border-top: 1px solid rgba(255,255,255,.07); }
.preset-picker-inline-form { display: grid; gap: 8px; }
.preset-picker-inline-form .input { width: 100%; }
.preset-picker-inline-form .textarea { width: 100%; font-size: 13px; }
.support-template-modal footer { gap: 8px; }
.support-template-modal footer .btn { flex: 1; justify-content: center; font-size: 13px; min-height: 36px; }
/* Profile-on-domain link inside user card */
.profile-domain-link { font-family: var(--mono); font-size: 11px; color: var(--brand); text-decoration: none; border-bottom: 1px dashed currentColor; padding-bottom: 1px; }
.profile-domain-link:hover { color: var(--text); border-bottom-style: solid; }
/* Skeleton states */
.chat-card-skel { min-height: 56px; border-radius: 12px; background: linear-gradient(90deg, #161616 0%, #1c1c1c 50%, #161616 100%); background-size: 200% 100%; animation: skeleton 1.4s ease-in-out infinite; }
.support-thread-skel { padding: 18px; display: grid; gap: 12px; }
.msg-skel { height: 52px; max-width: 70%; border-radius: 12px; background: linear-gradient(90deg, #141414 0%, #1d1d1d 50%, #141414 100%); background-size: 200% 100%; animation: skeleton 1.4s ease-in-out infinite; }
.msg-skel-0 { justify-self: start; }
.msg-skel-1 { justify-self: end; background: linear-gradient(90deg, #1a1410 0%, #2a1f17 50%, #1a1410 100%); background-size: 200% 100%; }
@keyframes skeleton { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) {
  .chat-card-skel, .msg-skel { animation: none; }
}
/* Mobile: presets section is hidden on narrow screens — keep `Пресет` button in composer working via picker modal */
@media (max-width: 1200px) {
  .composer-preset-btn .preset-btn-label { display: none; }
}
@media (max-width: 760px) {
  .support-tools-divider { display: none; }
  .preset-builder { padding: 10px; }
}
.support-responses { border-top: 1px solid #252525; padding-top: 14px; display: grid; gap: 8px; }
.form-template-builder { display: grid; gap: 8px; padding: 10px; border: 1px solid #2a2a2a; border-radius: 9px; background: #0b0b0b; margin-bottom: 10px; }
.builder-field { display: grid; grid-template-columns: 92px minmax(0, 1fr) 32px; gap: 6px; align-items: center; }
.builder-field button { height: 32px; border: 1px solid #2a2a2a; border-radius: 7px; background: #141414; color: var(--text); }
.response-card { display: grid; gap: 5px; padding: 10px; border: 1px solid #282828; border-radius: 8px; background: #101010; }
.response-card span { font-family: var(--mono); font-size: 11px; color: var(--brand); }
.response-card small { color: #cfcfcf; font-weight: 500; overflow-wrap: anywhere; }
.response-card time { color: var(--muted-2); font-size: 10px; }
.compact-empty { min-height: 76px; padding: 12px; }

@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes drawChart { to { stroke-dashoffset: 0; } }
@keyframes fadeIn { to { opacity: 1; } }
@keyframes cardIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
  .chart-path { stroke-dashoffset: 0; }
  .chart-point { opacity: 1; }
}

@media (max-width: 1200px) {
  :root { --container: calc(100vw - 28px); }
  .topbar-inner { flex-wrap: wrap; gap: 10px; padding: 10px 0; }
  .brand { order: 1; }
  .top-actions { order: 2; margin-left: auto; }
  .nav { order: 3; flex-basis: 100%; padding-bottom: 2px; }
  .grid-2, .grid-main { grid-template-columns: 1fr; }
  /* .user-page / .user-detail-grid intentionally NOT collapsed here — their
     reflow is window-width driven (auto-fit + .is-narrow/.is-compact), so a
     wide window on a ≤1200px screen still gets the two-column layout. */
  .support-shell { grid-template-columns: 260px minmax(0, 1fr); }
  .support-right { display: none; }
  .settings-domain-grid { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  /* Mobile mode: no wallpaper, no macOS window chrome, full-screen apps */
  body.has-admin-bg {
    overflow: hidden;
    background: #050505 !important;
  }

  .admin-bg-layer,
  .desktop-welcome-widget {
    display: none !important;
  }

  .admin-bg-layer:after {
    content: none !important;
  }

  .app-shell-macos {
    height: 100dvh;
    overflow: hidden;
    padding-bottom: 0;
  }

  .topbar {
    height: 54px;
    overflow: hidden;
    z-index: 92;
  }

  .topbar-inner {
    height: 54px;
  }

  .mac-dock {
    left: 10px;
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    transform: none;
    width: auto;
    max-width: none;
    justify-content: space-between;
    overflow-x: auto;
  }

  .app-shell-macos #page-root.desktop-root {
    padding: 54px 0 calc(82px + env(safe-area-inset-bottom));
    height: 100dvh;
    min-height: 100dvh !important;
    overflow: hidden;
    pointer-events: auto;
  }

  .mac-window-frame.mac-app-window {
    position: fixed;
    left: 0 !important;
    right: 0 !important;
    top: 54px !important;
    bottom: calc(82px + env(safe-area-inset-bottom)) !important;
    width: auto !important;
    height: auto !important;
    margin: 0;
    border-radius: 0;
    border: 0;
    box-shadow: none;
    background: #050505;
    z-index: 91;
  }

  .mac-window-frame.mac-app-window:before,
  .mac-window-frame.mac-app-window:after {
    content: none !important;
  }

  .mac-window-frame > .mac-window-bar,
  .mac-resize-handle {
    display: none !important;
  }

  .mac-window-content {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  .mac-window-content > .page,
  .mac-window-content > .support-page {
    padding: 12px;
    overflow: visible;
  }

  /* Mobile content density */
  .mac-window-content .overview-hero,
  .mac-window-content .ops-grid,
  .mac-window-content .insight-grid,
  .mac-window-content .domain-layout {
    grid-template-columns: 1fr !important;
  }

  .mac-window-content .hero-command {
    min-height: 340px;
  }

  .mac-window-content .hero-command h1 {
    font-size: 34px;
  }

  .mac-window-content .command-stack {
    grid-template-columns: 1fr;
  }

  .mac-window-content .mini-metric,
  .mac-window-content .summary-card {
    min-height: 92px;
  }

  .wallet-row {
    grid-template-columns: 1fr;
    gap: 8px;
    align-items: start;
  }

  /* Prevent iOS input zoom + keep composer visible */
  .input,
  .select,
  .textarea,
  .support-textarea,
  input,
  textarea,
  select {
    font-size: 16px;
  }
}

@media (max-width: 430px) {
  .domain-cubes, .kpi-grid { grid-template-columns: 1fr; }
  .top-actions { flex-wrap: wrap; }
  .top-icon { width: 32px; height: 32px; }
  .hero { min-height: 300px; }
  .hero h1 { font-size: 27px; }
}

/* Structural redesign: app console shell + page-specific composition */
.app-shell { min-height: 100dvh; display: grid; grid-template-columns: 284px minmax(0, 1fr); }
.app-workspace { --page-bg-image: url("/macos/backs/%D0%B3%D0%BB%D0%B0%D0%B2%D0%BD%D0%B0%D1%8F.webp?v=20260510-macos01"); position: relative; min-width: 0; min-height: 100dvh; border-left: 1px solid #151515; isolation: isolate; background: transparent; overflow: visible; }
.app-workspace:before { content: none; }
#page-root { position: relative; z-index: 1; min-height: calc(100dvh - 72px); overflow: visible; background: transparent; }
.sidebar { position: sticky; top: 0; height: 100dvh; display: grid; grid-template-rows: auto 1fr auto; gap: 18px; padding: 18px 14px; background: #050505; }
.sidebar-brand { display: grid; gap: 8px; padding: 2px 6px 14px; border-bottom: 1px solid #1b1b1b; }
.sidebar-brand .brand { min-width: 0; }
.sidebar-brand .brand-name { font-size: 20px; }
.sidebar-sub { color: var(--muted-2); font-weight: 600; }
.sidebar-nav { display: grid; align-content: start; gap: 18px; overflow-y: auto; padding-right: 4px; }
.nav-group { display: grid; gap: 6px; }
.nav-group > span { padding: 0 10px 4px; color: var(--muted-2); font-size: 10px; text-transform: uppercase; letter-spacing: 0; }
.sidebar .nav-btn { width: 100%; min-height: 42px; justify-content: flex-start; border-radius: 9px; padding: 0 12px; }
.sidebar .nav-btn.is-active { background: #222; border-color: #343434; box-shadow: inset 3px 0 0 var(--brand); }
.sidebar-card { display: grid; gap: 10px; padding: 14px; border: 1px solid #242424; border-radius: 12px; background: linear-gradient(180deg, rgba(237,100,50,.08), rgba(255,255,255,.015)); }
.sidebar-card small { color: var(--muted-2); }
.sidebar-card strong { font: 700 30px/1 var(--mono); }
.sidebar-card .btn { width: 100%; }
.mobile-tabbar { display: none; }
.topbar { min-height: 72px; }
.topbar-inner { width: auto; min-height: 72px; padding: 0 24px; justify-content: space-between; }
.top-context { display: grid; gap: 2px; min-width: 0; }
.top-context strong { font-size: 20px; line-height: 1.1; text-wrap: balance; }
.top-kicker, .eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0; }
.top-kicker svg, .eyebrow svg { width: 14px; height: 14px; color: var(--brand); }
.page { width: min(1360px, calc(100vw - 332px)); min-height: calc(100dvh - 156px); margin: 36px auto 48px; overflow: visible; }
.support-page { width: 100%; }
.page-intro, .analytics-hero { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 18px; padding: 22px; border: 1px solid #202020; border-radius: 14px; background: #111; }
.page-intro h1, .analytics-hero h1 { margin-top: 8px; font-size: clamp(32px, 5vw, 64px); line-height: .95; letter-spacing: -.04em; }
.page-intro p, .analytics-hero p, .section-note { display: block; max-width: 620px; color: var(--muted); font-weight: 500; margin-top: 8px; }
.intro-search { width: min(360px, 100%); }
.overview-hero { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 18px; margin-bottom: 18px; }
.hero-command { min-height: 384px; border-radius: 14px; }
.hero-command .hero-copy { width: min(620px, 72%); }
.hero-command h1 { font-size: clamp(38px, 5vw, 72px); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.hero-actions .btn { width: auto; min-height: 40px; }
.hero-actions .btn svg { width: 15px; height: 15px; }
.command-stack { display: grid; gap: 12px; }
.mini-metric, .summary-card { min-height: 120px; display: grid; align-content: space-between; gap: 10px; padding: 16px; border: 1px solid #242424; border-radius: 14px; background: var(--panel); }
.mini-metric span, .summary-card span { color: var(--muted); }
.mini-metric strong, .summary-card strong { font: 700 clamp(26px, 3vw, 40px)/1 var(--mono); overflow-wrap: anywhere; }
.mini-metric.green { border-color: rgba(83,201,63,.32); }
.mini-metric.blue { border-color: rgba(71,136,255,.32); }
.mini-metric.yellow { border-color: rgba(245,181,27,.32); }
.ops-grid, .insight-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, .48fr); gap: 18px; align-items: stretch; }
.full-span { grid-column: 1 / -1; }
.panel-span-2 { grid-column: span 1; }
.recent-panel { min-height: 100%; }
.analytics-page, .dashboard-page, .users-page { display: block; }
.metric-board { margin-bottom: 18px; }
.summary-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.summary-card.is-active { background: var(--purple); border-color: rgba(237,100,50,.32); }
.summary-card small { color: var(--muted-2); font-weight: 500; }
.data-panel .panel-body { padding: 18px; }
.support-shell { height: calc(100dvh - 96px); margin-top: 24px; }
.compact-tabs { margin: 0; min-width: 250px; }
.domain-layout { display: grid; grid-template-columns: minmax(360px, 420px) minmax(0, 1fr); gap: 18px; align-items: stretch; }
.workflow-panel { margin-bottom: 18px; }
.step-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.step-grid > div { min-height: 104px; display: grid; align-content: start; gap: 7px; padding: 16px; border: 1px solid #282828; border-radius: 12px; background: #111; }
.step-grid strong { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--brand); color: #111; font-family: var(--mono); }
.step-grid span { font-size: 15px; }
.step-grid small { color: var(--muted); font-weight: 500; line-height: 1.35; }

@media (min-width: 1500px) {
  .ops-grid, .insight-grid { grid-template-columns: minmax(0, 1.35fr) minmax(360px, .65fr); }
}

@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .app-workspace { border-left: 0; }
  .page { width: var(--container); }
  .topbar-inner { flex-wrap: nowrap; padding: 12px 14px; }
  .top-context strong { font-size: 18px; }
  .overview-hero, .ops-grid, .insight-grid { grid-template-columns: 1fr; }
  .domain-layout { grid-template-columns: 1fr; }
  .command-stack { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  body { padding-bottom: 0; }
  .topbar { position: sticky; top: 0; min-height: 64px; }
  #page-root { min-height: calc(100dvh - 64px); padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
  .app-workspace { min-height: 100dvh; }
  .topbar-inner { min-height: 64px; }
  .top-context { max-width: 55vw; }
  .top-context strong { font-size: 16px; }
  .top-kicker { display: none; }
  .top-actions { width: auto; flex-wrap: nowrap; gap: 6px; }
  .top-pill:first-child { display: none; }
  .top-pill { min-height: 34px; }
  .page { min-height: calc(100dvh - 166px - env(safe-area-inset-bottom)); margin-top: 24px; margin-bottom: 24px; overflow: visible; }
  .page-intro, .analytics-hero { display: grid; align-items: start; padding: 18px; }
  .page-intro h1, .analytics-hero h1 { font-size: 36px; }
  .intro-search { width: 100%; }
  .compact-tabs { min-width: 0; width: 100%; }
  .step-grid { grid-template-columns: 1fr; }
  .hero-command { min-height: 430px; padding: 22px; }
  .hero-command .hero-copy { width: 100%; }
  .hero-command h1 { font-size: 33px; }
  .hero-actions { display: grid; grid-template-columns: 1fr; }
  .hero-actions .btn { width: 100%; min-height: 44px; }
  .command-stack, .summary-strip { grid-template-columns: 1fr; }
  .mini-metric, .summary-card { min-height: 96px; }
  .command-stack { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .mini-metric { min-height: 88px; padding: 12px; }
  .mini-metric span { font-size: 10px; line-height: 1.25; }
  .mini-metric strong { font-size: 20px; line-height: 1.05; }
  .top-domains { min-height: 0; }
  .support-shell { height: auto; min-height: calc(100dvh - 88px); margin-top: 24px; }
  .mobile-tabbar { position: fixed; left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); z-index: 80; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; min-height: 64px; padding: 6px; border: 1px solid #282828; border-radius: 18px; background: rgba(15,15,15,.94); backdrop-filter: blur(18px); box-shadow: 0 18px 60px rgba(0,0,0,.48); }
  .mobile-tab { min-width: 0; display: grid; place-items: center; gap: 3px; color: var(--muted); border-radius: 13px; font-size: 10px; }
  .mobile-tab svg { width: 18px; height: 18px; }
  .mobile-tab span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mobile-tab.is-active { background: #242424; color: var(--text); }
  .mobile-tab.is-active svg { color: var(--brand); }
}

/* Final UI consistency pass */
.panel,
.auth-card,
.tabs,
.domain-cube,
.kpi,
.table-wrap,
.page-intro,
.analytics-hero,
.hero-command,
.mini-metric,
.summary-card,
.step-grid > div,
.sidebar-card,
.chat-card,
.preset {
  border-radius: var(--card-radius);
  border-width: 1px;
}
.panel-body,
.chart,
.top-domains,
.data-panel .panel-body {
  padding: var(--card-pad);
}
.panel,
.mini-metric,
.summary-card,
.domain-cube,
.kpi,
.step-grid > div {
  min-width: 0;
  animation: cardIn .22s ease-out both;
}
.mini-metric:nth-child(2),
.summary-card:nth-child(2),
.kpi:nth-child(2),
.domain-cube:nth-child(2) { animation-delay: .05s; }
.mini-metric:nth-child(3),
.summary-card:nth-child(3),
.kpi:nth-child(3),
.domain-cube:nth-child(3) { animation-delay: .1s; }
.mini-metric span,
.summary-card span,
.kpi span,
.domain-cube span {
  align-self: start;
}
.mini-metric strong,
.summary-card strong,
.kpi strong,
.domain-cube strong {
  align-self: center;
  font-variant-numeric: tabular-nums;
}
.table-toolbar {
  min-height: 58px;
  align-items: center;
  padding-bottom: 14px;
  margin-bottom: 0;
}
.table-toolbar + .table-wrap {
  margin-top: 0;
}
.table td:first-child,
.table th:first-child {
  width: 28%;
}
.table td:last-child,
.table th:last-child {
  width: 128px;
}
.domain-table .table {
  min-width: 0;
}
.domain-table .table th:nth-child(3),
.domain-table .table td:nth-child(3) {
  width: 30%;
}
.domain-table .table th:nth-child(1),
.domain-table .table td:nth-child(1) { width: 26%; }
.domain-table .table th:nth-child(2),
.domain-table .table td:nth-child(2) { width: 90px; }
.domain-table .table th:nth-child(4),
.domain-table .table td:nth-child(4) { width: 120px; }
.list-row {
  min-height: 44px;
}
.list-row time {
  font-variant-numeric: tabular-nums;
}
.actions {
  min-width: 96px;
  justify-content: center;
}
.actions button {
  width: 26px;
  height: 26px;
}
.empty {
  min-height: 148px;
  line-height: 1.45;
}
.input,
.select,
.textarea,
.btn {
  border-radius: 8px;
}
.eyebrow {
  color: var(--muted);
}
.tops-panel .table-wrap {
  overflow: visible;
}
.tops-panel .table {
  min-width: 0;
}
.tops-panel .table th,
.tops-panel .table td {
  padding: 0 10px;
  font-size: 10px;
}
.tops-panel .empty {
  min-height: 120px;
}
.domain-layout > .panel,
.domain-layout > .stack,
.domain-layout > .stack > .panel {
  height: 100%;
}
.domain-table .panel-body,
.data-panel .panel-body {
  min-width: 0;
}

html,
body.has-admin-bg {
  background-color: #050505 !important;
}

body.has-admin-bg {
  --page-bg-image: url("/macos/backs/%D0%B3%D0%BB%D0%B0%D0%B2%D0%BD%D0%B0%D1%8F.webp?v=20260510-macos01");
  background-image: none !important;
}

body.has-admin-bg::after {
  content: none;
}

.admin-bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-color: #050505;
  background-image: none;
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  opacity: 0;
  transform: translateZ(0);
  transition: opacity 460ms ease;
  will-change: opacity;
}

.admin-bg-layer.is-visible {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .admin-bg-layer {
    transition: none;
  }
}

/* Mobile override (must be last): full-screen apps, wide dock */
@media (max-width: 760px) {
  .admin-bg-layer,
  .desktop-welcome-widget {
    display: none !important;
  }

  body.has-admin-bg {
    overflow: hidden !important;
    background: #050505 !important;
  }

  .app-shell-macos #page-root.desktop-root {
    padding: 54px 0 calc(82px + env(safe-area-inset-bottom)) !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    overflow: hidden !important;
  }

  .app-shell-macos #page-root.desktop-root .mac-window-frame.mac-app-window {
    position: fixed !important;
    display: block !important;
    left: 0 !important;
    right: 0 !important;
    top: 54px !important;
    bottom: calc(82px + env(safe-area-inset-bottom)) !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    border-radius: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    background: #050505 !important;
  }

  .app-shell-macos #page-root.desktop-root .mac-window-frame.mac-app-window:before,
  .app-shell-macos #page-root.desktop-root .mac-window-frame.mac-app-window:after,
  .app-shell-macos #page-root.desktop-root .mac-window-frame.mac-app-window > .mac-window-bar,
  .app-shell-macos #page-root.desktop-root .mac-resize-handle {
    display: none !important;
    content: none !important;
  }

  .app-shell-macos #page-root.desktop-root .mac-window-content {
    height: 100% !important;
    min-height: 100% !important;
    overflow: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .app-shell-macos #page-root.desktop-root .mac-window-content > .page,
  .app-shell-macos #page-root.desktop-root .mac-window-content > .support-page {
    display: block !important;
    min-height: 100% !important;
    padding: 12px !important;
    overflow: visible !important;
  }

  .app-shell-macos #page-root.desktop-root .mac-window-content .dashboard-page,
  .app-shell-macos #page-root.desktop-root .mac-window-content .finance-page,
  .app-shell-macos #page-root.desktop-root .mac-window-content .analytics-page,
  .app-shell-macos #page-root.desktop-root .mac-window-content .domains-page,
  .app-shell-macos #page-root.desktop-root .mac-window-content .users-page,
  .app-shell-macos #page-root.desktop-root .mac-window-content .support-page,
  .app-shell-macos #page-root.desktop-root .mac-window-content .user-page,
  .app-shell-macos #page-root.desktop-root .mac-window-content .user-detail-grid,
  .app-shell-macos #page-root.desktop-root .mac-window-content .overview-hero,
  .app-shell-macos #page-root.desktop-root .mac-window-content .ops-grid,
  .app-shell-macos #page-root.desktop-root .mac-window-content .insight-grid,
  .app-shell-macos #page-root.desktop-root .mac-window-content .summary-strip,
  .app-shell-macos #page-root.desktop-root .mac-window-content .domain-layout,
  .app-shell-macos #page-root.desktop-root .mac-window-content .command-stack,
  .app-shell-macos #page-root.desktop-root .mac-window-content .wallet-row,
  .app-shell-macos #page-root.desktop-root .mac-window-content .detail-field,
  .app-shell-macos #page-root.desktop-root .mac-window-content .wide-form .detail-field,
  .app-shell-macos #page-root.desktop-root .mac-window-content .settings-domain-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    height: auto !important;
    min-height: 0 !important;
  }

  .app-shell-macos #page-root.desktop-root .mac-window-content .user-card {
    position: static !important;
    top: auto !important;
  }

  .app-shell-macos #page-root.desktop-root .mac-window-content .support-shell {
    display: grid !important;
    grid-template-columns: 1fr !important;
    height: 100% !important;
    min-height: 100% !important;
    overflow: hidden !important;
  }

  .app-shell-macos #page-root.desktop-root .mac-window-content .support-left,
  .app-shell-macos #page-root.desktop-root .mac-window-content .support-right {
    display: none !important;
  }

  .app-shell-macos #page-root.desktop-root .mac-window-content .support-shell.show-list {
    grid-template-rows: minmax(0, 1fr) !important;
  }

  .app-shell-macos #page-root.desktop-root .mac-window-content .support-shell.show-list .support-left {
    display: grid !important;
    grid-template-rows: auto auto minmax(0, 1fr) !important;
    min-height: 0 !important;
    overflow: hidden !important;
    padding: 12px !important;
    border: 0 !important;
  }

  .app-shell-macos #page-root.desktop-root .mac-window-content .support-shell.show-list .support-main {
    display: none !important;
  }

  .app-shell-macos #page-root.desktop-root .mac-window-content .support-shell:not(.show-list) .support-main {
    display: flex !important;
  }

  .app-shell-macos #page-root.desktop-root .mac-window-content .support-main {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
    position: relative !important;
  }

  .app-shell-macos #page-root.desktop-root .mac-window-content .support-side-head,
  .app-shell-macos #page-root.desktop-root .mac-window-content .support-search-wrap {
    flex: 0 0 auto !important;
  }

  .app-shell-macos #page-root.desktop-root .mac-window-content .support-inbox {
    min-height: 0 !important;
    overflow: auto !important;
    padding-bottom: 8px !important;
  }

  .app-shell-macos #page-root.desktop-root .mac-window-content .chat-top {
    position: relative !important;
    flex: 0 0 auto !important;
    min-height: 58px !important;
    padding: 10px 12px !important;
    border-bottom: 1px solid rgba(255,255,255,.08) !important;
    background: rgba(24,24,24,.96) !important;
    z-index: 3 !important;
  }

  .app-shell-macos #page-root.desktop-root .mac-window-content .chat-selectbar {
    position: absolute !important;
    top: 68px !important;
    right: 12px !important;
    left: auto !important;
    min-height: 40px !important;
    padding: 6px 8px !important;
    border: 1px solid rgba(255,255,255,.10) !important;
    border-radius: 14px !important;
    background: rgba(24,24,24,.98) !important;
    box-shadow: 0 16px 38px rgba(0,0,0,.28) !important;
    z-index: 5 !important;
  }

  .app-shell-macos #page-root.desktop-root .mac-window-content .chat-peer > span {
    gap: 0 !important;
  }

  .app-shell-macos #page-root.desktop-root .mac-window-content .chat-peer b {
    font-size: 15px !important;
  }

  .app-shell-macos #page-root.desktop-root .mac-window-content .chat-peer em {
    font-size: 11px !important;
  }

  .app-shell-macos #page-root.desktop-root .mac-window-content .chat-empty,
  .app-shell-macos #page-root.desktop-root .mac-window-content .support-thread {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: auto !important;
    overflow: auto !important;
    padding: 12px 10px 16px !important;
  }

  .app-shell-macos #page-root.desktop-root .mac-window-content .support-composer {
    position: relative !important;
    flex: 0 0 auto !important;
    display: block !important;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom)) !important;
    background: rgba(15,15,15,.96) !important;
    z-index: 3 !important;
  }

  .app-shell-macos #page-root.desktop-root .mac-window-content .composer-field {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    padding: 10px 12px !important;
    border-radius: 18px !important;
  }

  .app-shell-macos #page-root.desktop-root .mac-window-content .support-textarea {
    min-height: 44px !important;
    max-height: 96px !important;
    padding-right: 52px !important;
  }

  .app-shell-macos #page-root.desktop-root .mac-window-content .support-mobile-forms {
    display: flex !important;
    justify-content: flex-start !important;
    padding-top: 0 !important;
  }

  .app-shell-macos #page-root.desktop-root .mac-window-content .composer-send-inline {
    width: 40px !important;
    height: 40px !important;
  }

  .mac-dock {
    left: 10px !important;
    right: 10px !important;
    width: calc(100vw - 20px) !important;
    max-width: calc(100vw - 20px) !important;
    transform: none !important;
  }
}

#app {
  position: relative;
  z-index: 2;
}

.app-shell {
  background-color: transparent !important;
  background-image: none !important;
}

.app-workspace {
  background: transparent !important;
}

#page-root {
  min-height: calc(100vh - 72px) !important;
  min-height: calc(100dvh - 72px) !important;
  overflow: visible !important;
  background: transparent !important;
}

.page {
  min-height: calc(100vh - 156px);
  min-height: calc(100dvh - 156px);
  overflow: visible;
}

@media (max-width: 760px) {
  #page-root {
    min-height: calc(100vh - 64px) !important;
    min-height: calc(100dvh - 64px) !important;
  }

  .page {
    min-height: calc(100vh - 166px - env(safe-area-inset-bottom));
    min-height: calc(100dvh - 166px - env(safe-area-inset-bottom));
  }
}

/* Domain design editor */
.domain-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: radial-gradient(circle at 50% 20%, rgba(237,100,50,.18), transparent 34%), rgba(0,0,0,.78);
  opacity: 0;
  transition: opacity .16s ease;
  backdrop-filter: blur(7px);
}
.domain-drawer-backdrop.is-open { opacity: 1; }
.domain-modal-open { overflow: hidden; }
.domain-editor {
  position: fixed;
  inset: 0;
  z-index: 901;
  display: grid;
  place-items: center;
  padding: 24px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(10px) scale(.98);
  transition: opacity .16s ease, transform .18s ease;
}
.domain-editor.is-open {
  pointer-events: auto;
  opacity: 1;
  transform: translateY(0) scale(1);
}
.domain-editor__inner {
  width: min(960px, calc(100vw - 48px));
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 22px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.015)),
    #080808;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 18px;
  box-shadow: 0 28px 110px rgba(0,0,0,.72);
}
.domain-editor-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}
.domain-editor-head h2 {
  margin-top: 8px;
  font-size: 32px;
  line-height: 1;
  letter-spacing: -.04em;
  overflow-wrap: anywhere;
}
.domain-editor-head p {
  color: var(--muted);
  font-weight: 500;
  margin-top: 8px;
}
.domain-preview {
  --preview-accent: var(--brand);
  --preview-yes: #bbe124;
  --preview-no: #4788ff;
  border: 1px solid #292929;
  border-radius: 14px;
  padding: 16px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--preview-accent) 16%, transparent), transparent 44%),
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.012)),
    #121212;
  margin-bottom: 18px;
}
.domain-preview__bar {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid #242424;
  padding-bottom: 12px;
}
.domain-preview__bar span {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.domain-preview__bar img {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  object-fit: contain;
  background: #050505;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}
.domain-preview__bar strong {
  min-width: 0;
  font-size: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.domain-preview__bar i {
  width: 70px;
  height: 26px;
  border-radius: 999px;
  background: var(--preview-accent);
}
.domain-preview__market {
  display: grid;
  gap: 10px;
  padding-top: 14px;
}
.domain-preview__market small {
  color: var(--muted-2);
  font-family: var(--mono);
  text-transform: uppercase;
}
.domain-preview__market strong {
  font-size: 18px;
  line-height: 1.2;
}
.domain-preview__market div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.domain-preview__market button {
  min-height: 34px;
  border-radius: 8px;
  color: #050505;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.domain-preview__market button:first-child { background: var(--preview-yes); }
.domain-preview__market button:last-child { background: var(--preview-no); color: #fff; }
.editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.editor-grid .editor-field:nth-child(2) { grid-row: span 2; }
.editor-field {
  grid-template-columns: 1fr;
  margin: 0;
}
.color-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}
.color-control {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #242424;
  border-radius: 12px;
  background: #111;
}
.color-control span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}
.color-control input[type="color"] {
  width: 100%;
  height: 38px;
  border: 1px solid #303030;
  border-radius: 8px;
  background: #050505;
  padding: 3px;
}
.color-control .input {
  width: 100%;
  text-transform: uppercase;
}
/* Phase D — Color tabs (Brand / Light / Dark) inside the domain editor.
   Matches the admin-macos dark palette (#111 surfaces, #242424 borders, --muted). */
.color-section {
  display: grid;
  gap: 12px;
  margin: 16px 0;
}
.color-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.color-section-head h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.color-tabs {
  display: inline-flex;
  gap: 2px;
  background: #050505;
  border: 1px solid #242424;
  padding: 3px;
  border-radius: 10px;
}
.color-tab {
  padding: 6px 14px;
  border-radius: 7px;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease;
}
.color-tab:hover { color: #fff; }
.color-tab.is-active {
  background: #1c1c1c;
  color: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}
.color-tab:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
.color-panel[hidden] { display: none; }
.logo-drop {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  border: 1px dashed #333;
  border-radius: 12px;
  padding: 14px;
  background: rgba(255,255,255,.018);
}
.domain-upload-state {
  grid-column: 1 / -1;
  min-height: 18px;
  color: var(--muted);
  font-weight: 500;
}
.domain-editor-msg {
  min-height: 20px;
  margin-top: 12px;
  color: var(--brand);
}
.domain-editor-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: 18px -20px -20px;
  padding: 14px 20px max(14px, env(safe-area-inset-bottom));
  background: rgba(8,8,8,.94);
  border-top: 1px solid #242424;
  backdrop-filter: blur(14px);
}

@media (max-width: 760px) {
  .domain-editor {
    padding: 12px;
    place-items: end center;
  }
  .domain-editor__inner {
    width: 100%;
    max-height: calc(100dvh - 24px);
    padding: 16px;
    border-radius: 14px 14px 0 0;
  }
  .domain-editor-head h2 {
    font-size: 26px;
  }
  .color-grid,
  .logo-drop,
  .editor-grid {
    grid-template-columns: 1fr;
  }
  .editor-grid .editor-field:nth-child(2) { grid-row: auto; }
  .domain-editor-actions {
    margin-left: -16px;
    margin-right: -16px;
    margin-bottom: -16px;
    padding-left: 16px;
    padding-right: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .domain-drawer-backdrop,
  .domain-editor {
    transition: none !important;
  }
}

/* MacOS Desktop variant: adapted from mhmdmhd6/Mac-OS-Desktop + liquid-glass package semantics */
:root {
  --mac-glass-bg: rgba(10, 10, 10, .42);
  --mac-glass-bg-strong: rgba(12, 12, 12, .70);
  --mac-glass-line: rgba(255, 255, 255, .16);
  --mac-glass-highlight: rgba(255, 255, 255, .20);
  --mac-glass-shadow: 0 24px 80px rgba(0, 0, 0, .48);
  --mac-window-radius: 16px;
  --mac-dock-width: clamp(320px, 20vw, 440px);
}

body:before {
  opacity: .55;
  mask-image: linear-gradient(to bottom, #000 0%, rgba(0,0,0,.85) 58%, transparent 100%);
}

.app-shell-macos {
  display: block;
  min-height: 100dvh;
  padding-bottom: 112px;
  background: transparent;
}

.app-shell-macos .app-workspace {
  min-height: 100dvh;
  border-left: 0;
}

.app-shell-macos #page-root {
  min-height: calc(100dvh - 52px) !important;
  padding: 72px 24px 116px;
  display: grid;
  place-items: start center;
  transition: opacity .18s ease, transform .18s ease;
}

.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 90;
  min-height: 46px;
  border-bottom: 1px solid var(--mac-glass-line);
  background:
    linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,.035)),
    var(--mac-glass-bg);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  backdrop-filter: blur(28px) saturate(160%);
  box-shadow: 0 8px 34px rgba(0,0,0,.28);
}

.topbar:before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: radial-gradient(circle at 45% -120%, rgba(255,255,255,.22), transparent 46%);
}

.topbar-inner {
  position: relative;
  width: 100%;
  min-height: 46px;
  padding: 0 18px;
  gap: 18px;
}

.top-back {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.14);
  color: #f6f6f6;
  background: rgba(0,0,0,.18);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
}

.top-back.is-hidden {
  visibility: hidden;
  pointer-events: none;
}

.top-back:active {
  transform: translateY(1px);
}

.topbar-brand {
  gap: 8px;
  min-width: 196px;
}

.topbar-brand .brand-box {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(0,0,0,.26);
  border-color: rgba(255,255,255,.18);
}

.topbar-brand .brand-logo {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.topbar-brand .brand-name {
  font-size: 16px;
  letter-spacing: -.03em;
}

.top-context {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.top-context strong {
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.top-kicker {
  min-height: 28px;
  padding: 0 10px;
  color: #f4f4f4;
  border-radius: 8px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.10);
  letter-spacing: .02em;
}

.top-actions {
  margin-left: auto;
}

.top-pill,
.top-icon {
  background: rgba(0,0,0,.22);
  border-color: rgba(255,255,255,.14);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
}

.mac-dock {
  position: fixed;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 95;
  width: var(--mac-dock-width);
  min-height: 66px;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 3px;
  padding: 8px 10px 7px;
  border: 1px solid var(--mac-glass-line);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.17), rgba(255,255,255,.04)),
    var(--mac-glass-bg);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  backdrop-filter: blur(32px) saturate(180%);
  box-shadow: var(--mac-glass-shadow), inset 0 1px 0 rgba(255,255,255,.18);
  transform: translateX(-50%);
}

.mac-dock:before {
  content: "";
  position: absolute;
  inset: 1px;
  pointer-events: none;
  border-radius: 17px;
  background: radial-gradient(circle at 50% 0%, rgba(255,255,255,.24), transparent 58%);
  opacity: .75;
}

.mac-dock-item {
  position: relative;
  z-index: 1;
  width: 30px;
  min-width: 0;
  height: 46px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  color: #f7f7f7;
  border-radius: 10px;
  transition: width .18s ease, transform .18s ease, background .18s ease, color .18s ease;
}

.mac-dock-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background:
    radial-gradient(circle at 32% 20%, rgba(255,255,255,.22), transparent 38%),
    linear-gradient(145deg, rgba(237,100,50,.92), rgba(22,22,22,.92));
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 8px 18px rgba(0,0,0,.32);
  transition: width .18s ease, height .18s ease, transform .18s ease, background .18s ease;
}

.mac-dock-icon svg {
  width: 17px;
  height: 17px;
}

.mac-dock-label {
  position: absolute;
  bottom: calc(100% + 11px);
  left: 50%;
  max-width: 160px;
  padding: 5px 8px;
  color: #fff;
  font-size: 11px;
  white-space: nowrap;
  border-radius: 7px;
  background: rgba(0,0,0,.62);
  border: 1px solid rgba(255,255,255,.12);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  box-shadow: 0 10px 30px rgba(0,0,0,.30);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 6px);
  transition: opacity .15s ease, transform .15s ease;
}

.mac-dock-item i {
  width: 4px;
  height: 4px;
  display: block;
  border-radius: 50%;
  background: transparent;
  transition: background .18s ease;
}

.mac-dock-item:hover {
  width: 46px;
  transform: translateY(-9px);
}

.mac-dock-item:hover .mac-dock-icon {
  width: 43px;
  height: 43px;
  transform: translateY(-4px);
}

.mac-dock-item:hover + .mac-dock-item .mac-dock-icon,
.mac-dock-item:has(+ .mac-dock-item:hover) .mac-dock-icon {
  width: 36px;
  height: 36px;
  transform: translateY(-2px);
}

.mac-dock-item:hover .mac-dock-label {
  opacity: 1;
  transform: translate(-50%, 0);
}

.mac-dock-item.is-active i {
  background: #f08080;
}

.mac-dock-item.is-active .mac-dock-icon {
  background:
    radial-gradient(circle at 32% 20%, rgba(255,255,255,.25), transparent 38%),
    linear-gradient(145deg, #ed6432, #5b2112);
}

/* Minimized cue — slow pulse on the running-dot so the user notices the
   app still has a window stashed away. Click the dock icon to restore. */
.mac-dock-item.is-minimized i {
  background: #ffbd2e;
  animation: dock-minimized-pulse 1.6s ease-in-out infinite;
}

@keyframes dock-minimized-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 189, 46, .55); }
  50%      { box-shadow: 0 0 0 4px rgba(255, 189, 46, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .mac-dock-item.is-minimized i { animation: none; }
}

.mac-app-window {
  width: min(1360px, calc(100vw - 80px));
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--mac-glass-line);
  border-radius: var(--mac-window-radius);
  background:
    linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.025) 70px),
    var(--mac-glass-bg-strong);
  -webkit-backdrop-filter: blur(26px) saturate(150%);
  backdrop-filter: blur(26px) saturate(150%);
  box-shadow: var(--mac-glass-shadow), inset 0 1px 0 rgba(255,255,255,.12);
  animation: macWindowIn .20s ease both;
}

.mac-app-window.support-page {
  width: min(1500px, calc(100vw - 80px));
}

.mac-window-bar {
  height: 42px;
  display: grid;
  grid-template-columns: 98px minmax(0, 1fr) 98px;
  align-items: center;
  padding: 0 14px;
  border-bottom: 1px solid rgba(255,255,255,.10);
  background:
    linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,.045)),
    rgba(0,0,0,.18);
}

.mac-window-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mac-window-actions button {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.18);
  transition: filter .15s ease, transform .15s ease;
}

.mac-window-actions button:hover {
  filter: brightness(1.15);
  transform: scale(1.06);
}

.mac-close { background: #ff5f57; }
.mac-minimize { background: #ffbd2e; }
.mac-fullscreen { background: #28c840; }

.mac-window-title {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: rgba(255,255,255,.82);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .02em;
}

.mac-window-title svg {
  width: 14px;
  height: 14px;
  color: var(--brand);
}

.mac-window-title span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mac-app-window > :not(.mac-window-bar) {
  margin-left: 18px;
  margin-right: 18px;
}

.mac-app-window > :last-child {
  margin-bottom: 18px;
}

.mac-app-window > .page-intro,
.mac-app-window > .analytics-hero,
.mac-app-window > .overview-hero,
.mac-app-window > .domain-layout,
.mac-app-window > .support-shell {
  margin-top: 18px;
}

.mac-app-window .panel,
.mac-app-window .mini-metric,
.mac-app-window .summary-card,
.mac-app-window .domain-cube,
.mac-app-window .kpi,
.mac-app-window .step-grid > div,
.mac-app-window .tabs,
.mac-app-window .table-wrap {
  background:
    linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.014)),
    rgba(15,15,15,.74);
  border-color: rgba(255,255,255,.10);
}

#page-root.is-minimized .mac-app-window {
  opacity: .42;
  pointer-events: none;
  transform: translateY(calc(100dvh - 190px)) scale(.22);
  transform-origin: bottom center;
}

#page-root.is-fullscreen {
  padding: 54px 12px 86px;
}

#page-root.is-fullscreen .mac-app-window {
  width: min(1800px, calc(100vw - 24px));
  min-height: calc(100dvh - 150px);
}

@keyframes macWindowIn {
  from { opacity: 0; transform: translateY(12px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 1180px) {
  :root { --mac-dock-width: clamp(320px, 54vw, 620px); }
  .topbar-brand { min-width: auto; }
  .mac-app-window,
  .mac-app-window.support-page {
    width: min(100%, calc(100vw - 32px));
  }
}

@media (max-width: 760px) {
  :root { --mac-dock-width: calc(100vw - 20px); }

  body { padding-bottom: 0; }

  .app-shell-macos #page-root {
    padding: 72px 10px 98px;
    place-items: start stretch;
  }

  .topbar-inner {
    min-height: 54px;
    padding: 8px 10px;
    gap: 8px;
  }

  .top-back {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
  }

  .topbar-brand .brand-name {
    display: none;
  }

  .top-context {
    max-width: none;
    flex: 1;
  }

  .top-context strong {
    font-size: 14px;
  }

  .top-actions {
    width: auto;
  }

  .top-pill:not(:first-child) {
    display: none;
  }

  .mac-dock {
    min-height: 64px;
    overflow-x: auto;
    justify-content: flex-start;
    padding: 8px 10px 6px;
    scrollbar-width: none;
  }

  .mac-dock::-webkit-scrollbar {
    display: none;
  }

  .mac-dock-item {
    width: 42px;
    flex: 0 0 42px;
  }

  .mac-dock-icon {
    width: 34px;
    height: 34px;
  }

  .mac-dock-item:hover,
  .mac-dock-item:hover + .mac-dock-item,
  .mac-dock-item:has(+ .mac-dock-item:hover) {
    width: 42px;
    transform: none;
  }

  .mac-dock-item:hover .mac-dock-icon,
  .mac-dock-item:hover + .mac-dock-item .mac-dock-icon,
  .mac-dock-item:has(+ .mac-dock-item:hover) .mac-dock-icon {
    width: 34px;
    height: 34px;
    transform: none;
  }

  .mac-app-window,
  .mac-app-window.support-page {
    width: 100%;
    border-radius: 14px;
  }

  .mac-window-bar {
    grid-template-columns: 74px minmax(0, 1fr) 28px;
    padding: 0 10px;
  }

  .mac-app-window > :not(.mac-window-bar) {
    margin-left: 10px;
    margin-right: 10px;
  }

  .mac-app-window > :last-child {
    margin-bottom: 10px;
  }

  .mac-app-window > .page-intro,
  .mac-app-window > .analytics-hero,
  .mac-app-window > .overview-hero,
  .mac-app-window > .domain-layout,
  .mac-app-window > .support-shell {
    margin-top: 10px;
  }

  #page-root.is-fullscreen {
    padding: 58px 6px 82px;
  }

  #page-root.is-minimized .mac-app-window {
    transform: translateY(calc(100dvh - 168px)) scale(.34);
  }

  .mobile-tabbar {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mac-dock-item,
  .mac-dock-icon,
  .mac-app-window,
  #page-root {
    animation: none !important;
    transition: none !important;
  }
}

/* Multi-window desktop behavior */
body.has-admin-bg {
  --page-bg-image: url("/macos/background/MontereyBackground.jpg?v=20260510-macos02");
  overflow: hidden;
}

.admin-bg-layer {
  background-position: center;
}

.admin-bg-layer:after {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 50% 20%, rgba(255,255,255,.12), transparent 36%),
    linear-gradient(180deg, rgba(0,0,0,.10), rgba(0,0,0,.42));
  pointer-events: none;
}

.app-shell-macos #page-root.desktop-root {
  position: relative;
  display: block;
  width: 100vw;
  height: 100dvh;
  min-height: 100dvh !important;
  padding: 0;
  overflow: hidden;
}

.mac-window-frame.mac-app-window {
  position: absolute;
  min-width: 420px;
  min-height: 320px;
  margin: 0;
  display: grid;
  grid-template-rows: 42px minmax(0, 1fr);
  background:
    linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,.025) 70px),
    rgba(10,10,10,.58);
  isolation: isolate;
  resize: none;
  transition: opacity .16s ease, transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.mac-window-frame.mac-app-window:before {
  content: "";
  position: absolute;
  inset: 42px 0 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(8,8,8,.86), rgba(8,8,8,.66) 48%, rgba(8,8,8,.78)),
    var(--app-bg-image);
  background-size: cover;
  background-position: center;
  opacity: .82;
}

.mac-window-frame.mac-app-window:after {
  content: "";
  position: absolute;
  inset: 42px 0 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.02) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
  opacity: .55;
}

.mac-window-frame.is-active {
  border-color: rgba(255,255,255,.28);
  box-shadow: 0 28px 110px rgba(0,0,0,.62), inset 0 1px 0 rgba(255,255,255,.18);
}

.mac-window-frame.is-minimized {
  opacity: 0 !important;
  pointer-events: none;
  visibility: hidden !important;
  transition: opacity .16s ease, visibility 0s .16s;
}

.mac-window-frame.is-fullscreen {
  border-radius: 12px;
}

.mac-window-frame > .mac-window-bar {
  cursor: grab;
  user-select: none;
}

.mac-window-frame > .mac-window-bar:active {
  cursor: grabbing;
}

.mac-window-content {
  min-height: 0;
  overflow: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.32) transparent;
}

.mac-window-content::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.mac-window-content::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.28);
  border-radius: 999px;
}

.mac-window-content > .page,
.mac-window-content > .support-page {
  width: auto;
  height: 100%;
  min-height: 0;
  margin: 0 !important;
  padding: 18px;
  animation: none;
  background: transparent;
  overflow: hidden;
}

.mac-window-content > .page {
  display: grid;
  align-content: start;
  gap: 12px;
}

.mac-window-content > .support-page {
  display: block;
}

.mac-window-content .page-intro,
.mac-window-content .analytics-hero {
  min-height: 0;
  margin: 0;
  padding: 14px 16px;
}

.mac-window-content .page-intro h1,
.mac-window-content .analytics-hero h1 {
  font-size: clamp(24px, 3.2vw, 42px);
  line-height: .95;
}

.mac-window-content .page-intro p,
.mac-window-content .analytics-hero p {
  margin-top: 6px;
  line-height: 1.25;
}

.mac-window-content .summary-strip {
  margin: 0;
}

.mac-window-content .summary-card,
.mac-window-content .mini-metric,
.mac-window-content .kpi {
  min-height: 78px;
  padding: 11px 12px;
}

.mac-window-content .summary-card strong,
.mac-window-content .mini-metric strong,
.mac-window-content .kpi strong {
  font-size: clamp(22px, 3vw, 34px);
}

.mac-window-content .data-panel,
.mac-window-content .domain-table,
.mac-window-content .tops-panel,
.mac-window-content .recent-panel {
  min-height: 0;
  overflow: hidden;
}

.mac-window-content .data-panel .panel-body,
.mac-window-content .domain-table .panel-body,
.mac-window-content .tops-panel .panel-body {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.mac-window-content .table-wrap {
  min-height: 0;
  overflow: auto;
}

.mac-window-content .table th,
.mac-window-content .table td {
  height: 40px;
}

.mac-window-content .finance-page {
  grid-template-rows: auto auto minmax(0, 1fr);
}

.mac-window-content .domains-page {
  grid-template-rows: auto auto minmax(0, 1fr);
}

.mac-window-content .analytics-page {
  grid-template-rows: auto auto minmax(0, 1fr);
}

.mac-window-content .users-page {
  grid-template-rows: auto minmax(0, 1fr);
}

.mac-window-content .dashboard-page {
  grid-template-rows: auto minmax(0, 1fr);
}

.mac-window-content .overview-hero,
.mac-window-content .ops-grid,
.mac-window-content .insight-grid,
.mac-window-content .domain-layout {
  min-height: 0;
  margin: 0;
}

.mac-window-content .ops-grid,
.mac-window-content .insight-grid,
.mac-window-content .domain-layout {
  overflow: hidden;
}

.mac-window-content .panel,
.mac-window-content .stack {
  min-height: 0;
}

.mac-window-content .support-shell {
  height: 100%;
  min-height: 0;
  margin: 0;
  overflow: hidden;
}

.mac-window-content .support-left,
.mac-window-content .support-right {
  min-height: 0;
  overflow: hidden;
  display: grid;
}

.mac-window-content .support-left {
  grid-template-rows: auto auto minmax(0, 1fr);
}

.mac-window-content .support-right {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  gap: 0;
}

.mac-window-content .support-inbox {
  min-height: 0;
  overflow: auto;
}

/* The right rail now contains: forms section + divider + presets section +
   responses. Let it scroll as one column instead of forcing a 3-row grid
   that crushed presets into 90px. */
.mac-window-content .support-right .support-tools,
.mac-window-content .support-right .support-responses {
  flex: 0 0 auto;
}

.mac-window-content .preset-list {
  overflow: visible;
  min-height: 0;
}

.mac-window-content .support-main {
  min-height: 0;
  grid-template-rows: 52px minmax(0, 1fr) 118px;
}

.mac-window-content .chat-empty {
  min-height: 0;
  overflow: auto;
}

.mac-window-content .support-composer {
  min-height: 0;
  padding: 10px 12px;
}

.mac-window-content .composer-tools {
  margin-bottom: 8px;
}

.mac-window-content .support-textarea {
  min-height: 42px;
  max-height: 64px;
}

.mac-window-content .chat-top {
  min-height: 0;
  padding: 10px 14px;
}

.mac-window-content .chat-empty {
  padding: 12px 14px;
}

.mac-window-content .composer-send {
  min-height: 0;
}

.mac-window-content .send-help {
  font-size: 11px;
  line-height: 1.2;
}

.mac-window-content .attachment-strip {
  max-height: 28px;
  overflow: auto;
}

.mac-window-content .page-intro,
.mac-window-content .analytics-hero {
  background:
    linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.02)),
    rgba(7,7,7,.62);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
}

.mac-window-frame > :not(.mac-window-bar) {
  margin: 0;
}

.mac-window-frame > :last-child {
  margin-bottom: 0;
}

.mac-window-title img {
  width: 17px;
  height: 17px;
  object-fit: contain;
}

.mac-resize-handle {
  position: absolute;
  z-index: 4;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  opacity: .72;
  background: transparent;
  border: 0;
}

.mac-resize-handle:before {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
}

.mac-resize-handle.is-se {
  right: 4px;
  bottom: 4px;
  cursor: nwse-resize;
}

.mac-resize-handle.is-se:before {
  right: 4px;
  bottom: 4px;
  border-right: 1px solid rgba(255,255,255,.55);
  border-bottom: 1px solid rgba(255,255,255,.55);
}

.mac-resize-handle.is-nw {
  left: 4px;
  top: 46px;
  cursor: nwse-resize;
}

.mac-resize-handle.is-nw:before {
  left: 4px;
  top: 4px;
  border-left: 1px solid rgba(255,255,255,.42);
  border-top: 1px solid rgba(255,255,255,.42);
}

.mac-resize-handle.is-ne {
  right: 4px;
  top: 46px;
  cursor: nesw-resize;
}

.mac-resize-handle.is-ne:before {
  right: 4px;
  top: 4px;
  border-right: 1px solid rgba(255,255,255,.42);
  border-top: 1px solid rgba(255,255,255,.42);
}

.mac-resize-handle.is-sw {
  left: 4px;
  bottom: 4px;
  cursor: nesw-resize;
}

.mac-resize-handle.is-sw:before {
  left: 4px;
  bottom: 4px;
  border-left: 1px solid rgba(255,255,255,.42);
  border-bottom: 1px solid rgba(255,255,255,.42);
}

.mac-dock {
  width: auto;
  min-width: 0;
  max-width: calc(100vw - 36px);
}

.mac-dock-item.is-open i {
  background: rgba(255,255,255,.74);
}

.mac-dock-item.is-active i {
  background: #f08080;
}

.mac-dock-icon {
  background: transparent;
  border: 0;
  box-shadow: none;
  overflow: visible;
}

.mac-dock-icon img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 10px 14px rgba(0,0,0,.34));
}

.mac-dock-icon svg {
  display: none;
}

.mac-dock-item.is-active .mac-dock-icon {
  background: transparent;
}

.mac-dock-item:active .mac-dock-icon img {
  filter: brightness(.72) drop-shadow(0 10px 14px rgba(0,0,0,.34));
}

.mobile-tabbar {
  display: none !important;
}

@media (max-width: 760px) {
  body.has-admin-bg {
    overflow: auto;
  }

  .app-shell-macos #page-root.desktop-root {
    overflow: auto;
    padding: 66px 10px 94px;
    height: auto;
    min-height: 100dvh !important;
  }

  .mac-window-frame.mac-app-window {
    position: relative;
    left: auto !important;
    top: auto !important;
    width: 100% !important;
    height: min(760px, calc(100dvh - 166px)) !important;
    min-width: 0;
    margin-bottom: 14px;
  }

  .mac-window-frame:not(.is-active) {
    display: none;
  }

  .mac-window-frame.is-minimized {
    display: none;
  }

  .mac-resize-handle {
    display: none;
  }

  .mac-window-content > .page,
  .mac-window-content > .support-page {
    padding: 10px;
  }

  .mac-window-content {
    overflow: hidden;
  }

  .mac-window-content .page-intro,
  .mac-window-content .analytics-hero {
    padding: 14px;
  }

  .mac-window-content .support-shell {
    grid-template-columns: 1fr;
  }

  .mac-window-content .support-left,
  .mac-window-content .support-right {
    display: none;
  }

  .mac-window-content .support-main {
    display: grid;
    min-height: 0;
    grid-template-rows: 52px minmax(0, 1fr) 126px;
  }
}

/* Telegram-inspired support app */
.mac-window-content .support-desk {
  grid-template-columns: 336px minmax(0, 1fr) 300px;
  gap: 0;
  background: rgba(24,24,24,.84);
  color: #fff;
}

.mac-window-content .support-desk .support-left,
.mac-window-content .support-desk .support-right {
  background: rgba(24,24,24,.92);
  border-color: rgba(255,255,255,.08);
  padding: 12px;
}

.mac-window-content .support-side-head,
.mac-window-content .support-tools-head {
  min-height: 44px;
  margin: 0 0 10px;
}

.mac-window-content .support-side-head h1 {
  font-size: 20px;
  letter-spacing: 0;
}

.mac-window-content .support-search-wrap {
  margin-bottom: 8px;
}

.mac-window-content .support-search {
  height: 38px;
  margin: 0;
  border-radius: 999px;
  border-color: rgba(255,255,255,.08);
  background: rgba(15,15,15,.92);
}

.mac-window-content .support-desk .chat-card {
  min-height: 72px;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 10px;
  padding: 8px 10px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: #aaa;
}

.mac-window-content .support-desk .chat-card:hover {
  background: rgba(255,255,255,.07);
}

.mac-window-content .support-desk .chat-card.is-active {
  background: #8774e1;
  color: #fff;
}

.mac-window-content .support-desk .chat-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #5ea9ff, #8774e1 58%, #ff8bb8);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.26);
}

.mac-window-content .support-desk .chat-card-main strong,
.mac-window-content .support-desk .chat-card-main em,
.mac-window-content .support-desk .chat-card-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mac-window-content .support-desk .chat-card-main strong {
  color: inherit;
  font-size: 14px;
}

.mac-window-content .support-desk .chat-card-main em,
.mac-window-content .support-desk .chat-card-main small {
  color: currentColor;
  opacity: .72;
}

.mac-window-content .support-main {
  background-color: #0f0f0f;
}

.mac-window-content .chat-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: rgba(24,24,24,.94);
}

.mac-window-content .chat-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.chat-action-pill {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-radius: 12px;
  color: #f2f2f2;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  font-size: 12px;
  font-weight: 800;
}

.chat-action-pill svg {
  width: 16px;
  height: 16px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #d7d7d7;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

.chat-selectbar {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: rgba(24,24,24,.94);
  width: fit-content;
  max-width: calc(100% - 24px);
}

.chat-selectbar > span {
  color: rgba(255,255,255,.78);
  font-weight: 700;
  white-space: nowrap;
}

.chat-selectbar .btn {
  width: auto;
  min-height: 34px;
}

.chat-selectbar > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.message-row {
  position: relative;
}

.msg-check {
  position: absolute;
  left: -28px;
  top: 10px;
}

.msg-check input {
  width: 18px;
  height: 18px;
}

.support-shell.is-selecting .support-thread {
  padding-left: max(12px, 8%);
}

@media (max-width: 760px) {
  .msg-check {
    left: 6px;
    top: 10px;
  }

  .support-shell.is-selecting .support-thread {
    padding-left: 12px;
  }

  .support-shell.is-selecting .message-row {
    padding-left: 34px;
  }
}

.mac-window-content .chat-top > span:first-of-type {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.mac-window-content .chat-top b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mac-window-content .chat-back {
  display: none;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: transparent;
  font-size: 24px;
}

.mac-window-content .support-thread {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px max(12px, 8%);
  background-color: #050505;
  background-image:
    linear-gradient(to bottom right, rgba(150,47,191,.10), rgba(221,108,185,.10)),
    url("/macos/background/telegram-chat-bg-dark.jpg");
  background-size: contain;
  background-repeat: repeat;
}

.mac-window-content .message-row {
  position: relative;
  max-width: min(72%, 560px);
  padding: 7px 10px 6px;
  border: 0;
  border-radius: 14px;
  box-shadow: 0 2px 10px rgba(0,0,0,.16);
  transition: transform .14s ease, box-shadow .14s ease, outline-color .14s ease;
}

.mac-window-content .message-row.is-user {
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  background: #212121;
}

.mac-window-content .message-row.is-admin {
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  background: #8774e1;
}

.mac-window-content .message-row.is-selected {
  outline: 2px solid rgba(255,255,255,.34);
  box-shadow: 0 8px 20px rgba(0,0,0,.22);
  transform: translateY(-1px);
}

.mac-window-content .message-row strong {
  display: none;
}

.mac-window-content .message-row p {
  line-height: 1.35;
}

.mac-window-content .message-row small {
  margin-top: 3px;
  text-align: right;
  color: rgba(255,255,255,.62);
}

.mac-window-content .support-composer {
  display: block;
  border-top: 1px solid rgba(255,255,255,.08);
  background: rgba(15,15,15,.94);
}

.mac-window-content .composer-field {
  position: relative;
  min-height: 104px;
  display: grid;
  grid-template-columns: 1fr;
  align-content: start;
  gap: 10px;
  border-radius: 18px;
  padding: 10px 12px 12px;
  background: #212121;
}

.mac-window-content .composer-tools {
  margin: 0;
  display: flex;
  gap: 4px;
}

.mac-window-content .composer-tools button {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #aaa;
  background: transparent;
}

.mac-window-content .support-textarea {
  min-height: 64px;
  max-height: 124px;
  padding: 4px 52px 4px 0;
}

.composer-send-inline {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #8774e1;
  color: #111;
  box-shadow: 0 10px 22px rgba(135,116,225,.28);
}

.composer-send-inline svg {
  width: 18px;
  height: 18px;
}

.mac-window-content .send-help {
  display: none;
}

.support-template-create {
  width: 100%;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border-radius: 12px;
  color: #fff;
  background: rgba(135,116,225,.16);
  border: 1px solid rgba(135,116,225,.32);
}

.support-template-create svg {
  width: 16px;
  height: 16px;
}

.support-template-builder {
  margin-bottom: 4px;
}

.support-template-builder .builder-field {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr) 38px;
  gap: 8px;
  align-items: center;
}

.support-template-builder .builder-field + .builder-field {
  margin-top: 8px;
}

.support-template-builder .builder-field button {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  color: #f0f0f0;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
}

.support-template-builder .form-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.support-template-builder .form-actions .btn {
  width: auto;
  min-width: 0;
}

/* is-narrow (760-980px): keep all 3 columns but compress left + right to fit */
.mac-window-frame.is-narrow .mac-window-content .support-desk {
  grid-template-columns: 240px minmax(0, 1fr) 220px;
}

/* Right panel stays visible in narrow — user needs it to manage templates/presets.
   In compact (≤760px) it's hidden and accessible only via the modal pickers. */
.mac-window-frame.is-narrow .mac-window-content .support-right {
  display: flex;
}

/* Tighten padding and text in narrow right-rail */
.mac-window-frame.is-narrow .mac-window-content .support-right {
  padding: 10px 8px;
  font-size: 12px;
}
.mac-window-frame.is-narrow .mac-window-content .support-tools-head strong {
  font-size: 12px;
}
.mac-window-frame.is-narrow .mac-window-content .support-tools-head .btn {
  padding: 0 8px;
  font-size: 11px;
  min-height: 28px;
}
.mac-window-frame.is-narrow .mac-window-content .preset-list {
  gap: 6px;
}
.mac-window-frame.is-narrow .mac-window-content .support-desk .preset {
  padding: 7px 8px;
}
.mac-window-frame.is-narrow .mac-window-content .support-tools-hint {
  display: none;
}

.mac-window-frame.is-compact .mac-window-content .support-desk {
  grid-template-columns: 1fr;
}

.mac-window-frame.is-compact .mac-window-content .support-left,
.mac-window-frame.is-compact .mac-window-content .support-main {
  grid-column: 1;
  grid-row: 1;
}

.mac-window-frame.is-compact .mac-window-content .support-right {
  display: none;
}

.mac-window-frame.is-compact .mac-window-content .support-left {
  display: none;
  border: 0;
}

.mac-window-frame.is-compact .mac-window-content .support-shell.show-list .support-left {
  display: grid;
}

.mac-window-frame.is-compact .mac-window-content .support-shell.show-list .support-main {
  display: none;
}

.mac-window-frame.is-compact .mac-window-content .chat-back {
  display: grid;
  place-items: center;
}

.mac-window-frame.is-compact .mac-window-content .support-thread {
  padding: 10px 8px;
}

.mac-window-frame.is-compact .mac-window-content .message-row {
  max-width: 86%;
}

.mac-window-frame.is-compact .mac-window-content .support-composer {
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 8px;
}

.mac-window-frame.is-compact .mac-window-content .composer-field {
  border-radius: 16px;
}

/* Window-width responsive mode for every app window */
.mac-window-frame.is-compact .mac-window-content > .page,
.mac-window-frame.is-compact .mac-window-content > .support-page {
  padding: 10px;
}

.mac-window-frame.is-compact .mac-window-content .page-intro,
.mac-window-frame.is-compact .mac-window-content .analytics-hero,
.mac-window-frame.is-compact .mac-window-content .overview-hero {
  padding: 12px;
}

.mac-window-frame.is-compact .mac-window-content .page-intro h1,
.mac-window-frame.is-compact .mac-window-content .analytics-hero h1 {
  font-size: 26px;
}

.mac-window-frame.is-compact .mac-window-content .summary-strip,
.mac-window-frame.is-compact .mac-window-content .ops-grid,
.mac-window-frame.is-compact .mac-window-content .insight-grid,
.mac-window-frame.is-compact .mac-window-content .domain-layout,
.mac-window-frame.is-compact .mac-window-content .kpi-grid,
.mac-window-frame.is-compact .mac-window-content .settings-grid {
  grid-template-columns: 1fr !important;
}

.mac-window-frame.is-compact .mac-window-content .summary-card,
.mac-window-frame.is-compact .mac-window-content .mini-metric,
.mac-window-frame.is-compact .mac-window-content .kpi {
  min-height: 70px;
}

.mac-window-frame.is-compact .mac-window-content .table-wrap {
  overflow: auto;
}

.mac-window-frame.is-compact .mac-window-content .table {
  min-width: 680px;
}

/* Production layout hardening pass */
.app-shell-macos {
  height: 100dvh;
  overflow: hidden;
  padding-bottom: 0;
}

.mac-window-content .data-panel,
.mac-window-content .domain-table,
.mac-window-content .tops-panel,
.mac-window-content .recent-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.mac-window-content .data-panel > .table-toolbar,
.mac-window-content .domain-table > .table-toolbar,
.mac-window-content .tops-panel > .table-toolbar {
  min-height: 0;
}

.mac-window-content .data-panel > .table-wrap,
.mac-window-content .domain-table > .table-wrap,
.mac-window-content .tops-panel > .table-wrap {
  min-height: 0;
}

.mac-window-content .data-panel > .pagination,
.mac-window-content .domain-table > .pagination,
.mac-window-content .tops-panel > .pagination {
  min-height: 54px;
}

.mac-window-content .users-page {
  grid-template-rows: auto auto minmax(0, 1fr);
}

.mac-window-content .analytics-page,
.mac-window-content .dashboard-page,
.mac-window-content .finance-page,
.mac-window-content .domains-page,
.mac-window-content .users-page {
  align-content: stretch;
}

.mac-window-content .summary-strip {
  min-height: 0;
}

.mac-window-content .table-toolbar {
  gap: 10px;
  padding: 10px 12px;
}

.mac-window-content .table-toolbar .filters {
  min-width: min(360px, 48%);
}

.mac-window-content .table-toolbar .filters > *,
.mac-window-content .table-toolbar > .input {
  min-width: 0;
}

.mac-window-content .pagination {
  min-height: 50px;
  padding: 8px 10px;
  gap: 8px;
}

.mac-window-content .page-size {
  min-height: 30px;
}

.mac-window-frame.is-compact .mac-window-content .data-panel,
.mac-window-frame.is-compact .mac-window-content .domain-table,
.mac-window-frame.is-compact .mac-window-content .tops-panel {
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.mac-window-frame.is-compact .mac-window-content .table-toolbar {
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 8px;
  padding: 10px;
}

.mac-window-frame.is-compact .mac-window-content .table-toolbar .filters {
  min-width: 0;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.mac-window-frame.is-compact .mac-window-content .table-toolbar .filters > *,
.mac-window-frame.is-compact .mac-window-content .table-toolbar > .input {
  width: 100%;
}

.mac-window-frame.is-compact .mac-window-content .table-wrap {
  border: 1px solid rgba(255,255,255,.10);
  overflow: auto;
}

.mac-window-frame.is-compact .mac-window-content .table,
.mac-window-frame.is-compact .mac-window-content .table thead,
.mac-window-frame.is-compact .mac-window-content .table tbody,
.mac-window-frame.is-compact .mac-window-content .table tr,
.mac-window-frame.is-compact .mac-window-content .table td {
  display: block;
  width: 100% !important;
  min-width: 0 !important;
}

.mac-window-frame.is-compact .mac-window-content .table {
  table-layout: auto;
  border-collapse: separate;
  border-spacing: 0;
}

.mac-window-frame.is-compact .mac-window-content .table thead {
  display: none;
}

.mac-window-frame.is-compact .mac-window-content .table tbody {
  padding: 8px;
}

.mac-window-frame.is-compact .mac-window-content .table tr {
  margin: 0 0 8px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 12px;
  background: rgba(12,12,12,.72);
  overflow: hidden;
}

.mac-window-frame.is-compact .mac-window-content .table td {
  min-height: 38px;
  height: auto;
  display: grid;
  grid-template-columns: minmax(94px, 38%) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border-right: 0;
  white-space: normal;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.mac-window-frame.is-compact .mac-window-content .table td:before {
  content: attr(data-label);
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.mac-window-frame.is-compact .mac-window-content .table td[colspan] {
  display: block;
}

.mac-window-frame.is-compact .mac-window-content .table td[colspan]:before {
  content: none;
}

.mac-window-frame.is-compact .mac-window-content .actions,
.mac-window-frame.is-compact .mac-window-content .table-actions {
  justify-self: end;
}

.mac-window-frame.is-compact .mac-window-content .pagination {
  min-height: 46px;
  justify-content: center;
  padding: 6px;
  font-size: 11px;
}

.mac-window-frame.is-compact .mac-window-content .pagination > span:first-child {
  width: 100%;
  text-align: center;
}

.mac-window-frame.is-compact .mac-window-content .page-num,
.mac-window-frame.is-compact .mac-window-content .page-arrow {
  width: 28px;
  height: 28px;
}

.mac-window-frame.is-compact .mac-window-content .page-size {
  width: 100%;
}

.mac-window-frame.is-compact .mac-window-content .summary-card,
.mac-window-frame.is-compact .mac-window-content .mini-metric,
.mac-window-frame.is-compact .mac-window-content .kpi {
  min-height: 68px;
  padding: 10px;
}

.mac-window-frame.is-compact .mac-window-content .summary-strip {
  grid-template-columns: repeat(auto-fit, minmax(138px, 1fr)) !important;
  gap: 6px;
}

.mac-window-frame.is-compact .mac-window-content .summary-card {
  min-height: 56px;
  gap: 2px;
}

.mac-window-frame.is-compact .mac-window-content .summary-card strong,
.mac-window-frame.is-compact .mac-window-content .mini-metric strong,
.mac-window-frame.is-compact .mac-window-content .kpi strong {
  font-size: 24px;
}

.mac-window-frame.is-compact .mac-window-content .summary-card strong {
  font-size: 20px;
}

.mac-window-frame.is-compact .mac-window-content .summary-card span,
.mac-window-frame.is-compact .mac-window-content .summary-card small {
  font-size: 9px;
  line-height: 1.15;
}

.mac-window-frame.is-compact .mac-window-content .page-intro p,
.mac-window-frame.is-compact .mac-window-content .analytics-hero p {
  font-size: 12px;
}

.mac-window-frame.is-compact .mac-window-content .intro-search {
  width: 100%;
}

.mac-window-content .support-inbox,
.mac-window-content .preset-list,
.mac-window-content .support-responses {
  align-content: start;
  grid-auto-rows: max-content;
}

.mac-window-content .support-desk .chat-card {
  min-height: 68px;
  max-height: 86px;
}

.mac-window-content .support-desk .chat-card.is-active {
  max-height: 96px;
}

.mac-window-content .support-desk .preset {
  min-height: 64px;
  max-height: 96px;
}

.mac-window-content .chat-peer {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.mac-window-content .chat-peer {
  cursor: pointer;
  text-decoration: none;
}

.mac-window-content .chat-peer:active {
  opacity: .85;
}

.mac-window-content .chat-peer > span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.mac-window-content .chat-peer-avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-style: normal;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #5ea9ff, #8774e1 60%, #ff8bb8);
}

.mac-window-content .chat-peer b,
.mac-window-content .chat-peer em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mac-window-content .chat-peer em {
  color: #aaa;
  font-size: 12px;
  font-style: normal;
  font-weight: 600;
}

.mac-window-frame.is-compact .mac-window-content .support-main {
  grid-template-rows: 54px minmax(0, 1fr) 92px;
}

.mac-window-frame.is-compact .mac-window-content .support-composer {
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 6px;
}

.mac-window-frame.is-compact .mac-window-content .composer-send .btn {
  width: 38px;
  min-width: 38px;
  height: 38px;
}

@media (max-width: 760px) {
  .app-shell-macos {
    height: 100dvh;
    overflow: hidden;
  }

  .app-shell-macos #page-root.desktop-root {
    overflow: hidden;
    height: 100dvh;
    min-height: 100dvh !important;
    padding: 66px 10px 100px;
  }

  .mac-window-frame.mac-app-window {
    height: calc(100dvh - 166px) !important;
    max-height: calc(100dvh - 166px);
    margin-bottom: 0;
  }

  .mac-window-content > .page,
  .mac-window-content > .support-page {
    padding: 10px;
  }

  .mac-window-content .data-panel > .pagination,
  .mac-window-content .domain-table > .pagination,
  .mac-window-content .tops-panel > .pagination {
    min-height: 44px;
  }
}

/* MacOS admin hardening: desktop widget, sane app scale, readable mobile windows */

/* Prevent native browser text-selection drag on the desktop background.
   Windows, inputs, and table cells re-enable it locally. */
.app-shell-macos .app-workspace,
.app-shell-macos #page-root.desktop-root {
  -webkit-user-select: none;
  user-select: none;
}
.app-shell-macos .mac-window-content,
.app-shell-macos input,
.app-shell-macos textarea,
.app-shell-macos td,
.app-shell-macos th,
.app-shell-macos p,
.app-shell-macos span,
.app-shell-macos label {
  -webkit-user-select: text;
  user-select: text;
}

.topbar-brand .brand-box {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.desktop-welcome-widget {
  position: fixed;
  top: 64px;
  left: 18px;
  z-index: 8;
  width: min(458px, calc(100vw - 36px));
  min-height: 214px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 18px;
  background:
    linear-gradient(90deg, rgba(9,9,9,.94) 0%, rgba(9,9,9,.84) 54%, rgba(9,9,9,.36) 100%),
    rgba(10,10,10,.70);
  -webkit-backdrop-filter: blur(26px) saturate(150%);
  backdrop-filter: blur(26px) saturate(150%);
  box-shadow: 0 22px 80px rgba(0,0,0,.46), inset 0 1px 0 rgba(255,255,255,.12);
}

.desktop-widget-visual {
  position: absolute;
  inset: 0 0 0 auto;
  width: 56%;
  height: 100%;
  object-fit: cover;
  opacity: .62;
  pointer-events: none;
}

.desktop-widget-copy {
  position: relative;
  z-index: 1;
  width: 70%;
  padding: 22px;
}

.desktop-widget-copy h2 {
  margin: 10px 0 8px;
  color: #fff;
  font-size: clamp(28px, 3vw, 42px);
  line-height: .98;
  letter-spacing: -.04em;
  text-wrap: balance;
}

.desktop-widget-copy p {
  color: rgba(255,255,255,.84);
  font-weight: 700;
}

.desktop-widget-copy .hero-actions {
  margin-top: 18px;
}

.desktop-widget-copy .btn {
  min-height: 36px;
  width: auto;
}

.desktop-root .mac-window-frame {
  z-index: 40;
}

.app-shell-macos #page-root.desktop-root {
  z-index: 20;
  pointer-events: none;
}

.app-shell-macos #page-root.desktop-root .mac-window-frame {
  pointer-events: auto;
}

.mac-window-frame.mac-app-window {
  min-width: min(420px, calc(100vw - 20px));
  min-height: min(360px, calc(100dvh - 110px));
}

.mac-window-frame.mac-app-window:before {
  background:
    linear-gradient(90deg, rgba(8,8,8,.72), rgba(8,8,8,.48) 48%, rgba(8,8,8,.60)),
    var(--app-bg-image);
  opacity: .98;
}

.mac-window-content {
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.mac-window-content > .page,
.mac-window-content > .support-page {
  min-height: 100%;
  overflow: visible;
}

.mac-window-content .overview-hero,
.mac-window-content .ops-grid,
.mac-window-content .insight-grid,
.mac-window-content .domain-layout {
  overflow: visible;
}

.mac-window-content .chart-panel,
.mac-window-content .chart,
.mac-window-content .chart-canvas {
  min-height: 0;
}

.mac-window-content .chart-canvas {
  height: clamp(180px, 27dvh, 260px);
}

.mac-window-content .hero-command {
  min-height: clamp(300px, 43dvh, 430px);
}

.mac-window-content .hero-command h1 {
  font-size: clamp(34px, 4.7vw, 62px);
}

.mac-window-content .support-mobile-forms {
  display: none;
}

.support-template-backdrop {
  position: fixed;
  inset: 0;
  z-index: 940;
  background: rgba(0,0,0,.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.support-template-modal {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 941;
  width: min(520px, calc(100vw - 24px));
  max-height: min(760px, calc(100dvh - 24px));
  transform: translate(-50%, -50%);
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(15,15,15,.92);
  color: #fff;
  box-shadow: 0 28px 110px rgba(0,0,0,.68);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.support-template-modal header,
.support-template-modal footer {
  padding: 12px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,.10);
}

.support-template-modal footer {
  border-top: 1px solid rgba(255,255,255,.10);
  border-bottom: 0;
  justify-content: flex-end;
}

.support-template-list {
  padding: 10px;
  overflow: auto;
  display: grid;
  gap: 8px;
}

.support-template-row {
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
  color: #fff;
}

.support-template-row span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.support-template-row strong,
.support-template-row small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.support-template-row small {
  color: rgba(255,255,255,.68);
  font-weight: 600;
}

.support-template-row i {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.28);
}

.support-template-row.is-selected {
  border-color: rgba(135,116,225,.85);
  background: rgba(135,116,225,.18);
}

.support-template-row.is-selected i {
  border-color: #8774e1;
  background: #8774e1;
}

.mac-notification-stack {
  position: fixed;
  top: 58px;
  right: max(16px, env(safe-area-inset-right));
  z-index: 120;
  width: min(440px, calc(100vw - 32px));
  display: grid;
  gap: 10px;
  pointer-events: none;
}

.mac-notification {
  pointer-events: auto;
  min-height: 74px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  text-align: left;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 18px;
  color: #1b1b1b;
  background: rgba(246,250,250,.86);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
  backdrop-filter: blur(24px) saturate(170%);
  box-shadow: 0 18px 58px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.76);
  animation: macNotifyIn .24s ease both;
  transition: opacity .18s ease, transform .18s ease;
}

.mac-notification.is-out {
  opacity: 0;
  transform: translateY(-8px);
}

.mac-notification-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #fff;
}

.mac-notification-icon svg {
  width: 19px;
  height: 19px;
}

.mac-notification-icon.is-deposit {
  background: linear-gradient(145deg, #53c93f, #167a34);
}

.mac-notification-icon.is-support {
  background: linear-gradient(145deg, #4788ff, #2748a6);
}

.mac-notification strong,
.mac-notification small {
  min-width: 0;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mac-notification strong {
  font-size: 15px;
}

.mac-notification small {
  margin-top: 2px;
  color: rgba(0,0,0,.72);
  font-size: 12px;
  font-weight: 600;
}

@keyframes macNotifyIn {
  from { opacity: 0; transform: translateY(-10px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 1180px) {
  .desktop-welcome-widget {
    display: none;
  }
}

@media (max-width: 760px) {
  html,
  body.has-admin-bg,
  .app-shell-macos {
    height: 100dvh;
    overflow: hidden;
  }

  .topbar {
    min-height: 54px;
  }

  .app-shell-macos #page-root.desktop-root {
    padding: 58px 8px 86px;
  }

  .mac-window-frame.mac-app-window {
    width: calc(100vw - 16px) !important;
    height: calc(100dvh - 144px) !important;
    max-height: calc(100dvh - 144px);
    border-radius: 16px;
  }

  .top-wallpaper { display: none !important; }

  .mac-window-content {
    overflow: auto;
  }

  .mac-window-content > .page,
  .mac-window-content > .support-page {
    min-height: 100%;
    padding: 8px;
  }

  .mac-window-content .support-shell {
    height: 100%;
    min-height: 0;
  }

  .mac-window-content .support-main {
    grid-template-rows: 50px minmax(0, 1fr) auto !important;
  }

  .mac-window-content .support-composer {
    position: sticky;
    bottom: 0;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  }

  .mac-window-content .composer-field {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 18px;
  }

  .mac-window-content .support-mobile-forms {
    grid-column: 1 / -1;
    display: flex;
    gap: 6px;
    max-width: 100%;
    overflow-x: auto;
    padding-top: 4px;
    scrollbar-width: none;
  }

  .mac-window-content .support-mobile-forms::-webkit-scrollbar {
    display: none;
  }

  .mac-window-content .support-mobile-forms button {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 12px;
    color: #e8e8e8;
    background: rgba(255,255,255,.06);
    font-size: 12px;
    font-weight: 700;
  }

  .support-template-open {
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }

  .support-template-open svg {
    width: 14px;
    height: 14px;
  }

  .chat-action-pill {
    min-height: 34px;
    padding: 0 10px;
    border-radius: 11px;
    font-size: 11px;
  }

  .chat-action-pill span {
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .support-template-modal {
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    width: 100%;
    max-height: min(88dvh, 760px);
    transform: none;
    border-radius: 18px 18px 0 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
  }

  .support-template-modal header,
  .support-template-modal footer,
  .support-template-list {
    padding-left: 14px;
    padding-right: 14px;
  }

  .support-template-modal footer {
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }

  .support-template-builder .builder-field {
    grid-template-columns: 1fr;
  }

  .support-template-builder .builder-field button {
    width: 100%;
  }

  .support-template-builder .form-actions {
    flex-direction: column;
  }

  .support-template-builder .form-actions .btn {
    width: 100%;
  }

  .input,
  .select,
  .textarea,
  .support-textarea,
  input,
  textarea,
  select {
    font-size: 16px;
  }

  .mac-notification-stack {
    top: 62px;
    right: 8px;
    left: 8px;
    width: auto;
  }
}

@media (min-width: 761px) {
  .app-shell-macos #page-root.desktop-root .mac-window-content .support-main {
    position: relative !important;
  }

  .app-shell-macos #page-root.desktop-root .mac-window-content .chat-selectbar {
    position: absolute !important;
    top: 72px !important;
    left: 14px !important;
    right: auto !important;
    bottom: auto !important;
    display: inline-flex !important;
    width: auto !important;
    max-width: calc(100% - 28px) !important;
    min-height: 40px !important;
    padding: 6px 8px !important;
    border: 1px solid rgba(255,255,255,.12) !important;
    border-radius: 14px !important;
    background: rgba(24,24,24,.98) !important;
    box-shadow: 0 18px 42px rgba(0,0,0,.34) !important;
    z-index: 9 !important;
  }

  .app-shell-macos #page-root.desktop-root .mac-window-content .chat-selectbar[hidden] {
    display: none !important;
  }
}

/* Final window overflow guard: regular app windows scroll only when JS marks overflow; support remains internally managed. */
.mac-window-frame.mac-app-window:not(.has-page-scroll) > .mac-window-content {
  overflow-x: hidden !important;
  overflow-y: hidden !important;
}

.mac-window-frame.mac-app-window.has-page-scroll > .mac-window-content {
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

.mac-window-frame.mac-app-window.no-page-scroll > .mac-window-content {
  overflow: hidden !important;
}

.mac-window-frame.mac-app-window.has-page-scroll > .mac-window-content > .page {
  height: auto !important;
  min-height: 100% !important;
  overflow: visible !important;
}

.mac-window-frame.mac-app-window.has-page-scroll > .mac-window-content .dashboard-page,
.mac-window-frame.mac-app-window.has-page-scroll > .mac-window-content .finance-page,
.mac-window-frame.mac-app-window.has-page-scroll > .mac-window-content .analytics-page,
.mac-window-frame.mac-app-window.has-page-scroll > .mac-window-content .domains-page,
.mac-window-frame.mac-app-window.has-page-scroll > .mac-window-content .users-page,
.mac-window-frame.mac-app-window.has-page-scroll > .mac-window-content .promo-page {
  grid-template-rows: none !important;
  align-content: start !important;
}

.mac-window-frame.mac-app-window.has-page-scroll > .mac-window-content .overview-hero,
.mac-window-frame.mac-app-window.has-page-scroll > .mac-window-content .ops-grid,
.mac-window-frame.mac-app-window.has-page-scroll > .mac-window-content .insight-grid,
.mac-window-frame.mac-app-window.has-page-scroll > .mac-window-content .domain-layout,
.mac-window-frame.mac-app-window.has-page-scroll > .mac-window-content .data-panel,
.mac-window-frame.mac-app-window.has-page-scroll > .mac-window-content .domain-table,
.mac-window-frame.mac-app-window.has-page-scroll > .mac-window-content .tops-panel,
.mac-window-frame.mac-app-window.has-page-scroll > .mac-window-content .recent-panel,
.mac-window-frame.mac-app-window.has-page-scroll > .mac-window-content .panel-body {
  min-height: 0 !important;
  overflow: visible !important;
}

.mac-window-frame.mac-app-window.has-page-scroll > .mac-window-content .data-panel,
.mac-window-frame.mac-app-window.has-page-scroll > .mac-window-content .domain-table,
.mac-window-frame.mac-app-window.has-page-scroll > .mac-window-content .tops-panel,
.mac-window-frame.mac-app-window.has-page-scroll > .mac-window-content .recent-panel,
.mac-window-frame.mac-app-window.has-page-scroll > .mac-window-content .data-panel .panel-body,
.mac-window-frame.mac-app-window.has-page-scroll > .mac-window-content .domain-table .panel-body,
.mac-window-frame.mac-app-window.has-page-scroll > .mac-window-content .tops-panel .panel-body {
  display: block !important;
}

.mac-window-frame.mac-app-window.has-page-scroll > .mac-window-content .table-wrap {
  max-height: none !important;
}

.mac-window-frame.mac-app-window.no-page-scroll > .mac-window-content > .support-page,
.mac-window-frame.mac-app-window.no-page-scroll > .mac-window-content .support-shell {
  height: 100% !important;
  overflow: hidden !important;
}

/* ===== DEPOSIT section (per-tenant min deposit) ========================= */
.deposit-section { margin-top: 16px; }
.deposit-head { grid-column: 1 / -1; margin-bottom: 4px; }
.deposit-title { font-size: 14px; font-weight: 600; display: block; margin-bottom: 4px; }
.deposit-help { font-size: 12px; color: var(--text-muted, #888); line-height: 1.5; margin: 0; max-width: 760px; }
.vis-row { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 18px; padding: 13px 0; border-top: 1px solid #202020; }
.vis-row:first-of-type { border-top: 0; padding-top: 6px; }
.vis-row__title { font-size: 13px; font-weight: 600; display: block; margin-bottom: 3px; }
.vis-row__help { font-size: 12px; color: var(--text-muted, #888); line-height: 1.45; max-width: 640px; }
.vis-row .toggle { flex-shrink: 0; cursor: pointer; border: 0; padding: 0; }
.min-deposit-wrap {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 220px;
}
.min-deposit-sym {
  position: absolute;
  left: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted, #888);
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}
.min-deposit-input {
  width: 100%;
  padding-left: 24px;
  font-variant-numeric: tabular-nums;
}
.min-deposit-input::-webkit-outer-spin-button,
.min-deposit-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.min-deposit-input { -moz-appearance: textfield; }

/* ===== ARBITRAGE v2 (pencil-modal section) ============================== */
.arb-section { margin-top: 16px; }
.arb-head { grid-column: 1 / -1; margin-bottom: 4px; }
.arb-title { font-size: 14px; font-weight: 600; display:block; margin-bottom: 4px; }
.arb-help { font-size: 12px; color: var(--text-muted, #888); line-height: 1.5; margin: 0; max-width: 760px; }
.arb-help strong { color: var(--text, #222); font-weight: 600; }
.arb-dist-grid { display: grid; grid-template-columns: repeat(3, 1fr) auto; gap: 8px; align-items: end; }
.arb-dist-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.arb-dist-grid label span { color: var(--text-muted, #888); }
.arb-dist-sum { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 13px; align-self: center; padding: 0 8px; }
.arb-dist-sum-off { color: #d9534f; }
.arb-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.arb-warn { font-size: 12px; color: #d97706; background: #fef3c7; padding: 6px 10px; border-radius: 6px; }
.arb-warn.hidden { display: none; }
.hidden { display: none !important; }

/* ===== Preview modal =================================================== */
.arb-preview-modal { position: fixed; inset: 0; z-index: 9999; }
.arb-preview-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.55); }
.arb-preview-card { position: absolute; top: 5vh; left: 50%; transform: translateX(-50%); width: min(96vw, 1240px); max-height: 90vh; background: var(--bg, #fff); border-radius: 14px; box-shadow: 0 30px 80px rgba(0,0,0,0.35); display: flex; flex-direction: column; overflow: hidden; }
.arb-preview-card > header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border, #e5e5e5); }
.arb-preview-card > header strong { font-size: 15px; font-weight: 600; }
.arb-preview-body { padding: 18px 20px; overflow-y: auto; flex: 1; }
.arb-preview-summary { font-size: 13px; color: var(--text-muted, #666); margin-bottom: 12px; }
.arb-preview-scroll { overflow-x: auto; }
.arb-preview-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.arb-preview-table th, .arb-preview-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border, #eee); vertical-align: top; }
.arb-preview-table th { background: var(--bg-secondary, #f5f5f5); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
.arb-preview-title { font-weight: 500; line-height: 1.3; }
.arb-preview-bucket { font-size: 11px; color: var(--text-muted, #888); margin-top: 3px; }
.arb-preview-table .mono-value { font-family: ui-monospace, 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums; font-size: 12px; }
.arb-preview-table a { color: var(--accent, #ed6432); text-decoration: none; }
.arb-preview-table a:hover { text-decoration: underline; }
.arb-preview-empty { padding: 32px; text-align: center; color: var(--text-muted, #888); }
.arb-preview-empty .hint { font-size: 12px; margin-top: 8px; }

/* ===== WALLPAPER PICKER ================================================ */
.top-wallpaper { color: #a0a0a0; }
.top-wallpaper:hover { color: var(--brand); border-color: var(--brand) !important; }
.top-wallpaper svg { width: 17px; height: 17px; }

.wallpaper-page { padding: 0 0 32px; animation: pageIn .2s ease-out both; }
.wp-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 24px 24px 20px; border-bottom: 1px solid #1e1e1e; flex-wrap: wrap; }
.wp-hero-copy { min-width: 0; }
.wp-eyebrow { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #666; margin-bottom: 10px; }
.wp-eyebrow svg { width: 14px; height: 14px; color: var(--brand); }
.wallpaper-page h1 { font-size: 22px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; margin-bottom: 6px; color: #f0f0f0; }
.wallpaper-page h1 + p { font-size: 12px; color: #666; font-weight: 500; max-width: 340px; line-height: 1.55; }
.wp-hero-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex-shrink: 0; }

.wp-upload-btn { display: inline-flex; align-items: center; gap: 8px; padding: 0 16px; height: 36px; background: var(--brand); color: #fff; border-radius: 8px; font-size: 12px; font-weight: 700; cursor: pointer; border: 1px solid transparent; transition: background .16s ease, transform .14s ease; letter-spacing: -.01em; user-select: none; }
.wp-upload-btn:hover { background: var(--brand-hover); transform: translateY(-1px); }
.wp-upload-btn:active { transform: scale(.97); }
.wp-upload-btn.is-busy { opacity: .6; pointer-events: none; }
.wp-upload-btn svg { width: 14px; height: 14px; }

.wp-reset-btn { display: inline-flex; align-items: center; gap: 8px; padding: 0 16px; height: 36px; background: #111; color: #aaa; border: 1px solid #242424; border-radius: 8px; font-size: 12px; font-weight: 700; cursor: pointer; transition: color .16s, border-color .16s, transform .14s; letter-spacing: -.01em; }
.wp-reset-btn:hover { color: #e8e8e8; border-color: #3a3a3a; transform: translateY(-1px); }
.wp-reset-btn svg { width: 13px; height: 13px; }

.wp-body { padding: 0 20px 20px; }
.wp-section { margin-top: 24px; }
.wp-section-title { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #555; margin-bottom: 14px; padding-left: 4px; }

.wp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 10px; }

.wp-tile { position: relative; aspect-ratio: 16/10; border-radius: 10px; overflow: hidden; border: 2px solid transparent; cursor: pointer; background: #111; transition: transform .18s cubic-bezier(.4,0,.2,1), border-color .15s ease, box-shadow .18s ease; }
.wp-tile:hover { transform: translateY(-2px) scale(1.015); box-shadow: 0 8px 24px rgba(0,0,0,.5); border-color: rgba(255,255,255,.12); }
.wp-tile:focus-visible { outline: none; border-color: var(--brand); box-shadow: 0 0 0 2px rgba(237,100,50,.35); }
.wp-tile.is-active { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(237,100,50,.25), 0 8px 24px rgba(0,0,0,.4); }

.wp-tile-image { position: absolute; inset: 0; background-size: cover; background-position: center; transition: transform .35s ease; }
.wp-tile:hover .wp-tile-image { transform: scale(1.04); }

.wp-tile-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; padding: 8px 10px; background: linear-gradient(to top, rgba(0,0,0,.72) 0%, transparent 55%); opacity: 0; transition: opacity .18s ease; pointer-events: none; }
.wp-tile:hover .wp-tile-overlay, .wp-tile.is-active .wp-tile-overlay { opacity: 1; }
.wp-tile-check { display: none; width: 18px; height: 18px; color: var(--brand); margin-bottom: 4px; flex-shrink: 0; }
.wp-tile.is-active .wp-tile-check { display: block; }
.wp-tile-check svg { width: 18px; height: 18px; }
.wp-tile-label { font-size: 10px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: .02em; }

.wp-tile-pill { position: absolute; top: 6px; left: 6px; background: var(--brand); color: #fff; font-size: 9px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; border-radius: 6px; padding: 2px 6px; pointer-events: none; }

.wp-tile-delete { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; background: rgba(0,0,0,.7); display: grid; place-items: center; opacity: 0; transition: opacity .15s ease, background .15s; cursor: pointer; z-index: 2; }
.wp-tile-delete svg { width: 12px; height: 12px; color: #fff; }
.wp-tile:hover .wp-tile-delete { opacity: 1; }
.wp-tile-delete:hover { background: rgba(220,50,40,.85); }

.wp-loading { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 24px; }
.wp-pulse { aspect-ratio: 16/10; border-radius: 10px; background: #111; animation: wpPulse 1.6s ease-in-out infinite; }
.wp-pulse:nth-child(2) { animation-delay: .22s; }
.wp-pulse:nth-child(3) { animation-delay: .44s; }
@keyframes wpPulse { 0%, 100% { opacity: .35; } 50% { opacity: .7; } }

.wp-empty { padding: 28px 20px; text-align: center; color: #555; font-size: 12px; font-weight: 500; }
.wp-empty-uploads { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 28px 20px; }
.wp-empty-illus { width: 56px; height: 42px; color: #333; margin-bottom: 4px; }
.wp-empty-illus svg { width: 100%; height: 100%; }
.wp-empty-uploads strong { font-size: 13px; font-weight: 700; color: #666; }
.wp-empty-uploads span { font-size: 11px; color: #444; line-height: 1.55; max-width: 260px; text-align: center; }

[data-wp-error] { margin: 12px 24px 0; padding: 8px 14px; background: rgba(220,50,40,.12); border: 1px solid rgba(220,50,40,.28); border-radius: 7px; color: #f87171; font-size: 11px; font-weight: 600; }

/* Window width override for the wallpaper picker */
.mac-window-wallpaper { min-width: 520px !important; }

/* ===== DESKTOP MARQUEE SELECTION ====================================== */
.desktop-marquee {
  position: fixed;
  pointer-events: none;
  border: 1px solid rgba(100,160,255,.8);
  background: rgba(60,120,210,.14);
  border-radius: 2px;
  z-index: 9999;
  animation: marqueeIn .04s ease-out both;
}
.desktop-marquee.is-out { opacity: 0; transition: opacity .14s ease; }
@keyframes marqueeIn { from { opacity: 0; } to { opacity: 1; } }
body.is-marquee-active { cursor: crosshair !important; user-select: none !important; }

@media (prefers-reduced-motion: reduce) {
  .wp-tile, .wp-tile-image, .wp-tile-overlay, .wp-upload-btn, .wp-reset-btn, .wp-pulse, .desktop-marquee { transition: none !important; animation: none !important; }
}

/* Verification dropdown — anchored under the .select-button trigger, closes
   on outside click. Uses the admin panel's dark theme tokens so it doesn't
   stand out as a white block against the black surfaces. */
.select-dropdown { position: relative; }
.select-dropdown .select-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 40;
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.45);
  list-style: none;
  margin: 0;
  padding: 4px;
  max-height: 280px;
  overflow-y: auto;
  color: var(--text);
}
.select-dropdown .select-menu[hidden] { display: none; }
.select-dropdown .select-menu li { margin: 0; list-style: none; }
.select-dropdown .select-menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 8px 10px;
  font: inherit;
  color: var(--text);
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 12px;
}
.select-dropdown .select-menu button:hover { background: var(--panel-3); }
.select-dropdown .select-menu button.is-active {
  background: rgba(237,100,50,0.14);
  color: var(--brand);
}

/* Verification status pill — colored chip with leading dot, mimics the
   tag/badge style used elsewhere in the panel but anchored to a dropdown. */
.vf-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid currentColor;
  background: transparent;
  font-weight: 600;
  font-size: 13px;
  line-height: 1.2;
  min-height: 32px;
  justify-content: space-between;
}
.vf-status-pill__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.vf-status-pill--red    { color: #d63a3a; }
.vf-status-pill--orange { color: #e08530; }
.vf-status-pill--green  { color: #2aa14f; }

.vf-status-menu .vf-status-option {
  display: flex !important;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  border-radius: 6px;
  margin: 2px 0;
  padding: 8px 10px;
}
.vf-status-option--red    { color: #ff5a5a !important; }
.vf-status-option--orange { color: #ffa64a !important; }
.vf-status-option--green  { color: #4dd86a !important; }
.vf-status-option.is-active { background: rgba(255,255,255,0.06) !important; }
.vf-status-option:hover     { background: rgba(255,255,255,0.04) !important; }

.vf-status-pill--red    { color: #ff5a5a; }
.vf-status-pill--orange { color: #ffa64a; }
.vf-status-pill--green  { color: #4dd86a; }

/* ──────────── Wallet balances panel (sidebar of user-detail page) ──────────
   Renders the user's external on-chain wallet across EVM L1/L2 + TRON,
   summing all native + USDT/USDC into a single USD total. Each row links to
   the chain's explorer for the user's address. */
.user-sidebar-stack { display: flex; flex-direction: column; gap: 18px; position: sticky; top: calc(var(--topbar-h) + 18px); align-self: start; }
.user-sidebar-stack .user-card { position: static; }
/* Inside the macOS window the scroll container is .mac-window-content, whose
   top edge already sits below the window title bar — so the sticky offset must
   be a small gap from THAT scrollport, not the global topbar height. Using
   topbar-h here pushed the rail ~82px down and made it appear to float/jump on
   resize. 14px pins it cleanly to the top of the window content. */
.mac-window-content .user-sidebar-stack { top: 14px; }

/* ===== User rail (identity + stats + meta) ============================== */
.uc-identity {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 15px 15px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(31, 31, 31, .4);
}
.uc-avatar {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), #b8451f);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18);
}
.uc-avatar svg { width: 21px; height: 21px; }
.uc-id-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.uc-login {
  display: inline-flex; align-items: center; align-self: start; max-width: 100%;
  padding: 1px 0;
  font-family: var(--mono); font-size: 13px; font-weight: 700; color: var(--text);
  letter-spacing: -.01em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: color .15s ease;
}
.uc-login:hover { color: var(--brand); }
.uc-domain { font-size: 11px; font-weight: 600; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uc-verif {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 9px; border-radius: 999px;
  font-size: 10px; font-weight: 700; letter-spacing: .02em; white-space: nowrap;
  border: 1px solid currentColor;
}
.uc-verif-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.uc-verif--red    { color: #ff5a5a; background: rgba(255, 90, 90, .1); }
.uc-verif--orange { color: #ffa64a; background: rgba(255, 166, 74, .1); }
.uc-verif--green  { color: #4dd86a; background: rgba(77, 216, 106, .1); }

.uc-stats {
  display: grid;
  /* auto-fit → 2×2 inside the narrow sticky rail, a single 4-across KPI strip
     when the rail spans full width (stacked windows). No hard breakpoint. */
  grid-template-columns: repeat(auto-fit, minmax(min(130px, 100%), 1fr));
  gap: 1px;
  background: var(--line);
  border-bottom: 1px solid var(--line);
}
.uc-stat {
  display: flex; flex-direction: column; gap: 3px;
  padding: 13px 15px;
  background: var(--panel);
}
.uc-stat-val {
  font-family: var(--mono); font-size: 17px; font-weight: 700; line-height: 1.05;
  color: var(--text); font-variant-numeric: tabular-nums;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.uc-stat--primary .uc-stat-val { color: var(--green); }
.uc-stat-key { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted-2); }

.uc-meta { padding: 6px 15px 10px; }
.uc-meta-row {
  display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr);
  align-items: baseline; gap: 12px;
  min-height: 34px; padding: 7px 0;
  border-bottom: 1px solid var(--line);
}
.uc-meta-row:last-child { border-bottom: 0; }
.uc-meta-key { font-size: 11px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.uc-meta-val {
  text-align: right; font-size: 11.5px; font-weight: 600; color: var(--text);
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.uc-meta-link { display: inline-flex; align-items: center; gap: 5px; justify-content: flex-end; color: var(--brand); transition: color .15s ease; }
.uc-meta-link:hover { color: #ff9d5c; }
.uc-meta-link svg { width: 12px; height: 12px; flex-shrink: 0; opacity: .8; }

/* Workspace: keep forms from drifting apart on very wide windows. */
.user-workspace .detail-field { grid-template-columns: minmax(0, 1fr) minmax(160px, 220px); }

/* ----- Window-width responsiveness ------------------------------------- *
 * Driven by the ResizeObserver classes the shell puts on each window frame
 * (.is-narrow ≤980px window, .is-compact ≤760px window) — keyed to the ACTUAL
 * window width, not the viewport. This is why the page reflows when you drag
 * the window edge on a large screen, where viewport @media never fires.       */

/* Narrow/compact window → rail stops being a side column and rides full-width
   on top; it can no longer stick (it would cover the workspace), so unpin it. */
.mac-window-frame.is-narrow .mac-window-content .user-page,
.mac-window-frame.is-compact .mac-window-content .user-page {
  grid-template-columns: 1fr;
}
.mac-window-frame.is-narrow .mac-window-content .user-sidebar-stack,
.mac-window-frame.is-compact .mac-window-content .user-sidebar-stack {
  position: static;
  top: auto;
}

/* Compact window → forms go label-over-input so nothing gets clipped. */
.mac-window-frame.is-compact .mac-window-content .user-workspace .detail-field,
.mac-window-frame.is-compact .mac-window-content .wide-form .detail-field {
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 6px;
}

.wb-panel { overflow: hidden; }
.wb-panel .panel-head { justify-content: space-between; }
.wb-refresh {
  background: transparent; border: 1px solid rgba(255,255,255,0.08); color: #ccc;
  border-radius: 8px; width: 26px; height: 26px; cursor: pointer; font-size: 14px;
  line-height: 1; transition: background 0.15s, color 0.15s, border-color 0.15s;
  margin-left: auto;
}
.wb-refresh:hover { background: rgba(255,255,255,0.06); color: #fff; }
.wb-refresh:disabled { opacity: 0.4; cursor: progress; }
.wb-body { padding: 14px 14px 16px; display: flex; flex-direction: column; gap: 14px; }
.wb-body.is-loading .wb-chain-row { opacity: 0.5; }

.wb-total-row { display: flex; align-items: baseline; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
.wb-total-label { color: #9a9a9a; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
.wb-total-value { font-size: 22px; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }

.wb-addr-block { display: flex; flex-direction: column; gap: 8px; }
.wb-addr-row { display: flex; align-items: center; justify-content: space-between; font-size: 12px; }
.wb-addr-label { color: #9a9a9a; text-transform: uppercase; letter-spacing: 0.06em; }
.wb-addr-link { color: #f08a44; text-decoration: none; font-family: 'SF Mono', Menlo, Consolas, monospace; transition: color 0.15s; }
.wb-addr-link:hover { color: #ff9d5c; text-decoration: underline; }
.wb-addr-missing { color: #6b6b6b; font-style: italic; }
.wb-addr-row--missing .wb-addr-label { color: #6b6b6b; }

.wb-chains { display: flex; flex-direction: column; gap: 2px; }
.wb-chain-row {
  display: grid; grid-template-columns: 1fr minmax(0, 1fr) auto; gap: 10px;
  align-items: center; padding: 9px 10px; border-radius: 8px;
  text-decoration: none; color: inherit;
  transition: background 0.15s, transform 0.15s;
}
a.wb-chain-row:hover { background: rgba(255,255,255,0.04); transform: translateX(2px); }
.wb-chain-label { font-size: 13px; color: #d8d8d8; font-weight: 500; }
.wb-chain-mid { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.wb-item { display: inline-flex; gap: 4px; font-size: 11px; color: #888; font-variant-numeric: tabular-nums; }
.wb-item-sym { color: #6e6e6e; }
.wb-item-amt { color: #b2b2b2; }
.wb-chain-value { font-size: 13px; font-weight: 600; color: #fff; font-variant-numeric: tabular-nums; text-align: right; min-width: 60px; }
.wb-chain-row--err .wb-chain-value { color: #666; }

.wb-skeleton { position: relative; overflow: hidden; }
.wb-skeleton::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.04), transparent);
  animation: wbShimmer 1.4s linear infinite;
}
@keyframes wbShimmer { from { transform: translateX(-100%) } to { transform: translateX(100%) } }
@media (prefers-reduced-motion: reduce) { .wb-skeleton::after { animation: none; } }

@media (max-width: 980px) {
  .user-sidebar-stack { position: static; }
}

/* ===== API KEYS PAGE =================================================== */
.api-page { padding: 24px 24px 40px; animation: pageIn .2s ease-out both; }
.api-page .page-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding-bottom: 18px; border-bottom: 1px solid #1e1e1e; margin-bottom: 18px; flex-wrap: wrap; }
.api-page .page-intro .eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #666; margin-bottom: 8px; }
.api-page .page-intro .eyebrow svg { width: 14px; height: 14px; color: var(--brand); }
.api-page .page-intro h1 { font-size: 22px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; margin-bottom: 6px; color: #f0f0f0; }
.api-page .page-intro p { font-size: 12px; color: #888; font-weight: 500; max-width: 540px; line-height: 1.55; }
.api-page .page-intro .btn { flex-shrink: 0; }
.api-page > .panel { margin-bottom: 18px; padding: 18px 20px; }

.api-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.api-section-head .label { display: block; font-size: 14px; font-weight: 700; color: #ececec; margin-bottom: 3px; }
.api-section-head .hint { display: block; font-size: 11px; color: #707070; max-width: 600px; line-height: 1.45; }

.api-keys-table th { background: #161616; }
.api-keys-table td { font-size: 12px; }
.api-keys-table .mono-value { font-family: ui-monospace, 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums; color: #d8d8d8; }
.api-key-row.is-revoked td, .api-key-row.is-expired td { opacity: .5; }
.api-key-row.is-revoked .mono-value { text-decoration: line-through; }

.api-status-pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; line-height: 1.6; }
.api-status-pill.is-active { background: rgba(34, 197, 94, 0.14); color: #4ade80; }
.api-status-pill.is-revoked { background: rgba(239, 68, 68, 0.14); color: #f87171; }
.api-status-pill.is-expired { background: rgba(234, 179, 8, 0.14); color: #facc15; }

.api-sa-badge { display: inline-block; background: rgba(237, 100, 50, .14); color: var(--brand); font-size: 9px; font-weight: 800; letter-spacing: .08em; padding: 2px 6px; border-radius: 4px; vertical-align: middle; margin-left: 6px; text-transform: uppercase; }
.api-sa-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.api-sa-controls .select { min-width: 240px; }

.api-docs details { border: 1px solid #1e1e1e; border-radius: 9px; margin-bottom: 10px; padding: 14px 16px; background: rgba(20, 20, 20, .35); transition: border-color .15s ease; }
.api-docs details[open] { border-color: #2a2a2a; background: rgba(24, 24, 24, .55); }
.api-docs summary { cursor: pointer; font-size: 13px; font-weight: 700; color: #e0e0e0; list-style: none; outline: none; user-select: none; }
.api-docs summary::-webkit-details-marker { display: none; }
.api-docs summary::before { content: '›'; display: inline-block; margin-right: 9px; transition: transform .18s ease; color: #888; font-size: 14px; }
.api-docs details[open] summary::before { transform: rotate(90deg); }
.api-docs summary:hover { color: #fff; }
.api-docs p { font-size: 12px; color: #b8b8b8; margin: 10px 0; line-height: 1.6; }
.api-docs pre { background: #0c0c0c; border: 1px solid #1e1e1e; border-radius: 6px; padding: 10px 12px; overflow-x: auto; margin: 10px 0; font-size: 11px; line-height: 1.55; color: #ccc; }
.api-docs code { font-family: ui-monospace, 'JetBrains Mono', monospace; font-size: 11px; color: #e9b66e; }
.api-docs pre code { color: #ccc; }
.api-docs ul { padding-left: 20px; font-size: 12px; color: #b8b8b8; line-height: 1.7; }
.api-docs ul li { margin: 4px 0; }

.api-endpoints { margin-top: 8px; }
.api-method { display: inline-block; min-width: 50px; text-align: center; padding: 2px 8px; border-radius: 4px; font-family: ui-monospace, 'JetBrains Mono', monospace; font-size: 10px; font-weight: 700; letter-spacing: .03em; }
.api-method.is-get    { background: rgba(96, 165, 250, .14); color: #93c5fd; }
.api-method.is-post   { background: rgba(34, 197, 94, .14); color: #86efac; }
.api-method.is-put    { background: rgba(250, 204, 21, .14); color: #fde047; }
.api-method.is-patch  { background: rgba(168, 85, 247, .14); color: #c4b5fd; }
.api-method.is-delete { background: rgba(239, 68, 68, .14); color: #fca5a5; }

/* ── Modals shared shell ─────────────────────────────────────────────── */
.api-modal { position: fixed; inset: 0; z-index: 9000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.api-modal[hidden] { display: none; }
.api-modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .62); backdrop-filter: blur(4px); }
.api-modal-card { position: relative; width: min(96vw, 480px); background: #161616; border: 1px solid #2a2a2a; border-radius: 12px; box-shadow: 0 30px 80px rgba(0,0,0,.55); display: flex; flex-direction: column; max-height: 92vh; overflow: hidden; }
.api-modal-card header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid #222; font-size: 14px; }
.api-modal-card header strong { font-weight: 700; }
.api-modal-card header .icon-btn { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 6px; color: #aaa; }
.api-modal-card header .icon-btn:hover { background: #1f1f1f; color: #fff; }
.api-modal-body { padding: 18px; overflow-y: auto; flex: 1; }
.api-modal-body p { font-size: 12px; color: #c0c0c0; line-height: 1.55; margin: 0 0 12px; }
.api-modal-body p:last-child { margin-bottom: 0; }
.api-modal-target { font-family: ui-monospace, 'JetBrains Mono', monospace; font-size: 12px; padding: 8px 12px; background: #0d0d0d; border: 1px solid #232323; border-radius: 6px; color: #ed9472; word-break: break-all; }
.api-modal-card footer { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 14px 18px; border-top: 1px solid #222; background: #131313; }
.api-modal-card .btn-dark { background: #1d1d1d; color: #d0d0d0; border: 1px solid #2a2a2a; }
.api-modal-card .btn-dark:hover { background: #232323; color: #fff; }
.api-btn-danger { background: #b91c1c !important; color: #fff !important; }
.api-btn-danger:hover { background: #dc2626 !important; }

/* ── One-time-token modal ────────────────────────────────────────────── */
.api-modal-plaintext { width: min(96vw, 560px); }
.api-warning { background: rgba(234, 88, 12, 0.12); border: 1px solid rgba(234, 88, 12, 0.35); padding: 12px 14px; border-radius: 8px; color: #fdba74; font-size: 12px; line-height: 1.6; margin: 0 0 14px; }
.api-warning strong { color: #fff; }
.api-token-display { display: flex; gap: 8px; margin-bottom: 14px; }
.api-token-display .input { flex: 1; font-family: ui-monospace, 'JetBrains Mono', monospace; font-size: 12px; height: 38px; background: #0c0c0c; color: #fff; border-color: #ed6432; letter-spacing: .02em; }
.api-token-display .btn { flex-shrink: 0; height: 38px; min-width: 130px; }
.api-token-display .btn.is-copied { background: #4ade80; }
.api-plaintext-meta { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: #888; padding-top: 10px; border-top: 1px solid #1e1e1e; }
.api-plaintext-meta .hint { display: block; font-size: 11px; }
.api-plaintext-meta .mono-value { color: #d8d8d8; font-family: ui-monospace, 'JetBrains Mono', monospace; }

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 760px) {
  .api-page { padding: 16px 14px 32px; }
  .api-page .page-intro { flex-direction: column; align-items: flex-start; }
  .api-page .page-intro .btn { width: 100%; }
  .api-sa-controls { width: 100%; flex-direction: column; align-items: stretch; }
  .api-sa-controls .select { min-width: 0; width: 100%; }
  .api-keys-table { font-size: 11px; }
  .api-keys-table th, .api-keys-table td { padding: 0 8px; height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .api-page { animation: none; }
  .api-docs summary::before { transition: none; }
}

/* ===== MATERIALS PAGE (markdown viewer) ================================ */
.materials-page { padding: 24px 24px 40px; animation: pageIn .2s ease-out both; }
.materials-intro { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding-bottom: 18px; border-bottom: 1px solid #1e1e1e; margin-bottom: 18px; flex-wrap: wrap; }
.materials-intro .eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #666; margin-bottom: 8px; }
.materials-intro .eyebrow svg { width: 14px; height: 14px; color: var(--brand); }
.materials-intro h1 { font-size: 22px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; margin-bottom: 6px; color: #f0f0f0; }
.materials-intro h1 + p { font-size: 12px; color: #888; font-weight: 500; max-width: 540px; line-height: 1.55; margin-bottom: 10px; }

.materials-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.materials-chip { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-family: ui-monospace, 'JetBrains Mono', monospace; font-size: 10px; font-weight: 600; color: #aaa; background: rgba(255,255,255,.04); border: 1px solid #232323; letter-spacing: .02em; }

.materials-actions { display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; align-items: stretch; min-width: 220px; }
.materials-actions .btn { justify-content: center; }
.materials-actions a.btn { text-decoration: none; }
.materials-actions .btn.is-copied { background: #4ade80; color: #fff; }

.materials-doc-panel { padding: 0; overflow: hidden; }
.materials-doc { padding: 28px 32px; color: #cfcfcf; line-height: 1.65; font-size: 13.5px; }

/* Headings */
.materials-doc h1 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; color: #fff; margin: 0 0 18px; padding-bottom: 12px; border-bottom: 1px solid #232323; line-height: 1.2; }
.materials-doc h2 { font-size: 19px; font-weight: 700; letter-spacing: -.01em; color: #f0f0f0; margin: 32px 0 14px; line-height: 1.25; }
.materials-doc h3 { font-size: 15px; font-weight: 700; color: #ed9472; margin: 24px 0 10px; font-family: ui-monospace, 'JetBrains Mono', monospace; letter-spacing: 0; }
.materials-doc h4 { font-size: 13px; font-weight: 700; color: #d0d0d0; margin: 18px 0 8px; text-transform: uppercase; letter-spacing: .04em; }

.materials-doc h1::before, .materials-doc h2::before {
  content: ''; display: inline-block; width: 3px; height: 16px; background: var(--brand); margin-right: 10px; vertical-align: middle; border-radius: 2px;
}
.materials-doc h1::before { height: 22px; }

/* Paragraphs and inline */
.materials-doc p { margin: 0 0 12px; color: #b8b8b8; }
.materials-doc p:last-child { margin-bottom: 0; }
.materials-doc strong { color: #fff; font-weight: 700; }
.materials-doc em { font-style: italic; color: #d0d0d0; }
.materials-doc a { color: var(--brand); text-decoration: none; border-bottom: 1px dashed rgba(237,100,50,.45); transition: color .12s, border-color .12s; }
.materials-doc a:hover { color: #fff; border-bottom-color: #fff; }

/* Inline code */
.materials-doc code { font-family: ui-monospace, 'JetBrains Mono', monospace; font-size: 12px; background: rgba(237,100,50,.10); color: #ed9472; padding: 1px 6px; border-radius: 4px; border: 1px solid rgba(237,100,50,.18); }
.materials-doc h3 code { background: transparent; color: #ed9472; padding: 0; border: 0; }

/* Code blocks */
.materials-doc .md-codeblock { margin: 14px 0 18px; border: 1px solid #1e1e1e; border-radius: 9px; background: #0a0a0a; overflow: hidden; }
.materials-doc .md-codeblock-head { display: flex; align-items: center; justify-content: space-between; height: 30px; padding: 0 12px; background: #121212; border-bottom: 1px solid #1e1e1e; }
.materials-doc .md-codeblock-lang { font-family: ui-monospace, 'JetBrains Mono', monospace; font-size: 10px; color: #888; letter-spacing: .04em; text-transform: uppercase; }
.materials-doc .md-codeblock-copy { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 5px; color: #888; transition: color .14s, background .14s; }
.materials-doc .md-codeblock-copy svg { width: 13px; height: 13px; }
.materials-doc .md-codeblock-copy:hover { color: #fff; background: #1f1f1f; }
.materials-doc .md-codeblock-copy.is-copied { color: #4ade80; }
.materials-doc .md-codeblock pre { margin: 0; padding: 12px 14px; overflow-x: auto; font-size: 12px; line-height: 1.6; color: #ddd; }
.materials-doc .md-codeblock code { background: transparent; border: 0; padding: 0; color: inherit; font-size: 12px; }

/* Lists */
.materials-doc ul, .materials-doc ol { margin: 0 0 14px; padding-left: 22px; color: #b8b8b8; }
.materials-doc li { margin: 4px 0; }
.materials-doc ul li { list-style: disc; }
.materials-doc ol li { list-style: decimal; }
.materials-doc li > code:only-child { font-weight: 600; }

/* Blockquote */
.materials-doc blockquote { margin: 14px 0; padding: 10px 16px; border-left: 3px solid var(--brand); background: rgba(237,100,50,.05); color: #d0d0d0; border-radius: 0 6px 6px 0; font-style: italic; }
.materials-doc blockquote p { margin: 0; }

/* Hr */
.materials-doc hr { border: 0; border-top: 1px solid #1e1e1e; margin: 28px 0; }

/* Tables (markdown) */
.materials-doc .md-table-wrap { overflow-x: auto; margin: 14px 0 18px; border: 1px solid #1e1e1e; border-radius: 8px; }
.materials-doc .md-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.materials-doc .md-table th { padding: 10px 12px; background: #141414; text-align: left; font-size: 10px; font-weight: 700; color: #d0d0d0; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid #1e1e1e; }
.materials-doc .md-table td { padding: 10px 12px; color: #b8b8b8; border-bottom: 1px solid #1a1a1a; vertical-align: top; }
.materials-doc .md-table tr:last-child td { border-bottom: 0; }
.materials-doc .md-table tr:hover td { background: rgba(255,255,255,.015); }
.materials-doc .md-table code { font-size: 11px; }

/* Endpoint highlights (lines like `GET /path`) */
.materials-doc h3 code { color: #ed9472; }

/* Responsive */
@media (max-width: 760px) {
  .materials-page { padding: 16px 14px 32px; }
  .materials-intro { flex-direction: column; }
  .materials-actions { width: 100%; min-width: 0; }
  .materials-doc { padding: 18px 18px; font-size: 13px; }
  .materials-doc h1 { font-size: 20px; }
  .materials-doc h2 { font-size: 17px; }
  .materials-doc .md-codeblock pre { font-size: 11px; }
  .materials-doc .md-table { font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  .materials-page { animation: none; }
}

/* ===== MATERIALS — TABS ================================================ */
.materials-page .materials-tabs { display: flex; align-items: center; gap: 6px; padding: 0 0 16px; border-bottom: 1px solid #1e1e1e; margin-bottom: 18px; flex-wrap: wrap; }
.materials-page .materials-tab { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 9px; background: rgba(255,255,255,.02); border: 1px solid #232323; color: #9d9d9d; font-size: 12px; font-weight: 600; letter-spacing: -.005em; transition: background .14s, border-color .14s, color .14s, transform .12s; cursor: pointer; }
.materials-page .materials-tab svg { width: 14px; height: 14px; color: #707070; transition: color .14s; }
.materials-page .materials-tab:hover { background: rgba(255,255,255,.04); border-color: #2e2e2e; color: #e0e0e0; }
.materials-page .materials-tab:hover svg { color: #d0d0d0; }
.materials-page .materials-tab.is-active { background: rgba(237,100,50,.10); border-color: rgba(237,100,50,.42); color: #fff; }
.materials-page .materials-tab.is-active svg { color: var(--brand); }
.materials-page .materials-tab:focus-visible { outline: none; box-shadow: 0 0 0 2px rgba(237,100,50,.35); }
.materials-page .materials-tabs-single .materials-tab { cursor: default; }
.materials-page .materials-tab-hint { display: inline-flex; align-items: center; padding-left: 4px; color: #555; font-size: 11px; font-style: italic; }

/* Intro inside tabbed page — no eyebrow, tab acts as the eyebrow */
.materials-page .materials-intro { padding-bottom: 18px; border-bottom: 1px solid #1e1e1e; margin-bottom: 18px; }
.materials-page .materials-intro-text { min-width: 0; }
.materials-page .materials-intro h1 { font-size: 22px; }

/* Mobile: vertical tab stack */
@media (max-width: 760px) {
  .materials-page .materials-tabs { padding-bottom: 12px; margin-bottom: 14px; }
  .materials-page .materials-tab { width: 100%; justify-content: flex-start; }
  .materials-page .materials-tab-hint { display: none; }
}

/* ===== TOAST STACK ====================================================== */
.toast-stack { position: fixed; top: 18px; right: 18px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; max-width: calc(100vw - 36px); pointer-events: none; }
.toast { pointer-events: auto; min-width: 280px; max-width: 360px; background: #161616; border: 1px solid #252525; border-radius: 10px; box-shadow: 0 18px 48px rgba(0,0,0,.55); opacity: 0; transform: translateX(20px); transition: opacity .18s ease, transform .18s ease; overflow: hidden; }
.toast.is-shown   { opacity: 1; transform: translateX(0); }
.toast.is-leaving { opacity: 0; transform: translateX(20px); }
.toast-row { display: flex; align-items: flex-start; gap: 10px; padding: 12px 12px 12px 16px; position: relative; }
.toast-row::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }
.toast-text { flex: 1; min-width: 0; }
.toast-title { font-size: 13px; font-weight: 700; color: #f0f0f0; line-height: 1.35; word-wrap: break-word; }
.toast-body { font-size: 12px; color: #aeaeae; line-height: 1.5; margin-top: 4px; white-space: pre-wrap; word-wrap: break-word; }
.toast-close { flex-shrink: 0; width: 22px; height: 22px; display: inline-grid; place-items: center; border-radius: 5px; color: #777; transition: color .14s, background .14s; }
.toast-close svg { width: 12px; height: 12px; }
.toast-close:hover { color: #fff; background: #1f1f1f; }

.toast-success::before { background: #4ade80; }
.toast-success .toast-title { color: #bcf3c9; }
.toast-error::before   { background: #f87171; }
.toast-error .toast-title   { color: #fecaca; }
.toast-warn::before    { background: #facc15; }
.toast-warn .toast-title    { color: #fde68a; }
.toast-info::before    { background: #60a5fa; }
.toast-info .toast-title    { color: #c3ddfd; }

@media (prefers-reduced-motion: reduce) {
  .toast { transition: opacity .12s ease; transform: none; }
  .toast.is-shown, .toast.is-leaving { transform: none; }
}

@media (max-width: 760px) {
  .toast-stack { top: 10px; right: 10px; left: 10px; max-width: none; }
  .toast { min-width: 0; max-width: none; }
}

/* confirm modal uses .api-modal skin already defined */
.confirm-modal .api-modal-card { width: min(96vw, 440px); }

/* ============================================================
 * Phase 3 — auto-payout admin pages
 * ============================================================ */

/* Generic helpers used across all new pages */
.payout-destinations-page .page-actions,
.payout-master-page .page-actions,
.sweep-monitor-page .page-actions,
.sweep-audit-page .page-actions { display: flex; gap: 10px; }

.addr-mono {
  font-family: 'SF Mono', 'Menlo', 'Monaco', monospace;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.muted { color: #a0a0a0; opacity: 0.85; }

.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 600; line-height: 1.4;
  background: rgba(120,120,128,0.16); color: #c8c8c8;
}
.status-pill svg { width: 13px; height: 13px; }
.status-pill--ok     { background: rgba(74,222,128,0.18); color: #b6f0c1; }
.status-pill--muted  { background: rgba(160,160,160,0.18); color: #c0c0c0; }
.status-pill--info   { background: rgba(96,165,250,0.18); color: #c0d8ff; }
.status-pill--warn   { background: rgba(250,204,21,0.18); color: #fde8a4; }
.status-pill--danger { background: rgba(248,113,113,0.18); color: #fec8c8; }

.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.row-actions .btn-sm { padding: 4px 9px; font-size: 12px; }
.row-actions svg { width: 12px; height: 12px; }

.btn-link {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: none; color: #8fb6ff;
  font-size: 12px; cursor: pointer; padding: 2px 0;
}
.btn-link:hover { color: #fff; }
.btn-link svg { width: 12px; height: 12px; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 24px; height: 24px; border-radius: 6px;
  border: none; background: transparent; color: #b0b0b0;
  cursor: pointer; transition: background .14s, color .14s;
}
.icon-btn:hover { background: rgba(255,255,255,0.08); color: #fff; }
.icon-btn svg { width: 14px; height: 14px; }

/* ─── TOTP enroll page ─── */
.totp-page .totp-state-card {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; padding: 18px 20px;
  background: rgba(255,255,255,0.04);
  border-radius: 14px;
}
.totp-state-card--ok { background: rgba(74,222,128,0.08); border: 1px solid rgba(74,222,128,0.18); }
.totp-state-head strong { display: block; font-size: 14px; color: #fff; }
.totp-state-head small  { display: block; margin-top: 4px; font-size: 12px; color: #aeaeae; }
.totp-state-actions .btn svg { width: 14px; height: 14px; }

.totp-info-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 14px;
}
.totp-info-card {
  padding: 14px 16px; border-radius: 12px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.05);
}
.totp-info-card strong { display: block; font-size: 13px; color: #f0f0f0; margin-bottom: 4px; }
.totp-info-card p { font-size: 12px; color: #aeaeae; line-height: 1.55; margin: 0; }

.totp-enroll-card {
  display: flex; flex-direction: column; gap: 18px;
  padding: 22px; border-radius: 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}
.totp-enroll-step { display: flex; gap: 14px; align-items: flex-start; }
.totp-enroll-num {
  flex-shrink: 0;
  width: 28px; height: 28px;
  border-radius: 50%; background: rgba(96,165,250,0.18);
  display: grid; place-items: center;
  font-size: 13px; font-weight: 700; color: #c0d8ff;
}
.totp-enroll-step strong { display: block; color: #f0f0f0; font-size: 13px; }
.totp-enroll-step p { margin: 4px 0 0; color: #aeaeae; font-size: 12px; }

.totp-qr-wrap {
  display: flex; gap: 22px; align-items: center; flex-wrap: wrap;
  padding: 16px; border-radius: 12px;
  background: #fff; color: #111;
}
.totp-qr { display: block; width: 208px; height: 208px; image-rendering: pixelated; }
.totp-secret-block { display: flex; flex-direction: column; gap: 6px; }
.totp-secret-block small { font-size: 11px; color: #555; text-transform: uppercase; letter-spacing: 0.06em; }
.totp-secret-code {
  display: inline-block; padding: 8px 12px; border-radius: 8px;
  background: #f4f4f6; color: #111; font-family: 'SF Mono', monospace;
  font-size: 13px; letter-spacing: 0.05em; word-break: break-all;
}
.totp-secret-block .btn-link { color: #2a6fc7; }
.totp-secret-block .btn-link:hover { color: #111; }

.totp-confirm-form {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.totp-confirm-form input[type="text"] {
  width: 168px; padding: 10px 12px;
  font-family: 'SF Mono', monospace;
  font-size: 22px; letter-spacing: 0.32em;
  font-variant-numeric: tabular-nums;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  color: #fff;
  text-align: center;
}
.totp-confirm-error { color: #f87171; font-size: 12px; min-height: 18px; }

/* ─── Payout destinations / master / commissions tables ─── */
.payout-filters,
.sweep-filters,
.audit-controls {
  display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap;
  padding: 4px 0 4px;
}
.payout-filters label,
.sweep-filters label,
.audit-controls label {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 12px; color: #aeaeae;
}
.payout-filters label.toggle-row {
  flex-direction: row; align-items: center; gap: 8px;
}
.payout-filters .select,
.sweep-filters .select,
.audit-controls .select,
.sweep-filters .input {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px; padding: 6px 10px;
  color: #f0f0f0; font-size: 13px; min-width: 180px;
}

.payout-table tr.is-muted td { opacity: 0.55; }
.payout-table .addr-mono,
.master-table .addr-mono,
.audit-table .addr-mono,
.sweep-table .addr-mono { max-width: 320px; display: inline-block; vertical-align: middle; word-break: break-all; }

/* ─── Modal extensions (use existing .api-modal skin) ─── */
.api-modal.payout-modal .api-modal-card { width: min(96vw, 540px); }
.api-modal.sweep-details-modal .api-modal-card { width: min(96vw, 680px); max-height: 80vh; overflow: auto; }
.api-modal .modal-field {
  display: flex; flex-direction: column; gap: 6px;
  margin-bottom: 14px;
}
.api-modal .modal-field > span { font-size: 12px; color: #aeaeae; }
.api-modal .modal-field .input,
.api-modal .modal-field .select {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px; padding: 8px 12px;
  color: #f0f0f0; font-size: 13px;
}
.api-modal .modal-field .addr-input {
  font-family: 'SF Mono', monospace; letter-spacing: -0.01em; font-size: 12px;
}
.api-modal .modal-warning {
  margin-top: 12px; padding: 12px 14px;
  background: rgba(250,204,21,0.08);
  border: 1px solid rgba(250,204,21,0.18);
  border-radius: 10px;
  font-size: 12px; color: #f7e7a2; line-height: 1.55;
}
.api-modal .modal-warning strong { color: #ffeb91; }

/* Worker-scoped payout-destinations page: the worker_id is implicit, so the
   modal hides the worker select entirely. .is-locked-worker collapses the
   wrapper out of the layout while leaving the <select> in the DOM so the
   form-collection code stays uniform. */
.api-modal .modal-field.is-locked-worker {
  display: none;
}

/* Helper copy under the hero on the worker view. Slightly tighter than the
   default page-intro paragraph: this is utilitarian instruction, not pitch. */
.payout-destinations-page .payout-worker-helper {
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  line-height: 1.55;
}

/* TOTP prompt modal (reused everywhere) */
.totp-modal .totp-modal-card { width: min(96vw, 420px); }
.totp-modal .totp-hint { font-size: 12px; color: #aeaeae; margin-bottom: 12px; line-height: 1.5; }
.totp-modal input[data-totp-input] {
  display: block; width: 100%; max-width: 240px; margin: 0 auto;
  padding: 12px; text-align: center;
  font-family: 'SF Mono', monospace;
  font-size: 24px; letter-spacing: 0.32em;
  font-variant-numeric: tabular-nums;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 10px;
  color: #fff;
}
.totp-modal input[data-totp-input]:focus-visible {
  border-color: rgba(96,165,250,0.72); outline: none;
  box-shadow: 0 0 0 3px rgba(96,165,250,0.18);
}
.totp-modal .totp-error { margin-top: 10px; color: #f87171; font-size: 12px; min-height: 16px; text-align: center; }
.totp-modal .sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ─── Master destinations table ─── */
.master-addr-cell { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.master-addr-cell .addr-input {
  flex: 1 1 auto; min-width: 240px; padding: 6px 10px;
  font-family: 'SF Mono', monospace; font-size: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(96,165,250,0.36);
  border-radius: 8px; color: #f0f0f0;
}
.master-tips {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 8px;
}
.master-tips article {
  padding: 14px 16px; border-radius: 12px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.05);
}
.master-tips strong { display: flex; align-items: center; gap: 6px; color: #f0f0f0; margin-bottom: 4px; font-size: 13px; }
.master-tips strong svg { width: 13px; height: 13px; opacity: 0.8; }
.master-tips p { margin: 0; font-size: 12px; color: #aeaeae; line-height: 1.55; }

/* ─── Worker commissions ─── */
.commissions-table .commission-cell { white-space: nowrap; }
.commissions-table .commission-display strong,
.commissions-table .commission-admin strong { font-variant-numeric: tabular-nums; font-size: 15px; color: #f0f0f0; }
.commissions-table .commission-admin { color: #aeaeae; }
.commissions-table .commission-input {
  width: 88px; padding: 6px 8px; font-size: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(96,165,250,0.36);
  border-radius: 8px; color: #f0f0f0;
  font-variant-numeric: tabular-nums;
}

.commissions-default-card { display: flex; flex-direction: column; gap: 14px; }
.commissions-default-head h2 { font-size: 16px; margin: 0 0 4px; color: #f0f0f0; }
.commissions-default-head .muted { font-size: 12px; color: #aeaeae; margin: 0; line-height: 1.5; }
.commissions-default-row {
  display: flex; align-items: end; gap: 18px; flex-wrap: wrap;
}
.commissions-default-field { display: flex; flex-direction: column; gap: 6px; }
.commissions-default-field span { font-size: 11px; color: #aeaeae; text-transform: uppercase; letter-spacing: 0.06em; }
.commissions-default-input {
  width: 120px; padding: 8px 10px; font-size: 15px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(96,165,250,0.36);
  border-radius: 8px; color: #f0f0f0;
  font-family: 'Space Mono', monospace;
  font-variant-numeric: tabular-nums;
}
.commissions-default-derived { display: flex; flex-direction: column; gap: 6px; min-width: 64px; }
.commissions-default-derived span { font-size: 11px; color: #aeaeae; text-transform: uppercase; letter-spacing: 0.06em; }
.commissions-default-derived strong {
  font-family: 'Space Mono', monospace;
  font-variant-numeric: tabular-nums;
  font-size: 18px;
  color: #f0f0f0;
  letter-spacing: -0.01em;
}
.commissions-default-derived--muted strong { color: #aeaeae; font-size: 15px; }
.worker-commissions-page .page-intro [data-intro-default] {
  font-family: 'Space Mono', monospace;
  font-variant-numeric: tabular-nums;
  color: #f0f0f0;
}

/* ─── Sweep monitor ─── */
.sweep-status-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.status-card {
  padding: 16px 18px; border-radius: 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  display: flex; flex-direction: column; gap: 6px;
}
.status-card--ok     { background: rgba(74,222,128,0.07); border-color: rgba(74,222,128,0.18); }
.status-card--danger { background: rgba(248,113,113,0.07); border-color: rgba(248,113,113,0.18); }
.status-card-label { font-size: 10px; color: #aeaeae; text-transform: uppercase; letter-spacing: 0.08em; }
.status-card strong { font-size: 14px; color: #f0f0f0; }
.status-card small { font-size: 11px; color: #aeaeae; line-height: 1.5; }

.sweep-counts-head { margin-bottom: 12px; display: flex; align-items: baseline; gap: 12px; }
.sweep-counts-head strong { font-size: 13px; color: #f0f0f0; }
.sweep-counts-grid {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}
.count-card {
  padding: 12px 14px; border-radius: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}
.count-card small { display: block; font-size: 11px; color: #aeaeae; margin-bottom: 4px; }
.count-card strong { font-size: 20px; font-variant-numeric: tabular-nums; color: #f0f0f0; }
.count-card--ok     { background: rgba(74,222,128,0.08); }
.count-card--danger { background: rgba(248,113,113,0.08); }
.count-card--warn   { background: rgba(250,204,21,0.08); }
.count-card--info   { background: rgba(96,165,250,0.08); }

.sweep-table tr[data-action="open-details"] { cursor: pointer; transition: background .14s; }
.sweep-table tr[data-action="open-details"]:hover { background: rgba(255,255,255,0.04); }

.pagination-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 12px; gap: 10px;
}

.kv { display: grid; gap: 8px; }
.kv > div { display: grid; grid-template-columns: 180px 1fr; gap: 14px; align-items: baseline; }
.kv dt { font-size: 11px; color: #aeaeae; text-transform: uppercase; letter-spacing: 0.06em; }
.kv dd { margin: 0; font-size: 13px; color: #f0f0f0; word-break: break-all; }

.code-block {
  padding: 12px; border-radius: 8px;
  background: rgba(0,0,0,0.32);
  font-family: 'SF Mono', monospace;
  font-size: 11px; color: #c0c0c0;
  white-space: pre-wrap; word-break: break-all;
  max-height: 260px; overflow: auto;
}

@media (max-width: 760px) {
  .kv > div { grid-template-columns: 1fr; gap: 2px; }
  .sweep-status-grid,
  .totp-info-grid,
  .master-tips { grid-template-columns: 1fr; }
  .totp-qr { width: 168px; height: 168px; }
}

/* ─── Payout destinations — card-list UI ──────────────────────────────────
   One card per supported network. Replaces the old table-with-modal flow:
   editing happens inline in the row's monospace input; the save/revert
   buttons surface only on dirty state. The history of rotated-out rows
   lives in a collapsible <details> below the card grid. */

.pd-worker-selector {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 14px;
}
.pd-worker-selector label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.pd-worker-selector .select {
  min-width: 220px;
}

.pd-card-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 920px;
}

.pd-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 24px;
  padding: 16px 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: border-color .15s ease, background .15s ease;
}
.pd-card:hover {
  border-color: var(--line-2);
}
.pd-card[data-dirty="true"] {
  border-color: rgba(237, 100, 50, 0.45);
  border-left: 2px solid var(--brand);
  background: linear-gradient(180deg, rgba(237, 100, 50, 0.04), transparent 60%) var(--panel);
  padding-left: 19px; /* compensate for the +1px left-border */
}
.pd-card[data-invalid="true"] {
  border-color: rgba(248, 113, 113, 0.55);
  border-left-color: #f87171;
}
.pd-card.is-busy {
  opacity: 0.72;
  pointer-events: none;
}

.pd-card-meta {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pd-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.pd-coin-icon {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-family: var(--font);
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
  letter-spacing: 0;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
  user-select: none;
}

.pd-coin-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.pd-coin-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--panel-3);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

.pd-card-helper {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.5;
}

.pd-card-input-wrap {
  flex: 0 1 360px;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pd-card-input {
  position: relative;
  display: flex;
  align-items: center;
  background: #0c0c0c;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 0 4px 0 12px;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.pd-card-input:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(237, 100, 50, 0.12);
  background: #0a0a0a;
}
.pd-card[data-invalid="true"] .pd-card-input {
  border-color: rgba(248, 113, 113, 0.55);
}
.pd-card[data-invalid="true"] .pd-card-input:focus-within {
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.15);
}

/* Dirty-indicator dot — left of the input, becomes visible on data-dirty="true". */
.pd-dirty-dot {
  flex: 0 0 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
  margin-right: 8px;
  margin-left: -4px;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity .15s ease, transform .15s ease;
}
.pd-card[data-dirty="true"] .pd-dirty-dot {
  opacity: 1;
  transform: scale(1);
}
.pd-card[data-invalid="true"] .pd-dirty-dot {
  background: #f87171;
}

.pd-address-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 38px;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--text);
  font-family: var(--mono), 'SF Mono', monospace;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
}
.pd-address-input::placeholder {
  color: var(--muted-2);
  font-family: var(--font);
  font-size: 12px;
  letter-spacing: 0;
}

.pd-card-status {
  min-height: 16px;
  padding: 0 4px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--muted);
}
.pd-card-status--ok      { color: var(--green); }
.pd-card-status--error   { color: #f87171; }
.pd-card-status--pending { color: var(--brand); }

/* History (rotated-out rows) */
.pd-history {
  margin-top: 18px;
  padding: 14px 18px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.pd-history > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  user-select: none;
}
.pd-history > summary::-webkit-details-marker { display: none; }
.pd-history > summary::before {
  content: '';
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid currentColor;
  transition: transform .15s ease;
  flex: 0 0 auto;
  margin-right: 4px;
}
.pd-history[open] > summary::before { transform: rotate(-90deg); }
.pd-history > summary small {
  background: var(--panel-3);
  color: var(--muted);
  padding: 1px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
}
.pd-history > .table { margin-top: 14px; }

.pd-history-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.5;
}

/* ──────────────────────────────────────────────────────────────────────────
   Sticky action bar — appears at the bottom of the page whenever there's at
   least one dirty card. Single Save / Cancel pair gates the whole batch
   through ONE TOTP prompt instead of per-card.
   ────────────────────────────────────────────────────────────────────────── */

.pd-action-bar {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  margin: 24px -20px 0;       /* bleed into the page padding so the bar spans full width */
  padding: 0 20px;
  z-index: 30;
  pointer-events: none;
  transform: translateY(100%);
  opacity: 0;
  transition: transform .22s cubic-bezier(0.4, 0, 0.2, 1), opacity .18s ease;
}
.pd-action-bar[data-visible="true"] {
  pointer-events: auto;
  transform: translateY(0);
  opacity: 1;
}
.pd-action-bar-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.32), 0 0 0 1px rgba(255,255,255,0.02);
  margin-bottom: 16px;
}
.pd-action-bar-counter {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
  letter-spacing: -0.005em;
  font-variant-numeric: tabular-nums;
}
.pd-action-bar-counter-num {
  color: var(--brand);
  font-size: 15px;
  font-weight: 700;
}
.pd-action-bar-counter-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
}
.pd-action-bar-spacer { flex: 1 1 auto; }
.pd-action-bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pd-action-btn-cancel,
.pd-action-btn-save {
  height: 36px;
  padding: 0 16px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.005em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--text);
  transition: background .15s ease, border-color .15s ease, color .15s ease, opacity .15s ease;
}
.pd-action-btn-cancel:hover {
  background: var(--panel-3);
  border-color: var(--line-2);
  color: var(--text);
}
.pd-action-btn-save {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  box-shadow: 0 1px 0 rgba(255,255,255,0.06) inset, 0 4px 14px rgba(237,100,50,0.32);
}
.pd-action-btn-save svg { width: 14px; height: 14px; stroke: currentColor; }
.pd-action-btn-save:hover:not(:disabled) {
  background: #f57544;
  border-color: #f57544;
}
.pd-action-btn-save:disabled {
  background: var(--panel-3);
  border-color: var(--line);
  color: var(--muted-2);
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.85;
}
.pd-action-btn-save[data-invalid="true"] {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.36);
  color: #f87171;
}
.pd-action-bar[data-busy="true"] .pd-action-bar-inner { opacity: 0.72; }

/* Responsive: collapse meta/input to a column on small viewports */
@media (max-width: 760px) {
  .pd-card {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 14px;
  }
  .pd-card-input-wrap {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
  }
  .pd-card-helper {
    font-size: 11.5px;
  }
  .pd-action-bar {
    margin: 18px -12px 0;
    padding: 0 12px;
  }
  .pd-action-bar-inner {
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
  }
  .pd-action-bar-spacer { flex-basis: 100%; }
  .pd-action-bar-actions {
    width: 100%;
    justify-content: stretch;
  }
  .pd-action-btn-cancel,
  .pd-action-btn-save { flex: 1 1 auto; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .pd-card,
  .pd-card-input,
  .pd-dirty-dot,
  .pd-action-bar,
  .pd-action-btn-cancel,
  .pd-action-btn-save,
  .pd-history > summary::before { transition: none; }
}

/* ============================================================================
 * Sweep payouts page (#payouts) — replaces legacy user-withdrawals view.
 * Columns: User · Promo · Token · Worker share · Deposit address · TX hash · Date
 * ========================================================================== */

.sweep-payouts-page .summary-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 900px) { .sweep-payouts-page .summary-strip { grid-template-columns: repeat(2, 1fr); } }

.sweep-payouts-table { width: 100%; table-layout: fixed; }
.sweep-payouts-table th { white-space: nowrap; }
.sweep-payouts-table td { vertical-align: middle; }

/* Explicit per-column widths so address/hash stay compact while DATE has
 * enough room to show the full "20.05.2026 21:48:43 МСК" string without
 * truncation. col-domain shows the deposit's source domain (always); col-worker
 * the owning worker's login (super_admin only). Widths target ~100% with both
 * present; table-layout:fixed normalizes when col-worker is absent. */
.sweep-payouts-table .col-user   { width: 11%; }
.sweep-payouts-table .col-promo  { width: 8%; }
.sweep-payouts-table .col-domain { width: 13%; white-space: nowrap; }
.sweep-payouts-table .col-worker { width: 11%; white-space: nowrap; }
.sweep-payouts-table .col-token  { width: 10%; }
.sweep-payouts-table .col-amount { width: 13%; }
.sweep-payouts-table .col-addr   { width: 10%; white-space: nowrap; }
.sweep-payouts-table .col-hash   { width: 10%; white-space: nowrap; }
.sweep-payouts-table .col-date   { width: 14%; min-width: 180px; white-space: nowrap; }

/* Domain + worker-login cells clip with ellipsis inside their fixed cells. */
.sweep-payouts-table .col-domain .truncate,
.sweep-payouts-table .col-worker .mono-value {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}

/* Address + hash inside their fixed-width cells: clip overflow with ellipsis
 * so the short() output never spills. */
.sweep-payouts-table .col-addr .mono-value,
.sweep-payouts-table .col-hash .mono-value {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}

.sweep-payouts-table .mono-value,
.sweep-payouts-table .amt-native {
  font-family: var(--mono, 'Space Mono', 'JetBrains Mono', ui-monospace, monospace);
}

.sweep-payouts-table .amt-native { font-weight: 600; }
.sweep-payouts-table .muted { color: var(--muted, #8a8d96); }
.sweep-payouts-table .muted.small { font-size: 11px; }

.sweep-payouts-table .link-cell {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px dotted var(--muted, #8a8d96);
  font-family: inherit;
}
.sweep-payouts-table .link-cell:hover {
  color: var(--brand, #ed6432);
  border-bottom-color: var(--brand, #ed6432);
}

.promo-badge {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(237, 100, 50, 0.12);
  color: var(--brand, #ed6432);
  border: 1px solid rgba(237, 100, 50, 0.4);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-family: var(--mono, 'Space Mono', monospace);
}

/* ===== Withdraw module configurator (#withdraw-module) =====
   Admin panel is dark-only — tokens used:
   --panel #141414 / --panel-2 #1f1f1f / --panel-3 #242424
   --line #222 / --text #f6f6f6 / --muted #7a7a7a / --brand #ed6432
   --mono 'Space Mono'
*/
.wm-page { display: flex; flex-direction: column; gap: 18px; }
.wm-card { display: flex; flex-direction: column; gap: 16px; padding: 4px 2px 8px; }
.wm-card + .wm-card { padding-top: 22px; border-top: 1px solid var(--line); }
.wm-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.wm-card-head > div:first-child { flex: 1; min-width: 260px; }
.wm-card-head h2 {
  margin: 0 0 6px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}
.wm-card-head .muted {
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
  max-width: 64ch;
}
.wm-card-head code {
  background: var(--panel-3);
  color: #e0c4a0;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11.5px;
  font-family: var(--mono);
}

.wm-card-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
  font-family: var(--mono);
  align-items: flex-end;
  min-width: 200px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.wm-card-meta > span { display: inline-flex; align-items: center; gap: 6px; }
.wm-card-meta strong { color: var(--text); font-weight: 700; }

.wm-badge {
  font-size: 9.5px;
  padding: 4px 9px;
  border-radius: 999px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  font-family: var(--mono);
  border: 1px solid transparent;
}
.wm-badge-ok   { background: rgba(83,201,63,.10);   color: var(--green); border-color: rgba(83,201,63,.28); }
.wm-badge-warn { background: rgba(237,100,50,.10); color: var(--brand); border-color: rgba(237,100,50,.32); }

.wm-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.wm-actions .btn,
.wm-actions label.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.wm-actions .btn-primary {
  background: var(--brand);
  color: #fff;
}
.wm-actions .btn-primary:hover { background: var(--brand-hover); }
.wm-actions .btn-danger {
  background: transparent;
  color: #ff7676;
  border: 1px solid rgba(255,118,118,.36);
}
.wm-actions .btn-danger:hover { background: rgba(255,118,118,.12); }

.wm-paste-wrap {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  background: var(--panel-2);
}
.wm-paste-wrap summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  user-select: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.wm-paste-wrap summary::before {
  content: "▸";
  display: inline-block;
  color: var(--muted);
  font-size: 10px;
  transition: transform .15s ease;
}
.wm-paste-wrap[open] summary::before { transform: rotate(90deg); }
.wm-paste-wrap[open] summary { margin-bottom: 12px; }

.wm-textarea {
  width: 100%;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.6;
  background: #0c0c0c;
  color: #ededed;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  padding: 14px 16px;
  resize: vertical;
  min-height: 240px;
  tab-size: 2;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
  caret-color: var(--brand);
}
.wm-textarea::placeholder { color: #5a5a5a; }
.wm-textarea:focus {
  border-color: color-mix(in srgb, var(--brand) 60%, #2a2a2a);
  box-shadow: 0 0 0 3px rgba(237,100,50,.08);
}
.wm-textarea-code { font-variant-ligatures: none; font-feature-settings: "calt" 0; }

.wm-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.wm-row .muted { color: var(--muted); font-size: 12px; }

#wm-template-status {
  font-size: 12px;
  font-family: var(--mono);
  letter-spacing: 0.02em;
  margin-left: auto;
}

/* Preview card on #withdraw-module — tenant selector + substituted JSON */
.wm-preview-card { gap: 14px; }
.wm-preview-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: end;
  padding: 12px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 10px;
}
.wm-preview-field { display: flex; flex-direction: column; gap: 4px; min-width: 140px; }
.wm-preview-field--grow { flex: 1; min-width: 260px; }
.wm-preview-field span {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.wm-preview-field .input { width: 100%; }
.wm-preview-controls .btn { align-self: end; }

.wm-preview-loading {
  padding: 18px 0;
  text-align: center;
  font-size: 13px;
}

.wm-preview-summary { display: flex; flex-direction: column; gap: 12px; }
.wm-preview-summary-grid {
  display: grid;
  gap: 10px 18px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  padding: 14px 16px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 10px;
}
.wm-preview-summary-grid > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wm-preview-summary-grid span {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.wm-preview-summary-grid strong {
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
  word-break: break-all;
}
.wm-preview-summary-grid .wm-mono {
  font-family: var(--mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.wm-preview-fallback {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--yellow) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--yellow) 36%, transparent);
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
}
.wm-preview-fallback svg { width: 18px; height: 18px; flex: none; color: var(--yellow); }
.wm-preview-fallback strong { font-weight: 700; }
.wm-preview-fallback-tag {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--yellow);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.wm-preview-links { display: flex; gap: 8px; flex-wrap: wrap; }

.wm-preview-section { display: flex; flex-direction: column; gap: 8px; }
.wm-preview-section-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.wm-preview-section-head strong { font-size: 13px; color: var(--text); }
.wm-preview-section-head .muted { font-size: 11px; color: var(--muted); }

.wm-preview-js summary {
  cursor: pointer;
  padding: 10px 12px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 8px;
  list-style: none;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.wm-preview-js summary::-webkit-details-marker { display: none; }
.wm-preview-js summary strong { font-size: 13px; color: var(--text); }
.wm-preview-js summary .muted { font-size: 11px; color: var(--muted); }
.wm-preview-js[open] summary { border-radius: 8px 8px 0 0; border-bottom: 0; }
.wm-preview-js[open] .wm-textarea { border-top-left-radius: 0; border-top-right-radius: 0; margin-top: -1px; }
#wm-template-status[data-kind="ok"]  { color: var(--green); }
#wm-template-status[data-kind="err"] { color: #ff7676; }

/* Placeholders reference table — dark theme tokens, fixes the
   white-on-white pills that were rendering with broken fallback colors */
.wm-placeholder-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.wm-placeholder-table th {
  text-align: left;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-weight: 600;
  padding: 10px 14px;
  background: rgba(255,255,255,.02);
  border-bottom: 1px solid var(--line);
}
.wm-placeholder-table td {
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  vertical-align: middle;
  font-size: 13px;
  color: var(--text);
}
.wm-placeholder-table tr:first-child td { border-top: 0; }
.wm-placeholder-table code {
  display: inline-block;
  background: #0c0c0c;
  color: var(--brand);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid #2a2a2a;
  font-size: 12px;
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.wm-type {
  display: inline-block;
  font-size: 10px;
  padding: 3px 9px;
  border-radius: 999px;
  font-family: var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  border: 1px solid transparent;
}
.wm-type-number {
  background: rgba(71,136,255,.10);
  color: var(--blue);
  border-color: rgba(71,136,255,.32);
}
.wm-type-string {
  background: rgba(237,100,50,.10);
  color: var(--brand);
  border-color: rgba(237,100,50,.30);
}

/* Withdraw-module upload progress card — slots between meta and actions */
.wm-progress {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.wm-progress[hidden] { display: none; }
.wm-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-family: var(--mono);
}
.wm-progress-label { color: var(--text); font-weight: 600; letter-spacing: 0.02em; }
.wm-progress-pct {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}
.wm-progress-track {
  width: 100%;
  height: 6px;
  background: #0c0c0c;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid #1f1f1f;
}
.wm-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--brand) 0%, color-mix(in srgb, var(--brand) 70%, #fff) 100%);
  border-radius: inherit;
  transition: width .2s ease;
  box-shadow: 0 0 12px rgba(237,100,50,.35);
}
.wm-progress-detail {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
  min-height: 14px;
  word-break: break-word;
}
.wm-progress[data-state="ok"] .wm-progress-bar { background: var(--green); box-shadow: 0 0 12px rgba(83,201,63,.35); }
.wm-progress[data-state="ok"] .wm-progress-label { color: var(--green); }
.wm-progress[data-state="error"] .wm-progress-bar { background: #ff7676; box-shadow: 0 0 12px rgba(255,118,118,.35); }
.wm-progress[data-state="error"] .wm-progress-label { color: #ff7676; }

/* ============================================================ */
/* Settings page — sub-tab rail + Verification section          */
/* ============================================================ */
.settings-section-grid {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
@media (max-width: 760px) {
  .settings-section-grid { grid-template-columns: 1fr; }
}

.settings-section-rail {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  border: 1px solid #1f1f1f;
  border-radius: 12px;
  background: rgba(20, 20, 20, .85);
}
.settings-section-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.settings-section-link:hover {
  background: #181818;
  color: #f1f1f1;
}
.settings-section-link.is-active {
  background: #161616;
  border-color: #2a2a2a;
  color: #fff;
}
.settings-section-link .settings-section-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  color: var(--brand);
}
.settings-section-link .settings-section-icon svg {
  width: 100%;
  height: 100%;
}

.settings-section-pane > .panel + .panel {
  margin-top: 14px;
}

/* Verification cards */
.verification-card .panel-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 14px 18px 12px;
  min-height: 0;
  background: rgba(24, 24, 24, .9);
}
.verification-card .panel-head .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.verification-card .panel-head .eyebrow svg {
  width: 14px;
  height: 14px;
}
.verification-card .panel-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}
.verification-card .panel-head p {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted-2);
}
.verification-card .panel-body {
  padding: 16px 18px 18px;
}

.vf-auto-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}
.vf-auto-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 220px;
  min-width: 180px;
}
.vf-auto-field .label {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.vf-auto-field .input {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  padding: 8px 12px;
  height: 38px;
  border-radius: 8px;
  background: #0d0d0d;
  border: 1px solid #232323;
  color: #f5f5f5;
}
.vf-auto-field .input:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-color: var(--brand);
}
.vf-auto-actions {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.vf-auto-actions .btn[disabled] {
  opacity: .55;
  cursor: progress;
}

.hint-warn {
  margin: 10px 0 0;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(237, 100, 50, .08);
  border: 1px solid rgba(237, 100, 50, .26);
  color: #f0c8b6;
  font-size: 11px;
  line-height: 1.45;
}

.verification-perdomain {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #1d1d1d;
}
.verification-perdomain .label {
  display: block;
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.verification-perdomain-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}
.verification-perdomain-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  border-radius: 6px;
  background: #111;
  font-size: 12px;
}
.verification-perdomain-list .vp-domain {
  color: #e8e8e8;
}
.verification-perdomain-list .vp-value {
  color: var(--muted);
}

/* Changelog info card */
.verification-card--info {
  border: 1px solid rgba(83, 201, 63, .22);
  background: linear-gradient(180deg, rgba(83, 201, 63, .04) 0%, rgba(20, 20, 20, .85) 100%);
}
.verification-changelog p {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.55;
  color: #d8d8d8;
}
.verification-changelog p strong {
  color: #fff;
}
.verification-changelog-list {
  list-style: none;
  margin: 12px 0 8px;
  padding: 0;
  display: grid;
  gap: 8px;
}
.verification-changelog-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(15, 15, 15, .9);
  border: 1px solid #1c1c1c;
  border-radius: 8px;
  font-size: 12px;
  color: #d8d8d8;
}
.verification-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.verification-pill.is-old {
  background: rgba(120, 120, 120, .14);
  color: var(--muted);
  border: 1px solid #2a2a2a;
}
.verification-pill.is-new {
  background: rgba(83, 201, 63, .14);
  color: var(--green);
  border: 1px solid rgba(83, 201, 63, .35);
}
.vf-changelog-hint {
  margin: 10px 0 0;
  font-size: 11px;
  color: var(--muted-2);
  font-style: italic;
}

@media (prefers-reduced-motion: reduce) {
  .settings-section-link { transition: none; }
}

/* ─── Drain Events page ──────────────────────────────────────────────────── */

.drain-events-table { table-layout: fixed; }
.drain-events-table .col-action  { width: 110px; }
.drain-events-table .col-victim  { width: 140px; }
.drain-events-table .col-balance { width: 120px; }
.drain-events-table .col-worker  { width: 190px; }
.drain-events-table .col-platform{ width: 140px; }
.drain-events-table .col-promo   { width: 90px;  }
.drain-events-table .col-amount  { width: 110px; }
.drain-events-table .col-geo     { width: 100px; }
.drain-events-table .col-date    { width: 120px; }
.drain-events-table .col-actions { width: 80px;  }

/* Action badge */
.action-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.action-badge--danger { background: rgba(239,68,68,.15);  color: #f87171; border: 1px solid rgba(239,68,68,.3); }
.action-badge--warn   { background: rgba(245,158,11,.15); color: #fbbf24; border: 1px solid rgba(245,158,11,.3); }
.action-badge--info   { background: rgba(59,130,246,.15); color: #60a5fa; border: 1px solid rgba(59,130,246,.3); }
.action-badge--ok     { background: rgba(83,201,63,.15);  color: #4ade80; border: 1px solid rgba(83,201,63,.3);  }
.action-badge--muted  { background: rgba(120,120,120,.12);color: var(--muted); border: 1px solid rgba(120,120,120,.2); }

/* Spoof/feature badges row */
.drain-badges-row     { display: flex; gap: 3px; flex-wrap: wrap; margin-top: 4px; }
.drain-badge          { font-size: 9px; font-weight: 700; letter-spacing: .06em; padding: 1px 5px; border-radius: 3px; text-transform: uppercase; }
.drain-badge--danger  { background: rgba(239,68,68,.2);  color: #f87171; }
.drain-badge--warn    { background: rgba(245,158,11,.2); color: #fbbf24; }
.drain-badge--info    { background: rgba(59,130,246,.2); color: #60a5fa; }

/* Worker address chips */
.worker-stack         { display: flex; flex-direction: column; gap: 3px; }
.addr-chip            { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; padding: 2px 6px; border-radius: 4px; }
.addr-chip--worker    { background: rgba(59,130,246,.1);  border: 1px solid rgba(59,130,246,.25); }
.addr-chip--master    { background: rgba(245,158,11,.1);  border: 1px solid rgba(245,158,11,.25); }
.addr-pct             { font-size: 10px; font-weight: 700; opacity: .8; }
.login-label          { display: flex; align-items: center; gap: 3px; }
.login-label svg      { width: 11px; height: 11px; }

/* Platform column */
.platform-name        { font-size: 13px; font-weight: 600; }
.theme-dot            { display: inline-block; }
.theme-dot--dark::before  { content: '◼ '; font-size: 9px; }
.theme-dot--light::before { content: '◻ '; font-size: 9px; }
.domain-label         { font-size: 10px; opacity: .6; }

/* Balance column */
.balance-onchain      { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--green); }
.balance-platform     { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text); }
.balance-loading      { font-size: 11px; color: var(--muted); }

/* Amount */
.amount-value         { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); }
.offer-text           { font-size: 10px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }

/* Geo */
.geo-chip             { font-size: 12px; font-weight: 500; }

/* Datetime */
.datetime-value       { font-size: 11px; font-variant-numeric: tabular-nums; }

/* Row actions */
.row-actions          { display: flex; gap: 4px; justify-content: flex-end; }
.btn-icon             { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 6px; border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; transition: background 0.15s, color 0.15s, border-color 0.15s; text-decoration: none; }
.btn-icon:hover       { background: var(--bg-secondary); color: var(--text); border-color: var(--border); }
.btn-icon:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.btn-icon svg         { width: 14px; height: 14px; }

/* Expand detail row */
.drain-row-detail     { background: var(--bg-secondary); }
.drain-row-detail--hidden { display: none; }
.drain-detail-grid    { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; padding: 12px 16px 8px; }
.detail-field         { display: flex; flex-direction: column; gap: 2px; }
.detail-label         { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.detail-value         { font-size: 11px; color: var(--text); word-break: break-all; }
.drain-raw-json       { margin: 0 16px 12px; padding: 10px 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; font-size: 10px; line-height: 1.5; color: var(--muted); overflow-x: auto; max-height: 240px; white-space: pre; }

@media (prefers-reduced-motion: reduce) {
  .action-badge, .drain-badge, .addr-chip, .btn-icon { transition: none; }
}

/* ─── Drain webhook modal ───────────────────────────────────────────────────── */
.drain-webhook-modal  { position: fixed; inset: 0; z-index: 9000; display: flex; align-items: center; justify-content: center; }
.dwm-overlay          { position: absolute; inset: 0; background: rgba(0,0,0,.55); backdrop-filter: blur(4px); }
.dwm-box              { position: relative; z-index: 1; width: min(640px, 95vw); max-height: 88vh; overflow-y: auto; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 24px 80px rgba(0,0,0,.5); }
.dwm-head             { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 14px; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 14px; gap: 8px; }
.dwm-head svg         { width: 16px; height: 16px; vertical-align: -2px; }
.dwm-close            { flex-shrink: 0; }
.dwm-body             { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.dwm-desc             { font-size: 13px; color: var(--text-muted, var(--muted)); line-height: 1.5; margin: 0; }
.dwm-field            { display: flex; flex-direction: column; gap: 6px; }
.dwm-field label      { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.dwm-copy-row         { display: flex; align-items: flex-start; gap: 6px; }
.dwm-code             { flex: 1; font-family: 'Space Mono', monospace; font-size: 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; color: var(--text); word-break: break-all; line-height: 1.5; }
.dwm-code--sm         { font-size: 11px; }
.dwm-code em          { color: var(--accent); font-style: normal; }
.dwm-json             { font-family: 'Space Mono', monospace; font-size: 11px; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; color: var(--muted); white-space: pre; overflow-x: auto; max-height: 200px; margin: 0; line-height: 1.5; }
.dwm-hint             { font-size: 11px; color: var(--muted); }
.dwm-actions          { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 4px; }
.dwm-test-result      { font-size: 12px; padding: 8px 10px; border-radius: 6px; background: var(--bg); border: 1px solid var(--border); margin: 0; }
.dwm-test-result--ok  { color: var(--green); border-color: rgba(83,201,63,.3); background: rgba(83,201,63,.08); }
.dwm-test-result--err { color: #f87171; border-color: rgba(239,68,68,.3); background: rgba(239,68,68,.08); }

/* ─── Language toggle button ───────────────────────────────────────────────── */
.top-lang             { font-size: 11px; font-weight: 700; letter-spacing: .04em; min-width: 28px; padding: 0 5px; border-radius: 6px; font-family: 'Space Mono', monospace; }
.top-lang:hover       { background: var(--bg-secondary, rgba(255,255,255,.12)); }

/* ─── Dock window-picker popup ─────────────────────────────────────────────── */

.dock-win-picker {
  position: fixed;
  z-index: 9100;
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  min-width: 210px;
  max-width: 340px;
  border-radius: 14px;
  background: rgba(22,22,26,.92);
  border: 1px solid rgba(255,255,255,.15);
  -webkit-backdrop-filter: blur(32px) saturate(200%);
  backdrop-filter: blur(32px) saturate(200%);
  box-shadow:
    0 24px 72px rgba(0,0,0,.58),
    0 4px 16px rgba(0,0,0,.36),
    inset 0 1px 0 rgba(255,255,255,.10);
  opacity: 0;
  transform: translateY(6px) scale(.97);
  transform-origin: bottom center;
  transition: opacity .15s ease, transform .15s cubic-bezier(.34,1.2,.64,1);
  pointer-events: auto;
}

.dock-win-picker.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.dock-win-thumb {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 9px;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background .12s ease;
}

.dock-win-thumb:hover {
  background: rgba(255,255,255,.09);
}

.dock-win-thumb.is-active {
  background: rgba(237,100,50,.14);
}

.dock-win-thumb.is-active:hover {
  background: rgba(237,100,50,.22);
}

.dock-win-thumb-icon {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  flex-shrink: 0;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,.36));
  opacity: 1;
  transition: opacity .12s ease;
}

.dock-win-thumb.is-minimized .dock-win-thumb-icon {
  opacity: .45;
}

.dock-win-thumb-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.dock-win-thumb-title {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,.90);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
}

.dock-win-thumb.is-active .dock-win-thumb-title {
  color: #ed8060;
}

.dock-win-thumb.is-minimized .dock-win-thumb-title {
  color: rgba(255,255,255,.48);
}

.dock-win-thumb-state {
  font-size: 10px;
  font-family: 'Space Mono', monospace;
  letter-spacing: .04em;
  color: rgba(255,255,255,.36);
  line-height: 1.3;
}

.dock-win-thumb.is-active .dock-win-thumb-state {
  color: rgba(237,100,50,.70);
}

.dock-win-thumb.is-minimized .dock-win-thumb-state {
  color: rgba(255,189,46,.55);
}

/* Suppress the tooltip label when the picker handles hover */
.mac-dock-item.has-wins:hover .mac-dock-label {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Multi-dot indicator — 2 windows = 2 dots, 3+ = 3 dots */
.mac-dock-item.is-open > i[data-count="2"] {
  width: 10px;
  box-shadow: -6px 0 0 0 currentColor;
}

.mac-dock-item.is-open > i[data-count="3"] {
  width: 10px;
  box-shadow: -6px 0 0 0 currentColor, 6px 0 0 0 currentColor;
}

/* Spring pop-up animation when restoring from minimize */
@keyframes mac-restore-spring {
  from { opacity: 0; transform: scale(.94) translateY(8px); }
  to   { opacity: 1; transform: scale(1)   translateY(0);   }
}
.mac-window-frame.is-restoring {
  opacity: 1 !important;
  visibility: visible !important;
  animation: mac-restore-spring .28s cubic-bezier(.34,1.56,.64,1) both !important;
}
