:root {
  --bg: #0b1220;
  --fg: #e6edf3;
  --muted: #93a1b3;
  --card: #101828;
  --accent: #00c16a;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid #1e293b;
}

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

.window-picker select, .window-picker button {
  background: var(--card);
  color: var(--fg);
  border: 1px solid #263043;
  padding: 8px 12px;
  border-radius: 10px;
}
.window-picker button { cursor: pointer; }

main { padding: 20px; max-width: 1200px; margin: 0 auto; }

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 12px;
  margin-bottom: 24px;
}
@media (max-width: 900px) {
  .cards { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 600px) {
  .cards { grid-template-columns: 1fr; }
}

.card {
  background: var(--card);
  border: 1px solid #233045;
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.22);
}
.card .label {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}
.card .value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--fg);
}

section h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--muted);
  margin: 18px 0 10px;
}

canvas {
  background: var(--card);
  border: 1px solid #233045;
  border-radius: 16px;
  padding: 10px;
}
details {
  margin-top: 18px;
  background: #0f172a;
  border: 1px solid #233045;
  border-radius: 10px;
  padding: 10px;
}
pre { white-space: pre-wrap; }

.card .value.small { font-size: 18px; font-weight: 600; }

.table {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  background: var(--card);
  border: 1px solid #233045;
  border-radius: 12px;
  padding: 10px;
}
.table .th { color: var(--muted); font-weight: 600; }
.table .cell { padding: 6px 4px; border-bottom: 1px solid #1e293b; }
.table .row { display: contents; }

/* ===== Device candidates table: force block rows, 5 fixed columns ===== */

/* 1) Írjuk felül a globális .table flex/grid beállításait ennél az asztalnál */
.table--candidates {
  display: block !important;   /* ne legyen flex/grid a konténeren */
  width: 100%;
  overflow-x: auto;            /* ha szűk a viewport, inkább görgessen */
  padding-bottom: 4px;
}

/* 2) Minden .row legyen külön sor, teljes szélesség */
.table--candidates .row {
  display: grid !important;
  grid-template-columns: 1.1fr 1fr 1fr 0.8fr 1fr; /* Watt | Bekapcs. | Mióta megy | Biztonság | Művelet */
  gap: 8px;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: 8px 10px;
}

/* 3) Cellák alap stílusai */
.table--candidates .cell {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table--candidates .cell.th {
  font-weight: 600;
  opacity: 0.9;
}

/* fejléc sáv halvány háttérrel */
.table--candidates .row:first-child {
  background: rgba(255,255,255,0.03);
  border-bottom-color: rgba(255,255,255,0.12);
}

/* gombos oszlop rendezése */
.table--candidates .cell.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.table--candidates .btn,
.table--candidates button {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.15);
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.table--candidates .btn-ok { border-color: rgba(0,166,82,.5); }
.table--candidates .btn-cancel { border-color: rgba(220,38,38,.45); }

/* Mobil fallback: 2 oszlopos tördelés, de TOVÁBBRA IS soronként! */
@media (max-width: 720px) {
  .table--candidates .row {
    grid-template-columns: 1fr 1fr;
  }
  /* header rövidítése (mutassuk csak az első két címet) */
  .table--candidates .row:first-child .cell:nth-child(n+3) { display: none; }
  /* adat-sorok: a 3–5. cellák menjenek új sorokra, teljes szélességen */
  .table--candidates .row:not(:first-child) .cell:nth-child(3),
  .table--candidates .row:not(:first-child) .cell:nth-child(4),
  .table--candidates .row:not(:first-child) .cell:nth-child(5) {
    grid-column: 1 / -1;
  }
}

.params {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 10px;
}
.param {
  background: var(--card);
  border: 1px solid #233045;
  border-radius: 12px;
  padding: 10px;
  font-size: 13px;
}
.param .k { color: var(--muted); display:block; }
.param .v { font-weight: 700; }

.energy-form { display:flex; gap:12px; align-items:end; flex-wrap:wrap; margin-top:12px; }
.energy-form label { display:flex; flex-direction:column; gap:6px; }
.energy-error { color:#ef4444; margin-top:8px; }
.energy-result { margin-top:12px; display:grid; gap:6px; }




:root{
  --grid-gap: 12px;
  --bp-sm: 576px;
  --bp-md: 768px;
  --bp-lg: 992px;
}

.row{ display:flex; flex-wrap:wrap; gap:var(--grid-gap); }
.row > *{ box-sizing:border-box; }

/* Alap: minden col 100% (mobil) */
.col{ flex:0 0 100%; max-width:100%; }

/* Szélességek breakpointra */
@media (min-width: 576px){
  .col-sm-50{ flex-basis:50%; max-width:50%; }
  .col-sm-33{ flex-basis:33.3333%; max-width:33.3333%; }
  .col-sm-25{ flex-basis:25%; max-width:25%; }
  .col-sm-20{ flex-basis:20%; max-width:20%; }
  .col-sm-100{ flex-basis:100%; max-width:100%; }
}

@media (min-width: 768px){
  .col-md-50{ flex-basis:50%; max-width:50%; }
  .col-md-33{ flex-basis:33.3333%; max-width:33.3333%; }
  .col-lg-66{ flex-basis:66.6666%; max-width:64.6666%; }
  .col-md-25{ flex-basis:25%; max-width:25%; }
  .col-md-20{ flex-basis:20%; max-width:20%; }
  .col-md-100{ flex-basis:100%; max-width:100%; }
}

@media (min-width: 992px){
  .col-lg-50{ flex-basis:50%; max-width:50%; }
  .col-lg-33{ flex-basis:33.3333%; max-width:33.3333%; }
  .col-lg-66{ flex-basis:66.6666%; max-width:64.6666%; }
  .col-lg-25{ flex-basis:25%; max-width:25%; }
  .col-lg-20{ flex-basis:20%; max-width:20%; }
  .col-lg-100{ flex-basis:100%; max-width:100%; }
}

