:root {
  color-scheme: dark;
  --app: #101720;
  --rail: #131d28;
  --top: #131c27;
  --surface: #192532;
  --surface-up: #202e3e;
  --line: #2b394a;
  --line-soft: #223042;
  --text: #eff4fa;
  --muted: #a2b0c2;
  --muted-soft: #8494aa;
  --orange: #ff985d;
  --orange-hot: #ffaf80;
  --orange-dim: #38291f;
  --green: #78dbc0;
  --radius: 8px;
  --left: 244px;
  --right: 295px;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  font-size: 14px;
}
*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; background: var(--app); }
body { margin: 0; height: 100dvh; min-height: 0; overflow: hidden; display: flex; flex-direction: column; background: var(--app); color: var(--text); }
@media (display-mode: standalone) {
  body { padding-top: env(safe-area-inset-top); padding-inline: env(safe-area-inset-left) env(safe-area-inset-right); }
}
button, input, select { font: inherit; }
button, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .43; }
button, select, input { touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
button:focus:not(:focus-visible), select:focus:not(:focus-visible) { outline: none; }
[hidden] { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.topbar { flex: 0 0 auto; height: 69px; display: flex; align-items: center; gap: 21px; padding: 0 21px; background: var(--top); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--text); text-decoration: none; flex: 0 0 auto; }
.brand-logo {
  display: block;
  width: 113px;
  height: auto;
}
.brand-logo, .empty-logo {
  /* Follow the supplied badge's outer edge so its white lettering and trim stay intact. */
  clip-path: polygon(
    18% 2.2%, 18.8% 2.8%, 36% 27.6%, 41% 25%, 48% 22.7%,
    56% 21.4%, 64% 21.2%, 72% 22.3%, 80% 24.4%, 88% 27.7%,
    95% 31%, 98% 32.8%, 98.5% 34%, 98.5% 50%, 98.1% 57%,
    97% 63%, 95.2% 69.2%, 92.6% 73.5%, 89% 76.2%, 84% 78.3%,
    77% 80%, 69% 80.7%, 61% 80.9%, 54% 80.5%, 47% 79.5%,
    41% 78%, 36% 76%, 31.9% 73.5%, 29.7% 79.5%, 26% 86%,
    18.2% 96.4%, 17.5% 96.5%, 12% 89%, 7.6% 82%, 5.1% 76%,
    3.6% 70%, 2.8% 63.5%, 2.8% 30.7%, 1.1% 30.3%, .7% 28.7%,
    .9% 26.7%
  );
}
.brand-name { display: block; font-size: 17px; letter-spacing: .035em; line-height: 1.15; font-weight: 830; white-space: nowrap; }
.brand-name b { color: var(--orange); font-weight: 830; }
.brand-caption { display: block; margin-top: 4px; color: var(--muted-soft); font-size: 8px; letter-spacing: .23em; font-weight: 730; white-space: nowrap; }
.header-rule { height: 33px; width: 1px; background: var(--line); }
.job-select { min-width: 0; height: 42px; display: flex; align-items: center; gap: 10px; border: 0; background: transparent; border-radius: 7px; color: var(--muted); padding: 0 8px; text-align: left; }
.job-select:hover { background: var(--surface); }
.job-select .icon { width: 14px; height: 14px; }
.job-text { min-width: 0; }
.job-text strong { display: block; color: var(--text); font-size: 14px; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 250px; }
.micro { font-size: 9px; letter-spacing: .12em; font-weight: 760; color: var(--muted-soft); display: block; line-height: 1.3; }
.header-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.button { border: 1px solid transparent; border-radius: 7px; padding: 0 12px; min-height: 37px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; color: var(--text); background: transparent; font-weight: 650; font-size: 12px; white-space: nowrap; transition: background .13s, border-color .13s; }
.button .icon { width: 16px; height: 16px; }
.button.accent { background: var(--orange); color: #171f28; border-color: #ffad7b; box-shadow: inset 0 1px 0 #ffd6b74a; }
.button.accent:hover:not(:disabled) { background: var(--orange-hot); }
.button.secondary { background: var(--surface); border-color: var(--line); }
.button.secondary:hover:not(:disabled) { background: var(--surface-up); border-color: #4a5e76; }
.button.quiet { color: var(--muted); border-color: transparent; }
.button.quiet:hover:not(:disabled) { background: var(--surface-up); color: var(--text); }
.button.danger { color: #ffadab; border-color: #623e49; background: #2e232c; }
.button.danger:hover { background: #472b36; }
.button.wide { width: 100%; }
.icon-button { display: inline-grid; place-items: center; width: 33px; height: 33px; background: transparent; border: 1px solid transparent; color: var(--muted); border-radius: 6px; flex: 0 0 auto; }
.icon-button:hover { color: var(--text); background: var(--surface-up); border-color: var(--line); }
.tabbar { height: 48px; flex: 0 0 auto; display: flex; align-items: stretch; background: #101923; border-bottom: 1px solid var(--line); min-width: 0; }
.tabbar-label { display: flex; align-items: center; gap: 8px; padding: 0 17px; color: var(--muted-soft); font-size: 10px; font-weight: 760; letter-spacing: .12em; text-transform: uppercase; flex: 0 0 var(--left); border-right: 1px solid var(--line-soft); }
.tabbar-label .icon { width: 15px; height: 15px; }
.document-tabs { min-width: 0; flex: 1; display: flex; gap: 4px; align-items: stretch; padding: 7px 7px 0; overflow-x: auto; scrollbar-width: thin; }
.document-tab { max-width: min(240px, 40vw); min-width: 0; flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 0 13px; color: var(--muted); border: 1px solid transparent; border-bottom: 0; border-radius: 7px 7px 0 0; background: #17212c; font-size: 12px; font-weight: 640; }
.document-tab .icon { width: 15px; height: 15px; }
.document-tab span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.document-tab:hover { color: var(--text); background: var(--surface-up); }
.document-tab[aria-selected="true"] { color: #fff3eb; background: #2b2526; border-color: #6b4436; box-shadow: inset 0 2px 0 var(--orange); }
.document-tab[aria-selected="true"] .icon { color: var(--orange); }
.add-tab { align-self: center; margin-bottom: 5px; }
.tabbar-end { display: flex; align-items: center; justify-content: flex-end; padding: 0 15px; }
.tabbar-end { gap: 9px; }
#hookups-tab { min-height: 29px; white-space: nowrap; color: #a0d5ff; }
#print-plan { min-height: 35px; }
.hookups-workspace #hookups-tab { background: #21466b; border-color: #527ba3; color: #e0f2ff; }
.hookups-workspace .toolbar [data-mode]:not([data-mode="pan"]),
.hookups-workspace .scale-section,
.hookups-workspace #view-scale,
.hookups-workspace .axis-pick,
.hookups-workspace .schedule-tabs { display: none; }
.hookups-workspace #mode-options { flex-wrap: wrap; }
.hookups-workspace .hook-list-text { padding-block: 8px; }
@media (max-width: 620px) {
  #hookups-tab { min-height: 26px; padding-inline: 7px; font-size: 10px; }
  #print-plan { padding-inline: 8px; gap: 5px; font-size: 11px; }
  #print-plan .icon { width: 14px; height: 14px; }
  .hookups-workspace #mode-options .button { min-height: 28px; padding-inline: 6px; font-size: 10px; }
  .tabbar-end .hd-chip { display: none; }
}
.hd-chip { padding: 5px 7px; border: 1px solid #2c514d; color: #a4ddce; border-radius: 4px; background: #182d31; font: 700 9px/1 var(--mono); letter-spacing: .045em; white-space: nowrap; }
.hd-chip > span, .status-dot { display: inline-block; width: 6px; height: 6px; margin-right: 4px; vertical-align: 1px; border-radius: 50%; background: #76d8bb; }
.workbench { flex: 1 1 auto; min-height: 0; min-width: 0; display: grid; grid-template-columns: var(--left) minmax(0, 1fr) var(--right); }
.rail { background: var(--rail); display: flex; min-height: 0; flex-direction: column; min-width: 0; }
.left-rail { border-right: 1px solid var(--line); }
.right-rail { border-left: 1px solid var(--line); }
.rail-scroll { overflow: auto; min-height: 0; flex: 1 1 auto; scrollbar-width: thin; scrollbar-color: #3b4b5f transparent; }
.rail-section { padding: 16px 15px; border-bottom: 1px solid var(--line-soft); }
.section-heading { display: flex; align-items: center; gap: 8px; color: var(--muted); margin-bottom: 12px; }
.section-heading > .icon { width: 15px; height: 15px; color: #8fa2bb; }
.section-heading h2 { margin: 0; font-size: 10px; letter-spacing: .11em; text-transform: uppercase; font-weight: 780; }
.count { margin-left: auto; color: var(--muted); font: 700 10px/1 var(--mono); background: var(--surface-up); padding: 3px 6px; border-radius: 4px; }
.sheet-list { display: grid; gap: 5px; margin-bottom: 8px; }
.sheet-list:empty { margin-bottom: 0; }
.sheet-entry { display: flex; align-items: center; gap: 4px; }
.sheet-entry .sheet-row { min-width: 0; flex: 1; }
.sheet-entry > .icon-button { flex: 0 0 auto; }
.sheet-row { display: flex; align-items: center; gap: 8px; text-align: left; width: 100%; min-height: 42px; background: var(--surface); border: 1px solid var(--line-soft); border-radius: 6px; color: var(--muted); padding: 6px 8px; }
.sheet-row:hover { background: var(--surface-up); }
.sheet-row.active { border-color: #745241; background: #302726; color: var(--orange); }
.sheet-row .icon { width: 16px; height: 16px; }
.sheet-row .sheet-text { flex: 1; min-width: 0; }
.sheet-row strong { color: var(--text); display: block; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-row small { display: block; font-size: 9px; color: var(--muted); margin-top: 3px; }
.sheet-row .sheet-tag { font: 650 8px/1 var(--mono); color: var(--muted); border-radius: 3px; padding: 3px 4px; background: #273547; }
.sheet-row.active .sheet-tag { color: #ffc5a5; background: #53372c; }
.upload-button { display: flex; width: 100%; align-items: center; justify-content: center; gap: 7px; min-height: 35px; background: #15212b; border: 1px dashed #455873; color: #c2d0e0; border-radius: 6px; font-size: 11px; font-weight: 680; }
.upload-button:hover { background: #203041; border-color: var(--orange); }
.upload-button .icon { width: 15px; height: 15px; }
.scale-card { background: #192630; border: 1px solid #374758; border-radius: 7px; padding: 10px; margin-bottom: 8px; }
.scale-card.verified { background: #152d2e; border-color: #2e514e; }
.scale-card.pending { background: #2e2926; border-color: #665040; }
.scale-title { display: flex; align-items: center; gap: 6px; color: #d3deea; font-weight: 720; font-size: 12px; }
.verified .scale-title { color: var(--green); }
.pending .scale-title { color: #ffc192; }
.scale-title .icon { width: 15px; height: 15px; }
.scale-card dl { margin: 7px 0 0; }
.scale-card dl div { display: flex; justify-content: space-between; gap: 5px; align-items: center; padding-top: 5px; }
.scale-card dt, .scale-card p { color: #a8b8c8; font-size: 10.5px; margin: 0; line-height: 1.5; }
.scale-card p { margin-top: 5px; }
.scale-card dd { margin: 0; color: #e2ecf5; font: 630 10px/1.25 var(--mono); text-align: right; }
.stack { display: grid; gap: 8px; }
.stack.compact { gap: 3px; }
.scan-button { min-height: 31px; color: #fac09b !important; }
.rail-section .button { min-height: 33px; font-size: 11px; }
.slider-title { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; gap: 8px; align-items: center; }
.slider-title output { color: #e5edf6; font: 620 10px/1 var(--mono); }
input[type="range"] { width: 100%; margin: 8px 0 10px; height: 16px; accent-color: var(--orange); cursor: pointer; }
.switch-row { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 29px; color: #c0cddc; font-size: 11px; cursor: pointer; }
.switch-row input { position: absolute; right: 0; opacity: 0; width: 32px; height: 20px; margin: 0; }
.switch { position: relative; width: 29px; height: 16px; border-radius: 10px; background: #293748; border: 1px solid #4c5c6d; flex: 0 0 auto; pointer-events: none; }
.switch::before { content: ""; position: absolute; top: 2px; left: 2px; width: 10px; height: 10px; border-radius: 50%; background: #9aaab9; transition: transform .13s; }
.switch-row input:checked + .switch { background: #63412f; border-color: #9c6648; }
.switch-row input:checked + .switch::before { background: var(--orange); transform: translateX(13px); }
.switch-row input:focus-visible + .switch { outline: 2px solid var(--orange); outline-offset: 3px; }
.switch-row input:disabled + .switch { opacity: .45; }
.rail-footer { min-height: 35px; display: flex; align-items: center; gap: 6px; padding: 0 13px; border-top: 1px solid var(--line); color: var(--muted-soft); font-size: 9px; white-space: nowrap; }
.rail-footer .icon { width: 13px; height: 13px; color: #8eb9b6; }
.drawing-workspace { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; position: relative; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 4px; flex: 0 0 48px; background: #17222e; padding: 0 7px; border-bottom: 1px solid var(--line); z-index: 4; }
.toolgroup { display: flex; align-items: center; gap: 2px; min-width: 0; }
.tool { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 7px; color: #afbdcd; border-radius: 6px; background: transparent; border: 1px solid transparent; white-space: nowrap; font-size: 11px; font-weight: 670; }
.tool .icon { width: 15px; height: 15px; }
.tool:hover:not(:disabled) { color: var(--text); background: var(--surface-up); }
.tool.active { background: #402e27; color: #ffba93; border-color: #74503d; }
.tool.icon-only { width: 30px; padding: 0; }
.tool-separator { height: 20px; width: 1px; background: #364456; margin: 0 3px; flex: 0 0 auto; }
.page-control { position: relative; flex: 0 0 auto; }
.page-control select { height: 30px; min-width: 72px; appearance: none; background: #1d2a38; border: 1px solid #3a4b5e; border-radius: 5px; padding: 0 18px 0 7px; color: #e7eef7; font-size: 10.5px; font-weight: 650; }
.page-control .icon { position: absolute; right: 4px; top: 9px; width: 12px; height: 12px; pointer-events: none; color: var(--muted); }
.zoom-value { border: 0; background: transparent; color: #d2dfed; padding: 0 3px; min-width: 39px; height: 30px; font: 700 11px/1 var(--mono); border-radius: 4px; }
.zoom-value:hover { background: var(--surface-up); }
.mode-options { padding: 7px 10px; background: #1d2734; color: var(--muted); border-bottom: 1px solid #3d4b5e; z-index: 3; display: flex; flex-wrap: wrap; align-items: center; gap: 7px; font-size: 11px; }
.mode-options strong { color: var(--text); }
.mode-options select, .mode-options input { min-height: 29px; padding: 0 7px; }
.mode-options .button { min-height: 29px; font-size: 11px; }
.mode-options .mode-end { margin-left: auto; display: flex; gap: 5px; }
.viewport { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; touch-action: none; isolation: isolate; background-color: #0e161f; background-image: radial-gradient(#304158 0.75px, transparent 0.75px); background-size: 18px 18px; cursor: grab; user-select: none; -webkit-user-select: none; }
.viewport:focus-visible { outline-offset: -2px; }
.viewport.dragging { cursor: grabbing; }
.viewport.drawing { cursor: crosshair; }
.viewport.drawing:has(.aim-cursor):not(.dragging) { cursor: none; }
.viewport.drag-target { box-shadow: inset 0 0 0 2px var(--orange); }
.plan-paper { position: absolute; pointer-events: none; top: 0; left: 0; background: #eef4f8; box-shadow: 0 0 0 1px #acc4d2, 0 12px 30px #0008; }
.pdf-raster, .markup { position: absolute; inset: 0; pointer-events: none; }
.pdf-raster canvas { position: absolute; top: 0; left: 0; transform-origin: top left; }
.markup { width: 100%; height: 100%; overflow: hidden; }
.view-meta { position: absolute; top: 11px; left: 11px; right: 11px; display: flex; justify-content: space-between; align-items: center; gap: 8px; pointer-events: none; }
.view-file, .view-scale { display: inline-flex; gap: 6px; align-items: center; min-height: 23px; padding: 0 7px; border-radius: 4px; border: 1px solid #35465a; background: #172332ed; color: #d7e4ef; font: 680 9px/1 var(--mono); letter-spacing: .03em; white-space: nowrap; }
.view-file { max-width: 68%; }
.view-file strong { overflow: hidden; text-overflow: ellipsis; }
.view-file-dot { width: 5px; height: 5px; border-radius: 1px; background: var(--orange); flex: 0 0 auto; }
.view-scale.verified { background: #193132ed; color: #9be1cf; border-color: #3b665d; }
.view-scale.pending { background: #372b25ee; color: #ffd0af; border-color: #705341; }
.view-scale .icon { width: 12px; height: 12px; }
.canvas-guide { position: absolute; left: 50%; bottom: 11px; transform: translateX(-50%); max-width: calc(100% - 20px); padding: 7px 10px; display: flex; align-items: center; gap: 6px; white-space: nowrap; background: #172534f3; color: #d7e3ef; box-shadow: 0 4px 12px #0004; border: 1px solid #42546a; border-radius: 6px; font-size: 10px; font-weight: 600; pointer-events: none; }
.canvas-guide .icon { width: 13px; height: 13px; color: #ffac7f; }
.canvas-guide span { white-space: normal; }
.canvas-loader { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); padding: 11px 13px; border: 1px solid var(--line); border-radius: 7px; display: flex; align-items: center; gap: 8px; background: var(--surface); font-size: 12px; pointer-events: none; }
.spinner { width: 14px; height: 14px; border: 2px solid #4f5964; border-top-color: var(--orange); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty-plan { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 8px; padding: 18px; text-align: center; cursor: default; }
.empty-logo {
  width: min(88%, 560px, 68dvh);
  height: auto;
  margin-bottom: clamp(5px, 2vh, 16px);
  pointer-events: none;
  filter: url("#logo-blue");
  -webkit-mask: radial-gradient(circle, #000 1.15px, transparent 1.45px) 0 0 / 4px 4px repeat;
  mask: radial-gradient(circle, #000 1.15px, transparent 1.45px) 0 0 / 4px 4px repeat;
  opacity: .8;
}
.empty-plan h1 { font-size: 23px; margin: 6px 0 0; letter-spacing: -.035em; }
.empty-plan p { max-width: 300px; color: var(--muted); margin: 0 0 9px; line-height: 1.55; font-size: 13px; }
.view-footer { min-height: 35px; flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 9px; padding: 0 10px; background: #14202d; border-top: 1px solid var(--line); color: var(--muted); font-size: 9.5px; }
.view-footer > span { white-space: nowrap; }
.view-coords { font: 650 9.5px/1 var(--mono); color: #c0cee0; }
.text-button { border: 0; border-radius: 4px; background: transparent; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; min-height: 26px; font-size: 10px; }
.text-button:hover { background: var(--surface-up); color: var(--text); }
.text-button .icon { width: 14px; height: 14px; }
.schedule-scroll { padding: 16px 14px 12px; }
.schedule-heading { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; }
.schedule-heading h1 { margin: 0; font-size: 16px; font-weight: 740; letter-spacing: -.025em; }
.schedule-heading p { margin: 3px 0 0; font-size: 10px; color: var(--muted-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 201px; }
.schedule-symbol { width: 33px; height: 33px; border-radius: 7px; display: grid; place-items: center; background: #263143; color: #b0c6dc; border: 1px solid #394b62; }
.schedule-symbol .icon { width: 17px; height: 17px; }
.segmented { display: flex; gap: 2px; align-items: stretch; border: 1px solid #2a3a4e; background: #0f1823; padding: 3px; border-radius: 7px; }
.segmented > button { flex: 1; min-width: 0; border: 1px solid transparent; background: transparent; color: var(--muted); font-size: 11px; font-weight: 680; border-radius: 5px; padding: 5px 4px; min-height: 26px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; white-space: nowrap; }
.segmented > button:hover { color: var(--text); }
.segmented > button.selected { background: #253344; border-color: #3e5066; color: #f0f5fb; }
.seg-count { font: 700 9px/1 var(--mono); color: #c6d4e1; background: #36475c; padding: 3px 4px; border-radius: 3px; }
.schedule-metrics { margin-top: 12px; padding: 12px 11px 10px; border-radius: 8px; background: radial-gradient(ellipse at 93% 12%, #264548 0%, transparent 55%), #192b34; border: 1px solid #324d56; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.metric-number { display: block; margin-top: 4px; color: #eef8fa; font: 760 25px/1.08 var(--mono); letter-spacing: -.075em; white-space: nowrap; }
.metric-number small { color: #a6c7c9; font-size: 12px; letter-spacing: 0; }
.metric-caption { display: block; color: #a1c8cd; font-size: 9.5px; margin-top: 5px; }
.metric-icon { color: #79c9c1; padding: 8px; border: 1px solid #47716f; border-radius: 8px; background: #244145; }
.metric-icon .icon { display: block; width: 19px; height: 19px; }
.interval-group { margin-top: 14px; display: flex; align-items: center; justify-content: space-between; gap: 7px; }
.interval-group > span { color: var(--muted); font-size: 10px; font-weight: 650; }
.interval-group .segmented { width: 128px; }
.interval-group .segmented button { min-height: 23px; font: 690 9.5px/1 var(--mono); padding: 4px 5px; }
.schedule-label { margin: 16px 0 8px; display: flex; align-items: center; justify-content: space-between; gap: 6px; color: var(--muted); text-transform: uppercase; font-size: 9.5px; letter-spacing: .09em; font-weight: 770; }
.schedule-label small { color: var(--muted-soft); font-size: 8.5px; white-space: nowrap; letter-spacing: 0; text-transform: none; }
.route-list, .point-list { display: grid; gap: 6px; }
.route-card { background: var(--surface); border: 1px solid #324356; border-radius: 7px; overflow: hidden; }
.route-card.selected { border-color: #557c85; }
.route-head { width: 100%; display: flex; align-items: center; text-align: left; gap: 7px; background: transparent; border: 0; color: var(--text); padding: 9px 8px; }
.route-head:hover { background: var(--surface-up); }
.route-mark { width: 26px; height: 26px; border-radius: 6px; background: #213a42; color: var(--route-color, #7bcecc); display: grid; place-items: center; flex: 0 0 auto; }
.route-mark .icon { width: 15px; height: 15px; }
.route-text { flex: 1; min-width: 0; }
.route-text strong { font-size: 11px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.route-text small { font-size: 9px; color: var(--muted); display: block; margin-top: 2px; }
.route-value { color: var(--text); white-space: nowrap; font: 690 11px/1 var(--mono); }
.route-head > .icon { width: 13px; height: 13px; color: var(--muted-soft); }
.route-summary { display: flex; justify-content: space-between; gap: 3px; padding: 6px 8px 7px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 9px; }
.route-summary b { color: #d5e2ee; font-family: var(--mono); font-weight: 650; }
.route-expanded { padding: 9px 8px 8px; border-top: 1px solid var(--line); }
.route-expanded p, .schedule-note { color: var(--muted); font-size: 10px; line-height: 1.55; margin: 5px 0 8px; }
.station-table { max-height: 190px; overflow: auto; border: 1px solid var(--line-soft); border-radius: 5px; }
.station-table table { width: 100%; border-collapse: collapse; color: #cbd8e5; font: 10px/1.3 var(--mono); text-align: right; }
.station-table th, .station-table td { padding: 4px 6px; border-bottom: 1px solid #2b3949; }
.station-table th { position: sticky; top: 0; background: #253446; color: var(--text); font-weight: 630; }
.route-buttons { display: flex; gap: 3px; margin-top: 5px; justify-content: space-between; align-items: center; }
.legend { display: flex; flex-wrap: wrap; gap: 5px; }
.legend-item { display: inline-flex; align-items: center; gap: 5px; padding: 4px 5px; border-radius: 4px; border: 1px solid #304055; background: #182533; color: #c5d3df; font-size: 9px; white-space: nowrap; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--legend-color); flex: 0 0 auto; }
.legend-dot.square { border-radius: 1px; }
.legend-dot.diamond { border-radius: 1px; transform: rotate(45deg); }
.legend-dot.triangle { clip-path: polygon(50% 0, 100% 100%, 0 100%); border-radius: 0; }
.legend-dot.cross { clip-path: polygon(34% 0,66% 0,66% 34%,100% 34%,100% 66%,66% 66%,66% 100%,34% 100%,34% 66%,0 66%,0 34%,34% 34%); border-radius: 0; }
.point-row { display: flex; align-items: center; gap: 7px; padding: 7px; border: 1px solid #324356; background: var(--surface); border-radius: 6px; color: var(--text); }
.point-row.selected { border-color: var(--orange); }
.point-row > button:first-of-type { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 7px; text-align: left; color: inherit; padding: 0; border: 0; background: transparent; }
.point-row strong { font-size: 11px; white-space: nowrap; }
.point-row small { color: var(--muted); display: block; font-size: 9px; margin-top: 2px; }
.point-row .point-offset { font: 620 9px/1.45 var(--mono); text-align: right; margin-left: auto; white-space: nowrap; }
.point-row .icon-button { width: 23px; height: 24px; }
.point-row .icon-button .icon { width: 13px; height: 13px; }
.empty-schedule { padding: 15px 9px; border: 1px dashed #3b4c60; border-radius: 7px; color: var(--muted); text-align: center; font-size: 11px; line-height: 1.55; }
.empty-schedule .button { margin-top: 7px; }
.export-footer { border-top: 1px solid var(--line); padding: 11px 14px 9px; background: #14202c; flex: 0 0 auto; }
.export-footer .button { min-height: 36px; }
.export-arrow { position: absolute; right: 25px; }
.export-footer p { color: var(--muted-soft); font-size: 9px; text-align: center; margin: 7px 0 0; white-space: nowrap; }
.mobile-nav, .mobile-panel-head, .panel-backdrop { display: none; }
dialog { width: min(480px, calc(100vw - 28px)); max-height: min(85dvh, 760px); border: 1px solid #445873; border-radius: 13px; padding: 0; background: #172330; color: var(--text); box-shadow: 0 20px 70px #0008; }
dialog::backdrop { background: #070d15a8; backdrop-filter: blur(2px); }
.dialog-shell { padding: 18px; }
.dialog-head { display: flex; align-items: start; gap: 11px; }
.dialog-head h2 { font-size: 19px; margin: 3px 0 0; letter-spacing: -.025em; }
.dialog-head .icon-button { margin: -3px -4px 0 auto; }
.dialog-intro { color: var(--muted); font-size: 12px; line-height: 1.6; margin: 10px 0 13px; }
.dialog-form { display: grid; gap: 12px; margin-top: 14px; }
.field { display: grid; gap: 5px; min-width: 0; }
.field label { color: #cedae7; font-size: 11px; font-weight: 670; }
.field small { font-size: 10px; color: var(--muted); line-height: 1.45; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.control, .mode-options select, .mode-options input { background: #0f1925; color: var(--text); border: 1px solid #3d4e64; border-radius: 6px; font-size: 12px; }
.control { min-height: 37px; width: 100%; padding: 0 9px; }
.control::placeholder { color: #8493a7; }
.field-error { color: #ffb093; margin: 0; font-size: 11px; line-height: 1.5; }
.dialog-actions { display: flex; gap: 7px; justify-content: flex-end; flex-wrap: wrap; margin-top: 13px; }
.supplier-sections, .supplier-items { display: grid; gap: 6px; }
.supplier-section { background: var(--surface); border: 1px solid #34465b; border-radius: 7px; padding: 8px; }
.supplier-section summary { cursor: pointer; font-weight: 700; padding: 3px; }
.supplier-items { margin-top: 7px; }
.supplier-row { display: grid; grid-template-columns: 61px minmax(0, 1fr) 32px; align-items: center; gap: 5px; }
.supplier-row .control { padding-inline: 6px; }
.supplier-footer { position: sticky; bottom: -18px; padding: 8px 0 10px; background: #172330; border-top: 1px solid var(--line); }
.supplier-footer .dialog-actions { margin: 0; }
#supplier-form textarea { padding-block: 7px; resize: vertical; }
.choice-list { display: grid; gap: 6px; }
.choice { width: 100%; display: flex; gap: 9px; align-items: center; text-align: left; padding: 9px; color: var(--text); background: var(--surface); border: 1px solid #34465b; border-radius: 7px; }
.choice:hover { border-color: var(--orange); background: var(--surface-up); }
.choice > .icon { color: var(--orange); }
.choice > .icon:last-child { width: 14px; height: 14px; margin-left: auto; color: var(--muted); }
.choice > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.choice strong { font-size: 12px; display: block; overflow-wrap: anywhere; }
.choice small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.scan-list { max-height: 290px; overflow: auto; }
.scan-option { display: flex; align-items: start; gap: 7px; padding: 7px; background: var(--surface); border: 1px solid #34465b; border-radius: 6px; }
.scan-option input { accent-color: var(--orange); }
.scan-option strong { display: block; font-size: 11px; }
.scan-option small { color: var(--muted); font-size: 10px; }
.print-sheet { align-items: center; min-height: 44px; cursor: pointer; overflow-wrap: anywhere; }
.print-sheet input { margin: 0 4px; flex: none; }
kbd { background: #0e1722; border: 1px solid #3b4e64; border-radius: 4px; padding: 2px 5px; color: var(--text); font: 10px/1.4 var(--mono); }
.shortcut-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; color: var(--muted); font-size: 11px; }
.shortcut-list > div { display: flex; align-items: center; gap: 6px; }
.toast { position: fixed; bottom: 44px; left: 50%; transform: translateX(-50%); z-index: 15; width: max-content; max-width: calc(100vw - 22px); display: flex; align-items: center; gap: 7px; padding: 9px 13px; background: #243347; color: #f2f6fb; border: 1px solid #536b86; border-radius: 7px; box-shadow: 0 6px 20px #0006; font-size: 12px; }
.toast .icon { color: var(--orange); width: 15px; height: 15px; }
@media (max-width: 1250px) {
  :root { --left: 215px; --right: 264px; }
  .rail-section { padding-inline: 12px; }
  .schedule-scroll, .export-footer { padding-inline: 11px; }
  .tool { padding-inline: 5px; gap: 4px; }
}
@media (max-width: 1030px) {
  .workbench { display: flex; }
  .drawing-workspace { width: 100%; }
  .tabbar-label { flex: 0 0 auto; padding-inline: 11px; }
  .rail { position: fixed; display: none; z-index: 12; top: 0; bottom: 0; width: min(315px, calc(100vw - 43px)); box-shadow: 0 0 40px #0006; }
  .left-rail { left: 0; }
  .right-rail { right: 0; }
  body[data-panel="plans"] .left-rail, body[data-panel="schedule"] .right-rail { display: flex; }
  .mobile-panel-head { min-height: 52px; display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 0 12px; border-bottom: 1px solid var(--line); }
  .mobile-panel-head strong { font-size: 13px; }
  .panel-backdrop { position: fixed; display: block; z-index: 11; inset: 0; width: 100%; height: 100%; border: 0; background: #080e17a6; }
  .mobile-nav { min-height: calc(50px + env(safe-area-inset-bottom)); flex: 0 0 auto; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); display: flex; gap: 7px; background: #111a25; border-top: 1px solid var(--line); }
  .mobile-nav .button { flex: 1; min-height: 35px; }
  .toast { bottom: calc(60px + env(safe-area-inset-bottom)); }
}
@media (max-width: 620px) {
  .topbar { padding: 0 8px; height: 57px; gap: 6px; }
  .brand { gap: 5px; }
  .brand-logo { width: clamp(83px, 24vw, 113px); }
  .brand-name, .brand-caption { display: none; }
  .header-rule { height: 22px; }
  .job-select { padding: 0 3px; gap: 3px; flex: 1; }
  .job-text strong { font-size: 11px; max-width: min(22vw, 124px); }
  .job-select .micro { font-size: 7px; }
  .job-select .icon { width: 10px; height: 10px; }
  .header-actions { gap: 4px; }
  .header-actions .button { min-height: 33px; padding: 0 6px; font-size: 10px; }
  .header-actions .button .icon { width: 13px; height: 13px; }
  .header-actions .help-button { display: none; }
  .tabbar { height: 39px; }
  .tabbar-label { display: none; }
  .document-tabs { padding: 5px 4px 0; }
  .document-tab { font-size: 10px; padding: 0 7px; gap: 4px; max-width: 34vw; }
  .document-tab .icon { width: 12px; height: 12px; }
  .tabbar-end { padding: 0 5px; }
  .hd-chip { font-size: 8px; padding: 4px; }
  .toolbar { padding: 0 4px; flex-basis: 43px; }
  .toolgroup { gap: 1px; }
  .tool { width: 30px; height: 32px; padding: 0; }
  .tool > span { display: none; }
  .tool .icon { width: 16px; height: 16px; }
  .tool.icon-only { width: 26px; }
  .tool-separator { margin: 0 2px; }
  .page-control select { min-width: 56px; font-size: 9px; height: 28px; padding-left: 4px; }
  .page-control .icon { top: 8px; }
  .zoom-value { min-width: 33px; font-size: 10px; }
  .view-footer { min-height: 29px; font-size: 8.5px; padding-inline: 5px; gap: 4px; }
  .view-coords { font-size: 8.5px; }
  .view-meta { top: 6px; left: 5px; right: 5px; }
  .view-file, .view-scale { font-size: 8px; min-height: 19px; padding-inline: 4px; }
  .canvas-guide { font-size: 9.5px; bottom: 6px; white-space: normal; width: max-content; }
}
@media (max-width: 365px) {
  .tool { width: 26px; }
  .tool.icon-only { width: 23px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

/* Keep page coordinates stable as the active tool's controls change. */
.mode-options {
  position: absolute;
  top: 48px;
  left: 0;
  right: 0;
  min-height: 43px;
  background: #1d2734fa;
  box-shadow: 0 2px 10px #070b1240;
}
.drawing-workspace:has(.mode-options:not([hidden])) .view-meta { visibility: hidden; }
@media (max-width: 620px) {
  .mode-options { top: 43px; }
  .control { font-size: 16px; }
}
a.button { text-decoration: none; }

.topbar { background: linear-gradient(100deg, #163d6c, #153158 56%, #132947); border-bottom-color: #35587e; }
.brand-name b { color: #a0d5ff; }
.brand-caption, .topbar .micro { color: #a5c3df; }
.markup-colours { display: inline-flex; gap: 4px; align-items: center; }
.markup-swatch { background: var(--swatch); border: 2px solid #243649; width: 22px; height: 22px; border-radius: 50%; }
.markup-swatch[aria-pressed="true"] { outline: 1px solid #fff; outline-offset: 1px; }
.viewport.highlighting { cursor: crosshair; }
@media (min-width: 1031px) and (max-width: 1190px) {
  .tool[data-mode] > span { display: none; }
  .tool[data-mode] { width: 31px; }
}
@media (max-width: 620px) {
  .tool[data-mode] { width: 27px; }
}
@media (max-width: 365px) {
  .tool[data-mode] { width: 23px; }
}

.units-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; color: var(--muted); font-size: 11px; }
.units-row select { color: var(--text); background: var(--surface-up); border: 1px solid var(--line); border-radius: 5px; padding: 3px 6px; }
.add-palette { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.add-palette .choice { min-height: 38px; }
@media (max-width: 1190px) { #add-to-plan { width: 31px; } #add-to-plan span { display: none; } }
@media (max-width: 620px) { #add-to-plan { width: 27px; } }
@media (max-width: 365px) { #add-to-plan { width: 23px; } }
.material-settings { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 5px; }
.material-settings label { display: grid; gap: 4px; font-size: 9px; color: var(--muted); }
.material-settings input { width: 100%; min-width: 0; background: #101925; color: var(--text); border: 1px solid var(--line); border-radius: 5px; padding: 5px; font-size: 11px; }
.material-row { display: flex; justify-content: space-between; gap: 5px; border-bottom: 1px solid var(--line-soft); padding: 7px 3px; font-size: 10.5px; color: var(--muted); }
.material-row strong { color: var(--text); font-family: var(--mono); white-space: nowrap; }
.material-row small { display: block; margin-top: 3px; color: var(--muted-soft); }

.axis-x { color: #ff8892; font-weight: 750; }
.axis-y { color: #83b2ff; font-weight: 750; }

.view-scale { pointer-events: auto; cursor: pointer; }
.view-scale.pending:not(:disabled) { border-color: #aa704f; }
.scale-review-text { display: flex; gap: 4px 7px; flex-wrap: wrap; align-items: center; }
.calibration-error { color: #ffadab; }
@media (max-width: 620px) {
  .view-scale { min-height: 28px; font-size: 9px; padding-inline: 6px; }
  .scale-review-text { flex-basis: 100%; font-size: 10px; }
  .mode-options:has(.scale-review-text) { gap: 4px; }
  .mode-options:has(.scale-review-text) .button { min-height: 32px; padding-inline: 6px; }
}

.view-actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; flex: 0 0 auto; }
.view-file { min-width: 0; }
.view-scale.axis-pick { font: 730 10px/1 var(--mono); }
.axis-pick.axis-x { color: #ffa0aa; border-color: #784651; }
.axis-pick.axis-y { color: #9abfff; border-color: #435f90; }
.axis-pick.wall-set { box-shadow: inset 0 -2px currentColor; }

.mode-options:has(.point-tools) { padding-block: 4px; }
.point-tools { display: flex; gap: 6px; align-items: center; flex: 1 1 100%; min-width: 0; }
.point-tools > select, .point-tools > .button { flex: 0 0 auto; }
.point-quick { display: flex; gap: 4px; align-items: center; flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: thin; padding: 1px; }
.point-tools .button, .point-tools select { min-height: 26px; padding-inline: 7px; font-size: 11px; }
.point-quick .button { flex: 0 0 auto; }
@media (max-width: 620px) {
  .point-tools .button, .point-tools select { min-height: 30px; }
}

.fixture-card { pointer-events: all; cursor: grab; }
.viewport.dragging .fixture-card { cursor: grabbing; }

.account-page { height: auto; min-height: 100dvh; overflow: auto; padding: 24px 14px; align-items: center; justify-content: center; }
.account-card { width: min(100%, 630px); padding: clamp(18px, 5vw, 32px); border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.account-card .brand-logo { width: 150px; }
.account-card h1 { font-size: clamp(23px, 5vw, 32px); }
.account-card h2 { font-size: 19px; }
.account-card p { color: var(--muted); line-height: 1.6; overflow-wrap: anywhere; }
.account-card a:not(.button) { color: #a0d5ff; }
.account-note { color: var(--muted); font-size: 12px; }
.account-links { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 18px; }
.usage-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.usage-stats div { display: grid; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 7px; }
.usage-stats strong { font-size: 23px; }
.usage-stats small { color: var(--muted); }
.account-card table { width: 100%; border-collapse: collapse; text-align: left; overflow-wrap: anywhere; }
.account-card :is(th, td) { border-bottom: 1px solid var(--line); padding: 8px; }
@media (max-width: 620px) { .tabbar-end .account-button { min-height: 26px; padding-inline: 6px; font-size: 10px; } }
