/* Medium-style minimalism: one narrow column, serif reading text, sans UI, one accent. */
:root {
  --bg: #ffffff;
  --text: #242424;
  --muted: #6b6b6b;
  --line: #e6e6e6;
  --accent: #1a8917;
  --accent-text: #ffffff;
  --danger: #b3261e;
  --serif: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #121212; --text: #e8e6e3; --muted: #a0a0a0; --line: #2c2c2c; --accent: #3fb950; --accent-text: #0b0b0b; --danger: #f28b82; }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 16px; line-height: 1.5; }
a { color: inherit; text-decoration-color: var(--line); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }

.topbar { border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 680px; margin: 0 auto; padding: 16px 20px; display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.wordmark { font-family: var(--serif); font-weight: 700; font-size: 22px; text-decoration: none; margin-right: auto; }
.topbar nav { display: flex; gap: 20px; font-size: 14px; }
.topbar nav a { color: var(--muted); text-decoration: none; }
.topbar nav a:hover, .topbar nav a[aria-current] { color: var(--text); }
.account { position: relative; }
.account summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 999px; color: var(--muted); }
.account summary::-webkit-details-marker { display: none; }
.account summary:hover, .account[open] summary { color: var(--text); background: var(--line); }
.account summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.account-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 10; min-width: 220px; padding: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 24px rgba(0, 0, 0, .12); }
.account-who { margin: 0; padding: 8px 12px 10px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; font-size: 14px; overflow-wrap: anywhere; }
.account-who span { color: var(--muted); font-size: 13px; }
.account-company { padding: 8px 0 6px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.account-company > strong { display: block; padding: 0 12px; font-size: 14px; overflow-wrap: anywhere; }
.account-label { display: block; padding: 0 12px; color: var(--muted); font-size: 12px; }
.account-company .menu-item { color: var(--muted); }
.company-switch-form { margin: 0; }
.account-menu form { margin: 0; }
.account-menu .menu-item, .account-menu button.menu-item { display: flex; align-items: center; gap: 8px; width: 100%; margin: 0; padding: 9px 12px; border: 0; border-radius: 6px; background: none; color: var(--text); font: inherit; font-size: 14px; text-align: left; text-decoration: none; cursor: pointer; }
.account-menu .menu-item:hover, .account-menu .menu-item[aria-current] { background: var(--line); }
.account-menu .menu-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.topbar form { margin: 0; }

.column { max-width: 680px; margin: 0 auto; padding: 48px 20px 96px; }
.column h1 { font-family: var(--serif); font-size: 36px; line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 8px; }
.lede { font-family: var(--serif); font-size: 20px; color: var(--muted); margin: 0 0 40px; }
.column h2 { font-family: var(--serif); font-size: 24px; margin: 40px 0 8px; }

.prose { font-family: var(--serif); font-size: 20px; line-height: 1.6; }
.prose p { margin: 0 0 1.2em; }
.prose h3 { font-family: var(--serif); font-size: 21px; line-height: 1.3; margin: 28px 0 6px; }
.prose h4 { font-family: var(--serif); font-size: 19px; line-height: 1.3; margin: 24px 0 6px; }
.prose ul, .prose ol { margin: 0 0 1.2em; padding-left: 1.4em; }
.prose li { margin: 0 0 0.4em; }

.story { padding: 28px 0; border-bottom: 1px solid var(--line); }
.story h3 { font-family: var(--serif); font-size: 22px; line-height: 1.3; margin: 4px 0 6px; }
.story h3 a { text-decoration: none; }
.story p { font-family: var(--serif); font-size: 17px; color: var(--muted); margin: 0 0 12px; }
.meta { font-size: 13px; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.tag { background: var(--line); border-radius: 999px; padding: 2px 10px; font-size: 13px; color: var(--text); }
.tag.new { background: var(--accent); color: var(--accent-text); }
.tag.link { text-decoration: none; cursor: pointer; }
.tag.link:hover { background: var(--text); color: var(--bg, #fff); }

#top, #credibility { scroll-margin-top: 16px; }
.working { display: flex; align-items: center; gap: 10px; margin: 12px 0; color: var(--muted); font-size: 15px; }
.working.done { color: var(--accent); }
.working .spinner { flex: none; width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .working .spinner { animation: none; border-top-color: var(--muted); } }
.jump { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 10; }
.jump a { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--muted); text-decoration: none; }
.jump a:hover, .jump a:focus-visible { color: var(--accent); border-color: var(--accent); }
.btn, button, input[type=submit] { font: inherit; font-size: 14px; cursor: pointer; border-radius: 999px; padding: 8px 18px; border: 1px solid var(--text); background: transparent; color: var(--text); text-decoration: none; display: inline-block; }
.btn.primary, button.primary, input[type=submit].primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.quiet, button.quiet { border-color: transparent; color: var(--muted); padding-left: 0; padding-right: 0; }
.btn.danger, button.danger { color: var(--danger); border-color: transparent; }

input[type=text], input[type=url], input[type=email], input[type=password], textarea, select {
  font: inherit; width: 100%; padding: 12px 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--text); outline: none; border-radius: 0;
}
input:focus, textarea:focus { border-bottom-color: var(--text); }
textarea { font-family: var(--serif); font-size: 20px; line-height: 1.6; min-height: 50vh; resize: vertical; }
.row { display: flex; gap: 16px; align-items: center; }
.row > input { flex: 1; }

.flash { font-size: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.flash.alert { color: var(--danger); }
.empty { color: var(--muted); font-family: var(--serif); font-size: 18px; padding: 24px 0; }
.quote { border-left: 3px solid var(--line); padding-left: 16px; margin: 16px 0; font-family: var(--serif); color: var(--muted); }
.signin { max-width: 360px; margin: 0 auto; padding: 96px 20px; }
.signin form > * { margin-bottom: 16px; }

@media (max-width: 600px) {
  .column { padding-top: 32px; }
  .column h1 { font-size: 30px; }
  .prose { font-size: 18px; }
}

/* Sources: one line per source, tools folded away */
.source-list { border-top: 1px solid var(--line); }
.source-line { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.source-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.source-actions { display: flex; gap: 12px; margin-left: auto; }
.source-actions form { margin: 0; }
.fold { border-bottom: 1px solid var(--line); padding: 14px 0; }
.fold > summary { cursor: pointer; font-family: var(--serif); font-size: 20px; list-style: none; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::before { content: "+"; display: inline-block; width: 22px; color: var(--muted); }
.fold[open] > summary::before { content: "\2212"; }
.fold[open] > summary { margin-bottom: 16px; }
.fold .lede { font-size: 17px; margin-bottom: 20px; }
.source-name a { text-decoration: none; }
.source-name a:hover { text-decoration: underline; }
.thread-list { padding: 4px 0 10px 4px; border-bottom: 1px solid var(--line); }
.thread-list > summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.thread-list ul { list-style: none; margin: 8px 0 0; padding: 0; }
.thread-list li { display: flex; gap: 12px; align-items: baseline; padding: 4px 0; font-size: 15px; }
.source-line:has(+ .thread-list) { border-bottom: 0; }

/* Approval and comments: three cards */
.card { border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; margin: 16px 0; }
.card-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.card-title { font-family: var(--sans); font-size: 17px; margin: 0 0 4px; }
.card .row > input { min-width: 0; }
.link-row { flex-wrap: wrap; gap: 12px; }
.link-row form { margin: 0; }
.note { background: var(--line); border-radius: 8px; padding: 10px 14px; font-size: 14px; color: var(--muted); margin: 14px 0 0; }
.wide { width: 100%; }

/* Comments on highlighted words */
.quote-button { position: absolute; z-index: 20; padding: 5px 14px; font-size: 13px; box-shadow: 0 2px 10px rgba(0, 0, 0, .18); background: var(--text); color: var(--bg); border-color: var(--text); }
mark.quote-mark { background: color-mix(in srgb, var(--accent) 28%, transparent); color: inherit; border-radius: 2px; cursor: pointer; }
mark.quote-mark.resolved { background: var(--line); }
mark.quote-mark.flash-on, .quote.flash-on { outline: 2px solid var(--accent); }
.comment-quote { margin: 8px 0 4px; padding: 2px 0 2px 12px; border-left: 3px solid var(--line); font-family: var(--serif); font-size: 15px; color: var(--muted); }
.comment-quote[data-action] { cursor: pointer; }
.quote-chip { display: flex; gap: 10px; align-items: baseline; border-left: 3px solid var(--accent); padding: 4px 0 4px 12px; margin-bottom: 8px; font-family: var(--serif); font-size: 15px; }
.quote-chip[hidden] { display: none; }
.quote-chip-text { flex: 1; color: var(--muted); }
