/* scriptdesk. — Warm Editorial Paper + Forest Ink + Terracotta + Owl IP */
:root {
  --canvas: #f3ede2;
  --canvas-accent: radial-gradient(ellipse 68% 40% at 50% 0%, rgba(214, 78, 50, 0.08) 0%, transparent 72%);
  --header-bg: rgba(243, 237, 226, 0.92);
  --surface: #fbf8f2;
  --surface-subtle: #eee6d8;
  --surface-hover: #e6dccb;
  --action-bar-bg: #f6f0e4;
  --ink: #1b2823;
  --ink-soft: #43534b;
  --muted: #6f7c74;
  --line: #ddd3c2;
  --line-soft: #e6ddcd;
  --brand: #d64e32;
  --brand-hover: #bc3f25;
  --brand-ink: #ffffff;
  --brand-soft: #fef08a;
  --brand-soft-text: #7c2d12;
  --brand-ring: rgba(214, 78, 50, 0.18);
  --primary-action-bg: #1b2823;
  --primary-action-hover: #2a3e36;
  --primary-action-ink: #fbf8f2;
  --ok-bg: #e7f6ee;
  --ok-border: #a7dfc0;
  --ok-ink: #14633c;
  --err-bg: #fdeceb;
  --err-border: #f5b9b3;
  --err-ink: #9f251b;
  --card-radius: 14px;
  --card-border-width: 1px;
  --shadow-sm: 0 1px 2px rgba(27, 40, 35, 0.05);
  --shadow-card: 0 2px 6px rgba(27, 40, 35, 0.05), 0 14px 30px -16px rgba(27, 40, 35, 0.14);
  --shadow-pill: 0 3px 10px rgba(27, 40, 35, 0.06), 0 16px 36px -16px rgba(27, 40, 35, 0.16);
  --heading-font: 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--canvas);
  background-image: var(--canvas-accent);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}
body.has-result { background-image: none; }

button, input { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
button:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* Sticky App Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.header-inner {
  width: min(1400px, calc(100% - 40px));
  height: 62px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.4px;
  flex-shrink: 0;
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--surface);
  border: var(--card-border-width) solid var(--line);
  box-shadow: var(--shadow-sm);
  color: var(--brand);
}
.brand-mark svg { width: 22px; height: 22px; display: block; }
.brand-dot { color: var(--brand); }

.header-url-slot {
  flex: 1 1 380px;
  max-width: 500px;
  display: none;
}
body.has-result .header-url-slot { display: block; }

.top-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
}
.top-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}
.top-nav a:hover { color: var(--ink); }

/* Main Stage — Landing Mode */
.page-main {
  width: min(1400px, calc(100% - 40px));
  margin-inline: auto;
}
.tool-stage {
  padding: 48px 0 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
body.has-result .tool-stage {
  padding: 16px 0 36px;
  align-items: stretch;
}
body.has-result .hero-copy,
body.has-result .input-hint {
  display: none;
}
body.has-result .hero-form-slot {
  width: 100%;
  margin-bottom: 16px;
}
body.has-result .url-form {
  padding: 5px 5px 5px 15px;
  box-shadow: var(--shadow-sm);
}
body.has-result .url-form input[type="url"] {
  height: 38px;
  font-size: 14px;
}
body.has-result .primary-btn {
  height: 38px;
  padding: 0 18px;
  font-size: 13.5px;
}

.hero-copy {
  text-align: center;
  max-width: 680px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.hero-mascot-wrap {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: var(--surface);
  border: var(--card-border-width) solid var(--line);
  box-shadow: var(--shadow-card);
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  color: var(--brand);
}
.hero-mascot-wrap svg { width: 48px; height: 48px; }
.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 14px;
}
.hero-pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand);
}
h1 {
  margin: 0 0 10px;
  font-family: var(--heading-font);
  font-size: clamp(32px, 4.4vw, 50px);
  line-height: 1.08;
  letter-spacing: -1px;
  font-weight: 800;
  color: var(--ink);
}
.tool-lead {
  margin: 0 auto;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.65;
  max-width: 560px;
}

/* Integrated Pill URL Form (Landing) */
.hero-form-slot { width: min(740px, 100%); }
.url-form {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 7px 7px 16px;
  border-radius: 999px;
  background: var(--surface);
  border: var(--card-border-width) solid var(--line);
  box-shadow: var(--shadow-pill);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.url-form:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-ring), var(--shadow-pill);
}
.input-icon { display: inline-flex; color: var(--muted); flex-shrink: 0; }
.url-form input[type="url"] {
  flex: 1 1 auto;
  min-width: 0;
  height: 44px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  padding: 0 4px;
  outline: none;
}
.url-form input[type="url"]::placeholder { color: var(--muted); opacity: 0.78; }
.url-form input[aria-invalid="true"] { color: var(--err-ink); }

