@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@500;600;700&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  --bg: #ECEDEF;        /* steel grey page background */
  --surface: #FFFFFF;
  --ink: #1A1D1F;        /* turnout black */
  --ink-soft: #5B6166;   /* muted steel */
  --line: #D9DBDD;
  --blue: #C8102E;       /* alarm red — primary accent */
  --blue-dark: #9E0C22;  /* alarm red, pressed/hover */
  --gold: #FFB81C;       /* hazard amber — secondary accent */
  --green: #1E7A4C;      /* cleared / paid */
  --red: #B3261E;        /* owing / delete / error */
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
}

/* Signature element: a hazard-stripe edge, used sparingly — under the header and as the
   active-tab indicator — evoking turnout-gear reflective tape / hazard tape. */
.header {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 20px 16px;
  background: var(--ink);
  color: #fff;
  border-bottom: 5px solid;
  border-image: repeating-linear-gradient(
    -45deg, var(--gold) 0, var(--gold) 12px, var(--ink) 12px, var(--ink) 24px
  ) 5;
}
.bib {
  width: 46px; height: 46px;
  background: #fff;
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  padding: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.bib img { width: 100%; height: 100%; object-fit: contain; }
.header h1 {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: 23px;
  margin: 0;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.header p { margin: 4px 0 0; font-size: 12px; color: rgba(255,255,255,0.6); letter-spacing: 0.2px; }
.header .spacer { flex: 1; }
.header .link-btn { color: #fff; }

.wrap { max-width: 720px; margin: 0 auto; padding: 24px 20px 60px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--ink);
  border-radius: 6px;
  padding: 18px;
  margin-bottom: 18px;
  box-shadow: 0 1px 2px rgba(20,20,20,0.04);
}
h2 {
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  margin: 0 0 12px;
  color: var(--ink);
}

.landing { text-align: center; padding: 40px 10px; }
.landing-bib {
  width: 64px; height: 64px; margin: 0 auto 10px;
  display: flex; align-items: center; justify-content: center;
}
.landing-bib img { width: 100%; height: 100%; object-fit: contain; }
.landing h1 {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: 28px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 4px;
}
.landing p.sub { color: var(--ink-soft); margin: 0 0 20px; }
.choices { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.choice-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  padding: 22px 24px; min-width: 180px; cursor: pointer;
  font-family: inherit; color: var(--ink);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.choice-card:hover { border-color: var(--blue); transform: translateY(-1px); }
.choice-card strong {
  font-size: 13px; text-transform: uppercase; letter-spacing: 0.4px;
  font-family: 'Oswald', sans-serif; font-weight: 600;
}
.choice-card span.desc { font-size: 11px; color: var(--ink-soft); }

label {
  display: flex; flex-direction: column; gap: 4px; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.4px; color: var(--ink-soft); margin-bottom: 10px;
}
input, select {
  font-family: 'IBM Plex Mono', monospace;
  border: 1px solid var(--line); border-radius: 4px;
  padding: 9px 10px; font-size: 14px; background: var(--bg); color: var(--ink); width: 100%;
}
input:focus, select:focus { outline: 2px solid var(--blue); outline-offset: 1px; }

.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  background: var(--blue); color: #fff; border: none; border-radius: 4px;
  padding: 10px 16px; font-size: 13px; font-weight: 700; cursor: pointer; width: 100%;
  text-transform: uppercase; letter-spacing: 0.4px;
  font-family: 'Oswald', sans-serif;
}
.btn:hover { background: var(--blue-dark); }
.btn.secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.btn.danger { background: var(--red); }

.link-btn { background: none; border: none; color: var(--blue); font-size: 12px; font-weight: 600; cursor: pointer; padding: 0; }
.back-link { display: inline-flex; align-items: center; gap: 6px; background: none; border: none; color: var(--ink-soft); font-size: 12px; cursor: pointer; margin-bottom: 12px; }

.error-box { background: #FBEAEA; border: 1px solid var(--red); color: var(--red); padding: 8px 12px; border-radius: 4px; font-size: 13px; margin-bottom: 12px; }
.hint { font-size: 12px; color: var(--ink-soft); }

.totals-strip { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.totals-strip > div {
  flex: 1; min-width: 140px; background: var(--surface); border: 1px solid var(--line);
  border-top: 3px solid var(--ink); border-radius: 6px; padding: 14px 16px;
}
.tlabel { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--ink-soft); font-weight: 700; }
.tvalue { font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 26px; color: var(--red); }
.tvalue.paid { color: var(--green); }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: 0.3px;
  color: var(--ink-soft); border-bottom: 2px solid var(--ink); padding: 6px 8px; font-weight: 700;
}
td { padding: 8px; border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: none; }
.mono { font-family: 'IBM Plex Mono', monospace; }

.tabs { display: flex; gap: 2px; background: var(--ink); padding: 0 12px; overflow-x: auto; }
.tab-btn {
  background: transparent; border: none; color: rgba(255,255,255,0.55); padding: 10px 14px;
  font-size: 12px; font-weight: 700; cursor: pointer; border-bottom: 3px solid transparent;
  white-space: nowrap; text-transform: uppercase; letter-spacing: 0.4px;
  font-family: 'Oswald', sans-serif;
}
.tab-btn.active { color: #fff; border-bottom-color: var(--gold); }
.tab-btn:hover { color: #fff; }

.tag {
  font-size: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 3px;
  padding: 1px 6px; color: var(--ink-soft); margin-left: 6px; font-weight: 600;
}
.tag.green { color: var(--green); border-color: var(--green); }
.form-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.form-row > label { flex: 1; min-width: 130px; margin-bottom: 0; }
.row-actions { display: flex; gap: 8px; align-items: center; }
.icon-btn { background: none; border: none; color: var(--red); cursor: pointer; }

.splits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 10px;
  padding: 10px 4px;
  background: var(--bg);
  border-radius: 6px;
}
.splits-grid label { margin-bottom: 0; }
.splits-grid input { width: 100%; }

.site-footer {
  text-align: center;
  padding: 18px 20px 26px;
  margin-top: 8px;
  border-top: 1px solid var(--line);
}
.site-footer a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #14335E;           /* trustworthy corporate navy, distinct from the site's own red/amber */
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
  text-decoration: none;
  font-family: 'Inter', sans-serif;
}
.site-footer a:hover { color: #1E4A85; text-decoration: underline; }
