:root {
  color-scheme: light;
  font-family: Inter, "Helvetica Neue", Arial, sans-serif;
  --red: #df1734;
  --red-deep: #af0824;
  --ink: #29212a;
  --muted: #70656d;
  --soft-muted: #958991;
  --line: #eadfe3;
  --line-strong: #ddccd2;
  --paper: #fbf8f6;
  --panel: rgba(255, 255, 255, 0.9);
  --pink: #fff0f3;
  --green: #5eaa79;
  --amber: #db942f;
  --danger: #b84036;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background:
    radial-gradient(circle at 96% 4%, rgba(255, 210, 219, 0.48), transparent 30rem),
    radial-gradient(circle at 2% 90%, rgba(239, 220, 225, 0.4), transparent 27rem),
    var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid #8f2fc3;
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: -5rem;
  left: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 0.65rem;
  background: white;
  color: var(--red-deep);
  box-shadow: 0 8px 24px rgba(75, 34, 48, 0.14);
}

.skip-link:focus {
  top: 1rem;
}

.site-header,
.studio,
.site-footer {
  width: min(calc(100% - 48px), 1500px);
  margin-inline: auto;
}

.site-header {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink);
  text-decoration: none;
}

.brand-spark {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--red);
  color: white;
  font-size: 1.5rem;
  line-height: 1;
  transform: rotate(-13deg);
}

.brand-name {
  font-size: 1.75rem;
  font-weight: 850;
  letter-spacing: -0.075em;
  line-height: 1;
}

.brand-period {
  color: var(--red);
}

.brand-divider {
  width: 1px;
  height: 30px;
  margin-inline: 0.55rem 0.25rem;
  background: #d8cbd0;
}

.brand-team {
  color: #685d65;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.025em;
  line-height: 1.3;
  text-transform: uppercase;
}

.connection-summary {
  min-width: 178px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: rgba(255, 255, 255, 0.74);
}

.connection-summary div {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.status-label,
.section-kicker,
.eyebrow {
  color: var(--red);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.connection-summary strong {
  font-size: 0.88rem;
}

.status-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #aaa0a7;
  box-shadow: 0 0 0 4px rgba(170, 160, 167, 0.12);
}

.status-dot[data-state="connecting"] {
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(219, 148, 47, 0.14);
  animation: pulse 1.2s ease-in-out infinite;
}

.status-dot[data-state="active"] {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(94, 170, 121, 0.14);
}

.status-dot[data-state="error"] {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(184, 64, 54, 0.12);
}

@keyframes pulse {
  50% { opacity: 0.45; }
}

.studio {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(430px, 0.85fr);
  align-items: start;
  gap: 16px;
  min-height: 660px;
  height: auto;
  padding-bottom: 14px;
}

.mel-panel,
.controls-panel,
.settings-panel,
.log-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 18px 50px rgba(96, 42, 57, 0.07);
  backdrop-filter: blur(9px);
}

