/* ════════════════════════════════════════════════════════════════════
   Atlas Field Kit — inventory terminal / clipboard manifest
   Utilitarian precision: steel sheet, white manifest panels, graphite
   ink, one safety-orange accent. Mono is reserved for system data
   (tags, serials, counts, dates, codes). Signature device: bordered
   mono asset-tag chips, like stenciled equipment labels.
   Chrome: a two-deck ops console — graphite decks, a mono environment
   chip, and station tabs; mono station labels are system chrome.
   ──────────────────────────────────────────────────────────────────── */

:root {
  color-scheme: light;

  /* surfaces */
  --bg: #f4f6f7;            /* light steel sheet */
  --panel: #ffffff;         /* white manifest panels */
  --wash: #edf1f3;          /* row-hover steel wash */
  --line: #dde2e5;          /* hairline rules */
  --line-strong: #b9c1c7;   /* dashed slips, emphasized rules */

  /* ink */
  --ink: #1e2226;           /* graphite */
  --ink-soft: #3a424a;      /* secondary ink */
  --muted: #5a6572;         /* slate — 5.9:1 on white, 5.5:1 on steel */
  --border-control: #5f6a73;/* 1px graphite input borders */

  /* accent — safety orange, the single accent */
  --accent: #e85d26;        /* rails, ticks, fills (ink text on top) */
  --accent-bright: #f06c36; /* hover lift on filled controls */
  --accent-ink: #c2410c;    /* orange as text on light — 5.2:1 */
  --accent-wash: #fdf0e8;   /* selected-row wash */

  /* status */
  --ok: #2e7d4f;            /* in service / available — 5.1:1 */
  --warn: #b07818;          /* attention amber (dots, graphics) */
  --warn-ink: #8a5d10;      /* amber as text — 5.8:1 */
  --retired: #7b8691;       /* retired dot */
  --danger: #b3352b;        /* destructive / errors — 6.1:1 */

  /* graphite header bar */
  --bar: #1e2226;
  --bar-line: #343b42;
  --bar-edge: #4a535b;
  --bar-muted: #9aa5ad;     /* 6.4:1 on bar */

  /* type */
  --sans: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  /* geometry */
  --r-chip: 3px;
  --r-ctl: 4px;
  --r-panel: 6px;
  --tick: 8px;              /* checklist tick before section labels */

  /* manifest board columns: tag · asset · category · site · status */
  --board-cols: 150px minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1.3fr) 128px;
}

/* ── base ─────────────────────────────────────────────────────────── */

* { box-sizing: border-box; }

[hidden],
.hidden { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body:has(.access-grid:target) { overflow: hidden; }

h1, h2, h3, p, dl, dd, figure { margin: 0; }

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

#access, #inventory, #locations, #service { scroll-margin-top: 112px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.muted { color: var(--muted); }

/* ── small-caps labels + checklist tick ───────────────────────────── */

.eyebrow,
.card-kicker,
.panel-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow::before,
.card-kicker::before {
  content: "";
  flex: 0 0 auto;
  width: var(--tick);
  height: 2px;
  background: var(--accent);
}

.eyebrow { margin-bottom: 6px; }

/* ── ops-console chrome: graphite two-deck ────────────────────────── */

/* Deck one holds the mark, the environment readout, and the session.
   Deck two is the station rail: dense mono tabs aligned to the content
   column; the lit station fills safety orange and fuses with the
   chrome's 2px orange baseline. */

.topbar {
  --chrome-pad: max(16px, calc((100% - 1200px) / 2));
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bar);
  color: #fff;
  border-bottom: 2px solid var(--accent);
}

