/* Contractor app styles, adapted from voice-estimates-mockup.html. Colors and fonts: tokens.css. */

* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--f-body);
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}
input {
  font: inherit;
  color: var(--ink);
}
h1,
h2,
p {
  margin: 0;
}
:focus-visible {
  outline: 3px solid var(--sky);
  outline-offset: 2px;
}
.num {
  font-variant-numeric: tabular-nums;
}
svg.i {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

/* ---------- Top bar ---------- */

body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 10;
  background: var(--nav);
}
.top {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px max(16px, env(safe-area-inset-right, 0px)) 10px
    max(16px, env(safe-area-inset-left, 0px));
  background: var(--nav);
  color: var(--nav-ink);
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.01em;
}
.logo b {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--sky);
  color: #14303b;
  display: inline-grid;
  place-items: center;
  font-size: 14px;
}
.top-btn {
  margin-left: auto;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--nav-ink-2);
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 600;
}

/* ---------- Page ---------- */

.app {
  flex: 1;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 18px max(18px, env(safe-area-inset-right, 0px))
    calc(24px + env(safe-area-inset-bottom, 0px)) max(18px, env(safe-area-inset-left, 0px));
  display: flex;
  flex-direction: column;
}
.scr {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.h2 {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 22px;
  line-height: 1.2;
}
.sub {
  color: var(--ink-2);
  font-size: 14px;
  margin-top: 4px;
}
.sec-t {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.field {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}
.primary {
  width: 100%;
  border: 0;
  border-radius: 14px;
  background: var(--brand);
  color: var(--brand-ink);
  padding: 15px;
  font-weight: 700;
  font-size: 16px;
}
.primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.ghost {
  display: block;
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  padding: 13px;
  font-weight: 600;
  text-align: center;
  color: var(--ink);
  text-decoration: none;
}
.err {
  color: var(--bad);
  font-size: 13px;
  font-weight: 600;
}

/* ---------- Home, lists and navigation ---------- */

a {
  color: inherit;
}
.hello {
  font-family: var(--f-display);
  font-size: 26px;
  font-weight: 600;
  line-height: 1.2;
}
.big {
  display: flex;
  align-items: center;
  gap: 16px;
  border-radius: 22px;
  background: var(--brand);
  color: var(--brand-ink);
  padding: 22px;
  text-decoration: none;
}
.big .ring {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--sky);
  color: #14303b;
  display: grid;
  place-items: center;
  flex: none;
}
.big .ring svg.i {
  width: 28px;
  height: 28px;
}
.big strong {
  display: block;
  font-family: var(--f-display);
  font-size: 20px;
  font-weight: 600;
}
.big small {
  opacity: 0.85;
  font-size: 14px;
}
.sec-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
}
.link {
  color: var(--sea);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
}
.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  text-decoration: none;
}
.row.top-aligned {
  align-items: flex-start;
}
.row .grow {
  flex: 1;
  min-width: 0;
}
.row b {
  display: block;
  font-weight: 600;
}
.row small {
  display: block;
  color: var(--ink-2);
  font-size: 13px;
}
.row .excerpt {
  margin-top: 4px;
  font-style: italic;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.row > svg.i {
  color: var(--ink-2);
}
.empty {
  padding: 18px 14px;
  border: 1.5px dashed var(--line);
  border-radius: 14px;
  color: var(--ink-2);
  font-size: 14px;
  text-align: center;
}
.list-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px;
  text-align: center;
}
.small-btn {
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
}
.skeleton {
  height: 66px;
  border-radius: 14px;
  background: var(--surface-2);
}
.skeleton-title {
  height: 28px;
  width: 60%;
  border-radius: 8px;
}
.chip.c-review {
  background: var(--sky-bg);
  color: var(--sea);
}
.chip.c-changes {
  background: var(--warn-bg);
  color: var(--warn);
}
.chip.c-approved {
  background: var(--ok-bg);
  color: var(--ok);
}
.chip.c-failed {
  background: var(--bad-bg);
  color: var(--bad);
}
.back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  align-self: flex-start;
  color: var(--sea);
  font-weight: 600;
  text-decoration: none;
}
.play {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
  border: 0;
  border-radius: 999px;
  background: var(--sky-bg);
  color: var(--sea);
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.play svg.i {
  width: 14px;
  height: 14px;
}
.play.on {
  background: var(--sea);
  color: var(--surface);
}
.play:disabled {
  opacity: 0.5;
  cursor: default;
}
.tabbar {
  position: fixed;
  inset: auto 0 0;
  z-index: 5;
  display: flex;
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px)
    env(safe-area-inset-left, 0px);
}
.tabbar a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 4px 12px;
  font-size: 12px;
  color: var(--ink-2);
  text-decoration: none;
}
.tabbar a[aria-current="page"] {
  color: var(--sea);
  font-weight: 700;
}
body.with-tabbar .app {
  padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
}

