/* ==========================================================================
   IANA Meeting Tracker — mobile-first, one-handed, show-floor UI.
   Grey does the work, orange is the accent. Light + dark via prefers-color-scheme.
   ========================================================================== */

:root {
  color-scheme: light dark;

  /* KLN brand */
  --orange: #ED6D00;
  --orange-light: #FCBE85;
  --grey-dark: #54565B;
  --grey-mid: #76777B;

  /* surfaces & ink (light) */
  --bg: #f3f3f4;
  --surface: #ffffff;
  --surface-2: #ebebee;
  --surface-3: #e0e0e4;
  --text: #232427;
  --text-2: #64656a;
  --text-3: #8d8e94;
  --border: #dddde1;
  --border-strong: #c4c4ca;

  /* accents */
  --accent: var(--orange);            /* decorative: rules, dots, active states */
  --accent-solid: #C25E00;            /* text-bearing: filled buttons, links     */
  --accent-on: #ffffff;               /* ink on --accent-solid                   */
  --accent-wash: #fdf0e4;
  --accent-edge: #f3c69c;

  --danger: #a52318;
  --danger-wash: #fdeceb;
  --ok: #1c7048;
  --ok-wash: #e7f4ee;

  --radius: 12px;
  --radius-sm: 9px;
  --shadow-1: 0 1px 2px rgba(30, 30, 35, .07);
  --shadow-2: 0 2px 6px rgba(30, 30, 35, .10), 0 16px 40px rgba(30, 30, 35, .13);

  --tap: 44px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121316;
    --surface: #1b1c1f;
    --surface-2: #24252a;
    --surface-3: #2e2f35;
    --text: #ececed;
    --text-2: #a5a6ac;
    --text-3: #7f8087;
    --border: #2e2f35;
    --border-strong: #3d3e46;

    --accent: #F5822A;
    --accent-solid: #ED6D00;
    --accent-on: #1a1004;
    --accent-wash: #2a1c0f;
    --accent-edge: #5a3a17;

    --danger: #f0796c;
    --danger-wash: #2d1613;
    --ok: #5fcf99;
    --ok-wash: #142720;

    --shadow-1: 0 1px 2px rgba(0, 0, 0, .5);
    --shadow-2: 0 2px 6px rgba(0, 0, 0, .5), 0 16px 40px rgba(0, 0, 0, .45);
  }
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
/* Author display rules below outrank the UA's [hidden] sheet — this restores it. */
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: system-ui, -apple-system, 'Segoe UI', Calibri, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.42;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-solid); }
img { max-width: 100%; display: block; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- icons ---------- */
.ico { display: inline-flex; width: 20px; height: 20px; flex: none; }
.ico svg { width: 100%; height: 100%; display: block; }
.ico-sm { width: 16px; height: 16px; }
.ico-lg { width: 24px; height: 24px; }

/* ==========================================================================
   Splash + login
   ========================================================================== */
.splash {
  position: fixed; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; background: var(--bg); z-index: 60;
}
.splash-msg { color: var(--text-2); font-size: 14px; }
.spinner {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2.5px solid var(--border-strong);
  border-top-color: var(--accent);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2s; } }

.login {
  min-height: 100svh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px calc(20px + var(--safe-l)) calc(24px + var(--safe-b)) calc(20px + var(--safe-r));
}
.login-card {
  width: 100%; max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-1);
  padding: 26px 20px 22px;
}
.login-mark {
  width: 40px; height: 4px; border-radius: 2px;
  background: var(--orange); margin-bottom: 18px;
}
.login-title { font-size: 21px; font-weight: 660; letter-spacing: -.2px; }
.login-sub { color: var(--text-2); font-size: 14px; margin-top: 4px; margin-bottom: 18px; }
.login-error {
  margin: 12px 0 0;
  background: var(--danger-wash);
  border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent);
  color: var(--danger);
  border-radius: var(--radius-sm);
  padding: 9px 11px; font-size: 13.5px;
}
.login-warn { color: var(--accent-solid); background: var(--accent-wash); border-color: var(--accent-edge); }

