/* =============================================================
   tagging-tool · Design Tokens
   Ported from Fakultaets-CD (RUB Sportwissenschaft).
   Source: C:/Dev/fakultaet-cd/colors_and_type.css
   Single source of truth: brand colors, type, spacing (b-Modul),
   surfaces, status colors, focus ring, motion.
   ============================================================= */

/* ---------- Webfonts (lokal, latin + latin-ext) ---------- */
@font-face {
  font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400;
  font-display: swap;
  src: url("../fonts/ibm-plex-sans-latin-400-normal.77bc02670657.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2212;
}
@font-face {
  font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400;
  font-display: swap;
  src: url("../fonts/ibm-plex-sans-latin-ext-400-normal.1bc0d8e41d21.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+1E00-1E9F, U+20A0-20AB, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 500;
  font-display: swap;
  src: url("../fonts/ibm-plex-sans-latin-500-normal.f7016cd446d2.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2212;
}
@font-face {
  font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 500;
  font-display: swap;
  src: url("../fonts/ibm-plex-sans-latin-ext-500-normal.93a0df997e00.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+1E00-1E9F, U+20A0-20AB, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 600;
  font-display: swap;
  src: url("../fonts/ibm-plex-sans-latin-600-normal.196e3cbc5fee.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2212;
}
@font-face {
  font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 600;
  font-display: swap;
  src: url("../fonts/ibm-plex-sans-latin-ext-600-normal.8fccbdf5bf67.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+1E00-1E9F, U+20A0-20AB, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400;
  font-display: swap;
  src: url("../fonts/ibm-plex-mono-latin-400-normal.79936b18df9f.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2212;
}
@font-face {
  font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400;
  font-display: swap;
  src: url("../fonts/ibm-plex-mono-latin-ext-400-normal.8450d5944de2.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+1E00-1E9F, U+20A0-20AB, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500;
  font-display: swap;
  src: url("../fonts/ibm-plex-mono-latin-500-normal.b1c8a895f5fd.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2212;
}
@font-face {
  font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500;
  font-display: swap;
  src: url("../fonts/ibm-plex-mono-latin-ext-500-normal.fa8d8838b94a.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+1E00-1E9F, U+20A0-20AB, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Tokens ---------- */
:root {
  /* Brand */
  --brand-orange: #EA663B;   /* Tartan orange — Faculty signature */
  --brand-navy:   #003560;   /* RUB navy */
  --brand-navy-hover: #00264a;

  /* Text */
  --text-primary:   #1A1A1A;
  --text-secondary: #6B6B6B;
  --text-on-dark:   #FAFAFA;

  /* Surfaces (NEVER pure white per CD) */
  --surface-stage:  #E7E7E7;   /* Page bg */
  --surface-card:   #F2F2F2;   /* Cards, info blocks */
  --surface-bright: #FAFAFA;   /* Inputs */

  /* Lines */
  --border:          #C4C4C4;
  --border-hairline: rgba(26, 26, 26, 0.18);

  /* Status (semantic only) */
  --status-success: #2D7A3E;
  --status-warning: #B8761A;
  --status-error:   #C13030;
  --status-info:    var(--brand-navy);

  /* Type */
  --font-sans: 'IBM Plex Sans', 'Helvetica Neue', Helvetica, sans-serif;
  --font-mono: 'IBM Plex Mono', 'SFMono-Regular', Menlo, Consolas, monospace;

  /* Type scale */
  --fs-caption: 12px;
  --fs-body:    16px;
  --fs-lead:    20px;
  --fs-h3:      24px;
  --fs-h2:      32px;
  --fs-h1:      48px;

  /* Spacing · b-Modul (1b = 8px) */
  --b:    8px;
  --b-1:  8px;
  --b-2:  16px;
  --b-3:  24px;
  --b-4:  32px;
  --b-6:  48px;
  --b-8:  64px;

  /* Stroke / Radius */
  --stroke-hairline: 0.5px;
  --stroke:          1px;
  --stroke-accent:   2px;
  --radius-2:  2px;    /* Buttons, inputs */
  --radius-1b: 8px;    /* Cards */

  /* Motion */
  --dur-fast: 120ms;
  --dur-base: 240ms;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ---------- Reduced motion (a11y) ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Focus ring · global ---------- */
:focus { outline: none; }
:focus-visible {
  outline: var(--stroke-accent) solid var(--brand-orange);
  outline-offset: 2px;
}

button:active,
a:active,
[role="button"]:active,
.btn:active {
  opacity: 0.8;
  transition: opacity 80ms linear;
}

/* ---------- Base ----------
   Body uses Plex Sans + stage surface. Tailwind utility classes
   continue to work; brand defaults shine through where overridden. */
html, body {
  background: var(--surface-stage);
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Headings default to Plex Sans 500 (no Fraunces in the app UI). */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--text-primary);
}

/* Mono context — code, tags, hotkey hints */
code, kbd, samp, pre, .font-mono {
  font-family: var(--font-mono);
}

/* ---------- Helper classes (used in templates) ---------- */
.surface-stage  { background: var(--surface-stage); }
.surface-card   { background: var(--surface-card); }
.surface-bright { background: var(--surface-bright); }

.text-primary   { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-on-dark   { color: var(--text-on-dark); }

.border-hairline { border-color: var(--border-hairline); }

/* RUB Header · Cockpit Wedge variant ----------
   Full-bleed bar: orange wedge (display type + Sport-Wortmarke) left,
   navy telemetry/meta center, user-rail + RUB-Label right.
   Hard vertical 2px ink rule splits wedge from navy. */
.rub-header {
  background: var(--brand-navy);
  color: var(--text-on-dark);
  position: relative;
  overflow: hidden;
  border-bottom: var(--stroke) solid var(--border);
}
.rub-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    0deg,
    rgba(255,255,255,0) 0px,
    rgba(255,255,255,0) 2px,
    rgba(255,255,255,.025) 2px,
    rgba(255,255,255,.025) 3px
  );
  pointer-events: none;
  z-index: 0;
}
.rub-header__inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: stretch;
  position: relative;
  z-index: 1;
  min-height: 96px;
}

/* Wedge · orange surface w/ display type + wordmark */
.rub-header__wedge {
  background: var(--brand-orange);
  color: var(--text-primary);
  padding: var(--b-2) var(--b-4);
  display: flex;
  align-items: center;
  gap: var(--b-3);
  border-right: 2px solid var(--text-primary);
  text-decoration: none;
  transition: background var(--dur-fast) var(--ease-out);
}
.rub-header__wedge:hover { background: var(--brand-orange-hover, #d85a31); }
.rub-header__display {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 34px;
  line-height: .9;
  letter-spacing: -.025em;
  text-transform: uppercase;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
}
.rub-header__display-row {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}
.rub-header__display-slash {
  color: var(--brand-navy);
  font-weight: 500;
}
.rub-header__display-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--brand-navy);
  margin-top: 6px;
}
.rub-header__wordmark-cell {
  border-left: 1.5px solid var(--text-primary);
  padding-left: var(--b-2);
  display: flex;
  align-items: center;
}
.rub-header__wordmark {
  height: 30px;
  width: auto;
  display: block;
}

/* Meta strip · centered telemetry on navy (optional, per-page) */
.rub-header__meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--b-3);
  padding: 0 var(--b-4);
  font-family: var(--font-mono);
}
.rub-header__meta-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: flex-start;
  line-height: 1;
}
.rub-header__meta-k {
  color: rgba(255,255,255,.45);
  font-size: 9px;
  letter-spacing: .2em;
  text-transform: uppercase;
}
.rub-header__meta-v {
  color: var(--text-on-dark);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: .04em;
}
.rub-header__meta-cell--accent .rub-header__meta-v { color: var(--brand-orange); }
.rub-header__meta-cell--live .rub-header__meta-v {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.rub-header__meta-cell--live .rub-header__meta-v::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--brand-orange);
  border-radius: 50%;
  animation: rub-header-pulse 1.4s ease-in-out infinite;
}
.rub-header__meta-sep {
  width: 1px;
  height: 28px;
  background: rgba(255,255,255,.14);
}
@keyframes rub-header-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .4; transform: scale(.7); }
}

/* Right rail · user + logout + RUB label */
.rub-header__right {
  display: flex;
  align-items: center;
  gap: var(--b-2);
  padding: var(--b-2) var(--b-3) var(--b-2) var(--b-2);
  border-left: 1px solid rgba(255,255,255,.12);
}
.rub-header__user {
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(255,255,255,.7);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.rub-header__nav-link {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-on-dark);
  text-decoration: none;
  padding: 7px 12px;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: var(--radius-2);
  background: transparent;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}
.rub-header__nav-link:hover {
  background: var(--brand-orange);
  border-color: var(--brand-orange);
  color: var(--text-primary);
}
.rub-header__label-cell {
  padding-left: var(--b-2);
  border-left: 1px solid rgba(255,255,255,.12);
  display: flex;
  align-items: center;
}
.rub-header__label {
  height: 48px;
  width: auto;
  display: block;
}

/* Responsive — collapse display + wordmark on narrow */
@media (max-width: 900px) {
  .rub-header__display { font-size: 24px; }
  .rub-header__display-sub { display: none; }
  .rub-header__wordmark { height: 22px; }
  .rub-header__meta { display: none; }
}
@media (max-width: 640px) {
  .rub-header__wordmark-cell { display: none; }
  .rub-header__user { display: none; }
  .rub-header__label { height: 36px; }
}

/* Button system · works alongside Tailwind utility classes ----------
   Three semantic variants:
   - .btn-primary  · navy filled, core action (Login, Save, Create)
   - .btn-accent   · orange filled, hero CTA (New Project, sign-up nudge)
   - .btn-outline  · navy outline, secondary action
   - .btn-ghost    · text-only, tertiary action (Cancel, links-as-button)
   All inherit padding from `inline-flex px-N py-N` Tailwind utilities. */
.btn-primary,
.btn-accent,
.btn-outline,
.btn-ghost,
.btn-brand {  /* legacy alias, keep working */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--b-1);
  border-radius: var(--radius-2);
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
  border: var(--stroke) solid transparent;
  cursor: pointer;
}
.btn-primary,
.btn-brand {
  background: var(--brand-navy);
  color: var(--text-on-dark);
}
.btn-primary:hover,
.btn-brand:hover {
  background: var(--brand-navy-hover);
}
.btn-accent {
  background: var(--brand-orange);
  color: var(--text-on-dark);
}
.btn-accent:hover {
  background: #d85a31;
}
.btn-outline {
  background: transparent;
  color: var(--brand-navy);
  border-color: var(--brand-navy);
}
.btn-outline:hover {
  background: var(--brand-navy);
  color: var(--text-on-dark);
}
.btn-ghost {
  background: transparent;
  color: var(--text-primary);
}
.btn-ghost:hover {
  color: var(--brand-orange);
}
.btn-danger {
  background: var(--status-error);
  color: var(--text-on-dark);
}
.btn-danger:hover {
  background: #a52828;
}

/* Icon-button · square 28x28 ghost button for inline row actions ---------- */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-2);
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}
.icon-btn:hover {
  background: var(--surface-card);
  color: var(--text-primary);
}
.icon-btn--accent:hover {
  background: rgba(0, 53, 96, 0.08);
  color: var(--brand-navy);
}
.icon-btn--danger:hover {
  background: rgba(193, 48, 48, 0.10);
  color: var(--status-error);
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn--sm { width: 22px; height: 22px; }
.icon-btn--sm svg { width: 13px; height: 13px; }

/* Drag-handle · cursor + color treatment ---------- */
.drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--border);
  cursor: grab;
  transition: color var(--dur-fast) var(--ease-out);
}
.drag-handle:hover { color: var(--text-secondary); }
.drag-handle:active { cursor: grabbing; }

