/* 알바 일지 - 책상 위의 급여 명세서와 근무 카드.
   바탕은 책상(회색), 그 위의 종이는 흰색, 글자는 잉크 하나. 빨강은 도장(공제·경고), 노랑은 형광펜(오늘·볼 곳 하나).
   색은 그 밖에는 알바 구분(사람이 고른 색)에만 쓴다. 고정폭 숫자 글꼴은 시각과 명세서의 금액에만. */

/* 글꼴: SUIT(본문), JetBrains Mono(시각·금액). 버전을 박아 두어 CDN 이 바뀌어도 화면이 그대로다. */
@font-face {
    font-family: "SUIT Variable";
    font-weight: 100 900;
    font-display: swap;
    src: url("https://cdn.jsdelivr.net/gh/sun-typeface/SUIT@2.0.5/fonts/variable/woff2/SUIT-Variable.woff2") format("woff2-variations");
}

@font-face {
    font-family: "Slip Mono";
    font-weight: 500;
    font-display: swap;
    src: url("https://cdn.jsdelivr.net/npm/@fontsource/jetbrains-mono@5.2.5/files/jetbrains-mono-latin-500-normal.woff2") format("woff2");
    unicode-range: U+0020-007E;
}

@font-face {
    font-family: "Slip Mono";
    font-weight: 700 800;
    font-display: swap;
    src: url("https://cdn.jsdelivr.net/npm/@fontsource/jetbrains-mono@5.2.5/files/jetbrains-mono-latin-700-normal.woff2") format("woff2");
    unicode-range: U+0020-007E;
}

:root {
    color-scheme: light dark;

    --desk: #e9edf1;
    --slip: #ffffff;
    --well: #f2f4f7;
    --line: #dde3e9;
    --line-2: #c3ccd5;
    --ink: #17212b;
    --ink-2: #3c4855;
    --ink-soft: #5c6875;
    --ink-faint: #75818d;

    --stamp: #e5484d;
    --stamp-ink: #c8323a;
    --marker: #ffe45c;
    --sun: #d93a40;
    --sat: #2f66c9;

    --sans: "SUIT Variable", "SUIT", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
    --mono: "Slip Mono", "SUIT Variable", ui-monospace, "Malgun Gothic", monospace;

    --r-paper: 6px;
    --r-ctl: 10px;
    --paper-shadow: 0 1px 0 rgba(23, 33, 43, .06), 0 6px 18px -10px rgba(23, 33, 43, .18);
    --app: 480px;
    --tabbar: 62px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
    :root {
        --desk: #0f1419;
        --slip: #1a2129;
        --well: #232c35;
        --line: #2c3640;
        --line-2: #3d4955;
        --ink: #e9edf1;
        --ink-2: #c5ced7;
        --ink-soft: #9ba7b3;
        --ink-faint: #7f8b97;
        --stamp: #ff6369;
        --stamp-ink: #ff7a7f;
        --marker: rgba(255, 228, 92, .38);
        --sun: #ff6b70;
        --sat: #6f9dff;
        --paper-shadow: none;
    }
}

*, *::before, *::after { box-sizing: border-box; }

/* 두 번 탭 확대를 막는다. 입력칸은 16px 아래로 내리지 않는다 - iOS 가 누를 때 확대한다. */
html { -webkit-text-size-adjust: 100%; touch-action: manipulation; }

body {
    margin: 0;
    background: var(--desk);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: -.01em;
    word-break: keep-all;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior-y: none;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 6px; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.num { font-variant-numeric: tabular-nums; }
/* 시각과 명세서 금액만 고정폭. 한글(원·만)은 SUIT 로 떨어진다. */
.clock, .lines.num li > span:last-child, .slip__amount { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.money { color: var(--ink); }
.minus { color: var(--stamp-ink); }
.soft { color: var(--ink-soft); }

/* 형광펜: 글자 아래 절반만 칠한다. */
.marker { background: linear-gradient(transparent 55%, var(--marker) 55%, var(--marker) 92%, transparent 92%); padding: 0 2px; margin: 0 -2px; }

/* ---------- 앱 틀 ---------- */

.app {
    max-width: var(--app);
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0 auto;
    overflow-x: clip;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 6px;
    height: calc(56px + env(safe-area-inset-top, 0px));
    padding: env(safe-area-inset-top, 0px) 12px 0 20px;
    /* 반투명이면 스크롤할 때 아래 글자가 흐리게 비쳐 제목이 안 읽힌다. 바탕색 그대로 막고, 내려가면 선 하나. */
    background: var(--desk);
    transition: box-shadow .15s;
}

.topbar--stuck { box-shadow: 0 1px 0 var(--line-2); }
.topbar--back { padding-left: 6px; }
.topbar__title { flex: 1; min-width: 0; font-size: 1.2rem; font-weight: 800; letter-spacing: -.03em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.icon-btn {
    display: grid;
    place-items: center;
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: var(--r-ctl);
    color: var(--ink-2);
}

.icon-btn:active { background: var(--well); }
.icon-btn svg { width: 22px; height: 22px; }

.content { padding: 4px 20px calc(var(--tabbar) + var(--safe-bottom) + 32px); }
.content--form { padding-bottom: calc(96px + var(--safe-bottom)); }

/* ---------- 아래 탭바 (폰) ---------- */

.tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    padding-bottom: var(--safe-bottom);
    background: var(--slip);
    border-top: 1px solid var(--line-2);
}

.tabbar__inner {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: center;
    max-width: var(--app);
    height: var(--tabbar);
    margin: 0 auto;
}

.tabbar__brand { display: none; }

.tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    font-size: .7rem;
    font-weight: 700;
    color: var(--ink-faint);
}

.tab svg { width: 24px; height: 24px; }
.tab--on { color: var(--ink); }

.tab--add > span {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--ink);
    color: var(--slip);
}

