:root {
  --bg: #f6f7f9; --surface: #ffffff; --text: #1b1f24; --muted: #5b6470; --border: #dde1e6;
  --accent: #0b6e4f; --accent-text: #ffffff; --warn-bg: #fff3d6; --warn-text: #7a4b00; --focus: #1a5fd0;
  --error-bg: #fde8e8; --error-text: #8a1c1c; --bar: #e5e8ec;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111418; --surface: #1a1e24; --text: #e8eaed; --muted: #a3abb5; --border: #2d333b;
    --accent: #3fb68b; --accent-text: #0b1410; --warn-bg: #3a2c0b; --warn-text: #f3cf7a; --focus: #7aa7ff;
    --error-bg: #3b1717; --error-text: #ffb4b4; --bar: #2d333b; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.45; font-size: 16px; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--surface); padding: 8px 12px; }
.skip:focus { left: 8px; z-index: 10; }
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 700; } .brand span { color: var(--accent); }
nav { display: flex; gap: 4px; flex-wrap: wrap; }
nav a { padding: 8px 12px; border-radius: 8px; text-decoration: none; color: var(--text); }
nav a[aria-current="page"] { background: var(--accent); color: var(--accent-text); }
.status { margin: 0 0 0 auto; color: var(--muted); font-size: 14px; }
main { max-width: 1200px; margin: 0 auto; padding: 16px; outline: none; }
h1 { font-size: 26px; margin: 8px 0 12px; } h1 .sub { font-weight: 400; color: var(--muted); font-size: 18px; }
h2 { font-size: 18px; margin: 24px 0 8px; }
.muted { color: var(--muted); }
.tabs { display: flex; gap: 8px; margin-bottom: 8px; }
button, .button { font: inherit; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; text-decoration: none; display: inline-block; min-height: 40px; }
button[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
button.primary { border-color: var(--accent); }
button:disabled { opacity: .6; cursor: progress; }
.grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.card-link { display: flex; flex-direction: column; height: 100%; color: inherit; text-decoration: none; }
.card-link:hover .owner { text-decoration: underline; }
.thumb { position: relative; aspect-ratio: 4 / 3; background: var(--bar); display: grid; place-items: center; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.no-thumb { color: var(--muted); font-size: 14px; }
.no-thumb.quote { color: var(--text); font-size: 18px; font-weight: 600; padding: 16px; text-align: center; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.no-thumb.big { aspect-ratio: 9 / 16; display: grid; place-items: center; background: var(--bar); border-radius: 12px; }
.rank { position: absolute; top: 8px; left: 8px; background: var(--accent); color: var(--accent-text); font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.card-body { padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.card-body p { margin: 0; }
.owner { font-weight: 600; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.opening { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.label { font-weight: 600; }
.metrics { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--muted); font-size: 14px; }
.why { font-size: 14px; }
.evidence { font-size: 13px; color: var(--muted); }
.tag { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--bar); }
.tag.warn { background: var(--warn-bg); color: var(--warn-text); }
.notice { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.notice.error { background: var(--error-bg); color: var(--error-text); }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-bottom: 16px; }
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.filters input, .filters select { font: inherit; padding: 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); min-height: 40px; }
.filters input { min-width: 220px; }
.clear { align-self: center; }
.pager { display: flex; gap: 16px; justify-content: center; align-items: center; margin: 16px 0; }
.list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.row { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px; display: flex; gap: 12px; justify-content: space-between; align-items: center; }
.row p { margin: 2px 0; }
.detail { display: grid; grid-template-columns: minmax(260px, 380px) minmax(0, 1fr); gap: 24px; align-items: start; }
.media { position: sticky; top: 72px; display: flex; flex-direction: column; gap: 8px; }
.media video, .media img { width: 100%; border-radius: 12px; background: #000; max-height: 75vh; }
.info section:first-child h2 { margin-top: 0; }
.bars { list-style: none; padding: 0; margin: 8px 0; display: flex; flex-direction: column; gap: 6px; }
.bars li { display: grid; grid-template-columns: 180px 1fr 70px; gap: 8px; align-items: center; font-size: 14px; }
.bar { height: 8px; background: var(--bar); border-radius: 4px; overflow: hidden; }
.fill { display: block; height: 100%; width: 0; background: var(--accent); }
.v { text-align: right; color: var(--muted); }
.feedback { display: flex; flex-wrap: wrap; gap: 8px; }
.facts dt { font-weight: 600; margin-top: 8px; } .facts dd { margin: 2px 0 0; }
.transcript { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.time { font-variant-numeric: tabular-nums; padding: 2px 8px; min-height: 32px; font-size: 14px; }
/* Wide tables scroll inside their box, never the page. */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; background: var(--surface); }
caption { text-align: left; color: var(--muted); padding-bottom: 4px; }
th, td { border-bottom: 1px solid var(--border); padding: 6px 8px; text-align: left; }
.caption { white-space: pre-wrap; overflow-wrap: anywhere; }
.why, .opening, .facts dd, .transcript li { overflow-wrap: anywhere; }
.toast { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; display: flex; gap: 12px; align-items: center; z-index: 20; max-width: calc(100vw - 32px); }
.toast[hidden] { display: none; }
.toast button { background: transparent; color: inherit; border-color: currentColor; min-height: 32px; padding: 4px 10px; }
@media (max-width: 720px) {
  .detail { grid-template-columns: minmax(0, 1fr); }
  .media { position: static; }
  .bars li { grid-template-columns: 1fr 80px; } .bars .bar { grid-column: 1 / -1; grid-row: 2; }
  .row { flex-direction: column; align-items: stretch; }
  .filters input { min-width: 0; width: 100%; } .filters label { flex: 1 1 140px; }
  .status { margin: 0; width: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }

.recommendation { background: var(--surface); border: 2px solid var(--accent); border-radius: 12px; padding: 4px 16px 12px; margin: 8px 0 16px; }
.recommendation summary { font-weight: 700; cursor: pointer; padding: 8px 0; }
.recommendation h3 { font-size: 16px; margin: 16px 0 4px; }
.recommendation ul { margin: 4px 0; padding-left: 20px; }
.how { margin: 24px 0; color: var(--muted); }
.how summary { cursor: pointer; color: var(--text); }
.actions { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
/* Entrar y Ajustes */
.link { border: 0; background: none; color: var(--accent); text-decoration: underline; padding: 8px; }
nav[hidden], nav a[hidden], .top [hidden] { display: none; }
.narrow { max-width: 440px; }
.form { display: flex; flex-direction: column; gap: 12px; }
.form label, .field label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
.form input, .form select, .form textarea, .field input, .field select, .field textarea { font: inherit; font-weight: 400; padding: 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); min-height: 40px; width: 100%; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.panel h2 { margin-top: 0; }
.field { display: grid; gap: 6px; padding: 12px 0; border-top: 1px solid var(--border); }
.field:first-of-type { border-top: 0; }
.field .hint { font-size: 14px; color: var(--muted); margin: 0; }
.field .row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.state-ok { color: var(--accent); font-weight: 600; }
.state-bad { color: var(--error-text); font-weight: 600; }
.secret-once { background: var(--warn-bg); color: var(--warn-text); padding: 12px; border-radius: 8px; word-break: break-all; }
.people { list-style: none; padding: 0; margin: 0; }
.people li { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--border); }
code.copy { background: var(--bar); padding: 6px 8px; border-radius: 6px; word-break: break-all; }
button.solid { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 600; }
button.danger { border-color: var(--error-text); color: var(--error-text); }
button[aria-disabled="true"] { opacity: .6; cursor: progress; }
.field-error { color: var(--error-text); font-weight: 600; margin: 0; }
.field-error:empty { display: none; }
/* Phones: the header scrolls away and the counts go, so the content keeps the screen. */
@media (max-width: 720px) {
  .top { position: static; }
  .status { display: none; }
}
