/*
Pizza Dough Compass - pizza dough yeast, timing and preferment calculator
Copyright (C) 2026 Massimiliano Lentini
SPDX-License-Identifier: GPL-3.0-only

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, version 3 of the License.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <https://www.gnu.org/licenses/>.
*/
/* Look pizzeria: pomodoro, basilico, crosta dorata, mozzarella */
:root{
  color-scheme:light;
  --ink:#2b1a14; --soft:#7a6558; --muted:#a08f80;
  --tomato:#b3261e; --tomato-2:#d13a26; --lemon:#f2b13c; --lemon-tint:#fff1cf;
  --ember:#e07b1a;   /* ambiente (usato anche da pizzadoughcompass.js) */
  --frost:#3d8fd1;   /* frigo (usato anche da pizzadoughcompass.js) */
  --paper:#fbf4e6; --tile:#ffffff; --grout:#e8d9c0; --grout-2:#d2b98f;
  --basil:#2f7a3a; --basil-tint:#e6f3ea; --danger:#a8321a; --danger-tint:#fdece7;
  --serif:Georgia,"Noto Serif","Times New Roman",serif;
  --sans:system-ui,-apple-system,"Roboto","Segoe UI",sans-serif;
  --r:14px;
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;min-width:320px;background:var(--paper);color:var(--ink);font:16px/1.5 var(--sans);-webkit-tap-highlight-color:transparent}
.wrap{max-width:720px;margin:0 auto;padding:0 16px calc(48px + env(safe-area-inset-bottom))}

