/* EPUB → text tool. Builds on styles.css variables and .button / .lead / .eyebrow. */
.tool-page { padding: 56px 0 90px; }
/* Classes below set display; keep the hidden attribute authoritative. */
.tool-page [hidden] { display: none !important; }
.tool-hero { max-width: 780px; margin-bottom: 36px; }
.tool-hero h1 { font-size: clamp(32px, 4.4vw, 52px); line-height: 1.2; letter-spacing: -.03em; margin: 10px 0 18px; text-wrap: balance; }
.tool-hero .lead { font-size: 18px; margin: 0 0 14px; }
.tool-privacy { display: inline-block; margin: 0; padding: 6px 14px; border-radius: 999px; background: var(--sage); color: var(--green); font-size: 14px; font-weight: 650; }

.tool-card { margin-top: 22px; padding: 28px; border: 1px solid var(--line); border-radius: 22px; background: var(--card); box-shadow: 0 16px 42px rgba(50, 42, 34, .06); }
.tool-card h2 { margin: 0 0 8px; font-size: 22px; line-height: 1.35; }

.tool-drop { position: relative; display: grid; place-items: center; gap: 6px; min-height: 180px; padding: 28px; border: 2px dashed var(--line); border-radius: 16px; text-align: center; cursor: pointer; transition: border-color .15s, background-color .15s; }
.tool-drop:hover, .tool-drop.is-dragover { border-color: var(--brown); background: rgba(101, 81, 38, .05); }
.tool-drop:focus-within { outline: 2px solid var(--brown); outline-offset: 3px; }
.tool-drop-label { font-size: 19px; font-weight: 700; }
.tool-drop-hint { color: var(--muted); font-size: 14px; }
/* Visually hidden but still in the accessibility tree and keyboard order. */
.tool-file { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.tool-status { display: flex; align-items: center; gap: 14px; margin-top: 18px; color: var(--muted); font-size: 14px; }
.tool-status progress { flex: 1; max-width: 360px; accent-color: var(--brown); }
.tool-error { margin: 18px 0 0; padding: 12px 16px; border-radius: 12px; background: #f6e3dc; color: #8a2f1c; font-weight: 650; }
.tool-notice { margin: 14px 0 0; padding: 10px 14px; border-radius: 12px; background: #f4ecd2; color: var(--ink); font-size: 14px; }

.tool-book-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; }
.tool-book-head h2 { font-size: 26px; overflow-wrap: anywhere; }
.tool-meta { margin: 0; color: var(--muted); }
.button.tool-small { min-height: 36px; padding: 0 14px; border-radius: 10px; font-size: 14px; }
.tool-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 20px 0 10px; }
.tool-depth { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; color: var(--muted); font-size: 14px; }

.tool-chapters { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); max-height: 520px; overflow-y: auto; }
.tool-chapter { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 9px 4px; border-bottom: 1px solid var(--line); }
.tool-chapter.lvl-2 .tool-chapter-title { padding-left: 1.5em; }
.tool-chapter-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tool-chapter-title label { cursor: pointer; }
.tool-num { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.tool-copy { display: inline-flex; align-items: center; text-decoration: none; min-height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: transparent; color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; }
.tool-copy:hover { border-color: var(--brown); }
.tool-copy.is-copied { border-color: var(--green); color: var(--green); }
.tool-copy.is-failed { border-color: #8a2f1c; color: #8a2f1c; }

.tool-hint { margin: 12px 0 0; color: var(--muted); font-size: 13px; }
.tool-options { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; margin: 16px 0; }
.tool-options select, .tool-options input[type="number"], .tool-depth select { margin-left: 8px; min-height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); font: inherit; }
.tool-options input[type="number"] { width: 9em; }
.tool-format { display: flex; gap: 18px; margin: 0; padding: 0; border: 0; }
.tool-format legend { float: left; margin-right: 12px; color: var(--muted); }
.tool-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.tool-hint + .tool-actions { margin-top: 14px; }
.tool-actions .button:disabled { opacity: .45; cursor: not-allowed; }

.tool-ai-targets { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 22px 0 0; padding: 0; border: 0; }
.tool-ai-targets legend { float: left; margin-right: 6px; color: var(--muted); }
.tool-pill { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font-size: 14px; }
.tool-pill input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.tool-pill:has(input:checked) { border-color: var(--brown); background: var(--brown); color: #fff; }
.tool-pill:has(input:focus-visible) { outline: 2px solid var(--brown); outline-offset: 2px; }
.tool-ai-summary { margin: 16px 0 8px; font-weight: 650; }
.tool-ai-summary:empty { display: none; }
.tool-chunks { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.tool-chunks li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.tool-chunks .tool-empty { color: var(--muted); }

.tool-cta { background: var(--sage); border-color: transparent; box-shadow: none; }
.tool-cta p { margin: 0 0 18px; color: var(--muted); }
.tool-legal { margin: 26px 0 0; color: var(--muted); font-size: 13px; }

/* Content below the tool: how-to, AI answers, app, FAQ, related. */
.tool-section { margin-top: 72px; }
.tool-section h2 { margin: 0 0 18px; font-size: clamp(24px, 3vw, 32px); line-height: 1.3; }
.tool-section h3 { margin: 28px 0 10px; font-size: 19px; }
.tool-steps { margin: 0; padding-left: 1.4em; display: grid; gap: 8px; font-size: 17px; }
.tool-prompts { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tool-prompts li { padding: 12px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.tool-prompts li::before { content: "“"; color: var(--brown); font-weight: 700; margin-right: 2px; }
.tool-can { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.tool-can-item { padding: 22px 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); }
.tool-can-item h3 { margin: 0 0 6px; }
.tool-can-item p { margin: 0 0 10px; color: var(--muted); }
.tool-can-item a { color: var(--brown); font-weight: 650; text-underline-offset: 4px; }
.tool-app { padding: 40px; border-radius: 26px; background: var(--sage); }
.tool-app .lead { font-size: 18px; margin: 0 0 26px; }
.tool-shots { display: grid; grid-template-columns: 220px 220px minmax(0, 1fr); gap: 20px; align-items: end; }
.tool-shot { margin: 0; }
.tool-shot img { display: block; width: 100%; height: auto; border-radius: 18px; box-shadow: 0 16px 36px rgba(50, 42, 34, .16); background: #fff; }
.tool-shot.is-wide img { border-radius: 10px; }
.tool-shot figcaption { margin-top: 10px; color: var(--muted); font-size: 13px; text-align: center; }
.tool-compare-wrap { overflow-x: auto; }
.tool-compare { width: 100%; border-collapse: collapse; background: var(--card); border-radius: 14px; overflow: hidden; font-size: 15px; }
.tool-compare th, .tool-compare td { padding: 12px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tool-compare thead th { color: var(--brown); }
.tool-compare tbody th { color: var(--muted); font-weight: 650; white-space: nowrap; }
.tool-platform { margin: 22px 0 6px; }
.tool-app .button.app-store { margin-top: 14px; }
#faq details { padding: 14px 0; border-bottom: 1px solid var(--line); }
#faq summary { cursor: pointer; font-weight: 700; }
#faq details p { margin: 10px 0 0; color: var(--muted); }
.tool-related { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
.tool-related a { color: var(--ink); text-underline-offset: 4px; }

@media (max-width: 760px) {
  .tool-page { padding-top: 32px; }
  .tool-card { padding: 20px; border-radius: 18px; }
  .tool-book-head { flex-direction: column; }
  .tool-depth { margin-left: 0; }
  .tool-section { margin-top: 52px; }
  .tool-prompts, .tool-can { grid-template-columns: 1fr; }
  .tool-app { padding: 24px 20px; }
  .tool-shots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tool-shot.is-wide { grid-column: 1 / -1; }
  .tool-compare { font-size: 14px; }
  .tool-compare th, .tool-compare td { padding: 10px 8px; }
  .tool-compare tbody th { white-space: normal; width: 22%; }
  .tool-compare thead th { white-space: nowrap; }
}
