/* The 2D desk shares 豆D's warm paper and moulded pixel-brick frame. */
.two-d-page { background: #f8f4ec; }
.two-d-page .site-header { height: 74px; }
.workbench-intro { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 23px 28px 22px; }
.eyebrow { display: block; margin: 0 0 5px; color: #aa815d; font: 600 10px var(--font-display); letter-spacing: 1.5px; }
.workbench-intro h1 { margin: 0; font-size: 27px; font-weight: 700; letter-spacing: 1px; }
.workbench-intro h1 span { font-size: 12px; color: var(--muted); font-weight: 400; letter-spacing: 0; margin-left: 20px; }
.workbench-steps { list-style: none; display: flex; margin: 0; padding: 0; gap: 25px; font-size: 11px; color: #9a8777; }
.workbench-steps li { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.workbench-steps b { color: #d79059; background: #f8e4cd; padding: 4px 6px; border-bottom: 2px solid #e0b78f; border-radius: 3px; font: 600 11px var(--font-display); }
.two-d-workbench { display: grid; grid-template-columns: 284px minmax(0, 1fr) 210px; gap: 18px; padding: 0 24px 26px; height: calc(100dvh - 174px); min-height: 600px; }
.two-d-workbench .panel { background-color: #fffdf9; min-width: 0; min-height: 0; }
.settings-panel, .legend { overflow-y: auto; padding: 17px 15px; scrollbar-width: thin; scrollbar-color: #e1c6a8 transparent; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 18px; font-size: 14px; font-weight: 700; }
.section-heading h2 { font-size: inherit; margin: 0; }
.little-tag { color: #a57951; background: #faedda; border: 1px solid #ecd6b9; border-radius: 3px; padding: 2px 6px; font-size: 9px; font-weight: 400; white-space: nowrap; }
.group { padding: 0 0 18px; margin: 0 0 18px; border-bottom: 1px solid #eee2d3; }
.group > .title { display: block; color: #9e714b; font-size: 11px; font-weight: 600; letter-spacing: 1px; margin-bottom: 12px; }
.row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; min-width: 0; }
.row label { flex: 0 0 55px; color: #82705f; font-size: 11px; }
.row .val { min-width: 25px; text-align: right; color: #bc6b35; font-size: 11px; font-variant-numeric: tabular-nums; }
.grid-dimensions { margin-top: 13px; }
.grid-dimensions label { flex: 0 0 auto; }
input[type="number"], select, #palSearch { min-width: 0; border: 1px solid #e3d3c0; border-radius: 4px; color: #5b4838; background: #fffaf2; padding: 8px; font-size: 12px; }
input[type="number"] { width: 76px; flex: 1; }
select { width: 100%; flex: 1; }
input[type="range"] { flex: 1; width: 0; min-width: 0; accent-color: var(--orange); }
input[type="checkbox"] { accent-color: var(--orange); width: 14px; height: 14px; flex-shrink: 0; }
.check { display: flex; align-items: center; gap: 7px; margin: 9px 0; font-size: 11px; color: #82705f; }
.help { margin: 9px 0 0; color: #a08b78; font-size: 10px; line-height: 1.85; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; }
.presets button { min-height: 32px; border: 1px solid #e8d8c5; border-radius: 3px; padding: 6px 10px; background: #fffcf7; color: #8a7460; font-size: 11px; transition: background .15s, border-color .15s; }
.presets button:hover { background: #fff0dd; border-color: #e3b68c; }
.presets button.active { background: #fff0da; border-color: #e4a76e; color: #a75a25; box-shadow: inset 0 -2px #edc6a0; }
#presets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
#presets button { font: 600 16px var(--font-display); padding: 7px 2px; }
#presets button span { display: block; font: 9px var(--font-body); margin-top: 3px; }
.btn { display: block; width: 100%; border: 1px solid #e6d3bc; border-radius: 4px; padding: 10px; margin-bottom: 8px; background: #fffcf6; color: #87684c; font-size: 12px; font-weight: 600; }
.btn:hover { background: #fff0dc; border-color: #d9b38d; }
.btn.primary { background: var(--orange); color: #fff; border-color: #d5622d; box-shadow: 0 3px 0 #c95826; }
.btn.primary:hover { background: #dc6127; }
.btn.toggled { background: #f8e2cb; border-color: #d69e6f; color: #9a4e22; }
.advanced-settings { border-bottom: 1px solid #eee2d3; margin: -2px 0 18px; }
.advanced-settings summary { cursor: pointer; color: #87664b; font-size: 11px; font-weight: 600; padding: 0 0 13px; }
.advanced-settings summary span { display: block; margin: 3px 0 0 13px; font-size: 10px; color: #b19983; font-weight: 400; }
.advanced-settings > .group { margin-top: 14px; margin-bottom: 13px; padding-bottom: 0; border-bottom: 0; }
.settings-note { color: #aa9480; background: #fbf4e9; border-left: 2px solid #ebc69e; margin: 0; padding: 9px; font-size: 10px; line-height: 1.8; }
.file-receipt { background: #fff0d9; border: 1px solid #e8c8a3; padding: 9px; margin-bottom: 12px; border-radius: 3px; }
.file-receipt img { width: 42px; height: 48px; flex-basis: 42px; }
.file-receipt .file-selection-copy strong { font-size: 12px; }
.two-d-workbench .stage { display: flex; flex-direction: column; overflow: hidden; border: 8px solid transparent; border-image: url("../images/brick-frame.svg") 16 stretch; border-radius: 0; }
.stage-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 20px; background: #fffaf1; border-bottom: 1px solid #efdfcc; }
.stage-heading h2 { font-size: 17px; margin: 0; font-weight: 600; }
.stage-heading .eyebrow { font-size: 8px; letter-spacing: 1.8px; }
.canvas-fit { padding: 6px 9px; flex-shrink: 0; font-size: 10px; border: 1px solid #e2c8aa; color: #aa7549; border-radius: 3px; background: #fffdf8; }
.canvas-fit:hover { background: #fff0d9; }
.toolbar { display: flex; align-items: center; gap: 22px; padding: 12px 20px; border-bottom: 1px solid #eee2d2; }
.stat { color: #a18a74; font-size: 10px; white-space: nowrap; }
.stat-divider { color: #d3b99b; margin: 0 5px; }
.stat b { color: #b96c34; font: 600 13px var(--font-display); }
.canvas-wrap { flex: 1; min-height: 0; overflow: auto; padding: 24px; display: flex; align-items: flex-start; justify-content: safe center; position: relative; background-color: #f7f2e9; background-image: radial-gradient(#dfcbb380 .8px, transparent .8px); background-size: 14px 14px; scrollbar-width: thin; scrollbar-color: #dcbf9e #f8f1e6; }
canvas#view { flex-shrink: 0; max-width: none; background: #fff; cursor: crosshair; box-shadow: 0 5px 22px #9b76571f; }
.placeholder { margin: auto; text-align: center; color: #967c65; padding: 45px 0; }
.placeholder h3 { margin: 26px 0 8px; font-size: 15px; font-weight: 600; color: #8c6c50; }
.placeholder p { margin: 0; font-size: 12px; }
.empty-formats { display: block; color: #baa38c; font-size: 10px; margin-top: 18px; }
.empty-brick { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; width: 82px; height: 78px; padding: 14px; margin: 0 auto; border: 2px solid #e1b184; border-radius: 6px; background: #f3cfaa; box-shadow: inset 0 3px #ffe9ce, 0 7px #dfb38a, 8px 15px 0 #e9d6bd66; transform: rotate(-9deg); }
.empty-brick i { border-radius: 50%; background: #f9dfc0; box-shadow: inset 0 2px #fff4e2, 0 3px #dbac7f; }
.canvas-caption { font-size: 10px; color: #a18a75; padding: 12px 18px; border-top: 1px solid #ebdcc9; background: #fffcf6; }
.status-dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: #b7ad84; margin-right: 8px; vertical-align: 2px; }
.legend .section-heading { margin-bottom: 5px; }
.legend .help { margin: 0 0 15px; }
.legend .item { display: flex; gap: 8px; align-items: center; font-size: 11px; padding: 8px 5px; border-bottom: 1px solid #f1e8db; cursor: pointer; border-radius: 3px; }
.legend .item:hover { background: #fff5e7; }
.legend .item.sel { background: #ffe8cb; box-shadow: inset 2px 0 #eaa666; }
.legend .sw { width: 20px; height: 20px; border: 1px solid #00000014; border-radius: 3px; flex-shrink: 0; }
.legend .code { color: #73543a; min-width: 26px; font-weight: 600; }
.legend .name { color: #a68d76; font-size: 9px; flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.legend .cnt { color: #b17341; font: 600 12px var(--font-display); margin-left: auto; }
.legend-empty { color: #b7a38d; text-align: center; margin-top: 95px; font-size: 11px; line-height: 1.9; }
.legend-empty > span { display: inline-grid; place-items: center; width: 41px; height: 41px; border: 1px dashed #dec5a6; border-radius: 3px; background: #faf1e3; color: #c09a70; font: 14px var(--font-display); }
.drop-hint { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; background: #fff0dbeb; border: 2px dashed #d89156; color: #b16b33; pointer-events: none; font-size: 18px; z-index: 2; }
.tooltip { position: fixed; display: none; z-index: 999; pointer-events: none; background: #fffaf2f5; color: #68513c; padding: 10px 13px; border: 1px solid #d9b78e; border-radius: 4px; font-size: 11px; line-height: 1.8; box-shadow: 0 5px 16px #9a673428; white-space: nowrap; }
.tooltip .code { font-size: 15px; font-weight: 700; color: #b86630; margin-right: 6px; }
.tooltip .hex { color: #a88d70; font: 10px Consolas,monospace; }
.tooltip .name { color: #a08a74; }
.tooltip .sw { display: inline-block; width: 13px; height: 13px; border: 1px solid #0002; border-radius: 3px; vertical-align: -2px; margin-right: 5px; }
.editor { position: fixed; inset: 12px 12px 12px auto; width: 340px; max-width: calc(100vw - 24px); z-index: 50; transform: translateX(calc(100% + 25px)); transition: transform .22s; display: flex; flex-direction: column; padding: 18px 15px; border: 8px solid transparent; border-image: url("../images/brick-frame.svg") 16 stretch; background: #fffdf9; background-clip: padding-box; box-shadow: -10px 5px 35px #71481a1c; visibility: hidden; }
.editor.open { transform: translateX(0); visibility: visible; }
.editor-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.editor-head h2 { margin: 0; font-size: 17px; }
.editor .close { font-size: 24px; color: #ae8b6b; background: transparent; border: 0; padding: 2px 5px; }
.color-box { display: flex; align-items: center; gap: 9px; padding: 10px; margin-bottom: 10px; border: 1px solid #efdfcc; border-radius: 4px; background: #fcf5eb; font-size: 12px; }
.color-box .sw { width: 34px; height: 37px; border-radius: 3px; border: 1px solid #0002; flex-shrink: 0; }
.color-box .big { font-size: 15px; font-weight: 600; }
.color-code { color: #bd6a33; }
.color-hex { font: 10px Consolas,monospace; color: #aa957f; }
.color-side-note { margin-left: auto; max-width: 86px; font-size: 9px; color: #b29a82; }
.color-box .help { margin: 0; }
#palSearch { width: 100%; margin: 3px 0 12px; }
.swatches { flex: 1; display: grid; grid-template-columns: repeat(6,1fr); align-content: start; gap: 6px; overflow-y: auto; min-height: 90px; margin-bottom: 15px; }
.swatches .s { aspect-ratio: 1; border: 2px solid #00000012; border-radius: 3px; cursor: pointer; }
.swatches .s:hover { outline: 2px solid #c49a6b; outline-offset: -3px; }
.swatches .s.sel { border-color: #e76e32; box-shadow: inset 0 0 0 2px #fff7; }
.toast, .notice { position: fixed; left: 50%; transform: translate(-50%, 25px); opacity: 0; pointer-events: none; z-index: 150; background: #745339; color: #fff8ef; border: 1px solid #b68b62; border-radius: 5px; padding: 12px 20px; font-size: 12px; max-width: calc(100vw - 28px); text-align: center; transition: opacity .2s, transform .2s; }
.toast { bottom: 28px; }
.toast.show, .notice.show { transform: translate(-50%, 0); opacity: 1; }
.notice { top: 24px; display: flex; align-items: center; gap: 10px; }
.mini-spinner { width: 15px; height: 15px; border: 2px solid #fff5; border-top-color: #fff5e0; border-radius: 50%; animation: spin .8s linear infinite; }
.notice.done .mini-spinner { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 1150px) {
  .two-d-workbench { grid-template-columns: 262px minmax(0,1fr) 174px; gap: 12px; padding-inline: 16px; }
  .settings-panel, .legend { padding: 14px 10px; }
  .workbench-intro { padding-inline: 20px; }
  .workbench-intro h1 span { display: none; }
  .two-d-page .site-nav { gap: 22px; }
  .toolbar { gap: 15px; padding-inline: 13px; }
  .stage-heading { padding-inline: 13px; }
}
@media (max-width: 900px) {
  .two-d-workbench { grid-template-columns: 252px minmax(0,1fr); height: auto; min-height: 0; align-items: start; }
  .settings-panel { grid-row: span 2; max-height: none; }
  .stage { height: 660px; }
  .legend { max-height: 300px; }
  #legendList { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 10px; }
  .legend-empty { grid-column: 1 / -1; margin: 15px 0; }
}
.local-history{margin-bottom:20px}.local-history>.help{padding:0 12px}.local-history [role=status]{color:#ad673b}#local-history-list{max-height:215px;overflow:auto;padding:0 10px 10px}#local-history-list>button{display:block;text-align:left;width:100%;border:0;border-top:1px solid #ead9c5;background:transparent;padding:10px 3px;color:#654a35}#local-history-list strong{display:block;font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#local-history-list small{display:block;font-size:10px;color:#ac8c70;margin-top:4px}#local-history-list>p{font-size:11px;color:#a28770}#local-history-list>button:hover{color:var(--orange);background:#fff7ec}
@media (max-width: 700px) {
  .two-d-page .site-header { height: auto; min-height: 72px; flex-wrap: wrap; gap: 0 15px; padding: 12px 18px 0; }
  .two-d-page .site-account { margin-left: auto; }
  .two-d-page .site-nav { display: flex; order: 3; width: 100%; justify-content: space-between; height: 45px; gap: 12px; margin-top: 8px; }
  .two-d-page .site-nav a { font-size: 11px; }
  .workbench-intro { padding: 20px 18px; align-items: flex-start; }
  .workbench-intro h1 { font-size: 23px; }
  .workbench-steps { gap: 7px; font-size: 0; margin-top: 14px; }
  .workbench-steps li { gap: 0; }
  .two-d-workbench { display: flex; flex-direction: column; padding-inline: 12px; gap: 18px; }
  .two-d-workbench > * { width: 100%; }
  .settings-panel { padding: 18px; }
  .settings-panel .section-heading { margin-bottom: 18px; }
  #presets { grid-template-columns: repeat(5,minmax(0,1fr)); }
  .stage { height: 590px; }
  .stage-heading h2 { font-size: 15px; }
  .canvas-caption { font-size: 9px; padding-inline: 12px; }
}
