@import url('https://fonts.googleapis.com/earlyaccess/nanummyeongjo.css');
@import url('https://fonts.googleapis.com/earlyaccess/nanumgothic.css');

@font-face {
    font-family: 'NanumSquareRound';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_two@1.0/NanumSquareRound.woff') format('woff');
    font-weight: normal;
    font-display: swap;
}
@font-face {
    font-family: 'MaruBuri';
    src: url('https://hangeul.pstatic.net/hangeul_static/webfont/MaruBuri/MaruBuri-ExtraLight.woff2') format('woff2');
    font-weight: 200;
    font-display: swap;
}
@font-face {
    font-family: 'MaruBuri';
    src: url('https://hangeul.pstatic.net/hangeul_static/webfont/MaruBuri/MaruBuri-Light.woff2') format('woff2');
    font-weight: 300;
    font-display: swap;
}
@font-face {
    font-family: 'MaruBuri';
    src: url('https://hangeul.pstatic.net/hangeul_static/webfont/MaruBuri/MaruBuri-Regular.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: 'MaruBuri';
    src: url('https://hangeul.pstatic.net/hangeul_static/webfont/MaruBuri/MaruBuri-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-display: swap;
}
@font-face {
    font-family: 'MaruBuri';
    src: url('https://hangeul.pstatic.net/hangeul_static/webfont/MaruBuri/MaruBuri-Bold.woff2') format('woff2');
    font-weight: 700;
    font-display: swap;
}
@font-face {
    font-family: 'GangwonEducationSaeum';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2201-2@1.0/GangwonEduSaeeum_OTFMediumA.woff') format('woff');
    font-weight: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Lotteria';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2302@1.0/LOTTERIADDAG.woff2') format('woff2');
    font-weight: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Pretendard';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/pretendard@1.0/Pretendard-Medium.woff2') format('woff2');
    font-weight: 500;
    font-display: swap;
}
@font-face {
    font-family: 'HeirofLight';
    src: url('../data/font/HeirofLightRegular.ttf') format('truetype');
    font-weight: normal;
    font-display: swap;
}

/* 일정표 메이커 — 헤더/푸터/배경은 main.css.
   배치 기준: playlist(가운데 정렬, padding 1.5rem 2rem) · wiki(max-width 1200) */

html, body.sch-site-page {
    height: 100%;
}

body.sch-site-page {
    font-family: var(--font-main);
    overflow: hidden;
}

.sch-main {
    flex: 1;
    min-height: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 2rem;
    overflow: auto;
}

.sch-stage {
    --sch-tpl-w: 168px;
    --sch-tool-w: 280px;
    --sch-scroll-gutter: 0.75rem;
    --sch-col-gap: 2rem;
    --sch-card-gap: 0.65rem;
    --sch-border: 2px;
    --sch-author-pad-y: 0.18rem;
    --sch-author-size: 0.72rem;
    --sch-author-lh: 1.15;
    --sch-author-cut: 16px;
    --sch-thumb-h: calc(var(--sch-tpl-w) * 9 / 16);
    --sch-author-h: calc(
        var(--sch-border) * 2
        + var(--sch-author-pad-y) * 2
        + var(--sch-author-size) * var(--sch-author-lh)
    );
    --sch-card-h: calc(var(--sch-thumb-h) + var(--sch-author-h));
    --sch-list-h: calc(var(--sch-card-h) * 5 + var(--sch-card-gap) * 4);
    --sch-preview-w: calc(var(--sch-list-h) * 16 / 9);
    width: 100%;
    max-width: calc(
        var(--sch-tpl-w) + var(--sch-scroll-gutter)
        + var(--sch-preview-w)
        + var(--sch-tool-w)
        + var(--sch-col-gap) * 2
    );
}

.sch-page-title {
    font-family: var(--font-page-title);
    font-size: 2rem;
    font-weight: 600;
    line-height: 1.2;
    margin: 0 0 0.65rem;
    padding-top: 0.65rem;
}

.sch-layout {
    display: grid;
    grid-template-columns:
        calc(var(--sch-tpl-w) + var(--sch-scroll-gutter))
        minmax(0, 1fr)
        var(--sch-tool-w);
    gap: var(--sch-col-gap);
    align-items: stretch;
}

.sch-tpl-pane,
.sch-tool-pane {
    height: 0;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(119, 185, 252, 0.7) rgba(255, 255, 255, 0.08);
}

.sch-tpl-pane::-webkit-scrollbar,
.sch-tool-pane::-webkit-scrollbar {
    width: 6px;
}

.sch-tpl-pane::-webkit-scrollbar-track,
.sch-tool-pane::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 100px;
}

.sch-tpl-pane::-webkit-scrollbar-thumb,
.sch-tool-pane::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--secondary), var(--primary));
    border-radius: 100px;
}

