/* Try-it page (doc 03 §7). Uses the site's custom properties from ../styles.css. */
:root { --tok-attr: #d9a5b3; }

.try { max-width: 1400px; margin: 0 auto; padding: 24px; }
.try__intro { color: var(--text-secondary); margin: 0 0 16px; }
.try__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; height: calc(100vh - 220px); min-height: 480px; }
.try__grid > * { min-width: 0; }

.pane { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--panel-border); border-radius: 10px; background: var(--panel-bg); overflow: hidden; }

.tb { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--panel-border); position: sticky; top: 0; background: var(--panel-bg); z-index: 5; }
.tb__label { color: var(--text-muted); font-size: 0.8rem; }
.tb select { background: var(--code-bg); color: var(--text-primary); border: 1px solid var(--panel-border); border-radius: 6px; padding: 5px 8px; font: inherit; font-size: 0.85rem; max-width: 100%; }
.tb__blurb { color: var(--text-secondary); font-size: 0.8rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb__spacer { flex: 1; }

.btn { font-family: var(--font-display); font-size: 0.8rem; font-weight: 600; letter-spacing: 0.04em; padding: 6px 14px; border-radius: 6px; border: 1px solid var(--accent-dim); cursor: pointer; background: transparent; color: var(--accent); }
.btn:hover:not(:disabled) { color: var(--accent-strong); border-color: var(--accent); }
.btn--ghost { background: transparent; }
.btn--primary { background: var(--accent); color: var(--bg-edge); border-color: var(--accent); }
.btn--primary:hover:not(:disabled) { color: var(--bg-edge); background: var(--accent-strong); }
.btn:disabled { opacity: .5; cursor: default; }
.btn:focus-visible, .tb select:focus-visible, .con__loc:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

#editor, .cm-editor { flex: 1; min-height: 0; }
.cm-scroller { overflow: auto; }

.con { flex: 1; margin: 0; padding: 12px 14px; overflow: auto; font: 0.82rem/1.55 var(--font-mono); color: var(--text-primary); white-space: pre-wrap; word-break: break-word; min-height: 0; }
.con__cmd { color: var(--accent); }
.con__err { color: #e6a0a0; }
.con__sys { color: var(--text-muted); font-style: italic; }
.con__sys--err { color: #e6a0a0; }
.con__loc { all: unset; cursor: pointer; text-decoration: underline dotted; }

.con__stdin summary { padding: 8px 12px; border-top: 1px solid var(--panel-border); color: var(--text-secondary); cursor: pointer; }
.con__stdin textarea { display: block; width: 100%; border: 0; background: var(--code-bg); color: var(--text-primary); font: inherit; padding: 10px 12px; resize: vertical; }

#version { overflow-wrap: anywhere; }

/* Stacked layout: the toolbar stays pinned under the sticky site header so Run is always
   reachable. `display: contents` lifts the toolbar out of the clipped editor pane so its
   sticky containing block is the whole grid. */
@media (max-width: 900px) {
  .try { padding: 16px; }
  .try__grid { grid-template-columns: 1fr; height: auto; min-height: 0; gap: 0 16px; row-gap: 16px; }
  .pane--editor { display: contents; }
  .tb { flex-wrap: wrap; top: 58px; border: 1px solid var(--panel-border); border-radius: 10px 10px 0 0; margin-bottom: -16px; }
  .tb__blurb { order: 10; flex: 1 1 100%; white-space: normal; }
  #editor { height: 45vh; border: 1px solid var(--panel-border); border-top: 0; border-radius: 0 0 10px 10px; overflow: hidden; margin-bottom: 0; }
  .pane--console { height: 35vh; }
}
@media (max-width: 600px) {
  .try { padding: 12px; }
  .tb { top: 54px; gap: 8px; }
  .tb__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }   /* label stays for screen readers */
  .tb select { min-width: 0; flex: 0 1 auto; }
}
