:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --primary: #7886f6;
  --primary-dark: #5d69dc;
  --primary-soft: #eef0ff;
  --cyan: #43afe4;
  --tech-line: rgba(87, 116, 190, .18);
  --danger: #c23e3e;
  --danger-soft: #fff1f1;
  --warning: #9b650d;
  --warning-soft: #fff7df;
  --info: #3562c9;
  --info-soft: #eef4ff;
  --radius: 14px;
  --shadow: 0 8px 30px rgba(31, 41, 55, .07);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }

html { min-width: 320px; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 10%, rgba(183, 222, 255, .48) 0, rgba(183, 222, 255, 0) 32%),
    radial-gradient(circle at 88% 15%, rgba(208, 201, 255, .5) 0, rgba(208, 201, 255, 0) 34%),
    radial-gradient(circle at 52% 100%, rgba(246, 205, 238, .3) 0, rgba(246, 205, 238, 0) 38%),
    linear-gradient(135deg, #f7fbff 0%, #f5f5ff 52%, #fff8fc 100%);
  background-attachment: fixed;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  z-index: 0;
  inset: 0;
  background-image:
    linear-gradient(rgba(45, 111, 136, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(45, 111, 136, .045) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, .45) 58%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, .45) 58%, transparent 100%);
}

button,
input,
textarea { font: inherit; }

button { color: inherit; }

.hide { display: none !important; }

.page-shell {
  position: relative;
  z-index: 1;
  width: min(900px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(42px, 7vh, 76px) 0 34px;
}

.hero {
  position: relative;
  padding: 6px 20px 38px;
  text-align: center;
}

.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: min(680px, 100%);
  height: 250px;
  top: -28px;
  left: 50%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(114, 190, 255, .24) 0%, rgba(164, 149, 255, .12) 46%, transparent 72%);
  filter: blur(6px);
  transform: translateX(-50%);
  pointer-events: none;
}

.hero h1 {
  position: relative;
  display: inline-block;
  margin: 0;
  color: #6683ef;
  background: linear-gradient(90deg, #776eef 0%, #687fed 28%, #4ca9e7 44%, #55aee9 52%, #7c8fee 64%, #9279ed 78%, #776eef 100%);
  background-size: 135% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: clamp(58px, 7vw, 82px);
  font-weight: 850;
  line-height: 1;
  letter-spacing: .055em;
  text-indent: .055em;
}

.hero h1::before {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 0%, transparent 38%, rgba(255, 255, 255, .82) 49%, transparent 60%, transparent 100%);
  background-size: 42% 100%;
  background-repeat: no-repeat;
  background-position: -75% 0;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: titleLightSweep 2.6s linear infinite;
  pointer-events: none;
}

.hero h1::after {
  content: "";
  position: absolute;
  width: 58%;
  height: 3px;
  left: 21%;
  bottom: -12px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent 0%, #7ecbff 22%, #f4f1ff 50%, #a58aff 78%, transparent 100%);
  box-shadow: 0 0 14px rgba(116, 144, 241, .5);
}

@keyframes titleLightSweep {
  from { background-position: -75% 0; }
  to { background-position: 175% 0; }
}

.hero h2 {
  margin: 20px 0 0;
  color: #3f5269;
  font-size: 22px;
  line-height: 1.3;
  letter-spacing: .13em;
}

.hero p {
  margin: 14px 0 0;
  color: #72879b;
  font-size: 15px;
}

.tutorial-btn {
  margin-top: 22px;
  min-height: 46px;
  padding: 5px 10px 5px 6px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #48536c;
  background:
    linear-gradient(rgba(255, 255, 255, .94), rgba(248, 250, 255, .94)) padding-box,
    linear-gradient(135deg, #9d8af6, #55b9eb) border-box;
  box-shadow: 0 9px 24px rgba(91, 111, 205, .13), inset 0 1px 0 rgba(255, 255, 255, .8);
  cursor: pointer;
  font-size: 14px;
  font-weight: 750;
  transition: transform .16s ease, box-shadow .16s ease;
}

.tutorial-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(91, 111, 205, .19), inset 0 1px 0 rgba(255, 255, 255, .9);
}

