/* © 2026 Thrivegrid LLC. All rights reserved. Proprietary and confidential. */
/* Thrivegrid display settings: text size, high contrast, less motion, bigger buttons.
   display.js sets these attributes on <html> before the page paints, from what this device saved:
     data-tg-size="1".."5"   text size (100 / 115 / 130 / 150 / 175 %). Page CSS sizes type in rem, so all text grows.
     data-tg-contrast="high" stronger text, borders, underlined links, thick focus rings
     data-tg-motion="reduce" no animations or smooth scrolling (also on when the phone or computer asks for less motion)
     data-tg-big="1"         bigger buttons and fields, easier to tap
   Every screen should load this file and display.js in <head>. */

:root { --tap: 48px; --tg-focus: #F6C66E; --tg-focus-ink: #0B1621; }
html[data-tg-size="2"] { font-size: 115%; }
html[data-tg-size="3"] { font-size: 130%; }
html[data-tg-size="4"] { font-size: 150%; }
html[data-tg-size="5"] { font-size: 175%; }
/* Long words and addresses wrap instead of pushing the page sideways at big sizes. */
html[data-tg-size="3"] body, html[data-tg-size="4"] body, html[data-tg-size="5"] body { overflow-wrap: break-word; }

/* At big sizes, long button labels wrap instead of running off the screen. */
html[data-tg-size] :is(.btn, a.btn) { white-space: normal; max-width: 100%; }

/* ---------- Focus you can always see (keyboard, switch and TV-remote users) ---------- */
:focus-visible { outline: 3px solid var(--tg-focus) !important; outline-offset: 2px !important; box-shadow: 0 0 0 5px var(--tg-focus-ink); }
:focus:not(:focus-visible) { outline: none; }
.tg-skip { position: fixed; left: 8px; top: -100px; z-index: 2147483000; background: var(--tg-focus); color: var(--tg-focus-ink);
  font: 700 1rem/1.2 "Atkinson Hyperlegible", Verdana, system-ui, sans-serif; padding: 12px 16px; border-radius: 10px; text-decoration: none; }
.tg-skip:focus { top: 8px; }

/* ---------- Less motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html:not([data-tg-motion="full"]) *, html:not([data-tg-motion="full"]) *::before, html:not([data-tg-motion="full"]) *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
html[data-tg-motion="reduce"] *, html[data-tg-motion="reduce"] *::before, html[data-tg-motion="reduce"] *::after {
  animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important;
  transition-duration: .001ms !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
html[data-tg-motion="reduce"] { scroll-behavior: auto !important; }

/* ---------- Bigger buttons ---------- */
html[data-tg-big="1"] { --tap: 60px; }
html[data-tg-big="1"] :is(button, .btn, a.btn, [role="button"], input[type="submit"], input[type="button"], select,
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):not([type="hidden"])) {
  min-height: var(--tap); }
html[data-tg-big="1"] :is(button, .btn, a.btn, [role="button"]) { min-width: var(--tap); }
html[data-tg-big="1"] :is(input[type="checkbox"], input[type="radio"]) { width: 1.6em; height: 1.6em; }
html[data-tg-big="1"] :is(nav a, [role="tab"], .tab, .chip) { min-height: var(--tap); }
html[data-tg-big="1"] :is(p, li) a:not(.btn) { padding-block: .2em; }

/* ---------- High contrast ----------
   Pages name their soft text colors differently (--mist/--dim, --muted, --soft/--mute). In high contrast they all
   become the main text color, borders get much stronger, and links are always underlined. */
html:root[data-tg-contrast="high"] {
  --mist: var(--fg, var(--fog, var(--ink))); --dim: var(--fg, var(--fog, var(--ink)));
  --muted: var(--fg, var(--fog, var(--ink))); --soft: var(--fg, var(--fog, var(--ink))); --mute: var(--fg, var(--fog, var(--ink)));
  --line: color-mix(in srgb, currentColor 75%, transparent);
}
html[data-tg-contrast="high"] a:not(.btn):not([role="button"]):not(.htile):not(.card) { text-decoration: underline !important; text-underline-offset: .18em; }
html[data-tg-contrast="high"] :is(button, .btn, a.btn, [role="button"], input, select, textarea) { border: 2px solid currentColor !important; }
html[data-tg-contrast="high"] :is(.card, .htile, .tile, dialog) { border: 2px solid color-mix(in srgb, currentColor 75%, transparent) !important; }
html[data-tg-contrast="high"] :focus-visible { outline-width: 4px !important; outline-color: currentColor !important; }
html[data-tg-contrast="high"] ::placeholder { color: inherit; opacity: .85; }

/* ---------- The settings panel ---------- */
#tgDisp { width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 2px solid #3D6B8C; border-radius: 22px;
  background: #FFFFFF; color: #142433; font: 1.0625rem/1.5 "Atkinson Hyperlegible", Verdana, system-ui, sans-serif; color-scheme: light;
  box-shadow: 0 18px 60px rgba(0,0,0,.45); overflow-wrap: normal; }
#tgDisp::backdrop { background: rgba(11,22,33,.6); }
#tgDisp form { margin: 0; padding: 20px 20px 18px; }
#tgDisp h2 { font: 800 1.45rem/1.15 "ArchivoX", "Archivo", "Arial Narrow", Arial, sans-serif; margin: 0 0 4px; color: #142433; }
#tgDisp .tgd-lead { margin: 0 0 14px; color: #3E4C57; }
#tgDisp fieldset { border: 0; margin: 0 0 16px; padding: 0; min-width: 0; }
#tgDisp legend { font-weight: 700; font-size: 1.1rem; margin-bottom: 8px; padding: 0; }
#tgDisp .tgd-sizes { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
#tgDisp .tgd-sizes label { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px;
  min-height: 84px; padding: 8px 4px; border: 2px solid #A9B8C3; border-radius: 14px; background: #F5F8F9; cursor: pointer; text-align: center; }
