/* Shared design system for the admin console and the customer dashboard. It follows the public website
   (web/app/globals.css and pages.css): ink canvas, one electric-blue accent, green for healthy state, Plus
   Jakarta Sans for text and JetBrains Mono for figures and identifiers. */
@font-face {
  font-family: 'Plus Jakarta Sans Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url('/ui/fonts/plus-jakarta-sans.woff2') format('woff2-variations');
}
@font-face {
  font-family: 'JetBrains Mono Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url('/ui/fonts/jetbrains-mono.woff2') format('woff2-variations');
}
:root {
  --bg: #08090e;
  --bg-2: #0b0d14;
  --surface: #10131b;
  --surface-2: #141824;
  --surface-3: #1b2030;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.1);
  --line-3: rgba(255, 255, 255, 0.17);
  --text: #f3f5fb;
  --text-2: #9aa3b8;
  --text-3: #7d869c;
  --text-4: #4a5063;
  --brand: #3366ff;
  --brand-hover: #4d7bff;
  --brand-2: #8eaaff;
  --brand-text: #9db5ff;
  --brand-soft: rgba(51, 102, 255, 0.14);
  --brand-line: rgba(51, 102, 255, 0.45);
  --grad-btn: linear-gradient(180deg, #4673ff 0%, #3366ff 100%);
  --glow: 0 0 0 1px rgba(51, 102, 255, 0.4), 0 12px 44px -10px rgba(51, 102, 255, 0.6);
  --up: #3ee08f;
  --up-soft: rgba(62, 224, 143, 0.13);
  --down: #ff6b6b;
  --down-soft: rgba(255, 107, 107, 0.13);
  --warn: #f7b955;
  --warn-soft: rgba(247, 185, 85, 0.13);
  --info: #6fc3ff;
  --r: 12px;
  --r-lg: 18px;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 24px 60px -20px rgba(0, 0, 4, 0.85);
  --mono: 'JetBrains Mono Variable', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --sans: 'Plus Jakarta Sans Variable', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: dark;
}

/* ------------------------------------------------------------------ base */
*,
*::before,
*::after {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html {
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}
button {
  border: 0;
  background: none;
  padding: 0;
  transition:
    background 0.15s ease-out,
    color 0.15s ease-out,
    border-color 0.15s ease-out,
    box-shadow 0.15s ease-out;
}
button:not(:disabled),
summary,
select {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
a {
  color: inherit;
  text-decoration: none;
}
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--brand-2);
  outline-offset: 2px;
  border-radius: 6px;
}
::selection {
  background: rgba(51, 102, 255, 0.45);
  color: #fff;
}
h1,
h2,
h3,
h4,
p,
ul,
ol,
dl,
figure {
  margin: 0;
}
h1,
h2,
h3,
h4 {
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.022em;
  line-height: 1.12;
}
h1 {
  font-size: clamp(1.9rem, 3vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.035em;
}
h2 {
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}
h3 {
  font-size: 1rem;
  letter-spacing: -0.015em;
}
p {
  color: var(--text-2);
  line-height: 1.6;
}
small {
  font-size: 0.78rem;
}
code,
pre,
kbd,
.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
code {
  font-size: 0.82em;
}
pre {
  margin: 0;
}
svg {
  flex-shrink: 0;
}
* {
  scrollbar-width: thin;
  scrollbar-color: #232a3b transparent;
}
.sr-only,
.copy-buffer {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.skip {
  position: fixed;
  left: 1rem;
  top: -100px;
  z-index: 1000;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  padding: 0.5rem 1rem;
  border-radius: 8px;
}
.skip:focus {
  top: 8px;
}
.muted,
.hint {
  color: var(--text-2);
}
.hint {
  font-size: 0.8rem;
}
.sub {
  margin-top: 2px;
  color: var(--text-3);
  font-size: 0.74rem;
  font-family: var(--mono);
  overflow-wrap: anywhere;
}
.accent {
  color: var(--brand-text);
}
.good {
  color: var(--up);
}
.bad {
  color: #ffb3b3;
}
.warn-text {
  color: #f9cf85;
}
.stack {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  min-width: 0;
}
.actions,
.inline {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.grid-2,
.grid-3 {
  display: grid;
  gap: 18px;
  min-width: 0;
}
.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.span-2 {
  grid-column: span 2;
}

/* ------------------------------------------------------------------ brand */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.04em;
  line-height: 1;
}
.brand img {
  width: 26px;
  height: 26px;
}
.brand .tag {
  margin-left: 2px;
  letter-spacing: 0;
}

/* ------------------------------------------------------------------ buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.button,
.button.primary {
  background-color: var(--brand);
  background-image: var(--grad-btn);
  color: #fff;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.22) inset,
    0 10px 30px -12px rgba(51, 102, 255, 0.8);
}
.button:hover:not(:disabled) {
  background-color: var(--brand-hover);
  background-image: none;
  box-shadow: var(--glow);
}
.button.secondary {
  background: rgba(255, 255, 255, 0.035);
  border-color: var(--line-2);
  color: var(--text);
  box-shadow: none;
}
.button.secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--line-3);
  box-shadow: none;
}
.button.ghost {
  background: none;
  color: var(--text-2);
  box-shadow: none;
}
.button.ghost:hover:not(:disabled) {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: none;
}
.button.danger {
  background: rgba(255, 107, 107, 0.12);
  color: #ffb3b3;
  border-color: rgba(255, 107, 107, 0.4);
  box-shadow: none;
}
.button.danger:hover:not(:disabled) {
  background: rgba(255, 107, 107, 0.2);
  box-shadow: none;
}
.button.small {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 0.8rem;
}
.button.wide {
  width: 100%;
}
.icon-button {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  min-height: 34px;
  border-radius: 8px;
  color: var(--text-2);
}
.icon-button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}
.text-link,
button.link {
  color: var(--brand-text);
  font-weight: 600;
}
.text-link:hover,
button.link:hover {
  color: #c4d3ff;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.text-link svg {
  vertical-align: -2px;
  margin-left: 3px;
}

/* ------------------------------------------------------------------ eyebrow, badges */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-text);
}
.badge,
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  line-height: 1.6;
  padding: 1px 8px;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.04);
  color: #c2c9d8;
}
.badge.brand {
  color: var(--brand-text);
  background: var(--brand-soft);
  border-color: rgba(51, 102, 255, 0.35);
}
.badge.ok {
  color: var(--up);
  background: var(--up-soft);
  border-color: rgba(62, 224, 143, 0.32);
}
.badge.warn {
  color: #f9cf85;
  background: var(--warn-soft);
  border-color: rgba(247, 185, 85, 0.32);
}
.badge.error {
  color: #ffb3b3;
  background: var(--down-soft);
  border-color: rgba(255, 107, 107, 0.34);
}
.badge.info {
  color: #a9d8ff;
  background: rgba(111, 195, 255, 0.12);
  border-color: rgba(111, 195, 255, 0.3);
}
.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-4);
}
.dot.ok {
  background: var(--up);
  box-shadow: 0 0 8px rgba(62, 224, 143, 0.7);
}
.dot.warn {
  background: var(--warn);
}
.dot.error {
  background: var(--down);
  box-shadow: 0 0 8px rgba(255, 107, 107, 0.6);
}

