:root{
  --navy:#0e2a4d;
  --navy2:#163d6e;
  --red:#b91c1c;
  --red-soft:#fef2f2;
  --gold:#b45309;
  --gold-soft:#fffbeb;
  --green:#047857;
  --green-soft:#ecfdf5;
  --blue:#1d4ed8;
  --blue-soft:#eff6ff;
  --bg:#f1f5f9;
  --card:#ffffff;
  --border:#dbe3ee;
  --text:#0f172a;
  --muted:#475569;
  --radius:14px;
  --shadow:0 4px 16px rgba(14,42,77,.07);
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{
  margin:0;padding:0;
  font-family:"Segoe UI",-apple-system,BlinkMacSystemFont,Roboto,Arial,sans-serif;
  background:var(--bg);color:var(--text);
  font-size:14px;line-height:1.5;
  overflow-x:hidden;
  width:100%;
}
a{color:var(--blue);text-decoration:none}
a:hover{text-decoration:underline}
img,video{max-width:100%}

/* =========================================================
   TOP HEADER
   ========================================================= */
.topbar{
  background:linear-gradient(135deg,#0b223f 0%,#153b6b 65%,#1c4d89 100%);
  color:#fff;padding:12px 16px;
  box-shadow:0 4px 18px rgba(11,34,63,.22);
  position:relative;z-index:25;
}
.topbar-inner{
  max-width:1380px;margin:0 auto;
  display:flex;align-items:center;justify-content:space-between;
  gap:12px;flex-wrap:wrap;
}
.brand{display:flex;align-items:center;gap:11px;min-width:0;flex:1 1 320px}
.brand img{height:42px;width:auto;background:#fff;padding:4px 7px;border-radius:10px;box-shadow:0 2px 8px rgba(0,0,0,.15);flex-shrink:0}
.brand-text{min-width:0}
.brand h1{margin:0;font-size:16.5px;font-weight:800;letter-spacing:.15px;line-height:1.25}
.brand .sub{font-size:12px;color:#cbd5e1;margin-top:2px;line-height:1.35}
.top-controls{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.who-box{display:flex;align-items:center;gap:6px;background:rgba(255,255,255,.13);padding:4px 9px;border-radius:10px;border:1px solid rgba(255,255,255,.22)}
.who-box label{font-size:12px;color:#e2e8f0;font-weight:700;white-space:nowrap}
.who-box select{background:#fff;color:var(--navy);border:none;border-radius:7px;padding:5px 8px;font-weight:700;font-size:12.5px;cursor:pointer;max-width:210px}
.sync-pill{font-size:11.5px;background:rgba(16,185,129,.22);border:1px solid rgba(52,211,153,.45);color:#d1fae5;padding:5px 10px;border-radius:999px;font-weight:700;white-space:nowrap}
.btn-quick-top{background:rgba(255,255,255,.16);color:#fff;border:1px solid rgba(255,255,255,.32);padding:7px 11px;border-radius:9px;font-size:12.5px;font-weight:700;cursor:pointer;white-space:nowrap;transition:.15s}
.btn-quick-top:hover{background:rgba(255,255,255,.26)}
.btn-quick-top.gold{background:#d97706;border-color:#f59e0b}
.btn-quick-top.gold:hover{background:#b45309}

/* =========================================================
   STICKY TOP NAVIGATION (DESKTOP + HORIZONTAL PILLS)
   ========================================================= */
.nav-wrap{
  background:#fff;border-bottom:1px solid var(--border);
  position:sticky;top:0;z-index:30;
  box-shadow:0 2px 8px rgba(15,23,42,.05);
}
.nav{
  max-width:1380px;margin:0 auto;
  display:flex;gap:6px;padding:8px 12px;
  overflow-x:auto;-webkit-overflow-scrolling:touch;
  scrollbar-width:none;scroll-snap-type:x proximity;
}
.nav::-webkit-scrollbar{display:none}
.nav button{
  border:1px solid #e2e8f0;background:#f8fafc;color:var(--muted);
  padding:8px 12px;border-radius:10px;font-weight:700;font-size:12.5px;
  cursor:pointer;white-space:nowrap;transition:.16s;
  display:inline-flex;align-items:center;gap:6px;flex-shrink:0;
  scroll-snap-align:start;
}
.nav button:hover{background:#edf2f7;color:var(--navy)}
.nav button.active{background:var(--navy);border-color:var(--navy);color:#fff;box-shadow:0 3px 10px rgba(14,42,77,.22)}
.nav .badge-cnt{background:rgba(255,255,255,.22);padding:1px 6px;border-radius:999px;font-size:11px}
.nav button:not(.active) .badge-cnt{background:#e2e8f0;color:var(--navy)}

/* =========================================================
   MAIN CONTAINER & CARDS
   ========================================================= */
.container{max-width:1380px;margin:14px auto 44px;padding:0 14px}
.tab-panel{display:none;animation:fadeIn .18s ease}
.tab-panel.active{display:block}
@keyframes fadeIn{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}

.card{
  background:var(--card);border:1px solid var(--border);
  border-radius:var(--radius);padding:16px 18px;
  box-shadow:var(--shadow);margin-bottom:14px;
}
.card-title{
  margin:0 0 12px;font-size:15.5px;font-weight:800;color:var(--navy);
  display:flex;align-items:center;justify-content:space-between;
  gap:10px;flex-wrap:wrap;line-height:1.35;
}
.grid{display:grid;gap:12px}
.g2{grid-template-columns:repeat(2,minmax(0,1fr))}
.g3{grid-template-columns:repeat(3,minmax(0,1fr))}
.g4{grid-template-columns:repeat(4,minmax(0,1fr))}
.g5{grid-template-columns:repeat(5,minmax(0,1fr))}

/* =========================================================
   KPI BENTO CARDS
   ========================================================= */
.kpi{
  background:#fff;border:1px solid var(--border);border-radius:13px;
  padding:13px 14px;box-shadow:var(--shadow);
  position:relative;overflow:hidden;min-width:0;
}
.kpi::before{content:"";position:absolute;left:0;top:0;bottom:0;width:4px;background:var(--navy)}
.kpi.green::before{background:var(--green)}
.kpi.red::before{background:var(--red)}
.kpi.gold::before{background:var(--gold)}
.kpi.blue::before{background:var(--blue)}
.kpi .lbl{font-size:11px;font-weight:800;color:var(--muted);text-transform:uppercase;letter-spacing:.25px;line-height:1.3}
.kpi .val{font-size:20px;font-weight:800;color:var(--navy);margin:4px 0 2px;line-height:1.2;word-break:break-word}
.kpi .sub{font-size:11.5px;color:var(--muted);line-height:1.35}
.prog-bar{height:7px;background:#e2e8f0;border-radius:999px;overflow:hidden;margin-top:8px}
.prog-fill{height:100%;background:linear-gradient(90deg,#059669,#10b981);border-radius:999px;transition:width .3s}

/* =========================================================
   ALERTS, BUTTONS & FORM CONTROLS
   ========================================================= */
.alert{padding:12px 14px;border-radius:11px;margin-bottom:13px;border:1px solid transparent;font-size:13.2px;line-height:1.5}
.alert.warn{background:var(--gold-soft);border-color:#fcd34d;color:#78350f}
.alert.danger{background:var(--red-soft);border-color:#fca5a5;color:#7f1d1d}
.alert.info{background:var(--blue-soft);border-color:#93c5fd;color:#1e3a8a}
.alert.success{background:var(--green-soft);border-color:#6ee7b7;color:#065f46}

.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:6px;
  padding:9px 13px;border-radius:9px;border:1px solid var(--border);
  background:#fff;color:var(--navy);font-weight:700;font-size:13px;
  cursor:pointer;transition:.15s;text-decoration:none;min-height:36px;
}
.btn:hover{background:#f8fafc;text-decoration:none}
.btn-primary{background:var(--navy);border-color:var(--navy);color:#fff}
.btn-primary:hover{background:var(--navy2)}
.btn-green{background:var(--green);border-color:var(--green);color:#fff}
.btn-green:hover{background:#065f46}
.btn-red{background:var(--red);border-color:var(--red);color:#fff}
.btn-red:hover{background:#991b1b}
.btn-gold{background:var(--gold);border-color:var(--gold);color:#fff}
.btn-sm{padding:6px 10px;font-size:12px;border-radius:8px;min-height:32px}

input[type=text],input[type=number],input[type=date],input[type=time],select,textarea{
  width:100%;padding:9px 10px;border:1px solid #cbd5e1;border-radius:9px;
  font-family:inherit;font-size:14px;background:#fff;color:var(--text);
  min-height:38px;
}
textarea{min-height:70px;resize:vertical}
input:focus,select:focus,textarea:focus{outline:none;border-color:var(--navy);box-shadow:0 0 0 3px rgba(14,42,77,.12)}
.form-grid{display:grid;gap:10px;grid-template-columns:repeat(auto-fit,minmax(175px,1fr));align-items:end}
.field{min-width:0}
.field label{display:block;font-size:12px;font-weight:700;color:var(--muted);margin-bottom:4px}

/* =========================================================
   TABLES & SCROLL HINT
   ========================================================= */
.table-wrap{
  overflow-x:auto;-webkit-overflow-scrolling:touch;
  border:1px solid var(--border);border-radius:11px;background:#fff;
  position:relative;
}
.scroll-hint{display:none;font-size:11.5px;color:var(--blue);font-weight:700;margin:0 0 6px;align-items:center;gap:5px}
table{width:100%;border-collapse:collapse;font-size:13px;background:#fff}
th{background:#f1f5f9;color:var(--navy);font-weight:800;text-align:left;padding:9px 10px;border-bottom:2px solid var(--border);white-space:nowrap}
td{padding:9px 10px;border-bottom:1px solid #edf2f7;vertical-align:top;word-break:break-word}
tr:last-child td{border-bottom:none}
tr:hover td{background:#f8fafc}
.num{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}

/* =========================================================
   BADGES & PILLS
   ========================================================= */
.tag{display:inline-block;padding:2px 8px;border-radius:999px;font-size:11.5px;font-weight:700;white-space:nowrap;line-height:1.45}
.t-todo{background:#e2e8f0;color:#334155}
.t-doing{background:#dbeafe;color:#1d4ed8}
.t-review{background:#fef3c7;color:#92400e}
.t-done{background:#d1fae5;color:#065f46}
.t-red{background:#fee2e2;color:#991b1b}
.t-navy{background:#e0e7ff;color:#1e3a8a}

/* =========================================================
   ROLE SELECTOR & PLAYBOOK
   ========================================================= */
.role-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.role-btn{
  text-align:left;padding:12px 13px;border-radius:12px;
  border:2px solid var(--border);background:#fff;cursor:pointer;
  transition:.16s;display:flex;align-items:flex-start;gap:10px;width:100%;
}
.role-btn:hover{border-color:#94a3b8;background:#f8fafc}
.role-btn.active{border-color:var(--navy);background:#eff6ff;box-shadow:0 4px 12px rgba(14,42,77,.14)}
.role-ico{width:38px;height:38px;border-radius:10px;background:var(--navy);color:#fff;display:flex;align-items:center;justify-content:center;font-weight:800;font-size:13.5px;flex-shrink:0}
.role-btn.active .role-ico{background:var(--red)}
.role-name{font-weight:800;color:var(--navy);font-size:13.8px;line-height:1.3}
.role-sub{font-size:11.8px;color:var(--muted);margin-top:3px;line-height:1.35}

.playbook-head{background:linear-gradient(135deg,#0f294a,#1e4b85);color:#fff;padding:15px 17px;border-radius:12px;margin-bottom:13px}
.playbook-head h3{margin:0 0 4px;font-size:16px;line-height:1.35}
.playbook-head p{margin:0;font-size:13px;color:#dbeafe;line-height:1.45}
.step-list{margin:0;padding-left:18px}
.step-list li{margin-bottom:7px}

/* =========================================================
   TASK SUB-CHECKLIST DRAWER
   ========================================================= */
.task-guide-row td{background:#f8fafc!important;padding:10px 13px!important;border-bottom:2px solid var(--border)}
.guide-box{display:grid;grid-template-columns:1.45fr 1fr;gap:12px;align-items:start}
.subcheck-list{list-style:none;margin:6px 0 0;padding:0;display:flex;flex-direction:column;gap:6px}
.subcheck-list label{display:flex;align-items:flex-start;gap:9px;font-size:13px;cursor:pointer;background:#fff;padding:8px 10px;border-radius:9px;border:1px solid #e2e8f0;line-height:1.4}
.subcheck-list label.checked{background:#ecfdf5;border-color:#a7f3d0;color:#065f46;text-decoration:line-through}
.subcheck-list input{width:17px;height:17px;min-height:17px;margin-top:2px;flex-shrink:0}
.guide-meta{background:#fff;border:1px solid #e2e8f0;border-radius:10px;padding:11px 12px;font-size:12.8px}
.mini-pill{display:inline-flex;align-items:center;gap:4px;font-size:11.5px;font-weight:700;padding:4px 9px;border-radius:7px;background:#e0f2fe;color:#0369a1;cursor:pointer;border:none;min-height:28px}
.mini-pill:hover{background:#bae6fd}

/* =========================================================
   MEDIA VAULT, SCRIPTS & CHECKBOXES
   ========================================================= */
.dropzone{border:2px dashed #94a3b8;border-radius:14px;padding:22px 14px;text-align:center;background:#f8fafc;cursor:pointer;transition:.16s}
.dropzone:hover,.dropzone.drag{border-color:var(--navy);background:#eff6ff}
.folder-tabs{display:flex;gap:6px;flex-wrap:wrap;margin:12px 0}
.folder-tab{padding:7px 11px;border-radius:9px;border:1px solid var(--border);background:#fff;font-weight:700;font-size:12px;cursor:pointer;color:var(--navy)}
.folder-tab.active{background:var(--navy);color:#fff;border-color:var(--navy)}
.media-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:12px;margin-top:12px}
.media-card{border:1px solid var(--border);border-radius:12px;overflow:hidden;background:#fff;display:flex;flex-direction:column}
.media-thumb{height:165px;background:#0f172a;display:flex;align-items:center;justify-content:center;overflow:hidden;position:relative}
.media-thumb img{width:100%;height:100%;object-fit:cover;cursor:zoom-in}
.media-thumb video{width:100%;height:100%;object-fit:contain;background:#000}
.media-thumb .doc-badge{color:#fff;font-weight:800;font-size:17px;letter-spacing:.5px}
.media-meta{padding:10px 11px;font-size:12px;flex:1;display:flex;flex-direction:column;justify-content:space-between;gap:8px}
.media-name{font-weight:700;word-break:break-word;color:var(--navy);line-height:1.35}
.media-actions{display:flex;gap:6px;flex-wrap:wrap}

.script-box{border:1px solid var(--border);border-radius:11px;padding:13px;background:#fafcff;margin-bottom:10px}
.script-box pre{margin:8px 0 0;white-space:pre-wrap;word-break:break-word;font-family:inherit;font-size:13px;background:#fff;padding:10px;border-radius:8px;border:1px solid #e2e8f0;line-height:1.5}

.ref-img-card{border:1px solid var(--border);border-radius:12px;overflow:hidden;background:#fff}
.ref-img-card img{width:100%;height:220px;object-fit:cover;cursor:zoom-in;display:block}
.ref-img-card .cap{padding:10px 12px;font-size:12.5px;color:var(--muted)}

.nv-checks{display:flex;flex-wrap:wrap;gap:10px;padding:9px 11px;background:#f8fafc;border:1px solid var(--border);border-radius:9px}
.nv-checks label{display:flex;align-items:center;gap:6px;font-size:12.8px;font-weight:700;margin:0;cursor:pointer;color:var(--navy)}
.nv-checks input{width:17px;height:17px;min-height:17px}

/* =========================================================
   MODALS, LIGHTBOX, TOAST & MOBILE BOTTOM NAV
   ========================================================= */
.lightbox{position:fixed;inset:0;background:rgba(15,23,42,.9);z-index:130;display:none;align-items:center;justify-content:center;padding:16px}
.lightbox.open{display:flex}
.lightbox img{max-width:95vw;max-height:86vh;border-radius:10px;box-shadow:0 12px 40px rgba(0,0,0,.5)}
.lightbox .close-lb{position:absolute;top:14px;right:16px;background:#fff;color:#0f172a;border:none;border-radius:999px;width:42px;height:42px;font-size:22px;font-weight:800;cursor:pointer}

.modal-backdrop{position:fixed;inset:0;background:rgba(15,23,42,.62);z-index:120;display:none;align-items:center;justify-content:center;padding:14px}
.modal-backdrop.open{display:flex}
.modal-card{background:#fff;border-radius:16px;max-width:640px;width:100%;max-height:88vh;overflow:auto;padding:18px;box-shadow:0 20px 50px rgba(0,0,0,.35)}

.toast{position:fixed;bottom:20px;right:20px;background:#0f172a;color:#fff;padding:11px 16px;border-radius:11px;font-size:13px;font-weight:600;box-shadow:0 8px 24px rgba(0,0,0,.3);z-index:140;opacity:0;transform:translateY(10px);transition:.22s;pointer-events:none;max-width:92vw}
.toast.show{opacity:1;transform:none}

/* Native Mobile Bottom App Bar & Sheet (Hidden on Desktop) */
.mobile-bottom-nav{display:none}
.more-sheet-backdrop{position:fixed;inset:0;background:rgba(15,23,42,.55);z-index:115;display:none;align-items:flex-end;justify-content:center}
.more-sheet-backdrop.open{display:flex}
.more-sheet{background:#fff;width:100%;max-width:540px;border-radius:20px 20px 0 0;padding:16px 16px calc(18px + env(safe-area-inset-bottom));box-shadow:0 -10px 35px rgba(0,0,0,.22)}
.more-sheet-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin-top:10px}
.more-sheet-btn{display:flex;flex-direction:column;align-items:flex-start;gap:3px;padding:12px;border-radius:12px;border:1px solid var(--border);background:#f8fafc;color:var(--navy);font-weight:800;font-size:13px;cursor:pointer;text-align:left}
.more-sheet-btn span{font-size:11.5px;font-weight:500;color:var(--muted)}
.more-sheet-btn.active{background:#eff6ff;border-color:var(--navy)}

/* =========================================================
   SMART MY-DAY HERO, TEAM RADAR & DAY TIMELINE
   ========================================================= */
.smart-hero{
  background:linear-gradient(135deg,#ffffff 0%,#f0f6ff 100%);
  border:1.5px solid #bfdbfe;border-radius:16px;padding:16px 18px;
  box-shadow:0 8px 24px rgba(14,42,77,.09);margin-bottom:14px;
}
.smart-hero-top{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:12px}
.smart-hero h2{margin:0;font-size:17px;font-weight:800;color:var(--navy);line-height:1.3}
.smart-hero .hero-sub{font-size:12.8px;color:var(--muted);margin-top:3px}
.smart-alerts{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:12px}
.smart-chip{
  display:inline-flex;align-items:center;gap:6px;padding:6px 11px;border-radius:999px;
  font-size:12px;font-weight:700;cursor:pointer;border:1px solid transparent;transition:.15s;
}
.smart-chip.warn{background:#fef3c7;border-color:#fcd34d;color:#92400e}
.smart-chip.danger{background:#fee2e2;border-color:#fca5a5;color:#991b1b}
.smart-chip.ok{background:#d1fae5;border-color:#6ee7b7;color:#065f46}
.smart-chip.info{background:#dbeafe;border-color:#93c5fd;color:#1e40af}
.smart-chip:hover{filter:brightness(.96);transform:translateY(-1px)}

.day-strip{display:flex;gap:6px;overflow-x:auto;-webkit-overflow-scrolling:touch;padding-bottom:4px;margin-bottom:12px;scrollbar-width:none}
.day-strip::-webkit-scrollbar{display:none}
.day-pill{
  border:1px solid #cbd5e1;background:#fff;color:var(--navy);
  padding:7px 12px;border-radius:10px;font-size:12.2px;font-weight:700;
  cursor:pointer;white-space:nowrap;flex-shrink:0;transition:.15s;
}
.day-pill.active{background:var(--navy);border-color:var(--navy);color:#fff;box-shadow:0 3px 10px rgba(14,42,77,.2)}
.day-pill.hcns{border-color:#f59e0b}

.next-task-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.next-task-card{
  background:#fff;border:1px solid var(--border);border-radius:12px;padding:12px;
  display:flex;flex-direction:column;justify-content:space-between;gap:8px;
  box-shadow:0 2px 8px rgba(15,23,42,.04);transition:.15s;
}
.next-task-card:hover{border-color:#93c5fd;box-shadow:0 4px 14px rgba(29,78,216,.09)}
.nt-head{display:flex;align-items:center;justify-content:space-between;gap:6px;flex-wrap:wrap}
.nt-title{font-weight:700;color:var(--navy);font-size:13.2px;line-height:1.4}
.nt-out{font-size:11.8px;color:var(--muted);line-height:1.35}
.nt-actions{display:flex;gap:5px;flex-wrap:wrap;padding-top:4px;border-top:1px dashed #e2e8f0}

.radar-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.radar-card{
  background:#f8fafc;border:1px solid var(--border);border-radius:12px;padding:11px 13px;
  cursor:pointer;transition:.15s;display:flex;flex-direction:column;gap:6px;
}
.radar-card:hover{background:#eff6ff;border-color:#93c5fd;transform:translateY(-1px)}
.radar-top{display:flex;align-items:center;justify-content:space-between;gap:8px}
.radar-name{font-weight:800;color:var(--navy);font-size:13.2px;display:flex;align-items:center;gap:7px}
.radar-av{width:28px;height:28px;border-radius:8px;background:var(--navy);color:#fff;display:inline-flex;align-items:center;justify-content:center;font-size:11px;font-weight:800;flex-shrink:0}

@media(max-width:960px){
  .next-task-list,.radar-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:768px){
  .smart-hero{padding:13px 12px}
  .smart-hero h2{font-size:15.5px}
  .next-task-list,.radar-grid{grid-template-columns:1fr}
}

/* =========================================================
   PRINT STYLES
   ========================================================= */
@media print{
  .topbar,.nav-wrap,.mobile-bottom-nav,.no-print{display:none!important}
  .container{max-width:100%;margin:0;padding:0}
  .card{box-shadow:none;border:1px solid #cbd5e1;break-inside:avoid}
}

/* =========================================================
   TABLET BREAKPOINT (<= 1024px)
   ========================================================= */
@media(max-width:1024px){
  .g5{grid-template-columns:repeat(3,minmax(0,1fr))}
  .g4{grid-template-columns:repeat(2,minmax(0,1fr))}
  .g3,.role-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}

/* =========================================================
   MOBILE APP MODE (<= 768px) — ZERO OVERLAP, THUMB-FRIENDLY!
   ========================================================= */
@media(max-width:768px){
  body{font-size:14px}
  .topbar{padding:10px 12px}
  .topbar-inner{flex-direction:column;align-items:stretch;gap:9px}
  .brand{flex:none;gap:9px}
  .brand img{height:36px;padding:3px 6px}
  .brand h1{font-size:14.5px;line-height:1.25}
  .brand .sub{font-size:11px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
  .top-controls{display:grid;grid-template-columns:1fr 1fr;gap:7px;width:100%}
  .who-box{grid-column:1/-1;width:100%;justify-content:space-between;padding:5px 9px}
  .who-box select{flex:1;max-width:none;font-size:14px;min-height:34px}
  .sync-pill{grid-column:1/-1;text-align:center;font-size:11.5px;padding:4px 8px}
  .btn-quick-top{width:100%;text-align:center;padding:9px 8px;font-size:12.5px}

  .nav{padding:7px 10px;gap:6px}
  .nav button{padding:7px 11px;font-size:12px}

  .container{margin:10px auto 0;padding:0 10px calc(86px + env(safe-area-inset-bottom))}
  .card{padding:13px 12px;border-radius:13px;margin-bottom:12px}
  .card-title{font-size:14.8px;gap:8px;margin-bottom:10px}

  /* 2-col KPI Bento on mobile, 5th card spans full width cleanly */
  .g5{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
  .g5 > .kpi:last-child{grid-column:1/-1}
  .g2,.g3,.g4,.role-grid{grid-template-columns:1fr;gap:10px}
  .kpi{padding:11px 12px}
  .kpi .val{font-size:17.5px}

  /* Prevent iOS zoom on input focus */
  input[type=text],input[type=number],input[type=date],input[type=time],select,textarea{
    font-size:16px;padding:9px 10px;min-height:42px;
  }
  .btn{min-height:40px;font-size:13px}
  .btn-sm{min-height:36px;padding:6px 10px;font-size:12.5px}
  .form-grid{grid-template-columns:1fr;gap:9px}
  .guide-box{grid-template-columns:1fr}
  .media-grid{grid-template-columns:1fr}
  .folder-tabs{flex-wrap:nowrap;overflow-x:auto;-webkit-overflow-scrolling:touch;padding-bottom:4px;scrollbar-width:none}
  .folder-tabs::-webkit-scrollbar{display:none}
  .folder-tab{flex-shrink:0}

  /* Show scroll hint on wide data tables */
  .scroll-hint{display:flex}

  /* MOBILE CARD VIEW FOR CHECKLIST TABLES (NO HORIZONTAL SCROLL, ZERO OVERLAP!) */
  .table-wrap.mobile-cards{border:none;background:transparent;overflow:visible}
  .table-wrap.mobile-cards table,
  .table-wrap.mobile-cards tbody{display:block;width:100%;background:transparent}
  .table-wrap.mobile-cards thead{display:none}
  .table-wrap.mobile-cards tr.task-main-row{
    display:flex;flex-direction:column;gap:8px;
    background:#fff;border:1px solid var(--border);border-radius:13px;
    padding:12px;margin-bottom:10px;
    box-shadow:0 2px 8px rgba(14,42,77,.05);
  }
  .table-wrap.mobile-cards tr.task-main-row.has-guide-open{
    margin-bottom:0;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom:none;
  }
  .table-wrap.mobile-cards tr.task-main-row td{
    display:block;padding:0!important;border:none!important;width:100%!important;background:transparent!important;
  }
  .table-wrap.mobile-cards tr.task-main-row td.td-code{
    display:flex;align-items:center;justify-content:space-between;gap:6px;
    padding-bottom:6px!important;border-bottom:1px dashed #e2e8f0!important;
  }
  .table-wrap.mobile-cards tr.task-main-row td.td-code br{display:none}
  .table-wrap.mobile-cards tr.task-main-row td.td-time{
    display:flex;align-items:center;flex-wrap:wrap;gap:6px;font-size:12.5px;
  }
  .table-wrap.mobile-cards tr.task-main-row td.td-time br{display:none}
  .table-wrap.mobile-cards tr.task-main-row td.td-owner{
    background:#f8fafc!important;padding:5px 8px!important;border-radius:7px;font-size:12px;
  }
  .table-wrap.mobile-cards tr.task-main-row td.td-owner br{display:none}
  .table-wrap.mobile-cards tr.task-guide-row{
    display:block;margin-bottom:10px;
    border:1px solid var(--border);border-top:none;
    border-radius:0 0 13px 13px;overflow:hidden;
  }
  .table-wrap.mobile-cards tr.task-guide-row td{display:block;width:100%!important}

  /* Toast sits cleanly above Mobile Bottom Nav */
  .toast{bottom:calc(72px + env(safe-area-inset-bottom));left:12px;right:12px;text-align:center}

  /* Modal slides up cleanly on Mobile */
  .modal-backdrop{align-items:flex-end;padding:0}
  .modal-card{border-radius:20px 20px 0 0;max-height:90vh;padding:16px 14px calc(18px + env(safe-area-inset-bottom))}

  /* Native Mobile Bottom App Bar */
  .mobile-bottom-nav{
    display:grid;grid-template-columns:repeat(5,1fr);
    position:fixed;bottom:0;left:0;right:0;z-index:95;
    background:#ffffff;border-top:1px solid var(--border);
    box-shadow:0 -4px 18px rgba(15,23,42,.1);
    padding:4px 2px calc(4px + env(safe-area-inset-bottom));
  }
  .mobile-bottom-nav button{
    border:none;background:transparent;color:var(--muted);
    display:flex;flex-direction:column;align-items:center;justify-content:center;
    gap:2px;padding:5px 2px;font-size:10.5px;font-weight:700;cursor:pointer;
    border-radius:8px;line-height:1.15;
  }
  .mobile-bottom-nav button .ico{font-size:18px;line-height:1}
  .mobile-bottom-nav button.active{color:var(--navy);background:#eff6ff}
}