.detected-id {
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ok-ink);
  background: var(--ok-bg);
  border: 1px solid var(--ok-border);
  border-radius: 999px;
  padding: 4px 10px;
}

.primary-btn {
  flex: 0 0 auto;
  height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: var(--brand);
  color: var(--brand-ink);
  font-weight: 700;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
  transition: background 0.15s ease, transform 0.12s ease;
}
.primary-btn svg,
.primary-btn span {
  pointer-events: none;
}
.primary-btn:hover:not(:disabled) { background: var(--brand-hover); }
.primary-btn:disabled { opacity: 0.65; cursor: wait; }

/* Compact Header Form Variant (Workspace Mode) */
.header-url-slot .url-form {
  padding: 4px 4px 4px 13px;
  border-width: 1px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.header-url-slot .url-form input[type="url"] { height: 34px; font-size: 13px; }
.header-url-slot .detected-id { display: none !important; }
.header-url-slot .primary-btn { width: 34px; height: 34px; padding: 0; border-radius: 50%; }
.header-url-slot .btn-label { display: none; }

.input-hint { margin: 14px 0 0; font-size: 12.5px; color: var(--muted); text-align: center; }

.turnstile-slot {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

.turnstile-slot:empty {
  display: none;
  margin-top: 0;
}

.head-toggles {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.preset-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-muted);
  flex-wrap: wrap;
}

.preset-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.preset-select {
  font: inherit;
  font-size: 0.84rem;
  padding: 6px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.status-box {
  width: min(740px, 100%);
  margin: 16px auto 0;
  padding: 13px 16px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.55;
  border: 1px solid var(--line-soft);
  background: var(--surface);
  color: var(--ink-soft);
  box-shadow: var(--shadow-sm);
}
.status-box.is-error { background: var(--err-bg); border-color: var(--err-border); color: var(--err-ink); }
.status-box.is-loading { color: var(--ink); font-weight: 600; }

/* App-Grade 2-Column Split Workspace */
.result-area { width: 100%; }
.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(380px, 0.9fr);
  gap: 20px;
  align-items: start;
}

/* Left Column: Embedded Player & Metadata Card */
.player-column {
  position: sticky;
  top: 78px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.player-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--card-radius);
  overflow: hidden;
  background: #0b0e13;
  border: var(--card-border-width) solid var(--line);
  box-shadow: var(--shadow-card);
}
.player-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-meta-card {
  padding: 18px 20px;
  border-radius: var(--card-radius);
  background: var(--surface);
  border: var(--card-border-width) solid var(--line);
  box-shadow: var(--shadow-card);
}
.video-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}
.video-meta-card h2 {
  margin: 0;
  font-family: var(--heading-font);
  font-size: 20px;
  line-height: 1.32;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.open-yt-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--surface-subtle);
  border: 1px solid var(--line-soft);
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
}
.open-yt-btn:hover { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }

.channel-row { display: flex; align-items: center; gap: 12px; }
.channel-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--brand-ink);
  font-weight: 800;
  font-size: 14px;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
}
.channel-copy { min-width: 0; }
.video-channel { margin: 0 0 2px; font-size: 14px; font-weight: 700; color: var(--ink); }
.result-meta { margin: 0; font-size: 12.5px; color: var(--muted); }

/* Right Column: Branded Transcript Reader Card */
.transcript-column {
  border-radius: var(--card-radius);
  background: var(--surface);
  border: var(--card-border-width) solid var(--line);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  height: calc(100vh - 98px);
  min-height: 540px;
  max-height: 820px;
  overflow: hidden;
}
.transcript-head {
  padding: 14px 18px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.head-title-group { display: flex; align-items: center; gap: 8px; }
.panel-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 8px;
  background: var(--surface-subtle);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}
.segment-badge { font-size: 12px; color: var(--muted); font-weight: 500; }

/* Custom iOS Switch */
.switch-control { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; position: relative; }
.switch-control input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track {
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  position: relative;
  transition: background 0.18s ease;
}
.switch-track::after {
  content: '';
  position: absolute;
  top: 1px;
  left: 1px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
  transition: transform 0.18s ease;
}
.switch-control input:checked + .switch-track { background: var(--brand); border-color: var(--brand); }
.switch-control input:checked + .switch-track::after { transform: translateX(14px); }
.switch-label { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }

/* Search Bar Inside Reader */
.search-row { position: relative; margin: 0 16px 12px; }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.filter-input {
  width: 100%;
  height: 38px;
  padding: 0 12px 0 36px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--surface-subtle);
  color: var(--ink);
  font-size: 13.5px;
}
.filter-input:focus { background: var(--surface); border-color: var(--brand); outline: none; }

