/* Vzhled a okno Nastavení (vzhled.js) – pokyn vlastníka 14. 11. 2026, vzor GOODIE Economiq (SettingsWindow.tsx,
 * ThemePicker.tsx, ScaleSliders.tsx, globals.css .menu-zoom / .content-zoom). */

/* ---------- velikost menu a pracovní plochy (CSS zoom, 7 kroků 81,25–118,75 %) ---------- */
#route, .route--shadow { zoom: var(--content-zoom, 1); }
@media (min-width: 901px) {
  .sidebar { zoom: var(--menu-zoom, 1); }
  /* Sloupec menu roste i se zvětšením, ať se menu nezúží. */
  #app { grid-template-columns: calc(248px * var(--menu-zoom, 1)) minmax(0, 1fr); }
  html[data-nav="DENSE"] #app { grid-template-columns: calc(238px * var(--menu-zoom, 1)) minmax(0, 1fr); }
  html[data-nav="ICONS"] #app { grid-template-columns: calc(284px * var(--menu-zoom, 1)) minmax(0, 1fr); }
}
.route--shadow { pointer-events: none; user-select: none; }

/* ---------- kolečko u jména ---------- */
.settings-btn { position: relative; border-radius: 999px; }
.settings-btn svg { width: 19px; height: 19px; }
.settings-btn.is-active { background: var(--nav-active); color: var(--nav-active-text) !important; }
.settings-btn.has-alert::after {
  content: ''; position: absolute; top: 3px; right: 3px; width: 8px; height: 8px; border-radius: 999px;
  background: #dc2626; box-shadow: 0 0 0 2px var(--frame);
}

