:root {
  color-scheme: light dark;
  --background: #f7f8fa;
  --surface: #ffffff;
  --text: #17191d;
  --muted: #68707d;
  --line: #e4e7eb;
  --accent: #0067c7;
  --accent-pressed: #0053a0;
  --danger: #b42318;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #101216;
    --surface: #1b1f26;
    --text: #f4f6f8;
    --muted: #aeb7c2;
    --line: #303641;
    --accent: #63b0ff;
    --accent-pressed: #92caff;
    --danger: #ffb4ab;
  }
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }

button { cursor: pointer; }

button:focus-visible, input:focus-visible, a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent), transparent 55%);
  outline-offset: 2px;
}

.app-shell {
  width: min(100%, 720px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(28px, env(safe-area-inset-top)) 18px max(28px, env(safe-area-inset-bottom));
}

.app-header { margin: 10px 0 22px; }

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

h1 { margin: 0; font-size: clamp(2rem, 9vw, 3rem); letter-spacing: -0.04em; }

.search-form { display: flex; gap: 8px; }

.search-form input {
  min-width: 0;
  flex: 1;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 13px;
  background: var(--surface);
  color: var(--text);
}

.search-form button, .retry-button {
  min-height: 46px;
  border: 0;
  border-radius: 12px;
  padding: 0 16px;
  background: var(--accent);
  color: white;
  font-weight: 700;
}

.search-form button:active, .retry-button:active { background: var(--accent-pressed); }

.toolbar { display: flex; justify-content: space-between; margin: 10px 2px 4px; }

.text-button {
  min-height: 44px;
  border: 0;
  padding: 0 8px;
  background: transparent;
  color: var(--accent);
  font-weight: 650;
}

button:disabled { cursor: wait; opacity: 0.55; }

.status { min-height: 24px; margin: 12px 0; color: var(--muted); font-size: 0.92rem; }
.status[data-kind="error"] { color: var(--danger); }
.retry-button { margin: 0 0 12px; }

.news-list { display: grid; margin: 0; padding: 0; list-style: none; }

.news-list li { border-bottom: 1px solid var(--line); }

.news-list a {
  display: flex;
  align-items: center;
  min-height: 58px;
  padding: 12px 2px;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 650;
  line-height: 1.45;
  text-decoration: none;
}

.news-list a::after {
  flex: 0 0 auto;
  margin-left: 12px;
  color: var(--muted);
  content: "›";
  font-size: 1.5rem;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
