/* Conforto (9.6.0) — js/comfort.js + js/boot.js set data-cf-* on <html> before first paint (key memorify_comfort_v1).
   Text size uses CSS zoom on <body> because sizes in this app are px tokens plus many fixed px values; zoom scales all of them together
   and keeps the layout in proportion. Simple Mode (her screen) is excluded: it has its own very large type and a fixed overlay.
   Tokens only; no inline style anywhere; nothing flashes. */

/* ---------- 1. Text size (100 / 115 / 130 / 150 / 175 %) ---------- */
:root{--cf-z:1}
:root[data-cf-text="1"]{--cf-z:1.15}
:root[data-cf-text="2"]{--cf-z:1.3}
:root[data-cf-text="3"]{--cf-z:1.5}
:root[data-cf-text="4"]{--cf-z:1.75}
html:not([data-cf-text="0"]) body:not(.simple-mode){zoom:var(--cf-z)}
/* The page keeps its own scroll width: nothing may be wider than the (smaller) zoomed viewport. */
html:not([data-cf-text="0"]) body:not(.simple-mode) :where(img,svg,video,canvas,table,pre,iframe){max-width:100%}
html:not([data-cf-text="0"]) body:not(.simple-mode) :where(.row,.hm-chips,.tabs:not(.mnav-host),.release-status){flex-wrap:wrap}
html:not([data-cf-text="0"]) body:not(.simple-mode) :where(h1,h2,h3,h4,p,li,label,button,a,span,strong,b,em,small,code,td,th,div){overflow-wrap:anywhere}
html:not([data-cf-text="0"]) body:not(.simple-mode) :where(input,select,textarea){max-width:100%;min-width:0}
/* Fixed-width pieces of the app keep their words on one line; in a narrower (zoomed) page they wrap instead of pushing the page wider. */
html:not([data-cf-text="0"]) body:not(.simple-mode) :where(.btn,.ghost,button,.pill,.badge,.hm-chip,.hm-mini,.mu-btn,.cj-chip,.rd-chip,.md-chip,.tab){white-space:normal;max-width:100%}
html:not([data-cf-text="0"]) body:not(.simple-mode) :where(.card,.wrap,.section-h,.grid>*,.mu-card,.sh-lines,.sh-line,.acc-card,.acc-head){min-width:0;max-width:100%}
html:not([data-cf-text="0"]) body:not(.simple-mode) :where(.section-h,.acc-head,.hm-now li,.release-status){flex-wrap:wrap}
/* Inline min-widths and multi-column grids written for a 360px phone cannot hold in a page that is 175% larger: one column, nothing wider than the screen. */
html:not([data-cf-text="0"]) body:not(.simple-mode) [style*="min-width"]{min-width:0!important}
html:not([data-cf-text="0"]) body:not(.simple-mode) :where(.grid,.g2,.g3,.g4){grid-template-columns:minmax(0,1fr)!important}
html[data-cf-text="2"] body:not(.simple-mode) :where([class*="grid"],[class*="-cols"],[class*="-list"],[class*="-cards"],[class*="layout"],[class*="-split"],[class*="filters"]),html[data-cf-text="3"] body:not(.simple-mode) :where([class*="grid"],[class*="-cols"],[class*="-list"],[class*="-cards"],[class*="layout"],[class*="-split"],[class*="filters"]),html[data-cf-text="4"] body:not(.simple-mode) :where([class*="grid"],[class*="-cols"],[class*="-list"],[class*="-cards"],[class*="layout"],[class*="-split"],[class*="filters"]){grid-template-columns:minmax(0,1fr)!important}
html:not([data-cf-text="0"]) body:not(.simple-mode) .member{flex-wrap:wrap}
html:not([data-cf-text="0"]) body:not(.simple-mode) :where(.member>*,.row>*,.section-h>*){min-width:0}
html:not([data-cf-text="0"]) body:not(.simple-mode) :where(.sh-when,.pp-when,.mono,[class*="-when"],[class*="-meta"]){white-space:normal}
/* vh / dvh are multiplied by zoom as well: sheets that size themselves to the viewport are divided back so they stay on the screen. */
html:not([data-cf-text="0"]) body:not(.simple-mode) .mnav-panel,
html:not([data-cf-text="0"]) body:not(.simple-mode) .mnav-panel-more{max-height:calc((100vh - var(--mnav-bar-h) - 88px) / var(--cf-z));max-height:calc((100dvh - var(--mnav-bar-h) - env(safe-area-inset-bottom) - 72px) / var(--cf-z))}
html[data-cf-text="3"] body:not(.simple-mode) .topbar,
html[data-cf-text="4"] body:not(.simple-mode) .topbar{position:static}
html:not([data-cf-text="0"]) body:not(.simple-mode) .topbar{flex-wrap:wrap;row-gap:var(--s2)}
/* Browsers without CSS zoom (Firefox before 126): scale the type tokens instead. */
@supports not (zoom:1){
  :root[data-cf-text="1"]{--fs-xs:14px;--fs-sm:16px;--fs-md:18px;--fs-base:20px;--fs-lg:22px;--fs-xl:25px;--fs-2xl:30px;--fs-3xl:37px}
  :root[data-cf-text="2"]{--fs-xs:16px;--fs-sm:18px;--fs-md:21px;--fs-base:22px;--fs-lg:25px;--fs-xl:29px;--fs-2xl:34px;--fs-3xl:42px}
  :root[data-cf-text="3"]{--fs-xs:18px;--fs-sm:21px;--fs-md:24px;--fs-base:26px;--fs-lg:29px;--fs-xl:33px;--fs-2xl:39px;--fs-3xl:48px}
  :root[data-cf-text="4"]{--fs-xs:21px;--fs-sm:25px;--fs-md:28px;--fs-base:30px;--fs-lg:34px;--fs-xl:39px;--fs-2xl:46px;--fs-3xl:56px}
}

