:root {
  --ink: #14213a;
  --muted: #65748a;
  --line: #d8e2ee;
  --paper: #ffffff;
  --soft: #f3f7fb;
  --blue: #1f55a6;
  --blue-dark: #142766;
  --blue-light: #e8f2ff;
  --navy: #101b34;
  --green: #2f7d63;
  --gold: #a66f23;
  --shadow: 0 18px 45px rgba(22, 38, 55, 0.1);
}

* {
  box-sizing: border-box;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes softPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(31, 85, 166, 0.2);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(31, 85, 166, 0);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes statusFlash {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.45;
    transform: scale(1.18);
  }
}

@keyframes shimmer {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(120%);
  }
}

@keyframes outputLift {
  0% {
    opacity: 0;
    filter: blur(8px);
    transform: translateY(28px) scale(0.975);
  }
  62% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(-2px) scale(1.002);
  }
  100% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) scale(1);
  }
}

@keyframes readyGlow {
  from {
    box-shadow: 0 18px 42px rgba(31, 85, 166, 0.08);
  }
  to {
    box-shadow: 0 24px 60px rgba(31, 85, 166, 0.14);
  }
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(31, 85, 166, 0.12), transparent 36rem),
    linear-gradient(180deg, #f8fbff 0%, var(--soft) 48%, #eef4fb 100%);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 40px;
  padding: 0 14px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease;
}

button:hover {
  border-color: #b8c9d9;
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

button:disabled {
  cursor: wait;
  opacity: 0.82;
  transform: none;
}

.primary {
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  border-color: var(--blue);
  color: #fff;
  box-shadow: 0 12px 28px rgba(31, 85, 166, 0.22);
  position: relative;
  overflow: hidden;
}

.primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 20%, rgba(255, 255, 255, 0.22) 50%, transparent 80%);
  transform: translateX(-120%);
}

.primary:hover::after,
.primary.is-loading::after {
  animation: shimmer 1.4s ease infinite;
}

.large-action {
  width: 100%;
  min-height: 52px;
  font-size: 0.98rem;
}