/* Transcript Scroll List */
.transcript-lines {
  flex: 1 1 auto;
  list-style: none;
  margin: 0;
  padding: 4px 10px 10px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.transcript-row {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 9px;
  align-items: baseline;
  border-left: 3px solid transparent;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.transcript-row:hover { background: var(--surface-subtle); }
.transcript-row.is-active {
  background: var(--brand-soft);
  border-left-color: var(--brand);
}
.transcript-row.is-active .ts-tag {
  background: var(--brand);
  color: var(--brand-ink);
  font-weight: 700;
}
.transcript-lines.hide-timestamps .transcript-row { grid-template-columns: 1fr; }
.transcript-lines.hide-timestamps .ts-tag { display: none; }

.ts-tag {
  padding: 2px 6px;
  border: 0;
  border-radius: 6px;
  background: var(--surface-subtle);
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
}
.ts-tag:hover { background: var(--brand); color: var(--brand-ink); }
.line-text { margin: 0; color: var(--ink); font-size: 14px; line-height: 1.62; overflow-wrap: anywhere; word-break: break-word; }
.empty-filter { padding: 24px 14px; color: var(--muted); font-size: 13.5px; text-align: center; }

/* Sticky Bottom Export Bar */
.action-bar {
  padding: 12px 14px;
  border-top: 1px solid var(--line-soft);
  background: var(--action-bar-bg);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.export-group { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; flex: 1 1 auto; }
.action-btn {
  min-height: 36px;
  padding: 6px 11px;
  line-height: 1.2;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  box-shadow: var(--shadow-sm);
}
.action-btn:hover { background: var(--surface-hover); border-color: var(--brand); }
.action-btn-primary {
  background: var(--primary-action-bg);
  border-color: var(--primary-action-bg);
  color: var(--primary-action-ink);
  padding-inline: 14px;
}
.action-btn-primary:hover { background: var(--primary-action-hover); border-color: var(--primary-action-hover); }
.action-feedback { flex-basis: 100%; font-size: 12px; font-weight: 600; color: var(--ok-ink); }
.action-feedback:empty { display: none; }

/* Documentation Below the Fold */
.docs-wrap { width: min(980px, 100%); margin-inline: auto; }
.info-section { padding: 40px 0; border-top: 1px solid var(--line-soft); }
.info-section h2 { margin: 0 0 12px; font-family: var(--heading-font); font-size: 22px; line-height: 1.25; font-weight: 700; }
.section-intro { margin: 0 0 18px; color: var(--ink-soft); font-size: 14.5px; max-width: 68ch; }
.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.info-card {
  padding: 20px;
  border-radius: var(--card-radius);
  background: var(--surface);
  border: var(--card-border-width) solid var(--line);
  box-shadow: var(--shadow-sm);
}
.info-card h3 { margin: 0 0 6px; font-size: 15px; font-weight: 700; }
.info-card p { margin: 0; font-size: 13.5px; color: var(--ink-soft); line-height: 1.65; }
code {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--surface-subtle);
  padding: 2px 6px;
  border-radius: 5px;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.format-table-wrap {
  overflow-x: auto;
  border-radius: var(--card-radius);
  background: var(--surface);
  border: var(--card-border-width) solid var(--line);
  box-shadow: var(--shadow-sm);
}
.format-table { width: 100%; border-collapse: collapse; font-size: 13.5px; text-align: left; }
.format-table th, .format-table td { padding: 12px 16px; border-bottom: 1px solid var(--line-soft); }
.format-table th { background: var(--action-bar-bg); font-weight: 700; color: var(--ink); white-space: nowrap; }
.format-table tr:last-child td { border-bottom: 0; }
.format-table td { color: var(--ink-soft); }

.faq-list {
  border-radius: var(--card-radius);
  background: var(--surface);
  border: var(--card-border-width) solid var(--line);
  box-shadow: var(--shadow-sm);
  padding: 4px 20px;
}
.faq-list details { border-bottom: 1px solid var(--line-soft); padding: 15px 0; }
.faq-list details:last-child { border-bottom: 0; }
.faq-list summary { font-weight: 600; font-size: 14.5px; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: '+'; color: var(--muted); font-size: 18px; font-weight: 400; }
.faq-list details[open] summary::after { content: '−'; }
.faq-list details p { margin: 10px 0 0; font-size: 14px; color: var(--ink-soft); max-width: 72ch; }

.site-footer { padding: 24px 20px 38px; border-top: 1px solid var(--line-soft); font-size: 12.5px; color: var(--muted); }
.site-footer p { margin: 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 20px; }
.footer-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; }
.footer-nav a { color: var(--ink-soft); text-decoration: none; font-weight: 600; }
.footer-nav a:hover { color: var(--brand); text-decoration: underline; }

/* Subpages (About, Privacy Policy, Contact) */
.legal-main { width: min(760px, calc(100% - 32px)); margin: 0 auto; padding: 44px 0 64px; }
.legal-card {
  background: var(--surface);
  border: var(--card-border-width) solid var(--line);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-sm);
  padding: 32px 34px;
}
.legal-kicker {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 10px;
}
.legal-card h1 {
  margin: 0 0 12px;
  font-family: var(--heading-font);
  font-size: clamp(26px, 4vw, 34px);
  line-height: 1.2;
  color: var(--ink);
}
.legal-updated { margin: 0 0 24px; font-size: 13px; color: var(--muted); }
.legal-card h2 {
  margin: 26px 0 8px;
  font-family: var(--heading-font);
  font-size: 19px;
  line-height: 1.3;
  color: var(--ink);
}
.legal-card p { margin: 0 0 14px; font-size: 15px; line-height: 1.72; color: var(--ink-soft); }
.legal-card ul { margin: 0 0 16px; padding-left: 20px; color: var(--ink-soft); font-size: 15px; line-height: 1.72; }
.legal-card li { margin-bottom: 8px; }
.legal-card a { color: var(--brand); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.contact-box {
  margin: 18px 0 22px;
  padding: 18px 20px;
  border-radius: 12px;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
}
.contact-box-label { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin-bottom: 4px; }
.contact-email { font-family: var(--mono); font-size: 16px; font-weight: 700; word-break: break-all; }
.back-home { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; font-size: 14px; }
@media (max-width: 720px) {
  .legal-main { width: calc(100% - 24px); padding: 28px 0 44px; }
  .legal-card { padding: 22px 18px; }
}

/* Pricing Page */
.pricing-main, .batch-main { width: min(940px, calc(100% - 32px)); margin: 0 auto; padding: 44px 0 64px; }
.pricing-hero, .batch-header { text-align: center; margin-bottom: 32px; }
.pricing-hero h1, .batch-header h1 {
  margin: 0 0 12px;
  font-family: var(--heading-font);
  font-size: clamp(28px, 4.5vw, 40px);
  line-height: 1.15;
  color: var(--ink);
}
.pricing-hero .tool-lead, .batch-header .tool-lead { margin: 0 auto; max-width: 60ch; }
.billing-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 22px;
  padding: 5px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.toggle-pill {
  border: 0;
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 13.5px;
  font-weight: 600;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.toggle-pill.is-active { background: var(--ink); color: #fbf8f2; }
.save-chip {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
}
.pricing-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; align-items: stretch; }
.pricing-grid-single { grid-template-columns: minmax(0, 560px); justify-content: center; }
.plan-cta-group { display: flex; flex-direction: column; gap: 10px; }
.plan-card {
  display: flex;
  flex-direction: column;
  padding: 28px 26px;
  border-radius: var(--card-radius);
  background: var(--surface);
  border: var(--card-border-width) solid var(--line);
  box-shadow: var(--shadow-sm);
}
.plan-card-featured { border: 2px solid var(--brand); box-shadow: var(--shadow-md); }
.plan-title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.plan-card h2 { margin: 0 0 6px; font-family: var(--heading-font); font-size: 24px; color: var(--ink); }
.plan-badge {
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(214, 78, 50, 0.12);
  color: var(--brand);
}
.plan-desc { margin: 0 0 18px; font-size: 14px; color: var(--ink-soft); line-height: 1.55; }
.plan-price { display: flex; align-items: baseline; gap: 6px; margin-bottom: 6px; }
.price-amount { font-family: var(--heading-font); font-size: 40px; font-weight: 800; color: var(--ink); line-height: 1; }
.price-unit { font-size: 14px; color: var(--muted); font-weight: 600; }
.plan-subnote { margin: 0 0 18px; font-size: 12.5px; color: var(--muted); }
.plan-features { list-style: none; padding: 0; margin: 0 0 24px; flex: 1; }
.plan-features li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 10px;
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.55;
}
.plan-features li::before { content: '✓'; position: absolute; left: 0; color: var(--brand); font-weight: 800; }
.plan-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 14.5px;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
}
.plan-cta-primary { background: var(--brand); color: #fff; }
.plan-cta-primary:hover { filter: brightness(0.94); }
.plan-cta-secondary { background: var(--surface-subtle); color: var(--ink); border: 1px solid var(--line); }
.plan-cta-secondary:hover { border-color: var(--brand); }
.checkout-caption { margin: 10px 0 0; font-size: 12px; color: var(--muted); text-align: center; line-height: 1.5; }
.waitlist-form { display: flex; flex-direction: column; gap: 10px; }
.waitlist-input {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 14px;
  color: var(--ink);
}
.waitlist-input:focus { outline: 2px solid rgba(214, 78, 50, 0.28); border-color: var(--brand); }
.waitlist-feedback { margin: 10px 0 0; font-size: 13px; font-weight: 600; text-align: center; color: var(--ink-soft); }
.waitlist-feedback:empty { display: none; }
.waitlist-feedback.is-success { color: #1f6b47; }
.waitlist-feedback.is-error { color: #b42318; }
.license-feedback.is-success { color: #1f6b47; }
.license-feedback.is-error { color: #b42318; }
.pricing-faq { margin-top: 28px; }

/* Batch Workspace */
.license-bar {
  padding: 18px 20px;
  border-radius: var(--card-radius);
  background: var(--surface);
  border: var(--card-border-width) solid var(--line);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}
.plan-status-pill {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-subtle);
  color: var(--ink);
  margin-bottom: 8px;
}
.plan-status-pill.is-pro { background: rgba(27, 40, 35, 0.12); color: var(--ink); border: 1px solid var(--ink); }
.license-desc { margin: 0 0 12px; font-size: 13.5px; color: var(--ink-soft); }
.license-desc a { color: var(--brand); font-weight: 600; }
.license-form { display: flex; flex-wrap: wrap; gap: 8px; }
.license-form input {
  flex: 1 1 260px;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink);
}
.license-feedback { margin: 8px 0 0; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.license-feedback:empty { display: none; }
.batch-card {
  padding: 22px;
  border-radius: var(--card-radius);
  background: var(--surface);
  border: var(--card-border-width) solid var(--line);
  box-shadow: var(--shadow-sm);
}
.batch-label { display: block; font-size: 13.5px; font-weight: 700; color: var(--ink); margin-bottom: 8px; }
.batch-textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink);
  resize: vertical;
}
.batch-controls {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.batch-count { font-size: 13px; color: var(--muted); font-weight: 600; }
.batch-results-section { margin-top: 26px; }
.batch-results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}
.batch-results-bar h2 { margin: 0; font-family: var(--heading-font); font-size: 20px; }
.batch-export-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.batch-results-list { display: grid; gap: 12px; }
.batch-item-card {
  padding: 16px 18px;
  border-radius: var(--card-radius);
  background: var(--surface);
  border: var(--card-border-width) solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.batch-item-card.is-failed { border-color: rgba(214, 78, 50, 0.45); }
.batch-item-head h3 { margin: 0 0 4px; font-size: 15px; color: var(--ink); }
.batch-item-meta { margin: 0; font-size: 13px; color: var(--muted); }
.batch-item-actions { display: flex; flex-wrap: wrap; gap: 6px; }

@media (max-width: 720px) {
  .pricing-main, .batch-main { width: calc(100% - 24px); padding: 28px 0 44px; }
  .pricing-grid { grid-template-columns: 1fr; }
  .batch-card { padding: 16px; }
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Responsive */
@media (max-width: 960px) {
  .workspace-grid { grid-template-columns: 1fr; gap: 16px; }
  .transcript-column { order: -1; height: auto; min-height: 0; max-height: none; }
  .player-column { order: 1; position: static; }
  .transcript-lines { max-height: 460px; }
  .ai-study-panel { max-height: 520px; }
}
@media (max-width: 720px) {
  .header-inner { width: calc(100% - 24px); height: auto; min-height: 54px; padding: 8px 0; flex-wrap: nowrap; gap: 10px; }
  body.has-result .header-url-slot { order: 3; flex-basis: 100%; max-width: none; }
  .top-nav { gap: 10px; flex-wrap: nowrap; }
  .top-nav a { font-size: 12.5px; }
  .page-main { width: calc(100% - 24px); }
  .tool-stage { padding: 24px 0 24px; }
  .url-form { border-radius: 16px; padding: 8px 10px; flex-wrap: wrap; }
  .header-url-slot .url-form { border-radius: 999px; flex-wrap: nowrap; padding: 4px 4px 4px 12px; }
  .hero-form-slot .primary-btn { width: 100%; min-height: 44px; border-radius: 10px; }
  .info-grid { grid-template-columns: 1fr; }
  .video-meta-card { padding: 14px 16px; }
  .transcript-head { padding: 12px 14px 10px; gap: 8px; }
  .search-row { margin: 0 12px 10px; }
  .transcript-row { grid-template-columns: 52px 1fr; gap: 8px; padding: 8px; }
  .study-tabs { padding: 8px 12px; gap: 6px; }
  .study-tab { min-height: 34px; padding: 5px 11px; }
  .action-bar { padding: 10px 12px; gap: 8px; }
  .action-btn { min-height: 38px; }
  .action-btn-primary { width: 100%; }
  .export-group { width: 100%; }
  .export-group .action-btn { flex: 1 1 calc(25% - 4px); min-width: 68px; }
}

/* Guides Hub & Editorial Article System (T1 UI Polish + T4 GEO + T5 Visuals) */
.guide-shell {
  width: min(860px, calc(100% - 36px));
  margin: 0 auto;
  padding: 36px 0 64px;
}
.guide-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 18px;
}
.guide-breadcrumb a { color: var(--ink-soft); text-decoration: none; font-weight: 600; }
.guide-breadcrumb a:hover { color: var(--brand); }
.guide-header { margin-bottom: 24px; }
.guide-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 12px;
}
.guide-kicker-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }
.guide-header h1 {
  margin: 0 0 12px;
  font-family: var(--heading-font);
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.16;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.guide-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 13px;
  color: var(--muted);
}
.answer-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: var(--card-radius);
  padding: 20px 22px;
  margin: 0 0 28px;
  box-shadow: var(--shadow-card);
}
.answer-box-label {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand);
  margin-bottom: 8px;
}
.answer-box p { margin: 0 0 12px; font-size: 16px; line-height: 1.65; color: var(--ink); }
.answer-box p:last-child { margin-bottom: 0; }
.answer-box-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.guide-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--primary-action-bg);
  color: var(--primary-action-ink);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 700;
}
.guide-cta-btn:hover { background: var(--primary-action-hover); }
.guide-cta-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--surface-subtle);
  color: var(--ink);
  border: 1px solid var(--line);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
}
.guide-cta-secondary:hover { border-color: var(--brand); }
.guide-body h2 {
  margin: 34px 0 12px;
  font-family: var(--heading-font);
  font-size: 24px;
  line-height: 1.25;
  color: var(--ink);
}
.guide-body h3 {
  margin: 22px 0 8px;
  font-size: 17px;
  color: var(--ink);
}
.guide-body p, .guide-body li {
  font-size: 15.5px;
  line-height: 1.72;
  color: var(--ink-soft);
}
.guide-body ul, .guide-body ol { padding-left: 22px; margin: 10px 0 18px; }
.guide-body li { margin-bottom: 8px; }
.guide-body code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--surface-subtle);
  padding: 2px 6px;
  border-radius: 5px;
  color: var(--ink);
}
.code-block {
  background: #1b2823;
  color: #f6f0e4;
  border-radius: 12px;
  padding: 16px 18px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.65;
  margin: 14px 0 22px;
}
.code-block code { background: none; color: inherit; padding: 0; font-size: inherit; }
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background: var(--surface);
  margin: 16px 0 24px;
  box-shadow: var(--shadow-sm);
}
.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  text-align: left;
}
.spec-table th, .spec-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}
.spec-table th {
  background: var(--action-bar-bg);
  color: var(--ink);
  font-weight: 700;
  white-space: nowrap;
}
.spec-table tr:last-child td { border-bottom: none; }
.diagram-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  padding: 18px;
  margin: 22px 0 26px;
  box-shadow: var(--shadow-sm);
}
.diagram-card svg { width: 100%; height: auto; display: block; border-radius: 8px; }
.diagram-caption {
  margin: 10px 0 0;
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
}
.guide-callout {
  background: var(--action-bar-bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  margin: 18px 0 22px;
  font-size: 14.5px;
  color: var(--ink-soft);
}
.guide-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 22px;
}
.guide-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  border-radius: var(--card-radius);
  background: var(--surface);
  border: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.guide-card:hover { transform: translateY(-2px); border-color: var(--brand); }
