/* StackCar 화면 스타일
   기준: 흰 바탕, 먹색 글자, 회색 면, 강조색은 상태 표시에만. 그림자와 장식은 쓰지 않는다. */

:root {
  --bg: #ffffff;
  --surface: #f4f4f2;
  --surface-2: #e9e9e6;
  --line: #e6e6e2;
  --line-2: #cfcfca;
  --ink: #0c0c0d;
  --ink-2: #5f5f64;
  --ink-3: #96969b;
  --on-ink: #ffffff;
  --warn: #d9560b;
  --bad: #d3281c;
  --bad-bg: #fcebe9;
  --good: #1f7a4d;
  --glass: rgba(255, 255, 255, .84);
  --seg-on: #ffffff;
  --scrim: rgba(0, 0, 0, .42);
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0b0c;
    --surface: #18181a;
    --surface-2: #242427;
    --line: #26262a;
    --line-2: #3a3a3f;
    --ink: #f4f4f1;
    --ink-2: #a3a3a9;
    --ink-3: #6d6d73;
    --on-ink: #0b0b0c;
    --warn: #ff8a3d;
    --bad: #ff6257;
    --bad-bg: #2c1513;
    --good: #4cc38a;
    --glass: rgba(22, 22, 24, .82);
    --seg-on: #2e2e32;
    --scrim: rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0b0b0c;
  --surface: #18181a;
  --surface-2: #242427;
  --line: #26262a;
  --line-2: #3a3a3f;
  --ink: #f4f4f1;
  --ink-2: #a3a3a9;
  --ink-3: #6d6d73;
  --on-ink: #0b0b0c;
  --warn: #ff8a3d;
  --bad: #ff6257;
  --bad-bg: #2c1513;
  --good: #4cc38a;
  --glass: rgba(22, 22, 24, .82);
  --seg-on: #2e2e32;
  --scrim: rgba(0, 0, 0, .6);
  color-scheme: dark;
}

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

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  touch-action: manipulation; /* 두 번 눌러 확대 막기 */
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  word-break: keep-all;      /* 한글은 낱말 단위로 줄바꿈 */
  overflow-wrap: anywhere;   /* 긴 영문·숫자는 넘치지 않게 */
  overscroll-behavior-y: none;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, p, ol, ul { margin: 0; padding: 0; }
ol, ul { list-style: none; }
[hidden] { display: none !important; }

button {
  margin: 0; padding: 0; border: 0; background: none;
  color: inherit; font: inherit; text-align: inherit;
  cursor: pointer; touch-action: manipulation;
  -webkit-user-select: none; user-select: none;
}
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
input, textarea, select { font: inherit; color: inherit; }
svg { display: block; flex: none; }
.ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nw { white-space: nowrap; }

/* ---------- 전체 화면(로딩·로그인·오류) ---------- */
.screen {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; justify-content: center;
  max-width: 420px; margin: 0 auto;
  padding: calc(24px + env(safe-area-inset-top)) 28px calc(24px + env(safe-area-inset-bottom));
}
.brand { display: inline-flex; align-items: center; gap: 9px; font-size: 18px; font-weight: 700; letter-spacing: -.02em; }
.brand-ic { display: block; flex: none; width: 28px; height: 28px; border-radius: 7px; }
.brand.lg { flex-direction: column; align-items: flex-start; gap: 18px; font-size: 26px; }
.brand.lg .brand-ic { width: 60px; height: 60px; border-radius: 14px; }

.load-bar { position: relative; height: 2px; margin-top: 28px; background: var(--surface-2); overflow: hidden; }
.load-bar i { position: absolute; top: 0; bottom: 0; left: 0; width: 34%; background: var(--ink); animation: sweep 1.25s cubic-bezier(.4, 0, .2, 1) infinite; }
@keyframes sweep { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
.steps { margin-top: 22px; }
.steps li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 7px 0; font-size: 14px; color: var(--ink-3); }
.steps li.on { color: var(--ink); font-weight: 600; }
.steps li.done { color: var(--ink-2); }
.steps em { font-style: normal; font-size: 12.5px; font-weight: 500; color: var(--ink-3); white-space: nowrap; }
.load-note { min-height: 20px; margin-top: 14px; font-size: 13px; color: var(--ink-2); }