/* ------------------------------------------------------------------ cards, panels, stats */
.panel,
.table-wrap,
.card {
  min-width: 0;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: var(--surface);
}
.panel,
.card {
  padding: 22px;
}
.table-wrap {
  overflow: hidden;
}
.panel > h2,
.panel-head h2 {
  font-size: 1.05rem;
}
.panel-head,
.section-row,
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 14px;
}
.panel-head {
  margin-bottom: 16px;
}
/* A panel that is mostly a table: the heading sits in the box, the table runs edge to edge below it. */
.panel-head.flush {
  margin: 0;
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--line-2);
}
.table-wrap .table-wrap {
  border: 0;
  border-radius: 0;
  background: transparent;
}
.panel-head p {
  margin-top: 4px;
  font-size: 0.84rem;
}
.toolbar {
  margin-bottom: 14px;
}
.section-row {
  margin: 30px 0 14px;
}
.section-row:first-child {
  margin-top: 0;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  background: var(--line);
  overflow: hidden;
}
.stat {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  padding: 18px 20px;
  background: var(--surface);
}
.stat small {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-2);
}
.stat small svg {
  color: var(--text-3);
}
.stat strong {
  font-size: clamp(1.45rem, 2.3vw, 1.95rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.stat span {
  font-size: 0.78rem;
  color: var(--text-2);
}
.stat .spark {
  height: 30px;
  margin-top: 2px;
}
.kv {
  display: grid;
  font-size: 0.86rem;
}
.kv > div {
  display: grid;
  grid-template-columns: minmax(110px, 0.6fr) minmax(0, 1.2fr);
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.kv > div:last-child {
  border-bottom: 0;
}
.kv dt {
  color: var(--text-2);
}
.kv dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.meter {
  display: grid;
  gap: 6px;
}
.meter-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.84rem;
}
.meter-head strong {
  font-variant-numeric: tabular-nums;
}
.bar {
  height: 7px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}
.bar > i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
}
.bar.warn > i {
  background: var(--warn);
}
.bar.error > i {
  background: var(--down);
}

/* ------------------------------------------------------------------ tables */
.table-scroll {
  max-width: 100%;
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.84rem;
}
th,
td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
th {
  background: #121624;
  color: var(--text-2);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
td {
  color: #c3c9d6;
}
td.num,
th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
td.wrap {
  min-width: 14rem;
  max-width: 32rem;
  overflow-wrap: anywhere;
}
td strong {
  color: var(--text);
  font-weight: 600;
}
tbody tr:hover td {
  background: rgba(255, 255, 255, 0.015);
}
tbody tr.clickable {
  cursor: pointer;
}
tbody tr.clickable:hover td {
  background: rgba(51, 102, 255, 0.06);
}
tr:last-child td {
  border-bottom: 0;
}
.row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}
.error-text {
  color: #ffb3b3;
  font-family: var(--mono);
  font-size: 0.76rem;
  overflow-wrap: anywhere;
}
.code-text {
  display: block;
  max-height: 96px;
  overflow: auto;
  font-size: 0.74rem;
  color: var(--text-2);
  overflow-wrap: anywhere;
}

/* ------------------------------------------------------------------ forms */
.field {
  display: grid;
  gap: 6px;
  min-width: 0;
  font-size: 0.84rem;
  font-weight: 600;
}
.field small {
  color: var(--text-2);
  font-size: 0.76rem;
  font-weight: 400;
}
.field input:not([type='checkbox']):not([type='radio']),
.field select,
.field textarea,
input.control,
select.control {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.3);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 450;
}
.field input:hover,
.field select:hover,
.field textarea:hover,
input.control:hover {
  border-color: var(--line-3);
}
.field input:focus,
.field select:focus,
.field textarea:focus,
input.control:focus,
select.control:focus {
  border-color: var(--brand-line);
  box-shadow: 0 0 0 3px rgba(51, 102, 255, 0.16);
  outline: none;
}
.field input::placeholder,
input.control::placeholder {
  color: var(--text-3);
}
.field select,
select.control {
  appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' stroke='%239aa3b8' fill='none' stroke-width='1.6'%3E%3Cpath d='m5 8 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 15px;
}
select option {
  background: var(--surface-2);
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  align-items: end;
}
.form-stack {
  display: grid;
  gap: 14px;
}
.search {
  position: relative;
  min-width: min(340px, 100%);
}
.search svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
}
.search input.control {
  padding-left: 34px;
}
.segmented {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
}
.segmented button {
  padding: 5px 12px;
  border-radius: 7px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-2);
}
.segmented button:hover {
  color: var(--text);
}
.segmented button[aria-pressed='true'] {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text);
}

