/* The app's frame and screens: the page, the signed-in shell (top bar, tab bar on a phone, side bar on a laptop),
   cards (soft shadow, about 18px round), label pills and headlines, the first visit and Home. Form parts, lists and the person panel are in parts.css. Colors and
   fonts come only from brand.css. Phone first; 900px and up is the laptop layout. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--page);
  color: var(--navy);
  font: 600 17px/1.5 var(--font);
  overflow-x: clip;
}
h1, h2, p, ul, ol, dl, dd, blockquote, fieldset { margin: 0; }
fieldset { border: 0; padding: 0; min-width: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
[hidden] { display: none !important; }
/* A logo's light and dark versions (logo.js, company.js): only the one for the current look shows. */
:root:not([data-theme="dark"]) .for-dark, :root[data-theme="dark"] .for-light { display: none !important; }
.ic { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Standalone screens (first visit, PIN): the logo large on top. */
.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: calc(12px + env(safe-area-inset-top)) 16px calc(32px + env(safe-area-inset-bottom));
}
.page.narrow { max-width: 620px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; margin-bottom: 8px; }
/* The full logo: 56px tall is 147px wide, over the manual's 140px least. */
.logo { display: block; height: 56px; width: auto; max-width: calc(100% - 150px); }
.lang {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  background: var(--white);
  border: 1.5px solid var(--hair);
  border-radius: var(--pill);
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  transition: border-color .2s var(--ease);
}
.lang .ic { width: 20px; height: 20px; color: var(--slate); }
.lang:hover:not(:disabled) { border-color: var(--navy); }
.lang:disabled { color: var(--slate); cursor: default; }

/* Signed in: a top bar and tabs low on a phone; a side bar on a laptop. */
.shell { min-height: 100dvh; }
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: calc(8px + env(safe-area-inset-top)) 16px 8px;
  background: var(--white);
  border-bottom: 1px solid var(--hair);
}
/* The short logo in a phone's bar (124px wide: it has no small words to lose); the full one on a requester's Home at
   147px, over the manual's 140px least. The bar keeps its height either way. */
.brand { display: flex; align-items: center; min-height: 56px; }
.brand picture, .brand img { display: block; }
.brand img { height: 40px; width: auto; }
.brand img.full { height: 56px; }
.tabs {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 20;
  display: flex;
  background: var(--white);
  border-top: 1px solid var(--hair);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabs a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 64px;
  padding: 6px 4px;
  font-size: 13px;
  font-weight: 800;
  color: var(--slate);
  text-decoration: none;
}
.tabs a[aria-current="page"] { color: var(--navy); }
/* A phone's bar holds five: the rest sit under More (screens.js TABS `more`); a laptop's side bar shows them all. */
@media (max-width: 899px) {
  .tabs a.in-more, .tabs a.in-top, .bar .bar-end { display: none; }
  .tabs a { padding: 6px 2px; white-space: nowrap; }
  /* Send: one big round blue button in the middle of the bar, centred like the tabs beside it. Its word is read
     out but not shown (the + says it). */
  .tabs a.tab-main { color: var(--navy); }
  .tabs a.tab-main .ic {
    width: 52px; height: 52px; padding: 13px; border-radius: 50%;
    background: var(--blue-word); color: var(--on-fill); stroke-width: 2.6; box-shadow: var(--shadow-up);
  }
  .tabs a.tab-main span { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); white-space: nowrap; }
  .tabs a.tab-main[aria-current="page"] .ic { color: var(--white); background: var(--navy); }
}
.tabs a[aria-current="page"] .ic { color: var(--blue); stroke-width: 2.2; }
/* A phone's top bar: Search and Settings as plain icons at the right (screens.js TABS `top`). */
.bar-icons { display: flex; align-items: center; gap: 4px; margin-right: -10px; }
.bar-icons a {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  color: var(--slate); transition: background-color .2s var(--ease);
}
.bar-icons .ic { width: 26px; height: 26px; }
.bar-icons a:hover { color: var(--navy); }
.bar-icons a[aria-current="page"] { color: var(--navy); background: var(--ice); }
.main { max-width: 1120px; margin: 0 auto; padding: 16px 16px calc(96px + env(safe-area-inset-bottom)); }

