:root {
    --tool-max: 980px;
}

* {
    box-sizing: border-box;
}

body.tool-page {
    margin: 0;
    background: linear-gradient(180deg, #f4f8fb 0%, #ffffff 320px);
    color: #1e293b;
}

.tools-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(30, 41, 59, 0.08);
}

.tools-header-inner {
    max-width: var(--tool-max);
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.tools-header .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.tools-header .logo-img {
    height: 36px;
    width: auto;
}

.tools-header .logo-text {
    font-weight: 700;
    font-size: 1.15rem;
    color: #2c6697;
    letter-spacing: -0.5px;
}

.tools-header .logo-text span {
    color: #277957;
}

.tools-nav {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 0.9rem;
}

.tools-nav a {
    color: #475569;
    text-decoration: none;
    font-weight: 500;
}

.tools-nav a:hover,
.tools-nav a.is-active {
    color: #2c6697;
}

.tool-main {
    max-width: var(--tool-max);
    margin: 0 auto;
    padding: 40px 20px 72px;
}

.tool-hero {
    max-width: 720px;
    margin-bottom: 28px;
}

.tool-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(39, 121, 87, 0.1);
    color: #277957;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.tool-hero h1 {
    margin: 14px 0 12px;
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: #122b40;
}

.tool-hero p {
    margin: 0;
    font-size: 1.02rem;
    line-height: 1.65;
    color: #475569;
}

.tool-callout {
    margin: 20px 0 0;
    padding: 14px 18px;
    border-left: 4px solid #d97706;
    background: #fffbeb;
    border-radius: 0 12px 12px 0;
    color: #78350f;
    font-size: 0.92rem;
    line-height: 1.55;
}

.tool-card {
    background: #fff;
    border: 1px solid rgba(30, 41, 59, 0.1);
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 12px 40px rgba(30, 41, 59, 0.06);
}

.tool-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.tool-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tool-field label {
    font-size: 0.86rem;
    font-weight: 600;
    color: #334155;
}

.tool-field input,
.tool-field select {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
    color: #0f172a;
    font: inherit;
    font-size: 0.95rem;
}

.tool-field input:focus,
.tool-field select:focus {
    outline: 3px solid rgba(44, 102, 151, 0.18);
    border-color: #2c6697;
}

.tool-field .hint {
    font-size: 0.78rem;
    color: #64748b;
}

.tool-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-top: 20px;
}

.tool-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 12px 24px;
    border: 0;
    border-radius: 10px;
    font: inherit;
    font-size: 0.94rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tool-btn-primary {
    background: linear-gradient(120deg, #2c6697, #277957);
    color: #fff;
    box-shadow: 0 8px 20px rgba(44, 102, 151, 0.24);
}

.tool-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(44, 102, 151, 0.3);
}

.tool-btn-ghost {
    background: #fff;
    color: #2c6697;
    border: 1.5px solid #b6cfe2;
}

.tool-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.tool-error {
    margin: 14px 0 0;
    padding: 12px 14px;
    border-radius: 10px;
    background: #fef2f2;
    color: #991b1b;
    font-size: 0.9rem;
}

.tool-note {
    margin: 16px 0 0;
    font-size: 0.82rem;
    line-height: 1.55;
    color: #64748b;
}

.tool-result {
    margin-top: 28px;
}

.tool-result-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 14px;
}

.tool-result h2 {
    margin: 0;
    font-size: 1.25rem;
    color: #122b40;
}

.tool-result-summary {
    margin: 0;
    color: #64748b;
    font-size: 0.88rem;
}

.tool-day {
    margin: 22px 0 8px;
    font-size: 0.92rem;
    font-weight: 700;
    color: #2c6697;
    text-transform: capitalize;
}

.tool-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.tool-table th,
.tool-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
    vertical-align: top;
}

.tool-table th {
    background: #f1f5f9;
    color: #334155;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.tool-table td.time {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: #122b40;
    white-space: nowrap;
}

.tool-cta {
    margin-top: 34px;
    padding: 24px;
    border-radius: 18px;
    background: linear-gradient(120deg, #122b40, #1f4a6e);
    color: #e2e8f0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.tool-cta p {
    margin: 0;
    max-width: 560px;
    line-height: 1.55;
}

.tool-cta strong {
    color: #fff;
}

.tool-cta .tool-btn {
    background: #fff;
    color: #1f4a6e;
}

.tool-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
    margin-top: 24px;
}

.tool-download-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid rgba(30, 41, 59, 0.1);
    border-radius: 16px;
    padding: 22px;
    gap: 10px;
}

.tool-download-card h3 {
    margin: 0;
    font-size: 1.05rem;
    color: #122b40;
}

.tool-download-card p {
    margin: 0;
    flex: 1;
    color: #475569;
    font-size: 0.9rem;
    line-height: 1.55;
}

.tool-download-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 6px;
}

.tool-download-actions a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 14px;
    border-radius: 8px;
    background: #eff6fb;
    color: #2c6697;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
}

.tool-download-actions a:hover {
    background: #dcecf7;
}

.tools-footer {
    border-top: 1px solid rgba(30, 41, 59, 0.08);
    padding: 24px 20px 34px;
    color: #64748b;
    font-size: 0.82rem;
}

.tools-footer-inner {
    max-width: var(--tool-max);
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
}

.tools-footer a {
    color: #2c6697;
}

.print-only {
    display: none;
}

@media (max-width: 720px) {
    .tools-nav {
        gap: 12px;
    }

    .tools-nav a:not(.btn) {
        display: none;
    }

    .tool-form {
        grid-template-columns: 1fr;
    }

    .tool-card {
        padding: 18px;
    }
}

@media print {
    body.tool-page {
        background: #fff;
    }

    .tools-header,
    .tool-hero,
    .tool-card,
    .tool-cta,
    .tools-footer,
    .tool-actions,
    .tool-note,
    .print-hide {
        display: none !important;
    }

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

    .print-only {
        display: block;
    }

    .print-only h1 {
        font-size: 16pt;
        margin: 0 0 4pt;
    }

    .print-only p {
        font-size: 9pt;
        margin: 0 0 10pt;
        color: #334155;
    }

    .tool-table {
        font-size: 9pt;
    }

    .tool-table th,
    .tool-table td {
        padding: 5pt 6pt;
        border: 1px solid #94a3b8;
    }

    .tool-table th {
        background: #e2e8f0;
    }

    .tool-day {
        margin: 12pt 0 4pt;
        color: #000;
    }

    @page {
        size: A4;
        margin: 12mm;
    }
}
