/* Shared tool chrome, panels and buttons come from the existing Gnuplot tool. */
/* Keep the working area in view on laptop screens without reducing control sizes. */
.page-text-tool .tool-header { min-height: 4rem; }
.counter-main { width: min(100% - 3rem, 1180px); min-height: 0; padding-block: 1rem 2rem; }
.counter-main .tool-heading { align-items: center; }
.counter-main .tool-heading h1 { margin-bottom: .5rem; padding-bottom: .5rem; font-size: 2rem; }
.counter-main .page-intro { margin: 0; font-size: 1rem; line-height: 1.5; }
.counter-main .privacy-note { margin: 0; }
.counter-main .tool-panel { padding: 1.15rem; }
.counter-main .panel-heading { margin-bottom: .75rem; }
.counter-main .result-panel { position: static; }
.counter-workspace { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(310px, .9fr); gap: 1.25rem; margin-top: 1rem; align-items: start; }
.editor-actions { display: flex; gap: .5rem; }
.button:disabled { color: #87929b; cursor: default; }
#text-input { display: block; width: 100%; min-height: 250px; height: clamp(250px, calc(100svh - 345px), 400px); padding: 1rem; resize: vertical; color: var(--color-ink); border: 1px solid #c3cdd5; border-radius: .3rem; background: #fff; font: inherit; line-height: 1.9; }
#text-input::placeholder { color: #78848e; }
.editor-footnote { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .2rem .8rem; margin-top: .8rem; color: var(--color-muted); font-size: .78rem; }
.editor-footnote p { margin: 0; }
#action-status { color: var(--tool-blue); }
.count-list { margin: 0; }
.count-list > div { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .45rem 0; border-bottom: 1px solid var(--color-line); }
.count-list > div:first-child { padding-top: .25rem; }
.count-list dt { font-size: .875rem; font-weight: 600; line-height: 1.45; }
.count-list small { display: block; color: var(--color-muted); font-size: .78rem; font-weight: 400; line-height: 1.45; margin-top: .15rem; }
.count-list dd { margin: 0; color: var(--tool-blue); font-size: 1.65rem; line-height: 1.2; font-weight: 600; font-variant-numeric: tabular-nums; }
.count-list .secondary-count { border: 0; padding-bottom: .3rem; }
.secondary-count dt { color: var(--color-muted); font-weight: 400; }
.secondary-count dd { color: var(--color-muted); font-size: 1rem; }
.limit-settings { margin-top: .75rem; padding-top: .8rem; border-top: 1px solid var(--color-line); }
summary { color: var(--color-muted); font-size: .875rem; cursor: pointer; }
.limit-fields { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: .65rem; margin-top: .65rem; }
.limit-field { display: flex; min-width: 0; flex-direction: column; gap: .3rem; }
.limit-fields label { color: #344555; font-size: .875rem; font-weight: 700; }
.limit-fields input, .limit-fields select { width: 100%; min-width: 0; min-height: 2.7rem; margin-bottom: .3rem; padding: .48rem .65rem; color: var(--color-ink); border: 1px solid #c3cdd5; border-radius: .3rem; background: #fff; font: inherit; font-size: .875rem; }
.limit-status { margin: .8rem 0 0; color: var(--tool-blue); font-size: .875rem; font-variant-numeric: tabular-nums; }
.limit-status[data-state="over"], .limit-status[data-state="invalid"] { color: #9a3b35; }
.count-help { max-width: 780px; margin-top: 1.5rem; }
.count-help ul { padding-left: 1.3rem; color: var(--color-muted); font-size: .875rem; }
.count-help li { margin-bottom: .5rem; }
:where(textarea, input, select):focus-visible { outline: 3px solid var(--tool-focus); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
@media (max-width: 900px) {
  .counter-workspace { grid-template-columns: 1fr; }
  #text-input { min-height: 250px; height: 35vh; }
}
@media (max-width: 680px) {
  .counter-main { width: min(100% - 2rem, 1180px); }
  .counter-main .privacy-note { margin-top: .65rem; }
  .limit-fields input, .limit-fields select { font-size: 1rem; }
  .editor-panel .panel-heading { flex-wrap: wrap; }
}
