/* ============================================================
   VERILUX — Sync Intelligence Archive
   Cinematic dark editorial. Gambetta (display) + Satoshi (body).
   ============================================================ */

:root {
  --bg:        #0a0a0c;
  --bg-deep:   #060607;
  --surface:   #121216;
  --surface-2: #17171d;
  --surface-3: #1e1e25;
  --line:      #26262f;
  --line-soft: #1c1c23;

  --text:      #eeebe5;
  --text-2:    #b6b2ab;
  --muted:     #827e78;
  --faint:     #56534e;

  --accent:      #d9a441;
  --accent-hi:   #f0c069;
  --accent-dim:  rgba(217,164,65,.14);
  --accent-line: rgba(217,164,65,.34);
  --cyan:        #6fb3c4;
  --rose:        #c97b6e;

  --font-display: 'Gambetta', 'Iowan Old Style', Georgia, serif;
  --font-body: 'Satoshi', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --r-sm: 6px;
  --r:    10px;
  --r-lg: 16px;

  --ease: cubic-bezier(.22,.61,.36,1);
  --shadow: 0 1px 2px rgba(0,0,0,.5), 0 12px 32px -12px rgba(0,0,0,.7);

  --header-h: 61px;
  --maxw: 1280px;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(900px 500px at 12% -8%, rgba(217,164,65,.07), transparent 62%),
    radial-gradient(700px 460px at 92% 4%, rgba(111,179,196,.05), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.16; margin: 0; letter-spacing: -.012em; }
p { margin: 0 0 .85em; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font: inherit; color: inherit; }
mark {
  background: var(--accent-dim);
  color: var(--accent-hi);
  border-radius: 3px;
  padding: 0 .12em;
  font-weight: 500;
}

::selection { background: rgba(217,164,65,.28); color: #fff; }

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: #2c2c36; border-radius: 6px; border: 3px solid var(--bg-deep); }
::-webkit-scrollbar-thumb:hover { background: #3d3d49; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; position: relative; z-index: 1; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------- Header ---------------- */
.hdr {
  position: sticky; top: 0; z-index: 60;
  height: var(--header-h);
  background: rgba(10,10,12,.86);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--line-soft);
}
.hdr-in { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; height: 100%; display: flex; align-items: center; gap: 26px; }

.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand svg { color: var(--accent); flex-shrink: 0; }
.brand-txt { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-family: var(--font-body); font-weight: 700; font-size: 13.5px; letter-spacing: .14em; text-transform: uppercase; }
.brand-sub { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); font-weight: 500; }

.nav { display: flex; gap: 2px; flex: 1; min-width: 0; }
.nav a {
  padding: 7px 12px; border-radius: var(--r-sm); font-size: 13.5px; font-weight: 500;
  color: var(--text-2); transition: background .16s var(--ease), color .16s var(--ease);
  white-space: nowrap;
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.on { background: var(--accent-dim); color: var(--accent-hi); }

.kbtn {
  display: flex; align-items: center; gap: 9px; flex-shrink: 0;
  padding: 7px 10px 7px 12px; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--muted); font-size: 13px; transition: border-color .16s var(--ease), color .16s var(--ease);
}
.kbtn:hover { border-color: #34343f; color: var(--text-2); }
.kbtn kbd {
  font-family: var(--font-mono); font-size: 10.5px; padding: 2px 5px;
  border: 1px solid var(--line); border-radius: 4px; background: var(--bg); color: var(--faint);
}
.burger { display: none; }

/* ---------------- Hero ---------------- */
.hero { padding: 56px 0 34px; border-bottom: 1px solid var(--line-soft); }
.eyebrow {
  font-size: 11px; font-weight: 600; letter-spacing: .17em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 16px; display: flex; align-items: center; gap: 10px;
}
.eyebrow::after { content: ''; height: 1px; flex: 1; max-width: 130px; background: linear-gradient(90deg, var(--accent-line), transparent); }
.hero h1 { font-size: clamp(34px, 5vw, 56px); letter-spacing: -.024em; max-width: 17ch; }
.hero h1 em { font-style: italic; color: var(--accent); }
.hero p.lede { margin-top: 18px; max-width: 62ch; color: var(--text-2); font-size: 16.5px; line-height: 1.65; }

.stats { display: flex; flex-wrap: wrap; gap: 34px; margin-top: 34px; }
.stat-n { font-family: var(--font-display); font-size: 30px; font-weight: 600; letter-spacing: -.02em; line-height: 1; }
.stat-l { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin-top: 7px; font-weight: 600; }

/* ---------------- Sections / toolbar ---------------- */
.sec { padding: 38px 0 76px; }
/* `.sec` / `.detail` sit on the same element as `.wrap` and reset its shorthand padding,
   which flattened the side gutter at viewports <= --maxw. Restore it explicitly. */
.wrap.sec, .wrap.detail { padding-left: 28px; padding-right: 28px; }
.sec-hd { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.sec-hd h2 { font-size: 25px; }
.sec-hd .count { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 22px; }
.field {
  display: flex; align-items: center; gap: 9px; padding: 0 12px; height: 38px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm);
  transition: border-color .16s var(--ease);
}
.field:focus-within { border-color: var(--accent-line); }
.field svg { color: var(--faint); flex-shrink: 0; }
.field input { border: none; background: none; outline: none; width: 260px; font-size: 14px; }
.field input::placeholder { color: var(--faint); }
select.sel {
  height: 38px; padding: 0 32px 0 12px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-sm); font-size: 13.5px; color: var(--text-2); outline: none; cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23827e78' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}
select.sel:hover { border-color: #34343f; }

.chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chip {
  padding: 5px 11px; border-radius: 100px; font-size: 12.5px; font-weight: 500;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2);
  transition: all .16s var(--ease); white-space: nowrap;
}
.chip:hover { border-color: #3a3a46; color: var(--text); }
.chip.on { background: var(--accent-dim); border-color: var(--accent-line); color: var(--accent-hi); }
.chip .x { margin-left: 6px; opacity: .65; font-size: 14px; line-height: 1; }

/* ---------------- Session cards ---------------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }

.card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r);
  overflow: hidden; transition: border-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
}
.card:hover { border-color: #33333e; transform: translateY(-2px); box-shadow: var(--shadow); }

.card-top { padding: 17px 18px 0; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.tag {
  font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 4px; background: var(--surface-3); color: var(--text-2);
}
.tag.kind { background: var(--accent-dim); color: var(--accent-hi); }
.meta-s { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.dot { color: var(--line); }

.card-body { padding: 12px 18px 18px; flex: 1; display: flex; flex-direction: column; }
.card-body h3 { font-size: 19px; line-height: 1.26; margin-bottom: 9px; }
.card:hover .card-body h3 { color: var(--accent-hi); }
.card-body p { font-size: 13.5px; color: var(--text-2); line-height: 1.55; margin: 0 0 14px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.card-people { font-size: 12.5px; color: var(--muted); margin-bottom: 14px; line-height: 1.5; }
.card-people b { color: var(--text-2); font-weight: 500; }

.card-foot { margin-top: auto; padding-top: 13px; border-top: 1px solid var(--line-soft);
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--muted); font-weight: 500; }
.pill svg { color: var(--faint); }
.pill.has { color: var(--accent); } .pill.has svg { color: var(--accent); }

/* ---------------- Session detail ---------------- */
.detail { padding: 32px 0 90px; }
.back { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); margin-bottom: 22px; }
.back:hover { color: var(--accent); }

.d-head { max-width: 900px; margin-bottom: 26px; }
.d-head h1 { font-size: clamp(27px, 3.6vw, 40px); margin: 12px 0 14px; letter-spacing: -.022em; }
.d-head .lede { color: var(--text-2); font-size: 16px; max-width: 70ch; }
.d-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }

.player {
  background: #000; border: 1px solid var(--line); border-radius: var(--r-lg);
  overflow: hidden; margin-bottom: 28px; position: relative;
}
.player video { display: block; width: 100%; aspect-ratio: 16/9; background: #000; }
.player-missing {
  min-height: 210px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; background: linear-gradient(150deg, #101014, #06060a);
  border: 1px dashed var(--line); text-align: center; padding: 30px;
}
.player-missing svg { color: var(--faint); }
.player-missing p { color: var(--muted); font-size: 13.5px; max-width: 46ch; margin: 0; }

.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: var(--r-sm);
  font-size: 13.5px; font-weight: 600; background: var(--accent); color: #17130a;
  transition: background .16s var(--ease);
}
.btn:hover { background: var(--accent-hi); }
.btn.ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--surface-3); border-color: #3a3a46; }

.d-cols { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 40px; align-items: start; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 24px; overflow-x: auto; }
.tabs button {
  padding: 11px 15px; font-size: 13.5px; font-weight: 600; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
  transition: color .16s var(--ease), border-color .16s var(--ease);
}
.tabs button:hover { color: var(--text-2); }
.tabs button.on { color: var(--accent-hi); border-bottom-color: var(--accent); }
.tabs .n { font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; margin-left: 5px; }

.block { margin-bottom: 34px; }
.block > h3 {
  font-family: var(--font-body); font-size: 11px; font-weight: 700; letter-spacing: .15em;
  text-transform: uppercase; color: var(--faint); margin-bottom: 14px;
  padding-bottom: 9px; border-bottom: 1px solid var(--line-soft);
}
.bullets { list-style: none; padding: 0; margin: 0; display: grid; gap: 11px; }
.bullets li { display: flex; gap: 12px; font-size: 14.5px; line-height: 1.6; color: var(--text-2); }
.bullets li::before { content: ''; flex-shrink: 0; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); margin-top: 9px; }

