/* ==========================================================================
   Free tools (/tools/): shared layout + one section per tool
   Loaded only on tool pages via $page_styles.
   ========================================================================== */

.tool-page {
    --tool-paper: #FFFFFF;
    --tool-ink: var(--text-primary);
    --tool-muted: #78716C;
    --tool-line: var(--border);
    --tool-soft: #F7F4EE;
    --tool-focus: 0 0 0 3px rgba(146, 64, 14, 0.25);
    padding: 48px 0 40px;
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Hero ------------------------------------------------------------------- */
.tool-hero {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.tool-hero .breadcrumb ol {
    justify-content: center;
}

.tool-eyebrow {
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 14px;
}

.tool-hero h1 {
    font-size: clamp(2.25rem, 5vw, 3.25rem);
    font-weight: 600;
    margin-bottom: 18px;
}

.tool-lede {
    font-size: 1.1875rem;
    line-height: 1.6;
    max-width: 640px;
    margin: 0 auto 36px;
}

/* App panel ---------------------------------------------------------------- */
.tool-app {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 20px;
}

.tool-panel {
    background: var(--tool-paper);
    border: 1px solid var(--tool-line);
    border-radius: 14px;
    box-shadow: var(--shadow-md);
    padding: 28px;
    font-family: var(--font-ui);
    color: var(--tool-ink);
}

.tool-panel p {
    font-family: var(--font-ui);
}

.tool-noscript {
    font-family: var(--font-ui);
    background: var(--accent-light);
    border-radius: 8px;
    padding: 16px 20px;
    text-align: center;
}

.tool-privacy {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-ui);
    font-size: 13.5px;
    color: var(--tool-muted);
    margin: 14px 0 0;
    text-align: center;
}

.tool-privacy svg {
    flex: none;
}

.tool-textbtn {
    background: none;
    border: 0;
    padding: 2px 4px;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
    cursor: pointer;
    border-radius: 4px;
}

.tool-textbtn:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.tool-panel button:focus-visible,
.tool-panel input:focus-visible,
.tool-panel select:focus-visible,
.tool-panel textarea:focus-visible,
.tool-panel label.btn:focus-within,
.tool-panel [contenteditable]:focus-visible {
    outline: none;
    box-shadow: var(--tool-focus);
}

.tool-panel .btn[disabled],
.tool-panel button[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
}

.tool-panel select,
.tool-panel input[type="text"],
.tool-panel input[type="number"],
.tool-panel input[type="date"],
.tool-panel input[type="email"],
.tool-panel textarea {
    font-family: var(--font-ui);
    font-size: 15px;
    color: var(--tool-ink);
    background: #fff;
    border: 1px solid #D6D3D1;
    border-radius: 8px;
    padding: 9px 12px;
    min-height: 42px;
    max-width: 100%;
}

.tool-panel label.btn {
    position: relative;
}

/* Content below the tool ----------------------------------------------------- */
.tool-content {
    max-width: 740px;
    margin: 72px auto 0;
    padding: 0 20px;
}

.tool-content h2:first-child {
    margin-top: 0;
}

.tool-content code {
    font-size: 0.9em;
    background: var(--surface);
    padding: 1px 6px;
    border-radius: 4px;
}

.tool-faq > h2 {
    font-size: 2.25rem;
    margin-top: 72px;
    margin-bottom: 32px;
}

/* More tools ------------------------------------------------------------------ */
.tool-more {
    max-width: 1080px;
    margin: 80px auto 0;
    padding: 0 20px;
}

.tool-more h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 28px;
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.tool-card {
    display: block;
    background: var(--tool-paper, #fff);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    text-decoration: none;
    color: var(--text-primary);
    transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.tool-card:hover {
    border-color: #D6D3D1;
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    color: var(--text-primary);
}

.tool-card .tool-icon {
    color: var(--accent);
    margin-bottom: 12px;
}

.tool-card h3 {
    font-size: 1.375rem;
    margin-bottom: 8px;
}

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

.tool-card p {
    font-size: 15px;
    line-height: 1.55;
    margin: 0;
}

/* ==========================================================================
   Scrivener converter
   ========================================================================== */
.scriv-drop {
    border: 2px dashed #D6D3D1;
    border-radius: 12px;
    padding: 44px 24px 32px;
    text-align: center;
    background: var(--tool-soft);
    transition: border-color 0.15s ease, background 0.15s ease;
}

.scriv-drop.is-over {
    border-color: var(--accent);
    background: var(--accent-light);
}

.scriv-drop-icon {
    color: var(--accent);
    margin-bottom: 10px;
}

.scriv-drop-title {
    font-family: var(--font-display) !important;
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--tool-ink);
    margin: 0 0 6px;
}

.scriv-drop-sub {
    font-size: 15px;
    margin: 0 0 22px;
}

.scriv-drop-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-bottom: 22px;
}

.scriv-drop-help {
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--tool-muted);
    max-width: 620px;
    margin: 0 auto;
}

