.working-time-calculator {
    padding-top: 18px;
}

.working-time-card {
    margin-top: 34px;
}

.working-time-header {
    max-width: 900px;
    margin-bottom: 30px;
}

.working-time-kicker {
    margin: 0 0 12px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.working-time-header h1 {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(52px, 7vw, 80px);
    font-weight: 400;
    line-height: 0.98;
    letter-spacing: -0.055em;
    text-wrap: balance;
}

.working-time-lead {
    max-width: 820px;
    margin: 20px 0 0;
    color: var(--muted);
    font-size: clamp(17px, 1.8vw, 20px);
    line-height: 1.6;
    text-wrap: balance;
}

.working-time-scope {
    padding: 20px 24px;
    border: 1px solid rgba(31, 95, 74, 0.16);
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #edf6f1, #f8fbf9);
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    color: var(--muted);
    line-height: 1.6;
}

.working-time-scope strong {
    color: var(--accent-hover);
}

#working-time-form {
    margin-top: 20px;
    display: grid;
    gap: 20px;
}

.settings-panel,
.calendar-panel {
    padding: clamp(26px, 3vw, 38px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.82);
    box-shadow: var(--shadow-soft);
}

.form-section {
    margin: 0;
}

.panel-heading {
    margin-bottom: 28px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.panel-number {
    width: 42px;
    height: 42px;
    margin: 0;
    border-radius: 50%;
    background: var(--accent-soft);
    display: grid;
    place-items: center;
    color: var(--accent-hover);
    font-size: 12px;
    font-weight: 700;
}

.panel-heading h2,
.result-section h3 {
    margin: 0;
    font-size: 24px;
    line-height: 1.2;
}

.panel-heading p {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.65;
}

.working-time-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.input-with-unit {
    position: relative;
}

.input-with-unit input {
    padding-right: 70px;
}

.input-with-unit > span {
    position: absolute;
    top: 50%;
    right: 16px;
    color: var(--muted);
    font-size: 14px;
    transform: translateY(-50%);
    pointer-events: none;
}

.field-note,
.calendar-refresh-note,
.empty-state,
.option-note {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

.calendar-refresh-note {
    margin: 10px 0 0;
}

.calendar-options {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.calendar-option + .calendar-option {
    border-top: 1px solid var(--border);
}

details.calendar-option summary {
    min-height: 82px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    cursor: pointer;
    list-style: none;
}

details.calendar-option summary::-webkit-details-marker {
    display: none;
}

.calendar-option summary strong,
.calendar-option summary small {
    display: block;
}

.calendar-option summary small {
    margin-top: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
}

.details-toggle {
    width: 12px;
    height: 12px;
    flex: 0 0 auto;
    border-right: 2px solid var(--accent);
    border-bottom: 2px solid var(--accent);
    transform: rotate(45deg) translateY(-3px);
    transition: transform var(--motion-standard);
}

details[open] .details-toggle {
    transform: rotate(225deg) translate(-2px, -2px);
}

.calendar-option-body {
    padding: 0 20px 20px;
}

.option-actions {
    margin-bottom: 14px;
    display: flex;
    justify-content: flex-end;
}

.option-note {
    margin: 0 0 14px;
}

.holiday-option {
    padding: 22px 20px;
}

.holiday-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.holiday-heading p {
    max-width: 700px;
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

.exception-row,
.replacement-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: end;
    margin-top: 12px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.72);
}

.swap-row {
    grid-template-columns: 1fr 1fr auto;
}

.exception-row label,
.replacement-row label {
    display: block;
}

.exception-row label > span,
.replacement-row label > span {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 700;
}

.replacement-row {
    grid-template-columns: minmax(240px, 1fr) minmax(220px, 1fr);
}

.replacement-row strong,
.replacement-row span {
    display: block;
}

.replacement-row span {
    margin-top: 5px;
    color: var(--muted);
    font-size: 14px;
}

.remove-row {
    padding: 11px 14px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    box-shadow: none;
}

.remove-row:hover {
    background: var(--danger-bg);
    color: var(--danger-text);
}

.field-note,
.empty-state {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

.working-time-result {
    margin-top: 34px;
    padding-top: 28px;
    border-top: 1px solid var(--border);
}

.result-heading {
    align-items: center;
}

.result-heading h2 {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(32px, 4vw, 44px);
    font-weight: 400;
    line-height: 1.08;
    letter-spacing: -0.04em;
}

.result-range {
    margin: 8px 0 24px;
    color: var(--muted);
}

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

.summary-card {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--accent-soft);
}

.summary-card span,
.summary-card small {
    display: block;
    color: var(--muted);
}

.summary-card strong {
    display: block;
    margin: 8px 0;
    font-size: 25px;
    line-height: 1.2;
}

.result-section {
    margin-top: 32px;
}

.table-wrapper {
    margin-top: 16px;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 13px 15px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    white-space: nowrap;
}

th {
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

tbody tr:last-child td {
    border-bottom: 0;
}

.details-section details {
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.details-section summary {
    cursor: pointer;
    font-weight: 700;
}

.details-section h4 {
    margin: 16px 0 8px;
}

.details-section ul {
    margin: 0;
    padding-left: 20px;
    line-height: 1.7;
}

.result-assumption {
    margin: 28px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.working-time-download {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 14px 12px;
    align-items: center;
}

.working-time-download h3 {
    flex-basis: 100%;
    margin: 0;
    font-size: 17px;
}

.working-time-download .pdf-brand-option {
    width: fit-content;
    min-height: 42px;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid rgba(31, 95, 74, 0.16);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.68);
    gap: 10px;
    cursor: pointer;
}

.working-time-download .pdf-brand-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

@media (max-width: 800px) {
    .working-time-grid,
    .summary-grid {
        grid-template-columns: 1fr;
    }

    .section-heading,
    .result-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .swap-row,
    .replacement-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .working-time-download button,
    .working-time-download .pdf-brand-option {
        width: 100%;
    }
}

#working-time-form {
    display: flow-root;
}

.working-time-submit {
    display: block;
    margin: 24px 0 0;
}

.working-time-card .related-articles {
    border-top: 0;
}

@media print {
    .working-time-result {
        margin-top: 0;
        padding-top: 0;
        border: 0;
    }

    .working-time-result .result-assumption {
        display: none !important;
    }

    .summary-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .summary-card,
    .table-wrapper {
        break-inside: avoid;
        box-shadow: none;
    }

    .details-section details {
        break-inside: avoid;
    }

    .details-section details[open] summary {
        margin-bottom: 8px;
    }
}