/* ---------- 2. Strong contrast (own choice or the OS asked for it) ---------- */
:root[data-cf-contrast="high"],:root[data-cf-contrast="high"][data-theme="dark"]{
  --ink:#000;--ink-2:#000;--muted:#1a1a1a;--muted-2:#262626;--heading:#000;--line:#000;--line-2:#000;
  --paper:#fff;--paper-2:#fff;--card:#fff;--card-2:#fff;--topbar-bg:#fff;
  --teal-ink:#00423b;--gold-ink:#3d2600;--blue:#00336e;--blue-2:#00336e;--navy:#000;--navy-2:#000;
  --teal-soft:#fff;--blue-soft:#fff;--gold-soft:#fff;--navy-soft:#fff;--ok:#0b4a1d;--warn:#5c3d00;--bad:#8a0010;
  --ok-soft:#fff;--info-soft:#fff;--warn-soft:#fff;--bad-soft:#fff;
  --sh-1:none;--sh-2:none;--sh-3:none;--shadow:none;--focus:0 0 0 3px #fff,0 0 0 6px #000;color-scheme:light;
}
html[data-cf-contrast="high"] body{background:#fff;color:#000}
html[data-cf-contrast="high"] :where(.card,.btn,.ghost,.tab,.hm-chip,input,select,textarea,.lang-select,.cf-size,.cf-switch,.cf-pick,.cj-chip,.md-chip,.rd-chip){border:2px solid #000!important;box-shadow:none!important}
html[data-cf-contrast="high"] .btn:not(.ghost):not(.secondary),html[data-cf-contrast="high"] .tab.active{background:#000!important;color:#fff!important}
html[data-cf-contrast="high"] :where(.ghost,.btn.secondary,.tab:not(.active),.hm-chip){background:#fff!important;color:#000!important}
html[data-cf-contrast="high"] :where(.topbar,.mnav-bar,.mnav-panel,.mnav-panel-more,.release-status,.cf-sheet,.toast){background:#fff!important;color:#000!important;border-color:#000!important;-webkit-backdrop-filter:none!important;backdrop-filter:none!important}
html[data-cf-contrast="high"] :where(.meta,small,.hm-date,.hm-kicker,.cf-desc){color:#1a1a1a!important;opacity:1!important}
html[data-cf-contrast="high"] a{color:#00336e;text-decoration:underline}
html[data-cf-contrast="high"] *{text-shadow:none!important}
html[data-cf-contrast="high"] :focus-visible{outline:3px solid #000!important;outline-offset:3px!important;box-shadow:0 0 0 6px #fff!important}

/* ---------- 3. Large targets ---------- */
html[data-cf-targets="large"] :where(button,.btn,.ghost,.tab,.hm-chip,select,summary,[role="button"],input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"])){min-height:56px}
html[data-cf-targets="large"] :where(.btn,.ghost,.hm-chip,.tab){padding-top:12px;padding-bottom:12px}
html[data-cf-targets="large"] :where(.row,.hm-chips,.cf-sizes,.cf-hand,.cf-sheet-actions,.cf-first-btns){gap:12px}
html[data-cf-targets="large"] :where(.hm-now li,.hm-steps li){padding-top:12px;padding-bottom:12px}
html[data-cf-targets="large"] .mnav-bar{gap:12px}
html[data-cf-targets="large"] .mnav-bar .tab{min-height:60px}
html[data-cf-targets="large"] :where(input[type="checkbox"],input[type="radio"]){width:28px;height:28px}

/* ---------- 4. Reduced motion (own choice or the OS asked for it): animations finish at once, nothing glides ---------- */
html[data-cf-motion="reduce"] *,html[data-cf-motion="reduce"] *::before,html[data-cf-motion="reduce"] *::after{
  animation-duration:.01ms!important;animation-delay:0s!important;animation-iteration-count:1!important;
  transition-duration:.01ms!important;transition-delay:0s!important;scroll-behavior:auto!important}
html[data-cf-motion="reduce"] .reveal{opacity:1;transform:none}
html[data-cf-motion="reduce"] .hero canvas{display:none}

/* ---------- 5. Always a word next to the icon ---------- */
html[data-cf-labels="1"] .topbar .ghost span,html[data-cf-labels="1"] .topbar .cf-btn .cf-lbl{display:inline!important;font-size:var(--fs-sm)}
html[data-cf-labels="1"] .topbar .lang-select{display:inline-block!important}
html[data-cf-labels="1"] .mnav-bar .tab span{display:inline!important}
html[data-cf-labels="1"] .mnav-bar .tab{flex-direction:column;gap:2px;font-size:var(--fs-sm)}
/* Icon-only buttons that carry only an aria-label get that word printed beside the icon (best effort: needs :has). */
html[data-cf-labels="1"] button[aria-label]:not(.cf-btn):not(.tab):not(.mnav-group):not([data-cf-toggle]):not(.cf-size):not(:has(span)):not(:has(:is(p,div)))::after{content:attr(aria-label);margin-left:6px;font-size:var(--fs-sm);font-weight:700}

/* ---------- 6. Thumb side ---------- */
html[data-cf-hand="left"] .cf-sheet-actions,html[data-cf-hand="left"] .cf-first-btns,html[data-cf-hand="left"] .cf-foot{justify-content:flex-start}
html[data-cf-hand="right"] .cf-sheet-actions,html[data-cf-hand="right"] .cf-foot{justify-content:flex-end}
html[data-cf-hand="left"] .cf-live{left:var(--s4);right:auto}
html[data-cf-hand="right"] .cf-live{right:var(--s4);left:auto}
@media (max-width:760px){
  html[data-cf-hand="left"] .mnav-bar{flex-direction:row-reverse}
  html[data-cf-hand="left"] .mnav-bar .mnav-direct{flex-direction:row}
  html[data-cf-hand="left"] .mnav-panel,html[data-cf-hand="left"] .mnav-panel-more{direction:ltr}
  html[data-cf-hand="left"] body:not(.simple-mode) .topbar{flex-direction:row-reverse}
  html[data-cf-hand="left"] body:not(.simple-mode) .topbar .spacer{order:0}
}

/* ---------- 7. Modo Essencial: the only visual change is a quiet marker; the routes themselves are filtered in app.js ---------- */
html[data-cf-easy="1"] .mnav-legend{display:none}

/* ---------- 8. Controls added by this layer ---------- */
.cf-topbar{display:inline-flex;align-items:center;gap:var(--s2);flex-wrap:nowrap}
.cf-btn{display:inline-flex;align-items:center;gap:6px;min-height:44px;min-width:44px;justify-content:center}
.cf-btn .cf-ic{font-size:20px;line-height:1}
.topbar .cf-btn .cf-ic{display:inline}
.topbar .cf-btn .cf-lbl{display:none}
@media (min-width:900px){.topbar .cf-btn .cf-lbl{display:inline;font-size:var(--fs-sm)}}
.cf-btn[aria-pressed="true"]{background:var(--teal-soft);border-color:var(--teal);color:var(--teal-ink)}
.cf-btn.cf-big{width:100%;font-size:var(--fs-lg);min-height:56px}
.cf-btn.cf-big .cf-lbl{display:inline}
.cf-home-listen{margin:0 0 var(--s4)}
.cf-live{position:fixed;bottom:calc(var(--mnav-bar-h,64px) + var(--s4) + env(safe-area-inset-bottom));max-width:calc(min(92vw,420px) / var(--cf-z));z-index:95;background:var(--navy);color:#fff;border-radius:var(--r-lg);padding:12px 16px;font-size:var(--fs-md);font-weight:700;box-shadow:var(--sh-3)}
.cf-live:empty{display:none}
html[data-cf-contrast="high"] .cf-live{background:#000!important;color:#fff!important}

.cf-ov{position:fixed;inset:0;z-index:300;display:flex;align-items:flex-end;justify-content:center;background:rgba(15,39,71,.45)}
.cf-sheet{width:100%;max-width:560px;max-height:calc(85vh / var(--cf-z));overflow:auto;background:var(--card);color:var(--ink);border-radius:var(--r-xl) var(--r-xl) 0 0;padding:var(--s5) var(--s4) calc(var(--s5) + env(safe-area-inset-bottom));box-shadow:var(--sh-3)}
.cf-sheet h2{margin:0 0 var(--s2);font-size:var(--fs-xl);color:var(--heading)}
.cf-sheet-p{margin:0 0 var(--s3);color:var(--muted)}
.cf-steps{list-style:none;margin:0 0 var(--s4);padding:0;counter-reset:cf}
.cf-steps li{padding:var(--s3) 0;border-top:1px solid var(--line);font-size:var(--fs-lg);line-height:1.45}
.cf-steps li:first-child{border-top:0}
.cf-step-n{display:block;font-size:var(--fs-sm);font-weight:800;color:var(--teal-ink);text-transform:uppercase;letter-spacing:.06em}
.cf-sheet-actions{display:flex;flex-wrap:wrap;gap:var(--s3)}
@media (min-width:761px){.cf-ov{align-items:center}.cf-sheet{border-radius:var(--r-xl)}}

.cf-card .cf-block{margin:var(--s4) 0 0}
.cf-h{display:block;font-size:var(--fs-md);color:var(--heading)}
.cf-desc{display:block;color:var(--muted);font-size:var(--fs-sm);line-height:1.45}
.cf-sizes{display:grid;grid-template-columns:repeat(auto-fit,minmax(88px,1fr));gap:var(--s2);margin-top:var(--s2)}
.cf-size,.cf-pick{appearance:none;border:2px solid var(--line-2);background:var(--card);color:var(--ink);border-radius:var(--r-md);min-height:64px;padding:var(--s2);font:inherit;font-weight:700;cursor:pointer;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px}
.cf-size[aria-pressed="true"],.cf-pick[aria-pressed="true"]{border-color:var(--teal);background:var(--teal-soft);color:var(--teal-ink);box-shadow:inset 0 0 0 1px var(--teal)}
.cf-a{font-weight:800;line-height:1}
.cf-a0{font-size:16px}.cf-a1{font-size:18px}.cf-a2{font-size:21px}.cf-a3{font-size:25px}.cf-a4{font-size:30px}
.cf-size-n{font-size:var(--fs-xs);font-weight:700;text-align:center;line-height:1.2}
.cf-row{display:flex;align-items:center;justify-content:space-between;gap:var(--s3);padding:var(--s3) 0;border-top:1px solid var(--line);margin-top:var(--s3);flex-wrap:wrap}
.cf-row-t{flex:1 1 200px;min-width:0}
.cf-row-t strong{display:block;font-size:var(--fs-md);color:var(--heading)}
.cf-switch{appearance:none;border:2px solid var(--line-2);background:var(--card);color:var(--ink);border-radius:var(--r-pill);min-height:52px;min-width:104px;padding:6px 18px;font:inherit;font-weight:800;cursor:pointer}
.cf-switch[aria-checked="true"]{background:var(--teal);border-color:var(--teal-ink);color:#fff}
.cf-hand{display:grid;grid-template-columns:1fr 1fr;gap:var(--s2);margin-top:var(--s2)}
.cf-foot{display:flex;align-items:center;gap:var(--s3);flex-wrap:wrap;margin-top:var(--s4);padding-top:var(--s3);border-top:1px solid var(--line)}
.cf-done{color:var(--ok);font-weight:700;font-size:var(--fs-sm)}
.cf-voice-on{color:var(--ok);font-weight:700;font-size:var(--fs-sm)}
.cf-size:focus-visible,.cf-pick:focus-visible,.cf-switch:focus-visible,.cf-btn:focus-visible{outline:3px solid var(--teal);outline-offset:2px}

.cf-first{border:2px solid var(--teal)}
.cf-first-q{font-size:var(--fs-xl)!important;margin:0 0 var(--s3)!important}
.cf-first-btns{display:flex;flex-direction:column;gap:var(--s3)}
.cf-first-btns .btn{width:100%;min-height:56px;justify-content:center}
.cf-first-btns .cf-fs2{font-size:var(--fs-xl)}
.cf-first-btns .cf-fs4{font-size:var(--fs-2xl)}
.cf-first-more{margin:var(--s3) 0 0;display:flex;gap:var(--s2);flex-wrap:wrap}

@media print{.cf-topbar,.cf-live,.cf-ov,.cf-first,.cf-home-listen{display:none!important}}
@media (forced-colors:active){.cf-size[aria-pressed="true"],.cf-pick[aria-pressed="true"],.cf-switch[aria-checked="true"]{border:3px solid Highlight}}

.cf-card{margin-bottom:var(--s4)}
