/* Shared styles for the writing-checker family (Spell Checker,
 * Proofreader, Punctuation Checker). Composes the shared primitives in
 * tools.css. Each tool sets --gt-accent in its own tiny tool.css. */

:root {
    --gt-accent: #4f46e5;
    --gt-accent-dark: #4338ca;
    --gt-accent-tint: #eef2ff;
}

.page-hero h1 .gt-hero-mark {
    width: 1em;
    height: 1em;
    vertical-align: -0.12em;
    margin-right: 0.35rem;
    color: var(--gt-accent);
}

/* ---- Form ---- */
.gt-field-label { display: block; font-weight: 600; font-size: 0.92rem; color: #333; margin-bottom: 6px; }
.gt-textarea-input {
    width: 100%;
    box-sizing: border-box;
    min-height: 150px;
    resize: vertical;
    line-height: 1.6;
}
.gt-input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
    font-size: 0.82rem;
    color: #888;
}
.gt-input-counter.is-near { color: #d97706; }
.gt-input-counter.is-over { color: #dc2626; font-weight: 600; }
.gt-input-hint { color: #d97706; }
.gt-submit-row { margin-top: 16px; }

/* ---- Results body / score ---- */
.gt-results-body { padding: 16px 20px 18px; }
.gt-score-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    padding: 4px 0 2px;
}
.gt-score-badge {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    color: #fff;
    font-weight: 700;
    line-height: 1;
    flex: 0 0 auto;
}
.gt-score-badge .gt-grade { font-size: 1.25rem; }
.gt-score-badge .gt-score-num { font-size: 0.68rem; font-weight: 600; opacity: 0.9; margin-top: 2px; }
.gt-score-a { background: #16a34a; }
.gt-score-b { background: #65a30d; }
.gt-score-c { background: #d97706; }
.gt-score-d { background: #ea580c; }
.gt-score-f { background: #dc2626; }
.gt-score-text { flex: 1 1 240px; }
.gt-score-summary { color: #475569; font-size: 0.92rem; line-height: 1.5; margin: 0 0 6px; }
.gt-count-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.gt-count-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    background: #f1f5f9;
    color: #475569;
}
.gt-count-pill .gt-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.gt-dot-high { background: #dc2626; }
.gt-dot-medium { background: #d97706; }
.gt-dot-low { background: #64748b; }

/* ---- Findings ---- */
.gt-findings { margin: 14px 0 0; display: flex; flex-direction: column; gap: 10px; }
.gt-finding {
    border: 1px solid #e6e8eb;
    border-left-width: 4px;
    border-radius: 8px;
    padding: 11px 14px;
    background: #fff;
}
.gt-finding.sev-high { border-left-color: #dc2626; }
.gt-finding.sev-medium { border-left-color: #d97706; }
.gt-finding.sev-low { border-left-color: #64748b; }
.gt-finding-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}
.gt-finding-rule { font-weight: 600; color: #1f2937; font-size: 0.92rem; }
.gt-finding-cat {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gt-accent-dark);
    background: var(--gt-accent-tint);
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 700;
}
.gt-finding-exp { color: #475569; font-size: 0.88rem; line-height: 1.5; margin: 4px 0 8px; }
.gt-finding-diff { font-size: 0.9rem; line-height: 1.5; }
.gt-finding-diff .gt-from {
    background: #fee2e2;
    color: #991b1b;
    border-radius: 3px;
    padding: 0 4px;
    text-decoration: line-through;
}
.gt-finding-diff .gt-arrow { color: #94a3b8; margin: 0 6px; }
.gt-finding-diff .gt-to {
    background: #dcfce7;
    color: #166534;
    border-radius: 3px;
    padding: 0 4px;
}

/* Clean (no issues) state */
.gt-clean {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    color: #166534;
    font-weight: 600;
    margin: 14px 0 0;
}

/* ---- Corrected text panel ---- */
.gt-corrected-wrap { margin-top: 16px; }
.gt-corrected-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}
.gt-corrected-title { font-weight: 600; color: #1f2937; }
.gt-corrected {
    width: 100%;
    box-sizing: border-box;
    min-height: 120px;
    border: 1px solid #e6e8eb;
    border-radius: 8px;
    padding: 12px 14px;
    font: inherit;
    line-height: 1.6;
    color: #1f2937;
    resize: vertical;
    white-space: pre-wrap;
    background: #fafdff;
}
.gt-corrected:focus { outline: 2px solid var(--gt-accent); border-color: var(--gt-accent); }
.gt-corrected[hidden] { display: none; }

/* Highlight-changes toggle + read-only diff view */
.gt-corrected-head .gt-view-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--gt-accent-dark);
    cursor: pointer;
    user-select: none;
}
.gt-corrected-head .gt-view-toggle input { accent-color: var(--gt-accent); }
.gt-highlight-view {
    border: 1px dashed #dce3f0;
    background: #fafbff;
    border-radius: 8px;
    padding: 12px 14px;
    line-height: 1.6;
    color: #1f2937;
    white-space: pre-wrap;
    word-wrap: break-word;
}
.gt-highlight-view[hidden] { display: none; }
mark.ke-changed {
    background: #fde68a;
    color: #713f12;
    border-radius: 3px;
    padding: 0 2px;
}

@media (max-width: 640px) {
    .gt-corrected-head { flex-direction: column; align-items: flex-start; }
}
