/* Lucia Inquiry Studio — calm detective / notebook aesthetic (not candy quiz) */
:root {
  --ink: #1f2a24;
  --ink-soft: #3d4a42;
  --muted: #6b7a70;
  --paper: #f4f0e6;
  --paper-2: #ebe6d8;
  --card: #fffdf8;
  --sage: #5f7a68;
  --sage-deep: #3e5a4a;
  --sage-light: #d8e4db;
  --clay: #c4a484;
  --clay-deep: #8b6b4a;
  --accent: #2f5d50;
  --accent-soft: #e7f0eb;
  --warn: #8a5a3a;
  --line: rgba(31, 42, 36, 0.12);
  --shadow: 0 10px 30px rgba(31, 42, 36, 0.08);
  --radius: 18px;
  --touch: 48px;
  --font: "Segoe UI", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(1200px 600px at 10% -10%, #e8efe9 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #efe6d6 0%, transparent 50%),
    var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
}

button, textarea, input { font: inherit; }
button {
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}
button:disabled { opacity: 0.45; cursor: not-allowed; }

.app-shell {
  max-width: 920px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.brand-kicker {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sage);
  font-weight: 700;
}
.brand h1 {
  margin: 0;
  font-family: var(--font);
  font-size: clamp(1.35rem, 4vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.top-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn {
  min-height: var(--touch);
  padding: 12px 18px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--card);
  box-shadow: 0 1px 0 rgba(255,255,255,0.7) inset;
  font-weight: 650;
  transition: transform 0.12s ease, background 0.12s ease;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: var(--accent);
  color: #f7fbf8;
  border-color: transparent;
}
.btn-ghost { background: transparent; }
.btn-sage {
  background: var(--sage-light);
  border-color: transparent;
  color: var(--sage-deep);
}

.hero {
  background: linear-gradient(145deg, #fffdf8 0%, #eef4ef 100%);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  padding: 22px 22px 18px;
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}
.hero h2 {
  margin: 0 0 8px;
  font-family: var(--font);
  font-size: 1.45rem;
}
.hero p { margin: 0; color: var(--ink-soft); max-width: 54ch; }
.loop-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.loop-pill {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(47, 93, 80, 0.1);
  color: var(--accent);
}


.pack-picker {
  margin-bottom: 18px;
}
.pack-picker-label {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--sage);
  margin-bottom: 10px;
}
.pack-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.pack-card {
  text-align: left;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.15s ease, transform 0.12s ease, background 0.15s ease;
}
.pack-card:hover { border-color: rgba(47, 93, 80, 0.4); }
.pack-card:active { transform: scale(0.99); }
.pack-card.selected {
  border-color: var(--accent);
  background: linear-gradient(145deg, #fffdf8 0%, #e7f0eb 100%);
  outline: 2px solid rgba(47, 93, 80, 0.25);
}
.pack-card-kicker {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sage);
  font-weight: 700;
}
.pack-card h3 {
  margin: 0;
  font-family: var(--font);
  font-size: 1.15rem;
}
.pack-card-sub {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}
.pack-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 650;
}

.pack-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 14px;
}
.pack-meta strong { color: var(--ink-soft); font-weight: 650; }

.mission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.mission-card {
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  min-height: 168px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.15s ease, transform 0.12s ease;
}
.mission-card:hover { border-color: rgba(47, 93, 80, 0.35); }
.mission-card:active { transform: scale(0.99); }
.mission-card.done { outline: 2px solid rgba(47, 93, 80, 0.35); }
.mission-card .subject {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sage);
  font-weight: 750;
}
.mission-card .title-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.mission-card .icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 18px;
  flex-shrink: 0;
}
.mission-card h3 {
  margin: 0;
  font-family: var(--font);
  font-size: 1.15rem;
  line-height: 1.25;
}
.mission-card .blurb {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
  flex: 1;
}
.mission-card .foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}
.badge-done {
  background: var(--sage-light);
  color: var(--sage-deep);
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 700;
}

.screen { display: none; }
.screen.active { display: block; }

