/* /assets/css/app.css */
:root {
  --ink: #102f3a;
  --ink-soft: #57717a;
  --muted: #7b9299;
  --line: #dce8e9;
  --line-soft: #eaf1f2;
  --surface: #ffffff;
  --surface-soft: #f3f8f8;
  --surface-tint: #eaf6f5;
  --teal: #0b7f82;
  --teal-dark: #086568;
  --teal-soft: #d9efed;
  --blue: #4d86d9;
  --blue-soft: #eaf1fc;
  --navy: #163f58;
  --green: #2f966d;
  --green-soft: #e5f5ed;
  --amber: #bd7a22;
  --amber-soft: #fff4df;
  --red: #b74b56;
  --red-soft: #fcebed;
  --shadow-sm: 0 5px 18px rgba(30, 78, 88, 0.07);
  --shadow-md: 0 16px 45px rgba(25, 74, 83, 0.11);
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 26px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #f5f9f9;
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; background: #f5f9f9; touch-action: manipulation; }
body { min-width: 320px; min-height: 100vh; margin: 0; background: radial-gradient(circle at 10% 0%, rgba(80, 177, 171, .08), transparent 27rem), #f5f9f9; color: var(--ink); }
body, button, input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { color: inherit; }
button, summary, select, label[for], input[type="file"] { -webkit-tap-highlight-color: transparent; }
button { border: 0; }
svg { display: block; }
.icon { flex: none; }

.app-header { position: sticky; top: 0; z-index: 30; height: 64px; border-bottom: 1px solid rgba(220, 232, 233, .86); background: rgba(248, 251, 251, .92); backdrop-filter: blur(18px); }
.app-header__inner { display: flex; align-items: center; gap: 12px; width: min(100%, 1120px); height: 100%; margin: 0 auto; padding: 0 18px; }
.app-header__page { display: none; color: var(--muted); font-size: .82rem; font-weight: 700; }
.app-header .icon-button { margin-left: auto; }

.brand { display: inline-flex; align-items: center; gap: 10px; width: fit-content; }
.brand__mark { display: grid; flex: none; width: 42px; height: 42px; place-items: center; border-radius: 14px; background: linear-gradient(145deg, #0f9492, #086d78); box-shadow: 0 8px 20px rgba(11, 127, 130, .22); }
.brand__mark svg { width: 30px; height: 30px; }
.brand__mark svg path:first-child { fill: rgba(255, 255, 255, .13); stroke: #fff; stroke-width: 1.8; }
.brand__mark svg path:last-child { fill: none; stroke: #fff; stroke-width: 2.3; stroke-linecap: round; }
.brand__word { display: inline-flex; align-items: baseline; color: var(--navy); font-size: 1.18rem; letter-spacing: -.04em; }
.brand__word strong { color: var(--teal); }
.brand__word small { align-self: flex-start; margin: 0 0 0 4px; padding: 2px 5px; border-radius: 6px; background: var(--teal-soft); color: var(--teal-dark); font-size: .52rem; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; }
.brand--compact .brand__mark { width: 35px; height: 35px; border-radius: 11px; box-shadow: none; }
.brand--compact .brand__mark svg { width: 25px; height: 25px; }
.brand--compact .brand__word { font-size: 1rem; }

.avatar, .profile-avatar { display: grid; place-items: center; border: 1px solid #bcdada; background: linear-gradient(145deg, #e6f4f3, #cbe7e5); color: var(--teal-dark); font-weight: 800; }
.avatar { width: 35px; height: 35px; border-radius: 50%; font-size: .82rem; }
.profile-avatar { width: 68px; height: 68px; border-radius: 22px; font-size: 1.25rem; box-shadow: var(--shadow-sm); }
.icon-button { display: inline-grid; min-width: 38px; height: 38px; padding: 0; place-items: center; border-radius: 12px; background: transparent; color: var(--ink-soft); cursor: pointer; }
.icon-button:hover { background: var(--surface-tint); color: var(--teal); }

.app-shell { width: min(100%, 1120px); margin: 0 auto; }
.app-main { min-height: calc(100vh - 64px); padding: 22px 16px calc(108px + var(--safe-bottom)); }
.app-nav { position: fixed; right: 0; bottom: 0; left: 0; z-index: 40; padding-bottom: var(--safe-bottom); border-top: 1px solid var(--line); background: rgba(255, 255, 255, .96); box-shadow: 0 -12px 30px rgba(25, 63, 72, .08); backdrop-filter: blur(18px); }
.app-nav__inner { display: grid; grid-template-columns: repeat(5, 1fr); width: min(100%, 720px); height: 70px; margin: 0 auto; padding: 0 7px; }
.app-nav__item { position: relative; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 4px; color: #789097; font-size: .65rem; font-weight: 700; }
.app-nav__item::after { position: absolute; top: 0; width: 22px; height: 3px; border-radius: 0 0 4px 4px; background: transparent; content: ""; }
.app-nav__item.is-active { color: var(--teal); }
.app-nav__item.is-active::after { background: var(--teal); }
.app-nav__icon { display: grid; place-items: center; }

.eyebrow { display: inline-block; margin-bottom: 5px; color: var(--teal); font-size: .68rem; font-weight: 850; letter-spacing: .11em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { color: var(--ink); letter-spacing: -.035em; }
h1 { margin-bottom: 7px; font-size: clamp(1.75rem, 8vw, 2.65rem); line-height: 1.05; }
h2 { margin-bottom: 0; font-size: 1.22rem; line-height: 1.2; }
h3 { font-size: 1rem; }
p { color: var(--ink-soft); line-height: 1.55; }

.welcome-block { position: relative; display: flex; min-height: 136px; align-items: center; justify-content: space-between; gap: 16px; overflow: hidden; margin-bottom: 16px; padding: 24px 21px; border: 1px solid #d6e8e7; border-radius: var(--radius-lg); background: linear-gradient(125deg, #fff 8%, #edf8f6 100%); box-shadow: var(--shadow-sm); }
.welcome-block::after { position: absolute; right: -50px; bottom: -65px; width: 180px; height: 180px; border: 1px solid rgba(11, 127, 130, .10); border-radius: 50%; content: ""; }
.welcome-block h1 { margin-bottom: 4px; }
.welcome-block p { margin: 0; font-size: .92rem; }
.health-orbit { position: relative; display: grid; flex: 0 0 82px; height: 82px; place-items: center; }
.health-orbit__core { position: relative; z-index: 2; display: grid; width: 52px; height: 52px; place-items: center; border-radius: 19px; background: linear-gradient(145deg, #139c97, #08717b); color: #fff; box-shadow: 0 12px 25px rgba(11, 127, 130, .25); }
.health-orbit__ring { position: absolute; inset: 2px; border: 1px solid rgba(11, 127, 130, .22); border-radius: 50%; }
.health-orbit i { position: absolute; width: 7px; height: 7px; border: 2px solid #edf8f6; border-radius: 50%; background: var(--teal); }
.health-orbit i:nth-of-type(1) { top: 4px; left: 18px; }
.health-orbit i:nth-of-type(2) { right: 1px; bottom: 23px; }
.health-orbit i:nth-of-type(3) { bottom: 6px; left: 12px; background: var(--blue); }

.upload-hero { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 13px; margin-bottom: 28px; padding: 16px; border-radius: var(--radius); background: linear-gradient(105deg, #0b8384, #0d7180); color: #fff; box-shadow: 0 14px 30px rgba(11, 112, 122, .2); }
.upload-hero__icon { display: grid; width: 48px; height: 48px; place-items: center; border: 1px solid rgba(255, 255, 255, .18); border-radius: 15px; background: rgba(255, 255, 255, .12); }
.upload-hero strong, .upload-hero small { display: block; }
.upload-hero strong { font-size: .98rem; }
.upload-hero small { margin-top: 3px; color: rgba(255, 255, 255, .76); font-size: .76rem; }

.section-block, .detail-section { margin: 0 0 28px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.section-heading a, .text-button { padding: 5px 0; background: none; color: var(--teal); font-size: .78rem; font-weight: 800; cursor: pointer; }
.text-button { display: inline-flex; align-items: center; gap: 4px; }
.accent-icon { color: var(--teal); }

.study-list { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.study-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 11px; min-height: 72px; padding: 12px 13px; border-bottom: 1px solid var(--line-soft); }
.study-row:last-child { border-bottom: 0; }
.study-row:hover { background: #fbfdfd; }
.study-row__icon { display: grid; width: 43px; height: 43px; place-items: center; border-radius: 14px; background: var(--surface-tint); color: var(--teal); }
.study-row__icon--imagen { background: var(--blue-soft); color: var(--blue); }
.study-row__icon--cardiologia { background: var(--red-soft); color: var(--red); }
.study-row__icon--informe, .study-row__icon--documento { background: #f1effb; color: #7566ae; }
.study-row__body { min-width: 0; }
.study-row__body strong, .study-row__body small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.study-row__body strong { margin-bottom: 4px; font-size: .88rem; }
.study-row__body small { color: var(--muted); font-size: .7rem; }
.study-row__chevron { display: none; color: #a4b5b9; }
.status-pill { display: inline-flex; width: fit-content; align-items: center; padding: 5px 8px; border-radius: 999px; background: #eff4f4; color: #677f85; font-size: .59rem; font-style: normal; font-weight: 850; white-space: nowrap; }
.status-pill--success { background: var(--green-soft); color: #277b5b; }
.status-pill--info { background: var(--blue-soft); color: #3f75bf; }
.status-pill--warning { background: var(--amber-soft); color: #9c641c; }

.empty-card { padding: 30px 22px; border: 1px dashed #c9dddd; border-radius: var(--radius); background: rgba(255, 255, 255, .72); text-align: center; }
.empty-card--wide { margin-top: 20px; }
.empty-card__visual { position: relative; display: grid; width: 82px; height: 68px; margin: 0 auto 16px; place-items: center; }
.empty-card__visual span { position: relative; z-index: 3; display: grid; width: 56px; height: 56px; place-items: center; border-radius: 18px; background: var(--teal-soft); color: var(--teal); }
.empty-card__visual i { position: absolute; width: 36px; height: 45px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.empty-card__visual i:nth-child(2) { left: 3px; transform: rotate(-12deg); }
.empty-card__visual i:nth-child(3) { right: 3px; transform: rotate(12deg); }
.empty-card h3 { margin-bottom: 7px; }
.empty-card p { max-width: 450px; margin: 0 auto 18px; font-size: .82rem; }

.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.stat-card { padding: 13px 10px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); text-align: center; }
.stat-card span, .stat-card small { display: block; color: var(--muted); font-size: .63rem; }
.stat-card strong { display: block; margin: 3px 0 1px; color: var(--navy); font-size: 1.35rem; }

.ai-summary-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 13px; padding: 17px; border: 1px solid #cde4e3; border-radius: var(--radius); background: linear-gradient(130deg, #f1faf8, #fff); box-shadow: var(--shadow-sm); }
.ai-summary-card__icon { display: grid; width: 48px; height: 48px; place-items: center; border-radius: 16px; background: linear-gradient(145deg, #ccece8, #eaf8f6); color: var(--teal); }
.ai-summary-card__body strong, .ai-summary-card__body small { display: block; }
.ai-summary-card__body strong { margin-bottom: 4px; font-size: .88rem; }
.ai-summary-card__body small { color: var(--ink-soft); font-size: .71rem; line-height: 1.4; }
.medical-disclaimer { display: flex; align-items: flex-start; justify-content: center; gap: 6px; margin: 15px auto 0; color: var(--muted); font-size: .67rem; text-align: center; }
.medical-disclaimer svg { margin-top: 1px; }

.page-heading { margin-bottom: 18px; }
.page-heading p { margin: 0; font-size: .86rem; }
.page-heading--center { max-width: 540px; margin-right: auto; margin-left: auto; text-align: center; }
.upload-page-icon { display: grid; width: 58px; height: 58px; margin: 0 auto 13px; place-items: center; border-radius: 19px; background: var(--teal-soft); color: var(--teal); }

.filter-panel { margin-bottom: 20px; }
.search-field { display: flex; align-items: center; gap: 9px; height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: 0 3px 12px rgba(27, 72, 82, .04); color: var(--muted); }
.search-field:focus-within { border-color: #8ac6c3; box-shadow: 0 0 0 3px rgba(11, 127, 130, .09); }
.search-field input { width: 100%; border: 0; outline: 0; background: transparent; font-size: .84rem; }
.filter-chips { display: flex; gap: 7px; overflow-x: auto; margin: 10px -16px 0; padding: 0 16px 4px; scrollbar-width: none; }
.filter-chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink-soft); font-size: .7rem; font-weight: 750; cursor: pointer; }
.chip.is-active { border-color: var(--teal); background: var(--teal); color: #fff; }
.chip--select { display: flex; align-items: center; gap: 3px; padding: 0 9px; }
.chip--select select { height: 32px; border: 0; outline: 0; background: transparent; color: inherit; font-size: inherit; font-weight: inherit; }

.view-mode { margin-bottom: 13px; }
.view-mode > span { display: block; margin: 0 0 6px 3px; color: var(--muted); font-size: .65rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.study-view-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 14px; background: #eaf1f2; }
.study-view-switch a { display: flex; min-height: 38px; align-items: center; justify-content: center; gap: 6px; border-radius: 10px; color: var(--ink-soft); font-size: .7rem; font-weight: 800; }
.study-view-switch a.is-active { background: #fff; color: var(--teal); box-shadow: 0 3px 10px rgba(25, 69, 79, .08); }

.followup-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 9px; margin-bottom: 13px; }
.followup-toolbar__search, .group-picker__search { display: flex; min-width: 0; height: 42px; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--line); border-radius: 13px; background: #fff; color: var(--muted); }
.followup-toolbar__search:focus-within, .group-picker__search:focus-within { border-color: #8ac6c3; box-shadow: 0 0 0 3px rgba(11, 127, 130, .09); }
.followup-toolbar__search input, .group-picker__search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; font-size: .78rem; }
.followup-folder-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.followup-folder-card { --folder-accent: var(--teal); --folder-bg: var(--teal-soft); position: relative; min-width: 0; overflow: hidden; border: 1px solid #cee2e1; border-radius: 17px; background: linear-gradient(135deg, var(--folder-bg), #fff 90%); box-shadow: 0 4px 14px rgba(25, 69, 79, .05); }
.followup-folder-card--neutral { --folder-accent: #6e858b; --folder-bg: #edf2f2; }
.followup-folder-card--blue { --folder-accent: #4d86d9; --folder-bg: #eaf1fc; }
.followup-folder-card--purple { --folder-accent: #7566ae; --folder-bg: #f1effb; }
.followup-folder-card--amber { --folder-accent: #b87721; --folder-bg: #fff4df; }
.followup-folder-card--green { --folder-accent: #2f966d; --folder-bg: #e5f5ed; }
.followup-folder-card--coral { --folder-accent: #b75b68; --folder-bg: #fcebed; }
.followup-folder-card > a { display: grid; min-height: 112px; grid-template-columns: 1fr auto; align-content: space-between; gap: 8px; padding: 14px 44px 13px 14px; }
.followup-folder-card__icon { display: block; grid-column: 1 / -1; color: var(--folder-accent); }
.followup-folder-card__body { min-width: 0; align-self: end; }
.followup-folder-card__body strong, .followup-folder-card__body small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.followup-folder-card__body strong { color: var(--ink); font-size: .78rem; }
.followup-folder-card__body small { margin-top: 4px; color: var(--muted); font-size: .62rem; }
.followup-folder-card__chevron { align-self: end; color: #91a5a9; }
.followup-folder-card__edit { position: absolute; top: 7px; right: 7px; z-index: 2; width: 33px; min-width: 33px; height: 33px; background: rgba(255, 255, 255, .72); }
.followup-folder-card[hidden] { display: none; }
.followup-no-results { padding: 28px 18px; border: 1px dashed #c9dddd; border-radius: 17px; color: var(--muted); font-size: .72rem; text-align: center; }

.followup-group__icon { display: grid; width: 41px; height: 41px; place-items: center; border-radius: 13px; background: var(--teal-soft); color: var(--teal); }
.followup-group__icon--neutral { background: #edf2f2; color: #6e858b; }
.followup-group__icon--blue { background: #eaf1fc; color: #4d86d9; }
.followup-group__icon--purple { background: #f1effb; color: #7566ae; }
.followup-group__icon--amber { background: #fff4df; color: #b87721; }
.followup-group__icon--green { background: #e5f5ed; color: #2f966d; }
.followup-group__icon--coral { background: #fcebed; color: #b75b68; }
.followup-open { overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: rgba(255, 255, 255, .75); box-shadow: var(--shadow-sm); }
.followup-open__heading { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 13px; border-bottom: 1px solid var(--line-soft); background: #fff; }
.followup-open__heading h2 { margin: 0 0 3px; font-size: 1rem; }
.followup-open__heading p { margin: 0; color: var(--muted); font-size: .62rem; }
.followup-open__heading .eyebrow { margin-bottom: 2px; font-size: .56rem; }
.followup-open__back { display: grid; width: 34px; height: 38px; place-items: center; border-radius: 11px; color: var(--teal); transform: rotate(180deg); }
.followup-open__back:hover { background: var(--surface-tint); }
.followup-open__items { padding: 9px; }
.followup-open__items .timeline-item { border-left: 1px solid var(--line); border-radius: 15px; }
.followup-open__items .timeline-item__dot { display: none; }
.followup-open__items .timeline-item__main { grid-template-columns: 37px 42px minmax(0, 1fr); padding-left: 4px; }
.followup-group__empty { display: flex; min-height: 120px; align-items: center; justify-content: center; flex-direction: column; gap: 7px; border: 1px dashed #cddfdf; border-radius: 14px; color: var(--muted); font-size: .66rem; text-align: center; }
.followup-group__empty strong { color: var(--ink-soft); font-size: .76rem; }

.group-picker { max-height: min(680px, calc(100vh - 30px)); grid-template-rows: auto auto minmax(0, 1fr) auto; }
.group-picker__options { display: grid; gap: 7px; overflow-y: auto; overscroll-behavior: contain; }
.group-picker__options > button { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 58px; padding: 8px 10px; border: 1px solid var(--line-soft); border-radius: 14px; background: #fbfdfd; color: var(--ink); cursor: pointer; text-align: left; }
.group-picker__options > button:hover { border-color: #add3d0; background: var(--surface-tint); }
.group-picker__options > button.is-current { border-color: #9dcac7; background: var(--surface-tint); }
.group-picker__options > button[hidden] { display: none; }
.group-picker__options > button:disabled { opacity: .62; cursor: wait; }
.group-picker__options strong { overflow: hidden; font-size: .76rem; text-overflow: ellipsis; white-space: nowrap; }
.group-picker__options small { color: var(--teal); font-size: .59rem; font-weight: 800; }
.group-picker__options .followup-group__icon { width: 39px; height: 39px; }
.group-picker__empty { margin: 0; padding: 18px; color: var(--muted); font-size: .7rem; text-align: center; }
.organizer-toast { position: fixed; right: 16px; bottom: calc(91px + var(--safe-bottom)); left: 16px; z-index: 130; margin: auto; max-width: 430px; padding: 12px 14px; border-radius: 13px; background: var(--navy); color: #fff; box-shadow: var(--shadow-md); font-size: .72rem; font-weight: 750; text-align: center; }
.organizer-toast[hidden] { display: none; }
.organizer-toast.is-error { background: #873b44; }
.dialog-copy { margin: 0; color: var(--ink-soft); font-size: .72rem; line-height: 1.5; }
.danger-text { color: var(--red); }
.study-group-badge { width: fit-content; margin-top: 7px !important; padding: 4px 7px; border-radius: 8px; background: var(--teal-soft); color: var(--teal-dark) !important; font-weight: 800; }
.study-group-badge--blue { background: #eaf1fc; color: #3f75bf !important; }
.study-group-badge--purple { background: #f1effb; color: #695a9f !important; }
.study-group-badge--amber { background: #fff4df; color: #956018 !important; }
.study-group-badge--green { background: #e5f5ed; color: #277b5b !important; }
.study-group-badge--coral { background: #fcebed; color: #9a4855 !important; }

.timeline-group { margin-bottom: 23px; }
.timeline-group > h2 { margin: 0 0 9px 64px; color: var(--muted); font-size: .66rem; letter-spacing: .1em; }
.timeline-group__items { position: relative; }
.timeline-group__items::before { position: absolute; top: 17px; bottom: 17px; left: 48px; width: 1px; background: #cfe0e0; content: ""; }
.timeline-item { position: relative; min-height: 82px; margin-bottom: 8px; overflow: hidden; border: 1px solid var(--line); border-radius: 0 var(--radius) var(--radius) 0; border-left: 0; background: #fff; box-shadow: 0 4px 15px rgba(25, 69, 79, .045); transition: opacity .18s ease, transform .18s ease, box-shadow .18s ease; }
.timeline-item__main { display: grid; grid-template-columns: 37px 10px 42px minmax(0, 1fr); align-items: center; gap: 8px; min-height: 82px; padding: 10px 46px 10px 0; }
.timeline-item:hover { box-shadow: 0 7px 19px rgba(25, 69, 79, .08); }
.timeline-item time { display: flex; align-items: center; flex-direction: column; color: var(--ink-soft); line-height: 1; }
.timeline-item time strong { font-size: 1rem; }
.timeline-item time span { margin-top: 4px; color: var(--muted); font-size: .6rem; }
.timeline-item__dot { position: relative; z-index: 2; width: 9px; height: 9px; border: 2px solid #fff; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 1px var(--teal); }
.timeline-item .study-row__icon { width: 39px; height: 39px; border-radius: 13px; }
.timeline-item__body { min-width: 0; }
.timeline-item__body strong, .timeline-item__body small, .timeline-item__body em { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timeline-item__body strong { margin-bottom: 4px; font-size: .83rem; }
.timeline-item__body small { margin-bottom: 3px; color: var(--muted); font-size: .67rem; }
.timeline-item__body em { color: #8ea1a6; font-size: .58rem; font-style: normal; font-weight: 700; text-transform: uppercase; }
.timeline-item__group { display: inline-flex; width: fit-content; max-width: 100%; align-items: center; gap: 3px; margin-top: 5px; padding: 3px 6px; border-radius: 7px; background: var(--surface-tint); color: var(--teal-dark); font-size: .55rem; }
.timeline-item__group b { overflow: hidden; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.timeline-item__group--neutral { background: #edf2f2; color: #60777d; }
.timeline-item__group--blue { background: #eaf1fc; color: #3f75bf; }
.timeline-item__group--purple { background: #f1effb; color: #695a9f; }
.timeline-item__group--amber { background: #fff4df; color: #956018; }
.timeline-item__group--green { background: #e5f5ed; color: #277b5b; }
.timeline-item__group--coral { background: #fcebed; color: #9a4855; }
.timeline-item .status-pill { display: none; }
.timeline-item__chevron { display: none; }
.study-organize-button { position: absolute; top: 50%; right: 6px; z-index: 2; display: flex; width: 39px; height: 52px; align-items: center; justify-content: center; flex-direction: column; gap: 2px; padding: 0; border-radius: 11px; background: var(--surface-soft); color: #6f888e; cursor: pointer; }
.study-organize-button small { font-size: .48rem; font-weight: 800; }
.study-organize-button:hover { background: var(--teal-soft); color: var(--teal); }
.floating-upload { position: fixed; right: 17px; bottom: calc(86px + var(--safe-bottom)); z-index: 20; display: flex; align-items: center; gap: 6px; padding: 13px 16px; border-radius: 16px; background: var(--teal); color: #fff; box-shadow: 0 12px 28px rgba(11, 127, 130, .3); font-size: .76rem; font-weight: 800; }

.form-alert { display: flex; align-items: flex-start; flex-direction: column; gap: 3px; margin-bottom: 15px; padding: 12px 14px; border-radius: 13px; font-size: .78rem; line-height: 1.45; }
.form-alert--error { border: 1px solid #f2c6cc; background: var(--red-soft); color: #873b44; }

.duplicate-dialog .dialog-card { max-width: 520px; }
.duplicate-dialog__notice { display: grid; grid-template-columns: auto minmax(0,1fr); align-items: start; gap: 9px; margin-bottom: 10px; padding: 11px; border: 1px solid #efd596; border-radius: 12px; background: #fff9e9; color: #745815; }
.duplicate-dialog__notice > span { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; background: #ffe9af; }
.duplicate-dialog__notice p { margin: 0; font-size: .67rem; line-height: 1.5; }
.duplicate-dialog--danger .duplicate-dialog__notice { border-color: #efb8c0; background: var(--red-soft); color: #873b44; }
.duplicate-dialog--danger .duplicate-dialog__notice > span { background: #f7cfd5; }
.duplicate-dialog__existing { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 9px; margin-bottom: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); color: var(--ink); }
.duplicate-dialog__existing > span:first-child { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; background: #e4f2f1; color: var(--teal); }
.duplicate-dialog__existing strong, .duplicate-dialog__existing small { display: block; }
.duplicate-dialog__existing strong { font-size: .64rem; }
.duplicate-dialog__existing small { margin-top: 3px; color: var(--muted); font-size: .52rem; line-height: 1.35; }
.duplicate-dialog__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.duplicate-dialog__actions .button { flex: 1 1 130px; justify-content: center; }
.duplicate-dialog__danger-button { border-color: var(--red) !important; background: var(--red) !important; color: #fff !important; }
.form-alert--success { border: 1px solid #bfe2ce; background: var(--green-soft); color: #276d52; }
.flash { margin-bottom: 15px; padding: 12px 14px; border: 1px solid; border-radius: 13px; font-size: .78rem; font-weight: 700; }
.flash--success { border-color: #bfe2ce; background: var(--green-soft); color: #276d52; }
.flash--error { border-color: #f2c6cc; background: var(--red-soft); color: #873b44; }
.flash--info { border-color: #cbdcf3; background: var(--blue-soft); color: #3d6eaf; }

.upload-form { max-width: 760px; margin: 0 auto; }
.form-card { margin-bottom: 14px; padding: 17px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); }
.form-card__heading { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 15px; }
.form-card__heading > span { display: grid; flex: 0 0 27px; height: 27px; place-items: center; border-radius: 9px; background: var(--teal-soft); color: var(--teal); font-size: .7rem; font-weight: 850; }
.form-card__heading h2 { margin: 1px 0 3px; font-size: 1rem; }
.form-card__heading p { margin: 0; font-size: .72rem; }
.upload-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.upload-choices--single { grid-template-columns: 1fr; }
.upload-choice { position: relative; display: flex; align-items: center; flex-direction: column; gap: 5px; min-height: 116px; justify-content: center; overflow: hidden; border: 1px dashed #afd2d0; border-radius: 15px; background: #f7fbfb; color: var(--teal); cursor: pointer; text-align: center; }
.upload-choice:hover { border-color: var(--teal); background: var(--surface-tint); }
.upload-choice input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.upload-choice > span { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 12px; background: var(--teal-soft); }
.upload-choice strong { color: var(--ink); font-size: .78rem; }
.upload-choice small { color: var(--muted); font-size: .63rem; }
.selected-files { margin-top: 11px; }
.selected-files > p { margin: 0; color: var(--muted); font-size: .68rem; text-align: center; }
.selected-files__item { display: flex; align-items: center; gap: 8px; margin-top: 6px; padding: 9px 10px; border-radius: 11px; background: var(--surface-soft); font-size: .7rem; }
.selected-files__item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selected-files__item small { margin-left: auto; color: var(--muted); }
.field-help { margin: 10px 0 0; color: var(--muted); font-size: .64rem; text-align: center; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-stack { display: grid; gap: 13px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field { display: flex; min-width: 0; flex-direction: column; gap: 6px; color: var(--ink-soft); font-size: .72rem; font-weight: 750; }
.field--full { grid-column: 1 / -1; }
.field span { display: flex; justify-content: space-between; }
.field em { color: #9aacb1; font-size: .62rem; font-style: normal; font-weight: 600; }
.field small { color: var(--muted); font-size: .62rem; font-weight: 500; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--line); border-radius: 12px; outline: 0; background: #fbfdfd; color: var(--ink); font-size: .78rem; font-weight: 500; }
.field input, .field select { height: 44px; padding: 0 12px; }
.field textarea { min-height: 76px; padding: 11px 12px; resize: vertical; line-height: 1.45; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #80bfbd; background: #fff; box-shadow: 0 0 0 3px rgba(11, 127, 130, .08); }
.inline-button { display: inline; padding: 0; border: 0; background: transparent; cursor: pointer; font: inherit; }
.inline-button:disabled { color: #9aacb1; cursor: not-allowed; text-decoration: none; }
.form-subsection { display: flex; align-items: center; gap: 9px; margin-top: 3px; padding: 11px 12px; border-radius: 12px; background: var(--surface-tint); color: var(--ink); }
.form-subsection strong, .form-subsection small { display: block; }
.form-subsection strong { font-size: .72rem; }
.form-subsection small { margin-top: 3px; color: var(--muted); font-size: .6rem; }
.inline-create-form { margin: 11px 0 13px; padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-soft); }
.compact-list { margin-top: 10px; }
.section-empty-copy { margin: 10px 0 0; color: var(--muted); font-size: .68rem; }
.catalog-selected-place { margin: 0; padding: 10px 11px; border-radius: 11px; background: var(--teal-soft); color: var(--teal-dark); font-size: .68rem; font-weight: 750; }

.process-preview { display: flex; align-items: center; justify-content: center; gap: 4px; margin: 20px 0 14px; }
.process-preview div { display: flex; max-width: 92px; align-items: center; flex-direction: column; gap: 5px; color: var(--muted); text-align: center; }
.process-preview div span { display: grid; width: 33px; height: 33px; place-items: center; border-radius: 11px; background: var(--surface-tint); color: var(--teal); }
.process-preview div strong { font-size: .57rem; line-height: 1.3; }
.process-preview > i { margin-top: -16px; color: #aebfc2; transform: scale(.75); }

.button { display: inline-flex; min-height: 43px; align-items: center; justify-content: center; gap: 7px; padding: 10px 16px; border-radius: 13px; font-size: .78rem; font-weight: 800; cursor: pointer; }
.button--primary { background: linear-gradient(120deg, var(--teal), #08717c); color: #fff; box-shadow: 0 9px 20px rgba(11, 127, 130, .16); }
.button--primary:hover { background: linear-gradient(120deg, var(--teal-dark), #075e6b); }
.button--soft { background: var(--teal-soft); color: var(--teal-dark); }
.button--ghost { border: 1px solid var(--line); background: #fff; color: var(--ink-soft); }
.button--disabled, .button:disabled { background: #e9eeee; color: #87999d; box-shadow: none; cursor: not-allowed; }
.button--full { width: 100%; }
.button--large { min-height: 51px; border-radius: 15px; }
.button--small { min-height: 36px; padding: 7px 11px; font-size: .7rem; }
.button.is-loading { pointer-events: none; opacity: .75; }
.button.is-processing .icon { animation: processing-pulse 1.25s ease-in-out infinite; }
.button.is-processing:disabled { background: linear-gradient(120deg, var(--teal), #08717c); color: #fff; box-shadow: 0 9px 20px rgba(11, 127, 130, .16); cursor: wait; opacity: .88; }

.detail-back { margin: -4px 0 15px; }
.detail-back a { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-soft); font-size: .72rem; font-weight: 750; }
.icon-rotate { display: inline-block; transform: rotate(180deg); }
.study-hero { position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: 13px; margin-bottom: 23px; padding: 19px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: linear-gradient(130deg, #fff, #f0f8f7); box-shadow: var(--shadow-sm); }
.study-hero__icon { width: 52px; height: 52px; border-radius: 17px; }
.study-hero__body { min-width: 0; }
.study-hero__body h1 { margin: 7px 0 8px; font-size: 1.45rem; word-break: break-word; }
.study-hero__body p { display: flex; align-items: center; gap: 5px; margin: 3px 0; color: var(--ink-soft); font-size: .72rem; }
.menu-details { position: relative; }
.menu-details summary { list-style: none; }
.menu-details summary::-webkit-details-marker { display: none; }
.menu-details__panel { position: absolute; top: 43px; right: 0; z-index: 15; width: 230px; padding: 7px; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: var(--shadow-md); }
.menu-details__panel button { display: flex; width: 100%; align-items: center; gap: 7px; padding: 10px; border-radius: 9px; background: transparent; color: var(--ink-soft); font-size: .72rem; font-weight: 700; text-align: left; cursor: pointer; }
.menu-details__panel button:hover { background: var(--surface-soft); }
.menu-details__panel .danger { color: var(--red); }
.privacy-badge { display: inline-flex; align-items: center; gap: 4px; padding: 5px 8px; border-radius: 999px; background: var(--green-soft); color: #2d7659; font-size: .59rem; font-weight: 800; white-space: nowrap; }

.study-section-nav { position: sticky; top: 72px; z-index: 12; display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin: -8px 0 28px; padding: 5px; border: 1px solid rgba(220, 232, 233, .9); border-radius: 15px; background: rgba(255, 255, 255, .94); box-shadow: var(--shadow-sm); backdrop-filter: blur(14px); }
.study-section-nav a { display: flex; min-width: 0; min-height: 39px; align-items: center; justify-content: center; gap: 5px; padding: 7px 8px; border-radius: 11px; color: var(--ink-soft); font-size: .67rem; font-weight: 800; }
.study-section-nav a:hover { background: var(--surface-tint); color: var(--teal); }
.study-section-nav b { min-width: 18px; padding: 2px 5px; border-radius: 999px; background: #edf3f3; color: var(--muted); font-size: .52rem; text-align: center; }

.study-files-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px; padding: 10px 11px; border: 1px solid #d5e6e6; border-radius: 13px; background: #f7fbfb; }
.study-files-toolbar p { margin: 0; font-size: .67rem; line-height: 1.45; }
.study-files-toolbar .button { flex: none; }
.study-file-list { display: grid; gap: 8px; }
.study-file-item { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 3px 12px rgba(30, 78, 88, .035); }
.study-file-item__main { display: grid; width: 100%; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 12px; background: transparent; text-align: left; cursor: pointer; }
.study-file-item__main:hover { background: #fbfdfd; }
.file-row__icon { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; background: var(--surface-tint); color: var(--teal); }
.study-file-item__copy { min-width: 0; }
.study-file-item__copy strong, .study-file-item__copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.study-file-item__copy strong { font-size: .74rem; }
.study-file-item__copy small { margin-top: 3px; color: var(--muted); font-size: .59rem; text-transform: uppercase; }
.study-file-open { display: inline-flex; align-items: center; gap: 2px; color: var(--teal); font-size: .62rem; font-weight: 850; }
.study-file-actions { display: flex; justify-content: flex-end; border-top: 1px solid var(--line-soft); background: #fbfdfd; }
.study-file-actions button, .study-file-actions a { display: inline-flex; min-height: 36px; align-items: center; gap: 5px; padding: 7px 12px; border-left: 1px solid var(--line-soft); background: transparent; color: var(--ink-soft); font-size: .62rem; font-weight: 800; cursor: pointer; }
.study-file-actions button:hover, .study-file-actions a:hover { background: var(--surface-tint); color: var(--teal); }
.file-privacy-note { display: flex; align-items: flex-start; gap: 6px; margin: 10px 2px 0; color: var(--muted); font-size: .59rem; line-height: 1.45; }
.file-share-feedback, .values-feedback { margin: 0 0 9px; padding: 9px 11px; border: 1px solid #bedfd2; border-radius: 11px; background: var(--green-soft); color: #276d52; font-size: .65rem; font-weight: 700; }
.file-share-feedback.is-error, .values-feedback.is-error { border-color: #f1c6cb; background: var(--red-soft); color: #873b44; }

.file-viewer-dialog { width: min(1000px, calc(100% - 24px)); max-width: 1000px; max-height: calc(100dvh - 24px); overflow: hidden; border-radius: 18px; }
.file-viewer { display: flex; height: min(840px, calc(100dvh - 24px)); flex-direction: column; overflow: hidden; border-radius: 18px; background: #eef3f3; }
.file-viewer__header { display: flex; min-height: 62px; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 10px 9px 14px; border-bottom: 1px solid var(--line); background: #fff; }
.file-viewer__header > div:first-child { min-width: 0; }
.file-viewer__header small, .file-viewer__header strong { display: block; }
.file-viewer__header small { margin-bottom: 2px; color: var(--muted); font-size: .55rem; text-transform: uppercase; }
.file-viewer__header strong { overflow: hidden; font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.file-viewer__actions { display: flex; flex: none; align-items: center; gap: 3px; }
.file-viewer__actions > button:not(.icon-button), .file-viewer__actions > a { display: inline-flex; min-height: 38px; align-items: center; gap: 5px; padding: 7px 9px; border-radius: 10px; background: transparent; color: var(--teal); font-size: .61rem; font-weight: 800; cursor: pointer; }
.file-viewer__actions > button:hover, .file-viewer__actions > a:hover { background: var(--surface-tint); }
.file-viewer__body { display: grid; min-height: 0; flex: 1; place-items: center; overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.file-viewer__body iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.file-viewer__body img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.file-viewer__unavailable { display: flex; align-items: center; flex-direction: column; gap: 6px; padding: 28px; color: var(--muted); text-align: center; }
.file-viewer__unavailable strong { color: var(--ink); font-size: .85rem; }
.file-viewer__unavailable span { font-size: .68rem; }

.empty-inline, .summary-placeholder { display: flex; align-items: center; gap: 12px; padding: 18px; border: 1px dashed #cbdede; border-radius: var(--radius); background: rgba(255, 255, 255, .65); }
.empty-inline > span, .summary-placeholder > span { display: grid; flex: 0 0 43px; height: 43px; place-items: center; border-radius: 14px; background: var(--teal-soft); color: var(--teal); }
.empty-inline strong, .summary-placeholder strong { font-size: .77rem; }
.empty-inline p, .summary-placeholder p { margin: 3px 0 0; font-size: .68rem; }

.values-workspace { min-width: 0; }
.results-overview { display: grid; grid-template-columns: repeat(3, 1fr); overflow: hidden; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.results-overview span { padding: 9px 7px; border-right: 1px solid var(--line-soft); color: var(--muted); font-size: .59rem; text-align: center; }
.results-overview span:last-child { border-right: 0; }
.results-overview strong { display: block; margin-bottom: 1px; color: var(--navy); font-size: .82rem; }
.result-tabs { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 8px; padding: 4px; border-radius: 13px; background: #eaf1f1; }
.result-tabs button { display: flex; min-height: 37px; align-items: center; justify-content: center; gap: 6px; border-radius: 10px; background: transparent; color: var(--muted); font-size: .67rem; font-weight: 850; cursor: pointer; }
.result-tabs button.is-active { background: #fff; color: var(--teal-dark); box-shadow: 0 2px 8px rgba(30, 78, 88, .08); }
.result-tabs b, .result-filters b { min-width: 18px; padding: 2px 5px; border-radius: 999px; background: rgba(11, 127, 130, .09); color: currentColor; font-size: .51rem; }
.result-filters { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 9px; padding-bottom: 2px; scrollbar-width: none; }
.result-filters::-webkit-scrollbar { display: none; }
.result-filters button { display: inline-flex; flex: none; min-height: 32px; align-items: center; gap: 5px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink-soft); font-size: .59rem; font-weight: 800; cursor: pointer; }
.result-filters button.is-active { border-color: #83bebc; background: var(--teal-soft); color: var(--teal-dark); }
.result-dot { display: inline-block; flex: none; width: 9px; height: 9px; border: 2px solid #fff; border-radius: 50%; background: #8da0a5; box-shadow: 0 0 0 1px #b8c6c9; }
.result-dot--normal { background: var(--green); box-shadow: 0 0 0 1px var(--green); }
.result-dot--attention { background: #e38a17; box-shadow: 0 0 0 1px #e38a17; }
.result-dot--critical { background: #d62f40; box-shadow: 0 0 0 1px #d62f40; }
.result-dot--unknown { background: #8da0a5; }
.results-table { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow-sm); }
.result-row { display: grid; grid-template-columns: minmax(145px, 1.35fr) minmax(95px, .8fr) minmax(110px, 1fr) minmax(120px, 1fr) auto; align-items: center; gap: 8px; min-height: 58px; padding: 8px 10px; border-bottom: 1px solid var(--line-soft); border-left: 4px solid #a7b6b9; }
.result-row:last-child { border-bottom: 0; }
.result-row--normal { border-left-color: var(--green); }
.result-row--attention { border-left-color: #e38a17; background: #fffcf7; }
.result-row--critical { border-left-color: #d62f40; background: #fff8f8; }
.result-row--header { min-height: 34px; padding-top: 7px; padding-bottom: 7px; border-left-color: transparent; background: #f5f9f9; color: var(--muted); font-size: .54rem; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.result-cell { min-width: 0; }
.result-cell--parameter { display: flex; align-items: center; gap: 7px; }
.result-cell--parameter span { min-width: 0; }
.result-cell--parameter strong, .result-cell--parameter small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-cell--parameter strong { font-size: .69rem; }
.result-cell--parameter small { margin-top: 2px; color: var(--muted); font-size: .53rem; }
.result-cell--value { display: flex; align-items: baseline; gap: 4px; }
.result-cell--value strong { color: var(--navy); font-size: .83rem; }
.result-cell--value small, .result-cell--reference { color: var(--muted); font-size: .58rem; }
.result-cell--reference span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-state { display: inline-flex; max-width: 100%; align-items: center; padding: 4px 7px; border-radius: 999px; background: #edf2f3; color: #647a80; font-size: .53rem; font-weight: 850; white-space: nowrap; }
.result-state--normal { background: var(--green-soft); color: #277b5b; }
.result-state--attention { background: #fff0d9; color: #a75e00; }
.result-state--critical { background: #ffe3e6; color: #a61f2e; }
.result-cell--actions { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.result-cell--actions form { margin: 0; }
.result-ok-button, .result-edit-button, .result-confirmed { display: inline-flex; min-height: 31px; align-items: center; justify-content: center; gap: 4px; padding: 5px 8px; border-radius: 9px; font-size: .57rem; font-weight: 850; white-space: nowrap; }
.result-ok-button { background: var(--teal); color: #fff; cursor: pointer; }
.result-ok-button:disabled { opacity: .65; cursor: wait; }
.result-edit-button { border: 1px solid var(--line); background: #fff; color: var(--teal-dark); cursor: pointer; }
.result-confirmed { color: #277b5b; }
.results-empty { display: flex; align-items: center; flex-direction: column; gap: 3px; padding: 22px; border: 1px dashed var(--line); border-radius: 13px; color: var(--muted); text-align: center; }
.results-empty strong { margin-top: 4px; color: var(--ink); font-size: .72rem; }
.results-empty span { font-size: .62rem; }
.results-pagination { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; margin-top: 9px; }
.results-pagination button { display: inline-flex; min-height: 35px; align-items: center; justify-content: center; gap: 4px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--teal-dark); font-size: .61rem; font-weight: 800; cursor: pointer; }
.results-pagination button:first-child svg { transform: rotate(180deg); }
.results-pagination button:disabled { color: #9babad; cursor: not-allowed; opacity: .6; }
.results-pagination span { color: var(--muted); font-size: .6rem; font-weight: 750; }
.results-safety-note { margin: 9px 3px 0; color: var(--muted); font-size: .56rem; line-height: 1.45; }
.value-delete-form { padding-top: 2px; border-top: 1px solid var(--line-soft); text-align: right; }
.value-delete-form button { display: inline-flex; align-items: center; gap: 5px; padding: 8px 3px; background: transparent; color: var(--red); font-size: .62rem; font-weight: 800; cursor: pointer; }

.summary-box { padding: 18px; border: 1px solid #c9e3e0; border-radius: var(--radius); background: linear-gradient(125deg, #f1faf8, #fff); }
.summary-box > p { margin: 0; color: var(--ink); font-size: .78rem; line-height: 1.65; }
.summary-box > div { display: flex; flex-wrap: wrap; gap: 7px 14px; margin-top: 13px; padding-top: 11px; border-top: 1px solid #dcecea; }
.summary-box > div span { display: inline-flex; align-items: center; gap: 4px; color: var(--teal-dark); font-size: .6rem; font-weight: 750; }
.detail-section .summary-box + .button { margin-top: 9px; }
.consent-process-form { margin-top: 11px; }
.processing-state { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 11px; margin-top: 11px; padding: 13px 14px; border: 1px solid #cbdcf3; border-radius: 14px; background: var(--blue-soft); color: #3d6eaf; }
.processing-state[hidden] { display: none; }
.processing-state__indicator { position: relative; display: grid; width: 38px; height: 38px; place-items: center; border-radius: 12px; background: rgba(255, 255, 255, .72); font-size: .9rem; font-weight: 900; }
.processing-state--processing .processing-state__indicator::before { width: 19px; height: 19px; border: 3px solid rgba(11, 127, 130, .18); border-top-color: var(--teal); border-radius: 50%; content: ""; animation: processing-spin .85s linear infinite; }
.processing-state--processing .processing-state__indicator b { display: none; }
.processing-state--error { border-color: #f2c6cc; background: var(--red-soft); color: #873b44; }
.processing-state--success { border-color: #bfe2ce; background: var(--green-soft); color: #276d52; }
.processing-state > div { min-width: 0; }
.processing-state strong, .processing-state p, .processing-state small { display: block; }
.processing-state strong { font-size: .76rem; }
.processing-state p { margin: 3px 0 0; color: currentColor; font-size: .68rem; line-height: 1.45; }
.processing-state small { margin-top: 4px; opacity: .8; font-size: .6rem; line-height: 1.4; }
.consent-check { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 10px; padding: 10px; border-radius: 11px; background: var(--surface-soft); color: var(--ink-soft); font-size: .64rem; line-height: 1.45; }
.consent-check input { flex: 0 0 auto; margin-top: 2px; accent-color: var(--teal); }
.source-principle { display: flex; align-items: center; gap: 12px; padding: 15px; border-radius: var(--radius); background: var(--navy); color: #fff; }
.source-principle > span { display: grid; flex: 0 0 43px; height: 43px; place-items: center; border-radius: 14px; background: rgba(255, 255, 255, .1); }
.source-principle strong { font-size: .78rem; }
.source-principle p { margin: 3px 0 0; color: rgba(255, 255, 255, .7); font-size: .65rem; }

@keyframes processing-spin { to { transform: rotate(360deg); } }
@keyframes processing-pulse { 0%, 100% { opacity: .55; transform: scale(.92); } 50% { opacity: 1; transform: scale(1.08); } }

.app-dialog { width: calc(100% - 26px); max-width: 600px; max-height: calc(100vh - 30px); padding: 0; overflow: auto; border: 0; border-radius: 22px; background: transparent; box-shadow: var(--shadow-md); }
.app-dialog::backdrop { background: rgba(8, 31, 39, .55); backdrop-filter: blur(3px); }
.dialog-card { display: grid; gap: 13px; padding: 19px; border-radius: 22px; background: #fff; }
.dialog-card__heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.dialog-card__heading h2 { font-size: 1.1rem; }

.ai-heading { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 12px; margin-bottom: 15px; }
.ai-heading__mark { position: relative; display: grid; width: 54px; height: 54px; place-items: center; border-radius: 18px; background: linear-gradient(145deg, #0e9390, #0a6b77); color: #fff; box-shadow: 0 10px 24px rgba(11, 127, 130, .23); }
.ai-heading__mark i { position: absolute; top: -4px; right: -3px; width: 11px; height: 11px; border: 3px solid #f5f9f9; border-radius: 50%; background: #7fd6cb; }
.ai-heading h1 { margin-bottom: 4px; font-size: 1.7rem; }
.ai-heading p { margin: 0; font-size: .73rem; }
.ai-state { grid-column: 1 / -1; display: inline-flex; width: fit-content; align-items: center; gap: 5px; margin-left: 66px; padding: 5px 8px; border-radius: 999px; background: #eef3f3; color: var(--muted); font-size: .58rem; font-weight: 800; }
.ai-state i { width: 6px; height: 6px; border-radius: 50%; background: #9badaf; }
.ai-state.is-on { background: var(--green-soft); color: #267253; }
.ai-state.is-on i { background: var(--green); box-shadow: 0 0 0 3px rgba(47, 150, 109, .12); }
.configuration-banner { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 12px; padding: 11px 12px; border: 1px solid #cbdcf3; border-radius: 13px; background: var(--blue-soft); color: #3d6eaf; }
.configuration-banner strong { font-size: .7rem; }
.configuration-banner p { margin: 2px 0 0; color: #5579a8; font-size: .64rem; }
.chat-surface { display: flex; min-height: 560px; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: #fff; box-shadow: var(--shadow-sm); }
.chat-messages { display: flex; flex: 1; flex-direction: column; gap: 13px; min-height: 380px; max-height: 58vh; overflow-y: auto; padding: 17px 13px; scroll-behavior: smooth; }
.chat-welcome { max-width: 350px; margin: auto; padding: 28px 16px; text-align: center; }
.chat-welcome > span { display: grid; width: 58px; height: 58px; margin: 0 auto 12px; place-items: center; border-radius: 19px; background: var(--teal-soft); color: var(--teal); }
.chat-welcome h2 { margin-bottom: 6px; font-size: 1.05rem; }
.chat-welcome p { margin: 0; font-size: .72rem; }
.chat-message { display: flex; max-width: 92%; align-items: flex-start; gap: 7px; }
.chat-message--user { align-self: flex-end; }
.chat-message--assistant { align-self: flex-start; }
.chat-message__avatar { display: grid; flex: 0 0 30px; height: 30px; place-items: center; border-radius: 10px; background: var(--teal-soft); color: var(--teal); }
.chat-message__bubble { padding: 11px 12px; border-radius: 5px 15px 15px 15px; background: var(--surface-soft); }
.chat-message--user .chat-message__bubble { border-radius: 15px 5px 15px 15px; background: var(--teal); color: #fff; }
.chat-message__bubble > p, .chat-message__content p, .chat-message__content li { color: inherit; font-size: .73rem; line-height: 1.55; }
.chat-message__bubble > p { margin: 0; }
.chat-message__content { min-width: 0; }
.chat-message__content > :first-child { margin-top: 0; }
.chat-message__content > :last-child { margin-bottom: 0; }
.chat-message__content p { margin: 0 0 9px; }
.chat-message__content h3 { margin: 13px 0 6px; color: var(--navy); font-size: .8rem; letter-spacing: -.015em; line-height: 1.3; }
.chat-message__content ul, .chat-message__content ol { display: grid; gap: 5px; margin: 4px 0 10px; padding-left: 20px; }
.chat-message__content li { padding-left: 2px; }
.chat-message__content strong { color: var(--navy); font-weight: 850; }
.chat-citation { display: inline-flex; min-height: 19px; align-items: center; margin-left: 4px; padding: 2px 6px; border-radius: 999px; background: #dfeafb; color: #356dbd; font-size: .52rem; font-weight: 850; line-height: 1; text-decoration: none; vertical-align: middle; white-space: nowrap; }
.chat-citation:hover { background: #cfdef5; color: #285a9f; }
.chat-sources { display: grid; gap: 6px; margin-top: 11px; padding-top: 10px; border-top: 1px solid #d9e6e6; }
.chat-sources > strong { color: var(--ink-soft); font-size: .6rem; text-transform: uppercase; }
.chat-sources > a { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 7px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.chat-sources > a > span { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 8px; background: var(--blue-soft); color: var(--blue); font-size: .58rem; font-weight: 850; }
.chat-sources a strong, .chat-sources a small { display: block; }
.chat-sources a strong { font-size: .64rem; }
.chat-sources a small { margin-top: 2px; color: var(--muted); font-size: .55rem; }
.chat-message--loading .chat-message__bubble p::after { display: inline-block; width: 1.2em; content: "…"; animation: pulse 1s infinite; }
@keyframes pulse { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
.quick-prompts { display: flex; gap: 6px; overflow-x: auto; padding: 9px 12px; border-top: 1px solid var(--line-soft); scrollbar-width: none; }
.quick-prompts::-webkit-scrollbar { display: none; }
.quick-prompts button { flex: none; padding: 7px 9px; border: 1px solid #cfe3e2; border-radius: 999px; background: #f5fbfa; color: var(--teal-dark); font-size: .6rem; font-weight: 750; cursor: pointer; }
.chat-composer { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 8px; padding: 10px; border-top: 1px solid var(--line); background: #fff; }
.chat-composer label { display: block; }
.chat-composer textarea { display: block; width: 100%; max-height: 120px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 13px; outline: 0; background: #f8fbfb; font-size: .73rem; line-height: 1.45; resize: none; }
.chat-composer textarea:focus { border-color: #80bfbd; box-shadow: 0 0 0 3px rgba(11, 127, 130, .08); }
.chat-composer button { display: grid; width: 43px; height: 43px; place-items: center; border-radius: 14px; background: var(--teal); color: #fff; cursor: pointer; }
.chat-composer button:disabled { opacity: .55; cursor: wait; }

.page-heading--actions { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.page-heading--actions > div { min-width: 0; }
.page-heading--actions .button { flex: none; }
.status-pill--neutral { background: #edf2f2; color: #647d83; }
.inline-link { color: var(--teal); font-weight: 800; }
.detail-back--bottom { display: inline-flex; margin-top: 18px; }

.appointment-dashboard { padding: 16px; border: 1px solid #d5e7e6; border-radius: var(--radius-lg); background: linear-gradient(135deg, #fff, #f1f9f8); box-shadow: var(--shadow-sm); }
.appointment-dashboard .section-heading { margin-bottom: 11px; }
.appointment-empty { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 13px; border: 1px dashed #bddbd9; border-radius: 14px; background: rgba(255, 255, 255, .78); }
.appointment-empty > span:first-child { display: grid; width: 41px; height: 41px; place-items: center; border-radius: 13px; background: var(--teal-soft); color: var(--teal); }
.appointment-empty strong, .appointment-empty small { display: block; }
.appointment-empty strong { margin-bottom: 3px; font-size: .76rem; }
.appointment-empty small { color: var(--muted); font-size: .61rem; line-height: 1.4; }
.appointment-empty > svg { color: #91a6aa; }
.appointment-dashboard__list { overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.appointment-dashboard__item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 10px; min-height: 67px; padding: 9px 11px; border-bottom: 1px solid var(--line-soft); }
.appointment-dashboard__item:last-child { border-bottom: 0; }
.appointment-dashboard__item.is-next { background: #fbfefe; }
.appointment-dashboard__item time, .appointment-row time { display: grid; width: 44px; height: 47px; place-items: center; align-content: center; border-radius: 13px; background: var(--teal-soft); color: var(--teal-dark); text-align: center; }
.appointment-dashboard__item time strong, .appointment-row time strong { font-size: 1rem; line-height: 1; }
.appointment-dashboard__item time span, .appointment-row time span { margin-top: 3px; font-size: .52rem; font-weight: 850; }
.appointment-dashboard__item > span { min-width: 0; }
.appointment-dashboard__item > span strong, .appointment-dashboard__item > span small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appointment-dashboard__item > span strong { font-size: .72rem; }
.appointment-dashboard__item > span small { margin-top: 4px; color: var(--muted); font-size: .59rem; }
.appointment-dashboard__item em { padding: 4px 7px; border-radius: 999px; background: var(--green-soft); color: #277b5b; font-size: .52rem; font-style: normal; font-weight: 850; }
.appointment-dashboard__item > svg { color: #96aaae; }
.appointment-dashboard__links { display: flex; flex-wrap: wrap; gap: 8px 15px; margin-top: 11px; }
.appointment-dashboard__links a { display: inline-flex; align-items: center; gap: 5px; color: var(--teal); font-size: .62rem; font-weight: 800; }

.agenda-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-bottom: 15px; padding: 4px; border: 1px solid var(--line); border-radius: 14px; background: #eaf1f2; }
.agenda-tabs a { display: flex; min-height: 38px; align-items: center; justify-content: center; border-radius: 10px; color: var(--ink-soft); font-size: .68rem; font-weight: 800; }
.agenda-tabs a.is-active { background: #fff; color: var(--teal); box-shadow: 0 3px 10px rgba(25, 69, 79, .08); }
.appointment-list { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); }
.appointment-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 11px; min-height: 83px; padding: 12px; border-bottom: 1px solid var(--line-soft); }
.appointment-row:last-child { border-bottom: 0; }
.appointment-row:hover { background: #fbfdfd; }
.appointment-row__body { min-width: 0; }
.appointment-row__body strong, .appointment-row__body small, .appointment-row__body em { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appointment-row__body strong { font-size: .78rem; }
.appointment-row__body small { margin-top: 4px; color: var(--ink-soft); font-size: .63rem; }
.appointment-row__body em { margin-top: 4px; color: var(--muted); font-size: .57rem; font-style: normal; }
.appointment-row__side { display: grid; justify-items: end; gap: 5px; }
.appointment-row__side small { display: inline-flex; align-items: center; gap: 3px; color: var(--muted); font-size: .54rem; font-weight: 750; }
.appointment-row > svg { color: #9dafb2; }
.agenda-footer-links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 13px; }
.agenda-footer-links a { display: flex; min-height: 43px; align-items: center; justify-content: center; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--teal); font-size: .62rem; font-weight: 800; }

.professional-list { display: grid; gap: 9px; }
.professional-card { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow-sm); }
.professional-card__main { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 11px; min-height: 78px; padding: 12px; }
.professional-card__avatar { display: grid; width: 46px; height: 46px; place-items: center; border: 1px solid #bddbd9; border-radius: 15px; background: var(--teal-soft); color: var(--teal-dark); font-size: .88rem; font-weight: 850; }
.professional-card__body { min-width: 0; }
.professional-card__body strong, .professional-card__body small, .professional-card__body em { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.professional-card__body strong { font-size: .78rem; }
.professional-card__body small { margin-top: 4px; color: var(--ink-soft); font-size: .62rem; }
.professional-card__body em { margin-top: 5px; color: var(--muted); font-size: .55rem; font-style: normal; }
.professional-card__main > svg { color: #9dafb2; }
.professional-card__portal { display: flex; min-height: 38px; align-items: center; justify-content: center; gap: 5px; border-top: 1px solid var(--line-soft); background: #fbfdfd; color: var(--teal); font-size: .61rem; font-weight: 800; }
.professional-card__actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); border-top: 1px solid var(--line-soft); background: #fbfdfd; }
.professional-card__actions a { display: flex; min-height: 40px; align-items: center; justify-content: center; gap: 5px; padding: 7px; color: var(--teal); font-size: .61rem; font-weight: 800; text-align: center; }
.professional-card__actions a + a { border-left: 1px solid var(--line-soft); }
.professional-contact-line { display: flex; align-items: flex-start; gap: 8px; padding: 9px 10px; border: 1px solid var(--line-soft); border-radius: 12px; background: #fff; }
.professional-contact-line > svg { margin-top: 2px; color: var(--teal); }
.professional-contact-line strong, .professional-contact-line small { display: block; }
.professional-contact-line strong { font-size: .63rem; }
.professional-contact-line small { margin-top: 3px; color: var(--muted); font-size: .61rem; line-height: 1.4; }
.button--whatsapp { background: #1f9f5f; color: #fff; }
.button--whatsapp:hover { background: #198851; }

.credential-card { display: grid; gap: 10px; margin-bottom: 14px; padding: 16px; border: 1px solid #c9e1df; border-radius: var(--radius); background: linear-gradient(135deg, #f1faf8, #fff); box-shadow: var(--shadow-sm); }
.credential-card__heading { display: flex; align-items: center; gap: 10px; }
.credential-card__heading > span { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 13px; background: var(--teal-soft); color: var(--teal); }
.credential-card__heading strong, .credential-card__heading small { display: block; }
.credential-card__heading strong { font-size: .76rem; }
.credential-card__heading small { margin-top: 3px; color: var(--muted); font-size: .58rem; }
.credential-value { display: grid; gap: 5px; color: var(--ink-soft); font-size: .62rem; font-weight: 800; }
.credential-value > span:last-child { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.credential-value input { min-width: 0; height: 43px; padding: 0 11px; border: 0; outline: 0; background: transparent; font-size: .76rem; }
.credential-value button { display: grid; width: 42px; place-items: center; border-left: 1px solid var(--line-soft); background: transparent; color: var(--teal); cursor: pointer; }
.credential-feedback { margin: 0; color: var(--green); font-size: .62rem; font-weight: 750; }
.check-row { display: flex; align-items: center; gap: 8px; color: var(--ink-soft); font-size: .67rem; font-weight: 700; }
.check-row input { width: 18px; height: 18px; accent-color: var(--teal); }
.check-card { display: flex; min-height: 72px; align-items: center; padding: 11px 12px; border: 1px solid var(--line); border-radius: 13px; background: #f8fbfb; cursor: pointer; }
.check-card > input { width: 18px; height: 18px; margin: 0 10px 0 0; accent-color: var(--teal); }
.check-card > span { display: flex; min-width: 0; align-items: center; gap: 9px; }
.check-card > span > svg { color: var(--teal); }
.check-card strong, .check-card small { display: block; }
.check-card strong { font-size: .7rem; }
.check-card small { margin-top: 3px; color: var(--muted); font-size: .57rem; font-weight: 500; line-height: 1.35; }
.check-card--secondary { min-height: 66px; border-color: #d8d2ec; background: #faf9fe; }
.check-card--secondary > input { accent-color: #7566ae; }
.check-card--secondary > span > svg { color: #7566ae; }
.danger-zone { margin-top: 18px; }
.danger-text { color: var(--red); }

.notification-device-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 11px; margin-bottom: 10px; padding: 14px; border: 1px solid #cce2e0; border-radius: var(--radius); background: linear-gradient(135deg, #f1faf8, #fff); box-shadow: var(--shadow-sm); }
.notification-device-card__icon { display: grid; width: 45px; height: 45px; place-items: center; border-radius: 15px; background: var(--teal-soft); color: var(--teal); }
.notification-device-card strong { display: block; font-size: .72rem; }
.notification-device-card p { margin: 3px 0 0; font-size: .59rem; line-height: 1.4; }
.notification-device-card small { display: block; margin-top: 4px; color: var(--muted); font-size: .54rem; line-height: 1.4; }
.notification-settings { display: grid; gap: 13px; }
.notification-settings fieldset { display: grid; gap: 7px; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 14px; }
.notification-settings legend { padding: 0 6px; color: var(--ink-soft); font-size: .63rem; font-weight: 850; }
.setting-toggle { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 9px 3px; cursor: pointer; }
.setting-toggle--master { padding: 11px 12px; border-radius: 13px; background: var(--surface-tint); }
.setting-toggle strong, .setting-toggle small { display: block; }
.setting-toggle strong { font-size: .7rem; }
.setting-toggle small { margin-top: 3px; color: var(--muted); font-size: .57rem; line-height: 1.35; }
.setting-toggle input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.setting-toggle i { position: relative; width: 42px; height: 24px; border-radius: 999px; background: #cbd7d9; transition: background .2s ease; }
.setting-toggle i::after { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(16, 47, 58, .25); content: ""; transition: transform .2s ease; }
.setting-toggle input:checked + i { background: var(--teal); }
.setting-toggle input:checked + i::after { transform: translateX(18px); }
.setting-toggle input:focus-visible + i { outline: 3px solid rgba(11, 127, 130, .18); outline-offset: 2px; }

.profile-hero { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 13px; margin-bottom: 22px; padding: 17px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: linear-gradient(130deg, #fff, #edf8f6); box-shadow: var(--shadow-sm); }
.profile-hero h1 { margin-bottom: 3px; font-size: 1.35rem; }
.profile-hero p { margin: 0; font-size: .7rem; }
.profile-hero .privacy-badge { grid-column: 2; justify-self: start; }
.profile-stats { display: grid; grid-template-columns: repeat(3, 1fr); overflow: hidden; margin-bottom: 26px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.profile-stats div { padding: 14px 7px; border-right: 1px solid var(--line); text-align: center; }
.profile-stats div:last-child { border: 0; }
.profile-stats strong, .profile-stats span { display: block; }
.profile-stats strong { color: var(--navy); font-size: .86rem; }
.profile-stats span { margin-top: 3px; color: var(--muted); font-size: .58rem; }
.profile-summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.profile-summary-grid > div { min-width: 0; padding: 13px; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.profile-summary-grid > div:nth-child(2n) { border-right: 0; }
.profile-summary-grid > div:nth-last-child(-n + 2) { border-bottom: 0; }
.profile-summary-grid span, .profile-summary-grid strong { display: block; overflow: hidden; text-overflow: ellipsis; }
.profile-summary-grid span { margin-bottom: 5px; color: var(--muted); font-size: .57rem; font-weight: 750; }
.profile-summary-grid strong { color: var(--ink); font-size: .72rem; line-height: 1.35; }
.guardian-summary { display: flex; align-items: flex-start; gap: 10px; margin-top: 10px; padding: 12px; border: 1px solid #cce2e0; border-radius: 14px; background: var(--surface-tint); }
.guardian-summary > span { display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; border-radius: 12px; background: #fff; color: var(--teal); }
.guardian-summary strong { font-size: .7rem; }
.guardian-summary p { margin: 4px 0 0; color: var(--muted); font-size: .61rem; line-height: 1.45; }
.profile-edit-form { padding-top: 3px; }
.form-divider { margin-top: 5px; padding-top: 13px; border-top: 1px solid var(--line-soft); }
.form-divider span { color: var(--teal-dark); font-size: .62rem; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.guardian-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: #f8fbfb; }
.guardian-fields[hidden], .child-booklet-fields[hidden], [data-child-booklet-toggle-wrap][hidden], [data-insurance-other][hidden] { display: none; }
.child-booklet-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 14px; border: 1px solid #d8d2ec; border-radius: 16px; background: linear-gradient(145deg, #faf9fe, #fff); }
.child-booklet-fields__heading { padding-bottom: 3px; }
.child-booklet-fields__heading h3 { margin: 3px 0 4px; font-size: .88rem; }
.child-booklet-fields__heading p { margin: 0; color: var(--muted); font-size: .62rem; line-height: 1.45; }
.field-with-unit { position: relative; }
.field-with-unit input { padding-right: 52px; }
.field-with-unit em { position: absolute; top: 50%; right: 12px; pointer-events: none; transform: translateY(-50%); }
.blood-type-fields { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 8px; }
.child-booklet-fields__note { display: flex; align-items: flex-start; gap: 7px; margin: 2px 0 0; padding: 10px 11px; border-radius: 12px; background: #f1effb; color: #665b91; font-size: .59rem; line-height: 1.45; }
.child-booklet-fields__note svg { flex: 0 0 auto; margin-top: 1px; }
.child-booklet-summary { margin-top: 11px; overflow: hidden; border: 1px solid #d8d2ec; border-radius: 15px; background: #fff; }
.child-booklet-summary__heading { display: flex; align-items: center; gap: 10px; padding: 12px 13px; border-bottom: 1px solid #e6e2f3; background: #faf9fe; }
.child-booklet-summary__heading > span { display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; border-radius: 12px; background: #f1effb; color: #7566ae; }
.child-booklet-summary__heading strong, .child-booklet-summary__heading small { display: block; }
.child-booklet-summary__heading strong { font-size: .7rem; }
.child-booklet-summary__heading small { margin-top: 3px; color: var(--muted); font-size: .57rem; }
.child-booklet-summary__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line-soft); }
.child-booklet-summary__grid > div { min-width: 0; padding: 11px 13px; background: #fff; }
.child-booklet-summary__grid > .is-wide { grid-column: 1 / -1; }
.child-booklet-summary__grid span, .child-booklet-summary__grid strong { display: block; min-width: 0; overflow-wrap: anywhere; }
.child-booklet-summary__grid span { margin-bottom: 4px; color: var(--muted); font-size: .55rem; font-weight: 750; }
.child-booklet-summary__grid strong { color: var(--ink); font-size: .68rem; font-weight: 750; line-height: 1.45; }
.profile-edit-actions { display: flex; justify-content: flex-end; gap: 8px; }
.appointment-association-field { padding: 12px; border: 1px solid #c9e1df; border-radius: 14px; background: var(--surface-tint); }
.study-appointment-link { display: inline-flex; align-items: center; gap: 5px; color: var(--teal-dark); font-weight: 750; }
.settings-list { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.settings-list > div, .settings-list > a { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; min-height: 66px; padding: 10px 12px; border-bottom: 1px solid var(--line-soft); }
.settings-list > :last-child { border-bottom: 0; }
.settings-list__icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 12px; background: var(--surface-tint); color: var(--teal); }
.settings-list strong, .settings-list small { display: block; }
.settings-list strong { font-size: .72rem; }
.settings-list small { margin-top: 3px; color: var(--muted); font-size: .6rem; line-height: 1.35; }
.settings-list em { padding: 4px 6px; border-radius: 999px; background: var(--green-soft); color: #277b5b; font-size: .53rem; font-style: normal; font-weight: 800; }
.logout-form { margin-top: 8px; }

.notification-nudge { position: fixed; right: 14px; bottom: calc(83px + var(--safe-bottom)); left: 14px; z-index: 115; display: grid; max-width: 560px; min-height: 68px; margin: auto; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 10px; border: 1px solid #b9dcd8; border-radius: 17px; background: rgba(255, 255, 255, .97); box-shadow: 0 12px 35px rgba(16, 47, 58, .19); backdrop-filter: blur(12px); }
.notification-nudge[hidden] { display: none; }
.notification-nudge__icon { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 13px; background: var(--teal-soft); color: var(--teal); }
.notification-nudge strong, .notification-nudge small { display: block; }
.notification-nudge strong { font-size: .69rem; }
.notification-nudge small { margin-top: 3px; color: var(--muted); font-size: .56rem; line-height: 1.35; }
.notification-nudge > .button { width: auto; height: auto; min-height: 36px; background: var(--teal); color: #fff; }
.notification-nudge > button:not(.button) { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; }
.notification-nudge__feedback { grid-column: 1 / -1; margin: 0; }

.auth-shell { display: grid; min-height: 100vh; padding: 24px 16px; place-items: center; background: radial-gradient(circle at 20% 0%, #e2f3f1, transparent 25rem), linear-gradient(150deg, #f8fbfb, #eef5f5); }
.auth-card { width: min(100%, 460px); padding: 24px 20px; border: 1px solid var(--line); border-radius: 28px; background: rgba(255, 255, 255, .94); box-shadow: var(--shadow-md); }
.auth-card > .brand { margin-bottom: 31px; }
.auth-heading { margin-bottom: 21px; }
.auth-heading h1 { margin-bottom: 7px; font-size: 1.75rem; }
.auth-heading p { margin: 0; font-size: .78rem; }
.auth-switch { margin: 17px 0 0; color: var(--muted); font-size: .7rem; text-align: center; }
.auth-switch a { color: var(--teal); font-weight: 800; }
.security-note { display: flex; align-items: flex-start; gap: 8px; margin-top: 18px; padding: 11px; border-radius: 12px; background: var(--surface-soft); color: var(--ink-soft); font-size: .63rem; line-height: 1.45; }
.security-note svg { color: var(--teal); }

.offline-page { display: grid; min-height: 100vh; padding: 30px; place-content: center; text-align: center; }
.offline-page .brand__mark { margin: 0 auto 20px; }
.offline-page h1 { font-size: 1.7rem; }
.offline-page p { max-width: 420px; font-size: .8rem; }
.offline-page button { width: fit-content; margin: 10px auto; padding: 10px 18px; border-radius: 12px; background: var(--teal); color: #fff; font-weight: 800; }

@media (max-width: 699px) {
  input, select, textarea { font-size: 16px !important; }
  .credential-value input { font-size: 16px; }
  .app-dialog--picker { width: calc(100% - 16px); max-height: calc(100vh - 18px); margin: auto 8px 8px; }
  .study-section-nav { top: 69px; }
  .study-files-toolbar { align-items: stretch; flex-direction: column; }
  .study-files-toolbar .button { width: 100%; }
  .file-viewer-dialog { width: calc(100% - 8px); max-height: calc(100dvh - 8px); margin: 4px; border-radius: 14px; }
  .file-viewer { height: calc(100dvh - 8px); border-radius: 14px; }
  .file-viewer__header { min-height: 58px; padding-left: 10px; }
  .file-viewer__actions > button:not(.icon-button), .file-viewer__actions > a { width: 38px; padding: 0; justify-content: center; }
  .file-viewer__actions span { display: none; }
  .result-row--header { display: none; }
  .result-row { grid-template-areas: "parameter value actions" "reference status actions"; grid-template-columns: minmax(82px, 1fr) minmax(65px, auto) 63px; gap: 5px 8px; min-height: 67px; padding: 8px; }
  .result-cell--parameter { grid-area: parameter; }
  .result-cell--value { grid-area: value; justify-content: flex-end; }
  .result-cell--reference { grid-area: reference; }
  .result-cell--reference::before { content: "Ref. "; }
  .result-cell--status { grid-area: status; justify-self: end; }
  .result-cell--status .result-state { max-width: 88px; justify-content: center; line-height: 1.15; white-space: normal; text-align: center; }
  .result-cell--actions { grid-area: actions; flex-direction: column; align-items: stretch; }
  .result-ok-button, .result-edit-button, .result-confirmed { min-width: 63px; }
  .result-confirmed { padding-right: 3px; padding-left: 3px; }
  .results-table { overflow: visible; }
}

@media (max-width: 420px) {
  .health-orbit { flex-basis: 69px; transform: scale(.9); }
  .welcome-block { padding: 20px 17px; }
  .welcome-block h1 { font-size: 1.7rem; }
  .study-row { grid-template-columns: auto minmax(0, 1fr); }
  .study-row .status-pill { grid-column: 2; justify-self: start; margin-top: -4px; }
  .form-grid, .field-row { grid-template-columns: 1fr; }
  .field--full { grid-column: auto; }
  .appointment-dashboard__item { grid-template-columns: auto minmax(0, 1fr) auto; }
  .appointment-dashboard__item em { display: none; }
  .appointment-row { grid-template-areas: "date body chevron" "date side chevron"; grid-template-columns: auto minmax(0, 1fr) auto; gap: 5px 9px; }
  .appointment-row time { grid-area: date; }
  .appointment-row__body { grid-area: body; }
  .appointment-row__side { grid-area: side; grid-auto-flow: column; justify-content: start; justify-items: start; }
  .appointment-row > svg { grid-area: chevron; }
  .agenda-footer-links { grid-template-columns: 1fr; }
  .profile-summary-grid { grid-template-columns: 1fr; }
  .profile-summary-grid > div, .profile-summary-grid > div:nth-child(2n), .profile-summary-grid > div:nth-last-child(-n + 2) { border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .profile-summary-grid > div:last-child { border-bottom: 0; }
  .guardian-fields { grid-template-columns: 1fr; }
  .child-booklet-fields, .child-booklet-summary__grid { grid-template-columns: 1fr; }
  .child-booklet-summary__grid > .is-wide { grid-column: auto; }
  .profile-edit-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .notification-nudge { grid-template-columns: auto minmax(0, 1fr) auto; }
  .notification-nudge > .button { grid-column: 2; width: fit-content; }
  .notification-nudge > button:not(.button) { grid-column: 3; grid-row: 1; }
  .notification-device-card { grid-template-columns: auto minmax(0, 1fr); }
  .notification-device-card .button { grid-column: 1 / -1; width: 100%; }
  .timeline-item__main { grid-template-columns: 33px 9px 39px minmax(0, 1fr); gap: 6px; }
  .timeline-group__items::before { left: 44px; }
  .timeline-group > h2 { margin-left: 56px; }
  .process-preview div { max-width: 80px; }
}

@media (min-width: 700px) {
  .app-main { padding: 32px 28px 118px; }
  .app-header__inner { padding: 0 28px; }
  .welcome-block { min-height: 160px; padding: 30px; }
  .health-orbit { flex-basis: 110px; height: 110px; transform: scale(1.16); }
  .study-list--cards { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
  .study-list--cards .study-row:nth-child(odd) { border-right: 1px solid var(--line-soft); }
  .study-list--cards .study-row:nth-last-child(2) { border-bottom: 0; }
  .timeline-item { border-left: 1px solid var(--line); border-radius: var(--radius); }
  .timeline-item__main { grid-template-columns: 42px 12px 45px minmax(0, 1fr) auto 18px; padding-right: 49px; padding-left: 8px; }
  .followup-open__items .timeline-item__main { grid-template-columns: 42px 45px minmax(0, 1fr) auto 18px; }
  .timeline-group__items::before { left: 58px; }
  .timeline-group > h2 { margin-left: 73px; }
  .timeline-item .status-pill, .timeline-item__chevron { display: block; }
  .followup-folder-grid { grid-template-columns: repeat(3, 1fr); }
  .floating-upload { right: max(24px, calc((100vw - 1120px) / 2 + 28px)); }
  .study-file-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .study-file-open { align-self: center; }
  .chat-message { max-width: 76%; }
  .ai-heading { grid-template-columns: auto 1fr auto; }
  .ai-state { grid-column: auto; margin-left: 0; }
  .profile-hero { grid-template-columns: auto 1fr auto; }
  .profile-hero .privacy-badge { grid-column: auto; justify-self: auto; }
  .professional-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 980px) {
  body { padding-left: 94px; }
  .app-header { left: 94px; }
  .app-nav { top: 0; right: auto; width: 94px; padding: 18px 9px; border-top: 0; border-right: 1px solid var(--line); box-shadow: 10px 0 30px rgba(25, 63, 72, .05); }
  .app-nav__inner { display: flex; width: 100%; height: 100%; align-items: stretch; flex-direction: column; gap: 5px; padding: 67px 0 0; }
  .app-nav__item { min-height: 66px; border-radius: 15px; }
  .app-nav__item::after { top: auto; left: 0; width: 3px; height: 22px; border-radius: 0 4px 4px 0; }
  .app-nav__item.is-active { background: var(--surface-tint); }
  .app-main { padding-bottom: 50px; }
  .floating-upload { bottom: 25px; }
  .followup-folder-grid { grid-template-columns: repeat(4, 1fr); }
  .organizer-toast { bottom: 28px; left: 110px; }
  .app-header__page { display: inline; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* --- Asistente web conversacional (2026-08-31) --- */
.app-nav__item--primary .app-nav__icon { width: 47px; height: 47px; margin-top: -20px; border: 4px solid #fff; border-radius: 17px; background: linear-gradient(145deg, #129796, #08747b); color: #fff; box-shadow: 0 9px 22px rgba(11, 127, 130, .25); }
.app-nav__item--primary::after { display: none; }
.app-nav__item--primary span:last-child { margin-top: -1px; }

body.assistant-page { overflow: hidden; }
.assistant-page .app-main { min-height: 0; height: calc(100dvh - 64px); padding: 0 0 calc(70px + var(--safe-bottom)); }
.assistant-workspace { position: relative; display: grid; height: calc(100dvh - 64px - 70px - var(--safe-bottom)); min-height: 0; overflow: hidden; background: #eef5f4; }
.assistant-chat-panel { display: flex; min-width: 0; min-height: 0; flex-direction: column; overflow: hidden; background: #f4f8f7; }
.assistant-chat-header { display: grid; flex: 0 0 58px; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 8px 10px; border-bottom: 1px solid #d9e7e6; background: rgba(255,255,255,.97); }
.assistant-chat-header__avatar { position: relative; display: grid; width: 39px; height: 39px; place-items: center; border-radius: 13px; background: linear-gradient(145deg, #149b97, #08717b); color: #fff; }
.assistant-chat-header__avatar i { position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border: 2px solid #fff; border-radius: 50%; background: #45b97d; }
.assistant-chat-header > div:not(.assistant-chat-header__actions) { min-width: 0; }
.assistant-chat-header strong, .assistant-chat-header small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assistant-chat-header strong { font-size: .78rem; }
.assistant-chat-header small { margin-top: 2px; color: var(--muted); font-size: .56rem; }
.assistant-chat-header__actions { display: flex; align-items: center; gap: 1px; }
.assistant-chat-header__separate { display: inline-flex; min-height: 35px; align-items: center; justify-content: center; gap: 5px; padding: 0 9px; border-radius: 10px; color: var(--teal); font-size: .54rem; font-weight: 850; }
.assistant-chat-header__separate:hover { background: var(--teal-soft); }
.assistant-inline-alert { display: flex; flex: 0 0 auto; align-items: center; gap: 7px; padding: 7px 12px; border-bottom: 1px solid #d6e3f4; background: var(--blue-soft); color: #416fae; font-size: .58rem; line-height: 1.35; }

.assistant-history { position: fixed; top: 0; bottom: 0; left: 0; z-index: 101; display: flex; width: min(330px, 88vw); min-height: 0; flex-direction: column; padding: calc(12px + env(safe-area-inset-top, 0px)) 10px calc(12px + var(--safe-bottom)); border-right: 1px solid var(--line); background: #fff; box-shadow: 18px 0 48px rgba(13,49,58,.18); transform: translateX(-105%); transition: transform .2s ease; }
.assistant-history.is-open { transform: translateX(0); }
.assistant-history-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(7,31,38,.46); backdrop-filter: blur(2px); }
body.chat-history-open { overflow: hidden; }
.assistant-history__heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 5px 5px 11px; }
.assistant-history__heading strong, .assistant-history__heading small { display: block; }
.assistant-history__heading strong { font-size: .8rem; }
.assistant-history__heading small { margin-top: 2px; color: var(--muted); font-size: .56rem; }
.assistant-new-chat { display: flex; min-height: 43px; align-items: center; justify-content: center; gap: 7px; margin-bottom: 9px; border-radius: 13px; background: var(--teal); color: #fff; font-size: .65rem; font-weight: 850; }
.assistant-history__list { display: grid; min-height: 0; gap: 3px; overflow-y: auto; }
.assistant-history__list > p { padding: 18px 8px; color: var(--muted); font-size: .62rem; text-align: center; }
.assistant-history__list > a { display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 8px; min-height: 53px; padding: 8px; border-radius: 12px; }
.assistant-history__list > a:hover, .assistant-history__list > a.is-active { background: var(--surface-tint); }
.assistant-history__list > a > span { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 10px; background: #e4f2f1; color: var(--teal); }
.assistant-history__list strong, .assistant-history__list small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assistant-history__list strong { font-size: .62rem; }
.assistant-history__list small { margin-top: 3px; color: var(--muted); font-size: .49rem; }

.assistant-workspace .chat-messages { flex: 1 1 auto; min-height: 0; max-height: none; gap: 9px; overflow-y: auto; overscroll-behavior: contain; padding: 13px 10px 18px; background-color: #eef5f3; background-image: radial-gradient(circle at 12px 12px, rgba(30,126,123,.035) 1px, transparent 1.2px); background-size: 24px 24px; scroll-padding-bottom: 18px; }
.assistant-workspace .chat-message { max-width: min(91%, 660px); gap: 6px; }
.assistant-workspace .chat-message__avatar { width: 28px; flex-basis: 28px; height: 28px; border-radius: 9px; background: #d8ecea; }
.assistant-workspace .chat-message__bubble { padding: 9px 10px; border-radius: 5px 14px 14px 14px; background: #fff; box-shadow: 0 1px 2px rgba(18,60,67,.08); }
.assistant-workspace .chat-message--user .chat-message__bubble { border-radius: 14px 5px 14px 14px; background: #d7f0e6; color: #183f43; }
.assistant-workspace .chat-message__bubble > p, .assistant-workspace .chat-message__content p, .assistant-workspace .chat-message__content li { font-size: .72rem; line-height: 1.5; }
.assistant-workspace .chat-message--user .chat-message__bubble > p { white-space: pre-wrap; }
.chat-message__attachments { display: grid; gap: 4px; margin-top: 7px; }
.chat-message__attachments span { max-width: 100%; overflow: hidden; padding: 5px 7px; border-radius: 8px; background: rgba(255,255,255,.45); font-size: .55rem; text-overflow: ellipsis; white-space: nowrap; }
.assistant-workspace .chat-welcome { max-width: 460px; margin: auto; padding: 22px 12px; }
.assistant-workspace .chat-welcome h1 { margin-bottom: 7px; font-size: 1.18rem; }
.assistant-workspace .chat-welcome p { font-size: .69rem; }
.chat-welcome__examples { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 14px; }
.chat-welcome__examples button { padding: 7px 9px; border: 1px solid #bedbd8; border-radius: 999px; background: #fff; color: var(--teal-dark); font-size: .57rem; font-weight: 800; cursor: pointer; }

.chat-action-card { min-width: min(440px, 74vw); margin-top: 10px; overflow: hidden; border: 1px solid #cce1df; border-radius: 13px; background: #fff; }
.chat-action-card__heading { display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 8px; padding: 9px 10px; border-bottom: 1px solid var(--line-soft); background: #f1f9f8; }
.chat-action-card__heading > span { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 9px; background: var(--teal); color: #fff; font-size: .75rem; font-weight: 900; }
.chat-action-card--warning { border-color: #e4c878; }
.chat-action-card--warning .chat-action-card__heading { background: #fff8e6; }
.chat-action-card--warning .chat-action-card__heading > span { background: #c08a10; }
.chat-action-card--danger { border-color: #e9aab4; }
.chat-action-card--danger .chat-action-card__heading { background: var(--red-soft); }
.chat-action-card--danger .chat-action-card__heading > span { background: var(--red); }
.chat-action-card__heading strong, .chat-action-card__heading small { display: block; }
.chat-action-card__heading strong { font-size: .65rem; }
.chat-action-card__heading small { margin-top: 2px; color: var(--muted); font-size: .5rem; }
.chat-action-card__conflict { padding: 9px 10px; border-bottom: 1px solid var(--line-soft); background: #fffaf0; }
.chat-action-card--danger .chat-action-card__conflict { background: #fff7f8; }
.chat-action-card__conflict > strong { display: block; color: #7a5b12; font-size: .61rem; }
.chat-action-card--danger .chat-action-card__conflict > strong { color: #963b49; }
.chat-action-card__conflict > p { margin: 4px 0 7px; color: var(--ink); font-size: .55rem; line-height: 1.45; }
.chat-action-card__conflict > a { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 7px; padding: 7px 8px; border: 1px solid rgba(140,110,28,.2); border-radius: 9px; background: #fff; color: var(--ink); }
.chat-action-card__conflict > a strong, .chat-action-card__conflict > a small { display: block; }
.chat-action-card__conflict > a strong { font-size: .56rem; }
.chat-action-card__conflict > a small { margin-top: 2px; color: var(--muted); font-size: .48rem; line-height: 1.35; }
.chat-action-card dl { margin: 0; padding: 4px 10px; }
.chat-action-card dl > div { display: grid; grid-template-columns: minmax(82px, .36fr) minmax(0,1fr); gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.chat-action-card dl > div:last-child { border-bottom: 0; }
.chat-action-card dt { color: var(--muted); font-size: .5rem; font-weight: 800; }
.chat-action-card dd { margin: 0; overflow-wrap: anywhere; color: var(--ink); font-size: .58rem; font-weight: 700; line-height: 1.4; }
.chat-action-card__buttons { display: flex; flex-wrap: wrap; gap: 7px; padding: 9px 10px; border-top: 1px solid var(--line-soft); }
.chat-action-card__buttons .button { flex: 1 1 125px; justify-content: center; }
.chat-action-card__danger-button { border-color: var(--red) !important; background: var(--red) !important; color: #fff !important; }
.chat-action-card__quick-replies { display: flex; flex-wrap: wrap; gap: 6px; padding: 9px 10px; border-top: 1px solid var(--line-soft); }
.chat-action-card__quick-replies button { min-height: 32px; padding: 5px 10px; border: 1px solid #8dc8c4; border-radius: 999px; background: #fff; color: var(--teal-dark); font-size: .55rem; font-weight: 850; cursor: pointer; }
.chat-action-card__quick-replies button:hover { background: var(--teal-soft); }
.chat-action-card__open, .chat-action-card__status { display: flex; min-height: 36px; align-items: center; justify-content: center; gap: 5px; border-top: 1px solid var(--line-soft); color: var(--teal); font-size: .57rem; font-weight: 850; }
.chat-action-card__status { color: var(--muted); }

.chat-selected-files { display: flex; flex: 0 0 auto; gap: 5px; overflow-x: auto; padding: 6px 9px 0; border-top: 1px solid var(--line); background: #fff; }
.chat-selected-files span { flex: none; max-width: 210px; overflow: hidden; padding: 5px 8px; border-radius: 8px; background: var(--blue-soft); color: #396aa8; font-size: .52rem; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.assistant-workspace .chat-composer { position: relative; z-index: 3; display: grid; flex: 0 0 auto; grid-template-columns: auto minmax(0,1fr) auto; align-items: end; gap: 7px; padding: 8px 9px max(8px, var(--safe-bottom)); border-top: 1px solid var(--line); background: #fff; }
.assistant-workspace .chat-composer .chat-attach-button { position: relative; display: grid; width: 41px; height: 41px; place-items: center; border-radius: 50%; background: #edf5f4; color: var(--teal); cursor: pointer; }
.assistant-workspace .chat-composer .chat-attach-button > .icon { position: absolute; inset: 0; display: block; margin: auto; }
.chat-attach-button input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.chat-input-wrap { display: block; }
.assistant-workspace .chat-composer textarea { min-height: 41px; max-height: 132px; padding: 10px 12px; border-radius: 19px; background: #f7faf9; font-size: .72rem; }
.chat-send-button { display: grid; width: 41px; height: 41px; place-items: center; border-radius: 50%; background: var(--teal); color: #fff; cursor: pointer; }
.chat-send-button:disabled { opacity: .52; cursor: wait; }
.assistant-disclaimer { flex: 0 0 auto; margin: 0; padding: 3px 8px 5px; background: #fff; color: #81979b; font-size: .47rem; line-height: 1.25; text-align: center; }

body.chat-app-page { width: 100%; height: var(--chat-viewport-height, 100dvh); min-height: 0; overflow: hidden; padding: 0; background: #eef5f3; }
.chat-app-shell { width: 100%; height: 100%; min-height: 0; }
.assistant-workspace--standalone { width: 100%; height: 100%; }
.chat-install-dialog p { margin: 0; font-size: .7rem; }
.chat-browser-dialog p { margin: 0 0 9px; color: var(--muted); font-size: .67rem; line-height: 1.5; }
.chat-browser-dialog__url { overflow-wrap: anywhere; margin: 11px 0; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); color: var(--teal-dark); font-size: .59rem; font-weight: 750; }
.chat-browser-dialog__feedback { display: block; margin-top: 9px; color: var(--teal); font-size: .58rem; font-weight: 750; }

@media (display-mode: standalone) {
  .chat-app-page [data-chat-installed-hide] { display: none !important; }
}

.study-text-source { margin-bottom: 12px; overflow: hidden; border: 1px solid #bcdedb; border-radius: 14px; background: #f4fbfa; }
.study-text-source summary { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 9px; padding: 11px 12px; color: var(--teal-dark); cursor: pointer; list-style: none; }
.study-text-source summary::-webkit-details-marker { display: none; }
.study-text-source summary strong, .study-text-source summary small { display: block; }
.study-text-source summary strong { font-size: .65rem; }
.study-text-source summary small { margin-top: 2px; color: var(--muted); font-size: .52rem; }
.study-text-source[open] summary > svg:last-child { transform: rotate(90deg); }
.study-text-source > div { max-height: 320px; overflow: auto; padding: 11px 12px; border-top: 1px solid #cee4e2; background: #fff; }
.study-text-source p { margin: 0; color: var(--ink); font-size: .63rem; line-height: 1.55; white-space: normal; }

.assistant-admin-tabs { display: flex; gap: 5px; overflow-x: auto; margin-bottom: 14px; padding: 5px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.assistant-admin-tabs a { flex: 1; min-width: max-content; padding: 9px 12px; border-radius: 10px; color: var(--muted); font-size: .61rem; font-weight: 850; text-align: center; }
.assistant-admin-tabs a.is-active { background: var(--teal); color: #fff; }
.assistant-knowledge-list { display: grid; gap: 10px; }
.assistant-knowledge-card { position: relative; padding: 13px; border: 1px solid var(--line); border-radius: 15px; background: #fbfdfd; }
.assistant-knowledge-card.is-disabled { opacity: .7; }
.assistant-knowledge-card__heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.assistant-knowledge-card__heading > div { display: flex; align-items: center; gap: 6px; }
.assistant-knowledge-card__heading > small { color: var(--muted); font-size: .5rem; }
.assistant-system-badge { padding: 4px 7px; border-radius: 999px; background: var(--blue-soft); color: var(--blue); font-size: .49rem; font-weight: 850; }
.assistant-delete-form { position: absolute; right: 13px; bottom: 15px; margin: 0; }
.assistant-delete-form .text-button { font-size: .57rem; }
.assistant-conversation-filter { grid-template-columns: minmax(0,1fr) auto auto; align-items: end; }
.assistant-conversation-filter label { min-width: 0; }
.assistant-admin-message-list { display: grid; gap: 8px; }
.assistant-admin-message-list article { max-width: 82%; padding: 10px 11px; border-radius: 13px; background: var(--surface-soft); }
.assistant-admin-message-list article.is-user { justify-self: end; background: #dff1e9; }
.assistant-admin-message-list strong, .assistant-admin-message-list small { display: block; font-size: .52rem; }
.assistant-admin-message-list strong { color: var(--teal); }
.assistant-admin-message-list p { margin: 4px 0; color: var(--ink); font-size: .63rem; white-space: pre-wrap; }
.assistant-admin-message-list small { color: var(--muted); }

@media (min-width: 760px) {
  .assistant-page .app-main { padding: 16px 18px calc(86px + var(--safe-bottom)); }
  .assistant-workspace { height: calc(100dvh - 64px - 102px - var(--safe-bottom)); overflow: hidden; border: 1px solid var(--line); border-radius: 19px; box-shadow: var(--shadow-sm); }
  .assistant-history { position: static; z-index: auto; width: 260px; box-shadow: none; transform: none; }
  .assistant-workspace { grid-template-columns: 260px minmax(0,1fr); }
  .assistant-history__heading [data-chat-history-close], .assistant-chat-header [data-chat-history-open] { display: none; }
  .assistant-history-backdrop { display: none !important; }
  .assistant-workspace .chat-message { max-width: min(78%, 680px); }
  .chat-action-card { min-width: 430px; }
  .assistant-workspace--standalone { height: 100%; border: 0; border-radius: 0; }
}

@media (min-width: 980px) {
  .app-nav__item--primary { order: -1; min-height: 75px; margin-bottom: 14px; }
  .app-nav__item--primary .app-nav__icon { width: 48px; height: 48px; margin: 0; border: 0; }
  .assistant-page .app-main { height: calc(100dvh - 64px); padding: 18px 22px; }
  .assistant-workspace { height: calc(100dvh - 100px); }
  .assistant-workspace--standalone { height: 100%; }
}

@media (max-width: 430px) {
  .assistant-chat-header__separate span { display: none; }
  .assistant-chat-header__separate { width: 35px; padding: 0; }
}

/* --- Navegación, centro de alertas y administrador (2026-08-29) --- */
.app-header__actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.app-header__actions .icon-button { margin-left: 0; }
.app-notification-button { position: relative; }
.app-notification-badge { position: absolute; top: 1px; right: 0; display: grid; min-width: 17px; height: 17px; padding: 0 4px; place-items: center; border: 2px solid #f8fbfb; border-radius: 999px; background: var(--red); color: #fff; font-size: .48rem; font-weight: 900; line-height: 1; }
.profile-menu { position: relative; }
.profile-menu__trigger { display: inline-flex; width: auto; min-width: 38px; align-items: center; justify-content: center; gap: 1px; }
.profile-menu__caret { color: var(--muted); transform: rotate(90deg); }
.profile-menu__panel { position: absolute; top: calc(100% + 10px); right: 0; z-index: 80; width: min(330px, calc(100vw - 24px)); padding: 8px; border: 1px solid rgba(199, 220, 220, .95); border-radius: 18px; background: rgba(255, 255, 255, .99); box-shadow: 0 18px 48px rgba(17, 49, 59, .18); }
.profile-menu__heading { padding: 7px 8px 10px; }
.profile-menu__heading strong, .profile-menu__heading small { display: block; }
.profile-menu__heading strong { font-size: .73rem; }
.profile-menu__heading small { margin-top: 2px; color: var(--muted); font-size: .56rem; }
.profile-menu__list { display: grid; gap: 4px; }
.profile-menu__item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 57px; padding: 8px; border-radius: 13px; }
.profile-menu__item:hover { background: var(--surface-tint); }
.profile-menu__item.is-current { background: #eff8f7; }
.profile-menu__identity { min-width: 0; }
.profile-menu__identity strong, .profile-menu__identity small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-menu__identity strong { font-size: .69rem; }
.profile-menu__identity small { margin-top: 2px; color: var(--muted); font-size: .54rem; }
.profile-menu__action { color: var(--teal); font-size: .56rem; font-weight: 850; }

.dashboard-quick-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: -3px 0 16px; }
.dashboard-quick-actions > a { display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 9px; min-width: 0; min-height: 68px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 17px; background: #fff; box-shadow: var(--shadow-sm); }
.dashboard-quick-actions > a > span:first-child { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 13px; background: var(--teal-soft); color: var(--teal); }
.dashboard-quick-actions > a.dashboard-quick-actions__places > span:first-child { background: #eef7f3; color: #4f8e76; }
.dashboard-quick-actions > a.dashboard-quick-actions__agenda > span:first-child { background: var(--blue-soft); color: var(--blue); }
.dashboard-quick-actions > a.dashboard-quick-actions__prescriptions > span:first-child { background: #f1effb; color: #7566ae; }
.dashboard-quick-actions strong { display: block; overflow: hidden; font-size: .69rem; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }

.notification-center-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.notification-center-actions > span { color: var(--muted); font-size: .68rem; font-weight: 800; }
.notification-center-actions > div { display: flex; align-items: center; gap: 7px; }
.notification-center-actions form { margin: 0; }
.notification-center-list { display: grid; gap: 9px; }
.notification-center-item { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 11px; padding: 14px; border: 1px solid var(--line); border-radius: 17px; background: #fff; box-shadow: var(--shadow-sm); }
.notification-center-item.is-unread { border-color: #b9dcda; background: linear-gradient(135deg, #f3fbfa, #fff); }
.notification-center-item__icon { display: grid; width: 43px; height: 43px; place-items: center; border-radius: 14px; background: var(--teal-soft); color: var(--teal); }
.notification-center-item__heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.notification-center-item__heading strong { font-size: .76rem; }
.notification-center-item__heading span { padding: 4px 7px; border-radius: 999px; background: var(--teal); color: #fff; font-size: .49rem; font-weight: 850; }
.notification-center-item p { margin: 5px 0 6px; font-size: .69rem; line-height: 1.45; }
.notification-center-item small { color: var(--muted); font-size: .57rem; }
.notification-center-item__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 13px; margin-top: 10px; }
.notification-center-item__actions form { margin: 0; }
.notification-center-item__actions .text-button { font-size: .61rem; }

.admin-impersonation-bar { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 8px 14px; background: #173f58; color: #fff; font-size: .67rem; }
.admin-impersonation-bar span { color: rgba(255,255,255,.84); }
.admin-impersonation-bar strong { color: #fff; }
.admin-impersonation-bar form { margin: 0; }
.admin-impersonation-bar button { padding: 6px 9px; border-radius: 8px; background: rgba(255,255,255,.14); color: #fff; font-size: .6rem; font-weight: 800; cursor: pointer; }

body.admin-page { min-height: 100vh; background: #f4f8f8; }
.admin-header { position: sticky; top: 0; z-index: 60; border-bottom: 1px solid var(--line); background: rgba(250,252,252,.96); backdrop-filter: blur(16px); }
.admin-header__inner { display: flex; width: min(1180px, 100%); min-height: 64px; align-items: center; justify-content: space-between; gap: 16px; margin: 0 auto; padding: 10px 18px; }
.admin-brand { display: flex; align-items: center; gap: 10px; }
.admin-brand > span { padding: 4px 7px; border-radius: 8px; background: #173f58; color: #fff; font-size: .56rem; font-weight: 850; text-transform: uppercase; letter-spacing: .06em; }
.admin-header__actions { display: flex; align-items: center; gap: 10px; }
.admin-header__actions > span { display: none; color: var(--muted); font-size: .65rem; font-weight: 700; }
.admin-nav { position: sticky; top: 64px; z-index: 55; overflow-x: auto; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); }
.admin-nav__inner { display: flex; width: min(1180px, max-content); min-width: 100%; margin: 0 auto; padding: 0 12px; }
.admin-nav__item { position: relative; display: inline-flex; min-height: 52px; align-items: center; gap: 7px; padding: 0 13px; color: var(--muted); font-size: .66rem; font-weight: 800; white-space: nowrap; }
.admin-nav__item.is-active { color: var(--teal); }
.admin-nav__item.is-active::after { position: absolute; right: 13px; bottom: 0; left: 13px; height: 3px; border-radius: 3px 3px 0 0; background: var(--teal); content: ''; }
.admin-shell { width: min(1180px, 100%); margin: 0 auto; padding: 24px 16px 48px; }
.admin-page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.admin-page-heading h1 { margin-bottom: 5px; font-size: clamp(1.65rem, 6vw, 2.5rem); }
.admin-page-heading p { max-width: 720px; margin: 0; font-size: .78rem; }
.admin-page-heading > form { margin: 0; }

.admin-status-strip { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 11px; margin-bottom: 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.admin-status-strip > span { display: grid; width: 39px; height: 39px; place-items: center; border-radius: 12px; }
.admin-status-strip.is-closed > span { background: var(--green-soft); color: var(--green); }
.admin-status-strip.is-open > span { background: var(--amber-soft); color: var(--amber); }
.admin-status-strip strong, .admin-status-strip small { display: block; }
.admin-status-strip strong { font-size: .7rem; }
.admin-status-strip small { margin-top: 2px; color: var(--muted); font-size: .58rem; line-height: 1.35; }
.admin-status-strip > a { color: var(--teal); font-size: .62rem; font-weight: 850; }

.admin-stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; margin-bottom: 18px; }
.admin-stat-grid > div, .admin-stat-grid > a { display: block; min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow-sm); }
.admin-stat-grid span, .admin-stat-grid small { display: block; color: var(--muted); font-size: .57rem; font-weight: 750; }
.admin-stat-grid strong { display: block; overflow: hidden; margin: 6px 0 3px; color: var(--ink); font-size: 1.35rem; text-overflow: ellipsis; white-space: nowrap; }
.admin-dashboard-grid { display: grid; gap: 14px; margin-bottom: 14px; }
.admin-panel { margin-bottom: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: var(--shadow-sm); }
.admin-panel__heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.admin-panel__heading h2 { font-size: 1rem; }
.admin-panel__heading > a { color: var(--teal); font-size: .64rem; font-weight: 850; }
.admin-panel__heading > span { color: var(--muted); font-size: .58rem; font-weight: 800; }
.admin-empty-copy { margin: 0; color: var(--muted); font-size: .68rem; }

.admin-user-mini-list, .admin-campaign-list, .admin-activity-list { display: grid; }
.admin-user-mini-list > a { display: grid; grid-template-columns: auto minmax(0,1fr) auto auto; align-items: center; gap: 9px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.admin-user-mini-list > a:last-child { border-bottom: 0; }
.admin-user-mini-list strong, .admin-user-mini-list small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-user-mini-list strong { font-size: .68rem; }
.admin-user-mini-list small { margin-top: 3px; color: var(--muted); font-size: .55rem; }
.admin-user-mini-list em { color: var(--muted); font-size: .54rem; font-style: normal; font-weight: 800; }
.admin-campaign-list > div { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 9px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.admin-campaign-list > div:last-child { border-bottom: 0; }
.admin-campaign-list > div > span:first-child { color: var(--teal); }
.admin-campaign-list strong, .admin-campaign-list small { display: block; }
.admin-campaign-list strong { font-size: .67rem; }
.admin-campaign-list small { margin-top: 2px; color: var(--muted); font-size: .55rem; }
.admin-campaign-list em { color: var(--muted); font-size: .53rem; font-style: normal; font-weight: 800; white-space: nowrap; }

.admin-activity-list > div, .admin-activity-list > article { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 9px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.admin-activity-list > :last-child { border-bottom: 0; }
.admin-activity-dot { width: 8px; height: 8px; margin-top: 5px; border: 2px solid #fff; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 2px var(--teal-soft); }
.admin-activity-list strong, .admin-activity-list small { display: block; }
.admin-activity-list strong { font-size: .66rem; }
.admin-activity-list small { margin-top: 3px; color: var(--muted); font-size: .54rem; }
.admin-activity-list code { display: block; max-width: 100%; margin-top: 5px; overflow-wrap: anywhere; color: #526b73; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .52rem; line-height: 1.4; }
.admin-activity-list--detailed > article { grid-template-columns: auto minmax(0,1fr) auto; }
.admin-activity-meta { display: block; margin-top: 4px; color: var(--teal-dark); font-size: .52rem; font-weight: 750; }

.admin-search { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 8px; margin-bottom: 13px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.admin-search > span { color: var(--muted); }
.admin-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; font-size: .69rem; }
.admin-search > a { grid-column: 2; color: var(--teal); font-size: .57rem; font-weight: 800; }
.admin-table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow-sm); }
.admin-table { width: 100%; min-width: 920px; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: 10px 11px; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: middle; }
.admin-table th { background: #f7fafa; color: var(--muted); font-size: .54rem; font-weight: 850; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.admin-table td { font-size: .62rem; }
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table td strong, .admin-table td small { display: block; }
.admin-table td small { max-width: 360px; margin-top: 2px; color: var(--muted); font-size: .53rem; line-height: 1.35; }
.admin-state { display: inline-flex; width: fit-content; padding: 4px 7px; border-radius: 999px; font-size: .49rem; font-weight: 850; }
.admin-state.is-active { background: var(--green-soft); color: var(--green); }
.admin-state.is-inactive { background: var(--red-soft); color: var(--red); }

.admin-user-summary-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; margin-bottom: 14px; }
.admin-user-summary-grid > div { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.admin-user-summary-grid span, .admin-user-summary-grid small { display: block; color: var(--muted); font-size: .54rem; }
.admin-user-summary-grid strong { display: block; margin: 5px 0 2px; font-size: 1.12rem; }
.admin-user-summary-grid .admin-small-value { overflow: hidden; font-size: .67rem; text-overflow: ellipsis; white-space: nowrap; }
.admin-edit-form { margin: 0; }
.admin-device-list { display: grid; gap: 8px; }
.admin-device-item { display: grid; gap: 9px; padding: 11px; border: 1px solid var(--line-soft); border-radius: 13px; background: #fbfdfd; }
.admin-device-item strong, .admin-device-item small, .admin-device-item em { display: block; }
.admin-device-item strong { font-size: .65rem; }
.admin-device-item small { margin-top: 4px; overflow-wrap: anywhere; color: var(--muted); font-size: .52rem; line-height: 1.4; }
.admin-device-item em { margin-top: 4px; color: #6e858c; font-size: .5rem; font-style: normal; }
.admin-inline-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.admin-inline-actions form { margin: 0; }
.admin-danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.admin-danger-zone p { max-width: 680px; margin: 4px 0 0; font-size: .63rem; }

.admin-filter-bar { display: grid; gap: 8px; margin-bottom: 13px; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.admin-filter-bar label { display: grid; gap: 4px; }
.admin-filter-bar label > span { color: var(--muted); font-size: .54rem; font-weight: 800; }
.admin-filter-bar select, .admin-filter-bar input { width: 100%; height: 38px; padding: 0 9px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: .62rem; }
.admin-filter-bar > a { align-self: center; color: var(--teal); font-size: .58rem; font-weight: 800; }
.admin-info-stack { display: grid; gap: 9px; }
.admin-info-stack > div { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 10px; padding: 10px; border-radius: 13px; background: var(--surface-soft); }
.admin-info-stack > div > svg { color: var(--teal); }
.admin-info-stack strong, .admin-info-stack small { display: block; }
.admin-info-stack strong { font-size: .66rem; }
.admin-info-stack small { margin-top: 3px; color: var(--muted); font-size: .55rem; line-height: 1.4; }

.admin-registration-control { display: grid; gap: 9px; }
.admin-choice-card { cursor: pointer; }
.admin-choice-card > input { position: absolute; opacity: 0; pointer-events: none; }
.admin-choice-card > span { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.admin-choice-card.is-selected > span, .admin-choice-card:has(input:checked) > span { border-color: #9dd1ce; background: #f1faf9; box-shadow: inset 0 0 0 1px #bfe0de; }
.admin-choice-card svg { color: var(--teal); }
.admin-choice-card strong, .admin-choice-card small { display: block; }
.admin-choice-card strong { font-size: .68rem; }
.admin-choice-card small { margin-top: 3px; color: var(--muted); font-size: .56rem; line-height: 1.4; }
.admin-system-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.admin-system-grid > div { padding: 11px; border-radius: 13px; background: var(--surface-soft); }
.admin-system-grid span, .admin-system-grid strong { display: block; }
.admin-system-grid span { color: var(--muted); font-size: .53rem; }
.admin-system-grid strong { margin-top: 4px; font-size: .67rem; }

@media (max-width: 560px) {
  .notification-center-actions { align-items: flex-start; flex-direction: column; }
  .notification-center-actions > div { flex-wrap: wrap; }
  .admin-page-heading { align-items: stretch; flex-direction: column; }
  .admin-page-heading > .button, .admin-page-heading > form .button { width: 100%; }
  .admin-status-strip { grid-template-columns: auto minmax(0,1fr); }
  .admin-status-strip > a { grid-column: 2; }
  .admin-danger-zone { align-items: stretch; flex-direction: column; }
  .admin-danger-zone .button { width: 100%; }
  .admin-activity-list--detailed > article { grid-template-columns: auto minmax(0,1fr); }
  .admin-activity-list--detailed > article > .button { grid-column: 2; width: fit-content; }
}

@media (min-width: 700px) {
  .dashboard-quick-actions { max-width: 900px; }
  .admin-header__actions > span { display: inline; }
  .admin-shell { padding: 30px 28px 60px; }
  .admin-stat-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .admin-dashboard-grid { grid-template-columns: 1fr 1fr; }
  .admin-dashboard-grid--push { grid-template-columns: 1.25fr .75fr; }
  .admin-user-summary-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .admin-device-item { grid-template-columns: minmax(0,1fr) auto; align-items: center; }
  .admin-filter-bar { grid-template-columns: 1fr 1fr 1.4fr auto auto; align-items: end; }
  .admin-system-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}

@media (min-width: 980px) {
  body.admin-page { padding-left: 0; }
  .admin-header__inner { padding-right: 28px; padding-left: 28px; }
  .admin-nav__inner { padding-right: 22px; padding-left: 22px; }
  .admin-stat-grid { grid-template-columns: repeat(6,minmax(0,1fr)); }
}
.admin-panel-copy { margin: -4px 0 13px; color: var(--muted); font-size: .6rem; line-height: 1.45; }
.admin-campaign-list form { margin: 0; }
.admin-campaign-list .text-button { font-size: .56rem; }

/* --- Portada compacta y foto de perfil (2026-08-29) --- */
.avatar, .profile-avatar { overflow: hidden; }
.avatar img, .profile-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.avatar--photo, .profile-avatar--photo { background: #e8f1f1; }

.dashboard-quick-actions { gap: 10px; margin: -3px 0 15px; }

/* Recetas: carga rápida, documentos legibles y vínculo opcional con turnos */
.prescription-list { display: grid; max-width: 800px; gap: 9px; }
.prescription-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 11px; min-height: 76px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 17px; background: #fff; box-shadow: var(--shadow-sm); }
.prescription-row:hover { border-color: #c7dcdd; background: #fbfdfd; }
.prescription-row__icon, .prescription-detail-hero__icon { display: grid; width: 45px; height: 45px; place-items: center; border-radius: 14px; background: #f1effb; color: #7566ae; }
.prescription-row__body { min-width: 0; }
.prescription-row__body strong, .prescription-row__body small, .prescription-row__body em { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prescription-row__body strong { margin-bottom: 4px; font-size: .82rem; }
.prescription-row__body small { color: var(--muted); font-size: .66rem; }
.prescription-row__body em { display: flex; align-items: center; gap: 4px; margin-top: 5px; color: var(--teal); font-size: .58rem; font-style: normal; font-weight: 750; }
.prescription-row__count { padding: 5px 8px; border-radius: 999px; background: var(--surface-soft); color: var(--ink-soft); font-size: .56rem; font-weight: 800; white-space: nowrap; }
.prescription-row__chevron { color: #a4b5b9; }
.prescription-empty { max-width: 700px; }

.prescription-upload-form { max-width: 760px; margin: 0 auto; }
.form-card__heading h2 em { color: var(--muted); font-size: .62rem; font-style: normal; font-weight: 650; }
.prescription-cancel-edit { max-width: 760px; margin: 9px auto 0; }
.prescription-existing-files { display: grid; gap: 6px; margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.prescription-existing-files > strong { color: var(--ink-soft); font-size: .65rem; }
.prescription-existing-files > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 11px; background: var(--surface-soft); }
.prescription-existing-files > div > span { display: flex; min-width: 0; align-items: center; gap: 8px; }
.prescription-existing-files > div > span:first-child > svg { color: var(--teal); }
.prescription-existing-files > div > span:first-child > span { min-width: 0; }
.prescription-existing-files strong, .prescription-existing-files small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prescription-existing-files strong { font-size: .65rem; }
.prescription-existing-files small { margin-top: 2px; color: var(--muted); font-size: .54rem; }
.prescription-existing-files a, .prescription-existing-files button { padding: 5px; background: transparent; color: var(--teal); font-size: .58rem; font-weight: 800; cursor: pointer; }
.prescription-existing-files button { color: var(--red); }

.prescription-detail-hero { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 13px; margin-bottom: 17px; padding: 18px; border: 1px solid #d9d5ee; border-radius: var(--radius-lg); background: linear-gradient(130deg, #fff, #f7f5fd); box-shadow: var(--shadow-sm); }
.prescription-detail-hero__icon { width: 53px; height: 53px; border-radius: 17px; }
.prescription-detail-hero h1 { margin: 2px 0 6px; font-size: 1.42rem; word-break: break-word; }
.prescription-detail-hero p { margin: 0; font-size: .7rem; }
.prescription-appointment-link { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; margin-bottom: 24px; padding: 12px 13px; border: 1px solid #c8e1df; border-radius: 15px; background: linear-gradient(135deg, #eff9f7, #fff); }
.prescription-appointment-link > span:first-child { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 12px; background: var(--teal-soft); color: var(--teal); }
.prescription-appointment-link strong, .prescription-appointment-link small { display: block; }
.prescription-appointment-link strong { font-size: .7rem; }
.prescription-appointment-link small { margin-top: 3px; color: var(--muted); font-size: .59rem; }
.prescription-appointment-link > svg { color: #9aadb1; }
.prescription-instructions { padding: 16px; border: 1px solid var(--line); border-radius: 17px; background: #fff; box-shadow: var(--shadow-sm); }
.prescription-instructions p { margin: 0; color: var(--ink-soft); font-size: .78rem; line-height: 1.7; overflow-wrap: anywhere; }
.prescription-file-list { display: grid; max-width: 760px; gap: 7px; }
.prescription-file-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 11px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.prescription-file-row__icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 12px; background: var(--surface-tint); color: var(--teal); }
.prescription-file-row > span:nth-child(2) { min-width: 0; }
.prescription-file-row strong, .prescription-file-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prescription-file-row strong { font-size: .68rem; }
.prescription-file-row small { margin-top: 3px; color: var(--muted); font-size: .55rem; }
.prescription-file-row__actions { display: flex; align-items: center; gap: 3px; }
.prescription-file-row__actions a { display: inline-flex; min-height: 34px; align-items: center; padding: 6px 8px; border-radius: 9px; color: var(--teal); font-size: .6rem; font-weight: 800; }
.prescription-file-row__actions a:hover { background: var(--surface-tint); }

.appointment-prescriptions { margin-top: 22px; }
.appointment-prescriptions__empty, .appointment-prescriptions__list a { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.appointment-prescriptions__empty > span:first-child, .appointment-prescriptions__list a > span:first-child { display: grid; width: 39px; height: 39px; place-items: center; border-radius: 12px; background: #f1effb; color: #7566ae; }
.appointment-prescriptions__empty strong, .appointment-prescriptions__empty small, .appointment-prescriptions__list strong, .appointment-prescriptions__list small { display: block; }
.appointment-prescriptions__empty strong, .appointment-prescriptions__list strong { font-size: .68rem; }
.appointment-prescriptions__empty small, .appointment-prescriptions__list small { margin-top: 3px; color: var(--muted); font-size: .56rem; }
.appointment-prescriptions__empty > svg, .appointment-prescriptions__list a > svg { color: #9aadb1; }
.appointment-prescriptions__list { display: grid; gap: 7px; }


/* Turnos: ficha del día con edición secundaria */
.appointment-day-hero { position: relative; display: grid; grid-template-columns: 82px minmax(0, 1fr) 42px; align-items: center; gap: 16px; margin-bottom: 12px; padding: 16px 16px 16px 14px; overflow: hidden; border: 1px solid #c6dfdc; border-radius: 21px; background: linear-gradient(135deg, #ffffff 0%, #f5fbfa 62%, #edf8f6 100%); box-shadow: var(--shadow-sm); }
.appointment-day-hero::after { content: ''; position: absolute; right: -38px; bottom: -52px; width: 150px; height: 150px; border-radius: 50%; background: rgba(20, 139, 136, .055); pointer-events: none; }
.appointment-day-date { position: relative; z-index: 1; display: grid; min-height: 88px; place-items: center; align-content: center; border: 1px solid #b9d9d6; border-radius: 18px; background: #fff; box-shadow: 0 7px 18px rgba(21, 74, 79, .08); text-align: center; }
.appointment-day-date strong, .appointment-day-date span, .appointment-day-date small { display: block; }
.appointment-day-date strong { color: var(--teal-dark); font-size: 1.78rem; font-weight: 900; line-height: .94; letter-spacing: -.05em; }
.appointment-day-date span { margin-top: 5px; color: var(--teal); font-size: .7rem; font-weight: 900; letter-spacing: .1em; }
.appointment-day-date small { margin-top: 3px; color: var(--muted); font-size: .49rem; font-weight: 750; }
.appointment-day-main { position: relative; z-index: 1; min-width: 0; }
.appointment-day-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-bottom: 6px; }
.appointment-day-kicker > span { color: var(--teal-dark); font-size: .63rem; font-weight: 850; }
.appointment-day-kicker .status-pill { font-size: .48rem; }
.appointment-day-main h1 { margin: 0; color: var(--ink); font-size: 1.45rem; line-height: 1.16; overflow-wrap: anywhere; }
.appointment-day-place { display: flex; align-items: center; gap: 6px; margin: 9px 0 0; color: var(--ink-soft); font-size: .67rem; font-weight: 750; }
.appointment-day-place svg { flex: none; color: var(--teal); }
.appointment-detail-edit { position: relative; z-index: 2; align-self: start; }
.appointment-detail-card { margin-bottom: 22px; padding: 12px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: var(--shadow-sm); }
.appointment-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.appointment-detail-item { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; min-width: 0; padding: 11px 12px; border: 1px solid var(--line-soft); border-radius: 14px; background: #fbfdfd; }
.appointment-detail-item--time { background: #f1faf8; }
.appointment-detail-item__icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 12px; background: var(--surface-tint); color: var(--teal); }
.appointment-detail-item--time .appointment-detail-item__icon { background: var(--teal-soft); }
.appointment-detail-item > span:last-child { min-width: 0; }
.appointment-detail-item small, .appointment-detail-item strong { display: block; }
.appointment-detail-item small { margin-bottom: 4px; color: var(--muted); font-size: .56rem; font-weight: 750; }
.appointment-detail-item strong { color: var(--ink); font-size: .69rem; line-height: 1.42; overflow-wrap: anywhere; }
.appointment-detail-notes { padding: 16px; border: 1px solid var(--line); border-radius: 17px; background: #fff; box-shadow: var(--shadow-sm); }
.appointment-detail-notes p { margin: 0; color: var(--ink-soft); font-size: .76rem; line-height: 1.7; overflow-wrap: anywhere; }
.appointment-edit-cancel { margin: -4px 0 18px; }

@media (max-width: 560px) {
  .appointment-day-hero { grid-template-columns: 68px minmax(0, 1fr) 36px; align-items: start; gap: 11px; padding: 12px; border-radius: 18px; }
  .appointment-day-date { min-height: 76px; border-radius: 15px; }
  .appointment-day-date strong { font-size: 1.52rem; }
  .appointment-day-date span { margin-top: 4px; font-size: .62rem; }
  .appointment-day-date small { font-size: .45rem; }
  .appointment-day-kicker { gap: 5px; margin-bottom: 5px; }
  .appointment-day-kicker > span { font-size: .56rem; }
  .appointment-day-main h1 { font-size: 1.12rem; line-height: 1.18; }
  .appointment-day-place { margin-top: 7px; font-size: .59rem; }
  .appointment-detail-edit { width: 36px; min-width: 36px; height: 36px; border-radius: 11px; }
  .appointment-detail-grid { grid-template-columns: 1fr; }
  .appointment-detail-card { padding: 9px; }
}

.study-upload-inline { display: flex; width: 100%; min-height: 44px; align-items: center; justify-content: center; gap: 7px; margin-top: 9px; border: 1px solid rgba(191, 216, 215, .78); border-radius: 13px; background: rgba(255, 255, 255, .42); color: var(--teal); font-size: .66rem; font-weight: 800; }
.study-upload-inline:hover { border-color: #a8cfcd; background: rgba(241, 250, 248, .72); }

.profile-avatar-wrap { position: relative; width: 68px; height: 68px; }
.profile-avatar-camera { position: absolute; right: -6px; bottom: -6px; z-index: 2; display: grid; width: 30px; height: 30px; padding: 0; place-items: center; border: 3px solid #fff; border-radius: 50%; background: var(--teal); color: #fff; box-shadow: 0 5px 14px rgba(16, 47, 58, .2); cursor: pointer; }
.profile-avatar-camera:hover { background: var(--teal-dark); }
.profile-avatar-camera:focus-visible { outline: 3px solid rgba(11, 127, 130, .2); outline-offset: 2px; }
.profile-photo-dialog { max-width: 430px; }
.profile-photo-dialog__form { display: grid; gap: 11px; }
.profile-photo-file { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 11px; padding: 13px; border: 1px dashed #a8cfcc; border-radius: 14px; background: var(--surface-tint); cursor: pointer; }
.profile-photo-file:hover { border-color: var(--teal); background: #edf8f6; }
.profile-photo-file input[type="file"] { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
.profile-photo-file__icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 13px; background: #fff; color: var(--teal); box-shadow: var(--shadow-sm); }
.profile-photo-file strong, .profile-photo-file small { display: block; }
.profile-photo-file strong { color: var(--ink); font-size: .72rem; }
.profile-photo-file small { margin-top: 3px; color: var(--muted); font-size: .58rem; line-height: 1.35; }
.profile-photo-delete { display: flex; width: 100%; min-height: 40px; align-items: center; justify-content: center; gap: 6px; border: 1px solid #efd2d2; border-radius: 12px; background: #fff8f8; color: var(--red); font-size: .68rem; font-weight: 800; cursor: pointer; }
.profile-photo-delete:hover { background: var(--red-soft); }
.profile-access-intro { margin: -4px 0 14px; color: var(--muted); font-size: .68rem; line-height: 1.55; }
.profile-access-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; padding: 13px; border: 1px solid #c7e1df; border-radius: 16px; background: linear-gradient(135deg, #eff9f7, #fff); }
.profile-access-form .field { margin: 0; }
.profile-access-form .button { min-height: 43px; margin-bottom: 1px; white-space: nowrap; }
.profile-access-rules { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.profile-access-rules > div { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 8px; padding: 11px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.profile-access-rules > div > svg { margin-top: 1px; color: var(--teal); }
.profile-access-rules strong, .profile-access-rules small { display: block; }
.profile-access-rules strong { font-size: .64rem; }
.profile-access-rules small { margin-top: 3px; color: var(--muted); font-size: .55rem; line-height: 1.42; }
.profile-access-list { display: grid; gap: 7px; margin-top: 12px; }
.profile-access-person { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.profile-access-person > span:nth-child(2) { min-width: 0; }
.profile-access-person strong, .profile-access-person small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-access-person strong { font-size: .68rem; }
.profile-access-person small { margin-top: 3px; color: var(--muted); font-size: .55rem; }
.profile-access-person form, .profile-access-leave { margin: 0; }
.profile-access-empty { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 12px; padding: 14px; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); }
.profile-access-empty p { margin: 0; font-size: .62rem; }
.profile-access-managed { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 11px; padding: 14px; border: 1px solid #b9dcda; border-radius: 16px; background: linear-gradient(135deg, #edf9f7, #fff); }
.profile-access-managed > span { display: grid; width: 46px; height: 46px; place-items: center; border-radius: 14px; background: var(--teal-soft); color: var(--teal); }
.profile-access-managed strong { font-size: .72rem; }
.profile-access-managed p { margin: 5px 0 0; color: var(--muted); font-size: .61rem; line-height: 1.5; }
.profile-access-leave { margin-top: 10px; text-align: right; }

@media (max-width: 560px) {
  .dashboard-quick-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .dashboard-quick-actions > a { min-height: 60px; padding: 9px 10px; border-radius: 15px; }
  .dashboard-quick-actions > a > span:first-child { width: 38px; height: 38px; border-radius: 12px; }
  .dashboard-quick-actions strong { font-size: .68rem; }
  .profile-access-form { grid-template-columns: 1fr; }
  .profile-access-form .button { width: 100%; }
  .profile-access-rules { grid-template-columns: 1fr; }
  .profile-access-person { grid-template-columns: auto minmax(0, 1fr); }
  .profile-access-person form { grid-column: 1 / -1; }
  .profile-access-person .button { width: 100%; }
  .prescription-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .prescription-row__count { display: none; }
  .prescription-detail-hero { grid-template-columns: auto minmax(0, 1fr); align-items: start; }
  .prescription-detail-hero .button { grid-column: 1 / -1; width: 100%; }
}

@media (max-width: 420px) {
  .dashboard-quick-actions { gap: 7px; }
  .dashboard-quick-actions > a { min-height: 57px; padding: 8px; }
  .dashboard-quick-actions > a > span:first-child { width: 35px; height: 35px; }
  .dashboard-quick-actions > a > strong { font-size: .66rem; }
  .dashboard-quick-actions__prescriptions small { font-size: .54rem; }
  .prescription-row { padding: 10px; }
  .prescription-row__icon { width: 39px; height: 39px; }
  .prescription-existing-files > div { grid-template-columns: 1fr; }
  .prescription-existing-files > div > span:last-child { justify-content: flex-end; }
}

/* IA por archivo: trazabilidad de fuente y alcance de reprocesamiento */
.result-source { max-width: 100%; }
.result-source a { color: var(--teal-dark); font-weight: 800; text-decoration: underline; text-decoration-color: rgba(11, 127, 130, .28); text-underline-offset: 2px; }
.result-source a:hover { text-decoration-color: currentColor; }
.result-source--legacy { white-space: normal !important; line-height: 1.35; }
.ai-processing-scope { display: grid; gap: 7px; margin-bottom: 10px; }
.ai-processing-scope label { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: flex-start; gap: 9px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; }
.ai-processing-scope label:has(input:checked) { border-color: #83bebc; background: var(--teal-soft); }
.ai-processing-scope input { margin-top: 3px; accent-color: var(--teal); }
.ai-processing-scope span, .ai-processing-scope strong, .ai-processing-scope small { display: block; min-width: 0; }
.ai-processing-scope strong { color: var(--ink); font-size: .69rem; }
.ai-processing-scope small { margin-top: 2px; color: var(--muted); font-size: .58rem; line-height: 1.4; }
.ai-processing-note { margin: -2px 2px 10px; color: var(--muted); font-size: .58rem; line-height: 1.45; }

/* --- Estudio: acciones compactas mobile (2026-09-01) --- */
.study-files-heading { align-items: center; margin-bottom: 9px; }
.study-files-heading > div:first-child { min-width: 0; }
.study-files-heading__actions { display: flex; flex: none; align-items: center; gap: 6px; }
.study-files-heading__actions .privacy-badge { min-height: 34px; }
.study-files-action {
  display: inline-flex;
  min-width: 36px;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 9px;
  border: 1px solid #d5e6e6;
  border-radius: 11px;
  background: #f7fbfb;
  color: var(--teal-dark);
  font-size: .61rem;
  font-weight: 850;
  cursor: pointer;
}
.study-files-action:hover { border-color: #afd2d0; background: var(--teal-soft); color: var(--teal-dark); }
.study-files-action:focus-visible { outline: 3px solid rgba(11, 127, 130, .13); outline-offset: 2px; }
.study-files-summary { margin: 0 2px 9px; color: var(--muted); font-size: .61rem; line-height: 1.4; }
.study-files-summary strong { color: var(--ink-soft); }
.study-file-item__main { padding: 10px 11px; }
.study-file-actions button,
.study-file-actions a { min-height: 34px; padding: 6px 10px; }

@media (max-width: 699px) {
  .study-files-heading { gap: 8px; }
  .study-files-heading .eyebrow { margin-bottom: 3px; font-size: .6rem; }
  .study-files-heading h2 { font-size: 1.08rem; }
  .study-files-heading__actions { gap: 4px; }
  .study-files-heading__actions .privacy-badge,
  .study-files-action {
    width: 34px;
    min-width: 34px;
    height: 34px;
    min-height: 34px;
    justify-content: center;
    padding: 0;
    border-radius: 10px;
  }
  .study-files-heading__actions .privacy-badge span,
  .study-files-action span { display: none; }
  .study-files-summary { margin-bottom: 8px; font-size: .57rem; }
  .study-file-list { gap: 7px; }
  .study-file-item { border-radius: 13px; }
  .study-file-item__main { gap: 8px; padding: 9px 10px; }
  .file-row__icon { width: 32px; height: 32px; border-radius: 9px; }
  .study-file-item__copy strong { font-size: .7rem; }
  .study-file-item__copy small { margin-top: 2px; font-size: .54rem; }
  .study-file-open { font-size: .56rem; }
  .study-file-actions button,
  .study-file-actions a {
    flex: 1 1 50%;
    min-height: 33px;
    justify-content: center;
    padding: 5px 8px;
    font-size: .59rem;
  }
  .file-privacy-note { margin-top: 8px; }
}
/* --- Fin estudio: acciones compactas mobile --- */

/* --- Estudios: miniaturas, filtros y enlaces temporales (2026-09-02) --- */
.study-file-filters { display: flex; gap: 5px; margin: 0 0 10px; overflow-x: auto; scrollbar-width: none; }
.study-file-filters::-webkit-scrollbar { display: none; }
.study-file-filters button { flex: none; min-height: 27px; padding: 4px 9px; border: 1px solid #dce8e8; border-radius: 999px; background: #f8fbfb; color: var(--muted); font-size: .56rem; font-weight: 850; cursor: pointer; }
.study-file-filters button.is-active { border-color: #a8d3d0; background: var(--teal-soft); color: var(--teal-dark); }
.study-file-item--visual { display: flex; min-width: 0; flex-direction: column; }
.study-file-thumbnail { position: relative; display: grid; width: 100%; aspect-ratio: 16 / 9; min-height: 142px; place-items: center; overflow: hidden; border-bottom: 1px solid var(--line-soft); background: #eaf1f1; }
.study-file-thumbnail iframe,
.study-file-thumbnail img { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover; pointer-events: none; }
.study-file-thumbnail iframe { background: #fff; }
.study-file-thumbnail img { z-index: 2; opacity: 0; transition: opacity .18s ease; }
.study-file-thumbnail img.is-loaded { opacity: 1; }
.study-file-thumbnail--pdf iframe { width: 122%; height: 122%; transform: scale(.82); transform-origin: top left; }
.study-file-thumbnail__fallback { position: absolute; inset: 0; display: grid; z-index: 1; place-content: center; justify-items: center; gap: 6px; color: #6a8c90; background: linear-gradient(145deg, #edf5f4, #dce9e9); }
.study-file-thumbnail__fallback small { font-size: .59rem; font-weight: 850; text-transform: uppercase; }
.study-file-thumbnail__badge { position: absolute; top: 8px; left: 8px; z-index: 4; padding: 4px 7px; border-radius: 7px; background: rgba(8, 30, 34, .78); color: #fff; font-size: .51rem; font-weight: 900; letter-spacing: .05em; backdrop-filter: blur(6px); }
.study-file-thumbnail > button { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; background: transparent; color: #fff; cursor: pointer; }
.study-file-thumbnail > button span { display: inline-flex; align-items: center; gap: 5px; padding: 7px 10px; border-radius: 9px; background: rgba(7, 31, 35, .76); font-size: .61rem; font-weight: 850; opacity: 0; transform: translateY(3px); transition: opacity .16s ease, transform .16s ease; backdrop-filter: blur(7px); }
.study-file-thumbnail:hover > button span,
.study-file-thumbnail > button:focus-visible span { opacity: 1; transform: translateY(0); }
.study-file-visual-copy { min-width: 0; padding: 10px 11px; background: #fff; }
.study-file-visual-copy strong,
.study-file-visual-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.study-file-visual-copy strong { color: var(--ink); font-size: .72rem; }
.study-file-visual-copy small { margin-top: 4px; color: var(--muted); font-size: .54rem; text-transform: uppercase; }
.study-file-item--visual .study-file-actions { margin-top: auto; }
.file-share-feedback a { color: inherit; font-weight: 900; text-decoration: underline; text-underline-offset: 2px; }
.study-share-target { margin: -3px 0 2px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); color: var(--ink-soft); font-size: .65rem; font-weight: 800; }

.shared-study-page { min-height: 100dvh; padding-left: 0; background: #f3f7f7; }
.shared-study-header { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid rgba(215,230,230,.92); background: rgba(255,255,255,.94); backdrop-filter: blur(14px); }
.shared-study-header__inner { display: flex; width: min(960px, 100%); min-height: 58px; align-items: center; justify-content: space-between; margin: 0 auto; padding: 9px 18px; }
.shared-study-header__inner > span:last-child { color: var(--muted); font-size: .58rem; font-weight: 850; text-transform: uppercase; }
.shared-study-brand { display: inline-flex; align-items: center; gap: 7px; color: var(--ink); }
.shared-study-brand > span { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 10px; background: var(--teal); color: #fff; }
.shared-study-brand strong { font-size: .85rem; }
.shared-study-brand strong span { color: var(--teal); }
.shared-study-shell { width: min(960px, calc(100% - 24px)); margin: 0 auto; padding: 24px 0 45px; }
.shared-study-hero { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 14px; padding: 20px; border: 1px solid var(--line); border-radius: 19px; background: linear-gradient(135deg, #fff, #edf8f7); box-shadow: var(--shadow-sm); }
.shared-study-hero__icon { display: grid; width: 53px; height: 53px; place-items: center; border-radius: 17px; background: var(--teal-soft); color: var(--teal); }
.shared-study-hero h1 { margin: 5px 0 9px; font-size: 1.35rem; word-break: break-word; }
.shared-study-hero p { display: flex; align-items: center; gap: 5px; margin: 4px 0; color: var(--ink-soft); font-size: .67rem; }
.shared-study-expiry { display: flex; align-items: center; gap: 7px; margin: 10px 2px 19px; color: var(--muted); font-size: .61rem; }
.shared-study-expiry strong { color: var(--ink-soft); }
.shared-study-files { padding: 18px; border: 1px solid var(--line); border-radius: 19px; background: #fff; box-shadow: var(--shadow-sm); }
.shared-study-file-grid { grid-template-columns: 1fr; }
.shared-study-security { display: flex; align-items: flex-start; justify-content: center; gap: 6px; margin: 15px auto 0; color: var(--muted); font-size: .57rem; line-height: 1.45; text-align: center; }
.shared-study-unavailable { display: grid; min-height: 55dvh; place-content: center; justify-items: center; padding: 30px; text-align: center; }
.shared-study-unavailable > span { display: grid; width: 70px; height: 70px; place-items: center; border-radius: 22px; background: #e4efee; color: var(--teal); }
.shared-study-unavailable h1 { margin: 17px 0 7px; font-size: 1.35rem; }
.shared-study-unavailable p { margin: 0; color: var(--muted); font-size: .7rem; }

@media (max-width: 699px) {
  .study-file-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .study-file-thumbnail { min-height: 112px; }
  .study-file-thumbnail > button span { gap: 3px; padding: 5px 7px; font-size: .53rem; opacity: 1; transform: none; }
  .study-file-visual-copy { padding: 8px; }
  .study-file-visual-copy strong { font-size: .63rem; }
  .study-file-visual-copy small { margin-top: 3px; font-size: .48rem; }
  .study-file-item--visual .study-file-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .study-file-item--visual .study-file-actions button,
  .study-file-item--visual .study-file-actions a { min-width: 0; gap: 2px; padding: 5px 3px; font-size: .49rem; }
  .shared-study-shell { width: min(100% - 16px, 960px); padding-top: 13px; }
  .shared-study-hero { gap: 10px; padding: 15px; border-radius: 16px; }
  .shared-study-hero__icon { width: 43px; height: 43px; border-radius: 14px; }
  .shared-study-hero h1 { font-size: 1.12rem; }
  .shared-study-files { padding: 13px; border-radius: 16px; }
}

@media (min-width: 700px) {
  .shared-study-file-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
/* --- Fin estudios: miniaturas, filtros y enlaces temporales --- */

/* --- Recetas: galería visual de adjuntos (2026-09-01) --- */
.prescription-detail-edit {
  align-self: start;
  border: 1px solid #ddd8ef;
  background: rgba(255,255,255,.72);
  color: #7566ae;
}
.prescription-detail-edit:hover { background: #f1effb; color: #695a9f; }

.prescription-attachments__heading { align-items: center; margin-bottom: 10px; }
.prescription-attachments__heading h2 { display: flex; align-items: center; gap: 7px; }
.prescription-attachments__heading h2 small {
  display: inline-grid;
  min-width: 21px;
  height: 21px;
  padding: 0 5px;
  place-items: center;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: .55rem;
  font-weight: 850;
}
.prescription-attachments-add {
  display: inline-flex;
  min-height: 35px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 10px;
  border: 1px solid #cce1df;
  border-radius: 11px;
  background: #f1faf8;
  color: var(--teal-dark);
  font-size: .62rem;
  font-weight: 850;
  cursor: pointer;
}
.prescription-attachments-add:hover { border-color: #9dcac7; background: var(--teal-soft); }
.prescription-attachments-add:disabled { opacity: .48; cursor: not-allowed; }

.prescription-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  max-width: 760px;
}
.prescription-gallery-item {
  position: relative;
  min-width: 0;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #edf3f3;
  box-shadow: 0 3px 12px rgba(30, 78, 88, .04);
}
.prescription-gallery-thumb {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  background: #eef3f3;
  cursor: pointer;
}
.prescription-gallery-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.prescription-gallery-delete {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 2;
  margin: 0;
}
.prescription-gallery-delete button,
.prescription-document-card__delete button {
  display: grid;
  width: 31px;
  height: 31px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 10px;
  background: rgba(255,255,255,.92);
  color: var(--red);
  box-shadow: 0 3px 10px rgba(16,47,58,.12);
  cursor: pointer;
}
.prescription-gallery-delete button:hover,
.prescription-document-card__delete button:hover { background: var(--red-soft); }

.prescription-document-list { display: grid; max-width: 760px; gap: 7px; margin-top: 9px; }
.prescription-document-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px 38px;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
}
.prescription-document-card__main {
  display: grid;
  min-width: 0;
  min-height: 56px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.prescription-document-card__main > span:first-child {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 11px;
  background: #f1effb;
  color: #7566ae;
}
.prescription-document-card__main > span:nth-child(2) { min-width: 0; }
.prescription-document-card__main strong,
.prescription-document-card__main small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.prescription-document-card__main strong { font-size: .66rem; }
.prescription-document-card__main small { margin-top: 3px; color: var(--muted); font-size: .54rem; }
.prescription-document-card__main > svg { color: #9aadb1; }
.prescription-document-card__download {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 10px;
  color: var(--teal);
}
.prescription-document-card__download:hover { background: var(--surface-tint); }
.prescription-document-card__delete { display: grid; margin: 0; place-items: center; }
.prescription-document-card__delete button { box-shadow: none; border-color: transparent; background: transparent; }

.prescription-attachments-empty {
  display: grid;
  width: 100%;
  max-width: 760px;
  min-height: 82px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 12px;
  border: 1px dashed #bcdad8;
  border-radius: 15px;
  background: #f7fbfb;
  text-align: left;
  cursor: pointer;
}
.prescription-attachments-empty > span:first-child {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  background: var(--teal-soft);
  color: var(--teal);
}
.prescription-attachments-empty strong,
.prescription-attachments-empty small { display: block; }
.prescription-attachments-empty strong { font-size: .7rem; }
.prescription-attachments-empty small { margin-top: 3px; color: var(--muted); font-size: .57rem; }
.prescription-attachments-empty > svg { color: var(--teal); }
.prescription-attachments-limit { margin: 8px 2px 0; color: var(--muted); font-size: .56rem; }

.prescription-viewer-dialog {
  width: min(1000px, calc(100% - 16px));
  max-width: 1000px;
  max-height: calc(100dvh - 16px);
  overflow: hidden;
  border-radius: 16px;
}
.prescription-viewer {
  position: relative;
  display: flex;
  height: min(860px, calc(100dvh - 16px));
  flex-direction: column;
  overflow: hidden;
  border-radius: 16px;
  background: #0d171b;
}
.prescription-viewer__header {
  display: flex;
  flex: 0 0 56px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 8px 7px 13px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  background: #17262c;
  color: #fff;
}
.prescription-viewer__header > span {
  overflow: hidden;
  color: rgba(255,255,255,.76);
  font-size: .62rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.prescription-viewer__header > div { display: flex; flex: none; align-items: center; gap: 2px; }
.prescription-viewer__header a,
.prescription-viewer__header .icon-button { color: #fff; }
.prescription-viewer__header a {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 11px;
}
.prescription-viewer__header a:hover,
.prescription-viewer__header .icon-button:hover { background: rgba(255,255,255,.09); }
.prescription-viewer__body {
  display: grid;
  min-height: 0;
  flex: 1;
  place-items: center;
  overflow: auto;
  background: #0d171b;
}
.prescription-viewer__body img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.prescription-viewer__body iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}
.prescription-viewer__nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  display: grid;
  width: 42px;
  height: 52px;
  place-items: center;
  border-radius: 13px;
  background: rgba(0,0,0,.42);
  color: #fff;
  cursor: pointer;
  transform: translateY(-50%);
  backdrop-filter: blur(5px);
}
.prescription-viewer__nav--previous { left: 7px; }
.prescription-viewer__nav--previous svg { transform: rotate(180deg); }
.prescription-viewer__nav--next { right: 7px; }
.prescription-viewer__unavailable {
  display: flex;
  max-width: 390px;
  align-items: center;
  flex-direction: column;
  gap: 7px;
  padding: 24px;
  color: rgba(255,255,255,.7);
  text-align: center;
}
.prescription-viewer__unavailable strong { color: #fff; font-size: .8rem; }
.prescription-viewer__unavailable span { font-size: .62rem; line-height: 1.5; }
.prescription-viewer__unavailable a {
  margin-top: 5px;
  padding: 8px 11px;
  border-radius: 10px;
  background: rgba(255,255,255,.1);
  color: #fff;
  font-size: .6rem;
  font-weight: 800;
}

@media (max-width: 560px) {
  .prescription-detail-hero { grid-template-columns: auto minmax(0, 1fr) 38px; padding: 14px; }
  .prescription-detail-hero__icon { width: 46px; height: 46px; border-radius: 15px; }
  .prescription-detail-hero h1 { font-size: 1.22rem; }
  .prescription-detail-edit { width: 36px; min-width: 36px; height: 36px; border-radius: 11px; }
  .prescription-attachments__heading .eyebrow { margin-bottom: 3px; font-size: .58rem; }
  .prescription-attachments__heading h2 { font-size: 1.05rem; }
  .prescription-attachments-add { width: 35px; min-width: 35px; height: 35px; min-height: 35px; padding: 0; }
  .prescription-attachments-add span { display: none; }
  .prescription-gallery-grid { gap: 6px; }
  .prescription-gallery-item { border-radius: 11px; }
  .prescription-gallery-delete { top: 4px; right: 4px; }
  .prescription-gallery-delete button { width: 28px; height: 28px; border-radius: 9px; }
  .prescription-document-card { grid-template-columns: minmax(0, 1fr) 36px 36px; }
  .prescription-document-card__main { min-height: 52px; padding: 7px 8px; }
  .prescription-viewer-dialog { width: calc(100% - 6px); max-height: calc(100dvh - 6px); margin: 3px; border-radius: 13px; }
  .prescription-viewer { height: calc(100dvh - 6px); border-radius: 13px; }
  .prescription-viewer__nav { width: 37px; height: 48px; }
}

@media (min-width: 700px) {
  .prescription-gallery-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}
/* --- Fin recetas: galería visual de adjuntos --- */

/* --- Lugares: portal agrupado + WhatsApp --- */
.place-whatsapp-button,
.portal-launch-button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 68px;
  padding: 12px 14px;
  border-radius: 16px;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}
.place-whatsapp-button { margin: -8px 0 14px; background: #1f9f5f; color: #fff; }
.place-whatsapp-button:hover { background: #198851; color: #fff; }
.place-whatsapp-button__icon,
.portal-launch-button__icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
}
.place-whatsapp-button__icon { background: rgba(255,255,255,.16); }
.place-whatsapp-button strong,
.place-whatsapp-button small,
.portal-launch-button strong,
.portal-launch-button small { display: block; }
.place-whatsapp-button strong { font-size: .76rem; }
.place-whatsapp-button small { margin-top: 3px; color: rgba(255,255,255,.82); font-size: .59rem; }
.portal-access-card { padding: 0; overflow: hidden; gap: 0; }
.portal-launch-button {
  border-radius: 0;
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  color: #fff;
  box-shadow: none;
}
.portal-launch-button:hover { color: #fff; }
.portal-launch-button__icon { background: rgba(255,255,255,.15); }
.portal-launch-button__copy strong { font-size: .84rem; line-height: 1.25; }
.portal-launch-button__copy small { margin-top: 4px; color: rgba(255,255,255,.76); font-size: .56rem; font-weight: 700; }
.portal-access-card > .credential-card__heading,
.portal-access-card > .credential-value,
.portal-access-card > .credential-feedback { margin-left: 14px; margin-right: 14px; }
.portal-access-card > .credential-card__heading { margin-top: 14px; }
.portal-access-card > .credential-value { margin-top: 10px; }
.portal-access-card > .credential-feedback { margin-top: 8px; margin-bottom: 13px; }
.portal-launch-button + .credential-value { margin-top: 14px; }

@media (max-width: 560px) {
  .place-whatsapp-button,
  .portal-launch-button { min-height: 64px; padding: 11px 12px; }
  .place-whatsapp-button__icon,
  .portal-launch-button__icon { width: 39px; height: 39px; border-radius: 12px; }
  .portal-launch-button__copy strong { font-size: .8rem; }
}
/* --- Fin lugares: portal agrupado + WhatsApp --- */


/* /study.php - ficha simplificada v8 */
.study-sheet-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 14px;
  margin: 0 0 22px;
  padding: 18px 19px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.study-sheet-head__main { min-width: 0; }
.study-sheet-head__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px 14px;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: .65rem;
  font-weight: 750;
}
.study-sheet-head__meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.study-sheet-head h1 {
  margin: 0;
  color: var(--navy);
  font-size: 1.55rem;
  line-height: 1.14;
  letter-spacing: -.025em;
  word-break: break-word;
}
.study-sheet-head__submeta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: .66rem;
}
.study-sheet-head__submeta > span:not(.status-pill) {
  position: relative;
}
.study-sheet-head__submeta > span:not(.status-pill) + span:not(.status-pill)::before {
  position: absolute;
  top: 50%;
  left: -7px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #b8c5c7;
  content: "";
  transform: translateY(-50%);
}
.study-sheet-head__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
}
.study-sheet-head__links .study-appointment-link,
.study-sheet-head__links .study-group-badge {
  margin: 0;
  font-size: .61rem;
}
.study-sheet-head__menu { margin-top: 1px; }

.study-simple-heading { align-items: center; }
.study-simple-heading > div:first-child { min-width: 0; }
.study-simple-heading h2,
.study-files-heading h2 { margin: 0; }
.study-simple-heading p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: .61rem;
  line-height: 1.4;
}
#archivos.detail-section,
#resultados.detail-section,
#resumen.detail-section {
  margin-bottom: 31px;
}
#archivos.detail-section + #resultados.detail-section,
#resultados.detail-section + #resumen.detail-section {
  padding-top: 2px;
}
#resultados .values-workspace { margin-top: 2px; }
#resultados .result-filters {
  margin-bottom: 9px;
}
#resumen .summary-box {
  border-color: var(--line);
  background: #fff;
  box-shadow: var(--shadow-sm);
}
#resumen .summary-box > div {
  border-top-color: var(--line-soft);
}

@media (max-width: 699px) {
  .study-sheet-head { gap: 9px; margin-bottom: 19px; padding: 15px 14px; border-radius: 16px; }
  .study-sheet-head h1 { font-size: 1.32rem; }
  .study-sheet-head__meta { gap: 6px 10px; font-size: .61rem; }
  .study-sheet-head__submeta { font-size: .61rem; }
  .study-simple-heading { align-items: flex-start; }
  .study-simple-heading p { max-width: 260px; }
}