/* ==========================================================================
   Shell
   ========================================================================== */
.app { min-height: 100svh; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding-top: var(--safe-t);
}
.topbar::after {
  content: ''; display: block; height: 2px; background: var(--orange);
  position: absolute; left: 0; right: 0; bottom: -1px;
  opacity: .9;
}
.tb-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px calc(12px + var(--safe-r)) 8px calc(14px + var(--safe-l));
  min-height: 52px;
}
.tb-titles { min-width: 0; flex: 1; }
.tb-title { font-size: 18px; font-weight: 660; letter-spacing: -.2px; line-height: 1.15; }
.tb-sub {
  font-size: 12px; color: var(--text-2); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tb-actions { display: flex; gap: 6px; flex: none; }

.iconbtn {
  width: var(--tap); height: var(--tap);
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 11px; border: 1px solid var(--border-strong);
  background: var(--surface-2); color: var(--text);
}
.iconbtn:active { background: var(--surface-3); }
.iconbtn-accent {
  background: var(--accent-solid); border-color: var(--accent-solid); color: var(--accent-on);
}
.iconbtn-ghost { border-color: transparent; background: transparent; }

.stale-bar {
  background: var(--accent-wash);
  border-top: 1px solid var(--accent-edge);
  color: var(--accent-solid);
  font-size: 12.5px;
  padding: 6px calc(14px + var(--safe-l));
  display: flex; align-items: center; gap: 8px;
}
.stale-bar button {
  margin-left: auto; background: none; border: 1px solid currentColor;
  color: inherit; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 600;
}

.view {
  padding: 12px calc(12px + var(--safe-r)) calc(96px + var(--safe-b)) calc(12px + var(--safe-l));
  max-width: 900px; margin: 0 auto;
}
.view:focus { outline: none; }

/* ---------- bottom tab bar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.6) blur(12px);
  border-top: 1px solid var(--border);
  padding: 4px calc(4px + var(--safe-r)) calc(4px + var(--safe-b)) calc(4px + var(--safe-l));
}
.tab {
  flex: 1; min-width: 0; position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; padding: 6px 2px; min-height: var(--tap);
  background: none; border: 0; border-radius: 10px;
  color: var(--text-2);
}
.tab-label { font-size: 10.5px; font-weight: 560; letter-spacing: .1px; }
.tab[aria-current='page'] { color: var(--accent-solid); }
.tab[aria-current='page'] .tab-ico { color: var(--accent); }
.tab-badge {
  position: absolute; top: 2px; left: 50%; margin-left: 5px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: var(--orange); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
}
.tab-badge.is-quiet { background: var(--grey-mid); }

/* ==========================================================================
   Primitives
   ========================================================================== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
}
.stack { display: flex; flex-direction: column; gap: 10px; }
.stack-sm { display: flex; flex-direction: column; gap: 6px; }
.row { display: flex; align-items: center; gap: 8px; }
.row-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.grow { flex: 1; min-width: 0; }
.spacer { flex: 1; }
.muted { color: var(--text-2); }
.dim { color: var(--text-3); }
.tiny { font-size: 12px; }
.nowrap { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }

.section-title {
  font-size: 11.5px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase;
  color: var(--text-3); margin: 18px 2px 8px;
  display: flex; align-items: center; gap: 8px;
}
.section-title:first-child { margin-top: 4px; }
.section-title .spacer { flex: 1; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: var(--tap); padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 14.5px; font-weight: 580;
  white-space: nowrap;
}
.btn:active { background: var(--surface-2); }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn-primary { background: var(--accent-solid); border-color: var(--accent-solid); color: var(--accent-on); }
.btn-quiet { background: var(--surface-2); border-color: transparent; }
.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); background: var(--surface); }
.btn-block { width: 100%; }
.btn-sm { min-height: var(--tap); padding: 0 12px; font-size: 13.5px; border-radius: 9px; }
.btn-xs { min-height: var(--tap); padding: 0 10px; font-size: 12.5px; border-radius: 9px; }

/* chips */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 620; letter-spacing: .1px;
  border: 1px solid var(--border-strong); color: var(--text-2); background: var(--surface-2);
  white-space: nowrap;
}
.chip-accent { background: var(--accent-wash); border-color: var(--accent-edge); color: var(--accent-solid); }
.chip-ok { background: var(--ok-wash); border-color: color-mix(in srgb, var(--ok) 35%, transparent); color: var(--ok); }
.chip-danger { background: var(--danger-wash); border-color: color-mix(in srgb, var(--danger) 35%, transparent); color: var(--danger); }
.chip-warn { background: var(--accent-wash); border-color: var(--orange); color: var(--accent-solid); font-weight: 700; }
.chip-plain { background: transparent; }

