:root {
  --bg: #f4f7fb;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-strong: #ffffff;
  --surface-soft: #f8fafc;
  --border: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.14);
  --text: #0f172a;
  --muted: #64748b;
  --accent: #1d4ed8;
  --accent-strong: #153ea7;
  --accent-soft: rgba(29, 78, 216, 0.1);
  --danger: #b42318;
  --danger-soft: rgba(220, 38, 38, 0.1);
  --warning-soft: rgba(245, 158, 11, 0.12);
  --shadow-sm: 0 10px 30px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 24px 60px rgba(15, 23, 42, 0.08);
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --max-width: 1480px;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(29, 78, 216, 0.07), transparent 28%),
    linear-gradient(180deg, #f8fafc 0%, #f3f6fb 100%);
}

button,
input,
select {
  font: inherit;
}

.page-shell {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.brand-block {
  max-width: 820px;
}

.eyebrow,
.section-kicker,
.card-label {
  margin: 0 0 8px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

h1,
h2,
h3,
h4,
p,
ul {
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 3.2vw, 3rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

h2 {
  font-size: 1.35rem;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

h3 {
  font-size: 1.08rem;
  letter-spacing: -0.02em;
}

h4 {
  font-size: 1rem;
}

.lead {
  margin-top: 12px;
  max-width: 720px;
  color: var(--muted);
  line-height: 1.65;
}

.topbar-actions,
.room-actions,
.wizard-buttons {
  display: flex;
  gap: 12px;
}

.hero-strip {
  display: grid;
  grid-template-columns: 1.45fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.hero-card,
.panel,
.room-card,
.result-block,
.metric-card,
.stat-card,
.lot-card,
.soft-card {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(16px);
  border-radius: var(--radius-md);
}

.hero-card {
  padding: 22px;
}

.hero-card-strong {
  background: linear-gradient(135deg, rgba(255,255,255,0.96), rgba(244,248,255,0.96));
  box-shadow: var(--shadow-md);
}

.hero-card p,
.hero-list,
.hint,
.metric-label,
.empty-state,
.list-row small,
.lot-meta,
.field-help {
  color: var(--muted);
}

.hero-card p,
.field-help {
  margin-top: 10px;
  line-height: 1.6;
}

.hero-list {
  padding-left: 18px;
  line-height: 1.8;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(360px, 0.8fr);
  gap: 20px;
  align-items: start;
}

.sticky-panel {
  position: sticky;
  top: 20px;
}

.panel {
  padding: 22px;
  margin-bottom: 18px;
}

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

.panel-header-split,
.wizard-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

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

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

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

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

.grid-room {
  grid-template-columns: 1.1fr 1.25fr 0.7fr auto;
  align-items: end;
}

.field-wide {
  grid-column: 1 / -1;
}

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

label span {
  font-size: 0.9rem;
  font-weight: 600;
  color: #334155;
}

input,
select {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

input:hover,
select:hover {
  border-color: var(--border-strong);
}

input:focus,
select:focus {
  outline: none;
  border-color: rgba(29, 78, 216, 0.34);
  box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.08);
}

input.invalid,
select.invalid {
  border-color: rgba(220, 38, 38, 0.45);
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.08);
}

.toggle-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-soft);
}

.toggle-card input {
  width: auto;
  min-height: auto;
  padding: 0;
  box-shadow: none;
}

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
  color: #fff;
  box-shadow: 0 10px 24px rgba(29, 78, 216, 0.22);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.92);
  border-color: var(--border);
  color: var(--text);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--danger);
}

.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.stack,
.result-stack {
  display: grid;
  gap: 12px;
}

.soft-card,
.room-card {
  padding: 18px;
}

.double-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

.stat-card,
.metric-card {
  padding: 18px;
}

.stat-value,
.metric-value {
  display: block;
  margin-top: 8px;
  font-size: 1.52rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.metric-value.small {
  font-size: 1.02rem;
  line-height: 1.4;
}

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

.lot-card {
  padding: 16px;
  background: rgba(248, 250, 252, 0.92);
}

.lot-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.lot-title {
  font-weight: 700;
}

.results-panel {
  box-shadow: var(--shadow-md);
}

.result-block {
  padding: 18px;
}

.result-block h4 {
  margin-bottom: 8px;
}

.list-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.list-row:last-child {
  border-bottom: none;
}

.list-row strong,
.list-row span {
  display: block;
}

.list-row small {
  display: block;
  margin-top: 4px;
  line-height: 1.45;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 700;
}

.badge.warning {
  background: var(--warning-soft);
  color: #b45309;
}

.badge.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.wizard-header {
  margin-bottom: 18px;
}

.step-status {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
}

.progress-bar {
  width: 100%;
  height: 8px;
  margin-top: 16px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.progress-bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #4f83ff);
  transition: width 0.18s ease;
}

.steps-nav {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.step-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.75);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
}

.step-chip.is-current {
  border-color: rgba(29, 78, 216, 0.28);
  background: var(--accent-soft);
  color: var(--accent);
}

.step-chip.is-complete {
  color: #0f766e;
  background: rgba(20, 184, 166, 0.09);
}

.wizard-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.wizard-feedback {
  min-height: 24px;
  color: var(--danger);
  font-size: 0.92rem;
  font-weight: 500;
}

.hint,
.empty-state {
  line-height: 1.6;
}

.hidden {
  display: none !important;
}

@media (max-width: 1240px) {
  .hero-strip,
  .workspace,
  .double-panels,
  .grid-4,
  .grid-3,
  .grid-room,
  .lots-grid {
    grid-template-columns: 1fr 1fr;
  }

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

  .sticky-panel {
    position: static;
  }

  .steps-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .page-shell {
    padding: 16px;
  }

  .topbar,
  .panel-header-split,
  .wizard-topline,
  .wizard-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-actions,
  .wizard-buttons {
    width: 100%;
  }

  .topbar-actions .btn,
  .wizard-buttons .btn {
    flex: 1;
  }

  .hero-strip,
  .double-panels,
  .grid-2,
  .grid-3,
  .grid-4,
  .grid-room,
  .lots-grid,
  .stat-grid,
  .result-grid,
  .steps-nav {
    grid-template-columns: 1fr;
  }
}
