/* ============================================================
   QUERYBOX DESIGN SYSTEM — BASE STYLESHEET
   networktoolkit.io
   Depends on: tokens.css (must load first)
   Covers: reset, typography, layout shell, core components
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500;600&family=DM+Sans:wght@300;400;500;600&display=swap');


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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  background:  var(--bg-base);
  color:       var(--text-primary);
  font-family: var(--font-mono);
  font-size:   var(--text-base);
  line-height: var(--leading-base);
  min-height:  100vh;
}

img, video, svg { display: block; max-width: 100%; }

button, input, select, textarea { font: inherit; color: inherit; }

a {
  color: var(--accent-current);
  text-decoration: none;
  transition: opacity var(--duration-base) var(--ease-default);
}
a:hover { opacity: 0.75; }

::-webkit-scrollbar        { width: 3px; height: 3px; }
::-webkit-scrollbar-track  { background: transparent; }
::-webkit-scrollbar-thumb  { background: var(--border-strong); border-radius: var(--radius-pill); }
::-webkit-scrollbar-thumb:hover { background: var(--accent-neutral); }

::selection {
  background: color-mix(in srgb, var(--accent-current) 25%, transparent);
  color: var(--text-primary);
}

:focus-visible {
  outline: none;
  box-shadow: var(--glow-focus);
  border-radius: var(--radius-sm);
}


/* ----------------------------------------------------------
   TYPOGRAPHY
---------------------------------------------------------- */
h1 { font-size: var(--text-2xl); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-tight); }
h2 { font-size: var(--text-xl);  font-weight: var(--weight-semibold); letter-spacing: var(--tracking-tight); }
h3 { font-size: var(--text-lg);  font-weight: var(--weight-medium); }
h4 { font-size: var(--text-md);  font-weight: var(--weight-medium); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-mono);
  line-height: var(--leading-tight);
  color: var(--text-primary);
}

p {
  font-size:   var(--text-base);
  line-height: var(--leading-base);
  color:       var(--text-secondary);
  max-width:   68ch;
}

code, pre, kbd { font-family: var(--font-mono); font-size: var(--text-sm); }

.text-label {
  font-size:      var(--text-xs);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color:          var(--text-tertiary);
}

.text-mono    { font-family: var(--font-mono); }
.text-accent  { color: var(--accent-current); }
.text-muted   { color: var(--text-tertiary); }
.text-ghost   { color: var(--text-ghost); }
.text-sm      { font-size: var(--text-sm); color: var(--text-tertiary); }
.text-xs      { font-size: var(--text-xs); color: var(--text-ghost); letter-spacing: var(--tracking-wide); }


/* ----------------------------------------------------------
   PAGE SHELL
---------------------------------------------------------- */

/* Topbar */
.topbar {
  height:        var(--topbar-height);
  display:       flex;
  align-items:   center;
  padding:       0 var(--space-5);
  background:    var(--bg-surface);
  border-bottom: 1px solid var(--border-default);
  position:      sticky;
  top:           0;
  z-index:       var(--z-sticky);
  gap:           0;
}

.topbar__logo-block {
  display:         flex;
  flex-direction:  column;
  justify-content: center;
  line-height:     1.15;
  margin-right:    var(--space-5);
  cursor:          pointer;
}

.topbar__logo-name {
  font-size:      var(--text-md);
  font-weight:    var(--weight-semibold);
  letter-spacing: var(--tracking-tight);
  color:          var(--text-primary);
}

.topbar__logo-name--brand { color: var(--accent-cyan); }

.topbar__logo-url {
  font-size:      9px;
  color:          var(--text-tertiary);
  letter-spacing: 0.12em;
}

.topbar__divider {
  width:       1px;
  height:      28px;
  background:  var(--border-default);
  margin-right: var(--space-3);
  flex-shrink: 0;
}

.topbar__spacer { flex: 1; }