/* Sections: white cards with room between them; the one navy panel. */
.stack { display: grid; gap: 14px; }
.card { background: var(--white); border-radius: var(--round); box-shadow: var(--shadow); padding: 24px 20px; min-width: 0; }
/* The short label over a headline or a section: an ice pill (the manual's "pills"). */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  max-width: 100%;
  min-height: 28px;
  padding: 3px 12px;
  border-radius: var(--pill-label);
  background: var(--ice);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.35;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--navy);
  overflow-wrap: anywhere;
  margin-bottom: 12px;
}
.eyebrow .ic { width: 16px; height: 16px; color: var(--deep); stroke-width: 2.2; }
h1 { font-size: 38px; font-weight: 900; line-height: 1.08; letter-spacing: -.015em; text-wrap: balance; overflow-wrap: anywhere; }
/* The headline's one accent word (words files mark it *like this*). */
h1 em { font-family: var(--serif); font-style: italic; font-weight: 600; letter-spacing: 0; color: var(--blue-word); }
.panel h1 em { color: var(--blue); }
.screen-title { padding: 8px 4px 0; }
.lead { margin-top: 14px; font-size: 19px; color: var(--slate); text-wrap: pretty; }
.sub { color: var(--slate); }
.note { color: var(--slate); font-size: 17px; text-wrap: pretty; }
.panel { display: grid; gap: 16px; justify-items: start; background: var(--panel); color: var(--on-panel); border-radius: var(--round); box-shadow: var(--shadow); padding: 24px 20px; }
.panel-text { font-size: 19px; line-height: 1.5; text-wrap: pretty; }
.pair { display: grid; gap: 14px; }
.back { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 800; color: var(--slate); text-decoration: none; }

/* First visit. */
.join-grid { display: grid; gap: 20px; }
.join .intro { padding: 8px 4px 0; }
.join .card .sub { margin-bottom: 4px; }

/* Home. */
.facts { display: grid; }
.facts div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; padding: 12px 0; }
.facts div + div { border-top: 1px solid var(--hair); }
.facts dt { color: var(--slate); }
.facts dd { font-weight: 800; overflow-wrap: anywhere; text-align: right; }
.foot { margin-top: 6px; }
.status { display: flex; align-items: flex-start; gap: 8px; color: var(--slate); font-size: 17px; }
.status b { color: var(--navy); font-weight: 800; }
.st-icon { flex: none; width: 24px; height: 24px; fill: none; stroke: var(--slate); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.status[data-state="ok"] .st-icon { stroke: var(--ok); }
.status[data-state="down"] .st-icon, .status[data-state="offline"] .st-icon { stroke: var(--late); }

/* Loading shapes. */
.bones { display: grid; gap: 14px; padding-top: 12px; }
.page > .bones { padding-top: 84px; }
.bone { display: block; border-radius: var(--round); background: var(--ice); animation: pulse 1.4s ease-in-out infinite; }
.bone.bar { height: 28px; width: 40%; }
.bone.big { height: 180px; }
.bone.row { height: 64px; border-radius: 14px; }
@keyframes pulse { 50% { opacity: .55; } }
.boot-fail { max-width: 560px; margin: 40px auto; padding: 0 16px; color: var(--navy); }

@media (min-width: 900px) {
  .page { padding: 28px 40px 48px; }
  .top { min-height: 96px; margin-bottom: 20px; }
  .logo { height: 80px; }
  .join-grid { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 40px; align-items: start; }
  .join .intro { align-self: center; padding-bottom: 80px; }
  .card, .panel { padding: 36px 40px; border-radius: var(--round-big); }
  h1 { font-size: 56px; }
  .lead { font-size: 21px; max-width: 36em; }
  .shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .bar, .tabs { grid-column: 1; }
  .bar {
    grid-row: 1;
    flex-direction: column; align-items: stretch; gap: 20px;
    padding: 28px 20px 12px; border-bottom: 0; background: transparent;
  }
  .brand { min-height: 0; }
  .brand img, .brand img.full { height: 72px; }
  .bar .lang { align-self: flex-start; }
  .tabs {
    position: sticky; top: 24px; grid-row: 2; align-self: start;
    flex-direction: column; gap: 4px; padding: 0 12px; border: 0; background: transparent;
  }
  .tabs a.more-tab, .tabs a.team-send, .bar-icons { display: none; }
  .tabs a { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 48px; padding: 0 18px; border-radius: var(--pill); font-size: 17px; }
  .tabs a:hover { background: var(--ice); }
  .tabs a[aria-current="page"] { background: var(--white); box-shadow: var(--shadow); }
  .main { grid-column: 2; grid-row: 1 / -1; width: 100%; padding: 32px 40px 48px; }
  .stack { gap: 20px; }
  .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
  .facts div { flex-direction: column; justify-content: flex-start; padding: 4px 0; }
  .facts div + div { border-top: 0; }
  .facts dd { text-align: left; }
  .pair { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
