/* ToolGuest — Word & Character Counter component styles.
 *
 * One stylesheet for the flagship /word-counter and the ten specialised
 * counter pages. Every rule is prefixed .wc- or scoped to a .wc- ancestor, so
 * the pages load this file instead of the Tailwind bundle and stay under the
 * 50ms render budget. Dark mode is handled for all three site conventions:
 * html.dark, html[data-theme="dark"] and body.dark.
 */

:root {
  --wc-bg: #ffffff;
  --wc-fg: #09090b;
  --wc-muted: #52525b;
  --wc-soft: #f4f4f5;
  --wc-line: rgba(9, 9, 11, .10);
  --wc-card: #ffffff;
  --wc-accent: #4f46e5;
  --wc-accent-2: #7c3aed;
  --wc-ok: #059669;
  --wc-warn: #b45309;
  --wc-over: #dc2626;
  --wc-radius: 20px;
}

html.dark,
html[data-theme="dark"],
body.dark {
  --wc-bg: #08080a;
  --wc-fg: #fafafa;
  --wc-muted: #a1a1aa;
  --wc-soft: rgba(255, 255, 255, .045);
  --wc-line: rgba(255, 255, 255, .10);
  --wc-card: #0c0c10;
  --wc-accent: #818cf8;
  --wc-accent-2: #a78bfa;
  --wc-ok: #34d399;
  --wc-warn: #fbbf24;
  --wc-over: #fb7185;
}

