/* Keyrenter Denver — Maintenance Estimates. Design tokens from the design bundle README. */
:root {
  --green: #2F7A16;
  --green-dark: #1E5410;
  --green-bright: #8CC63F;
  --green-tint: #EDF6E0;
  --green-border: #D6E9BE;
  --ink: #16190F;
  --body: #3A3F30;
  --secondary: #565B4C;
  --muted: #8A907C;
  --muted-2: #9AA08B;
  --page: #F3F5EF;
  --card: #fff;
  --input-tint: #F9FCF5;
  --fill: #EEF1EA;
  --border: #E3E7DB;
  --hairline: #EDF0E8;
  --amber: #B54708;
  --amber-bg: #FEF3EA;
  --amber-border: #F0C99B;
  --red: #B42318;
  --red-dot: #E5484D;
  --red-bg: #FEE4E2;
  --blue: #175CD3;
  --blue-bg: #E6F0FF;
  --disabled: #B9C2AB;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: Lora, "New York", "Iowan Old Style", Georgia, serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--page);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
  min-height: 100dvh;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
[hidden] { display: none !important; }
.spacer { flex: 1; }

@keyframes krIn { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes krPop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }
@keyframes krBlink { 0%, 100% { opacity: 1; } 50% { opacity: .2; } }
@keyframes krPulse { 0% { transform: scale(1); opacity: .5; } 70% { transform: scale(1.6); opacity: 0; } 100% { opacity: 0; } }
@keyframes krSpin { to { transform: rotate(360deg); } }

.screen { min-height: 100vh; min-height: 100dvh; max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; }

/* ---------- launcher ---------- */
.launcher { padding: calc(64px + var(--safe-top)) 24px calc(28px + var(--safe-bottom)); }
.wordmark { text-align: center; margin-bottom: 24px; }
.wordmark-name { font-size: 34px; font-weight: 800; letter-spacing: -.02em; color: var(--green); line-height: 1; }
.wordmark-name span { display: block; font-size: 15px; letter-spacing: .32em; text-transform: uppercase; color: var(--ink); font-weight: 700; margin-top: 6px; }
.wordmark-sub { font-size: 15px; color: var(--secondary); font-weight: 500; margin-top: 14px; }
.install-hint { display: flex; align-items: center; gap: 11px; background: var(--green-tint); border: 1px solid var(--green-border); border-radius: 14px; padding: 12px 14px; margin-bottom: 24px; color: var(--green); }
.install-hint span { font-size: 13px; color: var(--body); font-weight: 600; line-height: 1.35; }
.install-hint svg { flex-shrink: 0; }
.role-card { display: flex; align-items: center; gap: 16px; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--border); border-radius: 22px; padding: 24px; box-shadow: 0 1px 2px rgba(20,25,15,.04); transition: border-color .15s, box-shadow .15s; }
.role-card:active { border-color: var(--green-bright); box-shadow: 0 8px 24px rgba(47,122,22,.12); }
.role-icon { width: 56px; height: 56px; border-radius: 16px; background: var(--green-tint); color: var(--green); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.role-text { flex: 1; display: flex; flex-direction: column; }
.role-title { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.role-sub { font-size: 14px; color: var(--secondary); line-height: 1.35; margin-top: 3px; }
.chev { color: #B5BBAA; flex-shrink: 0; }
.waiting-pill { display: flex; align-items: center; gap: 10px; width: 100%; background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 13px 16px; margin-bottom: 8px; font-size: 14px; font-weight: 700; text-align: left; }
.waiting-pill .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--red-dot); flex-shrink: 0; }
.waiting-pill .link { color: var(--green); font-size: 13px; }
.text-link { display: block; width: 100%; text-align: center; padding: 14px; font-size: 15px; font-weight: 600; color: var(--secondary); }
.text-link.strong { color: var(--green); font-weight: 700; }
.footnote { text-align: center; font-size: 12px; color: var(--muted-2); font-weight: 500; }

/* ---------- shared chrome ---------- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: calc(12px + var(--safe-top)) 16px 12px; background: rgba(243,245,239,.92); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid #E9ECE2; }
.topbar-title { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.icon-btn { position: relative; width: 44px; height: 44px; border-radius: 12px; background: var(--card); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; color: var(--ink); flex-shrink: 0; }
.badge { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red-dot); color: #fff; font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.net-pill { display: inline-flex; align-items: center; gap: 6px; padding: 8px 11px; border-radius: 11px; font-size: 12px; font-weight: 700; background: var(--green-tint); color: var(--green); }
.net-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.net-pill.offline { background: #FDECEC; color: var(--red); }
.content { flex: 1; padding: 18px 16px calc(150px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 22px; }
.section-label { font-size: 12px; font-weight: 800; letter-spacing: .06em; color: var(--green); margin-bottom: 8px; }
.label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.muted-small { font-size: 12px; color: var(--muted-2); font-weight: 600; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; }
.bottombar { position: sticky; bottom: 0; z-index: 20; padding: 12px 16px calc(16px + var(--safe-bottom)); background: rgba(243,245,239,.94); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-top: 1px solid #E9ECE2; }
.bar-foot { text-align: center; font-size: 12px; color: var(--muted-2); font-weight: 500; margin-top: 8px; }
.primary-btn { width: 100%; height: 58px; border-radius: 16px; background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 17px; font-weight: 700; box-shadow: 0 8px 20px rgba(47,122,22,.24); transition: background .15s; }
.primary-btn.big { height: 60px; font-size: 18px; }
.primary-btn:disabled { background: var(--disabled); box-shadow: none; cursor: default; }

/* ---------- tech capture ---------- */
.work-order { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field-label { font-size: 12px; font-weight: 700; color: var(--muted); }
.field-label em { font-style: normal; font-weight: 600; color: var(--muted-2); margin-left: 4px; }
.field input { width: 100%; min-width: 0; height: 46px; border: 1px solid var(--border); border-radius: 12px; background: var(--input-tint); padding: 0 12px; font-size: 17px; font-weight: 600; outline: none; }
.field input:focus { border-color: var(--green); border-width: 1.5px; }
.field input.invalid { border-color: var(--red-dot); }
#f-address { font-size: 18px; font-weight: 700; }
#f-meld { font-family: var(--mono); letter-spacing: .05em; text-transform: uppercase; }
#f-meld::placeholder { font-family: var(--sans); letter-spacing: 0; text-transform: none; }
.field-row { display: flex; gap: 10px; }
.field-row .meld { flex: 1 1 45%; }
.field-row .tech-name { flex: 1 1 55%; }
.field-hint { font-size: 12px; color: var(--muted-2); font-weight: 500; line-height: 1.35; }

.dictate { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 4px 0; }
.mic-btn { position: relative; width: 116px; height: 116px; border-radius: 50%; background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 26px rgba(47,122,22,.28); }
.mic-btn.active::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--green-bright); z-index: -1; animation: krPulse 1.6s ease-out infinite; }
.dictate-status { font-size: 15px; color: var(--secondary); font-weight: 600; }
.dictate-hint { font-size: 12px; color: var(--muted-2); font-weight: 500; text-align: center; max-width: 290px; line-height: 1.4; }
.dictate-hint b { color: var(--secondary); }
.mic-btn.active ~ .dictate-hint { visibility: hidden; }

