/* Clothing Platform admin.  Desktop first (DESIGN.md D10).  Dark, with Mossy green as the one accent. */
:root {
  --bg: #111311; --panel: #1A1D19; --panel2: #22261F; --line: #33392F; --text: #ECEFE6; --muted: #9AA392;
  --moss: #7FA650; --moss-deep: #5C7C38; --warn: #E0A040; --bad: #E06A50; --good: #7FA650;
  --r: 6px; font-size: 16px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif; }
a { color: var(--moss); text-decoration: none; } a:hover { text-decoration: underline; }
h1 { font-size: 28px; margin: 0; letter-spacing: -0.01em; } h2 { font-size: 20px; margin: 32px 0 12px; } h3 { font-size: 16px; margin: 0 0 8px; }
code { font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
.muted { color: var(--muted); } .small { font-size: 14px; } .nowrap { white-space: nowrap; }

.top { display: flex; align-items: center; gap: 28px; padding: 12px 28px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.brand { color: var(--text); font-weight: 700; display: flex; align-items: center; gap: 10px; }
.mark { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--moss); color: #0D0F0C; font-weight: 800; font-size: 13px; letter-spacing: .04em; }
.mark.big { width: 72px; height: 72px; font-size: 24px; margin-bottom: 16px; }
.top nav { display: flex; gap: 4px; flex: 1; }
.top nav a, .top nav .soon { padding: 6px 12px; border-radius: var(--r); color: var(--text); }
.top nav a.here { background: var(--panel2); color: var(--moss); }
.top nav .soon { color: #5E655A; cursor: default; }
.who { display: flex; gap: 10px; align-items: center; color: var(--muted); }
.who form { margin: 0; }
main { max-width: 1400px; margin: 0 auto; padding: 28px; }

.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.head.small { margin: 32px 0 8px; align-items: baseline; } .head.small h2 { margin: 0; }
.head-actions { display: flex; gap: 12px; align-items: center; }
.mg { font-family: ui-monospace, Menlo, monospace; font-weight: 700; letter-spacing: .02em; }
.mg.big { color: var(--moss); font-size: 15px; }

button, .button { font: inherit; display: inline-block; padding: 8px 16px; border-radius: var(--r); border: 1px solid var(--line); background: var(--panel2); color: var(--text); cursor: pointer; text-decoration: none; }
button:hover, .button:hover { border-color: var(--moss); text-decoration: none; }
.primary { background: var(--moss); border-color: var(--moss); color: #0D0F0C; font-weight: 600; }
.primary:hover { background: #8FB660; }
.button.small { padding: 4px 10px; font-size: 14px; }
button.link { background: none; border: 0; color: var(--moss); padding: 0; }

input, select, textarea { font: inherit; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: var(--r); padding: 8px 10px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--moss); outline-offset: 0; border-color: var(--moss); }
input[type=date] { color-scheme: dark; }
label { display: block; font-size: 14px; color: var(--muted); }
label input, label select, label textarea { margin-top: 4px; color: var(--text); }
.err { display: block; color: var(--bad); font-size: 14px; margin-top: 4px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 20px; }
.form { max-width: 880px; display: grid; gap: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.actions { display: flex; gap: 16px; align-items: center; }
.banner { padding: 10px 14px; border-radius: var(--r); margin: 0 0 16px; }
.banner.warn { background: #3A2E17; color: #F4D9A0; border: 1px solid #6B5320; }
.banner.good { background: #1F2B17; color: #CFE6B0; border: 1px solid var(--moss-deep); }
body > .banner { margin: 0; border-radius: 0; text-align: center; }

.filters { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; }
.filters input[type=search] { max-width: 320px; } .filters select { max-width: 200px; }
.filters .count { margin-left: auto; color: var(--muted); }

.list { width: 100%; border-collapse: collapse; }
.list th { text-align: left; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.list td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.list tbody tr:hover { background: var(--panel); }
.thumb { width: 64px; height: 48px; object-fit: cover; border-radius: 4px; display: block; background: var(--panel2); }
.thumb.empty { display: grid; place-items: center; font-size: 10px; color: var(--muted); }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; background: var(--panel2); border: 1px solid var(--line); }
.s-for_sale { border-color: var(--moss); color: var(--moss); } .s-sold { color: var(--muted); } .s-breeder { border-color: #8C7BB8; color: #B7A8E0; } .s-holdback { border-color: var(--warn); color: var(--warn); }
.empty-note { padding: 40px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 10px; }

.details dl { display: grid; grid-template-columns: 140px 1fr; gap: 8px 16px; margin: 0; }
.details dt { color: var(--muted); } .details dd { margin: 0; }
.notes { white-space: pre-wrap; margin: 16px 0 0; border-top: 1px solid var(--line); padding-top: 12px; }

.stages { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 12px 0 20px; }
.stage { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px; min-height: 120px; }
.stage h3 { color: var(--moss); text-transform: uppercase; letter-spacing: .08em; font-size: 13px; }
.set { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
.set-head { display: flex; justify-content: space-between; }
.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 8px 0; }
.thumbs img { width: 100%; height: 72px; object-fit: cover; border-radius: 4px; display: block; }
.thumbs a.retired img { opacity: .35; }
.drop { border: 1px dashed var(--line); border-radius: var(--r); padding: 10px; }
.drop.over { border-color: var(--moss); background: #1F2B17; }
.progress { margin-top: 8px; } .progress .bar { height: 6px; width: 0; background: var(--moss); border-radius: 3px; transition: width .2s; }
.ptext { font-size: 13px; color: var(--muted); }
.inline-form { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.inline-form h3 { width: 100%; } .inline-form label { width: 180px; } .inline-form label.grow { flex: 1; width: auto; }

.photo-layout { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 20px; align-items: start; }
.preview { margin: 0; padding: 12px; } .preview img { width: 100%; height: auto; display: block; border-radius: 4px; }
.sha { word-break: break-all; color: var(--muted); }
.retire { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 16px; display: grid; gap: 8px; }
.history td:first-child { width: 200px; }

body.door { display: grid; place-items: center; min-height: 100vh; text-align: center; }
body.door main { max-width: 460px; }
body.door h1 { margin-bottom: 8px; } body.door p { color: var(--muted); margin-bottom: 28px; }
body.door .button { padding: 12px 24px; font-size: 18px; }

/* Garment templates (M2).  Bleed is red (it is trimmed off), the print area is moss, the safe zone amber. */
.retired-row td { opacity: .55; }
.notes-card { white-space: pre-wrap; margin: 0 0 16px; }
.panels { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.panel-card { color: var(--text); display: block; }
.panel-card:hover { border-color: var(--moss); text-decoration: none; }
.panel-figure { background: var(--bg); border-radius: 6px; padding: 8px; margin-bottom: 12px; }
.panel-svg { width: 100%; height: auto; display: block; max-height: 360px; }
.panel-svg.plain { max-height: 260px; }
.panel-svg rect { fill: none; vector-effect: non-scaling-stroke; }
.panel-svg rect.bleed { stroke: var(--bad); stroke-width: 1.5; stroke-dasharray: 6 4; }
.panel-svg rect.print { stroke: var(--moss); stroke-width: 2.5; fill: rgba(127, 166, 80, .12); }
.panel-svg rect.safe { stroke: var(--warn); stroke-width: 1.5; stroke-dasharray: 3 3; }
.panel-svg rect.handle { fill: var(--moss); stroke: #0D0F0C; stroke-width: 1.5; cursor: nwse-resize; }
.panel-svg[data-editor] { max-height: 70vh; touch-action: none; outline: none; border-radius: 4px; }
.panel-svg[data-editor]:focus-visible { box-shadow: 0 0 0 2px var(--moss); }
.panel-svg[data-editor] rect.print, .panel-svg[data-editor] rect.safe { cursor: move; }
.panel-svg.off-mockup rect.print { stroke: var(--bad); }
.nums { display: grid; grid-template-columns: 110px 1fr; gap: 4px 12px; margin: 0; font-size: 14px; }
.nums dt { color: var(--muted); } .nums dd { margin: 0; }
.legend { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--muted); margin: 10px 0; }
.legend .key { display: inline-block; width: 22px; height: 12px; border-radius: 2px; margin-left: 10px; }
.legend .key:first-child { margin-left: 0; }
.key.bleed { border: 2px dashed var(--bad); } .key.print { border: 2px solid var(--moss); background: rgba(127, 166, 80, .2); } .key.safe { border: 2px dashed var(--warn); }
.inline-form label.narrow { width: 110px; }
.inline-form .full { width: 100%; margin: 0; }
.panels + .legend, .panels + .empty-note { margin-bottom: 20px; }
.two-forms { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.panel-layout { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 20px; align-items: start; }
.editor .drop { margin-top: 12px; }
.panel-form h3 { margin: 0; }
.retire-panel { margin: 20px 0 0; }
.button.small + .button.small { margin-left: 0; }

/* Design Studio (M3).  The canvas takes the page's whole width; the side panel holds the numbers. */
main:has(.studio) { max-width: none; }
.studio-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 12px; }
.status { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 14px; border: 1px solid var(--line); color: var(--muted); }
.status.good { border-color: var(--moss-deep); color: #CFE6B0; } .status.pending { border-color: var(--warn); color: #F4D9A0; } .status.bad { border-color: var(--bad); color: #F4B8A8; }
.studio-bar { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; padding: 8px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px 10px 0 0; border-bottom: 0; }
.studio-bar .group { display: flex; gap: 4px; align-items: center; }
.studio-bar button { padding: 4px 10px; font-size: 14px; }
.studio-bar button:disabled { opacity: .4; cursor: default; }
.tabs { display: flex; gap: 2px; }
.tabs button[aria-selected=true] { background: var(--moss); border-color: var(--moss); color: #0D0F0C; font-weight: 600; }
.zoom { min-width: 64px; text-align: center; font-size: 14px; font-variant-numeric: tabular-nums; }
.overlays { gap: 12px; }
.toggle { display: flex; align-items: center; gap: 5px; font-size: 14px; color: var(--text); cursor: pointer; }
.toggle input, label.check input { width: auto; margin: 0; accent-color: var(--moss); }
.studio-main { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.stage { position: relative; height: calc(100vh - 230px); min-height: 520px; background: #0B0C0B; border: 1px solid var(--line); border-radius: 0 0 0 10px; overflow: hidden; }
.stage svg { width: 100%; height: 100%; display: block; touch-action: none; outline: none; cursor: grab; user-select: none; }
.stage.panning svg { cursor: grabbing; }
.stage svg:focus-visible { box-shadow: inset 0 0 0 2px var(--moss); }
.stage .photo, .stage .detail { cursor: move; }
.stage text { cursor: move; user-select: none; }
.stage .dim { fill: rgba(11, 12, 11, .62); pointer-events: none; }
.stage .bleed, .stage .print, .stage .safe { fill: none; pointer-events: none; vector-effect: non-scaling-stroke; }
.stage .bleed { stroke: var(--bad); stroke-width: 1.5; stroke-dasharray: 6 4; }
.stage .print { stroke: var(--moss); stroke-width: 2; }
.stage .safe { stroke: var(--warn); stroke-width: 1.5; stroke-dasharray: 3 3; }
.stage .guides line { stroke: #4FC3F7; stroke-width: 1; vector-effect: non-scaling-stroke; pointer-events: none; }
.stage .sel .outline { fill: none; stroke: #4FC3F7; stroke-width: 1.5; vector-effect: non-scaling-stroke; pointer-events: none; }
.stage .sel .handle { fill: #fff; stroke: #0B6FA4; stroke-width: 1.5; vector-effect: non-scaling-stroke; cursor: nwse-resize; }
.stage .sel .handle.rot { cursor: grab; }
.stage .mockup { pointer-events: none; }
.stage-note { position: absolute; left: 10px; bottom: 8px; font-size: 13px; color: var(--muted); pointer-events: none; }
.inspector { display: grid; gap: 12px; max-height: calc(100vh - 230px); min-height: 520px; overflow-y: auto; }
.inspector .card { padding: 14px; }
.inspector h3 { margin-bottom: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 10px; }
.grid3 input, .grid3 select { padding: 5px 7px; font-size: 14px; }
label.check { display: flex; align-items: center; gap: 6px; color: var(--text); align-self: end; padding-bottom: 6px; }
.btns { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; align-items: center; }
button.small { padding: 3px 9px; font-size: 13px; }
button:disabled { opacity: .45; cursor: default; }
.quality { margin: 8px 0 0; } .quality.good { color: #CFE6B0; } .quality.warn { color: #F4D9A0; }
input[readonly] { color: var(--muted); }
input[type=color] { padding: 2px; height: 33px; margin-top: 4px; }
.text-list { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 2px; }
.text-list button.on { font-weight: 700; text-decoration: underline; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.checks li { padding: 6px 9px; border-radius: var(--r); border: 1px solid var(--line); }
.checks li.good { border-color: var(--moss-deep); color: #CFE6B0; } .checks li.warn { border-color: #6B5320; background: #3A2E17; color: #F4D9A0; } .checks li.info { color: var(--muted); }
.save-version { display: flex; gap: 6px; } .save-version input { padding: 5px 8px; font-size: 14px; }
.versions { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; max-height: 260px; overflow-y: auto; font-size: 14px; }
.versions li { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 4px 0; border-bottom: 1px solid var(--line); }
.versions li.named div > span:first-child { font-weight: 700; color: var(--moss); }
.keys { margin-top: 16px; } .keys summary { cursor: pointer; font-weight: 600; }
.keys dl { display: grid; grid-template-columns: 140px 1fr; gap: 4px 16px; margin: 12px 0 0; font-size: 14px; } .keys dt { color: var(--muted); } .keys dd { margin: 0; }
.studio + script + .two-forms { margin-top: 16px; }
.new-design { margin-bottom: 20px; align-items: flex-end; }
.new-design .thumb { width: 72px; height: 54px; }

/* Crop Picker and Contact Sheet (M4). */
main:has(.crops-page) { max-width: none; }
.studio-status { display: flex; gap: 10px; align-items: center; }
.studio-status .button { padding: 4px 12px; font-size: 14px; }
.crop-stage { height: calc(100vh - 300px); }
.crop-stage .crop { fill: rgba(255, 255, 255, .04); stroke: rgba(236, 239, 230, .8); stroke-width: 1.5; vector-effect: non-scaling-stroke; cursor: move; }
.crop-stage .crop.picked { stroke: var(--moss); stroke-width: 2.5; fill: rgba(127, 166, 80, .10); }
.crop-stage .crop.on { stroke: #4FC3F7; stroke-width: 2.5; fill: rgba(79, 195, 247, .10); }
.crop-stage .crop-top { fill: rgba(236, 239, 230, .8); pointer-events: none; }
.crop-stage .crop-num { fill: #fff; font: 700 15px/1 -apple-system, BlinkMacSystemFont, sans-serif; paint-order: stroke; stroke: #000; stroke-width: 3px; pointer-events: none; text-anchor: middle; dominant-baseline: central; }
.crop-stage .crop-num.picked { fill: #CFE6B0; }
.crop-stage .other { opacity: .35; }
.count { font-size: 14px; color: var(--muted); } .count.good { color: #CFE6B0; }
.big-check { font-size: 15px; margin: 10px 0; padding: 0; }
.removed-list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 4px; font-size: 14px; }
.removed-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sheet-section { margin-top: 24px; }
.sheet-tools { display: flex; gap: 18px; align-items: center; }
.sheet-tools input[type=range] { width: 140px; padding: 0; accent-color: var(--moss); }
.sheet { --card: 220px; display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--card), 1fr)); gap: 14px; margin-top: 12px; }
.sheet .empty-note { grid-column: 1 / -1; }
.crop-card { background: var(--panel); border: 2px solid var(--line); border-radius: 10px; padding: 8px; cursor: pointer; display: grid; gap: 6px; }
.crop-card:hover { border-color: var(--muted); }
.crop-card.picked { border-color: var(--moss); }
.crop-card.on { border-color: #4FC3F7; }
.crop-card .pic { position: relative; border-radius: 4px; overflow: hidden;
  background: repeating-conic-gradient(#2A2E27 0% 25%, #1D201B 0% 50%) 0 0 / 16px 16px; }
.crop-card .pic img { display: block; width: 100%; height: 100%; }
.crop-card .pic .print-line { position: absolute; border: 1.5px dashed rgba(255, 255, 255, .75); pointer-events: none; }
.sheet.no-print .print-line { display: none; }
.crop-card .cap { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 14px; }
.crop-card .cap strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crop-card .meta { font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; gap: 6px; }
.crop-card .meta .warn { color: #F4D9A0; }
.crop-card label.check { padding: 0; font-size: 13px; }

/* Narrow screens (an iPad held upright, a phone): the studio and crop pages put the side panel under the canvas. */
@media (max-width: 900px) {
  .studio-main { grid-template-columns: minmax(0, 1fr); }
  .stage, .crop-stage { height: 60vh; min-height: 320px; border-radius: 0 0 10px 10px; }
  .inspector { max-height: none; min-height: 0; overflow: visible; }
}

/* ---- Editions (M5) ---- */
form.inline { display: inline-flex; gap: 6px; align-items: flex-end; margin: 0; }
form.inline label { display: inline-flex; gap: 6px; align-items: center; }
form.inline input[name=name] { width: 240px; }
.edition-tools { display: flex; flex-wrap: wrap; gap: 18px 28px; align-items: center; margin: 0 0 16px; }
.piece-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin: 12px 0 28px; }
.piece-grid.small { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.piece-card { background: var(--panel); border: 2px solid var(--line); border-radius: 10px; padding: 8px; display: grid; gap: 6px; align-content: start; position: relative; }
.piece-card.problem { border-color: var(--bad); }
.piece-card.vault { border-color: #C9A227; }
.piece-card .pic { border-radius: 4px; overflow: hidden; background-color: #222; background-image: linear-gradient(45deg, #2B2B2B 25%, transparent 25%, transparent 75%, #2B2B2B 75%), linear-gradient(45deg, #2B2B2B 25%, transparent 25%, transparent 75%, #2B2B2B 75%); background-size: 16px 16px; background-position: 0 0, 8px 8px; }
.piece-card .pic img { display: block; width: 100%; height: auto; }
.piece-card .cap { display: grid; gap: 2px; font-size: 14px; }
.piece-card .btns { margin: 0; }
.piece-card .btns form { display: inline; }
.piece-num { font-size: 26px; font-weight: 700; line-height: 1; } .piece-num span { font-size: 15px; color: var(--muted); font-weight: 400; }
.piece-label { font-size: 18px; font-weight: 700; letter-spacing: .02em; }
.pill.good { background: #1F2B17; color: #CFE6B0; border-color: var(--moss-deep); }
.pill.big { font-size: 15px; padding: 4px 14px; }
.vault-pill { background: #3A3112; color: #F1D77A; border-color: #8A7121; }
.vault-note { margin: 0; }
.vault-form { display: flex; gap: 6px; flex-wrap: wrap; }
.vault-form input { flex: 1; min-width: 120px; padding: 5px 7px; font-size: 14px; }
.number-box { margin: 8px 0 16px; }
.number-box .checks { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 4px; }
.number-box .checks .ok { color: #CFE6B0; } .number-box .checks .no { color: #F4D9A0; }
.set-aside { margin-bottom: 28px; }
h2 .count { font-weight: 400; margin-left: 8px; }
.crop-card .pic .piece-tag { position: absolute; left: 6px; top: 6px; background: rgba(20, 26, 16, .88); color: #CFE6B0; font-size: 13px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.crop-card.is-piece { cursor: default; }

/* Narrow screens (found by /verify, M5): form fields stack, and wide tables scroll sideways instead of running off the page. */
/* Export (M6) */
.export-settings { margin: 0 0 24px; }
.grid-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 18px; align-items: start; }
.grid-form .wide { grid-column: 1 / -1; }
.table-wrap { overflow-x: auto; }
.warn-text { color: var(--warn); }
.file-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 28px; }
ul.files { list-style: none; padding: 0; margin: 6px 0 12px; display: grid; gap: 4px; }
ul.files a { word-break: break-all; }
[data-done] { margin: 0 0 24px; }
button[disabled] { opacity: .5; cursor: not-allowed; }

@media (max-width: 600px) {
  .inline-form label, .inline-form label.grow, .inline-form label.narrow { width: 100%; flex: none; }
  table.list { display: block; overflow-x: auto; }
  form.inline input[name=name] { width: 100%; }
  .edition-tools { gap: 12px; }
  .grid-form, .file-cols { grid-template-columns: 1fr; }
}