.scriv-status {
    padding: 40px 12px;
    text-align: center;
}

.scriv-status p {
    margin: 0 0 14px;
    color: var(--tool-ink);
}

.scriv-progress {
    height: 6px;
    background: var(--surface);
    border-radius: 3px;
    overflow: hidden;
    max-width: 360px;
    margin: 0 auto;
}

.scriv-progress span {
    display: block;
    height: 100%;
    width: 15%;
    background: var(--accent);
    transition: width 0.2s ease;
}

.scriv-error {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #991B1B;
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 16px;
    font-size: 14.5px;
    line-height: 1.5;
}

.scriv-pick {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 24px 0;
    justify-content: center;
}

.scriv-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.scriv-head h2 {
    font-size: 1.875rem;
    font-weight: 600;
    margin: 0 0 2px;
    word-break: break-word;
}

.scriv-meta {
    font-size: 14px;
    color: var(--tool-muted);
    margin: 0;
}

.scriv-notice {
    background: var(--accent-light);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.55;
    color: var(--tool-ink);
    margin: 0 0 16px;
}

.scriv-cols {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    gap: 20px;
}

.scriv-binder,
.scriv-preview {
    border: 1px solid var(--tool-line);
    border-radius: 10px;
    height: 440px;
    overflow: auto;
    background: #fff;
}

.scriv-binder-bar {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--tool-soft);
    border-bottom: 1px solid var(--tool-line);
    font-size: 13px;
    color: var(--tool-muted);
}

.scriv-binder-label {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 12px;
}

.scriv-binder-actions .tool-textbtn {
    font-size: 13px;
}

.scriv-tree,
.scriv-tree ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.scriv-tree {
    padding: 6px 0;
}

.scriv-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 10px 2px calc(10px + var(--depth, 0) * 18px);
    min-height: 32px;
}

.scriv-row:hover {
    background: var(--tool-soft);
}

.scriv-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    flex: none;
    accent-color: var(--accent);
    margin: 0;
}

.scriv-title {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex: 1;
    background: none;
    border: 0;
    padding: 4px 6px;
    border-radius: 5px;
    font: inherit;
    font-size: 14.5px;
    color: var(--tool-ink);
    text-align: left;
    cursor: pointer;
}

.scriv-title svg {
    flex: none;
    color: var(--tool-muted);
}

.scriv-title span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.scriv-title.is-current {
    background: var(--accent-light);
}

.scriv-row.is-trash .scriv-title {
    color: var(--tool-muted);
}

.scriv-words {
    flex: none;
    font-size: 12.5px;
    color: var(--tool-muted);
    font-variant-numeric: tabular-nums;
}

.scriv-words.is-total {
    opacity: 0.65;
}

