/* A little magazine energy, with quiet ink for the actual reading. */
:root { --wash: #def4ef; --glow: #e9f5d6; }
body {
  background: radial-gradient(ellipse at 0% 0%, var(--wash), transparent 65%),
    radial-gradient(ellipse at 100% 100%, var(--glow), transparent 60%), var(--bg);
  line-height: 1.55;
}
header { border-bottom: 1px solid var(--line); margin-bottom: var(--gap); }
.server-name { font-family: Georgia, serif; font-size: 1.35em; letter-spacing: -0.05em; }
.tab.active { background: var(--wash); border-color: var(--accent); color: var(--accent); }
#card { border-top: 5px solid var(--accent); box-shadow: 0 12px 32px #0000000a; }
.card-head { padding-bottom: var(--gap); border-bottom: 1px solid var(--line); }
#title, .caption h2 { font-family: Georgia, "Times New Roman", serif; letter-spacing: -0.025em; line-height: 1.2; }
#title { font-size: clamp(23px, 1.15rem + 1.2vw, 34px); }
.pill { background: var(--wash); color: var(--accent); padding: 3px 12px; letter-spacing: 0.025em; }
#body { line-height: 1.65; max-width: 65ch; }
#actions button { background: var(--wash); border-color: var(--accent); color: var(--accent); text-align: left; }
#actions button.yes { background: var(--yes); border-color: var(--yes); color: #fff; }
#actions button.no { background: var(--no); border-color: var(--no); color: #fff; }
button:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 3px;
}
@media (hover: hover) { #actions button:hover { box-shadow: inset 0 0 0 1px var(--accent); } }
.pane-title { color: var(--accent); letter-spacing: 0.08em; }
.caption { border-top: 4px solid var(--accent); padding-top: var(--gap); }
.caption h2 { font-size: clamp(23px, 1.1rem + 1vw, 32px); }
#empty { padding: var(--pad); background: var(--wash); border-radius: var(--radius); color: var(--fg); }
@media (prefers-reduced-motion: no-preference) {
  #actions button { transition: box-shadow 120ms ease, background-color 120ms ease; }
}

/* Small editorial details throughout the room. */
::selection { background: var(--wash); color: var(--fg); }
#count { color: var(--accent); font-size: 0.8em; font-weight: 700; font-variant-numeric: tabular-nums; }
.qitem { border-radius: var(--radius); }
.qitem.current { background: var(--wash); }
.qtitle { font-weight: 600; line-height: 1.4; margin-top: 4px; }
.ctx { padding: 12px 0; }
.ctx h3 { color: var(--accent); }
.ctx-post img { box-shadow: 0 3px 10px #0000000a; }
#login, #agent-detail { border-top: 4px solid var(--accent); }
#login { background: var(--card); padding: var(--pad); border-radius: var(--radius); }
#login button[type=submit], #send button[type=submit], #free button[type=submit] {
  background: var(--wash); color: var(--accent); border-color: var(--accent);
}
.row.current { background: var(--wash); }
.msg .reply { border-left: 3px solid var(--accent); }
.sheet-head h2, #ad-name { font-family: Georgia, serif; letter-spacing: -0.025em; }

/* Content remains selectable; long code blocks scroll inside the reading pane. */
.reading, #body.reading { white-space: normal; }
.reading > :first-child { margin-top: 0; }
.reading > :last-child { margin-bottom: 0; }
.reading p { white-space: pre-wrap; margin: 0 0 0.8em; }
.reading h2, .reading h3, .reading h4, .reading h5, .reading h6 {
  font-family: inherit; font-size: 1em; line-height: 1.4;
  color: var(--accent); margin: 1em 0 0.4em; font-weight: 750;
}
.reading ul, .reading ol { margin: 0.5em 0 1em; padding-left: 1.5em; }
.reading li { padding-left: 0.15em; margin: 0.3em 0; white-space: pre-wrap; }
.reading li::marker { color: var(--accent); font-weight: 700; }
.reading blockquote {
  margin: 0.8em 0; padding: 0.65em 1em; background: var(--wash);
  border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0;
}
.reading blockquote p:last-child { margin-bottom: 0; }
.reading code { font-size: 0.9em; background: var(--bg); border-radius: 4px; padding: 0.1em 0.3em; }
.reading pre { white-space: pre; overflow-x: auto; background: var(--bg); padding: 0.8em; border: 1px solid var(--line); border-radius: 8px; }
.reading pre code { background: transparent; padding: 0; }
.post-body.reading { display: block; max-height: 4.8em; cursor: auto; line-height: 1.6; }
.post-body.reading.open { max-height: none; }
.read-more { align-self: flex-start; min-height: 32px; padding: 2px 0; font-size: 0.85em; }
/* On short screens the title gives reading and answer controls more room. */
@container main (max-height: 460px) {
  #title { font-size: 21px; }
  .card-head { gap: 4px; padding-bottom: 4px; }
  #card { gap: 6px; }
}

/* Individual palettes add variety while the room stays green. Reading ink
   and approval colors keep their meaning across every palette. */
#card {
  background: radial-gradient(ellipse at 100% 0%, var(--wash), transparent 55%),
    radial-gradient(ellipse at 0% 0%, var(--glow), transparent 45%), var(--card);
}
.slide:not(.reel-end) {
  background: radial-gradient(ellipse at 10% 15%, var(--wash), transparent 65%),
    radial-gradient(ellipse at 100% 85%, var(--glow), transparent 55%), var(--bg);
}
.slide .caption {
  background: var(--card); border-radius: var(--radius);
  padding: var(--pad); box-shadow: 0 6px 24px #00000008;
}
.qitem.current { background: linear-gradient(120deg, var(--wash), var(--glow)); }
@media (prefers-color-scheme: dark) {
  :root { --wash: #173736; --glow: #29361e; }
}
.hist-card { border-left: 3px solid var(--accent); }
.hist-card .kind { color: var(--accent); }

/* Three goofy little forms: pebble, ticket, and postcard. Decorative edges
   stay inside the surface; the reading area and hit targets remain square. */
#card, .slide .caption {
  border-radius: var(--form-corners, var(--radius));
}
#card .card-head {
  border-bottom-style: var(--form-divider, solid);
  border-bottom-width: 3px;
  border-bottom-color: var(--accent);
}
#card .card-actions {
  border-top: 1px var(--form-divider, solid) var(--line);
  padding-top: calc(var(--gap) * 0.5);
}
.slide .caption { border-top-style: var(--form-divider, solid); }
#card .pill, .slide .pill {
  border: 1px solid var(--accent);
  border-radius: var(--form-stamp, 999px);
}
#card .pill::before, .slide .pill::before {
  content: var(--form-mark, "✳") / ""; /* decorative: empty accessible text */
  display: inline-block;
  margin-right: 0.4em;
  line-height: 1;
  font-size: 1em;
}
.reading blockquote {
  border-radius: 5px 16px 12px 5px;
}
.hist-card { border-radius: var(--form-corners, var(--radius)); }
@container main (max-height: 460px) {
  #card .card-actions { padding-top: 2px; }
}
@media (forced-colors: active) {
  #card, .slide .caption { border: 2px solid CanvasText; }
  #card .pill, .slide .pill { border-color: CanvasText; }
}

