:root {
  --het-cyan: #009fdf;
  --het-black: #000000;
  --headings-color: #000000;
  --text-color: #6f6f6f;
  --link-color: #0079b0;
  --button-primary-color: #009fdf;
  --button-secondary-color: #898e9e;
  --button-secondary-hover: #7b8192;
  --bg-input: #f2f7fa;
  --bg-subtle: #fafafa;
  --border-color: #e2e2e2;
  --border-color-light: #ededed;
  --line-color: #ebebeb;
  --color-white: #ffffff;
  --gray-15: #f0f0f0;
  --gray-20: #e9e6e4;
  --gray-40: #aba8a6;
  --gray-60: #726e6c;
  --gray-80: #3d3836;
  --border-radius-button: 6px;
  --border-radius-card: 6px;
  --transition-fast: 0.15s ease-in-out;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: transparent;
  color: var(--headings-color);
  font-family: "Mona Sans", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 0;
}

button,
input,
textarea,
select {
  font: inherit;
}

.app {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(320px, 2fr);
  gap: 2rem;
  align-items: stretch;
  height: 100%;
  min-height: 0;
  padding: 0;
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-width: 0;
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  padding: 0 0.15rem 1.5rem 0;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}

/* The bar keeps its width so nothing reflows -- only the thumb fades in
   while the column is actually being scrolled. */
.controls::-webkit-scrollbar {
  width: 6px;
}

.controls::-webkit-scrollbar-track {
  background: transparent;
}

.controls::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 6px;
}

.controls.is-scrolling {
  scrollbar-color: rgba(0, 0, 0, 0.24) transparent;
}

.controls.is-scrolling::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.24);
}

.panel {
  background: var(--color-white);
  border: 1px solid var(--border-color-light);
}

.panel-head {
  padding: 1rem 1.15rem 0.7rem;
  border-bottom: 1px solid var(--line-color);
}

.panel-head h2 {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--headings-color);
}

.panel-body {
  padding: 1rem 1.15rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.field-row .field-label {
  margin: 0;
}

.field-label,
.label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-color);
}

.hint {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--gray-60);
}

.seg {
  display: grid;
  grid-auto-rows: minmax(40px, auto);
  gap: 2px;
}

.seg--2 { grid-template-columns: repeat(2, 1fr); }
.seg--3 { grid-template-columns: repeat(3, 1fr); }
.seg--4 { grid-template-columns: repeat(4, 1fr); }

.seg button {
  appearance: none;
  margin: 0;
  padding: 0.7rem 0.45rem;
  border: 0;
  background: var(--bg-input);
  color: var(--gray-60);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.15;
  cursor: pointer;
  border-radius: var(--border-radius-button);
}

.seg button small {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.625rem;
  font-weight: 400;
  color: var(--gray-40);
}

.seg button:hover {
  color: var(--headings-color);
}

.seg button.is-on {
  background: var(--het-black);
  color: var(--color-white);
}

.seg button.is-on small {
  color: rgba(255, 255, 255, 0.62);
}

.seg button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  color: var(--gray-40);
}

.seg button:disabled:hover {
  color: var(--gray-40);
}

.seg button:focus-visible {
  outline: 2px solid var(--het-cyan);
  outline-offset: 2px;
  z-index: 1;
}

input[type="text"],
input[type="search"],
textarea,
select {
  width: 100%;
  height: 40px;
  padding: 0 0.75rem;
  border: 0;
  background: var(--bg-input);
  color: var(--headings-color);
  border-radius: var(--border-radius-button);
}

select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 2.25rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%236f6f6f' stroke-width='1.8'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 12px 8px;
  cursor: pointer;
}

select::-ms-expand {
  display: none;
}

textarea {
  height: auto;
  min-height: 88px;
  padding: 0.7rem 0.75rem;
  resize: vertical;
  line-height: 1.4;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--het-cyan);
  outline-offset: 2px;
}

.check {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-color);
  cursor: pointer;
}

.check input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--button-primary-color);
}

.actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
}

#download {
  width: 100%;
}

#reset {
  grid-column: 1 / -1;
  width: 100%;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.8rem 2em;
  border: 1px solid transparent;
  background: transparent;
  color: var(--headings-color);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  border-radius: var(--border-radius-button);
  box-shadow: none;
}

.btn:focus {
  box-shadow: none;
}

.btn:focus-visible {
  outline: 2px solid var(--het-cyan);
  outline-offset: 2px;
}

.btn-primary {
  color: var(--color-white);
  background: var(--button-primary-color);
  border-color: var(--button-primary-color);
}

.btn-primary:hover,
.btn-primary:focus {
  color: var(--color-white);
  background: var(--button-primary-color);
  border-color: var(--button-primary-color);
  filter: brightness(110%);
}

