/* snapEstimate — the built-in console.
   Dark, because it is read on a phone in a garage as often as at a desk, and
   sized for a gloved thumb before a mouse pointer. */
:root {
  --bg: #12161a; --panel: #181e24; --panel-2: #1f262e; --rule: #2b343d;
  --ink: #e8edf2; --ink-2: #93a1ae; --ink-3: #6b7885;
  --teal: #2fb39a; --amber: #f5a524; --brick: #e2603f; --ok: #4ca96b;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
/* `display` on a class beats the hidden attribute's display:none, which is
   how both the sign-in and sign-up forms ended up on screen at once. One
   rule, stated once, rather than remembering it at every call site. */
[hidden] { display: none !important; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

.top {
  display: flex; align-items: center; gap: 1.5rem; padding: .85rem 1.25rem;
  background: var(--panel); border-bottom: 1px solid var(--rule);
  position: sticky; top: 0; z-index: 10;
}
.brand { color: var(--ink); font-weight: 600; letter-spacing: -.01em; }
.brand b { color: var(--teal); font-weight: 700; }
.top nav { display: flex; gap: 1.1rem; margin-left: auto; }
.top nav a { color: var(--ink-2); font-size: .9rem; }
.top nav a.on { color: var(--ink); font-weight: 600; }

main { max-width: 1180px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }
.head { display: flex; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.head h1 { font-size: 1.6rem; margin: 0; letter-spacing: -.02em; }
.head > :last-child { margin-left: auto; }
.head-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
h2 { font-size: .78rem; text-transform: uppercase; letter-spacing: .09em; color: var(--ink-3); margin: 0 0 .8rem; }
.count { color: var(--ink-3); font-weight: 400; }
.sub { color: var(--ink-2); font-size: .85rem; }
.sub.bad { color: var(--brick); }
.hint { color: var(--ink-3); font-size: .82rem; margin: .7rem 0 0; }
.mono { font-family: var(--mono); font-size: .88em; }
.right { text-align: right; }
.band { color: var(--ink-3); font-weight: 400; }
.headline { font-size: 1.15rem; line-height: 1.5; margin: 0 0 1.25rem; max-width: 70ch; }

.cols { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 900px) { .cols { grid-template-columns: 1fr 340px; } }
.col { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }

.card { background: var(--panel); border: 1px solid var(--rule); border-radius: 10px; padding: 1.1rem; }
.card > form { display: flex; flex-direction: column; gap: .9rem; }
.empty { text-align: center; padding: 4rem 1rem; color: var(--ink-2); }
.empty .btn { margin-top: 1rem; }

label, .field { display: flex; flex-direction: column; gap: .35rem; font-size: .85rem; color: var(--ink-2); }
.lbl { font-size: .85rem; }
input, select, textarea {
  background: var(--panel-2); border: 1px solid var(--rule); border-radius: 7px;
  color: var(--ink); padding: .62rem .7rem; font: inherit; font-size: .92rem; width: 100%;
}
textarea { resize: vertical; }
label.check { flex-direction: row; align-items: center; gap: .55rem; }
label.check input { width: auto; }
.grid { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.actions { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }

.btn {
  background: var(--panel-2); border: 1px solid var(--rule); color: var(--ink);
  border-radius: 7px; padding: .55rem .95rem; font: inherit; font-size: .88rem;
  font-weight: 500; cursor: pointer;
}
.btn:hover:not(:disabled) { border-color: var(--ink-3); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--teal); border-color: var(--teal); color: var(--on-accent, #06231d); font-weight: 600; }
.btn.danger { color: var(--brick); }
.btn.block { width: 100%; margin-top: .8rem; }
.x { background: none; border: 0; color: var(--ink-3); font-size: 1.1rem; cursor: pointer; padding: 0 .3rem; }
.x:hover { color: var(--brick); }

table.rows { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.rows th {
  text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .07em;
  color: var(--ink-3); font-weight: 600; padding: .5rem .6rem; border-bottom: 1px solid var(--rule);
}
table.rows td { padding: .62rem .6rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
table.rows tbody tr:last-child td { border-bottom: 0; }
table.rows tbody tr[onclick] { cursor: pointer; }
table.rows tbody tr[onclick]:hover { background: var(--panel-2); }
table.tight td, table.tight th { padding: .45rem .5rem; }
table.rows tr.total td { border-top: 1px solid var(--rule); border-bottom: 0; }
.rows { overflow-x: auto; display: block; }
@media (min-width: 600px) { .rows { display: table; } }

.badge { font-size: .74rem; padding: .22rem .6rem; border-radius: 999px; font-weight: 600; white-space: nowrap; }
.badge.draft { background: #2b343d; color: var(--ink-2); }
.badge.processing { background: rgba(245,165,36,.16); color: var(--amber); }
.badge.completed { background: rgba(76,169,107,.16); color: var(--ok); }
.badge.failed { background: rgba(226,96,63,.16); color: var(--brick); }

.conf { font-size: .74rem; font-weight: 600; }
.conf.confirmed, .conf.ok, .conf.succeeded { color: var(--ok); }
.conf.estimated, .conf.running { color: var(--amber); }
.conf.undetermined, .conf.failed { color: var(--brick); }

.figures { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); margin: 0; }
.figures dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); }
.figures dd { margin: .2rem 0 0; font-size: 1.15rem; font-family: var(--mono); color: var(--ink); }

.note { border-left: 3px solid var(--rule); background: var(--panel); padding: .8rem 1rem; border-radius: 0 8px 8px 0; font-size: .88rem; margin-bottom: 1rem; }
.note b { display: block; margin-bottom: .15rem; }
.note.working { border-color: var(--amber); }
.note.warn { border-color: var(--amber); color: var(--ink-2); }
.note.bad { border-color: var(--brick); color: var(--ink-2); }

.thumbs, .frames { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
.thumbs img, .frames img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; border: 1px solid var(--rule); display: block; }
.frames figure { margin: 0; }
.frames figcaption { font-size: .7rem; color: var(--ink-3); margin-top: .2rem; text-align: center; }

ul.plain { margin: 0; padding-left: 1.1rem; }
ul.plain li { margin-bottom: .5rem; }
code { font-family: var(--mono); font-size: .88em; color: var(--ink); }

/* Why an agent failed. Monospace because it is usually a provider's error
   body, and wrapped because those are long and the useful part is rarely at
   the front. */
.agent-error {
  margin-top: .35rem; padding: .45rem .55rem;
  background: rgba(226, 96, 63, .1); border-left: 2px solid var(--brick);
  border-radius: 0 5px 5px 0;
  font-family: var(--mono); font-size: .72rem; line-height: 1.45;
  color: var(--ink-2); word-break: break-word; max-height: 11rem; overflow-y: auto;
}
.tiny { font-size: .68rem; color: var(--ink-3); }

/* The customer's capture page. Not the console: one column, big targets,
   and nothing to read before the camera opens. */
.capture { max-width: 34rem; margin: 0 auto; padding: 1rem 0 3rem; }
.capture h1 { font-size: 1.5rem; margin: 0 0 .4rem; letter-spacing: -.02em; }
.capture .lede { color: var(--ink-2); font-size: 1rem; margin: 0 0 1.4rem; }
.capture-actions { display: grid; gap: .7rem; }
.btn.big { padding: 1.05rem; font-size: 1.05rem; justify-content: center; text-align: center; display: block; }
.bar { height: 6px; background: var(--panel-2); border-radius: 3px; overflow: hidden; margin-top: .6rem; }
.bar-fill { height: 100%; width: 0; background: var(--teal); transition: width .2s; }
.capture .thumbs { margin-top: 1.1rem; }
.capture h2.ok { color: var(--ok); font-size: 1.3rem; margin: 1.5rem 0 .4rem; }

/* Sign in / sign up. One column, centred, no chrome. */
.auth { max-width: 26rem; margin: 3rem auto; padding: 0 1rem 3rem; }
.auth-brand { font-size: 1.35rem; font-weight: 600; margin-bottom: .3rem; }
.auth-brand b { color: var(--teal); }
.auth .card { margin-top: 1.2rem; display: flex; flex-direction: column; gap: .85rem; }
.auth h2 { font-size: .78rem; }
pre.key {
  background: var(--panel-2); border: 1px solid var(--rule); border-radius: 7px;
  padding: .8rem; font-family: var(--mono); font-size: .8rem; white-space: pre-wrap;
  word-break: break-all; color: var(--teal); margin: .6rem 0 0;
}
.btn.btn-sm { padding: .3rem .6rem; font-size: .78rem; }

/* Settings: a stack of integration cards under plain section headings. */
.sub-head { font-size: .78rem; text-transform: uppercase; letter-spacing: .09em;
  color: var(--ink-3); margin: 1.8rem 0 .7rem; }
.integration .conf { font-size: .72rem; }
.integration-form label { font-size: .82rem; }

/* ---- settings tabs ------------------------------------------------------
   Links, not buttons: each tab is a real URL, so it can be bookmarked, sent
   to a colleague, and opened in a new window, and the back button does what
   a back button should. */
.tabs {
  display: flex; gap: .25rem; margin: 0 0 1.25rem; overflow-x: auto;
  border-bottom: 1px solid var(--rule); padding-bottom: 0;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  color: var(--ink-2); font-size: .88rem; font-weight: 500; white-space: nowrap;
  padding: .55rem .85rem; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.on { color: var(--ink); border-bottom-color: var(--teal); }

/* ---- appearance ---------------------------------------------------------- */
.theme-choices { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.theme-choice {
  flex-direction: row; align-items: center; gap: .6rem; cursor: pointer;
  border: 1px solid var(--rule); border-radius: 9px; padding: .7rem .8rem;
  background: var(--panel-2); color: var(--ink-2); font-size: .88rem;
}
.theme-choice.on { border-color: var(--teal); color: var(--ink); }
.theme-choice input { width: auto; }
.theme-choice .swatch { width: 1.5rem; height: 1.5rem; border-radius: 5px; border: 1px solid var(--rule); flex: 0 0 auto; }
.swatch-dark { background: #12161a; }
.swatch-light { background: #f4f6f8; }
.swatch-system { background: linear-gradient(135deg, #f4f6f8 0 50%, #12161a 50% 100%); }

.accents { display: flex; gap: .6rem; flex-wrap: wrap; }
.accent { cursor: pointer; padding: 0; }
.accent input { position: absolute; opacity: 0; width: 0; height: 0; }
.accent > span {
  display: block; width: 2rem; height: 2rem; border-radius: 50%;
  border: 2px solid transparent; box-shadow: 0 0 0 1px var(--rule) inset;
}
.accent.on > span { border-color: var(--ink); }
.accent input:focus-visible + span { outline: 2px solid var(--teal); outline-offset: 2px; }

/* ---- light theme --------------------------------------------------------
   Same tokens, different values, so nothing below this point needs a second
   rule. `system` sends no data-theme attribute, which is what lets the
   media query decide; an explicit choice wins over the device either way. */
:root[data-theme="light"],
:root:not([data-theme="dark"]):not([data-theme="light"]) {
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f4f6f8; --panel: #ffffff; --panel-2: #eef1f4; --rule: #d8dee4;
    --ink: #121820; --ink-2: #54616d; --ink-3: #78848f;
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f4f6f8; --panel: #ffffff; --panel-2: #eef1f4; --rule: #d8dee4;
  --ink: #121820; --ink-2: #54616d; --ink-3: #78848f;
  color-scheme: light;
}