.scriv-badge {
    flex: none;
    font-size: 11px;
    color: var(--tool-muted);
    border: 1px solid var(--tool-line);
    border-radius: 999px;
    padding: 0 7px;
}

.scriv-preview {
    padding: 18px 22px;
}

.scriv-preview h3 {
    font-size: 1.5rem;
    margin: 0 0 2px;
}

.scriv-preview-meta {
    font-size: 13px;
    color: var(--tool-muted);
    margin: 0 0 14px;
}

.scriv-preview-text p {
    font-family: var(--font-body) !important;
    font-size: 16px;
    line-height: 1.65;
    color: var(--tool-ink);
    margin: 0 0 0.8em;
}

.scriv-preview-text p.is-center {
    text-align: center;
}

.scriv-preview-empty,
.scriv-preview-more {
    font-size: 14px;
    color: var(--tool-muted) !important;
}

.scriv-noteref {
    color: var(--accent);
    font-weight: 600;
}

.scriv-preview-notes {
    border-top: 1px solid var(--tool-line);
    margin: 18px 0 0;
    padding: 12px 0 0 20px;
    font-size: 14px;
    color: var(--text-secondary);
    list-style: decimal;
}

.scriv-export {
    margin-top: 24px;
    padding-top: 22px;
    border-top: 1px solid var(--tool-line);
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 18px 28px;
}

.scriv-formats {
    border: 0;
    margin: 0;
    padding: 0;
    grid-row: span 2;
}

.scriv-formats legend,
.scriv-opts > label,
.tool-label {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--tool-muted);
    margin-bottom: 8px;
    padding: 0;
}

.scriv-format {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 10px 12px;
    border: 1px solid var(--tool-line);
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--tool-muted);
    line-height: 1.45;
}

.scriv-format:has(input:checked) {
    border-color: var(--accent);
    background: #FFFBF3;
}

.scriv-format input {
    margin-top: 3px;
    accent-color: var(--accent);
}

.scriv-format strong {
    display: block;
    color: var(--tool-ink);
    font-size: 15px;
}

.scriv-opts {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.scriv-opts > label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
}

.scriv-opts > label select {
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
}

.scriv-opts > label.scriv-check {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    text-transform: none;
    letter-spacing: 0;
    font-size: 14.5px;
    font-weight: 500;
    color: var(--tool-ink);
}

.scriv-check input {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
}

.scriv-go {
    align-self: end;
}

.scriv-selected {
    font-size: 14px;
    color: var(--tool-muted);
    margin: 0 0 10px;
}

.scriv-go .btn {
    width: 100%;
}

.scriv-done {
    margin-top: 22px;
    padding: 20px 22px;
    border-radius: 10px;
    background: var(--tool-soft);
    border: 1px solid var(--tool-line);
}

.scriv-done p {
    font-size: 15px;
    line-height: 1.6;
    margin: 0 0 10px;
}

.scriv-done-title {
    font-weight: 600;
    color: var(--tool-ink) !important;
}

.scriv-done-cta {
    margin: 14px 0 0 !important;
}

@media (max-width: 900px) {
    .scriv-cols,
    .scriv-export {
        grid-template-columns: minmax(0, 1fr);
    }

    .scriv-binder {
        height: 360px;
    }

    .scriv-preview {
        height: auto;
        max-height: 420px;
    }

    .scriv-formats {
        grid-row: auto;
    }
}

@media (max-width: 600px) {
    .tool-page {
        padding-top: 32px;
    }

    .tool-panel {
        padding: 18px 16px;
        border-radius: 12px;
    }

    .scriv-drop {
        padding: 32px 16px 24px;
    }

    .scriv-drop-buttons .btn {
        width: 100%;
    }

    .scriv-head {
        flex-direction: column;
        gap: 6px;
    }

    .tool-lede {
        font-size: 1.0625rem;
    }
}

/* ==========================================================================
   Manuscript formatter
   ========================================================================== */
.ms-kind {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 22px;
}