/* ------------------------------------------------------------------ notices, toasts, empty states */
.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(51, 102, 255, 0.3);
  border-radius: 10px;
  background: rgba(51, 102, 255, 0.08);
  font-size: 0.86rem;
  color: #c9d5f5;
}
.notice svg {
  margin-top: 2px;
  color: var(--brand-text);
}
.notice.ok {
  border-color: rgba(62, 224, 143, 0.3);
  background: rgba(62, 224, 143, 0.07);
  color: #c4f2da;
}
.notice.ok svg {
  color: var(--up);
}
.notice.warn {
  border-color: rgba(247, 185, 85, 0.32);
  background: rgba(247, 185, 85, 0.07);
  color: #f6dfb5;
}
.notice.warn svg {
  color: var(--warn);
}
.notice.error {
  border-color: rgba(255, 107, 107, 0.34);
  background: rgba(255, 107, 107, 0.08);
  color: #ffd0d0;
}
.notice.error svg {
  color: var(--down);
}
.status:empty {
  display: none;
}
.status.ok {
  color: var(--up);
}
.status.error {
  color: #ffb3b3;
}
.alerts {
  display: grid;
  gap: 8px;
}
.toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  display: grid;
  gap: 8px;
  max-width: min(420px, calc(100vw - 40px));
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line-3);
  border-radius: 12px;
  background: var(--surface-2);
  box-shadow: var(--shadow);
  font-size: 0.86rem;
  animation: toast-in 0.18s ease-out;
}
.toast svg {
  margin-top: 2px;
  color: var(--up);
}
.toast.error svg {
  color: var(--down);
}
@keyframes toast-in {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
}
.empty {
  padding: 36px 16px;
  text-align: center;
  color: var(--text-3);
  font-size: 0.86rem;
}
.empty > svg {
  display: block;
  margin: 0 auto 10px;
  color: var(--brand-text);
}
.empty strong {
  display: block;
  color: var(--text);
  font-size: 0.95rem;
}
.loading-line {
  height: 2px;
  margin: -1px 0 0;
  background: linear-gradient(90deg, transparent, var(--brand), transparent);
  background-size: 40% 100%;
  background-repeat: no-repeat;
  animation: sweep 1.1s linear infinite;
}
@keyframes sweep {
  from {
    background-position: -40% 0;
  }
  to {
    background-position: 140% 0;
  }
}
.spin {
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ------------------------------------------------------------------ charts */
.chart {
  position: relative;
  min-width: 0;
}
.chart svg {
  display: block;
  width: 100%;
  overflow: visible;
}
.chart .grid line {
  stroke: rgba(255, 255, 255, 0.06);
}
.chart .axis text {
  fill: var(--text-3);
  font: 10px var(--mono);
}
.chart .tip {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  padding: 8px 10px;
  border: 1px solid var(--line-3);
  border-radius: 9px;
  background: rgba(16, 19, 27, 0.96);
  box-shadow: var(--shadow);
  font-size: 0.76rem;
  white-space: nowrap;
}
.chart .tip .swatch {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 2px;
}
.chart .tip b {
  display: block;
  margin-bottom: 3px;
  color: var(--text-2);
  font-weight: 600;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 10px;
  font-size: 0.76rem;
  color: var(--text-2);
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.legend i {
  display: inline-block;
  width: 10px;
  height: 3px;
  border-radius: 2px;
}
.uptime-strip {
  display: flex;
  gap: 2px;
  height: 26px;
}
.uptime-strip i {
  flex: 1;
  border-radius: 2px;
  background: var(--up);
  opacity: 0.85;
}
.uptime-strip i.partial {
  background: var(--warn);
}
.uptime-strip i.down {
  background: var(--down);
}
.uptime-strip i.none {
  background: rgba(255, 255, 255, 0.07);
}

/* ------------------------------------------------------------------ workspace shell */
.work-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  align-items: start;
  min-height: 100vh;
}
.work-sidebar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 18px 14px 16px;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: var(--bg-2);
}
.side-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 36px;
  padding: 0 6px;
}
.side-label {
  display: block;
  margin: 22px 10px 6px;
  font: 700 0.66rem / 1.6 var(--sans);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}
