/*
 * 123TinyTools - Grammar Checker
 * Version: 1.1.1
 * All selectors scoped under .tia-gc-wrap
 */

/* ── TOKENS ──────────────────────────────────────────────────── */
.tia-gc-wrap {
  --gc-accent:        #5B8DEF;
  --gc-accent-h:      #4B7CF3;
  --gc-accent-rgb:    91,141,239;
  --gc-accent-light:  #EFF4FF;
  --gc-accent-border: #B8D0FF;
  --gc-accent-dark:   #3461E8;
  --gc-surface:       #FFFFFF;
  --gc-bg:            #F8FAFD;
  --gc-border:        #E4EAF4;
  --gc-border-s:      #CBD5E1;
  --gc-text:          #1E293B;
  --gc-body:          #475569;
  --gc-muted:         #64748B;
  --gc-r-sm:          6px;
  --gc-r-md:          10px;
  --gc-r-lg:          12px;
  --gc-r-xl:          22px;
  --gc-r-pill:        9999px;
  --gc-sh-card:       0 2px 20px rgba(0,0,0,.07), 0 1px 4px rgba(0,0,0,.04);
  --gc-sh-sm:         0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.06);
  --gc-sh-md:         0 4px 8px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.05);
  --gc-font-h:        'Plus Jakarta Sans', system-ui, sans-serif;
  --gc-font-b:        'Inter', system-ui, sans-serif;

  /* Error type colours */
  --gc-err-grammar-clr:     #DC2626;
  --gc-err-grammar-bg:      #FEF2F2;
  --gc-err-grammar-border:  #FECACA;
  --gc-err-spelling-clr:    #B45309;
  --gc-err-spelling-bg:     #FFFBEB;
  --gc-err-spelling-border: #FDE68A;
  --gc-err-style-clr:       #7C3AED;
  --gc-err-style-bg:        #F5F3FF;
  --gc-err-style-border:    #DDD6FE;
  --gc-err-punct-clr:       #475569;
  --gc-err-punct-bg:        #F8FAFC;
  --gc-err-punct-border:    #CBD5E1;

  font-family: var(--gc-font-b);
  color: var(--gc-text);
  padding: 24px 0 64px;
}

/* ── DARK MODE (all 7 signals) ───────────────────────────────── */
html[data-theme="dark"] .tia-gc-wrap,
html.wp-dark-mode-active .tia-gc-wrap,
body.wp-dark-mode-active .tia-gc-wrap,
body.kt-dark-mode .tia-gc-wrap,
body.dark-mode .tia-gc-wrap,
body[data-theme="dark"] .tia-gc-wrap,
.is-dark .tia-gc-wrap {
  --gc-surface:       #1E293B;
  --gc-bg:            #0F172A;
  --gc-border:        #334155;
  --gc-border-s:      #475569;
  --gc-text:          #F1F5F9;
  --gc-body:          #CBD5E1;
  --gc-muted:         #94A3B8;
  --gc-err-grammar-clr:     #FCA5A5;
  --gc-err-grammar-bg:      rgba(220,38,38,.15);
  --gc-err-grammar-border:  rgba(220,38,38,.3);
  --gc-err-spelling-clr:    #FCD34D;
  --gc-err-spelling-bg:     rgba(180,83,9,.15);
  --gc-err-spelling-border: rgba(180,83,9,.3);
  --gc-err-style-clr:       #C4B5FD;
  --gc-err-style-bg:        rgba(124,58,237,.15);
  --gc-err-style-border:    rgba(124,58,237,.3);
  --gc-err-punct-clr:       #94A3B8;
  --gc-err-punct-bg:        rgba(71,85,105,.2);
  --gc-err-punct-border:    rgba(71,85,105,.4);
}

/* ── HEADER ──────────────────────────────────────────────────── */
.tia-gc-wrap .tia-gc-header {
  margin-bottom: 20px;
}

.tia-gc-wrap .tia-gc-title {
  font-family: var(--gc-font-h);
  font-size: clamp(22px, 3.5vw, 28px);
  font-weight: 800;
  letter-spacing: -.5px;
  color: var(--gc-text);
  margin: 0 0 6px;
  line-height: 1.2;
}

.tia-gc-wrap .tia-gc-tagline {
  font-size: 14px;
  color: var(--gc-muted);
  line-height: 1.55;
  margin: 0 0 12px;
}

.tia-gc-wrap .tia-gc-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tia-gc-wrap .tia-gc-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 500;
  border-radius: var(--gc-r-pill);
  padding: 3px 10px;
  color: var(--gc-accent-dark);
  background: var(--gc-accent-light);
  border: 1px solid var(--gc-accent-border);
}

/* Badge: dark mode — --gc-accent-light not flipped; light bg jarring on dark surface */
html[data-theme="dark"] .tia-gc-wrap .tia-gc-badge,
html.wp-dark-mode-active .tia-gc-wrap .tia-gc-badge,
body.wp-dark-mode-active .tia-gc-wrap .tia-gc-badge,
body.kt-dark-mode .tia-gc-wrap .tia-gc-badge,
body.dark-mode .tia-gc-wrap .tia-gc-badge,
body[data-theme="dark"] .tia-gc-wrap .tia-gc-badge,
.is-dark .tia-gc-wrap .tia-gc-badge {
  background: rgba(91,141,239,.15);
  border-color: rgba(91,141,239,.30);
  color: #93BBFD;
}