.app {
  width: min(1440px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0;
}

.brand-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  border: 1px solid rgba(31, 85, 166, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
  padding: 12px 16px;
  backdrop-filter: blur(12px);
  animation: fadeUp 420ms ease both;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-lockup img {
  width: 58px;
  height: 58px;
  border-radius: 10px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
}

.brand-lockup strong {
  display: block;
  color: var(--blue-dark);
  font-size: 1.05rem;
}

.brand-lockup span,
.brand-status {
  color: var(--muted);
  font-size: 0.86rem;
}

.brand-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  background: var(--blue-light);
  padding: 8px 12px;
  font-weight: 700;
  transition: background 180ms ease, color 180ms ease;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(47, 125, 99, 0.13);
}

.status-ready .status-dot {
  background: var(--green);
  animation: softPulse 2.2s ease infinite;
}

.status-working {
  background: #e6f8ef;
  color: #1f6d51;
}

.status-working .status-dot {
  background: #22a06b;
  animation: statusFlash 850ms ease infinite;
}

.status-error {
  background: #fff0f0;
  color: #9f3434;
}

.status-error .status-dot {
  background: #d34848;
  box-shadow: 0 0 0 4px rgba(211, 72, 72, 0.13);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 18px;
  align-items: stretch;
  margin-bottom: 18px;
  animation: fadeUp 520ms ease 80ms both;
}

.hero > div,
.model-card,
.stats article,
.supplier-panel,
.detail-panel,
.upload-box,
.result-panel,
.api-card,
.ai-output,
.training-example {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.hero-intro {
  position: relative;
  overflow: hidden;
  padding: 34px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(232, 242, 255, 0.9)),
    #fff;
}

.hero-intro::after {
  content: "";
  position: absolute;
  right: -80px;
  bottom: -120px;
  width: 360px;
  height: 360px;
  border: 44px solid rgba(31, 85, 166, 0.08);
  border-radius: 50%;
  pointer-events: none;
}

.model-card {
  display: grid;
  align-content: center;
  padding: 22px;
  background: var(--navy);
  color: #fff;
}

.model-card p {
  color: #c9d7e9;
}

.model-card code {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.eyebrow {
  display: block;
  margin-bottom: 8px;
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 820px;
  margin-bottom: 12px;
  font-size: clamp(2rem, 4.8vw, 4.4rem);
  line-height: 1;
  letter-spacing: 0;
}

.internal-note {
  display: inline-flex;
  width: fit-content;
  margin: 0 0 14px;
  border-radius: 999px;
  background: rgba(20, 39, 102, 0.08);
  color: var(--blue-dark);
  padding: 7px 12px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h2 {
  margin-bottom: 0;
  font-size: 1.1rem;
}

h3 {
  margin-bottom: 12px;
  font-size: 1rem;
}

p {
  color: var(--muted);
  line-height: 1.55;
}

code {
  border-radius: 6px;
  background: #eef5fa;
  color: var(--blue-dark);
  padding: 2px 5px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-width: 800px;
  margin-top: 24px;
}

.steps div {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(31, 85, 166, 0.14);
  border-radius: 10px;
  background: #fff;
  padding: 12px;
}

.steps strong {
  display: grid;
  place-items: center;
  flex: 0 0 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
}

.steps span {
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 700;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.stats article {
  padding: 18px;
  background: linear-gradient(180deg, #fff, #f8fbff);
  animation: fadeUp 500ms ease both;
}

.stats article:nth-child(2) {
  animation-delay: 70ms;
}

.stats article:nth-child(3) {
  animation-delay: 140ms;
}

.stats article:nth-child(4) {
  animation-delay: 210ms;
}

.stats strong {
  display: block;
  font-size: 1.9rem;
}

.stats span {
  color: var(--muted);
  font-size: 0.86rem;
}

.page-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow);
  padding: 8px;
}

.page-tab {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.page-tab.active {
  background: var(--blue-dark);
  color: #fff;
  box-shadow: 0 10px 24px rgba(20, 39, 102, 0.18);
}

.workspace {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  animation: fadeUp 560ms ease 180ms both;
}

.plan-workspace {
  grid-template-columns: minmax(0, 1fr);
}

.welcome-screen {
  display: grid;
  min-height: min(58vh, 620px);
  max-height: 780px;
  overflow: hidden;
  place-items: center;
  border: 1px solid #d9e2ee;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(232, 242, 255, 0.82)),
    #fff;
  padding: 42px 22px;
  opacity: 1;
  transform: translateY(0) scale(1);
  transition:
    max-height 620ms cubic-bezier(0.22, 1, 0.36, 1),
    padding 520ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 280ms ease,
    border-color 280ms ease,
    transform 480ms cubic-bezier(0.22, 1, 0.36, 1);
}

.welcome-card {
  display: grid;
  justify-items: center;
  width: min(720px, 100%);
  text-align: center;
  animation: outputLift 680ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.welcome-card h2 {
  margin-bottom: 12px;
  color: var(--navy);
  font-size: clamp(1.9rem, 4vw, 3.3rem);
  line-height: 1.04;
}

.welcome-card p {
  max-width: 590px;
  margin-bottom: 24px;
  font-size: 1rem;
}

.welcome-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  margin-bottom: 26px;
}

.welcome-steps article {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(31, 85, 166, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  padding: 12px;
  text-align: left;
}

.welcome-steps strong {
  display: grid;
  place-items: center;
  flex: 0 0 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--blue-dark);
  color: #fff;
  font-size: 0.82rem;
}

.welcome-steps span {
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 800;
}

.welcome-start {
  min-width: min(260px, 100%);
  min-height: 52px;
  font-size: 1rem;
}

.estimator-workspace-panel {
  max-height: 0;
  overflow: hidden;
  border-color: transparent;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(24px) scale(0.985);
  transition:
    max-height 760ms cubic-bezier(0.22, 1, 0.36, 1),
    padding 480ms ease,
    opacity 360ms ease 80ms,
    border-color 280ms ease,
    transform 600ms cubic-bezier(0.22, 1, 0.36, 1);
}

.plan-workspace.input-mode .welcome-screen {
  max-height: 0;
  border-color: transparent;
  border-width: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-18px) scale(0.985);
}

.plan-workspace.input-mode .estimator-workspace-panel {
  max-height: 5000px;
  border-color: #d9e2ee;
  padding-top: 16px;
  padding-bottom: 16px;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.pricing-workspace {
  grid-template-columns: 380px minmax(0, 1fr);
}

#projectsPage,
#reviewPage,
#devPage {
  grid-template-columns: minmax(0, 1fr);
}

.app-page:not(.active) {
  display: none;
}

.app-page.active {
  display: grid;
}

.supplier-panel,
.detail-panel {
  padding: 18px;
}

.supplier-panel {
  position: sticky;
  top: 18px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  min-height: 42px;
  padding: 10px 12px;
  outline: none;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #7aa7db;
  box-shadow: 0 0 0 4px rgba(31, 85, 166, 0.11);
}

textarea {
  resize: vertical;
}

label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 700;
}

.supplier-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.supplier-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfdff;
  padding: 14px;
  text-align: left;
  transition: 160ms ease;
}

.supplier-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(22, 38, 55, 0.08);
}

.supplier-card.active {
  border-color: var(--blue);
  background: var(--blue-light);
}

.supplier-card strong {
  display: block;
  font-size: 1rem;
}

.supplier-card span,
.small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  border-radius: 999px;
  background: var(--blue-light);
  color: var(--blue-dark);
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 800;
}

.tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
  overflow-x: auto;
}

.tab {
  border: 0;
  border-radius: 8px 8px 0 0;
  background: transparent;
}

.tab.active {
  background: #e8f3fb;
  color: var(--blue-dark);
}

.tab-view {
  display: none;
}

.tab-view.active {
  display: grid;
  gap: 16px;
}

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

.upload-box {
  padding: 18px;
  background: linear-gradient(180deg, #fff, #fbfdff);
}

.analysis-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 16px;
  margin-bottom: 16px;
  max-height: 1200px;
  opacity: 1;
  overflow: hidden;
  transform: translateY(0);
  transform-origin: top center;
  will-change: max-height, opacity, transform;
  transition:
    max-height 620ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 320ms ease,
    margin 520ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

.result-panel {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 18px;
  transform: translateY(0);
  will-change: margin, transform, opacity;
  transition:
    margin 520ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

.plan-workspace.results-mode .analysis-grid {
  max-height: 0;
  margin-bottom: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-22px) scale(0.975);
}

.plan-workspace.results-mode .result-panel {
  margin-top: 0;
  animation: outputLift 720ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.plan-workspace.results-mode .report-shell {
  min-height: 360px;
}

.ready-report {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 240px;
  border: 1px solid rgba(31, 85, 166, 0.16);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(232, 242, 255, 0.94), rgba(255, 255, 255, 0.98)),
    #fff;
  padding: 24px;
  animation: readyGlow 900ms ease both;
}

.ready-report strong {
  display: block;
  color: var(--blue-dark);
  font-size: clamp(1.45rem, 2.4vw, 2.2rem);
}

.ready-report p {
  max-width: 620px;
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

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

.edit-inputs-button {
  justify-self: start;
  margin-bottom: 10px;
}

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

.file-list,
.examples {
  display: grid;
  gap: 10px;
}

.file-row,
.training-example {
  padding: 12px;
}

.file-row {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfdff;
  animation: fadeUp 240ms ease both;
}

.prepared-files {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdff;
  overflow: hidden;
}

.prepared-files summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
}

.prepared-files summary::-webkit-details-marker {
  display: none;
}

.prepared-files summary span:first-child {
  display: grid;
  gap: 4px;
}

.prepared-files small {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.summary-action {
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--blue-light);
  color: var(--blue-dark);
  padding: 7px 10px;
  font-size: 0.78rem;
  font-weight: 800;
}

.prepared-files[open] .summary-action {
  background: var(--blue-dark);
  color: #fff;
}

.prepared-file-list {
  display: grid;
  gap: 8px;
  max-height: 320px;
  overflow: auto;
  border-top: 1px solid var(--line);
  padding: 10px;
}

.compact-file {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
}

.file-thumb {
  width: 92px;
  height: 68px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  object-fit: cover;
  object-position: top left;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.summary-grid article {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff, #f8fbff);
  padding: 14px;
}

.summary-grid strong {
  display: block;
  color: var(--blue-dark);
  font-size: 1.15rem;
}

.summary-grid span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.records-list {
  display: grid;
  gap: 12px;
}

.project-toolbar {
  display: inline-flex;
  gap: 8px;
  margin: -2px 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fbff;
  padding: 5px;
}

.project-filter {
  min-height: 34px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
  font-size: 0.86rem;
  box-shadow: none;
}

.project-filter:hover {
  background: #fff;
  transform: none;
}

.project-filter.active {
  background: var(--blue-dark);
  color: #fff;
}

.ai-review-workspace {
  display: grid;
  gap: 14px;
}

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

.review-summary-grid article,
.review-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
}

.review-summary-grid article {
  padding: 14px;
}

.review-summary-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.review-summary-grid strong {
  display: block;
  margin-top: 6px;
  color: var(--blue-dark);
  font-size: 1.28rem;
  text-transform: capitalize;
}

.review-warning,
.pricing-note {
  border: 1px solid #f0d3a8;
  border-radius: 8px;
  background: #fff8ed;
  color: #82551d;
  padding: 12px 14px;
  font-weight: 800;
}

.review-warning.danger {
  border-color: #f1b8b8;
  background: #fff1f1;
  color: #9f3434;
}

.ai-estimate-card {
  display: grid;
  gap: 14px;
  border: 1px solid #cfdced;
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(232, 242, 255, 0.74), rgba(255, 255, 255, 0.96)),
    #fff;
  padding: 16px;
}

.ai-estimate-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ai-estimate-header h3 {
  margin: 2px 0 0;
  color: var(--blue-dark);
  font-size: 1.25rem;
}

.confidence-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border-radius: 999px;
  border: 1px solid #cfdced;
  background: #fff;
  color: var(--blue-dark);
  padding: 0 12px;
  font-weight: 900;
  white-space: nowrap;
}

