:root {
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #182622;
  background: #f3f5f1;
  --ink: #182622;
  --muted: #52635c;
  --line: #dce3dd;
  --accent: #205d4c;
  --tint: #e9f2eb;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select { font: inherit; }
[hidden] { display: none !important; }
button { cursor: pointer; }
button:disabled, label:has(input:disabled) { cursor: default; opacity: .55; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid #318774; outline-offset: 3px; }
.shell { width: min(1200px, calc(100% - 64px)); margin: 0 auto; }
.top { border-bottom: 1px solid var(--line); background: #fff; }
.top-inner { min-height: 62px; display: flex; gap: 16px; align-items: center; }
.shop-logo { width: auto; max-width: 119px; height: 32px; object-fit: contain; flex: none; }
.shop-name { font-size: 14px; font-weight: 700; overflow-wrap: anywhere; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 21px; font-weight: 650; line-height: 1.15; letter-spacing: -.02em; text-wrap: balance; }
.top-inner:has(:is(.shop-logo, .shop-name):not([hidden])) h1 { border-inline-start: 1px solid var(--line); padding-inline-start: 16px; }
#demo-cart { margin-left: auto; }
.workspace { display: grid; grid-template-columns: minmax(280px, 31fr) minmax(0, 69fr); gap: 20px; align-items: start; }
.product-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 9px 16px; padding-block: 11px; }
.by-size { margin-left: auto; font-size: 13px; text-underline-offset: 3px; }
.control-label { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.control-label select { min-height: 36px; max-width: 220px; border: 1px solid #c2cec6; background: #fff; color: var(--ink); border-radius: 7px; padding: 5px 8px; font-size: 14px; }
.units, .mobile-navigation { display: flex; gap: 4px; }
.mobile-navigation { display: none; }
.mobile-shortcut { display: none; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 15px; min-width: 0; overflow: hidden; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 57px; padding: 9px 20px; border-bottom: 1px solid var(--line); }
.panel-head h3 { font-size: 17px; letter-spacing: -.02em; }
.panel-head span, .muted { color: var(--muted); font-size: 13px; }
#art-count:not(:empty) { margin-left: 5px; font-weight: 400; }
.preview-actions { display: flex; gap: 3px; }
.tool-button { min-height: 34px; border: 1px solid #b7c6bd; border-radius: 7px; padding: 5px 8px; background: #fff; color: var(--ink); font-size: 13px; font-weight: 600; }
.tool-button:not(:disabled):hover, .tool-button[aria-pressed="true"] { background: var(--tint); border-color: var(--accent); }
.view-tools, .layout-controls { margin: 0 18px; padding: 10px 0; border-top: 1px solid var(--line); }
.view-tools, .zoom-group, .zoom-buttons, .view-presets, .view-presets label, .layout-controls label {
  display: flex; align-items: center; gap: 7px;
}
.view-tools { flex-wrap: wrap; gap: 9px 16px; color: var(--muted); font-size: 13px; }
.view-presets { flex-wrap: wrap; }
.zoom-buttons { gap: 0; border: 1px solid #b7c6bd; border-radius: 7px; }
.zoom-buttons button { border: 0; min-width: 33px; font-size: 16px; }
.zoom-buttons output { min-width: 43px; text-align: center; font-variant-numeric: tabular-nums; font-weight: 650; }
.artwork-body { padding: 16px; }
.drop { min-height: 153px; padding: 22px 12px; border: 1px dashed #a9bdb0; border-radius: 12px; background: #f3f8f4; text-align: center; display: grid; justify-items: center; align-content: center; gap: 8px; }
.drop[data-over="true"] { background: #ddeee1; border-color: var(--accent); }
.drop p, .drop small { color: var(--muted); font-size: 13px; }
.button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 9px 14px; border-radius: 8px; border: 1px solid transparent; font-size: 14px; font-weight: 650; text-align: center; text-decoration: none; }
.primary { background: var(--accent); color: #fff; }
.primary:not(:disabled):hover { background: #174838; }
.secondary { background: #fff; border-color: #c2cec6; color: var(--ink); }
.secondary:not(:disabled):hover { background: #edf4ef; }
.upload-label { position: relative; cursor: pointer; }
.upload-label input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: inherit; }
.upload-label:focus-within { outline: 3px solid #318774; outline-offset: 3px; }
.art-options { display: flex; justify-content: space-between; gap: 4px 10px; flex-wrap: wrap; margin: 10px 0; align-items: center; font-size: 13px; }
.art-options label { display: flex; align-items: center; gap: 5px; min-height: 34px; }
input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; }
.text-button { border: 0; background: transparent; color: var(--accent); border-radius: 6px; padding: 6px; min-height: 34px; font-size: 13px; font-weight: 650; }
.text-button:not(:disabled):hover { background: var(--tint); }
.empty-art { color: var(--muted); padding: 12px 3px 16px; font-size: 13px; }
.message { padding: 8px 8px 8px 11px; margin: 8px 0; display: flex; align-items: center; justify-content: space-between; gap: 6px; border-radius: 8px; background: var(--tint); font-size: 13px; overflow-wrap: anywhere; }
.message.error { background: #fff0e8; color: #772f1c; }
.message-copy { min-width: 0; flex: 1; }
.message progress { display: block; width: 100%; height: 8px; margin: 6px 0 2px; accent-color: var(--accent); }
.card { border: 1px solid var(--line); border-radius: 10px; margin: 10px 0; padding: 11px; }
.card-head { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 9px; align-items: center; }
.thumb, .paper { background-color: #fff; background-image: conic-gradient(#eef1ee 25%, #fff 0 50%, #eef1ee 0 75%, #fff 0); background-size: 16px 16px; }
.thumb { width: 52px; height: 52px; border: 1px solid var(--line); border-radius: 6px; object-fit: contain; }
.thumb[data-warning="true"] { border: 2px solid #a96a16; }
.native-size { color: var(--muted); font-size: 12px; }
.card-actions { display: flex; flex-wrap: wrap; gap: 5px 10px; margin-top: 7px; }
.name { font-size: 14px; overflow-wrap: anywhere; display: block; }
.quality { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.quality.warning, .art-warning { color: #835018; }
.quality.error { color: #9c3621; }
.icon-button { color: var(--muted); background: #fff; border: 0; border-radius: 6px; min-width: 34px; min-height: 34px; font-size: 21px; line-height: 1; }
.icon-button:hover { background: var(--tint); }
.fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 9px; }
.fields label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.fields input { width: 100%; min-height: 39px; border: 1px solid #c6d1c8; border-radius: 7px; padding: 6px; color: var(--ink); background: #fff; font-size: 16px; }
.art-warning { font-size: 12px; margin-top: 8px; }
.layout-message { visibility: hidden; height: 30px; padding: 6px 19px; color: var(--muted); font-size: 13px; }
.layout-message:not(:empty) { visibility: visible; height: auto; min-height: 30px; }
.layout-message[data-error="true"] { color: #9c3621; }
.tabs { display: flex; gap: 6px; overflow: auto; padding: 0 18px 9px; }
.tabs:empty { display: none; }
.tab { white-space: nowrap; background: #fff; color: var(--muted); padding: 7px 11px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
.tab[aria-pressed="true"] { background: var(--tint); color: var(--accent); border-color: #a7c4b2; font-weight: 650; }
.viewport { background: #e7ede8; display: flex; align-items: flex-start; justify-content: center; min-height: 260px; height: min(36vh, 400px); overflow: auto; padding: 16px; margin: 0 18px; border-radius: 9px; }
.viewport { justify-content: safe center; }
.paper { position: relative; flex: none; border: 1px solid #bfccc2; box-shadow: 0 2px 7px #19352615; overflow: hidden; }
.paper[data-dark="true"] { background-color: #48524f; background-image: conic-gradient(#5e6965 25%, #48524f 0 50%, #5e6965 0 75%, #48524f 0); }
.paper .cut-guide { position: absolute; pointer-events: none; border: 1px dashed #628674; z-index: 1; }
.paper .used-guide { position: absolute; pointer-events: none; border-top: 1px dashed #628674; left: 0; right: 0; }
.paper[data-guides="false"] :is(.cut-guide, .used-guide) { display: none; }
.paper[data-guides="false"] .piece::after { border: 0; }
.piece::after { content: ""; position: absolute; z-index: 1; inset: 0; pointer-events: none; border: 1px dashed #205d4c8a; }
.paper.blank { width: min(100%, 230px); height: 100%; border-style: dashed; display: grid; align-content: center; text-align: center; padding: 16px; }
.paper.blank p { display: block; color: var(--muted); font-size: 13px; margin-top: 5px; }
.paper.blank[data-dark="true"], .paper.blank[data-dark="true"] p { color: #fff; }
.piece { position: absolute; border: 0; padding: 0; overflow: hidden; background: transparent; touch-action: pan-y; cursor: grab; color: inherit; }
.piece[aria-pressed="true"] { touch-action: none; }
.piece:hover, .piece:focus-visible, .piece[data-moving="true"], .piece[aria-pressed="true"] { outline: 2px solid var(--accent); outline-offset: -2px; }
.piece[data-moving="true"] { z-index: 2; cursor: grabbing; }
.piece img { position: absolute; top: 50%; left: 50%; width: 100%; height: 100%; transform: translate(-50%, -50%) rotate(var(--rotation, 0deg)); pointer-events: none; }
.preview-meta { min-height: 57px; padding: 10px 19px; display: grid; gap: 3px; align-content: center; color: var(--muted); font-size: 13px; }
.preview-meta strong { color: var(--ink); }
.summary { min-height: 74px; padding: 11px 17px; display: flex; justify-content: space-between; gap: 10px; align-items: center; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 15px 15px; background: #fcfdfa; }
.preview-column { position: sticky; top: 12px; min-width: 0; }
.layout { border-radius: 15px 15px 0 0; }
.summary-note { font-size: 13px; color: var(--muted); margin-left: auto; text-align: right; }
.summary strong { display: block; font-size: 22px; letter-spacing: -.03em; line-height: 1.2; }
.workspace-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; margin: 14px 0 22px; color: var(--muted); font-size: 12px; }
#shop-credit { margin-inline-start: auto; }
dialog { color: var(--ink); padding: 0; width: min(580px, calc(100% - 24px)); max-height: calc(100% - 30px); border: 1px solid var(--line); border-radius: 14px; }
dialog::backdrop { background: #14241ed0; }
.dialog-heading, .dialog-footer { padding: 16px 20px; display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.dialog-heading h2 { font-size: 24px; }
.dialog-heading p { color: var(--muted); margin-top: 5px; font-size: 14px; }
.dialog-footer { justify-content: flex-end; border-top: 1px solid var(--line); }
.review-notice { padding: 0 20px 13px; }
.artwork-label { position: absolute; z-index: 3; pointer-events: none; padding: 5px 8px; border: 1px solid #b7c6bd;
  border-radius: 6px; background: #fff; box-shadow: 0 2px 7px #19352625; color: var(--ink); font-size: 12px; font-weight: 650; white-space: nowrap; }
.card[data-selected="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.locate-art { display: block; padding: 0; text-align: left; color: inherit; background: none; border: 0; }
.layout-controls, .edit-tools, .notice-actions { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.layout-controls label, .edit-tools label, .crop-inputs label { font-size: 13px; color: var(--muted); }
.layout-controls input[type="number"], .view-presets select, .crop-inputs input { border: 1px solid #c6d1c8; border-radius: 6px; padding: 5px; background: white; max-width: 80px; }
.layout-controls input[type="number"], .view-presets select { min-height: 34px; }
.layout-controls input[type="number"] { width: 64px; }
.review-view-tools { margin: 10px 0 8px; }
.review-preview-viewport {
  --review-preview-height: clamp(175px, 43vh, 340px);
  height: var(--review-preview-height);
  overflow: auto;
  scrollbar-gutter: stable;
  background: #e7ede8;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.review-thumbnail { position: relative; margin-inline: auto; background: repeating-conic-gradient(#edf0ed 0 25%, #fff 0 50%) 0 / 12px 12px; overflow: hidden; }
.review-thumbnail .piece { pointer-events: none; }
.review-thumbnail .piece::after { border: 0; }
.notice-items { padding: 0 20px 14px; }
.notice-items p { margin: 0 0 9px; overflow-wrap: anywhere; }
.notice-item { padding: 9px 0; border-bottom: 1px solid var(--line); }
.art-editor-body { padding: 0 16px 16px; }
.editor-view { position: relative; width: fit-content; max-width: 100%; margin: 0 auto; line-height: 0; }
.editor-view canvas { display: block; max-width: 100%; max-height: 45vh; object-fit: contain; touch-action: none; background: repeating-conic-gradient(#dfe5df 0 25%, #fff 0 50%) 0 / 14px 14px; }
#crop-overlay { position: absolute; border: 2px dashed #27705b; pointer-events: none; }
.edit-tools { margin: 9px 0; }
#edit-status { margin-top: 9px; color: var(--muted); font-size: 13px; }
.crop-inputs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.crop-inputs label { display: grid; gap: 3px; }
.crop-inputs input { width: 100%; }
.settings-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 12px; padding: 0 20px; }
.settings-fields label, .price-grid { display: grid; gap: 4px; min-width: 0; font-size: 13px; color: var(--muted); }
.settings-fields input, .settings-fields select, .price-grid textarea { width: 100%; min-height: 38px; border: 1px solid #c6d1c8; border-radius: 7px; padding: 6px; font: inherit; font-size: 16px; color: var(--ink); background: #fff; }
.settings-fields .settings-check { display: flex; align-items: center; }
.settings-fields input[type="checkbox"] { width: auto; min-height: 0; }
.price-grid { padding: 12px 20px; }
#settings-status:not(:empty) { margin: 0 20px 12px; font-size: 13px; color: #9c3621; }
.review-notice label { display: flex; align-items: center; gap: 8px; padding: 9px; background: #fff4dd; border-radius: 8px; margin-bottom: 9px; font-size: 14px; }
#cart-status:not(:empty) { margin-top: 8px; font-size: 14px; }
#review-sheets { padding: 0 20px 14px; }
.review-row { padding: 12px; border: 1px solid var(--line); border-radius: 8px; margin-top: 8px; }
.review-row p { margin: 5px 0 8px; color: var(--muted); font-size: 13px; }
.review-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.export-status { color: var(--muted); font-size: 13px; }
@media (max-width: 760px) {
  .shell { width: calc(100% - 24px); }
  .workspace { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .top-inner { min-height: 56px; }
  .top-inner { flex-wrap: wrap; padding: 7px 0; gap: 10px; }
  .top-inner h1 { flex: 1; min-width: 0; font-size: 16px; }
  .top-inner:has(:is(.shop-logo, .shop-name):not([hidden])) h1 { padding-inline-start: 10px; }
  .shop-logo { max-width: 94px; }
  .mobile-navigation { display: flex; margin-bottom: 10px; }
  .mobile-shortcut { display: inline-block; }
  .mobile-navigation button { flex: 1; min-height: 40px; }
  .workspace[data-view="artwork"] .layout, .workspace[data-view="preview"] .artwork { display: none; }
  .preview-column { position: static; }
  .layout { border-radius: 15px; }
  .viewport { min-height: 300px; height: 51vh; margin: 0 12px; }
  .view-tools, .layout-controls { margin-inline: 12px; }
  .summary { position: fixed; bottom: 0; left: 0; right: 0; z-index: 3; gap: 6px 10px; flex-wrap: wrap; padding: 8px 12px max(8px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); border-radius: 0; }
  .summary-note:not(:empty) { order: 3; width: 100%; text-align: left; }
  .workspace-footer { margin-bottom: calc(var(--summary-height, 90px) + 16px); }
  .dialog-footer { flex-wrap: wrap; }
}
