:root {
  --paper: #f5efe2;
  --paper-strong: #fffaf1;
  --ink: #122033;
  --muted: #5d6776;
  --line: rgba(18, 32, 51, 0.12);
  --deep: #09121e;
  --teal: #0f766e;
  --teal-soft: rgba(15, 118, 110, 0.12);
  --clay: #c2410c;
  --clay-soft: rgba(194, 65, 12, 0.14);
  --clay-ink: #8d2f09;
  --mint-soft: rgba(9, 128, 112, 0.14);
  --mint-ink: #0d665a;
  --sky-soft: rgba(103, 164, 214, 0.16);
}

html,
body,
#root {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Sora", system-ui, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.17), transparent 28%),
    radial-gradient(circle at top right, rgba(194, 65, 12, 0.16), transparent 32%),
    linear-gradient(180deg, #fcf7ee 0%, #efe4d2 100%);
}

.mono-ui {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}

.glass-panel,
.hero-panel,
.surface-card,
.metric-tile,
.wall-card,
.editor-shell,
.status-ribbon {
  border: 1px solid var(--line);
}

.hero-panel {
  background:
    linear-gradient(135deg, rgba(255, 250, 241, 0.94), rgba(248, 243, 233, 0.82)),
    linear-gradient(rgba(18, 32, 51, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(18, 32, 51, 0.06) 1px, transparent 1px);
  background-size: auto, 24px 24px, 24px 24px;
  box-shadow: 0 22px 48px rgba(9, 18, 30, 0.1);
}

.glass-panel {
  background: rgba(255, 250, 241, 0.82);
  box-shadow: 0 18px 40px rgba(9, 18, 30, 0.08);
  backdrop-filter: blur(16px);
}

.surface-card,
.metric-tile,
.wall-card {
  background: rgba(255, 255, 255, 0.78);
}

.soft-button {
  transition: transform 140ms ease, box-shadow 140ms ease, background-color 140ms ease, border-color 140ms ease;
}

.soft-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(9, 18, 30, 0.08);
}

.soft-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
  box-shadow: none;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  background: rgba(9, 18, 30, 0.92);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero-badge-muted {
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
}

.status-ribbon {
  border-radius: 22px;
  padding: 0.95rem 1rem;
  background: rgba(9, 18, 30, 0.94);
  color: rgba(255, 255, 255, 0.92);
  line-height: 1.7;
}

.field-label,
.metric-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.field-input {
  width: 100%;
  margin-top: 0.5rem;
  border-radius: 18px;
  border: 1px solid rgba(18, 32, 51, 0.12);
  background: rgba(255, 255, 255, 0.86);
  padding: 0.8rem 0.95rem;
  color: var(--ink);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.field-input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.field-help {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  line-height: 1.55;
  color: var(--muted);
}

.metric-tile {
  border-radius: 24px;
  padding: 1rem;
}

.metric-default {
  background: rgba(255, 255, 255, 0.76);
}

.metric-ready {
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.12), rgba(255, 255, 255, 0.82));
}

.metric-value {
  margin-top: 0.45rem;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.metric-note {
  margin-top: 0.4rem;
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--muted);
}

.editor-shell {
  overflow: hidden;
  border-radius: 28px;
  background:
    linear-gradient(rgba(12, 27, 42, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(12, 27, 42, 0.05) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(246, 240, 229, 0.9));
  background-size: 24px 24px, 24px 24px, auto;
  min-height: 600px;
}

.editor-canvas {
  display: block;
  width: 100%;
  height: min(74vh, 760px);
  cursor: crosshair;
}

.editor-empty {
  display: grid;
  place-items: center;
  min-height: 600px;
  padding: 2rem;
  text-align: center;
}

.editor-empty-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--ink);
}

.preview-shell {
  overflow: hidden;
  border-radius: 28px;
  background: linear-gradient(180deg, #0d1827 0%, #070d16 100%);
  min-height: 360px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.mode-chip,
.toggle-pill {
  border: 1px solid rgba(18, 32, 51, 0.1);
  border-radius: 999px;
  padding: 0.75rem 0.95rem;
  background: rgba(255, 255, 255, 0.75);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: transform 140ms ease, background-color 140ms ease, border-color 140ms ease;
}

.mode-chip:hover,
.toggle-pill:hover {
  transform: translateY(-1px);
}

.mode-chip-active,
.toggle-pill-active {
  border-color: transparent;
  background: rgba(9, 18, 30, 0.94);
  color: #fff;
}

.wall-card {
  width: 100%;
  border-radius: 24px;
  padding: 0.95rem 1rem;
  text-align: left;
  transition: border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.wall-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(9, 18, 30, 0.06);
}

.wall-card-selected {
  border-color: rgba(15, 118, 110, 0.48);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.11);
}

.grid-line {
  stroke: rgba(18, 32, 51, 0.18);
  stroke-width: 1.2;
}

.footprint-outline {
  fill: none;
  stroke: rgba(59, 130, 246, 0.92);
  stroke-width: 4.5;
  stroke-linejoin: round;
}

.footprint-outline-default {
  stroke: rgba(37, 99, 235, 0.42);
  stroke-dasharray: 18 12;
}

.footprint-fill {
  fill: rgba(59, 130, 246, 0.1);
  stroke: rgba(59, 130, 246, 0.52);
  stroke-width: 3;
}

.footprint-node {
  fill: #f8fafc;
  stroke: #2563eb;
  stroke-width: 3;
}

.wall-line {
  stroke: rgba(15, 118, 110, 0.94);
  stroke-width: 5.5;
  stroke-linecap: round;
}

.wall-line-selected {
  stroke: rgba(249, 115, 22, 0.95);
  stroke-width: 6.5;
}

.wall-hit {
  stroke: transparent;
  stroke-width: 18;
  cursor: pointer;
}

.draft-line {
  stroke: rgba(249, 115, 22, 0.94);
  stroke-width: 4;
  stroke-dasharray: 10 10;
  stroke-linecap: round;
}

.draft-footprint {
  stroke: rgba(37, 99, 235, 0.88);
}

.draft-node {
  fill: rgba(249, 115, 22, 0.18);
  stroke: rgba(249, 115, 22, 0.96);
  stroke-width: 4;
}

.calibration-node {
  fill: rgba(255, 255, 255, 0.9);
  stroke: rgba(194, 65, 12, 0.96);
  stroke-width: 4;
}

.calibration-line {
  stroke: rgba(194, 65, 12, 0.98);
  stroke-width: 4.5;
  stroke-dasharray: 18 10;
  stroke-linecap: round;
}

input[type="file"]::file-selector-button {
  border: 0;
  border-radius: 999px;
  padding: 0.6rem 0.95rem;
  margin-right: 0.8rem;
  background: var(--deep);
  color: #fff;
  cursor: pointer;
  font-family: "Sora", system-ui, sans-serif;
}

textarea {
  resize: vertical;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: rgba(18, 32, 51, 0.22);
  border-radius: 999px;
}

::-webkit-scrollbar-track {
  background: transparent;
}
