/* ============================================================
   Content inside windows — "Retro outside, academic inside."
   Modern, readable typography; pixel fonts only for short labels.
   ============================================================ */
.doc { padding: 20px 24px 28px; font-size: 15px; line-height: 1.6; max-width: 880px; }
.doc h1, .doc h2, .doc h3 { font-family: var(--font-serif); line-height: 1.25; margin: 0 0 .5em; }
.doc h1 { font-size: 26px; }
.doc h2 { font-size: 20px; margin-top: 1.4em; }
.doc h3 { font-size: 16px; margin-top: 1.1em; }
.doc p { margin: 0 0 .8em; }
.doc .lead { font-size: 16.5px; color: var(--text); }
.doc .muted, .muted { color: var(--text-2); }
.doc ul { padding-left: 1.2em; margin: .2em 0 .8em; }
.kicker { font-family: var(--font-label); font-size: 10px; letter-spacing: .08em; color: var(--text-2); text-transform: uppercase; margin-bottom: 4px; }
.sample-note {
  display: flex; gap: 8px; align-items: center; margin: 0 0 16px; padding: 6px 10px;
  background: var(--cream); color: #302D43; border: 2px dashed var(--border);
  font-family: var(--font-mono); font-size: 12px;
}
.section-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 14px; }

/* ---------- Welcome.txt ---------- */
.welcome { display: grid; grid-template-columns: 112px 1fr; gap: 18px; align-items: start; }
.avatar { width: 112px; height: 112px; border: 2px solid var(--border); background: var(--pink); box-shadow: var(--bevel); display: grid; place-items: center; }
.avatar img { width: 96px; height: 96px; }
.welcome .name { font-family: var(--font-serif); font-size: 26px; margin: 0; }
.welcome .role { margin: 2px 0 0; color: var(--text-2); }
.tagline { font-family: var(--font-serif); font-style: italic; font-size: 17px; margin: 14px 0 10px; padding-left: 12px; border-left: 4px solid var(--title-active); }
.link-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.featured { margin-top: 18px; padding: 10px 12px; border: 2px solid var(--border); background: var(--win-bg-2); }
.featured h3 { margin: 0 0 6px; font-size: 15px; }
.featured a { font-family: var(--font-serif); }

