/* KmicOS '97 — program styles: Explorer, Properties, Bag, Wizard, Terminal, Paint, Radio, Lookbook, Welcome, About, BSOD. */

/* ---------- shared bits ---------- */
.note { margin: 0; color: var(--muted); font-size: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 3px 0 6px; }
.btn-tool { min-height: 26px; padding: 2px 10px; font-size: 12px; }
.tool-sep { width: 2px; height: 22px; margin: 0 4px; border-left: 1px solid var(--chrome-lo); border-right: 1px solid var(--chrome-hi); }
.menubar { display: flex; gap: 2px; margin: -4px 0 2px; font-size: 12px; }
.menubar span { padding: 2px 8px; }
.menubar span::first-letter { text-decoration: underline; }
.statusbar { display: flex; margin-top: 6px; }
.statusbar-cell { flex: 1; margin: 0; padding: 3px 8px; font-size: 12px; box-shadow: var(--bevel-field); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dialog-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; padding-top: 10px; }
.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--green); }
.empty { display: grid; justify-items: center; align-content: center; gap: 6px; min-height: 100%; padding: 20px; text-align: center; }
.empty-title { margin: 6px 0 0; font: 30px/1 var(--font-px); }
.empty p { margin: 0; }
.linkish { padding: 0; border: 0; background: none; color: var(--ink); font-weight: 700; text-align: left; text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 2px; cursor: pointer; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.details { width: 100%; border-collapse: collapse; font-size: 12px; }
.details th { position: sticky; top: 0; padding: 4px 8px; background: var(--chrome); box-shadow: var(--bevel-out); font-weight: 500; text-align: left; }
.details td { padding: 3px 8px; border-bottom: 1px dotted var(--chrome); }
.props { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 10px 0; }
.props dt { color: var(--muted); }
.props dd { margin: 0; }
.prop-price { font-weight: 700; color: var(--green); }

/* ---------- Shop.exe (Explorer) ---------- */
.win-shop .win-body { display: flex; flex-direction: column; padding: 6px 8px 8px; }
.address-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.address-label { font-size: 12px; color: var(--muted); }
.address { flex: 1; padding: 3px 8px; font-size: 12px; white-space: nowrap; overflow: hidden; }
.explorer { display: grid; grid-template-columns: 180px 1fr; gap: 6px; flex: 1; min-height: 0; }
.tree-pane { overflow: auto; padding: 8px 6px; }
.tree-root { margin: 0 0 4px; font-weight: 700; }
.tree { margin: 0; padding: 0 0 0 10px; list-style: none; border-left: 1px dotted var(--chrome-lo); }
.tree-item { display: flex; align-items: center; gap: 6px; width: 100%; padding: 3px 4px; border: 0; background: none; cursor: pointer; text-align: left; }
.tree-item::before { content: ''; width: 8px; border-top: 1px dotted var(--chrome-lo); margin-left: -14px; }
.tree-item[aria-pressed="true"] { background: var(--sel); color: var(--sel-ink); }
.tree-count { margin-left: auto; font-size: 11px; opacity: .7; }
.shop-main { overflow: auto; padding: 10px; }
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 14px 10px; margin: 0; padding: 0; list-style: none; }
.file { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; padding: 6px 4px 8px; border: 0; background: none; cursor: pointer; }
.file-thumb { position: relative; width: 100%; aspect-ratio: 4 / 5; overflow: hidden; background: var(--chrome); box-shadow: 0 0 0 1px var(--ink), 3px 3px 0 var(--chrome-lo); }
.file-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease, filter .35s ease; filter: saturate(.92) contrast(1.02); }
.file-thumb::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .06) 0 1px, transparent 1px 3px); pointer-events: none; }
.file:hover .file-thumb img { transform: scale(1.05); filter: saturate(1.1); }
.file-name { max-width: 100%; padding: 0 3px; font-size: 11.5px; line-height: 1.3; word-break: break-word; text-align: center; }
.file-price { font: 19px/1 var(--font-px); color: var(--green); }
.file.is-selected .file-name, .file:focus-visible .file-name { background: var(--sel); color: var(--sel-ink); outline: 1px dotted var(--gold); }
.file.is-selected .file-thumb, .file:focus-visible .file-thumb { box-shadow: 0 0 0 2px var(--sel), 3px 3px 0 var(--chrome-lo); }
.file.is-selected img { filter: sepia(.25) hue-rotate(80deg) saturate(1.1); }
.file:focus-visible { outline: none; }
.file-row { display: inline-flex; align-items: center; gap: 6px; padding: 2px; border: 0; background: none; cursor: pointer; text-align: left; }
.file-row.is-selected { background: var(--sel); color: var(--sel-ink); }

