* { box-sizing: border-box; }
[hidden] { display: none !important; }
:root { font-family: system-ui, sans-serif; color: #172942; background: #e8edf4; }
body { margin: 0; }
h1, h2, p { margin: 0; }
h1 { font-size: 1.25rem; }
h2 { font-size: .95rem; margin: 12px 0 6px; }
button, input, select, textarea { font: inherit; color: inherit; }
button, select, input, textarea { border: 1px solid #a4b2c4; border-radius: 5px; background: #fff; padding: .45rem .55rem; }
button { cursor: pointer; }
button:hover:enabled { border-color: #2653a0; }
button:disabled { opacity: .52; cursor: default; }
button.primary, button[aria-pressed=true] { color: white; background: #214a86; border-color: #214a86; }
:focus-visible { outline: 2px solid #3472c2; outline-offset: 2px; }
.masthead, .toolbar, .brand, .mode { display: flex; align-items: center; gap: 8px; }
.masthead { background: #132b48; color: white; padding: 12px 20px; justify-content: space-between; }
.brand span { color: #b1e1ff; font-size: 1.7rem; font-weight: 700; line-height: 1; }
#logout { color: #172942; }
#status { font-size: .875rem; }
.toolbar { padding: 10px 16px; flex-wrap: wrap; background: white; border-bottom: 1px solid #c9d3df; }
.toolbar label { margin-left: auto; }
.workspace { display: grid; grid-template-columns: 230px minmax(300px, 1fr) 260px; min-height: calc(100vh - 110px); }
.sidebar { padding: 12px 16px 20px; background: #f8faff; display: flex; flex-direction: column; gap: 7px; font-size: .875rem; }
.sidebar label, .login label { display: grid; gap: 4px; }
.sidebar input, .sidebar textarea, .sidebar select { width: 100%; min-width: 0; }
#pages, #layers, #fields { display: grid; gap: 5px; }
#layers button { text-align: left; }
.measurements { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.stage { min-width: 0; padding: 12px; text-align: center; }
.mode { justify-content: center; margin-bottom: 12px; }
.board { overflow: auto; max-height: calc(100vh - 195px); padding: 5px 0 12px; }
.canvas-container { margin-inline: auto; box-shadow: 0 3px 14px #23436935; }
#dimensions { font-size: .875rem; }
.login { margin: 48px auto; padding: 24px; background: #fff; width: min(380px, 95vw); display: grid; gap: 12px; }
dialog { width: min(880px, 95vw); height: 90vh; border: 1px solid #8aa0bc; border-radius: 7px; }
dialog::backdrop { background: #0d224c80; }
dialog iframe { width: 100%; height: calc(100% - 44px); margin-top: 8px; border: 0; }
@media (max-width: 900px) {
  .workspace { grid-template-columns: 175px minmax(0, 1fr); }
  .properties { grid-column: 1 / -1; }
}
@media (max-width: 550px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
}

#product-form, #batch-form, #product-actions { display: grid; gap: 6px; }
#batch-form { margin-top: 6px; }
#product-feedback:empty { display: none; }
#product-feedback { overflow-wrap: anywhere; }
.sidebar label.inline { display: flex; align-items: center; }
.sidebar label.inline input { width: auto; }
