/* The free tools (src/tools.mjs, public/tool-length.js, public/tool-outline.js).
   Loaded on the tool pages only, after styles.css: the fields, buttons, chips,
   notices, FAQ and calls to action are the site's own; this file adds the
   tables, the stopwatch, the outline and its print layout. */

.tool {
  margin-top: var(--s-6);
}

.tool-short input {
  max-width: 14rem;
}

.tool-guide {
  margin: 8px 0 0;
}

.tool-subhead {
  font: 600 1.35rem/1.2 var(--display);
  margin: 0 0 6px;
}

/* The tools index: the cards carry the page's second-level headings. */
.tool-page .guide-card h2 {
  margin: 0 0 8px;
  font-size: 1.4rem;
}

.tool-presets {
  margin: 0 0 var(--s-3);
}

/* Result tables: pace, words per minute, the result. */
.tool-table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--s-4) 0 var(--s-3);
  font-variant-numeric: tabular-nums;
}

.tool-table caption {
  text-align: left;
  font: 600 0.74rem/1.5 var(--sans);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding-bottom: var(--s-2);
}

.tool-table th,
.tool-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: baseline;
}

.tool-table thead th {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink-3);
  border-bottom-color: var(--line-strong);
}

.tool-table tbody th {
  font-weight: 600;
}

.tool-table [data-out] {
  font: 500 1.4rem/1.2 var(--display);
  font-feature-settings: 'lnum', 'tnum';
}

.tool-table .is-normal {
  background: var(--accent-soft);
}

.tool-table [data-pace='own'] th {
  color: var(--accent);
}

.tool-wpm {
  display: block;
  font-weight: 400;
  font-size: 0.8rem;
  color: var(--ink-3);
}

.tool-verdict {
  margin-top: 0;
}

/* The stopwatch */
.tool-timer {
  border-top: 1px solid var(--line);
  padding-top: var(--s-4);
  margin: var(--s-5) 0 var(--s-3);
}

.tool-clock {
  font: 500 1.7rem/1 var(--display);
  font-feature-settings: 'lnum', 'tnum';
  min-width: 3.2ch;
  color: var(--ink);
}

.tool-prose {
  margin-top: var(--s-7);
  max-width: none;
}

.tool-narrow {
  max-width: 760px;
}

.tool-more {
  margin-top: var(--s-7);
}

.tool-more-text {
  display: block;
  color: var(--ink-2);
}

/* The outline builder */
.tool-selects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
  gap: 0 var(--s-4);
}

.outline {
  margin-top: var(--s-6);
}

.outline-summary {
  color: var(--ink-2);
}

.outline-parts {
  list-style: none;
  padding: 0;
  margin: var(--s-5) 0 0;
  counter-reset: part;
}

.outline-part {
  counter-increment: part;
  border-top: 1px solid var(--ink);
  padding: var(--s-4) 0 var(--s-5);
}

.outline-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 16px;
  margin: 0 0 6px;
  font-size: 0.9rem;
  color: var(--ink-3);
}

.outline-time {
  font: italic 600 1.2rem/1 var(--display);
  color: var(--accent);
  font-feature-settings: 'lnum', 'tnum';
}

.outline-title {
  margin: 0 0 6px;
}

.outline-title::before {
  content: counter(part) '. ';
  color: var(--accent);
}

.outline-goal {
  color: var(--ink-2);
  margin-bottom: 8px;
}

.outline-prompts {
  margin: 0 0 var(--s-3);
  padding-left: 20px;
}

.outline-prompts li {
  margin-bottom: 4px;
}

.outline-notes {
  margin: var(--s-3) 0 0;
}

.outline-notes textarea {
  min-height: 72px;
}

.outline-tips {
  margin-top: var(--s-5);
  padding: var(--s-5);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.outline-tips .checks li:last-child {
  margin-bottom: 0;
}

.print-only {
  display: none;
}

/* A result and a length stay on one line ("10 min 15 s", "10 minutes"). */
.tool-table [data-out],
.tool-glance tbody th {
  white-space: nowrap;
}

@media (max-width: 480px) {
  .tool-table th,
  .tool-table td {
    padding: 8px 5px;
  }

  .tool-table [data-out] {
    font-size: 1.12rem;
  }

  .tool-table thead th {
    font-size: 0.8rem;
  }
}

/* Printing the outline: the outline alone, on white, with lines for notes. */
@media print {
  .print-only {
    display: block;
  }

  .tool-page {
    padding: 0;
  }

  .tool-page .wrap {
    max-width: none;
    padding: 0;
  }

  .outline {
    margin: 0;
  }

  .outline-brand {
    font-size: 9pt;
    color: #555;
    margin: 0 0 8pt;
  }

  .outline h2 {
    font-size: 22pt;
  }

  .outline-summary {
    color: #000;
    font-size: 10pt;
  }

  .outline-part {
    break-inside: avoid;
    border-top-color: #000;
    padding: 8pt 0 10pt;
  }

  .outline-time,
  .outline-title::before {
    color: #000;
  }

  .outline-goal,
  .outline-meta {
    color: #333;
  }

  .outline-notes-print {
    white-space: pre-wrap;
    font-size: 11pt;
    margin-top: 6pt;
  }

  .outline-rule {
    display: block;
    height: 1.6em;
    border-bottom: 1px solid #999;
  }

  .outline-tips {
    background: none;
    border: 1px solid #999;
    break-inside: avoid;
  }
}
