/* Dalc Audit: lifted from design/project/*.dc.html. Colors only through these tokens. */
:root {
  --bg: #040506;
  --surface: #07080a;
  --surface-2: #111214;
  --badge: #1b1c1e;
  --border: #363739;
  --ghost: #2f3031;
  --text: #ffffff;
  --muted: #9c9c9d;
  --mist: #e6e6e6;
  --btn-label: #454647;
  --coral: #ff6363;
  --ember: #452324;
  --coral-text: #ff8080;
  --coral-soft: #ffb3b3;
  --coral-pale: #ffd6d6;
  --coral-line: rgba(255, 99, 99, 0.3);
  --live: #59d499;
  --field: rgba(255, 255, 255, 0.05);
  --blue-glow: #043f96;
  /* the "keyboard key" card edge */
  --key: rgba(255, 255, 255, 0.05) 0 1px 0 0 inset, rgba(255, 255, 255, 0.25) 0 0 0 1px, rgba(0, 0, 0, 0.2) 0 -1px 0 0 inset;
  --outline: var(--badge) 0 0 0 1px;
  --ghost-edge: var(--ghost) 0 0 0 1px inset;
  --sans: Inter, system-ui, -apple-system, sans-serif;
  --mono: 'Geist Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0; min-height: 100dvh; display: flex; background: var(--bg); color: var(--text);
  font-family: var(--sans); font-feature-settings: 'calt', 'kern', 'liga', 'ss03'; line-height: 1.4;
  -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent;
}
h1, h2, p { margin: 0; overflow-wrap: anywhere; }
a { color: var(--muted); }
a:hover { color: var(--text); }
button, input, textarea, select { font: inherit; color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--mist); outline-offset: 2px; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Sidebar */
.sidebar {
  width: 232px; flex-shrink: 0; position: sticky; top: 0; height: 100dvh;
  padding: max(28px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  display: flex; flex-direction: column; gap: 4px; background: var(--surface); border-right: 1px solid var(--badge);
}
.signed-out .sidebar { display: none; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 12px 28px; font-size: 15px; font-weight: 600; }
.diamond { display: block; width: 13px; height: 13px; background: var(--coral); border-radius: 3px; transform: rotate(45deg); }
.nav-link {
  display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 8px;
  color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500;
}
.nav-link[aria-current="page"] { background: var(--ember); color: var(--text); }
.nav-link[aria-current="page"] svg { stroke: var(--coral); }
.nav-link[aria-disabled="true"] { opacity: 0.5; cursor: default; }
.nav-link[aria-disabled="true"]:hover { color: var(--muted); }
.sidebar-foot {
  padding: 12px 12px 0; display: flex; flex-direction: column; gap: 4px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted);
}

/* Main area */
#screen { flex-grow: 1; min-width: 0; position: relative; overflow-x: hidden; }
#screen:focus, #screen:focus-visible { outline: none; } /* focused only to move screen readers to the new screen */
.view {
  min-height: 100dvh; position: relative; display: flex; flex-direction: column; gap: 28px;
  padding: max(48px, env(safe-area-inset-top)) max(56px, env(safe-area-inset-right)) max(40px, env(safe-area-inset-bottom)) 56px;
}
.view-visit { padding-top: max(64px, env(safe-area-inset-top)); padding-left: 72px; padding-right: 72px; gap: 0; }
.view-quote { gap: 24px; }
.view-login { align-items: center; justify-content: center; }

