:root{
    --bg:#fff;
    --text:#111;
    --muted:#666;
    --line: #006443;
    --chip:#f4f4f4;
    --panel:#fafafa;
    --accent:#1e6fff;
    --radius:10px;
    --shadow:0 8px 24px rgba(0,0,0,.06);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }

body{
    margin:0;
    font-family:"Nunito", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    background:var(--bg);
    color:var(--text);
}

.container{
    max-width:980px;
    margin:0 auto;
    padding:0 16px;
}

.sr-only{
    position:absolute;
    width:1px;height:1px;
    padding:0;margin:-1px;
    overflow:hidden;clip:rect(0,0,0,0);
    white-space:nowrap;border:0;
}

/* Header */
.header{
    border-bottom:1px solid var(--line);
    background-color: var(--line);
    padding:22px 0 14px;
}
.meta{
    display:flex;
    gap:10px;
    align-items:center;
    flex-wrap:wrap;
    color:var(--muted);
    font-size:13px;
    letter-spacing:.02em;
}
.brand{ font-weight:800;color:white; }
.dot{ color:#bbb; }
.meta #helpBtn{ margin-left:auto; }
#helpBtn svg {fill: white;}
.headline-row{ margin-top:10px; }
.headline{
    color: white;
    margin:0;
    font-size:28px;
    line-height:1.15;
    font-weight:800;
}
.subtitle{
    margin:8px 0 20px 0 ;
    color: #d5d5d5;
    font-size:14px;
    max-width:75ch;
}

/* Main */
.main{ padding:18px 16px 64px; }

/* čisté ikony bez rámečku */
.icon-btn{
    border:none;
    background:transparent;
    color:var(--muted);
    width:38px;
    height:38px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    cursor:pointer;
    padding:0;
}
.icon-btn:hover{ color:var(--text); }
.icon-btn svg{ width:26px;height:26px; fill:black; }

/* Search */
.search{ margin: 0 0 10px; }

.search-wrap{
    position: relative;
    width: 100%;
}

.search-wrap input{
    width:100%;
    padding:14px 44px 14px 16px;
    font-size:18px;
    border:1px solid var(--line);
    border-radius:var(--radius);
    outline:none;
    background:#fff;
}
.search-wrap input:focus{ border-color:var(--accent); }

.search-clear{
    position:absolute;
    right:10px;
    top:50%;
    transform: translateY(-50%);
    border:none;
    background:transparent;
    width:32px;
    height:32px;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:0;
    cursor:pointer;
    color: var(--muted);
}
.search-clear:hover{ color: var(--text); }
.search-clear svg{ width:18px;height:18px; fill: currentColor; }

/* Results */
.section-head{
    display:flex;
    align-items:baseline;
    justify-content:space-between;
    gap:12px;
    margin:18px 0 10px;
}
.section-head h2{
    margin:0;
    font-size:13px;
    text-transform:uppercase;
    letter-spacing:.08em;
    color:var(--muted);
    font-weight:700;
}
.small{ font-size:12px; }
.muted{ color:var(--muted); }

.list{ border-top:1px solid var(--line); }
.item{
    padding:14px 0;
    border-bottom:1px solid var(--line);
}

/* HLAVNÍ ŘÁDEK: text vlevo, ikona vpravo */
.item-head{
    display:flex;
    align-items:stretch;
    gap:14px;
    cursor:pointer;
}

/* barevný proužek vlevo (šířka 8px, výška jako hlavička položky) */
.item-colorbar{
    width:8px;
    flex: 0 0 8px;
    background: transparent;
    align-self:stretch;
}
.item-head:focus-visible{
    outline:2px solid var(--accent);
    outline-offset:6px;
    border-radius:8px;
}

/* textový blok – cíleně „nejvýš 80 %“, zbytek je pro ikonu */
.item-text{
    flex: 1 1 auto;
    min-width:0;
    max-width:80%;
}
@media (max-width: 760px){
    .item-text{ max-width:100%; }
}

.item-title{
    font-size:18px;
    font-weight:700;
    margin:0;
    word-break:break-word;
}
.item-summary{
    margin:6px 0 0;
    font-size:14px;
    color:var(--muted);
}

/* pravý sloupec s ikonou */
.item-right{
    align-self:flex-start;
    margin-left:auto;
    width:38px;
    height:38px;
    display:flex;
    align-items:center;
    justify-content:center;
    color:var(--line);
    flex: 0 0 auto;
    border-radius:10px;
}
.item-right svg{ width:20px;height:20px; fill:currentColor; }
.item-head:hover .item-right{ color:var(--text); background:rgba(0,0,0,.03); }

/* detail */
.detail{
    margin-top:10px;
    padding:14px;
    background:var(--panel);
    border:1px solid var(--line);
    border-radius:var(--radius);
    display:none;
}
.detail.active{ display:block; }
.detail h3{
    margin:14px 0 6px;
    font-size:13px;
    text-transform:uppercase;
    letter-spacing:.06em;
    color:#444;
}
.detail h3:first-child{ margin-top:0; }
.detail p{ margin:0 0 8px;font-size:14px; }
.detail ul{ margin:0 0 8px 18px;font-size:14px; }

.links{
    margin-top:10px;
    display:flex;
    flex-wrap:wrap;
    gap:10px;
}
.link{
    color:var(--accent);
    text-decoration:none;
    font-size:14px;
}
.link:hover{ text-decoration:underline; }

/* Empty */
.empty{ padding:18px 0; }
.empty h3{ margin:0 0 6px;font-size:16px; }
.empty p{ margin:0;color:var(--muted);max-width:70ch; }

/* Footer */
.footer{
    border-top:1px solid var(--line);
    padding:14px 0;
    color:var(--muted);
    font-size:12px;
}
.footer-inner{
    display:flex;
    justify-content:space-between;
    gap:10px;
    flex-wrap:wrap;
}

/* Dialog */
.dialog{
    border: none;
    border-radius: 14px;
    padding: 0;
    width: min(680px, calc(100% - 24px));
    box-shadow: var(--shadow);
    background: #fff;
    color: #111;
}

.dialog::backdrop{
    background: rgba(0,0,0,.35);
}

.dialog-inner{
    padding: 16px;
}

.dialog-head{
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0,0,0,.08);
}