.lead { margin-top: 28px; font-size: 22px; font-weight: 650; letter-spacing: -.02em; line-height: 1.3; }
.sublead { margin-top: 8px; font-size: 14px; color: var(--ink-2); }
.login .inp { margin-top: 24px; }
.login .btn { width: 100%; margin-top: 14px; }
.fine { margin-top: 18px; font-size: 12.5px; line-height: 1.55; color: var(--ink-3); }
.err-actions { display: flex; gap: 10px; margin-top: 26px; }

/* ---------- 앱 틀 ---------- */
.top {
  position: -webkit-sticky; position: sticky; top: 0; z-index: 10;
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(18px); backdrop-filter: saturate(180%) blur(18px);
  padding-top: env(safe-area-inset-top);
}
.top-in { display: flex; align-items: center; justify-content: space-between; max-width: 520px; height: 54px; margin: 0 auto; padding: 0 10px 0 20px; }
.top-btns { display: flex; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; color: var(--ink); }
.icon-btn:active { background: var(--surface); }
.icon-btn.busy svg { animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.quiet { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; overflow: hidden; }
.quiet i { position: absolute; top: 0; bottom: 0; left: 0; width: 30%; background: var(--ink); animation: sweep 1.1s cubic-bezier(.4, 0, .2, 1) infinite; }

.banner { max-width: 520px; margin: 4px auto 0; padding: 0 20px; }
.banner-in { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--bad-bg); color: var(--bad); font-size: 13.5px; font-weight: 550; line-height: 1.4; }
.banner-in span { flex: 1; min-width: 0; }
.banner-in button { flex: none; height: 34px; padding: 0 12px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 13px; font-weight: 650; white-space: nowrap; }

main { max-width: 520px; margin: 0 auto; padding: 0 20px calc(112px + env(safe-area-inset-bottom)); }
.page-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0 16px; }
.page-h h1 { font-size: 26px; font-weight: 700; letter-spacing: -.03em; line-height: 1.2; }
.link { flex: none; padding: 10px 0 10px 12px; font-size: 14px; font-weight: 550; color: var(--ink-2); white-space: nowrap; }
/* 기록 탭의 날짜 단추: 날짜를 걸러 두었으면 검게 */
.period-btn { flex: none; display: inline-flex; align-items: center; gap: 6px; max-width: 70%; height: 38px; padding: 0 12px 0 10px; border-radius: 10px; background: var(--surface); font-size: 13.5px; font-weight: 550; color: var(--ink); white-space: nowrap; }
.period-btn .ico { flex: none; width: 17px; height: 17px; color: var(--ink-2); }
.period-btn span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.period-btn.on { background: var(--ink); color: var(--on-ink); }
.period-btn.on .ico { color: var(--on-ink); }
.period-sum { display: flex; align-items: baseline; gap: 10px; margin-top: 18px; font-size: 13.5px; color: var(--ink-2); }
.period-sum b { font-size: 20px; font-weight: 650; letter-spacing: -.02em; color: var(--ink); }
#lp-pick .f:first-child { margin-top: 18px; }
.period-note { margin-top: 18px; padding: 16px 0 6px; text-align: center; font-size: 14px; color: var(--ink-2); }
.stepper { display: flex; align-items: center; justify-content: space-between; height: 54px; margin-top: 18px; border-radius: 12px; background: var(--surface); }
.stepper b { font-size: 16px; font-weight: 600; white-space: nowrap; }
.stepper button { flex: none; width: 54px; height: 54px; display: grid; place-items: center; color: var(--ink); border-radius: 12px; }
.stepper button:first-child .ico { transform: rotate(180deg); }
.stepper button[disabled] { opacity: .25; pointer-events: none; }