.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--border-strong); }
.dot-high { background: var(--orange); }
.dot-medium { background: var(--grey-mid); }
.dot-low { background: var(--border-strong); }

.star-btn {
  width: var(--tap); height: var(--tap); flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: none; color: var(--text-3); border-radius: 9px;
}
.star-btn.is-on { color: var(--orange); }

/* forms */
form { position: relative; }
/* Keeps Enter-to-submit working when the visible Save button sits in the sheet
   footer, outside the <form>. Sized to 1px so it can never scroll the panel. */
.vh-submit {
  position: absolute; left: 0; top: 0;
  width: 1px; height: 1px; padding: 0; border: 0;
  opacity: 0; pointer-events: none; overflow: hidden;
}
.field { display: block; margin-bottom: 12px; }
.field-label {
  display: block; font-size: 12px; font-weight: 640; letter-spacing: .2px;
  color: var(--text-2); margin-bottom: 5px;
}
.input, .select, .textarea {
  width: 100%; min-height: var(--tap);
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 16px; /* 16px stops iOS zoom-on-focus */
  appearance: none;
}
.textarea { min-height: 84px; resize: vertical; line-height: 1.45; }
.select {
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--orange) 22%, transparent);
}
.field-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check {
  display: flex; align-items: center; gap: 10px;
  min-height: var(--tap); padding: 4px 2px; font-size: 14.5px;
}
.check input { width: 22px; height: 22px; accent-color: var(--orange); flex: none; }
.form-error {
  background: var(--danger-wash); color: var(--danger);
  border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent);
  border-radius: var(--radius-sm); padding: 9px 11px; font-size: 13.5px; margin-bottom: 12px;
}

/* segmented picker */
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg-btn {
  min-height: var(--tap); padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--surface);
  font-size: 13.5px; font-weight: 580; color: var(--text-2);
  white-space: nowrap;
}
.seg-btn[aria-pressed='true'] {
  background: var(--accent-wash); border-color: var(--orange); color: var(--accent-solid);
}

/* states */
.empty {
  text-align: center; color: var(--text-2);
  padding: 30px 18px; font-size: 14px;
}
.empty strong { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; font-weight: 620; }
.loading-row { display: flex; align-items: center; gap: 10px; color: var(--text-2); padding: 22px 4px; font-size: 14px; }
.errorbox {
  background: var(--danger-wash); border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent);
  color: var(--danger); border-radius: var(--radius); padding: 14px;
  display: flex; flex-direction: column; gap: 10px; align-items: flex-start;
}

/* ==========================================================================
   Schedule
   ========================================================================== */
