/* RailingLab web form (spec 005 N-522): colours from the RailingLab landing page */
:root {
  --bg: #0b0c0e;
  --panel: #131519;
  --line: #262a31;
  --field: #1b2029;
  --field-line: #2a3140;
  --text: #e8ebf2;
  --muted: #8b94a7;
  --label: #6f7a8f;
  --blue: #1f6bff;
  --blue-2: #3d8bff;
  --blue-3: #8fb8ff;
  --stair: #232a37;
  --stair-line: #5b667c;
  --ok-bg: #0f2a1c; --ok-line: #1f7a46; --ok: #7fe0a7; --ok-dot: #29c46b;
  --warn-bg: #2a230f; --warn-line: #7a641f; --warn: #f2d27a; --warn-dot: #e5b532;
  --conf-bg: #2d1c0e; --conf-line: #8a4f1c; --conf: #ffb27a; --conf-dot: #ff8a3d;
  --err-bg: #2d1012; --err-line: #8a2a30; --err: #ff9aa0; --err-dot: #ff4d57;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased; }

.top { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 18px;
  border-bottom: 1px solid var(--line); background: #0e1117; }
.brand { font-weight: 700; letter-spacing: -0.01em; }
.crumb { color: var(--muted); }
.example { font-size: 12px; color: var(--blue-3); border: 1px solid #2c5fb8; border-radius: 999px;
  padding: 1px 10px; }
.spacer { flex: 1; }
.version { color: var(--label); font-size: 12px; }

.layout { display: grid; grid-template-columns: 290px 1fr; height: calc(100% - 52px); }
.panel { background: var(--panel); border-right: 1px solid var(--line); overflow-y: auto;
  padding: 14px 16px 40px; }
.group { border-bottom: 1px solid var(--line); padding: 8px 0 12px; }
.group > summary { cursor: pointer; font-weight: 600; font-size: 15px; padding: 4px 0 6px;
  list-style: none; display: flex; justify-content: space-between; }
.group > summary::after { content: "+"; color: var(--label); }
.group[open] > summary::after { content: "–"; }
.group > summary::-webkit-details-marker { display: none; }
.field { display: block; margin: 6px 0 0; }
.field > span { display: block; color: var(--label); font-size: 12px; margin-bottom: 2px; }
.field input, .field select { width: 100%; height: 30px; padding: 0 9px; border-radius: 6px;
  border: 1px solid var(--field-line); background: var(--field); color: #c9d0dd;
  font: inherit; font-size: 13px; }
.field input::placeholder { color: #566074; font-style: italic; }
.field input:focus, .field select:focus { outline: none; border-color: var(--blue); }
.field.bad input, .field.bad select { border-color: var(--err-dot); }
.field .hint { display: block; color: var(--err); font-size: 11.5px; margin-top: 2px; }

.stage { display: flex; flex-direction: column; min-width: 0; padding: 16px 18px; gap: 12px;
  overflow-y: auto; }
.view { position: relative; flex: 1; min-height: 380px; border: 1px solid var(--line);
  border-radius: 12px; overflow: hidden; background-color: #0e1117;
  background-image: linear-gradient(#1d2430 1px, transparent 1px),
    linear-gradient(90deg, #1d2430 1px, transparent 1px);
  background-size: 24px 24px; }
#drawing { position: absolute; inset: 0; width: 100%; height: 100%; }
.placeholder { position: absolute; inset: 0; display: grid; place-items: center; margin: 0;
  color: var(--muted); }
.badges { position: absolute; top: 14px; left: 14px; z-index: 2; display: flex;
  flex-direction: column; gap: 8px; align-items: flex-start; }
.badge { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 14px 0 10px;
  border-radius: 999px; font-weight: 600; font-size: 13px; border: 1px solid; }
.badge i { width: 13px; height: 13px; border-radius: 50%; display: inline-block; }
.badge.ok { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok); }
.badge.ok i { background: var(--ok-dot); }
.badge.warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }
.badge.warn i { background: var(--warn-dot); }
.badge.conf { background: var(--conf-bg); border-color: var(--conf-line); color: var(--conf); }
.badge.conf i { background: var(--conf-dot); }
.badge.err { background: var(--err-bg); border-color: var(--err-line); color: var(--err); }
.badge.err i { background: var(--err-dot); }
.badge.wait { background: #161a22; border-color: var(--field-line); color: var(--muted); }
.badge.wait i { background: var(--label); }
.badge button { margin-left: 6px; background: none; border: 1px solid currentColor; color: inherit;
  border-radius: 999px; font: inherit; font-size: 12px; padding: 1px 9px; cursor: pointer; }
.messages { position: absolute; top: 14px; right: 14px; z-index: 2; margin: 0; padding: 0;
  list-style: none; max-width: min(420px, 55%); display: flex; flex-direction: column; gap: 6px; }
.messages li { background: rgba(19, 21, 25, .94); border: 1px solid var(--line);
  border-left: 3px solid var(--err-dot); border-radius: 8px; padding: 7px 10px; font-size: 12.5px; }
.messages li.warn { border-left-color: var(--warn-dot); }
.messages li.conf { border-left-color: var(--conf-dot); }
.messages b { font-weight: 600; }
.messages small { display: block; color: var(--muted); }

.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px;
  margin: 0; }
.summary div { background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 12px; }
.summary dt { color: var(--label); font-size: 12px; }
.summary dd { margin: 0; font-weight: 600; font-size: 16px; }
.summary .files { grid-column: span 2; }
.summary .files dd { font-weight: 400; font-size: 12.5px; color: #c9d0dd; word-break: break-word; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; height: 40px;
  padding: 0 20px; border-radius: 999px; font: inherit; font-weight: 600; font-size: 14px;
  border: 1.5px solid transparent; cursor: pointer; white-space: nowrap; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #0f57e6; }
.btn-primary:disabled { background: #22324f; color: #6f7a8f; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--field-line); }
.btn-ghost:hover { border-color: var(--muted); }
.preview-note { color: var(--muted); font-size: 12.5px; }
.action-msg { margin: 0; min-height: 1.2em; color: var(--err); font-size: 13px; }
.action-msg.info { color: var(--muted); }

@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; height: auto; }
  .panel { border-right: 0; border-bottom: 1px solid var(--line); overflow: visible; }
  .stage { padding: 14px 16px; overflow: visible; }
  .view { min-height: 300px; }
  .messages { position: static; max-width: none; margin: 56px 12px 0; }
  .version, .crumb { display: none; }
}