.opp { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.opp li {
  padding: 14px 16px; background: var(--surface); border: 1px solid var(--line-soft);
  border-left: 2px solid var(--accent); border-radius: var(--r-sm);
  font-size: 14px; line-height: 1.6; color: var(--text-2);
}

.quote {
  border-left: 2px solid var(--accent-line); padding: 4px 0 4px 18px; margin: 0 0 18px;
  font-family: var(--font-display); font-size: 18px; line-height: 1.5; font-style: italic; color: var(--text);
}
.quote footer { font-family: var(--font-body); font-style: normal; font-size: 12.5px; color: var(--muted); margin-top: 9px; }

.prose { font-size: 14.5px; line-height: 1.72; color: var(--text-2); white-space: pre-wrap; }
.prose strong { color: var(--text); font-weight: 600; }

/* transcript */
.t-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px;
  position: sticky; top: var(--header-h); background: var(--bg); padding: 12px 0; z-index: 20; border-bottom: 1px solid var(--line-soft); }
.t-hits { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.turn { display: grid; grid-template-columns: 168px minmax(0,1fr); gap: 22px; padding: 15px 0; border-bottom: 1px solid var(--line-soft); }
.turn-spk { font-size: 12.5px; font-weight: 600; color: var(--accent); line-height: 1.5; word-break: break-word; }
.turn-txt { font-size: 14.5px; line-height: 1.75; color: var(--text-2); }
.turn-txt p { margin: 0 0 .9em; } .turn-txt p:last-child { margin: 0; }
.turn.hit { background: linear-gradient(90deg, rgba(217,164,65,.05), transparent 70%); }

/* sidebar */
.side { position: sticky; top: calc(var(--header-h) + 22px); display: grid; gap: 16px; }
.panel { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r); padding: 17px 18px; }
.panel h4 {
  font-family: var(--font-body); font-size: 10.5px; font-weight: 700; letter-spacing: .15em;
  text-transform: uppercase; color: var(--faint); margin-bottom: 13px;
}
.prow { padding: 11px 0; border-top: 1px solid var(--line-soft); }
.prow:first-of-type { border-top: none; padding-top: 0; }
.prow .nm { font-size: 14px; font-weight: 600; color: var(--text); }
.prow .rl { font-size: 12.5px; color: var(--muted); line-height: 1.45; margin-top: 2px; }
.prow .rl b { color: var(--text-2); font-weight: 500; }
.contacts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cbadge {
  display: inline-flex; align-items: flex-start; gap: 5px; font-size: 11.5px; font-weight: 500;
  padding: 3px 8px; border-radius: 4px; background: var(--accent-dim); color: var(--accent-hi);
  border: 1px solid var(--accent-line); line-height: 1.5;
  word-break: normal; overflow-wrap: break-word; max-width: 100%;
}
.cbadge:hover { background: rgba(217,164,65,.22); }

