/* PA — 2026 look: soft glow background, large titles, bento cards, floating tab bar. */
:root {
  --bg: #f3f4f8; --card: #ffffff; --card-2: #f7f8fb; --ink: #0b0d12; --muted: #697180; --faint: #9aa1ad; --line: #e9ebf0;
  --accent: #4f46e5; --accent-soft: #eef0ff;
  --money: #059669; --money-soft: #e7f7f0; --orders: #7c3aed; --orders-soft: #f3edff;
  --bills: #2563eb; --bills-soft: #e9f0ff; --debts: #d97706; --debts-soft: #fff4e2;
  --in: #059669; --warn: #d97706; --warn-soft: #fff4e2; --bad: #e11d48; --bad-soft: #ffe9ee;
  --track: #eef0f4; --fill: #4f46e5;
  --shadow: 0 1px 1px rgba(16,24,40,.03), 0 4px 16px rgba(16,24,40,.06);
  --glow-a: rgba(99,102,241,.22); --glow-b: rgba(16,185,129,.16);
  --r: 22px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0c12; --card: #141821; --card-2: #10131a; --ink: #f1f3f7; --muted: #8e97a6; --faint: #5d6574; --line: #222835;
    --accent: #818cf8; --accent-soft: #1e2140;
    --money: #34d399; --money-soft: #10261f; --orders: #a78bfa; --orders-soft: #1f1934;
    --bills: #60a5fa; --bills-soft: #13213a; --debts: #fbbf24; --debts-soft: #2a2110;
    --in: #34d399; --warn: #fbbf24; --warn-soft: #2a2110; --bad: #fb7185; --bad-soft: #2d1219;
    --track: #222835; --fill: #818cf8; --shadow: 0 0 0 1px rgba(255,255,255,.04);
    --glow-a: rgba(99,102,241,.25); --glow-b: rgba(16,185,129,.12);
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif; -webkit-text-size-adjust: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--accent); }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.glow { position: fixed; inset: -20vh -20vw auto; height: 70vh; z-index: -1; pointer-events: none;
  background: radial-gradient(40% 50% at 20% 30%, var(--glow-a), transparent 70%), radial-gradient(35% 45% at 85% 10%, var(--glow-b), transparent 70%); filter: blur(10px); }

/* top bar */
.top { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center;
  padding: calc(env(safe-area-inset-top) + 8px) 18px 8px; max-width: 680px; margin: 0 auto;
  background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px); }
