:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-2: #faf8f4;
  --ink: #1d2327;
  --ink-2: #4a545b;
  --muted: #75808a;
  --line: #e4e0d8;
  --line-2: #d3cec4;
  --accent: #1f5f5b;
  --accent-ink: #ffffff;
  --accent-soft: #e3efed;
  --ok: #2f7a4b;
  --ok-soft: #e4f2e8;
  --work: #8a5a10;
  --work-soft: #fbf0dc;
  --bad: #a83a32;
  --bad-soft: #f8e6e3;
  --ins: #d8f0dc;
  --ins-ink: #164d27;
  --del: #f6dcd8;
  --del-ink: #7a2a22;
  --mark: #fff0b3;
  --shadow: 0 1px 2px rgba(30, 30, 20, .06), 0 2px 8px rgba(30, 30, 20, .04);
  --radius: 10px;
  --serif: "Iowan Old Style", "Charter", "Georgia", "Cambria", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15181b; --surface: #1c2024; --surface-2: #20252a; --ink: #e8e6e1; --ink-2: #c2c4c4;
    --muted: #8d969d; --line: #2c3238; --line-2: #3a4148; --accent: #5fb3aa; --accent-ink: #0e1a19;
    --accent-soft: #1e3432; --ok: #6cc08a; --ok-soft: #1c3124; --work: #e0b064; --work-soft: #3a2f1c;
    --bad: #ec8b82; --bad-soft: #3a2220; --ins: #1f3d27; --ins-ink: #b9e8c5; --del: #47241f; --del-ink: #f2bcb4;
    --mark: #4a4120; --shadow: none; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--sans); }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.25; margin: 0; }
h1 { font-family: var(--serif); font-weight: 600; font-size: 30px; letter-spacing: -.01em; }
[hidden] { display: none !important; }

.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top-inner { max-width: 1240px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 600; letter-spacing: .01em; }
.mark { width: 22px; height: 22px; border-radius: 6px; background: var(--accent); position: relative; }
.mark::after { content: ""; position: absolute; left: 5px; right: 5px; top: 7px; height: 8px; border-top: 2px solid var(--accent-ink); border-bottom: 2px solid var(--accent-ink); }
.who { display: flex; gap: 14px; align-items: center; color: var(--ink-2); font-size: 14px; }
.who a { color: var(--muted); }

.page { max-width: 860px; margin: 0 auto; padding: 28px 20px 80px; }
.page.wide { max-width: 1240px; }
.page-head { margin: 0 0 22px; }
.lede { color: var(--ink-2); margin: 6px 0 0; }
.meta { color: var(--muted); font-size: 14px; margin: 4px 0 0; }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); margin-bottom: 18px; flex-wrap: wrap; }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs .pager { margin-left: auto; display: flex; gap: 14px; }

.progress { height: 6px; background: var(--line); border-radius: 3px; margin-top: 12px; overflow: hidden; max-width: 320px; }
.progress span { display: block; height: 100%; background: var(--ok); width: 0; transition: width .3s; }

.cards, .days { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.card, .day-card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; color: inherit; text-decoration: none; box-shadow: var(--shadow); transition: border-color .15s; }
.card:hover, .day-card:hover { border-color: var(--line-2); }
.card:focus-visible, .day-card:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.card.done { opacity: .8; }
.card h2, .day-card h2 { font-size: 18px; font-family: var(--serif); font-weight: 600; }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.mini { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 4px; font-size: 14px; color: var(--ink-2); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; background: var(--line-2); vertical-align: 1px; }
.dot.in_review { background: var(--accent); } .dot.approved { background: var(--ok); }
.dot.revising { background: var(--work); } .dot.failed { background: var(--bad); }
.day-card { display: grid; grid-template-columns: 64px 1fr 20px; gap: 16px; align-items: center; }
.day-date span { display: block; text-align: center; font-size: 13px; font-weight: 600; color: var(--ink-2); line-height: 1.2; }
.first { margin: 6px 0 0; color: var(--ink-2); font-family: var(--serif); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.go { font-size: 26px; color: var(--muted); }

.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; background: var(--accent-soft); color: var(--accent); }
.pill.approved { background: var(--ok-soft); color: var(--ok); }
.pill.revising { background: var(--work-soft); color: var(--work); }
.pill.failed { background: var(--bad-soft); color: var(--bad); }
.tag { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: 600 15px/1 var(--sans); padding: 12px 18px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; min-height: 44px; }
.btn:hover { border-color: var(--ink-2); }
.btn:focus-visible, .linkish:focus-visible, .add-note:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.approve { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.quiet { background: transparent; }
.btn.small { padding: 8px 12px; min-height: 36px; font-size: 14px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.busy { opacity: .7; pointer-events: none; }
.linkish { background: none; border: none; padding: 0; color: var(--accent); font: inherit; font-size: 14px; cursor: pointer; text-decoration: underline; }
.actions-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }

.empty { text-align: center; padding: 60px 20px; background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--radius); }
.empty h1, .empty h2 { margin-bottom: 8px; }
.empty h2 { font-family: var(--serif); font-size: 22px; }
.empty p { color: var(--ink-2); max-width: 460px; margin: 8px auto; }