.daybar {
  display: flex; gap: 6px; overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
  margin: 0 -12px 12px; padding: 2px 12px 8px;
  scroll-snap-type: x proximity;
}
.daybar::-webkit-scrollbar { display: none; }
.daytab {
  flex: none; scroll-snap-align: start; white-space: nowrap;
  min-width: 76px; min-height: var(--tap);
  padding: 7px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface);
  text-align: left; color: var(--text-2); position: relative;
}
.daytab-top { font-size: 10.5px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; }
.daytab-day { font-size: 15px; font-weight: 660; color: var(--text); line-height: 1.2; }
.daytab-meta { font-size: 11px; margin-top: 1px; }
.daytab[aria-selected='true'] {
  border-color: var(--orange); background: var(--accent-wash); color: var(--accent-solid);
  box-shadow: inset 0 -2px 0 var(--orange);
}
.daytab[aria-selected='true'] .daytab-day { color: var(--accent-solid); }
.daytab-flag {
  position: absolute; top: 6px; right: 7px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--orange);
}
.daytab-today { color: var(--accent-solid); font-weight: 800; }

.conflict-banner {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--accent-wash);
  border: 1.5px solid var(--orange);
  border-left-width: 5px;
  border-radius: var(--radius);
  padding: 11px 13px; margin-bottom: 12px;
  color: var(--accent-solid);
}
.conflict-banner .ico { color: var(--orange); margin-top: 1px; }
.conflict-banner h3 { font-size: 14px; font-weight: 700; }
.conflict-banner p { font-size: 12.5px; margin-top: 2px; color: var(--text-2); }
@media (prefers-color-scheme: dark) { .conflict-banner p { color: #cfa981; } }

.agenda { display: flex; flex-direction: column; gap: 8px; }
.mrow {
  display: grid;
  grid-template-columns: 62px 1fr auto;
  gap: 10px; align-items: start;
  width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--border);
  border-left: 4px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 11px 10px 11px 9px;
  box-shadow: var(--shadow-1);
  color: inherit;
}
.mrow:active { background: var(--surface-2); }
.mrow.is-conflict { border-left-color: var(--orange); background: var(--accent-wash); }
.mrow.is-confirmed { border-left-color: var(--ok); }
.mrow.is-past { opacity: .62; }
.mrow-time { text-align: right; }
.mrow-hh { font-size: 15px; font-weight: 700; letter-spacing: -.2px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.mrow-ampm { font-size: 10.5px; font-weight: 700; color: var(--text-3); letter-spacing: .4px; }
.mrow-dur { font-size: 11px; color: var(--text-3); margin-top: 3px; }
.mrow-body { min-width: 0; }
.mrow-name { font-size: 15px; font-weight: 640; letter-spacing: -.1px; }
.mrow-co { font-size: 12.5px; color: var(--text-2); margin-top: 1px; }
.mrow-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; align-items: center; }
.mrow-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.kind-ico { font-size: 14px; line-height: 1; }
.overlap-note {
  font-size: 11.5px; color: var(--accent-solid); font-weight: 620; margin-top: 5px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; overflow-wrap: anywhere;
}
@media (prefers-color-scheme: dark) { .overlap-note { color: var(--accent); } }

.statstrip {
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  margin: 0 -12px 12px; padding: 0 12px;
}
.statstrip::-webkit-scrollbar { display: none; }
.statbox {
  flex: none; min-width: 84px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 11px;
}
.statbox b { display: block; font-size: 18px; font-weight: 700; letter-spacing: -.4px; }
.statbox span { font-size: 11px; color: var(--text-2); }
.statbox.is-alert { border-color: var(--orange); background: var(--accent-wash); }
.statbox.is-alert b { color: var(--accent-solid); }

/* ==========================================================================
   Pipeline / contacts lists
   ========================================================================== */
.stagehead {
  display: flex; align-items: center; gap: 8px;
  margin: 16px 2px 7px;
}
.stagehead:first-child { margin-top: 2px; }
.stagehead h2 { font-size: 13px; font-weight: 700; letter-spacing: .2px; }
.stagehead .count {
  min-width: 22px; text-align: center;
  font-size: 11.5px; font-weight: 700; color: var(--text-2);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 999px; padding: 1px 7px;
}
.stagehead .rule { flex: 1; height: 1px; background: var(--border); }

.crow {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 9px 10px;
  box-shadow: var(--shadow-1); width: 100%; text-align: left; color: inherit;
  margin-bottom: 6px;
}
.crow:active { background: var(--surface-2); }
.crow-main { flex: 1; min-width: 0; }
[role='button'] { cursor: pointer; }
.crow-name { font-size: 15px; font-weight: 620; letter-spacing: -.1px; display: flex; align-items: center; gap: 6px; }
.crow-sub { font-size: 12.5px; color: var(--text-2); margin-top: 1px; }
.crow-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.crow-side { display: flex; align-items: center; gap: 6px; flex: none; }
.status-select {
  min-height: var(--tap); max-width: 140px;
  border-radius: 999px; border: 1px solid var(--border-strong);
  background: var(--surface-2); padding: 0 26px 0 11px;
  font-size: 12.5px; font-weight: 620; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 14px) 52%, calc(100% - 10px) 52%;
  background-size: 4px 4px, 4px 4px; background-repeat: no-repeat;
  color: var(--text-2);
}
.status-select:disabled { opacity: .5; }