/* ---------- 홈 ---------- */
.hero { padding: 18px 0 22px; }
.eyebrow { font-size: 13.5px; font-weight: 500; color: var(--ink-2); }
.hero-num { display: flex; align-items: baseline; gap: 7px; margin-top: 6px; font-size: clamp(48px, 15.5vw, 66px); font-weight: 300; letter-spacing: -.045em; line-height: 1.02; white-space: nowrap; }
.hero-num small { font-size: .32em; font-weight: 500; letter-spacing: 0; color: var(--ink-2); }
.hero-sub { margin-top: 10px; font-size: 13.5px; color: var(--ink-2); }

.status { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 54px; padding: 12px 12px 12px 16px; border-radius: 14px; background: var(--surface); }
.status .txt { flex: 1; min-width: 0; font-size: 15px; font-weight: 600; line-height: 1.35; }
.status .ico { width: 18px; height: 18px; color: var(--ink-3); }
.dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.dot.good { background: var(--good); }
.dot.warn { background: var(--warn); }
.dot.bad { background: var(--bad); }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.tile { min-width: 0; padding: 15px 16px 16px; border-radius: 14px; background: var(--surface); }
.tile .k { font-size: 13px; font-weight: 500; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .v { margin-top: 9px; font-size: 25px; font-weight: 600; letter-spacing: -.03em; line-height: 1.1; white-space: nowrap; overflow: hidden; }
.tile .v small { margin-left: 3px; font-size: 13px; font-weight: 500; letter-spacing: 0; color: var(--ink-2); }
.tile .s { margin-top: 6px; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sec { margin-top: 30px; }
.sec-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; border-bottom: 1px solid var(--ink); }
.sec-h h2 { font-size: 16px; font-weight: 650; letter-spacing: -.01em; }
.sec-h .aside { font-size: 13px; color: var(--ink-2); white-space: nowrap; }

.empty { padding: 34px 0; text-align: center; font-size: 14px; color: var(--ink-2); line-height: 1.6; }
.empty b { display: block; margin-bottom: 4px; font-size: 15.5px; font-weight: 650; color: var(--ink); }

/* ---------- 정비 항목 줄 ---------- */
.care { display: block; width: 100%; padding: 15px 0 14px; border-bottom: 1px solid var(--line); }
.care-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.care-name { min-width: 0; font-size: 15.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.care-rem { flex: none; font-size: 14.5px; font-weight: 600; white-space: nowrap; }
.care-rem.warn { color: var(--warn); }
.care-rem.bad { color: var(--bad); }
.care-rem.none { font-weight: 500; color: var(--ink-3); }
.bar { height: 3px; margin-top: 11px; border-radius: 2px; background: var(--surface-2); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 2px; background: var(--ink); }
.bar.warn i { background: var(--warn); }
.bar.bad i { background: var(--bad); }
.care-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; font-size: 12.5px; color: var(--ink-3); }
.care-meta span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.care-meta span:last-child { flex: none; }
.care-meta .warn { color: var(--warn); }
.care-meta .bad { color: var(--bad); }

/* 통상 주기 길이의 막대: 가혹 기준 눈금 앞은 실선, 뒤는 점선 */
.track { position: relative; height: 11px; margin-top: 8px; color: var(--ink); }
.track.warn { color: var(--warn); }
.track.bad { color: var(--bad); }
.track i { position: absolute; display: block; }
.track .tr, .track .fl { top: 4px; height: 3px; }
.track .tr.solid { background: var(--surface-2); }
.track .tr.dash { background: repeating-linear-gradient(90deg, var(--line-2) 0 5px, transparent 5px 9px); }
.track .fl.solid { background: currentColor; }
.track .fl.dash { background: repeating-linear-gradient(90deg, currentColor 0 5px, transparent 5px 9px); }
.track .tick { top: 0; width: 2px; height: 11px; margin-left: -1px; background: currentColor; }
.care-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 12px 0 2px; font-size: 12px; color: var(--ink-2); }
.care-legend span { white-space: nowrap; }
.care-legend .lg { display: inline-block; vertical-align: middle; margin-right: 6px; width: 20px; height: 3px; }
.care-legend .lg.solid { background: var(--ink); }
.care-legend .lg.dash { background: repeating-linear-gradient(90deg, var(--ink-3) 0 5px, transparent 5px 9px); }
.care-legend .lg.tick { width: 2px; height: 11px; background: var(--ink); }

