/* Skimmer — register C: the menu is a monospace table of disposal, the
   reading pane is a place to actually read (comfortable proportional type),
   and the homage lives only where it earns its keep.
   Palette: the Black Skimmer — near-white water, black ink, vermilion beak. */

:root {
  --water: #f7f9f9;
  --ink: #16181a;
  --dim: #6d777c;
  --line: #dde4e6;
  --beak: #d9472b;      /* vermilion — selection, accents */
  --beak-soft: #fbe9e4;
  --amber: #9a6b0a; --amberbg: #faf0d8;
  --red: #a03a2e;   --redbg: #f9e5e1;
  --green: #2e7d46;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --prose: Charter, Georgia, "Times New Roman", serif;
  --ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0 1.5rem 4rem;
  background: var(--water);
  color: var(--ink);
  font: 15px/1.5 var(--ui);
}

/* --- top bar --- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  flex-wrap: wrap;
  background: var(--water);
  margin: 0 -1.5rem 1rem;
  padding: 0.8rem 1.5rem 0.6rem;
  border-bottom: 2px solid var(--ink);
}

.topbar h1 { margin: 0; font-size: 1.3rem; letter-spacing: 0.02em; }

.tagline { margin: 0; color: var(--dim); font-size: 0.85rem; font-style: italic; }

.store-chip {
  padding: 0.08rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--line);
  color: var(--dim);
}

.store-chip.live { background: #e3f2e7; color: var(--green); }

.controls { margin-left: auto; display: flex; gap: 0.4rem; }

button {
  font: inherit;
  font-size: 0.85rem;
  padding: 0.25rem 0.7rem;
  border: 1px solid var(--ink);
  border-radius: 3px;
  background: white;
  color: var(--ink);
  cursor: pointer;
}

button:hover:not(:disabled) { background: var(--beak-soft); }
button.primary { background: var(--beak); border-color: var(--beak); color: white; }
button.primary:hover:not(:disabled) { background: #b93a22; }
button:disabled { opacity: 0.45; cursor: default; }

.status {
  flex-basis: 100%;
  margin: 0.3rem 0 0;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--dim);
  min-height: 1.1em;
}

/* --- menu mode: the monospace table of disposal --- */

.menu { font-family: var(--mono); font-size: 0.82rem; }

.menu-head { display: flex; align-items: baseline; gap: 1rem; }
.menu-title { margin: 0.4rem 0 0.2rem; font-size: 1rem; font-weight: 700; }
.menu-count { color: var(--dim); font-size: 0.75rem; }

.menu-preamble {
  margin: 0.2rem 0 0.8rem;
  color: var(--dim);
  font-style: italic;
  font-family: var(--ui);
  max-width: 46rem;
}

.menu-lines { border-top: 1px solid var(--line); }

.menu-line {
  display: grid;
  grid-template-columns: 1.4em 1.2em 1.2em 1.4em 11.5em 3.2em minmax(12em, 1fr) minmax(6em, auto);
  gap: 0 0.4em;
  padding: 0.14rem 0.3rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  cursor: default;
}

.menu-line.cursor { background: #eef3f4; box-shadow: inset 3px 0 0 var(--ink); }
.menu-line.selected { background: var(--beak-soft); box-shadow: inset 3px 0 0 var(--beak); }
.menu-line.selected .col-sel { color: var(--beak); font-weight: 700; }
.menu-line.failed .col-author, .menu-line.failed .col-subject { color: var(--red); }
.menu-line.member { opacity: 0.85; }
.menu-line.member .col-subject { padding-left: 1.2em; }

.col-key { color: var(--dim); }
.col-sel { color: var(--amber); }
.col-trust.stranger { color: var(--amber); font-weight: 700; }
.col-verify.verify-verified { color: var(--green); }
.col-verify.verify-failed { color: var(--red); font-weight: 700; }
.col-author, .col-subject { overflow: hidden; text-overflow: ellipsis; }
.col-size { text-align: right; color: var(--dim); }
.col-provenance { color: var(--dim); text-align: right; }

.menu-killed { margin: 0.6rem 0 0; font-size: 0.75rem; color: var(--dim); }
.menu-killed summary { cursor: pointer; }
.killed-line { padding-left: 1rem; }

.menu-hint { margin-top: 0.8rem; color: var(--dim); font-size: 0.72rem; }

/* --- read mode: a place to actually read --- */

.reading {
  max-width: 42rem;
  margin: 0 auto;
  font-family: var(--prose);
  font-size: 1.06rem;
  line-height: 1.65;
}

.read-strip {
  display: flex;
  gap: 0.9rem;
  align-items: baseline;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--dim);
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.4rem;
}

