[hidden] { display: none !important; }
:root {
  --bg: rgba(8, 11, 20, .72);
  --bg2: rgba(18, 23, 38, .86);
  --line: rgba(160, 180, 220, .16);
  --text: #e6e9f2;
  --mute: #8c94aa;
  --acc: #9cc3ff;
  --warm: #ffcf8a;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #000; color: var(--text); overflow: hidden; overscroll-behavior: none; }
canvas#sky { position: fixed; inset: 0; width: 100%; height: 100%; touch-action: none; display: block; cursor: grab; }
canvas#sky.drag { cursor: grabbing; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

#labels { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.lbl { position: absolute; left: 0; top: 0; white-space: nowrap; font-size: 12px; color: rgba(220, 228, 245, .82);
  text-shadow: 0 0 3px #000, 0 0 6px #000; will-change: transform; }
.lbl.star { padding-left: 9px; font-size: 11.5px; }
.lbl.planet { padding-left: 11px; color: var(--warm); font-weight: 600; }
.lbl.moonlbl { padding-left: 11px; color: #f1ecdf; font-weight: 600; }
.lbl.con { transform-origin: center; color: rgba(140, 175, 255, .55); font-size: 11px; letter-spacing: .22em; text-transform: uppercase; }
.lbl.card { font-weight: 700; font-size: 15px; color: #ffb37a; letter-spacing: .05em; }
.lbl.card.main { font-size: 18px; color: #ff9a5c; }
.lbl.small { font-size: 10.5px; color: rgba(200, 210, 230, .7); padding-left: 6px; }

#reticle { position: fixed; width: 34px; height: 34px; margin: -17px 0 0 -17px; border: 1.5px solid rgba(255, 200, 120, .85);
  border-radius: 50%; pointer-events: none; box-shadow: 0 0 8px rgba(255, 180, 90, .4); }
#redmode { position: fixed; inset: 0; background: #ff2a1a; mix-blend-mode: multiply; pointer-events: none; z-index: 50; }

#loading { position: fixed; inset: 0; display: grid; place-content: center; justify-items: center; background: #02030a; z-index: 60; transition: opacity .6s; }
#loading.hide { opacity: 0; pointer-events: none; }
.spinner { width: 42px; height: 42px; border-radius: 50%; border: 2px solid #223; border-top-color: var(--acc); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#loading p { color: var(--mute); font-size: 14px; }

#top { position: fixed; top: calc(10px + var(--safe-t)); left: 10px; right: 10px; display: flex; gap: 8px; z-index: 10; pointer-events: none; }
#top > * { pointer-events: auto; }
.chip { display: flex; align-items: center; gap: 7px; height: 38px; padding: 0 13px; border-radius: 19px; background: var(--bg);
  border: 1px solid var(--line); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); font-size: 14px; max-width: 46vw; }
.chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip.icon { width: 38px; padding: 0; justify-content: center; margin-left: auto; }
#btnTime { font-variant-numeric: tabular-nums; }
.live { font-size: 9.5px; font-weight: 700; letter-spacing: .08em; color: #7dffb0; border: 1px solid rgba(125, 255, 176, .4); padding: 1px 5px; border-radius: 6px; }
.live.off { color: var(--warm); border-color: rgba(255, 207, 138, .45); }

#moonCard { position: fixed; top: calc(58px + var(--safe-t)); left: 10px; display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 6px;
  border-radius: 14px; background: var(--bg); border: 1px solid var(--line); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); z-index: 10; text-align: left; }
#moonThumb { width: 44px; height: 44px; border-radius: 50%; background: #000; }
#moonCard b { display: block; font-size: 13px; }
#moonCard small { color: var(--mute); font-size: 12px; }

#zoomBox { position: fixed; right: 10px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; align-items: center;
  background: var(--bg); border: 1px solid var(--line); border-radius: 22px; z-index: 10; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
#zoomBox button { width: 44px; height: 44px; font-size: 24px; line-height: 1; }
#fovLabel { font-size: 11px; color: var(--mute); padding: 2px 0; font-variant-numeric: tabular-nums; min-width: 44px; text-align: center; }

#bottom { position: fixed; left: 0; right: 0; bottom: 0; padding: 8px 10px calc(8px + var(--safe-b)); z-index: 10;
  background: linear-gradient(transparent, rgba(0, 0, 0, .55) 35%); }
.timebar { display: flex; align-items: center; gap: 6px; justify-content: center; margin-bottom: 8px; }
.timebar button { height: 34px; min-width: 40px; border-radius: 17px; background: var(--bg); border: 1px solid var(--line); font-size: 15px; }
.timebar .now { padding: 0 14px; font-size: 13px; }
#rateLabel { font-size: 12px; color: var(--mute); min-width: 92px; text-align: center; }
.tabs { display: flex; justify-content: space-around; max-width: 520px; margin: 0 auto; background: var(--bg); border: 1px solid var(--line);
  border-radius: 18px; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.tabs button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 7px; font-size: 11px; color: var(--mute); }
.tabs button.on { color: var(--acc); }
.tabs svg { width: 20px; height: 20px; }

.panel { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; max-height: 72vh; overflow: auto; padding: 4px 16px calc(18px + var(--safe-b));
  background: var(--bg2); border-top: 1px solid var(--line); border-radius: 20px 20px 0 0; backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  transform: translateY(105%); transition: transform .28s cubic-bezier(.2, .8, .2, 1); }
.panel.open { transform: none; }
.panel > header { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: 12px 0 6px; background: #121726; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
.panel h2 { font-size: 18px; margin: 0; font-weight: 650; }
.panel h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--mute); margin: 18px 0 8px; font-weight: 600; }
.close { font-size: 26px; width: 36px; height: 36px; color: var(--mute); }
.row { display: flex; gap: 8px; margin-top: 12px; }
.row > * { flex: 1; }
.panel button.primary, .panel button.wide, .row button { height: 42px; border-radius: 12px; background: rgba(255, 255, 255, .07); border: 1px solid var(--line); font-size: 14px; }
.panel button.primary { background: #2c4a7e; border-color: #3b5f9c; }
.panel button.wide { width: 100%; margin-top: 6px; }
.hint { color: var(--mute); font-size: 12.5px; line-height: 1.45; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 8px 0; font-size: 14px; }
.kv dt { color: var(--mute); }
.kv dd { margin: 0; font-variant-numeric: tabular-nums; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--line); font-size: 14px; cursor: pointer; }
.list li .sub { color: var(--mute); font-size: 12.5px; margin-left: auto; text-align: right; }
.list li .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.list li.below { opacity: .5; }
.moonHero { display: flex; gap: 16px; align-items: center; }
#moonBig { width: 140px; height: 140px; border-radius: 50%; background: #000; flex: none; }
.big { font-size: 20px; font-weight: 650; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal div { text-align: center; font-size: 11px; color: var(--mute); }
.cal canvas { width: 100%; aspect-ratio: 1; display: block; border-radius: 50%; }
.cal .today { color: var(--acc); font-weight: 700; }
.toggles label { display: flex; gap: 10px; align-items: center; padding: 9px 0; font-size: 14px; border-bottom: 1px solid var(--line); }
.toggles input { width: 18px; height: 18px; accent-color: #6d9cff; }
.slider { display: block; margin-top: 16px; font-size: 14px; }
.slider input { width: 100%; margin-top: 8px; accent-color: #6d9cff; }
.cities { display: flex; flex-wrap: wrap; gap: 6px; }
.cities button { padding: 8px 12px; border-radius: 16px; background: rgba(255, 255, 255, .06); border: 1px solid var(--line); font-size: 13px; }
.cities button.on { border-color: var(--acc); color: var(--acc); }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--mute); }
.field input, #searchIn { height: 42px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0, 0, 0, .35); color: var(--text); padding: 0 12px; font-size: 15px; width: 100%; }
#searchIn { margin: 6px 0 4px; }
#credits { display: none; position: fixed; right: 8px; bottom: calc(118px + var(--safe-b)); font-size: 9.5px; color: rgba(150, 160, 180, .45); z-index: 5; pointer-events: none; text-align: right; max-width: 60vw; }

@media (min-width: 900px) {
  .panel { left: auto; right: 16px; top: 64px; bottom: auto; width: 380px; max-height: calc(100vh - 210px); border-radius: 18px; border: 1px solid var(--line);
    transform: translateX(calc(100% + 30px)); }
  .panel.open { transform: none; }
  #zoomBox { right: 16px; }
  .panel.open ~ #zoomBox { right: 410px; }
  #credits { display: block; bottom: 12px; }
  #bottom { background: none; }
}
body.noui #top, body.noui #bottom, body.noui #moonCard, body.noui #zoomBox, body.noui #credits { display: none; }
body.panelOpen #zoomBox { opacity: .35; }

/* ---------- modalità spazio ---------- */
canvas#space { position: fixed; inset: 0; width: 100%; height: 100%; touch-action: none; display: block; }
#spaceLabels { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.slbl { position: absolute; left: 0; top: 0; transform-origin: 0 50%; margin-top: -8px; white-space: nowrap; font-size: 13px; font-weight: 600;
  color: rgba(235, 238, 248, .9); text-shadow: 0 0 4px #000, 0 0 8px #000; pointer-events: auto; cursor: pointer; padding: 2px 4px; }
.slbl.moon { font-size: 11.5px; font-weight: 500; color: rgba(210, 215, 230, .8); }
.slbl.sat { font-size: 11px; font-weight: 600; color: #ffe066; }
.slbl.on { color: #ffcf8a; }
body.space #sky, body.space #labels, body.space #reticle, body.space #moonCard, body.space .tabs, body.space #credits { display: none; }
body.space #space { display: block; }
#spaceBar { margin: 0 auto; max-width: 720px; }
#spaceBar .chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: none; }
#spaceBar .chips::-webkit-scrollbar { display: none; }
#spaceBar .chips button { flex: none; display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 16px; background: var(--bg);
  border: 1px solid var(--line); font-size: 13px; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
#spaceBar .chips button.on { border-color: var(--warm); color: var(--warm); }
#spaceBar .chips i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
#spaceBar .row2 { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
#spaceBar .back { height: 40px; padding: 0 16px; border-radius: 14px; background: #2c4a7e; border: 1px solid #3b5f9c; font-size: 14px; }
#spaceDist { font-size: 12px; color: var(--mute); text-align: right; }
.facts { margin-top: 10px; font-size: 14px; line-height: 1.5; color: #d5d9e6; }
.facts ul { margin: 6px 0 0; padding-left: 18px; color: var(--mute); font-size: 13px; }
.badge { display: inline-block; font-size: 11px; padding: 2px 7px; border-radius: 8px; border: 1px solid var(--line); color: var(--mute); margin-left: 6px; }
.badge.ok { color: #7dffb0; border-color: rgba(125, 255, 176, .4); }
.lbl.sat { padding-left: 8px; color: #ffe066; font-size: 11.5px; font-weight: 600; }
#spaceBar .info { height: 40px; padding: 0 14px; border-radius: 14px; background: var(--bg); border: 1px solid var(--warm); color: var(--warm); font-size: 14px; }
.slbl.cmp { white-space: pre; text-align: center; font-size: 12px; line-height: 1.3; min-width: 60px; }

/* ---------- novità: barra superiore, AR, tour, oculare, eventi ---------- */
#top .spacer { flex: 1; }
#top .chip.icon { margin-left: 0; }
#arVideo { position: fixed; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
body.arcam canvas#sky { background: transparent; }
#arBar { position: fixed; top: calc(56px + var(--safe-t)); left: 50%; transform: translateX(-50%); z-index: 12; display: flex; gap: 6px; align-items: center;
  padding: 6px; border-radius: 16px; background: var(--bg); border: 1px solid var(--line); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); max-width: 96vw; flex-wrap: wrap; justify-content: center; }
#arBar span { font-size: 12px; color: var(--mute); padding: 0 6px; }
#arBar button { height: 34px; padding: 0 12px; border-radius: 12px; background: rgba(255,255,255,.07); border: 1px solid var(--line); font-size: 13px; }
#arBar button.on { border-color: var(--acc); color: var(--acc); }
#arBar button.primary { background: #2c4a7e; border-color: #3b5f9c; }
body.ar #moonCard, body.ar #zoomBox { display: none; }
#tourCard { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(150px + var(--safe-b)); width: min(520px, 94vw); z-index: 25;
  padding: 12px 14px; border-radius: 16px; background: var(--bg2); border: 1px solid var(--line); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
#tourCard .th { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
#tourCard b { font-size: 16px; }
#tourCard #tourCount { font-size: 12px; color: var(--mute); }
#tourCard p { margin: 6px 0 2px; font-size: 14px; line-height: 1.45; color: #d5d9e6; max-height: 30vh; overflow: auto; }
#tourCard .row { margin-top: 8px; }
#tourCard .row button { height: 38px; border-radius: 12px; background: rgba(255,255,255,.07); border: 1px solid var(--line); font-size: 14px; }
body.touring #bottom .tabs { display: none; }
#eyepiece { position: fixed; inset: 0; pointer-events: none; z-index: 4; }
#eyepiece .ring { position: absolute; left: 50%; top: 50%; width: var(--d, 90vmin); height: var(--d, 90vmin); transform: translate(-50%, -50%); border-radius: 50%;
  box-shadow: 0 0 0 200vmax #000, inset 0 0 40px 12px rgba(0,0,0,.9); }
#eyeInfo { position: fixed; top: calc(58px + var(--safe-t)); right: 10px; z-index: 11; font-size: 12px; color: #ffcf8a; background: var(--bg); padding: 6px 10px;
  border-radius: 12px; border: 1px solid var(--line); max-width: 60vw; text-align: right; }
body.eye #moonCard { display: none; }
#toast { position: fixed; left: 50%; top: calc(64px + var(--safe-t)); transform: translateX(-50%); z-index: 70; background: var(--bg2); border: 1px solid var(--line);
  padding: 10px 16px; border-radius: 14px; font-size: 14px; max-width: 90vw; text-align: center; }
.menuGrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 6px 0; }
.menuGrid button { height: 46px; border-radius: 12px; background: rgba(255,255,255,.06); border: 1px solid var(--line); font-size: 14px; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 54px; margin: 8px 0 2px; }
.bars div { flex: 1; border-radius: 3px 3px 0 0; position: relative; min-width: 8px; }
.bars span { position: absolute; bottom: -16px; left: 50%; transform: translateX(-50%); font-size: 9.5px; color: var(--mute); }
.bars + .hint { margin-top: 20px; }
.evMonth { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--mute); padding: 14px 2px 4px; border: 0 !important; cursor: default !important; }
.list li .ic { width: 26px; text-align: center; font-size: 17px; flex: none; color: var(--warm); }
.list li.imp b { color: #ffcf8a; }
.list li .go { margin-left: 6px; font-size: 16px; padding: 4px 8px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.05); }
.lbl.dso { padding-left: 4px; color: rgba(170, 200, 255, .78); font-size: 11px; }
.lbl.rad { color: #ffd84a; font-size: 11px; font-weight: 600; transform-origin: center; }

.cities.wx button.on, #qualityList button.on { border-color: var(--acc); color: var(--acc); }
.legend { display: flex; justify-content: space-between; font-size: 10.5px; color: #10131c; border-radius: 6px; padding: 3px 6px; margin-top: 6px; font-weight: 600; }
.legend.temp { background: linear-gradient(90deg, #7333bf, #2659f2, #8cd9ff, #59d973, #fad940, #f25926, #990d1a); }
.legend.rain { background: linear-gradient(90deg, #338cff, #1ad959, #ffd926, #f23333 75%, #ebe0ff 75%); }

/* ---------------------------------------------------------------- modalità studio */
#studyCanvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 40; display: block; background: #000; }
#study { position: fixed; inset: 0; z-index: 45; pointer-events: none; display: flex; flex-direction: column; align-items: center;
  padding: calc(10px + var(--safe-t)) 12px calc(14px + var(--safe-b)); }
#study > *, #study .sheet { pointer-events: auto; }
body.studying #top, body.studying #bottom, body.studying #moonCard, body.studying #zoomBox, body.studying #credits,
body.studying #spaceBar, body.studying #spaceLabels, body.studying .panel { display: none !important; }
.stTop { display: flex; justify-content: space-between; width: 100%; gap: 8px; }
.stTimer { position: relative; width: min(46vw, 230px); aspect-ratio: 1; margin-top: 8px; }
.stTimer .ring { width: 100%; height: 100%; filter: drop-shadow(0 2px 10px rgba(0,0,0,.6)); }
.stTimer circle { fill: none; stroke-width: 5; }
.stTimer .bgc { stroke: rgba(255,255,255,.14); fill: rgba(5,8,16,.45); }
.stTimer .fg { stroke: #ff8a5c; stroke-linecap: round; stroke-dasharray: 339.29; transition: stroke-dashoffset .3s linear, stroke .5s; }
.stTimer .fg.brk { stroke: #7dd6a8; }
.stCenter { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-shadow: 0 1px 6px #000; }
#stPhase { font-size: 12px; color: var(--mute); letter-spacing: .04em; text-transform: uppercase; }
#stTime { font-size: clamp(38px, 12vw, 58px); font-weight: 300; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
#stSub { margin-top: 8px; text-align: center; font-size: 14px; color: #dfe6f5; text-shadow: 0 1px 6px #000; min-height: 36px; max-width: 520px; }
#stSub small { color: var(--warm); font-size: 12.5px; }
.stCtrl { display: flex; gap: 18px; align-items: center; margin-top: 4px; }
.stCtrl button { width: 48px; height: 48px; border-radius: 50%; background: var(--bg); border: 1px solid var(--line); font-size: 20px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.stCtrl .play { width: 64px; height: 64px; font-size: 24px; background: rgba(255,138,92,.22); border-color: rgba(255,138,92,.6); }
.stDock { margin-top: auto; display: flex; gap: 6px; padding: 6px; border-radius: 20px; background: var(--bg); border: 1px solid var(--line);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.stDock button { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 70px; padding: 6px 0; border-radius: 14px; font-size: 20px; }
.stDock button span { font-size: 11px; color: var(--mute); }
#study.calm .stTop, #study.calm .stCtrl, #study.calm .stDock { opacity: 0; transition: opacity 1.2s; }
#study.calm .stTimer { opacity: .75; transition: opacity 1.2s; }
#study .stTop, #study .stCtrl, #study .stDock, #study .stTimer { transition: opacity .3s; }
#stMusicBox { position: fixed; left: 10px; bottom: calc(88px + var(--safe-b)); width: min(360px, calc(100vw - 20px)); background: var(--bg2);
  border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
#stMusicBox .bar { display: flex; align-items: center; gap: 6px; padding: 4px 6px 4px 12px; font-size: 12px; color: var(--mute); }
#stMusicBox .bar span { flex: 1; }
#stMusicBox .bar button { width: 30px; height: 26px; border-radius: 8px; }
#stMusicBox iframe { display: block; width: 100%; border: 0; }
#stMusicBox.mini #stMusicFrame { height: 0; overflow: hidden; }
#study .sheet { position: fixed; left: 0; right: 0; bottom: 0; max-height: 78vh; overflow: auto; padding: 4px 16px calc(18px + var(--safe-b));
  background: var(--bg2); border-top: 1px solid var(--line); border-radius: 20px 20px 0 0; backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  transform: translateY(105%); transition: transform .28s; z-index: 2; }
#study .sheet.open { transform: none; }
#study .sheet header { display: flex; align-items: center; justify-content: space-between; }
#study .sheet h2 { font-size: 17px; margin: 12px 0 8px; }
#study .sheet .close { width: 36px; height: 36px; font-size: 22px; }
.stList { display: flex; flex-direction: column; gap: 8px; }
.stList button { text-align: left; padding: 11px 13px; border-radius: 12px; background: rgba(255,255,255,.05); border: 1px solid var(--line); }
.stList button small { display: block; color: var(--mute); font-size: 12.5px; margin-top: 3px; }
.stList button.on, .stGrid button.on { border-color: var(--acc); color: var(--acc); }
.stGrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stGrid button { min-height: 44px; padding: 6px 8px; border-radius: 12px; background: rgba(255,255,255,.05); border: 1px solid var(--line); font-size: 13.5px; }
.vol { display: flex; align-items: center; gap: 8px; margin: 14px 0 4px; }
.vol input { flex: 1; accent-color: #6d9cff; }
.stIn { display: flex; gap: 8px; margin-top: 12px; }
.stIn input { flex: 1; min-width: 0; height: 42px; padding: 0 12px; border-radius: 12px; background: rgba(255,255,255,.06); border: 1px solid var(--line); color: var(--text); font-size: 15px; }
.stIn button { padding: 0 16px; border-radius: 12px; background: rgba(156,195,255,.18); border: 1px solid var(--acc); }
.stNums { margin-top: 10px; }
.stNums label { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; font-size: 14px; border-bottom: 1px solid var(--line); }
.stNums input { width: 64px; height: 34px; text-align: center; border-radius: 9px; background: rgba(255,255,255,.06); border: 1px solid var(--line); color: var(--text); font-size: 15px; }
.wideBtn { width: 100%; height: 44px; margin-top: 8px; border-radius: 12px; background: rgba(255,255,255,.05); border: 1px solid var(--line); }
.menuGrid .wide { grid-column: 1 / -1; }
@media (min-width: 900px) {
  #study .sheet { left: auto; right: 16px; bottom: 100px; width: 380px; border-radius: 18px; border: 1px solid var(--line); transform: translateX(120%); }
  #study .sheet.open { transform: none; }
  .stTimer { width: 250px; margin-top: 4vh; }
}

/* ---------------------------------------------------------------- font "spaziale" e PWA */
@font-face { font-family: 'Space Grotesk'; src: url(../fonts/space-grotesk-latin-300-normal.woff2) format('woff2'); font-weight: 300; font-display: swap; }
@font-face { font-family: 'Space Grotesk'; src: url(../fonts/space-grotesk-latin-500-normal.woff2) format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Space Grotesk'; src: url(../fonts/space-grotesk-latin-700-normal.woff2) format('woff2'); font-weight: 700; font-display: swap; }
.panel h2, #study .sheet h2, #stTime, .instHead b { font-family: 'Space Grotesk', system-ui, sans-serif; }
.panel h2 { font-weight: 500; letter-spacing: .01em; }
#stTime { font-weight: 300; }

/* schermata di caricamento: la stessa immagine della schermata di avvio dell'app */
#loading { display: block; background: #05071a url(../img/splash/splash-wide-1920x1080.jpg) center / cover no-repeat; }
@media (max-aspect-ratio: 1/1) { #loading { background-image: url(../img/splash/splash-2048x2732.jpg); } }
@media (max-aspect-ratio: 3/5) { #loading { background-image: url(../img/splash/splash-1242x2208.jpg); } }
@media (max-aspect-ratio: 1/2) { #loading { background-image: url(../img/splash/splash-1290x2796.jpg); } }
#loading.hide { opacity: 0; transition: opacity .9s ease .1s; }
.ldBox { position: absolute; left: 0; right: 0; bottom: calc(9vh + var(--safe-b)); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.ldBar { width: min(46vw, 220px); height: 2px; border-radius: 2px; background: rgba(160, 180, 255, .16); overflow: hidden; }
.ldBar i { display: block; width: 40%; height: 100%; border-radius: 2px; background: linear-gradient(90deg, transparent, #ffd7a8, #fff, #9cc3ff, transparent);
  animation: ld 1.6s cubic-bezier(.45, 0, .55, 1) infinite; }
@keyframes ld { from { transform: translateX(-110%); } to { transform: translateX(260%); } }
#loading p { margin: 0; font: 400 12.5px 'Space Grotesk', system-ui, sans-serif; letter-spacing: .08em; color: rgba(200, 210, 240, .7); }

/* invito a installare */
#installPill { position: fixed; z-index: 35; left: 50%; bottom: calc(150px + var(--safe-b)); transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 6px; border-radius: 26px; background: var(--bg2);
  border: 1px solid rgba(255, 207, 138, .45); box-shadow: 0 6px 28px rgba(0, 0, 0, .5), 0 0 24px rgba(255, 190, 120, .15);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); font: 500 14px 'Space Grotesk', system-ui, sans-serif; color: #fff;
  animation: pillIn .6s cubic-bezier(.2, .9, .3, 1.2); white-space: nowrap; }
#installPill img { width: 36px; height: 36px; border-radius: 10px; }
#installPill i { font-style: normal; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: var(--mute); font-size: 18px; }
@keyframes pillIn { from { opacity: 0; transform: translate(-50%, 20px) scale(.9); } }
body.studying #installPill, body.space #installPill, body.panelOpen #installPill { display: none; }
#updateBar { position: fixed; z-index: 80; left: 50%; top: calc(58px + var(--safe-t)); transform: translateX(-50%); display: flex; align-items: center; gap: 12px;
  padding: 6px 6px 6px 14px; border-radius: 22px; background: var(--bg2); border: 1px solid var(--line); font-size: 14px; white-space: nowrap;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 6px 24px rgba(0, 0, 0, .45); animation: pillIn .5s ease; }
#updateBar button { height: 32px; padding: 0 14px; border-radius: 16px; background: linear-gradient(135deg, #ffb37a, #ff8a5c); color: #1a0d05; font-weight: 600; }
.instHead { display: flex; align-items: center; gap: 14px; margin: 6px 0 10px; }
.instHead img { border-radius: 20px; box-shadow: 0 6px 22px rgba(80, 120, 255, .35); }
.instHead b { display: block; font-size: 20px; font-weight: 500; }
.instHead span { color: var(--mute); font-size: 13.5px; }
.instFeat { list-style: none; padding: 0; margin: 0 0 12px; }
.instFeat li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; font-size: 14px; border-bottom: 1px solid var(--line); }
.instFeat i { font-style: normal; width: 22px; text-align: center; }
.instSteps { margin: 4px 0 8px; padding-left: 22px; font-size: 14.5px; line-height: 1.5; }
.instSteps li { padding: 6px 0; }
.ios-share { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: rgba(10, 132, 255, .18); vertical-align: middle; }
.ios-share svg { width: 17px; height: 17px; fill: none; stroke: #4aa3ff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ios-add { display: inline-grid; place-items: center; width: 22px; height: 22px; border: 1.5px solid var(--text); border-radius: 6px; font-size: 13px; vertical-align: middle; }
/* app installata: niente barra del browser, rispetta le aree sicure anche ai lati */
@media (display-mode: standalone), (display-mode: fullscreen) {
  #top { left: calc(10px + env(safe-area-inset-left, 0px)); right: calc(10px + env(safe-area-inset-right, 0px)); }
  body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
  input, textarea { -webkit-user-select: text; user-select: text; }
}

.about { display: flex; align-items: center; gap: 12px; margin: 16px 0 6px; padding: 12px; border-radius: 14px; background: rgba(255,255,255,.04); border: 1px solid var(--line); }
.about img { border-radius: 14px; }
.about b { display: block; font: 500 17px 'Space Grotesk', system-ui, sans-serif; }
.about span { display: block; font-size: 12.5px; color: var(--mute); }
.about .copy { color: #cfd6ea; margin-top: 2px; }
