/* The shared public stylesheet (/blog/blog.css) supplies the header, footer,
   slate palette and system type; this file only styles the tool itself. */
.transcript-page {
  color-scheme: dark;
  scroll-behavior: auto;
  --tool-surface: var(--surface, #13161b);
  --tool-field: var(--bg, #0b0d10);
  --tool-outline: var(--outline, #646c78);
  --tool-divider: var(--border, #262b33);
  /* Shared CTA colour, with 5.18:1 contrast against white. */
  --tool-cta: var(--cta, #c2410c);
  --tool-cta-hover: var(--cta-hover, #9a3412);
  --tool-focus: var(--orange, #fb923c);
}

.transcript-page [hidden] { display: none !important; }
.transcript-page :is(a, button, select, input):focus-visible {
  outline: 2px solid var(--tool-focus);
  outline-offset: 3px;
}
.transcript-page .nav-back, .transcript-page .nav-right .cta-btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  white-space: nowrap;
}
.transcript-page .nav-right .cta-btn { background: var(--tool-cta); }
.transcript-page .nav-right .cta-btn:hover { background: var(--tool-cta-hover); opacity: 1; }
.transcript-page .nav-right .nav-back { display: none; }
@media (min-width: 640px) {
  .transcript-page .nav-right .nav-back { display: inline-flex; }
}

.tool-main {
  max-width: 780px;
  padding-block: clamp(2.75rem, 6vw, 4.5rem) 4rem;
}
.tool-hero { margin-bottom: 1.75rem; }
.tool-hero h1 {
  font-size: clamp(2rem, 5vw, 3.45rem);
  line-height: 1.08;
  letter-spacing: -.045em;
  margin: 0 0 .85rem;
  text-wrap: balance;
}
.tool-hero .lead { max-width: 57ch; margin: 0; font-size: clamp(1rem, 2vw, 1.125rem); }
.tool-hero .tool-benefits {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem 1rem;
  margin: .85rem 0 0;
  padding: 0;
  list-style: none;
  color: var(--s300);
  font-size: .875rem;
}
.tool-benefits li { margin: 0; white-space: nowrap; }
.tool-benefits li::before {
  content: '';
  display: inline-block;
  width: .3rem;
  height: .3rem;
  margin-inline-end: .4rem;
  border-radius: 50%;
  background: var(--tool-focus);
  vertical-align: .17em;
}

/* The widget (BT-054) is embedded in static pages and in the React landing, so it
   carries its own palette instead of relying on the page stylesheet. Values mirror
   src/lib/public-palette.mjs (style C), checked by public-palette.test.ts. It is a
   size container so it can sit in a narrow hero column as well as a full article. */
.bt-tool {
  --text: #eef1f4; --s300: #b9c0ca; --s400: #7f8896;
  --tool-surface: #13161b; --tool-field: #0b0d10; --tool-raised: #1c2027; --tool-outline: #646c78; --tool-divider: #262b33;
  --tool-link: #ffa36b; --tool-cta: #c2410c; --tool-cta-hover: #9a3412; --tool-focus: #fb923c; --tool-warm: #1c130d;
  container-type: inline-size;
  color: var(--s300); text-align: left; font-size: 1rem; line-height: 1.6;
}
.bt-tool [hidden] { display: none !important; }
.bt-tool :is(a, button, input):focus-visible { outline: 2px solid var(--tool-focus); outline-offset: 3px; }
.bt-tool h2 { color: var(--text); }
.bt-tool a { color: var(--tool-link); }
.bt-tool ul, .bt-tool ol { padding-left: 1.4rem; }
.bt-tool li + li { margin-top: .25rem; }

/* The two boxes are the panels; the workspace holds them and the shared status below. */
.tool-workspace { min-width: 0; }
.tool-form-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .8rem; align-items: end; }

/* Two boxes, both visible: video links, and the channel box that stands out (BT-056). */
.tool-boxes { display: grid; gap: .85rem; }
.tool-box {
  display: grid; gap: .1rem; min-width: 0; padding: clamp(1rem, 3vw, 1.35rem);
  border: 1px solid var(--tool-divider); border-radius: .875rem; background: var(--tool-surface);
}
.bt-tool .tool-box label { margin-bottom: .3rem; font-size: 1rem; font-weight: 750; }
.tool-box-channel { border-color: #a74b2b; background: var(--tool-warm); box-shadow: inset 3px 0 0 var(--tool-focus); }
.bt-tool .tool-box .tool-hint { margin-top: .6rem; }
.tool-chips {
  display: grid; gap: .35rem; min-width: 0; padding: .35rem;
  border: 1px solid var(--tool-outline); border-radius: .5rem; background: var(--tool-field);
}
.tool-chips:focus-within { outline: 2px solid var(--tool-focus); outline-offset: 2px; }
.bt-tool .tool-chips input { min-height: 2.5rem; padding: .35rem .4rem; border: 0; background: transparent; }
.bt-tool .tool-chips input:focus-visible { outline: none; }
.bt-tool .tool-chips:has(input[aria-invalid="true"]) { border-color: #fca5a5; }
.bt-tool .tool-chip-list { display: grid; gap: .35rem; margin: 0; padding: 0; list-style: none; }
.tool-chip-list:empty { display: none; }
.bt-tool .tool-chip + .tool-chip { margin-top: 0; }
.tool-chip {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem; min-width: 0;
  padding: .15rem .15rem .15rem .6rem; border: 1px solid var(--tool-divider); border-radius: .4rem;
  background: var(--tool-surface);
}
.tool-chip code {
  min-width: 0; overflow-wrap: anywhere; color: var(--tool-link);
  font: .8125rem/1.5 var(--mono, ui-monospace, 'SF Mono', Menlo, monospace);
}
.bt-tool .tool-chip-remove {
  display: inline-grid; place-items: center; flex-shrink: 0; width: 2rem; height: 2rem;
  border: 0; border-radius: .3rem; background: transparent; color: var(--s400);
  font: inherit; font-size: 1.1rem; line-height: 1; cursor: pointer;
}
.bt-tool .tool-chip-remove:hover:not(:disabled) { background: var(--tool-raised); color: var(--text); }
.tool-field, #tool-signup-form { display: grid; gap: .35rem; min-width: 0; }
.bt-tool label { color: var(--text); font-size: .875rem; font-weight: 650; line-height: 1.4; }
.bt-tool :is(input, select) {
  width: 100%;
  min-width: 0;
  min-height: 3rem;
  padding: .6rem .7rem;
  border: 1px solid var(--tool-outline);
  border-radius: .5rem;
  background: var(--tool-field);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  line-height: 1.4;
}
.bt-tool input::placeholder { color: var(--s400); opacity: 1; }
.bt-tool input[aria-invalid="true"] { border-color: #fca5a5; }
.bt-tool :is(input, select, button):disabled { cursor: wait; }
.bt-tool .tool-hint { margin: .75rem 0 0; color: var(--s400); font-size: .875rem; }
.bt-tool noscript p { margin: .75rem 0 0; }

.bt-tool .tool-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 2.75rem;
  padding: .55rem .85rem;
  border: 1px solid var(--tool-outline);
  border-radius: .5rem;
  background: var(--tool-surface);
  color: var(--text);
  font: inherit;
  font-size: .875rem;
  font-weight: 650;
  line-height: 1.45;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
}
.bt-tool .tool-button:hover:not(:disabled) { background: var(--tool-raised); }
.bt-tool .tool-button-primary { min-height: 3rem; border-color: var(--tool-cta); background: var(--tool-cta); }
.bt-tool .tool-button-primary:hover:not(:disabled) { border-color: var(--tool-cta-hover); background: var(--tool-cta-hover); }
.bt-tool .tool-button:disabled { border-color: var(--tool-outline); background: var(--tool-raised); color: var(--s300); }
.bt-tool #tool-submit { white-space: nowrap; }

#tool-status {
  margin: 1rem 0 0;
  padding: .65rem .8rem;
  border: 1px solid var(--tool-divider);
  border-left: 3px solid var(--tool-outline);
  border-radius: .5rem;
  background: var(--tool-field);
  color: var(--s300);
  font-size: .9rem;
}
#tool-status[data-state="ready"] { border-left-color: var(--tool-focus); color: var(--text); }
#tool-status[data-state="quota"] { border-left-color: var(--tool-focus); color: #fed7aa; }
#tool-status:is([data-state="invalid"], [data-state="unavailable"], [data-state="provider_error"]) {
  border-left-color: #fca5a5; color: #fecaca;
}
.tool-loading { display: grid; gap: .5rem; padding: .9rem 0 .2rem; }
.tool-loading span { width: 100%; height: .45rem; border-radius: .25rem; background: var(--tool-raised); }
.tool-loading span:nth-child(2) { width: 75%; }
.tool-loading span:nth-child(3) { width: 55%; }
#tool-list { margin: .85rem 0 0; padding-left: 1.6rem; }
#tool-list:empty { display: none; }
#tool-list li { margin-bottom: .4rem; padding-left: .2rem; }
#tool-list a { display: inline-block; min-height: 24px; }
#tool-extract { margin-top: .65rem; }

.tool-output { margin-top: 1.25rem; border: 1px solid var(--tool-divider); border-radius: .875rem; background: var(--tool-surface); }
.tool-output:has(#tool-results:empty) { display: none; }
.bt-tool .tool-result { margin: 0; padding: clamp(1rem, 3vw, 1.5rem); }
.tool-result + .tool-result, #tool-actions { border-top: 1px solid var(--tool-divider); }
.tool-result h2, .tool-signup h2, .tool-section h2 {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: clamp(1.25rem, 3vw, 1.6rem);
  line-height: 1.25;
  letter-spacing: -.025em;
  overflow-wrap: anywhere;
  text-wrap: balance;
}
.tool-result-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .9rem; margin: .5rem 0 1rem; font-size: .875rem; }
.tool-result-meta a { display: inline-block; min-height: 24px; text-decoration: underline; text-underline-offset: .15em; }
.tool-result-language { color: var(--s400); font-weight: 600; }
.tool-result .tool-result-preview {
  max-width: 68ch;
  margin: 0;
  padding: clamp(.75rem, 2vw, 1rem);
  border-left: 2px solid var(--tool-outline);
  border-radius: 0 .5rem .5rem 0;
  background: var(--tool-field);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.75;
}
#tool-results > p { padding: .75rem 1rem; margin: 0; }
#tool-actions { display: flex; flex-wrap: wrap; gap: .6rem; padding: clamp(.75rem, 2vw, 1rem) clamp(1rem, 3vw, 1.5rem); }

.tool-signup {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  align-items: start;
  gap: clamp(1rem, 3vw, 1.7rem);
  margin-top: 1.25rem;
  padding: clamp(1rem, 3vw, 1.5rem);
  border: 1px solid #a74b2b;
  border-radius: .875rem;
  background: var(--tool-warm);
}
.tool-signup ul { margin: .8rem 0; font-size: .9rem; }
.tool-signup li::marker { color: var(--tool-focus); }
.tool-signup-copy p { margin: .65rem 0 0; font-size: .9rem; }
.tool-signup-copy .tool-signup-credits { color: #fed7aa; font-weight: 650; }
.tool-signup-controls { display: grid; gap: .75rem; min-width: 0; }
.bt-tool .tool-google { border-color: #eef1f4; background: #eef1f4; color: #0b0d10; }
.bt-tool .tool-google:hover:not(:disabled) { background: #b9c0ca; }
.tool-signup-controls .tool-signup-note { margin: 0; color: var(--s400); font-size: .8125rem; }

.tool-main .tool-section { margin-top: 2.75rem; padding-top: 1.35rem; border-top: 1px solid var(--tool-divider); }
.tool-section :is(h2, h3) { scroll-margin-top: 1rem; }
.tool-steps { margin: .95rem 0 0; padding-left: 1.5rem; }
.tool-steps li { padding-left: .35rem; margin-bottom: .75rem; }
.tool-steps li::marker { color: var(--tool-focus); font-weight: 700; }
.tool-section h3 { margin: 0 0 .2rem; font-size: 1rem; line-height: 1.4; }
.tool-section p { margin: 0; max-width: 65ch; }
.tool-faq h2 { margin-bottom: .4rem; }
.tool-faq > div { padding: .9rem 0; }
.tool-faq > div + div { border-top: 1px solid var(--tool-divider); }
.tool-related h2 { margin-bottom: .5rem; }
.tool-related a { text-decoration: underline; text-underline-offset: .15em; }

/* Stack by the widget's own width (narrow hero column) and by the viewport. */
@container (max-width: 420px) {
  .tool-form-row { grid-template-columns: minmax(0, 1fr); }
}
@container (max-width: 600px) {
  .tool-signup { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .bt-tool .tool-form-row, .bt-tool .tool-signup { grid-template-columns: minmax(0, 1fr); }
  .transcript-page .nav-inner, .transcript-page .nav-right { flex-wrap: nowrap; }
  .transcript-page .nav-right { gap: .5rem; }
  .tool-form-row, .tool-signup { grid-template-columns: minmax(0, 1fr); }
  .tool-hero { margin-bottom: 1.3rem; }
  .tool-main .tool-section { margin-top: 2rem; }
}

/* Tool lists keep their own rhythm; the shared article spacing is for guides. */
.tool-main li + li { margin-top: 0; }

/* Result screen (owner 21/11): the boxes give way to "Import it to your library"; the plain
   download is a secondary text link under a short preview. */
.bt-tool.is-result .tool-boxes { display: none; }
.bt-tool.is-result .tool-signup { margin-top: 1rem; }
.bt-tool.is-result .tool-result .tool-result-preview { max-height: 7.5rem; overflow: hidden; }
.bt-tool .tool-signup-more { color: var(--s300); }
.bt-tool .tool-link-button {
  display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0; border: 0;
  background: none; color: var(--tool-link); font: inherit; font-size: .9375rem; font-weight: 600;
  text-decoration: underline; text-underline-offset: .2em; cursor: pointer;
}
.bt-tool .tool-link-button:hover:not(:disabled) { color: var(--text); }
.bt-tool .tool-again { margin-top: .75rem; color: var(--s300); }
.bt-tool #tool-actions { align-items: center; gap: .35rem 1rem; }
.bt-tool .tool-actions-label { color: var(--s400); font-size: .9375rem; }