.mel-panel {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 12px;
  height: calc(100dvh - 106px);
  padding: 22px;
  border-radius: 1.4rem;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.eyebrow,
.section-kicker {
  margin: 0;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.eyebrow > span {
  width: 24px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

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

h1 {
  margin: 0.35rem 0 0;
  font-size: clamp(2.5rem, 4vw, 4.9rem);
  line-height: 0.98;
  letter-spacing: -0.07em;
}

h1 em {
  color: var(--red);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
}

h2 {
  margin: 0.25rem 0 0;
  font-size: 1.15rem;
  letter-spacing: -0.025em;
}

.audio-meter {
  width: 88px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 5px;
  border: 1px solid #f1dde2;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
}

.audio-meter span {
  width: 5px;
  height: 24px;
  border-radius: 999px;
  background: linear-gradient(#f06d81, var(--red));
  opacity: 0.75;
  transform: scaleY(0.16);
  transition: transform 75ms linear;
}

.mel-stage {
  position: relative;
  isolation: isolate;
  min-height: 420px;
  flex: 1 1 auto;
  overflow: hidden;
  margin-top: 16px;
  border: 1px solid #f4e2e5;
  border-radius: 1.3rem;
  background:
    radial-gradient(ellipse at 54% 38%, rgba(255, 255, 255, 0.96) 0%, rgba(255, 244, 247, 0.76) 34%, transparent 73%),
    radial-gradient(circle at 83% 20%, #fdd7df 0%, #fae8eb 29%, #f9f0ed 75%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 20px 45px rgba(126, 61, 75, 0.07);
}

.fullscreen-button {
  position: absolute;
  z-index: 6;
  top: 1rem;
  right: 1rem;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.96);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: #64515d;
  box-shadow: 0 6px 18px rgba(83, 43, 51, 0.09);
  font-size: 0.75rem;
  font-weight: 750;
  backdrop-filter: blur(8px);
}

.fullscreen-button:hover {
  border-color: #e8cbd2;
  background: white;
}

.fullscreen-button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.mel-stage.mel-stage--fullscreen {
  position: fixed;
  z-index: 1000;
  inset: 0;
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}

.mel-stage.mel-stage--fullscreen[data-chroma="black"] { background: #000; }
.mel-stage.mel-stage--fullscreen[data-chroma="green"] { background: #00ff00; }
.mel-stage.mel-stage--fullscreen[data-chroma="blue"] { background: #0000ff; }

.mel-stage.mel-stage--fullscreen .fallback-art {
  inset: 0 auto 0 48%;
  width: min(46vw, 175vh);
  height: 100%;
  transform-origin: center;
}

.mel-stage.mel-stage--fullscreen .fallback-art {
  object-fit: contain;
  mix-blend-mode: normal;
}

.mel-stage.mel-stage--fullscreen::before,
.mel-stage.mel-stage--fullscreen::after,
.mel-stage.mel-stage--fullscreen .stage-orbit,
.mel-stage.mel-stage--fullscreen .stage-shadow,
.mel-stage.mel-stage--fullscreen .stage-badge {
  display: none;
}

.mel-stage.mel-stage--fullscreen .fullscreen-button {
  display: none;
}

.chroma-picker {
  display: none;
}

.mel-stage.mel-stage--fullscreen .chroma-picker {
  position: absolute;
  z-index: 8;
  top: 1.25rem;
  left: 1.25rem;
  display: block;
  width: min(430px, calc(100vw - 2.5rem));
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 1rem;
  background: rgba(28, 25, 27, 0.9);
  color: white;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(10px);
}

.mel-stage.mel-stage--fullscreen .chroma-picker[hidden] {
  display: none;
}

.chroma-picker p {
  margin: 0 0 12px;
  font-size: 0.8rem;
  font-weight: 750;
}

.chroma-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.chroma-option {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 7px 3px;
  border: 1px solid transparent;
  border-radius: 0.6rem;
  background: transparent;
  color: white;
  font-size: 0.72rem;
  font-weight: 700;
}

.chroma-option:hover,
.chroma-option[aria-pressed="true"] {
  border-color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.14);
}

.chroma-swatch {
  width: 48px;
  height: 48px;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.chroma-option[data-color="black"] .chroma-swatch { background: #000; }
.chroma-option[data-color="white"] .chroma-swatch { background: #fff; }
.chroma-option[data-color="green"] .chroma-swatch { background: #00ff00; }
.chroma-option[data-color="blue"] .chroma-swatch { background: #0000ff; }

.chroma-option kbd {
  color: #d7cbd0;
  font-family: inherit;
  font-size: 0.62rem;
}

.fullscreen-hint {
  display: none;
}

.mel-stage.mel-stage--fullscreen .fullscreen-hint {
  position: absolute;
  z-index: 7;
  top: 1.25rem;
  left: 50%;
  display: block;
  margin: 0;
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  background: rgba(28, 25, 27, 0.76);
  color: white;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  pointer-events: none;
  transform: translateX(-50%);
  animation: fullscreen-hint 3s ease forwards;
  max-width: calc(100vw - 2rem);
  width: max-content;
  text-align: center;
}

@keyframes fullscreen-hint {
  0%, 58% { opacity: 1; }
  100% { opacity: 0; visibility: hidden; }
}

body.mel-fullscreen-open {
  overflow: hidden;
}

body.mel-fullscreen-open .mel-panel {
  z-index: 1000;
  backdrop-filter: none;
}

.mel-stage::before {
  position: absolute;
  z-index: 0;
  top: -36%;
  right: -20%;
  width: 75%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 28% 67%, rgba(255, 255, 255, 0.18), rgba(235, 46, 78, 0.16) 55%, rgba(235, 46, 78, 0.04) 72%);
  content: "";
}

.mel-stage::after {
  position: absolute;
  z-index: 0;
  bottom: -18%;
  left: 3%;
  width: 95%;
  height: 37%;
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  content: "";
  transform: rotate(-8deg);
}

.stage-orbit {
  position: absolute;
  z-index: 0;
  border: 1px solid rgba(233, 93, 118, 0.17);
  border-radius: 50%;
  pointer-events: none;
}

.stage-orbit-one {
  top: 28%;
  left: 6%;
  width: 89%;
  height: 39%;
  transform: rotate(-23deg);
}

.stage-orbit-two {
  top: 34%;
  left: 14%;
  width: 75%;
  height: 30%;
  border-color: rgba(255, 255, 255, 0.8);
  transform: rotate(23deg);
}

.stage-shadow {
  position: absolute;
  z-index: 1;
  bottom: 10%;
  left: 29%;
  width: 42%;
  height: 7%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(112, 57, 69, 0.24), rgba(112, 57, 69, 0.06) 56%, transparent 74%);
  filter: blur(6px);
}

.mel-viewer {
  position: absolute;
  z-index: 2;
  inset: 0;
  cursor: grab;
  touch-action: none;
}

.mel-viewer:active {
  cursor: grabbing;
}

.mel-viewer canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.fallback-art {
  position: absolute;
  z-index: 2;
  top: 9%;
  left: 11%;
  width: min(78%, 550px);
  height: 80%;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.load-status {
  position: absolute;
  z-index: 4;
  top: 50%;
  left: 50%;
  width: max-content;
  max-width: calc(100% - 3rem);
  padding: 0.75rem 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.88);
  color: #675a62;
  box-shadow: 0 6px 20px rgba(76, 40, 50, 0.08);
  font-size: 0.82rem;
  font-weight: 650;
  text-align: center;
  transform: translate(-50%, -50%);
}

.stage-badge {
  position: absolute;
  z-index: 3;
  right: 1rem;
  bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  color: #775e67;
  box-shadow: 0 5px 15px rgba(83, 43, 51, 0.07);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  pointer-events: none;
}

.stage-badge span {
  color: var(--red);
}

.stage-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 13px;
}

.stage-actions p {
  margin: 0;
  color: var(--soft-muted);
  font-size: 0.76rem;
}

.stage-actions p span {
  color: var(--red);
  font-size: 1rem;
}

.wave-button,
.quiet-button,
.text-button {
  background: transparent;
  color: #64515d;
}

.wave-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid #eadde1;
  border-radius: 0.65rem;
  background: white;
  font-size: 0.78rem;
  font-weight: 750;
}

.wave-button span {
  color: var(--red);
}

.button-shortcut {
  min-width: 1.4rem;
  height: 1.4rem;
  display: inline-grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 0.35rem;
  font-family: inherit;
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 1;
  opacity: 0.75;
}

button[data-shortcut-label]::after {
  content: attr(data-shortcut-label);
  display: inline-grid;
  place-items: center;
  min-width: 1.35rem;
  height: 1.25rem;
  margin-left: 0.15rem;
  padding: 0 0.2rem;
  border: 1px solid currentColor;
  border-radius: 0.3rem;
  font-family: inherit;
  font-size: 0.6rem;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  vertical-align: middle;
  opacity: 0.7;
}

.workbench {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(300px, 1fr);
  gap: 12px;
  overflow: visible;
}

.controls-panel,
.settings-panel,
.log-panel {
  border-radius: 1rem;
}

.controls-panel {
  padding: 18px;
}

.control-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.field {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label,
.prompt-label label {
  color: #3b3038;
  font-size: 0.78rem;
  font-weight: 750;
}

.field-help,
.prompt-field p,
.settings-footer,
.site-footer {
  color: var(--soft-muted);
  font-size: 0.68rem;
  line-height: 1.4;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 0.65rem;
  outline: none;
  background: white;
  color: var(--ink);
}

input,
select {
  min-height: 42px;
  padding: 0 10px;
}

.knowledge-access-dialog {
  width: min(calc(100% - 28px), 440px);
  max-height: min(calc(100dvh - 28px), 640px);
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 28px 90px rgba(34, 17, 27, 0.3);
}

.knowledge-access-dialog::backdrop {
  background: rgba(35, 19, 29, 0.66);
  backdrop-filter: blur(7px);
}

.knowledge-dialog-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: 1.5rem;
}

.knowledge-access-dialog .section-kicker {
  margin: 0 0 7px;
}

.knowledge-access-dialog h2 {
  margin: 0;
  font-size: clamp(1.45rem, 5vw, 1.85rem);
  line-height: 1.15;
}

#knowledgeDialogDescription {
  margin: 11px 0 23px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.knowledge-unlock-form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 9px;
}

.knowledge-unlock-form label {
  font-size: 0.77rem;
  font-weight: 750;
}

.knowledge-unlock-form input {
  min-width: 0;
}

.knowledge-unlock-form button {
  min-height: 46px;
  margin-top: 4px;
  border-radius: 0.6rem;
  background: var(--red);
  color: white;
  font-size: 0.82rem;
  font-weight: 800;
}

.knowledge-unlock-form button:hover:not(:disabled) {
  background: var(--red-deep);
}

.knowledge-modal-message {
  min-height: 1.4em;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.4;
}

.knowledge-modal-message[data-state="error"] {
  color: var(--danger);
}

.start-button {
  width: 100%;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 14px;
  border-radius: 0.7rem;
  background: var(--red);
  color: white;
  box-shadow: 0 8px 18px rgba(223, 23, 52, 0.18);
  font-size: 0.9rem;
  font-weight: 800;
}

.start-button:hover:not(:disabled) {
  background: #c90d2b;
}

.start-button[data-active="true"] {
  background: #3f343c;
  box-shadow: none;
}

.start-icon {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: currentColor;
}

.start-button[data-active="true"] .start-icon {
  border-radius: 2px;
}

.settings-panel {
  position: relative;
}

.settings-panel[open] {
  min-height: 315px;
  height: auto;
}

.settings-panel summary {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 18px;
  cursor: pointer;
  list-style: none;
}

.settings-panel summary::-webkit-details-marker {
  display: none;
}

.summary-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.summary-copy strong {
  font-size: 0.98rem;
}

.summary-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--soft-muted);
  font-size: 0.68rem;
}

.summary-meta .chevron {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--red);
  font-size: 1rem;
  transition: transform 180ms ease;
}

.settings-panel[open] .chevron {
  transform: rotate(180deg);
}

#saveStatus[data-state="error"] {
  color: var(--danger);
}

.settings-body {
  padding: 0 18px 15px;
  border-top: 1px solid #f1e7ea;
}

.prompt-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding-top: 14px;
}

.prompt-field {
  min-width: 0;
}

.prompt-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.prompt-label span {
  color: var(--soft-muted);
  font-size: 0.62rem;
  white-space: nowrap;
}

.prompt-field p {
  min-height: 29px;
  margin: 5px 0 7px;
}

textarea {
  min-height: 170px;
  resize: vertical;
  padding: 10px;
  font-size: 0.76rem;
  line-height: 1.45;
}

.settings-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 10px;
}

