#talkTracks {
  display: grid;
  gap: 24px;
  padding-bottom: 60px;
}
#talkTracks [hidden] {
  display: none !important;
}
.tt-sort-row { display: grid; grid-template-columns: 22px minmax(0,1fr); gap: 4px; align-items: center; }
.tt-drag-handle { display: inline-flex; align-items: center; justify-content: center; width: 22px; min-height: 36px; color: #8194ac; cursor: grab; user-select: none; }
.tt-drag-handle:hover { color: #e8be58; }
.tt-drag-handle:active { cursor: grabbing; }
.tt-drag-handle svg { pointer-events: none; }
.tt-sort-row,.tt-response-edit { position: relative; transition: opacity .15s, background .15s; }
.tt-dragging { opacity: .4; }
.tt-drop-before::before,.tt-drop-after::after { content:""; position:absolute; left:0; right:0; height:4px; border-radius:4px; background:#f3cb67; box-shadow:0 0 12px #f3cb6766; pointer-events:none; z-index:2; }
.tt-drop-before::before { top:-5px; }
.tt-drop-after::after { bottom:-5px; }
.tt-folder { border:1px solid #344258; border-radius:12px; overflow:visible; }
.tt-folder-heading { display:flex; flex-wrap:wrap; align-items:center; gap:4px; padding:8px; border-radius:12px; }
.tt-folder-heading button:first-child { flex:1; min-width:100px; font-weight:600; }
.tt-folder-heading button:not(:first-child) { padding:4px 6px; font-size:11px; color:#aabbd0; }
.tt-folder-content { display:grid; gap:10px; padding:10px 6px; min-height:48px; border-radius:8px; }
.tt-folder-empty { font-size:12px; color:#8fa7bd; text-align:center; margin:8px; }
.tt-drop-folder { background:#e8be5822; outline:2px dashed #e8be58; outline-offset:-2px; }
.tt-header,
.tt-controls,
.tt-footer {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.tt-header {
  justify-content: space-between;
  padding: 32px;
}
.tt-header h1 {
  font-size: clamp(36px, 5vw, 60px);
}
.tt-controls {
  padding: 24px;
}
.tt-import-button {
  border-color: #b9943e;
  color: #ffe09a;
  background: #302a1b;
}
.tt-importer {
  padding: clamp(24px, 4vw, 38px);
  border-top: 3px solid #e8be58;
}
.tt-import-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}
.tt-import-heading h2 { margin-bottom: 8px; }
.tt-import-heading p:last-child { color: #aabbd0; max-width: 760px; }
.tt-import-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 26px;
}
.tt-import-file {
  grid-column: 1 / -1;
  border: 1px dashed #52647d;
  border-radius: 14px;
  padding: 18px;
  background: #0c1623;
}
.tt-import-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 26px;
}
.tt-import-summary div {
  display: grid;
  gap: 4px;
  padding: 18px;
  border: 1px solid #344258;
  border-radius: 14px;
  background: #0e1926;
}
.tt-import-summary strong { color: #f4d276; font-size: 30px; }
.tt-import-summary span { color: #9eb0c7; }
.tt-import-ready,
.tt-import-issues {
  margin-top: 16px;
  padding: 18px;
  border-radius: 14px;
  border: 1px solid #315d52;
  background: #102720;
  color: #c9eee1;
}
.tt-import-ready { display: flex; flex-wrap: wrap; gap: 10px; }
.tt-import-issues { border-color: #64552f; background: #2a2415; color: #f3dda4; }
.tt-import-issues.is-error { border-color: #783f49; background: #2b171c; color: #ffd0d7; }
.tt-import-issues h3 { margin-bottom: 8px; }
.tt-import-issues ul { margin: 0; padding-left: 22px; max-height: 240px; overflow: auto; }
.tt-controls label {
  flex: 1;
  min-width: 200px;
}
#talkTracks label {
  display: grid;
  gap: 8px;
  color: #b8c6db;
}
#talkTracks input,
#talkTracks select,
#talkTracks textarea {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.tt-modes {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.tt-modes button,
.tt-index button,
.tt-edit-fields > button,
.tt-response-edit button {
  background: #111d2b;
  border: 1px solid #344258;
  border-radius: 12px;
  color: #dce7f5;
  padding: 12px 18px;
  cursor: pointer;
}
.tt-modes .is-active,
.tt-index [aria-current] {
  border-color: #e8be58;
  background: #342f20;
  color: #ffe09a;
}
.tt-muted {
  color: #aabbd0;
  line-height: 1.7;
}
.tt-tag {
  display: inline-block;
  font-size: 12px;
  color: #ead18c;
  border: 1px solid #5d5031;
  border-radius: 8px;
  padding: 4px 8px;
  margin: 10px 0;
}
.tt-delete-track {
  align-self: center;
  border: 1px solid #74434a;
  border-radius: 10px;
  background: #21161b;
  color: #e8aeb7;
  padding: 9px 13px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.tt-delete-track:hover { background: #321c23; color: #ffd2d8; }
.tt-overview-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  margin-bottom: 18px;
}
.tt-overview-heading p { margin: 0; }
.tt-overview-hint { color: #71859e; font-size: 13px; }
.tt-flow-legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.tt-flow-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border: 1px solid #314156;
  border-radius: 999px;
  color: #aebdd0;
  font-size: 12px;
}
.tt-flow-legend span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #56a6c9; }
.tt-flow-legend [data-kind="start"]::before { background: #e8be58; }
.tt-flow-legend [data-kind="end"]::before { background: #70b99f; }
.tt-flowchart {
  position: relative;
  overflow: hidden;
  border: 1px solid #243349;
  border-radius: 22px;
  background:
    radial-gradient(circle at 15% 10%, rgba(52, 117, 147, .15), transparent 28%),
    linear-gradient(rgba(78, 102, 132, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(78, 102, 132, .055) 1px, transparent 1px),
    #09111d;
  background-size: auto, 28px 28px, 28px 28px, auto;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
}
.tt-flowchart-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 28px 30px 42px;
  scrollbar-gutter: stable;
}
.tt-flowchart-canvas {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: repeat(var(--tt-flow-columns), 270px);
  align-items: start;
  gap: 110px;
  width: max-content;
  min-width: 100%;
  min-height: 350px;
  padding-bottom: 72px;
}
.tt-flow-lines {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: visible;
  pointer-events: none;
}
.tt-flow-lines path {
  fill: none;
  stroke: #4f89a8;
  stroke-width: 2;
  opacity: .78;
  vector-effect: non-scaling-stroke;
}
.tt-flow-lines path.is-return { stroke: #a98845; stroke-dasharray: 7 6; opacity: .62; }
.tt-flow-lines marker path { fill: #72b6d6; stroke: none; opacity: 1; }
.tt-flow-level { display: grid; align-content: start; gap: 30px; min-width: 0; }
.tt-flow-level-label {
  color: #6f849d;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  padding-left: 4px;
}
.tt-flow-node {
  position: relative;
  display: grid;
  gap: 14px;
  min-height: 165px;
  padding: 18px;
  border: 1px solid #36536d;
  border-radius: 16px;
  background: linear-gradient(155deg, #142538, #0c1725 78%);
  box-shadow: 0 14px 35px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255,255,255,.035);
}
.tt-flow-node[data-kind="start"] { border-color: #a98845; background: linear-gradient(155deg, #2a261b, #151a22 78%); }
.tt-flow-node[data-kind="end"] { border-color: #36715f; background: linear-gradient(155deg, #132b29, #0c191e 78%); }
.tt-flow-node::before,
.tt-flow-node::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 9px;
  height: 9px;
  margin-top: -5px;
  border: 2px solid #6eb0d0;
  border-radius: 50%;
  background: #09111d;
}
.tt-flow-node::before { left: -6px; }
.tt-flow-node::after { right: -6px; }
.tt-flow-level:first-of-type .tt-flow-node::before,
.tt-flow-level:last-of-type .tt-flow-node::after { display: none; }
.tt-flow-node-top { display: flex; justify-content: space-between; gap: 12px; color: #78bad8; font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.tt-flow-node[data-kind="start"] .tt-flow-node-top { color: #e8c66d; }
.tt-flow-node[data-kind="end"] .tt-flow-node-top { color: #84cdb4; }
.tt-flow-node-title {
  width: fit-content;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: #f1f5ff;
  font: inherit;
  font-size: 19px;
  font-weight: 750;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
}
.tt-flow-node-title:hover { color: #8ed5f3; text-decoration: underline; text-underline-offset: 4px; }
.tt-flow-node > p { margin: 0; color: #9aabc0; font-size: 13px; line-height: 1.55; }
.tt-flow-ports { display: grid; gap: 7px; margin-top: auto; }
.tt-flow-ports button {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid #2f4961;
  border-radius: 9px;
  background: #102033;
  color: #b9dbec;
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}
.tt-flow-ports button:hover { border-color: #5f9dbc; background: #162c42; }
.tt-flow-end-label { margin-top: auto; color: #83c5ae; font-size: 12px; font-weight: 700; }
.tt-script-layout,
.tt-editor-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 24px;
}
.tt-script-layout:has(> :only-child) {
  grid-template-columns: minmax(0, 1fr);
}
.tt-index {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  align-self: start;
}
.tt-index button {
  text-align: left;
}
.tt-script {
  padding: clamp(24px, 4vw, 48px);
}
.tt-live-layout {
  align-items: start;
}
.tt-live-script {
  width: 100%;
  height: 820px;
  min-height: 0;
  padding: 64px clamp(28px, 4vw, 48px) 28px;
  display: grid;
  grid-template-rows: 300px 330px 52px;
  row-gap: 20px;
  box-sizing: border-box;
  overflow: hidden;
  overflow-anchor: none;
}
.tt-live-script .tt-script-zone {
  min-height: 0;
  display: grid;
  grid-template-rows: 22px 18px minmax(0, 1fr);
  row-gap: 12px;
  overflow: hidden;
}
.tt-live-script .tt-script-zone > .eyebrow,
.tt-live-script .tt-script-zone > .tt-label {
  margin: 0;
}
.tt-live-script .tt-say {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px 14px 8px 0;
  scrollbar-gutter: stable;
}
.tt-live-script .tt-response-zone {
  min-height: 0;
  min-width: 0;
  display: grid;
  grid-template-rows: 18px minmax(0, 1fr);
  row-gap: 12px;
  overflow: hidden;
}
.tt-live-script .tt-response-zone > .tt-label {
  margin: 0;
}
.tt-live-script .tt-responses {
  min-height: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 86px;
  align-content: start;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 10px;
  scrollbar-gutter: stable;
}
.tt-live-script .tt-responses button {
  height: 86px;
  min-height: 0;
  align-content: center;
  overflow: hidden;
}
.tt-live-script > .tt-footer {
  height: 52px;
  min-height: 0;
  margin: 0;
  align-items: center;
}
.tt-label {
  color: #e8be58;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  font-weight: 700;
  margin: 24px 0 12px;
}
.tt-say {
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #f0f5ff;
  max-width: 1000px;
}
.tt-internal {
  background: #192531;
  border-left: 3px solid #8498ac;
  border-radius: 8px;
  margin: 28px 0;
  padding: 20px;
  color: #b1c1d0;
  white-space: pre-wrap;
}
.tt-responses {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}
.tt-responses button {
  padding: 22px;
  text-align: left;
  background: #163347;
  border: 1px solid #38748b;
  border-radius: 14px;
  color: #e0f7ff;
  font-size: 19px;
  cursor: pointer;
  display: grid;
  gap: 12px;
}
.tt-responses span {
  font-size: 15px;
  line-height: 1.6;
  font-weight: 400;
  white-space: pre-wrap;
}
.tt-responses button:hover,
.tt-branches button:hover {
  background: #244659;
}
.tt-footer {
  margin-top: 28px;
}
.tt-track-title {
  margin-bottom: 20px;
}
.tt-source-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
  padding: 18px 22px;
  border-color: #3c5267;
}
.tt-source-file > div { display: grid; gap: 5px; min-width: 0; }
.tt-source-file-label {
  color: #9bb4c9;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.tt-source-file strong { overflow-wrap: anywhere; color: #edf4ff; }
.tt-source-file button { flex: none; }
.tt-empty,
#ttEditor {
  padding: 32px;
}
.tt-editor-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 24px 0;
}
#talkTracks .tt-check {
  display: flex;
  align-items: center;
}
#talkTracks .tt-check input {
  width: auto;
}
.tt-edit-fields {
  display: grid;
  gap: 18px;
}
.tt-response-edit {
  padding: 16px;
  border: 1px solid #35445a;
  border-radius: 12px;
  display: grid;
  gap: 12px;
}
#ttStatus {
  white-space: pre-wrap;
  color: #f1ce82;
}
#talkTracks button:focus-visible {
  outline: 3px solid #f4cf66;
  outline-offset: 3px;
}
@media (max-width: 760px) {
  .tt-source-file { align-items: stretch; flex-direction: column; }
  .tt-overview-heading { align-items: flex-start; flex-direction: column; }
  .tt-flow-legend { justify-content: flex-start; }
  .tt-flowchart-scroll { padding: 22px 18px 34px; }
  .tt-flowchart-canvas { grid-template-columns: repeat(var(--tt-flow-columns), 250px); gap: 76px; }
  .tt-script-layout,
  .tt-editor-layout,
  .tt-editor-meta,
  .tt-import-fields {
    grid-template-columns: 1fr;
  }
  .tt-import-summary { grid-template-columns: 1fr; }
  .tt-import-heading { align-items: stretch; flex-direction: column; }
  .tt-live-script {
    height: 760px;
    min-height: 0;
    padding: 42px 22px 24px;
    grid-template-rows: 280px 300px 52px;
    row-gap: 18px;
  }
  .tt-live-script .tt-responses {
    grid-template-columns: 1fr;
    grid-auto-rows: 72px;
  }
  .tt-live-script .tt-responses button { height: 72px; min-height: 0; }
  .tt-index {
    max-height: 220px;
    overflow: auto;
  }
  .tt-header,
  .tt-controls {
    padding: 20px;
  }
}
