:root {
  --bg: #14161a; --card: #1d2026; --card2: #252931; --line: #30353f;
  --text: #eef0f3; --dim: #9aa2ae; --gold: #f2b84b; --red: #ff6b5e; --green: #5fd38d; --blue: #6fb3ff;
  --r: 14px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-text-size-adjust: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: rgba(20,22,26,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 750; letter-spacing: .2px; }
.brand img { border-radius: 7px; }
.link { background: none; border: 0; color: var(--gold); font-weight: 600; padding: 6px 4px; }

main { max-width: 640px; margin: 0 auto; padding: 16px 16px 110px; }
h1 { font-size: 28px; line-height: 1.15; margin: 8px 0 6px; letter-spacing: -.3px; }
h2 { font-size: 19px; margin: 22px 0 8px; }
h3 { font-size: 15px; margin: 0; }
p { margin: 6px 0; }
.dim { color: var(--dim); }
.small { font-size: 13px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin: 10px 0; }
.field { display: block; margin: 12px 0; }
.field > span { display: block; font-size: 13px; color: var(--dim); margin-bottom: 5px; }
input, select, textarea { width: 100%; background: var(--card2); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.money-in { position: relative; }
.money-in::before { content: "$"; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--dim); }
.money-in input { padding-left: 24px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 12px; padding: 13px 18px; font-weight: 700; background: var(--gold); color: #1a1406; }
.btn.wide { width: 100%; }
.btn.ghost { background: var(--card2); color: var(--text); border: 1px solid var(--line); }
.btn.danger { background: transparent; color: var(--red); border: 1px solid #5a2b28; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--card2); padding: 4px; border-radius: 12px; }
.seg button { border: 0; background: transparent; padding: 10px; border-radius: 9px; font-weight: 600; color: var(--dim); }
.seg button.on { background: var(--gold); color: #1a1406; }

/* lists */
.list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.list-head .count { color: var(--dim); font-size: 13px; }
.tag-urgent { color: var(--red); } .tag-problem { color: var(--gold); } .tag-want { color: var(--blue); }
.add { display: flex; gap: 8px; margin-top: 10px; }
.add input { flex: 1; }
.add button { flex: none; width: 48px; padding: 0; font-size: 22px; }
.item { display: flex; align-items: center; gap: 10px; padding: 10px 2px; border-top: 1px solid var(--line); }
.item:first-of-type { border-top: 0; }
.item .t { flex: 1; min-width: 0; }
.item .t b { font-weight: 600; display: block; overflow-wrap: anywhere; }
.item .price { color: var(--dim); font-size: 13px; white-space: nowrap; }
.item button.edit { background: none; border: 0; color: var(--dim); padding: 6px; }

/* plan */
.warn { background: #2b2414; border: 1px solid #5b4718; color: #f5dca4; border-radius: var(--r); padding: 12px 14px; font-size: 14px; }
.alert { background: #2d1816; border: 1px solid #5a2b28; color: #ffc7c0; border-radius: var(--r); padding: 12px 14px; font-size: 14px; margin: 10px 0; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.stat b { display: block; font-size: 18px; }
.stat span { font-size: 12px; color: var(--dim); }
.job { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: start; }
.job .n { width: 34px; height: 34px; border-radius: 10px; background: var(--card2); display: grid; place-items: center; font-weight: 800; color: var(--gold); }
.job.u .n { color: var(--red); }
.job .title { font-weight: 700; overflow-wrap: anywhere; }
.job .meta { font-size: 13px; color: var(--dim); margin-top: 2px; }
.job .meta .late { color: var(--red); font-weight: 600; }
.job .why { font-size: 14px; color: #c9ced6; margin-top: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.chip { font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--card2); border: 1px solid var(--line); color: var(--dim); }
.chip.red { color: var(--red); border-color: #5a2b28; } .chip.gold { color: var(--gold); border-color: #5b4718; } .chip.blue { color: var(--blue); border-color: #23415f; }
.moves { display: flex; flex-direction: column; gap: 4px; }
.moves button { width: 36px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--card2); color: var(--text); padding: 0; font-size: 14px; }
.moves button.check { color: var(--green); }
.moves button:disabled { opacity: .3; }
.cal-month { margin-top: 18px; }
.cal-day { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.cal-day .d { flex: none; width: 54px; text-align: center; }
.cal-day .d b { display: block; font-size: 22px; line-height: 1; }
.cal-day .d span { font-size: 12px; color: var(--dim); }
.cal-day .jobs { flex: 1; min-width: 0; }
.cal-day .pay { font-size: 12px; color: var(--green); font-weight: 600; }
.cal-job { padding: 3px 0; display: flex; justify-content: space-between; gap: 10px; }
.cal-job span:last-child { color: var(--dim); white-space: nowrap; }
.empty { text-align: center; padding: 34px 12px; color: var(--dim); }
.empty .btn { margin-top: 14px; }
.vs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.vs ol { margin: 6px 0 0; padding-left: 20px; font-size: 14px; }
.ok { color: var(--green); }

/* tabs */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: grid; grid-template-columns: repeat(5, 1fr); background: rgba(20,22,26,.96); backdrop-filter: blur(8px); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
.tabs button { background: none; border: 0; color: var(--dim); padding: 10px 2px; font-size: 13px; font-weight: 650; border-radius: 10px; }
.tabs button.on { color: var(--gold); background: var(--card); }
.tabs button .dot { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 3px; border-radius: 99px; background: var(--gold); color: #1a1406; font-size: 11px; }

/* sheet */
.sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 9; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; max-width: 640px; margin: 0 auto; background: var(--card); border: 1px solid var(--line); border-bottom: 0; border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); max-height: 90vh; overflow: auto; }
.sheet h2 { margin-top: 0; }
.sheet .btns { display: flex; gap: 8px; margin-top: 14px; }
.sheet .btns .btn { flex: 1; }
footer.fine { margin-top: 26px; font-size: 12px; color: var(--dim); text-align: center; }

.toast { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 12; background: var(--text); color: var(--bg); font-weight: 650; font-size: 14px; padding: 10px 16px; border-radius: 99px; box-shadow: 0 6px 24px rgba(0,0,0,.4); white-space: nowrap; }
