/* ============================================================
   Broker Genius — test-drive.css
   Converted from Claude Design "Test Drive"
   ============================================================ */

/* ---------- Hero ---------- */
.td-hero {
  border-bottom: 2px solid var(--ink);
  background: var(--ink);
  color: #fff;
  padding: 56px 28px;
}
.td-hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 40px;
  align-items: end;
}
.td-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font: 600 11.5px var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  padding: 7px 12px;
}
.td-hero__badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: bg-blink 1.8s ease-in-out infinite;
}
.td-hero__title {
  font-size: 68px;
  line-height: 0.92;
  letter-spacing: -0.05em;
  font-weight: 700;
  font-stretch: 94%;
  margin: 22px 0 0;
}
.td-hero__lede {
  font-size: 17px;
  line-height: 1.65;
  color: var(--sand-2);
  margin: 0;
  text-wrap: pretty;
}

/* ---------- Sandbox shell ---------- */
.td-sandbox { border-bottom: 2px solid var(--ink); background: var(--paper); }
.td-sandbox__inner {
  display: grid;
  grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
}

/* ---------- Tool rail ---------- */
.td-rail { border-right: 2px solid var(--ink); background: var(--tint); }
.td-rail__head {
  padding: 16px 22px;
  border-bottom: 2px solid var(--ink);
  font: 600 11px var(--font-mono);
  letter-spacing: 0.12em;
  color: var(--muted);
}
.td-tab {
  width: 100%;
  text-align: left;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 20px 22px;
  border: none;
  border-bottom: 1px solid var(--line);
  border-left: 6px solid transparent;
  background: transparent;
  cursor: pointer;
  font-family: var(--font-sans);
  color: var(--ink);
}
.td-tab:hover { background: var(--card); }
.td-tab.is-active { background: var(--card); border-left-color: var(--accent); }
.td-tab__n {
  font: 600 11px var(--font-mono);
  letter-spacing: 0.1em;
  color: var(--brown);
  padding-top: 3px;
}
.td-tab__body { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.td-tab__title { display: block; font-size: 17px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; }
.td-tab__sub { display: block; font-size: 13.5px; line-height: 1.5; color: var(--muted); margin-top: 4px; }

.td-rail__limits { padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.td-rail__limits-label {
  font: 600 10.5px var(--font-mono);
  letter-spacing: 0.11em;
  color: var(--muted-2);
}
.td-rail__limits-body { font-size: 13.5px; line-height: 1.55; color: var(--muted); }
.td-rail__limits-link {
  font: 600 11.5px var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: underline;
  color: var(--brown);
}

/* ---------- Stage ---------- */
.td-stage { background: var(--paper); padding: 34px 34px 44px; min-width: 0; }
.td-panel {
  border: 2px solid var(--ink);
  background: var(--card);
  box-shadow: 8px 8px 0 rgba(16, 22, 42, 0.10);
}
.td-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  border-bottom: 2px solid var(--ink);
  background: var(--ink);
  color: #fff;
}
.td-panel__label { font: 600 11px var(--font-mono); letter-spacing: 0.12em; }
.td-panel__state { font: 600 11px var(--font-mono); letter-spacing: 0.12em; color: var(--accent); }
.td-panel__body { padding: 28px 24px 30px; }

/* ---------- Panes ---------- */
.td-pane { display: none; }
.td-pane.is-active { display: block; }

.td-fields { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 16px; }
.td-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
/* Inputs and selects carry an intrinsic width that stops a grid track
   shrinking; these let the track win instead. */
.td-input, .td-select, .td-textarea { min-width: 0; max-width: 100%; }
.td-field__label {
  font: 600 10.5px var(--font-mono);
  letter-spacing: 0.11em;
  color: var(--muted-2);
}
.td-input,
.td-select {
  font: 400 15px var(--font-sans);
  color: var(--ink);
  padding: 13px;
  border: 2px solid var(--ink);
  background: var(--paper);
  outline: none;
  min-width: 0;
}
.td-input--mono { font: 500 15px var(--font-mono); letter-spacing: 0.06em; }
.td-input:focus,
.td-textarea:focus { background: var(--card); box-shadow: 3px 3px 0 var(--accent); }

.td-bulk__head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.td-bulk__shuffle {
  font: 600 10.5px var(--font-mono);
  letter-spacing: 0.1em;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--brown);
  text-decoration: underline;
}
.td-textarea {
  width: 100%;
  margin-top: 8px;
  font: 400 14px var(--font-mono);
  color: var(--ink);
  line-height: 1.6;
  padding: 14px;
  border: 2px solid var(--ink);
  background: var(--paper);
  outline: none;
  resize: vertical;
}