/* Nav button */
.nav-btn {
  background:     none;
  border:         1px solid transparent;
  color:          var(--text-tertiary);
  font-family:    var(--font-mono);
  font-size:      var(--text-xs);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  cursor:         pointer;
  padding:        5px 11px;
  border-radius:  var(--radius-md);
  transition:     all var(--duration-base) var(--ease-default);
}
.nav-btn:hover {
  color:        var(--text-primary);
  border-color: var(--border-default);
  background:   var(--bg-overlay);
}
.nav-btn.is-active {
  color:        var(--accent-current);
  border-color: color-mix(in srgb, var(--accent-current) 30%, transparent);
  background:   color-mix(in srgb, var(--accent-current) 8%, transparent);
}

/* Status pill */
.status-pill {
  display:        flex;
  align-items:    center;
  gap:            8px;
  font-size:      var(--text-xs);
  color:          var(--text-secondary);
  padding:        4px 11px;
  border:         1px solid var(--border-default);
  border-radius:  var(--radius-pill);
  cursor:         pointer;
  transition:     all var(--duration-base) var(--ease-default);
  background:     none;
  font-family:    var(--font-mono);
}
.status-pill:hover {
  border-color: rgba(0, 255, 148, 0.35);
  color:        var(--accent-green);
  background:   rgba(0, 255, 148, 0.05);
}

/* Live dot */
.live-dot {
  width:         6px;
  height:        6px;
  border-radius: var(--radius-pill);
  background:    var(--accent-green);
  box-shadow:    0 0 5px var(--accent-green);
  animation:     pulse-dot 2s ease-in-out infinite;
  flex-shrink:   0;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.35; }
}


/* ----------------------------------------------------------
   AD SLOTS
---------------------------------------------------------- */

/* Top leaderboard (between topbar and page content) */
.ad-top {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  padding:         5px var(--space-5);
  background:      rgba(255, 255, 255, 0.01);
  border-bottom:   1px solid rgba(255, 255, 255, 0.04);
  min-height:      38px;
}

/* Left vertical rail */
.ad-rail {
  width:       var(--ad-rail-width);
  height:      var(--ad-rail-height);  /* capped — does not grow with page */
  flex-shrink: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.04);
  display:      flex;
  flex-direction: column;
  align-items:  center;
  padding:      14px var(--space-2);
  gap:          var(--space-2) - 2px;
  background:   rgba(255, 255, 255, 0.008);
  position:     sticky;
  top:          var(--topbar-height);
}

.ad-rail__slot {
  width:       104px;
  height:      240px;
  border:      1px dashed rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md) - 2px;
  display:     flex;
  align-items: center;
  justify-content: center;
}

/* Bottom banner */
.ad-bottom {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  padding:         8px 0;
  background:      rgba(255, 255, 255, 0.01);
  border-top:      1px solid rgba(255, 255, 255, 0.04);
  min-height:      48px;
  margin-top:      var(--space-5) - 2px;
}

/* Shared ad label */
.ad-label {
  font-size:      9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color:          var(--text-ghost);
  flex-shrink:    0;
}

.ad-content {
  flex:       1;
  text-align: center;
  font-size:  var(--text-xs);
  color:      rgba(255, 255, 255, 0.1);
  padding:    0 var(--space-3);
}


/* ----------------------------------------------------------
   MAIN LAYOUT
---------------------------------------------------------- */
.main-layout {
  display:     flex;
  align-items: flex-start;
}

.main-content {
  flex:       1;
  min-width:  0;
  padding:    18px 22px;
}

/* Hero section */
.hero {
  text-align: center;
  padding:    18px 0 16px;
}

.hero h1 {
  font-size:      21px;
  font-weight:    var(--weight-semibold);
  letter-spacing: var(--tracking-tight);
  margin-bottom:  var(--space-1);
}

.hero__subtitle {
  font-size:      9px;
  color:          var(--text-tertiary);
  letter-spacing: 0.22em;
  text-transform: uppercase;
}