/* Schema list row · uniform card with drag-handle + color-dot + actions ---------- */
.list-row {
  background: var(--surface-bright);
  border: var(--stroke) solid var(--border-hairline);
  border-radius: var(--radius-1b);
  transition: border-color var(--dur-fast) var(--ease-out);
}
.list-row:hover { border-color: var(--border); }
.list-row__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
}
.list-row__sub {
  border-top: var(--stroke-hairline) solid var(--border-hairline);
  padding: 8px 16px;
  background: var(--surface-card);
  border-bottom-left-radius: var(--radius-1b);
  border-bottom-right-radius: var(--radius-1b);
}
.color-dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: var(--stroke-hairline) solid var(--border-hairline);
  flex-shrink: 0;
}

/* Hotkey · keyboard-cap chip ---------- */
.kbd-chip {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: var(--radius-2);
  background: var(--surface-card);
  border: var(--stroke-hairline) solid var(--border-hairline);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Inline-form panel · HTMX-loaded edit form below a list ---------- */
.form-panel {
  margin-top: var(--b-2);
  padding: var(--b-3);
  background: rgba(0, 53, 96, 0.04);
  border: var(--stroke) solid rgba(0, 53, 96, 0.20);
  border-left: 3px solid var(--brand-orange);
  border-radius: var(--radius-1b);
}
.form-panel__title {
  display: flex;
  align-items: baseline;
  gap: var(--b-1);
  font-weight: 500;
  font-size: var(--fs-body);
  color: var(--text-primary);
  margin-bottom: var(--b-2);
}
.form-panel__title small {
  font-family: var(--font-mono);
  font-size: var(--fs-caption);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  font-weight: 400;
}

/* Color-swatch picker · circular buttons ---------- */
.color-swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
  padding: 0;
}
.color-swatch:hover { border-color: var(--border); }
.color-swatch.is-selected {
  border-color: var(--text-primary);
  transform: scale(1.1);
}

