/* ============================================================================
   Case Converter — 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 — lime-green, measured against base.css surfaces (WCAG relative
   luminance):
     dark  #61ef79  12.73:1 on --bg   11.74:1 on --surface   13.17:1 on --bg-sunk
     light #287735   5.33:1 on --bg    5.56:1 on --surface    4.88:1 on --bg-sunk
   Both clear the 4.5:1 text floor on all three surfaces in both themes.
   ========================================================================= */
:root {
  --accent: #61ef79;
  --accent-dim: rgba(97, 239, 121, 0.14);
}
@media (prefers-color-scheme: light) {
  :root {
    --accent: #287735;
    --accent-dim: rgba(40, 119, 53, 0.10);
  }
}

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

/* ============================================================================
   The tool
   ========================================================================= */

.tool {
  background: var(--bg-sunk);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1rem, 3vw, 1.5rem);
  margin-bottom: 2.5rem;
}

#cc-input {
  min-height: 8rem;
  resize: vertical;
  font-family: var(--mono);
  font-size: 0.9375rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1rem;
  margin-top: 0.9rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--line);
}

.cc-counts {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--text-dim);
  font-feature-settings: "tnum" 1, "zero" 1;
}

.cc-rows {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.1rem;
}

.cc-row {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
}

.cc-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
}

.cc-row-label {
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.cc-copy {
  flex: 0 0 auto;
  padding: 0.3rem 0.65rem;
  font-size: 0.75rem;
  min-width: 4.75rem;
}

.cc-row-out {
  min-height: 1.5em;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--text);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  border-radius: var(--radius-sm);
}
.cc-row-out:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.cc-row-out:empty::before {
  content: "—";
  color: var(--text-faint);
}

/* off-screen textarea used only as the execCommand('copy') fallback target */
.cc-offscreen {
  position: fixed;
  top: -9999px;
  left: -9999px;
}

/* ============================================================================
   Article furniture — reference table, examples, FAQ links
   ========================================================================= */

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

.callout {
  background: var(--bg-sunk);
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1rem 1.1rem;
  margin: 0 0 1.2em;
  font-size: 0.9375rem;
  color: var(--text-dim);
}
.callout p:last-child { margin-bottom: 0; }
.callout strong { color: var(--text); }

.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;
}

td .mono, th .mono { white-space: nowrap; }