/* ── PRIVACY NOTICE ──────────────────────────────────────────── */
.tia-gc-wrap .tia-gc-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--gc-body);
  background: #EFF4FF;
  border: 1px solid #B8D0FF;
  border-radius: var(--gc-r-md);
  padding: 10px 14px;
  margin-bottom: 20px;
  line-height: 1.5;
}

/* Dark mode: privacy notice always brand blue */
html[data-theme="dark"] .tia-gc-wrap .tia-gc-notice,
html.wp-dark-mode-active .tia-gc-wrap .tia-gc-notice,
body.wp-dark-mode-active .tia-gc-wrap .tia-gc-notice,
body.kt-dark-mode .tia-gc-wrap .tia-gc-notice,
body.dark-mode .tia-gc-wrap .tia-gc-notice,
body[data-theme="dark"] .tia-gc-wrap .tia-gc-notice,
.is-dark .tia-gc-wrap .tia-gc-notice {
  background: rgba(91,141,239,.12);
  border-color: rgba(91,141,239,.30);
  color: #CBD5E1;
}

/* ── CARDS ───────────────────────────────────────────────────── */
.tia-gc-wrap .tia-gc-card {
  background: var(--gc-surface);
  border-radius: var(--gc-r-xl);
  box-shadow: var(--gc-sh-card);
  overflow: hidden;
  margin-bottom: 16px;
}

.tia-gc-wrap .tia-gc-card--input {
  padding: 18px;
}

.tia-gc-wrap .tia-gc-card--results {
  padding: 20px;
}

/* ── INPUT BAR ───────────────────────────────────────────────── */
.tia-gc-wrap .tia-gc-input-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.tia-gc-wrap .tia-gc-input-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--gc-text);
}

.tia-gc-wrap .tia-gc-input-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── SELECT ──────────────────────────────────────────────────── */
.tia-gc-wrap .tia-gc-select {
  font-family: var(--gc-font-b);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--gc-text);
  background: var(--gc-bg);
  border: 1.5px solid var(--gc-border);
  border-radius: var(--gc-r-md);
  padding: 6px 28px 6px 10px;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  transition: border-color .15s, box-shadow .15s;
}

.tia-gc-wrap .tia-gc-select:focus {
  border-color: var(--gc-accent);
  box-shadow: 0 0 0 3px rgba(var(--gc-accent-rgb), .14);
  background-color: var(--gc-surface);
}

/* ── CHAR COUNT ──────────────────────────────────────────────── */
.tia-gc-wrap .tia-gc-charcount {
  font-size: 11.5px;
  color: var(--gc-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.tia-gc-wrap .tia-gc-charcount--warn { color: #D97706; }
.tia-gc-wrap .tia-gc-charcount--over { color: #DC2626; font-weight: 600; }

/* ── TEXTAREA ────────────────────────────────────────────────── */
.tia-gc-wrap .tia-gc-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 12px;
  font-family: var(--gc-font-b);
  font-size: 14px;
  line-height: 1.7;
  color: var(--gc-text);
  background: var(--gc-bg);
  border: 1.5px solid var(--gc-border);
  border-radius: var(--gc-r-md);
  outline: none;
  resize: none;
  transition: border-color .15s, box-shadow .15s;
}

.tia-gc-wrap .tia-gc-textarea:focus {
  border-color: var(--gc-accent);
  box-shadow: 0 0 0 3px rgba(var(--gc-accent-rgb), .14);
  background: var(--gc-surface);
}

.tia-gc-wrap .tia-gc-textarea::placeholder { color: var(--gc-muted); }

/* ── TOOLBAR ─────────────────────────────────────────────────── */
.tia-gc-wrap .tia-gc-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

/* ── BUTTONS ─────────────────────────────────────────────────── */
.tia-gc-wrap .tia-gc-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--gc-accent);
  color: #fff;
  border: none;
  border-radius: var(--gc-r-pill);
  padding: 11px 22px;
  font-family: var(--gc-font-b);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, transform .15s, box-shadow .15s;
  box-shadow: 0 2px 12px rgba(var(--gc-accent-rgb), .4);
  white-space: nowrap;
}

.tia-gc-wrap .tia-gc-btn-primary:hover:not(:disabled) {
  background: var(--gc-accent-h);
  transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(var(--gc-accent-rgb), .5);
}

.tia-gc-wrap .tia-gc-btn-primary:active { transform: translateY(0); }

.tia-gc-wrap .tia-gc-btn-primary:disabled {
  background: #CBD5E1;
  color: #64748B;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

/* Dark mode disabled */
html[data-theme="dark"] .tia-gc-wrap .tia-gc-btn-primary:disabled,
html.wp-dark-mode-active .tia-gc-wrap .tia-gc-btn-primary:disabled,
body.wp-dark-mode-active .tia-gc-wrap .tia-gc-btn-primary:disabled,
body.kt-dark-mode .tia-gc-wrap .tia-gc-btn-primary:disabled,
body.dark-mode .tia-gc-wrap .tia-gc-btn-primary:disabled,
body[data-theme="dark"] .tia-gc-wrap .tia-gc-btn-primary:disabled,
.is-dark .tia-gc-wrap .tia-gc-btn-primary:disabled {
  background: #334155;
  color: #475569;
}

.tia-gc-wrap .tia-gc-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--gc-surface);
  color: var(--gc-body);
  border: 1.5px solid var(--gc-border);
  border-radius: var(--gc-r-pill);
  padding: 9px 20px;
  font-family: var(--gc-font-b);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
  white-space: nowrap;
}