/* Modal · centered overlay card ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: rgba(26, 26, 26, 0.45);
  padding: var(--b-3);
}
.modal-card {
  background: var(--surface-bright);
  border: var(--stroke) solid var(--border-hairline);
  border-radius: var(--radius-1b);
  padding: var(--b-3);
  max-width: 28rem;
  width: 100%;
  box-shadow: 0 10px 30px rgba(26, 26, 26, 0.20);
}

/* Context-menu popup · floating popover triggered by right-click ---------- */
.context-menu-popup {
  background: var(--surface-bright);
  border: var(--stroke) solid var(--border-hairline);
  border-radius: var(--radius-1b);
  box-shadow: 0 8px 24px rgba(26, 26, 26, 0.15);
}

/* Attribute pill-row · compact sub-row inside list-row__sub ---------- */
.sub-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px;
  border-radius: var(--radius-2);
  transition: background var(--dur-fast) var(--ease-out);
}
.sub-row:hover { background: var(--surface-bright); }

/* Back-link · subtle navigation arrow with mono caption ---------- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: var(--fs-caption);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}
.back-link:hover { color: var(--brand-orange); }
.back-link::before { content: "←"; font-family: var(--font-sans); }

/* Alert · semantic feedback block ---------- */
.alert {
  border-radius: var(--radius-1b);
  padding: var(--b-2) var(--b-3);
  border: var(--stroke) solid var(--border-hairline);
  background: var(--surface-bright);
}
.alert--danger {
  background: rgba(193, 48, 48, 0.06);
  border-color: rgba(193, 48, 48, 0.30);
  color: var(--status-error);
}
.alert--warning {
  background: rgba(184, 118, 26, 0.08);
  border-color: rgba(184, 118, 26, 0.35);
  color: var(--status-warning);
}
.alert--success {
  background: rgba(45, 122, 62, 0.08);
  border-color: rgba(45, 122, 62, 0.30);
  color: var(--status-success);
}
.alert--info {
  background: rgba(0, 53, 96, 0.06);
  border-color: rgba(0, 53, 96, 0.25);
  color: var(--brand-navy);
}

