:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --ink: #1d2a22;
  --muted: #5d6b62;
  --line: #dcd8cc;
  --brand: #3a3c3f;       /* logo charcoal */
  --brand-ink: #ffffff;
  --accent: #a3c93a;      /* logo lime: bars and borders only, too light for text on white */
  --danger: #a12a2a;
  --ok-bg: #e6f2ea;
  --warn-bg: #fbf2de;
  --radius: 10px;
  --serif: Georgia, "Times New Roman", serif;
  --sans: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 16px/1.5 var(--sans); }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
a { color: var(--brand); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; }
h1 { font-size: 2rem; margin: 0 0 .25rem; }
h2 { font-size: 1.35rem; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

/* Header */
.top { background: #fff; color: var(--brand); border-bottom: 4px solid var(--accent); }
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 8px; padding-bottom: 8px; flex-wrap: wrap; }
.brand { color: inherit; text-decoration: none; display: flex; align-items: center; gap: 12px; }
.brand img { display: block; width: 64px; height: 64px; }
.brand-text { display: flex; flex-direction: column; }
.brand-eyebrow { font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.brand-name { font-family: var(--serif); font-size: 1.2rem; }
.nav { display: flex; gap: 18px; align-items: center; }
.nav a, .nav .linklike { color: var(--brand); text-decoration: none; font: inherit; }
.nav a.active { font-weight: 600; border-bottom: 3px solid var(--accent); }
.linklike { background: none; border: 0; padding: 0; cursor: pointer; }

main { padding-top: 28px; padding-bottom: 60px; }

/* Cards and forms */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.narrow { max-width: 460px; margin: 24px auto; }
label { display: block; font-weight: 600; margin: 14px 0 4px; font-size: .95rem; }
.hint { font-weight: 400; color: var(--muted); font-size: .85rem; }
input[type=text], input[type=email], textarea {
  width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink);
}
input:focus, textarea:focus, button:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 35%, transparent); outline-offset: 1px; }
textarea { min-height: 110px; resize: vertical; }
.code-input { font-size: 1.6rem; letter-spacing: .4em; text-align: center; }
.btn { display: inline-block; font: inherit; font-weight: 600; padding: 10px 18px; border-radius: 8px; border: 1px solid var(--brand); background: var(--brand); color: var(--brand-ink); cursor: pointer; text-decoration: none; }
.btn.secondary { background: transparent; color: var(--brand); }
.btn:disabled { opacity: .55; cursor: default; }
.actions { display: flex; gap: 12px; align-items: center; margin-top: 20px; flex-wrap: wrap; }
.error { color: var(--danger); margin-top: 10px; }
.banner { padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; }
.banner.ok { background: var(--ok-bg); }
.banner.warn { background: var(--warn-bg); }
.radios { display: flex; gap: 18px; flex-wrap: wrap; }
.radios label { font-weight: 400; display: flex; gap: 8px; align-items: center; margin: 4px 0; }
.counter { text-align: right; font-size: .8rem; color: var(--muted); }

/* Profile form layout */
.profile-grid { display: grid; grid-template-columns: 240px 1fr; gap: 28px; }
@media (max-width: 720px) { .profile-grid { grid-template-columns: 1fr; } }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 520px) { .two { grid-template-columns: 1fr; } }

/* Photo */
.photo { width: 100%; max-width: 240px; aspect-ratio: 1; border-radius: var(--radius); background: #e9e5da; display: grid; place-items: center; overflow: hidden; color: var(--muted); font-family: var(--serif); font-size: 3rem; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cropper { margin-top: 12px; }
.cropper canvas { width: 240px; max-width: 100%; aspect-ratio: 1; border-radius: var(--radius); touch-action: none; cursor: grab; background: #ddd; display: block; }
.cropper input[type=range] { width: 240px; max-width: 100%; }

/* Directory */
.toolbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin: 12px 0 20px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab { font: inherit; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; color: var(--ink); }
.tab[aria-selected=true] { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.search { max-width: 260px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: inherit; display: flex; flex-direction: column; }
.card:hover { border-color: var(--brand); }
.card .photo { max-width: none; border-radius: 0; font-size: 2.4rem; }
.card-body { padding: 12px 14px 14px; }
.card-name { font-weight: 700; }
.card-meta { color: var(--muted); font-size: .9rem; }

/* Profile page (mirrors the Word profile) */
.sheet { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 36px; max-width: 760px; margin: 0 auto; }
.sheet-head { text-align: center; margin-bottom: 24px; }
.sheet-logo { width: 120px; height: 120px; display: block; margin: 0 auto 8px; }
.sheet-head .eyebrow { color: var(--muted); letter-spacing: .12em; text-transform: uppercase; font-size: .8rem; }
.sheet-head h1 { margin-top: 6px; }
.sheet-body { display: grid; grid-template-columns: 220px 1fr; gap: 28px; align-items: start; }
@media (max-width: 620px) { .sheet-body { grid-template-columns: 1fr; } }
.facts { margin: 0; }
.facts dt { font-weight: 700; margin-top: 12px; }
.facts dd { margin: 2px 0 0; white-space: pre-wrap; }
.bio { margin-top: 24px; white-space: pre-wrap; }

#assessment { margin-top: 24px; }
#assessment h3 { font-size: 1.05rem; margin: 12px 0 4px; }
.code-chip { font-family: Consolas, monospace; background: var(--warn-bg); padding: 2px 8px; border-radius: 6px; letter-spacing: .05em; }
.print-area { display: none; }

@media print {
  .screen-only { display: none !important; }
  .print-area { display: block; }
  .top, .toolbar, .no-print { display: none !important; }
  body { background: #fff; }
  main { padding: 0; }
  .sheet { border: 0; padding: 0; page-break-after: always; break-after: page; }
}
