:root {
  font-family: "Inter", system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #eef5f4;
  background: #0d1214;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: clamp(16px, 5vw, 52px);
  background: radial-gradient(ellipse at 50% 4%, #193135, #0d1214 62%);
}

main {
  width: min(100%, 680px);
  padding: clamp(20px, 5vw, 44px);
  border: 1px solid #304246;
  border-radius: 28px;
  background: #131b1e;
  text-align: center;
  box-shadow: 0 24px 72px #0006;
}

h1 {
  margin: 0;
  font-size: clamp(32px, 7vw, 50px);
  font-weight: 680;
  letter-spacing: -.055em;
}

button {
  min-height: 46px;
  padding: 10px 20px;
  border: 1px solid #405456;
  border-radius: 999px;
  background: #1d292c;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

button:hover { filter: brightness(1.12); }
button:focus-visible { outline: 2px solid #a1e9d7; outline-offset: 4px; }
button:disabled { opacity: .5; cursor: default; }

.workspace-body, .embedded body {
  place-items: start center;
  padding-bottom: max(96px, 12vw);
}

.embedded .standalone-nav { display: none; }
.workspace-page { min-width: 0; overflow-wrap: anywhere; }
.workspace-page button { translate: clamp(4px, 1.25vw, 8px); }

.workspace-title {
  display: flex;
  align-items: center;
  gap: clamp(12px, 3vw, 20px);
  padding: clamp(14px, 3vw, 22px);
  border: 1px solid #385457;
  border-radius: 16px;
  background: linear-gradient(110deg, #1e3235, #152024);
  box-shadow: 0 6px 18px #0003;
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  letter-spacing: .02em;
  line-height: 1.2;
  text-align: left;
}

.workspace-title::before {
  content: "";
  flex: none;
  width: clamp(40px, 8vw, 56px);
  aspect-ratio: 1;
  border: 1px solid #557a78;
  border-radius: 12px;
  background:
    radial-gradient(circle at 50% 35%, #a1e9d7 12%, transparent 14%),
    radial-gradient(ellipse 30% 28% at 50% 88%, #a1e9d7 97%, transparent),
    #243d3f;
}

@media (min-width: 768px) {
  .workspace-page { width: min(100%, 1040px); }
}

h2 { font-size: .98rem; font-weight: 650; margin: 0; }

li {
  display: grid;
  grid-template-columns: 5ch 1fr;
  gap: 14px;
  padding: 12px 4px 12px 0;
  border-bottom: 1px solid #263438;
  overflow-wrap: anywhere;
}

li:last-child { border-bottom: 0; }
li strong { color: #a1e9d7; font-size: .87rem; }
li span { white-space: pre-wrap; line-height: 1.5; }

.page-nav {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.page-nav a {
  color: #a1e9d7;
  font-size: .9rem;
  padding: 4px 0;
  text-underline-offset: 4px;
}

.settings-page { text-align: left; }
.settings-page form { margin-top: 22px; }
.login-page { max-width: 440px; }
.login-page h1 { font-size: clamp(28px, 7vw, 38px); }
.login-page .field-note { margin-top: 14px; }

.settings-page label {
  display: block;
  margin: 18px 0 7px;
  color: #eef5f4;
  font-size: .94rem;
  font-weight: 600;
}

.settings-page input:not([type="checkbox"]), .settings-page select {
  width: 100%;
  min-height: 45px;
  padding: 10px 12px;
  border: 1px solid #405456;
  border-radius: 10px;
  background: #101719;
  color: #eef5f4;
  font: inherit;
}

.settings-page input:focus-visible, .settings-page select:focus-visible, .page-nav a:focus-visible {
  outline: 2px solid #a1e9d7;
  outline-offset: 2px;
}

.settings-page .checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-weight: 400;
}

.field-note, #settings-status {
  margin: 6px 0 0;
  color: #a5b8b8;
  font-size: .88rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

#settings-status { margin: 14px 0 0; }
#settings-status[data-state="error"] { color: #ffb1a9; }
#settings-status[data-state="live"] { color: #a1e9d7; }

.settings-nav { align-items: center; gap: 14px; }
.settings-nav button { min-height: 36px; padding: 7px 12px; font-size: .9rem; }

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

#test-status[data-state="error"], #login-status[data-state="error"], #passkey-status[data-state="error"] { color: #ffb1a9; }
#test-status[data-state="live"] { color: #a1e9d7; }

.settings-section {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #304246;
}

#passkey-list { margin: 12px 0 0; padding: 0; list-style: none; }
#passkey-list:empty { display: none; }
#passkey-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; }
#passkey-list li + li { border-top: 1px solid #304246; }
#passkey-list li span { overflow-wrap: anywhere; }

.mic-test-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-top: 14px;
}

#mic-test-level {
  flex: 1;
  min-width: 110px;
  height: 17px;
  accent-color: #a1e9d7;
}

#mic-test-status[data-state="error"] { color: #ffb1a9; }
#mic-test-status[data-state="live"] { color: #a1e9d7; }

.primary-button {
  background: #a1e9d7;
  color: #102b27;
  font-weight: 650;
  border-color: transparent;
}
