/* app-core — the common look ("Tiszta, kontrasztos"): colours, type, header, user menu, dialogs, filters,
   list column, cards, details panel frame, sign-in, phone layout. The app adds its own rules in its css. */
:root {
  --bg: #ffffff; --surf: #ffffff; --band: #f7f8f9; --line: #e3e5e8; --line2: #d5d8dc;
  --ink: #15171a; --mute: #5b6068; --soft: #3d4148;
  --ind: #4c5bd4; --indt: #3a47b0; --indbg: #eef0fc;
  --tq: #0b766f; --tqt: #0b5f59; --tqbg: #e9f6f4;
  --amb: #8a4f0a; --ambbg: #fbf0e1; --ambline: #c98a3d;
  --hl: #fff1a8; --dark: #15171a; --onDark: #ffffff;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) {
    --bg: #121315; --surf: #17181b; --band: #1c1d21; --line: #2c2e33; --line2: #3a3d43;
    --ink: #eceef1; --mute: #a1a6ae; --soft: #c4c8ce;
    --ind: #8a95f0; --indt: #aab3ff; --indbg: #23284a;
    --tq: #3cc2b6; --tqt: #7fe0d6; --tqbg: #133532;
    --amb: #e7aa5c; --ambbg: #3a2a14; --ambline: #a7732f;
    --hl: #5a4d10; --dark: #eceef1; --onDark: #121315;
    color-scheme: dark;
  }
}
/* chosen in the header (app-core 2): the attribute on <html> wins over the system setting */
:root[data-theme=light] { color-scheme: light; }
:root[data-theme=dark] {
    --bg: #121315; --surf: #17181b; --band: #1c1d21; --line: #2c2e33; --line2: #3a3d43;
    --ink: #eceef1; --mute: #a1a6ae; --soft: #c4c8ce;
    --ind: #8a95f0; --indt: #aab3ff; --indbg: #23284a;
    --tq: #3cc2b6; --tqt: #7fe0d6; --tqbg: #133532;
    --amb: #e7aa5c; --ambbg: #3a2a14; --ambline: #a7732f;
    --hl: #5a4d10; --dark: #eceef1; --onDark: #121315;
    color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); font: 14px/1.45 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif; }
#app { height: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
button:disabled { cursor: default; }
a { color: var(--indt); }
.mono { font-family: 'IBM Plex Mono', ui-monospace, Consolas, monospace; font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--pa, var(--ind)); outline-offset: 2px; }
.ico { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; margin-right: 6px; color: var(--mute); }
.ico.after { margin: 0 0 0 6px; }
.note { font-size: 12px; color: var(--mute); }
mark { background: var(--hl); color: inherit; border-radius: 2px; }
.flabel { font-size: 11px; font-weight: 600; color: var(--mute); text-transform: uppercase; letter-spacing: .06em; }

.app { display: flex; flex-direction: column; height: 100%; }
.app > .topbar { flex: none; }

