:root {
  --bg: #efeae1;
  --panel: #fbf7f0;
  --ink: #171513;
  --muted: #6d675e;
  --line: #ddd4c6;
  --top: #171513;
  --top-text: #f4efe6;
  --top-muted: #b9b0a3;
  --accent: #0f6b57;
  --accent-soft: #e3f1ec;
  --copper: #b4532a;
  --copper-soft: #f6e6db;
  --blue: #2c4c7c;
  --blue-soft: #e7eef6;
  --danger: #8c2f2f;
  --danger-soft: #f8e4e4;
  --serif: "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
  --sans: "Avenir Next", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
}

h1, h2, h3, .brand {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.03em;
}

h1 { font-size: 36px; line-height: 1.1; margin: 0; }
h2 { font-size: 22px; margin: 0; }
h3 { font-size: 16px; margin: 0 0 10px; }
h4 { font-size: 16px; margin: 0; }

a { color: var(--accent); }
p { margin: 0 0 12px; }

.app { min-height: 100vh; }

.top {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 18px;
  padding: 12px 20px;
  background: var(--top);
  color: var(--top-text);
  position: sticky;
  top: 0;
  z-index: 5;
}

.brand {
  color: var(--top-text);
  text-decoration: none;
  font-size: 24px;
  flex: 0 0 auto;
}

.channel-nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
}

.channel-nav a {
  color: var(--top-text);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 14px;
  flex: 0 0 auto;
}

.channel-nav a[aria-current="page"] {
  background: #2e2a26;
  color: #f6e7c4;
}

.channel-nav a.add { color: var(--top-muted); }

.top-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--top-muted);
  font-size: 14px;
  margin-left: auto;
  flex: 0 0 auto;
}

