#app { max-width: 1100px; }
.panel-shell { display: grid; grid-template-columns: 220px 1fr; gap: 18px; align-items: start; }
.panel-nav { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 4px; }
.panel-nav a { display: block; padding: 10px 12px; border-radius: var(--radius); color: var(--text); }
.panel-nav a.active { background: var(--panel2); color: var(--accent); font-weight: 700; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0; }
.panel-search { margin-bottom: 12px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.tile b { display: block; font-size: 24px; }
.tile span { color: var(--muted); font-size: 13px; }
table.grid { width: 100%; border-collapse: collapse; background: var(--panel); border-radius: var(--radius); overflow: hidden; }
table.grid th, table.grid td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
table.grid th { color: var(--muted); font-weight: 600; }
table.grid tr:last-child td { border-bottom: 0; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; background: var(--panel2); color: var(--muted); }
.pill.ok { color: var(--ok); }
.pill.warn { color: var(--warn); }
.pill.bad { color: var(--danger); }
.linkbox { display: flex; gap: 8px; margin-top: 10px; }
.linkbox input { flex: 1; }
@media (max-width: 760px) { .panel-shell { grid-template-columns: 1fr; } .panel-nav { position: static; flex-direction: row; overflow-x: auto; } }
.tabs a.pill { padding: 6px 12px; font-size: 14px; color: var(--text); }
.tabs a.pill.ok { color: var(--accent); font-weight: 700; }
.split { display: flex; gap: 18px; align-items: flex-start; }
.split > table { flex: 1; min-width: 0; }
.sheet { width: 380px; flex-shrink: 0; box-sizing: border-box; padding: 18px 20px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--panel2); position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; }
.sheet[hidden] { display: none; }
@media (max-width: 1100px) { .split { flex-direction: column; } .sheet { width: 100%; position: static; max-height: none; } }
.plan-frame { flex: 1; min-width: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--panel2); }
.plan-view { display: block; width: 100%; cursor: pointer; }
.plan-editor { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; background: #0b0e12; color: var(--text); }
.plan-top { display: flex; align-items: center; gap: 8px; padding: 8px 14px; background: var(--panel); border-bottom: 1px solid var(--panel2); flex-wrap: wrap; }
.plan-top button, .plan-status button { min-height: 38px; padding: 6px 12px; }
.plan-body { flex: 1; min-height: 0; display: flex; }
.plan-tools { width: 150px; flex-shrink: 0; display: flex; flex-direction: column; gap: 5px; padding: 10px; background: var(--panel); border-right: 1px solid var(--panel2); overflow-y: auto; }
.plan-tools button { text-align: left; min-height: 36px; padding: 6px 10px; font-size: 14px; }
.plan-tools button.on { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.plan-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; padding: 6px 2px 0; }
.plan-stage { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.plan-canvas { flex: 1; min-height: 0; width: 100%; display: block; touch-action: none; outline: none; user-select: none; }
.plan-status { display: flex; align-items: center; gap: 16px; padding: 4px 12px; background: var(--panel); border-top: 1px solid var(--panel2); font-size: 12px; color: var(--muted); font-family: Consolas, "Cascadia Mono", monospace; }
.plan-props { width: 300px; flex-shrink: 0; display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; background: var(--panel); border-left: 1px solid var(--panel2); overflow-y: auto; }
.plan-props input[type="text"], .plan-props select { width: 100%; box-sizing: border-box; min-height: 38px; }
.plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.plan-field { display: flex; flex-direction: column; gap: 3px; }
.plan-field label { font-size: 12px; color: var(--muted); }
.plan-row { display: flex; gap: 6px; align-items: center; }
.plan-row input[type="text"] { flex: 1; min-width: 0; }
.plan-actions, .plan-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.plan-actions button, .plan-chips button, .plan-row button { min-height: 36px; padding: 6px 10px; font-size: 13px; }
.plan-chips button.on { color: var(--accent); }
.plan-swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.plan-swatches button { width: 30px; height: 30px; min-height: 0; padding: 0; border-radius: 8px; border: 2px solid transparent; }
.plan-swatches button.on { border-color: #ffffff; }
.plan-check { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.plan-check input, .plan-editor input[type="checkbox"] { width: 18px; height: 18px; min-height: 0; flex: 0 0 18px; margin: 0; padding: 0; }
.plan-props input[type="range"] { width: 100%; min-height: 0; padding: 0; }
.plan-help { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--panel2); }
.plan-editor .hidden { display: none; }
.plan-editor.saving .plan-body { opacity: 0.6; pointer-events: none; }
#toast { z-index: 200; }
@media (max-width: 900px) { .plan-tools { width: 112px; } .plan-props { width: 230px; } }
.label-sheets { display: flex; flex-direction: column; gap: 16px; align-items: flex-start; overflow-x: auto; }
.label-sheet { width: 210mm; height: 297mm; box-sizing: border-box; padding: 12mm 8mm; background: #fff; color: #000; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(8, 1fr); gap: 0 3mm; }
.label { display: flex; align-items: center; gap: 3mm; padding: 2mm; overflow: hidden; }
.label div { display: flex; flex-direction: column; min-width: 0; font-size: 9pt; line-height: 1.25; }
.label b { font-family: Consolas, "Cascadia Mono", monospace; font-size: 10pt; }
@media print {
  @page { size: A4; margin: 0; }
  body { background: #fff; }
  .panel-nav, .panel-head, .tabs, .no-print, #toast, .label-sheets ~ *, .stack > .muted { display: none !important; }
  #app { padding: 0 !important; margin: 0 !important; max-width: none !important; }
  .panel-shell { display: block; }
  .label-sheets { gap: 0; overflow: visible; }
  .label-sheet { page-break-after: always; }
  .label-sheet:last-child { page-break-after: auto; }
}
