/* Slash — shared tokens and components. */
:root {
  --canvas: #F3F0E8;
  --surface: #FFFEFA;
  --line: #DCD6CA;
  --line-strong: #B8B09F;
  --ink: #19372F;
  --muted: #68766D;
  --sunken: #EAE6DC;
  --signal: #B84F35;
  --signal-ink: #963C28;
  --ok: #5D7F48;
  --ok-ink: #496735;
  --lime: #D9EA82;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink);
  font-family: 'DM Sans', ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.mono { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace; font-variant-ligatures: none; }
.muted { color: var(--muted); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
[hidden] { display: none !important; }

/* Surfaces */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 3px; }
.topbar { border-bottom: 1px solid var(--ink); background: var(--ink); color: var(--surface); }
.rule { border: 0; border-top: 1px solid var(--line); margin: 0; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  height: 40px; padding: 0 16px; border-radius: 3px;
  font: 600 13px/1 'DM Sans', system-ui, sans-serif; white-space: nowrap; text-decoration: none;
  letter-spacing: .01em;
  color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); cursor: pointer;
  transition: transform .12s ease, background-color .12s ease, border-color .12s ease, color .12s ease;
}
.btn:hover { background: var(--sunken); }
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--lime); border-color: var(--lime); color: var(--ink); }
.btn-primary:hover { background: #C8DE5F; border-color: #C8DE5F; transform: scale(.992); }
.btn-primary:active { transform: scale(.975); }
.btn-lg { width: 100%; height: 54px; font-size: 14px; border-radius: 3px; }
.btn-sm { height: 32px; padding: 0 11px; font-size: 12px; border-radius: 3px; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--sunken); }
@media (hover: hover) { .btn-danger:hover { border-color: var(--signal-ink); color: var(--signal-ink); background: var(--surface); } }
.btn-danger[data-armed="true"] { background: var(--signal-ink); border-color: var(--signal-ink); color: #fff; }

/* Fields */
.label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 500; }
.hint { margin-top: 8px; font-size: 13px; color: var(--muted); min-height: 18px; }
.hint[data-tone="error"] { color: var(--signal-ink); }
.hint[data-tone="ok"] { color: var(--ok-ink); }
.hint:empty { min-height: 0; margin-top: 0; }
.input {
  display: block; width: 100%; height: 52px; padding: 0 14px;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: 3px;
  font: 400 15px/1 'DM Sans', system-ui, sans-serif;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.input.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 14px; }
.input.sm { height: 38px; font-size: 14px; border-radius: 8px; }
.input::placeholder { color: #A1A1A6; }
.input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(25, 55, 47, .1); }
.input[aria-invalid="true"] { border-color: var(--signal-ink); }

/* Alias field: locked host prefix + editable slug */
.alias { display: flex; align-items: stretch; height: 52px; border: 1px solid var(--line-strong); border-radius: 3px; background: var(--surface); overflow: hidden; transition: border-color .12s, box-shadow .12s; }
.alias:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(25, 55, 47, .1); }
.alias[data-invalid="true"] { border-color: var(--signal-ink); }
.alias-prefix { display: flex; align-items: center; max-width: 60%; padding: 0 12px; background: var(--sunken); border-right: 1px solid var(--line); color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; user-select: none; }
.alias input { flex: 1; min-width: 0; border: 0; outline: 0; padding: 0 12px; background: transparent; color: var(--ink); font: 400 14px 'JetBrains Mono', ui-monospace, monospace; }

/* Segmented control (N options). JS sets --i to the selected index. */
.seg { position: relative; display: grid; grid-template-columns: repeat(var(--n, 2), 1fr); padding: 3px; background: var(--sunken); border: 1px solid var(--line); border-radius: 3px; }
.seg-thumb { position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc((100% - 6px) / var(--n, 2)); background: var(--ink); border: 1px solid var(--ink); border-radius: 2px; transform: translateX(calc(var(--i, 0) * 100%)); transition: transform .22s cubic-bezier(.3, .8, .3, 1); }
.seg button { position: relative; z-index: 1; height: 36px; padding: 0 12px; background: none; border: 0; border-radius: 2px; font: 600 13px/1 'DM Sans', system-ui, sans-serif; color: var(--muted); cursor: pointer; transition: color .15s; }
.seg button[aria-checked="true"] { color: var(--ink); }
.seg button[aria-checked="true"] { color: var(--surface); }
.seg.sm button { height: 28px; font-size: 13px; }

/* Expiration chips */
.chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.chip { height: 38px; padding: 0 4px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 3px; font: 600 12px/1 'DM Sans', system-ui, sans-serif; color: var(--muted); cursor: pointer; transition: transform .12s, border-color .12s, color .12s; }
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip:active { transform: scale(.96); }
.chip[aria-checked="true"] { color: var(--ink); border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); background: var(--sunken); }

/* Monospace preview pill */
.pill { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; height: 28px; padding: 0 12px; border: 1px solid var(--line); border-radius: 2px; background: var(--surface); font: 400 11px/1 'JetBrains Mono', ui-monospace, monospace; color: var(--muted); overflow: hidden; white-space: nowrap; }
.pill.dashed { border-style: dashed; background: transparent; }

/* Status */
.dot { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.dot.live { background: var(--ok); }
.dot.warn { background: var(--signal); }
.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border: 1px solid var(--line); border-radius: 2px; background: var(--surface); font-size: 11px; font-weight: 600; white-space: nowrap; }
.badge[data-tone="live"] .dot { background: var(--ok); }
.badge[data-tone="warn"] .dot { background: var(--signal); }

/* Collapsible reveal: hidden content leaves the tab order */
.reveal { display: grid; grid-template-rows: 0fr; opacity: 0; visibility: hidden; transition: grid-template-rows .28s ease, opacity .2s ease, visibility 0s linear .28s; }
.reveal[data-open="true"] { grid-template-rows: 1fr; opacity: 1; visibility: visible; transition: grid-template-rows .28s ease, opacity .2s ease, visibility 0s; }
.reveal > .reveal-inner { min-height: 0; overflow: hidden; }

/* Dialog */
dialog.dialog { width: min(420px, calc(100vw - 32px)); padding: 0; background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); border-radius: 3px; box-shadow: 12px 12px 0 rgba(25, 55, 47, .14); }
dialog.dialog::backdrop { background: rgba(15, 31, 26, .55); }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 50; max-width: calc(100vw - 32px); padding: 10px 14px; border-radius: 8px; background: var(--ink); color: #fff; font-size: 13px; transform: translate(-50%, 12px); opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; }
.toast[data-show="true"] { opacity: 1; transform: translate(-50%, 0); }

.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--surface); text-decoration: none; font-weight: 600; font-size: 15px; letter-spacing: -.01em; }
.link { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.link:hover { text-decoration-color: var(--ink); }

.truncate-1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; scroll-behavior: auto !important; }
}