/* top bar */
.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; min-height: 56px; padding: 0 20px; border-bottom: 1px solid var(--line); background: var(--surf); }
.tright { flex: 1 1 auto; display: flex; align-items: center; gap: 8px; min-width: 0; }
.tsearch { flex: 1 1 auto; display: flex; gap: 6px; min-width: 0; padding: 8px 0; }
.tright .umenu { margin-left: auto; }
/* wide screens: header columns line up with the page columns */
@media (min-width: 1100px) {
  .topbar.cols3, .topbar.cols2 { display: grid; gap: 0; padding: 0; align-items: stretch; }
  .topbar.cols3 { grid-template-columns: 240px minmax(380px, 540px) minmax(0, 1fr); }
  .topbar.cols2 { grid-template-columns: minmax(380px, 580px) minmax(0, 1fr); }
  .topbar .brand { padding: 0 18px; }
  .topbar.cols2 .brand, .topbar.cols2 .tnav { grid-column: 1; grid-row: 1; }
  .topbar.cols2 .tnav { padding-left: 150px; }
  .topbar.cols2 .tright { grid-column: 2; }
  .topbar .tnav { justify-content: space-between; gap: 8px; padding: 0 18px; }
  .topbar .tright { padding: 0 20px; }
}
.topbar .logout { width: 40px; }
/* signed-in user (0.4.0): first name in the header, menu with members / password / sign-out */
.umenu { position: relative; flex: 0 0 auto; }
.ibtn.user { gap: 8px; padding: 0 10px 0 6px; max-width: 220px; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--band); border: 1px solid var(--line2); font-weight: 600; font-size: 13px; flex: 0 0 auto; }
.uname { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.uhh { color: var(--mute); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.umenu .menu { min-width: 280px; }
/* user menu: coloured head, workspace row, items with icons, footer, sign-out button */
.uhead { display: flex; align-items: center; gap: 10px; margin: -4px -4px 0; padding: 12px; border-radius: 6px 6px 0 0; background: var(--indbg); }
.avatar.big { width: 40px; height: 40px; font-size: 16px; background: var(--ind); border-color: var(--ind); color: #fff; }
.uwho { display: flex; flex-direction: column; min-width: 0; font-size: 12px; color: var(--soft); }
.uwho b { color: var(--ink); font-size: 15px; }
.uwho span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uws { display: flex; align-items: center; gap: 8px; padding: 9px 10px 5px; font-size: 13px; color: var(--soft); }
.uws .ico { margin: 0; }
.uws .mlabel { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rolechip { font-size: 11px; font-weight: 600; color: var(--indt); background: var(--indbg); border-radius: 4px; padding: 1px 7px; white-space: nowrap; }
.menu button.mitem { display: flex; align-items: center; gap: 10px; }
.mitem .ico { margin: 0; }
.mitem .mlabel { flex: 1; }
.mitem kbd { font-size: 11px; border: 1px solid var(--line2); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; color: var(--mute); }
.menu button.mout { display: flex; align-items: center; justify-content: center; gap: 8px; width: calc(100% - 8px); margin: 2px 4px 4px; height: 36px; }
.menu button.mout:hover { background: var(--band); }
.mout .ico { margin: 0; color: inherit; }
/* dialogs (members, password) */
.dlgwrap { position: fixed; inset: 0; background: rgba(0, 0, 0, .35); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; z-index: 8; overflow: auto; }
.dlg { width: min(620px, 100%); background: var(--surf); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 16px 40px rgba(0, 0, 0, .2); }
.dlghead { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.dlghead h2 { font-size: 16px; }
.dlg .x { display: inline-flex; }
.dlgbody { padding: 16px; display: flex; flex-direction: column; gap: 18px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack h3 { font-size: 14px; }
.row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.row2 > .field { min-width: 0; }
.row2 .field input { width: 100%; }
.field select { height: 40px; padding: 0 8px; border: 1px solid var(--line2); border-radius: 6px; background: var(--surf); color: var(--ink); font: inherit; }
.role { font-size: 12px; border: 1px solid var(--line2); border-radius: 4px; padding: 1px 6px; white-space: nowrap; }
.role-owner { border-color: var(--ind); color: var(--indt); background: var(--indbg); }
.role-editor { border-color: var(--tq); color: var(--tqt); background: var(--tqbg); }
.brand { display: flex; align-items: center; font-weight: 700; font-size: 15px; letter-spacing: -0.01em; white-space: nowrap; }
.brand .logo { width: 24px; height: 24px; border-radius: 6px; margin-right: 8px; flex: none; }
.brand .logo.big { width: 48px; height: 48px; border-radius: 11px; margin-right: 12px; }
.teszt { display: inline-block; margin-left: 8px; font-size: 10px; font-weight: 600; letter-spacing: .06em; color: var(--amb); border: 1px solid var(--ambline); border-radius: 4px; padding: 0 4px; }
.tnav { display: flex; gap: 20px; align-self: stretch; }
.nav { display: flex; align-items: center; gap: 0; color: var(--mute); border-bottom: 2px solid transparent; padding-top: 2px; white-space: nowrap; }
.nav:hover { color: var(--ink); }
.nav.on { color: var(--ink); font-weight: 600; border-bottom-color: var(--dark); }
.nav-ico { width: 17px; height: 17px; margin-right: 7px; color: inherit; }

/* multi-select filters (checkbox rows with hit counts) */
.chk { display: flex; flex-direction: column; gap: 1px; }
.chk .more { align-self: flex-start; margin: 4px 0 0 26px; }
.ck { display: flex; align-items: center; gap: 8px; min-height: 30px; padding: 0 2px; border-radius: 4px; cursor: pointer; }
.ck:hover { background: var(--band); }
.ck input { width: 16px; height: 16px; margin: 0; accent-color: var(--pa); flex: none; }
.ck .ico { margin: 0; width: 15px; height: 15px; }
.ck .cl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ck .n { color: var(--mute); font-size: 12px; }
.ck .n.warn { color: var(--amb); }
.ck.on .cl { font-weight: 600; }
.ck.dis { opacity: .4; cursor: default; }
/* date range */
.drange { position: relative; }
.dbtn { display: flex; align-items: center; width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--line2); border-radius: 6px; background: var(--surf); font-size: 13px; }
.dbtn .mono { flex: 1; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.dbtn.on { border-color: var(--pa); background: var(--pabg); color: var(--pat); }
.dbtn.on .ico { color: var(--pat); }
.dpop { position: absolute; left: 0; right: 0; top: 40px; z-index: 7; background: var(--surf); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 8px 20px rgba(0, 0, 0, .12); padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.presets { display: flex; flex-direction: column; gap: 4px; }
.presets .ibtn { justify-content: space-between; width: 100%; font-size: 13px; }
.presets .n { color: var(--mute); font-size: 12px; }
.mhead { display: flex; align-items: center; justify-content: space-between; font-weight: 600; font-size: 13px; }
.mhead .ibtn.sq { width: 30px; height: 30px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal .wd { font-size: 10px; color: var(--mute); text-align: center; padding: 2px 0; }
.day { height: 28px; border-radius: 4px; font-size: 12px; font-family: 'IBM Plex Mono', monospace; position: relative; }
.day:hover { background: var(--band); }
.day.has::after { content: ''; position: absolute; left: 50%; bottom: 3px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--pa); }
.day.today { box-shadow: inset 0 0 0 1px var(--line2); }
.day.in { background: var(--pabg); color: var(--pat); }
.day.edge { background: var(--pa); color: #fff; font-weight: 600; }
.day.edge::after { background: #fff; }
.dfoot { display: flex; justify-content: space-between; align-items: center; }

.ck.dis:hover { background: none; }
.fha { display: flex; align-items: center; gap: 10px; }

/* main grid */
.body { flex: 1; min-height: 0; display: grid; grid-template-columns: 240px minmax(380px, 540px) minmax(0, 1fr); }
.body.nof { grid-template-columns: minmax(380px, 580px) minmax(0, 1fr); }
.fcol { border-right: 1px solid var(--line); overflow: auto; padding: 16px 18px 40px; min-width: 0; }
.fh { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 34px; margin-bottom: 14px; }
.fh b { font-weight: 600; }
.fg { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; min-width: 0; }
.fg select { width: 100%; height: 34px; padding: 0 8px; border: 1px solid var(--line2); border-radius: 6px; background: var(--surf); color: var(--ink); font: inherit; }
.fg select.on, .dates input.on { border-color: var(--pa); background: var(--pabg); }
.fpanel { margin-top: 10px; border: 1px solid var(--line); border-radius: 6px; padding: 12px; }
.fpanel .fh { margin: 0; }

.mainc { display: flex; flex-direction: column; min-height: 0; min-width: 0; border-right: 1px solid var(--line); }
.top { padding: 16px 18px 8px; }
.titlerow { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tit { display: flex; align-items: baseline; gap: 10px; }
.tact { display: flex; align-items: center; gap: 8px; }
.titlerow .add { height: 34px; }
.ibtn.small { height: 34px; }
h1 { font-size: 20px; font-weight: 700; margin: 0; }
.count { font-size: 12px; color: var(--mute); }
.add { display: inline-flex; align-items: center; height: 40px; padding: 0 14px; border-radius: 6px; background: var(--dark); color: var(--onDark); font-weight: 600; white-space: nowrap; }
.add .ico { color: inherit; }
.srow { display: flex; gap: 6px; margin-top: 12px; }
.search { flex: 1; min-width: 0; display: flex; align-items: center; height: 40px; padding: 0 10px; border: 1px solid var(--line2); border-radius: 6px; background: var(--surf); }
.search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: var(--ink); font: inherit; }
.search:focus-within { border-color: var(--pa); box-shadow: 0 0 0 1px var(--pa); }
kbd { font-size: 11px; color: var(--mute); border: 1px solid var(--line2); border-radius: 4px; padding: 0 5px; }
.ibtn { display: inline-flex; align-items: center; height: 40px; padding: 0 12px; border: 1px solid var(--line2); border-radius: 6px; background: var(--surf); white-space: nowrap; }
.ibtn .ico { color: var(--ink); }
.ibtn.sq { width: 44px; justify-content: center; padding: 0; }
.ibtn.sq .ico { margin: 0; width: 18px; height: 18px; }
.fh .ibtn.sq { width: 34px; height: 34px; }
.ibtn.on { border-color: var(--pa); background: var(--pabg); color: var(--pat); }
.ibtn.on .ico { color: var(--pat); }
.ibtn b { background: var(--pa); color: #fff; border-radius: 4px; padding: 0 5px; font-size: 11px; margin-left: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; border: 1px solid var(--line2); border-radius: 4px; padding: 2px 4px 2px 8px; background: var(--surf); color: var(--soft); }
.chip .ico { margin: 0; width: 13px; height: 13px; }

/* list */
.tools { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 2px 18px 6px; min-height: 28px; }
.linkbtn { font-size: 13px; color: var(--indt); }
.linkbtn:hover { text-decoration: underline; }
.list { overflow: auto; flex: 1; padding: 0 14px 80px; }
.gh { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; width: 100%; background: var(--bg); padding: 10px 4px 6px; text-align: left; font-size: 11px; font-weight: 600; color: var(--mute); text-transform: uppercase; letter-spacing: .06em; }
.gh .ico { width: 14px; height: 14px; margin-right: 4px; }
.gh .gn { text-transform: none; letter-spacing: 0; margin-left: 6px; }
.card { display: block; width: 100%; text-align: left; background: var(--surf); border: 1px solid var(--line); border-radius: 6px; margin: 0 0 8px; overflow: hidden; scroll-margin-top: 44px; }
.card:hover { border-color: var(--line2); }
.empty { color: var(--mute); text-align: center; padding: 40px 10px; }
.empty.full { padding-top: 20vh; }

/* details panel */
aside.panel { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--surf); }
.psec { padding: 16px 20px; min-height: 0; overflow: auto; }
.sh { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.sech { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin: 0; }
.acts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; position: relative; }
.btn { display: inline-flex; align-items: center; height: 34px; padding: 0 12px; border: 1px solid var(--line2); border-radius: 6px; background: var(--surf); white-space: nowrap; }
.btn .ico { color: inherit; }
.btn.icon { width: 34px; padding: 0; justify-content: center; }
.btn.icon .ico { margin: 0; color: var(--ink); }
.menu { position: absolute; right: 0; top: 40px; background: var(--surf); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 8px 20px rgba(0, 0, 0, .12); z-index: 6; min-width: 200px; padding: 4px; }
.menu button { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 4px; }
.menu button:hover { background: var(--band); }
.ttl { font-size: 18px; font-weight: 700; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.ttl.small { font-size: 15px; font-weight: 600; }
.ttl .boxc .ico { width: 18px; height: 18px; }
.path { color: var(--mute); font-size: 13px; margin-top: 2px; }
.lnk { color: var(--indt); cursor: pointer; text-decoration: none; }
.lnk:hover { text-decoration: underline; }
.meta { font-size: 13px; color: var(--mute); margin-top: 4px; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.warnbox { display: flex; gap: 8px; margin: 12px 0; border: 1px solid var(--ambline); background: var(--ambbg); color: var(--amb); border-radius: 6px; padding: 8px 10px; }
.warnbox .ico { color: var(--amb); margin: 2px 0 0; }
.warnbox .note { color: var(--amb); }
/* Notice (app-core 3): information and the reason of a refusal, in an amber box; errors stay in the red box. */
.notice { margin: 8px 0; border: 1px solid var(--ambline); background: var(--ambbg); color: var(--amb); border-radius: 6px; padding: 10px 12px; font-size: 14px; line-height: 1.5; }
.fprow.act, .pkrow.act { background: var(--band); box-shadow: inset 3px 0 0 var(--pa, var(--ind)); }
.sec { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 12px; }
.sec h3 { font-size: 11px; font-weight: 600; color: var(--mute); text-transform: uppercase; letter-spacing: .06em; margin: 0 0 6px; }
dl.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); margin: 12px 0 0; border-top: 1px solid var(--line); }
dl.kv dt { color: var(--mute); padding: 8px 16px 8px 0; border-bottom: 1px solid var(--line); }
dl.kv dd { margin: 0; padding: 8px 0; border-bottom: 1px solid var(--line); min-width: 0; overflow-wrap: anywhere; }
.back { display: none; align-items: center; color: var(--tq); margin-bottom: 8px; }
.back .ico { color: inherit; margin-right: 2px; }
.x { display: none; width: 34px; height: 34px; align-items: center; justify-content: center; }
.x .ico { margin: 0; color: var(--ink); width: 20px; height: 20px; }

/* sign-in */
.authwrap { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth { width: min(360px, 100%); display: flex; flex-direction: column; gap: 14px; border: 1px solid var(--line); border-radius: 6px; padding: 24px; }
.auth h1 { font-size: 18px; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--mute); }
.field input { height: 40px; padding: 0 10px; border: 1px solid var(--line2); border-radius: 6px; background: var(--surf); color: var(--ink); font: inherit; }
.err { color: #b42318; font-size: 13px; }
.btn.dark { background: var(--dark); border-color: var(--dark); color: var(--onDark); font-weight: 600; justify-content: center; height: 40px; }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--dark); color: var(--onDark); padding: 8px 14px; border-radius: 6px; font-size: 14px; z-index: 9; max-width: 90vw; }
nav.bottom { display: none; }

/* below 1100 px: no filter column (filters drop down), panel slides in; with an item open it shows the item */
@media (max-width: 1099px) {
  .body, .body.nof { grid-template-columns: 1fr; }
  .mainc { border: 0; }
  aside.panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 94vw); border-left: 1px solid var(--line); box-shadow: -8px 0 24px rgba(0, 0, 0, .12); transform: translateX(105%); transition: transform .2s; z-index: 5; overflow: auto; display: block; padding-top: env(safe-area-inset-top, 0px); }
  aside.panel.open { transform: none; }
  .x { display: inline-flex; }
}
/* phone: bottom menu, panel as a sheet */
@media (max-width: 699px) {
  .uname, .uhh { display: none; }
  .ibtn.user { padding: 0; width: 44px; justify-content: center; }
  .topbar { position: relative; }
  .umenu { position: absolute; right: 12px; top: 6px; }
  .row2 { grid-template-columns: 1fr; }
  .dlgwrap { padding: 0; }
  .dlg { min-height: 100%; border-radius: 0; }
  .topbar .tnav { display: none; }
  .topbar { padding: 0 12px; }
  .topbar .brand { flex: 1; min-height: 52px; }
  .tsearch { order: 9; flex-basis: 100%; padding-top: 0; }
  .top { padding: 12px 12px 6px; }
  .list { padding: 0 10px 140px; }
  nav.bottom { display: flex; position: fixed; left: 0; right: 0; bottom: 0; background: var(--surf); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); z-index: 4; }
  nav.bottom .nav { flex: 1; flex-direction: column; justify-content: center; gap: 2px; font-size: 11px; min-height: 56px; border-bottom: 0; border-top: 2px solid transparent; padding: 0; }
  nav.bottom .nav.on { border-top-color: var(--dark); }
  nav.bottom .nav-ico { margin: 0; }
  aside.panel { top: auto; left: 0; width: auto; height: 88%; border-radius: 10px 10px 0 0; transform: translateY(105%); }
  .titlerow .add, .add { position: fixed; right: 16px; bottom: calc(72px + env(safe-area-inset-bottom, 0px)); height: 48px; border-radius: 24px; z-index: 3; box-shadow: 0 4px 12px rgba(0, 0, 0, .2); }
  .ibtn, .search { height: 44px; }
}
@media (prefers-reduced-motion: reduce) { aside.panel { transition: none; } }
.empty .ver { margin-top: 12px; }
.tagline { font-style: italic; }
.empty .tagline { margin-top: 12px; }

/* app-core 1 additions: menu marks, changelog, workspace backups, search in long filter lists */
:root { --red: #b42318; --redbg: #fdf0ef; }
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) { --red: #ff8a7a; --redbg: #3a1a17; } }
:root[data-theme=dark] { --red: #ff8a7a; --redbg: #3a1a17; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ind); flex: none; }
.ibtn.user { position: relative; }
.dot.corner { position: absolute; top: -4px; right: -4px; width: 10px; height: 10px; border: 2px solid var(--surf); box-sizing: content-box; }
.menu button.split { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.msep { height: 1px; background: var(--line); margin: 4px 0; }
.dlg.mid { width: min(660px, 100%); }
.dlg.wide { width: min(780px, 100%); }
.btn.tall { height: 40px; padding: 0 14px; }
.btn.dark { padding: 0 14px; }
.btn.small { height: 32px; padding: 0 10px; font-size: 13px; }
.btn:disabled { opacity: .45; }
.vhide { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.note.lead { font-size: 13px; line-height: 1.5; margin: 0; }
.newtag { font-size: 11px; color: var(--indt); background: var(--indbg); border-radius: 4px; padding: 1px 6px; }
.dlgfoot { display: flex; justify-content: flex-end; gap: 8px; }
.errbox { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border: 1px solid var(--red); border-radius: 6px; background: var(--redbg); color: var(--red); line-height: 1.5; }
.errbox span { color: var(--soft); font-size: 13px; }
.err { color: var(--red); }
/* changelog */
.clog { display: flex; flex-direction: column; max-height: min(64vh, 620px); overflow: auto; margin: -4px -4px -4px 0; padding: 4px 8px 4px 0; }
.clv + .clv { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 14px; }
.clh { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.clh h3 { margin: 0; font-size: 18px; }
.cld { font-size: 13px; color: var(--mute); }
.clt { margin-top: 12px; }
.clt h4 { margin: 0 0 4px; font-size: 15px; font-weight: 700; color: var(--ink); }
.clv ul { list-style: none; margin: 0; padding: 0; line-height: 1.5; color: var(--soft); }
.clv li { display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 10px; align-items: baseline; padding: 3px 0; }
.cltag { justify-self: start; font-size: 11px; font-weight: 600; letter-spacing: .02em; border-radius: 4px; padding: 1px 7px; white-space: nowrap; }
.cltag.k-added { color: var(--tqt); background: var(--tqbg); }
.cltag.k-changed { color: var(--indt); background: var(--indbg); }
.cltag.k-fixed { color: var(--amb); background: var(--ambbg); }
.clv p.note { margin: 8px 0 0; font-size: 13px; }
/* backups */
.bkact { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bkh { margin-bottom: 8px; letter-spacing: .08em; }
.bkh .mono { letter-spacing: 0; }
.bklist { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 6px; }
.bkrow { display: grid; grid-template-columns: 150px 140px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 14px; }
.bkrow + .bkrow { border-top: 1px solid var(--line); }
.bkd { font-size: 13px; }
.bkind { justify-self: start; font-size: 12px; border-radius: 4px; padding: 1px 7px; background: var(--band); border: 1px solid var(--line2); color: var(--soft); white-space: nowrap; }
.bkind.k-manual { background: var(--indbg); border-color: var(--ind); color: var(--indt); }
.bkind.k-pre_restore { background: var(--ambbg); border-color: var(--ambline); color: var(--amb); }
.bkbtn { display: flex; gap: 6px; }
.bkleg { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.bkleg .k-daily { color: var(--soft); }
.bkleg .k-manual { color: var(--indt); }
.bkleg .k-pre_restore { color: var(--amb); }
/* comparison before a restore */
.cmpsrc { display: flex; flex-direction: column; gap: 4px; }
.cmpsrc b { font-weight: 500; }
.cmpsrc .note { font-size: 13px; }
table.cmp { width: 100%; border: 1px solid var(--line); border-radius: 6px; border-spacing: 0; border-collapse: separate; }
table.cmp th, table.cmp td { padding: 9px 8px; text-align: left; font-weight: 400; }
table.cmp th:first-child { padding-left: 14px; }
table.cmp th:last-child, table.cmp td:last-child { padding-right: 14px; }
table.cmp thead th { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--mute); white-space: nowrap; }
table.cmp .num { text-align: right; font-size: 13px; }
table.cmp thead th.num { font-size: 11px; }
table.cmp tbody th, table.cmp tbody td { border-top: 1px solid var(--line); }
table.cmp tr.hot { background: var(--band); }
table.cmp td.unchanged, table.cmp td.zero { color: var(--mute); }
table.cmp td.changed, .cmpleg .c-changed { color: var(--indt); }
table.cmp td.restored, .cmpleg .c-restored { color: var(--tq); }
table.cmp td.deleted, .cmpleg .c-deleted { color: var(--red); }
table.cmp td.zero { color: var(--mute); }
.cmpleg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 20px; line-height: 1.45; }
.cmpleg .c-match { color: var(--soft); }
.cmpwarn { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; background: var(--ambbg); border: 1px solid var(--ambline); border-radius: 6px; font-size: 13px; color: var(--amb); line-height: 1.5; }
.agree { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.agree input { width: 18px; height: 18px; margin: 0; accent-color: var(--dark); flex: none; }
/* search in a long filter list */
.fsearch { display: flex; align-items: center; height: 34px; padding: 0 4px 0 10px; margin: 0 0 4px; border: 1px solid var(--line2); border-radius: 6px; background: var(--surf); }
.fsearch .ico { width: 14px; height: 14px; }
.fsearch input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: var(--ink); font: inherit; font-size: 13px; }
.fsearch:focus-within { border-color: var(--pa); box-shadow: 0 0 0 1px var(--pa); }
.fsearch .fx { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 4px; }
.fsearch .fx .ico { margin: 0; }
.fhits { margin: 4px 2px 2px; }
@media (max-width: 699px) {
  .dlg.mid, .dlg.wide { width: 100%; }
  .clog { max-height: none; overflow: visible; }
  .bkrow { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; }
  .bkrow .bks { grid-column: 1 / -1; }
  .bkrow .bkbtn { grid-column: 1 / -1; }
  .btn.small { height: 40px; }
  .fsearch { height: 44px; }
  .fsearch .fx { width: 40px; height: 40px; }
  .cmpleg { grid-template-columns: 1fr; }
  table.cmp, table.cmp tbody, table.cmp tr, table.cmp tbody th, table.cmp td { display: block; }
  table.cmp thead { display: none; }
  table.cmp tbody tr { padding: 10px 14px; }
  table.cmp tbody tr + tr { border-top: 1px solid var(--line); }
  table.cmp tbody th, table.cmp tbody th:first-child { border: 0; padding: 0 0 4px; font-weight: 600; }
  table.cmp tbody td, table.cmp tbody td:last-child { display: inline-block; border: 0; padding: 0 14px 2px 0; text-align: left; }
  table.cmp tbody td.zero { display: none; }
  table.cmp td::before { content: attr(data-label) ' '; font-family: 'IBM Plex Sans', system-ui, sans-serif; color: var(--mute); }
}
/* the version line at the bottom of the user menu */
.mfoot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 4px 6px; padding: 8px 4px 6px; border-top: 1px solid var(--line); font-size: 12px; color: var(--mute); }
.mver { white-space: nowrap; }
.menu .mfoot .mlog { display: inline-flex; align-items: center; gap: 6px; width: auto; padding: 0; font-size: 12px; white-space: nowrap; }
.menu .mfoot .mlog:hover { background: none; }
/* pages (changelog, backups, the app's own): instead of the main view, under the same header */
.pageview { min-height: 100vh; }
.pgwrap { display: flex; justify-content: center; padding: 24px 20px 48px; }
.pg { width: min(760px, 100%); display: flex; flex-direction: column; gap: 16px; }
.pg.wide { width: min(920px, 100%); }
.pghead { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.pghead h1 { margin: 0; font-size: 22px; }
.pghead .back { display: inline-flex; align-items: center; gap: 4px; }
.pghead .back .ico { width: 16px; height: 16px; margin: 0; }
.pgbody { display: flex; flex-direction: column; gap: 18px; }
.pgbody .clog { max-height: none; overflow: visible; margin: 0; padding: 0; }
.pgbody .clh h3 { font-size: 20px; }
.pgbody .clv ul { font-size: 15px; }
@media (max-width: 699px) {
  .pgwrap { padding: 16px 14px 40px; }
}
/* keyboard shortcuts page; the menu item is hidden on phones (no keyboard there) */
.kbs + .kbs { margin-top: 20px; }
.kbs h3 { margin: 0 0 8px; font-size: 16px; }
.kbl { display: grid; grid-template-columns: minmax(120px, max-content) minmax(0, 1fr); gap: 8px 18px; margin: 0; align-items: baseline; }
.kbl dt { margin: 0; }
.kbl dd { margin: 0; color: var(--soft); line-height: 1.5; }
.kbk { display: inline-flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.kbor { font-size: 12px; color: var(--mute); }
.kbl kbd { display: inline-block; min-width: 26px; text-align: center; padding: 2px 7px; border: 1px solid var(--line2); border-bottom-width: 2px; border-radius: 5px; background: var(--surf); font-size: 13px; color: var(--ink); }
@media (max-width: 699px) { .menu button.mkbd { display: none; } }
@media (max-width: 699px) { .clv li { grid-template-columns: 66px minmax(0, 1fr); gap: 8px; } .cltag { font-size: 10px; padding: 1px 5px; } }

/* app-core 2: colour theme button (header; on a phone a row at the bottom of the user menu) */
.tright .themebtn { margin-left: auto; }
.tright .themebtn + .umenu { margin-left: 0; }
.mtheme { display: none; }
.seg { display: flex; border: 1px solid var(--line2); border-radius: 6px; overflow: hidden; }
.seg button { flex: 1; display: inline-flex; align-items: center; justify-content: center; height: 44px; font-size: 13px; color: var(--soft); }
.seg button + button { border-left: 1px solid var(--line2); }
.seg button.on { background: var(--dark); color: var(--onDark); }
.seg button.on .ico { color: var(--onDark); }
@media (max-width: 699px) {
  .themebtn { display: none; }
  .mtheme { display: flex; flex-direction: column; gap: 6px; padding: 8px 12px 10px; border-top: 1px solid var(--line); }
  .mkbdhint { display: none; }
}
.mitem kbd.mkbdhint { margin-left: auto; font-size: 12px; color: var(--mute); }
/* help page ("Súgó"): search, tabs (glossary, guides, keyboard shortcuts — that tab is hidden on phones) */
.hsearch { max-width: 520px; }
.htabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.htab { padding: 10px 14px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--mute); font-weight: 500; }
.htab.on { color: var(--ink); border-bottom-color: var(--dark); }
.hgloss { display: grid; grid-template-columns: minmax(140px, 220px) minmax(0, 1fr); gap: 12px 24px; margin: 0; }
.hgloss dt { font-weight: 600; margin: 0; }
.hgloss dd { margin: 0; color: var(--soft); line-height: 1.55; }
.hgloss dd p, .hgbody p { margin: 0 0 6px; }
.hgloss ul, .hgbody ul { margin: 0 0 6px; padding-left: 20px; }
.hguides { display: flex; flex-direction: column; gap: 8px; }
.hguide { border: 1px solid var(--line); border-radius: 8px; background: var(--surf); }
.hguide summary { cursor: pointer; padding: 12px 14px; font-weight: 600; }
.hgbody { padding: 0 14px 12px; color: var(--soft); line-height: 1.55; }
.hgbody ol, .hgbody ul li { margin-bottom: 3px; }
.hres h3 { margin: 0 0 10px; font-size: 16px; }
.hres + .hres { margin-top: 8px; }
@media (max-width: 699px) {
  .htab.tkeys { display: none; }
  .hgloss { grid-template-columns: 1fr; gap: 2px; }
  .hgloss dd { margin-bottom: 10px; }
}
/* roadmap page ("Fejlesztési terv"): planned rounds, the next one open */
.rmlist { display: flex; flex-direction: column; gap: 8px; }
.rmround { border: 1px solid var(--line); border-radius: 8px; background: var(--surf); }
.rmhead { display: flex; align-items: center; width: 100%; text-align: left; padding: 12px 14px; font-weight: 600; font-size: 15px; }
.rmbody { padding: 0 14px 12px 36px; color: var(--soft); line-height: 1.55; }
.rmbody ul { margin: 0 0 6px; padding-left: 18px; }
.rmbody li { margin-bottom: 3px; }
.rmfeat { border-top: 1px solid var(--line); }
.rmfhead { display: flex; align-items: baseline; gap: 8px; width: 100%; text-align: left; padding: 9px 0; color: var(--ink); }
.rmfhead .ico { flex: none; align-self: center; }
.rmft { flex: 1; min-width: 0; font-weight: 500; }
.rmchip { flex: none; font-size: 11px; border: 1px solid var(--line2); border-radius: 4px; padding: 0 6px; color: var(--soft); white-space: nowrap; }
.rmchip.rms-ok { color: var(--tqt, #0B766F); border-color: currentColor; }
.rmchip.rms-plan { color: var(--amb); border-color: var(--ambline); }
.rmfields { margin: 0 0 10px 26px; display: grid; grid-template-columns: 130px 1fr; gap: 4px 12px; }
.rmfields dt { color: var(--mute); font-size: 13px; }
.rmfields dd { margin: 0; }
@media (max-width: 699px) { .rmfields { grid-template-columns: 1fr; margin-left: 0; } .rmfields dd { margin-bottom: 6px; } }

/* app-core 2: buttons — one system everywhere (40 px, 44 on phones; small 32 px only in table rows).
   .btn secondary · .btn.pri primary (dark) · .btn.sect section action (section colour, set by the app with --sc)
   · .btn.danger delete that opens a confirmation (red outline) · .btn.danger.fill the confirming delete · .linkbtn
   text · .ibtn.sq / .btn.icon icon only. Starting buttons carry an icon before the text, closing ones none. */
.btn { height: 40px; padding: 0 14px; gap: 0; font-weight: 500; justify-content: center; color: var(--ink); }
.btn .ico { color: inherit; }
.btn.pri, .btn.dark { background: var(--dark); border-color: var(--dark); color: var(--onDark); font-weight: 600; }
.btn.sect { border-color: var(--sc, var(--line2)); color: var(--sc, var(--ink)); font-weight: 600; }
.btn.danger { border-color: var(--red); color: var(--red); }
.btn.danger.fill { background: var(--red); color: #fff; }
:root[data-theme=dark] .btn.danger.fill { color: #1b0a08; }
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) .btn.danger.fill { color: #1b0a08; } }
.btn.icon { width: 40px; }
.btn:disabled, .btn[aria-disabled=true] { opacity: .45; cursor: default; }
@media (max-width: 699px) { .btn { height: 44px; } .btn.icon { width: 44px; } .btn.small { height: 40px; } }
/* forms: one field per row */
.form { display: flex; flex-direction: column; gap: 14px; }
.frow { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.flab { font-size: 13px; font-weight: 600; color: var(--soft); }
.req { color: var(--red); }
.frow input:not([type=checkbox]), .frow textarea, .frow select { width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid var(--line2); border-radius: 6px;
  background: var(--surf); color: var(--ink); font: inherit; }
.frow textarea { resize: vertical; line-height: 1.45; }
.frow input:focus, .frow textarea:focus, .frow select:focus { outline: none; border-color: var(--pa, var(--ind)); box-shadow: 0 0 0 1px var(--pa, var(--ind)); }
.frow.locked input, .frow.locked select, .frow input:disabled, .frow select:disabled { background: var(--band); color: var(--mute); }
.frow.bad input, .frow.bad textarea, .frow.bad select { border-color: var(--red); }
.fhint { font-size: 12px; color: var(--mute); line-height: 1.4; }
.fhint .ico { width: 12px; height: 12px; margin-right: 4px; vertical-align: -1px; }
.ferr { font-size: 12px; color: var(--red); }
.fcheck .ck { min-height: 36px; padding: 0; }
.fcheck .ck input { width: 18px; height: 18px; }
.fcheck .ck .cl { white-space: normal; font-weight: 500; }
.factions { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 4px; }
.factions .fleft, .factions .fright { display: flex; gap: 8px; flex-wrap: wrap; }
.factions .fright { margin-left: auto; }
.kv .emptyv { color: var(--line2); }
.cfdlg { width: min(460px, 100%); }
.cftext { margin: 0; line-height: 1.5; color: var(--soft); }
.cfwrap { z-index: 10; }
@media (max-width: 699px) { .cfdlg { min-height: 0; border-radius: 10px; margin: auto 12px; } .cfwrap { align-items: center; padding: 16px; } }
/* tree as a filter */
.tree { display: flex; flex-direction: column; gap: 1px; }
.tnode { display: flex; align-items: center; min-height: 30px; padding-left: calc(var(--d) * 14px); border-radius: 4px; position: relative; }
.tnode:hover { background: var(--band); }
.tnode.on { background: var(--pabg); }
.tcar { flex: 0 0 18px; height: 22px; display: inline-flex; align-items: center; justify-content: center; color: var(--mute); }
.tcar .ico { margin: 0; width: 13px; height: 13px; }
.tbtn { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; min-height: 30px; text-align: left; padding: 0 4px 0 2px; border-radius: 4px; }
.tbtn .tl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbtn .n { color: var(--mute); font-size: 12px; }
.tbtn.zero .tl { color: var(--mute); }
.tbtn.on { color: var(--pat); font-weight: 600; }
.tbtn.on .n { color: var(--pat); }
.tedit { flex: none; width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; border-radius: 4px; color: var(--pat); }
.tedit:hover { background: var(--surf); }
.tedit .ico { margin: 0; width: 14px; height: 14px; color: inherit; }
.tfoot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 6px; padding-left: 2px; }
.tadd { display: inline-flex; align-items: center; }
.tadd .ico { width: 13px; height: 13px; margin-right: 4px; color: inherit; }
.thcard { position: fixed; z-index: 9; width: 280px; padding: 12px 14px; background: var(--surf); border: 1px solid var(--line2); border-radius: 8px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .16); font-size: 13px; line-height: 1.45; pointer-events: none; }
@media (max-width: 1099px) { .tnode, .tbtn { min-height: 40px; } }
.fchips { display: flex; flex-wrap: wrap; gap: 6px; }
.fchip { min-height: 30px; padding: 0 10px; border: 1px solid var(--line2); border-radius: 15px; background: var(--surf); font-size: 13px; color: var(--soft); }
.fchip:hover { background: var(--band); }
.fchip.on { border-color: var(--pa, var(--ind)); background: var(--pabg, var(--indbg)); color: var(--pat, var(--indt)); font-weight: 600; }
@media (max-width: 699px) { .fchip { min-height: 38px; } }
/* choice list (pickField) and suggestion bar (suggestBar) */
.pickbtn { display: flex; align-items: center; width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid var(--line2); border-radius: 6px; background: var(--surf); color: var(--ink); text-align: left; }
.pickbtn > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.pickbtn.empty > span { color: var(--mute); }
.pickbtn[aria-expanded=true] { border-color: var(--pa, var(--ind)); box-shadow: 0 0 0 1px var(--pa, var(--ind)); }
.fpick { border: 1px solid var(--line2); border-radius: 6px; padding: 8px; display: flex; flex-direction: column; gap: 6px; background: var(--surf); }
.fpick .fsearch input { border: 0; box-shadow: none; min-height: 0; padding: 0; background: transparent; }
.fplist { max-height: 260px; overflow: auto; display: flex; flex-direction: column; }
.fprow { display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 8px; border-radius: 4px; text-align: left; }
.fprow:hover { background: var(--band); }
.fprow.on { background: var(--pabg, var(--indbg)); color: var(--pat, var(--indt)); font-weight: 600; }
.fprow .fpl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fpnew { color: var(--pat, var(--indt)); font-weight: 600; }
.fpnew .ico { color: inherit; width: 13px; height: 13px; }
.fpclear { color: var(--mute); font-size: 13px; }
.fpnone { padding: 4px 8px; }
.sugbar { display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1px dashed var(--line2); border-radius: 6px; background: var(--band); }
.sugt { font-size: 12px; font-weight: 600; color: var(--soft); }
.sugrow { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surf); }
.sugrow:hover { border-color: var(--pa, var(--ind)); }
.sugrow.best { border-color: var(--pa, var(--ind)); background: var(--pabg, var(--indbg)); }
.sugl { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.sugl .ico { margin: 0; color: var(--ind); }
.sugb { margin-left: auto; font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--mute); }
.sugs { font-size: 12px; color: var(--mute); }
.sugw { font-size: 12px; color: var(--soft); }
@media (max-width: 699px) { .fprow { min-height: 42px; } }
.tedit + .tedit { margin-left: 2px; }
.frow.bad .pickbtn { border-color: var(--red); box-shadow: 0 0 0 1px var(--red); }
.frow.bad input:focus, .frow.bad textarea:focus, .frow.bad select:focus, .frow.bad .pickbtn:focus { border-color: var(--red); box-shadow: 0 0 0 1px var(--red); }
