/* ============================================================================
   Text Repeater — tool layer over base.css
   base.css supplies reset, type, forms, buttons, chips, badges, panels, tables,
   header, footer, focus rings. This file adds the accent and only what is
   unique to this tool.

   Accent — sky blue, measured against base.css surfaces (WCAG relative
   luminance):
     dark  #61a8ef  7.52:1 on --bg   6.94:1 on --surface   7.79:1 on --bg-sunk
     light #084f96  7.84:1 on --bg   8.17:1 on --surface   7.18:1 on --bg-sunk
   Both clear the 4.5:1 text floor on all three surfaces in both themes.
   ========================================================================= */
:root { --accent: #61a8ef; --accent-dim: rgba(97, 168, 239, 0.14); }
@media (prefers-color-scheme: light) {
  :root { --accent: #084f96; --accent-dim: rgba(8, 79, 150, 0.10); }
}

.brand svg .mark-bg { fill: var(--accent); }
.brand svg .mark-fg { fill: var(--on-accent); font-family: var(--sans); }

/* base has no visually-hidden helper */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
[hidden] { display: none !important; }
.offscreen-copy { position: fixed; top: -1000px; left: 0; opacity: 0; }

/* ============================================================================
   Controls
   ========================================================================= */

.tr-controls {
  display: grid;
  gap: 1rem 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(min(11rem, 100%), 1fr));
  margin-top: 1.1rem;
}

#input-text {
  min-height: 8rem;
  resize: vertical;
  line-height: 1.5;
}

.tr-opts {
  margin-top: 1.1rem;
}

.opt-check {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8125rem;
  color: var(--text-dim);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.8rem 0.35rem 0.6rem;
  cursor: pointer;
}
.opt-check:hover { border-color: var(--line-strong); }
.opt-check input {
  width: 1rem; height: 1rem; margin: 0; cursor: pointer;
  accent-color: var(--accent);
}
.opt-check:has(input:checked) {
  color: var(--text); border-color: var(--accent); background: var(--accent-dim);
}

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin-top: 1.1rem; }

.copy-status {
  font-size: 0.8125rem;
  color: var(--ok);
  min-width: 1px;
}
.copy-status.is-err { color: var(--err); }

/* ============================================================================
   Result — repetitions / character-count stats, then the output box
   ========================================================================= */

.tr-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2rem;
  margin-top: 1.5rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
}

.tr-stats .stat-label { display: block; margin-bottom: 0.2rem; }

#cap-note {
  margin-top: 0.9rem;
}

.tr-output-field {
  margin-top: 1.1rem;
}

#output-text {
  min-height: 12rem;
  resize: vertical;
  line-height: 1.5;
  background: var(--bg-sunk);
}

/* ============================================================================
   Article furniture — shared with the rest of the site's tools
   ========================================================================= */

.section { max-width: 74ch; }
.section table { max-width: none; }

.formula,
.callout {
  background: var(--bg-sunk);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin: 0 0 1.2em;
}
.formula {
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.875rem;
  line-height: 1.7;
  white-space: pre;
}
.callout {
  border-left: 2px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.9375rem;
  color: var(--text-dim);
}
.callout p:last-child { margin-bottom: 0; }
.callout strong { color: var(--text); }

.example {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.95rem 1.15rem;
  margin: 0 0 1rem;
}
.example h3 { margin-top: 0; }
.example p:last-child { margin-bottom: 0; }

.pagelinks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(17rem, 100%), 1fr));
  gap: 0.75rem;
  margin-top: 1.25rem;
}
.pagelinks a {
  display: block;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.95rem 1.15rem;
}
.pagelinks a:hover { border-color: var(--accent); }
.pagelinks strong { display: block; color: var(--accent); margin-bottom: 0.15rem; }
.pagelinks span   { display: block; color: var(--text-dim); font-size: 0.875rem; }

.noscript {
  background: var(--err-bg);
  border: 1px solid var(--err);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  color: var(--err);
  font-size: 0.9375rem;
}

/* base.css only styles lists inside .prose; sections here use bare <ul>/<ol> */
main ul, main ol { padding-left: 1.25em; margin: 0 0 1.1em; }
main li { margin-bottom: 0.4em; }