.tutorial-btn-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  box-shadow: 0 5px 13px rgba(98, 114, 220, .24);
  font-size: 10px;
  text-indent: 2px;
}

.tutorial-btn-label { color: inherit; }

.tutorial-btn-arrow {
  color: #91a0b6;
  font-size: 13px;
}

.mode-tabs {
  margin-bottom: 16px;
  padding: 5px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid rgba(255, 255, 255, .64);
  border-radius: 14px;
  background: rgba(232, 237, 248, .46);
  box-shadow: 0 12px 34px rgba(78, 91, 151, .1), inset 0 1px 0 rgba(255, 255, 255, .78);
  backdrop-filter: blur(22px) saturate(155%);
  -webkit-backdrop-filter: blur(22px) saturate(155%);
}

.mode-tab {
  min-height: 48px;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
}

.mode-tab.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(111, 126, 244, .9) 0%, rgba(61, 173, 226, .88) 100%);
  box-shadow: 0 8px 22px rgba(92, 108, 213, .24), inset 0 1px 0 rgba(255, 255, 255, .34);
}

.content-stack { display: grid; gap: 16px; }

.steps {
  padding: 10px 20px 16px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.step-pill {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: #89949f;
  font-size: 14px;
  font-weight: 650;
}

.step-pill:not(:last-child)::after {
  content: "";
  position: absolute;
  width: calc(100% - 84px);
  height: 2px;
  top: 50%;
  left: calc(50% + 42px);
  border-radius: 999px;
  background: #dfe4ef;
}

.step-pill.complete:not(:last-child)::after {
  background: linear-gradient(90deg, var(--primary), var(--cyan));
}

.step-pill .number {
  position: relative;
  z-index: 1;
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--card);
  font-size: 12px;
}

.step-pill .label {
  position: relative;
  z-index: 1;
}

.step-pill.active { color: var(--primary-dark); }

.step-pill.active .number {
  color: #fff;
  border-color: var(--primary);
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  box-shadow: 0 0 0 4px rgba(105, 123, 235, .12);
}

.step-pill.complete { color: var(--primary); }

.step-pill.complete .number {
  color: var(--primary);
  border-color: #bdc5ff;
  background: var(--primary-soft);
  font-size: 0;
}

.step-pill.complete .number::after {
  content: "✓";
  font-size: 11px;
}

.card {
  position: relative;
  overflow: hidden;
  padding: clamp(30px, 4vw, 40px);
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(255, 255, 255, .66) 0%, rgba(245, 249, 255, .4) 54%, rgba(249, 244, 255, .38) 100%);
  box-shadow:
    0 26px 70px rgba(65, 76, 145, .16),
    inset 0 1px 0 rgba(255, 255, 255, .92),
    inset 0 -1px 0 rgba(105, 123, 200, .12);
  backdrop-filter: blur(28px) saturate(165%);
  -webkit-backdrop-filter: blur(28px) saturate(165%);
  animation: cardIn .2s ease both;
}

.flow-panel {
  min-height: 320px;
  animation: none;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, transparent 2%, rgba(126, 141, 255, .68) 24%, rgba(86, 197, 236, .75) 52%, rgba(153, 128, 246, .62) 78%, transparent 98%);
  opacity: .82;
}

@keyframes cardIn {
  from { opacity: .35; }
  to { opacity: 1; }
}

.card-head { margin-bottom: 27px; }

.section-kicker {
  display: block;
  margin-bottom: 7px;
  color: var(--cyan);
  font-size: 13px;
  font-weight: 750;
}

.card-head h2,
.tutorial-head h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1.25;
  letter-spacing: -.02em;
}

.sub {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.field-label {
  margin-bottom: 9px;
  display: block;
  color: #4b5563;
  font-size: 14px;
  font-weight: 650;
}

.field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
}