/* ---------- Research ---------- */
.pillars { display: grid; gap: 14px; }
.pillar { border: 2px solid var(--border); background: var(--win-bg-2); box-shadow: var(--bevel); }
.pillar header { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 2px solid var(--border); font-family: var(--font-pixel); font-size: 15px; font-weight: 600; }
.pillar .pbody { padding: 10px 14px 12px; }
.pillar.math header { background: var(--title-active); }
.pillar.ai header { background: var(--blue); color: #302D43; }
.pillar.ai4m header { background: var(--mint); color: #302D43; }
.pillar.math header { color: #302D43; }

/* ---------- Publications ---------- */
.filebar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px 10px; border-bottom: 2px solid var(--border); background: var(--face); position: sticky; top: 0; z-index: 2; }
.filebar .field { min-width: 0; }
.filebar input[type="search"] { flex: 1 1 180px; }
.pub-list { list-style: none; margin: 0; padding: 0; }
.pub { padding: 12px 16px; border-bottom: 1px dashed var(--shadow); }
.pub:target, .pub.flash { background: rgba(248, 228, 161, .45); }
.pub-title { font-family: var(--font-serif); font-weight: 600; font-size: 16px; margin: 0 0 2px; }
.pub-authors { font-size: 14px; color: var(--text-2); margin: 0; }
.pub-authors .me { color: var(--text); font-weight: 600; text-decoration: underline; text-decoration-thickness: 2px; text-decoration-color: var(--pink); }
.pub-venue { font-size: 14px; margin: 2px 0 6px; font-style: italic; }
.pub-actions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.pub-detail { margin-top: 10px; padding: 10px 12px; background: var(--win-bg-2); border: 2px solid var(--border); font-size: 14px; }
.bibtex { margin: 8px 0 0; padding: 8px 10px; background: #1F1C33; color: #D9F5DE; font-family: var(--font-mono); font-size: 12px; white-space: pre-wrap; overflow-x: auto; }
.status-chip.published { background: var(--mint); }
.status-chip.accepted { background: var(--blue); }
.status-chip.preprint { background: var(--cream); }
.empty { padding: 28px; text-align: center; color: var(--text-2); font-family: var(--font-mono); font-size: 13px; }

/* ---------- Projects ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.card { border: 2px solid var(--border); background: var(--win-bg-2); box-shadow: var(--bevel); padding: 12px 14px; }
.card h3 { margin: 0 0 4px; font-family: var(--font-serif); font-size: 16px; }
.card dl { margin: 8px 0 0; font-size: 13.5px; }
.card dt { font-family: var(--font-label); font-size: 9px; color: var(--text-2); margin-top: 6px; letter-spacing: .05em; text-transform: uppercase; }
.card dd { margin: 0; }

/* ---------- Journey timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0 0 0 26px; position: relative; }
.timeline::before { content: ""; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 4px; background: repeating-linear-gradient(to bottom, var(--border) 0 6px, transparent 6px 10px); }
.tl { position: relative; padding: 0 0 18px; }
.tl::before { content: ""; position: absolute; left: -24px; top: 4px; width: 14px; height: 14px; border: 2px solid var(--border); background: var(--pink); }
.tl.math::before { background: #D4BDEB; }
.tl.ai::before { background: var(--blue); }
.tl.now::before { background: var(--mint); }
.tl .when { font-family: var(--font-mono); font-size: 12px; color: var(--text-2); }
.tl h3 { margin: 0; font-family: var(--font-serif); font-size: 16px; }
.tl p { margin: 2px 0 0; font-size: 14px; }
.transition-note { margin: 4px 0 18px; padding: 8px 12px; background: var(--win-bg-2); border-left: 4px solid var(--blue); font-size: 14px; }

/* ---------- CV ---------- */
.cv-toolbar { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 10px; border-bottom: 2px solid var(--border); background: var(--face); position: sticky; top: 0; z-index: 2; }
.cv-sheet { background: #fff; color: #302D43; margin: 16px; padding: 28px 32px; border: 2px solid var(--border); box-shadow: var(--drop); font-family: var(--font-serif); font-size: 14px; line-height: 1.5; }
.cv-sheet h1 { font-size: 24px; margin: 0; }
.cv-sheet h2 { font-size: 13px; font-family: var(--font-sans); letter-spacing: .14em; text-transform: uppercase; border-bottom: 1px solid #302D43; padding-bottom: 2px; margin: 18px 0 6px; }
.cv-row { display: grid; grid-template-columns: 110px 1fr; gap: 10px; margin-bottom: 4px; }
.cv-row .y { font-family: var(--font-sans); font-size: 12.5px; color: #68647B; }

/* ---------- Generic lists ---------- */
.item-list { list-style: none; margin: 0; padding: 0; }
.item-list li { padding: 10px 0; border-bottom: 1px dashed var(--shadow); }
.item-list .date { font-family: var(--font-mono); font-size: 12px; color: var(--text-2); }
.item-list h3 { margin: 2px 0; font-size: 15px; font-family: var(--font-serif); }

/* ---------- Contact (retro mail client) ---------- */
.mail { display: grid; grid-template-columns: 170px 1fr; min-height: 100%; }
.mail-folders { border-right: 2px solid var(--border); background: var(--face); padding: 8px 0; font-family: var(--font-pixel); font-size: 13px; }
.mail-folders div { padding: 4px 12px; }
.mail-folders .on { background: var(--title-active); }
.mail-main { padding: 14px 18px; }
.mail-head { display: grid; grid-template-columns: 70px 1fr; gap: 4px 8px; padding-bottom: 10px; margin-bottom: 12px; border-bottom: 2px solid var(--border); font-size: 14px; }
.mail-head b { font-family: var(--font-label); font-size: 10px; color: var(--text-2); padding-top: 3px; }
.links-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.links-table td { padding: 6px 4px; border-bottom: 1px dashed var(--shadow); }
.links-table td:first-child { width: 160px; font-family: var(--font-pixel); }

/* ---------- Agent Monitor ---------- */
.mon-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 10px; border-bottom: 2px solid var(--border); background: var(--face); font-size: 13px; }
.mon-head .grow { flex: 1; }
.mon-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; padding: 10px; }
.stat { border: 2px solid var(--border); background: var(--win-bg-2); box-shadow: var(--bevel-in); padding: 6px 8px; text-align: center; }
.stat b { display: block; font-family: var(--font-pixel); font-size: 22px; line-height: 1.1; }
.stat span { font-family: var(--font-label); font-size: 9px; color: var(--text-2); }
.mon-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.mon-table th { position: sticky; top: 0; background: var(--face); text-align: left; padding: 5px 8px; font-family: var(--font-label); font-size: 9.5px; font-weight: 400; border-bottom: 2px solid var(--border); }
.mon-table td { padding: 6px 8px; border-bottom: 1px dashed var(--shadow); vertical-align: middle; }
.mon-table img.av { width: 36px; height: 36px; background: var(--pink); border: 2px solid var(--border); display: block; }
.mon-table .agent-name { font-weight: 600; }
.mon-table .agent-role { font-size: 12px; color: var(--text-2); }
.status-pill { display: inline-flex; align-items: center; gap: 5px; padding: 1px 7px; border: 2px solid var(--border); font-family: var(--font-label); font-size: 10px; color: #302D43; white-space: nowrap; }
.status-pill i { width: 8px; height: 8px; background: currentColor; display: inline-block; }
.st-active { background: var(--mint); }
.st-idle { background: var(--cream); }
.st-done { background: #CFE8FF; }
.st-error { background: #FFC4C4; }
.st-offline { background: #DCDCE8; }
.st-unknown { background: #EDE6F7; }
.fresh { font-family: var(--font-mono); font-size: 11.5px; }
.fresh.stale { color: var(--warn); font-weight: 600; }
.fresh.unknown { color: var(--bad); font-weight: 600; }
.demo-panel { margin: 10px; padding: 10px 12px; border: 2px dashed var(--border); background: var(--cream); color: #302D43; font-size: 13px; }
.demo-panel b { font-family: var(--font-label); font-size: 10px; letter-spacing: .05em; }
.demo-panel .row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.demo-panel .btn { color: #302D43; background: #FFF9EE; }
.conn-banner { margin: 10px 10px 0; padding: 6px 10px; border: 2px solid var(--border); background: #FFD6DF; color: #302D43; font-size: 13px; }

/* ---------- Meet the Agents ---------- */
.agent-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.agent-card { border: 2px solid var(--border); background: var(--win-bg-2); box-shadow: var(--bevel); }
.agent-card .stage { height: 140px; display: grid; place-items: end center; padding-bottom: 6px; border-bottom: 2px solid var(--border);
  background: linear-gradient(var(--grid-line) 1px, transparent 1px) 0 0 / 16px 16px, linear-gradient(90deg, var(--grid-line) 1px, transparent 1px) 0 0 / 16px 16px, var(--c, var(--pink)); }
.agent-card .stage img { width: 96px; height: 116px; }
.agent-card .info { padding: 10px 12px 12px; font-size: 14px; }
.agent-card h3 { margin: 0; font-family: var(--font-pixel); font-size: 18px; }
.agent-profile { display: grid; grid-template-columns: 180px 1fr; gap: 18px; }
.agent-profile .stage { height: auto; min-height: 220px; border: 2px solid var(--border); }
.agent-profile .stage img { width: 144px; height: 174px; }
.quote { font-family: var(--font-pixel); font-size: 14px; padding: 6px 10px; border: 2px solid var(--border); background: #fff; color: #302D43; display: inline-block; margin: 3px 4px 3px 0; }

/* ---------- Settings ---------- */
.settings { display: grid; grid-template-columns: 150px 1fr; min-height: 100%; }
.settings nav { border-right: 2px solid var(--border); background: var(--face); padding: 6px 0; }
.settings nav button { display: flex; gap: 8px; align-items: center; width: 100%; padding: 6px 10px; border: 0; background: none; text-align: left; font-family: var(--font-pixel); font-size: 13px; cursor: pointer; }
.settings nav button img { width: 18px; height: 18px; }
.settings nav button[aria-selected="true"] { background: var(--title-active); }
.settings .pane { padding: 14px 18px; }
.settings fieldset { border: 2px solid var(--border); padding: 10px 14px 12px; margin: 0 0 14px; box-shadow: var(--bevel-in); }
.settings legend { font-family: var(--font-pixel); font-size: 14px; padding: 0 6px; }
.opt { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 14px; }
.opt input[type="checkbox"], .opt input[type="radio"] { width: 18px; height: 18px; accent-color: #7E68B8; }
.opt .hint { font-size: 12px; color: var(--text-2); }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.theme-swatch { display: flex; flex-direction: column; gap: 4px; padding: 6px; border: 2px solid var(--border); background: var(--win-bg); cursor: pointer; font-family: var(--font-pixel); font-size: 12px; text-align: left; }
.theme-swatch[aria-pressed="true"] { outline: 3px solid var(--border); outline-offset: 1px; }
.theme-swatch .sw { height: 36px; border: 2px solid var(--border); }

/* Help / credits */
.kbd-table { border-collapse: collapse; font-size: 14px; }
.kbd-table td { padding: 4px 12px 4px 0; vertical-align: top; }
kbd { font-family: var(--font-mono); font-size: 12px; padding: 1px 5px; border: 2px solid var(--border); background: var(--face); }

@media (max-width: 767px) {
  .doc { padding: 14px 14px 24px; }
  .welcome { grid-template-columns: 72px 1fr; gap: 12px; }
  .avatar { width: 72px; height: 72px; }
  .avatar img { width: 60px; height: 60px; }
  .welcome .name { font-size: 21px; }
  .mon-stats { grid-template-columns: repeat(3, 1fr); }
  .mon-table .hide-sm { display: none; }
  .mail { grid-template-columns: 1fr; }
  .mail-folders { display: none; }
  .settings { grid-template-columns: 1fr; }
  .settings nav { display: flex; overflow-x: auto; border-right: 0; border-bottom: 2px solid var(--border); }
  .settings nav button { width: auto; white-space: nowrap; }
  .agent-profile { grid-template-columns: 1fr; }
  .cv-sheet { margin: 8px; padding: 16px; }
  .cv-row { grid-template-columns: 1fr; gap: 0; }
}