html, body { background: var(--wc-bg); }
.wc-page { color: var(--wc-fg); background: var(--wc-bg); -webkit-font-smoothing: antialiased; }
.wc-page ::selection { background: var(--wc-accent); color: #fff; }
.wc-shell { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.wc-page a { color: inherit; }

/* ── Header ───────────────────────────────────────────────────────────── */
.wc-head {
  position: sticky; top: 0; z-index: 40;
  border-bottom: 1px solid var(--wc-line);
  background: color-mix(in srgb, var(--wc-bg) 78%, transparent);
  backdrop-filter: blur(14px);
}
.wc-head__in { display: flex; align-items: center; gap: 10px; height: 56px; }
.wc-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: -.01em; text-decoration: none; }
.wc-brand img { height: 26px; width: auto; }
.wc-crumbs { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--wc-muted); min-width: 0; }
.wc-crumbs a { text-decoration: none; }
.wc-crumbs a:hover { color: var(--wc-fg); }
.wc-crumbs span[aria-current] { color: var(--wc-fg); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wc-head__tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.wc-live {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px;
  border-radius: 999px; font-size: 11px; font-weight: 700;
  color: var(--wc-ok); background: color-mix(in srgb, var(--wc-ok) 12%, transparent);
}
.wc-live i { width: 7px; height: 7px; border-radius: 999px; background: var(--wc-ok); }
.wc-theme {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  border: 1px solid var(--wc-line); background: transparent; color: var(--wc-muted); cursor: pointer;
}
.wc-theme:hover { color: var(--wc-fg); background: var(--wc-soft); }
.wc-theme svg { width: 16px; height: 16px; }
html.dark .wc-theme .wc-sun, html[data-theme="dark"] .wc-theme .wc-sun, body.dark .wc-theme .wc-sun { display: none; }
html:not(.dark) .wc-theme .wc-moon, html[data-theme="light"] .wc-theme .wc-moon { display: none; }

/* ── Hero ─────────────────────────────────────────────────────────────── */
.wc-hero { position: relative; overflow: hidden; }
.wc-hero::before {
  content: ""; position: absolute; inset: -30% -10% auto -10%; height: 560px; pointer-events: none;
  background:
    radial-gradient(45% 55% at 22% 20%, color-mix(in srgb, var(--wc-accent) 26%, transparent), transparent 70%),
    radial-gradient(40% 50% at 78% 12%, color-mix(in srgb, var(--wc-accent-2) 20%, transparent), transparent 70%);
  filter: blur(28px);
}
.wc-hero__in { position: relative; padding: 46px 0 26px; text-align: center; }
.wc-pill {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 18px;
  padding: 6px 14px; border-radius: 999px; border: 1px solid var(--wc-line);
  background: color-mix(in srgb, var(--wc-bg) 70%, transparent);
  font-size: 12px; font-weight: 600; color: var(--wc-muted);
}
.wc-pill i { width: 6px; height: 6px; border-radius: 999px; background: var(--wc-accent); }
.wc-page h1 {
  margin: 0; font-size: clamp(2rem, 5.2vw, 3.5rem); line-height: 1.06;
  font-weight: 850; letter-spacing: -.032em; text-wrap: balance;
}
.wc-page h1 em {
  font-style: normal;
  background: linear-gradient(90deg, var(--wc-accent), var(--wc-accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.wc-lead {
  max-width: 680px; margin: 18px auto 0; font-size: 16.5px; line-height: 1.62;
  color: var(--wc-muted); text-wrap: pretty;
}
.wc-lead strong { color: var(--wc-fg); font-weight: 650; }
.wc-trust {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: 10px 20px; margin-top: 20px; font-size: 12.5px; color: var(--wc-muted);
}
.wc-trust b { color: var(--wc-fg); }

/* ── Tool shell ───────────────────────────────────────────────────────── */
.wc-tool { position: relative; padding-bottom: 18px; }
.wc-glass {
  border: 1px solid var(--wc-line); border-radius: 26px; padding: 14px;
  background: color-mix(in srgb, var(--wc-card) 92%, transparent);
  box-shadow: 0 20px 60px -30px rgba(9, 9, 11, .30);
}

/* Primary stat cards */
.wc-hero-stats { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 700px) { .wc-hero-stats { grid-template-columns: repeat(3, 1fr); } }
.wc-stat {
  border: 1px solid var(--wc-line); border-radius: 16px; padding: 16px 18px;
  background: var(--wc-soft);
}
.wc-stat__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wc-stat__label {
  font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: var(--wc-muted);
}
.wc-stat__tag {
  font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  color: var(--wc-accent); background: color-mix(in srgb, var(--wc-accent) 12%, transparent);
}
.wc-stat__value {
  margin-top: 8px; font-size: clamp(1.7rem, 4vw, 2.3rem); font-weight: 800;
  letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.1;
}
.wc-stat__sub { margin-top: 5px; font-size: 11.5px; color: var(--wc-muted); }
.wc-stat--primary {
  border-color: transparent; color: #fff;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  box-shadow: 0 18px 40px -18px rgba(79, 70, 229, .55);
}
.wc-stat--primary .wc-stat__label { color: rgba(255, 255, 255, .78); }
.wc-stat--primary .wc-stat__sub { color: rgba(255, 255, 255, .78); }
.wc-stat--primary .wc-stat__tag { color: #fff; background: rgba(255, 255, 255, .18); }

/* Secondary stats */
.wc-sub-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; margin-top: 10px; }
@media (min-width: 640px) { .wc-sub-stats { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .wc-sub-stats { grid-template-columns: repeat(6, 1fr); } }
.wc-mini {
  border: 1px solid var(--wc-line); border-radius: 12px; padding: 10px 12px; background: var(--wc-soft);
}
.wc-mini__label {
  font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--wc-muted);
}
.wc-mini__value { margin-top: 3px; font-size: 17px; font-weight: 750; font-variant-numeric: tabular-nums; }

/* ── Platform limit gauges ────────────────────────────────────────────── */
.wc-gauges { margin-top: 12px; border: 1px solid var(--wc-line); border-radius: 16px; padding: 14px 16px; }
.wc-gauges__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.wc-gauges__title { font-size: 13px; font-weight: 750; letter-spacing: -.01em; }
.wc-gauges__note { font-size: 11px; color: var(--wc-muted); }
.wc-gauge-list { display: grid; gap: 11px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .wc-gauge-list { grid-template-columns: 1fr 1fr; } }
.wc-gauge__top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.wc-gauge__name { font-size: 12.5px; font-weight: 600; }
.wc-gauge__val { font-size: 11.5px; color: var(--wc-muted); font-variant-numeric: tabular-nums; }
.wc-gauge__val b { color: var(--wc-fg); font-weight: 700; }
.wc-gauge__bar {
  margin-top: 5px; height: 6px; border-radius: 999px; overflow: hidden;
  background: color-mix(in srgb, var(--wc-fg) 9%, transparent);
}
.wc-gauge__bar i {
  display: block; height: 100%; width: 0; border-radius: 999px;
  background: var(--wc-ok); transition: width .18s linear, background-color .18s linear;
}
.wc-gauge__hint { margin: 4px 0 0; font-size: 11px; color: var(--wc-muted); }
.wc-gauge.is-warn .wc-gauge__bar i { background: var(--wc-warn); }
.wc-gauge.is-over .wc-gauge__bar i { background: var(--wc-over); }
.wc-gauge.is-over .wc-gauge__val { color: var(--wc-over); font-weight: 700; }
.wc-gauge.is-over .wc-gauge__val b { color: var(--wc-over); }

/* ── Workflow bar ─────────────────────────────────────────────────────── */
.wc-flow {
  margin-top: 12px; border: 1px dashed color-mix(in srgb, var(--wc-accent) 42%, transparent);
  border-radius: 16px; padding: 12px 14px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--wc-accent) 8%, transparent), transparent);
}
.wc-flow__title {
  font-size: 11px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase;
  color: var(--wc-accent); margin: 0 0 8px;
}
.wc-flow__list { display: flex; flex-wrap: wrap; gap: 8px; }
.wc-flow__link {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px;
  border: 1px solid var(--wc-line); background: var(--wc-card);
  font-size: 12.5px; font-weight: 600; text-decoration: none;
  transition: border-color .15s ease, transform .15s ease;
}
.wc-flow__link:hover { border-color: var(--wc-accent); transform: translateY(-1px); }
.wc-flow__link span { color: var(--wc-muted); font-weight: 500; }

/* ── Editor + frequency panel ─────────────────────────────────────────── */
.wc-main { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 12px; }
@media (min-width: 980px) { .wc-main { grid-template-columns: 3fr 2fr; } }
.wc-editor-wrap {
  display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--wc-line); border-radius: 16px; background: var(--wc-card);
}
.wc-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
  padding: 7px 8px; border-bottom: 1px solid var(--wc-line);
}
.wc-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 9px;
  border: 0; background: transparent; cursor: pointer;
  font: inherit; font-size: 12.5px; font-weight: 600; color: var(--wc-muted);
}
.wc-btn:hover { background: var(--wc-soft); color: var(--wc-fg); }
.wc-btn svg { width: 14px; height: 14px; }
.wc-btn--accent { color: var(--wc-accent); }
.wc-btn--danger { color: var(--wc-over); margin-left: auto; }
.wc-btn--danger:hover { background: color-mix(in srgb, var(--wc-over) 12%, transparent); }
.wc-editor {
  flex: 1; width: 100%; min-height: 300px; resize: vertical;
  padding: 16px 18px; border: 0; outline: none; background: transparent;
  font: inherit; font-size: 15px; line-height: 1.72; color: var(--wc-fg);
  field-sizing: content;
}
.wc-editor::placeholder { color: color-mix(in srgb, var(--wc-muted) 75%, transparent); }
.wc-editor-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 12px; border-top: 1px solid var(--wc-line);
  font-size: 11px; color: var(--wc-muted);
}
.wc-editor-foot svg { width: 12px; height: 12px; vertical-align: -2px; }
.wc-kbd {
  border: 1px solid var(--wc-line); border-radius: 5px; padding: 1px 5px;
  font-family: ui-monospace, monospace; font-size: 10px;
}

