/* ==========================================================================
   Satcore SmokePing — base design system
   Dark only. Look and tokens follow satcore.net (assets/css/main.css) and
   the Satcore NetOps panel. Page specifics live in public.css / admin.css.

   Component index
   --------------------------------------------------------------------------
   Tokens ........ :root (--bg … --ease-out verbatim from satcore, + --amber,
                   --maxw, --header-h, --gutter, --font-*, --h-*, --z-*)
   Fonts ......... Inter 400–700, Inter Tight 500–700 (latin + latin-ext)
   Base .......... reset, body, plum glow (body bg + body::after dot grid),
                   grain (body::before), focus-visible, scrollbars, .skip-link
   Layout ........ .container .app-main .app-main-admin .page .section
                   .section-head .rule .grid .grid-2 .grid-3 .grid-4
                   .grid-auto(--min) .stack .row .wrap .between .grow .divider
   Type .......... h1–h4 .eyebrow .kicker .page-title .page-title-sm .h2 .h3
                   .text-gradient .lead .small .xsmall .link .link-arrow
                   .back-link .meta-line(.sep) .hint
   Page head ..... .page-head .page-head-row
   Header ........ .site-header(.scrolled) .header-inner .brand
                   .brand-label .header-actions .lang-link .lbl-long
                   .lbl-short
   App bar ....... .app-bar .app-bar-inner .app-bar-actions .app-user
                   .app-tabs .user-pill
   Footer ........ .site-footer .ft-grid .ft-brand .ft-desc .ft-head .ft-dl .ft-bottom .app-foot
   Buttons ....... .btn .btn-primary .btn-ghost .btn-outline .btn-danger
                   .btn-quiet .btn-sm .btn-xs .btn-icon .btn-block
                   .btn.is-loading .btn-group
   Cards ......... .card .card-flush .card-head .card-title .card-sub
                   .card-body .card-foot .card-link .card-inset
   Stat tiles .... .stats(--stat-min) .stats-plain .stat .stat-label
                   .stat-num(.unit) .stat-sub .stat-lg
   Segmented ..... .seg .seg-btn(.count) .seg-sm .seg-scroll
   Forms ......... .field .field-label .field-hint .field-error .has-error
                   .input .select .textarea .input-sm .search .input-group
                   .form-grid(.span-2) .form-section .check
   Switch ........ .switch .switch-track .switch-label .switch-sm .is-busy
   Tables ........ .table-wrap .table .table-compact .table-sticky .num
                   .col-shrink .sub tr.is-link tr.is-muted .drag-handle
                   tr.is-dragging tr.drop-before tr.drop-after
   Status ........ .st-ok .st-warn .st-down .st-unknown (set --st)
                   .dot .dot-lg .dot-pulse .pill .pill-lg .badge
                   .badge-muted .as-badge
   Alerts ........ .alert .alert-error .alert-warn .alert-info .alert-success
                   .alert-body .alert-title .alert-actions
   Tabs .......... .tabs .tab .tabs-line
   Toolbar ....... .toolbar .toolbar-grow .toolbar-group .toolbar-end
   Dialog ........ dialog.modal .modal-sm .modal-lg .modal-head .modal-title
                   .modal-close .modal-body .modal-foot
   Toasts ........ .toast-stack .toast .toast-success|error|warn|info
                   .toast-icon .toast-body .toast-title .toast-msg
                   .toast-close
   Tooltips ...... .chart-tip(.is-visible) .chart-tip-time .chart-tip-row
                   .chart-tip-sep .tip[data-tip]
   Legend ........ .legend .legend-item .swatch .swatch-line
   Skeleton ...... .skel .skel-text .skel-title .skel-num .skel-block
                   .skel-card .skel-circle
   Empty state ... .empty .empty-icon .empty-title .empty-text
   Lists ......... .list .list-row(.is-link) .list-main .list-meta .meter .kv
                   del/ins (old → new values)
   Misc .......... .spinner .spark-canvas .flag .live .kbd .is-busy
   Utilities ..... .muted .c-heading .c-text .c-cream .c-gold .c-gold-soft
                   .c-green .c-amber .c-red .mono .tnum .nowrap .truncate
                   .sr-only .text-left .text-right .text-center .w-full
                   .fw-500 .fw-600 .fw-700 .mt-0…6 .mb-0…6 .gap-1…6
                   .hide-sm .show-sm
   ========================================================================== */

/* ── Tokens ──────────────────────────────────────────────────────────────── */
:root {
  --bg: #0e080b;
  --bg-alt: #130a0f;
  --surface: #1a0f15;
  --shot-bg: #160c0f;
  --line: rgba(255, 236, 222, 0.08);
  --line-strong: rgba(255, 236, 222, 0.14);
  --plum: #572947;
  --plum-glow: rgba(122, 57, 99, 0.38);
  --gold: #c99762;
  --gold-soft: #e2bd8f;
  --gold-a10: rgba(201, 151, 98, 0.10);
  --gold-a20: rgba(201, 151, 98, 0.20);
  --gold-a35: rgba(201, 151, 98, 0.35);
  --heading: #f6ece2;
  --cream: #e3c9ae;
  --text: #bba596;
  --muted: #8e7880;
  --green: #62c28a;
  --red: #e2636f;
  --amber: #e8a54b;
  --on-gold: #1c0e16;

  --radius-lg: 20px;
  --radius: 14px;
  --radius-sm: 10px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  --maxw: 1320px;
  --header-h: 72px;
  --gutter: clamp(1rem, 4vw, 2.5rem);

  /* control heights: inputs, buttons and segmented controls line up */
  --h-md: 44px;
  --h-sm: 38px;
  --h-xs: 30px;

  --z-header: 200;
  --z-grain: 250;
  --z-toast: 300;
  --z-skip: 400;

  --font-display: 'Inter Tight', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;

  color-scheme: dark;
  accent-color: var(--gold);
}

/* ── Fonts (self-hosted variable woff2, Google unicode-range split) ───────── */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/inter-latin.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: 'Inter Tight';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url('../fonts/intertight-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter Tight';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url('../fonts/intertight-latin.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;
}

/* ── Base ────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* No background on <html>: the body background (colour + plum glow) then
   propagates to the canvas, which also keeps iOS rubber-band areas dark and
   lets the z-index:-1 dot grid below paint above it. */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + env(safe-area-inset-top, 0px) + 16px);
  scrollbar-color: rgba(122, 57, 99, 0.85) transparent;
}
html:has(dialog.modal[open]) { overflow: hidden; }

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 900px 540px at 14% -140px, rgba(122, 57, 99, 0.36) 0%, transparent 72%),
    radial-gradient(ellipse 680px 420px at 86% -110px, rgba(201, 151, 98, 0.075) 0%, transparent 70%);
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