/* ----------------------------------------------------------
   SEQUENCE GUIDE — numbered step indicator
---------------------------------------------------------- */
.seq-row {
  display:       flex;
  align-items:   center;
  gap:           0;
  flex-wrap:     wrap;
  margin-bottom: var(--space-3);
}

/* Connector line between steps */
.seq-line {
  width:      28px;
  height:     1px;
  background: var(--border-default);
  flex-shrink: 0;
  transition: background var(--duration-base);
}

/* Individual step */
.seq-step {
  display:        flex;
  align-items:    center;
  gap:            7px;
  padding:        5px 10px;
  border-radius:  var(--radius-pill);
  font-size:      11px;
  font-weight:    var(--weight-medium);
  letter-spacing: 0.03em;
  opacity:        0.35;
  transition:     opacity var(--duration-base) var(--ease-default);
  user-select:    none;
}

.seq-step.is-active { opacity: 1; }
.seq-step.is-done   { opacity: 0.6; }

/* Numbered circle */
.seq-step__num {
  width:         16px;
  height:        16px;
  border-radius: var(--radius-pill);
  display:       inline-flex;
  align-items:   center;
  justify-content: center;
  font-size:     9px;
  font-weight:   var(--weight-semibold);
  flex-shrink:   0;
  line-height:   1;
}

/* Per-step colour tokens */
.seq-step--tool .seq-step__num {
  background: var(--accent-green);
  color:      var(--text-inverse);
}
.seq-step--tool .seq-step__label { color: var(--accent-green); }
.seq-step--tool.is-active .seq-step__num {
  box-shadow: 0 0 8px var(--accent-green-dim);
}

.seq-step--target .seq-step__num {
  border:     1px solid rgba(0, 212, 255, 0.5);
  color:      var(--accent-cyan);
  background: transparent;
}
.seq-step--target .seq-step__label { color: var(--accent-cyan); }
.seq-step--target.is-active .seq-step__num {
  background: rgba(0, 212, 255, 0.1);
}

.seq-step--region .seq-step__num {
  border:     1px solid rgba(255, 184, 0, 0.5);
  color:      var(--accent-amber);
  background: transparent;
}
.seq-step--region .seq-step__label { color: var(--accent-amber); }
.seq-step--region.is-active .seq-step__num {
  background: rgba(255, 184, 0, 0.1);
}

/* Legacy chip classes kept for any other pages that still reference them */
.seq-chip {
  padding:        3px 10px;
  border-radius:  var(--radius-pill);
  font-size:      11px;
  font-weight:    var(--weight-medium);
  letter-spacing: 0.02em;
}
.seq-chip--tool   { background: var(--accent-green);      border: none;                               color: var(--text-inverse); font-weight: var(--weight-semibold); }
.seq-chip--host   { background: rgba(0,212,255,0.08);     border: 1px solid rgba(0,212,255,0.45);     color: var(--accent-cyan); }
.seq-chip--param  { background: rgba(0,212,255,0.08);     border: 1px solid rgba(0,212,255,0.45);     color: var(--accent-cyan); }
.seq-chip--region { background: rgba(255,184,0,0.08);     border: 1px solid rgba(255,184,0,0.45);     color: var(--accent-amber); }


/* ----------------------------------------------------------
   SEARCH BAR / COMMAND INPUT
   This is the primary interaction surface.
   Do not modify padding, border-radius, or badge alpha values.
---------------------------------------------------------- */
.search-outer {
  position:      relative;
  margin-bottom: var(--space-2) - 2px;
}

.input-container {
  background:     var(--bg-surface);
  border:         1px solid var(--border-default);
  border-radius:  var(--radius-lg);
  padding:        8px 12px;
  display:        flex;
  align-items:    center;
  flex-wrap:      wrap;
  gap:            8px;
  min-height:     46px;
  cursor:         text;
  transition:     border-color var(--duration-base) var(--ease-default),
                  box-shadow var(--duration-base) var(--ease-default);
}

