:root {
  --bg: #f4f5f2; --surface: #fff; --surface-2: #f8f9f7;
  --ink: #16221d; --ink-2: #3d4a44; --muted: #6b7871;
  --line: #e3e7e2; --line-2: #eef1ed;
  --primary: #1d5a43; --primary-hover: #164a37; --primary-soft: #e7f0eb; --primary-ink: #174a37;
  --amber: #a2670f; --amber-soft: #fbf1df;
  --red: #a53a2a; --red-soft: #fbe9e5;
  --client: #2b5a86; --client-soft: #e6eef7; --client-ink: #234d74;
  --radius: 14px; --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(22,34,29,.04), 0 4px 16px rgba(22,34,29,.05);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.5 Inter, "Segoe UI", system-ui, sans-serif; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; }
a { color: var(--primary); }
h1, h2, h3 { margin: 0; letter-spacing: -.3px; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

/* Header */
.app-header { position: sticky; top: 0; z-index: 10; background: rgba(255,255,255,.88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.header-inner { max-width: 1280px; margin: 0 auto; height: 64px; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; flex-shrink: 1; min-width: 0; text-decoration: none; }
.brand img { width: 320px; max-width: 100%; height: auto; }

.page { max-width: 1280px; margin: 0 auto; padding: 28px 24px 64px; }

/* Basics */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.button { height: 40px; padding: 0 16px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 600 13.5px/1 inherit; font-family: inherit; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; white-space: nowrap; }
.button:hover { background: var(--surface-2); }
.button.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.button.primary:hover { background: var(--primary-hover); }
.button.small { height: 32px; padding: 0 11px; font-size: 12.5px; }
.button:disabled { opacity: .5; cursor: not-allowed; }
.button.big { height: 48px; font-size: 15px; padding: 0 22px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--primary-soft); color: var(--primary-ink); }
.pill.warning { background: var(--amber-soft); color: var(--amber); }
.pill.error { background: var(--red-soft); color: var(--red); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; box-shadow: 0 0 0 4px var(--primary-soft); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.header-actions > * { white-space: nowrap; flex: none; }
.login { max-width: 420px; margin: 40px auto 0; }
.login h1 { font-size: 26px; letter-spacing: -.6px; }
.login .lead { color: var(--muted); margin: 6px 0 18px; }
.login-form { display: grid; gap: 14px; }
.login-form .notice { margin: 0; }
.noimg { aspect-ratio: 16/10; background: var(--line-2); }
input[type=text], input[type=password], textarea { width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; }
input[type=text]:focus, input[type=password]:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
label.field { display: grid; gap: 6px; font-weight: 600; font-size: 13px; }

/* Home: upload */
.hero { display: grid; grid-template-columns: 1fr; gap: 24px; }
.upload h1 { font-size: 28px; letter-spacing: -.8px; }
.upload p.lead { margin: 6px 0 20px; color: var(--muted); font-size: 14.5px; }
.drop { border: 1.5px dashed #c9d2cc; border-radius: var(--radius); background: var(--surface-2); padding: 36px 20px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--primary); background: var(--primary-soft); }
.drop strong { display: block; font-size: 15px; margin-bottom: 4px; }
.thumbs { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.thumb { position: relative; width: 120px; aspect-ratio: 4/3; border-radius: 9px; overflow: hidden; border: 1px solid var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb button { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(22,34,29,.75); color: #fff; cursor: pointer; font-size: 14px; line-height: 1; }
.upload-row { display: flex; gap: 12px; align-items: end; margin-top: 18px; flex-wrap: wrap; }
.custom-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.client-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.client-line { margin-top: 6px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
@media (max-width: 640px) { .client-row { grid-template-columns: 1fr; } }
/* New TEAM Design: the homeowner's features, picked with their details; they fill Good, Better and Best. */
.team-picks { border: 0; margin: 18px 0 0; padding: 0; min-width: 0; }
.team-picks[hidden] { display: none; }
.team-picks legend { font-size: 13px; font-weight: 600; color: var(--ink-2); padding: 0; margin-bottom: 8px; }
.team-pick-list { display: flex; flex-wrap: wrap; gap: 8px; }
.team-pick { position: relative; cursor: pointer; }
.team-pick input { position: absolute; opacity: 0; pointer-events: none; }
.team-pick span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 13px; font-weight: 500; color: var(--ink-2); transition: border-color .12s, background .12s; }
.team-pick span::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--surface); box-sizing: border-box; }
.team-pick input:checked + span { border-color: var(--primary); background: var(--primary-soft, var(--surface-2)); color: var(--ink); }
.team-pick input:checked + span::before { border-color: var(--primary); background: var(--primary); box-shadow: inset 0 0 0 2px var(--surface); }
.team-pick input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.upload-row .field { flex: 1 1 260px; }

.section-title { display: flex; justify-content: space-between; align-items: baseline; margin: 32px 0 14px; }
.section-title h2 { font-size: 20px; }
.projects, .leads { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.project { padding: 0; overflow: hidden; text-decoration: none; color: inherit; transition: transform .15s; }
.project:hover { transform: translateY(-2px); }
.project img { width: 100%; aspect-ratio: 16/10; object-fit: cover; background: var(--line-2); }
.project .meta { padding: 12px 14px; display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.project .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { color: var(--muted); padding: 24px; text-align: center; grid-column: 1 / -1; }
.folder-count { font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.folder-search { max-width: 280px; }

/* Project view */
.crumb { color: var(--muted); font-size: 13px; text-decoration: none; }
.title-row { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin: 6px 0 20px; flex-wrap: wrap; }
.title-row h1 { font-size: 30px; letter-spacing: -.8px; }
.team-status-field { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.team-status-field select, .team-status-field input { width: min(220px, 40vw); padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-weight: 500; color: var(--ink); background: var(--surface); }
.pill.team-status { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; flex-shrink: 0; }

.progress { display: grid; gap: 14px; }
.steps { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 500; }
.step .circle { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; font-size: 12px; background: var(--surface); }
.step.done { color: var(--ink); }
.step.done .circle { background: var(--primary); border-color: var(--primary); color: #fff; }
.step.active { color: var(--ink); font-weight: 600; }
.step.active .circle { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.step.active .circle::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); animation: pulse 1.2s infinite ease-in-out; }
.step.skipped { opacity: .55; }
.connector { flex: 0 1 28px; height: 1.5px; background: var(--line); }
.progress-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; color: var(--muted); }
.bar { height: 4px; border-radius: 4px; background: var(--line-2); overflow: hidden; }
.bar > div { height: 100%; background: var(--primary); border-radius: 4px; transition: width .4s; }
@keyframes pulse { 50% { transform: scale(.55); opacity: .5; } }

.notice { margin-top: 16px; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--amber-soft); color: var(--amber); font-weight: 500; }
.stale-note { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 16px; padding: 12px 16px; border: 1px solid color-mix(in srgb, var(--amber) 22%, transparent);
  border-radius: var(--radius-sm); background: var(--amber-soft); color: var(--ink); font-size: 14px; line-height: 1.45; }
.stale-note svg { flex: none; margin-top: 1px; color: var(--amber); }
.stale-note b { color: var(--amber); font-weight: 600; }
.notice.error { background: var(--red-soft); color: var(--red); display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }

.concepts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.concept { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.concept .shot { position: relative; aspect-ratio: 3/2; background: var(--surface-2); }
.concept .shot img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.concept .shot .tag { position: absolute; top: 10px; right: 10px; background: #fff; box-shadow: var(--shadow); }
.placeholder { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: var(--muted); padding: 16px;
  background: repeating-linear-gradient(135deg, transparent 0 10px, rgba(22,34,29,.025) 10px 20px); }
/* Image being drawn: dark dot grid with drifting blue glows, like ChatGPT's image loader. */
.generating { position: absolute; inset: 0; overflow: hidden; background: #111413; }
.generating.over { background: rgba(17,20,19,.78); }
.generating::before, .generating::after { content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(circle, currentColor 1px, transparent 1.6px); background-size: 11px 11px; background-position: center; }
.generating::before { color: rgba(255,255,255,.13); }
.generating::after { color: #6aa6ff; background-image: radial-gradient(circle, currentColor 1.4px, transparent 2px);
  -webkit-mask-image: radial-gradient(closest-side, #000 25%, transparent), radial-gradient(closest-side, #000 25%, transparent);
          mask-image: radial-gradient(closest-side, #000 25%, transparent), radial-gradient(closest-side, #000 25%, transparent);
  -webkit-mask-size: 60% 85%, 55% 80%; mask-size: 60% 85%, 55% 80%;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  animation: gen-drift 7s ease-in-out infinite, gen-twinkle 1.8s ease-in-out infinite; }
@keyframes gen-drift {
  0%, 100% { -webkit-mask-position: 0% 0%, 100% 100%; mask-position: 0% 0%, 100% 100%; }
  33% { -webkit-mask-position: 70% 20%, 20% 90%; mask-position: 70% 20%, 20% 90%; }
  66% { -webkit-mask-position: 30% 100%, 90% 10%; mask-position: 30% 100%, 90% 10%; } }
@keyframes gen-twinkle { 50% { opacity: .55; } }
.gen-label { position: absolute; right: 12px; bottom: 12px; z-index: 1; max-width: calc(100% - 24px);
  padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.08); color: #8fb9ff;
  font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.concept .body { padding: 18px 20px 20px; display: grid; gap: 14px; flex: 1; align-content: start; }
.concept-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.concept-head h3 { font-size: 18px; }
.includes { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13px; color: var(--ink-2); }
.includes li { display: flex; gap: 8px; align-items: start; }
.includes li::before { content: "✓"; flex: none; width: 17px; height: 17px; margin-top: 1px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-size: 10px; font-weight: 700; display: grid; place-items: center; }
.checknote { font-size: 12.5px; background: var(--amber-soft); color: var(--amber); border-radius: var(--radius-sm); padding: 8px 10px; }
.checknote ul { margin: 6px 0 0; padding-left: 18px; }
details.checknote summary { cursor: pointer; font-weight: 600; }
/* Card actions sit at the bottom so Aerial view, the change box and buttons line up across cards. */
.concept .body { display: flex; flex-direction: column; }
.concept .body .redo { margin-top: 0; }
.checks:empty, .versions:empty { display: none; }
.checks { display: grid; gap: 8px; }
.versions:not(:empty), .versions:empty + .views:not(:empty), .versions:empty + .views:empty + .redo { margin-top: auto; }
.versions { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; }
.versions button { width: 28px; height: 28px; padding: 0; }
.redo { display: grid; gap: 8px; margin-top: auto; }
.redo textarea { min-height: 62px; resize: vertical; font-size: 13px; }
.redo-hint { display: flex; align-items: center; gap: 6px; margin: 0 0 2px; font-size: 12px; color: var(--muted); }
.redo-hint svg { flex: none; color: var(--primary); opacity: .75; }
.redo-hint a { color: var(--primary); font-weight: 600; text-decoration: none; }
.redo-hint a:hover { text-decoration: underline; }
.redo-hint b { font-weight: 600; color: var(--ink-2); }
.redo-actions { display: flex; gap: 8px; }
.redo-actions .button.primary { flex: 1; }

.sources { margin-top: 24px; }
.sources-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 14px; }
.source { position: relative; border-radius: 11px; overflow: hidden; aspect-ratio: 3/2; background: var(--surface-2); }
.source img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.source .label { position: absolute; top: 10px; left: 10px; background: #fff; border-radius: 7px; padding: 4px 9px; font-size: 12px; font-weight: 600; box-shadow: var(--shadow); }

dialog#lightbox { border: 0; padding: 0; border-radius: 16px; max-width: min(1400px, 96vw); background: #111; box-shadow: 0 30px 80px rgba(0,0,0,.4); }
dialog#lightbox::backdrop { background: rgba(10,16,13,.7); }
dialog#lightbox img { max-height: 86vh; width: auto; margin: 0 auto; }
dialog#lightbox form { position: absolute; top: 12px; right: 12px; }

#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); transition: .2s; z-index: 50; }
#toast.show { opacity: 1; transform: translateX(-50%); }

@media (max-width: 1000px) {
  .concepts { grid-template-columns: repeat(2, 1fr); }
  /* iPad: logo keeps its size on its own row, the buttons go underneath instead of squeezing it. */
  .header-inner { height: auto; min-height: 64px; padding: 10px 24px; flex-wrap: wrap; row-gap: 8px; }
  .brand { flex-shrink: 0; }
  .brand img { width: 260px; }
}
@media (max-width: 640px) {
  .page { padding: 20px 16px 48px; }
  /* Phone: header scrolls away and the buttons sit in one swipeable row, not four stacked rows. */
  .app-header { position: static; }
  .header-inner { padding: 10px 16px; }
  .header-actions { width: calc(100% + 32px); margin: 0 -16px; padding: 0 16px 2px; overflow-x: auto; scrollbar-width: none; }
  .header-actions::-webkit-scrollbar { display: none; }
  .brand img { width: 230px; }
  .concepts { grid-template-columns: 1fr; }
  .title-row h1, .upload h1 { font-size: 24px; }
  .step .label { display: none; }
  .connector { flex-basis: 10px; }
  .step.active .label { display: inline; }
  .upload-row .button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Rear / Aerial view switch */
.views { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.views:empty { display: none; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.seg button { border: 0; background: none; padding: 5px 12px; border-radius: 7px; font: 600 12.5px/1 inherit; font-family: inherit; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.small { font-size: 12px; }

/* Google Drive photo library picker */
.or-drive { margin-top: 12px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.drive { margin-top: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); padding: 14px; display: grid; gap: 10px; }
.drive-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-weight: 600; min-width: 0; }
.crumbs .link { border: 0; background: none; padding: 0; color: var(--primary); font: inherit; cursor: pointer; }
.drive-list { max-height: 420px; overflow: auto; display: grid; gap: 12px; }
.folders { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.folder { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-sm); padding: 10px 12px; font: 500 13px/1.35 inherit; font-family: inherit; color: var(--ink); cursor: pointer; }
.folder:hover { border-color: var(--primary); background: var(--primary-soft); }
.drive-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.dphoto { position: relative; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; background: var(--line-2); cursor: pointer; aspect-ratio: 4 / 3; }
.dphoto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dphoto.on { border-color: var(--primary); }
.dphoto .badge { position: absolute; top: 6px; left: 6px; background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 2px 8px; }
.dphoto .badge:empty { display: none; }

/* Photo Scout labels in the Drive picker */
.folder { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.sbadge { display: inline-block; border-radius: 999px; padding: 2px 8px; font-size: 11px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.sbadge.s-recommended { background: var(--primary-soft); color: var(--primary-ink); border-color: transparent; }
.sbadge.s-review { background: var(--amber-soft); color: var(--amber); border-color: transparent; }
.sbadge.s-error { background: var(--red-soft); color: var(--red); border-color: transparent; }
.sbadge.s-pending, .sbadge.s-no-rear { color: var(--muted); }
.scout-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); font-size: 13px; }
.scout-bar .small { margin-top: 3px; }
.scanning { display: inline-flex; align-items: center; gap: 6px; color: var(--primary-ink); }
.scanning .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.scout-error { color: var(--red); }
.scout-filters { flex-wrap: wrap; justify-self: start; }
.scout-note { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13px; background: var(--surface); border: 1px solid var(--line); }
.scout-note > div { display: grid; gap: 2px; }
.scout-note.s-recommended { background: var(--primary-soft); border-color: transparent; color: var(--primary-ink); }
.scout-note.s-review { background: var(--amber-soft); border-color: transparent; color: var(--amber); }
.scout-note.s-error { background: var(--red-soft); border-color: transparent; color: var(--red); }
.dphoto .stag { position: absolute; bottom: 6px; left: 6px; background: rgba(22, 34, 29, .82); color: #fff; font-size: 11px; font-weight: 600; border-radius: 999px; padding: 2px 8px; }

/* Proposal editor */
.title-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.proposal-layout { display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); gap: 24px; align-items: start; }
.proposal-form { display: grid; gap: 14px; position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow: auto; }
.proposal-form textarea { resize: vertical; font-size: 13px; }
.proposal-form select { width: 100%; font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.prices { border: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.prices legend { font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.proposal-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.client-link { display: grid; gap: 6px; font-weight: 600; font-size: 13px; }
.client-link .link-row { display: flex; gap: 8px; }
.client-link input { flex: 1; min-width: 0; color: var(--ink-2); background: var(--surface-2); }
.client-link .muted { font-weight: 400; }
.proposal-preview { min-width: 0; overflow: auto; background: #d9d4c9; border-radius: var(--radius); padding: 24px 0; }
.proposal-preview .proposal { zoom: .72; }
@media (max-width: 1000px) {
  .proposal-layout { grid-template-columns: 1fr; }
  .proposal-form { position: static; max-height: none; }
  .proposal-preview .proposal { zoom: .42; }
}
/* Printing: only the proposal pages, full size, no app chrome */
@media print {
  @page { size: 8.5in 11in; margin: 0; }
  body { background: #fff; }
  body > *:not(main), #app > :not(.proposal-layout), .proposal-form, #toast { display: none !important; }
  #app { padding: 0 !important; max-width: none !important; }
  .proposal-layout { display: block; }
  .proposal-preview { padding: 0; background: none; overflow: visible; border-radius: 0; }
  .proposal-preview .proposal { zoom: 1; }
  .proposal .page { margin: 0; box-shadow: none; }
}

/* Design type switch and custom components */
.mode-switch { margin: 10px 0 4px; flex-wrap: wrap; }
.custom-panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); padding: 14px; margin-bottom: 16px; display: grid; gap: 12px; }
.custom-group { border: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.custom-group legend { font-weight: 700; font-size: 13px; margin-bottom: 6px; }
.custom-panel input[type=number], .custom-panel select { width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px; }
.custom-panel .inline { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.custom-panel .inline input[type=number] { width: 80px; }
.custom-panel textarea { min-height: 54px; }
/* The custom design's item card (same look as Build the options) */
.custom-card { display: grid; gap: 12px; }
.custom-top { display: flex; gap: 10px 22px; flex-wrap: wrap; align-items: center; }
.custom-card .toggle select { width: auto; padding: 4px 8px; border-radius: 8px; }
.custom-scope { max-width: 520px; }
.custom-scope .hd .muted { font-size: 12px; }
.custom-problem { margin: 0; max-width: 520px; }
.custom-problems { margin: 0; padding-left: 18px; color: var(--amber); font-size: 13px; }
.custom-problems:empty { display: none; }
.concepts.single { grid-template-columns: minmax(0, 760px); }
.change-panel { margin-top: 4px; }

/* Add a custom design to a Good/Better/Best project */
.add-custom-panel { margin-bottom: 16px; }
.inline-field { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.inline-field select { width: auto; }
.concepts:has(.concept:nth-child(4)) { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 640px) { .concepts:has(.concept:nth-child(4)) { grid-template-columns: 1fr; } }

/* Delete project */
.delete-row { display: flex; justify-content: flex-end; margin-top: 16px; }
.button.danger { color: #b42318; border-color: #f1c4bf; }
.button.danger:hover { background: #fdf0ef; }

/* Leads tab (client intake) */
#nav-requests.on, #nav-lessons.on { border-color: var(--primary); color: var(--primary-ink); background: var(--primary-soft); }
.nav-badge { background: var(--primary); color: #fff; border-radius: 999px; padding: 0 6px; font-size: 11px; line-height: 17px; }

/* Design requests: client intake vs TEAM */
.request-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.request-tabs { flex-wrap: wrap; }
.request-tabs a { min-height: 36px; padding: 0 14px; border-radius: 7px; font-weight: 600; font-size: 13px; color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.request-tabs a.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.request-tabs .count { font-size: 11.5px; padding: 0 7px; border-radius: 999px; line-height: 18px; background: var(--line); color: var(--ink-2); }
.request-tabs .count:empty { display: none; }
.request-tabs a.on .count { background: var(--primary); color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { min-height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font: 600 12.5px/1 inherit; font-family: inherit; cursor: pointer; }
.chips button.on { border-color: var(--client); background: var(--client-soft); color: var(--client-ink); }
.request-group { margin-top: 26px; }
.group-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-bottom: 10px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.group-head h2 { font-size: 18px; display: flex; align-items: center; gap: 10px; }
.group-link { margin-left: auto; font-weight: 600; font-size: 13px; text-decoration: none; }
.src-mark { width: 10px; height: 10px; display: inline-block; }
.src-mark.client { border-radius: 3px; background: var(--client); }
.src-mark.team { border-radius: 50%; background: var(--primary); }
.src { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.src::before { content: ''; width: 8px; height: 8px; background: currentColor; }
.src.client { color: var(--client); }
.src.client::before { border-radius: 2px; }
.src.team { color: var(--primary); }
.src.team::before { border-radius: 50%; }
.project-foot { padding: 0 14px 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.tier-chips { display: flex; gap: 4px; }
.tier-chip { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 6px; background: var(--line-2); color: var(--muted); }
.tier-chip.done { background: var(--primary-soft); color: var(--primary-ink); }
.pill.neutral { background: var(--line-2); color: var(--ink-2); }
.lead-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.lead-card > img { width: 100%; aspect-ratio: 16/10; object-fit: cover; cursor: zoom-in; background: var(--line-2); }
.lead-nophoto { display: grid; place-items: center; color: var(--muted); font-weight: 500; }
.lead-more { display: flex; gap: 6px; padding: 6px 6px 0; overflow-x: auto; }
.lead-more img { flex: none; width: 72px; aspect-ratio: 4/3; object-fit: cover; border-radius: 6px; cursor: zoom-in; background: var(--line-2); }
.lead-body { padding: 16px 18px 18px; display: grid; gap: 12px; flex: 1; align-content: start; }
.lead-address { margin: 0; color: var(--ink-2); }
.lead-facts { margin: 0; display: grid; gap: 6px; font-size: 13px; }
.lead-facts div { display: grid; grid-template-columns: 76px 1fr; gap: 8px; }
.lead-facts dt { color: var(--muted); }
.lead-facts dd { margin: 0; overflow-wrap: anywhere; }
.lead-card textarea { font-size: 13px; resize: vertical; }
.lead-actions { display: flex; gap: 8px; align-items: center; margin-top: auto; }
.waitlist-demand { grid-column: 1 / -1; margin: 0 0 4px; font-size: 14px; }

/* Design feedback (thumbs on each design card) */
.marketing-control { display: grid; gap: 6px; justify-items: start; }
.marketing-control:empty { display: none; }
.marketing-control .muted { font-size: 12px; }
.marketing-control .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; }
.marketing-control .approved { color: var(--primary-ink); font-size: 13px; font-weight: 600; }
.rate { display: grid; gap: 8px; }
.rate-row { display: flex; align-items: center; gap: 6px; }
.rate-row .muted { flex: 1; }
.rate-btn { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; width: 34px; height: 30px; font-size: 15px; line-height: 1; cursor: pointer; }
.rate-btn:hover { border-color: var(--primary); }
.rate-btn.on { background: var(--primary-soft); border-color: var(--primary); }
.rate-more { display: grid; gap: 8px; padding: 10px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line-2); }
.rate-note { font: inherit; font-size: 13px; padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 999px; padding: 4px 10px; font: 500 12.5px/1.3 inherit; font-family: inherit; cursor: pointer; }
.chip.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-ink); }

/* Lessons page */
.lesson-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 18px; }
.lesson-stats > div { display: grid; gap: 2px; }
.lesson-stats .stat { font-size: 26px; font-weight: 700; letter-spacing: -.5px; }
.lesson-stats .stat-text { font-size: 15px; font-weight: 600; min-height: 39px; display: flex; align-items: flex-end; }
.lesson-group { margin-top: 16px; display: grid; gap: 12px; }
.lesson-group > p { margin: 0; }
.lesson-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.lesson-head h2, details.lesson-group summary h2 { font-size: 17px; }
details.lesson-group summary { cursor: pointer; list-style-position: inside; }
details.lesson-group summary h2 { display: inline; }
.lesson { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.lesson p { margin: 0; }
.lesson-text { font: inherit; font-size: 14px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); resize: vertical; }
.lesson-static { font-size: 14px; color: var(--ink-2); }
.lesson-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
@media (max-width: 700px) { .lesson-stats { grid-template-columns: 1fr; } }

/* Backlog page */
.backlog-status { display: grid; gap: 16px; margin-bottom: 24px; }
.backlog-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-weight: 500; }
.backlog-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.backlog-stats { grid-template-columns: repeat(4, 1fr); margin-top: 0; }
.backlog-settings { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; }
.backlog-settings input { width: 110px; }
.backlog-item { display: grid; gap: 8px; align-content: start; }
.backlog-item.rejected .project { opacity: .45; }
.backlog-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 0 4px; }
@media (max-width: 700px) { .backlog-stats { grid-template-columns: repeat(2, 1fr); } }
.backlog-batch { margin-bottom: 28px; }

/* The client's choice from their next steps page (project page) */
.client-choice { margin-bottom: 18px; }
.proposal-help { margin-bottom: 18px; padding: 12px 18px; font-size: 13px; }
.proposal-help summary { cursor: pointer; font-weight: 600; color: var(--primary-ink); }
.proposal-help ul { margin: 10px 0 2px; padding-left: 18px; display: grid; gap: 6px; color: var(--ink-2); line-height: 1.5; }
.client-choice-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.client-choice-head h3 { margin: 0; }
.client-choice p { margin: 6px 0 0; }
.client-choice-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.team-notes { margin-top: 24px; }
.team-notes h2 { font-size: 16px; }
.team-notes textarea { width: 100%; margin-top: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font: inherit; color: var(--ink); background: var(--surface); resize: vertical; }
.team-notes .redo-actions { margin-top: 8px; }
.team-notes .redo-actions .button.primary { flex: none; }
.notes-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.notes-list li { border-top: 1px solid var(--line); padding-top: 10px; }
.notes-list .note-meta { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.notes-list .note-meta b { color: var(--ink-2); }
.notes-list .note-body { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.notes-list .note-delete { margin-left: auto; background: none; border: 0; padding: 0; color: var(--muted); font: inherit; font-size: 12.5px; cursor: pointer; text-decoration: underline; }

/* Fix rear view (Source views) */
.sources-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; flex-wrap: wrap; }
.rear-fix { display: grid; gap: 8px; margin-top: 14px; max-width: 640px; }
.rear-fix p { margin: 0; }
.rear-fix textarea { min-height: 62px; resize: vertical; font-size: 13px; }
.rear-fix .redo-actions .button.primary { flex: none; }
.rear-photo { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 8px; border-top: 1px solid var(--line); }

/* Build the options (#/options/<project>) and the Catalog page (#/catalog): personalized Good, Better, Best */
.options-photo { width: 180px; aspect-ratio: 16/10; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); cursor: zoom-in; }
.wish { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 14px; margin-bottom: 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); font-size: 13px; }
.wish b { margin-right: 4px; }
.wish .budget-pick { margin-left: 10px; }
.wish .added { display: contents; }
.wish .grow { flex: 1; }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.toggle input { width: 16px; height: 16px; accent-color: var(--primary); }
.toggle select { font: inherit; font-weight: 500; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; }
.scopes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.scope { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.scope.changed { border-color: var(--amber); }
.scope .hd { padding: 16px 18px 14px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.scope .hd h3 { font-size: 19px; }
.scope .line { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line-2); }
.scope .lbl { font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.scope .lbl .pill { font-size: 10.5px; padding: 1px 7px; }
.scope .amt { font-size: 13px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.scope .ctl { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.scope .note { grid-column: 1 / -1; font-size: 11.5px; color: var(--muted); }
.scope .line.off .lbl { color: var(--muted); font-weight: 500; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.stepper button { width: 30px; height: 30px; border: 0; background: var(--surface-2); font: 700 15px/1 inherit; font-family: inherit; color: var(--ink-2); cursor: pointer; }
.stepper button:hover:not(:disabled) { background: var(--primary-soft); color: var(--primary); }
.stepper button:disabled { opacity: .4; cursor: not-allowed; }
.stepper b { min-width: 96px; text-align: center; font-size: 13px; font-weight: 600; }
.addbtn { display: inline-flex; align-items: center; height: 30px; padding: 0 11px; border: 1px dashed #c9d2cc; border-radius: 8px; font: 600 12.5px/1 inherit; font-family: inherit; color: var(--primary); background: var(--surface); cursor: pointer; }
.addbtn:hover { border-color: var(--primary); background: var(--primary-soft); }
.link-remove { margin-left: auto; border: 0; background: none; padding: 0; font: 600 12px/1 inherit; font-family: inherit; color: var(--muted); cursor: pointer; }
.link-remove:hover { color: var(--red); }
.scope .ft { margin-top: auto; padding: 14px 18px 16px; background: var(--surface-2); display: grid; gap: 4px; }
.scope .ft .row { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.scope .ft .row.credit, .scope .ft .row.mo { color: var(--primary); font-weight: 600; }
.scope .ft .row.total { font-size: 20px; font-weight: 800; color: var(--ink); letter-spacing: -.4px; margin-top: 4px; }
.options-problems { display: block; margin-bottom: 12px; }
.options-problems > div > div { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.options-problems .small { margin-top: 4px; font-weight: 500; }
.bottom-bar { display: flex; align-items: center; gap: 12px; padding: 14px 16px; margin: 16px 0 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.bottom-bar .grow { flex: 1; font-size: 13px; }
.bottom-bar .grow b { color: var(--ink); }
@media (max-width: 1000px) { .scopes { grid-template-columns: 1fr; } .bottom-bar { flex-wrap: wrap; } }
/* Catalog page: shared items on top, then Good, Better, Best side by side (like the proposal). */
.catalog-actions { display: flex; gap: 8px; }
/* Everyone but Frank sees the catalog read-only (CATALOG_OWNER): the fieldset disables every field. */
.catalog-lock { display: contents; border: 0; margin: 0; padding: 0; min-width: 0; }
.catalog-lock:disabled .link-change, .catalog-lock:disabled button.item-photo { display: none; }
.catalog-lock:disabled input, .catalog-lock:disabled select, .catalog-lock:disabled .price-in { background: var(--line-2); color: var(--muted); }
#catalog-form h2 { font-size: 16px; }
#catalog-form h2 .muted { font-weight: 500; font-size: 13px; }
#catalog-form input, #catalog-form select { font: inherit; font-size: 13px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; height: 32px; }
#catalog-form input:focus, #catalog-form select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.catalog-items { padding: 18px 20px 12px; margin-bottom: 16px; }
.catalog-sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 6px 16px; flex-wrap: wrap; margin-bottom: 6px; }
.catalog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); column-gap: 28px; }
.catalog-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); min-width: 0; }
.catalog-item .item-cell { flex: 1; min-width: 0; }
.price-in { flex: none; display: inline-flex; align-items: center; height: 34px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding-left: 10px; color: var(--muted); font-weight: 500; }
.price-in:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
#catalog-form .price-in input { border: 0; height: 32px; width: 80px; padding: 0 10px 0 4px; text-align: right; font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; background: transparent; box-shadow: none; }
.item-cell { display: flex; align-items: center; gap: 12px; }
.item-photo { flex: none; width: 60px; height: 44px; padding: 0; border: 1px dashed #c9d2cc; border-radius: 8px; background: var(--surface-2); overflow: hidden; cursor: pointer; display: grid; place-items: center; font: 600 10.5px/1.1 inherit; font-family: inherit; color: var(--primary); }
.item-photo img { width: 100%; height: 100%; object-fit: cover; }
.item-photo:has(img) { border-style: solid; border-color: var(--line); cursor: zoom-in; }
.item-photo:hover { border-color: var(--primary); }
.item-cell.busy { opacity: .5; cursor: progress; }
.item-name { display: grid; gap: 2px; min-width: 0; font-size: 13.5px; line-height: 1.3; }
.item-name > .muted { font-size: 12px; }
.link-change { justify-self: start; border: 0; background: none; padding: 0; font: 600 11.5px/1 inherit; font-family: inherit; color: var(--primary); cursor: pointer; }
.link-change:hover { text-decoration: underline; }
.drawings { display: flex; gap: 4px; margin-top: 2px; }
.drawings img { width: 40px; height: 26px; object-fit: cover; object-position: center 30%; border: 1px solid var(--line); border-radius: 4px; background: #fff; cursor: zoom-in; }
.drawings img:hover { border-color: var(--primary); }
.catalog-tiers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.catalog-tier { padding: 0; overflow: hidden; }
.tier-head { padding: 16px 18px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.tier-head h3 { font-size: 19px; }
.tier-block { padding: 14px 18px; border-bottom: 1px solid var(--line-2); display: grid; gap: 8px; }
.tier-block:last-child { border-bottom: 0; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.start-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; }
#catalog-form .count-in { width: 58px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; padding: 0 4px; }
#catalog-form .start-row select { width: 112px; padding: 0 6px; }
.pack-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 2px; }
.pack-head .item-photo { width: 44px; height: 34px; }
.pack-row { display: grid; grid-template-columns: 1fr 58px; gap: 4px 8px; align-items: center; font-size: 13px; }
#catalog-form .spec-in { grid-column: 1 / -1; width: 100%; padding: 0 9px; margin-bottom: 4px; }
#catalog-form .spec-in::placeholder { color: #a7b0ab; }
.catalog-note { margin: 12px 2px 16px; max-width: 900px; }
.catalog-foot { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.catalog-save { display: grid; gap: 12px; padding: 18px 20px; }
.catalog-save p { margin: 0; }
.offer-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13.5px; }
.save-row { display: flex; gap: 10px; }
#catalog-form .save-row input { flex: 1; min-width: 0; height: 40px; padding: 0 12px; }
.catalog-history-card { padding: 16px 18px; }
.catalog-history { list-style: none; margin: 8px 0 0; padding: 0; display: grid; font-size: 13px; max-height: 320px; overflow: auto; }
.catalog-history li { display: grid; gap: 2px; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.catalog-history li:last-child { border-bottom: 0; }
.catalog-history .muted { font-size: 12px; }
@media (max-width: 1000px) { .catalog-tiers, .catalog-foot { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .catalog-items { padding: 16px 14px 8px; }
  .catalog-grid { grid-template-columns: 1fr; }
  .item-photo { width: 48px; height: 36px; }
  .save-row { flex-direction: column; }
  .catalog-actions .button.primary { display: none; }
}
.prices.itemized-prices { grid-template-columns: 1fr; gap: 6px; }
.itemized-row { display: grid; grid-template-columns: 70px auto 1fr; gap: 4px 12px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--line-2); }
.itemized-row span:nth-child(2) { font-weight: 700; font-variant-numeric: tabular-nums; }
.itemized-row .small { grid-column: 1 / -1; }
.lead-actions .tier-chips { margin-left: auto; }
.itemized-prices .price-moved { color: var(--amber); font-weight: 600; }
