/* Capa propia del portal sobre wit-ui.css: shell, barra de calidad, editor con panel lateral. Solo tokens --ds-*. */
html, body { height: 100%; }
body { margin: 0; background: var(--ds-canvas); color: var(--ds-text); font-family: var(--ds-font-ui); }
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; display: flex; align-items: center; gap: 16px; padding: 0 20px; height: 52px; background: var(--ds-surface); border-bottom: 1px solid var(--ds-border-subtle); }
.brand { display: flex; align-items: baseline; gap: 8px; font-family: var(--ds-font-display); font-weight: 700; font-size: 17px; letter-spacing: .01em; white-space: nowrap; }
.brand { align-items: center; }
.brand-logo { display: inline-flex; line-height: 0; }
.brand-logo img { height: 20px; width: auto; display: block; }
.brand-logo .logo-white { display: none; }
[data-theme="dark"] .brand-logo .logo-color { display: none; }
[data-theme="dark"] .brand-logo .logo-white { display: block; }
.auth .brand-logo img { height: 26px; }
.brand small { font-family: var(--ds-font-data); font-weight: 400; font-size: 11px; color: var(--ds-text-muted); letter-spacing: .06em; text-transform: uppercase; }
.topnav { display: flex; gap: 2px; flex: 1; overflow-x: auto; }
.topnav a { padding: 7px 11px; border-radius: var(--ds-r-control); color: var(--ds-text-secondary); text-decoration: none; font-size: 13px; font-weight: 500; white-space: nowrap; }
.topnav a:hover { background: var(--ds-surface-2); color: var(--ds-text); }
.topnav a[aria-current="page"] { background: var(--ds-accent-soft); color: var(--ds-accent-text); }
.topbar .who { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--ds-text-muted); white-space: nowrap; }
main.page { max-width: 1180px; margin: 0 auto; padding: 24px 20px 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin: 0; } .page-head p { margin: 4px 0 0; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 20px; }
.kpi { background: var(--ds-surface); border: 1px solid var(--ds-border-subtle); border-radius: var(--ds-r-card); padding: 14px 16px; }
.kpi b { display: block; font-family: var(--ds-font-display); font-size: 26px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi span { font-size: 12px; color: var(--ds-text-muted); }
.qbar { display: inline-block; width: 64px; height: 6px; border-radius: 999px; background: var(--ds-surface-3); overflow: hidden; vertical-align: middle; margin-right: 8px; }
.qbar i { display: block; height: 100%; }
.q-ok i { background: var(--ds-ok); } .q-warn i { background: var(--ds-warn); } .q-danger i { background: var(--ds-danger); }
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.side { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 68px); display: grid; gap: 14px; }
@media (max-width: 900px) { .editor { grid-template-columns: 1fr; } .side { position: static; } }
fieldset.sec { border: 1px solid var(--ds-border-subtle); border-radius: var(--ds-r-card); background: var(--ds-surface); padding: 18px 20px 20px; margin: 0 0 16px; }
fieldset.sec legend { font-family: var(--ds-font-display); font-weight: 700; font-size: 16px; padding: 0 6px; }
fieldset.sec .hint-top { margin: -2px 0 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.score-big { display: flex; align-items: baseline; gap: 8px; }
.score-big b { font-family: var(--ds-font-display); font-size: 40px; line-height: 1; font-variant-numeric: tabular-nums; }
.meter { height: 8px; border-radius: 999px; background: var(--ds-surface-3); overflow: hidden; margin: 10px 0 12px; }
.meter i { display: block; height: 100%; transition: width var(--ds-t-slow); }
.falta { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; padding: 5px 0; border-bottom: 1px dashed var(--ds-border-subtle); }
.falta:last-child { border-bottom: 0; } .falta span:last-child { font-family: var(--ds-font-data); color: var(--ds-text-muted); }
.thread { display: grid; gap: 10px; }
.msg { border: 1px solid var(--ds-border-subtle); border-radius: var(--ds-r-card); padding: 10px 12px; background: var(--ds-surface); }
.msg.witdata { border-left: 3px solid var(--ds-accent-solid); }
.msg .meta { font-size: 11px; color: var(--ds-text-muted); margin-bottom: 4px; font-family: var(--ds-font-data); }
.mat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.mat { border: 1px solid var(--ds-border-subtle); border-radius: var(--ds-r-card); background: var(--ds-surface); overflow: hidden; display: flex; flex-direction: column; }
.mat .thumb { height: 120px; display: grid; place-items: center; background: var(--ds-surface-2); padding: 14px; }
.mat .thumb.oscuro { background: #1B2432; }
.mat .thumb img { max-width: 100%; max-height: 92px; object-fit: contain; }
.mat .body { padding: 12px 14px; display: grid; gap: 4px; flex: 1; }
.mat .body p { margin: 0; font-size: 13px; color: var(--ds-text-secondary); white-space: pre-wrap; max-height: 7.5em; overflow: hidden; }
.mat .foot { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px 10px 14px; }
pre.code { background: var(--ds-surface-2); border: 1px solid var(--ds-border-subtle); border-radius: var(--ds-r-control); padding: 12px 14px; font-family: var(--ds-font-data); font-size: 12px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; max-height: 360px; overflow: auto; margin: 0; }
.dl { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 7px 14px; font-size: 13px; margin: 0; }
.dl dt { color: var(--ds-text-muted); } .dl dd { margin: 0; white-space: pre-wrap; word-break: break-word; }
@media (max-width: 640px) { .dl { grid-template-columns: 1fr; } .dl dd { margin-bottom: 6px; } }
.auth { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; }
.auth .card { width: min(420px, 100%); }
.auth .lead { color: var(--ds-text-secondary); font-size: 14px; margin: 6px 0 18px; }
.chips-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px 14px; }
.diff { font-size: 13px; margin: 6px 0 0; padding-left: 18px; }
.nowrap { white-space: nowrap; }
dialog.ds-modal { width: min(640px, calc(100vw - 32px)); }
.modal-body { max-height: 70vh; overflow: auto; }
a.link { color: var(--ds-accent-text); }
form[inert] { opacity: .78; }
a.btn { text-decoration: none; }
