/* site/play/styles.css — matches site/index.html palette */
:root {
  --bg: #ffffff;
  --fg: #1a1a1a;
  --fg-soft: #555;
  --border: #e6e6e6;
  --accent: #4c78a8;
  --accent-soft: #e8eef5;
  --red: #c0392b;
  --green: #1f7a39;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
}
* {
  box-sizing: border-box;
}
body {
  font: 14px / 1.5 system-ui, -apple-system, sans-serif;
  margin: 0;
  color: var(--fg);
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
}
.topbar .brand {
  font-weight: 700;
  font-size: 18px;
  text-decoration: none;
  color: var(--fg);
}
.topbar nav a {
  margin-left: 16px;
  color: var(--fg-soft);
  text-decoration: none;
}
.topbar nav a:hover {
  color: var(--fg);
}
.playground {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 280px;
  gap: 12px;
  padding: 12px;
  height: calc(100vh - 110px);
}
.pane {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.pane h2 {
  font-size: 12px;
  margin: 0 0 8px 0;
  color: var(--fg-soft);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 0 24px 12px 24px;
}
button {
  padding: 8px 14px;
  border: 1px solid var(--border);
  background: white;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 12px;
}
button:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.trust {
  float: right;
  font-family: var(--mono);
  font-weight: 700;
}
.trust .trust-score {
  font-size: 14px;
}
.trust .trust-label {
  font-weight: 400;
  color: var(--fg-soft);
}
#audit-findings {
  list-style: none;
  padding: 0;
  margin: 0;
  overflow-y: auto;
}
#audit-findings li {
  padding: 8px;
  border-left: 3px solid var(--accent);
  margin-bottom: 6px;
  background: var(--accent-soft);
  font-size: 12px;
  border-radius: 3px;
}
/* Severity classes match @glyph/core's AuditFinding contract:
   high → red, medium → amber, low → accent blue (the default).
   The PR1 stubs used error/warning/info; those tier names don't exist
   in the real audit module — we use low/medium/high directly. */
#audit-findings li.severity-high {
  border-left-color: var(--red);
  background: #fdecea;
}
#audit-findings li.severity-medium {
  border-left-color: #d4a017;
  background: #fbf2d8;
}
#audit-findings li.severity-low {
  border-left-color: var(--accent);
  background: var(--accent-soft);
}
#audit-findings li.clean {
  border-left-color: var(--green);
  background: #eaf6ee;
  color: var(--green);
}
#audit-findings .audit-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}
#audit-findings .audit-sev {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  color: var(--fg-soft);
  letter-spacing: 0.04em;
}
#audit-findings .audit-msg {
  color: var(--fg);
}
#audit-findings .audit-suggestion {
  color: var(--fg-soft);
  font-style: italic;
  margin-top: 4px;
}
#audit-findings .audit-path {
  display: inline-block;
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg-soft);
  background: rgba(0, 0, 0, 0.04);
  padding: 1px 4px;
  border-radius: 3px;
}
.placeholder {
  color: var(--fg-soft);
  font-family: var(--mono);
  font-size: 12px;
  padding: 6px 0;
  margin: 0;
}
/* Live chart pane (PR4). The compiler emits an SVG with an explicit
   width/height; clamp it to the pane width and let the height scale
   proportionally so it never overflows the grid cell. */
#chart-preview {
  flex: 1 1 auto;
  overflow: auto;
  min-height: 200px;
}
#chart-preview svg {
  max-width: 100%;
  height: auto;
}
#chart-preview .error {
  color: var(--red);
  background: #fdecea;
  border-left: 3px solid var(--red);
  padding: 8px;
  font-family: var(--mono);
  font-size: 12px;
  border-radius: 3px;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}
/* Monaco needs a sized host or it renders 0×0. The pane is already a
   flex column; let the editor fill whatever vertical space is left. */
#spec-editor {
  flex: 1 1 auto;
  height: 100%;
  min-height: 240px;
}
.hint {
  color: var(--fg-soft);
  font-family: var(--mono);
  font-size: 11px;
  margin: 8px 0 4px 0;
}
#csv-upload input[type="file"] {
  font-family: var(--mono);
  font-size: 11px;
  margin-bottom: 4px;
}
#csv-upload textarea {
  width: 100%;
  font-family: var(--mono);
  font-size: 12px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  resize: vertical;
  background: white;
  color: var(--fg);
}
#csv-upload textarea:focus {
  outline: none;
  border-color: var(--accent);
}
#csv-upload select {
  font-family: var(--mono);
  font-size: 12px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: white;
  color: var(--fg);
  margin-top: 6px;
}
#csv-upload select:hover {
  border-color: var(--accent);
}
#audit-findings li.placeholder {
  border-left-color: #ccc;
  background: #f7f7f7;
  color: var(--fg-soft);
}
/* Toast for share-button feedback (PR6). Bottom-right, ~2.5s lifetime.
   `.flash-out` is set ~250ms before removal for the fade-out transition. */
.flash {
  position: fixed;
  right: 16px;
  bottom: 16px;
  padding: 10px 14px;
  background: var(--fg);
  color: white;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 100;
  opacity: 1;
  transition: opacity 0.25s ease-out, transform 0.25s ease-out;
}
.flash-err {
  background: var(--red);
}
.flash-out {
  opacity: 0;
  transform: translateY(8px);
}

@media (max-width: 1100px) {
  .playground {
    grid-template-columns: 1fr 1fr;
    height: auto;
  }
}
@media (max-width: 600px) {
  .playground {
    grid-template-columns: 1fr;
  }
}
