/* Lucequant client app. Brand tokens are copied from the public site's style.css. Mobile first. */
:root {
  --bg: #071428; --bg2: #0b1b34; --surface: rgba(255,255,255,.04); --surface-2: rgba(255,255,255,.07);
  --line: rgba(255,255,255,.14); --text: #e8edf7; --muted: #a9b4ca; --cyan: #2dd4bf; --teal: #13ae94;
  --green: #34d399; --amber: #fbbf24; --red: #f87171; --r: 18px;
  --grad: linear-gradient(120deg, #2dd4bf 0%, #5eead4 50%, #7ce8d5 100%);
  --font: 'Manrope', 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { background: radial-gradient(1200px 500px at 70% -10%, #0d2a4a 0%, var(--bg) 60%); background-color: var(--bg); color: var(--text); font-family: var(--font); line-height: 1.55; min-height: 100vh; -webkit-font-smoothing: antialiased; }
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }
h1 { font-size: clamp(1.6rem, 5vw, 2.2rem); line-height: 1.15; letter-spacing: -.02em; }
h2 { font-size: 1.15rem; margin-bottom: 10px; }
h3 { font-size: 1rem; margin: 18px 0 8px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--cyan); color: #04211c; padding: 10px 14px; border-radius: 10px; z-index: 20; font-weight: 700; }
.skip:focus { top: 8px; }

/* header */
#app-header { border-bottom: 1px solid var(--line); background: rgba(7,20,40,.85); z-index: 10; }
.bar { width: min(100% - 32px, 1100px); margin-inline: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding: 10px 0; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.25rem; }
.brand b { color: var(--cyan); font-weight: 700; }
.bar nav { display: flex; gap: 6px; order: 3; width: 100%; }
.bar nav a { padding: 8px 12px; border-radius: 10px; color: var(--muted); }
.bar nav a:hover { background: var(--surface-2); color: var(--text); }
.who { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
@media (min-width: 720px) { .bar nav { order: 0; width: auto; } }

main { width: min(100% - 32px, 1100px); margin-inline: auto; padding: 24px 0 80px; outline: none; }
.crumbs { color: var(--muted); font-size: .9rem; margin-bottom: 8px; }
.crumbs a { text-decoration: underline; }
.page-head { margin-bottom: 20px; }
.page-head.split { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; justify-content: space-between; }
.sub, .meta, .help { color: var(--muted); font-size: .9rem; }
.help { display: block; margin: 2px 0 8px; }
.loading, .empty { color: var(--muted); padding: 8px 0; }

/* cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; margin-bottom: 16px; }
.card.narrow { max-width: 560px; margin-inline: auto; }
.card.empty-card { text-align: center; padding: 32px 20px; max-width: 560px; margin-inline: auto; }
.empty-card p { margin: 8px 0 18px; color: var(--muted); }
.cards { list-style: none; display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .cards { grid-template-columns: 1fr 1fr; } }
.link-card { display: flex; flex-direction: column; gap: 4px; margin: 0; height: 100%; transition: border-color .15s, background .15s; }
.link-card:hover { border-color: var(--cyan); background: var(--surface-2); }
.link-card strong { font-size: 1.05rem; }
.signin { min-height: 70vh; display: grid; place-items: center; }
.signin form img { margin-bottom: 12px; }
.signin h1 { margin-bottom: 16px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; font-weight: 600; text-align: center; }
.btn:hover:not(:disabled) { border-color: var(--cyan); }
.btn.primary { background: var(--grad); color: #04211c; border-color: transparent; }
.btn.small { min-height: 36px; padding: 6px 12px; }
.btn.wide { width: 100%; margin-top: 16px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.actions, .composer-row, .start-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; }
.start-row { margin-top: 18px; }

/* forms */
label, legend { display: block; font-weight: 600; margin: 14px 0 4px; }
.req { color: var(--muted); font-weight: 400; font-size: .85rem; }
input[type=text], input[type=password], select, textarea { width: 100%; max-width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.06); }
select option { color: #000; }
textarea { resize: vertical; }
.composer-row input[type=text], .composer-row select { flex: 1 1 220px; width: auto; }
fieldset { border: 0; min-width: 0; margin-top: 6px; }
.choice { display: flex; align-items: flex-start; gap: 10px; padding: 6px 0; }
.choice label { margin: 0; font-weight: 500; }
.choice.big { padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; }
.choice.big label { display: flex; flex-direction: column; }
.choice input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--teal); flex: none; }
.toggle-row { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.toggle-row label { margin: 0; }
.switch { appearance: none; width: 46px; height: 26px; border-radius: 99px; background: rgba(255,255,255,.18); position: relative; cursor: pointer; flex: none; border: 1px solid var(--line); transition: background .15s; }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch:checked { background: var(--teal); }
.switch:checked::after { transform: translateX(20px); }
.field { margin-bottom: 4px; }
.field-error, .error { color: var(--red); font-size: .92rem; min-height: 1.2em; }
.ok { color: var(--green); }
.error:empty { min-height: 0; }

/* files */
.drop { display: flex; flex-direction: column; gap: 2px; align-items: center; text-align: center; padding: 28px 16px; margin: 10px 0; border: 2px dashed var(--line); border-radius: 16px; cursor: pointer; font-weight: 500; }
.drop:hover, .drop.over { border-color: var(--cyan); background: rgba(45,212,191,.06); }
#zip-input:focus-visible + .drop { outline: 2px solid var(--cyan); outline-offset: 3px; border-color: var(--cyan); }
.items { list-style: none; display: grid; gap: 8px; margin: 10px 0; }
.item { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.item-name { overflow-wrap: anywhere; min-width: 0; }
.items.small .item { padding: 6px 12px; }
.badge { display: inline-block; padding: 3px 11px; border-radius: 99px; font-size: .78rem; font-weight: 700; background: rgba(255,255,255,.1); color: var(--muted); white-space: nowrap; margin-left: 8px; }
.badge.approved { background: rgba(52,211,153,.16); color: var(--green); }
.badge.uploading, .badge.checking, .badge.review { background: rgba(45,212,191,.14); color: var(--cyan); }
.badge.problem { background: rgba(248,113,113,.16); color: var(--red); }
.uploading { display: grid; gap: 6px; }
progress { width: 100%; height: 10px; accent-color: var(--cyan); }

/* progress */
.status-line { font-size: 1.05rem; margin-bottom: 12px; }
.status-line.bad { color: var(--amber); }
.steps { list-style: none; display: grid; gap: 8px; margin: 8px 0 12px; padding: 0; }
.steps li { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.steps .dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); flex: none; }
.steps li.done { color: var(--text); }
.steps li.done .dot { background: var(--green); border-color: var(--green); }
.steps li.current { color: var(--cyan); font-weight: 700; }
.steps li.current .dot { border-color: var(--cyan); background: var(--cyan); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(45,212,191,.2); } }
@media (min-width: 720px) { .steps { grid-auto-flow: column; grid-auto-columns: 1fr; } }

/* conversation */
.messages { list-style: none; display: grid; gap: 10px; margin: 8px 0 16px; max-height: 420px; overflow: auto; }
.msg { padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); max-width: 92%; }
.msg.assistant { background: rgba(45,212,191,.08); border-color: rgba(45,212,191,.3); justify-self: start; }
.msg.user { background: var(--surface-2); justify-self: end; }
.msg .who { font-size: .82rem; font-weight: 700; margin: 0 0 2px; justify-content: flex-start; }
.msg .text { white-space: pre-wrap; overflow-wrap: anywhere; }
.question { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--cyan); background: rgba(45,212,191,.08); margin-bottom: 6px; }
.toast { position: fixed; bottom: 16px; left: 16px; right: 16px; max-width: 420px; margin-inline: auto; background: #0f2a2a; border: 1px solid var(--cyan); padding: 12px 16px; border-radius: 12px; z-index: 30; text-align: center; }
.noscript { padding: 24px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) { .badge, .btn { border: 1px solid CanvasText; } }

/* tracker studies */
.wave-box { margin: 8px 0 14px; padding: 14px 16px; border: 1px solid var(--line, #d7dee6); border-radius: 12px; }
.wave-list { display: grid; gap: 8px; margin-top: 8px; max-height: 280px; overflow: auto; }
.wave-opt { display: grid; gap: 2px; }
.waves { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.tracker-card { display: grid; gap: 10px; }
.tracker-box:empty { display: none; }
.signin-id { display: inline-block; padding: .5rem .75rem; border: 1px solid var(--line); border-radius: 8px; word-break: break-all; user-select: all; }