.work-sidebar nav {
  display: grid;
  gap: 1px;
}
.work-sidebar nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text-2);
}
.work-sidebar nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}
.work-sidebar nav a svg {
  color: var(--text-3);
}
.work-sidebar nav a[aria-current='page'] {
  color: var(--text);
  background: var(--brand-soft);
  font-weight: 600;
}
.work-sidebar nav a[aria-current='page']::before {
  content: '';
  position: absolute;
  left: -14px;
  top: 7px;
  bottom: 7px;
  width: 2px;
  border-radius: 2px;
  background: var(--brand);
}
.work-sidebar nav a[aria-current='page'] svg {
  color: var(--brand-text);
}
.nav-count {
  margin-left: auto;
  min-width: 20px;
  padding: 0 6px;
  border-radius: 99px;
  background: var(--down-soft);
  color: #ffb3b3;
  font: 600 0.68rem/1.6 var(--mono);
  text-align: center;
}
.nav-count.info {
  background: var(--brand-soft);
  color: var(--brand-text);
}
.side-bottom {
  display: grid;
  gap: 4px;
  margin-top: auto;
  padding: 18px 4px 2px;
  font-size: 0.78rem;
  color: var(--text-2);
}
.side-bottom a,
.side-bottom button {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border-radius: 7px;
  text-align: left;
}
.side-bottom a:hover,
.side-bottom button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}
.work-page {
  min-width: 0;
}
.work-top {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 60px;
  padding-inline: clamp(18px, 3.5vw, 44px);
  border-bottom: 1px solid var(--line);
  background: rgba(8, 9, 14, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.crumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  font-size: 0.8rem;
  color: var(--text-3);
}
.crumbs a:hover {
  color: var(--text);
}
.crumbs [aria-current] {
  color: var(--text-2);
}
.crumbs svg {
  color: var(--text-4);
}
.work-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}
.avatar {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(51, 102, 255, 0.45);
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-text);
  font: 700 0.8rem var(--sans);
  text-transform: uppercase;
}
.who {
  display: grid;
  line-height: 1.25;
  text-align: right;
  font-size: 0.8rem;
}
.who small {
  color: var(--text-3);
  font-size: 0.7rem;
}
.work-banner {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  padding: 6px clamp(18px, 3.5vw, 44px);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(51, 102, 255, 0.12), rgba(51, 102, 255, 0.03));
  font-size: 0.78rem;
  color: #c9d5f5;
}
.work-banner svg {
  color: var(--brand-text);
}
.work-content {
  max-width: 1440px;
  margin: auto;
  padding: 26px clamp(18px, 3.5vw, 44px) 72px;
}
.work-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px 24px;
  margin: 8px 0 26px;
}
.work-heading p {
  max-width: 720px;
  margin-top: 8px;
  font-size: 0.94rem;
}
.work-menu,
.side-close,
.side-overlay {
  display: none;
}

