:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  color: #152b40;
  background: #f4f7fa;
  --ink: #152b40;
  --muted: #536a7c;
  --line: #dce6ed;
  --accent: #096971;
  --teal: #137e85;
  --surface: #fff;
  --navy: #0a344d;
  --amber: #7e4a08;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 300px; }
button, textarea, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
h1, h2, h3, p { margin: 0; }
.shell { width: min(1240px, calc(100% - 72px)); margin-inline: auto; }
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-inner { min-height: 69px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { display: block; border-radius: 10px; object-fit: cover; }
.brand strong { display: block; font-size: 17px; letter-spacing: -.025em; }
.brand span { display: block; font-size: 11px; margin-top: 2px; color: var(--muted); }
.topbar-actions { display: flex; align-items: center; gap: 18px; }

.button { min-height: 38px; border: 1px solid transparent; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 7px 13px; font-size: 13px; font-weight: 650; transition: background .15s, border-color .15s; }
.button-quiet, .button-outline { background: white; border-color: var(--line); color: var(--ink); }
.button-quiet:hover:not(:disabled), .button-outline:hover:not(:disabled) { background: #f1f7fa; border-color: #a8c0cf; }
.button-outline:disabled, .button-quiet:disabled { opacity: .55; }
.button-primary { background: var(--navy); color: #fff; min-height: 44px; padding-inline: 16px; }
.button-primary:hover:not(:disabled) { background: #12536d; }
.button-primary:disabled { background: #e2eaf0; color: #536879; }
.plus { position: relative; width: 13px; height: 13px; color: var(--accent); }
.plus::before, .plus::after { content: ""; position: absolute; inset: 5px 0 auto; height: 2px; border-radius: 2px; background: currentColor; }
.plus::after { transform: rotate(90deg); }
.arrow { font-size: 17px; line-height: 1; }
button:focus-visible, textarea:focus-visible, input:focus-visible { outline: 2px solid #147c8d; outline-offset: 3px; }

.main { padding-top: 34px; }
.page-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
h1 { font-size: clamp(2rem, 3.6vw, 2.65rem); font-weight: 720; letter-spacing: -.048em; line-height: 1.12; }
.page-intro p { margin-top: 8px; font-size: 14px; color: var(--muted); line-height: 1.55; }
.page-intro .button { flex: none; margin-bottom: 2px; }
.page-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.model-notice { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; padding: 11px 14px; border: 1px solid #eddbb6; border-radius: 9px; color: #49391f; background: #fff8e9; font-size: 13px; line-height: 1.4; }
.model-notice span { color: #8b5d0a; font-size: 19px; line-height: 1; flex: none; }
.connection-alert { color: var(--amber); background: #fff6e7; border: 1px solid #ecd8b5; padding: 12px 15px; border-radius: 9px; margin-bottom: 16px; font-size: 13px; }

.workbench { display: grid; grid-template-columns: minmax(0, 1.39fr) minmax(0, 1fr); align-items: start; gap: 24px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; min-width: 0; box-shadow: 0 4px 14px #162f4608; }
.visit-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 19px 21px 17px; border-bottom: 1px solid #e8eff4; }
.visit-header h2 { font-size: 18px; font-weight: 710; letter-spacing: -.02em; }
.progress-label { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); font-weight: 650; white-space: nowrap; }
.steps { display: flex; gap: 3px; }
.steps i { width: 15px; height: 4px; background: #dee9ee; border-radius: 999px; }
.steps i.active { background: var(--teal); }
.field-list { padding: 0 21px; }
.entry { padding: 11px 0; }
.entry + .entry { border-top: 1px solid #e8eff4; }
.entry-heading, .field-label { display: flex; align-items: center; gap: 9px; }
.entry-heading { justify-content: space-between; margin-bottom: 7px; }
.field-label label { font-size: 14px; font-weight: 700; }
.field-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: #216678; background: #edf6f8; }
.entry textarea { width: 100%; min-height: 69px; display: block; resize: vertical; padding: 10px 11px; border: 1px solid #d7e2e9; border-radius: 8px; background: #f9fbfc; color: var(--ink); font-size: 13px; line-height: 1.5; }
.entry textarea::placeholder { color: #5d7283; opacity: 1; }
.entry textarea:focus { border-color: #71acb3; background: white; }
.entry textarea:disabled { background: #f1f5f7; }
.entry[data-absent="true"] textarea { min-height: 42px; height: 42px; resize: none; }
.entry-footer { min-height: 23px; display: flex; align-items: baseline; justify-content: space-between; gap: 9px; padding-top: 4px; }
.field-status { color: var(--muted); font-size: 11px; line-height: 1.35; }
.field-status[data-kind="error"], .form-error { color: #a02b33; }
.field-status[data-kind="ok"] { color: #0e626a; }
.entry-footer .text-button { margin-left: auto; flex-shrink: 0; }
.text-button { border: none; border-radius: 3px; padding: 1px 0; background: transparent; color: #405d71; font-size: 11px; font-weight: 650; }
.text-button:hover:not(:disabled) { color: var(--accent); text-decoration: underline; }
.text-button:disabled { color: #71828d; }
.cancel-dictation { color: #9b2935; }
.dictate { color: var(--accent); background: #f0f7f8; border-color: #d4e8eb; min-height: 31px; padding: 4px 9px; font-size: 12px; }
.dictate:hover:not(:disabled) { color: #03525b; background: #e2f1f3; border-color: #a9d1d7; }
.dictate:disabled { opacity: .59; }
.dictate[data-active="true"] { color: #9d2833; background: #fff1f1; border-color: #edbbc1; }
.dictate[data-active="true"] .icon-mic::before { inset: 4px; width: auto; height: auto; border: none; border-radius: 2px; background: currentColor; }
.dictate[data-active="true"] .icon-mic::after { display: none; }
.visit-actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 15px 21px; border-top: 1px solid #e8eff4; }
.data-note { color: var(--muted); flex: 1 1 190px; max-width: 365px; display: flex; align-items: flex-start; gap: 8px; font-size: 11px; line-height: 1.55; }
.data-note .icon { margin-top: 1px; flex: none; }
.visit-actions .button { margin-left: auto; }
.form-error { flex: 0 0 100%; font-size: 13px; line-height: 1.5; }

.results { overflow: clip; }
.rank-header { padding: 21px; min-height: 157px; display: flex; flex-direction: column; justify-content: center; color: white; background: #0b2034 url('/rodilla.png') center 53% / cover no-repeat; }
.rank-kicker { color: #b5deea; font-size: 12px; font-weight: 650; }
.rank-header h2 { margin: 6px 0 8px; width: max-content; max-width: 100%; font-size: clamp(1.3rem, 2.1vw, 1.75rem); font-weight: 710; letter-spacing: -.03em; line-height: 1.2; }
.rank-header h2:focus-visible { outline: 2px solid #b5deea; outline-offset: 5px; }
.rank-header p { color: #d3e3ec; font-size: 12px; }
.rank-header strong { margin-left: 3px; color: white; }
.waiting { min-height: 231px; display: flex; align-items: center; flex-direction: column; justify-content: center; text-align: center; padding: 26px 20px 29px; }
.waiting h3 { font-size: 16px; letter-spacing: -.014em; margin: 13px 0 5px; }
.waiting p { color: var(--muted); font-size: 13px; line-height: 1.55; max-width: 275px; }
.empty-chart { width: 66px; height: 57px; border-radius: 14px; display: flex; flex-direction: column; justify-content: center; gap: 5px; background: #edf5f8; padding: 12px 13px; }
.empty-chart i { height: 5px; border-radius: 8px; background: #96bac9; }
.empty-chart i:nth-child(2) { width: 73%; background: #acccd6; }
.empty-chart i:nth-child(3) { width: 48%; background: #bfd8df; }
.results[aria-busy="true"] .empty-chart { animation: pulse 1.25s ease-in-out infinite alternate; }
@keyframes pulse { from { opacity: .45; } to { opacity: 1; } }
.results-body { padding: 15px 18px 11px; }
.result-status { color: #15535b; background: #ecf7f6; border: 1px solid #c6e1df; border-radius: 9px; padding: 10px 12px; font-size: 12px; line-height: 1.5; }
.result-status[data-tone="review"] { color: #754705; background: #fff6e3; border-color: #ebd5ad; }
.result-status[data-tone="neutral"] { color: #38556b; background: #edf4f8; border-color: #d8e6ef; }
.result-status strong { display: block; }
.result-status ul { padding-inline-start: 17px; margin: 4px 0 0; }
.rank-views { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 11px; padding: 4px; background: #eff5f7; border-radius: 9px; }
.rank-views button { flex: 1 0 auto; min-height: 31px; padding: 5px 8px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: #456377; font-size: 12px; font-weight: 650; }
.rank-views button:hover { color: var(--accent); }
.rank-views button[aria-pressed="true"] { color: var(--navy); background: white; border-color: #d4e2e9; box-shadow: 0 1px 3px #152b400d; }
.ranking-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 13px 2px 6px; }
.ranking-heading h3 { font-size: 13px; font-weight: 700; }
.ranking-heading span { font-size: 10px; color: var(--muted); font-weight: 650; }
.ranking { list-style: none; padding: 0; margin: 0; }
.rank-row { display: grid; grid-template-columns: 25px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 8px 2px; }
.rank-row + .rank-row { border-top: 1px solid #edf1f4; }
.rank-number { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 7px; color: #526b7c; background: #eef3f7; font-size: 11px; font-variant-numeric: tabular-nums; }
.rank-row[data-selected="true"] .rank-number { color: #075f64; background: #ddf1ef; font-weight: 700; }
.hypothesis { min-width: 0; }
.hypothesis-name { display: block; font-size: 12px; font-weight: 650; line-height: 1.3; overflow-wrap: anywhere; }
.score { min-width: 46px; color: #465e71; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.rank-row[data-selected="true"] .score { color: #08646a; }
.score-track { display: block; position: relative; height: 5px; margin-top: 6px; border-radius: 8px; }
.score-track::after { content: ""; position: absolute; inset: -2px auto -2px 50%; border-left: 1px solid #55697c; }
.score-track progress { display: block; width: 100%; height: 5px; appearance: none; border: 0; border-radius: 8px; background: #e8eff4; color: #91afc0; overflow: hidden; }
.score-track progress::-webkit-progress-bar { background: #e8eff4; }
.score-track progress::-webkit-progress-value { background: #91afc0; border-radius: 8px; }
.score-track progress::-moz-progress-bar { background: #91afc0; border-radius: 8px; }
.rank-row[data-selected="true"] progress::-webkit-progress-value { background: var(--teal); }
.rank-row[data-selected="true"] progress::-moz-progress-bar { background: var(--teal); }
.score.missing-score { font-size: 10px; font-weight: 550; }
.rank-legend { font-size: 10px; color: var(--muted); display: flex; align-items: center; gap: 4px; margin: 5px 2px 0; }
.rank-legend i { display: block; width: 1px; height: 9px; background: #55697c; margin-right: 3px; }
.result-note { padding: 13px 17px; display: flex; align-items: flex-start; gap: 8px; border-top: 1px solid #e8eff4; background: #f9fbfd; color: var(--muted); font-size: 11px; line-height: 1.5; }
.info { width: 15px; height: 15px; border: 1px solid #7397a6; border-radius: 50%; color: #355d70; text-align: center; line-height: 13px; font-size: 10px; font-weight: 750; flex: none; }
.foot { display: flex; justify-content: space-between; gap: 12px; padding: 21px 0; font-size: 11px; color: #566b7c; }

.icon { width: 15px; height: 15px; position: relative; display: inline-block; }
.icon::before, .icon::after { content: ""; position: absolute; }
.icon-note::before { inset: 1px 3px; border: 1.3px solid currentColor; border-radius: 2px; }
.icon-note::after { width: 5px; height: 1px; top: 5px; left: 5px; background: currentColor; box-shadow: 0 3px currentColor, 0 6px currentColor; }
.icon-crosshair::before { inset: 2px; border: 1.2px solid currentColor; border-radius: 50%; }
.icon-crosshair::after { inset: 5.5px; border: 1.2px solid currentColor; border-radius: 50%; }
.icon-echo::before { inset: 3px 2px 2px 3px; border: 1.3px solid currentColor; border-radius: 2px 8px 4px 8px; transform: rotate(-25deg); }
.icon-echo::after { inset: 6px; border-radius: 50%; background: currentColor; }
.icon-mic::before { top: 0; left: 5px; width: 5px; height: 9px; border: 1.3px solid currentColor; border-radius: 6px; }
.icon-mic::after { top: 6px; left: 3px; width: 9px; height: 6px; border: solid currentColor; border-width: 0 1px 1px; border-radius: 0 0 6px 6px; }
.icon-lock::before { inset: 6px 3px 1px; border: 1px solid currentColor; border-radius: 2px; }
.icon-lock::after { inset: 2px 5px 8px; border: solid currentColor; border-width: 1px 1px 0; border-radius: 4px 4px 0 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

dialog { width: min(420px, calc(100% - 28px)); border: 1px solid var(--line); border-radius: 15px; padding: 24px; color: var(--ink); box-shadow: 0 15px 50px #0a253d33; }
dialog::backdrop { background: #10243888; }
dialog h2 { font-size: 19px; }
dialog p { font-size: 14px; line-height: 1.5; margin-top: 8px; color: var(--muted); }
.dialog-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 18px; }
.about-dialog { width: min(570px, calc(100% - 28px)); }
.about-dialog p { margin-top: 12px; }
.about-meta { display: grid; grid-template-columns: auto 1fr; gap: 6px 13px; margin: 16px 0 0; font-size: 13px; }
.about-meta dt { font-weight: 700; }
.about-meta dd { margin: 0; color: var(--muted); }

.access-layout { max-width: 1000px; display: grid; grid-template-columns: minmax(0, .72fr) minmax(0, 1fr); margin-block: clamp(24px, 9vh, 82px); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: 0 12px 38px #152b4012; }
.access-image { min-height: 240px; background: #0b2034 url('/rodilla.png') 76% center / cover no-repeat; }
.access-card { padding: clamp(21px, 4vw, 40px); background: white; }
.access-card h1 { font-size: clamp(1.75rem, 3.5vw, 2.25rem); }
.access-subtitle { margin: 5px 0 20px; color: var(--muted); font-size: 14px; }
.access-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.access-fields label { font-weight: 700; font-size: 13px; }
.access-fields input { display: block; width: 100%; height: 41px; margin-top: 4px; padding: 7px 9px; border: 1px solid #d7e2e9; border-radius: 8px; background: #f9fbfc; color: var(--ink); }
.declaration { margin: 19px 0 12px; padding: 14px; border: 1px solid #dce6ed; border-radius: 9px; background: #f5f9fb; }
.declaration h2 { font-size: 14px; line-height: 1.4; }
.declaration p { margin-top: 8px; color: #40596b; font-size: 13px; line-height: 1.5; }
.acceptance { display: flex; align-items: flex-start; gap: 8px; margin-top: 11px; padding-top: 11px; border-top: 1px solid var(--line); font-size: 13px; font-weight: 650; cursor: pointer; }
.acceptance input { accent-color: var(--accent); width: 17px; height: 17px; margin: 0; flex: none; }
.access-error { margin-bottom: 10px; }
.access-actions { display: flex; justify-content: flex-end; }

@media (max-width: 880px) {
  .shell { width: min(700px, calc(100% - 38px)); }
  .workbench { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .rank-header { min-height: 153px; }
}
@media (max-width: 740px) {
  .access-layout { display: block; max-width: 560px; }
  .access-image { min-height: 104px; background-position: center 50%; }
}
@media (max-width: 505px) {
  .shell { width: calc(100% - 28px); }
  .topbar-inner { min-height: 62px; gap: 10px; }
  .brand { gap: 8px; }
  .brand img { width: 34px; height: 34px; }
  .brand strong { font-size: 15px; }
  .brand span { font-size: 10px; }
  .topbar-actions { gap: 5px; }
  .topbar-actions .button { font-size: 11px; padding-inline: 8px; }
  .main { padding-top: 23px; }
  .page-intro { align-items: flex-start; flex-direction: column; gap: 12px; margin-bottom: 17px; }
  .page-intro p { font-size: 13px; }
  .visit-header, .visit-actions { padding-inline: 14px; }
  .field-list { padding-inline: 14px; }
  .steps { display: none; }
  .entry-footer { flex-wrap: wrap; }
  .rank-header, .results-body { padding-inline: 15px; }
  .rank-header { background-position: 57% 54%; }
  .access-fields { grid-template-columns: 1fr; gap: 9px; }
  .access-actions .button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
