:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #edf3fb;
  color: #132449;
}

* { box-sizing: border-box; }

body { margin: 0; min-width: 320px; }

button, input { font: inherit; }

button { cursor: pointer; }

button:focus-visible, input:focus-visible {
  outline: 3px solid #467eff;
  outline-offset: 3px;
}

.operator-shell { width: min(1280px, calc(100% - 48px)); margin: 0 auto; padding: clamp(34px, 5vw, 76px) 0 48px; }

.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; margin-bottom: 28px; }

.eyebrow, .section-kicker { margin: 0; color: #3169d4; font-size: 13px; font-weight: 800; letter-spacing: .12em; }

h1 { margin: 10px 0 12px; font-size: clamp(34px, 4vw, 54px); letter-spacing: -.04em; }
h2 { margin: 5px 0 0; font-size: 24px; letter-spacing: -.02em; }

.intro { max-width: 720px; margin: 0; color: #63718c; font-size: 17px; line-height: 1.65; }

.connection-card { display: flex; flex: 0 0 auto; align-items: center; gap: 12px; padding: 14px 18px; border: 1px solid #d5e1f2; border-radius: 16px; background: #fff; box-shadow: 0 10px 25px rgba(28, 69, 133, .08); }
.connection-card strong, .connection-card span { display: block; }
.connection-card span { margin-top: 3px; color: #71809a; font-size: 13px; }
.connection-dot { width: 11px; height: 11px; border-radius: 50%; background: #a2afc5; }
.connection-card.is-connected .connection-dot { background: #26a56b; box-shadow: 0 0 0 5px #26a56b1d; }

.control-card { border: 1px solid #d5e1f2; border-radius: 22px; background: #fff; box-shadow: 0 13px 36px rgba(32, 75, 143, .08); }
.session-card { padding: 26px; }
.session-controls { display: grid; grid-template-columns: auto minmax(220px, 1fr) auto; align-items: center; gap: 13px; margin-top: 22px; }
.session-controls label { color: #52617d; font-weight: 700; }
.session-controls input { width: 100%; min-height: 46px; padding: 0 13px; border: 1px solid #b8c8e0; border-radius: 10px; color: #132449; }

.validation-message, .display-message { min-height: 24px; margin: 16px 0 0; color: #60708c; line-height: 1.55; }
.validation-message.is-ready { color: #18784c; }
.validation-message.is-error, .display-message.is-error { color: #a23a3a; }

.control-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 22px; margin-top: 22px; }
.display-card, .stage-card { padding: 28px; }
.supporting-copy { margin: 20px 0; color: #63718c; line-height: 1.65; }
.button-row { display: flex; flex-wrap: wrap; gap: 12px; }

.primary-button, .secondary-button, .stage-controls button { min-height: 46px; padding: 0 18px; border: 1px solid transparent; border-radius: 10px; font-weight: 750; }
.primary-button { color: #fff; background: #2354c9; box-shadow: 0 8px 17px #2354c933; }
.primary-button:hover { background: #163fa1; }
.secondary-button { color: #244477; border-color: #b8c8e0; background: #fff; }
.secondary-button:hover:not(:disabled) { border-color: #5e86df; background: #f3f7ff; }
button:disabled { cursor: not-allowed; opacity: .5; }

.current-stage { margin: 20px 0 15px; color: #435574; font-weight: 700; }
.stage-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.stage-controls button { color: #305083; border-color: #c8d6ea; background: #f8fbff; text-align: left; }
.stage-controls button:hover:not(:disabled), .stage-controls button[aria-pressed="true"] { color: #fff; border-color: #245bd4; background: #245bd4; }
.stage-controls button { display: flex; align-items: center; gap: 12px; }
.stage-controls button b { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: #fff; background: #1c2f52; font-size: 15px; }
.stage-controls button[aria-pressed="true"] b { color: #1c2f52; background: #ffd447; }
.sound-control[aria-pressed="true"] { color: #1c2f52; border-color: #e4b83a; background: #ffd447; }

.privacy-note { display: flex; gap: 10px; margin-top: 22px; padding: 18px 21px; border-radius: 16px; color: #52617d; background: #e4edf9; line-height: 1.6; }
.privacy-note strong { color: #244477; white-space: nowrap; }

@media (max-width: 800px) {
  .operator-shell { width: min(100% - 28px, 1280px); padding-top: 28px; }
  .page-header, .control-grid { display: grid; grid-template-columns: 1fr; }
  .connection-card { width: fit-content; }
  .session-controls { grid-template-columns: 1fr; gap: 9px; }
  .session-controls .secondary-button { width: 100%; }
}

@media (max-width: 460px) {
  .session-card, .display-card, .stage-card { padding: 21px; }
  .stage-controls { grid-template-columns: 1fr; }
  .button-row > button { width: 100%; }
  .privacy-note { display: grid; }
}