/* Empty-state · centered card with eyebrow + CTA ---------- */
.empty-state {
  background: var(--surface-bright);
  border: var(--stroke) dashed var(--border);
  border-radius: var(--radius-1b);
  padding: var(--b-8) var(--b-3);
  text-align: center;
}

/* Card system ----------
   - .card           · base panel, surface-bright on stage, subtle hairline
   - .card-elevated  · adds shadow + hover lift + orange top-accent on hover
   - .card__title    · 1.125rem semibold, 500-weight per CD
   - .card__meta     · mono caption (eyebrow style) */
.card,
.card-surface,
.card-elevated {
  background: var(--surface-bright);
  border-radius: var(--radius-1b);
  border: var(--stroke) solid var(--border-hairline);
  padding: var(--b-3);
  position: relative;
}
.card-elevated {
  box-shadow: 0 1px 2px rgba(26, 26, 26, 0.04);
  transition: box-shadow var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out);
  overflow: hidden;
}
.card-elevated::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--brand-orange);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-base) var(--ease-out);
}
.card-elevated:hover {
  box-shadow: 0 4px 16px rgba(26, 26, 26, 0.08);
  transform: translateY(-2px);
  border-color: var(--border);
}
.card-elevated:hover::before {
  transform: scaleX(1);
}
.card__title {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: var(--fs-lead);
  color: var(--text-primary);
  letter-spacing: -0.005em;
  margin: 0;
}
.card__meta {
  font-family: var(--font-mono);
  font-size: var(--fs-caption);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: var(--b-1);
}

/* Eyebrow · mono caption with orange accent dot ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-caption);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: var(--b-1);
}
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--brand-orange);
}

/* Section heading · orange accent bar left of title ---------- */
.h-accent {
  display: flex;
  align-items: center;
  gap: var(--b-2);
  font-weight: 500;
  letter-spacing: -0.005em;
}
.h-accent::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 1em;
  background: var(--brand-orange);
}

/* Inline link in body copy · orange underline on hover ---------- */
.link-accent {
  color: var(--brand-navy);
  text-decoration: none;
  background-image: linear-gradient(var(--brand-orange), var(--brand-orange));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0 2px;
  transition: background-size var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}
.link-accent:hover {
  background-size: 100% 2px;
  color: var(--brand-orange);
}

/* Form controls · global default for native inputs ----------
   Targets unstyled inputs inside <form> (e.g. Django's plain {{ field }}
   render). Tailwind utility classes on explicit inputs still take
   precedence due to specificity / source order. */
form input[type="text"],
form input[type="email"],
form input[type="password"],
form input[type="number"],
form input[type="url"],
form input[type="search"],
form input[type="date"],
form input[type="datetime-local"],
form input[type="time"],
form input[type="file"],
form select,
form textarea {
  width: 100%;
  background: var(--surface-bright);
  border: var(--stroke) solid var(--border);
  border-radius: var(--radius-2);
  padding: 8px 12px;
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  color: var(--text-primary);
  transition: border-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}