.confidence-pill.very-high,
.confidence-pill.high {
  border-color: rgba(47, 125, 99, 0.24);
  background: #eaf8f2;
  color: #1f6d51;
}

.confidence-pill.medium {
  border-color: #f0d3a8;
  background: #fff8ed;
  color: #82551d;
}

.confidence-pill.low {
  border-color: #f1b8b8;
  background: #fff1f1;
  color: #9f3434;
}

.ai-total-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.ai-total-strip article {
  border: 1px solid #d9e2ee;
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.ai-total-strip span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ai-total-strip strong {
  display: block;
  margin-top: 4px;
  color: var(--blue-dark);
  font-size: 1.24rem;
}

.ai-estimate-table-wrap .report-table-wrap {
  margin: 0;
  box-shadow: none;
}

.ai-estimate-table-wrap th {
  background: #142766;
  color: #fff;
}

.price-decision-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ai-price-card {
  display: grid;
  gap: 14px;
  border: 1px solid rgba(31, 85, 166, 0.22);
  border-radius: 10px;
  background: #0f1b30;
  color: #fff;
  padding: 18px;
}

.ai-price-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.ai-price-main .eyebrow {
  color: #9fc5ff;
}

.ai-price-main strong {
  display: block;
  margin-top: 5px;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1;
}

.ai-price-main p {
  max-width: 780px;
  margin: 10px 0 0;
  color: #d6e4f6;
  line-height: 1.5;
}

.ai-price-breakdown {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ai-price-breakdown article {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  padding: 12px;
}

.ai-price-breakdown span {
  display: block;
  color: #9fc5ff;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ai-price-breakdown strong {
  display: block;
  margin-top: 5px;
  font-size: 1.14rem;
}

.price-notes {
  display: grid;
  gap: 6px;
  margin: 0;
  color: #d6e4f6;
  padding-left: 18px;
}

.supplier-price-details,
.ai-hidden-details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.supplier-price-details {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
}

.supplier-price-details summary,
.ai-hidden-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
  list-style: none;
  padding: 14px;
}

.supplier-price-details summary::-webkit-details-marker,
.ai-hidden-details summary::-webkit-details-marker {
  display: none;
}

.supplier-price-details summary strong,
.ai-hidden-details summary strong {
  display: block;
}

.supplier-price-details summary small,
.ai-hidden-details summary small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-weight: 700;
}

.supplier-price-details summary small,
.supplier-price-details .summary-action {
  color: #d6e4f6;
}

.supplier-price-details .report-table-wrap {
  margin: 0 14px 14px;
  background: #fff;
}

.ai-hidden-content {
  display: grid;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding: 14px;
}

.review-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(0, 1.15fr);
  gap: 14px;
}

.review-card {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.review-card h3 {
  margin: 0;
}

.review-file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.review-file {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  padding: 10px;
}

.review-file img,
.file-placeholder {
  width: 100%;
  height: 110px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  object-fit: cover;
  object-position: top left;
}

.file-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 800;
}

.review-file strong,
.review-file span {
  overflow-wrap: anywhere;
}

.review-file span {
  color: var(--muted);
  font-size: 0.78rem;
}

.mini-checklist {
  display: grid;
  gap: 6px;
}

.takeoff-editor {
  display: grid;
  gap: 12px;
}

.room-editor {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  padding: 14px;
}

.room-editor-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 10px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  color: var(--ink);
  font-weight: 800;
}

.checkbox-label input {
  width: auto;
  min-height: auto;
}

.review-confidence-input {
  max-width: 240px;
}

.calculator-output {
  display: grid;
  gap: 12px;
}

#projectRecords,
#learningRecords {
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
}

.record-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff, #fbfdff);
  box-shadow: 0 10px 24px rgba(22, 38, 55, 0.06);
  padding: 15px;
}

.record-card strong {
  display: block;
  color: var(--blue-dark);
}

.record-card.archived {
  background: #f7f8fa;
  color: #58667a;
}

.record-card.archived strong {
  color: #42526b;
}

.dev-tab {
  opacity: 0.8;
}

.dev-gate,
.dev-log-panel {
  display: grid;
  gap: 14px;
  width: 100%;
}

.dev-gate[hidden],
.dev-log-panel[hidden] {
  display: none;
}

.dev-gate {
  border: 1px solid #d9e2ee;
  border-radius: 8px;
  background: #f7fbff;
  padding: 16px;
}

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

.dev-summary article,
.dev-log-card {
  border: 1px solid #d9e2ee;
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.dev-summary strong {
  display: block;
  color: var(--blue-dark);
  font-size: 1.4rem;
}

.dev-summary span,
.dev-log-card span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.dev-log-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr));
  align-items: start;
  gap: 10px;
}