.tab--add svg { width: 24px; height: 24px; }
.tab__add-text { display: none; }

/* 입력 화면 아래에 붙는 저장 줄. 탭바 자리를 대신한다. */
.savebar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    padding: 12px 20px calc(12px + var(--safe-bottom));
    background: var(--slip);
    border-top: 1px solid var(--line-2);
}

.savebar__inner { display: flex; align-items: center; gap: 14px; max-width: calc(var(--app) - 40px); margin: 0 auto; }
.savebar__sum { flex: 1; min-width: 0; }
.savebar__sum small { display: block; font-size: .76rem; font-weight: 600; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.savebar__sum strong { display: block; font-family: var(--mono); font-size: 1.3rem; font-weight: 700; letter-spacing: -.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.savebar .btn { flex: none; min-width: 120px; }
.savebar--full .btn { flex: 1; }

/* ---------- 달 넘기기 ---------- */

.month-switch { display: flex; align-items: center; gap: 2px; margin: 2px 0 14px -8px; }
.month-switch strong { padding: 0 4px; font-size: 1.05rem; font-weight: 800; white-space: nowrap; }

.month-switch a, .year-head a {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: var(--r-ctl);
    color: var(--ink-soft);
}

.month-switch a:active, .year-head a:active { background: var(--slip); }
.month-switch svg, .year-head svg { width: 18px; height: 18px; }

.year-head { display: flex; align-items: center; gap: 2px; margin: 0 0 12px -8px; }
.year-head h2 { padding: 0 4px; font-size: 1.05rem; font-weight: 800; }

/* ---------- 종이 ---------- */

/* 흰 종이 한 장. 카드를 여러 장 늘어놓지 않고, 한 장 안에서 줄로 나눈다. */
.card, .sheet, .list, .form-card {
    background: var(--slip);
    border-radius: var(--r-paper);
    box-shadow: var(--paper-shadow);
}

.card { padding: 20px; }
.card + .card { margin-top: 12px; }

.section { margin-top: 32px; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0 2px 10px; }
.section__head h2 { font-size: 1.05rem; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; }
.section__head a { flex: none; font-size: .86rem; font-weight: 700; color: var(--ink-soft); white-space: nowrap; }

/* ---------- 급여 명세서 (이 앱의 얼굴) ---------- */

.slip-link { display: block; }
.slip-link:active .slip { transform: translateY(1px); }

/* 아래 끝은 톱니처럼 뜯어낸 종이. 그림자는 마스크에 잘리므로 감싼 쪽에서 drop-shadow. */
.slip-wrap { filter: drop-shadow(0 1px 0 rgba(23, 33, 43, .07)) drop-shadow(0 10px 14px rgba(23, 33, 43, .07)); }

.slip {
    --tooth: 7px;
    position: relative;
    padding: 20px 20px calc(18px + var(--tooth));
    border-radius: var(--r-paper) var(--r-paper) 0 0;
    background: var(--slip);
    -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / calc(var(--tooth) * 2) 100%;
    mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / calc(var(--tooth) * 2) 100%;
}

/* 알바 한 곳의 명세서는 맨 위에 그 알바 색 띠. */
.slip--job { border-top: 6px solid var(--job); }

.slip__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding-bottom: 12px; border-bottom: 2px solid var(--ink); }
.slip__title { font-size: 1rem; font-weight: 800; letter-spacing: -.02em; min-width: 0; }
.slip__meta { flex: none; font-size: .82rem; font-weight: 600; color: var(--ink-soft); white-space: nowrap; }
.slip-link .slip__meta::after { content: " ›"; }

.slip .lines { margin-top: 10px; }

/* 실수령: 명세서 맨 아래의 굵은 합계 */
.slip__total { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; column-gap: 12px; margin-top: 12px; padding-top: 12px; border-top: 2px solid var(--ink); }
.slip__total > span { font-size: .95rem; font-weight: 800; }
.slip__amount { margin-left: auto; font-size: clamp(1.7rem, 8.4vw, 2.3rem); font-weight: 800; line-height: 1.15; letter-spacing: -.04em; white-space: nowrap; }
.slip__amount small { margin-left: 2px; font-family: var(--sans); font-size: .5em; font-weight: 700; letter-spacing: 0; }

.slip__note { margin-top: 10px; font-size: .84rem; color: var(--ink-soft); overflow-wrap: anywhere; }
.slip__note b { color: var(--ink); font-weight: 800; white-space: nowrap; }
.slip__sub { margin-top: 4px; font-size: .84rem; color: var(--ink-soft); }

/* ---------- 줄 항목 (명세서·기준표) ---------- */

.lines { margin: 0; padding: 0; list-style: none; }
.lines li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 6px 0; font-size: .95rem; }
.lines li > span:first-child { min-width: 0; color: var(--ink-2); overflow-wrap: anywhere; }
.lines li > span:last-child { flex: none; white-space: nowrap; font-weight: 600; }
.lines small { margin-left: 6px; font-size: .76rem; color: var(--ink-soft); }
.lines .indent > span:first-child { padding-left: 12px; font-size: .88rem; }

