:root {
  color-scheme: light;
  --bg: #f6f7f8;
  --panel: #ffffff;
  --text: #14191f;
  --muted: #5f6975;
  --line: #d9dee5;
  --accent: #0f766e;
  --danger: #a4343a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

.shell {
  min-height: 100vh;
  padding: 20px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 22px;
  line-height: 1.2;
}

.topbar p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}

.controls {
  display: grid;
  grid-template-columns: minmax(260px, 1.2fr) minmax(260px, 1fr);
  gap: 12px;
  align-items: end;
  padding: 14px;
  margin-bottom: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

input,
textarea {
  width: 100%;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
}

textarea {
  min-height: 104px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

details {
  grid-column: 1 / -1;
}

summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
}

.actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 9px 12px;
  cursor: pointer;
}

button:first-child {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

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

.sync {
  display: inline-flex;
  grid-auto-flow: column;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.sync input {
  width: auto;
}

output {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-align: right;
}

.compare {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  min-height: 0;
}

.pane {
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.pane-header h2 {
  font-size: 14px;
}

.pane-header span {
  color: var(--muted);
  font-size: 12px;
}

.stream-surface {
  position: relative;
  width: min(100%, 390px);
  aspect-ratio: 390 / 844;
  margin: 0 auto;
  background: #eef1f4;
}

iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.input-overlay {
  position: absolute;
  inset: 0;
  cursor: default;
  outline: none;
}

.input-overlay:focus {
  box-shadow: inset 0 0 0 2px var(--accent);
}

@media (max-width: 960px) {
  .controls,
  .compare {
    grid-template-columns: 1fr;
  }

  output {
    text-align: left;
  }
}