.logo { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; font-weight: 800; font-size: 13px; letter-spacing: -.02em;
  background: linear-gradient(135deg, #111827, #374151); color: #fff; }
.icon { border: 0; background: var(--card); box-shadow: var(--shadow); border-radius: 50%; width: 38px; height: 38px; display: grid; place-items: center; }
.icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon.busy svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

main { padding: 2px 18px calc(env(safe-area-inset-bottom) + 110px); max-width: 680px; margin: 0 auto; }
.enter { animation: rise .25s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

/* page title */
.title { margin: 6px 2px 16px; }
.title h1 { font-size: 32px; line-height: 1.1; margin: 0; font-weight: 800; letter-spacing: -.03em; }
.title p { margin: 6px 0 0; color: var(--muted); font-size: 15px; }
.title .date { font-size: 12.5px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 4px; }

/* floating tab bar */
.tabs { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom) + 12px); z-index: 6;
  display: flex; gap: 2px; padding: 6px; border-radius: 26px; width: min(460px, calc(100% - 24px));
  background: color-mix(in srgb, var(--card) 82%, transparent); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 8px 30px rgba(16,24,40,.14), 0 0 0 1px var(--line); }
.tabs button { flex: 1; border: 0; background: none; padding: 7px 0 6px; border-radius: 20px; font-size: 10.5px; font-weight: 650; color: var(--faint);
  display: flex; flex-direction: column; align-items: center; gap: 2px; transition: background .2s, color .2s; }
.tabs svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tabs button.on { color: var(--accent); background: var(--accent-soft); }

/* bento (Today) */
.bento { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; border: 0; text-align: left; display: flex; flex-direction: column; gap: 4px; min-height: 168px; position: relative; overflow: hidden; }
.tile.wide { grid-column: span 2; min-height: 0; }
.tile:active { transform: scale(.985); }
.tile .ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 8px; }
.tile .ic svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tile h3 { margin: 0; font-size: 16px; font-weight: 750; letter-spacing: -.01em; }
.tile .what { font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.tile .big { font-size: 26px; font-weight: 800; letter-spacing: -.03em; margin-top: auto; padding-top: 8px; }
.tile .foot { font-size: 12.5px; color: var(--muted); }
.tile .go { position: absolute; top: 14px; right: 16px; color: var(--faint); font-size: 20px; }
.tile .rows { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.tile .rows div { display: flex; justify-content: space-between; font-size: 13.5px; }
.tile .rows span:first-child { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-right: 8px; }
.c-money .ic { background: var(--money-soft); color: var(--money); }
.c-orders .ic { background: var(--orders-soft); color: var(--orders); }
.c-bills .ic { background: var(--bills-soft); color: var(--bills); }
.c-debts .ic { background: var(--debts-soft); color: var(--debts); }
.skel { background: linear-gradient(90deg, var(--track), var(--card-2), var(--track)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; height: 26px; width: 70%; margin-top: auto; }
@keyframes sk { to { background-position: -200% 0; } }

/* needs-you list */
.todo { display: flex; flex-direction: column; gap: 8px; margin-bottom: 22px; }
.todo button { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; text-align: left; background: var(--card); box-shadow: var(--shadow); border-radius: 18px; padding: 13px 14px; }
.todo .dot { width: 32px; height: 32px; border-radius: 11px; display: grid; place-items: center; flex: none; font-size: 15px; font-weight: 800; }
.todo .warn-c { background: var(--warn-soft); color: var(--warn); } .todo .bad-c { background: var(--bad-soft); color: var(--bad); }
.todo .tx { flex: 1; min-width: 0; } .todo .tx b { display: block; font-weight: 650; } .todo .tx span { font-size: 13px; color: var(--muted); }
.todo .chev { color: var(--faint); font-size: 20px; }
.allgood { display: flex; gap: 12px; align-items: center; background: var(--money-soft); color: var(--money); border-radius: 18px; padding: 14px 16px; font-weight: 650; margin-bottom: 22px; }
.label { font-size: 12.5px; font-weight: 750; color: var(--faint); text-transform: uppercase; letter-spacing: .07em; margin: 4px 4px 10px; }

/* hero */
.hero { background: var(--card); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); }
.hero .k { font-size: 13px; color: var(--muted); font-weight: 550; }
.hero .big { font-size: 40px; font-weight: 800; letter-spacing: -.035em; line-height: 1.1; margin: 4px 0 2px; }
.hero .sub { font-size: 13px; color: var(--muted); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); margin: 16px -20px -20px; border-top: 1px solid var(--line); border-radius: 0 0 var(--r) var(--r); overflow: hidden; }
.split > div { background: var(--card); padding: 12px 20px 15px; }
.split .k { font-size: 12px; }
.split .v { font-size: 18px; font-weight: 750; margin-top: 1px; }

/* controls */
.seg { display: flex; background: var(--track); border-radius: 13px; padding: 3px; margin: 0 0 12px; }
.seg button { flex: 1; border: 0; background: none; padding: 8px 2px; white-space: nowrap; border-radius: 10px; font-size: 13px; font-weight: 650; color: var(--muted); }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.seg.big button { font-size: 14px; padding: 9px 0; }
.bar2 { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.bar2 .seg { flex: 1; margin: 0; }
.pill { border: 0; background: var(--card); box-shadow: var(--shadow); border-radius: 999px; padding: 9px 14px; font-size: 13px; font-weight: 650; white-space: nowrap; }
.chips { display: flex; gap: 8px; margin: 12px 0 0; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chips button { flex: none; border: 0; background: var(--card); box-shadow: var(--shadow); padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 650; color: var(--muted); }
.chips button.on { background: var(--ink); color: var(--bg); }
.chips .cnt { opacity: .6; font-weight: 500; margin-left: 2px; }
.search { position: relative; }
.search input { width: 100%; border: 0; background: var(--card); box-shadow: var(--shadow); color: var(--ink); border-radius: 14px;
  padding: 12px 14px 12px 40px; font: inherit; outline: none; -webkit-appearance: none; }
.search::before { content: ""; position: absolute; left: 14px; top: 50%; width: 12px; height: 12px; margin-top: -9px; border: 2px solid var(--faint); border-radius: 50%; }
.search::after { content: ""; position: absolute; left: 25px; top: 50%; width: 6px; height: 2px; margin-top: 5px; background: var(--faint); transform: rotate(45deg); border-radius: 1px; }

/* attention strip */
.alert { display: flex; align-items: center; gap: 12px; background: var(--warn-soft); border-radius: 16px; padding: 13px 14px; margin-top: 12px; border: 0; width: 100%; text-align: left; }
.alert .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); flex: none; }
.alert .go { margin-left: auto; color: var(--warn); font-weight: 650; font-size: 13px; white-space: nowrap; }

/* lists */
.sec { display: flex; align-items: baseline; justify-content: space-between; margin: 26px 4px 10px; }
.sec h2 { font-size: 18px; margin: 0; font-weight: 750; letter-spacing: -.015em; }
.sec button { border: 0; background: none; color: var(--accent); font-size: 14px; font-weight: 650; padding: 0; }
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.li { display: flex; gap: 12px; align-items: center; padding: 13px 16px; position: relative; }
.li + .li::before { content: ""; position: absolute; top: 0; left: 66px; right: 0; border-top: 1px solid var(--line); }
.li.tap { cursor: pointer; } .li.tap:active { background: var(--card-2); }
.li .main { flex: 1; min-width: 0; }
.li .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.li .m { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.li .amt { text-align: right; white-space: nowrap; font-weight: 650; }
.li .amt small { display: block; font-size: 12px; color: var(--faint); font-weight: 500; }
.av { width: 38px; height: 38px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 750; font-size: 14px; flex: none; }
.av.in { background: var(--money-soft); color: var(--money); }
.av.o { background: var(--orders-soft); color: var(--orders); } .av.b { background: var(--bills-soft); color: var(--bills); } .av.d { background: var(--debts-soft); color: var(--debts); }
.in { color: var(--in); } .warn { color: var(--warn); } .bad { color: var(--bad); } .muted { color: var(--muted); }
.track { height: 6px; background: var(--track); border-radius: 3px; margin-top: 8px; overflow: hidden; }
.track i { display: block; height: 100%; background: linear-gradient(90deg, var(--fill), color-mix(in srgb, var(--fill) 55%, #22d3ee)); border-radius: 3px; }
.status { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; vertical-align: 1px; background: var(--in); }
.status.warn { background: var(--warn); } .status.bad { background: var(--bad); }
.day { font-size: 13px; color: var(--muted); font-weight: 650; margin: 20px 6px 8px; }
.empty { color: var(--muted); padding: 28px 16px; text-align: center; font-size: 14px; }
.note { font-size: 12.5px; color: var(--faint); margin: 12px 6px; line-height: 1.45; }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.duo > div { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; }
.duo .k { font-size: 12.5px; color: var(--muted); font-weight: 550; }
.duo .v { font-size: 24px; font-weight: 800; letter-spacing: -.025em; margin-top: 2px; }

/* delivery status */
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; margin-top: 3px; }
.b-pending { background: var(--warn-soft); color: var(--warn); }
.b-shipped { background: var(--bills-soft); color: var(--bills); }
.b-done { background: var(--money-soft); color: var(--money); }
.b-problem { background: var(--bad-soft); color: var(--bad); }
.b-unknown { background: var(--track); color: var(--muted); }
.dset { display: flex; flex-wrap: wrap; gap: 8px; }
.dset button { border: 1px solid var(--line); background: var(--card-2); border-radius: 999px; padding: 8px 14px; font-size: 14px; font-weight: 650; }
.dset button.on { border: 1.5px solid currentColor; padding: 7.5px 13.5px; }

/* sheet */
.sheet { position: fixed; inset: 0; background: rgba(5,8,15,.45); z-index: 20; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.sheet-card { background: var(--card); width: 100%; max-width: 560px; border-radius: 28px 28px 0 0; padding: 8px 20px calc(env(safe-area-inset-bottom) + 20px);
  max-height: 90vh; overflow: auto; animation: up .22s cubic-bezier(.2,.8,.2,1); }
.sheet-card .card { box-shadow: none; background: var(--card-2); }
.grab { width: 38px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 16px; }
@keyframes up { from { transform: translateY(40px); opacity: .6; } }
@keyframes fade { from { opacity: 0; } }
.sheet-card h3 { margin: 0; font-size: 20px; letter-spacing: -.015em; }
.sheet-card .amount { font-size: 32px; font-weight: 800; letter-spacing: -.03em; margin: 6px 0 2px; }
.sheet-card label { display: block; font-size: 13px; color: var(--muted); font-weight: 650; margin: 18px 2px 7px; }
.sheet-card select { width: 100%; padding: 13px; border-radius: 14px; border: 1px solid var(--line); background: var(--card-2); color: var(--ink); font: inherit; -webkit-appearance: none; }
.sheet-card .row { display: flex; gap: 10px; margin-top: 20px; }
.sheet-card .row .btn { flex: 1; }
.opt { display: flex; justify-content: space-between; align-items: center; width: 100%; border: 0; background: none; padding: 15px 4px; font-size: 16px; text-align: left; }
.opt + .opt { border-top: 1px solid var(--line); }
.opt.on::after { content: "✓"; color: var(--accent); font-weight: 800; }

.btn { display: inline-block; border: 0; border-radius: 14px; padding: 14px 18px; background: var(--track); text-decoration: none; color: var(--ink); font-weight: 650; text-align: center; }
.btn.primary { background: var(--accent); color: #fff; box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn.wide { display: block; width: 100%; }
.btn:disabled { opacity: .5; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom) + 96px); background: var(--ink); color: var(--bg);
  padding: 12px 18px; border-radius: 14px; z-index: 30; font-size: 14px; font-weight: 550; white-space: pre-line; max-width: calc(100% - 32px); box-shadow: 0 8px 30px rgba(0,0,0,.2); }

.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 18px; }
.login-card { text-align: center; max-width: 360px; width: 100%; }
.login-card img { border-radius: 20px; box-shadow: 0 10px 30px rgba(16,24,40,.18); }
.login-card h1 { margin: 18px 0 6px; font-size: 34px; letter-spacing: -.03em; }
.login-card p { color: var(--muted); margin: 0 0 30px; }
.err { color: var(--bad) !important; margin-top: 14px !important; }
.loading { opacity: .5; transition: opacity .2s; }

/* debts: when it was updated / checked */
.li .stamp { font-size: 12px; color: var(--faint); white-space: normal; }
.stampbar { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin: 12px 4px 0; font-size: 13px; color: var(--muted); }
.stampbar b { color: var(--ink); font-weight: 650; }
.stampbar .warn, .stampbar .in { font-weight: 650; margin-left: auto; }

/* count on the Regular tab */
.tabs button { position: relative; }
.tbadge { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 750; line-height: 18px; text-align: center; }
.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); margin: 16px -20px -20px; border-top: 1px solid var(--line); border-radius: 0 0 var(--r) var(--r); overflow: hidden; }
.trio > button { background: var(--card); border: 0; padding: 12px 10px 14px; text-align: left; }
.trio > button.on { background: var(--accent-soft); }
.trio .n { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.trio .k { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.trio .s { font-size: 12px; color: var(--faint); }

.li .note-line { color: var(--ink); opacity: .8; white-space: normal; }
.sheet-card input[type=date] { width: 100%; padding: 12px 13px; border-radius: 14px; border: 1px solid var(--line); background: var(--card-2); color: var(--ink); font: inherit; -webkit-appearance: none; min-height: 46px; }
.sheet-card textarea { width: 100%; padding: 12px 13px; border-radius: 14px; border: 1px solid var(--line); background: var(--card-2); color: var(--ink); font: inherit; resize: vertical; }

/* Mykola's note on a regular payment: green, on the right under the amount */
.note-pill { display: inline-block; margin-top: 4px; max-width: 150px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 650;
  background: var(--money-soft); color: var(--money); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: top; }

.sheet-card input.txt { width: 100%; padding: 12px 13px; border-radius: 14px; border: 1px solid var(--line); background: var(--card-2); color: var(--ink); font: inherit; }

/* ───────── computer layout (900px and wider): sidebar, wide two-column pages, centred dialogs */
.side-brand { display: none; }
.cols { display: block; }
@media (min-width: 900px) {
  body { padding-left: 240px; }
  .glow { left: 240px; }
  .top { max-width: 1120px; padding-left: 32px; padding-right: 32px; }
  .top .brand { visibility: hidden; }
  main { max-width: 1120px; padding: 8px 32px 48px; }
  .title h1 { font-size: 38px; }

  .tabs { left: 0; top: 0; bottom: 0; transform: none; width: 240px; border-radius: 0; flex-direction: column; justify-content: flex-start;
    gap: 4px; padding: 22px 14px; box-shadow: none; border-right: 1px solid var(--line); background: var(--card); }
  .tabs button { flex: none; max-width: none; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 11px 14px; border-radius: 12px; font-size: 14.5px; }
  .tabs button:hover { background: var(--card-2); color: var(--ink); }
  .tabs button.on { background: var(--accent-soft); color: var(--accent); }
  .tbadge { position: static; margin-left: auto; order: 3; }
  .side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; font-weight: 700; font-size: 14px; color: var(--muted); }

  .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
  .todo { margin-bottom: 0; }
  .hero .big { font-size: 46px; }
  .li.tap:hover { background: var(--card-2); }
  .chips button:hover, .seg button:hover { color: var(--ink); }

  .sheet { align-items: center; }
  .sheet-card { max-width: 600px; border-radius: 24px; max-height: 86vh; padding: 10px 26px 26px; animation: pop .18s ease-out; }
  .sheet-card .grab { visibility: hidden; height: 0; margin-bottom: 14px; }
  @keyframes pop { from { transform: scale(.97); opacity: .6; } }
  .toast { bottom: 28px; left: calc(50% + 120px); }
}
@media (min-width: 1300px) { main, .top { max-width: 1240px; } }

.sortbar { margin: 14px 2px 0; padding: 12px 14px; border-radius: 14px; background: var(--warn-soft); color: var(--ink); font-size: 14px; }
.sortbar b { color: var(--warn); font-size: 17px; }
.amt .note-pill { display: block; width: fit-content; margin-left: auto; }
