
:root{
  --bg: #0a0b0d;
  --bg-elevated: #111318;
  --bg-elevated-2: #171a20;
  --bg-hover: #1d2128;
  --border: #23262e;
  --border-soft: #1a1d24;
  --text: #eeeae2;
  --text-dim: #a3a7b3;
  --text-faint: #63677a;
  --accent: #c9a15a;
  --accent-soft: rgba(201,161,90,.14);
  --accent-text: #e4c483;
  --blue: #7fa8c9;
  --green: #7fb88f;
  --red: #d17b6a;
  --orange: #d9a35c;
  --yellow: #d6c26a;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 20px 60px -20px rgba(0,0,0,.6);
  --serif: 'Fraunces', serif;
  --sans: 'Manrope', sans-serif;
  --mono: 'JetBrains Mono', monospace;
}
[data-theme="light"]{
  --bg: #faf8f4;
  --bg-elevated: #ffffff;
  --bg-elevated-2: #f2efe8;
  --bg-hover: #ece8df;
  --border: #e5e0d5;
  --border-soft: #ede9df;
  --text: #201d18;
  --text-dim: #66605450;
  --text-dim: #6b6255;
  --text-faint: #9a927f;
  --accent: #a97d2f;
  --accent-soft: rgba(169,125,47,.12);
  --accent-text: #8a651f;
  --shadow: 0 20px 60px -25px rgba(0,0,0,.25);
}
*{box-sizing:border-box;}
html,body{margin:0;padding:0;height:100%;}
body{
  background:var(--bg); color:var(--text);
  font-family:var(--sans);
  -webkit-font-smoothing:antialiased;
  overflow:hidden;
}
::selection{background:var(--accent-soft); color:var(--accent-text);}
::-webkit-scrollbar{width:8px;height:8px;}
::-webkit-scrollbar-thumb{background:var(--border);border-radius:8px;}
::-webkit-scrollbar-track{background:transparent;}
h1,h2,h3,h4{font-family:var(--serif); font-weight:500; margin:0; letter-spacing:-.01em;}
p{margin:0;}
a{color:inherit;text-decoration:none;}
button{font-family:var(--sans);cursor:pointer;}
input,textarea,select{font-family:var(--sans);}
.mono{font-family:var(--mono);}

#shell{display:flex;height:100vh;height:100dvh;width:100vw;}

