
    :root {
      --navy: #0B3251;
      --blue: #1F80C4;
      --red: #CE3143;
      --red-soft: #FDECEE;
      --amber: #B86A00;
      --amber-soft: #FFF4E0;
      --ok: #1F7A4D;
      --ok-soft: #E8F6EE;
      --bg: #E8EEF3;
      --card: #FFFFFF;
      --ink: #0B3251;
      --muted: #5B6E7D;
      --line: #D3DCE4;
      --shadow: 0 1px 3px rgba(11,50,81,.08);
      --tap: 44px;
    }
    * { box-sizing: border-box; }
    html, body { margin: 0; padding: 0; background: #C5D0DA; color: var(--ink);
      font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
      -webkit-font-smoothing: antialiased; }
    body { min-height: 100vh; }
    .stage {
      min-height: 100vh;
      display: flex;
      flex-direction: column;
      align-items: center;
      padding: 16px 12px 24px;
    }
    .preview-note {
      width: 390px;
      max-width: 100%;
      font-size: 12px;
      color: #31485A;
      margin: 0 0 8px;
      line-height: 1.4;
    }
    .phone {
      width: 390px;
      max-width: 100%;
      height: 844px;
      min-height: 844px;
      max-height: 844px;
      background: var(--bg);
      border: 1px solid #9AADB8;
      border-radius: 28px;
      overflow: hidden;
      box-shadow: 0 12px 40px rgba(11,50,81,.18);
      display: flex;
      flex-direction: column;
      position: relative;
    }
    header.app-bar {
      background: var(--navy);
      color: #fff;
      padding: 12px 16px 14px;
      display: flex;
      align-items: center;
      gap: 10px;
      min-height: 64px;
      flex-shrink: 0;
    }
    header.app-bar img.logo {
      height: 28px;
      width: auto;
      max-width: 160px;
      object-fit: contain;
      background: #fff;
      border-radius: 4px;
      padding: 3px 6px;
      flex-shrink: 0;
    }
    header.app-bar .titles { min-width: 0; flex: 1; }
    header.app-bar h1 {
      margin: 0;
      font-size: 16px;
      font-weight: 700;
      letter-spacing: .01em;
      line-height: 1.2;
      overflow-wrap: anywhere;
    }
    header.app-bar p {
      margin: 2px 0 0;
      font-size: 12px;
      color: #C9D7E3;
      line-height: 1.3;
      overflow-wrap: anywhere;
    }
    header.app-bar button.linkish {
      background: transparent;
      border: 0;
      color: #fff;
      font-size: 13px;
      font-weight: 600;
      padding: 8px 4px;
      min-height: var(--tap);
      cursor: pointer;
      flex-shrink: 0;
    }
    .sample-banner {
      background: #FFF4E0;
      color: #6A3E00;
      font-size: 11px;
      line-height: 1.35;
      padding: 7px 16px;
      border-bottom: 1px solid #F0D39A;
      flex-shrink: 0;
    }
    main {
      flex: 1;
      min-height: 0;
      padding: 12px 14px 88px;
      overflow-x: hidden;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
    }
    h2 { margin: 0 0 8px; font-size: 18px; line-height: 1.3; overflow-wrap: anywhere; }
    .lede { margin: 0 0 16px; font-size: 14px; color: var(--muted); line-height: 1.45; overflow-wrap: anywhere; }
    .who-grid { display: grid; gap: 10px; }
    .who-btn {
      display: flex; align-items: center; gap: 12px;
      background: var(--card); border: 1px solid var(--line);
      border-radius: 14px; padding: 14px 14px;
      min-height: 68px; width: 100%; text-align: left;
      cursor: pointer; box-shadow: var(--shadow);
      color: var(--ink); font: inherit;
    }
    .who-btn:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
    .who-btn .avatar {
      width: 44px; height: 44px; border-radius: 50%;
      background: var(--navy); color: #fff;
      display: flex; align-items: center; justify-content: center;
      font-weight: 700; font-size: 16px; flex-shrink: 0;
    }
    .who-btn.office .avatar { background: var(--blue); }
    .who-btn .meta { min-width: 0; }
    .who-btn .meta strong { display: block; font-size: 16px; overflow-wrap: anywhere; }
    .who-btn .meta span { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }

    .cat {
      margin: 18px 0 8px;
      font-size: 12px; font-weight: 700; letter-spacing: .04em;
      text-transform: uppercase; color: var(--blue);
    }
    .cat:first-child { margin-top: 4px; }
    .item-row {
      background: var(--card);
      border: 1px solid var(--line);
      border-radius: 12px;
      padding: 10px 10px 10px 12px;
      margin: 0 0 8px;
      box-shadow: var(--shadow);
    }
    .item-row.low { border-color: #E8C070; background: #FFFaf0; }
    .item-row.out { border-color: #E8A0A8; background: var(--red-soft); }
    .item-row .top { display: flex; gap: 8px; align-items: flex-start; }
    .item-row .name {
      flex: 1; min-width: 0;
      font-size: 14px; font-weight: 650; line-height: 1.3;
      overflow-wrap: anywhere;
    }
    .pill {
      flex-shrink: 0;
      font-size: 11px; font-weight: 700;
      padding: 3px 8px; border-radius: 999px;
      line-height: 1.2; white-space: nowrap;
    }
    .pill.ok { background: var(--ok-soft); color: var(--ok); }
    .pill.low { background: var(--amber-soft); color: var(--amber); }
    .pill.out { background: var(--red-soft); color: var(--red); }
    .item-row .sub {
      margin: 3px 0 8px;
      font-size: 12px; color: var(--muted); line-height: 1.35;
      overflow-wrap: anywhere;
    }
    .stepper {
      display: flex; align-items: center; gap: 8px;
    }
    .stepper button {
      width: var(--tap); height: var(--tap);
      border-radius: 10px; border: 0; cursor: pointer;
      font-size: 22px; font-weight: 700; line-height: 1;
      flex-shrink: 0;
    }
    .stepper button.minus { background: var(--navy); color: #fff; }
    .stepper button.plus { background: var(--blue); color: #fff; }
    .stepper button:disabled { opacity: .35; cursor: default; }
    .stepper .qty {
      min-width: 48px; text-align: center;
      font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums;
    }
    .stepper .unit {
      font-size: 11px; color: var(--muted); margin-left: 2px;
      overflow-wrap: anywhere; max-width: 110px; line-height: 1.2;
    }

    .van-summary {
      display: grid;
      grid-template-columns: 1fr 1fr 1fr;
      gap: 8px;
      margin: 0 0 14px;
    }
    .van-card {
      background: var(--card);
      border: 1px solid var(--line);
      border-radius: 12px;
      padding: 10px 8px;
      text-align: center;
      box-shadow: var(--shadow);
      min-width: 0;
    }
    .van-card h3 { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
    .van-card .reg { font-size: 10px; color: var(--muted); margin: 2px 0 6px; overflow-wrap: anywhere; line-height: 1.3; }
    .van-card .stat { font-size: 12px; line-height: 1.35; overflow-wrap: anywhere; }
    .van-card .stat strong { font-size: 16px; display: block; }
    .van-card .stat.bad strong { color: var(--red); }
    .van-card .stat.warn strong { color: var(--amber); }

    .table-wrap {
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
      border: 1px solid var(--line);
      border-radius: 12px;
      background: var(--card);
      margin-bottom: 12px;
    }
    table.grid {
      border-collapse: collapse;
      width: 100%;
      min-width: 360px;
      font-size: 12px;
    }
    table.grid th, table.grid td {
      padding: 8px 6px;
      text-align: center;
      border-bottom: 1px solid var(--line);
      vertical-align: middle;
      font-variant-numeric: tabular-nums;
    }
    table.grid th {
      background: var(--navy); color: #fff;
      font-weight: 650; font-size: 11px;
      position: sticky; top: 0;
    }
    table.grid th.item, table.grid td.item {
      text-align: left;
      padding-left: 10px;
      width: 42%;
      overflow-wrap: anywhere;
      line-height: 1.3;
    }
    table.grid tr.low td { background: var(--amber-soft); }
    table.grid tr.out td { background: var(--red-soft); }
    table.grid td.bad { color: var(--red); font-weight: 700; }
    table.grid td.warn { color: var(--amber); font-weight: 700; }
    table.grid caption {
      caption-side: top; text-align: left;
      font-size: 12px; color: var(--muted);
      padding: 0 0 6px; background: transparent;
    }

    .group { margin: 0 0 16px; }
    .group h3 {
      margin: 0 0 8px; font-size: 15px;
      padding: 6px 0; border-bottom: 2px solid var(--blue);
      overflow-wrap: anywhere;
    }
    .reorder-row {
      background: var(--card);
      border: 1px solid var(--line);
      border-radius: 12px;
      padding: 10px 12px;
      margin: 0 0 8px;
      box-shadow: var(--shadow);
    }
    .reorder-row h4 { margin: 0 0 4px; font-size: 14px; line-height: 1.3; overflow-wrap: anywhere; }
    .reorder-row p { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.4; overflow-wrap: anywhere; }
    .need {
      margin-top: 6px; font-size: 13px; font-weight: 700; color: var(--red);
      overflow-wrap: anywhere;
    }
    .empty {
      background: var(--ok-soft); color: var(--ok);
      padding: 14px; border-radius: 12px; font-size: 14px; line-height: 1.4;
    }

    .transfer-bar {
      background: var(--card);
      border: 1px solid var(--line);
      border-radius: 12px;
      padding: 12px;
      margin: 0 0 14px;
      box-shadow: var(--shadow);
    }
    .transfer-bar label {
      display: block; font-size: 12px; font-weight: 650; margin: 0 0 6px;
    }
    select, input[type="number"] {
      width: 100%;
      min-height: var(--tap);
      border: 1px solid var(--line);
      border-radius: 10px;
      padding: 8px 10px;
      font: inherit; font-size: 15px;
      background: #fff; color: var(--ink);
    }
    .send-btn {
      margin-top: 8px;
      width: 100%;
      min-height: var(--tap);
      background: var(--blue); color: #fff;
      border: 0; border-radius: 10px;
      font-weight: 700; font-size: 15px; cursor: pointer;
    }
    .send-btn:disabled { opacity: .4; cursor: default; background: var(--navy); }
    .toast {
      position: absolute; left: 16px; right: 16px; bottom: 80px;
      background: var(--navy); color: #fff;
      padding: 12px 14px; border-radius: 12px;
      font-size: 13px; line-height: 1.35;
      overflow-wrap: anywhere;
      box-shadow: 0 8px 24px rgba(11,50,81,.3);
      z-index: 20;
      display: none;
    }
    .toast.show { display: block; }

    nav.tabbar {
      position: absolute; left: 0; right: 0; bottom: 0;
      background: #fff;
      border-top: 1px solid var(--line);
      display: grid;
      grid-template-columns: 1fr 1fr 1fr;
      padding: 4px 4px 10px;
      z-index: 10;
    }
    nav.tabbar button {
      background: none; border: 0; cursor: pointer;
      min-height: 52px; font: inherit;
      font-size: 11px; font-weight: 650; color: var(--muted);
      padding: 6px 4px; line-height: 1.2;
      overflow-wrap: anywhere;
    }
    nav.tabbar button.active { color: var(--navy); }
    nav.tabbar button span { display: block; font-size: 16px; margin-bottom: 2px; }

    .hidden { display: none !important; }
    footer.legal {
      width: 390px; max-width: 100%;
      font-size: 11px; color: #3E5463;
      margin-top: 10px; line-height: 1.4;
    }
  
/* Live app shell (not the phone preview frame) */
html, body { height: 100%; }
body.app {
  margin: 0;
  background: #e8eef3;
  min-height: 100%;
}
.app-shell {
  max-width: 1100px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg, #e8eef3);
  position: relative;
}
.app-shell header.app-header {
  position: sticky;
  top: 0;
  z-index: 5;
}
.app-shell main {
  flex: 1;
  overflow: auto;
  padding-bottom: 96px;
}
.app-shell nav#office-nav {
  position: relative;
  bottom: auto;
  left: auto;
  right: auto;
}
.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(11,50,81,.08);
}
.login-card label { display: block; font-weight: 600; color: var(--navy); margin: 12px 0 6px; }
.login-card input[type=email] {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border: 1px solid #c5d0da;
  border-radius: 10px;
  font: inherit;
  color: var(--navy);
}
.btn-primary {
  display: block;
  width: 100%;
  margin-top: 16px;
  background: var(--blue);
  color: #fff;
  border: 0;
  border-radius: 12px;
  padding: 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.btn-primary:disabled { opacity: .6; }
.flash { margin-top: 12px; padding: 10px 12px; border-radius: 10px; }
.flash.ok { background: #e7f6ed; color: #146c2e; }
.flash.err { background: #fde8ea; color: var(--red); }
.hidden { display: none !important; }
.desk-note { display: none; }
@media (min-width: 800px) {
  .app-shell { min-height: 100vh; box-shadow: 0 0 0 1px #d5dee6; }
  .desk-note { display: block; color: var(--muted); font-size: 13px; margin: 0 20px 8px; }
}

body.app { background: var(--bg); }
.app-shell {
  position: relative;
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 0 1px var(--line);
}
.app-shell header.app-bar,
.app-shell .sample-banner { flex-shrink: 0; }
.app-shell main {
  flex: 1;
  min-height: 0;
  padding: 12px 14px 88px;
  overflow-y: auto;
}
.login-card label { display: block; font-size: 12px; font-weight: 650; margin: 12px 0 6px; }
.login-card input[type=email] {
  width: 100%; min-height: var(--tap);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 10px; font: inherit; font-size: 15px;
}
.flash { margin-top: 12px; padding: 10px 12px; border-radius: 10px; font-size: 14px; }
.flash.ok { background: var(--ok-soft); color: var(--ok); }
.flash.err { background: var(--red-soft); color: var(--red); }
@media (min-width: 900px) {
  body.app { background: #c5d0da; }
  .app-shell { max-width: 980px; min-height: 100vh; }
}


/* Live app: tab bar is part of the column, not absolutely placed, so the list
   scrolls in main and the bar stays on screen. */
.app-shell {
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}
.app-shell nav.tabbar,
.app-shell nav#office-nav {
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  flex-shrink: 0;
}
.app-shell nav.tabbar.hidden { display: none !important; }

/* Desktop: keep the dashboard table as one grid. overflow-x + sticky
   <th> was splitting the header from the body on wide screens. */
.app-shell table.grid {
  width: 100%;
  table-layout: fixed;
}
.app-shell table.grid thead { display: table-header-group; }
.app-shell table.grid tbody { display: table-row-group; }
.app-shell table.grid th { position: static; }
.app-shell .table-wrap { overflow-x: visible; }
@media (max-width: 600px) {
  .app-shell .table-wrap { overflow-x: auto; }
  .app-shell table.grid { table-layout: auto; min-width: 360px; }
  .app-shell table.grid th { position: sticky; top: 0; }
}


.van-pick-list { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
button.van-pick {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  width: 100%; text-align: left;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px; font: inherit; color: var(--navy); cursor: pointer;
}
button.van-pick strong { font-size: 18px; }
button.van-pick span { color: var(--muted); font-size: 13px; }
button.van-pick:disabled { opacity: .5; cursor: default; }
button.van-pick:not(:disabled):hover { border-color: var(--blue); }
.van-card label.assign { display: block; margin-top: 10px; font-size: 12px; font-weight: 650; color: var(--muted); }
.van-card label.assign select {
  display: block; width: 100%; margin-top: 4px;
  min-height: 40px; border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 8px; font: inherit; color: var(--navy); background: #fff;
}
