/* === Employment Contract (Seishain).
   Apple-product clean: off-white canvas, paper-on-shadow preview, restrained chrome. === */

/* Hero. Same brand gradient as other tools for site consistency */
.ecs-hero {
    background: linear-gradient(180deg, #003e82 0%, #0058b8 100%);
    padding: 36px 22px 26px;
    text-align: center;
}
.ecs-hero-inner { max-width: 1080px; margin: 0 auto; }

.ecs-hero-crumbs {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px;
    font-size: var(--extra-small);
    color: rgba(255, 255, 255, .75);
    margin-bottom: 14px;
}
.ecs-hero-crumbs a {
    color: #fff; text-decoration: none; font-weight: 700;
    border-bottom: 1px solid rgba(255, 255, 255, .35);
}
.ecs-hero-crumbs a:hover { border-bottom-color: #fff; }
.ecs-hero-crumbs span[aria-hidden] { color: rgba(255, 255, 255, .45); }

.ecs-hero-title {
    margin: 0 0 8px;
    font-size: 32px; font-weight: 800; letter-spacing: -0.025em;
    color: #fff; line-height: 1.15;
}
.ecs-hero-deck {
    margin: 0 auto; max-width: 560px;
    font-size: var(--default);
    color: rgba(255, 255, 255, .88);
    line-height: 1.5;
}
.ecs-hero-meta {
    margin-top: 12px;
    font-size: var(--extra-small);
    color: rgba(255, 255, 255, .70);
}
.ecs-hero-meta strong { color: #fff; font-weight: 700; }

@media (max-width: 720px) {
    .ecs-hero { padding: 24px 16px 18px; }
    .ecs-hero-title { font-size: 24px; }
    .ecs-hero-deck { font-size: var(--small); }
}

/* Section. Off-white canvas to make the paper feel like the focal product */
.ecs-section {
    background: #f5f6f8;
    padding: 36px 22px 60px;
}

/* Two-pane shell. Rail on the left, preview on the right */
.ecs-shell {
    display: grid;
    grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
    gap: 22px;
    max-width: 1240px;
    margin: 0 auto;
    align-items: start;
}
@media (max-width: 1024px) {
    .ecs-shell { grid-template-columns: 1fr; }
}

/* === LEFT: control rail === */
.ecs-rail {
    background: #fff;
    border: 1px solid var(--border-subtle);
    border-radius: 18px;
    padding: 22px 22px 24px;
    box-shadow: 0 4px 14px rgba(17, 24, 39, .03);
    position: sticky;
    top: 22px;
    max-height: calc(100vh - 44px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
@media (max-width: 1024px) {
    .ecs-rail { position: static; max-height: none; }
}

.ecs-rail-section + .ecs-rail-section {
    margin-top: 22px;
    padding-top: 22px;
    border-top: 1px solid var(--border-subtle);
}

.ecs-rail-title {
    margin: 0 0 14px;
    font-size: var(--extra-small);
    font-weight: 700;
    color: var(--blue);
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.ecs-field { display: block; }
.ecs-field + .ecs-field { margin-top: 12px; }

.ecs-field-label {
    display: block;
    font-size: var(--extra-small);
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 6px;
    line-height: 1.3;
}
.ecs-field-label-secondary {
    color: var(--text-muted);
    font-weight: 500;
    margin-left: 6px;
}

.ecs-input,
.ecs-textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border-default);
    border-radius: 10px;
    background: #fff;
    color: var(--text-main);
    font-size: var(--small);
    font-family: inherit;
    line-height: 1.4;
    transition: border-color .15s ease, box-shadow .15s ease;
    -webkit-appearance: none;
    appearance: none;
}
.ecs-textarea {
    resize: vertical;
    min-height: 60px;
    line-height: 1.5;
}
.ecs-input:hover,
.ecs-textarea:hover { border-color: #c9cfdb; }
.ecs-input:focus,
.ecs-textarea:focus,
.ecs-input:focus-visible,
.ecs-textarea:focus-visible {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(0, 113, 235, .14);
}

.ecs-input-currency-wrap { position: relative; }
.ecs-input-currency-prefix {
    position: absolute;
    left: 12px; top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: var(--small);
    font-weight: 600;
    pointer-events: none;
}
.ecs-input-currency-prefix + .ecs-input { padding-left: 26px; }

/* Toggle row for optional clauses in the rail (checkbox + label) */
.ecs-toggle-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid var(--border-default);
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
    transition: border-color .15s ease, background-color .15s ease;
}
.ecs-toggle-row + .ecs-toggle-row { margin-top: 8px; }
.ecs-toggle-row:hover { border-color: var(--blue); background: #f5f8ff; }
.ecs-toggle-row input[type="checkbox"] {
    width: 14px; height: 14px;
    accent-color: var(--blue);
    margin-top: 2px;
    cursor: pointer;
    flex-shrink: 0;
}
.ecs-toggle-row-text {
    font-size: var(--extra-small);
    color: var(--text-main);
    line-height: 1.45;
}
.ecs-toggle-row-text strong { font-weight: 700; }
.ecs-toggle-row-text small {
    display: block;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 2px;
    line-height: 1.4;
}

/* Inline currency-style row showing the time fields side by side */
.ecs-input-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.ecs-input-pair-label {
    display: block;
    font-size: var(--extra-extra-small);
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 4px;
    line-height: 1.2;
}

.ecs-rail-reset {
    display: inline-flex; align-items: center;
    margin-top: 22px;
    background: transparent;
    border: 1px solid var(--border-default);
    color: var(--text-muted);
    padding: 7px 14px;
    border-radius: 8px;
    font-size: var(--extra-small);
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: border-color .15s ease, color .15s ease, background-color .15s ease;
}
.ecs-rail-reset:hover { border-color: var(--blue); color: var(--blue); background: #f5f8ff; }

/* === RIGHT: preview area === */
.ecs-preview-area {
    min-width: 0;
}

/* Toolbar above paper: pill toggle + edit + nothing else (clean) */
.ecs-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.ecs-toggle-group {
    display: inline-flex;
    background: #fff;
    border: 1px solid var(--border-default);
    border-radius: 999px;
    padding: 3px;
    box-shadow: 0 1px 2px rgba(17, 24, 39, .04);
}
.ecs-toggle {
    appearance: none;
    -webkit-appearance: none;
    border: none;
    background: transparent;
    padding: 7px 16px;
    border-radius: 999px;
    cursor: pointer;
    font-family: inherit;
    font-size: var(--extra-small);
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    transition: background-color .15s ease, color .15s ease;
    line-height: 1.2;
}
.ecs-toggle:hover:not(.is-active) { color: var(--text-main); }
.ecs-toggle.is-active {
    background: var(--blue);
    color: #fff;
    box-shadow: 0 1px 2px rgba(0, 113, 235, .25);
}
.ecs-toggle:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 113, 235, .20);
}

.ecs-toolbar-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.ecs-icon-btn {
    appearance: none;
    -webkit-appearance: none;
    background: #fff;
    border: 1px solid var(--border-default);
    border-radius: 10px;
    padding: 7px 12px;
    cursor: pointer;
    font-family: inherit;
    font-size: var(--extra-small);
    font-weight: 600;
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}
.ecs-icon-btn:hover { border-color: var(--blue); color: var(--blue); background: #f5f8ff; }
.ecs-icon-btn[data-state="on"] {
    border-color: var(--blue);
    background: var(--blue);
    color: #fff;
}
.ecs-icon-btn[data-state="on"]:hover { background: var(--blue-hover); }
.ecs-icon-btn svg { width: 14px; height: 14px; }

/* Edit-mode banner */
.ecs-edit-banner {
    margin-bottom: 14px;
    padding: 10px 14px;
    background: #fff8e1;
    border: 1px solid #f3d99f;
    border-radius: 10px;
    font-size: var(--extra-small);
    color: #7a5b1f;
    line-height: 1.5;
}

/* === Paper preview === */
.ecs-paper-stack {
    display: grid;
    gap: 22px;
}

.ecs-paper {
    background: #fff;
    border-radius: 6px;
    box-shadow:
        0 1px 2px rgba(17, 24, 39, .06),
        0 18px 38px -16px rgba(17, 24, 39, .25);
    padding: 56px 60px;
    color: #1a1a1a;
    line-height: 1.85;
    font-size: 14px;
    min-height: 1000px;
    overflow-wrap: break-word;
    word-break: break-word;
}
@media (max-width: 720px) {
    .ecs-paper { padding: 36px 28px; min-height: 0; }
}

.ecs-paper-ja {
    font-family: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "MS Mincho", serif;
}
.ecs-paper-en {
    font-family: Georgia, "Times New Roman", "Hiragino Mincho ProN", serif;
}

.ecs-paper.is-editable {
    outline: 2px dashed rgba(0, 113, 235, .35);
    outline-offset: 4px;
}
.ecs-paper.is-editable:focus-within {
    outline-color: var(--blue);
}

/* Letter sections */
.ecs-letter-date {
    text-align: right;
    margin: 0 0 36px;
    font-size: 14px;
    color: #1a1a1a;
}
.ecs-letter-recipient {
    margin: 0 0 22px;
    font-size: 16px;
    font-weight: 600;
}
.ecs-letter-recipient .ecs-honorific { margin-left: 6px; font-weight: 500; }

.ecs-letter-sender {
    text-align: right;
    margin: 0 0 32px;
    font-size: 13px;
    line-height: 1.7;
}
.ecs-letter-sender > * { display: block; }

.ecs-letter-title {
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.5em;
    margin: 8px 0 24px;
    padding-right: 0;
}
.ecs-paper-en .ecs-letter-title {
    letter-spacing: 0.03em;
    font-size: 20px;
}

/* === Contract-specific layout === */

/* Parties block: 甲 (employer) + 乙 (employee), side-by-side */
.ecs-parties {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin: 0 0 22px;
    padding: 16px 18px;
    border: 1px solid rgba(17, 24, 39, .12);
    background: #fafbfd;
    border-radius: 4px;
}
.ecs-party p {
    margin: 0;
    line-height: 1.8;
    font-size: 13px;
}
.ecs-party-label {
    font-weight: 700;
    font-size: 12px;
    margin-bottom: 4px !important;
    color: #444;
    letter-spacing: 0.04em;
}
@media (max-width: 720px) {
    .ecs-parties { grid-template-columns: 1fr; gap: 14px; }
}

/* "甲と乙は、下記のとおり労働契約を締結する。" intro line */
.ecs-letter-intro {
    margin: 0 0 14px;
    font-size: 13.5px;
    line-height: 1.85;
}

/* === Article wrapper + dynamic numbering === */
/* Each article is a wrapper. The title text stores only the article NAME
   (e.g. "雇用"); CSS counters prepend the live article number. When an
   article is toggled off via .is-hidden (display:none), the counter skips
   it, so visible articles always renumber sequentially without JS. */
.ecs-paper-ja, .ecs-paper-en {
    counter-reset: art;
}
.ecs-article {
    /* one logical article, wraps title + body */
}
.ecs-article.is-hidden {
    display: none;
}
.ecs-paper-ja .ecs-article:not(.is-hidden) {
    counter-increment: art;
}
.ecs-paper-en .ecs-article:not(.is-hidden) {
    counter-increment: art;
}

/* Article header: prepended by CSS counter */
.ecs-article-title {
    margin: 18px 0 6px;
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1.5;
    color: #1a1a1a;
    letter-spacing: 0.03em;
    page-break-after: avoid;
    break-after: avoid;
}
.ecs-paper-ja .ecs-article:not(.is-hidden) .ecs-article-title::before {
    content: "第" counter(art) "条（";
}
.ecs-paper-ja .ecs-article:not(.is-hidden) .ecs-article-title::after {
    content: "）";
}
.ecs-paper-en .ecs-article:not(.is-hidden) .ecs-article-title::before {
    content: "Article " counter(art) " (";
}
.ecs-paper-en .ecs-article:not(.is-hidden) .ecs-article-title::after {
    content: ")";
}

/* Article body, for single-paragraph articles like 第7条社会保険 */
.ecs-article-body {
    margin: 0 0 4px;
    font-size: 13.5px;
    line-height: 1.85;
}

/* Numbered sub-items inside an article */
.ecs-article-list {
    list-style: none;
    counter-reset: art-item;
    margin: 0 0 6px;
    padding: 0;
}
.ecs-article-list > li {
    counter-increment: art-item;
    position: relative;
    padding-left: 2.4em;
    margin-bottom: 3px;
    line-height: 1.85;
    font-size: 13.5px;
}
.ecs-article-list > li::before {
    content: counter(art-item) "．";
    position: absolute;
    left: 0.6em;
    top: 0;
    font-weight: 500;
    font-feature-settings: "palt" 0;
}
/* English contract uses half-width "1." for natural look */
.ecs-paper-en .ecs-article-list > li::before {
    content: counter(art-item) ".";
}
/* Bulleted sub-list inside a numbered article item (e.g. dismissal grounds) */
.ecs-article-list ul {
    list-style: none;
    padding: 0;
    margin: 4px 0 0;
}
.ecs-article-list ul > li {
    position: relative;
    padding-left: 16px;
    margin-bottom: 2px;
    font-size: 13.5px;
    line-height: 1.8;
}
.ecs-article-list ul > li::before {
    content: "・";
    position: absolute;
    left: 0;
    top: 0;
}
.ecs-paper-en .ecs-article-list ul > li::before { content: "•"; }

/* Closing note before signatures */
.ecs-letter-footnote {
    margin: 22px 0 28px;
    font-size: 13px;
    color: #333;
    line-height: 1.85;
}

/* Signature block at the bottom */
.ecs-signatures {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    margin: 18px 0 0;
    padding-top: 22px;
    border-top: 1px solid rgba(17, 24, 39, .12);
}
.ecs-signature p {
    margin: 0 0 4px;
    font-size: 13px;
    line-height: 1.8;
}
.ecs-signature-label {
    font-weight: 700;
    font-size: 12px;
    margin-bottom: 6px !important;
    color: #444;
    letter-spacing: 0.04em;
}
.ecs-signature-line {
    margin-top: 16px !important;
    color: #777;
    font-size: 12px;
    letter-spacing: 0.05em;
}
@media (max-width: 720px) {
    .ecs-signatures { grid-template-columns: 1fr; gap: 18px; }
}

.ecs-letter-body p {
    margin: 0 0 14px;
    line-height: 1.85;
}

.ecs-letter-closing-right { text-align: right; margin: 4px 0 22px; }

.ecs-letter-record-marker {
    text-align: center;
    margin: 18px 0 14px;
    font-weight: 700;
    letter-spacing: 0.3em;
}

/* Note: .ecs-letter-conditions stacked-layout rules live in the
   "Letter-format additions" section near the end of this file. */

.ecs-letter-clause-title {
    font-weight: 600;
    margin: 4px 0 6px;
}
.ecs-letter-clause-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.ecs-letter-clause-list > li {
    position: relative;
    padding-left: 18px;
    margin-bottom: 4px;
    font-size: 13px;
    line-height: 1.7;
}
.ecs-letter-clause-list > li::before {
    content: "・";
    position: absolute;
    left: 0;
}
.ecs-paper-en .ecs-letter-clause-list > li::before { content: "•"; }

.ecs-letter-footnote {
    margin: 22px 0 30px;
    font-size: 13px;
    color: #333;
    line-height: 1.75;
}

.ecs-letter-end {
    text-align: right;
    font-weight: 700;
    letter-spacing: 0.4em;
    margin-top: 18px;
}
.ecs-paper-en .ecs-letter-end { letter-spacing: 0.05em; }

/* Variable spans: visually distinct in the letter so users see what's editable */
.ecs-var {
    background: linear-gradient(transparent 80%, rgba(0, 113, 235, .14) 80%);
    padding: 0 1px;
    border-radius: 2px;
    transition: background .15s ease;
}
.ecs-paper.is-editable .ecs-var {
    background: rgba(0, 113, 235, .10);
}
.ecs-var.is-empty { color: #b4b9c2; font-style: italic; }

/* === Export / email gate === */
.ecs-export {
    margin-top: 22px;
    background: #fff;
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 18px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 14px rgba(17, 24, 39, .03);
}
.ecs-export-blurb {
    flex: 1;
    min-width: 200px;
    font-size: var(--small);
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}
.ecs-export-blurb strong { color: var(--text-main); font-weight: 700; }

.ecs-export-action {
    position: relative;
}

.ecs-btn-primary {
    appearance: none;
    -webkit-appearance: none;
    background: #0a0a0a;
    color: #fff;
    border: none;
    padding: 11px 20px;
    border-radius: 999px;
    font-family: inherit;
    font-size: var(--small);
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: background-color .15s ease, transform .1s ease, opacity .15s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.ecs-btn-primary:hover { background: #1f2937; }
.ecs-btn-primary:active { transform: translateY(1px); }
.ecs-btn-primary:disabled { opacity: .55; cursor: not-allowed; }
.ecs-btn-primary svg { width: 14px; height: 14px; }

.ecs-email-gate {
    display: none;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid var(--border-default);
    border-radius: 999px;
    padding: 4px 4px 4px 14px;
    box-shadow: 0 1px 2px rgba(17, 24, 39, .04);
    min-width: 320px;
}
.ecs-email-gate.is-open { display: inline-flex; }
.ecs-email-gate-input {
    border: none;
    outline: none;
    background: transparent;
    flex: 1;
    min-width: 0;
    font-family: inherit;
    font-size: var(--small);
    color: var(--text-main);
    padding: 4px 0;
}
.ecs-email-gate-input::placeholder { color: var(--text-muted); }
.ecs-email-gate-cancel {
    appearance: none; -webkit-appearance: none;
    background: transparent; border: none; padding: 6px;
    color: var(--text-muted); cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 999px;
}
.ecs-email-gate-cancel:hover { color: var(--text-main); background: #f3f4f6; }
.ecs-email-gate-cancel svg { width: 14px; height: 14px; }

.ecs-email-gate-submit {
    appearance: none; -webkit-appearance: none;
    background: var(--blue);
    color: #fff;
    border: none;
    padding: 9px 18px;
    border-radius: 999px;
    font-family: inherit;
    font-size: var(--extra-small);
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: background-color .15s ease;
}
.ecs-email-gate-submit:hover { background: var(--blue-hover); }
.ecs-email-gate-submit:disabled { opacity: .55; cursor: not-allowed; }

.ecs-email-error {
    display: none;
    margin-top: 10px;
    font-size: var(--extra-small);
    color: #c62828;
}
.ecs-email-error.is-visible { display: block; }

.ecs-export-status {
    display: none;
    margin-top: 10px;
    font-size: var(--extra-small);
    color: #2e7d32;
    line-height: 1.5;
}
.ecs-export-status.is-visible { display: block; }

/* === Prose === */
.ecs-prose-section {
    background: #fff;
    padding: 44px 22px 32px;
    border-top: 1px solid var(--border-subtle);
}
.ecs-prose-inner { max-width: 760px; margin: 0 auto; }
.ecs-prose-header { margin-bottom: 22px; text-align: center; }
.ecs-prose-eyebrow {
    font-size: var(--extra-small); font-weight: 700;
    color: var(--blue);
    text-transform: uppercase; letter-spacing: 0.12em;
    margin: 0 0 4px;
}
.ecs-prose-title {
    margin: 0;
    font-size: 24px; font-weight: 800;
    letter-spacing: -0.02em; color: var(--text-main);
}
.ecs-prose-section p,
.ecs-prose-section ul {
    margin: 0 0 14px;
    font-size: var(--default);
    color: var(--text-muted);
    line-height: 1.7;
}
.ecs-prose-section ul { padding-left: 22px; }
.ecs-prose-section ul li { margin-bottom: 4px; }
.ecs-prose-section h3 {
    margin: 24px 0 8px;
    font-size: var(--large);
    font-weight: 700;
    color: var(--text-main);
}
.ecs-prose-section strong { color: var(--text-main); font-weight: 700; }

/* FAQ (reuse the same accordion pattern from payroll-calculator) */
.ecs-faq-section {
    background: linear-gradient(180deg, #e6efff 0%, #d8e5ff 100%);
    padding: 44px 22px 48px;
    border-top: 1px solid #c9d8f5;
}
.ecs-faq-section-alt { background: #fff; }
.ecs-faq-inner { max-width: 760px; margin: 0 auto; }
.ecs-faq-header { margin-bottom: 22px; text-align: center; }
.ecs-faq-eyebrow {
    font-size: var(--extra-small); font-weight: 700;
    color: var(--blue);
    text-transform: uppercase; letter-spacing: 0.12em;
    margin: 0 0 4px;
}
.ecs-faq-title {
    margin: 0;
    font-size: 24px; font-weight: 800;
    letter-spacing: -0.02em; color: var(--text-main);
}
.ecs-faq { border-top: 1px solid var(--border-subtle); }
.ecs-faq-section .ecs-faq,
.ecs-faq-section .ecs-faq-item { border-color: rgba(0, 88, 184, 0.18); }
.ecs-faq-section-alt .ecs-faq,
.ecs-faq-section-alt .ecs-faq-item { border-color: var(--border-subtle); }
.ecs-faq-item { border-bottom: 1px solid var(--border-subtle); }
.ecs-faq-item summary {
    list-style: none;
    cursor: pointer;
    padding: 18px 4px;
    display: flex; align-items: center; gap: 16px;
    font-size: var(--default); font-weight: 600;
    color: var(--text-main);
    transition: color .15s ease;
}
.ecs-faq-item summary::-webkit-details-marker { display: none; }
.ecs-faq-item summary:hover { color: var(--blue); }
.ecs-faq-item summary::after {
    content: '';
    margin-left: auto;
    width: 9px; height: 9px;
    border-right: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    transform: rotate(45deg);
    transition: transform .2s ease, border-color .15s ease;
    flex-shrink: 0; margin-bottom: 3px;
}
.ecs-faq-item[open] summary { color: var(--blue); }
.ecs-faq-item[open] summary::after {
    border-color: var(--blue);
    transform: rotate(-135deg);
    margin-bottom: 0; margin-top: 3px;
}
.ecs-faq-answer {
    padding: 0 4px 18px;
    font-size: var(--small);
    color: var(--text-muted);
    line-height: 1.65;
    margin: 0;
}

/* Related guides */
.ecs-related-section {
    background: #fbfcff;
    padding: 36px 22px 50px;
    border-top: 1px solid var(--border-subtle);
}
.ecs-related-inner { max-width: 1080px; margin: 0 auto; }
.ecs-related-header { margin-bottom: 18px; text-align: center; }
.ecs-related-eyebrow {
    font-size: var(--extra-small); font-weight: 700;
    color: var(--blue);
    text-transform: uppercase; letter-spacing: 0.12em;
    margin: 0 0 4px;
}
.ecs-related-title {
    margin: 0;
    font-size: 22px; font-weight: 800;
    letter-spacing: -0.02em; color: var(--text-main);
}
.ecs-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 20px;
}
.ecs-related-card {
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 22px 24px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(17, 24, 39, .03);
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
    text-decoration: none; color: inherit; display: block;
}
.ecs-related-card:hover {
    border-color: var(--blue);
    box-shadow: 0 12px 28px rgba(0, 113, 235, .10);
    transform: translateY(-1px);
}
.ecs-related-card-title {
    margin: 0 0 6px;
    font-size: var(--large); font-weight: 700;
    color: var(--text-main); letter-spacing: -0.01em;
}
.ecs-related-card-text {
    margin: 0 0 12px;
    font-size: var(--small);
    color: var(--text-muted);
    line-height: 1.55;
}
.ecs-related-card-cta {
    font-size: var(--extra-small); font-weight: 700;
    color: var(--blue);
    text-transform: uppercase; letter-spacing: 0.08em;
}
.ecs-related-card-cta::after { content: ' →'; }

/* Body-level CTA (lands on RPO service + a sibling tool) */
.ecs-cta-section {
    background: linear-gradient(180deg, #003e82 0%, #0058b8 100%);
    padding: 44px 22px 48px;
    color: #fff;
}
.ecs-cta-inner { max-width: 760px; margin: 0 auto; text-align: center; }
.ecs-cta-eyebrow {
    font-size: var(--extra-small);
    font-weight: 700;
    color: rgba(255, 255, 255, .75);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin: 0 0 6px;
}
.ecs-cta-title {
    margin: 0 0 12px;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #fff;
    line-height: 1.25;
}
.ecs-cta-text {
    margin: 0 auto 20px;
    max-width: 560px;
    font-size: var(--default);
    color: rgba(255, 255, 255, .88);
    line-height: 1.55;
}
.ecs-cta-actions {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}
.ecs-cta-btn {
    display: inline-flex;
    align-items: center;
    padding: 11px 20px;
    border-radius: 999px;
    font-size: var(--small);
    font-weight: 700;
    text-decoration: none;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.ecs-cta-btn-primary {
    background: #fff;
    color: var(--blue);
}
.ecs-cta-btn-primary:hover { background: #f4f8ff; }
.ecs-cta-btn-ghost {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .55);
}
.ecs-cta-btn-ghost:hover { border-color: #fff; background: rgba(255, 255, 255, .08); }

@media (max-width: 520px) {
    .ecs-cta-section { padding: 32px 18px 36px; }
    .ecs-cta-title { font-size: 20px; }
}

/* Page-bottom legal disclaimer */
.ecs-page-disclaimer {
    background: #fff;
    padding: 28px 22px 40px;
    border-top: 1px solid var(--border-subtle);
}
.ecs-page-disclaimer-inner {
    max-width: 760px; margin: 0 auto; text-align: center;
}
.ecs-page-disclaimer p {
    margin: 0;
    font-size: var(--small);
    color: var(--text-muted);
    line-height: 1.65;
}
.ecs-page-disclaimer strong { color: var(--text-main); font-weight: 700; }

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

/* PDF export pose: while html2canvas is rasterising the paper, drop the
   on-screen chrome (variable highlights, drop shadow, rounded corners,
   editable outline) so the captured canvas looks like a real printed page. */
.ecs-paper.is-printing {
    box-shadow: none !important;
    border-radius: 0 !important;
    outline: none !important;
}
.ecs-paper.is-printing .ecs-var {
    background: transparent !important;
}

@media (max-width: 520px) {
    .ecs-section { padding: 22px 12px 32px; }
    .ecs-export { padding: 14px 16px; }
    .ecs-email-gate { min-width: 0; width: 100%; }
}

/* === Supporting documents note ===
   Plain centered text strip between the tool section and the "How it works"
   prose. Lists the regulations / agreements this contract assumes exist on
   the employer side. Items use a CSS-generated middle-dot separator that
   collapses cleanly when optional items are toggled off. */
.ecs-docs-note {
    max-width: 760px;
    margin: 0 auto;
    padding: 32px 22px 28px;
    text-align: center;
    background: transparent;
}
.ecs-docs-note p {
    margin: 0 0 6px;
    font-size: var(--extra-small);
    color: var(--text-muted);
    line-height: 1.6;
}
.ecs-docs-note-title {
    font-weight: 600;
    color: var(--text-main);
    letter-spacing: 0.01em;
}
.ecs-docs-inline {
    list-style: none;
    padding: 0;
    margin: 8px 0;
    font-size: var(--extra-small);
    color: var(--text-muted);
    line-height: 1.85;
}
.ecs-docs-inline li {
    display: block;
}
.ecs-docs-inline li.is-hidden {
    display: none;
}
.ecs-docs-inline a {
    color: var(--blue);
    text-decoration: none;
    font-weight: 500;
}
.ecs-docs-inline a:hover { text-decoration: underline; }
.ecs-docs-note-sub {
    font-style: italic;
    margin-top: 4px;
}


/* ============================================================
 * Letter-format additions (used by termination notice and other
 * separation documents that follow the formal Japanese letter
 * structure: date, recipient, sender, title, body, 記/以上, signature)
 * ============================================================ */

.ecs-letter-recipient {
    margin-bottom: 22px;
}
.ecs-letter-recipient-name {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 4px;
}
.ecs-letter-recipient-address {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
}

.ecs-letter-sender {
    text-align: right;
    margin-bottom: 28px;
    font-size: 0.95rem;
    line-height: 1.55;
    color: var(--text-muted);
}
.ecs-letter-sender p { margin: 0; }
.ecs-letter-sender strong { color: var(--text-main); font-weight: 600; }

.ecs-letter-body { margin: 8px 0; }
.ecs-letter-body p { margin: 0 0 10px; line-height: 1.75; }

.ecs-letter-closing-right {
    text-align: right;
    margin: 12px 0;
    font-weight: 500;
}

.ecs-letter-record-marker {
    text-align: center;
    font-weight: 700;
    letter-spacing: 0.4em;
    margin: 16px 0 12px;
}

.ecs-letter-end-marker {
    text-align: right;
    font-weight: 700;
    letter-spacing: 0.2em;
    margin: 18px 0 22px;
}

.ecs-letter-conditions {
    list-style: none;
    counter-reset: ltr;
    padding: 0;
    margin: 0;
}
.ecs-letter-conditions > li {
    counter-increment: ltr;
    position: relative;
    padding: 12px 0 12px 28px;
    border-bottom: 1px dashed rgba(17, 24, 39, 0.08);
    line-height: 1.7;
}
.ecs-letter-conditions > li:last-child {
    border-bottom: none;
}
.ecs-letter-conditions > li.is-hidden { display: none; }
.ecs-letter-conditions > li::before {
    content: counter(ltr) ".";
    position: absolute;
    left: 0;
    top: 12px;
    font-weight: 700;
    color: var(--text-main);
    width: 24px;
}
.ecs-letter-conditions-label {
    display: block;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 4px;
}
.ecs-letter-conditions-detail {
    display: block;
    color: var(--text-muted);
    margin-left: 0;
    line-height: 1.65;
}

.ecs-letter-signature {
    text-align: right;
    margin-top: 28px;
    font-size: 0.95rem;
    line-height: 1.6;
}
.ecs-letter-signature p { margin: 0; }
.ecs-letter-signature strong { color: var(--text-main); font-weight: 600; }
.ecs-letter-signature-seal {
    margin-top: 14px;
    border-top: 1px solid rgba(17, 24, 39, 0.15);
    width: 240px;
    margin-left: auto;
    padding-top: 4px;
    color: var(--text-muted);
    font-size: var(--small);
}


/* ============================================================
 * Agreement-format additions (used by separation agreement and
 * other bilateral documents with 甲 / 乙 signature blocks)
 * ============================================================ */

.ecs-agreement-signatures {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px dashed rgba(17, 24, 39, 0.10);
}

.ecs-agreement-signature-block {
    font-size: 0.95rem;
    line-height: 1.6;
}

.ecs-agreement-signature-block p {
    margin: 0 0 4px;
    color: var(--text-muted);
}

.ecs-agreement-signature-block p:first-child {
    margin-bottom: 8px;
    font-size: 1rem;
    color: var(--text-main);
}

.ecs-agreement-signature-block strong {
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: 0.2em;
}

@media (max-width: 720px) {
    .ecs-agreement-signatures {
        grid-template-columns: 1fr;
        gap: 18px;
    }
}


/* ============================================================
 * Computed-summary block (used by severance-payment-notice rail
 * to display auto-calculated fields read-only)
 * ============================================================ */

.ecs-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px dashed rgba(17, 24, 39, 0.08);
    font-size: 0.92rem;
}
.ecs-summary-row:last-child { border-bottom: none; }

.ecs-summary-label {
    color: var(--text-muted);
    line-height: 1.4;
}

.ecs-summary-value {
    color: var(--text-main);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
}

.ecs-summary-row-total {
    margin-top: 4px;
    padding-top: 12px;
    border-top: 1px solid rgba(17, 24, 39, 0.10);
    border-bottom: none;
}

.ecs-summary-row-total .ecs-summary-label {
    color: var(--text-main);
    font-weight: 600;
}

.ecs-summary-row-total .ecs-summary-value {
    font-size: 1.05rem;
    font-weight: 700;
}
