:root {
  --ink: #20233b;
  --muted: #6f7488;
  --line: #e7e8f0;
  --canvas: #f8f8fc;
  --surface: #ffffff;
  --primary: #5b56e8;
  --primary-dark: #4942cf;
  --primary-soft: #eeedff;
  --blue: #3477dc;
  --blue-soft: #eaf2ff;
  --green: #188c6d;
  --green-soft: #e8f8f2;
  --orange: #af6b1b;
  --orange-soft: #fff4e5;
  --red: #c24d5a;
  --red-soft: #fff0f2;
}

* { box-sizing: border-box; }
body {
  min-width: 320px;
  margin: 0;
  background: radial-gradient(circle at 50% -20%, #ecebff 0, transparent 38%), var(--canvas);
  color: var(--ink);
  font: 15px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, textarea { font: inherit; }
button { cursor: pointer; }

.page-shell { width: min(1040px, calc(100% - 40px)); margin: 0 auto; padding: 24px 0 36px; }
.site-header { height: 52px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); font-weight: 780; letter-spacing: -.25px; text-decoration: none; }
.brand-mark { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 9px; background: linear-gradient(145deg, #8a86fb, #5853df); color: white; font: 700 17px Georgia, serif; box-shadow: 0 6px 15px #d8d7ff; }
.plan-badge { border: 1px solid #dddffd; border-radius: 999px; background: rgba(255,255,255,.7); color: #605db4; padding: 6px 10px; font-size: 11px; font-weight: 700; }

.hero { max-width: 610px; margin: 76px auto 42px; text-align: center; }
.eyebrow { margin: 0 0 10px; color: #7773ca; font-size: 10px; font-weight: 800; letter-spacing: 1.45px; }
.hero h1 { margin: 0; letter-spacing: -1.35px; font-size: clamp(30px, 5vw, 44px); line-height: 1.13; }
.hero > p:last-child { margin: 15px auto 0; color: var(--muted); font-size: 15px; }

.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.action-card { min-height: 414px; padding: 29px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 16px 38px rgba(39,42,75,.065); }
.redeem-card { border-top: 3px solid var(--primary); }
.query-card { border-top: 3px solid var(--blue); }
.card-icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 11px; font-size: 18px; font-weight: 800; }
.card-icon.purple { background: var(--primary-soft); color: var(--primary); }
.card-icon.blue { background: var(--blue-soft); color: var(--blue); }
.card-heading { margin: 16px 0 23px; }
.card-heading h2 { margin: 0; font-size: 19px; letter-spacing: -.35px; }
.card-heading p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }

.field-label { display: block; margin: 17px 0 7px; font-size: 12px; font-weight: 760; }
.text-field { width: 100%; border: 1px solid #dfe1eb; border-radius: 9px; outline: 0; background: #fff; color: var(--ink); padding: 11px 12px; transition: border-color .18s, box-shadow .18s; }
.text-field::placeholder { color: #a8adbb; }
.text-field:focus { border-color: #8c88f6; box-shadow: 0 0 0 3px rgba(91,86,232,.11); }
.session-field { resize: vertical; min-height: 102px; line-height: 1.45; }
.field-help { margin: 7px 0 17px; color: #8d92a2; font-size: 10px; }
.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; font-weight: 750; transition: background .18s, transform .18s; }
.primary-button { width: 100%; min-height: 43px; border: 1px solid var(--primary); background: var(--primary); color: #fff; box-shadow: 0 7px 15px rgba(91,86,232,.18); }
.primary-button:hover { background: var(--primary-dark); }
.primary-button:active, .secondary-button:active { transform: scale(.985); }
.primary-button span { margin-left: 6px; font-size: 17px; }
.query-input-row,
.redeem-code-row { display: flex; gap: 8px; }
.query-input-row .text-field,
.redeem-code-row .text-field { min-width: 0; }
.secondary-button { flex: 0 0 auto; border: 1px solid #cbd8f2; background: #f7faff; color: #336fc5; padding: 0 17px; }
.secondary-button:hover { background: var(--blue-soft); }
.secondary-button:disabled { cursor: not-allowed; opacity: .66; }
.verify-button { min-height: 43px; }

.status-message { display: flex; align-items: center; gap: 8px; margin-top: 16px; border-radius: 9px; padding: 10px 11px; font-size: 12px; }
.status-message::before { content: ""; width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; }
.status-message.processing { background: var(--primary-soft); color: #4c48bc; }
.status-message.processing::before { background: var(--primary); box-shadow: 0 0 0 4px rgba(91,86,232,.11); }
.status-message.success { background: var(--green-soft); color: var(--green); }
.status-message.success::before { background: var(--green); }
.status-message.error { background: var(--red-soft); color: var(--red); }
.status-message.error::before { background: var(--red); }
.status-message.task-status { align-items: flex-start; }
.task-status-content { display: grid; gap: 4px; line-height: 1.45; }
.task-status-content strong { font-size: 13px; }
.task-status-content span { color: inherit; }
.task-status-content small { color: currentColor; opacity: .74; font-weight: 700; }

.code-validation { margin-top: 8px; border-radius: 9px; padding: 9px 10px; font-size: 11px; }
.code-validation.empty { background: #f4f5f9; color: #7d8494; }
.code-validation.checking { background: var(--primary-soft); color: #4c48bc; }
.code-validation.success { background: var(--green-soft); color: var(--green); }
.code-validation.error { background: var(--red-soft); color: var(--red); }

.query-result { display: flex; align-items: flex-start; gap: 11px; min-height: 112px; margin-top: 22px; border: 1px solid var(--line); border-radius: 11px; padding: 16px; }
.result-icon { display: grid; width: 29px; height: 29px; flex: 0 0 29px; place-items: center; border-radius: 8px; background: #f0f1f5; color: #8a91a0; font-size: 14px; font-weight: 800; }
.query-result strong { display: block; font-size: 13px; }
.query-result p { margin: 4px 0 0; color: #858b9a; font-size: 11px; }
.query-result.used { border-color: #c8ecdf; background: #fbfffd; }
.query-result.used .result-icon { background: var(--green-soft); color: var(--green); }
.query-result.unused { border-color: #f4dfbd; background: #fffdfa; }
.query-result.unused .result-icon { background: var(--orange-soft); color: var(--orange); }
.query-result.not-found, .query-result.error { border-color: #f2d0d5; background: #fffdfd; }
.query-result.not-found .result-icon, .query-result.error .result-icon { background: var(--red-soft); color: var(--red); }
.result-email { display: block; margin-top: 10px; border-radius: 6px; background: var(--green-soft); color: #237761; padding: 5px 7px; font: 700 11px ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }

.batch-query-form {
  margin-top: 20px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.batch-query-field {
  resize: vertical;
  min-height: 106px;
  line-height: 1.45;
}

.batch-query-button {
  width: 100%;
  min-height: 40px;
  margin-top: 10px;
}

.batch-query-result {
  display: grid;
  gap: 8px;
  margin-top: 13px;
}

.batch-query-row {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  padding: 10px 11px;
}

.batch-query-row strong {
  font: 800 11px ui-monospace, SFMono-Regular, Menlo, monospace;
  overflow-wrap: anywhere;
}

.batch-query-row span {
  color: var(--muted);
  font-size: 11px;
}

.batch-query-row.used {
  border-color: #c8ecdf;
  background: #fbfffd;
}

.batch-query-row.unused {
  border-color: #f4dfbd;
  background: #fffdfa;
}

.batch-query-row.not_found,
.batch-query-row.error {
  border-color: #f2d0d5;
  background: #fffdfd;
}

.notice { display: flex; align-items: center; gap: 9px; max-width: 660px; margin: 24px auto 0; color: #73798a; font-size: 11px; }
.notice span { display: grid; width: 25px; height: 25px; flex: 0 0 25px; place-items: center; border-radius: 7px; background: #eceef4; color: #687185; }
.notice p { margin: 0; }
footer { margin-top: 54px; color: #a1a5b1; font-size: 10px; text-align: center; }

@media (max-width: 760px) {
  .page-shell { width: min(100% - 28px, 520px); padding-top: 15px; }
  .site-header { height: 42px; }
  .hero { margin: 53px auto 29px; }
  .hero > p:last-child { font-size: 13px; }
  .action-grid { grid-template-columns: 1fr; }
  .action-card { min-height: auto; padding: 24px 20px; }
  footer { margin-top: 37px; }
}

@media (max-width: 390px) {
  .plan-badge { font-size: 9px; padding: 5px 7px; }
  .query-input-row,
  .redeem-code-row { display: grid; }
  .secondary-button { min-height: 40px; }
}