form input:focus,
form select:focus,
form textarea:focus {
  outline: none;
  border-color: var(--brand-navy);
  box-shadow: 0 0 0 3px rgba(0, 53, 96, 0.15);
}
form input::placeholder,
form textarea::placeholder {
  color: var(--text-secondary);
  opacity: 0.7;
}

/* Pill · semantic chip · sport, status, role ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: var(--fs-caption);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--surface-card);
  color: var(--text-primary);
  border: var(--stroke-hairline) solid var(--border-hairline);
}
.pill--accent {
  background: rgba(234, 102, 59, 0.12);
  color: #a64523;
  border-color: rgba(234, 102, 59, 0.35);
}
.pill--navy {
  background: rgba(0, 53, 96, 0.10);
  color: var(--brand-navy);
  border-color: rgba(0, 53, 96, 0.30);
}

/* =============================================================
   Cockpit Tagging Uplift — 2026-05-26
   Spec: docs/superpowers/specs/2026-05-26-tagging-cockpit-cd-uplift-design.md
   ============================================================= */

/* ---------- Vars ---------- */
:root {
  --pitch-green: #1D4D2A;

  --cd-color-l-min: 0.30;
  --cd-color-l-max: 0.75;
  --cd-color-c-min: 0.08;
  --cd-color-c-max: 0.20;

  --cockpit-bg:        #0F141A;
  --cockpit-row-a:     #171D26;
  --cockpit-row-b:     #0F141A;
  --cockpit-control:   #1A2230;
  --cockpit-border:    rgba(255,255,255,0.08);
  --cockpit-text:      rgba(255,255,255,0.85);
  --cockpit-text-sec:  rgba(255,255,255,0.55);
  --cockpit-text-mut:  rgba(255,255,255,0.30);
}

/* ---------- Eyebrow small variant ---------- */
.eyebrow--sm {
  font-size: 10px;
  letter-spacing: 0.08em;
}

/* ---------- Cockpit-Strip (telemetry bar) ---------- */
.cockpit-strip {
  display: flex;
  align-items: stretch;
  background: var(--brand-navy);
  color: var(--text-on-dark);
  border-radius: var(--radius-2);
  padding: 0;
  min-height: 44px;
  overflow: hidden;
  font-family: var(--font-mono);
}
.cockpit-strip__cell {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 6px var(--b-2);
  line-height: 1;
}
.cockpit-strip__key {
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
}
.cockpit-strip__value {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-on-dark);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cockpit-strip__cell--accent .cockpit-strip__value { color: var(--brand-orange); }
.cockpit-strip__input {
  background: rgba(255,255,255,0.10);
  color: var(--text-on-dark);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: var(--radius-2);
  padding: 2px 4px;
  font-family: var(--font-mono);
  font-size: 12px;
}
.cockpit-strip__cell--live .cockpit-strip__value::before {
  content: "";
  width: 6px; height: 6px;
  background: var(--brand-orange);
  border-radius: 50%;
  animation: rub-header-pulse 1.4s ease-in-out infinite;
}
.cockpit-strip__sep {
  width: 1px;
  background: rgba(255,255,255,0.14);
  margin: 8px 0;
  flex-shrink: 0;
}
.cockpit-strip__actions {
  display: flex;
  align-items: center;
  gap: var(--b-1);
  padding: 4px var(--b-1) 4px var(--b-2);
  margin-left: auto;
  border-left: 1px solid rgba(255,255,255,0.12);
}
.cockpit-strip__actions .btn-outline,
.cockpit-strip__actions .btn-ghost,
.cockpit-strip__actions .btn-accent {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 6px 10px;
}
.cockpit-strip__actions .btn-outline {
  background: transparent;
  color: var(--text-on-dark);
  border: 1px solid rgba(255,255,255,0.25);
}
.cockpit-strip__actions .btn-outline:hover {
  background: var(--brand-orange);
  border-color: var(--brand-orange);
  color: var(--text-primary);
}
.cockpit-strip__actions .btn-ghost {
  color: var(--text-on-dark);
  opacity: 0.85;
}
.cockpit-strip__actions .btn-ghost:hover { color: var(--brand-orange); opacity: 1; }
.cockpit-strip__actions .icon-btn {
  color: var(--text-on-dark);
  background: rgba(255,255,255,0.06);
}
.cockpit-strip__actions .icon-btn:hover {
  background: var(--brand-orange);
  color: var(--text-primary);
}

@media (max-width: 900px) {
  .cockpit-strip__cell--collapse-md { display: none; }
}
@media (max-width: 640px) {
  .cockpit-strip__cell--collapse-sm { display: none; }
}

