:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --panel-2: #eef4ff;
  --text: #17202a;
  --muted: #657384;
  --line: #dce3ec;
  --primary: #1768ac;
  --primary-2: #0f4f84;
  --good: #0f8b5f;
  --warn: #b66a00;
  --bad: #b03a48;
  --shadow: 0 10px 30px rgba(30, 43, 58, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

button,
textarea,
input,
select {
  font: inherit;
}

.app-shell {
  max-width: 860px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 16px calc(122px + env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.eyebrow {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.1;
}

h2 {
  font-size: 20px;
}

h3 {
  font-size: 17px;
}

p {
  line-height: 1.5;
}

.content {
  display: grid;
  gap: 14px;
}

.panel,
.question-card,
.result-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 16px;
}

.panel.soft {
  background: var(--panel-2);
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.stack {
  display: grid;
  gap: 12px;
}

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

.small {
  font-size: 13px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

button,
.button {
  border: 0;
  border-radius: 8px;
  padding: 10px 13px;
  cursor: pointer;
  color: #ffffff;
  background: var(--primary);
  text-decoration: none;
}

button:hover,
.button:hover {
  background: var(--primary-2);
}

button.secondary {
  background: #e8eef5;
  color: var(--text);
}

button.secondary:hover {
  background: #dce6f1;
}

button.ghost {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--line);
}

button.danger {
  background: var(--bad);
}

.icon-btn {
  width: 42px;
  height: 42px;
  padding: 0;
}

.bottom-nav {
  position: fixed;
  left: 8px;
  right: 8px;
  bottom: calc(8px + env(safe-area-inset-bottom));
  width: auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.bottom-nav button {
  background: transparent;
  color: var(--muted);
  min-width: 0;
  padding: 9px 3px;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bottom-nav button.active {
  background: var(--primary);
  color: #ffffff;
}

@media (min-width: 900px) {
  .bottom-nav {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: 860px;
  }

  .bottom-nav button {
    font-size: 14px;
    padding: 10px 8px;
  }
}

.program-grid,
.question-grid,
.stats-grid {
  display: grid;
  gap: 10px;
}

@media (min-width: 720px) {
  .program-grid,
  .question-grid,
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e8eef5;
  color: var(--muted);
  font-size: 12px;
}

.score {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 20px;
}

.score.good {
  background: var(--good);
}

.score.warn {
  background: var(--warn);
}

.score.bad {
  background: var(--bad);
}

textarea {
  width: 100%;
  min-height: 150px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  color: var(--text);
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}

ul {
  padding-left: 20px;
}

.source-link {
  display: block;
  color: var(--primary);
  word-break: break-word;
}

.notice {
  border-left: 4px solid var(--primary);
}

.hidden {
  display: none !important;
}

.status-processing {
  color: var(--warn);
}

.status-pending_moderation {
  color: var(--primary);
}

.status-approved {
  color: var(--good);
}

.status-rejected,
.status-failed {
  color: var(--bad);
}
