:root {
  --background: #ffffff;
  --surface: #f7f7f5;
  --text: #111111;
  --muted: #666660;
  --faint: #666660;
  --accent: #164cda;
  --line: #dcdcd6;
  --serif: Iowan Old Style, Baskerville, "Times New Roman", serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --max: 1040px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--background); color: var(--text); font: 16px/1.55 var(--mono); -webkit-font-smoothing: antialiased; }
button, textarea { font: inherit; }
a { color: inherit; text-underline-offset: .25em; }
a:hover { color: #000; }
:focus-visible { outline: 2px solid #111; outline-offset: 3px; }
.skip-link { position: fixed; top: 12px; left: 12px; z-index: 20; padding: 10px 14px; background: #111; color: #fff; transform: translateY(-160%); }
.skip-link:focus { transform: none; }

.site-header, .opening, .conversation, .instructions, .boundary, footer { width: min(100%, var(--max)); margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.site-header { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 28px; border-bottom: 1px solid var(--line); }
.name { font-weight: 700; text-decoration: none; }
nav { display: flex; flex-wrap: wrap; gap: 12px 22px; }
nav a { color: var(--muted); font-size: 14px; text-decoration: none; }

.opening { display: grid; grid-template-columns: 1.2fr .8fr; gap: 36px; padding-top: 44px; padding-bottom: 36px; }
.eyebrow { margin: 0 0 12px; color: var(--faint); font-size: 14px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { max-width: 720px; margin-bottom: 0; font: 300 clamp(2.8rem, 5.4vw, 4.8rem)/1.02 var(--serif); letter-spacing: -.05em; }
.opening-copy { align-self: end; }
.opening-copy p { margin: 0 0 16px; color: var(--muted); font: 300 clamp(1.2rem, 2.5vw, 1.65rem)/1.28 var(--serif); }
.opening-copy p:last-child { margin-bottom: 0; color: var(--text); }

.conversation { padding-top: 36px; padding-bottom: 80px; border-top: 1px solid var(--text); }
.conversation-head { display: flex; justify-content: space-between; align-items: end; gap: 30px; margin-bottom: 30px; }
h2 { margin-bottom: 0; font: 300 clamp(2.2rem, 5vw, 3.8rem)/1 var(--serif); letter-spacing: -.035em; }
.counts { display: flex; gap: 38px; margin: 0; }
.counts div { min-width: 78px; }
.counts dt { color: var(--faint); font-size: 14px; letter-spacing: .1em; text-transform: uppercase; }
.counts dd { margin: 3px 0 0; font: 300 1.55rem/1 var(--serif); }

.composer { margin-bottom: 38px; border: 1px solid var(--text); background: var(--background); }
.composer > label { display: block; padding: 12px 15px; border-bottom: 1px solid var(--line); font-size: 14px; font-weight: 700; }
.composer textarea { display: block; width: 100%; min-height: 132px; padding: 17px 15px; resize: vertical; border: 0; border-radius: 0; background: transparent; color: var(--text); line-height: 1.55; }
.composer textarea:focus { outline: 0; }
.composer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 11px 12px 11px 15px; border-top: 1px solid var(--line); }
.composer-bottom p { margin: 0; color: var(--faint); font-size: 14px; }
.composer button[type="submit"] { flex: 0 0 auto; padding: 10px 15px; border: 1px solid #111; background: #111; color: #fff; cursor: pointer; }
.composer button[type="submit"]:hover { background: #333; }
.composer button[disabled] { cursor: wait; opacity: .6; }
.reply-context { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 10px 15px; border-bottom: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 14px; }
.reply-context span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reply-context button { max-width: 360px; overflow: hidden; border: 0; background: none; color: var(--text); text-overflow: ellipsis; white-space: nowrap; cursor: pointer; text-decoration: underline; text-underline-offset: .2em; }
.form-status { min-height: 0; margin: 0; padding: 0 15px; color: var(--muted); font-size: 14px; }
.form-status:not(:empty) { padding-top: 10px; padding-bottom: 10px; border-top: 1px solid var(--line); }
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; opacity: 0; }

.feed-tools { display: flex; justify-content: space-between; gap: 20px; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.feed-tools p { margin: 0; color: var(--faint); font-size: 14px; }
.quiet-button { padding: 0; border: 0; background: none; color: var(--muted); font-size: 14px; cursor: pointer; text-decoration: underline; text-underline-offset: .2em; }
.feed { border-bottom: 1px solid var(--line); }
.post { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 26px; padding: 27px 0; border-bottom: 1px solid var(--line); }
.post:last-child { border-bottom: 0; }
.post-meta { color: var(--faint); font-size: 14px; line-height: 1.55; text-transform: uppercase; }
.post-kind { display: block; margin-bottom: 8px; color: var(--text); font-weight: 700; letter-spacing: .08em; }
.post-id { display: block; overflow: hidden; margin-top: 6px; text-overflow: ellipsis; text-transform: none; white-space: nowrap; }
.post-body { min-width: 0; }
.post-body p { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.post-body blockquote { margin: 0 0 13px; padding-left: 14px; border-left: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.post-actions { margin-top: 16px; }
.post-actions button { padding: 0; border: 0; background: none; color: var(--muted); font-size: 14px; cursor: pointer; text-decoration: underline; text-underline-offset: .2em; }
.empty-state { margin: 0; padding: 45px 0; color: var(--muted); font: 300 1.4rem/1.3 var(--serif); }
.load-more { width: 100%; margin-top: 18px; padding: 12px; border: 1px solid var(--line); background: var(--background); color: var(--muted); cursor: pointer; }

.instructions { display: grid; grid-template-columns: .75fr 1.25fr; gap: 72px; padding-top: 74px; padding-bottom: 82px; border-top: 1px solid var(--line); }
.instructions .section-label h2 { max-width: 430px; }
.instructions > div:last-child > p { max-width: 650px; color: var(--muted); }
.instructions strong { color: var(--text); }
pre { max-width: 100%; margin: 26px 0; padding: 20px; overflow: auto; border: 1px solid var(--line); background: var(--surface); font-size: 14px; }
code { font-family: var(--mono); color: var(--text); }
.boundary { padding-top: 28px; padding-bottom: 58px; border-top: 1px solid var(--text); }
.boundary p { max-width: 790px; margin: 0; color: var(--muted); font-size: 14px; }
footer { display: grid; grid-template-columns: 1fr 1fr auto; gap: 24px; padding-top: 28px; padding-bottom: 38px; border-top: 1px solid var(--line); color: var(--faint); font-size: 14px; }
footer p { margin: 0; }

@media (max-width: 760px) {
  .site-header { align-items: flex-start; padding-top: 20px; padding-bottom: 20px; }
  .site-header nav { max-width: 170px; justify-content: flex-end; }
  .opening, .instructions { grid-template-columns: 1fr; gap: 34px; }
  .opening { padding-top: 48px; padding-bottom: 54px; }
  .conversation-head { align-items: flex-start; }
  .post { grid-template-columns: 95px minmax(0, 1fr); gap: 18px; }
  footer { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .site-header { display: block; }
  .site-header nav { max-width: none; margin-top: 14px; justify-content: flex-start; }
  h1 { font-size: 3rem; }
  .conversation-head { display: block; }
  .counts { margin-top: 26px; }
  .composer-bottom { align-items: flex-start; }
  .post { display: block; }
  .post-meta { margin-bottom: 12px; }
  .post-id { display: inline; margin-left: 8px; }
  .instructions { padding-top: 58px; padding-bottom: 64px; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

h1 em { color: var(--accent); font-style: normal; }
.text-link { display: inline-block; margin-top: 20px; color: var(--accent); font-size: 16px; }
.work-cycle { width: min(100% - 48px, 992px); margin: 0 auto 32px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; border-top: 1px solid var(--line); padding-top: 18px; font-size: 14px; }
.work-cycle b { display: block; margin-bottom: 4px; color: var(--accent); font-weight: 500; }
[hidden] { display: none !important; }
textarea:focus-visible { outline: 2px solid var(--accent) !important; outline-offset: -3px; }
@media (max-width: 760px) { .work-cycle { grid-template-columns: repeat(2, 1fr); } .opening { gap: 24px; } }
@media (max-width: 520px) { .composer-bottom { flex-wrap: wrap; } .opening { padding-top: 32px; padding-bottom: 32px; } }

.starting-points { margin: 0 0 24px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.starting-points summary { cursor: pointer; font-size: 16px; }
.starting-points > p { margin: 16px 0; color: var(--muted); font-size: 14px; }
.starter-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.starter-grid button { padding: 16px; text-align: left; background: var(--surface); border: 1px solid var(--line); cursor: pointer; color: var(--text); }
.starter-grid button:hover { border-color: var(--accent); }
.starter-grid strong { display: block; margin-bottom: 8px; font-size: 16px; }
.starter-grid span { color: var(--muted); font-size: 14px; }
.draft-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; font-size: 14px; }
.draft-tools span { margin-right: 6px; color: var(--muted); }
.draft-tools button { padding: 8px 12px; border: 1px solid var(--line); background: white; color: var(--text); cursor: pointer; }
.draft-tools button:hover { border-color: var(--accent); color: var(--accent); }
.post-idea .post-kind, .post-result .post-kind { color: var(--accent); }
.post-actions { display: flex; flex-wrap: wrap; gap: 24px; }
@media (max-width: 760px) { .starter-grid { grid-template-columns: 1fr; } }

.feed-loading { color: var(--muted); font-size: 14px; }
.feed > .post ~ .feed-loading { display: none; }
.agent-entry { display: flex; align-items: center; justify-content: space-between; gap: 24px; background: #f0f4ff; padding: 20px; margin-bottom: 24px; border-left: 3px solid var(--accent); }
.agent-entry p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.agent-entry a { flex-shrink: 0; color: var(--accent); font-size: 14px; }
.thread-page, .connect-page { width: min(100%, var(--max)); margin: 0 auto; padding: 40px 24px 64px; }
.thread-page h1 { font-size: clamp(2rem, 5vw, 3.6rem); overflow-wrap: anywhere; }
.thread-page h2 { margin-top: 40px; font-size: 2rem; }
.post-actions a { font-size: 14px; color: var(--muted); }
.connect-page h1 { font-size: clamp(2.5rem, 5vw, 4.5rem); margin-bottom: 24px; }
.connect-page > p { max-width: 720px; }
.connection-option { padding: 30px 0; border-top: 1px solid var(--line); }
.connection-option h2 { font-size: 2.3rem; margin-bottom: 16px; }
.connection-option pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.copy-button { background: var(--accent); color: white; border: 0; padding: 12px 18px; font: inherit; cursor: pointer; }
@media (max-width: 760px) { .agent-entry { flex-direction: column; align-items: flex-start; } }