.searchbar { position: relative; margin-bottom: 10px; }
.searchbar .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.searchbar .input { padding-left: 40px; padding-right: 40px; }
.searchbar .input::-webkit-search-cancel-button,
.searchbar .input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
.searchbar .clear {
  position: absolute; right: 2px; top: 50%; transform: translateY(-50%);
  width: var(--tap); height: var(--tap); border: 0; background: none; color: var(--text-3);
  display: inline-flex; align-items: center; justify-content: center;
}
.filterbar {
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  margin: 0 -12px 10px; padding: 2px 12px 6px;
}
.filterbar::-webkit-scrollbar { display: none; }
.result-count { font-size: 12px; color: var(--text-3); margin: 2px 2px 8px; }

/* ==========================================================================
   Sheets / modals
   ========================================================================== */
.layers { position: relative; z-index: 50; }
.layer {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(20, 20, 24, .48);
}
.layer-panel {
  background: var(--surface);
  width: 100%; max-width: 620px;
  max-height: 94svh;
  border-radius: 16px 16px 0 0;
  border: 1px solid var(--border);
  border-bottom: 0;
  box-shadow: var(--shadow-2);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.layer-full .layer-panel { height: 100svh; max-height: 100svh; border-radius: 0; border: 0; }
.layer-head {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 10px 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  padding-top: calc(12px + var(--safe-t));
}
.layer-full .layer-head { position: sticky; top: 0; z-index: 2; }
.layer-title { font-size: 17px; font-weight: 660; letter-spacing: -.2px; min-width: 0; }
.layer-sub { font-size: 12.5px; color: var(--text-2); margin-top: 2px; }
.layer-body {
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 14px 16px calc(22px + var(--safe-b));
  flex: 1;
}
.layer-foot {
  border-top: 1px solid var(--border);
  padding: 10px 16px calc(10px + var(--safe-b));
  display: flex; gap: 8px; background: var(--surface);
}
.layer-foot .btn { flex: 1; }

/* contact detail bits */
.detail-hero { padding-bottom: 4px; }
.detail-name { font-size: 20px; font-weight: 680; letter-spacing: -.3px; overflow-wrap: anywhere; }
.detail-co { font-size: 14px; color: var(--text-2); margin-top: 2px; overflow-wrap: anywhere; }
.actrow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 14px 0 4px; }
.actbtn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 58px; padding: 6px 2px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); text-decoration: none;
  font-size: 11px; font-weight: 600;
}
.actbtn .ico { color: var(--accent); }
.actbtn:active { background: var(--surface-2); }
.actbtn.is-off { opacity: .38; pointer-events: none; }

.kv { display: grid; grid-template-columns: 92px 1fr; gap: 4px 10px; font-size: 13.5px; }
.kv dt { color: var(--text-3); font-size: 12px; padding-top: 1px; }
.kv dd { margin: 0; overflow-wrap: anywhere; }

