/* ============================================================
   Arkhenz Design System — component styles.
   Extracted verbatim from the DS component bundle (the prototype
   injected these at runtime via JS). Static build links them here.
   ============================================================ */

/* ---- Badge ---- */
.ark-badge{
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-family: var(--font-mono); font-weight: var(--weight-medium);
  font-size: var(--text-2xs); letter-spacing: .06em; text-transform: uppercase;
  height: 22px; padding: 0 var(--space-2); border-radius: var(--radius-xs);
  border: 1px solid transparent; white-space: nowrap;
}
.ark-badge__dot{ width: 6px; height: 6px; border-radius: 999px; background: currentColor; }
.ark-badge--soft{ background: var(--bg-surface-2); color: var(--text-muted); }
.ark-badge--neutral{ background: var(--bg-surface-2); color: var(--text-body); border-color: var(--border-subtle); }
.ark-badge--brand{ background: var(--brand-soft); color: var(--brand); }
.ark-badge--accent{ background: color-mix(in srgb, var(--signal-500) 16%, transparent); color: var(--signal-700); }
[data-theme="dark"] .ark-badge--accent,.theme-dark .ark-badge--accent{ color: var(--signal-400); }
.ark-badge--positive{ background: color-mix(in srgb, var(--positive) 15%, transparent); color: var(--signal-700); }
.ark-badge--caution{ background: color-mix(in srgb, var(--caution) 18%, transparent); color: #946a08; }
.ark-badge--critical{ background: color-mix(in srgb, var(--critical) 15%, transparent); color: #b23b2a; }
.ark-badge--info{ background: color-mix(in srgb, var(--info) 16%, transparent); color: #1d7fa8; }
.ark-badge--solid{ border: 0; }
.ark-badge--solid.ark-badge--brand{ background: var(--brand); color: var(--text-on-brand); }
.ark-badge--solid.ark-badge--accent{ background: var(--signal-500); color: var(--accent-ink); }
.ark-badge--solid.ark-badge--positive{ background: var(--positive); color: #06231a; }
.ark-badge--solid.ark-badge--critical{ background: var(--critical); color: #fff; }

/* ---- Button ---- */
.ark-btn{
  --_h: var(--control-md);
  font-family: var(--font-sans);
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
  line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  height: var(--_h); padding: 0 var(--space-5);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background var(--dur-fast) var(--ease-standard),
              border-color var(--dur-fast) var(--ease-standard),
              box-shadow var(--dur-fast) var(--ease-standard),
              transform var(--dur-instant) var(--ease-standard),
              color var(--dur-fast) var(--ease-standard);
  user-select: none;
}
.ark-btn:focus-visible{ outline: none; box-shadow: var(--focus-ring); }
.ark-btn:active{ transform: scale(0.98); }
.ark-btn[disabled],.ark-btn[aria-disabled="true"]{ opacity: .45; pointer-events: none; box-shadow: none; }
.ark-btn--sm{ --_h: var(--control-sm); font-size: var(--text-xs); padding: 0 var(--space-3); border-radius: var(--radius-xs); }
.ark-btn--lg{ --_h: var(--control-lg); font-size: var(--text-base); padding: 0 var(--space-6); }
.ark-btn--full{ width: 100%; }

/* primary — forest fill (signal fill in dark theme via --brand) */
.ark-btn--primary{ background: var(--brand); color: var(--text-on-brand); }
.ark-btn--primary:hover{ background: var(--forest-700); }
[data-theme="dark"] .ark-btn--primary,.theme-dark .ark-btn--primary{ color: var(--text-on-brand); }
[data-theme="dark"] .ark-btn--primary:hover,.theme-dark .ark-btn--primary:hover{ background: var(--signal-400); box-shadow: var(--glow-signal-sm); }

/* accent — luminous signal, the single loudest action */
.ark-btn--accent{ background: var(--signal-500); color: var(--accent-ink); }
.ark-btn--accent:hover{ background: var(--signal-400); box-shadow: var(--glow-signal-sm); }

/* secondary — bordered, quiet */
.ark-btn--secondary{ background: var(--bg-surface); color: var(--text-strong); border-color: var(--border-default); }
.ark-btn--secondary:hover{ border-color: var(--border-strong); background: var(--bg-surface-2); }

/* ghost — text only */
.ark-btn--ghost{ background: transparent; color: var(--text-body); }
.ark-btn--ghost:hover{ background: var(--bg-surface-2); color: var(--text-strong); }

/* danger */
.ark-btn--danger{ background: var(--critical); color: #fff; }
.ark-btn--danger:hover{ filter: brightness(0.93); }

.ark-btn__spin{ width: 1em; height: 1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 999px; animation: ark-btn-spin .6s linear infinite; }
@keyframes ark-btn-spin{ to{ transform: rotate(360deg); } }

/* button icon sizing (lucide <i> swapped to <svg>) */
.ark-btn i, .ark-btn svg{ width: 1.05em; height: 1.05em; flex: 0 0 auto; }
.ark-btn--lg i, .ark-btn--lg svg{ width: 1.1em; height: 1.1em; }

/* ---- IconButton ---- */
.ark-iconbtn{
  --_s: var(--control-md);
  display: inline-flex; align-items: center; justify-content: center;
  width: var(--_s); height: var(--_s); padding: 0;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  background: transparent; color: var(--text-body); cursor: pointer;
  transition: all var(--dur-fast) var(--ease-standard);
}
.ark-iconbtn svg,.ark-iconbtn i{ width: 1.25em; height: 1.25em; font-size: 18px; }
.ark-iconbtn:focus-visible{ outline: none; box-shadow: var(--focus-ring); }
.ark-iconbtn:active{ transform: scale(0.96); }
.ark-iconbtn[disabled]{ opacity: .45; pointer-events: none; }
.ark-iconbtn--sm{ --_s: var(--control-sm); }
.ark-iconbtn--lg{ --_s: var(--control-lg); }
.ark-iconbtn--ghost:hover{ background: var(--bg-surface-2); color: var(--text-strong); }
.ark-iconbtn--outline{ border-color: var(--border-default); }
.ark-iconbtn--outline:hover{ border-color: var(--border-strong); background: var(--bg-surface-2); color: var(--text-strong); }
.ark-iconbtn--solid{ background: var(--brand); color: var(--text-on-brand); }
.ark-iconbtn--solid:hover{ background: var(--forest-700); }
[data-theme="dark"] .ark-iconbtn--solid:hover,.theme-dark .ark-iconbtn--solid:hover{ background: var(--signal-400); box-shadow: var(--glow-signal-sm); }

/* ---- Tag ---- */
.ark-tag{
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-family: var(--font-sans); font-weight: var(--weight-medium); font-size: var(--text-sm);
  height: 32px; padding: 0 var(--space-3); border-radius: var(--radius-pill);
  background: var(--bg-surface); color: var(--text-body);
  border: 1px solid var(--border-default); cursor: default; white-space: nowrap;
  transition: all var(--dur-fast) var(--ease-standard);
}
.ark-tag--clickable{ cursor: pointer; }
.ark-tag--clickable:hover{ border-color: var(--border-strong); color: var(--text-strong); }
.ark-tag--selected{ background: var(--brand); border-color: var(--brand); color: var(--text-on-brand); }
[data-theme="dark"] .ark-tag--selected,.theme-dark .ark-tag--selected{ color: var(--accent-ink); }
.ark-tag__x{
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; margin-right: -4px; border-radius: 999px;
  background: transparent; border: 0; color: inherit; cursor: pointer; opacity: .6; font-size: 14px; line-height: 1;
}
.ark-tag__x:hover{ opacity: 1; background: color-mix(in srgb, currentColor 18%, transparent); }

/* ---- Toast ---- */
.ark-toast{
  display: flex; align-items: flex-start; gap: var(--space-3);
  width: 340px; max-width: 92vw; box-sizing: border-box;
  background: var(--bg-surface); color: var(--text-body);
  border: 1px solid var(--border-subtle); border-left: 3px solid var(--border-strong);
  border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
  padding: var(--space-4) var(--space-4);
  font-family: var(--font-sans);
}
.ark-toast__icon{ display: flex; flex: none; width: 20px; height: 20px; margin-top: 1px; }
.ark-toast__icon svg,.ark-toast__icon i{ width: 20px; height: 20px; }
.ark-toast__body{ flex: 1; min-width: 0; }
.ark-toast__title{ font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--text-strong); }
.ark-toast__desc{ font-size: var(--text-xs); color: var(--text-muted); margin-top: 2px; line-height: 1.45; }
.ark-toast__x{ flex: none; background: transparent; border: 0; color: var(--text-faint); cursor: pointer; font-size: 16px; line-height: 1; padding: 2px; border-radius: var(--radius-xs); }
.ark-toast__x:hover{ color: var(--text-strong); background: var(--bg-surface-2); }
.ark-toast--positive{ border-left-color: var(--positive); }
.ark-toast--positive .ark-toast__icon{ color: var(--signal-700); }
.ark-toast--critical{ border-left-color: var(--critical); }
.ark-toast--critical .ark-toast__icon{ color: var(--critical); }
.ark-toast--info{ border-left-color: var(--info); }
.ark-toast--info .ark-toast__icon{ color: var(--info); }
.ark-toast--brand{ border-left-color: var(--brand); }
.ark-toast--brand .ark-toast__icon{ color: var(--brand); }

/* ---- Input ---- */
.ark-field{ display: flex; flex-direction: column; gap: var(--space-2); font-family: var(--font-sans); }
.ark-field__label{ font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--text-strong); }
.ark-field__req{ color: var(--critical); margin-left: 2px; }
.ark-field__wrap{ position: relative; display: flex; align-items: center; }
.ark-field__icon{ position: absolute; display: flex; color: var(--text-faint); pointer-events: none; }
.ark-field__icon svg,.ark-field__icon i{ width: 18px; height: 18px; }
.ark-field__icon--l{ left: var(--space-3); }
.ark-field__icon--r{ right: var(--space-3); }
.ark-input{
  width: 100%; height: var(--control-md); box-sizing: border-box;
  font-family: inherit; font-size: var(--text-sm); color: var(--field-text);
  background: var(--field-bg); border: 1px solid var(--field-border);
  border-radius: var(--radius-sm); padding: 0 var(--space-3);
  transition: border-color var(--dur-fast) var(--ease-standard), box-shadow var(--dur-fast) var(--ease-standard);
}
.ark-input::placeholder{ color: var(--field-placeholder); }
.ark-input:hover{ border-color: var(--border-strong); }
.ark-input:focus{ outline: none; border-color: var(--border-accent); box-shadow: var(--focus-ring); }
.ark-input--has-l{ padding-left: calc(var(--space-3) + 26px); }
.ark-input--has-r{ padding-right: calc(var(--space-3) + 26px); }
.ark-input[disabled]{ opacity: .55; cursor: not-allowed; }
.ark-field--error .ark-input{ border-color: var(--critical); }
.ark-field--error .ark-input:focus{ box-shadow: 0 0 0 3px color-mix(in srgb, var(--critical) 30%, transparent); }
.ark-field__hint{ font-size: var(--text-xs); color: var(--text-muted); font-family: var(--font-mono); }
.ark-field--error .ark-field__hint{ color: var(--critical); }

/* ---- Switch ---- */
.ark-switch{ display: inline-flex; align-items: center; gap: var(--space-3); cursor: pointer; font-family: var(--font-sans); user-select: none; }
.ark-switch input{ position: absolute; opacity: 0; width: 0; height: 0; }
.ark-switch__track{
  position: relative; width: 42px; height: 24px; flex: none;
  background: var(--stone-300); border-radius: 999px;
  transition: background var(--dur-base) var(--ease-standard), box-shadow var(--dur-base) var(--ease-standard);
}
[data-theme="dark"] .ark-switch__track,.theme-dark .ark-switch__track{ background: var(--ink-600); }
.ark-switch__thumb{
  position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
  background: #fff; border-radius: 999px; box-shadow: var(--shadow-sm);
  transition: transform var(--dur-base) var(--ease-standard);
}
.ark-switch input:checked + .ark-switch__track{ background: var(--brand); }
[data-theme="dark"] .ark-switch input:checked + .ark-switch__track,.theme-dark .ark-switch input:checked + .ark-switch__track{ background: var(--signal-500); box-shadow: var(--glow-signal-sm); }
.ark-switch input:checked + .ark-switch__track .ark-switch__thumb{ transform: translateX(18px); }
.ark-switch input:focus-visible + .ark-switch__track{ box-shadow: var(--focus-ring); }
.ark-switch input:disabled + .ark-switch__track{ opacity: .5; }
.ark-switch--disabled{ cursor: not-allowed; }
.ark-switch__label{ font-size: var(--text-sm); color: var(--text-body); }

/* ---- Card ---- */
.ark-card{
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  color: var(--text-body);
  position: relative;
  transition: box-shadow var(--dur-base) var(--ease-standard),
              border-color var(--dur-base) var(--ease-standard),
              transform var(--dur-base) var(--ease-standard);
}
.ark-card--pad-sm{ padding: var(--space-4); }
.ark-card--pad-md{ padding: var(--space-5); }
.ark-card--pad-lg{ padding: var(--space-6); }
.ark-card--pad-none{ padding: 0; }
.ark-card--interactive{ cursor: pointer; }
.ark-card--interactive:hover{
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
  transform: translateY(-2px);
}
[data-theme="dark"] .ark-card--interactive:hover,.theme-dark .ark-card--interactive:hover{
  border-color: var(--border-accent);
  box-shadow: var(--glow-signal-sm);
}
.ark-card--accent::before{
  content: ""; position: absolute; top: 0; left: var(--space-5); right: var(--space-5); height: 2px;
  background: var(--signal-500); border-radius: 0 0 2px 2px;
}

/* ---- StatBlock ---- */
.ark-stat{ font-family: var(--font-sans); }
.ark-stat__value{
  font-family: var(--font-display); font-weight: var(--weight-semibold);
  font-size: var(--text-3xl); line-height: 1; letter-spacing: var(--tracking-tighter);
  color: var(--text-strong); display: flex; align-items: baseline; gap: 2px;
}
.ark-stat__value--accent{ color: var(--brand); }
.ark-stat__suffix{ font-size: var(--text-xl); color: var(--text-muted); font-weight: var(--weight-medium); }
.ark-stat__label{
  font-family: var(--font-mono); font-size: var(--text-2xs); letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase; color: var(--text-muted); margin-top: var(--space-2);
}