/* ---------- Recorder ---------- */

.recbox {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 24px 0 8px;
}
.wave {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 44px;
}
.wave i {
  width: 4px;
  height: 8px;
  border-radius: 2px;
  background: var(--line);
  transition: height 80ms linear;
}
.wave.live i {
  background: var(--rec);
}
.recbtn {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 6px solid var(--bad-bg);
  background: var(--rec);
  color: #fff;
  display: grid;
  place-items: center;
}
.recbtn svg.i {
  width: 38px;
  height: 38px;
}
.recbtn .sq {
  display: none;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: var(--rec);
}
.recbtn.on {
  background: var(--surface);
  border-color: var(--rec);
}
.recbtn.on svg.i {
  display: none;
}
.recbtn.on .sq {
  display: block;
}
.rectime {
  font-family: var(--f-mono);
  font-size: 22px;
}
.hint {
  font-size: 13px;
  color: var(--ink-2);
  text-align: center;
}
.limit {
  font-size: 13px;
  font-weight: 600;
  color: var(--warn);
  text-align: center;
}
.live-box {
  border-radius: 12px;
  background: var(--surface-2);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.live-text {
  font-size: 14px;
  white-space: pre-wrap;
}
.live-text .interim {
  color: var(--ink-2);
}

/* ---------- Processing ---------- */

.intro {
  margin-top: 30px;
}
.steps {
  list-style: none;
  margin: 0;
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.step {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--ink-2);
}
.step .b {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--line);
  display: grid;
  place-items: center;
  flex: none;
}
.step .b svg.i {
  width: 16px;
  height: 16px;
}
.step.done {
  color: var(--ink);
}
.step.done .b {
  background: var(--ok);
  border-color: var(--ok);
  color: var(--surface);
}
.step.now {
  color: var(--ink);
  font-weight: 600;
}
.step.now .b {
  border-color: var(--sea);
  border-top-color: transparent;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Error ---------- */

.badmark {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: var(--bad-bg);
  color: var(--bad);
  display: grid;
  place-items: center;
  align-self: center;
  margin-top: 30px;
}
.badmark svg.i {
  width: 42px;
  height: 42px;
}
.center {
  text-align: center;
}

/* ---------- Result ---------- */

.alerts {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--warn-bg);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.alerts.clear {
  background: var(--ok-bg);
}
.alerts ul {
  margin: 0;
  padding-left: 18px;
  font-size: 14px;
}
.lines {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.room-h {
  font-weight: 700;
  font-size: 14px;
  color: var(--ink-2);
  margin-top: 6px;
}
.line {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--surface);
}
.line.need {
  border-color: var(--warn);
  background: var(--warn-bg);
}
.line-top {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  justify-content: space-between;
}
.line-top b {
  font-weight: 600;
  line-height: 1.3;
}
.chip {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
  background: var(--warn-bg);
  color: var(--warn);
}
.line.need .chip {
  background: var(--surface);
}
.quote {
  font-size: 13px;
  color: var(--ink-2);
  font-style: italic;
}
.lowc,
.askmsg {
  font-size: 13px;
  font-weight: 600;
  color: var(--warn);
}
.lowc {
  font-size: 12px;
  font-weight: 700;
}
.fields {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 14px;
}
.val {
  min-width: 44px;
  padding: 5px 8px;
  border: 1.5px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  text-align: center;
}
.val.miss {
  border-color: var(--warn);
  color: var(--warn);
  font-weight: 700;
}
.fields .tot {
  margin-left: auto;
  font-weight: 700;
}
.transcript {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-2);
  white-space: pre-wrap;
}
.sendbar {
  position: sticky;
  bottom: 0;
  margin: 0 -18px calc(-24px - env(safe-area-inset-bottom, 0px));
  padding: 12px 18px calc(16px + env(safe-area-inset-bottom, 0px));
  background: var(--surface);
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sendbar .t {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.sendbar .t strong {
  font-family: var(--f-display);
  font-size: 22px;
}

@media (prefers-reduced-motion: reduce) {
  .wave i {
    transition: none;
  }
  .step.now .b {
    animation: none;
    border-top-color: var(--sea);
  }
}
