* {
    box-sizing: border-box;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #f7f4ee;
    color: #17212b;
    margin: 0;
    min-height: 100vh;
}

.shell {
    min-height: 100vh;
    padding: 32px 18px;
    display: grid;
    place-items: center;
}

.workspace {
    width: min(1080px, 100%);
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 22px;
    align-items: start;
}

.intro,
.detector,
.result {
    background: white;
    border: 1px solid #dfded9;
    border-radius: 8px;
    box-shadow: 0 18px 40px rgba(23, 33, 43, 0.08);
}

.intro {
    grid-column: 1 / -1;
    padding: 26px;
}

.eyebrow,
.result-label {
    color: #586674;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0;
    margin: 0 0 8px;
    text-transform: uppercase;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    font-size: 3.5rem;
    line-height: 1;
    margin-bottom: 12px;
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.intro p:last-child,
#resultSummary {
    color: #4d5a66;
    line-height: 1.6;
    margin-bottom: 0;
}

.detector {
    padding: 22px;
}

label {
    display: block;
    font-weight: 700;
    margin-bottom: 10px;
}

textarea {
    width: 100%;
    min-height: 340px;
    resize: vertical;
    border: 1px solid #c8cbd0;
    border-radius: 8px;
    padding: 16px;
    font: inherit;
    line-height: 1.55;
    color: #17212b;
}

textarea:focus {
    border-color: #1f7a6d;
    box-shadow: 0 0 0 3px rgba(31, 122, 109, 0.18);
    outline: none;
}

.actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

#wordCount,
.score-row,
.stats {
    color: #586674;
    font-size: 0.92rem;
}

button {
    min-height: 44px;
    padding: 0 18px;
    background-color: #1f7a6d;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}

button:hover {
    background-color: #185f55;
}

button:disabled {
    background-color: #8aa5a0;
    cursor: wait;
}

.result {
    padding: 22px;
    position: sticky;
    top: 24px;
}

.hidden {
    display: none;
}

.meter {
    height: 12px;
    background: #e8e6df;
    border-radius: 999px;
    overflow: hidden;
    margin: 20px 0 10px;
}

#meterFill {
    width: 0;
    height: 100%;
    background: #1f7a6d;
    transition: width 180ms ease, background-color 180ms ease;
}

.score-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

#signals {
    padding-left: 20px;
    margin: 20px 0;
    line-height: 1.5;
}

#signals:empty {
    display: none;
}

.stats {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px 14px;
    border-top: 1px solid #e8e6df;
    padding-top: 18px;
    margin-bottom: 0;
}

.stats dt,
.stats dd {
    margin: 0;
}

.stats dd {
    color: #17212b;
    font-weight: 700;
}

@media (max-width: 820px) {
    .workspace {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 2.4rem;
    }

    .result {
        position: static;
    }
}
}
