/* Selfaudit — používá proměnné z /inc/ui.css (light/dark přes data-theme) */

.audit-page {
    min-height: 50vh;
    padding-bottom: 2rem;
}

#app {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.25rem 1rem 2rem;
}

.page-head {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.page-title {
    margin: 0;
    font-size: clamp(1.35rem, 2.5vw, 1.75rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--fg);
}

.layout {
    display: grid;
    grid-template-columns: minmax(260px, 320px) 1fr;
    gap: 1.25rem;
    align-items: start;
}

@media (max-width: 960px) {
    .layout {
        grid-template-columns: 1fr;
    }
}

/* Hlavní blok testů — cca 10px od pravého okraje kontejneru stránky */
.main-panel {
    margin-right: 10px;
}

.panel {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem 1.15rem;
    box-shadow: var(--shadow);
}

.panel-title {
    margin: 0 0 0.75rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--fg);
}

.panel-hint {
    margin: 0 0 1rem;
    font-size: 0.85rem;
    color: var(--muted);
}

.field-group {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.field {
    margin-bottom: 0.85rem;
}

.field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: var(--muted);
}

.field-hint {
    display: block;
    font-size: 0.72rem;
    color: var(--muted);
    margin-top: 0.2rem;
}

.input,
.select,
.notes {
    width: 100%;
    padding: 0.45rem 0.55rem;
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--fg);
    background: var(--input);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.input:focus,
.select:focus,
.notes:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(21, 59, 162, 0.2);
}

html[data-theme="dark"] .input:focus,
html[data-theme="dark"] .select:focus,
html[data-theme="dark"] .notes:focus {
    box-shadow: 0 0 0 2px rgba(106, 163, 255, 0.25);
}

/* Globální .input v ui.css má min-width: 380px — na Selfauditu nechceme */
.audit-page .input,
.audit-page .select,
.audit-page .notes {
    min-width: 0;
    flex: 0 1 auto;
}

.input-sm {
    max-width: 4.5rem;
}

.select {
    cursor: pointer;
}

.notes {
    resize: vertical;
    min-height: 2.5rem;
}

.subhead {
    margin: 0 0 0.65rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--fg);
}

.subhead-small {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-size: 0.82rem;
    color: var(--muted);
}

.legend {
    margin-top: 1rem;
    padding: 0.65rem 0.75rem;
    font-size: 0.78rem;
    color: var(--muted);
    background: var(--input);
    border-radius: 6px;
    border: 1px solid var(--border);
}

.legend p {
    margin: 0;
}

.table-scroll-outer {
    margin: 0 -0.15rem;
    overflow: visible;
    border-radius: 8px;
}

.table-scroll {
    overflow-x: auto;
    overflow-y: visible;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.prompt-blocks {
    display: flex;
    flex-direction: column;
    gap: 1.35rem;
}

.prompt-block-title {
    margin: 0 0 0.35rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--fg);
    letter-spacing: -0.01em;
}

.prompt-block-hint {
    margin: 0 0 0.65rem;
    font-size: 0.8rem;
    color: var(--muted);
    line-height: 1.45;
    max-width: 52rem;
}

.block-table {
    margin: 0;
}

.col-platform {
    white-space: nowrap;
    color: var(--muted);
    font-size: 0.8rem;
}

.select-zminen {
    min-width: 11rem;
    max-width: 100%;
}

.select-zminen--none {
    background: var(--input);
    color: var(--fg);
    border-color: var(--border);
}

.select-zminen--ne {
    background: #ffe4e6;
    color: #881337;
    border-color: #fda4af;
}

.select-zminen--top3 {
    background: #bbf7d0;
    color: #052e16;
    border-color: #4ade80;
}

.select-zminen--mid {
    background: #fef9c3;
    color: #854d0e;
    border-color: #fde047;
}

.select-kvalita {
    min-width: 3.75rem;
    max-width: 100%;
    border-width: 1px;
    border-style: solid;
}

.select-kvalita--vnone {
    background: var(--input);
    color: var(--fg);
    border-color: var(--border);
}

.select-kvalita--v1 {
    background: #ffe4e6;
    color: #881337;
    border-color: #fda4af;
}

.select-kvalita--v2 {
    background: #ffedd5;
    color: #9a3412;
    border-color: #fdba74;
}

.select-kvalita--v3 {
    background: #fef9c3;
    color: #854d0e;
    border-color: #fde047;
}

.select-kvalita--v4 {
    background: #dcfce7;
    color: #14532d;
    border-color: #86efac;
}

.select-kvalita--v5 {
    background: #bbf7d0;
    color: #052e16;
    border-color: #4ade80;
}