/* ---------- Pitch-Frame + Coord-Bar ---------- */
.pitch-frame {
  overflow: hidden;
  cursor: crosshair;
  border-radius: var(--radius-1b);
  background: var(--pitch-green);
  border: var(--stroke) solid var(--border-hairline);
  transition: opacity var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out);
  opacity: 0.85;
}
.pitch-frame--armed {
  opacity: 1;
  box-shadow: 0 0 0 2px var(--brand-orange);
  animation: pitch-armed-pulse 1.6s ease-in-out infinite;
}
@keyframes pitch-armed-pulse {
  0%, 100% { box-shadow: 0 0 0 2px var(--brand-orange); }
  50%      { box-shadow: 0 0 0 3px var(--brand-orange); }
}
.pitch-coord-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px var(--b-2);
  background: var(--brand-navy);
  color: var(--text-on-dark);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  min-height: 28px;
}
.pitch-coord-bar__state,
.pitch-coord-bar__readout {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.pitch-coord-bar__indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  font-size: 12px;
  line-height: 1;
}
.pitch-coord-bar__indicator--idle   { color: rgba(255,255,255,0.45); }
.pitch-coord-bar__indicator--armed  {
  color: var(--brand-orange);
  animation: rub-header-pulse 1.4s ease-in-out infinite;
}
.pitch-coord-bar__indicator--tagged { color: var(--status-success); }

/* ---------- Cockpit-Card ---------- */
.cockpit-card {
  background: var(--surface-bright);
  border: var(--stroke) solid var(--border-hairline);
  border-radius: var(--radius-1b);
  padding: 0;
  position: relative;
  overflow: hidden;
}
.cockpit-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--brand-navy);
}
.cockpit-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--b-2);
  padding: 10px 12px 8px;
}
.cockpit-card__body { padding: 0 12px 12px; }
.cockpit-card__meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
}
.cockpit-card__footer {
  border-top: var(--stroke-hairline) solid var(--border-hairline);
  background: rgba(0,53,96,0.04);
  padding: 10px 12px;
}

/* ---------- Sequence-Active (replaces alert--danger for live sequence) ---------- */
.sequence-active {
  display: flex;
  align-items: center;
  gap: var(--b-1);
  padding: 8px 12px;
  border-radius: var(--radius-2);
  background: rgba(234,102,59,0.10);
  border: var(--stroke) solid rgba(234,102,59,0.35);
}
.sequence-active__dot {
  width: 8px; height: 8px;
  background: var(--brand-orange);
  border-radius: 50%;
  animation: rub-header-pulse 1.4s ease-in-out infinite;
  flex-shrink: 0;
}

/* ---------- kbd-chip on colored bg ---------- */
.kbd-chip--on-color {
  background: rgba(255,255,255,0.25);
  color: var(--text-on-dark);
  border-color: transparent;
}

/* ---------- Drag-Canvas armed state (selection ring) ---------- */
.drag-canvas-btn.is-armed {
  outline: 2px solid var(--brand-navy);
  outline-offset: 2px;
  z-index: 20;
}

/* ---------- Attribute-Pill system ---------- */
.attr-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: var(--radius-2);
  background: var(--surface-card);
  color: var(--text-primary);
  border: var(--stroke) solid var(--border-hairline);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              outline-color var(--dur-fast) var(--ease-out);
}
.attr-pill:hover {
  background: var(--surface-bright);
  border-color: var(--border);
}
.attr-pill.is-selected {
  background: var(--brand-navy);
  color: var(--text-on-dark);
  outline: 2px solid var(--brand-orange);
  outline-offset: 1px;
  border-color: var(--brand-navy);
}
.attr-pill--yes.is-selected {
  background: var(--status-success);
  border-color: var(--status-success);
  outline-color: transparent;
}
.attr-pill--no.is-selected {
  background: var(--status-error);
  border-color: var(--status-error);
  outline-color: transparent;
}
.attr-pill--input {
  cursor: text;
  font-family: var(--font-mono);
  text-align: right;
}
.attr-pill__label {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.attr-pill__required {
  color: var(--brand-orange);
  font-weight: 500;
}

/* ---------- Event-Row (replaces inline-styled rows in event_list.html) ---------- */
.event-row {
  display: flex;
  align-items: center;
  gap: var(--b-1);
  padding: 6px 12px;
  cursor: pointer;
  border-bottom: var(--stroke-hairline) solid var(--border-hairline);
  font-size: 12px;
  transition: background var(--dur-fast) var(--ease-out);
}
.event-row:hover { background: var(--surface-card); }
.event-row:last-child { border-bottom: none; }
.event-row__time {
  width: 48px;
  flex-shrink: 0;
  color: var(--brand-navy);
  font-weight: 500;
}
.event-row__type-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-on-dark);
  flex-shrink: 0;
}
.event-row__coords {
  color: var(--text-secondary);
  flex-shrink: 0;
}
.event-row__player {
  color: var(--text-primary);
  flex-shrink: 0;
}
.event-row__attr-chip {
  padding: 1px 6px;
  background: var(--surface-card);
  color: var(--text-secondary);
  font-size: 10px;
  border-radius: var(--radius-2);
  flex-shrink: 0;
}
.event-row__seq-tag {
  color: var(--text-secondary);
  font-size: 10px;
  flex-shrink: 0;
}
.event-row__delete {
  margin-left: auto;
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease-out);
}
.event-row:hover .event-row__delete { opacity: 1; }
.event-row.is-editing {
  background: var(--surface-card);
  box-shadow: inset 3px 0 0 var(--brand-orange);
}

