:root{
  color-scheme:dark;
  --bg:#070a10;--bg2:#0f1828;--text:#f7f7fb;--muted:#b4bac8;--line:rgba(255,255,255,.12);
  --glass:rgba(28,34,48,.50);--glass-strong:rgba(20,24,34,.72);--accent:#eef3ff;--accent-text:#11151e;
  --danger:#ff9b9b;--radius:30px;--radius-sm:22px;--shadow:0 24px 60px rgba(0,0,0,.34);
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;min-height:100%;background:#07111c;font-family:"Palatino Linotype",Palatino,"Book Antiqua",Georgia,serif;color:var(--text)}
body{overflow-x:hidden}
button,input,select{font:inherit}
.glass{background:var(--glass);border:1px solid var(--line);box-shadow:inset 0 1px 0 rgba(255,255,255,.12),0 16px 40px rgba(0,0,0,.2);backdrop-filter:blur(28px) saturate(145%);-webkit-backdrop-filter:blur(28px) saturate(145%)}
.glass-heavy{background:var(--glass-strong);border:1px solid rgba(255,255,255,.14);box-shadow:var(--shadow);backdrop-filter:blur(34px) saturate(155%);-webkit-backdrop-filter:blur(34px) saturate(155%)}
.liquid-button{position:relative;overflow:hidden;box-shadow:inset 0 1px 0 rgba(255,255,255,.16), inset 0 -1px 0 rgba(255,255,255,.04), 0 12px 26px rgba(0,0,0,.22)}
.liquid-button::before{content:"";position:absolute;inset:0;border-radius:inherit;background:linear-gradient(180deg,rgba(255,255,255,.18),rgba(255,255,255,.06) 32%,rgba(255,255,255,.03) 66%,rgba(255,255,255,.08));pointer-events:none}
.liquid-button:active{transform:scale(.985)}
.app-shell{position:relative;z-index:1;width:min(760px,100%);margin:auto;padding:calc(env(safe-area-inset-top) + 18px) 18px 0}
.topbar{display:flex;align-items:center;justify-content:space-between;margin:2px 4px 20px}
.eyebrow{font-size:13px;font-weight:760;letter-spacing:.14em;color:var(--muted)}
h1{font-size:31px;letter-spacing:-.04em;margin:4px 0 0}
h2{font-size:27px;letter-spacing:-.03em;margin:4px 0}
.icon-button,.back-circle{width:48px;height:48px;border-radius:50%;border:1px solid var(--line);background:rgba(255,255,255,.08);color:var(--text);display:grid;place-items:center;padding:0}
.icon-button svg{width:21px;fill:none;stroke:currentColor;stroke-width:1.6}
.back-circle,.sheet-close{line-height:1}
.back-circle span{display:grid;place-items:center;width:100%;height:100%;font-size:34px;transform:translateX(-1px)}
.hero-card{min-height:310px;border-radius:36px;overflow:hidden;position:relative;background-image:linear-gradient(155deg,rgba(43,64,93,.88),rgba(16,19,28,.90));background-size:cover;background-position:center}
.hero-overlay{position:absolute;inset:0;background:linear-gradient(180deg,rgba(0,0,0,.04),rgba(0,0,0,.46))}
.hero-mark{position:absolute;z-index:1;top:22px;right:22px;width:74px;height:74px;border-radius:22px;background-position:center;background-size:cover;background-repeat:no-repeat;opacity:0;pointer-events:none;filter:saturate(.9) contrast(1.05);transition:opacity .2s ease;border:1px solid rgba(255,255,255,.12);box-shadow:inset 0 1px 0 rgba(255,255,255,.16)}
.hero-mark.show{opacity:1}
.hero-content{position:relative;z-index:1;min-height:310px;padding:24px;display:flex;flex-direction:column;gap:14px}
.status-pill{align-self:flex-start;display:flex;align-items:center;gap:10px;padding:10px 14px;border-radius:999px;background:rgba(10,12,17,.42);border:1px solid rgba(255,255,255,.12);font-size:15px;font-weight:650}
.status-dot{width:10px;height:10px;background:#9ba4b4;border-radius:50%;box-shadow:0 0 0 5px rgba(255,255,255,.06)}
.status-pill.pending .status-dot{background:#ffd47c}.status-pill.ready .status-dot{background:#8ee6ad}
.hero-copy{margin-top:12px}
.hero-label{font-size:15px;letter-spacing:.14em;font-weight:760;color:rgba(255,255,255,.74)}
.hero-value{font-size:54px;line-height:1;letter-spacing:-.05em;font-weight:760;margin-top:8px}
.hero-sub{margin-top:10px;color:rgba(255,255,255,.74);font-size:16px;line-height:1.45;max-width:32ch}
.primary-button{border:1px solid rgba(255,255,255,.22);border-radius:22px;background:rgba(244,247,255,.84);color:var(--accent-text);padding:18px 20px;font-weight:760;font-size:20px;box-shadow:inset 0 1px 0 rgba(255,255,255,.95), 0 11px 24px rgba(0,0,0,.22);margin-top:auto}
.primary-button.full{width:100%}
.quick-grid{display:grid;grid-template-columns:1fr;gap:14px;margin-top:16px}
.quick-card{border-radius:25px;padding:18px;text-align:left;color:var(--text);display:flex;gap:14px;align-items:center;min-height:92px}
.quick-icon{font-size:26px;width:38px;text-align:center}
.quick-title,.quick-value{display:block}.quick-title{font-size:14px;color:var(--muted);font-weight:650}.quick-value{font-size:20px;margin-top:3px;font-weight:680}
.section-head{display:flex;justify-content:space-between;align-items:flex-end;margin:32px 4px 14px}.section-head h2{font-size:25px}.text-button{border:1px solid rgba(255,255,255,.14);background:rgba(255,255,255,.08);color:#d6e4ff;font-weight:650;padding:10px 14px;font-size:18px;border-radius:16px;box-shadow:inset 0 1px 0 rgba(255,255,255,.14),0 10px 22px rgba(0,0,0,.16);display:grid;place-items:center;min-height:54px;white-space:nowrap;text-align:center}
.list-card{border-radius:28px;overflow:hidden}.empty-state{padding:32px 18px;text-align:center;color:var(--muted);font-size:17px}
.record-row{display:flex;align-items:center;gap:14px;padding:18px 18px;border-bottom:1px solid var(--line);cursor:pointer}.record-row:last-child{border-bottom:0}
.record-icon{width:48px;height:48px;border-radius:16px;background:rgba(255,255,255,.08);display:grid;place-items:center;font-size:20px}
.record-main{flex:1;min-width:0}.record-main strong{display:block;font-size:20px}.record-main span{display:block;margin-top:4px;font-size:16px;color:var(--muted)}
.record-time{text-align:right;font-size:15px;color:var(--muted);line-height:1.35}
.summary-card{margin-top:14px;border-radius:25px;padding:20px;display:flex;justify-content:space-around;align-items:center}
.summary-item{text-align:center;min-width:78px}.summary-number,.summary-label{display:block}.summary-number{font-size:25px;font-weight:760}.summary-label{font-size:14px;color:var(--muted);margin-top:3px}.summary-divider{width:1px;height:34px;background:var(--line)}
.bottom-spacer{height:120px}
.tabbar{position:fixed;z-index:20;left:50%;transform:translateX(-50%);bottom:max(10px,env(safe-area-inset-bottom));width:min(540px,calc(100% - 28px));border-radius:30px;padding:8px;display:grid;grid-template-columns:repeat(3,1fr)}
.tab{border:0;background:transparent;color:#9aa1ae;border-radius:22px;padding:10px 5px}.tab span,.tab b{display:block}.tab span{font-size:22px}.tab b{font-size:14px;margin-top:3px}.tab.active{background:rgba(255,255,255,.10);color:#fff;box-shadow:inset 0 1px 0 rgba(255,255,255,.14)}
.sheet-dialog,.full-dialog{border:0;background:transparent;padding:0;color:var(--text)}
.sheet-dialog::backdrop,.full-dialog::backdrop{background:rgba(0,0,0,.54);backdrop-filter:blur(6px)}
.sheet-dialog{width:min(620px,100%);max-width:none;position:fixed;bottom:0;left:0;right:0;margin:auto}
.centered-dialog{inset:0;width:100%;height:100%;bottom:auto}
.centered-dialog[open]{display:grid;place-items:center}
dialog:not([open]){display:none!important}
.sheet{position:relative;border-radius:34px 34px 0 0;padding:28px 22px calc(28px + env(safe-area-inset-bottom));min-height:430px}
.centered-sheet{border-radius:34px;max-height:min(540px,calc(100dvh - 42px));overflow:auto;padding-bottom:28px}
.compact-sheet{min-height:0}
.sheet-close{position:absolute;right:17px;top:16px;width:40px;height:40px;border-radius:50%;border:1px solid rgba(255,255,255,.12);background:rgba(255,255,255,.08);color:#fff;font-size:28px;display:grid;place-items:center;padding:0}
.sheet-kicker{font-size:12px;letter-spacing:.14em;font-weight:760;color:var(--muted);margin-top:16px}
.sheet p{color:var(--muted);line-height:1.54;margin:8px 0 20px;font-size:16px}
.step-dots{display:flex;gap:6px;margin:0 auto 18px;width:max-content}.step-dots i{width:22px;height:4px;border-radius:999px;background:rgba(255,255,255,.12)}.step-dots i.active{background:rgba(255,255,255,.72)}
.sheet-step{display:none}.sheet-step.active{display:block}
.choice-grid.two{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.choice-button{min-height:116px;border-radius:24px;border:1px solid var(--line);background:rgba(255,255,255,.08);color:#fff}.choice-symbol{display:block;font-size:28px;margin-bottom:8px}.choice-button strong{font-size:21px}
.pain-list{display:grid;gap:10px}.pain-list button{border:1px solid var(--line);background:rgba(255,255,255,.075);color:#fff;border-radius:20px;padding:16px 18px;text-align:left;display:flex;justify-content:space-between;align-items:center;gap:10px}.pain-list button strong{font-size:18px}.pain-list button span{font-size:13px;color:var(--muted);text-align:right;max-width:46%}
.back-button{display:inline-flex;align-items:center;justify-content:center;border:1px solid rgba(255,255,255,.14);background:rgba(255,255,255,.08);color:#d7e4ff;padding:10px 14px;margin:0 0 8px;border-radius:16px;font-weight:650;font-size:17px;box-shadow:inset 0 1px 0 rgba(255,255,255,.14),0 10px 22px rgba(0,0,0,.16)}
.field-label{display:block;font-size:14px;color:var(--muted);font-weight:650;margin:16px 2px 7px}
.number-field{display:flex;align-items:center;border:1px solid var(--line);background:rgba(255,255,255,.065);border-radius:20px;padding:0 16px}.number-field input{width:100%;padding:16px 0;background:none;border:0;color:#fff;font-size:23px;outline:none}.number-field span{color:var(--muted);font-size:16px}
.switch-row{display:flex;gap:14px;align-items:center;justify-content:space-between;padding:18px 2px}.switch-row-stack{padding-top:14px;padding-bottom:4px}.switch-row strong,.switch-row span{display:block}.switch-row strong{font-size:18px}.switch-row span{color:var(--muted);font-size:14px;margin-top:4px;line-height:1.4;max-width:90%}.switch-row input{display:none}.switch-row i{width:54px;height:32px;border-radius:99px;background:#3a3f49;position:relative;transition:.2s;flex:0 0 auto}.switch-row i:after{content:"";position:absolute;width:28px;height:28px;top:2px;left:2px;border-radius:50%;background:white;transition:.2s}.switch-row input:checked+i{background:#688ec8}.switch-row input:checked+i:after{left:24px}
.inline-note{min-height:22px;font-size:13px;color:var(--muted);text-align:center;margin-top:10px}
.full-dialog{width:100%;height:100%;max-width:none;max-height:none}.full-panel{min-height:100%;background:linear-gradient(160deg,#070a10,#0f1828);padding:calc(env(safe-area-inset-top) + 12px) 18px 0;position:relative}
.full-header{display:grid;grid-template-columns:48px 1fr auto;align-items:center;gap:10px;width:min(760px,100%);margin:0 auto 18px}.full-header h2{font-size:28px}
.filter-row{width:min(760px,100%);margin:0 auto 14px;border-radius:24px;padding:14px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr)) 112px;gap:12px;align-items:start}
.filter-row label{font-size:13px;color:var(--muted);min-width:0;display:grid;grid-template-rows:auto 56px;row-gap:6px;align-items:start}
.filter-row label span{display:block;margin:0 0 0 2px;line-height:1.2}
.filter-row input{display:block;width:100%;min-width:0;margin:0;background:rgba(255,255,255,.07);border:1px solid var(--line);border-radius:15px;color:#fff;padding:13px 12px;appearance:none;-webkit-appearance:none;font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text",system-ui,sans-serif;font-size:17px;font-variant-numeric:tabular-nums;text-align:center;white-space:nowrap}
.filter-row button,.filter-clear{display:inline-flex;align-items:center;justify-content:center;border:1px solid rgba(255,255,255,.14);background:rgba(255,255,255,.08);color:#d7e4ff;padding:0 16px;border-radius:16px;align-self:end;justify-self:stretch;white-space:nowrap;min-height:56px;height:56px;line-height:1;margin-top:22px}
.history-full-list{width:min(760px,100%);margin:auto}.history-day{font-size:16px;font-weight:720;color:var(--muted);margin:22px 4px 10px;text-transform:capitalize}.history-day-card{border-radius:24px;overflow:hidden;background:rgba(255,255,255,.045);border:1px solid var(--line)}
.settings-group{width:min(760px,100%);margin:0 auto 26px}.settings-group h3{font-size:13px;color:var(--muted);text-transform:uppercase;letter-spacing:.1em;margin:0 6px 10px}
.settings-row{width:100%;border:0;border-bottom:1px solid var(--line);background:rgba(255,255,255,.055);color:#fff;padding:17px 16px;text-align:left;display:flex;justify-content:space-between;align-items:center;border-radius:0}.settings-group>.settings-row:nth-child(2){border-radius:22px 22px 0 0}.settings-group>.settings-row:last-child{border-radius:0 0 22px 22px;border-bottom:0}.settings-group>.settings-row:nth-child(2):last-child{border-radius:22px}.settings-row strong,.settings-row small{display:block}.settings-row strong{font-size:18px}.settings-row small{color:var(--muted);margin-top:4px;line-height:1.4;font-size:14px}.settings-row b{font-size:22px;color:#98a4b8}.file-row{position:relative}.file-row input{position:absolute;inset:0;opacity:0}
.info-card{border:1px solid var(--line);border-radius:22px;padding:18px;background:rgba(255,255,255,.05)}.info-card p{color:var(--muted);font-size:15px;line-height:1.54;margin:0}.info-card h3{margin-bottom:10px}
.export-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:20px}.export-grid button{border:1px solid var(--line);border-radius:20px;background:rgba(255,255,255,.075);color:#fff;padding:20px 12px;font-weight:720;font-size:19px}.export-grid span{display:block;color:var(--muted);font-size:13px;margin-top:4px;font-weight:500}
.date-time-input,select{width:100%;border:1px solid var(--line);border-radius:17px;background:rgba(255,255,255,.065);color:#fff;padding:14px 13px;font-size:17px}
.segmented{display:grid;grid-template-columns:1fr 1fr;background:rgba(255,255,255,.06);border-radius:17px;padding:4px;border:1px solid var(--line)}.segmented button{border:0;background:transparent;color:var(--muted);padding:12px;border-radius:13px;font-size:17px}.segmented button.active{background:rgba(255,255,255,.14);color:#fff}
.edit-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:20px}.danger-button{border:1px solid rgba(255,138,138,.3);background:rgba(255,138,138,.08);color:var(--danger);border-radius:20px;font-weight:720;font-size:18px}.edit-actions .primary-button{margin:0}
.toast{position:fixed;z-index:100;left:50%;bottom:105px;transform:translate(-50%,20px);padding:12px 16px;background:rgba(18,20,26,.9);border:1px solid var(--line);border-radius:999px;opacity:0;pointer-events:none;transition:.22s;white-space:nowrap;max-width:calc(100% - 30px);overflow:hidden;text-overflow:ellipsis;font-size:15px}.toast.show{opacity:1;transform:translate(-50%,0)}
@media(max-width:620px){.hero-card,.hero-content{min-height:280px}.hero-value{font-size:44px}.quick-grid{grid-template-columns:1fr}.quick-card{min-height:78px}.sheet{padding-left:18px;padding-right:18px}.pain-list button{padding:14px}.pain-list button span{max-width:45%}.filter-row{grid-template-columns:1fr 1fr}.filter-clear{grid-column:1/-1;width:100%;margin-top:0;height:56px}}
@media(max-width:520px){h1{font-size:27px}h2{font-size:24px}.eyebrow{font-size:12px}.hero-label{font-size:13px}.hero-sub{font-size:15px}.quick-value,.record-main strong,.summary-number,.settings-row strong,.switch-row strong{font-size:18px}.record-main span,.record-time,.summary-label,.settings-row small,.sheet p{font-size:15px}.filter-row{grid-template-columns:1fr 1fr}.filter-clear{grid-column:1/-1;margin-top:0}.full-header{grid-template-columns:48px 1fr 82px}.text-button{font-size:17px}.topbar{margin-bottom:18px}}
@media(prefers-reduced-motion:no-preference){dialog[open] .sheet{animation:sheetIn .24s ease-out}@keyframes sheetIn{from{transform:translateY(30px);opacity:.6}to{transform:none;opacity:1}}}

.filter-row input::-webkit-date-and-time-value{text-align:left}
.filter-row input{line-height:1.2}

/* Revisão 4: campos de data estáveis, export centralizado e onboarding */
.date-control{position:relative;display:flex!important;align-items:center;justify-content:center;width:100%;height:56px;min-height:56px;max-height:56px;border:1px solid var(--line);border-radius:15px;background:rgba(255,255,255,.07);overflow:hidden;color:var(--text)}
.date-display{display:flex!important;align-items:center;justify-content:center;width:100%;height:56px;padding:0 12px;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text",system-ui,sans-serif;font-size:17px;font-variant-numeric:tabular-nums;color:var(--text);line-height:1}
.date-control input[type="date"]{position:absolute!important;inset:0!important;display:block!important;width:100%!important;height:56px!important;min-width:0!important;max-width:none!important;margin:0!important;padding:0!important;border:0!important;border-radius:15px!important;opacity:.01!important;appearance:auto!important;-webkit-appearance:auto!important;cursor:pointer;z-index:2;color:transparent!important;-webkit-text-fill-color:transparent!important;caret-color:transparent!important;background:transparent!important}
.date-control input[type="date"]::-webkit-date-and-time-value,.date-control input[type="date"]::-webkit-datetime-edit,.date-control input[type="date"]::-webkit-datetime-edit-fields-wrapper,.date-control input[type="date"]::-webkit-datetime-edit-text,.date-control input[type="date"]::-webkit-datetime-edit-month-field,.date-control input[type="date"]::-webkit-datetime-edit-day-field,.date-control input[type="date"]::-webkit-datetime-edit-year-field{color:transparent!important;-webkit-text-fill-color:transparent!important;opacity:0!important}
.date-control input[type="date"]::-webkit-calendar-picker-indicator{opacity:.02!important;width:100%;height:100%;margin:0;cursor:pointer}
.prompt-actions{display:grid;grid-template-columns:1fr 1.25fr;gap:12px;margin-top:22px}
.prompt-actions .primary-button{margin:0;min-height:58px}
.secondary-button{border:1px solid rgba(255,255,255,.15);border-radius:22px;background:rgba(255,255,255,.075);color:var(--text);padding:16px 18px;font-weight:700;font-size:18px}
.reminder-prompt-sheet{width:min(560px,calc(100vw - 28px))}
@media(max-width:520px){.prompt-actions{grid-template-columns:1fr}.date-control,.date-control input[type="date"]{height:54px!important;min-height:54px}.date-display{height:54px}.filter-row{grid-template-columns:1fr}.filter-clear{grid-column:auto;margin-top:0}}

.panel-tabbar{position:fixed;z-index:30;left:50%;transform:translateX(-50%);bottom:max(10px,env(safe-area-inset-bottom));width:min(540px,calc(100% - 28px))}
.dialog-spacer{height:130px}

.app-version{width:min(760px,100%);margin:-8px auto 18px;text-align:center;color:rgba(180,186,200,.42);font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text",system-ui,sans-serif;font-size:11px;letter-spacing:.08em;font-variant-numeric:tabular-nums;user-select:none}

.import-mode-sheet{width:min(560px,calc(100vw - 28px))}
.import-mode-actions{display:grid;gap:12px;margin-top:20px}
.import-mode-button{width:100%;border:1px solid rgba(255,255,255,.14);border-radius:22px;background:rgba(255,255,255,.075);color:var(--text);padding:17px 18px;text-align:left}
.import-mode-button strong,.import-mode-button span{display:block}
.import-mode-button strong{font-size:19px}
.import-mode-button span{margin-top:5px;color:var(--muted);font-size:14px;line-height:1.4}
.import-mode-button.replace{border-color:rgba(255,155,155,.24);background:rgba(255,130,130,.07)}
.import-mode-button:disabled{opacity:.55;pointer-events:none}


/* v15 — Ferramentas no padrão visual do Diário de Medicação */
#settingsView .full-panel{
  background:
    radial-gradient(circle at 88% -10%,rgba(55,86,128,.25),transparent 34%),
    linear-gradient(165deg,#07101c 0%,#091525 48%,#0c192b 100%);
}
#settingsView .full-header{
  margin-bottom:24px;
}
#settingsView .full-header .eyebrow,
#settingsView .settings-group h3{
  color:#aeb8ca;
  font-family:"Palatino Linotype",Palatino,"Book Antiqua",Georgia,serif;
  letter-spacing:.14em;
}
#settingsView .full-header h2{
  color:#f7f5f2;
  font-family:"Palatino Linotype",Palatino,"Book Antiqua",Georgia,serif;
  font-weight:700;
}
#settingsView .settings-group{
  display:grid;
  gap:10px;
  margin-bottom:30px;
}
#settingsView .settings-group h3{
  margin:0 8px 2px;
  font-size:13px;
}
#settingsView .settings-row,
#settingsView .settings-group>.settings-row:nth-child(2),
#settingsView .settings-group>.settings-row:last-child,
#settingsView .settings-group>.settings-row:nth-child(2):last-child{
  min-height:82px;
  border:1px solid rgba(190,207,235,.15);
  border-radius:24px;
  background:linear-gradient(180deg,rgba(37,49,69,.80),rgba(25,35,52,.76));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.10),
    inset 0 -1px 0 rgba(255,255,255,.025),
    0 14px 28px rgba(0,0,0,.20);
  padding:17px 19px;
  overflow:hidden;
}
#settingsView .settings-row strong{
  color:#f5f3f0;
  font-family:"Palatino Linotype",Palatino,"Book Antiqua",Georgia,serif;
  font-size:19px;
  line-height:1.15;
  font-weight:700;
}
#settingsView .settings-row small{
  color:#b3bdcd;
  font-family:"Palatino Linotype",Palatino,"Book Antiqua",Georgia,serif;
  font-size:15px;
  line-height:1.35;
  margin-top:5px;
}
#settingsView .settings-row b{
  color:#aab7ca;
  font-family:"Palatino Linotype",Palatino,"Book Antiqua",Georgia,serif;
  font-size:25px;
  font-weight:400;
  flex:0 0 auto;
  margin-left:15px;
}
#settingsView .settings-row::before{
  background:linear-gradient(180deg,rgba(255,255,255,.105),rgba(255,255,255,.025) 45%,rgba(255,255,255,.015));
}
#settingsView .file-row input{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  opacity:.001;
  cursor:pointer;
  z-index:4;
}
#settingsView .info-card{
  display:block;
  border:1px solid rgba(190,207,235,.15);
  border-radius:24px;
  background:linear-gradient(180deg,rgba(31,43,62,.70),rgba(22,32,48,.68));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.08),0 14px 28px rgba(0,0,0,.16);
  padding:18px 20px;
}
#settingsView .info-card h3{
  margin:0 0 9px;
}
#settingsView .info-card p{
  color:#aeb8c8;
  font-family:"Palatino Linotype",Palatino,"Book Antiqua",Georgia,serif;
  font-size:14px;
}
#settingsView .panel-tabbar{
  background:rgba(18,27,42,.82);
  border-color:rgba(190,207,235,.15);
}
#settingsView .tab.active{
  background:linear-gradient(180deg,rgba(70,84,108,.58),rgba(50,62,82,.52));
}
@media(max-width:520px){
  #settingsView .settings-row{min-height:78px;padding:16px 17px}
  #settingsView .settings-row strong{font-size:18px}
  #settingsView .settings-row small{font-size:14px}
}

