/* Dianfy · perfil, vínculos, ideación y panel profesional (se carga después de app.css) */
.av { --s: 38px; width: var(--s); height: var(--s); flex: none; display: inline-grid; place-items: center; border-radius: 50%; background: var(--c); color: #1B1A17; border: 2px solid #1B1A17; overflow: hidden; font-weight: 800; font-size: calc(var(--s) * .42); }
.av img { width: 100%; height: 100%; object-fit: cover; display: block; } .av b { line-height: 1; }
.av.sm { --s: 28px; } .av.lg { --s: 52px; } .av.xl { --s: 96px; }
.whochip { display: inline-flex !important; align-items: center; gap: 8px; }
.whochip .nm { display: none; } @media (min-width: 700px) { .whochip .nm { display: inline; } }
.prof-head { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; margin-bottom: 22px; }
.prof-pic { display: grid; gap: 12px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches button { width: 26px; height: 26px; border-radius: 50%; background: var(--c); border: 2px solid var(--soft); cursor: pointer; padding: 0; }
.swatches button.on { border-color: var(--ink); box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink); }
.label { display: block; margin-bottom: 8px; font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; color: var(--ink2); }
.two { display: grid; gap: 14px; margin: 14px 0; } @media (min-width: 640px) { .two { grid-template-columns: 1fr 1fr; } }
.prof-head + label.f { margin-bottom: 4px; }
.pfields { display: grid; gap: 8px; } .pf { display: grid; grid-template-columns: 1fr 2fr auto; gap: 8px; align-items: center; }
.codebox { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 16px 18px; border: 2px dashed var(--line); border-radius: 16px; background: var(--surface2); }
.codebox code { font-size: 1.7rem; font-weight: 800; letter-spacing: .14em; font-family: inherit; }
.linkrow { display: flex; gap: 14px; align-items: center; padding: 14px 0; border-top: 1px solid var(--soft); flex-wrap: wrap; }
.linkrow > div:not(.actions) { flex: 1; min-width: 180px; } .linkrow small { display: block; color: var(--ink2); }
.vbadge { display: inline-block; margin-left: 6px; padding: 1px 9px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: .68rem; font-weight: 800; vertical-align: middle; }
.vbadge.off { background: var(--surface2); color: var(--ink2); border: 1px solid var(--soft); }
.chk { display: flex; gap: 10px; align-items: flex-start; font-size: .88rem; font-weight: 600; } .chk input { width: auto; margin-top: 3px; }
.chk-row { display: grid; gap: 8px; }
.ide { display: grid; gap: 10px; } @media (min-width: 640px) { .ide { grid-template-columns: repeat(2, 1fr); } }
.ide button { text-align: left; padding: 13px 16px; border: var(--bw) solid var(--soft); border-radius: 16px; background: var(--surface2); font-weight: 700; font-size: .9rem; cursor: pointer; transition: transform .15s, border-color .15s; }
.ide button:hover { border-color: var(--line); }
.ide button.on { background: var(--blue); color: #1B1A17; border-color: #1B1A17; box-shadow: var(--shadow-sm); transform: translate(-1px, -1px); }
.ide button.skip { grid-column: 1 / -1; background: transparent; border-style: dashed; color: var(--ink2); }
.helpbox { margin-top: 14px; padding: 16px 18px; border: 2px solid var(--coral); background: color-mix(in srgb, var(--coral) 12%, var(--surface)); border-radius: 16px; font-size: .92rem; }
.helpbox b { display: block; margin-bottom: 4px; }
.tabs .dotn { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 6px; border-radius: 999px; background: var(--coral); color: #1B1A17; font-size: .7rem; font-weight: 800; text-align: center; }

/* ----- panel profesional ----- */
.ptable { width: 100%; border-collapse: collapse; font-size: .9rem; }
.ptable th { text-align: left; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--ink2); padding: 8px 10px; border-bottom: 2px solid var(--soft); }
.ptable td { padding: 12px 10px; border-bottom: 1px solid var(--soft); vertical-align: middle; }
.ptable tr.row { cursor: pointer; } .ptable tr.row:hover td { background: var(--surface2); }
.pcell { display: flex; align-items: center; gap: 12px; } .pcell b { display: block; } .pcell small { color: var(--ink2); }
.spark { width: 120px; height: 30px; display: block; }
.pill { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: .74rem; font-weight: 800; border: 2px solid #1B1A17; background: var(--surface2); color: #1B1A17; white-space: nowrap; }
.pill.ok { background: var(--green); } .pill.warn { background: var(--warn, #FF8A1F); } .pill.bad { background: var(--coral); } .pill.info { background: var(--blue); }
.alert { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border: 2px solid #1B1A17; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-sm); margin-bottom: 14px; flex-wrap: wrap; }
.alert.l3 { background: color-mix(in srgb, var(--coral) 22%, var(--surface)); } .alert.l2 { background: color-mix(in srgb, var(--warn, #FF8A1F) 22%, var(--surface)); }
.alert.done { opacity: .6; box-shadow: none; }
.alert > div { flex: 1; min-width: 200px; } .alert b, .alert small, .alert .small { display: block; } .alert small { color: var(--ink2); }
.bkrow { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: .9rem; } .dl dt { color: var(--ink2); font-weight: 700; } .dl dd { margin: 0; }
.nlist li { padding: 12px 0; border-top: 1px solid var(--soft); display: flex; gap: 10px; align-items: flex-start; } .nlist li:first-child { border-top: 0; }
.nlist li > div { flex: 1; } .nlist small { color: var(--ink2); display: block; }
.idelist li { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--soft); font-size: .9rem; } .idelist li:first-child { border-top: 0; }
@media (max-width: 760px) { .ptable .hide-s { display: none; } .spark { width: 84px; } }

/* ----- deslizadores, crisis y coincidencias ----- */
.slide { display: flex; align-items: center; gap: 12px; width: min(58%, 320px); } .slide small { min-width: 70px; text-align: right; font-size: .74rem; color: var(--ink2); font-weight: 700; }
.rng { -webkit-appearance: none; appearance: none; flex: 1; width: 100%; height: 12px; border-radius: 999px; border: 2px solid var(--line); background: linear-gradient(90deg, color-mix(in srgb, var(--c, #00D9C0) 18%, var(--surface2)), var(--c, #00D9C0)); cursor: pointer; padding: 0; }
.rng::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 28px; height: 28px; border-radius: 50%; background: var(--surface); border: 3px solid #1B1A17; box-shadow: var(--shadow-sm); cursor: grab; }
.rng::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--surface); border: 3px solid #1B1A17; box-shadow: var(--shadow-sm); cursor: grab; }
.rng.idle { opacity: .55; } .rng:focus-visible { outline: 3px solid var(--blue); outline-offset: 5px; }
.peak { display: flex; align-items: center; gap: 14px; } .peak b { min-width: 110px; text-align: right; font-size: 1.05rem; }
.sensbox { margin-top: 22px; border-top: 2px dashed var(--soft); padding-top: 18px; } .sensbox summary { cursor: pointer; font-weight: 800; } .sensbox summary em { font-style: normal; font-weight: 500; color: var(--ink2); font-size: .8rem; margin-left: 8px; }
.crisisbar { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; justify-content: space-between; margin-bottom: 22px; padding: 13px 18px; border: 2px solid #1B1A17; border-radius: 16px; background: color-mix(in srgb, var(--coral) 20%, var(--surface)); box-shadow: var(--shadow-sm); transition: transform .15s; } .crisisbar:hover { transform: translate(-2px, -2px); }
.crisisbar span { font-size: .85rem; color: var(--ink2); font-weight: 700; }
.breathe { position: relative; height: 150px; display: grid; place-items: center; margin-top: 6px; }
.breathe i { width: 120px; height: 120px; border-radius: 50%; background: var(--accent); border: 3px solid #1B1A17; animation: breathe 10s ease-in-out infinite; }
.breathe span { position: absolute; font-weight: 800; color: #04231f; font-size: 1.1rem; opacity: 0; }
.breathe .in { animation: lblin 10s infinite; } .breathe .out { animation: lblout 10s infinite; }
@keyframes breathe { 0%, 100% { transform: scale(.55); } 40% { transform: scale(1.12); } }
@keyframes lblin { 0%, 4% { opacity: 0; } 8%, 36% { opacity: 1; } 42%, 100% { opacity: 0; } }
@keyframes lblout { 0%, 42% { opacity: 0; } 48%, 94% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .breathe i, .breathe span { animation: none; } .breathe i { transform: scale(.85); } .breathe .in { opacity: 1; } }
.readbox { margin-top: 12px; padding: 14px 16px; border: 2px solid var(--blue); border-radius: 14px; background: color-mix(in srgb, var(--blue) 12%, var(--surface)); font-size: .9rem; } .readbox p + p { margin-top: 8px; }
.eplist li { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--soft); align-items: flex-start; } .eplist li:first-child { border-top: 0; } .eplist li > div { flex: 1; } .eplist small { display: block; color: var(--ink2); margin-top: 3px; }
.guide td:first-child { font-weight: 800; white-space: nowrap; } .guide td { font-size: .84rem; }
@media (max-width: 560px) { .tr-row { flex-wrap: wrap; } .slide { width: 100%; } }
.grid2 > *, .two > *, .stack > *, .reg > * { min-width: 0; }
.card input:not([type=checkbox]):not([type=radio]):not([type=range]), .card select, .card textarea { max-width: 100%; }
@media (max-width: 700px) { .rtable { display: block; overflow-x: auto; max-width: 100%; } }
#ptabs { max-width: 100%; flex-wrap: wrap; border-radius: 22px; }
.suibox { margin: 0 0 24px; padding: 20px; border: 3px solid #1B1A17; border-radius: 20px; background: color-mix(in srgb, var(--coral) 16%, var(--surface)); box-shadow: 6px 6px 0 var(--coral); }
.suihead { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 1.15rem; }
.suibox .alert { background: var(--surface); } .alert .actions { margin-top: 8px; }

/* ----- ventana de apoyo ----- */
.support { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 16px; background: rgba(20, 18, 14, .62); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); animation: supIn .25s ease; overflow-y: auto; }
.support.out { opacity: 0; transition: opacity .18s; }
.support-box { position: relative; width: 100%; max-width: 560px; margin: auto; background: var(--surface); color: var(--ink); border: 3px solid #1B1A17; border-radius: 26px; box-shadow: 8px 8px 0 var(--accent); overflow: hidden; animation: supPop .35s var(--ease); }
.support-x { position: absolute; top: 12px; right: 14px; width: 40px; height: 40px; border-radius: 50%; border: 2px solid #1B1A17; background: var(--surface); color: var(--ink); font-size: 1.5rem; line-height: 1; cursor: pointer; z-index: 2; }
.support-hero { padding: 30px 26px 22px; background: linear-gradient(160deg, color-mix(in srgb, var(--coral) 28%, var(--surface)), color-mix(in srgb, var(--amber) 24%, var(--surface))); border-bottom: 2px solid #1B1A17; }
.support-hero h2 { font-size: clamp(1.45rem, 5vw, 1.9rem); font-weight: 800; letter-spacing: -.035em; line-height: 1.1; margin: 10px 40px 10px 0; }
.support-hero p { font-size: .98rem; line-height: 1.55; }
.heart { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: #FF5252; color: #fff; border: 2px solid #1B1A17; animation: beat 2.4s ease-in-out infinite; } .heart svg { width: 24px; height: 24px; }
.support-steps { counter-reset: s; display: grid; gap: 12px; padding: 20px 26px 6px; }
.support-steps li { counter-increment: s; position: relative; padding-left: 40px; font-size: .94rem; line-height: 1.5; }
.support-steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--amber); border: 2px solid #1B1A17; display: grid; place-items: center; font-weight: 800; font-size: .85rem; color: #1B1A17; }
.support-lines { margin: 14px 26px 0; padding: 4px 0; border-top: 2px dashed var(--soft); }
.sl-country > span { display: block; margin: 12px 0 4px; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; color: var(--ink2); }
.sl-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--soft); } .sl-row > div { flex: 1; } .sl-row b { display: block; font-size: .9rem; } .sl-row small { display: block; font-size: .95rem; color: var(--ink); font-weight: 800; letter-spacing: .02em; }
.sl-call { padding: 7px 16px; border-radius: 999px; background: var(--accent); color: var(--on-accent); border: 2px solid #1B1A17; font-weight: 800; font-size: .82rem; }
.support-pro { margin: 14px 26px 0; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--blue) 14%, var(--surface)); border: 2px solid var(--blue); font-size: .88rem; }
.support-actions { display: flex; flex-wrap: wrap; gap: 10px; padding: 18px 26px 6px; }
.support-foot { padding: 6px 26px 20px; font-size: .75rem; color: var(--ink2); }
@keyframes supIn { from { opacity: 0; } } @keyframes supPop { from { opacity: 0; transform: translateY(18px) scale(.97); } } @keyframes beat { 0%, 100% { transform: scale(1); } 12% { transform: scale(1.12); } 24% { transform: scale(1); } 36% { transform: scale(1.1); } }
@media (prefers-reduced-motion: reduce) { .support, .support-box, .heart { animation: none; } }
@media (max-width: 480px) { .support-hero { padding: 26px 20px 18px; } .support-steps, .support-actions { padding-left: 20px; padding-right: 20px; } .support-lines, .support-pro { margin-left: 20px; margin-right: 20px; } .support-foot { padding-left: 20px; } }

/* ----- análisis y gráficos extra ----- */
.divbars { display: grid; gap: 8px; } .dv { display: grid; grid-template-columns: minmax(90px, 1.1fr) 2fr 52px 36px; gap: 10px; align-items: center; font-size: .86rem; } .dv span { font-weight: 700; }
.dvb { position: relative; height: 14px; border-radius: 7px; background: var(--surface2); border: 2px solid var(--soft); } .dvb::after { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 2px; background: currentColor; opacity: .35; }
.dvb i { position: absolute; top: 0; bottom: 0; border-radius: 6px; } .dvb i.pos { left: 50%; background: #00D9C0; } .dvb i.neg { right: 50%; background: #FF5252; }
.dv small { color: var(--ink2); } .dv b { text-align: right; }
.report .dvb { background: #eee9de; border-color: #ddd6c6; } .report .dv small { color: #5b6270; }
svg.heat text { fill: var(--ink2); } .report svg.heat text { fill: #5b6270; }
.lowdata { margin: 12px 0 0; padding: 10px 14px; border: 2px solid var(--blue); border-radius: 12px; background: var(--note, color-mix(in srgb, var(--blue) 14%, var(--surface))); font-size: .85rem; }
.risklist { display: grid; gap: 6px; } .risklist li { display: flex; justify-content: space-between; gap: 14px; padding: 9px 12px; border-radius: 10px; background: #f4f1ea; font-size: .88rem; border-left: 5px solid #cfc8b6; } .risklist li.l1 { border-color: #FFD60A; } .risklist li.l2 { border-color: #FF8A1F; background: #fff1e6; } .risklist li.l3 { border-color: #FF5252; background: #ffe9e9; } .risklist span { color: #5b6270; } .risklist b { text-align: right; }
details.items { margin-top: 10px; } details.items summary { cursor: pointer; font-size: .82rem; font-weight: 700; } details.items tr.hot td { background: #ffe9e9; }
.rcard { padding: 16px 18px; border: 2px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-sm); }
.toolkit li { display: flex; gap: 10px; padding: 8px 0; border-top: 1px solid var(--soft); font-size: .9rem; } .toolkit li:first-child { border-top: 0; }
.taskli { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; border-top: 1px solid var(--soft); } .taskli:first-child { border-top: 0; } .taskli input { width: 22px; height: 22px; margin-top: 2px; accent-color: #00D9C0; } .taskli.done b { text-decoration: line-through; opacity: .6; } .taskli small { display: block; color: var(--ink2); }
.planlist { margin: 6px 0 0; padding-left: 18px; list-style: disc; } .planlist li { padding: 2px 0; }
.row2 { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; align-items: center; }
.faces5 { display: flex; gap: 6px; } .faces5 button { width: 44px; height: 44px; padding: 3px; border-radius: 12px; border: 2px solid var(--soft); background: var(--surface2); cursor: pointer; } .faces5 button svg { width: 100%; height: 100%; } .faces5 button.on { border-color: #1B1A17; background: var(--c); box-shadow: var(--shadow-sm); }
.seg4 { display: flex; flex-wrap: wrap; gap: 8px; } .seg4 button { padding: 8px 14px; border-radius: 999px; border: 2px solid var(--soft); background: var(--surface2); font-weight: 700; font-size: .84rem; cursor: pointer; } .seg4 button.on { background: var(--amber); border-color: #1B1A17; color: #1B1A17; box-shadow: var(--shadow-sm); }
@media (max-width: 560px) { .dv { grid-template-columns: 1fr 1.4fr 50px; } .dv small { display: none; } }

.mrow { display: flex; align-items: center; gap: 12px; margin-top: 10px; } .mrow > span { width: 62px; }
.medbox { margin-top: 18px; padding-top: 16px; border-top: 2px dashed var(--soft); }
.support-plan { margin: 14px 26px 0; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--accent) 14%, var(--surface)); border: 2px solid var(--accent); font-size: .9rem; }
.support-plan .label { margin-bottom: 4px; }
.flags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; } .flags .pill { font-size: .68rem; padding: 1px 8px; }
.row2 { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; align-items: center; }

/* ----- modos de registro, chequeo periódico ----- */
.off { display: none !important; }
.modebar { margin: 0 0 22px; padding: 14px 16px; border: 2px dashed var(--soft); border-radius: 18px; display: grid; gap: 12px; background: var(--surface); }
.mb-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; } .mb-row .label { min-width: 150px; }
.seg4 button small { display: block; font-size: .68rem; font-weight: 600; opacity: .7; margin-top: 1px; }
.mb-custom { display: grid; gap: 8px 18px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); padding: 10px 12px; border-radius: 14px; background: var(--surface2); }
.duecard, .donecard { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; padding: 16px 18px; border: 2px solid #1B1A17; border-radius: 18px; box-shadow: var(--shadow-sm); }
.duecard { background: color-mix(in srgb, var(--warn, #FF8A1F) 22%, var(--surface)); } .donecard { background: color-mix(in srgb, var(--accent) 22%, var(--surface)); }
.duecard b, .donecard b { display: block; font-size: 1.02rem; } .duecard span, .donecard span { font-size: .86rem; color: var(--ink2); }
.ck.on { background: var(--amber); border-color: #1B1A17; }
.faces5 button.ck.on { background: var(--c); }


/* ----- navegación en 5 destinos, barra inferior y botón de ayuda ----- */
.tabs .navit { display: inline-flex; align-items: center; gap: 7px; } .tabs .navit svg { width: 17px; height: 17px; }
.subnav { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 0 24px; padding-bottom: 4px; }
.subnav a { flex: none; padding: 8px 16px; border-radius: 999px; border: 2px solid var(--soft); background: var(--surface); font-weight: 800; font-size: .86rem; color: var(--ink2); white-space: nowrap; }
.subnav a.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.bottombar { display: none; }
.sosfab { position: fixed; right: 14px; bottom: 24px; z-index: 45; padding: 11px 18px; border-radius: 999px; background: var(--coral); color: #1B1A17; border: 2px solid #1B1A17; box-shadow: var(--shadow-sm); font-weight: 800; font-size: .85rem; }
.sosfab[hidden] { display: none !important; }
@media (max-width: 899px) {
  .tabs { display: none !important; }
  .bottombar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 44; background: #1B1A17; border-top: 2px solid var(--accent); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .bottombar a { flex: 1; display: grid; justify-items: center; gap: 3px; padding: 6px 2px; border-radius: 12px; font-size: .68rem; font-weight: 700; color: rgba(255,255,255,.62); position: relative; }
  .bottombar a svg { width: 22px; height: 22px; } .bottombar a.on { color: var(--accent); }
  .bottombar .dotn { position: absolute; top: 0; right: 22%; margin: 0; }
  body { padding-bottom: 84px; } .sosfab { bottom: 86px; }
}
.quickok { margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--accent) 22%, var(--surface)); border: 2px solid #1B1A17; font-size: .9rem; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.quickok[hidden] { display: none; }

.morecharts > summary { cursor: pointer; font-weight: 800; padding: 14px 18px; margin-top: 22px; border: 2px dashed var(--soft); border-radius: 16px; background: var(--surface); } .morecharts[open] > summary { margin-bottom: 0; }
.steps ul { display: grid; gap: 12px; } .steps li { display: flex; gap: 12px; align-items: flex-start; } .steps li small { display: block; color: var(--ink2); margin-top: 2px; } .steps li small a { text-decoration: underline; font-weight: 800; color: var(--ink); }
.steps .ck { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: .8rem; font-weight: 800; } .steps .ck.on { background: var(--accent); color: #04231f; }
.steps li.ok b { text-decoration: line-through; opacity: .6; } .steps-h { display: flex; justify-content: space-between; align-items: center; } .steps-h h3 { margin: 0; }

.idc-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.av b { display: grid; place-items: center; width: 100%; height: 100%; line-height: 1; padding-top: .08em; text-align: center; }

.support-note { margin: 0 26px 14px; font-size: .86rem; line-height: 1.5; color: var(--ink2); }
@media (max-width: 480px) { .support-note { margin-left: 20px; margin-right: 20px; } }

.lockbox { display: flex; flex-direction: column; gap: 4px; padding: 14px 18px; background: var(--note, color-mix(in srgb, var(--blue) 14%, var(--surface))); border: 2px solid #1B1A17; border-radius: 16px; box-shadow: var(--shadow-sm); font-size: .92rem; }
.pastmood { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; } .pface { width: 64px; height: 64px; display: block; } .pface svg { width: 100%; height: 100%; }
.pchips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; } .pchip { padding: 6px 14px; border: 2px solid #1B1A17; border-radius: 999px; background: color-mix(in srgb, var(--c) 55%, var(--surface)); font-weight: 700; font-size: .86rem; }
.pnote { margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--surface2); white-space: normal; }

/* Bloby de ánimo */
.qface { flex: none; display: inline-block; width: 44px; height: 44px; vertical-align: middle; } .qface.big { width: 62px; height: 62px; } .qface svg { width: 100%; height: 100%; display: block; overflow: visible; }
.donecard { align-items: center; } .donecard > .qface { margin-right: 4px; }
.story-h { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; } .story-h h3 { margin: 0; }
.lg-b { display: inline-flex; align-items: center; gap: 6px; } .lg-b em { width: 26px; height: 26px; display: inline-block; } .lg-b em svg { width: 100%; height: 100%; display: block; overflow: visible; }
.quickok .qface { margin-right: 4px; }

/* barra de modo de registro */
.modebar { border: 2px solid #1B1A17; border-style: solid; background: var(--surface); box-shadow: var(--shadow-sm); }
.modebar.compact { display: flex; align-items: center; gap: 14px; padding: 12px 16px; }
.mb-ico { flex: none; width: 42px; height: 42px; display: grid; place-items: center; border: 2px solid #1B1A17; border-radius: 14px; background: var(--amber); color: #1B1A17; }
.mb-ico svg { width: 22px; height: 22px; }
.mb-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.mb-t { font-weight: 800; font-size: .98rem; line-height: 1.1; }
.mb-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mb-chip { padding: 3px 11px; border: 2px solid #1B1A17; border-radius: 999px; font-size: .78rem; font-weight: 800; color: #1B1A17; background: #FFD60A; white-space: nowrap; }
.mb-chip.m-full { background: #7EE03A; } .mb-chip.m-simple { background: #FFD60A; } .mb-chip.m-essential { background: #FF8A1F; } .mb-chip.m-custom { background: #2D8CFF; color: #fff; }
.mb-chip.c { background: var(--surface2); }
.mb-btn { flex: none; padding: 8px 18px; border: 2px solid #1B1A17; border-radius: 999px; background: #1B1A17; color: #fff; font: inherit; font-weight: 800; font-size: .86rem; cursor: pointer; box-shadow: 2px 2px 0 var(--amber); transition: transform .12s, box-shadow .12s; }
.mb-btn:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--amber); }
.mb-done { display: flex; justify-content: flex-end; }
@media (max-width: 480px) { .modebar.compact { flex-wrap: wrap; } .mb-txt { flex-basis: calc(100% - 60px); } .mb-btn { margin-left: auto; } }

/* ----- qué influyó: positivos / negativos ----- */
.fac-key i { display: inline-block; width: 11px; height: 11px; border: 2px solid #1B1A17; border-radius: 50%; vertical-align: -1px; margin: 0 2px 0 8px; } .fac-key i:first-child { margin-left: 0; }
.fc.neg.on { color: #1B1A17; }

/* ----- selector de hora ----- */
.tp { display: inline-flex; align-items: center; gap: 2px; margin-top: 6px; padding: 4px 8px 4px 10px; border: 2px solid #1B1A17; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-sm); }
.tp select { appearance: none; -webkit-appearance: none; border: 0; background: transparent; color: var(--ink); font: inherit; font-weight: 800; font-size: 1.35rem; padding: 4px 6px; border-radius: 10px; cursor: pointer; text-align: center; text-align-last: center; }
.tp select:hover, .tp select:focus-visible { background: color-mix(in srgb, var(--amber) 35%, var(--surface)); outline: none; }
.tp b { font-size: 1.35rem; line-height: 1; }
.tp-x { border: 0; background: var(--surface2); color: var(--ink2); width: 26px; height: 26px; border-radius: 50%; font-size: 1.1rem; line-height: 1; cursor: pointer; margin-left: 4px; }
.tp-x:hover { background: #FF8A1F; color: #1B1A17; }

/* ----- medicación ----- */
.medlist { margin: 6px 0 10px; } .medlist a { font-weight: 800; text-decoration: underline; }
.medgrid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin-top: 18px; }
.medcard { padding: 16px 18px; border: 2px solid #1B1A17; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-sm); }
.medcard.off { opacity: .75; box-shadow: none; }
.mc-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; } .mc-h b { font-size: 1.05rem; }
.mc-dose { padding: 2px 11px; border: 2px solid #1B1A17; border-radius: 999px; background: #FFD60A; color: #1B1A17; font-weight: 800; font-size: .82rem; }
.mc-w { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.mc-chip { padding: 2px 11px; border: 2px solid #1B1A17; border-radius: 999px; background: #7EE03A; color: #1B1A17; font-weight: 800; font-size: .78rem; }
.mc-a { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.medform { margin-top: 18px; } .medform .f { display: block; margin-bottom: 12px; }
.acwrap { position: relative; }
.aclist { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); border: 2px solid #1B1A17; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-sm); overflow: hidden; }
.aclist button { display: flex; flex-direction: column; align-items: flex-start; width: 100%; padding: 9px 14px; border: 0; border-bottom: 1px solid var(--soft); background: transparent; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.aclist button:hover, .aclist button:focus-visible { background: color-mix(in srgb, var(--amber) 30%, var(--surface)); outline: none; }
.aclist small { color: var(--ink2); font-size: .76rem; }
.ac-new { padding: 9px 14px; font-size: .8rem; color: var(--ink2); background: var(--surface2); }

.f > .tp { display: flex; width: fit-content; }
.tp select { width: auto; }
.tp-x { display: inline-grid; place-items: center; padding: 0 0 2px; }
.fxbox { margin-top: 4px; } .fxbox .label small { text-transform: none; }
.fxin { width: 100%; margin-top: 10px; padding: 11px 16px; border: 2px dashed var(--soft); border-radius: 999px; background: transparent; font: inherit; font-size: .9rem; }
.fxin:focus { outline: none; border-style: solid; border-color: #1B1A17; background: var(--surface); box-shadow: var(--shadow-sm); }
.fxc.on { color: #1B1A17; }

/* botones de medicación: simples y bien visibles */
.mbtn { display: inline-flex; align-items: center; justify-content: center; padding: 9px 20px; border: 2px solid #1B1A17; border-radius: 999px; background: #FFD60A; color: #1B1A17; font: inherit; font-weight: 800; font-size: .9rem; text-decoration: none; cursor: pointer; box-shadow: 2px 2px 0 #1B1A17; transition: transform .12s, box-shadow .12s; }
.mbtn:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 #1B1A17; }
.mbtn.ghost { background: var(--surface); }
.mbtn.sm { padding: 5px 14px; font-size: .8rem; margin-left: 6px; }
.medlist a.mbtn { text-decoration: none; }
.mc-a { gap: 10px; }
.medform .actions .btn { padding: 11px 26px; font-size: .95rem; }
.medform .actions .btn.pri { background: #FFD60A; color: #1B1A17; border: 2px solid #1B1A17; box-shadow: 2px 2px 0 #1B1A17; }

/* datos del perfil: tarjetas */
.pfields { display: grid; gap: 12px; }
.pf { display: grid; grid-template-columns: 1fr; gap: 8px; padding: 12px 14px; border: 2px solid #1B1A17; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-sm); }
.pf-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pf-t { font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink2); }
.pf-h input.k { flex: 1; font-weight: 800; }
.pf-x { flex: none; display: inline-grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 2px solid #1B1A17; border-radius: 50%; background: var(--surface2); color: #1B1A17; cursor: pointer; }
.pf-x:hover { background: #FF8A1F; }

/* medicación: paso propio y destacado */
.medstep { padding: 18px 18px 20px; margin-left: -4px; margin-right: -4px; border: 2px solid #1B1A17; border-radius: 20px; background: color-mix(in srgb, #7EE03A 20%, var(--surface)); box-shadow: var(--shadow-sm); }
.medstep .step-h em { background: #1B1A17; color: #fff; padding: 2px 10px; border-radius: 999px; font-style: normal; font-weight: 800; font-size: .72rem; }
.medq { margin: 0 0 8px; font-weight: 800; font-size: 1.02rem; }
.medempty p { margin: 0 0 12px; font-size: .92rem; }
.medbox .seg4 button { font-size: 1rem; padding: 10px 20px; }
.medempty .mc-a { margin-top: 0; } .medempty.slim p { margin-bottom: 10px; }
.medstep:has(.medempty.slim) { background: var(--surface); box-shadow: none; border-style: dashed; }

/* selectores del modo de registro */
.modebar:not(.compact) { gap: 18px; padding: 18px; }
.modebar .mb-row { display: grid; gap: 10px; } .modebar .mb-row .label { min-width: 0; margin: 0; }
#modeSeg { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
#modeSeg button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 14px; border: 2px solid #1B1A17; border-radius: 16px; background: var(--surface); color: var(--ink); font-size: .95rem; font-weight: 800; text-align: left; box-shadow: 2px 2px 0 #1B1A17; transition: transform .12s, box-shadow .12s; }
#modeSeg button small { font-size: .76rem; opacity: .75; margin: 0; }
#modeSeg button:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 #1B1A17; }
#modeSeg button.on { background: #FFD60A; color: #1B1A17; box-shadow: 3px 3px 0 #1B1A17; }
#modeSeg button.on small { opacity: .85; }
#cadSeg button { padding: 9px 18px; border: 2px solid #1B1A17; background: var(--surface); color: var(--ink); font-weight: 800; }
#cadSeg button.on { background: #7EE03A; color: #1B1A17; box-shadow: 2px 2px 0 #1B1A17; }
.mb-custom { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px; border: 2px dashed var(--soft); background: transparent; }
.mb-custom .chk { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px 8px 12px; border: 2px solid #1B1A17; border-radius: 999px; background: var(--surface); font-size: .86rem; font-weight: 700; cursor: pointer; user-select: none; }
.mb-custom .chk input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.mb-custom .chk::before { content: ""; flex: none; width: 18px; height: 18px; border: 2px solid #1B1A17; border-radius: 50%; background: var(--surface2); }
.mb-custom .chk:has(input:checked) { background: #FFD60A; color: #1B1A17; box-shadow: 2px 2px 0 #1B1A17; }
.mb-custom .chk:has(input:checked)::before { background: #1B1A17 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFD60A' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center/12px no-repeat; }
.mb-custom .chk:has(input:focus-visible) { outline: 3px solid #2D8CFF; outline-offset: 2px; }
.mb-custom p { flex-basis: 100%; }
@media (max-width: 380px) { #modeSeg { grid-template-columns: 1fr; } }

/* alcohol, sustancias, hábitos y medicación por medicamento */
.urow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; } .urow .bl { font-weight: 700; font-size: .92rem; }
.usub { margin-top: 12px; padding: 14px; border: 2px dashed var(--soft); border-radius: 16px; }
.subrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 10px; font-weight: 700; font-size: .9rem; }
.stepper.sm button { width: 32px; height: 32px; font-size: 1.1rem; } .stepper.sm output { min-width: 96px; font-size: .92rem; }
.hab-tools { margin-top: 10px; } .habman { margin-top: 12px; padding: 14px; border: 2px dashed var(--soft); border-radius: 16px; }
.hform { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; } .hform input[type=text] { flex: 1 1 160px; width: auto; } .hform select { width: auto; }
.hb.on { color: #1B1A17; }
.medrows { display: grid; gap: 10px; margin: 6px 0 4px; } .medrow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; padding: 10px 14px; border: 2px solid #1B1A17; border-radius: 16px; background: var(--surface); }
.medrow .seg4 button { padding: 8px 20px; font-size: .95rem; }

/* Mi resumen */
.rs-hero { display: flex; align-items: center; gap: 18px; padding: 20px 22px; border: 2px solid #1B1A17; border-radius: 22px; background: color-mix(in srgb, #FFD60A 30%, var(--surface)); box-shadow: var(--shadow-sm); }
.rs-face { flex: none; width: 84px; height: 84px; } .rs-face svg { width: 100%; height: 100%; }
.rs-k { display: block; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink2); }
.rs-hero strong { display: block; font-size: 1.9rem; line-height: 1.1; margin: 2px 0 4px; } .rs-hero p { margin: 0; font-size: .92rem; }
.rs-day { display: flex; gap: 12px; align-items: flex-start; margin-top: 12px; } .rs-day small { display: block; }
.rs-dot { flex: none; width: 22px; height: 22px; margin-top: 2px; border: 2px solid #1B1A17; border-radius: 50%; }
.goodlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: .92rem; }
@media (max-width: 480px) { .rs-hero { flex-direction: column; text-align: center; } }

/* registros del día con su hora */
.reglist { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 6px; }
.regchip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 6px 3px 6px; border: 2px solid #1B1A17; border-radius: 999px; background: var(--surface); font-size: .82rem; }
.regchip .rg-f { width: 26px; height: 26px; display: block; } .regchip .rg-f svg { width: 100%; height: 100%; }
.rg-x { display: inline-grid; place-items: center; width: 20px; height: 20px; padding: 0 0 2px; border: 0; border-radius: 50%; background: var(--surface2); color: var(--ink2); cursor: pointer; font-size: .95rem; line-height: 1; }
.rg-x:hover { background: #FF8A1F; color: #1B1A17; }
.atx { display: inline-flex; align-items: center; gap: 8px; font-size: .82rem; font-weight: 700; color: var(--ink2); } .atx .tp { margin-top: 0; padding: 2px 6px 2px 8px; border-radius: 12px; box-shadow: none; } .atx .tp select { font-size: 1rem; padding: 2px 4px; } .atx .tp b { font-size: 1rem; }
.medrow .medt { flex-basis: 100%; }
.subrow .atx { flex-basis: 100%; justify-content: flex-end; }

/* selector de hora */
.tp2 { display: inline-block; position: relative; margin-top: 6px; max-width: 100%; }
.atx .tp2 { margin-top: 0; }
.tp2-show { display: inline-flex; align-items: center; gap: 10px; padding: 7px 16px; border: 2px solid #1B1A17; border-radius: 999px; background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; box-shadow: 2px 2px 0 #1B1A17; }
.tp2-show:hover { background: color-mix(in srgb, #FFD60A 30%, var(--surface)); }
.tp2-t { font-weight: 800; font-size: 1.1rem; font-variant-numeric: tabular-nums; } .tp2-p { font-size: .76rem; font-weight: 700; color: var(--ink2); }
.tp2-pop { margin-top: 10px; padding: 14px; border: 2px solid #1B1A17; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-sm); min-width: min(100%, 300px); max-width: 420px; position: relative; z-index: 5; }
.tp2-parts, .tp2-hours { display: flex; flex-wrap: wrap; gap: 6px; }
.tp2-parts button, .tp2-hours button { padding: 7px 12px; border: 2px solid #1B1A17; border-radius: 999px; background: var(--surface2); color: var(--ink); font: inherit; font-weight: 700; font-size: .82rem; cursor: pointer; }
.tp2-hours { margin-top: 10px; } .tp2-hours button { font-variant-numeric: tabular-nums; padding: 5px 10px; font-size: .8rem; }
.tp2-parts button.on, .tp2-hours button.on { background: #FFD60A; color: #1B1A17; box-shadow: 2px 2px 0 #1B1A17; }
.tp2-slide { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: .75rem; font-weight: 700; color: var(--ink2); font-variant-numeric: tabular-nums; }
.tp2-slide input[type=range] { flex: 1; width: auto; accent-color: #1B1A17; height: 8px; padding: 0; border: 0; box-shadow: none; background: transparent; }
.tp2-act { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 12px; }
.tp2-ok { margin-left: auto; padding: 7px 20px; border: 2px solid #1B1A17; border-radius: 999px; background: #1B1A17; color: #fff; font: inherit; font-weight: 800; cursor: pointer; }
.tp2-clr { border: 0; background: transparent; color: var(--ink2); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }

/* para qué usa Dianfy */
.goalcard { margin-bottom: 22px; padding: 20px 22px; border: 2px solid #1B1A17; border-radius: 22px; background: color-mix(in srgb, #7EE03A 22%, var(--surface)); box-shadow: var(--shadow-sm); }
.goalcard h2 { margin: 0 0 4px; font-size: 1.3rem; }
.goalgrid, .usegrid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin: 14px 0 8px; }
.goalopt { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 14px 16px; border: 2px solid #1B1A17; border-radius: 16px; background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer; box-shadow: 2px 2px 0 #1B1A17; transition: transform .12s, box-shadow .12s; }
.goalopt b { font-size: .98rem; } .goalopt span { font-size: .8rem; color: var(--ink2); line-height: 1.35; }
.goalopt:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 #1B1A17; } .goalopt.on { background: #FFD60A; color: #1B1A17; } .goalopt.on span { color: #1B1A17; opacity: .85; }

/* aviso con acción, buscar, instalar */
.toast.act { pointer-events: auto; display: flex; align-items: center; gap: 14px; }
.toast-act { border: 2px solid #FFD60A; border-radius: 999px; background: #FFD60A; color: #1B1A17; padding: 4px 14px; font: inherit; font-weight: 800; font-size: .85rem; cursor: pointer; }
.sres { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.sres button { display: flex; gap: 14px; align-items: flex-start; width: 100%; padding: 12px 14px; border: 2px solid #1B1A17; border-radius: 16px; background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer; box-shadow: 2px 2px 0 #1B1A17; }
.sres button:hover { background: color-mix(in srgb, #FFD60A 25%, var(--surface)); }
.sr-f { flex: none; width: 40px; height: 40px; display: block; } .sr-f svg { width: 100%; height: 100%; }
.sres em { display: block; font-style: normal; font-size: .86rem; margin-top: 3px; } .sres em i { font-style: normal; font-weight: 800; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink2); margin-right: 6px; }
.installcard { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; padding: 14px 18px; border: 2px solid #1B1A17; border-radius: 18px; background: color-mix(in srgb, #2D8CFF 22%, var(--surface)); box-shadow: var(--shadow-sm); }
.installcard b { display: block; } .installcard span { font-size: .86rem; color: var(--ink2); }

/* ayuda en el momento */
.hint { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-left: 6px; padding: 0 0 1px; border: 2px solid #1B1A17; border-radius: 50%; background: #FFD60A; color: #1B1A17; font: inherit; font-weight: 800; font-size: .75rem; line-height: 1; cursor: pointer; vertical-align: 2px; }
.hint:hover, .hint[aria-expanded=true] { background: #1B1A17; color: #fff; }
.hintpop { position: absolute; z-index: 400; padding: 12px 14px; border: 2px solid #1B1A17; border-radius: 14px; background: var(--surface); color: var(--ink); font-size: .86rem; line-height: 1.45; font-weight: 600; box-shadow: var(--shadow-sm); }

/* permisos por categoría */
.scopelist { display: grid; gap: 8px; margin: 6px 0; }
.scopeitem { align-items: flex-start; padding: 8px 12px; border: 2px solid #1B1A17; border-radius: 14px; background: var(--surface); } .scopeitem span { display: grid; gap: 1px; } .scopeitem small { font-size: .78rem; line-height: 1.35; }
.scopebox { padding: 10px 0 14px; }
.askbox { margin: 8px 0 12px; padding: 12px 14px; border: 2px solid #1B1A17; border-radius: 14px; background: color-mix(in srgb, #FFD60A 28%, var(--surface)); font-size: .9rem; }

/* registro más corto: lo esencial arriba, lo demás en un desplegable */
.moresteps { margin-top: 18px; border: 2px dashed var(--soft); border-radius: 18px; padding: 4px 16px 8px; }
.moresteps > summary { cursor: pointer; padding: 12px 0; list-style: none; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.moresteps > summary::-webkit-details-marker { display: none; }
.moresteps > summary::before { content: "＋"; font-weight: 800; margin-right: 2px; } .moresteps[open] > summary::before { content: "−"; }
.moresteps > summary span { font-size: .84rem; color: var(--ink2); }
.moresteps[open] > summary { border-bottom: 1px solid var(--soft); margin-bottom: 8px; }

/* panel profesional: dashboard */
.kpis6 { grid-template-columns: repeat(2, 1fr); } @media (min-width: 760px) { .kpis6 { grid-template-columns: repeat(3, 1fr); } } @media (min-width: 1100px) { .kpis6 { grid-template-columns: repeat(6, 1fr); } }
.kpi strong em { font-style: normal; font-size: .95rem; opacity: .55; margin-left: 2px; } .kpi.hot { background: color-mix(in srgb, #FF8A1F 22%, var(--surface)); }
.kpi small .hint { margin-left: 4px; width: 18px; height: 18px; font-size: .65rem; }
.cohortcard { margin-bottom: 18px; } .cohortcard .chart-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 14px; align-items: baseline; margin-bottom: 8px; }
.cohort { width: 100%; height: auto; display: block; color: var(--ink); }
.moodtoday { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 10px; font-size: .9rem; }
.mt-chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 12px 2px 4px; border: 2px solid #1B1A17; border-radius: 999px; background: var(--surface); font-weight: 800; } .mt-chip i { width: 28px; height: 28px; display: block; } .mt-chip i svg { width: 100%; height: 100%; }
.ptools { margin: 0 0 16px; display: grid; gap: 12px; } .pfilters { display: flex; flex-wrap: wrap; gap: 8px; } .pfilters .ec b { margin-left: 4px; padding: 0 7px; border-radius: 999px; background: #1B1A17; color: #fff; font-size: .72rem; }
.prow2 { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; } .prow2 input[type=search] { flex: 1 1 260px; width: auto; } .prow2 select { width: auto; margin-left: 6px; }
.chg { font-weight: 800; white-space: nowrap; } .chg.up { color: #0a8a78; } .chg.down { color: #c24a1a; } .chg.flat { opacity: .65; }

/* ficha del profesional: permisos, datos y criterios en un solo desplegable */
.fichabox { margin-bottom: 22px; padding-top: 6px; } .fichabox > summary { cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 0; } .fichabox > summary::-webkit-details-marker { display: none; }
.fichabox > summary::before { content: "＋"; font-weight: 800; } .fichabox[open] > summary::before { content: "−"; } .fb-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fichagrid { display: grid; gap: 18px; padding: 8px 0 12px; border-top: 1px solid var(--soft); } @media (min-width: 900px) { .fichagrid { grid-template-columns: 1fr 1fr; } .fichagrid #thrCard { grid-column: 1 / -1; } }
.fb-block { padding: 14px 16px; border: 2px solid var(--soft); border-radius: 16px; }
.prosides { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); margin-top: 8px; align-items: start; }
#plist .ptable { min-width: 760px; } #plist .scrollx { overflow-x: auto; }

/* Casilla de consentimiento al vincular */
.consent { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0 4px; padding: 12px 14px; border: 2px solid var(--ink, #1B1A17); border-radius: 14px; background: var(--surface2, #F4EEE2); font-size: .86rem; line-height: 1.5; cursor: pointer; }
.consent input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: #00A896; }

/* Selector de hora: flota sobre la página, no empuja lo de abajo */
.tp2-pop { position: absolute; top: 100%; left: 0; margin-top: 6px; z-index: 40; width: min(320px, calc(100vw - 40px)); max-width: none; }
.atx .tp2-pop, .subrow .tp2-pop { left: auto; right: 0; }
@media (max-width: 520px) { .tp2-pop, .atx .tp2-pop, .subrow .tp2-pop { position: fixed; left: 8px; right: 8px; top: auto; bottom: 80px; width: auto; z-index: 90; box-shadow: 0 -4px 0 rgba(27,26,23,.15), var(--shadow-sm); } }

/* Perfil profesional: profesión e institución con la misma altura */
.two:has(#ptitle) { align-items: end; }
#ptitle, #porg { height: 48px; box-sizing: border-box; }

/* Caritas de ánimo en tablas y filas del panel profesional: tamaño fijo */
.pcell > svg, td > svg[viewBox="0 0 64 64"], .rtable svg[viewBox="0 0 64 64"], .ptable svg[viewBox="0 0 64 64"] { width: 32px; height: 32px; flex: none; display: inline-block; vertical-align: middle; }

/* «Sobre mí»: ventana única para armar el perfil. Lo destacado es Guardar; no responder es un enlace discreto. */
.aboutmask { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 16px; background: rgba(27, 26, 23, .55); overflow-y: auto; }
.aboutbox { position: relative; width: min(460px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; padding: 26px 22px 20px; background: var(--surface, #FFFDF8); color: var(--ink, #1B1A17); border: 2px solid var(--ink, #1B1A17); border-radius: 20px; box-shadow: 6px 6px 0 var(--ink, #1B1A17); }
.aboutbox h2 { margin: 0 0 6px; font-size: 1.4rem; padding-right: 28px; }
.aboutx { position: absolute; top: 8px; right: 12px; border: 0; background: none; font-size: 1.7rem; line-height: 1; cursor: pointer; color: var(--muted, #5E594E); }
.abconsent { margin: 2px 0 0; font-size: .74rem; line-height: 1.45; }
.abskip { display: block; margin: 12px auto 0; border: 0; background: none; font: inherit; font-size: .78rem; color: var(--muted, #5E594E); text-decoration: underline; cursor: pointer; }
.abskip:hover { color: var(--ink, #1B1A17); }

.goalskip { display: block; margin: 14px auto 0; padding: 9px 24px; border: 2px solid #1B1A17; border-radius: 999px; background: var(--surface); color: var(--ink); font: inherit; font-size: .9rem; font-weight: 700; cursor: pointer; box-shadow: 2px 2px 0 #1B1A17; transition: transform .12s, box-shadow .12s; }
.goalskip:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 #1B1A17; }

/* «Sobre mí»: vista de lectura y selector (interruptor) de la autorización */
.aboutlist { display: grid; gap: 8px; margin: 0 0 12px; } .aboutlist div { display: flex; gap: 10px; align-items: baseline; } .aboutlist dt { min-width: 110px; font-size: .8rem; color: var(--ink2); font-weight: 700; } .aboutlist dd { margin: 0; font-weight: 700; }
.switch { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 2px solid var(--ink, #1B1A17); border-radius: 14px; background: var(--surface2, #F4EEE2); font-size: .84rem; line-height: 1.45; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.switch i { flex: none; position: relative; width: 44px; height: 26px; margin-top: 1px; border: 2px solid var(--ink, #1B1A17); border-radius: 999px; background: var(--surface, #fff); transition: background .15s; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--ink, #1B1A17); transition: transform .15s; }
.switch:has(input:checked) i { background: #00D9C0; } .switch:has(input:checked) i::after { transform: translateX(18px); }
.switch:has(input:focus-visible) { outline: 3px solid #2D8CFF; outline-offset: 2px; }

.steps-f { margin-top: 12px; text-align: right; }

/* Alcohol y sustancias: cada una en su bloque con divisor; «¿Cuándo?» con momentos del día */
.subblock { margin-top: 14px; padding-top: 14px; border-top: 2px solid var(--line, rgba(27,26,23,.18)); }
.subhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; font-size: .95rem; }
.momrow { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.momrow button { padding: 8px 14px; border: 2px solid var(--ink, #1B1A17); border-radius: 999px; background: var(--surface, #fff); color: var(--ink, #1B1A17); font: inherit; font-size: .84rem; font-weight: 700; cursor: pointer; }
.momrow button.on { background: #FFD60A; color: #1B1A17; box-shadow: 2px 2px 0 #1B1A17; }
.momrow button.all { border-style: dashed; } .momrow button.all.on { border-style: solid; background: #00D9C0; }

/* Permisos del profesional: resumen y edición */
.scopesum { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.scopesum li { padding: 5px 12px; border: 2px solid var(--line); border-radius: 999px; font-size: .8rem; font-weight: 800; background: var(--surface); }
.scopesum li.yes { background: rgba(0,217,192,.18); }
.scopesum li.no { opacity: .55; text-decoration: line-through; }
.scopeedit { padding: 12px; margin-top: 8px; border: 2px dashed var(--line); border-radius: 14px; }

/* Políticas semi visibles al agregar un profesional */
.polbox { position: relative; margin: 12px 0; border: 2px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; }
.polbody { max-height: 4.6em; overflow: hidden; padding: 12px 14px 0; font-size: .84rem; line-height: 1.55; color: var(--ink2); transition: max-height .35s ease; }
.polbody p { margin: 0 0 8px; }
.polbox:not(.open)::after { content: ""; position: absolute; left: 0; right: 0; bottom: 38px; height: 2.6em; background: linear-gradient(to bottom, transparent, var(--surface)); pointer-events: none; }
.polbox.open .polbody { max-height: 260px; overflow-y: auto; }
.polmore { display: block; width: 100%; padding: 9px 14px; border: 0; border-top: 2px solid var(--line); background: var(--surface2); color: var(--ink); font: inherit; font-weight: 800; font-size: .82rem; cursor: pointer; }
.polmore:hover { background: var(--accent); color: var(--on-accent); }
[data-sc-view][hidden], [data-sc-edit][hidden] { display: none !important; }

/* Cuestionarios: habilitar y frecuencia */
.scfg { margin: 12px 0 0; padding: 12px 14px; border: 2px dashed var(--line); border-radius: 14px; display: grid; gap: 10px; }
.scfreq { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.scfreq .pill-b, .scother { padding: 6px 12px; border: 2px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font: inherit; font-weight: 800; font-size: .8rem; cursor: pointer; }
.scfreq .pill-b.on, .scother.on { background: var(--accent); color: var(--on-accent); border-color: #1B1A17; }
.scother { display: inline-flex; align-items: center; gap: 6px; cursor: default; }
.scother input { width: 56px; padding: 2px 6px; border-radius: 8px; font-size: .8rem; }
.screm { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.screm li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px; border: 2px solid var(--line); border-radius: 12px; font-weight: 700; font-size: .85rem; }
.screm li small { color: var(--ink2); font-weight: 600; text-align: right; }
.screm li.due { border-color: #1B1A17; background: rgba(255,214,10,.28); }
.screm li.off { opacity: .55; }

/* Selector de cuestionarios, más claro y con aire */
.scfg { margin: 16px 0 0; padding: 14px 16px; border: 2px solid var(--line); border-radius: 16px; background: var(--surface2); gap: 12px; }
.scfg .chk { align-items: center; gap: 12px; }
.scfg .chk b { display: block; font-size: .92rem; }
.scfg .chk small { display: block; margin-top: 2px; font-weight: 600; line-height: 1.4; }
.scfg .chk input[type=checkbox] { appearance: none; -webkit-appearance: none; width: 46px; height: 26px; margin: 0; flex: none; position: relative; border: 2px solid #1B1A17; border-radius: 999px; background: var(--surface); cursor: pointer; transition: background .2s; }
.scfg .chk input[type=checkbox]::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #1B1A17; transition: transform .2s; }
.scfg .chk input[type=checkbox]:checked { background: var(--accent); }
.scfg .chk input[type=checkbox]:checked::after { transform: translateX(20px); }
.scfg .chk input[type=checkbox]:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.scfreq { gap: 8px; padding-top: 12px; border-top: 2px dashed var(--line); }
.scfreq > .small { flex-basis: 100%; font-weight: 800; }
.scfreq .pill-b, .scother { padding: 8px 14px; font-size: .82rem; }
.scfreq .pill-b { transition: transform .15s, box-shadow .15s, background .2s; }
.scfreq .pill-b:hover { transform: translateY(-1px); }
.scfreq .pill-b.on, .scother.on { box-shadow: 2px 2px 0 #1B1A17; }
/* El botón de responder queda bien separado del selector */
.scfg + .actions { margin-top: 26px; }

/* Frecuencia: recomendada preseleccionada y selector de días más cuidado */
.scfreq.off { opacity: .55; }
.scfreq.off button, .scfreq.off input { cursor: not-allowed; }
.scfreq .pill-b { display: inline-flex; flex-direction: column; align-items: center; gap: 1px; line-height: 1.15; }
.scfreq .pill-b em { font-style: normal; font-size: .62rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; opacity: .7; }
.scfreq .pill-b.on em { opacity: 1; }
.scother { padding: 4px 6px 4px 14px; gap: 8px; font-weight: 800; }
.scother input { width: 3.2ch; min-width: 0; padding: 4px 0; border: 0; border-bottom: 2px solid #1B1A17; border-radius: 0; background: transparent; text-align: center; font-weight: 800; font-size: .95rem; box-shadow: none; -moz-appearance: textfield; appearance: textfield; }
.scother input::-webkit-outer-spin-button, .scother input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.scother input:focus { box-shadow: none; border-bottom-color: var(--accent); }
.scother .stp { width: 28px; height: 28px; padding: 0; border: 2px solid #1B1A17; border-radius: 50%; background: var(--surface); color: var(--ink); font: inherit; font-weight: 800; font-size: 1.05rem; line-height: 1; cursor: pointer; display: grid; place-items: center; transition: background .15s, transform .15s; }
.scother .stp:hover:not(:disabled) { background: var(--accent); color: var(--on-accent); transform: scale(1.08); }
.scother.on .stp { background: var(--surface); color: #1B1A17; }

/* Selector bajo la cabecera del panel profesional */
.psub { display: flex; gap: 6px; width: max-content; max-width: 100%; margin: 0 0 24px; padding: 6px; overflow-x: auto; scrollbar-width: none; border: 2px solid var(--line); border-radius: 999px; background: var(--surface); }
.psub a { display: inline-flex; align-items: center; gap: 6px; padding: 9px 22px; border: 2px solid transparent; border-radius: 999px; font-weight: 800; font-size: .92rem; color: var(--ink); white-space: nowrap; text-decoration: none; transition: background .2s, transform .15s; }
.psub a:hover { background: var(--surface2); }
.psub a.on { background: var(--accent); color: var(--on-accent); border-color: #1B1A17; box-shadow: 2px 2px 0 #1B1A17; }
.psub a b { padding: 1px 8px; border-radius: 999px; background: #1B1A17; color: #fff; font-size: .72rem; }

/* Botones pequeños (notas, tareas) */
.mini { display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px; border: 2px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font: inherit; font-weight: 800; font-size: .76rem; cursor: pointer; white-space: nowrap; transition: background .15s, color .15s, transform .15s; }
.mini:hover { background: var(--surface2); transform: translateY(-1px); }
.mini svg { width: 14px; height: 14px; flex: none; }
.mini.danger { color: #C62828; border-color: #C62828; background: transparent; }
.mini.danger:hover { background: #E5383B; border-color: #E5383B; color: #fff; }

/* Acciones de la ficha: cada botón con su explicación */
.sesrow { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 14px 22px; margin: 0 0 22px; padding: 14px 16px; border: 2px dashed var(--line); border-radius: 16px; }
.sesact { display: grid; gap: 7px; max-width: 270px; justify-items: start; }
.sesact small { color: var(--ink2); font-size: .76rem; line-height: 1.4; }
.sesact.end { margin-left: auto; }
.btn.dangerfill { background: #E5383B; color: #fff; border-color: #1B1A17; }
.btn.dangerfill:hover { background: #F0484B; }

/* Volver a usuarios */
.backbtn { display: inline-flex; align-items: center; gap: 8px; padding: 8px 18px 8px 12px; border: 2px solid #1B1A17; border-radius: 999px; background: var(--surface); color: var(--ink); font-weight: 800; font-size: .86rem; text-decoration: none; box-shadow: 2px 2px 0 #1B1A17; transition: transform .15s, box-shadow .15s, background .2s; }
.backbtn svg { width: 16px; height: 16px; }
.backbtn:hover { background: var(--accent); color: var(--on-accent); transform: translate(-1px, -1px); box-shadow: 3px 3px 0 #1B1A17; }

/* Plantillas de notas */
.tplbox { margin-bottom: 12px; }
.tplchips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.tplchip { padding: 7px 14px; border: 2px solid #1B1A17; border-radius: 999px; background: var(--surface); color: var(--ink); font: inherit; font-weight: 800; font-size: .78rem; cursor: pointer; box-shadow: 2px 2px 0 #1B1A17; transition: transform .15s, box-shadow .15s, background .2s; }
.tplchip:hover { background: #FFD60A; color: #1B1A17; transform: translate(-1px, -1px); box-shadow: 3px 3px 0 #1B1A17; }
.tplchip:active { transform: translate(2px, 2px); box-shadow: 0 0 0 #1B1A17; }

/* Confirmaciones */
.cmodal { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 20px; background: rgba(18,19,22,.62); backdrop-filter: blur(3px); }
.cbox { width: 100%; max-width: 420px; padding: 26px 24px 20px; background: var(--surface); border: 3px solid #1B1A17; border-radius: 22px; box-shadow: 6px 6px 0 #1B1A17; text-align: center; }
.cico { width: 46px; height: 46px; margin: 0 auto 12px; border-radius: 50%; background: #E5383B; color: #fff; border: 2px solid #1B1A17; font-weight: 800; font-size: 1.5rem; display: grid; place-items: center; }
.cbox h3 { margin: 0 0 8px; }
.cbox p { margin: 0 0 18px; color: var(--ink2); font-size: .92rem; line-height: 1.5; }
.cbox .actions { justify-content: center; }
.cbox .cstep { margin: 14px 0 0; font-size: .74rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.busy { opacity: .55; pointer-events: none; transition: opacity .15s; }

#pbody { scroll-margin-top: 96px; }

/* Nota al marcar una alerta como revisada, dentro de la misma alerta */
.alert { flex-wrap: wrap; }
.alert .ackform { flex: 1 1 100%; display: grid; gap: 10px; margin-top: 4px; padding: 14px; border: 2px dashed var(--line); border-radius: 14px; background: var(--surface2); }
.alert .ackform textarea { min-height: 70px; }
.cico.ok { background: var(--accent); color: var(--on-accent); }
.btn.marked, .btn.marked:disabled { background: rgba(0,217,192,.22); border-color: #1B1A17; color: var(--ink); opacity: 1; cursor: default; box-shadow: none; transform: none; }

/* Guía de ansiedad, pánico, angustia: una tarjeta por tipo, con encabezado de color y cada dato en su bloque */
.cmp3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.cmp-card { overflow: hidden; border: 2px solid #1B1A17; border-radius: 16px; background: var(--surface); box-shadow: 3px 3px 0 #1B1A17; }
.cmp-card h4 { margin: 0; padding: 10px 14px; background: var(--c); color: #1B1A17; font-size: 1rem; border-bottom: 2px solid #1B1A17; }
.cmp-item { padding: 10px 14px; }
.cmp-item + .cmp-item { border-top: 1px dashed var(--line); }
.cmp-item span { display: block; font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--ink2); }
.cmp-item p { margin: 3px 0 0; font-size: .88rem; line-height: 1.45; text-align: left; }
.jus, .delnote { text-align: justify; text-justify: inter-word; hyphens: auto; -webkit-hyphens: auto; }
.delnote { margin: -6px 0 12px; }
.locked { display: inline-grid; place-items: center; width: 28px; height: 28px; color: var(--ink2); opacity: .7; cursor: help; }

/* Textos largos de derechos y datos, justificados */
#rightsCard p:not(.label):not(.msg), #rightsCard li { text-align: justify; text-justify: inter-word; hyphens: auto; -webkit-hyphens: auto; }

/* Fila compacta bajo el nombre (celular), alertas con dos interruptores por tipo, y hoja «Preparar sesión» */
.pmini { display: none; align-items: center; flex-wrap: wrap; gap: 4px 10px; margin-top: 6px; font-size: .8rem; }
@media (max-width: 760px) { .pmini { display: flex; } .ptable .pcell > div { min-width: 0; } .pmini .spark { width: 60px; } }
.alrow { display: flex; justify-content: space-between; align-items: center; gap: 12px 18px; padding: 10px 0; border-top: 1px solid var(--soft); }
.alrow:first-of-type { border-top: 0; } .alt b { display: block; font-size: .92rem; } .alt small { display: block; font-size: .78rem; }
.alsws { display: flex; gap: 8px; flex-wrap: wrap; } .alsws .swrow { width: auto; padding: 8px 12px; align-items: center; } .alsws .swrow b { font-size: .84rem; }
@media (max-width: 640px) { .alrow { flex-direction: column; align-items: stretch; } .alsws { width: 100%; } .alsws .swrow { flex: 1 1 140px; min-width: 0; } }
.ses-g { font-size: .8rem; margin-right: 6px; } .ses-h { margin: 14px 0 6px; }
/* Fase de pruebas abierta (panel profesional) */
.betabar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; max-width: 1180px; margin: 12px auto 0; padding: 0 20px; }
.betachip { display: inline-block; padding: 6px 12px; border: 2px solid #1B1A17; border-radius: 999px; background: var(--note, color-mix(in srgb, var(--blue) 14%, var(--surface))); color: var(--ink); font-size: .82rem; font-weight: 800; }
.betafb { padding: 7px 14px; border: 2px solid #1B1A17; border-radius: 999px; background: var(--surface); color: var(--ink); font: inherit; font-size: .85rem; font-weight: 800; cursor: pointer; box-shadow: 2px 2px 0 #1B1A17; }
.betanote { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: flex-end; max-width: 1140px; margin: 12px auto 0; padding: 16px 20px; border: 2px solid #1B1A17; border-radius: 18px; background: var(--note, color-mix(in srgb, var(--blue) 14%, var(--surface))); color: var(--ink); }
.betanote > div { flex: 1 1 420px; } .betanote p { margin: 6px 0 0; font-size: .94rem; }
.betaclose { padding: 8px 14px; border: 2px solid #1B1A17; border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; font-weight: 800; cursor: pointer; }
@media (max-width: 700px) { .betabar, .betanote { margin-left: 16px; margin-right: 16px; padding-left: 0; padding-right: 0; } .betanote { padding: 14px 16px; } }
.fbdlg { position: fixed; inset: 0; z-index: 500; display: grid; place-items: center; padding: 16px; background: rgba(27,26,23,.45); }
.fbdlg[hidden] { display: none; }
.fbbox { width: min(560px, 100%); max-height: 90vh; overflow: auto; } .fbbox textarea, .fbbox select { width: 100%; }
.fbact { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
@media print {
  @page { size: A4; margin: 9mm; }
  .rsec[data-s="sesion"] { break-inside: auto; font-size: 9.5pt; }
  .rsec[data-s="sesion"] .ses-h { margin: 8px 0 3px; font-size: 10.5pt; } .rsec[data-s="sesion"] .risklist li { padding: 3px 8px; font-size: 8.5pt; }
  .rsec[data-s="sesion"] .rtable { font-size: 8pt; } .rsec[data-s="sesion"] .rtable th, .rsec[data-s="sesion"] .rtable td { padding: 2px 5px; }
  .rsec[data-s="sesion"] svg.chart { max-height: 190px; } .rsec[data-s="sesion"] .chart-legend { font-size: 7.5pt !important; gap: 1px !important; }
  .rsec[data-s="sesion"] .mini-note, .rsec[data-s="sesion"] .obs li { font-size: 8pt; margin: 2px 0; }
}

/* Panel profesional: sin desplazamiento horizontal; los textos largos se parten dentro de su caja */
.card, .kpi, .suibox, .alert { overflow-wrap: anywhere; }
.ptable { table-layout: auto; } .ptable td, .ptable th { overflow-wrap: anywhere; }
#plist .ptable { min-width: 0; } #plist .scrollx, .scrollx { overflow-x: visible; }
.ptable .pill, .idelist .pill, .suibox .pill { white-space: normal; text-align: center; line-height: 1.25; }
.idelist li { flex-wrap: wrap; gap: 4px 10px; }
.idelist li .pill { flex: 0 1 auto; max-width: 100%; }
@media (max-width: 900px) { #recs .ptable th, #recs .ptable td { padding: 8px 6px; font-size: .8rem; } }

/* Tu código profesional / Agregar usuario / Cómo funciona: tres filas, texto justificado */
.prosides { grid-template-columns: 1fr; }
.prosides .card p, .prosides .insights li { text-align: justify; hyphens: auto; }
.prosides .insights { padding-left: 18px; }

/* Avisos y umbrales: los dos selectores van uno sobre otro, a la derecha del texto */
.alrow { align-items: center; }
.alrow .alt { flex: 1 1 0; min-width: 0; }
.alsws { flex: none; flex-direction: column; flex-wrap: nowrap; width: 170px; gap: 8px; margin-left: auto; }
.alsws .swrow { width: 100%; }
@media (max-width: 640px) { .alrow { flex-direction: row; align-items: center; } .alsws { width: 150px; } .alsws .swrow { flex: none; padding: 8px 10px; } }
@media (max-width: 400px) { .alrow { flex-direction: column; align-items: stretch; } .alsws { width: 100%; margin-left: 0; } }

/* ===== Móvil: ajustes de estética de la app ===== */
.medform { scroll-margin-top: 84px; }
@media (max-width: 700px) {
  /* Tu registro de hoy: ícono + texto arriba, botón a todo el ancho abajo */
  .modebar.compact { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px 12px; padding: 14px; }
  .modebar.compact .mb-txt { flex: none; min-width: 0; }
  .modebar.compact .mb-chips { gap: 6px; }
  .modebar.compact .mb-chip { white-space: normal; }
  .modebar.compact .mb-btn { grid-column: 1 / -1; margin: 0; width: 100%; padding: 10px 18px; text-align: center; }

  /* Toma de medicamentos: la hora queda debajo de Sí / No, a todo el ancho */
  .medrow { display: grid; grid-template-columns: 1fr; justify-items: start; gap: 10px; padding: 12px 14px; }
  .medrow .seg4 { flex-wrap: nowrap; }
  .medrow .medt { display: grid; gap: 6px; width: 100%; justify-items: stretch; font-size: .8rem; }
  .medrow .medt .tp2 { display: block; width: 100%; }
  .medrow .medt .tp2-show { width: 100%; justify-content: space-between; }
  .medrow .medt .tp2-t { white-space: nowrap; font-size: 1.15rem; }

  /* Apariencia y accesibilidad: cabe en la pantalla */
  .lookmenu { left: 10px !important; right: 10px !important; width: auto !important; max-width: none; box-sizing: border-box; }

  /* Selectores segmentados (rango de días, vista del gráfico): una sola fila repartida */
  .seg:not(.wrapseg) { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; width: 100%; max-width: 100%; border-radius: 20px; padding: 4px; gap: 2px; box-sizing: border-box; }
  .seg:not(.wrapseg) button { padding: 9px 4px; font-size: .78rem; text-align: center; min-width: 0; }
  .chart-head .seg { width: 100%; }

  /* Pestañas de Mi progreso / Cuidado: más compactas */
  .subnav { gap: 6px; flex-wrap: wrap; overflow-x: visible; }
  .subnav a { padding: 8px 13px; font-size: .82rem; }

  /* Calendario y año en colores dentro de su caja */
  #view .card .scrollx { overflow-x: hidden; }
  #view .year { min-width: 0; gap: 2px; }
  .cal { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
  .cal-head { gap: 10px; } .cal-head h3 { font-size: 1.12rem; }

  /* Informe: período y formato como opciones ordenadas */
  #rseg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; padding: 0; border: 0; background: transparent; box-shadow: none; border-radius: 0; }
  #rseg button { padding: 12px 8px; border: 2px solid #1B1A17; border-radius: 14px; background: var(--surface2); color: var(--ink); font-size: .84rem; line-height: 1.2; white-space: normal; }
  #rseg button.on { background: #FFD60A; color: #1B1A17; box-shadow: 3px 3px 0 #1B1A17; }
  #rseg button:disabled { opacity: .45; border-style: dashed; }
  #rseg button[data-r="custom"], #rseg button[data-r="visit"] { grid-column: 1 / -1; }
  #rpre { display: grid; grid-template-columns: 1fr; gap: 8px; }
  #rpre button { width: 100%; padding: 12px 16px; border: 2px solid #1B1A17; border-radius: 14px; background: var(--surface2); color: var(--ink); text-align: left; font-size: .9rem; line-height: 1.25; }
  #rpre button.on { background: #FFD60A; color: #1B1A17; box-shadow: 3px 3px 0 #1B1A17; }

  /* Coincide con tus mejores días: título arriba y detalle abajo */
  .toolkit li { flex-direction: column; gap: 3px; padding: 11px 0; }
  .toolkit li b { font-size: .98rem; }
  .toolkit li .muted { font-size: .86rem; line-height: 1.45; }

  /* Historial de episodios: tarjetas ordenadas */
  .eplist li { border: 2px solid #1B1A17; border-radius: 16px; padding: 12px 14px; margin-top: 10px; background: var(--surface2); align-items: flex-start; }
  .eplist li:first-child { border-top: 2px solid #1B1A17; }
  .eplist li > div > b { display: block; font-size: 1rem; margin-bottom: 6px; }
  .eplist li .pill { display: inline-block; margin: 0 6px 6px 0; white-space: normal; }
  .eplist li small { margin-top: 3px; line-height: 1.4; }
}

/* ===== Panel profesional en móvil: la lista de usuarios en filas (tarjetas) ===== */
@media (max-width: 760px) {
  #plist .ptable, #plist .ptable tbody { display: block; width: 100%; }
  #plist .ptable thead { display: none; }
  #plist .ptable tr.row { display: grid; gap: 8px; padding: 12px 14px; margin-bottom: 10px; border: 2px solid #1B1A17; border-radius: 16px; background: var(--surface); cursor: pointer; }
  #plist .ptable tr.row:last-child { margin-bottom: 0; }
  #plist .ptable tr.row td { display: block; padding: 0; border: 0; min-width: 0; }
  #plist .ptable tr.row td .pcell { align-items: center; }
  #plist .ptable tr.row td:nth-child(2) { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-top: 8px; border-top: 1px dashed var(--soft); }
  #plist .ptable tr.row td:nth-child(2) .flags { display: contents; }
  #plist .ptable tr.row td:nth-child(2) .pill { white-space: normal; text-align: left; }
  #plist .ptable tr.row td.hide-s { display: none; }
  #plist .ptable tr.row td.hide-s:nth-child(6) { display: block; font-size: .82rem; color: var(--ink2); }
  #plist .ptable tr.row td.hide-s:nth-child(6)::before { content: "Último registro: "; font-weight: 700; }
  #plist .ptable tr.row td.hide-s:nth-child(6) b, #plist .ptable tr.row td.hide-s:nth-child(6) small { display: inline; }
  #plist .ptable tr.row td.hide-s:nth-child(6) small::before { content: " · "; }
  #plist .scrollx { overflow-x: visible; }
}
/* Barra inferior del panel profesional: deja espacio para que no tape el contenido */
body:has(.bottombar) .wrap { padding-bottom: 96px; }

/* Panel profesional (móvil): tablas de registros y episodios como filas con título */
@media (max-width: 760px) {
  .ptable.stk, .ptable.stk tbody { display: block; width: 100%; }
  .ptable.stk thead { display: none; }
  .ptable.stk tr { display: grid; gap: 6px; padding: 12px 14px; margin-bottom: 10px; border: 2px solid #1B1A17; border-radius: 16px; background: var(--surface); }
  .ptable.stk td { display: block; padding: 0; border: 0; max-width: none !important; }
  .ptable.stk td.hide-s { display: none; }
  .ptable.stk td.stk-h { font-weight: 800; font-size: .95rem; padding-bottom: 6px; border-bottom: 1px dashed var(--soft); }
  .ptable.stk td[data-l]::before { content: attr(data-l); display: block; margin-bottom: 2px; font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink2); }
  .ptable.stk .scrollx, .scrollx:has(.ptable.stk) { overflow-x: visible; }
}
@media (max-width: 760px) { .ptable.stk td[data-l]:empty { display: none; } }
