/* ReadSense — modern white, reading-first */
:root {
  --bg: #ffffff;
  --bg-soft: #f5f6f8;
  --bg-hover: #eff1f4;
  --ink: #0d1017;
  --ink-soft: #3a4150;
  --muted: #6b7385;
  --line: #e7e9ef;
  --line-strong: #d8dbe4;
  --accent: #b8441f;
  --accent-soft: #fdf0ea;
  --warn: #94620a;
  --ok: #1f7a4d;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(13, 16, 23, .05);
  --shadow: 0 12px 34px rgba(13, 16, 23, .10);
  --serif: "Charter", "Iowan Old Style", "Source Serif Pro", Georgia, "Times New Roman", serif;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

html[data-theme="dark"] {
  --bg: #0b0d11;
  --bg-soft: #13161c;
  --bg-hover: #1a1e26;
  --ink: #edf0f6;
  --ink-soft: #c2c8d4;
  --muted: #8b93a3;
  --line: #232833;
  --line-strong: #303644;
  --accent: #ff8f63;
  --accent-soft: #2a1a13;
  --warn: #e0b062;
  --ok: #6cd39a;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 14px 40px rgba(0, 0, 0, .55);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

h1, h2, h3, h4 {
  font-family: var(--sans);
  font-weight: 650;
  letter-spacing: -.022em;
  margin: 0 0 .45em;
  color: var(--ink);
}
h1 { font-size: clamp(30px, 4vw, 42px); line-height: 1.1; }
h2 { font-size: 23px; line-height: 1.25; }
h3 { font-size: 17px; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

::selection { background: var(--accent-soft); color: var(--ink); }

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

/* ------------------------------------------------ top bar */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1180px; margin: 0 auto; padding: 0 20px; height: 62px;
  display: flex; align-items: center; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 650; letter-spacing: -.02em; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-size: 15px; font-weight: 700;
  box-shadow: var(--shadow-sm);
}
.brand-name { font-weight: 650; }

.search-mini { flex: 1; max-width: 340px; }
.search-mini input, .search-page input {
  width: 100%; padding: 9px 14px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--bg-soft); color: var(--ink);
  font-family: var(--sans); font-size: 14px; transition: .15s ease;
}
.search-mini input::placeholder, .search-page input::placeholder { color: var(--muted); }
.search-mini input:focus, .search-page input:focus {
  outline: none; border-color: var(--accent); background: var(--bg);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 999px; border: 1px solid transparent;
  font-family: var(--sans); font-size: 14px; font-weight: 550; cursor: pointer;
  background: transparent; color: var(--ink); transition: .16s ease;
  white-space: nowrap;
}
.btn-ghost { border-color: var(--line); background: var(--bg); }
.btn-ghost:hover { background: var(--bg-soft); color: var(--ink); border-color: var(--line-strong); }
.btn-dark { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn-dark:hover { background: #2a3140; border-color: #2a3140; color: var(--bg); }
html[data-theme="dark"] .btn-dark { background: var(--ink); color: #0b0d11; }
html[data-theme="dark"] .btn-dark:hover { background: #fff; color: #0b0d11; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.icon-btn {
  background: none; border: none; font-size: 18px; cursor: pointer; color: var(--muted);
  padding: 8px; border-radius: 10px; transition: .15s ease;
}
.icon-btn:hover { color: var(--ink); background: var(--bg-soft); }

.avatar {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); cursor: pointer;
  background: var(--bg-soft); color: var(--ink); font-weight: 600; font-family: var(--sans);
  transition: .15s ease;
}
.avatar:hover { border-color: var(--line-strong); background: var(--bg-hover); }
.user-menu { position: relative; }
.user-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 200px; display: none;
  background: var(--bg); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); padding: 6px; flex-direction: column;
}
.user-menu:hover .user-dropdown, .user-menu:focus-within .user-dropdown { display: flex; }
.user-dropdown a, .user-dropdown button {
  display: block; width: 100%; text-align: left; padding: 9px 12px; border: none;
  background: none; font: inherit; font-size: 14px; color: var(--ink);
  border-radius: 9px; cursor: pointer;
}
.user-dropdown a:hover, .user-dropdown button:hover { background: var(--bg-soft); color: var(--ink); }

/* ------------------------------------------------ layout */
.page { max-width: 1180px; margin: 0 auto; padding: 36px 20px 80px; }
.feed-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 56px; }
.feed-main.narrow { max-width: 760px; margin: 0 auto; }

