﻿/* Plate Marketplace theme: taken from the logo. Purple #9063CD, near-black #111111, white. */
:root {
  --brand: #9063CD;          /* logo purple (decorative: bars, highlights) */
  --brand-strong: #7448B5;   /* deeper purple for text and buttons, readable on white */
  --brand-soft: #f1ebfa;
  --black: #111111;
  --bg: #f7f6fa;
  --surface: #ffffff;
  --ink: #111111;
  --muted: #66636e;
  --line: #e6e3ec;
  --shadow: 0 1px 2px rgb(18 18 18 / .04), 0 8px 24px rgb(18 18 18 / .06);
  --btn: var(--brand-strong);
  --btn-ink: #ffffff;
  --plate-bg: #111111;
  --plate-ink: #ffffff;
  --ok: #2e7d32;
  --warn: #946200;
  --danger: #b3261e;
  --radius: 14px;
  --sans: Arial, "Helvetica Neue", Helvetica, sans-serif;
  --display: Michroma, "Arial Black", Arial, sans-serif; /* wide, squared, like the logo lettering */
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --brand: #a888dc; --brand-strong: #b99ce6; --brand-soft: #2a2236;
    --bg: #0f0e12; --surface: #18171d; --ink: #f2f1f5; --muted: #a29fab; --line: #2c2a33; --shadow: none;
    --btn: #9063CD; --btn-ink: #ffffff;
    --plate-bg: #000000; --plate-ink: #ffffff;
    --ok: #7ccf81; --warn: #f0c247; --danger: #f08a80;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--sans); }
[hidden] { display: none !important; }
a { color: var(--brand-strong); }
.muted { color: var(--muted); }

button { font: inherit; cursor: pointer; border: 0; border-radius: 10px; background: var(--btn); color: var(--btn-ink); padding: 10px 16px; font-weight: 700; }
button:hover:not(:disabled) { filter: brightness(1.08); }
button:disabled { opacity: .5; cursor: default; }
button.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); padding: 6px 12px; font-weight: 500; }
button.ghost:hover { border-color: var(--brand); filter: none; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* Shell */
#app { display: grid; grid-template-rows: auto 1fr auto auto auto; grid-template-columns: minmax(0, 1fr); height: 100dvh; overflow: hidden; }
#app > * { min-width: 0; }
.top { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.top button.ghost { font-size: 13px; margin-left: auto; white-space: nowrap; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.logo { display: block; height: 40px; width: auto; }
.brand-tag { font-family: var(--display); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--brand-strong); border-left: 2px solid var(--ink); padding-left: 12px; line-height: 1.6; }

/* Market panel */
#market { position: fixed; top: 61px; right: 0; bottom: 0; width: min(400px, 100%); z-index: 3; background: var(--surface); border-left: 1px solid var(--line); padding: 16px; overflow: auto; box-shadow: -8px 0 24px rgb(0 0 0 / .08); }
.lib-head { display: flex; justify-content: space-between; align-items: start; }
.lib-head h2 { margin: 0; font-family: var(--display); font-size: 16px; letter-spacing: .02em; }
.lib-head p { margin: 4px 0 10px; font-size: 13px; }
#market h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 18px 0 6px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.stats div { border: 1px solid var(--line); border-radius: 10px; padding: 8px; text-align: center; }
.stats div:first-child { border-color: var(--brand); background: var(--brand-soft); }
.stats b { display: block; font-size: 18px; }
.stats span { font-size: 11px; color: var(--muted); line-height: 1.2; display: block; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12.5px; border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; }
#market table, .comps table { border-collapse: collapse; width: 100%; font-size: 13px; }
#market th, #market td, .comps th, .comps td { text-align: left; padding: 5px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
#market td a { color: var(--ink); }
.bad { color: var(--danger); }
.skipped { padding-left: 18px; font-size: 13px; color: var(--muted); margin: 0; }
.skipped b { color: var(--ink); font-weight: 600; }

/* Chat */
#chat { overflow-y: auto; padding: 24px 16px 8px; }
#empty, #thread { max-width: 760px; margin: 0 auto; }
#empty { padding-top: 5vh; text-align: center; }
#empty h1 { font-family: var(--display); font-weight: 400; font-size: 28px; line-height: 1.3; margin: 22px 0 10px; letter-spacing: .01em; }
#empty p { max-width: 560px; margin: 0 auto; }
/* The logo's three stepped bars */
.hero-logo { display: block; margin: 0 auto; height: auto; width: min(340px, 80%); }
.hero-mark { display: inline-grid; gap: 7px; justify-items: end; }
.hero-mark i { display: block; height: 18px; border-radius: 6px; background: var(--ink); }
.hero-mark i:nth-child(1) { width: 104px; background: var(--brand); }
.hero-mark i:nth-child(2) { width: 78px; }
.hero-mark i:nth-child(3) { width: 52px; }
.examples { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; justify-content: center; }
.examples button { background: var(--surface); color: var(--ink); border: 1px solid var(--line); font-weight: 700; letter-spacing: .03em; font-size: 14px; box-shadow: var(--shadow); }
.examples button:hover { border-color: var(--brand); filter: none; }
.demo-note { margin-top: 18px !important; font-size: 13px; color: var(--warn); }

#thread { list-style: none; padding: 0; display: grid; gap: 18px; }
.q { justify-self: end; max-width: 85%; background: var(--black); color: #fff; padding: 10px 14px; border-radius: 14px 14px 4px 14px; white-space: pre-wrap; overflow-wrap: anywhere; font-weight: 700; letter-spacing: .04em; }
@media (prefers-color-scheme: dark) { .q { background: #2a2733; } }
.a { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); overflow-wrap: anywhere; }
.a .body > :first-child { margin-top: 0; }
.a .body > :last-child { margin-bottom: 0; }
.a .body ul { padding-left: 20px; }
.a .body li::marker { color: var(--brand); }
.a.error { border-color: var(--danger); color: var(--danger); }
.thinking { color: var(--muted); font-style: italic; }
.thinking::after { content: 'â€¦'; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* State badge (examples, question bubbles) */
.ex-state { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .06em; padding: 1px 6px; border-radius: 4px; background: var(--brand); color: #fff; margin-right: 4px; vertical-align: 1px; }

/* Valuation card */
.cards:empty { display: none; }
.cards { display: grid; gap: 12px; margin-bottom: 14px; }
.vcard { display: grid; grid-template-columns: auto 1fr; gap: 14px 18px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
/* The plate: black, white characters, purple state band like the logo's top bar */
.plate-art { display: flex; align-items: stretch; min-width: 170px; background: var(--plate-bg); color: var(--plate-ink); border-radius: 9px; overflow: hidden; box-shadow: inset 0 0 0 2px rgb(255 255 255 / .12); }
/* State letters stacked one under the other, upright */
.pa-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; background: #9063CD; color: #fff; font-family: var(--display); font-size: 9px; line-height: 1.15; padding: 6px 5px; min-width: 20px; }
.pa-state b { font-weight: 400; }
.pa-text { flex: 1; display: flex; align-items: center; justify-content: center; padding: 10px 16px; font-family: var(--display); font-size: 22px; letter-spacing: .06em; line-height: 1.2; white-space: nowrap; }
.vbody { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.likely { font-family: var(--display); font-size: 26px; letter-spacing: .01em; }
.likely.small { font-size: 16px; }
.range { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); flex-basis: 100%; max-width: 380px; }
.bar { flex: 1; height: 6px; border-radius: 3px; background: var(--line); position: relative; }
.bar i { position: absolute; inset: 0; border-radius: 3px; background: linear-gradient(90deg, transparent, var(--brand) 30% 70%, transparent); }
.bar::after { content: ''; position: absolute; left: 50%; top: -4px; width: 3px; height: 14px; margin-left: -1.5px; border-radius: 2px; background: var(--ink); }
.conf { font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 9px; border: 1px solid currentColor; }
.conf.high { color: var(--ok); }
.conf.medium { color: var(--warn); }
.conf.low, .conf.none { color: var(--muted); }
.list-btn { margin-left: auto; text-decoration: none; background: var(--btn); color: var(--btn-ink); font-weight: 700; font-size: 13px; padding: 8px 14px; border-radius: 9px; }
.list-btn:hover { filter: brightness(1.08); }
.comps { grid-column: 1 / -1; font-size: 13px; }
.comps summary { cursor: pointer; color: var(--muted); }
.comps summary:hover { color: var(--brand-strong); }
.comps table { margin-top: 6px; display: block; overflow-x: auto; }
.comps tr.same td { background: var(--brand-soft); }
.comps small { color: var(--muted); }
.comps + .comps { margin-top: -8px; }
.comps.none { margin: 0; color: var(--muted); }
.comps td a { color: var(--ink); }

/* Ask bar: state first, then the characters */
.ask { display: flex; gap: 8px; max-width: 760px; width: calc(100% - 32px); margin: 8px auto 0; align-items: end; }
.ask select, .ask input {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; box-shadow: var(--shadow); height: 48px;
}
.ask select { flex: none; width: 104px; font-weight: 700; cursor: pointer; }
.ask select.need { border-color: var(--danger); outline: 2px solid var(--danger); }
.ask input { flex: 1; min-width: 0; text-transform: uppercase; font-weight: 700; letter-spacing: .06em; }
.ask input::placeholder { text-transform: none; font-weight: 400; letter-spacing: 0; }
.ask select:focus, .ask input:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: transparent; }
.ask button { flex: none; border-radius: 12px; padding: 0 22px; height: 48px; }
.ask-msg { max-width: 760px; width: calc(100% - 32px); margin: 4px auto 0; font-size: 13px; color: var(--danger); }
.ask-msg:empty { display: none; }
.foot { text-align: center; font-size: 12px; margin: 6px 16px 12px; }

/* Sign-in page */
.signin { min-height: 100dvh; display: grid; place-items: center; padding: 16px; }
.signin-card { width: min(380px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 28px; box-shadow: var(--shadow); display: grid; gap: 10px; }
.signin-card .hero-logo { width: 220px; }
.center-tag { border: 0; padding: 0; text-align: center; margin: 0 0 8px; }
.signin-card label { font-weight: 700; font-size: 13px; }
.signin-card input { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; }
.signin-card input:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.signin-msg { margin: 0; min-height: 1.3em; font-size: 13px; color: var(--danger); }

@media (max-width: 640px) {
  .logo { height: 32px; }
  .brand-tag { font-size: 9px; padding-left: 8px; }
  #market { top: 53px; }
  #chat { padding: 16px 12px 8px; }
  #empty h1 { font-size: 20px; }
  .examples button { flex: 1 1 40%; }
  .ask { width: calc(100% - 24px); }
  .ask select, .ask input { font-size: 16px; }
  .ask select { width: 84px; padding: 12px 8px; }
  .ask button { padding: 0 14px; }
  .vcard { grid-template-columns: 1fr; }
  .plate-art { justify-self: start; }
  .list-btn { margin-left: 0; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .foot { margin-bottom: calc(8px + env(safe-area-inset-bottom)); }
}