/* 금액 줄은 점선 지시선으로 이름과 금액을 잇는다. */
.lines.num li > span:first-child { display: flex; flex: 1; align-items: baseline; flex-wrap: wrap; }
.lines.num li > span:first-child::after { content: ""; flex: 1 0 16px; align-self: flex-end; margin: 0 0 6px 8px; border-bottom: 2px dotted var(--line-2); }
.lines.num li > span:first-child > small { order: 0; }
/* 주휴 주별 줄처럼 설명이 긴 들여쓴 줄: 지시선 없이 설명을 아래 줄로. */
.lines.num .indent > span:first-child { display: block; }
.lines.num .indent > span:first-child::after { display: none; }
.lines.num .indent small { display: block; margin: 1px 0 0; }

.lines .total { margin-top: 8px; padding-top: 12px; border-top: 2px solid var(--ink); font-size: 1.05rem; font-weight: 800; }
.lines .total > span { color: var(--ink); font-weight: 800; }
.lines.num .total > span:first-child::after { display: none; }
.lines .subtotal { margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--line); }
.lines.num .subtotal > span:first-child::after { display: none; }
/* 실수령 아래 덧줄: 아직 안 들어간 주휴 예상. 합계가 아니라는 것이 보이게 흐리게. */
.lines .pending { margin-top: 2px; font-size: .86rem; }
.lines .pending > span:last-child { color: var(--ink-soft); }

.empty { padding: 36px 20px; text-align: center; }
.empty h2 { font-size: 1.1rem; font-weight: 800; }
.empty p { margin-top: 6px; color: var(--ink-soft); font-size: .92rem; }
.empty .btn { margin-top: 18px; }
.empty--quiet { padding: 22px 20px; color: var(--ink-soft); font-size: .92rem; }

/* ---------- 근무 카드 (오늘 적을 알바) ---------- */

.today { margin-bottom: 8px; }
.today .list { margin-top: 10px; }

.quick { display: grid; gap: 10px; margin-bottom: 10px; }

.quick__btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 76px;
    padding: 10px 12px 10px 18px;
    border-left: 6px solid var(--job);
    border-radius: var(--r-paper);
    background: var(--slip);
    box-shadow: var(--paper-shadow);
}

