:root {
  --bg: #eef1ec;
  --panel: #ffffff;
  --ink: #1c2921;
  --muted: #6a756e;
  --line: #d8ded8;
  --green: #285f3a;
  --green-2: #3d7c51;
  --sand: #f3eee2;
  --orange: #b46d00;
  --red: #8a2b2b;
  --blue: #2a62a8;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; color: var(--ink); background: var(--bg); overflow: hidden; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at top, #f8faf6, #dfe8df); }
.card { background: white; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 20px 50px rgba(32,55,38,.12); }
.login-card { width: min(460px, 100%); padding: 36px; }
.login-card h1 { margin: 5px 0 12px; font-size: 2rem; }
.eyebrow { margin: 0; color: var(--green); font-size: .72rem; font-weight: 800; letter-spacing: .16em; }
label { display: grid; gap: 6px; color: var(--muted); font-size: .84rem; margin: 14px 0; }
input, select, textarea { width: 100%; border: 1px solid #c9d2ca; border-radius: 9px; padding: 10px 11px; background: #fff; color: var(--ink); }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid #a9cbb1; border-color: var(--green-2); }
.primary, .secondary, .ghost, .danger-outline, .icon-button { border-radius: 9px; padding: 9px 13px; border: 1px solid transparent; }
.primary { background: var(--green); color: white; }
.primary:hover { background: #1e4d2d; }
.secondary { background: #edf4ee; color: var(--green); border-color: #bbd0bf; }
.ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.danger-outline { background: #fff7f7; border-color: #d6aaaa; color: var(--red); }
.icon-button { width: 34px; height: 34px; padding: 0; background: var(--green); color: white; font-size: 1.3rem; }
.full { width: 100%; }
.small { padding: 6px 9px; font-size: .8rem; }
.error { color: var(--red); min-height: 1.2em; }
.app { height: 100vh; min-height: 0; display: grid; grid-template-rows: auto minmax(0,1fr); overflow: hidden; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 24px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); }
.topbar h1 { margin: 3px 0 0; font-size: 1.35rem; }
.top-actions, .button-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.badge { background: var(--sand); color: #665535; border-radius: 999px; padding: 6px 10px; font-size: .77rem; }
.workspace { display: grid; grid-template-columns: 260px minmax(480px,1fr) 370px; min-height: 0; height: 100%; overflow: hidden; gap: 1px; background: var(--line); }
.panel { background: var(--panel); min-height: 0; overflow: auto; }
.left-panel, .right-panel { padding: 18px; }
.left-panel section, .right-panel section { border-bottom: 1px solid var(--line); padding-bottom: 18px; margin-bottom: 18px; }
section:last-child { border-bottom: 0; }
h2 { font-size: 1rem; margin: 0 0 10px; }
.section-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.hint, .muted { color: var(--muted); font-size: .78rem; }
.list { display: grid; gap: 8px; }
.list-item { border: 1px solid var(--line); border-radius: 10px; padding: 10px; background: #fff; }
.list-item.active { border-color: var(--green-2); box-shadow: inset 3px 0 var(--green-2); background: #f6faf6; }
.list-item button { border: 0; background: transparent; color: inherit; padding: 0; text-align: left; }
.item-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 5px; color: var(--muted); font-size: .72rem; }
.item-actions { margin-top: 7px; display: flex; gap: 7px; }
.compact .list-item { padding: 8px; }
.drawing-controls { background: #eef6ff; border: 1px solid #b9d0eb; border-radius: 10px; padding: 9px; margin-top: 9px; }
.map-panel { display: grid; grid-template-rows: auto 1fr auto; overflow: hidden; }
.map-toolbar { min-height: 58px; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: .72rem; color: var(--muted); }
.swatch { display: inline-block; width: 12px; height: 12px; margin-right: 4px; vertical-align: -2px; border-radius: 2px; }
.swatch.existing { background: #b2caaa; }
.swatch.protected { border: 2px solid #9c2f2f; }
.swatch.zone { background: #3c83f6; opacity: .5; }
.swatch.planned { background: #e5a235; }
.swatch.conflict { background: #d83b35; border: 1px solid #9f1f1b; }
.map-wrap { position: relative; min-height: 480px; background: #f7f5ef; overflow: hidden; }
#garden-map { display: block; width: 100%; height: 100%; min-height: 480px; cursor: default; }
#garden-map.drawing { cursor: crosshair; }
.map-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); pointer-events: none; }
.feature { vector-effect: non-scaling-stroke; transition: opacity .15s, stroke-width .15s; }
.feature:hover { opacity: .78; stroke-width: 4; }
.feature.protected { stroke: #9b3030; stroke-width: 3; }
.feature.external { opacity: .5; }
.zone-shape { fill: rgba(44,103,188,.18); stroke: #2a62a8; stroke-width: 3; vector-effect: non-scaling-stroke; }
.plan-shape { fill: rgba(235,165,46,.28); stroke: #b46d00; stroke-width: 3; vector-effect: non-scaling-stroke; }
.drawing-line { fill: rgba(42,98,168,.08); stroke: #2a62a8; stroke-width: 2; stroke-dasharray: 7 5; vector-effect: non-scaling-stroke; }
.selection-card { border-top: 1px solid var(--line); padding: 10px 16px; display: flex; gap: 12px; font-size: .82rem; }
.proposal { display: grid; gap: 9px; font-size: .83rem; }
.proposal-card { background: #f7f9f6; border: 1px solid var(--line); border-radius: 9px; padding: 10px; }
.proposal-card h3 { margin: 0 0 5px; font-size: .9rem; }
.proposal ul { padding-left: 18px; margin: 5px 0; }
.check-row { display: flex; grid-template-columns: auto 1fr; align-items: center; gap: 8px; }
.check-row input { width: auto; }
.gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.gallery figure { margin: 0; }
.gallery img { width: 100%; border-radius: 9px; border: 1px solid var(--line); }
.gallery figcaption { font-size: .7rem; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #1e3025; color: white; padding: 11px 16px; border-radius: 10px; box-shadow: 0 12px 30px rgba(0,0,0,.25); z-index: 10; }
@media (max-width: 1100px) {
  .workspace { grid-template-columns: 220px minmax(420px,1fr); }
  .right-panel { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; }
  .right-panel section { border-bottom: 0; border-right: 1px solid var(--line); padding-right: 18px; }
}
@media (max-width: 760px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .workspace { display: block; }
  .left-panel, .right-panel { overflow: visible; }
  .right-panel { display: block; }
  .map-wrap, #garden-map { min-height: 420px; }
}
.guided { border: 1px solid var(--line); border-radius: 10px; padding: 9px; margin: 10px 0 14px; background: #fbfcfa; }
.guided summary { cursor: pointer; font-weight: 700; color: var(--green); }
.guided-catalog { display: grid; gap: 8px; max-height: 330px; overflow: auto; padding-right: 4px; margin-top: 10px; }
.guided-catalog fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.guided-catalog legend { color: var(--ink); font-size: .78rem; font-weight: 700; padding: 0 4px; }
.guided-catalog .check-row { margin: 5px 0; font-size: .76rem; color: var(--ink); }
.variant-picker { display: grid; gap: 7px; margin-bottom: 9px; }
.variant-option { display: block; border: 1px solid var(--line); border-radius: 9px; padding: 9px; background: #fff; }
.variant-option.selected { border-color: var(--green-2); background: #f2f8f3; }

.zone-scope-block { margin: 12px 0; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfa; }
.zone-scope-list { display: grid; gap: 3px; max-height: 130px; overflow: auto; }
.planning-zone-option { margin: 3px 0; color: var(--ink); font-size: .78rem; }

/* v0.1.1-rc.6 planning usability and grounded visualisation */
.swatch.preview { background: #7a4eb2; opacity: .55; }
#garden-map.drawing .feature,
#garden-map.drawing .zone-shape,
#garden-map.drawing .plan-shape,
#garden-map.drawing .preview-shape { pointer-events: none; }
.drawing-controls { display: grid; gap: 8px; }
.drawing-controls .button-row { align-items: stretch; }
.drawing-point { fill: #fff; stroke: #1f5fbf; stroke-width: 3; vector-effect: non-scaling-stroke; pointer-events: none; }
.drawing-point-label { fill: #153b72; font-size: 18px; font-weight: 800; paint-order: stroke; stroke: #fff; stroke-width: 4px; pointer-events: none; }
.preview-shape { fill: rgba(122,78,178,.16); stroke: #7041a8; stroke-width: 4; stroke-dasharray: 9 6; vector-effect: non-scaling-stroke; }
.zone-profile-label { margin: 8px 0 0; }
.zone-profile-select { padding: 7px 8px; font-size: .75rem; }
.zone-rule { margin: 7px 0 0; padding: 7px; border-left: 3px solid var(--blue); background: #f0f5fb; color: #3b4e61; font-size: .72rem; line-height: 1.35; }
.terrain-action { border-color: #d8b56f; background: #fffaf0; }
.terrain-approval { padding: 9px; border: 1px solid #d8b56f; border-radius: 9px; background: #fff8e8; color: #684a14; }
.warning-meta { color: #8a5a19; }
.server-check { border-color: #9fb8d4; background: #f2f7fc; }
.source-preview { width: 100%; max-height: 210px; object-fit: cover; border-radius: 9px; border: 1px solid var(--line); margin-top: 4px; }

.photo-layout-panel { margin-top: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfa; }
.photo-layout-header > div { display: grid; gap: 2px; }
.photo-layout-header .muted { font-size: .72rem; }
.photo-layout-stage { position: relative; margin: 8px auto 0; width: 100%; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #eef2ef; }
.photo-layout-stage img { display: block; width: 100%; height: auto; max-height: 520px; object-fit: contain; }
.photo-layout-stage svg { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.photo-layout-panel.expanded { position: fixed; inset: 14px; z-index: 10020; margin: 0; padding: 16px; overflow: auto; border-radius: 16px; background: rgba(251,252,250,.99); box-shadow: 0 0 0 100vmax rgba(13,22,16,.62), 0 24px 80px rgba(0,0,0,.38); }
.photo-layout-panel.expanded .photo-layout-header { position: sticky; top: -16px; z-index: 3; margin: -16px -16px 10px; padding: 14px 16px 12px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.97); }
.photo-layout-panel.expanded .photo-layout-stage { width: min(100%, 1500px); }
.photo-layout-panel.expanded .photo-layout-stage img { max-height: none; }
.photo-layout-panel.expanded #photo-layout-status { position: sticky; bottom: -16px; z-index: 2; margin: 10px -16px -16px; padding: 10px 16px 14px; border-top: 1px solid var(--line); background: rgba(255,255,255,.96); }
body.photo-layout-expanded { overflow: hidden; }
.photo-overlay-shape { cursor: move; vector-effect: non-scaling-stroke; }
.photo-overlay-item.selected .photo-overlay-shape { filter: drop-shadow(0 0 4px rgba(0,0,0,.18)); }
.photo-overlay-label-text { font-size: 12px; fill: #1f3124; font-weight: 700; pointer-events: none; }
.photo-overlay-handle { fill: #fff; stroke: #1f3124; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.photo-overlay-handle.scale { cursor: nwse-resize; }
.photo-overlay-handle.rotate { cursor: grab; }
.photo-overlay-stem { stroke: #304235; stroke-width: 2; vector-effect: non-scaling-stroke; }
.compact-title h3 { margin: 0; font-size: 1rem; }
.compact-title { margin-bottom: 4px; }
.gallery { grid-template-columns: 1fr; }
.gallery img { max-height: 360px; object-fit: cover; }
button:disabled { cursor: not-allowed; opacity: .5; }


/* v0.1.1-rc.7 grounded 2D planning */
.small-badge { padding: 4px 7px; font-size: .68rem; }
.subheading { margin: 14px 0 8px; font-size: .84rem; }
.element-catalog { display: grid; gap: 10px; margin: 12px 0; }
.catalog-group { display: grid; gap: 6px; }
.catalog-group > strong { font-size: .75rem; color: var(--muted); }
.catalog-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.catalog-item { display: grid; gap: 2px; text-align: left; border: 1px solid var(--line); border-radius: 9px; padding: 8px; background: #fff; color: var(--ink); }
.catalog-item:hover, .catalog-item.selected { border-color: var(--green-2); background: #f2f8f3; box-shadow: inset 3px 0 var(--green-2); }
.catalog-item small { color: var(--muted); font-size: .68rem; }
.placement-controls { border: 1px solid #9fb8d4; border-radius: 10px; padding: 10px; background: #f2f7fc; margin: 10px 0; }
.dimension-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 7px; }
.dimension-grid label { margin: 7px 0; }
.placement-instruction { margin: 5px 0 10px; font-size: .76rem; color: #304f73; font-weight: 650; }
#garden-map.placing { cursor: copy; }
.plan-shape.locked-plan-shape { fill: rgba(235,165,46,.38); stroke-width: 4; }
.plan-shape.legacy-plan-shape { fill: rgba(180,70,50,.12); stroke: #9b3c2f; stroke-dasharray: 7 5; }
.planned-item.locked-item { border-color: #d2a454; background: #fffaf0; }
.item-warning, .site-warning { margin: 7px 0 0; color: #7a4d13; font-size: .72rem; line-height: 1.35; }
.item-error { margin: 7px 0 0; color: #9f1f1b; font-size: .72rem; line-height: 1.35; }
.danger-text { color: var(--red) !important; }
.unplaced-action { border-color: #d6aaaa; background: #fff8f7; }
.image-history { margin-top: 10px; border: 1px solid var(--line); border-radius: 9px; padding: 8px; }
.image-history summary { cursor: pointer; font-weight: 700; color: var(--green); }
.image-history[open] .gallery { max-height: 430px; overflow: auto; padding-right: 4px; }
.map-panel { position: relative; }
.right-panel, .left-panel { overscroll-behavior: contain; }

@media (max-width: 760px) {
  html, body { height: auto; }
  body { overflow: auto; }
  .app { height: auto; min-height: 100vh; overflow: visible; }
  .workspace { height: auto; overflow: visible; }
  .dimension-grid { grid-template-columns: 1fr; }
}

/* v0.1.1-rc.8 icon palette and direct manipulation */
.catalog-toolbar { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; margin-top: 12px; }
.catalog-toolbar input, .planned-filter { margin: 0; padding: 8px 9px; font-size: .78rem; }
.element-catalog { max-height: 470px; overflow: auto; padding-right: 4px; }
.catalog-group { border: 1px solid var(--line); border-radius: 9px; background: #fbfcfa; overflow: hidden; }
.catalog-group > summary { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 9px; cursor: pointer; list-style: none; color: var(--ink); font-size: .76rem; }
.catalog-group > summary::-webkit-details-marker { display: none; }
.catalog-group > summary::before { content: '▸'; color: var(--muted); }
.catalog-group[open] > summary::before { content: '▾'; }
.catalog-group > summary span { margin-left: auto; color: var(--muted); font-size: .68rem; }
.catalog-group .catalog-grid { padding: 0 7px 7px; }
.catalog-item { grid-template-columns: 32px 1fr; grid-template-rows: auto auto; align-items: center; column-gap: 8px; min-height: 58px; }
.catalog-item .catalog-icon { grid-row: 1 / 3; width: 28px; height: 28px; object-fit: contain; pointer-events: none; }
.catalog-item span { font-weight: 700; font-size: .75rem; line-height: 1.2; }
.catalog-item small { line-height: 1.2; }
.placement-heading { display: flex; align-items: center; gap: 9px; }
.placement-icon { width: 30px; height: 30px; object-fit: contain; }
.dimension-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
.inventory-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-top: 12px; }
.inventory-heading .subheading { margin-bottom: 5px; }
.planned-group-summary { display: flex; flex-wrap: wrap; gap: 5px; margin: 7px 0; }
.inventory-chip { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px 7px; background: #f7f9f6; color: var(--muted); font-size: .64rem; }
.planned-item-main { display: grid; grid-template-columns: 30px 1fr; gap: 8px; align-items: center; }
.planned-icon { width: 28px; height: 28px; object-fit: contain; }
.planned-item.active { border-color: var(--green-2); background: #f3f8f4; box-shadow: inset 3px 0 var(--green-2); }
.planned-item.conflict-item { border-color: #d46762; background: #fff3f2; box-shadow: inset 3px 0 #c62828; }
.planned-item.conflict-item.active { border-color: #a91f1a; background: #ffe9e7; box-shadow: inset 4px 0 #a91f1a; }
.plan-item-group { cursor: grab; }
.plan-item-group.editing { cursor: grabbing; }
.plan-item-group .plan-shape { fill: rgba(235,165,46,.10); stroke: rgba(180,109,0,.65); stroke-width: 2; }
.plan-item-group:hover .plan-shape, .plan-item-group.selected .plan-shape { fill: rgba(235,165,46,.18); stroke: #a45f00; stroke-width: 3; }
.plan-item-group.conflict .plan-shape, .plan-item-group.conflict:hover .plan-shape, .plan-item-group.conflict.selected .plan-shape { fill: rgba(210,45,38,.20); stroke: #c62828; stroke-width: 4; stroke-dasharray: 8 4; }
.plan-item-group.conflict .plan-map-icon { filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 3px #c62828); }
.plan-map-icon { cursor: grab; filter: drop-shadow(0 1px 1px rgba(255,255,255,.9)); }
.plan-item-group.editing .plan-map-icon { cursor: grabbing; }
.plan-item-group .locked-plan-shape { fill: rgba(235,165,46,.22); stroke-width: 3; cursor: default; }
.plan-resize-handle { fill: #fff; stroke: #1d6b3a; stroke-width: 3; vector-effect: non-scaling-stroke; cursor: nwse-resize; }
#garden-map.direct-editing { cursor: grabbing; touch-action: none; }
#garden-map .plan-item-group, #garden-map .plan-resize-handle { touch-action: none; }
@media (max-width: 760px) {
  .element-catalog { max-height: none; }
  .catalog-grid { grid-template-columns: 1fr 1fr; }
}
.placement-controls .full + .full { margin-top: 7px; }
.size-guide { margin: 7px 0 0; padding: 7px 9px; border-radius: 7px; background: #eef4ea; color: #36533a; font-size: .72rem; line-height: 1.35; }
.size-guide.warning { background: #fff4df; color: #7a4d13; border-left: 3px solid #c47b16; }
#garden-map .baseline-parcel { pointer-events: visiblePainted; }
.plan-rotate-stem { stroke: #2d5f8c; stroke-width: 2; vector-effect: non-scaling-stroke; pointer-events: none; }
.plan-rotate-handle { fill: #fff; stroke: #2d5f8c; stroke-width: 3; vector-effect: non-scaling-stroke; cursor: grab; }
.plan-rotate-handle:active { cursor: grabbing; }
.plan-delete-handle { cursor: pointer; }
.plan-delete-handle circle { fill: #fff; stroke: #a52b2b; stroke-width: 3; vector-effect: non-scaling-stroke; }
.plan-delete-handle line { stroke: #a52b2b; stroke-width: 2.5; stroke-linecap: round; vector-effect: non-scaling-stroke; pointer-events: none; }
#garden-map .plan-rotate-handle, #garden-map .plan-delete-handle { touch-action: none; }

/* RC10: explicit scenario deletion and reliable image-scope selection. */
.danger-link { color: #8a2525; border-color: #d8a8a8; background: #fff8f8; }
.danger-link:hover { background: #fbeaea; }
.image-zone-fieldset { margin: 10px 0 12px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
.image-zone-fieldset legend { padding: 0 6px; font-weight: 700; color: var(--green); }
.image-zone-options { display: grid; gap: 7px; }
.image-zone-option { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 9px; padding: 9px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; background: #fff; }
.image-zone-option:hover { border-color: #94aa9b; background: #f7faf7; }
.image-zone-option.selected { border-color: var(--green); box-shadow: 0 0 0 1px var(--green) inset; background: #f1f7f2; }
.image-zone-option input { margin: 0; }
.image-zone-option span { display: grid; gap: 2px; }
.image-zone-option small { color: var(--muted); font-size: .72rem; }

/* rc.12 terrain, canopy and colour controls */
.terrain-tools { margin: 10px 0 14px; border: 1px solid #d5c49b; border-radius: 10px; padding: 8px 10px; background: #fffaf0; }
.terrain-tools > summary { cursor: pointer; font-weight: 750; color: #684a14; }
.terrain-template-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin: 8px 0; }
.terrain-template-grid button { min-height: 42px; }
.terrain-placement-approval { margin: 8px 0; padding: 8px; border-radius: 8px; background: #fff8e8; border: 1px solid #d8b56f; color: #684a14; }
.color-preview { display: flex; align-items: center; gap: 8px; margin: 7px 0; font-size: .72rem; color: var(--muted); }
.color-dot { display: inline-block; width: 12px; height: 12px; min-width: 12px; border-radius: 999px; border: 1px solid rgba(0,0,0,.24); vertical-align: -2px; }
.item-color-label { display: inline-flex; align-items: center; gap: 5px; }
.item-style-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding-top: 7px; border-top: 1px solid var(--line); }
.item-style-row label { display: flex; align-items: center; gap: 6px; margin: 0; font-size: .7rem; }
.item-color-picker { width: 34px; height: 26px; padding: 1px; border-radius: 6px; cursor: pointer; }
.item-color-name { color: var(--muted); font-size: .68rem; }
.terrain-approve-button { color: #684a14 !important; font-weight: 700; }
.plan-item-group .terrain-plan-shape { stroke-dasharray: 4 3; }
.plan-item-group .overhead-plan-shape { stroke-dasharray: 10 4; }
@media (max-width: 720px) { .terrain-template-grid { grid-template-columns: 1fr; } }

/* RC13: direct shape switching and transparent image-cost guidance. */
.item-shape-switch { display:flex; align-items:center; gap:6px; flex-wrap:wrap; margin:8px 0 4px; font-size:.72rem; color:var(--muted); }
.shape-switch-button { padding:4px 8px; border:1px solid var(--line); border-radius:999px; background:#fff; color:var(--ink); font-size:.7rem; }
.shape-switch-button.active, .shape-switch-button:disabled { border-color:var(--green); background:#eaf4ec; color:var(--green); opacity:1; }
.image-cost-estimate { margin:10px 0 7px; padding:8px 10px; border-left:3px solid #6e8b73; background:#f3f7f3; line-height:1.4; }
.image-cost-buttons { align-items:stretch; }
.image-cost-buttons .image-button { min-height:48px; line-height:1.25; }

/* rc.14 strict image scope and visible generation progress */
.image-item-fieldset { margin: 10px 0 12px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfa; }
.image-item-fieldset legend { padding: 0 6px; font-weight: 700; color: var(--green); }
.compact-row { margin: 0 0 8px; }
.compact-row button { padding: 6px 9px; font-size: .72rem; }
.image-item-options { display: grid; gap: 6px; max-height: 260px; overflow: auto; padding-right: 3px; }
.image-item-option { display: grid; grid-template-columns: auto 30px 1fr; gap: 8px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
.image-item-option:hover { border-color: #94aa9b; background: #f7faf7; }
.image-item-option.selected { border-color: var(--green); background: #eff7f1; box-shadow: inset 3px 0 var(--green); }
.image-item-option input { margin: 0; }
.image-item-option img { width: 26px; height: 26px; object-fit: contain; }
.image-item-option span { display: grid; gap: 2px; }
.image-item-option small { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: .69rem; flex-wrap: wrap; }
.image-item-summary { margin: 8px 0 4px; color: #7a4d13; }
.image-item-summary.selection-ready { color: #245d37; font-weight: 700; }
.strict-preserve { margin: 8px 0 3px; padding: 7px 8px; border-radius: 8px; background: #edf5ef; color: #245d37; font-weight: 700; }
.image-generation-overlay { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; background: rgba(15,25,19,.52); backdrop-filter: blur(2px); }
.image-generation-card { width: min(440px, calc(100vw - 34px)); display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: start; padding: 18px; border-radius: 14px; background: #fff; box-shadow: 0 18px 60px rgba(0,0,0,.28); }
.image-generation-card strong { display: block; color: var(--green); font-size: 1rem; }
.image-generation-card p { margin: 5px 0; color: var(--ink); }
.image-generation-card small { display: block; margin-top: 4px; color: var(--muted); }
.image-spinner { width: 38px; height: 38px; border: 4px solid #dce7df; border-top-color: var(--green); border-radius: 50%; animation: gp3-spin .9s linear infinite; }
@keyframes gp3-spin { to { transform: rotate(360deg); } }

@media (max-width: 760px) {
  .photo-layout-panel.expanded { inset: 4px; padding: 10px; border-radius: 10px; }
  .photo-layout-panel.expanded .photo-layout-header { top: -10px; margin: -10px -10px 8px; padding: 10px; }
  .photo-layout-panel.expanded #photo-layout-status { bottom: -10px; margin: 8px -10px -10px; padding: 8px 10px 10px; }
}

/* RC19: cached transparent element assets as movable photo layers. */
.photo-layer-controls { margin: 10px 0; padding: 10px; border: 1px solid #c8d9cb; border-radius: 10px; background: #f6faf6; }
.photo-layer-controls h4 { margin: 0; font-size: .92rem; color: var(--green); }
.photo-layer-settings { display: grid; grid-template-columns: minmax(180px, 2fr) minmax(120px, 1fr) minmax(90px, .7fr); gap: 8px; align-items: end; }
.photo-layer-settings label { margin: 0; font-size: .7rem; }
.photo-layer-list { display: grid; gap: 6px; margin-top: 8px; }
.photo-layer-row { display: grid; grid-template-columns: 32px minmax(0,1fr) auto; gap: 8px; align-items: center; padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.photo-layer-row img { width: 30px; height: 30px; object-fit: contain; background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 50% / 8px 8px; border-radius: 5px; }
.photo-layer-row strong { display: block; font-size: .72rem; }
.photo-layer-row small { color: var(--muted); font-size: .64rem; }
.photo-layer-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.photo-layer-actions button { padding: 4px 6px; font-size: .64rem; }
.photo-layer-stage { position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
.photo-layer-stage img { position: absolute; object-fit: contain; transform-origin: center center; pointer-events: none; user-select: none; -webkit-user-drag: none; filter: drop-shadow(0 4px 5px rgba(0,0,0,.22)); }
.photo-layout-stage > img { position: relative; z-index: 1; }
.photo-layout-stage > svg { z-index: 3; }
.photo-layer-saving { color: #7a4d13; }
.photo-layer-saved { color: #245d37; }
.photo-layer-error { color: #8a2525; }
@media (max-width: 760px) {
  .photo-layer-settings { grid-template-columns: 1fr; }
  .photo-layer-row { grid-template-columns: 28px 1fr; }
  .photo-layer-actions { grid-column: 1 / -1; justify-content: flex-start; }
}
