/* /try/ simulator. The CAD side stays dark on purpose: Civil 3D is dark, and
   every clip and screenshot on the site shows it that way. The SheetAgent
   palette and the dialogs copy the real ones (light, Segoe UI). */

.sa {
  --cad-bg: #14171c;
  --cad-bg-2: #1d2128;
  --cad-line: #2c323b;
  --cad-ink: #d9dde2;
  --cad-ink-2: #9aa3ad;
  --pal-bg: #f0f0f0;
  --pal-ink: #1a1a1a;
  --pal-blue: #0f4c9c;
  --pal-ok: #18802b;
  --pal-warn: #b46a00;
  --pal-err: #c4141e;
  --win: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --cad-font: "Arial Narrow", "Roboto Condensed", Arial, sans-serif;
  position: relative;
  margin-top: 28px;
}
.sa [hidden] { display: none !important; }
.sa-fallback { padding: 24px; border: 1px solid var(--rule); background: var(--cell); }
.sa.is-live .sa-fallback { display: none; }

/* --- the rail: steps, the current instruction, the engineer's button --- */
.sa-rail { border: 1px solid var(--line); border-bottom: 0; background: var(--sheet); }
.sa-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--rule); }
.sa-steps li { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-right: 1px solid var(--rule); color: var(--ink-3); min-width: 0; }
.sa-steps li:last-child { border-right: 0; }
.sa-step-no { flex: none; width: 24px; height: 24px; border: 1.5px solid currentColor; border-radius: 50%; display: grid; place-items: center; font-family: var(--mono); font-size: 12px; font-weight: 700; }
.sa-step-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 13px; line-height: 1.35; }
.sa-step-txt b { font-size: 14px; color: inherit; }
.sa-steps li.is-now { color: var(--ink); background: var(--accent-tint); box-shadow: inset 0 -3px 0 var(--accent); }
.sa-steps li.is-now .sa-step-no { background: var(--accent); border-color: var(--accent); color: #fff; }
.sa-steps li.is-done { color: var(--good); }
.sa-steps li.is-done .sa-step-no { background: var(--good); border-color: var(--good); color: #fff; font-size: 0; }
.sa-steps li.is-done .sa-step-no::after { content: "\2713"; font-size: 13px; }
.sa-hintrow { display: flex; gap: 16px; align-items: center; justify-content: space-between; padding: 12px 14px; flex-wrap: wrap; }
.sa-hint { margin: 0; font-size: 16px; line-height: 1.45; color: var(--ink); flex: 1 1 360px; min-width: 0; }
.sa-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.sa-btn-change, .sa-btn-reset {
  font: 600 14px/1 var(--font); padding: 11px 16px; border-radius: 0; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--sheet); color: var(--ink);
}
.sa-btn-change { background: var(--ink); color: #fff; }
.sa-btn-change:disabled { opacity: 0.35; cursor: not-allowed; }
.sa-btn-reset { border-color: var(--rule); color: var(--ink-2); }
.sa-btn-change:hover:not(:disabled) { background: #2b333d; }
.sa-btn-reset:hover { border-color: var(--line); color: var(--ink); }
.sa-btn-change:focus-visible, .sa-btn-reset:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.sa-end { border-top: 1px solid var(--rule); padding: 14px; background: var(--accent-tint); display: flex; gap: 14px 20px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.sa-end p { margin: 0; font-size: 15px; max-width: 60ch; }
.sa-end-acts { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.sa-end-acts > a:not(.hero-cta) { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* --- the app frame --- */
.sa-app { display: grid; grid-template-columns: minmax(0, 1fr) 268px; height: clamp(560px, 74vh, 760px); border: 1px solid var(--line); background: var(--cad-bg); }
.sa-draw { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.sa-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; background: var(--cad-bg); }
.sa-stage.is-layout { background: #2a2e35; }
.sa-model { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; user-select: none; -webkit-user-select: none; }
.sa-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.sa-vplabel { position: absolute; left: 8px; top: 6px; font: 12px/1 var(--win); color: var(--cad-ink-2); pointer-events: none; }
.sa-stage.is-layout .sa-vplabel { display: none; }
.sa-coords { position: absolute; right: 8px; bottom: 6px; font: 11px/1 var(--mono); color: var(--cad-ink-2); pointer-events: none; }
.sa-zoom { position: absolute; right: 8px; bottom: 24px; display: flex; flex-direction: column; gap: 4px; z-index: 2; }
.sa-zoom button { width: 32px; height: 32px; border: 1px solid #3a414b; background: rgba(29,33,40,0.92); color: var(--cad-ink); font: 600 17px/1 var(--win); cursor: pointer; }
.sa-zoom button:hover { background: #2c323b; }
.sa-zoom button:focus-visible, .sa-tab:focus-visible, .sa-chip:focus-visible { outline: 2px solid #6aa6ff; outline-offset: 1px; }

.mv-ucs path { fill: #d0d4d9; stroke: #d0d4d9; stroke-width: 1.2; }
.mv-ucs text { fill: #d0d4d9; font: 11px var(--win); }
.sa-model .tx { font-family: var(--cad-font); }
.sa-model.z-sm .t-sm, .sa-model.z-ml .t-ml, .sa-model.z-pr .t-pr { display: none; }
.mv-ptile polygon { stroke: #9fd6ff; stroke-dasharray: 8 5; fill: none; }
.mv-ptile .mv-tlabel { fill: #9fd6ff; }
.mv-letter { font-weight: 700; font-family: var(--win); }
.mv-tile polygon { fill: rgba(242,242,242,0.02); stroke: #f2f2f2; stroke-width: 1.3; }
.mv-tile .mv-tlabel { fill: #f2f2f2; font-family: var(--cad-font); paint-order: stroke; stroke: #14171c; stroke-width: 0.18em; stroke-linejoin: round; }
.mv-tile.is-sel polygon { stroke: #6aa6ff; stroke-dasharray: 6 4; fill: rgba(106,166,255,0.08); }
.mv-tile.is-drift polygon { stroke: #ff9f1a; fill: rgba(255,159,26,0.08); }
.mv-tile.is-drift .mv-tlabel { fill: #ff9f1a; }
.mv-tile.is-flash polygon { stroke: #3ee07a; fill: rgba(62,224,122,0.12); }
.mv-tile.is-flash .mv-tlabel { fill: #3ee07a; }
.mv-grips .grip { fill: #2a6bff; stroke: #fff; stroke-width: 1; }
.mv-grips .grip-rot { fill: #ff9f1a; cursor: grab; }
.mv-grips .grip-arm { stroke: #ff9f1a; stroke-dasharray: 3 3; }
.mv-pick-name { font-weight: 700; paint-order: stroke; stroke: #14171c; stroke-width: 6px; }

/* --- layouts --- */
.sa-sheets { position: absolute; inset: 0; overflow: auto; }
.sa-sheets.is-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; padding: 16px; align-content: start; }
.sa-sheets.is-single { overflow: hidden; touch-action: none; }
.sa-sheets.is-single .sa-card { display: none; }
.sa-sheets.is-single .sa-card.is-shown { display: block; position: absolute; inset: 0; margin: 0; }
.sa-sheets.is-single .sa-card figcaption { display: none; }
.sa-card { margin: 0; cursor: default; }
.sa-sheets.is-grid .sa-card { cursor: zoom-in; }
.sa-card figcaption { display: flex; justify-content: space-between; gap: 8px; font: 12px/1.3 var(--win); color: var(--cad-ink-2); margin-bottom: 6px; }
.sa-card figcaption b { color: var(--cad-ink); font-size: 13px; }
.sa-card.is-updated figcaption span { color: #3ee07a; font-weight: 600; }
.sa-card.is-updated .sa-paper { outline: 2px solid #3ee07a; }
.sa-card.is-skipped figcaption span { color: var(--cad-ink-2); }
.sa-card.is-new { animation: sa-in .35s var(--ease-out) both; }
.sa-paper { display: block; width: 100%; height: auto; background: #2a2e35; }
.sa-sheets.is-single .sa-paper { height: 100%; }
.sa-sheets.is-grid .sa-paper { aspect-ratio: 37.2 / 25.2; box-shadow: 0 2px 10px rgba(0,0,0,0.45); }
.sa-paper .pp-paper { fill: #050607; }
.sa-paper .pl { fill: none; stroke: #e9ecef; stroke-width: 1; vector-effect: non-scaling-stroke; }
.sa-paper .pl-dim { stroke: #59606a; }
.sa-paper .pl-vp { stroke: #6f7781; stroke-dasharray: 5 3; }
.sa-paper .pl-fill { fill: #e9ecef; }
.sa-paper .pl-dash { stroke-dasharray: 4 3; stroke: #8a929c; }
.sa-paper .pt { fill: #e9ecef; font-family: var(--cad-font); }
.sa-paper .pt-h { font-weight: 700; }
.sa-paper .pt-dim { fill: #8a929c; }
.sa-paper .pt-att { fill: #3fd0d0; }
.sa-paper .pt-no { font-weight: 700; }
.sa-paper .tx { font-family: var(--cad-font); }
.sa-paper .ctl { paint-order: stroke; stroke: #050607; stroke-width: 0.3em; stroke-linejoin: round; }
@keyframes sa-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* --- command line and layout tabs --- */
.sa-cmd { height: 76px; overflow-y: auto; background: #0e1014; border-top: 1px solid var(--cad-line); padding: 6px 10px; font: 12.5px/1.5 var(--mono); color: var(--cad-ink-2); }
.sa-cl { white-space: normal; overflow-wrap: anywhere; }
.sa-cl:last-child { color: var(--cad-ink); }
.sa-cl.is-prompt { color: var(--cad-ink); }
.sa-cl.is-warn { color: #ffb347; }
.sa-chip { font: 600 12px/1 var(--mono); margin-left: 6px; padding: 4px 8px; border: 1px solid #4a525d; background: #1d2128; color: #9fc3ff; cursor: pointer; }
.sa-chip.is-main { border-color: #6aa6ff; color: #fff; background: #1f3a66; }
.sa-chip:hover:not(:disabled) { background: #2c3a52; }
.sa-chip:disabled { opacity: 0.4; cursor: default; }
.sa-ans { margin-left: 8px; color: #fff; }
.sa-tabs { display: flex; gap: 2px; overflow-x: auto; background: var(--cad-bg-2); border-top: 1px solid var(--cad-line); padding: 0 6px; scrollbar-width: thin; }
.sa-tab { flex: none; font: 12px/1 var(--win); padding: 8px 12px 7px; border: 0; border-top: 2px solid transparent; background: transparent; color: var(--cad-ink-2); cursor: pointer; white-space: nowrap; }
.sa-tab:hover { color: var(--cad-ink); background: #262b33; }
.sa-tab.is-on { color: #fff; background: var(--cad-bg); border-top-color: #6aa6ff; }
.sa-tab.is-upd::after { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #3ee07a; margin-left: 6px; vertical-align: middle; }
.sa-tab-grid { margin-left: auto; }

/* --- the SheetAgent palette (light, like the real one) --- */
.sa-pal { position: relative; display: flex; flex-direction: column; min-height: 0; background: var(--pal-bg); border-left: 1px solid #0b0d10; font-family: var(--win); color: var(--pal-ink); }
.sa-pp { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
.sa-pp-head { flex: none; display: flex; align-items: center; justify-content: space-between; font: 11px/1 var(--win); letter-spacing: 0.02em; color: #d6d9dd; background: #3b4048; padding: 6px 8px; }
.sa-pp-head::before { content: "||"; margin-right: 6px; color: #8a9099; }
.sa-pp-head { justify-content: flex-start; }
.sa-pp-tabs { flex: none; display: flex; gap: 0; overflow-x: auto; background: #e3e3e3; border-bottom: 1px solid #c8c8c8; scrollbar-width: none; }
.sa-pp-tabs button { flex: none; font: 12px/1 var(--win); padding: 7px 8px; border: 0; background: transparent; color: #555; cursor: pointer; }
.sa-pp-tabs button.is-on { background: #fff; color: #000; font-weight: 600; }
.sa-pp-tabs button.is-na { color: #8d8d8d; }
.sa-pp-body { flex: 1; overflow-y: auto; padding: 8px 8px 12px; }
.sa-pp-note { flex: none; margin: 0; padding: 7px 9px; font: 11.5px/1.4 var(--win); color: #5a4300; background: #fff6d6; border-bottom: 1px solid #e6d69a; }
.sa-dl-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin: 2px 0 4px; }
.sa-dl-inline .sa-dl-radios { margin-top: 0; }
.sa-status { list-style: none; margin: 0 0 6px; padding: 0; font: 600 12.5px/1.55 var(--win); }
.sa-status li.is-ok { color: var(--pal-ok); }
.sa-status li.is-todo { color: #777; font-weight: 400; }
.sa-status li.is-warn { color: var(--pal-warn); }
.sa-sec { margin: 12px 0 6px; font: 700 12.5px/1 var(--win); letter-spacing: 0.02em; color: var(--pal-blue); }
.sa-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.sa-pb {
  position: relative; font: 600 12px/1.2 var(--win); min-height: 38px; padding: 4px 3px; border: 1px solid #c3c3c3; background: #fbfbfb; color: #1a1a1a;
  cursor: pointer; text-align: center; overflow-wrap: anywhere;
}
.sa-pb:hover { background: #e8f0fd; border-color: #8fb3eb; }
.sa-pb:focus-visible { outline: 2px solid #1d6fe0; outline-offset: 1px; }
.sa-pb.is-off { color: #a3a3a3; background: #f3f3f3; border-color: #d6d6d6; cursor: not-allowed; }
.sa-pb.is-na { color: #9a9a9a; border-style: dashed; background: #f3f3f3; }
.sa-pb.is-done::after { content: "\2713"; position: absolute; top: 2px; right: 4px; font-size: 10px; color: var(--pal-ok); }
/* Show full palette: the plugin's other controls, for a look (Ramy 2026-10-14). */
.sa-pp:not(.is-full) .sa-full { display: none; }
.sa-pb.is-look { color: #6f6f6f; background: #f6f6f6; border-color: #d4d4d4; font-weight: 500; }
.sa-pb.is-look:hover { background: #eef1f5; border-color: #b9c3cf; }
.sa-pp.is-full .sa-pb:not(.is-look) { border-color: #8fb3eb; box-shadow: inset 3px 0 0 #1d6fe0; }
.sa-new { position: absolute; top: -6px; right: 3px; padding: 1px 3px; font: 700 8.5px/1 var(--win); font-style: normal; color: #c88200; background: #fff4e0; border: 1px solid #f0d6a8; }
.sa-pp.is-full .sa-grid { row-gap: 7px; }
.sa-pp-foot { flex: none; padding: 8px; background: #e4e7eb; border-top: 1px solid #c3c8ce; }
.sa-pp-fullbtn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 10px 12px;
  font: 700 13px/1.2 var(--win); letter-spacing: 0.01em; color: #fff; background: var(--pal-blue);
  border: 1px solid #0a3a78; box-shadow: 0 1px 2px rgba(0,0,0,0.18); cursor: pointer;
}
.sa-pp-fullbtn::after { content: "\25BE"; font-size: 13px; line-height: 1; }
.sa-pp-fullbtn[aria-expanded="true"]::after { content: "\25B4"; }
.sa-pp-fullbtn:hover { background: #0b3d80; }
.sa-pp-fullbtn:focus-visible { outline: 2px solid #1d6fe0; outline-offset: 2px; }
.sa-pb.is-pulse, .sa-btn-change.is-pulse, .sa-chip.is-main { animation: sa-pulse 1.6s ease-in-out infinite; }
@keyframes sa-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(11,97,244,0.55); } 50% { box-shadow: 0 0 0 5px rgba(11,97,244,0); } }
.sa-dot { position: absolute; top: 4px; left: 4px; width: 7px; height: 7px; border-radius: 50%; background: #bbb; }
.sa-dot.is-ok { background: #1fa33a; }
.sa-dot.is-warn { background: #f29b00; box-shadow: 0 0 0 2px rgba(242,155,0,0.25); }

.sa-hp { flex: none; display: flex; flex-direction: column; max-height: 52%; border-top: 2px solid #0b0d10; background: #f6f6f6; }
.sa-hp:focus { outline: none; }
.sa-hp-x { margin-left: auto; border: 0; background: transparent; color: #d6d9dd; font-size: 16px; line-height: 1; cursor: pointer; padding: 0 2px; }
.sa-hp-list { list-style: none; margin: 0; padding: 8px; overflow-y: auto; flex: 1; font: 600 12.5px/1.45 var(--win); }
.sa-hp-list li { display: flex; gap: 6px; margin-bottom: 8px; }
.sa-hp-list .hp-ic { flex: none; width: 12px; }
.hp-err { color: var(--pal-err); }
.hp-warn { color: var(--pal-warn); }
.hp-ok { color: var(--pal-ok); }
.hp-info { color: #1f6fb8; }
.sa-hp-list.is-flash { animation: sa-in .3s ease-out; }
.sa-hp-btns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 6px 8px 8px; border-top: 1px solid #ddd; }
.sa-hp-btns .sa-pb { min-height: 32px; font-size: 11.5px; }
.sa-hp-btns .sa-pb[hidden] { display: none; }

.sa-toast { position: absolute; left: 8px; right: 8px; bottom: 8px; z-index: 3; padding: 10px 12px; background: #23272e; color: #f2f2f2; font: 13px/1.4 var(--win); box-shadow: 0 4px 16px rgba(0,0,0,0.3); }

/* --- dialogs (Windows look, like the real Sheet Naming dialog) --- */
.sa-dlg-wrap { position: absolute; inset: 0; z-index: 20; background: rgba(8,10,14,0.45); display: grid; place-items: center; padding: 16px; }
.sa-dlg-wrap[hidden] { display: none; }
.sa-dl { width: min(640px, 100%); max-height: calc(100% - 8px); display: flex; flex-direction: column; background: #f0f0f0; color: #1a1a1a; font: 13px/1.4 var(--win); box-shadow: 0 10px 40px rgba(0,0,0,0.45); border: 1px solid #8a8a8a; }
.sa-dl-head { flex: none; display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: #fff; font-size: 13px; }
.sa-dl-ic { width: 14px; height: 14px; background: linear-gradient(135deg, #1d3557 0 50%, #457b9d 50%); }
.sa-dl-x { margin-left: auto; border: 0; background: transparent; font-size: 18px; line-height: 1; cursor: pointer; padding: 2px 8px; }
.sa-dl-x:hover { background: #e81123; color: #fff; }
.sa-dl-body { flex: 1; overflow-y: auto; padding: 12px 18px 6px; }
.sa-dl-lead { margin: 0 0 12px; font-size: 14px; }
.sa-dl-grid { display: grid; grid-template-columns: max-content minmax(0, max-content) minmax(0, 1fr); gap: 7px 12px; align-items: center; }
.sa-dl-grid > label { white-space: nowrap; }
.sa-dl-ctl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.sa-dl-help { color: #767676; font-style: italic; font-size: 12px; min-width: 0; }
.sa-dl input[type=text], .sa-dl input[type=number], .sa-dl select { font: 13px var(--win); padding: 3px 5px; border: 1px solid #7a7a7a; background: #fff; color: #000; border-radius: 0; height: 26px; }
.sa-dl input:focus, .sa-dl select:focus { outline: 2px solid #1d6fe0; outline-offset: 0; }
.sa-dl input:disabled { background: #f4f4f4; color: #9a9a9a; border-color: #c8c8c8; }
.sa-dl .w-name { width: 190px; }
.sa-dl .w-sm { width: 86px; }
.sa-dl .w-xs { width: 58px; }
.sa-dl-or { color: #767676; font-style: italic; }
.sa-dl-inl { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.sa-dl-fs { border: 0; margin: 12px 0 0; padding: 0; }
.sa-dl-fs legend { padding: 0; font-weight: 700; font-size: 14px; color: #12397a; margin-bottom: 4px; }
.sa-dl-sub { margin: 0 0 4px; color: #767676; font-style: italic; font-size: 12px; }
.sa-dl-radios { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 4px; }
.sa-dl-radios label { display: inline-flex; gap: 4px; align-items: center; }
.sa-dl-range { display: flex; gap: 8px; align-items: center; margin: 6px 0 0 20px; flex-wrap: wrap; }
.sa-dl-tbl { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid #b9b9b9; margin: 6px 0 10px; font-size: 13px; }
.sa-dl-tbl th { text-align: left; font-weight: 600; padding: 4px 8px; border-bottom: 1px solid #d0d0d0; background: #f7f7f7; }
.sa-dl-tbl td { padding: 5px 8px; border-bottom: 1px solid #eee; }
.sa-dl-tbl input:disabled + .sa-dl-letter { opacity: 0.45; }
.sa-dl-letter { margin-left: 6px; font-weight: 700; color: #0aa3a3; }
.sa-dl-ro { color: #444; padding: 3px 0; }
.sa-dl-err { color: #c4141e; min-height: 1.4em; margin: 10px 0 0; }
.sa-dl-foot { flex: none; display: flex; justify-content: flex-end; gap: 8px; padding: 10px 18px 14px; }
.sa-dl-foot button { min-width: 74px; font: 13px var(--win); padding: 5px 12px; border: 1px solid #adadad; background: #e1e1e1; cursor: pointer; }
.sa-dl-foot button:hover { background: #e5f1fb; border-color: #0078d7; }
.sa-dl-foot .sa-dl-ok { border: 2px solid #0078d7; font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  .sa *, .sa *::before, .sa *::after { animation: none !important; transition: none !important; }
}

/* Phones and narrow windows: the palette goes under the drawing. */
@media (max-width: 860px) {
  .sa-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sa-steps li:nth-child(2) { border-right: 0; }
  .sa-steps li:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }
  .sa-app { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; height: auto; }
  .sa-draw { height: 62vh; min-height: 380px; }
  .sa-pal { border-left: 0; border-top: 1px solid #0b0d10; max-height: none; }
  .sa-pp-body { overflow: visible; }
  .sa-hp { max-height: none; }
  .sa-cmd { height: 64px; font-size: 12px; }
  .sa-dlg-wrap { position: fixed; z-index: 1000; }
  .sa-dl-grid { grid-template-columns: max-content minmax(0, 1fr); }
  .sa-dl-help { display: none; }
}
@media (max-width: 520px) {
  .sa-steps { grid-template-columns: minmax(0, 1fr); }
  .sa-steps li { border-right: 0; border-bottom: 1px solid var(--rule); padding: 9px 12px; }
  .sa-step-txt span { display: none; }
  .sa-hint { font-size: 15px; }
  .sa-sheets.is-grid { grid-template-columns: minmax(0, 1fr); }
}

/* --- the Welcome chooser: every layout type, over the drawing --- */
.sa-chooser { position: absolute; inset: 0; z-index: 4; overflow-y: auto; background: rgba(12, 14, 18, 0.78); display: flex; align-items: flex-start; justify-content: center; padding: 22px 18px; }
.sa-ch-box { width: min(760px, 100%); background: var(--sheet); color: var(--ink); border: 1px solid var(--line); padding: 20px 22px 18px; box-shadow: 0 14px 40px rgba(0,0,0,0.45); }
.sa-ch-h { margin: 0; font: 800 22px/1.2 var(--font); }
.sa-ch-lead { margin: 6px 0 12px; font-size: 14.5px; line-height: 1.45; color: var(--ink-2); }
.sa-ch-g { margin: 14px 0 8px; font: 700 11.5px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.sa-ch-grid { display: grid; gap: 8px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sa-ch-single { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.sa-ch-card { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; text-align: left; padding: 10px 11px 12px; border: 1.5px solid var(--rule); background: var(--sheet); color: var(--ink); cursor: pointer; font: inherit; min-width: 0; }
.sa-ch-card:hover { border-color: var(--accent); background: var(--accent-tint); }
.sa-ch-card:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.sa-ch-card.is-first { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.sa-ch-ic { width: 64px; height: 44px; flex: none; background: #14171c; padding: 2px; }
.sa-ch-ic path { fill: none; stroke: #9fd6ff; stroke-width: 1.4; stroke-linejoin: round; }
.sa-ch-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sa-ch-txt b { font-size: 15px; }
.sa-ch-txt span { font-size: 12.5px; line-height: 1.4; color: var(--ink-2); }
.sa-ch-more { margin: 0; padding: 0 0 0 18px; font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.sa-ch-more a { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.sa-pp-intro { margin: 0 0 4px; font: 12.5px/1.4 var(--win); color: #333; }
.mv-ghost polygon { fill: rgba(106,166,255,0.08); stroke: #6aa6ff; stroke-dasharray: 8 5; stroke-width: 1.3; }
.mv-ghost .mv-tlabel { fill: #6aa6ff; font-family: var(--cad-font); }
.sa-dl-order { display: inline-grid; grid-template-columns: repeat(3, 26px); gap: 2px; margin: 8px 0 0; }
.sa-dl-order span { display: grid; place-items: center; height: 20px; border: 1px solid #9a9a9a; background: #fff; font: 600 12px var(--win); }
@media (max-width: 860px) {
  .sa-ch-grid, .sa-ch-single { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sa-chooser { padding: 12px; }
}
@media (max-width: 520px) {
  .sa-ch-grid, .sa-ch-single { grid-template-columns: minmax(0, 1fr); }
  .sa-ch-card { flex-direction: row; }
}
.sa-freebar { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); z-index: 3; display: flex; align-items: center; gap: 12px; max-width: calc(100% - 24px); padding: 8px 8px 8px 14px; background: rgba(20, 24, 30, 0.94); border: 1px solid #3a5f9a; color: #dfe6ef; font: 13px/1.35 var(--win); box-shadow: 0 6px 20px rgba(0,0,0,0.4); }
.sa-freebar button { flex: none; font: 700 14px/1 var(--font); padding: 10px 16px; border: 0; background: var(--accent); color: #fff; cursor: pointer; }
.sa-freebar button:disabled { opacity: 0.4; cursor: default; }
.sa-freebar button:focus-visible { outline: 2px solid #6aa6ff; outline-offset: 2px; }
.sa-pp-greet { margin: 2px 0 2px; font: 700 15px/1.3 var(--win); color: var(--pal-blue); }
.sa-dl-tbl td.ok { color: var(--pal-ok); font-weight: 600; white-space: nowrap; }
.sa-dl-tbl td.warn { color: var(--pal-warn); font-weight: 600; white-space: nowrap; }

/* ---- Project Control (2026-10-14) ---- */
.mv-tile.is-dim polygon { stroke: #59616b; stroke-dasharray: 5 5; fill: none; }
.mv-tile.is-dim .mv-tlabel { fill: #6b737d; }
.sa-ftabs { flex: none; display: flex; gap: 1px; overflow-x: auto; background: #1b1f25; border-bottom: 1px solid var(--cad-line); padding: 3px 6px 0; scrollbar-width: thin; }
.sa-ftab { flex: none; font: 12px/1 var(--win); padding: 7px 14px; border: 1px solid transparent; border-bottom: 0; background: #262b33; color: var(--cad-ink-2); cursor: pointer; white-space: nowrap; }
.sa-ftab:hover { color: var(--cad-ink); }
.sa-ftab.is-on { background: var(--cad-bg); color: #fff; border-color: var(--cad-line); border-top: 2px solid #6aa6ff; }
.sa-ftab:focus-visible { outline: 2px solid #6aa6ff; outline-offset: -2px; }
.sa-ssm { position: absolute; inset: 0; overflow: auto; padding: 14px; background: #ececec; color: #1a1a1a; font: 13px/1.4 var(--win); }
.sa-ssm-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 6px 10px; background: #3b4048; color: #d6d9dd; font: 11px/1.2 var(--win); letter-spacing: 0.02em; }
.sa-ssm-head span { color: #fff; font-size: 13px; letter-spacing: 0; }
.sa-ssm-lead { margin: 8px 0 12px; color: #444; }
.sa-ssm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; align-items: start; }
.sa-ssm-sub { min-width: 0; background: #fff; border: 1px solid #c8c8c8; }
.sa-ssm-sub h4 { display: flex; justify-content: space-between; gap: 8px; margin: 0; padding: 7px 10px; font: 700 13px/1.2 var(--win); color: var(--pal-blue); background: #f5f7fa; border-bottom: 1px solid #dcdcdc; }
.sa-ssm-sub h4 span { font-weight: 400; color: #666; }
.sa-ssm-sub ul { list-style: none; margin: 0; padding: 4px; display: grid; gap: 4px; }
.sa-ssm-file { display: grid; grid-template-columns: 54px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 8px; width: 100%; padding: 5px 6px; text-align: left; font: 12px/1.3 var(--win); color: #1a1a1a; background: #fbfbfb; border: 1px solid #d6d6d6; cursor: pointer; }
.sa-ssm-file:hover { background: #e8f0fd; border-color: #8fb3eb; }
.sa-ssm-file:focus-visible { outline: 2px solid #1d6fe0; outline-offset: 1px; }
.sa-ssm-map { grid-row: 1 / span 2; width: 54px; height: 40px; background: #1d2128; }
.sa-ssm-map polygon { fill: none; stroke: #59616b; stroke-width: 12; }
.sa-ssm-map polygon.is-mine { fill: rgba(106,166,255,0.35); stroke: #9cc4ff; }
.sa-ssm-txt { display: flex; flex-direction: column; min-width: 0; }
.sa-ssm-txt b { font-weight: 600; overflow-wrap: anywhere; }
.sa-ssm-txt span { color: #555; overflow-wrap: anywhere; }
.sa-ssm-file em { grid-column: 2; font-style: normal; font-size: 11px; color: #777; }
.sa-ssm-file.is-updated { border-color: #3fae5c; box-shadow: inset 3px 0 0 #3fae5c; }
.sa-ssm-file.is-updated em { color: #23893f; font-weight: 700; }
.sa-ssm-file.is-new em { color: var(--pal-ok); }
.sa-dl.sa-dl-wide { width: min(860px, 100%); }
.sa-dl-tblwrap { overflow-x: auto; }
.sa-pc-tbl input { width: 100%; min-width: 0; }
.sa-pc-tbl input.w-xs { width: 3.6em; }
.sa-pc-tbl tr.is-sel td { background: #e8f0fd; }
.sa-pc-tbl tr.is-bad td { background: #fdecea; }
.sa-pc-tbl .sa-pc-will { font-family: Consolas, ui-monospace, monospace; font-size: 12px; white-space: nowrap; }
.sa-pc-tbl tr.is-bad .sa-pc-will { color: #b3261e; font-family: inherit; }
.sa-pc-mono { font-family: Consolas, ui-monospace, monospace; font-size: 12px; }
.sa-pc-head { gap: 6px 14px; margin: 4px 0 8px; }
.sa-pc-head input { margin-left: 4px; }
.sa-pc-rowacts { gap: 6px; margin: 0 0 6px; }
.sa-pc-rowacts button, .sa-dl-mini { font: 12px/1 var(--win); padding: 5px 10px; border: 1px solid #adadad; background: #e1e1e1; cursor: pointer; margin-left: 4px; }
.sa-pc-mode { display: flex; gap: 10px; margin: 10px 0; }
.sa-pc-mode button { flex: 1; padding: 14px 10px; font: 600 14px/1 var(--win); border: 1px solid #adadad; background: #e1e1e1; cursor: pointer; }
.sa-pc-mode button.sa-dl-ok { background: #fff; border-color: #1d6fe0; color: #0f4c9c; }
.sa-pc-mode button:disabled { color: #9a9a9a; cursor: not-allowed; }
@media (max-width: 520px) {
  .sa-ssm { padding: 10px; }
  .sa-ssm-grid { grid-template-columns: minmax(0, 1fr); }
}
/* Wide dialogs on a phone: the column is the screen, the table scrolls inside. */
.sa-dlg-wrap { grid-template-columns: minmax(0, 1fr); }
.sa-dl { min-width: 0; justify-self: center; }
.sa-dl-body { min-width: 0; }
.sa-pc-tbl { min-width: 560px; }
.sa-dl select { max-width: 100%; }
/* Every file card the same height, whatever the discipline's name (Ramy 2026-10-14):
   the name always takes two lines, the sheet range and the status one each. */
.sa-ssm-file { grid-template-rows: auto auto; align-items: start; }
.sa-ssm-txt b { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; height: 2.6em; line-height: 1.3; }
.sa-ssm-txt span, .sa-ssm-file em { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sa-ch-sim { margin: -6px 0 14px; padding: 7px 10px; font-size: 13px; line-height: 1.4; color: #5a4300; background: #fff6d6; border: 1px solid #e6d69a; }
