html.signs-page, html body.signs-page {
  height: 100dvh !important; min-height: 0 !important; overflow: hidden !important;
  margin: 0 !important; padding: 0 !important;
}
html body.signs-page { display: block !important; }
html.signs-page body.admin-mode.signs-page > header.topbar,
html.signs-page body.user-mode.signs-page > header.topbar {
  position: fixed !important; inset: 14px 14px auto !important;
  width: auto !important; margin: 0 !important; z-index: 99999 !important;
}
@media (min-width: 1181px) {
  html.signs-page body.signs-page .topbar .site-main-nav { flex: 1 1 auto !important; }
}
.signs-page .sign-workshop {
  --sign-control-bg: #1c222c; --sign-control-text: #f1f4fa;
  --sign-line: #343c49; --sign-muted: #a7b3c5;
  position: fixed; top: var(--sign-top, 96px); left: 0; right: 0;
  height: max(0px, calc(var(--sign-viewport-height, 100dvh) - var(--sign-top, 96px) - max(12px, env(safe-area-inset-bottom))));
  max-width: 1680px; margin: 0 auto; padding: 0 20px; box-sizing: border-box;
  display: flex; flex-direction: column; min-height: 0; letter-spacing: 0;
  color-scheme: dark;
}
.sign-workshop [hidden] { display: none !important; }
.sign-heading { display: flex; flex: 0 0 auto; justify-content: space-between; align-items: center; gap: 12px; margin: 0 0 12px; }
.sign-heading h1 { font-size: 22px; line-height: 1.25; margin: 0; }
.sign-unit, .sign-workshop small, .sign-disclaimer { color: var(--sign-muted); font-size: 12px; }
.sign-view-tabs { display: none; }
.sign-layout { flex: 1; min-height: 0; display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 22px; }
.sign-controls { min-width: 0; min-height: 0; display: flex; flex-direction: column; border-right: 1px solid var(--sign-line); padding-right: 16px; }
.sign-controls-fields { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; padding: 0 6px 0 0; }
.sign-controls-footer { flex: 0 0 auto; padding-top: 12px; }
.sign-controls fieldset { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }
.sign-controls legend { font-size: 14px; font-weight: 700; margin-bottom: 10px; }
.sign-workshop label { display: flex; flex-direction: column; gap: 5px; min-width: 0; font-size: 12px; margin: 0 0 10px; }
.sign-workshop input, .sign-workshop select {
  width: 100%; min-width: 0; box-sizing: border-box; height: 38px; padding: 7px 9px;
  border: 1px solid var(--sign-line); border-radius: 6px;
  background: var(--sign-control-bg); color: var(--sign-control-text); font: inherit; color-scheme: inherit;
}
.sign-workshop select option, .sign-workshop select optgroup { background-color: var(--sign-control-bg); color: var(--sign-control-text); }
.sign-workshop input[type=file] { height: auto; white-space: normal; font-size: 11px; }
.sign-workshop input::file-selector-button { background: var(--sign-control-bg); color: var(--sign-control-text); border: 1px solid var(--sign-line); border-radius: 4px; padding: 4px 6px; }
.sign-workshop :focus-visible { outline: 2px solid #7ebdef; outline-offset: 2px; }
.sign-field-pair { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0 10px; }
.sign-segments { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 12px; border-bottom: 1px solid var(--sign-line); }
.sign-segments button, .sign-view-tabs button { height: 36px; border: 0; border-bottom: 2px solid transparent; color: inherit; background: transparent; cursor: pointer; font: inherit; font-size: 13px; }
.sign-segments button[aria-pressed=true], .sign-view-tabs button[aria-selected=true] { border-bottom-color: #26bce2; color: #66d7ee; }
.sign-stage-column { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.sign-preview-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex: 0 0 auto; padding-bottom: 8px; }
.sign-preview-tools .sign-segments { margin: 0; width: 148px; }
.sign-workshop .sign-toggle { flex-direction: row; justify-content: flex-start; align-items: center; margin: 0; min-height: 36px; gap: 8px; cursor: pointer; }
.sign-workshop .sign-toggle > span { min-width: 0; line-height: 1.4; overflow-wrap: anywhere; }
/* Admin text-input rules must not stretch native checkbox and color controls. */
body.signs-page .sign-workshop .sign-toggle input[type=checkbox] {
  flex: 0 0 18px; width: 18px !important; max-width: 18px !important;
  height: 18px; min-height: 18px; margin: 0; padding: 0; accent-color: #36bddd; box-shadow: none !important;
}
body.signs-page .sign-workshop #sign-led-color { flex: 0 0 40px; width: 40px !important; max-width: 40px !important; height: 32px; margin: 0; padding: 3px; cursor: pointer; }
.sign-colors { display: block; min-width: 0; border: 0; margin: 10px 0; padding: 0; }
.sign-colors legend { font-size: 12px; margin-bottom: 4px; padding: 0; }
.sign-colors-options { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.sign-workshop .sign-colors label { display: grid; place-items: center; position: relative; flex: 0 0 36px; width: 36px; height: 36px; margin: 0; gap: 0; cursor: pointer; }
.sign-workshop .sign-colors input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; cursor: pointer; }
.sign-colors span:not(.sr-only) { display: block; background: var(--swatch); border: 2px solid #657082; width: 24px; height: 24px; border-radius: 50%; pointer-events: none; }
.sign-colors input:checked + span, .sign-colors input:focus-visible + span { outline: 2px solid #64d8ed; outline-offset: 2px; }
.sign-workshop button:disabled { cursor: not-allowed; opacity: .5; }
.sign-workshop #sign-order-status { font-size: 13px; overflow-wrap: anywhere; }
.sign-workshop #sign-order-status:empty { display: none; }
.sign-scene { position: relative; flex: 1 1 0; min-height: 0; overflow: hidden; background: #10151c; touch-action: none; }
.sign-scene canvas { display: block; width: 100%; height: 100%; }
.sign-scene-label { position: absolute; left: 12px; top: 12px; font-size: 12px; color: #b8c5d8; pointer-events: none; max-width: calc(100% - 64px); }
.sign-camera { position: absolute; right: 10px; top: 8px; z-index: 1; width: 36px; height: 36px; border: 1px solid #536171; border-radius: 6px; background: #1d2633; color: white; font-size: 24px; cursor: pointer; }
.sign-view-error { position: absolute; inset: 50% 20px auto; text-align: center; color: #e6c878; }
.sign-result-panel { flex: 0 1 auto; min-height: 0; max-height: 45%; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; padding-right: 4px; }
.sign-summary { display: grid; grid-template-columns: minmax(0,1fr) 140px auto; gap: 16px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--sign-line); }
.sign-summary h2 { font-size: 17px; margin: 0 0 4px; }
.sign-summary p { font-size: 12px; color: var(--sign-muted); margin: 0; }
.sign-summary label { margin: 0; }
.sign-total { display: flex; flex-direction: column; gap: 4px; text-align: right; }
.sign-total strong { font-size: 22px; white-space: nowrap; }
.sign-result-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin: 12px 2px 4px; }
.sign-result-actions .btn { min-height: 40px; text-align: center; white-space: normal; }
.sign-generate { width: 100%; min-height: 40px; }
.sign-status { font-size: 12px; line-height: 1.4; min-height: 17px; max-height: 54px; overflow: auto; margin: 8px 0 0; overflow-wrap: anywhere; }
.sign-status:empty { display: none; }
.sign-status[data-error=true] { color: #f19898; }
.sign-parts { padding: 0; margin: 12px 0 0; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px 20px; font-size: 12px; }
.sign-parts:empty { display: none; }
.sign-parts li { border-bottom: 1px solid var(--sign-line); padding-bottom: 8px; overflow-wrap: anywhere; }
.sign-disclaimer { line-height: 1.5; margin: 12px 0 2px; max-width: 900px; }
[data-theme=light] .sign-workshop { --sign-control-bg: #fff; --sign-control-text: #202a39; --sign-line: #c6cdd7; --sign-muted: #586579; color: #202a39; color-scheme: light; }
[data-theme=light] .sign-segments button[aria-pressed=true], [data-theme=light] .sign-view-tabs button[aria-selected=true] { color: #07718b; }
[data-theme=light] .sign-status[data-error=true] { color: #a52636; }
@media (max-width: 1180px) {
  html.signs-page body.admin-mode.signs-page > header.topbar,
  html.signs-page body.user-mode.signs-page > header.topbar { inset: 8px 8px auto !important; }
  html.signs-page body.signs-page > header.topbar.is-menu-open {
    height: auto !important; max-height: calc(100dvh - 16px) !important; overflow-y: auto !important;
  }
}
@media (max-width: 820px) {
  .signs-page .sign-workshop { padding: 0 12px; }
  .sign-heading { margin-bottom: 8px; }
  .sign-heading h1 { font-size: 20px; }
  .sign-view-tabs { flex: 0 0 auto; display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 10px; border-bottom: 1px solid var(--sign-line); }
  .sign-layout { display: flex; gap: 0; }
  .sign-controls, .sign-stage-column { flex: 1; }
  .sign-controls { border: 0; padding: 0; }
  .sign-workshop[data-view=settings] .sign-stage-column, .sign-workshop[data-view=preview] .sign-controls { display: none; }
  .sign-summary { grid-template-columns: minmax(0,1fr) 125px; gap: 10px; }
  .sign-total { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; }
  .sign-result-actions .btn { flex: 1 1 140px; }
  .sign-parts { grid-template-columns: 1fr; }
}
@media (max-height: 600px) {
  .sign-heading { margin-bottom: 6px; }
  .sign-heading h1 { font-size: 18px; }
  .sign-view-tabs { margin-bottom: 6px; }
  .sign-controls-footer { padding-top: 8px; }
  .sign-result-panel { max-height: 32%; }
}