/* item page */
.review { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; }
.item-head { margin-bottom: 18px; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: 12px; font-weight: 600; color: var(--muted); margin: 0 0 6px; }
.item-meta { display: flex; gap: 12px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.versions { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.versions a { padding: 4px 10px; font-size: 13px; color: var(--ink-2); text-decoration: none; border-right: 1px solid var(--line); }
.versions a:last-child { border-right: 0; }
.versions a.on { background: var(--ink); color: var(--bg); }

.banner { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius); margin: 0 0 18px; font-size: 15px; }
.banner.info { background: var(--accent-soft); }
.banner.work { background: var(--work-soft); }
.banner.ok { background: var(--ok-soft); }
.banner.bad { background: var(--bad-soft); }
.banner-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--work); border-right-color: transparent; border-radius: 50%; animation: spin 1s linear infinite; flex: none; margin-top: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

.changes { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 20px; }
.changes-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.changes h2 { font-size: 16px; }
.switch { font-size: 14px; color: var(--ink-2); display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.warnings { margin: 10px 0 0; padding-left: 18px; color: var(--work); font-size: 14px; }

.channel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; margin-bottom: 16px; box-shadow: var(--shadow); }
.channel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.channel-head h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.channel-head .note { text-transform: none; letter-spacing: 0; font-weight: 400; margin-left: 6px; }
.ch-linkedin { padding: 24px 28px; }
.post-image { display: block; width: 100%; max-width: 300px; border-radius: 8px; margin: 4px 0 16px; border: 1px solid var(--line); }
.block, .file { position: relative; padding: 10px 0; border-top: 1px solid var(--line); }
.channel-head + .block, .post-image + .block { border-top: 0; padding-top: 0; }
.block-label { font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; display: flex; gap: 8px; align-items: center; }
.block-label .open { margin-left: auto; font-weight: 400; }
.changed { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); background: var(--accent-soft); padding: 1px 6px; border-radius: 4px; }
.text { white-space: pre-wrap; overflow-wrap: anywhere; }
.text.serif { font-family: var(--serif); font-size: 18px; line-height: 1.6; }
.review.diff-on .block .plain:has(+ .diff) { display: none; }
.review:not(.diff-on) .block .diff { display: none; }
.review:not(.diff-on) .file .text.diff { display: none; }
.review.diff-on .file .doc-md.plain:has(+ .diff) { display: none; }
ins { background: var(--ins); color: var(--ins-ink); text-decoration: none; border-radius: 2px; }
del { background: var(--del); color: var(--del-ink); border-radius: 2px; }
.add-note { position: absolute; top: 8px; right: 0; font: 600 12px var(--sans); color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; cursor: pointer; opacity: 0; transition: opacity .15s; }
.block:hover .add-note, .file:hover .add-note, .add-note:focus { opacity: 1; }
@media (hover: none) { .add-note { opacity: 1; } }
.channel-head + .block .add-note, .post-image + .block .add-note { top: -2px; }
iframe.doc { width: 100%; height: 640px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.filediff { margin-top: 8px; font-size: 14px; }
.filediff summary { cursor: pointer; color: var(--accent); }
.prose { font-family: var(--serif); font-size: 17px; line-height: 1.6; }
.prose.small { font-size: 15px; font-family: var(--sans); }
.prose h1, .prose h2, .prose h3 { font-family: var(--serif); margin: 1em 0 .4em; font-size: 1.15em; }
.prose p { margin: .6em 0; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose blockquote { border-left: 3px solid var(--line-2); margin: .6em 0; padding-left: 12px; color: var(--ink-2); }
.doc-md { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 20px; max-height: 720px; overflow: auto; }
::selection { background: var(--mark); color: inherit; }

.history { margin-top: 28px; }
.history h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 10px; }
.history details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 16px; margin-bottom: 10px; }
.history summary { cursor: pointer; font-weight: 600; font-size: 15px; }
.sent { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 12px; }
.by { font-size: 13px; color: var(--muted); margin: 0 0 4px; }
.timeline { list-style: none; padding: 0; margin: 12px 0 0; font-size: 14px; color: var(--ink-2); display: grid; gap: 4px; }
.timeline span { color: var(--muted); margin-right: 6px; }

