/* Green Healthcare · SaludUmana — portal styles */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("/fonts/inter-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("/fonts/inter-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --navy: #1b3a6b; --navy-2: #24508f; --navy-soft: #e8eef8;
  --green: #17945e; --green-2: #0f7a4c; --green-soft: #e3f5ec;
  --teal: #0e9aa7; --amber: #e5a019; --amber-soft: #fdf3dc; --red: #d1373b; --red-soft: #fdeceb; --violet: #6d5bd0; --violet-soft: #eeebfb;
  --bg: #f3f6fa; --surface: #ffffff; --surface-2: #f8fafc; --text: #0f1b2d; --muted: #61708a; --line: #e3e8ef;
  --radius: 16px; --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 27, 45, .04), 0 8px 24px rgba(15, 27, 45, .06);
  --shadow-lg: 0 24px 60px rgba(15, 27, 45, .18);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  color: var(--text); color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --navy: #8fb4ff; --navy-2: #a9c5ff; --navy-soft: #1a2a45; --green: #3fcf8e; --green-2: #63dba3; --green-soft: #12301f;
    --amber-soft: #3a2c0c; --red-soft: #3d1517; --violet-soft: #26203f;
    --bg: #0b1220; --surface: #121b2c; --surface-2: #172236; --text: #e7edf7; --muted: #94a3bb; --line: #243149;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --navy: #8fb4ff; --navy-2: #a9c5ff; --navy-soft: #1a2a45; --green: #3fcf8e; --green-2: #63dba3; --green-soft: #12301f;
  --amber-soft: #3a2c0c; --red-soft: #3d1517; --violet-soft: #26203f;
  --bg: #0b1220; --surface: #121b2c; --surface-2: #172236; --text: #e7edf7; --muted: #94a3bb; --line: #243149; color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); }
body { font-size: 15px; line-height: 1.55; min-height: 100vh; -webkit-font-smoothing: antialiased; }
a { color: var(--green-2); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.015em; }
h2 { font-size: 1.5rem; font-weight: 700; } h3 { font-size: 1.02rem; font-weight: 650; }
code { background: var(--surface-2); border: 1px solid var(--line); padding: 2px 7px; border-radius: 7px; font-size: .88em; word-break: break-all; }
.muted { color: var(--muted); } .small-text { font-size: .86rem; }
.empty { color: var(--muted); text-align: center; padding: 26px 10px; border: 1.5px dashed var(--line); border-radius: var(--radius-sm); margin: 6px 0; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }

/* ---------- Buttons & inputs ---------- */
button, .btn { font: inherit; font-weight: 600; font-size: .92rem; cursor: pointer; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  padding: .58em 1.05em; display: inline-flex; align-items: center; gap: .45em; justify-content: center; text-decoration: none; transition: background .15s, border-color .15s, transform .05s, box-shadow .15s; }
button:hover, .btn:hover { border-color: var(--navy-2); }
button:active { transform: translateY(1px); }
button:focus-visible, .btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid color-mix(in srgb, var(--green) 35%, transparent); outline-offset: 1px; }
button.primary, .btn.primary { background: var(--green); border-color: var(--green); color: #fff; box-shadow: 0 6px 16px color-mix(in srgb, var(--green) 28%, transparent); }
button.primary:hover, .btn.primary:hover { background: var(--green-2); }
button.navy { background: var(--navy); border-color: var(--navy); color: #fff; }
button.danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 30%, var(--line)); background: var(--surface); }
button.danger:hover { background: var(--red-soft); }
button.danger.solid { background: var(--red); color: #fff; }
button.ghost { background: transparent; border-color: transparent; }
button.ghost:hover { background: var(--surface-2); }
button.link { border: 0; background: none; color: var(--green-2); padding: 0; font-weight: 600; box-shadow: none; }
button.small, .btn.small { padding: .38em .75em; font-size: .84rem; border-radius: 8px; }
button:disabled { opacity: .55; cursor: not-allowed; }
.icon-btn { border: 0; background: none; padding: .35em; border-radius: 10px; color: var(--muted); }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
input, select, textarea { font: inherit; width: 100%; padding: .66em .85em; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); transition: border-color .15s; }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--navy-2) 40%, var(--line)); }
textarea { min-height: 96px; resize: vertical; }
.field { display: flex; flex-direction: column; gap: .35em; }
.field > span { font-weight: 600; font-size: .88rem; }
.field small { color: var(--muted); font-size: .82rem; }
.check { display: flex; gap: .6em; align-items: flex-start; font-size: .92rem; }
.check input { width: auto; margin-top: .3em; accent-color: var(--green); }
.stack { display: flex; flex-direction: column; gap: 1em; }
.row { display: flex; gap: .6em; flex-wrap: wrap; align-items: center; }
.row > .grow { flex: 1; min-width: 180px; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: .8em; flex-wrap: wrap; }
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1em; }
.cols-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1em; }
@media (max-width: 680px) { .cols-2, .cols-3 { grid-template-columns: 1fr; } }

