/* Akkufalu: a warm, paper-and-ink look. Phone first (390 wide), a sidebar on wide screens, a rail on a landscape phone. */
:root {
  --paper: #f4eddb; --paper2: #fbf7ec; --card: #fffdf6; --ink: #2b2a26; --ink2: #5d5a50; --muted: #8a8574;
  --line: #e2d9c1; --green: #2f4a36; --green2: #3f6b4b; --leaf: #6f9a5a; --gold: #d9a441; --red: #b4473a; --blue: #3f6c8f;
  --pos: #2f7a43; --neg: #b4473a; --r: 14px; --shadow: 0 1px 0 rgba(60, 45, 20, .06), 0 2px 10px rgba(60, 45, 20, .06);
  --top-h: 52px; --tabs-h: 62px;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.42 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overscroll-behavior-y: none; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--green2); }
h2 { font-size: 1.22rem; margin: 0 0 .4rem; line-height: 1.2; }
h3 { font-size: 1.02rem; margin: .9rem 0 .4rem; }
h3:first-child { margin-top: 0; }
p { margin: .35rem 0; }
.small { font-size: .86rem; }
.muted { color: var(--muted); }
.warn { color: #9a5b12; }
.pos { color: var(--pos); } .neg { color: var(--neg); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---- the shell */
#app { min-height: 100dvh; }
#top { position: sticky; top: 0; z-index: 20; height: var(--top-h); display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 0 calc(12px + var(--safe-r)) 0 calc(12px + var(--safe-l)); background: var(--green); color: #fdf8e8; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.brand { display: flex; flex-direction: column; align-items: flex-start; background: none; border: 0; padding: 0; cursor: pointer; color: inherit; min-width: 0; }
.brand-name { font-weight: 700; font-size: 1.06rem; letter-spacing: .01em; font-family: Georgia, "Times New Roman", serif; }
.brand-day { font-size: .76rem; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 52vw; }
.top-right { display: flex; align-items: center; gap: 10px; font-size: .88rem; white-space: nowrap; }
.clock { opacity: .9; font-variant-numeric: tabular-nums; }
.money { background: rgba(255,255,255,.14); padding: 3px 9px; border-radius: 99px; font-weight: 650; font-variant-numeric: tabular-nums; }
.money.neg { background: rgba(220, 90, 70, .45); }
.conn { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: #e98b7a; }
.conn.on { background: #9be08e; }
.money-float { position: absolute; right: 44px; top: 40px; font-weight: 700; color: #bff0b0; text-shadow: 0 1px 2px rgba(0,0,0,.4); animation: floatUp 2.1s ease-out forwards; pointer-events: none; }
.money-float.neg { color: #ffc2b5; }
@keyframes floatUp { from { opacity: 0; transform: translateY(6px); } 15% { opacity: 1; } to { opacity: 0; transform: translateY(-26px); } }

#tabs { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; height: calc(var(--tabs-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: flex; background: var(--paper2); border-top: 1px solid var(--line); box-shadow: 0 -2px 10px rgba(60,45,20,.06); }
.tab { flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-decoration: none;
  color: var(--ink2); font-size: .68rem; min-width: 0; -webkit-tap-highlight-color: transparent; }
.tab.on { color: var(--green); font-weight: 700; }
.tab.on::before { content: ""; position: absolute; top: 0; left: 22%; right: 22%; height: 3px; border-radius: 0 0 3px 3px; background: var(--green2); }
.tab-ico, .tab .ico-ph { width: 26px; height: 26px; font-size: 20px; line-height: 26px; text-align: center; display: block; object-fit: contain; }
.tab-l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tab .badge { position: absolute; top: 5px; left: calc(50% + 6px); }
.tab-n { position: absolute; top: 6px; right: calc(50% + 10px); font-size: .62rem; color: var(--muted); }
.badge { display: inline-block; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: .7rem; font-weight: 700; line-height: 18px; text-align: center; margin-left: 4px; }

#screen { padding: 12px calc(12px + var(--safe-r)) calc(var(--tabs-h) + var(--safe-b) + 18px) calc(12px + var(--safe-l)); max-width: 760px; margin: 0 auto; outline: none; }

/* ---- cards and pieces */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin: 0 0 12px; box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.card-head h2 { margin: 0; }
.box { background: var(--paper2); border: 1px dashed var(--line); border-radius: 10px; padding: 10px 12px; margin: 10px 0; }
.row { display: flex; align-items: center; }
.row.gap { gap: 8px; } .row.wrap { flex-wrap: wrap; } .row.between { justify-content: space-between; } .row.end { align-items: flex-end; }
.ico, .ico-ph { width: 22px; height: 22px; vertical-align: -4px; display: inline-block; object-fit: contain; font-size: 18px; line-height: 22px; text-align: center; }
.btn { appearance: none; border: 1px solid #cfc4a6; background: #fff; color: var(--ink); border-radius: 10px; padding: 9px 14px; min-height: 42px; cursor: pointer;
  font-weight: 600; touch-action: manipulation; transition: transform .08s, background .15s; }
.btn:hover { background: #fbf6e6; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn.primary { background: var(--green2); border-color: var(--green); color: #fff; }
.btn.primary:hover { background: var(--green); }
.btn.ghost { background: transparent; }
.btn.danger { background: #fff4f1; border-color: #e3b1a8; color: var(--red); }
.btn.on { background: #e9f1e3; border-color: var(--leaf); }
.btn.sm { padding: 5px 10px; min-height: 34px; font-size: .9rem; }
.btn.wide { width: 100%; margin-top: 8px; }
.icon-btn { background: none; border: 0; cursor: pointer; color: var(--muted); font-size: 1rem; padding: 4px; }
.linkish { background: none; border: 0; padding: 0; color: var(--green2); text-decoration: underline; cursor: pointer; }
.back { background: none; border: 0; color: var(--green2); font-weight: 600; padding: 4px 0 10px; cursor: pointer; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 8px; margin: 10px 0; }
.stat { background: var(--paper2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 6px; text-align: center; min-width: 0; }
button.stat { cursor: pointer; font: inherit; }
.stat-v { font-weight: 700; font-size: 1.05rem; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-l { font-size: .74rem; color: var(--ink2); }
.stat-s { font-size: .7rem; color: var(--muted); }
.bar { height: 9px; background: #ece4cf; border-radius: 6px; overflow: hidden; flex: 1; min-width: 60px; }
.bar-fill { height: 100%; background: var(--gold); border-radius: 6px; transition: width .6s ease; }
.bar.good .bar-fill { background: var(--leaf); } .bar.bad .bar-fill { background: #d7876f; } .bar.wish .bar-fill { background: #c9a35b; }
.rep { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.line { display: flex; align-items: baseline; gap: 8px; width: 100%; padding: 8px 2px; border: 0; border-bottom: 1px solid #efe7d2; background: none; text-align: left; font: inherit; color: inherit; }
button.line { cursor: pointer; }
button.line:hover { background: #fbf6e7; }
.line-l { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.line-m { flex: 0 1 auto; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.line-r { flex: 0 0 auto; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.line.total { border-bottom: 0; border-top: 2px solid var(--line); font-weight: 700; }
.line.with-pic { align-items: center; }
.empty { text-align: center; color: var(--muted); padding: 10px 4px; }
.empty .btn { margin-top: 6px; }
.segs { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.segs::-webkit-scrollbar { display: none; }
.seg { flex: 0 0 auto; border: 1px solid var(--line); background: var(--card); border-radius: 99px; padding: 7px 13px; cursor: pointer; font-weight: 600; color: var(--ink2); min-height: 38px; }
.seg.on { background: var(--green2); color: #fff; border-color: var(--green); }
.seg .badge { margin-left: 6px; }
.field { display: flex; flex-direction: column; gap: 3px; margin: 8px 0; font-size: .88rem; color: var(--ink2); flex: 1 1 160px; }
.field input, .field select, .numin input { border: 1px solid #cfc4a6; border-radius: 9px; padding: 9px 10px; background: #fff; min-height: 42px; color: var(--ink); width: 100%; }
.numin { display: flex; flex-direction: column; gap: 3px; font-size: .88rem; color: var(--ink2); position: relative; flex: 1 1 140px; margin: 6px 0; }
.numin .suffix { position: absolute; right: 10px; bottom: 11px; color: var(--muted); pointer-events: none; font-size: .85rem; }
.numin input { padding-right: 44px; font-variant-numeric: tabular-nums; }
.check { display: flex; align-items: center; gap: 10px; margin: 10px 0; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--green2); }
.sl { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; margin: 10px 0 14px; align-items: baseline; }
.sl-l { font-weight: 600; font-size: .92rem; }
.sl-v { font-size: .88rem; color: var(--ink2); text-align: right; }
.sl input[type=range] { grid-column: 1 / -1; width: 100%; accent-color: var(--green2); height: 30px; }
.sl-h { grid-column: 1 / -1; font-size: .78rem; color: var(--muted); }
.stepper { display: flex; align-items: center; gap: 8px; margin: 10px 0; }
.stepper .sl-l { flex: 1; }
.stepper-v { min-width: 30px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.msg.bad { color: var(--red); }
.spark { display: block; }
.spark polyline { fill: none; stroke: var(--green2); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark circle { fill: var(--green2); }
.spark-zero { stroke: #d9cfb5; stroke-width: 1; stroke-dasharray: 3 3; }
.chart { margin: 6px 0; }
.chart .spark { width: 100%; height: 54px; }
pre.err { white-space: pre-wrap; font-size: .7rem; color: var(--muted); }

/* ---- Ma */
.day { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; background: linear-gradient(135deg, #fffaf0, #f6ecd0); }
.day-date { font-family: Georgia, serif; font-size: 1.3rem; font-weight: 700; }
.day-n { font-size: .85rem; color: var(--ink2); }
.day-count { text-align: right; display: flex; flex-direction: column; }
.day-count-l { font-size: .78rem; color: var(--muted); }
.day-count-v { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--green); }
.choices { border-color: #e6c983; background: #fffaf0; }
.choice { padding: 8px 0 10px; border-bottom: 1px dashed var(--line); }
.choice:last-child { border-bottom: 0; }
.choice-t { font-weight: 600; }
.events { list-style: none; margin: 0; padding: 0; }
.ev { display: flex; gap: 10px; padding: 8px 2px; border-bottom: 1px solid #efe7d2; cursor: default; }
.ev.unread { cursor: pointer; }
.ev.unread .ev-t { font-weight: 650; }
.ev.unread::before { content: ""; flex: 0 0 8px; height: 8px; margin-top: 7px; border-radius: 50%; background: var(--red); }
.ev-day { flex: 0 0 auto; font-size: .78rem; color: var(--muted); min-width: 46px; padding-top: 2px; }
.ev-t { flex: 1; }
.ev-ans { font-size: .8rem; color: var(--pos); white-space: nowrap; }
.paper-teaser .paper-lines { margin: 0; padding-left: 18px; font-family: Georgia, serif; }
.pulse .stats { margin-top: 0; }
.welcome { background: linear-gradient(160deg, #fffdf6, #eef3e2); }
.cta { border-color: #bcd3ae; }

/* ---- the map */
#screen[data-screen=terkep] { max-width: none; display: flex; flex-direction: column; height: calc(100dvh - var(--top-h)); padding-bottom: calc(var(--tabs-h) + var(--safe-b) + 8px); }
.map-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.map-bar .segs { padding-bottom: 6px; }
.map-btns { display: flex; gap: 6px; padding-bottom: 6px; }
.map-btns .btn { min-width: 40px; font-size: 1.1rem; }
.map-wrap { position: relative; flex: 1 1 auto; min-height: 260px; overflow: hidden; border-radius: var(--r); border: 1px solid var(--line); background: #e3dbbd;
  touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.map-wrap.dragging { cursor: grabbing; }
.map-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.map-bg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.map-layer { position: absolute; inset: 0; }
.map-hint { text-align: center; margin: 6px 0 0; }
.pin { position: absolute; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; pointer-events: none; -webkit-tap-highlight-color: transparent; }
.pin-hit { position: absolute; left: 18%; right: 18%; top: 44%; bottom: 8%; pointer-events: auto; border-radius: 6px; }
.pin-hit.wide { left: 8%; right: 8%; top: 20%; bottom: 4%; }
.pin-hit.full { inset: 0; }
.pin:hover .pin-hit, .pin:focus-visible .pin-hit { background: rgba(255, 240, 190, .28); outline: 2px solid rgba(217, 164, 65, .9); }
.pin:focus-visible { outline: none; }
.pin-pic { position: absolute; left: 0; top: 0; width: 100%; height: auto; display: block; pointer-events: none; }
.pin .bph.pin-pic { position: absolute; }
.lotpin.mine .pin-hit { outline: 2px dashed rgba(63, 107, 75, .9); background: rgba(207, 227, 195, .35); }
.pin.mine .pin-pic { filter: drop-shadow(0 0 3px rgba(255, 255, 255, .95)) drop-shadow(0 0 5px rgba(63, 107, 75, .9)); }
.pin.mine::after { content: "★"; position: absolute; top: 40%; right: 18%; color: var(--gold); font-size: 15px; text-shadow: 0 1px 1px rgba(0,0,0,.45); pointer-events: none; }
.pin.site .pin-pic { opacity: .5; filter: grayscale(.6); }
.pin .sign { position: absolute; height: auto; transform: translate(-50%, -50%); pointer-events: none; }
.pin .sign:not(.on-wall) { left: 50%; top: 66%; width: 60%; }
.pin .sign-ph { position: absolute; left: 50%; top: 66%; transform: translate(-50%, -50%); max-width: 92%; padding: 1px 4px; border-radius: 3px; background: #5b3d24; color: #f9edcf;
  font-size: 9px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 1px 2px rgba(0,0,0,.3); pointer-events: none; }
.pin-tag { position: absolute; top: 36%; left: 50%; transform: translateX(-50%); background: #c9851a; color: #fff; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 8px; white-space: nowrap; pointer-events: none; }
.pin.auc .pin-tag { background: var(--red); }
.pin-tag.build { background: #5d6b78; top: 30%; }
.pin-label { display: none; position: absolute; top: 93%; left: 50%; transform: translateX(-50%); font-size: 10px; line-height: 1.15; background: rgba(255, 252, 240, .92); padding: 1px 4px; border-radius: 4px;
  white-space: nowrap; color: var(--ink); pointer-events: none; max-width: 170px; overflow: hidden; text-overflow: ellipsis; }
.lotpin .pin-label { top: 100%; }
.z-near .pin.biz .pin-label, .z-near .pin.mine .pin-label, .z-near .pin.fixed .pin-label, .z-near .pin.site .pin-label { display: block; }
.z-far .pin .sign-ph { display: none; }
.z-far .pin-tag { font-size: 14px; }

/* placeholder building: a box with a roof and a letter, in the kind's colour */
.bph { position: relative; display: block; aspect-ratio: 1 / .9; --c: #c9a27e; }
.bph-roof { position: absolute; left: 6%; right: 6%; top: 0; height: 38%; background: color-mix(in srgb, var(--c) 60%, #5a3b25); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.bph::after { content: ""; position: absolute; left: 14%; right: 14%; top: 36%; bottom: 0; background: var(--c); border: 2px solid rgba(70, 50, 30, .55); border-radius: 2px; }
.bph-l { position: absolute; z-index: 1; left: 0; right: 0; top: 46%; text-align: center; font-weight: 800; color: rgba(50, 35, 20, .75); font-size: 16px; }
.pin.s2 .bph-l { font-size: 20px; } .pin.s3 .bph-l { font-size: 24px; }
.bpic.big, .bph.big { width: 120px; }
.bpic.sm, .bph.sm { width: 48px; flex: 0 0 48px; }
.bpic.xs, .bph.xs { width: 30px; flex: 0 0 30px; }
.bpic { height: auto; }

/* ---- sheet */
#sheet-root .sheet-back { position: fixed; inset: 0; z-index: 40; background: rgba(40, 32, 18, .32); animation: fadeIn .18s ease-out; }
#sheet-root .sheet { position: fixed; z-index: 41; left: 0; right: 0; bottom: 0; max-height: 86dvh; overflow: auto; background: var(--card); border-radius: 18px 18px 0 0;
  padding: 18px 16px calc(18px + var(--safe-b)); box-shadow: 0 -6px 30px rgba(40, 30, 10, .25); animation: sheetUp .22s ease-out; outline: none; overscroll-behavior: contain; }
#sheet-root .sheet::before { content: ""; position: absolute; top: 7px; left: 50%; width: 44px; height: 4px; margin-left: -22px; border-radius: 2px; background: #ddd2b6; }
.sheet-x { position: absolute; top: 8px; right: 10px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--paper2); font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--ink2); }
.sheet-body h2 { padding-right: 44px; }
@keyframes sheetUp { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.card-hero { display: flex; align-items: flex-end; gap: 10px; margin-bottom: 8px; }
.card-hero .sign { width: 120px; height: auto; }
.card-hero .sign-ph, .biz-head .sign-ph, .biz-row .sign-ph, .kind .sign-ph { display: inline-block; background: #5b3d24; color: #f9edcf; font-weight: 700; padding: 5px 10px; border-radius: 5px; font-family: Georgia, serif; box-shadow: 0 2px 3px rgba(0,0,0,.2); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.build-list { display: flex; flex-direction: column; gap: 6px; }
.build-opt { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid #efe7d2; }
.build-t { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.reviews .review { display: flex; gap: 10px; margin: 8px 0; padding: 0; }
.review p { margin: 0; font-style: italic; }
.review cite { font-size: .8rem; color: var(--muted); font-style: normal; }
.stars { color: var(--gold); font-style: normal; letter-spacing: 1px; }
.face { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex: 0 0 38px; background: #eee3c6; }
.face.big, .face-ph.big { width: 64px; height: 64px; flex-basis: 64px; font-size: 28px; line-height: 64px; }
.face-ph { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 50%; background: #e7dcc0; color: var(--ink2); text-align: center; line-height: 38px; font-weight: 700; }

/* ---- Cégeim */
.biz-row { display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; gap: 4px 12px; align-items: center; width: 100%; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.biz-row .sign, .biz-row .sign-ph { grid-row: 1 / 3; width: 76px; font-size: .78rem; }
.biz-row-t { display: flex; flex-direction: column; min-width: 0; }
.biz-row-t b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.biz-row-n { display: flex; flex-direction: column; align-items: flex-end; font-weight: 700; font-variant-numeric: tabular-nums; }
.biz-row .spark { grid-column: 2 / 4; justify-self: end; }
.biz-row.on { border-color: var(--leaf); box-shadow: 0 0 0 2px #cfe3c3; }
.biz-head { display: flex; gap: 12px; align-items: center; }
.biz-head .sign { width: 110px; }
.biz-head h2 { margin: 0; }
.accounts summary { cursor: pointer; color: var(--green2); font-weight: 600; padding: 4px 0; }
.person { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid #efe7d2; }
.person-t { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.person-w { font-variant-numeric: tabular-nums; font-size: .9rem; white-space: nowrap; }
.kinds { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 10px 0; }
.kind { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; text-align: left; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper2); cursor: pointer; font: inherit; color: inherit; }
.kind .sign { width: 100%; max-width: 140px; }
.kind.on { border-color: var(--green2); box-shadow: 0 0 0 2px #cfe3c3; background: #f4f8ee; }
.kind.locked { opacity: .55; cursor: default; }
.danger-zone { background: transparent; box-shadow: none; border-style: dashed; text-align: center; }
.split { display: block; }

/* ---- Piac */
.offer { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.offer:last-child { border-bottom: 0; }
.form { display: flex; flex-wrap: wrap; gap: 0 10px; }

/* ---- Falu */
.level { margin: 0 0 8px; }
.level-badge { display: inline-block; background: var(--green2); color: #fff; padding: 2px 10px; border-radius: 99px; font-weight: 700; }
.level-row { display: grid; grid-template-columns: minmax(110px, 1fr) 2fr auto; gap: 10px; align-items: center; margin: 7px 0; font-size: .9rem; }
.split-bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; margin: 8px 0; }
.split-res { background: var(--leaf); } .split-com { background: #d9b36a; }
.wishes { margin: 0; padding: 0; list-style: none; }
.wishes li { display: grid; grid-template-columns: 26px 1fr 1fr; gap: 8px; align-items: center; margin: 6px 0; }

/* ---- Hírmondó */
.paper { background: #fbf8ef; border: 1px solid #ddd2b4; border-radius: 6px; padding: 16px; box-shadow: var(--shadow); font-family: Georgia, "Times New Roman", serif; }
.paper-head { text-align: center; border-bottom: 3px double #3b3326; padding-bottom: 8px; margin-bottom: 10px; }
.masthead { width: 100%; max-width: 560px; height: auto; }
.mast-ph { display: flex; flex-direction: column; align-items: center; }
.mast-t { font-size: 2.3rem; font-weight: 700; letter-spacing: .04em; font-variant: small-caps; line-height: 1; }
.mast-s { font-size: .8rem; font-style: italic; color: var(--ink2); margin-top: 4px; }
.paper-meta { display: flex; justify-content: space-between; font-size: .76rem; color: var(--ink2); border-top: 1px solid #3b3326; margin-top: 8px; padding-top: 4px; gap: 8px; flex-wrap: wrap; }
.paper-day { margin: 12px 0 16px; }
.paper-date { font-size: .9rem; text-transform: uppercase; letter-spacing: .08em; border-bottom: 1px solid #cfc3a3; padding-bottom: 3px; color: var(--ink2); }
.paper-lines { margin: 0; padding: 0; list-style: none; }
.paper-lines li { margin: 7px 0; line-height: 1.45; }
.paper-day.first .paper-lines li.lead { font-size: 1.12rem; font-weight: 700; }
.pk { margin-right: 6px; font-family: system-ui; }

/* ---- Én */
.me-head { display: flex; gap: 14px; align-items: center; }
.titles { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.title { background: #fff6dc; border: 1px solid #ecd28f; border-radius: 99px; padding: 3px 10px; font-size: .85rem; }
.loan { border-bottom: 1px dashed var(--line); padding-bottom: 6px; }
.signin form { margin-top: 8px; }

/* ---- toasts and the day flash */
#toast-root { position: fixed; z-index: 60; left: 0; right: 0; bottom: calc(var(--tabs-h) + var(--safe-b) + 10px); display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.toast { max-width: min(92vw, 460px); background: #2f3a2f; color: #fff; padding: 10px 14px; border-radius: 12px; box-shadow: 0 4px 16px rgba(0,0,0,.2); opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; }
.toast.in { opacity: 1; transform: none; }
.toast.out { opacity: 0; }
.toast.good { background: #2f5a3a; } .toast.bad { background: #8d3a2f; }
#dayflash { position: fixed; z-index: 30; left: 50%; top: calc(var(--top-h) + 12px); transform: translate(-50%, -20px); background: #fff7df; border: 1px solid #e6c983; color: var(--green);
  font-family: Georgia, serif; font-weight: 700; padding: 8px 18px; border-radius: 99px; box-shadow: 0 6px 20px rgba(60,45,20,.18); opacity: 0; pointer-events: none; white-space: nowrap; }
#dayflash.go { animation: dayFlash 3.2s ease-in-out forwards; }
@keyframes dayFlash { 0% { opacity: 0; transform: translate(-50%, -20px); } 12% { opacity: 1; transform: translate(-50%, 0); } 80% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, -10px); } }

/* ---- wide screens: a sidebar */
@media (min-width: 900px) {
  :root { --tabs-h: 0px; }
  #app { display: grid; grid-template-columns: 200px 1fr; grid-template-rows: var(--top-h) 1fr; }
  #top { grid-column: 1 / -1; }
  #tabs { position: sticky; top: var(--top-h); height: calc(100dvh - var(--top-h)); flex-direction: column; justify-content: flex-start; gap: 2px; padding: 12px 8px; border-top: 0; border-right: 1px solid var(--line); box-shadow: none; }
  .tab { flex: 0 0 auto; flex-direction: row; justify-content: flex-start; gap: 10px; padding: 10px 12px; border-radius: 10px; font-size: .95rem; }
  .tab:hover { background: #f1e8d0; }
  .tab.on { background: #e8efdf; }
  .tab.on::before { display: none; }
  .tab .badge { position: static; margin-left: auto; }
  .tab-n { position: static; margin-left: auto; font-size: .78rem; }
  #screen { padding: 18px 24px 30px; max-width: 1100px; width: 100%; margin: 0; }
  #screen[data-screen=terkep] { height: calc(100dvh - var(--top-h)); padding-bottom: 16px; }
  #screen[data-screen=ma], #screen[data-screen=falu], #screen[data-screen=en] { columns: 2 380px; column-gap: 14px; }
  #screen[data-screen=ma] > .card, #screen[data-screen=falu] > .card, #screen[data-screen=en] > .card { break-inside: avoid; }
  .split { display: grid; grid-template-columns: minmax(280px, 360px) 1fr; gap: 14px; align-items: start; }
  .split .back { display: none; }
  #sheet-root .sheet { left: auto; top: var(--top-h); right: 0; bottom: 0; width: 440px; max-height: none; border-radius: 0; animation: sheetIn .2s ease-out; }
  #sheet-root .sheet::before { display: none; }
  #sheet-root .sheet-back { background: rgba(40, 32, 18, .14); }
  #toast-root { bottom: 20px; }
  .money-float { right: 56px; }
}
@keyframes sheetIn { from { transform: translateX(30px); opacity: .5; } to { transform: none; opacity: 1; } }
@media (max-width: 899px) { .hide-narrow { display: none; } }

/* ---- a landscape phone: the tabs as a rail on the left, a slim header */
@media (max-height: 500px) and (orientation: landscape) and (max-width: 1000px) {
  :root { --top-h: 40px; --tabs-h: 0px; --rail: 64px; }
  #top { padding-left: calc(var(--rail) + 10px + var(--safe-l)); }
  .brand { flex-direction: row; align-items: baseline; gap: 10px; }
  .brand-day { max-width: 40vw; }
  #tabs { top: 0; bottom: 0; right: auto; width: calc(var(--rail) + var(--safe-l)); height: 100dvh; padding: 4px 0 4px var(--safe-l); flex-direction: column; border-top: 0; border-right: 1px solid var(--line); z-index: 25; }
  .tab { font-size: .6rem; gap: 0; }
  .tab-ico, .tab .ico-ph { width: 22px; height: 22px; font-size: 17px; line-height: 22px; }
  .tab.on::before { top: 20%; bottom: 20%; left: 0; right: auto; width: 3px; height: auto; border-radius: 0 3px 3px 0; }
  .tab .badge { top: 2px; left: calc(50% + 4px); }
  #screen { padding: 10px calc(12px + var(--safe-r)) 20px calc(var(--rail) + 12px + var(--safe-l)); max-width: none; }
  #screen[data-screen=terkep] { height: calc(100dvh - var(--top-h)); padding-bottom: 8px; }
  #screen[data-screen=ma], #screen[data-screen=falu], #screen[data-screen=en] { columns: 2 300px; column-gap: 12px; }
  #screen > .card { break-inside: avoid; }
  .map-hint { display: none; }
  #sheet-root .sheet { left: auto; top: 0; width: min(440px, 62vw); max-height: none; border-radius: 16px 0 0 16px; padding-bottom: 14px; }
  #toast-root { bottom: 10px; }
  #dayflash { top: 48px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media (max-width: 420px) { .stat-v { font-size: .95rem; letter-spacing: -.01em; } .stat { padding: 8px 3px; } }
.kjback { background: rgba(255,255,255,.14); border: 0; color: #fdf8e8; width: 34px; height: 34px; border-radius: 50%; font-size: 1.1rem; cursor: pointer; }
