:root {
  --bg: #0d1118;
  --panel: #141b26e8;
  --text: #e8edf6;
  --muted: #a3aec0;
  --accent: #ff8a65;
  --accent-dark: #e86a4f;
  --ok: #45d6b0;
  --warn: #f3c969;
  --fail: #ff6b6b;
  --border: #2a3448;
  --field: #111823;
  --field-border: #3a4660;
  --surface: #182231;
  --row-border: #2d3950;
  --focus: #ff8a6560;
  --shadow: 0 18px 46px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", "Avenir Next", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 10%, #22324d 0%, transparent 45%),
    radial-gradient(circle at 82% 75%, #1f3a35 0%, transparent 40%),
    var(--bg);
}

.background-shape {
  position: fixed;
  z-index: -1;
  filter: blur(25px);
  opacity: 0.5;
  border-radius: 999px;
}

.shape-one {
  width: 260px;
  height: 260px;
  background: #ff8a65;
  top: -80px;
  right: -80px;
  animation: drift 12s ease-in-out infinite;
}

.shape-two {
  width: 220px;
  height: 220px;
  background: #45d6b0;
  bottom: -80px;
  left: -80px;
  animation: drift 10s ease-in-out infinite reverse;
}

.page {
  width: min(1080px, 92vw);
  margin: 2rem auto 3rem;
  display: grid;
  gap: 1rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 1.25rem;
  backdrop-filter: blur(10px);
}

.intro h1 {
  margin: 0.2rem 0 0.4rem;
  font-size: clamp(2rem, 5vw, 3.1rem);
  letter-spacing: -0.03em;
}

.eyebrow {
  margin: 0;
  color: var(--accent-dark);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  font-size: 0.8rem;
}

.lead {
  margin: 0;
  color: var(--muted);
  max-width: 65ch;
}

.grid {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

label {
  display: grid;
  gap: 0.35rem;
  font-weight: 600;
  font-size: 0.9rem;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  width: 100%;
  padding: 0.62rem 0.66rem;
  border: 1px solid var(--field-border);
  border-radius: 10px;
  background: var(--field);
  color: var(--text);
}

input:focus,
select:focus {
  outline: 2px solid var(--focus);
  border-color: var(--accent);
}

.inline-input {
  display: grid;
  gap: 0.4rem;
  grid-template-columns: 1fr auto;
}

button {
  margin-top: 1rem;
  background: linear-gradient(120deg, var(--accent), var(--accent-dark));
  color: #fff;
  border: 0;
  border-radius: 12px;
  font-weight: 700;
  padding: 0.8rem 1rem;
  cursor: pointer;
  transition: transform 0.16s ease;
}

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

#calc-form > button[type="submit"] {
  margin-top: 1rem;
}

.multi-cables {
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--row-border);
  display: grid;
  gap: 0.7rem;
}

.multi-cables-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.multi-cables-head h3 {
  margin: 0;
  font-size: 1rem;
}

.ghost-btn {
  margin-top: 0;
  padding: 0.45rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--field-border);
  background: #1d2a3d;
  color: var(--text);
  font-weight: 600;
}

.extra-cables {
  display: grid;
  gap: 0.65rem;
}

.extra-cable-row {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #121a27;
  padding: 0.75rem;
  display: grid;
  gap: 0.6rem;
}

.extra-cable-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.6rem;
}

.extra-cable-actions {
  display: flex;
  justify-content: flex-end;
}

.remove-cable {
  margin-top: 0;
  padding: 0.38rem 0.62rem;
  border: 1px solid #5b2d35;
  background: #3a2026;
  border-radius: 8px;
  color: #ffcdd2;
}

.compact-inline {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem;
}

.result h2 {
  margin-top: 0;
}

.result-grid {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.result-grid article {
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 0.7rem;
  background: var(--surface);
}

.label {
  margin: 0 0 0.2rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.value {
  margin: 0;
  font-weight: 700;
  font-size: 1.05rem;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  border-bottom: 1px solid var(--row-border);
  padding: 0.56rem 0.45rem;
}

tbody tr:hover {
  background: #1c2637;
}

table input,
table select {
  min-width: 90px;
  padding: 0.4rem 0.5rem;
}

.ia-actions {
  margin-top: 0.8rem;
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

th {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.87rem;
}

.status {
  font-weight: 700;
}

.status.ok {
  color: var(--ok);
}

.status.warn {
  color: var(--warn);
}

.status.fail {
  color: var(--fail);
}

.muted {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.87rem;
}

@keyframes drift {
  0% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(-14px, 9px, 0);
  }
  100% {
    transform: translate3d(0, 0, 0);
  }
}

@media (max-width: 640px) {
  .page {
    width: 94vw;
    margin-top: 1.1rem;
  }

  .panel {
    border-radius: 14px;
    padding: 0.95rem;
  }
}
