/* Generátor QR kódů, říjen 2026. Načítá se jen na stránce generátoru.
   Barvy, písmo, pole formuláře a tlačítka přebírá z pomucky.css a nove-pomucky.css. */

/* Rozložení: kroky vlevo, náhled vpravo. Na úzké obrazovce je náhled až za všemi kroky. */
.qrg-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); gap: 36px; align-items: start; }
.qrg-steps { display: grid; gap: 14px; min-width: 0; }
.qrg-preview { position: sticky; top: 100px; min-width: 0; padding: 2px; }
/* Na nízkém okně by se spodek panelu nevešel: panel se pak neposouvá s oknem */
@media (max-height: 640px) { .qrg-preview { position: static; } }
@media (max-width: 960px) {
  .qrg-layout { grid-template-columns: minmax(0, 1fr); }
  .qrg-preview { position: static; margin-top: 18px; padding-top: 26px; border-top: 1px solid var(--border); }
  .qrg-stage { width: 100%; }
}

/* Kroky */
.qrg-step + .qrg-step { margin-top: 22px; padding-top: 30px; border-top: 1px solid var(--border); }
.new-tool .qrg-step h2, .new-tool .qrg-preview h2 { display: flex; align-items: center; gap: 12px; font-size: clamp(22px, 2.3vw, 27px); margin: 0 0 6px; }
.new-tool .qrg-preview h2 { margin-bottom: 14px; }
.qrg-sub { margin: 0 0 18px; }
.qrg-num { display: inline-grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--green); color: #fff; font-size: 16px; font-weight: 800; line-height: 1; }
.qrg-num::before { content: attr(data-n); }
.qrg-num--narrow { display: none; }
@media (max-width: 960px) { .qrg-num--narrow { display: inline-grid; } }
.qrg-opt { font-weight: 400; color: var(--muted); }
.qrg-panel { margin-top: 20px; }
.qrg-panel[hidden] { display: none; }
.qrg-label { margin: 20px 0 10px; font-weight: 650; color: var(--green-dark); }
.t-field label output { margin-left: 6px; font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; }
#qrg-status { margin: 10px 0 0; }
#qrg-status:empty { min-height: 0; }
.qrg-raw { margin-top: 10px; font-size: 14px; }
.qrg-raw summary { cursor: pointer; color: var(--muted); }
.qrg-raw pre { margin: 8px 0 0; padding: 12px; max-height: 170px; overflow: auto; background: var(--green-soft); border-radius: 12px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; }

