/* Dekodéry používají stejnou tmavou paletu jako ostatní technické pomůcky. */
/* Náhledy v rozcestníku mají společné měřítko a nahrazují text odkazu „Otevřít“. */
/* Jednotné odsazení a mezery platí pro všechny pomůcky i mobilní rozložení. */
.resistor-directory, .resistor-tool { --resistor-padding: 10px; --resistor-gap: 8px; }
.resistor-directory { gap: var(--resistor-gap); padding: var(--resistor-padding); }
.resistor-directory-group { display: grid; gap: var(--resistor-gap); min-width: 0; }
.resistor-directory-group h3 { margin: 0; padding-bottom: var(--resistor-gap); border-bottom: 1px solid var(--line); font-size: 16px; }
.resistor-directory .tool-entry { display: grid; grid-template-columns: 16px minmax(0, 1fr) 80px; align-items: center; gap: var(--resistor-gap); min-height: 44px; padding: var(--resistor-padding); font-size: var(--font-size-base); line-height: 1.35; }
.resistor-directory .tool-entry > span { min-width: 0; overflow-wrap: anywhere; }
/* Tvar ikony rozlišuje dekodér a výpočet; obě kategorie používají barvu Lime. */
.resistor-directory .tool-entry > .icon { width: 16px; height: 16px; color: #00ff00; }
.resistor-card-preview { display: block; width: 80px; max-width: 100%; height: auto; justify-self: end; }
.resistor-card-preview text { fill: #fff; font: 700 23px Consolas, "Courier New", monospace; text-anchor: middle; dominant-baseline: middle; }
/* Velikost písma a výsledných hodnot je nezávislá na odsazení panelu. */
.resistor-tool { padding: var(--resistor-padding); }
.resistor-back { display: inline-block; margin-bottom: var(--resistor-gap); color: var(--link); font-size: var(--font-size-base); }
.resistor-back:hover { text-decoration: underline; }
.resistor-modes { display: flex; flex-wrap: wrap; gap: var(--resistor-gap); }
.resistor-modes a { padding: 3.5px 7px; border: 1px solid var(--line); border-radius: 3px; font-size: var(--font-size-base); }
.resistor-modes a:hover { background: var(--surface-hover); }
.resistor-modes a[aria-current] { border-color: var(--primary); color: var(--accent); background: var(--accent-bg); }
/* Vývody a tělo jsou čisté CSS; proužky odpovídají pořadí ovládacích polí. */
.resistor-preview { display: flex; align-items: center; justify-content: center; max-width: 460px; margin: var(--resistor-gap) auto; }
.resistor-preview::before, .resistor-preview::after { content: ""; flex: 1; height: 5px; background: #a7b5c8; }
.resistor-body { display: flex; align-items: stretch; justify-content: space-between; gap: 8px; width: 70%; height: 70px; padding-inline: 18px; border: 2px solid #a68a60; border-radius: 18px; background: #dfc799; box-shadow: inset 0 -10px 14px #0002; }
.resistor-stripe { flex: 0 0 12px; border-inline: 1px solid #0003; }
.resistor-stripe--tolerance { margin-left: 14px; }
.resistor-fields { min-width: 0; margin: 0; padding: 0; border: 0; }
.resistor-fields legend { margin-bottom: var(--resistor-gap); color: var(--heading); font-weight: 700; }
.resistor-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: var(--resistor-gap); }
.resistor-field { min-width: 0; }
.resistor-field label { display: block; margin-bottom: var(--resistor-gap); font-size: var(--font-size-base); font-weight: 700; }
.resistor-field label span { display: block; color: var(--muted); font-size: var(--font-size-base); font-weight: 400; }
.resistor-field select, .resistor-field input { width: 100%; min-height: 42px; padding: 8px; border: 1px solid var(--field-border); border-radius: 3px; background: var(--bg); color: var(--text); font: inherit; font-size: var(--font-size-base); }
/* Zadání hodnoty i výběr barev ovládají stejnou sestavu proužků. */
.resistor-value-form { margin-top: var(--resistor-gap); }
.resistor-value-row { display: grid; grid-template-columns: minmax(0, 1fr) 130px auto; gap: var(--resistor-gap); align-items: end; }
.resistor-value-row button { min-height: 42px; padding: 8px 16px; border-radius: 3px; font-size: var(--font-size-base); font-weight: 700; cursor: pointer; }
.resistor-value-error { margin: var(--resistor-gap) 0 0; padding: var(--resistor-padding); border-left: 3px solid var(--danger); background: var(--danger-bg); color: var(--danger); font-size: var(--font-size-base); }
.resistor-value-form [aria-invalid="true"] { border-color: var(--danger); }
/* SMD používá stejné formuláře; náhled čipu nese dekódované nebo vytvořené označení. */
.smd-code-row { grid-template-columns: minmax(0, 1fr) auto; }
.smd-format-hint { margin: var(--resistor-gap) 0 0; color: var(--muted); font-size: var(--font-size-base); }
/* Pevné čtverce zachovají velikost i na telefonu; každý sloupec je jeden znak. */
.smd-workspace { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--resistor-gap); align-items: start; margin-top: var(--resistor-gap); }
.smd-keypad { display: flex; gap: var(--resistor-gap); justify-content: center; }
.smd-keypad-column { display: flex; flex-direction: column; gap: var(--resistor-gap); min-width: 0; margin: 0; padding: 0; border: 0; }
.smd-keypad-column legend { width: 100%; margin-bottom: var(--resistor-gap); padding: 0; color: var(--muted); font-size: var(--font-size-base); text-align: center; }
.smd-key { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--field-border); border-radius: 3px; background: var(--bg); color: var(--text); font: 700 var(--font-size-base)/1 Consolas, "Courier New", monospace; cursor: pointer; }
.smd-key:hover { border-color: var(--primary); background: var(--surface-hover); }
.smd-key[aria-pressed="true"] { border-color: var(--primary); background: var(--primary); color: var(--page-bg); }
.smd-feedback { min-width: 0; position: sticky; top: 20px; }
.smd-feedback .smd-encode-form { margin-top: 0; }
.smd-feedback .smd-result { margin-top: 0; border-top: 0; }
.smd-feedback .resistor-value-row { grid-template-columns: minmax(0, 1fr) 100px; }
.smd-feedback .resistor-value-row button { grid-column: 1 / -1; justify-self: start; }
.smd-package { display: flex; align-items: center; justify-content: center; width: min(100%, 280px); min-height: 90px; margin: var(--resistor-gap) auto; padding: 12px; border-inline: 28px solid #b5bdc7; border-radius: 4px; background: #181818; color: #fff; font: 700 34px/1.4 Consolas, "Courier New", monospace; letter-spacing: 3px; box-shadow: inset 0 2px 5px #fff2, 0 4px 10px #0003; }
/* Každá možnost má vlastní barvu; nativní výběr zachovává ovládání klávesnicí i dotykem. */
.resistor-field option { font-weight: 600; }
.resistor-result { margin-top: var(--resistor-gap); border-top: 1px solid var(--line); }
.resistor-values { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: var(--resistor-gap); margin: var(--resistor-gap) 0 0; }
.resistor-values dt { color: var(--muted); font-size: var(--font-size-base); }
.resistor-values dd { margin: var(--resistor-gap) 0 0; color: var(--heading); font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
@media (max-width: 760px) {
    .resistor-body { padding-inline: 10px; gap: 5px; }
    .resistor-stripe { flex-basis: 10px; }
    .resistor-stripe--tolerance { margin-left: 8px; }
}
@media (max-width: 1024px) {
    .resistor-value-row { grid-template-columns: minmax(0, 1fr) 110px; }
    .smd-code-row { grid-template-columns: minmax(0, 1fr); }
    .resistor-value-row button { grid-column: 1 / -1; justify-self: start; }
    .smd-workspace { grid-template-columns: minmax(0, 1fr); }
    .smd-feedback { grid-row: 1; position: static; }
}
