:root{
  --bg:#f7f2ec;--panel:#fffdf9;--text:#2c332b;--muted:#74766f;--sage:#64765d;
  --sage-dark:#455540;--sage-soft:#e4eadf;--peach:#d79a78;--peach-dark:#b87354;--peach-soft:#f5dfd2;--border:#dfe3da;--amber:#a96820;
  --amber-soft:#f7ead8;--red:#a84545;--red-soft:#f4dfdf;--blue-soft:#e4ecec;
  --shadow:0 12px 35px rgba(46,60,44,.08);--radius:18px
}
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:var(--bg);color:var(--text);font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
button,input,select,textarea{font:inherit}.app-shell{min-height:100vh;display:grid;grid-template-columns:260px 1fr}
.sidebar{background:#283328;color:#f7f8f3;padding:26px 18px;position:sticky;top:0;height:100vh;display:flex;flex-direction:column;overflow:auto}
.brand{display:flex;gap:12px;align-items:center;margin-bottom:24px}.brand-mark{width:42px;height:42px;border-radius:14px;background:#dfe8d7;color:#32402e;display:grid;place-items:center;font-weight:800;font-size:20px}
.brand h1{font-size:18px;margin:0}.brand p{font-size:11px;margin:3px 0 0;color:#cbd3c7}
nav{display:grid;gap:4px}.nav-btn{background:transparent;border:0;color:#dce2d9;text-align:left;padding:10px 12px;border-radius:11px;cursor:pointer;font-size:13px}.nav-btn:hover,.nav-btn.active{background:#3a4938;color:#fff}
.privacy-note{margin-top:auto;font-size:10.5px;line-height:1.5;color:#bec8ba;border-top:1px solid #485746;padding-top:16px}
.main{padding:28px 34px 60px;min-width:0}.topbar{display:flex;justify-content:space-between;align-items:center;margin-bottom:18px}.topbar h2{margin:2px 0 0;font-size:28px}.top-actions,.row{display:flex;align-items:center}.gap{gap:8px}
.eyebrow{text-transform:uppercase;letter-spacing:.11em;font-size:10px;font-weight:800;color:var(--sage);margin:0 0 6px}.muted{color:var(--muted);font-size:13px}
.page{display:none}.page.active{display:block}.card{background:var(--panel);border:1px solid var(--border);border-radius:var(--radius);padding:20px;box-shadow:var(--shadow)}
.hero-grid{display:grid;grid-template-columns:1.7fr .8fr;gap:16px;margin-bottom:16px}.focus-card{background:linear-gradient(135deg,#fdfcf8,#edf2e8)}.focus-card h3{font-size:26px;margin:5px 0 8px}.focus-card p:not(.eyebrow){color:var(--muted);max-width:720px}
.score-wrap{display:flex;align-items:end;gap:4px}.score{font-size:58px;line-height:1;font-weight:800;color:var(--sage-dark)}.score-card p:last-child{color:var(--muted)}
.metrics{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:16px}.metric{display:flex;flex-direction:column;gap:8px}.metric span{font-size:12px;color:var(--muted)}.metric strong{font-size:28px}.metric.warning strong{color:var(--amber)}
.two-col{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-bottom:16px}.section-head{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:14px}.section-head h3,.card>h3{margin:0 0 8px}
.btn{border:0;border-radius:11px;padding:10px 14px;font-weight:700;cursor:pointer}.btn.primary{background:var(--sage);color:white}.btn.primary:hover{background:var(--sage-dark)}.btn.secondary{background:var(--sage-soft);color:var(--sage-dark)}.btn.ghost{background:#fff;border:1px solid var(--border);color:var(--sage-dark)}.btn.danger{background:#f0dede;color:#8f3232}.btn.tiny{padding:7px 10px;font-size:11px}.icon-btn{border:0;background:transparent;font-size:24px;cursor:pointer}
.inline-form{display:grid;grid-template-columns:2fr 1fr 1fr 1fr auto;gap:9px}.inline-mini{display:grid;grid-template-columns:1fr auto;gap:8px;margin-top:14px}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.span-2{grid-column:span 2}.stack-form{display:grid;gap:12px}
label{display:grid;gap:6px;font-size:12px;font-weight:700;color:var(--muted)}input,select,textarea{width:100%;background:white;border:1px solid var(--border);border-radius:10px;padding:10px;color:var(--text);outline:none}input:focus,select:focus,textarea:focus{border-color:#9eac98;box-shadow:0 0 0 3px #edf1e9}textarea{resize:vertical}
.checklist,.stack,.attention-list,.task-list,.roadmap-stages{display:grid;gap:9px}.check-row,.attention,.task-item,.note-card,.roadmap-stage,.review-card{display:flex;align-items:flex-start;gap:10px;padding:11px 12px;border:1px solid var(--border);border-radius:12px;background:#fff}
.check-row input,.task-item input,.roadmap-stage input{width:auto;margin-top:3px}.check-row small,.attention small,.task-item small,.note-card small,.review-card small{display:block;color:var(--muted);margin-top:3px}.attention-dot{width:8px;height:8px;border-radius:999px;background:var(--amber);margin-top:6px;flex:0 0 auto}.empty{color:var(--muted);padding:14px 0;font-size:13px}
.task-item{align-items:center}.task-main{flex:1}.task-title{font-weight:700}.task-title.done{text-decoration:line-through;color:#929890}.pill{display:inline-block;font-size:10px;font-weight:800;border-radius:999px;padding:4px 7px;margin-left:5px;background:var(--sage-soft);color:var(--sage-dark)}.pill.high{background:var(--amber-soft);color:#8d571a}.pill.overdue{background:#f3dede;color:#913e3e}
.filters{display:flex;justify-content:flex-end;margin:14px 0 8px}.filters select{width:auto}
.table-wrap{overflow-x:auto}table{width:100%;border-collapse:collapse;font-size:12px}th,td{text-align:left;border-bottom:1px solid var(--border);padding:11px 8px;vertical-align:top}th{color:var(--muted);font-size:10px;text-transform:uppercase;letter-spacing:.08em}td button{padding:5px 8px;border:0;border-radius:8px;cursor:pointer}
.progress{height:10px;background:#e9ece5;border-radius:999px;overflow:hidden}.progress>div{height:100%;width:0;background:var(--sage);transition:width .2s}
.snapshot{display:grid;grid-template-columns:1fr 1fr;gap:12px}.snap{padding:14px;border-radius:14px;background:#f0f3ed}.snap span{display:block;color:var(--muted);font-size:11px}.snap strong{font-size:21px}
.alert-banner{margin-bottom:16px;padding:12px 14px;border-radius:13px;background:var(--red-soft);color:#7e3434;border:1px solid #eccaca;font-weight:700}.hidden{display:none!important}
.assistant-layout{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(260px,.7fr);gap:16px}.chat-card{min-height:70vh;display:flex;flex-direction:column}.assistant-status{display:flex;gap:10px;align-items:center;background:#f0f3ed;border-radius:12px;padding:10px 12px;margin-bottom:12px}.assistant-status small{display:block;color:var(--muted);margin-top:2px}.status-dot{width:10px;height:10px;border-radius:999px;background:var(--sage)}
.chat-messages{flex:1;min-height:360px;max-height:60vh;overflow:auto;padding:8px 2px;display:flex;flex-direction:column;gap:10px}.chat-msg{max-width:82%;padding:11px 13px;border-radius:15px;line-height:1.45;font-size:13px;white-space:pre-wrap}.chat-msg.user{align-self:flex-end;background:var(--sage);color:white;border-bottom-right-radius:5px}.chat-msg.assistant{align-self:flex-start;background:#f0f2ed;border:1px solid var(--border);border-bottom-left-radius:5px}.chat-input{display:grid;grid-template-columns:1fr auto;gap:9px;margin-top:12px;align-items:end}.prompt-list{display:grid;gap:8px}.prompt-chip{border:1px solid var(--border);background:#fff;text-align:left;border-radius:10px;padding:9px 10px;cursor:pointer;color:var(--sage-dark)}.prompt-chip:hover{background:var(--sage-soft)}.callout{margin-top:18px;background:#f3f5f0;border:1px solid var(--border);border-radius:13px;padding:13px;font-size:12px}.callout p{margin:6px 0 0;color:var(--muted);line-height:1.5}
.calendar-weekdays,.calendar-grid{display:grid;grid-template-columns:repeat(7,1fr)}.calendar-weekdays div{padding:9px;text-align:center;color:var(--muted);font-size:11px;font-weight:700}.calendar-grid{border-top:1px solid var(--border);border-left:1px solid var(--border)}.calendar-day{min-height:118px;border-right:1px solid var(--border);border-bottom:1px solid var(--border);padding:7px;background:white}.calendar-day.muted-day{background:#fafaf7;color:#a8aca5}.calendar-day.today{box-shadow:inset 0 0 0 2px var(--sage)}.calendar-num{font-size:11px;font-weight:800;margin-bottom:5px}.cal-event{font-size:10px;border-radius:7px;padding:4px 5px;margin-bottom:4px;background:var(--sage-soft);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.cal-event.task{background:var(--amber-soft)}.cal-event.overdue{background:var(--red-soft)}
.roadmap-stage{align-items:center}.roadmap-stage .task-main small{line-height:1.4}.roadmap-stage.complete{background:#f0f4ed}.roadmap-category{font-size:10px;text-transform:uppercase;letter-spacing:.08em;color:var(--sage);font-weight:800}
.chart-card canvas{width:100%;max-width:100%;display:block}.review-summary{line-height:1.6}.review-summary ul{padding-left:18px}.review-card{display:block}.review-card p{margin:6px 0}.custom-fields{display:grid;grid-template-columns:1fr 1fr;gap:12px}.toggle-list{display:grid;gap:8px}.toggle-row{display:flex;align-items:center;justify-content:space-between;padding:9px 10px;border:1px solid var(--border);border-radius:10px}.switch{width:auto}.tag-list{display:flex;gap:7px;flex-wrap:wrap}.tag{display:flex;align-items:center;gap:5px;background:var(--sage-soft);color:var(--sage-dark);border-radius:999px;padding:6px 9px;font-size:11px;font-weight:700}.tag button{border:0;background:transparent;cursor:pointer;color:inherit}
.danger-zone{border-color:#ecd1d1}dialog{border:0;border-radius:18px;padding:0;box-shadow:0 30px 80px rgba(0,0,0,.2)}dialog::backdrop{background:rgba(15,22,15,.45)}.dialog-card{width:min(440px,90vw);padding:22px;display:grid;gap:12px}
@media(max-width:1100px){.app-shell{grid-template-columns:220px 1fr}.metrics{grid-template-columns:1fr 1fr}.assistant-layout{grid-template-columns:1fr}}
@media(max-width:850px){.app-shell{grid-template-columns:1fr}.sidebar{position:relative;height:auto}.privacy-note{margin-top:20px}.main{padding:20px}.hero-grid,.two-col{grid-template-columns:1fr}.inline-form{grid-template-columns:1fr 1fr}.inline-form input:first-child{grid-column:span 2}.calendar-day{min-height:90px}.sidebar nav{grid-template-columns:1fr 1fr}}
@media(max-width:560px){.metrics{grid-template-columns:1fr 1fr}.form-grid,.inline-form,.inline-mini,.chat-input{grid-template-columns:1fr}.span-2,.inline-form input:first-child{grid-column:auto}.custom-fields{grid-template-columns:1fr}.topbar{align-items:flex-start;gap:10px}.top-actions{display:grid;gap:5px}.main{padding:14px}.sidebar{padding:18px 14px}.brand{margin-bottom:16px}.focus-card h3{font-size:22px}.score{font-size:46px}.calendar-weekdays div{font-size:9px;padding:5px}.calendar-day{min-height:76px;padding:4px}.cal-event{font-size:8px}.assistant-layout{display:block}.prompt-card{margin-top:14px}}


/* v3 mobile capture + command controls */
.page-tools{display:flex;justify-content:flex-end;margin-bottom:12px}
.capture-hero{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:16px;background:linear-gradient(135deg,#fdfcf8,#eaf0e5)}
.capture-hero h3{font-size:25px;margin:0 0 6px}
.capture-summary{margin-top:14px;padding:14px;border-radius:14px;background:#f0f3ed;min-height:88px;line-height:1.55}
.capture-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:14px}
.dictation-box{font-size:18px;line-height:1.55;min-height:290px;padding:16px}
.tiny-note{font-size:11px;color:var(--muted);line-height:1.5;margin:10px 0 0}
.mobile-command-form{display:grid;grid-template-columns:1fr auto;gap:10px;align-items:end}
.mobile-command-form textarea{font-size:17px;line-height:1.45}
.command-result{margin-top:12px;padding:12px 14px;border-radius:12px;background:#f0f3ed;white-space:pre-wrap;line-height:1.5;min-height:44px}
.command-result:empty{display:none}
@media(max-width:700px){
  .capture-hero{display:block}
  .capture-hero .btn{margin-top:12px}
  .mobile-command-form{grid-template-columns:1fr}
  .dictation-box{min-height:340px;font-size:19px}
}

/* v4: peach + green, linked metrics, multi-job schedule, cloud sync */
.sidebar{background:linear-gradient(180deg,#2d382c 0%,#344233 65%,#473d35 100%)}
.brand-mark{background:var(--peach-soft);color:#684736}
.nav-btn.active{background:linear-gradient(90deg,#495b45,#5b5449)}
.metric-link{border:1px solid var(--border);text-align:left;cursor:pointer;color:inherit;font:inherit;transition:transform .12s ease,box-shadow .12s ease,border-color .12s ease}
.metric-link:hover{transform:translateY(-2px);border-color:#c9d1c2;box-shadow:0 16px 38px rgba(46,60,44,.12)}
.metric-link small{font-size:10px;color:var(--sage);font-weight:700}
.metric.warning{background:linear-gradient(160deg,#fffdf9,#fbede3)}
.btn.primary{background:linear-gradient(135deg,var(--sage),#748a6c)}
.btn.secondary{background:linear-gradient(135deg,var(--sage-soft),var(--peach-soft));color:#4f5848}
.attention-dot{background:var(--peach-dark)}
.job-legend{display:flex;gap:8px;flex-wrap:wrap;margin:4px 0 14px}
.legend-item,.job-badge{display:inline-flex;align-items:center;gap:6px;border-radius:999px;padding:5px 9px;font-size:10px;font-weight:800;background:#fff;border:1px solid var(--border)}
.legend-dot{width:9px;height:9px;border-radius:50%;display:inline-block}
.cal-event{border-left:4px solid var(--job-color,var(--sage));background:color-mix(in srgb,var(--job-color,var(--sage)) 16%,white)}
.job-badge{border-color:color-mix(in srgb,var(--job-color,var(--sage)) 35%,#ddd);background:color-mix(in srgb,var(--job-color,var(--sage)) 14%,white)}
.job-settings{display:grid;gap:10px}.job-setting-row{display:grid;grid-template-columns:1.6fr .65fr auto;gap:9px;align-items:end;padding:12px;border:1px solid var(--border);border-radius:13px;background:#fff}
.job-setting-row input[type=color]{height:42px;padding:4px}
.sync-status{margin-top:12px;padding:12px;border-radius:12px;background:#fff;border:1px solid var(--border)}
.sync-actions{display:flex;gap:8px;flex-wrap:wrap}
.sync-indicator{display:inline-flex;padding:6px 9px;border-radius:999px;background:var(--peach-soft);color:#7a513d;font-size:11px;font-weight:800}
.sync-indicator.online{background:var(--sage-soft);color:var(--sage-dark)}
@media(max-width:700px){.job-setting-row{grid-template-columns:1fr 90px}.job-setting-row .remove-job{grid-column:span 2}.metrics{grid-template-columns:1fr 1fr}}

/* v5 dashboard calendar + persistent AI */
.dashboard-calendar-card{margin-bottom:16px;background:linear-gradient(150deg,#fffdf9,#fbf1e9)}
.dashboard-week-calendar{display:grid;grid-template-columns:repeat(7,1fr);gap:8px}
.week-day{min-height:128px;border:1px solid var(--border);border-radius:13px;padding:9px;background:#fff}
.week-day.today{box-shadow:inset 0 0 0 2px var(--sage)}
.week-day-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:7px}.week-day-name{font-weight:800;font-size:11px}.week-day-num{font-size:11px;color:var(--muted)}
.week-event{font-size:9.5px;padding:5px 6px;border-radius:8px;margin-bottom:5px;border-left:4px solid var(--job-color,var(--sage));background:color-mix(in srgb,var(--job-color,var(--sage)) 12%,white);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.floating-ai-btn{position:fixed;left:278px;bottom:18px;z-index:60;border:0;border-radius:999px;padding:12px 16px;display:flex;align-items:center;gap:8px;background:linear-gradient(135deg,var(--sage),var(--peach-dark));color:white;font-weight:800;box-shadow:0 15px 40px rgba(40,55,39,.25);cursor:pointer}
.ai-spark{font-size:18px}.floating-ai-panel{position:fixed;left:278px;bottom:72px;z-index:70;width:min(390px,calc(100vw - 300px));height:510px;border:1px solid var(--border);border-radius:18px;background:var(--panel);box-shadow:0 25px 70px rgba(34,44,33,.25);display:flex;flex-direction:column;padding:14px}
.floating-ai-head{display:flex;justify-content:space-between;align-items:center;padding-bottom:9px;border-bottom:1px solid var(--border)}.floating-ai-head small{display:block;color:var(--muted);margin-top:2px}
.floating-ai-messages{flex:1;overflow:auto;padding:10px 0;display:flex;flex-direction:column;gap:8px}.floating-ai-form{display:grid;grid-template-columns:1fr auto;gap:8px;align-items:end}

/* source toggles and smarter time */
.source-toggle-wrap{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:12px}.source-toggle{display:flex;gap:6px;flex-wrap:wrap}.source-toggle-capture{margin-bottom:12px}
.source-toggle-btn{border:1px solid var(--border);border-radius:999px;background:#fff;padding:7px 11px;font-size:11px;font-weight:800;cursor:pointer}.source-toggle-btn.active{background:var(--sage);color:white;border-color:var(--sage)}
.smart-time-row{display:grid;grid-template-columns:1fr auto;gap:7px}.field-help{font-size:9.5px;color:var(--muted);font-weight:500}

/* scribe */
.scribe-card{margin-bottom:16px}.scribe-mode-toggle{display:flex;gap:5px}.scribe-mode{border:1px solid var(--border);background:#fff;border-radius:999px;padding:7px 10px;font-size:10px;font-weight:800;cursor:pointer}.scribe-mode.active{background:var(--peach-soft);border-color:#e3b69c;color:#704b39}
.scribe-output{margin-top:14px;border:1px solid var(--border);border-radius:13px;background:#fafbf8;padding:14px;min-height:120px;white-space:pre-wrap;line-height:1.55;font-size:13px}.scribe-output:empty:before{content:"Your generated draft will appear here.";color:var(--muted)}

/* health/nutrition */
.health-metrics{margin-bottom:16px}.nutrition-card{border-top:4px solid var(--peach)}.nutrition-snapshot{display:grid;grid-template-columns:repeat(2,1fr);gap:10px}.nutrition-stat{padding:12px;border-radius:13px;background:#f3f5f0}.nutrition-stat span{display:block;font-size:10px;color:var(--muted)}.nutrition-stat strong{font-size:21px}
.small-weight-card{margin-top:14px;display:flex;align-items:center;gap:12px;padding:10px 12px;border:1px solid var(--border);border-radius:12px}.small-weight-card span{font-size:11px;color:var(--muted)}.small-weight-card strong{font-size:18px;margin-right:auto}
.target-editor{margin-top:17px}.target-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}.quick-fitness-buttons{display:flex;gap:7px;flex-wrap:wrap;margin-bottom:14px}.movement-form{margin-top:8px}.fitness-summary{margin-top:12px}

/* mileage */
.irs-note{margin-top:16px;padding:13px;border-radius:13px;background:linear-gradient(135deg,var(--sage-soft),#fff5ef);font-size:12px}.irs-note p{color:var(--muted);line-height:1.5;margin:5px 0 0}
.compact-money-form{max-width:850px}

/* Poco sequence */
.roadmap-sequence-number{width:29px;height:29px;border-radius:50%;display:grid;place-items:center;flex:0 0 auto;background:var(--peach-soft);color:#704b39;font-weight:900;font-size:11px}.roadmap-priority{margin-left:auto}
.roadmap-stage.next-roadmap{box-shadow:inset 4px 0 0 var(--peach-dark);background:#fff9f4}

@media(max-width:1100px){.floating-ai-btn,.floating-ai-panel{left:238px}.dashboard-week-calendar{grid-template-columns:repeat(4,1fr)}}
@media(max-width:850px){.floating-ai-btn{left:16px;bottom:16px}.floating-ai-panel{left:16px;bottom:70px;width:calc(100vw - 32px);height:min(520px,70vh)}.dashboard-week-calendar{grid-template-columns:repeat(2,1fr)}}
@media(max-width:560px){.dashboard-week-calendar{grid-template-columns:1fr 1fr}.week-day{min-height:105px}.target-grid{grid-template-columns:1fr 1fr}.nutrition-snapshot{grid-template-columns:1fr 1fr}.floating-ai-form{grid-template-columns:1fr}.source-toggle-wrap{display:block}.source-toggle-wrap .source-toggle{margin-top:7px}}

/* v6 AI narration, rewards, odometer photos, theme customization */
.reward-strip{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-top:12px}.reward-strip span{background:var(--peach-soft);padding:5px 8px;border-radius:999px;font-size:10px;font-weight:900}.reward-strip strong{font-size:12px}.reward-strip small{color:var(--muted)}
.reward-card{display:grid;grid-template-columns:1fr minmax(220px,.5fr);align-items:center;gap:20px;margin-bottom:16px;background:linear-gradient(135deg,#fff9f4,var(--sage-soft))}
.reward-card h3{margin:0 0 5px;font-size:21px}.reward-progress{height:10px;border-radius:999px;background:#e8e8e2;overflow:hidden}.reward-progress div{height:100%;background:linear-gradient(90deg,var(--sage),var(--peach));width:0}.reward-progress-wrap small{display:block;color:var(--muted);margin-top:5px;text-align:right}
.ai-narration-box{padding:12px;border:1px solid var(--border);border-radius:13px;background:linear-gradient(135deg,#fff,#fff7f1);margin-bottom:14px}.ai-narration-box textarea{font-size:15px;line-height:1.5}
.reimbursement-row{display:grid;grid-template-columns:1fr 1fr;gap:12px;padding:11px;border-radius:12px;background:var(--sage-soft)}
.odometer-upload-card{padding:14px;border-radius:13px;border:1px solid var(--border);background:#fff9f4}.odometer-upload-card p{margin:4px 0 10px}.odometer-photo-grid{display:grid;grid-template-columns:1fr auto 1fr auto;gap:8px;align-items:end}
.theme-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin:14px 0}.theme-grid input[type=color]{height:48px;padding:4px}
.reward-pop{position:fixed;right:20px;top:20px;z-index:100;background:linear-gradient(135deg,var(--sage),var(--peach-dark));color:#fff;border-radius:16px;padding:14px 17px;box-shadow:0 18px 48px rgba(42,53,42,.28);max-width:320px;animation:rewardIn .25s ease-out}
@keyframes rewardIn{from{transform:translateY(-10px);opacity:0}to{transform:translateY(0);opacity:1}}
@media(max-width:800px){.reward-card{grid-template-columns:1fr}.theme-grid{grid-template-columns:1fr 1fr}.odometer-photo-grid{grid-template-columns:1fr auto}.reimbursement-row{grid-template-columns:1fr}}

.address-with-action{display:grid;grid-template-columns:1fr auto;gap:7px}.subhead-space{margin-top:18px!important}

.dashboard-calendar-card{display:block!important}
.dashboard-week-calendar{min-height:120px}
.floating-ai-btn{pointer-events:auto!important}
.floating-ai-panel{pointer-events:auto!important}

/* v6.2 responsive theme controls */
.mobile-theme-note{display:none}
.desktop-theme-editor{display:block}

@media (max-width: 900px), (hover: none) and (pointer: coarse){
  .desktop-theme-editor{display:none!important}
  .mobile-theme-note{display:block!important}
}

.sync-auth-status{margin-top:12px;padding:11px 12px;border-radius:12px;background:linear-gradient(135deg,var(--sage-soft),#fff7f1);border:1px solid var(--border);font-size:12px;line-height:1.45}
#syncSignUpBtn:disabled,#syncAuthForm button:disabled{opacity:.65;cursor:wait}

/* v6.4 iPad tap reliability */
.app-version{display:inline-block;margin-top:6px;font-size:10px;font-weight:800;letter-spacing:.08em;color:#bfc9bb}
.topbar{position:relative;z-index:20}
.top-actions{position:relative;z-index:21;gap:7px;flex-wrap:wrap}
.top-actions .btn,
.metric-link,
.dashboard-top-action{
  touch-action:manipulation;
  -webkit-tap-highlight-color:rgba(100,118,93,.16);
  user-select:none;
  -webkit-user-select:none;
  position:relative;
  pointer-events:auto!important;
}
.top-actions .btn{min-height:44px}
.metric-link{min-height:96px}
@media (min-width: 700px) and (max-width: 1180px){
  .topbar{align-items:flex-start;gap:14px}
  .top-actions{justify-content:flex-end;max-width:440px}
  .top-actions .btn{padding:11px 14px}
}
@media (hover:none) and (pointer:coarse){
  button,.btn,.metric-link,.nav-btn{touch-action:manipulation}
  .top-actions .btn{min-height:46px}
}

/* v6.5 mobile / iPad app-shell redesign */
html{
  min-height:100%;
  background:var(--bg);
}
body{
  min-height:100%;
  padding-bottom:env(safe-area-inset-bottom);
}
.topbar-title{min-width:0}

/* Tablet + touch layout: convert desktop sidebar into a compact top app header */
@media (max-width: 900px), (hover:none) and (pointer:coarse) and (max-width:1180px){
  .app-shell{
    display:block;
    min-height:100vh;
  }

  .sidebar{
    position:relative;
    top:auto;
    z-index:90;
    height:auto;
    min-height:0;
    padding:
      calc(10px + env(safe-area-inset-top))
      14px
      10px;
    overflow:visible;
    border-radius:0 0 18px 18px;
    box-shadow:0 8px 24px rgba(31,42,31,.16);
  }

  .brand{
    margin:0 0 9px;
    gap:10px;
    min-height:42px;
  }

  .brand-mark{
    width:36px;
    height:36px;
    border-radius:12px;
    font-size:17px;
    flex:0 0 36px;
  }

  .brand h1{
    font-size:16px;
    line-height:1.1;
  }

  .brand p{
    font-size:10px;
    margin-top:2px;
    white-space:nowrap;
  }

  .app-version{
    margin-top:2px;
    font-size:8.5px;
  }

  .sidebar nav{
    display:flex;
    grid-template-columns:none;
    gap:6px;
    overflow-x:auto;
    overflow-y:hidden;
    padding:1px 0 4px;
    margin:0 -2px;
    scrollbar-width:none;
    -webkit-overflow-scrolling:touch;
    scroll-snap-type:x proximity;
  }

  .sidebar nav::-webkit-scrollbar{display:none}

  .nav-btn{
    flex:0 0 auto;
    width:auto;
    min-height:38px;
    padding:8px 11px;
    border:1px solid rgba(255,255,255,.08);
    background:rgba(255,255,255,.04);
    color:#edf2eb;
    border-radius:999px;
    font-size:11px;
    font-weight:750;
    line-height:1;
    white-space:nowrap;
    scroll-snap-align:start;
  }

  .nav-btn.active{
    background:linear-gradient(135deg,var(--sage-soft),var(--peach-soft));
    border-color:transparent;
    color:#394337;
    box-shadow:0 4px 12px rgba(0,0,0,.11);
  }

  .privacy-note{
    display:none;
  }

  .main{
    padding:14px 16px calc(76px + env(safe-area-inset-bottom));
  }

  .topbar{
    position:relative;
    z-index:20;
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    align-items:center;
    gap:12px;
    margin:0 0 14px;
    padding:12px 13px;
    background:color-mix(in srgb,var(--panel) 93%,transparent);
    border:1px solid var(--border);
    border-radius:16px;
    box-shadow:0 7px 20px rgba(46,60,44,.07);
  }

  .topbar .eyebrow{
    margin-bottom:3px;
    font-size:9px;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }

  .topbar h2{
    margin:0;
    font-size:23px;
    line-height:1.05;
  }

  .top-actions{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:7px;
    width:auto;
    max-width:none;
  }

  .top-actions .btn{
    min-height:42px;
    padding:9px 11px;
    border-radius:11px;
    font-size:11px;
    white-space:nowrap;
  }

  .desktop-demo-btn{
    display:none!important;
  }

  .hero-grid,
  .two-col{
    gap:12px;
  }

  .card{
    border-radius:16px;
    padding:16px;
  }

  .dashboard-calendar-card .section-head{
    align-items:flex-start;
  }
}

/* iPhone / narrow portrait refinement */
@media (max-width: 600px){
  .sidebar{
    padding-left:12px;
    padding-right:12px;
    border-radius:0 0 16px 16px;
  }

  .brand p{
    max-width:235px;
    overflow:hidden;
    text-overflow:ellipsis;
  }

  .nav-btn{
    min-height:36px;
    padding:8px 10px;
    font-size:10.5px;
  }

  .main{
    padding:10px 11px calc(82px + env(safe-area-inset-bottom));
  }

  .topbar{
    grid-template-columns:1fr;
    gap:10px;
    padding:12px;
    border-radius:14px;
  }

  .topbar h2{
    font-size:22px;
  }

  .top-actions{
    width:100%;
  }

  .top-actions .btn{
    width:100%;
    min-height:44px;
    font-size:11.5px;
  }

  .metrics{
    gap:8px;
  }

  .metric.card{
    min-height:88px;
    padding:13px;
  }

  .metric strong{
    font-size:24px;
  }

  .focus-card .row{
    align-items:stretch;
  }

  .focus-card .row .btn{
    flex:1;
    min-height:42px;
  }
}

/* Installed iOS web-app polishing */
@media (display-mode: standalone){
  .sidebar{
    padding-top:calc(12px + env(safe-area-inset-top));
  }
  body{
    overscroll-behavior-y:none;
  }
}

/* v6.6 browser-agnostic touch layouts */

/* Any touch device */
html.touch-device .top-actions .btn,
html.touch-device .metric-link,
html.touch-device .nav-btn{
  touch-action:manipulation!important;
  -webkit-tap-highlight-color:rgba(100,118,93,.18);
  pointer-events:auto!important;
}

/* iPad/tablet: force the mobile shell even when Chrome reports a desktop-like viewport */
html.tablet-device .app-shell{display:block!important}
html.tablet-device .sidebar{
  position:relative!important;
  width:auto!important;
  height:auto!important;
  min-height:0!important;
  padding:calc(10px + env(safe-area-inset-top)) 14px 10px!important;
  overflow:visible!important;
  border-radius:0 0 18px 18px!important;
}
html.tablet-device .sidebar nav{
  display:flex!important;
  grid-template-columns:none!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
  gap:6px!important;
  padding:1px 0 5px!important;
  scrollbar-width:none;
  -webkit-overflow-scrolling:touch;
}
html.tablet-device .sidebar nav::-webkit-scrollbar{display:none}
html.tablet-device .nav-btn{
  flex:0 0 auto!important;
  width:auto!important;
  min-height:40px!important;
  padding:9px 12px!important;
  border-radius:999px!important;
  white-space:nowrap!important;
}
html.tablet-device .privacy-note{display:none!important}
html.tablet-device .main{
  margin-left:0!important;
  width:auto!important;
  padding:14px 16px calc(76px + env(safe-area-inset-bottom))!important;
}
html.tablet-device .topbar{
  position:relative!important;
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  gap:12px!important;
  padding:12px 13px!important;
  border-radius:16px!important;
}
html.tablet-device .top-actions{
  display:grid!important;
  grid-template-columns:1fr 1fr!important;
  gap:7px!important;
}
html.tablet-device .top-actions .btn{min-height:46px!important}

/* iPhone: a deliberately different, denser phone header */
html.phone-device .app-shell{display:block!important}
html.phone-device .sidebar{
  position:relative!important;
  width:auto!important;
  height:auto!important;
  min-height:0!important;
  padding:calc(8px + env(safe-area-inset-top)) 10px 8px!important;
  border-radius:0 0 14px 14px!important;
}
html.phone-device .brand{
  margin-bottom:7px!important;
  min-height:36px!important;
}
html.phone-device .brand-mark{
  width:32px!important;height:32px!important;flex-basis:32px!important;border-radius:10px!important;
}
html.phone-device .brand h1{font-size:14px!important}
html.phone-device .brand p{font-size:9px!important;max-width:210px!important}
html.phone-device .app-version{font-size:8px!important}
html.phone-device .sidebar nav{
  display:flex!important;
  overflow-x:auto!important;
  gap:5px!important;
  padding-bottom:3px!important;
  scrollbar-width:none;
  -webkit-overflow-scrolling:touch;
}
html.phone-device .sidebar nav::-webkit-scrollbar{display:none}
html.phone-device .nav-btn{
  flex:0 0 auto!important;
  width:auto!important;
  min-height:34px!important;
  padding:7px 9px!important;
  font-size:10px!important;
  border-radius:999px!important;
  white-space:nowrap!important;
}
html.phone-device .privacy-note{display:none!important}
html.phone-device .main{
  margin-left:0!important;
  width:auto!important;
  padding:8px 9px calc(78px + env(safe-area-inset-bottom))!important;
}
html.phone-device .topbar{
  display:block!important;
  margin-bottom:10px!important;
  padding:10px!important;
  border-radius:13px!important;
}
html.phone-device .topbar .eyebrow{font-size:8.5px!important;margin-bottom:2px!important}
html.phone-device .topbar h2{font-size:20px!important}
html.phone-device .top-actions{
  display:grid!important;
  grid-template-columns:1fr 1fr!important;
  gap:6px!important;
  width:100%!important;
  margin-top:9px!important;
}
html.phone-device .top-actions .btn{
  width:100%!important;
  min-height:42px!important;
  padding:8px 9px!important;
  font-size:10.5px!important;
}
html.phone-device .card{padding:13px!important;border-radius:14px!important}
html.phone-device .metrics{grid-template-columns:1fr 1fr!important;gap:7px!important}
html.phone-device .metric.card{min-height:82px!important;padding:11px!important}
html.phone-device .metric strong{font-size:22px!important}
html.phone-device .dashboard-week-calendar{min-height:100px!important}

/* v6.7 compatibility navigation */
.compat-error{
  margin:0 0 12px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid #e7bcbc;
  background:#fff0f0;
  color:#7c3030;
  font-size:12px;
  font-weight:700;
  position:relative;
  z-index:200;
}
html.tablet-device .nav-btn,
html.tablet-device [data-dashboard-action]{
  cursor:pointer;
  -webkit-user-select:none;
  user-select:none;
  touch-action:manipulation!important;
}

/* v6.8 Auto Sync */
.auto-sync-panel{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 14px;padding:12px 13px;border:1px solid var(--border);border-radius:14px;background:linear-gradient(135deg,var(--sage-soft),var(--peach-soft))}
.auto-sync-toggle{display:flex;align-items:flex-start;gap:10px;cursor:pointer;min-width:0}
.auto-sync-toggle input{width:20px;height:20px;margin:1px 0 0;accent-color:var(--sage);flex:0 0 auto}
.auto-sync-toggle span{display:grid;gap:2px}
.auto-sync-toggle strong{font-size:13px}
.auto-sync-toggle small{font-size:10.5px;line-height:1.35;color:var(--muted)}
.auto-sync-status{flex:0 0 auto;padding:6px 9px;border-radius:999px;background:rgba(255,255,255,.72);border:1px solid var(--border);font-size:10px;font-weight:800;white-space:nowrap}
.auto-sync-status[data-kind="ok"]{background:#eef6ec}
.auto-sync-status[data-kind="busy"]{background:#fff5e9}
.auto-sync-status[data-kind="error"]{background:#fff0f0}
@media(max-width:600px){.auto-sync-panel{align-items:flex-start;flex-direction:column}.auto-sync-status{align-self:flex-start}}

/* v6.9 password visibility + auth touch reliability */
.password-field-wrap{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:stretch;gap:7px;margin-top:6px}
.password-field-wrap input{margin-top:0!important;min-width:0}
.password-toggle-btn{min-width:64px;min-height:44px;padding:0 12px;border:1px solid var(--border);border-radius:11px;background:var(--panel);color:var(--text);font:inherit;font-size:11px;font-weight:800;cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:rgba(100,118,93,.16)}
.password-toggle-btn:active{transform:translateY(1px)}
#syncSignInBtn{touch-action:manipulation!important;pointer-events:auto!important;min-height:44px}
#syncSignInBtn:disabled{opacity:.65;cursor:wait}
@media(max-width:600px){.password-toggle-btn{min-width:60px;padding:0 10px}.password-field-wrap{gap:6px}}

/* v7.0 auth compatibility */
#syncAuthStatus{min-height:18px}
#syncAuthStatus:empty::after{content:"Checking sign-in status…";color:var(--muted)}

/* v7.1 installed-app experience */
.install-app-banner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin:0 0 14px;
  padding:12px 13px;
  border:1px solid var(--border);
  border-radius:16px;
  background:linear-gradient(135deg,var(--sage-soft),var(--peach-soft));
  box-shadow:0 7px 20px rgba(46,60,44,.06);
}
.install-app-banner.hidden{display:none!important}
.install-app-copy{display:flex;align-items:center;gap:11px;min-width:0}
.install-app-copy strong{display:block;font-size:13px;margin-bottom:2px}
.install-app-copy p{margin:0;color:var(--muted);font-size:10.5px;line-height:1.35}
.install-app-icon{width:42px;height:42px;flex:0 0 42px;border-radius:12px;overflow:hidden;box-shadow:0 3px 10px rgba(0,0,0,.12)}
.install-app-icon img{display:block;width:100%;height:100%}
.install-app-actions{display:flex;align-items:center;gap:7px;flex:0 0 auto}
.install-app-actions .btn{min-height:40px}
@media(max-width:650px){
  .install-app-banner{align-items:stretch;flex-direction:column}
  .install-app-actions{width:100%}
  .install-app-actions .btn{flex:1}
}
@media(display-mode:standalone){
  .install-app-banner{display:none!important}
  body{padding-top:env(safe-area-inset-top)}
}

/* v7.2 documentation backlog card */
.manual-backlog-card{
  border-style:dashed;
  background:linear-gradient(135deg,var(--peach-soft),var(--panel));
}

/* v7.3 visit editing */
.visit-row-actions{display:flex;align-items:center;gap:6px;white-space:nowrap}
.visit-delete-btn{font-size:10px}
.visit-edit-dialog{max-width:none;background:transparent;overflow:visible}
.visit-edit-card{width:min(680px,92vw);max-height:min(86vh,820px);overflow:auto;padding:20px}
.edit-visit-head{margin-bottom:2px}
.dialog-close-btn{width:38px;height:38px;border:1px solid var(--border);border-radius:999px;background:var(--panel);color:var(--text);font-size:24px;line-height:1;cursor:pointer;touch-action:manipulation}
.visit-edit-grid{margin-top:2px}
.visit-edit-actions{display:flex;justify-content:flex-end;gap:8px;padding-top:2px}
.visit-edit-actions .btn{min-width:112px}
.edit-visit-note{margin:0;text-align:right;font-size:10px}
@media(max-width:700px){
  .visit-edit-dialog{width:100%;max-width:100%;margin:auto 0 0;border-radius:20px 20px 0 0}
  .visit-edit-card{width:100%;max-height:88vh;padding:16px 14px calc(16px + env(safe-area-inset-bottom));border-radius:20px 20px 0 0}
  .visit-edit-grid{grid-template-columns:1fr!important}
  .visit-edit-grid .span-2{grid-column:auto!important}
  .visit-edit-actions{position:sticky;bottom:0;background:var(--panel);padding:10px 0 2px;z-index:2}
  .visit-edit-actions .btn{flex:1;min-height:46px;min-width:0}
  .edit-visit-note{text-align:left}
  .visit-row-actions{gap:5px}
}

/* v7.4 editable calendar + appointment Day View */
.calendar-toolbar{flex-wrap:wrap;justify-content:flex-end}
.calendar-edit-hint{margin:4px 0 10px;font-size:10.5px}
.calendar-day{cursor:pointer}
.calendar-date-add{
  display:inline-flex;align-items:center;justify-content:center;
  width:27px;height:27px;padding:0;margin:0 0 4px;
  border:0;border-radius:999px;background:transparent;color:inherit;font:inherit;font-weight:800;cursor:pointer
}
.calendar-day.today .calendar-date-add{background:var(--sage);color:white}
.calendar-visit-event,.personal-calendar-event,.dashboard-visit-event,.dashboard-personal-event{
  width:100%;border:0;text-align:left;font:inherit;color:inherit;cursor:pointer;touch-action:manipulation
}
.personal-calendar-event{background:color-mix(in srgb,var(--job-color,#7b8794) 13%,white)}
.calendar-more{font-size:9px;color:var(--muted);padding:2px 4px}
.visit-duplicate-warning{margin:0 0 10px;padding:9px 11px;border:1px solid #e4b7a5;border-radius:11px;background:var(--peach-soft);font-size:10.5px;font-weight:700;line-height:1.4}
.visit-duplicate-warning.hidden{display:none!important}

/* Calendar item editor */
.calendar-item-card{width:min(650px,92vw);max-height:min(86vh,820px);overflow:auto}
.calendar-item-actions{display:flex;align-items:center;gap:8px}
.calendar-item-actions .spacer{flex:1}
.calendar-all-day-toggle{align-self:end;min-height:44px}
.calendar-all-day-toggle input{width:20px;height:20px}

/* Day View */
.day-view-card{padding-bottom:12px}
.day-view-header{align-items:flex-start}
.day-view-toolbar{flex-wrap:wrap;justify-content:flex-end}
.day-view-date-input{width:auto;min-height:36px;padding:6px 8px}
.day-all-day-items{display:flex;align-items:center;gap:7px;flex-wrap:wrap;margin:0 0 10px;padding:8px 10px;background:var(--bg);border:1px solid var(--border);border-radius:12px}
.day-all-day-items:empty{display:none}
.all-day-label{font-size:9px;font-weight:900;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);margin-right:2px}
.all-day-chip{border:1px solid var(--border);background:var(--panel);border-radius:999px;padding:6px 9px;font:inherit;font-size:10px;font-weight:750;cursor:pointer}
.task-chip{background:var(--amber-soft)}
.day-view-scroll{height:min(68vh,720px);overflow:auto;border:1px solid var(--border);border-radius:14px;background:white;-webkit-overflow-scrolling:touch}
.day-timeline{position:relative;min-height:2304px}
.day-slots{position:absolute;inset:0}
.day-time-slot{display:grid;grid-template-columns:68px 1fr;width:100%;padding:0;border:0;background:white;text-align:left;cursor:pointer}
.day-time-slot:hover,.day-time-slot:active{background:var(--sage-soft)}
.day-time-label{display:flex;justify-content:flex-end;align-items:flex-start;padding:2px 8px 0 2px;font-size:9px;color:var(--muted);white-space:nowrap}
.day-slot-line{border-top:1px solid #eef0ec;margin-top:0}
.day-time-slot.hour .day-slot-line{border-top-color:#d8ddd4}
.day-appointments{position:absolute;inset:0;pointer-events:none}
.day-appointment{
  position:absolute;z-index:3;pointer-events:auto;overflow:hidden;
  padding:5px 7px;border:1px solid color-mix(in srgb,var(--item-color) 55%,white);
  border-left:5px solid var(--item-color);border-radius:8px;
  background:color-mix(in srgb,var(--item-color) 15%,white);
  color:var(--text);text-align:left;font:inherit;cursor:pointer;touch-action:manipulation
}
.day-appointment strong{display:block;font-size:10.5px;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.day-appointment small{display:block;margin-top:2px;font-size:8.5px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.day-appointment.calendar{border-style:dashed;border-left-style:solid}
@media(max-width:700px){
  .calendar-toolbar{justify-content:flex-start}
  .calendar-item-dialog{width:100%;max-width:100%;margin:auto 0 0;border-radius:20px 20px 0 0}
  .calendar-item-card{width:100%;max-height:88vh;padding:16px 14px calc(16px + env(safe-area-inset-bottom));border-radius:20px 20px 0 0}
  .calendar-item-grid{grid-template-columns:1fr!important}
  .calendar-item-grid .span-2{grid-column:auto!important}
  .calendar-item-actions{position:sticky;bottom:0;background:var(--panel);padding:10px 0 2px;z-index:5}
  .day-view-header{display:block}
  .day-view-toolbar{justify-content:flex-start;margin-top:10px}
  .day-view-date-input{max-width:145px}
  .day-view-scroll{height:72vh}
  .day-time-slot{grid-template-columns:58px 1fr}
  .day-time-label{padding-right:6px;font-size:8.5px}
}

/* v7.6 Day View horizontal alignment fix
   The appointment layer occupies ONLY the lined calendar field.
   Time labels remain in their own gutter on the left. */
.day-timeline{
  --day-time-gutter:72px;
  --day-right-pad:8px;
}
.day-time-slot{
  grid-template-columns:var(--day-time-gutter) minmax(0,1fr)!important;
}
.day-appointments{
  position:absolute!important;
  top:0!important;
  bottom:0!important;
  left:var(--day-time-gutter)!important;
  right:var(--day-right-pad)!important;
  pointer-events:none;
  overflow:hidden;
}
.day-appointment{
  box-sizing:border-box;
  max-width:calc(100% - 2px);
  margin-left:2px;
  margin-right:2px;
}
@media(max-width:700px){
  .day-timeline{
    --day-time-gutter:58px;
    --day-right-pad:5px;
  }
  .day-time-slot{
    grid-template-columns:var(--day-time-gutter) minmax(0,1fr)!important;
  }
}

.day-slot-line{
  min-width:0;
}
.day-appointment:focus-visible{
  outline:2px solid var(--sage);
  outline-offset:1px;
}

/* v7.7 — iPad Day View visibility fix */
#dayview.active{
  display:block!important;
  width:100%!important;
  min-width:0!important;
}
#dayview .day-view-card{
  display:block!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  box-sizing:border-box!important;
}
#dayview .day-view-scroll{
  display:block!important;
  position:relative!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  height:68vh!important;
  min-height:520px!important;
  max-height:760px!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  box-sizing:border-box!important;
  background:#fff!important;
}
#dayview .day-timeline{
  display:block!important;
  position:relative!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  height:2304px!important;
  min-height:2304px!important;
  box-sizing:border-box!important;
}
#dayview .day-slots{
  position:absolute!important;
  top:0!important;
  left:0!important;
  right:0!important;
  width:100%!important;
  height:2304px!important;
  z-index:1!important;
}
#dayview .day-appointments{
  position:absolute!important;
  top:0!important;
  bottom:auto!important;
  left:var(--day-time-gutter)!important;
  right:var(--day-right-pad)!important;
  width:auto!important;
  height:2304px!important;
  z-index:4!important;
  pointer-events:none!important;
  overflow:visible!important;
}
#dayview .day-appointment{
  pointer-events:auto!important;
  box-sizing:border-box!important;
  min-width:0!important;
  max-width:calc(100% - 4px)!important;
}
#dayview .day-time-slot{
  position:relative!important;
  z-index:1!important;
  width:100%!important;
  max-width:100%!important;
}

/* Explicit tablet rules independent of browser user-agent quirks */
html.tablet-device #dayview,
html.touch-device #dayview.active{
  overflow:visible!important;
}
html.tablet-device #dayview .day-view-card{
  margin:0!important;
}
html.tablet-device #dayview .day-view-scroll{
  height:70vh!important;
  min-height:560px!important;
}
html.tablet-device #dayview .day-timeline{
  width:100%!important;
}

/* Phone remains compact */
html.phone-device #dayview .day-view-scroll{
  height:72vh!important;
  min-height:440px!important;
}

/* v7.9 Momentum note checklist */
.reward-card{align-items:start}
.momentum-checklist-wrap{
  grid-column:1/-1;
  border-top:1px solid var(--border);
  padding-top:14px;
  min-width:0;
}
.momentum-checklist-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:10px;
}
.momentum-checklist-head strong{font-size:13px}
.momentum-checklist-head small{display:block;color:var(--muted);font-size:10.5px;margin-top:2px}
.momentum-points-chip{
  flex:0 0 auto;
  padding:5px 8px;
  border-radius:999px;
  background:var(--sage-soft);
  color:var(--sage-dark);
  font-size:9.5px;
  font-weight:900;
}
.momentum-note-checklist{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:7px;
  max-height:330px;
  overflow-y:auto;
  padding-right:2px;
  -webkit-overflow-scrolling:touch;
}
.momentum-note-item{
  display:flex;
  grid-template-columns:none;
  align-items:center;
  gap:9px;
  min-width:0;
  padding:9px 10px;
  border:1px solid var(--border);
  border-radius:11px;
  background:#fff;
  cursor:pointer;
  color:var(--text);
  touch-action:manipulation;
}
.momentum-note-item input{
  width:19px;
  height:19px;
  flex:0 0 auto;
  margin:0;
  accent-color:var(--sage);
}
.momentum-note-copy{min-width:0;flex:1}
.momentum-note-copy strong{
  display:block;
  font-size:11px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.momentum-note-copy small{
  display:block;
  margin-top:2px;
  font-size:9px;
  color:var(--muted);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.momentum-note-points{
  flex:0 0 auto;
  font-size:9px;
  font-weight:900;
  color:var(--sage);
}
.momentum-note-item.done{
  background:var(--sage-soft);
  opacity:.78;
}
.momentum-note-item.done .momentum-note-copy strong{
  text-decoration:line-through;
  color:var(--muted);
}
.momentum-empty{
  grid-column:1/-1;
  padding:12px;
  border:1px dashed var(--border);
  border-radius:11px;
  color:var(--muted);
  font-size:10.5px;
  background:rgba(255,255,255,.6);
}
.momentum-linked-note-hint{
  margin:9px 0 0;
  padding:8px 10px;
  border-radius:10px;
  background:var(--peach-soft);
  color:var(--muted);
  font-size:9.5px;
  line-height:1.4;
}

/* v7.9 iPad calendar visibility guard */
html.tablet-device #calendar.active,
html.touch-device #calendar.active,
html.tablet-device #dayview.active,
html.touch-device #dayview.active{
  display:block!important;
  visibility:visible!important;
  opacity:1!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
}
html.tablet-device #calendar>.card,
html.touch-device #calendar.active>.card,
html.tablet-device #dayview>.card,
html.touch-device #dayview.active>.card{
  display:block!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  overflow:visible!important;
  box-sizing:border-box!important;
}
html.tablet-device #calendar .calendar-weekdays,
html.tablet-device #calendar .calendar-grid,
html.touch-device #calendar.active .calendar-weekdays,
html.touch-device #calendar.active .calendar-grid{
  display:grid!important;
  visibility:visible!important;
  opacity:1!important;
  grid-template-columns:repeat(7,minmax(0,1fr))!important;
  width:100%!important;
  min-width:0!important;
}
html.tablet-device #calendar .calendar-day{
  min-width:0!important;
  overflow:hidden!important;
}
html.tablet-device #dayview .day-view-scroll,
html.touch-device #dayview.active .day-view-scroll{
  display:block!important;
  visibility:visible!important;
  opacity:1!important;
  width:100%!important;
  min-height:500px!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
}
html.tablet-device #dayview .day-timeline,
html.touch-device #dayview.active .day-timeline{
  display:block!important;
  visibility:visible!important;
  opacity:1!important;
  width:100%!important;
  height:2304px!important;
  min-height:2304px!important;
}

@media(max-width:760px){
  .momentum-note-checklist{grid-template-columns:1fr}
}

/* v8.0 — Home Health backlog session-detail editor */
.manual-backlog-group{
  display:grid;
  gap:8px;
}
.manual-backlog-summary{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:8px 2px 4px;
}
.manual-backlog-summary strong{display:block;font-size:12px}
.manual-backlog-summary small{display:block;margin-top:2px;color:var(--muted);font-size:9.5px}

.manual-backlog-card{
  display:grid!important;
  grid-template-columns:34px minmax(0,1fr) auto;
  align-items:center;
  gap:10px;
  border-style:solid!important;
  background:linear-gradient(135deg,var(--peach-soft),var(--panel))!important;
}
.manual-note-number{
  width:30px;height:30px;
  display:flex;align-items:center;justify-content:center;
  border-radius:999px;
  background:var(--panel);
  border:1px solid var(--border);
  font-size:10px;
  font-weight:900;
  color:var(--muted);
}
.manual-note-content{min-width:0}
.manual-note-content strong{
  display:block;
  font-size:11.5px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.manual-note-content small{
  display:block;
  margin-top:2px;
  font-size:9.5px;
  color:var(--muted);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.manual-note-detail-snippet{
  margin-top:5px;
  font-size:9.5px;
  line-height:1.35;
  color:var(--text);
}
.manual-note-actions{
  display:flex;
  align-items:center;
  gap:6px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.backlog-note-card{
  width:min(680px,92vw);
  max-height:min(88vh,850px);
  overflow:auto;
}
.backlog-note-actions{
  display:flex;
  justify-content:flex-end;
  gap:8px;
}
.backlog-note-helper{
  margin:0;
  font-size:9.5px;
  line-height:1.4;
}

@media(max-width:760px){
  .manual-backlog-card{
    grid-template-columns:30px minmax(0,1fr)!important;
    align-items:start;
  }
  .manual-note-actions{
    grid-column:1/-1;
    justify-content:stretch;
  }
  .manual-note-actions .btn{
    flex:1;
    min-height:42px;
  }
  .backlog-note-dialog{
    width:100%;
    max-width:100%;
    margin:auto 0 0;
    border-radius:20px 20px 0 0;
  }
  .backlog-note-card{
    width:100%;
    max-height:90vh;
    padding:16px 14px calc(16px + env(safe-area-inset-bottom));
    border-radius:20px 20px 0 0;
  }
  .backlog-note-grid{
    grid-template-columns:1fr!important;
  }
  .backlog-note-grid .span-2{
    grid-column:auto!important;
  }
  .backlog-note-actions{
    position:sticky;
    bottom:0;
    z-index:4;
    padding-top:10px;
    background:var(--panel);
  }
  .backlog-note-actions .btn{
    flex:1;
    min-height:46px;
  }
}

/* v8.1.0 — global sign-in notice */
.login-notice{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin:0 0 14px;
  padding:11px 13px;
  border:1px solid #d8a58f;
  border-radius:14px;
  background:linear-gradient(135deg,#fff2eb,#fff8f4);
  box-shadow:0 6px 18px rgba(72,48,37,.07);
}
.login-notice.hidden{display:none!important}
.login-notice-copy{display:flex;align-items:center;gap:10px;min-width:0}
.login-notice-icon{
  width:28px;height:28px;flex:0 0 28px;
  display:flex;align-items:center;justify-content:center;
  border-radius:999px;
  background:#d98263;color:#fff;font-weight:900;
}
.login-notice strong{display:block;font-size:11.5px}
.login-notice p{margin:2px 0 0;color:var(--muted);font-size:9.5px;line-height:1.35}
.login-notice .btn{flex:0 0 auto;min-height:38px}

/* v8.1.0 — Smart Scribe */
.scribe-mode-toggle{flex-wrap:wrap}
.scribe-mode[data-scribe-mode="aoc"]{font-weight:800}
.scribe-output{
  white-space:pre-wrap;
  line-height:1.55;
}
@media(max-width:700px){
  .login-notice{align-items:stretch;flex-direction:column}
  .login-notice .btn{width:100%}
  .scribe-mode-toggle{width:100%}
  .scribe-mode-toggle .scribe-mode{flex:1;min-height:40px}
}

/* v8.2 — simplified navigation */
.nav-icon{display:inline-flex;width:18px;justify-content:center;margin-right:7px;font-weight:900}
.mobile-bottom-nav,.bottom-more-menu{display:none}

.accountability-extras{display:grid;gap:8px;margin-top:10px}
.usage-streak-chip{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:7px 9px;border:1px solid var(--border);border-radius:10px;background:var(--sage-soft)}
.usage-streak-chip span,.motivation-box span{font-size:8.5px;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);font-weight:900}
.usage-streak-chip strong{font-size:11px}
.motivation-box{padding:8px 9px;border-left:3px solid var(--peach);background:var(--peach-soft);border-radius:8px}
.motivation-box p{margin:3px 0 0;font-size:10px;line-height:1.4;color:var(--text)}

.aoc-deadline-card{margin-bottom:14px}
.deadline-status-chip{padding:5px 8px;border-radius:999px;background:var(--sage-soft);font-size:9px;font-weight:900;color:var(--sage)}
.deadline-status-chip.warning{background:var(--peach-soft);color:#9a5a43}
.aoc-deadline-grid,.pay-schedule-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:10px 0}
.aoc-deadline-grid>div,.pay-schedule-grid>div{padding:9px;border:1px solid var(--border);border-radius:10px;background:var(--bg);min-width:0}
.aoc-deadline-grid span,.pay-schedule-grid span{display:block;font-size:8.5px;color:var(--muted);margin-bottom:3px}
.aoc-deadline-grid strong,.pay-schedule-grid strong{font-size:13px}
.pay-schedule-grid small{display:block;margin-top:3px;font-size:8px;color:var(--muted);line-height:1.25}
.deadline-alert-controls{display:flex;align-items:end;gap:8px;flex-wrap:wrap;margin-top:10px}
.deadline-alert-controls label{min-width:150px}

/* Touch devices: primary navigation lives at the bottom. */
@media (max-width:900px), (hover:none) and (pointer:coarse) and (max-width:1180px){
  .sidebar nav{display:none!important}
  .sidebar{padding-bottom:8px!important;border-radius:0 0 14px 14px!important}
  .brand{margin-bottom:0!important}
  .main{padding-bottom:calc(96px + env(safe-area-inset-bottom))!important}
  .top-actions{grid-template-columns:1fr!important}
  .top-actions .dashboard-top-action{min-width:120px}
  .mobile-bottom-nav{
    position:fixed;z-index:500;left:0;right:0;bottom:0;
    display:grid;grid-template-columns:repeat(5,1fr);gap:2px;
    padding:6px 7px calc(6px + env(safe-area-inset-bottom));
    background:color-mix(in srgb,#293429 96%,transparent);
    border-top:1px solid rgba(255,255,255,.12);box-shadow:0 -8px 24px rgba(24,33,24,.18)
  }
  .bottom-nav-btn{border:0;background:transparent;color:#dfe7dc;min-height:54px;padding:4px 3px;border-radius:10px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;font-size:8.5px;font-weight:800;touch-action:manipulation}
  .bottom-nav-btn.active{background:rgba(255,255,255,.12);color:#fff}
  .bottom-nav-icon{font-size:18px;line-height:1;font-weight:900}
  .bottom-more-menu{position:fixed;z-index:510;left:10px;right:10px;bottom:calc(72px + env(safe-area-inset-bottom));display:block;padding:12px;border:1px solid var(--border);border-radius:18px;background:var(--panel);box-shadow:0 18px 50px rgba(22,29,22,.24)}
  .bottom-more-menu.hidden{display:none!important}
  .bottom-more-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}
  .bottom-more-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
  .bottom-more-grid button{border:1px solid var(--border);background:var(--bg);border-radius:11px;min-height:58px;padding:7px;font:inherit;font-size:9px;font-weight:800;color:var(--text);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;touch-action:manipulation}
  .bottom-more-grid button span{font-size:16px;font-weight:900}
}
html.tablet-device .sidebar nav,html.phone-device .sidebar nav{display:none!important}
html.tablet-device .mobile-bottom-nav,html.phone-device .mobile-bottom-nav{display:grid!important}
html.tablet-device .main,html.phone-device .main{padding-bottom:calc(96px + env(safe-area-inset-bottom))!important}

@media(max-width:760px){
  .aoc-deadline-grid,.pay-schedule-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .deadline-alert-controls{display:grid;grid-template-columns:1fr 1fr}
  .deadline-alert-controls label{grid-column:1/-1}
  .bottom-more-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
}

/* v8.3 — swipeable bottom navigation; no More popup */
.internal-only-page{display:none!important}
.mobile-bottom-nav.scroll-tabs{
  grid-template-columns:none!important;
  display:flex!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
  overscroll-behavior-x:contain;
  scroll-snap-type:x proximity;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:none;
  gap:3px!important;
  justify-content:flex-start!important;
  padding-left:8px!important;
  padding-right:8px!important;
}
.mobile-bottom-nav.scroll-tabs::-webkit-scrollbar{display:none}
.mobile-bottom-nav.scroll-tabs .bottom-nav-btn{
  flex:0 0 82px!important;
  min-width:82px!important;
  scroll-snap-align:center;
}
.bottom-more-menu{display:none!important}

/* Floating assistant stays available above bottom nav */
.floating-ai-btn{
  position:fixed!important;
  right:14px!important;
  bottom:calc(78px + env(safe-area-inset-bottom))!important;
  z-index:720!important;
  display:flex!important;
}
.floating-ai-panel{
  position:fixed!important;
  z-index:730!important;
  right:12px!important;
  bottom:calc(142px + env(safe-area-inset-bottom))!important;
  max-height:min(68vh,620px)!important;
}
@media(min-width:901px){
  .floating-ai-btn{bottom:20px!important}
  .floating-ai-panel{bottom:78px!important}
}

/* AOC scribe clearly separates progress from activity */
.aoc-structured-output{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin-top:12px;
}
.aoc-structured-output.hidden{display:none!important}
.aoc-output-field{
  display:flex;
  flex-direction:column;
  gap:5px;
  min-width:0;
}
.aoc-output-field>span{
  font-size:10px;
  font-weight:900;
  color:var(--text);
}
.aoc-output-field textarea{
  min-height:104px;
  resize:vertical;
}
@media(max-width:760px){.aoc-structured-output{grid-template-columns:1fr}}

/* Task rows are tappable/editable */
.clickable-task{cursor:pointer}
.clickable-task:hover{border-color:var(--sage)}

/* Phone calendar/task editors: fixed shell, only body scrolls */
@media(max-width:760px){
  .calendar-item-dialog,.task-edit-dialog{
    position:fixed!important;
    inset:0!important;
    width:100vw!important;
    max-width:none!important;
    height:100dvh!important;
    max-height:none!important;
    margin:0!important;
    padding:0!important;
    border:0!important;
    border-radius:0!important;
    background:rgba(30,35,30,.28)!important;
  }
  .calendar-item-dialog[open],.task-edit-dialog[open]{
    display:flex!important;
    align-items:flex-end!important;
  }
  .calendar-item-card,.task-edit-card{
    width:100%!important;
    height:min(88dvh,760px)!important;
    max-height:88dvh!important;
    margin:0!important;
    border-radius:22px 22px 0 0!important;
    overflow:hidden!important;
    display:grid!important;
    grid-template-rows:auto minmax(0,1fr) auto!important;
    padding:0!important;
    background:var(--panel)!important;
  }
  .calendar-item-card>.section-head,.task-edit-card>.section-head{
    margin:0!important;
    padding:14px 14px 10px!important;
    background:var(--panel)!important;
    border-bottom:1px solid var(--border)!important;
    z-index:3;
  }
  .calendar-item-grid,.task-edit-grid{
    overflow-y:auto!important;
    overscroll-behavior:contain;
    -webkit-overflow-scrolling:touch;
    padding:12px 14px!important;
    display:grid!important;
    grid-template-columns:1fr!important;
    align-content:start!important;
  }
  .calendar-item-grid .span-2,.task-edit-grid .span-2{grid-column:auto!important}
  .calendar-item-actions,.task-edit-actions{
    margin:0!important;
    padding:10px 14px calc(10px + env(safe-area-inset-bottom))!important;
    background:var(--panel)!important;
    border-top:1px solid var(--border)!important;
    z-index:4;
    display:flex!important;
    gap:8px!important;
    align-items:center!important;
  }
  .calendar-item-actions .btn,.task-edit-actions .btn{min-height:44px}
}

/* Cloud + local backup in one scrollable page */
.sync-backup-section{
  margin-top:16px;
  padding-top:16px;
  border-top:2px solid var(--border);
}

/* v8.3.1 HOTFIX — exact mobile geometry
   Fixes v8.3 Assistant stretching and bottom nav expanding into a box. */

/* Assistant: cancel the original desktop LEFT coordinate when anchored on the right. */
/* High-specificity touch/device rules */
html.phone-device #floatingAiBtn.floating-ai-btn,
html.tablet-device #floatingAiBtn.floating-ai-btn {
  left:auto!important;
  right:14px!important;
  top:auto!important;
  bottom:calc(70px + env(safe-area-inset-bottom))!important;
  width:auto!important;
  min-width:0!important;
  max-width:150px!important;
  height:44px!important;
  min-height:44px!important;
  max-height:44px!important;
  margin:0!important;
  padding:0 14px!important;
  display:inline-flex!important;
  flex:0 0 auto!important;
  align-items:center!important;
  justify-content:center!important;
  gap:7px!important;
  white-space:nowrap!important;
  border-radius:999px!important;
  box-sizing:border-box!important;
}

html.phone-device #floatingAiPanel.floating-ai-panel,
html.tablet-device #floatingAiPanel.floating-ai-panel {
  left:auto!important;
  right:10px!important;
  width:min(390px,calc(100vw - 20px))!important;
  max-width:calc(100vw - 20px)!important;
  bottom:calc(122px + env(safe-area-inset-bottom))!important;
}

/* Bottom nav: force a single slim horizontal scroll strip, not the older grid. */
html.phone-device #mobileBottomNav.mobile-bottom-nav.scroll-tabs,
html.tablet-device #mobileBottomNav.mobile-bottom-nav.scroll-tabs {
  position:fixed!important;
  left:0!important;
  right:0!important;
  top:auto!important;
  bottom:0!important;
  z-index:700!important;

  display:flex!important;
  flex-direction:row!important;
  flex-wrap:nowrap!important;
  align-items:stretch!important;
  justify-content:flex-start!important;

  width:100%!important;
  height:calc(62px + env(safe-area-inset-bottom))!important;
  min-height:calc(62px + env(safe-area-inset-bottom))!important;
  max-height:calc(62px + env(safe-area-inset-bottom))!important;

  margin:0!important;
  padding:4px 7px calc(4px + env(safe-area-inset-bottom))!important;
  gap:2px!important;

  overflow-x:auto!important;
  overflow-y:hidden!important;
  box-sizing:border-box!important;
  scrollbar-width:none!important;
  -webkit-overflow-scrolling:touch;
  border-radius:0!important;
}

html.phone-device #mobileBottomNav.mobile-bottom-nav.scroll-tabs::-webkit-scrollbar,
html.tablet-device #mobileBottomNav.mobile-bottom-nav.scroll-tabs::-webkit-scrollbar {
  display:none!important;
}

html.phone-device #mobileBottomNav .bottom-nav-btn,
html.tablet-device #mobileBottomNav .bottom-nav-btn {
  flex:0 0 76px!important;
  width:76px!important;
  min-width:76px!important;
  max-width:76px!important;
  height:52px!important;
  min-height:52px!important;
  max-height:52px!important;
  margin:0!important;
  padding:3px 2px!important;
  overflow:hidden!important;
  box-sizing:border-box!important;
}

html.phone-device #mobileBottomNav .bottom-nav-icon,
html.tablet-device #mobileBottomNav .bottom-nav-icon {
  font-size:17px!important;
  line-height:18px!important;
}

html.phone-device #mobileBottomNav .bottom-nav-btn > span:last-child,
html.tablet-device #mobileBottomNav .bottom-nav-btn > span:last-child {
  display:block!important;
  width:100%!important;
  max-width:72px!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
  font-size:8px!important;
  line-height:11px!important;
  text-align:center!important;
}

/* Generic viewport fallback if device detection hasn't run yet. */
@media (max-width:900px) {
  #floatingAiBtn.floating-ai-btn {
    left:auto!important;
    right:14px!important;
    width:auto!important;
    max-width:150px!important;
    height:44px!important;
    min-height:44px!important;
    padding:0 14px!important;
    display:inline-flex!important;
  }

  #mobileBottomNav.mobile-bottom-nav.scroll-tabs {
    display:flex!important;
    grid-template-columns:none!important;
    flex-direction:row!important;
    flex-wrap:nowrap!important;
    width:100%!important;
    height:calc(62px + env(safe-area-inset-bottom))!important;
    min-height:calc(62px + env(safe-area-inset-bottom))!important;
    max-height:calc(62px + env(safe-area-inset-bottom))!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    padding:4px 7px calc(4px + env(safe-area-inset-bottom))!important;
  }

  #mobileBottomNav .bottom-nav-btn {
    flex:0 0 76px!important;
    width:76px!important;
    min-width:76px!important;
    max-width:76px!important;
    height:52px!important;
    min-height:52px!important;
    max-height:52px!important;
  }
}

/* Content clears the now-slimmer bar. */
html.phone-device .main,
html.tablet-device .main {
  padding-bottom:calc(76px + env(safe-area-inset-bottom))!important;
}

/* v8.3.2 — strict desktop vs mobile layout separation */

/* DESKTOP / NORMAL WEB BROWSER
   Never show the mobile dock. Keep the Assistant compact in the lower-right. */
/* Default non-mobile safety: hidden unless phone/tablet class enables it. */
#mobileBottomNav.mobile-bottom-nav.scroll-tabs{
  display:none!important;
}

html.desktop-device #mobileBottomNav.mobile-bottom-nav.scroll-tabs{
  display:none!important;
}

html.desktop-device #floatingAiBtn.floating-ai-btn{
  position:fixed!important;
  left:auto!important;
  right:22px!important;
  top:auto!important;
  bottom:20px!important;
  width:auto!important;
  min-width:0!important;
  max-width:150px!important;
  height:44px!important;
  min-height:44px!important;
  max-height:44px!important;
  margin:0!important;
  padding:0 14px!important;
  display:inline-flex!important;
  flex:0 0 auto!important;
  align-items:center!important;
  justify-content:center!important;
  white-space:nowrap!important;
  border-radius:999px!important;
  box-sizing:border-box!important;
}

html.desktop-device #floatingAiPanel.floating-ai-panel{
  position:fixed!important;
  left:auto!important;
  right:22px!important;
  bottom:76px!important;
  width:390px!important;
  max-width:calc(100vw - 44px)!important;
  height:min(510px,calc(100vh - 110px))!important;
}

html.desktop-device .app-shell{
  grid-template-columns:260px minmax(0,1fr)!important;
  width:100%!important;
  max-width:100vw!important;
  overflow-x:hidden!important;
}

html.desktop-device .main{
  width:100%!important;
  max-width:1500px!important;
  min-width:0!important;
  overflow-x:hidden!important;
}

/* Prevent cards/forms from forcing the desktop page wider than the viewport. */
html.desktop-device .page,
html.desktop-device .card,
html.desktop-device .two-col,
html.desktop-device .hero-grid,
html.desktop-device .metrics,
html.desktop-device .form-grid,
html.desktop-device .inline-form{
  min-width:0!important;
  max-width:100%!important;
}

/* PHONE / IPAD: explicitly enable the compact swipeable dock. */
html.phone-device #mobileBottomNav.mobile-bottom-nav.scroll-tabs,
html.tablet-device #mobileBottomNav.mobile-bottom-nav.scroll-tabs{
  display:flex!important;
  position:fixed!important;
  left:0!important;
  right:0!important;
  bottom:0!important;
  top:auto!important;
  flex-direction:row!important;
  flex-wrap:nowrap!important;
  align-items:stretch!important;
  justify-content:flex-start!important;
  width:100vw!important;
  max-width:100vw!important;
  height:calc(62px + env(safe-area-inset-bottom))!important;
  min-height:calc(62px + env(safe-area-inset-bottom))!important;
  max-height:calc(62px + env(safe-area-inset-bottom))!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
  margin:0!important;
  padding:4px 7px calc(4px + env(safe-area-inset-bottom))!important;
  gap:2px!important;
  box-sizing:border-box!important;
}

html.phone-device #floatingAiBtn.floating-ai-btn,
html.tablet-device #floatingAiBtn.floating-ai-btn{
  left:auto!important;
  right:14px!important;
  width:auto!important;
  max-width:150px!important;
  height:44px!important;
  min-height:44px!important;
  max-height:44px!important;
  bottom:calc(70px + env(safe-area-inset-bottom))!important;
}

/* If JS has not classified the device yet, use width only for small screens.
   This avoids a desktop flash of the mobile dock. */
@media (max-width:700px){
  html:not(.desktop-device) #mobileBottomNav.mobile-bottom-nav.scroll-tabs{
    display:flex!important;
  }
}

/* Wider desktop browser windows should not make forms/cards absurdly wide. */
@media (min-width:1500px){
  html.desktop-device .main{
    max-width:1400px!important;
  }
}

/* v8.3.4 — calendar date navigation and timed task ordering */
.calendar-date-view{
  cursor:pointer!important;
}
.calendar-date-view:hover,
.calendar-date-view:focus-visible{
  background:var(--sage-soft)!important;
  color:var(--sage-dark)!important;
  outline:2px solid color-mix(in srgb,var(--sage) 45%,transparent);
  outline-offset:1px;
}
.week-day-date-link{
  width:100%;
  border:0;
  background:transparent;
  padding:0;
  margin:0;
  display:flex;
  justify-content:space-between;
  align-items:center;
  color:inherit;
  cursor:pointer;
  text-align:left;
}
.week-day-date-link:hover .week-day-num,
.week-day-date-link:focus-visible .week-day-num{
  color:var(--sage-dark);
  font-weight:900;
}
.dashboard-task-event{
  border-style:solid;
}

/* v8.3.5 — circular calendar date buttons */
.calendar-num,
.calendar-date-view{
  width:30px!important;
  height:30px!important;
  min-width:30px!important;
  min-height:30px!important;
  max-width:30px!important;
  max-height:30px!important;
  padding:0!important;
  border-radius:50%!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  line-height:1!important;
  font-size:11px!important;
  font-weight:900!important;
  border:1px solid transparent!important;
  background:transparent!important;
  color:var(--text)!important;
}

.calendar-day.today .calendar-num,
.calendar-day.today .calendar-date-view{
  background:var(--sage)!important;
  color:#fff!important;
  border-color:var(--sage)!important;
  box-shadow:0 0 0 3px color-mix(in srgb,var(--sage) 16%,transparent)!important;
}

.calendar-day.muted-day .calendar-num,
.calendar-day.muted-day .calendar-date-view{
  opacity:.45;
}

.calendar-num:hover,
.calendar-date-view:hover,
.calendar-num:focus-visible,
.calendar-date-view:focus-visible{
  background:var(--sage-soft)!important;
  color:var(--sage-dark)!important;
  border-color:color-mix(in srgb,var(--sage) 45%,transparent)!important;
  outline:none!important;
}

.calendar-day.today .calendar-num:hover,
.calendar-day.today .calendar-date-view:hover,
.calendar-day.today .calendar-num:focus-visible,
.calendar-day.today .calendar-date-view:focus-visible{
  background:var(--sage-dark)!important;
  color:#fff!important;
}

/* Dashboard week date number circle for visual consistency */
.week-day-num{
  width:28px!important;
  height:28px!important;
  min-width:28px!important;
  min-height:28px!important;
  border-radius:50%!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  padding:0!important;
  line-height:1!important;
  font-weight:900!important;
}

.week-day.today .week-day-num{
  background:var(--sage)!important;
  color:#fff!important;
}

/* v8.3.6 — Health page phone/app width containment */
html.phone-device,
html.phone-device body{
  width:100%!important;
  max-width:100%!important;
  overflow-x:hidden!important;
}

html.phone-device #health{
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  overflow-x:hidden!important;
}

html.phone-device #health > *,
html.phone-device #health .card,
html.phone-device #health .two-col,
html.phone-device #health .form-grid,
html.phone-device #health .ai-narration-box,
html.phone-device #health .target-grid,
html.phone-device #health .nutrition-snapshot,
html.phone-device #health .small-weight-card,
html.phone-device #health .table-wrap{
  min-width:0!important;
  max-width:100%!important;
}

html.phone-device #health .two-col{
  grid-template-columns:minmax(0,1fr)!important;
  width:100%!important;
}

html.phone-device #health .form-grid{
  grid-template-columns:minmax(0,1fr)!important;
  width:100%!important;
}

html.phone-device #health .form-grid .span-2{
  grid-column:auto!important;
}

html.phone-device #health .health-metrics{
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
}

html.phone-device #health .nutrition-snapshot,
html.phone-device #health .target-grid{
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
}

html.phone-device #health input,
html.phone-device #health select,
html.phone-device #health textarea{
  min-width:0!important;
  max-width:100%!important;
}

html.phone-device #health canvas{
  display:block!important;
  width:100%!important;
  max-width:100%!important;
  height:auto;
}

html.phone-device #health .capture-actions{
  display:grid!important;
  grid-template-columns:minmax(0,1fr)!important;
  width:100%!important;
}

html.phone-device #health .capture-actions .btn,
html.phone-device #health .ai-narration-box > .btn{
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
}

html.phone-device #health .small-weight-card{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  align-items:center!important;
}
html.phone-device #health .small-weight-card span{
  grid-column:1/-1;
}
html.phone-device #health .small-weight-card strong{
  min-width:0!important;
  margin-right:0!important;
}

html.phone-device #health .table-wrap{
  width:100%!important;
  overflow-x:auto!important;
  -webkit-overflow-scrolling:touch;
}
html.phone-device #health .table-wrap table{
  min-width:680px;
}

/* Same Health containment in installed iOS/Android app if device class arrives late. */
@media (display-mode:standalone) and (max-width:600px){
  #health{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    overflow-x:hidden!important;
  }
  #health .two-col,
  #health .form-grid{
    grid-template-columns:minmax(0,1fr)!important;
    width:100%!important;
    min-width:0!important;
  }
  #health .form-grid .span-2{grid-column:auto!important}
  #health .card,
  #health .ai-narration-box,
  #health input,
  #health select,
  #health textarea,
  #health canvas{
    min-width:0!important;
    max-width:100%!important;
  }
}

/* v8.3.6 — Customize belongs to DESKTOP WEB only */
.desktop-web-only{
  display:none!important;
}
html.desktop-device .desktop-web-only{
  display:flex!important;
}
html.phone-device .desktop-web-only,
html.tablet-device .desktop-web-only{
  display:none!important;
}
@media (display-mode:standalone){
  .desktop-web-only{display:none!important}
  #customize.desktop-web-customize-page{display:none!important}
}

/* v8.3.6 — desktop left rail visually continues to the bottom of long pages */
@media (min-width:851px){
  html.desktop-device body{
    --desktop-rail-width:260px;
    background:
      linear-gradient(90deg,
        #2d382c 0,
        #2d382c var(--desktop-rail-width),
        var(--bg) var(--desktop-rail-width),
        var(--bg) 100%)!important;
  }
}
@media (min-width:851px) and (max-width:1100px){
  html.desktop-device body{--desktop-rail-width:220px}
}

/* v8.3.7 — make the REAL desktop sidebar match page height */
@media (min-width:851px){
  html.desktop-device .app-shell{
    min-height:100vh!important;
    align-items:stretch!important;
  }

  html.desktop-device .sidebar{
    position:relative!important;
    top:auto!important;
    height:auto!important;
    min-height:100vh!important;
    align-self:stretch!important;
    overflow:visible!important;
    background:linear-gradient(180deg,#2d382c 0%,#344233 65%,#473d35 100%)!important;
  }

  html.desktop-device .sidebar .privacy-note{
    margin-top:auto!important;
    padding-bottom:8px!important;
  }

  /* The old body rail is no longer needed because the sidebar itself grows. */
  html.desktop-device body{
    background:var(--bg)!important;
  }
}

/* v8.3.7 — Health history + micronutrients */
.micronutrient-entry{
  border:1px solid var(--border);
  border-radius:12px;
  padding:10px 12px;
  background:#fff;
}
.micronutrient-entry summary,
.day-log-micros summary{
  cursor:pointer;
  font-weight:900;
  color:var(--text);
}
.micronutrient-entry summary span{
  color:var(--muted);
  font-weight:600;
  font-size:10px;
}
.micronutrient-entry-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
  margin-top:12px;
}

.day-log-card{
  margin-bottom:16px;
  background:linear-gradient(145deg,#fffdf9,#f7faf3);
}
.day-log-date-controls{
  display:flex;
  gap:6px;
  align-items:center;
  flex-wrap:wrap;
}
.day-log-date-controls input{
  width:auto;
  min-width:145px;
}
.day-log-primary{
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:9px;
  margin-bottom:14px;
}
.day-log-primary>div,
.day-log-micro-grid>div{
  border:1px solid var(--border);
  border-radius:12px;
  padding:10px;
  background:#fff;
  min-width:0;
}
.day-log-primary span,
.day-log-micro-grid span{
  display:block;
  font-size:10px;
  color:var(--muted);
  margin-bottom:4px;
}
.day-log-primary strong{
  font-size:18px;
}
.day-log-micros{
  border-top:1px solid var(--border);
  padding-top:12px;
}
.day-log-micro-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:8px;
  margin-top:10px;
}
.day-log-micro-grid strong{
  font-size:13px;
}
.day-log-meals-wrap{
  margin-top:16px;
  border-top:1px solid var(--border);
  padding-top:14px;
}
.section-head.compact{
  margin-bottom:8px;
}
.day-log-meals{
  display:grid;
  gap:8px;
}
.day-log-meal{
  border:1px solid var(--border);
  border-radius:12px;
  padding:11px 12px;
  background:#fff;
}
.day-log-meal p{
  margin:4px 0 5px;
  font-size:12px;
}
.day-log-meal small{
  color:var(--muted);
  font-size:10px;
}

@media(max-width:760px){
  .micronutrient-entry-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .day-log-head{
    align-items:flex-start!important;
    flex-direction:column;
  }
  .day-log-date-controls{
    width:100%;
  }
  .day-log-date-controls input{
    flex:1;
    min-width:0;
  }
  .day-log-primary{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .day-log-micro-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}
@media(max-width:420px){
  .micronutrient-entry-grid{
    grid-template-columns:1fr;
  }
}

/* v8.3.8 — genuinely swipeable bottom tabs */
html.phone-device #mobileBottomNav.mobile-bottom-nav.scroll-tabs,html.tablet-device #mobileBottomNav.mobile-bottom-nav.scroll-tabs{scroll-snap-type:none!important;overscroll-behavior-x:auto!important;touch-action:pan-x!important;scroll-behavior:auto!important}
html.phone-device #mobileBottomNav .bottom-nav-btn,html.tablet-device #mobileBottomNav .bottom-nav-btn{scroll-snap-align:none!important;touch-action:pan-x!important;-webkit-user-select:none;user-select:none}
.saved-clinical-notes-section{margin-top:18px;padding-top:15px;border-top:1px solid var(--border)}
.saved-clinical-notes{display:grid;gap:9px;max-height:430px;overflow-y:auto}.saved-note-card{display:grid;grid-template-columns:48px minmax(0,1fr);gap:10px;align-items:start;padding:10px;border:1px solid var(--border);border-radius:13px;background:#fff}.saved-note-date{width:44px;height:44px;border-radius:50%;display:flex;flex-direction:column;justify-content:center;align-items:center;background:var(--sage-soft);color:var(--sage-dark);line-height:1}.saved-note-date span{font-size:8px;text-transform:uppercase;font-weight:900}.saved-note-date strong{font-size:16px;margin-top:2px}.saved-note-main{min-width:0}.saved-note-title-row{display:flex;align-items:center;gap:7px;flex-wrap:wrap}.saved-note-main>small{display:block;margin:3px 0 6px;color:var(--muted)}.saved-note-main p{margin:0 0 7px;font-size:10px;line-height:1.4}.saved-note-actions{display:flex;gap:6px}.saved-draft-inline{display:inline-block;margin-top:6px;padding:5px 7px;border-radius:8px;background:var(--sage-soft);color:var(--sage-dark);font-weight:800}.scribe-visit-date-badge{margin:9px 0 10px;padding:8px 10px;border-radius:10px;background:var(--sage-soft);color:var(--sage-dark);font-size:10px;font-weight:800}

/* v8.3.9 — first-login cloud safety */
.cloud-safety-status{margin:10px 0 0;padding:10px 12px;border:1px solid var(--border);border-radius:12px;background:var(--sage-soft);display:grid;gap:3px}
.cloud-safety-status strong{font-size:10px;text-transform:uppercase;letter-spacing:.05em}.cloud-safety-status span{font-size:10px;line-height:1.4;color:var(--text)}
.cloud-safety-status[data-kind="error"]{background:var(--peach-soft);border-color:#d8a58f}.cloud-safety-status[data-kind="busy"]{opacity:.85}

/* v8.3.10 — compact phone/iPad top app bar */
html.phone-device .topbar,
html.tablet-device .topbar{
  min-height:48px!important;
  height:auto!important;
  padding:6px 10px!important;
  margin:0!important;
  gap:8px!important;
  align-items:center!important;
}

html.phone-device .topbar > *,
html.tablet-device .topbar > *{
  min-height:0!important;
}

html.phone-device .topbar h1,
html.tablet-device .topbar h1,
html.phone-device .topbar h2,
html.tablet-device .topbar h2{
  margin:0!important;
  line-height:1.1!important;
}

html.phone-device .topbar .page-title,
html.tablet-device .topbar .page-title{
  font-size:17px!important;
  line-height:1.1!important;
  margin:0!important;
}

html.phone-device .topbar .eyebrow,
html.tablet-device .topbar .eyebrow,
html.phone-device .topbar p,
html.tablet-device .topbar p{
  margin-top:0!important;
  margin-bottom:2px!important;
  line-height:1.15!important;
}

html.phone-device .topbar .top-actions,
html.tablet-device .topbar .top-actions{
  gap:5px!important;
  align-items:center!important;
}

html.phone-device .topbar button,
html.tablet-device .topbar button{
  min-height:34px!important;
  height:34px!important;
  padding:5px 9px!important;
}

/* Keep the content directly under the header from inheriting oversized spacing. */
html.phone-device .main-content,
html.tablet-device .main-content{
  padding-top:10px!important;
}

@media (display-mode:standalone) and (max-width:850px){
  .topbar{
    min-height:48px!important;
    height:auto!important;
    padding:6px 10px!important;
    gap:8px!important;
  }
  .topbar button{
    min-height:34px!important;
    height:34px!important;
    padding:5px 9px!important;
  }
}

/* v8.3.11 — slim the ACTUAL top app header on phone/iPad/web touch views.
   Navigation remains exclusively in the bottom swipe strip. */
@media (max-width:900px), (hover:none) and (pointer:coarse) and (max-width:1180px){
  .sidebar{
    min-height:44px!important;
    height:44px!important;
    max-height:44px!important;
    padding:5px 10px!important;
    border-radius:0 0 10px 10px!important;
    box-shadow:0 3px 10px rgba(31,42,31,.10)!important;
    overflow:hidden!important;
    display:flex!important;
    align-items:center!important;
  }

  .sidebar .brand{
    min-height:34px!important;
    height:34px!important;
    max-height:34px!important;
    margin:0!important;
    gap:8px!important;
    width:100%!important;
    align-items:center!important;
  }

  .sidebar .brand-mark{
    width:30px!important;
    height:30px!important;
    min-width:30px!important;
    flex-basis:30px!important;
    border-radius:9px!important;
    font-size:14px!important;
  }

  .sidebar .brand h1{
    margin:0!important;
    font-size:13px!important;
    line-height:1!important;
  }

  /* Hide secondary branding copy/version in compact app header.
     It remains visible in the desktop left sidebar. */
  .sidebar .brand p,
  .sidebar .app-version{
    display:none!important;
  }

  .sidebar nav{
    display:none!important;
  }

  .sidebar .privacy-note{
    display:none!important;
  }

  .main{
    padding-top:8px!important;
  }

  /* Page title strip should read like a header, not a large card. */
  .topbar{
    min-height:40px!important;
    height:auto!important;
    max-height:52px!important;
    margin:0 0 8px!important;
    padding:5px 8px!important;
    gap:6px!important;
    border-radius:10px!important;
    box-shadow:none!important;
    overflow:hidden!important;
  }

  .topbar .eyebrow{
    margin:0 0 1px!important;
    font-size:8px!important;
    line-height:1!important;
  }

  .topbar h2{
    margin:0!important;
    font-size:18px!important;
    line-height:1.05!important;
  }

  .topbar .top-actions{
    margin:0!important;
    min-height:0!important;
  }

  .topbar .top-actions:empty{
    display:none!important;
  }
}

/* Explicit phone/tablet classes override historical header rules. */
html.phone-device .sidebar,
html.tablet-device .sidebar{
  min-height:44px!important;
  height:44px!important;
  max-height:44px!important;
  padding:5px 10px!important;
  display:flex!important;
  align-items:center!important;
}
html.phone-device .sidebar .brand,
html.tablet-device .sidebar .brand{
  min-height:34px!important;
  height:34px!important;
  max-height:34px!important;
  margin:0!important;
}
html.phone-device .sidebar .brand p,
html.tablet-device .sidebar .brand p,
html.phone-device .sidebar .app-version,
html.tablet-device .sidebar .app-version{
  display:none!important;
}
html.phone-device .sidebar nav,
html.tablet-device .sidebar nav{
  display:none!important;
}

/* Normal desktop web: keep a clean, compact page-title row.
   The real navigation stays in the left rail. */
html.desktop-device .topbar{
  min-height:42px!important;
  height:auto!important;
  margin:0 0 12px!important;
  padding:0!important;
  background:transparent!important;
  border:0!important;
  border-radius:0!important;
  box-shadow:none!important;
}
html.desktop-device .topbar h2{
  font-size:24px!important;
  line-height:1.1!important;
}
html.desktop-device .topbar .eyebrow{
  margin:0 0 2px!important;
}
html.desktop-device .topbar .top-actions:empty{
  display:none!important;
}

/* Installed mobile/tablet PWA gets the same slim app header. */
@media (display-mode:standalone) and (max-width:900px){
  .sidebar{
    min-height:44px!important;
    height:44px!important;
    max-height:44px!important;
    padding:5px 10px!important;
  }
  .sidebar .brand p,
  .sidebar .app-version,
  .sidebar nav{
    display:none!important;
  }
  .topbar{
    min-height:40px!important;
    max-height:52px!important;
    padding:5px 8px!important;
    margin-bottom:8px!important;
  }
}

/* v8.3.12 — HARD DESKTOP-WEB LAYOUT GUARD
   A normal Mac/Windows/Linux browser remains desktop even when its window is narrow.
   Width alone must never convert the desktop left rail into a full-width top header. */
html.desktop-device .app-shell{
  display:grid!important;
  grid-template-columns:clamp(190px,22vw,260px) minmax(0,1fr)!important;
  min-height:100vh!important;
  width:100%!important;
  max-width:100%!important;
  align-items:stretch!important;
  overflow:visible!important;
}

html.desktop-device .sidebar{
  position:relative!important;
  inset:auto!important;
  top:auto!important;
  left:auto!important;
  right:auto!important;
  bottom:auto!important;
  width:auto!important;
  min-width:0!important;
  height:auto!important;
  min-height:100vh!important;
  max-height:none!important;
  align-self:stretch!important;
  padding:26px 18px!important;
  margin:0!important;
  overflow:visible!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:stretch!important;
  border-radius:0!important;
  box-shadow:none!important;
  background:linear-gradient(180deg,#2d382c 0%,#344233 65%,#473d35 100%)!important;
}

html.desktop-device .sidebar .brand{
  display:flex!important;
  align-items:center!important;
  width:auto!important;
  min-height:0!important;
  height:auto!important;
  max-height:none!important;
  margin:0 0 24px!important;
  gap:12px!important;
}
html.desktop-device .sidebar .brand-mark{
  width:42px!important;
  height:42px!important;
  min-width:42px!important;
  flex:0 0 42px!important;
  border-radius:14px!important;
  font-size:20px!important;
}
html.desktop-device .sidebar .brand h1{
  display:block!important;
  margin:0!important;
  font-size:18px!important;
  line-height:1.15!important;
}
html.desktop-device .sidebar .brand p{
  display:block!important;
  margin:3px 0 0!important;
  font-size:11px!important;
  line-height:1.25!important;
  white-space:normal!important;
}
html.desktop-device .sidebar .app-version{
  display:block!important;
}
html.desktop-device .sidebar nav{
  display:grid!important;
  grid-template-columns:1fr!important;
  gap:4px!important;
  overflow:visible!important;
  padding:0!important;
  margin:0!important;
}
html.desktop-device .sidebar .nav-btn{
  display:block!important;
  width:100%!important;
  min-height:0!important;
  height:auto!important;
  padding:10px 12px!important;
  border-radius:11px!important;
  white-space:normal!important;
}
html.desktop-device .sidebar .privacy-note{
  display:block!important;
  margin-top:auto!important;
  padding-top:16px!important;
  padding-bottom:8px!important;
}

html.desktop-device .main{
  display:block!important;
  width:100%!important;
  max-width:1500px!important;
  min-width:0!important;
  margin:0!important;
  padding:28px 34px 60px!important;
  overflow-x:hidden!important;
}

html.desktop-device #mobileBottomNav.mobile-bottom-nav.scroll-tabs{
  display:none!important;
}

html.desktop-device .topbar{
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  min-height:42px!important;
  height:auto!important;
  max-height:none!important;
  margin:0 0 12px!important;
  padding:0!important;
  background:transparent!important;
  border:0!important;
  border-radius:0!important;
  box-shadow:none!important;
  overflow:visible!important;
}

/* Narrow desktop browser windows keep the desktop rail, just slightly tighter. */
@media (max-width:850px){
  html.desktop-device .app-shell{
    grid-template-columns:190px minmax(0,1fr)!important;
  }
  html.desktop-device .sidebar{
    padding:20px 13px!important;
  }
  html.desktop-device .sidebar .brand-mark{
    width:36px!important;height:36px!important;min-width:36px!important;flex-basis:36px!important;
  }
  html.desktop-device .sidebar .brand h1{font-size:15px!important}
  html.desktop-device .sidebar .brand p{font-size:9.5px!important}
  html.desktop-device .sidebar .nav-btn{font-size:11px!important;padding:9px 9px!important}
  html.desktop-device .main{padding:20px 20px 54px!important}
}

/* v8.3.13 — HARD mobile dock size guard. Never allow the bottom nav to become a giant block. */
html.phone-device #mobileBottomNav.mobile-bottom-nav.scroll-tabs,
html.tablet-device #mobileBottomNav.mobile-bottom-nav.scroll-tabs{
  display:flex!important;
  position:fixed!important;
  inset:auto 0 0 0!important;
  z-index:700!important;
  width:100vw!important;
  max-width:100vw!important;
  block-size:68px!important;
  height:68px!important;
  min-height:68px!important;
  max-height:68px!important;
  min-block-size:68px!important;
  max-block-size:68px!important;
  margin:0!important;
  padding:5px 7px 7px!important;
  flex-direction:row!important;
  flex-wrap:nowrap!important;
  align-items:center!important;
  align-content:center!important;
  justify-content:flex-start!important;
  gap:3px!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
  box-sizing:border-box!important;
  contain:layout paint!important;
  background:#293429!important;
  border-radius:0!important;
  border-top:1px solid rgba(255,255,255,.12)!important;
  box-shadow:0 -6px 18px rgba(24,33,24,.16)!important;
  scroll-snap-type:none!important;
  overscroll-behavior-x:auto!important;
  touch-action:pan-x!important;
  -webkit-overflow-scrolling:touch!important;
}
html.phone-device #mobileBottomNav .bottom-nav-btn,
html.tablet-device #mobileBottomNav .bottom-nav-btn{
  flex:0 0 76px!important;
  width:76px!important;
  min-width:76px!important;
  max-width:76px!important;
  block-size:54px!important;
  height:54px!important;
  min-height:54px!important;
  max-height:54px!important;
  margin:0!important;
  padding:3px 2px!important;
  box-sizing:border-box!important;
  overflow:hidden!important;
  align-self:center!important;
  scroll-snap-align:none!important;
}
html.phone-device .main,html.tablet-device .main{padding-bottom:82px!important}

/* Assistant drawer occupies the usable area ABOVE the fixed dock. */
html.phone-device body.floating-ai-open #floatingAiBtn,
html.tablet-device body.floating-ai-open #floatingAiBtn{opacity:0!important;pointer-events:none!important}
html.phone-device #floatingAiBtn.floating-ai-btn,
html.tablet-device #floatingAiBtn.floating-ai-btn{bottom:76px!important}
html.phone-device #floatingAiPanel.floating-ai-panel{
  position:fixed!important;left:8px!important;right:8px!important;top:8px!important;bottom:76px!important;
  width:auto!important;max-width:none!important;height:auto!important;max-height:none!important;min-height:0!important;
  padding:12px!important;border-radius:18px!important;box-sizing:border-box!important;overflow:hidden!important;
  display:flex!important;flex-direction:column!important;
}
html.phone-device #floatingAiPanel.floating-ai-panel.hidden{display:none!important}
html.tablet-device #floatingAiPanel.floating-ai-panel{
  position:fixed!important;left:auto!important;right:12px!important;top:12px!important;bottom:78px!important;
  width:min(430px,calc(100vw - 24px))!important;max-width:calc(100vw - 24px)!important;
  height:auto!important;max-height:none!important;min-height:0!important;padding:13px!important;overflow:hidden!important;
  display:flex!important;flex-direction:column!important;
}
html.tablet-device #floatingAiPanel.floating-ai-panel.hidden{display:none!important}
html.phone-device #floatingAiMessages.floating-ai-messages,
html.tablet-device #floatingAiMessages.floating-ai-messages{
  flex:1 1 auto!important;min-height:0!important;max-height:none!important;overflow-y:auto!important;
  overscroll-behavior-y:contain!important;-webkit-overflow-scrolling:touch!important;padding:10px 0!important;
}
html.phone-device #floatingAiForm.floating-ai-form,
html.tablet-device #floatingAiForm.floating-ai-form{
  flex:0 0 auto!important;position:relative!important;margin-top:6px!important;padding-top:8px!important;
  border-top:1px solid var(--border)!important;background:var(--panel)!important;z-index:2!important;
}
html.phone-device #floatingAiForm.floating-ai-form{display:grid!important;grid-template-columns:1fr!important;gap:8px!important}
html.phone-device #floatingAiInput{min-height:70px!important;max-height:105px!important;resize:none!important}
html.phone-device #floatingAiForm .btn{min-height:44px!important;width:100%!important}
