/* Koryos Connect — credential-dossier visual system.
   Pure CSS, no JavaScript. System fonts only (CSP forbids remote fonts).
   Two voices: a sans for content, a mono utility face for labels/codes/badges.
   Two accents that MEAN something: navy = brand/actions, green = verified. */

:root {
  /* KORYOS / KORYOS design system — 1980s field office.
     Sun-bleached paper, hard 1px rules, typewriter mono, tri-stripe livery. */
  --ink:        #211D14;   /* warm near-black */
  --ink-soft:   #57503F;
  --ink-faint:  #857B63;
  --bg:         #EFE9DA;   /* paper-1: sun-bleached page */
  --panel:      #FAF7EE;   /* card: raised cream */
  --panel-2:    #E7DFCB;   /* paper-2: wells, table headers */
  --paper-3:    #DDD2B8;   /* pressed/hover on paper */

  --line:       rgba(33,29,20,.28);  /* hard rules */
  --line-soft:  rgba(33,29,20,.14);  /* soft dividers */

  /* Livery */
  --red:   #B8442F;  --coral: #E07B57;  --gold: #DFAE4B;
  --tan:   #BCA478;  --olive: #6F7A4C;
  --stripe: linear-gradient(to right, var(--red) 0 40%, var(--coral) 40% 70%, var(--gold) 70% 100%);
  --stripe-v: linear-gradient(to bottom, var(--red) 0 40%, var(--coral) 40% 70%, var(--gold) 70% 100%);

  --brand:      var(--red);       /* primary actions */
  --brand-ink:  #9C3823;          /* red hover */
  --accent-ink: #F7F1E3;          /* text on accent */
  --verify:     var(--olive);     /* verified status */
  --verify-bg:  #E9EBDC;
  --danger:     var(--red);
  --danger-bg:  #F5E3DD;
  --focus:      rgba(184,68,47,.45);

  /* Dark ink panel — header band, used sparingly */
  --panel-dark:  #26221A;
  --panel-ink:   #EFE9DA;
  --panel-muted: #A79C82;

  --sans: 'Archivo', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;

  --radius: 3px;       /* squarish, 80s hardware */
  --radius-sm: 2px;
  --shadow: 0 2px 0 rgba(33,29,20,.12), 0 8px 24px rgba(33,29,20,.10);
  --shadow-sm: 0 1px 0 rgba(33,29,20,.10);
  --maxw: 980px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  /* faint paper grain: repeating hairlines only (kit: large regions only) */
  background-image: repeating-linear-gradient(0deg,
    rgba(33,29,20,.02) 0 1px, transparent 1px 4px);
}

/* ---------- typography ---------- */
h1, h2, h3 { line-height: 1.15; letter-spacing: -.01em; margin: 0 0 .4em; font-weight: 700; }
h1 { font-size: 1.9rem; font-weight: 800; font-stretch: 118%; }
h2 { font-size: 1.3rem; margin-top: 1.6rem; }
h3 { font-size: 1.08rem; letter-spacing: -.01em; }
p { margin: 0 0 1rem; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

.eyebrow {
  font-family: var(--mono);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 .5rem;
}
.muted { color: var(--ink-soft); }

/* ---------- header ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem 1.5rem; flex-wrap: wrap;
  padding: .8rem clamp(1rem, 4vw, 2rem);
  background: var(--panel-dark);
  border-bottom: 3px solid transparent;
  border-image: var(--stripe) 1;              /* the livery */
}
.brand { display: inline-flex; flex-direction: column; gap: .18rem; }
.brand:hover { text-decoration: none; }
.brand .wm {
  color: var(--panel-ink); font-weight: 800; font-size: 1.15rem;
  font-stretch: 118%; letter-spacing: -.01em; line-height: 1;
}
.brand .wm-q {
  display: inline-flex; align-items: center; gap: .45rem;
  font-family: var(--mono); font-size: .56rem; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase; color: var(--panel-muted);
}
.brand .wm-q::before { content: ""; width: 2rem; height: 2px; background: var(--stripe); }
nav { display: flex; align-items: center; gap: 1.05rem; flex-wrap: wrap; }
nav a {
  color: var(--panel-muted); font-size: .9rem; font-weight: 600;
  padding: .2rem 0; border-bottom: 2px solid transparent;
}
nav a:hover { color: var(--panel-ink); text-decoration: none; border-bottom-color: var(--gold); }

/* ---------- layout ---------- */
.container { max-width: var(--maxw); margin: 2rem auto; padding: 0 clamp(1rem, 4vw, 1.5rem); }