/* v19 — níveis de dor configuráveis e lembrete diário */
.pain-list button{justify-content:flex-start}
.pain-list button strong{width:100%}
.pain-unknown{color:#ff8f8f!important}
.pain-unknown small{display:block!important;margin-top:4px!important;color:#ff9f9f!important;font-size:12px!important;font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text",system-ui,sans-serif!important;font-weight:600}
.record-row.is-pending-sync{cursor:default}.record-sync-pending{display:block;margin-top:5px;color:var(--muted);font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text",system-ui,sans-serif;font-size:12px;font-weight:600}
.unknown-pain-note{margin-top:9px;padding:10px 12px;border:1px solid rgba(255,130,130,.25);border-radius:14px;background:rgba(255,90,90,.07);color:#ff9f9f;font-size:13px;line-height:1.4}
.timezone-note{margin:10px 2px 16px;color:var(--muted);font-size:13px;line-height:1.4}
.timezone-note strong{color:#d9e1ef;font-weight:650}
.manager-sheet{width:min(620px,calc(100vw - 28px));max-height:min(760px,calc(100dvh - 32px))}
.manager-weight-note{margin:14px 0 2px;padding:11px 13px;border:1px solid rgba(190,207,235,.12);border-radius:15px;background:rgba(120,154,205,.07);color:var(--muted);font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text",system-ui,sans-serif;font-size:12px;line-height:1.45}
.manager-weight-note strong{color:#e4eaf5;font-weight:700}
.manager-list{display:grid;gap:10px;margin:12px 0 16px;max-height:390px;overflow:auto;padding-right:2px}
.manager-row{display:grid;grid-template-columns:38px minmax(0,1fr) auto;align-items:center;gap:12px;padding:14px 12px;border:1px solid rgba(190,207,235,.15);border-radius:19px;background:rgba(255,255,255,.055)}
.manager-weight{width:38px;align-self:start;padding-top:1px;text-align:center;font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text",system-ui,sans-serif;line-height:1;user-select:none;pointer-events:none}
.manager-weight strong{display:block;font-size:27px;font-weight:730;color:#9fc5ff;font-variant-numeric:tabular-nums;letter-spacing:-.03em}
.manager-weight small{display:block;margin-top:5px;font-size:8px;text-transform:uppercase;letter-spacing:.12em;color:#7f8ca0;font-weight:700}
.manager-label-wrap{min-width:0;display:flex;flex-direction:column;align-items:flex-start;gap:5px;padding:2px 0}
.manager-label{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#f7f5f2;font-family:"Palatino Linotype",Palatino,"Book Antiqua",Georgia,serif;font-size:19px;font-weight:600;line-height:1.18}
.manager-rename{border:0;background:transparent;color:#91a8ca;padding:1px 0;font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text",system-ui,sans-serif;font-size:11px;font-weight:680;line-height:1.3;text-align:left}
.manager-rename span{font-size:11px;margin-right:3px}.manager-rename:active{opacity:.58}
.manager-buttons{display:flex;gap:5px;align-self:center}
.mini-button{width:34px;height:34px;padding:0;border:1px solid rgba(255,255,255,.12);border-radius:11px;background:rgba(255,255,255,.07);color:#dbe4f3;font-size:16px;display:grid;place-items:center}
.mini-button:disabled{opacity:.28}
.danger-mini{color:#ff9f9f}
.manager-add{margin:4px 0 10px;width:100%;min-height:50px}
@media(max-width:520px){.manager-row{grid-template-columns:34px minmax(0,1fr) auto;gap:10px}.manager-weight{width:34px}.manager-weight strong{font-size:25px}.manager-buttons{gap:4px}.mini-button{width:33px;height:33px}.manager-list{max-height:330px}}


/* v21 — gerenciador mais limpo e seletor rotatório de horário */

/* v23 — roda virtual de frequência: sem milhares de <option> no iPhone */
.frequency-wheel-field{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:12px;border:1px solid var(--line);background:rgba(255,255,255,.065);border-radius:20px;padding:8px 15px 8px 10px;min-height:166px;overflow:hidden}
.frequency-wheel{position:relative;height:150px;min-width:0;overflow:hidden;display:grid;grid-template-rows:repeat(5,30px);align-items:center;touch-action:none;user-select:none;-webkit-user-select:none;outline:none;cursor:ns-resize;mask-image:linear-gradient(to bottom,transparent 0,#000 18%,#000 82%,transparent 100%);-webkit-mask-image:linear-gradient(to bottom,transparent 0,#000 18%,#000 82%,transparent 100%)}
.frequency-wheel::before{content:"";position:absolute;left:8px;right:8px;top:60px;height:30px;border-top:1px solid rgba(190,207,235,.17);border-bottom:1px solid rgba(190,207,235,.17);background:rgba(127,164,221,.07);border-radius:9px;pointer-events:none}
.frequency-wheel-item{position:relative;z-index:1;height:30px;display:grid;place-items:center;color:#8f9aab;font-family:-apple-system,BlinkMacSystemFont,"SF Pro Display","SF Pro Text",system-ui,sans-serif;font-size:18px;font-variant-numeric:tabular-nums;transition:opacity .08s ease,transform .08s ease,color .08s ease;font-weight:540}
.frequency-wheel-item.near{opacity:.64;transform:scale(.91)}
.frequency-wheel-item.far{opacity:.28;transform:scale(.82)}
.frequency-wheel-item.selected{color:#fff;font-size:29px;font-weight:700;opacity:1;transform:scale(1)}
.frequency-wheel.disabled{opacity:.38;cursor:default;pointer-events:none}
.frequency-wheel-unit{color:var(--muted);font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text",system-ui,sans-serif;font-size:16px;align-self:center}
.frequency-wheel-hint{margin:7px 3px 0;color:#7f8ca0;font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text",system-ui,sans-serif;font-size:11px;line-height:1.4;text-align:center}

#installAppBtn.installed{cursor:default}
#installAppBtn.installed #installAppIcon{color:#9fc5ff}
.install-sheet{width:min(560px,calc(100vw - 28px))}
.install-steps{display:grid;gap:10px;margin:18px 0 22px}
.install-steps>div{display:grid;grid-template-columns:34px 1fr;gap:11px;align-items:start;padding:12px 13px;border:1px solid rgba(190,207,235,.13);border-radius:17px;background:rgba(255,255,255,.045)}
.install-steps>div>strong{width:30px;height:30px;border-radius:50%;display:grid;place-items:center;background:rgba(127,164,221,.13);color:#cfe0fb;font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text",system-ui,sans-serif;font-size:14px}
.install-steps span{color:#bac4d3;font-family:"Palatino Linotype",Palatino,"Book Antiqua",Georgia,serif;font-size:15px;line-height:1.45;padding-top:3px}
.install-steps b{color:#edf2fa;font-weight:650}

/* v24 — frequência compacta, picker sob demanda e correção do lembrete diário */
.frequency-picker-trigger{width:100%;min-height:58px;border:1px solid var(--line);border-radius:20px;background:rgba(255,255,255,.065);color:var(--text);padding:11px 15px;display:flex;align-items:center;justify-content:space-between;text-align:left}
.frequency-picker-trigger>span{display:flex;flex-direction:column;gap:2px;min-width:0}
.frequency-picker-trigger strong{font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text",system-ui,sans-serif;font-size:19px;font-weight:700;font-variant-numeric:tabular-nums}
.frequency-picker-trigger small{font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text",system-ui,sans-serif;font-size:12px;color:var(--muted)}
.frequency-picker-trigger b{font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text",system-ui,sans-serif;font-size:25px;color:#a9b5c7;font-weight:500;line-height:1}
.frequency-picker-trigger:disabled{opacity:.38;pointer-events:none}
.frequency-repeat-note{margin:10px 2px 3px;padding:10px 12px;border-radius:15px;background:rgba(117,151,201,.065);border:1px solid rgba(190,207,235,.11);font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text",system-ui,sans-serif;font-size:12px;line-height:1.45;color:#9da9ba}
.frequency-repeat-note strong{color:#dbe4f1;font-weight:700}


.daily-reminder-sheet{width:min(540px,calc(100vw - 28px))!important;max-width:calc(100vw - 28px)!important;overflow-x:hidden}
.daily-reminder-time-wrap{width:100%;max-width:100%;min-width:0;overflow:hidden}
.daily-reminder-time-wrap .date-time-input{display:block;width:100%!important;max-width:100%!important;min-width:0!important;margin:0!important}

@media(max-width:520px){
  .frequency-picker-trigger{min-height:56px}
  .frequency-repeat-note{font-size:11px}
  .daily-reminder-sheet{width:calc(100vw - 24px)!important;max-width:calc(100vw - 24px)!important}
}


/* v25: seletor de frequência compacto + ajustes iOS */
.frequency-picker-trigger{min-height:58px;height:58px;padding:0 15px}
.frequency-wheel-panel{margin-top:10px;border:1px solid rgba(190,207,235,.13);border-radius:20px;background:rgba(12,17,27,.72);padding:8px 12px 12px;overflow:hidden;max-height:220px;opacity:1;transform:none}
.frequency-wheel-panel[hidden]{display:none!important}
.frequency-wheel-panel .frequency-wheel{height:150px;width:100%;margin:0}
.frequency-wheel-panel .frequency-wheel::before{left:10px;right:10px}
.frequency-wheel-panel .frequency-wheel-hint{margin-top:4px}
.frequency-wheel-done{display:block;margin:8px auto 0;border:1px solid rgba(255,255,255,.13);border-radius:14px;background:rgba(255,255,255,.075);color:#dbe5f4;padding:9px 18px;font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text",system-ui,sans-serif;font-size:14px;font-weight:650}

.daily-reminder-sheet{width:min(520px,calc(100vw - 24px))!important;max-width:calc(100vw - 24px)!important;padding-left:20px!important;padding-right:20px!important;overflow-x:hidden!important}
.daily-reminder-time-wrap{display:flex;width:100%;max-width:100%;min-width:0;overflow:hidden}
.daily-reminder-time-wrap .date-time-input{flex:1 1 0;width:0!important;min-width:0!important;max-width:100%!important;height:58px;margin:0!important;padding:0 14px!important;font-family:-apple-system,BlinkMacSystemFont,"SF Pro Display","SF Pro Text",system-ui,sans-serif!important;font-size:22px!important;font-weight:650!important;line-height:58px!important;text-align:center!important;-webkit-appearance:none;appearance:none;overflow:hidden}
.daily-reminder-time-wrap input[type="time"]::-webkit-date-and-time-value{text-align:center!important;min-width:0!important}
.daily-reminder-time-wrap input[type="time"]::-webkit-datetime-edit{padding:0!important;min-width:0!important}
.daily-reminder-time-wrap input[type="time"]::-webkit-datetime-edit-fields-wrapper{padding:0!important;min-width:0!important}

.install-group{margin-top:30px!important}
/* Proteção visual imediata no Capacitor; o app.js também remove estes nós do DOM. */
html[data-mm-runtime="native"] .install-group,
html[data-mm-runtime="native"] #installDialog{display:none!important}
.install-share-icon{width:30px;height:30px;display:grid;place-items:center;color:#aebbd0;flex:0 0 30px}
.install-share-icon svg{width:25px;height:25px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;overflow:visible}
#installAppBtn.installed .install-share-icon{color:#91b8f0;opacity:.9}

@media(max-width:520px){
  .daily-reminder-sheet{width:calc(100vw - 20px)!important;max-width:calc(100vw - 20px)!important;padding-left:18px!important;padding-right:18px!important}
  .daily-reminder-time-wrap .date-time-input{font-size:21px!important}
}

/* v26 — refinamento visual da frequência e correções de largura no iPhone */
.frequency-wheel-panel{
  margin-top:10px;
  padding:10px 12px 14px;
  max-height:none;
  border-radius:20px;
  overflow:hidden;
}
.frequency-wheel-panel .frequency-wheel{
  height:116px;
  min-height:116px;
  grid-template-rows:repeat(5,23px);
  align-content:center;
  margin:0;
}
.frequency-wheel-panel .frequency-wheel::before{
  top:46px;
  height:23px;
  left:10px;
  right:10px;
}
.frequency-wheel-panel .frequency-wheel-item{
  height:23px;
  font-size:16px;
  line-height:23px;
}
.frequency-wheel-panel .frequency-wheel-item.selected{
  font-size:27px;
}
.frequency-wheel-panel .frequency-wheel-hint{
  margin:7px 2px 0;
  min-height:16px;
  line-height:1.35;
}
.frequency-wheel-done{
  min-height:38px;
  margin:7px auto 0;
  padding:8px 20px;
}
.frequency-repeat-note{margin-top:12px}

.notifications-sheet{
  width:calc(100% - 32px)!important;
  max-width:520px!important;
  margin-inline:auto;
}
.notification-recurring-help{
  margin:0 0 18px!important;
  font-size:14px!important;
}
.notification-recurring-help strong{color:#e7edf7}

.daily-reminder-sheet{
  width:calc(100% - 32px)!important;
  max-width:500px!important;
  min-width:0!important;
  margin-inline:auto!important;
  padding-left:20px!important;
  padding-right:20px!important;
  overflow-x:clip!important;
}
.daily-reminder-time-wrap{
  display:block!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  overflow:hidden!important;
}
.daily-reminder-time-wrap .date-time-input{
  display:block!important;
  inline-size:100%!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  height:60px!important;
  margin:0!important;
  padding:0 10px!important;
  border-radius:17px!important;
  font-size:26px!important;
  font-weight:650!important;
  line-height:60px!important;
  text-align:center!important;
  overflow:hidden!important;
  appearance:none!important;
  -webkit-appearance:none!important;
}
.daily-reminder-time-wrap input[type="time"]::-webkit-date-and-time-value{
  width:100%!important;
  min-width:0!important;
  padding:0!important;
  text-align:center!important;
}
.daily-reminder-time-wrap input[type="time"]::-webkit-datetime-edit,
.daily-reminder-time-wrap input[type="time"]::-webkit-datetime-edit-fields-wrapper{
  width:100%!important;
  min-width:0!important;
  padding:0!important;
}

@media(max-width:520px){
  .frequency-wheel-panel{padding:9px 10px 13px}
  .frequency-wheel-panel .frequency-wheel{height:108px;min-height:108px;grid-template-rows:repeat(5,21px)}
  .frequency-wheel-panel .frequency-wheel::before{top:42px;height:22px}
  .frequency-wheel-panel .frequency-wheel-item{height:21px;line-height:21px}
  .frequency-wheel-panel .frequency-wheel-item.selected{font-size:25px}
  .frequency-wheel-done{margin-top:6px}
  .daily-reminder-sheet,.notifications-sheet{width:calc(100% - 24px)!important;max-width:calc(100% - 24px)!important}
  .daily-reminder-sheet{padding-left:17px!important;padding-right:17px!important}
  .daily-reminder-time-wrap .date-time-input{font-size:25px!important}
}


/* v27 — seletor de frequência mais compacto */
.frequency-wheel-panel{
  padding:8px 12px 9px;
}
.frequency-wheel-panel .frequency-wheel{
  height:94px;
  min-height:94px;
  grid-template-rows:repeat(5,18px);
  align-content:center;
}
.frequency-wheel-panel .frequency-wheel::before{
  top:37px;
  height:20px;
}
.frequency-wheel-panel .frequency-wheel-item{
  height:18px;
  line-height:18px;
  font-size:15px;
}
.frequency-wheel-panel .frequency-wheel-item.selected{
  font-size:26px;
}
.frequency-wheel-panel .frequency-wheel-hint{
  margin:5px 2px 0;
}
.frequency-wheel-done{
  min-height:36px;
  margin:6px auto 0;
  padding:7px 20px;
}
.frequency-repeat-note{display:none!important}

@media(max-width:520px){
  .frequency-wheel-panel{padding:8px 10px 9px}
  .frequency-wheel-panel .frequency-wheel{height:90px;min-height:90px;grid-template-rows:repeat(5,17px)}
  .frequency-wheel-panel .frequency-wheel::before{top:35px;height:20px}
  .frequency-wheel-panel .frequency-wheel-item{height:17px;line-height:17px;font-size:14px}
  .frequency-wheel-panel .frequency-wheel-item.selected{font-size:25px}
  .frequency-wheel-done{margin-top:6px;margin-bottom:0}
}


/* v28 — wheel mais legível e modais respeitando a safe area do iPhone */
.frequency-wheel-panel{
  min-height:169px;
  box-sizing:border-box;
  display:flex;
  flex-direction:column;
  justify-content:flex-start;
  padding:9px 12px 10px;
}
.frequency-wheel-panel[hidden]{display:none!important}
.frequency-wheel-panel .frequency-wheel{
  height:110px;
  min-height:110px;
  grid-template-rows:repeat(5,22px);
  align-content:center;
}
.frequency-wheel-panel .frequency-wheel::before{
  top:38px;
  height:34px;
  border-radius:11px;
}
.frequency-wheel-panel .frequency-wheel-item{
  height:22px;
  line-height:22px;
  font-size:17px;
}
.frequency-wheel-panel .frequency-wheel-item.near{
  opacity:.58;
  transform:scale(.92);
}
.frequency-wheel-panel .frequency-wheel-item.far{
  opacity:.20;
  transform:scale(.82);
}
.frequency-wheel-panel .frequency-wheel-item.selected{
  font-size:34px;
  line-height:1;
  font-weight:720;
}
.frequency-wheel-hint{display:none!important}
.frequency-wheel-done{
  min-height:36px;
  margin:7px auto 0;
  padding:7px 22px;
}

/*
  Quando um bottom sheet cresce até quase a altura total, preserva a região
  interativa do topo (status bar / Dynamic Island) e faz o conteúdo rolar
  dentro do próprio sheet, em vez de empurrar o botão Fechar para essa área.
*/
.sheet-dialog{
  box-sizing:border-box;
  max-height:100dvh;
  padding-top:calc(env(safe-area-inset-top) + 8px);
}
.sheet-dialog > .sheet{
  max-height:calc(100dvh - env(safe-area-inset-top) - 8px);
  overflow-y:auto;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
}
.sheet-dialog > .sheet .sheet-close{
  top:16px;
  z-index:20;
}
.centered-dialog{
  padding-top:calc(env(safe-area-inset-top) + 8px);
  padding-bottom:calc(env(safe-area-inset-bottom) + 8px);
  box-sizing:border-box;
}
.centered-dialog > .centered-sheet{
  max-height:calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 24px);
}

@media(max-width:520px){
  .frequency-wheel-panel{
    min-height:169px;
    padding:9px 10px 10px;
  }
  .frequency-wheel-panel .frequency-wheel{
    height:110px;
    min-height:110px;
    grid-template-rows:repeat(5,22px);
  }
  .frequency-wheel-panel .frequency-wheel::before{
    top:38px;
    height:34px;
  }
  .frequency-wheel-panel .frequency-wheel-item{
    height:22px;
    line-height:22px;
    font-size:17px;
  }
  .frequency-wheel-panel .frequency-wheel-item.selected{
    font-size:34px;
  }
  .frequency-wheel-done{margin-top:7px}
}


/* v29 — wheel centralizado, com mais respiro visual sem aumentar o box */
.frequency-wheel-panel{
  height:169px;
  min-height:169px;
  max-height:169px;
  box-sizing:border-box;
  padding:10px 12px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  overflow:hidden;
}
.frequency-wheel-panel[hidden]{display:none!important}
.frequency-wheel-panel .frequency-wheel{
  flex:0 0 100px;
  height:100px;
  min-height:100px;
  grid-template-rows:repeat(5,20px);
  align-content:center;
  margin:0;
}
.frequency-wheel-panel .frequency-wheel::before{
  top:26px;
  height:48px;
  border-radius:12px;
}
.frequency-wheel-panel .frequency-wheel-item{
  height:20px;
  line-height:20px;
  font-size:16px;
}
.frequency-wheel-panel .frequency-wheel-item.selected{
  font-size:37px;
  line-height:1;
  font-weight:720;
}
.frequency-wheel-panel .frequency-wheel-item[data-frequency-offset="-1"]{
  transform:translateY(-8px) scale(.91);
}
.frequency-wheel-panel .frequency-wheel-item[data-frequency-offset="1"]{
  transform:translateY(8px) scale(.91);
}
.frequency-wheel-panel .frequency-wheel-item[data-frequency-offset="-2"]{
  transform:translateY(-3px) scale(.82);
}
.frequency-wheel-panel .frequency-wheel-item[data-frequency-offset="2"]{
  transform:translateY(3px) scale(.82);
}
.frequency-wheel-done{
  flex:0 0 36px;
  min-height:36px;
  height:36px;
  margin:7px auto 0;
  padding:0 22px;
}

@media(max-width:520px){
  .frequency-wheel-panel{
    height:169px;
    min-height:169px;
    max-height:169px;
    padding:10px;
  }
  .frequency-wheel-panel .frequency-wheel{
    flex-basis:100px;
    height:100px;
    min-height:100px;
    grid-template-rows:repeat(5,20px);
  }
  .frequency-wheel-panel .frequency-wheel::before{
    top:26px;
    height:48px;
  }
  .frequency-wheel-panel .frequency-wheel-item{
    height:20px;
    line-height:20px;
    font-size:16px;
  }
  .frequency-wheel-panel .frequency-wheel-item.selected{font-size:37px}
  .frequency-wheel-done{margin-top:7px}
}

/* v30 — centralização óptica do número selecionado */
.frequency-wheel-panel .frequency-wheel-item.selected{
  transform:translateY(-3px) scale(1);
}
@media(max-width:520px){
  .frequency-wheel-panel .frequency-wheel-item.selected{
    transform:translateY(-3px) scale(1);
  }
}



/* v31 — geometria absoluta da roda para centralização real em iPhone/iPad */
.frequency-wheel-panel .frequency-wheel{
  position:relative;
  display:block;
  height:100px;
  min-height:100px;
  overflow:hidden;
}
.frequency-wheel-panel .frequency-wheel::before{
  top:50%;
  height:48px;
  transform:translateY(-50%);
}
.frequency-wheel-panel .frequency-wheel-item{
  position:absolute;
  z-index:1;
  left:0;
  right:0;
  top:50%;
  height:28px;
  margin:0;
  display:flex;
  align-items:center;
  justify-content:center;
  line-height:1;
  transform-origin:center center;
}
.frequency-wheel-panel .frequency-wheel-item.selected{
  height:48px;
  font-size:40px;
  line-height:1;
  transform:translateY(calc(-50% - 1px)) scale(1);
}
.frequency-wheel-panel .frequency-wheel-item[data-frequency-offset="-1"]{
  transform:translateY(calc(-50% - 38px)) scale(.91);
}
.frequency-wheel-panel .frequency-wheel-item[data-frequency-offset="1"]{
  transform:translateY(calc(-50% + 38px)) scale(.91);
}
.frequency-wheel-panel .frequency-wheel-item[data-frequency-offset="-2"]{
  transform:translateY(calc(-50% - 65px)) scale(.82);
}
.frequency-wheel-panel .frequency-wheel-item[data-frequency-offset="2"]{
  transform:translateY(calc(-50% + 65px)) scale(.82);
}
@media(max-width:520px){
  .frequency-wheel-panel .frequency-wheel{
    height:100px;
    min-height:100px;
  }
  .frequency-wheel-panel .frequency-wheel::before{
    top:50%;
    height:48px;
    transform:translateY(-50%);
  }
  .frequency-wheel-panel .frequency-wheel-item{
    height:28px;
    line-height:1;
  }
  .frequency-wheel-panel .frequency-wheel-item.selected{
    height:48px;
    font-size:40px;
    transform:translateY(calc(-50% - 1px)) scale(1);
  }
}

/* v32 — gráficos de dor por faixa horária */
.chart-sheet{
  
  max-
  padding-bottom:24px!important;
}
.chart-sheet > p{
  margin-bottom:18px;
}
.chart-filter-card,
.chart-card,
.chart-metric{
  border:1px solid rgba(190,207,235,.14);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.08),0 16px 30px rgba(0,0,0,.18);
}
.chart-filter-card{
  margin:0 0 18px;
  padding:16px 16px 14px;
  border-radius:24px;
  background:linear-gradient(180deg,rgba(28,41,61,.76),rgba(18,29,43,.68));
}
.chart-filter-head{
  margin:0 0 12px 4px;
  color:#dce5f4;
  font-family:"Palatino Linotype",Palatino,"Book Antiqua",Georgia,serif;
  font-size:15px;
  font-weight:700;
}
.chart-filter-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr)) 112px;
  gap:12px;
  align-items:start;
}
.chart-filter-grid label{
  display:grid;
  grid-template-rows:auto 56px;
  row-gap:6px;
  min-width:0;
  color:var(--muted);
  font-size:13px;
}
.chart-filter-grid label span:first-child{
  margin-left:2px;
}
.chart-filter-clear{
  margin-top:21px;
}
.chart-card{
  padding:18px 18px 16px;
  border-radius:28px;
  background:
    radial-gradient(circle at 12% 0%,rgba(122,164,237,.10),transparent 28%),
    linear-gradient(180deg,rgba(17,29,44,.96),rgba(8,18,31,.98));
}
.chart-card-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
}
.chart-card-head h3{
  margin:4px 0 0;
  font-family:"Palatino Linotype",Palatino,"Book Antiqua",Georgia,serif;
  font-size:28px;
  line-height:1.1;
}
.chart-range{
  flex:0 0 auto;
  align-self:center;
  padding:10px 14px;
  border-radius:999px;
  background:rgba(124,160,223,.12);
  border:1px solid rgba(190,207,235,.12);
  color:#c9d6ea;
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text",system-ui,sans-serif;
  font-size:12px;
  font-weight:650;
  line-height:1;
  letter-spacing:.02em;
}
.chart-plot{
  margin-top:14px;
  min-height:320px;
}
.pain-chart-svg{
  display:block;
  width:100%;
  height:auto;
}
.chart-backdrop{fill:rgba(11,20,34,.76)}
.chart-grid{stroke:rgba(190,207,235,.11);stroke-width:1}
.chart-axis{stroke:rgba(211,224,246,.28);stroke-width:1.2}
.chart-y-label,
.chart-x-label{
  fill:#95a3b7;
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text",system-ui,sans-serif;
  font-size:12px;
}
.chart-line-glow{
  fill:none;
  stroke-width:10;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.chart-area{opacity:1}
.chart-line{
  fill:none;
  stroke-width:4;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.chart-dot{fill:#86b7ff;opacity:.24}
.chart-dot-core{fill:#edf5ff;stroke:#86b7ff;stroke-width:2}
.chart-empty{
  min-height:320px;
  display:grid;
  place-items:center;
  padding:36px 18px;
  text-align:center;
}
.chart-metrics{
  margin-top:16px;
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
}
.chart-metric{
  padding:16px 16px 14px;
  border-radius:22px;
  background:linear-gradient(180deg,rgba(32,45,64,.76),rgba(18,29,44,.70));
}
.chart-metric strong{
  display:block;
  color:#f6f7fb;
  font-family:"Palatino Linotype",Palatino,"Book Antiqua",Georgia,serif;
  font-size:29px;
  line-height:1.05;
  font-weight:700;
}
.chart-metric span{
  display:block;
  margin-top:7px;
  color:#aebbd0;
  font-family:"Palatino Linotype",Palatino,"Book Antiqua",Georgia,serif;
  font-size:14px;
  line-height:1.35;
}
.chart-note{
  margin:12px 4px 0;
  color:#9faec4;
  font-family:"Palatino Linotype",Palatino,"Book Antiqua",Georgia,serif;
  font-size:14px;
  line-height:1.45;
}
@media(max-width:700px){
  .chart-filter-grid{grid-template-columns:1fr 1fr}
  .chart-filter-clear{grid-column:1/-1;margin-top:0}
  .chart-card-head{flex-direction:column;align-items:flex-start}
  .chart-range{align-self:flex-start}
  .chart-metrics{grid-template-columns:1fr}
}
@media(max-width:520px){
  .chart-sheet{max-}
  .chart-card{padding:16px 14px 14px;border-radius:24px}
  .chart-filter-card{padding:14px 14px 12px;border-radius:22px}
  .chart-filter-grid{grid-template-columns:1fr 1fr}
  .chart-filter-clear{grid-column:1/-1}
  .chart-card-head h3{font-size:25px}
  .chart-range{font-size:11px;padding:9px 12px}
  .chart-plot,.chart-empty{min-height:290px}
  .chart-y-label,.chart-x-label{font-size:11px}
  .chart-metric strong{font-size:27px}
}

/* v33 — painel de gráficos clínicos */
.chart-sheet{
  
  max-
  padding-bottom:26px!important;
}
.chart-sheet > p{margin-bottom:18px}
.chart-dashboard-actions{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin:2px 0 16px;
}
.chart-dashboard-actions .liquid-button{
  min-height:48px;
  padding:0 18px;
  border-radius:18px;
  font-size:15px;
  font-weight:650;
}
.chart-summary{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:12px;
  margin-bottom:14px;
}
.chart-summary-card,
.chart-filter-card,
.chart-card,
.chart-metric{
  border:1px solid rgba(190,207,235,.14);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.08),0 16px 30px rgba(0,0,0,.18);
}
.chart-summary-card{
  padding:16px 16px 14px;
  border-radius:22px;
  background:linear-gradient(180deg,rgba(32,45,64,.76),rgba(18,29,44,.70));
}
.chart-summary-card strong,
.chart-metric strong{
  display:block;
  color:#f6f7fb;
  font-family:"Palatino Linotype",Palatino,"Book Antiqua",Georgia,serif;
  font-size:29px;
  line-height:1.05;
  font-weight:700;
}
.chart-summary-card span,
.chart-metric span{
  display:block;
  margin-top:7px;
  color:#aebbd0;
  font-family:"Palatino Linotype",Palatino,"Book Antiqua",Georgia,serif;
  font-size:14px;
  line-height:1.35;
}
.chart-card{
  margin-top:14px;
  padding:18px 18px 16px;
  border-radius:28px;
  background:
    radial-gradient(circle at 12% 0%,rgba(122,164,237,.10),transparent 28%),
    linear-gradient(180deg,rgba(17,29,44,.96),rgba(8,18,31,.98));
}
.chart-card-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
}
.chart-card-head h3{
  margin:4px 0 0;
  font-family:"Palatino Linotype",Palatino,"Book Antiqua",Georgia,serif;
  font-size:28px;
  line-height:1.1;
}
.chart-card-subtitle{
  margin-top:8px;
  color:#aebbd0;
  font-family:"Palatino Linotype",Palatino,"Book Antiqua",Georgia,serif;
  font-size:15px;
  line-height:1.45;
}
.chart-export-btn{
  flex:0 0 auto;
  min-width:88px;
  min-height:46px;
  border-radius:18px;
  padding:0 16px;
  font-size:14px;
  font-weight:650;
}
.chart-range{
  flex:0 0 auto;
  align-self:center;
  padding:10px 14px;
  border-radius:999px;
  background:rgba(124,160,223,.12);
  border:1px solid rgba(190,207,235,.12);
  color:#c9d6ea;
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text",system-ui,sans-serif;
  font-size:12px;
  font-weight:650;
  line-height:1;
  letter-spacing:.02em;
}
.chart-plot{margin-top:14px;min-height:320px}
.pain-chart-svg{display:block;width:100%;height:auto}
.chart-backdrop{fill:rgba(11,20,34,.76)}
.chart-grid{stroke:rgba(190,207,235,.11);stroke-width:1}
.chart-axis{stroke:rgba(211,224,246,.28);stroke-width:1.2}
.chart-y-label,
.chart-x-label{fill:#95a3b7;font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text",system-ui,sans-serif;font-size:12px}
.chart-line-glow{fill:none;stroke-width:10;stroke-linecap:round;stroke-linejoin:round}
.chart-line{fill:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:round}
.chart-empty{min-height:320px;display:grid;place-items:center;padding:36px 18px;text-align:center}
.chart-note{margin:12px 4px 0;color:#9faec4;font-family:"Palatino Linotype",Palatino,"Book Antiqua",Georgia,serif;font-size:14px;line-height:1.48}
@media(max-width:700px){
  .chart-dashboard-actions{flex-direction:column;align-items:stretch}
  .chart-summary{grid-template-columns:repeat(2,minmax(0,1fr))}
  .chart-filter-grid{grid-template-columns:1fr 1fr}
  .chart-filter-clear{grid-column:1/-1;margin-top:0}
  .chart-card-head{flex-direction:column;align-items:flex-start}
  .chart-range{align-self:flex-start}
}
@media(max-width:520px){
  .chart-sheet{max-}
  .chart-summary{grid-template-columns:1fr}
  .chart-card{padding:16px 14px 14px;border-radius:24px}
  .chart-filter-card{padding:14px 14px 12px;border-radius:22px}
  .chart-filter-grid{grid-template-columns:1fr 1fr}
  .chart-filter-clear{grid-column:1/-1}
  .chart-card-head h3{font-size:25px}
  .chart-range{font-size:11px;padding:9px 12px}
  .chart-plot,.chart-empty{min-height:290px}
  .chart-y-label,.chart-x-label{font-size:11px}
  .chart-summary-card strong{font-size:27px}
}

/* v34 — ações dos gráficos e equilíbrio visual */
.chart-dashboard-actions{
  display:grid;
  grid-template-columns:max-content minmax(0,1fr);
  align-items:center;
  gap:14px;
}
.chart-dashboard-btn,
.chart-range{
  box-sizing:border-box;
  height:52px;
  min-height:52px;
  display:flex;
  align-items:center;
  justify-content:center;
}
.chart-dashboard-btn{
  margin:0;
  padding:0 20px;
  white-space:nowrap;
  color:#eef3fb;
  font-family:"Palatino Linotype",Palatino,"Book Antiqua",Georgia,serif;
  font-size:16px;
  font-weight:700;
  background:linear-gradient(180deg,rgba(60,72,92,.72),rgba(37,48,66,.76));
  border:1px solid rgba(210,222,241,.17);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 12px 24px rgba(0,0,0,.20);
}
.chart-range{
  justify-self:end;
  max-width:100%;
  padding:0 17px;
  white-space:nowrap;
}
.chart-export-btn{
  box-sizing:border-box;
  height:46px;
  min-height:46px;
  margin:0;
  padding:0 16px;
  display:flex;
  align-items:center;
  justify-content:center;
  color:#eef3fb;
  font-family:"Palatino Linotype",Palatino,"Book Antiqua",Georgia,serif;
  font-size:15px;
  font-weight:700;
  background:linear-gradient(180deg,rgba(60,72,92,.72),rgba(37,48,66,.76));
  border:1px solid rgba(210,222,241,.17);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 10px 22px rgba(0,0,0,.18);
}
.chart-area{
  opacity:1;
}
@media(max-width:700px){
  .chart-dashboard-actions{
    grid-template-columns:1fr;
  }
  .chart-dashboard-btn,
  .chart-range{
    width:100%;
    justify-self:stretch;
  }
}


/* v35 — compatibilidade WebKit para gráficos SVG de área */
.pain-chart-svg .chart-area{opacity:1}
.pain-chart-svg .chart-line,.pain-chart-svg .chart-line-glow{fill:none}
.pain-chart-svg .chart-single-point{vector-effect:non-scaling-stroke}

/* v36 — texto configurável das notificações */
.notification-message-sheet{width:calc(100% - 32px)!important;max-width:520px!important;margin-inline:auto!important}
.notification-message-input{display:block;width:100%;min-width:0;max-width:100%;min-height:112px;resize:none;border:1px solid var(--line);border-radius:18px;background:rgba(255,255,255,.065);color:#fff;padding:15px 16px;font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text",system-ui,sans-serif;font-size:17px;line-height:1.45;outline:none;box-sizing:border-box}
.notification-message-input:focus{border-color:rgba(145,180,230,.46);box-shadow:0 0 0 3px rgba(95,145,215,.10)}
.notification-message-meta{display:flex;justify-content:space-between;gap:14px;align-items:flex-start;margin:8px 2px 18px;color:var(--muted);font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text",system-ui,sans-serif;font-size:12px;line-height:1.4}
.notification-message-meta span{min-width:0}.notification-message-meta b{flex:0 0 auto;color:#c3ccda;font-variant-numeric:tabular-nums;font-weight:600}
@media(max-width:520px){.notification-message-sheet{width:calc(100% - 24px)!important;max-width:calc(100% - 24px)!important}.notification-message-meta{font-size:11px}}

/* v37 — safe area global e ancoragem robusta da tab bar no iOS/iPadOS */
html,body{
  min-height:100%;
  min-height:100dvh;
}

/*
  Full-screen secondary views use a non-scrolling dialog shell and an explicit
  inner scroll container. This avoids the iOS/WebKit case where a fixed child
  can become visually attached to the scrolled dialog and appear in the middle
  of the screen after a long drag/bounce.
*/
.full-dialog[open]{
  position:fixed!important;
  inset:0!important;
  width:100vw!important;
  height:100dvh!important;
  max-width:100vw!important;
  max-height:100dvh!important;
  margin:0!important;
  overflow:hidden!important;
  overscroll-behavior:none;
}
.full-dialog[open] > .full-panel{
  width:100%;
  height:100dvh;
  min-height:0;
  overflow-x:hidden;
  overflow-y:auto;
  overscroll-behavior-y:contain;
  -webkit-overflow-scrolling:touch;
  padding-top:calc(env(safe-area-inset-top) + 12px);
  padding-bottom:calc(env(safe-area-inset-bottom) + 146px);
  scroll-padding-top:calc(env(safe-area-inset-top) + 72px);
}
.full-dialog .full-header{
  position:relative;
  z-index:35;
}

/*
  Every sheet/centered dialog already shares .sheet-dialog. Keep its entire
  interactive surface below the status-bar safe area regardless of content
  height. The close control therefore cannot occupy the clock/Dynamic Island
  region on any secondary sheet.
*/
.sheet-dialog[open]{
  box-sizing:border-box;
  max-height:100dvh!important;
  overflow:hidden;
  padding-top:calc(env(safe-area-inset-top) + 8px)!important;
}
.centered-dialog[open]{
  padding-top:calc(env(safe-area-inset-top) + 8px)!important;
  padding-bottom:calc(env(safe-area-inset-bottom) + 8px)!important;
}
.sheet-dialog[open] > .sheet{
  max-height:calc(100dvh - env(safe-area-inset-top) - 8px)!important;
  overflow-x:hidden;
  overflow-y:auto;
  overscroll-behavior-y:contain;
  -webkit-overflow-scrolling:touch;
  scroll-padding-top:72px;
}
.centered-dialog[open] > .centered-sheet{
  max-height:calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 24px)!important;
}
.sheet-dialog[open] > .sheet .sheet-close{
  z-index:50;
  pointer-events:auto;
}


/* v2.20 — check-in sheet must expose its complete perimeter in both steps. */
body.mm-registro #checkinDialog[open] > .sheet{
  border:1px solid var(--mm-border-strong) !important;
  border-bottom:1px solid var(--mm-border-strong) !important;
  border-radius:var(--mm-radius-sheet) !important;
}
body.mm-registro #painList [data-pain]:disabled{
  opacity:.55;
  pointer-events:none;
}

/*
  The tab bar is always compositor-anchored to the visual bottom. Explicitly
  resetting top/margins and disabling drag/text gestures prevents WebKit from
  leaving it at an intermediate scroll position after overscroll.
*/
.tabbar,
.panel-tabbar{
  position:fixed!important;
  top:auto!important;
  left:50%!important;
  right:auto!important;
  bottom:calc(env(safe-area-inset-bottom) + 10px)!important;
  margin:0!important;
  transform:translate3d(-50%,0,0)!important;
  -webkit-transform:translate3d(-50%,0,0)!important;
  backface-visibility:hidden;
  -webkit-backface-visibility:hidden;
  touch-action:manipulation;
  user-select:none;
  -webkit-user-select:none;
  -webkit-user-drag:none;
  pointer-events:auto;
  will-change:transform;
}
body > .tabbar{z-index:60!important}
.full-dialog .panel-tabbar{z-index:80!important}

/* v38 — horário limite dos relembretes 2× */
.frequency-cutoff-card{
  margin:14px 0 16px;
  padding:15px 16px;
  display:grid;
  grid-template-columns:minmax(0,1fr) 132px;
  gap:16px;
  align-items:center;
  border:1px solid rgba(190,207,235,.13);
  border-radius:20px;
  background:linear-gradient(180deg,rgba(37,49,69,.68),rgba(25,35,52,.64));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.08);
}
.frequency-cutoff-card>div:first-child{min-width:0}
.frequency-cutoff-card strong{
  display:block;
  color:#f1f4f9;
  font-family:"Palatino Linotype",Palatino,"Book Antiqua",Georgia,serif;
  font-size:17px;
  line-height:1.2;
}
.frequency-cutoff-card span{
  display:block;
  margin-top:5px;
  color:#aeb9ca;
  font-family:"Palatino Linotype",Palatino,"Book Antiqua",Georgia,serif;
  font-size:13px;
  line-height:1.42;
}
.frequency-cutoff-time-wrap{min-width:0;width:100%}
.frequency-cutoff-time-wrap .date-time-input{
  display:block!important;
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  height:54px!important;
  margin:0!important;
  padding:0 10px!important;
  box-sizing:border-box!important;
  border-radius:16px!important;
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Display","SF Pro Text",system-ui,sans-serif!important;
  font-size:23px!important;
  font-weight:650!important;
  line-height:54px!important;
  text-align:center!important;
  font-variant-numeric:tabular-nums;
  appearance:none!important;
  -webkit-appearance:none!important;
}
.frequency-cutoff-time-wrap input[type="time"]::-webkit-date-and-time-value{text-align:center!important}
.frequency-cutoff-time-wrap input[type="time"]::-webkit-datetime-edit,
.frequency-cutoff-time-wrap input[type="time"]::-webkit-datetime-edit-fields-wrapper{padding:0!important}
@media(max-width:520px){
  .frequency-cutoff-card{grid-template-columns:1fr;gap:12px;padding:14px}
  .frequency-cutoff-time-wrap .date-time-input{height:56px!important;line-height:56px!important;font-size:24px!important}
}

/* v1.42 — MMDS follow-up refinements */
#historyView .filter-row{
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}
#historyView .filter-row .filter-clear{
  grid-column:1 / -1;
  margin-top:0;
}
@media(max-width:389px){
  #historyView .filter-row{
    grid-template-columns:1fr;
  }
  #historyView .filter-row .filter-clear{
    grid-column:auto;
  }
}

#frequencyDialog .frequency-picker-trigger,
#frequencyDialog .switch-row,
#frequencyDialog .frequency-cutoff-card,
#frequencyDialog #saveFrequencyBtn,
#frequencyDialog .inline-note{
  margin-top:12px;
}
#frequencyDialog .switch-row{
  padding:16px 18px;
  gap:16px;
  align-items:center;
}
#frequencyDialog .switch-row strong{
  font-size:17px;
}
#frequencyDialog .switch-row span{
  max-width:none;
}
#frequencyDialog .switch-row i{
  align-self:center;
}
#frequencyDialog .switch-row-stack{
  padding-top:16px;
  padding-bottom:16px;
}

.export-preview-panel .history-full-list{
  padding-bottom:118px;
}
.export-preview-list .empty-state{
  width:min(760px,100%);
  margin:0 auto;
}
.export-preview-actionbar{
  position:sticky;
  bottom:0;
  z-index:4;
  width:min(760px,100%);
  margin:0 auto;
  padding:12px 0 calc(12px + env(safe-area-inset-bottom));
  background:linear-gradient(180deg,rgba(7,17,28,0),rgba(7,17,28,.94) 28%,rgba(7,17,28,.98) 100%);
}
.export-preview-actionbar .primary-button{
  width:100%;
}

/* v1.43 — tools grouping parity and reminder spacing refinements */
#dailyReminderDialog .switch-row{
  margin-top:12px;
  padding:16px 18px;
  gap:16px;
  align-items:center;
}
#dailyReminderDialog .switch-row strong{
  font-size:17px;
}
#dailyReminderDialog .switch-row span{
  max-width:none;
}
#dailyReminderDialog .field-label{
  display:block;
  padding-left:4px;
  margin-top:14px;
}
#dailyReminderDialog .timezone-note{
  margin:10px 4px 16px;
}
#dailyReminderDialog .daily-reminder-time-wrap .date-time-input,
#frequencyDialog .frequency-cutoff-time-wrap .date-time-input{
  font-size:26px !important;
  height:58px !important;
  line-height:58px !important;
}
#dailyReminderDialog .daily-reminder-time-wrap .date-time-input{
  padding-inline:18px !important;
}
@media(max-width:520px){
  #dailyReminderDialog .daily-reminder-time-wrap .date-time-input,
  #frequencyDialog .frequency-cutoff-time-wrap .date-time-input{
    font-size:25px !important;
  }
}


/* v1.45 — home parity and report filters */
.topbar.mm-app-header{align-items:flex-start}
.hero-card{min-height:286px;background-image:radial-gradient(circle at 82% 16%,rgba(157,188,232,.16),transparent 32%),linear-gradient(160deg,rgba(17,44,75,.92),rgba(11,31,52,.88) 42%,rgba(10,23,39,.86) 100%)}
.hero-overlay{background:linear-gradient(180deg,rgba(6,14,24,.05),rgba(6,14,24,.18))}
.hero-content{min-height:286px}
.section-head{margin:10px 4px 14px}
.summary-card{margin-top:0}
.quick-grid{margin-top:16px;margin-bottom:16px}


/* v1.46 — extra spacing on home blocks */
.section-head{margin:14px 4px 18px}
.summary-card{margin-top:0;margin-bottom:32px}
.quick-grid{margin-top:0;margin-bottom:32px}
.hero-card{margin-top:0}
@media(max-width:520px){
  .summary-card{margin-bottom:28px}
  .quick-grid{margin-bottom:28px}
}


/* v1.48 — standardized compact analytics */
.chart-sheet>h2{margin-bottom:12px}
.chart-filter-card{padding:12px 14px 13px;margin-bottom:12px}
.chart-quick-range{margin:0 0 12px}
.chart-filter-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px}
.chart-filter-grid label{grid-template-rows:auto 52px}
.chart-dashboard-actions{margin:0 0 10px;gap:10px}
.chart-summary{margin-bottom:10px!important}
.chart-summary-card{background:linear-gradient(180deg,rgba(32,45,64,.76),rgba(18,29,44,.70))}
.chart-card{margin-top:12px}
@media(max-width:520px){
  .chart-filter-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .chart-summary{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}

/* v1.53 — analytics aligned with Diário de Medicação */
.chart-sheet .mm-analysis-controls{display:block}
.chart-sheet .analysis-quick-range{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:7px;
  margin-top:4px;
}
.chart-sheet .range-chip{
  min-width:0;
  min-height:42px;
  padding:0 7px;
  font-size:13px;
  white-space:nowrap;
}
.chart-sheet .analysis-period-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
  margin-top:14px;
}
.chart-sheet .analysis-period-grid label{
  min-width:0;
  display:grid;
  gap:8px;
}
.chart-sheet .analysis-actions.chart-dashboard-actions{
  display:grid;
  grid-template-columns:1fr;
  gap:12px;
  margin:12px 0 14px;
}
.chart-sheet .chart-range{display:none !important}
.chart-sheet .chart-dashboard-btn{
  width:100%;
  min-height:50px;
}
.chart-sheet .chart-summary{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
  margin-bottom:12px !important;
}
.chart-sheet .chart-summary-card{
  padding:11px 12px 10px;
  border-radius:17px;
}
.chart-sheet .chart-summary-card span{
  margin-top:0;
  margin-bottom:5px;
  font-size:11px;
  line-height:1.2;
  text-transform:uppercase;
  letter-spacing:.06em;
}
.chart-sheet .chart-summary-card strong{
  font-size:19px;
  line-height:1.11;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.chart-sheet .chart-summary-card small{
  margin-top:4px;
  font-size:11px;
  line-height:1.25;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
@media(max-width:430px){
  .chart-sheet .analysis-quick-range{gap:5px}
  .chart-sheet .range-chip{font-size:12px;padding:0 4px}
  .chart-sheet .chart-summary-card strong{font-size:18px}
}


/* v2.1 — MM Registro AppShell primary views */
#homeView,#historyView,#settingsView{min-width:0;}
#historyView .bottom-spacer,#settingsView .bottom-spacer{height:18px;}



/* v2.8 — charts refinement and compact export preview */
.chart-note{
  margin:10px 4px 0;
}
.chart-plot{
  min-height:0;
}


/* MM Registro 2.47 — central unificada de lembretes: Secondary Sheet canônico + geometria consistente */
#frequencyDialog.reminder-settings-dialog{padding-top:calc(var(--mm-safe-top) + 8px)}
#frequencyDialog.reminder-settings-dialog .reminder-settings-sheet{
  width:min(760px,100%);max-width:760px;height:calc(100dvh - var(--mm-safe-top) - 8px);max-height:calc(100dvh - var(--mm-safe-top) - 8px);
  padding-top:0;overflow-x:hidden;overflow-y:auto;scroll-padding-top:126px
}
#frequencyDialog .reminder-settings-sticky-zone{
  position:sticky;top:0;z-index:24;margin:0 -18px 14px;padding:8px 18px 14px;border-bottom:1px solid rgba(159,198,236,.13);
  background:linear-gradient(180deg,rgba(8,20,34,.998),rgba(7,18,30,.992))
}
#frequencyDialog .reminder-settings-sticky-zone .sheet-handle{margin-bottom:14px}
#frequencyDialog .reminder-settings-heading{margin:0;padding:0 66px 0 2px}
#frequencyDialog .reminder-settings-heading h2{margin:0}
#frequencyDialog .frequency-wheel-done{min-height:48px}
#frequencyDialog .reminder-config-section{
  margin:16px 0 0;padding:16px;border:1px solid rgba(190,207,235,.13);border-radius:22px;
  background:linear-gradient(180deg,rgba(37,49,69,.66),rgba(25,35,52,.60));box-shadow:inset 0 1px 0 rgba(255,255,255,.07)
}
#frequencyDialog .reminder-section-heading{margin:0 2px 12px}
#frequencyDialog .reminder-section-heading>strong{display:block;color:#f3f6fb;font-family:"Palatino Linotype",Palatino,"Book Antiqua",Georgia,serif;font-size:19px;line-height:1.2}
#frequencyDialog .reminder-section-heading>span{display:block;margin-top:5px;color:#aeb9ca;font-family:"Palatino Linotype",Palatino,"Book Antiqua",Georgia,serif;font-size:13px;line-height:1.42}
#frequencyDialog .reminder-config-section .switch-row{margin:0 0 13px;padding:14px 15px}
#frequencyDialog .reminder-config-section .frequency-picker-trigger{margin:0;height:60px;min-height:60px;max-height:60px}
#frequencyDialog .reminder-field{
  box-sizing:border-box;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,42%);align-items:center;gap:14px;
  margin:10px 0 0;padding:13px 14px;border:1px solid rgba(190,207,235,.11);border-radius:17px;background:rgba(255,255,255,.045);
  color:#edf2f9;font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text",system-ui,sans-serif;font-size:15px;line-height:1.25;overflow:hidden
}
#frequencyDialog .reminder-field>span:first-child{min-width:0;display:block}
#frequencyDialog .reminder-field--stacked{grid-template-columns:minmax(0,1fr);align-items:stretch;gap:10px}
#frequencyDialog .reminder-field--stacked>span:first-child{margin:0}
#frequencyDialog .reminder-control-inset{box-sizing:border-box;width:calc(100% - 16px)!important;max-width:calc(100% - 16px)!important;min-width:0!important;margin-left:8px!important;margin-right:8px!important;}
#frequencyDialog .reminder-time-control{display:block;height:60px;min-height:60px;max-height:60px;overflow:hidden;border-radius:15px;}
#frequencyDialog .reminder-field--button .reminder-field-button{width:100%}
#frequencyDialog .reminder-field--textarea .notification-message-input{margin-top:0}
#frequencyDialog .reminder-field--textarea .notification-message-meta{margin:8px 0 0}
#frequencyDialog .reminder-field>span:first-child>b{display:block;font-size:15px}
#frequencyDialog .reminder-field>span:first-child>small{display:block;margin-top:4px;color:#aeb9ca;font-family:"Palatino Linotype",Palatino,"Book Antiqua",Georgia,serif;font-size:12px;line-height:1.35}
#frequencyDialog .reminder-select,#frequencyDialog .reminder-number-input,#frequencyDialog .reminder-number-control,#frequencyDialog .reminder-time-input{
  box-sizing:border-box;display:block;width:100%;max-width:100%;min-width:0;height:60px;min-height:60px;max-height:60px;border:1px solid rgba(190,207,235,.18);border-radius:15px;
  background:rgba(8,18,31,.72);color:#f5f8fc;font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text",system-ui,sans-serif;font-size:17px;font-weight:600;overflow:hidden
}
#frequencyDialog .reminder-select{padding:0 38px 0 14px;line-height:60px}
#frequencyDialog .reminder-number-input{padding:0 14px;text-align:center;font-variant-numeric:tabular-nums}
#frequencyDialog .reminder-number-control{position:relative;display:block;padding:0;overflow:hidden}
#frequencyDialog .reminder-number-control input{
  display:block;width:100%!important;max-width:100%!important;min-width:0!important;height:58px!important;min-height:58px!important;margin:0!important;
  border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important;color:#fff!important;padding:0 64px 0 18px!important;text-align:center!important;
  font:inherit!important;font-size:18px!important;font-variant-numeric:tabular-nums;outline:none!important;box-sizing:border-box!important;-webkit-appearance:none!important;appearance:none!important
}
#frequencyDialog .reminder-number-control input::-webkit-inner-spin-button,#frequencyDialog .reminder-number-control input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
#frequencyDialog .reminder-number-control b{
  position:absolute;right:18px;top:0;bottom:0;display:flex;align-items:center;justify-content:center;margin:0;padding:0;border:0;background:transparent;
  color:#aeb9ca;font-size:14px;font-weight:700;white-space:nowrap;pointer-events:none
}
#frequencyDialog .reminder-time-control .reminder-time-input{display:block;width:100%!important;max-width:100%!important;min-width:0!important;height:60px!important;min-height:60px!important;max-height:60px!important;margin:0!important;padding:0 10px!important;line-height:60px!important;text-align:center!important;font-size:19px!important;font-variant-numeric:tabular-nums;-webkit-appearance:none;appearance:none}
#frequencyDialog .reminder-time-control .reminder-time-input::-webkit-date-and-time-value{min-width:0!important;text-align:center!important}
#frequencyDialog .reminder-time-control .reminder-time-input::-webkit-datetime-edit,
#frequencyDialog .reminder-time-control .reminder-time-input::-webkit-datetime-edit-fields-wrapper{padding:0!important;min-width:0!important}
#frequencyDialog .reminder-field[hidden]{display:none!important}
#frequencyDialog .notification-message-input{margin-top:6px}
#frequencyDialog .notification-message-meta{margin-bottom:0}
#frequencyDialog .reminder-save{margin-top:18px!important}
#frequencyDialog .timezone-note{margin:9px 4px 0;color:#aeb9ca;font-size:12px;line-height:1.35}
#frequencyDialog input:disabled,#frequencyDialog select:disabled{opacity:.48}
@media(max-width:520px){
  #frequencyDialog .reminder-settings-sticky-zone{margin-left:-14px;margin-right:-14px;padding-left:14px;padding-right:14px}
  #frequencyDialog .reminder-config-section{padding:14px;border-radius:20px}
  #frequencyDialog .reminder-field{grid-template-columns:1fr;gap:9px;padding:13px}
  #frequencyDialog .reminder-select,#frequencyDialog .reminder-number-input,#frequencyDialog .reminder-number-control,#frequencyDialog .reminder-time-input{height:60px;min-height:60px;max-height:60px}
  #frequencyDialog .reminder-time-input{line-height:60px!important;font-size:20px!important}
}


/* MM Registro 2.47 — Central de Lembretes em padrão grouped settings.
   Um card por assunto; dentro dele, linhas simples + um único controle por configuração. */
#frequencyDialog .reminder-config-section{
  padding:16px 18px;
}
#frequencyDialog .reminder-config-section .switch-row{
  margin:0!important;
  padding:12px 0 14px!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
}
#frequencyDialog .reminder-field{
  display:grid;
  grid-template-columns:minmax(0,1fr);
  align-items:stretch;
  gap:8px;
  width:100%;
  margin:0;
  padding:14px 0;
  border:0;
  border-top:1px solid rgba(190,207,235,.12);
  border-radius:0;
  background:transparent;
  box-shadow:none;
  overflow:visible;
}
#frequencyDialog .reminder-section-heading + .reminder-field,
#frequencyDialog .reminder-section-heading + .switch-row{border-top:0;}
#frequencyDialog .reminder-field>span:first-child{
  margin:0 2px;
  color:#c4ccd8;
  font-size:15px;
  line-height:1.3;
}
#frequencyDialog .reminder-control-inset{
  width:100%!important;
  max-width:100%!important;
  margin-left:0!important;
  margin-right:0!important;
}
#frequencyDialog .reminder-select,
#frequencyDialog .reminder-number-input,
#frequencyDialog .reminder-number-control,
#frequencyDialog .reminder-time-control,
#frequencyDialog .reminder-field-button,
#frequencyDialog .notification-message-input{
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
}
#frequencyDialog .reminder-field--button .frequency-picker-trigger{margin:0!important;}
#frequencyDialog .reminder-field--textarea .notification-message-input{margin:0!important;}
#frequencyDialog .reminder-field--textarea .notification-message-meta{margin:8px 2px 0!important;}
#frequencyDialog .timezone-note{margin:10px 2px 0;}
@media(max-width:520px){
  #frequencyDialog .reminder-config-section{padding:14px 16px;}
  #frequencyDialog .reminder-field{padding:13px 0;gap:8px;}
}