.read-author { color: var(--ink); font-weight: 700; }
.verify-mark.verify-verified { color: var(--green); }
.verify-mark.verify-failed { color: var(--red); font-weight: 700; }
.stranger-mark { color: var(--amber); font-weight: 700; }
.read-position { margin-left: auto; }

.read-subject { font-size: 1.5rem; margin: 0.8rem 0 0.2rem; line-height: 1.25; }

.read-marks {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--beak);
  margin: 0.2rem 0;
}

.read-body { white-space: pre-wrap; margin: 1rem 0; }

.read-provenance, .read-hint {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--dim);
}

.read-hint { border-top: 1px solid var(--line); padding-top: 0.5rem; margin-top: 2rem; }

.read-raw pre {
  font-size: 0.75rem;
  background: white;
  border: 1px solid var(--line);
  padding: 0.8rem;
  overflow-x: auto;
}

.read-kind { color: var(--amber); }

/* --- the end screen --- */

.endscreen {
  max-width: 44rem;
  margin: 3rem auto 0;
  text-align: left;
}

.endscreen h2 {
  text-align: center;
  font-weight: 400;
  font-size: 1.4rem;
  color: var(--ink);
}

.end-stats {
  text-align: center;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--dim);
}

.endscreen h3 { margin-top: 2rem; font-size: 0.95rem; }

.draft-list {
  font-family: var(--mono);
  font-size: 0.8rem;
  border-top: 1px solid var(--line);
}

.draft-row {
  display: flex;
  gap: 0.6em;
  align-items: baseline;
  padding: 0.2rem 0.3rem;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.draft-why { width: 5em; font-weight: 700; }
.why-mine { color: var(--ink); }
.why-positive { color: var(--green); }
.why-neutral { color: var(--dim); }
.why-negative { color: var(--red); }
.draft-ref { color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.neutral-toggle { display: block; margin: 0.7rem 0; font-size: 0.85rem; color: var(--dim); }

.preamble-label { display: block; margin: 0.8rem 0; font-size: 0.85rem; color: var(--dim); }
.preamble-label textarea {
  display: block;
  width: 100%;
  font: 0.9rem/1.4 var(--ui);
  margin-top: 0.3rem;
  padding: 0.4rem;
  border: 1px solid var(--line);
  border-radius: 3px;
}

.end-buttons { display: flex; gap: 0.6rem; margin: 1rem 0; }
.end-note { font-size: 0.8rem; color: var(--dim); }
.end-again { text-align: center; margin-top: 3rem; color: var(--dim); font-style: italic; }

/* --- dialogs --- */

dialog {
  border: 2px solid var(--ink);
  border-radius: 4px;
  padding: 1rem 1.2rem;
  max-width: min(46rem, 92vw);
  background: var(--water);
}

dialog::backdrop { background: rgba(22, 24, 26, 0.35); }

.overlay pre {
  font-family: var(--mono);
  font-size: 0.8rem;
  white-space: pre-wrap;
  max-height: 60vh;
  overflow-y: auto;
  margin: 0 0 0.8rem;
}

.compose textarea {
  width: min(42rem, 88vw);
  font: 0.82rem/1.45 var(--mono);
  padding: 0.6rem;
  border: 1px solid var(--line);
  background: white;
}

.dialog-note { font-size: 0.78rem; color: var(--dim); max-width: 40rem; }
.dialog-buttons { display: flex; gap: 0.6rem; justify-content: flex-end; margin-top: 0.6rem; }

.help h2 { margin-top: 0; }
.help-cols { display: flex; gap: 2rem; flex-wrap: wrap; }
.help dl { font-size: 0.82rem; }
.help dt { font-family: var(--mono); font-weight: 700; margin-top: 0.4rem; }
.help dd { margin: 0 0 0.2rem; color: var(--dim); }
.help h3 { font-size: 0.85rem; margin-bottom: 0.2rem; }
body:not(.mac) .mac-only { display: none; }

/* --- the action bar: clickable keys, contextual per phase --- */

.actionbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  gap: 0.4rem;
  justify-content: center;
  flex-wrap: wrap;
  padding: 0.45rem 1rem;
  background: var(--water);
  border-top: 2px solid var(--ink);
  z-index: 15;
}

.bar-button {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-size: 0.78rem;
}

.bar-button kbd { font-size: 0.68rem; color: var(--dim); }
.bar-button.primary kbd { color: rgba(255, 255, 255, 0.8); background: transparent; border-color: rgba(255, 255, 255, 0.5); }

.menu-line { cursor: pointer; }

body { padding-bottom: 5.5rem; }

/* --- footer --- */

.foot {
  margin-top: 3rem;
  border-top: 1px solid var(--line);
  padding-top: 0.6rem;
  font-size: 0.78rem;
  color: var(--dim);
}

.foot a { color: inherit; }
kbd {
  font-family: var(--mono);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0 0.25em;
  background: white;
}