.guide-card-tag { font-size: 11.5px; font-weight: 700; color: var(--brand); text-transform: uppercase; letter-spacing: 0.06em; }
.guide-card h2 { margin: 0; font-family: var(--heading-font); font-size: 19px; line-height: 1.3; color: var(--ink); }
.guide-card p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--ink-soft); flex: 1; }
.guide-card-meta { font-size: 12px; color: var(--muted); margin-top: 6px; }
@media (max-width: 720px) {
  .guide-shell { width: calc(100% - 24px); padding: 24px 0 48px; }
  .answer-box { padding: 16px; }
  .answer-box p { font-size: 15px; }
  .guide-body h2 { font-size: 21px; }
  .diagram-card { padding: 12px; }
  .top-nav { gap: 12px; flex-wrap: wrap; }
}

/* Browser-Local Transcript History (Nav Button, Recent Strip, Slide-Over Drawer) */
.history-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.2;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.history-nav-btn:hover {
  border-color: var(--brand);
  background: var(--action-bar-bg);
}
.history-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.recent-strip {
  width: min(680px, 100%);
  margin: 14px auto 0;
  padding: 12px 14px;
  border-radius: var(--card-radius);
  background: rgba(251, 248, 242, 0.82);
  border: 1px solid var(--line-soft);
}
body.has-result .recent-strip { display: none; }
.recent-strip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.recent-strip-label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.recent-strip-all {
  border: none;
  background: none;
  padding: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--brand);
}
.recent-strip-all:hover { text-decoration: underline; }
.recent-chips {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}
.recent-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  text-align: left;
  transition: border-color 0.15s ease, transform 0.12s ease;
}
.recent-chip:hover {
  border-color: var(--brand);
  transform: translateY(-1px);
}
.recent-chip-title {
  width: 100%;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.recent-chip-meta {
  font-size: 11px;
  color: var(--muted);
}

.history-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(27, 40, 35, 0.36);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.18s ease;
}
.history-backdrop.is-open { opacity: 1; }