/* ---------------- Directory rows ---------------- */
.rows { display: grid; gap: 10px; }
.row {
  display: grid; grid-template-columns: minmax(0,1.35fr) minmax(0,1.5fr) minmax(0,1fr); gap: 22px;
  padding: 16px 18px; background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--r); transition: border-color .18s var(--ease);
}
.row:hover { border-color: #33333e; }
.row .nm { font-size: 15.5px; font-weight: 600; font-family: var(--font-display); }
.row .sub { font-size: 13px; color: var(--muted); margin-top: 3px; line-height: 1.5; }
.row .bio { font-size: 13.5px; color: var(--text-2); line-height: 1.55; }
.row .links { display: grid; gap: 5px; align-content: start; }
.row .links a { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.row .links a:hover { color: var(--accent); }

.topics-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tchip {
  display: inline-flex; align-items: baseline; gap: 8px; padding: 8px 14px; border-radius: 100px;
  background: var(--surface); border: 1px solid var(--line-soft); font-size: 13.5px; font-weight: 500;
  transition: all .16s var(--ease);
}
.tchip:hover { border-color: var(--accent-line); color: var(--accent-hi); }
.tchip span { font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; }

/* ---------------- Search overlay ---------------- */
.ovl {
  position: fixed; inset: 0; z-index: 200; background: rgba(4,4,6,.78);
  backdrop-filter: blur(6px); display: flex; align-items: flex-start; justify-content: center;
  padding: 9vh 20px 20px; opacity: 0; pointer-events: none; transition: opacity .18s var(--ease);
}
.ovl.open { opacity: 1; pointer-events: auto; }
.ovl-box {
  width: min(780px, 100%); max-height: 76vh; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.9); overflow: hidden;
  transform: translateY(-8px); transition: transform .18s var(--ease);
}
.ovl.open .ovl-box { transform: none; }
.ovl-in { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.ovl-in input { flex: 1; border: none; background: none; outline: none; font-size: 17px; }
.ovl-in input::placeholder { color: var(--faint); }
.ovl-in .esc { font-family: var(--font-mono); font-size: 10.5px; color: var(--faint); border: 1px solid var(--line); padding: 3px 6px; border-radius: 4px; }
.ovl-res { overflow-y: auto; padding: 8px; }
.res-grp { font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--faint); padding: 12px 12px 7px; }
.res {
  display: block; padding: 10px 12px; border-radius: var(--r-sm); transition: background .12s var(--ease);
}
.res:hover, .res.sel { background: var(--surface-3); }
.res .t { font-size: 14.5px; font-weight: 600; }
.res .s { font-size: 12.5px; color: var(--muted); margin-top: 2px; line-height: 1.5; }
.res .snip { font-size: 12.5px; color: var(--text-2); margin-top: 5px; line-height: 1.6;
  padding-left: 10px; border-left: 2px solid var(--line); }
.empty { padding: 46px 20px; text-align: center; color: var(--muted); font-size: 14px; }

/* Long-label button: keeps the external-link glyph attached to the last word
   instead of floating beside a wrapped block. */
.btn.longlab { display: inline-block; text-align: center; }
.btn.longlab > span { display: inline; }
.btn.longlab svg { display: inline-block; vertical-align: -2px; margin-left: 6px; }

/* ---------------- Pipeline: deadline strip ---------------- */
.dstrip {
  display: flex; align-items: flex-start; gap: 10px; overflow-x: auto; padding: 2px 0 14px;
  margin-bottom: 30px; scroll-snap-type: x proximity;
}
.dcard {
  flex: 0 0 244px; max-width: 244px; scroll-snap-align: start;
  background: var(--surface); border: 1px solid var(--line-soft);
  border-left: 2px solid var(--line); border-radius: var(--r-sm);
  padding: 13px 15px; min-width: 0;
}
.dcard.soon { border-left-color: var(--accent); }
.dcard.mid  { border-left-color: #3a3a46; }
.dcard.far  { border-left-color: var(--line-soft); }
.dcard.past { border-left-color: var(--line-soft); opacity: .55; }
.dcard-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.dcard-dt { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); font-variant-numeric: tabular-nums; }
.dcard.past .dcard-dt, .dcard.far .dcard-dt { color: var(--muted); }
.dcard-in { font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dcard.soon .dcard-in { color: var(--accent-hi); }
.dcard h4 { font-size: 14.5px; line-height: 1.32; color: var(--text); overflow-wrap: break-word; }
.dcard p { margin: 6px 0 0; font-size: 12px; color: var(--muted); line-height: 1.5; overflow-wrap: break-word;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------------- Pipeline: submissions ---------------- */
.gsub { margin-bottom: 34px; }
.gsub > h3 {
  font-family: var(--font-body); font-size: 11px; font-weight: 700; letter-spacing: .15em;
  text-transform: uppercase; color: var(--faint); margin-bottom: 14px;
  padding-bottom: 9px; border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
}
.gsub.urgent > h3 { color: var(--accent); border-bottom-color: var(--accent-line); }
.srow {
  display: grid; grid-template-columns: minmax(0,1fr) 232px; gap: 22px;
  padding: 16px 18px; background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--r); margin-bottom: 10px; transition: border-color .18s var(--ease);
}
.srow:hover { border-color: #33333e; }
.srow.urgent { border-left: 2px solid var(--accent); }
.srow .nm { font-family: var(--font-display); font-size: 16.5px; font-weight: 600; overflow-wrap: break-word; }
.srow .who { font-size: 12.5px; color: var(--muted); margin-top: 3px; line-height: 1.5; overflow-wrap: break-word; }
.srow .what { font-size: 14px; color: var(--text-2); line-height: 1.58; margin: 9px 0 0; }
.srow .brief { font-size: 12.5px; color: var(--muted); line-height: 1.55; margin: 7px 0 0; }
.srow .src { font-size: 11.5px; color: var(--faint); line-height: 1.5; margin: 9px 0 0; overflow-wrap: break-word; }
.srow-side { display: grid; gap: 9px; align-content: start; min-width: 0; }
.badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 700;
  letter-spacing: .09em; text-transform: uppercase; padding: 3px 8px; border-radius: 4px;
  background: var(--surface-3); color: var(--text-2);
}
.badge.on { background: var(--accent-dim); color: var(--accent-hi); }
.badge.soft { background: transparent; border: 1px solid var(--line); color: var(--muted); font-weight: 600; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.dl { font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; line-height: 1.45; }
.dl b { color: var(--text); font-weight: 600; }
.dl span { display: block; font-size: 11.5px; color: var(--faint); margin-top: 2px; }
.dl.soon b, .dl.soon span { color: var(--accent-hi); }

/* ---------------- Pipeline: recordings, portals, membership ---------------- */
.recs { display: grid; gap: 8px; }
.rec {
  display: grid; grid-template-columns: minmax(0,1.5fr) 88px minmax(0,180px) 150px 136px;
  gap: 8px 16px; align-items: center; padding: 12px 16px;
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-sm);
}
/* The status note spans the full row underneath the four columns. */
.rec .rnote {
  grid-column: 1 / -1; font-size: 12px; line-height: 1.55; color: var(--muted);
  padding-left: 10px; border-left: 2px solid var(--line); overflow-wrap: break-word;
}
.rec.dead { opacity: .72; border-style: dashed; }
.rec.dead .nm { color: var(--text-2); }
.badge.bad { background: rgba(201,123,110,.12); color: #d99384; border: 1px solid rgba(201,123,110,.3); }
.rec .nm .badge { margin-left: 8px; vertical-align: middle; }
@media (max-width: 760px) {
  .rec { grid-template-columns: 1fr; gap: 7px; }
  .rec .rnote { padding-top: 2px; }
}
.rec .nm { font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.4; overflow-wrap: break-word; }
.rec .dt { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rec .pc { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; min-width: 0; }
.code {
  font-family: var(--font-mono); font-size: 12px; padding: 3px 7px; border-radius: 4px;
  background: var(--bg-deep); border: 1px solid var(--line); color: var(--accent-hi);
  overflow-wrap: break-word; max-width: 100%;
}
.copy {
  font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 4px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--muted); white-space: nowrap;
  transition: color .16s var(--ease), border-color .16s var(--ease);
}
.copy:hover { color: var(--text); border-color: #3a3a46; }
.copy.ok { color: var(--accent-hi); border-color: var(--accent-line); }
.alink { font-size: 12.5px; color: var(--accent); display: inline-flex; align-items: center; gap: 6px; }
.alink:hover { color: var(--accent-hi); }
.plinks { display: grid; gap: 9px; }
.plink {
  padding: 12px 16px; background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--r-sm); transition: border-color .18s var(--ease);
}
.plink:hover { border-color: #33333e; }
.plink .nm { font-size: 14px; font-weight: 600; color: var(--accent-hi); display: inline-flex; align-items: center; gap: 7px; }
.plink p { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.mship { display: grid; grid-template-columns: 190px minmax(0,1fr); gap: 26px; align-items: start; }
.mship-n { font-family: var(--font-display); font-size: 23px; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }
.mship-l { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin-top: 7px; font-weight: 600; }
.fine { font-size: 12.5px; color: var(--muted); line-height: 1.6; margin: 0 0 8px; overflow-wrap: break-word; }
.fine:last-child { margin-bottom: 0; }
.fine b { color: var(--text-2); font-weight: 600; }
.mono-chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------------- Directory ---------------- */
.dcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); gap: 12px; }
.pcard {
  display: flex; flex-direction: column; gap: 4px; padding: 15px 17px;
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r);
  transition: border-color .18s var(--ease);
}
.pcard:hover { border-color: #33333e; }
.pcard h3 { font-size: 16.5px; line-height: 1.3; overflow-wrap: break-word; }
.pcard .ttl { font-size: 13px; color: var(--text-2); line-height: 1.5; overflow-wrap: break-word; }
.pcard .co { font-size: 13px; color: var(--muted); line-height: 1.5; overflow-wrap: break-word; }
.pcard .xtra { font-size: 12px; color: var(--faint); line-height: 1.55; margin-top: 3px; overflow-wrap: break-word; }
.pcard .acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }

/* ---------------- Misc ---------------- */
.notice {
  display: flex; gap: 13px; padding: 15px 17px; border-radius: var(--r);
  background: rgba(111,179,196,.06); border: 1px solid rgba(111,179,196,.2); margin-bottom: 22px;
}
.notice svg { color: var(--cyan); flex-shrink: 0; margin-top: 2px; }
.notice > div { min-width: 0; }
.notice p { margin: 0; font-size: 13.5px; color: var(--text-2); line-height: 1.6; overflow-wrap: break-word; min-width: 0; }
.notice b { color: var(--text); font-weight: 600; }
.notice.warn { background: rgba(201,123,110,.07); border-color: rgba(201,123,110,.32); }
.notice.warn svg { color: var(--rose); }
.notice.warn p + p { margin-top: 9px; }
.notice.warn a { overflow-wrap: anywhere; color: var(--accent-hi); text-decoration: underline; text-decoration-color: var(--accent-line); text-underline-offset: 2px; }
.notice .ntitle { font-family: var(--font-body); font-size: 11px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--rose); margin: 0 0 7px; }
.lede-p { color: var(--text-2); max-width: 72ch; margin-bottom: 24px; }

.ftr { border-top: 1px solid var(--line-soft); padding: 30px 0 44px; color: var(--faint); font-size: 12.5px; }
.ftr a { color: var(--muted); } .ftr a:hover { color: var(--accent); }

.skel { background: linear-gradient(90deg, var(--surface) 25%, var(--surface-3) 50%, var(--surface) 75%);
  background-size: 200% 100%; animation: sh 1.3s infinite linear; border-radius: var(--r); }
@keyframes sh { to { background-position: -200% 0; } }

@media (max-width: 1180px) {
  .nav a { padding: 7px 9px; font-size: 13px; }
}
@media (max-width: 1080px) {
  /* minmax(0,…) so a wide child cannot stretch the column past the viewport */
  .d-cols { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  .side { position: static; }
  .rec { grid-template-columns: minmax(0,1fr) 88px; row-gap: 10px; }
}
@media (max-width: 860px) {
  .srow { grid-template-columns: 1fr; gap: 14px; }
  .mship { grid-template-columns: 1fr; gap: 14px; }
  .row { grid-template-columns: 1fr; gap: 10px; }
  .nav { display: none; }
  .nav.open {
    display: flex; flex-direction: column; position: absolute; top: var(--header-h); left: 0; right: 0;
    background: var(--bg); border-bottom: 1px solid var(--line); padding: 10px 20px 16px; gap: 2px;
  }
  .burger { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px;
    border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface-2); }
  .kbtn span { display: none; }
}
@media (max-width: 640px) {
  .wrap, .hdr-in { padding: 0 18px; }
  .wrap.sec, .wrap.detail { padding-left: 18px; padding-right: 18px; }
  .grid { grid-template-columns: 1fr; }
  .turn { grid-template-columns: 1fr; gap: 5px; }
  .field input { width: 100%; }
  .field { flex: 1; min-width: 0; }
  .toolbar .field { flex: 1 0 100%; }
  .toolbar .sel { flex: 1; min-width: 0; }
  .stats { gap: 18px 26px; }
  .stat-n { font-size: 26px; }
  .hero { padding: 38px 0 28px; }
  .dcard { flex-basis: 218px; max-width: 218px; }
  .rec { grid-template-columns: 1fr; row-gap: 8px; align-items: start; }
  .dcards { grid-template-columns: 1fr; }
  /* Fit all four session tabs inside a 375px viewport without a hidden scroll. */
  .tabs button { padding: 11px 9px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
}

/* Per-submission caution — e.g. a Disco link whose slug names a different supervisor
   than the email that shared it. Reads as a warning without shouting. */
.swarn{display:flex;gap:8px;align-items:flex-start;margin:10px 0 0;padding:9px 11px;
  font-size:12.5px;line-height:1.5;color:#e8c98a;
  background:rgba(217,164,65,.07);border:1px solid rgba(217,164,65,.26);border-radius:7px}
.swarn svg{flex:0 0 auto;width:14px;height:14px;margin-top:2px;opacity:.85}

/* ------------------------------- course view ------------------------------ */
.cbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 14px 16px; margin-bottom: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
}
.cnext {
  margin: 0 0 22px; font-size: 13.5px; color: var(--text-2);
  padding-left: 12px; border-left: 2px solid var(--accent-line);
}
.cnext b { color: var(--text); font-weight: 600; }
/* Sits under "Next up" and carries schedule-wide context: which weeks moved,
   why a class runs shorter. Deliberately quieter than .cnext, which is the
   single actionable line, but wider measure since it runs to a few sentences. */
.cnote {
  margin: -12px 0 22px; padding-left: 12px;
  font-size: 13px; line-height: 1.65; color: var(--muted);
  border-left: 2px solid var(--line); max-width: 76ch;
}
.cmuted { font-size: 12.5px; color: var(--muted); line-height: 1.5; }

.ccards { display: grid; gap: 14px; }
.ccard {
  background: var(--surface); border: 1px solid var(--line);
  border-left: 3px solid var(--line-soft);
  border-radius: var(--r); padding: 18px 20px; min-width: 0;
}
.ccard.held { border-left-color: var(--accent-line); }
.ccard-hd {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 8px;
}
.ccard-n {
  font-family: var(--font-body); font-size: 11px; font-weight: 700;
  letter-spacing: .15em; text-transform: uppercase; color: var(--accent);
}
.ccard-dt { font-size: 12.5px; color: var(--muted); margin-left: 10px; }
.ccard h3 {
  font-family: var(--font-display); font-size: 21px; font-weight: 500;
  line-height: 1.25; margin: 0 0 8px; color: var(--text); overflow-wrap: break-word;
}
.ccard-cv { margin: 0 0 10px; font-size: 14px; line-height: 1.65; color: var(--text-2); overflow-wrap: break-word; }
.ccard-ls {
  display: flex; align-items: center; gap: 8px; margin: 0 0 12px;
  font-size: 13px; color: var(--cyan); overflow-wrap: break-word; min-width: 0;
}
.ccard-ls svg { flex-shrink: 0; }

.ctask {
  background: var(--bg-deep); border: 1px solid var(--line-soft);
  border-radius: var(--r-sm); padding: 12px 14px; margin: 0 0 13px;
}
.ctask.soon { border-color: var(--accent-line); background: rgba(217,164,65,.05); }
.ctask-hd {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; margin-bottom: 7px;
}
.ctask-hd > span:first-child {
  font-family: var(--font-body); font-size: 10.5px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.ctask-dl { font-size: 12.5px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.ctask-dl.soon { color: var(--accent-hi); }
.ctask-dl.past { color: var(--faint); }
.ctask p { margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--text-2); overflow-wrap: break-word; }

.cres { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.cpc {
  display: flex; flex-wrap: wrap; align-items: center; gap: 9px;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-soft);
  font-size: 11px; font-weight: 700; letter-spacing: .13em;
  text-transform: uppercase; color: var(--muted);
}
.cpc .code { letter-spacing: 0; text-transform: none; }

@media (max-width: 620px) {
  .ccard { padding: 15px 16px; }
  .ccard h3 { font-size: 18.5px; }
  .cbar { padding: 12px; }
  .ccard-dt { margin-left: 0; display: block; margin-top: 3px; }
}
.pcard .esrc {
  font-size: 11.5px; line-height: 1.5; color: var(--faint);
  margin-top: 7px; padding-left: 9px; border-left: 2px solid var(--line-soft);
  overflow-wrap: break-word;
}
.pcard .acts .cbadge { overflow-wrap: anywhere; }


/* Machine-transcript notice -- these sessions come from whisper, not Fathom,
   and some are partial, so the caveat sits above the player where it cannot
   be missed rather than buried in a footnote. */
.mnote {
  border: 1px solid rgba(217,164,65,.28); background: rgba(217,164,65,.05);
  border-radius: var(--r-sm); padding: 13px 16px; margin-bottom: 18px;
}
.mnote-hd {
  display: flex; align-items: center; gap: 9px; color: var(--accent-hi);
  font-size: 11.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
}
.mnote-hd svg { flex: none; }
.mnote p {
  margin: 7px 0 0; font-size: 13px; line-height: 1.6; color: var(--text-2);
  max-width: 78ch;
}

/* ============================================================
   Category filters — People, Companies, Opportunities
   ============================================================ */
.fchips { display: flex; gap: 7px; flex-wrap: wrap; margin: -6px 0 22px; }
.facets { display: flex; gap: 7px; flex-wrap: wrap; }
.fchip {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  padding: 6px 11px; border-radius: 999px; font-size: 12.5px;
  font-family: var(--font-body); color: var(--text-2);
  background: var(--surface-2); border: 1px solid var(--line);
  transition: border-color .16s var(--ease), color .16s var(--ease), background .16s var(--ease);
}
.fchip:hover { border-color: #3a3a46; color: var(--text); }
.fchip.on { background: var(--accent-dim); border-color: var(--accent-line); color: var(--accent-hi); }
.fchip span {
  font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums;
  background: rgba(0,0,0,.28); padding: 1px 6px; border-radius: 999px;
}
.fchip.on span { color: var(--accent); background: rgba(0,0,0,.3); }

.catline { display: flex; align-items: center; gap: 7px; margin-top: 7px; flex-wrap: wrap; }
.cattag {
  display: inline-block; font-size: 10.5px; font-weight: 600; letter-spacing: .07em;
  text-transform: uppercase; color: var(--cyan); padding: 2px 7px; border-radius: 4px;
  background: rgba(111,179,196,.09); border: 1px solid rgba(111,179,196,.24);
}
.cattag.sm { text-transform: none; letter-spacing: .02em; font-weight: 500; opacity: .8; margin-left: 4px; }
.lowconf {
  font-size: 10.5px; color: var(--faint); border: 1px dashed var(--line);
  padding: 1px 6px; border-radius: 4px; cursor: help;
}
.row .nosess { font-size: 12.5px; color: var(--faint); font-style: italic; }
.esrc { font-size: 11.5px; color: var(--faint); margin-top: 6px; }

/* ============================================================
   Ask the archive — floating assistant
   ============================================================ */
#askfab {
  position: fixed; right: 22px; bottom: 22px; z-index: 60;
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer;
  padding: 12px 18px 12px 15px; border-radius: 999px;
  font-family: var(--font-body); font-size: 14px; font-weight: 600;
  color: #16130c; background: linear-gradient(180deg, var(--accent-hi), var(--accent));
  border: none; box-shadow: 0 4px 14px -2px rgba(0,0,0,.6), 0 12px 34px -10px rgba(217,164,65,.45);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
#askfab:hover { transform: translateY(-2px);
  box-shadow: 0 6px 18px -2px rgba(0,0,0,.65), 0 16px 40px -10px rgba(217,164,65,.6); }
#askfab:active { transform: translateY(0); }

#askp {
  position: fixed; right: 22px; bottom: 88px; z-index: 61;
  width: 456px; max-width: calc(100vw - 32px);
  height: 620px; max-height: calc(100vh - 130px);
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: 0 8px 24px rgba(0,0,0,.5), 0 30px 70px -20px rgba(0,0,0,.85);
  opacity: 0; transform: translateY(12px) scale(.985);
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
#askp.on { opacity: 1; transform: none; }
#askp[hidden] { display: none; }

#askp header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 15px 16px 13px; border-bottom: 1px solid var(--line-soft);
  background: var(--surface-2); flex-shrink: 0;
}
#askp header h2 { font-family: var(--font-display); font-size: 16px; font-weight: 600; margin: 0; }
#askmeta { margin: 3px 0 0; font-size: 11.5px; color: var(--faint); }
#askp .hbtns { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
#asknew, #askx {
  cursor: pointer; background: none; border: 1px solid var(--line); color: var(--muted);
  border-radius: var(--r-sm); font-family: var(--font-body); font-size: 12px; padding: 5px 9px;
  transition: color .16s var(--ease), border-color .16s var(--ease);
}
#askx { padding: 5px 6px; display: grid; place-items: center; }
#asknew:hover, #askx:hover { color: var(--text); border-color: #3a3a46; }