.capture-editor {
  width: min(560px, calc(100% - 24px)); max-height: calc(100dvh - 24px);
  overflow-y: auto; overscroll-behavior: contain; padding: var(--pad);
  color: var(--fg); background: var(--card); border: 1px solid var(--line);
  border-top: 4px solid var(--accent); border-radius: 20px 10px 24px 10px;
}
.capture-editor::backdrop { background: rgb(0 0 0 / .4); }
.capture-editor > p { margin: 8px 0 16px; }
.capture-source { padding: 12px; margin-bottom: 16px; background: var(--wash); border-radius: 12px; overflow-wrap: anywhere; }
.capture-source p { margin: 4px 0 0; }
#capture-source-excerpt { white-space: pre-wrap; max-height: 5em; overflow-y: auto; }
#capture-fields { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
#capture-fields label { font-weight: 600; font-size: 0.9em; }
#capture-fields input, #capture-fields select { width: 100%; min-width: 0; }
#capture-save, .capture-button { background: var(--wash); color: var(--accent); border-color: var(--accent); }
.capture-button { align-self: flex-start; }
.source-link { align-self: flex-start; padding: 2px 0; min-height: 36px; font-size: 0.85em; text-align: left; }
.capture-feedback { display: flex; align-items: center; gap: 8px; padding: 0 var(--pad); flex: none; }
.capture-feedback p { margin: 4px 0; font-size: 0.85em; color: var(--accent); }

