:root {
  color-scheme: light;
  --bg: #f4f7f5;
  --card: #ffffff;
  --ink: #14201b;
  --muted: #66736e;
  --line: #dce4df;
  --accent: #0f6b4f;
  --accent-dark: #064331;
  --accent-soft: #e4f4ee;
  --danger: #9b2c2c;
  --shadow: 0 18px 42px rgba(20, 32, 27, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: linear-gradient(180deg, #edf6f1 0, var(--bg) 280px);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a { color: inherit; }

.app-header,
.app-footer,
.app {
  width: min(1080px, calc(100% - 28px));
  margin: 0 auto;
}

.app-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  padding: 18px 0;
}

.brand {
  color: var(--accent-dark);
  font-size: 1.25rem;
  font-weight: 850;
  text-decoration: none;
}

nav { display: flex; gap: 8px; }

nav a,
.workflow button {
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 9px 12px;
  text-decoration: none;
}

nav a:hover,
.workflow button:hover { background: var(--accent-soft); color: var(--accent-dark); }

.app {
  min-height: calc(100vh - 150px);
  outline: none;
  padding: 18px 0 60px;
}

.home-hero {
  align-items: flex-start;
  display: grid;
  gap: 18px;
  padding: 52px 0 42px;
}

h1,
h2,
h3,
p { margin-top: 0; }

h1 {
  font-size: clamp(3rem, 13vw, 6.8rem);
  letter-spacing: -0.07em;
  line-height: 0.92;
  margin-bottom: 0;
}

h2 { font-size: clamp(1.45rem, 5vw, 2rem); margin-bottom: 10px; }
h3 { margin-bottom: 8px; }

.home-hero p,
.project-heading p,
.app-footer,
.empty-state,
.notice { color: var(--muted); }

.home-hero p { font-size: clamp(1.15rem, 4vw, 1.7rem); }

.button,
.file-button {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--accent-dark);
  cursor: pointer;
  display: inline-flex;
  font: 800 1rem inherit;
  justify-content: center;
  min-height: 50px;
  padding: 12px 18px;
  text-decoration: none;
}

.button.primary,
.file-button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.button.jumbo {
  border-radius: 26px;
  font-size: 1.18rem;
  min-height: 70px;
  padding: 18px 26px;
  width: min(100%, 420px);
}

.button.full { width: 100%; }
.button.ghost { color: var(--danger); min-height: 42px; }
.button:disabled { cursor: not-allowed; opacity: 0.45; }
.file-button input { display: none; }

.section-stack,
.panel,
.project-card,
.quotation-document {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 22px;
}

.section-stack,
.project-list,
.photo-grid,
.assessment-grid,
.scope-list,
.pricing-list {
  display: grid;
  gap: 14px;
}

.project-card {
  align-items: center;
  box-shadow: none;
  display: flex;
  gap: 14px;
  justify-content: space-between;
}

.project-card div { display: grid; gap: 5px; }
.project-card span { color: var(--muted); font-size: 0.92rem; }

.project-actions {
  display: flex !important;
  flex-direction: row;
  gap: 8px !important;
}

.project-actions .button {
  min-height: 42px;
  padding: 9px 14px;
}

.status-pill {
  background: var(--accent-soft);
  border-radius: 999px;
  color: var(--accent-dark) !important;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  padding: 4px 10px;
}

.project-heading,
.section-title,
.quote-head {
  align-items: flex-start;
  display: flex;
  gap: 18px;
  justify-content: space-between;
}

.project-heading { margin-bottom: 16px; }
.project-heading h1 { font-size: clamp(2.2rem, 9vw, 4.2rem); }

.workflow {
  display: flex;
  gap: 8px;
  margin: 0 0 16px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.panel { margin-bottom: 16px; }

.eyebrow {
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

label {
  color: var(--ink);
  display: grid;
  font-weight: 800;
  gap: 8px;
  margin-top: 14px;
}

input,
textarea,
select {
  background: #fbfdfc;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--ink);
  font: 500 1rem inherit;
  padding: 13px 14px;
  width: 100%;
}

textarea { resize: vertical; }

input:focus,
textarea:focus,
select:focus,
.button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(15, 107, 79, 0.2);
  outline-offset: 2px;
}

.photo-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin: 16px 0; }

.photo-card {
  background: #f9fbfa;
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
  padding: 12px;
}

.photo-card img {
  aspect-ratio: 4 / 3;
  border-radius: 18px;
  display: block;
  object-fit: cover;
  width: 100%;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 20px;
  margin: 0;
  padding: 18px;
}

.notice {
  background: #fff8e6;
  border: 1px solid #f1dca4;
  border-radius: 18px;
  padding: 14px;
}

.error-box {
  background: #fff1f1;
  border: 1px solid #f0b5b5;
  border-radius: 18px;
  color: #7a1f1f;
  padding: 14px;
}

.assessment-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 16px 0; }
.assessment-grid article { background: #f8fbf9; border-radius: 18px; padding: 16px; }
.assessment-grid ul,
.quotation-document ul { padding-left: 22px; }

.scope-item {
  align-items: start;
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr auto;
}

.price-row {
  align-items: end;
  background: #f8fbf9;
  border: 1px solid var(--line);
  border-radius: 20px;
  display: grid;
  gap: 10px;
  grid-template-columns: 2fr 0.8fr 0.8fr 0.9fr auto auto;
  padding: 12px;
}

.price-row label { margin-top: 0; }

.totals,
.quote-totals {
  background: var(--accent-soft);
  border-radius: 20px;
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr auto;
  margin-top: 16px;
  padding: 16px;
}

.form-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.quotation-actions { display: grid; gap: 12px; }

.quotation-document {
  background: #fff;
  color: #111;
  margin-top: 18px;
}

.quotation-document.hidden { display: none; }
.quotation-document h1 { font-size: 2.6rem; letter-spacing: -0.04em; }
.quotation-document table { border-collapse: collapse; margin-top: 12px; width: 100%; }
.quotation-document th,
.quotation-document td { border-bottom: 1px solid #ddd; padding: 10px; text-align: left; }
.quotation-document th { background: #f4f4f4; }
.quote-meta { background: #f8f8f8; border-radius: 16px; margin: 16px 0; padding: 14px; }
.quote-totals { margin-left: auto; max-width: 360px; }
.logo,
.logo-preview { max-height: 82px; max-width: 180px; object-fit: contain; }
.settings-panel h1 { font-size: clamp(2rem, 8vw, 4rem); }
.switch { align-items: center; display: flex; flex-direction: row; }

.app-footer { border-top: 1px solid var(--line); font-size: 0.9rem; padding: 18px 0 28px; }

@media (max-width: 760px) {
  .app-header,
  .project-heading,
  .section-title,
  .project-card,
  .quote-head { flex-direction: column; }

  .project-card { align-items: stretch; }
  .project-actions { width: 100%; }

  .panel,
  .section-stack,
  .project-card,
  .quotation-document { border-radius: 22px; padding: 18px; }

  .assessment-grid,
  .form-grid,
  .price-row { grid-template-columns: 1fr; }

  .scope-item { grid-template-columns: 1fr; }

  .button,
  .file-button { width: 100%; }
}

@media print {
  body { background: #fff; }
  .no-print,
  .app-header,
  .app-footer,
  .app > :not(#quotation-preview) { display: none !important; }
  .app { width: 100%; padding: 0; }
  .quotation-document { border: 0; box-shadow: none; display: block !important; margin: 0; }
}
