/* The shell: forest header band with the pattern line, linen page, white cards, tabs.
   Phone first; desktop moves the tabs into a forest side bar (docs/BRAND.md "App layout").
   Colours only through tokens.css. */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--linen);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.4;
}

h1, h2, h3 { font-family: var(--font-head); font-weight: 700; color: var(--forest); margin: 0; }

:where(a) { color: var(--forest); }

:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.eyebrow {
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

/* ---- Header band ------------------------------------------------------------------------- */

.band {
  background: var(--forest);
  color: var(--white);
  padding: 12px 16px 0;
}
.band__row { display: flex; align-items: center; gap: 12px; }
.band__badge { width: var(--badge-size); height: var(--badge-size); flex: none; display: block; }
.band__title { margin: 0; font-family: var(--font-head); font-weight: 700; color: var(--white); font-size: 26px; line-height: 1.1; }
.band .eyebrow { color: var(--sand); }
/* The pattern line: once per screen, along the bottom of the band, with green below it. */
.band__pattern {
  height: var(--pattern-height);
  margin: 12px -16px 0;
  border-bottom: 14px solid var(--forest);
  box-sizing: content-box;
  background: url('../img/brand-line.svg') repeat-x left center / auto 100%;
}

/* ---- Layout ---------------------------------------------------------------------------- */

.shell { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.screen { flex: 1; padding: 20px 16px 96px; max-width: 1200px; width: 100%; margin: 0 auto; container-type: inline-size; }
.screen__title { font-size: 26px; padding-bottom: 6px; border-bottom: 2px solid var(--gold); display: inline-block; }

.card {
  background: var(--white);
  border: 1px solid var(--hair);
  border-radius: var(--radius-card);
  padding: 16px;
  margin-top: 16px;
}
.card p { margin: 0; }
.muted { color: var(--muted); }

.demo-note {
  margin: 16px 0 0;
  padding: 10px 14px;
  background: var(--white);
  border: 1px solid var(--hair);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius-card);
}

/* ---- Tabs: bottom bar on a phone ------------------------------------------------------------ */

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0;
  display: flex;
  background: var(--forest);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 10;
}
.tabs a {
  flex: 1;
  min-height: 56px;
  display: flex; align-items: center; justify-content: center;
  color: var(--sand);
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  border-top: 3px solid transparent;
}
.tabs a[aria-current="page"] { color: var(--white); border-top-color: var(--gold); }
.tabs a:hover { background: var(--forest-deep); }

/* ---- Desktop: tabs become a forest side bar ------------------------------------------------- */

@media (min-width: 900px) {
  .has-tabs .shell { display: grid; grid-template-columns: 220px 1fr; grid-template-rows: auto 1fr; }
  .band { grid-column: 1 / -1; padding: 16px 24px 0; }
  .band__pattern { margin: 12px -24px 0; }
  .tabs {
    /* bottom: auto undoes the phone bar's bottom: 0, which on a sticky bar pulls it up over the header once a screen is taller than the window. */
    position: sticky; top: 0; bottom: auto; align-self: start;
    flex-direction: column;
    height: 100%; min-height: calc(100vh - 140px);
    padding: 16px 0;
  }
  .tabs a { flex: none; justify-content: flex-start; padding: 0 24px; border-top: 0; border-left: 4px solid transparent; }
  .tabs a[aria-current="page"] { border-left-color: var(--gold); }
  .has-tabs .screen { padding: 28px 32px 48px; margin: 0; }
  .screen { padding-bottom: 48px; }
}

/* ---- Shared pieces ----------------------------------------------------------------------- */

[hidden] { display: none !important; }

.small { font-size: 14px; }
.wrap { overflow-wrap: anywhere; }
.problem { color: var(--alert); background: var(--alert-bg); padding: 8px 12px; border-radius: var(--radius-button); margin: 8px 0 0; }

.who { margin-left: auto; display: flex; align-items: center; gap: 10px; color: var(--sand); font-size: 14px; }
.who__out {
  min-height: var(--tap); padding: 0 12px;
  background: transparent; color: var(--white);
  border: 1px solid var(--sand); border-radius: var(--radius-button);
  font: 700 14px var(--font-body); cursor: pointer;
}
.who__out:hover { background: var(--forest-deep); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--tap); padding: 0 18px;
  background: var(--white); color: var(--forest);
  border: 1px solid var(--hair); border-radius: var(--radius-button);
  font: 700 16px var(--font-body); text-decoration: none; cursor: pointer;
}
.btn--primary { background: var(--forest); color: var(--white); border-color: var(--forest); }
.btn--primary:hover { background: var(--forest-deep); border-color: var(--forest-deep); }

.card h2 { font-size: 20px; margin-bottom: 12px; }

.form { display: grid; gap: 14px; max-width: 520px; }
.form label { display: grid; gap: 4px; font-weight: 700; font-size: 14px; }
.form input:not([type="checkbox"]), .form select, .form textarea {
  min-height: var(--tap); padding: 8px 10px;
  border: 1px solid var(--hair); border-radius: var(--radius-button);
  font: 16px var(--font-body); color: var(--ink); background: var(--white);
}
.form input[readonly] { background: var(--linen); }
/* A fieldset is as wide as its content by default (min-inline-size: min-content); let it shrink on a phone. */
.form .pair { border: 0; margin: 0; padding: 0; min-inline-size: 0; display: grid; grid-template-columns: 2fr 1fr; gap: 10px; }
.form .pair input { width: 100%; min-width: 0; }
.form .pair legend { font-weight: 700; padding: 0 0 4px; }
.form .check { display: flex; align-items: center; gap: 10px; font-weight: 400; font-size: 16px; }
.form .check input { width: 22px; height: 22px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }

.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table th { text-align: left; background: var(--linen); border-bottom: 2px solid var(--gold); padding: 8px; font-size: 14px; }
.table td { padding: 8px; border-bottom: 1px solid var(--hair); vertical-align: top; }

/* A table on a narrow screen: each row becomes a block. */
@container (max-width: 560px) {
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; }
  .table tr { padding: 8px 0; border-bottom: 1px solid var(--hair); }
  .table td { border: 0; padding: 2px 0; }
}

.list-links { padding: 0; }
.list-links a {
  display: grid; gap: 2px; padding: 14px 16px; min-height: var(--tap);
  text-decoration: none; font-weight: 700; border-bottom: 1px solid var(--hair);
}
.list-links a:last-child { border-bottom: 0; }
.list-links .muted { font-weight: 400; font-size: 14px; }

.gate { display: grid; gap: 14px; max-width: 520px; }

/* Crew: no office tabs, so no room kept for them at the bottom. */
.is-crew .screen { padding-bottom: 32px; }