.history-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  width: min(400px, 100vw);
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: -12px 0 36px rgba(27, 40, 35, 0.16);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.2s ease;
}
.history-drawer.is-open { transform: translateX(0); }

.history-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 12px;
  border-bottom: 1px solid var(--line-soft);
}
.history-drawer-head h2 {
  margin: 0 0 3px;
  font-family: var(--heading-font);
  font-size: 21px;
  color: var(--ink);
}
.history-privacy-note {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}
.history-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--action-bar-bg);
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.history-close-btn:hover { border-color: var(--brand); color: var(--brand); }

.history-search-wrap {
  padding: 12px 18px;
  border-bottom: 1px solid var(--line-soft);
}
.history-search-input {
  width: 100%;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 13.5px;
}
.history-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.history-empty {
  margin: 28px 12px;
  text-align: center;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.6;
}
.history-item {
  display: flex;
  align-items: stretch;
  gap: 6px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  transition: border-color 0.15s ease;
}
.history-item:hover { border-color: var(--brand); }
.history-item.is-current {
  border-color: var(--brand);
  background: var(--action-bar-bg);
}
.history-item-main {
  flex: 1;
  min-width: 0;
  border: none;
  background: none;
  padding: 10px 12px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.history-item-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.history-item-meta {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-item-del {
  width: 34px;
  border: none;
  border-left: 1px solid var(--line-soft);
  background: none;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  border-radius: 0 9px 9px 0;
  flex-shrink: 0;
}
.history-item-del:hover { background: var(--err-bg); color: var(--err-ink); }

.history-drawer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-top: 1px solid var(--line-soft);
  background: var(--action-bar-bg);
}
.history-foot-count { font-size: 12px; color: var(--muted); font-weight: 600; }
.history-clear-btn {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
}
.history-clear-btn:hover { border-color: var(--err-ink); color: var(--err-ink); }
.history-clear-btn.is-armed {
  background: var(--err-bg);
  border-color: var(--err-border);
  color: var(--err-ink);
}

/* AI Study Lab Tabs & Interactive Panels */
.study-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px 10px;
  border-bottom: 1px solid var(--line-soft);
  overflow-x: auto;
  scrollbar-width: none;
}
.study-tabs::-webkit-scrollbar { display: none; }
.study-tab {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.study-tab:hover { border-color: var(--brand); color: var(--ink); }
.study-tab.is-active {
  background: var(--primary-action-bg);
  border-color: var(--primary-action-bg);
  color: var(--primary-action-ink);
}

.ai-study-panel {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ai-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.ai-counter {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-soft);
}
.ai-state-box {
  margin: auto 0;
  padding: 36px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--ink-soft);
}
.ai-state-box.is-error p { color: var(--err-ink); font-weight: 600; }
.ai-state-sub { font-size: 12px; color: var(--muted); }
.ai-spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--brand);
  animation: aiSpin 0.8s linear infinite;
}
@keyframes aiSpin { to { transform: rotate(360deg); } }