/* ---------- Tagging page split layout (pitch | handle | mask) ---------- */
.tag-split {
  display: flex;
  align-items: flex-start;
}
.tag-split__main {
  flex: 0 0 66%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tag-split__handle {
  flex: 0 0 16px;
  align-self: stretch;
  cursor: col-resize;
  position: relative;
  touch-action: none;
}
.tag-split__handle::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 2px;
  border-radius: 2px;
  background: var(--border-hairline);
  transition: background var(--dur-fast) var(--ease-out);
}
.tag-split__handle:hover::before,
.tag-split--dragging .tag-split__handle::before { background: var(--brand-orange); }
.tag-split--dragging { user-select: none; cursor: col-resize; }
.tag-mask {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tag-mask__group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tag-mask--full {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 1023px) {
  .tag-split { flex-direction: column; gap: 12px; }
  .tag-split__main { flex-basis: auto !important; width: 100%; }
  .tag-split__handle { display: none; }
  .tag-mask { width: 100%; }
  .tag-mask--full { grid-template-columns: 1fr; }
}

/* ---------- Event inline editor (event_edit.html) ---------- */
.event-edit {
  padding: 8px 12px 10px;
  border-bottom: var(--stroke-hairline) solid var(--border-hairline);
  background: var(--surface-card);
}
.event-edit__header {
  display: flex;
  align-items: center;
  gap: var(--b-1);
  margin-bottom: 8px;
}
.event-edit__close { margin-left: auto; }
.event-edit__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}
.event-edit__section { margin-bottom: 8px; }
.event-edit__section:last-child { margin-bottom: 0; }

/* ---------- Dark-Cockpit surface + buttons (timeline window) ---------- */
.cockpit-surface-dark {
  background: var(--cockpit-bg);
  color: var(--cockpit-text);
}
.cockpit-btn--ghost {
  background: var(--cockpit-control);
  color: var(--cockpit-text-sec);
  border: 1px solid var(--cockpit-border);
  padding: 4px 10px;
  border-radius: var(--radius-2);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}
.cockpit-btn--ghost:hover {
  background: var(--brand-orange);
  color: var(--text-primary);
  border-color: var(--brand-orange);
}
.cockpit-btn--ghost:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}
.cockpit-btn--danger {
  background: var(--status-error);
  color: var(--text-on-dark);
  border: 1px solid var(--status-error);
  padding: 4px 10px;
  border-radius: var(--radius-2);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}
.cockpit-btn--danger:hover { background: #a52828; }
.cockpit-btn--danger:disabled {
  background: var(--cockpit-control);
  color: var(--cockpit-text-mut);
  border-color: var(--cockpit-border);
  cursor: not-allowed;
}

/* ── Analysis page ─────────────────────────────────────────── */
.analysis-split {
  display: grid;
  grid-template-columns: minmax(320px, 2fr) 3fr;
  gap: calc(var(--b) * 2);
  align-items: start;
}
@media (max-width: 1024px) {
  .analysis-split { grid-template-columns: 1fr; }
}
.analysis-split__right { position: sticky; top: calc(var(--b) * 2); }
.chip-group { margin-bottom: calc(var(--b) * 2); }
.chip-group__head { display: flex; align-items: center; justify-content: space-between; gap: var(--b); }
.chip-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }
.chip-count { font-family: var(--font-mono); font-size: 11px; opacity: 0.7; margin-left: 4px; }
.clip-list { list-style: none; padding: 0; margin: 0; border-top: var(--stroke) solid var(--border-hairline); }
.clip-row {
  display: grid;
  grid-template-columns: 2rem 3.5rem 1fr 1fr 3rem;
  gap: var(--b);
  align-items: center;
  padding: 6px var(--b);
  border-bottom: var(--stroke) solid var(--border-hairline);
  cursor: pointer;
}
.clip-row:hover { background: var(--surface-card); }
.clip-row.is-active { background: var(--surface-card); box-shadow: inset 3px 0 0 var(--brand-orange); }
.clip-row.is-skipped { opacity: 0.4; }
.clip-row__num { font-family: var(--font-mono); font-size: 12px; color: var(--text-secondary); }
.clip-row__label { font-weight: 500; }