.ms-kind-opt,
.scriv-format {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 14px;
    border: 1px solid var(--tool-line);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--tool-muted);
    line-height: 1.45;
}

.ms-kind-opt:has(input:checked) {
    border-color: var(--accent);
    background: #FFFBF3;
}

.ms-kind-opt input {
    margin-top: 3px;
    accent-color: var(--accent);
}

.ms-kind-opt strong {
    display: block;
    color: var(--tool-ink);
    font-size: 15px;
}

.ms-cols {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 24px;
}

.ms-text-bar {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
}

.ms-text-bar .tool-label {
    margin: 0;
}

.ms-open {
    cursor: pointer;
    position: relative;
}

.ms-editor {
    height: 470px;
    overflow: auto;
    border: 1px solid #D6D3D1;
    border-radius: 10px;
    padding: 16px 20px;
    background: #fff;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.65;
    color: var(--tool-ink);
    white-space: pre-wrap;
    word-wrap: break-word;
}

.ms-editor:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: var(--tool-focus);
}

.ms-editor.is-empty::before {
    content: attr(data-placeholder);
    color: #A8A29E;
    pointer-events: none;
}

.ms-editor p,
.ms-editor div {
    margin: 0 0 0.6em;
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--tool-ink);
}

.ms-editor h1,
.ms-editor h2,
.ms-editor h3 {
    font-family: var(--font-body);
    font-size: 17px;
    font-weight: 700;
    margin: 1em 0 0.6em;
    color: var(--tool-ink);
}

.ms-stats {
    font-size: 13.5px;
    color: var(--tool-muted);
    margin: 8px 0 0;
}

.ms-form fieldset {
    border: 0;
    padding: 0;
    margin: 0 0 16px;
}

.ms-form legend {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--tool-muted);
    padding: 0;
    margin-bottom: 8px;
}

.ms-form label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--tool-ink);
    margin-bottom: 10px;
}

.ms-form label input,
.ms-form label textarea,
.ms-form label select {
    font-weight: 400;
    width: 100%;
}

.ms-form textarea {
    resize: vertical;
    min-height: 62px;
}

.ms-opt {
    font-weight: 400;
    color: var(--tool-muted);
}

.ms-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.ms-more {
    border-top: 1px solid var(--tool-line);
    padding-top: 12px;
}

.ms-more summary {
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 12px;
}

.ms-form label.ms-check {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    margin-bottom: 6px;
}

.ms-check input {
    width: 16px !important;
    height: 16px;
    accent-color: var(--accent);
}

.ms-bottom {
    margin-top: 24px;
    padding-top: 22px;
    border-top: 1px solid var(--tool-line);
    display: grid;
    grid-template-columns: minmax(0, 2.6fr) minmax(0, 1fr);
    gap: 24px;
    align-items: end;
}

.ms-preview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    background: #E7E5E4;
    border-radius: 10px;
    padding: 14px;
}

/* A US Letter page; every size is a fraction of the page width (8.5in). */
.ms-page {
    container-type: inline-size;
    position: relative;
    aspect-ratio: 8.5 / 11;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    font-family: 'Times New Roman', Times, serif;
    color: #111;
}

.ms-page.is-courier {
    font-family: 'Courier New', Courier, monospace;
}

.ms-head {
    position: absolute;
    top: 5.88cqw;
    right: 11.76cqw;
    font-size: 1.96cqw;
    white-space: nowrap;
}

.ms-body {
    position: absolute;
    inset: 11.76cqw 11.76cqw;
    font-size: 1.96cqw;
    line-height: 3.92cqw;
    overflow: hidden;
}

.ms-l {
    min-height: 3.92cqw;
    overflow-wrap: anywhere;
}

.ms-l.is-single {
    line-height: 1.96cqw;
    min-height: 1.96cqw;
    display: flex;
    justify-content: space-between;
}

.ms-l.is-p {
    text-indent: 5.88cqw;
}

