/* The CRM's components. Every colour and size is a variable from design.css,
   which is generated from operations/design-system/tokens.json. Rules for
   each component: operations/design-system/README.md. */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--type-body-family);
  font-size: var(--type-body-size);
  line-height: var(--type-body-line);
  font-variant-numeric: tabular-nums;
}
[hidden] { display: none !important; }

/* App bar: the navy chrome shared by all three apps. */
.bar {
  background: var(--navy);
  color: var(--on-chrome);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.bar .brand {
  font-family: var(--font-display);
  color: var(--brand-gold);
  letter-spacing: 0.06em;
  font-size: 15px;
}
.bar .app {
  font-size: var(--type-label-size);
  font-weight: var(--type-label-weight);
  letter-spacing: var(--type-label-tracking);
  text-transform: uppercase;
  color: var(--on-chrome);
  padding: 6px 0;
  border-bottom: 3px solid var(--brand-gold);
}
.bar .right { margin-left: auto; }

/* Status mark (README: the six marks). Only "Look first" is used so far. */
.mk {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  padding: var(--mark-padding-block) var(--mark-padding-inline-end) var(--mark-padding-block) var(--mark-padding-inline-start);
  border-radius: var(--radius-control);
  border: var(--mark-border-width) solid transparent;
  white-space: nowrap;
}
.mk .g {
  display: inline-grid;
  place-items: center;
  width: var(--mark-glyph);
  height: var(--mark-glyph);
  border-radius: 50%;
  font-size: 10.5px;
  font-weight: 800;
}
.mk.check { color: var(--check); border-color: var(--check); background: var(--check-wash); }
.mk.check .g { background: var(--check); color: var(--card); }

main { max-width: 1120px; margin: 24px auto 48px; padding: 0 16px; }
.narrow { max-width: 480px; margin: 24px auto 0; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-surface);
  padding: 20px;
  display: grid;
  gap: 14px;
}
h1 {
  margin: 0;
  font-size: var(--type-record-title-size);
  font-weight: var(--type-record-title-weight);
  line-height: 1.25;
}
p { margin: 0; }
.muted { color: var(--ink-2); }
.meta { font-size: var(--type-meta-size); color: var(--ink-3); }
.label {
  font-size: var(--type-label-size);
  font-weight: var(--type-label-weight);
  letter-spacing: var(--type-label-tracking);
  text-transform: uppercase;
  color: var(--ink-2);
}
dl { margin: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; }
dt { color: var(--ink-2); }
dd { margin: 0; overflow-wrap: anywhere; }
.yes { color: var(--clear); font-weight: 600; }
.no { color: var(--stop); font-weight: 600; }

/* Buttons (README: one gold Main per screen; Second for everything else). */
.btn {
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1;
  min-height: var(--button-min-height);
  padding: var(--button-padding-block) var(--button-padding-inline);
  border-radius: var(--radius-control);
  border: 1px solid transparent;
  cursor: pointer;
  justify-self: start;
}
.btn.primary { background: var(--gold); color: var(--on-gold); border-color: var(--gold-edge); }
.btn.primary:hover { background: var(--gold-hover); }
.btn.secondary { background: var(--card); color: var(--navy-text); border-color: var(--navy-light); }
.btn.secondary:hover { background: var(--sunk); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:focus-visible { outline: var(--focus-width) solid var(--focus); outline-offset: var(--focus-offset); }

.problem { border-left: 4px solid var(--stop); padding-left: 12px; }

/* App bar, signed in: who you are and a quiet sign-out. */
.bar .right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.bar .who { font-size: var(--type-meta-size); color: var(--on-chrome-2); }
.link-on-chrome {
  font: inherit;
  font-size: var(--type-meta-size);
  color: var(--on-chrome);
  background: none;
  border: 0;
  padding: 6px 0;
  text-decoration: underline;
  cursor: pointer;
}
.link-on-chrome:focus-visible { outline: var(--focus-width) solid var(--on-chrome); outline-offset: var(--focus-offset); }

/* Landing (plan 2026-10-21-landing-screen-build.md; README: Tiles). */
.page-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-title {
  font-family: var(--type-page-title-family);
  font-size: var(--type-page-title-size);
  font-weight: var(--type-page-title-weight);
  line-height: var(--type-page-title-line);
}
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 14px;
  margin-bottom: 14px;
}
.tile {
  background: var(--card);
  border: 1px solid var(--tile-line);
  border-radius: var(--radius-surface);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 168px;
  color: var(--ink);
  text-decoration: none;
}
.tile:hover { background: var(--sunk); }
.tile:focus-visible { outline: var(--focus-width) solid var(--focus); outline-offset: var(--focus-offset); }
.tile .label { color: var(--ink-2); }
.tile .figure {
  font-family: var(--type-tile-figure-family);
  font-size: var(--type-tile-figure-size);
  font-weight: var(--type-tile-figure-weight);
  letter-spacing: var(--type-tile-figure-tracking);
  line-height: var(--type-tile-figure-line);
}
.tile .open { margin-top: auto; color: var(--navy-text); text-decoration: underline; font-size: var(--type-meta-size); }
.tile .touched { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: var(--type-table-cell-size); }
.tile .touched li { overflow-wrap: anywhere; }

/* A worksheet: the list behind a tile. */
.back { display: inline-block; margin-bottom: 12px; color: var(--navy-text); }
.back:focus-visible { outline: var(--focus-width) solid var(--focus); outline-offset: var(--focus-offset); }
#ws-rule { max-width: 70ch; margin-bottom: 16px; }
.ws-list { list-style: none; margin: 0 0 20px; padding: 0; background: var(--card); border: 1px solid var(--line); }
.ws-row {
  display: grid;
  gap: 2px;
  padding: 10px 14px;
  min-height: var(--row-comfortable);
  border-top: 1px solid var(--line-2);
  font-size: var(--type-table-cell-size);
}
.ws-row:first-child { border-top: 0; }
.ws-row .nm { font-weight: 600; overflow-wrap: anywhere; }
.section-head { font-size: var(--type-section-head-size); font-weight: var(--type-section-head-weight); margin: 8px 0; }
