:root {
  color-scheme: dark;
  --background: #0b0b0c;
  --surface: #151517;
  --surface-2: #1d1d20;
  --line: #303034;
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --accent: #ff5a23;
  --accent-soft: rgba(255, 90, 35, .15);
  --success: #6dd29a;
  --warning: #ffc363;
  --danger: #ff7777;
  --shadow: 0 22px 55px rgba(0, 0, 0, .28);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--background);
}

body {
  min-width: 300px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 50% -10%, rgba(255, 90, 35, .12), transparent 32rem),
    var(--background);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

button,
label,
input[type="range"],
select {
  touch-action: manipulation;
}

.app-shell {
  width: min(100%, 980px);
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom));
}

.topbar,
.card-heading,
.button-row,
.connection-options,
footer {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

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

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  font-size: .85rem;
  font-weight: 900;
  box-shadow: 0 10px 28px rgba(255, 90, 35, .25);
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 2px;
  font-size: 1.2rem;
}

h2 {
  margin-bottom: 8px;
  font-size: 1.16rem;
}

.brand p,
footer {
  margin-bottom: 0;
  color: var(--muted);
  font-size: .76rem;
}

.status-badge,
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: .75rem;
  font-weight: 700;
  white-space: nowrap;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.status-badge.online,
.pill.success {
  color: var(--success);
}

.status-badge.connecting,
.pill.warning {
  color: var(--warning);
}

.card,
.notice {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(21, 21, 23, .94);
  box-shadow: var(--shadow);
}

.card {
  padding: 20px;
}

.connection-card {
  display: grid;
  gap: 15px;
  margin-bottom: 16px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.card-heading {
  justify-content: space-between;
  gap: 14px;
}

.eyebrow {
  margin-bottom: 4px;
  color: var(--accent);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: .8rem;
}

.metric {
  color: var(--text);
  font-size: clamp(1.45rem, 4vw, 2rem);
  font-weight: 850;
}

.button-row,
.connection-options {
  flex-wrap: wrap;
  gap: 10px;
}

.button-row.compact {
  margin-top: 14px;
}

.button {
  min-height: 43px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 13px;
  cursor: pointer;
  font-weight: 750;
}

.button:disabled,
.range:disabled,
.select:disabled {
  cursor: not-allowed;
  opacity: .42;
}

.button.primary {
  background: var(--accent);
  color: #fff;
}

.button.secondary {
  border-color: rgba(255, 90, 35, .35);
  background: var(--accent-soft);
  color: #ff9d78;
}

.button.ghost {
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--text);
}

.toggle-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  color: var(--muted);
  font-size: .78rem;
}

.toggle-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.meter {
  height: 11px;
  margin: 14px 0;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-2);
}

.meter-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #ff986f);
  transition: width .25s ease;
}

.info-list {
  display: grid;
  gap: 1px;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--line);
}

.info-list div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 12px;
  background: var(--surface-2);
}

.info-list dt {
  color: var(--muted);
  font-size: .75rem;
}

.info-list dd {
  margin: 0;
  text-align: right;
  font-size: .8rem;
  font-weight: 750;
}

.range {
  width: 100%;
  height: 40px;
  accent-color: var(--accent);
}

.range-labels {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: .72rem;
}

.field-label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: .78rem;
}

.select {
  width: 100%;
  min-height: 45px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-2);
  color: var(--text);
}

.notice {
  display: grid;
  gap: 5px;
  margin-bottom: 16px;
  padding: 15px;
}

.notice.error {
  border-color: rgba(255, 119, 119, .35);
  color: var(--danger);
}

footer {
  justify-content: space-between;
  margin-top: 18px;
  padding: 4px 3px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 50;
  max-width: min(90vw, 520px);
  padding: 12px 16px;
  transform: translateX(-50%);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #242427;
  color: #fff;
  box-shadow: var(--shadow);
  font-size: .82rem;
}

.hidden {
  display: none !important;
}

@media (max-width: 700px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
  }

  .status-badge {
    margin-top: 6px;
  }
}

@media (max-width: 450px) {
  .app-shell {
    padding-left: 12px;
    padding-right: 12px;
  }

  .card {
    padding: 17px;
  }

  .topbar {
    flex-direction: column;
  }

  .button-row .button {
    flex: 1 1 140px;
  }

  .connection-options {
    align-items: flex-start;
  }
}


/* v1.0.1 – Standard / Boost mód */
.segmented-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0 10px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-2);
}

.segment-button {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.segment-button:disabled {
  cursor: not-allowed;
  opacity: .42;
}

.segment-button.active {
  border-color: rgba(255, 90, 35, .35);
  background: var(--accent-soft);
  color: #ff9d78;
}

.segment-button.active.boost {
  background: rgba(255, 195, 99, .13);
  border-color: rgba(255, 195, 99, .35);
  color: var(--warning);
}