#asklog { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
#asklog::-webkit-scrollbar { width: 9px; }
#asklog::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 9px; }

.askintro p { font-size: 13.5px; color: var(--text-2); line-height: 1.6; margin: 0 0 14px; }
.asksugg { display: grid; gap: 7px; }
.sg {
  text-align: left; cursor: pointer; font-family: var(--font-body); font-size: 12.5px;
  color: var(--text-2); background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r); padding: 9px 11px; line-height: 1.45;
  transition: border-color .16s var(--ease), color .16s var(--ease);
}
.sg:hover { border-color: var(--accent-line); color: var(--accent-hi); }

.msg { max-width: 100%; }
.msg.me {
  align-self: flex-end; max-width: 86%;
  background: var(--accent-dim); border: 1px solid var(--accent-line);
  border-radius: var(--r) var(--r) 3px var(--r); padding: 9px 12px;
}
.msg.me p { margin: 0; font-size: 13.5px; color: var(--text); line-height: 1.5; }
.msg.ai .body { font-size: 13.5px; color: var(--text-2); line-height: 1.62; }
.msg.ai .body p { margin: 0 0 9px; }
.msg.ai .body p:last-child { margin-bottom: 0; }
.msg.ai .body ul, .msg.ai .body ol { margin: 0 0 9px; padding-left: 18px; }
.msg.ai .body h4 {
  font-family: var(--font-display); font-size: 13.5px; font-weight: 600;
  color: var(--text); margin: 13px 0 6px; letter-spacing: .01em;
}
.msg.ai .body h4:first-child { margin-top: 0; }
.msg.ai .body em { font-style: italic; color: var(--text); }
.msg.ai .body li { margin-bottom: 5px; }
.msg.ai .body strong { color: var(--text); font-weight: 600; }
.msg.ai .body code {
  font-family: var(--font-mono); font-size: 12px; background: var(--surface-3);
  padding: 1px 5px; border-radius: 4px; color: var(--accent-hi);
}
.msg.ai .body a { color: var(--accent-hi); text-decoration: underline;
  text-decoration-color: var(--accent-line); text-underline-offset: 2px; overflow-wrap: anywhere; }
