/* ==========================================================================
   PomoMed — specialty themes ("skins"). Owner: THEMES.
   A skin changes appearance only: the three mode colours (light + dark),
   the accent tokens used on surfaces, a very faint line-art background
   pattern and a small emoji badge on the logo. The default skin
   ("pomomed") is the untouched app.css look — no attribute, no rules.

   Where the skin lives
     <html data-skin="…">  set before first paint by the inline head script
     <body data-skin="…">  mirrored at runtime by themes.js
     [data-skin-preview="…"] any element (mini previews, pro try-on tiles)
   Selectors use ":root[data-skin] body" so the tokens land on <body>, where
   app.css resolves --mode-bg from --c-focus/--c-short/--c-long.

   Contrast rules (checked for every skin, both schemes)
     • white text on --c-* (light scheme) ≥ 5.5:1  (default teal is 5.47:1)
       and ≥ 4.5:1 for the 90 % white secondary text over the pattern;
     • white text on --c-* (dark scheme) ≥ 9:1;
     • --light-* accents on the dark surfaces (#111827) ≥ 8.9:1;
     • --solid-* carry white button text in light surfaces (= --c-* light).
   ========================================================================== */

/* ---------- 1. Shared skin layers ---------- */

/* Faint line-art pattern behind everything (fixed, never scrolls, never
   catches pointer events). Softer in the middle so the timer stays clean. */