/* ===== Sidebar ===== */
#sidebar{
  width:236px; flex-shrink:0; background:var(--bg-elevated);
  border-right:1px solid var(--border-soft);
  display:flex; flex-direction:column; padding:18px 12px;
  transition:transform .3s ease;
}
.brand{display:flex;align-items:center;gap:10px;padding:6px 10px 20px 10px;}
.brand-mark{width:26px;height:26px;border-radius:7px;background:linear-gradient(135deg,var(--accent),#8a6a2f);display:flex;align-items:center;justify-content:center;font-family:var(--serif);font-weight:600;color:#0a0b0d;font-size:14px;}
.brand-name{font-family:var(--serif);font-size:16.5px;font-weight:500;letter-spacing:-.01em;}
.nav-group{margin-bottom:4px;}
.nav-label{font-size:10.5px;text-transform:uppercase;letter-spacing:.09em;color:var(--text-faint);padding:14px 12px 6px;font-weight:600;}
.nav-item{
  display:flex;align-items:center;gap:11px;padding:8px 12px;border-radius:9px;
  color:var(--text-dim);font-size:13.6px;font-weight:500;margin:1px 0;
  transition:background .12s, color .12s; position:relative; cursor:pointer;
}
.nav-item svg{flex-shrink:0;opacity:.85;}
.nav-item:hover{background:var(--bg-hover);color:var(--text);}
.nav-item.active{background:var(--accent-soft);color:var(--accent-text);}
.nav-item.active svg{opacity:1;}
.nav-badge{margin-left:auto;background:var(--red);color:#fff;font-size:10px;font-weight:700;padding:1px 6px;border-radius:20px;}
.sidebar-foot{margin-top:auto;padding-top:10px;border-top:1px solid var(--border-soft);}
.profile-row{display:flex;align-items:center;gap:9px;padding:8px 10px;border-radius:10px;cursor:pointer;}
.profile-row:hover{background:var(--bg-hover);}
.avatar{width:28px;height:28px;border-radius:50%;background:linear-gradient(135deg,#8a97a8,#4a5568);display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:700;color:#fff;flex-shrink:0;}
.profile-name{font-size:12.5px;font-weight:600;}
.profile-sub{font-size:10.5px;color:var(--text-faint);}

/* ===== Main ===== */
#main{flex:1;display:flex;flex-direction:column;min-width:0;position:relative;}
#topbar{
  height:58px;flex-shrink:0;display:flex;align-items:center;gap:12px;
  padding:0 22px;border-bottom:1px solid var(--border-soft);
}
#topbar .crumbs{font-size:12.5px;color:var(--text-faint);display:flex;align-items:center;gap:6px;}
#topbar .crumbs b{color:var(--text-dim);font-weight:600;}
.search-trigger{
  margin-left:auto;display:flex;align-items:center;gap:8px;
  background:var(--bg-elevated-2);border:1px solid var(--border);
  padding:7px 10px 7px 12px;border-radius:9px;color:var(--text-faint);font-size:12.5px;
  min-width:220px;
}
.search-trigger kbd{margin-left:auto;font-family:var(--mono);font-size:10px;background:var(--bg-hover);padding:2px 6px;border-radius:5px;border:1px solid var(--border);}
.icon-btn{width:34px;height:34px;border-radius:9px;display:flex;align-items:center;justify-content:center;background:transparent;border:1px solid transparent;color:var(--text-dim);position:relative;}
.icon-btn:hover{background:var(--bg-hover);border-color:var(--border);color:var(--text);}
.dot-badge{position:absolute;top:6px;right:6px;width:7px;height:7px;border-radius:50%;background:var(--red);border:1.5px solid var(--bg-elevated);}
#content{flex:1;overflow-y:auto;padding:30px 34px 70px;}
.page-head{display:flex;align-items:baseline;justify-content:space-between;margin-bottom:22px;flex-wrap:wrap;gap:10px;}
.page-title{font-size:26px;}
.page-sub{color:var(--text-faint);font-size:13px;margin-top:4px;}

/* ===== Buttons ===== */
.btn{border:1px solid var(--border);background:var(--bg-elevated-2);color:var(--text);padding:8px 14px;border-radius:9px;font-size:13px;font-weight:600;display:inline-flex;align-items:center;gap:7px;transition:.12s;}
.btn:hover{background:var(--bg-hover);}
.btn-primary{background:var(--accent);border-color:var(--accent);color:#1a1305;}
.btn-primary:hover{background:var(--accent-text);}
.btn-ghost{background:transparent;border-color:transparent;color:var(--text-dim);}
.btn-ghost:hover{background:var(--bg-hover);color:var(--text);}
.btn-sm{padding:5px 10px;font-size:12px;}
.btn-danger{color:var(--red);}

/* ===== Cards / grid ===== */
.grid{display:grid;gap:14px;}
.grid-2{grid-template-columns:1fr 1fr;}
.grid-3{grid-template-columns:repeat(3,1fr);}
.card{background:var(--bg-elevated);border:1px solid var(--border-soft);border-radius:var(--radius);padding:18px;}
.card-title{font-size:13px;font-weight:700;color:var(--text-dim);text-transform:uppercase;letter-spacing:.06em;margin-bottom:12px;display:flex;align-items:center;gap:8px;}
.card-title .cnt{margin-left:auto;font-family:var(--mono);font-weight:500;color:var(--text-faint);font-size:11px;text-transform:none;letter-spacing:0;}
.empty-state{padding:18px 8px;text-align:center;color:var(--text-faint);font-size:12.5px;}
.empty-state .btn{margin-top:10px;}

.badge{font-size:10px;font-weight:700;padding:2px 7px;border-radius:20px;text-transform:uppercase;letter-spacing:.04em;}
.badge-demo{background:rgba(217,163,92,.15);color:var(--orange);}
.badge-real{background:rgba(127,184,143,.15);color:var(--green);}
.badge-ai{background:rgba(127,168,201,.15);color:var(--blue);}
.badge-soon{background:var(--bg-hover);color:var(--text-faint);}

.attn-row{display:flex;align-items:flex-start;gap:10px;padding:9px 4px;border-bottom:1px solid var(--border-soft);font-size:13px;}
.attn-row:last-child{border-bottom:none;}
.attn-dot{width:8px;height:8px;border-radius:50%;margin-top:4px;flex-shrink:0;}
.attn-red{background:var(--red);} .attn-orange{background:var(--orange);} .attn-yellow{background:var(--yellow);} .attn-green{background:var(--green);}
.attn-text{flex:1;}
.attn-why{color:var(--text-faint);font-size:11px;margin-top:2px;}

.list-row{display:flex;align-items:center;gap:11px;padding:10px 6px;border-radius:8px;font-size:13.5px;cursor:pointer;}
.list-row:hover{background:var(--bg-hover);}
.list-row .meta{margin-left:auto;font-size:11.5px;color:var(--text-faint);display:flex;align-items:center;gap:8px;}
.check{width:17px;height:17px;border-radius:6px;border:1.5px solid var(--border);flex-shrink:0;display:flex;align-items:center;justify-content:center;}
.check.done{background:var(--green);border-color:var(--green);}
.pill{font-size:10.5px;padding:2px 8px;border-radius:20px;background:var(--bg-hover);color:var(--text-dim);font-weight:600;}
.pill-prio-high{background:rgba(209,123,106,.15);color:var(--red);}
.pill-prio-med{background:rgba(217,163,92,.15);color:var(--orange);}
.pill-prio-low{background:rgba(127,184,143,.15);color:var(--green);}

.stat{display:flex;flex-direction:column;gap:2px;}
.stat-val{font-family:var(--serif);font-size:22px;}
.stat-label{font-size:11px;color:var(--text-faint);}
.trend-up{color:var(--green);} .trend-down{color:var(--red);} .trend-flat{color:var(--text-faint);}

/* ===== Home Briefing ===== */
.briefing{
  background:linear-gradient(160deg,var(--bg-elevated) 0%, var(--bg-elevated-2) 100%);
  border:1px solid var(--border-soft);border-radius:18px;padding:26px 28px;margin-bottom:20px;position:relative;overflow:hidden;
}
.briefing::before{content:'';position:absolute;top:-60%;right:-10%;width:320px;height:320px;background:radial-gradient(circle,var(--accent-soft),transparent 70%);pointer-events:none;}
.greeting{font-family:var(--serif);font-size:25px;margin-bottom:6px;}
.briefing-text{color:var(--text-dim);font-size:14px;line-height:1.65;max-width:640px;position:relative;}
.briefing-loading{display:flex;align-items:center;gap:8px;color:var(--text-faint);font-size:13px;}

/* Free time bar */
.day-bar{display:flex;height:26px;border-radius:7px;overflow:hidden;border:1px solid var(--border-soft);margin-top:14px;}
.day-bar span{height:100%;}

/* ===== Command palette / search ===== */
.overlay{position:fixed;inset:0;background:rgba(5,6,8,.6);backdrop-filter:blur(3px);z-index:100;display:flex;align-items:flex-start;justify-content:center;padding-top:12vh;}
.palette{width:600px;max-width:92vw;background:var(--bg-elevated);border:1px solid var(--border);border-radius:14px;box-shadow:var(--shadow);overflow:hidden;}
.palette input{width:100%;border:none;background:transparent;padding:16px 18px;font-size:15px;color:var(--text);outline:none;border-bottom:1px solid var(--border-soft);}
.palette-results{max-height:360px;overflow-y:auto;padding:6px;}
.palette-item{display:flex;align-items:center;gap:10px;padding:9px 10px;border-radius:8px;font-size:13.5px;}
.palette-item:hover, .palette-item.sel{background:var(--bg-hover);}
.palette-item .type{margin-left:auto;font-size:10.5px;color:var(--text-faint);}
.palette-empty{padding:26px;text-align:center;color:var(--text-faint);font-size:13px;}

/* ===== Quick add ===== */
.qa-panel{width:520px;max-width:92vw;background:var(--bg-elevated);border:1px solid var(--border);border-radius:16px;box-shadow:var(--shadow);padding:20px;}
.qa-panel textarea{width:100%;resize:none;background:var(--bg-elevated-2);border:1px solid var(--border);border-radius:10px;padding:12px 14px;color:var(--text);font-size:14.5px;outline:none;min-height:64px;line-height:1.5;}
.qa-panel textarea:focus{border-color:var(--accent);}
.qa-hints{display:flex;flex-wrap:wrap;gap:6px;margin-top:12px;}
.qa-hint{font-size:11.5px;background:var(--bg-elevated-2);border:1px solid var(--border-soft);padding:4px 9px;border-radius:20px;color:var(--text-faint);}
.qa-types{display:flex;flex-wrap:wrap;gap:6px;margin-top:14px;}
.qa-type-btn{font-size:11.5px;padding:6px 10px;border-radius:8px;border:1px solid var(--border-soft);background:var(--bg-elevated-2);color:var(--text-dim);}
.qa-preview{margin-top:14px;background:var(--bg-elevated-2);border:1px solid var(--accent);border-radius:10px;padding:14px;}
.qa-preview .kv{display:flex;font-size:12.5px;padding:3px 0;}
.qa-preview .kv b{width:110px;color:var(--text-faint);font-weight:600;}

/* ===== AI panel ===== */
#ai-panel{
  position:fixed;top:0;right:0;height:100vh;width:400px;max-width:92vw;
  background:var(--bg-elevated);border-left:1px solid var(--border);z-index:90;
  display:flex;flex-direction:column;transform:translateX(100%);transition:transform .25s ease;box-shadow:var(--shadow);
}
#ai-panel.open{transform:translateX(0);}
.ai-head{padding:16px 18px;border-bottom:1px solid var(--border-soft);display:flex;align-items:center;gap:10px;}
.ai-title{font-family:var(--serif);font-size:16px;}
.ai-msgs{flex:1;overflow-y:auto;padding:16px 18px;display:flex;flex-direction:column;gap:14px;}
.ai-msg{font-size:13.5px;line-height:1.6;}
.ai-msg.user{align-self:flex-end;background:var(--accent-soft);color:var(--accent-text);padding:9px 13px;border-radius:12px 12px 3px 12px;max-width:85%;}
.ai-msg.assistant{background:var(--bg-elevated-2);padding:11px 14px;border-radius:12px 12px 12px 3px;border:1px solid var(--border-soft);}
.ai-msg.assistant .src{margin-top:8px;font-size:10.5px;color:var(--text-faint);border-top:1px solid var(--border-soft);padding-top:6px;}
.ai-suggest{display:flex;flex-wrap:wrap;gap:6px;padding:0 18px 12px;}
.ai-suggest span{font-size:11.5px;background:var(--bg-elevated-2);border:1px solid var(--border-soft);padding:5px 9px;border-radius:20px;color:var(--text-dim);cursor:pointer;}
.ai-suggest span:hover{border-color:var(--accent);color:var(--accent-text);}
.ai-input-row{padding:14px;border-top:1px solid var(--border-soft);display:flex;gap:8px;}
.ai-input-row input{flex:1;background:var(--bg-elevated-2);border:1px solid var(--border);border-radius:10px;padding:10px 13px;color:var(--text);font-size:13.5px;outline:none;}
.ai-input-row input:focus{border-color:var(--accent);}
.typing{display:flex;gap:4px;padding:4px 0;}
.typing span{width:5px;height:5px;border-radius:50%;background:var(--text-faint);animation:blink 1.2s infinite ease-in-out;}
.typing span:nth-child(2){animation-delay:.2s;} .typing span:nth-child(3){animation-delay:.4s;}
@keyframes blink{0%,80%,100%{opacity:.25;}40%{opacity:1;}}

/* Toast */
#toast-wrap{position:fixed;bottom:20px;left:50%;transform:translateX(-50%);z-index:200;display:flex;flex-direction:column;gap:8px;align-items:center;}
.toast{background:var(--bg-elevated);border:1px solid var(--border);padding:10px 16px;border-radius:10px;font-size:13px;box-shadow:var(--shadow);animation:toastIn .2s ease;}
@keyframes toastIn{from{opacity:0;transform:translateY(8px);}to{opacity:1;transform:translateY(0);}}

/* Detail page */
.detail-header{display:flex;align-items:center;gap:16px;margin-bottom:22px;}
.detail-avatar{width:58px;height:58px;border-radius:16px;background:linear-gradient(135deg,#8a97a8,#4a5568);display:flex;align-items:center;justify-content:center;font-size:22px;font-weight:700;color:#fff;flex-shrink:0;}
.tab-row{display:flex;gap:4px;border-bottom:1px solid var(--border-soft);margin-bottom:18px;}
.tab{padding:9px 4px;margin-right:18px;font-size:13px;color:var(--text-faint);border-bottom:2px solid transparent;cursor:pointer;font-weight:600;}
.tab.active{color:var(--text);border-color:var(--accent);}

/* Forms */
.field{margin-bottom:14px;}
.field label{display:block;font-size:12px;color:var(--text-faint);margin-bottom:5px;font-weight:600;}
.field input,.field select,.field textarea{width:100%;background:var(--bg-elevated-2);border:1px solid var(--border);border-radius:9px;padding:9px 11px;color:var(--text);font-size:13.5px;outline:none;}
.field input:focus,.field select:focus,.field textarea:focus{border-color:var(--accent);}
.modal-bg{position:fixed;inset:0;background:rgba(5,6,8,.55);z-index:100;display:flex;align-items:center;justify-content:center;}
.modal{width:460px;max-width:92vw;max-height:86vh;overflow-y:auto;background:var(--bg-elevated);border:1px solid var(--border);border-radius:16px;padding:22px;box-shadow:var(--shadow);}
.modal-head{display:flex;align-items:center;margin-bottom:16px;}
.modal-head h3{flex:1;font-size:17px;}

/* Kanban */
.kanban{display:grid;grid-template-columns:repeat(6,1fr);gap:12px;}
.kanban-col{background:var(--bg-elevated);border:1px solid var(--border-soft);border-radius:12px;padding:10px;min-height:120px;}
.kanban-col h4{font-size:11.5px;text-transform:uppercase;letter-spacing:.05em;color:var(--text-faint);margin-bottom:8px;padding:0 4px;}
.kanban-card{background:var(--bg-elevated-2);border:1px solid var(--border-soft);border-radius:9px;padding:9px 10px;font-size:12.5px;margin-bottom:7px;cursor:pointer;}
.kanban-card:hover{border-color:var(--accent);}

/* progress */
.progress-bar{height:6px;border-radius:20px;background:var(--bg-hover);overflow:hidden;}
.progress-bar div{height:100%;background:var(--accent);border-radius:20px;}
.balance-bar{display:flex;align-items:center;gap:10px;margin-bottom:9px;}
.balance-bar .lbl{width:110px;font-size:12px;color:var(--text-dim);}
.balance-bar .track{flex:1;height:8px;background:var(--bg-hover);border-radius:20px;overflow:hidden;}
.balance-bar .track div{height:100%;border-radius:20px;}

.chip-row{display:flex;flex-wrap:wrap;gap:6px;}
.chip{font-size:11px;background:var(--bg-hover);color:var(--text-dim);padding:4px 9px;border-radius:20px;}
.person-chip{cursor:pointer;border:1px solid var(--border-soft);user-select:none;transition:.1s;}
.person-chip:hover{border-color:var(--accent);}
.chip-active{background:var(--accent-soft) !important;color:var(--accent-text) !important;border-color:var(--accent) !important;}

.calendar-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:1px;background:var(--border-soft);border:1px solid var(--border-soft);border-radius:12px;overflow:hidden;}
.cal-cell{background:var(--bg-elevated);min-height:96px;padding:7px;font-size:11.5px;}
.cal-cell .dnum{color:var(--text-faint);font-size:11px;margin-bottom:5px;}
.cal-cell.today{background:var(--accent-soft);}
.cal-cell.today .dnum{color:var(--accent-text);font-weight:700;}
.cal-ev{background:var(--bg-hover);border-left:2px solid var(--blue);padding:2px 5px;border-radius:4px;margin-bottom:3px;font-size:10.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.cal-ev.google{border-color:var(--green);}
.cal-dow{text-align:center;font-size:10.5px;color:var(--text-faint);padding:6px 0;background:var(--bg-elevated-2);text-transform:uppercase;letter-spacing:.05em;}

.mobile-tabbar{display:none;}
@media (max-width: 880px){
  #sidebar{position:fixed;left:0;top:0;height:100vh;z-index:80;transform:translateX(-100%);}
  #sidebar.open{transform:translateX(0);}
  .kanban{grid-template-columns:1fr 1fr;}
  .grid-2,.grid-3{grid-template-columns:1fr;}
  #ai-panel{width:100vw;}
  .mobile-tabbar{display:flex;position:fixed;bottom:0;left:0;right:0;height:60px;background:var(--bg-elevated);border-top:1px solid var(--border-soft);z-index:70;align-items:center;justify-content:space-around;}
  .mobile-tabbar div{display:flex;flex-direction:column;align-items:center;gap:2px;color:var(--text-faint);font-size:9.5px;}
  #content{padding:20px 16px 90px;}
}
.fade-in{animation:fadeIn .28s ease;}
@keyframes fadeIn{from{opacity:0;transform:translateY(4px);}to{opacity:1;transform:translateY(0);}}
.skel{background:linear-gradient(90deg,var(--bg-hover) 25%,var(--bg-elevated-2) 37%,var(--bg-hover) 63%);background-size:400% 100%;animation:skel 1.4s ease infinite;border-radius:8px;}
@keyframes skel{0%{background-position:100% 50%;}100%{background-position:0 50%;}}
.hidden{display:none !important;}


/* ===== Cloud Auth ===== */
#auth-gate{position:fixed;inset:0;z-index:500;background:var(--bg);display:flex;align-items:center;justify-content:center;padding:24px;}
.auth-card{width:420px;max-width:94vw;background:var(--bg-elevated);border:1px solid var(--border);border-radius:18px;padding:28px;box-shadow:var(--shadow);}
.auth-logo{display:flex;align-items:center;gap:10px;margin-bottom:22px;}
.auth-card h1{font-size:25px;margin-bottom:7px;}
.auth-card .auth-sub{font-size:13px;line-height:1.55;color:var(--text-faint);margin-bottom:20px;}
.auth-tabs{display:flex;gap:6px;margin-bottom:18px;background:var(--bg-elevated-2);padding:4px;border-radius:10px;}
.auth-tab{flex:1;border:0;background:transparent;color:var(--text-faint);padding:8px;border-radius:8px;font-weight:700;font-size:12px;}
.auth-tab.active{background:var(--bg-hover);color:var(--text);}
.auth-status{font-size:12px;line-height:1.5;margin-top:12px;color:var(--text-faint);min-height:18px;}
.auth-status.err{color:var(--red);}.auth-status.ok{color:var(--green);}
.cloud-status{display:inline-flex;align-items:center;gap:6px;font-size:10.5px;color:var(--green);}
.cloud-status::before{content:'';width:6px;height:6px;border-radius:50%;background:var(--green);}

/* Life OS 0.13.0 Calendar Core */
.cal-controlbar-v130{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin:0 0 12px}.cal-controlbar-v130>input{min-width:190px;flex:1;max-width:330px;background:var(--bg-elevated-2);border:1px solid var(--border);border-radius:9px;padding:8px 10px;color:var(--text)}.cal-layers-v130{display:flex;gap:5px;flex-wrap:wrap}.cal-actions-v130{display:flex;gap:7px;align-items:center}.cal-item-v130{font-size:10.5px;line-height:1.25;padding:3px 5px;border-radius:5px;margin:2px 0;background:var(--bg-hover);border-left:2px solid var(--accent);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer}.cal-item-v130.kind-task{border-left-color:var(--orange)}.cal-item-v130.kind-project{border-left-color:var(--purple)}.cal-item-v130.kind-goal{border-left-color:var(--green)}.cal-item-v130.kind-travel{border-left-color:var(--blue)}.cal-item-v130.kind-finance{border-left-color:var(--red)}.cal-kind-dot-v130{display:none}.cal-out-v130{opacity:.42}.cal-month-v130 .cal-cell{min-height:115px;padding:7px}.cal-week-v130{display:grid;border:1px solid var(--border-soft);border-radius:12px;overflow:auto;max-height:72vh;background:var(--border-soft);gap:1px}.cal-week-head-v130,.cal-hour-v130,.cal-slot-v130{background:var(--bg-elevated);padding:6px}.cal-week-head-v130{text-align:center;font-size:11px;font-weight:700;position:sticky;top:0;z-index:2}.cal-week-head-v130.today{color:var(--accent-text)}.cal-hour-v130{font-size:10px;color:var(--text-faint);text-align:right}.cal-slot-v130{min-height:52px}.cal-slot-v130:hover{background:var(--bg-hover)}.cal-agenda-v130{padding:4px 14px}.agenda-day-v130{display:grid;grid-template-columns:130px 1fr;border-bottom:1px solid var(--border-soft);padding:10px 0}.agenda-date-v130{font-size:11.5px;color:var(--text-dim);padding:8px}.cal-year-v130{display:grid;grid-template-columns:repeat(3,minmax(220px,1fr));gap:12px}.mini-month-v130 .card-title{cursor:pointer;text-transform:capitalize}.mini-grid-v130{display:grid;grid-template-columns:repeat(7,1fr);gap:3px}.mini-grid-v130 b,.mini-grid-v130 span{font-size:10px;text-align:center;padding:5px 2px;border-radius:5px;position:relative}.mini-grid-v130 span{cursor:pointer}.mini-grid-v130 span:hover,.mini-grid-v130 span.has-items{background:var(--bg-hover)}.mini-grid-v130 span.today{outline:1px solid var(--accent)}.mini-grid-v130 span i{position:absolute;right:1px;top:0;font-size:7px;font-style:normal;color:var(--accent-text)}.cal-google-ready-v130{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:14px}@media(max-width:900px){.cal-year-v130{grid-template-columns:1fr 1fr}.cal-month-v130 .cal-cell{min-height:90px}.cal-controlbar-v130{align-items:stretch}.agenda-day-v130{grid-template-columns:1fr}.cal-week-v130{max-height:68vh}}@media(max-width:600px){.cal-year-v130{grid-template-columns:1fr}.cal-month-v130{min-width:720px}.cal-month-v130{overflow:visible}.calendar-grid.cal-month-v130{display:grid}.fade-in{overflow-x:visible}.cal-head-v130{align-items:flex-start}.cal-actions-v130{flex-wrap:wrap}.cal-controlbar-v130 .tab-row{overflow-x:auto;max-width:100%}.cal-layers-v130{overflow-x:auto;flex-wrap:nowrap;max-width:100%;padding-bottom:3px}.cal-week-v130{min-width:620px}.agenda-day-v130{padding:6px 0}}



/* ===== Life OS 0.15.1 · Mobile Foundation ===== */
:root{--mobile-tab-h:72px;--mobile-top-h:56px;}
body.lifeos-mobile{overscroll-behavior-y:none;}
body.lifeos-mobile #app{min-height:100dvh;}
body.lifeos-mobile #sidebar{width:min(88vw,340px);height:100dvh;padding:16px 14px calc(22px + env(safe-area-inset-bottom));box-shadow:18px 0 45px rgba(0,0,0,.35);transition:transform .22s ease;}
body.lifeos-mobile #sidebar.open{transform:translateX(0);}
body.lifeos-mobile .mobile-drawer-backdrop-v150{display:block;position:fixed;inset:0;background:rgba(0,0,0,.46);z-index:75;opacity:0;pointer-events:none;transition:opacity .2s ease;}
body.lifeos-mobile .mobile-drawer-backdrop-v150.open{opacity:1;pointer-events:auto;}
body.lifeos-mobile #topbar{height:calc(var(--mobile-top-h) + env(safe-area-inset-top));padding:env(safe-area-inset-top) 12px 0;gap:8px;position:sticky;top:0;z-index:60;background:color-mix(in srgb,var(--bg-elevated) 94%,transparent);backdrop-filter:blur(14px);}
body.lifeos-mobile #topbar .crumbs{flex:1;min-width:0;font-size:13px;}
body.lifeos-mobile #topbar .crumbs b{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;}
body.lifeos-mobile #topbar .search-trigger{display:none;}
body.lifeos-mobile #topbar .mobile-only-v150{display:inline-flex!important;}
body.lifeos-mobile #topbar .desktop-quick-v150{display:none!important;}
body.lifeos-mobile #hamburger{display:inline-flex!important;}
body.lifeos-mobile #content{padding:16px 12px calc(var(--mobile-tab-h) + 24px + env(safe-area-inset-bottom));overflow-x:hidden;-webkit-overflow-scrolling:touch;}
body.lifeos-mobile .fade-in{min-width:0;max-width:100%;}
body.lifeos-mobile .page-head{align-items:flex-start;margin-bottom:15px;gap:9px;}
body.lifeos-mobile .page-head>div:first-child{min-width:0;flex:1 1 180px;}
body.lifeos-mobile .page-title{font-size:23px;line-height:1.12;}
body.lifeos-mobile .page-sub{font-size:11.5px;line-height:1.45;}
body.lifeos-mobile .briefing{padding:20px 18px;border-radius:16px;margin-bottom:12px;}
body.lifeos-mobile .greeting{font-size:23px;}
body.lifeos-mobile .briefing-text{font-size:12.5px;line-height:1.55;}
body.lifeos-mobile .grid,body.lifeos-mobile .grid-2,body.lifeos-mobile .grid-3{grid-template-columns:minmax(0,1fr)!important;gap:10px!important;}
body.lifeos-mobile .card{border-radius:13px;padding:14px;min-width:0;}
body.lifeos-mobile .card-title{font-size:11px;margin-bottom:10px;}
body.lifeos-mobile .stat-val{font-size:25px;}
body.lifeos-mobile .list-row{min-height:48px;padding:10px 4px;gap:9px;}
body.lifeos-mobile .meta{font-size:10.5px;max-width:42%;text-align:right;}
body.lifeos-mobile .btn{min-height:40px;touch-action:manipulation;}
body.lifeos-mobile .btn-sm{min-height:38px;padding:7px 10px;}
body.lifeos-mobile .icon-btn{width:42px;height:42px;flex:0 0 42px;}
body.lifeos-mobile input,body.lifeos-mobile select,body.lifeos-mobile textarea{font-size:16px!important;min-height:44px;max-width:100%;}
body.lifeos-mobile textarea{min-height:96px;}
body.lifeos-mobile .field{margin-bottom:13px;min-width:0;}
body.lifeos-mobile .field label{font-size:11.5px;}
body.lifeos-mobile .modal-bg{align-items:flex-end;padding:0;}
body.lifeos-mobile .modal{width:100%;max-width:none;max-height:min(92dvh,900px);border-radius:20px 20px 0 0;border-left:0;border-right:0;border-bottom:0;padding:18px 14px calc(20px + env(safe-area-inset-bottom));box-shadow:0 -18px 48px rgba(0,0,0,.35);}
body.lifeos-mobile .modal-head{position:sticky;top:-18px;z-index:5;background:var(--bg-elevated);padding:14px 0 10px;margin-bottom:10px;border-bottom:1px solid var(--border-soft);}
body.lifeos-mobile .modal-head:before{content:'';position:absolute;width:44px;height:4px;border-radius:5px;background:var(--border);top:5px;left:50%;transform:translateX(-50%);}
body.lifeos-mobile .modal .grid,body.lifeos-mobile .modal .grid-2,body.lifeos-mobile .modal .grid-3{grid-template-columns:minmax(0,1fr)!important;}
body.lifeos-mobile .tab-row{overflow-x:auto;flex-wrap:nowrap!important;scrollbar-width:none;-webkit-overflow-scrolling:touch;padding-bottom:2px;}
body.lifeos-mobile .tab-row::-webkit-scrollbar,body.lifeos-mobile .cal-layers-v130::-webkit-scrollbar{display:none;}
body.lifeos-mobile .tab{flex:0 0 auto;white-space:nowrap;margin-right:14px;min-height:38px;display:flex;align-items:center;}
body.lifeos-mobile .chip-row{flex-wrap:nowrap;overflow-x:auto;padding-bottom:4px;scrollbar-width:none;}
body.lifeos-mobile .kanban{display:flex!important;overflow-x:auto;scroll-snap-type:x mandatory;gap:10px;padding-bottom:8px;}
body.lifeos-mobile .kanban-col{flex:0 0 min(84vw,330px);scroll-snap-align:start;min-height:170px;}
body.lifeos-mobile .kanban-card{padding:12px;font-size:13px;min-height:50px;}
body.lifeos-mobile table{min-width:680px;}
body.lifeos-mobile .table-wrap,body.lifeos-mobile .card:has(>table){overflow-x:auto;-webkit-overflow-scrolling:touch;}
body.lifeos-mobile .balance-bar .lbl{width:86px;}
body.lifeos-mobile .detail-header{align-items:flex-start;gap:10px;flex-wrap:wrap;}
body.lifeos-mobile .detail-header>div:nth-child(2){min-width:0;flex:1;}
body.lifeos-mobile .palette{width:calc(100vw - 20px)!important;max-width:none!important;top:calc(env(safe-area-inset-top) + 8px)!important;}
body.lifeos-mobile #ai-panel{width:100vw;max-width:none;padding-bottom:env(safe-area-inset-bottom);}
body.lifeos-mobile .mobile-tabbar{height:calc(var(--mobile-tab-h) + env(safe-area-inset-bottom));padding:6px 7px env(safe-area-inset-bottom);display:grid!important;grid-template-columns:1fr 1fr 1.05fr 1fr 1fr;position:fixed;bottom:0;left:0;right:0;background:color-mix(in srgb,var(--bg-elevated) 96%,transparent);backdrop-filter:blur(16px);border-top:1px solid var(--border-soft);z-index:70;align-items:start;}
body.lifeos-mobile .mobile-nav-btn-v150{appearance:none;border:0;background:transparent;color:var(--text-faint);font:inherit;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-width:0;height:56px;font-size:9.5px;border-radius:10px;padding:3px;touch-action:manipulation;}
body.lifeos-mobile .mobile-nav-btn-v150 svg{width:20px;height:20px;}
body.lifeos-mobile .mobile-nav-btn-v150.active{color:var(--accent-text);background:var(--accent-soft);}
body.lifeos-mobile .mobile-nav-btn-v150.add{width:52px;height:52px;justify-self:center;margin-top:-13px;border-radius:50%;background:var(--accent);color:#111;box-shadow:0 7px 24px rgba(0,0,0,.3);}
body.lifeos-mobile .mobile-nav-btn-v150.add svg{width:23px;height:23px;}
body:not(.lifeos-mobile) .mobile-drawer-backdrop-v150{display:none;}

/* Mobile Calendar */
body.lifeos-mobile .cal-head-v130{display:grid;grid-template-columns:1fr;}
body.lifeos-mobile .cal-actions-v130{display:grid;grid-template-columns:42px 1fr 42px 1.2fr;width:100%;gap:6px;}
body.lifeos-mobile .cal-actions-v130 .btn{min-width:0;padding:7px 6px;}
body.lifeos-mobile .cal-controlbar-v130{display:flex;flex-direction:column;align-items:stretch;gap:8px;}
body.lifeos-mobile .cal-controlbar-v130>input{order:1;width:100%;max-width:none;min-width:0;}
body.lifeos-mobile .cal-controlbar-v130>.tab-row{order:0;margin:0;width:100%;}
body.lifeos-mobile .cal-layers-v130{order:2;display:flex;flex-wrap:nowrap;overflow-x:auto;max-width:100%;padding-bottom:3px;}
body.lifeos-mobile .cal-layers-v130 .btn{flex:0 0 auto;}
body.lifeos-mobile .cal-agenda-v130{padding:0;}
body.lifeos-mobile .agenda-day-v130{grid-template-columns:1fr;padding:8px 0;}
body.lifeos-mobile .agenda-date-v130{padding:6px 2px;font-weight:700;}
body.lifeos-mobile .cal-year-v130{grid-template-columns:1fr!important;}
body.lifeos-mobile .cal-month-weeks-v149,body.lifeos-mobile .cal-month-dows-v149{min-width:650px;}
body.lifeos-mobile .cal-month-v150-scroll{overflow-x:auto;-webkit-overflow-scrolling:touch;margin:0 -12px;padding:0 12px;}
body.lifeos-mobile .cal-week-shell-v149{max-height:66dvh;border-radius:10px;}
body.lifeos-mobile .cal-day-track-v149{min-width:150px;}
body.lifeos-mobile .cal-timed-event-v149{font-size:10px;}
body.lifeos-mobile .mini-month-v130{min-width:0;}

/* Finance/Documents/mobile dense areas */
body.lifeos-mobile .finance-summary-v120,body.lifeos-mobile .finance-projection-v110{min-width:0;}
body.lifeos-mobile .finance-filter-row,body.lifeos-mobile .filter-row{display:flex;flex-direction:column;align-items:stretch;}
body.lifeos-mobile .doc-row-v15{align-items:flex-start;}
body.lifeos-mobile .doc-row-v15 .meta{max-width:100%;text-align:left;}

@media (max-width:390px){
 body.lifeos-mobile #content{padding-left:10px;padding-right:10px;}
 body.lifeos-mobile .page-title{font-size:21px;}
 body.lifeos-mobile .mobile-nav-btn-v150{font-size:9px;}
 body.lifeos-mobile .card{padding:12px;}
 body.lifeos-mobile .cal-actions-v130{grid-template-columns:38px 1fr 38px 1fr;}
}


/* 0.15.1 mobile hardening */
body.lifeos-mobile .overlay{align-items:flex-end;padding:0;}
body.lifeos-mobile .qa-panel{width:100%;max-width:none;border-radius:20px 20px 0 0;border-left:0;border-right:0;border-bottom:0;padding:18px 14px calc(18px + env(safe-area-inset-bottom));max-height:88dvh;overflow-y:auto;}
body.lifeos-mobile .qa-panel textarea{font-size:16px;min-height:88px;}
body.lifeos-mobile .qa-hints{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;padding-bottom:3px;}
body.lifeos-mobile .qa-hint{flex:0 0 auto;max-width:82vw;white-space:normal;}
body.lifeos-mobile #auth-gate{padding:calc(14px + env(safe-area-inset-top)) 12px calc(14px + env(safe-area-inset-bottom));align-items:flex-start;overflow-y:auto;}
body.lifeos-mobile .auth-card{width:100%;max-width:480px;padding:22px 16px;border-radius:16px;margin:auto 0;}
body.lifeos-mobile .auth-card h1{font-size:23px;}
body.lifeos-mobile .mobile-table-scroll-v150{overflow-x:auto;-webkit-overflow-scrolling:touch;width:100%;border-radius:10px;}
body.lifeos-mobile .mobile-table-scroll-v150>table{margin:0;}
body.lifeos-mobile img,body.lifeos-mobile video,body.lifeos-mobile canvas,body.lifeos-mobile svg{max-width:100%;}
body.lifeos-mobile .sidebar-scroll-v105{overflow-y:auto;overscroll-behavior:contain;}
body.lifeos-mobile .nav-item{min-height:44px;padding:10px 11px;}
body.lifeos-mobile .nav-sub .nav-item{min-height:40px;}
body.lifeos-mobile .profile-row{padding:10px 5px;}
body.lifeos-mobile .universal-filter-v10,body.lifeos-mobile .task-filter-v14{overflow-x:auto;}
body.lifeos-mobile .universal-filter-v10>* ,body.lifeos-mobile .task-filter-v14>*{min-width:0;}



/* ===== Life OS 0.15.1 · Mobile complete pass ===== */
body.lifeos-mobile{--mobile-edge:12px;--mobile-card-gap:10px;}
body.lifeos-mobile[data-mobile-page] #content{scroll-padding-bottom:calc(var(--mobile-tab-h) + 28px + env(safe-area-inset-bottom));}
body.lifeos-mobile .page-head{display:flex;flex-wrap:wrap;}
body.lifeos-mobile .page-head>button,
body.lifeos-mobile .page-head>.btn,
body.lifeos-mobile .page-head>.mobile-page-actions-v151{flex:0 0 auto;}
body.lifeos-mobile .page-head>.mobile-page-actions-v151{display:flex!important;gap:6px!important;flex-wrap:wrap!important;justify-content:flex-end;max-width:100%;}
body.lifeos-mobile .page-head>.mobile-page-actions-v151 .btn{flex:1 1 auto;white-space:nowrap;}
body.lifeos-mobile .mobile-toolbar-v151{display:flex!important;gap:7px!important;flex-wrap:nowrap!important;overflow-x:auto;scrollbar-width:none;-webkit-overflow-scrolling:touch;padding-bottom:3px;max-width:100%;}
body.lifeos-mobile .mobile-toolbar-v151::-webkit-scrollbar{display:none;}
body.lifeos-mobile .mobile-toolbar-v151>*{flex:0 0 auto!important;}
body.lifeos-mobile .mobile-filter-card-v151{padding:10px!important;}
body.lifeos-mobile .mobile-filter-card-v151>div{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:8px!important;align-items:stretch!important;}
body.lifeos-mobile .mobile-filter-card-v151 .field{min-width:0!important;width:100%!important;margin:0!important;}
body.lifeos-mobile .mobile-filter-card-v151 .btn{width:100%;}
body.lifeos-mobile .mobile-list-card-v151 .list-row{align-items:flex-start;flex-wrap:wrap;}
body.lifeos-mobile .mobile-list-card-v151 .list-row>div[style*="flex:1"],
body.lifeos-mobile .mobile-list-card-v151 .list-row>div:nth-child(2){min-width:0;}
body.lifeos-mobile .mobile-list-card-v151 .list-row>.meta{margin-left:auto;max-width:100%;text-align:right;white-space:normal;}
body.lifeos-mobile .mobile-table-scroll-v151{overflow-x:auto;-webkit-overflow-scrolling:touch;width:100%;}
body.lifeos-mobile table.mobile-card-table-v151{min-width:0!important;width:100%!important;border-collapse:separate;border-spacing:0 8px;}
body.lifeos-mobile table.mobile-card-table-v151 thead{display:none;}
body.lifeos-mobile table.mobile-card-table-v151 tbody,body.lifeos-mobile table.mobile-card-table-v151 tr,body.lifeos-mobile table.mobile-card-table-v151 td{display:block;width:100%;}
body.lifeos-mobile table.mobile-card-table-v151 tr{border:1px solid var(--border-soft);border-radius:12px;background:var(--bg-elevated);padding:8px 10px;overflow:hidden;}
body.lifeos-mobile table.mobile-card-table-v151 td{display:grid;grid-template-columns:minmax(90px,36%) minmax(0,1fr);gap:10px;align-items:start;border:0!important;padding:6px 0!important;min-height:0;word-break:break-word;}
body.lifeos-mobile table.mobile-card-table-v151 td::before{content:attr(data-mobile-label);font-size:10.5px;color:var(--text-faint);font-weight:650;text-transform:none;}
body.lifeos-mobile table.mobile-card-table-v151 td[data-mobile-label=""]::before{display:none;}
body.lifeos-mobile table.mobile-card-table-v151 td[data-mobile-label=""]{display:block;text-align:right;}
body.lifeos-mobile table.mobile-card-table-v151 .btn{min-height:36px;}

/* Home */
body.lifeos-mobile[data-mobile-page="home"] .briefing{padding:18px 15px;}
body.lifeos-mobile[data-mobile-page="home"] .day-bar{height:5px;}
body.lifeos-mobile[data-mobile-page="home"] .grid.grid-3{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:7px!important;}
body.lifeos-mobile[data-mobile-page="home"] .grid.grid-3 .card{padding:11px 8px;text-align:center;}
body.lifeos-mobile[data-mobile-page="home"] .grid.grid-3 .stat-val{font-size:20px;line-height:1.05;}
body.lifeos-mobile[data-mobile-page="home"] .grid.grid-3 .stat-label{font-size:9px;line-height:1.25;}
body.lifeos-mobile[data-mobile-page="home"] .grid.grid-2{display:grid!important;grid-template-columns:minmax(0,1fr)!important;}
body.lifeos-mobile[data-mobile-page="home"] .attn-row{padding:9px 0;}
body.lifeos-mobile[data-mobile-page="home"] .list-row{min-height:44px;}

/* Tasks / Projects / Goals */
body.lifeos-mobile[data-mobile-page="tasks"] .page-head{align-items:stretch;}
body.lifeos-mobile[data-mobile-page="tasks"] .page-head>div:last-child{width:100%;display:grid!important;grid-template-columns:1fr 1fr 1.15fr;gap:6px!important;}
body.lifeos-mobile[data-mobile-page="tasks"] .page-head>div:last-child .btn{padding-inline:7px;}
body.lifeos-mobile[data-mobile-page="tasks"] .kanban-col{flex-basis:min(88vw,350px);}
body.lifeos-mobile[data-mobile-page="tasks"] .task-row,body.lifeos-mobile[data-mobile-page="tasks"] .list-row{align-items:flex-start;}
body.lifeos-mobile[data-mobile-page="projects"] .grid.grid-3{grid-template-columns:minmax(0,1fr)!important;}
body.lifeos-mobile[data-mobile-page="project"] .card-title .btn{float:none!important;margin-top:8px;width:100%;}
body.lifeos-mobile[data-mobile-page="project"] .list-row{align-items:flex-start;}
body.lifeos-mobile[data-mobile-page="goals"] .card>div[style*="padding:10px"]{padding:11px 0!important;}
body.lifeos-mobile[data-mobile-page="goals"] .chip-row{margin-top:7px!important;}

/* People / Categories */
body.lifeos-mobile[data-mobile-page="people"] .grid,
body.lifeos-mobile[data-mobile-page="categories"] .grid{grid-template-columns:minmax(0,1fr)!important;}
body.lifeos-mobile[data-mobile-page="people"] .list-row,
body.lifeos-mobile[data-mobile-page="categories"] .list-row{align-items:flex-start;}
body.lifeos-mobile[data-mobile-page="person"] .detail-header{display:grid!important;grid-template-columns:auto minmax(0,1fr);}
body.lifeos-mobile[data-mobile-page="person"] .detail-header>.btn,body.lifeos-mobile[data-mobile-page="person"] .detail-header>button{grid-column:1/-1;width:100%;}

/* Documents */
body.lifeos-mobile[data-mobile-page="documents"] .page-head>.btn{width:100%;}
body.lifeos-mobile[data-mobile-page="documents"] .card[style*="padding:10px 12px"]>div{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:8px!important;}
body.lifeos-mobile[data-mobile-page="documents"] .card[style*="padding:10px 12px"] .field{min-width:0!important;width:100%;}
body.lifeos-mobile[data-mobile-page="documents"] .list-row{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;}
body.lifeos-mobile[data-mobile-page="documents"] .list-row .meta{max-width:none;font-size:9.5px;}

/* Finance and all module tabs */
body.lifeos-mobile[data-mobile-page="finance-hub"] .page-head{align-items:stretch;}
body.lifeos-mobile[data-mobile-page="finance-hub"] .page-head>div:last-child:not(:first-child){display:flex!important;flex-wrap:wrap!important;gap:6px!important;width:100%;}
body.lifeos-mobile[data-mobile-page="finance-hub"] .page-head>div:last-child:not(:first-child) .btn{flex:1 1 130px;}
body.lifeos-mobile[data-mobile-page="finance-hub"] .tab-row{margin-inline:-2px;padding-inline:2px;}
body.lifeos-mobile[data-mobile-page="finance-hub"] .grid.grid-3{grid-template-columns:minmax(0,1fr)!important;}
body.lifeos-mobile[data-mobile-page="finance-hub"] .balance-bar{display:grid!important;grid-template-columns:78px minmax(0,1fr) auto;gap:8px;align-items:center;}
body.lifeos-mobile[data-mobile-page="finance-hub"] .balance-bar .lbl{width:auto!important;}
body.lifeos-mobile[data-mobile-page="finance-hub"] .card>div[style*="display:flex"][style*="align-items:end"]{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:8px!important;align-items:stretch!important;}
body.lifeos-mobile[data-mobile-page="finance-hub"] .card>div[style*="display:flex"][style*="align-items:end"] .field{min-width:0!important;width:100%!important;}
body.lifeos-mobile[data-mobile-page="finance-hub"] .list-row{align-items:flex-start;}
body.lifeos-mobile[data-mobile-page="finance-hub"] .list-row>.meta{max-width:38%;}
body.lifeos-mobile[data-mobile-sub="investments"] .grid,
body.lifeos-mobile[data-mobile-sub="travel"] .grid,
body.lifeos-mobile[data-mobile-sub="contracts"] .grid,
body.lifeos-mobile[data-mobile-sub="inventory"] .grid,
body.lifeos-mobile[data-mobile-sub="knowledge"] .grid,
body.lifeos-mobile[data-mobile-sub="habits"] .grid,
body.lifeos-mobile[data-mobile-sub="memories"] .grid{grid-template-columns:minmax(0,1fr)!important;}

/* Calendar mobile product */
body.lifeos-mobile[data-mobile-page="calendar"] .page-head{margin-bottom:10px;}
body.lifeos-mobile[data-mobile-page="calendar"] .cal-head-v130{gap:8px;}
body.lifeos-mobile[data-mobile-page="calendar"] .cal-actions-v130{grid-template-columns:42px minmax(0,1fr) 42px minmax(92px,1fr);}
body.lifeos-mobile[data-mobile-page="calendar"] .cal-controlbar-v130{gap:7px;}
body.lifeos-mobile[data-mobile-page="calendar"] .cal-layers-v130{margin-inline:-12px;padding-inline:12px;}
body.lifeos-mobile[data-mobile-page="calendar"] .cal-agenda-v130 .cal-item-v130{min-height:40px;padding:8px 9px;}
body.lifeos-mobile[data-mobile-page="calendar"] .cal-week-shell-v149{max-height:68dvh;margin-inline:-12px;border-radius:0;border-left:0;border-right:0;}
body.lifeos-mobile[data-mobile-page="calendar"] .cal-day-track-v149{min-width:168px;}
body.lifeos-mobile[data-mobile-page="calendar"] .cal-month-v150-scroll{padding-bottom:4px;}
body.lifeos-mobile[data-mobile-page="calendar"] .cal-month-week-v149 .cal-cell{min-height:110px;padding:5px;}
body.lifeos-mobile[data-mobile-page="calendar"] .cal-month-range-v149{font-size:9.5px;height:19px;}
body.lifeos-mobile[data-mobile-page="calendar"] .cal-timed-event-v149{border-radius:6px;padding:3px 5px;}

/* Notifications */
body.lifeos-mobile[data-mobile-page="notifications"] .page-head>.btn{width:100%;}
body.lifeos-mobile[data-mobile-page="notifications"] .notification-history-v144>.card{padding:11px;}
body.lifeos-mobile[data-mobile-page="notifications"] .attn-row{align-items:flex-start;}
body.lifeos-mobile[data-mobile-page="notifications"] .attn-row .btn{flex:0 0 auto;}

/* Settings */
body.lifeos-mobile[data-mobile-page="settings"] .grid.grid-2{grid-template-columns:minmax(0,1fr)!important;}
body.lifeos-mobile[data-mobile-page="settings"] .card{padding:14px;}
body.lifeos-mobile[data-mobile-page="settings"] .card>.btn{width:100%;margin:5px 0 0!important;}
body.lifeos-mobile[data-mobile-page="settings"] label[style*="display:flex"]{min-height:42px;align-items:center!important;}
body.lifeos-mobile[data-mobile-page="settings"] .attn-row{align-items:flex-start;}

/* Quick Add / AI / overlays */
body.lifeos-mobile #quick-add-modal .modal,body.lifeos-mobile .quick-add-modal .modal{max-height:88dvh;}
body.lifeos-mobile #ai-panel{top:0!important;height:100dvh!important;border-radius:0!important;}
body.lifeos-mobile #ai-panel .ai-messages{padding-bottom:calc(96px + env(safe-area-inset-bottom));}
body.lifeos-mobile #ai-panel .ai-input-wrap{padding-bottom:calc(10px + env(safe-area-inset-bottom));}
body.lifeos-mobile .palette .palette-list{max-height:60dvh;}

/* Tiny screens */
@media(max-width:360px){
 body.lifeos-mobile{--mobile-edge:9px;}
 body.lifeos-mobile #content{padding-left:9px;padding-right:9px;}
 body.lifeos-mobile[data-mobile-page="home"] .grid.grid-3{grid-template-columns:1fr!important;}
 body.lifeos-mobile[data-mobile-page="home"] .grid.grid-3 .card{text-align:left;}
 body.lifeos-mobile[data-mobile-page="tasks"] .page-head>div:last-child{grid-template-columns:1fr 1fr;}
 body.lifeos-mobile[data-mobile-page="tasks"] .page-head>div:last-child .btn:last-child{grid-column:1/-1;}
 body.lifeos-mobile[data-mobile-page="calendar"] .cal-actions-v130{grid-template-columns:38px 1fr 38px;}
 body.lifeos-mobile[data-mobile-page="calendar"] .cal-actions-v130 .btn:last-child{grid-column:1/-1;}
}
@media(orientation:landscape) and (max-height:520px) and (pointer:coarse){
 body.lifeos-mobile #topbar{position:relative;}
 body.lifeos-mobile .modal{max-height:96dvh;}
 body.lifeos-mobile[data-mobile-page="calendar"] .cal-week-shell-v149{max-height:76dvh;}
}