.td-drop-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.td-sample { border: 2px solid var(--ink); background: var(--paper); }
.td-sample__head {
  padding: 11px 14px;
  border-bottom: 2px solid var(--ink);
  font: 600 10.5px var(--font-mono);
  letter-spacing: 0.11em;
}
.td-sample__image {
  height: 190px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--tint);
  font: 600 11px var(--font-mono);
  letter-spacing: 0.1em;
  color: var(--sand);
}
.td-sample__doc {
  height: 190px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  background: var(--card);
}
.td-sample__line { height: 6px; background: var(--line); }
.td-sample__line--head { height: 9px; width: 45%; background: var(--ink); }
.td-sample__line--w80 { width: 80%; }
.td-sample__line--w70 { width: 70%; }
.td-sample__line--w88 { width: 88%; }
.td-sample__line--total { margin-top: auto; width: 35%; background: var(--accent); }

.td-drop {
  border: 2px dashed var(--ink);
  background: var(--card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
}
.td-drop__title { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.td-drop__hint { font-size: 13.5px; color: var(--muted); }
.td-drop__btn {
  font: 700 13px var(--font-sans);
  padding: 11px 20px;
  border: 2px solid var(--ink);
  background: var(--paper);
  box-shadow: 3px 3px 0 var(--ink);
  cursor: pointer;
}

/* ---------- Run row ---------- */
.td-runrow { display: flex; align-items: center; gap: 16px; margin-top: 22px; flex-wrap: wrap; }
.td-run {
  font: 700 15px var(--font-sans);
  padding: 14px 28px;
  border: 2px solid var(--ink);
  background: var(--accent);
  color: var(--ink);
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--ink);
}
.td-run:hover { box-shadow: 1px 1px 0 var(--ink); }
.td-run.is-complete { background: var(--card); }
.td-runrow__note {
  font: 500 12px var(--font-mono);
  letter-spacing: 0.06em;
  color: var(--muted-2);
}

/* ---------- Result ---------- */
.td-result { margin-top: 26px; border-top: 2px solid var(--ink); padding-top: 20px; }
.td-result__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.td-result__label { font: 600 11px var(--font-mono); letter-spacing: 0.12em; }
.td-result__meta { font: 600 11px var(--font-mono); letter-spacing: 0.12em; color: var(--brown); }
.td-result__cells {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 2px solid var(--ink);
  background: var(--paper);
}
.td-cell { padding: 16px 14px; border-right: 1px solid var(--line); }
.td-cell__k { font: 600 10px var(--font-mono); letter-spacing: 0.12em; color: var(--muted-2); }
.td-cell__v { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; margin-top: 7px; }
.td-cell__v.is-empty { color: var(--sand-2); }
.td-cell__v.is-accent { color: var(--brown); }
.td-result__note { font-size: 14px; line-height: 1.6; color: var(--muted); margin: 14px 0 0; }

/* ---------- Follow-on cards ---------- */
.td-cards { margin-top: 24px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.td-card { border: 2px solid var(--ink); background: var(--card); padding: 24px; }
.td-card--dark { background: var(--ink); color: #fff; }
.td-card__tag { font: 600 10.5px var(--font-mono); letter-spacing: 0.12em; color: var(--brown); }
.td-card__tag--accent { color: var(--accent); }
.td-card__title { font-size: 21px; font-weight: 700; letter-spacing: -0.03em; margin-top: 9px; }
.td-card__body { font-size: 14px; line-height: 1.6; color: var(--muted); margin: 8px 0 16px; }
.td-card__body--dark { color: var(--sand-2); }
.td-card__cta {
  font: 700 13px var(--font-sans);
  padding: 11px 20px;
  border: 2px solid var(--ink);
  background: var(--accent);
  box-shadow: 3px 3px 0 var(--ink);
  display: inline-block;
}
.td-card__cta:hover { color: var(--ink); box-shadow: 1px 1px 0 var(--ink); }
.td-card__cta--ghost {
  border-color: var(--accent);
  background: transparent;
  color: var(--accent);
  box-shadow: none;
}
.td-card__cta--ghost:hover { background: var(--accent); color: var(--ink); box-shadow: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .td-hero__inner { grid-template-columns: 1fr; gap: 24px; align-items: start; }
  .td-hero__title { font-size: 52px; }
  .td-sandbox__inner { grid-template-columns: 1fr; }
  .td-rail { border-right: none; border-bottom: 2px solid var(--ink); }
  .td-stage { padding: 28px 24px 36px; }
  .td-result__cells { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .td-cell:nth-child(2n) { border-right: none; }
  .td-cell:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .td-cards { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .td-hero { padding: 44px 20px; }
  .td-hero__title { font-size: 40px; }
  .td-stage { padding: 22px 18px 30px; }
  .td-panel__body { padding: 22px 16px 24px; }
  .td-fields { grid-template-columns: minmax(0, 1fr); }
  .td-drop-grid { grid-template-columns: 1fr; }
  .td-result__cells { grid-template-columns: 1fr; }
  .td-cell { border-right: none; border-bottom: 1px solid var(--line); }
  .td-cell:last-child { border-bottom: none; }
  .td-bulk__head { flex-wrap: wrap; gap: 8px; }
}

/* ============================================================
   Live demo additions
   ============================================================
   The sandbox on /tryitout posts to the real endpoints, so it
   needs a few things the static design did not: per-pane result
   areas that receive injected HTML, drop-area upload state, and
   the PDF preview. Hooks named tryitout-* are the ones
   tryscript.js binds to and must keep their names.
   ============================================================ */

/* Only the selected tool is on screen. */
.td-pane { display: none; }
.td-pane.is-active { display: block; }

/* Injected results — markup comes from the endpoints, so this
   styles by element rather than by class. */
.td-result:empty { display: none; }
.td-result {
  margin-top: 18px;
  border: 2px solid var(--ink);
  background: var(--card);
  padding: 18px 20px;
  font-size: 15px;
  line-height: 1.65;
  overflow-x: auto;
}
.td-result p { margin: 0 0 10px; }
.td-result p:last-child { margin-bottom: 0; }
.td-result table { width: 100%; border-collapse: collapse; font-size: 14px; }
.td-result th {
  font: 600 10.5px var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: left;
  background: var(--ink);
  color: #fff;
  padding: 10px 12px;
}
.td-result td { padding: 9px 12px; border-top: 1px solid var(--line); vertical-align: top; }
.td-result pre {
  margin: 8px 0 0;
  padding: 14px 16px;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: var(--line-soft);
  font: 500 12.5px/1.6 var(--font-mono);
  overflow-x: auto;
}
.td-result img { max-width: 100%; height: auto; border: 2px solid var(--ink); }

/* The endpoints inject a FontAwesome spinner; the theme does not
   load FontAwesome, so give it a shape of its own. */
.td-result .fa-spinner,
.td-result .fa-spin {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 2px solid var(--sand);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: td-spin 0.7s linear infinite;
  vertical-align: -2px;
}
@keyframes td-spin { to { transform: rotate(360deg); } }

/* Upload area. The file input is driven by the Choose file button. */
.tryitout-file-input { display: none; }
.td-drop.highlight { background: #FFF8E4; border-style: solid; }
.tryitout-drop-icon { color: var(--sand); margin-bottom: 8px; }
.tryitout-preview-image {
  display: none;
  max-width: 100%;
  max-height: 170px;
  margin-top: 12px;
  border: 2px solid var(--ink);
}
.tryitout-pdf-preview {
  display: none;
  align-items: center;
  gap: 9px;
  margin-top: 12px;
  font: 500 13px var(--font-mono);
  color: var(--ink);
}
.tryitout-pdf-badge {
  background: var(--ink);
  color: #fff;
  font: 600 10.5px var(--font-mono);
  letter-spacing: 0.08em;
  padding: 3px 7px;
}

/* Clickable sample thumbnails. */
.tryitout-image-container { border: 2px solid var(--ink); background: var(--card); overflow: hidden; }
.tryitout-image-container img { display: block; width: 100%; height: auto; cursor: pointer; }
.tryitout-image-container img:hover { opacity: 0.88; }
