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

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

.page-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0;
}

.control-card, .iframe-panel {
  background: #ffffff;
  border: 1px solid #dbe3ef;
  border-radius: 20px;
  box-shadow: 0 14px 40px rgba(29, 45, 68, 0.08);
}

h1 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 5vw, 3.25rem);
}

.control-card {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  align-items: end;
  padding: 20px;
}

label {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

input, select, button {
  width: 100%;
  border-radius: 12px;
  border: 1px solid #c9d4e5;
  padding: 12px 14px;
  font: inherit;
}

button {
  border: 0;
  background: #2d6cdf;
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
}

button:disabled, select:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.status-message {
  min-height: 1.5em;
  color: #40516b;
}

.iframe-panel {
  --iframe-height: 900px;
  position: relative;
  min-height: var(--iframe-height);
  overflow: hidden;
}

.iframe-panel iframe {
  width: 100%;
  height: var(--iframe-height);
  border: 0;
  background: #f8fafc;
}

.overlay-card {
  position: absolute;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%);
  z-index: 2;
  width: min(360px, calc(100% - 48px));
  padding: 20px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(45, 108, 223, 0.22);
  box-shadow: 0 18px 50px rgba(15, 31, 56, 0.18);
  backdrop-filter: blur(10px);
}

.overlay-card h2 {
  margin: 0 0 10px;
}

.overlay-card p {
  margin: 8px 0 0;
}

.formula {
  color: #5d6b82;
  word-break: break-word;
}

.placeholder-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 32px;
  background: #f8fafc;
  color: #172033;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.placeholder-card {
  max-width: 680px;
  padding: 32px;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid #dbe3ef;
  box-shadow: 0 14px 40px rgba(29, 45, 68, 0.08);
}

@media (max-width: 820px) {
  .control-card {
    grid-template-columns: 1fr;
  }

  .overlay-card {
    position: static;
    transform: none;
    width: auto;
    margin: 16px;
  }
}
