:root {
  color-scheme: light;
  font-family: Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f4f7f8;
  color: #203b50;
  --navy: #193e59;
  --blue: #256ca8;
  --soft-blue: #edf4fa;
  --line: rgba(76, 116, 141, .13);
  --muted: #617586;
  --danger: #c73333;
  --surface: #fff;
  --shadow: 0 10px 40px rgba(35, 76, 100, .045);
  --primary: #286ca8;
  --radius-control: 13px;
}
* { box-sizing: border-box; }
body { margin:0; min-height:100dvh; background:radial-gradient(ellipse at 95% 0%, #eaf4f0 0%, transparent 45%), #f4f7f8; line-height:1.6; letter-spacing:-.015em; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; transition:background .24s cubic-bezier(.32,.72,0,1), box-shadow .24s cubic-bezier(.32,.72,0,1), transform .24s cubic-bezier(.32,.72,0,1); }
button:focus-visible { outline: 3px solid #1263dd; outline-offset: 3px; }
button:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
button:active:not(:disabled) { transform: translateY(1px); }
@media (hover: hover) { button:hover:not(:disabled) { filter: brightness(.97); } }
@media (prefers-reduced-motion: reduce) { button, .toast { transition: none !important; } }
.app-shell { min-height: 100vh; max-width: 760px; margin: 0 auto; background: transparent; padding-bottom: calc(116px + env(safe-area-inset-bottom, 0px)); }
.page { padding:calc(32px + env(safe-area-inset-top, 0px)) 24px 36px; }
.topbar { display:flex; align-items:center; gap:14px; margin-bottom:28px; min-height:64px; }
.brand { margin:0; color:var(--navy); font-size:max(15.84px, 1.55rem); font-weight:750; letter-spacing:-.045em; line-height:1.35; }
.eyebrow { color:var(--muted); font-weight:500; font-size:max(15.84px, .76rem); margin-top:5px; }
.muted { color: var(--muted); }
.card { background:var(--surface); border:1px solid rgba(255,255,255,.95); border-radius:22px; padding:24px; box-shadow:var(--shadow), inset 0 0 0 1px rgba(80,123,146,.035); margin-bottom:18px; }
.hero { background:radial-gradient(ellipse at top right, #edf7f3, transparent 65%), #fff; color:var(--navy); padding:32px; }
.hero h2 { font-size:clamp(1.4rem, 4.8vw, 1.8rem); font-weight:650; letter-spacing:-.04em; margin:12px 0 8px; }
.hero .muted { color: var(--muted); }
.stats { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.stat { background:var(--surface); border-radius:20px; padding:22px; box-shadow:var(--shadow); text-align:left; font-size:max(15.84px, .86rem); font-weight:500; color:var(--muted); }
.stat strong { display:block; color:var(--navy); font-size:max(15.84px, 2rem); font-weight:650; margin-top:10px; line-height:1.2; font-variant-numeric:tabular-nums; }
.bottom-nav { position:fixed; z-index:20; bottom:calc(12px + env(safe-area-inset-bottom, 0px)); left:50%; transform:translateX(-50%); width:min(712px,calc(100% - 24px)); display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:3px; background:rgba(255,255,255,.94); border:1px solid rgba(255,255,255,.95); border-radius:24px; padding:7px; box-shadow:0 12px 40px rgba(35,76,100,.1), inset 0 0 0 1px rgba(80,123,146,.04); }
@supports ((backdrop-filter: blur(24px)) or (-webkit-backdrop-filter: blur(24px))) {
  .bottom-nav { background: rgba(247,252,255,.68); -webkit-backdrop-filter: blur(24px) saturate(160%); backdrop-filter: blur(24px) saturate(160%); }
}
.nav-btn { min-width: 0; min-height: 58px; border: 0; border-radius: 20px; background: transparent; color: #526f8a; padding: 7px 1px; font-size: clamp(.58rem, 2.45vw, .72rem); font-weight: 600; display: grid; align-content: center; gap: 4px; justify-items: center; }
.nav-btn .icon { display: grid; place-items: center; height: 24px; }
.nav-btn .icon svg { width: 23px; height: 23px; }
.nav-btn.active { color:#236497; background:#eaf3f8; font-weight:700; }
.field { display:grid; gap:8px; margin-bottom:22px; }
.field label { font-weight:600; font-size:max(15.84px, .87rem); color:#3f586a; }
.required::after { content: " *"; color: var(--danger); }
input, select, textarea { width: 100%; min-width: 0; min-height: 48px; border: 1px solid var(--line); border-radius: var(--radius-control); background: rgba(255,255,255,.85); padding: 12px 13px; color: #16283e; }
textarea { min-height: 112px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(31,104,178,.16); border-color: var(--blue); }
input:disabled, select:disabled { background: #edf1f5; color: #8190a0; }
.row { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.row.three { grid-template-columns: repeat(3, minmax(0,1fr)); }
.btn, .segmented button, .update-banner button, .map-list-item, button.warning { min-height: 48px; border: 1px solid transparent; border-radius: var(--radius-control); padding: 12px 16px; font-weight: 700; line-height: 1.4; }
.btn { background:var(--primary); color:white; box-shadow:0 4px 12px rgba(37,108,168,.1), inset 0 1px 0 rgba(255,255,255,.15); }
.btn.secondary { background: var(--soft-blue); color: #1659a0; border-color: var(--line); box-shadow: none; }
.btn.ghost { background: rgba(255,255,255,.8); color: #1659a0; border-color: var(--line); box-shadow: 0 2px 8px rgba(63,123,174,.04); }
.btn.danger { background:#af4854; box-shadow:none; }
.actions { display: flex; gap: 9px; flex-wrap: wrap; }
.actions .btn { flex: 1; min-width: 110px; }
.hint { font-size:max(15.84px, .82rem); color: var(--muted); margin-top: 5px; }
.error { color: var(--danger); font-weight: 700; font-size:max(15.84px, .85rem); }
.schedule { border-left:4px solid var(--marker,#286ca8); padding:24px; }
.schedule-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.schedule-title { margin:0; font-size:max(15.84px, 1.08rem); font-weight:650; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.badge { display:inline-flex; align-items:center; border-radius:8px; padding:5px 9px; font-size:max(15.84px, .72rem); font-weight:600; background:#f0f4f6; white-space:nowrap; }
.meta { display:grid; gap:7px; margin:18px 0 22px; font-size:max(15.84px, .88rem); color:#617586; font-variant-numeric:tabular-nums; }
.filters { display:grid; gap:14px; }
.segmented { display:grid; grid-template-columns:repeat(4,1fr); gap:4px; padding:4px; background:#f0f4f6; border-radius:16px; }
.segmented button { border:0; padding:10px 4px; background:transparent; color:#617586; font-size:max(15.84px, .8rem); font-weight:500; }
.segmented button.active { background:white; color:#236497; box-shadow:0 2px 7px rgba(35,76,100,.065); font-weight:700; }
.count { font-size:max(15.84px, .84rem); color: var(--muted); margin: 12px 2px; }
.empty { text-align: center; padding: 42px 16px; color: var(--muted); }
.warning { border: 1px solid #f2cf80; background: #fff8e8; color: #76530a; border-radius: 12px; padding: 11px; font-size:max(15.84px, .85rem); }
.map-placeholder { min-height: 330px; border-radius: 18px; border: 1px dashed #9bb2ca; background: rgba(237,248,255,.8); display: grid; place-items: center; text-align: center; padding: 24px; color: #41566f; }
#map { min-height: 420px; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); }
.map-toolbar { display:grid; gap:16px; margin-top:18px; }
.map-summary { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size:max(15.84px, .82rem); margin: 10px 2px; }
.map-legend { display: flex; flex-wrap: wrap; gap: 8px 12px; font-size:max(15.84px, .75rem); color: var(--muted); margin: 10px 2px; }
.map-legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.map-bubble { border: 3px solid white; min-width: 30px; height: 30px; padding: 0 7px; border-radius: 999px; color: white; font-size:max(15.84px, .76rem); font-weight: 900; box-shadow: 0 3px 12px rgba(17,37,59,.38); display: grid; place-items: center; cursor: pointer; }
.map-bubble.single { width: 26px; min-width: 26px; height: 26px; padding: 0; }
.map-bubble.completed { margin-left: 20px; margin-top: 20px; }
.map-list { display: grid; gap: 8px; max-height: 48vh; overflow: auto; margin: 14px 0; }
.map-list-item { width: 100%; text-align: left; border: 1px solid var(--line); border-radius: var(--radius-control); background: rgba(255,255,255,.85); padding: 12px; color: #203b50; }
.map-list-item strong, .map-list-item small { display: block; }
.map-list-item small { color: var(--muted); margin-top: 4px; }
.detail-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.update-banner { position: fixed; z-index: 55; left: 50%; top: calc(16px + env(safe-area-inset-top, 0px)); transform: translateX(-50%); width: min(520px, calc(100% - 28px)); background: #102f55; color: white; border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.update-banner button { background: white; color: var(--navy); flex-shrink: 0; }
.onboarding { min-height: 100vh; display: grid; place-items: center; padding: calc(28px + env(safe-area-inset-top, 0px)) 24px 28px; background: transparent; }
.onboarding .panel { width: min(520px, 100%); }
.app-shell:has(.onboarding) { padding-bottom: 0; }
.logo { width:160px; height:160px; border-radius:26px; object-fit:contain; box-shadow:var(--shadow); }
.toast { position: fixed; z-index: 60; left: 50%; bottom: calc(112px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px); background: #12243a; color: white; border-radius: 12px; padding: 11px 15px; opacity: 0; pointer-events: none; transition:opacity .24s cubic-bezier(.32,.72,0,1), transform .24s cubic-bezier(.32,.72,0,1); max-width: calc(100% - 36px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.modal { color:#203b50; background:#fff; border:1px solid white; border-radius:26px; padding:0; width:min(440px,calc(100% - 32px)); box-shadow:0 24px 80px rgba(35,76,100,.18); }
.modal::backdrop { background: rgba(24,54,82,.32); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); }
.modal-body { padding: 22px; }
.map-sheet { position: fixed; inset: auto 0 calc(108px + env(safe-area-inset-bottom, 0px)); margin: 0 auto; z-index: 30; width: min(724px, calc(100% - 24px)); max-height: min(56vh, 540px); max-height: min(56dvh, 540px); overflow-y: auto; overscroll-behavior: contain; border: 1px solid rgba(255,255,255,.95); border-radius: 28px; background: rgba(246,252,255,.98); color: #203b50; padding: 0; box-shadow: 0 -8px 40px rgba(41,88,130,.18); }
.sheet-handle { width: 40px; height: 4px; border-radius: 999px; background: #b6cde0; margin: 12px auto 0; }
.sheet-body { padding: 12px 20px 20px; }
.sheet-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.sheet-header h2 { font-size:max(15.84px, 1.1rem); margin: 4px 0; overflow-wrap: anywhere; }
.sheet-header .eyebrow { margin: 0; }
.sheet-close { flex-shrink: 0; min-width: 64px; }
.sheet-memo { white-space: pre-wrap; overflow-wrap: anywhere; }
.sheet-actions { margin-top: 14px; }
.sheet-actions .btn { min-width: 0; }
.onboarding h1 { color: var(--navy); font-size: clamp(1.6rem, 6vw, 2.1rem); line-height: 1.3; margin: 14px 0; letter-spacing: -.04em; }
.onboarding-progress { display: flex; align-items: center; gap: 6px; margin-bottom: 30px; }
.onboarding-progress span { width: 24px; height: 5px; background: #d6e7f4; border-radius: 999px; }
.onboarding-progress span.active { background: var(--blue); }
.onboarding-progress small { margin-left: auto; color: var(--muted); }
.onboarding-lead { color: var(--muted); font-size:max(15.84px, 1.05rem); }
.welcome-preview { display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0; }
.welcome-preview span { border-radius: 999px; background: var(--soft-blue); color: #1659a0; padding: 8px 12px; font-size:max(15.84px, .85rem); }
.onboarding-features { display: grid; gap: 10px; margin: 22px 0; }
.onboarding-features div { background: rgba(255,255,255,.7); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.onboarding-features p { font-size:max(15.84px, .88rem); color: var(--muted); margin: 5px 0 0; }
.onboarding .warning p { margin: 8px 0 0; }
.onboarding-controls { display: flex; gap: 10px; margin-top: 24px; }
.onboarding-primary { flex: 1; width: 100%; }
.onboarding-skip { display: block; margin: 14px auto 0; padding: 10px; border: 0; background: transparent; color: var(--muted); text-decoration: underline; }
.switch-row { display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.switch { appearance: none; -webkit-appearance: none; flex-shrink: 0; width: 48px; min-height: 28px; height: 28px; border-radius: 999px; padding: 3px; background: #a8bbcc; border: 0; cursor: pointer; }
.switch::before { content: ""; display: block; width: 22px; height: 22px; border-radius: 50%; background: white; box-shadow: 0 1px 4px #61778a44; }
.switch:checked { background:#338970; }
.switch:checked::before { transform: translateX(20px); }
.offline { background: #462a2a; color: white; text-align: center; padding: 7px; font-size:max(15.84px, .82rem); }
.char-count { text-align: right; font-size:max(15.84px, .75rem); color: var(--muted); }
@media (max-width: 560px) {
  .row.three { grid-template-columns: 1fr; }
  .row { grid-template-columns: 1fr; }
  .page { padding-inline: 14px; }
  .segmented { grid-template-columns:repeat(4,minmax(0,1fr)); }
}

.onboarding h1:focus { outline: none; }

.search-bar { display: flex; align-items: center; gap: 10px; padding: 14px; }
.search-bar input { flex: 1; min-width: 0; }
.search-button { flex: 0 0 48px; width: 48px; padding: 12px; display: grid; place-items: center; }

.time-inputs { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 10px; }

.onboarding .privacy-warning { border: 1px solid #eaa0a7; border-left: 4px solid #c73333; background: #fff0f1; color: #8a2531; }
.onboarding .privacy-warning strong { color: #b42335; }

.manage-sort-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 10px; }

.map-date-row { display:grid; grid-template-columns:48px minmax(0,1fr) 48px; gap:10px; align-items:center; }
.map-date-row .btn { padding-left:0; padding-right:0; }

.map-date-range { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:10px; }
.map-date-range .map-date-row { grid-template-columns:32px minmax(0,1fr) 32px; gap:4px; min-width:0; }
.map-date-range input { min-width:0; padding-left:8px; padding-right:8px; }
@media (max-width:560px) {
  .map-date-range { gap:6px; }
  .map-date-range .map-date-row { grid-template-columns:24px minmax(0,1fr) 24px; gap:2px; }
  .map-date-range input { font-size:18.72px; padding-left:3px; padding-right:3px; }
}

.profile-name-row { display:grid; grid-template-columns:minmax(0,1fr) 48px; gap:10px; align-items:center; }
.profile-save-button { display:flex; align-items:center; justify-content:center; padding:0; min-height:48px; }

/* Brand-led, soft structural surfaces; preserve the existing task flows. */
.header-logo { width:64px; height:64px; object-fit:contain; border-radius:16px; flex-shrink:0; }
.topbar > .btn:last-child { margin-left:auto; }
.hero-kicker { display:inline-flex; color:#39806d; background:#eaf4ef; padding:4px 10px; border-radius:999px; font-size:max(15.84px, .72rem); font-weight:600; }
.home-clock { color:var(--muted); font-size:max(15.84px, .92rem); font-variant-numeric:tabular-nums; margin:0; }
.hero .muted { margin:22px 0 0; font-size:max(15.84px, .85rem); }
.stat-primary { grid-column:1 / -1; display:flex; align-items:center; justify-content:space-between; background:#eaf3fa; color:#386783; }
.stat-primary strong { margin:0; font-size:max(15.84px, 2.4rem); color:#236497; }
.stat-completed strong { color:#338970; }
.home-shortcuts { display:grid; gap:12px; margin-top:24px; }
.shortcut { display:flex; align-items:center; gap:16px; text-align:left; min-height:88px; padding:18px 22px; border:1px solid rgba(255,255,255,.95); border-radius:20px; background:white; color:var(--navy); box-shadow:var(--shadow); }
.shortcut-icon { display:grid; place-items:center; width:44px; height:44px; border-radius:14px; background:#eef5f8; color:#397ba8; flex-shrink:0; }
.shortcut-icon svg { width:22px; height:22px; }
.shortcut strong { display:block; font-size:max(15.84px, .94rem); font-weight:600; }
.shortcut small { display:block; font-size:max(15.84px, .78rem); color:var(--muted); margin-top:3px; }
.shortcut > span:last-child { margin-left:auto; color:#78909f; }
.status-filter { padding:10px; background:transparent; border:0; box-shadow:none; }
#schedule-form > .btn { width:100%; margin-top:8px; }
#schedule-form input[readonly] { background:#f7f9fa; }
.profile-name-row { margin-bottom:0; }
.card:has(.profile-name-row) .field { margin-bottom:0; }
#map { border-radius:22px; box-shadow:var(--shadow); }
.map-toolbar .switch-row { padding-top:10px; border-top:1px solid var(--line); font-size:max(15.84px, .88rem); }
input[type=date] { font-variant-numeric:tabular-nums; }
.onboarding .panel { padding:32px; }
.onboarding-features div { background:#f7fafb; border:0; }
.onboarding-progress span.active { background:#338970; }
.sheet-body { padding:16px 24px 24px; }
@keyframes page-arrive { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:translateY(0); } }
.page, .onboarding .panel { animation:page-arrive .3s cubic-bezier(.32,.72,0,1); }
@media (prefers-reduced-motion:reduce) { .page, .onboarding .panel { animation:none; } }
@media (max-width:560px) {
  .page { padding-top:24px; }
  .card { padding:20px; }
  .hero { padding:26px 22px; }
  .header-logo { width:56px; height:56px; }
  .topbar { margin-bottom:22px; gap:10px; }
  .brand { font-size:max(15.84px, 1.4rem); }
  .stat { padding:18px; }
  .status-filter { padding:4px 0; }
  .segmented button { font-size:max(15.84px, .74rem); }
  .onboarding .panel { padding:24px; }
  .logo { width:140px; height:140px; }
}