.sch-tpl-pane::-webkit-scrollbar-thumb:hover,
.sch-tool-pane::-webkit-scrollbar-thumb:hover {
    background: var(--secondary);
}

.sch-tpl-pane {
    padding-right: var(--sch-scroll-gutter);
}

.sch-tpl-list {
    display: flex;
    flex-direction: column;
    gap: var(--sch-card-gap);
}

.sch-tpl-card {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    width: 100%;
    height: var(--sch-card-h);
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.sch-tpl-item {
    display: block;
    box-sizing: border-box;
    width: 100%;
    height: var(--sch-thumb-h);
    flex-shrink: 0;
    overflow: hidden;
    border: var(--sch-border) solid var(--border);
}

.sch-tpl-card.is-selected .sch-tpl-item {
    border-color: #2b7dff;
}

.sch-tpl-thumb {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: transparent;
    border: none;
}

.sch-tpl-author {
    display: block;
    box-sizing: border-box;
    width: fit-content;
    max-width: 100%;
    height: var(--sch-author-h);
    align-self: flex-start;
    padding: var(--sch-author-pad-y) calc(0.5rem + var(--sch-author-cut)) var(--sch-author-pad-y) 0.5rem;
    font-size: var(--sch-author-size);
    line-height: var(--sch-author-lh);
    color: var(--text);
    border: var(--sch-border) solid var(--secondary);
    background: var(--secondary);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    clip-path: polygon(0 0, 100% 0, calc(100% - var(--sch-author-cut)) 100%, 0 100%);
}

.sch-preview-pane {
    min-width: 0;
    min-height: 0;
}

.sch-preview-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    border: 2px solid var(--border);
    background: transparent;
    overflow: hidden;
}

.sch-preview-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.sch-preview-error {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 1rem;
    text-align: center;
    font-size: 0.95rem;
    color: var(--text);
}

.sch-preview-error[hidden] {
    display: none;
}

.sch-tool-pane {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding-right: 0.35rem;
}

.sch-image-tools {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-areas:
        "add preview save"
        "sliders sliders sliders";
    gap: 0.65rem;
    align-items: center;
    flex-shrink: 0;
}

.sch-btn-add,
.sch-btn-preview,
.sch-btn-save {
    width: 100%;
    justify-content: center;
    padding-left: 0.4rem;
    padding-right: 0.4rem;
}

.sch-btn-add { grid-area: add; }
.sch-btn-preview { grid-area: preview; }
.sch-sliders { grid-area: sliders; min-width: 0; }
.sch-btn-save { grid-area: save; }

.sch-style-btn,
.sch-stepper button {
    font-family: var(--font-main);
    color: var(--text);
    background: transparent;
    border: 2px solid var(--border);
}

.sch-btn {
    display: flex;
    align-items: center;
    font-family: var(--font-main);
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    color: var(--text);
    background: var(--card-bg);
    border: 2px solid var(--border);
    text-decoration: none;
    transition: border-color 0.2s ease, color 0.2s ease;
    white-space: nowrap;
}

.sch-btn:hover {
    color: var(--fgb-dark);
    border-color: var(--fgb-dark);
}

.sch-btn:disabled,
.sch-stepper button:disabled {
    cursor: default;
    opacity: 0.7;
}

.sch-slider-row {
    display: grid;
    grid-template-columns: 2.4rem minmax(0, 1fr) auto;
    gap: 0.45rem;
    align-items: center;
    margin-bottom: 0.45rem;
    font-size: 0.88rem;
}

.sch-slider-row > span:first-child {
    font-weight: 600;
}

.sch-slider-row:last-child {
    margin-bottom: 0;
}

.sch-range {
    --sch-range-track: linear-gradient(
        to right,
        rgba(255, 255, 255, 0.3) 0%,
        rgba(255, 255, 255, 0.3) var(--sch-fill-a, 50%),
        var(--secondary) var(--sch-fill-a, 50%),
        var(--secondary) var(--sch-fill-b, 50%),
        rgba(255, 255, 255, 0.3) var(--sch-fill-b, 50%),
        rgba(255, 255, 255, 0.3) 100%
    );
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    background: var(--sch-range-track);
}

.sch-range::-webkit-slider-runnable-track {
    height: 4px;
    border-radius: 2px;
    background: transparent;
}

.sch-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 11px;
    height: 11px;
    margin-top: -3.5px;
    border-radius: 50%;
    background: var(--secondary);
    box-shadow: 0 0 4px rgba(119, 185, 252, 0.7);
    cursor: pointer;
}

.sch-range::-moz-range-track {
    height: 4px;
    border-radius: 2px;
    border: none;
    background: var(--sch-range-track);
}

.sch-range::-moz-range-progress {
    background: transparent;
}