/* MM Registro 2.47 — contextual image action follows each chart explanation. */
#chartDialog .chart-card-head{display:block;}
#chartDialog .chart-export-action{display:flex;justify-content:center;width:100%;margin:14px 0 2px;}
#chartDialog .chart-export-action .chart-export-btn{width:min(320px,100%);min-width:0;min-height:50px;height:50px;margin:0 auto;padding:0 22px;border-radius:18px;font-size:16px;}
@media(max-width:430px){#chartDialog .chart-export-action .chart-export-btn{width:min(300px,100%);}}

/* Check-in 2.49 — paired reminder settings keep semantically related controls together. */
#frequencyDialog .reminder-field-pair{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
  width:100%;
  padding:14px 0;
  border-top:1px solid rgba(190,207,235,.12);
}
#frequencyDialog .reminder-section-heading + .reminder-field-pair{border-top:0;padding-top:0;}
#frequencyDialog .reminder-field-pair .reminder-field{
  min-width:0;
  padding:0;
  border-top:0;
}
#frequencyDialog .reminder-field-pair.is-single > :not([hidden]){grid-column:1 / -1;}
#frequencyDialog .reminder-field-pair + .reminder-field-pair{margin-top:0;}
@media(max-width:360px){
  #frequencyDialog .reminder-field-pair{grid-template-columns:minmax(0,1fr);gap:10px;}
  #frequencyDialog .reminder-field-pair > *{grid-column:1!important;}
}

