/* Don't Over — 디자인 시안(돈 오버 (Don't Over).html) 기준 스타일 */
:root {
    --accent: #FF6B2C;          /* 설정에서 바꿀 수 있음 (layout.html 에서 덮어씀) */
    --ink: #111418;
    --bg: #F2F3F5;
    --surface: #FFFFFF;
    --muted: #5B636E;
    --sub: #3F4650;
    --line: #E3E6EA;
    --chip: #EDEFF2;
    --soft: #C9CED6;
    --faint: #DDE1E6;
    --night: #1A1E24;
    --night-2: #2A3038;
    --night-line: #3A414B;
    --warm-bg: #FFE8DE;
    --warm-ink: #B33A0C;
    --sun-bg: #FFF1D6;
    --sun-ink: #7A4B00;
    --sun-sub: #5C4410;
    --red: #B42318;
    --blue: #1D4ED8;
    --off: #C4CAD2;
    --num: 'Space Grotesk', 'IBM Plex Sans KR', sans-serif;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: 'IBM Plex Sans KR', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
    /* 한글이 '출/발'처럼 글자 중간에서 끊기지 않게 단어 단위로 줄바꿈, 긴 링크만 아무 데서나 */
    word-break: keep-all;
    overflow-wrap: anywhere;
    /* 가로로 돌리거나 글자 크기를 키워도 브라우저가 임의로 글자를 키우지 않게 */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

a { color: inherit; text-decoration: none; }
h1, h2, p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
/* 시각·숫자는 '13:38 → 14:20'처럼 한 덩어리로 */
.num { font-family: var(--num); white-space: nowrap; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.ic { width: 20px; height: 20px; flex-shrink: 0; }
.ic-sm { width: 14px; height: 14px; }
.ic-md { width: 18px; height: 18px; }
.ic-lg { width: 22px; height: 22px; }

/* ── 앱 틀 ──
   폰마다 다른 화면에 맞춤: 노치·상태 표시줄(safe-area-inset-top)과 하단 제스처 바(…-bottom)만큼 자동으로 비우고,
   위 여백·양옆 여백은 화면 높이·너비에 따라 줄어든다 (작은 폰 320px 에서 16px). */
:root {
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --gutter: clamp(16px, 5vw, 20px);
    --tabbar-h: 84px;
}
.app {
    max-width: 430px;
    min-height: 100vh;
    min-height: 100dvh; /* 주소창이 생겼다 사라져도 실제 보이는 높이 기준 */
    margin: 0 auto;
    padding: calc(clamp(24px, 7vh, 56px) + var(--safe-top)) var(--gutter) calc(var(--tabbar-h) + 28px + var(--safe-bottom));
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.app.dark { background: var(--night); color: #fff; }
.app.plain { padding-bottom: calc(32px + var(--safe-bottom)); }
body.dark { background: var(--night); }

.head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.head-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.eyebrow { font-size: 13px; font-weight: 500; color: var(--muted); }
.dark .eyebrow { color: var(--soft); }
.title { font-size: 26px; font-weight: 700; letter-spacing: -0.5px; }
.title-sm { font-size: 20px; font-weight: 700; letter-spacing: -0.3px; }
.bar-title { font-size: 17px; font-weight: 700; text-align: center; flex-grow: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.icon-btn {
    width: 44px; height: 44px; border-radius: 22px; flex-shrink: 0;
    border: 1px solid var(--line); background: var(--surface);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; padding: 0; position: relative; color: var(--ink);
}
.icon-btn .badge {
    position: absolute; top: 6px; right: 6px; min-width: 16px; height: 16px; padding: 0 4px;
    border-radius: 8px; background: var(--accent); color: var(--ink);
    font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.pill-btn {
    height: 44px; padding: 0 18px; border-radius: 22px; border: none;
    background: var(--ink); color: #fff; font-size: 14px; font-weight: 700;
    display: inline-flex; align-items: center; cursor: pointer;
}

.section { display: flex; flex-direction: column; gap: 10px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; }
.section-head h2 { font-size: 16px; font-weight: 700; }
.section-head a, .section-head span { font-size: 13px; font-weight: 500; color: var(--muted); }

/* ── 아래 탭 바 ── */
.tabbar {
    position: fixed; left: 50%; bottom: 0; transform: translateX(-50%);
    width: 100%; max-width: 430px; height: calc(var(--tabbar-h) + var(--safe-bottom));
    padding: 8px var(--gutter) calc(20px + var(--safe-bottom)); background: var(--surface); border-top: 1px solid var(--line);
    display: flex; justify-content: space-between; align-items: center; z-index: 10;
}
.tabbar a {
    width: 64px; height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; color: var(--muted); font-size: 11px; font-weight: 500;
}
.tabbar a.on { color: var(--ink); font-weight: 700; }
.tabbar a.add { width: 52px; border-radius: 18px; background: var(--ink); color: #fff; }

/* ── 다음 출발 카드 (검정) ── */
.hero {
    background: var(--ink); color: #fff; border-radius: 24px; padding: 20px;
    display: flex; flex-direction: column; gap: 16px;
}
.hero-top { display: flex; justify-content: space-between; align-items: center; }
.pill-accent {
    font-size: 12px; font-weight: 600; color: var(--ink); background: var(--accent);
    padding: 4px 10px; border-radius: 999px;
}
.hero-time { font-family: var(--num); font-size: 15px; font-weight: 500; color: var(--soft); }
.hero-name { display: flex; flex-direction: column; gap: 6px; }
.hero-title { font-size: 21px; font-weight: 700; letter-spacing: -0.3px; }
.hero-place { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--soft); }
.hero-count { display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; }
.hero-big { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
/* 큰 숫자는 화면 너비에 비례 (320px 폰에서 작아지고 큰 폰에서 원래 크기) */
.hero-big .value {
    font-family: var(--num); font-size: clamp(54px, 18vw, 68px); font-weight: 700; line-height: 0.9;
    color: var(--accent); letter-spacing: -2px;
}
.hero-big .value.text { font-family: inherit; font-size: clamp(42px, 14vw, 52px); letter-spacing: -1.5px; }
.hero-big .unit { font-size: 18px; font-weight: 600; white-space: nowrap; }
.hero-leave { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex-shrink: 0; }
.hero-leave span:first-child { font-size: 11px; color: var(--soft); }
.hero-leave span:last-child { font-family: var(--num); font-size: 20px; font-weight: 700; }

.progress { display: flex; flex-direction: column; gap: 8px; }
.track { height: 6px; background: var(--night-2); border-radius: 3px; position: relative; overflow: hidden; }
.track .fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); border-radius: 3px; }
.light .track { background: var(--line); }
.progress-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--soft); }
.progress-labels .now { color: #fff; font-weight: 600; }
.light .progress-labels { color: var(--muted); }
.light .progress-labels .now { color: var(--ink); }

.btn-row { display: flex; gap: 8px; }
.btn-row > * { flex: 1 1 0; min-width: 0; }
.btn {
    height: 46px; border-radius: 14px; border: none; padding: 0 14px;
    font-size: 14px; font-weight: 700; cursor: pointer; white-space: nowrap;
    display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%;
}
.btn-accent { background: var(--accent); color: var(--ink); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-ghost-dark { background: transparent; color: #fff; border: 1px solid var(--night-line); font-weight: 600; }
.btn-ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line); font-weight: 600; }
.btn-danger { background: transparent; color: var(--red); border: 1px solid #F1C4BF; font-weight: 600; }
.btn-row > .btn-fixed { flex: 0 0 104px; }

/* ── 목록 · 카드 ── */
.card { background: var(--surface); border-radius: 18px; }
.card-pad { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.list { background: var(--surface); border-radius: 18px; display: flex; flex-direction: column; overflow: hidden; }
.list-row {
    display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--line);
}
.list-row:last-child { border-bottom: none; }
.list-row .time { font-family: var(--num); font-size: 15px; font-weight: 700; width: 44px; flex-shrink: 0; }
.list-row .main { display: flex; flex-direction: column; gap: 2px; flex-grow: 1; min-width: 0; }
.list-row .main b {
    font-size: 14px; font-weight: 600;
    /* 긴 제목은 두 줄까지만 */
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.list-row .main small { font-size: 12px; color: var(--muted); }
.chip { font-size: 12px; font-weight: 600; padding: 5px 9px; border-radius: 8px; white-space: nowrap; }
.chip-warm { color: var(--warm-ink); background: var(--warm-bg); }
.chip-gray { color: var(--sub); background: var(--chip); }

.note-card {
    background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px;
    display: flex; align-items: center; gap: 12px;
}
.note-icon {
    width: 40px; height: 40px; border-radius: 12px; background: var(--warm-bg); color: var(--warm-ink);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.note-card .main { display: flex; flex-direction: column; gap: 2px; flex-grow: 1; min-width: 0; }
.note-card .kicker { font-size: 12px; font-weight: 600; color: var(--warm-ink); }
.note-card .main b { font-size: 14px; font-weight: 600; }

.empty {
    background: var(--surface); border-radius: 16px; padding: 18px;
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.empty span { font-size: 14px; color: var(--muted); }
.empty .btn { width: auto; height: 40px; border-radius: 12px; font-size: 13px; }

.flash {
    border-radius: 16px; padding: 12px 14px; font-size: 13px; font-weight: 600;
    background: var(--warm-bg); color: var(--warm-ink); display: flex; flex-direction: column; gap: 10px;
}
.flash.ok { background: #E3F6EA; color: #11643A; }

/* ── 캘린더 ── */
.cal { background: var(--surface); border-radius: 22px; padding: 14px 10px 10px; display: flex; flex-direction: column; gap: 4px; }
.cal-week, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); text-align: center; }
.cal-week { font-size: 12px; font-weight: 600; color: var(--muted); padding-bottom: 6px; }
.cal-week .sun { color: var(--red); }
.cal-week .sat { color: var(--blue); }
.cal-grid { row-gap: 2px; }
.cal-cell { height: 52px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.cal-day {
    width: 40px; height: 40px; border-radius: 14px; border: 2px solid transparent;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--num); font-size: 15px; font-weight: 500; color: var(--ink);
}
.cal-day.sun { color: var(--red); }
.cal-day.sat { color: var(--blue); }
.cal-day.today { border-color: var(--accent); font-weight: 700; }
.cal-day.sel { background: var(--ink); color: #fff; border-color: transparent; font-weight: 700; }
.cal-dot { width: 5px; height: 5px; border-radius: 3px; background: transparent; }
.cal-dot.on { background: var(--accent); }

.event {
    background: var(--surface); border-radius: 16px; padding: 12px 14px;
    display: flex; align-items: center; gap: 12px;
}
.event .bar { width: 4px; align-self: stretch; border-radius: 2px; background: var(--accent); }
.event .main { display: flex; flex-direction: column; gap: 2px; flex-grow: 1; min-width: 0; }
.event .line { display: flex; gap: 8px; align-items: baseline; }
.event .line .t { font-family: var(--num); font-size: 15px; font-weight: 700; }
.event .line b { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event .main small { font-size: 12px; color: var(--muted); }
.event .leave { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; flex-shrink: 0; }
.event .leave span:first-child { font-size: 11px; color: var(--muted); }
.event .leave span:last-child { font-family: var(--num); font-size: 15px; font-weight: 700; color: var(--warm-ink); }
.event .leave .done { color: var(--muted) !important; }

/* ── 일정 추가 폼 ── */
.app.form-page { gap: 14px; padding-top: 52px; padding-bottom: 40px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 12px; font-weight: 600; color: var(--muted); }
.input {
    height: 50px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface);
    padding: 0 16px; font-size: 16px; font-weight: 600; outline: none; width: 100%;
}
.input:focus, .tile:focus-within, .route:focus-within { border-color: var(--ink); }
.input::placeholder { color: #6B737E; font-weight: 500; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile {
    height: 60px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface);
    padding: 0 14px; display: flex; flex-direction: column; justify-content: center; gap: 2px;
}
.tile span { font-size: 11px; font-weight: 600; color: var(--muted); }
.tile { min-width: 0; }
.tile input {
    border: none; padding: 0; background: transparent; font-size: clamp(13px, 4vw, 15px); font-weight: 700; outline: none;
    width: 100%; min-width: 0;
}
.tile input[type=time] { font-family: var(--num); font-size: clamp(15px, 4.6vw, 17px); }
.route { background: var(--surface); border-radius: 14px; border: 1px solid var(--line); display: flex; flex-direction: column; }
.route-row { display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 50px; }
.route-row + .route-row { border-top: 1px solid var(--line); }
.route-row .mark { width: 10px; height: 10px; border-radius: 5px; border: 2px solid var(--muted); flex-shrink: 0; }
.route-row .mark.to { border: none; background: var(--accent); }
.route-row label { font-size: 12px; font-weight: 600; color: var(--muted); width: 40px; flex-shrink: 0; }
.route-row input { flex-grow: 1; min-width: 0; height: 40px; border: none; background: transparent; font-size: 15px; font-weight: 600; outline: none; }

.segmented {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px;
    background: var(--line); padding: 4px; border-radius: 14px;
}
.segmented label { position: relative; }
.segmented input, .chips input, .swatches input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span {
    height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 500; color: var(--sub); cursor: pointer;
}
.segmented input:checked + span { background: var(--surface); color: var(--ink); font-weight: 700; box-shadow: 0 1px 2px rgba(17, 20, 24, .12); }
.segmented input:focus-visible ~ span, .chips input:focus-visible ~ span { outline: 2px solid var(--accent); }
.chips { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.chips.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.chips label { position: relative; }
.chips span {
    height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
    display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 500; cursor: pointer;
}
/* ~ : 체크박스 뒤에 Thymeleaf 가 숨은 입력칸(_repeatDays)을 넣어서 바로 다음(+)이 아닐 수 있음 */
.chips input:checked ~ span { border: 2px solid var(--ink); font-weight: 700; }

.preview {
    background: var(--ink); color: #fff; border-radius: 18px; padding: 14px 16px;
    display: flex; justify-content: space-between; align-items: center; gap: 6px;
}
.preview div { display: flex; flex-direction: column; gap: 2px; }
.preview div:last-child { align-items: flex-end; }
.preview span:first-child { font-size: 11px; color: var(--soft); }
.preview .num { font-size: 20px; font-weight: 700; }
.preview .leave { color: var(--accent); }
.preview .ic { color: #6B737E; }

.toggles { background: var(--surface); border-radius: 14px; border: 1px solid var(--line); display: flex; flex-direction: column; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 14px; min-height: 52px; }
.toggle-row + .toggle-row { border-top: 1px solid var(--line); }
.toggle-row .main { display: flex; flex-direction: column; padding: 8px 0; }
.toggle-row .main b { font-size: 14px; font-weight: 600; }
.toggle-row .main small { font-size: 11px; color: var(--muted); }
.toggle-row .main small input[type=time] {
    border: 1px solid var(--line); border-radius: 8px; background: var(--bg); padding: 2px 6px;
    font-family: var(--num); font-size: 13px; color: var(--ink);
}

/* 스위치 (체크박스) */
.switch { position: relative; width: 50px; height: 30px; flex-shrink: 0; cursor: pointer; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch span {
    position: absolute; inset: 0; border-radius: 15px; background: var(--off); padding: 3px;
    display: flex; align-items: center; transition: background .15s; pointer-events: none;
}
.switch span::after {
    content: ''; width: 24px; height: 24px; border-radius: 12px; background: #fff; transition: transform .15s, background .15s;
}
/* th:field 가 체크박스 바로 뒤에 hidden input 을 넣으므로 + 대신 ~ */
.switch input:checked ~ span { background: var(--ink); }
.switch input:checked ~ span::after { transform: translateX(20px); background: var(--accent); }
.switch input:focus-visible ~ span { outline: 2px solid var(--accent); outline-offset: 2px; }

.error { color: var(--red); font-size: 12px; font-weight: 500; }
.hint { font-size: 12px; color: var(--muted); }

/* ── 상세 ── */
.info { background: var(--surface); border-radius: 16px; display: flex; flex-direction: column; }
.info-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 13px 14px; border-bottom: 1px solid var(--line); }
.info-row:last-child { border-bottom: none; }
.info-row span:first-child { font-size: 14px; font-weight: 500; flex-shrink: 0; }
.info-row span:last-child { font-size: 14px; color: var(--muted); text-align: right; overflow-wrap: anywhere; }
.link-box {
    font-size: 12px; color: var(--muted); background: var(--bg); border-radius: 10px; padding: 10px 12px;
    overflow-wrap: anywhere;
}

/* ── 설정 ── */
.group { display: flex; flex-direction: column; gap: 6px; }
.group h2 { margin-left: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.rows { background: var(--surface); border-radius: 16px; display: flex; flex-direction: column; }
.row {
    min-height: 46px; padding: 0 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
    border-bottom: 1px solid var(--line);
}
.row:last-child { border-bottom: none; }
.row > span:first-child, .row .main b { font-size: 14px; font-weight: 500; }
.row .main { display: flex; flex-direction: column; padding: 8px 0; }
.row .main small { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.row .value { display: flex; align-items: center; gap: 4px; font-size: 14px; color: var(--muted); }
.row input[type=text], .row select {
    border: none; background: transparent; text-align: right; font-size: 14px; color: var(--muted);
    outline: none; max-width: 160px;
}
/* 주소처럼 긴 값은 줄 끝까지 */
.row input.wide { flex: 1; min-width: 0; max-width: none; }
.row input[type=number] {
    width: 56px; border: 1px solid var(--line); border-radius: 8px; padding: 4px 6px; text-align: right;
    font-family: var(--num); font-size: 14px; background: var(--bg);
}
.row input[type=time] { border: none; background: transparent; font-size: 11px; color: var(--muted); padding: 0; }
.row.sub { min-height: 40px; background: #FAFAFB; }
.row.sub > span:first-child { font-size: 13px; color: var(--sub); padding-left: 8px; }
.swatches { display: flex; gap: 8px; }
.swatches label { position: relative; }
.swatches span { display: block; width: 26px; height: 26px; border-radius: 13px; cursor: pointer; border: 2px solid transparent; }
.swatches input:checked + span { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink); }
.profile {
    background: var(--ink); color: #fff; border-radius: 18px; padding: 14px 16px; display: flex; align-items: center; gap: 12px;
}
.avatar {
    width: 40px; height: 40px; border-radius: 20px; background: var(--accent); color: var(--ink);
    display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; flex-shrink: 0;
}
.profile .main { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.profile .main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile .main b { font-size: 15px; }
.profile .main small { font-size: 12px; color: var(--soft); }
.toast {
    position: fixed; left: 50%; top: calc(16px + var(--safe-top)); transform: translateX(-50%); z-index: 20;
    background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 13px; font-weight: 600;
    animation: toast 2.4s forwards;
}
@keyframes toast { 0%, 80% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }

/* ── 위젯 · 잠금 화면 · 상단 표시 ── */
.view-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; background: var(--night-2); padding: 4px; border-radius: 14px; }
.view-tabs a { height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 500; color: var(--soft); }
.view-tabs a.on { background: #fff; color: var(--ink); font-weight: 700; }
.light-view .view-tabs { background: var(--line); }
.light-view .view-tabs a { color: var(--sub); }

.stage { display: flex; flex-direction: column; gap: 8px; }
.stage-label { font-size: 12px; font-weight: 600; color: var(--soft); display: flex; align-items: center; gap: 6px; padding-left: 2px; }
.light-view .stage-label { color: var(--sub); }
.live-badge { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: var(--accent); color: var(--ink); }
.wcard {
    min-height: 96px; border-radius: 22px; padding: 16px 18px;
    display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--ink);
}
.wcard .main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.wcard .main small { font-size: 12px; font-weight: 500; color: var(--muted); }
.wcard .main b { font-size: 18px; font-weight: 700; }
.wcard .main span { font-size: 12px; color: var(--muted); }
.wcard.calm { background: #fff; }
.wcard.sun { background: var(--sun-bg); }
.wcard.sun .main small { color: var(--sun-ink); font-weight: 600; }
.wcard.sun .main span { color: var(--sun-sub); }
.wcard.hot { background: var(--accent); }
.wcard.hot .main small { font-weight: 700; color: var(--ink); }
.wcard.hot .main b { font-size: 22px; letter-spacing: -0.4px; }
.wcard.hot .main span { color: var(--ink); font-weight: 500; }
.wcard.late { background: #FDE7E4; }
.wcard .big { display: flex; align-items: baseline; gap: 2px; flex-shrink: 0; }
.wcard .big .num { font-size: 44px; font-weight: 700; letter-spacing: -1px; line-height: 1; }
.wcard .big span:last-child { font-size: 14px; font-weight: 600; }
.wcard .round-btn {
    width: 48px; height: 48px; border-radius: 16px; border: none; background: var(--ink); color: #fff;
    display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0;
}
.wcard .chip { border-radius: 999px; padding: 5px 10px; }

.wgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.wsquare { height: 150px; border-radius: 22px; padding: 16px; display: flex; flex-direction: column; justify-content: space-between; }
.wsquare.dark { background: var(--ink); border: 1px solid #2E343D; }
.wsquare.dark small { font-size: 12px; font-weight: 500; color: var(--soft); }
.wsquare.dark .big { display: flex; align-items: baseline; gap: 4px; }
.wsquare.dark .big .num { font-size: clamp(44px, 15vw, 56px); font-weight: 700; line-height: .9; letter-spacing: -2px; color: var(--accent); }
.wsquare.dark .big .num.time { font-size: 34px; letter-spacing: -1px; }
.wsquare.dark .big span:last-child { font-size: 15px; font-weight: 600; }
.wsquare.dark .track { height: 5px; }
.wsquare.white { background: #fff; color: var(--ink); }
.wsquare.white small { font-size: 12px; font-weight: 600; color: var(--warm-ink); }
.wsquare.white .main .num { font-size: 30px; font-weight: 700; letter-spacing: -0.5px; display: block; color: var(--ink); }
.wsquare.white .main span { font-size: 12px; color: var(--muted); }
.wsquare.white footer { font-size: 11px; color: var(--muted); }

.notif { background: var(--night-2); border-radius: 20px; padding: 12px 14px; display: flex; gap: 12px; align-items: flex-start; color: #fff; }
.notif-icon {
    width: 36px; height: 36px; border-radius: 10px; background: #fff; color: var(--ink);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.notif-icon.hot { background: var(--accent); }
.notif .main { display: flex; flex-direction: column; gap: 2px; flex-grow: 1; min-width: 0; }
.notif .meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--soft); }
.notif .meta b { font-weight: 600; }
.notif .main > b { font-size: 14px; font-weight: 700; }
.notif .main > span { font-size: 13px; color: var(--faint); }

.clock { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0; }
.clock span:first-child { font-size: 15px; font-weight: 500; color: var(--faint); }
.clock .num { font-size: clamp(64px, 22vw, 80px); font-weight: 700; letter-spacing: -3px; line-height: 1; }

.live { background: #fff; color: var(--ink); border-radius: 24px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.live-app { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.live-app .logo {
    width: 22px; height: 22px; border-radius: 7px; background: var(--ink); color: var(--accent);
    display: flex; align-items: center; justify-content: center;
}
.live-app b { font-weight: 600; color: var(--sub); }
.live-app span { color: var(--muted); }
.live-main { display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; }
.live-main .left { display: flex; flex-direction: column; gap: 2px; }
.live-main .left small { font-size: 13px; font-weight: 600; color: var(--warm-ink); }
.live-main .left .big { display: flex; align-items: baseline; gap: 4px; }
.live-main .left .big .num { font-size: 40px; font-weight: 700; letter-spacing: -1px; line-height: 1; }
.live-main .left .big span:last-child { font-size: 15px; font-weight: 700; }
.live-main .right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.live-main .right span { font-size: 11px; color: var(--muted); }
.live-main .right .num { font-size: 16px; font-weight: 700; }
.live .btn { height: 44px; border-radius: 12px; font-size: 13px; }

.statusbar {
    height: 64px; background: var(--night-2); border-radius: 28px 28px 12px 12px; padding: 0 22px;
    display: flex; align-items: center; justify-content: space-between; color: #fff;
}
.statusbar .left { display: flex; align-items: center; gap: 8px; }
.statusbar .left .num { font-size: 15px; font-weight: 700; }
.statusbar .mini { width: 18px; height: 18px; border-radius: 5px; background: var(--accent); color: var(--ink); display: flex; align-items: center; justify-content: center; }
.statusbar .left b { font-size: 12px; font-weight: 700; color: var(--accent); }
.statusbar .right { display: flex; gap: 6px; align-items: center; }
.island-wrap { height: 64px; background: var(--night-2); border-radius: 28px 28px 12px 12px; display: flex; align-items: center; justify-content: center; }
.island {
    width: 236px; max-width: 100%; height: 38px; background: #000; border-radius: 19px; padding: 0 10px 0 7px;
    display: flex; align-items: center; justify-content: space-between;
}
.island .dotlogo { width: 24px; height: 24px; border-radius: 12px; background: var(--accent); color: var(--ink); display: flex; align-items: center; justify-content: center; }
.island .txt { display: flex; align-items: baseline; gap: 4px; color: var(--accent); }
.island .txt span:first-child { font-size: 11px; font-weight: 600; color: var(--soft); }
.island .txt .num { font-size: 16px; font-weight: 700; }
.island-x-wrap { background: var(--night-2); border-radius: 28px 28px 12px 12px; padding: 10px; }
.island-x { background: #000; border-radius: 34px; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; color: #fff; }
.island-x .top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.island-x .who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.island-x .who .dotlogo { width: 28px; height: 28px; border-radius: 14px; background: var(--accent); color: var(--ink); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.island-x .who div { display: flex; flex-direction: column; min-width: 0; }
.island-x .who b { font-size: 13px; }
.island-x .who span { font-size: 11px; color: var(--soft); }
.island-x .count { display: flex; align-items: baseline; gap: 3px; color: var(--accent); flex-shrink: 0; }
.island-x .count .num { font-size: 30px; font-weight: 700; letter-spacing: -1px; line-height: 1; }
.island-x .count span:last-child { font-size: 13px; font-weight: 700; }
.island-x .track { height: 5px; }
.island-x .btn { height: 44px; border-radius: 22px; font-size: 13px; }
.island-x .btn-muted { background: var(--night-2); color: #fff; font-weight: 600; }
.banner-wrap { background: var(--faint); border-radius: 28px 28px 12px 12px; padding: 12px 10px 70px; position: relative; overflow: hidden; }
.banner-wrap::after {
    content: ''; position: absolute; left: 18px; right: 18px; bottom: 22px; height: 40px;
    background: linear-gradient(var(--off) 0 12px, transparent 12px 22px, var(--off) 22px 34px, transparent 34px);
    border-radius: 6px; opacity: .8; width: 70%;
}
.banner { position: relative; background: var(--ink); color: #fff; border-radius: 24px; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; z-index: 1; }
.banner .top { display: flex; gap: 12px; align-items: center; }
.banner .door { width: 40px; height: 40px; border-radius: 12px; background: var(--accent); color: var(--ink); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.banner .main { display: flex; flex-direction: column; gap: 1px; flex-grow: 1; min-width: 0; }
.banner .meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--soft); }
.banner .main > b { font-size: 16px; }
.banner .main > span { font-size: 12px; color: var(--faint); }
.banner .btn { height: 44px; border-radius: 12px; font-size: 13px; }

/* ── 공유 링크 페이지 ── */
.share-page { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px 20px; }
.share-card {
    width: 100%; max-width: 390px; background: var(--ink); color: #fff; border-radius: 24px; padding: 24px 20px;
    display: flex; flex-direction: column; gap: 14px;
}
.share-card .eta { display: flex; align-items: baseline; gap: 8px; }
.share-card .eta .num { font-size: clamp(52px, 17vw, 64px); font-weight: 700; letter-spacing: -2px; line-height: .9; color: var(--accent); }
.share-card .eta span:last-child { font-size: 18px; font-weight: 600; }
.share-card .status { font-size: 15px; font-weight: 600; }
.share-card .late { color: #FFB4A1; font-size: 14px; font-weight: 600; }
.share-card small { font-size: 12px; color: var(--soft); }
.share-brand { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--soft); }
.share-brand .logo { width: 22px; height: 22px; border-radius: 7px; background: var(--accent); color: var(--ink); display: flex; align-items: center; justify-content: center; }

/* ── 장소 검색 화면 (layout.html place-search) ── */
input[data-place-search] { cursor: pointer; }
.place-sheet {
    border: none; padding: 0; margin: 0 auto; inset: 0;
    width: 100%; max-width: 430px; height: 100dvh; max-height: none;
    background: var(--bg); color: var(--ink);
}
.place-sheet[open] { display: flex; flex-direction: column; }
.place-sheet::backdrop { background: rgba(17, 20, 24, 0.45); }
.ps-head { display: flex; align-items: center; gap: 10px; padding: calc(16px + var(--safe-top)) var(--gutter) 12px; }
.ps-head input {
    flex-grow: 1; min-width: 0; height: 44px; padding: 0 16px; border-radius: 22px;
    border: 1px solid var(--line); background: var(--surface); font-size: 15px; font-weight: 500; outline: none;
}
.ps-head input:focus { border-color: var(--ink); }
.ps-head input::placeholder { color: #6B737E; }
.ps-body { flex-grow: 1; overflow-y: auto; padding: 0 var(--gutter) calc(24px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 10px; }
.ps-status { font-size: 12px; color: var(--muted); padding: 0 4px; }
.ps-status:empty { display: none; }
.ps-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: 18px; overflow: hidden; }
.ps-item {
    width: 100%; min-height: 56px; padding: 10px 14px; display: flex; align-items: center; gap: 12px;
    border: none; border-bottom: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer;
}
.ps-list li:last-child .ps-item { border-bottom: none; }
.ps-item:hover, .ps-item:focus-visible { background: var(--chip); outline: none; }
.ps-item .ic { color: var(--muted); }
.ps-item .main { display: flex; flex-direction: column; gap: 2px; flex-grow: 1; min-width: 0; }
.ps-item .main b { font-size: 14px; font-weight: 600; }
.ps-item .main small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps-item .tag { font-size: 11px; color: var(--muted); flex-shrink: 0; max-width: 30%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── 자주 가는 장소 (places.html) ── */
.place-row { padding-top: 10px; padding-bottom: 10px; }
.place-main { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.place-main b { font-size: 14px; font-weight: 600; }
.row .place-main input[type=text] {
    width: 100%; max-width: none; min-width: 0; text-align: left; font-size: 13px;
    overflow: hidden; text-overflow: ellipsis;
}
.row .place-main input[type=text]::placeholder { color: var(--warm-ink); font-weight: 600; }
.place-add .btn { height: 48px; }

/* ── 반복 일정 (schedule-form.html) ── */
.segmented.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.chips.seven { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.repeat-days, .repeat-until { display: none; margin-top: 8px; }
.repeat:has(input[name=repeat][value=WEEKLY]:checked) .repeat-days { display: grid; }
.repeat:has(input[name=repeat]:checked:not([value=NONE])) .repeat-until { display: flex; }
/* 반복 일정을 '이 일정만' 고칠 때는 반복 설정을 바꾸지 않으니 숨긴다 */
#sf:has(input[name=scope][value=ONE]:checked) .repeat { display: none; }
.repeat-mark { display: inline-flex; align-items: center; gap: 3px; color: var(--muted); }
.repeat-value { display: flex; align-items: center; gap: 8px; }
.btn.btn-small { width: auto; height: 30px; padding: 0 10px; border-radius: 10px; font-size: 12px; }
.info-row .repeat-value > span:first-child { font-weight: 400; color: var(--muted); }

/* ── 준비물 체크리스트 (schedule.html) · 템플릿 (schedule-form.html) ── */
.checklist { background: var(--surface); border-radius: 16px; display: flex; flex-direction: column; overflow: hidden; }
.checklist form + form { border-top: 1px solid var(--line); }
.check-row {
    width: 100%; min-height: 48px; padding: 10px 14px; display: flex; align-items: center; gap: 12px;
    border: none; background: transparent; text-align: left; font-size: 15px; font-weight: 500; cursor: pointer;
}
.check-row .box {
    width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--soft); flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}
.check-row[aria-pressed=true] .box { background: var(--accent); border-color: var(--accent); }
.check-row[aria-pressed=true] .box::after {
    content: ""; width: 10px; height: 5px; border: 2.5px solid var(--ink); border-top: 0; border-right: 0;
    transform: translateY(-1px) rotate(-45deg);
}
.check-row[aria-pressed=true] .name { color: var(--muted); text-decoration: line-through; }
.check-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.item-templates { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag-btn {
    height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
    font-size: 13px; font-weight: 600; color: var(--sub); cursor: pointer;
}
.tag-btn:active { background: var(--chip); }
.tag-btn[aria-pressed=true] { background: var(--ink); border-color: var(--ink); color: #fff; }
.info-row a.link { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* ── 정시 도착 기록 ── */
.record-hero {
    background: var(--ink); color: #fff; border-radius: 24px; padding: 20px;
    display: flex; flex-direction: column; gap: 10px;
}
.record-hero .label { font-size: 12px; font-weight: 600; color: var(--soft); }
.record-hero .sub { font-size: 13px; color: var(--soft); }
.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat {
    background: var(--surface); border-radius: 16px; padding: 12px; min-width: 0;
    display: flex; flex-direction: column; gap: 4px;
}
.stat span { font-size: 11px; font-weight: 600; color: var(--muted); }
.stat b { font-size: clamp(14px, 4.4vw, 17px); font-weight: 700; }
.stat small { font-size: 11px; color: var(--muted); }
.card-pad a.link, .flash a.link { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* ── 코치 마크 (처음 사용 안내) ── */
.coach { position: fixed; inset: 0; z-index: 100; }
/* 비출 곳만 뚫린 어두운 막: 큰 그림자로 둘레를 덮는다 */
.coach-spot {
    position: fixed; border-radius: 18px; box-shadow: 0 0 0 200vmax rgba(17, 20, 24, 0.72);
    outline: 2px solid var(--accent); outline-offset: 2px; transition: all 0.25s ease; pointer-events: none;
}
.coach.centered { background: rgba(17, 20, 24, 0.72); }
.coach.centered .coach-spot { display: none; }
.coach-tip {
    position: fixed; left: 50%; transform: translateX(-50%);
    width: min(calc(100% - var(--gutter) * 2), 398px); background: var(--surface); color: var(--ink);
    border-radius: 20px; padding: 18px; display: flex; flex-direction: column; gap: 8px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}
.coach.centered .coach-tip { top: 50%; transform: translate(-50%, -50%); }
.coach-count { font-family: var(--num); font-size: 12px; font-weight: 700; color: var(--warm-ink); }
.coach-tip h2 { font-size: 18px; font-weight: 700; letter-spacing: -0.3px; }
.coach-tip p { font-size: 14px; color: var(--sub); line-height: 1.55; }
.coach-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; }
.coach-skip {
    border: none; background: none; padding: 8px 4px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer;
}
.coach-next { width: auto; height: 42px; padding: 0 18px; border-radius: 12px; font-size: 14px; }
.coach-dots { display: flex; gap: 5px; }
.coach-dots i { width: 6px; height: 6px; border-radius: 3px; background: var(--faint); }
.coach-dots i.on { width: 16px; background: var(--ink); }
.coach-skip:focus-visible, .coach-next:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .coach-spot { transition: none; } }
/* 설정 줄 모양의 버튼 */
.row-button { width: 100%; border: none; border-bottom: 1px solid var(--line); background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.row-button[hidden] { display: none; }

/* ── 로그인 · 가입 ── */
.auth { justify-content: center; gap: 20px; }
.auth-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.auth-logo {
    width: 48px; height: 48px; border-radius: 14px; background: var(--ink); color: var(--accent);
    display: flex; align-items: center; justify-content: center;
}
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-switch { font-size: 14px; color: var(--muted); text-align: center; }
.auth .link, .row .link { color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ── 로그인 (카카오로 시작하기) ── */
.login-screen {
    min-height: 100vh; min-height: 100dvh; max-width: 430px; margin: 0 auto;
    padding: var(--safe-top) 24px calc(44px + var(--safe-bottom));
    display: flex; flex-direction: column;
}
.login-brand {
    flex-grow: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 20px; padding: 48px 0;
}
.login-icon {
    width: 84px; height: 84px; border-radius: 26px; background: var(--ink); color: var(--accent);
    display: flex; align-items: center; justify-content: center;
}
.login-names { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.login-names h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.6px; }
.login-names .en { font-family: var(--num); font-size: 14px; font-weight: 500; color: var(--muted); }
.login-tagline { font-size: 16px; line-height: 1.6; color: var(--sub); text-align: center; }
.login-actions { display: flex; flex-direction: column; gap: 14px; }
.kakao-btn {
    height: 54px; border-radius: 14px; background: #FEE500; color: rgba(0, 0, 0, 0.85);
    display: flex; align-items: center; justify-content: center; gap: 8px;
    font-size: 16px; font-weight: 700; width: 100%;
}
.kakao-btn:active { filter: brightness(0.95); }
.kakao-btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.login-legal { font-size: 12px; line-height: 1.6; color: var(--muted); text-align: center; }
.login-legal a { color: var(--sub); text-decoration: underline; }

/* ── 프로필 ── */
.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-link { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; color: inherit; }
.profile-photo { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 8px 0; }
.profile-photo .avatar { width: 96px; height: 96px; border-radius: 48px; font-size: 36px; }
.profile-photo form { width: 100%; display: flex; justify-content: center; }
.profile-photo .btn { width: auto; min-width: 160px; cursor: pointer; }
.profile-photo label.btn:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