.btn-outline {
  color: var(--button-primary-color);
  border-color: var(--button-primary-color);
  text-align: center;
}

.btn-outline:hover,
.btn-outline:focus {
  color: var(--color-white);
  background: var(--button-primary-color);
  border-color: var(--button-primary-color);
}

.btn-secondary {
  color: var(--color-white);
  background: var(--button-secondary-color);
  border-color: var(--button-secondary-color);
}

.btn-secondary:hover,
.btn-secondary:focus {
  color: var(--color-white);
  background: var(--button-secondary-hover);
  border-color: var(--button-secondary-hover);
}

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

.stage {
  position: sticky;
  top: 0;
  align-self: start;
  min-width: 0;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  background: var(--bg-subtle);
}

.stage {
  height: 100%;
  overflow-y: auto;
  scrollbar-width: thin;
}

.stage-frame {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
  min-height: 200px;
  padding: 0 1.5rem 2rem;
}

.card {
  margin: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.stage.is-ready .card {
  opacity: 1;
}

.spec {
  width: 100%;
  max-width: 640px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.stage.is-ready .spec {
  opacity: 1;
}

.spec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.7rem;
}

.spec-copy {
  padding: 0.4rem 1rem;
  font-size: 0.75rem;
}

.spec-list {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.45rem 1.25rem;
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.4;
}

.spec-list dt {
  font-weight: 600;
  color: var(--gray-60);
}

.spec-list dd {
  margin: 0;
  min-width: 0;
  color: var(--headings-color);
  overflow-wrap: anywhere;
}

@media (max-width: 479.98px) {
  .spec-list {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }

  .spec-list dd {
    margin-bottom: 0.4rem;
  }
}

.card-canvas {
  display: block;
  max-width: 100%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 6px 22px rgba(0, 0, 0, 0.08);
}

.card figcaption {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-60);
}

.field-tag {
  font-size: 0.6875rem;
  font-weight: 400;
  color: var(--gray-40);
}

input[type="url"],
input[type="email"],
input[type="tel"] {
  width: 100%;
  height: 40px;
  padding: 0 0.75rem;
  border: 0;
  background: var(--bg-input);
  color: var(--headings-color);
  border-radius: var(--border-radius-button);
}

.qr-meta {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--headings-color);
}

.qr-meta:empty {
  display: none;
}

.warnings {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.warnings:empty {
  display: none;
}

.warnings li {
  padding: 0.55rem 0.7rem;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--link-color);
  background: #fdf0ed;
}

.stage-loader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-60);
  pointer-events: none;
  z-index: 3;
}

.stage.is-ready .stage-loader {
  display: none;
}

.stage-spinner {
  width: 26px;
  height: 26px;
  border: 3px solid var(--border-color);
  border-top-color: var(--button-primary-color);
  border-radius: 50%;
  animation: stage-spin 0.8s linear infinite;
}

@keyframes stage-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .stage-spinner {
    animation-duration: 2.4s;
  }
}

.status {
  min-height: 1.2em;
  font-size: 0.75rem;
  color: var(--text-color);
}

.status.is-ok { color: #1b1511; }
.status.is-err { color: var(--link-color); }

@media (max-width: 639.98px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .stage {
    order: -1;
    z-index: 2;
    max-height: 58%;
  }

  .stage-frame {
    padding-top: 2rem;
  }

  .seg--3,
  .seg--4 {
    grid-template-columns: repeat(2, 1fr);
  }
}


/* Praha 10 */
.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.font-state {
  margin: 0;
  padding: 0.6rem 0.75rem;
  font-size: 0.8125rem;
  line-height: 1.4;
  background: var(--bg-input);
}

.font-state.is-ok {
  color: var(--headings-color);
}

.font-state.is-warn {
  color: #7a4a00;
  background: #fff3d6;
}

.hint code {
  font-size: 0.6875rem;
  padding: 0 0.2em;
  background: var(--gray-15);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

label.btn {
  width: 100%;
}

/* HET – vizitka: přepínač varianty a upozornění na licenci písma */
.seg button small { white-space: nowrap; }
.font-slots { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 13px; color: var(--text-color); }
.font-slots li::before { content: "• "; }
.font-slots li.is-ok { color: #1f7a4d; }

/* skrytá strana vizitky (jednostranná varianta) – display:flex u .card jinak přebije atribut hidden */
.card[hidden] { display: none; }

/* Nástroj roste s obsahem a roluje se celá stránka: Visualbook drží výšku rámu podle
   obsahu dokumentu, takže žádný sloupec nemá vlastní posuvník. */
html,
body {
  height: auto;
  overflow: visible;
}

.app {
  height: auto;
  align-items: start;
}

.controls,
.stage {
  position: static;
  height: auto;
  max-height: none;
  overflow: visible;
}

@media (max-width: 639.98px) {
  .stage {
    max-height: none;
  }
}
