:root {
  color-scheme: light;
  --bg: #f4f6fb;
  --panel: #ffffff;
  --panel-border: #d8e0ef;
  --text: #182133;
  --muted: #5f6c85;
  --accent: #2856f6;
  --accent-soft: #e6edff;
  --danger: #c63f4b;
  --shadow: 0 24px 50px rgba(24, 33, 51, 0.08);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Tahoma, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(40, 86, 246, 0.14), transparent 24%),
    linear-gradient(180deg, #f9fbff 0%, var(--bg) 100%);
}

button,
input,
textarea {
  font: inherit;
}

.page {
  width: min(1240px, calc(100% - 32px));
  margin: 32px auto 48px;
}

.panel {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.9fr);
  gap: 24px;
  padding: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 52px);
  line-height: 0.98;
}

.subtitle {
  margin: 18px 0 0;
  max-width: 56ch;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.5;
}

.hero-meta {
  display: grid;
  gap: 12px;
}

.meta-item,
.metric {
  padding: 18px 20px;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff, #f3f6ff);
  border: 1px solid #dde5f6;
}

.meta-item span,
.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.meta-item strong,
.metric strong {
  font-size: 22px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(340px, 0.9fr) minmax(360px, 1.1fr);
  gap: 24px;
  margin-top: 24px;
}

.search-panel,
.output-panel {
  padding: 24px;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.field span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.field input,
.field textarea {
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid #cfd8ed;
  background: #fbfcff;
  color: var(--text);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(40, 86, 246, 0.12);
}

.field.small {
  margin: 0;
}

.uuid-panel {
  margin-top: 24px;
  padding: 24px;
}

.uuid-panel-head h2 {
  margin: 0;
  font-size: 28px;
}

.uuid-hint {
  margin: 10px 0 20px;
  max-width: 70ch;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.uuid-status {
  margin: 12px 0 0;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid #d7e0f5;
  background: #f8faff;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  word-break: break-word;
}

.uuid-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.uuid-search .field {
  margin-bottom: 0;
}

.secondary {
  height: 52px;
  padding: 0 20px;
  border-radius: 16px;
  border: 1px solid rgba(40, 86, 246, 0.35);
  background: var(--accent-soft);
  color: #1734a7;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.secondary:hover,
.secondary:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 12px 24px rgba(40, 86, 246, 0.16);
  outline: none;
}

.uuid-status.error {
  border-color: rgba(198, 63, 75, 0.35);
  background: #fdf5f6;
  color: var(--danger);
}

.results {
  display: grid;
  gap: 10px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
  margin-bottom: 18px;
}

.result-item {
  width: 100%;
  padding: 16px;
  border: 1px solid #d9e1f3;
  border-radius: 18px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.result-item:hover,
.result-item:focus-visible,
.result-item.active {
  transform: translateY(-1px);
  border-color: rgba(40, 86, 246, 0.45);
  box-shadow: 0 14px 28px rgba(40, 86, 246, 0.12);
  outline: none;
}

.result-item strong,
.selection strong {
  display: block;
  font-size: 15px;
  line-height: 1.45;
}

.result-item span,
.selection span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.selection {
  min-height: 112px;
  padding: 18px;
  border-radius: 18px;
  background: #f8faff;
  border: 1px solid #dfe7f6;
}

.selection.empty {
  display: flex;
  align-items: center;
}

.selection.empty p {
  margin: 0;
  color: var(--muted);
}

.actions {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 16px;
  align-items: end;
}

.primary {
  height: 52px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(135deg, #2856f6 0%, #1734a7 100%);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(40, 86, 246, 0.24);
}

.primary:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  box-shadow: none;
}

.qr-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 20px;
  align-items: center;
}

.qr-frame {
  display: grid;
  place-items: center;
  min-height: 320px;
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(40, 86, 246, 0.08), rgba(40, 86, 246, 0.01)),
    #ffffff;
  border: 1px solid #d7e0f5;
}

.qr-frame img {
  width: 100%;
  max-width: 280px;
  height: auto;
  display: block;
}

.qr-frame p,
.qr-caption span,
.note {
  color: var(--muted);
  line-height: 1.55;
}

.code-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 22px 0 18px;
}

.metric strong {
  font-size: clamp(22px, 4vw, 30px);
}

.note {
  margin: 0;
  font-size: 14px;
}

.status-error {
  color: var(--danger);
}

.debug-details {
  margin: 18px 0 0;
  padding: 14px 16px;
  border-radius: 18px;
  background: #fbfcff;
  border: 1px solid #cfd8ed;
}

.debug-details summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.debug-content {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.debug-step {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid #dde5f6;
  background: linear-gradient(180deg, #ffffff, #f6f8ff);
}

.debug-step-title {
  font-weight: 700;
  margin: 0 0 6px;
}

.debug-step-desc {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.debug-step-value {
  margin: 0;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid #e3e9f6;
  background: #ffffff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 980px) {
  .hero,
  .layout,
  .qr-shell,
  .actions,
  .uuid-search,
  .code-grid {
    grid-template-columns: 1fr;
  }

  .qr-frame {
    min-height: 260px;
  }
}