/* Check-in 2.50 — paired controls share identical rendered height and baseline. */
#frequencyDialog .reminder-field-pair{align-items:stretch;}
#frequencyDialog .reminder-field-pair .reminder-field--paired{
  height:100%;
  min-height:0;
  align-self:stretch;
  grid-template-rows:minmax(42px,1fr) 60px;
  align-content:stretch;
}
#frequencyDialog .reminder-field-pair .reminder-field--paired>span:first-child{
  display:flex;
  align-items:flex-start;
  min-height:42px;
}
#frequencyDialog .reminder-field-pair .reminder-field--paired>.reminder-select,
#frequencyDialog .reminder-field-pair .reminder-field--paired>.reminder-number-input,
#frequencyDialog .reminder-field-pair .reminder-field--paired>.reminder-number-control{
  height:60px!important;
  min-height:60px!important;
  max-height:60px!important;
  align-self:end;
}
@media(max-width:360px){
  #frequencyDialog .reminder-field-pair .reminder-field--paired{grid-template-rows:auto 60px;}
  #frequencyDialog .reminder-field-pair .reminder-field--paired>span:first-child{min-height:0;}
}


/* Check-in 2.52 — paired reminder controls use a 60/40 hierarchy.
   Primary rule controls get more room; compact numeric parameters share one visual style. */