.sch-range::-moz-range-thumb {
    width: 11px;
    height: 11px;
    border: none;
    border-radius: 50%;
    background: var(--secondary);
    box-shadow: 0 0 4px rgba(119, 185, 252, 0.7);
    cursor: pointer;
}

.sch-stepper {
    display: flex;
    align-items: center;
    gap: 0.15rem;
}

.sch-stepper button,
.sch-style-btn {
    font-size: 0.88rem;
    border-width: 1px;
    min-width: 1.5rem;
    height: 1.65rem;
    padding: 0 0.3rem;
    cursor: pointer;
}

.sch-stepper input[type="number"] {
    width: 3.2rem;
    height: 1.65rem;
    font-family: var(--font-main);
    font-size: 0.88rem;
    text-align: center;
    color: var(--text);
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border);
    outline: none;
    box-shadow: none;
    -moz-appearance: textfield;
    appearance: textfield;
}

.sch-stepper input[type="number"]:focus,
.sch-stepper input[type="number"]:focus-visible {
    outline: none;
    box-shadow: none;
    border-bottom-color: var(--border);
}

.sch-stepper input[type="number"]::-webkit-outer-spin-button,
.sch-stepper input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.sch-text-fields {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 0.65rem 0.7rem;
    background: rgba(255, 255, 255, 0.5);
}

.sch-text-toolbar {
    position: absolute;
    z-index: 5;
    left: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    width: 100%;
    padding: 0.4rem 0.45rem;
    margin: 0;
    box-sizing: border-box;
    background: #fff;
    border: 1px solid rgba(8, 24, 73, 0.15);
    color: var(--fgb-dark);
}

.sch-toolbar-close {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 1.65rem;
    height: 1.65rem;
    margin-left: auto;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--fgb-dark);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
}

.sch-toolbar-close:hover {
    background: rgba(8, 24, 73, 0.08);
}

.sch-text-toolbar[hidden] {
    display: none;
}

.sch-text-toolbar-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.3rem;
    align-items: center;
}


.sch-text-toolbar select,
.sch-text-toolbar .sch-style-btn,
.sch-text-toolbar .sch-stepper button,
.sch-text-toolbar .sch-stepper input[type="number"] {
    color: var(--fgb-dark);
    border-color: #c8d0de;
}

.sch-text-toolbar .sch-stepper input[type="number"] {
    width: 2.2rem;
}

.sch-text-toolbar-row-color {
    justify-content: flex-start;
    gap: 0.5rem;
}

.sch-color-theme,
.sch-color-custom {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
}

.sch-color-theme {
    flex: 1;
}

.sch-color-theme[hidden] {
    display: none;
}

.sch-color-custom {
    margin-left: auto;
    flex-shrink: 0;
}

.sch-color-label {
    flex-shrink: 0;
    font-family: var(--font-main);
    font-size: 0.75rem;
    line-height: 1;
    color: var(--fgb-dark);
    white-space: nowrap;
}

.sch-palette {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    align-items: center;
    min-width: 0;
}

.sch-palette-swatch {
    box-sizing: border-box;
    width: 1.15rem;
    height: 1.15rem;
    padding: 0;
    border: 1px solid #c8d0de;
    border-radius: 2px;
    cursor: pointer;
}

.sch-palette-swatch.is-active {
    outline: 2px solid #081849;
    outline-offset: 1px;
}

.sch-text-toolbar .sch-color-input {
    width: 1.65rem;
    height: 1.65rem;
    padding: 0;
    border: 1px solid #c8d0de;
    background: #fff;
    cursor: pointer;
    flex-shrink: 0;
}

.sch-text-toolbar .sch-color-input::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.sch-text-toolbar .sch-color-input::-webkit-color-swatch {
    border: none;
    border-radius: 2px;
}

.sch-text-toolbar .sch-color-input::-moz-color-swatch {
    border: none;
    border-radius: 2px;
}

.sch-text-toolbar .sch-style-btn.is-active {
    border-color: var(--fgb-dark);
    background: rgba(8, 24, 73, 0.08);
    color: var(--fgb-dark);
}

.sch-font-select {
    position: relative;
    flex: 1;
    min-width: 0;
}

.sch-font-select-toggle {
    position: relative;
    display: block;
    width: 100%;
    height: 1.65rem;
    font-size: 0.95rem;
    line-height: 1.35;
    color: #081849;
    background: #fff;
    border: 1px solid #c8d0de;
    padding: 0 1.35rem 0 0.35rem;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}

.sch-font-select-toggle::after {
    content: '';
    position: absolute;
    top: 0.7rem;
    right: 0.4rem;
    border: 0.28rem solid transparent;
    border-top-color: #081849;
    border-bottom-width: 0;
    pointer-events: none;
}

