/* Siteline Exterior app. Brand: navy #0C1520, gold #C4A35A, paper #F3EFE6, bronze #7D6224 (gold text on light). */
@font-face { font-family: 'Lora'; src: url('/fonts/Lora-Variable.ttf') format('truetype'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: 'Poppins'; src: url('/fonts/Poppins-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Poppins'; src: url('/fonts/Poppins-Medium.ttf') format('truetype'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Poppins'; src: url('/fonts/Poppins-Bold.ttf') format('truetype'); font-weight: 600 700; font-display: swap; }

:root {
  color-scheme: light;
  --navy: #0C1520; --navy-2: #16243A; --gold: #C4A35A; --bronze: #7D6224;
  --paper: #F3EFE6; --card: #FFFFFF; --ink: #0C1520; --muted: #5A6472; --line: #E2DCCF; --line-2: #CFC6B2;
  --good: #2E6B4F; --good-bg: #E4F0E8; --warn: #8A5A12; --warn-bg: #F7EBD3; --bad: #9B3B2B; --bad-bg: #F6E2DC;
  --info: #2D4A6E; --info-bg: #E3E9F1;
  --radius: 10px; --shadow: 0 1px 2px rgba(12,21,32,.06), 0 4px 14px -6px rgba(12,21,32,.14);
  --nav-h: 64px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { background: var(--paper); }
body { background: var(--paper); color: var(--ink); font: 15px/1.5 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
h1, h2, h3 { font-family: 'Lora', Georgia, serif; font-weight: 600; margin: 0; line-height: 1.2; text-wrap: balance; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1.02rem; }
p { margin: 0; }
a { color: var(--bronze); }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* ---------- shell ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--navy); color: var(--paper);
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px; display: flex; align-items: center; gap: 12px; }
.topbar img.logo { height: 34px; width: auto; }
.topbar .spacer { flex: 1; }
.topbar .who { font-size: .78rem; color: #AEB6C1; text-align: right; line-height: 1.25; }
.topbar .who b { color: var(--paper); font-weight: 500; display: block; }
.topbar .back { background: none; border: 0; color: var(--gold); font-weight: 500; padding: 6px 0; cursor: pointer; }
main { max-width: 760px; margin: 0 auto; padding: 18px 16px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 16px; }
main.wide { max-width: 1040px; }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--card); border-top: 1px solid var(--line);
  display: flex; padding-bottom: env(safe-area-inset-bottom, 0px); }
.tabbar a { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: var(--nav-h);
  text-decoration: none; color: var(--muted); font-size: .72rem; font-weight: 500; position: relative; }
.tabbar a svg { width: 22px; height: 22px; }
.tabbar a.on { color: var(--navy); }
.tabbar a.on::before { content: ''; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; background: var(--gold); border-radius: 0 0 3px 3px; }
.tabbar .dot { position: absolute; top: 9px; left: calc(50% + 7px); min-width: 17px; height: 17px; border-radius: 9px; background: var(--bad); color: #fff; font-size: .65rem; display: grid; place-items: center; padding: 0 4px; }
@media (min-width: 900px) {
  .tabbar { position: sticky; top: calc(54px + env(safe-area-inset-top, 0px)); bottom: auto; border-top: 0; border-bottom: 1px solid var(--line); justify-content: center; padding: 0; }
  .tabbar a { flex: 0 0 auto; flex-direction: row; height: 48px; padding: 0 18px; font-size: .88rem; gap: 8px; }
  .tabbar a svg { width: 18px; height: 18px; }
  .tabbar a.on::before { top: auto; bottom: 0; left: 12px; right: 12px; border-radius: 3px 3px 0 0; }
  .tabbar .dot { top: 6px; left: auto; right: 2px; }
  main { padding-bottom: 40px; }
}

/* ---------- building blocks ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; display: grid; gap: 12px; min-width: 0; }
.card.flat { box-shadow: none; }
.card.navy { background: var(--navy); color: var(--paper); border-color: var(--navy); }
.card.navy .muted { color: #AEB6C1; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.top { align-items: flex-start; }
.stack { display: grid; gap: 8px; min-width: 0; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.kicker { font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; color: var(--bronze); }
.card.navy .kicker { color: var(--gold); }
.big-date { font-family: 'Lora', Georgia, serif; font-size: 1.55rem; font-weight: 600; line-height: 1.15; }
.lede { color: var(--muted); max-width: 62ch; }
.divider { height: 1px; background: var(--line); }
.empty { color: var(--muted); font-size: .92rem; padding: 6px 0; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; text-decoration: none; color: inherit; display: block; }
.stat b { display: block; font-family: 'Lora', Georgia, serif; font-size: 1.6rem; font-weight: 600; line-height: 1.1; }
.stat span { font-size: .78rem; color: var(--muted); }
.stat.alert b { color: var(--bad); }

.list { display: grid; }
.item { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); text-decoration: none; color: inherit; min-width: 0; }
.item:first-child { border-top: 0; padding-top: 2px; }
.item .thumb { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; background: var(--paper); flex: none; }
.item .thumb.ph { display: grid; place-items: center; color: var(--line-2); }
.item .body { flex: 1; min-width: 0; }
.item .title { font-weight: 500; overflow-wrap: anywhere; }
.item .sub { font-size: .82rem; color: var(--muted); overflow-wrap: anywhere; }
.item .chev { color: var(--line-2); flex: none; }

.pill { display: inline-flex; align-items: center; gap: 5px; font-size: .72rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; background: #ECE8DE; color: var(--muted); }
.pill.good { background: var(--good-bg); color: var(--good); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.info { background: var(--info-bg); color: var(--info); }
.pill.gold { background: #F1E6CD; color: var(--bronze); }

/* ---------- buttons & forms ---------- */
.btn { appearance: none; border: 1px solid var(--navy); background: var(--navy); color: var(--paper); border-radius: 8px; padding: 11px 16px; font-weight: 500; font-size: .92rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; min-height: 44px; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: var(--navy); }
.btn.ghost { background: transparent; color: var(--navy); border-color: var(--line-2); }
.btn.danger { background: transparent; color: var(--bad); border-color: #E3C2B9; }
.btn.block { width: 100%; }
.btn.sm { padding: 6px 11px; min-height: 34px; font-size: .82rem; }
.btn:disabled { opacity: .5; cursor: default; }
.btn svg { width: 18px; height: 18px; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--bronze); text-decoration: underline; cursor: pointer; font-size: inherit; }

label.field { display: grid; gap: 5px; font-size: .84rem; font-weight: 500; color: var(--muted); }
.input, select.input, textarea.input { width: 100%; border: 1px solid var(--line-2); background: #fff; border-radius: 8px; padding: 10px 12px; font-size: 1rem; color: var(--ink); min-height: 44px; }
textarea.input { min-height: 90px; resize: vertical; }
.input:focus { outline: 2px solid var(--gold); outline-offset: 0; border-color: var(--gold); }
.form { display: grid; gap: 12px; }
.form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form .hint { font-size: .78rem; color: var(--muted); font-weight: 400; }
.check { display: flex; align-items: center; gap: 8px; font-size: .9rem; }
.check input { width: 18px; height: 18px; accent-color: var(--navy); }
.error { background: var(--bad-bg); color: var(--bad); border-radius: 8px; padding: 10px 12px; font-size: .88rem; }
.note { background: #F8F4EA; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: .88rem; }

/* segmented control */
.seg { display: inline-flex; background: #E9E4D8; border-radius: 9px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; padding: 7px 12px; border-radius: 7px; font-size: .82rem; font-weight: 500; color: var(--muted); cursor: pointer; }
.seg button.on { background: #fff; color: var(--navy); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* ---------- photos ---------- */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.photo { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: #E9E4D8; border: 0; padding: 0; cursor: pointer; }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo .tag { position: absolute; left: 6px; bottom: 6px; background: rgba(12,21,32,.78); color: var(--paper); font-size: .66rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; padding: 2px 7px; border-radius: 5px; }
.photo.uploading img { opacity: .45; }
.photo .bar { position: absolute; left: 8px; right: 8px; bottom: 8px; height: 5px; background: rgba(255,255,255,.7); border-radius: 3px; overflow: hidden; }
.photo .bar i { display: block; height: 100%; background: var(--gold); width: 0; transition: width .2s; }
.photo.failed { outline: 2px solid var(--bad); }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.compare h3 { font-family: 'Poppins', sans-serif; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--bronze); margin-bottom: 6px; }
.addphoto { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.addphoto label { display: flex; align-items: center; justify-content: center; gap: 8px; border: 1.5px dashed var(--line-2); border-radius: 10px; min-height: 64px; cursor: pointer; font-weight: 500; font-size: .9rem; background: #FBF9F4; text-align: center; padding: 8px; }
.addphoto label svg { width: 22px; height: 22px; color: var(--bronze); }
.addphoto input { position: absolute; opacity: 0; width: 1px; height: 1px; }

/* ---------- messages ---------- */
.thread { display: grid; gap: 10px; }
.msg { max-width: 86%; padding: 10px 12px; border-radius: 12px; background: #fff; border: 1px solid var(--line); }
.msg.mine { justify-self: end; background: var(--navy); color: var(--paper); border-color: var(--navy); }
.msg.internal { background: var(--warn-bg); border-color: #EBD7AE; }
.msg .meta { font-size: .72rem; color: var(--muted); margin-bottom: 3px; }
.msg.mine .meta { color: #AEB6C1; }
.msg .text { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- overlays ---------- */
.sheet-back { position: fixed; inset: 0; background: rgba(12,21,32,.5); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--paper); width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; border-radius: 16px 16px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 14px; }
@media (min-width: 700px) { .sheet-back { align-items: center; } .sheet { border-radius: 14px; } }
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(6,10,16,.94); display: flex; flex-direction: column; }
.lightbox img { flex: 1; min-height: 0; object-fit: contain; width: 100%; }
.lightbox .bar { display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 10px; color: var(--paper); }
.lightbox .cap { padding: 10px 16px calc(14px + env(safe-area-inset-bottom, 0px)); color: #D5D9DF; font-size: .9rem; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom, 0px)); z-index: 60; background: var(--navy); color: var(--paper); padding: 10px 16px; border-radius: 10px; font-size: .9rem; box-shadow: var(--shadow); max-width: calc(100% - 32px); }
.toast.bad { background: var(--bad); }

/* ---------- auth screens ---------- */
.auth { min-height: 100%; display: grid; place-items: center; padding: calc(24px + env(safe-area-inset-top, 0px)) 16px 24px; background: var(--navy); }
.auth .panel { width: 100%; max-width: 400px; display: grid; gap: 22px; }
.auth .panel > img { width: 190px; margin: 0 auto 6px; }
.auth .card { padding: 22px; }
.auth .foot { color: #AEB6C1; text-align: center; font-size: .8rem; }

.install { display: flex; gap: 12px; align-items: center; }
.install img { width: 44px; height: 44px; border-radius: 10px; flex: none; }
.timeline { display: grid; gap: 0; }
.timeline .step { display: flex; gap: 10px; align-items: center; font-size: .85rem; color: var(--muted); padding: 4px 0; }
.timeline .step i { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--line-2); flex: none; }
.timeline .step.done i { background: var(--good); border-color: var(--good); }
.timeline .step.now { color: var(--ink); font-weight: 500; }
.timeline .step.now i { border-color: var(--gold); background: var(--gold); }
.tablewrap { overflow-x: auto; }
table.t { border-collapse: collapse; width: 100%; font-size: .88rem; }
table.t th { text-align: left; font-weight: 500; color: var(--muted); font-size: .76rem; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.daygroup h3 { font-family: 'Poppins', sans-serif; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--bronze); margin: 4px 0 2px; }
.spin { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--gold); border-radius: 50%; animation: sp 0.8s linear infinite; margin: 30px auto; }
@keyframes sp { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 3s; } }
.banner-img { width: 100%; height: 170px; object-fit: cover; border-radius: 8px; background: #E9E4D8; }
a.card { text-decoration: none; color: inherit; }
.text { white-space: pre-wrap; overflow-wrap: anywhere; }
.item svg.chev { width: 20px; height: 20px; }
.item .thumb.ph svg { width: 24px; height: 24px; }
.btn.sm svg { width: 16px; height: 16px; }
.card.navy .divider { background: #2A3A52; }
