:root {
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: #11211f;
  background:
    radial-gradient(circle at top, rgba(234, 245, 232, 0.95), transparent 35%),
    linear-gradient(180deg, #f7f3ea 0%, #eef4ef 55%, #e5ede7 100%);
  line-height: 1.4;
  font-weight: 400;
  color-scheme: light;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

#app {
  min-height: 100vh;
}

.app-shell {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 20px 16px 40px;
}

.topbar-card {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding: 18px 20px;
  margin-bottom: 16px;
}

.topbar-card p,
.report-job-copy p {
  margin: 6px 0 0;
  color: #536761;
}

.topbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.auth-card {
  max-width: 520px;
  margin: 0 auto;
}

.report-job-list {
  display: grid;
  gap: 14px;
}

.report-job-card {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.report-job-copy strong {
  display: block;
  font-size: 1.05rem;
}

.report-job-actions {
  justify-content: flex-end;
}

.card {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(17, 33, 31, 0.08);
  border-radius: 24px;
  box-shadow: 0 20px 40px rgba(31, 50, 43, 0.08);
  backdrop-filter: blur(14px);
}

.hero,
.status-card,
.stepper,
.screen-card,
.gallery-card,
.install-card,
.sync-card {
  margin-bottom: 16px;
}

.hero {
  padding: 24px;
}

.hero h1,
.gallery-card h2,
.screen-card h2 {
  margin: 0;
  font-size: clamp(2rem, 7vw, 3rem);
  line-height: 0.98;
}

.hero-copy,
.screen-copy p,
.gallery-header p,
.status-card p,
.empty-state p {
  color: #415650;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #577367;
}

.hero-actions,
.footer-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-actions {
  margin-top: 20px;
}

.hero-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.inline-message {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 18px;
  background: #edf4ee;
}

.inline-message.warning {
  background: #f7efe3;
}

.inline-message p {
  margin: 6px 0 0;
  color: #4f655e;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
}

.status-chip.saved,
.status-chip.ready {
  background: #e6f4ee;
  color: #1e6550;
}

.status-chip.saving,
.status-chip.loading,
.status-chip.neutral {
  background: #edf1f4;
  color: #46605b;
}

.status-chip.error {
  background: #f8e7e3;
  color: #923d2f;
}

.install-card,
.sync-card {
  padding: 16px 20px;
}

.install-card strong,
.sync-card strong {
  display: block;
  color: #17322d;
}

.install-card p,
.sync-card p {
  margin: 6px 0 0;
  color: #4f655e;
}

.primary-button,
.secondary-button {
  min-height: 58px;
  padding: 14px 18px;
  border-radius: 18px;
  font-size: 1rem;
  font-weight: 700;
}

.primary-button {
  color: #f8f7f3;
  background: linear-gradient(135deg, #1e6550, #0d4436);
  box-shadow: 0 14px 24px rgba(13, 68, 54, 0.24);
}

.secondary-button {
  color: #17322d;
  background: #edf3ee;
}

.primary-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.status-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 20px;
}

.status-card strong {
  display: block;
  font-size: 1.3rem;
}

.status-card p {
  margin: 4px 0 0;
}

.four-up {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.section-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
  margin-bottom: 16px;
}

.section-pill {
  min-height: 54px;
  border-radius: 18px;
  background: #edf2ee;
  color: #28453e;
  font-weight: 700;
}

.section-pill.active {
  background: #dcefe3;
  color: #143f32;
}

.section-pill:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.form-card,
.list-card {
  padding: 20px;
  margin-bottom: 16px;
}

.section-header,
.subsection-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.section-header {
  margin-bottom: 16px;
}

.section-header h2 {
  margin: 0;
  font-size: clamp(1.6rem, 5vw, 2.3rem);
  line-height: 1;
}

.section-header p,
.subsection-header span,
.summary-note {
  color: #536761;
}

.field-grid {
  display: grid;
  gap: 14px;
}

.two-column {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  color: #17322d;
  font-weight: 700;
}

.field span {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.required-mark {
  padding: 2px 8px;
  border-radius: 999px;
  background: #143f32;
  color: #f7f3ea;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 56px;
  padding: 14px 16px;
  border: 1px solid rgba(20, 51, 44, 0.14);
  border-radius: 18px;
  background: #fcfdfb;
  color: #17322d;
}

.field textarea {
  min-height: 120px;
  resize: vertical;
}

.checkbox-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 8px 0 18px;
  padding: 14px 16px;
  border-radius: 18px;
  background: #edf4ee;
  color: #17322d;
  font-weight: 700;
}

.checkbox-row input {
  width: 22px;
  height: 22px;
}

.photo-section-grid,
.summary-grid,
.sample-summary-grid {
  display: grid;
  gap: 16px;
}

.photo-panel,
.editor-card,
.summary-card,
.summary-block,
.room-card,
.summary-room-card {
  padding: 16px;
  border-radius: 20px;
  background: #f7faf8;
  border: 1px solid rgba(20, 51, 44, 0.08);
}

.room-list,
.sample-list {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.room-card,
.card-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.compact,
.ghost-button {
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.92rem;
  font-weight: 700;
}

.ghost-button {
  background: #f1f4f1;
  color: #27433c;
}

.image-strip {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.mini-photo-card {
  overflow: hidden;
  border-radius: 20px;
  background: #eef3ef;
}

.mini-photo-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.mini-photo-card button {
  width: 100%;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.single-preview {
  margin-top: 14px;
}

.slim {
  padding: 24px 12px;
}

.summary-room-card {
  display: grid;
  gap: 16px;
  margin-top: 14px;
}

.summary-room-copy p,
.summary-card p,
.room-card p {
  margin: 6px 0 0;
  color: #536761;
}

.summary-room-photos {
  display: grid;
  gap: 16px;
}

.stepper {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
}

.step-pill {
  display: grid;
  gap: 8px;
  place-items: center;
  padding: 14px 8px;
  border-radius: 18px;
  background: #edf2ee;
  color: #5e7169;
  text-align: center;
}

.step-pill span {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  font-weight: 700;
}

.step-pill.active {
  background: #dcefe3;
  color: #143f32;
}

.step-pill.done {
  background: #e7efe6;
  color: #255847;
}

.screen-card,
.gallery-card {
  padding: 20px;
}

.screen-copy p,
.gallery-header p {
  margin-top: 10px;
}

.option-grid {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.option-button {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 18px;
  border-radius: 20px;
  border: 2px solid transparent;
  background: #f4f6f1;
  color: #15302b;
  text-align: left;
  font-size: 1.05rem;
  font-weight: 700;
}

.option-button small {
  color: #5c6d67;
  font-size: 0.9rem;
  font-weight: 500;
}

.option-button.selected {
  border-color: #1e6550;
  background: #edf7f1;
}

.footer-actions {
  justify-content: space-between;
  margin-top: 22px;
}

.selection-summary {
  display: grid;
  gap: 8px;
  margin: 18px 0;
  padding: 16px;
  border-radius: 18px;
  background: #edf4ee;
  color: #28453e;
}

.upload-card {
  display: grid;
  gap: 8px;
  padding: 24px 18px;
  border: 2px dashed #7ba193;
  border-radius: 22px;
  background: #f6fbf7;
  color: #17322d;
  text-align: center;
  font-weight: 700;
}

.upload-card input {
  display: none;
}

.upload-card small {
  color: #5c7269;
  font-weight: 500;
}

.preview-card {
  overflow: hidden;
  margin-top: 16px;
  border-radius: 22px;
  background: #d9e9e0;
}

.preview-card img {
  aspect-ratio: 4 / 3;
  width: 100%;
  object-fit: cover;
}

.note-field {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  color: #14332c;
  font-weight: 700;
}

.note-field textarea {
  width: 100%;
  padding: 16px;
  border: 1px solid rgba(20, 51, 44, 0.14);
  border-radius: 18px;
  background: #fcfdfb;
  resize: vertical;
}

.gallery-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.gallery-group + .gallery-group {
  margin-top: 26px;
}

.gallery-group h3,
.empty-state h3 {
  margin: 0 0 12px;
  font-size: 1.4rem;
}

.photo-type-group + .photo-type-group {
  margin-top: 18px;
}

.group-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: #23463c;
}

.gallery-grid {
  display: grid;
  gap: 14px;
}

.gallery-item {
  overflow: hidden;
  border-radius: 22px;
  background: #f7faf8;
  border: 1px solid rgba(20, 51, 44, 0.08);
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.gallery-meta {
  display: grid;
  gap: 6px;
  padding: 14px;
}

.gallery-meta span,
.gallery-meta p {
  margin: 0;
  color: #546963;
}

.sync-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.sync-badge.saved-local {
  background: #e7f1ea;
  color: #205041;
}

.sync-badge.syncing {
  background: #edf1f8;
  color: #38558a;
}

.sync-badge.synced {
  background: #e6f4ee;
  color: #1e6550;
}

.sync-badge.sync-error {
  background: #f8e7e3;
  color: #923d2f;
}

.empty-state {
  padding: 36px 14px 20px;
  text-align: center;
}

@media (min-width: 640px) {
  .app-shell {
    padding: 28px 20px 48px;
  }

  .two-column,
  .photo-section-grid,
  .summary-grid,
  .sample-summary-grid,
  .summary-room-photos {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .two-column-span {
    grid-column: 1 / -1;
  }

  .four-up {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-job-card {
    align-items: center;
  }
}

@media (max-width: 639px) {
  .topbar-card,
  .report-job-card {
    flex-direction: column;
  }

  .topbar-actions,
  .report-job-actions {
    width: 100%;
    justify-content: stretch;
  }
}