.quick__link { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; padding: 4px 0; }
.quick__link:active { opacity: .7; }
.quick__plus { display: none; }
.quick__main { flex: 1; min-width: 0; }
.quick__name { display: flex; align-items: center; gap: 6px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quick__time { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; margin-top: 2px; font-size: .84rem; color: var(--ink-soft); }
.quick__time .clock { font-size: 1.02rem; font-weight: 700; color: var(--ink); white-space: nowrap; }
.quick__time .clock--soft { color: var(--ink-2); font-weight: 500; }
.quick__pay { white-space: nowrap; }
.quick__form { flex: none; margin: 0; }
.quick__go { flex: none; color: var(--ink-faint); font-size: 1.4rem; padding: 0 4px; }

/* [기록]: 근무 카드를 찍는 단추. 일정대로 바로 저장. */
.quick__save {
    height: 44px;
    padding: 0 18px;
    border: 0;
    border-radius: var(--r-ctl);
    background: var(--ink);
    color: var(--slip);
    font-weight: 800;
    white-space: nowrap;
    cursor: pointer;
}

.quick__save:active { transform: scale(.96); }

/* ---------- 목록 ---------- */

.list { overflow: hidden; }

.row { display: flex; align-items: center; gap: 12px; padding: 15px 18px; }
.row + .row { border-top: 1px solid var(--line); }
a.row:active { background: var(--well); }

/* 알바 색 띠: 줄 왼쪽 끝 */
.row[style*="--job"] { box-shadow: inset 5px 0 0 var(--job); padding-left: 20px; }
.row .dot { display: none; }

.row__main { flex: 1; min-width: 0; }
.row__title { display: flex; align-items: center; gap: 6px; min-width: 0; font-weight: 700; }
.row__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row__sub { margin-top: 1px; font-size: .84rem; color: var(--ink-soft); overflow-wrap: anywhere; }
.row__sub .clock { color: var(--ink-2); }
.row__end { flex: none; text-align: right; font-weight: 800; white-space: nowrap; }
.row__end small { display: block; font-size: .76rem; font-weight: 500; color: var(--ink-soft); }
.row__chev { color: var(--ink-faint); font-size: 1.2rem; }
.row--sum { background: var(--well); }

/* 알바별: 한 장의 종이에 줄로 */
.job { display: block; padding: 16px 18px 16px 20px; box-shadow: inset 5px 0 0 var(--job); }
.job + .job { border-top: 1px solid var(--line); }
.job:active { background: var(--well); }

.job__top { display: flex; align-items: baseline; gap: 10px; }
.job__top .dot { display: none; }
.job__name { flex: 1; min-width: 0; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job__net { flex: none; font-size: 1.08rem; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; }
.job__meta { margin-top: 3px; font-size: .84rem; color: var(--ink-soft); overflow-wrap: anywhere; }

.meter { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.meter__track { flex: 1; height: 6px; border-radius: 2px; background: var(--well); overflow: hidden; }
.meter__track span { display: block; height: 100%; background: var(--job); }
.meter__text { flex: none; font-size: .78rem; font-weight: 700; color: var(--ink-soft); }
.meter__text--pending { color: var(--ink); }

.dot { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--job, var(--ink-faint)); }

.tag {
    display: inline-flex;
    align-items: center;
    flex: none;
    padding: 1px 6px;
    border: 1px solid var(--line-2);
    border-radius: 4px;
    color: var(--ink-soft);
    font-size: .72rem;
    font-weight: 700;
    white-space: nowrap;
}

/* 특근은 도장처럼 */
.tag--special { border-color: var(--stamp); color: var(--stamp-ink); }
.tag--bonus { border-color: var(--ink); color: var(--ink); }

/* ---------- 달력 ---------- */

/* 알바 필터. 가로 스크롤로 두면 고른 칩이 화면 끝에 걸려 잘리므로 줄을 바꿔 전부 보인다. */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }

.filter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: none;
    max-width: 180px;
    height: 36px;
    padding: 0 12px;
    border-radius: 8px;
    background: var(--slip);
    box-shadow: inset 0 0 0 1px var(--line-2);
    font-size: .88rem;
    font-weight: 700;
    color: var(--ink-2);
}

.filter--on { background: var(--ink); color: var(--slip); box-shadow: none; }
.filter__name, .pick__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 근무표처럼 칸마다 가는 선 */
.cal { padding: 14px 0 0; overflow: hidden; }

.cal__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 0 16px 12px; }
.cal__head span { font-size: .86rem; font-weight: 700; color: var(--ink-soft); }
.cal__head strong { font-family: var(--mono); font-size: 1.15rem; font-weight: 800; letter-spacing: -.03em; white-space: nowrap; }

/* minmax(0, 1fr): 금액 글자가 칸을 밀어 달력이 화면 밖으로 넘치지 않게. */
.cal__week, .cal__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal__week { border-bottom: 1px solid var(--ink); }
.cal__week span { padding-bottom: 6px; text-align: center; font-size: .74rem; font-weight: 700; color: var(--ink-soft); }
.cal__week span:first-child { color: var(--sun); }
.cal__week span:last-child { color: var(--sat); }

.cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    min-height: 66px;
    padding: 4px 2px 5px;
    border-bottom: 1px solid var(--line);
}

.cell:not(:nth-child(7n)) { border-right: 1px solid var(--line); }
.cell:active { background: var(--well); }
.cell--out { color: var(--ink-faint); }
.cell--out > * { opacity: .45; }
.cell--selected { background: var(--well); }

.cell__day {
    align-self: center;
    display: grid;
    place-items: center;
    min-width: 26px;
    height: 24px;
    padding: 0 3px;
    border-radius: 4px;
    font-size: .82rem;
    font-weight: 700;
}

.cell--sun .cell__day { color: var(--sun); }
.cell--sat .cell__day { color: var(--sat); }
/* 오늘은 형광펜 */
.cell--today .cell__day { background: var(--marker); color: var(--ink); }
.cell--selected .cell__day { background: var(--ink); color: var(--slip); }
.cell--today.cell--selected .cell__day { box-shadow: 0 0 0 2px var(--marker); }

/* 기간 합계: 고른 기간은 칸을 칠하고, 시작·끝 날은 날짜를 채운다. */
.cell--range, .cell--range.cell--selected { background: color-mix(in srgb, var(--ink) 9%, var(--slip)); }
.cell--edge .cell__day { background: var(--ink); color: var(--slip); box-shadow: none; }

.bar {
    display: block;
    padding: 1px 3px;
    border-radius: 3px;
    background: color-mix(in srgb, var(--job) 18%, var(--slip));
    color: color-mix(in srgb, var(--job) 55%, var(--ink));
    font-size: .62rem;
    font-weight: 800;
    line-height: 1.4;
    text-align: center;
    letter-spacing: -.04em;
    white-space: nowrap;
    overflow: hidden;
}