/* ---------- cards (the "credential" surface) ---------- */
.card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.6rem;
  margin: 0 0 1.1rem;
  box-shadow: var(--shadow-sm);
}
.cards { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: .9rem; }
.cards .card { margin: 0; transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease; }
.cards .card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #c4cedb; }
.cards .card h3 { margin-bottom: .3rem; }
.cards .card h3 a { color: var(--ink); }
.cards .card h3 a:hover { color: var(--brand); }

/* a left accent rail for primary/profile cards */
.card.dossier { padding-left: 1.6rem; }
.card.dossier::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--stripe-v);
  border-radius: var(--radius) 0 0 var(--radius);
}

/* ---------- page + profile headers ---------- */
.page-head { margin: 0 0 1.2rem; }
.profile-head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: .6rem 1.2rem; margin-bottom: 1rem; }
.profile-head h1 { margin: 0; }
.profile-head .muted { width: 100%; margin: 0; }

/* ---------- facts: a key/value dossier grid ---------- */
.facts {
  display: grid; grid-template-columns: max-content 1fr; gap: 0;
  margin: 1.2rem 0; border-top: 1px solid var(--line-soft);
}
.facts dt {
  font-family: var(--mono); font-size: .72rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint);
  padding: .7rem 1.5rem .7rem 0; border-bottom: 1px solid var(--line-soft);
  align-self: start; white-space: nowrap;
}
.facts dd {
  margin: 0; padding: .7rem 0; border-bottom: 1px solid var(--line-soft);
  min-width: 0; word-wrap: break-word;
}

/* ---------- tags / credential pills ---------- */
.tags { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; padding: 0; list-style: none; }
.tag {
  display: inline-flex; align-items: center;
  font-family: var(--mono); font-size: .74rem; letter-spacing: .02em;
  color: #2a3b4d; background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 999px;
  padding: .2rem .6rem;
}

/* ---------- verification badge ---------- */
.badge {
  display: inline-flex; align-items: center; gap: .35rem;
  font-family: var(--mono); font-size: .68rem; font-weight: 500;
  letter-spacing: .1em; text-transform: uppercase;
  padding: .26rem .55rem; border-radius: var(--radius-sm);
  border: 1px solid transparent; white-space: nowrap;
}
.badge.verify { color: var(--verify); background: var(--verify-bg); border-color: #b9e0c9; }
.badge.verify::before { content: "\2713"; font-weight: 700; }   /* ✓ */
.badge.pending { color: var(--ink-soft); background: var(--panel-2); border-color: var(--line); }
.badge.pending::before { content: "\2014"; }                     /* — */

/* ---------- meta line (mono, for list rows) ---------- */
.meta {
  font-family: var(--mono); font-size: .78rem; color: var(--ink-soft);
  letter-spacing: .01em; margin: .15rem 0 0;
  display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .55rem;
}
.meta .sep { color: var(--ink-faint); }
.meta .pay { color: var(--verify); font-weight: 600; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--sans); font-size: .94rem; font-weight: 600; line-height: 1;
  padding: .62rem 1.05rem; border-radius: var(--radius-sm);
  background: var(--brand); color: var(--accent-ink); border: 1px solid var(--brand);
  cursor: pointer; transition: background .14s ease, transform .05s ease, box-shadow .14s ease;
}
.btn:hover { background: var(--brand-ink); border-color: var(--brand-ink); text-decoration: none; box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: var(--panel); color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--paper-3); color: var(--ink); border-color: var(--line); box-shadow: none; }
.btn.danger { background: var(--danger); border-color: var(--danger); }
.btn.danger:hover { background: #97160d; border-color: #97160d; }
.linklike {
  background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; color: var(--brand); font-size: .92rem; font-weight: 600;
}
nav .linklike { color: var(--panel-muted); }
nav .linklike:hover { color: var(--panel-ink); text-decoration: underline; text-underline-offset: 3px; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-top: 1.3rem; }
.inline { display: inline; margin: 0; }

/* ---------- forms ---------- */
.stack { display: flex; flex-direction: column; gap: 1rem; }
.stack label, .grid2 label, fieldset label:not(.radio) {
  display: flex; flex-direction: column; gap: .35rem;
  font-size: .82rem; font-weight: 600; color: var(--ink);
  letter-spacing: .01em;
}
input, textarea, select {
  font-family: var(--sans); font-size: .95rem; font-weight: 400; color: var(--ink);
  padding: .58rem .7rem; width: 100%;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm);
  transition: border-color .12s ease, box-shadow .12s ease;
}
input::placeholder, textarea::placeholder { color: var(--ink-faint); }
input:hover, textarea:hover, select:hover { border-color: #c4cedb; }
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(47,111,176,.18);
}
textarea { resize: vertical; min-height: 4.5rem; line-height: 1.5; }

fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1rem 1.1rem; margin: 0; }
legend {
  font-family: var(--mono); font-size: .72rem; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); padding: 0 .4rem;
}
.radio {
  flex-direction: row; align-items: center; gap: .55rem;
  font-weight: 400; font-size: .95rem; cursor: pointer; padding: .15rem 0;
}
.radio input { width: auto; }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--brand); transform: translateY(1px); }

/* search form: keep the filter grid tidy, full-width submit */
form.grid2 { gap: 1rem 1.2rem; align-items: end; }
form.grid2 .btn { grid-column: 1 / -1; justify-self: start; }

/* ---------- photos ---------- */
.thumbs { display: flex; flex-wrap: wrap; gap: .55rem; margin: 1rem 0; }
.thumbs img {
  border-radius: var(--radius-sm); object-fit: cover;
  border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}

/* ---------- hero ---------- */
.hero {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(1.8rem, 5vw, 3rem); box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 4px;
  background: var(--stripe);
}
.hero h1 { font-size: clamp(2rem, 5vw, 2.7rem); margin: 0 0 .6rem; }
.hero > p:first-of-type { font-size: 1.1rem; color: var(--ink-soft); max-width: 46ch; margin-bottom: 1.6rem; }
.hero .actions { margin-top: 0; }

/* ---------- flash messages ---------- */
.flash {
  list-style: none; margin: 0 0 1.4rem; padding: .8rem 1rem .8rem 1.1rem;
  background: var(--panel); border: 1px solid var(--line);
  border-left: 4px solid var(--gold); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm); font-size: .94rem;
}
.flash li + li { margin-top: .35rem; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* ---------- accessibility floor ---------- */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
.btn:focus-visible { outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- responsive ---------- */
@media (max-width: 620px) {
  .grid2 { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; }
  .facts dt { border-bottom: 0; padding-bottom: 0; }
  .facts dd { padding-top: .15rem; padding-bottom: .9rem; }
  h1 { font-size: 1.6rem; }
}


/* heading resets inside grouped heads (avoids inline styles) */
.page-head h1, .page-head h2, .page-head h3 { margin-top: 0; }
.page-head h2 { margin-bottom: .2rem; }

/* ---------- weekly availability grid ---------- */
.avail-grid {
  display: grid;
  grid-template-columns: 52px repeat(7, minmax(0, 1fr));
  gap: 2px;
  margin-top: .4rem;
  font-family: var(--mono);
}
.avail-corner { background: transparent; }
.avail-dayhead {
  font-size: .66rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--ink-faint); text-align: center; padding: .2rem 0;
}
.avail-hour {
  font-size: .62rem; color: var(--ink-faint);
  display: flex; align-items: center; justify-content: flex-end;
  padding-right: .4rem; white-space: nowrap;
}
.avail-cell {
  display: flex; align-items: center; justify-content: center;
  min-height: 22px; background: var(--panel-2);
  border: 1px solid var(--line-soft); border-radius: 3px; cursor: pointer;
  transition: background .1s ease;
}
.avail-cell:hover { background: var(--paper-3); }
.avail-cell input { margin: 0; cursor: pointer; accent-color: var(--verify); }
/* Enhancement on modern browsers: fill the whole cell when checked. */
.avail-cell:has(input:checked) { background: var(--verify-bg); border-color: var(--verify); }

/* read-only display variant */
.avail-grid.readonly .avail-cell { cursor: default; }
.avail-grid.readonly .avail-cell.on { background: var(--verify); border-color: var(--verify); }
.avail-grid.readonly .avail-cell.off { background: var(--panel-2); }

/* multi-select (certifications) */
select[multiple] {
  height: auto; padding: .3rem; font-size: .9rem;
}
select[multiple] option { padding: .2rem .35rem; border-radius: 4px; }

@media (max-width: 620px) {
  .avail-grid { grid-template-columns: 40px repeat(7, minmax(0, 1fr)); }
  .avail-dayhead { font-size: .58rem; }
  .avail-cell { min-height: 24px; }
}

/* ---------- availability: time-range editor (candidate edit) ---------- */
.avail-week { display: grid; gap: .5rem; margin-top: .4rem; }
.avail-day {
  display: grid; grid-template-columns: 90px 1fr; align-items: center; gap: .5rem;
  padding: .35rem .5rem; background: var(--panel-2); border: 1px solid var(--line-soft); border-radius: 7px;
}
.avail-day-label { font-family: var(--mono); font-size: .72rem; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase; color: var(--ink-faint); }
.avail-ranges { display: flex; flex-wrap: wrap; gap: .5rem; }
.avail-range { display: inline-flex; align-items: center; gap: .35rem; }
.avail-range input[type="time"] { width: auto; padding: .3rem .4rem; font-size: .85rem; }
.avail-range .dash, .seg-row .dash { color: var(--ink-faint); font-size: .8rem; }

/* search availability windows */
.seg-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .5rem;
}
.seg-row select { width: auto; min-width: 9rem; }
.seg-row input[type="time"] { width: auto; }
#add-segment { padding: .4rem .8rem; font-size: .85rem; }

