@font-face {
  font-family: "Leadly Montserrat";
  src: url("assets/montserrat-latin-variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: #0e0e0d; color: #f4f2ed; font-family: "Leadly Montserrat", sans-serif; }
button, input { font: inherit; }
button { cursor: pointer; }

.lab-shell { height: 100%; display: grid; grid-template-columns: 370px minmax(0, 1fr); }
.control-panel { min-height: 0; padding: 24px; display: flex; flex-direction: column; border-right: 1px solid rgba(255,255,255,.11); background: #11110f; }
.control-header { padding-bottom: 24px; border-bottom: 1px solid rgba(255,255,255,.1); }
.lab-brand { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 700; letter-spacing: -.02em; }
.lab-brand img { display: block; width: 30px; height: 30px; border: 0; }
.control-header p { margin: 15px 0 14px; color: #a8a69f; font-size: 12px; line-height: 1.55; }
.source-state { display: flex; align-items: center; gap: 8px; color: #bbb8b0; font-size: 10px; font-weight: 600; }
.source-state i { width: 7px; height: 7px; border-radius: 50%; background: #47b276; box-shadow: 0 0 0 4px rgba(71,178,118,.11); }

.control-tabs { margin: 22px 0 18px; padding: 4px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; border-radius: 12px; background: #22221f; }
.control-tabs button { min-height: 42px; border: 0; border-radius: 9px; background: transparent; color: #96938c; font-size: 12px; font-weight: 700; }
.control-tabs button.active { background: #f4f2ed; color: #171714; box-shadow: 0 3px 12px rgba(0,0,0,.24); }
.control-tabs button:focus-visible, .control-footer button:focus-visible, .stepper button:focus-visible, .type-scope button:focus-visible { outline: 3px solid #6257e7; outline-offset: 2px; }

.settings-panel { min-height: 0; overflow: auto; }
.settings-panel[hidden] { display: none; }
.panel-heading { display: grid; gap: 5px; margin-bottom: 16px; }
.panel-heading strong { font-size: 13px; }
.panel-heading span { color: #85827b; font-size: 10px; }
.colour-controls { display: grid; gap: 8px; }
.colour-controls label { min-height: 52px; padding: 8px 9px 8px 12px; display: flex; align-items: center; justify-content: space-between; border: 1px solid rgba(255,255,255,.1); border-radius: 11px; background: #191917; }
.colour-controls label > span { display: flex; align-items: center; gap: 11px; color: #d5d2ca; font-size: 12px; font-weight: 600; }
.colour-controls i { width: 25px; height: 25px; border: 1px solid rgba(255,255,255,.15); border-radius: 7px; background: var(--swatch); }
.colour-controls input[type="color"] { width: 36px; height: 36px; padding: 3px; border: 1px solid rgba(255,255,255,.14); border-radius: 9px; background: #262623; }
.colour-controls input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.colour-controls input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 5px; }

.type-scope { margin-bottom: 12px; padding: 3px; display: grid; grid-template-columns: 1fr 1fr; gap: 3px; border-radius: 10px; background: #22221f; }
.type-scope button { min-height: 36px; padding: 0 8px; border: 0; border-radius: 8px; background: transparent; color: #85827b; font-size: 10px; font-weight: 700; }
.type-scope button.active { background: #34342f; color: #f4f2ed; box-shadow: 0 3px 10px rgba(0,0,0,.2); }
.type-controls { display: grid; gap: 8px; }
.type-control { min-height: 66px; padding: 10px 10px 10px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid rgba(255,255,255,.1); border-radius: 11px; background: #191917; }
.type-control > span { min-width: 0; display: grid; gap: 4px; }
.type-control strong { color: #d5d2ca; font-size: 12px; }
.type-control small { color: #77746e; font-size: 9px; line-height: 1.25; }
.stepper { flex: none; display: grid; grid-template-columns: 28px 52px 28px; align-items: center; overflow: hidden; border: 1px solid rgba(255,255,255,.13); border-radius: 9px; background: #252521; }
.stepper button { width: 28px; height: 32px; padding: 0; border: 0; background: transparent; color: #bbb8b0; font-size: 16px; }
.stepper button:hover { background: rgba(255,255,255,.07); color: white; }
.stepper output { color: #f4f2ed; text-align: center; font-size: 10px; font-weight: 700; }
.scale-note { margin: 16px 2px 0; color: #85827b; font-size: 10px; line-height: 1.55; }

.control-footer { margin-top: auto; padding-top: 22px; display: grid; grid-template-columns: 84px 1fr; gap: 8px; border-top: 1px solid rgba(255,255,255,.1); }
.control-footer button { min-height: 42px; padding: 0 13px; border: 1px solid rgba(255,255,255,.15); border-radius: 10px; background: #252521; color: #d7d4cc; font-size: 11px; font-weight: 700; }
.control-footer button.primary { border-color: #6257e7; background: #6257e7; color: white; }
.control-footer p { grid-column: 1 / -1; min-height: 14px; margin: 2px 0 0; color: #77746e; font-size: 9px; }

.preview-panel { min-width: 0; min-height: 0; display: grid; grid-template-rows: 58px minmax(0, 1fr); background: #282824; }
.preview-toolbar { padding: 0 20px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid rgba(255,255,255,.1); background: #171714; }
.preview-toolbar strong { font-size: 12px; }
.preview-toolbar span { color: #85827b; font-size: 10px; }
.preview-panel iframe { display: block; width: calc(100% - 28px); height: calc(100% - 28px); margin: 14px; border: 0; border-radius: 15px; background: #f4f2ed; box-shadow: 0 22px 70px rgba(0,0,0,.38); }

@media (max-width: 820px) {
  .lab-shell { height: auto; min-height: 100%; grid-template-columns: 1fr; }
  .control-panel { min-height: 560px; border-right: 0; border-bottom: 1px solid rgba(255,255,255,.11); }
  .preview-panel { min-height: 850px; }
  .preview-toolbar span { display: none; }
}