/* Faint dot grid under the glow, like satcore's .hero-bg::after. */
body::after {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0 0 auto 0;
  height: 640px;
  pointer-events: none;
  opacity: 0.55;
  background-image: radial-gradient(rgba(255, 236, 222, 0.08) 1px, transparent 1.3px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(ellipse 62% 78% at 64% 0%, #000 12%, transparent 74%);
  mask-image: radial-gradient(ellipse 62% 78% at 64% 0%, #000 12%, transparent 74%);
}

/* Subtle grain so large flat fields don't read as one dead-flat wash —
   static, no animation, negligible paint cost. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: var(--z-grain);
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img, canvas { display: block; max-width: 100%; }
/* Icons carry explicit sizes and must never be squeezed by a flex parent. */
svg { display: block; flex-shrink: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
ul, ol { list-style: none; }
table { border-collapse: collapse; }
p { text-wrap: pretty; }
strong, b { font-weight: 600; color: var(--heading); }
code, kbd, samp { font-family: var(--font-mono); font-size: 0.92em; }
[hidden] { display: none !important; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.012em;
  color: var(--heading);
}
h1 { font-size: 2rem; font-weight: 700; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; }
h4 { font-size: 1rem; }

::selection { background: rgba(201, 151, 98, 0.35); color: #fff; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(122, 57, 99, 0.85); border-radius: 4px; }

.skip-link {
  position: fixed;
  top: calc(0.75rem + env(safe-area-inset-top, 0px));
  left: max(0.75rem, env(safe-area-inset-left, 0px));
  z-index: var(--z-skip);
  padding: 0.6rem 1rem;
  border-radius: 10px;
  background: var(--gold);
  color: var(--on-gold);
  font-weight: 600;
}
.skip-link:not(:focus) {
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  white-space: nowrap;
  clip-path: inset(50%);
  opacity: 0;
  pointer-events: none;
}

/* ── Layout ──────────────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
}

/* Public pages: the header is fixed, so main clears it. */
.app-main {
  flex: 1 0 auto;
  width: 100%;
  padding-top: calc(var(--header-h) + env(safe-area-inset-top, 0px) + clamp(1.75rem, 4vw, 3rem));
  padding-bottom: clamp(3rem, 7vw, 5rem);
}
.app-main:focus { outline: none; }
/* Admin: the app bar is sticky (in flow), so only breathing room. */
.app-main-admin { padding-top: clamp(1.5rem, 3vw, 2.25rem); }

.page { display: grid; gap: clamp(1.5rem, 3vw, 2.25rem); min-width: 0; }
.page > * { min-width: 0; }
.section { display: grid; gap: 1rem; min-width: 0; }
.section-head {
  display: flex;
  align-items: center;
  gap: 0.75rem 1rem;
  min-width: 0;
}
.section-head .kicker { min-width: 0; overflow-wrap: anywhere; }
/* Hairline that fills the remaining width, like NetOps "ATTACK ORIGIN ───". */
.rule { flex: 1 1 2rem; min-width: 1rem; height: 1px; background: var(--line); }

.grid { display: grid; gap: var(--gap, 1rem); }
.grid-2 { display: grid; gap: var(--gap, 1rem); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { display: grid; gap: var(--gap, 1rem); grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { display: grid; gap: var(--gap, 1rem); grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-auto {
  display: grid;
  gap: var(--gap, 1rem);
  grid-template-columns: repeat(auto-fill, minmax(min(var(--min, 270px), 100%), 1fr));
}
.stack { display: flex; flex-direction: column; gap: var(--gap, 0.75rem); min-width: 0; }
/* Grid/flex items default to min-width:auto, so one wide child (a long
   segmented filter, a table) would stretch the whole column past the
   container; let them shrink and scroll inside instead. */
.section > *,
.stack > *,
.grid > *,
.grid-2 > *,
.grid-3 > *,
.grid-4 > *,
.grid-auto > * { min-width: 0; }
.row { display: flex; align-items: center; gap: var(--gap, 0.5rem); min-width: 0; }
.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }
.divider { height: 1px; border: 0; background: var(--line); }

/* ── Typography ──────────────────────────────────────────────────────────── */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-size: clamp(0.98rem, 1.2vw, 1.1rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--gold);
}
.eyebrow svg { width: 18px; height: 18px; }

.kicker {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.page-title {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 4.6vw, 3.6rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.022em;
  color: var(--heading);
  text-wrap: balance;
}
.page-title-sm { font-size: clamp(1.65rem, 3.2vw, 2.4rem); line-height: 1.1; letter-spacing: -0.02em; }

.h2 {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2vw, 1.6rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.016em;
  color: var(--heading);
}
.h3 {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--heading);
}

.text-gradient {
  padding-bottom: 0.14em;
  margin-bottom: -0.14em;
  background: linear-gradient(180deg, #f3d6ae 0%, var(--gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.lead {
  max-width: 46rem;
  font-size: clamp(1.02rem, 1.35vw, 1.17rem);
  line-height: 1.6;
  letter-spacing: -0.006em;
  color: var(--text);
  text-wrap: pretty;
}
.lead strong { color: var(--heading); font-weight: 600; }

.small { font-size: 0.875rem; }
.xsmall { font-size: 0.78rem; }

.link {
  color: var(--gold);
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease;
}
.link:hover { color: var(--gold-soft); text-decoration: underline; text-underline-offset: 3px; }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  color: var(--gold);
}
.link-arrow svg { width: 16px; height: 16px; transition: transform 0.25s var(--ease-out); }
.link-arrow:hover { color: var(--gold-soft); }
.link-arrow:hover svg { transform: translateX(3px); }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  width: fit-content;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.2s ease;
}
.back-link svg { width: 16px; height: 16px; transition: transform 0.25s var(--ease-out); }
.back-link:hover { color: var(--gold-soft); }
.back-link:hover svg { transform: translateX(-3px); }

/* "host · 212.156.0.10 · İstanbul · group" */
.meta-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.6rem;
  min-width: 0;
  font-size: 0.92rem;
  color: var(--muted);
}
.meta-line > * { min-width: 0; overflow-wrap: anywhere; }
.meta-line .sep { color: var(--line-strong); }
.meta-line .mono { color: var(--text); }

.hint {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--muted);
}
.hint svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 0.12rem; color: var(--gold); }

/* ── Page head ───────────────────────────────────────────────────────────── */
.page-head { display: grid; justify-items: start; gap: 0.75rem; min-width: 0; }
.page-head > * { max-width: 100%; }
.page-head .lead { margin-top: 0.35rem; }
.page-head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem 2rem;
  width: 100%;
}

/* ── Header (public pages) ───────────────────────────────────────────────── */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: var(--z-header);
  height: calc(var(--header-h) + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  border-bottom: 1px solid transparent;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}
.site-header.scrolled {
  background: rgba(14, 8, 11, 0.74);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  backdrop-filter: saturate(160%) blur(18px);
  border-bottom-color: var(--line);
}
.header-inner {
  height: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 max(var(--gutter), env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
  margin-left: -3px;
  border-radius: 8px;
}
.brand img { height: 34px; width: auto; }
/* Small gold product label after the wordmark, like "NETOPS" in the panel. */
.brand-label {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  white-space: nowrap;
}

.header-actions { display: flex; align-items: center; gap: 0.6rem; flex-shrink: 0; margin-left: auto; }

.lang-link {
  display: grid;
  place-items: center;
  height: var(--h-sm);
  min-width: 42px;
  padding: 0 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--muted);
  transition: color 0.2s ease, border-color 0.2s ease;
}
.lang-link:hover { color: var(--heading); border-color: var(--line-strong); }
.lbl-short { display: none; }

/* ── App bar (admin) ─────────────────────────────────────────────────────── */
.app-bar {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  padding-top: env(safe-area-inset-top, 0px);
  background: rgba(14, 8, 11, 0.84);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  backdrop-filter: saturate(160%) blur(18px);
  border-bottom: 1px solid var(--line);
}
.app-bar-inner {
  max-width: var(--maxw);
  height: 64px;
  margin: 0 auto;
  padding: 0 max(var(--gutter), env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
  display: flex;
  align-items: center;
  gap: 1rem;
}
.app-bar .brand img { height: 32px; }
.app-bar-actions { display: flex; align-items: center; gap: 0.6rem; margin-left: auto; min-width: 0; }
.app-tabs {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 max(var(--gutter), env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px)) 0.55rem;
}
.app-tabs .tabs { margin-inline: -0.25rem; }
/* Filled by the admin app after sign-in (user pill, sign-out button). */
.app-user { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.app-user:empty { display: none; }

/* "kerim  ADMIN" — name plus a small role badge, like NetOps "satcore USER". */
.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  max-width: 16rem;
  height: var(--h-sm);
  padding: 0 0.5rem 0 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--heading);
  white-space: nowrap;
}
.user-pill > span:first-child { overflow: hidden; text-overflow: ellipsis; }
.user-pill svg { width: 15px; height: 15px; color: var(--muted); flex-shrink: 0; }