.deck {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px var(--chrome-pad);
  border-bottom: 1px solid var(--bar-line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 1 auto;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border: 1px solid var(--accent);
  border-radius: var(--r-chip);
  color: var(--accent);
  font: 600 15px/1 var(--mono);
}

.brand strong {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* mono environment readout — the console's context chip */
.env-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 1px solid var(--bar-edge);
  border-radius: var(--r-chip);
  color: var(--bar-muted);
  font: 500 10px/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}

.env-chip > span:last-child { color: #fff; }

.env-dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 1px;
  background: var(--accent);
  animation: env-pulse 2.6s ease-in-out infinite;
}

@keyframes env-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* station rail — scrolls within its own strip when cramped */
.console-rail {
  display: flex;
  padding: 0 var(--chrome-pad);
  overflow-x: auto;
  scrollbar-width: none;
}

.console-rail::-webkit-scrollbar { display: none; }

.console-tab {
  flex: 0 0 auto;
  display: grid;
  gap: 3px;
  padding: 9px 18px 10px;
  color: #fff;
  text-decoration: none;
  transition: background 140ms ease, color 140ms ease;
}

.console-tab + .console-tab { border-left: 1px solid var(--bar-line); }

.console-tab span {
  font: 600 11px/1.2 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.console-tab small {
  color: var(--bar-muted);
  font: 500 9px/1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.console-tab:hover { background: var(--bar-line); }

.console-tab:focus-visible { outline-offset: -3px; }

/* lit station: ink on safety orange, fused with the baseline rule */
.console-tab.active {
  background: var(--accent);
  color: var(--ink);
}

.console-tab.active small { color: var(--ink); }

.console-tab.active:hover { background: var(--accent-bright); }

.console-tab.active:focus-visible { outline-color: #fff; }

.account-dock {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  margin-left: auto;
  min-width: 0;
}

.account-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.account-chip strong,
.account-chip small {
  display: block;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-chip strong {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
}

.account-chip small {
  margin-top: 2px;
  color: var(--bar-muted);
  font: 500 9px/1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 1px solid var(--bar-edge);
  border-radius: var(--r-chip);
  color: #fff;
  font: 600 11px/1 var(--mono);
  letter-spacing: 0.05em;
}

/* sign-in action on the bar */
.account-dock a.button {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--ink);
}

.account-dock a.button:hover {
  background: var(--accent-bright);
  border-color: var(--accent-bright);
}

#logoutButton {
  background: transparent;
  border-color: var(--bar-edge);
  color: #fff;
}

#logoutButton:hover {
  background: transparent;
  border-color: var(--accent);
  color: var(--accent);
}

/* ── layout shell ─────────────────────────────────────────────────── */

main {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 88px;
}

/* ── hero: manifest headline + day sheet ──────────────────────────── */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 44px;
  align-items: center;
  padding: 26px 0 40px;
  border-bottom: 1px solid var(--line);
}

.hero h1 {
  max-width: 640px;
  margin: 10px 0 16px;
  font-size: clamp(28px, 4.2vw, 44px);
  font-weight: 600;
  line-height: 1.14;
  letter-spacing: -0.015em;
}

.hero-copy > p {
  max-width: 560px;
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.hero-card {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
}

.hero-card .card-kicker {
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}

.hero-card strong {
  display: block;
  padding: 18px 18px 4px;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.hero-card > span:last-child {
  display: block;
  padding: 0 18px 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

/* ── buttons ──────────────────────────────────────────────────────── */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 16px;
  border: 1px solid var(--ink);
  border-radius: var(--r-ctl);
  background: var(--panel);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.button:hover { background: var(--wash); }

.button:active { transform: translateY(1px); }

/* ink on safety orange, like stenciled signage — 4.6:1 */
.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--ink);
}

.button.primary:hover {
  background: var(--accent-bright);
  border-color: var(--accent-bright);
}

.button.secondary {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.button.secondary:hover {
  background: var(--ink-soft);
  border-color: var(--ink-soft);
}

.button.ghost {
  background: transparent;
}

.button.small {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 13px;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.button:disabled:active { transform: none; }

/* ── team access overlay ──────────────────────────────────────────── */

.access-grid {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 60;
  grid-template-columns: repeat(2, minmax(300px, 420px));
  justify-content: center;
  align-content: center;
  gap: 20px;
  padding: 96px 20px 32px;
  overflow-y: auto;
}

.access-grid:target { display: grid; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: rgba(30, 34, 38, 0.58);
  backdrop-filter: blur(3px);
}

.access-modal-head {
  position: absolute;
  top: 26px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 8px 8px 8px 16px;
  background: var(--bar);
  border: 1px solid var(--bar-line);
  border-radius: var(--r-ctl);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}

.access-modal-head a {
  padding: 6px 12px;
  border-radius: var(--r-chip);
  background: var(--accent);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: background 140ms ease;
}

.access-modal-head a:hover { background: var(--accent-bright); }

@keyframes panel-rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.access-panel {
  display: grid;
  gap: 14px;
  align-content: start;
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  animation: panel-rise 150ms ease both;
}

.access-panel.tinted { background: var(--bg); }

.access-panel h2 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* issued-credentials slip */
.demo-login {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-ctl);
  background: var(--bg);
}

.access-panel.tinted .demo-login { background: var(--panel); }

.demo-login div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.demo-login strong { font-size: 13px; font-weight: 600; }

.demo-login code {
  color: var(--muted);
  font: 500 12px/1.4 var(--mono);
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
}

/* ── forms ────────────────────────────────────────────────────────── */

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border-control);
  border-radius: var(--r-ctl);
  background: var(--panel);
  color: var(--ink);
  font: 400 14px/1.4 var(--sans);
  letter-spacing: normal;
  text-transform: none;
  transition: border-color 120ms ease;
}

input:hover,
select:hover,
textarea:hover { border-color: var(--ink); }

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  border-color: var(--ink);
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

input::placeholder,
textarea::placeholder { color: var(--muted); opacity: 1; }

input:disabled,
select:disabled,
textarea:disabled {
  background: var(--bg);
  border-color: var(--line-strong);
  color: var(--muted);
  cursor: not-allowed;
}

textarea {
  min-height: 84px;
  resize: vertical;
}

/* system-data fields read as stencil entries */
input[name="asset_tag"],
input[name="serial_number"],
input[name="purchase_price"],
input[name="purchase_date"],
#searchInput {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

input[type="search"] { appearance: none; -webkit-appearance: none; }

.form-status {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.form-status.error { color: var(--danger); }
.form-status.success { color: var(--ok); }

.form-note {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-ctl);
  background: var(--bg);
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.5;
}

/* ── sections ─────────────────────────────────────────────────────── */

.workspace,
.location-section { margin-top: 36px; }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.section-head h2 {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.toolbar {
  display: flex;
  gap: 8px;
  flex: 0 1 auto;
}

.toolbar input {
  width: 320px;
  max-width: 100%;
  flex: 0 1 320px;
  min-width: 0;
}

/* ── ledger totals strip ──────────────────────────────────────────── */

.metric-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  margin-bottom: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  overflow: hidden;
}

.metric {
  padding: 14px 18px 12px;
  border-left: 1px solid var(--line);
  min-width: 0;
}

.metric:first-child { border-left: 0; }

.metric strong {
  display: block;
  font: 600 24px/24px var(--mono);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.metric span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.metric.locked strong {
  font: 500 13px/24px var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── custody board: ruled manifest rows ───────────────────────────── */

.asset-board { display: block; }

.board-rows {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  overflow: hidden;
}

.board-columns {
  display: grid;
  grid-template-columns: var(--board-cols);
  gap: 0 16px;
  padding: 9px 16px 8px 18px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.board-columns span:last-child { justify-self: end; }

.asset-card {
  display: grid;
  grid-template-columns: var(--board-cols);
  grid-template-areas: "tag main cat site status";
  gap: 2px 16px;
  align-items: center;
  width: 100%;
  padding: 11px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-left: 2px solid transparent;
  background: var(--panel);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 130ms ease, border-color 130ms ease;
}

.asset-card:last-child { border-bottom: 0; }

.asset-card:hover {
  background: var(--wash);
  border-left-color: var(--accent);
}

.asset-card.active {
  background: var(--accent-wash);
  border-left-color: var(--accent);
}

.asset-card:focus-visible {
  outline-offset: -2px;
}

.asset-card > .pill.tag { grid-area: tag; }

.asset-main {
  grid-area: main;
  display: grid;
  gap: 2px;
  min-width: 0;
}

.asset-name {
  display: block;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-desc {
  display: block;
  font-size: 12.5px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-cat,
.asset-site {
  color: var(--ink-soft);
  font-size: 13px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-cat { grid-area: cat; }
.asset-site { grid-area: site; }

.asset-card > .pill:not(.tag) {
  grid-area: status;
  justify-self: end;
}

/* ── status pills + signature tag chips ───────────────────────────── */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-soft);
  font: 500 11px/1.2 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.pill::before {
  content: "";
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 1px;
  background: var(--line-strong);
}

.pill.available { color: var(--ok); }
.pill.available::before { background: var(--ok); }

.pill.assigned { color: var(--accent-ink); }
.pill.assigned::before { background: var(--accent); }

.pill.maintenance { color: var(--warn-ink); }
.pill.maintenance::before { background: var(--warn); }

.pill.retired { color: var(--muted); }
.pill.retired::before { background: var(--retired); }

/* the memorable device: stenciled equipment tag */
.pill.tag {
  display: inline-block;
  max-width: 100%;
  padding: 4px 8px;
  border: 1px solid var(--ink);
  border-radius: var(--r-chip);
  background: var(--panel);
  color: var(--ink);
  font-weight: 500;
  letter-spacing: 0.06em;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

.pill.tag::before { content: none; }

/* secondary site chip in the detail header */
.pill.site {
  display: inline-block;
  max-width: 100%;
  padding: 4px 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-chip);
  color: var(--muted);
  letter-spacing: 0.06em;
  white-space: normal;
  overflow-wrap: anywhere;
}

.pill.site::before { content: none; }

.meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* ── detail + intake panels ───────────────────────────────────────── */

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  margin-top: 20px;
}

.detail-panel,
.action-panel {
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
}

.detail-panel h2 {
  margin: 2px 0 12px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.detail-copy {
  margin: 14px 0 18px;
  font-size: 14px;
  line-height: 1.6;
}

.asset-facts {
  margin-bottom: 20px;
  border-top: 1px solid var(--line);
}

.asset-facts > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 2px;
  border-bottom: 1px solid var(--line);
}

.asset-facts dt {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.asset-facts dd {
  font-size: 13.5px;
  font-weight: 500;
  text-align: right;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.asset-facts .is-mono dd {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.02em;
}

/* ── intake desk tabs ─────────────────────────────────────────────── */

.tabs {
  display: flex;
  gap: 22px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.tab {
  position: relative;
  padding: 4px 2px 10px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: color 130ms ease;
}

.tab:hover { color: var(--ink); }

.tab.active { color: var(--ink); }

.tab.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--accent);
}

.action-form {
  display: grid;
  gap: 14px;
}

.action-form .button[type="submit"] {
  justify-self: start;
  min-width: 200px;
  margin-top: 2px;
}

.action-panel.locked {
  display: grid;
  place-content: center;
  min-height: 200px;
  padding: 24px;
  border-style: dashed;
  border-color: var(--line-strong);
  background: transparent;
}

.action-panel.locked .tabs,
.action-panel.locked .action-form { display: none; }

.action-panel.locked .form-status {
  max-width: 340px;
  text-align: center;
}

/* ── site coverage cards ──────────────────────────────────────────── */

.location-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}

.location-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
}

.location-card h3 {
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  overflow-wrap: anywhere;
}

.location-card .muted {
  font-size: 13px;
  line-height: 1.5;
}

.location-card strong {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font: 500 12px/1.2 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

/* ── empty / locked / loading slips ───────────────────────────────── */

.empty-state,
.locked-state {
  grid-column: 1 / -1;
  padding: 40px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-panel);
  text-align: center;
}

.empty-state h3,
.locked-state h3 {
  margin-bottom: 6px;
  font-size: 16px;
  font-weight: 600;
}

.empty-state p,
.locked-state p {
  max-width: 380px;
  margin: 0 auto;
  font-size: 13.5px;
  line-height: 1.55;
}

.empty-state code {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}

.empty-state.error h3 { color: var(--danger); }

.empty-state .button,
.locked-state .button { margin-top: 16px; }

@keyframes slip-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.empty-state.loading h3 { animation: slip-pulse 1.4s ease-in-out infinite; }

/* ── responsive ───────────────────────────────────────────────────── */

@media (max-width: 1080px) {
  .board-columns { display: none; }

  .asset-card {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "tag  status"
      "main main"
      "cat  site";
    row-gap: 7px;
  }

  /* keep the stenciled tag chip sized to its label once columns stack */
  .asset-card > .pill.tag { justify-self: start; }

  .asset-site { text-align: right; }
}

@media (max-width: 960px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
    padding-top: 12px;
  }

  .hero-card { max-width: 460px; }

  .detail-grid { grid-template-columns: minmax(0, 1fr); }

  .access-grid {
    grid-template-columns: minmax(0, 480px);
    align-content: start;
    padding-top: 92px;
  }
}

@media (max-width: 700px) {
  main { width: calc(100% - 28px); padding-top: 24px; }

  .section-head {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar { width: 100%; }
  .toolbar input { width: 100%; flex: 1; }

  .metric-grid { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric:nth-child(2n + 1) { border-left: 0; }
  .metric:nth-child(2n) { border-left: 1px solid var(--line); }
  .metric:nth-child(n + 3) { border-top: 1px solid var(--line); }

  .detail-panel,
  .action-panel,
  .access-panel { padding: 18px; }

  .access-grid { padding: 88px 14px 20px; }

  .access-modal-head { gap: 12px; }

  .demo-login {
    flex-direction: column;
    align-items: stretch;
  }

  .demo-login .button { justify-content: center; }

  .asset-facts dt { letter-spacing: 0.08em; }

  .account-chip strong,
  .account-chip small { max-width: 120px; }
}

@media (max-width: 640px) {
  .deck { gap: 10px; }

  /* tight deck: the stencil mark carries the brand, the environment
     chip compresses to its live signal, the session keeps identity */
  .brand strong { display: none; }

  .env-scope,
  .env-sep { display: none; }

  .console-tab { padding: 9px 14px 10px; }

  .account-chip strong,
  .account-chip small { max-width: 96px; }
}

@media (max-width: 420px) {
  .asset-card {
    grid-template-areas:
      "tag    tag"
      "status status"
      "main   main"
      "cat    site";
  }

  .asset-card > .pill:not(.tag) { justify-self: start; }
}

/* ── motion discipline ────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
