:root {
  --bg: #f3f4f6;
  --panel: #ffffff;
  --panel-border: #d1d5db;
  --text: #0f172a;
  --muted: #475569;
  --hex-fill-a: #64686d;
  --hex-fill-b: #232529;
  --hex-stroke: #000000;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, sans-serif;
  color: var(--text);
  background: var(--bg);
}

.layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 280px;
}

.board-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: auto;
}

.board {
  position: relative;
  min-width: 300px;
  min-height: 220px;
}

.size-overlay {
  position: absolute;
  left: 0;
  top: -36px;
  padding: 6px 9px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.78);
  color: #ffffff;
  font-size: 12px;
  line-height: 1.2;
  pointer-events: none;
  user-select: none;
}

.board svg {
  display: block;
}

.hex-cell {
  cursor: pointer;
}

.hex-base,
.perimeter-light {
  stroke: var(--hex-stroke);
  stroke-width: 1.5;
  stroke-linejoin: round;
}

.hex-cell.selected .hex-base,
.hex-cell.selected .perimeter-light {
  stroke: #2f77ff;
  stroke-width: 2.4;
}

.hex-base {
  fill: url(#hexMaterialGradient);
}

.hex-window {
  fill: url(#ledGlowGradient);
  stroke: #e9d5ff;
  stroke-width: 1;
  filter: url(#ledGlowFilter);
}

.perimeter-light {
  fill: url(#ledGlowGradient);
  filter: url(#ledGlowFilter);
}

.hex-core-cutout {
  fill: url(#hexMaterialGradient);
  stroke: none;
}

.hex-height-label {
  fill: #ffffff;
  font-size: 8px;
  font-weight: 600;
  text-anchor: middle;
  dominant-baseline: middle;
  pointer-events: none;
  user-select: none;
}

.honeycomb-rect {
  fill: url(#hexMaterialGradient);
  stroke: var(--hex-stroke);
  stroke-width: 2;
  pointer-events: none;
}

.panel {
  padding: 28px 20px;
  border-left: 1px solid var(--panel-border);
  background: var(--panel);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel h1 {
  margin: 0 0 4px;
  font-size: 20px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.field[hidden] {
  display: none;
}

.field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  font-size: 16px;
  color: var(--text);
}

.field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  font-size: 15px;
  color: var(--text);
  background: #fff;
}

.action-button {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #0f172a;
  border-radius: 8px;
  background: #0f172a;
  color: #ffffff;
  font-size: 14px;
  cursor: pointer;
}

.action-button:hover {
  background: #111827;
}

.cell-editor {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--panel-border);
}

.cell-editor h2 {
  margin: 0 0 8px;
  font-size: 16px;
}

.selected-cell-label {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--muted);
}

.pricing {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--panel-border);
}

.pricing h2 {
  margin: 0 0 8px;
  font-size: 16px;
}

.total-price {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
}

.psu-note {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
}

.delivery-note {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
}

.cost-table {
  width: 100%;
  margin-top: 10px;
  border-collapse: collapse;
  font-size: 13px;
  color: var(--text);
}

.cost-table td {
  padding: 4px 0;
  border-bottom: 1px solid #eef2f7;
}

.cost-table td:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 860px) {
  .layout {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
  }

  .panel {
    border-left: 0;
    border-top: 1px solid var(--panel-border);
  }
}