.ms-l.is-center {
    text-align: center;
}

.ms-l.ms-h {
    margin-bottom: 3.92cqw;
}

.ms-r {
    text-align: right;
}

.ms-go-note {
    font-size: 13px;
    color: var(--tool-muted);
    margin: 0 0 10px;
}

.ms-go .btn {
    width: 100%;
}

.ms-error {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #991B1B;
    border-radius: 8px;
    padding: 10px 14px;
    margin: 12px 0 0;
    font-size: 14px;
}

.ms-done {
    margin-top: 22px;
    padding: 20px 22px;
    border-radius: 10px;
    background: var(--tool-soft);
    border: 1px solid var(--tool-line);
}

.ms-done p {
    font-size: 15px;
    line-height: 1.6;
    margin: 0 0 10px;
}

.ms-done-title {
    font-weight: 600;
    color: var(--tool-ink) !important;
}

@media (max-width: 900px) {
    .ms-cols,
    .ms-bottom {
        grid-template-columns: minmax(0, 1fr);
    }

    .ms-editor {
        height: 360px;
    }
}

@media (max-width: 600px) {
    .ms-kind,
    .ms-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .ms-preview {
        padding: 10px;
        gap: 10px;
    }
}

/* ==========================================================================
   Words per day calculator
   ========================================================================== */
.wpd-mode {
    display: inline-flex;
    background: var(--surface);
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 18px;
}

.wpd-tab {
    border: 0;
    background: none;
    font: inherit;
    font-size: 14.5px;
    font-weight: 600;
    color: var(--tool-muted);
    padding: 9px 16px;
    border-radius: 7px;
    cursor: pointer;
}

.wpd-tab.is-active {
    background: #fff;
    color: var(--tool-ink);
    box-shadow: var(--shadow-sm);
}

.wpd-presets {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 22px;
}

.wpd-presets .tool-label {
    margin: 0 6px 0 0;
}

.wpd-chip {
    border: 1px solid var(--tool-line);
    background: #fff;
    border-radius: 999px;
    padding: 6px 14px;
    font: inherit;
    font-size: 14px;
    color: var(--tool-ink);
    cursor: pointer;
}

.wpd-chip:hover,
.wpd-chip.is-active {
    border-color: var(--accent);
    background: #FFFBF3;
}

.wpd-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}

.wpd-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.wpd-inputs label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--tool-ink);
    margin-bottom: 14px;
}

.wpd-inputs label[hidden] {
    display: none;
}

.wpd-inputs input,
.wpd-inputs select {
    width: 100%;
    font-weight: 400;
}

.wpd-days {
    border: 0;
    margin: 0 0 14px;
    padding: 0;
}

.wpd-days legend {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--tool-ink);
    margin-bottom: 6px;
    padding: 0;
}

