/* Original app grid and gestures; compact cards styled like index3.html. */
:root {
  --ev-cyan: #08bbff;
  --ev-mint: #78e6ad;
  --ev-text: #fff;
  --ev-muted: var(--ev-text);
  /* Only this dashboard: keep secondary text, hints and menus bright too. */
  --app-text-primary: var(--ev-text);
  --app-text-secondary: var(--ev-text);
  --app-text-muted: var(--ev-text);
}
body { font-family: 'DM Sans', sans-serif; }
button, input, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--ev-cyan); outline-offset: 4px; }
[hidden] { display: none !important; }
.skip-link { position: fixed; top: -60px; left: 20px; z-index: 4000; padding: 12px; background: #006be6; color: white; }
.skip-link:focus { top: 10px; }
body > header { position: fixed; z-index: 1000; }
.shell-header-actions { position: absolute; right: 20px; display: flex; align-items: center; gap: 12px; }
header .hamburger { position: static; border: 0; background: transparent; }
.resume-app { border: 1px solid #23528b; background: #102a4d; border-radius: 9px; padding: 8px 12px; font-size: 12px; }
header .back-to-questionnaire { background: transparent; font-weight: 400; color: var(--ev-text); }
#screens-container { padding-top: 78px; touch-action: pan-x pan-y; }
.screen { height: calc(100dvh - 78px); touch-action: pan-x pan-y; }
/* Native horizontal paging also works when a swipe starts on a tile.
   The shared long-press handlers still take over once a drag starts. */
#screens-container .widget { touch-action: pan-x pan-y; }
body.dragging-widget #screens-container .widget { touch-action: none; }
.widget-grid { height: calc(100dvh - 78px - 32px); padding-top: 26px; gap: 24px 10px; }
.grid-overlay { top: 26px; gap: 24px 10px; }
.row-labels { top: 26px; height: calc(100% - 26px); }
.row-label-item { pointer-events: none; }
.row-label-text, .row-label-input { pointer-events: auto; }
.screen-indicators { position: fixed; }

/* Override the thick Franks frame on this page only, including hover/drag. */
:root[data-theme="franks"] .widget,
:root[data-theme="franks"] .widget:is(:hover, :focus-visible) {
  border: 1px solid #153754;
  border-radius: 16px;
  background: linear-gradient(125deg, #071d3a80, #031125cc);
  box-shadow: none;
  transform: none;
}
:root[data-theme="franks"] .widget::before { content: none; display: none; }
.content-widget { padding: 0; min-width: 0; min-height: 0; text-align: left; cursor: default; }
.widget:has(> .widget-content) { container-type: size; }
.widget-content { width: 100%; height: 100%; min-height: 0; padding: 12px 17px; position: relative; overflow: hidden; border-radius: 15px; }
.widget-content:not(.content-welcome) { display: flex; flex-direction: column; }
.widget-content > .ev-heading { flex-shrink: 0; margin-bottom: 6px; }
.widget-content > :is(.score-body, .prizes-body, .co2-body) { flex: 1; min-height: 0; }
.ev-heading { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.ev-heading h2 { color: var(--ev-text); font-size: 12px; line-height: 1.2; font-weight: 500; margin: 0; }
.ev-icon { display: inline-block; width: 22px; height: 22px; flex-shrink: 0; fill: none; vertical-align: middle; }
.widget-content h3 { font-size: 14px; font-weight: 500; line-height: 1.25; color: var(--ev-text); }
.widget-content p { font-size: 10px; line-height: 1.5; color: var(--ev-text); margin: 6px 0 10px; }
.ev-primary { display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 9px 13px; border: 1px solid #258dff; border-radius: 7px; background: linear-gradient(135deg, #008dff, #0664df); color: #fff; font-size: 10px; font-weight: 500; text-decoration: none; cursor: pointer; }
.ev-primary:hover { filter: brightness(1.15); }
.ev-compact { font-size: 9px; padding: 6px 9px; gap: 7px; }
.ev-link { display: inline-flex; align-items: center; gap: 10px; color: #32baff; font-size: 11px; text-decoration: none; }
.ev-link:hover { color: #a7e7ff; }
.ev-icon-link { display: inline-flex; color: #8eb6e8; text-decoration: none; }
.ev-icon-link > span { display: none; }
.ev-icon-link .ev-icon { width: 15px; height: 15px; }
.ev-tag { display: inline-block; font-size: 8px; line-height: 1.2; white-space: nowrap; color: #8fe8b8; border: 1px solid #37665670; padding: 3px 5px; border-radius: 5px; background: #1c44332e; }
.ev-tag.violet { color: #c191ff; background: #55336d33; border-color: #9364c64d; }

/* Content scales with the actual tile, not just the browser width. */
.content-welcome { padding: clamp(20px, 4cqw, 28px); background: radial-gradient(ellipse at 85% 55%, #074d9b6e, transparent 63%), linear-gradient(120deg, #040f23, #041c3a); isolation: isolate; }
.welcome-copy { position: relative; z-index: 4; width: 54%; height: calc(100% - 30px); display: flex; flex-direction: column; align-items: flex-start; justify-content: center; pointer-events: none; }
.welcome-copy button { pointer-events: auto; }
.welcome-copy h1 { margin: 11px 0 10px; font-size: clamp(17px, min(4.5cqw, 8.5cqh), 29px); font-weight: 600; line-height: 1.15; letter-spacing: -.025em; color: var(--ev-text); }
.welcome-copy h1 em { font-style: normal; color: #08b9ff; }
.welcome-copy p { font-size: clamp(9px, 1.65cqw, 10.5px); line-height: 1.55; max-width: 235px; margin: 0 0 14px; text-shadow: 0 2px 12px #000; }
.welcome-actions { display: flex; align-items: center; gap: 12px; }
.welcome-play { display: flex; align-items: center; gap: 6px; color: var(--ev-text); text-decoration: none; font-size: 8px; line-height: 1.4; }
.welcome-play .ev-icon { width: 28px; height: 28px; padding: 7px; border: 1px solid #6ba1d77d; border-radius: 50%; }
.orbital-scene { position: absolute; right: 0; top: 46%; width: 58%; aspect-ratio: 4 / 3; transform: translateY(-50%); overflow: visible; clip-path: inset(0 0 -40px 0); isolation: isolate; z-index: 1; }
.orbital-track { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke: #62a9df; stroke-width: .8; stroke-dasharray: 2 7; opacity: .24; pointer-events: none; }
.orbital-earth { position: absolute; z-index: 2; width: 60%; aspect-ratio: 1; left: 70%; top: 45%; transform: translate(-50%, -50%); border-radius: 50%; overflow: hidden; background: #06182a; box-shadow: -3px -1px 18px #1689ea35; }
.widget .orbital-earth img { position: absolute; width: 118%; height: 118%; max-width: none; max-height: none; top: -9%; left: -9%; object-fit: contain; transform: rotate(-20deg); border-radius: 0; }
.orbital-earth::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: linear-gradient(115deg, transparent 45%, #000b); pointer-events: none; }
.satellite { position: absolute; display: grid; place-items: center; width: clamp(38px, 8cqw, 58px); height: 44px; padding: 0; background: none; border: 0; color: var(--sat-color); cursor: pointer; transform: translate(-50%, -50%) scale(var(--sat-scale, 1)); will-change: left, top; }
.satellite svg { width: 100%; height: 100%; overflow: visible; transform: rotate(var(--sat-turn, -16deg)); filter: drop-shadow(0 0 3px #000); }
.satellite-label { position: absolute; top: calc(100% + 1px); left: calc(50% + var(--label-shift, 0px)); transform: translateX(-50%); width: max-content; padding: 2px 5px; border-radius: 4px; background: #000; color: #fff; font-size: clamp(9px, 1.7cqw, 11px); font-weight: 500; line-height: 1.2; white-space: nowrap; }
.satellite:hover svg, .satellite:focus-visible svg { filter: drop-shadow(0 0 4px var(--sat-color)); }
.orbit-controls { position: absolute; z-index: 5; right: 16px; bottom: 12px; display: flex; gap: 4px; }
.orbit-controls button { display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: var(--ev-text); font-size: 15px; cursor: pointer; }
.orbit-controls button:hover, .orbit-controls button:focus-visible { color: white; background: #0006; }
.orbit-controls .orbit-step { font-size: 23px; }

.score-body { display: flex; align-items: center; justify-content: center; gap: 13px; }
.score-gauge { position: relative; width: min(40%, 108px, 80cqh); flex-shrink: 0; }
.score-gauge > svg { display: block; width: 100%; overflow: visible; }
.gauge-track, .gauge-progress { fill: none; stroke-width: 8; stroke-linecap: round; }
.gauge-track { stroke: #173457; }.gauge-progress { stroke: #008dff; stroke-dasharray: 0 100; }
.score-number { position: absolute; inset: 25% 0 0; display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.score-number .ev-icon { color: #00adff; width: 12px; height: 12px; margin-bottom: 2px; }
.score-number strong { font-size: clamp(14px, 5.5cqw, 21px); font-weight: 600; letter-spacing: -.03em; }
.score-number > span { margin-top: 2px; font-size: 7px; color: var(--ev-text); }
.score-detail { flex: 1; min-width: 0; max-width: 115px; }
.score-detail p { font-size: 9px; margin: 6px 0; }
.score-detail progress { display: block; width: 100%; height: 3px; border: 0; border-radius: 5px; background: #1d3656; accent-color: #0094ff; }
.score-detail progress::-webkit-progress-bar { background: #1d3656; border-radius: 5px; }
.score-detail progress::-webkit-progress-value { background: #0094ff; border-radius: 5px; }
.prizes-body { position: relative; display: flex; align-items: center; justify-content: space-between; }
.prizes-body > div { position: relative; z-index: 1; }
.prizes-body h3 { font-size: 14px; }.prizes-body p { font-size: 9px; margin: 5px 0 7px; }
.widget .gift-art { position: absolute; width: 38%; height: auto; max-width: 112px; max-height: 100%; right: 0; top: 50%; object-fit: contain; border-radius: 0; transform: translateY(-50%); }
.content-prizes { background: radial-gradient(ellipse at 85% 70%, #25277844, transparent 68%); }
/* Blend only the dark screenshot backdrop; retain the original neon artwork. */
.content-prizes, .content-co2-footprint { background-color: #0a1a30; isolation: isolate; }
.reference-art {
  mix-blend-mode: lighten;
  /* Fade only the narrow outer margins, not the neon contours. Two intersecting
     linear masks soften all four edges and corners without an oval-shaped crop.
     Keep the original image files intact; the percentages scale with the tile. */
  --reference-edge-mask:
    linear-gradient(to right, transparent, #000 8%, #000 92%, transparent),
    linear-gradient(to bottom, transparent, #000 5%, #000 95%, transparent);
  -webkit-mask-image: var(--reference-edge-mask);
  mask-image: var(--reference-edge-mask);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

/* Reference CO₂ comparison, compressed to one grid row; no details button. */
.content-co2-footprint { padding-top: 10px; padding-bottom: 10px; }
.co2-example { font-size: 7px; color: var(--ev-text); }
.co2-body { display: flex; align-items: center; gap: 16px; }
.co2-data { flex: 1; min-width: 0; }
.co2-summary { display: flex; align-items: center; gap: 12px; margin-bottom: 5px; }
.co2-summary > strong { font-size: 20px; font-weight: 500; line-height: 1.15; color: var(--ev-text); white-space: nowrap; }
.co2-summary small { font-size: 10px; font-weight: 400; }
.co2-summary .ev-tag { font-size: 7px; padding: 3px 5px; }
.co2-comparison { display: grid; gap: 5px; }
.co2-caption { font-size: 8px; line-height: 1; margin-bottom: 1px; color: var(--ev-text); }
.co2-row { display: grid; grid-template-columns: 102px minmax(0, 1fr); align-items: center; gap: 10px; font-size: 9px; line-height: 1; color: var(--ev-text); }
.co2-bar-area { display: flex; align-items: center; gap: 8px; min-width: 0; padding-right: 34px; }
.co2-bar-area i { display: block; flex: 0 0 var(--bar-width); height: 5px; border-radius: 4px; }
.co2-bar-area > span { flex-shrink: 0; white-space: nowrap; font-size: 8px; color: var(--ev-text); }
.co2-row--you i { background: linear-gradient(90deg, #499f29, #68c643); }.co2-row--you .co2-bar-area > span { color: #92eaaa; }
.co2-row--friends i { background: linear-gradient(90deg, #063c99, #0759cb); }.co2-row--average i { background: #474d53; }
.widget .co2-art { flex: 0 0 auto; width: 76px; height: 112px; max-height: 100%; object-fit: contain; border-radius: 0; }
.widget.edit-mode .widget-content { opacity: .65; }
.widget-delete-btn { z-index: 10; }

@container (max-width: 240px) {
  .ev-heading h2 { font-size: 10px; }
  .ev-tag { font-size: 7px; padding: 2px 4px; }
  .prizes-body h3 { font-size: 12px; }
  .prizes-body p { font-size: 8px; margin: 4px 0 6px; }
  .prizes-body .ev-compact { font-size: 8px; padding: 5px 7px; }
  .score-detail p { font-size: 8px; }
}

/* Lightweight app windows keep module navigation inside this variant. */
.app-window { position: fixed; inset: 0; margin: auto; width: min(1100px, 94vw); height: 88dvh; max-width: none; max-height: 96dvh; padding: 0; border: 1px solid #2b5784; border-radius: 14px; color: var(--ev-text); background: #081629; overflow: hidden; z-index: 3000; }
.app-window[open] { display: flex; flex-direction: column; }.app-window.maximized { width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; }
dialog::backdrop { background: #010711b8; backdrop-filter: blur(8px); }
.window-titlebar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 13px; border-bottom: 1px solid #1e395b; }
.window-titlebar h2 { font-size: 13px; font-weight: 500; }.window-controls { display: flex; gap: 5px; }
.window-titlebar { flex-shrink: 0; }
.window-controls > * { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 30px; border-radius: 5px; border: 0; background: #132c49; color: var(--ev-text); text-decoration: none; cursor: pointer; }
.window-controls .window-close:hover { background: #973748; color: white; }
#app-frame { width: 100%; flex: 1; border: 0; background: #0d182a; }
.sat-reader { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: clamp(18px, 4vw, 42px); background: radial-gradient(ellipse at top right, #16375366, transparent 65%), #081629; }
.sat-reader-top { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; color: var(--ev-text); font-size: 11px; }
.sat-reader-channel { display: flex; align-items: center; gap: 8px; color: var(--sat-color); }
.sat-reader-channel i { width: 7px; height: 7px; background: currentColor; border-radius: 50%; }
.sat-reader-notice { color: #92edba; font-size: 13px; margin-top: 14px; }
.sat-reader-notice:empty { margin: 0; }
.sat-article, .sat-exhausted { max-width: 760px; margin: 25px auto 0; }
.sat-article h3, .sat-exhausted h3 { font-size: clamp(23px, 3vw, 35px); font-weight: 500; line-height: 1.18; color: var(--ev-text); margin: 8px 0 23px; }
.sat-kicker { font-size: 11px; color: var(--sat-color); letter-spacing: .02em; }
.sat-level { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; font-size: 12px; color: var(--ev-text); margin-bottom: 22px; }
.sat-level select { max-width: 100%; border: 1px solid #294665; border-radius: 6px; color: var(--ev-text); padding: 8px; background: #122840; font: inherit; }
.sat-paragraphs p, .sat-exhausted p { font-size: 15px; line-height: 1.75; color: var(--ev-text); margin-bottom: 15px; }
.sat-visual { display: flex; align-items: center; justify-content: center; gap: 25px; padding: 20px; margin: 0 0 24px; min-height: 160px; border: 1px solid #29415b; border-radius: 12px; background: #102d35; color: #87dcb5; }
.sat-visual svg { width: 40%; max-width: 220px; }
.sat-visual figcaption { display: flex; flex-direction: column; gap: 6px; }
.sat-visual strong { font-size: clamp(22px, 3vw, 34px); font-weight: 500; }
.sat-visual span { font-size: 11px; color: var(--ev-text); }
.sat-ozone { background: #092640; }
.sat-ozone img { width: 130px; max-width: 35%; }
.sat-article video { display: block; width: 100%; max-height: 52dvh; border-radius: 10px; background: #030911; }
.sat-media-note { color: var(--ev-text); font-size: 11px; line-height: 1.6; margin: 12px 0 22px; }
.sat-reader a { color: #74c9f3; text-underline-offset: 3px; }
.sat-takeaway { border-left: 2px solid var(--sat-color); padding: 5px 0 5px 18px; margin: 24px 0; }
.sat-takeaway > span { color: var(--sat-color); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
.sat-takeaway p { font-size: 14px; line-height: 1.65; color: var(--ev-text); margin: 6px 0 0; }
.sat-source { display: grid; gap: 6px; font-size: 12px; margin: 24px 0; overflow-wrap: anywhere; }
.sat-source > span { color: var(--ev-text); font-size: 10px; }
.sat-verdict { display: inline-block; margin-bottom: 20px; color: var(--sat-color); border: 1px solid #70515e; padding: 7px 10px; border-radius: 6px; font-size: 12px; }
.sat-secondary { border: 1px solid #3c5877; border-radius: 6px; background: #14314c; color: var(--ev-text); padding: 10px 14px; font-size: 13px; cursor: pointer; }
.sat-module-stage iframe { width: 100%; height: 55dvh; border: 1px solid #294b6c; border-radius: 8px; margin-top: 16px; }
.sat-completion { border-top: 1px solid #253d55; padding-top: 20px; margin-top: 28px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 15px; }
.sat-completion > span { color: var(--ev-text); font-size: 11px; }
.sat-completion .ev-primary { font-size: 12px; padding: 11px 15px; }
.sat-completion button:disabled { background: #183b62; border-color: #315578; cursor: default; filter: none; }
.sat-editorial { max-width: 760px; margin: 25px auto 0; color: var(--ev-text); font-size: 10px; line-height: 1.5; }
.sat-exhausted > span { color: var(--sat-color); font-size: 35px; }
.sat-exhausted > a { font-size: 12px; }
.sat-archive { display: grid; gap: 9px; margin: 25px 0; }
.sat-archive button { display: flex; align-items: center; justify-content: space-between; gap: 15px; text-align: left; border: 1px solid #254562; border-radius: 8px; padding: 16px; color: var(--ev-text); background: #0d243d; font-size: 13px; cursor: pointer; }
.window-loading { position: absolute; inset: 47px 0 0; display: grid; place-items: center; background: #0a172b; color: var(--ev-text); }
.prize-dialog { position: fixed; inset: 0; margin: auto; width: min(430px, 90vw); padding: 35px; border: 1px solid #315d97; border-radius: 20px; background: #0b1930; color: var(--ev-text); text-align: center; }
.prize-dialog .ev-icon { width: 45px; height: 45px; color: #0bbcff; margin-bottom: 18px; }.prize-dialog h2 { font-size: 24px; }.prize-dialog p { font-size: 14px; line-height: 1.65; color: var(--ev-text); margin: 18px 0 24px; }
/* The shared renderer supplies inline gray text for these legacy elements. */
#comingSoonTitle, #comingSoonText, #comingSoonWidget,
.widget [id$="-trend"] { color: var(--ev-text) !important; }
.storage-note { position: fixed; left: 20px; bottom: 20px; padding: 14px; background: #273e59; color: white; border-radius: 8px; z-index: 3000; font-size: 12px; }

@media (min-width: 1024px) {
  .screen { padding-left: 15px; padding-right: 15px; }
}
@media (max-width: 600px) {
  .screen { padding-left: 12px; padding-right: 12px; }
  .widget-content { padding: 10px 12px; }
  .ev-heading h2 { font-size: 11px; }.ev-tag { font-size: 7px; padding: 2px 4px; }
  .content-welcome { padding: 20px; }.welcome-play span { display: none; }
  .welcome-copy h1 { margin: 10px 0; }.welcome-copy p { margin-bottom: 12px; }
  .welcome-copy { width: 57%; }.welcome-copy p { font-size: 8px; }
  .ev-primary { padding: 8px 11px; font-size: 9px; }.ev-compact { padding: 6px 8px; font-size: 8px; }
  .score-body { gap: 7px; }.score-detail p { font-size: 7px; margin: 5px 0; }.score-number { inset: 21% 0 0; }.score-number .ev-icon { width: 10px; height: 10px; margin-bottom: 1px; }.score-number > span { font-size: 6px; }
  .prizes-body h3 { font-size: 12px; }.prizes-body p { font-size: 8px; }
  .co2-body { gap: 7px; }.co2-summary { gap: 8px; margin-bottom: 4px; }.co2-summary > strong { font-size: 16px; }.co2-summary small { font-size: 8px; }.co2-summary .ev-tag { font-size: 6px; padding: 2px 4px; }
  .co2-comparison { gap: 4px; }.co2-caption { font-size: 7px; }.co2-row { grid-template-columns: 82px minmax(0, 1fr); gap: 6px; font-size: 7px; }.co2-bar-area { gap: 5px; padding-right: 28px; }.co2-bar-area > span { font-size: 7px; }.co2-bar-area i { height: 4px; }
  .widget .co2-art { width: 50px; height: 78px; }
  .resume-app { max-width: 85px; font-size: 10px; padding: 6px; }.shell-header-actions { right: 8px; gap: 3px; }
  .app-window { width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; }
}
@media (max-height: 850px) {
  .widget-grid { height: calc(100dvh - 78px - 20px); grid-template-rows: repeat(5, minmax(0, 1fr)); }
  .widget-content { padding-top: 10px; padding-bottom: 10px; }
  .content-welcome { padding: 20px; }
  .co2-summary > strong { font-size: 17px; }.co2-summary small { font-size: 9px; }
  .co2-summary { margin-bottom: 4px; }.co2-comparison { gap: 4px; }.widget .co2-art { height: 80px; }
  .floating-add-btn { bottom: 8px; }
}
@media (max-height: 760px) {
  .screen { overflow-y: auto; overscroll-behavior-y: contain; }
  .widget-grid { min-height: 700px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