.wc-freq {
  display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--wc-line); border-radius: 16px; background: var(--wc-card);
}
.wc-freq__head { padding: 12px 14px 8px; }
.wc-freq__title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.wc-freq__title { margin: 0; font-size: 13px; font-weight: 750; }
.wc-freq__badge { font-size: 10px; font-weight: 600; color: var(--wc-muted); }
.wc-tabs { display: flex; gap: 4px; padding: 3px; border-radius: 11px; background: var(--wc-soft); }
.wc-tab {
  flex: 1; padding: 6px 4px; border: 0; border-radius: 8px; cursor: pointer;
  background: transparent; font: inherit; font-size: 11.5px; font-weight: 650; color: var(--wc-muted);
}
.wc-tab[aria-selected="true"] { background: var(--wc-card); color: var(--wc-fg); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.wc-freq__list { flex: 1; padding: 4px 14px 14px; overflow-y: auto; max-height: 420px; }
.wc-freq__empty { padding: 40px 16px; text-align: center; font-size: 12.5px; line-height: 1.6; color: var(--wc-muted); }
.wc-freq__row + .wc-freq__row { margin-top: 10px; }
.wc-freq__row-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.wc-freq__word { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wc-freq__num { flex-shrink: 0; font-size: 11.5px; color: var(--wc-muted); font-variant-numeric: tabular-nums; }
.wc-freq__track { height: 6px; border-radius: 999px; overflow: hidden; background: color-mix(in srgb, var(--wc-fg) 8%, transparent); }
.wc-freq__fill {
  height: 100%; border-radius: 999px; width: 0;
  background: linear-gradient(90deg, var(--wc-accent), var(--wc-accent-2));
  transition: width .35s cubic-bezier(.22, 1, .36, 1);
}
.wc-privacy-note { margin: 12px 0 0; text-align: center; font-size: 11.5px; color: var(--wc-muted); }

/* ── Editorial / SEO-AEO-GEO blocks ───────────────────────────────────── */
.wc-prose { padding: 8px 0 64px; }
.wc-block { margin-top: 52px; }
.wc-block:first-child { margin-top: 34px; }
.wc-eyebrow {
  display: inline-block; margin-bottom: 8px; font-size: .72rem; font-weight: 800;
  letter-spacing: .16em; text-transform: uppercase; color: var(--wc-accent);
}
.wc-prose h2 {
  margin: 0; font-size: clamp(1.35rem, 3vw, 1.85rem); font-weight: 800;
  letter-spacing: -.026em; line-height: 1.18; text-wrap: balance;
}
.wc-prose h3 { margin: 0; font-size: 1rem; font-weight: 700; letter-spacing: -.012em; }
.wc-prose p { margin: 12px 0 0; font-size: .965rem; line-height: 1.78; color: var(--wc-muted); }
.wc-prose strong { color: var(--wc-fg); font-weight: 650; }
.wc-prose a { color: var(--wc-accent); text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--wc-accent) 38%, transparent); }
.wc-prose a:hover { border-bottom-color: var(--wc-accent); }
.wc-prose ul { margin: 12px 0 0; padding-left: 20px; }
.wc-prose li { margin-top: 7px; font-size: .965rem; line-height: 1.72; color: var(--wc-muted); }

