/* Brand: Profile Equipment viewer (docs/research/UX.md §1). */
:root {
  --bg: #17150e; --stage: #2a2619; --panel: #1d1a12; --card: #221f16; --line: #3a3526;
  --gold: #c2a202; --gold-hi: #f0d24a; --gold-bg: rgba(194, 162, 2, .15); --gold-bg2: rgba(194, 162, 2, .22);
  --cream: #f5f1e6; --text2: #b0aa96; --muted: #8f8970; --muted2: #7c7558;
  --held: #3a8df0; --load: #f07a1a; --warn: #e0912c; --err: #d9463f;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--cream); font: 13px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
#topbar { height: 48px; display: flex; align-items: center; gap: 16px; padding: 0 14px; border-bottom: 1px solid var(--line); background: var(--bg); }
.brand { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.kicker { color: var(--gold); font-weight: 700; letter-spacing: .14em; font-size: 11px; }
.title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta { color: var(--text2); font-size: 12px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.actions { display: flex; gap: 8px; }
#app { display: flex; height: calc(100% - 48px); }
#panel { width: 340px; min-width: 340px; overflow: auto; padding: 10px; background: var(--panel); border-right: 1px solid var(--line); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
.card.active { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold-bg2) inset; }
.card h2 { margin: 0 0 8px; font-size: 13px; font-weight: 650; color: var(--cream); }
.card h3 { margin: 10px 0 4px; font-size: 12px; font-weight: 600; color: var(--text2); }
.hint { color: var(--text2); margin: 4px 0 8px; font-size: 12px; }
.warn { color: var(--warn); margin: 6px 0 0; font-size: 12px; }
.privacy { color: var(--muted2); font-size: 11px; margin: 8px 4px; }
/* links in the panel footer (licences): muted like the privacy line, underline only on hover / keyboard focus */
.privacy a { color: var(--muted); text-decoration: none; }
.privacy a:visited { color: var(--muted); }
.privacy a:hover, .privacy a:focus-visible { color: var(--text2); text-decoration: underline; text-underline-offset: 2px; }
.privacy a:focus-visible { outline: 1px solid var(--gold); outline-offset: 2px; border-radius: 2px; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pill, .btn { background: #2c2819; color: var(--cream); border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; font: inherit; font-size: 12px; cursor: pointer; }
.pill:hover, .btn:hover { border-color: var(--gold); }
.pill.on { background: var(--gold-bg2); border-color: var(--gold); color: var(--gold-hi); }
.btn.primary { background: var(--gold); color: #17150e; border-color: var(--gold); font-weight: 650; }
.btn.primary:hover { background: var(--gold-hi); }
.pill:disabled, .btn:disabled { opacity: .45; cursor: not-allowed; }
table { border-collapse: collapse; width: 100%; }
td { padding: 2px 0; vertical-align: top; font-variant-numeric: tabular-nums; }
td:first-child { color: var(--text2); width: 38%; padding-right: 8px; }
.tag { display: inline-block; font-size: 10.5px; padding: 0 6px; border-radius: 999px; border: 1px solid var(--line); color: var(--text2); margin-left: 4px; }
.tag.ok { color: #7fc9a2; border-color: #3fa37a; }
.tag.bad { color: var(--warn); border-color: var(--warn); }
input[type=range] { width: 100%; accent-color: var(--gold); }
input[type=number], select { background: #2c2819; color: var(--cream); border: 1px solid var(--line); border-radius: 6px; padding: 3px 6px; font: inherit; }
label.inline { display: flex; align-items: center; gap: 6px; color: var(--text2); font-size: 12px; margin: 6px 0; }
#stage { flex: 1; position: relative; background: radial-gradient(ellipse at 50% 42%, #2a2619 0%, #1c1a12 65%, #17150e 100%); overflow: hidden; }
#stage > canvas { display: block; width: 100%; height: 100%; touch-action: none; }
#unitBanner { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); max-width: min(720px, 94%); background: #2b2511f2; border: 1px solid var(--gold); border-radius: 12px; padding: 10px 14px; box-shadow: 0 6px 24px #0008; z-index: 5; }
#unitBanner .q { font-weight: 650; margin-bottom: 2px; }
#unitBanner .sub { color: var(--text2); font-size: 12px; margin-bottom: 8px; }
#unitBanner .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
#unitBanner .size { font-variant-numeric: tabular-nums; margin: 8px 0 2px; }
#unitBanner .banana { color: var(--text2); font-size: 12px; }
#unitBanner .plaus { color: var(--warn); font-size: 12px; margin-top: 4px; }
#chip { position: absolute; top: 12px; left: 12px; background: #17150ee6; border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; color: var(--cream); font-size: 12px; z-index: 4; }
#toast { position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%); max-width: min(640px, 92%); background: #3a1714f2; border: 1px solid var(--err); color: var(--cream); padding: 10px 14px; border-radius: 10px; z-index: 6; }
#toast .code { color: var(--text2); font-size: 11px; margin-top: 4px; font-family: ui-monospace, monospace; }
#drop { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: #17150ecc; border: 2px dashed var(--gold); font-size: 18px; color: var(--gold-hi); z-index: 7; pointer-events: none; }
#drop[hidden], #busy[hidden], #toast[hidden], #chip[hidden], #unitBanner[hidden] { display: none; }
#busy { position: absolute; inset: 0; display: flex; gap: 10px; align-items: center; justify-content: center; background: #17150e99; z-index: 6; color: var(--cream); }
.spinner { width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--gold); border-radius: 50%; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#status { position: absolute; bottom: 10px; left: 12px; color: var(--muted); font-size: 11.5px; }
.facelist { list-style: none; padding: 0; margin: 4px 0; max-height: 150px; overflow: auto; }
.facelist li { display: flex; align-items: center; gap: 6px; padding: 2px 0; font-size: 12px; font-variant-numeric: tabular-nums; }
.facelist li .sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.facelist li .x { margin-left: auto; background: none; border: none; color: var(--muted); cursor: pointer; font-size: 14px; }
.facelist li .x:hover { color: var(--cream); }
.empty { color: var(--muted); font-size: 12px; font-style: italic; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.dot.held { background: var(--held); }
.dot.load { background: var(--load); }
.role-card.active.held { border-color: var(--held); box-shadow: 0 0 0 1px rgba(58, 141, 240, .25) inset; }
.role-card.active.load { border-color: var(--load); box-shadow: 0 0 0 1px rgba(240, 122, 26, .25) inset; }
.pill.on.held { background: rgba(58, 141, 240, .2); border-color: var(--held); color: #cfe3ff; }
.pill.on.load { background: rgba(240, 122, 26, .2); border-color: var(--load); color: #ffe0c7; }
/* Advanced terms are hidden for beginners (UX.md §4); ?adv=1 shows them next to the plain wording. */
.tag.adv { display: none; }
body.advanced .tag.adv { display: inline-block; }
.advbox { display: none; }
body.advanced .advbox { display: block; margin-top: 8px; padding: 6px 8px; border: 1px dashed var(--line); border-radius: 8px; color: var(--text2); font-size: 11.5px; font-family: ui-monospace, monospace; white-space: pre; overflow-x: auto; }
/* Project card + "Install & offline use" card (ADR-0013): same pills / hints as the other cards */
#projMsg p { margin: 6px 0 0; }
#projList li .when { color: var(--muted); font-size: 11px; margin-left: auto; white-space: nowrap; }
#projList li .x { margin-left: 0; }
#projList li .linkbtn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card.notice { border-color: var(--gold); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.card.notice[hidden] { display: none; }
#appProgress .bar { height: 6px; background: #2c2819; border-radius: 3px; overflow: hidden; border: 1px solid var(--line); margin-top: 8px; }
#appProgress .bar > div { height: 100%; width: 0; background: var(--gold); transition: width .25s linear; }
.hint.small { font-size: 11px; color: var(--muted); margin-top: 0; }
input[type=checkbox] { accent-color: var(--gold); }
@media (max-width: 700px) {
  #app { flex-direction: column-reverse; }
  #panel { width: 100%; min-width: 0; height: 42%; border-right: none; border-top: 1px solid var(--line); }
}
