:root{--accent:#0f766e;--accent-2:#0d9488;--ink:#0f172a;--muted:#64748b;--line:#e2e8f0;--bg:#f8fafc;--card:#fff;--ok:#15803d;--warn:#b45309;--err:#b91c1c;--info:#1d4ed8;--radius:14px;color-scheme:light}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;background:var(--bg);color:var(--ink);font-size:16px;line-height:1.45;-webkit-text-size-adjust:100%}
a{color:var(--accent)}
.hidden{display:none!important}
.wrap{max-width:760px;margin:0 auto;padding:16px}
header.top{background:var(--accent);color:#fff;padding:14px 16px;padding-top:max(14px,env(safe-area-inset-top))}
header.top .in{max-width:760px;margin:0 auto;display:flex;gap:12px;align-items:center}
header.top img{width:44px;height:44px;border-radius:10px;background:#fff;object-fit:contain}
header.top h1{font-size:18px;margin:0;line-height:1.2}
header.top p{margin:2px 0 0;font-size:13px;opacity:.9}
.card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);padding:16px;margin:12px 0}
.card h2{font-size:17px;margin:0 0 10px}
.muted{color:var(--muted);font-size:14px}
.small{font-size:13px}
.row{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.grow{flex:1}
.btn{appearance:none;border:1px solid var(--accent);background:var(--accent);color:#fff;border-radius:10px;padding:11px 16px;font-size:15px;font-weight:600;cursor:pointer;min-height:44px;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;gap:6px}
.btn:disabled{opacity:.5;cursor:default}
.btn.sec{background:#fff;color:var(--accent)}
.btn.danger{background:#fff;color:var(--err);border-color:#fecaca}
.btn.ghost{background:transparent;border-color:transparent;color:var(--accent)}
.btn.block{width:100%}
.btn.sm{min-height:34px;padding:6px 10px;font-size:14px}
label{display:block;font-size:14px;font-weight:600;margin:10px 0 4px}
input[type=text],input[type=email],input[type=tel],input[type=password],input[type=date],input[type=time],input[type=number],input[type=url],select,textarea{width:100%;border:1px solid #cbd5e1;border-radius:10px;padding:11px 12px;font-size:16px;background:#fff;color:var(--ink)}
textarea{min-height:110px;font-family:inherit}
input:focus,select:focus,textarea:focus{outline:2px solid var(--accent-2);outline-offset:1px}
.check{display:flex;gap:10px;align-items:flex-start;font-weight:400;margin:12px 0}
.check input{width:22px;height:22px;flex:none;margin-top:1px}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(84px,1fr));gap:8px}
.slot{border:1px solid #99f6e4;background:#f0fdfa;color:#115e59;border-radius:10px;padding:10px 0;text-align:center;font-weight:700;cursor:pointer;min-height:44px;font-size:15px}
.slot.sel{background:var(--accent);color:#fff;border-color:var(--accent)}
.days{display:flex;gap:8px;overflow-x:auto;padding-bottom:6px;scroll-snap-type:x mandatory}
.day{flex:none;width:72px;border:1px solid var(--line);background:#fff;border-radius:12px;padding:8px 4px;text-align:center;cursor:pointer;scroll-snap-align:start}
.day b{display:block;font-size:20px}
.day span{display:block;font-size:12px;color:var(--muted)}
.day.sel{border-color:var(--accent);background:#f0fdfa}
.day.off{opacity:.4;cursor:default}
.svc{display:flex;justify-content:space-between;gap:8px;border:1px solid var(--line);border-radius:12px;padding:12px;margin:8px 0;cursor:pointer;background:#fff}
.svc.sel{border-color:var(--accent);background:#f0fdfa}
.pill{display:inline-block;border-radius:999px;padding:3px 10px;font-size:13px;font-weight:700;background:#e2e8f0;color:#334155}
.pill.PENDING,.pill.PROPOSED{background:#fef3c7;color:#92400e}
.pill.CONFIRMED{background:#dcfce7;color:#166534}
.pill.COMPLETED{background:#dbeafe;color:#1e40af}
.pill.REJECTED,.pill.CANCELLED,.pill.EXPIRED,.pill.NO_SHOW{background:#fee2e2;color:#991b1b}
.notice{border-radius:12px;padding:12px 14px;margin:12px 0;font-size:15px}
.notice.ok{background:#f0fdf4;border:1px solid #bbf7d0}
.notice.warn{background:#fffbeb;border:1px solid #fde68a}
.notice.err{background:#fef2f2;border:1px solid #fecaca;color:#7f1d1d}
.notice.info{background:#eff6ff;border:1px solid #bfdbfe}
.trap{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}
footer.legal{max-width:760px;margin:24px auto 40px;padding:0 16px;color:var(--muted);font-size:13px}
.prewrap{white-space:pre-wrap}
/* agenda */
.app{padding-bottom:calc(70px + env(safe-area-inset-bottom))}
.tabs{position:fixed;left:0;right:0;bottom:0;background:#fff;border-top:1px solid var(--line);display:flex;padding-bottom:env(safe-area-inset-bottom);z-index:20}
.tabs button{flex:1;border:0;background:none;padding:10px 4px;font-size:13px;color:var(--muted);font-weight:600;min-height:54px;position:relative}
.tabs button.on{color:var(--accent)}
.badge{display:inline-block;min-width:20px;padding:1px 6px;border-radius:999px;background:var(--err);color:#fff;font-size:12px;margin-left:4px}
.appt{display:flex;gap:12px;border:1px solid var(--line);border-left:5px solid #94a3b8;border-radius:12px;padding:10px 12px;margin:8px 0;background:#fff;cursor:pointer}
.appt.PENDING,.appt.PROPOSED{border-left-color:#f59e0b}
.appt.CONFIRMED{border-left-color:#16a34a}
.appt.COMPLETED{border-left-color:#2563eb}
.appt.CANCELLED,.appt.REJECTED,.appt.EXPIRED,.appt.NO_SHOW{border-left-color:#ef4444;opacity:.75}
.appt .t{font-weight:800;min-width:52px}
.appt .who{font-weight:700}
.blk{border:1px dashed #94a3b8;border-radius:12px;padding:10px 12px;margin:8px 0;background:repeating-linear-gradient(45deg,#f8fafc,#f8fafc 8px,#f1f5f9 8px,#f1f5f9 16px)}
.sheet-bg{position:fixed;inset:0;background:rgba(15,23,42,.45);z-index:40;display:flex;align-items:flex-end;justify-content:center}
.sheet{background:#fff;width:100%;max-width:640px;max-height:92vh;overflow:auto;border-radius:18px 18px 0 0;padding:16px 16px calc(20px + env(safe-area-inset-bottom))}
.sheet h3{margin:0 0 6px;font-size:19px}
.mail{display:flex;justify-content:space-between;gap:8px;font-size:14px;border-top:1px solid var(--line);padding:6px 0}
.mail .st-FAILED,.mail .st-UNCERTAIN{color:var(--err);font-weight:700}
.mail .st-SENT{color:var(--ok)}
.mail .st-RETRY,.mail .st-QUEUED,.mail .st-SENDING{color:var(--warn)}
.toast{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(80px + env(safe-area-inset-bottom));background:var(--ink);color:#fff;padding:10px 16px;border-radius:10px;z-index:60;max-width:90%;font-size:15px}
.code{font-family:ui-monospace,Menlo,Consolas,monospace;font-size:15px;background:#f1f5f9;border-radius:8px;padding:8px 10px;word-break:break-all}
.qr svg{width:220px;height:220px;display:block;margin:8px auto}
table.simple{width:100%;border-collapse:collapse;font-size:14px}
table.simple td,table.simple th{border-bottom:1px solid var(--line);padding:6px 4px;text-align:left;vertical-align:top}
@media (min-width:900px){.sheet-bg{align-items:center}.sheet{border-radius:18px}}
.row>input.grow{flex:1 1 0;min-width:0;width:auto;margin:0}
.grid>p{grid-column:1/-1;margin:0}
.pgimgs{display:flex;flex-wrap:wrap;gap:10px;margin:6px 0 10px}
.pgimg{width:104px;display:flex;flex-direction:column;gap:4px}
.pgimg img{width:104px;height:104px;object-fit:cover;border-radius:10px;border:1px solid var(--line);background:#f1f5f9}
.pgimg.logo img{object-fit:contain;background:#fff}
.pgimg .row{gap:4px}
.pgimg .btn{padding:4px 0;flex:1;min-width:0}

/* agenda: grafica rinnovata */
body.app{background:linear-gradient(180deg,#eef6f5 0,#f8fafc 220px) fixed}
header.top{background:linear-gradient(135deg,#0b5f58 0%,#0f766e 55%,#14917f 100%);box-shadow:0 2px 12px rgba(15,118,110,.25)}
header.top .in img{flex:none;padding:3px;border-radius:12px;box-shadow:0 2px 6px rgba(0,0,0,.2)}
header.top h1{font-size:19px;letter-spacing:.01em}
.card{box-shadow:0 1px 3px rgba(15,23,42,.06)}
.tabs{border-top:0;box-shadow:0 -4px 18px rgba(15,23,42,.08);border-radius:18px 18px 0 0}
.tabs button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;font-size:12px;padding:8px 4px 6px;font-weight:600}
.tabs button svg{width:24px;height:24px;padding:3px 14px;box-sizing:content-box;border-radius:999px;transition:background .15s}
.tabs button.on svg{background:#ccfbf1;color:var(--accent)}
.tabs button .badge{position:absolute;top:4px;left:calc(50% + 6px);margin:0;min-width:18px;padding:0 5px;font-size:11px;line-height:18px}
.appt{border-radius:14px;box-shadow:0 1px 3px rgba(15,23,42,.07);padding:12px 14px;transition:transform .08s}
.appt:active{transform:scale(.985)}
.appt .t{background:#f1f5f9;border-radius:10px;padding:6px 8px;text-align:center;align-self:flex-start;min-width:58px}
.appt.CONFIRMED .t{background:#dcfce7}
.appt.PENDING .t,.appt.PROPOSED .t{background:#fef3c7}
.days .day{border-radius:14px;box-shadow:0 1px 2px rgba(15,23,42,.05)}
.days .day.sel{background:var(--accent);border-color:var(--accent);color:#fff}
.days .day.sel span{color:#d1fae5}
.mi-row{display:flex;align-items:center;gap:14px;cursor:pointer;padding:14px 16px}
.mi-row:active{background:#f8fafc}
.mi{flex:none;width:44px;height:44px;border-radius:14px;display:flex;align-items:center;justify-content:center}
.mi.teal{background:#ccfbf1;color:#0f766e}.mi.blue{background:#dbeafe;color:#1d4ed8}.mi.rose{background:#ffe4e6;color:#be123c}
.mi.violet{background:#ede9fe;color:#6d28d9}.mi.amber{background:#fef3c7;color:#b45309}.mi.slate{background:#e2e8f0;color:#334155}.mi.green{background:#dcfce7;color:#15803d}
.mi-chev{color:#94a3b8;display:flex}
.mi-row b{font-size:16px}
.exercise-delivery { margin-block: 1.25rem; padding-block: .25rem 1rem; border-block-end: 1px solid rgba(110,130,145,.28); }
.exercise-content { display: grid; gap: .55rem; justify-items: start; }
.exercise-content label { display: grid; gap: .25rem; width: 100%; }
.exercise-content select { max-width: 100%; }
.exercise-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem; }
.billing-steps { display: flex; flex-wrap: wrap; gap: .35rem; list-style: none; padding: 0; margin: .25rem 0 .5rem; }
.billing-steps li { font-size: .82rem; padding: .2rem .55rem; border-radius: 999px; border: 1px solid rgba(110,130,145,.4); color: inherit; opacity: .7; }
.billing-steps li.done { background: #0f766e; border-color: #0f766e; color: #fff; opacity: 1; }
.contact-pick { margin-block: .75rem .25rem; display: grid; gap: .5rem; }

/* giorno a griglia oraria (agenda) */
.grid-day{margin:6px -4px 0}
.hour{display:flex;gap:10px;align-items:flex-start;padding:4px 0}
.hour-t{width:46px;flex:none;padding-top:16px;font-weight:700;color:var(--muted);font-size:15px;text-align:right}
.hour-c{flex:1;min-width:0}
.hour-c .appt{margin:0 0 6px;background:#ddd9fb;border-color:#c9c4f5;border-left-width:5px}
.hour-c .appt.PENDING,.hour-c .appt.PROPOSED{background:#fef3c7;border-color:#f5dd9a}
.hour-c .appt.COMPLETED{background:#dbeafe;border-color:#bfd6f7}
.slot-row{display:flex;align-items:center;gap:8px;border:1px solid var(--line);border-radius:12px;background:#fff;min-height:54px;padding:0 8px 0 0}
.slot-add{flex:1;min-height:54px;border:0;background:none;text-align:left;padding:0 14px;font-size:17px;font-weight:600;color:var(--accent);cursor:pointer}
.slot-x{flex:none;width:36px;height:36px;border-radius:50%;border:0;background:#64748b;color:#fff;font-size:17px;line-height:1;cursor:pointer}
.slot-x.undo{background:#94a3b8;font-size:20px}
.slot-row.blocked{padding-left:14px;background:repeating-linear-gradient(45deg,#f8fafc,#f8fafc 8px,#eef2f6 8px,#eef2f6 16px);border-style:dashed}
