/* Move-In Kit picker: the app around the pages. A plain technical workbench (hairlines, mono step
   numbers) so the documents stay the loudest thing on screen. Pages keep their own layout CSS. */
:root {
  --ui-bg: #E6E6E1; --ui-panel: #FAFAF7; --ui-ink: #151515; --ui-soft: #64645D; --ui-line: #D3D3CB;
  --ui-sel: #151515; --ui-warn: #7A4F00; --ui-warn-bg: #FAEFD6; --ui-err: #9E2A1F; --ui-err-bg: #FAE3DF;
  --f-ui: "Geist", Arial, sans-serif; --f-mono: "Geist Mono", ui-monospace, monospace;
  --panel-w: 400px; --z: 1;
}
html, body { height: 100% }
body.app-body { background: var(--ui-bg); color: var(--ui-ink); font-family: var(--f-ui); font-size: 14px; line-height: 1.45 }
.app { height: 100%; display: flex; flex-direction: column }
button, input, select { font: inherit; color: inherit }
[hidden] { display: none !important }
:focus-visible { outline: 2px solid var(--ui-ink); outline-offset: 2px }

/* Top bar */
.bar { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 12px 20px; background: var(--ui-panel); border-bottom: 1px solid var(--ui-line) }
.wordmark { display: flex; align-items: baseline; gap: 10px }
.wordmark b { font-weight: 600; font-size: 16px; letter-spacing: -.01em }
.wordmark span, .bar-note { font-family: var(--f-mono); font-size: 11px; color: var(--ui-soft); letter-spacing: .03em; text-transform: uppercase }
.bar-note { margin: 0 }

.workspace { flex: 1; min-height: 0; display: grid; grid-template-columns: var(--panel-w) 1fr }

/* Left panel */
.panel { overflow-y: auto; background: var(--ui-panel); border-right: 1px solid var(--ui-line) }
.step { padding: 18px 20px 22px; border-bottom: 1px solid var(--ui-line); display: flex; flex-direction: column; gap: 12px }
.step h2 { margin: 0; font-size: 15px; font-weight: 600; display: flex; align-items: baseline; gap: 10px }
.step h2 .n { font-family: var(--f-mono); font-size: 11px; font-weight: 500; color: var(--ui-soft) }
.help { margin: 0; color: var(--ui-soft); font-size: 13px }

