:root {
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  background: #243242;
  color: #172033;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background: #2d3b4c;
}

button,
input {
  font: inherit;
}

[hidden] {
  display: none !important;
}

.app-shell {
  width: 100vw;
  height: 100vh;
  display: grid;
  grid-template-rows: 56px minmax(0, 1fr);
  background: #2d3b4c;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 18px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.38);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.controls {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.scene-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: #344158;
  font-size: 13px;
  font-weight: 650;
}

.scene-input {
  width: 180px;
  height: 34px;
  padding: 0 11px;
  border: 1px solid #c9d3e1;
  border-radius: 6px;
  background: #ffffff;
  color: #172033;
  outline: none;
}

.scene-input:focus {
  border-color: #3877d5;
  box-shadow: 0 0 0 3px rgba(56, 119, 213, 0.14);
}

.button {
  height: 34px;
  min-width: 68px;
  padding: 0 14px;
  border: 1px solid #c9d3e1;
  border-radius: 6px;
  background: #ffffff;
  color: #223047;
  cursor: pointer;
}

.button:hover:not(:disabled) {
  border-color: #8aa6cc;
  background: #f8fbff;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.button-primary {
  border-color: #2167c8;
  background: #2167c8;
  color: #ffffff;
  font-weight: 650;
}

.button-primary:hover:not(:disabled) {
  border-color: #174f9d;
  background: #174f9d;
}

.status {
  min-width: 104px;
  padding: 7px 12px;
  border: 1px solid #d4dce8;
  border-radius: 6px;
  background: #f9fbfd;
  color: #58667b;
  font-size: 13px;
  text-align: center;
}

.status[data-tone="ready"] {
  border-color: #9fd7b3;
  background: #eef9f2;
  color: #257047;
}

.status[data-tone="busy"] {
  border-color: #a8c9f3;
  background: #eef6ff;
  color: #245b96;
}

.status[data-tone="error"] {
  border-color: #f0b4b4;
  background: #fff1f1;
  color: #a13b3b;
}

.viewer {
  min-width: 0;
  min-height: 0;
  display: grid;
  background: #2d3b4c;
}

.preview-frame {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  border: 0;
  display: block;
  background: #2d3b4c;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 700px) {
  .app-shell {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
  }

  .controls {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
  }

  .scene-field {
    grid-column: 1 / -1;
  }

  .scene-input {
    width: 100%;
  }

  .status {
    width: 100%;
  }
}
