/* Syllable Counter — a compact editorial proof-sheet rather than a dashboard.
   Everything is feature-scoped; global type, buttons, and color tokens remain
   owned by main.css. Color never carries source status by itself. */

.sc-tool {
    max-width: 74rem;
    margin: 0 auto;
    padding: 0 1rem 4rem;
}

.sc-masthead {
    max-width: 56rem;
    margin: 2.2rem 0 1.5rem;
}

.sc-kicker {
    margin: 0 0 0.35rem;
    color: var(--color-text-muted, #5f625f);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.sc-masthead h1 {
    margin: 0;
    font-size: clamp(2.45rem, 7vw, 5.2rem);
    line-height: 0.96;
    letter-spacing: -0.045em;
}

.sc-deck {
    max-width: 45rem;
    margin: 1rem 0 0;
    color: var(--color-text-muted, #4e5350);
    font-family: var(--font-serif, Georgia, serif);
    font-size: clamp(1.1rem, 2.5vw, 1.42rem);
    line-height: 1.45;
}

.sc-workbench {
    position: relative;
    margin: 1.5rem 0 2.5rem;
    padding: clamp(1rem, 3vw, 1.6rem);
    overflow: hidden;
    border: 2px solid var(--color-border-strong, #0b1020);
    border-top: 8px solid var(--color-accent, #1748ff);
    border-radius: 0;
    background:
        linear-gradient(90deg, transparent 2.85rem, rgba(177, 75, 64, 0.16) 2.85rem,
            rgba(177, 75, 64, 0.16) 2.93rem, transparent 2.93rem),
        repeating-linear-gradient(0deg, transparent 0, transparent 1.85rem,
            rgba(75, 104, 126, 0.08) 1.85rem, rgba(75, 104, 126, 0.08) 1.9rem),
        var(--bg-surface, #fffef9);
    box-shadow: 8px 8px 0 var(--color-border-strong, #0b1020);
}

.sc-workbench__heading,
.sc-results__header,
.sc-report-block__heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.sc-workbench__heading h2,
.sc-results__header h2,
.sc-report-block__heading h3 {
    margin: 0;
}

.sc-char-count,
.sc-report-hint {
    color: var(--color-text-muted, #626762);
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
}

.sc-textarea {
    min-height: 13rem;
    margin-top: 0.8rem;
    resize: vertical;
    background: color-mix(in srgb, var(--color-surface, #fffdf7) 92%, transparent);
    font-family: var(--font-serif, Georgia, serif);
    font-size: 1.08rem;
    line-height: 1.75;
}

.sc-input-help,
.sc-table-note {
    margin: 0.55rem 0 0;
    color: var(--color-text-muted, #5d625f);
    font-size: 0.86rem;
}

.sc-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 0.9rem;
}

.sc-noscript,
.sc-privacy {
    padding: 0.65rem 0.8rem;
    border-left: 3px solid var(--color-accent, #315b4f);
    background: color-mix(in srgb, var(--color-accent, #315b4f) 7%, transparent);
    font-size: 0.88rem;
    line-height: 1.5;
}

.sc-noscript {
    margin: 1rem 0 0;
}

.sc-privacy {
    margin: 1rem 0 0;
}

.sc-privacy span {
    margin-right: 0.35rem;
    color: var(--color-accent, #315b4f);
}

.sc-results {
    margin: 0 0 3rem;
    scroll-margin-top: 1rem;
}

.sc-results__header {
    padding-bottom: 0.7rem;
    border-bottom: 1px solid var(--color-border, #cbc7bd);
}

.sc-summary {
    display: grid;
    grid-template-columns: minmax(10rem, 0.65fr) minmax(20rem, 2fr);
    gap: 1rem;
    margin: 1rem 0 1.5rem;
}

.sc-total-card {
    display: flex;
    min-height: 8.5rem;
    padding: 1rem;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    border: 2px solid var(--color-border-strong, #0b1020);
    border-radius: 0;
    background: var(--color-accent, #1748ff);
    color: #fff;
    text-align: center;
}

.sc-total-card__number {
    font-family: var(--font-serif, Georgia, serif);
    font-size: clamp(2.8rem, 7vw, 4.7rem);
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    line-height: 0.9;
}

.sc-total-card__label {
    margin-top: 0.55rem;
    font-size: 0.84rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.sc-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(6rem, 1fr));
    gap: 0.55rem;
    margin: 0;
}

.sc-stat-grid div {
    padding: 0.85rem;
    border: 1px solid var(--color-border, #cbc7bd);
    border-radius: 0;
    background: var(--bg-surface, #fffef9);
}

.sc-stat-grid dt {
    color: var(--color-text-muted, #626762);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1.3;
    text-transform: uppercase;
}

.sc-stat-grid dd {
    margin: 0.35rem 0 0;
    font-family: var(--font-serif, Georgia, serif);
    font-size: 1.5rem;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.sc-coverage-note {
    grid-column: 1 / -1;
    margin: 0;
    padding: 0.65rem 0.8rem;
    border-left: 3px solid var(--color-accent, #315b4f);
    background: color-mix(in srgb, var(--color-accent, #315b4f) 7%, transparent);
    font-size: 0.9rem;
}

.sc-report-grid {
    display: grid;
    gap: 1.6rem;
}

.sc-report-block {
    min-width: 0;
}

.sc-report-block__heading {
    margin-bottom: 0.55rem;
}

.sc-estimate-filter {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.84rem;
    cursor: pointer;
}

.sc-table-wrap {
    overflow-x: auto;
    border: 2px solid var(--color-border-strong, #0b1020);
    border-radius: 0;
}

.sc-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-surface, #fff);
    font-size: 0.9rem;
}

.sc-table th,
.sc-table td {
    padding: 0.62rem 0.7rem;
    border-bottom: 1px solid var(--color-border, #dedbd3);
    text-align: left;
    vertical-align: top;
}

.sc-table thead th {
    background: color-mix(in srgb, var(--color-text, #222) 5%, var(--color-surface, #fff));
    color: var(--color-text-muted, #565b57);
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.sc-table tbody tr:last-child > * {
    border-bottom: 0;
}

.sc-line-table th:first-child,
.sc-line-table td:nth-last-child(-n + 2),
.sc-word-table td:nth-child(2) {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.sc-line-table td:nth-child(2) {
    max-width: 38rem;
    overflow-wrap: anywhere;
    font-family: var(--font-serif, Georgia, serif);
}

.sc-line--blank {
    color: var(--color-text-muted, #686d69);
    background: color-mix(in srgb, var(--color-text, #222) 3%, transparent);
}

.sc-estimate-mark {
    margin-left: 0.18rem;
    color: #9b5818;
    font-weight: 800;
}

.sc-source {
    display: inline-block;
    margin: 0 0.45rem 0.25rem 0;
    padding: 0.13rem 0.4rem;
    border: 1px solid currentColor;
    border-radius: 0;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.sc-source--cmu {
    color: #276354;
}

.sc-source--estimate {
    border-style: dashed;
    color: #92510f;
}

.sc-evidence {
    display: inline;
    line-height: 1.45;
}

.sc-phonetic {
    display: block;
    margin-top: 0.3rem;
    color: var(--color-text-muted, #5b605d);
    font-size: 0.78rem;
    overflow-wrap: anywhere;
}

.sc-phonetic code {
    font-size: 0.76rem;
}

.sc-method,
.sc-guidance,
.sc-limits,
.sc-related,
.sc-tool .faqs-section {
    max-width: 54rem;
    margin: 3.2rem auto 0;
}

.sc-method > h2,
.sc-guidance > h2,
.sc-limits > h2,
.sc-related > h2,
.sc-tool .faqs-section > h2 {
    margin-top: 0;
    font-size: clamp(1.65rem, 4vw, 2.25rem);
}

.sc-method > p,
.sc-guidance p,
.sc-limits p {
    line-height: 1.65;
}

.sc-method-steps {
    margin: 1.5rem 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--color-border, #cbc7bd);
}

.sc-method-steps li {
    display: grid;
    grid-template-columns: 3rem 1fr;
    gap: 0.9rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--color-border, #cbc7bd);
}

.sc-method-steps__number {
    color: var(--color-accent, #315b4f);
    font-family: var(--font-serif, Georgia, serif);
    font-size: 1.35rem;
    font-variant-numeric: tabular-nums;
}

.sc-method-steps h3,
.sc-method-steps p {
    margin: 0;
}

.sc-method-steps p {
    margin-top: 0.35rem;
    line-height: 1.6;
}

.sc-research-note {
    margin-top: 1.5rem;
    padding: 1.1rem 1.2rem;
    border: 2px solid var(--color-border-strong, #0b1020);
    border-left: 7px solid var(--color-accent, #1748ff);
    background: var(--bg-surface, #fffef9);
}

.sc-research-note h3,
.sc-research-note p {
    margin: 0;
}

.sc-research-note .sc-kicker {
    margin-bottom: 0.3rem;
}

.sc-research-note h3 + p {
    margin-top: 0.45rem;
}

.sc-research-note h3:not(:first-of-type) {
    margin-top: 1.25rem;
}

.sc-audit-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
    margin: 1rem 0;
}

.sc-audit-stats div {
    padding: 0.7rem;
    border: 1px solid var(--color-border, #cbc7bd);
    background: color-mix(in srgb, var(--color-surface, #fff) 82%, transparent);
}

.sc-audit-stats dt {
    color: var(--color-text-muted, #626762);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.sc-audit-stats dd {
    margin: 0.3rem 0 0;
    font-family: var(--font-serif, Georgia, serif);
    font-size: 1.1rem;
    font-weight: 700;
}

.sc-audit-stats dd span {
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 400;
}

.sc-audit-details {
    margin-top: 0.8rem;
    padding-top: 0.7rem;
    border-top: 1px solid var(--color-border, #cbc7bd);
    font-size: 0.86rem;
}

.sc-audit-details summary {
    font-weight: 700;
    cursor: pointer;
}

.sc-audit-details code {
    overflow-wrap: anywhere;
}

.sc-research-note p {
    margin-top: 0.45rem;
}

.sc-research-note code {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.sc-guidance-grid,
.sc-limits-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.sc-guidance-grid article,
.sc-limits-grid > div {
    padding: 1rem;
    border: 1.5px solid var(--color-border-strong, #0b1020);
    border-top: 5px solid var(--color-accent, #1748ff);
    background: color-mix(in srgb, var(--color-accent, #1748ff) 6%, transparent);
}

.sc-guidance-grid h3,
.sc-guidance-grid p,
.sc-limits-grid h3,
.sc-limits-grid p {
    margin: 0;
}

.sc-guidance-grid p,
.sc-limits-grid p {
    margin-top: 0.45rem;
    font-size: 0.94rem;
}

.sc-guidance > h3 {
    margin-top: 2rem;
}

.sc-guidance > ol {
    line-height: 1.65;
}

.sc-limits-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sc-version-note {
    padding-top: 1rem;
    border-top: 1px solid var(--color-border, #cbc7bd);
    color: var(--color-text-muted, #565b57);
    font-size: 0.9rem;
}

.sc-related ul {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.7rem;
    padding: 0;
    list-style: none;
}

.sc-related li a {
    display: block;
    height: 100%;
    padding: 0.8rem;
    border: 1px solid var(--color-border, #cbc7bd);
    border-radius: 0;
}

/* Clipboard fallback for browsers without navigator.clipboard. Keeping these
   declarations in the stylesheet preserves the strict style-src CSP. */
.sc-copy-helper {
    position: fixed;
    top: 0;
    left: -10000px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

[data-theme="dark"] .sc-workbench {
    background:
        linear-gradient(90deg, transparent 2.85rem, rgba(232, 129, 113, 0.15) 2.85rem,
            rgba(232, 129, 113, 0.15) 2.93rem, transparent 2.93rem),
        repeating-linear-gradient(0deg, transparent 0, transparent 1.85rem,
            rgba(135, 171, 197, 0.08) 1.85rem, rgba(135, 171, 197, 0.08) 1.9rem),
        var(--color-surface, #1d211f);
}

[data-theme="dark"] .sc-source--cmu {
    color: #8fd2bf;
}

[data-theme="dark"] .sc-source--estimate,
[data-theme="dark"] .sc-estimate-mark {
    color: #efb16f;
}

@media (max-width: 760px) {
    .sc-summary {
        grid-template-columns: 1fr;
    }

    .sc-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sc-guidance-grid,
    .sc-limits-grid,
    .sc-audit-stats,
    .sc-related ul {
        grid-template-columns: 1fr;
    }

    .sc-table {
        font-size: 0.82rem;
    }

    .sc-table th,
    .sc-table td {
        padding: 0.5rem;
    }
}

@media (max-width: 460px) {
    .sc-tool {
        padding-right: 0.5rem;
        padding-left: 0.5rem;
    }

    .sc-stat-grid {
        grid-template-columns: 1fr 1fr;
    }

    .sc-workbench {
        background: var(--color-surface, #fffdf7);
    }
}

@media print {
    .sc-workbench,
    .sc-results__header .btn,
    .sc-estimate-filter,
    .sc-method,
    .sc-guidance,
    .sc-limits,
    .sc-related,
    .sc-tool .faqs-section {
        display: none !important;
    }

    .sc-tool {
        max-width: none;
        padding: 0;
    }

    .sc-results {
        display: block !important;
    }

    .sc-table-wrap {
        overflow: visible;
    }
}
