body.paint-page { background: #fbf8f4; font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; -webkit-font-smoothing: antialiased; }

/* paint-design is intentionally self-contained: the old page borrowed this
   header from portrait.css without loading that file, which left naked text at
   the top of the page. */
.tool-site-header { display: flex; align-items: center; min-height: 58px; padding: 0 28px; border-bottom: 1px solid rgba(96, 67, 45, .09); background: rgba(255, 253, 250, .94); box-shadow: 0 2px 12px rgba(71, 47, 30, .035); }
.tool-site-header-left { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.tool-site-header-back { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid #e7ddd4; border-radius: 10px; background: #fff; }
.tool-site-header-back:hover { color: #a84b1d; border-color: #d9a985; }
.tool-site-header-back svg { width: 18px; height: 18px; }
.tool-site-header-title { display: grid; gap: 1px; }
.tool-site-header-title h1 { margin: 0; color: #2e2520; font-size: 16px; line-height: 1.2; letter-spacing: .04em; }
.tool-site-header-title small { color: #978b82; font-size: 10px; }
.tool-site-header-nav { display: flex; align-items: stretch; gap: 24px; height: 58px; margin-left: auto; }
.tool-site-header-nav a { position: relative; display: inline-flex; align-items: center; color: #756c65; font-size: 12px; white-space: nowrap; }
.tool-site-header-nav a:hover { color: #2e2520; }
.tool-site-header-nav a.is-active { color: #a84b1d; font-weight: 650; }
.tool-site-header-nav a.is-active::after { content: ""; position: absolute; right: 0; bottom: 0; left: 0; height: 2px; border-radius: 2px 2px 0 0; background: #b95725; }

.paint-shell { width: min(1420px, calc(100% - 48px)); margin: 0 auto; padding: 16px 0 28px; }
.paint-hero { position: relative; margin-bottom: 14px; }
.paint-crumb { position: absolute; top: 5px; right: 0; display: flex; justify-content: flex-end; gap: 6px; color: #a8978b; font-size: 11px; }
.paint-crumb a:hover { color: #b54f1f; }
.paint-crumb b { color: #6b615a; font-weight: 500; }
.paint-hero h1 { margin: 0; font-size: clamp(22px, 2vw, 28px); line-height: 1.25; letter-spacing: .01em; }
.paint-hero p { margin: 5px 0 0; color: #8a817b; font-size: 12px; }

.paint-workspace { display: grid; grid-template-columns: minmax(0, 1.95fr) minmax(345px, .95fr); gap: 14px; align-items: stretch; }
.paint-main, .paint-side { display: grid; gap: 12px; min-width: 0; }
.paint-side { grid-template-rows: auto auto minmax(0, 1fr); }
.paint-side > .paint-panel:last-child { display: flex; flex-direction: column; }
.paint-side > .paint-panel:last-child .paint-primary { margin-top: 16px; }
.paint-panel { padding: 14px 16px; border: 1px solid #eee6df; border-radius: 16px; background: rgba(255, 255, 255, .94); box-shadow: 0 8px 22px rgba(91, 62, 42, .045); }
.paint-panel-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.paint-panel-head h2 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 17px; }
.paint-panel-head h2 i { display: grid; place-items: center; flex-shrink: 0; width: 25px; height: 25px; border-radius: 50%; color: #fff; background: linear-gradient(135deg, #c98a52, #ad5728); font-size: 12px; font-style: normal; font-weight: 700; }
.paint-panel-head > span { margin-left: auto; color: #a8978b; font-size: 12px; }
.paint-hint { margin: 12px 0 0; color: #a8978b; font-size: 12px; line-height: 1.65; }
.paint-hint.is-center { text-align: center; }
.paint-preview-billing { display: flex; align-items: center; justify-content: center; gap: 8px; }
.paint-preview-billing strong { flex: 0 0 auto; padding: 2px 8px; border-radius: 999px; color: #9b441c; background: #fff0e5; font-size: 11px; line-height: 1.6; }

.paint-style-list { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 9px; }
.paint-style-card { display: grid; gap: 5px; padding: 5px; border: 1px solid #eee5dd; border-radius: 11px; text-align: left; background: #fff; cursor: pointer; transition: .16s ease; }
.paint-style-card:hover { border-color: #dfbaa1; transform: translateY(-1px); }
.paint-style-card.is-active { border-color: #b54f1f; box-shadow: 0 0 0 2px rgba(181, 79, 31, .14); }
.paint-style-thumb { position: relative; display: grid; place-items: center; aspect-ratio: 1.78 / 1; overflow: hidden; border-radius: 7px; color: rgba(255, 255, 255, .94); background: var(--thumb, linear-gradient(135deg, #f4eadf, #e4d2bf)); font-size: 10px; letter-spacing: .04em; }
.paint-style-thumb img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.paint-style-card.is-active .paint-style-thumb::after { content: "✓"; position: absolute; top: 5px; right: 5px; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; color: #fff; background: #b54f1f; font-size: 11px; line-height: 1; }
.paint-style-card strong { font-size: 12px; }
.paint-style-card small { overflow: hidden; color: #8a817b; font-size: 10px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.paint-scene-fieldset { display: flex; align-items: stretch; gap: 8px; margin: 12px 0 0; padding: 0; border: 0; }
.paint-scene-fieldset legend { float: left; align-self: center; margin-right: 4px; padding: 0; color: #5f5a55; font-size: 12px; font-weight: 600; }
.paint-scene-option { display: flex; align-items: flex-start; gap: 7px; flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid #eee5dd; border-radius: 10px; background: #fff; cursor: pointer; }
.paint-scene-option:has(input:checked) { border-color: #c8784d; background: #fff8f3; }
.paint-scene-option input { margin: 2px 0 0; accent-color: #b54f1f; }
.paint-scene-option span { display: grid; gap: 2px; }
.paint-scene-option strong { font-size: 12px; }
.paint-scene-option small { color: #8a817b; font-size: 10px; line-height: 1.35; }

.paint-source-picker { margin-bottom: 14px; padding: 12px 14px; border: 1px solid #e7b58f; border-radius: 12px; background: #fff7f1; }
.paint-notice { margin: 0 0 10px; color: #8b3715; font-size: 12px; line-height: 1.65; }
.paint-source-strip { display: flex; flex-wrap: wrap; gap: 10px; }
.paint-source-entry { position: relative; padding: 4px 4px 0 0; }
.paint-source-remove { position: absolute; top: -3px; right: -3px; display: grid; place-items: center; width: 25px; height: 25px; padding: 0; border: 1px solid #dcc7b6; border-radius: 50%; background: #fff; color: #9b6543; font: 18px/1 sans-serif; cursor: pointer; }
.paint-source-remove:focus-visible { outline: 3px solid #b87542; outline-offset: 2px; }
.paint-source-entry button:disabled { opacity: .5; cursor: default; }
.paint-source-thumb { position: relative; width: 64px; height: 64px; padding: 0; overflow: hidden; border: 1px solid #e2d5c9; border-radius: 10px; background: #fff; cursor: pointer; transition: .16s ease; }
.paint-source-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.paint-source-thumb:hover { border-color: #dfbaa1; }
.paint-source-thumb.is-active { border-color: #b54f1f; box-shadow: 0 0 0 2px rgba(181, 79, 31, .16); }
.paint-source-thumb > span { position: absolute; right: 3px; bottom: 3px; padding: 1px 5px; border-radius: 6px; color: #fff; background: rgba(44, 41, 39, .58); font-size: 10px; line-height: 1.5; }

.paint-compare { --paint-preview-ratio: 3 / 4; display: grid; grid-template-columns: minmax(0, 1fr) 26px minmax(0, 1fr); gap: 14px; align-items: center; }
.paint-compare-slot { display: grid; gap: 8px; width: 100%; min-width: 0; margin: 0; }
.paint-compare-image { display: grid; place-items: center; width: 100%; height: auto; aspect-ratio: var(--paint-preview-ratio); overflow: hidden; border: 1px dashed #e6dacd; border-radius: 12px; color: #b3a496; background: #fdfaf7; font-size: 12px; }
.paint-compare-image.is-filled { border-style: solid; border-color: #efe1d4; }
.paint-compare-image img { display: block; width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; object-position: center; background: #fff; }
.paint-compare-slot figcaption { color: #8a817b; font-size: 12px; text-align: center; line-height: 1.5; }
.paint-compare-arrow { color: #cbb9aa; }
.paint-compare-arrow svg { width: 22px; height: 22px; }

.paint-history { margin: 14px 0; }
.paint-history[hidden] { display: none; }
.paint-history-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; font-size: 12px; }
.paint-history-head a { color: #a84b1d; }
.paint-history-list { display: flex; gap: 9px; overflow-x: auto; padding: 3px 2px 6px; }
.paint-history-entry { position: relative; flex: 0 0 76px; }
.paint-history-item { flex: 0 0 76px; padding: 4px; border: 1px solid #e9ddd3; border-radius: 9px; background: #fff; cursor: pointer; }
.paint-history-delete { position: absolute; top: -3px; right: -3px; display: grid; place-items: center; width: 20px; height: 20px; padding: 0; border: 1px solid #e9d2c4; border-radius: 50%; background: #fff; color: #a84b1d; font-size: 16px; line-height: 1; cursor: pointer; }
.paint-history-delete:hover { background: #fff1e9; }
.paint-history-delete:focus-visible { outline: 2px solid #a84b1d; outline-offset: 2px; }
.paint-history-item.is-active { border-color: #b54f1f; box-shadow: 0 0 0 2px rgba(181,79,31,.12); }
.paint-history-item img { width: 66px; height: 66px; object-fit: contain; background: #fbf8f4; }
.paint-history-item span { display: block; overflow: hidden; font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }

.paint-primary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 48px; border: 0; border-radius: 11px; color: #fff; background: linear-gradient(105deg, #bf5f2b, #8d3714); font-size: 14px; font-weight: 700; letter-spacing: .02em; cursor: pointer; box-shadow: 0 8px 18px rgba(123, 51, 17, .18); }
.paint-primary:hover:not(:disabled) { background: linear-gradient(105deg, #ad4f1e, #7a2f10); }
.paint-primary:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.paint-primary svg { width: 17px; height: 17px; }
.paint-panel .paint-primary { margin-top: 12px; }
.paint-side > .paint-primary { margin-top: 0; }
.paint-primary.is-order { background: linear-gradient(105deg, #c2662f, #8d3714); }

.paint-craft-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.paint-craft-card { display: grid; grid-template-columns: auto 1fr; gap: 3px 8px; align-items: center; min-height: 68px; padding: 10px; border: 1px solid #f0e7de; border-radius: 11px; text-align: left; background: #fff; cursor: pointer; transition: .16s ease; }
.paint-craft-card:hover { border-color: #dfbaa1; }
.paint-craft-card.is-active { border-color: #b54f1f; background: #fff7f1; box-shadow: 0 0 0 2px rgba(181, 79, 31, .12); }
.paint-craft-dot { grid-row: span 2; width: 17px; height: 17px; border: 1.5px solid #ddcec1; border-radius: 50%; }
.paint-craft-card.is-active .paint-craft-dot { border-color: #b54f1f; box-shadow: inset 0 0 0 4px #b54f1f; }
.paint-craft-card strong { font-size: 13.5px; }
.paint-craft-card span { grid-column: 2; color: #8a817b; font-size: 11px; line-height: 1.5; }

.paint-painter { margin-top: 12px; padding: 14px; border: 1px solid #e7b58f; border-radius: 12px; background: #fff7f1; }
.paint-painter-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.paint-painter-avatar { display: grid; place-items: center; flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; color: #8b3715; background: #fbe2d0; font-size: 15px; font-weight: 700; }
.paint-painter strong { display: block; font-size: 14px; }
.paint-painter small { color: #8a817b; font-size: 12px; }
.paint-painter p { margin: 0; color: #5f5a55; font-size: 12px; line-height: 1.7; }

.paint-field { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 3px 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid #f5f0ea; }
.paint-field:last-child { border-bottom: 0; }
.paint-field-label { color: #5f5a55; font-size: 13px; }
.paint-field select { min-width: 0; height: 36px; padding: 0 10px; border: 1px solid #e8dfd8; border-radius: 9px; color: #39312c; background: #fff; font-size: 12px; }
.paint-field-hint { grid-column: 2; color: #a8978b; font-size: 11px; line-height: 1.5; }
.paint-ratio-notice { margin: 2px 0 8px 48px; color: #99522d; font-size: 11px; line-height: 1.45; }

.paint-quote { display: grid; gap: 7px; }
.paint-quote-row { display: flex; justify-content: space-between; gap: 12px; color: #5f5a55; font-size: 13px; }
.paint-quote-total { display: flex; align-items: baseline; justify-content: space-between; margin-top: 2px; padding-top: 12px; border-top: 1px solid #f2ece5; }
.paint-quote-total span { color: #5f5a55; font-size: 13px; }
.paint-quote-total strong { color: #b54f1f; font-size: 21px; }
.paint-quote-note { margin: 8px 0 0; color: #b3a496; font-size: 10px; line-height: 1.5; }
.paint-order-summary { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding: 8px; border: 1px solid #f0e8e0; border-radius: 10px; background: #fdfaf7; }
.paint-order-summary img { display: block; width: 52px; height: 52px; flex: 0 0 auto; border-radius: 7px; object-fit: contain; background: #fff; }
.paint-order-summary > span { color: #a8978b; font-size: 11px; }
.paint-order-summary div { display: grid; gap: 3px; min-width: 0; }
.paint-order-summary strong { color: #39312c; font-size: 12px; }
.paint-order-summary small { color: #8a817b; font-size: 11px; }
.paint-order-dialog { width: min(460px, calc(100% - 32px)); max-height: calc(100dvh - 32px); padding: 0; overflow: auto; border: 1px solid #e9ddd2; border-radius: 16px; color: #39312c; background: #fff; box-shadow: 0 24px 70px rgba(44, 25, 15, .24); }
.paint-order-dialog::backdrop { background: rgba(32, 25, 21, .55); }
.paint-order-dialog-content { position: relative; padding: 22px; }
.paint-order-dialog h2 { margin: 0 30px 6px 0; font-size: 19px; }
.paint-order-intro, .paint-order-caution, .paint-order-ratio { margin: 0 0 12px; color: #82766f; font-size: 12px; line-height: 1.55; }
.paint-order-close { position: absolute; top: 12px; right: 14px; border: 0; color: #8a817b; background: transparent; font-size: 26px; cursor: pointer; }
.paint-order-art { display: grid; place-items: center; max-height: min(45vh, 360px); margin-bottom: 14px; border: 1px solid #eee6df; border-radius: 10px; background: #fdfaf7; }
.paint-order-art img { display: block; max-width: 100%; max-height: min(45vh, 360px); object-fit: contain; }
.paint-order-details { display: grid; grid-template-columns: 60px 1fr; gap: 6px 10px; margin: 0 0 12px; font-size: 12px; }
.paint-order-details dt { color: #8a817b; }
.paint-order-details dd { margin: 0; }
.paint-order-caution { color: #a35a32; }
.paint-order-actions { display: flex; gap: 10px; }
.paint-order-actions button { flex: 1; height: 42px; }
.paint-order-cancel { border: 1px solid #e8dfd8; border-radius: 10px; background: #fff; cursor: pointer; }
.paint-order-actions .paint-primary { width: auto; margin: 0; }

.paint-trust { display: flex; justify-content: space-between; gap: 10px; margin: 10px 0 0; padding: 0; list-style: none; }
.paint-trust li { display: inline-flex; align-items: center; gap: 6px; color: #8a817b; font-size: 12px; }
.paint-trust svg { width: 15px; height: 15px; color: #b54f1f; }

.paint-toast { position: fixed; z-index: 30; top: 20px; left: 50%; max-width: min(520px, calc(100% - 32px)); padding: 11px 18px; border: 1px solid #e6c6b1; border-radius: 11px; color: #8b3715; background: #fffaf6; box-shadow: 0 10px 28px rgba(73, 50, 36, .055); opacity: 0; pointer-events: none; transform: translate(-50%, -8px); transition: .2s ease; }
.paint-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.paint-toast.is-error { color: #982d25; border-color: #efc8c2; background: #fff6f4; }

/* 13-inch laptops commonly leave only ~700px of page height after browser UI.
   Keep the complete workflow visible without shrinking tap targets. */
@media (min-width: 1051px) and (max-height: 820px) {
  .tool-site-header { min-height: 50px; }
  .tool-site-header-nav { height: 50px; }
  .paint-shell { padding-top: 10px; }
  .paint-hero { min-height: 42px; margin-bottom: 10px; }
  .paint-hero h1 { font-size: 23px; }
  .paint-hero p { margin-top: 3px; font-size: 11px; }
  .paint-crumb { top: 3px; }
  .paint-main, .paint-side { gap: 10px; }
  .paint-panel { padding: 12px 16px; border-radius: 14px; }
  .paint-panel-head { margin-bottom: 9px; }
  .paint-panel-head h2 { font-size: 16px; }
  .paint-panel-head h2 i { width: 24px; height: 24px; }
  .paint-style-card { gap: 3px; padding: 4px; }
  .paint-style-thumb { aspect-ratio: 1.78 / 1; }
  .paint-style-card small { line-height: 1.2; }
  .paint-compare { gap: 10px; }
  .paint-compare-slot { gap: 4px; }
  .paint-primary { height: 42px; }
  .paint-panel .paint-primary { margin-top: 9px; }
  .paint-hint { margin-top: 6px; line-height: 1.4; }
  .paint-craft-card { min-height: 58px; padding: 8px; }
  .paint-craft-card span { line-height: 1.25; }
  .paint-field { grid-template-columns: 36px minmax(0, 1fr) auto; gap: 3px 9px; padding: 6px 0; }
  .paint-field select { height: 33px; }
  .paint-field-hint { grid-column: 2 / -1; line-height: 1.3; }
  .paint-quote { gap: 5px; }
  .paint-quote-total { padding-top: 8px; }
  .paint-quote-total strong { font-size: 19px; }
  .paint-quote-note { margin-top: 5px; line-height: 1.3; }
  .paint-trust { margin-top: 7px; }
}

@media (max-width: 1050px) {
  .paint-workspace { grid-template-columns: minmax(0, 1fr); }
  .paint-side { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto auto; align-items: start; }
  .paint-side .paint-panel:last-child { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .paint-style-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tool-site-header { align-items: flex-start; padding: 10px 16px; }
  .tool-site-header-nav { gap: 18px; height: auto; margin-left: 20px; overflow-x: auto; }
  .tool-site-header-nav a { min-height: 36px; }
}
@media (max-width: 720px) {
  .paint-shell { width: calc(100% - 24px); }
  .paint-side { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; }
  .paint-style-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .paint-crumb { justify-content: flex-start; }
  .paint-crumb { position: static; margin-bottom: 8px; }
  .tool-site-header-title small, .tool-site-header-nav { display: none; }
  .paint-compare { grid-template-columns: minmax(0, 1fr); }
  .paint-compare-image { height: auto; min-height: 0; aspect-ratio: var(--paint-preview-ratio); }
  .paint-compare-arrow { justify-self: center; transform: rotate(90deg); }
  .paint-preview-billing { align-items: flex-start; }
  .paint-scene-fieldset { flex-wrap: wrap; }
  .paint-scene-fieldset legend { float: none; width: 100%; }
}

/* Account project controls */
#paintAccountProject { display: grid; gap: 12px; }
#paintAccountProject[hidden], .paint-project-actions [hidden] { display: none !important; }
.paint-project-name { display: grid; grid-template-columns: 76px minmax(0,1fr); align-items: center; gap: 10px; font-size: 13px; }
.paint-project-name input { width: 100%; min-width: 0; padding: 9px 10px; border: 1px solid #e8dfd8; border-radius: 8px; font: inherit; color: #39312c; background: #fff; }
.paint-project-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.paint-project-actions button { padding: 9px 14px; border: 1px solid #d7b79f; border-radius: 8px; color: #8d3714; background: #fff8f3; font: inherit; font-size: 13px; cursor: pointer; }
.paint-project-actions button:disabled { opacity: .5; cursor: default; }
#paintSaveStatus { margin: 0; overflow-wrap: anywhere; }