.top-foot span {
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top button,
.top button[type="submit"] {
  background: none;
  border: 0;
  box-shadow: none;
  padding: 0;
  margin: 0;
  color: var(--top-muted);
  cursor: pointer;
  font: inherit;
  border-radius: 0;
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: 4px;
  border-radius: 50%;
  background: #e0b15a;
  vertical-align: middle;
}

main { padding: 28px 24px 80px; }
.page { max-width: 1180px; margin: 0 auto; }
.page.narrow { max-width: 720px; }

.kicker {
  margin: 0 0 6px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.lede { font-size: 18px; max-width: 62ch; }
.quiet { color: var(--muted); }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.meta { color: var(--muted); font-size: 14px; }
.label {
  margin: 16px 0 8px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 16px;
}
.title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.jump {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 0 0 22px;
  position: sticky;
  top: var(--top-height, 52px);
  z-index: 4;
  background: var(--bg);
  padding: 8px 0;
}

.panel[id] {
  scroll-margin-top: 112px;
}

.jump a {
  text-decoration: none;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 4px 0;
  font-size: 14px;
}

.jump a:hover { color: var(--ink); }

button,
.button {
  font: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #f6f1e7;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 9px 14px;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.2;
  text-align: center;
  appearance: none;
  box-shadow: none;
  vertical-align: middle;
}

button.secondary,
.button.secondary {
  background: #fff;
  color: var(--ink);
  border-color: #cfc6b8;
  box-shadow: none;
}

button.danger {
  background: var(--danger);
  color: #f6f1e7;
}

.stack > button[type="submit"],
.login form > button[type="submit"],
.actions,
.copy-row button {
  margin-top: 16px;
}

button:disabled { opacity: 0.55; cursor: not-allowed; }

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

label {
  display: block;
  margin-top: 14px;
  font-size: 14px;
}

input[type="text"],
input[type="password"],
input[type="datetime-local"],
input:not([type]),
textarea,
select,
.copy-field {
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  color: var(--ink);
  font: inherit;
}

textarea { min-height: 180px; resize: vertical; }
textarea.short { min-height: 88px; }
.copy-field { max-width: 280px; }
.copy-field.command { max-width: 28rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.stack { max-width: 100%; }
.editor textarea { min-height: 200px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.actions button { margin-top: 0; }
.draft-actions { margin-top: 16px; }

.copy-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  max-width: 36rem;
}
.copy-row .copy-field { max-width: none; margin-top: 6px; flex: 1 1 auto; }
.copy-row button { margin-top: 6px; flex: 0 0 auto; }

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  margin-top: 12px;
}

.inline-form label { margin: 0; }
.inline-form select { width: auto; min-width: 140px; margin: 0; }
.inline-form button { margin: 0; }

.notices { list-style: none; padding: 0; margin: 0 0 16px; }
.notice, .banner, .warn, .errors, .errorlist {
  padding: 10px 12px;
  border-radius: 10px;
  margin: 0 0 12px;
}
.notice, .banner { background: var(--accent-soft); }
.warn, .errors, .errorlist { background: var(--danger-soft); color: var(--danger); }
.errors, .errorlist { padding-left: 28px; }

.cards { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.card, .panel {
  display: block;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  color: inherit;
  text-decoration: none;
}
a.card:hover { border-color: #c8bba6; }
.card h2 { margin-bottom: 6px; }
.panel { margin-bottom: 18px; }
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.panel-head form { margin: 0; }
.panel-head button { margin-top: 0; }

.board {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.9fr);
  gap: 18px;
  align-items: start;
}

.board.writing {
  grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.2fr);
}

#draft { scroll-margin-top: calc(var(--top-height, 52px) + 48px); }
#draft[aria-busy="true"] { opacity: 0.55; }
.write-preview,
.write-editor { min-width: 0; }
.write-preview .tg { margin: 0; }
.write-editor h2 { margin-bottom: 12px; }

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  background: #eeeae3;
  color: var(--muted);
}
.pace-ahead, .pace-met, .status-done, .status-scheduled { background: var(--accent-soft); color: var(--accent); }
.pace-behind, .status-pending, .status-draft { background: var(--copper-soft); color: #8a4b12; }
.pace-missed, .status-failed { background: var(--danger-soft); color: var(--danger); }
.pace-no_data, .status-skipped, .status-publishing { background: #eeeae3; color: var(--muted); }
.status-published { background: var(--blue-soft); color: var(--blue); }

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 16px;
}
.stats div {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
}
.stats dt { color: var(--muted); font-size: 13px; }
.stats dd { margin: 4px 0 0; font-family: var(--serif); font-size: 26px; }
.stats.minor dd { font-family: var(--sans); font-size: 18px; }
.stats .meta { margin: 0; }

.summary {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px 16px;
  margin: 0 0 16px;
}
.summary p:last-child { margin-bottom: 0; }

.chart-card { margin-top: 4px; }
.chart-card svg { width: 100%; height: auto; display: block; }
.grid { stroke: var(--line); stroke-width: 1; }
.tick { fill: var(--muted); font-size: 11px; }
.series { fill: none; }
.series.actual { stroke: var(--accent); stroke-width: 2.5; }
.series.prognosis { stroke: var(--blue); stroke-width: 2; stroke-dasharray: 7 5; }
.goal-line { stroke: var(--copper); stroke-dasharray: 2 4; }
.actual-mark { fill: var(--accent); }
.goal-mark { fill: var(--copper); }
.axis-dates {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
  margin: 8px 0 0;
}
.legend { display: flex; gap: 16px; list-style: none; padding: 0; font-size: 14px; }
.swatch { display: inline-block; width: 18px; height: 4px; margin-right: 6px; vertical-align: middle; border-radius: 2px; }
.swatch.measured { background: var(--accent); }
.swatch.prognosis { background: var(--blue); }
.swatch.goal { background: var(--copper); }

.steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: start;
}
.step {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 10px;
}
.step-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.instructions p:last-child { margin-bottom: 0; }
.results { list-style: none; padding: 0; margin: 0; }
.results li { margin-bottom: 10px; }
.results time { display: block; color: var(--muted); font-size: 13px; }

.skill {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  margin: 8px 0 12px;
}
.skill summary {
  cursor: pointer;
}
.skill summary .badge { margin-left: 8px; }
.skill[open] summary { margin-bottom: 4px; }
.fold { margin: 22px 0; }
.fold summary { cursor: pointer; font-weight: 600; }
.skill-pick {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0;
}
.skill-pick input { width: auto; margin: 4px 0 0; }
.skill { margin-bottom: 12px; }
.skill .skill-pick { margin-top: 10px; }

.steps-list { padding-left: 20px; max-width: 68ch; }
.steps-list li { margin-bottom: 8px; }

.claim-list { margin-top: 28px; }
.claim {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.claim button { margin-top: 0; }
.claim strong { display: block; }

.desk {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 22px 22px 8px;
}
.desk > .panel,
.desk .chart-panel { background: #fff; }
.desk-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
}
.desk-tools { display: flex; flex-direction: column; gap: 10px; }
.desk-tools .panel { margin-bottom: 0; }
button.factoid {
  width: 100%;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 12px 14px;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 18px;
  font: inherit;
  text-align: left;
}
button.factoid:hover { border-color: #c8bba6; }
.factoid-label { color: var(--muted); font-size: 13px; }
.factoid-value {
  font-family: var(--serif);
  font-size: 28px;
  line-height: 1;
  letter-spacing: -0.03em;
}
.chart-panel { margin-bottom: 0; }
.chart-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}
.skills-launch {
  width: 100%;
  margin: 0;
  padding: 12px 14px;
  border-radius: 18px;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  font-size: 16px;
}
.skills-launch:hover { border-color: #c8bba6; }
.launch-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
}
.launch-row form { display: flex; margin: 0; min-width: 0; }
.launch-row .skills-launch {
  width: auto;
  flex: 1 1 auto;
  height: 100%;
  white-space: normal;
}

.calendar-widget { padding: 14px; background: #fff; }
.cal-head {
  display: grid;
  grid-template-columns: 32px 1fr 32px;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
}
.cal-head h2 { font-size: 16px; text-align: center; }
.cal-nav {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  text-decoration: none;
  color: var(--ink);
  border-radius: 999px;
}
.cal-nav:hover { background: var(--bg); }
.cal-today { margin: 0 0 8px; text-align: center; font-size: 13px; }
.mini-cal {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.mini-cal .dow {
  padding: 2px 0;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}
.mini-day {
  position: relative;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  text-decoration: none;
  color: var(--ink);
  border-radius: 8px;
  font-size: 13px;
}
.mini-day:hover { background: var(--bg); }
.mini-day.outside { color: #c4bbb0; }
.mini-day.today { background: var(--accent); color: #f6f1e7; }
.mini-day.is-selected { box-shadow: inset 0 0 0 1.5px var(--copper); }
.mini-dot {
  position: absolute;
  bottom: 3px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--copper);
}
.mini-day.today .mini-dot { background: #f6f1e7; }

body.day-open { margin-right: min(380px, 100vw); }
.day-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 26;
  width: min(380px, 100vw);
  height: 100vh;
  overflow: auto;
  padding: 16px 16px 32px;
  background: var(--panel);
  border-left: 1px solid var(--line);
  box-shadow: -12px 0 40px rgba(23, 21, 19, 0.08);
}
.day-drawer[hidden] { display: none; }
.day-drawer-bar { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.day-drawer-bar button { margin: 0; }
.day-list h3 { margin: 0 0 12px; }
.day-list[hidden] { display: none; }
.day-add { margin-top: 12px; }

.task-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 8px;
}
.task-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
}
.task-card h4 { font-size: 15px; }
.task-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.task-head .badge { flex: 0 0 auto; }
.task-instructions { margin-top: 6px; color: var(--muted); font-size: 13px; }
.task-instructions p { margin: 0; }
.task-card .meta { margin: 4px 0 0; }
.skip-note-text {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--ink);
}
.status-picks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  align-items: stretch;
  margin-top: auto;
  padding-top: 12px;
}
.status-picks form { display: flex; margin: 0; min-width: 0; }
.status-picks button {
  flex: 1 1 auto;
  width: 100%;
  min-height: 32px;
  margin: 0;
  padding: 6px 4px;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: none;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
}
.status-picks button[aria-pressed="true"][value="pending"] { background: var(--copper-soft); color: #8a4b12; border-color: transparent; }
.status-picks button[aria-pressed="true"][value="done"] { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.status-picks button[aria-pressed="true"][value="skipped"] { background: #eeeae3; color: var(--muted); border-color: transparent; }
.task-card label { margin-top: 8px; font-size: 12px; color: var(--muted); }
textarea.skip-note { min-height: 52px; margin-top: 4px; font-size: 14px; }
.task-results { margin-top: 8px; font-size: 13px; }
.task-results summary { cursor: pointer; color: var(--muted); }
.task-result { margin-top: 8px; }
.task-result button { width: 100%; margin-top: 8px; }

dialog {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  color: var(--ink);
  padding: 0;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
}
dialog::backdrop { background: rgba(23, 21, 19, 0.46); }
dialog[open] { position: fixed; margin: auto; }
.dialog-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 12px 12px 0;
}
.dialog-bar button,
.day-drawer-bar button {
  min-height: 36px;
  margin: 0;
  padding: 6px 14px;
}
.skills-dialog { width: min(640px, calc(100vw - 32px)); }
.report-dialog { width: min(720px, calc(100vw - 32px)); }
.report-dialog .panel { border: 0; margin: 0; background: transparent; box-shadow: none; }
.report-copy p:first-child { margin-top: 0; }
.report-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.report-row p { margin: 0; }
.report-row .button { flex: 0 0 auto; margin: 0; }
.report-link { word-break: break-all; }
.skills-dialog .panel { border: 0; margin: 0; background: transparent; box-shadow: none; }
.idea-cards {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: grid;
  gap: 10px;
}
.idea-card {
  margin: 0;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.idea-card p { margin: 0; }
.idea-skill {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
}
.post-dialog { width: min(1080px, calc(100vw - 32px)); }
.post-dialog .board.writing { margin: 0; padding: 8px 16px 16px; }

.link-shell {
  min-height: 100vh;
  padding: 28px 16px 48px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}
.link-desk {
  width: min(1080px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(23, 21, 19, 0.18);
}
.link-desk .board.writing { margin: 0; padding: 4px 16px 16px; }
.link-note { margin: 0; padding: 14px 16px 0; }
.link-copy { padding: 22px 22px 8px; }
.link-desk .notices { margin: 16px 16px 0; }

.month-nav { display: flex; gap: 12px; margin-top: 6px; font-size: 14px; }
.calendar-scroll { overflow-x: auto; }
.calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(88px, 1fr));
  gap: 6px;
  min-width: 680px;
}
.dow, .day { background: transparent; }
.dow {
  padding: 4px 6px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.day {
  min-height: 88px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.day.outside { background: transparent; border-color: transparent; color: var(--muted); }
.day.today { box-shadow: none; }
.day.today .day-num {
  background: var(--accent);
  color: #f6f1e7;
  border-radius: 999px;
}
.day-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.day-num {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  font-size: 13px;
}
.add-day { font-size: 12px; text-decoration: none; }
.pill {
  display: block;
  margin-top: 6px;
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.3;
  text-decoration: none;
}
.pill time { display: block; font-weight: 600; }
.pill-status {
  display: block;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.pill-text {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.calendar-legend { margin-top: 12px; }
.calendar-legend .swatch {
  width: 8px;
  height: 8px;
  border-radius: 99px;
}
.swatch.draft { background: var(--copper); }
.swatch.scheduled { background: var(--accent); }
.swatch.published { background: var(--blue); }
.swatch.failed { background: var(--danger); }
.pill.status-draft { background: var(--copper-soft); color: #6a3b12; }
.pill.status-scheduled { background: var(--accent-soft); color: var(--accent); }
.pill.status-published { background: var(--blue-soft); color: var(--blue); }
.pill.status-failed { background: var(--danger-soft); color: var(--danger); }
.pill.status-publishing { background: #eeeae3; color: var(--muted); }
.pill.is-open { box-shadow: inset 0 0 0 1px var(--accent); }

.main-martor {
  margin-top: 6px;
  font-family: var(--sans);
  color: var(--ink);
}
.main-martor .section-martor {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.main-martor .martor-toolbar,
.main-martor .nav-tabs,
.main-martor .nav-tabs .nav-link {
  background: var(--panel);
  color: var(--ink);
  border-color: var(--line);
  font-family: var(--sans);
}
.martor-field {
  min-height: 220px;
}
.main-martor textarea.martor {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
}

.thread-switch { display: flex; flex-wrap: wrap; gap: 8px; }
.thread-switch a {
  text-decoration: none;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 13px;
}
.thread-switch a[aria-current="page"] { border-color: var(--accent); color: var(--accent); }
.thread { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; max-height: 420px; overflow: auto; }
.bubble {
  max-width: 68ch;
  padding: 12px 14px;
  border-radius: 14px;
}
.bubble.you { align-self: flex-end; background: var(--accent-soft); white-space: pre-wrap; }
.bubble.agent { align-self: flex-start; background: #fff; border: 1px solid var(--line); }
.bubble.agent > :first-child { margin-top: 0; }
.bubble.agent > :last-child { margin-bottom: 0; }
.bubble.agent p,
.bubble.agent ul,
.bubble.agent ol,
.bubble.agent pre,
.bubble.agent blockquote { margin: 0 0 10px; }
.bubble.agent ul,
.bubble.agent ol { padding-left: 1.2em; }
.bubble.agent h2,
.bubble.agent h3 { margin: 0 0 8px; font-size: 1.05em; }
.bubble.agent pre {
  padding: 8px 10px;
  overflow: auto;
  background: var(--panel);
  border-radius: 8px;
}
.bubble.agent code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em; }
.bubble.agent blockquote {
  padding-left: 10px;
  border-left: 2px solid var(--line);
  color: var(--muted);
}
.bubble.agent a { color: var(--accent); }
.tool { color: var(--muted); font-size: 13px; margin: 0; }
.composer { margin-top: 8px; }
.cover { margin: 16px 0; }
.cover img { max-width: 280px; border-radius: 12px; }
.saved-markdown { display: none; }

.when {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 8px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
}
.when.is-open { gap: 16px; padding: 16px; }
.when-body { display: none; }
.when.is-open .when-body {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
.when-face {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.when-face .kicker { margin: 0; }
.when-day { margin: 0; font-family: var(--serif); font-size: 16px; letter-spacing: -0.03em; white-space: nowrap; }
.when.is-open .when-day { font-size: 22px; }
.when-clock {
  margin: 0;
  font-variant-numeric: tabular-nums;
  font-size: 22px;
  line-height: 1;
  letter-spacing: -0.04em;
}
.when.is-open .when-clock { font-size: 40px; line-height: 0.9; }
.when-toggle {
  margin: 0;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
}
.when-zone { margin: 0 0 4px; color: var(--muted); font-size: 13px; }
.when-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.when-nav p { margin: 0; font-size: 14px; }
.when-nav button,
.when-spin button,
.when-quick button {
  margin: 0;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}
.when-nav button { width: 32px; height: 32px; padding: 0; }
.when-dows, .when-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
}
.when-dows { color: var(--muted); font-size: 11px; letter-spacing: 0.04em; margin-bottom: 4px; }
.when-grid button {
  width: 32px;
  height: 32px;
  margin: 0 auto;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.when-grid button.is-outside { color: #c4bbb0; }
.when-grid button[aria-pressed="true"] { background: var(--accent); color: #f6f1e7; }
.when-side { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; padding-top: 28px; }
.when-spins { display: flex; align-items: center; justify-content: center; gap: 8px; }
.when-spin { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.when-spin span {
  font-variant-numeric: tabular-nums;
  font-size: 32px;
  line-height: 1;
  letter-spacing: -0.04em;
}
.when-spin button { width: 36px; height: 28px; padding: 0; }
.when-colon { font-size: 28px; color: var(--muted); }
.when-quick { display: flex; flex-wrap: wrap; gap: 8px; }
.when-quick button { padding: 6px 10px; font-size: 13px; }

.tg {
  margin: 16px 0;
  padding: 12px 14px 14px;
  background: #fff;
  border: 1px solid #e7e7e7;
  border-radius: 16px;
  box-shadow: 0 8px 28px rgba(23, 21, 19, 0.06);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color: #000;
}
.tg-head { display: flex; align-items: center; gap: 10px; }
.tg-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  flex: 0 0 auto;
}
.tg-name { margin: 0; font-weight: 700; font-size: 15px; line-height: 1.2; }
.tg-meta { margin: 2px 0 0; color: #8e8e8e; font-size: 13px; display: flex; gap: 8px; }
.tg-media { margin: 12px 0 0; display: grid; gap: 4px; }
.tg-media[hidden] { display: none; }
.tg-media img {
  width: 100%;
  height: auto;
  min-height: 180px;
  max-height: 420px;
  object-fit: cover;
  border-radius: 12px;
  background: #8d8d8d;
  display: block;
}
.tg-copy {
  margin-top: 12px;
  color: #000;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: 0;
}
.tg-copy:empty { display: none; }
.tg-copy > :first-child { margin-top: 0; }
.tg-copy > :last-child { margin-bottom: 0; }
.tg-copy p { margin: 0 0 10px; }
.tg-copy p:last-child { margin-bottom: 0; }
.tg-copy h1,
.tg-copy h2,
.tg-copy h3,
.tg-copy h4,
.tg-copy h5,
.tg-copy h6 {
  font-family: inherit;
  font-weight: 700;
  letter-spacing: 0;
  color: #000;
  line-height: 1.25;
  margin: 12px 0 6px;
}
.tg-copy h1 { font-size: 24px; }
.tg-copy h2 { font-size: 21px; }
.tg-copy h3 { font-size: 18px; }
.tg-copy h4,
.tg-copy h5,
.tg-copy h6 { font-size: 16px; }
.tg-copy a,
.tg-copy .tg-entity { color: #2481cc; text-decoration: none; }
.tg-copy strong,
.tg-copy b { font-weight: 700; color: inherit; }
.tg-copy em,
.tg-copy i { font-style: italic; }
.tg-copy del,
.tg-copy s,
.tg-copy strike { text-decoration: line-through; }
.tg-copy u,
.tg-copy ins { text-decoration: underline; }
.tg-copy mark { background: #fff3a0; color: inherit; padding: 0 1px; }
.tg-copy code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: rgba(0, 0, 0, 0.06);
  padding: 1px 4px;
  border-radius: 4px;
  font-size: 0.92em;
}
.tg-copy pre {
  margin: 8px 0;
  padding: 8px 10px;
  overflow: auto;
  background: #f4f4f5;
  border-radius: 8px;
  white-space: pre-wrap;
}
.tg-copy pre code { background: none; padding: 0; }
.tg-copy blockquote {
  margin: 8px 0;
  padding: 2px 0 2px 10px;
  border-left: 3px solid #4ea4f6;
  color: inherit;
}
.tg-copy ul,
.tg-copy ol { margin: 6px 0; padding-left: 1.3em; }
.tg-copy li { margin: 2px 0; }
.tg-copy hr { border: 0; border-top: 1px solid #dfe3e6; margin: 10px 0; }
.tg-copy table { border-collapse: collapse; width: 100%; font-size: 15px; margin: 8px 0; }
.tg-copy th,
.tg-copy td { border: 1px solid #e3e6e8; padding: 6px 8px; text-align: start; vertical-align: top; }
.tg-copy th { background: #f4f4f5; font-weight: 700; }
.tg-copy .tg-spoiler { border-radius: 4px; cursor: pointer; }
.tg-copy .tg-spoiler:not(.is-open),
.tg-copy .tg-spoiler:not(.is-open) * {
  color: transparent;
  background: #8d969c;
}
.tg-copy .tg-photo { margin: 8px 0 10px; }
.tg-copy .tg-photo img,
.tg-copy .tg-photo video {
  width: 100%;
  height: auto;
  border-radius: 12px;
  display: block;
  background: #d6d6d6;
}
.tg-copy figcaption { margin-top: 4px; color: #707579; font-size: 14px; line-height: 1.35; }
.tg-copy .tg-file {
  display: block;
  margin: 8px 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f4f4f5;
  color: #000;
}
.tg-copy .tg-box {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 6px;
  border: 1.5px solid #8e8e8e;
  border-radius: 4px;
  vertical-align: -2px;
}
.tg-copy .tg-box.is-on { background: #2aa3d4; border-color: #2aa3d4; position: relative; }
.tg-copy .tg-box.is-on::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.tg-copy .tg-math { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.tg-copy .footnote { color: #707579; font-size: 14px; }

.login {
  max-width: 420px;
  margin: 10vh auto;
  padding: 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
}
.login .brand { color: var(--ink); border: 0; padding: 0; margin: 0 0 8px; font-size: 32px; }

@media (max-width: 960px) {
  .board, .board.writing, .steps, .stats, .desk-top { grid-template-columns: 1fr; }
  .stats.minor { grid-template-columns: 1fr 1fr; }
  .post-dialog .board.writing { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  main { padding: 18px 14px 56px; }
  h1 { font-size: 28px; }
  .stats.minor { grid-template-columns: 1fr; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .when-body { grid-template-columns: 1fr; }
  .when-side { padding-top: 0; }
  .actions { align-items: stretch; }
  .desk { padding: 14px 12px 4px; }
  body.day-open { margin-right: 0; }
}