/* ── Footer ──────────────────────────────────────────────────────────────── */
.site-footer {
  position: relative;
  padding: clamp(2.5rem, 6vh, 3.5rem) 0 calc(1.75rem + env(safe-area-inset-bottom, 0px));
  background: #0a0508;
  border-top: 1px solid var(--line);
}
.ft-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem 3rem;
}
.ft-brand { min-width: 0; max-width: 30rem; }
/* Contact block, as in the satcore.net footer. */
.ft-head {
  margin-bottom: 0.9rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}
.ft-dl dt {
  margin-bottom: 0.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.ft-dl dd { font-size: 0.9rem; color: var(--text); }
.ft-dl dd a { transition: color 0.2s ease; }
.ft-dl dd a:hover { color: var(--gold); }
.ft-brand .brand img { height: 30px; opacity: 0.92; }
.ft-desc { margin-top: 0.9rem; font-size: 0.9rem; line-height: 1.6; color: var(--muted); }
.ft-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  margin-top: 2.25rem;
  padding-top: 1.35rem;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--muted);
}
.ft-bottom a { color: var(--text); transition: color 0.2s ease; }
.ft-bottom a:hover { color: var(--gold); }

/* Slim admin footer. */
.app-foot {
  padding: 1.25rem 0 calc(1.25rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--muted);
}
.app-foot .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1.5rem; }
.app-foot a:hover { color: var(--gold); }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
/* Bare .btn is the neutral (ghost) button; variants change the fill. */
.btn {
  --spin: var(--heading);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: var(--h-md);
  padding: 0 1.25rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.94rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.005em;
  color: var(--heading);
  white-space: nowrap;
  text-decoration: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.2s var(--ease-out), background-color 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}
.btn svg { width: 16px; height: 16px; transition: transform 0.25s var(--ease-out); }
.btn:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 236, 222, 0.26); }
.btn:hover .i-arrow-right { transform: translateX(3px); }
.btn:hover .i-external { transform: translate(2px, -2px); }
.btn:active { transform: scale(0.98); }

.btn-ghost { background: rgba(255, 255, 255, 0.04); border-color: var(--line-strong); color: var(--heading); }

.btn-primary {
  --spin: var(--on-gold);
  background: var(--gold);
  border-color: transparent;
  color: var(--on-gold);
  box-shadow: 0 10px 30px -12px rgba(201, 151, 98, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}
.btn-primary:hover {
  background: #d6a672;
  border-color: transparent;
  transform: translateY(-1px);
  box-shadow: 0 16px 40px -14px rgba(201, 151, 98, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.32);
}
.btn-primary:active { transform: scale(0.98); }

/* Gold outline, like the NetOps "Ruleset version" button. */
.btn-outline { --spin: var(--gold-soft); background: transparent; border-color: var(--gold-a35); color: var(--gold-soft); }
.btn-outline:hover { background: var(--gold-a10); border-color: rgba(201, 151, 98, 0.55); }

.btn-danger { --spin: var(--red); background: rgba(226, 99, 111, 0.06); border-color: rgba(226, 99, 111, 0.42); color: var(--red); }
.btn-danger:hover { background: rgba(226, 99, 111, 0.14); border-color: rgba(226, 99, 111, 0.65); color: #f08690; }

/* Text-only button (e.g. "Canlıya dön", toolbar secondary actions). */
.btn-quiet { background: transparent; border-color: transparent; color: var(--text); }
.btn-quiet:hover { background: rgba(255, 255, 255, 0.05); border-color: transparent; color: var(--heading); }

.btn-sm { height: var(--h-sm); padding: 0 1rem; font-size: 0.875rem; gap: 0.45rem; }
.btn-sm svg { width: 15px; height: 15px; }
.btn-xs { height: var(--h-xs); padding: 0 0.75rem; font-size: 0.8rem; gap: 0.35rem; }
.btn-xs svg { width: 14px; height: 14px; }

/* Icon-only: always give it an aria-label. */
.btn-icon { width: var(--h-md); padding: 0; }
.btn-sm.btn-icon { width: var(--h-sm); }
.btn-xs.btn-icon { width: var(--h-xs); }
.btn-block { width: 100%; }

/* No hover feedback at all on disabled buttons (a disabled gold button must
   not lift), hence pointer-events rather than a cursor. */
.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  pointer-events: none;
  transform: none;
  box-shadow: none;
}
.btn.is-loading { color: transparent !important; cursor: progress; opacity: 1; }
.btn.is-loading > * { visibility: hidden; }
.btn.is-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  width: 16px;
  height: 16px;
  margin: auto;
  border-radius: 50%;
  border: 2px solid var(--spin);
  border-right-color: transparent;
  animation: spin 0.7s linear infinite;
}