/* Document list */
.choices { display: flex; flex-direction: column; border: 1px solid var(--ui-line); background: #fff }
.choice { display: grid; grid-template-columns: 64px 1fr auto; gap: 10px; align-items: baseline; padding: 9px 12px; border-top: 1px solid var(--ui-line); cursor: pointer }
.choice:first-child { border-top: 0 }
.choice input { position: absolute; opacity: 0; pointer-events: none }
.choice .code { font-family: var(--f-mono); font-size: 11px; color: var(--ui-soft) }
.choice .name { font-weight: 500 }
.choice .desc { display: block; font-size: 12px; color: var(--ui-soft); font-weight: 400 }
.choice .tag { font-family: var(--f-mono); font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--ui-warn); background: var(--ui-warn-bg); padding: 1px 5px; white-space: nowrap }
.choice:hover { background: #F4F4EF }
.choice:has(input:checked) { background: var(--ui-sel); color: #fff }
.choice:has(input:checked) .code, .choice:has(input:checked) .desc { color: #C9C9C2 }
.choice:has(input:focus-visible) { outline: 2px solid var(--ui-ink); outline-offset: -2px }

/* Layout cards */
.layouts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px }
.lay { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 8px; background: #fff; border: 1px solid var(--ui-line); cursor: pointer; min-width: 0 }
.lay input { position: absolute; opacity: 0; pointer-events: none }
.lay img { width: 100%; aspect-ratio: 210 / 297; object-fit: cover; object-position: top; border: 1px solid var(--ui-line); background: #fff; display: block }
.lay .lay-name { font-weight: 600; display: flex; justify-content: space-between; gap: 6px; align-items: baseline }
.lay .lay-note { font-size: 12px; color: var(--ui-soft) }
.lay .badge { font-family: var(--f-mono); font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--ui-soft) }
.lay.auto { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 10px }
.lay.auto .auto-mark { width: 38px; height: 38px; flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: 2px }
.lay.auto .auto-mark i { background: var(--ui-line) }
.lay:hover { border-color: #9D9D95 }
.lay:has(input:checked) { border: 2px solid var(--ui-sel); padding: 7px }
.lay:has(input:focus-visible) { outline: 2px solid var(--ui-ink); outline-offset: 2px }

/* Forms */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0 }
.field.full { grid-column: 1 / -1 }
.lbl { font-size: 12px; font-weight: 500 }
.lbl i { font-style: normal; font-weight: 400; color: var(--ui-soft) }
.field input:not([type=radio]):not([type=file]):not([type=color]), .field select {
  width: 100%; padding: 7px 9px; border: 1px solid var(--ui-line); background: #fff; border-radius: 0; min-height: 34px }
.field input::placeholder { color: #A3A39B }
.field .hint { font-family: var(--f-mono); font-size: 10.5px; color: var(--ui-soft); min-height: 1em }
.money { position: relative }
.money::before { content: "₦"; position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--ui-soft); font-family: "Noto Sans", sans-serif }
.money input { padding-left: 22px !important; font-variant-numeric: tabular-nums }
.sample-note { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; padding: 10px 12px; background: var(--ui-warn-bg); color: var(--ui-warn); font-size: 13px }
.sample-note p { margin: 0 }
.brand-row { display: grid; grid-template-columns: 1fr; gap: 12px }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; align-items: center }
.sw { width: 28px; height: 28px; border: 1px solid var(--ui-line); cursor: pointer; padding: 0 }
.sw[aria-pressed="true"] { outline: 2px solid var(--ui-ink); outline-offset: 2px }
.sw-custom { position: relative; width: 28px; height: 28px; border: 1px dashed var(--ui-soft); display: grid; place-items: center; font-size: 16px; color: var(--ui-soft); cursor: pointer }
.sw-custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100% }
.logo-row { display: flex; gap: 8px; align-items: center }
.file-btn input { position: absolute; width: 1px; height: 1px; opacity: 0 }
.err { color: var(--ui-err); font-size: 12px }

/* Details */
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap }
#detail-groups { display: flex; flex-direction: column; border: 1px solid var(--ui-line); background: #fff }
#detail-groups details { border-top: 1px solid var(--ui-line) }
#detail-groups details:first-child { border-top: 0 }
#detail-groups summary { cursor: pointer; padding: 10px 12px; display: flex; justify-content: space-between; align-items: baseline; font-weight: 500; list-style: none }
#detail-groups summary::-webkit-details-marker { display: none }
#detail-groups summary::after { content: "+"; font-family: var(--f-mono); color: var(--ui-soft) }
#detail-groups details[open] summary::after { content: "−" }
#detail-groups summary .count { font-family: var(--f-mono); font-size: 11px; color: var(--ui-soft); margin-left: auto; margin-right: 10px; font-weight: 400 }
#detail-groups .form-grid { padding: 4px 12px 14px }
.is-blank #detail-groups { opacity: .55 }

/* Buttons */
.btn, .btn-ghost { border-radius: 0; cursor: pointer; padding: 8px 14px; font-weight: 500; position: relative; display: inline-flex; align-items: center; gap: 6px }
.btn { background: var(--ui-ink); color: #fff; border: 1px solid var(--ui-ink) }
.btn:hover { background: #333 }
.btn-ghost { background: #fff; border: 1px solid var(--ui-line); font-size: 13px; padding: 6px 10px }
.btn-ghost:hover { border-color: #9D9D95 }

/* Stage */
.stage { overflow: auto; min-width: 0; position: relative }
.stage-bar { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 20px; background: rgba(230,230,225,.94); backdrop-filter: blur(6px); border-bottom: 1px solid var(--ui-line) }
.status { font-family: var(--f-mono); font-size: 12px; color: var(--ui-soft) }
.status b { color: var(--ui-ink); font-weight: 500 }
.stage-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap }
.seg { display: inline-flex; border: 1px solid var(--ui-line); background: #fff }
.seg label { cursor: pointer }
.seg input { position: absolute; opacity: 0; pointer-events: none }
.seg span { display: block; padding: 7px 12px; font-size: 13px }
.seg label + label span { border-left: 1px solid var(--ui-line) }
.seg input:checked + span { background: var(--ui-ink); color: #fff }
.seg input:focus-visible + span { outline: 2px solid var(--ui-ink); outline-offset: -3px }
.print-tip { margin: 10px 20px 0; font-size: 12px; color: var(--ui-soft) }
.checks { list-style: none; margin: 10px 20px 0; padding: 0; display: flex; flex-direction: column; gap: 6px }
.checks li { padding: 8px 12px; font-size: 13px; background: var(--ui-warn-bg); color: var(--ui-warn); border-left: 3px solid currentColor }
.checks li.error { background: var(--ui-err-bg); color: var(--ui-err) }
.pages { padding: 20px; display: flex; flex-direction: column; align-items: center; gap: 18px }
.pages > .page { margin: 0 }                         /* while paginating, before framing */
.frame { width: calc(210mm * var(--z)); height: calc(297mm * var(--z)); flex: none; box-shadow: 0 1px 6px rgba(0,0,0,.16); overflow: hidden; background: #fff }
.frame > .page { margin: 0; transform: scale(var(--z)); transform-origin: 0 0; box-shadow: none }

/* Narrow screens: one column, preview after the controls */
@media (max-width: 960px) {
  .app { height: auto }
  .workspace { display: flex; flex-direction: column }
  .panel { overflow: visible; border-right: 0 }
  .stage { overflow: visible }
  .bar-note { display: none }
}
@media (max-width: 420px) {
  .form-grid { grid-template-columns: 1fr }
  .layouts { grid-template-columns: 1fr 1fr }
}

/* Print: only the pages, at full size */
@media print {
  html, body, .app { height: auto; background: none !important }
  .bar, .panel, .stage-bar, .print-tip, .checks { display: none !important }
  .workspace { display: block }
  .stage { overflow: visible }
  .pages { padding: 0; gap: 0; display: block }
  .frame { width: auto; height: auto; box-shadow: none; overflow: visible; break-after: page }
  .frame > .page { transform: none }
}
