.qr-hero { padding: 42px 0 30px; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 20px; color: var(--muted); font-size: 14px; }
.breadcrumbs a { color: var(--brand); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs span[aria-hidden] { color: #98a2b3; }
.qr-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.qr-hero h1 { margin: 0; font-size: clamp(2rem, 5vw, 3.35rem); line-height: 1.12; letter-spacing: -.035em; }
.qr-hero .lede { max-width: 650px; margin: 12px 0 0; color: var(--muted); font-size: 1.08rem; }
.privacy-pill { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 8px; margin-top: 7px; padding: 8px 12px; border: 1px solid #b9ddd8; border-radius: 999px; color: #115e59; background: #f0fdfa; font-size: 14px; font-weight: 600; }
.privacy-pill svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }

.generator-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(340px, .95fr); gap: 24px; align-items: start; padding-bottom: 56px; }
.panel { border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.94); box-shadow: 0 16px 42px rgba(15,23,42,.07); }
.config-panel { padding: clamp(22px, 3vw, 30px); }
.panel-heading { margin: 0 0 20px; font-size: 1.25rem; }
.field { margin-top: 20px; }
.field:first-of-type { margin-top: 0; }
.field-header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.field label, .field legend { color: #253244; font-weight: 600; }
.field legend { padding: 0; }
.field-hint, .character-count { color: var(--muted); font-size: 13px; }
.field-input, .field-select {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid #c8d0dc;
  border-radius: 9px;
  color: var(--ink);
  background: #fff;
  transition: border-color .16s ease, box-shadow .16s ease;
}
textarea.field-input { min-height: 138px; resize: vertical; }
.field-input:hover, .field-select:hover { border-color: #9aabba; }
.field-input:focus, .field-select:focus { border-color: var(--focus); outline: 0; box-shadow: 0 0 0 3px rgba(14,116,144,.16); }
.field-input[aria-invalid="true"] { border-color: var(--danger); }
.error-message { min-height: 1.45em; margin: 6px 0 0; color: var(--danger); font-size: 13px; }

.type-selector { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: #f3f6f9; }
.type-selector label { display: flex; min-height: 44px; align-items: center; justify-content: center; border-radius: 7px; color: var(--muted); font-weight: 600; cursor: pointer; }
.type-selector input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.type-selector label:has(input:checked) { color: var(--brand-dark); background: #fff; box-shadow: 0 2px 8px rgba(15,23,42,.08); }
.type-selector label:has(input:focus-visible) { outline: 3px solid rgba(14,116,144,.38); outline-offset: 2px; }

.button-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 17px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s ease, background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.button:active:not(:disabled) { transform: translateY(1px); }
.button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.button-primary { color: #fff; background: var(--brand); box-shadow: 0 8px 20px rgba(21,94,159,.22); }
.button-primary:hover:not(:disabled) { background: #124f87; }
.button-secondary { color: #344054; border-color: #cfd7e2; background: #fff; }
.button-secondary:hover:not(:disabled) { border-color: #9aabba; background: #f8fafc; }
.button:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }

.advanced { margin-top: 24px; border-top: 1px solid var(--line); }
.advanced-panel { grid-column: 1; margin-top: 0; padding: 14px clamp(22px, 3vw, 30px) clamp(22px, 3vw, 30px); }
.advanced summary { display: flex; min-height: 50px; align-items: center; justify-content: space-between; gap: 10px; padding-top: 15px; color: #253244; font-weight: 600; cursor: pointer; list-style: none; }
.advanced summary::-webkit-details-marker { display: none; }
.advanced summary::after { content: "+"; display: grid; width: 28px; height: 28px; place-items: center; border-radius: 50%; color: var(--brand); background: #e8f4ff; font-size: 21px; font-weight: 400; }
.advanced[open] summary::after { content: "−"; }
.advanced-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 16px; padding-top: 8px; }
.advanced-grid .field { margin: 0; }
.color-control { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 10px; border: 1px solid #c8d0dc; border-radius: 9px; background: #fff; }
.color-control input[type="color"] { width: 34px; height: 34px; padding: 0; border: 0; border-radius: 6px; background: transparent; cursor: pointer; }
.color-value { color: #344054; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; text-transform: uppercase; }
.contrast-message { grid-column: 1 / -1; margin: -5px 0 0; color: var(--muted); font-size: 13px; }
.contrast-message.is-warning { color: var(--danger); }
.logo-field { grid-column: 1 / -1; padding-top: 4px; border-top: 1px solid var(--line); }
.visually-hidden-input { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.visually-hidden-input:focus-visible + .logo-actions label { outline: 3px solid rgba(14,116,144,.42); outline-offset: 3px; }
.logo-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.logo-actions .button { flex: 0 0 auto; }
.logo-size-select { width: auto; min-width: 190px; flex: 1 1 190px; }
.logo-preview { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; align-items: center; gap: 12px; margin-top: 12px; padding: 10px; border: 1px solid #cfe0e8; border-radius: 10px; background: #f8fbfc; }
.logo-preview[hidden] { display: none; }
.logo-preview img { width: 120px; height: 64px; padding: 5px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.logo-preview span { min-width: 0; overflow: hidden; color: #344054; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.logo-preview .button { min-height: 40px; padding: 8px 12px; }
.logo-hint, .logo-h-notice { display: block; margin: 8px 0 0; }
.logo-h-notice { color: var(--green); }

.preview-panel { position: sticky; top: 92px; grid-column: 2; grid-row: 1 / span 2; padding: clamp(22px, 3vw, 30px); text-align: center; }
.preview-panel h2 { margin: 0; font-size: 1.25rem; text-align: left; }
.preview-stage { display: grid; min-height: 388px; place-items: center; margin-top: 18px; padding: 28px; border: 1px solid #dce3ec; border-radius: 14px; background: #f7f9fc; }
.preview-empty { max-width: 240px; color: var(--muted); }
.preview-empty svg { width: 48px; height: 48px; color: #8291a5; fill: none; stroke: currentColor; stroke-width: 1.5; }
.preview-empty strong { display: block; margin-top: 12px; color: #344054; font-size: 1rem; }
.preview-empty p { margin: 5px 0 0; font-size: 14px; }
#qr-canvas { display: block; max-width: 100%; height: auto; padding: 0; background: #fff; image-rendering: pixelated; }
#qr-canvas[hidden] { display: none; }
.preview-meta { margin: 12px 0 0; color: var(--muted); font-size: 13px; }
.download-button { width: 100%; margin-top: 16px; }

.education { padding: 6px 0 68px; }
.education-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.info-card { padding: 24px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.78); }
.info-card h2 { margin: 0; font-size: 1.2rem; }
.info-card p { margin: 8px 0 0; color: var(--muted); }
.uses-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.uses-list li { padding: 5px 9px; border: 1px solid #d8e0ea; border-radius: 999px; color: #475467; background: #fff; font-size: 13px; }

.toast-region { position: fixed; right: 18px; bottom: 18px; z-index: 50; display: grid; gap: 8px; pointer-events: none; }
.toast { max-width: min(360px, calc(100vw - 36px)); padding: 12px 16px; border-radius: 10px; color: #fff; background: #17324d; box-shadow: 0 12px 30px rgba(15,23,42,.22); animation: toast-in .2s ease-out; }
.toast.is-error { background: #7a271a; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 820px) {
  .qr-title-row { display: block; }
  .privacy-pill { margin-top: 18px; }
  .generator-layout { grid-template-columns: 1fr; }
  .preview-panel { position: static; grid-column: auto; grid-row: auto; }
  .advanced-panel { grid-column: auto; }
  .preview-stage { min-height: 340px; }
  .education-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .qr-hero { padding-top: 28px; }
  .config-panel, .preview-panel { padding: 18px; border-radius: 14px; }
  .advanced-panel { padding: 8px 18px 18px; border-radius: 14px; }
  .advanced-grid { grid-template-columns: 1fr; }
  .contrast-message { grid-column: auto; }
  .logo-field { grid-column: auto; }
  .logo-preview { grid-template-columns: 90px minmax(0, 1fr); }
  .logo-preview img { width: 90px; height: 56px; }
  .logo-preview .button { grid-column: 1 / -1; }
  .button-row .button { flex: 1 1 130px; }
  .preview-stage { min-height: 300px; padding: 18px; }
}