.ai-card-block {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 14px 16px;
}
.ai-card-block h3 {
  margin: 0 0 10px;
  font-family: var(--heading-font);
  font-size: 16.5px;
  color: var(--ink);
}
.ai-bullet-list {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.55;
}
.ai-takeaway-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ai-takeaway-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.ai-takeaway-copy strong {
  display: block;
  font-size: 13.5px;
  color: var(--ink);
  margin-bottom: 2px;
}
.ai-takeaway-copy p {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.55;
}
.ai-ts-chip {
  flex-shrink: 0;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--action-bar-bg);
  color: var(--brand);
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
}
.ai-ts-chip:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.flashcard-stage {
  width: 100%;
  min-height: 210px;
  padding: 24px 22px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.flashcard-stage:hover { border-color: var(--brand); }
.flashcard-stage.is-flipped {
  background: var(--action-bar-bg);
  border-color: var(--brand);
}
.flashcard-side {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--brand);
}
.flashcard-text {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  font-weight: 600;
}
.flashcard-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.quiz-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.quiz-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.quiz-q-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.quiz-q-text {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.45;
}
.quiz-options {
  display: grid;
  gap: 7px;
}
.quiz-opt-btn {
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 13.5px;
  text-align: left;
  transition: border-color 0.12s ease, background-color 0.12s ease;
}
.quiz-opt-btn:hover:not(:disabled) { border-color: var(--brand); background: var(--action-bar-bg); }
.quiz-opt-btn.is-correct {
  background: var(--ok-bg);
  border-color: var(--ok-border);
  color: var(--ok-ink);
  font-weight: 700;
}
.quiz-opt-btn.is-wrong {
  background: var(--err-bg);
  border-color: var(--err-border);
  color: var(--err-ink);
}
.quiz-explanation {
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.5;
}
.quiz-explanation.is-ok { background: var(--ok-bg); color: var(--ok-ink); }
.quiz-explanation.is-bad { background: var(--err-bg); color: var(--err-ink); }