.dev-log-card {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.dev-log-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.dev-log-head > div {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.dev-category {
  width: fit-content;
  border-radius: 999px;
  background: #eaf3ff;
  color: var(--blue-dark);
  padding: 5px 9px;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dev-menu {
  overflow: hidden;
  border: 1px solid #d9e2ee;
  border-radius: 8px;
  background: #f8fbff;
}

.dev-menu summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  cursor: pointer;
  list-style: none;
}

.dev-menu summary::-webkit-details-marker {
  display: none;
}

.dev-menu summary span:first-child {
  display: grid;
  gap: 4px;
}

.dev-menu summary strong {
  color: var(--blue-dark);
}

.dev-menu summary small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.dev-menu[open] .summary-action {
  background: var(--blue-dark);
  color: #fff;
}

.dev-menu-body {
  display: grid;
  gap: 12px;
  border-top: 1px solid #d9e2ee;
  padding: 12px;
  background: #fff;
}

.dev-clean-grid,
.dev-answer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.dev-clean-grid article,
.dev-answer-chip,
.dev-note {
  border: 1px solid #d9e2ee;
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.dev-clean-grid article strong,
.dev-answer-chip strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 0.98rem;
}

.dev-answer-chip.yes {
  border-color: rgba(47, 125, 99, 0.24);
  background: #f0fbf6;
}

.dev-answer-chip.no {
  background: #fbfdff;
}

.dev-note span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.dev-note p {
  margin: 6px 0 0;
  color: var(--ink);
}

.raw-dev-menu {
  background: #fff;
}

.dev-log-card pre {
  max-height: 520px;
  overflow: auto;
  border: 1px solid #d9e2ee;
  border-radius: 8px;
  background: #0f1b30;
  color: #eaf3ff;
  padding: 12px;
  white-space: pre-wrap;
}

.record-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.pricing-db-summary,
.pricing-db-table {
  display: grid;
  gap: 12px;
}

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

.correction-output {
  display: grid;
  gap: 10px;
  border: 1px dashed rgba(31, 85, 166, 0.32);
  border-radius: 12px;
  background: #fff;
  padding: 14px;
}

.correction-output:empty {
  display: none;
}

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  place-items: center;
  background:
    radial-gradient(circle at top, rgba(31, 85, 166, 0.24), transparent 34rem),
    rgba(16, 27, 52, 0.68);
  padding: 22px;
  backdrop-filter: blur(10px);
}

.login-overlay.show {
  display: grid;
}

body.is-locked {
  overflow: hidden;
}

.login-card {
  display: grid;
  gap: 14px;
  width: min(430px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 28px 80px rgba(16, 27, 52, 0.28);
  padding: 28px;
  animation: fadeUp 260ms ease both;
}

.login-card img {
  width: 84px;
  height: 84px;
  border: 1px solid var(--line);
  border-radius: 14px;
  object-fit: contain;
  background: #fff;
}

.login-card h2 {
  color: var(--blue-dark);
  font-size: 1.6rem;
}

.login-card p {
  margin-bottom: 0;
}

.login-error {
  min-height: 20px;
  color: #9f3434;
  font-size: 0.86rem;
  font-weight: 800;
}

.workflow-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  place-items: center;
  padding: 22px;
}

.workflow-modal.show {
  display: grid;
}

.workflow-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 27, 48, 0.48);
  backdrop-filter: blur(8px);
}

