:root {
  color-scheme: dark;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #0a0f1c;
  color: #edf3ff;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 12% 0%, rgba(64, 103, 241, 0.2), transparent 35rem),
    radial-gradient(circle at 88% 25%, rgba(53, 212, 154, 0.12), transparent 28rem),
    #0a0f1c;
}

.shell {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 56px 0 72px;
}

header {
  max-width: 780px;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 12px;
  color: #78a0ff;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}

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

h1 {
  margin-bottom: 14px;
  font-size: clamp(2.2rem, 7vw, 4.5rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

h2 {
  margin-bottom: 0;
  font-size: 1.05rem;
}

.lead {
  max-width: 690px;
  margin-bottom: 0;
  color: #aebbd1;
  font-size: 1.04rem;
  line-height: 1.65;
}

.panel,
.metric,
.notice {
  border: 1px solid rgba(169, 188, 222, 0.16);
  border-radius: 18px;
  background: rgba(18, 27, 46, 0.86);
  box-shadow: 0 16px 60px rgba(0, 0, 0, 0.24);
}

.panel {
  margin-top: 18px;
  padding: 22px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.pill {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.74rem;
  font-weight: 750;
}

.pill.idle {
  border-color: #36445d;
  color: #91a0b8;
  background: #151e2e;
}

.pill.pending {
  border-color: #876d2d;
  color: #ffd876;
  background: #2b2618;
}

.pill.ok {
  border-color: #25785d;
  color: #72e1b7;
  background: #122a24;
}

.pill.recording {
  border-color: #a23e55;
  color: #ff8ca0;
  background: #341923;
}

label {
  display: block;
  margin: 0 0 8px;
  color: #aab8ce;
  font-size: 0.8rem;
  font-weight: 750;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  width: 100%;
  border: 1px solid #34435d;
  border-radius: 11px;
  outline: none;
  background: #0c1423;
  color: #f3f7ff;
}

input {
  padding: 13px 14px;
  font-size: 0.86rem;
}

#ws-url,
#session-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

select {
  padding: 12px;
}

input:focus,
select:focus {
  border-color: #6991f6;
  box-shadow: 0 0 0 3px rgba(105, 145, 246, 0.14);
}

input:disabled,
select:disabled {
  opacity: 0.68;
}

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

.identity-grid {
  margin-top: 0;
  margin-bottom: 16px;
}

.field-help {
  margin: 8px 0 0;
  color: #71829d;
  font-size: 0.76rem;
  line-height: 1.45;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

button {
  border: 0;
  border-radius: 11px;
  padding: 11px 16px;
  cursor: pointer;
  color: white;
  font-weight: 780;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

button.primary {
  background: #4672ee;
}

button.danger {
  background: #bc405a;
}

button.secondary {
  border: 1px solid #3a4962;
  background: #182236;
  color: #b9c6d9;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.metric {
  min-width: 0;
  padding: 17px;
}

.metric span {
  display: block;
  margin-bottom: 7px;
  color: #8494ad;
  font-size: 0.75rem;
}

.metric strong {
  display: block;
  overflow: hidden;
  font-size: 1.05rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#meter {
  display: block;
  width: 100%;
  height: 66px;
  border-radius: 10px;
  background: #172033;
}

.muted {
  color: #8494ad;
  font-size: 0.78rem;
}

.log {
  max-height: 310px;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem;
}

.log li {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 12px;
  border-top: 1px solid rgba(169, 188, 222, 0.1);
  padding: 10px 0;
  color: #bfcbdd;
}

.log li:first-child {
  border-top: 0;
}

.log time {
  color: #6e809c;
}

.log .success span {
  color: #72e1b7;
}

.log .warning span {
  color: #ffd876;
}

.log .error span {
  color: #ff8ca0;
}

.notice {
  margin-top: 18px;
  padding: 16px 18px;
  color: #9eadc2;
  font-size: 0.86rem;
  line-height: 1.55;
}

.notice strong {
  color: #f0f5ff;
}

code {
  border-radius: 5px;
  padding: 2px 5px;
  background: #0c1423;
  color: #8fb0ff;
}

@media (max-width: 740px) {
  .shell {
    width: min(100% - 20px, 1080px);
    padding-top: 34px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .pills {
    justify-content: flex-start;
  }

  .settings-grid,
  .metrics {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 440px) {
  .settings-grid,
  .metrics {
    grid-template-columns: 1fr;
  }

  .actions button {
    width: 100%;
  }
}