.mindmap-svg-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f6f0e4;
  padding: 8px;
}
.mindmap-svg-wrap svg {
  width: 100%;
  min-width: 540px;
  height: auto;
  display: block;
}
.mindmap-branches {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
.mindmap-branch-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
}
.mindmap-branch-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.mindmap-branch-head strong { font-size: 13.5px; color: var(--ink); }
.mindmap-branch-card ul {
  margin: 0;
  padding-left: 16px;
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.5;
}

/* Compact Options Popover (keeps Obsidian YAML accessible without cluttering header) */
.options-popover {
  position: relative;
}
.options-trigger {
  list-style: none;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
  user-select: none;
}
.options-trigger::-webkit-details-marker { display: none; }
.options-trigger::after { content: ' ▾'; font-size: 10px; opacity: 0.75; }
.options-popover[open] .options-trigger {
  border-color: var(--brand);
  color: var(--ink);
}
.options-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 40;
  min-width: 220px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.options-hint {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--muted);
}

/* Extra local document exports (CSV, Word, PDF) & AI Translate picker */
.extra-export-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.action-btn-subtle {
  background: transparent;
  border-style: dashed;
  color: var(--ink-soft);
  font-size: 12px;
  padding: 5px 10px;
}
.action-btn-subtle:hover {
  border-style: solid;
  border-color: var(--brand);
  color: var(--ink);
}
.translate-toolbar {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-soft);
}
.translate-select {
  flex: 1 1 180px;
  min-height: 36px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

/* Ask AI (Video Chat) tab styles */
.ai-chat-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 300px;
  flex: 1;
}
.ai-chat-messages {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding-right: 2px;
}
.ai-chat-welcome {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 14px 16px;
}
.ai-chat-welcome p {
  margin: 0 0 10px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-soft);
}
.ai-chat-starters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.ai-chat-starter-btn {
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
  transition: border-color 0.14s ease, background-color 0.14s ease;
}
.ai-chat-starter-btn:hover:not(:disabled) {
  border-color: var(--brand);
  background: var(--action-bar-bg);
}
.ai-chat-msg {
  max-width: 92%;
  padding: 10px 13px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.58;
}
.ai-chat-msg p { margin: 0; white-space: pre-wrap; }
.ai-chat-msg.is-user {
  align-self: flex-end;
  background: var(--primary-action-bg);
  color: var(--primary-action-ink);
  border-bottom-right-radius: 4px;
}
.ai-chat-msg.is-assistant {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  border-bottom-left-radius: 4px;
}
.ai-chat-msg.is-pending {
  color: var(--muted);
  font-style: italic;
}
.ai-chat-citations {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.ai-chat-error {
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--err-bg);
  color: var(--err-ink);
  font-size: 12.5px;
  font-weight: 600;
}
.ai-chat-form {
  display: flex;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line-soft);
}
.ai-chat-input {
  flex: 1;
  min-width: 0;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 13.5px;
}
.ai-chat-input:focus {
  outline: none;
  border-color: var(--brand);
}

/* Language switcher strip in footer */
.lang-switcher {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  font-size: 12.5px;
  color: var(--muted);
}
.lang-switcher a {
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 600;
}
.lang-switcher a:hover,
.lang-switcher a[aria-current="page"] {
  border-color: var(--brand);
  color: var(--brand);
}

/* Clean browser Print / Save-as-PDF layout */
@media print {
  .site-header,
  .hero-copy,
  .hero-form-slot,
  .input-hint,
  .recent-strip,
  .player-column,
  .study-tabs,
  .search-row,
  .action-bar,
  .ai-toolbar,
  .docs-wrap,
  .site-footer,
  .history-backdrop,
  .history-drawer {
    display: none !important;
  }
  body { background: #fff !important; color: #000 !important; }
  .workspace-grid { display: block !important; }
  .transcript-column { border: none !important; box-shadow: none !important; height: auto !important; max-height: none !important; }
  .transcript-lines, .ai-study-panel { max-height: none !important; overflow: visible !important; }
}
