/* TRACEWEAVER: file-role=vanilla-dev-responsive-theme; req=REQ-AIR-027; trace=TRACE-AIR-027; ver=VER-AIR-027 */
:root {
  color-scheme: light;
  --ink: #1d1c1b;
  --ink-soft: #5a3f35;
  --brown: #5b2310;
  --paper: #ffffff;
  --surface: #f2ebe8;
  --surface-strong: #e5d7d2;
  --yellow: #ffe500;
  --yellow-soft: #fffacc;
  --red: #c7000d;
  --green: #56841a;
  --focus: #006bb3;
  --shadow: 0 12px 32px rgba(91, 86, 82, 0.12);
  font-family: "Be Vietnam Pro", Inter, Roboto, system-ui, sans-serif;
  font-size: 16px;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--surface); min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button, input, select { min-height: 44px; }
button, .button {
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 10px 18px;
  color: white;
  background: var(--ink);
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease, box-shadow 120ms ease;
}
button:hover, .button:hover { background: var(--brown); box-shadow: var(--shadow); }
button:active { transform: translateY(1px); }
button:disabled { cursor: not-allowed; opacity: 0.55; box-shadow: none; }
button.secondary { color: var(--ink); background: transparent; }
button.secondary:hover { background: var(--surface-strong); }
button.danger { background: var(--red); border-color: var(--red); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.app-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 76px;
  padding: 12px clamp(16px, 5vw, 64px);
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--surface-strong);
}
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand img { width: 112px; height: 48px; object-fit: contain; }
.brand-text { display: grid; gap: 2px; }
.brand-text strong { font-size: 1.1rem; }
.brand-text span { color: var(--ink-soft); font-size: 0.78rem; }
.dev-pill, .status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--ink);
  background: var(--yellow);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.status-pill.online { background: #e5f2d5; color: #33520f; }
.status-pill.held { background: #ffb8bb; color: #521414; }
.app-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.app-actions a { color: var(--ink); font-weight: 600; }

main { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 32px 0 64px; }
.hero {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 24px;
  padding: clamp(24px, 5vw, 56px);
  border-radius: 24px;
  background: linear-gradient(135deg, var(--yellow-soft), white 56%, #ffd1b3);
  box-shadow: var(--shadow);
}
.eyebrow { margin: 0 0 8px; color: var(--brown); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { margin: 0; max-width: 16ch; font-size: clamp(2rem, 5vw, 4rem); line-height: 1.02; }
h2 { margin: 0 0 16px; font-size: clamp(1.35rem, 3vw, 2rem); }
h3 { margin: 0 0 8px; }
.hero p { max-width: 60ch; color: var(--ink-soft); font-size: 1.05rem; line-height: 1.6; }
.hero-aside { display: grid; align-content: center; gap: 12px; }
.metric { padding: 16px; border-radius: 16px; background: rgba(255,255,255,0.75); border: 1px solid var(--surface-strong); }
.metric strong { display: block; font-size: 1.65rem; }
.metric span { color: var(--ink-soft); font-size: 0.82rem; }

.section { margin-top: 32px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section-heading p { margin: 0; color: var(--ink-soft); }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.card { padding: 20px; border-radius: 16px; background: var(--paper); border: 1px solid var(--surface-strong); box-shadow: 0 2px 4px rgba(91,86,82,.08); }
.card.active { border: 3px solid var(--yellow); padding: 18px; }
.card-meta { display: grid; gap: 6px; margin-top: 16px; color: var(--ink-soft); font-size: 0.82rem; }
.card-meta code { color: var(--ink); }

.auth-grid, .workspace { display: grid; grid-template-columns: 0.75fr 1.25fr; gap: 20px; align-items: start; }
.form-stack { display: grid; gap: 14px; }
label { display: grid; gap: 6px; color: var(--ink-soft); font-size: 0.82rem; font-weight: 600; }
input, select {
  width: 100%;
  border: 1px solid var(--ink-soft);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: white;
}
.help { margin: 0; color: var(--ink-soft); font-size: 0.82rem; line-height: 1.5; }
.feedback { min-height: 24px; margin: 10px 0 0; color: var(--ink-soft); }
.feedback.error { color: var(--red); font-weight: 600; }
.feedback.success { color: var(--green); font-weight: 600; }

.chat-shell { min-height: 520px; display: grid; grid-template-rows: auto 1fr auto; padding: 0; overflow: hidden; }
.chat-header { display: flex; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--surface-strong); }
.messages { display: grid; align-content: start; gap: 12px; min-height: 300px; max-height: 480px; padding: 20px; overflow-y: auto; background: #fbfaf9; }
.message { max-width: 84%; padding: 12px 14px; border-radius: 16px; line-height: 1.5; white-space: pre-wrap; }
.message.user { justify-self: end; color: white; background: var(--brown); border-bottom-right-radius: 4px; }
.message.assistant { justify-self: start; background: var(--yellow-soft); border-bottom-left-radius: 4px; }
.chat-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 16px; border-top: 1px solid var(--surface-strong); }
.chat-form input { border-radius: 999px; }
.pending-action { margin: 0 16px 12px; padding: 12px; border-radius: 12px; background: #fff4e6; border: 1px solid #ff8e42; }

.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs button[aria-selected="true"] { color: var(--ink); background: var(--yellow); }
.panel[hidden] { display: none; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 10px; text-align: left; border-bottom: 1px solid var(--surface-strong); vertical-align: top; }
th { color: var(--ink-soft); font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.row-actions button { min-height: 36px; padding: 6px 12px; font-size: .8rem; }
.empty { padding: 32px; text-align: center; color: var(--ink-soft); }
.empty.compact { padding: 12px 0; text-align: left; }
.router-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.router-card { padding: 18px; border: 1px solid var(--surface-strong); border-radius: 14px; background: #fbfaf9; }
.router-card-head { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.router-card h3, .router-card h4 { margin: 0; }
.router-card h4 { margin-top: 18px; font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); }
.router-meta { display: grid; gap: 10px; margin: 18px 0 0; }
.router-meta div { display: grid; gap: 2px; }
.router-meta dt { color: var(--ink-soft); font-size: .72rem; font-weight: 700; text-transform: uppercase; }
.router-meta dd { margin: 0; }
.assignment-list { display: grid; gap: 8px; padding: 0; list-style: none; }
.assignment-list li { display: flex; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--surface-strong); font-size: .82rem; }
.assignment-list span { color: var(--ink-soft); text-transform: capitalize; }
.router-assign { display: grid; gap: 8px; margin-top: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 820px) {
  .hero, .auth-grid, .workspace { grid-template-columns: 1fr; }
  .grid, .router-grid { grid-template-columns: 1fr; }
  .hero h1 { max-width: none; }
}

@media (max-width: 600px) {
  .app-bar { position: static; align-items: flex-start; flex-direction: column; }
  .brand img { width: 96px; }
  main { width: min(100% - 20px, 1180px); padding-top: 16px; }
  .hero { padding: 24px 18px; border-radius: 16px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .chat-form { grid-template-columns: 1fr; }
  .message { max-width: 94%; }
  table, thead, tbody, th, td, tr { display: block; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
  tr { padding: 12px 0; border-bottom: 1px solid var(--surface-strong); }
  td { display: grid; grid-template-columns: 8rem 1fr; gap: 8px; border: 0; padding: 6px 0; }
  td::before { content: attr(data-label); color: var(--ink-soft); font-size: .72rem; font-weight: 700; text-transform: uppercase; }
}

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