.bar--special { box-shadow: inset 0 0 0 1px var(--stamp); }
/* 보너스는 알바 색이 아니라 잉크 테두리. 기록과 한눈에 갈린다. */
.bar--bonus { background: var(--slip); color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.cell__more { font-size: .62rem; text-align: center; color: var(--ink-soft); }

.day-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 28px 2px 12px; }
.day-head h2 { font-size: 1.05rem; font-weight: 800; white-space: nowrap; }
.day-head__actions { display: flex; gap: 6px; }

/* 달력 / 기간 계산 탭 */
.seg--tabs { margin: 0 0 14px; }
a.seg__btn { display: grid; place-items: center; }

/* 기간 합계 단계 안내: 1 시작일 -> 2 끝날 (진짜 순서라 번호를 둔다) */
.range-guide { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 14px; }
.range-step {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 12px;
    border-radius: var(--r-paper);
    background: var(--slip);
    box-shadow: inset 0 0 0 1px var(--line-2);
}
.range-step b {
    display: grid;
    place-items: center;
    flex: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--well);
    color: var(--ink-soft);
    font-size: .84rem;
}
.range-step span { min-width: 0; font-size: .92rem; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.range-step small { display: block; font-size: .74rem; font-weight: 600; color: var(--ink-soft); }
.range-step--now { box-shadow: inset 0 0 0 2px var(--ink); }
.range-step--now b { background: var(--marker); color: var(--ink); }
.range-step--done b { background: var(--ink); color: var(--slip); }
.range-again { margin-top: 12px; }
.range-job + .range-job { margin-top: 12px; }
.range-job__name { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-weight: 800; }
.range-job { box-shadow: var(--paper-shadow), inset 0 5px 0 var(--job); padding-top: 22px; }
.range-job .dot { display: none; }

/* ---------- 계산 기준 ---------- */

.rules-lead { margin: 4px 2px 0; font-size: .95rem; color: var(--ink-2); }
.rules h3 { margin: 0 0 10px; font-size: 1.08rem; font-weight: 800; }
.rules h3 small { margin-left: 6px; font-size: .78rem; font-weight: 600; color: var(--ink-soft); }
.rules ul:not(.lines) { margin: 0; padding-left: 18px; }
.rules ul:not(.lines) li { margin: 8px 0; font-size: .94rem; line-height: 1.6; }
.rules .lines { margin-bottom: 8px; }
.rules b { font-weight: 800; }
.law { display: block; margin-top: 2px; font-size: .78rem; color: var(--ink-soft); }
.app-note { margin: 12px 0 0; padding: 11px 13px; border-left: 3px solid var(--ink); background: var(--well); font-size: .86rem; line-height: 1.6; color: var(--ink-2); }
.note-link { color: var(--ink-2); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- 폼 ---------- */

.form-card { padding: 4px 20px; }
.form-card + .form-card { margin-top: 12px; }

.field { padding: 16px 0; }
.field + .field { border-top: 1px solid var(--line); }
.field__label { display: block; margin-bottom: 10px; font-size: .86rem; font-weight: 700; color: var(--ink-2); }
.field__label em { font-style: normal; color: var(--ink-soft); font-weight: 500; }

.input {
    width: 100%;
    height: 50px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: var(--r-ctl);
    background: var(--well);
    font-size: 1.02rem;
    font-weight: 600;
    -webkit-appearance: none;
    appearance: none;
}

.input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); background: var(--slip); }
.input::placeholder { color: var(--ink-faint); font-weight: 500; }
.input--money { font-family: var(--mono); font-size: 1.12rem; font-weight: 700; }
input[type="time"].input { font-family: var(--mono); font-weight: 700; }

.with-unit { position: relative; }
.with-unit .input { padding-right: 44px; }
.with-unit span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-soft); font-weight: 700; }

/* 시간 두 칸이 좁은 폭에서 서로를 밀어내지 않게. */
.pair { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; }
.pair .input { min-width: 0; padding: 0 10px; text-align: center; }
.pair__sep { color: var(--ink-soft); font-family: var(--mono); }
.next-day { display: inline-block; margin-top: 8px; }
/* 크롬이 붙이는 시계 아이콘이 좁은 칸에서 시간을 가린다. 폰에서는 칸을 누르면 고르는 창이 뜨므로 아이콘이 필요 없다. */
.pair input[type="time"]::-webkit-calendar-picker-indicator { display: none; }
.pair input[type="time"]::-webkit-datetime-edit { padding: 0; }

/* 고르기 (라디오를 감싼 label) */
.picks { display: flex; flex-wrap: wrap; gap: 8px; }
.pick { position: relative; max-width: 100%; }
.pick input { position: absolute; opacity: 0; pointer-events: none; }

.pick > span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    max-width: 100%;
    height: 44px;
    padding: 0 16px;
    border-radius: var(--r-ctl);
    background: var(--well);
    box-shadow: inset 0 0 0 1px var(--line);
    color: var(--ink-2);
    font-weight: 700;
    white-space: nowrap;
    transition: background .12s, color .12s;
}

.pick input:checked + span { background: var(--ink); color: var(--slip); box-shadow: none; }
.pick input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }

/* 알바 고르기는 고른 알바 색으로 칠한다. */
.pick--job input:checked + span { background: var(--job); color: #fff; }
.pick--job input:checked + span .dot { background: #fff; }

.picks--fill { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
.picks--fill .pick > span { display: flex; justify-content: center; width: 100%; padding: 0 6px; }

/* 설명이 붙는 선택지 */
.pick--stack > span { flex-direction: column; justify-content: center; gap: 0; height: 58px; line-height: 1.25; }
.pick--stack small { font-size: .74rem; font-weight: 500; opacity: .75; }
/* 공제처럼 넷이 한 줄에 들어갈 때: 좁은 폰에서 "고용보험" 이 넘치지 않게 한 단계 줄인다. */
.picks--fill:has(> .pick:nth-child(4)) .pick--stack > span { padding: 0 2px; font-size: .9rem; letter-spacing: -.04em; }

.swatches { display: flex; flex-wrap: wrap; gap: 12px; }
.swatch > span { width: 34px; height: 34px; padding: 0; border-radius: 50%; background: var(--job); box-shadow: none; }
.swatch input:checked + span { background: var(--job); box-shadow: 0 0 0 3px var(--slip), 0 0 0 5px var(--ink); }

/* 켜고 끄는 줄 */
.toggle { display: flex; align-items: center; gap: 12px; padding: 16px 0; }
.toggle + .toggle, .field + .toggle, .toggle + .field { border-top: 1px solid var(--line); }
.toggle__text { flex: 1; font-weight: 700; }
.toggle__text small { display: block; margin-top: 1px; font-size: .8rem; font-weight: 500; color: var(--ink-soft); }

.switch { position: relative; flex: none; width: 50px; height: 30px; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; z-index: 1; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: var(--line-2); transition: background .15s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .15s; }
.switch input:checked + i { background: var(--ink); }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:focus-visible + i { outline: 2px solid var(--ink); outline-offset: 2px; }

.alert { margin-bottom: 12px; padding: 13px 16px; border-left: 4px solid var(--stamp); border-radius: var(--r-paper); background: color-mix(in srgb, var(--stamp) 10%, var(--slip)); color: var(--stamp-ink); font-weight: 700; font-size: .92rem; }

/* 근무 요일 칩 (월~일) */
.weekdays { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.weekday > span { display: flex; justify-content: center; width: 100%; height: 42px; padding: 0; }
.weekday--sun > span { color: var(--sun); }
.weekday--sat > span { color: var(--sat); }
.weekday input:checked + span { color: var(--slip); }

/* 요일마다 다른 시간 한 줄: 요일 · 시작 ~ 끝 / 휴게 */
.day-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 6px; padding: 8px 0; }
.day-row + .day-row { border-top: 1px solid var(--line); }
.day-row__break { grid-column: 2 / 5; }
.day-row__name { font-weight: 800; text-align: center; }
.day-row .input { height: 44px; min-width: 0; padding: 0 6px; text-align: center; font-size: 1rem; }
.day-row .brk-select { height: 40px; text-align: left; padding-left: 12px; }
.day-row input[type="time"]::-webkit-calendar-picker-indicator { display: none; }
#sched-per { padding-bottom: 8px; }

/* 휴게 셀렉트. .input 이 기본 화살표를 지우므로 직접 그린다. */
.brk-select {
    padding-right: 36px;
    font-weight: 700;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%235c6875' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    cursor: pointer;
}

/* 오늘 / 어제 / 여러 날 */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0; padding: 3px; border-radius: var(--r-ctl); background: var(--slip); box-shadow: inset 0 0 0 1px var(--line-2); }
.form-card .seg { background: var(--well); box-shadow: inset 0 0 0 1px var(--line); }

.seg__btn {
    height: 40px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ink-2);
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
}

.seg__btn--on { background: var(--ink); color: var(--slip); }

/* 여러 날 고르는 작은 달력 */
.mini { margin-top: 10px; padding: 10px; border-radius: var(--r-ctl); background: var(--well); }
.mini__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.mini__head strong { font-size: .95rem; font-weight: 800; }
.mini__nav { width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-soft); font-size: 1.3rem; cursor: pointer; }

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

.mini__week button {
    height: 30px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--ink-soft);
    font-size: .78rem;
    font-weight: 800;
    cursor: pointer;
}

.mini__week button:first-child { color: var(--sun); }
.mini__week button:last-child { color: var(--sat); }

.mini__grid button {
    aspect-ratio: 1;
    min-width: 0;
    border: 0;
    border-radius: 6px;
    background: var(--slip);
    color: var(--ink);
    font-size: .88rem;
    font-weight: 700;
    cursor: pointer;
}

.mini__grid button.sun { color: var(--sun); }
.mini__grid button.sat { color: var(--sat); }
.mini__grid button.on { background: var(--ink); color: var(--slip); }
.mini__foot { margin-top: 8px; font-size: .82rem; color: var(--ink-soft); text-align: center; }

.note-line { padding: 14px 0; font-size: .88rem; color: var(--ink-2); }
.field-note { margin: 8px 2px 0; font-size: .8rem; color: var(--ink-soft); }