.btn-group { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
  --card-pad: clamp(1.1rem, 2vw, 1.5rem);
  position: relative;
  min-width: 0;
  padding: var(--card-pad);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01));
  transition: border-color 0.25s ease, background-color 0.25s ease;
}
.card:hover { border-color: rgba(201, 151, 98, 0.26); }
/* Flush cards hold tables/charts edge to edge; heads/feet keep the padding. */
.card-flush { padding: 0; overflow: hidden; }
.card-flush > .card-head { padding: var(--card-pad) var(--card-pad) 0; }
.card-flush > .card-foot { margin: 0; padding: 0.9rem var(--card-pad); }
.card-flush > .card-body { padding: var(--card-pad); }

.card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
  min-width: 0;
}
.card-flush > .card-head { margin-bottom: 1rem; }
.card-title {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--heading);
}
.card-sub { font-size: 0.85rem; color: var(--muted); }
.card-body { min-width: 0; }
.card-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--muted);
}

/* Whole-card links (dashboard target cards). Pointer-following glow like
   satcore's bento tiles; --mx/--my may be set from JS, defaults to top. */
.card-link { display: block; color: inherit; cursor: pointer; isolation: isolate; overflow: hidden; }
.card-link::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(201, 151, 98, 0.12), transparent 45%);
  transition: opacity 0.25s ease;
}
.card-link:hover::before,
.card-link:focus-visible::before { opacity: 1; }
.card-link:focus-visible { outline-offset: 3px; }

/* Recessed panel inside a card (NetOps side lists, MTR hints). */
.card-inset {
  min-width: 0;
  padding: 0.9rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.22);
}

/* ── Stat tiles ──────────────────────────────────────────────────────────── */
.stats {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--stat-min, 170px)), 1fr));
}
.stat {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
  padding: 1rem 1.15rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01));
  transition: border-color 0.25s ease;
}
.stat:hover { border-color: rgba(201, 151, 98, 0.26); }
.stat-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.stat-label > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-num {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.3vw, 2rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--heading);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.stat-num .unit {
  font-size: 0.5em;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--gold);
}
.stat-sub {
  min-width: 0;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.stat-lg .stat-num { font-size: clamp(1.9rem, 3.4vw, 2.7rem); }
/* Header-style stats without tiles (NetOps attack-log head): a wrapping
   row that also works as a shrink-to-fit flex item. */
.stats-plain { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 1rem 2.5rem; }
.stats-plain .stat { padding: 0; border: 0; background: none; }

/* ── Segmented control ───────────────────────────────────────────────────── */
.seg {
  position: relative; /* offsetParent for the JS that keeps the checked item in view */
  display: inline-flex;
  align-items: center;
  gap: 2px;
  max-width: 100%;
  height: var(--h-sm);
  padding: 3px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  vertical-align: middle;
  /* Never wider than its container: on a phone a 6-option range picker
     scrolls sideways instead of pushing the page wider. */
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.seg::-webkit-scrollbar { display: none; }
.seg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  flex-shrink: 0;
  height: 100%;
  padding: 0 0.85rem;
  border: 0;
  border-radius: 9px;
  background: transparent;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  color: var(--text);
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.seg-btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.seg-btn:hover { color: var(--heading); background: rgba(255, 255, 255, 0.05); }
.seg-btn:focus-visible { outline-offset: 1px; }
.seg-btn[aria-checked="true"],
.seg-btn[aria-pressed="true"],
.seg-btn[aria-selected="true"],
.seg-btn.is-active {
  background: var(--gold);
  color: var(--on-gold);
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 6px 18px -10px rgba(201, 151, 98, 0.75);
}
.seg-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.seg-btn .count {
  min-width: 1.4rem;
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.seg-btn[aria-checked="true"] .count,
.seg-btn[aria-pressed="true"] .count,
.seg-btn.is-active .count { background: rgba(28, 14, 22, 0.14); color: var(--on-gold); }
.seg-sm { height: 32px; }
.seg-sm .seg-btn { padding: 0 0.7rem; font-size: 0.82rem; border-radius: 8px; }
/* Many options (group filter): a full-width row that scrolls sideways. */
.seg-scroll { display: flex; }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.field { display: grid; align-content: start; gap: 0.45rem; min-width: 0; }
.field-label,
.field > label {
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--cream);
}
.field-label .opt { font-weight: 400; color: var(--muted); }
.field-hint { font-size: 0.8rem; line-height: 1.45; color: var(--muted); }
.field-error {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--red);
}
.field-error svg { width: 14px; height: 14px; flex-shrink: 0; margin-top: 0.15rem; }
.field-error:empty { display: none; }

/* Controls: .input/.select/.textarea anywhere, and bare controls inside
   .field. :where() keeps specificity at one class so modifiers win. */
.input,
.select,
.textarea,
:where(.field) :where(input:not([type="checkbox"], [type="radio"], [type="range"], [type="file"], [type="color"]), select, textarea) {
  display: block;
  width: 100%;
  min-width: 0;
  height: var(--h-md);
  padding: 0 0.95rem;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background-color: rgba(0, 0, 0, 0.28);
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--heading);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.textarea,
:where(.field) textarea {
  height: auto;
  min-height: 110px;
  padding: 0.75rem 0.95rem;
  line-height: 1.55;
  resize: vertical;
}
.select,
:where(.field) select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c99762' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 16px;
  cursor: pointer;
}
.select option,
:where(.field) select option { background: var(--surface); color: var(--heading); }
.input::placeholder,
.textarea::placeholder,
:where(.field) :where(input, textarea)::placeholder { color: #9c878f; opacity: 1; }
.input:hover,
.select:hover,
.textarea:hover,
:where(.field) :where(input, select, textarea):hover { border-color: rgba(255, 236, 222, 0.22); }
.input:focus,
.select:focus,
.textarea:focus,
:where(.field) :where(input, select, textarea):focus {
  outline: none;
  border-color: var(--gold-a35);
  box-shadow: 0 0 0 3px rgba(201, 151, 98, 0.18);
}
.input:disabled,
.select:disabled,
.textarea:disabled,
:where(.field) :where(input, select, textarea):disabled { opacity: 0.55; cursor: not-allowed; }
.input[readonly],
:where(.field) input[readonly] { background-color: rgba(255, 255, 255, 0.025); }

.has-error .input,
.has-error .select,
.has-error .textarea,
.has-error :where(input, select, textarea),
.input[aria-invalid="true"],
.select[aria-invalid="true"],
.textarea[aria-invalid="true"],
:where(.field) [aria-invalid="true"] { border-color: rgba(226, 99, 111, 0.65); }
.has-error :where(input, select, textarea):focus,
[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(226, 99, 111, 0.2); }

.input-sm,
.select.input-sm { height: var(--h-sm); padding-left: 0.85rem; font-size: 0.9rem; border-radius: 11px; }
.select.input-sm { padding-right: 2.3rem; background-position: right 0.75rem center; }
.input.mono,
.textarea.mono { font-family: var(--font-mono); font-size: 0.88rem; }

/* Native date/time pickers: the dark colour-scheme already themes them;
   keep the indicator subtle and the digits tabular. */
input[type="datetime-local"],
input[type="date"],
input[type="time"] { font-variant-numeric: tabular-nums; }
input::-webkit-calendar-picker-indicator { opacity: 0.6; cursor: pointer; }
input::-webkit-calendar-picker-indicator:hover { opacity: 1; }
/* Inputs with a <datalist>: the same gold chevron as selects; Chrome's own
   indicator stays clickable on top of it but invisible. */
.input[list],
:where(.field) input[list] {
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c99762' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 16px;
}
input[list]::-webkit-calendar-picker-indicator { opacity: 0; }
input::-webkit-datetime-edit-fields-wrapper { padding: 0; }
input[type="number"] { font-variant-numeric: tabular-nums; }

/* Search: <label class="search"><svg/><input class="input" type="search"></label> */
.search { position: relative; display: block; min-width: 0; }
.search > svg {
  position: absolute;
  top: 50%;
  left: 0.85rem;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.search > .input { padding-left: 2.4rem; }
.search > .input-sm { padding-left: 2.25rem; }
input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; }
input[type="search"]::-webkit-search-cancel-button { cursor: pointer; filter: grayscale(1) brightness(1.4); }

.input-group { display: flex; align-items: stretch; gap: 0.5rem; min-width: 0; }
.input-group > .input,
.input-group > .select,
.input-group > input { flex: 1 1 auto; }
.input-group > .btn { flex-shrink: 0; height: auto; min-height: var(--h-md); }
.input-group > .input-sm ~ .btn { min-height: var(--h-sm); }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.1rem;
  align-items: start;
}
.form-grid > .span-2 { grid-column: 1 / -1; }
.form-section { display: grid; gap: 1rem; min-width: 0; border: 0; }
.form-section > legend,
.form-section-title {
  margin-bottom: 0.25rem;
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--heading);
}

