/* Cedar and Stone design studio.
   Mobile first — this is used on a phone in someone's bathroom before it is
   ever used on a laptop. Every tap target is at least 44px. */

:root {
  --navy: #1e3a5f;
  --navy-deep: #15293f;
  --gold: #c49a2a;
  --gold-soft: #e6c76b;
  --ink: #26333f;
  --muted: #6a7885;
  --line: #e2e7ec;
  --bg: #f6f8fa;
  --card: #ffffff;
  --good: #1f7a52;
  --warn: #9a5b12;
  --shadow: 0 1px 2px rgba(30, 58, 95, .06), 0 8px 24px rgba(30, 58, 95, .07);
  --shadow-lift: 0 2px 4px rgba(30, 58, 95, .08), 0 18px 44px rgba(30, 58, 95, .14);
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3 { margin: 0 0 .35em; line-height: 1.2; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.28rem; }
h3 { font-size: 1.02rem; }
p { margin: 0 0 .8em; }
a { color: var(--navy); }

.muted { color: var(--muted); }
.small { font-size: .86rem; }
.tiny { font-size: .78rem; }
.center { text-align: center; }
.hide { display: none !important; }
.stack > * + * { margin-top: 12px; }

/* ----------------------------------------------------------------- shell */

.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px;
  background: var(--navy);
  color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .08);
}
.topbar .brand { font-weight: 700; letter-spacing: .02em; font-size: .98rem; }
.topbar .brand span { color: var(--gold-soft); font-weight: 500; }
.topbar .spacer { flex: 1; }
.topbar a, .topbar button.link {
  color: #cfe0f0; text-decoration: none; font-size: .88rem;
  background: none; border: 0; cursor: pointer; font-family: inherit;
}
.topbar a:hover, .topbar button.link:hover { color: #fff; }

.wrap { max-width: 720px; margin: 0 auto; padding: 20px 18px 120px; }
.wrap.wide { max-width: 1040px; }

/* --------------------------------------------------------------- steprail */

.steps {
  display: flex; flex-direction: column; gap: 10px; padding: 0 0 12px;
  background: #fff; border-bottom: 1px solid var(--line);
  position: sticky; top: 49px; z-index: 30;
}
.steps:empty { display: none; }

.prog { height: 3px; background: #eef2f6; }
.prog .fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--navy), var(--gold));
  transition: width .32s cubic-bezier(.22, .61, .36, 1);
}

.chapters {
  display: flex; gap: 6px; overflow-x: auto; padding: 0 18px;
  scrollbar-width: none;
}
.chapters::-webkit-scrollbar { display: none; }
.chapters .step { font: inherit; border: 1px solid transparent; }