/* ---------- 버튼 ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 46px;
    padding: 0 18px;
    border: 0;
    border-radius: var(--r-ctl);
    background: var(--ink);
    color: var(--slip);
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}

.btn:active { transform: scale(.98); }
.btn--block { display: flex; width: 100%; height: 54px; font-size: 1.02rem; }
.btn--soft { background: var(--slip); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn--small { height: 36px; padding: 0 12px; border-radius: 8px; font-size: .86rem; }
.btn--danger { background: transparent; color: var(--stamp-ink); font-weight: 700; box-shadow: none; }

.stack { display: grid; gap: 8px; margin-top: 20px; }
.stack form { margin: 0; }

.google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 56px;
    border-radius: var(--r-ctl);
    background: #fff;
    color: #1f1f1f;
    box-shadow: inset 0 0 0 1px #c3ccd5;
    font-weight: 800;
    font-size: 1.02rem;
}

/* ---------- 로그인 ---------- */

.splash {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    padding: calc(40px + env(safe-area-inset-top, 0px)) 24px calc(28px + var(--safe-bottom));
}

.splash__body { flex: 1; display: flex; flex-direction: column; justify-content: center; padding-bottom: 28px; }
.splash__mark { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 14px; font-size: 1.8rem; }
.splash h1 { margin-top: 22px; font-size: clamp(1.7rem, 7.6vw, 2.1rem); font-weight: 800; letter-spacing: -.04em; line-height: 1.28; }
.splash__lead { margin-top: 10px; color: var(--ink-2); font-size: 1.02rem; }
.splash__foot { margin-top: 16px; font-size: .8rem; color: var(--ink-soft); text-align: center; }

/* 로그인 화면의 견본 명세서: 무엇을 해 주는 앱인지 숫자로 */
.splash .slip-wrap { margin-top: 28px; }
.splash .slip { padding-top: 16px; }

/* ---------- 앱 설치 ---------- */

.install { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; padding: 14px 16px; border-radius: var(--r-paper); background: var(--slip); box-shadow: var(--paper-shadow); }
.install img { width: 44px; height: 44px; border-radius: 10px; flex: none; }
.install__text { flex: 1; min-width: 0; }
.install__text b { display: block; font-weight: 800; }
.install__text small { display: block; font-size: .82rem; color: var(--ink-soft); }

/* ---------- 알림 ---------- */

.toast {
    position: fixed;
    left: 50%;
    bottom: calc(var(--tabbar) + var(--safe-bottom) + 12px);
    z-index: 40;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    width: min(440px, calc(100% - 32px));
    padding: 14px 18px;
    border-radius: var(--r-ctl);
    background: #17212b;
    color: #fff;
    font-size: .92rem;
    font-weight: 700;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .22);
    transform: translateX(-50%);
    animation: toast-in .25s ease-out, toast-out .4s ease-in 3.4s forwards;
}

.toast span { white-space: nowrap; }
.toast b { color: #ffe45c; font-family: var(--mono); }
.toast a { flex: none; color: #ffe45c; font-weight: 800; }

@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px); } }
@keyframes toast-out { to { opacity: 0; transform: translate(-50%, 12px); visibility: hidden; } }

details.more { margin-top: 28px; }
details.more summary { cursor: pointer; list-style: none; padding: 4px 2px 10px; font-size: .9rem; font-weight: 700; color: var(--ink-soft); }
details.more summary::-webkit-details-marker { display: none; }

/* ---------- 월급: 연간 막대 ---------- */

.trend { padding: 12px 18px; }
.trend__row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 7px 0; }
.trend__label { font-size: .88rem; font-weight: 700; color: var(--ink-soft); }
.trend__track { height: 10px; border-radius: 2px; background: var(--well); overflow: hidden; }
.trend__track span { display: block; height: 100%; background: var(--line-2); }
.trend__value { min-width: 56px; text-align: right; font-size: .88rem; font-weight: 700; color: var(--ink-soft); white-space: nowrap; }
.trend__row--on .trend__label, .trend__row--on .trend__value { color: var(--ink); }
.trend__row--on .trend__track span { background: var(--ink); }
.trend__row--on .trend__label span { background: linear-gradient(transparent 55%, var(--marker) 55%, var(--marker) 92%, transparent 92%); }
.trend__row--future { opacity: .4; }

.trend__sum { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding-top: 6px; }
.trend__sum span { font-size: .88rem; font-weight: 700; color: var(--ink-2); }
.trend__sum strong { font-family: var(--mono); font-size: 1.2rem; font-weight: 800; letter-spacing: -.03em; white-space: nowrap; }
.trend__gross { margin: 2px 0 8px; padding-bottom: 10px; border-bottom: 2px solid var(--ink); text-align: right; font-size: .82rem; color: var(--ink-soft); }

/* ---------- 넓은 화면 배치 (폰에서는 한 줄로 쌓인다) ---------- */

.split > * + * { margin-top: 32px; }
.split__side > .section:first-child, .split__side > .today:first-child { margin-top: 0; }
.range-slip { margin-top: 28px; }

