:root {
  color-scheme: dark;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: #0c141b;
  color: #eef6f9;
  --panel: #15212b;
  --raised: #1b2b36;
  --line: #2c414e;
  --muted: #a8b9c5;
  --mint: #63e5bd;
  --danger: #ffacaa;
  --warning: #f4ca87;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
[hidden] { display: none !important; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .6; }
a { color: var(--mint); }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; }
.topbar, .footer { padding: 0 max(1.25rem, calc((100% - 82rem) / 2)); }
.topbar {
  min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  background: #101b24; border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: .65rem; text-decoration: none; color: inherit; }
.brand strong { display: block; font-size: 1.55rem; letter-spacing: -.065em; line-height: 1; }
.brand strong span { color: var(--mint); }
.brand small { display: block; margin-top: .3rem; font-size: .62rem; font-weight: 700; letter-spacing: .16em; color: var(--muted); }
.brand-mark { position: relative; display: inline-block; width: 36px; height: 36px; border-radius: 9px; background: var(--mint); }
.brand-mark i { position: absolute; inset: 7px 11px; border-left: 3px solid #13322d; transform: skew(-16deg); }
.brand-mark i + i { inset: 7px 6px 7px 19px; }
.topbar-right { display: flex; align-items: center; gap: 1rem; color: var(--muted); font-size: .9rem; }
#app { width: 100%; max-width: 86rem; margin: 0 auto; padding: 2.4rem 1.25rem 3rem; flex: 1; }
.loading { color: var(--muted); padding: 1rem; }
h1,h2,h3,p { margin-top: 0; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); letter-spacing: -.05em; line-height: 1.08; margin-bottom: .8rem; }
h2 { font-size: 1.28rem; letter-spacing: -.02em; margin-bottom: .5rem; }
h3 { font-size: 1rem; margin-bottom: .35rem; }
p, dd { line-height: 1.55; }
label { font-size: .92rem; font-weight: 650; }
input, select {
  display: block; width: 100%; color: inherit; background: #0e1922; border: 1px solid #436071;
  padding: .67rem .75rem; border-radius: 7px; margin-top: .3rem; min-height: 43px;
}
input[readonly] { color: var(--mint); }
button {
  border: 1px solid #47616b; background: var(--raised); color: #f1f8fa;
  border-radius: 7px; padding: .52rem .8rem; font-weight: 650; min-height: 38px;
}
button:hover { border-color: var(--mint); }
button.primary { background: var(--mint); color: #102e28; border-color: var(--mint); }
button.primary:hover { background: #a8f4df; }
.panel-link {
  display: inline-block; background: var(--mint); color: #102e28; border-radius: 7px;
  padding: .55rem .8rem; font-weight: 650; text-decoration: none;
}
.panel-link:hover { background: #a8f4df; }
button.quiet { background: transparent; }
button.destructive { color: var(--danger); }
button.small { min-height: 34px; font-size: .875rem; }
.muted { color: var(--muted); }
.eyebrow { color: var(--mint); font-size: .77rem; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; margin-bottom: .65rem; }
.panel, .metric, .rail { background: var(--panel); border: 1px solid var(--line); border-radius: 13px; }
.panel { padding: clamp(1rem, 2vw, 1.6rem); min-width: 0; }
.entry { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(330px, .8fr); gap: 1.25rem; }
.intro {
  background-color: #142837;
  background-image: linear-gradient(156deg, #10202d 12%, #224659 100%);
  display: flex; flex-direction: column; justify-content: space-between; border-color: #385765;
  padding: clamp(1.45rem, 4.5vw, 4.3rem); min-height: 31rem;
}
.intro .summary { color: #d1e0e9; max-width: 28rem; font-size: 1.05rem; }
.entry-notes { list-style: none; margin: 1.75rem 0 0; padding: 0; max-width: 30rem; }
.entry-notes li { border-top: 1px solid #456273; padding: .85rem 0; color: #d2e2ea; }
.entry-notes strong { color: white; }
.auth { padding: clamp(1.25rem, 3vw, 2.4rem); align-self: start; }
.auth h2 { margin-top: 1.2rem; }
.tabs { display: flex; gap: .28rem; background: #0e1922; border: 1px solid var(--line); border-radius: 8px; padding: .25rem; flex-wrap: wrap; }
.tabs button { border: 1px solid transparent; background: transparent; color: var(--muted); flex: 1 1 auto; font-size: .87rem; }
.tabs button[aria-pressed=true] { color: var(--mint); background: #23413e; border-color: #3c6b61; }
form.stack { display: grid; gap: .85rem; }
.stack > button { margin-top: .2rem; place-self: start; }
.stack .primary { min-height: 43px; }
.auth .stack .primary { width: 100%; }
form.inline { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .6rem; align-items: end; }
form.inline button { min-height: 43px; }
.feedback { color: var(--danger); margin-bottom: 0; }
.feedback:empty { display: none; }
.callout { background: #203739; color: #c7ece2; padding: .85rem 1rem; border-left: 3px solid var(--mint); border-radius: 5px; }
.alert { background: #44302d; color: #ffd6c8; border-color: #d58b70; }
.dash { display: grid; grid-template-columns: 14.5rem minmax(0, 1fr); gap: 1.2rem; align-items: start; }
.rail { padding: 1rem; }
.rail p { margin-bottom: .6rem; }
.rail nav { display: grid; gap: .3rem; }
.rail button { text-align: left; background: transparent; border-color: transparent; font-size: .92rem; }
.rail button[aria-current=page] { color: var(--mint); background: #223d3c; border-color: #355f56; }
.dash-main { display: grid; align-content: start; gap: 1rem; }
.dash-heading p { margin-bottom: 0; }
.dash-heading h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); overflow-wrap: anywhere; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; }
.metric { padding: .85rem 1rem; overflow-wrap: anywhere; }
.metric span { color: var(--muted); display: block; font-size: .89rem; }
.metric strong { display: block; font-size: 1.55rem; letter-spacing: -.03em; margin-top: .17rem; }
.duo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .85rem; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: .65rem .55rem; vertical-align: middle; border-bottom: 1px solid var(--line); line-height: 1.35; overflow-wrap: anywhere; }
th { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 650; }
td:first-child { min-width: 9rem; }
td.actions { min-width: 6rem; }
td strong, td small { display: block; }
td small { color: var(--muted); font-size: .82rem; margin-top: .18rem; }
.actions button { margin: .13rem .18rem .13rem 0; }
.badge { display: inline-block; padding: .25rem .44rem; border-radius: 5px; background: #263744; color: #ccdae3; font-size: .8rem; font-weight: 650; white-space: nowrap; }
.badge.active, .badge.accepted, .badge.approved { background: #213f39; color: #a2f0d8; }
.badge.pending, .badge.open { background: #493b24; color: var(--warning); }
.badge.suspended, .badge.declined { background: #452d36; color: var(--danger); }
.copy-field { margin: .7rem 0 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: .5rem; }
.copy-field button { min-height: 43px; }
.empty { color: var(--muted); margin: .75rem 0 .2rem; }
.toast {
  position: fixed; right: 1.2rem; bottom: 1.2rem; z-index: 2; max-width: calc(100vw - 2.4rem);
  padding: .75rem 1rem; background: #224237; border: 1px solid #4b8c73; border-radius: 8px;
  box-shadow: 0 12px 35px #0006; color: #eefff4;
}
.toast.error { background: #462e32; border-color: #975963; }
.footer {
  display: flex; justify-content: space-between; gap: 1rem; align-items: center; min-height: 54px;
  border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem;
}
@media (max-width: 840px) {
  .entry { grid-template-columns: 1fr; }
  .intro { min-height: auto; }
  .dash { grid-template-columns: 1fr; }
  .rail nav { display: flex; flex-wrap: wrap; }
  .duo { grid-template-columns: 1fr; }
}
@media (max-width: 475px) {
  .topbar { min-height: 63px; }
  #app { padding: 1.25rem .7rem 2rem; }
  .metrics { grid-template-columns: 1fr; }
  .topbar-right { gap: .4rem; font-size: .77rem; }
  form.inline { grid-template-columns: 1fr; }
  form.inline button { justify-self: start; }
}