.wc-answer {
  border: 1px solid color-mix(in srgb, var(--wc-accent) 32%, transparent);
  border-radius: 18px; padding: 20px 22px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--wc-accent) 10%, transparent), color-mix(in srgb, var(--wc-accent-2) 5%, transparent));
}
.wc-answer__label {
  display: inline-flex; align-items: center; gap: 6px; font-size: .72rem; font-weight: 800;
  letter-spacing: .13em; text-transform: uppercase; color: var(--wc-accent);
}
.wc-answer__label svg { width: 13px; height: 13px; }
.wc-answer h2 { font-size: 1.02rem; margin-top: 8px; }
.wc-answer p { margin-top: 7px; font-size: 1.01rem; line-height: 1.68; color: var(--wc-fg); }

.wc-grid { display: grid; gap: 14px; margin-top: 20px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .wc-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .wc-grid--3 { grid-template-columns: repeat(3, 1fr); } }
.wc-card {
  border: 1px solid var(--wc-line); border-radius: 16px; padding: 18px;
  background: color-mix(in srgb, var(--wc-card) 88%, transparent);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.wc-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--wc-accent) 45%, transparent); box-shadow: 0 16px 36px -22px rgba(79, 70, 229, .45); }
.wc-card p { margin-top: 7px; font-size: .9rem; }
.wc-step__num {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 9px;
  font-size: 12px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
}
.wc-step h3 { margin-top: 10px; }

