:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #1d2330;
  --muted: #6a7282;
  --line: #dde1e8;
  --accent: #1f5fbf;
  --accent-text: #ffffff;
  --danger: #b3261e;
  --ok: #1e7a3c;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
body { margin: 0; }
h1 { font-size: 1.4rem; margin: 0 0 1rem; }
h2 { font-size: 1.1rem; margin: 1.5rem 0 .5rem; }
a { color: var(--accent); }

.topbar {
  display: flex; align-items: center; gap: 1rem; flex-wrap: nowrap;
  padding: .6rem 1rem; background: var(--panel); border-bottom: 1px solid var(--line);
}
.topbar .brand { font-weight: 600; }
.topbar nav { display: flex; flex-wrap: wrap; gap: .1rem; flex: 1 1 auto; min-width: 0; }
.topbar nav a { padding: .3rem .55rem; white-space: nowrap; border-radius: 6px; text-decoration: none; color: var(--text); }
.topbar nav a.active { background: var(--accent); color: var(--accent-text); }
.topbar .spacer { flex: 0 0 .5rem; }
.topbar > select, .topbar > button, .topbar > .user { flex: none; }
.topbar .user { color: var(--muted); }

main { padding: 1rem; max-width: 1500px; margin: 0 auto; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 1rem; margin-bottom: 1rem; }
.narrow { max-width: 420px; margin: 3rem auto; }
/* a visitor looking at the example: said above everything */
.demo-bar { display: flex; gap: 1rem; align-items: center; justify-content: center; flex-wrap: wrap; padding: .5rem 1rem; background: #fff8e1; border-bottom: 1px solid #f0d98a; font-size: .95rem; }
/* the sign-in with what the program is for beside it */
.welcome { display: flex; gap: 3rem; align-items: flex-start; max-width: 980px; margin: 3rem auto; padding: 0 1rem; }
.welcome .about { flex: 1; padding-top: .6rem; }
.welcome .about h2 { font-size: 1.6rem; line-height: 1.25; margin: 0 0 .8rem; }
.welcome .about ul { padding-left: 1.2rem; margin: 1rem 0; }
.welcome .about li { margin: .5rem 0; }
.welcome .narrow { flex: 0 0 420px; margin: 0; }
@media (max-width: 880px) {
  .welcome { flex-direction: column; gap: 1.2rem; margin: 1rem 0; padding: 0 .6rem; }
  .welcome .narrow { flex: none; width: 100%; max-width: none; margin: 0; order: -1; }
}

label { display: block; margin: .5rem 0 .2rem; color: var(--muted); font-size: .9rem; }
input, select, textarea {
  font: inherit; padding: .4rem .5rem; border: 1px solid var(--line); border-radius: 6px; background: #fff; width: 100%;
}
input[type=checkbox] { width: auto; }
.check { display: flex; gap: .4rem; align-items: center; color: var(--text); }

button {
  font: inherit; padding: .45rem .9rem; border-radius: 6px; border: 1px solid var(--line); background: #fff; cursor: pointer;
}
button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
button.danger { color: var(--danger); }
button:disabled { opacity: .5; cursor: default; }
.actions { display: flex; gap: .5rem; margin-top: 1rem; flex-wrap: wrap; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 1rem; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .4rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: .9rem; }
td.num, th.num { text-align: right; white-space: nowrap; }
tr.clickable { cursor: pointer; }
tr.clickable:hover { background: #f0f4fb; }
.lines td { padding: .25rem .3rem; }
.lines input, .lines select { padding: .3rem .4rem; }

.error { color: var(--danger); margin: .5rem 0; white-space: pre-wrap; }
.success { color: var(--ok); margin: .5rem 0; }
.muted { color: var(--muted); }
.badge { display: inline-block; padding: .05rem .45rem; border-radius: 10px; font-size: .8rem; background: #eef1f6; }
.badge.draft { background: #fff3cd; }
.badge.posted { background: #d8f0df; }
/* payment state: green paid, amber partly, blue not yet, red overdue - on invoices, in lists by a coloured edge */
.badge.pay-paid { background: #d8f0df; color: var(--ok); }
.badge.pay-partial { background: #fff3cd; color: #7a5a00; }
.badge.pay-unpaid { background: #e3ecfb; color: #1f4f99; }
.badge.pay-overdue { background: #fde2e0; color: var(--danger); font-weight: 600; }
tr.pay-row-overdue > td:first-child { box-shadow: inset 4px 0 0 var(--danger); }
tr.pay-row-partial > td:first-child { box-shadow: inset 4px 0 0 #e0a800; }
tr.pay-row-paid > td:first-child { box-shadow: inset 4px 0 0 var(--ok); }
.panel.pay-panel-overdue { border-left: 4px solid var(--danger); }
.panel.pay-panel-paid { border-left: 4px solid var(--ok); }
.panel.pay-panel-partial { border-left: 4px solid #e0a800; }
/* a tick box with the whole cell to click: a near miss doesn't open the row */
label.tick { display: flex; align-items: center; justify-content: center; margin: -.4rem -.5rem; padding: .4rem .9rem; min-height: 1.6rem; cursor: pointer; }
label.tick input { width: 1.15rem; height: 1.15rem; cursor: pointer; margin: 0; }
.code { font-family: Consolas, monospace; font-size: 1.05rem; letter-spacing: .05em; }
.qr img { display: block; margin: .5rem 0; }
.totals { margin-left: auto; width: 320px; }
.totals td { border: none; padding: .15rem .5rem; }
.totals tr.gross td { font-weight: 600; border-top: 1px solid var(--line); }
.lock-date { display: flex; gap: .4rem; align-items: center; }
.lock-date input { width: 10rem; }
.small { font-size: .8rem; }
tr.total td { font-weight: 600; border-top: 2px solid var(--line); }
.nowrap { white-space: nowrap; }
.narrow-form { max-width: 420px; }
.topbar a.user { text-decoration: none; }
.in { color: var(--ok); }
.out { color: var(--danger); }
.overdue { color: var(--danger); }
.payment-editor { background: #f6f8fc; border: 1px solid var(--line); border-radius: 6px; padding: .5rem .8rem; }
a.button { display: inline-block; font: inherit; padding: .45rem .9rem; border-radius: 6px; border: 1px solid var(--line); background: #fff; color: var(--text); text-decoration: none; }
a.button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
/* a button waiting for the server: its text gives way to a spinner, its size stays */
button.busy { position: relative; color: transparent !important; cursor: progress; opacity: 1; }
button.busy::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 1em; height: 1em; margin: -.5em 0 0 -.5em;
  border: 2px solid rgba(0, 0, 0, .2); border-top-color: var(--text); border-radius: 50%; animation: spin .7s linear infinite;
}
button.primary.busy::after { border-color: rgba(255, 255, 255, .35); border-top-color: var(--accent-text); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { button.busy::after { animation-duration: 2s; } }
.spinner {
  display: inline-block; width: 1em; height: 1em; vertical-align: -.15em; border: 2px solid rgba(0, 0, 0, .15);
  border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite;
}
.loading { text-align: center; color: var(--muted); margin-top: 4rem; }
.input-with-button { display: flex; gap: .4rem; }
.input-with-button input { flex: 1; min-width: 0; }
.input-with-button button { white-space: nowrap; }
/* the invoice and its original side by side (as Odoo shows a vendor bill) */
main:has(.with-original) { max-width: none; }
.with-original { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 45%); gap: 1rem; align-items: start; }
.originals { position: sticky; top: .5rem; }
.originals h2 { margin-top: 0; }
.originals .viewer { display: block; width: 100%; height: calc(100vh - 12rem); min-height: 420px; border: 1px solid var(--line); border-radius: 4px; margin-top: .6rem; background: #fff; }
.originals img.viewer { height: auto; min-height: 0; }
.file-list { list-style: none; padding: 0; margin: 0 0 .5rem; }
.file-list li { padding: .2rem 0; }
.file-list li.active > a { font-weight: 600; }
button.link { border: none; background: none; padding: 0 .2rem; }
@media (max-width: 1000px) { .with-original { grid-template-columns: 1fr; } .originals { position: static; } }
.notice { background: #fff8e1; border-color: #f0d98a; }
.notice ul { margin: .3rem 0 0; padding-left: 1.2rem; }

.company-picker { border: 1px solid var(--line); border-radius: 6px; padding: .4rem .6rem; margin: .5rem 0; }
.company-picker legend { font-size: .85em; color: var(--muted); padding: 0 .3rem; }
.title-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.title-row select.language { width: auto; }
select.language { width: auto; }
/* supplier files dragged over the window */
.drop-overlay {
  position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem;
  background: color-mix(in srgb, var(--accent) 12%, transparent); border: 3px dashed var(--accent); font-size: 1.3rem; color: var(--accent);
  pointer-events: none;
}
.drop-overlay > div:first-child { background: var(--panel); padding: .8rem 1.4rem; border-radius: 8px; }
.file-list li.error { color: var(--danger); }
.title-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.title-row h1 { margin-right: auto; }
button.drop-toggle { border-style: dashed; border-color: var(--accent); color: var(--accent); }
button.drop-toggle.on { border-style: solid; color: var(--muted); border-color: var(--line); }
.drop-zone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem; text-align: center;
  min-height: 220px; margin: 0 0 1rem; padding: 1.5rem; border: 2px dashed color-mix(in srgb, var(--accent) 55%, transparent);
  border-radius: 12px; background: color-mix(in srgb, var(--accent) 5%, var(--panel)); color: var(--heading, inherit); cursor: pointer;
  transition: background .15s, border-color .15s;
}
.drop-zone:hover, .drop-zone:focus-visible { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, var(--panel)); outline: none; }
.drop-zone.over { border-style: solid; border-color: var(--accent); background: color-mix(in srgb, var(--accent) 15%, var(--panel)); }
.drop-zone.busy { cursor: progress; opacity: .8; }
.drop-zone .drop-icon { font-size: 2.4rem; line-height: 1; color: var(--accent); }

/* lists: striped rows, sortable titles, a filter under each title */
.panel table:not(.totals) > tbody > tr:nth-child(even):not(.empty) { background: #f7f9fc; }
.panel table:not(.totals) > tbody > tr.clickable:hover { background: #e8effa; }
.table-wrap { overflow-x: auto; }
table.data thead th { position: sticky; top: 0; background: var(--panel); z-index: 1; }
table.data th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
table.data th.sortable:hover { color: var(--accent); }
table.data .sort-mark { font-size: .75em; color: var(--accent); }
table.data tr.filters th { padding-top: 0; padding-bottom: .35rem; border-bottom: 2px solid var(--line); }
table.data tr.filters input { width: 100%; min-width: 4rem; padding: .2rem .35rem; font-size: .85rem; border: 1px solid var(--line); border-radius: 4px; }
table.data tr.filters th.num input { text-align: right; }
table.data tfoot td { font-weight: 600; border-top: 2px solid var(--line); border-bottom: none; }
.table-search { display: flex; align-items: center; gap: .8rem; margin-bottom: .6rem; flex-wrap: wrap; }
.table-search input { max-width: 360px; }
.table-search .spacer { flex: 1; }
.table-search button.excel { padding: .3rem .8rem; }
/* the partner's card */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .3rem 1.5rem; }
.card-grid > div > span:first-child { display: block; color: var(--muted); font-size: .85rem; }
.figures { display: flex; gap: 2rem; flex-wrap: wrap; }
.figures > div > b { display: block; font-size: 1.3rem; }
/* a field that searches its options as you type */
.search-select { position: relative; }
.search-select ul { position: absolute; z-index: 20; left: 0; right: 0; top: 100%; margin: 2px 0 0; padding: 0; list-style: none; background: var(--panel);
  border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 4px 14px rgba(0,0,0,.12); max-height: 18rem; overflow-y: auto; }
.search-select li { padding: .35rem .6rem; cursor: pointer; }
.search-select li.active, .search-select li:hover { background: #e8effa; }
.search-select li small { color: var(--muted); margin-left: .4rem; }
@media (max-width: 700px) { .topbar { flex-wrap: wrap; } }
/* entering by hand from the original: the field that takes the clicked block, the original as blocks of text */
input.pick-target { outline: 2px solid var(--accent); outline-offset: 1px; background: #eef4ff; }
.originals .toggle { display: inline-flex; gap: 0; margin-left: auto; }
.originals .toggle button { border-radius: 0; }
.originals .toggle button:first-child { border-radius: 6px 0 0 6px; }
.originals .toggle button:last-child { border-radius: 0 6px 6px 0; }
.markup { max-height: 80vh; overflow-y: auto; }
.markup-hint { position: sticky; top: 0; z-index: 2; background: var(--panel); margin: 0 0 .4rem; padding: .3rem 0; font-size: .9rem; }
.markup-hint:not(.muted) { color: var(--accent); font-weight: 600; }
.markup-page { position: relative; background: #fff; border: 1px solid var(--line); margin-bottom: .6rem; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.markup-block { position: absolute; padding: 0 1px; margin: 0; border: 1px solid transparent; border-radius: 2px; background: transparent;
  color: var(--text); line-height: 1; white-space: nowrap; overflow: hidden; text-align: left; cursor: pointer; font-family: inherit; }
.markup-block:hover { border-color: var(--accent); background: rgba(31, 95, 191, .12); z-index: 1; overflow: visible; }
.markup-block.used { background: rgba(30, 122, 60, .14); }
.feed-settings { border-top: 1px solid var(--line); margin-top: .6rem; padding-top: .6rem; }
.feed-settings ol.steps { padding-left: 1.3rem; }
.feed-settings ol.steps li { margin-bottom: .45rem; }
.markup { overflow: auto; }
.markup-zoom { display: flex; gap: .2rem; margin-bottom: .3rem; }
.markup-zoom button { padding: .15rem .5rem; font-size: .85rem; }
.markup-hint { left: 0; }
tr.suggest-row td { background: #f3f7ff; border-bottom: 2px solid var(--line); }
tr.suggest-row .inline-search { display: inline-block; min-width: 22rem; vertical-align: middle; }
.inline-category { display: inline-block; min-width: 12rem; vertical-align: middle; }
/* the original's page as a picture, its blocks over it: seen when the mouse is over them */
.markup-image { position: absolute; inset: 0; width: 100%; height: 100%; user-select: none; }
.markup-page.over-image .markup-block { color: transparent; background: rgba(31, 95, 191, .06); border-color: rgba(31, 95, 191, .35); }
.markup-page.over-image .markup-block:hover { color: transparent; border: 2px solid var(--accent); background: rgba(31, 95, 191, .22); overflow: hidden; }
.markup-page.over-image .markup-block.used { background: rgba(30, 122, 60, .22); border-color: rgba(30, 122, 60, .6); }

/* ---- look: calm colours, clear headings, soft depth (not loud) ---- */
:root {
  --bg: #f3f5f9;
  --heading: #17325a;
  --accent-soft: #e7effb;
  --line-soft: #e9edf3;
  --shadow: 0 1px 2px rgba(16, 32, 64, .05), 0 2px 8px rgba(16, 32, 64, .05);
  --focus: 0 0 0 3px rgba(31, 95, 191, .18);
}
body { background: var(--bg); }
h1 { color: var(--heading); font-weight: 600; font-size: 1.45rem; letter-spacing: -.01em; }
h2 { color: var(--heading); font-weight: 600; }
.panel { border-color: var(--line-soft); border-radius: 10px; box-shadow: var(--shadow); padding: 1.1rem 1.25rem; }
.panel > h2:first-child, .panel > form > h2:first-child { margin-top: 0; padding-bottom: .45rem; border-bottom: 1px solid var(--line-soft); }

.topbar { box-shadow: 0 1px 3px rgba(16, 32, 64, .06); position: sticky; top: 0; z-index: 30; }
.topbar .brand { color: var(--heading); font-size: 1.05rem; }
.topbar nav a { color: #384356; transition: background .12s; }
.topbar nav a:hover { background: var(--accent-soft); }
.topbar nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); border-radius: 6px 6px 2px 2px; }

label { color: #5a6475; font-weight: 500; font-size: .85rem; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
input::placeholder, textarea::placeholder { color: #a0a8b6; }
button { transition: background .12s, border-color .12s, box-shadow .12s; }
button:not(:disabled):hover { border-color: #b9c3d3; background: #f7f9fc; }
button.primary:not(:disabled):hover { background: #1a52a6; border-color: #1a52a6; }
button.danger:not(:disabled):hover { background: #fdecea; border-color: #f2b8b5; }
button:focus-visible, a:focus-visible { outline: none; box-shadow: var(--focus); }
button.link { color: var(--accent); }
button.link:hover { background: none !important; text-decoration: underline; }
.actions .push-right { margin-left: auto; }

table.data thead th, .panel table:not(.totals) > thead th { background: #f6f8fb; color: #5a6475; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
table.data thead th { background: #f6f8fb; }
table.data tr.filters th { background: #fff; text-transform: none; }
th, td { border-bottom-color: var(--line-soft); }

/* the number a new document gets */
.doc-number { margin: -.6rem 0 1rem; color: var(--muted); }
.doc-number b { color: var(--heading); font-family: Consolas, monospace; letter-spacing: .03em; }

/* a field's list: the "make a new one" line */
.search-select li.create { color: var(--accent); font-weight: 600; border-top: 1px solid var(--line-soft); }
.search-select li.create.active, .search-select li.create:hover { background: var(--accent-soft); }

/* a window over the page */
dialog.dialog { border: none; border-radius: 12px; padding: 1.1rem 1.4rem 1.3rem; width: min(560px, calc(100vw - 2rem));
  box-shadow: 0 12px 40px rgba(16, 32, 64, .25); color: var(--text); }
dialog.dialog.wide { width: min(860px, calc(100vw - 2rem)); }
dialog.dialog::backdrop { background: rgba(23, 50, 90, .28); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .4rem; border-bottom: 1px solid var(--line-soft); }
.dialog-head h2 { margin: 0 0 .5rem; }
.dialog-head .close { font-size: 1.6rem; line-height: 1; color: var(--muted); padding: 0 .3rem; }

/* rows under group headings (product categories) */
tr.group-row td { background: #eef2f8 !important; cursor: pointer; user-select: none; border-bottom: 1px solid #dfe5ee; }
tr.group-row:hover td { background: #e3eaf5 !important; }
tr.group-row .group-arrow { display: inline-block; width: 1rem; color: var(--accent); }
tr.group-row .group-summary { float: right; color: var(--muted); font-size: .85rem; }
/* keywords as chips; the editable list takes new ones in its own input */
.chips { display: inline-flex; flex-wrap: wrap; gap: .25rem; }
.chip { display: inline-flex; align-items: center; gap: .15rem; padding: .05rem .5rem; border-radius: 999px; background: var(--accent-soft); color: #23466f; font-size: .82rem; }
.chip button.link { padding: 0 0 0 .15rem; color: #6a7f9c; font-size: 1rem; line-height: 1; }
.chips.editable { display: flex; border: 1px solid var(--line); border-radius: 6px; padding: .35rem; min-height: 2.6rem; background: #fff; }
.chips.editable:focus-within { border-color: var(--accent); box-shadow: var(--focus); }
.chips.editable .chip-input { border: none; box-shadow: none; flex: 1 1 10rem; min-width: 8rem; padding: .15rem .3rem; }
.try-result { margin: .4rem 0 0; padding: .45rem .7rem; border-radius: 6px; background: #f6f8fb; }
.try-result.ok { background: #e6f4ea; color: var(--ok); }
.try-result.other { background: #fff6dd; color: #7a5a00; }
.try-result.none { background: #f6f8fb; color: var(--muted); }
tr.group-row .edit-group { margin-left: .3rem; color: var(--muted); font-size: .95rem; }
tr.group-row .edit-group:hover { color: var(--accent); }
/* a date in the user's format, the browser's calendar behind a button */
.date-input { position: relative; display: flex; align-items: stretch; width: 100%; }
.date-input > input:first-child { flex: 1; min-width: 0; padding-right: 2.2rem; font-variant-numeric: tabular-nums; }
.date-input .date-pick { position: absolute; right: 1px; top: 1px; bottom: 1px; width: 2rem; padding: 0; border: none; background: transparent; color: var(--muted); border-radius: 0 5px 5px 0; }
.date-input .date-pick:hover { color: var(--accent); background: var(--accent-soft) !important; }
.date-input .date-native { position: absolute; right: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; border: 0; padding: 0; }
.date-input.invalid > input:first-child { border-color: var(--danger); background: #fff7f6; }
.lock-date .date-input { width: 10rem; }
.inline-field { display: inline-flex; align-items: center; gap: .5rem; margin: 0; } .inline-field .date-input { width: 10.5rem; }
/* the journal: an entry's heading, its lines under it (credit side indented, as written by hand) */
.journal-filters { grid-template-columns: 11rem 11rem minmax(14rem, 1fr) minmax(12rem, 1fr); }
.journal-figures { margin-bottom: .8rem; }
.journal-figures > div > span { display: block; font-size: .8rem; }
.panel table.journal > tbody > tr { background: none !important; }
table.journal tr.entry-head td { background: #f3f6fb; border-top: 2px solid var(--line-soft); font-weight: 500; }
table.journal tr.entry-head a { color: var(--heading); text-decoration: none; }
table.journal tr.entry-head a:hover { text-decoration: underline; color: var(--accent); }
table.journal tr.entry-line td { border-bottom: 1px dashed var(--line-soft); padding-top: .25rem; padding-bottom: .25rem; }
table.journal td.credit-side { padding-left: 1.6rem; }
table.journal tr.on-account td { background: #fff8e1 !important; }
table.journal .code-link { font-family: Consolas, monospace; padding: 0; }
@media (max-width: 800px) { .journal-filters { grid-template-columns: 1fr 1fr; } }
button.excel { border-color: #9fd0ae; color: #1e6b3a; }
button.excel:not(:disabled):hover { background: #e6f4ea !important; border-color: #1e7a3c !important; }

/* a row opened for editing in the list */
.panel table > tbody > tr.opened > td { background: var(--accent-soft) !important; border-bottom: none; font-weight: 500; }
.panel table > tbody > tr.open-row > td { background: #f8fafd !important; border-left: 3px solid var(--accent); padding: .8rem 1rem 1rem; cursor: default; }
form.in-list .actions { margin-top: .6rem; }

table.lines input.discount { width: 4.5rem; }

/* the app's question / message window (dialogs.tsx) */
dialog.dialog.message { width: min(480px, calc(100vw - 2rem)); }
.message-text { white-space: pre-line; margin: .8rem 0 1rem; line-height: 1.5; }
dialog.dialog.message .actions { justify-content: flex-end; margin-top: 0; }
button.danger.solid { background: var(--danger); border-color: var(--danger); color: #fff; }
button.danger.solid:hover { filter: brightness(.92); }

/* the empty line at the end of an invoice: for the next one, never saved */
table.lines tr.blank-line input, table.lines tr.blank-line select { opacity: .6; }
table.lines tr.blank-line:focus-within input, table.lines tr.blank-line:focus-within select { opacity: 1; }

/* the supplier field takes the next block clicked in the original */
.pick-target-box input { outline: 2px solid var(--accent); outline-offset: 1px; background: #eef4ff; }

/* the buttons of a form or document (save, post, back to the list...): always at the bottom of the screen while
   the form is longer than it, over a soft band; in its place at the end once scrolled there */
.actions.sticky-bar {
  position: sticky; bottom: 0; z-index: 20;
  margin: 1rem -1.25rem -1.1rem; padding: .7rem 1.25rem;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border-top: 1px solid var(--line-soft); border-radius: 0 0 10px 10px;
  box-shadow: 0 -6px 14px -10px rgba(16, 32, 64, .25);
}
/* outside a panel (a posted invoice) and in a window: no panel edges to reach */
.invoice-side > .actions.sticky-bar, main > .actions.sticky-bar { margin: 1rem 0 0; border-radius: 10px; border: 1px solid var(--line-soft); }
dialog .actions.sticky-bar { margin: 1rem -1.4rem -1.3rem; border-radius: 0 0 12px 12px; }
form.in-list .actions.sticky-bar { margin: .6rem 0 0; border-radius: 8px; }

/* the Odoo import: the sales to decide on */
table.odoo-review td { vertical-align: top; }
table.odoo-review td.odoo-choice { min-width: 280px; }
table.odoo-review select { width: auto; }

/* how the invoice rounds its VAT, over its totals */
.vat-mode { display: flex; align-items: center; justify-content: flex-end; gap: .5rem; margin-top: .8rem; }
.vat-mode label { margin: 0; }
.vat-mode select { width: auto; }

/* the journal for Odoo: what goes, by group */
ul.odoo-groups { list-style: none; padding: 0; margin: .4rem 0; }
ul.odoo-groups li { padding: .3rem 0; border-bottom: 1px solid var(--line-soft); }
ul.odoo-groups li .muted.small { margin-left: 1.8rem; }

/* mail accounts and the letters of an invoice */
.mail-form .grid { margin-bottom: .4rem; }
.panel.letters ul.file-list { margin: .6rem 0 0; }

/* the numbering of the company */
dialog .data input { width: auto; }

/* how to get a Gmail app password, under the mail form */
.mail-help { background: var(--accent-soft, #eef4ff); border-radius: 8px; padding: .6rem .9rem; margin: .4rem 0 .6rem; font-size: .9rem; }
.mail-help ol { margin: .3rem 0 .4rem 1.2rem; padding: 0; }
.mail-help p { margin: .2rem 0 0; color: var(--muted); }

/* which Odoo product the invoice lines go under */
.odoo-products { margin-top: .8rem; }
.odoo-products h4 { margin: .2rem 0; }
.odoo-products table input { width: 100%; }
.odoo-products .warn { color: var(--warn, #b26a00); }
.odoo-products select { margin-top: .4rem; width: auto; }

/* the transfer to Odoo: the invoices and what changed in them */
.odoo-invoices { list-style: none; padding: 0; margin: .3rem 0 .6rem; }
.odoo-invoices > li { padding: .35rem 0; border-bottom: 1px solid var(--border, #e5e7eb); }
.odoo-invoices table.changes { margin: .3rem 0; font-size: .85rem; width: auto; }
.odoo-invoices table.changes td { padding: .1rem .5rem; }
.odoo-invoices table.changes td.was { color: var(--muted); text-decoration: line-through; }
/* in the lists of the transfer the ticks sit at the left, with their text */
ul.odoo-groups label.tick, ul.odoo-invoices label.tick { justify-content: flex-start; gap: .4rem; margin: 0; padding: .15rem 0; flex-wrap: wrap; }

/* the moves of the transfer, each to choose, its lines to look at */
.odoo-move-group { margin: .4rem 0 .6rem; }
ul.odoo-moves { list-style: none; padding: 0 0 0 1.6rem; margin: .2rem 0; }
ul.odoo-moves > li { padding: .15rem 0; border-bottom: 1px solid var(--line-soft); }
ul.odoo-moves details summary { cursor: pointer; margin-left: 1.6rem; }
ul.odoo-moves details table { margin: .2rem 0 .4rem 1.6rem; width: auto; font-size: .85rem; }
.odoo-move-group label.tick, label.tick.all { justify-content: flex-start; gap: .4rem; margin: 0; padding: .15rem 0; }
details.odoo-howto { margin: .3rem 0 .6rem; background: var(--accent-soft, #eef4ff); border-radius: 8px; padding: .4rem .8rem; font-size: .9rem; }
details.odoo-howto summary { cursor: pointer; font-weight: 600; }
details.odoo-howto ol { margin: .3rem 0 .3rem 1.2rem; padding: 0; }
.empty-moves { background: var(--accent-soft, #eef4ff); border-radius: 8px; padding: .5rem .8rem; font-size: .9rem; }

/* a page over another one (an invoice over the journal) */
dialog.dialog.full { width: min(1400px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); padding-bottom: .6rem; }
dialog.dialog.full .sticky-actions, dialog.dialog.full .actions.sticky { position: static; }

table.data.numbering-check { width: auto; }

/* the journal: entries to tick, the numbering under the buttons */
table.journal th.pick, table.journal td.pick, table.open-bank th.pick, table.open-bank td.pick { width: 1.6rem; padding-right: 0; }
table.journal tr.entry-head.picked td { background: var(--accent-soft, #eef4ff); }
.numbering-line { margin-top: .5rem; display: flex; flex-wrap: wrap; gap: .3rem .8rem; align-items: center; }
p.note { background: var(--accent-soft, #eef4ff); border-radius: 8px; padding: .4rem .8rem; font-size: .9rem; }

/* the ticked entries' figures after the whole period's, set apart */
.journal-figures .figures-gap { margin-left: 1.2rem; padding-left: 1.2rem; border-left: 1px solid var(--line-soft); }

/* the transfer to Odoo, step by step: one step open, done ones ticked */
.odoo-steps { display: flex; flex-direction: column; gap: .4rem; }
.odoo-step { border: 1px solid var(--line-soft); border-radius: 10px; }
.odoo-step.open { border-color: var(--accent, #2f5fbf); }
.odoo-step-head { display: flex; align-items: center; gap: .6rem; width: 100%; background: none; border: none; padding: .55rem .8rem; cursor: pointer; text-align: left; font: inherit; color: inherit; }
.odoo-step-n { display: inline-flex; align-items: center; justify-content: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--line-soft); font-weight: 600; flex: none; }
.odoo-step.open .odoo-step-n { background: var(--accent, #2f5fbf); color: #fff; }
.odoo-step.done .odoo-step-n { background: #2e8b57; color: #fff; }
.odoo-step-title { font-weight: 600; flex: 1; }
.odoo-step-body { padding: 0 .9rem .8rem 3rem; }
.odoo-step-body h4 { margin: .6rem 0 .2rem; }
.odoo-step-next { justify-content: flex-end; }
ol.odoo-howto-list { margin: .3rem 0 .5rem 1.2rem; padding: 0; }
ol.odoo-howto-list li { margin: .2rem 0; }
ol.odoo-howto-list ul.fields { margin: .2rem 0 .2rem 1rem; padding: 0; }
.odoo-ids-result ul { margin: .2rem 0 .4rem 1.2rem; padding: 0; }
.error-text { color: var(--danger, #b42318); margin: .3rem 0 0; }

.odoo-invoices .warn { color: var(--warn, #b26a00); margin-left: 1.6rem; }

/* step 5: the files from Odoo, chosen or dropped */
label.odoo-drop { display: flex; flex-direction: column; align-items: center; gap: .3rem; text-align: center; cursor: pointer;
  border: 2px dashed var(--accent, #2f5fbf); border-radius: 10px; padding: 1rem; margin: .4rem 0; background: var(--accent-soft, #eef4ff); }
label.odoo-drop.over, label.odoo-drop:hover { background: #dfe9ff; }
.badge.muted-badge { background: var(--line-soft); color: var(--muted); }

/* step 2: the check of the numbering, plain to see, needed to go on */
label.numbering-confirm { display: flex; gap: .7rem; align-items: flex-start; margin: .7rem 0 .2rem; padding: .7rem .9rem; cursor: pointer;
  border: 2px solid var(--warn, #b26a00); border-radius: 10px; background: #fff7e6; }
label.numbering-confirm input { width: 1.4rem; height: 1.4rem; margin: .1rem 0 0; flex: none; cursor: pointer; }
label.numbering-confirm.checked { border-color: #2e8b57; background: #eaf6ee; }

/* the numbering: the whole table in the window, the button under it */
table.data.numbering-edit { width: 100%; table-layout: auto; }
table.data.numbering-edit td { padding: .3rem .35rem; }
table.data.numbering-edit input { width: 100%; min-width: 0; box-sizing: border-box; }
table.data.numbering-edit td:nth-child(2) { width: 32%; }
table.data.numbering-edit td:nth-child(3), table.data.numbering-edit td:nth-child(5) { width: 3.6rem; }
table.data.numbering-edit td:nth-child(4) { width: 5rem; }
table.data.numbering-edit td:nth-child(6) { width: 6rem; }
table.data.numbering-edit code { white-space: nowrap; font-size: .85rem; }

.odoo-unlinked { border: 1px solid var(--warn, #b26a00); border-radius: 8px; padding: .3rem .8rem .5rem; margin: .5rem 0; background: #fff7e6; }
.odoo-unlinked h4 { margin: .3rem 0 .2rem; }

/* the kind of a new company */
.kind-choice { display: flex; gap: .8rem; flex-wrap: wrap; margin: .3rem 0 .6rem; }
.kind-choice label.kind { flex: 1 1 16rem; display: flex; flex-direction: column; gap: .2rem; border: 2px solid var(--line-soft); border-radius: 10px; padding: .6rem .8rem; cursor: pointer; }
.kind-choice label.kind.on { border-color: var(--accent, #2f5fbf); background: var(--accent-soft, #eef4ff); }
/* the radio itself is not shown (the card is the choice): kept inside its card, a point in size - it once stretched the page sideways */
.kind-choice label.kind { position: relative; }
.kind-choice label.kind input { position: absolute; left: 0; top: 0; width: 1px; height: 1px; padding: 0; border: 0; opacity: 0; pointer-events: none; }

/* the lines of the utilities in a lease */
table.data.lease-items input, table.data.lease-items select { width: 100%; min-width: 0; box-sizing: border-box; }
table.data.lease-items td:nth-child(3) { width: 5rem; }
table.data.lease-items td:nth-child(4), table.data.lease-items td:nth-child(5) { width: 6.5rem; }

/* the month of the utilities */
.utilities-period { display: flex; align-items: center; gap: 1rem; }
.utilities-period h2 { margin: 0; }
.utilities-period > button { font-size: 1.2rem; padding: .2rem .8rem; }
table.data.utilities-lines input { width: 100%; min-width: 0; box-sizing: border-box; }
table.data.utilities-lines td:nth-child(3), table.data.utilities-lines td:nth-child(4) { width: 7rem; }
table.data.utilities-lines td:nth-child(5), table.data.utilities-lines td:nth-child(6) { width: 6rem; }
table.data.utilities-lines input.need { border-color: var(--warn, #b26a00); background: #fff7e6; }
pre.utilities-log { white-space: pre-wrap; font-size: .85rem; background: var(--line-soft); padding: .5rem .7rem; border-radius: 6px; }

/* the mailbox for the suppliers' bills */
ul.inbox-letters { list-style: none; padding: 0; margin: 0; }
ul.inbox-letters > li { padding: .5rem 0; border-bottom: 1px solid var(--line-soft); }
ul.inbox-letters ul { margin: .2rem 0 0 1rem; padding: 0; list-style: none; }
ul.inbox-letters li.state-failed .badge { background: #fde8e8; }
ul.inbox-letters li.state-draft .badge, ul.inbox-letters li.state-utility .badge { background: #eaf6ee; }
details.inbox-settings summary { cursor: pointer; }
details.inbox-year { border-top: 1px solid var(--line); padding: .4rem 0; }
details.inbox-year:first-of-type { border-top: 0; }
details.inbox-year > summary { cursor: pointer; font-size: 1.05rem; padding: .2rem 0; }
details.inbox-month { margin: .3rem 0 .3rem 1rem; }
details.inbox-month > summary { cursor: pointer; font-weight: 600; padding: .2rem 0; }
details.inbox-month > ul.inbox-letters { margin-left: 1rem; }
input.num.invalid { border-color: var(--danger); background: #fff7f6; }

/* Tele2: the bills by month, each person's share as it is sent, their account */
.tele2-bills { flex-wrap: wrap; }
.tele2-shares { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .8rem; margin: .8rem 0; }
.tele2-share { border: 1px solid var(--line); border-radius: 8px; padding: .6rem .8rem; background: var(--panel); }
.tele2-share.own { opacity: .75; }
.tele2-share-head { display: flex; gap: .5rem; align-items: baseline; }
.tele2-share-head .num { margin-left: auto; font-weight: 600; }
.tele2-share pre, pre.tele2-check { white-space: pre-wrap; font-family: inherit; font-size: .9rem; margin: .4rem 0; }
pre.tele2-check { color: var(--muted); border-top: 1px solid var(--line); padding-top: .5rem; }
pre.tele2-check.bad { color: var(--danger); }
tr.tele2-guess td { background: #eef6ff; }
.tele2-ledger { padding: .4rem 0 .8rem; }
.tele2-extra { align-items: end; }
td.nowrap, span.nowrap { white-space: nowrap; }
details.tele2-others { margin-top: .8rem; }
details.tele2-others > summary { cursor: pointer; color: var(--muted); }
.loading { display: flex; align-items: center; justify-content: center; gap: .6rem; padding: 2.5rem 1rem; color: var(--muted); font-size: 1rem; }
.loading .spinner { width: 1.4rem; height: 1.4rem; }
.bank-tools { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: .4rem; }
.bank-tools input[type=search] { flex: 1 1 260px; max-width: 420px; }
.payment-editor tr.picked td { background: #eef6ff; }

/* the menu's "More": what is not used every day */
.topbar nav details.more { position: relative; }
.topbar nav details.more > summary { list-style: none; cursor: pointer; padding: .3rem .55rem; border-radius: 6px; white-space: nowrap; }
.topbar nav details.more > summary::-webkit-details-marker { display: none; }
.topbar nav details.more > summary::after { content: ' ▾'; color: var(--muted); }
.topbar nav details.more.active > summary { background: var(--accent); color: var(--accent-text); }
.topbar nav details.more.active > summary::after { color: var(--accent-text); }
.topbar nav .more-menu { position: absolute; top: calc(100% + .3rem); left: 0; z-index: 30; min-width: 12rem; display: flex; flex-direction: column; gap: .1rem;
  padding: .35rem; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.14); }
.tabs .count { display: inline-block; min-width: 1.3em; padding: 0 .35em; border-radius: 999px; background: var(--danger); color: #fff; font-size: .8em; text-align: center; }

/* the dates to keep: overdue in red, those within two weeks marked */
table.deadlines tr.due-overdue td { background: #fdf0ef; }
table.deadlines tr.due-done td { color: var(--muted); }
.badge.overdue { background: #fde8e8; color: var(--danger); }
details.deadline-rules { margin-top: .8rem; }
details.deadline-rules > summary { cursor: pointer; color: var(--muted); }
.topbar nav a .count { display: inline-block; min-width: 1.3em; padding: 0 .35em; border-radius: 999px; background: var(--danger); color: #fff; font-size: .8em; text-align: center; }

/* the site is away for a moment (being updated): said at the top, the page goes on by itself */
.waiting-bar { position: sticky; top: 0; z-index: 50; padding: .45rem 1rem; text-align: center; background: #fff7dc; border-bottom: 1px solid #ecd9a0; }
.waiting-bar.error { background: #fde8e8; border-color: #f0c2c2; }
table.data tr.month td:first-child { padding-left: 1.6rem; }
.regime { margin: .2rem 0; }
/* what the tick of the books gives, said under it: a note, not wider than a line is read */
.books-note { margin: .1rem 0 .35rem; max-width: 34rem; white-space: normal; }
.regime select { width: auto; max-width: 100%; font-size: inherit; padding: .15rem .3rem; }

/* the company's other accounts: room for an IBAN or two */
input.ibans { width: 22rem; max-width: 100%; }

/* a month of the year's summary opened: the register's rows its sums are made of */
table.data tr.month-rows > td { padding: .4rem .6rem .8rem 1.6rem; background: var(--panel, #fff); }
table.data tr.month-rows table.data { margin: 0; }
button.link.expand { color: inherit; text-align: left; }

/* the "?" of a page: its section of the guide */
main { position: relative; }
a.help-link { position: absolute; top: 1rem; left: 1rem; width: 1.8rem; height: 1.8rem; line-height: 1.8rem; text-align: center; border-radius: 50%;
  background: var(--accent, #3458b8); color: #fff; font-weight: 700; font-size: 1.05rem; text-decoration: none; box-shadow: 0 1px 3px rgba(0,0,0,.18); }
a.help-link:hover { filter: brightness(1.15); }
/* the "?" stands before the page's title */
main:has(> a.help-link) h1 { padding-left: 2.4rem; }
/* the guide as a window over the page: moved by its head, stretched by its corner */
.help-window { position: fixed; z-index: 50; display: flex; flex-direction: column; min-width: 280px; min-height: 200px; max-width: calc(100vw - 16px); max-height: calc(100vh - 16px);
  background: var(--panel, #fff); border: 1px solid var(--line, #dde1e8); border-radius: 10px; box-shadow: 0 10px 34px rgba(23, 50, 90, .28); resize: both; overflow: hidden; }
.help-window-head { display: flex; align-items: center; gap: .5rem; padding: .45rem .6rem; background: var(--accent-soft, #e7effb); border-bottom: 1px solid var(--line, #dde1e8);
  cursor: move; user-select: none; touch-action: none; flex: none; }
.help-window-head select { flex: 1; min-width: 0; width: auto; }
.help-window-head a, .help-window-head button.link { flex: none; font-size: 1.25rem; line-height: 1; text-decoration: none; padding: 0 .25rem; cursor: pointer; }
.help-window-text { flex: 1; overflow: auto; padding: .2rem 1rem 1.2rem; max-width: none; }
.help-window-text h2 { margin-top: .8rem; }
/* a name in the guide that is on the page, and the thing of the page it points at */
.guide-ref { border-bottom: 2px dotted var(--accent, #1f5fbf); cursor: pointer; background: var(--accent-soft, #e7effb); border-radius: 3px; padding: 0 .1rem; }
.guide-ref:hover, .guide-ref:focus-visible { background: #ffe9a8; outline: none; }
.guide-shown { outline: 3px solid #f5a300 !important; outline-offset: 3px; border-radius: 4px; animation: guide-ring 1.3s ease-out 2; position: relative; z-index: 2; }
@keyframes guide-ring { 0% { box-shadow: 0 0 0 0 rgba(245, 163, 0, .75); } 100% { box-shadow: 0 0 0 16px rgba(245, 163, 0, 0); } }
/* the guide: its sections beside the text */
.guide { display: grid; grid-template-columns: minmax(12rem, 17rem) minmax(0, 1fr); gap: 1rem; align-items: start; }
.guide-list { display: flex; flex-direction: column; gap: .1rem; position: sticky; top: 1rem; }
.guide-list a { padding: .35rem .6rem; border-radius: 6px; text-decoration: none; color: inherit; }
.guide-list a.active { background: #eef2fb; font-weight: 600; }
.guide-text { max-width: 60rem; line-height: 1.55; }
.guide-text h3 { margin: 1.3rem 0 .4rem; }
.guide-text li { margin: .3rem 0; }
@media (max-width: 800px) { .guide { grid-template-columns: 1fr; } .guide-list { position: static; } }

/* the suppliers whose bills are the utilities' */
.utility-suppliers { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1rem; max-width: 34rem; }
.utility-supplier { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .3rem .6rem; border: 1px solid var(--line, #dde1e8); border-radius: 6px; background: var(--panel, #fff); }
.utility-supplier span.muted { white-space: nowrap; }
.utility-supplier button.link { font-size: 1.2rem; line-height: 1; padding: 0 .2rem; }
.utility-supplier-add { margin-top: .2rem; }

/* the gears of an update: as on the page shown while the site is stopped */
.gears { display: inline-block; position: relative; width: 120px; height: 96px; }
.gears .gear { position: absolute; fill: var(--accent, #1f5fbf); height: auto; }
.gears .g1 { width: 60%; left: 3%; top: 12%; animation: gear-spin 6s linear infinite; }
.gears .g2 { width: 38%; right: 3%; top: 0; opacity: .55; animation: gear-spin 4s linear infinite reverse; }
.gears.small { width: 34px; height: 27px; vertical-align: middle; margin-right: .35rem; }
@keyframes gear-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .gears .gear { animation: none; } }
.waiting-screen { display: grid; justify-items: center; gap: 1rem; margin: 18vh auto 0; max-width: 30rem; text-align: center; color: var(--muted, #6a7282); }

/* a form watched for changes not saved: no box of its own */
.unsaved-scope { display: contents; }
h2 label.check.inline { font-size: .9rem; font-weight: 400; margin-left: 1rem; }

/* a part of a form that is opened for changes by its own tick */
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; }
/* protected: the fields are dimmed, not what says whether the lease is in force */
fieldset.plain:disabled .grid, fieldset.plain:disabled table, fieldset.plain:disabled .utility-suppliers, fieldset.plain:disabled > p { opacity: .78; }
h2 label.lease-state { padding: .15rem .7rem .15rem .5rem; border-radius: 999px; font-weight: 600; }
h2 label.lease-state.on { background: #dff5e3; color: #17692d; border: 1px solid #9fd8ab; }
h2 label.lease-state.off { background: #fde8e8; color: #9b1c1c; border: 1px solid #f0b4b4; }
fieldset.plain:disabled .utility-supplier button.link, fieldset.plain:disabled .utility-supplier-add { display: none; }
.lease-unlock { display: block; margin-bottom: .8rem; padding: .45rem .7rem; background: var(--accent-soft, #e7effb); border-radius: 6px; }

/* the lease in blocks: the contract, the rent, the utilities - each apart, with its own colour at the edge */
.lease-block { border-left: 5px solid var(--accent, #1f5fbf); margin-bottom: 1.2rem; }
.lease-block > h2, .lease-block > fieldset > h2 { margin-top: 0; padding-bottom: .45rem; border-bottom: 1px solid var(--line, #dde1e8); }
.lease-block.rent { border-left-color: #2e9a4c; }
.lease-block.utilities { border-left-color: #d9861a; }
.lease-block h3 { margin: 1.3rem 0 .4rem; padding-top: .9rem; border-top: 1px dashed var(--line, #dde1e8); }
.lease-unlock { margin-top: .6rem; }
.lease-save { background: var(--panel, #fff); padding: .7rem 1rem; border: 1px solid var(--line, #dde1e8); border-radius: 8px; }

/* whether a lease is in force: on its tab and beside its title */
.lease-state { display: inline-block; margin-left: .6rem; padding: .08rem .6rem; border-radius: 999px; font-size: .8rem; font-weight: 600; vertical-align: middle; }
.lease-state.on { background: #dff5e3; color: #17692d; border: 1px solid #9fd8ab; }
.lease-state.off { background: #fde8e8; color: #9b1c1c; border: 1px solid #f0b4b4; }
h2 .lease-state { font-size: .9rem; margin-left: 1rem; }

/* a button that picks a file: a label over a hidden field */
label.button { display: inline-block; font: inherit; padding: .45rem .9rem; border-radius: 6px; border: 1px solid var(--line); background: #fff; color: var(--text); cursor: pointer; font-weight: 400; margin: 0; }
label.button:hover { border-color: var(--accent); }
label.button.busy { opacity: .6; cursor: default; }
.lease-files .file-list { margin-top: 0; }

/* the free version said on a page */
.plan-notice { margin: .6rem 0; }
/* the page of the texts: a text in its three languages at the left, where it is used and its picture at the right */
.texts-filter { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.texts-filter select { width: auto; max-width: 18rem; }
.texts-filter input { flex: 1 1 14rem; min-width: 10rem; }
.text-row { display: flex; gap: 1.2rem; align-items: flex-start; border-left: 4px solid var(--line); }
.text-row.text-reviewed { border-left-color: #8fd0a3; }
.text-row.text-approved { border-left-color: #1e7a3c; }
.text-former > div { margin: .3rem 0 .3rem .6rem; }
.text-row.text-changed { border-left-color: var(--accent); }
.text-langs { flex: 1 1 0; min-width: 0; }
.text-langs > label { display: block; margin: 0 0 .5rem; }
.text-lang { display: inline-block; font-size: .75rem; font-weight: 700; color: var(--muted); letter-spacing: .04em; }
.text-lang .badge { margin-left: .4rem; }
.text-langs textarea { width: 100%; resize: vertical; font: inherit; }
.text-langs textarea.invalid { border-color: var(--danger); }
.text-was { display: block; white-space: pre-wrap; }
.text-parts code { background: var(--accent-soft, #e7effb); border-radius: 4px; padding: 0 .3rem; margin-right: .25rem; }
.text-where { flex: 0 0 460px; max-width: 100%; }
.text-where > div { margin-bottom: .35rem; }
.text-noshot { padding: .6rem; border: 1px dashed var(--line); border-radius: 8px; }
.text-shot { position: relative; display: block; overflow: hidden; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: zoom-in; max-width: 100%; }
.text-shot img, .text-shot-full img { position: absolute; max-width: none; }
.text-shot i, .text-shot-full i { position: absolute; border: 3px solid #e0271a; border-radius: 6px; box-shadow: 0 0 0 9999px rgba(20, 30, 50, .14); pointer-events: none; }
.text-shot-full { position: fixed; inset: 0; z-index: 60; background: rgba(15, 23, 42, .6); padding: 2vh 2vw; cursor: zoom-out; }
.text-shot-full > div { width: 100%; height: 100%; overflow: auto; background: #fff; border-radius: 8px; }
.text-shot-full > div > div { position: relative; }
.text-shot-full img { left: 0; top: 0; }
@media (max-width: 1100px) { .text-row { flex-direction: column; } .text-where { flex-basis: auto; width: 100%; } }
/* what the subscription would do here: a line under the heading of the step that is done by hand */
.plan-hint { margin: .35rem 0 .6rem; padding: .4rem .7rem; border-radius: 8px; background: var(--accent-soft, #e7effb); color: var(--heading, #17325a); font-size: .9rem; }
.plan-hint a { font-weight: 600; white-space: nowrap; }
/* a company's subscription in the table: one thing under another, so the table is no wider for it */
.subscription { display: grid; gap: .3rem; justify-items: start; max-width: 11rem; }
.subscription .lease-state { white-space: normal; border-radius: 10px; }
.subscription .date-input, .subscription input[type=date] { width: 10rem; }

/* under the sign-in form: the way to register, and back */
.register-link { margin: 1rem 0 0; font-size: .9rem; }
/* under the password, at the right: apart from the way to a new account, which stands under the button */
.inbox-address { font-size: 1.1rem; display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; margin: .2rem 0 .4rem; }
.inbox-address b { user-select: all; overflow-wrap: anywhere; }
.forgot { text-align: right; font-size: .9rem; margin-top: .4rem; }

/* a supplier's bill template: the sample's pages with the regions on them, and what each region is beside */
.template-new { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.template-new > :first-child { min-width: 18rem; flex: 0 1 26rem; }
label.button.disabled { opacity: .55; cursor: default; }
.template-editor { display: grid; grid-template-columns: minmax(0, 1fr) 22rem; gap: 1rem; align-items: start; }
.template-pages { min-width: 0; }
.template-page { cursor: crosshair; user-select: none; }
.template-text { position: absolute; border: 1px dotted rgba(31, 95, 191, .35); border-radius: 2px; pointer-events: none; overflow: hidden; white-space: nowrap; line-height: 1.1; }
.template-text.shown { color: var(--text); border-color: transparent; }
.template-region { position: absolute; border: 2px solid #1f5fbf; background: rgba(31, 95, 191, .16); border-radius: 2px; cursor: pointer; box-sizing: border-box; }
.template-region b { position: absolute; left: -2px; top: -1.25rem; font-size: .75rem; line-height: 1.1rem; min-width: 1.1rem; text-align: center; color: #fff; background: #1f5fbf; border-radius: 3px; padding: 0 .2rem; }
.template-region.kind-period, .template-number.kind-period { border-color: #8a4fbf; }
.template-region.kind-period { background: rgba(138, 79, 191, .16); } .template-region.kind-period b, .template-number.kind-period { background: #8a4fbf; }
.template-region.kind-quantity, .template-region.kind-reading { border-color: #1e7a3c; background: rgba(30, 122, 60, .16); }
.template-region.kind-quantity b, .template-region.kind-reading b, .template-number.kind-quantity, .template-number.kind-reading { background: #1e7a3c; }
.template-region.chosen { box-shadow: 0 0 0 3px rgba(240, 160, 0, .75); z-index: 1; }
.template-region.drawing { border-style: dashed; pointer-events: none; }
.template-side { position: sticky; top: .6rem; max-height: calc(100vh - 1.2rem); overflow-y: auto; margin: 0; }
.template-region-row { border: 1px solid var(--line); border-radius: 6px; padding: .4rem .5rem; margin-bottom: .45rem; display: grid; gap: .3rem; cursor: pointer; }
.template-region-row.chosen { border-color: #f0a000; box-shadow: 0 0 0 2px rgba(240, 160, 0, .35); }
.template-region-head { display: flex; gap: .4rem; align-items: center; }
.template-region-head select { flex: 1; min-width: 0; }
.template-number { display: inline-block; min-width: 1.3rem; text-align: center; color: #fff; background: #1f5fbf; border-radius: 3px; font-size: .8rem; padding: .05rem .25rem; }
.template-problems { margin: .4rem 0; padding-left: 1.1rem; color: #9b1c1c; font-size: .85rem; }
.ok-text { color: #17692d; } .error-text { color: #9b1c1c; }
@media (max-width: 900px) { .template-editor { grid-template-columns: 1fr; } .template-side { position: static; max-height: none; } }

/* ------------------------------------------------------------------ a phone
   The same pages on a narrow screen: the menu folded under a button, one column, tables that scroll inside their
   panel (the page itself never scrolls sideways), controls large enough for a finger. */
.menu-toggle { display: none; }
@media (max-width: 820px) {
  html { font-size: 16px; }
  .topbar { flex-wrap: wrap; gap: .5rem; padding: .5rem .6rem; }
  .topbar > select { flex: 1 1 8rem; min-width: 0; width: auto; max-width: none; }
  .menu-toggle { display: block; flex: none; margin-left: auto; min-width: 2.6rem; min-height: 2.4rem; font-size: 1.2rem; line-height: 1; padding: .2rem .6rem; }
  .topbar nav, .topbar .spacer, .topbar > select.language, .topbar > .user, .topbar > button:not(.menu-toggle) { display: none; }
  .topbar.menu-open { max-height: 100vh; max-height: 100dvh; overflow-y: auto; }
  .topbar.menu-open nav { display: flex; flex-direction: column; flex: 1 0 100%; order: 5; gap: .15rem; }
  .topbar.menu-open nav a, .topbar.menu-open nav details.more > summary { padding: .65rem .7rem; font-size: 1.05rem; white-space: normal; }
  .topbar.menu-open nav .more-menu { position: static; box-shadow: none; border: none; border-left: 3px solid var(--line); border-radius: 0; margin-left: .6rem; padding: 0 0 0 .3rem; min-width: 0; }
  .topbar.menu-open > select.language { display: block; order: 6; flex: 1 1 5rem; }
  .topbar.menu-open > .user { display: block; order: 7; flex: 1 1 8rem; padding: .5rem 0; overflow: hidden; text-overflow: ellipsis; }
  .topbar.menu-open > button:not(.menu-toggle) { display: block; order: 8; min-height: 2.4rem; }

  main { padding: .6rem; }
  h1 { font-size: 1.2rem; margin-bottom: .7rem; }
  .panel { padding: .75rem .7rem; border-radius: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .narrow { margin: 1rem .6rem; max-width: none; }
  .grid { grid-template-columns: 1fr; }
  button, label.button, a.button, input, select, textarea { min-height: 2.5rem; }
  input[type=checkbox], input[type=radio] { min-height: 0; width: 1.25rem; height: 1.25rem; vertical-align: middle; }
  button.link { min-height: 0; }
  .actions { gap: .5rem; }
  table.data thead th, .panel table thead th { position: static; }
  th, td { padding-left: .4rem; padding-right: .4rem; }
  dialog.dialog, dialog.dialog.wide, dialog.dialog.message { width: calc(100vw - 1rem); max-width: none; max-height: calc(100dvh - 1rem); padding: .9rem .9rem 1rem; }
  dialog .actions.sticky-bar { margin: 1rem -.9rem -1rem; }
  .title-row { flex-wrap: wrap; gap: .4rem; }
  .template-new > :first-child { min-width: 0; flex: 1 1 100%; }
  .lock-date { flex-wrap: wrap; }
}

/* a phone: the rows of a list are cards - each value beside the name of its column, nothing off the screen */
@media (max-width: 820px) {
  table.cards, table.cards > tbody, table.cards > tfoot { display: block; width: 100%; }
  table.cards > thead { display: none; }
  table.cards > tbody > tr { display: block; border: 1px solid var(--line); border-radius: 8px; margin: .5rem 0; padding: .45rem .65rem; background: var(--panel) !important; }
  table.cards > tbody > tr.clickable:active { background: var(--accent-soft) !important; }
  table.cards > tbody > tr > td { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; border: none; padding: .14rem 0; text-align: right; white-space: normal; overflow-wrap: anywhere; }
  table.cards > tbody > tr > td[data-label]::before { content: attr(data-label); flex: none; max-width: 45%; text-align: left; color: var(--muted); font-size: .8rem; }
  table.cards > tbody > tr > td:empty { display: none; }
  table.cards > tbody > tr > td:first-child { font-weight: 600; font-size: 1.02rem; }
  table.cards > tbody > tr.group-row, table.cards > tbody > tr.empty { border: none; padding: .3rem 0; margin: .3rem 0 0; background: none !important; }
  table.cards > tbody > tr.group-row > td, table.cards > tbody > tr.empty > td, table.cards > tbody > tr.open-row > td { display: block; text-align: left; font-weight: 400; font-size: 1rem; }
  table.cards > tbody > tr.open-row { border-color: var(--accent); margin-top: -.3rem; }
  table.cards > tbody > tr.opened { border-color: var(--accent); }
  table.cards > tfoot > tr { display: flex; flex-wrap: wrap; gap: .2rem 1rem; justify-content: space-between; padding: .4rem .2rem; }
  table.cards > tfoot > tr > td { display: block; border: none; padding: 0; }
  table.cards > tfoot > tr > td:empty { display: none; }
  /* a table written by hand (cards.ts names its cells by its heading): a cell across the columns is a line of text, a
     field or a choice in a cell takes what the name leaves, the widths of the wide screen do not hold */
  table.cards[data-cards-from] > tbody > tr > td { width: auto !important; min-width: 0 !important; align-items: center; }
  table.cards > tbody > tr > td[colspan]:not([colspan="1"]) { display: block; text-align: left; font-weight: 400; font-size: 1rem; }
  table.cards[data-cards-from] > tbody > tr > td > :where(input:not([type=checkbox]):not([type=radio]), select, textarea, .search-select) { flex: 1 1 8rem; min-width: 0; max-width: 64%; width: auto; }
  table.cards[data-cards-from] > tbody > tr > td:first-child:has(> input[type=checkbox]:only-child) { justify-content: flex-start; }
  table.cards[data-cards-from] { width: 100% !important; }
  /* a cell with more in it than a value: its name above it, what is in it as it is on the wide screen */
  table.cards > tbody > tr > td[data-rich] { display: block; text-align: left; }
  table.cards > tbody > tr > td[data-rich][data-label]::before { display: block; max-width: none; margin-bottom: .15rem; }
  table.cards[data-cards-from] > tbody > tr > td:first-child > :where(div, label, p, small) { font-weight: 400; font-size: .92rem; }
}
@media (max-width: 820px) {
  /* the colour of a row's payment: on the card's own edge, not over the first value */
  table.cards > tbody > tr[class*="pay-row-"] > td:first-child { box-shadow: none; }
  table.cards > tbody > tr.pay-row-overdue { border-left: 5px solid var(--danger); }
  table.cards > tbody > tr.pay-row-partial { border-left: 5px solid #e0a800; }
  table.cards > tbody > tr.pay-row-paid { border-left: 5px solid var(--ok); }
  table.cards tr.month td:first-child { padding-left: 0; }
}
@media (max-width: 820px) {
  /* the month's utilities: a line is a card, its readings typed with a finger */
  table.utilities-lines.cards > tbody > tr > td { align-items: center; }
  table.utilities-lines.cards input { width: 9rem; text-align: right; }
  table.utilities-lines.cards > tbody > tr > td:first-child::before { content: none; }
  table.utilities-lines.cards > tbody > tr > td:first-child { justify-content: flex-start; text-align: left; }
}
@media (max-width: 820px) {
  /* the widths of the columns of the wide screen do not hold on a card: a value takes the row's width, the field is large */
  table.data.utilities-lines.cards > tbody > tr > td { width: auto !important; min-height: 2.6rem; }
  table.data.utilities-lines.cards input { width: 9.5rem; flex: none; text-align: right; font-size: 1.05rem; }
  /* a table kept as a table scrolls inside its panel: its cells do not break into letters */
  .panel > table:not(.cards) th, .panel > table:not(.cards) td { white-space: nowrap; }
  .panel > table:not(.cards) td:first-child { white-space: normal; min-width: 9rem; }
}
@media (max-width: 820px) { .regime select, .regime input { max-width: 78vw; } }

/* paying for the subscription */
.pay-row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.pay-row select { width: auto; min-width: 12rem; }
table.pay-history { width: auto; margin-top: .8rem; }
table.pay-history td, table.pay-history th { padding-right: 1.5rem; }

/* the terms and the privacy policy: plain text as written */
.legal-text { white-space: pre-wrap; line-height: 1.5; }
.legal-page.standalone { max-width: 820px; margin: 2rem auto; }
.legal-over { max-width: 820px; margin: 2rem auto; }
/* the first steps of a new company */
.first-steps { border-left: 4px solid var(--accent); }
.first-steps .step { display: flex; gap: .7rem; align-items: flex-start; padding: .45rem 0; opacity: .6; }
.first-steps .step.now, .first-steps .step.done { opacity: 1; }
.first-steps .step > div { flex: 1; min-width: 0; }
.step-mark { flex: none; width: 1.7rem; height: 1.7rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: #e7ecf4; color: #384356; font-weight: 600; font-size: .9rem; }
.step.now .step-mark { background: var(--accent); color: #fff; }
.step-mark.done { background: #dff5e3; color: #17692d; }
