/* Word Counter Tools — light, modern UI for the writing tools. */
.wct-tool, .wct-tools-grid, .wct-related {
  --wct-blue: #2563eb; --wct-blue-dark: #1d4ed8; --wct-blue-soft: #e8f0ff; --wct-violet: #7c3aed;
  --wct-text: #1e293b; --wct-muted: #64748b; --wct-line: #e6eaf2; --wct-line-2: #d5dce8;
  --wct-bg-soft: #f8fafc; --wct-radius: 18px;
  --wct-shadow: 0 1px 2px rgba(15,23,42,.04), 0 18px 48px -24px rgba(37,99,235,.28);
  color: var(--wct-text);
}
.wct-tool *, .wct-tools-grid * { box-sizing: border-box; }

/* Layout */
.wct-tool { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: 20px; align-items: start; position: relative; text-align: left; }
.wct-card { background: #fff; border: 1px solid var(--wct-line); border-radius: var(--wct-radius); box-shadow: var(--wct-shadow); }
.wct-editor-card { overflow: hidden; }

/* Stats */
.wct-stats { display: grid; grid-template-columns: repeat(5,1fr); border-bottom: 1px solid var(--wct-line); background: linear-gradient(180deg,#fff,#fbfcff); }
.wct-stat { padding: 16px 8px 14px; text-align: center; border-right: 1px solid var(--wct-line); }
.wct-stat:last-child { border-right: 0; }
.wct-stat b { display: block; font-size: 1.7rem; line-height: 1.15; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -.02em; color: var(--wct-text); }
.wct-stat span { display: block; margin-top: 3px; font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--wct-muted); }
.wct-stat--words b { background: linear-gradient(120deg,var(--wct-blue),var(--wct-violet)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Toolbar */
.wct-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--wct-line); background: #fff; }
.wct-spacer { flex: 1; }
.wct-btn { display: inline-flex; align-items: center; gap: 7px; font-family: inherit; font-size: .86rem; font-weight: 600; line-height: 1; color: var(--wct-text); background: #fff; border: 1px solid var(--wct-line-2); border-radius: 10px; padding: 8px 12px; cursor: pointer; transition: background .15s, border-color .15s, color .15s; white-space: nowrap; }
.wct-btn:hover { background: var(--wct-bg-soft); border-color: #bcc6d6; }
.wct-btn--soft { background: var(--wct-blue-soft); border-color: #cfdcfb; color: var(--wct-blue-dark); }
.wct-btn--soft:hover { background: #dce8ff; border-color: #b7cbf7; }
.wct-btn:focus-visible, .wct-input:focus-visible, .wct-link:focus-visible, .wct-tool-card:focus-visible { outline: 3px solid #a5c0fb; outline-offset: 2px; }
.wct-private { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--wct-muted); }

/* Status line (file import) */
.wct-status { padding: 9px 16px; font-size: .88rem; border-bottom: 1px solid var(--wct-line); }
.wct-status--info { background: #f5f8ff; color: #334155; }
.wct-status--ok { background: #effaf4; color: #14532d; }
.wct-status--error { background: #fff4f2; color: #9a3412; }
.wct-link { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--wct-blue); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

/* Editor */
.wct-input-wrap { position: relative; }
.wct-input { display: block; width: 100%; min-height: 360px; resize: vertical; border: 0; margin: 0; padding: 20px 22px; font-family: inherit; font-size: 1.04rem; font-weight: 400; line-height: 1.75; color: var(--wct-text); background: #fff; }
.wct-input:focus { outline: none; box-shadow: inset 0 0 0 2px #dbe6fe; }
.wct-input::placeholder { color: #94a3b8; }
.wct-drop { position: absolute; inset: 8px; display: none; place-items: center; text-align: center; border: 2px dashed #8fb0f6; border-radius: 14px; background: rgba(239,245,255,.94); color: var(--wct-blue-dark); pointer-events: none; }
.wct-drop div { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.wct-drop span { color: var(--wct-muted); font-size: .88rem; }
.is-drag .wct-drop { display: grid; }

/* Side panels */
.wct-side { display: flex; flex-direction: column; gap: 16px; }
.wct-panel { padding: 16px 18px; box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.wct-panel-title { font-size: .76rem !important; font-weight: 750; text-transform: uppercase; letter-spacing: .09em; color: var(--wct-muted); margin: 0 0 8px !important; }
.wct-kv { list-style: none; margin: 0; padding: 0; }
.wct-kv li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--wct-line); font-size: .92rem; margin: 0; }
.wct-kv li:last-child { border-bottom: 0; }
.wct-kv b { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.wct-muted { color: var(--wct-muted); font-size: .88rem; margin: 0; }
.wct-kw-row { display: grid; grid-template-columns: 1fr auto 52px; gap: 8px; align-items: center; padding: 5px 0 3px; font-size: .9rem; }
.wct-kw-word { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wct-kw-pct { color: var(--wct-muted); text-align: right; font-variant-numeric: tabular-nums; }
.wct-kw-bar { grid-column: 1 / -1; height: 5px; border-radius: 5px; background: #f1f5f9; overflow: hidden; }
.wct-kw-bar i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg,#93b4fa,#b9a2f5); }
.wct-check { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: .84rem; color: var(--wct-muted); cursor: pointer; }
.wct-check input { accent-color: var(--wct-blue); }

/* Toast (light) */
.wct-toast { position: fixed; left: 50%; bottom: 24px; z-index: 50; transform: translate(-50%, 16px); background: #fff; color: var(--wct-text); border: 1px solid var(--wct-line); box-shadow: 0 12px 30px -10px rgba(15,23,42,.25); padding: 10px 16px; border-radius: 12px; font-size: .9rem; font-weight: 600; opacity: 0; pointer-events: none; transition: .2s; }
.wct-toast::before { content: "✓"; color: #16a34a; margin-right: 8px; }
.wct-toast.is-show { opacity: 1; transform: translate(-50%, 0); }

/* Tool cards */
.wct-tools-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }
.wct-tool-card { display: flex; flex-direction: column; gap: 8px; padding: 20px; background: #fff; border: 1px solid var(--wct-line); border-radius: 16px; color: var(--wct-text); text-decoration: none !important; transition: border-color .15s, box-shadow .15s, transform .15s; }
a.wct-tool-card:hover { border-color: #bcd0fb; box-shadow: 0 14px 30px -18px rgba(37,99,235,.35); transform: translateY(-2px); }
.wct-tool-card h3 { font-size: 1.02rem !important; margin: 6px 0 0 !important; line-height: 1.3; }
.wct-tool-card p { margin: 0 !important; color: var(--wct-muted); font-size: .9rem; line-height: 1.5; flex: 1; }
.wct-go { font-size: .86rem; font-weight: 700; color: var(--wct-blue); }
.wct-soon { align-self: flex-start; font-size: .74rem; font-weight: 700; color: var(--wct-muted); background: var(--wct-bg-soft); border: 1px solid var(--wct-line); border-radius: 999px; padding: 3px 9px; }
.wct-tool-card.is-soon { opacity: .85; }
.wct-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; }
.wct-hue-blue { background: #e8f0ff; color: #2563eb; }
.wct-hue-violet { background: #f1ebff; color: #7c3aed; }
.wct-hue-teal { background: #e3f7f4; color: #0f8f7e; }
.wct-hue-amber { background: #fff4e0; color: #c26a05; }
.wct-hue-rose { background: #ffecf0; color: #db2763; }
.wct-hue-green { background: #e8f8ec; color: #16a34a; }

/* Reserved ad slots (only rendered when enabled in settings) */
.wct-ad { min-height: var(--wct-ad-h, 90px); margin: 28px auto 0; max-width: 970px; display: block; }

.wct-hide-sm { display: inline; }

/* ---------- Tool pages ---------- */
.wct-stats--3 { grid-template-columns: repeat(3,1fr); }
.wct-stats--4 { grid-template-columns: repeat(4,1fr); }
.wct-stats--4 .wct-stat:first-child b, .wct-stats--3 .wct-stat:first-child b { background: linear-gradient(120deg,var(--wct-blue),var(--wct-violet)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.wct-stat b[data-out="top"] { font-size: 1.15rem; line-height: 1.6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wct-wide { grid-column: 1 / -1; min-width: 0; }
.wct-panel--wide { padding: 20px 22px; }
.wct-panel--accent { background: linear-gradient(180deg,#f7faff,#fff); }
.wct-hint { font-size: .84rem; color: var(--wct-muted); margin: 10px 0 0 !important; }
.wct-input--small { min-height: 160px; border: 1px solid var(--wct-line); border-radius: 12px; margin-top: 10px; }

/* Controls */
.wct-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-bottom: 14px; }
.wct-controls--center { justify-content: center; margin: 16px 0; }
.wct-seg { display: inline-flex; background: #f1f5f9; border-radius: 11px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.wct-seg button { border: 0; background: transparent; font: inherit; font-size: .86rem; font-weight: 650; color: #475569; padding: 7px 12px; border-radius: 9px; cursor: pointer; }
.wct-seg button small { font-weight: 600; color: var(--wct-muted); margin-left: 2px; }
.wct-seg button[aria-checked="true"] { background: #fff; color: var(--wct-blue-dark); box-shadow: 0 1px 3px rgba(15,23,42,.12); }
.wct-field { display: flex; flex-direction: column; gap: 5px; font-size: .84rem; font-weight: 650; color: #475569; margin-top: 12px; }
.wct-field--inline { flex-direction: row; align-items: center; gap: 8px; margin: 0; }
.wct-field input, .wct-field select { font: inherit; font-size: .95rem; font-weight: 500; color: var(--wct-text); background: #fff; border: 1px solid var(--wct-line-2); border-radius: 10px; padding: 9px 11px; min-width: 0; }
.wct-field input:focus, .wct-field select:focus { outline: none; border-color: #93b4fa; box-shadow: 0 0 0 3px #e3ecfe; }
.wct-field--inline input { width: 170px; }
.wct-form-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 0 14px; }
.wct-form-row--3 { grid-template-columns: repeat(3,1fr); }
.wct-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.wct-btn--primary { background: linear-gradient(135deg,#2563eb,#4f46e5); color: #fff; border-color: transparent; box-shadow: 0 8px 18px -10px rgba(37,99,235,.7); padding: 10px 18px; }
.wct-btn--primary:hover { background: linear-gradient(135deg,#1d4ed8,#4338ca); border-color: transparent; }
.wct-btn--ghost { background: transparent; }
.wct-btn:disabled { opacity: .45; cursor: default; }
.wct-big { font-size: 2.4rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; background: linear-gradient(120deg,var(--wct-blue),var(--wct-violet)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.wct-panel--accent .wct-muted { margin: 6px 0 14px; }

/* Meters, lists, bars */
.wct-limit { padding: 6px 0; }
.wct-limit-top { display: flex; justify-content: space-between; gap: 8px; font-size: .86rem; margin-bottom: 4px; }
.wct-limit-top b { font-variant-numeric: tabular-nums; font-weight: 650; color: #475569; }
.wct-meter { display: block; height: 6px; border-radius: 6px; background: #f1f5f9; overflow: hidden; }
.wct-meter i { display: block; height: 100%; width: 0; border-radius: 6px; background: linear-gradient(90deg,#93b4fa,#b9a2f5); transition: width .15s; }
.is-near .wct-meter i { background: #f5b84b; }
.is-over .wct-meter i { background: #f0766a; }
.is-over .wct-limit-top b { color: #c2410c; }
.wct-limits + .wct-field--inline { margin-top: 12px; }
.wct-list { margin: 0; padding: 0; list-style: none; counter-reset: wl; }
.wct-list li { padding: 8px 0; border-bottom: 1px dashed var(--wct-line); font-size: .88rem; line-height: 1.5; display: flex; gap: 8px; align-items: flex-start; }
.wct-list li:last-child { border-bottom: 0; }
.wct-badge { flex: none; font-size: .72rem; font-weight: 750; background: var(--wct-blue-soft); color: var(--wct-blue-dark); border-radius: 999px; padding: 2px 8px; margin-top: 1px; }
.is-long .wct-badge { background: #fff1e6; color: #c2410c; }
.wct-list-text { color: #334155; word-break: break-word; }
.wct-bar-row { display: grid; grid-template-columns: 38px 1fr 40px; gap: 8px; align-items: center; font-size: .82rem; padding: 3px 0; }
.wct-bar-row b { text-align: right; font-variant-numeric: tabular-nums; }
.wct-bar-label { color: var(--wct-muted); }
.wct-bar-row.is-long .wct-meter i { background: #f5b84b; }

/* Tables */
.wct-table-wrap { max-height: 460px; overflow: auto; border: 1px solid var(--wct-line); border-radius: 12px; }
.wct-table-wrap--tall { max-height: 560px; }
.wct-table { width: 100%; border-collapse: collapse; font-size: .92rem; margin: 0 !important; }
.wct-table th { position: sticky; top: 0; background: #f8fafc; text-align: left; font-weight: 700; color: #334155; padding: 10px 12px; border-bottom: 1px solid var(--wct-line); z-index: 1; }
.wct-table td { padding: 8px 12px; border-bottom: 1px solid #f1f4f9; }
.wct-table tr:last-child td { border-bottom: 0; }
.wct-table tbody tr:hover td { background: #fafcff; }
.wct-num { text-align: right; font-variant-numeric: tabular-nums; width: 1%; white-space: nowrap; }
.wct-table th:nth-child(n+3), .wct-table th:first-child { text-align: right; }
.wct-sort { background: none; border: 0; font: inherit; font-weight: 700; color: inherit; cursor: pointer; padding: 0; }
.wct-sort[aria-sort="descending"]::after { content: " ↓"; color: var(--wct-blue); }
.wct-sort[aria-sort="ascending"]::after { content: " ↑"; color: var(--wct-blue); }
.wct-focus { background: #f5f8ff; border: 1px solid #dfe8fb; border-radius: 10px; padding: 10px 14px; font-size: .92rem; font-weight: 600; margin: 0 0 14px !important; }

/* Random words */
.wct-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; min-height: 48px; }
.wct-chip { background: #fff; border: 1px solid #d9e3f7; border-radius: 12px; padding: 9px 16px; font-size: 1.05rem; font-weight: 650; color: var(--wct-text); box-shadow: 0 6px 14px -12px rgba(37,99,235,.6); }

/* Case converter */
.wct-case-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.wct-tips { margin: 0; padding-left: 1.1rem; font-size: .9rem; color: #334155; }
.wct-tips li { margin: 0 0 8px; }

/* Words per page */
.wct-result-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-top: 20px; }
.wct-result-grid div { background: linear-gradient(180deg,#f7faff,#fff); border: 1px solid #e3eafb; border-radius: 14px; padding: 16px; text-align: center; }
.wct-result-grid span { display: block; font-size: .78rem; font-weight: 750; text-transform: uppercase; letter-spacing: .07em; color: var(--wct-muted); }
.wct-result-grid b { display: block; font-size: 2rem; font-weight: 800; letter-spacing: -.02em; color: var(--wct-text); }
.wct-result-grid div:first-child b { background: linear-gradient(120deg,var(--wct-blue),var(--wct-violet)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.wct-more { margin-top: 16px; }
.wct-more summary { cursor: pointer; font-weight: 650; color: var(--wct-blue); font-size: .92rem; }

/* Text compare */
.wct-compare-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.wct-compare-box { overflow: hidden; }
.wct-compare-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--wct-line); font-weight: 700; font-size: .9rem; }
.wct-input--compare { min-height: 240px; }
.wct-compare-stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-bottom: 14px; }
.wct-compare-stats div { background: var(--wct-bg-soft); border: 1px solid var(--wct-line); border-radius: 12px; padding: 10px 12px; }
.wct-compare-stats span { display: block; font-size: .74rem; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; color: var(--wct-muted); }
.wct-compare-stats b { font-size: 1.35rem; font-weight: 800; }
.wct-legend { display: flex; gap: 10px; font-size: .84rem; margin-bottom: 10px; }
.wct-diff { white-space: pre-wrap; word-break: break-word; line-height: 1.8; font-size: 1rem; background: #fff; border: 1px solid var(--wct-line); border-radius: 12px; padding: 16px 18px; max-height: 560px; overflow: auto; }
.wct-ins, .wct-diff ins { background: #dcfce7; color: #14532d; text-decoration: none; border-radius: 4px; padding: 1px 2px; }
.wct-del, .wct-diff del { background: #fee2e2; color: #991b1b; text-decoration: line-through; border-radius: 4px; padding: 1px 2px; }
.wct-diff .wct-status { margin: 0 0 10px; border-radius: 8px; border: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .wct-tool { grid-template-columns: 1fr; }
  .wct-side { display: grid; grid-template-columns: 1fr 1fr; }
  .wct-tools-grid { grid-template-columns: repeat(3,1fr); }
}
@media (max-width: 760px) {
  .wct-stats:not([class*="wct-stats--"]) { grid-template-columns: repeat(3,1fr); }
  .wct-stats:not([class*="wct-stats--"]) .wct-stat { border-bottom: 1px solid var(--wct-line); }
  .wct-stats:not([class*="wct-stats--"]) .wct-stat:nth-child(3) { border-right: 0; }
  .wct-stats:not([class*="wct-stats--"]) .wct-stat:nth-child(4), .wct-stats:not([class*="wct-stats--"]) .wct-stat:nth-child(5) { border-bottom: 0; }
  .wct-stats:not([class*="wct-stats--"]) .wct-stat:nth-child(5) { grid-column: span 2; }
  .wct-stats--4 { grid-template-columns: repeat(2,1fr); }
  .wct-stats--4 .wct-stat:nth-child(2) { border-right: 0; }
  .wct-stats--4 .wct-stat:nth-child(-n+2) { border-bottom: 1px solid var(--wct-line); }
  .wct-stat b { font-size: 1.45rem; }
  .wct-form-row, .wct-form-row--3 { grid-template-columns: 1fr 1fr; }
  .wct-compare-inputs { grid-template-columns: 1fr; }
  .wct-result-grid { grid-template-columns: 1fr; }
  .wct-compare-stats { grid-template-columns: 1fr 1fr; }
  .wct-case-btns .wct-btn { flex: 1 1 calc(50% - 8px); justify-content: center; }
  .wct-toolbar .wct-btn { flex: 1 1 calc(50% - 8px); justify-content: center; }
  .wct-private { display: none; }
  .wct-hide-sm { display: none; }
  .wct-side { grid-template-columns: 1fr; }
  .wct-input { min-height: 260px; padding: 16px; }
  .wct-tools-grid { grid-template-columns: repeat(2,1fr); gap: 12px; }
  .wct-tool-card { padding: 16px; }
  .wct-ad { min-height: var(--wct-ad-hm, 100px); }
}
@media (max-width: 440px) { .wct-tools-grid { grid-template-columns: 1fr; } .wct-form-row, .wct-form-row--3 { grid-template-columns: 1fr; } .wct-field--inline { flex-wrap: wrap; } .wct-field--inline input { width: 100%; } }
@media (prefers-reduced-motion: reduce) { .wct-tool *, .wct-tool-card { transition: none !important; } }


/* Contact form */
.wct-contact { background: #fff; border: 1px solid var(--wct-line, #e6eaf2); border-radius: 18px; padding: 22px 24px; box-shadow: 0 18px 48px -28px rgba(37,99,235,.35); color: #1e293b; --wct-blue: #2563eb; --wct-blue-dark: #1d4ed8; --wct-violet: #7c3aed; --wct-text: #1e293b; --wct-muted: #64748b; --wct-line: #e6eaf2; --wct-line-2: #d5dce8; --wct-bg-soft: #f8fafc; }
.wct-contact .wct-field { margin-top: 0; margin-bottom: 14px; }
.wct-contact textarea { font: inherit; font-size: .95rem; color: var(--wct-text); border: 1px solid var(--wct-line-2); border-radius: 10px; padding: 10px 12px; resize: vertical; min-height: 140px; }
.wct-contact textarea:focus { outline: none; border-color: #93b4fa; box-shadow: 0 0 0 3px #e3ecfe; }
.wct-contact-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.wct-contact-note { font-size: .86rem; color: var(--wct-muted); margin: 0 0 14px !important; }
.wct-contact-actions { display: flex; justify-content: flex-start; }
.wct-contact-status { margin-top: 14px; border-radius: 10px; }
.wct-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 600px) { .wct-contact { padding: 18px; } .wct-contact-row { grid-template-columns: 1fr; } }

/* Cookie choice card */
.wct-cookie-choice { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; background: linear-gradient(180deg,#f7faff,#fff); border: 1px solid #dfe8fb; border-radius: 14px; padding: 16px 18px; margin: 1.2rem 0 !important; }
.wct-cookie-choice strong { display: block; color: #0f172a; }
.wct-cookie-choice span { display: block; color: #64748b; font-size: .9rem; }
.wct-cookie-choice button { font: inherit; font-weight: 700; font-size: .9rem; color: #1d4ed8; background: #e8f0ff; border: 1px solid #cfdcfb; border-radius: 10px; padding: 9px 16px; cursor: pointer; white-space: nowrap; }
.wct-cookie-choice button:hover { background: #dce8ff; }