/* Native checkbox/radio with a label: <label class="check"><input type="checkbox"> Text</label> */
.check {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.92rem;
  color: var(--heading);
  cursor: pointer;
}
.check input { width: 16px; height: 16px; flex-shrink: 0; }

/* ── Switch ──────────────────────────────────────────────────────────────── */
/* <label class="switch"><input type="checkbox" role="switch"><span class="switch-track"></span><span class="switch-label">MTR</span></label> */
.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  vertical-align: middle;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}
.switch-track {
  position: relative;
  flex-shrink: 0;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
  box-shadow: inset 0 0 0 1px rgba(255, 236, 222, 0.06);
  transition: background-color 0.25s ease;
}
.switch-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: transform 0.25s var(--ease-out);
}
.switch input:checked + .switch-track { background: var(--gold); }
.switch input:checked + .switch-track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--gold); outline-offset: 3px; }
.switch:hover input:not(:checked):not(:disabled) + .switch-track { background: rgba(255, 255, 255, 0.18); }
.switch input:disabled + .switch-track { opacity: 0.45; }
.switch:has(input:disabled) { cursor: not-allowed; }
.switch-label { font-size: 0.92rem; color: var(--heading); }
.switch-sm .switch-track { width: 36px; height: 22px; }
.switch-sm .switch-track::after { width: 16px; height: 16px; }
.switch-sm input:checked + .switch-track::after { transform: translateX(14px); }
/* Saving an instant toggle: knob pulses, clicks are ignored. */
.switch.is-busy { pointer-events: none; }
.switch.is-busy .switch-track::after { animation: knob-pulse 0.9s ease-in-out infinite alternate; }

/* ── Tables ──────────────────────────────────────────────────────────────── */
/* Wide tables scroll inside their card, never the page. */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}
.table {
  width: 100%;
  min-width: var(--table-min, 0);
  border-collapse: collapse;
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}
.table th,
.table td { padding: 0.75rem 1rem; text-align: left; vertical-align: middle; }
.table th:first-child,
.table td:first-child { padding-left: var(--table-edge, 1.25rem); }
.table th:last-child,
.table td:last-child { padding-right: var(--table-edge, 1.25rem); }
.table thead th {
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.table thead th button {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border: 0;
  background: none;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: inherit;
}
.table thead th button:hover,
.table thead th[aria-sort]:not([aria-sort="none"]) { color: var(--heading); }
.table tbody td { border-top: 1px solid var(--line); }
.table tbody tr:first-child td { border-top: 0; }
:where(.table) td { color: var(--text); }
:where(.table) td.num { color: var(--heading); }
.table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table tbody tr { transition: background-color 0.15s ease; }
.table tbody tr:hover { background: rgba(255, 255, 255, 0.025); }
.table tr.is-link { cursor: pointer; }
.table tr.is-link:hover { background: rgba(201, 151, 98, 0.05); }
.table tr.is-muted > td { opacity: 0.55; }
.table td .sub {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.8rem;
  line-height: 1.35;
  color: var(--muted);
}
.table td .sub.mono { font-size: 0.78rem; }
.table-compact th,
.table-compact td { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.table-compact { font-size: 0.875rem; }
.table-sticky thead th { position: sticky; top: 0; z-index: 1; background: #170d13; }
.col-shrink { width: 1%; white-space: nowrap; }

/* Drag-and-drop reordering (admin lists). */
.drag-handle {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: var(--muted);
  cursor: grab;
  touch-action: none;
}
.drag-handle:hover { color: var(--heading); background: rgba(255, 255, 255, 0.05); }
.drag-handle:active { cursor: grabbing; }
.drag-handle svg { width: 16px; height: 16px; }
.table tr.is-dragging { opacity: 0.4; }
.table tr.drop-before > td { box-shadow: inset 0 2px 0 var(--gold); }
.table tr.drop-after > td { box-shadow: inset 0 -2px 0 var(--gold); }

/* ── Status: dots, pills, badges ─────────────────────────────────────────── */
/* Status colour lives in --st so any component can follow it. */
.st-ok { --st: var(--green); }
.st-warn { --st: var(--amber); }
.st-down { --st: var(--red); }
.st-unknown { --st: var(--muted); }

.dot {
  display: inline-block;
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--st, var(--muted));
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.04);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--st, var(--muted)) 18%, transparent);
  vertical-align: middle;
}
.dot-lg { width: 10px; height: 10px; }
/* Live indicator: a ring expands from the dot. */
.dot-pulse { position: relative; }
.dot-pulse::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1.5px solid var(--st, var(--green));
  opacity: 0;
  animation: ring 2.2s var(--ease-out) infinite;
}