.item {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 11px; margin-bottom: 7px;
}
.item.is-conflict { border-color: var(--orange); background: var(--accent-wash); }
.item-head { display: flex; align-items: flex-start; gap: 8px; }
.item-title { font-size: 14px; font-weight: 620; min-width: 0; }
.item-meta { font-size: 12.5px; color: var(--text-2); margin-top: 2px; }
.item-note {
  font-size: 13px; margin-top: 7px; padding-top: 7px;
  border-top: 1px dashed var(--border-strong); color: var(--text-2);
}
.item-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }

.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.thumb-wrap { position: relative; }
.thumb {
  position: relative; width: 100%; aspect-ratio: 4 / 3;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  overflow: hidden; background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  padding: 0; color: var(--text-2);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-file { display: flex; flex-direction: column; gap: 4px; align-items: center; font-size: 10.5px; padding: 6px; text-align: center; }
.thumb-del {
  position: absolute; top: 4px; right: 4px;
  width: 36px; height: 36px; border-radius: 9px; border: 0;
  background: rgba(18, 18, 22, .62); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
}
.thumb-cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: rgba(18, 18, 22, .62); color: #fff;
  font-size: 9.5px; padding: 3px 5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.filebtn { position: relative; overflow: hidden; }
.filebtn input[type='file'] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 100px;
}
.viewer-img { width: 100%; height: auto; border-radius: var(--radius-sm); }

/* ==========================================================================
   Toasts
   ========================================================================== */
.toasts {
  position: fixed; z-index: 70;
  left: 0; right: 0; bottom: calc(70px + var(--safe-b));
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  pointer-events: none; padding: 0 14px;
}
.toast {
  max-width: 460px; width: fit-content;
  background: var(--grey-dark); color: #fff;
  border-radius: 999px; padding: 9px 16px;
  font-size: 13.5px; font-weight: 560;
  box-shadow: var(--shadow-2);
}
.toast-err { background: var(--danger); color: #fff; }
.toast-ok { background: var(--grey-dark); }
@media (prefers-color-scheme: dark) {
  .toast { background: #3a3b41; }
  .toast-err { background: #7d2119; }
}

/* ==========================================================================
   Desktop
   ========================================================================== */
@media (min-width: 900px) {
  body { font-size: 14.5px; }
  .app {
    display: grid;
    grid-template-columns: 226px minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas: 'side top' 'side view';
    min-height: 100svh;
  }
  .topbar { grid-area: top; }
  .view {
    grid-area: view;
    padding: 18px 26px 44px;
    max-width: 1000px; margin: 0;
  }
  .tabbar {
    grid-area: side; position: sticky; top: 0; align-self: start;
    height: 100svh; flex-direction: column; justify-content: flex-start;
    gap: 3px; padding: 16px 10px;
    background: var(--surface); border-top: 0; border-right: 1px solid var(--border);
    backdrop-filter: none;
  }
  .tabbar::before {
    content: 'Meeting Tracker';
    font-size: 12px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase;
    color: var(--text-3); padding: 4px 10px 14px;
  }
  .tab {
    flex: none; flex-direction: row; justify-content: flex-start;
    gap: 11px; padding: 9px 11px; width: 100%;
  }
  .tab-label { font-size: 14px; font-weight: 580; }
  .tab[aria-current='page'] { background: var(--accent-wash); }
  .tab-badge { position: static; margin: 0 0 0 auto; }
  .layer { align-items: center; padding: 24px; }
  .layer-panel { border-radius: 16px; border-bottom: 1px solid var(--border); max-height: 88svh; }
  .layer-full .layer-panel { height: auto; max-height: 88svh; border-radius: 16px; border: 1px solid var(--border); }
  .layer-head { padding-top: 14px; }
  .toasts { bottom: 26px; }
  .actrow { grid-template-columns: repeat(4, minmax(0, 120px)); }
}

@media (min-width: 1180px) {
  .view { max-width: 1100px; }
}