/* Agents: a heading, an activity cue, then distinct session blocks. */
#agent-list { gap: 16px; }
#agent-list .agent-card {
  padding: 18px; border: 1px solid var(--line); border-left: 4px solid var(--accent);
  background: var(--card); box-shadow: 0 4px 18px #00000006;
}
#agent-list .agent-card.current {
  background: linear-gradient(145deg, var(--wash), var(--card) 70%);
  border-color: var(--accent); box-shadow: 0 6px 24px #0000000a;
}
.agent-card-head, .session-heading, .message-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
}
.agent-card-head .name { display: flex; align-items: center; gap: 6px; min-width: 0; }
#agent-list .agent-card .dot { margin-right: 0; }
.agent-name { font-size: 1.1em; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.presence-label, .assistant-label, .request-kind, .request-state {
  display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 0.72em;
  font-weight: 650; line-height: 1.4;
}
.presence-label { color: var(--muted); border: 1px solid var(--line); }
[data-presence="recent"] .presence-label { background: var(--wash); color: var(--accent); border-color: var(--accent); }
.agent-summary { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 8px 0 14px; font-size: 0.78em; color: var(--muted); }
.pending-label { color: var(--accent); font-weight: 700; }
.session-block { padding: 12px; margin-top: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px 6px 14px 6px; }
.session-title { font-size: 0.95em; color: var(--fg); overflow-wrap: anywhere; }
.assistant-label { background: var(--wash); color: var(--accent); }
.project-label { display: inline-block; margin-top: 6px; color: var(--accent); font-size: 0.78em; font-weight: 650; overflow-wrap: anywhere; }
.session-topic { margin: 6px 0; font-size: 0.85em; line-height: 1.5; color: var(--fg); overflow-wrap: anywhere; }
.session-location, .session-time, .more-sessions { font-size: 0.73em; line-height: 1.5; color: var(--muted); overflow-wrap: anywhere; }
.session-time { margin-top: 5px; }
.more-sessions { display: block; margin-top: 10px; color: var(--accent); }
#agent-list .session-topic { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#agent-detail { padding: var(--pad); background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--accent); border-radius: 18px; min-width: 0; }
#ad-name { font-size: clamp(24px, 1.4rem + 0.5vw, 32px); }
#ad-status { font-size: 0.8em; line-height: 1.5; }
.agent-section-title { margin: 20px 0 10px; font-size: 0.85em; font-weight: 750; color: var(--accent); }
#send { padding: 14px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; }
#send label { font-size: 0.8em; font-weight: 700; }
#thread .request-card { border-left: 3px solid var(--accent); }
#thread .request-card[data-kind="task"] { border-left-width: 5px; }
#thread .request-card[data-kind="prepare_card"] { border-left-style: double; border-left-width: 5px; }
.request-kind { background: var(--wash); color: var(--accent); }
.request-state { color: var(--muted); border: 1px solid var(--line); }
#thread [data-state="pending"] .request-state { color: var(--warn); border-color: var(--warn); }
#thread [data-state="done"] .request-state { color: var(--yes); border-color: var(--yes); }
#thread [data-state="declined"] .request-state { color: var(--no); border-color: var(--no); }
#thread .text { margin-top: 10px; line-height: 1.55; }
#thread .reply { padding: 10px 12px; margin-top: 12px; background: var(--wash); border-radius: 0 10px 10px 0; }
@media (max-width: 520px) {
  #agent-list .agent-card { padding: 14px; }
  .session-block { padding: 10px; }
}
