/* Parents' payments: big, calm, readable. Same colours as the demo the school saw. */
:root {
  --paper: #FAF8F4; --paper-deep: #F2EEE6; --ink: #22303E; --soft: #4A5866; --faint: #586370; --line: #E6E0D5;
  --wood: #2F6E55; --wood-deep: #1E4A39; --wood-tint: #E5F1EB; --gold: #D9A441; --gold-tint: #FAF3E3; --red: #B4382F; --red-tint: #FBEAE8;
  --radius: 14px; --nav-h: 66px; color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); }
body { font: 18px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; -webkit-text-size-adjust: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--wood); }
.boot { padding: 40px; text-align: center; color: var(--faint); }
[hidden] { display: none !important; }

/* ---------- layout ---------- */
.shell { display: flex; min-height: 100vh; }
.side { width: 230px; flex: none; background: #fff; border-right: 1px solid var(--line); padding: 18px 12px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; }
.brand { font-weight: 800; color: var(--wood); font-size: 18px; padding: 6px 12px 16px; line-height: 1.25; }
.brand small { display: block; color: var(--faint); font-weight: 600; font-size: 13px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; text-decoration: none; color: var(--soft); font-weight: 600; }
.nav a svg { width: 22px; height: 22px; flex: none; }
.nav a.on { background: var(--wood-tint); color: var(--wood-deep); }
.nav a:hover { background: var(--paper-deep); }
.side .me { margin-top: auto; font-size: 14px; color: var(--faint); padding: 10px 14px; }
main.view { flex: 1; min-width: 0; padding: 22px 28px 60px; max-width: 1240px; }
.testbar { background: #FFF6DA; border-bottom: 1px dashed var(--gold); color: #7A5A12; font-size: 14px; text-align: center; padding: 6px 10px; }
.offline { background: var(--red); color: #fff; text-align: center; padding: 8px; font-weight: 600; position: sticky; top: 0; z-index: 60; }

@media (max-width: 820px) {
  .side { display: none; }
  main.view { padding: 14px 14px calc(var(--nav-h) + 90px); }
  .tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: #fff; border-top: 1px solid var(--line);
          display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding-bottom: env(safe-area-inset-bottom); }
  .tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: var(--nav-h);
            text-decoration: none; color: var(--faint); font-size: 13px; font-weight: 700; white-space: nowrap; }
  .tabs a svg { width: 24px; height: 24px; }
  .tabs a.on { color: var(--wood); }
}
@media (min-width: 821px) { .tabs { display: none; } }
@media (max-width: 820px) {
  .head h1 { font-size: 22px; }
  .month h1 { min-width: 0; flex: 1; }
  .head .month { flex: 1; justify-content: space-between; }
  .chips { gap: 6px; }
  .chip { font-size: 14px; padding: 5px 10px; }
  .testbar { font-size: 12.5px; padding: 4px 8px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .tile { padding: 7px 9px; }
  .tile b { font-size: 17px; }
  .tile small { font-size: 12px; }
  #tools { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  #tools .btn { white-space: normal; line-height: 1.2; font-size: 14px; }
  #tools [data-act="copy"] { grid-column: 1 / -1; }
  .bar .seg { width: 100%; }
  .bar .seg button { flex: 1; padding: 8px 4px; font-size: 14.5px; line-height: 1.2; }
  .seg button .cnt { margin-left: 3px; padding: 0 6px; font-size: 12px; }
}

/* ---------- headings and bars ---------- */
.head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.head h1 { font-size: 26px; margin: 0; line-height: 1.2; }
.head .grow { flex: 1; }
.month { display: inline-flex; align-items: center; gap: 4px; }
.month h1 { min-width: 9.5em; text-align: center; }
.iconbtn { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: #fff; display: inline-grid; place-items: center; font-size: 20px; color: var(--soft); text-decoration: none; flex: none; }
.iconbtn:hover { background: var(--paper-deep); }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 240px)); gap: 10px; margin: 2px 0 14px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px 14px; }
.tile b { display: block; font-size: 21px; line-height: 1.2; color: var(--wood); font-variant-numeric: tabular-nums; }
.tile small { display: block; color: var(--soft); font-size: 13.5px; line-height: 1.25; }
.tile.owe b { color: var(--red); }
.chips { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 14px; }
.chip { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; font-size: 15px; color: var(--soft); }
.chip b { color: var(--ink); }
.chip.good b { color: var(--wood); }
.chip.owe b { color: var(--red); }
.bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.search { flex: 1 1 260px; min-width: 200px; position: relative; }
.search input { width: 100%; height: 48px; border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 0 14px 0 42px; font-size: 17px; }
.search svg { position: absolute; left: 13px; top: 14px; width: 20px; height: 20px; color: var(--faint); }
.seg { display: inline-flex; background: var(--paper-deep); border-radius: 12px; padding: 4px; }
.seg button { border: 0; background: transparent; padding: 9px 14px; border-radius: 9px; font-weight: 600; color: var(--soft); min-height: 40px; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.seg button .cnt { display: inline-block; min-width: 1.6em; margin-left: 4px; padding: 0 7px; border-radius: 999px; background: rgba(0,0,0,.07); font-size: 13px; line-height: 1.6; font-variant-numeric: tabular-nums; }
.seg button.on .cnt { background: var(--wood-tint); color: var(--wood-deep); }
.seg button[data-f="owe"].on .cnt { background: var(--red-tint); color: var(--red); }
button.tile { font: inherit; color: inherit; text-align: left; cursor: pointer; width: 100%; }
button.tile:hover { border-color: var(--wood); }
button.tile.owe:hover { border-color: var(--red); }
button.tile.on { border-color: var(--wood); box-shadow: inset 0 0 0 1px var(--wood); }
button.tile.owe.on { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }

/* ---------- buttons ---------- */
.btn { border: 0; border-radius: 12px; padding: 0 18px; min-height: 48px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; white-space: nowrap; }
.btn.go { background: var(--wood); color: #fff; }
.btn.go:hover { background: var(--wood-deep); }
.btn.plain { background: #fff; color: var(--wood); border: 2px solid var(--wood); }
.btn.soft { background: var(--paper-deep); color: var(--ink); }
.btn.danger { background: #fff; color: var(--red); border: 2px solid #E8C2BE; }
.btn.small { min-height: 38px; padding: 0 12px; font-size: 15px; border-radius: 10px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.link { background: none; border: 0; color: var(--wood); font-weight: 600; padding: 6px 4px; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- the fast entry row ---------- */
.entry { background: #fff; border: 2px solid var(--wood); border-radius: var(--radius); padding: 12px; margin-bottom: 8px; box-shadow: 0 6px 18px -12px rgba(47,110,85,.6); }
.entry .fields { display: grid; grid-template-columns: 1.5fr 1.25fr 1fr .7fr auto; gap: 8px; align-items: start; }
.field { position: relative; }
.field label { display: block; font-size: 12.5px; font-weight: 700; color: var(--faint); margin: 0 0 4px 4px; letter-spacing: .2px; }
.field input, .field select, .field textarea { width: 100%; height: 50px; border: 1px solid #D8D1C4; border-radius: 10px; padding: 0 12px; background: #fff; font-size: 17px; }
.field textarea { height: auto; min-height: 90px; padding: 10px 12px; line-height: 1.4; }
.field input:focus, .field select:focus, .field textarea:focus, .search input:focus { outline: 3px solid rgba(47,110,85,.25); border-color: var(--wood); }
/* the € and the amount share one box, so the sign is always centred on the number's line */
.money { position: relative; display: block; }
.money .euro { position: absolute; left: 13px; top: 0; bottom: 0; display: flex; align-items: center; font-size: 17px; line-height: 1; color: var(--faint); pointer-events: none; }
.money .euro + input { padding-left: 30px; }
.field.bad input { border-color: var(--red); background: var(--red-tint); }
.field .err { color: var(--red); font-size: 13.5px; margin: 4px 0 0 4px; }
.entry .save { align-self: end; height: 50px; }
.entry .hint { color: var(--faint); font-size: 13.5px; margin: 8px 4px 0; }
.entry .tag { display: inline-block; font-size: 12px; font-weight: 700; color: var(--wood); background: var(--wood-tint); border-radius: 6px; padding: 1px 6px; margin-left: 6px; }
.ask { margin-top: 10px; background: var(--gold-tint); border: 1px solid #F0E2BF; border-radius: 12px; padding: 12px; }
.ask p { margin: 0 0 10px; }
.ask .btns { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 820px) {
  .entry .fields { grid-template-columns: 1fr 1fr; }
  .entry .f-name, .entry .f-service { grid-column: 1 / -1; }
  .entry .save { grid-column: 1 / -1; width: 100%; }
}

/* ---------- suggestions under a field ---------- */
.sugg { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; background: #fff; border: 1px solid #D8D1C4; border-radius: 12px; box-shadow: 0 16px 40px -18px rgba(0,0,0,.35); overflow: hidden; min-width: 240px; }
.sugg button { display: flex; width: 100%; justify-content: space-between; gap: 12px; border: 0; background: #fff; padding: 11px 14px; text-align: left; font-size: 16px; }
.sugg button small { color: var(--faint); }
.sugg button.on, .sugg button:hover { background: var(--wood-tint); }
.sugg .new { color: var(--wood); font-weight: 600; border-top: 1px solid var(--line); }

/* ---------- rows ---------- */
.recent { margin: 0 0 14px; }
.recent .lbl, .lbl { font-size: 12.5px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--faint); margin: 10px 4px 6px; }
.table { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.row { display: grid; grid-template-columns: 1.5fr 1.25fr 1fr .7fr 236px; gap: 8px; align-items: center; padding: 8px 12px 8px 16px; border-top: 1px solid #F0EBE3; min-height: 60px; cursor: pointer; }
.row:first-child { border-top: 0; }
.row:hover { background: #FCFBF8; }
.row .n { font-weight: 650; }
.row .s, .row .ph { color: var(--soft); }
.row .a { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; padding-right: 8px; }
.row.th { min-height: 40px; cursor: default; background: var(--paper-deep); font-size: 12.5px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--faint); }
.row.th:hover { background: var(--paper-deep); }
.row.flash { animation: flash 1.6s ease; }
@keyframes flash { 0% { background: #FFF3C8; } 100% { background: #fff; } }
/* the tick box: empty and red until paid, ticked and green after */
.tick { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 50px; padding: 6px 12px; border-radius: 12px; border: 2px solid #E3B4AE; background: #fff; color: var(--red); text-align: left; cursor: pointer; font: inherit; }
.tick .box { flex: none; width: 28px; height: 28px; border: 2.5px solid currentColor; border-radius: 7px; display: grid; place-items: center; font-weight: 900; font-size: 18px; line-height: 1; background: #fff; }
.tick .t { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.tick b { font-size: 16px; font-weight: 800; }
.tick small { font-size: 12.5px; color: var(--soft); font-weight: 600; }
.tick:hover { border-color: var(--red); background: var(--red-tint); }
.tick.on { border-color: #BFDCCB; color: var(--wood-deep); background: var(--wood-tint); }
.tick.on .box { background: var(--wood); border-color: var(--wood); color: #fff; }
.tick.on:hover { border-color: var(--wood); background: var(--wood-tint); }
.tick.pending { opacity: .75; }
.empty { padding: 34px 20px; text-align: center; color: var(--soft); }
.empty b { display: block; font-size: 20px; color: var(--ink); margin-bottom: 6px; }
.empty .btn { margin-top: 14px; }
.more { padding: 12px; text-align: center; }
@media (max-width: 820px) {
  .row.th { display: none; }
  .row { grid-template-columns: 1fr auto; grid-template-areas: "n a" "s s" "b b"; gap: 4px 10px; padding: 12px 14px; }
  .row .n { grid-area: n; font-size: 18px; }
  .row .a { grid-area: a; font-size: 18px; padding: 0; }
  .row .s { grid-area: s; font-size: 15px; }
  .row .ph { display: none; }
  .row .b { grid-area: b; margin-top: 6px; }
  .row .s .phm { display: inline; }
}
.phm { display: none; }
/* on the parent's own page a charge row does not repeat their name and phone: what it is, how much, paid or not */
.table.mine .row { grid-template-columns: minmax(0, 1fr) .5fr 236px; }
.table.mine .row .n, .table.mine .row .ph, .table.mine .row .s .phm { display: none; }
.table.mine .row .s { color: var(--ink); font-weight: 650; }
@media (max-width: 820px) {
  .table.mine .row { grid-template-columns: 1fr auto; grid-template-areas: "s a" "b b"; }
  .table.mine .row .s { font-size: 17px; }
}

/* ---------- cards, lists, forms ---------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 14px; }
.card h2 { font-size: 19px; margin: 0 0 10px; }
.card h3 { font-size: 16px; margin: 14px 0 8px; }
.card p { margin: 6px 0; }
.muted { color: var(--faint); font-size: 15px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 820px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.grid2 > *, .grid3 > * { min-width: 0; }
.scrollx { overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 820px) { table.plain td, table.plain th { padding: 8px 5px; font-size: 15px; } }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.kpi b { display: block; font-size: 28px; line-height: 1.15; color: var(--wood); font-variant-numeric: tabular-nums; }
.kpi.owe b { color: var(--red); }
.kpi small { color: var(--soft); }
.list > * { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-top: 1px solid #F0EBE3; }
.list > *:first-child { border-top: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .grow small { display: block; color: var(--faint); }
.list a.item { text-decoration: none; color: inherit; }
.badge { display: inline-block; font-size: 13px; font-weight: 700; border-radius: 999px; padding: 3px 10px; background: var(--paper-deep); color: var(--soft); white-space: nowrap; }
.badge.ok { background: var(--wood-tint); color: var(--wood-deep); }
.badge.owe { background: var(--red-tint); color: var(--red); }
.badge.warn { background: var(--gold-tint); color: #8A6212; }
.prog { height: 10px; background: var(--paper-deep); border-radius: 999px; overflow: hidden; }
.prog i { display: block; height: 100%; background: var(--wood); border-radius: 999px; }
.charge { display: grid; grid-template-columns: 1fr 120px 90px; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid #F0EBE3; }
.charge:first-child { border-top: 0; }
.charge .t { font-weight: 650; }
.charge .t small { display: block; font-weight: 400; color: var(--faint); }
.charge .c { text-align: right; font-variant-numeric: tabular-nums; }
.charge input[type="date"] { border: 1px solid var(--line); border-radius: 8px; padding: 2px 6px; background: #fff; }
@media (max-width: 820px) {
  .charge { grid-template-columns: 1fr auto; grid-template-areas: "t c" "p p"; gap: 6px 10px; }
  .charge .t { grid-area: t; } .charge .c { grid-area: c; } .charge .prog { grid-area: p; }
}
table.plain { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.plain th { text-align: right; font-size: 12.5px; letter-spacing: .3px; text-transform: uppercase; color: var(--faint); padding: 6px 8px; }
table.plain td { text-align: right; padding: 9px 8px; border-top: 1px solid #F0EBE3; }
table.plain th:first-child, table.plain td:first-child { text-align: left; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-top: 1px solid #F0EBE3; }
.switch:first-of-type { border-top: 0; }
.switch .grow small { display: block; color: var(--faint); font-size: 14px; }
.toggle { position: relative; width: 54px; height: 32px; flex: none; }
.toggle input { opacity: 0; width: 100%; height: 100%; position: absolute; inset: 0; margin: 0; cursor: pointer; z-index: 2; }
.toggle span { position: absolute; inset: 0; background: #D3CCBF; border-radius: 999px; transition: background .2s; }
.toggle span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; background: #fff; border-radius: 50%; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.toggle input:checked + span { background: var(--wood); }
.toggle input:checked + span::after { transform: translateX(22px); }
.toggle input:focus-visible + span { outline: 3px solid rgba(47,110,85,.35); }
.saved { color: var(--wood); font-size: 13.5px; font-weight: 700; margin-left: 6px; }
.tokens { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.tokens button { border: 1px dashed var(--wood); background: var(--wood-tint); color: var(--wood-deep); border-radius: 8px; padding: 4px 8px; font-size: 13px; font-weight: 700; }
.preview { background: var(--paper-deep); border-radius: 10px; padding: 10px 12px; font-size: 15px; white-space: pre-wrap; word-break: break-word; }
.conn { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid #F0EBE3; }
.conn:first-of-type { border-top: 0; }
.conn small { display: block; color: var(--faint); font-size: 14px; }
.toggle input:disabled + span { opacity: .45; }
.toggle input:disabled { cursor: default; }
.dot { width: 12px; height: 12px; border-radius: 50%; flex: none; background: #C9C2B5; }
.dot.on { background: #2E9B66; }
.dot.test { background: var(--gold); }

/* ---------- sheets (edit forms) and toasts ---------- */
.veil { position: fixed; inset: 0; background: rgba(24,32,42,.42); z-index: 80; display: flex; align-items: center; justify-content: center; padding: 20px; }
.sheet { background: var(--paper); border-radius: 18px; width: min(560px, 100%); max-height: calc(100vh - 40px); overflow: auto; box-shadow: 0 30px 80px -20px rgba(0,0,0,.5); }
.sheet.wide { width: min(980px, 100%); }
.sheet header { display: flex; align-items: center; gap: 10px; padding: 16px 18px 6px; position: sticky; top: 0; background: var(--paper); z-index: 2; }
.sheet header h2 { flex: 1; margin: 0; font-size: 21px; }
.sheet .body { padding: 8px 18px 18px; display: flex; flex-direction: column; gap: 12px; }
.sheet .body > .search { flex: none; }   /* the toolbar's «grow» would make it tall in a window */
.sheet .actions { display: flex; gap: 10px; flex-wrap: wrap; padding: 4px 18px 18px; }
.sheet .actions .grow { flex: 1; }
@media (max-width: 820px) {
  .veil { align-items: flex-end; padding: 0; }
  .sheet { border-radius: 18px 18px 0 0; max-height: 92vh; width: 100%; padding-bottom: env(safe-area-inset-bottom); }
}
#toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: 22px; z-index: 90; display: flex; flex-direction: column; gap: 8px; width: min(560px, calc(100% - 24px)); }
@media (max-width: 820px) { #toasts { bottom: calc(var(--nav-h) + 12px + env(safe-area-inset-bottom)); } }
.toast { background: var(--ink); color: #fff; border-radius: 14px; padding: 12px 14px 12px 16px; display: flex; align-items: center; gap: 12px; box-shadow: 0 14px 40px -12px rgba(0,0,0,.45); animation: up .2s ease; }
.toast .t { flex: 1; }
.toast button { background: #fff; color: var(--ink); border: 0; border-radius: 10px; padding: 9px 14px; font-weight: 800; }
.toast.err { background: var(--red); }
@keyframes up { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- paste preview ---------- */
.paste textarea { width: 100%; min-height: 140px; border: 1px solid #D8D1C4; border-radius: 10px; padding: 10px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 14px; }
.ptable { width: 100%; border-collapse: collapse; font-size: 15px; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.ptable th, .ptable td { padding: 8px; border-top: 1px solid #F0EBE3; text-align: left; vertical-align: top; }
.ptable th select { width: 100%; height: 40px; border-radius: 8px; border: 1px solid #D8D1C4; background: #fff; }
.ptable tr.bad td { background: var(--red-tint); }
.ptable tr.ask td { background: var(--gold-tint); }
.ptable td.st { font-size: 14px; }

/* ---------- photos ---------- */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.photos a { display: block; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; text-decoration: none; color: inherit; }
.photos img { width: 100%; height: 150px; object-fit: cover; display: block; background: var(--paper-deep); }
.photos span { display: block; padding: 8px 10px; font-size: 13.5px; color: var(--soft); }
.work { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(380px, 1fr); gap: 16px; align-items: start; }
.viewer { position: sticky; top: 10px; background: #2B2F33; border-radius: var(--radius); overflow: hidden; height: calc(100vh - 140px); touch-action: none; }
.viewer img { position: absolute; left: 0; top: 0; transform-origin: 0 0; user-select: none; -webkit-user-drag: none; max-width: none; }
.viewer .tools { position: absolute; right: 10px; top: 10px; display: flex; gap: 6px; z-index: 2; }
.viewer .tools button { width: 44px; height: 44px; border-radius: 10px; border: 0; background: rgba(255,255,255,.92); font-size: 20px; font-weight: 800; }
.work .entry .fields { grid-template-columns: 1fr 1fr; }
.work .entry .f-name, .work .entry .f-service { grid-column: 1 / -1; }
.work .entry .save { grid-column: 1 / -1; width: 100%; }
@media (max-width: 980px) { .work { grid-template-columns: 1fr; } .viewer { position: relative; height: 46vh; } }
.work .row.th { display: none; }
.work .row { grid-template-columns: 1fr auto; grid-template-areas: "n a" "s s" "b b"; gap: 2px 10px; padding: 10px 12px; }
.work .row .n { grid-area: n; } .work .row .a { grid-area: a; padding: 0; } .work .row .s { grid-area: s; font-size: 15px; }
.work .row .ph { display: none; } .work .row .phm { display: inline; } .work .row .b { grid-area: b; margin-top: 6px; }

/* ---------- install guide pictures ---------- */
.guide { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.step { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.step .num { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--wood); color: #fff; font-weight: 800; margin-right: 6px; }
.step svg { width: 100%; height: auto; max-height: 230px; display: block; margin-top: 10px; border-radius: 10px; background: var(--paper-deep); }
.step p { margin: 8px 0 0; font-size: 17px; }

/* ---------- sign in ---------- */
.login { max-width: 420px; margin: 8vh auto; padding: 0 16px; }
.login .logo { width: 72px; height: 72px; border-radius: 18px; display: block; margin-bottom: 18px; }
.login h1 { font-size: 28px; margin: 0 0 6px; }
.login form { display: flex; flex-direction: column; gap: 14px; margin-top: 22px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 16px; }
.check input { width: 22px; height: 22px; }
.errbox { background: var(--red-tint); color: var(--red); border-radius: 10px; padding: 10px 12px; font-weight: 600; }
.okbox { background: var(--wood-tint); color: var(--wood-deep); border-radius: 10px; padding: 10px 12px; font-weight: 600; }
.warnbox { background: var(--gold-tint); border: 1px solid #F0E2BF; color: #6E4E0E; border-radius: 12px; padding: 12px 14px; }
.viberq .done { opacity: .55; }
.kbd { font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--paper-deep); border-radius: 6px; padding: 1px 6px; font-size: 14px; }

/* ---------- simpler for the office: big main button, the new-charge window, help ---------- */
.btn.big { min-height: 58px; font-size: 19px; padding: 0 26px; box-shadow: 0 6px 16px -10px rgba(47,110,85,.8); }
.entry.big { border: 0; box-shadow: none; padding: 0; margin: 0; background: transparent; }
.entry.big .fields { grid-template-columns: 1fr; gap: 14px; }
.entry.big .field label { font-size: 16px; color: var(--ink); letter-spacing: 0; }
.entry.big .field label small { color: var(--soft); font-weight: 500; }
.entry.big .field input { height: 56px; font-size: 19px; }
.entry.big .money .euro { font-size: 19px; left: 14px; }
.entry.big .money .euro + input { padding-left: 34px; }
.entry.big .save { width: 100%; height: 58px; font-size: 19px; margin-top: 4px; }
.entry.big .hint { font-size: 15px; color: var(--soft); margin: 10px 2px 0; }
.entry.big [data-done] { margin-top: 12px; }
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { display: flex; gap: 12px; align-items: flex-start; padding: 7px 0; font-size: 18px; line-height: 1.4; }
.steps .num { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--wood); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 16px; }
.help { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.lead { font-size: 19px; margin: 0 0 16px; }
@media (max-width: 820px) {
  #tools [data-act="new"], #tools [data-act="group"] { grid-column: 1 / -1; }
  #tools .btn.big { font-size: 18px; min-height: 56px; }
  .helpbtn { display: none; }
  .help { grid-template-columns: 1fr; }
}

/* ---------- the filters: the same three rows (Πληρωμή, Χρέωση, Μήνυμα) on every list; sending the link after a new charge ---------- */
.filters { display: grid; gap: 8px; margin: -2px 0 14px; }
.filters:empty { display: none; }
.fgroup { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: start; gap: 8px; }
.fgroup .lbl { margin: 0; line-height: 42px; font-size: 12.5px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase; color: var(--faint); }
.fgroup .opts { display: flex; flex-wrap: wrap; gap: 8px; }
.ffoot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding-left: 104px; min-height: 34px; }
.ffoot .fsum { color: var(--soft); font-size: 14.5px; }
.ffoot .fsum b { color: var(--ink); }
button.chip { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 0 14px; line-height: 1.2;
              cursor: pointer; font: inherit; font-size: 15.5px; font-weight: 600; color: var(--ink); }
button.chip:hover { border-color: var(--wood); }
button.chip.on { background: var(--wood); border-color: var(--wood); color: #fff; }
button.chip.owe.on { background: var(--red); border-color: var(--red); }
button.chip.zero:not(.on) { color: var(--faint); border-style: dashed; }
.chip .cnt { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 22px; padding: 0 7px; border-radius: 999px;
             background: rgba(0,0,0,.07); font-size: 13px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.chip.on .cnt { background: rgba(255,255,255,.25); }
.row .s .mst { display: block; margin-top: 2px; font-size: 13px; color: var(--wood-deep); }
#mfl { margin: 4px 0 12px; }
@media (max-width: 700px) {
  .filters { gap: 8px; }
  .fgroup { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .fgroup .lbl { line-height: 1.3; font-size: 11.5px; }
  .fgroup .opts { gap: 5px; }
  .ffoot { padding-left: 0; }
  button.chip { min-height: 36px; padding: 0 10px; font-size: 13.5px; gap: 5px; }
  .chip .cnt { min-width: 18px; height: 18px; padding: 0 5px; font-size: 11.5px; }
}
.sendrow { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.sendres { margin: 8px 0 2px; font-weight: 700; line-height: 1.4; }
.sendres.ok { color: var(--wood-deep); }
.sendres.bad { color: var(--red); }
.okbox .next { margin-top: 6px; font-weight: 500; color: var(--soft); }

/* «Δείτε όλα / Κλείσιμο» under a long list: one click each way */
.morebtn { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 46px; margin-top: 8px;
           border: 1px dashed #CFC6B5; border-radius: 10px; background: var(--paper); color: var(--wood-deep); font: inherit; font-weight: 700; cursor: pointer; }
.morebtn:hover { background: var(--wood-tint); }

/* Lists to pick from (e.g. «Τι πληρώνει»): a clear arrow, the text centred like every other box; the box for «Άλλο» sits under the list */
.field select { -webkit-appearance: none; appearance: none; padding-right: 44px; text-overflow: ellipsis; cursor: pointer;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='10' viewBox='0 0 16 10'%3E%3Cpath d='M1.5 1.5 8 8l6.5-6.5' fill='none' stroke='%232F6E55' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 16px center / 16px 10px; }
.field select:disabled { cursor: default; opacity: .7; }
.field .typesel + input { margin-top: 8px; }
.entry.big .field select { height: 56px; font-size: 19px; }
.field.bad select { border-color: var(--red); background-color: var(--red-tint); }

/* ---------- the one list: a line per parent, their charges as small tick boxes ---------- */
.plist { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.pline { display: grid; grid-template-columns: minmax(150px, 210px) minmax(0, 1fr) auto; align-items: center; gap: 6px 14px;
         padding: 7px 12px 7px 14px; border-top: 1px solid #F0EBE3; min-height: 56px; }
.pline:first-child { border-top: 0; }
.pline:hover { background: #FCFBF8; }
.pline .pname { display: flex; flex-direction: column; min-width: 0; text-decoration: none; color: var(--ink); }
.pline .pname b { font-size: 16.5px; line-height: 1.25; }
.pline .pname small { font-size: 13.5px; color: var(--soft); }
.pline .pname:hover b { text-decoration: underline; text-underline-offset: 3px; }
.pch { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.pch .muted { margin-right: 4px; }
.ctick { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 9px 0 6px; border-radius: 9px; border: 2px solid #E3B4AE;
         background: #fff; color: var(--red); font: inherit; font-size: 14px; line-height: 1.2; text-align: left; cursor: pointer; }
.ctick .box { flex: none; display: grid; place-items: center; width: 19px; height: 19px; border: 2px solid currentColor; border-radius: 5px;
              background: #fff; font-size: 13px; font-weight: 900; line-height: 1; }
.ctick .cn { color: var(--ink); font-weight: 600; }
.ctick .cn small { color: var(--red); font-weight: 700; }
.ctick b { font-variant-numeric: tabular-nums; }
.ctick:hover { border-color: var(--red); background: var(--red-tint); }
.ctick.on { border-color: #BFDCCB; background: var(--wood-tint); color: var(--wood-deep); }
.ctick.on .box { background: var(--wood); border-color: var(--wood); color: #fff; }
.ctick.on .cn { color: var(--wood-deep); }
.ctick.on:hover { border-color: var(--wood); }
.ctick.pending { opacity: .7; }
.ctick.sample { min-height: 0; padding: 2px 4px; vertical-align: middle; cursor: default; }
.legend { margin: 0 0 8px 4px; font-size: 14px; color: var(--soft); }
.pstate { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; white-space: nowrap; }
.pst { font-size: 13.5px; font-weight: 700; white-space: nowrap; }
.pst.no { color: var(--red); }
.pst.yes { color: var(--wood-deep); }
.bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin: 0 0 12px; }
.bulk a.quiet { color: var(--wood-deep); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
/* the search and the two lists that choose the parents, on one line */
.bar.find { align-items: stretch; }
.find .search { flex: 1 1 220px; }
.lfs { display: flex; flex-wrap: wrap; gap: 10px; flex: 2 1 520px; }
.lfs:empty { display: none; }
.lfs .fsel { flex: 2 1 200px; max-width: 330px; }
.lfs .fsel:first-child { flex: 3 1 260px; max-width: 400px; }     /* its longest choice must show whole */
.lfs .fsel select { width: 100%; height: 48px; }
#bulk .warnbox { margin: 0 0 12px; }
@media (max-width: 820px) {
  .pline { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "n s" "c c"; align-items: start; padding: 10px 12px; }
  .pline .pname { grid-area: n; }
  .pline .pstate { grid-area: s; }
  .pline .pch { grid-area: c; }
  .lfs .fsel { flex-basis: 100%; max-width: none; }
  .ctick { font-size: 13.5px; padding: 0 8px 0 5px; gap: 5px; }
  .bulk .btn { flex: 1 1 100%; white-space: normal; }
}

/* Σύνολα: the red total and each charge's «X/Y» open the Λίστα */
a.kpi { display: block; text-decoration: none; color: inherit; }
a.kpi:hover { border-color: var(--red); }
.charge a.c { flex: none; text-decoration: none; min-width: 74px; }

/* the filters: three plain lists on one line (Πληρωμή, Χρέωση, Μήνυμα); one that filters is green */
.fsels { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; }
.fsel { display: flex; flex-direction: column; gap: 4px; flex: 1 1 220px; max-width: 330px; }
.fsel > span { margin-left: 4px; font-size: 12.5px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase; color: var(--faint); }
.fsel select { height: 46px; padding: 0 40px 0 12px; border: 1px solid #D8D1C4; border-radius: 10px; font: inherit; font-size: 16px; color: var(--ink); cursor: pointer;
  -webkit-appearance: none; appearance: none;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='10' viewBox='0 0 16 10'%3E%3Cpath d='M1.5 1.5 8 8l6.5-6.5' fill='none' stroke='%232F6E55' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center / 14px 9px; }
.fsel select:focus { outline: 3px solid rgba(47,110,85,.25); border-color: var(--wood); }
.fsel.on select { border: 2px solid var(--wood); background-color: var(--wood-tint); font-weight: 700; }
.filters .ffoot { padding-left: 0; margin-top: 2px; }
@media (max-width: 700px) {
  .fsel { flex-basis: 100%; max-width: none; }
}
