:root {
  --bg: #eef1f5; --card: #ffffff; --text: #1a202b; --muted: #566175; --line: #cdd5df;
  --accent: #3b4861; --accent-text: #ffffff; --danger: #b3261e; --note: #eef0d8;
  --lunch: #e7f1ec; --shop: #e8eef8; --other: #efedea; --paperless: #f6e9f2;
  --series-1: #2f6f5e; --series-2: #c46a2b; --series-3: #4a68b0; --series-4: #a3842a; --series-5: #8a4f8f; --series-6: #3f8fa0;
  --up: #b3261e; --down: #2f6f5e;
  --card-2: #e6eaf0; --link: #2c4c90;
  --btn1-top: #5d6d89; --btn1-bot: #3b4861; --btn1-edge: #2e394d; --btn1-hi: rgba(255,255,255,.35);
  --btn2-top: #ffffff; --btn2-bot: #e1e6ee; --btn2-edge: #7e8aa0; --btn2-text: #1a202b;
  --glow: #ffffff;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1218; --card: #171c24; --text: #e8ecf2; --muted: #9aa5b6; --line: #2b3441;
    --accent: #c9d1de; --accent-text: #10151d; --danger: #f2827a; --note: #2c2f1f;
    --lunch: #22352d; --shop: #232d3c; --other: #2c2c2a; --paperless: #3a2834;
    --series-1: #5fb39b; --series-2: #e0925a; --series-3: #7f9be0; --series-4: #d0b25a; --series-5: #c08ac4; --series-6: #6cc0d0;
    --up: #f2827a; --down: #5fb39b;
    --card-2: #1f2630; --link: #9fb9e8;
    --btn1-top: #eef2f7; --btn1-bot: #b9c3d1; --btn1-edge: #8b97aa; --btn1-hi: rgba(255,255,255,.75);
    --btn2-top: #2b3443; --btn2-bot: #1e2531; --btn2-edge: #5f6c82; --btn2-text: #e8ecf2;
    --glow: #1d2530;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
       font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
/* Dazdranagon dragon-D watermark: faint, fixed behind the page, never takes clicks */
body::before { content: ""; position: fixed; inset: 0; z-index: 1; pointer-events: none;
               background: url(/static/icons/watermark-ink.png) center / min(78vmin, 560px) no-repeat; }
@media (prefers-color-scheme: dark) {
  body::before { background-image: url(/static/icons/watermark-light.png); }
}
main { max-width: 960px; margin: 0 auto; padding: 16px; }
a { color: var(--accent); }
h1 { font-size: 1.4rem; margin: 0 0 12px; }
h2 { font-size: 1.1rem; margin: 20px 0 8px; }
.muted { color: var(--muted); }
.center { text-align: center; margin-top: 40px; }

nav.top { display: flex; gap: 16px; align-items: center; padding: 10px 16px; background: var(--card);
          border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; }
nav.top .brand { font-weight: 700; text-decoration: none; color: var(--text); margin-right: auto; }
form.inline { display: inline; }

.btn { display: inline-block; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line);
       background: var(--card); color: var(--text); font: inherit; text-decoration: none; cursor: pointer; }
.btn.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.btn.danger { color: var(--danger); border-color: var(--danger); background: transparent; }
button.link { background: none; border: 0; color: var(--accent); font: inherit; cursor: pointer; padding: 0; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.card.narrow { max-width: 360px; margin: 60px auto; }
.note { background: var(--note); padding: 8px 12px; border-radius: 8px; margin: 0 0 8px; }
.error { color: var(--danger); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 16px; }
.danger-zone { margin-top: 24px; }

label { display: flex; flex-direction: column; gap: 4px; font-size: .9rem; color: var(--muted); }
label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); margin: 8px 0; }
input, select { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line);
                border-radius: 8px; padding: 8px 10px; width: 100%; min-width: 0; }
