:root {
  font: 16px/1.52 system-ui, sans-serif;
  color: #172625;
  background: #f3f5ef;
  --ink: #172625;
  --muted: #4a605b;
  --accent: #14594b;
  --line: #cfdad1;
  --paper: #fffefa;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--accent); text-underline-offset: .19em; }
a:hover { text-decoration-thickness: .14em; }
:focus-visible { outline: 3px solid #a34a10; outline-offset: 3px; }
.shell { width: min(1120px, calc(100% - 2rem)); margin: 0 auto; }
main { padding: clamp(1.3rem, 4vw, 3rem) 0 4rem; }
.masthead { color: white; background: #15473f; }
.masthead-inner { min-height: 65px; display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.brand { color: white; font-size: 1.15rem; font-weight: 720; text-decoration: none; }
.masthead button { color: white; border-color: #9abbb1; }
h1, h2, h3 { line-height: 1.17; letter-spacing: -.025em; }
h1 { margin: 0 0 1.15rem; font-size: clamp(1.65rem, 4vw, 2.5rem); }
h2 { margin: 0 0 1rem; font-size: 1.45rem; }
h3 { margin-top: 1.5rem; }
.inbox, .detail { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.6fr); gap: clamp(1rem, 3vw, 2.3rem); align-items: start; }
.detail { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.detail article h1 { margin: 1rem 0 .4rem; }
.detail article section { margin: 1.5rem 0; }
.panel, .card, .empty { background: var(--paper); border: 1px solid var(--line); border-radius: .85rem; }
.panel { padding: clamp(1rem, 3vw, 1.75rem); }
.login { max-width: 430px; margin: 5vh auto 0; }
label { display: block; font-size: .9rem; font-weight: 650; margin-bottom: .95rem; }
.field { margin-bottom: .95rem; }
.field label, .filters .field { margin-bottom: 0; }
input, textarea, select, button { font: inherit; }
input:not([type=checkbox]), textarea, select { margin-top: .25rem; width: 100%; padding: .55rem .65rem; border: 1px solid #899e95; border-radius: .4rem; background: white; color: var(--ink); }
input[type=checkbox] { width: 1.1rem; height: 1.1rem; accent-color: var(--accent); flex: 0 0 auto; }
textarea { resize: vertical; }
button, .button { display: inline-block; cursor: pointer; min-height: 42px; padding: .45rem .8rem; border: 1px solid transparent; border-radius: .45rem; background: var(--accent); color: white; font-weight: 650; text-decoration: none; }
button:hover, .button:hover { filter: brightness(.9); }
.secondary, .subtle { background: transparent; color: var(--accent); border-color: #899e95; }
.subtle { font-size: .875rem; }
.actions, .chips { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: .65rem; align-items: end; }
.filters label { margin: 0; }
.filters .wide { grid-column: 1/-1; }
.export { margin: 1rem 0 .65rem; }
.cards, .preview { margin: 0; padding: 0; list-style: none; }
.card { display: flex; align-items: flex-start; gap: .8rem; padding: .85rem; margin-bottom: .55rem; }
.card-content { min-width: 0; }
.card-title { font-weight: 730; overflow-wrap: anywhere; }
.card .chips { margin-top: .4rem; }
.excerpt { margin: .25rem 0; overflow-wrap: anywhere; white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.chip, .count { font-size: .8rem; font-weight: 650; border-radius: 1rem; padding: .16rem .55rem; background: #e8eee8; }
.needs_text, .failed, .notice { background: #fff0d9; color: #653709; }
.done { background: #dceee0; color: #16543a; }
.notice, .empty { padding: .7rem; border-radius: .4rem; }
.back { display: inline-block; margin-bottom: 1rem; }
.muted, .count { color: var(--muted); }
.source-url, main { overflow-wrap: anywhere; }
.note, pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.import-drawer { border-top: 1px solid var(--line); margin-top: 1.15rem; padding-top: .8rem; }
summary { cursor: pointer; color: var(--accent); font-weight: 650; }
details form { margin-top: .8rem; }
.preview li { padding: .8rem 0; border-top: 1px solid var(--line); }
.preview p { margin: .35rem 0; }
.check { display: flex; align-items: center; gap: .5rem; }
@media (max-width: 760px) {
  .inbox, .detail { grid-template-columns: minmax(0, 1fr); }
  .filters { grid-template-columns: 1fr 1fr; }
}