.settings-footer > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.settings-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.save-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}

.text-button {
  padding: 4px 0;
  color: var(--soft-muted);
  font-size: 0.68rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.shared-save-button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 0.55rem;
  background: var(--red);
  color: white;
  font-size: 0.68rem;
  font-weight: 800;
}

.shared-save-button:hover:not(:disabled) {
  background: #c90d2b;
}

.log-panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 18px;
}

.log-heading {
  align-items: center;
  flex: 0 0 auto;
}

.log-actions {
  display: flex;
  gap: 6px;
}

.quiet-button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: white;
  font-size: 0.7rem;
  font-weight: 700;
}

.conversation-log {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  margin-top: 13px;
  padding: 9px;
  border: 1px solid #f0e5e8;
  border-radius: 0.75rem;
  background: #fdfafa;
  scrollbar-color: #ddcdd2 transparent;
}

.empty-log {
  height: 100%;
  min-height: 110px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 6px;
  color: #a0939b;
  text-align: center;
}

.empty-log span {
  color: var(--red);
  font-size: 1.35rem;
}

.empty-log p {
  margin: 0;
  font-size: 0.75rem;
}

.log-entry {
  margin-bottom: 8px;
  padding: 9px 10px;
  border: 1px solid #eee2e5;
  border-radius: 0.65rem;
  background: white;
}