textarea { width: 100%; resize: vertical; border: 1px solid var(--border); border-radius: 16px; background: var(--card); color: var(--ink); outline: none; line-height: 1.5; }
textarea:focus { border-color: var(--green); }
.big-text { min-height: 150px; padding: 16px; font-size: 17px; }
.note-text { min-height: 82px; padding: 14px 16px; font-size: 16px; }

.photo-strip { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.photo-strip::-webkit-scrollbar { display: none; }
.photo-add { position: relative; flex-shrink: 0; width: 104px; height: 132px; border-radius: 14px; border: 1.5px dashed #C4CAB6; background: var(--card); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--green); font-size: 13px; font-weight: 700; cursor: pointer; }
.photo-add.secondary { width: 84px; color: var(--secondary); }
.photo-add input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.photo-list { display: flex; gap: 10px; }
.photo { position: relative; flex-shrink: 0; width: 104px; height: 132px; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); background: var(--fill); animation: krIn .28s ease-out; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo .num { position: absolute; left: 6px; bottom: 6px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 7px; background: rgba(22,25,15,.82); color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.photo .remove { position: absolute; top: 5px; right: 5px; width: 28px; height: 28px; border-radius: 50%; background: rgba(22,25,15,.72); color: #fff; display: flex; align-items: center; justify-content: center; }
.photo.pending { display: flex; align-items: center; justify-content: center; }
.photo.pending::after { content: ""; width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--green); animation: krSpin .8s linear infinite; }
.photo-error { margin-top: 8px; font-size: 13px; color: var(--red); font-weight: 600; }
.submit-helper { text-align: center; font-size: 12px; font-weight: 700; color: var(--red); margin-bottom: 8px; }

/* ---------- confirm ---------- */
.confirm { align-items: center; text-align: center; padding: calc(96px + var(--safe-top)) 26px calc(24px + var(--safe-bottom)); }
.confirm-icon { width: 96px; height: 96px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; animation: krPop .45s ease-out; background: var(--green); box-shadow: 0 14px 34px rgba(47,122,22,.3); }
.confirm-icon.amber { background: var(--amber); box-shadow: 0 14px 34px rgba(181,71,8,.26); }
.confirm-icon.blue { background: var(--blue); box-shadow: 0 14px 34px rgba(23,92,211,.24); }
.confirm-icon.red { background: var(--red); box-shadow: 0 14px 34px rgba(180,35,24,.26); }
.confirm-icon .spin { width: 40px; height: 40px; border-radius: 50%; border: 4px solid rgba(255,255,255,.35); border-top-color: #fff; animation: krSpin .9s linear infinite; }
.serif { font-family: var(--serif); font-size: 27px; font-weight: 700; letter-spacing: -.01em; margin: 24px 0 0; line-height: 1.2; }
.confirm-msg { font-size: 16px; color: var(--secondary); line-height: 1.5; margin: 10px 0 0; max-width: 320px; }
.summary { width: 100%; padding: 6px 18px; margin-top: 28px; text-align: left; }
.summary-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--fill); font-size: 15px; }
.summary-row:last-child { border-bottom: 0; }
.summary-row span { color: var(--secondary); flex-shrink: 0; }
.summary-row b { text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.confirm .primary-btn { margin-top: 28px; }

/* ---------- queue ---------- */
.lead { font-size: 14px; color: var(--secondary); line-height: 1.4; font-weight: 500; margin: 0; }
.job-list { display: flex; flex-direction: column; gap: 12px; }
.job { background: var(--card); border: 1px solid var(--border); border-left: 4px solid var(--c, #C4CAB6); border-radius: 16px; padding: 15px 16px; animation: krIn .24s ease-out; }
.job-top { display: flex; align-items: flex-start; gap: 10px; }
.job-main { flex: 1; min-width: 0; }
.job-addr { font-size: 16px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.job-meld { font-family: var(--mono); font-size: 13px; font-weight: 700; letter-spacing: .04em; color: var(--secondary); margin-top: 3px; }
.job-meld.none { font-family: var(--sans); letter-spacing: 0; font-weight: 600; color: var(--amber); }
.job-meta { font-size: 13px; color: var(--muted); margin-top: 3px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; padding: 6px 10px; border-radius: 9px; white-space: nowrap; flex-shrink: 0; }
.chip.queued { background: #EDF0E8; color: var(--secondary); }
.chip.syncing { background: var(--blue-bg); color: var(--blue); }
.chip.syncing::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: krBlink 1s infinite; }
.chip.sent { background: var(--green-tint); color: var(--green); }
.chip.failed { background: var(--red-bg); color: var(--red); }
.job-note { margin-top: 10px; font-size: 13px; line-height: 1.42; color: var(--secondary); }
.job-error { margin-top: 11px; background: #FEF3F2; border-radius: 11px; padding: 11px 12px; font-size: 13px; line-height: 1.42; color: var(--red); }
.danger-btn { margin-top: 10px; width: 100%; height: 48px; border-radius: 12px; background: var(--red); color: #fff; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 15px; font-weight: 700; }
.job-actions { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 10px; }
.mini-link { font-size: 13px; font-weight: 700; color: var(--muted); padding: 4px 0; }
.mini-link.green { color: var(--green); }
.empty { text-align: center; color: var(--muted-2); font-size: 14px; font-weight: 600; padding: 44px 0; }

/* ---------- toast / update ---------- */
.toast { position: fixed; left: 50%; bottom: calc(118px + var(--safe-bottom)); transform: translateX(-50%); z-index: 50; animation: krIn .24s ease-out; background: var(--ink); color: #fff; font-size: 14px; font-weight: 600; padding: 11px 18px; border-radius: 12px; box-shadow: 0 10px 28px rgba(0,0,0,.28); max-width: calc(100vw - 40px); text-align: center; }
.update-banner { position: fixed; top: calc(8px + var(--safe-top)); left: 50%; transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 12px; background: var(--ink); color: #fff; font-size: 14px; font-weight: 600; padding: 8px 8px 8px 16px; border-radius: 14px; box-shadow: 0 10px 28px rgba(0,0,0,.28); white-space: nowrap; }
.update-banner button { background: var(--green-bright); color: var(--ink); font-weight: 800; padding: 8px 12px; border-radius: 10px; }

@media (min-width: 600px) {
  body { background: radial-gradient(120% 120% at 50% 0%, #fbfcf9 0%, #eef1e8 55%, #e6ebdd 100%) fixed; }
}
