:root {
    --ink: #17201c;
    --ink-soft: #5f6964;
    --forest: #11211b;
    --forest-light: #1e342b;
    --paper: #f5f6f2;
    --white: #ffffff;
    --line: #dfe4df;
    --green: #64d19a;
    --green-dark: #12683e;
    --green-soft: #e5f7ed;
    --blue-soft: #e9eff5;
    --blue: #496476;
    --sand: #f3eadc;
    --sand-dark: #87633c;
    --gray-soft: #f0f1ee;
    --shadow: 0 20px 55px rgba(20, 36, 29, 0.08);
    --radius-large: 24px;
    --radius-medium: 16px;
}

* {
    box-sizing: border-box;
}

html {
    color-scheme: light;
    font-family: "DM Sans", sans-serif;
    background: var(--paper);
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at 8% 24%, rgba(100, 209, 154, 0.08), transparent 24rem),
        var(--paper);
    font-size: 16px;
    line-height: 1.5;
    overflow-x: hidden;
}

button,
input {
    font: inherit;
}

button,
input[type="range"] {
    -webkit-tap-highlight-color: transparent;
}

button {
    color: inherit;
}

a {
    color: inherit;
}

.page-shell {
    min-height: 100vh;
}

.app-header {
    position: relative;
    overflow: visible;
    min-height: 380px;
    padding: 28px max(5vw, 28px) 80px;
    color: var(--white);
    background:
        radial-gradient(circle at 84% 8%, rgba(100, 209, 154, 0.2), transparent 25rem),
        radial-gradient(circle at 5% 100%, rgba(100, 209, 154, 0.1), transparent 24rem),
        var(--forest);
}

.app-header::after {
    position: absolute;
    right: 0;
    bottom: -160px;
    width: 380px;
    height: 380px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    box-shadow:
        0 0 0 55px rgba(255, 255, 255, 0.025),
        0 0 0 110px rgba(255, 255, 255, 0.018);
    content: "";
    pointer-events: none;
}

.brand-link {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: color 160ms ease;
}

.brand-link:hover {
    color: var(--white);
}

.brand-mark {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.26);
    border-radius: 11px;
    color: var(--green);
    font-family: "Manrope", sans-serif;
    font-size: 12px;
    letter-spacing: -0.03em;
}

.header-copy {
    position: relative;
    z-index: 1;
    max-width: 760px;
    margin: 56px auto 0;
    text-align: center;
}

.eyebrow,
.section-kicker {
    margin: 0 0 10px;
    color: var(--green-dark);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.15em;
}

.eyebrow {
    color: var(--green);
}

.header-copy h1 {
    max-width: 720px;
    margin: 0 auto;
    font-family: "Manrope", sans-serif;
    font-size: clamp(36px, 6vw, 62px);
    font-weight: 800;
    letter-spacing: -0.055em;
    line-height: 1.03;
}

.header-intro {
    max-width: 640px;
    margin: 20px auto 0;
    color: rgba(255, 255, 255, 0.68);
    font-size: 17px;
}

.month-navigation {
    position: absolute;
    z-index: 2;
    bottom: -33px;
    left: 50%;
    display: flex;
    align-items: stretch;
    gap: 10px;
    width: min(470px, calc(100% - 32px));
    padding: 10px;
    border: 1px solid rgba(23, 32, 28, 0.08);
    border-radius: 20px;
    background: var(--white);
    box-shadow: 0 18px 46px rgba(11, 26, 19, 0.18);
    transform: translateX(-50%);
}

.icon-button {
    flex: 0 0 48px;
    border: 0;
    border-radius: 13px;
    background: var(--gray-soft);
    cursor: pointer;
    font-size: 28px;
    line-height: 1;
    transition: background 160ms ease, transform 160ms ease;
}

.icon-button:hover {
    background: #e4e7e2;
    transform: translateY(-1px);
}

