:root {
  --ow-red: #702423;
  --ow-red-strong: #500201;
  --ow-accent: #bf4542;
  --ow-ink: #101010;
  --ow-ink-soft: #2a2a2a;
  --ow-cream: #f5f2ef;
  --ow-sand: #efe8e2;
  --ow-paper: #ffffff;
  --ow-line: #d9d0c9;
  --ow-shadow: rgba(26, 16, 14, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Alegreya Sans", "Gill Sans", "Trebuchet MS", sans-serif;
  color: var(--ow-ink);
  background: radial-gradient(circle at top left, #ffffff 0%, #f4eeea 45%, #e8dfd7 100%);
}

h1, h2, h3, .card-title {
  font-family: "Cormorant Garamond", "Palatino Linotype", "Book Antiqua", Palatino, serif;
  letter-spacing: 0.3px;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 6vw 18px;
  border-bottom: 2px solid var(--ow-line);
  background: linear-gradient(120deg, #fdfbfa, #f3ebe6);
  position: sticky;
  top: 0;
  z-index: 10;
}

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

.brand-logo {
  width: 160px;
  height: auto;
}

.brand-text h1 {
  margin: 4px 0 0;
  font-size: 28px;
  color: var(--ow-red-strong);
}

.brand-text p {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--ow-ink-soft);
}

.brand-kicker {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ow-accent);
}

.status {
  background: var(--ow-red);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.app {
  padding: 32px 6vw 64px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.card {
  background: var(--ow-paper);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 18px 40px var(--ow-shadow);
  border: 1px solid var(--ow-line);
  animation: rise 0.7s ease;
}

.card.subtle {
  background: var(--ow-cream);
  box-shadow: none;
}

.card-title {
  font-size: 20px;
  margin-bottom: 16px;
  color: var(--ow-red-strong);
}

.notes {
  display: grid;
  gap: 6px;
  font-size: 14px;
  color: var(--ow-ink-soft);
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.option-group {
  background: var(--ow-cream);
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--ow-line);
}

.option-group h3 {
  margin-top: 0;
  font-size: 16px;
  color: var(--ow-red);
}

.option-group label {
  display: block;
  margin: 6px 0;
  font-size: 14px;
}

.layout-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  align-items: start;
}

.layout-grid.two-column {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.table-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.table-title {
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ow-red);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th,
.data-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--ow-line);
}

.data-table th {
  text-align: left;
  font-weight: 600;
  color: var(--ow-ink-soft);
}

.data-table td.range {
  font-size: 12px;
  color: var(--ow-accent);
}

.data-table td.meta {
  font-size: 12px;
  color: #7a6f68;
}

.data-table input[type="text"] {
  width: 100%;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--ow-line);
  font-size: 14px;
  background: #fff;
  color: var(--ow-ink);
}

.data-table input[readonly] {
  background: #f5f1ee;
  color: var(--ow-ink-soft);
}

.input-error {
  border-color: var(--ow-accent);
  background: #fff1f0;
}

.diagram {
  display: flex;
  align-items: center;
  justify-content: center;
}

.diagram-surface {
  padding: 0;
  background: transparent;
  border-radius: 0;
  border: none;
  text-align: center;
}

.diagram-surface svg {
  width: 180px;
  height: 180px;
}

.diagram-image {
  width: min(528px, 88vw);
  height: auto;
  display: block;
  margin: 0 auto;
}

.diagram-surface rect {
  fill: #fff;
  stroke: var(--ow-red);
  stroke-width: 3;
}

.diagram-surface path,
.diagram-surface circle {
  fill: none;
  stroke: var(--ow-red);
  stroke-width: 3;
}

.diagram-label {
  margin-bottom: 10px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ow-red-strong);
}

.actions {
  display: flex;
  gap: 12px;
  margin-top: 18px;
}

.btn {
  padding: 10px 18px;
  border-radius: 999px;
  border: 2px solid var(--ow-red);
  background: transparent;
  color: var(--ow-red);
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn.primary {
  background: var(--ow-red);
  color: #fff;
  border-color: var(--ow-red-strong);
}

.btn.ghost {
  background: transparent;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(112, 36, 35, 0.2);
}

.distance-block {
  padding: 8px 0;
  font-size: 14px;
}

.hidden {
  display: none;
}

.site-footer {
  padding: 24px 6vw 40px;
  text-align: center;
  color: #6b5c55;
}

label input[type="text"] {
  margin-top: 6px;
}

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

@media (max-width: 900px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

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

  .brand-logo {
    width: 140px;
  }

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