/* Type */
.eyebrow { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.display { font-size: 52px; font-weight: 400; line-height: 1.15; letter-spacing: 0.2px; max-width: 700px; }
.title { font-size: 32px; font-weight: 500; line-height: 1.15; }
.h2 { font-size: 20px; font-weight: 500; }
.card-title { font-size: 17px; font-weight: 500; }
.lede { font-size: 18px; line-height: 1.45; color: var(--muted); max-width: 560px; }
.lede-sm { font-size: 15px; }
.section-label { font-size: 14px; font-weight: 500; color: var(--muted); }
.row-title { font-size: 15px; font-weight: 500; color: var(--text); overflow-wrap: anywhere; }
.mono { font-family: var(--mono); }
.small { font-size: 13px; }
.small-14 { font-size: 14px; }
.tiny { font-size: 11px; }
.muted { color: var(--muted); }
.mist { color: var(--mist); }
.coral-text { color: var(--coral-text); }
.lh-14 { line-height: 1.4; }
.lh-15 { line-height: 1.5; }

/* Layout helpers */
.stack { display: flex; flex-direction: column; min-width: 0; }
.row { display: flex; align-items: center; }
.wrap { flex-wrap: wrap; }
.grow { flex-grow: 1; min-width: 0; }
.gap-3 { gap: 3px; } .gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; }
.gap-16 { gap: 16px; } .gap-20 { gap: 20px; } .gap-24 { gap: 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.divider { height: 1px; background: var(--badge); }
.divider.inset { margin: 0 12px; }
.pad { padding: 16px 14px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }

/* Surfaces */
.card { border-radius: 20px; background: var(--surface); padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.key { box-shadow: var(--key); }
.list { padding: 6px; border-radius: 16px; background: var(--surface); box-shadow: var(--outline); display: flex; flex-direction: column; }

/* Controls */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border: 0; border-radius: 8px; background: none; text-decoration: none; font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.btn.primary { background: var(--mist); color: var(--btn-label); }
.btn.primary:hover { color: var(--btn-label); }
.btn.ghost { box-shadow: var(--ghost-edge); color: var(--mist); padding: 0 16px; }
.btn.ghost[aria-pressed="true"] { background: var(--mist); color: var(--btn-label); box-shadow: none; }
.btn.small { min-height: 44px; font-size: 13px; align-self: flex-start; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: progress; }
.link-btn {
  min-height: 44px; padding: 0 4px; border: 0; background: none; color: var(--text);
  font-size: 13px; font-weight: 600; text-decoration: underline; cursor: pointer;
}
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field > label { font-size: 13px; font-weight: 500; color: var(--muted); }
.input {
  min-height: 48px; width: 100%; padding: 0 14px; border: 0; border-radius: 8px; background: var(--field);
  color: var(--text); font-size: 16px;
}
.input.textarea { padding: 12px 14px; line-height: 1.45; resize: vertical; }
.input.narrow { width: 140px; }
.input.narrow-date { width: 220px; color-scheme: dark; }
.field-error { font-size: 13px; color: var(--coral-text); }
.field-error:empty { display: none; }
.chip {
  flex-shrink: 0; padding: 3px 8px; border-radius: 6px; background: var(--badge);
  font-size: 12px; font-weight: 500; color: var(--mist); white-space: nowrap;
}
.pill {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 0; border-radius: 9999px;
  background: none; box-shadow: var(--ghost-edge); color: var(--mist); font-size: 14px; font-weight: 500; cursor: pointer;
}
.pill[aria-pressed="true"] { background: var(--mist); color: var(--btn-label); box-shadow: none; }
.seg { display: inline-flex; gap: 4px; }
.seg .pill { min-width: 44px; justify-content: center; padding: 0 12px; }
.load-error { display: flex; flex-direction: column; gap: 16px; align-items: flex-start; color: var(--mist); }

/* Sign in */
.login { width: 360px; max-width: 100%; gap: 20px; padding: 32px; }
.login .brand { padding: 0; }
.pin-input { font-family: var(--mono); font-size: 24px; letter-spacing: 0.4em; text-align: center; }

/* New visit */
.glow { position: absolute; pointer-events: none; }
.glow.coral { top: -140px; right: -120px; width: 620px; height: 120px; background: var(--coral); opacity: 0.22; filter: blur(48px); transform: rotate(-24deg); }
.glow.blue { top: -60px; right: 80px; width: 520px; height: 340px; border-radius: 50%; background: var(--blue-glow); opacity: 0.28; filter: blur(80px); }
.hero { position: relative; display: flex; flex-direction: column; gap: 16px; }
.visit-form { position: relative; margin-top: 36px; display: flex; flex-direction: column; gap: 16px; }
.url-bar {
  display: flex; align-items: center; gap: 14px; min-height: 68px; padding: 0 10px 0 22px;
  background: var(--surface); border-radius: 16px;
}
.url-field { flex-grow: 1; min-width: 0; display: flex; align-items: center; gap: 14px; color: var(--mist); }
.url-field svg { flex-shrink: 0; }
.url-input { flex-grow: 1; min-width: 0; height: 48px; background: transparent; border: 0; color: var(--text); font-size: 20px; }
.url-note { flex-grow: 1; font-size: 17px; color: var(--mist); }
.url-bar .btn { min-height: 48px; padding: 0 22px; font-size: 15px; }
.switch { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; align-self: flex-start; font-size: 14px; font-weight: 500; color: var(--mist); cursor: pointer; }
.switch-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { position: relative; width: 44px; height: 26px; border-radius: 9999px; background: var(--badge); box-shadow: var(--ghost-edge); }
.switch-track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--muted); transition: transform 0.15s; }
.switch-input:checked + .switch-track { background: var(--mist); }
.switch-input:checked + .switch-track::after { transform: translateX(18px); background: var(--btn-label); }
.switch-input:focus-visible + .switch-track { outline: 2px solid var(--mist); outline-offset: 2px; }
.lists { position: relative; margin-top: 40px; display: flex; flex-direction: column; gap: 32px; }
.list-section { display: flex; flex-direction: column; gap: 12px; }
.visit-row { display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 8px 12px; border-radius: 8px; text-decoration: none; }
.visit-row:hover { background: var(--surface-2); }
.avatar {
  width: 32px; height: 32px; flex-shrink: 0; border-radius: 99999px; background: var(--badge);
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; color: var(--mist);
}

