.page {
  flex: 1;
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ad-slot { display: flex; justify-content: center; }

/* ---------- Tool card ---------- */
.tool {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

/* ---------- Panels ---------- */
.panel { display: flex; flex-direction: column; gap: 8px; }

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 2px;
}
.panel-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  color: var(--muted);
  text-transform: uppercase;
}
.panel-meta {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--muted);
}

.panel textarea {
  width: 100%;
  min-height: 110px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  line-height: 1.7;
  resize: vertical;
  background: var(--surface);
  color: var(--ink);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.panel textarea::placeholder { color: var(--muted); }
.panel textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ---------- Options row ---------- */
.options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
}
.option {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
}
.option-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--muted);
  text-transform: uppercase;
}
.option select {
  appearance: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 10px;
  font-family: "Noto Sans JP", sans-serif;
  font-size: 13px;
  color: var(--ink);
  width: 100%;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.option select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ---------- Action bar ---------- */
.action-bar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin: 18px 0;
}

.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-family: "Noto Sans JP", sans-serif;
  font-weight: 600;
  font-size: 14px;
  padding: 12px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 80ms ease, background 140ms ease, border-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
  user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn svg { flex-shrink: 0; }

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  font-weight: 700;
}
.btn.primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); }

.btn.secondary {
  background: var(--surface);
  border: 1px solid var(--accent);
  color: var(--accent-deep);
}
.btn.secondary:hover { background: var(--accent-soft); }

.btn.ghost {
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--border);
  font-weight: 500;
  padding: 12px 14px;
}
.btn.ghost:hover {
  background: var(--danger-soft);
  border-color: var(--danger-soft);
  color: var(--danger);
}

.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 2px 6px;
  color: var(--muted);
}
.divider .line { flex: 1; height: 1px; background: var(--border); }
.divider .label {
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.18em;
}

/* ---------- QR result ---------- */
.qr-stage {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  min-height: 260px;
  justify-content: center;
}
.qr-frame {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px -6px rgba(0,0,0,0.12);
}
.qr-frame img,
.qr-frame canvas {
  display: block;
  width: 220px !important;
  height: 220px !important;
}
.qr-placeholder {
  width: 220px;
  height: 220px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  border: 2px dashed var(--border);
  border-radius: 10px;
  background:
    repeating-linear-gradient(
      45deg,
      transparent 0 6px,
      rgba(0,0,0,0.025) 6px 12px
    );
}
.qr-summary {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-align: center;
  word-break: break-all;
  max-width: 100%;
  line-height: 1.6;
}
.qr-summary b { color: var(--sub); font-weight: 600; }

.result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}
.result-actions .btn { padding: 11px 14px; font-size: 13px; }

/* ---------- Badge ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid transparent;
}
.badge::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.badge.ready {
  background: #dcfce7;
  color: #15803d;
  border-color: #bbf7d0;
}
.badge.hidden { display: none; }

/* ---------- About ---------- */
.about { margin-top: 16px; }

code.inline {
  font-family: "JetBrains Mono", monospace;
  font-size: 12.5px;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 5px;
  color: var(--ink);
}

@media (max-width: 900px) {
  .options { grid-template-columns: 1fr 1fr; }
  .action-bar { grid-template-columns: 1fr; }
}