.sch-font-select-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 2px);
    z-index: 6;
    min-width: 10.5rem;
    margin: 0;
    padding: 0.15rem 0;
    list-style: none;
    background: #fff;
    border: 1px solid #c8d0de;
    box-shadow: 0 4px 14px rgba(8, 24, 73, 0.14);
}

.sch-font-select-menu[hidden] {
    display: none;
}

.sch-font-select-option {
    padding: 0.28rem 0.45rem;
    font-size: 0.95rem;
    line-height: 1.4;
    color: #081849;
    white-space: nowrap;
    cursor: pointer;
}

.sch-font-select-option[data-font="GangwonEducationSaeum"] {
    font-size: 1.15rem;
}

.sch-font-select-option.is-theme::after {
    content: '테마';
    margin-left: 0.4rem;
    font-family: var(--font-main);
    font-size: 0.68rem;
    letter-spacing: 0;
    color: #4a7ab5;
}

.sch-font-select-option:hover,
.sch-font-select-option.is-active {
    background: rgba(8, 24, 73, 0.08);
}

.sch-font-select-sep {
    height: 1px;
    margin: 0.2rem 0.45rem;
    padding: 0;
    background: #d5dbe6;
    pointer-events: none;
}

.sch-align-group {
    display: flex;
    gap: 0.25rem;
}

.sch-style-btn svg {
    display: block;
    width: 0.95rem;
    height: 0.95rem;
}

.sch-style-btn[data-style="bold"] {
    font-weight: 700;
}

.sch-style-italic {
    font-style: italic;
}

.sch-style-strike {
    text-decoration: line-through;
}

.sch-text-rows {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.sch-text-row {
    display: grid;
    grid-template-columns: 3.6rem minmax(0, 1fr) 2.55rem;
    gap: 0.5rem;
    align-items: center;
    min-height: 1.55rem;
}

.sch-text-row[hidden] {
    display: none;
}

.sch-day-toggle {
    position: relative;
    z-index: 1;
    height: 1.55rem;
    padding: 0 0.2rem;
    border: 1px solid var(--fgb-dark);
    background: var(--fgb-dark);
    color: #fff;
    font-family: var(--font-main);
    font-size: 0.78rem;
    line-height: 1;
    cursor: pointer;
}

.sch-day-toggle[aria-pressed="true"] {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.sch-text-row label {
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
    color: var(--fgb-dark);
}

.sch-text-row .sch-text-input {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    min-height: 1.55rem;
    font-family: 'GangwonEducationSaeum', var(--font-main);
    font-size: 1.1rem;
    line-height: 1;
    color: var(--fgb-dark);
    caret-color: var(--fgb-dark);
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--fgb-dark);
    padding: 0;
    overflow: hidden;
    outline: none;
    white-space: pre-wrap;
    word-break: break-word;
    text-align: left;
}

.sch-text-row .sch-text-input[data-font="GangwonEducationSaeum"] {
    font-size: 1.45rem;
}

.sch-text-row .sch-text-input:empty::before {
    content: '';
}

.sch-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: rgba(8, 24, 73, 0.72);
}

.sch-lightbox[hidden] {
    display: none;
}

.sch-lightbox-canvas {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.35);
}

.sch-lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1.2rem;
    width: 2.2rem;
    height: 2.2rem;
    padding: 0;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
}

.sch-lightbox-close:hover {
    color: var(--secondary);
}

@media (max-width: 980px) {
    html, body.sch-site-page {
        height: auto;
        min-height: 100vh;
        overflow: auto;
    }

    .sch-main {
        align-items: flex-start;
        padding: 1rem 0.75rem;
        overflow: visible;
    }

    .sch-page-title {
        padding-top: 0;
    }

    .sch-layout {
        height: auto;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto;
        gap: 1.5rem;
    }

    .sch-tpl-pane {
        width: 100%;
        height: auto;
        min-height: 0;
        max-height: none;
        overflow-x: auto;
        overflow-y: hidden;
        padding-right: 0;
        padding-bottom: var(--sch-scroll-gutter);
    }

    .sch-tpl-pane::-webkit-scrollbar,
    .sch-tool-pane::-webkit-scrollbar {
        height: 6px;
    }

    .sch-tool-pane {
        width: 100%;
        height: auto;
        min-height: 0;
        max-height: none;
        overflow: visible;
        padding-right: 0;
    }

    .sch-tpl-list {
        flex-direction: row;
        flex-wrap: nowrap;
    }

    .sch-tpl-card {
        width: 132px;
        height: auto;
        flex-shrink: 0;
    }

    .sch-tpl-item {
        height: auto;
        aspect-ratio: 16 / 9;
    }

    .sch-preview-frame {
        height: auto;
    }

    .sch-image-tools {
        grid-template-columns: auto auto;
        justify-content: space-between;
    }
}
