/* PlanVisto · clinic portal. Layout and components from
   docs/portal-prototipo.html; type and colour from the landing (Poppins,
   #009474). Mobile first; one light look, like the landing.
   White text on #009474 is 3.8:1, below WCAG AA for normal text, so buttons
   and green text use the landing's darker green (#007a60, 5.3:1); #009474
   stays for accents (focus ring, borders, soft fills). */
:root{
  --brand:#009474; --brand-ink:#007a60; --brand-ink-2:#00664f; --brand-soft:#e4f2ee;
  --ink:#100f0d; --ink-2:#4b5654; --ink-3:#5f6b68;
  --line:#dce2e0; --line-2:#eef1f0;
  --canvas:#f6f7f6; --surface:#ffffff;
  --red:#b42318; --red-soft:#fdecea;
  --amber:#8a5300; --amber-soft:#fdf3e3;
  --shadow:0 1px 2px rgba(16,15,13,.05),0 8px 24px rgba(16,15,13,.06);
  --font:"Poppins","Segoe UI",system-ui,-apple-system,sans-serif;
  color-scheme:light;
}
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
/* Bold is Poppins 600 here. Until 2026-11-23 the portal loaded no 700 face, so
   the browser drew every bold (b, strong, headings, and the PIN and «EJEMPLO»
   once written 700) with the 600 one; /shared/fonts/poppins.css, shared with
   the landing, now has a 700 face: these keep the portal as it was drawn. */
b,strong,h1,h2,h3,h4,h5,h6,th{font-weight:600}
html{-webkit-text-size-adjust:100%}
body{min-height:100vh;min-height:100svh;font-family:var(--font);background:var(--canvas);color:var(--ink);font-size:14px;line-height:1.55;-webkit-font-smoothing:antialiased}
button,input,select,textarea{font-family:inherit;font-size:inherit;color:inherit}
button{cursor:pointer;border:none;background:none}
[hidden]{display:none!important}
:focus-visible{outline:2px solid var(--brand);outline-offset:2px}
h1[tabindex="-1"]:focus{outline:none}

/* top bar */
.topbar{position:sticky;top:0;z-index:30;display:flex;align-items:center;justify-content:space-between;gap:12px;
  height:calc(60px + env(safe-area-inset-top,0px));padding:env(safe-area-inset-top,0px) 16px 0;
  background:var(--surface);border-bottom:1px solid var(--line)}
.brand{display:flex;align-items:center;gap:10px;min-width:0;flex-shrink:0}
.brand-link{display:flex;align-items:center;gap:10px;min-width:0;color:inherit;text-decoration:none;border-radius:8px}
.brand-link:focus-visible{outline:2px solid var(--brand);outline-offset:4px}
.brand .pvlogo{height:30px;width:auto;display:block}
.brand .pv{font-size:16px;font-weight:600;letter-spacing:-.01em}
.brand .pv b{color:var(--brand-ink);font-weight:600}
.brand .bt{display:none;font-size:12px;color:var(--ink-3);font-weight:500;border-left:1px solid var(--line);padding-left:10px}
.account{display:flex;align-items:center;gap:6px;min-width:0}
.clinic-select{max-width:46vw;padding:6px 30px 6px 10px;font-size:13px}
/* the clinic, top right after the menu and "Salir": its logo in a 34 px
   rounded square (or its initials in a brand circle), its name and city */
