:root {
  color-scheme: light dark;
  --bg: #f6f6f4; --fg: #1b1b1a; --muted: #6b6b66; --card: #fff; --line: #e2e1dc;
  --accent: #2f5d8a; --accent-fg: #fff; --ok: #1d7a3a; --warn: #9a6200; --bad: #b3261e;
  --add: #e6f4ea; --del: #fbe9e7; --chip: #eeede8;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #141413; --fg: #ecebe6; --muted: #9b9a93; --card: #1d1d1b; --line: #33322e;
    --accent: #7fb0e0; --accent-fg: #0d1a26; --ok: #5cc27d; --warn: #e0a84a; --bad: #ff8a80;
    --add: #1d3324; --del: #3a1f1c; --chip: #2a2926; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.5 system-ui, -apple-system, sans-serif;
  -webkit-text-size-adjust: 100%; }
a { color: var(--accent); }
header.top { position: sticky; top: 0; z-index: 5; background: var(--card); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px; padding: 10px 16px; }
header.top .brand { font-weight: 700; text-decoration: none; color: var(--fg); }

main { max-width: 820px; margin: 0 auto; padding: 16px; }
h1 { font-size: 1.4rem; margin: 4px 0 8px; line-height: 1.25; }
h2 { font-size: 1.1rem; margin: 0 0 8px; }
h3 { font-size: 1rem; margin: 12px 0 6px; }
.muted { color: var(--muted); font-size: .9rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin: 12px 0; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.grow { flex: 1 1 200px; }
label { display: block; font-size: .85rem; color: var(--muted); margin: 8px 0 2px; }
input[type=text], input[type=url], input[type=password], input[type=number], input[type=email], select, textarea {
  width: 100%; font: inherit; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--fg); }
textarea { min-height: 120px; resize: vertical; }
textarea.editor { min-height: 50vh; font-family: ui-monospace, Menlo, monospace; font-size: .9rem; }
button, .btn { font: inherit; font-size: .95rem; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--card); color: var(--fg); cursor: pointer; text-decoration: none; display: inline-block; }
button.primary, .btn.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
button.danger { color: var(--bad); }
button.link { border: 0; background: none; color: var(--accent); padding: 0; }
.chip { display: inline-block; font-size: .78rem; padding: 2px 8px; border-radius: 99px; background: var(--chip); }
.s-new { background: #dbe8f5; color: #1c3d5e; } .s-passed { background: #eee; color: #555; }
.s-pursuing, .s-brief_ready { background: #fff1d6; color: #6b4a00; } .s-letter_ready { background: #e3f1e6; color: #1d5c2e; }
.s-applied, .s-interviewing, .s-offer { background: #e6e1f7; color: #3d2d80; }
@media (prefers-color-scheme: dark) { .chip[class*=s-] { filter: invert(.88) hue-rotate(180deg); } }
.ok { color: var(--ok); } .warn { color: var(--warn); } .bad { color: var(--bad); }
.flash { background: var(--add); border-radius: 8px; padding: 8px 12px; }
.error { background: var(--del); border-radius: 8px; padding: 8px 12px; }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain > li { padding: 10px 0; border-top: 1px solid var(--line); }
ul.plain > li:first-child { border-top: 0; }
.opp-link { text-decoration: none; color: var(--fg); display: block; }
.opp-link strong { display: block; }
.timeline li { font-size: .9rem; }
.md { overflow-wrap: anywhere; } .md p { margin: .4em 0; } .md h1 { font-size: 1.15rem; } .md h2 { font-size: 1rem; margin-top: 1em; }
pre.jd { white-space: pre-wrap; font: .9rem/1.45 system-ui, sans-serif; max-height: 60vh; overflow: auto; margin: 0; }
.diff { font-family: ui-monospace, Menlo, monospace; font-size: .8rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.diff .add { background: var(--add); display: block; } .diff .del { background: var(--del); display: block; }
.diff .hunk { color: var(--muted); display: block; } .diff .ctx { display: block; }
.pdf-frame { width: 100%; height: 70vh; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
img.page { width: 100%; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
details > summary { cursor: pointer; font-weight: 600; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.tabs a { padding: 4px 10px; border-radius: 99px; background: var(--chip); text-decoration: none; color: var(--fg); font-size: .85rem; }
.tabs a.on { background: var(--accent); color: var(--accent-fg); }
.task { display: flex; gap: 8px; align-items: center; font-size: .92rem; }
.spinner { width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%;
  animation: spin 1s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
table.simple { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.simple td, table.simple th { border-top: 1px solid var(--line); padding: 6px 4px; text-align: left; vertical-align: top; }
@media (min-width: 700px) { .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } }

/* navigation: menu button on phones, left sidebar on wide screens */
header.top details.menu { margin-left: auto; position: relative; }
header.top details.menu > summary { list-style: none; padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; }
header.top details.menu > summary::-webkit-details-marker { display: none; }
.menu-panel { position: absolute; right: 0; top: 40px; background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 8px 14px; min-width: 220px; box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.menu-panel a, aside.side nav a { display: block; padding: 7px 0; text-decoration: none; color: var(--fg); }
.menu-panel a.on, aside.side nav a.on { color: var(--accent); font-weight: 600; }
.nav-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-top: 10px; }
.menu-panel form, aside.side form { margin: 10px 0 4px; }
aside.side { display: none; }
@media (min-width: 900px) {
  header.top { display: none; }
  aside.side { display: block; position: fixed; top: 0; bottom: 0; left: 0; width: 220px; overflow-y: auto;
    background: var(--card); border-right: 1px solid var(--line); padding: 16px 18px; }
  aside.side .brand { font-weight: 700; font-size: 1.1rem; text-decoration: none; color: var(--fg); }
  body:has(aside.side) main { margin-left: 220px; max-width: none; padding: 20px 32px; }
  body:has(aside.side) main > * { max-width: 820px; }
}
.decide { margin: 10px 0; }
.decide .row button { min-width: 84px; font-size: 1.05rem; padding: 10px 18px; }
.decide details { margin-top: 6px; }
details.fb > summary.fb-sum { list-style: none; font-weight: 400; }
details.fb > summary.fb-sum::-webkit-details-marker { display: none; }
details.fb > summary.fb-sum > * { margin-right: 4px; }
details.fb > summary.fb-sum .muted { display: block; margin-top: 2px; }
details.fb > summary.fb-sum::after { content: "Show conversation ▾"; display: block; font-size: .8rem; color: var(--accent); margin-top: 4px; }
details.fb[open] > summary.fb-sum::after { content: "Hide ▴"; }