/* ---------- Badges & chips ---------- */
.badge { display: inline-flex; align-items: center; gap: .3em; font-size: .74rem; font-weight: 650; padding: .2em .65em; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); margin-left: .35em; white-space: nowrap; vertical-align: middle; }
.badge.ok { background: var(--green-soft); color: var(--green-2); border-color: transparent; }
.badge.warn { background: var(--amber-soft); color: #9a6200; border-color: transparent; }
.badge.danger { background: var(--red-soft); color: var(--red); border-color: transparent; }
.badge.brand { background: var(--navy-soft); color: var(--navy); border-color: transparent; }
.badge.violet { background: var(--violet-soft); color: var(--violet); border-color: transparent; }
.chip-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--navy-soft); color: var(--navy); }
.chip-ico.green { background: var(--green-soft); color: var(--green-2); } .chip-ico.amber { background: var(--amber-soft); color: #b07500; }
.chip-ico.red { background: var(--red-soft); color: var(--red); } .chip-ico.violet { background: var(--violet-soft); color: var(--violet); } .chip-ico.teal { background: color-mix(in srgb, var(--teal) 14%, transparent); color: var(--teal); }

/* ---------- Login page ---------- */
.auth-page { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.auth-hero { position: relative; overflow: hidden; background: radial-gradient(1200px 600px at -10% -10%, #2c62b3 0%, transparent 60%), linear-gradient(150deg, #1b3a6b 0%, #102647 55%, #0b5d43 120%); color: #eaf2ff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-hero::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle, rgba(46, 204, 133, .35), transparent 65%); }
.brand { display: flex; align-items: center; gap: .7em; font-weight: 800; letter-spacing: -.01em; }
.brand .mark { width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg, #2ecc85, #17945e); color: #fff; display: grid; place-items: center; box-shadow: 0 8px 20px rgba(23, 148, 94, .35); }
.brand .mark svg { width: 22px; height: 22px; stroke-width: 2.2; }
.brand img { height: 40px; width: auto; }
.brand small { display: block; font-weight: 500; font-size: .74rem; opacity: .75; letter-spacing: .02em; }
.auth-hero h1 { font-size: clamp(1.8rem, 3vw, 2.7rem); margin-top: 1.2em; max-width: 13em; font-weight: 800; letter-spacing: -.03em; }
.auth-hero .lead { font-size: 1.05rem; opacity: .85; max-width: 32em; }
.feature-list { list-style: none; padding: 0; margin: 2em 0 0; display: grid; gap: 14px; max-width: 34em; position: relative; z-index: 1; }
.feature-list li { display: flex; gap: .85em; align-items: flex-start; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); padding: 12px 14px; border-radius: 14px; backdrop-filter: blur(4px); }
.feature-list li svg { color: #5fe0a3; margin-top: 2px; }
.auth-hero footer { font-size: .82rem; opacity: .7; position: relative; z-index: 1; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 36px 20px; }
.auth-card { width: 100%; max-width: 460px; }
.auth-card .card { padding: 30px; }
.auth-card h2 { margin-bottom: .2em; font-size: 1.6rem; }
.auth-card .sub { color: var(--muted); margin: 0 0 1.4em; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin-bottom: 1.4em; }
.segmented button { border: 0; background: transparent; box-shadow: none; padding: .55em; border-radius: 9px; color: var(--muted); }
.segmented button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(15, 27, 45, .12); }
.auth-links { margin-top: 1.3em; text-align: center; color: var(--muted); font-size: .92rem; display: grid; gap: .55em; }
.otp-input { font-size: 1.8rem; letter-spacing: .55em; text-align: center; font-variant-numeric: tabular-nums; font-weight: 700; padding: .5em; }
.notice { display: flex; gap: .6em; align-items: flex-start; background: var(--amber-soft); color: #8a5a00; padding: .8em 1em; border-radius: 12px; font-size: .92rem; }
.notice.info { background: var(--navy-soft); color: var(--navy); } .notice.ok { background: var(--green-soft); color: var(--green-2); } .notice.danger { background: var(--red-soft); color: var(--red); }
.qr { width: 196px; height: 196px; image-rendering: pixelated; align-self: center; border: 1px solid var(--line); border-radius: 14px; padding: 8px; background: #fff; }
.secure-note { display: flex; gap: .5em; align-items: center; justify-content: center; color: var(--muted); font-size: .8rem; margin-top: 1.2em; }
@media (max-width: 900px) { .auth-page { grid-template-columns: 1fr; } .auth-hero { padding: 26px 20px; } .auth-hero h1 { margin-top: .6em; } .feature-list, .auth-hero .lead, .auth-hero footer { display: none; } }

/* ---------- App shell ---------- */
.shell { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--line); padding: 20px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.sidebar .brand { padding: 2px 8px 14px; color: var(--navy); }
.sidebar .portal-tag { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding: 6px 12px 6px; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidebar nav button { background: none; border: 0; box-shadow: none; color: var(--muted); justify-content: flex-start; padding: .62em .8em; border-radius: 11px; font-weight: 550; gap: .75em; }
.sidebar nav button:hover { background: var(--surface-2); color: var(--text); }
.sidebar nav button.active { background: var(--navy-soft); color: var(--navy); font-weight: 650; }
.sidebar nav button.active svg { color: var(--green); }
.sidebar nav .count:not(:empty) { margin-left: auto; background: var(--red); color: #fff; border-radius: 999px; font-size: .7rem; padding: 0 .55em; font-weight: 700; line-height: 1.6; }
.sidebar .help { background: linear-gradient(135deg, var(--navy), #10325c); color: #e9f0fb; border-radius: 14px; padding: 14px; font-size: .84rem; margin-top: 10px; }
.sidebar .help strong { display: block; margin-bottom: .2em; }
.sidebar .help a { color: #7fe3b2; font-weight: 600; text-decoration: none; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 14px 32px; position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid transparent; }
.topbar .title { font-weight: 700; font-size: 1.05rem; flex: 1; }
.topbar .user-chip { display: flex; align-items: center; gap: .6em; padding: 4px 6px 4px 4px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: .88rem; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--navy), var(--navy-2)); color: #fff; display: grid; place-items: center; font-size: .8rem; font-weight: 700; }
#menu-toggle { display: none; }
.bell { position: relative; }
.bell .dot:not(:empty) { position: absolute; top: 2px; right: 2px; background: var(--red); color: #fff; border-radius: 999px; font-size: .62rem; min-width: 16px; height: 16px; display: grid; place-items: center; font-weight: 700; }
main { padding: 6px 32px 70px; max-width: 1240px; width: 100%; outline: none; }
.content { min-width: 0; }
.loading { color: var(--muted); padding: 3em 0; text-align: center; }
.loading::before { content: ""; display: block; width: 26px; height: 26px; margin: 0 auto 10px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--green); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 280px; transform: translateX(-102%); transition: transform .2s; z-index: 40; box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(5, 12, 25, .45); z-index: 30; }
  #menu-toggle { display: inline-flex; }
  .topbar { padding: 12px 16px; }
  .topbar .user-chip span { display: none; }
  main { padding: 4px 16px 60px; }
}

/* ---------- Cards & layout ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); margin-bottom: 20px; min-width: 0; }
.card > header { display: flex; align-items: center; gap: .7em; margin-bottom: 14px; }
.card > header h3 { margin: 0; flex: 1; }
.card > header .chip-ico { width: 34px; height: 34px; border-radius: 10px; }
.card.flat { box-shadow: none; }
.card.error-card { color: var(--red); background: var(--red-soft); border-color: transparent; }
.card.emergency { border-color: color-mix(in srgb, var(--red) 40%, var(--line)); background: linear-gradient(0deg, var(--surface), var(--surface)), var(--red-soft); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(330px, 100%), 1fr)); gap: 20px; align-items: start; }
.grid > .card { margin-bottom: 0; }
.grid + .card, .grid + .grid, .stats + .grid { margin-top: 20px; }
.hero { border-radius: 20px; padding: 26px 28px; color: #fff; margin-bottom: 20px; position: relative; overflow: hidden;
  background: radial-gradient(700px 300px at 100% 0%, rgba(46, 204, 133, .45), transparent 60%), linear-gradient(120deg, #1b3a6b, #22528f); box-shadow: var(--shadow); }
.hero h2 { color: #fff; margin-bottom: .25em; font-size: 1.6rem; }
.hero p { margin: 0; opacity: .88; max-width: 44em; }
.hero .row { margin-top: 16px; }
.hero button { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .25); color: #fff; }
.hero button.primary { background: #2ecc85; border-color: #2ecc85; color: #06281a; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); display: flex; gap: 14px; align-items: center; text-align: left; justify-content: flex-start; font-weight: 400; }
.stat:hover { border-color: color-mix(in srgb, var(--navy-2) 35%, var(--line)); transform: translateY(-1px); }
.stat .n { font-size: 1.55rem; font-weight: 750; letter-spacing: -.02em; line-height: 1.1; color: var(--text); }
.stat .l { color: var(--muted); font-size: .84rem; font-weight: 500; }
.list { list-style: none; padding: 0; margin: 0; }
.list > li { padding: 13px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: .2em; }
.list > li:last-child { border-bottom: 0; padding-bottom: 0; }
.list > li:first-child { padding-top: 0; }
.list > li.unread { background: var(--navy-soft); padding: 12px 14px; border-radius: 12px; border: 0; margin-bottom: 6px; }
.list .line { display: flex; justify-content: space-between; gap: .8em; align-items: center; flex-wrap: wrap; }
.item { display: flex; gap: 12px; align-items: flex-start; }
.item .body-col { flex: 1; min-width: 0; }
.table-wrap { overflow-x: auto; margin: 0 -4px; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: .75em .7em; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; }
tbody tr:hover { background: var(--surface-2); }
.person { display: flex; align-items: center; gap: .7em; }
.person .avatar { width: 36px; height: 36px; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 17px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.timeline > li { position: relative; padding: 0 0 22px 50px; }
.timeline > li > .dot { position: absolute; left: 0; top: 0; width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--navy-soft); color: var(--navy); border: 3px solid var(--surface); }
.timeline > li > .dot svg { width: 16px; height: 16px; }
.timeline .meta { color: var(--muted); font-size: .84rem; }
.timeline .body { white-space: pre-wrap; margin: .4em 0 0; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: .7em .9em; }
.amend-box { margin-top: .6em; padding: .7em .9em; border-left: 3px solid var(--amber); background: var(--amber-soft); border-radius: 0 12px 12px 0; }

/* ---------- Documents ---------- */
.dropzone { border: 2px dashed color-mix(in srgb, var(--green) 45%, var(--line)); border-radius: 18px; padding: 28px 18px; text-align: center; background: color-mix(in srgb, var(--green-soft) 50%, var(--surface)); cursor: pointer; transition: background .15s, border-color .15s; }
.dropzone.over { background: var(--green-soft); border-color: var(--green); }
.dropzone .big { width: 54px; height: 54px; border-radius: 16px; background: var(--surface); color: var(--green); display: grid; place-items: center; margin: 0 auto 10px; box-shadow: var(--shadow); }
.dropzone .big svg { width: 26px; height: 26px; }
.dropzone strong { display: block; font-size: 1.02rem; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 12px; margin: 18px 0; }
.cat { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); text-align: left; font-weight: 500; box-shadow: none; }
.cat .n { font-size: 1.2rem; font-weight: 750; }
.cat.active { border-color: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 18%, transparent); }
.doc-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.doc-row:last-child { border-bottom: 0; }
.doc-row .body-col { flex: 1; min-width: 0; }
.doc-row .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-row select { width: auto; padding: .35em .5em; font-size: .84rem; }
.filetype { width: 42px; height: 48px; border-radius: 9px; display: grid; place-items: center; font-size: .66rem; font-weight: 800; letter-spacing: .03em; color: #fff; background: var(--navy-2); flex: none; }
.filetype.pdf { background: #d1373b; } .filetype.img { background: #0e9aa7; } .filetype.txt { background: #61708a; } .filetype.doc { background: #2b6cd4; }
.email-card { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.email-card code { font-size: .95rem; padding: .45em .7em; }

/* ---------- Modal, toasts, misc ---------- */
.overlay { position: fixed; inset: 0; background: rgba(5, 12, 25, .5); display: grid; place-items: center; z-index: 60; padding: 16px; backdrop-filter: blur(3px); animation: fade .15s; }
.modal { background: var(--surface); border-radius: 20px; width: 100%; max-width: 540px; max-height: 92vh; overflow: auto; box-shadow: var(--shadow-lg); animation: pop .18s; }
.modal.wide { max-width: 800px; }
.modal header { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal header h3 { margin: 0; }
.modal-body { padding: 22px; }
@keyframes fade { from { opacity: 0; } } @keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
#toasts { position: fixed; bottom: 20px; right: 20px; display: grid; gap: 8px; z-index: 70; max-width: min(420px, calc(100vw - 40px)); }
.toast { background: #0f1b2d; color: #fff; padding: .8em 1.1em; border-radius: 12px; box-shadow: var(--shadow-lg); display: flex; gap: .6em; align-items: center; animation: pop .18s; }
.toast.error { background: var(--red); }
.scale { display: grid; grid-template-columns: repeat(11, 1fr); gap: 4px; }
.scale label { text-align: center; border: 1px solid var(--line); border-radius: 9px; padding: .45em 0; cursor: pointer; font-weight: 650; font-size: .9rem; position: relative; }
.scale input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.scale label:has(input:checked) { background: var(--green); border-color: var(--green); color: #fff; }
.scale label:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--green) 35%, transparent); }
@media (max-width: 520px) { .scale { grid-template-columns: repeat(6, 1fr); } }
.options { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; }
.options label { border: 1px solid var(--line); border-radius: 12px; padding: .7em .6em; text-align: center; cursor: pointer; font-weight: 600; font-size: .9rem; position: relative; }
.options input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.options label:has(input:checked) { border-color: var(--green); background: var(--green-soft); color: var(--green-2); }
.pill-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.pill-tabs button { border-radius: 999px; padding: .42em 1em; font-size: .88rem; box-shadow: none; }
.pill-tabs button.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.spark { display: flex; align-items: flex-end; gap: 4px; height: 70px; margin: .4em 0 1em; padding: 8px; background: var(--surface-2); border-radius: 12px; }
.spark i { flex: 1; background: linear-gradient(180deg, var(--green), color-mix(in srgb, var(--green) 55%, transparent)); border-radius: 4px 4px 2px 2px; min-height: 3px; }
.duties { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.duties li { display: flex; gap: .7em; align-items: flex-start; }
.duties li svg { color: var(--green); margin-top: 2px; }
.pending-screen { max-width: 560px; margin: 10vh auto; text-align: center; }
.pending-screen .chip-ico { margin: 0 auto 12px; width: 56px; height: 56px; }
.footer-note { color: var(--muted); font-size: .8rem; margin-top: 2em; text-align: center; }
dl.answers { display: grid; gap: 10px; margin: 0; }
dl.answers div { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
dl.answers dt { font-size: .82rem; color: var(--muted); font-weight: 600; }
dl.answers dd { margin: .2em 0 0; white-space: pre-wrap; }
.viewer-head { background: linear-gradient(120deg, #1b3a6b, #22528f); color: #fff; padding: 18px 24px; }
.viewer-head .brand { color: #fff; }
.viewer-main { max-width: 1000px; margin: 0 auto; padding: 24px 16px 60px; }
@media print { .sidebar, .topbar, button, .no-print { display: none !important; } .shell { display: block; } .card { box-shadow: none; break-inside: avoid; } }
.auth-hero footer a { color: inherit; }
.viewer-head .brand small { color: #cfe0ff; }
@media (max-width: 640px) {
  .doc-row { flex-wrap: wrap; }
  .doc-row .body-col { flex: 1 1 calc(100% - 60px); }
  .doc-row > .row { width: 100%; justify-content: flex-end; }
  .doc-row .title { white-space: normal; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .cat { padding: 10px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 12px; gap: 10px; }
  .stat .n { font-size: 1.2rem; }
  .card { padding: 16px; border-radius: 14px; }
  .hero { padding: 20px; }
  .hero h2 { font-size: 1.3rem; }
}
