body {
  background: #090909;
}

.app-page {
  min-height: 100vh;
  padding: 32px 20px;
}

.app-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 18px;
  align-items: start;
}

.panel {
  background: rgba(18, 18, 18, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.panel + .panel {
  margin-top: 18px;
}

.app-title {
  margin: 0 0 6px;
  font-size: 30px;
  line-height: 1.1;
}

.app-subtitle {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.section-title {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label,
.toggle-label,
.stat-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}

.field input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #101010;
  color: var(--text);
  border-radius: 8px;
  padding: 11px 12px;
  font-size: 14px;
  font-weight: 800;
  outline: none;
}

.field input:focus {
  border-color: rgba(255, 255, 255, 0.26);
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.switch {
  position: relative;
  width: 54px;
  height: 30px;
  flex: 0 0 auto;
}

.switch input {
  display: none;
}

.slider-switch {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #242424;
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  transition: 0.2s ease;
}

.slider-switch::before {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #f4f4f4;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  transition: 0.2s ease;
}

.switch input:checked + .slider-switch {
  background: #148c37;
}

.switch input:checked + .slider-switch::before {
  transform: translateX(24px);
}

.button-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

button {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #202020;
  color: #ffffff;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

button:hover {
  transform: translateY(-1px);
  background: #2a2a2a;
}

button.primary {
  background: #148c37;
}

button.danger {
  background: #7d2020;
}

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

.stat {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
}

.stat-value {
  margin-top: 6px;
  font-size: 17px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.overlay-url-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.overlay-url-row input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #101010;
  color: var(--text);
  border-radius: 8px;
  padding: 11px 12px;
  font-size: 13px;
}

.status-line {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.preview-panel {
  display: grid;
  gap: 14px;
  justify-items: center;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .config-grid,
  .state-grid,
  .overlay-url-row {
    grid-template-columns: 1fr;
  }
}