.tia-gc-wrap .tia-gc-btn-secondary:hover {
  border-color: var(--gc-accent-border);
  color: var(--gc-accent);
  background: var(--gc-accent-light);
}

/* Dark mode secondary hover */
html[data-theme="dark"] .tia-gc-wrap .tia-gc-btn-secondary:hover,
html.wp-dark-mode-active .tia-gc-wrap .tia-gc-btn-secondary:hover,
body.wp-dark-mode-active .tia-gc-wrap .tia-gc-btn-secondary:hover,
body.kt-dark-mode .tia-gc-wrap .tia-gc-btn-secondary:hover,
body.dark-mode .tia-gc-wrap .tia-gc-btn-secondary:hover,
body[data-theme="dark"] .tia-gc-wrap .tia-gc-btn-secondary:hover,
.is-dark .tia-gc-wrap .tia-gc-btn-secondary:hover {
  background: #334155;
  border-color: var(--gc-accent-border);
  color: var(--gc-accent);
}

.tia-gc-wrap .tia-gc-btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: var(--gc-muted);
  border: none;
  border-radius: var(--gc-r-md);
  padding: 6px 10px;
  font-family: var(--gc-font-b);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s;
  white-space: nowrap;
}

.tia-gc-wrap .tia-gc-btn-ghost:hover { background: var(--gc-bg); color: var(--gc-body); }

/* Dark mode ghost hover */
html[data-theme="dark"] .tia-gc-wrap .tia-gc-btn-ghost:hover,
html.wp-dark-mode-active .tia-gc-wrap .tia-gc-btn-ghost:hover,
body.wp-dark-mode-active .tia-gc-wrap .tia-gc-btn-ghost:hover,
body.kt-dark-mode .tia-gc-wrap .tia-gc-btn-ghost:hover,
body.dark-mode .tia-gc-wrap .tia-gc-btn-ghost:hover,
body[data-theme="dark"] .tia-gc-wrap .tia-gc-btn-ghost:hover,
.is-dark .tia-gc-wrap .tia-gc-btn-ghost:hover {
  background: #334155;
  color: #CBD5E1;
}

/* ── LOADING SPINNER ─────────────────────────────────────────── */
.tia-gc-wrap .tia-gc-spin {
  animation: tia-gc-spin 1s linear infinite;
}

@keyframes tia-gc-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ── STATS BAR ───────────────────────────────────────────────── */
.tia-gc-wrap .tia-gc-stats {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 16px;
  background: var(--gc-surface);
  border-radius: var(--gc-r-lg);
  box-shadow: var(--gc-sh-sm);
  padding: 14px 20px;
  margin-bottom: 16px;
}

.tia-gc-wrap .tia-gc-stat {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.tia-gc-wrap .tia-gc-stat-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--gc-muted);
}