.wpd-daylist {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.wpd-daylist label {
    margin: 0;
    position: relative;
}

.wpd-daylist input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.wpd-daylist span {
    display: inline-block;
    min-width: 50px;
    text-align: center;
    padding: 7px 0;
    border: 1px solid var(--tool-line);
    border-radius: 8px;
    font-weight: 500;
    color: var(--tool-muted);
    cursor: pointer;
    user-select: none;
}

.wpd-daylist input:checked + span {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.wpd-daylist input:focus-visible + span {
    box-shadow: var(--tool-focus);
}

.wpd-inputs .wpd-speed {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.wpd-inputs .wpd-speed select {
    width: auto;
}

.wpd-result {
    background: var(--tool-soft);
    border-radius: 12px;
    padding: 24px 26px;
    min-height: 100%;
}

.wpd-big {
    font-family: var(--font-display) !important;
    font-size: 2.25rem;
    line-height: 1.15;
    font-weight: 600;
    color: var(--tool-ink) !important;
    margin: 0 0 4px;
}

.wpd-big span {
    color: var(--accent);
    font-size: 3.25rem;
    display: block;
}

.wpd-sub {
    font-size: 15px;
    margin: 0 0 16px;
}

.wpd-facts {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--tool-line);
}

.wpd-facts li {
    padding: 9px 0;
    border-bottom: 1px solid var(--tool-line);
    font-size: 14.5px;
    color: var(--tool-ink);
}

.wpd-warn {
    margin: 14px 0 0;
    font-size: 14px;
    color: #92400E !important;
    background: var(--accent-light);
    border-radius: 8px;
    padding: 10px 12px;
}

.wpd-chart {
    margin: 26px 0 0;
}

.wpd-chart svg {
    width: 100%;
    height: 160px;
    display: block;
    background: linear-gradient(var(--tool-line) 1px, transparent 1px) 0 0 / 100% 40px;
    border-bottom: 1px solid #D6D3D1;
}

.wpd-area {
    fill: rgba(146, 64, 14, 0.08);
}

.wpd-line {
    fill: none;
    stroke: var(--accent);
    stroke-width: 2.5;
}

.wpd-goal-line {
    stroke: #A8A29E;
    stroke-dasharray: 4 4;
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
}

.wpd-today {
    stroke: #1C1917;
    stroke-width: 1.5;
    stroke-dasharray: 2 3;
}

.wpd-chart figcaption {
    font-size: 13.5px;
    color: var(--tool-muted);
    margin-top: 8px;
    font-family: var(--font-ui);
}

.wpd-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid var(--tool-line);
}

.wpd-ics {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.wpd-time {
    font-size: 14px;
    color: var(--tool-muted);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.wpd-time input {
    min-height: 40px;
    padding: 6px 8px;
}

.wpd-copied {
    font-size: 13.5px;
    color: #166534;
}

.tool-panel.is-empty .wpd-actions,
.tool-panel.is-empty .wpd-plan,
.tool-panel.is-empty .wpd-chart {
    display: none;
}

.wpd-plan {
    margin-top: 26px;
}

.wpd-plan-head h2 {
    font-size: 1.75rem;
    margin: 0 0 4px;
}

.wpd-plan-head p {
    font-size: 14px;
    margin: 0 0 16px;
}

.wpd-months {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 22px;
    max-height: 560px;
    overflow: auto;
    padding-right: 4px;
}

.wpd-month h3 {
    font-family: var(--font-ui);
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 8px;
}

.wpd-cal {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 3px;
}

.wpd-dow {
    font-size: 11px;
    text-align: center;
    color: var(--tool-muted);
    text-transform: uppercase;
}

.wpd-cell {
    position: relative;
    min-height: 54px;
    border: 1px solid var(--tool-line);
    border-radius: 5px;
    padding: 3px 4px;
    font-size: 11px;
    line-height: 1.25;
    color: var(--tool-muted);
    background: #fff;
}

.wpd-cell.is-pad {
    border: 0;
    background: none;
}

.wpd-cell.is-out {
    opacity: 0.4;
}

.wpd-cell b {
    display: block;
    font-weight: 600;
    color: var(--tool-ink);
}

.wpd-cell.is-write {
    background: #FFFBF3;
    border-color: #E9C9A0;
}

.wpd-cell i {
    display: block;
    font-style: normal;
    font-weight: 700;
    color: var(--accent);
    font-size: 12px;
}

.wpd-cell small {
    display: block;
    font-size: 10px;
}

.wpd-cell em {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 10px;
    height: 10px;
    border: 1px solid #A8A29E;
    border-radius: 2px;
}

.wpd-plan-foot {
    display: none;
}

.wpd-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-ui);
    font-size: 14.5px;
    min-width: 560px;
}

.wpd-table th,
.wpd-table td {
    border-bottom: 1px solid var(--border);
    padding: 10px 8px;
    text-align: left;
    vertical-align: top;
}

.wpd-table thead th {
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--tool-muted, #78716C);
}

.wpd-table td span {
    font-size: 12.5px;
    color: #78716C;
}

@media (max-width: 900px) {
    .wpd-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 600px) {
    .wpd-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .wpd-mode {
        display: flex;
    }

    .wpd-tab {
        flex: 1;
        padding: 9px 8px;
    }

    .wpd-daylist span {
        min-width: 40px;
    }

    .wpd-big span {
        font-size: 2.75rem;
    }
}

/* Print: only the day-by-day plan, and only on the calculator page */
@media print {
    body:has(#wpd-app) .site-header,
    body:has(#wpd-app) .site-footer,
    body:has(#wpd-app) .back-to-top,
    body:has(#wpd-app) .tool-hero,
    body:has(#wpd-app) .tool-content,
    body:has(#wpd-app) .tool-faq,
    body:has(#wpd-app) .tool-more,
    body:has(#wpd-app) .tool-privacy,
    body:has(#wpd-app) .tool-noscript,
    #wpd-app > *:not(.wpd-plan) {
        display: none !important;
    }

    body:has(#wpd-app)::after {
        display: none;
    }

    body:has(#wpd-app) {
        background: #fff;
    }

    .wpd-screen {
        display: none;
    }

    .wpd-print-only {
        display: inline !important;
    }

    body:has(#wpd-app) .tool-page,
    body:has(#wpd-app) .tool-app {
        padding: 0;
        margin: 0;
    }

    #wpd-app {
        border: 0;
        box-shadow: none;
        padding: 0;
    }

    .wpd-plan {
        margin: 0;
    }

    .wpd-months {
        max-height: none;
        overflow: visible;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .wpd-month {
        break-inside: avoid;
    }

    .wpd-cell {
        min-height: 60px;
    }

    .wpd-plan-foot {
        display: block;
        font-size: 10px;
        margin-top: 12px;
    }
}

.scriv-drop-note {
    font-size: 12.5px;
    color: var(--tool-muted);
    margin: -10px auto 18px;
    max-width: 520px;
}

.tool-disclaimer {
    max-width: 800px;
    margin: 40px auto 0;
    padding: 0 20px;
    text-align: center;
    font-family: var(--font-ui);
    font-size: 12.5px;
    color: #A8A29E;
}

.scriv-pick select {
    max-width: 100%;
}

.tool-page [hidden] {
    display: none !important;
}

/* ==========================================================================
   Words to pages
   ========================================================================== */
.wtp-input {
    display: flex;
    gap: 10px;
    align-items: stretch;
    max-width: 560px;
    margin: 0 auto;
}

.tool-panel .wtp-input input {
    flex: 1;
    min-width: 0;
    font-family: var(--font-display);
    font-size: 2.25rem;
    font-weight: 600;
    text-align: center;
    padding: 6px 14px;
    border-radius: 10px;
}

.tool-panel .wtp-input input[aria-invalid="true"] {
    border-color: #DC2626;
}

.tool-panel .wtp-input select {
    font-size: 16px;
    border-radius: 10px;
}

.wtp-hint {
    text-align: center;
    font-size: 13.5px;
    color: var(--tool-muted);
    margin: 12px 0 24px;
}

.wtp-chip {
    border: 1px solid var(--tool-line);
    background: #fff;
    border-radius: 999px;
    padding: 3px 11px;
    margin-left: 6px;
    font: inherit;
    font-size: 13px;
    color: var(--tool-ink);
    cursor: pointer;
}

.wtp-chip:hover {
    border-color: var(--accent);
}

.wtp-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.wtp-card {
    background: var(--tool-soft);
    border-radius: 10px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.wtp-k {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--tool-muted);
}

.wtp-card strong {
    font-family: var(--font-display);
    font-size: 1.875rem;
    font-weight: 600;
    color: var(--tool-ink);
    line-height: 1.2;
}

.wtp-note {
    font-size: 13px;
    color: var(--tool-muted);
}

.wtp-note select {
    font-size: 13px !important;
    min-height: 0 !important;
    padding: 2px 6px !important;
    margin-left: 4px;
}

.wtp-genre {
    margin-top: 24px;
    padding-top: 22px;
    border-top: 1px solid var(--tool-line);
}

.wtp-genre > label {
    font-size: 14px;
    font-weight: 600;
    margin-right: 8px;
}

.wtp-bar {
    position: relative;
    height: 12px;
    background: var(--surface);
    border-radius: 6px;
    margin: 22px 0 6px;
}

.wtp-range {
    position: absolute;
    top: 0;
    bottom: 0;
    background: rgba(146, 64, 14, 0.28);
    border-radius: 6px;
}

.wtp-you {
    position: absolute;
    top: -6px;
    width: 4px;
    height: 24px;
    margin-left: -2px;
    background: var(--tool-ink);
    border-radius: 2px;
}

.wtp-scale {
    display: flex;
    justify-content: space-between;
    font-size: 11.5px;
    color: var(--tool-muted);
}

.wtp-verdict {
    margin: 14px 0 0;
    font-size: 15px;
    color: var(--tool-ink) !important;
}

@media (max-width: 760px) {
    .wtp-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .wtp-input {
        flex-direction: column;
    }

    .wtp-card strong {
        font-size: 1.5rem;
    }
}

/* Words per day: additions */
.wpd-note {
    font-size: 13.5px;
    background: #fff;
    border: 1px solid var(--tool-line);
    border-radius: 8px;
    padding: 9px 12px;
    margin: 0 0 14px;
}

.wpd-bridge {
    font-size: 14px;
    margin: 16px 0 0;
}

.wpd-bridge strong {
    color: var(--tool-ink);
}

.wpd-axis {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-ui);
    font-size: 12px;
    color: var(--tool-muted);
    margin-top: 4px;
}

.wpd-ics {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.wpd-ics-label {
    font-size: 14px;
    color: var(--tool-muted);
}

.wpd-ics .btn {
    padding: 10px 16px;
    font-size: 14px;
}

button.wpd-cell {
    font: inherit;
    text-align: left;
    cursor: pointer;
    width: 100%;
}

button.wpd-cell:hover {
    border-color: var(--accent);
}

.wpd-cell.is-done {
    background: #ECFDF3;
    border-color: #86EFAC;
}

.wpd-cell.is-done em {
    background: #16A34A;
    border-color: #16A34A;
}

.wpd-cell.is-done em::after {
    content: '';
    position: absolute;
    left: 3px;
    top: 0;
    width: 3px;
    height: 6px;
    border: solid #fff;
    border-width: 0 1.5px 1.5px 0;
    transform: rotate(45deg);
}

.wpd-more {
    grid-column: 1 / -1;
    font-size: 13px;
    color: var(--tool-muted);
}

@media (max-width: 600px) {
    .wpd-grid {
        display: flex;
        flex-direction: column;
    }

    .wpd-result {
        order: -1;
    }
}

/* Words to pages: additions */
.wtp-error {
    text-align: center;
    font-size: 14px;
    color: #991B1B !important;
    margin: -12px 0 18px;
}

.tool-panel.is-invalid .wtp-cards,
.tool-panel.is-invalid .wtp-genre {
    opacity: 0.35;
}

.wtp-scale {
    position: relative;
    height: 16px;
    display: block;
}

.wtp-scale span {
    position: absolute;
    transform: translateX(-50%);
}

.wtp-scale span:first-child {
    transform: none;
}

.wtp-scale span:last-child {
    transform: translateX(-100%);
}

.wpd-print-only {
    display: none;
}

.tool-panel.is-empty .wpd-bridge {
    display: none;
}

.wpd-cell.is-past {
    background: #FAFAF9;
    border-color: var(--tool-line);
    opacity: 0.8;
}
