@font-face {
  font-family: 'Unbounded';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(./fonts/unbounded-600-0.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Unbounded';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(./fonts/unbounded-700-1.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(./fonts/dm-sans-400-700-0.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Space Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(./fonts/space-mono-400-0.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Space Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(./fonts/space-mono-700-1.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --ink: #0f172a;
  --muted: #52607a;
  --line: #e2e8f0;
  --paper: #f1f5f9;
  --card: #ffffff;
  --card-subtle: #f8fafc;
  --accent: #18181b;
  --accent-dark: #09090b;
  --accent-soft: rgba(24, 24, 27, 0.08);
  --cta-bg: #09090b;
  --cta-ink: #ffffff;
  --rail: #08080a;
  --rail-card: #0e0e11;
  --rail-border: rgba(255, 255, 255, 0.085);
  --rail-muted: #8f8f99;
  --good: #047857;
  --good-bg: #d1fae5;
  --warn: #b45309;
  --warn-bg: #fef3c7;
  --hot: #be123c;
  --hot-bg: #ffe4e6;
  --info: #1d4ed8;
  --info-bg: #dbeafe;
  --font-display: "Unbounded", system-ui, sans-serif;
  --font-sans: "DM Sans", system-ui, -apple-system, sans-serif;
  --font-mono: "Space Mono", ui-monospace, Consolas, monospace;
  font-family: var(--font-sans);
  text-rendering: optimizeLegibility;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #FAFAFA;
  --muted: #A1A1AA;
  --line: rgba(255, 255, 255, 0.085);
  --paper: #050506;
  --card: #0E0E11;
  --card-subtle: #16161A;
  --accent: #E4E4E7;
  --accent-dark: #FFFFFF;
  --accent-soft: rgba(228, 228, 231, 0.09);
  --cta-bg: #FFFFFF;
  --cta-ink: #050506;
  --rail: #08080A;
  --rail-card: #0E0E11;
  --rail-border: rgba(255, 255, 255, 0.085);
  --rail-muted: #7C7C86;
  --good: #10B981;
  --good-bg: rgba(16, 185, 129, 0.12);
  --warn: #F59E0B;
  --warn-bg: rgba(245, 158, 11, 0.12);
  --hot: #EF4444;
  --hot-bg: rgba(239, 68, 68, 0.13);
  --info: #38BDF8;
  --info-bg: rgba(56, 189, 248, 0.12);
}

*, ::before, ::after { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); min-width: 0; font-family: var(--font-sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
code, pre { font-family: var(--font-mono); font-size: .8rem; }
pre.code-box {
  margin: 10px 0 0; padding: 10px 12px; border-radius: 6px;
  background: var(--rail); color: #cbd5e1; border: 1px solid var(--rail-border);
  overflow-x: auto; white-space: pre-wrap; word-break: break-word;
}
.loading { padding: 36px; color: var(--muted); font-family: var(--font-mono); font-size: .85rem; }

.shell { display: grid; grid-template-columns: 244px minmax(0, 1fr); min-height: 100vh; }
.rail {
  display: flex; flex-direction: column; gap: 16px; min-height: 100vh;
  padding: 18px 13px 15px; background: var(--rail); color: #FAFAFA;
  border-right: 1px solid var(--rail-border);
}
.wordmark { display: flex; align-items: center; gap: 11px; padding-bottom: 14px; border-bottom: 1px solid var(--rail-border); }
.wordmark .brand-name { display: block; font-family: var(--font-display); font-size: .86rem; font-weight: 700; letter-spacing: .03em; line-height: 1.05; color: #FAFAFA; white-space: nowrap; }
.wordmark small { display: block; font-family: var(--font-mono); font-size: .62rem; font-weight: 400; color: var(--rail-muted); letter-spacing: .08em; text-transform: uppercase; margin-top: 3px; }
.mark {
  display: inline-flex; width: 34px; height: 34px; flex: 0 0 auto; align-items: center; justify-content: center;
  background: #16161A; border: 1px solid rgba(228, 228, 231, 0.24);
  clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 7px 100%, 0 calc(100% - 7px));
}
.mark svg { width: 18px; height: 18px; display: block; }
.rail-label { display: block; margin: 0 0 6px; color: var(--rail-muted); font-family: var(--font-mono); font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; }
.workspaces { min-width: 0; padding: 0 2px; }
.workspace-head { display: flex; align-items: center; justify-content: space-between; gap: 5px; }
.rail-plus {
  margin-top: -5px; border: 1px solid var(--rail-border); border-radius: 4px; width: 25px; height: 24px;
  padding: 0; color: #FAFAFA; background: var(--rail-card);
}
.rail-plus:hover { background: #1D1D23; border-color: rgba(228, 228, 231, 0.26); }
.workspace {
  appearance: none; min-width: 0; width: 100%; border: 1px solid var(--rail-border); border-radius: 4px;
  color: #FAFAFA; background-color: var(--rail-card); padding: 9px 26px 9px 10px; font-size: .83rem; font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  background-image: linear-gradient(45deg, transparent 50%, #A1A1AA 50%), linear-gradient(135deg, #A1A1AA 50%, transparent 50%);
  background-position: calc(100% - 14px) 52%, calc(100% - 10px) 52%; background-size: 4px 4px; background-repeat: no-repeat;
}

.nav { display: grid; gap: 2px; }
.nav button {
  display: flex; align-items: center; text-align: left; gap: 9px; border: 1px solid transparent; min-height: 36px;
  padding: 7px 10px; color: #A1A1AA; background: transparent; border-radius: 4px; white-space: nowrap; font-size: .84rem; font-weight: 500;
}
.nav button:hover { background: #0E0E11; color: #FAFAFA; }
.nav button[aria-current="page"] {
  background: #16161A; color: #FAFAFA; font-weight: 600;
  border-color: var(--rail-border); box-shadow: inset 2px 0 #E4E4E7, inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.nav button[aria-current="page"] .nav-icon { color: #E4E4E7; }
.nav-icon { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; flex: 0 0 auto; color: #6B6B74; }
.nav-svg { width: 15px; height: 15px; display: block; }

.rail-groups { display: grid; gap: 3px; border-top: 1px solid var(--rail-border); padding-top: 12px; }
.rail-group-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 0; background: transparent;
  color: #A1A1AA; padding: 5px 8px; border-radius: 4px; font-size: .8rem; text-align: left;
}
.rail-group-btn:hover, .rail-group-btn.active { background: #16161A; color: #FAFAFA; }
.rail-group-count { font-family: var(--font-mono); font-size: .68rem; padding: 1px 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.05); color: #A1A1AA; }

.rail-bottom { display: grid; align-content: end; gap: 10px; margin-top: auto; border-top: 1px solid var(--rail-border); padding-top: 12px; }
.rail-status-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.device-mini { display: flex; align-items: center; gap: 7px; color: #A1A1AA; font-family: var(--font-mono); font-size: .72rem; }
.device-mini::before { content: ""; display: inline-block; width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: #64748b; }
.device-mini.online::before { background: #10B981; box-shadow: 0 0 0 3px rgba(16, 185, 129, .18); }
.theme-btn {
  border: 1px solid var(--rail-border); background: #16161A; color: #E4E4E7;
  border-radius: 4px; padding: 4px 8px; font-family: var(--font-mono); font-size: .68rem; font-weight: 700; text-transform: uppercase;
}
.theme-btn:hover { background: #1D1D23; }
.user-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; overflow-wrap: anywhere; font-family: var(--font-mono); font-size: .7rem; color: var(--rail-muted); }
.user-row .text-btn { color: #E4E4E7; font-size: .7rem; }

.content { padding: 20px clamp(16px, 2.5vw, 32px) 40px; min-width: 0; }
.stage { max-width: 1460px; margin-inline: auto; }
.crumb { color: var(--muted); font-family: var(--font-mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 10px; }
.crumb span { color: var(--muted); opacity: .45; padding-inline: 7px; }
.topline { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.page-actions:empty { display: none; }
h1 { font-family: var(--font-display); font-size: clamp(1.18rem, 2.1vw, 1.42rem); font-weight: 700; line-height: 1.15; letter-spacing: .01em; text-transform: uppercase; }
.sub { margin-top: 6px; color: var(--muted); font-size: .86rem; line-height: 1.45; }

.btn {
  border: 1px solid var(--line); border-radius: 4px; background: var(--card); color: var(--ink);
  min-height: 36px; padding: 7px 12px; font-weight: 600; font-size: .82rem;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.btn:hover:not(:disabled) { background: var(--card-subtle); border-color: rgba(228, 228, 231, 0.24); }
.btn.primary {
  background: var(--cta-bg); color: var(--cta-ink); border-color: transparent; font-weight: 700;
  clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 7px 100%, 0 calc(100% - 7px));
  border-radius: 0; padding-inline: 15px;
}
.btn.primary:hover:not(:disabled) { opacity: .9; background: var(--cta-bg); }
.btn.launch { background: var(--card-subtle); color: var(--ink); border-color: rgba(228, 228, 231, 0.24); font-family: var(--font-mono); font-size: .74rem; text-transform: uppercase; letter-spacing: .03em; }
.btn.launch:hover:not(:disabled) { background: #1D1D23; border-color: var(--good); color: var(--good); }
.btn.stop-btn { background: var(--good-bg); color: var(--good); border-color: rgba(16, 185, 129, 0.34); font-family: var(--font-mono); font-size: .74rem; text-transform: uppercase; }
.btn.small { min-height: 31px; padding: 5px 10px; font-size: .78rem; }
.text-btn { border: 0; background: transparent; color: var(--accent); padding: 1px 0; font-size: .82rem; font-weight: 600; text-align: left; }
.text-btn:hover { text-decoration: underline; }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.metrics.three-col { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metric, .panel {
  background: var(--card); border: 1px solid var(--line); border-radius: 6px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.metric { min-width: 0; padding: 13px 15px; position: relative; overflow: hidden; }
.metric::before { content: ""; position: absolute; top: 0; left: 0; width: 26px; height: 2px; background: var(--accent); }
.metric span { display: block; color: var(--muted); font-family: var(--font-mono); font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.metric strong { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; letter-spacing: -.02em; }
.metric.highlight { background: var(--card); border-color: rgba(228, 228, 231, 0.22); }

.table-panel { overflow: hidden; }
.tools { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 11px 14px; background: var(--card); }
.tools label { min-width: min(100%, 220px); flex: 1 1 220px; }
.tools .folder-filter, .tools .filter-field { min-width: min(100%, 118px); flex: 0 1 auto; }
.tools .toggle { margin-left: auto; }
.density-button[aria-pressed="true"] { background: var(--accent-soft); color: var(--ink); border-color: var(--accent); }
.search { width: 100%; min-height: 36px; border: 1px solid var(--line); border-radius: 4px; padding: 6px 10px; background: var(--card-subtle); color: var(--ink); font-size: .82rem; }
.toggle { display: flex; gap: 3px; padding: 3px; border-radius: 4px; background: var(--paper); border: 1px solid var(--line); }
.toggle button { border: 1px solid transparent; border-radius: 3px; padding: 5px 10px; font-size: .78rem; font-weight: 600; color: var(--muted); background: transparent; }
.toggle button[aria-pressed="true"] { color: var(--ink); background: var(--card-subtle); border-color: var(--line); }
.view-switch { width: fit-content; margin-bottom: 12px; }

.selection-line {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 7px 12px;
  min-height: 46px; border-top: 1px solid var(--line); padding: 6px 14px; background: var(--card-subtle);
}
.selection-line label, .selection-count, .selection-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.selection-line label { font-size: .8rem; font-weight: 600; color: var(--muted); }
.selection-line input, .row-check { width: 15px; height: 15px; margin: 0; flex: 0 0 auto; accent-color: var(--accent); }
.selection-badge { background: var(--accent-soft); color: var(--accent); font-family: var(--font-mono); font-size: .72rem; font-weight: 700; border-radius: 4px; padding: 3px 7px; }

.heads, .profile-row {
  display: grid;
  grid-template-columns: minmax(175px, 1.25fr) minmax(130px, .9fr) minmax(120px, .9fr) minmax(88px, .52fr) minmax(86px, .52fr) minmax(145px, .72fr);
  align-items: center; gap: 11px; padding: 10px 14px;
}
.heads {
  color: var(--muted); background: var(--card-subtle); font-family: var(--font-mono); font-size: .68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; border-block: 1px solid var(--line);
}
.heads > :first-child { padding-left: 22px; }
.profile-row { min-height: 66px; font-size: .84rem; border-bottom: 1px solid var(--line); transition: background .12s; }
.profile-row:hover { background: #1D1D23; }
.profile-row:has(.row-check:checked) { background: var(--accent-soft); }
.profile-row:last-child { border-bottom: 0; }
.compact-profiles .profile-row { min-height: 46px; padding-block: 5px; }
.compact-profiles .avatar { width: 28px; height: 28px; }

.identity { display: flex; align-items: center; gap: 10px; min-width: 0; }
.identity strong, .identity small { display: block; overflow-wrap: anywhere; }
.identity small { color: var(--muted); font-family: var(--font-mono); font-size: .7rem; padding-top: 2px; }
.identity-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.seg-leds { display: inline-grid; grid-template-columns: repeat(7, 14px); gap: 3px; margin-top: 5px; }
.seg-led { height: 4px; border-radius: 1px; background: rgba(255, 255, 255, 0.09); }
.seg-led.on { background: var(--accent); }
.status-chip {
  font-family: var(--font-mono); font-size: .65rem; font-weight: 700; padding: 1px 6px; border-radius: 3px;
  border: 1px solid var(--line); background: var(--card-subtle); color: var(--muted); cursor: pointer; text-transform: uppercase;
}
.status-chip.s-ready { background: var(--good-bg); color: var(--good); border-color: transparent; }
.status-chip.s-warming { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.status-chip.s-new { background: var(--info-bg); color: var(--info); border-color: transparent; }
.status-chip.s-needs { background: var(--hot-bg); color: var(--hot); border-color: transparent; }

.avatar {
  display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 4px;
  font-family: var(--font-display); font-weight: 700; font-size: .72rem;
  background: var(--card-subtle); color: #FAFAFA; border: 1px solid rgba(228, 228, 231, 0.22);
}
.avatar.mint { border-color: rgba(16, 185, 129, 0.4); color: #10B981; background: rgba(16, 185, 129, 0.1); }
.avatar.sky { border-color: rgba(56, 189, 248, 0.4); color: #38BDF8; background: rgba(56, 189, 248, 0.1); }
.avatar.amber { border-color: rgba(245, 158, 11, 0.4); color: #F59E0B; background: rgba(245, 158, 11, 0.1); }
.avatar.rose { border-color: rgba(239, 68, 68, 0.4); color: #FB7185; background: rgba(239, 68, 68, 0.1); }

.route-col { display: grid; gap: 3px; min-width: 0; overflow-wrap: anywhere; }
.route-col small { color: var(--muted); font-family: var(--font-mono); font-size: .7rem; }
.route-shortcut { justify-self: start; max-width: 100%; overflow-wrap: anywhere; font-family: var(--font-mono); font-size: .76rem; }

.platforms { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.platform {
  display: inline-flex; align-items: center; gap: 5px; min-width: 28px; min-height: 26px; max-width: 100%;
  padding: 3px 7px; overflow-wrap: anywhere; border-radius: 4px; color: var(--muted);
  background: var(--card-subtle); font-family: var(--font-mono); font-weight: 400; font-size: .68rem; border: 1px solid var(--line);
}
.plat-svg { width: 12px; height: 12px; flex: 0 0 auto; }
button.platform { border: 1px solid var(--line); min-width: 32px; min-height: 28px; }
button.platform:hover:not(:disabled) { border-color: rgba(228, 228, 231, 0.35); color: #FAFAFA; background: #1D1D23; }
button.all-platforms { padding-inline: 8px; color: #FAFAFA; background: var(--accent-soft); border-color: rgba(228, 228, 231, 0.25); }
.platform[data-name=YouTube],
.platform[data-name=Instagram],
.platform[data-name=TikTok],
.platform[data-name=LinkedIn],
.platform[data-name=X] { color: #D4D4D8; background: var(--card-subtle); }

.tag {
  display: inline-flex; align-items: center; gap: 5px; width: max-content; max-width: 100%;
  padding: 3px 8px; border: 0; border-radius: 4px; background: var(--card-subtle); color: var(--muted);
  font-family: var(--font-mono); font-size: .68rem; font-weight: 700; text-transform: uppercase;
}
.tag.good { background: var(--good-bg); color: var(--good); }
.tag.warn { background: var(--warn-bg); color: var(--warn); }
.tag.hot { background: var(--hot-bg); color: var(--hot); }
.tag.info { background: var(--info-bg); color: var(--info); }

.profile-browser { display: grid; gap: 4px; min-width: 0; }
.profile-browser small { color: var(--muted); font-family: var(--font-mono); font-size: .7rem; overflow-wrap: anywhere; }
.row-actions { display: flex; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.profile-actions .history-action { color: var(--muted); }
.catalog-list .network-row:last-child { border-bottom: 0; }
.member-scope { min-width: 0; max-height: 215px; overflow: auto; border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; }
.member-scope legend { color: var(--muted); font-size: .8rem; font-weight: 700; }
.member-scope .inline-check + .inline-check { margin-top: 6px; }
.cloud-extension-panel { margin-top: 16px; padding: 12px; }
.cloud-extension-panel .catalog-list { margin-top: 8px; }
.extension-approval { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; padding-block: 6px; }
.workflow-steps { min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px 12px; }
.workflow-steps legend { color: var(--muted); font-size: .8rem; font-weight: 700; }
.workflow-step { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; padding: 8px 0; }
.workflow-step + .workflow-step { border-top: 1px solid var(--line); }
.workflow-step > label { flex: 1 1 115px; min-width: 0; }
.workflow-step > button { flex: 0 0 auto; }

.network-row {
  display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr) minmax(0, 1fr) minmax(135px, .85fr);
  align-items: center; gap: 12px; padding: 12px 15px; border-bottom: 1px solid var(--line); font-size: .84rem; overflow-wrap: anywhere;
}
#network-rows article:last-child { border: 0; }
.network-row small { display: block; margin-top: 3px; color: var(--muted); font-family: var(--font-mono); font-size: .72rem; }
.network-head { background: var(--card-subtle); color: var(--muted); font-family: var(--font-mono); font-weight: 700; font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; }

.catalog-row {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  min-height: 62px; gap: 12px; padding: 12px 15px; border-bottom: 1px solid var(--line); font-size: .84rem;
}
.catalog-row:last-child { border: 0; }
.catalog-item { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; min-width: 0; }
.catalog-item strong, .catalog-item small { overflow-wrap: anywhere; }
.catalog-item small { color: var(--muted); }
.catalog-item > div small { display: block; margin-top: 3px; }
.catalog-icon { display: grid; width: 34px; height: 34px; place-items: center; flex: 0 0 auto; border-radius: 4px; background: var(--accent-soft); color: var(--accent); border: 1px solid var(--line); }

.activity-tools { border-bottom: 1px solid var(--line); }
.activity-list { list-style: none; margin: 0; padding: 0 15px; }
.activity-list li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 11px 0; }
.activity-list li + li { border-top: 1px solid var(--line); }
.activity-list div { overflow-wrap: anywhere; }
.activity-list small, .activity-list time { color: var(--muted); font-family: var(--font-mono); font-size: .74rem; }
.activity-list small { display: block; margin-top: 2px; }
.setup-list { display: grid; gap: 13px; }
.setup-card { padding: 16px; min-width: 0; }
.setup-card header, .setup-card li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; justify-content: space-between; }
.setup-card h2 { font-family: var(--font-display); font-size: .98rem; }
.setup-card header p, .setup-card small { font-size: .82rem; overflow-wrap: anywhere; }
.setup-card header p { margin-top: 4px; }
.setup-card ul { list-style: none; padding: 0; margin: 12px 0 0; }
.setup-card li { padding: 9px 0; border-top: 1px solid var(--line); font-size: .88rem; overflow-wrap: anywhere; }
.setup-card li > div:first-child { flex: 1 1 100px; min-width: 0; }
.setup-card li .row-actions { margin-left: auto; }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.panel-footer { padding: 11px 15px; border-top: 1px solid var(--line); }
.quiet { color: var(--muted); font-size: .84rem; }
.empty { padding: 34px 20px; text-align: center; }
.empty h2 { font-family: var(--font-display); font-size: 1.05rem; margin-bottom: 5px; }
.empty .btn { margin-top: 14px; }

.settings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.settings .panel, .audit-item { padding: 16px; min-width: 0; }
.settings h2, .audit-item h2 { font-family: var(--font-display); font-size: .96rem; margin-bottom: 4px; }
.settings .sub { font-size: .84rem; margin-bottom: 10px; }
.settings .btn { margin-top: 10px; margin-right: 6px; }
.btn.download { display: inline-flex; align-items: center; text-decoration: none; }
.history time { color: var(--muted); font-family: var(--font-mono); font-size: .74rem; }
.setting-rows, .audit-list { display: grid; gap: 9px; }
.setting-rows { list-style: none; padding: 0; margin: 8px 0 0; }
.setting-rows li { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; overflow-wrap: anywhere; font-size: .85rem; padding: 6px 0; border-bottom: 1px solid var(--line); }
.setting-rows li:last-child { border-bottom: 0; }
.audit-item { display: grid; gap: 8px; overflow-wrap: anywhere; }
.audit-item .tag { margin-top: 2px; }

.crumb .preview-note { color: var(--accent); font-family: var(--font-mono); font-size: .68rem; font-weight: 700; padding: 2px 7px; margin-left: 7px; background: var(--accent-soft); border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

dialog {
  border: 1px solid rgba(228, 228, 231, 0.18); border-radius: 8px; width: min(640px, calc(100% - 28px));
  max-height: 90vh; padding: 20px; color: var(--ink); background: var(--card);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75);
}
dialog::backdrop { background: rgba(5, 5, 6, .76); backdrop-filter: blur(4px); }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 16px; }
.modal-head h2 { font-family: var(--font-display); font-size: 1.06rem; letter-spacing: -.01em; }
.modal-head .btn { min-width: 36px; }
dialog:not(.viewer) .modal-head {
  position: sticky; z-index: 2; top: -20px; background: var(--card);
  border-bottom: 1px solid var(--line); margin: -20px -20px 14px; padding: 14px 20px 11px;
}
dialog.viewer { width: min(1180px, calc(100% - 24px)); }
.viewer-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; font-size: .85rem; }
.viewer-frame { display: block; border: 1px solid var(--line); border-radius: 8px; width: 100%; height: min(68dvh, 750px); }
.viewer-shell { overflow: hidden; width: 100%; height: 100vh; margin: 0; }
.viewer-shell iframe { display: block; border: 0; width: 100%; height: 100%; }

.form { display: grid; gap: 12px; }
.editor-nav { display: flex; flex-wrap: wrap; gap: 5px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.editor-nav button { border: 0; border-radius: 6px; min-height: 31px; padding: 4px 9px; background: var(--accent-soft); color: var(--accent); font-weight: 650; font-size: .78rem; }
[data-editor] { scroll-margin: 12px; }
.form input[type=checkbox] { accent-color: var(--accent); }
.engine-info { display: grid; gap: 3px; align-content: start; font-size: .84rem; line-height: 1.4; }
.engine-info span { color: var(--muted); }
.browser-controls { display: flex; flex-wrap: wrap; gap: 7px; }
.form label { display: grid; gap: 5px; min-width: 0; font-size: .84rem; font-weight: 600; }
.form input:not([type=checkbox]), .form select, .form textarea {
  min-width: 0; width: 100%; min-height: 38px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--card-subtle); padding: 7px 9px; font: inherit; font-weight: 400; color: var(--ink);
}
.profile-notes { grid-column: 1 / -1; }
.form .inline-check { display: flex; align-items: center; gap: 8px; }
.profile-footer { display: flex; flex-wrap: wrap; gap: 12px; }
.form select {
  appearance: none; padding-right: 25px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 15px) 52%, calc(100% - 11px) 52%; background-size: 4px 4px; background-repeat: no-repeat;
}
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.platform-select { display: flex; flex-wrap: wrap; gap: 7px; padding: 0; margin: 0; border: 0; min-width: 0; }
.platform-select legend { font-weight: 650; font-size: .84rem; margin-bottom: 6px; }
.platform-select label { display: flex; align-items: center; gap: 5px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; }
.platform-select input { accent-color: var(--accent); margin: 0; }
summary { cursor: pointer; width: max-content; max-width: 100%; font-size: .86rem; font-weight: 650; }
details > .fields { margin-top: 9px; }
.shortcut-list { display: grid; gap: 9px; }
.shortcut-fields { display: grid; grid-template-columns: minmax(0, .7fr) minmax(0, 1fr) auto; align-items: end; gap: 8px; padding-top: 9px; }
.shortcut-fields button { min-height: 38px; }
.add-link { margin-top: 9px; }
.form-actions { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.form-error { padding: 7px 9px; background: var(--hot-bg); border-radius: 6px; color: var(--hot); font-size: .84rem; }

.sign { min-height: 100vh; display: grid; justify-items: center; align-content: center; gap: 20px; padding: 24px; background: var(--paper); }
.sign .panel { width: min(100%, 410px); min-width: 0; padding: 24px; }
.sign h1 { font-size: 1.55rem; margin: 0 0 12px; }
.sign .btn { width: 100%; }
.sign .text-btn { margin-top: 12px; }
.toast { position: fixed; z-index: 5; right: 16px; bottom: 16px; max-width: min(395px, calc(100% - 32px)); background: var(--rail); color: #f8fafc; border: 1px solid var(--rail-border); padding: 11px 14px; border-radius: 9px; overflow-wrap: anywhere; }

@media (max-width: 1160px) {
  .shell { grid-template-columns: 208px minmax(0, 1fr); }
  .content { padding-inline: 18px; }
  .heads, .profile-row {
    gap: 8px;
    grid-template-columns: minmax(130px, 1.15fr) minmax(105px, .85fr) minmax(95px, .8fr) minmax(78px, .52fr) minmax(74px, .52fr) minmax(112px, .68fr);
  }
}
@media (min-width: 641px) and (max-width: 1000px) {
  .heads, .profile-row {
    grid-template-columns: minmax(0, 1.28fr) minmax(0, .9fr) minmax(0, .86fr) minmax(0, .68fr) minmax(0, .7fr) minmax(0, .7fr);
  }
}
@media (max-width: 840px) {
  .shell { display: block; }
  .rail { min-height: auto; padding: 12px 14px 10px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; border-right: 0; border-bottom: 1px solid var(--rail-border); }
  .workspaces { padding: 0; }
  .rail-label { margin-bottom: 4px; }
  .workspace { min-height: 34px; padding-block: 6px; }
  .nav { display: flex; flex-wrap: wrap; grid-column: 1 / -1; gap: 3px; }
  .nav button { min-height: 36px; padding: 5px 8px; gap: 5px; font-size: .8rem; }
  .nav button[aria-current="page"] { box-shadow: inset 0 -2px var(--accent); }
  .rail-groups, .rail-bottom { display: none; }
  .content { padding: 18px 14px 32px; }
  .crumb { margin-bottom: 14px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .metric { padding: 10px 10px; }
  .metric span { font-size: .74rem; line-height: 1.2; min-height: 18px; }
  .metrics { gap: 7px; margin-bottom: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metrics.three-col { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .topline { gap: 10px; margin-bottom: 14px; }
  .stage[data-screen="profiles"] .topline .sub { display: none; }
  .stage[data-screen="profiles"] .crumb { margin-bottom: 10px; }
  .page-actions .btn { min-height: 36px; }
  .heads { display: none; }
  .profile-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 12px 11px; }
  .profile-row .identity, .profile-row .route-col, .profile-row .platforms, .profile-row .row-actions { grid-column: 1 / -1; }
  .profile-actions .btn { min-height: 38px; }
  .compact-profiles .profile-row { padding-block: 8px; }
  button.platform { min-width: 36px; min-height: 36px; }
  .network-head { display: none; }
  .network-row { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px 11px; }
  .network-row .row-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .shortcut-fields, .fields { grid-template-columns: minmax(0, 1fr); }
  .row-actions { justify-content: stretch; gap: 6px; }
  .row-actions > .btn { flex: 1 1 0; }
  .settings { grid-template-columns: 1fr; }
  .tools { padding: 10px; gap: 8px; }
}
a.btn { text-decoration: none; }
.rail-connect { width: 100%; }
.pc-offline-bar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 14px;
  margin-bottom: 14px; padding: 11px 14px; border-radius: 6px;
  background: var(--warn-bg); border: 1px solid var(--warn); color: var(--ink); font-size: .84rem;
}
.pc-offline-bar strong { color: var(--warn); }