/* availability precise ranges list (read-only view) */
.avail-list { list-style: none; padding: 0; margin: .8rem 0 0; display: grid; gap: .4rem; }
.avail-list li { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.avail-list-day { font-family: var(--mono); font-size: .72rem; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase; color: var(--ink-faint); min-width: 2.4rem; }

@media (max-width: 620px) {
  .avail-day { grid-template-columns: 1fr; }
}

/* ---------- community chat ---------- */
.chat-box { display: flex; flex-direction: column; gap: .6rem; }
.chat-log {
  list-style: none; margin: 0; padding: .25rem;
  max-height: 55vh; overflow-y: auto; display: flex; flex-direction: column; gap: .35rem;
}
.chat-msg {
  display: grid; grid-template-columns: auto 1fr auto; gap: .5rem; align-items: baseline;
  padding: .35rem .55rem; background: var(--panel-2);
  border: 1px solid var(--line-soft); border-radius: 7px;
}
.chat-msg.mine { border-left: 3px solid var(--verify); }
.chat-sender { font-family: var(--mono); font-size: .72rem; font-weight: 600;
  letter-spacing: .03em; text-transform: uppercase; color: var(--ink-faint); white-space: nowrap; }
.chat-body { overflow-wrap: anywhere; }
.chat-time { font-family: var(--mono); font-size: .68rem; color: var(--ink-faint); }
.chat-form { display: flex; gap: .5rem; }
.chat-form input[name="body"] { flex: 1; }
.chat-status { font-size: .8rem; }

/* ---------- message board ---------- */
.post-list { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .6rem; }
.post .post-body { white-space: pre-wrap; overflow-wrap: anywhere; margin: .3rem 0 0; }
.pager { display: flex; gap: 1rem; align-items: center; justify-content: center; margin: 1rem 0; }
details.card > summary { cursor: pointer; font-weight: 600; }
details.card[open] > summary { margin-bottom: .6rem; }

/* ---------- checkbox groups (replace ctrl-click multi-selects) ---------- */
.checkgroup-wrap { border: 1px solid var(--line-soft); border-radius: 7px; padding: .6rem .8rem; }
.checkgroup-wrap legend { font-size: .8rem; font-weight: 600; color: var(--ink-faint);
  padding: 0 .35rem; letter-spacing: .02em; }
.checkgroup {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: .15rem .9rem; max-height: 240px; overflow-y: auto; padding: .2rem;
}
.checkgroup .check {
  display: flex; align-items: baseline; gap: .45rem;
  font-size: .88rem; padding: .18rem .3rem; border-radius: 5px; cursor: pointer;
}
.checkgroup .check:hover { background: var(--panel-2); }
.checkgroup .check input { accent-color: var(--verify); flex: none; }

/* distance badge on search results */
.badge.dist {
  font-family: var(--mono); font-size: .68rem; font-weight: 600;
  padding: .1rem .4rem; border-radius: 4px;
  background: var(--panel-2); border: 1px solid var(--line-soft); color: var(--ink-faint);
  vertical-align: middle;
}

/* ---------- admin tables ---------- */
.data-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.data-table th { text-align: left; font-family: var(--mono); font-size: .68rem;
  font-weight: 500; text-transform: uppercase; letter-spacing: .1em;
  color: var(--ink-soft); background: var(--panel-2);
  border-bottom: 1px solid var(--line); padding: .5rem .6rem; }
.data-table td { padding: .45rem .6rem; border-bottom: 1px solid var(--line-soft); }
.data-table tr:hover { background: var(--panel-2); }
.stat { font-size: 1.6rem; font-weight: 700; margin: .2rem 0; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: .2rem 1rem; font-size: .88rem; }
.facts dt { font-weight: 600; color: var(--ink-faint); }
.btn-danger { background: #c0392b; }
.btn-danger:hover { background: #a93226; }
.linklike.danger { color: #c0392b; }
.linklike.danger:hover { color: #a93226; }

/* ---------- workflow ---------- */
.badge { display: inline-block; font-size: .72rem; font-weight: 600; padding: .12rem .5rem;
  border-radius: 4px; background: var(--panel-2); border: 1px solid var(--line-soft);
  color: var(--ink-faint); text-transform: uppercase; letter-spacing: .03em; }
.notice { border-left: 3px solid var(--verify); }
.inline-form { display: inline-flex; gap: .35rem; align-items: center; margin: .15rem 0; }
.inline-form select, .inline-form input { font-size: .82rem; padding: .25rem .4rem; }
.btn-sm { font-size: .78rem; padding: .3rem .7rem; }

/* ---------- messaging ---------- */
.message-list { list-style: none; padding: 0; margin: 0 0 1rem;
  max-height: 55vh; overflow-y: auto; display: flex; flex-direction: column; gap: .5rem; }
.msg { max-width: 75%; padding: .5rem .8rem; border-radius: 10px;
  background: var(--panel-2); border: 1px solid var(--line-soft); }
.msg.mine { align-self: flex-end; background: #E9EBDC; }
.msg .who { font-size: .7rem; font-weight: 700; color: var(--ink-faint);
  text-transform: uppercase; letter-spacing: .04em; }
.msg p { margin: .15rem 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg time { font-size: .68rem; color: var(--ink-faint); }
.send-row { display: flex; gap: .5rem; }
.send-row input { flex: 1; }
.badge.unread { background: var(--verify); color: #fff; border: none; }
.prewrap { white-space: pre-wrap; }
.inline { display: inline-block; margin-right: .5rem; }

/* ---- top-nav dropdowns (pure CSS: hover + keyboard focus-within) ---- */
.topnav { position: relative; }
.dropdown { position: relative; display: inline-block; }
.dropdown .drop-toggle { cursor: pointer; }
.dropdown .drop-menu {
  display: none; position: absolute; left: 0; top: 100%; z-index: 50;
  min-width: 11rem; padding: .4rem 0; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.dropdown:hover .drop-menu,
.dropdown:focus-within .drop-menu { display: block; }
.drop-menu a { display: block; padding: .45rem .9rem; white-space: nowrap; }
.drop-menu a:hover { background: var(--paper-3); }

/* ---- dashboard grid + previews ---- */
.dash-grid {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  align-items: start; margin-top: 1rem;
}
.dash-grid .card { margin: 0; }
.dash-grid h3 { margin-top: 0; }
.preview { margin: .3rem 0; padding-left: .5rem; border-left: 3px solid var(--line-soft); }
.card.highlight { border: 2px solid var(--gold); background: #FBF4DF; }

/* ---- mini month calendar ---- */
.mini-cal { width: 100%; border-collapse: collapse; text-align: center; }
.mini-cal th { font-weight: 600; padding: .15rem; }
.mini-cal td { padding: .25rem; border-radius: 4px; }
.mini-cal td.dim { color: #bbb; }
.mini-cal td.today { outline: 2px solid #333; font-weight: 700; }
.mini-cal td.has-shift { background: #F0DFAE; font-weight: 600; }

/* ---------- analytics ---------- */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.kpi { text-align: center; padding: .8rem .5rem; }
.filter-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.checkline { display: inline-flex; align-items: center; gap: .35rem; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }
.chart { width: 100%; height: auto; }
.chart .bar-views { fill: var(--brand); }
.chart .bar-uniques { fill: var(--focus); opacity: .85; }
.chart .axis { font-size: 14px; fill: var(--ink-faint); font-family: var(--sans); }
.chart .axis-line { stroke: var(--line); stroke-width: 1; }
.heatmap { width: 100%; height: auto; border: 1px solid var(--line); border-radius: 4px; }
.heat-bg { fill: var(--panel-2); }
.mono-sm { font-family: var(--mono); font-size: .78rem; word-break: break-all; }
.depth-cell { min-width: 130px; }
.depth-cell meter { width: 80px; height: .8rem; vertical-align: middle; margin-right: .3rem; }

/* ---------- signup wizard ---------- */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wizard-steps { display: flex; gap: .5rem; list-style: none; padding: 0; margin: 0 0 1.2rem; counter-reset: wstep; }
.wizard-steps li { counter-increment: wstep; padding: .35rem .7rem; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-faint); font-size: .85rem; }
.wizard-steps li::before { content: counter(wstep) ". "; }
.wizard-steps li.current { border-color: var(--brand); color: var(--ink); font-weight: 600; }
.wizard-steps li.done { border-color: var(--brand); }
.wizard-steps li.done a { text-decoration: none; }
.cert-chips { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; padding: 0; margin: 0 0 .6rem; }
.cert-chips li { border: 1px solid var(--line); border-radius: 999px; padding: .2rem .3rem .2rem .7rem; font-size: .85rem; background: var(--panel-2); }
.chip-x { border: 0; background: none; cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 .3rem; color: var(--ink-faint); }
.chip-x:hover { color: var(--danger); }
.cert-add { display: flex; gap: .5rem; margin-bottom: .5rem; }
.cert-add input { flex: 1; }

/* ---------- 2FA + captcha ---------- */
.totp-secret { font-size: 1.05rem; letter-spacing: .12em; word-break: break-all; }
.totp-input { font-size: 1.3rem; letter-spacing: .35em; max-width: 14rem; }
.recovery-codes { columns: 2; list-style: none; padding: 0; }
.recovery-codes li { margin-bottom: .4rem; }
.pow-captcha { border: 1px dashed var(--line); border-radius: 6px; padding: .5rem .8rem; }
.pow-captcha.solved { border-color: var(--brand); }
.pow-captcha .pow-status { margin: 0; }

/* ---------- earned badges + ratings ---------- */
.badge-row { display: inline-flex; flex-wrap: wrap; gap: .3rem; vertical-align: middle; }
.badge-earned { background: var(--panel-dark); color: var(--gold); border: 0; }
.stars-avg { color: #8A6A1F; font-weight: 700; white-space: nowrap; }
.rate-form { margin-top: .3rem; }

/* ---------- dossier admin grid ---------- */
.grid-scroll { overflow-x: auto; margin-bottom: .8rem; }
.dossier-grid th.rot { writing-mode: vertical-rl; transform: rotate(180deg); font-size: .72rem; max-height: 10rem; white-space: nowrap; padding: .4rem .2rem; }
.dossier-grid .cell-center { text-align: center; }

/* ---------- dossier ---------- */
.prov-tag { font-size: .68rem; border: 1px solid var(--line); border-radius: 999px; padding: .05rem .45rem; color: var(--ink-faint); margin-left: .35rem; white-space: nowrap; }
.field-help { margin: -.4rem 0 .6rem; font-size: .82rem; }
.ms-group { max-height: 14rem; overflow-y: auto; }
.report-label { width: 40%; color: var(--ink-faint); }
.report-meta p { margin: .25rem 0; }

/* ---------- match scoring ---------- */
.match-details { margin: .4rem 0; }
.match-details summary { cursor: pointer; }
.match-score { font-weight: 700; color: var(--brand); }
.match-gate { color: var(--danger); font-size: .82rem; margin-left: .4rem; }

/* ---------- report print ---------- */
@media print {
  nav, .no-print button, .flash, footer, .eyebrow { display: none !important; }
  .card { border: 1px solid #999; break-inside: avoid; box-shadow: none; }
  body { background: #fff; color: #000; }
  a { color: #000; text-decoration: none; }
}

/* ---------- dossier evidence ---------- */
.evidence-block { margin: .4rem 0 .8rem; }
.ev-label { font-weight: 600; }
.ev-list { margin: .2rem 0 0 1rem; padding: 0; }
.ev-list li { margin: .15rem 0; }

.dispute-banner { background: #F5EBD2; border: 1px solid var(--gold); border-radius: var(--radius); padding: .5rem .7rem; }

/* ---------- notifications ---------- */
.notif-row { border-bottom: 1px solid var(--line); }
.notif-row:last-child { border-bottom: 0; }
.notif-btn { display: block; width: 100%; text-align: left; background: none; border: 0; padding: .55rem .3rem; cursor: pointer; font: inherit; color: inherit; }
.notif-unread .notif-btn strong { color: var(--brand); }
.notif-unread { background: color-mix(in srgb, var(--brand) 6%, transparent); }
.notif-time { float: right; font-size: .78rem; }
.nav-bell { position: relative; }
.bell-count { background: var(--danger, #c0392b); color: #fff; border-radius: 999px; font-size: .68rem; padding: 0 .38rem; margin-left: .15rem; vertical-align: super; }

/* ---------- flow rework ---------- */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 800px) { .two-col { grid-template-columns: 1fr; } }
.mutual-details { margin-top: .4rem; }

/* ---------- support ---------- */
.reply-admin { border-left: 3px solid var(--brand); }
.site-footer { text-align: center; padding: 1.2rem 0 2rem; color: var(--ink-faint); font-size: .85rem; }

/* ---------- relevance + validation ---------- */
.match-ready { background: #E9EBDC; border-color: var(--olive); color: #4C552F; }
.match-jump { background: #F7E5DB; border-color: var(--coral); color: #8C4326; }
.field-error { border: 2px solid #c0392b !important; background: #fdf3f2; }
.error-summary { border-left: 4px solid #c0392b; background: #fdf3f2; padding: .6rem .8rem; margin-bottom: 1rem; border-radius: 6px; }

.match-gate-warn { background: #F5EBD2; border-color: var(--gold); color: #7A5A16; }

.input-narrow { max-width: 110px; }

/* ---------- archived engagements ---------- */
.archived-banner { border-left: 4px solid var(--ink-faint); background: #f2f2f0; }
.locked-actions form button[type="submit"],
.locked-actions form input, .locked-actions form select, .locked-actions form textarea {
  pointer-events: none; opacity: .45;
}


/* ============ KORYOS landing (public front page) ============ */
.land { background: var(--bg); color: var(--ink); }
.land-topline {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 7px clamp(1rem, 4vw, 40px); border-bottom: 1px solid var(--line-soft);
}
.land-mono, .land-topline span {
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint);
}
.land-mono.accent { color: var(--brand); }
.land-mono.on-panel { color: var(--gold); }
.land-header {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  flex-wrap: wrap; padding: 18px clamp(1rem, 4vw, 40px);
  border-bottom: 1px solid var(--line);
}
.land-header nav { display: flex; gap: 28px; }
.land-header nav a { color: var(--ink); font-weight: 600; font-size: 14px; border: 0; }
.land-header nav a:hover { color: var(--brand); text-decoration: none; }
.land-wordmark { display: flex; flex-direction: column; gap: 5px; text-decoration: none; }
.land-wordmark .wm { font-weight: 800; font-size: 22px; line-height: 1;
  font-stretch: 118%; letter-spacing: -.01em; color: var(--ink); }
.land-wordmark .wm-q { display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 8px; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }
.land-wordmark .wm-q::before { content: ""; width: 33px; height: 2px; background: var(--stripe); }
.land-hero {
  display: grid; grid-template-columns: 1.15fr 1fr; gap: 48px;
  padding: 72px clamp(1rem, 4vw, 40px) 64px; align-items: center;
  max-width: 1160px; margin: 0 auto;
}
.land-hero h1 { font-size: clamp(2.4rem, 5.5vw, 56px); line-height: 1.02;
  font-weight: 800; font-stretch: 118%; letter-spacing: -.01em; margin: 0 0 20px; }
.land-hero .lede { font-size: 17px; line-height: 1.6; color: var(--ink-soft);
  max-width: 46ch; margin: 0 0 28px; }
.land-hero .land-mono { display: block; margin-bottom: 16px; }
.land-cta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.btn.lg { padding: .8rem 1.4rem; font-size: 15px; }
.land-assure { display: flex; gap: 10px; align-items: center; margin-top: 28px; }
.stripe-bar { flex: none; height: 3px; width: 64px; background: var(--stripe); }
.ph-media {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: repeating-linear-gradient(45deg, var(--panel-2) 0 8px, var(--bg) 8px 16px);
  display: grid; place-items: center; min-height: 320px;
}
.land-stats { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: var(--panel-2); }
.land-stats-inner { max-width: 1160px; margin: 0 auto;
  padding: 22px clamp(1rem, 4vw, 40px);
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.land-stat-n { font-weight: 800; font-size: 32px; line-height: 1; font-stretch: 118%; }
.land-stat-l { margin-top: 6px; font-family: var(--mono); font-size: 11px;
  letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }
.land-section { max-width: 1160px; margin: 0 auto; padding: 64px clamp(1rem, 4vw, 40px); }
.land-section-head { display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 28px; }
.land-section-head h2 { font-size: 30px; font-weight: 700; font-stretch: 110%; margin: 0; }
.land-caps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.land-cap { position: relative; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); overflow: hidden; }
.land-cap::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px;
  background: var(--stripe); }
.land-cap .cap-title { font-weight: 700; font-size: 19px; line-height: 1.2; margin: 10px 0 8px; }
.land-cap p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--ink-soft); }
.land-panel { background: var(--panel-dark); color: var(--panel-ink); }
.land-panel-inner { max-width: 1160px; margin: 0 auto;
  padding: 56px clamp(1rem, 4vw, 40px);
  display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.land-panel h2 { font-size: 34px; font-weight: 800; font-stretch: 114%; margin: 0 0 10px; }
.land-panel p { margin: 0; color: var(--panel-muted); font-size: 15px; line-height: 1.6; max-width: 52ch; }
.land-panel .btn.ghost { background: transparent; color: var(--panel-ink); border-color: var(--panel-muted); }
.land-panel .btn.ghost:hover { background: rgba(239,233,218,.08); }
.land-footer { padding: 28px clamp(1rem, 4vw, 40px);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  flex-wrap: wrap; border-top: 1px solid var(--line); }
.badge.active-dot { background: #E9EBDC; border-color: var(--olive); color: #4C552F; }
.badge.active-dot::before { content: "\25CF"; color: var(--olive); }
@media (max-width: 860px) {
  .land-hero { grid-template-columns: 1fr; padding-top: 48px; }
  .land-stats-inner { grid-template-columns: repeat(2, 1fr); }
  .land-caps { grid-template-columns: 1fr; }
}


/* ==================== MOBILE LAYER ==================== */
/* Hamburger (hidden on desktop) */
.nav-toggle { display: none; background: none; border: 1px solid var(--panel-muted);
  border-radius: var(--radius-sm); padding: .55rem .6rem; cursor: pointer;
  flex-direction: column; gap: 4px; }
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--panel-ink); }

/* Tap-driven dropdowns (coarse pointers get .open via JS; hover stays on desktop) */
.dropdown.open .drop-menu { display: block; }

@media (max-width: 820px) {
  .nav-toggle { display: inline-flex; }
  .topbar { position: relative; }
  .topnav { display: none; width: 100%; flex-direction: column; align-items: stretch;
    gap: 0; padding: .4rem 0 .6rem; border-top: 1px solid rgba(239,233,218,.15); }
  body.nav-open .topnav { display: flex; }
  .topnav a, .topnav .linklike { padding: .7rem .35rem; font-size: 1rem;
    border-bottom: 1px solid rgba(239,233,218,.08); min-height: 44px;
    display: flex; align-items: center; }
  /* Dropdowns flatten inside the mobile panel — no hover, no positioning */
  .topnav .dropdown { display: contents; }
  .topnav .drop-menu { display: block; position: static; box-shadow: none;
    border: 0; border-left: 3px solid var(--gold); border-radius: 0;
    background: rgba(239,233,218,.05); margin: 0 0 .25rem .6rem; padding: 0; }
  .topnav .drop-menu a { color: var(--panel-muted); padding: .55rem .6rem; }
  .topnav .drop-toggle::after { content: ""; }  /* caret is noise when flattened */
}

@media (max-width: 700px) {
  html { -webkit-text-size-adjust: 100%; }
  body { font-size: 15px; }
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.2rem; }
  .container { padding: 1rem .8rem 3rem; }

  /* Wide tables: scroll within the card, never the page */
  .data-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch;
    white-space: nowrap; }
  .data-table td, .data-table th { white-space: nowrap; }

  /* Thumb targets + iOS zoom prevention (inputs must be ≥16px) */
  .btn, button.btn { min-height: 44px; }
  .btn-sm { min-height: 38px; }
  input, select, textarea { font-size: 16px; min-height: 44px; }
  textarea { min-height: 88px; }
  .filter-row { gap: .5rem; }
  .filter-row input, .filter-row select { flex: 1 1 100%; }
  .grid2 { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }
  .dash-grid { grid-template-columns: 1fr; }

  /* Cards breathe less on small screens */
  .card { padding: .9rem .85rem; }

  /* Landing tune-ups */
  .land-hero { padding-top: 40px; gap: 28px; }
  .land-stats-inner { gap: 14px; }
  .land-stat-n { font-size: 24px; }
  .land-panel-inner { padding: 40px 1rem; }
}

@media (max-width: 480px) {
  .land-stats-inner { grid-template-columns: 1fr 1fr; }
  .land-footer { flex-direction: column; align-items: flex-start; }
}


/* ============ action queues (dashboard homes) ============ */
.queue-action { border-left: 4px solid var(--red); }
.queue-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .6rem 0; border-bottom: 1px solid var(--line-soft);
}
.queue-row:last-child { border-bottom: 0; }
.queue-row > div { display: flex; flex-direction: column; gap: .15rem; }
.queue-row .muted { font-size: .88rem; }
.section-rule {
  margin: 1.6rem 0 .8rem; padding-top: .9rem; font-size: 1.05rem;
  border-top: 1px solid var(--line);
}
@media (max-width: 700px) {
  .queue-row { flex-direction: column; align-items: flex-start; gap: .5rem; }
  .queue-row .btn { width: 100%; text-align: center; }
}
