:root {
  --bg: #f3eee6;
  --ink: #1c1712;
  --muted: #6f655b;
  --line: #e3d8cb;
  --card: #fffaf3;
  --hot: #9a3412;
  --demand: #1f5132;
  --shadow: 0 8px 24px rgba(58, 38, 18, 0.05);
  color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: linear-gradient(180deg, #f7f3ec 0%, var(--bg) 220px);
  font-family: "IBM Plex Sans KR", "Malgun Gothic", sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

a { color: inherit; }

.top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  max-width: 1080px;
  margin: 0 auto;
  padding: 22px 20px 8px;
}

.eyebrow, .status-kicker, .card-kicker, .column-label {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0;
  color: var(--hot);
  font-weight: 500;
}

h1, h2, h3, .lead-value, .clock, strong {
  font-family: inherit;
  font-weight: 600;
  letter-spacing: 0;
}

h1 {
  margin: 2px 0 0;
  font-size: 30px;
  line-height: 1.35;
}

.subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.top-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.clock {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
}

.analyzed {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

button {
  appearance: none;
  border: 0;
  cursor: pointer;
  background: var(--ink);
  color: #fffaf3;
  border-radius: 999px;
  padding: 7px 12px;
  font: 500 13px/1.2 "IBM Plex Sans KR", "Malgun Gothic", sans-serif;
}

button:hover { background: #3a2d22; }
button:disabled { opacity: 0.45; cursor: wait; }

.jump {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  gap: 8px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 10px 20px;
  background: rgba(243, 238, 230, 0.92);
}

.jump a {
  text-decoration: none;
  border: 1px solid var(--line);
  background: rgba(255, 250, 243, 0.8);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 13px;
  color: var(--muted);
}

.jump a:hover { color: var(--ink); border-color: #c8b6a4; }

main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 4px 20px 36px;
}

.section-head, #articles, #keywords, #interests, #topics {
  scroll-margin-top: 52px;
}

.status-panel, .error-panel, .note {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
}

.status-panel p:last-child, .error-panel p, .note { margin: 4px 0 0; }

.error-panel { border-color: #e7b6a4; }

.lead {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 10px;
  margin: 8px 0 18px;
}

.lead article, .block, .split > section {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.lead article { padding: 12px 14px; }

.lead .lead-value {
  margin: 4px 0 6px;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--ink);
}

.lead p, .why, .sample {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin: 18px 0 8px;
}

h2 {
  margin: 0;
  font-size: 19px;
  line-height: 1.4;
}

.section-head span { color: var(--muted); font-size: 13px; }

.split {
  display: grid;
  grid-template-columns: 1.35fr 0.85fr;
  gap: 10px;
}

.column-label {
  margin: 0;
  padding: 14px 14px 0;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
}
.list { list-style: none; margin: 0; padding: 4px 8px 8px; }

.story, .word, .topic, .interest {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
}

.list > :last-child { border-bottom: 0; }

.story-top, .word-top, .topic-top, .interest-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.rank {
  font-variant-numeric: tabular-nums;
  color: var(--hot);
  font-weight: 600;
  font-size: 13px;
  margin-right: 6px;
}

.story h3, .topic h3 {
  display: inline;
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.45;
}

.story h3 a { text-decoration: none; }
.story h3 a:hover { text-decoration: underline; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

.tag, .badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 12px;
  background: #f3ebe1;
  color: #5c5148;
}

.badge-demand { background: #e7f2ea; color: var(--demand); }

.bar {
  height: 5px;
  margin-top: 6px;
  border-radius: 99px;
  background: #f0e6da;
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #9a3412;
}

.bar.green span { background: #1f5132; }

.word strong, .interest strong {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.45;
}

.count {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  white-space: nowrap;
  flex-shrink: 0;
}

.topics { display: grid; gap: 8px; }

.topic {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}

.topic p { margin: 6px 0 0; font-size: 13px; line-height: 1.45; }

.why { margin-top: 4px; }

.sources {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 18px;
}

.source {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  color: var(--muted);
  background: rgba(255, 250, 243, 0.7);
}

.source.bad { color: var(--hot); border-color: #e7b6a4; }

.colophon {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px 28px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 860px) {
  .top, .top-meta { align-items: flex-start; flex-direction: column; }
  .lead, .split { grid-template-columns: 1fr; }
  .jump { overflow-x: auto; }
  h1 { font-size: 26px; }
}