.workflow-modal-card {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
  width: min(760px, 100%);
  max-height: min(760px, calc(100vh - 44px));
  overflow-y: auto;
  border: 1px solid #d9e2ee;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(16, 27, 52, 0.24);
  padding: 18px;
  animation: outputLift 440ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.workflow-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.workflow-modal-header h3 {
  margin: 0;
  color: var(--blue-dark);
}

.approval-summary {
  border: 1px solid #d9e2ee;
  border-radius: 8px;
  background: #f7fbff;
  padding: 14px;
}

.approval-summary.reject {
  background: #fff8ed;
}

.approval-summary span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.approval-summary strong {
  display: block;
  margin-top: 5px;
  color: var(--blue-dark);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
}

.approval-summary p {
  margin: 8px 0 0;
  color: var(--muted);
}

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

.button-survey {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.survey-question-card {
  display: grid;
  gap: 10px;
  border: 1px solid #d9e2ee;
  border-radius: 8px;
  background: #fbfdff;
  padding: 12px;
}

.survey-question-card strong {
  color: var(--ink);
  font-size: 0.9rem;
}

.survey-toggle-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.survey-toggle {
  min-height: 38px;
  border-color: #d9e2ee;
  background: #fff;
  color: var(--muted);
}

.survey-toggle.active {
  border-color: rgba(31, 85, 166, 0.3);
  background: linear-gradient(135deg, #eaf3ff, #f8fbff);
  color: var(--blue-dark);
  box-shadow: inset 0 0 0 1px rgba(31, 85, 166, 0.08);
}

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

.survey-rating-select {
  border-color: rgba(31, 85, 166, 0.22);
  background:
    linear-gradient(135deg, rgba(232, 242, 255, 0.78), rgba(255, 255, 255, 0.96)),
    #fff;
  color: var(--blue-dark);
  font-weight: 800;
}

.training-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
  align-items: start;
}

.training-layout section {
  display: grid;
  gap: 12px;
}

.api-card,
.ai-output,
.report-shell {
  padding: 16px;
}

.ai-output {
  background: #102235;
  color: #edf7ff;
  min-height: 150px;
  white-space: pre-wrap;
}

.report-shell {
  min-height: 420px;
  overflow: auto;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--ink);
  line-height: 1.58;
}

.plan-output {
  min-height: 420px;
  overflow: auto;
  line-height: 1.5;
}

.empty-report {
  display: grid;
  align-content: center;
  min-height: 360px;
  text-align: center;
  padding: 36px;
}

.empty-report strong {
  font-size: 1.25rem;
  color: var(--blue-dark);
}

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

.report-section {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdff;
  padding: 16px;
  animation: fadeUp 260ms ease both;
}

.report-section h3 {
  margin: 0 0 10px;
  color: var(--blue-dark);
  font-size: 1.02rem;
}

.priority-chart {
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.priority-chart h3 {
  font-size: 1.18rem;
}

.confidence-summary {
  background: linear-gradient(180deg, #fff, #f8fbff);
  padding: 14px;
}

.confidence-compact {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  align-items: stretch;
  gap: 12px;
}

.confidence-compact > span {
  display: grid;
  place-items: center start;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--blue-dark);
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 0 14px;
  text-transform: uppercase;
}

.confidence-score {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  border: 1px solid rgba(31, 85, 166, 0.16);
  border-radius: 10px;
  background: var(--blue-light);
  padding: 16px 18px;
  text-align: left;
}

.confidence-score strong {
  color: var(--blue-dark);
  font-size: clamp(2rem, 5vw, 4.2rem);
  line-height: 0.95;
}

.confidence-score span {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--blue-dark);
  font-size: 0.82rem;
  font-weight: 800;
  padding: 8px 10px;
  white-space: nowrap;
}

.confidence-high .confidence-score {
  background: #e6f8ef;
}

.confidence-medium .confidence-score {
  background: #fff8e8;
}

.confidence-low .confidence-score {
  background: #fff0f0;
}

.confidence-details {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}

.confidence-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
}

.confidence-details summary::-webkit-details-marker {
  display: none;
}

.confidence-details summary span:first-child {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 800;
}

.confidence-details[open] .summary-action {
  background: var(--blue-dark);
  color: #fff;
}

.confidence-details-body {
  border-top: 1px solid var(--line);
  padding: 12px;
}

.confidence-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 10px;
}

.confidence-grid > div {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 12px;
}

.confidence-grid strong {
  display: block;
  color: var(--blue-dark);
}

.ai-notes-dropdown {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.ai-notes-dropdown summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  cursor: pointer;
  list-style: none;
}

.ai-notes-dropdown summary::-webkit-details-marker {
  display: none;
}

.ai-notes-dropdown summary span:first-child {
  display: grid;
  gap: 4px;
}

.ai-notes-dropdown small {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.ai-notes-content {
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 12px;
  background: #f8fbff;
}

.review-actions {
  background: #fff;
}

.review-button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.reject-button {
  background: #fff5f5;
  border-color: #f0caca;
  color: #9f3434;
}

.danger-button {
  background: #9f3434;
  border-color: #9f3434;
  color: #fff;
}

.danger-button:hover {
  border-color: #7f2424;
  background: #842727;
}

#reviewPanel {
  margin-top: 14px;
}

.email-draft-panel,
.feedback-panel {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fbff;
  padding: 14px;
}

.email-preview {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(31, 85, 166, 0.16);
  border-radius: 12px;
  background: #fff;
  padding: 14px;
}

.email-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--blue-dark), var(--blue));
  color: #fff;
  padding: 14px;
}

.email-preview-header span {
  font-weight: 800;
}

.report-line {
  margin: 7px 0;
  color: #27364a;
}

.report-line strong {
  color: var(--ink);
}

.report-list {
  margin: 8px 0 0;
  padding-left: 20px;
}

.report-list li {
  margin: 7px 0;
}

