:root {
  --bg: #f1f5f9;
  --surface: #ffffff;
  --navy: #0f172a;
  --text: #0f172a;
  --muted: #475569;
  --subtle: #64748b;
  --border: #cbd5e1;
  --border-light: #e2e8f0;
  --ice: #0284c7;
  --ice-dark: #0369a1;
  --ice-soft: #e0f2fe;
  --ok: #059669;
  --ok-soft: #d1fae5;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
}

.top-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-light);
  padding: 12px 16px 10px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.top-inner {
  max-width: 820px;
  margin: 0 auto;
}

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

.top-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
}

.sync-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--ice-soft);
  color: var(--ice-dark);
  white-space: nowrap;
}

.sync-badge.ok {
  background: var(--ok-soft);
  color: var(--ok);
}

.progress-track {
  width: 100%;
  height: 6px;
  background: var(--border-light);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--ice), #0ea5e9);
  transition: width 0.25s ease;
}

.hero {
  max-width: 820px;
  margin: 18px auto 0;
  padding: 0 14px;
}

.hero-card {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #f8fafc;
  border-radius: 16px;
  padding: 22px 22px 20px;
  box-shadow: var(--shadow);
}

.hero-kicker {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.28);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.hero-card h1 {
  margin: 0;
  font-size: clamp(19px, 2.6vw, 25px);
  font-weight: 800;
  line-height: 1.25;
}

.hero-card p {
  margin: 8px 0 0;
  color: #cbd5e1;
  font-size: 14px;
}

.container {
  max-width: 820px;
  margin: 14px auto 48px;
  padding: 0 14px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}

.q-num {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ice-dark);
  background: var(--ice-soft);
  padding: 2px 9px;
  border-radius: 999px;
  margin-bottom: 6px;
}

.card h2 {
  margin: 0 0 6px;
  font-size: 16.5px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.35;
}

.hint {
  margin: 0 0 10px;
  font-size: 13.5px;
  color: var(--muted);
}

.hint-list {
  margin: -4px 0 12px;
  padding-left: 20px;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.5;
}

.hint-list li {
  margin: 4px 0;
}

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

@media (min-width: 600px) {
  .meta-grid {
    grid-template-columns: 1fr 1fr;
  }
  .meta-grid .full {
    grid-column: 1 / -1;
  }
}

label.field-lbl {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 4px;
}

input[type="text"], textarea {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 12px;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

textarea {
  min-height: 82px;
  resize: vertical;
  line-height: 1.45;
}

input[type="text"]:focus, textarea:focus {
  border-color: var(--ice);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.13);
}

.submit-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 20px 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
}

.btn-submit {
  min-height: 50px;
  border: none;
  border-radius: 12px;
  background: var(--ice);
  color: #ffffff;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  padding: 12px 20px;
  transition: background 0.15s ease;
}

.btn-submit:hover { background: var(--ice-dark); }
.btn-submit:disabled { opacity: 0.6; cursor: wait; }

.success-banner {
  display: none;
  background: var(--ok-soft);
  border: 1px solid #6ee7b7;
  color: #065f46;
  border-radius: 12px;
  padding: 16px;
  font-size: 14.5px;
  font-weight: 600;
}

.success-banner.show { display: block; }

.acquirer-wrap {
  margin: 10px 0 14px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  overflow-x: auto;
  background: #ffffff;
}

table.acq-tbl {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
  font-size: 12.5px;
  line-height: 1.4;
}

table.acq-tbl th, table.acq-tbl td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
  border-right: 1px solid var(--border-light);
  vertical-align: top;
}

table.acq-tbl th:last-child, table.acq-tbl td:last-child {
  border-right: none;
}

table.acq-tbl th {
  background: #f8fafc;
  font-weight: 700;
  color: var(--navy);
  white-space: nowrap;
  border-bottom: 2px solid var(--border);
}

