:root {
  color-scheme: light;
  --ink: #1d1a16;
  --muted: #5c564c;
  --paper: #f3efe6;
  --card: #fffdf8;
  --line: #ddd4c6;
  --green: #1c3d2e;
  --green-soft: #e7f0eb;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  max-width: 100%;
  overflow-x: clip;
  font-family: "Segoe UI", sans-serif;
  background: var(--paper);
  color: var(--ink);
  padding-bottom: env(safe-area-inset-bottom);
}

html {
  overflow-y: scroll;
  scrollbar-color: var(--green) #d5cbbd;
  scrollbar-width: auto;
}

html::-webkit-scrollbar {
  -webkit-appearance: none;
  width: 12px;
}

html::-webkit-scrollbar-track {
  background: #d5cbbd;
}

html::-webkit-scrollbar-thumb {
  background: var(--green);
  border-radius: 999px;
  min-height: 48px;
}

a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid #e6c56a;
  outline-offset: 2px;
}

header {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--green);
  color: var(--paper);
  padding-top: env(safe-area-inset-top);
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  min-width: 0;
  padding: 0.85rem 1rem 0.4rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-width: 0;
  max-width: 7.5rem;
  min-height: 44px;
  padding: 0.15rem 0.35rem;
  border-radius: 12px;
  background: #fff;
  line-height: 0;
  text-decoration: none;
}

.brand img {
  height: 44px;
  width: auto;
  max-width: 6.5rem;
  display: block;
}

nav { display: flex; gap: 0.4rem; }

nav a {
  color: var(--paper);
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 0.7rem;
  border-radius: 999px;
}

nav a[aria-current="page"] { background: rgba(255, 255, 255, 0.16); }

#search {
  display: flex;
  gap: 0.45rem;
  padding: 0 1rem 0.75rem;
}

#search-input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  font: inherit;
}

#search button {
  background: #fff;
  color: var(--green);
  border-color: #fff;
}

.categories {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  padding: 0.75rem 1rem 0.85rem;
  background: var(--paper);
  color: var(--ink);
  scrollbar-width: none;
}

.categories a {
  flex: 0 0 auto;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.92rem;
}

.categories a[aria-current="true"] {
  background: var(--green);
  color: var(--paper);
  border-color: var(--green);
}

main {
  max-width: 40rem;
  margin: 0 auto;
  padding: 0.4rem 1rem 3rem;
}

.story-card, .story, .notice {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.95rem 1rem;
  margin-top: 0.75rem;
}

.story-card {
  display: block;
  color: inherit;
  text-decoration: none;
}

.kicker, .meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.kicker {
  color: var(--green);
  font-weight: 650;
  letter-spacing: 0.01em;
}

h2 {
  font-family: Georgia, "Iowan Old Style", serif;
  font-size: 1.35rem;
  line-height: 1.25;
  margin: 0.25rem 0 0.45rem;
}

.summary {
  margin: 0;
  line-height: 1.5;
}

.story-card .summary {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.story h2 { font-size: 1.6rem; }

.back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 44px;
  margin: 0 0 0.9rem;
  padding: 0 0.95rem;
  border: 1px solid var(--green);
  border-radius: 999px;
  background: #fff;
  color: var(--green);
  font-weight: 650;
  text-decoration: none;
}

.back::before { content: "←"; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.9rem;
}

button, .link-button {
  min-height: 44px;
  font: inherit;
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--green);
  background: var(--green);
  color: #fff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

button.secondary, a.secondary {
  background: #fff;
  color: var(--green);
}

.source {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}

.source h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.source .link-button {
  width: 100%;
  justify-content: center;
  margin-top: 0.7rem;
}

.more { margin-top: 0.9rem; }

.notice { color: var(--muted); }