.month-picker-label {
    display: flex;
    flex: 1;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    padding: 3px 9px;
    color: var(--ink-soft);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.month-picker-label input {
    width: 100%;
    margin-top: 1px;
    padding: 0;
    border: 0;
    outline: 0;
    color: var(--ink);
    background: transparent;
    font-family: "Manrope", sans-serif;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.app-main {
    width: min(1220px, calc(100% - 40px));
    margin: 0 auto;
    padding: 86px 0 42px;
}

.notice {
    margin-bottom: 20px;
    padding: 14px 18px;
    border: 1px solid #e0a8a8;
    border-radius: 12px;
    background: #fff0f0;
}

.summary-grid {
    display: grid;
    grid-template-columns: 1.25fr repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}

.summary-card {
    display: flex;
    min-height: 132px;
    flex-direction: column;
    justify-content: center;
    padding: 23px 25px;
    border: 1px solid var(--line);
    border-radius: var(--radius-medium);
    background: rgba(255, 255, 255, 0.82);
}

.summary-card-accent {
    border-color: var(--forest);
    color: var(--white);
    background: var(--forest);
}

.summary-label,
.summary-detail {
    color: var(--ink-soft);
    font-size: 13px;
}

.summary-card-accent .summary-label,
.summary-card-accent .summary-detail {
    color: rgba(255, 255, 255, 0.62);
}

.summary-card strong {
    margin: 3px 0 2px;
    font-family: "Manrope", sans-serif;
    font-size: 29px;
    letter-spacing: -0.04em;
}

.workspace-grid {
    display: grid;
    grid-template-columns: minmax(290px, 0.78fr) minmax(580px, 1.6fr);
    gap: 20px;
    align-items: stretch;
}

.panel {
    border: 1px solid var(--line);
    border-radius: var(--radius-large);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow);
}

.settings-panel,
.calendar-panel {
    padding: clamp(22px, 3vw, 34px);
}

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

.panel-heading h2,
.result-panel h2 {
    margin: 0;
    font-family: "Manrope", sans-serif;
    font-size: clamp(22px, 3vw, 28px);
    letter-spacing: -0.04em;
    line-height: 1.2;
}

.panel-description {
    margin: 10px 0 26px;
    color: var(--ink-soft);
    font-size: 14px;
}

.text-button {
    flex: 0 0 auto;
    padding: 4px 0;
    border: 0;
    color: var(--green-dark);
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
}

.text-button:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.preference-list {
    display: grid;
    gap: 18px;
}

.preference-row {
    display: grid;
    gap: 10px;
}

.preference-name {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    font-size: 14px;
}

.preference-name output {
    color: var(--ink-soft);
    font-size: 12px;
    text-align: right;
}

.preference-slider {
    width: 100%;
    height: 6px;
    margin: 0;
    border-radius: 999px;
    outline: 0;
    background: linear-gradient(90deg, #cad3d8, var(--green));
    cursor: pointer;
    appearance: none;
}

.preference-slider::-webkit-slider-thumb {
    width: 20px;
    height: 20px;
    border: 3px solid var(--white);
    border-radius: 50%;
    background: var(--forest);
    box-shadow: 0 2px 8px rgba(17, 33, 27, 0.22);
    appearance: none;
}

.preference-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border: 3px solid var(--white);
    border-radius: 50%;
    background: var(--forest);
    box-shadow: 0 2px 8px rgba(17, 33, 27, 0.22);
}

.preference-slider:focus-visible::-webkit-slider-thumb {
    outline: 3px solid rgba(100, 209, 154, 0.4);
    outline-offset: 2px;
}

.scale-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 9px;
    color: #89928e;
    font-size: 10px;
}

.calculation-note {
    display: flex;
    gap: 13px;
    margin-top: 28px;
    padding: 17px;
    border-radius: 14px;
    background: var(--green-soft);
    color: #244534;
    font-size: 13px;
}

.calculation-note p {
    margin: 4px 0 0;
    color: #51705f;
}

.note-icon {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    place-items: center;
    border-radius: 10px;
    color: var(--white);
    background: var(--green-dark);
    font-family: "Manrope", sans-serif;
    font-weight: 800;
}

.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    margin: -4px 0 22px;
    color: var(--ink-soft);
    font-size: 12px;
}

.calendar-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.legend-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.legend-remote { background: var(--green-dark); }
.legend-office { background: var(--blue); }
.legend-leave { background: var(--sand-dark); }
.legend-holiday { background: #a4aaa6; }

.weekday-header,
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
}

.weekday-header {
    margin-bottom: 8px;
}

.weekday-header span {
    padding: 0 8px;
    color: #858e89;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-align: center;
    text-transform: uppercase;
}

.day-card,
.day-placeholder {
    min-width: 0;
    min-height: 92px;
    border-radius: 13px;
}

.day-placeholder {
    border: 1px dashed #edf0ec;
    opacity: 0.5;
}