/* ── Playlists ─────────────────────────────────────────────── */
.playlist-add { margin-bottom: var(--b); padding: var(--b); }
.playlist-add .playlist-add__field { width: 100%; text-align: left; }
.playlist-section .playlist-input, .analysis-panel .playlist-input { text-align: left; min-width: 0; }
.playlist-section { margin-bottom: calc(var(--b) * 1.5); }
.playlist-section__head {
  display: flex; align-items: center; gap: var(--b); padding: 6px var(--b);
  border-radius: 6px; background: var(--surface-card); border-left: 3px solid var(--brand-orange);
}
.playlist-section__num { font-family: var(--font-mono); font-size: 12px; color: var(--text-secondary); min-width: 1.5em; }
.playlist-section__tools { display: flex; gap: 2px; flex-shrink: 0; }
.playlist-section__tools .icon-btn[disabled] { opacity: 0.3; pointer-events: none; }

/* ── Analysis player ───────────────────────────────────────── */
.analysis-stage { background: var(--surface-card); border: var(--stroke) solid var(--border); border-radius: 8px; padding: var(--b); }
.analysis-stage__video { position: relative; background: #000; border-radius: 4px; overflow: hidden; }
.analysis-stage__video video { width: 100%; max-height: 60vh; display: block; }
.analysis-stage__empty {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; color: var(--text-on-dark); text-align: center; padding: calc(var(--b) * 2);
}
.video-link-form { width: 100%; max-width: 520px; margin-top: calc(var(--b) * 1.5); text-align: left; font-size: 13px; }
.video-link-form__label { display: block; margin-bottom: 4px; }
.video-link-form__row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.video-link-form__input {
  flex: 1 1 240px; min-width: 0; padding: 5px 8px; border-radius: 4px;
  border: var(--stroke) solid var(--border); background: var(--surface-bright); color: var(--text-primary); font-size: 13px;
}
.video-link-form__hint { margin-top: 4px; font-size: 11px; opacity: 0.75; }
.video-link-form__verdict { margin-top: 6px; padding: 4px 8px; border-radius: 4px; font-size: 12px; border-left: 3px solid; }
.video-link-form__verdict--ok { border-color: var(--status-success, #2E7D32); }
.video-link-form__verdict--warn { border-color: var(--status-warning); }
.video-link-form__verdict--error { border-color: var(--status-error); }
.video-link-form__error { margin-top: 4px; font-size: 12px; color: var(--status-error); }
.video-link-form--dark { color: var(--text-on-dark); }
.video-link-form--dark .video-link-form__input { background: #1a1a1a; color: #fafafa; border-color: #333; }
.video-link-form--dark .btn-ghost { color: var(--text-on-dark); }
.video-link-details { margin-top: 6px; font-size: 12px; }
.video-link-details > summary { cursor: pointer; color: var(--text-secondary); }
.video-link-details .video-link-form { margin-top: 6px; }
.analysis-stage:fullscreen { display: flex; flex-direction: column; background: #000; padding: calc(var(--b) * 2); }
.analysis-stage:fullscreen .analysis-stage__video { flex: 1; min-height: 0; }
.analysis-stage:fullscreen video { max-height: none; height: 100%; object-fit: contain; }
.analysis-stage:fullscreen .tagbar { background: var(--cockpit-bg); color: var(--cockpit-text); }
.tag-overlay {
  position: absolute; top: 12px; left: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  max-width: 70%; padding: 6px 10px 6px 14px; border-radius: 6px;
  background: rgba(15, 20, 26, 0.82); color: var(--text-on-dark); font-size: 14px;
}
.tag-overlay__bar { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; border-radius: 6px 0 0 6px; }
.tag-overlay__attr { font-size: 12px; opacity: 0.85; }
.tagbar { margin-top: var(--b); padding: var(--b); border-radius: 6px; background: var(--surface-bright); }
.tagbar__head { display: flex; align-items: center; gap: calc(var(--b) * 1.5); font-size: 14px; }
.tagbar__free { color: var(--status-warning); }
.tagbar__track { position: relative; height: 10px; margin: var(--b) 0; border-radius: 5px; background: var(--border-hairline); }
.tagbar__marker { position: absolute; top: 1px; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; }
.tagbar__playhead { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--brand-orange); }
.tagbar__sequence { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: var(--b); }
.tagbar__cards { display: flex; flex-direction: column; gap: 6px; }
.tag-card { display: flex; border: var(--stroke) solid var(--border-hairline); border-radius: 6px; overflow: hidden; opacity: 0.6; transition: opacity var(--dur-fast) var(--ease-out); }
.tag-card.is-active { opacity: 1; border-color: var(--brand-orange); }
.tag-card__bar { width: 5px; flex-shrink: 0; }
.tag-card__body { padding: 6px 10px; flex: 1; }
.tag-card__title { display: flex; align-items: baseline; justify-content: space-between; gap: var(--b); font-size: 16px; }
.player-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: var(--b); }
