:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --ink: #0f172a;
  --ink-soft: #475569;
  --muted: #94a3b8;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --primary: #0b2545;
  --primary-600: #13315c;
  --accent: #c89b3c;
  --ok: #166534;
  --ok-bg: #dcfce7;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 4px 12px rgba(15, 23, 42, 0.06);
  --radius: 14px;
  --radius-sm: 10px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header */
.app-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-600) 100%);
  color: #fff;
  padding: 18px 0 22px;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 6px 20px rgba(11, 37, 69, 0.18);
}

.header-inner {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-weight: 700;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.brand-text h1 {
  font-size: 17px;
  margin: 0;
  font-weight: 600;
  letter-spacing: 0.1px;
}

.brand-text p {
  margin: 2px 0 0;
  font-size: 12.5px;
  opacity: 0.85;
}

.progress-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.progress-text {
  font-size: 13px;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.progress-text .muted {
  opacity: 0.8;
}

.progress-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 250ms ease;
}

/* Category nav */
.cat-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 110px;
  z-index: 15;
}

.cat-nav-inner {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 10px 16px;
  scrollbar-width: none;
}

.cat-nav-inner::-webkit-scrollbar {
  display: none;
}

.cat-pill {
  flex-shrink: 0;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-soft);
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 150ms ease;
}

.cat-pill:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.cat-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.cat-pill .count {
  margin-left: 6px;
  font-size: 11.5px;
  opacity: 0.85;
}

/* Main */
.main {
  padding: 20px 16px 80px;
}

.status {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ok-bg);
  color: var(--ok);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow);
  z-index: 30;
  animation: fadeIn 200ms ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translate(-50%, 6px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* Category sections */
.category {
  margin-bottom: 28px;
  scroll-margin-top: 170px;
}

.category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.category-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.category-title::before {
  content: "";
  display: block;
  width: 4px;
  height: 18px;
  background: var(--accent);
  border-radius: 2px;
}

.category-meta {
  font-size: 12.5px;
  color: var(--muted);
}

/* Question card */
.q-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  transition: border-color 150ms ease;
}

.q-card.answered {
  border-left: 3px solid var(--ok);
}

.q-num {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--muted);
  text-transform: uppercase;
}

.q-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin: 4px 0 6px;
  line-height: 1.45;
}

.q-purpose {
  font-size: 13px;
  color: var(--ink-soft);
  background: #f1f5f9;
  border-left: 3px solid var(--line-strong);
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 12px;
}

.q-purpose strong {
  color: var(--primary);
  font-weight: 600;
  display: block;
  font-size: 11px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.field {
  margin-top: 10px;
}

.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-soft);
  margin-bottom: 4px;
}

.field textarea,
.field input {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--ink);
  background: #fff;
  resize: vertical;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.field textarea {
  min-height: 64px;
}

.field textarea:focus,
.field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(11, 37, 69, 0.12);
}

.q-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--muted);
  min-height: 16px;
}

.saved-tag {
  color: var(--ok);
  font-weight: 500;
}

.footer {
  margin-top: 40px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

.footer code {
  background: #eef2f7;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11.5px;
}

/* Tablet / desktop */
@media (min-width: 720px) {
  .header-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .brand-text h1 {
    font-size: 19px;
  }

  .brand-text p {
    font-size: 13px;
  }

  .progress-block {
    min-width: 220px;
  }

  .cat-nav {
    top: 84px;
  }

  .q-card {
    padding: 20px;
  }
}