/* Audit */
.audit-cols { display: flex; gap: 24px; align-items: flex-start; }
.audit-side { width: 330px; flex-shrink: 0; display: flex; flex-direction: column; gap: 24px; }
.scores { padding: 28px 24px; gap: 22px; }
.ring-row { display: flex; align-items: center; gap: 20px; }
.ring { position: relative; width: 120px; height: 120px; flex-shrink: 0; }
.ring svg { display: block; transform: rotate(-90deg); }
.ring-track { stroke: var(--badge); }
.arc { stroke: var(--mist); transition: stroke-dasharray 0.4s; }
.arc.low { stroke: var(--coral); }
.ring-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-num { font-size: 40px; font-weight: 600; line-height: 1; }
.caption { font-size: 15px; line-height: 1.4; color: var(--mist); }
.bars { display: flex; flex-direction: column; gap: 18px; }
.bar { display: flex; flex-direction: column; gap: 8px; }
.bar-head { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; font-weight: 500; }
.track { height: 6px; border-radius: 9999px; background: var(--badge); overflow: hidden; }
.fill { height: 6px; border-radius: 9999px; background: var(--mist); transition: width 0.4s; }
.fill.low { background: var(--coral); }
.skeleton { background: linear-gradient(90deg, var(--badge) 0%, var(--ghost) 50%, var(--badge) 100%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.skeleton-text { color: var(--muted); }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } .arc, .fill, .switch-track::after { transition: none; } }
.fail-note { display: flex; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--mist); }
.profile { gap: 12px; }
.profile-name { font-size: 15px; font-weight: 500; overflow-wrap: anywhere; }
.facts { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; text-align: right; font-family: var(--mono); color: var(--mist); }
.findings { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.finding {
  display: flex; align-items: center; gap: 16px; width: 100%; min-height: 68px; padding: 10px 14px;
  border: 0; border-radius: 8px; background: none; text-align: left; color: var(--text); cursor: pointer;
}
button.finding:hover, .finding.open { background: var(--surface-2); }
.finding .chev { flex-shrink: 0; stroke: var(--muted); transition: transform 0.15s; }
.finding.open .chev { transform: rotate(90deg); }
.skeleton-row { cursor: default; }
.tag {
  width: 72px; flex-shrink: 0; padding: 4px 0; border-radius: 6px; background: var(--badge);
  text-align: center; font-size: 12px; font-weight: 500; color: var(--mist);
}
.tag.skeleton { height: 24px; }
.tag.urgent { background: var(--ember); color: var(--coral-text); }
.tag.good { background: none; box-shadow: var(--ghost-edge); color: var(--muted); }

/* Portfolio */
.work { display: flex; flex-direction: column; border-radius: 16px; overflow: hidden; background: var(--surface); text-decoration: none; color: var(--text); }
.work img { display: block; width: 100%; height: 176px; object-fit: cover; object-position: top; background: var(--surface-2); }
.work-body { padding: 16px 20px 18px; display: flex; flex-direction: column; gap: 10px; }
.work-name { font-size: 17px; font-weight: 500; color: var(--text); }
.meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.live-dot { width: 6px; height: 6px; border-radius: 99999px; background: var(--live); }

/* Quote */
.pkg-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.pkg {
  display: flex; flex-direction: column; gap: 14px; padding: 22px; border: 0; border-radius: 16px;
  background: var(--surface); color: var(--text); text-align: left; cursor: pointer;
}
.pkg-top { display: flex; align-items: center; justify-content: space-between; min-height: 18px; }
.pkg-eyebrow, .pkg-fixes { font-family: var(--mono); font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.pkg-fixes { margin-top: 4px; font-size: 12px; letter-spacing: 0; text-transform: none; }
.pkg-check { display: flex; visibility: hidden; color: var(--coral); }
.pkg-name { font-size: 20px; font-weight: 500; }
.pkg-price { display: flex; align-items: baseline; gap: 6px; }
.pkg-amount { font-size: 32px; font-weight: 600; }
.pkg-when { font-size: 13px; color: var(--muted); }
.pkg-blurb { font-size: 14px; line-height: 1.4; color: var(--muted); }
.pkg-rule { height: 1px; background: var(--badge); }
.pkg-bullets { display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--mist); }
.pkg.suggested .pkg-eyebrow { color: var(--coral-soft); }
.pkg[aria-pressed="true"] { background: var(--ember); box-shadow: rgba(255, 255, 255, 0.08) 0 1px 0 0 inset, var(--coral) 0 0 0 1px; }
.pkg[aria-pressed="true"] .pkg-check { visibility: visible; }
.pkg[aria-pressed="true"] .pkg-eyebrow, .pkg[aria-pressed="true"] .pkg-when, .pkg[aria-pressed="true"] .pkg-fixes { color: var(--coral-soft); }
.pkg[aria-pressed="true"] .pkg-blurb { color: var(--coral-pale); }
.pkg[aria-pressed="true"] .pkg-rule { background: var(--coral-line); }
.pkg[aria-pressed="true"] .pkg-bullets { color: var(--text); }
.addons { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.addon-label { font-size: 13px; font-weight: 500; color: var(--muted); margin-right: 4px; }
.addon-label:not(:first-child) { margin-left: 12px; }
.stepper { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 6px 0 16px; border-radius: 9999px; box-shadow: var(--ghost-edge); font-size: 14px; font-weight: 500; color: var(--mist); }
.step-btn { width: 44px; height: 44px; border: 0; border-radius: 50%; background: none; color: var(--text); font-size: 20px; cursor: pointer; }
.step-count { min-width: 20px; text-align: center; font-family: var(--mono); }
.grow-input { flex: 1 1 220px; min-width: 0; }
.total-bar {
  padding: 22px 26px; border-radius: 20px; background: var(--surface);
  box-shadow: var(--outline), rgba(255, 255, 255, 0.05) 0 1px 0 0 inset; display: flex; align-items: center; gap: 32px;
}
.total-line { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; }
.total { font-size: 40px; font-weight: 600; line-height: 1.1; }
.was { font-size: 20px; color: var(--muted); }
.per-month { font-size: 18px; color: var(--mist); }
.total-side { width: 340px; flex-shrink: 0; display: flex; flex-direction: column; gap: 8px; }
.send-panel { display: flex; flex-direction: column; gap: 12px; }
.send-panel:empty { display: none; }
.notice { display: flex; flex-direction: column; gap: 12px; padding: 16px 20px; border-radius: 16px; background: var(--surface); box-shadow: var(--outline); color: var(--mist); }
.sent { display: flex; align-items: center; gap: 8px; color: var(--mist); font-weight: 500; }
.notes { margin-top: 8px; }

/* Settings */
.settings-card { max-width: 860px; }
.price-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; }
.price-row { display: flex; flex-direction: column; gap: 4px; }
.portfolio-entry { margin: 0; padding: 16px; border: 1px solid var(--border); border-radius: 16px; display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.portfolio-entry .grid-2 { width: 100%; }
.portfolio-entry legend { padding: 0 6px; font-size: 14px; font-weight: 500; }

/* Portrait iPad and smaller */
@media (max-width: 1000px) {
  .view, .view-visit { padding-left: 32px; padding-right: 32px; }
  .audit-cols, .total-bar { flex-direction: column; align-items: stretch; }
  .audit-side, .total-side { width: auto; }
  .pkg-grid { grid-template-columns: 1fr; }
  .display { font-size: 40px; }
}
@media (max-width: 700px) {
  body { flex-direction: column; }
  .sidebar { position: static; width: auto; height: auto; flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--badge); padding: max(12px, env(safe-area-inset-top)) 16px 12px; }
  .brand { padding: 0 12px 0 0; width: 100%; }
  .sidebar .grow, .sidebar-foot { display: none; }
  .view, .view-visit { padding: 24px 16px 40px; min-height: 0; }
  .grid-2, .price-list { grid-template-columns: 1fr; }
  .page-head { flex-direction: column; align-items: stretch; }
}