/* feedback panel */
.panel { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; }
.panel-inner { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.panel-inner.calm p { color: var(--ink-2); }
.panel h2 { font-size: 17px; margin-bottom: 4px; }
.hint { font-size: 13px; color: var(--muted); margin: 4px 0 12px; }
.panel label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 10px 0 4px; }
textarea { width: 100%; font: 15px/1.5 var(--sans); color: var(--ink); background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 8px; padding: 10px 12px; resize: vertical; }
textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.composer { border: 2px solid var(--accent); border-radius: 10px; padding: 12px; margin-bottom: 12px; background: var(--accent-soft); }
.composer .row { display: flex; gap: 8px; margin-top: 10px; }
.composer details { margin-top: 8px; font-size: 14px; }
.composer summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.composer details textarea { margin-top: 6px; }
.where { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); margin: 0 0 4px; }
blockquote { margin: 4px 0 6px; padding: 4px 10px; border-left: 3px solid var(--mark); background: var(--surface-2); font-family: var(--serif); font-size: 15px; color: var(--ink-2); white-space: pre-wrap; max-height: 9em; overflow: auto; }
.pins { list-style: none; padding: 0; margin: 0 0 6px; display: grid; gap: 10px; }
.pins li { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--surface); }
.pins li.flash { animation: flash 1.2s; }
@keyframes flash { from { background: var(--accent-soft); } to { background: var(--surface); } }
.body { margin: 0; white-space: pre-wrap; font-size: 15px; }
.repl { margin: 6px 0 0; font-size: 14px; white-space: pre-wrap; }
.repl span { font-weight: 600; color: var(--ink-2); }
.notes-label { margin-top: 14px !important; }
.saved { font-size: 12px; color: var(--muted); min-height: 1.2em; margin: 4px 0 0; }
.attach { margin-top: 10px; }
.attach ul { list-style: none; padding: 0; margin: 0 0 8px; font-size: 14px; display: grid; gap: 4px; }
.file-btn { position: relative; overflow: hidden; margin: 0 !important; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.decide { display: grid; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.decide .hint { margin: 0; min-height: 1.2em; }
.sel-btn { position: absolute; z-index: 50; font: 600 13px var(--sans); background: var(--ink); color: var(--bg); border: 0; border-radius: 8px; padding: 8px 12px; box-shadow: 0 4px 14px rgba(0,0,0,.18); cursor: pointer; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 8px; font-size: 14px; z-index: 100; max-width: calc(100vw - 32px); box-shadow: 0 4px 14px rgba(0,0,0,.2); }
.toast.bad { background: var(--bad); color: #fff; }

.mobilebar { display: none; }
@media (max-width: 980px) {
  .review { grid-template-columns: 1fr; }
  .panel { position: static; max-height: none; scroll-margin-top: 12px; }
  .mobilebar { display: flex; gap: 10px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); }
  .mobilebar .btn { flex: 1; }
  .page.wide { padding-bottom: 110px; }
}
@media (max-width: 600px) {
  h1 { font-size: 25px; }
  .page { padding: 18px 16px 120px; }
  .ch-linkedin, .channel { padding: 16px; }
  .text.serif { font-size: 17px; }
  .day-card { grid-template-columns: 52px 1fr; }
  .go { display: none; }
  .crumbs .pager { margin-left: 0; width: 100%; justify-content: space-between; }
  iframe.doc { height: 520px; }
  .add-note { position: static; opacity: 1; margin-top: 6px; }
}
