html, body {
  height: 100%;
}

.playground-body {
  display: flex;
  flex-direction: column;
  margin: 0;
  height: 100vh;
  overflow: hidden;
  background: #eceae3;
  /* preview.css declares html, body font-family for the WKWebView preview;
     override it here so the page chrome stays sans-serif. */
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #1e2a33;
}

.playground-body .site-header {
  flex: 0 0 auto;
}

.playground-shell {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.playground-stage {
  flex: 1 1 auto;
  display: flex;
  flex-direction: row;
  gap: 10px;
  padding: 10px 12px 6px;
  min-height: 0;
}

.pane-card {
  /* override styles.css `section { padding: 64px 24px }` for our card-shaped sections */
  padding: 0;
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: #ffffff;
  border: 1px solid rgba(214, 212, 203, 0.78);
  border-radius: 12px;
  box-shadow: 0 8px 22px rgba(30, 42, 51, 0.08), 0 1px 2px rgba(30, 42, 51, 0.06);
  overflow: hidden;
}

.pane-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(214, 212, 203, 0.72);
}

.pane-title-group {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.pane-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #1e2a33;
  line-height: 1;
}

.pane-status {
  color: #6b7077;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pane-actions {
  margin-left: auto;
  display: inline-flex;
  gap: 6px;
}

.pane-action {
  appearance: none;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  padding: 6px 11px;
  border: 0;
  border-radius: 6px;
  background: rgba(120, 120, 128, 0.10);
  color: #1e2a33;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 120ms ease;
}

.pane-action:hover {
  background: rgba(120, 120, 128, 0.16);
}

.pane-action:focus-visible {
  outline: 2px solid #4f6e55;
  outline-offset: 2px;
}

.pane-action--primary {
  background: #4f6e55;
  color: white;
}

.pane-action--primary:hover {
  background: #36533d;
}

.pane-toolbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  min-height: 42px;
  border-bottom: 1px solid rgba(214, 212, 203, 0.72);
  background: rgba(244, 242, 235, 0.42);
}

.toolbar-label {
  margin-right: 2px;
  color: #6b7077;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.chip {
  appearance: none;
  cursor: pointer;
  padding: 4px 9px;
  border: 1px solid rgba(214, 212, 203, 0.78);
  border-radius: 6px;
  background: white;
  color: #1e2a33;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color 120ms ease, border-color 120ms ease;
}

.chip:hover {
  background: rgba(120, 120, 128, 0.06);
}

.chip:focus-visible,
.mode-button:focus-visible {
  outline: 2px solid #4f6e55;
  outline-offset: 2px;
}

.chip.is-active {
  border-color: #4f6e55;
  background: #4f6e55;
  color: white;
}

.mode-switch {
  display: inline-flex;
  border: 1px solid rgba(214, 212, 203, 0.78);
  border-radius: 6px;
  overflow: hidden;
  background: white;
}

.mode-button {
  appearance: none;
  cursor: pointer;
  padding: 4px 11px;
  border: 0;
  background: transparent;
  color: #1e2a33;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
}

.mode-button + .mode-button {
  border-left: 1px solid rgba(214, 212, 203, 0.78);
}

.mode-button.is-active {
  background: #4f6e55;
  color: white;
}

.trial-toast {
  margin-left: auto;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(162, 57, 57, 0.10);
  color: #a23939;
  font-weight: 700;
  font-size: 12px;
  white-space: nowrap;
}

.pane-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  background: white;
}

.editor-pane .pane-content {
  display: flex;
}

.editor-pane textarea {
  display: block;
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  margin: 0;
  border: 0;
  outline: none;
  resize: none;
  padding: 18px 22px;
  background: white;
  color: #1e2a33;
  font-family: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace;
  font-size: 14px;
  line-height: 1.65;
  caret-color: #36533d;
  overflow: auto;
  tab-size: 4;
}

.preview-pane .pane-content {
  background: #e9e9ec;
  overflow: auto;
}

.preview-stage {
  padding: 22px 18px;
}

.preview-stage .page,
.preview-stage .slide {
  background: #ffffff;
  margin: 0 auto 22px;
  padding: 50px 56px;
  max-width: 720px;
  font-size: 11.5pt;
  line-height: 1.55;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06), 0 8px 24px rgba(0,0,0,0.08);
  font-family: "Charter", "Georgia", "Palatino", "Times New Roman", serif;
  color: #1a1a1a;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.preview-stage .slide {
  aspect-ratio: 16 / 9;
  padding: 36px 44px;
  overflow: hidden;
}

.preview-stage .empty {
  margin: 80px auto;
  max-width: 360px;
  text-align: center;
  color: #6b7077;
  font-size: 14px;
}

.preview-stage .mermaid {
  display: block;
  margin: 1.45em auto;
  text-align: center;
}

.preview-stage .mermaid svg {
  max-width: 100%;
  height: auto;
}

.preview-stage .slide .mermaid {
  max-width: 70%;
  margin: 0.6em auto;
}

.preview-stage .slide .mermaid svg {
  max-width: 100%;
  max-height: 200px;
  width: auto;
  height: auto;
}

.meter-warn { color: #b8722a; font-weight: 700; }
.meter-stop { color: #a23939; font-weight: 700; }

.playground-trialbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding: 8px 16px 10px;
  border-top: 1px solid rgba(214, 212, 203, 0.72);
  background: rgba(244, 242, 235, 0.78);
  font-size: 12px;
  color: #4a5056;
}

.trialbar-note {
  flex: 1 1 auto;
  min-width: 0;
}

.playground-trialbar .button {
  min-height: 28px;
  padding: 0 11px;
  font-size: 12px;
}