.tia-gc-wrap .tia-gc-stat--total      { color: var(--gc-accent); }
.tia-gc-wrap .tia-gc-stat--grammar    { color: #DC2626; }
.tia-gc-wrap .tia-gc-stat--spelling   { color: #B45309; }
.tia-gc-wrap .tia-gc-stat--style      { color: #7C3AED; }
.tia-gc-wrap .tia-gc-stat-sep         { width: 1px; height: 20px; background: var(--gc-border); }

/* Dark mode stat colours (lighter for contrast) */
html[data-theme="dark"] .tia-gc-wrap .tia-gc-stat--grammar,
html.wp-dark-mode-active .tia-gc-wrap .tia-gc-stat--grammar,
body.wp-dark-mode-active .tia-gc-wrap .tia-gc-stat--grammar,
body.kt-dark-mode .tia-gc-wrap .tia-gc-stat--grammar,
body.dark-mode .tia-gc-wrap .tia-gc-stat--grammar,
body[data-theme="dark"] .tia-gc-wrap .tia-gc-stat--grammar,
.is-dark .tia-gc-wrap .tia-gc-stat--grammar { color: #FCA5A5; }

html[data-theme="dark"] .tia-gc-wrap .tia-gc-stat--spelling,
html.wp-dark-mode-active .tia-gc-wrap .tia-gc-stat--spelling,
body.wp-dark-mode-active .tia-gc-wrap .tia-gc-stat--spelling,
body.kt-dark-mode .tia-gc-wrap .tia-gc-stat--spelling,
body.dark-mode .tia-gc-wrap .tia-gc-stat--spelling,
body[data-theme="dark"] .tia-gc-wrap .tia-gc-stat--spelling,
.is-dark .tia-gc-wrap .tia-gc-stat--spelling { color: #FCD34D; }

html[data-theme="dark"] .tia-gc-wrap .tia-gc-stat--style,
html.wp-dark-mode-active .tia-gc-wrap .tia-gc-stat--style,
body.wp-dark-mode-active .tia-gc-wrap .tia-gc-stat--style,
body.kt-dark-mode .tia-gc-wrap .tia-gc-stat--style,
body.dark-mode .tia-gc-wrap .tia-gc-stat--style,
body[data-theme="dark"] .tia-gc-wrap .tia-gc-stat--style,
.is-dark .tia-gc-wrap .tia-gc-stat--style { color: #C4B5FD; }

/* ── RESULTS HEAD ────────────────────────────────────────────── */
.tia-gc-wrap .tia-gc-results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.tia-gc-wrap .tia-gc-results-title {
  font-family: var(--gc-font-h);
  font-size: 15px;
  font-weight: 700;
  color: var(--gc-text);
}

/* ── TEXT PREVIEW ────────────────────────────────────────────── */
.tia-gc-wrap .tia-gc-preview {
  font-family: var(--gc-font-b);
  font-size: 14px;
  line-height: 1.8;
  color: var(--gc-body);
  background: var(--gc-bg);
  border: 1.5px solid var(--gc-border);
  border-radius: var(--gc-r-md);
  padding: 14px;
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 16px;
  min-height: 60px;
}

/* Highlighted error marks in preview */
.tia-gc-wrap .tia-gc-err {
  cursor: pointer;
  border-radius: 2px;
  padding: 0 1px;
  text-decoration-line: underline;
  text-decoration-style: wavy;
  text-decoration-thickness: 2px;
  transition: background .15s;
  outline: none;
}

.tia-gc-wrap .tia-gc-err:focus-visible {
  box-shadow: 0 0 0 2px rgba(var(--gc-accent-rgb), .4);
  border-radius: 3px;
}

.tia-gc-wrap .tia-gc-err--grammar    { text-decoration-color: #EF4444; }
.tia-gc-wrap .tia-gc-err--spelling   { text-decoration-color: #D97706; }
.tia-gc-wrap .tia-gc-err--style      { text-decoration-color: #8B5CF6; }
.tia-gc-wrap .tia-gc-err--punctuation { text-decoration-color: #64748B; }
.tia-gc-wrap .tia-gc-err--other      { text-decoration-color: #5B8DEF; }

.tia-gc-wrap .tia-gc-err--grammar:hover,
.tia-gc-wrap .tia-gc-err--grammar.tia-gc-err--active   { background: rgba(239,68,68,.12); }
.tia-gc-wrap .tia-gc-err--spelling:hover,
.tia-gc-wrap .tia-gc-err--spelling.tia-gc-err--active  { background: rgba(217,119,6,.12); }
.tia-gc-wrap .tia-gc-err--style:hover,
.tia-gc-wrap .tia-gc-err--style.tia-gc-err--active     { background: rgba(139,92,246,.12); }
.tia-gc-wrap .tia-gc-err--punctuation:hover,
.tia-gc-wrap .tia-gc-err--punctuation.tia-gc-err--active { background: rgba(100,116,139,.12); }
.tia-gc-wrap .tia-gc-err--other:hover,
.tia-gc-wrap .tia-gc-err--other.tia-gc-err--active     { background: rgba(91,141,239,.12); }

/* ── LEGEND ──────────────────────────────────────────────────── */
.tia-gc-wrap .tia-gc-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.tia-gc-wrap .tia-gc-legend-item {
  font-size: 11.5px;
  font-weight: 500;
  padding: 2px 10px;
  border-radius: var(--gc-r-pill);
  border: 1px solid;
}

.tia-gc-wrap .tia-gc-legend-item--grammar    { color: var(--gc-err-grammar-clr);  background: var(--gc-err-grammar-bg);  border-color: var(--gc-err-grammar-border); }
.tia-gc-wrap .tia-gc-legend-item--spelling   { color: var(--gc-err-spelling-clr); background: var(--gc-err-spelling-bg); border-color: var(--gc-err-spelling-border); }
.tia-gc-wrap .tia-gc-legend-item--style      { color: var(--gc-err-style-clr);    background: var(--gc-err-style-bg);    border-color: var(--gc-err-style-border); }
.tia-gc-wrap .tia-gc-legend-item--punctuation { color: var(--gc-err-punct-clr);   background: var(--gc-err-punct-bg);    border-color: var(--gc-err-punct-border); }

/* ── ERROR LIST ──────────────────────────────────────────────── */
.tia-gc-wrap .tia-gc-error-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tia-gc-wrap .tia-gc-error-item {
  background: var(--gc-surface);
  border: 1.5px solid var(--gc-border);
  border-left: 4px solid var(--gc-border);
  border-radius: var(--gc-r-lg);
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}

.tia-gc-wrap .tia-gc-error-item:hover,
.tia-gc-wrap .tia-gc-error-item--active { box-shadow: var(--gc-sh-sm); }

.tia-gc-wrap .tia-gc-error-item--grammar    { border-left-color: #EF4444; }
.tia-gc-wrap .tia-gc-error-item--spelling   { border-left-color: #D97706; }
.tia-gc-wrap .tia-gc-error-item--style      { border-left-color: #8B5CF6; }
.tia-gc-wrap .tia-gc-error-item--punctuation { border-left-color: #64748B; }
.tia-gc-wrap .tia-gc-error-item--other      { border-left-color: #5B8DEF; }

.tia-gc-wrap .tia-gc-error-item--active { border-color: var(--gc-border-s); }

.tia-gc-wrap .tia-gc-error-header {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.tia-gc-wrap .tia-gc-error-type {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 2px 8px;
  border-radius: var(--gc-r-pill);
  flex-shrink: 0;
  border: 1px solid;
}

.tia-gc-wrap .tia-gc-error-type--grammar    { color: var(--gc-err-grammar-clr);  background: var(--gc-err-grammar-bg);  border-color: var(--gc-err-grammar-border); }
.tia-gc-wrap .tia-gc-error-type--spelling   { color: var(--gc-err-spelling-clr); background: var(--gc-err-spelling-bg); border-color: var(--gc-err-spelling-border); }
.tia-gc-wrap .tia-gc-error-type--style      { color: var(--gc-err-style-clr);    background: var(--gc-err-style-bg);    border-color: var(--gc-err-style-border); }
.tia-gc-wrap .tia-gc-error-type--punctuation { color: var(--gc-err-punct-clr);   background: var(--gc-err-punct-bg);    border-color: var(--gc-err-punct-border); }
.tia-gc-wrap .tia-gc-error-type--other      { color: var(--gc-accent-dark);      background: var(--gc-accent-light);    border-color: var(--gc-accent-border); }

.tia-gc-wrap .tia-gc-error-msg {
  font-size: 13.5px;
  color: var(--gc-body);
  line-height: 1.5;
}

/* Context snippet */
.tia-gc-wrap .tia-gc-error-ctx {
  font-size: 12.5px;
  color: var(--gc-muted);
  font-style: italic;
  margin-bottom: 10px;
  line-height: 1.6;
}

.tia-gc-wrap .tia-gc-ctx-err {
  background: rgba(239,68,68,.12);
  border-radius: 3px;
  padding: 0 2px;
  font-style: normal;
  color: var(--gc-body);
}

/* Dark mode context error highlight */
html[data-theme="dark"] .tia-gc-wrap .tia-gc-ctx-err,
html.wp-dark-mode-active .tia-gc-wrap .tia-gc-ctx-err,
body.wp-dark-mode-active .tia-gc-wrap .tia-gc-ctx-err,
body.kt-dark-mode .tia-gc-wrap .tia-gc-ctx-err,
body.dark-mode .tia-gc-wrap .tia-gc-ctx-err,
body[data-theme="dark"] .tia-gc-wrap .tia-gc-ctx-err,
.is-dark .tia-gc-wrap .tia-gc-ctx-err {
  background: rgba(239,68,68,.25);
}

/* Error action buttons */
.tia-gc-wrap .tia-gc-error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.tia-gc-wrap .tia-gc-fix-btn {
  display: inline-flex;
  align-items: center;
  background: var(--gc-accent-light);
  color: var(--gc-accent-dark);
  border: 1px solid var(--gc-accent-border);
  border-radius: var(--gc-r-pill);
  padding: 4px 12px;
  font-family: var(--gc-font-b);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  white-space: nowrap;
}

.tia-gc-wrap .tia-gc-fix-btn:hover {
  background: var(--gc-accent);
  border-color: var(--gc-accent);
  color: #fff;
}

/* Dark mode fix button */
html[data-theme="dark"] .tia-gc-wrap .tia-gc-fix-btn,
html.wp-dark-mode-active .tia-gc-wrap .tia-gc-fix-btn,
body.wp-dark-mode-active .tia-gc-wrap .tia-gc-fix-btn,
body.kt-dark-mode .tia-gc-wrap .tia-gc-fix-btn,
body.dark-mode .tia-gc-wrap .tia-gc-fix-btn,
body[data-theme="dark"] .tia-gc-wrap .tia-gc-fix-btn,
.is-dark .tia-gc-wrap .tia-gc-fix-btn {
  background: rgba(91,141,239,.15);
  color: #93BBFD;
  border-color: rgba(91,141,239,.3);
}

html[data-theme="dark"] .tia-gc-wrap .tia-gc-fix-btn:hover,
html.wp-dark-mode-active .tia-gc-wrap .tia-gc-fix-btn:hover,
body.wp-dark-mode-active .tia-gc-wrap .tia-gc-fix-btn:hover,
body.kt-dark-mode .tia-gc-wrap .tia-gc-fix-btn:hover,
body.dark-mode .tia-gc-wrap .tia-gc-fix-btn:hover,
body[data-theme="dark"] .tia-gc-wrap .tia-gc-fix-btn:hover,
.is-dark .tia-gc-wrap .tia-gc-fix-btn:hover {
  background: var(--gc-accent);
  border-color: var(--gc-accent);
  color: #fff;
}

.tia-gc-wrap .tia-gc-ignore-btn {
  background: none;
  color: var(--gc-muted);
  border: none;
  padding: 4px 8px;
  font-family: var(--gc-font-b);
  font-size: 12px;
  cursor: pointer;
  border-radius: var(--gc-r-sm);
  transition: background .15s, color .15s;
}

.tia-gc-wrap .tia-gc-ignore-btn:hover { background: var(--gc-bg); color: var(--gc-body); }

/* Dark mode ignore hover */
html[data-theme="dark"] .tia-gc-wrap .tia-gc-ignore-btn:hover,
html.wp-dark-mode-active .tia-gc-wrap .tia-gc-ignore-btn:hover,
body.wp-dark-mode-active .tia-gc-wrap .tia-gc-ignore-btn:hover,
body.kt-dark-mode .tia-gc-wrap .tia-gc-ignore-btn:hover,
body.dark-mode .tia-gc-wrap .tia-gc-ignore-btn:hover,
body[data-theme="dark"] .tia-gc-wrap .tia-gc-ignore-btn:hover,
.is-dark .tia-gc-wrap .tia-gc-ignore-btn:hover {
  background: #334155;
  color: #CBD5E1;
}

/* ── NO ERRORS STATE ─────────────────────────────────────────── */
.tia-gc-wrap .tia-gc-no-errors {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #DCFCE7;
  color: #15803D;
  border: 1px solid #BBF7D0;
  border-radius: var(--gc-r-md);
  padding: 16px 18px;
  font-size: 14px;
}

html[data-theme="dark"] .tia-gc-wrap .tia-gc-no-errors,
html.wp-dark-mode-active .tia-gc-wrap .tia-gc-no-errors,
body.wp-dark-mode-active .tia-gc-wrap .tia-gc-no-errors,
body.kt-dark-mode .tia-gc-wrap .tia-gc-no-errors,
body.dark-mode .tia-gc-wrap .tia-gc-no-errors,
body[data-theme="dark"] .tia-gc-wrap .tia-gc-no-errors,
.is-dark .tia-gc-wrap .tia-gc-no-errors {
  background: rgba(22,163,74,.15);
  color: #86EFAC;
  border-color: rgba(22,163,74,.3);
}

/* ── API ERROR ───────────────────────────────────────────────── */
.tia-gc-wrap .tia-gc-api-error {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #FEF2F2;
  color: #DC2626;
  border: 1px solid #FECACA;
  border-radius: var(--gc-r-md);
  padding: 14px 16px;
  font-size: 13.5px;
}

html[data-theme="dark"] .tia-gc-wrap .tia-gc-api-error,
html.wp-dark-mode-active .tia-gc-wrap .tia-gc-api-error,
body.wp-dark-mode-active .tia-gc-wrap .tia-gc-api-error,
body.kt-dark-mode .tia-gc-wrap .tia-gc-api-error,
body.dark-mode .tia-gc-wrap .tia-gc-api-error,
body[data-theme="dark"] .tia-gc-wrap .tia-gc-api-error,
.is-dark .tia-gc-wrap .tia-gc-api-error {
  background: rgba(220,38,38,.15);
  color: #FCA5A5;
  border-color: rgba(220,38,38,.3);
}

/* ── TOAST ───────────────────────────────────────────────────── */
.tia-gc-wrap .tia-gc-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: #1E293B;
  color: #F1F5F9;
  font-size: 13px;
  font-weight: 500;
  padding: 9px 18px;
  border-radius: var(--gc-r-pill);
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 9999;
  white-space: nowrap;
}

.tia-gc-wrap .tia-gc-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── LOGIN GATE ──────────────────────────────────────────────── */
.tia-gc-wrap .tia-gc-gate {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.55);
  backdrop-filter: blur(4px);
  z-index: 9990;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tia-gc-wrap .tia-gc-gate-modal {
  background: var(--gc-surface);
  border-radius: var(--gc-r-xl);
  box-shadow: 0 12px 40px rgba(0,0,0,.2);
  padding: 40px 36px;
  max-width: 420px;
  width: 90%;
  text-align: center;
}

.tia-gc-wrap .tia-gc-gate-icon {
  width: 56px;
  height: 56px;
  background: var(--gc-accent-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: var(--gc-accent);
}

.tia-gc-wrap .tia-gc-gate-title {
  font-family: var(--gc-font-h);
  font-size: 18px;
  font-weight: 800;
  color: var(--gc-text);
  margin: 0 0 8px;
}

.tia-gc-wrap .tia-gc-gate-sub {
  font-size: 14px;
  color: var(--gc-body);
  margin: 0 0 24px;
  line-height: 1.6;
}

.tia-gc-wrap .tia-gc-gate-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  background: var(--gc-accent);
  color: #fff;
  text-decoration: none;
  border-radius: var(--gc-r-pill);
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  transition: background .15s;
}

.tia-gc-wrap .tia-gc-gate-btn:hover { background: var(--gc-accent-h); }

.tia-gc-wrap .tia-gc-gate-link {
  display: block;
  font-size: 13px;
  color: var(--gc-muted);
  text-decoration: none;
}

.tia-gc-wrap .tia-gc-gate-link:hover { color: var(--gc-accent); }

/* ── SEO CONTENT BLOCK ───────────────────────────────────────── */
.tia-gc-wrap .tia-gc-seo-content {
  margin-top: 32px;
  padding: 28px;
  background: var(--gc-surface);
  border-radius: var(--gc-r-xl);
  box-shadow: var(--gc-sh-card);
}

.tia-gc-wrap .tia-gc-seo-content h2 {
  font-family: var(--gc-font-h);
  font-size: 20px;
  font-weight: 800;
  color: var(--gc-text);
  margin: 0 0 12px;
}

.tia-gc-wrap .tia-gc-seo-content h3 {
  font-family: var(--gc-font-h);
  font-size: 16px;
  font-weight: 700;
  color: var(--gc-text);
  margin: 24px 0 8px;
}

.tia-gc-wrap .tia-gc-seo-content p,
.tia-gc-wrap .tia-gc-seo-content li {
  font-size: 14px;
  color: var(--gc-body);
  line-height: 1.75;
  margin: 0 0 10px;
}

.tia-gc-wrap .tia-gc-seo-content ol,
.tia-gc-wrap .tia-gc-seo-content ul {
  padding-left: 20px;
  margin: 0 0 12px;
}

.tia-gc-wrap .tia-gc-seo-content a { color: var(--gc-accent); }

/* Dark mode SEO content */
html[data-theme="dark"] .tia-gc-wrap .tia-gc-seo-content h2,
html[data-theme="dark"] .tia-gc-wrap .tia-gc-seo-content h3,
html.wp-dark-mode-active .tia-gc-wrap .tia-gc-seo-content h2,
html.wp-dark-mode-active .tia-gc-wrap .tia-gc-seo-content h3,
body.wp-dark-mode-active .tia-gc-wrap .tia-gc-seo-content h2,
body.wp-dark-mode-active .tia-gc-wrap .tia-gc-seo-content h3,
body.kt-dark-mode .tia-gc-wrap .tia-gc-seo-content h2,
body.kt-dark-mode .tia-gc-wrap .tia-gc-seo-content h3,
body.dark-mode .tia-gc-wrap .tia-gc-seo-content h2,
body.dark-mode .tia-gc-wrap .tia-gc-seo-content h3,
body[data-theme="dark"] .tia-gc-wrap .tia-gc-seo-content h2,
body[data-theme="dark"] .tia-gc-wrap .tia-gc-seo-content h3,
.is-dark .tia-gc-wrap .tia-gc-seo-content h2,
.is-dark .tia-gc-wrap .tia-gc-seo-content h3 { color: #F1F5F9; }

html[data-theme="dark"] .tia-gc-wrap .tia-gc-seo-content p,
html[data-theme="dark"] .tia-gc-wrap .tia-gc-seo-content li,
html.wp-dark-mode-active .tia-gc-wrap .tia-gc-seo-content p,
html.wp-dark-mode-active .tia-gc-wrap .tia-gc-seo-content li,
body.wp-dark-mode-active .tia-gc-wrap .tia-gc-seo-content p,
body.wp-dark-mode-active .tia-gc-wrap .tia-gc-seo-content li,
body.kt-dark-mode .tia-gc-wrap .tia-gc-seo-content p,
body.kt-dark-mode .tia-gc-wrap .tia-gc-seo-content li,
body.dark-mode .tia-gc-wrap .tia-gc-seo-content p,
body.dark-mode .tia-gc-wrap .tia-gc-seo-content li,
body[data-theme="dark"] .tia-gc-wrap .tia-gc-seo-content p,
body[data-theme="dark"] .tia-gc-wrap .tia-gc-seo-content li,
.is-dark .tia-gc-wrap .tia-gc-seo-content p,
.is-dark .tia-gc-wrap .tia-gc-seo-content li { color: #CBD5E1; }

/* ── FAQ ─────────────────────────────────────────────────────── */
.tia-gc-wrap .tia-gc-faq-section {
  margin-top: 32px;
}

.tia-gc-wrap .tia-gc-faq-heading {
  font-family: var(--gc-font-h);
  font-size: 18px;
  font-weight: 800;
  color: var(--gc-text);
  margin: 0 0 16px;
}

.tia-gc-wrap .tia-gc-faq-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tia-gc-wrap .tia-gc-faq-item {
  background: var(--gc-surface);
  border: 1px solid var(--gc-border);
  border-radius: var(--gc-r-lg);
  overflow: hidden;
}

.tia-gc-wrap .tia-gc-faq-q {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--gc-text);
  cursor: pointer;
  list-style: none;
  transition: background .15s, color .15s;
}

.tia-gc-wrap .tia-gc-faq-q::-webkit-details-marker { display: none; }
.tia-gc-wrap .tia-gc-faq-q::after {
  content: '+';
  font-size: 18px;
  font-weight: 400;
  color: var(--gc-muted);
  flex-shrink: 0;
}

.tia-gc-wrap .tia-gc-faq-item[open] .tia-gc-faq-q::after { content: '−'; }

.tia-gc-wrap .tia-gc-faq-q:hover {
  background: var(--gc-accent-light);
  color: var(--gc-accent);
}

/* Dark mode FAQ summary */
html[data-theme="dark"] .tia-gc-wrap .tia-gc-faq-q,
html.wp-dark-mode-active .tia-gc-wrap .tia-gc-faq-q,
body.wp-dark-mode-active .tia-gc-wrap .tia-gc-faq-q,
body.kt-dark-mode .tia-gc-wrap .tia-gc-faq-q,
body.dark-mode .tia-gc-wrap .tia-gc-faq-q,
body[data-theme="dark"] .tia-gc-wrap .tia-gc-faq-q,
.is-dark .tia-gc-wrap .tia-gc-faq-q { color: #F1F5F9 !important; }
html[data-theme="dark"] .tia-gc-wrap .tia-gc-faq-q:hover,
html.wp-dark-mode-active .tia-gc-wrap .tia-gc-faq-q:hover,
body.wp-dark-mode-active .tia-gc-wrap .tia-gc-faq-q:hover,
body.kt-dark-mode .tia-gc-wrap .tia-gc-faq-q:hover,
body.dark-mode .tia-gc-wrap .tia-gc-faq-q:hover,
body[data-theme="dark"] .tia-gc-wrap .tia-gc-faq-q:hover,
.is-dark .tia-gc-wrap .tia-gc-faq-q:hover { background: rgba(91,141,239,.20) !important; color: #93BBFD !important; }

.tia-gc-wrap .tia-gc-faq-a {
  padding: 14px 18px 18px;
  font-size: 14px;
  color: var(--gc-body);
  line-height: 1.7;
  background: var(--gc-bg);
  border-top: 1px solid var(--gc-border);
}

/* Dark mode FAQ answer */
html[data-theme="dark"] .tia-gc-wrap .tia-gc-faq-a,
html.wp-dark-mode-active .tia-gc-wrap .tia-gc-faq-a,
body.wp-dark-mode-active .tia-gc-wrap .tia-gc-faq-a,
body.kt-dark-mode .tia-gc-wrap .tia-gc-faq-a,
body.dark-mode .tia-gc-wrap .tia-gc-faq-a,
body[data-theme="dark"] .tia-gc-wrap .tia-gc-faq-a,
.is-dark .tia-gc-wrap .tia-gc-faq-a {
  background: #0F172A !important;
  color: #CBD5E1 !important;
  border-color: #334155 !important;
}

/* ── RELATED TOOLS ───────────────────────────────────────────── */
.tia-gc-wrap .tia-gc-related {
  margin-top: 32px;
}

.tia-gc-wrap .tia-gc-related-title {
  font-family: var(--gc-font-h);
  font-size: 16px;
  font-weight: 700;
  color: var(--gc-text);
  margin-bottom: 12px;
}

.tia-gc-wrap .tia-gc-related-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tia-gc-wrap .tia-gc-related-tool {
  display: inline-flex;
  align-items: center;
  background: var(--gc-surface);
  border: 1px solid var(--gc-border);
  border-radius: var(--gc-r-pill);
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gc-body);
  text-decoration: none;
  transition: border-color .2s, color .2s, box-shadow .2s;
  box-shadow: var(--gc-sh-sm);
}

.tia-gc-wrap .tia-gc-related-tool:hover {
  border-color: #B8D0FF;
  color: var(--gc-accent);
  box-shadow: var(--gc-sh-md);
}

/* Dark mode related tools */
html[data-theme="dark"] .tia-gc-wrap .tia-gc-related-tool,
html.wp-dark-mode-active .tia-gc-wrap .tia-gc-related-tool,
body.wp-dark-mode-active .tia-gc-wrap .tia-gc-related-tool,
body.kt-dark-mode .tia-gc-wrap .tia-gc-related-tool,
body.dark-mode .tia-gc-wrap .tia-gc-related-tool,
body[data-theme="dark"] .tia-gc-wrap .tia-gc-related-tool,
.is-dark .tia-gc-wrap .tia-gc-related-tool {
  background: #1E293B;
  border-color: #334155;
  color: #CBD5E1;
}

html[data-theme="dark"] .tia-gc-wrap .tia-gc-related-tool:hover,
html.wp-dark-mode-active .tia-gc-wrap .tia-gc-related-tool:hover,
body.wp-dark-mode-active .tia-gc-wrap .tia-gc-related-tool:hover,
body.kt-dark-mode .tia-gc-wrap .tia-gc-related-tool:hover,
body.dark-mode .tia-gc-wrap .tia-gc-related-tool:hover,
body[data-theme="dark"] .tia-gc-wrap .tia-gc-related-tool:hover,
.is-dark .tia-gc-wrap .tia-gc-related-tool:hover {
  border-color: var(--gc-accent-border);
  color: var(--gc-accent);
}

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .tia-gc-wrap .tia-gc-header  { text-align: center; }
  .tia-gc-wrap .tia-gc-tagline { text-align: center; }
  .tia-gc-wrap .tia-gc-badges  { justify-content: center; }
  .tia-gc-wrap .tia-gc-stats   { gap: 10px; }
}

@media (max-width: 540px) {
  .tia-gc-wrap { overflow-x: hidden; padding: 16px 0 48px; }
  .tia-gc-wrap .tia-gc-card { min-width: 0; overflow: hidden; }
  .tia-gc-wrap .tia-gc-toolbar { flex-wrap: wrap; }
  .tia-gc-wrap .tia-gc-input-bar { flex-direction: column; align-items: flex-start; }
  .tia-gc-wrap .tia-gc-results-head { flex-direction: column; align-items: flex-start; }
  .tia-gc-wrap .tia-gc-btn-primary { width: 100%; justify-content: center; }
  .tia-gc-wrap .tia-gc-gate-modal { padding: 28px 20px; }
}

/* ── REDUCED MOTION ──────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
  }
}
