/* MANS ĢIMENES PLĀNOTĀJS – violeti elegants dizains ar lielām pogām */
@font-face { font-family: Poppins; font-weight: 400; font-display: swap; src: url(/fonts/poppins-400.woff) format('woff'); }
@font-face { font-family: Poppins; font-weight: 500 600; font-display: swap; src: url(/fonts/poppins-500.woff) format('woff'); }
@font-face { font-family: Poppins; font-weight: 700 800; font-display: swap; src: url(/fonts/poppins-700.woff) format('woff'); }
@font-face { font-family: 'Lora Italic'; font-style: italic; font-weight: 400 700; font-display: swap; src: url(/fonts/lora-italic.woff) format('woff'); }

:root {
  /* BLACK & PURPLE ELEGANCE */
  color-scheme: dark;
  --bg: #211d26;
  --card: #2d2833;
  --field: #37313f;
  --ink: #f2eef7;
  --silver: #e6e0ee;
  --muted: #aca4ba;
  --line: #433b4d;
  --primary: #8b5cd6;
  --primary-dark: #6c40bb;
  --primary-ink: #cfb5ff;
  --primary-soft: #3b3049;
  --grad: linear-gradient(135deg, #b083ee 0%, #8352d1 55%, #6e3fc0 100%);
  --topbar: var(--bg);
  --accent: #d9b56b;
  --warn: #e6a64a;
  --warn-soft: #3a2b16;
  --danger: #f0717a;
  --danger-soft: #3e1b22;
  --good: #5cc48f;
  --info: #8fb0ee;
  --radius: 16px;
  --shadow: 0 2px 14px rgba(0, 0, 0, .45);
  --nav-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  font-size: 17px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font-family: Poppins, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.45; -webkit-tap-highlight-color: transparent;
  padding-bottom: calc(var(--nav-h) + var(--safe-b) + 16px);
}
body.modal-open { overflow: hidden; }
a { color: var(--primary-ink); text-decoration: none; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
small { display: block; color: var(--muted); font-size: .8rem; font-weight: normal; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .8rem; }
.center { text-align: center; display: block; margin-left: auto; margin-right: auto; }
.txt-danger { color: var(--danger) !important; }
.txt-warn { color: var(--warn); }

/* ---------- Augšējā josla ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; padding-top: calc(10px + env(safe-area-inset-top, 0px));
  background: var(--topbar); color: var(--silver); box-shadow: 0 2px 12px rgba(0,0,0,.5); border-bottom: 1px solid #4a2d7a;
}
.topbar h1 { font-size: 1.15rem; font-weight: 650; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .icon-btn { color: var(--silver); font-size: 1.8rem; background: transparent; }
.offline-badge { display: none; font-size: .8rem; background: rgba(255,255,255,.2); padding: 4px 10px; border-radius: 99px; }
body.offline .offline-badge { display: inline-block; }

main { max-width: 860px; margin: 0 auto; }
.page { padding: 16px; display: flex; flex-direction: column; gap: 14px; }

/* ---------- Apakšējā izvēlne ---------- */
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: center;
  background: var(--card); border-top: 1px solid var(--line); padding-bottom: var(--safe-b);
  box-shadow: 0 -2px 10px rgba(0,0,0,.05);
}
.bottomnav a {
  flex: 1; max-width: 160px; min-height: var(--nav-h); display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: .75rem; color: var(--muted); gap: 2px; font-weight: 600;
}
.bottomnav a span { font-size: 1.45rem; line-height: 1; }
.bottomnav a.active { color: var(--primary-ink); }
.bottomnav a.active span { transform: scale(1.1); }

/* ---------- Pogas ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 10px 18px;
  font: inherit; font-weight: 650; border-radius: 14px; border: 2px solid transparent; cursor: pointer; text-align: center;
  transition: transform .05s, background .15s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: wait; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--primary-soft); color: var(--primary-ink); }
.btn-ghost { background: transparent; color: var(--primary-ink); border-color: var(--line); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-link-danger { background: none; border: 0; color: var(--danger); font: inherit; padding: 14px; cursor: pointer; width: 100%; }
.btn-big { min-height: 58px; font-size: 1.08rem; }
.btn-block { width: 100%; }
.btn-small { min-height: 40px; padding: 6px 12px; font-size: .9rem; }
.btn.loading { position: relative; color: transparent !important; }
.btn.loading::after {
  content: ""; position: absolute; width: 20px; height: 20px; border: 3px solid rgba(255,255,255,.6); border-top-color: var(--primary-dark);
  border-radius: 50%; animation: spin .8s linear infinite;
}
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.btn-row .btn { flex: 1; min-width: 120px; }
.icon-btn {
  min-width: 44px; min-height: 44px; border: 0; border-radius: 12px; background: var(--bg); font-size: 1.1rem; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; color: var(--ink);
}
.icon-btn.big { min-width: 54px; min-height: 54px; font-size: 1.2rem; background: var(--card); box-shadow: var(--shadow); }
.icon-btn:disabled { opacity: .3; }

/* ---------- Kartītes, sākums ---------- */
.card { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card.stack { display: flex; flex-direction: column; gap: 10px; }
.hero { text-align: center; padding: 10px 0 2px; }
.hero h1 { font-size: 1.45rem; letter-spacing: .06em; color: var(--silver); text-shadow: 0 0 18px rgba(123, 79, 208, .55); }
.hero p { margin: 4px 0 0; color: var(--muted); }
.section-title { font-size: 1.05rem; margin-top: 8px; color: var(--primary-ink); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.stats-3 { grid-template-columns: repeat(3, 1fr); }

.stat {
  background: var(--card); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 2px; color: var(--ink); border-left: 5px solid var(--primary-soft); min-height: 112px;
}
.stat-icon { font-size: 1.3rem; }
.stat-num { font-size: 1.7rem; font-weight: 750; color: var(--silver); }
.stat-num.small { font-size: 1.2rem; }
.stat-label { font-weight: 650; font-size: .92rem; }
.stat-sub { font-size: .8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.stat.warn { border-left-color: var(--warn); }
.stat.danger { border-left-color: var(--danger); }
.stat.danger .stat-num { color: var(--danger); }
.stat.good { border-left-color: var(--good); }
.stats-3 .stat { min-height: 0; text-align: center; border-left: 0; border-top: 4px solid var(--primary-soft); }
.stats-3 .stat.good { border-top-color: var(--good); }
.stats-3 .stat.danger { border-top-color: var(--danger); }

.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 700px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
.tile {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); min-height: 100px; padding: 14px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
  color: var(--ink); font-weight: 650; border: 2px solid transparent;
}
.tile:active, .tile:hover { border-color: var(--primary-soft); }
.tile-icon { font-size: 2rem; }
.tile-icon.sm { font-size: 1.4rem; }

.alert { display: block; padding: 14px 16px; border-radius: 14px; font-weight: 550; cursor: pointer; }
.alert-danger { background: var(--danger-soft); color: var(--danger); }
.alert-warn { background: var(--warn-soft); color: var(--warn); }

.mini-list { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.mini-row {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px; width: 100%;
  border: 0; border-bottom: 1px solid var(--line); background: none; font: inherit; color: var(--ink); text-align: left; cursor: pointer;
}
.mini-row:last-child { border-bottom: 0; }
.mini-row .right { text-align: right; font-weight: 650; white-space: nowrap; }

/* ---------- Saraksti ---------- */
.quick-add { display: flex; gap: 8px; }
.quick-add input { flex: 1; }
.quick-add .btn { min-width: 58px; font-size: 1.5rem; }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.tab {
  flex: 1; min-height: 48px; padding: 8px 12px; border-radius: 12px; border: 2px solid var(--line); background: var(--card);
  font: inherit; font-weight: 650; color: var(--muted); cursor: pointer; white-space: nowrap;
}
.tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.tab .count { display: inline-block; min-width: 24px; padding: 0 6px; border-radius: 99px; background: rgba(255,255,255,.08); font-size: .8rem; }
.tab.active .count { background: rgba(255,255,255,.25); }
.filters { display: flex; gap: 8px; }
.filters > * { flex: 1; min-width: 0; }
.filters.wrap { flex-wrap: wrap; }
.filters.wrap > * { flex: 1 1 45%; }
.mini-field { display: flex; align-items: center; gap: 6px; font-size: .9rem; color: var(--muted); }
.mini-field input { flex: 1; }
.summary-line { margin: 0; color: var(--muted); font-size: .9rem; }
.group-title { font-size: .95rem; color: var(--muted); margin: 6px 0 -4px; }
.list { display: flex; flex-direction: column; gap: 8px; }
.item {
  display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 14px; padding: 12px 14px;
  box-shadow: var(--shadow); cursor: pointer; border-left: 5px solid transparent; min-height: 64px;
}
.item.is-overdue { border-left-color: var(--danger); background: #22141b; }
.item.is-soon { border-left-color: var(--warn); }
.item.is-done .item-title { text-decoration: line-through; color: var(--muted); }
.item.is-muted { opacity: .65; }
.check {
  flex: none; width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--primary); background: transparent;
  font-size: 1.2rem; font-weight: 800; color: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.check.checked { background: var(--good); border-color: var(--good); }
.check.placeholder { border-color: var(--line); cursor: default; }
.check.loading { opacity: .5; }
.item-body { flex: 1; min-width: 0; }
.item-title { font-weight: 650; overflow-wrap: anywhere; }
.qty { color: var(--muted); font-weight: 500; }
.item-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: .82rem; color: var(--muted); margin-top: 2px; }
.item-amount { font-weight: 750; white-space: nowrap; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 99px; background: var(--bg); color: var(--muted); font-size: .75rem; font-weight: 650; }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: #1d2740; color: var(--info); }
.prio-urgent { background: var(--danger-soft); color: var(--danger); }
.prio-important { background: var(--warn-soft); color: var(--warn); }
.prio-later { background: var(--primary-soft); color: var(--primary-ink); }
.tag { color: var(--primary-ink); font-weight: 600; }
.empty { text-align: center; color: var(--muted); padding: 24px 12px; margin: 0; }

/* ---------- Formas ---------- */
input, select, textarea {
  font: inherit; width: 100%; min-height: 50px; padding: 10px 14px; border: 2px solid var(--line); border-radius: 12px;
  background: var(--field); color: var(--ink);
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(123, 79, 208, .35); }
select:disabled { background: var(--bg); }
input[type=checkbox] { width: 24px; height: 24px; min-height: 0; accent-color: var(--primary); flex: none; }
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .95rem; }
.field small { font-weight: 400; }
.row-input { display: flex; gap: 8px; }
.row-input select { flex: 1; }
.newcat { display: flex; gap: 8px; margin-top: 4px; }
.check-row { display: flex; gap: 10px; align-items: flex-start; font-size: .95rem; }
.hint { font-size: .87rem; color: var(--muted); margin: 0; }
.lead { font-size: 1.05rem; margin: 0 0 6px; }
.form-error { color: var(--danger); background: var(--danger-soft); padding: 10px 12px; border-radius: 10px; margin: 0; }
.search-input { min-height: 56px; font-size: 1.05rem; }

/* ---------- Logi ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 50; background: rgba(5, 3, 8, .7);
  display: flex; align-items: flex-end; justify-content: center; animation: fade .15s;
}
.sheet {
  background: var(--card); width: 100%; max-width: 560px; max-height: 92vh; overflow: auto;
  border-radius: 22px 22px 0 0; padding-bottom: var(--safe-b); animation: up .2s ease-out;
}
@media (min-width: 700px) { .overlay { align-items: center; } .sheet { border-radius: 22px; } }
.sheet-head { position: sticky; top: 0; background: var(--card); display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 8px; z-index: 1; }
.sheet-head h2 { font-size: 1.2rem; }
.sheet-body { padding: 4px 16px 20px; }
.option-card { border: 2px solid var(--line); border-radius: 14px; padding: 14px; margin: 10px 0; display: flex; flex-direction: column; gap: 8px; }
.option-card h3 { font-size: 1rem; }
.steps { padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }

/* ---------- Paziņojumi ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--safe-b) + 14px); transform: translate(-50%, 30px);
  z-index: 60; background: #2b2040; color: var(--ink); border: 1px solid #4a2d7a; padding: 12px 16px; border-radius: 14px; max-width: calc(100% - 24px); width: max-content;
  display: flex; align-items: center; gap: 14px; opacity: 0; pointer-events: none; transition: all .2s; box-shadow: 0 6px 20px rgba(0,0,0,.2);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast.error { background: var(--danger); }
.toast-btn { background: rgba(255,255,255,.18); color: #fff; border: 0; border-radius: 10px; padding: 8px 12px; font: inherit; font-weight: 700; cursor: pointer; }

/* ---------- Budžets ---------- */
.month-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.month-nav h2 { font-size: 1.25rem; text-align: center; flex: 1; }
.budget-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.big-num { font-size: 1.8rem; font-weight: 750; color: var(--silver); }
.progress { height: 16px; border-radius: 99px; background: var(--bg); overflow: hidden; margin: 14px 0 6px; }
.progress span { display: block; height: 100%; background: var(--good); border-radius: 99px; transition: width .3s; }
.progress.warn span { background: var(--warn); }
.progress.danger span { background: var(--danger); }

/* ---------- Kalendārs ---------- */
.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; background: var(--card); padding: 8px; border-radius: var(--radius); box-shadow: var(--shadow); }
.cal-head { text-align: center; font-size: .8rem; font-weight: 700; color: var(--muted); padding: 4px 0; }
.cal-cell {
  min-height: 56px; border: 2px solid transparent; border-radius: 10px; background: var(--bg); font: inherit; padding: 4px 2px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--ink);
}
.cal-cell.empty { background: transparent; cursor: default; }
.cal-cell.today { border-color: var(--primary); }
.cal-cell.selected { background: var(--primary); color: #fff; }
.cal-cell.has-overdue .cal-num { color: var(--danger); font-weight: 800; }
.cal-cell.selected.has-overdue .cal-num { color: #fff; }
.cal-num { font-weight: 650; }
.dots { display: flex; gap: 3px; flex-wrap: wrap; justify-content: center; align-items: center; font-size: .7rem; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.dot-bills { background: var(--warn); }
.dot-planned { background: var(--info); }
.dot-shopping { background: var(--primary-ink); }
.dot-overdue { background: var(--danger); }
.dot-done { background: #6e6680; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .8rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }

/* ---------- Pārvaldība ---------- */
.manage-list { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.manage-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.manage-row:last-child { border-bottom: 0; }
.manage-row.sub { padding-left: 32px; background: #15111c; }
.manage-name { flex: 1 1 180px; display: flex; align-items: center; gap: 10px; font-weight: 650; min-width: 0; }
.manage-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.cats-btn { flex-basis: 100%; }
.icon-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 6px; }
.icon-opt { min-height: 48px; font-size: 1.4rem; border: 2px solid var(--line); border-radius: 12px; background: var(--field); cursor: pointer; }
.icon-opt.active { border-color: var(--primary); background: var(--primary-soft); }
.file-btn { cursor: pointer; }
.install-btn { margin-top: 6px; }

/* ---------- Ieeja ---------- */
.auth { max-width: 440px; margin: 0 auto; padding: 30px 16px; text-align: center; display: flex; flex-direction: column; gap: 14px; }
.auth-logo { font-size: 3.4rem; }
.auth h1 { font-size: 1.4rem; color: var(--silver); letter-spacing: .05em; text-shadow: 0 0 18px rgba(123, 79, 208, .55); }
.auth .card { text-align: left; }
.auth-links { display: flex; flex-direction: column; gap: 8px; }

.loading-screen { padding: 80px 20px; text-align: center; color: var(--muted); }
.spinner { width: 42px; height: 42px; margin: 0 auto 12px; border: 4px solid var(--primary-soft); border-top-color: var(--primary); border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: .5; } }

@media (min-width: 1000px) {
  :root { font-size: 17.5px; }
  .page { padding: 24px; }
}

/* ---------- Tumšā tēma: papildu detaļas ---------- */
.stat { border-left-color: var(--line); }
.stats-3 .stat { border-top-color: var(--line); }
.tile { border-color: var(--line); }
.tile:active, .tile:hover { border-color: var(--primary); }
.cal-cell { background: var(--field); }
.cal-cell.empty { background: transparent; }
.btn-ghost:hover { border-color: var(--primary); }
.sheet { border: 1px solid var(--line); }
.sheet-head h2, .option-card h3 { color: var(--silver); }
.mini-row .right { color: var(--silver); }
.item-amount { color: var(--silver); }
.toast.error { background: #5a1f2a; border-color: var(--danger); }

/* ---------- Nopirktie saraksta apakšā ---------- */
.done-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 10px; color: var(--muted); font-weight: 700; font-size: .95rem; }
.list.done-list .item { opacity: .6; }

/* ---------- Foto ---------- */
.photo-box { display: flex; flex-direction: column; gap: 8px; }
.photo-preview { width: 100%; max-height: 320px; object-fit: contain; border-radius: 14px; background: var(--field); border: 1px solid var(--line); cursor: zoom-in; }
.photo-full { width: 100%; height: auto; border-radius: 12px; }
.photo-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.photo-actions .btn { flex: 1; }
.photo-preview.photo-full { max-height: none; cursor: zoom-out; }

/* ---------- Sākums ar sarakstu ---------- */
body.is-home .topbar { display: none; }
.page.home { padding-top: calc(14px + env(safe-area-inset-top, 0px)); }
.hero { padding: 6px 0 0; }
.hero h1 { font-size: 1.35rem; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 16px; border-radius: 99px;
  background: var(--card); border: 1px solid var(--line); color: var(--ink); font-weight: 650; white-space: nowrap; }
.chip:active, .chip:hover { border-color: var(--primary); }
.chip .ico { font-size: 1.2rem; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 14px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.panel-head h2 { font-size: 1.12rem; color: var(--silver); display: flex; align-items: center; gap: 8px; }
.panel-link { color: var(--primary-ink); font-weight: 650; white-space: nowrap; padding: 6px 2px; }
.count-pill { display: inline-block; min-width: 26px; padding: 1px 8px; border-radius: 99px; background: var(--primary-soft); color: var(--primary-ink); font-size: .85rem; text-align: center; }
.panel .item { background: var(--field); box-shadow: none; }
.panel .group-title { margin-top: 2px; }
.small-empty { padding: 10px; }

/* ---------- Apakšējā josla ar sadaļām ---------- */
.bottomnav a b { font-weight: 600; font-size: .72rem; max-width: 100%; padding: 0 4px; text-align: center; line-height: 1.15;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.bottomnav a span { font-size: 1.35rem; }

/* ---------- Elegantās (vienkrāsainās) ikonas ---------- */
body:not(.icons-color) .ico,
body:not(.icons-color) .stat-icon,
body:not(.icons-color) .tile-icon {
  filter: grayscale(1) brightness(1.35) sepia(1) hue-rotate(215deg) saturate(2.4) brightness(1.05);
}
body:not(.icons-color) .bottomnav a:not(.active) .ico { opacity: .75; }
.stats > .stat:last-child:nth-child(odd) { grid-column: 1 / -1; }

/* =================== DIZAINS PĒC PARAUGA =================== */
.script { font-family: 'Great Vibes', 'Lora Italic', cursive; font-weight: 400; font-style: normal; letter-spacing: 0; }
.topbar { box-shadow: none; border-bottom: 0; padding-top: calc(14px + env(safe-area-inset-top, 0px)); padding-bottom: 8px; }
.topbar h1 { text-align: center; font-size: 1.2rem; font-weight: 600; color: var(--silver); white-space: normal; line-height: 1.25; }
.title-icon { font-size: 1.9rem; min-width: 44px; text-align: center; }
.topbar .icon-btn { font-size: 2rem; }
.btn-primary { background: var(--grad); border: 0; }
.btn-primary:hover { background: var(--grad); filter: brightness(1.08); }
.btn-glow { box-shadow: 0 6px 22px rgba(139, 92, 214, .45); border-radius: 999px; }
.btn { border-radius: 16px; font-weight: 600; }

/* Sākums */
.home-hero { display: flex; align-items: center; gap: 8px; padding: 8px 2px 4px; }
.hero-text { flex: 1; min-width: 0; }
.home-hero h1 { font-size: 3rem; line-height: 1.05; color: var(--silver); font-weight: 400; text-shadow: 0 2px 16px rgba(176, 131, 238, .35); overflow-wrap: anywhere; }
.swash { width: 85%; height: 14px; display: block; margin: 2px 0 2px; }
.home-hero .sub { font-size: 1.6rem; color: #d9cdea; margin: 0; }
.hero-date { margin: 4px 0 0; color: var(--muted); font-size: .85rem; }
.hero-art { width: 112px; flex: none; filter: drop-shadow(0 6px 14px rgba(139, 92, 214, .45)); }
.sec-cards { display: flex; flex-direction: column; gap: 14px; }
.sec-card { display: flex; align-items: center; gap: 16px; min-height: 92px; padding: 16px 18px; border-radius: 24px;
  background: var(--card); border: 1px solid var(--line); color: var(--ink); box-shadow: var(--shadow); transition: transform .08s; }
.sec-card:active { transform: scale(.985); }
.sec-card.featured { background: linear-gradient(135deg, #8a5cd2 0%, #6b3fb3 100%); border-color: #a77ae8; box-shadow: 0 8px 26px rgba(139, 92, 214, .4); }
.sec-ico { font-size: 2.6rem; width: 64px; height: 64px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.sec-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sec-text b { font-size: 1.15rem; font-weight: 600; line-height: 1.25; }
.sec-text small { color: var(--muted); font-size: .85rem; }
.sec-card.featured .sec-text small { color: #eadcff; }
.sec-arrow { width: 44px; height: 44px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.8rem; line-height: 1; padding-bottom: 3px; color: #fff; background: rgba(255, 255, 255, .14); border: 2px solid rgba(255, 255, 255, .35); }
.sec-card:not(.featured) .sec-arrow { background: var(--primary-soft); border-color: #5b4a73; color: var(--primary-ink); }
.home-footer { display: flex; align-items: flex-end; gap: 6px; margin-top: 6px; }
.leaf-art { width: 120px; flex: none; }
.home-footer p { font-size: 1.7rem; color: #d9cdea; margin: 0 0 6px; line-height: 1.1; text-align: center; flex: 1; }

/* Apakšējā josla – aktīvā poga ar violetu fonu */
.bottomnav { background: #26222c; border-top: 1px solid var(--line); }
.bottomnav a { position: relative; }
.bottomnav a.active::before { content: ""; position: absolute; inset: 6px 14% ; border-radius: 16px; background: var(--primary-soft); border: 1px solid #5b4a73; z-index: -1; }
.bottomnav a.active { color: var(--primary-ink); }
.bottomnav { isolation: isolate; }

/* Saraksts – kā paraugā */
.segmented { display: flex; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 4px; gap: 4px; }
.segmented .seg { flex: 1; min-height: 46px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; padding: 6px 10px; }
.segmented.many .seg { font-size: .85rem; padding: 6px 4px; }
.segmented .seg.active { background: var(--grad); color: #fff; box-shadow: 0 4px 14px rgba(139, 92, 214, .4); }
.segmented .count { display: inline-block; min-width: 22px; padding: 0 6px; border-radius: 99px; background: rgba(255,255,255,.14); font-size: .78rem; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.toolbar-btns { display: flex; gap: 6px; }
.tool-btn { min-width: 46px; min-height: 46px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font-size: 1.2rem; cursor: pointer; }
.tool-btn.on { border-color: var(--primary); color: var(--primary-ink); }
.list { background: var(--card); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; gap: 0; box-shadow: var(--shadow); }
.list .item { border-radius: 0; box-shadow: none; background: transparent; border-left: 0; border-bottom: 1px solid var(--line); min-height: 62px; padding: 10px 6px 10px 14px; }
.list .item:last-child { border-bottom: 0; }
.list .item.is-overdue { box-shadow: inset 4px 0 0 var(--danger); background: rgba(240, 113, 122, .07); }
.list .item.is-soon { box-shadow: inset 4px 0 0 var(--warn); }
.check { border-radius: 9px; width: 34px; height: 34px; border: 2.5px solid #9a8fb0; }
.check.checked { background: var(--grad); border-color: transparent; }
.more-btn { flex: none; width: 40px; height: 44px; border: 0; background: transparent; color: var(--muted); font-size: 1.4rem; cursor: pointer; border-radius: 10px; }
.more-btn:active { background: var(--field); }
.list.done-list .item { opacity: .55; }
.group-title { margin: 8px 4px -4px; color: var(--primary-ink); font-weight: 600; font-size: .9rem; text-transform: none; }
.add-sticky { position: sticky; bottom: calc(var(--nav-h) + var(--safe-b) + 10px); z-index: 5; padding-top: 6px; }
.list-page { padding-bottom: 8px; }
.panel .list { box-shadow: none; }

/* Vienkāršais pievienošanas logs */
.input-icon { position: relative; display: block; }
.input-icon .ico { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 1.3rem; pointer-events: none; }
.field-simple input { min-height: 58px; font-size: 1.05rem; padding-right: 48px; border-radius: 16px; }
.more-opts { border: 1px solid var(--line); border-radius: 16px; padding: 4px 14px; background: var(--card); }
.more-opts summary { cursor: pointer; padding: 12px 0; color: var(--primary-ink); font-weight: 600; list-style: none; }
.more-opts summary::-webkit-details-marker { display: none; }
.more-opts summary::before { content: "＋ "; }
.more-opts[open] summary::before { content: "－ "; }
.more-body { display: flex; flex-direction: column; gap: 14px; padding-bottom: 14px; }
.added-note { color: var(--good); }
.sheet { background: var(--bg); }
.sheet-head { background: var(--bg); }
.item-meta:not(:has(*)) { display: none; }
.list .item { min-height: 56px; }
.list .item-title { font-weight: 500; }

/* =================== PARAUGS 2: Mājas iepirkumi =================== */
.center { text-align: center; }
.home-hero2 { display: grid; grid-template-columns: 1fr 1.6fr 1fr; align-items: end; gap: 0; margin: -6px -6px 0; padding: 4px 0 0;
  background: radial-gradient(120% 90% at 50% 0%, #3c2b55 0%, rgba(33,29,38,0) 70%); border-radius: 0 0 28px 28px; }
.hh-center { text-align: center; padding-bottom: 6px; }
.house-art { width: 64px; height: 60px; display: block; margin: 0 auto 2px; filter: drop-shadow(0 0 10px rgba(201, 162, 255, .5)); }
.home-hero2 h1 { font-size: 2.7rem; line-height: 1; color: #f3ecfb; font-weight: 400; text-shadow: 0 2px 14px rgba(176, 131, 238, .45); }
.home-hero2 .swash { width: 90%; margin: 4px auto 0; }
.home-hero2 .sub { font-size: 1.4rem; color: #d9cdea; margin: 2px 0 0; }
.lav-art { width: 100%; max-height: 170px; display: block; }
.lantern-art { width: 82%; max-height: 140px; display: block; margin-left: auto; }
.hero-date { margin: -4px 0 0; color: var(--muted); font-size: .85rem; }
.sec-ico { position: relative; }
.sec-badge { position: absolute; right: -4px; bottom: 2px; width: 26px; height: 26px; border-radius: 8px; background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.35); display: inline-flex; align-items: center; justify-content: center; color: #fff; filter: none; }

/* Datuma pārslēgs */
.date-switch { display: flex; gap: 8px; align-items: stretch; }
.ds-arrow { width: 52px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); color: var(--primary-ink); font-size: 1.8rem; cursor: pointer; }
.ds-center { flex: 1; min-height: 52px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 16px; border: 0;
  background: var(--grad); color: #fff; font: inherit; font-weight: 600; cursor: pointer; box-shadow: 0 4px 16px rgba(139, 92, 214, .35); }
.ds-center b { font-weight: 600; }
.panel-sub { font-size: .95rem; color: var(--silver); font-weight: 600; margin: 0; }
.date-panel { gap: 6px; }
.date-row { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 12px; border-radius: 14px; border: 1px solid transparent; background: transparent; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.date-row .grow { flex: 1; }
.date-row small { color: var(--muted); }
.date-row.active { background: var(--grad); color: #fff; }
.date-row.active small { color: #eadcff; }
.date-row:not(.active) { border-bottom-color: var(--line); border-radius: 0; }
.new-list { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.new-list input { flex: 1 1 150px; }
.new-list .btn { flex: 1 1 200px; }
.grow { flex: 1; min-width: 0; }

/* Ātrā pievienošana */
.quick-cats { display: flex; flex-direction: column; gap: 8px; }
.qc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.qc { min-height: 86px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-size: .85rem; font-weight: 500;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 8px 4px; cursor: pointer; text-align: center; line-height: 1.2; }
.qc .ico { font-size: 1.9rem; }
.qc:active { border-color: var(--primary); background: var(--primary-soft); }
.qc-dots { font-size: 1.2rem; letter-spacing: 2px; color: var(--primary-ink); height: 2.2rem; display: inline-flex; align-items: center; }

/* Kategoriju filtri */
.cat-chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.cat-chips::-webkit-scrollbar { display: none; }
.cchip { flex: none; min-height: 44px; padding: 6px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font: inherit; font-size: .9rem; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.cchip b { font-weight: 600; color: var(--primary-ink); }
.cchip.active { background: var(--grad); border-color: transparent; color: #fff; }
.cchip.active b { color: #fff; }

/* Saliekamās kategoriju grupas */
.cat-group { display: flex; flex-direction: column; gap: 6px; }
.cat-head { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 14px; border-radius: 14px; border: 0; cursor: pointer;
  background: linear-gradient(135deg, #5b3a8c 0%, #46306a 100%); color: #fff; font: inherit; font-weight: 600; text-align: left; }
.cat-head .ico { font-size: 1.3rem; }
.cat-head .chev { transition: transform .15s; font-size: 1.1rem; }
.cat-group.collapsed .chev { transform: rotate(180deg); }
.item-emoji { font-size: 1.5rem; width: 32px; text-align: center; flex: none; }
.qty-pill { flex: none; padding: 3px 10px; border-radius: 10px; background: var(--field); border: 1px solid var(--line); color: var(--silver); font-size: .85rem; white-space: nowrap; }
.note-txt { color: var(--muted); font-style: italic; }
.add-sticky.two { display: flex; gap: 8px; }
.add-sticky.two .btn { flex: 1; min-width: 0; padding: 10px 12px; }
.bought-btn { display: inline-flex; gap: 6px; border: 1px solid #5b4a73; }
.bought-btn.on { background: var(--grad); color: #fff; }
.bought-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.bought-head h3 { color: var(--silver); font-size: 1.05rem; }

/* Pievienot preci */
.qty-row { display: flex; gap: 8px; align-items: center; }
.qty-row .step { width: 50px; height: 50px; flex: none; border-radius: 50%; border: 2px solid #6c5a85; background: var(--field); color: var(--ink); font-size: 1.4rem; cursor: pointer; }
.qty-row input { width: 70px; flex: none; text-align: center; font-weight: 600; }
.qty-row select { flex: 1; min-width: 0; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 52px; padding: 6px 14px; border-radius: 14px; background: var(--field); border: 1px solid var(--line); font-weight: 500; }
input.switch { appearance: none; -webkit-appearance: none; width: 52px; height: 30px; min-height: 0; padding: 0; border-radius: 99px; background: #514764; border: 0; position: relative; cursor: pointer; flex: none; transition: background .15s; }
input.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: left .15s; }
input.switch:checked { background: var(--primary); }
input.switch:checked::after { left: 25px; }

/* ⋮ izvēlne */
.menu-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.menu-row { display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 8px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-weight: 500; text-align: left; cursor: pointer; flex-wrap: wrap; }
.menu-row > span:first-child { font-size: 1.3rem; }
.menu-row.danger { color: var(--danger); }
.menu-date input { flex: 1 1 140px; min-height: 44px; }
.menu-date .btn { flex: 0 0 auto; }

/* Galerija */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.g-tile { border: 1px solid var(--line); background: var(--card); border-radius: 16px; padding: 0; overflow: hidden; cursor: pointer; display: flex; flex-direction: column; text-align: left; color: var(--ink); font: inherit; }
.g-img { aspect-ratio: 1; background: var(--field); display: flex; align-items: center; justify-content: center; font-size: 2rem; overflow: hidden; }
.g-img img { width: 100%; height: 100%; object-fit: cover; }
.g-cap { padding: 6px 8px; font-size: .8rem; font-weight: 500; line-height: 1.2; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.g-cap small { display: block; font-size: .72rem; }
.viewer-img { max-height: 70vh; object-fit: contain; background: #000; }
.qc-grid { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.qc { min-height: 70px; font-size: .8rem; padding: 6px 4px; }
.qc .ico { font-size: 1.5rem; }
.add-sticky.two .btn { font-size: 1rem; }
