:root { --muted: #62626a; --accent-dark: #766022; }
::selection { background: #c9a84c; color: #1a1a1a; }
:focus-visible { outline: 3px solid #8a6f25; outline-offset: 3px; }
.workspace { position: relative; }
.topbar, .bottombar { flex-shrink: 0; }
html, body, #app { height: 100%; height: 100dvh; }
.canvas-area canvas { touch-action: none; }
.side-btn, .float-tools button em, .side-switch button { font-size: 11px; }
.btn-concluir { color: #1a1a1a; }
.btn-concluir:hover { color: #fff; }
.upload-box { width: 100%; }
.modal-close, .panel-close, .layer-row button { min-width: 44px; min-height: 44px; }
.swatch { width: 44px; height: 44px; }
.prod-card .mini-swatches { gap: 8px; }
.prod-card .mini-swatches button { width: 32px; height: 32px; border-radius: 50%; border: 1px solid #aaa; }
.prod-img { width: 100%; }
.obj-toolbar { max-width: calc(100% - 16px); overflow-x: auto; overscroll-behavior: contain; }
.obj-toolbar button { min-width: 44px; height: 44px; flex-shrink: 0; }
.tool-font { min-height: 44px; flex-shrink: 0; font-size: 16px; }
.tool-color input { width: 44px; height: 44px; }
.qty-table input { width: 100%; min-width: 44px; min-height: 44px; font-size: 16px; }
.qty-table { table-layout: fixed; }
.view3d-credito { width: 90%; text-align: center; color: #62626a; font-size: 11px; }
.view3d-hint { width: max-content; max-width: 90%; text-align: center; color: #45454a; }
#view3dStatus { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); max-width: 80%; text-align: center; background: #fff; padding: 16px; border-radius: 8px; }
.project-slot:focus-within .slot-x { display: flex; }
.slot-select { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: inherit; }
.project-slot .slot-x { z-index: 1; }
.layer-row .layer-name { text-align: left; padding: 4px 0; color: var(--ink); }
#quotePreview { margin-bottom: 20px; }
#quotePreview img { display: block; width: 100%; max-height: 38dvh; object-fit: contain; background: #fff; border: 1px solid var(--line); }
#quotePreview p { margin-top: 8px; font-size: 13px; color: var(--muted); }
.view3d-views { position: absolute; bottom: 34px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; }
.view3d-views button { min-height: 44px; padding: 8px 16px; background: #fff; border-radius: 8px; font-weight: 600; box-shadow: var(--shadow); }
.view3d-views button[aria-pressed="true"] { outline: 2px solid var(--accent); }
.view3d-hint { bottom: 88px; }
#canvasArea[data-loading="true"]::after { content: 'Carregando o produto…'; position: absolute; inset: 0; display: grid; place-content: center; background: rgba(240,240,240,.8); color: var(--ink); z-index: 35; }
.history-tools { position: absolute; right: 12px; top: 12px; z-index: 30; display: flex; gap: 6px; }
.history-tools button { width: 44px; height: 44px; border-radius: 8px; background: #fff; box-shadow: var(--shadow); display: grid; place-content: center; }
.history-tools button:hover:not(:disabled) { background: #f8f2df; }
button:disabled { opacity: .45; cursor: not-allowed; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.art-quality { position: absolute; left: 12px; bottom: 12px; z-index: 20; max-width: min(330px,calc(100% - 170px)); padding: 10px 12px; background: #fff; text-align: left; border-radius: 8px; box-shadow: var(--shadow); }
.art-quality strong, .art-quality small { display: block; }
.art-quality strong { font-size: 13px; line-height: 1.4; }
.art-quality small { font-size: 12px; color: var(--muted); margin-top: 4px; }
.art-quality[data-level="low"] strong, .quality-item[data-level="low"] > p:first-of-type { color: #913718; }
.art-quality[data-level="review"] strong, .quality-item[data-level="review"] > p:first-of-type { color: #766022; }
.art-quality[data-level="suitable"] strong, .quality-item[data-level="suitable"] > p:first-of-type { color: #286138; }
.quality-item { padding-block: 12px; border-bottom: 1px solid var(--line); }
.quality-item strong { display: block; overflow-wrap: anywhere; font-size: 14px; }
.quality-item p, .quality-note, .quantity-note { font-size: 13px; color: var(--muted); margin-top: 8px; line-height: 1.5; }
.quality-item p:first-of-type { font-weight: 600; }
.quote-section { border-top: 1px solid var(--line); padding-block: 14px; }
.quote-section > summary { font-weight: 600; font-size: 14px; cursor: pointer; min-height: 28px; }
.quote-section:last-of-type { margin-bottom: 12px; }
.quantity-product { padding-block: 14px; }
.quantity-product + .quantity-product { border-top: 1px solid var(--line); }
.quantity-product h3 { font-size: 14px; line-height: 1.5; margin-bottom: 12px; }
.size-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 8px; }
.size-grid label { min-width: 0; text-align: center; font-size: 13px; font-weight: 600; }
.size-grid input { width: 100%; min-width: 0; height: 44px; padding: 6px 2px; border: 1px solid #aaa; border-radius: 6px; text-align: center; margin-top: 6px; font-size: 16px; font-weight: 400; font-variant-numeric: tabular-nums; }
.size-grid input[aria-invalid="true"] { border-color: #913718; }
.size-grid input:disabled { opacity: .6; }
@media (max-width: 600px) {
  .topbar { height: 56px; padding-inline: 8px; gap: 4px; }
  .topbar-left, .topbar-right { flex: 0 0 auto; }
  .logo { font-size: clamp(12px,4.2vw,18px); letter-spacing: .03em; }
  .btn-ghost { min-height: 44px; min-width: 44px; padding: 8px; font-size: 13px; }
  .sidebar { position: absolute; bottom: 0; left: 0; right: 0; width: 100%; height: 68px; padding: 0; flex-direction: row; justify-content: space-around; }
  .side-spacer { display: none; }
  .side-btn { flex: 1; padding: 9px 2px; font-size: 11px; letter-spacing: 0; min-width: 0; }
  .side-btn.active { box-shadow: inset 0 3px 0 var(--accent); }
  .canvas-area { margin-bottom: 68px; }
  .panel { position: absolute; left: 0; right: 0; top: auto; bottom: 68px; width: 100%; height: min(46dvh,340px); border-radius: 16px 16px 0 0; border-top: 1px solid #aaa; padding: 18px 16px; z-index: 25; overscroll-behavior: contain; }
  .panel h2 { padding-right: 44px; }
  .panel p, .upload-box small { font-size: 14px; }
  .panel-close { position: absolute; top: auto; bottom: calc(68px + min(46dvh,340px) - 50px); right: 8px; z-index: 26; width: 44px; height: 44px; }
  .float-tools { left: 8px; top: 12px; transform: none; flex-direction: row; gap: 6px; }
  .float-tools button { width: 44px; min-height: 48px; border-radius: 8px; }
  .history-tools { right: 8px; }
  .side-switch { right: 8px; bottom: 10px; flex-direction: row; gap: 8px; }
  .side-switch button { width: 58px; min-height: 48px; font-size: 11px; }
  .obj-toolbar { top: 70px; left: 8px; right: 8px; width: auto; transform: none; }
  .bottombar { min-height: 68px; height: auto; gap: 8px; padding: 8px 10px max(8px,env(safe-area-inset-bottom)); }
  .project-slots { min-width: 0; flex: 1; gap: 8px; }
  .project-slot, .btn-add { width: 44px; height: 44px; flex-shrink: 0; }
  .bottombar-right { flex-shrink: 0; margin-left: 0; }
  .btn-concluir { padding: 12px; font-size: 12px; min-height: 44px; letter-spacing: 0; }
  .project-slot .slot-x { display: flex; width: 24px; height: 24px; top: -2px; right: -2px; }
  .modal { padding: 10px; }
  .modal-card { max-height: calc(100dvh - 20px); }
  .modal-head { padding: 12px 16px; }
  .modal-body { padding: 16px; }
  .prod-grid { grid-template-columns: 1fr; }
  .prod-card .prod-img img { max-height: 35dvh; object-fit: contain; }
  .prod-card .mini-swatches button { width: 44px; height: 44px; }
  .modal-body input:not([type="color"]), .modal-body textarea { font-size: 16px; }
  .toast { bottom: 154px; max-width: calc(100% - 24px); width: max-content; text-align: center; }
}
@media (max-height: 500px) and (max-width: 900px) {
  .topbar { height: 44px; }
  .bottombar { height: 56px; }
  .modal { padding: 8px; }
  .modal-card { max-height: calc(100dvh - 16px); }
  .panel { top: 0; bottom: 0; }
  .panel-close { position: absolute; top: 4px; bottom: auto; }
}