/* ---------- 아주 좁은 화면 ---------- */

@media (max-width: 350px) {
    .content { padding-left: 14px; padding-right: 14px; }
    .card, .form-card { padding-left: 16px; padding-right: 16px; }
    .slip { padding-left: 16px; padding-right: 16px; }
    .row { padding-right: 14px; gap: 10px; }
    .bar { font-size: .56rem; padding: 1px 1px; }
    .tab { font-size: .64rem; }
    .quick__save { padding: 0 14px; }
}

/* ---------- 태블릿: 폰 기둥을 책상 위에 ---------- */

@media (min-width: 540px) and (max-width: 1023.98px) {
    .tabbar, .savebar { left: 50%; right: auto; width: var(--app); transform: translateX(-50%); }
    .tabbar { border-left: 1px solid var(--line-2); border-right: 1px solid var(--line-2); }
}

/* ---------- PC: 폭을 쓴다. 왼쪽에 메뉴, 가운데에 명세서와 오늘. ---------- */

@media (min-width: 1024px) {
    :root { --app: 1040px; --rail: 208px; }

    /* 메뉴가 있는 화면만 두 칸. 입력 화면(메뉴 없음)은 가운데 한 기둥, 로그인은 폰 폭 그대로. */
    body:has(> .tabbar) { display: grid; grid-template-columns: var(--rail) minmax(0, var(--app)); justify-content: center; column-gap: 40px; padding: 0 32px; }
    body:has(> .tabbar) .app { grid-column: 2; width: 100%; max-width: none; margin: 0; }
    .tabbar { grid-column: 1; grid-row: 1; }
    body:not(:has(> .tabbar)) .app { max-width: 704px; }
    body:not(:has(> .tabbar)) .app.splash { max-width: 480px; }

    .topbar { height: 76px; padding: 0 0 0 2px; }
    .topbar--back { padding-left: 0; margin-left: -8px; }
    .topbar__title { font-size: 1.5rem; }
    .content { padding: 4px 2px 64px; }
    .content--form { padding-bottom: 32px; }

    /* 아래 탭바 -> 왼쪽 세로 메뉴 */
    .tabbar {
        position: sticky;
        top: 0;
        align-self: start;
        height: 100vh;
        padding: 0;
        background: transparent;
        border: 0;
    }
    .tabbar__inner { display: flex; flex-direction: column; align-items: stretch; gap: 2px; height: auto; padding-top: 22px; }
    .tabbar__brand { display: flex; align-items: center; gap: 10px; height: 36px; margin: 0 0 22px 6px; font-size: 1.05rem; font-weight: 800; letter-spacing: -.02em; }
    .tabbar__brand img { width: 28px; height: 28px; border-radius: 7px; }
    .tab { flex-direction: row; gap: 12px; height: 44px; padding: 0 12px; border-radius: var(--r-ctl); font-size: .98rem; color: var(--ink-2); }
    .tab svg { width: 22px; height: 22px; }
    .tab:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); }
    .tab--on { background: var(--slip); color: var(--ink); box-shadow: var(--paper-shadow); }
    .tab--add { order: 9; margin-top: 18px; padding: 0; height: auto; }
    .tab--add:hover { background: transparent; }
    .tab--add > span { display: flex; gap: 8px; width: 100%; height: 50px; border-radius: var(--r-ctl); font-weight: 800; font-size: 1rem; }
    .tab--add svg { width: 20px; height: 20px; }
    .tab__add-text { display: inline; }

    .savebar, .savebar--full {
        position: sticky;
        left: auto;
        right: auto;
        bottom: 0;
        width: auto;
        margin: 20px 0 0;
        padding: 14px 0 18px;
        transform: none;
        background: var(--desk);
        border-top: 1px solid var(--line-2);
    }
    .savebar__inner { max-width: none; margin: 0; }
    .savebar--full .btn { flex: none; width: 240px; margin-left: auto; }

    .toast { bottom: 24px; left: calc(50% + (var(--rail) + 40px) / 2); }

    /* 두 칸: 왼쪽 명세서(달력), 오른쪽 오늘·알바별(그날 기록) */
    .split { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); align-items: start; gap: 36px; }
    .split > * + * { margin-top: 0; }
    .split__side > :first-child, .split__side > .range-slip { margin-top: 0; }
    .split__main { position: sticky; top: 92px; }
    .split--wide { grid-template-columns: minmax(0, 1fr) minmax(0, 360px); }
    .split--wide .split__main { position: static; }

    .slip { padding: 26px 28px calc(24px + var(--tooth)); }
    .slip__amount { font-size: 2.6rem; }

    /* 달력: 칸을 키우고 금액 띠를 읽히게 */
    .cell { min-height: 92px; padding: 6px 4px; }
    .bar { font-size: .74rem; padding: 2px 4px; }
    .cell__day { font-size: .9rem; }

    /* 입력·설정 화면은 읽기 좋은 폭으로 */
    .content--form, .narrow { max-width: 640px; }
    .content--form .stack { max-width: 640px; }
}