/* ---------- 기록 줄 ---------- */
.month { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 26px 0 9px; border-bottom: 1px solid var(--ink); }
.month b { font-size: 14.5px; font-weight: 650; }
.month span { font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.row .ic { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--surface); color: var(--ink-2); }
.row .ic .ico { width: 19px; height: 19px; }
.row .mid { flex: 1; min-width: 0; }
.row .t { display: block; font-size: 15.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .d { display: block; margin-top: 3px; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .amt { flex: none; max-width: 46%; text-align: right; }
.row .amt b { display: block; font-size: 15.5px; font-weight: 600; white-space: nowrap; }
.row .amt span { display: block; margin-top: 3px; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.row .amt .none { font-weight: 500; color: var(--ink-3); }
/* ---------- 구간 선택 ---------- */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); padding: 3px; border-radius: 12px; background: var(--surface); }
.seg button { height: 38px; border-radius: 9px; font-size: 14px; font-weight: 550; color: var(--ink-2); text-align: center; white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--seg-on); color: var(--ink); font-weight: 650; box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }

/* ---------- 통계 ---------- */
.facts { margin-top: 18px; border-top: 1px solid var(--ink); }
.fact { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.fact dt { font-size: 14px; color: var(--ink-2); white-space: nowrap; }
.fact dd { margin: 0; min-width: 0; font-size: 16px; font-weight: 600; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fact dd small { margin-left: 6px; font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
dl { margin: 0; }
.chart { margin-top: 14px; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart text { font-family: var(--font); fill: var(--ink-2); font-size: 11px; }
.chart .val { fill: var(--ink); font-weight: 600; }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .b1, .chart .sel, .chart .pt { fill: var(--ink); }
.chart .b2 { fill: var(--line-2); }
.chart .axis { stroke: var(--line); stroke-width: 1; }
.chart .ln { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.chart .avg { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 3 4; }
.chart-note { min-height: 20px; margin-top: 8px; font-size: 13px; color: var(--ink-2); }
.chart-note b { font-weight: 650; color: var(--ink); }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--ink-2); }
.legend i { display: inline-block; width: 9px; height: 9px; margin-right: 6px; border-radius: 2px; background: var(--ink); }
.legend i.b { background: var(--line-2); }

/* ---------- 아래 메뉴 ---------- */
.tabbar {
  position: fixed; left: 50%; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 20;
  transform: translateX(-50%);
  width: calc(100% - 24px); max-width: 440px; height: 64px;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: center;
  padding: 0 4px; border: 1px solid var(--line); border-radius: 22px;
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .10);
}
.tab { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 10.5px; font-weight: 600; color: var(--ink-3); white-space: nowrap; }
.tab[aria-current="page"] { color: var(--ink); }
.tab-add { justify-self: center; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: var(--on-ink); }
.tab-add .ico { width: 24px; height: 24px; stroke-width: 2; }
.tab-add:active { transform: scale(.94); }

/* ---------- 아래에서 올라오는 창 ---------- */
.layer { position: fixed; inset: 0; z-index: 50; }
.scrim { position: absolute; inset: 0; background: var(--scrim); opacity: 0; transition: opacity .22s ease; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: var(--kb, 0px);
  max-width: 520px; margin: 0 auto;
  max-height: calc(100vh - 20px);
  max-height: calc(var(--vvh, 100dvh) - 12px - env(safe-area-inset-top));
  display: flex; flex-direction: column;
  background: var(--bg); border-radius: 22px 22px 0 0;
  transform: translateY(100%); transition: transform .3s cubic-bezier(.2, .8, .2, 1);
  box-shadow: 0 -8px 40px rgba(0, 0, 0, .16);
}
.sheet.full { height: calc(var(--vvh, 100dvh) - 12px - env(safe-area-inset-top)); }
.layer.open .scrim { opacity: 1; }
.layer.open .sheet { transform: none; }
.sheet-h { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 60px; padding: 8px 8px 0 20px; }
.sheet-h h3 { min-width: 0; font-size: 19px; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-b { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 4px 20px 20px; }
.sheet-f { flex: none; padding: 10px 20px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.sheet-f .btns { display: flex; gap: 10px; }
.form-err { margin-bottom: 10px; font-size: 13.5px; font-weight: 550; color: var(--bad); line-height: 1.4; }

@media (min-width: 620px) {
  .sheet { bottom: auto; top: 50%; border-radius: 22px; transform: translateY(calc(-50% + 24px)); opacity: 0; transition: transform .22s ease, opacity .22s ease; max-height: min(760px, calc(100vh - 48px)); }
  .sheet.full { height: min(760px, calc(100vh - 48px)); }
  .layer.open .sheet { transform: translateY(-50%); opacity: 1; }
}

/* ---------- 입력 ---------- */
.f { display: block; margin-top: 18px; }
.f:first-child { margin-top: 6px; }
.f .l { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; font-size: 13.5px; font-weight: 550; color: var(--ink-2); }
.f .l em { font-style: normal; font-size: 12.5px; font-weight: 500; color: var(--ink-3); white-space: nowrap; }
.inp { display: flex; align-items: center; height: 54px; padding: 0 14px; border: 1.5px solid transparent; border-radius: 12px; background: var(--surface); transition: border-color .15s ease; }
.inp:focus-within { border-color: var(--ink); }
.inp.err { border-color: var(--bad); }
.inp input, .inp textarea {
  flex: 1; min-width: 0; width: 100%; height: 100%;
  margin: 0; padding: 0; border: 0; border-radius: 0; outline: 0; background: transparent;
  font-size: 17px; /* 16px 밑이면 아이폰이 입력할 때 화면을 확대한다 */
  font-weight: 550; letter-spacing: -.01em;
  -webkit-appearance: none; appearance: none;
}
.inp input::placeholder, .inp textarea::placeholder { color: var(--ink-3); font-weight: 450; }
.inp input[type="date"] { min-height: 0; text-align: left; }
.inp input[type="date"]::-webkit-date-and-time-value { text-align: left; }
.inp .u { flex: none; margin-left: 8px; font-size: 14px; font-weight: 500; color: var(--ink-3); white-space: nowrap; }
.inp.ta { height: auto; padding: 13px 14px; }
.inp.ta textarea { height: 52px; resize: none; line-height: 1.45; font-size: 16px; font-weight: 500; }
.hint { margin-top: 7px; font-size: 12.5px; line-height: 1.4; color: var(--ink-3); }
.hint.warn { color: var(--warn); }
.hint.err { color: var(--bad); }
.g2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.g2 .f { margin-top: 18px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { max-width: 100%; height: 40px; padding: 0 14px; border-radius: 10px; background: var(--surface); font-size: 14.5px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }
.chip.sm { height: 34px; padding: 0 12px; font-size: 13.5px; }

.toggle { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; margin-top: 18px; padding: 14px 14px 14px 16px; border-radius: 12px; background: var(--surface); }
.toggle .tx { min-width: 0; }
.toggle b { display: block; font-size: 15px; font-weight: 600; }
.toggle span { display: block; margin-top: 2px; font-size: 12.5px; color: var(--ink-2); }
.sw { flex: none; position: relative; width: 48px; height: 30px; border-radius: 15px; background: var(--line-2); transition: background .18s ease; }
.sw::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, .25); transition: transform .18s ease; }
.toggle[aria-checked="true"] .sw { background: var(--ink); }
.toggle[aria-checked="true"] .sw::after { transform: translateX(18px); background: var(--on-ink); }

.btn { flex: 1; min-width: 0; display: inline-flex; align-items: center; justify-content: center; gap: 9px; height: 54px; padding: 0 18px; border-radius: 14px; font-size: 16px; font-weight: 650; white-space: nowrap; }
.btn.pri { background: var(--ink); color: var(--on-ink); }
.btn.sub { background: var(--surface); color: var(--ink); }
.btn.danger { background: var(--bad-bg); color: var(--bad); }
.btn.slim { flex: none; }
.btn:active { opacity: .86; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.spinner { width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }

/* ---------- 상세·설정 ---------- */
.kv { border-top: 1px solid var(--ink); }
.kv .fact dd { font-size: 15px; }
.sub-h { margin-top: 28px; padding-bottom: 9px; border-bottom: 1px solid var(--ink); font-size: 14.5px; font-weight: 650; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 56px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15.5px; font-weight: 550; }
.set-row .r { display: flex; align-items: center; gap: 6px; flex: none; font-size: 14px; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.set-row .r .ico { width: 18px; height: 18px; color: var(--ink-3); }
.set-row.danger { color: var(--bad); }
.set-block { padding: 14px 0; border-bottom: 1px solid var(--line); }
.set-block .cap { margin-bottom: 10px; font-size: 15.5px; font-weight: 550; }
.diag { margin-top: 14px; font-size: 12px; line-height: 1.6; color: var(--ink-3); }

.item-row { display: flex; align-items: center; gap: 8px; min-height: 62px; border-bottom: 1px solid var(--line); }
.item-row .main { flex: 1; min-width: 0; padding: 11px 0; }
.item-row .t { font-size: 15.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-row .d { margin-top: 3px; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-row .mv { flex: none; display: flex; }
.item-row .mv button { width: 40px; height: 44px; display: grid; place-items: center; color: var(--ink-2); border-radius: 10px; }
.item-row .mv button[disabled] { opacity: .25; pointer-events: none; }
.item-row .mv button:active { background: var(--surface); }
.item-row > .ico { width: 18px; height: 18px; color: var(--ink-3); }

.confirm p { margin-top: 2px; font-size: 14.5px; color: var(--ink-2); line-height: 1.55; }

/* ---------- 알림 ---------- */
#toast {
  position: fixed; left: 50%; bottom: calc(88px + env(safe-area-inset-bottom) + var(--kb, 0px)); z-index: 80;
  transform: translate(-50%, 10px);
  width: max-content; max-width: calc(100% - 32px);
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px; border-radius: 12px;
  background: var(--ink); color: var(--on-ink);
  font-size: 14px; font-weight: 550; line-height: 1.35;
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease;
}
#toast.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
#toast button { flex: none; padding: 4px 0; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }

/* ---------- 좁은 화면(320px 폰) ---------- */
@media (max-width: 359px) {
  main, .banner { padding-left: 16px; padding-right: 16px; }
  .top-in { padding-left: 16px; padding-right: 6px; }
  .sheet-b { padding-left: 16px; padding-right: 16px; }
  .sheet-f { padding-left: 16px; padding-right: 16px; }
  .sheet-h { padding-left: 16px; }
  .tile { padding: 14px 13px 15px; }
  .tile .v { font-size: 22px; }
  .row { gap: 10px; }
  .row .ic { width: 32px; height: 32px; border-radius: 9px; }
  .row .t, .row .amt b, .care-name { font-size: 15px; }
  .tab { font-size: 10px; }
  .btn { padding: 0 12px; font-size: 15.5px; }
  .inp { padding: 0 12px; }
  .screen { padding-left: 22px; padding-right: 22px; }
}

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