.msg.ai .body .err { color: var(--rose); }

.srcs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 9px; }
.srcs span {
  font-size: 10px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase;
  color: var(--faint);
}
.srcs a {
  font-size: 11px; color: var(--muted); background: var(--surface-2);
  border: 1px solid var(--line-soft); border-radius: 999px; padding: 2px 8px;
  max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.srcs a:hover { color: var(--accent-hi); border-color: var(--accent-line); }

.dots { display: inline-flex; gap: 4px; align-items: center; height: 18px; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--muted);
  animation: bounce 1.15s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 70%, 100% { opacity: .28; transform: translateY(0); }
  35% { opacity: 1; transform: translateY(-3px); } }

#askf {
  display: flex; gap: 8px; align-items: flex-end; padding: 12px;
  border-top: 1px solid var(--line-soft); background: var(--surface-2); flex-shrink: 0;
}
#aski {
  flex: 1; resize: none; font-family: var(--font-body); font-size: 13.5px; line-height: 1.5;
  color: var(--text); background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--r); padding: 10px 12px; outline: none; max-height: 130px;
}
#aski:focus { border-color: var(--accent-line); }
#aski::placeholder { color: var(--faint); }
#asksend {
  cursor: pointer; display: grid; place-items: center; width: 38px; height: 38px;
  border: none; border-radius: var(--r); color: #16130c; flex-shrink: 0;
  background: linear-gradient(180deg, var(--accent-hi), var(--accent));
  transition: opacity .16s var(--ease);
}
#asksend:hover { opacity: .88; }