input[type=checkbox] { width: auto; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.grid .wide { grid-column: 1 / -1; }
details { margin: 12px 0; }
.photo-pick input { padding: 12px; }

.summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.summary div { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.summary span { display: block; font-size: .85rem; }
.summary strong { font-size: 1.2rem; }

.actual-bar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap;
          background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; }
.filters { display: flex; gap: 8px; margin-bottom: 12px; align-items: end; flex-wrap: wrap; }
.filters input[type=search] { flex: 1; }
.filters select { width: auto; }
.filters label { flex-direction: row; align-items: center; }

.receipts { list-style: none; padding: 0; margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.receipts li + li { border-top: 1px solid var(--line); }
.receipts a { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; padding: 10px 14px;
              text-decoration: none; color: var(--text); align-items: baseline; }
.receipts .date { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .9rem; }
.receipts .sum { font-variant-numeric: tabular-nums; font-weight: 600; }
.tag { font-size: .75rem; padding: 1px 6px; border-radius: 6px; background: var(--other); color: var(--text); margin-left: 4px; }
.tag.actual { background: var(--lunch); color: var(--accent); font-weight: 600; }
.tag.lunch { background: var(--lunch); } .tag.shop { background: var(--shop); } .tag.paperless { background: var(--paperless); }

table { width: 100%; border-collapse: collapse; }
table.items input { padding: 6px; }
table.items th, table.data th { text-align: left; font-weight: 500; color: var(--muted); font-size: .85rem; padding: 4px; }
table.items td { padding: 2px; }
table.items td:nth-child(1) { width: 34%; }
table.items td:nth-child(2) { width: 22%; }
table.items select { padding: 6px; }
table.data td { padding: 6px 4px; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin: 8px 0 12px; }
.thumb { position: relative; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--bg); }
.thumb img { display: block; width: 100%; height: 128px; object-fit: cover; }
.thumb span { position: absolute; top: 4px; left: 4px; background: var(--card); border-radius: 6px; padding: 0 6px; font-size: .8rem; }
.thumb > button { position: absolute; top: 2px; right: 6px; font-size: 1.1rem; }
.thumb .drop { flex-direction: row; gap: 4px; align-items: center; padding: 4px 6px; font-size: .8rem; }
.pick { margin-top: 0; }
label.btn input[type=file] { display: none; }
.photo { max-width: 100%; max-height: 480px; border-radius: 8px; border: 1px solid var(--line); margin-top: 16px; }

table.data select { padding: 4px 6px; }
table.data tr.group-top td { font-weight: 600; }
table.data td.sub { padding-left: 16px; color: var(--muted); }
table.data td.up { color: var(--up); } table.data td.down { color: var(--down); }
.tree { display: grid; gap: 12px; }
.tree-top input.top { font-weight: 600; }
.tree-children { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; margin: 6px 0 0 16px; align-items: start; }
.tree-node { display: grid; gap: 4px; }
.tree-node input.mid { font-weight: 600; }
.tree-node input.leaf3 { margin-left: 14px; width: calc(100% - 14px); font-size: .9rem; padding: 6px 8px; }
.tabs { display: flex; gap: 4px; margin-bottom: 8px; }
.tab { background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 8px; padding: 4px 10px; font: inherit; cursor: pointer; }
.tab.active { color: var(--accent-text); background: var(--accent); border-color: var(--accent); }
.chart { position: relative; height: 260px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.btn { white-space: nowrap; }
a.back { display: inline-block; margin: 0 0 12px; text-decoration: none; font-weight: 600; }
nav.tabbar { display: none; }

footer.ver { margin: 2rem 0 1rem; font-size: .8rem; text-align: center; }
footer.ver a { color: var(--muted, #6b7280); }
footer.ver { display: flex; align-items: center; justify-content: center; gap: .6rem; }
footer.ver a.maker { display: inline-flex; }
footer.ver a.maker img { display: block; }
tr.current td { font-weight: 600; }

/* aptechka */
.tag.draft { background: var(--note); }
.receipts .sum.soon { color: var(--series-2); font-weight: 700; }
.receipts .sum.error { font-weight: 700; }
h1 .tag { font-size: .8rem; vertical-align: middle; }

/* analogs in Bulgaria */
.analogs h3 { font-size: 1rem; margin: 16px 0 4px; }
.analog-list { list-style: none; padding: 0; margin: 8px 0; border: 1px solid var(--line); border-radius: 10px; }
.analog-list > li { padding: 10px 12px; }
.analog-list > li + li { border-top: 1px solid var(--line); }
.analog .diffs { margin: 4px 0; padding-left: 18px; color: var(--series-2); }
.analog .shop-line, .analog .src { font-size: .9rem; margin-top: 2px; }
.tag.rx { background: var(--note); color: var(--danger); }
.tag.otc { background: var(--lunch); }

/* Dazdranagon theme (silver and platinum, from the dragon-D mark), 2026-11-04. Source: dazdranagon-site/tools/theme_build.py.
   The old green theme is kept in brand/previous-theme-2026-11-04/. */
body {
  background-color: var(--bg);
  background-image: radial-gradient(ellipse at 50% -10%, var(--glow) 0%, transparent 60%), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='26'%3E%3Cg fill='none' stroke='%23808c9f' stroke-opacity='.16' stroke-width='1'%3E%3Cpath d='M0 13a18 13 0 0 0 36 0M-18 0a18 13 0 0 0 36 0M18 0a18 13 0 0 0 36 0'/%3E%3C/g%3E%3C/svg%3E");
  background-attachment: fixed;
}
a { color: var(--link); }
button.link { color: var(--link); }
.btn {
  background: linear-gradient(180deg, var(--btn2-top), var(--btn2-bot)); color: var(--btn2-text);
  border: 1px solid var(--btn2-edge); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 1px 2px rgba(10,20,35,.12);
}
.btn.primary {
  background: linear-gradient(180deg, var(--btn1-top), var(--btn1-bot)); color: var(--accent-text);
  border-color: var(--btn1-edge); box-shadow: inset 0 1px 0 var(--btn1-hi), 0 1px 2px rgba(10,20,35,.2);
}
.btn.danger { background: transparent; color: var(--danger); border-color: var(--danger); box-shadow: none; }
.btn:hover { filter: brightness(1.06); }
.btn:active { filter: brightness(.94); box-shadow: inset 0 1px 2px rgba(10,20,35,.25); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible, button:focus-visible {
  outline: 2px solid var(--link); outline-offset: 2px; }
.table-wrap { overflow-x: auto; margin: 8px 0; border: 1px solid var(--line); border-radius: 10px; }
table.prices { font-size: .9rem; }
table.prices th { text-align: left; font-weight: 500; color: var(--muted); font-size: .8rem; padding: 6px 8px; }
table.prices td { padding: 6px 8px; border-top: 1px solid var(--line); vertical-align: top; font-variant-numeric: tabular-nums; }
table.prices tr.grp td { background: var(--other); font-weight: 600; font-size: .8rem; padding: 3px 8px; }
table.prices td.price a { text-decoration: none; white-space: nowrap; }
table.prices td.manual { font-size: .8rem; white-space: nowrap; }

/* drafts: photos kept before Claude reads them (HO-B-133) */
.receipts.drafts a { align-items: center; }
.receipts .mini { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; display: block; }