/* Intestazione */
header{margin:0 -16px 0;padding:calc(22px + env(safe-area-inset-top)) 20px 22px;background:var(--tomato);color:#fff;position:relative}
header::after{content:"";position:absolute;left:0;right:0;bottom:-7px;height:14px;
  background:radial-gradient(circle at 50% 50%,var(--lemon) 0 3px,transparent 3.5px) 0 0/16px 14px repeat-x}
h1{margin:0 0 6px;font:700 clamp(28px,7.5vw,40px)/1.05 var(--serif);letter-spacing:-.02em}
.lede{margin:0;max-width:44ch;color:#f9d9cc;font-size:14px}

/* Schede */
.tabs{position:sticky;top:0;z-index:5;display:flex;gap:6px;margin:24px -16px 16px;padding:8px 16px;background:var(--paper);border-bottom:1px solid var(--grout)}
.tab{flex:1;min-height:46px;padding:8px 10px;border:1.5px solid var(--grout-2);border-radius:var(--r);background:var(--tile);color:var(--tomato);font:700 14px var(--sans);cursor:pointer}
.tab.active{background:var(--tomato);border-color:var(--tomato);color:#fff}
.tab:active,.chip:active{transform:scale(.97)}
.tab:focus-visible,.chip:focus-visible,input:focus-visible{outline:3px solid var(--lemon);outline-offset:2px}

/* Modulo */
.card{padding:18px;border:1.5px solid var(--grout);border-radius:var(--r);background:var(--tile)}
.opt-row{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px;margin-bottom:16px;padding-bottom:16px;border-bottom:1.5px dashed var(--grout)}
.opt-label{font-weight:700;font-size:14px}
.chips{display:flex;gap:6px;flex-wrap:wrap}
.chip{min-height:40px;padding:8px 16px;border:1.5px solid var(--grout-2);border-radius:999px;background:var(--tile);color:var(--tomato);font:700 13px var(--sans);cursor:pointer}
.chip.active{background:var(--lemon);border-color:var(--lemon);color:var(--ink)}
.grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.field{display:flex;flex-direction:column;gap:6px;min-width:0}
label{font-size:13px;font-weight:600;color:var(--soft)}
input[type=number]{width:100%;min-height:48px;padding:10px 12px;border:1.5px solid var(--grout-2);border-radius:10px;background:var(--paper);color:var(--ink);font:700 18px var(--sans);font-variant-numeric:tabular-nums;-moz-appearance:textfield}
input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
input[type=number]:focus{border-color:var(--tomato-2);background:#fff}
input:disabled{opacity:.5}

.info-box{display:none;margin:0 0 16px;padding:12px 14px;border-left:5px solid var(--lemon);border-radius:0 10px 10px 0;background:var(--lemon-tint);font-size:13px;color:#4a4020}
.info-box.show{display:block}
.info-box b{display:block;margin-bottom:4px;color:var(--ink)}
.fridge-panel{margin-top:20px;padding-top:18px;border-top:1.5px dashed var(--grout)}
.fridge-panel.off{opacity:.45}
.fridge-head{margin:0 0 12px;font-weight:700}
.fridge-head span{font-size:12px;font-weight:500;color:var(--soft)}
.hint{display:flex;gap:7px;margin:8px 0 0;font-size:12px;color:var(--soft)}
.hint b{color:var(--tomato-2)}
.warn{color:var(--ember);font-weight:700}
.warn-box{display:flex;gap:8px;margin-top:12px;padding:12px 14px;border:1.5px solid #f0b8a8;border-radius:var(--r);background:var(--danger-tint);color:#6b2313;font-size:13px}
.warn-box b{color:var(--danger)}
.warn-box span:empty{display:none}

/* Risultato: il pezzo forte è il riquadro cobalto */
.result{margin-top:22px}
.hero{position:relative;padding:34px 20px 26px;border-radius:var(--r);background:var(--tomato);color:#fff;text-align:center;overflow:hidden}
.hero::before{content:"";position:absolute;left:0;right:0;top:0;height:14px;
  background:radial-gradient(circle at 50% 50%,var(--lemon) 0 3px,transparent 3.5px) 0 0/16px 14px repeat-x}
.hero .cap{margin:0 0 4px;font-size:14px;color:#f9d9cc}
.hero .big{margin:0;font:700 clamp(64px,19vw,96px)/1 var(--serif);letter-spacing:-.04em;color:var(--lemon);font-variant-numeric:tabular-nums}
.hero .big span{margin-left:6px;font:700 24px var(--sans);letter-spacing:0;color:#fff}
.hero .sub{margin:8px 0 0;font-size:14px;color:#f9d9cc}
.alts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:10px}
.alt{padding:14px 10px;border:1.5px solid var(--grout);border-radius:var(--r);background:var(--tile);text-align:center}
.alt .k{margin:0 0 2px;font-size:13px;color:var(--soft)}
.alt .v{margin:0;font:700 28px/1.1 var(--serif);color:var(--tomato)}
.alt .u{font:500 13px var(--sans);color:var(--soft)}

/* Margine sovralievitazione */
.overproof{margin-top:12px;padding:14px 16px;border-radius:var(--r);border:1.5px solid;font-size:14px}
.overproof p{margin:0 0 6px}
.overproof p:last-child{margin:0}
.overproof-title{font-weight:700}
.overproof.safe{background:var(--basil-tint);border-color:#a5d2b4;color:#1f5a37}
.overproof.danger{background:var(--danger-tint);border-color:#eeb1a2;color:#7a2a17}

/* Cronologia */
.timeline,.ingredients{margin-top:12px;padding:16px;border:1.5px solid var(--grout);border-radius:var(--r);background:var(--tile)}
.timeline h3{margin:0 0 12px;font:700 17px var(--serif);color:var(--tomato)}
.bar{display:flex;height:48px;overflow:hidden;border-radius:10px;background:var(--grout)}
.seg{display:flex;min-width:0;align-items:center;justify-content:center;color:#fff;font-size:10.5px;font-weight:700;line-height:1.25;text-align:center}
.seg span{overflow:hidden;padding:0 6px;white-space:nowrap;text-overflow:ellipsis}
.seg.room{background:var(--ember)}
.seg.fridge{background:var(--frost)}
.seg.transition{background:#d6a85f;color:#382817}
.legend{display:flex;flex-wrap:wrap;gap:14px;margin-top:10px;font-size:12px;color:var(--soft)}
.legend i{display:inline-block;width:10px;height:10px;margin-right:5px;border-radius:3px;vertical-align:middle}
.idx{margin:10px 0 0;font-size:13px;color:var(--soft)}
.idx b{color:var(--ink)}

/* Ingredienti */
.ingredients{padding:6px 16px}
.ing-row{display:flex;justify-content:space-between;gap:14px;padding:12px 0;border-bottom:1.5px dashed var(--grout)}
.ing-row:last-child{border-bottom:0}
.ing-row .name{color:var(--soft)}
.ing-row .amt{font-weight:700;font-variant-numeric:tabular-nums}
.ing-row.total{color:var(--tomato);font-weight:700}
.per-panetto .ph{margin:8px 0 0;font:700 15px var(--serif);color:var(--tomato)}

.note{margin:18px 0 0;font-size:13px;color:var(--soft)}
footer{margin-top:32px;padding-top:18px;border-top:1.5px solid var(--grout);font-size:13px;color:var(--soft)}
footer h2{margin:0 0 6px;font:700 20px var(--serif);color:var(--tomato)}

@media(max-width:420px){.grid{grid-template-columns:1fr}.alt .v{font-size:24px}}
@media(prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}

/* --- Nuove funzioni --- */
[hidden]{display:none!important}
select{width:100%;min-height:48px;padding:10px 12px;border:1.5px solid var(--grout-2);border-radius:10px;background:var(--paper);color:var(--ink);font:700 16px var(--sans)}
select:disabled{opacity:.5}
fieldset{margin:14px 0 0;min-width:0;padding:18px;border:1.5px solid var(--grout);border-radius:var(--r);background:var(--tile)}
fieldset:disabled{opacity:.45}
.field.full{grid-column:1/-1}
.range{min-height:1em;font-size:11.5px;font-weight:600;color:var(--tomato-2)}
.bar{height:auto;min-height:64px}
.seg{flex-direction:column;gap:1px;min-width:66px;padding:7px 4px;font-size:12px}
.seg b{font-size:12px}.seg em{font-style:normal;font-size:13px}
.seg.pf{background:var(--basil)}.seg.fin{background:var(--tomato);min-width:80px}
.summary{margin:12px 0 0;font-size:13px;line-height:1.6}
.steps{width:100%;margin-top:12px;border-collapse:collapse;font-size:13px}
.steps th,.steps td{padding:9px 6px;border-bottom:1.5px dashed var(--grout);text-align:left;vertical-align:top}
.steps th{color:var(--soft);font-weight:600}
.steps td:nth-child(2){font-weight:700;white-space:nowrap}
.seg.fold{background:#9a5b14}
.steps small{font-weight:500;color:var(--soft)}
.lang{display:flex;gap:4px;justify-content:flex-end;margin:-6px 0 10px}
.lb{min-height:30px;padding:2px 10px;border:1.5px solid rgba(255,255,255,.45);border-radius:999px;background:transparent;color:#fff;font:700 12px var(--sans);cursor:pointer}
.lb.on{background:var(--lemon);border-color:var(--lemon);color:var(--ink)}
.page h2{margin:26px 0 8px;font:700 21px var(--serif);color:var(--tomato)}
.page p,.page li{font-size:15px}.page ul,.page ol{padding-left:22px}.page li{margin:6px 0}
.page .lede2{margin:16px 0 0;font-size:16px}
pre.f{margin:10px 0;padding:12px 14px;border:1.5px solid var(--grout);border-radius:10px;background:var(--tile);overflow-x:auto;font:12.5px/1.55 ui-monospace,Menlo,Consolas,monospace;white-space:pre}
.links{margin:14px 0 0;font-size:13px}.links a{color:var(--tomato-2);font-weight:700;text-decoration:none}

/* Correzioni dopo le schermate sul telefono */
fieldset .opt-row{margin-top:16px}
.card>.opt-row:last-child,.fridge-panel .opt-row:last-child{margin-bottom:0;padding-bottom:0;border-bottom:0}
.fridge-panel>.field.full{margin-bottom:14px}
@media(max-width:600px){
.steps,.steps tbody,.steps tr,.steps td{display:block;width:100%}
.steps tr:first-child{display:none}
.steps tr{padding:12px 0;border-bottom:1.5px dashed var(--grout)}
.steps tr:last-child{border-bottom:0}
.steps td{padding:2px 0;border:0}
.steps td:nth-child(1){font-weight:700;color:var(--tomato)}
.steps td:nth-child(2){white-space:normal;font-weight:600}
}

/* Marchio Pizza Dough Compass */
.brand{display:flex;align-items:center;gap:14px}
.brand h1{margin:0 0 4px}.brand .lede{margin:0}
.logo{flex:none;width:64px;height:64px;border-radius:22%;border:2px solid rgba(255,255,255,.6);box-shadow:0 2px 8px rgba(0,0,0,.25)}
.brand.mini{margin:0 0 12px;color:#fff;text-decoration:none;font:700 20px var(--serif)}
.brand.mini .logo{width:44px;height:44px}

input[type=datetime-local]{width:100%;min-height:48px;padding:10px 12px;border:1.5px solid var(--grout-2);border-radius:10px;background:var(--paper);color:var(--ink);font:700 16px var(--sans)}
#useNow{margin-top:10px}
.brand h1{font-size:clamp(24px,7vw,34px);line-height:1.05}

/* solo sul web */
.web-only{margin-top:32px;padding-top:26px;border-top:1.5px solid var(--grout);font-size:13px;color:var(--ink)}
/* il codice QR ha bisogno di un margine chiaro attorno (almeno 4 quadratini) e di ingrandimenti interi: 84 px × 2 + 28 px di margine per lato */
.web-only img{display:block;width:224px;height:224px;margin:0 0 10px;padding:28px;border:1.5px solid var(--grout);border-radius:10px;background:#fff;image-rendering:pixelated}
.web-only p{margin:0}
.web-only a{color:var(--tomato-2);font-weight:700}