.th-with-help {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.th-help {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.15rem;
    height: 1.15rem;
    padding: 0 0.2rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1;
    color: var(--muted);
    cursor: help;
    flex-shrink: 0;
    background: var(--card);
    appearance: none;
    -webkit-appearance: none;
    font-family: inherit;
    margin: 0;
}

.th-help:hover,
.th-help:focus-visible {
    border-color: var(--accent);
    color: var(--accent);
    outline: none;
}

.th-floating-tip-local {
    display: none;
    position: absolute;
    z-index: 50;
    right: 0;
    bottom: calc(100% + 0.35rem);
    left: auto;
    min-width: 12rem;
    max-width: min(22rem, 85vw);
    padding: 0.45rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 400;
    line-height: 1.4;
    color: var(--fg);
    text-align: left;
    white-space: normal;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: var(--shadow);
}

.th-with-help:hover .th-floating-tip-local,
.th-with-help:focus-within .th-floating-tip-local {
    display: block;
}

.data-table th.has-help {
    position: relative;
    z-index: 1;
    overflow: visible;
    white-space: normal;
    vertical-align: bottom;
}

.data-table th.has-help:hover,
.data-table th.has-help:focus-within {
    z-index: 40;
}

.col-dalsi {
    min-width: 9rem;
}

.col-dalsi .notes-dalsi {
    width: 100%;
    min-width: 8rem;
    min-height: 2.5rem;
    resize: vertical;
}

.summary-mentions {
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--muted);
    margin: 0 0 0.75rem;
    word-break: break-word;
}

.cell-hint {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.72rem;
    line-height: 1.35;
    color: var(--muted);
    max-width: 14rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.data-table th,
.data-table td {
    padding: 0.5rem 0.55rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    background: var(--input);
    color: var(--muted);
    font-weight: 600;
    white-space: nowrap;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background: rgba(128, 128, 128, 0.06);
}

html[data-theme="dark"] .data-table tr:hover td {
    background: rgba(255, 255, 255, 0.04);
}

.col-prompt {
    min-width: 220px;
}

.col-notes {
    min-width: 140px;
}

.num {
    text-align: center;
    color: var(--muted);
    white-space: nowrap;
}

.typ {
    color: var(--muted);
    white-space: nowrap;
}

.prompt code {
    display: block;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.78rem;
    line-height: 1.45;
    color: var(--fg);
    opacity: 0.92;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

.link-open {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
}

.link-open:hover {
    text-decoration: underline;
}

.link-muted {
    color: var(--muted);
}

.open-cell {
    white-space: normal;
    min-width: 11rem;
    vertical-align: top;
}

.open-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
}

.link-copy-open {
    padding: 0;
    margin: 0;
    border: none;
    background: none;
    font: inherit;
    font-size: 0.76rem;
    line-height: 1.35;
    color: var(--muted);
    cursor: pointer;
    text-align: left;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.link-copy-open:hover {
    color: var(--accent);
}

.summary {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--input);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.summary-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
}

.summary-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.summary-label {
    font-size: 0.75rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.summary-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ok);
}

.mini-table {
    width: 100%;
    max-width: 360px;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.mini-table th,
.mini-table td {
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--border);
    text-align: left;
}

.mini-table th {
    background: var(--bg);
    color: var(--muted);
}

.eval-list {
    margin: 0.5rem 0 0;
    padding-left: 1.1rem;
    font-size: 0.85rem;
    color: var(--muted);
}

.eval-list li {
    margin-bottom: 0.35rem;
}

.eval-list strong {
    color: var(--fg);
}

.navod {
    margin-top: 1.25rem;
}

.steps {
    margin: 0;
    padding-left: 1.2rem;
    font-size: 0.88rem;
    color: var(--muted);
}

.steps li {
    margin-bottom: 0.4rem;
}

/* Blok Stáhnout / odeslat mailem */
.server-box {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.server-lead {
    margin-bottom: 0.75rem !important;
    line-height: 1.45;
}

.sync-status {
    margin: 0.5rem 0 0;
    font-size: 0.78rem;
    color: var(--muted);
    min-height: 1.2em;
}

.export-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.65rem;
    align-items: center;
}

.btn-export {
    display: inline-block;
    padding: 0.35rem 0.65rem;
    font-size: 0.8rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    color: var(--accent);
    text-decoration: none;
    background: var(--input);
}

.btn-export:hover:not(.is-disabled) {
    border-color: var(--accent);
}

.btn-export.is-disabled {
    opacity: 0.45;
    pointer-events: none;
    color: var(--muted);
}

.btn-export-pending {
    opacity: 0.85;
    border-style: dashed;
}

.btn-mail {
    display: block;
    width: 100%;
    margin-top: 0.5rem;
    min-width: 0;
    padding: 0.5rem 0.75rem;
    font-size: 0.88rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    background: var(--ok);
    color: #fff;
}

.btn-mail:hover:not(:disabled) {
    filter: brightness(1.06);
}

.btn-mail:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