/* ---------- Product Properties ---------- */
.product-body { display: flex; flex-direction: column; }
.product { display: grid; grid-template-columns: minmax(180px, 44%) 1fr; gap: 12px; flex: 1; min-height: 0; }
.product-media { display: flex; flex-direction: column; margin: 0; padding: 4px; min-height: 0; }
.product-img { flex: 1; width: 100%; min-height: 0; object-fit: cover; }
.product-media figcaption { padding: 4px 2px 0; font-size: 11px; color: var(--muted); }
.product-info { display: flex; flex-direction: column; min-height: 0; }
.tabs { display: flex; gap: 0; padding-left: 4px; }
.tab { position: relative; padding: 4px 14px; border: 0; background: var(--chrome); cursor: pointer; box-shadow: inset 1px 1px var(--chrome-hi), inset -1px 0 var(--chrome-dk), inset -2px 0 var(--chrome-lo); }
.tab[aria-selected="true"] { z-index: 1; margin-bottom: -2px; padding-bottom: 6px; top: -2px; font-weight: 700; }
.tab-panel { flex: 1; min-height: 0; overflow: auto; padding: 12px; box-shadow: var(--bevel-out); }
.tab-panel:focus-visible { outline-offset: -4px; }
.prop-name { margin: 0; font: 36px/.95 var(--font-px); }
.prop-twi { margin: 2px 0 0; color: var(--red); font-style: italic; }
.prop-story { margin: 0 0 10px; font: 24px/1.15 var(--font-px); }
.group { margin: 8px 0 0; padding: 6px 8px 8px; border: 1px solid var(--chrome-lo); box-shadow: 1px 1px 0 var(--chrome-hi), inset 1px 1px 0 var(--chrome-hi); }
.group legend { padding: 0 4px; font-size: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span { display: block; min-width: 36px; padding: 3px 9px; background: var(--chrome); box-shadow: var(--bevel-out); text-align: center; font-size: 12px; }
.chip input:checked + span { background: var(--sel); color: var(--sel-ink); box-shadow: var(--bevel-in); font-weight: 700; }
.chip input:focus-visible + span { outline: 2px dashed var(--ink); outline-offset: 2px; }
.qty { display: inline-flex; align-items: center; gap: 2px; }
.qty-label { margin-right: 6px; font-size: 12px; }
.qty-out { display: inline-grid; place-items: center; min-width: 38px; height: 30px; font-weight: 700; }
.product-body .dialog-actions { justify-content: space-between; }
.product-body .dialog-actions .qty { margin-right: auto; }

/* ---------- Bag + Recycle Bin ---------- */
.bag-body, .bin-body { display: flex; flex-direction: column; gap: 8px; }
.bag-scroll { flex: 1; min-height: 120px; overflow: auto; }
.bag-lines, .bin-list { margin: 0; padding: 0; list-style: none; }
.bag-line, .bin-list li { display: grid; grid-template-columns: 52px 1fr auto auto auto; align-items: center; gap: 8px; padding: 6px 8px; border-bottom: 1px dotted var(--chrome-lo); }
.bin-list { flex: 1; overflow: auto; }
.bin-list li { grid-template-columns: 52px 1fr auto; }
.bag-thumb { width: 52px; height: 62px; object-fit: cover; box-shadow: 0 0 0 1px var(--ink); }
.bag-meta { display: flex; flex-direction: column; min-width: 0; }
.bag-line-total { min-width: 92px; font-weight: 700; text-align: right; }
.btn-x { font-size: 11px; }
.free-delivery p { margin: 0 0 4px; font-size: 12px; }
.free-delivery .progress { height: 20px; }
.totals { display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; margin: 0; padding: 8px 10px; background: var(--chrome-mid); box-shadow: var(--bevel-field); }
.totals dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.totals .grand { padding-top: 4px; border-top: 1px solid var(--chrome-lo); font-weight: 700; font-size: 15px; }
.bag-body .dialog-actions { padding-top: 2px; }

/* ---------- Order Wizard ---------- */
.wizard-body { display: flex; flex-direction: column; }
.wizard { display: grid; grid-template-columns: 150px 1fr; gap: 14px; flex: 1; min-height: 0; }
.wizard-side { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; padding: 14px 8px; background: linear-gradient(180deg, var(--title-a), var(--green) 55%, var(--gold)); box-shadow: var(--bevel-field); color: #fff; }
.wizard-art { margin-bottom: auto; filter: drop-shadow(3px 3px 0 rgba(0, 0, 0, .4)); }
.wizard-brand { margin: 0; font: 34px/1 var(--font-px); }
.wizard-ver { margin: 0; font-size: 11px; opacity: .85; }
.wizard-main { display: flex; flex-direction: column; min-height: 0; }
.wizard-steps { display: flex; gap: 4px; margin: 0 0 10px; padding: 0; list-style: none; counter-reset: s; font-size: 12px; }
.wizard-steps li { counter-increment: s; padding: 2px 8px; color: var(--muted); }
.wizard-steps li::before { content: counter(s) '. '; }
.wizard-steps .is-current { background: var(--sel); color: #fff; font-weight: 700; }
.wizard-steps .is-done { color: var(--green); }
.wizard-steps .is-done::before { content: '✓ '; }
.wizard-content { flex: 1; min-height: 0; overflow: auto; padding-right: 4px; }
.wizard-content h3 { margin: 0 0 6px; font: 30px/1 var(--font-px); }
.wizard-content > p { margin: 0 0 10px; }
.wizard-list { margin: 0 0 10px; padding: 6px 10px; list-style: none; }
.wizard-list li { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; font-size: 12px; }
.form-row { display: grid; gap: 3px; margin-bottom: 4px; }
.form-row label { font-size: 12px; font-weight: 500; }
.field-error { min-height: 1.2em; margin: 0; color: var(--red); font-size: 11.5px; }
.momo { margin: 8px 0; padding: 8px 10px; background: #fff7cc; box-shadow: 0 0 0 1px var(--gold), 3px 3px 0 var(--gold); font-weight: 500; }
.momo::before { content: 'MoMo · '; color: var(--red); font-weight: 700; }
.progress-install { transition: none; }
.install-file { margin-bottom: 8px !important; font-family: var(--font-px); font-size: 20px; }

/* ---------- Terminal ---------- */
.win-terminal { background: var(--chrome); }
.term-body { padding: 0 !important; background: #050805; }
.term-screen {
  height: 100%; overflow: auto; padding: 10px 12px 14px;
  background: radial-gradient(120% 120% at 50% 40%, #0b1a0b, #020402 80%);
  color: var(--phosphor); font: 20px/1.12 var(--font-px);
  text-shadow: 0 0 6px rgba(57, 255, 20, .55);
  cursor: text;
}
.term-line { white-space: pre-wrap; word-break: break-word; }
.term-line.echo { color: #d6ffd0; }
.term-line.dim { color: #4fae3a; text-shadow: none; }
.term-line.err { color: #ff6b5e; text-shadow: 0 0 6px rgba(255, 80, 60, .5); }
.term-line.ok { color: var(--gold); text-shadow: 0 0 6px rgba(242, 183, 5, .5); }
.term-kente { margin: 4px 0; line-height: .9; letter-spacing: 0; text-shadow: none; }
.term-kente div { white-space: pre; overflow: hidden; }
.k-gold { color: var(--gold); }
.k-green { color: #1fbf85; }
.k-red { color: #ff3b4a; }
.k-black { color: #5a5a5a; }
.term-form { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.term-prompt { flex: none; color: var(--phosphor); }
.term-input {
  flex: 1; min-width: 0; padding: 0; border: 0; background: transparent;
  color: var(--phosphor); font: inherit; text-shadow: inherit; caret-color: var(--phosphor); caret-shape: block;
}
.term-input:focus-visible { outline: none; }
.term-form:focus-within .term-prompt { text-decoration: underline; }
.term-mic { flex: none; width: 36px; height: 30px; border: 1px solid var(--phosphor); background: transparent; font-size: 16px; cursor: pointer; }
.term-mic:focus-visible { outline: 2px solid var(--gold); }
.term-mic.is-listening { background: var(--red); animation: blink 1s steps(1) infinite; }

/* ---------- Kente Paint ---------- */
.paint-body { display: flex; flex-direction: column; }
.swatches { display: flex; gap: 3px; }
.swatch { width: 28px; height: 28px; border: 0; background: var(--sw); box-shadow: var(--bevel-field); cursor: pointer; }
.swatch[aria-checked="true"] { outline: 2px solid var(--ink); outline-offset: 2px; transform: translateY(-2px); }
.paint-stage { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; }
.paint-canvas { width: min(352px, 100%); height: auto; aspect-ratio: 1; padding: 3px; cursor: crosshair; touch-action: none; image-rendering: pixelated; }
.paint-canvas:focus-visible { outline: 2px dashed var(--green); outline-offset: 2px; }
.paint-side { display: grid; gap: 8px; flex: 1; min-width: 180px; }
.paint-preview { width: 160px; height: 160px; padding: 3px; image-rendering: pixelated; }

/* ---------- Radio Accra ---------- */
.radio-body { display: flex; flex-direction: column; gap: 8px; background: linear-gradient(180deg, var(--chrome), #c4bfae); }
.radio-lcd { padding: 8px 10px; background: #0d1f10; color: var(--phosphor); box-shadow: var(--bevel-field); overflow: hidden; }
.radio-freq { margin: 0; font: 34px/1 var(--font-px); text-shadow: 0 0 8px rgba(57, 255, 20, .7); }
.marquee { overflow: hidden; }
.radio-now { margin: 0; white-space: nowrap; font: 20px var(--font-px); color: #b6ff9f; }
.is-playing .radio-now { animation: marquee 12s linear infinite; }
@keyframes marquee { from { transform: translateX(60%); } to { transform: translateX(-100%); } }
.viz { display: flex; align-items: flex-end; gap: 3px; height: 70px; padding: 6px; background: #050805; }
.viz-bar { flex: 1; height: 100%; transform: scaleY(.06); transform-origin: bottom; background: linear-gradient(0deg, var(--green) 0 45%, var(--gold) 45% 78%, var(--red) 78%); transition: transform .08s linear; }
.radio-ctrls { justify-content: center; }
.vol { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; font-size: 12px; }
.range { width: 90px; accent-color: var(--green); }
.playlist { flex: 1; overflow: auto; margin: 0; padding: 4px; list-style: none; }
.track { display: grid; grid-template-columns: 28px 1fr; width: 100%; padding: 4px 6px; border: 0; background: none; text-align: left; cursor: pointer; }
.track .note { grid-column: 2; }
.track[aria-current="true"] { background: var(--sel); color: #fff; }
.track[aria-current="true"] .note { color: #cfe; }
.track-n { font: 20px/1 var(--font-px); }

/* ---------- Lookbook ---------- */
.lb-body { display: flex; flex-direction: column; gap: 6px; background: #1b1a17; color: var(--chrome); }
.lb-stage { flex: 1; min-height: 0; display: grid; place-items: center; overflow: hidden; background: #0c0c0b; box-shadow: var(--bevel-field); }
.lb-img { max-height: 100%; width: auto; max-width: 100%; object-fit: contain; }
.lb-img.is-in { animation: lb-in .5s ease-out; }
@keyframes lb-in { from { opacity: 0; filter: brightness(2.2) contrast(.6); clip-path: inset(0 0 100% 0); } to { clip-path: inset(0); } }
.lb-cap { margin: 0; font: 24px/1 var(--font-px); color: var(--gold); }
.lb-tools .btn { min-height: 28px; }
.lb-thumbs { display: flex; gap: 4px; margin: 0; padding: 2px; overflow-x: auto; list-style: none; }
.lb-thumb { flex: none; width: 52px; height: 52px; padding: 0; border: 0; background: none; cursor: pointer; opacity: .55; }
.lb-thumb img { width: 100%; height: 100%; object-fit: cover; }
.lb-thumb[aria-current="true"], .lb-thumb:hover { opacity: 1; outline: 2px solid var(--gold); }

/* ---------- Welcome (hero) ---------- */
.welcome-body { padding: 0 !important; background: var(--paper); }
.welcome { display: grid; grid-template-columns: 1.15fr .85fr; height: 100%; }
.welcome-copy { display: flex; flex-direction: column; gap: 10px; padding: 18px 18px 14px 20px; overflow: auto; }
.welcome-copy p { margin: 0; }
.welcome-kicker { font: 24px/1 var(--font-px); color: var(--muted); }
.welcome-title { margin: 0; font: clamp(56px, 7vw, 76px)/.8 var(--font-px); letter-spacing: -.01em; text-shadow: 3px 3px 0 var(--gold); }
.welcome-title span { display: block; color: var(--green); text-shadow: 3px 3px 0 var(--red); }
.welcome-tag { font-weight: 700; color: var(--red); }
.welcome-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.tip { padding: 6px 8px; background: #fffbd8; box-shadow: 0 0 0 1px var(--chrome-lo); }
kbd { padding: 0 4px; background: #111; color: var(--phosphor); font: 15px var(--font-px); }
.welcome-fig { position: relative; margin: 0; background: var(--black); }
.welcome-feature { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: pointer; }
.welcome-img { width: 100%; height: 100%; object-fit: cover; }
.welcome-fig::before { content: ''; position: absolute; inset: 0 auto 0 0; z-index: 1; width: 10px; background: var(--kente); background-size: 100% 34px; background-image: repeating-linear-gradient(180deg, var(--gold) 0 10px, var(--black) 10px 12px, var(--green) 12px 20px, var(--gold) 20px 24px, var(--red) 24px 32px, var(--black) 32px 34px); pointer-events: none; }
.welcome-fig figcaption { position: absolute; left: 18px; right: 8px; bottom: 8px; pointer-events: none; }
.welcome-cap { display: inline; margin: 0; padding: 2px 6px; background: var(--black); color: var(--gold); font: 20px/1.3 var(--font-px); box-decoration-break: clone; -webkit-box-decoration-break: clone; }

/* ---------- About ---------- */
.about-body { display: flex; flex-direction: column; }
.about { display: grid; grid-template-columns: 90px 1fr; gap: 14px; flex: 1; }
.about-logo { display: grid; place-items: center; align-self: start; padding: 8px; background: var(--teal); box-shadow: var(--bevel-field); }
.about-title { margin: 0; font: 44px/1 var(--font-px); }
.about p { margin: 4px 0; }
.about-body .dialog-actions { justify-content: space-between; }

/* ---------- BSOD ---------- */
.bsod { position: fixed; inset: 0; z-index: 14000; display: grid; place-items: center; padding: 24px; background: #0000aa; color: #fff; font: 24px/1.25 var(--font-px); cursor: pointer; }
.bsod:focus { outline: none; }
.bsod-inner { max-width: 720px; }
.bsod-inner p { margin: 0 0 18px; }
.bsod-title { display: table; margin: 0 auto 24px !important; padding: 0 8px; background: #aaa; color: #0000aa; }
.bsod-blink { animation: blink 1s steps(1) infinite; }

/* ---------- mobile program tweaks ---------- */
@media (max-width: 767px) {
  .explorer { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .tree-pane { padding: 4px; overflow-x: auto; }
  .tree-root { display: none; }
  .tree { display: flex; gap: 4px; padding: 0; border: 0; }
  .tree li { flex: none; }
  .tree-item { padding: 6px 10px; box-shadow: var(--bevel-out); background: var(--chrome); white-space: nowrap; }
  .tree-item::before, .tree-item .px-icon { display: none; }
  .menubar { display: none; }
  .file-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product { grid-template-columns: 1fr; grid-template-rows: auto auto; overflow: auto; }
  .product-body { overflow: auto; }
  .product-media { display: block; }
  .product-img { width: 100%; height: auto; max-height: 56vh; aspect-ratio: 4 / 5; object-fit: cover; }
  .tab-panel { background: var(--chrome); }
  .product-info { min-height: 260px; }
  .product-body .dialog-actions { position: sticky; bottom: -10px; margin: 0 -10px -10px; padding: 8px 10px; background: var(--chrome); box-shadow: inset 0 2px var(--chrome-hi); }
  .bag-line { grid-template-columns: 52px 1fr auto; grid-template-areas: 'img meta meta' 'img qty total' 'img x x'; }
  .bag-line .bag-thumb { grid-area: img; }
  .bag-line .bag-meta { grid-area: meta; }
  .bag-line .qty { grid-area: qty; }
  .bag-line .bag-line-total { grid-area: total; }
  .bag-line .btn-x { grid-area: x; justify-self: end; }
  .wizard { grid-template-columns: 1fr; }
  .wizard-side { display: none; }
  .welcome { grid-template-columns: 1fr; grid-template-rows: auto 260px; height: auto; }
  .term-screen { font-size: 18px; }
  .about { grid-template-columns: 1fr; }
  .about-logo { justify-self: start; }
}