.mission-chrome {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.stepper {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.step-dot {
  font-size: 12px;
  font-weight: 700;
  padding: 8px 11px;
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--muted);
}
.step-dot.active {
  background: var(--accent);
  color: #f7fbf8;
}
.step-dot.done {
  background: var(--sage-light);
  color: var(--sage-deep);
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  padding: 20px;
  box-shadow: var(--shadow);
}
.panel h2 {
  margin: 0 0 8px;
  font-family: var(--font);
  font-size: 1.4rem;
}
.panel .lead { margin: 0 0 16px; color: var(--ink-soft); }

.artifact {
  background: linear-gradient(180deg, #fbf8f0, #f3eee3);
  border: 1px dashed rgba(139, 107, 74, 0.35);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 18px;
}
.artifact .label {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--clay-deep);
  font-weight: 750;
  margin-bottom: 6px;
}
.number-hero {
  font-family: var(--font);
  font-size: clamp(2.6rem, 10vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--sage-deep);
}
.artifact-hint { color: var(--muted); margin-top: 4px; font-size: 0.95rem; }
.passage-title { font-weight: 750; margin-bottom: 8px; font-family: var(--font); }
.passage-text { white-space: pre-wrap; color: var(--ink); }
.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 640px) {
  .compare-grid { grid-template-columns: 1fr; }
}
.compare-card {
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  border: 1px solid var(--line);
}
.compare-card strong { display: block; margin-bottom: 6px; color: var(--sage-deep); }

.instruction {
  font-weight: 650;
  margin: 0 0 12px;
}

.choice-list { display: flex; flex-direction: column; gap: 10px; }
.choice {
  text-align: left;
  min-height: var(--touch);
  padding: 14px 16px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: #fff;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.choice .tick {
  width: 26px; height: 26px;
  border-radius: 8px;
  border: 2px solid rgba(47,93,80,0.35);
  flex-shrink: 0;
  display: grid; place-items: center;
  margin-top: 1px;
  font-size: 14px;
  color: transparent;
}
.choice.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.choice.selected .tick {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.choice .detail { display: block; color: var(--muted); font-size: 0.9rem; margin-top: 2px; }

.sort-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
}
@media (max-width: 700px) {
  .sort-board { grid-template-columns: 1fr; }
}
.sort-col {
  background: var(--paper-2);
  border-radius: 14px;
  padding: 12px;
  min-height: 120px;
  border: 1px solid var(--line);
}
.sort-col h4 {
  margin: 0 0 10px;
  font-size: 0.95rem;
  color: var(--sage-deep);
}
.sort-pool {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.chip {
  text-align: left;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff;
  border: 1.5px solid var(--line);
  min-height: 44px;
  font-weight: 600;
}
.chip.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47,93,80,0.15);
}
.chip.in-bucket { font-size: 0.95rem; }

.three-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
@media (max-width: 760px) {
  .three-board { grid-template-columns: 1fr; }
}

.seq-row { display: flex; flex-direction: column; gap: 8px; }
.seq-picked {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
  min-height: 48px;
  padding: 10px;
  border-radius: 12px;
  background: var(--accent-soft);
  border: 1px dashed rgba(47,93,80,0.3);
}
.seq-picked:empty::before {
  content: "Tap cards below in order…";
  color: var(--muted);
  font-size: 0.95rem;
}

.starters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}
.starter {
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  font-size: 0.92rem;
  color: var(--ink-soft);
  min-height: 42px;
}
.explain-box {
  width: 100%;
  min-height: 140px;
  resize: vertical;
  padding: 14px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: #fff;
  line-height: 1.5;
}
.explain-box:focus {
  outline: 3px solid rgba(47,93,80,0.2);
  border-color: var(--accent);
}
.char-hint { margin-top: 6px; font-size: 13px; color: var(--muted); }

.feedback {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f7efe6;
  color: var(--warn);
  font-weight: 600;
  display: none;
}
.feedback.show { display: block; }
.feedback.ok {
  background: var(--accent-soft);
  color: var(--sage-deep);
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  justify-content: flex-end;
}

.save-card {
  background: linear-gradient(160deg, #eef5f0, #fffdf8);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  margin-top: 12px;
}
.save-card h3 { margin: 0 0 8px; font-family: var(--font); }

.notebook-list { display: flex; flex-direction: column; gap: 14px; }
.note-entry {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.note-entry h3 { margin: 0 0 4px; font-family: var(--font); }
.note-meta { color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.note-block {
  background: var(--paper-2);
  border-radius: 12px;
  padding: 12px;
  margin-top: 8px;
}
.note-block strong {
  display: block;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sage);
  margin-bottom: 4px;
}
.empty-state {
  padding: 28px;
  text-align: center;
  color: var(--muted);
  background: var(--card);
  border-radius: var(--radius);
  border: 1px dashed var(--line);
}

.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  border: 0;
}