/* ---------- okno Nastavení ---------- */
.setw {
  position: fixed; inset: 0; z-index: 70; display: flex; justify-content: center;
  background: rgba(0, 0, 0, .45); backdrop-filter: blur(2px);
}
.setw[hidden] { display: none; }
.setw__win {
  display: flex; flex-direction: column; width: 100%; height: 100%; max-width: 1320px; overflow: hidden;
  background: var(--canvas); box-shadow: 0 25px 50px -12px rgba(0, 0, 0, .35);
}
.setw__head {
  display: flex; align-items: center; gap: 10px; height: 56px; flex-shrink: 0; padding: 0 16px;
  background: #fff; border-bottom: 1px solid var(--line); color: var(--ink);
}
.setw__ic { color: var(--muted); display: grid; }
.setw__ic svg { width: 18px; height: 18px; }
.setw__head h2 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.setw__cur { font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.setw__x {
  margin-left: auto; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 999px; color: var(--muted);
}
.setw__x svg { width: 16px; height: 16px; }
.setw__x:hover { background: var(--canvas); color: var(--ink); }
.setw__chips {
  display: none; gap: 6px; overflow-x: auto; flex-shrink: 0; padding: 8px 12px; background: #fff; border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}
.setw__chip {
  flex-shrink: 0; border-radius: 999px; padding: 6px 12px; font-size: 12px; font-weight: 500; background: var(--canvas); color: var(--ink);
  white-space: nowrap;
}
.setw__chip.is-active { background: var(--nav-active); color: var(--nav-active-text); }
.setw__body { display: flex; flex: 1; min-height: 0; }
.setw__list {
  display: flex; flex-direction: column; gap: 12px; width: 250px; flex-shrink: 0; overflow-y: auto; overscroll-behavior-y: contain;
  padding: 10px; background: #fff; border-right: 1px solid var(--line);
}
.setw__group { display: flex; flex-direction: column; gap: 2px; }
.setw__gl { padding: 4px 10px 4px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.setw__item {
  display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border-radius: 12px; text-align: left; color: var(--ink);
  transition: background var(--t);
}
.setw__item:hover { background: var(--canvas); }
.setw__item.is-active { background: var(--nav-active); color: var(--nav-active-text); box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
.setw__item-ic { margin-top: 1px; flex-shrink: 0; opacity: .8; display: grid; }
.setw__item-ic svg { width: 16px; height: 16px; }
.setw__item-t { min-width: 0; }
.setw__item-l { display: block; font-size: 13px; font-weight: 600; line-height: 1.25; }
.setw__item-h { display: block; font-size: 11px; line-height: 1.375; color: var(--muted); }
.setw__item.is-active .setw__item-h { color: inherit; opacity: .8; }
.setw__badge {
  display: inline-block; min-width: 16px; padding: 0 5px; border-radius: 999px; background: #dc2626; color: #fff;
  font-size: 10px; line-height: 16px; text-align: center; vertical-align: 1px;
}
.setw__content { position: relative; flex: 1; min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; }
.setw__content > .route { padding: 18px 22px 48px; max-width: none; margin: 0; }
.setw__content > .ro-banner { width: calc(100% - 44px); margin: 16px 22px -4px; max-width: none; }
body.setw-open { overflow: hidden; }
@media (min-width: 768px) {
  .setw { padding: 24px; }
  .setw__win { border-radius: 22px; border: 1px solid var(--line); }
}
@media (max-width: 767px) {
  .setw__chips { display: flex; }
  .setw__list { display: none; }
  .setw__content > .route { padding: 14px 14px 40px; }
}

/* ---------- část Vzhled ---------- */
.vz { max-width: 1100px; }
.vz-intro { margin: 0 0 4px; color: var(--muted); font-size: 13px; }
.vz-h { margin: 20px 0 10px; font-size: 15px; font-weight: 700; color: var(--ink); }
.vz-note { margin: 8px 0 0; font-size: 12px; color: var(--muted); }
.vz-note--top { margin: -4px 0 10px; }
.vz-themes { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.vz-navs { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.vz-card {
  display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; text-align: left;
  border: 1px solid var(--line); background: #fff; color: var(--ink); transition: border-color var(--t);
}
.vz-card:hover { border-color: var(--line-3); }
.vz-card.is-on { border-color: var(--ink); box-shadow: 0 0 0 2px var(--lime); }
.vz-card:disabled { opacity: .6; cursor: progress; }
.vz-sw { display: flex; flex-shrink: 0; overflow: hidden; border-radius: 8px; border: 1px solid var(--line); }
.vz-sw i { display: block; width: 20px; height: 36px; }
.vz-card__t { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.vz-card__n { font-size: 14px; font-weight: 600; }
.vz-card__h { font-size: 12px; color: var(--muted); line-height: 1.35; }
.vz-on { margin-left: 2px; font-size: 12px; font-weight: 500; color: var(--muted); }
.vz-letter { color: var(--muted); font-weight: 700; }
.vz-card--nav .nav-prev { flex-shrink: 0; }

.vz-custom { margin-top: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.vz-custom__head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.vz-custom__head h4 { margin: 0 0 2px; font-size: 14px; font-weight: 600; }
.vz-custom__head p { margin: 0; font-size: 12px; color: var(--muted); max-width: 640px; }
.vz-status { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }
.vz-slot { display: grid; gap: 8px; padding: 6px 0; align-items: center; }
@media (min-width: 640px) { .vz-slot { grid-template-columns: 150px 1fr; } }
.vz-slot__l { font-size: 14px; font-weight: 500; }
.vz-slot__h { font-size: 12px; color: var(--muted); }
.vz-slot__c { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.vz-dot { width: 28px; height: 28px; border-radius: 999px; border: 1px solid rgba(0, 0, 0, .15); transition: transform var(--t); }
.vz-dot:hover { transform: scale(1.1); }
.vz-dot.is-on { border-color: var(--ink); box-shadow: 0 0 0 1px #fff, 0 0 0 3px var(--lime); }
.vz-pick {
  margin-left: 4px; display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 2px; cursor: pointer;
  border: 1px solid var(--line-3); border-radius: 999px; font-size: 12px;
}
.vz-pick:hover { border-color: var(--ink); }
.vz-pick input { width: 24px; height: 24px; padding: 0; border: 0; border-radius: 999px; background: transparent; cursor: pointer; }
.vz-pick input::-webkit-color-swatch-wrapper { padding: 0; }
.vz-pick input::-webkit-color-swatch { border: 0; border-radius: 999px; }
.vz-pick span { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.vz-warn { font-size: 12px; color: var(--muted); }

.vz-scales { display: grid; gap: 12px; }
@media (min-width: 1024px) { .vz-scales { grid-template-columns: 1fr 1fr; } }
.vz-scale { padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.vz-scale__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.vz-scale__l { font-size: 14px; font-weight: 600; }
.vz-scale__h { font-size: 12px; color: var(--muted); }
.vz-scale__v { font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.vz-scale__row { display: flex; align-items: center; gap: 10px; margin: 10px 0 4px; }
.vz-scale__row input { flex: 1; height: 8px; cursor: pointer; accent-color: var(--lime-600); }
.vz-a { font-size: 11px; color: var(--muted); }
.vz-a--big { font-size: 17px; font-weight: 600; }
.vz-scale__foot { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.vz-link { color: var(--link); font-size: 11px; }
.vz-link:hover { text-decoration: underline; }

/* ---------- menu: A Hustý seznam (sbalitelné sekce) a B lišta s počty ---------- */
.nav__foldall { display: none; }
.nav__chev, .nav__fold-n { display: none; }
@media (min-width: 901px) {
  html[data-nav="DENSE"] .nav__foldall {
    display: flex; align-items: center; gap: 4px; margin: 0 0 4px auto; padding: 2px 6px; border-radius: 6px;
    font-size: 9px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; line-height: 1;
    color: var(--chrome-muted); opacity: .8; white-space: nowrap;
  }
  html[data-nav="DENSE"] .nav__foldall:hover { color: var(--chrome-text); opacity: 1; }
  html[data-nav="DENSE"] .nav__foldall svg { width: 8px; height: 10px; }
  html[data-nav="DENSE"] .nav { display: flex; flex-direction: column; }
  html[data-nav="DENSE"] .nav__group {
    border: 1px solid var(--chrome-line); border-radius: 12px; padding: 2px; margin-bottom: 6px;
  }
  html[data-nav="DENSE"] .nav__label {
    display: flex; align-items: center; gap: 6px; cursor: pointer; user-select: none;
    padding: 4px 8px; font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
    color: var(--chrome-text); opacity: 1; border-bottom: 1px solid var(--chrome-line); margin-bottom: 2px; border-radius: 0;
  }
  html[data-nav="DENSE"] .nav__label:hover { opacity: .75; }
  html[data-nav="DENSE"] .nav__chev { display: block; width: 6px; height: 10px; margin-left: auto; color: var(--chrome-muted); transform: rotate(90deg); transition: transform var(--t); flex-shrink: 0; }
  html[data-nav="DENSE"] .nav__group.is-folded .nav__chev { transform: none; }
  html[data-nav="DENSE"] .nav__group.is-folded .nav__label { border-bottom-color: transparent; margin-bottom: 0; }
  html[data-nav="DENSE"] .nav__group.is-folded .nav__item:not(.is-active) { display: none !important; }
  html[data-nav="DENSE"] .nav__fold-n:not([hidden]) {
    display: inline-block; margin-left: auto; min-width: 17px; padding: 0 4px; border-radius: 999px; background: #b73a26; color: #fff;
    font-size: 10px; font-style: normal; line-height: 16px; text-align: center; letter-spacing: 0;
  }
  html[data-nav="DENSE"] .nav__fold-n:not([hidden]) + .nav__chev { margin-left: 0; }

  .nav-rail__badge {
    position: absolute; top: 2px; right: 2px; min-width: 15px; padding: 0 4px; border-radius: 999px;
    background: #b73a26; color: #fff; font-size: 9px; font-style: normal; font-weight: 600; line-height: 16px; text-align: center;
  }
  .nav-rail__badge[hidden] { display: none; }
}
@media (min-width: 901px) {
  html[data-nav="DENSE"] .nav__t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  html[data-nav="DENSE"] .nav__item .badge { flex-shrink: 0; margin-left: auto; }
}