/* Status pill like NetOps "● Ended". */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  height: 26px;
  padding: 0 0.7rem 0 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  border-color: color-mix(in srgb, var(--st, var(--muted)) 32%, transparent);
  background: rgba(255, 255, 255, 0.04);
  background: color-mix(in srgb, var(--st, var(--muted)) 13%, transparent);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1;
  color: var(--st, var(--text));
  white-space: nowrap;
}
.pill .dot { width: 7px; height: 7px; box-shadow: none; }
.pill-lg { height: 30px; padding: 0 0.85rem 0 0.75rem; font-size: 0.86rem; }

/* Small uppercase badge like NetOps "BETA". */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  height: 20px;
  padding: 0 0.45rem;
  border-radius: 6px;
  border: 1px solid var(--gold-a20);
  background: var(--gold-a10);
  font-size: 0.64rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-soft);
  white-space: nowrap;
  vertical-align: middle;
}
.badge-muted { border-color: var(--line); background: rgba(255, 255, 255, 0.04); color: var(--muted); }
.badge:is(.st-ok, .st-warn, .st-down, .st-unknown) {
  border-color: color-mix(in srgb, var(--st) 32%, transparent);
  background: color-mix(in srgb, var(--st) 13%, transparent);
  color: var(--st);
}

/* "AS9121 TTNET": <span class="as-badge"><b>AS9121</b> TTNET</span> */
.as-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 100%;
  height: 20px;
  padding: 0 0.45rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}
.as-badge b { font-weight: 600; color: var(--gold-soft); }

/* ── Alerts ──────────────────────────────────────────────────────────────── */
/* <div class="alert alert-error"><svg/><div class="alert-body"><p class="alert-title">…</p><p>…</p></div><div class="alert-actions">…</div></div> */
.alert {
  --al: var(--gold);
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  min-width: 0;
  padding: 0.85rem 1.1rem;
  border: 1px solid var(--line-strong);
  border-color: color-mix(in srgb, var(--al) 30%, transparent);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  background: color-mix(in srgb, var(--al) 10%, transparent);
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text);
}
.alert > svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 0.1rem; color: var(--al); }
.alert-body { flex: 1 1 auto; min-width: 0; }
.alert-title { font-weight: 600; color: var(--al); }
.alert-title + * { margin-top: 0.15rem; }
.alert-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; flex-shrink: 0; margin-left: auto; }
.alert-error { --al: var(--red); }
.alert-warn { --al: var(--amber); }
.alert-success { --al: var(--green); }
.alert-info { --al: var(--gold); }

/* ── Tabs ────────────────────────────────────────────────────────────────── */
/* Pill tabs like the NetOps top navigation; .tabs-line for in-card tabs. */
.tabs {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  height: 36px;
  padding: 0 0.85rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1;
  color: var(--text);
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}
.tab svg { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.85; }
.tab:hover { color: var(--heading); background: rgba(255, 255, 255, 0.04); }
.tab[aria-selected="true"],
.tab[aria-current]:not([aria-current="false"]),
.tab.is-active { color: var(--gold-soft); background: rgba(255, 255, 255, 0.065); }
.tabs-line { gap: 1.4rem; border-bottom: 1px solid var(--line); }
.tabs-line .tab {
  height: 40px;
  padding: 0 0.1rem;
  border-radius: 0;
  background: none;
  box-shadow: inset 0 -2px 0 transparent;
}
.tabs-line .tab:hover { background: none; }
.tabs-line .tab[aria-selected="true"],
.tabs-line .tab[aria-current]:not([aria-current="false"]),
.tabs-line .tab.is-active { background: none; color: var(--heading); box-shadow: inset 0 -2px 0 var(--gold); }

/* ── Toolbar ─────────────────────────────────────────────────────────────── */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}
.toolbar-grow { flex: 1 1 14rem; min-width: 0; }
.toolbar-group { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; min-width: 0; }
.toolbar-end { margin-left: auto; }
.toolbar .search { flex: 1 1 14rem; max-width: 22rem; }
.toolbar > .seg-scroll { min-width: 0; }

/* ── Dialog ──────────────────────────────────────────────────────────────── */
/* <dialog class="modal"><div class="modal-head">…</div><div class="modal-body">…</div><div class="modal-foot">…</div></dialog>
   Padding lives on the parts, so a click whose target is the <dialog>
   itself is a click on the backdrop. */
dialog.modal {
  position: fixed;
  inset: 0;
  width: min(calc(100% - 2rem), var(--modal-w, 560px));
  max-width: none;
  max-height: min(calc(100% - 2rem), 920px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background: linear-gradient(180deg, #1e1219 0%, #160c12 100%);
  color: var(--text);
  box-shadow: 0 40px 120px -30px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}
dialog.modal[open] { display: flex; flex-direction: column; animation: modal-in 0.22s var(--ease-out); }
dialog.modal::backdrop {
  background: rgba(8, 4, 6, 0.68);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: fade-in 0.2s ease;
}
.modal-sm { --modal-w: 440px; }
.modal-lg { --modal-w: 780px; }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-shrink: 0;
  padding: 1.1rem 1.1rem 1rem 1.5rem;
  border-bottom: 1px solid var(--line);
}
.modal-title {
  min-width: 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.012em;
  color: var(--heading);
}
.modal-close { flex-shrink: 0; }
.modal-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 1.35rem 1.5rem 1.5rem;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.modal-body > * + * { margin-top: 1rem; }
.modal-body > .form-grid,
.modal-body > .stack { margin-top: 0; }
.modal-body > * + .form-grid,
.modal-body > * + .stack { margin-top: 1rem; }
.modal-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
  flex-shrink: 0;
  padding: 1rem 1.5rem calc(1.15rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.14);
}
.modal-foot .spacer { margin-right: auto; }

