body.tool-text .site-main>section {
    box-sizing: border-box;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 8px 24px 72px;
}

body.tool-text .site-main>section>header {
    margin: 0 0 28px;
    padding: 0 0 24px;
    font-size: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--g-rule);
}

body.tool-text .site-main>section>header h1 {
    margin: 0 0 12px;
}

body.tool-text .site-main>section>header>p {
    max-width: 62ch;
    margin: 0;
    padding: 0;
    font-size: 1.05rem;
    line-height: 1.55;
    color: var(--g-ink-2);
}

.duplicate-words-container {
    box-sizing: border-box;
    display: grid;
    gap: 16px;
    margin: 0;
    padding: 0;
}

.duplicate-words-options,
.duplicate-words-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    margin: 0;
    padding: 0;
}

.duplicate-words-options {
    padding-bottom: 16px;
    border-bottom: 1px solid var(--g-rule);
}

.duplicate-words-options label {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--g-ink-2);
}

.duplicate-words-options input.number-input {
    width: 72px;
    min-height: 36px;
    margin: 0 18px 0 0;
    padding: 6px 8px;
    text-align: center;
}

.duplicate-words-options input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
}

.duplicate-words-actions .action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.stats-display:empty {
    display: none;
}

.stats-display {
    padding: 0;
    background: var(--g-panel);
    border: 1px solid var(--g-rule);
    border-top-color: var(--g-rule-strong);
    border-bottom-color: var(--g-rule-strong);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stats-grid .stat-item {
    display: flex;
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 4px;
    padding: 14px 18px;
    border-left: 1px solid var(--g-rule);
}

.stats-grid .stat-item:first-child {
    border-left: 0;
}

.stats-grid .stat-value {
    font-size: 1.5rem;
    line-height: 1.1;
}

.duplicate-words-main {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    height: 560px;
}

.duplicate-words-input-area,
.duplicate-words-display-area,
.duplicate-words-table-area {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    height: 100%;
    padding: 16px;
    overflow: auto;
    background: var(--g-clasp), var(--g-panel);
    border: 1px solid var(--g-rule);
}

.pane-title {
    flex: none;
    margin: 0 0 12px;
    font-family: var(--g-font-display);
    font-size: 1.2rem;
    font-weight: 600;
    font-variant: small-caps;
    letter-spacing: 0.06em;
    line-height: 1.2;
    text-align: left;
    text-transform: lowercase;
    color: var(--g-ink);
}

.duplicate-words-input-area textarea#textInput {
    flex: 1;
    width: 100%;
    min-height: 0;
    height: auto;
    box-sizing: border-box;
    padding: 14px 16px;
    font-size: 0.9rem;
    line-height: 1.6;
    resize: none;
}

.duplicate-words-display {
    flex: 1;
    min-height: 0;
    font-family: var(--g-font-mono);
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--g-ink-2);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.duplicate-words-display:empty::before {
    content: "Repeated words are marked here as you type.";
    font-family: var(--g-font-sans);
    color: var(--g-ink-3);
}

.highlight {
    padding: 0 2px;
    font-weight: 500;
    color: var(--g-ink);
    background: var(--g-gold-soft);
    border-bottom: 1px solid var(--g-gold);
}

.duplicate-words-table-area table {
    display: table;
    width: 100%;
    margin: 0;
    border-collapse: collapse;
}

.duplicate-words-table-area th,
.duplicate-words-table-area td {
    padding: 8px 10px;
    text-align: left;
    border: 0;
    border-bottom: 1px solid var(--g-rule);
}

.duplicate-words-table-area th {
    background: transparent;
    border-bottom-color: var(--g-rule-strong);
}

.duplicate-words-table-area td {
    font-family: var(--g-font-mono);
    font-size: 0.86rem;
    color: var(--g-ink);
}

.duplicate-words-table-area th.sortable {
    cursor: pointer;
    user-select: none;
}

.duplicate-words-table-area th.sortable:hover {
    color: var(--g-gold);
}

.duplicate-words-table-area tbody tr:hover {
    background: var(--g-panel-2);
}

.word-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    padding: 12px 18px;
    font-size: 0.88rem;
    color: var(--g-ink);
    background: var(--g-panel);
    border: 1px solid var(--g-rule-strong);
    border-left: 2px solid var(--g-verdigris);
    animation: slideIn 0.18s ease;
}

.notification.error {
    border-left-color: var(--g-rose);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

body.tool-text .site-main>section>.help-box {
    margin: 32px 0 0;
    padding: 18px 22px;
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--g-ink-2);
}

body.tool-text .site-main>section>.help-box>strong {
    display: block;
    margin-bottom: 8px;
    font-family: var(--g-font-display);
    font-size: 1.15rem;
    font-weight: 600;
    font-variant: small-caps;
    letter-spacing: 0.06em;
    text-transform: lowercase;
    color: var(--g-ink);
}

body.tool-text .site-main>section>.help-box ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

body.tool-text .site-main>section>.help-box ul ul {
    margin: 4px 0;
}

body.tool-text .site-main>section>.help-box li {
    position: relative;
    padding: 3px 0 3px 20px;
}

body.tool-text .site-main>section>.help-box li strong {
    display: inline;
    margin: 0;
    font-weight: 600;
    color: var(--g-ink);
}

body.tool-text .site-main>section>.help-box li::before {
    position: absolute;
    left: 2px;
    top: 0.55em;
}

@media screen and (max-width: 900px) {
    .duplicate-words-main {
        grid-template-columns: minmax(0, 1fr);
        height: auto;
    }

    .duplicate-words-input-area,
    .duplicate-words-display-area,
    .duplicate-words-table-area {
        height: auto;
        max-height: 420px;
    }

    .duplicate-words-input-area textarea#textInput {
        min-height: 220px;
    }

    .duplicate-words-display {
        min-height: 120px;
    }
}

@media screen and (max-width: 600px) {
    body.tool-text .site-main>section {
        padding: 4px 16px 56px;
    }

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

    .stats-grid .stat-item:nth-child(3) {
        border-left: 0;
    }

    .stats-grid .stat-item:nth-child(n+3) {
        border-top: 1px solid var(--g-rule);
    }

    .duplicate-words-options {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .duplicate-words-options input.number-input {
        margin: 0;
    }

    .duplicate-words-options input[type="checkbox"] {
        justify-self: center;
    }
}