#frequencyDialog #followupModePair,
#frequencyDialog #followupIntervalPair{
  grid-template-columns:minmax(0,3fr) minmax(0,2fr);
}
#frequencyDialog #followupCount,
#frequencyDialog #followupIntervalMinutes{
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  height:60px!important;
  min-height:60px!important;
  max-height:60px!important;
  padding:0 14px!important;
  border:1px solid rgba(190,207,235,.18)!important;
  border-radius:15px!important;
  background:rgba(8,18,31,.72)!important;
  color:#f5f8fc!important;
  text-align:center!important;
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text",system-ui,sans-serif!important;
  font-size:17px!important;
  font-weight:600!important;
  font-variant-numeric:tabular-nums;
  box-sizing:border-box!important;
  -webkit-appearance:none;
  appearance:textfield;
}
#frequencyDialog #followupCount::-webkit-inner-spin-button,
#frequencyDialog #followupCount::-webkit-outer-spin-button,
#frequencyDialog #followupIntervalMinutes::-webkit-inner-spin-button,
#frequencyDialog #followupIntervalMinutes::-webkit-outer-spin-button{
  -webkit-appearance:none;
  margin:0;
}
@media(max-width:360px){
  #frequencyDialog #followupModePair,
  #frequencyDialog #followupIntervalPair{grid-template-columns:minmax(0,1fr);}
}


