/* QUIZ - one question per screen. The trail log is the signature: every
   answer prints onto the rail and the walked segment turns solid. */
.quiz-body { background: var(--cream); min-height: 100vh; min-height: 100dvh; }
.quiz-shell { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.q-top { background: var(--green); color: var(--on-green); position: sticky; top: 0; z-index: 10; }
.q-top .bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 60px; }
.q-top .logo { color: var(--on-green); }
.q-top .logo-thread { color: var(--amber); width: 7.8rem; }
.q-top .logo-word { font-size: 1.18rem; }
.q-back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; min-width: 76px; padding: 0 12px 0 6px; border: 0; border-radius: 10px; background: transparent; color: var(--on-green); font-weight: 600; font-size: .95rem; }
.q-back:hover { background: rgba(250, 246, 238, .1); }
.q-back.is-hidden { visibility: hidden; }
.q-count { font: 600 .85rem/1 var(--f-body); color: var(--on-green-2); min-width: 76px; text-align: right; font-variant-numeric: tabular-nums; }

/* Horizontal trail (progress) */
.q-trail { position: relative; height: 26px; margin: 0 0 10px; }
.q-trail .line { position: absolute; left: 6px; right: 6px; top: 12px; height: 2px; background: repeating-linear-gradient(to right, rgba(250, 246, 238, .45) 0 6px, transparent 6px 12px); }
.q-trail .walked { position: absolute; left: 6px; right: 6px; top: 12px; height: 2px; background: var(--on-green); transform-origin: left; transform: scaleX(var(--p, 0)); transition: transform .6s var(--ease); }
.q-trail .nodes { position: absolute; inset: 0; display: flex; justify-content: space-between; align-items: center; }
.q-trail .node { width: 12px; height: 12px; border-radius: 50%; background: var(--green); box-shadow: inset 0 0 0 2px rgba(250, 246, 238, .5); transition: background-color .4s, box-shadow .4s, transform .4s var(--ease); }
.q-trail .node.done { background: var(--on-green); box-shadow: none; }
.q-trail .node.here { background: var(--amber); box-shadow: 0 0 0 4px rgba(232, 163, 61, .3); transform: scale(1.25); }
.q-trail .node.end { border-radius: 3px; width: 10px; height: 16px; }

.q-main { flex: 1; padding: 22px 0 48px; }
.q-grid { display: grid; gap: 20px; }
@media (min-width: 960px) { .q-grid { grid-template-columns: 260px minmax(0, 1fr); gap: 72px; } .q-main { padding-top: 52px; } }

/* Trail log */
.q-logwrap { min-width: 0; }
.q-log-title { display: none; font: 600 .8rem/1 var(--f-body); color: var(--ink-3); margin: 0 0 14px; }
.q-log { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter); list-style: none; }
.q-log::-webkit-scrollbar { display: none; }
.q-log li { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 999px; background: var(--sage-soft); color: var(--green); font: 600 .8rem/1 var(--f-body); white-space: nowrap; }
.q-log li .k { color: var(--ink-3); font-weight: 500; }
.q-log li.ahead, .q-log li.here { display: none; }
.q-log li.new { animation: print .65s steps(12, end) both; }
@keyframes print { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@media (min-width: 960px) {
  .q-log-title { display: block; }
  .q-log { display: block; margin: 0; padding: 0 0 0 30px; overflow: visible; position: relative; }
  .q-log li { position: relative; display: block; background: none; padding: 0 0 18px; white-space: normal; font: 600 1.02rem/1.3 var(--f-display); color: var(--green); border-radius: 0; }
  .q-log li::after { content: ""; position: absolute; left: -23px; top: 6px; bottom: -6px; width: 2px; background: var(--green-mid); }
  .q-log li:last-child::after { display: none; }
  .q-log li::before { content: ""; position: absolute; left: -28px; top: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--green-mid); box-shadow: 0 0 0 4px var(--cream); z-index: 1; }
  .q-log li .k { display: block; font: 600 .72rem/1 var(--f-body); color: var(--ink-3); margin-bottom: 5px; }
  .q-log li.new::before { animation: blaze 1.3s var(--ease) both; }
  .q-log li.ahead, .q-log li.here { display: block; font: 500 .9rem/1.3 var(--f-body); color: var(--ink-3); }
  .q-log li.ahead::before { background: var(--cream); box-shadow: inset 0 0 0 2px var(--line-strong), 0 0 0 4px var(--cream); }
  .q-log li.ahead::after { background: repeating-linear-gradient(to bottom, var(--line-strong) 0 5px, transparent 5px 10px); }
  .q-log li.here { color: var(--ink); font: 600 .95rem/1.3 var(--f-body); }
  .q-log li.here::before { background: var(--amber); box-shadow: 0 0 0 4px rgba(232, 163, 61, .3); }
}
@keyframes blaze { 0% { background: var(--amber); transform: scale(1.7); } 100% { background: var(--green-mid); transform: scale(1); } }