.report-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.report-table {
  width: 100%;
  min-width: 880px;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.report-table th,
.report-table td {
  border-bottom: 1px solid var(--line);
  padding: 12px;
  text-align: left;
  vertical-align: top;
}

.report-table th {
  position: sticky;
  top: 0;
  background: var(--blue-dark);
  color: #fff;
  font-size: 0.78rem;
}

.report-table tr:nth-child(even) td {
  background: #f8fbff;
}

.report-table tr:last-child td {
  border-bottom: 0;
}

.loading-report {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 14px;
  min-height: 390px;
  text-align: center;
  padding: 36px;
}

.loading-report strong {
  color: var(--blue-dark);
  font-size: 1.25rem;
}

.progress-meter {
  position: relative;
  width: min(520px, 100%);
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #dbe8f7;
  box-shadow: inset 0 1px 3px rgba(16, 27, 52, 0.14);
}

.progress-meter span {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue-dark), var(--blue));
  transform-origin: left center;
  transition: transform 180ms linear;
  will-change: transform;
}

.progress-meter span::after {
  content: none;
}

.progress-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.progress-meta span {
  border-radius: 999px;
  background: #f1f6fc;
  color: var(--blue-dark);
  padding: 7px 10px;
  font-size: 0.82rem;
  font-weight: 800;
}

.loading-steps {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}

