  :root{
    --ink:#0B2436; --ink-2:#14344A;
    --canvas:#EDF1F4; --surface:#FFFFFF; --surface-2:#F7F9FB;
    --line:#E2E7EC; --line-2:#EDF0F3;
    --muted:#5C6B78; --muted-2:#8494A0;
    --accent:#127C8A; --accent-deep:#0D5E69; --accent-tint:#E4F1F2;
    --copper:#C2764B;
    --green:#2E9E5B; --green-bg:#E7F4EC;
    --amber:#D98A28; --amber-bg:#FBF0DF;
    --red:#CE443A; --red-bg:#FBE9E7;
    --radius:14px; --radius-sm:10px;
    --shadow:0 1px 2px rgba(11,36,54,.04), 0 8px 24px rgba(11,36,54,.06);
    --shadow-lg:0 12px 40px rgba(11,36,54,.16);
  }
  [data-theme="dark"]{
    --ink:#E8EEF2; --ink-2:#C4D2DC;
    --canvas:#0A1620; --surface:#0F2230; --surface-2:#12293A;
    --line:#1E3A4C; --line-2:#182F3F;
    --muted:#9DB0BD; --muted-2:#6E8494;
    --accent:#3BA8B6; --accent-deep:#5BC4D0; --accent-tint:#12333A;
    --copper:#D68E63;
    --green:#3FB56C; --green-bg:#122E20;
    --amber:#E39A3E; --amber-bg:#33280F;
    --red:#E25A50; --red-bg:#331512;
    --shadow:0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
    --shadow-lg:0 12px 40px rgba(0,0,0,.5);
  }
  /* keep the sidebar visually distinct (darker) from the dark canvas */
  [data-theme="dark"] .sidebar{background:#081118}
  [data-theme="dark"] .brand .name{color:#fff}
  /* soften pure-white images/illustrations a touch in dark */
  [data-theme="dark"] img{filter:brightness(.94)}
  /* --- dark-mode contrast fixes (feedback 01) --- */
  /* topbar keeps a light-on-dark identity: use a fixed dark surface, not the inverted --ink */
  [data-theme="dark"] .topbar{background:#0C1E2B;border-bottom-color:#1E3A4C}
  [data-theme="dark"] .crumbs b{color:#E8EEF2}
  /* co-pilot fab: keep its dark pill, add a visible hairline border so it reads against the dark canvas */
  [data-theme="dark"] .copilot-fab{background:#12293A;border:1px solid #2C4A5E}
  [data-theme="dark"] .copilot-fab:hover{background:#173241}
  /* primary + action buttons: royal blue → turquoise on hover, white text (readable in dark) */
  [data-theme="dark"] .btn-primary,[data-theme="dark"] .dojob{background:#2563EB;color:#fff}
  [data-theme="dark"] .btn-primary:hover,[data-theme="dark"] .dojob:hover{background:var(--accent)}
  [data-theme="dark"] .rowbtn{background:var(--surface-2);color:var(--ink);border-color:var(--line)}
  [data-theme="dark"] .rowbtn.prim{background:#2f5fe0;color:#fff;border-color:#2f5fe0}
  [data-theme="dark"] .rowbtn.prim:hover{background:#2951c7;color:#fff;border-color:#2951c7}
  [data-theme="dark"] .rowbtn:hover{border-color:var(--accent);color:var(--accent-deep)}
  /* ---- brand skins: VesselPath (workboat) wears teal, YachtPath (yacht & pleasure) wears soft copper ---- */
  [data-brand="yachtpath"]{--accent:#C97B4F;--accent-deep:#A85F38;--accent-tint:#F6ECE3}
  [data-theme="dark"][data-brand="yachtpath"]{--accent:#D9905F;--accent-deep:#E7AC82;--accent-tint:#3A2617}
  [data-brand="yachtpath"] .brand .mark{box-shadow:0 3px 10px rgba(201,123,79,.4)}
  /* co-pilot: send button + sent bubbles keep royal blue in dark (were --ink = light grey) */
  [data-theme="dark"] .cp-send{background:#2563EB}
  [data-theme="dark"] .cp-send:hover{background:#1D4ED8}
  [data-theme="dark"] .msg.user{background:#2563EB;color:#fff}
  [data-theme="dark"] .msg.bot{background:var(--surface-2)}
  /* survey-cycle "You are here" badge + pin: royal blue in dark (was --ink = light grey behind white text) */
  [data-theme="dark"] .survey-now .sn-badge{background:#2563EB;color:#fff}
  [data-theme="dark"] .survey-now .sn-pin{background:#2563EB}
  /* toast: ensure the little popup text is readable in dark */
  [data-theme="dark"] .toast{background:#12293A;color:#E8EEF2;border:1px solid #2C4A5E}
  html{color-scheme:light}
  [data-theme="dark"]{color-scheme:dark}
  *{box-sizing:border-box}
  html{scroll-behavior:smooth}
  body{
    margin:0; background:var(--canvas); color:var(--ink);
    font-family:'Instrument Sans',system-ui,sans-serif; font-size:14.5px; line-height:1.5;
    -webkit-font-smoothing:antialiased;
  }
  a{color:inherit;text-decoration:none}
  button{font-family:inherit;cursor:pointer;border:none;background:none;color:inherit}
  :focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:6px}
  .mono{font-family:'IBM Plex Mono',monospace}
  .grotesk{font-family:'Space Grotesk',sans-serif}
  .eyebrow{font-family:'Space Grotesk',sans-serif;text-transform:uppercase;letter-spacing:.14em;font-size:11px;font-weight:600;color:var(--muted-2)}

  /* ---------- shell ---------- */
  .app{display:grid;grid-template-columns:248px 1fr;min-height:100vh}

  /* ---------- sidebar ---------- */
  .sidebar{background:var(--ink);color:#C6D3DC;display:flex;flex-direction:column;position:sticky;top:0;height:100vh;overflow-y:auto}
  .brand{display:flex;align-items:center;gap:11px;padding:20px 20px 18px}
  .brand .mark{width:32px;height:32px;border-radius:8px;background:#0B2436;display:grid;place-items:center;flex:none;box-shadow:0 3px 10px rgba(11,36,54,.45)}
  .brand .mark svg{width:26px;height:26px}
  .brand .mark .glyph-y{display:none}
  [data-brand="yachtpath"] .brand .mark{background:#0B1929}
  [data-brand="yachtpath"] .brand .mark .glyph-v{display:none}
  [data-brand="yachtpath"] .brand .mark .glyph-y{display:block}
  [data-theme="dark"] .brand .mark{outline:1px solid rgba(255,255,255,.14)}
  .brand .mark svg{width:19px;height:19px}
  .brand .name{font-family:'Space Grotesk';font-weight:600;font-size:16px;color:#fff;letter-spacing:-.01em;line-height:1.05}
  .brand .name span{display:block;font-size:10.5px;letter-spacing:.14em;color:var(--accent);font-weight:500;text-transform:uppercase;margin-top:2px}

  .vessel-switch{margin:2px 14px 14px;padding:10px 12px;background:rgba(255,255,255,.05);border:1px solid rgba(255,255,255,.08);border-radius:11px;display:flex;align-items:center;gap:10px;cursor:pointer;transition:background .15s}
  .vessel-switch:hover{background:rgba(255,255,255,.09)}
  .vessel-switch .vs-ico{width:28px;height:28px;border-radius:7px;background:#0E2C40;display:grid;place-items:center;flex:none}
  .vessel-switch .vs-ico svg{width:17px;height:17px}
  .vessel-switch .vs-name{font-weight:600;color:#fff;font-size:13.5px;line-height:1.1}
  .vessel-switch .vs-sub{font-size:11px;color:var(--muted-2)}
  .vessel-switch .vs-caret{margin-left:auto;color:var(--muted-2)}

  .nav{padding:4px 12px 20px;flex:1}
  .nav-group{margin-top:16px}
  .nav-group > .lbl{font-family:'Space Grotesk';text-transform:uppercase;letter-spacing:.13em;font-size:10px;font-weight:600;color:#5E7384;padding:0 12px 7px}
  .nav-item{display:flex;align-items:center;gap:11px;padding:8.5px 12px;border-radius:9px;color:#B7C6D1;font-weight:500;font-size:13.5px;position:relative;transition:background .13s,color .13s}
  .nav-item svg{width:17px;height:17px;flex:none;opacity:.85}
  .nav-item .chev{margin-left:auto;width:14px;height:14px;transition:transform .18s;opacity:.6}
  .nav-item:hover{background:rgba(255,255,255,.06);color:#EAF1F5}
  .nav-item.active{background:linear-gradient(90deg,rgba(18,124,138,.22),rgba(18,124,138,.08));color:#fff}
  .nav-item.active::before{content:"";position:absolute;left:-12px;top:8px;bottom:8px;width:3px;border-radius:0 3px 3px 0;background:var(--accent)}
  .nav-item .badge{margin-left:auto;font-size:10.5px;font-weight:600;background:var(--red);color:#fff;border-radius:20px;padding:1px 7px;font-family:'Space Grotesk'}
  .nav-item.has-badge .chev{display:none}
  .subnav{overflow:hidden;max-height:0;transition:max-height .22s ease}
  .subnav.open{max-height:600px}
  .subnav a{display:block;padding:7px 12px 7px 40px;font-size:12.75px;color:#94A7B4;border-radius:8px}
  .subnav a:hover{color:#EAF1F5;background:rgba(255,255,255,.05)}
  .subnav a.active{color:#fff}
  .nav-group.open > .nav-item .chev{transform:rotate(90deg)}

  .side-foot{padding:12px 20px 18px;border-top:1px solid rgba(255,255,255,.07);display:flex;align-items:center;gap:10px}
  .avatar{width:32px;height:32px;border-radius:50%;background:linear-gradient(135deg,var(--copper),#9C5A34);display:grid;place-items:center;color:#fff;font-weight:600;font-size:13px;font-family:'Space Grotesk';flex:none}
  .side-foot .who{line-height:1.15}
  .side-foot .who b{color:#fff;font-weight:600;font-size:13px;display:block}
  .side-foot .who span{font-size:11px;color:var(--muted-2)}

  /* ---------- main ---------- */
  .main{display:flex;flex-direction:column;min-width:0}
  .topbar{height:60px;background:rgba(255,255,255,.85);backdrop-filter:blur(8px);border-bottom:1px solid var(--line);display:flex;align-items:center;gap:16px;padding:0 26px;position:sticky;top:0;z-index:30}
  .crumbs{font-size:13px;color:var(--muted)}
  .crumbs b{color:var(--ink);font-weight:600}
  .search{margin-left:auto;display:flex;align-items:center;gap:9px;background:var(--surface-2);border:1px solid var(--line);border-radius:10px;padding:8px 13px;width:270px;color:var(--muted)}
  .search input{border:none;background:none;outline:none;font-family:inherit;font-size:13.5px;width:100%;color:var(--ink)}
  .search input::placeholder{color:var(--muted-2)}
  .tb-btn{width:38px;height:38px;border-radius:10px;border:1px solid var(--line);background:var(--surface);display:grid;place-items:center;color:var(--ink-2);position:relative;transition:border-color .15s,background .15s}
  .tb-btn:hover{border-color:var(--accent);color:var(--accent)}
  .tb-btn .dot{position:absolute;top:8px;right:9px;width:8px;height:8px;border-radius:50%;background:var(--red);border:2px solid var(--surface)}
  .btn-primary{background:var(--ink);color:#fff;border-radius:10px;padding:9px 15px;font-weight:600;font-size:13px;display:flex;align-items:center;gap:7px;transition:background .15s}
  .btn-primary:hover{background:var(--accent-deep)}
  .btn-primary svg{width:16px;height:16px}

  .view{padding:26px 30px 90px;max-width:1240px;margin:0 auto;width:100%}
  .view[hidden]{display:none}
  .page-head{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;margin-bottom:20px;flex-wrap:wrap}
  .page-head h1{font-family:'Space Grotesk';font-size:25px;font-weight:600;letter-spacing:-.02em;margin:0 0 3px}
  .page-head p{margin:0;color:var(--muted);font-size:13.5px}
  .head-actions{display:flex;gap:9px;align-items:center}
  .btn-ghost{border:1px solid var(--line);background:var(--surface);border-radius:10px;padding:8px 13px;font-weight:600;font-size:13px;color:var(--ink-2);display:flex;align-items:center;gap:7px;transition:border-color .15s,color .15s}
  .btn-ghost:hover{border-color:var(--accent);color:var(--accent)}
  .btn-ghost svg{width:15px;height:15px}

  /* ---------- cards ---------- */
  .card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow)}
  .card-h{display:flex;align-items:center;justify-content:space-between;padding:15px 18px 12px}
  .card-h h3{margin:0;font-size:14.5px;font-weight:600;font-family:'Space Grotesk';display:flex;align-items:center;gap:8px}
  .card-h a{font-size:12.5px;color:var(--accent);font-weight:600}

  /* ---------- dashboard hero ---------- */
  .hero{background:linear-gradient(115deg,var(--ink) 0%,#123A54 62%,#155A66 130%);border-radius:18px;color:#fff;padding:24px 26px;position:relative;overflow:hidden;box-shadow:var(--shadow)}
  .hero .wake{position:absolute;inset:0;opacity:.5;pointer-events:none}
  .hero-top{display:flex;justify-content:space-between;align-items:flex-start;gap:20px;position:relative}
  .hero .eyebrow{color:#7FB6C0}
  .hero h2{font-family:'Space Grotesk';font-size:30px;font-weight:600;letter-spacing:-.02em;margin:4px 0 6px}
  .hero .spec{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}
  .chip{font-size:11.5px;font-weight:500;background:rgba(255,255,255,.1);border:1px solid rgba(255,255,255,.14);border-radius:20px;padding:4px 11px;color:#DCE8ED;font-family:'Space Grotesk'}
  .chip.code{background:rgba(18,124,138,.35);border-color:rgba(127,182,192,.4);color:#DAF2F5}
  .hero-vessel{width:230px;flex:none;align-self:center;opacity:.96}
  .hero-vessel svg{width:100%;height:auto;display:block;filter:drop-shadow(0 8px 18px rgba(0,0,0,.35))}

  .readiness{display:grid;grid-template-columns:repeat(5,1fr);gap:1px;background:rgba(255,255,255,.1);border-radius:12px;overflow:hidden;margin-top:22px;position:relative}
  .rd{background:rgba(9,28,42,.34);padding:13px 15px;backdrop-filter:blur(2px)}
  .rd .rd-top{display:flex;align-items:center;gap:7px;font-size:11.5px;color:#AFC5CF;font-weight:500;font-family:'Space Grotesk';text-transform:uppercase;letter-spacing:.06em}
  .rd .rd-dot{width:9px;height:9px;border-radius:50%;flex:none}
  .rd .rd-val{font-family:'Space Grotesk';font-size:19px;font-weight:600;margin-top:7px;line-height:1;color:#fff}
  .rd .rd-sub{font-size:11.5px;color:#96B0BC;margin-top:4px}
  .dot-g{background:#46C877;box-shadow:0 0 0 3px rgba(70,200,119,.22)}
  .dot-a{background:#F0A94A;box-shadow:0 0 0 3px rgba(240,169,74,.22)}
  .dot-r{background:#EA6559;box-shadow:0 0 0 3px rgba(234,101,89,.22)}

  /* dashboard grid */
  .dash-grid{display:grid;grid-template-columns:1.15fr 1fr;gap:18px;margin-top:18px}
  .dash-grid .col{display:flex;flex-direction:column;gap:18px}

  /* gauge */
  .gauge-wrap{display:flex;align-items:center;gap:22px;padding:6px 18px 20px}
  .gauge{position:relative;width:132px;height:132px;flex:none}
  .gauge svg{transform:rotate(-90deg)}
  .gauge .center{position:absolute;inset:0;display:grid;place-content:center;text-align:center}
  .gauge .center b{font-family:'Space Grotesk';font-size:30px;font-weight:600;line-height:1}
  .gauge .center span{font-size:11px;color:var(--muted);text-transform:uppercase;letter-spacing:.08em;font-family:'Space Grotesk'}
  .legend{display:flex;flex-direction:column;gap:11px;flex:1}
  .legend .lg{display:flex;align-items:center;gap:11px}
  .legend .sw{width:11px;height:11px;border-radius:3px;flex:none}
  .legend .lg b{font-family:'Space Grotesk';font-size:16px;margin-left:auto}
  .legend .lg .t{font-size:13px;color:var(--ink-2);font-weight:500}

  /* expiry list */
  .exp-section-lbl{font-family:'Space Grotesk';font-weight:600;font-size:11px;text-transform:uppercase;letter-spacing:.05em;color:var(--muted-2);padding:10px 18px 4px}
  .exp-row{display:flex;align-items:center;gap:13px;padding:11px 18px;border-top:1px solid var(--line-2)}
  .exp-row:first-of-type{border-top:none}
  .exp-ico{width:34px;height:34px;border-radius:9px;display:grid;place-items:center;flex:none}
  .exp-ico svg{width:17px;height:17px}
  .exp-row .nm{font-weight:600;font-size:13.5px}
  .exp-row .mt{font-size:12px;color:var(--muted)}
  .exp-row .cd{margin-left:auto;text-align:right;font-family:'Space Grotesk';font-weight:600;font-size:13px}
  .exp-row .cd small{display:block;font-size:10.5px;font-weight:500;color:var(--muted-2);letter-spacing:.03em}

  /* meters */
  .meters{display:grid;grid-template-columns:1fr 1fr;gap:14px;padding:4px 18px 18px}
  .meter{background:var(--surface-2);border:1px solid var(--line);border-radius:11px;padding:13px 15px}
  .meter .ml{font-size:11.5px;color:var(--muted);font-weight:500;font-family:'Space Grotesk';text-transform:uppercase;letter-spacing:.05em}
  .meter .mv{font-family:'IBM Plex Mono';font-size:24px;font-weight:600;margin-top:6px;letter-spacing:-.02em}
  .meter .mv small{font-size:12px;color:var(--muted);font-weight:400}
  .meter .mbar{height:5px;border-radius:4px;background:var(--line);margin-top:9px;overflow:hidden}
  .meter .mbar i{display:block;height:100%;border-radius:4px;background:var(--accent)}
  .meter .mnote{font-size:11px;color:var(--muted-2);margin-top:7px;display:flex;justify-content:space-between}

  /* agenda */
  .agenda-row{display:flex;gap:13px;padding:11px 18px;border-top:1px solid var(--line-2);align-items:center}
  .agenda-row:first-of-type{border-top:none}
  .ag-date{width:44px;text-align:center;flex:none}
  .ag-date b{font-family:'Space Grotesk';font-size:18px;font-weight:600;display:block;line-height:1}
  .ag-date span{font-size:10.5px;text-transform:uppercase;color:var(--muted-2);letter-spacing:.06em;font-family:'Space Grotesk'}
  .ag-row .nm{font-weight:600;font-size:13.5px}
  .ag-bar{width:3px;align-self:stretch;border-radius:3px;flex:none}

  /* ---------- pills & tables ---------- */
  .pill{display:inline-flex;align-items:center;gap:6px;font-size:11.5px;font-weight:600;padding:3px 10px;border-radius:20px;font-family:'Space Grotesk';white-space:nowrap}
  .pill .pd{width:7px;height:7px;border-radius:50%}
  .pill.g{background:var(--green-bg);color:#1E7A43} .pill.g .pd{background:var(--green)}
  .pill.a{background:var(--amber-bg);color:#9C6414} .pill.a .pd{background:var(--amber)}
  .pill.r{background:var(--red-bg);color:#A5322A} .pill.r .pd{background:var(--red)}
  .pill.n{background:#EDF0F3;color:var(--muted)} .pill.n .pd{background:var(--muted-2)}
  .pill.acc{background:var(--accent-tint);color:var(--accent-deep)} .pill.acc .pd{background:var(--accent)}

  .tabs{display:flex;gap:4px;background:var(--surface-2);border:1px solid var(--line);border-radius:11px;padding:4px;margin-bottom:16px;width:fit-content}
  .tab{padding:7px 15px;border-radius:8px;font-weight:600;font-size:13px;color:var(--muted);display:flex;align-items:center;gap:8px;transition:.13s}
  .tab .n{font-family:'Space Grotesk';font-size:11px;background:#E4E9ED;color:var(--muted);border-radius:20px;padding:0 7px;font-weight:600}
  .tab.active{background:var(--surface);color:var(--ink);box-shadow:var(--shadow)}
  .tab.active .n{background:var(--accent);color:#fff}

  table{width:100%;border-collapse:collapse;font-size:13.5px}
  thead th{text-align:left;font-family:'Space Grotesk';font-size:11px;text-transform:uppercase;letter-spacing:.07em;color:var(--muted-2);font-weight:600;padding:0 16px 11px}
  tbody tr{border-top:1px solid var(--line-2)}
  tbody tr:hover{background:var(--surface-2)}
  tbody td{padding:13px 16px;vertical-align:middle}
  .job-nm{font-weight:600;color:var(--ink);display:flex;align-items:center;gap:9px}
  .job-nm .crit{width:7px;height:7px;border-radius:2px;background:var(--red);flex:none}
  .job-sub{font-size:12px;color:var(--muted);margin-top:2px}
  .tick{width:22px;height:22px;border-radius:6px;border:1.5px solid var(--line);background:var(--surface);display:grid;place-items:center;cursor:pointer;transition:.13s}
  .tick:hover{border-color:var(--accent)}
  .due{font-family:'Space Grotesk';font-weight:600;font-size:13px}
  .due small{color:var(--muted-2);font-weight:500;font-size:11px}

  /* ---------- components tree ---------- */
  .tree{padding:8px 10px}
  .tnode{border-radius:9px}
  .tparent{display:flex;align-items:center;gap:10px;padding:10px 12px;border-radius:9px;cursor:pointer;font-weight:600;transition:background .13s}
  .tparent:hover{background:var(--surface-2)}
  .tparent .tchev{width:15px;height:15px;transition:transform .18s;color:var(--muted)}
  .tparent.open .tchev{transform:rotate(90deg)}
  .tparent .tico{width:28px;height:28px;border-radius:8px;background:var(--accent-tint);color:var(--accent-deep);display:grid;place-items:center;flex:none}
  .tparent .tico svg{width:15px;height:15px}
  .tparent .tcount{margin-left:auto;font-size:11.5px;color:var(--muted);font-family:'Space Grotesk'}
  .tchildren{max-height:0;overflow:hidden;transition:max-height .25s ease}
  .tchildren.open{max-height:400px}
  [onclick]{cursor:pointer}
  /* horizontal sub-navigation bar shown at the top of section dashboards */
  .subtab-bar{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:16px;padding:6px;background:var(--surface-2);border:1px solid var(--line);border-radius:12px}
  .subtab-bar a{padding:7px 13px;border-radius:8px;font-size:12.75px;font-weight:600;color:var(--muted);white-space:nowrap;transition:.13s}
  .subtab-bar a:hover{background:var(--surface);color:var(--ink)}
  .subtab-bar a.active{background:var(--accent);color:#fff}
  .ra-chip{display:inline-block;padding:5px 10px;margin:0 5px 6px 0;border:1px solid var(--line);border-radius:999px;font-size:12px;color:var(--muted);background:var(--surface);user-select:none;transition:.12s}
  .ra-chip:hover{border-color:var(--accent)}
  .ra-chip.on{background:var(--accent);border-color:var(--accent);color:#fff;font-weight:600}
  .rm-table{width:100%;border-collapse:collapse;font-size:12px;text-align:center}
  .rm-table th,.rm-table td{border:1px solid var(--surface);padding:8px 6px}
  .rm-table thead th{background:var(--surface-2);color:var(--ink);font-weight:600}
  .rm-corner{background:var(--surface-2)!important;font-size:10.5px;color:var(--muted);text-align:left}
  .rm-row{background:var(--surface-2);color:var(--ink);font-weight:600;text-align:left;white-space:nowrap}
  .rm-n{opacity:.6;font-weight:700}
  .rm-band{font-size:9.5px;opacity:.9;text-transform:uppercase;letter-spacing:.03em}
  .mt-crew{display:flex;align-items:center;gap:7px;padding:6px 9px;border:1px solid var(--line);border-radius:8px;font-size:12.5px;cursor:pointer;background:var(--surface)}
  .mt-crew input{accent-color:var(--accent)}
  .mt-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:7px}
  .lf-ta{width:100%;padding:9px 11px;border:1px solid var(--line);border-radius:9px;font-family:inherit;font-size:13px;background:var(--surface);color:var(--ink);resize:vertical}
  .cat-group{border:1px solid var(--line);border-radius:11px;margin-bottom:10px;overflow:hidden;background:var(--surface)}
  .cat-head{display:flex;align-items:center;gap:10px;padding:12px 14px;cursor:pointer;user-select:none;background:var(--surface-2)}
  .cat-head:hover{background:var(--surface-3,var(--surface-2))}
  .cat-head .chev{transition:transform .18s;color:var(--muted)}
  .cat-group.open .cat-head .chev{transform:rotate(90deg)}
  .cat-name{font-family:'Space Grotesk';font-weight:600;font-size:13.5px;flex:1}
  .cat-count{font-size:11.5px;color:var(--muted);background:var(--surface);border:1px solid var(--line);border-radius:999px;padding:2px 9px}
  .cat-body{display:none}
  .cat-group.open .cat-body{display:block}
  .lf-field label .req-star{color:var(--red);margin-left:2px}
  .field-missing{border-color:var(--red)!important;box-shadow:0 0 0 2px rgba(214,69,69,.15)!important}
  .req-hint{color:var(--red);font-size:11.5px;margin-top:8px;display:none}
  .req-hint.show{display:block}
  .sig-wrap{border:1px solid var(--line);border-radius:10px;padding:8px;background:var(--surface)}
  .sig-canvas{width:100%;height:96px;border:1px dashed var(--line);border-radius:8px;background:var(--surface-2);touch-action:none;display:block;cursor:crosshair}
  .sig-bar{display:flex;align-items:center;justify-content:space-between;margin-top:7px;gap:8px}
  .sig-stamp{font-size:11.5px;color:var(--muted)}
  .sig-stamp.signed{color:var(--green);font-weight:600}
  .sig-btns{display:flex;gap:6px}
  .chk-line{display:flex;align-items:center;gap:7px;margin-bottom:7px}
  .chk-line .chk-cb{accent-color:var(--accent);width:17px;height:17px;flex:none}
  .chk-txt{flex:1;padding:8px 10px;border:1px solid var(--line);border-radius:8px;font-family:inherit;font-size:13px;background:var(--surface);color:var(--ink)}
  .pv-doc{background:#fff;color:#1a2a33;border-radius:8px;padding:34px 40px;box-shadow:0 2px 20px rgba(0,0,0,.12);min-height:380px;font-family:Georgia,serif;line-height:1.6}
  [data-theme="dark"] .pv-doc{background:#f4f6f7}
  .pv-doc h2{font-family:'Space Grotesk';margin:0 0 6px}
  .pv-frame{background:repeating-linear-gradient(45deg,var(--surface-2),var(--surface-2) 12px,var(--surface) 12px,var(--surface) 24px);padding:22px;border-radius:10px}
  /* platform-wide: anything clickable shows the hand cursor, not the text I-beam */
  a,[data-view],[data-tab],.nav-item,.subnav a,.jump,.tab,.mblock,.mnote,.fj,.la,.preset,.rep-card,.dt-prov,.tick,.cbx,.seg button,.chip-line .x,.rowbtn,.dojob,.crit,summary,label[for],[role="button"]{cursor:pointer}
  /* keep the text cursor where the user genuinely types */
  input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]),textarea{cursor:text}
  input[readonly]{cursor:default}
  .vd-input{width:130px;max-width:100%;padding:5px 8px;border:1px solid var(--accent);border-radius:7px;font-size:13px;font-family:'Space Grotesk';font-weight:600;text-align:right;background:var(--surface);color:var(--ink)}
  .vd-input:focus{outline:2px solid var(--accent);outline-offset:1px}
  #vdEditBtn.saving{background:var(--green)}
  [data-theme="dark"] #vdEditBtn.saving{background:var(--green)}

  .dt-prov{background:var(--surface);border:1px solid var(--line);border-radius:11px;padding:13px 14px;cursor:pointer;text-align:left;transition:.15s;display:flex;flex-direction:column;gap:3px}
  .dt-prov:hover{border-color:var(--accent);transform:translateY(-2px)}
  .dt-prov b{font-family:'Space Grotesk';font-size:13.5px}
  .dt-prov span{font-size:11.5px;color:var(--muted)}

  .tchild{display:flex;align-items:center;gap:10px;padding:8px 12px 8px 50px;font-size:13px;color:var(--ink-2);border-radius:8px;cursor:pointer}
  .tchild:hover{background:var(--surface-2)}
  .tchild .cdot{width:7px;height:7px;border-radius:50%;flex:none}
  .tchild .cmeta{margin-left:auto;font-size:11.5px;color:var(--muted-2);font-family:'IBM Plex Mono'}

  /* ---------- compliance ---------- */
  .comp-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;margin-bottom:18px}
  .stat{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:17px 18px;box-shadow:var(--shadow)}
  .stat .st-ico{width:36px;height:36px;border-radius:10px;display:grid;place-items:center;margin-bottom:12px}
  .stat .st-ico svg{width:19px;height:19px}
  .stat .st-v{font-family:'Space Grotesk';font-size:27px;font-weight:600;line-height:1}
  .stat .st-l{font-size:12.5px;color:var(--muted);margin-top:3px}
  .sms-item{display:flex;align-items:center;gap:14px;padding:14px 18px;border-top:1px solid var(--line-2)}
  .sms-item:first-of-type{border-top:none}
  .sms-item .si-ico{width:36px;height:36px;border-radius:10px;background:var(--surface-2);border:1px solid var(--line);display:grid;place-items:center;flex:none;color:var(--accent-deep)}
  .sms-item .si-ico svg{width:18px;height:18px}
  .sms-item .nm{font-weight:600;font-size:14px}
  .sms-item .mt{font-size:12.5px;color:var(--muted);margin-top:1px}
  .sms-item .act{margin-left:auto}

  /* placeholder / empty */
  .placeholder{text-align:center;padding:60px 20px;color:var(--muted)}
  .placeholder .pico{width:56px;height:56px;border-radius:16px;background:var(--accent-tint);color:var(--accent-deep);display:grid;place-items:center;margin:0 auto 16px}
  .placeholder .pico svg{width:26px;height:26px}
  .placeholder h3{font-family:'Space Grotesk';font-size:17px;color:var(--ink);margin:0 0 6px}
  .placeholder p{max-width:400px;margin:0 auto 4px}
  .placeholder .tag{display:inline-block;margin-top:14px;font-size:11.5px;font-weight:600;color:var(--accent-deep);background:var(--accent-tint);border-radius:20px;padding:5px 13px;font-family:'Space Grotesk'}

  /* ---------- co-pilot ---------- */
  .copilot-fab{position:fixed;bottom:24px;right:24px;z-index:60;display:flex;align-items:center;gap:11px;background:var(--ink);color:#fff;border-radius:30px;padding:11px 18px 11px 13px;box-shadow:var(--shadow-lg);transition:transform .18s,background .18s}
  .copilot-fab:hover{transform:translateY(-2px);background:var(--accent-deep)}
  .copilot-fab .cf-ico{width:30px;height:30px;border-radius:50%;background:linear-gradient(150deg,var(--accent),var(--copper));display:grid;place-items:center;flex:none}
  .copilot-fab .cf-ico svg{width:17px;height:17px}
  .copilot-fab .cf-txt b{font-family:'Space Grotesk';font-weight:600;font-size:13.5px;display:block;line-height:1.1}
  .copilot-fab .cf-txt span{font-size:11px;color:#9FD0D6}

  .copilot{position:fixed;bottom:24px;right:24px;width:390px;max-width:calc(100vw - 32px);height:560px;max-height:calc(100vh - 48px);background:var(--surface);border-radius:18px;box-shadow:var(--shadow-lg);z-index:61;display:none;flex-direction:column;overflow:hidden;border:1px solid var(--line)}
  .copilot.open{display:flex}
  .cp-head{background:linear-gradient(120deg,var(--ink),#16465C);color:#fff;padding:16px 18px;display:flex;align-items:center;gap:12px}
  .cp-head .cp-ico{width:36px;height:36px;border-radius:50%;background:linear-gradient(150deg,var(--accent),var(--copper));display:grid;place-items:center;flex:none}
  .cp-head .cp-ico svg{width:20px;height:20px}
  .cp-head b{font-family:'Space Grotesk';font-size:15px;display:block;line-height:1.15}
  .cp-head span{font-size:11.5px;color:#9FD0D6;display:flex;align-items:center;gap:5px}
  .cp-head span::before{content:"";width:7px;height:7px;border-radius:50%;background:#46C877}
  .cp-close{margin-left:auto;color:#9FD0D6;width:30px;height:30px;border-radius:8px;display:grid;place-items:center}
  .cp-close:hover{background:rgba(255,255,255,.12);color:#fff}
  .cp-body{flex:1;overflow-y:auto;padding:18px;background:var(--surface-2);display:flex;flex-direction:column;gap:14px}
  .msg{max-width:86%;font-size:13.5px;line-height:1.5}
  .msg.bot{align-self:flex-start;background:var(--surface);border:1px solid var(--line);border-radius:4px 14px 14px 14px;padding:12px 14px;box-shadow:var(--shadow)}
  .msg.user{align-self:flex-end;background:var(--ink);color:#fff;border-radius:14px 14px 4px 14px;padding:11px 14px}
  .msg.bot b{color:var(--ink)}
  .msg .src{margin-top:9px;font-size:11.5px;color:var(--accent-deep);background:var(--accent-tint);border-radius:8px;padding:7px 10px;display:flex;align-items:center;gap:7px}
  .msg .src svg{width:14px;height:14px;flex:none}
  .cp-chips{display:flex;flex-wrap:wrap;gap:7px}
  .cp-chip{font-size:12px;font-weight:500;border:1px solid var(--line);background:var(--surface);border-radius:20px;padding:6px 12px;color:var(--ink-2);text-align:left;transition:.13s}
  .cp-chip:hover{border-color:var(--accent);color:var(--accent);background:var(--accent-tint)}
  .cp-foot{padding:12px 14px;border-top:1px solid var(--line);display:flex;gap:9px;align-items:center;background:var(--surface)}
  .cp-foot input{flex:1;border:1px solid var(--line);border-radius:22px;padding:10px 15px;font-family:inherit;font-size:13.5px;outline:none}
  .cp-foot input:focus{border-color:var(--accent)}
  .cp-send{width:38px;height:38px;border-radius:50%;background:var(--ink);color:#fff;display:grid;place-items:center;flex:none}
  .cp-send:hover{background:var(--accent-deep)}
  .cp-send svg{width:17px;height:17px}

  /* toast — always the top-most layer, above every modal however many are stacked
     (see the stacking convention comment on .modal-bg) */
  .toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%) translateY(20px);background:var(--ink);color:#fff;padding:12px 18px;border-radius:12px;font-size:13.5px;font-weight:500;box-shadow:var(--shadow-lg);z-index:500;display:flex;align-items:center;gap:10px;opacity:0;pointer-events:none;transition:.25s}
  .toast.show{opacity:1;transform:translateX(-50%) translateY(0)}
  .toast svg{width:17px;height:17px;color:#46C877}

  /* ---- collapsible rail ---- */
  .app.rail{grid-template-columns:76px 1fr}
  .app.rail .brand{padding:20px 0 18px;justify-content:center}
  .app.rail .brand .name{display:none}
  .app.rail .vessel-switch{margin:2px 14px 14px;justify-content:center;padding:10px}
  .app.rail .vessel-switch .vs-name,.app.rail .vessel-switch .vs-sub,.app.rail .vessel-switch .vs-caret{display:none}
  .app.rail .nav-group>.lbl{display:none}
  .app.rail .nav-group{margin-top:10px;border-top:1px solid rgba(255,255,255,.06);padding-top:10px}
  .app.rail .nav-group:first-child{border-top:none;margin-top:6px}
  .app.rail .nav-item{justify-content:center;gap:0;font-size:0;padding-left:0;padding-right:0}
  .app.rail .nav-item svg{font-size:initial}
  .app.rail .nav-item .chev,.app.rail .nav-item .badge,.app.rail .nav-item .pill{display:none}
  .app.rail .subnav{display:none}
  .app.rail .side-foot{justify-content:center;padding:12px 0 18px}
  .app.rail .side-foot .who{display:none}
  #railToggle svg{transition:transform .2s}
  .app.rail #railToggle svg{transform:rotate(180deg)}

  /* ---- sub-tabs ---- */
  .subtabs{display:flex;gap:0;border-bottom:1px solid var(--line);margin-bottom:20px}
  .subtab{padding:10px 2px;margin-right:26px;font-weight:600;font-size:14px;color:var(--muted);border-bottom:2px solid transparent;margin-bottom:-1px;transition:.13s}
  .subtab.active{color:var(--ink);border-color:var(--accent)}
  .subtab:hover{color:var(--ink)}
  .crew-pane[hidden]{display:none}

  /* ---- API / integration widgets ---- */
  .api-head{position:relative}
  .api-manage{position:absolute;right:10px;top:50%;transform:translateY(-50%);background:transparent;border:none;color:var(--muted-2);cursor:pointer;padding:4px;border-radius:6px}
  .api-manage:hover{background:var(--surface-2);color:var(--ink)}
  .api-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-top:16px}
  .api-card{background:var(--surface);border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow);overflow:hidden;display:flex;flex-direction:column}
  .api-head{display:flex;align-items:center;gap:8px;padding:13px 15px 0;font-size:11.5px;font-weight:600;font-family:'Space Grotesk';color:var(--muted);text-transform:uppercase;letter-spacing:.05em}
  .api-head svg{width:16px;height:16px;color:var(--accent-deep)}
  .api-head .live{margin-left:auto;font-size:10px;color:var(--green);display:flex;align-items:center;gap:5px;letter-spacing:0;text-transform:none}
  .api-head .live::before{content:"";width:6px;height:6px;border-radius:50%;background:var(--green);box-shadow:0 0 0 3px var(--green-bg)}
  .api-add{border:1.5px dashed #C9D3DA;background:var(--surface-2);border-radius:14px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;color:var(--muted);padding:20px;text-align:center;transition:.15s;cursor:pointer;min-height:150px}
  .api-add:hover{border-color:var(--accent);color:var(--accent-deep);background:var(--accent-tint)}
  .api-add .pl{width:34px;height:34px;border-radius:10px;background:var(--surface);border:1px solid var(--line);display:grid;place-items:center}
  .api-add .pl svg{width:18px;height:18px}
  .api-add b{font-size:13px;font-family:'Space Grotesk'}
  .api-add span{font-size:11px;max-width:150px}
  .wx-body{padding:12px 15px 16px;display:flex;flex-direction:column;gap:10px}
  .wx-main{display:flex;align-items:center;gap:12px}
  .wx-main>svg{width:40px;height:40px;flex:none}
  .wx-temp{font-family:'Space Grotesk';font-size:30px;font-weight:600;line-height:1}
  .wx-sub{font-size:12px;color:var(--muted);margin-top:2px}
  .wx-stats{display:flex;gap:16px;font-size:12px;color:var(--ink-2)}
  .wx-stats b{font-family:'Space Grotesk'}
  .map-body{position:relative;height:118px;background:radial-gradient(circle at 55% 45%,#12617A,#0C3D4D);overflow:hidden}
  .map-body .ln{position:absolute;background:rgba(143,208,218,.13)}
  .map-marker{position:absolute;left:54%;top:48%;width:12px;height:12px;transform:translate(-50%,-50%)}
  .map-marker .dot{width:12px;height:12px;border-radius:50%;background:#8FD0DA;border:2px solid #fff;position:relative;z-index:2}
  .map-marker .ping{position:absolute;inset:-7px;border-radius:50%;border:2px solid rgba(143,208,218,.7);animation:ping 2.2s ease-out infinite}
  @keyframes ping{0%{transform:scale(.4);opacity:.9}100%{transform:scale(1.7);opacity:0}}
  .map-foot{padding:9px 14px;display:flex;justify-content:space-between;font-size:11.5px;color:var(--ink-2)}
  .map-foot b{font-family:'IBM Plex Mono';font-weight:600}
  .tide-body{padding:10px 6px 4px}
  .tide-foot{display:flex;justify-content:space-between;padding:6px 14px 14px;font-size:11px;color:var(--muted)}
  .tide-foot b{font-family:'Space Grotesk';color:var(--ink);display:block;font-size:14px;margin-top:1px}

  /* ---- spec sheet ---- */
  .spec-grid{display:grid;grid-template-columns:1fr 1fr;gap:0 44px;padding:6px 22px 20px}
  .spec-row{display:flex;justify-content:space-between;gap:16px;padding:11px 0;border-bottom:1px solid var(--line-2);font-size:13.5px}
  .spec-row .k{color:var(--muted)}
  .spec-row .v{font-weight:600;font-family:'Space Grotesk';text-align:right}
  .preset-row{display:flex;gap:9px;padding:16px 22px;border-bottom:1px solid var(--line-2);flex-wrap:wrap}
  .preset{border:1px solid var(--line);border-radius:10px;padding:9px 14px;font-weight:600;font-size:13px;color:var(--muted);display:flex;align-items:center;gap:8px;cursor:pointer;transition:.13s}
  .preset svg{width:17px;height:17px}
  .preset.on{border-color:var(--accent);background:var(--accent-tint);color:var(--accent-deep)}
  .preset:hover{border-color:var(--accent)}

  /* ---- hours of rest ---- */
  .sync-banner{display:flex;align-items:center;gap:13px;background:var(--accent-tint);border:1px solid #CBE6E9;border-radius:12px;padding:13px 16px;margin-bottom:16px}
  .sync-banner .sb-ico{width:38px;height:38px;border-radius:10px;background:var(--surface);border:1px solid #CBE6E9;display:grid;place-items:center;flex:none;color:var(--accent-deep)}
  .sync-banner .sb-ico svg{width:20px;height:20px}
  .sync-banner b{font-size:13.5px;color:var(--accent-deep)}
  .sync-banner div>span{font-size:12.5px;color:var(--ink-2)}
  .hor-legend{display:flex;gap:18px;font-size:12px;color:var(--muted);padding:0 2px 14px;align-items:center;flex-wrap:wrap}
  .hor-legend i{width:11px;height:11px;border-radius:3px;display:inline-block;margin-right:6px;vertical-align:-1px}
  .hor-block{padding:16px 18px;border-top:1px solid var(--line-2)}
  .hor-block:first-child{border-top:none}
  .hor-top{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px}
  .hor-top b{font-size:14px}
  .hor-strip{display:flex;gap:3px}
  .hor-cell{height:28px;flex:1;border-radius:4px}
  .hor-days{display:flex;justify-content:space-between;font-size:10px;color:var(--muted-2);font-family:'Space Grotesk';margin-top:5px;text-transform:uppercase;letter-spacing:.04em}
  .hor-days span{flex:1;text-align:center}

  /* ---- calendar ---- */
  .cal-top{display:flex;align-items:center;gap:14px;padding:16px 18px 4px}
  .cal-top h3{font-family:'Space Grotesk';font-size:16px;margin:0}
  .cal-nav{display:flex;gap:6px;margin-left:auto}
  .cal-nav button{width:30px;height:30px;border:1px solid var(--line);border-radius:8px;display:grid;place-items:center;color:var(--muted)}
  .cal-nav button:hover{border-color:var(--accent);color:var(--accent)}
  .cal-legend{display:flex;gap:16px;padding:8px 18px 6px;font-size:11.5px;color:var(--muted);flex-wrap:wrap}
  .cal-legend i{width:9px;height:9px;border-radius:3px;display:inline-block;margin-right:5px;vertical-align:-1px}
  .cal-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:7px;padding:8px 18px 18px}
  #calCells{grid-column:1 / -1;display:grid;grid-template-columns:repeat(7,1fr);gap:7px}
  .cal-dow{font-family:'Space Grotesk';font-size:10.5px;text-transform:uppercase;letter-spacing:.06em;color:var(--muted-2);text-align:center;padding:2px 0}
  /* Fixed (not min-) height + scoped overflow — found live 2026-08-20 once RA/DG/meetings/
     CA all started feeding the calendar shim: a day with the render cap's max 3 lines (2
     events + "+N more") needs ~96-100px, but min-height let a busy cell grow past 78px and
     — since #calCells is a CSS grid — stretch that entire ROW to match, making busy months
     look uneven/broken. A fixed height + overflow-y:auto keeps every row the same height
     regardless of how many events land on one day; the JS render cap (calendar.js) still
     keeps the common case to 2 events + "+N more" with no scrollbar needed, this is the
     defensive backstop for whatever does need more room. */
  .cal-cell{height:100px;border:1px solid var(--line);border-radius:10px;padding:7px 8px;overflow-y:auto;overflow-x:hidden}
  .cal-cell .d{font-family:'Space Grotesk';font-weight:600;color:var(--ink-2);font-size:13px}
  .cal-cell.mut{background:var(--surface-2)}
  .cal-cell.mut .d{color:var(--muted-2)}
  .cal-cell.today{border-color:var(--accent);box-shadow:0 0 0 1.5px var(--accent)}
  .cal-ev{margin-top:5px;font-size:10px;font-weight:600;border-radius:5px;padding:2px 6px;color:#fff;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:'Space Grotesk'}

  @media(max-width:1100px){.api-grid{grid-template-columns:repeat(2,1fr)}}
  @media(max-width:760px){.api-grid{grid-template-columns:1fr}.spec-grid{grid-template-columns:1fr}.cal-cell{height:72px}}

  /* SMS Builder's two-column layout (step rail + editor) was inline-styled with a bare
     grid-template-columns:255px 1fr — invisible to every phone-breakpoint override below
     (those all target classes) and, per the blowout gotcha already noted elsewhere in this
     file, a bare 1fr defaults to minmax(auto,1fr): the editor column's wide content (e.g.
     a .tscroll-wrapped table) grew the WHOLE grid instead of scrolling inside its column.
     Root cause of the "reserved margin" the user found on their S20 — verified live via
     headless Chrome that window.innerWidth desynced from the true viewport specifically on
     this page, traced to this exact rule. Moved off inline style onto a real class so it
     can be overridden like every other layout grid in the app. */
  .smsb-layout{display:grid;grid-template-columns:255px minmax(0,1fr);gap:18px;align-items:start}

  /* ---- survey cycle timeline ---- */
  .survey{padding:20px 26px 26px}
  .survey-track{position:relative;height:4px;background:var(--line);border-radius:4px;margin:40px 8px 14px}
  .survey-fill{position:absolute;left:0;top:0;bottom:0;border-radius:4px;background:linear-gradient(90deg,var(--accent),var(--green))}
  .survey-node{position:absolute;top:50%;transform:translate(-50%,-50%);text-align:center}
  .survey-node .sn-dot{width:14px;height:14px;border-radius:50%;background:var(--surface);border:3px solid var(--line)}
  .survey-node.done .sn-dot{border-color:var(--green);background:var(--green)}
  .survey-node.next .sn-dot{border-color:var(--amber);background:var(--surface);box-shadow:0 0 0 4px var(--amber-bg)}
  .survey-node .sn-lbl{position:absolute;bottom:20px;left:50%;transform:translateX(-50%);white-space:nowrap;font-size:11px;font-weight:600;font-family:'Space Grotesk';color:var(--ink-2)}
  .survey-node .sn-date{position:absolute;top:20px;left:50%;transform:translateX(-50%);font-size:10.5px;color:var(--muted-2);white-space:nowrap}
  .survey-now{position:absolute;top:-30px;transform:translateX(-50%);z-index:3;text-align:center}
  .survey-now .sn-badge{background:var(--ink);color:#fff;font-size:10.5px;font-weight:600;font-family:'Space Grotesk';border-radius:20px;padding:3px 10px;white-space:nowrap}
  .survey-now .sn-pin{width:2px;height:44px;background:var(--ink);margin:2px auto 0}

  /* ---- days-to-go chip ---- */
  .dtg{font-family:'Space Grotesk';font-weight:600;font-size:11.5px;border-radius:7px;padding:3px 9px;display:inline-block;white-space:nowrap}
  .dtg.r{background:var(--red-bg);color:#A5322A} .dtg.a{background:var(--amber-bg);color:#9C6414} .dtg.g{background:var(--green-bg);color:#1E7A43}

  /* ---- component detail ---- */
  .cdetail{padding:4px 14px 14px 50px;display:none;gap:14px;flex-wrap:wrap}
  .cdetail.open{display:flex}
  .cd-box{flex:1;min-width:210px;background:var(--surface-2);border:1px solid var(--line);border-radius:10px;padding:12px 14px}
  .cd-box .cdh{font-size:10.5px;text-transform:uppercase;letter-spacing:.05em;color:var(--muted-2);font-family:'Space Grotesk';font-weight:600;margin-bottom:9px;display:flex;align-items:center;gap:6px}
  .cd-box .cdh svg{width:14px;height:14px}
  .cd-part{display:flex;justify-content:space-between;font-size:12.5px;padding:4px 0}
  .cd-part .qty{font-family:'IBM Plex Mono';color:var(--muted)}
  .cd-manual{display:flex;align-items:center;gap:8px;font-size:12.5px;color:var(--accent-deep);font-weight:500;padding:3px 0}
  .cd-manual svg{width:15px;height:15px;flex:none}

  /* ---- Sealogical-style HoR ---- */
  .dept-tabs{display:flex;gap:8px;margin-bottom:18px;flex-wrap:wrap}
  .dept-tab{padding:7px 14px;border:1px solid var(--line);border-radius:20px;font-weight:600;font-size:13px;color:var(--muted);background:var(--surface);display:flex;align-items:center;gap:7px}
  .dept-tab.active{border-color:var(--accent);background:var(--accent-tint);color:var(--accent-deep)}
  .dept-tab .n{font-size:11px;background:var(--accent);color:#fff;border-radius:20px;padding:0 6px;font-family:'Space Grotesk'}
  .hor-cards{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}
  .hor-card{background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:16px;box-shadow:var(--shadow)}
  .hor-card .hc-top{display:flex;align-items:center;gap:11px;margin-bottom:14px}
  .hor-card .hc-av{width:38px;height:38px;border-radius:50%;background:linear-gradient(135deg,var(--accent),var(--accent-deep));display:grid;place-items:center;color:#fff;font-family:'Space Grotesk';font-weight:600;font-size:14px;flex:none}
  .hor-card .hc-nm{font-weight:600;font-size:14px;line-height:1.15}
  .hor-card .hc-role{font-size:12px;color:var(--muted)}
  .hor-cal{display:grid;grid-template-columns:repeat(7,1fr);gap:6px;margin-bottom:14px}
  .hor-dow{font-size:9px;text-align:center;color:var(--muted-2);font-family:'Space Grotesk';text-transform:uppercase}
  .hd{aspect-ratio:1;border-radius:50%;display:grid;place-items:center;font-size:10px;font-weight:600;font-family:'Space Grotesk';position:relative}
  .hd span{position:relative;z-index:2}
  .hd.ok{background:conic-gradient(var(--green) 78%,#D8EDE0 0);color:#0E5B32}
  .hd.short{background:conic-gradient(var(--amber) 45%,#F1E2C8 0);color:#8A5A12}
  .hd.ok::after,.hd.short::after{content:"";position:absolute;inset:3px;background:var(--surface);border-radius:50%}
  .hd.none{background:#EDF0F3;color:var(--muted-2)}
  .hor-sum{display:flex;justify-content:space-between;padding:11px 0;border-top:1px solid var(--line-2);margin-bottom:12px}
  .hor-sum div{text-align:center;flex:1}
  .hor-sum b{font-family:'Space Grotesk';font-size:18px;display:block;line-height:1}
  .hor-sum span{font-size:9.5px;color:var(--muted);text-transform:uppercase;letter-spacing:.03em}
  .hor-approve{width:100%;padding:10px;border-radius:9px;background:var(--accent);color:#fff;font-weight:600;font-size:13px}
  .hor-approve:hover{background:var(--accent-deep)}
  .hor-approve.pending{background:var(--surface-2);color:var(--muted);border:1px solid var(--line);cursor:default}

  /* ---- crew profile expand ---- */
  .crew-profile td{padding:0!important;background:var(--surface-2)}
  .cprofile{padding:18px 22px;display:grid;grid-template-columns:1fr 1fr 1fr;gap:26px}
  .cprofile h4{font-family:'Space Grotesk';font-size:11px;text-transform:uppercase;letter-spacing:.05em;color:var(--muted-2);margin:0 0 8px}
  .cprofile .pr{display:flex;justify-content:space-between;gap:12px;font-size:12.5px;padding:5px 0;border-bottom:1px solid var(--line-2)}
  .cprofile .pr .k{color:var(--muted)}
  .cprofile .pr .v{font-weight:500;text-align:right}

  /* ---- finance ---- */
  .fin-bal{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;margin-bottom:18px}
  .balc{background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:16px 18px;box-shadow:var(--shadow)}
  .balc h4{font-family:'Space Grotesk';font-size:13px;margin:0 0 12px;color:var(--ink)}
  .balc .brow{display:flex;justify-content:space-between;font-size:12.5px;padding:5px 0;color:var(--muted)}
  .balc .brow b{color:var(--ink);font-family:'Space Grotesk'}
  .balc .big{font-family:'Space Grotesk';font-size:26px;font-weight:600;margin-top:6px}
  .balc .big.pos{color:var(--green)} .balc .big.neg{color:var(--red)}
  .fin-tt{font-weight:600;font-family:'Space Grotesk'}
  .donut-wrap{display:flex;align-items:center;gap:26px;padding:8px 18px 22px;flex-wrap:wrap}

  /* ---- reports ---- */
  .rep-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}
  .rep-card{background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:18px;box-shadow:var(--shadow);cursor:pointer;transition:.15s}
  .rep-card:hover{border-color:var(--accent);transform:translateY(-2px)}
  .rep-card.disabled{opacity:.5;cursor:not-allowed;box-shadow:none}
  .rep-card.disabled:hover{border-color:var(--line);transform:none}
  .rep-card .ric{width:40px;height:40px;border-radius:11px;background:var(--accent-tint);color:var(--accent-deep);display:grid;place-items:center;margin-bottom:13px}
  .rep-card .ric svg{width:20px;height:20px}
  .rep-card h3{font-family:'Space Grotesk';font-size:15px;margin:0 0 5px}
  .rep-card p{font-size:12.5px;color:var(--muted);margin:0}

  /* ---- logbook ---- */
  .trip-row{display:flex;gap:14px;padding:15px 18px;border-top:1px solid var(--line-2);align-items:center}
  .trip-row:first-of-type{border-top:none}
  .trip-ico{width:40px;height:40px;border-radius:11px;background:var(--accent-tint);color:var(--accent-deep);display:grid;place-items:center;flex:none}
  .trip-ico svg{width:20px;height:20px}
  .nmea{display:flex;gap:22px;margin-left:auto;text-align:right}
  .nmea div{font-size:10.5px;color:var(--muted);text-transform:uppercase;letter-spacing:.03em;font-family:'Space Grotesk'}
  .nmea b{font-family:'IBM Plex Mono';font-size:15px;color:var(--ink);display:block;font-weight:500}

  /* ---- modal ---- */
  /* Stacking convention (app-wide, not just here): base UI chrome <= ~90 < .modal-bg
     (90, the resting z-index every modal starts at) < a modal raised from inside another
     open modal (assigned a higher z-index dynamically, see the MutationObserver in
     shared.js — never hardcode a specific value or ID here, that's the old per-pair-patch
     pattern this replaced) < .toast (500, always above every possible modal depth). Any
     new modal that follows the existing .modal-bg/.open pattern gets correct stacking
     automatically — nothing to configure per modal or per module. */
  .modal-bg{position:fixed;inset:0;background:rgba(11,36,54,.5);backdrop-filter:blur(3px);z-index:90;display:none;align-items:center;justify-content:center;padding:20px}
  .ns-line{display:flex;align-items:center;gap:10px;font-size:13px;padding:6px 0;cursor:pointer}
  .ns-line input{width:16px;height:16px}
  .ne-chip{display:flex;align-items:center;justify-content:space-between;gap:8px;background:var(--surface-2);border:1px solid var(--line);border-radius:9px;padding:8px 11px;font-size:13px}
  .ne-chip .x{cursor:pointer;color:var(--muted-2);font-size:16px}
  .rb-btn{flex-direction:column;align-items:flex-start;gap:2px;padding:14px 15px !important;text-align:left;height:auto}
  .rb-btn b{font-family:'Space Grotesk';font-size:15px}
  .rb-btn span{font-size:11.5px;color:var(--muted);font-weight:400}
  /* ---- login page ---- */
  #loginOverlay{align-items:center;justify-content:center}
  .lg-card{position:relative;z-index:3;width:380px;max-width:90vw;background:rgba(255,255,255,.97);border-radius:20px;padding:32px 30px;box-shadow:0 30px 80px rgba(0,0,0,.45);animation:lgUp .5s cubic-bezier(.2,.8,.2,1)}
  [data-theme="dark"] .lg-card{background:rgba(18,32,42,.97)}
  @keyframes lgUp{from{opacity:0;transform:translateY(18px)}to{opacity:1;transform:none}}
  .lg-brand{display:flex;align-items:center;gap:12px;margin-bottom:14px}
  .lg-name{font-family:'Space Grotesk';font-weight:700;font-size:23px;letter-spacing:-.02em;color:var(--ink)}
  .lg-tag{font-size:11.5px;color:var(--muted);letter-spacing:.02em}
  .lg-sub{color:var(--muted);font-size:13px;margin:0 0 18px}
  .lg-demo{margin-top:16px;padding:11px 13px;border:1px dashed var(--line);border-radius:10px;background:var(--surface-2);font-size:11.5px;color:var(--muted);line-height:1.5}
  .lg-sea{position:absolute;inset:0;z-index:1;overflow:hidden;pointer-events:none}
  .lg-wave{position:absolute;left:-10%;width:120%;height:120px;background:radial-gradient(120px 100%at 50% 100%,rgba(18,112,126,.35),transparent 70%);border-radius:50%}
  .lg-wave1{bottom:-70px;opacity:.5;animation:lgWave 9s ease-in-out infinite}
  .lg-wave2{bottom:-90px;opacity:.4;animation:lgWave 12s ease-in-out infinite reverse}
  .lg-wave3{bottom:-110px;opacity:.3;animation:lgWave 15s ease-in-out infinite}
  @keyframes lgWave{0%,100%{transform:translateX(0)}50%{transform:translateX(4%)}}
  .lg-ship{position:absolute;bottom:16%;opacity:.9;filter:drop-shadow(0 8px 14px rgba(0,0,0,.3))}
  .lg-ship1{animation:lgSail1 26s linear infinite,lgBob 4s ease-in-out infinite}
  .lg-ship2{bottom:11%;animation:lgSail2 34s linear infinite,lgBob 5s ease-in-out infinite}
  .lg-ship3{bottom:22%;opacity:.55;animation:lgSail3 46s linear infinite,lgBob 6s ease-in-out infinite}
  @keyframes lgSail1{from{left:-15%}to{left:115%}}
  @keyframes lgSail2{from{left:115%;transform:scaleX(-1)}to{left:-15%;transform:scaleX(-1)}}
  @keyframes lgSail3{from{left:-20%}to{left:120%}}
  @keyframes lgBob{0%,100%{margin-bottom:0}50%{margin-bottom:8px}}
  /* P3 Stage 3 (2026-09-18) — "view as client, read-only" DOM-level backstop.
     The real guarantee is canAdminWrite() (data/permissions.js): every write
     gate this session's sweep touched genuinely never attempts the write, so
     this CSS changes nothing about what data can be saved. What it's honestly
     scoped to: primary Save/Create buttons (.btn-primary, used consistently
     across the app for exactly that, never for navigation) and every form
     field inside a .modal (every modal in this app is a create/edit form —
     none is used for search/filter, so this never blocks a read affordance).
     It does NOT catch every possible write trigger (an inline .rowbtn
     Remove/Delete, or a per-row <select> outside a modal, isn't covered by
     this alone) — those are exactly the shape the function-level sweep
     closes instead, which is the reason two layers exist. */
  body.view-as-readonly .btn-primary{opacity:.4;pointer-events:none;cursor:not-allowed}
  body.view-as-readonly .modal input,
  body.view-as-readonly .modal select,
  body.view-as-readonly .modal textarea{opacity:.6;pointer-events:none;cursor:not-allowed}
  .modal-bg.open{display:flex}
  .modal{background:var(--surface);border-radius:18px;width:500px;max-width:100%;max-height:88vh;overflow-y:auto;box-shadow:var(--shadow-lg)}
  .modal-h{display:flex;align-items:center;justify-content:space-between;padding:18px 20px;border-bottom:1px solid var(--line);position:sticky;top:0;background:var(--surface)}
  .modal-h h3{font-family:'Space Grotesk';font-size:17px;margin:0}
  .modal-h .x{width:30px;height:30px;border-radius:8px;display:grid;place-items:center;color:var(--muted)}
  .modal-h .x:hover{background:var(--surface-2);color:var(--ink)}
  .modal-b{padding:10px 20px 20px}
  .chk-item{display:flex;align-items:center;gap:12px;padding:13px 4px;border-bottom:1px solid var(--line-2)}
  .chk-item .cbx{width:24px;height:24px;border:1.6px solid var(--line);border-radius:7px;flex:none;cursor:pointer;display:grid;place-items:center;transition:.13s}
  .chk-item .cbx.on{background:var(--green);border-color:var(--green)}
  .chk-item .ct{font-weight:500;font-size:14px}
  .form-tile{display:flex;align-items:center;gap:13px;padding:14px 16px;border:1px solid var(--line);border-radius:11px;margin-bottom:10px;cursor:pointer;transition:.13s}
  .form-tile:hover{border-color:var(--accent);background:var(--accent-tint)}
  .form-tile .ft-ico{width:36px;height:36px;border-radius:10px;background:var(--accent-tint);color:var(--accent-deep);display:grid;place-items:center;flex:none}
  .form-tile .ft-ico svg{width:18px;height:18px}
  .form-tile b{font-size:14px;display:block}
  .form-tile span{font-size:12px;color:var(--muted)}
  .locked{display:inline-flex;align-items:center;gap:5px;font-size:11px;color:var(--muted-2);font-family:'Space Grotesk';font-weight:600}
  .locked svg{width:13px;height:13px}

  @media(max-width:1100px){.fin-bal,.rep-grid,.hor-cards{grid-template-columns:1fr}.cprofile{grid-template-columns:1fr}}

  /* ---- notifications panel ---- */
  .notif-wrap{position:relative}
  .notif-panel{position:absolute;top:48px;right:0;width:366px;max-width:calc(100vw - 32px);background:var(--surface);border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow-lg);z-index:70;display:none;overflow:hidden}
  .notif-panel.open{display:block}
  .notif-head{display:flex;align-items:center;justify-content:space-between;padding:14px 16px;border-bottom:1px solid var(--line)}
  .notif-head b{font-family:'Space Grotesk';font-size:15px}
  .notif-head span{display:block;font-size:11.5px;color:var(--muted);margin-top:1px}
  .notif-head button{font-size:12px;font-weight:600;color:var(--accent-deep)}
  .notif-head button:hover{text-decoration:underline}
  .notif-list{max-height:360px;overflow-y:auto}
  .notif-item{display:flex;gap:11px;padding:12px 16px;border-bottom:1px solid var(--line-2);cursor:pointer;transition:background .12s;align-items:flex-start}
  .notif-item:hover{background:var(--surface-2)}
  .notif-item.unread{background:var(--accent-tint)}
  .notif-item.unread:hover{background:#DBEDEF}
  .ni-ico{width:32px;height:32px;border-radius:9px;display:grid;place-items:center;flex:none;margin-top:1px}
  .ni-ico svg{width:16px;height:16px}
  .ni-ico.r{background:var(--red-bg);color:var(--red)} .ni-ico.a{background:var(--amber-bg);color:var(--amber)} .ni-ico.acc{background:#E4F1F2;color:var(--accent-deep)}
  .ni-t{font-weight:600;font-size:13px;line-height:1.3}
  .ni-m{font-size:12px;color:var(--muted);margin-top:2px}
  .ni-time{font-size:11px;color:var(--muted-2);font-family:'Space Grotesk';flex:none;margin-top:2px}
  .notif-foot{padding:11px 16px;font-size:11.5px;color:var(--muted);text-align:center;background:var(--surface-2)}
  .notif-foot a{color:var(--accent-deep);font-weight:600;cursor:pointer}

  /* ---- sidebar collapse control ---- */
  .collapse-ctl{display:flex;align-items:center;gap:12px;margin:0 14px 8px;padding:9px 11px;border-radius:11px;color:#C6D3DC;font-size:13px;font-weight:600;font-family:'Space Grotesk';background:rgba(255,255,255,.055);border:1px solid rgba(255,255,255,.11);transition:.15s}
  .collapse-ctl:hover{background:rgba(255,255,255,.13);color:#fff}
  .cc-ic{width:30px;height:30px;border-radius:8px;background:rgba(18,124,138,.28);display:grid;place-items:center;flex:none}
  .cc-ic svg{width:20px;height:20px}
  .app.rail .collapse-ctl{justify-content:center;margin:0 12px 8px;padding:8px 0;gap:0;background:none;border:none}
  .app.rail .collapse-ctl:hover{background:rgba(255,255,255,.06)}
  .app.rail .collapse-ctl .cc-label{display:none}
  .app.rail .cc-ic{width:40px;height:40px}
  .app.rail .cc-ic svg{width:26px;height:26px}

  /* ---- vessel photo ---- */
  .vphoto{display:flex;gap:24px;padding:18px 20px;align-items:center;flex-wrap:wrap}
  .vphoto-img{width:290px;height:158px;border-radius:12px;background:linear-gradient(115deg,#0B2436,#155A66);display:grid;place-items:center;flex:none;overflow:hidden}
  .vphoto-img img{width:100%;height:100%;object-fit:cover}
  .vphoto-side{flex:1;min-width:230px}
  .hero-vessel img{width:100%;border-radius:12px;display:block;box-shadow:0 8px 18px rgba(0,0,0,.3)}
  @media(max-width:760px){.vphoto-img{width:100%}}

  /* ---- vessel spec sections ---- */
  .vsection{padding:18px 22px;border-top:1px solid var(--line-2)}
  .vsection>h4{font-family:'Space Grotesk';font-size:12px;text-transform:uppercase;letter-spacing:.07em;color:var(--accent-deep);margin:0 0 8px;display:flex;align-items:center;gap:8px}
  .vsection>h4 svg{width:15px;height:15px}
  .vgrid{display:grid;grid-template-columns:1fr 1fr;gap:0 44px}
  .tank-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-top:2px}
  .tank{background:var(--surface-2);border:1px solid var(--line);border-radius:10px;padding:11px 13px}
  .tank .tk-l{font-size:10.5px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);font-family:'Space Grotesk';font-weight:600}
  .tank .tk-v{font-family:'IBM Plex Mono';font-size:17px;font-weight:600;margin-top:6px}
  .tank .tk-v small{font-size:11px;color:var(--muted);font-weight:400}
  .upload-empty{border:1.5px dashed #C9D3DA;background:var(--surface-2);border-radius:12px;padding:30px 20px;text-align:center;display:flex;flex-direction:column;align-items:center;gap:7px}
  .upload-empty .ue-ico{width:52px;height:52px;border-radius:14px;background:var(--accent-tint);color:var(--accent-deep);display:grid;place-items:center;margin-bottom:4px}
  .upload-empty .ue-ico svg{width:26px;height:26px}
  .upload-empty b{font-family:'Space Grotesk';font-size:15px}
  .upload-empty .ue-sub{font-size:12.5px;color:var(--muted);max-width:440px;margin-bottom:10px}
  .ga-embed{width:100%;height:440px;border:1px solid var(--line);border-radius:10px;display:block}
  .ga-file{display:flex;align-items:center;gap:12px;margin-bottom:12px}
  .ga-file .gf-ico{width:38px;height:38px;border-radius:9px;background:var(--red-bg);color:var(--red);display:grid;place-items:center;flex:none}
  .ga-file .gf-ico svg{width:19px;height:19px}
  .ga-file b{font-size:14px;display:block}
  .ga-file span{font-size:12px;color:var(--muted)}
  .dt-preview{position:relative;height:320px;border-radius:12px;overflow:hidden;background:radial-gradient(circle at 50% 38%,#155A66,#0B2436);display:grid;place-items:center;text-align:center;color:#fff}
  .dt-preview .dt-badge{position:absolute;top:12px;left:12px;background:rgba(255,255,255,.14);border:1px solid rgba(255,255,255,.25);border-radius:20px;padding:4px 11px;font-size:11px;font-weight:600;font-family:'Space Grotesk';display:flex;align-items:center;gap:6px}
  .dt-preview .dt-badge::before{content:"";width:7px;height:7px;border-radius:50%;background:#46C877}
  .dt-preview .dt-ring{width:78px;height:78px;border-radius:50%;border:3px solid rgba(255,255,255,.55);display:grid;place-items:center;margin:0 auto 14px}
  .dt-preview .dt-ring svg{width:38px;height:38px}
  @media(max-width:900px){.tank-grid{grid-template-columns:repeat(2,1fr)}}
  @media(max-width:760px){.vgrid{grid-template-columns:1fr}}

  /* ---- fullscreen viewer ---- */
  .fs-btn{display:inline-flex;align-items:center;gap:7px;border-radius:9px;padding:7px 12px;font-weight:600;font-size:12.5px;font-family:'Space Grotesk';border:1px solid var(--line);background:var(--surface);color:var(--ink-2)}
  .fs-btn:hover{border-color:var(--accent);color:var(--accent)}
  .fs-btn svg{width:15px;height:15px}
  .fs-btn.light{background:rgba(255,255,255,.14);border-color:rgba(255,255,255,.25);color:#fff}
  .fs-btn.light:hover{background:rgba(255,255,255,.24)}
  .fs-overlay{position:fixed;inset:0;background:#0B2436;z-index:120;display:none;flex-direction:column}
  .fs-overlay.open{display:flex}
  .fs-head{display:flex;align-items:center;justify-content:space-between;padding:14px 20px;background:var(--ink-2);color:#fff;flex:none}
  .fs-head b{font-family:'Space Grotesk';font-size:15px}
  .fs-exit{display:flex;align-items:center;gap:8px;background:rgba(255,255,255,.14);color:#fff;border-radius:9px;padding:9px 15px;font-weight:600;font-size:13px;font-family:'Space Grotesk'}
  .fs-exit:hover{background:rgba(255,255,255,.24)}
  .fs-exit svg{width:16px;height:16px}
  .fs-body{flex:1;min-height:0;display:flex}
  .fs-body embed,.fs-body iframe{width:100%;height:100%;border:none}
  .fs-body .dt-preview{width:100%;height:100%;border-radius:0}

  /* ---- account menu ---- */
  .acct-wrap{position:relative}
  .acct-caret{margin-left:auto;color:var(--muted-2);transition:transform .18s}
  .acct-wrap.open .acct-caret{transform:rotate(180deg)}
  .acct-menu{position:absolute;bottom:calc(100% - 2px);left:12px;width:224px;background:var(--surface);border:1px solid var(--line);border-radius:12px;box-shadow:var(--shadow-lg);z-index:85;display:none;overflow:hidden;padding:6px}
  .acct-menu.open{display:block}
  .acct-menu a{display:flex;align-items:center;gap:11px;padding:9px 11px;border-radius:8px;font-size:13.5px;font-weight:500;color:var(--ink);cursor:pointer}
  .acct-menu a:hover{background:var(--surface-2)}
  .acct-menu a svg{width:16px;height:16px;color:var(--muted);flex:none}
  .acct-divider{height:1px;background:var(--line-2);margin:5px 4px}
  .side-foot{width:100%;text-align:left;cursor:pointer;background:none}
  .side-foot:hover{background:rgba(255,255,255,.04)}
  .app.rail .acct-caret{display:none}

  /* ---- settings permissions matrix ---- */
  .pmatrix{width:100%;border-collapse:collapse;font-size:13px}
  .pmatrix th{font-family:'Space Grotesk';font-size:11px;text-transform:uppercase;letter-spacing:.05em;color:var(--muted-2);font-weight:600;padding:0 12px 12px;text-align:center}
  .pmatrix th:first-child{text-align:left}
  .pmatrix td{padding:12px;border-top:1px solid var(--line-2);text-align:center}
  .pmatrix td:first-child{text-align:left;font-weight:600}
  .pm-y{color:var(--green)} .pm-y svg{width:17px;height:17px}
  .pm-v{color:var(--muted);font-size:11.5px;font-weight:600;font-family:'Space Grotesk'}
  .pm-n{color:#D4D9DE}

  /* ---- maintenance dashboard ---- */
  .kpi-grid{display:grid;grid-template-columns:repeat(6,1fr);gap:14px;margin-bottom:18px}
  .kpi{background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:14px 15px;box-shadow:var(--shadow)}
  .kpi .kv{font-family:'Space Grotesk';font-size:25px;font-weight:600;line-height:1}
  .kpi .kl{font-size:11px;color:var(--muted);margin-top:5px;line-height:1.25}
  .kpi .kt{font-size:10px;font-family:'Space Grotesk';font-weight:600;margin-top:8px;display:inline-block;padding:2px 7px;border-radius:6px}
  .kt.g{background:var(--green-bg);color:#1E7A43} .kt.a{background:var(--amber-bg);color:#9C6414} .kt.r{background:var(--red-bg);color:#A5322A}
  .mblocks{display:grid;grid-template-columns:1fr 1fr;gap:14px}
  .mblock{background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:15px 16px;box-shadow:var(--shadow);cursor:pointer;transition:.15s;display:flex;gap:12px;align-items:center}
  .mblock:hover{border-color:var(--accent);transform:translateY(-2px)}
  .mblock .mb-ico{width:38px;height:38px;border-radius:10px;background:var(--accent-tint);color:var(--accent-deep);display:grid;place-items:center;flex:none}
  .mblock .mb-ico svg{width:19px;height:19px}
  .mblock h3{font-family:'Space Grotesk';font-size:14px;margin:0 0 2px}
  .mblock p{font-size:12px;color:var(--muted);margin:0}
  .mblock .mb-n{font-family:'Space Grotesk';font-weight:600;font-size:13px;margin-left:auto;color:var(--ink-2);white-space:nowrap}

  /* ---- component modal ---- */
  .cmodal{width:740px;max-width:100%}
  .cm-tabs{display:flex;gap:0;padding:0 20px;border-bottom:1px solid var(--line);background:var(--surface);overflow-x:auto}
  .cm-tab{padding:13px 2px;margin-right:24px;font-weight:600;font-size:13.5px;color:var(--muted);border-bottom:2px solid transparent;margin-bottom:-1px;white-space:nowrap}
  .cm-tab.active{color:var(--ink);border-color:var(--accent)}
  .cm-pane{padding:18px 20px}
  .cm-pane[hidden]{display:none}
  .cm-gen{display:flex;gap:20px;flex-wrap:wrap}
  .cm-photo{width:230px;height:150px;border-radius:12px;background:linear-gradient(115deg,#0B2436,#155A66);display:grid;place-items:center;flex:none}
  .cm-photo svg{width:130px}
  .cm-det{flex:1;min-width:230px}
  .tk-row{display:flex;align-items:center;gap:12px;padding:12px 0;border-top:1px solid var(--line-2)}
  .tk-row:first-of-type{border-top:none}
  .tk-row .tk-nm{font-weight:600;font-size:13.5px}
  .tk-row .tk-sub{font-size:12px;color:var(--muted)}
  .addbtns{display:flex;gap:9px;margin-bottom:14px;flex-wrap:wrap}

  /* ---- log form ---- */
  .lf-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px 18px}
  .lf-field{display:flex;flex-direction:column;gap:5px}
  .lf-field.full{grid-column:1/-1}
  .lf-field label{font-size:11.5px;font-weight:600;color:var(--muted);font-family:'Space Grotesk';text-transform:uppercase;letter-spacing:.03em}
  .lf-field input,.lf-field select,.lf-field textarea{border:1px solid var(--line);border-radius:9px;padding:9px 11px;font-family:inherit;font-size:13.5px;outline:none;background:var(--surface);color:var(--ink)}
  .lf-field input:focus,.lf-field select:focus,.lf-field textarea:focus{border-color:var(--accent)}
  .lf-field input[readonly]{background:var(--surface-2);color:var(--muted)}
  .lf-parts{border:1px solid var(--line);border-radius:9px;overflow:hidden}
  .lf-part{display:flex;align-items:center;gap:11px;padding:9px 12px;border-top:1px solid var(--line-2);font-size:13px}
  .lf-part:first-child{border-top:none}
  .lf-part .cbx{width:20px;height:20px;border:1.5px solid var(--line);border-radius:6px;display:grid;place-items:center;cursor:pointer;flex:none}
  .lf-part .cbx.on{background:var(--green);border-color:var(--green)}
  .lf-part .cbx svg{width:13px;height:13px}
  .lf-part .qty{margin-left:auto;font-family:'IBM Plex Mono';color:var(--muted);font-size:12px}
  .lf-upload{border:1.5px dashed #C9D3DA;background:var(--surface-2);border-radius:9px;padding:15px;text-align:center;font-size:12.5px;color:var(--muted);cursor:pointer;display:flex;align-items:center;justify-content:center;gap:9px}
  .lf-upload:hover{border-color:var(--accent);color:var(--accent-deep)}
  .lf-upload svg{width:17px;height:17px}

  /* ---- SMS custom-section rich editor (Tiptap, Addition A follow-up 2026-09-07) ---- */
  #smsRichHost .ProseMirror{outline:none;font-size:13.5px;line-height:1.6;color:var(--ink);min-height:200px}
  #smsRichHost .ProseMirror p{margin:0 0 8px}
  #smsRichHost .ProseMirror h4{font-size:13px;margin:14px 0 6px;font-weight:700}
  #smsRichHost .ProseMirror ul,#smsRichHost .ProseMirror ol{margin:4px 0 8px;padding-left:22px}
  #smsRichHost .ProseMirror li{margin:2px 0}
  #smsRichHost .ProseMirror ul[data-type="taskList"]{list-style:none;padding-left:2px}
  #smsRichHost .ProseMirror ul[data-type="taskList"] li{display:flex;align-items:flex-start;gap:8px}
  #smsRichHost .ProseMirror ul[data-type="taskList"] li>label{flex:none;margin-top:3px}
  #smsRichHost .ProseMirror ul[data-type="taskList"] li>div{flex:1;min-width:0}
  #smsRichHost .ProseMirror table{border-collapse:collapse;margin:8px 0;width:100%}
  #smsRichHost .ProseMirror td,#smsRichHost .ProseMirror th{border:1px solid var(--line);padding:5px 8px;font-size:12.5px;text-align:left;min-width:60px}
  #smsRichHost .ProseMirror th{background:var(--surface-2);font-weight:600}
  #smsRichHost .ProseMirror img{max-width:100%;border-radius:8px;margin:6px 0}
  #smsRichToolbar .rowbtn{min-width:36px;justify-content:center}

  /* ---- do-job button ---- */
  .dojob{display:inline-flex;align-items:center;gap:6px;background:var(--ink);color:#fff;border-radius:8px;padding:6px 12px;font-weight:600;font-size:12.5px;font-family:'Space Grotesk'}
  .dojob:hover{background:var(--accent-deep)}
  .dojob svg{width:14px;height:14px}

  /* ---- components edit mode ---- */
  .comp-remove{width:22px;height:22px;border-radius:6px;background:var(--red-bg);color:var(--red);display:none;place-items:center;flex:none;cursor:pointer;margin-left:8px}
  .comp-remove svg{width:13px;height:13px}
  .tree.editing .comp-remove{display:grid}
  .comp-grip{color:var(--muted-2);cursor:grab;display:none;flex:none}
  .comp-grip svg{width:15px;height:15px}
  .tree.editing .comp-grip{display:inline-flex}
  .tree.editing .tparent,.tree.editing .tchild{background:linear-gradient(90deg,rgba(18,124,138,.04),transparent)}
  .edit-note{display:flex;align-items:center;gap:10px;background:var(--amber-bg);border:1px solid #F0D9B0;border-radius:11px;padding:11px 15px;margin-bottom:16px;font-size:12.5px;color:#8A5A12}
  .edit-note svg{width:18px;height:18px;flex:none}

  @media(max-width:1200px){.kpi-grid{grid-template-columns:repeat(3,1fr)}}
  @media(max-width:900px){.mblocks{grid-template-columns:1fr}}
  @media(max-width:600px){.kpi-grid{grid-template-columns:repeat(2,1fr)}.lf-grid{grid-template-columns:1fr}}

  /* fix: edit note only in edit mode */
  .edit-note[hidden]{display:none}

  /* segmented control */
  .seg{display:flex;gap:8px;flex-wrap:wrap}
  .seg button{flex:1;min-width:130px;border:1px solid var(--line);background:var(--surface);border-radius:9px;padding:9px 12px;font-weight:600;font-size:12.5px;color:var(--muted);display:flex;align-items:center;justify-content:center;gap:7px;transition:.13s}
  .seg button svg{width:15px;height:15px}
  .seg button.on{border-color:var(--accent);background:var(--accent-tint);color:var(--accent-deep)}
  .seg button:hover{border-color:var(--accent)}
  .seg.small button{min-width:0}
  .contractor-fields{display:none;grid-column:1/-1}
  .contractor-fields.on{display:grid;grid-template-columns:1fr 1fr;gap:14px 18px}

  /* add-component form */
  .acsec{border-top:1px solid var(--line-2);padding-top:16px;margin-top:16px}
  .acsec.first{border-top:none;margin-top:0;padding-top:0}
  .acsec>h4{font-family:'Space Grotesk';font-size:12px;text-transform:uppercase;letter-spacing:.05em;color:var(--accent-deep);margin:0 0 12px}
  .chip-list{display:flex;flex-direction:column;gap:6px;margin-bottom:10px}
  .chip-list:empty{display:none}
  .chip-line{display:flex;align-items:center;gap:8px;font-size:13px;background:var(--surface-2);border:1px solid var(--line);border-radius:8px;padding:8px 11px}
  .chip-line .x{margin-left:auto;color:var(--muted-2);cursor:pointer;font-weight:700}
  .chip-row{display:flex;gap:8px}
  .chip-row input{flex:1;border:1px solid var(--line);border-radius:9px;padding:9px 11px;font-family:inherit;font-size:13px;outline:none}
  .chip-row input:focus{border-color:var(--accent)}
  .ac-photo{width:100%;height:140px;border:1.5px dashed #C9D3DA;background:var(--surface-2);border-radius:10px;display:grid;place-items:center;color:var(--muted);cursor:pointer;font-size:12.5px;overflow:hidden}
  .ac-photo img{width:100%;height:100%;object-fit:cover}

  /* ---- certificates ---- */
  .rowbtns{display:flex;gap:6px;justify-content:flex-end}
  .rowbtn{display:inline-flex;align-items:center;gap:6px;border:1px solid var(--line);background:var(--surface);border-radius:8px;padding:6px 10px;font-weight:600;font-size:12px;color:var(--ink-2);white-space:nowrap}
  .rowbtn:hover{border-color:var(--accent);color:var(--accent-deep)}
  .rowbtn svg{width:13px;height:13px}
  .rowbtn.prim{background:var(--ink);color:#fff;border-color:var(--ink)}
  .rowbtn.prim:hover{background:var(--accent-deep);color:#fff}
  .cat-head td{background:var(--surface-2);font-family:'Space Grotesk';font-weight:600;font-size:11.5px;text-transform:uppercase;letter-spacing:.05em;color:var(--muted);padding:9px 16px}
  .cat-head.inv-grp{cursor:pointer}
  .cat-head.inv-grp:hover td{background:var(--line)}
  .inv-chev{display:inline-flex;transition:transform .15s;vertical-align:middle;margin-right:3px;color:var(--muted-2)}
  .cat-head.collapsed .inv-chev{transform:rotate(-90deg)}
  .tag{display:inline-flex;align-items:center;gap:5px;font-size:10px;font-weight:600;font-family:'Space Grotesk';padding:2px 8px;border-radius:6px;text-transform:uppercase;letter-spacing:.03em}
  .tag.oneoff{background:var(--accent-tint);color:var(--accent-deep)}
  .tag.recur{background:#F3E7DC;color:#9A5A2B}
  .lf-check{display:flex;align-items:center;gap:8px}
  .lf-check input{flex:1}
  .lf-check .x{color:var(--muted-2);cursor:pointer;font-weight:700;padding:0 4px}
  .er-block{border:1px solid var(--line);border-radius:11px;padding:13px 15px;margin-bottom:12px;background:var(--surface-2)}
  .er-block>h4{font-family:'Space Grotesk';font-size:13px;margin:0 0 10px;display:flex;align-items:center;gap:8px}
  .er-note{display:flex;align-items:center;gap:10px;background:var(--surface-2);border:1px solid var(--line);border-radius:11px;padding:16px;font-size:13px;color:var(--muted);margin:6px 0}
  .cert-grip{position:absolute;left:8px;top:50%;transform:translateY(-50%);color:var(--muted-2);cursor:grab;display:none;align-items:center}
  .cert-grip svg{width:15px;height:15px}
  #certTable.editing td:first-child{position:relative;padding-left:34px}
  #certTable.editing .cert-grip{display:inline-flex}
  #certTable.editing .rowbtn{display:none}
  #certTable.editing tr[data-cat]{cursor:grab}
  #certTable tr.drag-src{opacity:.4}
  .cert-remove{width:26px;height:26px;border-radius:7px;background:var(--red-bg);color:var(--red);display:none;place-items:center;cursor:pointer;margin-left:auto}
  .cert-remove svg{width:14px;height:14px}
  #certTable.editing .cert-remove{display:grid}

  /* crew cards */
  .crew-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(270px,1fr));gap:14px}
  .crew-card{background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:16px;box-shadow:var(--shadow);cursor:pointer;transition:.15s}
  .crew-card:hover{border-color:var(--accent);transform:translateY(-2px)}
  .cc-top{display:flex;align-items:center;gap:12px;margin-bottom:10px}
  .cc-av{width:44px;height:44px;font-size:15px;border-radius:12px;flex:none}
  .cc-nm{font-family:'Space Grotesk';font-weight:600;font-size:15px}
  .cc-role{font-size:12.5px;color:var(--muted)}
  .cc-meta{font-size:12px;color:var(--muted);margin-bottom:10px}
  .cc-certs{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:12px;min-height:20px}
  .cc-foot{display:flex;align-items:center;justify-content:space-between;border-top:1px solid var(--line-2);padding-top:12px}
  .switch{position:relative;display:inline-block;width:42px;height:24px;flex:none}
  .switch input{opacity:0;width:0;height:0}
  .switch span{position:absolute;inset:0;background:var(--line);border-radius:20px;transition:.18s;cursor:pointer}
  .switch span::before{content:"";position:absolute;width:18px;height:18px;left:3px;top:3px;background:#fff;border-radius:50%;transition:.18s}
  .switch input:checked+span{background:var(--green)}
  .switch input:checked+span::before{transform:translateX(18px)}
  /* hours of rest ribbon + budget */
  .hor-ribbon{display:flex;gap:4px;margin:12px 0 14px}
  .hor-day{flex:1;height:36px;border-radius:6px;display:flex;flex-direction:column;align-items:center;justify-content:center;font-family:'Space Grotesk';font-weight:600;color:#fff;line-height:1.1}
  .hor-day b{font-size:9.5px}
  .hor-day small{font-size:8px;opacity:.9;font-weight:500}
  .hd-g{background:var(--green)} .hd-a{background:var(--amber)} .hd-r{background:var(--red)}
  .hor-budget{display:flex;flex-direction:column;gap:10px}
  .hb{display:flex;align-items:center;gap:10px;font-size:12px}
  .hb-l{width:130px;color:var(--muted)}
  .hb-bar{flex:1;height:8px;background:var(--line);border-radius:5px;position:relative;overflow:hidden}
  .hb-fill{height:100%;border-radius:5px}
  .hb-v{width:96px;text-align:right;font-family:'IBM Plex Mono';font-size:11.5px}
  .hor-legend{display:flex;gap:16px;font-size:12px;color:var(--muted);margin:2px 0 4px;flex-wrap:wrap}
  .hor-legend span{display:flex;align-items:center;gap:6px}
  .hor-legend i{width:11px;height:11px;border-radius:3px;display:inline-block}

  /* fleet */
  [hidden]{display:none!important}
  .fv-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:16px}
  .fv-card{background:var(--surface);border:1px solid var(--line);border-radius:16px;box-shadow:var(--shadow);cursor:pointer;transition:.15s;overflow:hidden}
  .fv-card:hover{border-color:var(--accent);transform:translateY(-3px)}
  .fv-photo{height:104px;background:linear-gradient(135deg,#0B2436,#0D5E69);position:relative;display:grid;place-items:center;color:#CFE3E7}
  .fv-photo .pill{position:absolute;top:10px;right:10px}
  .fv-body{padding:14px 16px}
  .fv-top{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px;gap:8px}
  .fv-nm{font-family:'Space Grotesk';font-weight:600;font-size:15.5px}
  .fv-rings{display:grid;grid-template-columns:repeat(5,1fr);gap:5px;margin-bottom:12px}
  .fleet-stats{grid-template-columns:repeat(4,1fr)!important;gap:12px!important}
  .fleet-stats .stat{padding:13px 14px}
  .fleet-stats .st-ico{width:30px;height:30px;border-radius:8px;margin-bottom:8px}
  .fleet-stats .st-ico svg{width:16px;height:16px}
  .fleet-stats .st-v{font-size:22px}
  .fleet-stats .st-l{font-size:11px;line-height:1.35}
  .ringwrap.clik{cursor:pointer;border-radius:9px;padding:3px 2px;transition:.13s}
  .ringwrap.clik:hover{background:var(--surface-2)}
  .ringwrap{display:flex;flex-direction:column;align-items:center;gap:4px}
  .ringbox{position:relative;width:46px;height:46px}
  .ring{width:46px;height:46px;transform:rotate(-90deg)}
  .ring circle{fill:none;stroke-width:4.5}
  .ring .rbg{stroke:var(--line)}
  .ring .rfg{stroke-linecap:round}
  .ringbox b{position:absolute;inset:0;display:grid;place-items:center;font-family:'Space Grotesk';font-size:11.5px}
  .ringwrap .rl{font-size:9px;color:var(--muted);text-transform:uppercase;letter-spacing:.03em;font-family:'Space Grotesk';font-weight:600;text-align:center}
  .fv-meta{display:flex;gap:14px;font-size:12px;color:var(--muted);border-top:1px solid var(--line-2);padding-top:11px;flex-wrap:wrap}
  .fv-meta b{color:var(--ink)}
  .back-fleet{color:#9DB4C0!important;font-size:12.5px!important;margin-bottom:6px}
  .back-fleet:hover{color:#fff!important}
  .tmx{width:100%;border-collapse:collapse;font-size:12.5px}
  .tmx th,.tmx td{padding:9px 10px;border-bottom:1px solid var(--line-2);text-align:center}
  .tmx th{font-family:'Space Grotesk';font-size:10.5px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted-2);font-weight:600}
  .tmx td:first-child,.tmx th:first-child{text-align:left}
  .tdot{display:inline-block;width:13px;height:13px;border-radius:50%}
  .tdot.g{background:var(--green)} .tdot.a{background:var(--amber)} .tdot.r{background:var(--red)} .tdot.n{background:var(--line)}
  .ob-note{display:flex;gap:10px;align-items:flex-start;background:var(--accent-tint);border:1px solid #CBE6E9;border-radius:10px;padding:12px 14px;font-size:12.5px;color:var(--accent-deep);margin-top:10px}
  .gauges{display:grid;grid-template-columns:repeat(5,1fr);gap:12px;margin-bottom:18px}
  /* onboarding vessel rows */
  .obv-row{border:1px solid var(--line);border-radius:11px;padding:12px 13px;margin-bottom:10px;background:var(--surface-2);position:relative}
  .obv-row .obv-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:9px}
  .obv-row .obv-n{font-family:'Space Grotesk';font-weight:600;font-size:12.5px;color:var(--accent-deep)}
  .obv-row .obv-del{background:none;border:none;color:var(--muted-2);cursor:pointer;padding:3px;border-radius:6px}
  .obv-row .obv-del:hover{color:var(--red);background:var(--red-bg)}
  .obv-grid{display:grid;grid-template-columns:1fr 1fr;gap:9px}
  .obv-grid .full{grid-column:1/-1}
  .obv-grid label{display:block;font-size:11px;font-weight:600;color:var(--muted);margin-bottom:4px;font-family:'Space Grotesk'}
  .obv-grid input,.obv-grid select{width:100%;padding:8px 10px;border:1px solid var(--line);border-radius:8px;font-size:12.5px;background:var(--surface);font-family:inherit;color:var(--ink)}
  @media(max-width:560px){.obv-grid{grid-template-columns:1fr}}

  /* ===== Fleet reporting ===== */
  .rep-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:16px;margin-top:18px}
  .rep-card{background:var(--surface);border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow);padding:0;overflow:hidden}
  .rep-h{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:14px 16px;border-bottom:1px solid var(--line-2);flex-wrap:wrap}
  .rep-h h3{margin:0;font-family:'Space Grotesk';font-size:14.5px;font-weight:600}
  .rep-tools{display:flex;align-items:center;gap:8px}
  .rep-seg{display:inline-flex;background:var(--surface-2);border-radius:8px;padding:2px}
  .rep-seg button{border:none;background:none;font:inherit;font-size:11.5px;font-weight:600;padding:4px 10px;border-radius:6px;cursor:pointer;color:var(--muted)}
  .rep-seg button.on{background:var(--surface);color:var(--accent-deep);box-shadow:0 1px 2px rgba(11,36,54,.12)}
  .rep-x{background:none;border:none;cursor:pointer;color:var(--muted-2);padding:4px;border-radius:6px}
  .rep-x:hover{background:var(--surface-2);color:var(--accent-deep)}
  .rep-body{padding:14px 16px}
  .rep-chart{width:100%;height:180px}
  .rep-bar{cursor:pointer;transition:opacity .12s}
  .rep-bar:hover{opacity:.75}
  .rep-lgd{display:flex;gap:14px;flex-wrap:wrap;font-size:11.5px;color:var(--muted);padding:0 16px 14px}
  .rep-lgd span{display:inline-flex;align-items:center;gap:5px}
  .rep-lgd i{width:10px;height:10px;border-radius:3px;display:inline-block}
  @media(max-width:820px){.rep-grid{grid-template-columns:1fr}}

  /* ===== Safety & Compliance hub block-buttons ===== */
  .sc-hub{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin:18px 0}
  .sc-blk{background:var(--surface);border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow);padding:16px;cursor:pointer;transition:.15s;text-align:left;display:flex;flex-direction:column;gap:12px;position:relative}
  .sc-blk:hover{border-color:var(--accent);transform:translateY(-2px)}
  .sc-blk .scb-top{display:flex;align-items:center;justify-content:space-between;gap:10px}
  .sc-blk .scb-ico{width:38px;height:38px;border-radius:10px;background:var(--accent-tint);color:var(--accent-deep);display:grid;place-items:center;flex:none}
  .sc-blk .scb-ico svg{width:20px;height:20px}
  .sc-blk .scb-nm{font-family:'Space Grotesk';font-weight:600;font-size:14.5px;line-height:1.2}
  .sc-blk .scb-sub{font-size:12px;color:var(--muted);margin-top:2px}
  .sc-blk .scb-foot{display:flex;align-items:center;justify-content:space-between;gap:8px;border-top:1px solid var(--line-2);padding-top:11px;margin-top:2px}
  .sc-blk .scb-count{font-family:'Space Grotesk';font-weight:600;font-size:20px}
  .scb-ring{position:relative;width:44px;height:44px;flex:none}
  .scb-ring svg{transform:rotate(-90deg)}
  .scb-ring .rt{position:absolute;inset:0;display:grid;place-items:center;font-family:'Space Grotesk';font-weight:600;font-size:12px}
  .sc-back{display:inline-flex;align-items:center;gap:6px;font-size:13px;color:var(--accent-deep);cursor:pointer;font-weight:600;margin-bottom:4px}
  .sc-back svg{width:16px;height:16px}
  @media(max-width:900px){.sc-hub{grid-template-columns:repeat(2,minmax(0,1fr))}}
  @media(max-width:560px){.sc-hub{grid-template-columns:1fr}}

  .dgauge{background:var(--surface);border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow);padding:16px;display:flex;align-items:center;gap:14px;cursor:pointer;transition:.15s}
  .dgauge:hover{border-color:var(--accent);transform:translateY(-2px)}
  .dgauge .gbox{position:relative;width:60px;height:60px;flex:none}
  .dgauge .gsvg{width:60px;height:60px;transform:rotate(-90deg)}
  .dgauge .gsvg circle{fill:none;stroke-width:6}
  .dgauge .gsvg .gbg{stroke:var(--line)}
  .dgauge .gsvg .gfg{stroke-linecap:round}
  .dgauge .gbox b{position:absolute;inset:0;display:grid;place-items:center;font-family:'Space Grotesk';font-size:14px;font-weight:600}
  .dgauge .gt{font-family:'Space Grotesk';font-weight:600;font-size:13.5px;margin-bottom:3px;color:var(--ink)}
  .dgauge .gs{font-size:11.5px;color:var(--muted);line-height:1.35}
  .dgauge .gcount{position:absolute;inset:0;display:grid;place-items:center;font-family:'Space Grotesk';font-size:17px;font-weight:600}
  .la-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:11px}
  .la{display:flex;align-items:center;gap:12px;background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:14px;cursor:pointer;text-align:left;transition:.15s;font-family:inherit}
  .la:hover{border-color:var(--accent);background:var(--accent-tint)}
  .la-ic{width:36px;height:36px;border-radius:10px;display:grid;place-items:center;background:var(--accent-tint);color:var(--accent-deep);flex:none}
  .la-ic svg{width:19px;height:19px}
  .la b{font-family:'Space Grotesk';font-size:13.5px;display:block;line-height:1.2}
  .la span{font-size:11.5px;color:var(--muted)}
  .cd-tiles{display:grid;grid-template-columns:repeat(2,1fr);gap:16px}
  .cd-tile{background:var(--surface);border:1px solid var(--line);border-radius:16px;box-shadow:var(--shadow);padding:22px;cursor:pointer;transition:.15s}
  .cd-tile:hover{border-color:var(--accent);transform:translateY(-3px)}
  .cd-ic{width:44px;height:44px;border-radius:12px;display:grid;place-items:center;background:var(--accent-tint);color:var(--accent-deep);margin-bottom:14px}
  .cd-tile h3{font-family:'Space Grotesk';font-size:17px;margin:0 0 5px}
  .cd-tile p{font-size:13px;color:var(--muted);margin:0 0 14px;line-height:1.45}
  .cd-stats{display:flex;gap:18px;border-top:1px solid var(--line-2);padding-top:13px}
  .cd-st b{display:block;font-family:'Space Grotesk';font-size:19px}
  .cd-st span{font-size:11px;color:var(--muted)}
  .vy-timeline{position:relative;padding-left:26px}
  .vy-timeline:before{content:"";position:absolute;left:8px;top:6px;bottom:6px;width:2px;background:var(--line)}
  .vy-ev{position:relative;padding:11px 0;border-bottom:1px solid var(--line-2)}
  .vy-ev:last-child{border-bottom:none}
  .vy-ev:before{content:"";position:absolute;left:-22px;top:16px;width:10px;height:10px;border-radius:50%;background:var(--accent);border:2px solid var(--surface);box-shadow:0 0 0 2px var(--line)}
  .vy-ev.r:before{background:var(--red)} .vy-ev.a:before{background:var(--amber)} .vy-ev.g:before{background:var(--green)}
  .vy-t{font-size:11.5px;color:var(--muted-2);font-family:'IBM Plex Mono'}
  .vy-n{font-family:'Space Grotesk';font-weight:600;font-size:13.5px;margin:2px 0}
  .vy-s{font-size:12px;color:var(--muted)}
  .pob-row{display:flex;align-items:center;justify-content:space-between;padding:10px 0;border-bottom:1px solid var(--line-2);font-size:13px}
  .pob-row:last-child{border-bottom:none}
  .pob-tag{font-size:10.5px;padding:2px 8px;border-radius:6px;background:var(--accent-tint);color:var(--accent-deep);font-weight:600;font-family:'Space Grotesk'}
  .pob-tag.pax{background:var(--amber-bg);color:var(--amber)}
  .pob-tag.ind{background:var(--copper-bg,#F6EAE2);color:var(--copper)}
  .pob-tag.con{background:var(--surface-2);color:var(--muted)}
  .amend{background:var(--amber-bg);border-left:3px solid var(--amber);border-radius:0 8px 8px 0;padding:9px 12px;margin-top:8px;font-size:12px}
  .amend b{font-family:'Space Grotesk';display:block;font-size:11px;text-transform:uppercase;letter-spacing:.04em;color:var(--amber);margin-bottom:3px}
  .amend .orig{color:var(--muted);text-decoration:line-through}
  .locked-note{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--muted);background:var(--surface-2);border:1px solid var(--line);border-radius:8px;padding:9px 12px;margin-top:10px}
  .cl-card{background:var(--surface);border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow);padding:16px 18px;cursor:pointer;transition:.15s}
  .cl-card:hover{border-color:var(--accent);transform:translateY(-2px)}
  .cl-top{display:flex;justify-content:space-between;align-items:flex-start;gap:10px;margin-bottom:12px}
  .cl-nm{font-family:'Space Grotesk';font-weight:600;font-size:15px}
  .cl-sub{font-size:12px;color:var(--muted);margin-top:2px}
  .plan{font-size:10.5px;padding:3px 9px;border-radius:6px;font-weight:600;font-family:'Space Grotesk';white-space:nowrap}
  .plan.std{background:var(--surface-2);color:var(--muted)}
  .plan.enh{background:var(--accent-tint);color:var(--accent-deep)}
  .plan.ycht{background:var(--copper-bg,#F6EAE2);color:var(--copper)}
  .cl-kpis{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;border-top:1px solid var(--line-2);padding-top:12px}
  .cl-k b{display:block;font-family:'Space Grotesk';font-size:16px}
  .cl-k span{font-size:10.5px;color:var(--muted)}
  .hbar{height:6px;border-radius:4px;background:var(--line);overflow:hidden;margin-top:9px}
  .hbar i{display:block;height:100%;border-radius:4px}
  .spark{display:flex;align-items:flex-end;gap:2px;height:30px}
  .spark i{flex:1;background:var(--accent-tint);border-radius:2px 2px 0 0;min-height:2px}
  .spark i.hi{background:var(--accent)}
  .usebar{display:flex;align-items:center;gap:10px;padding:9px 0;border-bottom:1px solid var(--line-2);font-size:13px}
  .usebar:last-child{border-bottom:none}
  .usebar .ub{flex:1;height:8px;background:var(--line);border-radius:5px;overflow:hidden}
  .usebar .ub i{display:block;height:100%;background:var(--accent);border-radius:5px}
  .full{grid-column:1/-1}
  /* finance */
  .fin-jump{display:grid;grid-template-columns:repeat(auto-fit,minmax(148px,1fr));gap:12px}
  .fj{display:flex;flex-direction:column;gap:9px;background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:14px 16px;cursor:pointer;box-shadow:var(--shadow);transition:.15s}
  .fj:hover{border-color:var(--accent);transform:translateY(-2px)}
  .fj-ic{width:34px;height:34px;border-radius:9px;display:grid;place-items:center;background:var(--accent-tint);color:var(--accent-deep)}
  .fj-t{font-family:'Space Grotesk';font-weight:600;font-size:13.5px}
  .fj-s{font-size:11.5px;color:var(--muted)}
  .cf-chart{display:flex;align-items:flex-end;gap:10px;height:172px;padding:12px 4px 0}
  .cf-col{flex:1;display:flex;flex-direction:column;align-items:center;gap:7px;height:100%;justify-content:flex-end}
  .cf-bars{display:flex;gap:4px;align-items:flex-end;height:100%;width:100%;justify-content:center}
  .cf-bar{width:14px;border-radius:4px 4px 0 0}
  .cf-m{font-size:11px;color:var(--muted)}
  .fin-list-row{display:flex;align-items:center;justify-content:space-between;padding:11px 0;border-bottom:1px solid var(--line-2);font-size:13px}
  .fin-list-row:last-child{border-bottom:none}
  .bank-acct{display:flex;align-items:center;justify-content:space-between;padding:14px 18px;border-bottom:1px solid var(--line-2)}
  .recon-dot{font-size:11px;padding:2px 9px;border-radius:6px;background:var(--amber-bg);color:var(--amber);font-weight:600;font-family:'Space Grotesk'}
  .recon-dot.ok{background:var(--green-bg);color:var(--green)}
  .doc-sub td{background:var(--surface);font-family:'Space Grotesk';font-weight:600;font-size:12px;color:var(--ink);padding:8px 16px 8px 36px;cursor:pointer;border-top:1px solid var(--line-2)}
  .doc-sub:hover td{background:var(--surface-2)}
  .doc-sub .inv-chev{color:var(--muted-2)}
  .doc-row td:first-child{padding-left:48px!important}

  /* ==================== RESPONSIVE ==================== */
  .tscroll{overflow-x:auto;-webkit-overflow-scrolling:touch;max-width:100%}
  .scrim{position:fixed;inset:0;background:rgba(6,20,28,.5);z-index:44;opacity:0;pointer-events:none;transition:opacity .2s}
  .scrim.on{opacity:1;pointer-events:auto}

  /* ---- tablet & below: sidebar becomes a drawer ---- */
  @media(max-width:1024px){
    .app{grid-template-columns:1fr!important}
    .app.rail{grid-template-columns:1fr!important}
    .sidebar{position:fixed;top:0;left:0;bottom:0;width:264px;height:100dvh;z-index:45;transform:translateX(-100%);transition:transform .22s ease;box-shadow:0 0 40px rgba(0,0,0,.35)}
    .sidebar.open{transform:translateX(0)}
    #railToggle{display:none!important}
    #burger{display:grid!important}
    .topbar{padding:0 14px;gap:10px}
    .search{width:auto;flex:1;min-width:0}
    .search span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
    .page{padding:20px 18px 60px}
    .dash-grid{grid-template-columns:1fr}
    .comp-grid{grid-template-columns:repeat(2,1fr)}
    .fleet-stats{grid-template-columns:repeat(2,1fr)!important}
    .gauges{grid-template-columns:repeat(2,minmax(0,1fr))}
    .cd-tiles{grid-template-columns:1fr}
    .fv-grid{grid-template-columns:repeat(auto-fill,minmax(280px,1fr))}
    .cf-chart{height:150px}
  }

  /* ---- phone ---- */
  @media(max-width:640px){
    .topbar{height:56px;padding:0 12px;gap:8px}
    .search{display:none}
    .topbar .btn-ghost span,.topbar .btn-primary span{display:none}
    .topbar .btn-ghost,.topbar .btn-primary{padding:9px 12px;font-size:12.5px;white-space:nowrap}
    /* "Do a checklist" is reachable from the vessel menu; drop it on phones to fit the theme toggle */
    .topbar > .btn-ghost,#vesselTopActions > .btn-ghost{display:none}
    #themeToggle{flex:none}
    .crumbs{font-size:12.5px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
    .page{padding:16px 13px 78px}
    h1{font-size:22px!important}
    .page-head{flex-direction:column;align-items:stretch;gap:12px;margin-bottom:16px}
    .page-head p{font-size:12.5px}
    .head-actions{flex-wrap:wrap}
    .head-actions>button,.head-actions>span>button{flex:1;justify-content:center;min-width:calc(50% - 5px)}
    /* Real root cause of the dashboard/compliance "reserved margin" overflow the user
       found on their S20 (not the co-pilot after all — confirmed via a live DOM walk that
       traced the overflowing element to a card's OWN header): .card-h is a bare
       justify-content:space-between flex row with no wrap, so a title sharing space with a
       status pill + action button (e.g. the Survey cycle card) doesn't fit at 360px and
       pushes content wide instead of wrapping — same class of fix .page-head already got. */
    .card-h{flex-wrap:wrap;row-gap:8px}

    /* one column everywhere */
    .comp-grid,.gauges,.fv-grid,.cd-tiles,.la-grid,.fin-jump,.api-grid,.rep-grid{grid-template-columns:1fr!important}
    .fleet-stats{grid-template-columns:repeat(2,1fr)!important}
    .lf-grid{grid-template-columns:1fr!important}
    .crew-grid{grid-template-columns:1fr!important}
    .tank-grid{grid-template-columns:repeat(2,1fr)!important}

    /* stats & gauges compact */
    .stat{padding:13px 14px}
    .st-v{font-size:22px}
    .dgauge{padding:13px}
    .fleet-stats .st-v{font-size:19px}
    .fleet-stats .st-l{font-size:10.5px}

    /* fleet tiles: keep the 4 rings but tighter */
    .fv-rings{gap:2px}
    .ringbox,.ring{width:42px;height:42px}
    .ringwrap .rl{font-size:8.5px}

    /* tables scroll sideways rather than squash */
    .tscroll table{min-width:600px}
    .tmx{min-width:560px}
    .tabs{overflow-x:auto;white-space:nowrap;-webkit-overflow-scrolling:touch;scrollbar-width:none}
    .tabs::-webkit-scrollbar{display:none}
    .tabs .tab{flex:none}
    th,td{padding:11px 12px;font-size:12.5px}
    .rowbtns{flex-wrap:nowrap}
    .rowbtn{padding:6px 9px;font-size:11.5px}

    /* notification panel + account menu behave like sheets, not off-screen popovers */
    .notif-panel{position:fixed!important;top:auto!important;bottom:0!important;left:0!important;right:0!important;width:100%!important;max-width:100%!important;border-radius:16px 16px 0 0;max-height:80dvh;overflow-y:auto;z-index:80}
    #acctMenu{position:fixed!important;left:12px!important;right:12px!important;width:auto!important;bottom:78px!important;top:auto!important}

    /* modals become sheets */
    .modal-bg{align-items:flex-end;padding:0}
    .modal,.cmodal{width:100%!important;max-width:100%!important;border-radius:18px 18px 0 0;max-height:92dvh}
    .modal-b{padding:16px 15px 22px}
    .modal-h{padding:15px}
    .seg{flex-wrap:wrap}
    .seg button{flex:1 0 45%;font-size:12.5px;padding:9px 8px}

    /* grids must be allowed to shrink (1fr defaults to minmax(auto,1fr) and blows out) */
    .cal-grid{grid-template-columns:repeat(7,minmax(0,1fr))!important;gap:3px;padding:8px 10px 14px}
    #calCells{grid-template-columns:repeat(7,minmax(0,1fr))!important;gap:3px}
    .meters{grid-template-columns:1fr!important;padding:4px 14px 16px}
    .tabs{width:100%!important;max-width:100%}
    .comp-grid,.gauges,.fv-grid,.cd-tiles,.la-grid,.fin-jump,.dash-grid,.crew-grid{grid-template-columns:minmax(0,1fr)!important}
    .fleet-stats,.tank-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
    .lf-grid{grid-template-columns:minmax(0,1fr)!important}
    .fv-rings{grid-template-columns:repeat(5,minmax(0,1fr))}

    /* misc */
    .cal-cell{height:60px;font-size:11px;padding:4px;overflow-y:auto;overflow-x:hidden}
    .cal-cell .d{font-size:11px}
    .cal-ev{font-size:9.5px;padding:1px 4px}
    .nmea{flex-wrap:wrap;gap:14px!important}
    .copilot-fab{bottom:16px;right:14px;padding:10px 11px}
    .cf-txt{display:none}
    .cp-panel{width:100%;right:0;bottom:0;height:82dvh;border-radius:16px 16px 0 0}
    .hor-day{width:9px}
    .vy-timeline{padding-left:22px}
    .subtabs{overflow-x:auto;white-space:nowrap;-webkit-overflow-scrolling:touch}
    .subtab{flex:none}
    .g-wrap,.gantt{overflow-x:auto}
    .fj,.la{padding:12px}
    /* Survey-cycle timeline: absolutely-positioned nodes with nowrap labels have no room
       to reflow at phone width — contained horizontal scroll (same pattern as .tscroll
       tables) rather than squeezing/overlapping the node labels. */
    .survey{overflow-x:auto;-webkit-overflow-scrolling:touch;padding:20px 16px 22px}
    .survey-track{min-width:1040px}
    /* Sub-menu bar (injectSubtabs(), shared.js): a flex-wrap pill list of every sibling
       page reads fine on desktop but wraps into a tall multi-row block at phone width —
       10 items measured at 243px tall, pushing real page content far down. Compact
       single-row scrolling tab-strip instead, same overflow-x pattern .subtabs already
       uses elsewhere — not a new component, reusing the established convention. */
    .subtab-bar{flex-wrap:nowrap;overflow-x:auto;-webkit-overflow-scrolling:touch;scrollbar-width:none}
    .subtab-bar::-webkit-scrollbar{display:none}
    .subtab-bar a{flex:none}
    /* SMS Builder two-column layout collapses to one, step rail on top — same treatment
       as every other desktop 2-column page layout at this breakpoint. */
    .smsb-layout{grid-template-columns:minmax(0,1fr)}
  }
  @media(max-width:400px){
    .fleet-stats{grid-template-columns:1fr!important}
    .head-actions>button{min-width:100%}
  }

  @media print{
    .sidebar,.topbar,.copilot-fab,#cpPanel,#notifPanel,#acctMenu,.head-actions,.cal-nav,#utcClock{display:none!important}
    .main{margin-left:0!important}
    body{background:#fff}
    .card{box-shadow:none;border-color:#ccc}
    .view[hidden]{display:none!important}
  }
  /* gantt */
  .gantt{min-width:620px}
  .g-head,.g-row{display:flex;align-items:center;border-bottom:1px solid var(--line-2)}
  .g-head{border-bottom:1px solid var(--line)}
  .g-lbl-h,.g-lbl{width:190px;flex:none;font-size:12px;padding:9px 12px 9px 0}
  .g-lbl-h{color:var(--muted-2);font-family:'Space Grotesk';font-weight:600;text-transform:uppercase;letter-spacing:.04em;font-size:11px}
  .g-lbl{font-weight:500;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .g-axis{flex:1;display:flex}
  .g-tick{font-size:10.5px;color:var(--muted-2);border-left:1px solid var(--line-2);padding:6px 0 6px 6px}
  .g-track{flex:1;position:relative;height:36px}
  .g-bar{position:absolute;top:8px;height:20px;border-radius:5px;display:flex;align-items:center;padding:0 8px;font-size:10.5px;color:#fff;font-weight:600;white-space:nowrap;overflow:hidden;box-shadow:0 1px 2px rgba(11,36,54,.18);min-width:20px}
  @media(max-width:1000px){
    .app{grid-template-columns:1fr}
    .sidebar{position:fixed;left:-260px;z-index:100;transition:left .2s}
    .sidebar.open{left:0}
    .dash-grid{grid-template-columns:1fr}
    .readiness{grid-template-columns:repeat(2,1fr)}
    .comp-grid{grid-template-columns:1fr}
    .hero-vessel{display:none}
    .search{display:none}
  }