.log-entry[data-kind="assistant"] {
  border-color: #f1cdd5;
  background: #fff4f6;
}

.log-entry[data-kind="user"] {
  margin-left: 9%;
}

.log-entry[data-kind="system"],
.log-entry[data-kind="error"] {
  border-style: dashed;
  background: #faf7f8;
}

.log-entry[data-kind="error"] {
  border-color: #e5b4af;
  color: var(--danger);
}

.log-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.log-speaker {
  color: var(--red-deep);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.log-time {
  color: #a0939b;
  font-size: 0.6rem;
}

.log-message {
  margin: 0;
  color: #4b3f47;
  font-size: 0.77rem;
  line-height: 1.48;
  white-space: pre-wrap;
}

.site-footer {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
}

.site-footer p {
  max-width: 850px;
  margin: 0;
}

.site-footer > span {
  white-space: nowrap;
}

#remoteAudio {
  display: none;
}

@media (max-width: 1100px) {
  .site-header,
  .studio,
  .site-footer {
    width: min(calc(100% - 32px), 900px);
  }

  .studio {
    height: auto;
    grid-template-columns: 1fr;
  }

  .mel-panel {
    position: static;
    height: auto;
    min-height: 700px;
  }

  .mel-stage {
    min-height: 540px;
  }

  .workbench {
    grid-template-rows: auto auto minmax(420px, auto);
  }

  .log-panel {
    min-height: 420px;
  }
}

