:root {
  color-scheme: light;
  --ink: #17212b;
  --muted: #5a6875;
  --surface: #ffffff;
  --background: #f3f6f8;
  --line: #d9e1e7;
  --primary: #0b6f7c;
  --primary-dark: #07545e;
  --accent: #f28b2d;
  --success: #176b3a;
  --warning: #8a5700;
  --danger: #a4262c;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--background); color: var(--ink); line-height: 1.5; }
a { color: var(--primary-dark); }
input, select, textarea, button { font: inherit; }
input, select, textarea {
  width: 100%;
  padding: .72rem .8rem;
  border: 1px solid #aebbc5;
  border-radius: .45rem;
  background: #fff;
}
input:focus, select:focus, textarea:focus, button:focus, a:focus {
  outline: 3px solid rgba(11, 111, 124, .25);
  outline-offset: 2px;
}
label { display: grid; gap: .35rem; font-weight: 650; }
fieldset { border: 1px solid var(--line); border-radius: .65rem; padding: 1rem; }
legend { padding: 0 .4rem; font-weight: 750; }
code { white-space: normal; word-break: break-word; }

.environment-banner {
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: .65rem 1rem;
  border-bottom: 3px solid #7a4b00;
  background: #ffd24d;
  color: #231800;
  box-shadow: 0 2px 8px rgba(35, 24, 0, .25);
  font-size: .92rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-align: center;
}

.site-header { background: #123747; color: #fff; }
.header-inner {
  max-width: 1180px; margin: auto; padding: .9rem 1.2rem;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.brand { color: #fff; text-decoration: none; font-weight: 800; }
nav { display: flex; align-items: center; flex-wrap: wrap; gap: 1rem; }
nav a, .link-button { color: #fff; font-weight: 650; }
.link-button { padding: 0; border: 0; background: transparent; text-decoration: underline; cursor: pointer; }
.inline-form { display: inline; margin: 0; }
.page-shell { max-width: 1180px; min-height: calc(100vh - 135px); margin: auto; padding: 1.5rem 1.2rem 3rem; }
.site-footer { padding: 1rem; text-align: center; color: var(--muted); font-size: .88rem; }

.page-heading {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 1.25rem; margin-bottom: 1.25rem;
}
.page-heading h1 { margin: .1rem 0; }
.page-heading p { margin: .25rem 0; }
.eyebrow { color: var(--primary-dark); font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; }
.panel, .auth-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: .8rem;
  padding: 1.25rem; box-shadow: 0 4px 18px rgba(24, 43, 58, .05); margin-bottom: 1rem;
}
.auth-card { max-width: 430px; margin: 4rem auto; }
.narrow { max-width: 620px; margin: 3rem auto; }
.form-panel { max-width: 920px; }
.stack-form { display: grid; gap: 1rem; }
.two-column, .four-column { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.four-column { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.button-row { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; }
.primary-button, .secondary-button, .file-button {
  display: inline-block; border-radius: .48rem; padding: .72rem 1rem;
  font-weight: 750; text-decoration: none; cursor: pointer; text-align: center;
}
.primary-button { background: var(--primary); border: 1px solid var(--primary); color: #fff; }
.primary-button:hover { background: var(--primary-dark); }
.secondary-button { background: #fff; border: 1px solid var(--primary); color: var(--primary-dark); }
.file-button { width: fit-content; color: #fff; background: var(--accent); border: 1px solid #cf6810; }
button:disabled { opacity: .65; cursor: wait; }
.optional, .help-text, .muted { color: var(--muted); font-size: .9rem; font-weight: 400; }
.file-status { display: block; color: var(--muted); margin: .5rem 0 1rem; }
.visually-hidden {
  position: absolute !important; width: 1px !important; height: 1px !important;
  padding: 0 !important; margin: -1px !important; overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important;
}

.alert { padding: .85rem 1rem; border-radius: .55rem; margin: 0 0 1rem; border: 1px solid; }
.alert-success { background: #eaf7ef; color: var(--success); border-color: #9ac8aa; }
.alert-warning { background: #fff5d9; color: var(--warning); border-color: #e8c56e; }
.alert-error { background: #fdebed; color: var(--danger); border-color: #e7a4a8; }
.attention-panel { border-left: 5px solid var(--danger); }
.status-good { color: var(--success); font-weight: 650; }
.attention-link { color: var(--danger); font-weight: 800; }

.bss-grid { display: grid; grid-template-columns: repeat(7, minmax(78px, 1fr)); gap: .55rem; }
.bss-option {
  display: grid; grid-template-rows: 1fr auto; border: 2px solid var(--line);
  border-radius: .55rem; padding: .35rem; cursor: pointer; text-align: center;
}
.bss-option input { width: auto; justify-self: center; }
.bss-option img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.bss-option:has(input:checked) { border-color: var(--primary); background: #e7f5f6; }

.confirmation-form { display: flex; align-items: center; flex-wrap: wrap; gap: 1rem; }
.confirmation-form label, .checkbox-label { display: flex; align-items: center; gap: .55rem; font-weight: 600; }
.confirmation-form input, .checkbox-label input { width: auto; }
.overdue-confirmation {
  padding: .75rem; border: 1px solid var(--line); border-radius: .55rem;
}
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.section-heading h2, .section-heading p { margin: 0; }
.card-list { display: grid; gap: .8rem; }
.event-card {
  display: flex; justify-content: space-between; gap: 1rem; align-items: center;
  border: 1px solid var(--line); border-radius: .6rem; padding: .9rem;
}
.event-card h3, .event-card p { margin: .15rem 0; }
.event-actions { display: grid; justify-items: end; gap: .4rem; }
.tag { display: inline-block; padding: .16rem .48rem; border-radius: 999px; background: #e7edf1; font-size: .78rem; font-weight: 800; text-transform: uppercase; }
.tag-standard { background: #fff0c8; color: #6e4700; }
.tag-high { background: #fbdfe2; color: #8c1f27; }

.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.metric-grid article { background: #fff; border: 1px solid var(--line); border-radius: .7rem; padding: 1rem; }
.metric-grid span { display: block; color: var(--muted); font-size: .88rem; }
.metric-grid strong { display: block; font-size: 1.8rem; margin-top: .25rem; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: .65rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #edf3f5; white-space: nowrap; }
.review-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); gap: 1rem; }
.review-image { display: block; max-width: 100%; max-height: 650px; margin: auto; border-radius: .55rem; }
.data-list { display: grid; grid-template-columns: minmax(160px, 1fr) 1fr; gap: .45rem .8rem; }
.data-list dt { color: var(--muted); }
.data-list dd { margin: 0; font-weight: 700; }
.probability-list { columns: 2; padding-left: 1.3rem; }

@media (max-width: 820px) {
  .header-inner, .page-heading { align-items: flex-start; flex-direction: column; }
  .four-column, .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bss-grid { grid-template-columns: repeat(4, minmax(70px, 1fr)); }
  .review-layout { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .two-column, .four-column, .metric-grid { grid-template-columns: 1fr; }
  .bss-grid { grid-template-columns: repeat(2, minmax(90px, 1fr)); }
  .event-card { align-items: flex-start; flex-direction: column; }
  .event-actions { justify-items: start; }
}
