/* UULE Generator (/tools/uule-generator/) */
#uule-generator [hidden] { display: none !important; }
#uule-generator .sv-panel-head .sv-dim { text-transform: none; letter-spacing: 0; font-weight: 400; }
.uu-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 12px; padding: 4px; background: #f1f3f5; border-radius: 10px; width: fit-content; max-width: 100%; }
.uu-tabs button {
    border: 0; background: transparent; padding: 7px 14px; font-size: 13.5px; font-weight: 600; color: #495057;
    border-radius: 7px; cursor: pointer;
}
.uu-tabs button:hover { color: #212529; }
.uu-tabs button.is-active { background: #fff; color: #3b5bdb; box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
.uu-tabs button:focus-visible { outline: 2px solid #3b5bdb; outline-offset: 1px; }

.uu-grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 10px; }
.uu-grid3 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); gap: 0 10px; }
.tl-app .uu-select { width: 100%; height: 36px; font-size: 14px; }
.uu-ta { min-height: 120px; }
.uu-check { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #495057; cursor: pointer; margin-top: 6px; }

/* Location autocomplete */
.uu-combo { position: relative; }
.tl-app ul.uu-list {
    position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); max-height: 340px; overflow-y: auto;
    list-style: none; margin: 0 !important; padding: 4px !important; background: #fff; border: 1px solid #dee2e6; border-radius: 10px;
    box-shadow: 0 12px 32px -12px rgba(15, 23, 42, .3);
}
.tl-app ul.uu-list li { display: block; margin: 0 !important; padding: 7px 10px; border-radius: 7px; cursor: pointer; }
.tl-app ul.uu-list li.is-active, .tl-app ul.uu-list li:hover { background: #edf2ff; }
.uu-opt-name { display: block; font-size: 13.5px; color: #212529; word-break: break-word; }
.uu-opt-meta { display: block; font-size: 11.5px; color: #868e96; }
.uu-opt-meta b { color: #c92a2a; font-weight: 600; }

/* Results */
.uu-out { display: flex; gap: 8px; align-items: flex-start; }
.tl-app .uu-out code {
    flex: 1; min-width: 0; display: block; padding: 8px 10px !important; border-radius: 8px !important;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px;
    line-height: 1.5; word-break: break-all; background: #f8f9fa !important; color: #1e3a8a !important;
}
.uu-out .sv-btn { flex: none; margin-top: 4px; }
.tl-app dl.uu-dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; margin: 6px 0 0 !important; font-size: 13px; }
.uu-dl dt { color: #868e96; font-weight: 600; }
.uu-dl dd { margin: 0 !important; word-break: break-word; }
.uu-sugs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.tl-app .uu-sug {
    border: 1px dashed #4c6ef5; background: #f8f9ff; color: #3b5bdb; border-radius: 6px; padding: 2px 8px;
    font-size: 12.5px; cursor: pointer; text-align: left;
}
.tl-app .uu-sug:hover { background: #edf2ff; }
.tl-list li > span:last-child { min-width: 0; }

/* Tables */
.uu-scroll { max-height: 520px; overflow: auto; }
.tl-app table.uu-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 0 !important; }
.tl-app table.uu-table th, .tl-app table.uu-table td {
    border: 0 !important; border-bottom: 1px solid #f1f3f5 !important; padding: 7px 6px !important;
    text-align: left; vertical-align: top; word-break: break-word;
}
.tl-app table.uu-table thead th { font-size: 12px; color: #868e96; font-weight: 600; position: sticky; top: 0; background: #fff; }
.tl-app table.uu-table td code { word-break: break-all; font-size: 11.5px; }
.tl-app table.uu-table td.uu-actions { width: 1%; white-space: nowrap; text-align: right; }
.tl-app table.uu-table tr.is-center td { background: #f8f9ff; }
.uu-actions .sv-btn + .sv-btn { margin-left: 4px; }
.uu-issue { font-size: 11.5px; margin-top: 3px; color: #c92a2a; }
.tl-app table.uu-params td:first-child { width: 1%; white-space: nowrap; }

/* Grid preview */
.uu-svg { max-width: 300px; margin: 4px auto 10px; }
.uu-svg svg { width: 100%; height: auto; display: block; }
.uu-svg circle { fill: #edf2ff; stroke: #4c6ef5; stroke-width: 1.5; transition: fill .15s; }
.uu-svg circle.is-center { fill: #3b5bdb; }
.tool-page .content .uu-svg a, .uu-svg text { text-decoration: none !important; border: 0 !important; }
.uu-svg a:hover circle { fill: #bac8ff; }
.uu-svg text { font-weight: 700; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; text-anchor: middle; fill: #1e3a8a; pointer-events: none; }
.uu-svg circle.is-center + text { fill: #fff; }

/* Decoder */
.uu-dec-name { font-weight: 600; font-size: 15px; margin: 0 0 6px !important; word-break: break-word; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.uu-raw summary { cursor: pointer; font-size: 12.5px; color: #495057; margin: 6px 0; }
.tl-app pre.uu-pre {
    margin: 0 !important; padding: 8px 10px !important; border-radius: 8px; background: #f8f9fa; color: #343a40;
    font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; word-break: break-all;
}

/* Keyword and collapsible URL settings */
.uu-kw .tl-field { margin-bottom: 0; }
.uu-settings > summary { cursor: pointer; list-style: none; gap: 8px; margin-bottom: 0; }
.uu-settings > summary::-webkit-details-marker { display: none; }
.uu-settings > summary::after { content: '▾'; font-size: 12px; color: #868e96; transition: transform .15s; flex: none; }
.uu-settings[open] > summary { margin-bottom: .5rem; }
.uu-settings[open] > summary::after { transform: rotate(180deg); }
.uu-settings > summary > span:first-child { flex: none; }
.uu-settings > summary .sv-dim { flex: 1; min-width: 0; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uu-settings[open] > summary .sv-dim { display: none; }

/* One column: input → result → checks → settings, instead of all inputs first */
@media screen and (max-width: 960px) {
    .tl-app.uu-app { display: flex; flex-direction: column; gap: 0; }
    .uu-col-in, .uu-col-out { display: contents; }
    .uu-col-in > * { order: 1; }
    .uu-col-out > * { order: 2; }
    .uu-col-in > .uu-settings { order: 3; }
}

@media screen and (max-width: 560px) {
    .uu-grid3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .uu-grid3 > :first-child { grid-column: 1 / -1; }
    .uu-tabs { display: flex; flex-wrap: nowrap; width: 100%; gap: 2px; padding: 3px; }
    .uu-tabs button { flex: 1 1 auto; padding: 7px 4px; font-size: 12.5px; white-space: nowrap; }
    #uule-generator .sv-panel { padding: 12px; border-radius: 12px; margin-bottom: 10px; }
    #uule-generator .tl-field { margin-bottom: 10px; }
    #uule-generator .uu-kw .tl-field { margin-bottom: 0; }
    .uu-svg { max-width: 260px; }
}
