:root {
  --bg: #1a1a1a;
  --surface: #ffffff;
  --surface-2: #f4f4f5;
  --line: #d9d9de;
  --text: #1a1a1a;
  --muted: #6b6b72;
  --brand: #cc1b22;        /* BDE-style corporate red accent */
  --brand-dark: #a3141a;
  --blue: #2563eb;
  --green: #1e8a4c;
  --amber: #b45309;
  --red: #cc1b22;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0, 0, 0, .10), 0 1px 2px rgba(0, 0, 0, .06);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  background: var(--surface-2);
  color: var(--text);
  font-family: "Aptos", "Aptos Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}

/* ---------- App shell ---------- */
.app { max-width: 640px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; background: var(--surface-2); }

/* Home draws its own masthead, so the bar is hidden there. It must be display:
   none rather than the hidden attribute, because .topbar sets display:flex and
   would win. Content picks up the safe-area inset the bar was providing. */
body.home-view .topbar { display: none; }
body.home-view .content { padding-top: calc(16px + env(safe-area-inset-top)); }

.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--surface); color: var(--text);
  padding: env(safe-area-inset-top) 16px 0;
  display: flex; align-items: center; gap: 10px;
  min-height: calc(56px + env(safe-area-inset-top));
  border-bottom: 2px solid var(--brand);
}
.topbar .title { flex: 1; display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.bde-mark { font-weight: 800; font-style: italic; font-size: 22px; letter-spacing: -.01em; color: var(--text); flex: 0 0 auto; }
.bde-mark .e { color: var(--brand); }
#appTitle { font-weight: 600; font-size: 14px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar button { color: var(--text); }
.topbar-back { color: var(--brand); font-weight: 700; font-size: 15px; padding: 8px 10px 8px 6px; display: inline-flex; align-items: center; gap: 2px; }
.topbar-back:active { opacity: .6; }

.content { flex: 1; padding: 16px; padding-bottom: 96px; }

/* ---------- Buttons ---------- */
button {
  font: inherit; border: none; background: none; cursor: pointer;
  border-radius: 10px; padding: 10px 14px; display: inline-flex; align-items: center; gap: 8px; justify-content: center;
}
.btn { background: var(--surface); border: 1px solid var(--line); color: var(--text); box-shadow: var(--shadow); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; border: none; font-weight: 600; }
.btn-primary:active { background: var(--brand-dark); }
.btn-ghost { background: transparent; border: none; box-shadow: none; }
.btn-danger { color: var(--red); }
.btn-block { width: 100%; }
.btn-lg { padding: 14px 18px; font-size: 17px; }
.icon-btn { padding: 8px; border-radius: 999px; }

.fab {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(20px + env(safe-area-inset-bottom));
  background: var(--brand); color: #fff; font-weight: 600;
  padding: 14px 22px; border-radius: 999px; box-shadow: 0 6px 20px rgba(249,115,22,.45);
  z-index: 30; max-width: 608px; width: calc(100% - 32px);
}

/* ---------- Cards (flat, rule-based like the letterhead) ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: none; padding: 14px; margin-bottom: 10px; }
.card-tap { cursor: pointer; }
.card-tap:active { background: var(--surface-2); }
.card h3 { margin: 0 0 4px; font-size: 16px; font-weight: 700; }
.card .meta { color: var(--muted); font-size: 13px; }
.card-draft { border-left: 4px solid var(--amber, #c99800); background: #fffbf0; }
.card-draft .draft-cta { margin-top: 8px; font-size: 12px; font-weight: 700; color: #b45309; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.spacer { flex: 1; }
.stack > * + * { margin-top: 12px; }

/* ---------- Sign in (first page) ---------- */
.signin { max-width: 420px; margin: 0 auto; padding-top: 6vh; }
.signin-note { text-align: center; margin: 14px 4px 0; line-height: 1.5; }

/* The company the agent works for, introduced on the sign-in page. Client
   identity, not branding — the letterhead above it stays the product's. */
.company-block { text-align: center; padding: 14px 12px 16px; margin-bottom: 4px;
  border-bottom: 1px solid var(--line); }
.company-name { font-size: 15px; font-weight: 800; letter-spacing: .04em;
  text-transform: uppercase; color: var(--text); }
.company-line { font-size: 12.5px; color: var(--muted); margin-top: 4px; line-height: 1.45; }

/* ---------- Client bar (home, under the masthead) ---------- */
/* Whose account this is. Today it is the client the build was made for;
   when accounts arrive it becomes the signed-in identity. Deliberately not
   labelled "signed in as" while there is no sign-in. */
/* No card border and no red edge: the cards below it are tappable and this
   is not, so it must not borrow their look. */
.client-bar { display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 2px 12px 12px; margin: 0 0 14px;
  border-bottom: 1px solid var(--line); }
.client-bar-icon { font-size: 13px; line-height: 1; opacity: .75; }
.client-bar-name { flex: 1; text-align: center; font-size: 12px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Quiet, so it never competes with the actions below. */
.client-bar-out { flex: 0 0 auto; padding: 2px 6px; font-size: 11px; font-weight: 600;
  color: var(--muted); background: none; text-decoration: underline; }
.client-bar-out:active { opacity: .6; }

/* ---------- Letterhead masthead (home) ---------- */
.masthead { text-align: center; padding: 6px 0 10px; border-bottom: 1.5px solid var(--text); position: relative; margin-bottom: 18px; }
.masthead:has(+ .client-bar) { margin-bottom: 12px; }
.masthead::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 2px; background: var(--brand); }
.mast-mark { font-weight: 800; font-style: italic; font-size: 24px; letter-spacing: -.01em; color: var(--text); line-height: 1.1; }
.mast-mark .e { color: var(--brand); }
.mast-mark .mast-rest { font-style: normal; letter-spacing: .01em; }
.mast-sub { font-size: 8.5px; letter-spacing: .14em; color: var(--muted); margin-top: 3px; text-transform: uppercase; }

.home-prompt { font-size: 13px; color: var(--muted); margin: 0 2px 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }

/* ---------- Project groups (home) ---------- */
.project-group { margin-bottom: 18px; }
.project-header { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 2px 4px 8px; flex-wrap: wrap; }
.project-header[data-toggle] { cursor: pointer; }
.project-header-right { display: inline-flex; align-items: center; gap: 4px; }
.project-header-right .icon-btn { padding: 4px 6px; font-size: 17px; line-height: 1; }
.project-header-right .icon-btn:active { opacity: .5; }
.project-header[data-toggle]:active { opacity: .6; }
.project-name { font-weight: 700; font-size: 15px; }
.project-reports { border-left: 3px solid var(--brand); border-radius: 2px; padding-left: 12px; }
.project-reports .card { margin-bottom: 8px; }
.project-reports .card:last-child { margin-bottom: 0; }

/* Collapsed project = a stack of pages, latest on top */
.stacked { position: relative; margin-bottom: 16px; cursor: pointer; }
.stacked .stack-top { position: relative; z-index: 2; margin-bottom: 0; }
.stack-behind { position: absolute; left: 8px; right: 8px; top: 0; height: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.stack-behind.s1 { transform: translateY(7px); z-index: 1; }
.stack-behind.s2 { transform: translateY(14px); z-index: 0; opacity: .7; }
.empty { text-align: center; color: var(--muted); padding: 48px 20px; }
.empty .big { font-size: 40px; margin-bottom: 8px; }

/* ---------- Forms ---------- */
label.field { display: block; margin-bottom: 12px; }
label.field .lbl { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
input, textarea, select {
  width: 100%; font: inherit; color: var(--text);
  padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--brand); outline-offset: -1px; border-color: var(--brand); }
textarea { min-height: 76px; resize: vertical; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.progress-bar { height: 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; margin-top: 8px; }
.progress-fill { height: 100%; background: var(--brand); border-radius: 999px; transition: width .2s ease; }

/* ---------- Minutes rows ---------- */
.minute-row { border: 1px solid var(--line); border-left: 3px solid var(--brand); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; background: var(--surface); }
.minute-row .min-no { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--brand); }
.minute-row textarea { min-height: 46px; }
.minute-row .min-disc { min-height: 52px; }
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.field-grid label.field { margin-bottom: 0; }

/* ---------- Tabs (underline nav, document-style) ---------- */
.tabs { display: flex; gap: 0; background: var(--surface); border: none; border-bottom: 2px solid var(--line); border-radius: 0; padding: 0; margin: 0 0 16px; position: sticky; top: calc(56px + env(safe-area-inset-top)); z-index: 15; box-shadow: none; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.tabs::-webkit-scrollbar { display: none; }
/* Tabs grow to fill the bar when they fit; when there are too many (e.g. the
   History tab makes five), they keep their width and the bar scrolls sideways. */
.tabs button { flex: 1 0 auto; padding: 11px 14px; border-radius: 0; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; color: var(--muted); position: relative; border-bottom: 2px solid transparent; margin-bottom: -2px; white-space: nowrap; }
@media (max-width: 400px) { .tabs button { font-size: 11px; letter-spacing: 0; padding: 11px 6px; } .tabs .count { margin-left: 1px; } }
.tabs button.active { background: transparent; color: var(--brand); border-bottom-color: var(--brand); }
.tabs .count { font-size: 11px; opacity: .7; letter-spacing: 0; }

/* ---------- Badges / chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; }
.badge-open { background: #fef3c7; color: #92400e; }
.badge-progress { background: #dbeafe; color: #1e40af; }
.badge-done { background: #dcfce7; color: #166534; }
.badge-low { background: #e2e8f0; color: #334155; }
.badge-medium { background: #fef3c7; color: #92400e; }
.badge-high { background: #fee2e2; color: #991b1b; }

/* ---------- Photos ---------- */
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.thumb { position: relative; width: 76px; height: 76px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .x { position: absolute; top: 2px; right: 2px; background: rgba(15,23,42,.8); color: #fff; width: 22px; height: 22px; border-radius: 999px; padding: 0; font-size: 14px; }
.thumb .geo-pin { position: absolute; bottom: 2px; left: 2px; background: rgba(15,23,42,.7); border-radius: 999px; font-size: 11px; line-height: 1; padding: 2px 3px; }

/* ---------- Floor plans ---------- */
.plan-block { margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.plan-block:last-child { border-bottom: none; margin-bottom: 0; }
.plan-name { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; background: var(--surface); color: var(--text); }
.plan-wrap { position: relative; display: block; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface-2); touch-action: manipulation; cursor: crosshair; }
.plan-wrap img { width: 100%; display: block; }
.plan-pin { position: absolute; transform: translate(-50%, -50%); min-width: 24px; height: 24px; padding: 0 4px; border-radius: 999px; background: var(--brand, #cc1b22); color: #fff; font-size: 13px; font-weight: 800; line-height: 24px; text-align: center; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); cursor: pointer; }
.plan-legend { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.plan-leg { font-size: 13px; color: var(--text); display: flex; gap: 8px; align-items: flex-start; }
.plan-leg-n { flex: none; display: inline-block; min-width: 20px; height: 20px; border-radius: 999px; background: var(--brand, #cc1b22); color: #fff; font-size: 12px; font-weight: 800; line-height: 20px; text-align: center; }
.plan-arm { background: #fffbf0; border-left: 4px solid var(--amber, #c99800); font-size: 14px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }

/* Full-screen zoomable plan viewer (.overlay.plan-zoom beats .overlay) */
.overlay.plan-zoom { flex-direction: column; align-items: stretch; justify-content: flex-start;
  padding: 0; background: #0f172a; z-index: 90; }
.pz-top { display: flex; align-items: center; gap: 10px; padding: calc(8px + env(safe-area-inset-top)) 12px 8px; color: #fff; }
.pz-title { flex: 1; font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pz-zoom { display: flex; gap: 6px; }
.pz-btn { background: rgba(255,255,255,.14); color: #fff; width: 38px; height: 38px; border-radius: 10px; font-size: 20px; line-height: 1; padding: 0; }
.pz-vp { position: relative; flex: 1; overflow: hidden; touch-action: none; background: #0b1220; }
.pz-vp img { position: absolute; top: 0; left: 0; transform-origin: 0 0; will-change: transform; user-select: none; -webkit-user-drag: none; }
.pz-pin { position: absolute; transform: translate(-50%, -50%); z-index: 2; }
.pz-hint { color: #cbd5e1; font-size: 12px; text-align: center; padding: 6px 12px; }
.pz-actions { display: flex; gap: 10px; padding: 8px 12px calc(12px + env(safe-area-inset-bottom)); }
.pz-actions .btn, .pz-actions .btn-primary { flex: 1; }
.add-photo { width: 76px; height: 76px; border: 2px dashed var(--line); border-radius: 10px; color: var(--muted); font-size: 12px; flex-direction: column; gap: 2px; }
.add-photo .big { font-size: 22px; line-height: 1; }

/* ---------- Comments ---------- */
.comment { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; font-size: 14px; margin-top: 6px; }
.comment .when { color: var(--muted); font-size: 11px; }

/* ---------- Modal / sheet ---------- */
/* Pop-ups sit in the middle of the screen rather than against the bottom edge. */
.overlay { position: fixed; inset: 0; background: rgba(15,23,42,.55); z-index: 40;
  display: flex; align-items: center; justify-content: center; padding: 20px; }
/* .overlay-center is now what .overlay already does; kept so existing markup
   (and any half-remembered class name) still lands in the right place. */
.overlay-center { align-items: center; padding: 20px; }
/* Centred sheets are rounded all round, fit inside the padding, and have no
   drag grip — there is no bottom edge to drag them from. */
.overlay .sheet { border-radius: 16px; max-height: calc(100vh - 40px);
  padding-bottom: 20px; animation: dialogpop .16s ease-out; }
.overlay .sheet .grip { display: none; }

/* ---------- Dialog (centered confirm) ---------- */
.dialog { background: var(--surface); width: 100%; max-width: 380px; border-radius: 10px; border-top: 4px solid var(--brand); padding: 22px 20px 18px; box-shadow: 0 12px 44px rgba(0,0,0,.34); animation: dialogpop .16s ease-out; }
@keyframes dialogpop { from { transform: scale(.96); opacity: .5; } to { transform: none; opacity: 1; } }
.dialog-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.dialog-msg { font-size: 14px; color: var(--muted); margin: 0 0 18px; line-height: 1.5; }
.dialog-actions { display: flex; flex-direction: column; gap: 8px; }
.dialog-actions button { width: 100%; }
.dialog-actions #dlgDiscard { color: var(--brand); }
.sheet {
  background: var(--surface); width: 100%; max-width: 640px;
  border-radius: 20px 20px 0 0; max-height: 92vh; overflow-y: auto;
  padding: 8px 16px calc(20px + env(safe-area-inset-bottom));
  animation: slideup .18s ease-out;
}
@keyframes slideup { from { transform: translateY(30px); opacity: .6; } to { transform: none; opacity: 1; } }
.sheet .grip { width: 40px; height: 4px; background: var(--line); border-radius: 999px; margin: 8px auto 12px; }
.sheet h2 { margin: 0 0 14px; font-size: 19px; }
.sheet-actions { display: flex; gap: 10px; margin-top: 18px; position: sticky; bottom: 0; background: var(--surface); padding: 10px 0 0; }
.sheet-actions .btn, .sheet-actions .btn-primary { flex: 1; }

/* ---------- Signature ---------- */
.sigpad { width: 100%; height: 200px; background: #fff; border: 2px dashed var(--line); border-radius: 12px; touch-action: none; display: block; }
.sig-preview { width: 100%; max-width: 260px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.attendee-sign { display: flex; align-items: center; gap: 12px; }
.attendee-sign .info { flex: 1; }
.attendee-sign img { height: 48px; }

/* ---------- Type chooser ---------- */
.type-choice { width: 100%; display: flex; align-items: center; gap: 14px; text-align: left; padding: 15px; border: 1px solid var(--line); border-left: 3px solid var(--brand); border-radius: var(--radius); background: var(--surface); box-shadow: none; }
.type-choice:active { background: var(--surface-2); }
.type-choice .type-icon { font-size: 28px; line-height: 1; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; background: var(--surface-2); border-radius: 12px; flex: 0 0 auto; }
.type-choice .type-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.type-choice .type-text strong { font-size: 16px; }
.type-choice .type-arrow { font-size: 26px; color: var(--muted); }

/* ---------- Reference lookup ---------- */
.ref-matches { margin: -4px 0 12px; }
.ref-matches:empty { margin: 0; }
.ref-match { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px; text-align: left; padding: 10px 12px; margin-bottom: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); font-size: 14px; }
.ref-match:active { background: var(--line); }

/* ---------- Attendee sign row ---------- */
.attendee-sign-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 4px; }
.attendee-sign-row .sig-thumb { height: 40px; max-width: 180px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.attendee-sign-row .btn { padding: 8px 12px; }

/* ---------- Voice-to-text mic ---------- */
.field-with-mic { position: relative; }
.field-with-mic input, .field-with-mic textarea { padding-right: 46px; }
.mic-btn { position: absolute; top: 6px; right: 6px; width: 34px; height: 34px; padding: 0; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 16px; line-height: 1; }
.mic-btn:active { background: var(--line); }
.mic-btn.rec { background: var(--red); border-color: var(--red); animation: micpulse 1s infinite; }
.mic-btn.mic-off { opacity: .55; }
@keyframes micpulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,.5); } 50% { box-shadow: 0 0 0 6px rgba(220,38,38,0); } }

.hint { font-size: 13px; color: var(--muted); }
.section-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text); margin: 6px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--text); }

.toast { position: fixed; bottom: calc(90px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); background: var(--bg); color: #fff; padding: 12px 18px; border-radius: 999px; z-index: 60; box-shadow: var(--shadow); font-size: 14px; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.show { opacity: 1; }

/* Busy spinner shown while a report file is being prepared for sharing. */
.busy-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 80; display: flex; align-items: center; justify-content: center; }
.busy-overlay[hidden] { display: none; }
.busy-box { background: var(--surface); border-radius: 16px; padding: 24px 30px; display: flex; flex-direction: column; align-items: center; gap: 14px; box-shadow: var(--shadow); }
.busy-spinner { width: 40px; height: 40px; border: 4px solid var(--line); border-top-color: var(--brand, #cc1b22); border-radius: 50%; animation: busy-spin .8s linear infinite; }
.busy-label { font-size: 14px; font-weight: 600; color: var(--text); }
@keyframes busy-spin { to { transform: rotate(360deg); } }

/* TEST AID — grey screen number, top-right (remove for production) */
#scrTag { position: fixed; top: 6px; right: 8px; z-index: 9999; font: 700 12px/1.2 ui-monospace, Menlo, Consolas, monospace; color: #a0a0a8; background: rgba(255,255,255,.6); border-radius: 6px; padding: 1px 7px; pointer-events: none; }

/* Back / Next navigation through the report tabs */
.tab-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 22px; padding: 16px 0 6px; border-top: 1px solid var(--line); }
.tab-nav button { min-width: 120px; }

/* ---------- House banner (Details tab) ---------- */
/* The report's house is fixed once created, so it reads as a heading with a
   shortcut into the house record rather than as an editable field. */
.house-banner { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; margin-bottom: 12px; border-left: 3px solid var(--brand);
  background: var(--surface-2); border-radius: var(--radius); }
.house-banner .hint { margin-top: 2px; }

/* ---------- Tick box with an explanatory line (Details tab) ---------- */
.check-field { display: flex; align-items: flex-start; gap: 10px; padding: 10px 2px 2px;
  cursor: pointer; }
.check-field input[type="checkbox"] { width: 20px; height: 20px; margin: 1px 0 0;
  accent-color: var(--brand); flex: 0 0 auto; }
.check-field .check-text { display: block; font-size: 13px; }
.check-field .check-text .hint { display: block; margin-top: 2px; }

/* ---------- Search box (house lists) ---------- */
.search-input { width: 100%; margin-bottom: 12px; padding: 11px 12px; font-size: 15px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  color: var(--text); }
.search-input:focus { outline: none; border-color: var(--brand); }
.search-input::placeholder { color: var(--muted); }

/* ---------- Attached document row (rental agreement) ---------- */
.doc-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.doc-icon { font-size: 20px; flex: 0 0 auto; }
.doc-text { flex: 1; min-width: 0; font-size: 14px; }
.doc-text strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-text .hint { display: block; margin-top: 1px; }

/* ---------- Room list (house details) ---------- */
.room-row { gap: 8px; margin-bottom: 6px; align-items: center; }
.room-name { flex: 1; padding: 9px 10px; font-size: 14px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--surface); color: var(--text); }
.room-name:focus { outline: none; border-color: var(--brand); }

/* ---------- Condition by room ---------- */
.cond-progress { font-size: 13px; color: var(--muted); }
.cond-card { margin-bottom: 10px; }
.cond-head { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: 8px; font-size: 15px; }
/* Four taps across, so a room is rated without scrolling sideways on a phone. */
.cond-ratings { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.cond-btn { padding: 9px 4px; font-size: 12.5px; font-weight: 600; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface); color: var(--muted); }
.cond-btn.on { color: #fff; border-color: transparent; }
.cond-btn.on.badge-done { background: var(--green); }
.cond-btn.on.badge-medium { background: var(--amber); }
.cond-btn.on.badge-high { background: var(--brand); }
.cond-notes { width: 100%; margin-top: 8px; min-height: 56px; padding: 9px 10px; font-size: 14px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  color: var(--text); resize: vertical; }
.cond-notes:focus { outline: none; border-color: var(--brand); }
.cond-photos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.cond-photos:empty { margin-top: 0; }

/* ---------- Check-out comparison ---------- */
.cond-compare { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.cond-was { font-size: 12.5px; color: var(--muted); margin: -2px 0 8px; }
.cond-worse { color: var(--brand); font-weight: 700; margin-left: 6px; }

/* ---------- Deposit ---------- */
.ded-row { gap: 8px; margin-bottom: 6px; align-items: center; }
.ded-label { flex: 1; min-width: 0; }
.ded-amount { flex: 0 0 96px; text-align: right; }
.ded-label, .ded-amount { padding: 9px 10px; font-size: 14px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--surface); color: var(--text); }
.ded-label:focus, .ded-amount:focus { outline: none; border-color: var(--brand); }
.dep-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 6px 0; font-size: 14px; }
.dep-refund { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 10px; font-size: 15px; }
.dep-pos { color: var(--green); }
.dep-neg { color: var(--brand); }

/* ---------- Saved property location (house details) ---------- */
.geo-row { display: flex; align-items: center; gap: 8px; padding: 9px 10px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.geo-icon { font-size: 15px; line-height: 1; }
.geo-text { flex: 1; min-width: 0; font-size: 13px; }
.geo-text a { color: var(--brand); font-weight: 700; text-decoration: none; }
.geo-text .hint { display: block; margin-top: 1px; }

/* The two overall assessments that open the walk-through, set apart from the
   rooms below them. */
.cond-general { border-left: 3px solid var(--brand); }
.cond-general .cond-head strong { font-size: 14px; }

/* ---------- Inventory (furnished lets) ---------- */
.inv-area { margin-top: 14px; }
.inv-area-head { display: flex; justify-content: space-between; align-items: baseline;
  padding: 0 2px 6px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.inv-row { gap: 8px; margin-bottom: 6px; }
.inv-row .inv-name { flex: 1; min-width: 0; }
.inv-row .inv-qty { width: 68px; flex: 0 0 auto; text-align: center; }
.btn-sm { padding: 8px 10px; font-size: 13px; }

/* The check, on a report */
.inv-item { padding: 10px 0; border-bottom: 1px solid var(--line); }
.inv-item:last-child { border-bottom: 0; }
.inv-item-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.inv-item-head .inv-qty-txt { color: var(--muted); font-size: 13px; white-space: nowrap; }
.inv-states { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 7px; }
.inv-was { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.inv-was .inv-worse { color: var(--brand); font-weight: 700; margin-left: 6px; }
.inv-extra { display: flex; gap: 8px; margin-top: 7px; }
.inv-extra input { flex: 1; min-width: 0; }
.inv-extra .inv-found { width: 84px; flex: 0 0 auto; text-align: center; }

/* The pencil on the client bar: who is holding this phone. */
.link-btn {
  background: none; border: 0; padding: 2px 6px; cursor: pointer;
  font: inherit; font-size: 13px; color: var(--muted); line-height: 1;
}
.link-btn:hover { color: var(--brand); }
