:root {
  color-scheme: light;
  --canvas: #eef0eb;
  --surface: #ffffff;
  --ink: #111916;
  --muted: #59635e;
  --line: #c7cec8;
  --accent: #125e5b;
  --accent-dark: #093f3d;
  --focus: #b56616;
  --danger: #a12828;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  letter-spacing: 0;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--canvas); color: var(--ink); }
body { margin: 0; min-width: 320px; }
a { color: var(--accent-dark); }
button, input, select, textarea { font: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.skip-link { position: fixed; left: 0.75rem; top: 0.75rem; z-index: 30; padding: 0.65rem; color: white; background: var(--ink); transform: translateY(-180%); }
.skip-link:focus { transform: translateY(0); }
.topbar { min-height: 4rem; padding: 0.75rem clamp(1rem, 4vw, 3rem); display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: var(--ink); color: white; }
.brand { color: white; text-decoration: none; font-family: Georgia, "Times New Roman", serif; font-weight: 700; }
.top-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 0.85rem; }
.top-actions a { color: white; font-weight: 650; }
.top-actions button { min-height: 2.5rem; border: 1px solid white; background: transparent; color: white; padding: 0.45rem 0.75rem; cursor: pointer; }
.shell { width: min(1240px, calc(100% - 2rem)); margin: 0 auto; padding: clamp(1.5rem, 4vw, 3rem) 0 4rem; }
.loading { min-height: 55vh; display: grid; place-items: center; }
.spinner { width: 2rem; height: 2rem; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.gate { border-left: 4px solid var(--accent); background: var(--surface); padding: 1.2rem; }
.gate.denied, .message.error { border-left-color: var(--danger); }
.gate h1 { margin: 0 0 0.5rem; font-size: 1.4rem; }
.gate p { margin: 0.4rem 0; }
.button, .command { display: inline-flex; align-items: center; justify-content: center; min-height: 2.7rem; border: 1px solid var(--accent); padding: 0.55rem 0.85rem; font-weight: 700; text-decoration: none; cursor: pointer; }
.button.primary, .command { color: white; background: var(--accent); }
.workspace-heading { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1.5rem; }
.workspace-heading h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2rem, 5vw, 3.2rem); }
.workspace-heading p { margin: 0.25rem 0 0; color: var(--muted); overflow-wrap: anywhere; }
.summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--line); background: var(--surface); margin-bottom: 1.5rem; }
.metric { padding: 1rem; min-width: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.metric:nth-child(2n) { border-right: 0; }
.metric strong { display: block; font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.metric span { color: var(--muted); font-size: 0.84rem; }
.tabs { display: flex; gap: 0.4rem; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 1.5rem; }
.tab { border: 0; border-bottom: 3px solid transparent; background: transparent; padding: 0.75rem 0.85rem; white-space: nowrap; cursor: pointer; }
.tab[aria-selected="true"] { border-bottom-color: var(--accent); color: var(--accent-dark); font-weight: 750; }
.panel[hidden] { display: none; }
.panel h2 { font-size: 1.15rem; margin: 0 0 1rem; }
.form-grid { display: grid; gap: 1rem; }
.field { display: grid; gap: 0.35rem; min-width: 0; }
.field label { font-size: 0.85rem; font-weight: 700; }
.field input, .field select, .field textarea { width: 100%; min-height: 2.7rem; border: 1px solid #87948d; background: white; color: var(--ink); padding: 0.55rem 0.65rem; border-radius: 0; }
.field textarea { min-height: 7rem; resize: vertical; }
.field small { color: var(--muted); }
.form-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1rem; }
.message { min-height: 1.5rem; margin: 1rem 0; border-left: 4px solid transparent; padding-left: 0.75rem; }
.message.success { border-left-color: var(--accent); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); background: white; }
table { width: 100%; border-collapse: collapse; min-width: 640px; }
th, td { text-align: left; padding: 0.7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; }
.empty { color: var(--muted); }
@media (min-width: 760px) {
  .summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .metric { border-bottom: 0; }
  .metric:nth-child(2n) { border-right: 1px solid var(--line); }
  .metric:last-child { border-right: 0; }
  .form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .topbar { align-items: flex-start; }
  .top-actions { gap: 0.5rem; font-size: 0.84rem; }
  .shell { width: min(100% - 1.25rem, 1240px); }
}
@media (max-width: 680px) {
  .tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; gap: 0; }
  .tab { width: 100%; min-width: 0; white-space: normal; text-align: left; }
  .table-wrap { overflow: visible; }
  table, tbody, tr, td { display: block; width: 100%; }
  table { min-width: 0; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  tr { padding: 0.35rem 0; border-bottom: 1px solid var(--line); }
  tr:last-child { border-bottom: 0; }
  td { display: grid; grid-template-columns: minmax(7rem, 0.8fr) minmax(0, 1.2fr); gap: 0.75rem; padding: 0.55rem 0.7rem; border: 0; overflow-wrap: anywhere; }
  td::before { content: attr(data-label); color: var(--muted); font-size: 0.76rem; font-weight: 750; text-transform: uppercase; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
