@charset "UTF-8";

:root {
  color-scheme: dark;
  font-family: "Segoe UI", "Leelawadee UI", Tahoma, sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: #e8ebeb;
  background: #141719;
  --bg: #141719;
  --panel: #191c1e;
  --field: #222628;
  --border: #2d3234;
  --muted: #8b9497;
  --lime: #d5ff5f;
  --radius: 6px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; height: 100dvh; min-height: 600px; overflow: hidden; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button, input, select, textarea { outline: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, .viewport:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; }
button { color: inherit; }
button:disabled { opacity: .32; cursor: not-allowed; }
input:disabled, select:disabled, textarea:disabled { opacity: .45; cursor: not-allowed; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
button, a, input, select, textarea { transition: background-color .15s, color .15s, border-color .15s, box-shadow .15s; }
button:active:not(:disabled) { transform: translateY(1px); }
button svg { vertical-align: middle; }
h2, p { margin: 0; }
h2 { font-size: 18px; line-height: 1.5; font-weight: 600; letter-spacing: -.35px; }
::selection { background: #d5ff5f; color: #141719; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-thumb { border-radius: 4px; background: #42494b; }
::-webkit-scrollbar-track { background: transparent; }

.topbar { height: 76px; display: flex; align-items: center; padding: 0 24px; gap: 30px; border-bottom: 1px solid var(--border); background: #191c1e; }
.brand { flex: 0 0 254px; display: flex; align-items: center; gap: 10px; text-decoration: none; color: #f4f5ef; font-size: 17px; font-weight: 750; line-height: 1.15; letter-spacing: -.5px; }
.brand-icon { width: 35px; height: 35px; border: 1px solid #d5ff5f66; background: #d5ff5f0d; color: var(--lime); display: grid; place-items: center; font-size: 27px; font-weight: 400; border-radius: 7px; }
.brand-light { color: #a4adb0; font-weight: 400; margin-left: 3px; }
.brand small { display: block; margin-top: 6px; color: #737e82; font-size: 8px; font-weight: 600; letter-spacing: 1.85px; }
.project-area { display: flex; align-items: center; min-width: 0; flex: 1; gap: 10px; }
.project-marker { width: 7px; height: 7px; background: #9ba3a4; border-radius: 50%; flex: 0 0 auto; }
.project-area input { width: 160px; min-width: 80px; max-width: 220px; color: #dce0df; font-size: 13px; font-weight: 500; background: transparent; border: 1px solid transparent; padding: 7px 3px; border-radius: 4px; }
.project-area input:hover { border-color: var(--border); }
.project-area input:focus { background: #222628; border-color: #697346; }
.save-state { color: #6f7a7e; white-space: nowrap; font-size: 11px; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.logo-shortcut { display: inline-flex; align-items: center; gap: 7px; border-color: #71823b !important; color: #e0efbd; }
.logo-shortcut img { width: 24px; height: 21px; object-fit: contain; background: #0c1011; border-radius: 2px; }
#logo-shortcut-icon { color: var(--lime); font-size: 17px; }
.button { min-height: 36px; padding: 7px 14px; border: 1px solid #383f41; border-radius: var(--radius); font-weight: 500; font-size: 12px; background: #232729; white-space: nowrap; line-height: 1.5; }
.button:hover:not(:disabled) { background: #303638; border-color: #535c5f; }
.button.ghost { background: transparent; border-color: transparent; color: #b5bdc0; }
.button.ghost:hover:not(:disabled) { background: #252b2d; border-color: #343c3f; color: #f3f5ed; }
.button.primary { background: var(--lime); border-color: var(--lime); color: #1e2514; font-weight: 650; }
.button.primary:hover:not(:disabled) { background: #e2ff8a; border-color: #e2ff8a; box-shadow: 0 0 20px #d5ff5f0c; }
.header-actions .primary { margin-left: 6px; padding-inline: 19px; }
.header-actions .primary span { margin-left: 15px; font-size: 16px; }
.button.small { min-height: 30px; padding: 5px 9px; font-size: 11px; }
.button.danger { color: #c68680; border-color: #473331; }
.button.danger:hover:not(:disabled) { color: #ffb2aa; background: #3b2422; border-color: #70423c; }
.icon-button { border: 1px solid transparent; background: transparent; width: 30px; height: 30px; border-radius: 5px; color: #9da7aa; padding: 0; display: inline-grid; place-items: center; font-size: 20px; line-height: 1; flex-shrink: 0; }
.icon-button:hover:not(:disabled) { color: #f1f5e7; background: #2c3234; border-color: #3d4649; }
.workspace { height: calc(100dvh - 104px); min-height: 496px; display: grid; grid-template-columns: 220px minmax(0, 1fr) 288px; }
.screen-sidebar, .inspector { background: var(--panel); min-height: 0; display: flex; flex-direction: column; }
.screen-sidebar { border-right: 1px solid var(--border); padding: 0 14px; }
.inspector { border-left: 1px solid var(--border); }
.panel-heading { height: 91px; min-height: 91px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.eyebrow { font-size: 9px; letter-spacing: 1.6px; color: #758186; font-weight: 650; display: block; line-height: 1.6; }
.panel-heading .eyebrow { margin-bottom: 5px; }
.screen-sidebar .panel-heading { padding-inline: 3px; }
.count { font-size: 11px; color: #9ca5a7; font-weight: 400; background: #2a3032; border-radius: 4px; padding: 1px 5px; margin-left: 4px; vertical-align: 2px; letter-spacing: 0; }
.add-button { border: 1px solid #3b4345; border-radius: 5px; color: #b9c1c2; background: #262c2e; width: 27px; height: 27px; }
.screen-list { flex: 1; overflow-y: auto; min-height: 140px; margin: 0 -5px; padding: 1px 5px 8px; }
.screen-card { position: relative; flex: 0 0 auto; margin-bottom: 9px; }
.screen-card > .screen-item { margin-bottom: 0; }
.screen-card .screen-item-top { padding-right: 15px; }
.screen-remove { position: absolute; right: 5px; top: 5px; width: 25px; height: 25px; padding: 0; display: grid; place-items: center; background: #2d2424; border: 1px solid #55403c; border-radius: 4px; color: #e0a39c; font-size: 20px; line-height: 1; }
.screen-remove:hover { color: #fff; border-color: #ba6e60; background: #693e37; }
.screen-item { position: relative; width: 100%; min-height: 104px; display: grid; grid-template-columns: 56px minmax(0, 1fr); align-items: center; gap: 10px; padding: 15px 10px; background: transparent; border: 1px solid #303638; text-align: left; border-radius: 6px; margin-bottom: 9px; }
.screen-item:hover { background: #23282a; border-color: #495155; }
.screen-item.selected { border-color: #71823b; background: #d5ff5f08; }
.screen-item.selected::before { content: ""; position: absolute; left: -1px; top: 20px; bottom: 20px; width: 3px; background: var(--lime); border-radius: 0 2px 2px 0; }
.screen-thumb { width: 56px; height: 42px; display: flex; align-items: center; justify-content: center; background: #0c0e0f; border: 1px solid #41494b; border-radius: 2px; overflow: hidden; }
.screen-thumb canvas { display: block; width: 100%; max-height: 100%; object-fit: contain; }
.screen-item-content { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.screen-item-content strong { color: #dbe1e0; font-size: 11px; font-weight: 650; letter-spacing: .5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.screen-item.selected strong { color: var(--lime); }
.screen-item-content small, .screen-dimensions { color: #a3adb0; font-size: 9px; line-height: 1.5; font-variant-numeric: tabular-nums; letter-spacing: .05px; white-space: nowrap; }
.screen-position { font-size: 9px; color: #69767b; white-space: nowrap; font-variant-numeric: tabular-nums; }
.screen-index { position: absolute; top: 7px; left: 8px; color: #6a767a; font-size: 8px; font-family: Consolas, monospace; }
.add-screen-wide { flex-shrink: 0; border: 1px dashed #3b4345; border-radius: 5px; min-height: 36px; background: transparent; color: #8e9a9e; font-size: 11px; }
.add-screen-wide:hover { color: var(--lime); border-color: #81964a; background: #d5ff5f05; }
.sidebar-bottom { padding: 26px 2px 20px; }
.sidebar-bottom .eyebrow { margin-bottom: 9px; }
.sidebar-bottom .field { margin-bottom: 10px; }
.sidebar-bottom .field > span { font-size: 10px; color: #8e999d; }
.sidebar-bottom select { font-size: 10px; padding-left: 8px; }
.sidebar-bottom p { color: #69767c; line-height: 1.85; font-size: 10px; }
.center-panel { background: #141719; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.canvas-toolbar { height: 61px; min-height: 61px; display: flex; justify-content: space-between; align-items: center; gap: 10px; border-bottom: 1px solid #272d2f; padding: 0 24px; background: #181b1d; }
.view-tabs { display: flex; gap: 4px; padding: 3px; background: #101416; border: 1px solid #292f32; border-radius: 6px; }
.view-tab { border: 0; background: transparent; border-radius: 4px; color: #859297; padding: 6px 13px; font-size: 11px; min-height: 29px; white-space: nowrap; }
.view-tab:hover { color: #d0d9d9; background: #202729; }
.view-tab.active { color: #e2e9d5; background: #333a32; box-shadow: inset 0 0 0 1px #56604866; }
.toolbar-actions { display: flex; align-items: center; gap: 3px; }
.toolbar-actions .icon-button { font-size: 22px; }
.toolbar-divider { width: 1px; height: 18px; background: #343b3e; margin-inline: 8px; }
.canvas-meta { display: flex; justify-content: space-between; align-items: center; min-height: 54px; height: 54px; padding: 0 27px; font-size: 9px; letter-spacing: 1.5px; color: #68777c; }
.canvas-meta > span:first-child { display: flex; align-items: center; gap: 8px; }
.live-dot { width: 5px; height: 5px; background: #98aa6c; border-radius: 50%; }
#map-size { font-family: Consolas, "Segoe UI", monospace; font-size: 10px; letter-spacing: .5px; color: #8b999f; }
.viewport { position: relative; flex: 1; min-height: 150px; overflow: hidden; margin: 0 24px; background-color: #101416; background-image: radial-gradient(#34404499 .65px, transparent .65px); background-size: 16px 16px; border: 1px solid #2a3336; border-radius: 4px; cursor: default; }
.viewport::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 90px #080b0d55; border-radius: inherit; }
.viewport canvas { width: 100%; height: 100%; display: block; position: relative; z-index: 1; touch-action: none; }
.snap-indicator { position: absolute; left: 12px; top: 12px; z-index: 2; pointer-events: none; color: #a4f2ff; background: #123940ed; border: 1px solid #67e3ff77; border-radius: 4px; padding: 5px 9px; font-size: 10px; letter-spacing: .5px; }
.empty-state { position: absolute; inset: 0; display: grid; place-items: center; color: #7e8d92; font-size: 14px; }
.canvas-bottom-bar { height: 48px; min-height: 48px; padding: 0 25px; display: flex; justify-content: space-between; align-items: center; }
.canvas-hint { font-size: 10px; color: #69787e; display: flex; gap: 6px; align-items: center; }
.mouse-icon { color: #8a999e; font-size: 15px; margin-right: 2px; }
kbd { font: 9px "Segoe UI", sans-serif; border: 1px solid #394347; background: #232c30; border-radius: 3px; padding: 1px 5px; color: #a1aeb2; box-shadow: 0 1px 0 #080c0e; }
.zoom-controls { display: flex; align-items: center; gap: 2px; border: 1px solid #323c40; border-radius: 5px; padding: 1px 2px; background: #1b2225; }
.zoom-controls .icon-button { width: 24px; height: 24px; font-size: 16px; }
.zoom-value { min-width: 46px; border: 0; background: transparent; color: #b8c3c5; font-size: 10px; padding: 3px 6px; }
.zoom-value:hover { color: var(--lime); }
.mapping-strip { min-height: 72px; display: flex; align-items: center; gap: 8px; border-top: 1px solid #2d3538; border-bottom: 1px solid #242d30; background: #191e21; margin-top: 4px; padding: 12px 24px; }
.mapping-title { margin-right: 8px; flex-shrink: 0; }
.mapping-title .eyebrow { font-size: 8px; letter-spacing: 1.2px; margin-bottom: 2px; }
.mapping-title > span:last-child { color: #b3bfc1; font-size: 11px; }
.mapping-strip .button { background: #242c30; border-color: #3b464a; }
.snap-control { display: flex; align-items: center; gap: 5px; color: #8a9a9f; font-size: 10px; margin-left: 4px; white-space: nowrap; }
.snap-toggle { position: relative; display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 7px 10px; border: 1px solid #4d585c; border-radius: 6px; background: #242a2d; color: #d2d8d9; cursor: pointer; }
.snap-toggle.active { border-color: #8ca94b; background: #d5ff5f14; color: #e2f5be; }
.snap-toggle input[type="checkbox"] { position: absolute; inset: 0; margin: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.snap-toggle:has(input:focus-visible) { outline: 2px solid var(--lime); outline-offset: 2px; }
.snap-toggle-track { position: relative; width: 29px; height: 17px; border-radius: 10px; background: #626b70; flex-shrink: 0; }
.snap-toggle-track::after { content: ''; position: absolute; left: 2px; top: 2px; width: 13px; height: 13px; border-radius: 50%; background: #fff; transition: transform .12s; }
.snap-toggle.active .snap-toggle-track { background: #a0bd4b; }
.snap-toggle.active .snap-toggle-track::after { transform: translateX(12px); }
.snap-toggle strong { min-width: 18px; font-weight: 600; }
.snap-grid-label { display: inline-flex; align-items: center; gap: 5px; margin-left: 3px; }
.screen-colors { grid-column: 1 / -1; border: 1px solid #37433d; border-radius: 6px; padding: 0 10px 10px; margin-bottom: 14px; background: #18201e; }
.screen-color-toggle { display: flex; align-items: center; gap: 8px; min-height: 40px; cursor: pointer; font-size: 11px; color: #c9d4cb; }
.screen-colors .color-row { gap: 12px; margin-bottom: 10px; }
.screen-colors .field-help { margin: 4px 0 0; font-size: 9px; }
.screen-colors .text-button { padding-top: 0; font-size: 9px; }
input[type="checkbox"] { accent-color: var(--lime); width: 13px; height: 13px; margin: 0; cursor: pointer; }
.snap-control input[type="number"] { width: 38px; min-height: 28px; height: 28px; padding: 3px 3px; text-align: center; font-size: 10px; color: #c6d0d1; background: #11191c; border-color: #344147; border-radius: 4px; appearance: textfield; }
.snap-control input[type="number"]::-webkit-inner-spin-button { appearance: none; }
.mapping-status { margin-left: auto; font-size: 9px; color: #7d9270; white-space: nowrap; }
.mapping-status.warning { color: #e3ba6a; }
.workspace-note { min-height: 46px; display: flex; align-items: center; padding: 8px 25px; color: #64747b; line-height: 1.7; font-size: 9px; }
.workspace-note > span { color: #8a9b85; margin-right: 8px; font-size: 16px; }
.inspector .panel-heading { padding: 0 21px; border-bottom: 1px solid #2c3235; }
.selected-number { font-family: Consolas, monospace; color: #4d5a60; font-size: 28px; font-weight: 400; letter-spacing: -1px; }
.inspector-scroll { flex: 1; padding: 18px 20px 20px; overflow-y: auto; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin-bottom: 14px; }
.field > span { color: #9ca8ac; font-size: 10px; line-height: 1.5; }
input[type="text"], input[type="number"], select, textarea { min-height: 35px; width: 100%; border: 1px solid #374044; background: #22292c; color: #d7dfe0; border-radius: 5px; padding: 7px 10px; line-height: 1.5; }
input[type="number"] { font-family: Consolas, "Segoe UI", monospace; font-size: 12px; font-variant-numeric: tabular-nums; }
input::placeholder, textarea::placeholder { color: #5f7079; opacity: 1; }
input:hover, select:hover, textarea:hover { border-color: #4d5b61; }
input:focus, select:focus, textarea:focus { border-color: #9bb65b; box-shadow: 0 0 0 2px #d5ff5f0a; }
select { appearance: none; padding-right: 26px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='6'%3E%3Cpath d='m1 1 3.5 3.5L8 1' fill='none' stroke='%238c9da4' stroke-width='1.3'/%3E%3C/svg%3E"); background-position: right 10px center; background-repeat: no-repeat; font-size: 11px; cursor: pointer; }
textarea { resize: vertical; min-height: 70px; font: 11px Consolas, monospace; }
#screen-name { font-weight: 600; font-size: 13px; letter-spacing: .6px; }
.field-row { display: flex; gap: 10px; align-items: flex-end; }
.field-row > .field { flex: 1; }
.field-times { color: #596c74; margin: 0 -3px 23px; font-size: 12px; }
.section-label { display: flex; align-items: baseline; justify-content: space-between; color: #829297; font-size: 9px; font-weight: 600; letter-spacing: 1px; margin: 5px 0 9px; }
.section-label > span { color: #5f717a; font-size: 8px; font-weight: 400; letter-spacing: .5px; }
.advanced { border-top: 1px solid #303b3f; border-bottom: 1px solid #303b3f; margin: 2px 0 15px; color: #9aa9ae; }
.advanced summary { cursor: pointer; font-size: 10px; padding: 11px 0; list-style: none; display: flex; align-items: center; justify-content: space-between; }
.advanced summary::-webkit-details-marker { display: none; }
.advanced summary::after { content: "+"; font-size: 15px; color: #697c85; }
.advanced[open] summary::after { content: "−"; }
.advanced summary:hover { color: #d3e1dd; }
.advanced p { color: #617681; font-size: 9px; padding-bottom: 12px; margin-top: -4px; }
.screen-actions { display: flex; gap: 7px; justify-content: space-between; margin-bottom: 20px; }
#screen-settings > .screen-actions { position: sticky; top: -18px; z-index: 2; padding: 9px 0; background: var(--panel); }
.screen-actions > button:first-child { flex: 1; }
.inspector-section { padding-top: 19px; border-top: 1px solid #303a3f; margin-top: 18px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
.section-heading .eyebrow { color: #9ba8ac; }
.applies-all { font-size: 9px; color: #617680; }
.field-help { color: #84959c; font-size: 9px; line-height: 1.8; margin: -4px 0 12px; }
.checker-size { margin-top: 12px; }
#cabinet-controls { padding: 9px; background: #101719; border-radius: 5px; margin-bottom: 12px; }
#cabinet-controls p { margin-top: 0; padding-bottom: 0; line-height: 1.6; }
.pattern-toggles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; margin-bottom: 17px; }
.pattern-toggles label { height: 47px; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font-size: 9px; color: #9cacb0; background: #232c30; border: 1px solid #39474d; border-radius: 5px; cursor: pointer; }
.pattern-toggles label > span { font-size: 17px; line-height: 1.2; color: #c2cec9; }
.pattern-toggles input { position: absolute; opacity: 0; width: 100%; height: 100%; inset: 0; }
.pattern-toggles label:has(input:checked) { border-color: #72864c; color: #c6d4b0; background: #d5ff5f08; }
.pattern-toggles label:has(input:checked) > span { color: #d1dfb7; }
.pattern-toggles label:hover { border-color: #9aac74; }
.pattern-toggles label:has(input:focus-visible) { outline: 2px solid var(--lime); outline-offset: 2px; }
.color-row { display: flex; gap: 16px; align-items: center; }
.color-row label { display: flex; flex: 1; align-items: center; justify-content: space-between; color: #8fa1aa; font-size: 10px; }
input[type="color"] { width: 31px; height: 24px; background: #273137; border: 1px solid #425259; padding: 3px; border-radius: 4px; cursor: pointer; }
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 2px; }
.upload-logo { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 59px; padding: 10px 12px; border: 1px dashed #46575f; border-radius: 5px; background: #1a2327; text-align: left; color: #a5b7bd; font-size: 10px; }
.upload-logo > span:first-child { color: #aabdac; font-size: 23px; line-height: 1; }
.upload-logo small { display: block; color: #617782; font-size: 8px; margin-top: 4px; }
.upload-logo:hover { border-color: #97ac69; background: #d5ff5f05; }
.text-button { background: transparent; color: #9bacb3; border: 0; padding: 8px 0 0; font-size: 10px; }
.text-button:hover { color: #e9baae; }
.statusbar { height: 28px; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; border-top: 1px solid #313b40; background: #1b2225; color: #687e88; font-size: 9px; letter-spacing: .3px; }
.statusbar > span { display: flex; align-items: center; }
.status-dot { width: 5px; height: 5px; border-radius: 50%; background: #9eb86a; display: inline-block; margin-right: 7px; }
#footer-stats { font-family: Consolas, monospace; letter-spacing: .8px; color: #7d929c; }
dialog { color: #e3eae6; background: #1c2529; border: 1px solid #48585e; border-radius: 12px; padding: 28px; width: min(490px, calc(100vw - 32px)); box-shadow: 0 24px 100px #0009; }
dialog::backdrop { background: #080d11c9; backdrop-filter: blur(5px); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.dialog-heading h2 { font-size: 21px; margin-top: 4px; }
.dialog-heading .eyebrow { color: #9eaf78; font-size: 8px; letter-spacing: 1.8px; }
.dialog-heading > .icon-button { align-self: flex-start; }
.dialog-description { color: #8ca1aa; font-size: 11px; line-height: 1.8; margin: 14px 0 24px; }
dialog .field { margin-bottom: 17px; }
dialog .field > span { font-size: 11px; }
dialog select { min-height: 41px; font-size: 11px; background-color: #28343a; }
.export-info { border: 1px solid #4a6042; border-radius: 6px; background: #d5ff5f06; padding: 13px 14px; color: #b7c7a4; font-size: 11px; line-height: 1.8; min-height: 46px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 24px; }
.dialog-actions .button { min-height: 38px; font-size: 11px; }
.export-footnote { color: #667d87; font-size: 9px; line-height: 1.7; margin-top: 17px; text-align: center; }
#help-dialog > p { color: #a7b8bf; line-height: 1.9; font-size: 12px; margin-top: 15px; }
.toast { position: fixed; z-index: 100; bottom: 49px; left: 50%; transform: translateX(-50%); max-width: min(580px, calc(100vw - 32px)); padding: 12px 19px; border-radius: 7px; background: #d5ff5f; color: #243111; border: 1px solid #e2ff8b; box-shadow: 0 7px 35px #0006; font-size: 12px; text-align: center; }
.center-panel:fullscreen, .center-panel.is-fullscreen { width: 100vw; height: 100dvh; background: #101416; }
.center-panel:fullscreen .viewport, .center-panel.is-fullscreen .viewport { margin: 0 24px; }
.screen-item { grid-template-columns: 56px minmax(0, 1fr); grid-template-rows: auto auto; gap: 3px 10px; min-height: 88px; }
.screen-item-top { grid-column: 2; grid-row: 1; align-self: end; min-width: 0; }
.screen-item-top strong { display: block; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.screen-item > .screen-thumb { grid-column: 1; grid-row: 1 / 3; }
.screen-item > .screen-item-content { grid-column: 2; grid-row: 2; align-self: start; }
.fullscreen-pattern { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; z-index: 10; }
.fullscreen-pattern:fullscreen { width: 100vw; height: 100dvh; object-fit: contain; background: #000; }

@media (min-width: 1600px) {
  .workspace { grid-template-columns: 240px minmax(0, 1fr) 310px; }
  .screen-sidebar { padding-inline: 18px; }
  .inspector-scroll { padding-inline: 24px; }
  .inspector .panel-heading { padding-inline: 25px; }
  .screen-item { min-height: 112px; grid-template-columns: 62px minmax(0, 1fr); }
  .screen-thumb { width: 62px; height: 44px; }
}

@media (max-width: 1240px) {
  .workspace { grid-template-columns: 200px minmax(0, 1fr) 260px; }
  .topbar { gap: 18px; padding-inline: 18px; }
  .brand { flex-basis: 222px; }
  .save-state { display: none; }
  .inspector-scroll { padding-inline: 15px; }
  .inspector .panel-heading { padding-inline: 16px; }
  .screen-sidebar { padding-inline: 12px; }
  .screen-item { grid-template-columns: 46px minmax(0, 1fr); padding-inline: 9px; gap: 8px; }
  .screen-thumb { width: 46px; height: 36px; }
  .screen-item-content strong { font-size: 10px; }
  .screen-item-content small, .screen-position { font-size: 8px; }
  .canvas-toolbar { padding-inline: 17px; }
  .viewport { margin-inline: 16px; }
  .canvas-meta { padding-inline: 19px; }
  .canvas-bottom-bar { padding-inline: 17px; }
  .mapping-strip { padding-inline: 16px; gap: 6px; flex-wrap: wrap; }
  .mapping-title { margin-right: 3px; }
  .mapping-status { display: none; }
  .canvas-hint { font-size: 9px; gap: 4px; }
  .workspace-note { padding-inline: 17px; font-size: 8px; }
}

@media (max-width: 1040px) {
  .workspace { grid-template-columns: 178px minmax(0, 1fr) 250px; }
  .brand { flex-basis: 196px; font-size: 15px; }
  .brand small { font-size: 7px; letter-spacing: 1.5px; }
  .brand-icon { width: 30px; height: 30px; font-size: 23px; }
  .project-area input { width: 120px; font-size: 12px; }
  .topbar { gap: 12px; }
  .header-actions { gap: 2px; }
  .header-actions .button { font-size: 11px; padding-inline: 9px; }
  .header-actions .primary { padding-inline: 13px; }
  .header-actions .primary span { margin-left: 8px; }
  .screen-item { grid-template-columns: 42px minmax(0, 1fr); gap: 3px 8px; min-height: 90px; padding: 14px 8px 12px; }
  .screen-thumb { width: 42px; height: 34px; border-color: #3c494e; }
  .screen-thumb canvas { max-height: 100%; width: 100%; }
  .screen-item-content { gap: 2px; }
  .screen-item-content strong { font-size: 11px; }
  .screen-item-content small, .screen-position { font-size: 9px; }
  .screen-index { top: 5px; right: 35px; left: auto; }
  .panel-heading h2 { font-size: 16px; }
  .canvas-toolbar { padding-inline: 12px; }
  .view-tab { padding-inline: 9px; font-size: 10px; }
  .toolbar-divider { margin-inline: 3px; }
  .toolbar-actions .button { padding-inline: 5px; font-size: 10px; }
  .toolbar-actions .icon-button { width: 24px; font-size: 19px; }
  .canvas-hint kbd, .canvas-hint .mouse-icon { display: none; }
  .canvas-hint { max-width: 65%; line-height: 1.6; display: block; }
  .mapping-title { width: 100%; display: flex; gap: 9px; align-items: center; }
  .mapping-title .eyebrow { margin-bottom: 0; }
  .mapping-strip { min-height: 98px; padding-block: 10px; }
  .mapping-strip .button { font-size: 10px; }
  .snap-control { margin-left: auto; }
}

@media (max-width: 800px) {
  body { height: auto; min-height: 100dvh; overflow-y: auto; }
  .topbar { height: auto; min-height: 76px; flex-wrap: wrap; padding: 15px 16px; gap: 14px; }
  .brand { flex: 1; min-width: 190px; }
  .project-area { flex: 0 1 auto; }
  .project-area input { width: 140px; }
  .header-actions { width: 100%; justify-content: flex-end; padding-top: 9px; border-top: 1px solid #303a3e; }
  .header-actions .button { min-height: 34px; }
  .header-actions .primary { margin-left: auto; }
  .workspace { height: auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 250px; }
  .screen-sidebar { grid-column: 1 / -1; padding: 14px 16px; border-right: 0; border-bottom: 1px solid #344147; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 15px; align-items: center; }
  .screen-sidebar .panel-heading { height: auto; min-height: 65px; padding: 0; gap: 15px; }
  .screen-sidebar .panel-heading .eyebrow { font-size: 8px; }
  .screen-sidebar .panel-heading h2 { font-size: 15px; }
  .screen-sidebar .add-button { display: none; }
  .screen-list { display: flex; gap: 7px; overflow-x: auto; overflow-y: hidden; min-height: 0; padding: 0 0 5px; margin: 0; }
  .screen-item { width: 142px; min-width: 142px; min-height: 76px; margin: 0; grid-template-columns: 33px minmax(0, 1fr); gap: 6px; padding: 11px 8px; }
  .screen-thumb { width: 33px; height: 31px; }
  .screen-item-content strong { font-size: 9px; }
  .screen-item-content small, .screen-position { font-size: 7px; }
  .screen-item.selected::before { top: 12px; bottom: 12px; }
  .screen-index { font-size: 7px; top: 4px; }
  .add-screen-wide { min-height: 37px; padding: 0 10px; font-size: 10px; }
  .sidebar-bottom { grid-column: 1 / -1; padding: 3px 0 0; display: flex; align-items: center; gap: 14px; }
  .sidebar-bottom .eyebrow { margin: 0; white-space: nowrap; }
  .sidebar-bottom .field { margin: 0; flex: 1; flex-direction: row; gap: 8px; align-items: center; }
  .sidebar-bottom .field > span { white-space: nowrap; font-size: 9px; }
  .sidebar-bottom select { max-width: 290px; min-height: 30px; }
  .sidebar-bottom p { display: none; }
  .center-panel { min-height: 660px; }
  .canvas-toolbar { height: 56px; min-height: 56px; }
  .canvas-toolbar .toolbar-actions .button { font-size: 9px; }
  .canvas-meta { min-height: 45px; height: 45px; }
  .viewport { min-height: 330px; }
  .inspector .panel-heading { min-height: 78px; height: 78px; }
  .inspector-scroll { max-height: 980px; }
  .statusbar { height: 32px; }
  .statusbar > span:last-child { display: none; }
}

@media (max-width: 600px) {
  .header-actions { flex-wrap: wrap; }
  .topbar { gap: 11px; }
  .brand { min-width: 170px; }
  .brand-icon { width: 28px; height: 28px; }
  .project-area { max-width: 135px; gap: 5px; }
  .project-area input { width: 116px; font-size: 10px; }
  .project-marker { width: 5px; height: 5px; }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .screen-sidebar { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 12px; }
  .screen-sidebar .panel-heading { grid-column: 1; min-height: 36px; }
  .screen-sidebar .panel-heading > div { display: flex; align-items: center; gap: 10px; }
  .screen-sidebar .panel-heading .eyebrow { margin: 0; }
  .screen-list { grid-column: 1 / -1; grid-row: 2; }
  .add-screen-wide { grid-row: 1; grid-column: 2; min-height: 30px; }
  .sidebar-bottom { flex-wrap: wrap; gap: 8px; }
  .sidebar-bottom > .eyebrow { display: none; }
  .sidebar-bottom .field > span { display: none; }
  .sidebar-bottom select { max-width: none; }
  .center-panel { min-height: 640px; }
  .canvas-toolbar { padding-inline: 12px; }
  .canvas-toolbar .toolbar-divider { margin-inline: 2px; }
  .viewport { min-height: 315px; margin-inline: 12px; }
  .canvas-meta { padding-inline: 15px; font-size: 8px; letter-spacing: 1px; }
  #map-size { font-size: 9px; }
  .canvas-bottom-bar { padding-inline: 13px; }
  .mapping-strip { padding-inline: 13px; min-height: 100px; }
  .mapping-strip .button { font-size: 10px; }
  .mapping-title { justify-content: space-between; }
  .workspace-note { font-size: 8px; padding-inline: 13px; min-height: 46px; }
  .inspector { border-left: 0; border-top: 1px solid #384950; }
  .inspector .panel-heading { padding-inline: 20px; min-height: 78px; }
  .inspector-scroll { padding: 18px 20px 25px; overflow: visible; max-height: none; }
  .inspector-scroll #screen-settings { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
  #screen-settings > .field:first-child, #screen-settings > .section-label, #screen-settings > .field-row, #screen-settings > details, #screen-settings > .screen-actions, #screen-settings > .field { grid-column: 1 / -1; }
  .section-label { margin-top: 8px; }
  .pattern-toggles { gap: 8px; }
  .pattern-toggles label { height: 56px; font-size: 10px; }
  .pattern-toggles label > span { font-size: 21px; }
  .color-row { gap: 30px; }
  .inspector-section { margin-top: 23px; padding-top: 22px; }
  .statusbar { padding-inline: 13px; font-size: 8px; }
  #footer-stats { font-size: 8px; }
  dialog { padding: 23px; }
  .dialog-actions { gap: 7px; }
  .dialog-actions .button { padding-inline: 10px; font-size: 10px; }
  .dialog-heading h2 { font-size: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