table.acq-tbl tr:last-child td { border-bottom: none; }
table.acq-tbl tr.group-end td { border-bottom: 2px solid var(--border); }
table.acq-tbl td.prov-cell {
  background: #f8fafc;
  font-weight: 700;
  color: var(--navy);
  white-space: nowrap;
  border-bottom: 2px solid var(--border);
}
table.acq-tbl tr.rec td { background: #f0f9ff; }
table.acq-tbl tr.rec td.prov-cell { background: #e0f2fe; }
.acq-note {
  margin: 0 0 12px;
  font-size: 12.5px;
  color: var(--subtle);
}

@media (min-width: 960px) {
  .card.card-wide {
    width: min(1280px, calc(100vw - 48px));
    position: relative;
    left: 50%;
    transform: translateX(-50%);
  }
  .card.card-wide table.acq-tbl {
    min-width: 0;
    font-size: 13px;
  }
}

/* ---------- Saved answers list (top of page) ---------- */
.saves-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}

.saves-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.saves-head h2 {
  margin: 0;
  font-size: 16px;
  color: var(--navy);
}

.saves-hint {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--muted);
}

.btn-link {
  border: 1px solid var(--border);
  background: #f8fafc;
  color: var(--navy);
  border-radius: 9px;
  padding: 6px 12px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.btn-link:hover { background: #eef2f7; }

.saves-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 340px;
  overflow-y: auto;
  padding-right: 2px;
}

.save-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 4px 12px;
  align-items: center;
  border: 1px solid var(--border-light);
  border-radius: 11px;
  padding: 10px 12px;
  background: #f8fafc;
}

.save-row.active {
  border-color: var(--ice);
  background: var(--ice-soft);
}

.save-num {
  font-size: 15px;
  font-weight: 800;
  color: var(--ice-dark);
  white-space: nowrap;
}

.save-meta {
  min-width: 0;
  font-size: 13px;
  line-height: 1.4;
}

.save-meta .who {
  font-weight: 700;
  color: var(--navy);
  overflow-wrap: anywhere;
}

.save-meta .sub {
  color: var(--subtle);
  font-size: 12.5px;
}

.save-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn-load {
  border: none;
  background: var(--ice);
  color: #ffffff;
  border-radius: 9px;
  padding: 7px 12px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

.btn-load:hover { background: var(--ice-dark); }

.saves-empty {
  font-size: 13.5px;
  color: var(--subtle);
  padding: 8px 0;
}

.undo-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  color: #92400e;
  font-size: 13px;
}

.undo-banner.show { display: flex; }

/* ---------- Info box inside a question ---------- */
.info-box {
  margin: 4px 0 12px;
  padding: 11px 14px;
  border-radius: 10px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  font-size: 13px;
  color: #0c4a6e;
}

.info-box strong.t {
  display: block;
  margin-bottom: 4px;
  color: var(--navy);
}

.info-box ul {
  margin: 4px 0 6px;
  padding-left: 18px;
}

.info-box li { margin: 2px 0; }

/* ---------- Bottom actions & device footnote ---------- */
.save-status {
  display: none;
  background: var(--ok-soft);
  border: 1px solid #6ee7b7;
  color: #065f46;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 14.5px;
  font-weight: 600;
}

.save-status.show { display: block; }

.footnote {
  margin: 4px 2px 0;
  font-size: 12px;
  color: var(--subtle);
  line-height: 1.45;
}

@media (max-width: 560px) {
  .save-row { grid-template-columns: 1fr; }
  .save-actions { justify-content: flex-start; }
}

/* ---------- Top instruction & confirmed TZ summary ---------- */
.how-box {
  margin-top: 12px;
  padding: 10px 13px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.24);
  font-size: 13px;
  line-height: 1.48;
  color: #f0f9ff;
}

.how-box strong { color: #ffffff; }

.tz-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--ice);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}

.tz-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.tz-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
}

.tz-sub {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--muted);
}

.tz-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 8px 14px;
}

.tz-item {
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 13px;
  line-height: 1.4;
}

.tz-item strong {
  display: block;
  font-size: 12px;
  color: var(--ice-dark);
  margin-bottom: 2px;
}