/* Typ obsahu: stejné "pilulky" jako odkazy na kategorie */
.qrg-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.qrg-chip { position: relative; }
.qrg-chip input, .qrg-seg input, .qrg-tile input { position: absolute; width: 1px; height: 1px; margin: -1px; opacity: 0; overflow: hidden; }
.qrg-chip span { display: inline-flex; align-items: center; min-height: 44px; padding: 9px 18px; border: 1px solid var(--border); border-radius: 999px; background: #fff; color: var(--green-dark); cursor: pointer; transition: background-color .18s ease, border-color .18s ease, color .18s ease; }
.qrg-chip span:hover { border-color: rgba(31, 95, 58, .4); background: var(--green-soft); }
.qrg-chip input:checked + span { background: var(--green); border-color: var(--green); color: #fff; font-weight: 700; }
.qrg-chip input:focus-visible + span, .qrg-seg input:focus-visible + span, .qrg-tile input:focus-visible + span { outline: 3px solid var(--gold-light); outline-offset: 3px; }

/* Předvolby podle použití (karty .mode-option z pomucky.css) */
.mode-switch.qrg-presets { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.qrg-presets .mode-option > span { min-height: 74px; padding: 12px 16px; }
.qrg-presets .mode-option strong { font-size: 16px; line-height: 1.3; }
.qrg-distance { margin-top: 16px; max-width: 280px; }
.qrg-preset-hint { margin: 16px 0 0; padding: 14px 16px; border-radius: 14px; background: var(--green-soft); color: var(--green-dark); font-size: 15px; }

/* Nepovinné kroky jako rozbalovací karty (vzhled podle .faq-item) */
.qrg-optional-title { margin: 30px 0 0; padding-top: 28px; border-top: 1px solid var(--border); font-size: 18px; font-weight: 800; color: var(--green-dark); }
.qrg-more { border: 1px solid var(--border); border-radius: 16px; background: #fff; box-shadow: 0 8px 24px rgba(31, 95, 58, .05); scroll-margin-top: 110px; }
.qrg-more[open] { border-color: rgba(31, 95, 58, .34); }
.qrg-more > summary { display: flex; align-items: center; gap: 12px; padding: 14px 20px; cursor: pointer; font-size: 18px; font-weight: 800; color: var(--green-dark); list-style: none; }
.qrg-more > summary::-webkit-details-marker { display: none; }
.qrg-more > summary::after { content: ""; margin-left: auto; width: 10px; height: 10px; border-right: 3px solid var(--gold-text); border-bottom: 3px solid var(--gold-text); transform: rotate(45deg) translateY(-3px); transition: transform .18s ease; }
.qrg-more[open] > summary::after { transform: rotate(-135deg) translateY(-3px); }
.qrg-more > summary:focus-visible { border-radius: 15px; outline: 3px solid var(--gold-light); outline-offset: 3px; }
.qrg-more__body { padding: 0 20px 22px; }
.qrg-more__body > .t-hint:first-child { margin-top: 0; }
.qrg-more__body .t-field + .t-field, .qrg-more__body .t-field + .field-grid, .qrg-more__body .field-grid + .field-grid, .qrg-more__body .field-grid + .t-field { margin-top: 16px; }
.qrg-more__body .t-check { margin-top: 10px; }
.qrg-narrow { max-width: 220px; }

/* Dlaždice s náhledy tvarů */
.qrg-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 10px; }
.qrg-tile { position: relative; }
.qrg-tile > span { display: grid; justify-items: center; gap: 6px; padding: 10px 4px 8px; border: 2px solid var(--border); border-radius: 14px; background: #fff; cursor: pointer; font-size: 13px; line-height: 1.25; text-align: center; color: var(--text); transition: border-color .18s ease, background-color .18s ease; }
.qrg-tile > span:hover { border-color: rgba(31, 95, 58, .38); background: var(--green-soft); }
.qrg-tile input:checked + span { border-color: var(--green); background: var(--green-soft); box-shadow: inset 0 0 0 1px var(--green); }
.qrg-tile .qrg-tile__pv { display: block; width: 52px; height: 52px; }
.qrg-tile .qrg-tile__pv svg { display: block; width: 100%; height: 100%; }

/* Barvy */
.qrg-colors { display: flex; flex-wrap: wrap; gap: 14px 24px; margin-top: 18px; }
.qrg-color__row { display: flex; gap: 8px; align-items: center; }
.t-field .qrg-color__row input[type=color] { width: 52px; min-height: 48px; height: 48px; padding: 4px; border: 2px solid #d7e0d8; border-radius: 12px; background: #fff; cursor: pointer; }
.t-field .qrg-color__row input[type=text] { width: 120px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; text-transform: uppercase; }
.qrg-grad { margin-top: 14px; }

/* Logo */
.qrg-drop { display: grid; gap: 4px; justify-items: center; padding: 22px 16px; border: 2px dashed #c9d6cc; border-radius: 16px; background: #fbfcfb; text-align: center; color: var(--muted); cursor: pointer; transition: border-color .18s ease, background-color .18s ease; }
.qrg-drop strong { color: var(--green); }
.qrg-drop small { font-size: 13px; }
.qrg-drop:hover, .qrg-drop.is-over { border-color: var(--green); background: var(--green-soft); }
.qrg-logo-info { display: flex; align-items: center; gap: 14px; padding: 12px; border: 1px solid var(--border); border-radius: 14px; }
.qrg-logo-info img { width: 48px; height: 48px; object-fit: contain; border-radius: 8px; background: repeating-conic-gradient(#edf0ed 0% 25%, #fff 0% 50%) 0 0 / 12px 12px; }
.qrg-logo-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qrg-logo-opts { margin-top: 16px; }
.qrg-logo-opts.is-off { opacity: .45; pointer-events: none; }
.button.qrg-small { min-height: 40px; padding: 8px 16px; font-size: 15px; }

/* Přepínač formátu a jednotek */
.qrg-seg { display: inline-flex; flex-wrap: wrap; justify-self: start; align-self: flex-start; max-width: 100%; border: 2px solid #d7e0d8; border-radius: 12px; overflow: hidden; background: #fff; }
.qrg-seg label { position: relative; }
.qrg-seg span { display: block; padding: 10px 16px; cursor: pointer; font-weight: 700; color: var(--green-dark); border-left: 1px solid var(--border); }
.qrg-seg label:first-child span { border-left: 0; }
.qrg-seg input:checked + span { background: var(--green); color: #fff; }

/* Vysvětlivky ke korekci chyb */
.qrg-ec-help { margin-top: 14px; }
.qrg-ec-note { margin: 0; font-size: 15px; }
.qrg-ec-compare { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.qrg-ec-compare button { display: grid; gap: 2px; justify-items: center; padding: 8px 4px; border: 2px solid var(--border); border-radius: 12px; background: #fff; color: var(--green-dark); cursor: pointer; line-height: 1.25; }
.qrg-ec-compare button b { font-size: 15px; }
.qrg-ec-compare button span { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.qrg-ec-compare button[aria-pressed="true"] { border-color: var(--green); background: var(--green-soft); box-shadow: inset 0 0 0 1px var(--green); }
.qrg-ec-compare button:disabled { cursor: not-allowed; opacity: .45; }
.qrg-ec-compare button[aria-pressed="true"]:disabled { opacity: 1; }
.qrg-ec-compare button:focus-visible { outline: 3px solid var(--gold-light); outline-offset: 3px; }
.qrg-ec-more { margin-top: 12px; font-size: 15px; }
.qrg-ec-more summary { cursor: pointer; color: var(--green); font-weight: 700; }
.qrg-ec-more dl { display: grid; gap: 8px; margin: 12px 0 0; }
.qrg-ec-more dt { font-weight: 700; color: var(--green-dark); }
.qrg-ec-more dd { margin: 2px 0 0; color: var(--muted); }
.qrg-ec-more p { margin: 10px 0 0; color: var(--muted); }

/* Náhled */
.qrg-stage { position: relative; aspect-ratio: 1; min-height: 0; padding: 0; width: min(100%, max(220px, calc(100vh - 480px))); margin-inline: auto; }
.qrg-stage.is-transparent { background: repeating-conic-gradient(#edf0ed 0% 25%, #fff 0% 50%) 0 0 / 20px 20px; }
.qrg-stage > div { width: 100%; height: 100%; }
.qrg-stage svg { display: block; width: 100%; height: 100%; }
.qrg-empty { padding: 24px; text-align: center; color: var(--muted); }
.qrg-size { margin: 10px 0 0; text-align: center; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.qrg-change { margin-left: 4px; color: var(--green); font-weight: 700; }
.qrg-actions { margin-top: 14px; }
.qrg-actions { gap: 10px; }
.qrg-actions .button { flex: 1 1 auto; padding-inline: 16px; white-space: nowrap; }
.qrg-verdict { margin-top: 14px; padding: 11px 14px; border-radius: 12px; font-weight: 800; }
.qrg-verdict.is-ok { background: var(--green-soft); color: var(--green); }
.qrg-verdict.is-warn { background: #fff8df; color: var(--gold-text); border-left: 4px solid var(--gold); }
.qrg-verdict.is-err { background: #fff2f2; color: #702020; border-left: 4px solid var(--danger); }
.qrg-verdict.is-wait { background: #f4f6f4; color: var(--muted); }
.qrg-checks { display: grid; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.qrg-checks li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 9px; font-size: 14px; line-height: 1.45; }
.qrg-ic { display: grid; place-items: center; width: 22px; height: 22px; margin-top: 1px; border-radius: 50%; color: #fff; font-size: 12px; font-weight: 900; }
.is-ok .qrg-ic { background: var(--green); }
.is-warn .qrg-ic { background: var(--gold-text); }
.is-err .qrg-ic { background: var(--danger); }
.is-info .qrg-ic { background: #3d6a8a; }

/* Malý plovoucí náhled na úzké obrazovce */
.qrg-mini { position: fixed; right: 12px; bottom: 12px; z-index: 15; display: none; width: 96px; padding: 6px 6px 5px; border: 2px solid var(--border); border-radius: 14px; background: #fff; box-shadow: 0 8px 22px rgba(18, 60, 37, .22); cursor: pointer; color: var(--muted); font: inherit; }
.qrg-mini img { display: block; width: 80px; height: 80px; margin: 0 auto; }
.qrg-mini span { display: block; margin-top: 3px; font-size: 11px; font-weight: 800; line-height: 1.2; text-align: center; }
.qrg-mini[data-state=ok] { border-color: var(--green); color: var(--green); }
.qrg-mini[data-state=warn] { border-color: var(--gold); color: var(--gold-text); }
.qrg-mini[data-state=err] { border-color: var(--danger); color: var(--danger); }
@media (max-width: 960px) { .qrg-mini.is-shown { display: block; } }

/* Hláška po stažení */
.qrg-toast { position: fixed; left: 50%; bottom: 22px; z-index: 30; max-width: calc(100% - 32px); padding: 11px 18px; border-radius: 12px; background: var(--green-dark); color: #fff; font-size: 15px; opacity: 0; transform: translate(-50%, 16px); transition: opacity .2s ease, transform .2s ease; pointer-events: none; }
.qrg-toast.is-shown { opacity: 1; transform: translate(-50%, 0); }

/* Popisy možností pod nástrojem */
.qrg-features { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 20px; }
.qrg-feature { display: flex; flex-direction: column; gap: 4px; }
.qrg-feature p { flex: 1; }
.qrg-feature p a { color: var(--green-dark); font-weight: 650; }
.qrg-feature .button { align-self: flex-start; margin-top: 16px; text-decoration: none; }

@media (max-width: 620px) {
  .qrg-chip span { padding: 8px 15px; }
  .mode-switch.qrg-presets { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .qrg-presets .mode-option > span { min-height: 70px; padding: 10px 12px; }
  .qrg-presets .mode-option small { font-size: 13px; }
  .qrg-more > summary { padding: 13px 16px; font-size: 17px; }
  .qrg-more__body { padding: 0 16px 18px; }
  .qrg-feature .button { align-self: stretch; }
  .qrg-actions .button { flex-basis: 100%; }
}
@media (max-width: 380px) {
  .mode-switch.qrg-presets { grid-template-columns: minmax(0, 1fr); }
  .qrg-ec-compare { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .qrg-chip span, .qrg-tile > span, .qrg-drop, .qrg-more > summary::after, .qrg-toast { transition: none; }
}