.day-card {
    position: relative;
    display: flex;
    overflow: hidden;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    padding: 12px;
    border: 1px solid transparent;
    background: var(--gray-soft);
    cursor: pointer;
    text-align: left;
    transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.day-card::before {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 4px;
    background: currentColor;
    content: "";
    opacity: 0.8;
}

.day-card:hover:not(:disabled) {
    border-color: rgba(23, 32, 28, 0.18);
    box-shadow: 0 7px 18px rgba(20, 36, 29, 0.08);
    transform: translateY(-2px);
}

.day-card:focus-visible,
.icon-button:focus-visible,
.text-button:focus-visible,
.primary-button:focus-visible {
    outline: 3px solid rgba(18, 104, 62, 0.32);
    outline-offset: 3px;
}

.day-card.is-remote {
    color: var(--green-dark);
    background: var(--green-soft);
}

.day-card.is-office {
    color: var(--blue);
    background: var(--blue-soft);
}

.day-card.is-leave {
    color: var(--sand-dark);
    background: var(--sand);
}

.day-card.is-holiday {
    color: #8b918e;
    background: #f1f2f0;
    cursor: default;
}

.day-card.is-today {
    box-shadow: inset 0 0 0 2px currentColor;
}

.day-number {
    color: currentColor;
    font-family: "Manrope", sans-serif;
    font-size: 18px;
    font-weight: 800;
    line-height: 1;
}

.day-status {
    display: block;
    overflow: hidden;
    width: 100%;
    color: currentColor;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.result-panel {
    display: grid;
    grid-template-columns: minmax(260px, 0.7fr) auto;
    gap: 28px;
    margin-top: 20px;
    padding: clamp(24px, 4vw, 38px);
}

.result-copy p:last-child {
    margin: 10px 0 0;
    color: var(--ink-soft);
}

.result-actions {
    display: flex;
    align-items: center;
}

.primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 48px;
    padding: 0 19px;
    border: 0;
    border-radius: 13px;
    color: var(--white);
    background: var(--forest);
    cursor: pointer;
    font-weight: 700;
    transition: background 160ms ease, transform 160ms ease;
}

.primary-button:hover {
    background: var(--forest-light);
    transform: translateY(-1px);
}

.primary-button svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.remote-date-list {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 9px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.remote-date-list li {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid #cde7d8;
    border-radius: 11px;
    color: #235b3b;
    background: #f0faf4;
    font-size: 13px;
    font-weight: 600;
}

.remote-date-list li::before {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
    background: var(--green-dark);
    content: "";
}

.remote-date-list .empty-result {
    grid-column: 1 / -1;
    border-color: var(--line);
    color: var(--ink-soft);
    background: var(--gray-soft);
}

.remote-date-list .empty-result::before {
    display: none;
}

.method-details {
    margin: 20px 0 0;
    padding: 0 4px;
    color: var(--ink-soft);
    font-size: 13px;
}

.method-details summary {
    width: fit-content;
    color: var(--ink);
    cursor: pointer;
    font-weight: 700;
}

.method-details p {
    max-width: 820px;
    margin: 10px 0 0;
}

.app-footer {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    width: min(1220px, calc(100% - 40px));
    margin: 0 auto;
    padding: 22px 0 34px;
    border-top: 1px solid var(--line);
    color: var(--ink-soft);
    font-size: 12px;
}

.app-footer a {
    color: var(--ink);
    font-weight: 700;
}

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

@media (max-width: 960px) {
    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .workspace-grid {
        grid-template-columns: 1fr;
    }

    .calendar-panel {
        grid-row: 1;
    }
}

@media (max-width: 640px) {
    .app-header {
        min-height: 400px;
        padding: 22px 20px 76px;
    }

    .header-copy {
        margin-top: 48px;
        text-align: left;
    }

    .header-copy h1 {
        font-size: 39px;
    }

    .header-intro {
        font-size: 15px;
    }

    .month-navigation {
        bottom: -31px;
    }

    .month-picker-label {
        padding-right: 3px;
        padding-left: 3px;
    }

    .month-picker-label input {
        font-size: 16px;
    }

    .app-main {
        width: min(100% - 24px, 1220px);
        padding-top: 70px;
    }

    .summary-grid {
        grid-template-columns: 1fr 1fr;
        gap: 9px;
    }

    .summary-card {
        min-height: 112px;
        padding: 17px;
    }

    .summary-card strong {
        font-size: 24px;
    }

    .summary-detail {
        font-size: 11px;
    }

    .settings-panel,
    .calendar-panel {
        padding: 20px 15px;
    }

    .calendar-heading {
        align-items: flex-end;
    }

    .calendar-legend {
        gap: 8px 11px;
    }

    .weekday-header,
    .calendar-grid {
        gap: 4px;
    }

    .day-card,
    .day-placeholder {
        min-height: 72px;
        border-radius: 10px;
    }

    .day-card {
        padding: 9px 7px;
    }

    .day-card::before {
        width: 3px;
    }

    .day-number {
        font-size: 16px;
    }

    .day-status {
        font-size: 8px;
    }

    .result-panel {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .result-actions,
    .primary-button {
        width: 100%;
    }

    .remote-date-list {
        grid-template-columns: 1fr 1fr;
    }

    .app-footer {
        flex-direction: column;
        width: min(100% - 28px, 1220px);
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
    }
}