.input-container:focus-within {
  border-color: rgba(0, 212, 255, 0.4);
  box-shadow:   var(--glow-input-focus);
}

.input-container__prompt {
  color:       var(--text-ghost);
  font-size:   var(--text-base);
  user-select: none;
  flex-shrink: 0;
  margin-right: 2px;
}

/* Text input inside the container */
.search-input {
  flex:        1;
  min-width:   100px;
  background:  transparent;
  border:      none;
  outline:     none;
  color:       var(--text-primary);
  font-family: var(--font-mono);
  font-size:   var(--text-base);
  caret-color: var(--accent-cyan);
}
.search-input::placeholder { color: var(--text-ghost); }

/* Run button */
.run-btn {
  flex-shrink:    0;
  background:     var(--accent-cyan);
  color:          var(--text-inverse);
  border:         none;
  border-radius:  var(--radius-md) - 2px;
  padding:        5px 14px;
  font-family:    var(--font-mono);
  font-size:      var(--text-xs);
  font-weight:    var(--weight-semibold);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  cursor:         pointer;
  margin-left:    auto;
  transition:     background var(--duration-base) var(--ease-default);
}
.run-btn:hover    { background: #33ddff; }
.run-btn:disabled { background: var(--bg-overlay); color: var(--text-tertiary); cursor: not-allowed; }


/* ----------------------------------------------------------
   BADGES
   CRITICAL: Do not deviate from these exact values.
   bg = accent at 7% alpha, border = accent at 27% alpha
   border-radius: 4px (--radius-sm), padding: 3px 10px
---------------------------------------------------------- */
.badge {
  display:     inline-flex;
  align-items: center;
  gap:         5px;
  border-radius: var(--radius-sm);   /* 4px — do not change */
  padding:     3px 10px;             /* do not change */
  font-size:   var(--text-sm);       /* 12px — do not change */
  white-space: nowrap;
}

.badge--tool   { background: var(--accent-green);             border: none;                                  color: var(--text-inverse); font-weight: var(--weight-semibold); }
.badge--host   { background: rgba(0, 212, 255, 0.08);        border: 1px solid rgba(0, 212, 255, 0.45);     color: var(--accent-cyan); }
.badge--param  { background: rgba(0, 212, 255, 0.08);        border: 1px solid rgba(0, 212, 255, 0.45);     color: var(--accent-cyan); }
.badge--region { background: rgba(255, 184, 0, 0.08);        border: 1px solid rgba(255, 184, 0, 0.45);     color: var(--accent-amber); }

/* "none" region — no workers available */
.badge--region.badge--none {
  background:   rgba(255, 107, 107, 0.1);
  border-color: rgba(255, 107, 107, 0.45);
  color:        var(--accent-red);
}

.badge__remove {
  background:  none;
  border:      none;
  cursor:      pointer;
  color:       inherit;
  opacity:     0.55;
  font-size:   13px;
  line-height: 1;
  font-family: var(--font-mono);
  padding:     0;
  transition:  opacity var(--duration-fast);
}
.badge__remove:hover { opacity: 1; }


/* ----------------------------------------------------------
   AUTOCOMPLETE DROPDOWN
---------------------------------------------------------- */
.ac-drop {
  position:     absolute;
  top:          calc(100% + 4px);
  left:         0;
  right:        0;
  background:   var(--bg-elevated);
  border:       1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow:   var(--shadow-lg);
  z-index:      var(--z-dropdown);
  overflow:     hidden;
  display:      none;
}
.ac-drop.is-open { display: block; }

.ac-drop__header {
  padding:        5px 12px;
  font-size:      10px;
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color:          var(--text-ghost);
  border-bottom:  1px solid var(--border-default);
}

.ac-drop__item {
  display:     flex;
  align-items: center;
  gap:         10px;
  padding:     8px 12px;
  cursor:      pointer;
  transition:  background var(--duration-fast);
}
.ac-drop__item:hover,
.ac-drop__item.is-focused { background: var(--bg-overlay); }

.ac-drop__name {
  font-size:   var(--text-sm);
  font-weight: var(--weight-medium);
  min-width:   130px;
}
.ac-drop__desc { font-size: var(--text-xs); color: var(--text-tertiary); flex: 1; }
.ac-drop__tag  { font-size: 10px; letter-spacing: var(--tracking-wider); text-transform: uppercase; color: var(--text-ghost); }


/* ----------------------------------------------------------
   SESSION HISTORY PANEL
---------------------------------------------------------- */
.hist-panel {
  background:    var(--bg-surface);
  border:        1px solid var(--border-default);
  border-radius: var(--radius-md);
  overflow:      hidden;
  margin-bottom: 10px;
  display:       none;
}
.hist-panel.is-open { display: block; }

.hist-panel__head {
  display:       flex;
  align-items:   center;
  padding:       7px 12px;
  border-bottom: 1px solid var(--border-default);
}

.hist-panel__label {
  font-size:      10px;
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color:          var(--text-secondary);
  flex:           1;
}

.hist-panel__clear {
  background:     none;
  border:         none;
  font-family:    var(--font-mono);
  font-size:      10px;
  color:          var(--text-ghost);
  cursor:         pointer;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  padding:        0;
  transition:     color var(--duration-base);
}
.hist-panel__clear:hover { color: var(--accent-red); }

.hist-panel__empty {
  padding:   10px 12px;
  font-size: var(--text-xs);
  color:     var(--text-ghost);
}

.hist-panel__row {
  display:       flex;
  align-items:   center;
  gap:           var(--space-2);
  padding:       7px 12px;
  cursor:        pointer;
  transition:    background var(--duration-fast);
  border-bottom: 1px solid rgba(255, 255, 255, 0.025);
}
.hist-panel__row:last-child    { border-bottom: none; }
.hist-panel__row:hover         { background: var(--bg-overlay); }

.hist-panel__cmd  { font-size: var(--text-sm); color: var(--text-secondary); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-panel__time { font-size: 10px; color: var(--text-ghost); flex-shrink: 0; }

.hist-panel__rerun {
  background:     none;
  border:         1px solid var(--border-default);
  color:          var(--text-ghost);
  font-family:    var(--font-mono);
  font-size:      10px;
  padding:        2px 7px;
  border-radius:  var(--radius-sm);
  cursor:         pointer;
  transition:     all var(--duration-base);
  flex-shrink:    0;
}
.hist-panel__rerun:hover { color: var(--accent-cyan); border-color: rgba(0, 212, 255, 0.3); }


/* ----------------------------------------------------------
   TERMINAL
---------------------------------------------------------- */
.terminal-wrap { margin-top: 12px; }

.terminal__topbar {
  display:       flex;
  align-items:   center;
  gap:           var(--space-2);
  padding:       7px 12px;
  background:    var(--bg-elevated);
  border:        1px solid var(--border-default);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  border-bottom: none;
}

.terminal__dots    { display: flex; gap: 5px; }
.terminal__dot {
  width:         10px;
  height:        10px;
  border-radius: var(--radius-pill);
  border:        none;
  padding:       0;
  cursor:        pointer;
  flex-shrink:   0;
  opacity:       0.85;
  transition:    opacity var(--duration-fast), transform var(--duration-fast);
}
.terminal__dot:hover  { opacity: 1; transform: scale(1.2); }
.terminal__dot:active { transform: scale(0.85); }
.terminal__title   { font-size: 10px; color: var(--text-tertiary); flex: 1; margin-left: 4px; letter-spacing: 0.05em; }

.terminal__action {
  background:     none;
  border:         1px solid var(--border-default);
  color:          var(--text-tertiary);
  font-family:    var(--font-mono);
  font-size:      10px;
  letter-spacing: 0.05em;
  border-radius:  var(--radius-sm);
  padding:        3px 8px;
  cursor:         pointer;
  transition:     all var(--duration-base);
  text-transform: uppercase;
}
.terminal__action:hover { color: var(--text-primary); border-color: var(--border-strong); }

.terminal {
  background:    var(--bg-recessed);
  border:        1px solid var(--border-default);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  padding:       12px 14px;
  min-height:    200px;
  max-height:    340px;
  overflow-y:    auto;
  font-size:     var(--text-sm);
  line-height:   1.85;
}

/* Terminal output classes */
.t-dim  { color: rgba(255, 255, 255, 0.25); }   /* Metadata, comments — dim but readable */
.t-cmd  { color: var(--accent-cyan); }
.t-ok   { color: var(--accent-green); }
.t-warn { color: var(--accent-amber); }
.t-err  { color: var(--accent-red); }
.t-info { color: var(--text-primary); }          /* Data fields — full brightness */

/* Blinking cursor */
.t-cursor {
  display:        inline-block;
  width:          7px;
  height:         12px;
  background:     var(--accent-cyan);
  animation:      cursor-blink 1.1s step-end infinite;
  vertical-align: text-bottom;
  margin-left:    1px;
}
@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* Shake on critical error */
@keyframes terminal-shake {
  0%, 100% { transform: translateX(0); }
  15%       { transform: translateX(-6px); }
  30%       { transform: translateX(6px); }
  45%       { transform: translateX(-4px); }
  60%       { transform: translateX(4px); }
  75%       { transform: translateX(-2px); }
  90%       { transform: translateX(2px); }
}
.terminal-wrap--shake {
  animation: terminal-shake 0.45s ease;
}


/* ----------------------------------------------------------
   SURFACE / CARD
---------------------------------------------------------- */
.surface {
  background:    var(--bg-surface);
  border:        1px solid var(--border-default);
  border-radius: var(--radius-lg);
}

.surface--elevated {
  background:    var(--bg-elevated);
  border-color:  var(--border-strong);
  box-shadow:    var(--shadow-md);
}

.card { padding: var(--space-6); }
.card--sm { padding: var(--space-4); }


/* ----------------------------------------------------------
   STATUS INDICATORS
---------------------------------------------------------- */
.status-dot {
  display:       inline-block;
  width:         8px;
  height:        8px;
  border-radius: var(--radius-pill);
  flex-shrink:   0;
}
.status-dot--online  { background: var(--accent-green); box-shadow: 0 0 6px var(--accent-green); }
.status-dot--warning { background: var(--accent-amber); box-shadow: 0 0 6px var(--accent-amber); }
.status-dot--offline { background: var(--accent-red);   box-shadow: 0 0 6px var(--accent-red); }
.status-dot--idle    { background: var(--text-ghost); }

.status-badge {
  display:     inline-flex;
  align-items: center;
  gap:         4px;
  padding:     2px 8px;
  border-radius: var(--radius-pill);
  font-size:   10px;
  font-weight: var(--weight-medium);
}
.status-badge--online  { background: rgba(0,255,148,0.1);   border: 1px solid rgba(0,255,148,0.25);   color: var(--accent-green); }
.status-badge--warning { background: rgba(255,184,0,0.1);   border: 1px solid rgba(255,184,0,0.25);   color: var(--accent-amber); }
.status-badge--offline { background: rgba(255,107,107,0.1); border: 1px solid rgba(255,107,107,0.25); color: var(--accent-red); }


/* ----------------------------------------------------------
   BUTTONS
---------------------------------------------------------- */
.btn {
  display:        inline-flex;
  align-items:    center;
  justify-content:center;
  gap:            var(--space-2);
  padding:        var(--space-2) var(--space-4);
  border-radius:  var(--radius-md);
  font-family:    var(--font-mono);
  font-size:      var(--text-xs);
  font-weight:    var(--weight-medium);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  cursor:         pointer;
  border:         1px solid transparent;
  transition:     all var(--duration-base) var(--ease-default);
  white-space:    nowrap;
  user-select:    none;
}

.btn--ghost {
  background:   color-mix(in srgb, var(--accent-current) 10%, transparent);
  border-color: color-mix(in srgb, var(--accent-current) 35%, transparent);
  color:        var(--accent-current);
}
.btn--ghost:hover {
  background:   color-mix(in srgb, var(--accent-current) 18%, transparent);
  border-color: color-mix(in srgb, var(--accent-current) 50%, transparent);
}

.btn--solid {
  background: var(--accent-current);
  color:      var(--text-inverse);
}
.btn--solid:hover { opacity: 0.88; }

.btn--subtle {
  background:   none;
  border-color: var(--border-default);
  color:        var(--text-tertiary);
}
.btn--subtle:hover {
  border-color: var(--border-strong);
  color:        var(--text-primary);
  background:   var(--bg-overlay);
}

.btn:disabled { opacity: 0.35; cursor: not-allowed; pointer-events: none; }


/* ----------------------------------------------------------
   TABLE
---------------------------------------------------------- */
.table-wrap {
  overflow-x:    auto;
  border:        1px solid var(--border-default);
  border-radius: var(--radius-lg);
}

table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }

thead th {
  text-align:     left;
  padding:        8px 14px;
  font-size:      10px;
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color:          var(--text-ghost);
  border-bottom:  1px solid var(--border-default);
  white-space:    nowrap;
}

tbody td {
  padding:       9px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  color:         var(--text-secondary);
  transition:    background var(--duration-fast);
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td      { background: var(--bg-overlay); color: var(--text-primary); }


/* ----------------------------------------------------------
   KBD HINT
---------------------------------------------------------- */
kbd {
  display:        inline-flex;
  align-items:    center;
  padding:        2px var(--space-2);
  background:     var(--bg-elevated);
  border:         1px solid var(--border-strong);
  border-radius:  var(--radius-sm);
  font-family:    var(--font-mono);
  font-size:      var(--text-xs);
  color:          var(--text-tertiary);
  line-height:    1.6;
}


/* ----------------------------------------------------------
   FILTER PILLS
---------------------------------------------------------- */
.filter-btn {
  background:     none;
  border:         1px solid var(--border-default);
  color:          var(--text-tertiary);
  font-family:    var(--font-mono);
  font-size:      10px;
  padding:        3px 9px;
  border-radius:  var(--radius-pill);
  cursor:         pointer;
  transition:     all var(--duration-base);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.filter-btn:hover { border-color: var(--border-strong); color: var(--text-primary); }
.filter-btn.is-active {
  border-color: rgba(0, 212, 255, 0.4);
  color:        var(--accent-cyan);
  background:   rgba(0, 212, 255, 0.08);
}


/* ----------------------------------------------------------
   DIVIDER
---------------------------------------------------------- */
.divider {
  height:     1px;
  background: var(--border-default);
  border:     none;
  margin:     var(--space-4) 0;
}


/* ----------------------------------------------------------
   UTILITIES
---------------------------------------------------------- */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flex     { display: flex; }
.flex-col { flex-direction: column; }
.items-center    { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--space-2); }
.gap-md { gap: var(--space-4); }
.gap-lg { gap: var(--space-8); }
.w-full { width: 100%; }
.relative { position: relative; }
.cursor-pointer { cursor: pointer; }
.no-select { user-select: none; }
.mono { font-family: var(--font-mono); }


/* ----------------------------------------------------------
   RESPONSIVE
---------------------------------------------------------- */
@media (max-width: 768px) {
  .ad-rail { display: none; }
  .main-content { padding: var(--space-4) var(--space-4); }
  :root { --content-padding: var(--space-4); }
}