#tgDisp .tgd-sizes input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
#tgDisp .tgd-sizes b { font-family: Georgia, "Times New Roman", serif; line-height: 1; color: #142433; }
#tgDisp .tgd-sizes span { font-size: .8rem; line-height: 1.15; color: #3E4C57; }
#tgDisp .tgd-sizes label:has(input:checked) { border-color: #142433; background: #FFF4DC; box-shadow: inset 0 0 0 2px #F0A92E; }
#tgDisp .tgd-sizes label:has(input:checked) span { color: #142433; font-weight: 700; }
#tgDisp .tgd-sizes label:has(input:focus-visible) { outline: 3px solid #3D6B8C; outline-offset: 2px; }
#tgDisp .tgd-preview { margin: 10px 0 0; padding: 10px 12px; border-radius: 12px; background: #EDF1F2; color: #142433; }
#tgDisp .tgd-sw { display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 10px 12px; margin: 0 0 8px; border: 2px solid #C9D4DA;
  border-radius: 14px; cursor: pointer; background: #FFFFFF; }
#tgDisp .tgd-sw:has(input:checked) { border-color: #142433; background: #FFF4DC; }
#tgDisp .tgd-sw input { appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 58px; height: 34px; margin: 0;
  border-radius: 999px; background: #8A9DAC; border: 2px solid #4C5B67 !important; cursor: pointer; }
#tgDisp .tgd-sw input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #FFFFFF;
  box-shadow: 0 1px 3px rgba(0,0,0,.4); transition: transform .15s; }
#tgDisp .tgd-sw input:checked { background: #24834B; border-color: #1B6A3C !important; }
#tgDisp .tgd-sw input:checked::after { transform: translateX(24px); }
#tgDisp .tgd-sw b { display: block; }
#tgDisp .tgd-sw small { display: block; font-size: .9rem; color: #3E4C57; line-height: 1.35; }
#tgDisp .tgd-sw .tgd-state { margin-left: auto; font: 700 .85rem/1 "IBM Plex Mono", Menlo, monospace; letter-spacing: .06em; text-transform: uppercase; color: #3E4C57; }
#tgDisp .tgd-sw input:checked ~ .tgd-state { color: #1B6A3C; }
#tgDisp .tgd-acts { display: flex; gap: 10px; flex-wrap: wrap; justify-content: space-between; margin-top: 14px; }
#tgDisp .tgd-acts button { min-height: 52px; padding: 10px 20px; border-radius: 14px; font: 700 1.05rem/1.2 inherit; font-family: inherit; cursor: pointer; }
#tgDisp .tgd-reset { background: #FFFFFF; color: #142433; border: 2px solid #4C5B67; }
#tgDisp .tgd-done { background: #142433; color: #FFFFFF; border: 2px solid #142433; flex: 1; }
#tgDisp .tgd-note { margin: 10px 0 0; font-size: .9rem; color: #3E4C57; }
@media (max-width: 420px) {
  #tgDisp form { padding: 16px 14px 14px; }
  #tgDisp .tgd-sizes { gap: 5px; }
  #tgDisp .tgd-sizes label { min-height: 76px; }
  #tgDisp .tgd-sizes span { font-size: .72rem; }
}
/* The "Aa Text size" button, only on screens that don't have their own Text size button. It sits at the end of the page,
   in the flow, so it never covers what's on screen (it used to float over "Start messaging" and the Status page). */
.tg-aa { position: static; display: flex; align-items: center; justify-content: center; gap: 10px; margin: 28px auto 24px; min-height: 48px; padding: 0 20px;
  border-radius: 24px; border: 1.5px solid #F6C66E; background: #142433; color: #FFFFFF; cursor: pointer;
  font: 700 1rem/1 "Archivo", Arial, sans-serif; }
.tg-aa b { font: 800 1.1rem/1 "ArchivoX", "Archivo", Arial, sans-serif; }
.tg-aa:hover { background: #1A2F42; }
@media print { .tg-aa, .tg-skip { display: none !important; } }
/* A "Aa" button that sits in a screen's own header. */
.tg-aa-in { flex: none; display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding: 0 10px; border-radius: 12px; cursor: pointer;
  border: 1.5px solid color-mix(in srgb, currentColor 45%, transparent); background: transparent; color: inherit;
  font: 800 1rem/1 "ArchivoX", "Archivo", Arial, sans-serif; }
.tg-aa-in:hover { background: color-mix(in srgb, currentColor 12%, transparent); }
.tg-aa-ib span, .iconbtn[data-tg-display] span { font: 800 1rem/1 "ArchivoX", "Archivo", Arial, sans-serif; }
/* Every printed or PDF page from the hub carries the same notice, in the page's language. */
@media print {
  body::after { content: "Printed from Thrivegrid. General information only: not guaranteed, may be out of date, and not medical, legal or other professional advice. Anything written by AI can be wrong. Follow official instructions. In an emergency, call 911.";
    display: block; margin-top: 14pt; padding-top: 6pt; border-top: 1px solid #888; font: 8.5pt/1.35 Arial, sans-serif; color: #333; white-space: normal; }
  html:lang(es) body::after { content: "Impreso desde Thrivegrid. Solo información general: no garantizada, puede estar desactualizada y no es consejo médico, legal ni profesional. Lo escrito por IA puede estar equivocado. Sigue las instrucciones oficiales. En una emergencia, llama al 911."; }
}