/* ── Toasts ──────────────────────────────────────────────────────────────── */
/* The stack is a manual popover when supported so it sits in the top layer,
   above an open modal dialog. */
.toast-stack {
  position: fixed;
  z-index: var(--z-toast);
  inset: auto max(1rem, env(safe-area-inset-right, 0px)) max(1rem, env(safe-area-inset-bottom, 0px)) auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.6rem;
  width: min(390px, calc(100vw - 2rem));
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  overflow: visible;
  pointer-events: none;
}
.toast-stack[popover]:not(:popover-open) { display: none; }
.toast {
  --tc: var(--gold);
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  width: 100%;
  padding: 0.8rem 0.6rem 0.8rem 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: rgba(29, 17, 24, 0.97);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.85);
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text);
  pointer-events: auto;
  animation: toast-in 0.26s var(--ease-out);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.is-leaving { opacity: 0; transform: translateY(6px); }
.toast-success { --tc: var(--green); }
.toast-error { --tc: var(--red); }
.toast-warn { --tc: var(--amber); }
.toast-info { --tc: var(--gold); }
.toast-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--tc);
  background: rgba(255, 255, 255, 0.05);
  background: color-mix(in srgb, var(--tc) 16%, transparent);
}
.toast-icon svg { width: 15px; height: 15px; }
.toast-body { flex: 1 1 auto; min-width: 0; padding-top: 0.2rem; }
.toast-title { display: block; font-weight: 600; color: var(--heading); }
.toast-msg { overflow-wrap: anywhere; }
.toast-title + .toast-msg { margin-top: 0.1rem; }
.toast-close {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  transition: color 0.2s ease, background-color 0.2s ease;
}
.toast-close:hover { color: var(--heading); background: rgba(255, 255, 255, 0.06); }
.toast-close svg { width: 15px; height: 15px; }

/* ── Tooltips ────────────────────────────────────────────────────────────── */
/* Chart tooltip: absolutely positioned inside the chart wrapper (position:
   relative) and moved with transform; toggled with .is-visible. */
.chart-tip {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 20;
  min-width: 200px;
  max-width: 290px;
  padding: 0.7rem 0.85rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(23, 12, 17, 0.96);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 44px -16px rgba(0, 0, 0, 0.85);
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease;
  will-change: transform;
}
.chart-tip.is-visible { opacity: 1; }
.chart-tip-time { margin-bottom: 0.4rem; font-size: 0.82rem; font-weight: 600; color: var(--heading); }
.chart-tip-row { display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; }
.chart-tip-row > :first-child { display: inline-flex; align-items: center; gap: 0.45rem; color: var(--muted); }
.chart-tip-row > :last-child { font-weight: 600; color: var(--heading); white-space: nowrap; }
.chart-tip-sep { height: 1px; margin: 0.4rem 0; background: var(--line); }

/* Lightweight hover/focus tooltip: <span class="tip" data-tip="…" tabindex="0">???</span>.
   Clipped by scroll containers — inside .table-wrap prefer the title attribute. */
.tip {
  position: relative;
  cursor: help;
  text-decoration: underline dotted rgba(255, 236, 222, 0.3);
  text-underline-offset: 3px;
}
.tip::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  z-index: 30;
  width: max-content;
  max-width: 260px;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #241520;
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, 0.8);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0;
  text-transform: none;
  color: var(--heading);
  white-space: normal;
  text-align: left;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.tip:hover::after,
.tip:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }

/* ── Legend ──────────────────────────────────────────────────────────────── */
.legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.legend-item { display: inline-flex; align-items: center; gap: 0.5rem; }
.legend-item b { font-weight: 600; color: var(--heading); }
.swatch {
  display: inline-block;
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--sw, var(--gold));
  /* faint band colours (min–max at 10 %) stay visible against the card */
  box-shadow: inset 0 0 0 1px rgba(255, 236, 222, 0.14);
}
.swatch-line { width: 16px; height: 2px; border-radius: 2px; }

/* ── Skeleton ────────────────────────────────────────────────────────────── */
.skel {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}
.skel::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 236, 222, 0.055), transparent);
  animation: shimmer 1.6s ease-in-out infinite;
}
.skel-text { height: 0.8em; margin: 0.35em 0; border-radius: 6px; }
.skel-title { height: clamp(2rem, 4vw, 3rem); border-radius: 10px; }
.skel-num { width: 5.5rem; height: 1.8rem; border-radius: 8px; }
.skel-block { height: var(--h, 120px); border-radius: var(--radius); }
.skel-card { min-height: var(--h, 180px); border: 1px solid var(--line); border-radius: var(--radius-lg); background: rgba(255, 255, 255, 0.025); }
.skel-circle { width: var(--s, 32px); height: var(--s, 32px); border-radius: 50%; }

/* ── Empty state ─────────────────────────────────────────────────────────── */
.empty {
  display: grid;
  justify-items: center;
  gap: 0.55rem;
  padding: clamp(2.5rem, 6vw, 4rem) 1.5rem;
  text-align: center;
}
.empty-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 0.45rem;
  border-radius: 16px;
  background: var(--gold-a10);
  color: var(--gold);
}
.empty-icon svg { width: 24px; height: 24px; }
.empty-title { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; color: var(--heading); }
.empty-text { max-width: 28rem; font-size: 0.92rem; color: var(--muted); }
.empty .btn,
.empty .btn-group { margin-top: 0.75rem; }

/* ── Lists, meters, key/value ────────────────────────────────────────────── */
/* Row list like the NetOps side lists: <ul class="list"><li class="list-row">
   <div class="list-main">…</div><div class="list-meta">…</div></li></ul> */
