/* A.R. Household Repair app — colors taken from Alex's logo */
:root {
  --navy: #0a1228;
  --navy-2: #16234a;
  --red: #e2262b;
  --red-dk: #b81a1f;
  --yellow: #facc28;
  --orange: #f58c1e;
  --sky: #1478c8;
  --cream: #f8eed6;
  --paper: #f6f1e6;
  --card: #ffffff;
  --ink: #1a2238;
  --muted: #5d6680;
  --line: #e2dccd;
  --ok: #1f7a43;
  --radius: 16px;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
h1, h2, .btn, .brand span, .tile b, .hero-name { font-family: "Oswald", "Arial Narrow", system-ui, sans-serif; letter-spacing: .02em; }
h1 { font-size: 1.75rem; line-height: 1.15; margin: 0 0 .6rem; font-weight: 700; }
h2 { font-size: 1.2rem; margin: 1.6rem 0 .4rem; font-weight: 600; text-transform: uppercase; color: var(--navy-2); }
a { color: var(--sky); }

/* top bar */
.top { background: var(--navy); color: var(--cream); position: sticky; top: 0; z-index: 5; padding-top: env(safe-area-inset-top); }
.top-in { max-width: 720px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--cream); text-decoration: none; min-width: 0; }
.brand img { border-radius: 10px; flex: none; }
.brand span { font-weight: 600; font-size: 1.15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stripes { display: grid; grid-template-rows: 4px 4px 5px; }
.stripes i:nth-child(1) { background: var(--yellow); }
.stripes i:nth-child(2) { background: var(--orange); }
.stripes i:nth-child(3) { background: var(--red); }
.signout button { white-space: nowrap; background: none; border: 1px solid rgba(248,238,214,.35); color: var(--cream); border-radius: 10px; padding: 7px 12px; font: inherit; font-size: .9rem; cursor: pointer; }

.wrap { width: 100%; max-width: 720px; margin: 0 auto; padding: 18px 16px 32px; flex: 1; }
.foot { text-align: center; color: var(--muted); font-size: .75rem; padding: 0 0 calc(16px + env(safe-area-inset-bottom)); }

/* cards + forms */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 18px; margin: 0 0 16px; box-shadow: 0 1px 0 rgba(10,18,40,.04); }
.lead { font-size: 1.05rem; color: var(--ink); margin: 0 0 1rem; }
.hint { color: var(--muted); font-size: .88rem; font-weight: 400; }
.center { text-align: center; }
label { display: block; font-weight: 600; margin: 0 0 14px; }
input, select, textarea {
  display: block; width: 100%; margin-top: 6px;
  font: inherit; font-size: 1.05rem; color: var(--ink);
  padding: 13px 14px; min-height: 52px;
  border: 1.5px solid var(--line); border-radius: 12px; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--sky); box-shadow: 0 0 0 3px rgba(20,120,200,.18); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--red); color: #fff; border: 0; border-radius: 12px;
  font-size: 1.15rem; font-weight: 600; text-transform: uppercase; text-decoration: none;
  padding: 12px 20px; min-height: 52px; cursor: pointer;
  box-shadow: 0 3px 0 var(--red-dk);
}
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--red-dk); }
.btn.big { width: 100%; min-height: 58px; margin-top: 6px; }
.btn.ghost { background: #fff; color: var(--navy); border: 1.5px solid var(--line); box-shadow: none; }
.note { border-radius: 12px; padding: 12px 14px; margin: 0 0 14px; font-size: .97rem; }
.note.ok { background: #e7f5ec; color: var(--ok); border: 1px solid #bfe3cc; }
.note.bad { background: #fdecec; color: #9b1c1f; border: 1px solid #f3c2c3; }

/* sign-in hero: Alex's own logo art */
.hero { background: var(--navy); border-radius: var(--radius); overflow: hidden; margin: 0 0 16px; text-align: center; }
.hero img { display: block; width: 100%; height: auto; }
.hero-name { color: var(--cream); font-size: 1.5rem; font-weight: 700; text-transform: uppercase; padding: 8px 12px 12px; border-top: 4px solid var(--yellow); box-shadow: inset 0 4px 0 var(--orange); }

/* home */
.greet h1 { margin-bottom: 0; }
.today { color: var(--muted); margin: 2px 0 16px; }
.install-row { display: flex; gap: 14px; align-items: center; margin-bottom: 6px; }
.install-row img { border-radius: 14px; flex: none; }
.install-row p { margin: 2px 0 0; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile {
  position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 14px 14px; display: flex; flex-direction: column; gap: 2px; min-height: 132px;
  color: var(--ink); text-decoration: none;
}
.tile .ti { font-size: 1.8rem; line-height: 1; margin-bottom: 6px; }
.tile b { font-size: 1.2rem; font-weight: 600; text-transform: uppercase; }
.tile small { color: var(--muted); font-size: .85rem; line-height: 1.3; }
.tile.soon { opacity: .72; }
.tile .pill { margin-top: auto; align-self: flex-start; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; background: var(--paper); color: var(--muted); border-radius: 999px; padding: 3px 9px; margin-top: 10px; }
.tile .pill.next { background: var(--yellow); color: var(--navy); }
.tile.live { opacity: 1; border-color: #d4cbb5; box-shadow: 0 2px 0 rgba(10,18,40,.06); }
.tile.live:active { transform: translateY(1px); }
@media (min-width: 560px) { .tiles { grid-template-columns: repeat(4, 1fr); } }

/* shared bits */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.page-head h1 { margin: 0; }
.page-head .btn { min-height: 44px; padding: 8px 16px; font-size: 1rem; }
.btn.off, .btn:disabled { opacity: .4; pointer-events: none; box-shadow: none; }
.btn.danger { background: #fff; color: #9b1c1f; border: 1.5px solid #f3c2c3; box-shadow: none; }
.btn.danger:not(.ghost) { background: #9b1c1f; color: #fff; border: 0; }
.note.warn { background: #fff6dc; color: #7a5a00; border: 1px solid #f2dd9a; }
textarea { resize: vertical; min-height: 0; line-height: 1.4; }
.chips { display: flex; gap: 8px; margin: 0 0 14px; overflow-x: auto; }
.chip { padding: 7px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 600; font-size: .92rem; white-space: nowrap; }
.chip.on { background: var(--navy); color: var(--cream); border-color: var(--navy); }
.list { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 13px 14px; color: var(--ink); text-decoration: none; text-align: left; font: inherit; width: 100%; cursor: pointer; }
.row-main { display: flex; flex-direction: column; min-width: 0; }
.row-main b { font-size: 1.05rem; }
.row-main span { color: var(--muted); font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; color: var(--muted); font-size: 1.3rem; }
.row-side b { color: var(--ink); font-size: 1.02rem; }
.st { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; border-radius: 999px; padding: 3px 9px; white-space: nowrap; }
.st-draft { background: #eceae3; color: #5d6680; }
.st-sent { background: #e3effa; color: #13579a; }
.st-viewed { background: #e7f5ec; color: var(--ok); }
.st-expired { background: #fdecec; color: #9b1c1f; }
.empty { text-align: center; }
.searchbar input { margin: 0 0 12px; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.quick .btn { flex: 1 1 40%; min-height: 46px; font-size: 1rem; }

/* bid editor */
.line { border: 1.5px solid var(--line); border-radius: 14px; padding: 10px 12px 12px; margin: 0 0 12px; background: #fffdf8; }
.line.k-material { background: #f7fbff; }
.line-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.kind { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.line .x { background: none; border: 0; font-size: 1.2rem; color: var(--muted); padding: 4px 8px; cursor: pointer; }
.line textarea { margin-top: 0; }
.nums { display: none; gap: 10px; margin-top: 10px; }
.nums label { flex: 1; margin: 0; font-size: .85rem; }
.k-flat .nums-flat, .k-hours .nums-hours, .k-material .nums-material { display: flex; }
.line-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; margin-top: 8px; }
.line-foot .amt { margin-left: auto; font-size: 1.1rem; }
.elec { font-size: .82rem; color: #7a5a00; background: #fff6dc; border-radius: 8px; padding: 6px 8px; }
.add-row { display: flex; gap: 8px; flex-wrap: wrap; }
.add-row .btn { flex: 1 1 30%; min-height: 48px; font-size: .95rem; padding: 8px 10px; }
.totals .trow, .est-totals .trow { display: flex; justify-content: space-between; padding: 4px 0; }
.trow.grand { border-top: 2px solid var(--navy); margin-top: 6px; padding-top: 10px; font-size: 1.25rem; }
.trow.dep { color: var(--muted); font-size: .95rem; }
.meter { height: 8px; border-radius: 99px; background: #eceae3; overflow: hidden; margin-top: 12px; }
.meter i { display: block; height: 100%; width: 0; background: var(--ok); transition: width .2s; }
.totals.near .meter i { background: var(--orange); }
.totals.over .meter i { background: var(--red); }
.limit-msg { margin: 8px 0 0; font-size: .9rem; color: var(--muted); }
.totals.near .limit-msg { color: #7a5a00; font-weight: 600; }
.totals.over { border-color: #f3c2c3; background: #fffafa; }
.totals.over .limit-msg { color: #9b1c1f; font-weight: 600; }
.send-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.send-grid .btn { min-height: 52px; font-size: 1rem; padding: 8px 10px; }
.more { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 4px 0 90px; }
.more .btn { min-height: 44px; font-size: .95rem; }
.savebar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: var(--navy); color: var(--cream); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); box-shadow: 0 -4px 16px rgba(10,18,40,.2); }
.savebar .hint { color: rgba(248,238,214,.7); }
.savebar b { font-size: 1.25rem; font-family: "Oswald", "Arial Narrow", sans-serif; }
.savebar .btn { min-width: 130px; }
.savebar .btn.pulse { background: var(--yellow); color: var(--navy); box-shadow: 0 3px 0 #c9a10e; }

/* the client's estimate */
.owner-bar { display: flex; justify-content: space-between; align-items: center; background: var(--yellow); color: var(--navy); border-radius: 12px; padding: 10px 14px; margin: 0 0 12px; font-weight: 600; font-size: .92rem; }
.owner-bar a { color: var(--navy); }
.owner-bar span { font-weight: 400; font-size: .8rem; }
.estimate { padding: 22px 18px; }
.est-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; border-bottom: 2px solid var(--navy); padding-bottom: 10px; margin-bottom: 12px; }
.est-label { font-family: "Oswald", sans-serif; text-transform: uppercase; letter-spacing: .12em; color: var(--red); font-weight: 700; font-size: .9rem; }
.est-head h1 { margin: 0; }
.est-num { font-family: "Oswald", sans-serif; color: var(--muted); font-size: 1.1rem; white-space: nowrap; }
.est-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; font-size: .95rem; margin-bottom: 14px; }
.est-meta span { display: block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.est-scope { background: var(--paper); border-radius: 10px; padding: 12px 14px; margin: 0 0 14px; }
.est-lines { width: 100%; border-collapse: collapse; margin-bottom: 8px; }
.est-lines td { padding: 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.est-lines td small { display: block; color: var(--muted); font-size: .82rem; }
.est-lines td.num { text-align: right; white-space: nowrap; padding-left: 12px; font-weight: 600; }
.est-totals { margin: 6px 0 14px; }
.est-pay { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 14px; }
.est-pay div { background: #f7fbff; border: 1px solid #d6e6f5; border-radius: 12px; padding: 10px 12px; }
.est-pay span { display: block; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.est-pay b { font-size: 1.25rem; }
.est-pay small { display: block; color: var(--muted); font-size: .8rem; }
.contact { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
.contact .btn { min-height: 50px; font-size: 1rem; }
@media print {
  .top, .foot, .no-print, .owner-bar, .savebar { display: none !important; }
  body { background: #fff; }
  .card { border: 0; box-shadow: none; padding: 0; }
  .hero { border-radius: 0; }
}

/* ===== Step 4: agreements ===== */
.st-signed { background: #dff3e6; color: #17603a; }
.agree .terms { padding-left: 22px; margin: 14px 0; font-size: .95rem; }
.agree .terms li { margin-bottom: 8px; }
.cancel-box { border: 2px solid var(--navy); background: #fffaeb; border-radius: 12px; padding: 12px 14px; margin: 14px 0; font-size: 1rem; }
.cancel-box .cap, .notice .cap { display: block; font-family: "Oswald", sans-serif; letter-spacing: .04em; font-size: 1.05rem; }
.cancel-box p { margin: 8px 0 0; }
.notice { border: 1px dashed var(--line); border-radius: 12px; padding: 10px 14px; font-size: .9rem; }
.notice summary { cursor: pointer; font-weight: 600; color: var(--sky); }
.sigblock { margin-top: 16px; border-top: 2px solid var(--navy); padding-top: 10px; }
.sigblock img { display: block; max-width: 320px; width: 100%; height: auto; margin: 6px 0; }
.for-owner { background: #fff9e3; border-color: #f2dd9a; }
.say { margin: 4px 0 0; }
.sign-title { margin: 6px 0 12px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.check input { width: 26px; height: 26px; min-height: 0; margin: 2px 0 0; flex: none; }
.cancel-mini { font-size: .92rem; background: #fffaeb; border-left: 4px solid var(--navy); padding: 8px 10px; margin: 0 0 12px; border-radius: 6px; }
.sigpad-wrap { position: relative; border: 2px dashed #9aa3b8; border-radius: 14px; background: #fff; margin: 0 0 10px; }
#sigpad { display: block; width: 100%; height: 190px; touch-action: none; cursor: crosshair; }
.sigpad-hint { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); text-align: center; color: #9aa3b8; pointer-events: none; font-size: 1.05rem; }
.sigpad-wrap::after { content: ""; position: absolute; left: 18px; right: 18px; bottom: 44px; border-bottom: 1.5px solid #c9cfdc; pointer-events: none; }
.sigpad-clear { position: absolute; right: 8px; top: 8px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; font: inherit; font-size: .85rem; color: var(--muted); }
.done { text-align: center; }
.big-check { font-size: 3.2rem; line-height: 1; margin-bottom: 6px; }
.handback { font-family: "Oswald", sans-serif; font-size: 1.3rem; text-transform: uppercase; color: var(--red); margin: 14px 0 0; }
.kv { display: grid; gap: 10px; }
.kv span { display: block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.linkbtn { background: none; border: 0; color: var(--sky); font: inherit; font-size: .85rem; padding: 0; cursor: pointer; text-decoration: underline; }
.invite { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 4px; }
.todo-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: .97rem; }
.todo-item:last-child { border-bottom: 0; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .95rem; }
.feed li:last-child { border-bottom: 0; }
.feed .ft { display: flex; flex-direction: column; min-width: 0; }
.feed .ft a { color: var(--ink); text-decoration: none; }
.feed small { color: var(--muted); font-size: .8rem; }

/* ===== computer layout ===== */
.side { display: none; }
.only-computer { display: none; }
@media (min-width: 1000px) {
  .only-phone { display: none !important; }
  .only-computer { display: block; }
  body { display: grid; grid-template-columns: 230px 1fr; grid-template-rows: auto 1fr auto; }
  .top { grid-column: 1 / -1; }
  .top-in { max-width: none; padding: 10px 24px; }
  .side { display: flex; flex-direction: column; gap: 4px; padding: 20px 14px; border-right: 1px solid var(--line); background: #fbf8f1; position: sticky; top: 72px; height: calc(100vh - 72px); }
  .side-new { margin-bottom: 14px; min-height: 46px; font-size: 1rem; }
  .side-link { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 600; }
  .side-link:hover { background: #f1ebdc; }
  .side-link.on { background: var(--navy); color: var(--cream); }
  .side-me { margin-top: auto; color: var(--muted); font-size: .85rem; padding: 0 12px; }
  .wrap.with-side { max-width: 1180px; padding: 26px 32px 40px; margin: 0; }
  .wrap:not(.with-side) { grid-column: 1 / -1; }
  .foot { grid-column: 1 / -1; }
  .stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 0 0 16px; }
  .stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; color: var(--ink); text-decoration: none; display: flex; flex-direction: column; }
  .stat span { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
  .stat b { font-family: "Oswald", sans-serif; font-size: 2rem; font-weight: 600; margin: 4px 0 2px; }
  .stat small { color: var(--muted); }
  .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .tbl { width: 100%; border-collapse: collapse; font-size: .95rem; }
  .tbl th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 8px 10px; border-bottom: 2px solid var(--line); }
  .tbl td { padding: 10px; border-bottom: 1px solid var(--line); }
  .tbl tbody tr { cursor: pointer; }
  .tbl tbody tr:hover { background: #fbf8f1; }
  .tbl .num { text-align: right; white-space: nowrap; }
  .list .row:hover { border-color: #c9bfa6; }
  .savebar { left: 230px; }
  #bidform, .estimate, .signcard { max-width: 860px; }
  .send-grid { grid-template-columns: repeat(4, 1fr); }
  .kv { grid-template-columns: repeat(3, 1fr); }
}

/* ===== Step 5: hours, receipts, miles ===== */
.quick-acts { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.quick-acts .btn { flex-direction: column; gap: 2px; min-height: 64px; font-size: .95rem; padding: 8px 6px; }
.quick-acts .btn span { font-size: 1.4rem; line-height: 1; }
.running { border: 2px solid var(--ok); background: #f1faf4; display: flex; flex-direction: column; gap: 10px; }
.running .btn.big { margin-top: 0; }
.running .ticker { font-family: "Oswald", sans-serif; font-size: 1.15rem; color: var(--ok); }
.running form.center { margin: -2px 0 0; }
.head-btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.head-btns .btn { min-height: 44px; padding: 8px 14px; font-size: .95rem; }
.sumline { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; padding: 14px 18px; }
.sumline > span:first-child { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); width: 100%; }
.sumline b { font-family: "Oswald", sans-serif; font-size: 1.6rem; font-weight: 600; }
.sumline a { margin-left: auto; font-weight: 600; text-decoration: none; white-space: nowrap; }
.cats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; padding: 14px 18px; }
.cats div { display: flex; justify-content: space-between; gap: 8px; font-size: .95rem; border-bottom: 1px dashed var(--line); padding: 3px 0; }
.thumb { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; flex: none; background: var(--paper); border: 1px solid var(--line); }
.thumb.none { display: flex; align-items: center; justify-content: center; font-size: 1.4rem; }
.row .thumb + .row-main { margin-right: auto; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 12px; }
.two input { min-width: 0; }
.photo-pick { margin: 0 0 16px; text-align: center; }
.photo-pick img { display: block; max-width: 100%; max-height: 340px; margin: 0 auto 10px; border-radius: 12px; border: 1px solid var(--line); }
.camera { cursor: pointer; margin: 0; }
.note.now { background: #f1faf4; color: var(--ink); border: 1px solid #bfe3cc; }
.rates .row { cursor: default; padding: 10px 14px; }
.job-so-far .kv b { font-size: 1.1rem; }
.kv span.hint { display: inline; text-transform: none; letter-spacing: 0; font-size: .88rem; font-weight: 400; }