/* 2.57 — estado de notificações: um único switch no padrão iOS. */
#frequencyDialog .notification-master-row{margin:0 0 14px;padding:14px 15px}
#frequencyDialog .notification-master-row.is-disabled{opacity:.72}
#frequencyDialog .notification-master-row input:disabled+i{opacity:.55}
#frequencyBtn.is-disabled .quick-icon{opacity:.58}
#frequencyBtn.is-disabled .quick-value{color:var(--muted)}

/* D4.3.2 — Monitoramento de Dor: card com margens e respiro no padrão MM Registro. */
.pain-monitoring-copy{padding:10px 22px 4px;color:var(--muted);line-height:1.55}
.pain-monitoring-copy p{margin:0}
.pain-monitoring-sheet .reminder-config-section{
  margin:16px 0 0;
  padding:0;
}
.pain-monitoring-sheet .reminder-config-section .switch-row{
  gap:16px;
  padding:16px 18px;
  border:1px solid rgba(190,207,235,.13);
  border-radius:22px;
  background:linear-gradient(180deg,rgba(37,49,69,.66),rgba(25,35,52,.60));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.07);
}
.pain-monitoring-sheet .reminder-config-section .switch-row>div{min-width:0;padding-right:8px}
.pain-monitoring-sheet .reminder-config-section .switch-row span{max-width:none}
.pain-monitoring-sheet .reminder-config-section .switch-row i{margin-right:0}
.pain-not-informed{color:var(--muted);font-style:italic}

