/* 퀵 기사 장부 v2 — 어두운 바탕 기본(밤 운행), 밝은 모드는 기기 설정을 따른다 */
:root {
  --bg: #0d0f14; --bg2: #12151c; --card: #171a23; --card2: #1f2330; --line: #2a2f3d;
  --text: #f3f5f9; --sub: #98a1b3; --mute: #6b7386;
  --accent: #ff7a1a; --accent2: #ffb04d; --accent-ink: #1a0d00;
  --in: #2fd47c; --out: #ff5d6c; --warn: #ffc53d; --ok: #2fd47c;
  --r: 20px;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --font: system-ui, -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f3f4f8; --bg2: #eceef4; --card: #ffffff; --card2: #f1f2f7; --line: #e2e5ee;
    --text: #141821; --sub: #5d6578; --mute: #8a91a3;
    --in: #12a356; --out: #e23d50; --warn: #b77d00; --accent2: #e86a0c;
    --shadow: 0 8px 24px rgba(20,24,33,.08);
    color-scheme: light;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); }
body { min-height: 100vh; padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
button, input, select { font: inherit; color: inherit; }
svg { width: 22px; height: 22px; flex: none; }
a { color: var(--accent2); }
.c-in { color: var(--in); } .c-out { color: var(--out); }
.hint { color: var(--sub); font-size: 13.5px; line-height: 1.55; margin: 8px 0; }
.center { text-align: center; }
.msg { min-height: 1.2em; color: var(--accent2); font-size: 14px; margin: 8px 2px; }
[hidden] { display: none !important; }

/* 상단 */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: var(--bg); }
.brand { display: flex; gap: 10px; align-items: center; }
.brand img { border-radius: 10px; }
.brand b { display: block; font-size: 17px; letter-spacing: -.3px; }
.brand span { display: block; font-size: 12.5px; color: var(--sub); }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--card); display: grid; place-items: center; cursor: pointer; font-size: 24px; line-height: 1; }
main { max-width: 560px; margin: 0 auto; padding: 4px 16px 16px; }
.tab { animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* 카드 */
.card { background: var(--card); border-radius: var(--r); padding: 16px; margin: 12px 0; box-shadow: var(--shadow); }
.card-h { margin: 0 0 8px; font-size: 16px; } .card-h small { color: var(--sub); font-weight: 400; font-size: 12.5px; }
.sec { font-size: 15px; color: var(--sub); margin: 22px 4px 8px; font-weight: 600; }
.row-between { display: flex; justify-content: space-between; align-items: center; }
.lbl { display: block; font-size: 12.5px; color: var(--sub); margin: 10px 0 6px; }
.link { background: none; border: 0; color: var(--accent2); font-weight: 700; cursor: pointer; padding: 6px; margin-top: 14px; }

/* 오늘 요약 */
.hero { position: relative; overflow: hidden; border-radius: 26px; padding: 20px 20px 18px; margin: 6px 0 14px;
  background: radial-gradient(120% 140% at 100% 0%, rgba(255,122,26,.28), transparent 55%), linear-gradient(160deg, var(--card2), var(--card)); box-shadow: var(--shadow); }
.hero-label { color: var(--sub); font-size: 13.5px; }
.hero-num { font-size: 40px; font-weight: 800; letter-spacing: -1.2px; margin: 2px 0 14px; font-variant-numeric: tabular-nums; }
.hero-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.hero-row div { background: rgba(127,127,127,.1); border-radius: 14px; padding: 9px 10px; }
.hero-row span { display: block; color: var(--sub); font-size: 12px; }
.hero-row b { font-size: 16px; font-variant-numeric: tabular-nums; }
.goal { display: flex; gap: 10px; align-items: center; margin-top: 12px; font-size: 12.5px; color: var(--sub); }
.goal-bar { flex: 1; height: 8px; border-radius: 8px; background: rgba(127,127,127,.18); overflow: hidden; }
.goal-bar i { display: block; height: 100%; width: 0; border-radius: 8px; background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width .4s; }

/* 큰 마이크 */
.mic-hero { width: 100%; border: 0; background: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 0 4px; }
.mic-disc { position: relative; width: 150px; height: 150px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  background: radial-gradient(circle at 35% 30%, #ffa04d, var(--accent) 55%, #e8560a); box-shadow: 0 16px 40px rgba(255,122,26,.45), inset 0 -6px 16px rgba(0,0,0,.18); transition: transform .12s; }
.mic-disc svg { width: 72px; height: 72px; position: relative; z-index: 1; }
.mic-hero:active .mic-disc { transform: scale(.95); }
.mic-hero b { font-size: 19px; margin-top: 10px; }
.mic-hero small { color: var(--sub); font-size: 13px; }
.ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(255,122,26,.5); animation: ring 2.4s ease-out infinite; }
.ring.r2 { animation-delay: 1.2s; } .ring.r3 { animation-delay: .6s; }
@keyframes ring { from { transform: scale(1); opacity: .9; } to { transform: scale(1.5); opacity: 0; } }

.quick4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 18px 0 6px; }
.qbtn { border: 0; background: var(--card); border-radius: 16px; padding: 12px 4px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 13.5px; font-weight: 700; cursor: pointer; box-shadow: var(--shadow); }
.qbtn span { font-size: 22px; line-height: 22px; font-weight: 800; }
.qbtn.in span { color: var(--in); } .qbtn.out span { color: var(--out); }
.qbtn svg { color: var(--accent2); }

.shift, .odo { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.shift b, .odo b { display: block; font-size: 17px; }
.shift small, .odo small { display: block; color: var(--sub); font-size: 12.5px; margin-top: 2px; }
.odo b.big { font-size: 28px; letter-spacing: -.6px; font-variant-numeric: tabular-nums; }
.shift .lbl, .odo .lbl { margin: 0 0 2px; }
.pill-btn { border: 0; border-radius: 999px; padding: 12px 18px; font-weight: 800; background: var(--card2); cursor: pointer; white-space: nowrap; }
.pill-btn.on { background: var(--accent); color: var(--accent-ink); }

/* 알림 */
.alert { display: flex; gap: 10px; align-items: center; border-radius: 16px; padding: 12px 14px; margin: 8px 0; background: var(--card); border-left: 4px solid var(--warn); }
.alert.over { border-left-color: var(--out); } .alert.pend { border-left-color: var(--accent); }
.alert .t { flex: 1; font-size: 14px; line-height: 1.45; min-width: 0; } .alert .t small { display: block; color: var(--sub); }
.alert button { border: 0; border-radius: 10px; padding: 9px 11px; background: var(--card2); font-weight: 700; cursor: pointer; white-space: nowrap; }
.alert button.ok { background: var(--accent); color: var(--accent-ink); }

/* 기록 목록 */
.entries { list-style: none; padding: 0; margin: 0; }
.entries li { display: flex; align-items: center; gap: 12px; padding: 12px; margin: 6px 0; background: var(--card); border-radius: 16px; cursor: pointer; }
.entries li.pending { outline: 1.5px dashed var(--accent); }
.entries .ic { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; font-size: 12.5px; font-weight: 800; flex: none; }
.ic.in { background: rgba(47,212,124,.14); color: var(--in); } .ic.out { background: rgba(255,93,108,.13); color: var(--out); } .ic.note { background: var(--card2); color: var(--sub); }
.entries .m { flex: 1; min-width: 0; } .entries .m b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entries .m span { display: block; font-size: 12.5px; color: var(--sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entries .a { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.entries .empty { justify-content: center; color: var(--sub); cursor: default; font-size: 14px; }
.dayhead { display: flex; justify-content: space-between; align-items: baseline; margin: 18px 4px 4px; font-size: 14px; }
.dayhead b { font-size: 15px; } .dayhead span { color: var(--sub); font-size: 13px; font-variant-numeric: tabular-nums; }

/* 가계부 */
.seg { display: flex; background: var(--card); border-radius: 14px; padding: 4px; gap: 4px; margin: 8px 0; }
.seg button { flex: 1; border: 0; background: none; border-radius: 11px; padding: 10px; font-weight: 800; color: var(--sub); cursor: pointer; }
.seg button.on { background: var(--card2); color: var(--text); box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.seg.type button.on[data-type="in"] { background: var(--in); color: #04220f; } .seg.type button.on[data-type="out"] { background: var(--out); color: #2a0408; }
.seg.small button { padding: 8px; }
.monthnav { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 10px 0; }
.monthnav b { font-size: 18px; min-width: 130px; text-align: center; }
.sum3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sum3 div { background: var(--card); border-radius: 16px; padding: 12px; box-shadow: var(--shadow); min-width: 0; }
.sum3 span { display: block; color: var(--sub); font-size: 12px; } .sum3 b { font-size: 16px; font-variant-numeric: tabular-nums; word-break: break-all; }
.bars { list-style: none; padding: 0; margin: 0; }
.bars li { margin: 11px 0; } .bars .h { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 5px; gap: 8px; }
.bars .h span { color: var(--sub); font-variant-numeric: tabular-nums; }
.bars .b { height: 10px; border-radius: 10px; background: var(--card2); overflow: hidden; } .bars .b i { display: block; height: 100%; border-radius: 10px; background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.bars.in .b i { background: var(--in); }
.trend { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; align-items: end; padding-top: 8px; }
.trend .col { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.trend .pair { display: flex; gap: 3px; align-items: flex-end; height: 110px; }
.trend .pair i { width: 13px; border-radius: 5px 5px 2px 2px; background: var(--in); min-height: 2px; } .trend .pair i.o { background: var(--out); }
.trend span { font-size: 11.5px; color: var(--sub); } .trend .col.cur span { color: var(--text); font-weight: 800; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--sub); margin-top: 10px; } .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* 정비 */
.maint { list-style: none; padding: 0; margin: 0; }
.maint li { background: var(--card); border-radius: 16px; padding: 13px 14px; margin: 8px 0; cursor: pointer; }
.maint .h { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.maint .h b { font-size: 15.5px; }
.maint .d { color: var(--sub); font-size: 12.5px; margin-top: 4px; line-height: 1.45; }
.maint .p { height: 6px; border-radius: 6px; background: var(--card2); margin-top: 9px; overflow: hidden; } .maint .p i { display: block; height: 100%; border-radius: 6px; background: var(--ok); }
.maint li.soon .p i { background: var(--warn); } .maint li.over .p i { background: var(--out); }
.tag { font-size: 12px; font-weight: 800; border-radius: 999px; padding: 4px 9px; white-space: nowrap; background: var(--card2); color: var(--sub); }
.tag.ok { background: rgba(47,212,124,.14); color: var(--in); } .tag.soon { background: rgba(255,197,61,.16); color: var(--warn); } .tag.over { background: rgba(255,93,108,.15); color: var(--out); }
.fuelcard { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fuelcard div span { display: block; color: var(--sub); font-size: 12px; } .fuelcard div b { font-size: 20px; font-variant-numeric: tabular-nums; }
.fuelcard p { grid-column: 1 / -1; margin: 0; }

/* 버튼 */
.btns { display: flex; gap: 8px; margin: 10px 0; flex-wrap: wrap; } .btns > button { flex: 1; }
.btns.two > button { flex: 1 1 40%; }
button.primary, button.accent, button.ghost, .btns > button, .stops button, .plain-list button { border: 0; border-radius: 14px; padding: 13px 14px; font-weight: 800; cursor: pointer; background: var(--card2); }
button.primary { background: linear-gradient(135deg, var(--accent), #ff9233); color: var(--accent-ink); font-size: 16px; }
button.accent { background: var(--accent); color: var(--accent-ink); }
button.ghost { background: var(--card); }
button.danger { color: var(--out); }
button.wide { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 15px; margin: 12px 0; }

/* 입력 */
label { display: block; font-size: 13px; color: var(--sub); margin: 10px 0; }
input, select { display: block; width: 100%; margin-top: 6px; padding: 13px 14px; border-radius: 13px; border: 1.5px solid var(--line); background: var(--bg2); color: var(--text); font-size: 16px; outline: none; }
input:focus, select:focus { border-color: var(--accent); }
label.check { display: flex; gap: 10px; align-items: flex-start; color: var(--text); font-size: 14px; line-height: 1.45; }
label.check input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--accent); }
.inrow { display: flex; gap: 8px; align-items: center; } .inrow input { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .grid2 label { margin: 6px 0; min-width: 0; }
.mic-sm { flex: none; width: 50px; height: 50px; margin-top: 6px; border: 0; border-radius: 14px; background: rgba(255,122,26,.16); color: var(--accent); display: grid; place-items: center; cursor: pointer; }
.mic-sm svg { width: 26px; height: 26px; }
.mic-sm.big { width: 64px; height: 64px; border-radius: 50%; background: var(--accent); color: #fff; box-shadow: 0 8px 20px rgba(255,122,26,.4); margin: 0; }
.mic-sm.big svg { width: 32px; height: 32px; }
.mic-sm.rec { animation: blink 1s infinite; background: var(--out); color: #fff; }
@keyframes blink { 50% { opacity: .55; } }
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 6px 0; }
.chips button { border: 1.5px solid var(--line); background: var(--card); border-radius: 999px; padding: 9px 13px; font-size: 14px; font-weight: 700; cursor: pointer; }
.chips button.on { border-color: var(--accent); background: rgba(255,122,26,.16); color: var(--accent2); }
.fixed-add { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .fixed-add input, .fixed-add select { margin: 0; }
.fixed-add #fxName { grid-column: 1 / -1; } .fixed-add button { grid-column: 1 / -1; border: 0; border-radius: 13px; padding: 12px; font-weight: 800; }
.plain-list { list-style: none; padding: 0; margin: 0; }
.plain-list li { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--card); border-radius: 14px; margin: 6px 0; font-size: 14px; }
.plain-list li .m { flex: 1; min-width: 0; } .plain-list li .m span { display: block; color: var(--sub); font-size: 12.5px; }
.plain-list button { padding: 8px 11px; }

/* 길찾기 */
.stops { list-style: none; padding: 0; margin: 10px 0; }
.stops li { display: flex; align-items: center; gap: 8px; padding: 11px 12px; background: var(--card); border-radius: 14px; margin: 6px 0; }
.stops li.pick { border-left: 4px solid var(--accent); } .stops li.cur { border-left: 4px solid var(--in); }
.stops .n { width: 28px; height: 28px; border-radius: 50%; background: var(--card2); display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: none; }
.stops .m { flex: 1; min-width: 0; } .stops .m b { display: block; font-size: 15px; } .stops .m span { display: block; color: var(--sub); font-size: 12px; }
.stops button { padding: 8px 10px; border-radius: 10px; }

/* 하단 탭 */
.bottom { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: 1fr 1fr 96px 1fr 1fr; align-items: end;
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom)); background: var(--card); border-top: 1px solid var(--line); }
.bottom button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11.5px; color: var(--mute); padding: 6px 0; cursor: pointer; font-weight: 700; }
.bottom button.on { color: var(--accent2); }
.bottom .fab { width: 78px; height: 78px; margin: -38px auto 0; border-radius: 50%; color: #fff; justify-content: center;
  background: radial-gradient(circle at 35% 30%, #ffa04d, var(--accent) 60%, #e8560a); box-shadow: 0 10px 26px rgba(255,122,26,.5), 0 0 0 6px var(--bg); }
.bottom .fab svg { width: 40px; height: 40px; }
.bottom .fab:active { transform: scale(.94); }

/* 시트 */
.sheet { position: fixed; inset: 0; z-index: 50; }
.sheet-bg { position: absolute; inset: 0; background: rgba(0,0,0,.55); animation: fadeIn .15s; }
.sheet-body { position: absolute; left: 0; right: 0; bottom: 0; max-height: 92vh; overflow: auto; background: var(--bg); border-radius: 26px 26px 0 0;
  padding: 8px 18px calc(18px + env(safe-area-inset-bottom)); max-width: 560px; margin: 0 auto; animation: up .2s ease; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } }
.grab { width: 44px; height: 5px; border-radius: 5px; background: var(--line); margin: 4px auto 10px; }
.amt { display: flex; align-items: center; gap: 10px; margin: 14px 0 6px; padding: 8px 8px 8px 16px; background: var(--card); border-radius: 22px; }
.amt input { border: 0; background: none; font-size: 34px; font-weight: 800; padding: 6px 0; margin: 0; text-align: right; letter-spacing: -1px; font-variant-numeric: tabular-nums; min-width: 0; }
.amt span { font-size: 20px; font-weight: 800; color: var(--sub); }
.sheet-btns { position: sticky; bottom: calc(-18px - env(safe-area-inset-bottom)); background: var(--bg); padding: 8px 0 4px; margin-bottom: 0; }

/* 음성 화면 */
.voice { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: calc(68px + env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom));
  background: radial-gradient(80% 60% at 50% 40%, rgba(255,122,26,.22), transparent 70%), #08090c; color: #f3f5f9; text-align: center; animation: fadeIn .15s; overflow: auto; }
.voice > * { flex-shrink: 0; }
.voice::before, .voice::after { content: ''; flex: 1 1 0; }
.voice { justify-content: flex-start; }
.v-text.small { font-size: 15px; font-weight: 600; color: #c8cfdc; }
.v-close { position: absolute; top: calc(14px + env(safe-area-inset-top)); right: 16px; background: rgba(255,255,255,.1); color: #fff; }
.v-state { font-size: 20px; font-weight: 800; }
.v-orb { position: relative; width: 190px; height: 190px; border-radius: 50%; border: 0; display: grid; place-items: center; color: #fff; cursor: pointer; flex: none;
  background: radial-gradient(circle at 35% 30%, #ffa04d, var(--accent) 55%, #e8560a); box-shadow: 0 20px 60px rgba(255,122,26,.5); transition: width .2s, height .2s; }
.v-orb svg { width: 86px; height: 86px; position: relative; z-index: 1; }
.v-orb .ring { border-color: rgba(255,160,80,.6); }
.voice:not(.listening) .v-orb .ring { animation: none; opacity: 0; }
.voice.listening .v-orb { animation: breathe 1.4s ease-in-out infinite; }
.voice.done .v-orb { width: 96px; height: 96px; } .voice.done .v-orb svg { width: 44px; height: 44px; }
@keyframes breathe { 50% { transform: scale(1.06); } }
.v-text { font-size: 22px; font-weight: 800; min-height: 1.4em; max-width: 520px; line-height: 1.4; word-break: keep-all; }
.v-card { width: 100%; max-width: 420px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); border-radius: 22px; padding: 16px; text-align: left; }
.v-card .k { font-size: 13px; color: #aab2c4; } .v-card .big { font-size: 34px; font-weight: 800; letter-spacing: -1px; margin: 2px 0 8px; }
.v-card .big.in { color: #3ee08a; } .v-card .big.out { color: #ff7684; }
.v-card dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 15px; } .v-card dt { color: #aab2c4; } .v-card dd { margin: 0; }
.v-type { width: 100%; max-width: 420px; } .v-type p { color: #c8cfdc; margin: 0 0 4px; }
.v-type input { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.18); color: #fff; }
.v-type button { border: 0; border-radius: 13px; padding: 13px 16px; font-weight: 800; margin-top: 6px; }
.v-btns { display: flex; gap: 10px; width: 100%; max-width: 420px; flex-wrap: wrap; }
.v-btns button { flex: 1 1 30%; border: 0; border-radius: 16px; padding: 16px 10px; font-weight: 800; font-size: 16px; cursor: pointer; background: rgba(255,255,255,.12); color: #fff; }
.v-btns button.ok { background: var(--accent); color: var(--accent-ink); flex-basis: 100%; font-size: 18px; }
.v-hint { color: #8d96a8; font-size: 13px; line-height: 1.6; max-width: 420px; margin: 0; }

.toast { position: fixed; left: 50%; bottom: calc(112px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 70; background: #222736; color: #fff; padding: 12px 18px; border-radius: 14px; font-size: 14.5px; box-shadow: var(--shadow); max-width: calc(100% - 32px); width: max-content; }
.install { display: flex; margin: 4px 0 8px; border: 1px solid var(--line); align-items: center; gap: 10px; background: var(--card2); border-radius: 16px; padding: 10px 10px 10px 14px; font-size: 14px; }
.install span { flex: 1; } .install button.accent { border: 0; border-radius: 12px; padding: 10px 14px; font-weight: 800; } .install .icon-btn { width: 36px; height: 36px; }

/* 사용법 문서 */
body.doc { padding-bottom: 40px; } body.doc main { line-height: 1.7; } body.doc h2 { font-size: 19px; margin-top: 28px; } body.doc li { margin: 6px 0; }
