[hidden] { display: none !important; }
:root {
  --navy-900: #0f1b3d;
  --navy-800: #142950;
  --navy-700: #1e3a5f;
  --navy-500: #3b6fa0;
  --mist: #e8edf3;
  --mist-2: #f4f6f9;
  --white: #ffffff;
  --ink: #13213a;
  --muted: #6e7787;
  --line: rgba(15,27,61,.11);
  --green: #2e7d5b;
  --green-bg: #e8f4ed;
  --amber: #9a650f;
  --amber-bg: #fff4d9;
  --shadow: 0 10px 30px rgba(15,27,61,.09);
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin:0; color:var(--ink); background:var(--mist-2); font-family:"DM Sans", system-ui, sans-serif; overflow:hidden; }
button, input, select, textarea { font:inherit; }
button { cursor:pointer; }
.app-shell { height:100vh; display:grid; grid-template-columns:264px minmax(0,1fr); }
.sidebar { background:linear-gradient(180deg,#0d2147 0%,#0f1b3d 100%); color:#fff; padding:18px 14px 14px; display:flex; flex-direction:column; min-height:0; box-shadow: 8px 0 28px rgba(15,27,61,.08); z-index:20; }
.brand { display:flex; align-items:center; gap:10px; padding:4px 8px 22px; border-bottom:1px solid rgba(255,255,255,.12); }
.brand-mark { width:42px; height:42px; border-radius:9px; object-fit:cover; object-position:center; filter:contrast(1.05); }
.brand-name { font-family:"Space Grotesk"; font-size:17px; font-weight:700; letter-spacing:-.02em; }
.brand-sub { font-family:"Space Grotesk"; font-size:9px; letter-spacing:.17em; opacity:.65; margin-top:2px; }
.side-section { margin-top:18px; }
.side-label { padding:0 8px 7px; font-family:"Space Grotesk"; font-size:10px; font-weight:600; letter-spacing:.11em; color:rgba(255,255,255,.58); }
.side-label-row { display:flex; align-items:center; justify-content:space-between; }
.vessel-card { width:100%; display:grid; grid-template-columns:28px 1fr 18px; align-items:center; gap:8px; padding:10px 10px; border:1px solid rgba(255,255,255,.13); border-radius:9px; background:rgba(59,111,160,.22); color:white; text-align:left; }
.vessel-card strong, .user-card strong { display:block; font-size:12px; font-weight:600; }
.vessel-card small, .user-card small { display:block; margin-top:2px; color:rgba(255,255,255,.57); font-size:10px; }
.vessel-icon { font-size:21px; opacity:.9; }
.chevron { opacity:.6; }
.icon-btn { border:0; width:24px; height:24px; border-radius:5px; display:grid; place-items:center; font-size:17px; line-height:1; }
.icon-btn.light { color:white; background:rgba(255,255,255,.1); }
.icon-btn.light:hover { background:rgba(255,255,255,.18); }
.deck-nav { display:flex; flex-direction:column; gap:3px; }
.deck-link { width:100%; display:grid; grid-template-columns:22px minmax(0,1fr) auto; gap:7px; align-items:center; padding:8px 9px; color:rgba(255,255,255,.76); border:0; background:transparent; border-radius:7px; text-align:left; font-size:12px; transition:.15s ease; }
.deck-link:hover { background:rgba(255,255,255,.07); color:white; }
.deck-link.active { background:#215b98; color:#fff; box-shadow:inset 3px 0 0 #79b7f1; }
.deck-link .count { min-width:20px; padding:1px 5px; border-radius:10px; text-align:center; font-size:9px; background:rgba(255,255,255,.12); }
.deck-link.active .count { background:rgba(255,255,255,.2); }
.deck-icon { opacity:.75; }
.quick-section { padding-top:4px; border-top:1px solid rgba(255,255,255,.1); }
.side-action { width:100%; display:flex; gap:9px; align-items:center; color:rgba(255,255,255,.66); padding:7px 9px; border:0; background:transparent; border-radius:6px; text-align:left; font-size:11px; }
.side-action:hover { background:rgba(255,255,255,.07); color:#fff; }
.sidebar-spacer { flex:1; min-height:10px; }
.workspace-summary { border:1px solid rgba(255,255,255,.12); background:rgba(255,255,255,.045); border-radius:9px; padding:10px 11px; margin:8px 0 10px; }
.summary-row { display:flex; justify-content:space-between; align-items:center; font-size:10px; color:rgba(255,255,255,.58); padding:2px 0; }
.summary-row strong { color:white; font-size:11px; }
.user-card { border-top:1px solid rgba(255,255,255,.12); padding:12px 5px 2px; display:grid; grid-template-columns:35px 1fr 20px; gap:8px; align-items:center; }
.avatar { width:34px; height:34px; display:grid; place-items:center; border-radius:50%; background:#3b6fa0; font-size:10px; font-weight:700; }
.workspace { min-width:0; height:100vh; display:flex; flex-direction:column; overflow:hidden; }
.topbar { height:66px; flex:0 0 66px; background:white; border-bottom:1px solid var(--line); padding:0 24px; display:flex; align-items:center; gap:18px; z-index:10; }
.mobile-menu { display:none; }
.search-wrap { width:min(590px,45vw); position:relative; margin-right:auto; }
.search-wrap input { width:100%; border:1px solid var(--line); background:#f8fafc; border-radius:8px; padding:10px 70px 10px 38px; outline:none; font-size:13px; color:var(--ink); transition:.15s; }
.search-wrap input:focus { background:white; border-color:rgba(59,111,160,.6); box-shadow:0 0 0 3px rgba(59,111,160,.09); }
.search-icon { position:absolute; left:13px; top:8px; color:#6d7789; font-size:20px; z-index:2; }
kbd { position:absolute; right:10px; top:9px; font-family:"DM Sans"; color:#7a8391; background:#fff; border:1px solid var(--line); border-radius:5px; font-size:10px; padding:2px 6px; box-shadow:0 1px 0 rgba(15,27,61,.08); }
.search-results { position:absolute; top:46px; left:0; right:0; max-height:410px; overflow:auto; background:white; border:1px solid var(--line); border-radius:10px; box-shadow:var(--shadow); z-index:60; padding:6px; }
.search-empty { padding:20px 14px; text-align:center; color:var(--muted); font-size:12px; }
.search-result { width:100%; border:0; background:white; display:grid; grid-template-columns:1fr auto; gap:10px; text-align:left; padding:10px 11px; border-radius:7px; color:var(--ink); }
.search-result:hover, .search-result.active { background:#f0f5fb; }
.search-result strong { display:block; font-size:12px; }
.search-result small { display:block; margin-top:2px; color:var(--muted); font-size:10px; }
.search-result .qty { align-self:center; background:#e7eff8; color:#255884; font-weight:700; font-size:10px; border-radius:10px; padding:3px 7px; }
.top-actions { display:flex; gap:9px; align-items:center; white-space:nowrap; }
.sync-pill { font-size:10px; color:#58706a; background:#f4f8f5; border:1px solid #e0ebe4; border-radius:15px; padding:6px 8px; }
.sync-dot { width:6px; height:6px; border-radius:50%; background:#4d9c71; display:inline-block; margin-right:5px; }
.primary-btn, .secondary-btn { min-height:36px; border-radius:7px; padding:0 14px; font-family:"Space Grotesk"; font-size:12px; font-weight:600; display:inline-flex; gap:6px; align-items:center; justify-content:center; }
.primary-btn { background:var(--navy-900); border:1px solid var(--navy-900); color:white; box-shadow:0 3px 9px rgba(15,27,61,.15); }
.primary-btn:hover { background:var(--navy-700); }
.secondary-btn { background:white; border:1px solid rgba(15,27,61,.18); color:var(--navy-900); }
.secondary-btn:hover { background:#f7f9fc; }
.page-head { flex:0 0 auto; display:flex; justify-content:space-between; gap:20px; align-items:end; padding:18px 25px 15px; border-bottom:1px solid var(--line); background:#f8fafc; }
.breadcrumb { display:flex; gap:7px; align-items:center; font-size:10px; color:#718095; margin-bottom:8px; }
.breadcrumb strong { color:#365f88; font-weight:600; }
.title-row { display:flex; align-items:center; gap:10px; }
h1 { font-family:"Space Grotesk"; margin:0; font-size:28px; letter-spacing:-.035em; color:var(--navy-900); }
.status-badge { font-size:9px; color:#2e694e; background:var(--green-bg); border:1px solid #cce4d7; border-radius:12px; padding:4px 8px; font-weight:600; }
.page-subtitle { margin:5px 0 0; color:#7b8492; font-size:11px; }
.head-stats { display:flex; gap:7px; }
.stat { min-width:82px; padding:8px 10px; background:white; border:1px solid var(--line); border-radius:8px; }
.stat span { display:block; font-family:"Space Grotesk"; color:#8790a0; font-size:8px; letter-spacing:.08em; }
.stat strong { display:block; margin-top:3px; font-family:"Space Grotesk"; color:var(--navy-900); font-size:16px; }
.content-grid { flex:1; min-height:0; display:grid; grid-template-columns:minmax(0,1fr) 350px; gap:14px; padding:14px 16px 16px; overflow:hidden; }
.plan-card, .inspector { background:white; border:1px solid var(--line); border-radius:10px; box-shadow:0 2px 9px rgba(15,27,61,.035); min-height:0; }
.plan-card { display:flex; min-width:0; flex-direction:column; overflow:hidden; }
.plan-toolbar { flex:0 0 46px; display:flex; align-items:center; justify-content:space-between; padding:0 12px 0 15px; border-bottom:1px solid var(--line); }
.legend { display:flex; align-items:center; gap:15px; color:#6f7989; font-size:10px; }
.legend span { display:flex; align-items:center; gap:6px; }
.legend-box { width:12px; height:9px; border-radius:2px; display:inline-block; }
.legend-box.mapped { border:1.5px solid #3b6fa0; background:rgba(59,111,160,.12); }
.legend-box.selected { border:1.5px solid #0f1b3d; background:rgba(15,27,61,.22); }
.plan-tools { display:flex; gap:4px; align-items:center; }
.tool-btn { border:1px solid var(--line); background:#fff; color:#38475e; border-radius:5px; width:29px; height:28px; font-weight:700; }
.tool-btn:hover { background:#f3f6f9; }
.tool-btn.wide { width:38px; font-size:9px; font-weight:600; }
.zoom-label { width:42px; text-align:center; color:#6e7888; font-size:9px; }
.mapping-banner { flex:0 0 38px; padding:0 13px; display:flex; align-items:center; justify-content:space-between; color:#704f12; background:#fff8e8; border-bottom:1px solid #f2dfae; font-size:10px; }
.mapping-banner button { border:0; background:transparent; color:#7a5717; font-weight:700; font-size:10px; }
.plan-viewport {
  flex:1; min-height:0; overflow:auto; background:#f4f6f8; position:relative; padding:34px;
  cursor:grab; overscroll-behavior:contain; scrollbar-gutter:stable; -webkit-overflow-scrolling:touch;
}
.plan-viewport.is-panning { cursor:grabbing; user-select:none; }
.deck-stage {
  width:100%; max-width:1150px; min-width:0; position:relative; margin:auto; background:white;
  box-shadow:0 2px 13px rgba(15,27,61,.08);
}
.deck-stage img { display:block; width:100%; height:auto; user-select:none; pointer-events:none; }
.overlay-layer { position:absolute; inset:0; touch-action:none; }
.plan-viewport.is-panning .overlay-layer { cursor:grabbing; }
.locker-zone { position:absolute; border:1.5px solid #3b6fa0; background:rgba(59,111,160,.12); border-radius:3px; cursor:pointer; transition:background .14s,border-color .14s,box-shadow .14s; min-width:7px; min-height:7px; }
.locker-zone::after { content:attr(data-label); position:absolute; left:0; top:-21px; max-width:180px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; background:rgba(15,27,61,.92); color:#fff; padding:2px 5px; border-radius:3px; font-size:8px; opacity:0; transform:translateY(2px); pointer-events:none; transition:.12s; z-index:6; }
.locker-zone:hover { background:rgba(59,111,160,.22); box-shadow:0 0 0 2px rgba(59,111,160,.12); }
.locker-zone:hover::after, .locker-zone.selected::after { opacity:1; transform:translateY(0); }
.locker-zone.selected { border:2px solid var(--navy-900); background:rgba(15,27,61,.22); box-shadow:0 0 0 4px rgba(59,111,160,.18); z-index:4; }
.locker-zone.pulse { animation:pulseZone 1.2s ease 2; }
@keyframes pulseZone { 0%,100%{box-shadow:0 0 0 4px rgba(59,111,160,.18)} 50%{box-shadow:0 0 0 12px rgba(59,111,160,.20)} }
.draft-zone { position:absolute; border:2px dashed #9a650f; background:rgba(255,193,71,.16); pointer-events:none; }
.mapping .overlay-layer { cursor:crosshair; }
.plan-footer { flex:0 0 36px; border-top:1px solid var(--line); display:flex; align-items:center; justify-content:space-between; padding:0 14px; color:#8b93a0; font-size:9px; }
.inspector { overflow:auto; display:flex; flex-direction:column; }
.inspector-empty { margin:auto; padding:42px 28px; text-align:center; color:#758091; }
.inspector-empty .empty-icon { width:52px; height:52px; display:grid; place-items:center; border-radius:14px; margin:0 auto 13px; background:#eff4fa; color:#3b6fa0; font-size:24px; }
.inspector-empty h3 { margin:0 0 6px; font-family:"Space Grotesk"; color:var(--navy-900); font-size:16px; }
.inspector-empty p { margin:0; font-size:11px; line-height:1.55; }
.inspector-head { padding:16px 17px 14px; border-bottom:1px solid var(--line); }
.inspector-kicker { color:#3b6fa0; font-family:"Space Grotesk"; font-size:9px; letter-spacing:.09em; font-weight:600; }
.inspector-title-row { display:flex; gap:8px; justify-content:space-between; align-items:start; margin-top:4px; }
.inspector-title-row h2 { margin:0; font-family:"Space Grotesk"; font-size:19px; letter-spacing:-.02em; color:var(--navy-900); }
.menu-btn { border:1px solid var(--line); background:white; border-radius:5px; width:28px; height:28px; color:#667185; }
.inspector-meta { margin-top:5px; color:#7d8796; font-size:10px; }
.inspector-actions { display:flex; gap:6px; padding:10px 17px; border-bottom:1px solid var(--line); }
.inspector-actions button { flex:1; }
.stock-summary { display:grid; grid-template-columns:repeat(3,1fr); gap:6px; padding:12px 17px; border-bottom:1px solid var(--line); }
.mini-stat { background:#f6f8fb; border-radius:7px; padding:8px 8px; }
.mini-stat span { display:block; color:#8a93a1; font-size:8px; }
.mini-stat strong { display:block; margin-top:2px; font-family:"Space Grotesk"; color:#1d3356; font-size:14px; }
.inspector-section { padding:14px 17px; }
.section-title-row { display:flex; justify-content:space-between; align-items:center; margin-bottom:8px; }
.section-title-row h3 { margin:0; font-family:"Space Grotesk"; color:#2c3d59; font-size:11px; letter-spacing:.03em; }
.add-link { border:0; background:transparent; color:#2f689b; font-weight:700; font-size:9px; }
.stock-list { display:flex; flex-direction:column; gap:6px; }
.stock-row { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px; padding:9px 9px; border:1px solid var(--line); border-radius:7px; background:white; }
.stock-row:hover { border-color:rgba(59,111,160,.3); }
.stock-name { min-width:0; cursor:pointer; }
.stock-name strong { display:block; font-size:11px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.stock-name small { display:block; margin-top:2px; color:#8a93a0; font-size:9px; }
.qty-control { display:flex; align-items:center; gap:3px; }
.qty-control button { width:23px; height:23px; border:1px solid var(--line); background:#f8fafc; border-radius:4px; color:#4e5a6c; }
.qty-control span { min-width:25px; text-align:center; font-weight:700; color:#203b60; font-size:10px; }
.stock-notes { padding:10px 17px 16px; border-top:1px solid var(--line); color:#7f8997; font-size:10px; line-height:1.5; }
.stock-empty { border:1px dashed #d5dbe3; border-radius:8px; padding:18px 12px; text-align:center; color:#8b94a1; font-size:10px; }
.danger-link { width:100%; border:0; border-top:1px solid var(--line); background:#fff; color:#a54a48; padding:11px 17px; text-align:left; font-size:10px; margin-top:auto; }
.toast { position:fixed; left:50%; bottom:24px; transform:translate(-50%,12px); opacity:0; pointer-events:none; color:white; background:#14284c; padding:9px 14px; border-radius:7px; box-shadow:var(--shadow); font-size:11px; z-index:100; transition:.2s; }
.toast.show { opacity:1; transform:translate(-50%,0); }
.modal-backdrop { position:fixed; inset:0; z-index:90; display:grid; place-items:center; background:rgba(10,20,40,.42); backdrop-filter:blur(2px); padding:20px; }
.modal { width:min(520px,96vw); max-height:88vh; overflow:auto; background:white; border-radius:11px; box-shadow:0 24px 70px rgba(15,27,61,.28); }
.modal-head { display:flex; justify-content:space-between; gap:16px; align-items:start; padding:18px 20px 14px; border-bottom:1px solid var(--line); }
.modal-head h2 { margin:2px 0 0; font-family:"Space Grotesk"; color:var(--navy-900); font-size:20px; }
.eyebrow { color:#3b6fa0; font-family:"Space Grotesk"; font-size:9px; font-weight:700; letter-spacing:.1em; }
.modal-close { border:0; background:transparent; color:#7d8694; font-size:24px; line-height:1; }
.modal-body { padding:16px 20px 6px; }
.modal-actions { display:flex; justify-content:flex-end; gap:8px; padding:12px 20px 18px; }
.form-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.field { margin-bottom:12px; }
.field.full { grid-column:1/-1; }
.field label { display:block; margin-bottom:5px; color:#42516a; font-family:"Space Grotesk"; font-size:10px; font-weight:600; }
.field input, .field select, .field textarea { width:100%; border:1px solid rgba(15,27,61,.15); border-radius:6px; padding:9px 10px; outline:none; color:var(--ink); background:white; font-size:12px; }
.field textarea { min-height:78px; resize:vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color:#6090bc; box-shadow:0 0 0 3px rgba(59,111,160,.09); }
.field-help { margin-top:5px; color:#8a93a0; font-size:9px; line-height:1.4; }
.file-drop { border:1px dashed #bdc8d5; background:#f8fafc; border-radius:8px; padding:14px; }
.full-ga-modal img { width:100%; height:auto; display:block; border:1px solid var(--line); }
.confirm-copy { color:#5f6a7a; font-size:12px; line-height:1.55; }
@media (max-width:1100px) {
  .content-grid { grid-template-columns:minmax(0,1fr) 310px; }
  .sync-pill { display:none; }
  .head-stats .stat { min-width:68px; }
}
@media (max-width:900px) {
  body { overflow:auto; }
  .app-shell { grid-template-columns:1fr; min-height:100vh; height:auto; }
  .sidebar { position:fixed; inset:0 auto 0 0; width:264px; transform:translateX(-100%); transition:.2s; z-index:80; }
  .sidebar.open { transform:translateX(0); }
  .workspace { height:auto; min-height:100vh; overflow:visible; }
  .mobile-menu { display:inline-grid; place-items:center; width:34px; height:34px; border:1px solid var(--line); background:white; border-radius:6px; }
  .topbar { position:sticky; top:0; padding:0 14px; }
  .search-wrap { width:auto; flex:1; }
  .top-actions .secondary-btn { display:none; }
  .page-head { padding:16px; align-items:start; }
  .head-stats { display:none; }
  .content-grid { grid-template-columns:1fr; overflow:visible; padding:10px; }
  .plan-card { height:65vh; min-height:520px; }
  .inspector { min-height:330px; }
  .plan-viewport { padding:20px; }
}
@media (max-width:600px) {
  .top-actions .primary-btn { width:38px; padding:0; font-size:0; }
  .top-actions .primary-btn span { font-size:18px; }
  kbd { display:none; }
  .search-wrap input { padding-right:10px; }
  .page-subtitle { display:none; }
  .page-head { padding-bottom:12px; }
  h1 { font-size:23px; }
  .plan-card { height:57vh; min-height:450px; }
  .legend span:last-child { display:none; }
  .plan-footer span:last-child { display:none; }
  .form-grid { grid-template-columns:1fr; }
}

.danger-inline { border:0; background:transparent; color:#a54a48; padding:3px 0 9px; font-size:10px; font-weight:600; }
.danger-inline:hover { text-decoration:underline; }

/* Flexible locker mapping: rectangle or point-linked polygon */
.mapping-banner { gap:12px; }
.mapping-copy { min-width:0; line-height:1.35; }
.mapping-actions { display:flex; align-items:center; gap:8px; flex:0 0 auto; }
.mapping-actions button { padding:4px 7px; border-radius:5px; }
.mapping-actions button:disabled { opacity:.38; cursor:not-allowed; }
.mapping-actions .mapping-finish { background:#9a650f; color:#fff; padding:5px 9px; }

.polygon-layer,
.draft-polygon-layer { position:absolute; inset:0; width:100%; height:100%; overflow:visible; pointer-events:none; }
.locker-polygon {
  pointer-events:all; cursor:pointer; fill:rgba(59,111,160,.12); stroke:#3b6fa0; stroke-width:1.5px;
  vector-effect:non-scaling-stroke; transition:fill .14s,stroke .14s,stroke-width .14s;
}
.locker-polygon:hover { fill:rgba(59,111,160,.22); stroke-width:2px; }
.locker-polygon.selected { fill:rgba(15,27,61,.22); stroke:#0f1b3d; stroke-width:2.5px; }
.locker-polygon:focus-visible { outline:none; stroke:#0f1b3d; stroke-width:3px; }
.locker-polygon.pulse { animation:pulsePolygon 1.2s ease 2; }
@keyframes pulsePolygon { 0%,100%{stroke-width:2.5px;fill:rgba(15,27,61,.22)} 50%{stroke-width:7px;fill:rgba(59,111,160,.28)} }
.locker-polygon-label {
  position:absolute; z-index:7; transform:translateY(-22px); max-width:180px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  background:rgba(15,27,61,.92); color:#fff; padding:2px 5px; border-radius:3px; font-size:8px; opacity:0; pointer-events:none;
  transition:opacity .12s,transform .12s;
}
.locker-polygon-label.visible,
.locker-polygon-label.selected { opacity:1; transform:translateY(-24px); }

.draft-polygon-line { fill:rgba(255,193,71,.14); stroke:#9a650f; stroke-width:2px; stroke-dasharray:7 5; vector-effect:non-scaling-stroke; }
.draft-point { fill:#fff; stroke:#9a650f; stroke-width:2px; vector-effect:non-scaling-stroke; }
.draft-point.first { fill:#9a650f; stroke:#fff; stroke-width:2px; }
.mapping-polygon .overlay-layer { cursor:crosshair; }

.mapping-choice-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; padding:2px 0 10px; }
.mapping-choice {
  min-height:150px; border:1px solid var(--line); border-radius:10px; background:#fff; padding:17px; text-align:left;
  display:flex; flex-direction:column; gap:15px; color:var(--navy-900); transition:border-color .14s,box-shadow .14s,background .14s;
}
.mapping-choice:hover { border-color:rgba(59,111,160,.55); background:#f8fbff; box-shadow:0 8px 22px rgba(15,27,61,.08); }
.mapping-choice > span:last-child { display:flex; flex-direction:column; gap:5px; }
.mapping-choice strong { font-family:"Space Grotesk"; font-size:14px; }
.mapping-choice small { color:#747e8d; font-size:10px; line-height:1.45; }
.mapping-choice-icon { width:54px; height:44px; display:block; position:relative; }
.rectangle-icon { border:2px solid #3b6fa0; background:rgba(59,111,160,.10); border-radius:4px; }
.polygon-icon { border:2px solid #3b6fa0; background:rgba(59,111,160,.10); clip-path:polygon(8% 72%,28% 8%,90% 20%,76% 88%,30% 94%); }
.polygon-icon i { position:absolute; width:7px; height:7px; border-radius:50%; background:#0f1b3d; }
.polygon-icon i:nth-child(1){left:5px;top:27px}.polygon-icon i:nth-child(2){left:13px;top:2px}.polygon-icon i:nth-child(3){right:2px;top:7px}.polygon-icon i:nth-child(4){right:8px;bottom:1px}

@media (max-width:640px) {
  .mapping-choice-grid { grid-template-columns:1fr; }
  .mapping-banner { min-height:48px; height:auto; flex-basis:auto; padding:7px 10px; align-items:flex-start; }
  .mapping-actions { gap:4px; }
}

/* Account + cloud workspace */
.auth-gate { min-height:100vh; display:grid; grid-template-columns:minmax(360px,1.05fr) minmax(420px,.95fr); background:#f7f9fc; }
.auth-brand-panel { position:relative; overflow:hidden; min-height:100vh; padding:48px clamp(34px,6vw,88px); color:#fff; background:linear-gradient(145deg,#0b1c3d 0%,#102951 52%,#1e4f7c 100%); display:flex; flex-direction:column; }
.auth-brand-panel::after { content:""; position:absolute; width:520px; height:520px; right:-220px; bottom:-190px; border:1px solid rgba(255,255,255,.10); border-radius:50%; box-shadow:0 0 0 80px rgba(255,255,255,.025),0 0 0 160px rgba(255,255,255,.018); }
.auth-brand-lockup { position:relative; z-index:1; display:flex; align-items:center; gap:14px; }
.auth-brand-lockup img { width:58px; height:58px; object-fit:cover; border-radius:13px; box-shadow:0 8px 26px rgba(0,0,0,.18); }
.auth-brand-name { font-family:"Space Grotesk"; font-size:22px; font-weight:700; letter-spacing:-.025em; }
.auth-brand-sub { margin-top:3px; font-family:"Space Grotesk"; font-size:9px; letter-spacing:.2em; opacity:.64; }
.auth-copy { position:relative; z-index:1; margin:auto 0 42px; max-width:610px; }
.auth-kicker { display:block; margin-bottom:13px; font-family:"Space Grotesk"; font-size:10px; font-weight:700; letter-spacing:.15em; color:#8fc2ef; }
.auth-copy h1 { color:#fff; font-size:clamp(36px,4.2vw,62px); line-height:1.02; letter-spacing:-.045em; max-width:600px; }
.auth-copy p { max-width:540px; margin:22px 0 0; color:rgba(255,255,255,.70); font-size:15px; line-height:1.7; }
.auth-feature-grid { position:relative; z-index:1; display:grid; grid-template-columns:repeat(3,1fr); gap:12px; }
.auth-feature-grid > div { min-height:92px; padding:15px; border:1px solid rgba(255,255,255,.12); border-radius:10px; background:rgba(255,255,255,.055); backdrop-filter:blur(8px); }
.auth-feature-grid strong { display:block; font-family:"Space Grotesk"; font-size:11px; color:#fff; }
.auth-feature-grid span { display:block; margin-top:6px; color:rgba(255,255,255,.55); font-size:9px; line-height:1.5; }
.auth-form-panel { min-height:100vh; display:grid; place-items:center; padding:38px; }
.auth-card { width:min(430px,100%); background:#fff; border:1px solid var(--line); border-radius:16px; padding:30px; box-shadow:0 20px 54px rgba(15,27,61,.10); }
.auth-card h2 { margin:7px 0 7px; font-family:"Space Grotesk"; color:var(--navy-900); font-size:25px; letter-spacing:-.035em; }
.auth-note { margin:0 0 22px; color:#778191; font-size:11px; line-height:1.62; }
.auth-note code { color:#315f8b; background:#eef4fa; padding:2px 5px; border-radius:4px; }
.auth-tabs { display:grid; grid-template-columns:1fr 1fr; gap:4px; padding:4px; margin-bottom:24px; background:#f0f3f7; border-radius:9px; }
.auth-tabs button { height:34px; border:0; border-radius:7px; background:transparent; color:#707b8c; font-family:"Space Grotesk"; font-size:11px; font-weight:600; }
.auth-tabs button.active { background:#fff; color:var(--navy-900); box-shadow:0 2px 8px rgba(15,27,61,.08); }
.auth-form { display:flex; flex-direction:column; gap:14px; }
.auth-form label { display:flex; flex-direction:column; gap:6px; color:#43516a; font-family:"Space Grotesk"; font-size:10px; font-weight:600; }
.auth-form input { width:100%; height:42px; padding:0 11px; border:1px solid rgba(15,27,61,.15); border-radius:7px; outline:none; color:var(--ink); background:#fff; font-family:"DM Sans"; font-size:12px; }
.auth-form input:focus { border-color:#6090bc; box-shadow:0 0 0 3px rgba(59,111,160,.09); }
.auth-submit { width:100%; min-height:42px; margin-top:3px; }
.auth-wide { width:100%; min-height:40px; }
.text-button { display:block; margin:14px auto 0; border:0; background:transparent; color:#3b6fa0; font-size:10px; font-weight:600; }
.text-button:hover { text-decoration:underline; }
.auth-message { padding:9px 10px; border-radius:7px; background:#fff4e8; border:1px solid #f0dcc4; color:#8a5a21; font-size:10px; line-height:1.45; }
.auth-message.success { background:#eaf5ee; border-color:#cde4d6; color:#2e694e; }
.auth-divider { display:flex; align-items:center; gap:10px; margin:18px 0; color:#a0a7b1; font-size:9px; }
.auth-divider::before,.auth-divider::after { content:""; height:1px; flex:1; background:var(--line); }
.auth-mini { margin:10px 0 0; text-align:center; color:#98a0ac; font-size:9px; line-height:1.5; }
.auth-loading { text-align:center; }
.loading-ring { width:32px; height:32px; margin:0 auto 14px; border:3px solid #e4e9ef; border-top-color:#3b6fa0; border-radius:50%; animation:authSpin .8s linear infinite; }
@keyframes authSpin { to { transform:rotate(360deg); } }
.auth-loading h2 { font-size:19px; }
.auth-loading p { margin:0; color:#8a93a0; font-size:10px; }
.user-card { width:100%; color:#fff; background:transparent; border-right:0; border-bottom:0; border-left:0; text-align:left; }
.user-card:hover { background:rgba(255,255,255,.05); }
.sync-pill.saving { color:#7b631e; background:#fff8e7; border-color:#f0dfb7; }
.sync-pill.saving .sync-dot { background:#cf9c36; animation:syncPulse 1s ease infinite; }
.sync-pill.offline { color:#8c4b48; background:#fff0ef; border-color:#efd2d0; }
.sync-pill.offline .sync-dot { background:#b85a54; }
@keyframes syncPulse { 50% { opacity:.35; } }
.empty-plan-message { position:absolute; inset:0; z-index:4; display:grid; place-items:center; align-content:center; text-align:center; padding:35px; background:#f7f9fb; color:#7d8795; }
.empty-plan-message .empty-icon { width:58px; height:58px; display:grid; place-items:center; margin:0 auto 12px; border-radius:14px; background:#eaf1f8; color:#3b6fa0; font-size:28px; }
.empty-plan-message h3 { margin:0; font-family:"Space Grotesk"; color:var(--navy-900); font-size:18px; }
.empty-plan-message p { max-width:340px; margin:7px auto 14px; font-size:10px; line-height:1.5; }
.account-grid { display:grid; gap:12px; }
.account-status { display:flex; align-items:center; gap:8px; padding:10px 11px; background:#f3f7f5; border:1px solid #dfe9e2; border-radius:7px; color:#50705f; font-size:10px; }
.account-status i { width:8px; height:8px; border-radius:50%; background:#4d9c71; }
.account-email { padding:9px 10px; background:#f7f9fb; border:1px solid var(--line); border-radius:7px; color:#677284; font-size:11px; }
.full-ga-upload { padding:28px 20px; border:1px dashed #bdc8d5; border-radius:9px; text-align:center; background:#f8fafc; }
.full-ga-upload p { margin:0 0 12px; color:#7a8494; font-size:10px; line-height:1.5; }

@media (max-width:900px) {
  .auth-gate { grid-template-columns:1fr; }
  .auth-brand-panel { min-height:auto; padding:28px 24px 32px; }
  .auth-copy { margin:55px 0 30px; }
  .auth-copy h1 { font-size:38px; }
  .auth-feature-grid { display:none; }
  .auth-form-panel { min-height:auto; padding:28px 18px 46px; }
}

/* Multi-user yacht workspaces */
.onboarding-choice-tabs { display:grid; grid-template-columns:1fr 1fr; gap:4px; padding:4px; margin:0 0 20px; background:#f0f3f7; border-radius:9px; }
.onboarding-choice-tabs button { height:36px; border:0; border-radius:7px; background:transparent; color:#707b8c; font-family:"Space Grotesk"; font-size:10px; font-weight:600; }
.onboarding-choice-tabs button.active { background:#fff; color:var(--navy-900); box-shadow:0 2px 8px rgba(15,27,61,.08); }
.modal.wide-modal { width:min(880px,96vw); }
.modal-divider { height:1px; background:var(--line); margin:16px 0; }
.workspace-switch-list { display:grid; gap:8px; }
.workspace-switch-card { width:100%; display:flex; align-items:center; justify-content:space-between; gap:14px; padding:12px 13px; border:1px solid var(--line); border-radius:8px; background:#fff; text-align:left; color:var(--navy-900); }
.workspace-switch-card:hover { border-color:#aebfd0; background:#f9fbfd; }
.workspace-switch-card.active { border-color:#6f98bc; background:#f2f7fb; box-shadow:inset 3px 0 #3b6fa0; }
.workspace-switch-card > span:first-child { min-width:0; display:grid; gap:3px; }
.workspace-switch-card strong { font-family:"Space Grotesk"; font-size:12px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.workspace-switch-card small { color:#7c8796; font-size:9px; }
.workspace-switch-card > span:last-child { flex:none; color:#507ba3; font-family:"Space Grotesk"; font-size:8px; font-weight:700; letter-spacing:.08em; }
.workspace-secondary-actions { display:flex; justify-content:flex-start; margin-top:12px; }
.crew-loading { padding:36px 0 42px; text-align:center; color:#7b8593; font-size:10px; }
.crew-access-card { display:grid; gap:19px; padding-bottom:8px; }
.join-code-box { display:flex; justify-content:space-between; gap:18px; align-items:center; padding:16px; border:1px solid #cdd9e5; border-radius:10px; background:linear-gradient(135deg,#f7fafc,#eef4f9); }
.join-code-box > div:first-child { display:grid; gap:4px; }
.crew-section-label { display:block; color:#6f7e91; font-family:"Space Grotesk"; font-size:8px; font-weight:700; letter-spacing:.13em; }
.join-code-digits { color:var(--navy-900); font-family:"Space Grotesk"; font-size:31px; line-height:1; letter-spacing:.16em; }
.join-code-box small { max-width:430px; color:#778494; font-size:9px; line-height:1.45; }
.join-code-actions { display:flex; gap:7px; flex-wrap:wrap; justify-content:flex-end; }
.access-explainer { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.access-explainer > div { padding:11px 12px; border:1px solid var(--line); border-radius:8px; background:#fafbfd; }
.access-explainer strong { display:block; margin-bottom:3px; color:var(--navy-900); font-family:"Space Grotesk"; font-size:9px; letter-spacing:.08em; }
.access-explainer span { color:#758091; font-size:9px; line-height:1.45; }
.crew-section-head { display:flex; align-items:flex-end; justify-content:space-between; gap:10px; margin-bottom:-10px; padding-top:3px; }
.crew-section-head h3 { margin:3px 0 0; color:var(--navy-900); font-family:"Space Grotesk"; font-size:14px; }
.crew-invite-form { display:grid; grid-template-columns:minmax(180px,1.35fr) minmax(150px,1fr) 130px auto; gap:8px; align-items:end; padding:12px; border:1px solid var(--line); border-radius:9px; background:#fafbfd; }
.crew-invite-form label,.crew-controls label { display:grid; gap:5px; color:#536176; font-family:"Space Grotesk"; font-size:8px; font-weight:600; }
.crew-invite-form input,.crew-invite-form select,.crew-controls input,.crew-controls select { height:36px; min-width:0; border:1px solid rgba(15,27,61,.15); border-radius:6px; padding:0 9px; outline:none; background:#fff; color:var(--ink); font-family:"DM Sans"; font-size:10px; }
.crew-invite-form input:focus,.crew-invite-form select:focus,.crew-controls input:focus,.crew-controls select:focus { border-color:#6090bc; box-shadow:0 0 0 3px rgba(59,111,160,.09); }
.crew-invite-form > button { height:36px; white-space:nowrap; }
.crew-list,.pending-invite-list { display:grid; gap:7px; }
.crew-row { display:grid; grid-template-columns:minmax(190px,1fr) minmax(390px,1.55fr); gap:12px; align-items:center; padding:11px 12px; border:1px solid var(--line); border-radius:9px; background:#fff; }
.crew-person { display:flex; gap:10px; align-items:center; min-width:0; }
.crew-avatar { width:34px; height:34px; flex:none; display:grid; place-items:center; border-radius:50%; background:#e9f0f7; color:#2d5d88; font-family:"Space Grotesk"; font-size:10px; font-weight:700; }
.crew-person > div:last-child { min-width:0; display:grid; gap:3px; }
.crew-person strong { color:var(--navy-900); font-size:11px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.crew-person small { color:#86909d; font-size:8px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.crew-controls { display:grid; grid-template-columns:minmax(130px,1fr) 116px auto auto; gap:7px; align-items:end; }
.crew-controls button { min-height:36px; align-self:end; white-space:nowrap; }
.crew-controls .danger-inline { margin:0; padding:0 7px; border:1px solid #edd1cf; border-radius:6px; background:#fff7f6; }
.pending-invite-row { display:flex; justify-content:space-between; gap:12px; align-items:center; padding:10px 12px; border:1px dashed #c9d2dc; border-radius:8px; background:#fbfcfd; }
.pending-invite-row > span { min-width:0; display:grid; gap:2px; }
.pending-invite-row strong { color:var(--navy-900); font-size:10px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.pending-invite-row small { color:#84909f; font-size:8px; }
.pending-invite-row .text-button { margin:0; flex:none; }
.invite-welcome { display:grid; gap:13px; }
.invite-welcome > p { margin:0; color:#697587; font-size:10px; line-height:1.55; }

@media (max-width:760px) {
  .join-code-box { align-items:flex-start; flex-direction:column; }
  .join-code-actions { justify-content:flex-start; }
  .access-explainer { grid-template-columns:1fr; }
  .crew-invite-form { grid-template-columns:1fr; align-items:stretch; }
  .crew-row { grid-template-columns:1fr; }
  .crew-controls { grid-template-columns:1fr 1fr; }
  .crew-controls label:first-child { grid-column:1/-1; }
  .join-code-digits { font-size:27px; }
}

/* SeaStowed department workspaces */
.department-bar {
  flex:0 0 auto; display:flex; align-items:center; justify-content:space-between; gap:14px;
  padding:9px 16px 0; background:#f8fafc;
}
.department-tabs { display:flex; align-items:center; gap:6px; min-width:0; overflow-x:auto; padding-bottom:1px; }
.department-tab {
  min-height:34px; border:1px solid var(--line); border-radius:8px; background:#fff; color:#5f6d81;
  padding:0 13px; display:inline-flex; align-items:center; gap:7px; white-space:nowrap;
  font-family:"Space Grotesk"; font-size:10px; font-weight:600;
}
.department-tab:hover { border-color:rgba(59,111,160,.35); background:#f7faff; color:#244d76; }
.department-tab.active { background:var(--navy-900); border-color:var(--navy-900); color:#fff; box-shadow:0 3px 9px rgba(15,27,61,.12); }
.department-tab .dept-count { min-width:19px; padding:1px 5px; border-radius:10px; text-align:center; background:#eef3f8; color:#47637f; font-size:8px; }
.department-tab.active .dept-count { background:rgba(255,255,255,.16); color:#fff; }
.department-context { color:#8490a0; font-size:9px; white-space:nowrap; }
.department-badge { display:inline-flex; align-items:center; gap:4px; margin-left:6px; padding:2px 6px; border-radius:10px; background:#edf3f9; color:#365f88; font-size:8px; font-weight:700; vertical-align:middle; }
.department-empty { margin:auto; max-width:360px; padding:30px 24px; text-align:center; color:#778292; }
.department-empty strong { display:block; margin-bottom:5px; color:var(--navy-900); font-family:"Space Grotesk"; font-size:15px; }

.crew-departments { grid-column:1/-1; display:flex; align-items:center; gap:7px; flex-wrap:wrap; padding-top:2px; }
.crew-departments > span { margin-right:3px; color:#536176; font-family:"Space Grotesk"; font-size:8px; font-weight:700; letter-spacing:.05em; }
.dept-check { position:relative; display:inline-flex !important; grid-auto-flow:column; align-items:center; justify-content:start; gap:5px !important; cursor:pointer; color:#5b687b !important; font-family:"DM Sans" !important; font-size:9px !important; font-weight:600 !important; }
.dept-check input { appearance:none; -webkit-appearance:none; width:15px !important; height:15px !important; min-width:15px !important; padding:0 !important; border:1px solid #bdc8d5 !important; border-radius:4px !important; background:#fff !important; }
.dept-check input:checked { background:var(--navy-900) !important; border-color:var(--navy-900) !important; box-shadow:inset 0 0 0 3px #fff !important; }
.dept-check input:disabled { opacity:.5; cursor:not-allowed; }
.crew-department-line { grid-column:1/-1; display:flex; align-items:center; gap:7px; flex-wrap:wrap; padding:3px 0 0; }
.crew-department-line > span { color:#7c8796; font-size:8px; }
.pending-invite-row small .department-badge { margin-left:3px; }

@media (max-width:900px) {
  .department-bar { position:sticky; top:66px; z-index:9; padding:8px 10px; border-bottom:1px solid var(--line); }
  .department-context { display:none; }
}
@media (max-width:600px) {
  .department-tab { padding:0 10px; min-height:32px; }
}


/* Inventory tags + minimum stock alerts */
.tags-browser-btn { min-height:36px; padding:0 11px; border:1px solid var(--line); border-radius:7px; background:#fff; color:#365f88; font-family:"Space Grotesk"; font-size:10px; font-weight:700; white-space:nowrap; }
.tags-browser-btn:hover { background:#f4f8fc; border-color:#b8c9da; }
.tag-chip-row { display:flex; flex-wrap:wrap; gap:4px; margin-top:6px; }
.tag-chip { border:1px solid #d6e1ec; background:#f3f7fb; color:#365f88; border-radius:12px; padding:2px 6px; font-size:8px; font-weight:700; }
.tag-chip:hover { background:#e8f1f8; border-color:#aebfd0; }
.min-qty-line { margin-top:5px; color:#8994a2; font-size:8px; }
.low-stock-row { border-color:#e4c38b; background:#fffaf1; }
.low-stock-pill { display:inline-block; color:#8a5a21; background:#fff0d8; border:1px solid #efd6ad; border-radius:8px; padding:1px 4px; font-size:7px; font-weight:800; letter-spacing:.05em; vertical-align:1px; }
.tag-browser-copy { margin:0 0 12px; color:#788493; font-size:10px; line-height:1.5; }
.tag-browser-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(135px,1fr)); gap:8px; padding-bottom:8px; }
.tag-browser-chip { min-height:48px; display:flex; align-items:center; justify-content:space-between; gap:9px; padding:9px 11px; border:1px solid var(--line); border-radius:8px; background:#fff; color:#365f88; text-align:left; }
.tag-browser-chip:hover { border-color:#9fb6cb; background:#f7faff; }
.tag-browser-chip span { min-width:0; overflow:hidden; text-overflow:ellipsis; font-size:10px; font-weight:700; }
.tag-browser-chip strong { min-width:24px; padding:3px 6px; border-radius:10px; background:#edf3f9; color:#47637f; text-align:center; font-size:9px; }
.low-stock-settings { padding:13px; border:1px solid var(--line); border-radius:9px; background:#fafbfd; }
.low-stock-settings > p { margin:0 0 11px; color:#6e7a8b; font-size:9px; line-height:1.55; }
.alert-dept-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; }
.alert-dept-card { min-width:0; padding:10px; border:1px solid #dfe5eb; border-radius:8px; background:#fff; }
.alert-dept-head { display:flex; align-items:center; justify-content:space-between; gap:6px; margin-bottom:8px; }
.alert-dept-head .department-badge { margin-left:0; }
.alert-dept-head small { color:#8a94a2; font-size:7px; }
.alert-recipient-grid { display:grid; gap:5px; }
.alert-recipient-check { display:grid; grid-template-columns:15px minmax(0,1fr); gap:7px; align-items:center; cursor:pointer; }
.alert-recipient-check input { appearance:none; -webkit-appearance:none; width:15px; height:15px; border:1px solid #bdc8d5; border-radius:4px; background:#fff; }
.alert-recipient-check input:checked { background:var(--navy-900); border-color:var(--navy-900); box-shadow:inset 0 0 0 3px #fff; }
.alert-recipient-check > span { min-width:0; display:grid; gap:1px; }
.alert-recipient-check strong { color:#43516a; font-size:8px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.alert-recipient-check small { color:#949ca7; font-size:7px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.low-stock-actions { display:flex; align-items:center; gap:10px; margin-top:11px; }
.low-stock-actions span { color:#738093; font-size:8px; }
@media (max-width:760px) { .alert-dept-grid { grid-template-columns:1fr; } .tags-browser-btn { display:none; } }

/* SeaStowed phone workspace — keeps the desktop layout unchanged. */
.sidebar-scrim,
.mobile-sheet-scrim,
.mobile-bottom-nav,
.mobile-inspector-close { display:none; }

@media (max-width:900px) {
  .sidebar { overflow-y:auto; -webkit-overflow-scrolling:touch; padding-bottom:calc(18px + env(safe-area-inset-bottom)); }
  .sidebar-scrim {
    position:fixed; inset:0; z-index:79; display:block; border:0; padding:0;
    background:rgba(8,17,35,.42); opacity:0; pointer-events:none; transition:opacity .18s ease;
  }
  .sidebar-scrim.show { opacity:1; pointer-events:auto; }
}

@media (max-width:760px) {
  html,body { height:100%; overscroll-behavior:none; }
  body { overflow:hidden; background:#eef2f6; }
  button { -webkit-tap-highlight-color:transparent; }

  .app-shell { height:100dvh; min-height:100dvh; overflow:hidden; grid-template-columns:1fr; }
  .workspace {
    height:100dvh; min-height:0; overflow:hidden;
    padding-bottom:calc(64px + env(safe-area-inset-bottom));
  }

  /* Compact, touch-friendly top chrome. */
  .topbar {
    position:relative; top:auto; height:56px; flex:0 0 56px; padding:0 9px; gap:8px;
    box-shadow:0 1px 8px rgba(15,27,61,.06);
  }
  .mobile-menu { width:42px; height:42px; flex:none; border-radius:9px; font-size:18px; }
  .search-wrap { min-width:0; width:auto; flex:1; }
  .search-wrap input {
    height:42px; padding:0 10px 0 38px; border-radius:9px; font-size:16px;
    background:#f5f7fa;
  }
  .search-icon { top:8px; left:12px; }
  .search-results {
    position:fixed; top:56px; left:8px; right:8px; max-height:min(62dvh,520px);
    border-radius:12px; z-index:88; box-shadow:0 18px 50px rgba(15,27,61,.2);
  }
  .search-result { min-height:56px; padding:11px 12px; }
  .search-result strong { font-size:13px; }
  .search-result small { font-size:10px; line-height:1.4; }
  .top-actions { display:none; }

  .page-head { flex:0 0 auto; padding:8px 11px 7px; gap:6px; align-items:center; }
  .breadcrumb,.page-subtitle,.head-stats { display:none; }
  .title-row { width:100%; justify-content:space-between; gap:8px; }
  h1 { font-size:19px; line-height:1.1; letter-spacing:-.025em; }
  .status-badge { max-width:48%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:8px; padding:4px 7px; }

  .department-bar {
    position:relative; top:auto; flex:0 0 auto; padding:5px 7px 6px; border-bottom:1px solid var(--line);
    background:#f8fafc; z-index:8;
  }
  .department-tabs { gap:5px; width:100%; padding:0 1px; scrollbar-width:none; scroll-snap-type:x proximity; }
  .department-tabs::-webkit-scrollbar { display:none; }
  .department-tab {
    min-height:40px; padding:0 11px; border-radius:9px; font-size:11px; scroll-snap-align:start;
  }
  .department-tab .dept-count { font-size:9px; min-width:21px; }

  /* The GA gets the majority of the phone screen. */
  .content-grid { flex:1; min-height:0; display:block; overflow:hidden; padding:6px 6px 7px; }
  .plan-card { height:100%; min-height:0; border-radius:11px; }
  .plan-toolbar { min-height:48px; flex:0 0 48px; padding:0 7px 0 10px; }
  .legend { display:none; }
  .plan-tools { width:100%; justify-content:flex-end; gap:6px; }
  .tool-btn { width:42px; height:40px; border-radius:8px; font-size:17px; }
  .tool-btn.wide { width:48px; font-size:10px; }
  .zoom-label { width:48px; font-size:10px; }
  .plan-viewport { padding:9px; scrollbar-gutter:auto; background:#f0f3f6; }
  .deck-stage { max-width:none; box-shadow:0 2px 10px rgba(15,27,61,.08); }
  .plan-footer { display:none; }
  .locker-zone::before { content:""; position:absolute; inset:-7px; }
  .locker-zone.selected { box-shadow:0 0 0 5px rgba(59,111,160,.2); }
  .locker-zone::after,.locker-polygon-label { font-size:10px; padding:4px 6px; }
  .locker-polygon { stroke-width:2.5px; }

  .mapping-banner {
    min-height:58px; height:auto; flex:0 0 auto; padding:7px 9px; gap:7px; align-items:center;
    font-size:9px;
  }
  .mapping-copy { max-width:48%; }
  .mapping-actions { gap:2px; flex-wrap:wrap; justify-content:flex-end; }
  .mapping-actions button { min-height:36px; padding:5px 7px; font-size:9px; }

  /* Locker details become a slide-up sheet instead of pushing the GA off screen. */
  .inspector {
    position:fixed; left:6px; right:6px; bottom:calc(68px + env(safe-area-inset-bottom));
    width:auto; height:min(70dvh,650px); min-height:0; z-index:76;
    border-radius:18px 18px 12px 12px; box-shadow:0 -10px 45px rgba(15,27,61,.24);
    transform:translateY(calc(100% + 24px)); opacity:0; pointer-events:none;
    transition:transform .22s ease,opacity .18s ease; padding-top:9px;
    overscroll-behavior:contain; -webkit-overflow-scrolling:touch;
  }
  .inspector::before {
    content:""; position:sticky; top:0; z-index:4; display:block; width:42px; height:4px;
    margin:-2px auto 5px; border-radius:4px; background:#cbd3dc;
  }
  .inspector.mobile-open { transform:translateY(0); opacity:1; pointer-events:auto; }
  .mobile-inspector-close {
    position:fixed; top:12px; right:14px; z-index:8; display:grid; place-items:center;
    width:38px; height:38px; border:1px solid var(--line); border-radius:50%; background:#fff;
    color:#697588; font-size:24px; box-shadow:0 3px 12px rgba(15,27,61,.08);
  }
  .inspector-head { padding:12px 52px 12px 15px; }
  .inspector-title-row h2 { font-size:20px; }
  .inspector-meta { font-size:10px; line-height:1.45; }
  .inspector-actions { padding:9px 12px; gap:7px; }
  .inspector-actions button { min-height:44px; font-size:11px; }
  .stock-summary { padding:10px 12px; }
  .mini-stat { padding:8px; }
  .inspector-section { padding:12px; }
  .section-title-row h3 { font-size:12px; }
  .add-link { min-height:36px; font-size:10px; }
  .stock-list { gap:8px; }
  .stock-row { min-height:62px; gap:7px; padding:9px 8px 9px 10px; align-items:center; }
  .stock-name strong { font-size:13px; white-space:normal; line-height:1.25; }
  .stock-name small { font-size:10px; line-height:1.4; }
  .tag-chip { min-height:27px; padding:3px 8px; font-size:9px; }
  .min-qty-line { font-size:9px; }
  .qty-control { gap:4px; }
  .qty-control button { width:38px; height:38px; border-radius:8px; font-size:18px; }
  .qty-control span { min-width:30px; font-size:12px; }
  .danger-link { min-height:48px; padding:13px 15px; font-size:11px; }
  .inspector-empty { display:none; }

  .mobile-sheet-scrim {
    position:fixed; inset:0 0 calc(64px + env(safe-area-inset-bottom)) 0; z-index:73;
    display:block; border:0; background:rgba(8,17,35,.36); opacity:0; pointer-events:none; transition:opacity .18s ease;
  }
  .mobile-sheet-scrim.show { opacity:1; pointer-events:auto; }

  /* Thumb-friendly bottom navigation. */
  .mobile-bottom-nav {
    position:fixed; left:0; right:0; bottom:0; z-index:78; display:grid;
    grid-template-columns:repeat(4,1fr); min-height:64px; padding:5px 6px calc(5px + env(safe-area-inset-bottom));
    background:rgba(255,255,255,.97); border-top:1px solid rgba(15,27,61,.12);
    box-shadow:0 -8px 26px rgba(15,27,61,.08); backdrop-filter:blur(12px);
  }
  .mobile-bottom-nav button {
    min-width:0; min-height:54px; border:0; border-radius:10px; background:transparent; color:#66748a;
    display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px;
  }
  .mobile-bottom-nav button span { font-size:21px; line-height:1; }
  .mobile-bottom-nav button small { font-family:"Space Grotesk"; font-size:9px; font-weight:700; }
  .mobile-bottom-nav button.active { color:#fff; background:var(--navy-900); }
  .mobile-bottom-nav button:disabled { opacity:.35; }
  .mobile-bottom-nav button[hidden] { display:none !important; }
  .mobile-bottom-nav:has(button[hidden]) { grid-template-columns:repeat(3,1fr); }

  .toast { bottom:calc(76px + env(safe-area-inset-bottom)); max-width:calc(100vw - 24px); text-align:center; }

  /* Forms/modals behave like native phone sheets and avoid Safari's input zoom. */
  .modal-backdrop { padding:0; place-items:end center; align-items:end; }
  .modal,.modal.wide-modal {
    width:100vw; max-width:none; max-height:92dvh; border-radius:20px 20px 0 0;
    padding-bottom:env(safe-area-inset-bottom); overscroll-behavior:contain;
  }
  .modal-head { position:sticky; top:0; z-index:5; padding:16px 16px 12px; background:#fff; border-radius:20px 20px 0 0; }
  .modal-head h2 { font-size:20px; }
  .modal-close { width:42px; height:42px; margin:-5px -5px 0 0; }
  .modal-body { padding:14px 14px 6px; }
  .modal-actions {
    position:sticky; bottom:0; z-index:5; padding:10px 14px calc(12px + env(safe-area-inset-bottom));
    background:#fff; border-top:1px solid var(--line);
  }
  .modal-actions button { min-height:46px; flex:1; }
  .field input,.field select,.field textarea,
  .auth-form input,.crew-invite-form input,.crew-invite-form select,.crew-controls input,.crew-controls select { font-size:16px; }
  .form-grid { grid-template-columns:1fr; gap:0; }
  .mapping-choice { min-height:112px; padding:14px; flex-direction:row; align-items:center; }
  .mapping-choice-icon { flex:none; }

  .crew-access-card { gap:14px; }
  .join-code-box { padding:12px; }
  .join-code-digits { font-size:25px; letter-spacing:.12em; }
  .crew-invite-form { padding:10px; }
  .crew-invite-form > button { min-height:46px; height:auto; }
  .crew-controls { grid-template-columns:1fr; }
  .crew-controls label:first-child { grid-column:auto; }
  .crew-controls button { min-height:44px; }
  .crew-department-line { grid-column:auto; }
  .pending-invite-row { align-items:flex-start; flex-direction:column; }
  .alert-dept-grid { grid-template-columns:1fr; }
  .alert-recipient-check { min-height:42px; }
  .alert-recipient-check input { width:20px; height:20px; }
  .tag-browser-grid { grid-template-columns:1fr 1fr; }
  .tag-browser-chip { min-height:54px; }

  /* Login/signup on a phone is intentionally simpler. */
  .auth-gate { height:100dvh; min-height:100dvh; overflow:auto; display:block; background:#fff; }
  .auth-brand-panel { min-height:auto; padding:18px 18px 20px; }
  .auth-brand-lockup img { width:46px; height:46px; }
  .auth-brand-name { font-size:19px; }
  .auth-copy { margin:28px 0 0; }
  .auth-copy h1 { font-size:28px; }
  .auth-copy p { display:none; }
  .auth-form-panel { min-height:auto; padding:14px 12px calc(28px + env(safe-area-inset-bottom)); }
  .auth-card { width:100%; border-radius:14px; padding:22px 16px; box-shadow:none; }
  .auth-form input { min-height:48px; }
  .auth-submit,.auth-wide { min-height:48px; }
}

@media (max-width:430px) {
  .status-badge { display:none; }
  .department-tab { padding:0 9px; }
  .zoom-label { display:none; }
  .plan-tools { gap:5px; }
  .mapping-copy { display:none; }
  .mapping-actions { width:100%; justify-content:space-between; }
  .mapping-actions button { flex:1; }
  .stock-row { grid-template-columns:minmax(0,1fr) auto; }
  .qty-control button { width:36px; }
  .tag-browser-grid { grid-template-columns:1fr; }
}

/* SeaStowed email OTP verification */
.otp-code-input { text-align:center; font-family:"Space Grotesk",sans-serif !important; font-size:26px !important; font-weight:700; letter-spacing:.32em; padding-left:.32em !important; font-variant-numeric:tabular-nums; }
.otp-actions { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:16px; }
.otp-actions .text-button { margin:0; }
#otpPanel .auth-note strong { color:var(--navy-900); word-break:break-word; }
@media (max-width:760px) {
  .otp-code-input { min-height:56px !important; font-size:28px !important; }
  .otp-actions { flex-direction:column; align-items:stretch; }
  .otp-actions .text-button { min-height:42px; text-align:center; }
}
