:root {
  color-scheme: light;
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #111827;
  --muted: #5b6472;
  --border: #d9dfeb;
  --accent: #111827;
  --accent-soft: #eef2ff;
  --shadow: 0 16px 45px rgba(17, 24, 39, 0.10);
}

* { box-sizing: border-box; }

html { font-size: 18px; }

body {
  margin: 0;
  min-height: 100svh;
  background: radial-gradient(circle at top, #ffffff 0%, var(--bg) 52%);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input { font: inherit; }

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 -16px 14px;
  padding: 12px 16px;
  background: rgba(244, 246, 251, 0.92);
  backdrop-filter: blur(14px);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
  letter-spacing: .06em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(1.45rem, 7vw, 2.3rem);
  line-height: 1.05;
}

.iconButton {
  width: 48px;
  height: 48px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  box-shadow: 0 8px 20px rgba(17, 24, 39, .08);
}

.panel, .answerCard {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 26px;
  box-shadow: var(--shadow);
}

.panel { padding: 16px; }

.searchLabel {
  display: block;
  margin: 4px 2px 10px;
  font-weight: 800;
  font-size: 1.08rem;
}

.search {
  width: 100%;
  min-height: 56px;
  border: 2px solid var(--border);
  border-radius: 18px;
  padding: 0 16px;
  background: #fff;
  color: var(--text);
  font-size: 1.05rem;
  outline: none;
}

.search:focus {
  border-color: #111827;
  box-shadow: 0 0 0 4px rgba(17, 24, 39, .08);
}

.questionList {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.questionButton {
  width: 100%;
  min-height: 74px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #ffffff;
  color: var(--text);
  text-align: left;
  font-weight: 800;
  line-height: 1.25;
  box-shadow: 0 5px 15px rgba(17, 24, 39, .05);
}

.questionButton:active { transform: scale(.99); }

.questionNumber {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  margin-right: 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  font-size: .92rem;
}

.answerView { display: grid; gap: 14px; }
.hidden { display: none; }

.backButton, .navButtons button {
  min-height: 54px;
  border: 0;
  border-radius: 18px;
  background: var(--accent);
  color: #fff;
  font-weight: 850;
  padding: 0 18px;
}

.answerCard { padding: 20px; }

.counter {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: .95rem;
  font-weight: 800;
}

h2 {
  margin: 0 0 18px;
  font-size: clamp(1.45rem, 6.5vw, 2.25rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.answerText {
  font-size: clamp(1.18rem, 5.3vw, 1.55rem);
  line-height: 1.58;
  font-weight: 520;
}

.answerText p { margin: 0 0 1em; }
.answerText p:last-child { margin-bottom: 0; }

.answerText .dateLine {
  display: block;
  margin: 0 0 10px;
  padding: 12px 14px;
  border-radius: 16px;
  background: #f7f8fb;
  border: 1px solid var(--border);
  font-size: 1.04em;
  line-height: 1.35;
}

.navButtons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.navButtons button:disabled {
  opacity: .45;
}

@media (min-width: 700px) {
  html { font-size: 19px; }
  .app { padding-inline: 24px; }
  .topbar { margin-inline: -24px; padding-inline: 24px; }
  .panel, .answerCard { padding: 24px; }
}
.hidden {
  display: none;
}

#listView,
#answerView {
  animation: fadeSlide .22s ease;
}

@keyframes fadeSlide {
  from {
    opacity: 0;
    transform: translateX(12px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.questionButton {
  transition: transform .15s ease, opacity .15s ease;
}

.questionButton:active {
  transform: scale(0.98);
}