.list { display: grid; min-width: 0; }
.list-row {
  display: flex;
  align-items: center;
  gap: 0.75rem 1rem;
  min-width: 0;
  padding: 0.8rem 0;
  border-top: 1px solid var(--line);
}
.list-row:first-child { border-top: 0; }
.list-main { flex: 1 1 auto; min-width: 0; }
.list-main > * { overflow-wrap: anywhere; }
.list-meta { flex-shrink: 0; font-size: 0.85rem; color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.list-row.is-link { cursor: pointer; margin-inline: -0.75rem; padding-inline: 0.75rem; border-radius: 10px; transition: background-color 0.15s ease; }
.list-row.is-link:hover { background: rgba(255, 255, 255, 0.03); }
.list-row.is-link + .list-row,
.list-row + .list-row.is-link { border-top-color: var(--line); }

/* Thin bar, e.g. a share or a fill level: <div class="meter" style="--v: 42%"><span></span></div> */
.meter {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}
.meter > span {
  display: block;
  width: var(--v, 0%);
  height: 100%;
  border-radius: inherit;
  background: var(--st, var(--gold));
}

/* Key/value pairs (system info): <dl class="kv"><dt>Sürüm</dt><dd>1.0.0</dd>…</dl> */
.kv {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 0.55rem 1.5rem;
  font-size: 0.9rem;
}
.kv dt { color: var(--muted); }
.kv dd { min-width: 0; color: var(--heading); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

/* Changed values, e.g. route hops old → new. */
del { color: var(--red); text-decoration: line-through; text-decoration-color: rgba(226, 99, 111, 0.55); }
ins { color: var(--green); text-decoration: none; }

/* ── Misc ────────────────────────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  vertical-align: -3px;
  opacity: 0.85;
  animation: spin 0.7s linear infinite;
}
/* Sparkline canvas; drawSpark() reads its CSS size. */
.spark-canvas { display: block; width: 100%; height: var(--spark-h, 40px); }
/* Country flag image (flag-icons 4:3): a small flat rectangle like the
   NetOps country list; --flag-h sets the size. */
.flag {
  display: inline-block;
  flex-shrink: 0;
  width: calc(var(--flag-h, 15px) * 4 / 3);
  height: var(--flag-h, 15px);
  border-radius: 2px;
  object-fit: cover;
  vertical-align: middle;
  /* hairline so white flag fields keep their edge on dark surfaces */
  box-shadow: 0 0 0 1px rgba(255, 236, 222, 0.08);
  user-select: none;
}
.live {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.kbd {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.78em;
  color: var(--cream);
}
/* Container busy state set by setBusy() on non-buttons. */
.is-busy { opacity: 0.6; pointer-events: none; transition: opacity 0.2s ease; }

/* ── Utilities ───────────────────────────────────────────────────────────── */
.muted { color: var(--muted) !important; }
.c-heading { color: var(--heading) !important; }
.c-text { color: var(--text) !important; }
.c-cream { color: var(--cream) !important; }
.c-gold { color: var(--gold) !important; }
.c-gold-soft { color: var(--gold-soft) !important; }
.c-green { color: var(--green) !important; }
.c-amber { color: var(--amber) !important; }
.c-red { color: var(--red) !important; }
.mono { font-family: var(--font-mono); font-size: 0.92em; letter-spacing: 0; }
.tnum { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.truncate { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.w-full { width: 100%; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 0.75rem !important; }
.mt-4 { margin-top: 1rem !important; }
.mt-5 { margin-top: 1.5rem !important; }
.mt-6 { margin-top: 2rem !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 0.75rem !important; }
.mb-4 { margin-bottom: 1rem !important; }
.mb-5 { margin-bottom: 1.5rem !important; }
.mb-6 { margin-bottom: 2rem !important; }
.gap-1 { --gap: 0.25rem; }
.gap-2 { --gap: 0.5rem; }
.gap-3 { --gap: 0.75rem; }
.gap-4 { --gap: 1rem; }
.gap-5 { --gap: 1.5rem; }
.gap-6 { --gap: 2rem; }

/* ── Motion ──────────────────────────────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { transform: translateX(100%); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(0.985); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes ring {
  0% { opacity: 0.7; transform: scale(0.6); }
  80%, 100% { opacity: 0; transform: scale(1.6); }
}
@keyframes knob-pulse { to { opacity: 0.45; } }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 960px) {
  :root { --header-h: 64px; }
  .brand img { height: 30px; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .grid-2,
  .grid-3,
  .grid-4,
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .card { --card-pad: 1.05rem; border-radius: 18px; }
  .toolbar .search { max-width: none; flex-basis: 100%; }
  .toolbar > .seg-scroll { flex: 1 1 100%; }
  .page-head-row { align-items: flex-start; }
  .app-bar-inner { height: 58px; }
  .hide-sm { display: none !important; }
  .table th,
  .table td { padding-left: 0.75rem; padding-right: 0.75rem; }
  .table { --table-edge: 1rem; }
}
@media (min-width: 721px) {
  .show-sm { display: none !important; }
}
@media (max-width: 560px) {
  /* Phones: the product label moves under the wordmark, so the language
     switch and the satcore.net button keep their place in the header. */
  .site-header .brand { flex-direction: column; align-items: flex-start; gap: 0.32rem; }
  .site-header .brand img { height: 26px; }
  .site-header .brand-label { padding-left: 24%; font-size: 0.6rem; letter-spacing: 0.2em; }
  .header-actions { gap: 0.5rem; }
  .lbl-long { display: none; }
  .lbl-short { display: inline; }
  .brand { gap: 0.75rem; }
  .brand-label { font-size: 0.7rem; letter-spacing: 0.12em; }
  .stats { --stat-min: 140px; gap: 0.6rem; }
  .stat { padding: 0.85rem 0.95rem 0.9rem; }
  .app-bar .brand-label { display: none; }
  .user-pill { max-width: 9rem; }
  dialog.modal { width: calc(100% - 1rem); max-height: calc(100% - 1rem); border-radius: 18px; }
  .modal-head { padding: 0.9rem 0.9rem 0.85rem 1.15rem; }
  .modal-body { padding: 1.15rem; }
  .modal-foot { padding: 0.9rem 1.15rem calc(1rem + env(safe-area-inset-bottom, 0px)); }
  .modal-foot .btn { flex: 1 1 auto; }
  .toast-stack { inset: auto 0.75rem max(0.75rem, env(safe-area-inset-bottom, 0px)) 0.75rem; width: auto; align-items: stretch; }
  .alert { flex-wrap: wrap; }
  .alert-actions { margin-left: 0; width: 100%; }
}
@media (max-width: 380px) {
  .brand img { height: 26px; }
  .brand-label { font-size: 0.66rem; }
  .btn:not(.btn-icon) { padding-inline: 1rem; }
  .seg-btn { padding: 0 0.65rem; }
}

/* ── Accessibility ───────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
  .skel::after,
  .dot-pulse::after { display: none; }
}
@media (forced-colors: active) {
  .seg-btn[aria-checked="true"],
  .seg-btn[aria-pressed="true"],
  .seg-btn.is-active,
  .tab[aria-selected="true"],
  .tab[aria-current="page"] { outline: 2px solid CanvasText; }
  .switch-track { border: 1px solid CanvasText; }
  .dot,
  .swatch { forced-color-adjust: none; }
}
