/* Live Playground (/try/) — extends /site.css */

.try-shell {
  padding: 28px 0 56px;
}

.try-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 20px;
}
.try-top h1 {
  font-size: clamp(1.55rem, 2.5vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 6px;
}
.try-top p { color: var(--ink-2); font-size: 0.94rem; max-width: 64ch; }

.try-dataset-switch {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.try-layout {
  display: grid;
  grid-template-columns: 19.5rem minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.try-rail {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.try-rail h2 { font-size: 0.94rem; font-weight: 650; }
.try-rail-sub { font-size: 0.8rem; color: var(--ink-3); margin-top: -6px; }

.try-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.try-preset-btn {
  font-family: var(--sans);
  font-size: 0.74rem;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  color: var(--ink-2);
  cursor: pointer;
}
.try-preset-btn:hover { border-color: var(--border-strong); color: var(--ink); }
.try-preset-btn.active { background: var(--ink); color: #fff; border-color: var(--ink); }

.try-rule-list { display: flex; flex-direction: column; }
.try-rule {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 2px 10px;
  padding: 9px 0;
  border-top: 1px solid var(--border);
}
.try-rule label { font-size: 0.84rem; font-weight: 500; color: var(--ink); }
.try-rule-help { grid-column: 1 / -1; font-size: 0.75rem; color: var(--ink-3); line-height: 1.35; }
.try-rule-inp {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  color: var(--ink-3);
}
.try-rule-inp input,
.try-select {
  font-family: var(--sans);
  font-size: 0.84rem;
  padding: 5px 7px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.try-rule-inp input { width: 4rem; text-align: right; }
.try-rule.is-off label { color: var(--ink-3); }

.try-budget-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 0.84rem;
  font-weight: 500;
}

.try-turnstile-wrap {
  padding-top: 8px;
  border-top: 1px solid var(--border);
  min-height: 68px;
}

.try-rail-actions { display: flex; gap: 8px; }
.try-rail-actions .btn { flex: 1; }
.try-rail-foot { font-size: 0.76rem; color: var(--ink-3); line-height: 1.45; }

.try-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.try-banner {
  border-radius: var(--radius-md);
  padding: 12px 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.88rem;
}
.try-banner-warn { border-color: var(--amber-border); background: var(--amber-bg); color: #78350f; }
.try-banner-err { border-color: var(--red-border); background: var(--red-bg); color: var(--red); }
.try-banner-info { border-color: var(--accent-border); background: var(--accent-soft); color: #1e3a8a; }
.try-banner pre { margin-top: 6px; font-family: var(--sans); white-space: pre-line; font-size: 0.84rem; }

.try-progress {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 0.84rem;
  color: var(--ink-2);
}
.try-progress-track { height: 5px; background: var(--surface-muted); border-radius: 999px; overflow: hidden; }
.try-progress-fill { height: 100%; background: var(--accent); width: 0%; transition: width 0.5s linear; }

/* Option cards */
.try-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 10px;
}
.try-opt {
  text-align: left;
  font-family: var(--sans);
  padding: 13px 15px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--ink);
  transition: border-color 0.12s ease;
}
.try-opt:hover { border-color: var(--border-strong); }
.try-opt.selected { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.try-opt-title { font-size: 0.95rem; font-weight: 650; }
.try-opt-note { font-size: 0.78rem; color: var(--ink-3); min-height: 1.3em; }
.try-opt-facts {
  margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 2px;
  font-size: 0.82rem; font-variant-numeric: tabular-nums;
}
.try-opt-facts b { font-weight: 650; }
.try-opt-short b { color: var(--red); }

/* Rota panel */
.try-rota-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}
.try-rota-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
}
.try-rota-head h2 { font-size: 1.05rem; font-weight: 650; }
.try-rota-head p { font-size: 0.84rem; color: var(--ink-3); margin-top: 2px; }

.try-impact {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 18px;
  padding: 10px 16px;
  background: #fafbfc;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}
.try-impact-item { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.try-impact-lbl { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-3); }
.try-impact-val { font-size: 0.96rem; font-weight: 650; color: var(--ink); }
.try-impact-val.ok { color: var(--green); }
.try-impact-val.short { color: var(--red); }
.try-impact-sub { font-size: 0.76rem; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.try-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  padding: 10px 16px;
  font-size: 0.78rem;
  color: var(--ink-3);
  border-bottom: 1px solid var(--border);
}
.try-legend-item { display: inline-flex; align-items: center; gap: 5px; }
.try-swatch { width: 13px; height: 13px; border-radius: 3px; display: inline-block; }
.sw-t0 { background: #e7effd; border-left: 3px solid #3b76e8; }
.sw-t1 { background: #fbf0d6; border-left: 3px solid #d79a1d; }
.sw-t2 { background: #e2f3e9; border-left: 3px solid #35a06a; }
.sw-held { background: #fff; border: 1.5px solid #667085; }
.sw-before { background: transparent; border: 1px dashed #98a2b3; }
.sw-away { background: repeating-linear-gradient(135deg, #e3e6ea 0 3px, #f3f4f6 3px 6px); }
.sw-req { width: 9px; height: 9px; border-radius: 50%; border: 2px solid #8a94a3; }

/* Grid table */
.try-scroll { overflow-x: auto; }
.try-grid {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  font-size: 0.77rem;
  font-variant-numeric: tabular-nums;
}
.try-grid th, .try-grid td { border-bottom: 1px solid var(--border); }
.try-grid thead th {
  padding: 7px 2px 6px;
  min-width: 3.1rem;
  text-align: center;
  font-weight: 500;
  color: var(--ink-3);
  background: var(--surface);
}
.try-dow { display: block; font-size: 0.68rem; }
.try-dom { display: block; color: var(--ink); font-weight: 600; }
.try-grid td { height: 2.35rem; padding: 2px; text-align: center; vertical-align: middle; }
.try-who {
  position: sticky; left: 0; z-index: 1;
  min-width: 13.5rem; padding: 4px 10px 4px 14px;
  text-align: left; background: var(--surface);
  border-right: 1px solid var(--border);
}
.try-who-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.try-name { display: block; font-weight: 600; color: var(--ink); white-space: nowrap; }
.try-roles { display: block; font-size: 0.7rem; color: var(--ink-3); font-weight: 400; }
.try-load { flex: none; width: 4.9rem; text-align: right; white-space: nowrap; font-weight: 400; }
.try-load b { font-weight: 600; color: var(--ink); }
.try-load-pct { color: var(--ink-3); margin-left: 4px; font-size: 0.71rem; }
.try-load-bar { display: block; height: 3px; margin-top: 3px; background: var(--border); border-radius: 2px; }
.try-load-bar span { display: block; height: 100%; margin-left: auto; background: #8a94a3; border-radius: 2px; }

.try-grid .col-wk { border-left: 1px solid var(--border); }
.try-grid .col-we { background: #f4f5f8; }
.try-grid .col-pre { background: #fafafa; }
.try-grid thead .col-pre .try-dom { color: var(--ink-3); font-weight: 400; }
.try-grid .col-start { border-left: 2px solid var(--ink); }
.try-grid .cell-away { background: repeating-linear-gradient(135deg, #eceef1 0 4px, #f7f8f9 4px 8px); color: var(--ink-3); font-size: 0.68rem; }
.try-grid tfoot th, .try-grid tfoot td { border-bottom: 0; height: 2.1rem; }

.try-chip {
  display: flex; align-items: center; justify-content: center; gap: 2px;
  width: 100%; min-height: 1.75rem; padding: 0 2px;
  border-radius: 5px; border: 0; border-left: 3px solid var(--edge);
  background: var(--tint); color: var(--ink-c);
  font-family: var(--sans); font-size: 0.72rem; font-weight: 600;
  white-space: nowrap; position: relative;
}
button.try-chip { cursor: pointer; }
button.try-chip:hover { box-shadow: inset 0 0 0 1.5px var(--edge); }
.try-chip.picked { box-shadow: inset 0 0 0 2px var(--edge), 0 0 0 2px #fff, 0 0 0 4px var(--edge); }
.try-chip.chip-held { background: #fff; border: 1.5px solid var(--edge); border-left-width: 3px; }
.try-chip.chip-before { background: transparent; border: 1px dashed #c3c9d1; color: var(--ink-3); font-weight: 500; }
.try-chip.chip-new { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--edge); }
.try-chip.chip-gone { background: transparent; border: 1px dashed var(--edge); color: var(--ink-3); text-decoration: line-through; font-weight: 500; }

.tone-0 { --tint: #e7effd; --edge: #3b76e8; --ink-c: #1d4fb8; }
.tone-1 { --tint: #fbf0d6; --edge: #d79a1d; --ink-c: #7a5000; }
.tone-2 { --tint: #e2f3e9; --edge: #35a06a; --ink-c: #1c6540; }

.try-ask-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; border: 2px solid #8a94a3; }
.try-ask-unmet { position: absolute; top: -3px; right: -3px; background: #e5a00d; border-color: #fff; }
.try-open-pill {
  display: inline-block; min-width: 1.4rem; padding: 1px 5px; border-radius: 999px;
  background: #fbe9ea; color: var(--red); font-weight: 650; font-size: 0.72rem;
}

/* Live swap & sick-call interactive panels */
.try-live-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}
.try-tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.try-tool-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.try-tool-head h3 { font-size: 0.95rem; font-weight: 650; }
.try-replan-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.try-field { display: flex; flex-direction: column; gap: 2px; font-size: 0.75rem; color: var(--ink-3); }

.try-json-details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
}
.try-json-details summary { cursor: pointer; font-size: 0.86rem; font-weight: 600; color: var(--ink-2); }
.try-json-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.try-json-grid pre { max-height: 260px; overflow: auto; font-size: 0.74rem; }

@media (max-width: 980px) {
  .try-layout, .try-live-tools, .try-json-grid { grid-template-columns: minmax(0, 1fr); }
  .try-impact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .try-impact { grid-template-columns: minmax(0, 1fr); }
}