input,
textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, .82);
  border-radius: 12px;
  outline: none;
  color: var(--text);
  background: rgba(255, 255, 255, .52);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .86), 0 4px 16px rgba(74, 90, 152, .06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color .15s ease, box-shadow .15s ease;
}

input {
  min-height: 52px;
  padding: 0 16px;
  font-family: var(--mono);
  font-size: 15px;
}

textarea {
  min-height: 155px;
  padding: 14px 16px;
  resize: vertical;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.6;
}

input::placeholder,
textarea::placeholder { color: #a7adb5; }

input:focus,
textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 4px rgba(105, 123, 235, .12), 0 8px 22px rgba(87, 132, 222, .08);
}

textarea:disabled,
input:disabled {
  color: #8f949b;
  background: #f3f4f6;
  cursor: not-allowed;
}

.btn {
  min-height: 46px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 9px;
  text-decoration: none;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  transition: background .15s ease, border-color .15s ease, opacity .15s ease;
}

.btn.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, var(--cyan) 100%);
  box-shadow: 0 8px 20px rgba(99, 111, 222, .2);
}

.btn.primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--primary-dark) 0%, #398fc5 100%);
  box-shadow: 0 10px 24px rgba(91, 105, 207, .25);
}

.btn.ghost,
.btn.outline {
  color: #4b5563;
  border-color: var(--line);
  background: #fff;
}

