:root {
  color-scheme: light dark;
  --bg: #f6f2eb;
  --panel: #fffefa;
  --ink: #202329;
  --muted: #63666d;
  --line: #d8d1c7;
  --accent: #24756c;
  --accent-strong: #15564f;
  --success: #227247;
  --voice: #356fc0;
  --shadow: 0 22px 70px rgba(46, 37, 25, 0.15);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(36, 117, 108, 0.12), transparent 38%),
    linear-gradient(315deg, rgba(201, 65, 53, 0.1), transparent 35%),
    var(--bg);
}

.shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
}

.panel {
  width: min(100%, 520px);
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  box-shadow: var(--shadow);
}

.admin-panel {
  width: min(100%, 860px);
}

.auth-panel {
  width: min(100%, 440px);
}

.admin-shell {
  place-items: start center;
}

.session-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

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

.text-link,
.text-button {
  color: var(--accent-strong);
  font: inherit;
  font-weight: 800;
}

.text-link {
  text-decoration: none;
}

.text-link:hover {
  text-decoration: underline;
}

.text-button {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.text-button:hover {
  text-decoration: underline;
}

.heading {
  display: grid;
  gap: 8px;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 7vw, 3.5rem);
  line-height: 1;
}

.summary {
  max-width: 38rem;
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
}

code {
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.5);
  color: var(--accent-strong);
}

.controls {
  display: grid;
  gap: 16px;
}

.admin-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto auto;
  align-items: end;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.check-row {
  grid-template-columns: auto 1fr;
  align-items: center;
  min-height: 48px;
  color: var(--ink);
}

.check-row input {
  width: 18px;
  min-height: 18px;
  padding: 0;
}

input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #ffffff;
  font: inherit;
}

input:focus {
  outline: 3px solid rgba(36, 117, 108, 0.22);
  border-color: var(--accent);
}

.admin-section {
  margin-top: 28px;
}

.admin-section h2 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.data-list {
  display: grid;
  gap: 8px;
}

.data-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.52);
}

.data-row div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.data-row span {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 0.82rem;
}

.action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 58px;
  border: 0;
  border-radius: 8px;
  color: white;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 850;
  cursor: pointer;
}

.voice-button {
  margin-top: 8px;
  background: var(--voice);
  box-shadow: 0 14px 32px rgba(53, 111, 192, 0.24);
}

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

.toggle-button {
  min-height: 44px;
  padding: 0 14px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line);
  font-size: 0.88rem;
  font-weight: 800;
  box-shadow: none;
}

.toggle-button.is-active {
  color: #ffffff;
  background: var(--success);
  border-color: var(--success);
}

.toggle-button.is-locked {
  opacity: 0.52;
}

.toggle-dot {
  width: 11px;
  height: 11px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.toggle-button.is-active .toggle-dot {
  background: currentColor;
}

.action-button:hover {
  filter: brightness(0.96);
}

.action-button:focus-visible {
  outline: 4px solid rgba(36, 117, 108, 0.25);
  outline-offset: 3px;
}

.action-button:disabled {
  cursor: progress;
  opacity: 0.68;
}

.button-icon {
  position: relative;
  width: 18px;
  height: 24px;
  border: 2px solid currentColor;
  border-radius: 9px;
}

.button-icon::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -8px;
  width: 18px;
  height: 10px;
  border-bottom: 2px solid currentColor;
  border-left: 2px solid currentColor;
  border-right: 2px solid currentColor;
  border-radius: 0 0 10px 10px;
  transform: translateX(-50%);
}

.muted-icon::after {
  content: "";
  position: absolute;
  left: -7px;
  top: 9px;
  width: 32px;
  height: 2px;
  background: currentColor;
  transform: rotate(-38deg);
}

.live-icon::after {
  content: "";
  position: absolute;
  left: 22px;
  top: 3px;
  width: 7px;
  height: 14px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  border-radius: 0 12px 12px 0;
}

.status {
  min-height: 44px;
  margin-top: 18px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.55);
  line-height: 1.35;
}

.status.good {
  border-color: rgba(36, 117, 108, 0.45);
  color: var(--accent-strong);
}

.status.bad {
  border-color: rgba(201, 65, 53, 0.45);
  color: #8d281f;
}

@media (max-width: 560px) {
  .shell {
    padding: 18px;
    place-items: stretch;
  }

  .panel {
    align-self: center;
    padding: 24px;
  }

  .parameter-grid {
    grid-template-columns: 1fr;
  }

  .session-bar,
  .admin-form,
  .data-row {
    grid-template-columns: 1fr;
  }

  .session-bar {
    align-items: start;
  }
}