.step {
  flex: 0 0 auto; display: flex; align-items: center; gap: 7px;
  padding: 7px 13px; border-radius: 999px;
  font-size: .82rem; font-weight: 550; white-space: nowrap;
  color: var(--muted); background: #f1f4f7; border: 1px solid transparent;
  cursor: pointer;
}
.step .dot {
  width: 19px; height: 19px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center;
  background: #d8dee5; color: #fff; font-size: .68rem; font-weight: 700;
}
.step.done { color: var(--good); background: #eaf5ef; }
.step.done .dot { background: var(--good); }
.step.active { color: #fff; background: var(--navy); border-color: var(--navy); }
.step.active .dot { background: var(--gold); color: var(--navy-deep); }

/* ------------------------------------------------------------------ cards */

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
}
.card + .card { margin-top: 16px; }
.card h2 { margin-bottom: 4px; }
.card .lead { color: var(--muted); margin-bottom: 18px; }

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 22px;
  border: 0; border-radius: 11px; cursor: pointer;
  font: inherit; font-weight: 600; letter-spacing: .01em;
  background: var(--navy); color: #fff;
  transition: transform .06s ease, box-shadow .16s ease, background .16s ease;
}
.btn:hover { background: var(--navy-deep); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.gold { background: var(--gold); color: #23303d; }
.btn.gold:hover { background: #b08a20; }
.btn.ghost { background: #fff; color: var(--navy); border: 1.5px solid var(--line); }
.btn.ghost:hover { border-color: var(--navy); background: #fff; }
.btn.full { width: 100%; }
.btn.sm { min-height: 38px; padding: 8px 14px; font-size: .86rem; border-radius: 9px; }

.btnrow { display: flex; gap: 10px; flex-wrap: wrap; }
.btnrow .btn { flex: 1 1 160px; }

.footbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}
.footbar .inner { max-width: 720px; margin: 0 auto; display: flex; gap: 10px; align-items: center; }
.footbar .price { font-weight: 700; font-size: 1.05rem; }

/* ----------------------------------------------------------------- fields */

label.field { display: block; margin-bottom: 16px; }
label.field .name { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 5px; }
label.field .hint { display: block; color: var(--muted); font-size: .8rem; margin-top: 4px; }

input[type=text], input[type=email], input[type=tel], input[type=number],
select, textarea {
  width: 100%; padding: 12px 14px; font: inherit; color: var(--ink);
  background: #fff; border: 1.5px solid var(--line); border-radius: 10px;
  min-height: 48px;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(30, 58, 95, .1);
}
textarea { min-height: 140px; resize: vertical; line-height: 1.55; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }

/* ----------------------------------------------------------------- photos */

.dropzone {
  display: block;
  border: 2px dashed #c9d3dc; border-radius: var(--radius);
  padding: 30px 20px; text-align: center; background: #fbfcfd; cursor: pointer;
}
.dropzone:hover, .dropzone.over { border-color: var(--navy); background: #f4f8fc; }
.dropzone .big { font-size: 1.05rem; font-weight: 600; margin-bottom: 3px; }

.photogrid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 10px; margin-top: 16px;
}
.photo {
  position: relative; aspect-ratio: 1; border-radius: 11px; overflow: hidden;
  background: #e8edf1; border: 1px solid var(--line);
}
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo button {
  position: absolute; top: 5px; right: 5px; width: 27px; height: 27px;
  border: 0; border-radius: 50%; cursor: pointer; font-size: 15px; line-height: 1;
  background: rgba(21, 41, 63, .78); color: #fff;
}

/* ---------------------------------------------------------- design boards */

.boards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.board {
  border: 2px solid var(--line); border-radius: var(--radius); overflow: hidden;
  background: #fff; cursor: pointer; text-align: left; padding: 0;
  font: inherit; color: inherit; transition: border-color .14s, box-shadow .14s, transform .14s;
}
.board:hover { border-color: #b9c6d2; transform: translateY(-2px); box-shadow: var(--shadow); }
.board.sel { border-color: var(--gold); box-shadow: var(--shadow-lift); }
.board .swatches { display: flex; height: 96px; }
.board .swatches i { flex: 1; display: block; }
.board .body { padding: 14px 16px 16px; }
.board .name { font-weight: 650; }
.board .tag { color: var(--gold); font-size: .8rem; font-weight: 600; margin-bottom: 6px; }
.board ul { margin: 10px 0 0; padding-left: 18px; font-size: .84rem; color: var(--muted); }
.board li { margin-bottom: 3px; }

.board .shot {
  display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover;
  animation: shotin .45s ease-out both;
}
@keyframes shotin { from { opacity: 0; } to { opacity: 1; } }

.seeit {
  display: block; width: 100%; margin-top: 12px; font: inherit;
  font-size: .84rem; font-weight: 600; color: var(--navy);
  background: #f2f6f9; border: 1px solid var(--line); border-radius: 9px;
  padding: 9px 10px; cursor: pointer; transition: background .14s;
}
.seeit:hover { background: #e6eef4; }
.seeit.working { color: var(--muted); cursor: progress; }
.seeit.working::after {
  content: ''; display: inline-block; width: 11px; height: 11px;
  margin-left: 8px; vertical-align: -1px; border-radius: 50%;
  border: 2px solid var(--line); border-top-color: var(--navy);
  animation: spin .7s linear infinite;
}

/* ------------------------------------------------------------------ tiers */

.tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.tier {
  position: relative; background: #fff; border: 2px solid var(--line);
  border-radius: var(--radius); padding: 22px 20px; cursor: pointer;
  text-align: left; font: inherit; color: inherit;
  transition: border-color .14s, box-shadow .14s, transform .14s;
}
.tier:hover { border-color: #b9c6d2; transform: translateY(-2px); }
.tier.sel { border-color: var(--navy); box-shadow: var(--shadow-lift); }
.tier.best { border-color: var(--gold); }
.tier.best.sel { border-color: var(--navy); }
.tier .flag {
  position: absolute; top: -11px; left: 20px;
  background: var(--gold); color: #23303d; font-size: .7rem; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px;
}
.tier .label { font-size: .82rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.tier .amount { font-size: 2rem; font-weight: 700; letter-spacing: -.02em; margin: 6px 0 2px; }
.tier .per { color: var(--muted); font-size: .86rem; }
.tier .note { margin-top: 12px; font-size: .88rem; color: var(--muted); }
.tier .pick { margin-top: 16px; }

.optiongrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.opt {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 13px 15px; border: 1.5px solid var(--line); border-radius: 11px;
  background: #fff; cursor: pointer;
}
.opt.on { border-color: var(--navy); background: #f5f9fd; }
.opt input { margin: 3px 0 0; width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--navy); }
.opt .t { font-weight: 600; font-size: .92rem; }
.opt .b { color: var(--muted); font-size: .82rem; }

/* -------------------------------------------------------------- financing */

.plan {
  display: block; width: 100%; text-align: left; font: inherit; color: inherit;
  border: 2px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; background: #fff; cursor: pointer; margin-bottom: 12px;
}
.plan.sel { border-color: var(--navy); box-shadow: var(--shadow); }
.plan .head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.plan .pay { font-size: 1.42rem; font-weight: 700; white-space: nowrap; }
.plan .disc { margin-top: 10px; font-size: .74rem; line-height: 1.5; color: var(--muted); }

.legal { font-size: .74rem; line-height: 1.55; color: var(--muted); }

.summary { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 14px; }
.row { display: flex; justify-content: space-between; gap: 14px; padding: 6px 0; }
.row .v { font-weight: 600; }
.row.total { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 12px; font-size: 1.08rem; }

/* -------------------------------------------------------------- internals */

.internal {
  background: #fffbf0; border: 1px solid #ecd9a6; border-left: 4px solid var(--gold);
  border-radius: 11px; padding: 15px 17px; margin-top: 16px;
}
.internal h3 { color: var(--warn); font-size: .8rem; text-transform: uppercase; letter-spacing: .07em; }
.internal table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.internal td { padding: 4px 0; }
.internal td:last-child { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ misc */

.banner { padding: 13px 16px; border-radius: 11px; font-size: .9rem; margin-bottom: 16px; }
.banner.err { background: #fdecec; color: #96231f; border: 1px solid #f4c9c6; }
.banner.ok { background: #eaf5ef; color: var(--good); border: 1px solid #bfe2ce; }
.banner.info { background: #eef4fb; color: var(--navy); border: 1px solid #cfe0f0; }

.pill {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: .74rem; font-weight: 650; letter-spacing: .03em;
  background: #eef2f6; color: var(--muted); text-transform: capitalize;
}
.pill.go { background: #eaf5ef; color: var(--good); }
.pill.gold { background: #fbf2da; color: var(--warn); }

/* --------------------------------------------------------------- portal */

.rowhead { display: flex; align-items: center; gap: 10px; margin: 26px 0 12px; }
.rowhead h2 { margin: 0; }
.rowhead .spacer { flex: 1; }

select.mini, input.mini {
  width: auto; padding: 7px 10px; font-size: .85rem; border-radius: 9px;
}

.delivered { font-size: .86rem; color: var(--muted); font-style: italic; }

.timeline { list-style: none; margin: 6px 0 0; padding: 0; }
.timeline li {
  position: relative; padding: 0 0 16px 26px; border-left: 2px solid var(--line);
  font-size: .9rem;
}
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before {
  content: ''; position: absolute; left: -7px; top: 3px; width: 12px; height: 12px;
  border-radius: 50%; background: #fff; border: 2px solid var(--line);
}
.timeline li.done::before { background: var(--good); border-color: var(--good); }
.timeline li.now::before { background: var(--gold); border-color: var(--gold); }
.timeline li.now { font-weight: 650; }
.timeline .date { display: block; font-size: .78rem; color: var(--muted); }

.grid-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.grid-photos figure { margin: 0; }
.grid-photos img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 10px; display: block; }
.grid-photos figcaption { font-size: .76rem; color: var(--muted); margin-top: 4px; }

.doclist { list-style: none; margin: 0; padding: 0; }
.doclist li { padding: 11px 0; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: center; }
.doclist li:last-child { border-bottom: 0; }
.doclist .spacer { flex: 1; }

.projcard {
  display: block; border: 2px solid var(--line); border-radius: var(--radius);
  background: #fff; padding: 18px 20px; margin-bottom: 12px; text-decoration: none;
  color: inherit; transition: border-color .14s, box-shadow .14s;
}
.projcard:hover { border-color: var(--navy); box-shadow: var(--shadow); }
.projcard .n { font-weight: 650; }
.projcard .m { font-size: .85rem; color: var(--muted); margin-top: 4px; }

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tabs button {
  font: inherit; background: none; border: 0; border-bottom: 3px solid transparent;
  padding: 10px 14px; cursor: pointer; color: var(--muted); font-weight: 600; font-size: .92rem;
}
.tabs button.sel { color: var(--navy); border-bottom-color: var(--gold); }

table.list { width: 100%; border-collapse: collapse; background: #fff; }
table.list th {
  text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line);
}
table.list td { padding: 13px 12px; border-bottom: 1px solid var(--line); font-size: .9rem; }
table.list tr:hover td { background: #f9fbfc; }
table.list a { font-weight: 600; text-decoration: none; }

.spin {
  display: inline-block; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: fixed; left: 50%; bottom: 92px; transform: translateX(-50%);
  background: var(--navy-deep); color: #fff; padding: 12px 20px;
  border-radius: 11px; font-size: .9rem; box-shadow: var(--shadow-lift);
  z-index: 60; max-width: 90vw; text-align: center;
}

/* ------------------------------------------------------- one question card */

.qcard {
  display: block;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px 22px; box-shadow: var(--shadow);
  animation: qin .26s cubic-bezier(.22, .61, .36, 1) both;
}
.qcard.back { animation-name: qin-back; }
.qcard.leaving { animation: qout .15s ease-in both; }
.qcard.leaving-back { animation: qout-back .15s ease-in both; }
.qcard.wide { max-width: none; }
.qcard h2 { font-size: 1.42rem; margin-bottom: 6px; }
.qcard .lead { color: var(--muted); margin-bottom: 20px; }
.qcard > label.field:last-of-type { margin-bottom: 0; }

@keyframes qin { from { opacity: 0; transform: translateX(22px); } to { opacity: 1; transform: none; } }
@keyframes qin-back { from { opacity: 0; transform: translateX(-22px); } to { opacity: 1; transform: none; } }
@keyframes qout { to { opacity: 0; transform: translateX(-16px); } }
@keyframes qout-back { to { opacity: 0; transform: translateX(16px); } }

label.field.big .name { font-size: 1rem; }
input.jumbo {
  font-size: 1.22rem; padding: 15px 16px; min-height: 56px; font-weight: 550;
}

/* ------------------------------------------------------------- big choices */

.choices { display: grid; gap: 11px; }
.choice {
  display: block; width: 100%; text-align: left; font: inherit; color: inherit;
  border: 2px solid var(--line); border-radius: var(--radius);
  padding: 17px 19px; background: #fff; cursor: pointer;
  transition: border-color .14s, box-shadow .14s, transform .14s;
}
.choice:hover { border-color: #b9c6d2; transform: translateY(-2px); box-shadow: var(--shadow); }
.choice.sel { border-color: var(--gold); box-shadow: var(--shadow-lift); }
.choice .t { font-weight: 650; font-size: 1.02rem; }
.choice .b { color: var(--muted); font-size: .87rem; margin-top: 3px; }

/* ------------------------------------------------------------------- chat */

.chat {
  height: 46vh; min-height: 280px; overflow-y: auto;
  padding: 16px; margin-bottom: 12px;
  background: #f7f9fb; border: 1px solid var(--line); border-radius: var(--radius);
  display: flex; flex-direction: column; gap: 10px;
  overscroll-behavior: contain;
}
.bub {
  max-width: 84%; padding: 11px 15px; border-radius: 17px;
  font-size: .95rem; line-height: 1.5; white-space: pre-wrap;
  animation: bubin .22s ease-out both;
}
.bub.her { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.bub.me { align-self: flex-end; background: var(--navy); color: #fff; border-bottom-right-radius: 5px; }
@keyframes bubin { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }

.bub.typing { display: flex; gap: 5px; align-items: center; padding: 15px; }
.bub.typing i {
  width: 7px; height: 7px; border-radius: 50%; background: #b3bfca;
  animation: blink 1.3s infinite ease-in-out both;
}
.bub.typing i:nth-child(2) { animation-delay: .18s; }
.bub.typing i:nth-child(3) { animation-delay: .36s; }
@keyframes blink { 0%, 80%, 100% { opacity: .28; } 40% { opacity: 1; } }

.chatbar { display: flex; gap: 9px; align-items: flex-end; }
.chatbar textarea {
  min-height: 48px; max-height: 160px; resize: none; overflow-y: auto;
  border-radius: 13px; padding: 12px 14px;
}
.chatbar .btn { flex: 0 0 auto; }

.linky {
  display: block; margin: 14px auto 0; background: none; border: 0;
  font: inherit; font-size: .87rem; color: var(--muted);
  text-decoration: underline; cursor: pointer; padding: 6px;
}
.linky:hover { color: var(--navy); }

/* ------------------------------------------------------------ price + misc */

.thinking { color: var(--muted); text-align: center; padding: 34px 10px; }
.thinking::after {
  content: ''; display: block; width: 22px; height: 22px; margin: 14px auto 0;
  border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--navy);
  animation: spin .7s linear infinite;
}

.detail { margin-top: 18px; }

.photo.pop { animation: pop .24s cubic-bezier(.2, .8, .3, 1.2) both; }
@keyframes pop { from { opacity: 0; transform: scale(.86); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