.btn.ghost:hover:not(:disabled),
.btn.outline:hover:not(:disabled) { background: #f4f5f7; }

.btn:disabled,
.copy-cards-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.actions {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.actions.spread { justify-content: space-between; }

.action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.verified-banner {
  margin-bottom: 25px;
  padding: 13px 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 9px;
  color: var(--primary-dark);
  background: var(--primary-soft);
}

.verified-icon {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

.verified-banner > div {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
}

.verified-banner strong { font-size: 14px; }

.verified-banner code {
  overflow: hidden;
  font: 13px/1.6 var(--mono);
  text-overflow: ellipsis;
}

.login-link,
.token-link {
  min-height: 50px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(91, 125, 218, .24);
  border-radius: 10px;
  color: var(--primary-dark);
  background: linear-gradient(135deg, var(--primary-soft), #edf7ff);
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
}

.login-link:hover,
.token-link:hover { border-color: var(--primary); }

.token-link {
  width: max-content;
  min-height: 38px;
  margin: -10px 0 14px;
  gap: 8px;
}

.notice {
  margin-top: 22px;
  padding: 12px 14px;
  border-radius: 8px;
  color: #7c5b1d;
  background: var(--warning-soft);
  font-size: 14px;
}

.result {
  margin-top: 16px;
  padding: 13px 14px;
  border-radius: 9px;
  color: var(--info);
  background: var(--info-soft);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.field-feedback:not(:empty) {
  margin-bottom: 18px;
}

.field-feedback > .result {
  margin-top: 0;
}

.result.ok { color: var(--primary-dark); background: var(--primary-soft); }
.result.bad { color: var(--danger); background: var(--danger-soft); }
.result.wait { color: var(--warning); background: var(--warning-soft); }
.result.info { color: var(--info); background: var(--info-soft); }

.status-title,
.success-title {
  margin-bottom: 7px;
  font-size: 15px;
  font-weight: 750;
}

.success-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 17px;
}

.success-title span {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 11px;
}

.rows {
  margin-top: 9px;
  border-top: 1px solid rgba(107, 114, 128, .2);
}

.row {
  padding: 8px 0;
  display: grid;
  grid-template-columns: 125px minmax(0, 1fr);
  gap: 12px;
  border-bottom: 1px solid rgba(107, 114, 128, .16);
}

.row:last-child { border-bottom: 0; }

.row .key {
  color: var(--muted);
  font-size: 13px;
}

.row .value {
  min-width: 0;
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  text-align: right;
  overflow-wrap: anywhere;
}

.badge {
  padding: 4px 7px;
  display: inline-flex;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
}

.badge.ok { color: var(--primary-dark); background: #e4e8ff; }
.badge.bad { color: var(--danger); background: #ffe1e1; }
.badge.wait { color: var(--warning); background: #ffedb8; }

.coverage-note,
.result-note {
  margin-top: 10px;
  padding: 9px 10px;
  border-radius: 7px;
  background: rgba(255, 255, 255, .55);
  font-size: 13px;
}

.query-card { margin-top: 16px; }

.query-result-toolbar {
  margin-top: 20px;
  padding-top: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
}

.summary-strip,
.query-copy-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.summary-chip,
.copy-cards-btn {
  min-height: 29px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: #4b5563;
  background: #fff;
  font-size: 12px;
  font-weight: 700;
}

.summary-chip.ok { color: var(--primary-dark); background: var(--primary-soft); }
.summary-chip.wait { color: var(--warning); background: var(--warning-soft); }
.summary-chip.bad { color: var(--danger); background: var(--danger-soft); }

.copy-cards-btn { cursor: pointer; }

.copy-cards-btn.unused {
  color: var(--primary-dark);
  border-color: #cfd5ff;
  background: var(--primary-soft);
}

.copy-cards-btn.used {
  color: var(--warning);
  border-color: #f0d38a;
  background: var(--warning-soft);
}

.copy-cards-btn.unused:hover:not(:disabled) {
  border-color: #aab5fb;
  background: #e1e5ff;
}

.copy-cards-btn.used:hover:not(:disabled) {
  border-color: #dcbb69;
  background: #ffedbd;
}

.table-wrap {
  margin-top: 10px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12px;
}

.table th,
.table td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.table th {
  color: #4b5563;
  background: #f7f8f9;
  font-size: 12px;
}

.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafcfb; }
.col-card { width: 170px; }
.col-status { width: 80px; }
.col-email { width: 160px; }
.col-id { width: 150px; }
.col-created,
.col-finished { width: 150px; }

.cell-value {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-card,
.cell-id,
.cell-time { font-family: var(--mono); }

.footer {
  padding: 24px 4px 0;
  color: #969ca5;
  font-size: 13px;
  text-align: center;
}

.toast {
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: 24px;
  max-width: calc(100% - 32px);
  padding: 10px 14px;
  border-radius: 8px;
  color: #fff;
  background: #1f2937;
  opacity: 0;
  transform: translate(-50%, 10px);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  font-size: 12px;
  text-align: center;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }
body.modal-open { overflow: hidden; }

.tutorial-modal {
  position: fixed;
  z-index: 200;
  inset: 0;
  padding: 20px;
  display: grid;
  place-items: center;
}

.tutorial-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, .72);
}

.tutorial-dialog {
  position: relative;
  width: min(760px, 100%);
  overflow: hidden;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .24);
}

.tutorial-head {
  min-height: 60px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

.tutorial-head h2 { font-size: 17px; }

.tutorial-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tutorial-open-link {
  color: var(--primary-dark);
  text-decoration: none;
  font-size: 11px;
  font-weight: 650;
}

.tutorial-close {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 20px;
}

.tutorial-player { padding: 12px; background: #111827; }

.tutorial-video-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #05080d;
}

.tutorial-video-wrap video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  cursor: pointer;
}

.tutorial-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-align: center;
}

.tutorial-empty p { margin: 5px 0 0; color: #9ca3af; font-size: 11px; }

.tutorial-controls {
  padding-top: 10px;
  display: grid;
  grid-template-columns: 34px auto minmax(80px, 1fr) 34px 34px;
  align-items: center;
  gap: 8px;
  color: #fff;
}

.tutorial-controls button {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid #374151;
  border-radius: 7px;
  color: #fff;
  background: #1f2937;
  cursor: pointer;
}

.tutorial-time { font: 10px/1 var(--mono); }

#tutorialSeek {
  min-height: 0;
  height: 4px;
  padding: 0;
  border: 0;
  box-shadow: none;
  accent-color: var(--primary);
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(105, 123, 235, .25);
  outline-offset: 2px;
}

@media (max-width: 600px) {
  html,
  body {
    height: 100%;
    overflow: hidden;
  }

  .page-shell {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .hero {
    flex: 0 0 auto;
    padding: 0 4px 8px;
  }

  .hero::before { height: 100px; top: -18px; }
  .hero h1 { font-size: clamp(34px, 11vw, 44px); }
  .hero h1::after { height: 2px; bottom: -7px; }
  .hero h2 { margin-top: 11px; font-size: 13px; letter-spacing: .06em; }
  .hero p { display: none; }

  .tutorial-btn {
    min-height: 34px;
    margin-top: 8px;
    padding: 3px 8px 3px 4px;
    gap: 6px;
    font-size: 12px;
  }

  .tutorial-btn-icon { width: 27px; height: 27px; font-size: 8px; }
  .tutorial-btn-arrow { font-size: 11px; }

  .mode-tabs {
    flex: 0 0 auto;
    margin-bottom: 7px;
    padding: 3px;
    border-radius: 10px;
  }

  .mode-tab {
    min-height: 36px;
    border-radius: 8px;
    font-size: 13px;
  }

  .content-stack {
    min-height: 0;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 7px;
  }

  .steps {
    flex: 0 0 auto;
    padding: 3px 2px 7px;
  }

  .step-pill { gap: 4px; font-size: 10px; }

  .step-pill:not(:last-child)::after {
    display: block;
    width: calc(100% - 58px);
    left: calc(50% + 29px);
  }

  .step-pill .number { width: 22px; height: 22px; font-size: 10px; }

  .card {
    padding: 16px;
    border-radius: 13px;
  }

  .flow-panel {
    min-height: 0;
    flex: 1 1 auto;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .card-head { margin-bottom: 12px; }
  .section-kicker { margin-bottom: 3px; font-size: 10px; }
  .card-head h2 { font-size: 21px; }
  .sub { margin-top: 4px; font-size: 12px; }
  .field-label { margin-bottom: 5px; font-size: 12px; }

  input { min-height: 42px; padding: 0 11px; font-size: 13px; }
  textarea { min-height: 82px; padding: 9px 11px; font-size: 12px; }

  .field-row { grid-template-columns: 1fr; }
  .field-row .btn { min-height: 40px; }

  .btn { min-height: 40px; padding: 0 14px; font-size: 13px; }
  .actions { margin-top: 12px; gap: 7px; }
  .verified-banner { margin-bottom: 12px; padding: 8px 10px; }
  .login-link,
  .token-link { min-height: 40px; padding: 0 11px; font-size: 13px; }
  .token-link { margin: -3px 0 9px; }
  .field-feedback:not(:empty) { margin-bottom: 10px; }
  .result { padding: 9px 10px; font-size: 12px; }
  .notice { margin-top: 12px; padding: 8px 10px; font-size: 11px; }

  .query-card {
    min-height: 0;
    flex: 1 1 auto;
    margin-top: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .row { grid-template-columns: 1fr; gap: 2px; }
  .row .value { text-align: left; }

  .query-result-toolbar { align-items: flex-start; flex-direction: column; }
  .footer { display: none; }

  .tutorial-modal { padding: 0; }
  .tutorial-dialog { width: 100%; border-radius: 0; }
  .tutorial-open-link { display: none; }
  .tutorial-controls { grid-template-columns: 32px minmax(80px, 1fr) 32px 32px; }
  .tutorial-time { display: none; }
}

@media (max-width: 420px) {
  .page-shell { padding-inline: 9px; }
  .hero h1 { font-size: 34px; }
  .hero h2 { font-size: 12px; }
  .step-pill .label { font-size: 9px; }
  .card { padding: 14px; }
  .actions.spread { align-items: stretch; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