.flash-wrap { max-width: 1180px; margin: 14px auto 0; padding: 0 20px; }
.flash {
  padding: 11px 15px; border-radius: var(--radius); margin-bottom: 8px;
  border: 1px solid var(--line); background: var(--bg-soft); font-size: 14px;
}
.flash-ok { border-color: color-mix(in srgb, var(--ok) 30%, var(--line)); background: color-mix(in srgb, var(--ok) 7%, var(--bg)); color: var(--ok); }
.flash-error { border-color: #f3cccc; background: #fdf2f2; color: #a01e1e; }
html[data-theme="dark"] .flash-error { background: #2a1516; color: #ffb4b4; border-color: #5b2a2a; }

/* ------------------------------------------------ feed */
.feed-head { margin-bottom: 26px; }
.feed-head h1 { margin-bottom: 14px; font-size: clamp(26px, 3vw, 32px); }
.feed-tabs {
  display: inline-flex; gap: 2px; padding: 4px; border-radius: 999px;
  background: var(--bg-soft); border: 1px solid var(--line);
}
.feed-tabs a {
  padding: 7px 14px; font-size: 13.5px; font-weight: 500; color: var(--muted);
  border-radius: 999px; transition: .15s ease;
}
.feed-tabs a:hover { color: var(--ink); }
.feed-tabs a.is-active {
  color: var(--ink); background: var(--bg); box-shadow: var(--shadow-sm);
  border: none;
}
.feed-filter-note { font-size: 13px; color: var(--muted); margin-top: 12px; }
.feed-filter-note a { color: var(--accent); }

.story-list { list-style: none; margin: 0; padding: 0; }
.story { border-bottom: 1px solid var(--line); }
.story:last-child { border-bottom: none; }
.story-link {
  display: block; padding: 24px 16px; margin: 0 -16px;
  border-radius: 14px; transition: background .15s ease;
}
.story-link:hover { background: var(--bg-soft); }
.story-text { flex: 1; min-width: 0; }
.byline { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.story h2 { font-size: 20.5px; margin-bottom: 5px; letter-spacing: -.02em; }
.story-sub { color: var(--ink-soft); margin-bottom: 6px; font-size: 15px; max-width: 72ch; }
.story-excerpt { color: var(--muted); font-size: 14.5px; margin: 0; max-width: 72ch; }
.story-foot { display: flex; align-items: center; gap: 10px; margin-top: 11px; flex-wrap: wrap; }
.story-stats { margin-left: auto; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chip-quiet { background: var(--bg-soft); border-color: transparent; color: var(--muted); }
.chip-quiet:hover { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.meta-item { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.story-list.compact .story-link { padding: 16px 16px; }

.author-dot {
  width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  display: inline-grid; place-items: center; font-size: 12px; font-weight: 600; flex: none;
}
.author-dot.big { width: 40px; height: 40px; font-size: 16px; }
.author-dot.xl { width: 76px; height: 76px; font-size: 28px; }

.chip {
  display: inline-block; padding: 5px 11px; border-radius: 999px; background: var(--bg);
  border: 1px solid var(--line); font-size: 12.5px; color: var(--ink-soft);
  transition: .15s ease;
}
.chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.chip-warn { color: var(--warn); border-color: #f0dcb4; background: #fdf8ec; }
html[data-theme="dark"] .chip-warn { background: #2a2114; border-color: #5b4526; color: #f0c07a; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }

.side-card {
  border: 1px solid var(--line); border-radius: 16px; padding: 20px;
  margin-bottom: 16px; background: var(--bg);
}
.side-card h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; }
.side-links { list-style: none; margin: 0; padding: 0; }
.side-links li { margin-bottom: 10px; font-size: 14px; }

.empty {
  text-align: center; padding: 44px 20px; border: 1px dashed var(--line-strong);
  border-radius: 16px; background: var(--bg-soft);
}
.empty.tall { padding: 96px 20px; border: none; background: none; }

/* ------------------------------------------------ article */
.article { max-width: 720px; margin: 0 auto; }
.article-head { margin-bottom: 30px; }
.article-tags { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.article h1 { font-size: clamp(32px, 4.4vw, 46px); margin-bottom: 12px; letter-spacing: -.03em; line-height: 1.08; }
.article-sub { font-size: 20px; color: var(--muted); font-family: var(--serif); margin-bottom: 24px; line-height: 1.4; }
.article-byline { display: flex; align-items: center; gap: 12px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.author-name { font-weight: 600; font-size: 15px; }
.article-byline .btn { margin-left: auto; }

.article-body {
  font-family: var(--serif); font-size: 19.5px; line-height: 1.75; color: var(--ink-soft);
}
.article-body h1, .article-body h2, .article-body h3 { color: var(--ink); margin-top: 1.6em; font-family: var(--sans); }
.article-body p { margin: 0 0 1.15em; }
.article-body blockquote {
  margin: 1.4em 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--accent);
  font-style: italic; color: var(--ink-soft);
}
.article-body pre {
  background: var(--bg-soft); padding: 16px 18px; border-radius: var(--radius);
  overflow-x: auto; font-size: 14px; border: 1px solid var(--line);
}
.article-body code { font-size: .88em; background: var(--bg-soft); padding: 1px 5px; border-radius: 5px; }
.article-body pre code { background: none; padding: 0; }
.article-body img { max-width: 100%; border-radius: var(--radius); }
.article-body table { width: 100%; border-collapse: collapse; font-size: 15px; font-family: var(--sans); }
.article-body th, .article-body td { border: 1px solid var(--line); padding: 9px 11px; text-align: left; }
.article-foot { margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--line); }
.reaction-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.nod-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg); cursor: pointer;
  font-family: var(--sans); font-size: 14px; color: var(--ink); transition: .15s ease;
}
.nod-btn:hover { border-color: var(--accent); color: var(--accent); }
.nod-btn.is-nodded { background: var(--accent); border-color: var(--accent); color: #fff; }
.nod-btn.is-nodded:hover { background: #a13a19; border-color: #a13a19; color: #fff; }
.nod-glyph { font-size: 15px; line-height: 1; }
.nod-count { font-variant-numeric: tabular-nums; }
.finish-pill { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); }
.finish-inline { margin-left: auto; }

/* reading progress line */
.read-progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0;
  background: var(--accent); z-index: 60; transition: width .1s linear;
}

/* ------------------------------------------------ responses */
.responses { margin-top: 40px; padding-top: 8px; }
.response-list { list-style: none; margin: 0; padding: 0; }
.response {
  border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px;
  margin-bottom: 12px; background: var(--bg);
}
.response-form { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.response-form textarea {
  width: 100%; min-height: 130px; padding: 14px 16px; border: 1px solid var(--line-strong);
  border-radius: 12px; background: var(--bg); color: var(--ink); font-family: var(--sans);
  font-size: 15px; line-height: 1.6; resize: vertical;
}
.response-form textarea::placeholder { color: var(--muted); }
.response-form textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft);
}
.response-form .btn { align-self: flex-end; }

/* ------------------------------------------------ editor */
.editor { max-width: 900px; margin: 0 auto; }
.editor:has(.editor-preview:not([hidden])) { max-width: 1240px; }
.editor-bar {
  display: flex; align-items: center; gap: 10px; margin-bottom: 22px;
  padding-bottom: 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.editor-bar kbd {
  font-family: var(--sans); font-size: 11.5px; padding: 1px 5px; border-radius: 5px;
  border: 1px solid var(--line); background: var(--bg-soft); color: var(--ink-soft);
}
.editor-actions { display: flex; gap: 8px; margin-left: auto; }
.editor-panes { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }
.editor-canvas {
  border: 1px solid var(--line); border-radius: 18px; background: var(--bg-soft);
  padding: 26px 30px 30px; transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.editor-canvas:focus-within {
  background: var(--bg); border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.editor-canvas .editor-body { min-height: 56vh; }
.editor-panes:has(> .editor-preview:not([hidden])) {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.editor-title {
  width: 100%; border: none; background: none; color: var(--ink);
  font-family: var(--sans); font-size: 34px; font-weight: 650; letter-spacing: -.03em;
  padding: 0; margin-bottom: 10px; line-height: 1.15;
}
.editor-title:focus, .editor-subtitle:focus, .editor-body:focus, .editor-tags:focus { outline: none; }
.editor-subtitle {
  width: 100%; border: none; background: none; color: var(--muted);
  font-family: var(--serif); font-size: 20px; padding: 0; margin-bottom: 18px;
}
.editor-body {
  width: 100%; min-height: 68vh; border: none; background: none; color: var(--ink);
  font-family: var(--serif); font-size: 19px; line-height: 1.8; resize: vertical; padding: 0;
  field-sizing: content;
}
.editor-body::placeholder { color: var(--muted); }
.editor-tags {
  width: 100%; max-width: 100%; border: 1px solid var(--line); border-radius: 999px; background: var(--bg-soft);
  padding: 9px 14px; font-family: var(--sans); font-size: 13.5px; color: var(--ink); margin: 16px 0 18px;
}
.editor-preview {
  border: 1px solid var(--line); border-radius: 16px; padding: 22px 24px;
  background: var(--bg-soft); overflow-y: auto; max-height: 72vh;
}
.editor-hint { font-size: 12.5px; color: var(--muted); margin-top: 10px; }
.draft-tag { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--warn); }

/* ------------------------------------------------ profile & auth */
.auth-wrap { max-width: 420px; margin: 56px auto 80px; padding: 0 20px; }
.auth-card {
  border: 1px solid var(--line); border-radius: 20px; padding: 30px 28px;
  background: var(--bg); box-shadow: var(--shadow-sm);
}
.auth-card h1 { font-size: 26px; margin-bottom: 6px; }
.auth-form { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.auth-form label { font-size: 13px; color: var(--muted); display: block; margin-bottom: 4px; }
.auth-form input {
  width: 100%; padding: 11px 14px; border: 1px solid var(--line-strong);
  border-radius: 11px; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 15px;
  transition: .15s ease;
}
.auth-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

.profile-head { display: flex; align-items: flex-start; gap: 20px; margin-bottom: 28px; }
.profile-info h1 { font-size: 30px; margin-bottom: 4px; }
.profile-card { border: 1px solid var(--line); border-radius: 18px; padding: 26px; background: var(--bg); }

/* ------------------------------------------------ footer */
.site-footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 26px 0; }
.footer-inner {
  max-width: 1180px; margin: 0 auto; padding: 0 20px;
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  font-size: 13px; color: var(--muted);
}

/* ------------------------------------------------ forms (shared) */
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input[type="text"], .field input[type="email"], .field input[type="password"],
.field textarea, .field select {
  width: 100%; padding: 11px 14px; border: 1px solid var(--line-strong);
  border-radius: 11px; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 14.5px; transition: .15s ease;
}
.field textarea { font-family: var(--sans); line-height: 1.6; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft);
}
.field small { display: block; color: var(--muted); font-size: 12px; margin-top: 6px; }
.form-actions { display: flex; gap: 8px; align-items: center; margin-top: 6px; flex-wrap: wrap; }

/* ------------------------------------------------ responsive */
@media (max-width: 980px) {
  .feed-layout { grid-template-columns: 1fr; gap: 32px; }
  .feed-side { order: 2; }
  .editor-panes { grid-template-columns: 1fr; }
  .editor-preview { max-height: none; }
  .editor-canvas { padding: 18px 18px 22px; }
  .editor-body { min-height: 52vh; }
}
@media (max-width: 720px) {
  .page { padding: 22px 16px 64px; }
  .topbar-inner { height: auto; padding: 10px 14px; gap: 8px; flex-wrap: wrap; }
  .nav-extra { display: none; }
  .brand-name { display: none; }
  .search-mini { order: 3; flex: 1 0 100%; max-width: none; margin-top: 8px; }
  .search-mini input { padding: 10px 14px; }
  .topbar-actions { gap: 6px; }
  .btn { padding: 8px 13px; }
  .feed-tabs { width: 100%; overflow-x: auto; }
  .story-link { padding: 18px 12px; margin: 0 -12px; }
  .story-meta { display: none; }
  .editor-bar .editor-hint { display: none; }
  .editor-bar .editor-actions { margin-left: 0; width: 100%; }
  .editor-bar .editor-actions .btn { flex: 1; }
  .editor-title { font-size: 30px; }
  .article h1 { font-size: 30px; }
  .article-body { font-size: 18px; }
  .profile-head { flex-direction: column; }
  .auth-wrap { margin: 28px auto 60px; }
  .auth-card { padding: 24px 20px; }
}
/* ------------------------------------------------ marginalia (notes in the margin) */
.article-shell {
  display: grid;
  grid-template-columns: minmax(0, 720px) 280px;
  gap: 56px;
  max-width: 1120px;
  margin: 0 auto;
  align-items: start;
}
.margin-rail {
  position: sticky; top: 84px;
  border-left: 1px solid var(--line);
  padding-left: 20px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}
.rail-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted);
  border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 10px;
}
.rail-count { font-variant-numeric: tabular-nums; color: var(--accent); }
.rail-hint { font-size: 12.5px; color: var(--muted); margin-bottom: 14px; }
.rail-empty { font-size: 12.5px; color: var(--muted); font-style: italic; }

.note-list { list-style: none; margin: 0; padding: 0; }
.note {
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 11px;
  margin-bottom: 10px; cursor: pointer; background: var(--bg); transition: .15s ease;
}
.note:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
.note:hover .note-quote { color: var(--accent); }
.note-num {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 999px; background: var(--accent-soft); color: var(--accent);
  font-size: 11.5px; font-weight: 600; margin-bottom: 6px;
}
.note-quote {
  margin: 0 0 6px; padding-left: 10px; border-left: 2px solid var(--accent);
  font-family: var(--serif); font-size: 13px; color: var(--ink-soft);
}
.note-body { font-size: 13.5px; margin: 0 0 6px; }
.note-meta { font-size: 11.5px; color: var(--muted); margin: 0; }
.note-del {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 11.5px; text-decoration: underline; padding: 0 0 0 6px;
}
.note-del:hover { color: var(--accent); }
.note-inline { color: var(--ink-soft); }

mark.margin-mark {
  background: var(--accent-soft); color: inherit; border-radius: 2px;
  border-bottom: 1px solid var(--accent); padding: 0 1px; cursor: pointer;
}
mark.margin-mark.is-active { background: var(--accent); color: var(--bg); }

.margin-pop {
  position: fixed; z-index: 70; width: 330px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); padding: 14px;
}
.pop-quote {
  margin: 0 0 10px; padding-left: 10px; border-left: 2px solid var(--accent);
  font-family: var(--serif); font-size: 13px; color: var(--ink-soft);
  max-height: 76px; overflow: auto;
}
.margin-pop textarea {
  width: 100%; min-height: 96px; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font-family: var(--sans); font-size: 14px; line-height: 1.55;
  background: var(--bg); color: var(--ink); resize: vertical;
}
.margin-pop textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.pop-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.pop-error { color: #a01e1e; font-size: 12.5px; margin: 8px 0 0; }
html[data-theme="dark"] .pop-error { color: #ffb4b4; }

@media (max-width: 1120px) {
  .article-shell { grid-template-columns: 1fr; gap: 32px; }
  .margin-rail {
    position: static; border-left: none; padding-left: 0;
    border-top: 1px solid var(--line); padding-top: 18px; max-height: none;
  }
}

@media (max-width: 640px) {
  .nav-extra { display: none; }
  .brand-name { display: none; }
  .topbar-inner { padding: 10px 14px; gap: 8px; }
  .topbar-actions { gap: 4px; }
  .btn { padding: 8px 12px; }
}

/* ------------------------------------------------ settings */
.settings-page { max-width: 680px; margin: 0 auto; padding-bottom: 40px; }
.settings-head {
  display: flex; align-items: center; gap: 14px;
  padding: 6px 0 20px; border-bottom: 1px solid var(--line); margin-bottom: 8px;
}
.settings-head h1 { font-size: 27px; margin: 0; letter-spacing: -.025em; }
.settings-back {
  width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 999px; color: var(--ink-soft); text-decoration: none; font-size: 18px;
}
.settings-back:hover { background: var(--bg-soft); color: var(--accent); }

.settings-group { margin-top: 26px; }
.group-title {
  font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: .09em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 8px; padding: 0 2px;
}
.rows {
  list-style: none; margin: 0; padding: 0;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
}
.row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 16px; border-top: 1px solid var(--line); font-size: 15px; color: var(--ink);
}
.row:first-child { border-top: none; }
.row-link {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  width: 100%; text-decoration: none; color: inherit;
}
.row a.row-link:hover span:first-child { color: var(--accent); }
.chev { color: var(--muted); font-size: 17px; line-height: 1; }
.row-value { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.row-plain { color: var(--ink-soft); }
.row-hint { display: block; font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.row-toggle { flex: 1; cursor: pointer; }
.group-note { font-size: 12.5px; color: var(--muted); margin: 10px 2px 0; line-height: 1.55; }
.group-note a { color: var(--accent); }
.version { font-size: 12px; color: var(--muted); margin: 14px 2px 0; }

.linkish {
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--accent); font: inherit; font-size: 14px; text-decoration: underline;
}
.row-signout { width: 100%; }
.row-signout button {
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--accent); font: inherit; font-size: 15px;
}

/* segmented appearance control */
.segmented {
  display: inline-flex; background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 999px; padding: 3px; gap: 2px;
}
.segmented button {
  border: none; background: none; cursor: pointer; padding: 6px 12px;
  border-radius: 999px; font-family: var(--sans); font-size: 13px; color: var(--ink-soft);
}
.segmented button.is-on { background: var(--bg); color: var(--ink); box-shadow: var(--shadow); font-weight: 500; }
.segmented button:hover { color: var(--accent); }

/* toggle switch */
.switch { position: relative; display: inline-block; flex: 0 0 auto; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
  display: block; width: 46px; height: 28px; border-radius: 999px;
  background: var(--line); position: relative; transition: background .18s ease; cursor: pointer;
}
.switch-track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px;
  border-radius: 50%; background: var(--bg); box-shadow: 0 1px 2px rgba(0,0,0,.25);
  transition: transform .18s ease;
}
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* forms */
.settings-form { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 13px; font-weight: 500; color: var(--ink-soft); margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  font-family: var(--sans); font-size: 15px; background: var(--bg); color: var(--ink);
}
.field input:focus, .field textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.field small { display: block; font-size: 12px; color: var(--muted); margin-top: 5px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; align-items: center; }
.group-danger .rows, .group-danger .settings-form { border-color: #e8b4ad; }
.btn-danger { background: #b3261e; color: #fff; border: 1px solid #b3261e; }
.btn-danger:hover { background: #8f1d17; border-color: #8f1d17; }
.preview-card { display: flex; gap: 14px; align-items: flex-start; padding: 16px;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); }
.preview-card .byline { margin: 0 0 4px; }

/* story stats */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stat { background: var(--bg); padding: 14px 16px; }
.stat-num { display: block; font-family: var(--sans); font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 12px; color: var(--muted); }
.stat-row .row-link { align-items: flex-start; }
.story-stat-title { font-size: 14.5px; }
.story-stat-nums { display: flex; gap: 10px; color: var(--muted); font-size: 12.5px; white-space: nowrap;
  font-variant-numeric: tabular-nums; }
.draft-tag { font-style: normal; font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--warn); border: 1px solid var(--warn); border-radius: 999px; padding: 0 6px; margin-left: 6px; }

/* docs */
.doc-intro { font-size: 16.5px; color: var(--ink-soft); margin: 18px 0 6px; line-height: 1.6; }
.doc-section { margin-top: 22px; }
.doc-section h2 { font-size: 17px; margin-bottom: 6px; }
.doc-section p { font-size: 15px; line-height: 1.7; color: var(--ink-soft); margin: 0 0 10px; }

@media (max-width: 560px) {
  .row { padding: 12px 13px; font-size: 14.5px; }
  .segmented { flex-wrap: wrap; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .story-stat-nums { flex-wrap: wrap; justify-content: flex-end; }
}

.feed-filter-note {
  font-size: 12.5px; color: var(--muted); margin: -4px 0 14px;
  border-left: 2px solid var(--accent); padding-left: 10px;
}
.feed-filter-note a { color: var(--accent); }

/* continue reading */
.continue-strip { margin: 0 0 22px; }
.continue-title {
  font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: .09em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 8px;
}
.continue-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.continue-item a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg);
  text-decoration: none; color: inherit;
}
.continue-item a:hover { border-color: var(--accent); }
.continue-progress {
  width: 6px; height: 40px; border-radius: 999px; flex: 0 0 auto;
  background: linear-gradient(to top, var(--accent) var(--p), var(--line) var(--p));
}
.continue-text { display: flex; flex-direction: column; gap: 2px; font-size: 14px; flex: 1; }
.continue-text .muted { font-size: 12.5px; }
.continue-cta { font-size: 13px; color: var(--accent); white-space: nowrap; }

.quiet-note {
  border-left: 3px solid var(--accent); background: var(--accent-soft);
  padding: 12px 14px; border-radius: 8px; font-size: 14px; margin: 0 0 18px;
}
.quiet-note a { color: var(--accent); }

/* replies to a margin note */
.note-replies { margin-top: 6px; }
.note-reply {
  font-size: 12.5px; line-height: 1.55; color: var(--ink-soft);
  border-left: 2px solid var(--line); padding-left: 8px; margin: 6px 0 0;
}
.note-reply strong { color: var(--ink); font-weight: 600; }
.note-reply-btn {
  background: none; border: none; padding: 0; margin-top: 6px; cursor: pointer;
  color: var(--muted); font-size: 11.5px; text-decoration: underline;
}
.note-reply-btn:hover { color: var(--accent); }
.note-reply-form { margin-top: 8px; }
.note-reply-form textarea {
  width: 100%; min-height: 76px; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 11px; font-family: var(--sans); font-size: 13.5px; line-height: 1.5;
  background: var(--bg); color: var(--ink); resize: vertical;
}
.note-reply-form .reply-actions { display: flex; gap: 8px; margin-top: 6px; justify-content: flex-end; }
.note-reply-form .btn { padding: 5px 10px; font-size: 12.5px; }

/* named shelves */
.shelf-select {
  padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px;
  font-family: var(--sans); font-size: 13px; background: var(--bg); color: var(--ink-soft);
}
.shelf-new { display: flex; gap: 8px; align-items: center; margin: 0 0 18px; flex-wrap: wrap; }
.shelf-new input {
  flex: 1; min-width: 200px; padding: 9px 12px; border: 1px solid var(--line);
  border-radius: 8px; font-family: var(--sans); font-size: 14px;
  background: var(--bg); color: var(--ink);
}
.shelf-error { color: #a01e1e; font-size: 12.5px; }
.shelf-block { margin-bottom: 26px; }
.shelf-head { display: flex; align-items: baseline; gap: 10px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.shelf-head h2 { font-size: 18px; margin: 0; }
.shelf-del {
  margin-left: auto; background: none; border: none; padding: 0; cursor: pointer;
  color: var(--muted); font-size: 12px; text-decoration: underline;
}
.shelf-del:hover { color: #b3261e; }
.shelf-empty { font-size: 13px; color: var(--muted); font-style: italic; margin: 10px 0 0; }

/* auth extras */
.auth-wrap { display: flex; justify-content: center; padding: 24px 20px 60px; }
.auth-card { width: 100%; max-width: 440px; margin: 0 auto; }
.link-box {
  border: 1px dashed var(--accent); background: var(--accent-soft);
  border-radius: 12px; padding: 12px 14px; margin: 0 0 16px; font-size: 13px;
  word-break: break-all;
}
.link-box a { color: var(--accent); }
.link-box .small { margin: 0 0 6px; }
.btn.wide { width: 100%; }

/* quote card modal */
.quote-modal {
  position: fixed; inset: 0; z-index: 90; background: rgba(10, 12, 16, .68);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.quote-modal-inner { display: flex; flex-direction: column; gap: 12px; max-height: 100%; }
.quote-modal canvas {
  max-height: 76vh; width: auto; border-radius: 6px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
}
.quote-actions { display: flex; gap: 10px; justify-content: center; }

/* the hidden attribute must beat the flex layout, or the overlay eats all clicks */
.quote-modal[hidden] { display: none; }

/* moderation */
.admin-row { align-items: flex-start; }
.admin-main { flex: 1; }
.admin-title { font-weight: 500; color: var(--ink); text-decoration: none; }
.admin-title:hover { color: var(--accent); }
.admin-reason { font-size: 14px; color: var(--ink-soft); margin: 4px 0; }
.admin-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-actions form { margin: 0; }

/* draft autosave */
.autosave-banner {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  border: 1px dashed var(--accent); background: var(--accent-soft);
  border-radius: 8px; padding: 10px 12px; margin: 0 0 14px; font-size: 13.5px;
}
.autosave-banner[hidden] { display: none; }
.autosave-status { font-size: 12px; color: var(--muted); margin: 8px 2px 0; min-height: 16px; }

/* google sign-in */
.google-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
  font-size: 15px; padding: 11px 16px; border-radius: var(--radius); text-decoration: none;
  margin-bottom: 4px;
}
.google-btn:hover { border-color: var(--accent); color: var(--accent); }
.google-g {
  font-family: Georgia, serif; font-weight: 700; color: #4285f4;
}
.auth-divider {
  display: flex; align-items: center; gap: 10px; color: var(--muted);
  font-size: 12px; margin: 14px 0 6px; text-transform: uppercase; letter-spacing: .08em;
}
.auth-divider::before, .auth-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--line);
}
.inline-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px;
  background: var(--bg-soft); padding: 2px 5px; border-radius: 4px;
}
.doc-list { margin: 0; padding-left: 20px; font-size: 14px; line-height: 1.8; color: var(--ink-soft); }
.doc-list a { color: var(--accent); }

/* roles */
.role-pill {
  display: inline-block; font-size: 11px; letter-spacing: .04em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 999px; border: 1px solid var(--line);
  color: var(--muted); vertical-align: middle; margin-left: 6px;
}
.role-superadmin { border-color: var(--accent); color: var(--accent); }
.role-admin { border-color: var(--ink-soft); color: var(--ink-soft); }
.role-off { border-color: #b3261e; color: #b3261e; }
.role-form { display: flex; gap: 6px; align-items: center; }
.role-form select {
  font: inherit; font-size: 13px; padding: 5px 6px; border: 1px solid var(--line);
  border-radius: 6px; background: var(--bg); color: var(--ink);
}
.matrix { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.matrix th, .matrix td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.matrix th { white-space: nowrap; font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.matrix td:nth-child(n+2) { text-align: center; width: 84px; }

/* more from this author */
.more-stories { margin-top: 46px; padding-top: 26px; border-top: 1px solid var(--line); }
.more-stories h2 { font-size: 17px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.more-stories .story { border-bottom: 1px solid var(--line); }
.more-stories .story:last-child { border-bottom: none; }
.more-stories .story h2 { font-size: 19px; text-transform: none; letter-spacing: -.02em; color: var(--ink); margin-bottom: 4px; }
.more-stories .meta-item { font-size: 12.5px; color: var(--muted); margin-top: 6px; display: block; }

/* compact lists outside the main feed */
.story-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.story-list.compact .story-link { padding: 16px 0; margin: 0; }

/* share menu */
.foot-actions { display: flex; align-items: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.share-menu { position: relative; display: inline-flex; }
.share-trigger.is-active { background: var(--bg-soft); border-color: var(--line-strong); }
.share-pop {
  position: absolute; left: 0; right: auto; top: calc(100% + 8px); z-index: 50;
  width: min(300px, calc(100vw - 32px));
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: var(--shadow); padding: 14px;
}
.share-pop[hidden] { display: none; }
.share-pop.opens-up { top: auto; bottom: calc(100% + 8px); }
.share-head {
  font-size: 11px; text-transform: uppercase; letter-spacing: .09em;
  color: var(--muted); font-weight: 600; margin: 0 0 10px;
}
.share-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.share-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 9px;
  border: none; background: none; border-radius: 10px; cursor: pointer;
  font-family: var(--sans); font-size: 13.5px; color: var(--ink); text-align: left;
  transition: background .14s ease;
}
.share-item:hover { background: var(--bg-soft); color: var(--ink); }
.share-badge {
  width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center;
  font-size: 10.5px; font-weight: 700; color: #fff; flex: none;
}
.b-wa { background: #25d366; }
.b-tg { background: #26a5e4; }
.b-x { background: #111214; }
.b-fb { background: #1877f2; }
.b-li { background: #0a66c2; font-size: 9.5px; }
.b-rd { background: #ff4500; }
.b-mail { background: #64748b; }
.b-copy { background: #94a3b8; }
.b-native { background: var(--accent); }
.share-note { font-size: 12px; color: var(--muted); margin: 9px 2px 0; min-height: 15px; }

/* ------------------------------------------------ newsletter + book (v0.7) */
.footer-sub {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; flex-wrap: wrap; width: 100%;
  padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--line);
}
.footer-sub strong { font-family: var(--sans); font-size: 14px; color: var(--ink); }
.footer-sub p { margin: 3px 0 0; max-width: 46ch; }
.footer-base { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; width: 100%; }

.sub-form { display: flex; gap: 8px; flex-wrap: wrap; }
.sub-form input[type="email"] {
  min-width: 230px; padding: 10px 14px; font: inherit; font-size: 14px;
  color: var(--ink); background: var(--bg);
  border: 1px solid var(--line-strong); border-radius: 999px;
}
.sub-form input[type="email"]:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(184,68,31,.12);
}
.sub-form .btn { border-radius: 999px; }
.sub-form-wide { margin: 10px 0 6px; }

.settings-form .field-label {
  display: block; font-family: var(--sans); font-size: 13px; font-weight: 500;
  color: var(--ink-soft); margin: 14px 0 6px;
}
.settings-form input:not([type="checkbox"]):not([type="radio"]),
.settings-form select, .settings-form textarea {
  width: 100%; padding: 10px 12px; font: inherit; font-size: 15px;
  color: var(--ink); background: var(--bg);
  border: 1px solid var(--line-strong); border-radius: 10px;
}
.settings-form textarea { resize: vertical; min-height: 84px; }
.settings-form input:focus, .settings-form select:focus, .settings-form textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(184,68,31,.12);
}
.settings-form .btn-dark { margin-top: 16px; }

.stat-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 12px; }
.stat-box {
  flex: 1 1 120px; padding: 14px 16px; background: var(--bg-soft);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.stat-box .small { display: block; margin-top: 2px; }

.pick-list { list-style: none; margin: 6px 0 0; padding: 0; max-height: 320px; overflow: auto; }
.pick-list li { border-bottom: 1px solid var(--line); }
.pick-list li:last-child { border-bottom: 0; }
.pick { display: flex; align-items: center; gap: 10px; padding: 9px 4px; font-size: 14px; }
.pick span:first-of-type { flex: 1; color: var(--ink); }
.radio-row { display: flex; gap: 16px; flex-wrap: wrap; font-size: 14px; margin-bottom: 4px; }
.radio-row label { display: inline-flex; align-items: center; gap: 6px; }

.notice-warn {
  background: #fff6ed; border: 1px solid #f0d3b4; color: #7a4a1d;
  padding: 12px 14px; border-radius: var(--radius); font-size: 13.5px; line-height: 1.6;
}
html[data-theme="dark"] .notice-warn {
  background: #2a1d10; border-color: #4a3520; color: #f0c99a;
}

.book-page {
  max-width: 1080px; margin: 24px auto 0; padding: 0 20px;
  display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 46px;
  align-items: start;
}
.book-cover {
  padding: 44px 34px 40px; border-radius: 18px; color: #fff;
  background: linear-gradient(155deg, #1c1a17 0%, #2b2622 55%, #4a2418 100%);
  box-shadow: 0 24px 50px rgba(13,16,23,.22); position: sticky; top: 84px;
}
.book-kicker {
  font-family: var(--sans); font-size: 11px; letter-spacing: .16em;
  text-transform: uppercase; color: rgba(255,255,255,.62);
}
.book-cover h1 {
  font-family: var(--sans); font-size: 30px; line-height: 1.16;
  letter-spacing: -.02em; margin: 14px 0 10px; color: #fff;
}
.book-sub { font-family: var(--serif); font-style: italic; color: rgba(255,255,255,.8);
  margin: 0 0 28px; font-size: 15px; line-height: 1.5; }
.book-by { font-family: var(--sans); font-size: 11.5px; letter-spacing: .14em;
  text-transform: uppercase; color: rgba(255,255,255,.66); margin: 0; }
.book-price { font-family: var(--sans); font-size: 22px; font-weight: 600; margin: 22px 0 12px; }
.book-buy { background: #fff; color: #14110f; border-radius: 999px; }
.book-buy:hover { background: #f3ede7; color: #14110f; }
.book-side h2 { font-family: var(--sans); font-size: 17px; margin: 26px 0 8px; }
.book-side h2:first-child { margin-top: 0; }
.book-side p { font-size: 15px; line-height: 1.75; color: var(--ink-soft); }

@media (max-width: 860px) {
  .book-page { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .book-cover { position: static; }
  .footer-sub { flex-direction: column; align-items: flex-start; }
  .sub-form { width: 100%; }
  .sub-form input[type="email"] { flex: 1; min-width: 0; }
}

/* ------------------------------------------------- book builder (v0.7.1) */
.ebook-wrap { max-width: 1140px; margin: 0 auto; padding: 8px 20px 60px; }
.ebook-head {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 6px 0 22px; border-bottom: 1px solid var(--line); margin-bottom: 26px;
}
.ebook-head-text { flex: 1; }
.ebook-head h1 {
  font-family: var(--sans); font-size: 30px; letter-spacing: -.03em;
  margin: 2px 0 4px; line-height: 1.1;
}
.ebook-head p { margin: 0; font-size: 14px; }
.ebook-head > .btn { margin-top: 4px; white-space: nowrap; }

.ebook-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) 336px;
  gap: 26px; align-items: start;
}
.ebook-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.ebook-side { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 84px; }

.card {
  background: var(--bg); border: 1px solid var(--line); border-radius: 16px;
  padding: 22px 24px;
}
.card-tight { padding: 18px 18px 20px; }
.card-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 14px;
}
.card-head h2 {
  font-family: var(--sans); font-size: 15px; font-weight: 600;
  letter-spacing: -.01em; margin: 0;
}
.card-hint { font-size: 12.5px; color: var(--muted); }
.card-tools { display: flex; align-items: center; gap: 12px; }
.link-btn {
  background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; font-size: 12.5px; font-weight: 500; color: var(--accent);
}
.link-btn:hover { text-decoration: underline; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.control { display: block; margin-bottom: 14px; }
.control > span {
  display: block; font-family: var(--sans); font-size: 12.5px; font-weight: 500;
  color: var(--ink-soft); margin-bottom: 7px;
}
.control input:not([type="checkbox"]):not([type="radio"]),
.control textarea, .control select {
  width: 100%; box-sizing: border-box;
  padding: 11px 13px; font: inherit; font-size: 15px; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line-strong); border-radius: 10px;
  transition: border-color .15s, box-shadow .15s;
}
.control textarea { resize: vertical; min-height: 92px; line-height: 1.6; }
.control input:focus, .control textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(184,68,31,.12);
}
.control-hint { display: block; font-size: 12px; color: var(--muted); margin-top: 6px; font-style: normal; }
.control-hint a { color: var(--accent); }

.chapter-list { list-style: none; margin: 0; padding: 0; }
.chapter-item { border-top: 1px solid var(--line); }
.chapter-item:first-child { border-top: 0; }
.chapter-item label {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 4px; cursor: pointer; border-radius: 10px;
}
.chapter-item label:hover { background: var(--bg-soft); }
.chapter-box { margin-top: 3px; accent-color: var(--accent); width: 16px; height: 16px; }
.chapter-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.chapter-title { font-size: 14.5px; color: var(--ink); line-height: 1.4; }
.chapter-meta { font-size: 12.5px; color: var(--muted); }
.chapter-empty { padding: 16px 4px; font-size: 14px; color: var(--muted); }

.format-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.format-card {
  position: relative; display: block; cursor: pointer;
  border: 1px solid var(--line-strong); border-radius: 12px;
  padding: 14px 14px 12px; background: var(--bg);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.format-card input { position: absolute; opacity: 0; pointer-events: none; }
.format-body { display: flex; flex-direction: column; gap: 4px; }
.format-body strong { font-family: var(--sans); font-size: 13.5px; font-weight: 600; color: var(--ink); }
.format-body em { font-style: normal; font-size: 12px; color: var(--muted); line-height: 1.45; }
.format-card:hover { border-color: var(--ink-soft); }
.format-card:has(input:checked) {
  border-color: var(--accent); background: #fdf6f3;
  box-shadow: 0 0 0 3px rgba(184,68,31,.1);
}
html[data-theme="dark"] .format-card:has(input:checked) { background: #241611; }

.ebook-actions {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 16px 2px 0; margin-top: 2px;
  border-top: 1px solid var(--line);
}
.btn-lg { padding: 13px 26px; font-size: 15px; }

.file-list { list-style: none; margin: 0; padding: 0; }
.file-list li {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 0; border-top: 1px solid var(--line); font-size: 13.5px;
}
.file-list li:first-child { border-top: 0; }
.file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; color: var(--ink); }
.file-badge {
  font-family: var(--sans); font-size: 10.5px; font-weight: 700; letter-spacing: .06em;
  padding: 4px 8px; border-radius: 6px; background: var(--bg-soft); color: var(--ink-soft);
  border: 1px solid var(--line);
}
.file-badge.is-pdf { background: #fbeeea; color: #9c3416; border-color: #f0d5cc; }
.file-badge.is-epub { background: #eef3ec; color: #33573f; border-color: #d6e2d2; }

.cover-panel {
  display: block; background: var(--bg); border: 1px solid var(--line);
  border-radius: 16px; padding: 16px;
}
.cover-panel > * { width: 100%; box-sizing: border-box; }
.preview-label {
  display: block; font-family: var(--sans); font-size: 11px; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px;
}
.cover-preview {
  width: 100%; aspect-ratio: 3 / 4; box-sizing: border-box; border-radius: 12px; padding: 26px 22px;
  display: flex; flex-direction: column; justify-content: center;
  background: linear-gradient(155deg, #1c1a17 0%, #2b2622 55%, #4a2418 100%);
  color: #fff; box-shadow: 0 16px 32px rgba(13,16,23,.18);
  overflow: hidden;
}
.cover-kicker {
  font-family: var(--sans); font-size: 9.5px; letter-spacing: .16em;
  text-transform: uppercase; color: rgba(255,255,255,.6);
}
.cover-preview h3 {
  font-family: var(--sans); font-size: 23px; line-height: 1.2; letter-spacing: -.02em;
  margin: 12px 0 8px; color: #fff; word-break: break-word;
}
.cover-preview p {
  font-family: var(--serif); font-style: italic; font-size: 12.5px; line-height: 1.5;
  color: rgba(255,255,255,.8); margin: 0 0 18px;
}
.cover-preview p.is-hidden { display: none; }
.cover-author {
  border-top: 1px solid rgba(255,255,255,.18); padding-top: 12px;
  font-family: var(--sans) !important; font-style: normal !important;
  font-size: 10px !important; letter-spacing: .14em; text-transform: uppercase;
  color: rgba(255,255,255,.66) !important; margin: 0 !important;
}
.preview-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin: 14px 0 0; padding-top: 14px; border-top: 1px solid var(--line);
}
.preview-stats div { text-align: center; }
.preview-stats dt {
  font-family: var(--sans); font-size: 11px; color: var(--muted); margin-bottom: 3px;
}
.preview-stats dd {
  font-family: var(--sans); font-size: 17px; font-weight: 600; margin: 0;
  font-variant-numeric: tabular-nums;
}
.selling-form { display: flex; flex-direction: column; }
.btn-block { width: 100%; justify-content: center; }

@media (max-width: 900px) {
  .ebook-grid { grid-template-columns: minmax(0, 1fr); }
  .ebook-side { position: static; }
  .cover-preview { max-width: 320px; }
}
@media (max-width: 640px) {
  .ebook-wrap { padding: 4px 16px 48px; }
  .ebook-head {
    display: grid; grid-template-columns: auto minmax(0, 1fr);
    align-items: center; gap: 8px 12px;
  }
  .ebook-head-text { min-width: 0; }
  .ebook-head h1 { font-size: 23px; margin: 0 0 2px; }
  .ebook-head p { font-size: 13px; }
  .ebook-head > .btn { grid-column: 1 / -1; justify-content: center; margin-top: 6px; }
  .card { padding: 18px 16px; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .format-row { grid-template-columns: minmax(0, 1fr); }
  .ebook-actions { flex-direction: column; align-items: stretch; }
  .ebook-actions .btn { width: 100%; }
}

/* ------------------------------------------------- newsletter admin (v0.7.2) */
.newsletter-wrap { max-width: 1140px; margin: 0 auto; padding: 8px 20px 60px; }
.nl-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 0 0 22px; }
.nl-stat {
  background: var(--bg); border: 1px solid var(--line); border-radius: 16px;
  padding: 18px 20px 16px; display: flex; flex-direction: column; gap: 2px;
}
.nl-stat .num {
  font-family: var(--sans); font-size: 30px; font-weight: 600; line-height: 1.1;
  letter-spacing: -.02em; font-variant-numeric: tabular-nums;
}
.nl-stat .lbl { font-family: var(--sans); font-size: 13px; font-weight: 500; color: var(--ink); }
.nl-stat .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

.nl-grid { display: grid; grid-template-columns: minmax(0, 1fr) 336px; gap: 24px; align-items: start; }
.nl-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.nl-side { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 84px; }

.filter-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.tab-group {
  display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px;
  background: var(--bg-soft); border: 1px solid var(--line);
}
.tab-group button {
  border: 0; background: none; cursor: pointer; font: inherit;
  font-family: var(--sans); font-size: 12.5px; font-weight: 500;
  padding: 7px 14px; border-radius: 999px; color: var(--muted);
  transition: background .15s, color .15s;
}
.tab-group button:hover { color: var(--ink); }
.tab-group button.is-active {
  background: var(--bg); color: var(--ink); box-shadow: 0 1px 2px rgba(13,16,23,.08);
}
.nl-search { margin-left: auto; }
.nl-search input {
  width: 220px; padding: 9px 14px; font: inherit; font-size: 13.5px; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line-strong); border-radius: 999px;
}
.nl-search input:focus { outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(184,68,31,.12); }

.sub-list { list-style: none; margin: 0; padding: 0; }
.sub-row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 2px; border-top: 1px solid var(--line);
}
.sub-row:first-child { border-top: 0; }
.sub-row[hidden] { display: none; }
.sub-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sub-email { font-size: 14px; font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
.sub-meta { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.pill {
  font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: .01em;
  padding: 4px 9px; border-radius: 999px; white-space: nowrap;
}
.pill-confirmed { background: #eef3ec; color: #33573f; }
.pill-pending { background: #fdf3e6; color: #8a5a1c; }
.pill-left { background: var(--bg-soft); color: var(--muted); }
html[data-theme="dark"] .pill-confirmed { background: #17241a; color: #a8c9b2; }
html[data-theme="dark"] .pill-pending { background: #2a2012; color: #e3bb85; }
.danger-link { color: var(--muted); font-size: 12.5px; }
.danger-link:hover { color: #b3261e; }
.sub-empty { padding: 22px 2px; font-size: 14px; color: var(--muted); line-height: 1.7; }
.sub-empty strong { display: block; color: var(--ink); margin-bottom: 4px; font-size: 14.5px; }
.sub-noresults { font-size: 13.5px; color: var(--muted); padding: 14px 2px 2px; margin: 0; }

.grow-list { list-style: none; margin: 0 0 10px; padding: 0; }
.grow-list li {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px;
}
.grow-list li:first-child { border-top: 0; }
.grow-list span { color: var(--muted); }
.grow-list code {
  font-family: ui-monospace, Menlo, monospace; font-size: 12px;
  background: var(--bg-soft); padding: 2px 6px; border-radius: 6px; color: var(--ink-soft);
}
.grow-list a { color: var(--accent); font-size: 12.5px; }

@media (max-width: 1080px) {
  .nl-search { flex: 1 1 100%; margin-left: 0; }
  .nl-search input { width: 100%; }
}
@media (max-width: 900px) {
  .nl-grid { grid-template-columns: minmax(0, 1fr); }
  .nl-side { position: static; }
}
@media (max-width: 640px) {
  .newsletter-wrap { padding: 4px 16px 48px; }
  .nl-stats { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .nl-stat { padding: 14px 16px; }
  .nl-stat .num { font-size: 26px; }
  .nl-search { margin-left: 0; width: 100%; }
  .nl-search input { width: 100%; }
  .tab-group { width: 100%; justify-content: space-between; }
  .sub-row { flex-wrap: wrap; }
}

/* ------------------------------------------------- email settings (v0.7.3) */
.steps { margin: 0 0 12px; padding-left: 18px; font-size: 13px; line-height: 1.65;
  color: var(--ink-soft); }
.steps li { margin-bottom: 9px; }
.steps li::marker { color: var(--muted); font-variant-numeric: tabular-nums; }
.steps code {
  font-family: ui-monospace, Menlo, monospace; font-size: 11.5px;
  background: var(--bg-soft); padding: 2px 5px; border-radius: 5px; color: var(--ink);
}
.steps a { color: var(--accent); }
.check-row {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 13.5px; line-height: 1.55; color: var(--ink-soft);
  margin: 4px 0 18px;
}
.check-row input { margin-top: 3px; accent-color: var(--accent); width: 16px; height: 16px; }
.notice-warn a { color: inherit; text-decoration: underline; }

/* ------------------------------------------------- analytics (v0.7.4) */
.kpi-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.chart {
  display: flex; align-items: flex-end; gap: 4px; height: 148px;
  padding: 10px 2px 0; border-bottom: 1px solid var(--line);
}
.chart-col { flex: 1; display: flex; align-items: flex-end; height: 100%; }
.chart-bar {
  width: 100%; border-radius: 3px 3px 0 0; min-height: 3px;
  background: linear-gradient(180deg, var(--accent), #d9694a);
  opacity: .85; transition: opacity .15s;
}
.chart-col:hover .chart-bar { opacity: 1; }
.chart-axis {
  display: flex; justify-content: space-between; margin-top: 8px;
  font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums;
}

.table-wrap { overflow-x: auto; margin: 0 -4px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th {
  text-align: left; font-family: var(--sans); font-size: 11.5px; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase; color: var(--muted);
  padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.data-table td {
  padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: 0; }
.data-table td a { color: var(--ink); font-weight: 500; }
.data-table td a:hover { color: var(--accent); }
.num-col { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rate { display: inline-block; min-width: 34px; }
.rate-bar {
  display: inline-block; width: 54px; height: 5px; border-radius: 999px;
  background: var(--bg-soft); vertical-align: middle; margin-left: 6px; overflow: hidden;
}
.rate-bar i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }

.source-list { list-style: none; margin: 0; padding: 0; }
.source-list li {
  display: grid; grid-template-columns: 92px minmax(0, 1fr) 34px;
  align-items: center; gap: 10px; padding: 8px 0;
}
.source-name { font-size: 13px; color: var(--ink-soft); }
.source-bar { height: 6px; border-radius: 999px; background: var(--bg-soft); overflow: hidden; }
.source-bar i { display: block; height: 100%; background: var(--ink-soft); border-radius: 999px; }
.source-count { font-size: 12.5px; color: var(--muted); text-align: right;
  font-variant-numeric: tabular-nums; }

@media (max-width: 1080px) { .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .kpi-row { grid-template-columns: minmax(0, 1fr); } }

/* ------------------------------------------------------ series (v0.8.0) */
.series-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px;
}
.series-card {
  display: flex; flex-direction: column; gap: 8px; padding: 22px 22px 20px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 16px;
  color: var(--ink); text-decoration: none; transition: border-color .15s, transform .15s;
}
.series-card:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.series-card h2 { font-family: var(--sans); font-size: 20px; letter-spacing: -.02em; margin: 0; }
.series-card p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--ink-soft); }
.series-count {
  font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent);
}
.series-author { margin-top: auto; font-size: 12.5px; color: var(--muted); }

.series-intro {
  max-width: 62ch; font-family: var(--serif); font-size: 17px; line-height: 1.7;
  color: var(--ink-soft); margin: 0 0 22px;
}
.series-progress { font-size: 13px; color: var(--muted); margin: -8px 0 16px; }

.path-list { list-style: none; margin: 0; padding: 0; counter-reset: path; }
.path-item {
  display: flex; align-items: center; gap: 16px; padding: 16px 4px;
  border-top: 1px solid var(--line);
}
.path-item:first-child { border-top: 0; }
.path-num {
  flex: 0 0 32px; height: 32px; border-radius: 999px; display: grid; place-items: center;
  font-family: var(--sans); font-size: 13px; font-weight: 600;
  background: var(--bg-soft); color: var(--ink-soft);
}
.path-item.is-done .path-num { background: #eef3ec; color: #33573f; }
.path-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px;
  text-decoration: none; color: var(--ink); }
.path-title { font-family: var(--sans); font-size: 16px; font-weight: 600;
  letter-spacing: -.01em; line-height: 1.35; }
.path-item a.path-body:hover .path-title { color: var(--accent); }
.path-sub { font-size: 13px; color: var(--muted); line-height: 1.5; }
.path-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--bg); color: var(--ink-soft); cursor: pointer; font-size: 13px;
  line-height: 1; display: grid; place-items: center;
}
.icon-btn:hover:not(:disabled) { background: var(--bg-soft); color: var(--ink); }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }
.path-item.is-draft .path-title::after {
  content: "draft"; margin-left: 8px; font-size: 10.5px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); border: 1px solid var(--line);
  padding: 2px 6px; border-radius: 999px; vertical-align: 2px;
}

.series-chip {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 12px;
  font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: var(--accent); text-decoration: none;
}
.series-chip:hover { text-decoration: underline; }
.series-nav {
  display: flex; justify-content: space-between; gap: 16px; margin-top: 34px;
  padding-top: 20px; border-top: 1px solid var(--line);
}
.series-nav a {
  flex: 1; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px;
  text-decoration: none; color: var(--ink); background: var(--bg);
}
.series-nav a:hover { border-color: var(--line-strong); background: var(--bg-soft); }
.series-nav span { display: block; font-size: 11.5px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em; margin-bottom: 3px; }
.series-nav strong { font-family: var(--sans); font-size: 14.5px; font-weight: 600; }
.series-nav .is-next { text-align: right; }
@media (max-width: 640px) { .series-nav { flex-direction: column; } }

.danger-zone { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }

/* ------------------------------------------------- writing toolbar (v0.8.1) */
.editor-tools {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 10px; margin: 0 0 10px;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 12px;
}
.tool-group { display: flex; gap: 2px; }
.tool-group + .tool-group { padding-left: 8px; border-left: 1px solid var(--line); }
.tool {
  min-width: 34px; height: 32px; padding: 0 9px; border-radius: 8px;
  border: 1px solid transparent; background: transparent; cursor: pointer;
  font: inherit; font-family: var(--sans); font-size: 13px; color: var(--ink-soft);
  display: inline-flex; align-items: center; justify-content: center; gap: 3px;
}
.tool:hover { background: var(--bg); border-color: var(--line); color: var(--ink); }
.tool:active { transform: translateY(1px); }
.tool strong, .tool em, .tool s { pointer-events: none; }

.type-panel {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  margin-top: 12px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--bg);
  font-size: 13px; color: var(--ink-soft);
}
.type-label {
  font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
}
.type-control { display: inline-flex; align-items: center; gap: 8px; }
.type-control > span { color: var(--muted); font-size: 12.5px; }
.type-control select {
  padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line-strong);
  background: var(--bg); font: inherit; font-size: 13px; color: var(--ink);
}
.type-control input[type="range"] { width: 108px; accent-color: var(--accent); }
.type-control output { font-variant-numeric: tabular-nums; color: var(--ink); min-width: 44px; }
.type-hint { color: var(--muted); font-size: 12px; margin-left: auto; }
@media (max-width: 720px) {
  .editor-tools { overflow-x: auto; flex-wrap: nowrap; }
  .type-panel { gap: 12px; }
  .type-hint { margin-left: 0; flex-basis: 100%; }
}

/* ----------------------------------------- author actions on story (v0.8.2) */
.author-actions { display: inline-flex; align-items: center; gap: 8px; }
.author-actions form { display: inline; }
.btn.danger, .btn-ghost.danger { color: #b3261e; border-color: #e8b4ad; }
.btn.danger:hover, .btn-ghost.danger:hover { background: #fdf1ef; color: #8f1d17; }
html[data-theme="dark"] .btn.danger { color: #ff9d90; border-color: #5a2a24; }
html[data-theme="dark"] .btn.danger:hover { background: #2a1512; }

.draft-row { display: flex; align-items: center; gap: 14px; }
.draft-row .story-link { flex: 1; min-width: 0; }
.draft-actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.draft-actions form { display: inline; }
@media (max-width: 640px) {
  .draft-row { flex-direction: column; align-items: stretch; }
  .draft-actions { justify-content: flex-end; }
}

/* ------------------------------------------------ draft review */
.chip-review { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.review-panel {
  margin: 18px 0 28px; border: 1px solid var(--line); border-radius: 16px;
  padding: 16px 18px; background: var(--bg); box-shadow: var(--shadow-sm);
}
.review-panel-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  flex-wrap: wrap; font-size: 14px; margin-bottom: 4px;
}
.review-link-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.review-link-row input[type="text"], .review-link-row input[type="email"] {
  flex: 1; min-width: 220px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 13.5px; font-family: var(--sans); background: var(--bg-soft); color: var(--ink-soft);
}
.note.is-resolved { opacity: .55; }
.note-resolved-tag { color: var(--ok); font-weight: 600; margin-left: 4px; }