/* Question card */
.q-card { max-width: 620px; width: 100%; }
.q-card h1 { font-size: clamp(1.8rem, 6.4vw, 2.7rem); line-height: 1.08; letter-spacing: -.025em; }
.q-card h1 .dog { font-style: italic; font-weight: 500; }
.q-sub { margin: 10px 0 0; color: var(--ink-2); font-size: 1rem; }
.q-options { display: grid; gap: 10px; margin: 24px 0 0; padding: 0; list-style: none; }
@media (min-width: 560px) { .q-options.two { grid-template-columns: 1fr 1fr; } }
.q-opt {
  position: relative; display: flex; align-items: center; gap: 14px; width: 100%; min-height: 64px; padding: 14px 16px; text-align: left;
  background: var(--paper); border: 0; border-radius: var(--r); box-shadow: inset 0 0 0 1.5px var(--line-strong);
  color: var(--ink); transition: box-shadow .2s, background-color .2s, transform .2s var(--ease);
}
.q-opt:hover { box-shadow: inset 0 0 0 2px var(--green); }
.q-opt:active { transform: scale(.985); }
.q-opt .tx { flex: 1; min-width: 0; }
.q-opt .t { font-weight: 600; font-size: 1.04rem; line-height: 1.25; display: block; }
.q-opt .h { display: block; font-size: .87rem; color: var(--ink-3); margin-top: 3px; }
.q-opt .dot { flex: none; width: 24px; height: 24px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--line-strong); display: grid; place-items: center; background: var(--cream); transition: background-color .2s, box-shadow .2s; }
.q-opt .dot .ico { width: 15px; height: 15px; opacity: 0; color: var(--ink); transition: opacity .15s; }
.q-opt.multi .dot { border-radius: 7px; }
.q-opt .oi { flex: none; width: 26px; height: 26px; color: var(--green); }
.q-opt[aria-checked="true"] { background: var(--amber-soft); box-shadow: inset 0 0 0 2px var(--amber-deep); }
.q-opt[aria-checked="true"] .dot { background: var(--amber); box-shadow: none; }
.q-opt[aria-checked="true"] .dot .ico { opacity: 1; }
.q-opt:disabled { opacity: .45; cursor: not-allowed; box-shadow: inset 0 0 0 1.5px var(--line); }
.q-actions { margin-top: 22px; display: grid; gap: 10px; }
.q-counter { font: 600 .88rem/1 var(--f-body); color: var(--ink-3); margin-top: 14px; font-variant-numeric: tabular-nums; }
.q-input { font-size: 1.25rem !important; min-height: 62px !important; margin-top: 22px; }
.q-zip-ok { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-weight: 600; color: var(--ok); min-height: 24px; }
.q-zip-ok .ico { width: 20px; height: 20px; }

/* Breed combobox */
.combo { position: relative; margin-top: 14px; }
.combo .search-ico { position: absolute; left: 16px; top: 31px; transform: translateY(-50%); color: var(--ink-3); width: 20px; height: 20px; pointer-events: none; }
.combo input { padding-left: 46px !important; margin-top: 0; }
.combo-list { list-style: none; margin: 8px 0 0; padding: 6px; border-radius: var(--r); background: var(--paper); box-shadow: var(--shadow), inset 0 0 0 1px var(--line); max-height: 300px; overflow: auto; }
.combo-list:empty { display: none; }
.combo-list li { padding: 13px 12px; border-radius: 9px; cursor: pointer; font-weight: 500; }
.combo-list li[aria-selected="true"], .combo-list li:hover { background: var(--sage-soft); color: var(--green); }
.combo-list mark { background: none; color: var(--green); font-weight: 700; }

/* Contact gate */
.gate-preview { position: relative; margin: 20px 0 4px; border-radius: var(--r-lg); overflow: hidden; background: var(--paper); box-shadow: var(--shadow-lift); }
.gate-preview .gp-top { background: var(--green); color: var(--on-green); padding: 18px 20px; position: relative; overflow: hidden; isolation: isolate; }
.gate-preview .gp-top::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--contours) 70% 30% / 240% no-repeat; opacity: .22; }
.gate-preview .gp-k { font: 600 .8rem/1 var(--f-body); color: var(--on-green-2); padding-right: 90px; }
.gate-preview .gp-name { font: italic 500 1.55rem/1.15 var(--f-display); margin-top: 8px; filter: blur(7px); user-select: none; }
.gate-preview .gp-body { padding: 14px 20px 16px; filter: blur(4.5px); user-select: none; }
.gate-preview .gp-lock { position: absolute; right: 14px; top: 14px; display: inline-flex; gap: 6px; align-items: center; font: 700 .76rem/1 var(--f-body); background: var(--amber); color: var(--ink); padding: 7px 10px; border-radius: 999px; z-index: 2; }
.gate-preview .gp-lock .ico { width: 14px; height: 14px; }
.gate-form { margin-top: 20px; display: grid; gap: 14px; }
.gate-small { font-size: .84rem; color: var(--ink-3); display: flex; gap: 6px; justify-content: center; align-items: center; text-align: center; margin: 0; }
.gate-small .ico { width: 15px; height: 15px; flex: none; }
.q-form-error { padding: 12px 14px; border-radius: 10px; background: #F8E2D8; color: var(--danger); font-weight: 600; font-size: .92rem; }
.q-form-error:empty { display: none; }

.q-card.enter { animation: qin .5s var(--ease) both; }
.q-card.enter.back { animation-name: qback; }
@keyframes qin { from { opacity: 0; transform: translateX(22px); } to { opacity: 1; transform: none; } }
@keyframes qback { from { opacity: 0; transform: translateX(-22px); } to { opacity: 1; transform: none; } }
.q-restore { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--sage-soft); color: var(--green); font-size: .92rem; font-weight: 500; margin-bottom: 18px; }
.q-restore button { border: 0; background: none; color: var(--green); font-weight: 700; text-decoration: underline; text-underline-offset: .2em; padding: 6px 0; min-height: 36px; }
@media (prefers-reduced-motion: reduce) { .q-card.enter, .q-log li.new, .q-log li.new::before { animation: none; } }

.q-card h1:focus { outline: none; }
.q-actions.stick { position: sticky; bottom: 0; z-index: 2; margin: 14px calc(-1 * var(--gutter)) 0; padding: 22px var(--gutter) calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(to bottom, rgba(250,246,238,0), var(--cream) 34%); }