@media (max-width: 680px) {
  .site-header,
  .studio,
  .site-footer {
    width: min(calc(100% - 20px), 520px);
  }

  .site-header {
    min-height: 74px;
  }

  .brand-divider,
  .brand-team {
    display: none;
  }

  .connection-summary {
    min-width: 0;
    padding: 9px 11px;
  }

  .status-label {
    display: none;
  }

  .mel-panel,
  .controls-panel,
  .log-panel {
    padding: 15px;
  }

  .mel-panel {
    min-height: 590px;
  }

  .mel-heading {
    align-items: center;
  }

  h1 {
    font-size: clamp(2.55rem, 13vw, 4rem);
  }

  .audio-meter {
    width: 72px;
  }

  .mel-stage {
    min-height: 430px;
  }

  .stage-actions p {
    max-width: 200px;
  }

  .control-grid,
  .prompt-grid {
    grid-template-columns: 1fr;
  }

  .prompt-field p {
    min-height: 0;
  }

  .settings-panel summary,
  .settings-body {
    padding-inline: 14px;
  }

  .summary-meta > span:first-child {
    display: none;
  }

  .site-footer {
    min-height: 92px;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 7px;
    padding-block: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .status-dot,
  .summary-meta .chevron,
  .audio-meter span {
    animation: none;
    transition: none;
  }

  .mel-stage.mel-stage--fullscreen .fullscreen-hint {
    animation: fullscreen-hint 2.4s step-end forwards;
  }
}
