:root {
  --cream: #fdf7f0;
  --ink: #3b2a21;
  --muted: #8b7566;
  --accent: #c96f4a;
  --line: #ece2d4;
  --card: #fffaf3;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--cream);
  color: var(--ink);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  max-width: 720px;
  margin: 0 auto;
  padding: env(safe-area-inset-top) 20px env(safe-area-inset-bottom);
}

header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 24px 0 16px;
}

.title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }

h1 {
  font-size: 28px;
  margin: 0;
  letter-spacing: -0.02em;
  font-weight: 700;
}

.date {
  color: var(--muted);
  font-size: 14px;
}

.actions { display: flex; gap: 4px; }

.actions button {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 20px;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
}

.actions button:hover, .actions button:active { background: var(--line); color: var(--ink); }

.brief {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 20px;
}

.brief-body {
  font-size: 16px;
  line-height: 1.55;
}

.brief-body.placeholder { color: var(--muted); }

.brief-meta {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.tab {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 8px 16px;
  border-radius: 999px;
  font: inherit;
  cursor: pointer;
}

.tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.list { display: flex; flex-direction: column; gap: 2px; }

.item {
  display: block;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}

.item:active { opacity: 0.6; }

.item .src {
  font-size: 12px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.item .headline {
  font-size: 17px;
  font-weight: 600;
  margin: 4px 0 6px;
  line-height: 1.35;
}

.item .blurb {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0 0 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.item .when {
  font-size: 12px;
  color: var(--muted);
}

.empty {
  color: var(--muted);
  padding: 40px 0;
  text-align: center;
}

.end {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  padding: 20px 0 40px;
  min-height: 1px;
}

.end:empty { padding: 0; }

dialog {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--cream);
  color: var(--ink);
  padding: 24px;
  max-width: 420px;
  width: calc(100% - 40px);
}

dialog::backdrop { background: rgba(59, 42, 33, 0.4); }

dialog h2 { margin: 0 0 12px; font-size: 20px; }

dialog label { font-size: 13px; color: var(--muted); display: block; margin-bottom: 6px; }

dialog input {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

dialog .hint { font-size: 12px; color: var(--muted); margin: 8px 0 20px; }

dialog .row { display: flex; justify-content: flex-end; gap: 8px; }

dialog button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

dialog button.secondary { background: transparent; color: var(--muted); }