/* ------------------------------------------------------------------ signed-out pages */
.auth-page {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 48px 20px;
  overflow: hidden;
  isolation: isolate;
}
.auth-page::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.11) 1px, transparent 1.4px);
  background-size: 20px 20px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 20%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 20%, transparent 72%);
}
.auth-wrap {
  display: grid;
  gap: 22px;
  width: min(440px, 100%);
}
.auth-wrap.wide {
  width: min(560px, 100%);
}
.auth-form {
  display: grid;
  gap: 16px;
  padding: 30px;
  border: 1px solid var(--line-2);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.auth-form h1 {
  margin-top: 8px;
  font-size: clamp(1.7rem, 3vw, 2.1rem);
}
.auth-form .lede {
  margin-top: 8px;
  font-size: 0.93rem;
}
.auth-form h2 {
  margin-top: 6px;
  font-size: 0.98rem;
}
.auth-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 14px;
  font-size: 0.84rem;
  color: var(--text-2);
}
.qr {
  width: 200px;
  padding: 10px;
  border-radius: 12px;
  background: #fff;
}
.qr svg {
  display: block;
  width: 100%;
  height: auto;
}
.secret-text {
  display: block;
  padding: 10px 12px;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.3);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  overflow-wrap: anywhere;
  user-select: all;
}
details summary {
  color: var(--brand-text);
  font-size: 0.84rem;
  font-weight: 600;
}
details[open] summary {
  margin-bottom: 10px;
}
ol.codes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
  gap: 8px 28px;
  margin: 0;
  padding: 14px 16px 14px 40px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
  color: var(--text-3);
  font-family: var(--mono);
  font-size: 0.86rem;
}
ol.codes code {
  color: var(--text);
  font-size: 1em;
}
.secret-box {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid rgba(247, 185, 85, 0.32);
  border-radius: 12px;
  background: rgba(247, 185, 85, 0.06);
}
.secret-box input {
  font-family: var(--mono) !important;
}

/* ------------------------------------------------------------------ dialogs */
dialog {
  width: min(520px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line-3);
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}
dialog::backdrop {
  background: rgba(3, 4, 8, 0.72);
  backdrop-filter: blur(3px);
}
dialog form {
  display: grid;
  gap: 14px;
  padding: 24px;
}
dialog h2 {
  font-size: 1.15rem;
}
dialog.wide {
  width: min(720px, calc(100vw - 32px));
}
dialog .actions {
  justify-content: flex-end;
  margin-top: 4px;
}
.drawer {
  margin: 0 0 0 auto;
  width: min(760px, 100vw);
  height: 100vh;
  max-height: 100vh;
  border-radius: 0;
  border-width: 0 0 0 1px;
}
.drawer-body {
  display: grid;
  gap: 18px;
  padding: 24px;
}
.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1100px) {
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 900px) {
  .work-shell {
    grid-template-columns: minmax(0, 1fr);
  }
  .work-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 270px;
    transform: translateX(-100%);
    transition: transform 0.2s ease-out;
  }
  .work-sidebar.open {
    transform: none;
    box-shadow: var(--shadow);
  }
  .side-overlay.open {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(3, 4, 8, 0.6);
  }
  .work-menu,
  .side-close {
    display: inline-grid;
  }
  .grid-2,
  .grid-3 {
    grid-template-columns: minmax(0, 1fr);
  }
  .span-2 {
    grid-column: auto;
  }
  .who {
    display: none;
  }
}
@media (max-width: 560px) {
  .auth-form {
    padding: 22px;
  }
  .kv > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }
}

/* ---------------------------------------------------------------- link cards */
.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
}
.link-card {
  position: relative;
  display: grid;
  gap: 2px;
  padding: 14px 36px 14px 16px;
  color: var(--text);
  text-decoration: none;
}
.link-card:hover {
  border-color: var(--brand-line);
}
.link-card svg {
  position: absolute;
  top: 15px;
  right: 14px;
  color: var(--text-3);
}
.code-block {
  margin: 4px 0 14px;
  padding: 14px 16px;
  overflow-x: auto;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  color: #cfd8ff;
  font-size: 0.86rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
}