:root[data-skin]:not([data-skin="pomomed"]) body::after,
body[data-skin]:not([data-skin="pomomed"])::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: var(--skin-pattern, none);
  background-size: var(--skin-pattern-size, 160px);
  background-position: 50% 0;
  opacity: .09;
  -webkit-mask-image: radial-gradient(ellipse 62% 48% at 50% 34%, rgba(0, 0, 0, .3), #000 78%);
  mask-image: radial-gradient(ellipse 62% 48% at 50% 34%, rgba(0, 0, 0, .3), #000 78%);
}
:root[data-skin]:not([data-skin="pomomed"]) body[data-theme="dark"]::after,
body[data-skin]:not([data-skin="pomomed"])[data-theme="dark"]::after { opacity: .075; }

/* Emoji badge on the logo's tomato (absolutely positioned: no layout shift). */
:root[data-skin]:not([data-skin="pomomed"]) .logo,
body[data-skin]:not([data-skin="pomomed"]) .logo { position: relative; }
:root[data-skin]:not([data-skin="pomomed"]) .logo::after,
body[data-skin]:not([data-skin="pomomed"]) .logo::after {
  content: var(--skin-emoji, none);
  position: absolute;
  left: 21px;
  top: calc(50% - 1px);
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 2px var(--mode-bg), 0 2px 5px rgba(0, 0, 0, .28);
  font-size: 11px;
  line-height: 1;
  pointer-events: none;
  transition: box-shadow var(--mode-transition, .6s ease);
}
@media (max-width: 380px) {
  :root[data-skin]:not([data-skin="pomomed"]) .logo::after,
  body[data-skin]:not([data-skin="pomomed"]) .logo::after { left: 16px; width: 17px; height: 17px; font-size: 10px; }
}

/* Accent: a faint tinted rim on the timer card. */
:root[data-skin]:not([data-skin="pomomed"]) .timer-card,
body[data-skin]:not([data-skin="pomomed"]) .timer-card {
  border-color: color-mix(in srgb, var(--skin-accent, #fff) 30%, transparent);
}
:root[data-skin]:not([data-skin="pomomed"]) ::selection,
body[data-skin]:not([data-skin="pomomed"]) ::selection {
  background: color-mix(in srgb, var(--skin-accent, #fde047) 70%, #fff);
  color: #111;
}

@media (forced-colors: active), print {
  body::after { display: none !important; }
  .logo::after { display: none !important; }
}

/* ---------- 2. Skin tokens (generated palette; see header for the contrast rules) ---------- */
/* pomomed */
[data-skin-preview="pomomed"] {
  --c-focus: #0f766e;
  --c-short: #0369a1;
  --c-long: #4338ca;
  --solid-focus: #0f766e;
  --solid-short: #0369a1;
  --solid-long: #4338ca;
  --light-focus: #5eead4;
  --light-short: #7dd3fc;
  --light-long: #a5b4fc;
  --skin-accent: #5eead4;
  --skin-pattern: none;
}
body[data-theme="dark"] [data-skin-preview="pomomed"] {
  --c-focus: #0a3f3b;
  --c-short: #0a3150;
  --c-long: #25226a;
}
/* gastro */
:root[data-skin="gastro"] body,
body[data-skin="gastro"],
[data-skin-preview="gastro"] {
  --c-focus: #a8481f;
  --c-short: #8f5a10;
  --c-long: #8c3b4f;
  --solid-focus: #a8481f;
  --solid-short: #8f5a10;
  --solid-long: #8c3b4f;
  --light-focus: #fdba8c;
  --light-short: #fcd34d;
  --light-long: #f9a8c0;
  --skin-accent: #fdba74;
  --skin-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cg fill='none' stroke='%23fff' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath transform='translate(18 20) rotate(0) scale(0.95)' d='M0 0h34a9 9 0 0 1 0 18H8a9 9 0 0 0 0 18h26a9 9 0 0 1 0 18H8a9 9 0 0 0 0 18h30'/%3E%3Cpath transform='translate(112 96) rotate(90) scale(0.8)' d='M0 0h34a9 9 0 0 1 0 18H8a9 9 0 0 0 0 18h26a9 9 0 0 1 0 18H8a9 9 0 0 0 0 18h30'/%3E%3Ccircle cx='150' cy='26' r='3'/%3E%3Ccircle cx='34' cy='150' r='2.4'/%3E%3Ccircle cx='90' cy='60' r='1.8'/%3E%3C/g%3E%3C/svg%3E");
  --skin-pattern-size: 180px;
  --skin-pattern-mini: 75.6px;
  --skin-emoji: "🌀";
}
:root[data-skin="gastro"] body[data-theme="dark"],
body[data-skin="gastro"][data-theme="dark"],
body[data-theme="dark"] [data-skin-preview="gastro"] {
  --c-focus: #4a1e0e;
  --c-short: #45290a;
  --c-long: #3d1a24;
}
/* pediatria */
:root[data-skin="pediatria"] body,
body[data-skin="pediatria"],
[data-skin-preview="pediatria"] {
  --c-focus: #b23a70;
  --c-short: #246ca3;
  --c-long: #634dbb;
  --solid-focus: #b23a70;
  --solid-short: #246ca3;
  --solid-long: #634dbb;
  --light-focus: #f9a8d4;
  --light-short: #93c5fd;
  --light-long: #c4b5fd;
  --skin-accent: #fbcfe8;
  --skin-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='150' viewBox='0 0 150 150'%3E%3Cg fill='none' stroke='%23fff' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M26.0 22.0L28.1 27.1L33.6 27.5L29.4 31.1L30.7 36.5L26.0 33.6L21.3 36.5L22.6 31.1L18.4 27.5L23.9 27.1Z'/%3E%3Cpath d='M112.0 86.0L113.6 89.8L117.7 90.1L114.6 92.8L115.5 96.9L112.0 94.7L108.5 96.9L109.4 92.8L106.3 90.1L110.4 89.8Z'/%3E%3Cpath d='M96 20Q96 26 102 26Q96 26 96 32Q96 26 90 26Q96 26 96 20Z'/%3E%3Cpath d='M36 109Q36 116 43 116Q36 116 36 123Q36 116 29 116Q36 116 36 109Z'/%3E%3Ccircle cx='70' cy='70' r='2.2'/%3E%3Ccircle cx='132' cy='140' r='1.8'/%3E%3Ccircle cx='8' cy='78' r='1.6'/%3E%3Cpath d='M76.0 131.5L77.2 134.4L80.3 134.6L77.9 136.6L78.6 139.6L76.0 138.0L73.4 139.6L74.1 136.6L71.7 134.6L74.8 134.4Z'/%3E%3C/g%3E%3C/svg%3E");
  --skin-pattern-size: 150px;
  --skin-pattern-mini: 63px;
  --skin-emoji: "🧸";
}
:root[data-skin="pediatria"] body[data-theme="dark"],
body[data-skin="pediatria"][data-theme="dark"],
body[data-theme="dark"] [data-skin-preview="pediatria"] {
  --c-focus: #4d1932;
  --c-short: #132f4a;
  --c-long: #2c2356;
}
/* cardio */
:root[data-skin="cardio"] body,
body[data-skin="cardio"],
[data-skin-preview="cardio"] {
  --c-focus: #b91c1c;
  --c-short: #9d1c4a;
  --c-long: #7a1f2b;
  --solid-focus: #b91c1c;
  --solid-short: #9d1c4a;
  --solid-long: #7a1f2b;
  --light-focus: #fca5a5;
  --light-short: #f9a8c8;
  --light-long: #fda4af;
  --skin-accent: #fecaca;
  --skin-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='120' viewBox='0 0 240 120'%3E%3Cg fill='none' stroke='%23fff' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M0.0 42H55.2q6 -8 12 0H79.2l4 5 6 -30 7 38 5 -13H132.0q10 -14 20 0H240.0'/%3E%3Cpath d='M0.0 102H55.2q6 -8 12 0H79.2l4 5 6 -30 7 38 5 -13H132.0q10 -14 20 0H240.0'/%3E%3Cpath transform='translate(196 70) scale(0.7)' d='M0 4C-2 -1 -9 -1 -9 5c0 5 9 10 9 10s9-5 9-10c0-6-7-6-9-1z'/%3E%3C/g%3E%3C/svg%3E");
  --skin-pattern-size: 240px 120px;
  --skin-pattern-mini: 100.8px 50.4px;
  --skin-emoji: "🫀";
}
:root[data-skin="cardio"] body[data-theme="dark"],
body[data-skin="cardio"][data-theme="dark"],
body[data-theme="dark"] [data-skin-preview="cardio"] {
  --c-focus: #520e10;
  --c-short: #460d22;
  --c-long: #380e14;
}
/* neuro */
:root[data-skin="neuro"] body,
body[data-skin="neuro"],
[data-skin-preview="neuro"] {
  --c-focus: #6d28d9;
  --c-short: #4f46e5;
  --c-long: #86198f;
  --solid-focus: #6d28d9;
  --solid-short: #4f46e5;
  --solid-long: #86198f;
  --light-focus: #c4b5fd;
  --light-short: #a5b4fc;
  --light-long: #f0abfc;
  --skin-accent: #ddd6fe;
  --skin-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cg fill='none' stroke='%23fff' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M0 40L38 52L84 30L132 58L180 40M38 52L56 104L22 140L0 132M56 104L110 118L132 58M110 118L150 150L180 132M110 118L96 180M96 0L84 30M150 150L160 180M160 0L132 58M22 140L30 180M30 0L38 52'/%3E%3Ccircle cx='38' cy='52' r='5' fill='%23fff' fill-opacity='.35'/%3E%3Ccircle cx='84' cy='30' r='3.2' fill='%23fff' fill-opacity='.35'/%3E%3Ccircle cx='132' cy='58' r='3.2' fill='%23fff' fill-opacity='.35'/%3E%3Ccircle cx='56' cy='104' r='5' fill='%23fff' fill-opacity='.35'/%3E%3Ccircle cx='22' cy='140' r='3.2' fill='%23fff' fill-opacity='.35'/%3E%3Ccircle cx='110' cy='118' r='3.2' fill='%23fff' fill-opacity='.35'/%3E%3Ccircle cx='150' cy='150' r='5' fill='%23fff' fill-opacity='.35'/%3E%3C/g%3E%3C/svg%3E");
  --skin-pattern-size: 180px;
  --skin-pattern-mini: 75.6px;
  --skin-emoji: "🧠";
}
:root[data-skin="neuro"] body[data-theme="dark"],
body[data-skin="neuro"][data-theme="dark"],
body[data-theme="dark"] [data-skin-preview="neuro"] {
  --c-focus: #2e1360;
  --c-short: #221f66;
  --c-long: #3d0f44;
}
/* pneumo */
:root[data-skin="pneumo"] body,
body[data-skin="pneumo"],
[data-skin-preview="pneumo"] {
  --c-focus: #0369a1;
  --c-short: #0b6b85;
  --c-long: #1d4ed8;
  --solid-focus: #0369a1;
  --solid-short: #0b6b85;
  --solid-long: #1d4ed8;
  --light-focus: #7dd3fc;
  --light-short: #67e8f9;
  --light-long: #93c5fd;
  --skin-accent: #bae6fd;
  --skin-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='170' height='170' viewBox='0 0 170 170'%3E%3Cg fill='none' stroke='%23fff' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M40 0V22M40 22L22 44M40 22L60 46M126 92V112M126 112L108 134M126 112L146 136'/%3E%3Cg transform='translate(18 52) scale(0.8)'%3E%3Ccircle cx='0' cy='0' r='7'/%3E%3Ccircle cx='-11' cy='5' r='6'/%3E%3Ccircle cx='11' cy='5' r='6'/%3E%3Ccircle cx='-6' cy='14' r='6'/%3E%3Ccircle cx='6' cy='14' r='6'/%3E%3Ccircle cx='0' cy='-11' r='5'/%3E%3C/g%3E%3Cg transform='translate(62 56) scale(0.8)'%3E%3Ccircle cx='0' cy='0' r='7'/%3E%3Ccircle cx='-11' cy='5' r='6'/%3E%3Ccircle cx='11' cy='5' r='6'/%3E%3Ccircle cx='-6' cy='14' r='6'/%3E%3Ccircle cx='6' cy='14' r='6'/%3E%3Ccircle cx='0' cy='-11' r='5'/%3E%3C/g%3E%3Cg transform='translate(104 142) scale(0.8)'%3E%3Ccircle cx='0' cy='0' r='7'/%3E%3Ccircle cx='-11' cy='5' r='6'/%3E%3Ccircle cx='11' cy='5' r='6'/%3E%3Ccircle cx='-6' cy='14' r='6'/%3E%3Ccircle cx='6' cy='14' r='6'/%3E%3Ccircle cx='0' cy='-11' r='5'/%3E%3C/g%3E%3Cg transform='translate(148 146) scale(0.8)'%3E%3Ccircle cx='0' cy='0' r='7'/%3E%3Ccircle cx='-11' cy='5' r='6'/%3E%3Ccircle cx='11' cy='5' r='6'/%3E%3Ccircle cx='-6' cy='14' r='6'/%3E%3Ccircle cx='6' cy='14' r='6'/%3E%3Ccircle cx='0' cy='-11' r='5'/%3E%3C/g%3E%3Ccircle cx='130' cy='34' r='5'/%3E%3Ccircle cx='142' cy='44' r='4'/%3E%3Ccircle cx='18' cy='120' r='4'/%3E%3C/g%3E%3C/svg%3E");
  --skin-pattern-size: 170px;
  --skin-pattern-mini: 71.39999999999999px;
  --skin-emoji: "🫁";
}
:root[data-skin="pneumo"] body[data-theme="dark"],
body[data-skin="pneumo"][data-theme="dark"],
body[data-theme="dark"] [data-skin-preview="pneumo"] {
  --c-focus: #0b3552;
  --c-short: #093846;
  --c-long: #152866;
}
/* cirurgia */
:root[data-skin="cirurgia"] body,
body[data-skin="cirurgia"],
[data-skin-preview="cirurgia"] {
  --c-focus: #2a6b4f;
  --c-short: #356b7d;
  --c-long: #3f5f4a;
  --solid-focus: #2a6b4f;
  --solid-short: #356b7d;
  --solid-long: #3f5f4a;
  --light-focus: #86efac;
  --light-short: #99d5e6;
  --light-long: #bbd9a8;
  --skin-accent: #bbf7d0;
  --skin-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200' viewBox='0 0 200 200'%3E%3Cg fill='none' stroke='%23fff' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cg transform='translate(16 40) rotate(0)'%3E%3Cpath d='M0 0C24 -6 48 6 72 -2S96 2 96 0'/%3E%3Cpath d='M13 -7L19 7'/%3E%3Cpath d='M29 -7L35 7'/%3E%3Cpath d='M45 -7L51 7'/%3E%3Cpath d='M61 -7L67 7'/%3E%3Cpath d='M77 -7L83 7'/%3E%3C/g%3E%3Cg transform='translate(96 140) rotate(-20)'%3E%3Cpath d='M0 0C22.5 -6 45 6 67.5 -2S90 2 90 0'/%3E%3Cpath d='M12 -7L18 7'/%3E%3Cpath d='M27 -7L33 7'/%3E%3Cpath d='M42 -7L48 7'/%3E%3Cpath d='M57 -7L63 7'/%3E%3Cpath d='M72 -7L78 7'/%3E%3C/g%3E%3Cpath d='M150 30v14M143 37h14M40 150v10M35 155h10'/%3E%3C/g%3E%3C/svg%3E");
  --skin-pattern-size: 200px;
  --skin-pattern-mini: 84px;
  --skin-emoji: "✂️";
}
:root[data-skin="cirurgia"] body[data-theme="dark"],
body[data-skin="cirurgia"][data-theme="dark"],
body[data-theme="dark"] [data-skin-preview="cirurgia"] {
  --c-focus: #14382a;
  --c-short: #18343e;
  --c-long: #1c2e22;
}
/* go */
:root[data-skin="go"] body,
body[data-skin="go"],
[data-skin-preview="go"] {
  --c-focus: #be185d;
  --c-short: #9d174d;
  --c-long: #86198f;
  --solid-focus: #be185d;
  --solid-short: #9d174d;
  --solid-long: #86198f;
  --light-focus: #f9a8d4;
  --light-short: #fda4af;
  --light-long: #f0abfc;
  --skin-accent: #fbcfe8;
  --skin-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='170' height='170' viewBox='0 0 170 170'%3E%3Cg fill='none' stroke='%23fff' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cg transform='translate(34 36) scale(0.9)'%3E%3Cellipse cx='0' cy='-7' rx='4' ry='7' transform='rotate(0)'/%3E%3Cellipse cx='0' cy='-7' rx='4' ry='7' transform='rotate(72)'/%3E%3Cellipse cx='0' cy='-7' rx='4' ry='7' transform='rotate(144)'/%3E%3Cellipse cx='0' cy='-7' rx='4' ry='7' transform='rotate(216)'/%3E%3Cellipse cx='0' cy='-7' rx='4' ry='7' transform='rotate(288)'/%3E%3Ccircle r='2.6'/%3E%3C/g%3E%3Cg transform='translate(120 118) scale(0.75)'%3E%3Cellipse cx='0' cy='-7' rx='4' ry='7' transform='rotate(0)'/%3E%3Cellipse cx='0' cy='-7' rx='4' ry='7' transform='rotate(72)'/%3E%3Cellipse cx='0' cy='-7' rx='4' ry='7' transform='rotate(144)'/%3E%3Cellipse cx='0' cy='-7' rx='4' ry='7' transform='rotate(216)'/%3E%3Cellipse cx='0' cy='-7' rx='4' ry='7' transform='rotate(288)'/%3E%3Ccircle r='2.6'/%3E%3C/g%3E%3Cpath d='M0 90C30 70 50 110 85 90S140 70 170 90'/%3E%3Ccircle cx='128' cy='34' r='4'/%3E%3Ccircle cx='140' cy='44' r='2.4'/%3E%3Ccircle cx='40' cy='140' r='3'/%3E%3C/g%3E%3C/svg%3E");
  --skin-pattern-size: 170px;
  --skin-pattern-mini: 71.39999999999999px;
  --skin-emoji: "🤰";
}
:root[data-skin="go"] body[data-theme="dark"],
body[data-skin="go"][data-theme="dark"],
body[data-theme="dark"] [data-skin-preview="go"] {
  --c-focus: #560b2a;
  --c-short: #480a23;
  --c-long: #3d0c44;
}
/* orto */
:root[data-skin="orto"] body,
body[data-skin="orto"],
[data-skin-preview="orto"] {
  --c-focus: #4a6178;
  --c-short: #3a6a8a;
  --c-long: #545a7e;
  --solid-focus: #4a6178;
  --solid-short: #3a6a8a;
  --solid-long: #545a7e;
  --light-focus: #b6c7d9;
  --light-short: #9ccbe8;
  --light-long: #c3c6e6;
  --skin-accent: #cbd5e1;
  --skin-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='170' height='170' viewBox='0 0 170 170'%3E%3Cg fill='none' stroke='%23fff' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath transform='translate(42 40) rotate(-30)' d='M-14.6 -3H14.6A4.5 4.5 0 1 1 21.06 0A4.5 4.5 0 1 1 14.6 3H-14.6A4.5 4.5 0 1 1 -21.06 0A4.5 4.5 0 1 1 -14.6 -3Z'/%3E%3Cpath transform='translate(124 120) rotate(20)' d='M-14.6 -3H14.6A4.5 4.5 0 1 1 21.06 0A4.5 4.5 0 1 1 14.6 3H-14.6A4.5 4.5 0 1 1 -21.06 0A4.5 4.5 0 1 1 -14.6 -3Z'/%3E%3Cpath transform='translate(126 30) rotate(60)' d='M-14.6 -3H14.6A4.5 4.5 0 1 1 21.06 0A4.5 4.5 0 1 1 14.6 3H-14.6A4.5 4.5 0 1 1 -21.06 0A4.5 4.5 0 1 1 -14.6 -3Z'/%3E%3Ccircle cx='40' cy='128' r='3'/%3E%3Ccircle cx='52' cy='138' r='2'/%3E%3C/g%3E%3C/svg%3E");
  --skin-pattern-size: 170px;
  --skin-pattern-mini: 71.39999999999999px;
  --skin-emoji: "🦴";
}
:root[data-skin="orto"] body[data-theme="dark"],
body[data-skin="orto"][data-theme="dark"],
body[data-theme="dark"] [data-skin-preview="orto"] {
  --c-focus: #202b37;
  --c-short: #19303f;
  --c-long: #25283c;
}
/* psiquiatria */
:root[data-skin="psiquiatria"] body,
body[data-skin="psiquiatria"],
[data-skin-preview="psiquiatria"] {
  --c-focus: #6e58b5;
  --c-short: #4a64a0;
  --c-long: #7a5596;
  --solid-focus: #6e58b5;
  --solid-short: #4a64a0;
  --solid-long: #7a5596;
  --light-focus: #c9bcf5;
  --light-short: #b4c4ec;
  --light-long: #dcc0ea;
  --skin-accent: #ddd6fe;
  --skin-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200' viewBox='0 0 200 200'%3E%3Cg fill='none' stroke='%23fff' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M0 50C25 38 50 38 75 50S125 62 150 50S175 38 200 50M0 150C25 138 50 138 75 150S125 162 150 150S175 138 200 150' stroke-opacity='.8'/%3E%3Ccircle cx='150' cy='100' r='6'/%3E%3Ccircle cx='150' cy='100' r='13' stroke-opacity='.7'/%3E%3Ccircle cx='150' cy='100' r='21' stroke-opacity='.4'/%3E%3Ccircle cx='40' cy='100' r='6'/%3E%3Ccircle cx='40' cy='100' r='13' stroke-opacity='.7'/%3E%3Ccircle cx='40' cy='100' r='18' stroke-opacity='.4'/%3E%3C/g%3E%3C/svg%3E");
  --skin-pattern-size: 200px;
  --skin-pattern-mini: 84px;
  --skin-emoji: "🧘";
}
:root[data-skin="psiquiatria"] body[data-theme="dark"],
body[data-skin="psiquiatria"][data-theme="dark"],
body[data-theme="dark"] [data-skin-preview="psiquiatria"] {
  --c-focus: #2f2650;
  --c-short: #222d48;
  --c-long: #352442;
}

/* Content pages (pro, sobre, privacidade…): pages.css accent tokens follow the skin. */
:root[data-skin="gastro"] body.pg,
body.pg[data-skin="gastro"],
:root[data-skin="pediatria"] body.pg,
body.pg[data-skin="pediatria"],
:root[data-skin="cardio"] body.pg,
body.pg[data-skin="cardio"],
:root[data-skin="neuro"] body.pg,
body.pg[data-skin="neuro"],
:root[data-skin="pneumo"] body.pg,
body.pg[data-skin="pneumo"],
:root[data-skin="cirurgia"] body.pg,
body.pg[data-skin="cirurgia"],
:root[data-skin="go"] body.pg,
body.pg[data-skin="go"],
:root[data-skin="orto"] body.pg,
body.pg[data-skin="orto"],
:root[data-skin="psiquiatria"] body.pg,
body.pg[data-skin="psiquiatria"] {
  --pg-accent: var(--solid-focus);
  --pg-accent-strong: color-mix(in srgb, var(--solid-focus) 78%, #000);
  --pg-accent-contrast: #ffffff;
  --pg-soft: color-mix(in srgb, var(--solid-focus) 8%, #fff);
}
:root[data-skin="gastro"] body.pg[data-theme="dark"],
body.pg[data-skin="gastro"][data-theme="dark"],
:root[data-skin="pediatria"] body.pg[data-theme="dark"],
body.pg[data-skin="pediatria"][data-theme="dark"],
:root[data-skin="cardio"] body.pg[data-theme="dark"],
body.pg[data-skin="cardio"][data-theme="dark"],
:root[data-skin="neuro"] body.pg[data-theme="dark"],
body.pg[data-skin="neuro"][data-theme="dark"],
:root[data-skin="pneumo"] body.pg[data-theme="dark"],
body.pg[data-skin="pneumo"][data-theme="dark"],
:root[data-skin="cirurgia"] body.pg[data-theme="dark"],
body.pg[data-skin="cirurgia"][data-theme="dark"],
:root[data-skin="go"] body.pg[data-theme="dark"],
body.pg[data-skin="go"][data-theme="dark"],
:root[data-skin="orto"] body.pg[data-theme="dark"],
body.pg[data-skin="orto"][data-theme="dark"],
:root[data-skin="psiquiatria"] body.pg[data-theme="dark"],
body.pg[data-skin="psiquiatria"][data-theme="dark"] {
  --pg-accent: var(--light-focus);
  --pg-accent-strong: color-mix(in srgb, var(--light-focus) 70%, #fff);
  --pg-accent-contrast: #0b1220;
  --pg-soft: color-mix(in srgb, var(--light-focus) 12%, #0b1220);
}

/* ---------- 3. Per-skin extras ---------- */
/* Pediatria: rounder, softer shapes */
:root[data-skin="pediatria"] body,
body[data-skin="pediatria"] {
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 28px;
}
:root[data-skin="pediatria"] body .btn,
body[data-skin="pediatria"] .btn,
:root[data-skin="pediatria"] body .mode-tab,
body[data-skin="pediatria"] .mode-tab { border-radius: 999px; }
:root[data-skin="pediatria"] body .btn-start,
body[data-skin="pediatria"] .btn-start { border-radius: 22px; }
:root[data-skin="pediatria"] body .timer-display,
body[data-skin="pediatria"] .timer-display { letter-spacing: -.03em; }

/* Cardio: the ECG line takes centre stage */
:root[data-skin="cardio"] body #ecg-track,
body[data-skin="cardio"] #ecg-track { stroke: rgba(255, 255, 255, .22); stroke-width: 1.8; }
:root[data-skin="cardio"] body #ecg-fill,
body[data-skin="cardio"] #ecg-fill {
  stroke-width: 2.4;
  filter: drop-shadow(0 0 3px rgba(254, 202, 202, .95)) drop-shadow(0 0 10px rgba(252, 165, 165, .55));
}
:root[data-skin="cardio"] body .ecg-head,
body[data-skin="cardio"] .ecg-head { box-shadow: 0 0 0 3px rgba(254, 202, 202, .35), 0 0 14px 4px rgba(252, 165, 165, .85); }
:root[data-skin="cardio"] body .logo__pulse,
body[data-skin="cardio"] .logo__pulse { stroke: #fecaca; }
@media (prefers-reduced-motion: reduce) {
:root[data-skin="cardio"] body #ecg-fill,
body[data-skin="cardio"] #ecg-fill { filter: drop-shadow(0 0 3px rgba(254, 202, 202, .9)); }
}

/* ---------- 4. Header button + popover ---------- */
.skin-switch { display: inline-flex; }
.btn-skin__icon { position: relative; display: inline-grid; place-items: center; }
.btn-skin__dot {
  position: absolute;
  right: -3px;
  bottom: -2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--light-focus);
  box-shadow: 0 0 0 2px var(--mode-bg), 0 0 6px var(--light-focus);
  transition: background-color .2s, box-shadow var(--mode-transition, .6s ease);
}
.btn.btn-skin[aria-expanded="true"] { border-color: var(--glass-line-hover, rgba(255, 255, 255, .5)); background: rgba(0, 0, 0, .28); }

/* The popover is portalled to <body> and fixed-positioned by themes.js.
   It carries its own surface tokens, so it never depends on where it sits. */
.skin-pop-backdrop {
  position: fixed;
  inset: 0;
  z-index: 890;
  background: rgba(4, 10, 18, .45);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.skin-pop {
  --ctx-text: var(--surface-text);
  --ctx-muted: var(--surface-muted);
  --ctx-border: var(--surface-border);
  --ring: var(--mode-solid);
  position: fixed;
  z-index: 900;
  top: 72px;
  right: 16px;
  width: min(432px, calc(100vw - 24px));
  max-height: min(80vh, 640px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 16px 12px;
  border: 1px solid var(--surface-border);
  border-radius: 18px;
  background: var(--surface);
  color: var(--surface-text);
  font-family: var(--font-ui);
  font-size: 1rem;
  line-height: 1.4;
  text-align: left;
  box-shadow: var(--shadow-lg);
}
body[data-theme="dark"] .skin-pop { --ring: var(--mode-light); }
.skin-pop[hidden], .skin-pop-backdrop[hidden] { display: none !important; }
@media (prefers-reduced-motion: no-preference) {
  .skin-pop.is-in:not(.is-sheet) { animation: skin-pop-in .18s var(--ease, ease-out); transform-origin: top right; }
  .skin-pop.is-in.is-sheet { animation: skin-sheet-in .24s var(--ease, ease-out); }
  .skin-pop-backdrop:not([hidden]) { animation: skin-fade .2s ease-out; }
}
@keyframes skin-pop-in { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
@keyframes skin-sheet-in { from { transform: translateY(100%); } }
@keyframes skin-fade { from { opacity: 0; } }

/* Phones: bottom sheet */
.skin-pop.is-sheet {
  top: auto;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  max-height: 86vh;
  max-height: 86dvh;
  padding: 8px 16px max(16px, env(safe-area-inset-bottom));
  border-width: 1px 0 0;
  border-radius: 22px 22px 0 0;
}
.skin-pop__grip { display: none; }
.skin-pop.is-sheet .skin-pop__grip {
  display: block;
  width: 40px;
  height: 4px;
  margin: 0 auto 10px;
  border-radius: 4px;
  background: var(--surface-border);
}

.skin-pop__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.skin-pop__title {
  margin: 2px 0 2px;
  font-size: 1.0625rem;
  font-weight: 800;
  letter-spacing: -.015em;
  color: var(--surface-text);
}
.skin-pop__hint {
  margin: 0;
  font-size: .8125rem;
  line-height: 1.4;
  color: var(--surface-muted);
}
.skin-pop__close { flex: none; margin: -6px -8px 0 0; color: var(--surface-muted); }
.skin-pop__close:hover { color: var(--surface-text); }
.skin-pop__foot {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--surface-border);
}
.skin-pop__more {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--mode-solid);
  font: inherit;
  font-size: .875rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition: text-decoration-color .16s, gap .16s;
}
body[data-theme="dark"] .skin-pop__more { color: var(--mode-light); }
.skin-pop__more:hover { text-decoration-color: currentColor; gap: 9px; }
.skin-pop__more .pm-icon { width: 16px; height: 16px; }

/* ---------- 5. Skin picker tiles (popover + settings) ---------- */
.skin-group + .skin-group { margin-top: 12px; }
.skin-group__title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
  font-size: .6875rem;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--surface-muted);
}
.skin-group__title .skin-lock { width: 12px; height: 12px; }
.skin-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.skin-tile {
  appearance: none;
  position: relative;
  display: grid;
  align-content: start;
  gap: 6px;
  width: 100%;
  min-height: 44px;
  padding: 5px 5px 8px;
  border: 1.5px solid var(--surface-border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--surface-text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .12s var(--ease, ease-out);
}
.skin-tile:hover { border-color: color-mix(in srgb, var(--surface-text) 30%, var(--surface-border)); }
@media (prefers-reduced-motion: no-preference) {
  .skin-tile:hover { transform: translateY(-1px); }
  .skin-tile:active { transform: scale(.98); }
}
.skin-tile[aria-pressed="true"] {
  border-color: var(--mode-solid);
  box-shadow: inset 0 0 0 1px var(--mode-solid), 0 0 0 3px color-mix(in srgb, var(--mode-solid) 18%, transparent);
}
body[data-theme="dark"] .skin-tile[aria-pressed="true"] {
  border-color: var(--mode-light);
  box-shadow: inset 0 0 0 1px var(--mode-light), 0 0 16px -4px var(--mode-light);
}
.skin-tile:focus-visible { outline: 2px solid var(--ring, var(--mode-solid)); outline-offset: 2px; }

/* Mini preview of the skin: focus colour + pattern + a tiny timer. */
.skin-tile__swatch {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 11;
  border-radius: 9px;
  overflow: hidden;
  isolation: isolate;
  place-items: end center;
  padding-bottom: 10px;
  background: var(--c-focus);
  color: #fff;
}
.skin-tile__swatch::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: var(--skin-pattern, none);
  background-size: var(--skin-pattern-mini, 70px);
  background-position: 50% 0;
  opacity: .32;
}
.skin-tile__swatch::after {
  /* the three modes, as a strip: focus · short break · long break */
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--light-focus) 0 33.4%, var(--light-short) 0 66.7%, var(--light-long) 0);
}
.skin-tile__clock {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-weight: 800;
  font-size: .8125rem;
  letter-spacing: -.03em;
  line-height: 1;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .18);
}
.skin-tile__clock::after {
  /* the white INICIAR pill */
  content: "";
  display: block;
  width: 22px;
  height: 5px;
  margin: 4px auto 0;
  border-radius: 3px;
  background: #fff;
}
.skin-tile__emoji {
  position: absolute;
  top: 4px;
  left: 4px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  font-size: 10px;
  line-height: 1;
}
.skin-tile__mark {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  color: var(--c-focus);
  opacity: 0;
  transform: scale(.6);
  transition: opacity .15s, transform .2s var(--ease-spring, ease-out);
}
.skin-tile__mark svg { width: 12px; height: 12px; }
.skin-tile[aria-pressed="true"] .skin-tile__mark { opacity: 1; transform: none; }
.skin-tile.is-locked .skin-tile__mark { display: none; }
/* 🔒 Pro pill on locked previews */
.skin-tile__pro {
  position: absolute;
  top: 4px;
  right: 4px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 18px;
  padding: 0 6px 0 5px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fff4cc, #fcd34d 55%, #f2a516);
  color: #3b1d03;
  font-family: var(--font-ui);
  font-size: .625rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  line-height: 1;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
}
.skin-tile__pro .skin-lock { width: 10px; height: 10px; }
.skin-tile.is-locked .skin-tile__swatch { filter: saturate(.85); }
.skin-tile__name {
  display: block;
  padding: 0 3px;
  font-size: .8125rem;
  font-weight: 750;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.skin-tile__meta {
  display: block;
  margin-top: -3px;
  padding: 0 3px;
  font-size: .75rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--surface-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.skin-tile[aria-pressed="true"] .skin-tile__meta { color: var(--mode-solid); font-weight: 750; }
body[data-theme="dark"] .skin-tile[aria-pressed="true"] .skin-tile__meta { color: var(--mode-light); }
.skin-tile.is-locked .skin-tile__meta { color: #92400e; font-weight: 750; }
body[data-theme="dark"] .skin-tile.is-locked .skin-tile__meta { color: #fcd34d; }
.skin-status {
  min-height: 1.2em;
  margin: 8px 0 0;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--surface-muted);
}
.skin-status:empty { display: none; }

.skin-grid--free { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.skin-grid--free .skin-tile__clock { font-size: .75rem; }
.skin-grid--free .skin-tile__clock::after { display: none; }
.skin-grid--free .skin-tile__emoji,
.skin-grid--free .skin-tile__mark { width: 16px; height: 16px; top: 3px; font-size: 9px; }
.skin-grid--free .skin-tile__emoji { left: 3px; }
.skin-grid--free .skin-tile__mark { right: 3px; }
.skin-grid--free .skin-tile__mark svg { width: 10px; height: 10px; }
.skin-grid--free .skin-tile__swatch { padding-bottom: 8px; }
@media (max-width: 480px) {
  .skin-grid--free .skin-tile { padding-inline: 4px; }
  .skin-grid--free .skin-tile__name,
  .skin-grid--free .skin-tile__meta { padding-inline: 1px; letter-spacing: -.01em; }
  .skin-grid--free .skin-tile__name {
    font-size: .75rem;
    white-space: normal;
    overflow: visible;
    -webkit-hyphens: auto;
    hyphens: auto;
  }
}
@media (max-width: 340px) {
  .skin-grid--free { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .skin-tile, .skin-tile__mark, .btn-skin__dot, .skin-pop__more { transition: none; }
}
@media (forced-colors: active) {
  .skin-tile { border: 1px solid ButtonText; }
  .skin-tile[aria-pressed="true"] { outline: 3px solid Highlight; }
  .skin-tile__swatch { forced-color-adjust: none; }
}

/* Popover: the Pro pill already says it; keep locked tiles to the name. */
.skin-pop .skin-tile.is-locked .skin-tile__meta { display: none; }