.loading-steps span {
  border-radius: 999px;
  background: #eef3f8;
  color: var(--muted);
  padding: 7px 10px;
  font-size: 0.78rem;
  font-weight: 800;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.loading-steps span.step-active {
  background: var(--blue-light);
  color: var(--blue-dark);
  transform: translateY(-1px);
}

.training-example {
  display: grid;
  gap: 8px;
}

.training-example p {
  margin-bottom: 0;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: 360px;
  border-radius: 8px;
  background: #122235;
  color: #fff;
  padding: 13px 16px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  transition: 180ms ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.processing-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(16, 27, 52, 0.28);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.processing-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.processing-card {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 12px;
  width: min(420px, calc(100vw - 40px));
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 24px 70px rgba(16, 27, 52, 0.24);
  padding: 28px;
  text-align: center;
  animation: outputLift 360ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.processing-card strong {
  color: var(--blue-dark);
  font-size: 1.15rem;
}

.processing-card p {
  margin-bottom: 0;
}

.processing-wheel {
  position: relative;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 5px solid #dbe8f7;
  border-top-color: var(--blue-dark);
  animation: spin 850ms linear infinite;
}

.processing-wheel::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  border: 3px solid transparent;
  border-bottom-color: var(--blue);
  animation: spin 1.2s linear infinite reverse;
}

/* Enterprise workspace shell */
body {
  background: #f5f7fb;
}

.app.app-shell {
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  gap: 0;
  width: 100%;
  max-width: none;
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

.app-sidebar {
  position: sticky;
  top: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 22px;
  height: 100vh;
  border-right: 1px solid #d9e2ee;
  background: #ffffff;
  padding: 20px 16px;
  z-index: 5;
}

.sidebar-brand {
  gap: 12px;
  border-bottom: 1px solid #edf1f6;
  padding-bottom: 18px;
}

.sidebar-brand img {
  width: 48px;
  height: 48px;
  border-radius: 8px;
}

.sidebar-brand strong {
  color: var(--blue-dark);
  font-size: 1rem;
}

.sidebar-brand span {
  color: var(--muted);
  font-size: 0.82rem;
}

.app-main {
  min-width: 0;
  padding: 22px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  border: 1px solid #d9e2ee;
  border-radius: 8px;
  background: #fff;
  padding: 18px 20px;
}

.topbar h1 {
  max-width: none;
  margin: 0;
  color: var(--navy);
  font-size: clamp(1.55rem, 2.1vw, 2.15rem);
  line-height: 1.1;
}

.topbar-status {
  max-width: 780px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.45;
}

.topbar .eyebrow {
  margin-bottom: 5px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-bar,
.hero {
  display: none;
}

.brand-status {
  width: 100%;
  justify-content: flex-start;
  border: 1px solid #d9e2ee;
  border-radius: 8px;
  background: #f7fbff;
  padding: 10px 12px;
}

.sidebar-footer {
  display: grid;
  gap: 10px;
  border-top: 1px solid #edf1f6;
  padding-top: 14px;
}

.sidebar-note {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page-tabs {
  display: grid;
  align-content: start;
  gap: 6px;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.page-tab {
  display: grid;
  gap: 2px;
  min-height: 54px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  padding: 10px 12px;
  text-align: left;
}

.page-tab span {
  font-size: 0.92rem;
  font-weight: 800;
}

.page-tab small {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.page-tab:hover {
  border-color: #d9e2ee;
  background: #f7faff;
  transform: none;
}

.page-tab.active {
  border-color: rgba(31, 85, 166, 0.24);
  background: #eaf3ff;
  color: var(--blue-dark);
  box-shadow: none;
}

.page-tab.active small {
  color: #486486;
}

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

.app-main.estimator-welcome-mode .stats {
  display: none;
}

.app-main[data-active-page="devPage"] .stats {
  display: none;
}

.stats article {
  border: 1px solid #d9e2ee;
  border-radius: 8px;
  box-shadow: none;
  padding: 14px 16px;
}

.stats strong {
  font-size: 1.45rem;
}

.workspace {
  gap: 14px;
  animation: none;
}

.detail-panel,
.supplier-panel,
.upload-box,
.result-panel,
.report-section,
.report-shell,
.prepared-files,
.record-card,
.summary-grid article,
.report-table-wrap,
.ai-notes-dropdown,
.email-draft-panel,
.feedback-panel {
  border-color: #d9e2ee;
  border-radius: 8px;
  box-shadow: none;
}

.detail-panel,
.supplier-panel {
  padding: 16px;
}

.plan-workspace:not(.input-mode) .estimator-workspace-panel {
  border-width: 0;
  padding-top: 0;
  padding-bottom: 0;
}

.plan-workspace.input-mode .estimator-workspace-panel {
  border-width: 1px;
  padding: 16px;
}

#devPage {
  align-items: stretch;
}

#devPage .detail-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: calc(100vh - 118px);
}

#devPage .dev-gate {
  align-content: center;
  min-height: 420px;
}

.supplier-panel {
  top: 22px;
}

.panel-header {
  margin-bottom: 14px;
}

.analysis-grid {
  grid-template-columns: minmax(360px, 0.82fr) minmax(0, 1.18fr);
  gap: 14px;
}

.upload-box,
.result-panel {
  padding: 16px;
}

.upload-box p {
  margin-bottom: 12px;
  font-size: 0.92rem;
}

input,
textarea,
select {
  min-height: 40px;
  border-color: #d9e2ee;
  border-radius: 7px;
  background: #fcfdff;
}

.large-action {
  min-height: 48px;
}

.report-shell {
  min-height: 520px;
  background: #fff;
}

.empty-report {
  min-height: 320px;
}

.report-content {
  gap: 12px;
}

.report-section {
  padding: 14px;
}

.record-card {
  background: #fff;
  padding: 14px;
}

.record-card:hover,
.supplier-card:hover {
  border-color: #b8c9d9;
  box-shadow: 0 8px 20px rgba(22, 38, 55, 0.06);
}

.supplier-card {
  border-radius: 8px;
  box-shadow: none;
}

.pricing-workspace {
  grid-template-columns: 340px minmax(0, 1fr);
}

#projectsPage,
#reviewPage {
  grid-template-columns: minmax(0, 1fr);
}

@media (max-width: 980px) {
  .app.app-shell {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid #d9e2ee;
  }

  .app-main {
    padding: 16px;
  }

  .pricing-workspace {
    grid-template-columns: 1fr;
  }

  .hero,
  .workspace,
  .analysis-grid,
  .review-layout,
  .training-layout,
  .correction-grid,
  .confidence-grid {
    grid-template-columns: 1fr;
  }

  .supplier-panel {
    position: static;
  }

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

  .steps {
    grid-template-columns: 1fr;
  }

  .page-tabs {
    grid-template-columns: repeat(5, minmax(150px, 1fr));
    overflow-x: auto;
  }

  .page-tab {
    min-width: 150px;
  }

  .sidebar-footer {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }
}

@media (max-width: 640px) {
  .app {
    width: min(100vw - 20px, 1440px);
    padding: 10px 0;
  }

  .app.app-shell {
    width: 100%;
    padding: 0;
  }

  .app-sidebar,
  .app-main {
    padding: 12px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
    padding: 14px;
  }

  .ready-report {
    align-items: stretch;
    flex-direction: column;
  }

  .ready-actions {
    justify-content: flex-start;
  }

  .ai-estimate-header,
  .ai-price-main {
    flex-direction: column;
  }

  .ai-price-breakdown {
    grid-template-columns: 1fr;
  }

  .hero-intro,
  .model-card,
  .supplier-panel,
  .detail-panel {
    padding: 16px;
  }

  .stats,
  .form-grid,
  .summary-grid,
  .review-summary-grid,
  .ai-total-strip,
  .survey-grid,
  .survey-rating-grid,
  .dev-summary,
  .welcome-steps,
  .room-editor-head {
    grid-template-columns: 1fr;
  }

  .welcome-screen {
    min-height: 54vh;
    padding: 28px 14px;
  }

  .welcome-card {
    justify-items: stretch;
    text-align: left;
  }

  .welcome-start {
    width: 100%;
  }

  .record-card {
    align-items: stretch;
    flex-direction: column;
  }

  .record-actions {
    width: 100%;
  }

  .record-actions button {
    width: 100%;
  }

  .compact-file {
    grid-template-columns: 1fr;
  }

  .file-thumb {
    width: 100%;
    height: 150px;
  }

  .confidence-compact {
    grid-template-columns: 1fr;
  }

  .confidence-score {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand-status {
    width: 100%;
  }
}

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