.clinic-badge{display:flex;align-items:center;gap:9px;min-width:0;margin-left:4px;padding-left:12px;border-left:1px solid var(--line)}
.clinic-mark{width:34px;height:34px;flex-shrink:0;display:grid;place-items:center;border-radius:50%;background:var(--brand-ink);color:#fff;font-size:13px;font-weight:600;letter-spacing:.02em;line-height:1}
.clinic-mark.has-logo{border-radius:9px;background:var(--surface);border:1px solid var(--line);overflow:hidden}
.clinic-mark img{width:100%;height:100%;object-fit:contain;display:block}
.clinic-text{display:flex;flex-direction:column;min-width:0;max-width:200px;line-height:1.25}
.clinic-name{min-width:0;font-weight:600;font-size:12.5px;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.clinic-city{font-size:11.5px;color:var(--ink-3);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.clinic-city:empty{display:none}
/* phones (under 600 px): the logo alone; the name stays for screen readers */
@media (max-width:599px){
  .clinic-badge{padding-left:8px;margin-left:2px}
  .clinic-text{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
}
/* phones: once signed in, the mark alone, to leave room for the clinic name */
@media (max-width:479px){body.signed-in .brand .pv{display:none}}
@media (min-width:720px){
  .topbar{padding-left:20px;padding-right:20px}
  .brand .bt{display:inline}
  .account{gap:10px}
}

/* menu */
.menu{position:relative}
.iconbtn{width:36px;height:36px;border-radius:8px;display:grid;place-items:center;color:var(--ink-2);flex-shrink:0}
.iconbtn:hover,.iconbtn[aria-expanded="true"]{background:var(--line-2);color:var(--ink)}
.menu-list{position:absolute;right:0;top:calc(100% + 6px);min-width:220px;background:var(--surface);border:1px solid var(--line);border-radius:12px;box-shadow:0 12px 32px rgba(16,15,13,.14);padding:6px;z-index:40}
.menu-who{padding:8px 10px 10px;font-size:12px;color:var(--ink-3);border-bottom:1px solid var(--line-2);margin-bottom:4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.menu-list button{display:block;width:100%;text-align:left;padding:9px 10px;border-radius:8px;font-size:13.5px;font-weight:500}
.menu-list button:hover,.menu-list button:focus-visible{background:var(--line-2)}

/* buttons and fields */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;border-radius:9px;padding:10px 18px;font-size:13.5px;font-weight:600;white-space:nowrap;text-decoration:none}
.btn-sm{padding:7px 12px;font-size:13px}
.btn-block{width:100%}
.btn-primary{background:var(--brand-ink);color:#fff}
.btn-primary:hover:not(:disabled){background:var(--brand-ink-2)}
.btn-primary:disabled{background:#cfd6d4;color:#4b5654;cursor:not-allowed}
.btn-line{border:1px solid var(--line);background:var(--surface);color:var(--ink)}
.btn-line:hover{background:var(--line-2)}
.btn[aria-busy="true"]{opacity:.7;cursor:progress}
.linkbtn{font-size:13px;color:var(--ink-2);font-weight:500;padding:6px 8px;border-radius:7px}
.linkbtn:hover{background:var(--line-2);color:var(--ink)}
.field{width:100%;background:var(--surface);border:1px solid var(--line);border-radius:9px;padding:10px 12px;font-size:16px;color:var(--ink);transition:border-color .12s,box-shadow .12s}
.field:focus{outline:none;border-color:var(--brand);box-shadow:0 0 0 3px var(--brand-soft)}
select.field{appearance:none;cursor:pointer;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234b5654' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 9px center;background-size:15px}
.lbl{display:block;font-size:12.5px;font-weight:600;color:var(--ink-2);margin-bottom:6px}
.hint{font-size:12px;color:var(--ink-3);margin-top:5px}
.fg{margin-bottom:14px}
/* Nombre and Apellidos side by side (one under the other on a phone) */
.names{display:grid;grid-template-columns:1fr 1.4fr;gap:12px;align-items:start}
@media(max-width:560px){.names{grid-template-columns:1fr}}
.notice{font-size:13px;color:var(--ink);background:var(--amber-soft);border-radius:8px;padding:9px 12px;margin:0 0 16px}
.notice.neutral{background:var(--line-2);color:var(--ink-2)}
.formerr{font-size:13px;color:var(--red);background:var(--red-soft);border-radius:8px;padding:9px 12px;margin:2px 0 14px}
.pwwrap{position:relative}
.pwwrap .field{padding-right:48px}
.eye{position:absolute;right:4px;top:50%;transform:translateY(-50%);width:40px;height:36px;display:grid;place-items:center;border-radius:7px;color:var(--ink-3)}
.eye:hover{color:var(--ink)}
.eye[data-shown="true"]{color:var(--brand-ink)}
.eye .ic-hide,.eye[data-shown="true"] .ic-show{display:none}
.eye[data-shown="true"] .ic-hide{display:block}
/* Edge's own eye inside a password field: the portal has its own (.eye) */
input[type=password]::-ms-reveal{display:none}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.fielderr{font-size:13px;color:var(--red);margin-top:6px}
.field[aria-invalid="true"],.field[aria-invalid="true"]:focus{border-color:var(--red)}
.field[aria-invalid="true"]:focus{box-shadow:0 0 0 3px var(--red-soft)}

/* new-password rules and the match line: grey until met, then green */
.rules{list-style:none;display:grid;gap:5px;margin-top:9px;font-size:12.5px;color:var(--ink-2)}
.rules li,.match{display:flex;align-items:center;gap:8px;line-height:1.35}
.rules li::before,.match::before{content:"";width:16px;height:16px;flex-shrink:0;border-radius:50%;border:1.5px solid #9aa5a2;box-sizing:border-box;background:var(--surface) center/10px no-repeat}
.rules li.ok{color:var(--brand-ink)}
.rules li.ok::before,.match.ok::before{border-color:var(--brand-ink);background-color:var(--brand-ink);background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E")}
.match{margin-top:7px;font-size:12.5px}
.match.ok{color:var(--brand-ink)}
.match.no{color:var(--red)}
.match.no::before{border-color:var(--red);background-color:var(--red);background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round'%3E%3Cpath d='M7 7l10 10M17 7L7 17'/%3E%3C/svg%3E")}
@media (min-width:480px){.rules{grid-template-columns:1fr 1fr;column-gap:14px}}

/* screens */
.screen{min-height:calc(100vh - 60px);min-height:calc(100svh - 60px)}
.pattern{background-color:var(--canvas);background-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%22220%22%20height%3D%22220%22%20viewBox%3D%220%200%20220%20220%22%3E%3Cg%20fill%3D%22none%22%20stroke%3D%22%237d8a86%22%20stroke-opacity%3D%22.2%22%20stroke-width%3D%221.6%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20transform%3D%22translate%2840%2044%29%20rotate%28-12%29%20scale%280.9%29%22%20d%3D%22M-11-9c-4%200-7%203-6%209%201%205%202%208%203%2014%201%204%204%204%205%200l2-8c.5-2%203.5-2%204%200l2%208c1%204%204%204%205%200%201-6%202-9%203-14%201-6-2-9-6-9-3%200-4%202-6%202s-3-2-6-2z%22/%3E%3Cpath%20transform%3D%22translate%28128%2030%29%20rotate%280%29%20scale%281%29%22%20d%3D%22M0-8L2-2%208%200%202%202%200%208-2%202-8%200-2-2z%22/%3E%3Cpath%20transform%3D%22translate%28186%2092%29%20rotate%280%29%20scale%281%29%22%20d%3D%22M-14%206L10-10M8-13l6%206M-16%204l4%204%22/%3E%3Cpath%20transform%3D%22translate%2898%20118%29%20rotate%2810%29%20scale%280.9%29%22%20d%3D%22M0%207C-9%201-10-4-7-7c2-2%205-1%207%202%202-3%205-4%207-2%203%203%202%208-7%2014z%22/%3E%3Cpath%20transform%3D%22translate%2826%20170%29%20rotate%280%29%20scale%281%29%22%20d%3D%22M-3%203L-12%2012M6-6a7%207%200%201%201-.1%200z%22/%3E%3Cpath%20transform%3D%22translate%28150%20182%29%20rotate%2814%29%20scale%280.75%29%22%20d%3D%22M-11-9c-4%200-7%203-6%209%201%205%202%208%203%2014%201%204%204%204%205%200l2-8c.5-2%203.5-2%204%200l2%208c1%204%204%204%205%200%201-6%202-9%203-14%201-6-2-9-6-9-3%200-4%202-6%202s-3-2-6-2z%22/%3E%3Cpath%20transform%3D%22translate%2862%20104%29%20rotate%280%29%20scale%280.7%29%22%20d%3D%22M0-8L2-2%208%200%202%202%200%208-2%202-8%200-2-2z%22/%3E%3Cpath%20transform%3D%22translate%28206%20196%29%20rotate%280%29%20scale%280.6%29%22%20d%3D%22M0-8L2-2%208%200%202%202%200%208-2%202-8%200-2-2z%22/%3E%3C/g%3E%3C/svg%3E");background-size:220px 220px}
.loading{min-height:inherit;display:grid;place-content:center;justify-items:center;gap:12px;color:var(--ink-2);font-size:13px}
.spin{width:30px;height:30px;border-radius:50%;border:3px solid var(--line);border-top-color:var(--brand);animation:sp .8s linear infinite}
@keyframes sp{to{transform:rotate(360deg)}}

/* login */
.login{min-height:inherit;display:grid;place-items:center;align-content:center;gap:16px;padding:28px 16px}
.backlink{font-size:13.5px;font-weight:500;color:var(--ink-2);text-decoration:none;padding:8px 10px;border-radius:8px}
.backlink:hover{color:var(--ink);text-decoration:underline}
.login .box,.msgbox .box{width:100%;max-width:400px;background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:28px 22px;box-shadow:var(--shadow)}
.login h1{font-size:22px;font-weight:500;letter-spacing:-.02em;line-height:1.25}
.login .lead{color:var(--ink-2);font-size:13.5px;margin:4px 0 22px}
.login .btn-block{margin-top:4px;padding:12px}
.forgot{display:block;margin:14px auto 0}
.forgot-text{margin-top:8px;text-align:center;font-size:13.5px;color:var(--ink)}
.forgot-text a,.support a{color:var(--brand-ink);font-weight:600}
@media (min-width:480px){.login .box,.msgbox .box{padding:32px 30px}}

/* message screens (unavailable, no clinic) */
.msgbox{min-height:inherit;display:grid;place-items:center;padding:28px 16px}
.msgbox .box{text-align:center}
.msgbox h1{font-size:18px;font-weight:500;letter-spacing:-.01em;line-height:1.35;margin-bottom:10px}
.msgbox p{color:var(--ink-2);font-size:13.5px;margin-bottom:20px}
.msgbox p b{color:var(--ink);font-weight:600;overflow-wrap:anywhere}
.msgbox h1+.btn{margin-top:10px}
.msgic{width:48px;height:48px;border-radius:50%;display:grid;place-items:center;margin:0 auto 14px;background:var(--brand-soft);color:var(--brand-ink)}
.msgic.warn{background:var(--amber-soft);color:var(--amber)}

/* card list page */
.page{max-width:1120px;margin:0 auto;padding:22px 16px 60px}
.head{display:flex;flex-direction:column;gap:14px;margin-bottom:18px}
.head h1{font-size:21px;font-weight:600;letter-spacing:-.02em;line-height:1.3}
.head p{color:var(--ink-2);font-size:13.5px;margin-top:3px}
.newcard{display:flex;align-items:center;gap:10px}
@media (min-width:640px){
  .page{padding:28px 20px 60px}
  .head{flex-direction:row;align-items:flex-end;justify-content:space-between}
}

.block{background:var(--surface);border:1px solid var(--line);border-radius:12px;box-shadow:var(--shadow)}
.block>header{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:13px 16px 12px;background:var(--canvas);border-bottom:1px solid var(--line-2);border-radius:12px 12px 0 0}
.block h2{font-size:14.5px;font-weight:600;letter-spacing:-.01em}
.count{font-size:12.5px;color:var(--ink-3)}
.block .body{padding:4px 16px}

/* the clinic's figures (without its examples) */
.stats{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-bottom:10px}
@media (min-width:720px){.stats{grid-template-columns:repeat(4,minmax(0,1fr))}}
.stat{background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:12px 14px;box-shadow:var(--shadow);display:flex;flex-direction:column;gap:2px;min-width:0}
.stat-n{font-size:24px;font-weight:600;line-height:1.15;letter-spacing:-.02em;font-variant-numeric:tabular-nums}
.stat-l{font-size:12.5px;color:var(--ink-2);line-height:1.3}
.stats-note{font-size:12.5px;color:var(--ink-2);margin:0 2px 16px}
.stats+.block{margin-top:16px}

/* filters: the states as pills with their number; the date as a segmented control */
.filters{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px 16px;padding:12px 16px 4px}
.pills{display:flex;flex-wrap:wrap;gap:6px}
.pill{display:inline-flex;align-items:center;gap:6px;padding:5px 11px;border:1px solid var(--line);border-radius:99px;background:var(--surface);font-size:12.5px;font-weight:500;color:var(--ink-2);white-space:nowrap}
.pill:hover{background:var(--line-2);color:var(--ink)}
.pill .pill-n{font-size:11.5px;font-weight:600;color:var(--ink-3);font-variant-numeric:tabular-nums}
.pill[aria-pressed="true"]{background:var(--brand-ink);border-color:var(--brand-ink);color:#fff}
.pill[aria-pressed="true"] .pill-n{color:#fff}
.seg{display:inline-flex;border:1px solid var(--line);border-radius:9px;overflow:hidden;background:var(--surface)}
.seg button{padding:5px 12px;font-size:12.5px;font-weight:500;color:var(--ink-2);border-left:1px solid var(--line);white-space:nowrap}
.seg button:first-child{border-left:none}
.seg button:hover{background:var(--line-2);color:var(--ink)}
.seg button[aria-pressed="true"]{background:var(--brand-soft);color:var(--brand-ink-2);font-weight:600}
.listnote{font-size:13px;color:var(--red);background:var(--red-soft);border-radius:8px;padding:8px 12px;margin:8px 16px 0}
.nomatch{padding:28px 4px;text-align:center;font-size:13.5px;color:var(--ink-2)}

/* empty state */
.empty{text-align:center;padding:36px 8px 40px}
.empty-ic{width:52px;height:52px;border-radius:14px;display:grid;place-items:center;margin:0 auto 12px;background:var(--brand-soft);color:var(--brand-ink)}
.empty-t{font-size:15px;font-weight:600}
.empty-d{font-size:13px;color:var(--ink-2);margin-top:3px}

/* card rows: stacked on phones and tablets, a table from 860px (fixed
   column widths: every row is its own grid, so they must not depend on content) */
.cards{list-style:none}
.cards li{display:grid;grid-template-columns:1fr auto;gap:4px 12px;padding:13px 0;border-bottom:1px solid var(--line-2)}
.cards li:last-child{border-bottom:none}
.cards .thead{display:none}
.c-link{min-width:0}
.c-link code{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:13px;font-weight:600;word-break:break-all}
.c-dates{grid-column:1/-1;font-size:12.5px;color:var(--ink-2)}
.c-dates .lab{color:var(--ink-3)}
.c-act{grid-column:1/-1;display:flex;gap:4px;margin-left:-8px}
.minibtn{display:inline-flex;align-items:center;gap:6px;font-size:13px;font-weight:600;color:var(--brand-ink);padding:6px 8px;border-radius:7px;text-decoration:none}
.minibtn:hover{background:var(--brand-soft)}
.chip{display:inline-flex;align-items:center;gap:6px;align-self:start;padding:3px 10px;border-radius:99px;font-size:12px;font-weight:600;white-space:nowrap}
.chip::before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor}
.chip.active{background:var(--brand-soft);color:var(--brand-ink)}
.chip.expired{background:var(--line-2);color:var(--ink-2)}
.chip.locked{background:var(--amber-soft);color:var(--amber)}
@media (min-width:860px){
  .cards li{grid-template-columns:minmax(0,1fr) 110px 110px 110px 180px;align-items:center;gap:12px}
  .cards .thead{display:grid;font-size:12px;font-weight:600;color:var(--ink-3);padding:11px 0 9px;border-bottom:1px solid var(--line)}
  /* link · created · expires · status · actions (DOM order is the phone's) */
  .c-link{order:1}
  .c-dates{display:contents}
  .c-dates .lab{display:none}
  .c-dates>span{order:2;font-size:13px}
  .cards .chip{order:3;justify-self:start;align-self:center}
  .c-act{order:4;grid-column:auto;margin-left:0;justify-content:flex-end}
}

/* case list: patient · date · status · openings · action */
.cards .c-name{min-width:0;font-weight:600;font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cards .c-opens{font-size:12.5px;color:var(--ink-2)}
/* the PC's table: the last opening under the count, without the dot */
@media (min-width:860px){.cards .c-last{display:block;font-size:12px;color:var(--ink-3);white-space:nowrap}.cards .c-last .sep{display:none}}
.chip.preparing{background:var(--line-2);color:var(--ink-2)}
/* Green is «Firmada»'s only (2026-11-16): «Lista para enviar» violet. */
.chip.ready{background:#efeafa;color:#55389a}
.chip.sent{background:#e8eef7;color:#2f4b7c}
.chip.uploading{background:var(--amber-soft);color:var(--amber)}

/* the patient signed the budget in the card (014) */
.chip.signed{background:#dcf1e3;color:#156b3a}
/* «Firmada» the first time the panel sees it (2026-11-17; 0.87 s and a 24 × 20 px
   logo before, hardly seen), 2.45 s in all: PlanVisto's logo, 40 px tall,
   centred on the chip, drawn slowly in the portal's green (--brand, #009474;
   the logo's own #28cda0 before) — its outline 0–1.2 s, the sheet's lines
   .8–1.3 s —, held whole until 1.7 s, gone by
   1.95 s; then «Firmada» pops in with a small bounce (1.95–2.45 s). The row
   glows green and fades (li.glow, 0–2.45 s). The chip's pop has no backwards
   fill: it is not scaled while the logo, its child, shows. */
.chip.draw{position:relative;animation:chipBg .2s ease-out 1.95s backwards,chipPop .5s ease-out 1.95s}
.chip.draw .chip-logo-box{position:absolute;left:50%;top:50%;width:49px;height:40px;margin:-20px 0 0 -24.5px;pointer-events:none;animation:chipLogoOut .25s ease-in 1.7s forwards}
.chip.draw .chip-logo{display:block;width:100%;height:100%;fill:none;stroke:var(--brand);stroke-width:7.5;stroke-linecap:round;stroke-linejoin:round;overflow:visible}
.chip.draw .chip-logo path{stroke-dasharray:1;stroke-dashoffset:1;animation:chipDraw 1.2s cubic-bezier(.45,0,.3,1) forwards}
.chip.draw .chip-logo path+path{animation-duration:.5s;animation-delay:.8s}
.chip.draw .chip-t,.chip.draw::before{opacity:0;animation:chipIn .2s ease-out 1.95s forwards}
@keyframes chipDraw{to{stroke-dashoffset:0}}
@keyframes chipLogoOut{to{opacity:0;transform:scale(.7)}}
@keyframes chipIn{to{opacity:1}}
@keyframes chipBg{from{background-color:transparent}}
@keyframes chipPop{0%{transform:scale(.6)}55%{transform:scale(1.1)}80%{transform:scale(.97)}100%{transform:none}}
/* its row: a soft green light behind the row's content (isolation: its z-index -1 stays within the row, above the list's white background) */
.cards li.glow{position:relative;isolation:isolate}
.cards li.glow::before{content:"";position:absolute;inset:3px -10px;z-index:-1;border-radius:10px;background:#e3f5ea;box-shadow:inset 0 0 0 1px rgba(21,107,58,.12);opacity:0;pointer-events:none;animation:rowGlow 2.45s ease-in-out forwards}
@keyframes rowGlow{12%,55%{opacity:1}to{opacity:0}}
@media (prefers-reduced-motion:reduce){.chip.draw{animation:none}.chip.draw .chip-logo-box,.cards li.glow::before{display:none}.chip.draw .chip-t,.chip.draw::before{opacity:1;animation:none}}
/* its download: a long label, which may take two lines */
.c-act [data-act="download"]{text-align:left}
@media (min-width:860px){.c-act [data-act="download"]{text-align:right}}
@media (min-width:860px){
  .cards.cases li{grid-template-columns:minmax(0,1fr) 92px 210px 236px 240px}
  .cards.cases .c-who{order:1}
  .cards.cases .c-opens{order:4;font-size:13px}
  .cards.cases .chip{order:3}
  .cards.cases .c-act{order:5}
}
/* the patient: the name, "EJEMPLO" beside it, and under it what an example is */
.cards .c-who{min-width:0}
/* «EJEMPLO» goes under the name when both do not fit (a phone), never cutting it */
.cards .c-line{display:flex;flex-wrap:wrap;align-items:center;gap:2px 8px;min-width:0}
.tag-ex{flex-shrink:0;font-size:10.5px;font-weight:600;letter-spacing:.06em;color:var(--amber);background:var(--amber-soft);border:1px solid #ecd3a6;border-radius:5px;padding:1px 6px;line-height:1.5}
.c-sub{font-size:12px;color:var(--ink-2);margin-top:1px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
/* the follow-up column: "Aprobada el …" over the openings */
.cards .c-approved{display:block;font-weight:600;color:#17633a}
.cards .c-approved>span{white-space:nowrap}
@media (min-width:860px){.cards .c-approved+span{display:block}}
.c-act{flex-wrap:wrap}
.minibtn:disabled{color:var(--ink-3);cursor:not-allowed;background:none}
.minibtn.quiet{color:var(--ink-2);font-weight:500}
.xbtn{width:30px;height:30px;display:inline-grid;place-items:center;border-radius:7px;font-size:17px;line-height:1;color:var(--ink-2)}
.xbtn:hover{background:var(--red-soft);color:var(--red)}
/* «Marcar como aprobada»: a row under the case, not a window */
.cards li.approve-row{display:block;margin:0 -16px;padding:14px 16px 16px;background:var(--canvas);border-bottom:1px solid var(--line)}
.ap-form{display:grid;gap:10px}
.ap-fields{display:grid;grid-template-columns:1fr;gap:10px}
@media (min-width:600px){.ap-fields{grid-template-columns:200px 220px;align-items:end}}
.ap-fields .field{font-size:14px;padding:8px 10px}
.ap-amount{position:relative}
.ap-amount .field{padding-right:30px}
.ap-amount .eur{position:absolute;right:10px;bottom:9px;font-size:13px;color:var(--ink-3)}
.ap-info{font-size:12.5px;color:var(--ink-2)}
.ap-acts{display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap}
.ap-err{font-size:13px;color:var(--red)}
/* ✕ and «Quitar aprobada»: «Deshacer» for 6 s at the foot */
.undo{position:fixed;left:50%;bottom:calc(24px + env(safe-area-inset-bottom,0px));transform:translateX(-50%);z-index:70;display:flex;align-items:center;gap:14px;max-width:calc(100vw - 32px);background:var(--ink);color:#fff;padding:9px 10px 9px 16px;border-radius:9px;font-size:13px;font-weight:500;box-shadow:var(--shadow)}
.undo span{white-space:nowrap}
.undo-btn{color:#9fe3cf;font-weight:600;font-size:13px;padding:4px 8px;border-radius:6px;text-decoration:underline;text-underline-offset:2px}
.undo-btn:hover{background:rgba(255,255,255,.1)}

/* new card form */
.page.narrow{max-width:640px}
.form{padding:22px 18px 18px}
/* upload slots: icon (the owner's own artwork, portal/icons/) + title + required/optional */
.slot{margin-bottom:18px}
.slot-head{display:flex;align-items:center;gap:12px;min-height:46px;margin-bottom:8px}
.slot-ico{width:46px;height:46px;flex-shrink:0;display:block}
.slot-head .lbl{font-size:14px;color:var(--ink);margin:0}
.slot-req{display:block;font-size:12px;color:var(--ink-3)}
.slot-head.no-ico{padding-left:58px}
/* the simulation: "Antes" left, "Después" right */
.pair{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.pair-col{min-width:0}
.pair-lbl{display:block;font-size:12.5px;font-weight:600;color:var(--ink-2);margin-bottom:6px}
.pair .drop{min-height:92px;padding:12px 8px}
.pair .thumbs{grid-template-columns:1fr}
textarea.field{resize:vertical;min-height:84px;font-size:15px;line-height:1.5}
.drop{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-height:92px;padding:14px;border:1.5px dashed #b9c4c1;border-radius:10px;background:var(--canvas);color:var(--ink-2);font-size:13.5px;text-align:center;cursor:pointer;transition:border-color .12s,background .12s}
.drop u{color:var(--brand-ink);font-weight:600;text-decoration-thickness:1px}
.drop:hover,.drop.over{border-color:var(--brand);background:var(--brand-soft)}
.drop-hint{font-size:12px;color:var(--ink-3)}
.filechip{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:8px;padding:8px 8px 8px 12px;border:1px solid var(--line);border-radius:9px;font-size:13px;font-weight:500;overflow-wrap:anywhere}
.x{width:30px;height:30px;flex-shrink:0;border-radius:7px;font-size:18px;line-height:1;color:var(--ink-2)}
.x:hover{background:var(--line-2);color:var(--ink)}
.thumbs{list-style:none;display:grid;grid-template-columns:repeat(auto-fill,minmax(84px,1fr));gap:8px;margin-top:10px}
.thumbs:empty{display:none}
.thumbs li{position:relative;aspect-ratio:1;border-radius:9px;overflow:hidden;background:var(--line-2)}
.thumbs img{width:100%;height:100%;object-fit:cover;display:block}
.thumbs .x{position:absolute;top:4px;right:4px;width:26px;height:26px;background:rgba(255,255,255,.92);font-size:16px}
.thumbs .n{position:absolute;left:4px;bottom:4px;font-size:11px;font-weight:600;background:rgba(255,255,255,.92);border-radius:5px;padding:0 5px}
.progress{font-size:13px;color:var(--ink-2);margin:2px 0 12px}
.form .acts{display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap;margin-top:4px}

/* "Ver y enviar" */
.modal .box.send{max-width:520px}
.kv{display:grid;grid-template-columns:auto 1fr;gap:6px 14px;margin-bottom:14px;font-size:13.5px}
.kv dt{color:var(--ink-3);font-weight:500}
.kv dd{min-width:0;font-weight:600;overflow-wrap:anywhere}
.kv code{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:13px}
.box-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:12px}
.box-head h2{margin:4px 0 0}
.kv .pin-dt{align-self:center}
.pin{font-size:30px;font-weight:600;letter-spacing:.22em;line-height:1.1;color:var(--ink);font-variant-numeric:tabular-nums}
/* the message, with its copy button inside, top right */
.msgwrap{position:relative}
.msgwrap .field{padding-right:52px}
.copybtn{position:absolute;top:8px;right:8px;width:36px;height:36px;display:grid;place-items:center;border:1px solid var(--line);border-radius:8px;background:var(--surface);color:var(--ink-2)}
.copybtn:hover:not(:disabled){background:var(--line-2);color:var(--ink)}
.copybtn:disabled{opacity:.45;cursor:default}
.copybtn::after{content:attr(data-tip);position:absolute;right:0;bottom:calc(100% + 6px);white-space:nowrap;background:var(--ink);color:#fff;font-size:12px;font-weight:500;padding:4px 8px;border-radius:6px;opacity:0;pointer-events:none;transition:opacity .12s}
.copybtn:hover:not(:disabled)::after,.copybtn:focus-visible::after{opacity:1}
.copied{position:absolute;right:8px;top:50px;font-size:12px;font-weight:600;color:var(--brand-ink)}
.copied:empty{display:none}
.send-acts{display:grid;grid-template-columns:1fr 1fr;gap:10px;align-items:start;margin:4px 0 12px}
.send-acts .btn{width:100%}
.viewcard{display:flex;flex-direction:column;align-items:center;gap:4px}
.tiny{font-size:11.5px;color:var(--ink-3)}
.send-info{font-size:12.5px;color:var(--ink-2);background:var(--line-2);border-radius:8px;padding:9px 12px;margin:0 0 8px}
.send-info[hidden]{display:none}
.linkbtn{font-size:13px;font-weight:600;color:var(--brand-ink);text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:2px;padding:4px 0}
.linkbtn:hover{color:var(--brand-ink-2)}
/* "¿Se envió a quien no era? Cambiar el PIN": small, not one of the dialog's actions */
.regen{font-size:12px;color:var(--ink-3);margin:2px 0 0}
.regen .linkbtn{font-size:12px;font-weight:500;color:var(--ink-2);padding:2px 0}
.regen .linkbtn:hover{color:var(--ink)}
/* the first click arms it: another label, and the warning under it (5 s) */
.regen .linkbtn.armed{color:var(--amber);font-weight:600}
.regen-ask{font-size:12.5px;color:var(--ink);background:var(--amber-soft);border-radius:8px;padding:8px 12px;margin:6px 0 0}
.regen-ask:empty{display:none}
.kv .opens{font-weight:500;color:var(--ink-2)}
@media (max-width:420px){.send-acts{grid-template-columns:1fr}}
.btn[aria-disabled="true"]{opacity:.45;pointer-events:none}

/* modal + toast */
.modal{position:fixed;inset:0;z-index:60;display:grid;place-items:center;padding:16px;background:rgba(16,15,13,.38)}
.modal .box{width:100%;max-width:420px;max-height:calc(100vh - 32px);overflow:auto;background:var(--surface);border-radius:14px;padding:22px 20px 18px;box-shadow:0 20px 50px rgba(0,0,0,.25)}
.modal h2{font-size:17px;font-weight:600;margin-bottom:16px}
.modal .acts{display:flex;justify-content:flex-end;gap:8px;margin-top:6px;flex-wrap:wrap}
.toast{position:fixed;left:50%;bottom:calc(24px + env(safe-area-inset-bottom,0px));transform:translateX(-50%);z-index:70;max-width:calc(100vw - 32px);background:var(--ink);color:#fff;padding:10px 16px;border-radius:9px;font-size:13px;font-weight:500;box-shadow:var(--shadow)}

@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}