@media (max-width: 560px) {
  #askfab { right: 14px; bottom: 14px; padding: 11px 16px 11px 13px; }
  #askp {
    right: 8px; left: 8px; bottom: 74px; width: auto;
    height: calc(100vh - 108px); max-height: none;
  }
  .srcs a { max-width: 140px; }
}

/* ============================================================
   Calendar — month + week views
   Type colours are deliberately few: deadlines are the loud one
   (rose), classes and summits carry the gold accent, everything
   else stays quiet so a due date is never lost in the grid.
   ============================================================ */
.cal-bar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin: 4px 0 18px;
}
.cal-nav { display: flex; align-items: center; gap: 7px; }
.cal-arrow {
  width: 34px; height: 34px; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--text-2); font-size: 19px; line-height: 1; cursor: pointer;
  transition: background .16s var(--ease), color .16s var(--ease), border-color .16s var(--ease);
}
.cal-arrow:hover { background: var(--surface-3); color: var(--accent-hi); border-color: #3a3a46; }
.cal-title {
  font-family: var(--font-display); font-size: 21px; font-weight: 500;
  margin: 0; flex: 1; min-width: 180px; letter-spacing: -.01em;
}
.cal-views { display: flex; gap: 0; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.cal-vbtn {
  background: var(--surface-2); border: 0; color: var(--text-2);
  font-family: var(--font-body); font-size: 12.5px; font-weight: 500;
  padding: 8px 15px; cursor: pointer; transition: background .16s var(--ease), color .16s var(--ease);
}
.cal-vbtn + .cal-vbtn { border-left: 1px solid var(--line); }
.cal-vbtn:hover { background: var(--surface-3); color: var(--text); }
.cal-vbtn.on { background: var(--accent-dim); color: var(--accent-hi); }

/* --- month --- */
.cal-dow {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px;
  margin-top: 14px; padding: 0 1px;
}
.cal-dow div {
  font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase;
  color: var(--faint); padding: 0 0 7px 3px;
}
/* minmax(0,1fr) rather than 1fr: the pills are nowrap, so a plain 1fr track
   refuses to shrink below its longest label and blows the grid past the page. */
.cal-grid {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px; background: var(--line-soft);
  border: 1px solid var(--line-soft); border-radius: var(--r);
  overflow: hidden;
}
.cal-cell {
  background: var(--surface); min-height: 116px; padding: 7px 6px 8px;
  display: flex; flex-direction: column; gap: 5px;
  min-width: 0; overflow: hidden;
}
.cal-cell.out { background: var(--bg-deep); }
.cal-cell.out .cal-num { color: var(--faint); opacity: .55; }
.cal-cell.today { background: rgba(217,164,65,.05); box-shadow: inset 0 0 0 1px var(--accent-line); }
.cal-num {
  font-family: var(--font-mono); font-size: 11.5px; color: var(--muted);
  padding-left: 3px; line-height: 1;
}
.cal-cell.today .cal-num { color: var(--accent-hi); font-weight: 700; }
.cal-evs { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-pill {
  display: block; width: 100%; text-align: left; cursor: pointer;
  background: var(--surface-3); border: 0; border-left: 2.5px solid var(--muted);
  border-radius: 3px; padding: 4px 6px; color: var(--text-2);
  font-family: var(--font-body); font-size: 11.5px; line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: background .14s var(--ease), color .14s var(--ease);
}
.cal-pill:hover { background: #26262f; color: var(--text); }
.cal-pill.on { background: var(--accent-dim); color: var(--accent-hi); }
.cal-pill i { font-style: normal; font-family: var(--font-mono); font-size: 10px; color: var(--faint); margin-right: 4px; }
.cal-pill.on i { color: var(--accent); }
.cal-cont { font-size: 9.5px; color: var(--faint); margin-left: 4px; text-transform: uppercase; letter-spacing: .05em; }
.cal-more {
  background: none; border: 0; cursor: pointer; text-align: left;
  font-family: var(--font-body); font-size: 10.5px; color: var(--faint);
  padding: 1px 6px;
}
.cal-more:hover { color: var(--accent); }

/* type accents, shared by month pills and week cards */
.t-deadline          { border-left-color: var(--rose); }
.t-class             { border-left-color: var(--accent); }
.t-summit,
.t-symposium         { border-left-color: var(--accent-hi); }
.t-cafe              { border-left-color: var(--cyan); }
.t-listening-session { border-left-color: var(--cyan); }
.t-office-hours      { border-left-color: #4a4a58; }
.t-course            { border-left-color: var(--accent); }

/* --- week --- */
.cal-week {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px;
  margin-top: 14px; background: var(--line-soft);
  border: 1px solid var(--line-soft); border-radius: var(--r); overflow: hidden;
}
.cal-wcol { background: var(--surface); min-height: 260px; display: flex; flex-direction: column; min-width: 0; }
.cal-wcol.today { background: rgba(217,164,65,.05); }
.cal-whead {
  padding: 10px 10px 9px; border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: baseline; gap: 6px;
}
.cal-whead span { font-size: 10.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--faint); }
.cal-whead b { font-family: var(--font-display); font-size: 19px; font-weight: 500; color: var(--text); }
.cal-whead em { font-style: normal; font-size: 10.5px; color: var(--faint); }
.cal-wcol.today .cal-whead b,
.cal-wcol.today .cal-whead span { color: var(--accent-hi); }
.cal-wbody { padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.cal-wcard {
  display: flex; flex-direction: column; gap: 3px; text-align: left; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--line-soft);
  border-left: 2.5px solid var(--muted); border-radius: var(--r-sm);
  padding: 8px 9px; font-family: var(--font-body);
  transition: background .14s var(--ease), border-color .14s var(--ease);
}
.cal-wcard:hover { background: var(--surface-3); border-color: var(--line); }
.cal-wcard.on { background: var(--accent-dim); border-color: var(--accent-line); }
.cal-wtype { font-size: 9.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.cal-wtitle { font-size: 12.5px; line-height: 1.35; color: var(--text); overflow-wrap: anywhere; }
.cal-wtime { font-family: var(--font-mono); font-size: 10.5px; color: var(--accent); }
.cal-wempty { color: var(--faint); font-size: 13px; padding: 6px 2px; }

/* --- detail card --- */
.cal-detail {
  position: relative; margin-top: 20px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 22px 24px; box-shadow: var(--shadow);
}
.cal-x {
  position: absolute; top: 12px; right: 14px; width: 28px; height: 28px;
  background: none; border: 0; color: var(--faint); font-size: 22px; line-height: 1;
  cursor: pointer; border-radius: var(--r-sm);
}
.cal-x:hover { color: var(--text); background: var(--surface-3); }
.cal-d-tags { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 11px; }
.cal-detail h3 {
  font-family: var(--font-display); font-size: 24px; font-weight: 500;
  line-height: 1.22; margin: 0 34px 9px 0; letter-spacing: -.012em;
}
.cal-d-when { font-size: 14.5px; color: var(--text); font-weight: 500; }
.cal-d-time { font-family: var(--font-mono); font-size: 12.5px; color: var(--accent); margin-top: 3px; }
.cal-d-faint { color: var(--faint); font-family: var(--font-body); }
.cal-detail > p { font-size: 14px; line-height: 1.62; color: var(--text-2); margin: 15px 0 0; max-width: 68ch; }
.cal-d-rows {
  display: grid; grid-template-columns: 82px 1fr; gap: 9px 16px;
  margin: 18px 0 0; padding-top: 16px; border-top: 1px solid var(--line-soft);
}
.cal-d-rows dt {
  font-size: 10.5px; font-weight: 600; letter-spacing: .085em; text-transform: uppercase;
  color: var(--faint); padding-top: 2px;
}
.cal-d-rows dd { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--text-2); }
.cal-d-rows code {
  font-family: var(--font-mono); font-size: 12.5px; background: var(--surface-3);
  padding: 2px 7px; border-radius: 4px; color: var(--accent-hi);
}
.cal-d-caveat { margin-top: 18px; }
.cal-d-caveat p { margin: 6px 0 0; font-size: 13px; line-height: 1.6; }
.cal-d-links { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 20px; }

/* --- next up --- */
.cal-next { margin-top: 30px; }
.cal-next h3 {
  font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--faint); margin: 0 0 11px;
}
.cal-nextlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.cal-nextlist button {
  display: flex; align-items: baseline; gap: 14px; width: 100%; text-align: left;
  background: var(--surface); border: 0; border-radius: var(--r-sm);
  padding: 11px 14px; cursor: pointer; font-family: var(--font-body);
  transition: background .14s var(--ease);
}
.cal-nextlist button:hover { background: var(--surface-2); }
.cal-nd { font-family: var(--font-mono); font-size: 11.5px; color: var(--accent); min-width: 52px; }
.cal-nt { font-size: 13.5px; color: var(--text); flex: 1; line-height: 1.4; }
.cal-nr { font-size: 11.5px; color: var(--faint); white-space: nowrap; }

@media (max-width: 900px) {
  .cal-week { grid-template-columns: 1fr; }
  .cal-wcol { min-height: 0; }
  .cal-whead { border-bottom: 1px solid var(--line); }
  .cal-wcol .cal-wbody:empty { display: none; }
}
@media (max-width: 720px) {
  .cal-bar { gap: 11px; }
  .cal-title { order: -1; width: 100%; flex: none; font-size: 19px; }
  .cal-cell { min-height: 74px; padding: 5px 3px 6px; }
  .cal-num { font-size: 10.5px; }
  /* On a phone the month grid is a density map, not a reading surface: show a
     dot per event and let the week view or a tap carry the detail. */
  .cal-pill { font-size: 0; padding: 0; height: 5px; border-radius: 3px;
    border-left: 0; background: var(--muted); }
  .cal-pill i, .cal-cont { display: none; }
  .cal-pill.t-deadline { background: var(--rose); }
  .cal-pill.t-class, .cal-pill.t-course { background: var(--accent); }
  .cal-pill.t-summit, .cal-pill.t-symposium { background: var(--accent-hi); }
  .cal-pill.t-cafe, .cal-pill.t-listening-session { background: var(--cyan); }
  .cal-pill.t-office-hours { background: #4a4a58; }
  .cal-pill.on { background: var(--accent-hi); box-shadow: 0 0 0 1.5px var(--accent-line); }
  .cal-more { font-size: 9.5px; padding: 0 2px; }
  .cal-detail { padding: 18px 16px; }
  .cal-detail h3 { font-size: 20px; }
  .cal-d-rows { grid-template-columns: 1fr; gap: 3px 0; }
  .cal-d-rows dt { padding-top: 9px; }
}

/* Schedule corrections ------------------------------------------------------
   Mark reschedules often and some corrections land automatically from his
   email, so a moved event has to announce itself. Cyan reads as informational
   next to the gold accent; rose is already the warning colour elsewhere, so
   cancellations reuse it for consistency. */
.tag.chg {
  background: rgba(111, 179, 196, .1);
  border-color: rgba(111, 179, 196, .34);
  color: var(--cyan);
}
.tag.cxl {
  background: rgba(201, 123, 110, .1);
  border-color: rgba(201, 123, 110, .34);
  color: var(--rose);
}
.cxl-txt { text-decoration: line-through; text-decoration-thickness: 1px; }

/* .notice is a flex row built for an icon beside a block of text. This variant
   has no icon and stacks a heading, a diff list and an attribution line, so it
   switches to a column or the three pieces sit side by side and cramp. */
.notice.cal-d-changed {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: rgba(111, 179, 196, .06);
  border-color: rgba(111, 179, 196, .3);
  margin: 14px 0 0;
}
.notice.cal-d-changed b { color: var(--cyan); }
.notice.cal-d-changed .bullets { margin: 8px 0 0; }
/* The old values are reference, not the headline, so they stay quieter than
   the new time shown above them. */
.notice.cal-d-changed .bullets li { font-size: 13px; color: var(--text-2); }
.notice.cal-d-changed .bullets li b { color: var(--text-2); font-weight: 600; }
.notice.cal-d-changed p { margin-top: 9px; font-size: 12.5px; }

/* A moved event stays visible in the grid but reads as amended, so scanning
   the month surfaces reschedules without opening anything. */
.cal-pill.chg { border-left-color: var(--cyan); }
.cal-pill.cxl span { text-decoration: line-through; opacity: .62; }

/* A cancellation is a warning, not neutral information, so it borrows the rose
   treatment rather than the cyan used for a simple time change. */
.notice.cal-d-changed.cxl-note {
  background: rgba(201, 123, 110, .07);
  border-color: rgba(201, 123, 110, .32);
}
.notice.cal-d-changed.cxl-note b { color: var(--rose); }

/* Events authored automatically from Mark's email. Muted rather than coloured:
   this is a provenance caveat, not an alert, and it should not compete with a
   reschedule or a cancellation on the same card. */
.tag.auto {
  background: transparent;
  border-color: var(--line);
  color: var(--muted);
  border-style: dashed;
}
/* A dashed left edge reads as provisional while scanning the month. */
.cal-pill.auto { border-left-style: dashed; }

/* ---------------- Watch tracking ---------------- */
/* The wrapper becomes the grid item so the toggle can be positioned against
   the card without nesting a button inside the card's anchor. */
.card-wrap { position: relative; display: flex; }
.card-wrap > .card { flex: 1; min-width: 0; }

.wbtn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .01em;
  padding: 5px 10px; border-radius: 100px; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--muted);
  transition: all .16s var(--ease);
}
.wbtn svg { opacity: .5; transition: opacity .16s var(--ease); }
.wbtn:hover { border-color: #3a3a46; color: var(--text); }
.wbtn:hover svg { opacity: 1; }
.wbtn.on { background: var(--accent-dim); border-color: var(--accent-line); color: var(--accent-hi); }
.wbtn.on svg { opacity: 1; }
.wbtn.big { font-size: 13px; padding: 8px 15px; }

/* On a card the toggle sits over the top-right corner. It stays dim until the
   card is hovered so a grid of unwatched sessions is not covered in buttons,
   but a watched one is always legible. */
.card-wrap > .wbtn {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  opacity: 0; transform: translateY(-2px); pointer-events: auto;
}
.card-wrap:hover > .wbtn, .card-wrap > .wbtn:focus-visible { opacity: 1; transform: none; }
.card-wrap.seen > .wbtn { opacity: 1; transform: none; }
/* Keep the title clear of the button. */
.card-wrap > .wbtn ~ .card .card-top { padding-right: 108px; }

.card-wrap.seen > .card { border-color: var(--accent-line); }
.card-wrap.seen > .card .card-body h3 { color: var(--text-2); }

.d-watch { display: flex; align-items: center; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.wago { font-size: 12.5px; color: var(--faint); }

.wprog { margin-bottom: 22px; max-width: 460px; }
.wprog-hd { display: flex; justify-content: space-between; align-items: baseline;
  font-size: 12.5px; color: var(--muted); margin-bottom: 7px; }
.wprog-hd b { color: var(--accent); font-variant-numeric: tabular-nums; }
.wbar { height: 4px; border-radius: 100px; background: var(--surface-3); overflow: hidden; }
.wbar i { display: block; height: 100%; border-radius: 100px; background: var(--accent);
  transition: width .35s var(--ease); }

.werr {
  margin: 0 0 18px; padding: 9px 13px; border-radius: 8px; font-size: 12.5px;
  background: rgba(201,123,110,.09); border: 1px solid rgba(201,123,110,.3); color: var(--rose);
}

@media (max-width: 640px) {
  /* No hover on touch, so the toggle is always visible there. An unwatched
     button drops its label and becomes a tick: at full width it reserved
     enough room to wrap the card's date and runtime onto a second line. A
     watched one keeps its label, since that state is worth naming. */
  .card-wrap > .wbtn { opacity: 1; transform: none; }
  .card-wrap > .wbtn:not(.on) { padding: 6px; }
  .card-wrap > .wbtn:not(.on) span { display: none; }
  .card-wrap > .wbtn:not(.on) ~ .card .card-top { padding-right: 50px; }
}

/* Watch tick on recordings that live outside the session grid. */
.rec .rw { display: flex; justify-content: flex-end; }
.rec .rw .wbtn { white-space: nowrap; }
@media (max-width: 760px) { .rec .rw { justify-content: flex-start; } }