/* D4.3.7 — Política de Privacidade dentro da Secondary Sheet; suporte por e-mail direto. */
.privacy-policy-content{padding:0 2px 30px;color:rgba(255,255,255,.84);font-size:15px;line-height:1.6}
.privacy-policy-content .updated{margin:0 0 22px;color:var(--muted);font-size:13px}
.privacy-policy-content h1{display:none}
.privacy-policy-content h2{margin:26px 0 8px;color:#fff;font-size:19px;line-height:1.2}
.privacy-policy-content p{margin:0 0 14px}
.privacy-policy-content ul{margin:0 0 16px;padding-left:20px}
.privacy-policy-content li{margin:0 0 6px}
.privacy-policy-content a{color:#9dccff}


/* Dentes 2.81 — Suporte e modo diagnóstico */
.support-sheet .support-copy{padding-bottom:4px}
.support-sheet .support-config-section{display:grid;gap:12px;margin:16px 0 0;padding:0}
.support-sheet .support-config-section .support-action-row{
  width:100%;
  min-height:82px;
  margin:0;
  padding:14px 15px;
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  gap:14px;
  align-items:center;
  border:1px solid var(--mm-border);
  border-radius:var(--mm-radius-card-small);
  background:var(--mm-surface);
  box-shadow:none;
  color:var(--mm-text-primary);
  font-family:var(--mm-font-ui);
  text-align:left;
  appearance:none;
  -webkit-appearance:none;
}
.support-sheet .support-config-section .support-action-row:active{background:var(--mm-surface-pressed);transform:scale(.992)}
.support-sheet .support-action-row .support-action-copy{min-width:0}
.support-sheet .support-action-row strong,.support-sheet .support-action-row small{display:block}
.support-sheet .support-action-row strong{font-size:18px;line-height:1.2}
.support-sheet .support-action-row small{margin-top:4px;color:var(--muted);font-size:14px;line-height:1.4}
.support-sheet .support-action-row b{font-size:22px;color:#98a4b8;font-weight:600}
.support-sheet .support-config-section .switch-row{margin:0;padding:14px 15px}
.support-sheet .support-config-section .switch-row>div{min-width:0;padding-right:8px}
.support-sheet .support-config-section .switch-row span{max-width:none}

/* Histórico grande: renderização progressiva evita milhares de nós DOM simultâneos. */
.history-load-more{display:flex;flex-direction:column;align-items:center;gap:10px;padding:18px 0 4px;color:var(--muted)}
.history-load-more .secondary-button{padding:10px 18px;font-size:14px}