.dialog-head h3{
    margin: 0;
    font-size: 16px;
    line-height: 1.2;
}

/* Close button – viditelný křížek i bez icon fontu */
.dialog .icon-btn{
    width: 36px;
    height: 36px;
    border: 1px solid rgba(0,0,0,.12);
    background: rgba(0,0,0,.03);
    border-radius: 10px;
    display: inline-grid;
    place-items: center;
    cursor: pointer;
    padding: 0;
    color: #111;
}

.dialog .icon-btn:hover{
    background: rgba(0,0,0,.06);
}

.dialog .icon-btn:active{
    transform: translateY(1px);
}

.dialog .icon-btn:focus-visible{
    outline: 2px solid rgba(0,0,0,.35);
    outline-offset: 2px;
}

/* Fallback "X" jen když je tlačítko prázdné */
.dialog .dialog-close:empty::before{
    content: "×";
    font-size: 22px;
    line-height: 1;
    font-weight: 700;
    color: black;
}

/* Pokud máš reálně ikonový systém přes data-icon, můžeš ho mít dál.
   Tahle úprava jen zajistí, že fallback křížek nezmizí. */

/* Body typografie */
.dialog-body{
    padding-top: 12px;
}

.dialog-body p{
    margin: 10px 0;
    line-height: 1.45;
}

.dialog-body a{
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.dialog-body a:hover{
    text-decoration-thickness: 2px;
}

/* Kontakt trochu oddělit */
.help-contact{
    margin-top: 12px;
}

/* Muted text – nechávám kompatibilní s tvým .muted.small */
.dialog .muted{
    opacity: .72;
}

.dialog .small{
    font-size: 12.5px;
}

/* Legenda */
.help-legend{
    margin: 12px 0 8px;
    padding: 10px 10px;
    border-radius: 12px;
    background: rgba(0,0,0,.03);
    border: 1px solid rgba(0,0,0,.08);
    display: grid;
    gap: 8px;
}

.legend-row{
    display: grid;
    grid-template-columns: 14px 1fr;
    align-items: center;
    column-gap: 10px;
    min-height: 22px;
}

.legend-swatch{
    width: 10px;
    height: 18px;
    background: #777;
    justify-self: center;
}

/* 5 barev – uprav si podle reálných barev proužků u itemů */
.legend-swatch.is-1{ background: rgb(89,72,173); } /* indigo */
.legend-swatch.is-2{ background: rgb(0,100,67); } /* green */
.legend-swatch.is-3{ background: #FFFF00; } /* amber */
.legend-swatch.is-4{ background: #f3333f; } /* red */
.legend-swatch.is-5{ background: #555555; } /* sky */

.legend-text{
    font-weight: 600;
    letter-spacing: .2px;
}

/* A11y helper */
.sr-only{
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0,0,0,0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}