.wc-tablewrap {
  margin-top: 20px; overflow-x: auto; border: 1px solid var(--wc-line);
  border-radius: 16px; background: color-mix(in srgb, var(--wc-card) 88%, transparent);
}
.wc-table { width: 100%; min-width: 600px; border-collapse: collapse; font-size: .89rem; text-align: left; }
.wc-table th, .wc-table td { padding: 12px 16px; border-bottom: 1px solid var(--wc-line); vertical-align: top; }
.wc-table tbody tr:last-child th, .wc-table tbody tr:last-child td { border-bottom: 0; }
.wc-table thead th {
  font-size: .69rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase;
  color: var(--wc-muted); white-space: nowrap;
}
.wc-table tbody th { font-weight: 600; color: var(--wc-fg); }
.wc-table td { color: var(--wc-muted); }
.wc-table code {
  font-family: ui-monospace, monospace; font-size: .88em; color: var(--wc-accent);
  background: color-mix(in srgb, var(--wc-accent) 10%, transparent);
  padding: .1em .4em; border-radius: .35em;
}
.wc-table .yes { color: var(--wc-ok); font-weight: 650; }
.wc-table .no { color: var(--wc-muted); }

.wc-faq { display: grid; gap: 10px; margin-top: 20px; }
.wc-faq details {
  border: 1px solid var(--wc-line); border-radius: 14px;
  background: color-mix(in srgb, var(--wc-card) 88%, transparent);
}
.wc-faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 15px 18px; cursor: pointer; list-style: none;
  font-size: .95rem; font-weight: 650; letter-spacing: -.01em;
}
.wc-faq summary::-webkit-details-marker { display: none; }
.wc-faq summary::after { content: "+"; font-size: 1.2rem; font-weight: 400; color: var(--wc-muted); }
.wc-faq details[open] summary::after { content: "\2013"; }
.wc-faq details > p { margin: 0; padding: 0 18px 15px; font-size: .92rem; line-height: 1.72; color: var(--wc-muted); }

/* ── Cluster grid ─────────────────────────────────────────────────────── */
.wc-cluster { display: grid; gap: 10px; margin-top: 20px; grid-template-columns: 1fr; }
@media (min-width: 620px) { .wc-cluster { grid-template-columns: 1fr 1fr; } }
@media (min-width: 980px) { .wc-cluster { grid-template-columns: repeat(3, 1fr); } }
.wc-cluster__link {
  display: block; padding: 14px 16px; border-radius: 14px; text-decoration: none;
  border: 1px solid var(--wc-line); background: color-mix(in srgb, var(--wc-card) 88%, transparent);
  transition: border-color .15s ease, transform .15s ease;
}
.wc-cluster__link:hover { border-color: var(--wc-accent); transform: translateY(-2px); }
.wc-cluster__link b { display: block; font-size: .93rem; font-weight: 700; letter-spacing: -.01em; }
.wc-cluster__link span { display: block; margin-top: 3px; font-size: .82rem; line-height: 1.5; color: var(--wc-muted); }
.wc-cluster__link[aria-current="page"] { border-color: color-mix(in srgb, var(--wc-accent) 55%, transparent); background: color-mix(in srgb, var(--wc-accent) 7%, transparent); }

/* ── Toast ────────────────────────────────────────────────────────────── */
.wc-toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 60; transform: translate(-50%, 12px);
  opacity: 0; pointer-events: none; transition: opacity .22s ease, transform .22s ease;
  display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 12px;
  background: #18181b; color: #fff; font-size: 13px; font-weight: 600;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .35);
}
html.dark .wc-toast, html[data-theme="dark"] .wc-toast, body.dark .wc-toast { background: #fafafa; color: #09090b; }
.wc-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.wc-toast svg { width: 15px; height: 15px; }

@media (prefers-reduced-motion: reduce) {
  .wc-card, .wc-cluster__link, .wc-flow__link { transition: none; }
  .wc-gauge__bar i, .wc-freq__fill { transition: none; }
}
