/* webaccess: ledger-paper look. Dense, ruled, bottle-green ink, amber for unsaved edits. */

@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  src: url('../fonts/atkinson-hyperlegible-next-latin-400-normal.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  src: url('../fonts/atkinson-hyperlegible-next-latin-600-normal.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  src: url('../fonts/atkinson-hyperlegible-next-latin-700-normal.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}

:root {
  --paper: #fbfcfa;
  --ledger: #f1f5f1;
  --pane: #e6ece7;
  --rule: #cad5cd;
  --rule-strong: #9fb1a5;
  --ink: #20262a;
  --ink-soft: #5b6660;
  --green: #1f5c4a;
  --green-dark: #164536;
  --green-tint: #dceae3;
  --amber: #b97a12;
  --amber-tint: #fbf0d9;
  --danger: #a3342b;
  --danger-tint: #f7e3e1;

  --font: 'Atkinson Hyperlegible Next', system-ui, sans-serif;
  --step--1: 12px;
  --step-0: 14px;
  --step-1: 16px;
  --step-2: 20px;
  --row: 28px;
  --radius: 3px;
}

* { box-sizing: border-box; }
html, body, #app { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.4;
  color: var(--ink);
  background: var(--paper);
  font-variant-numeric: tabular-nums;
}
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 1px; }
[hidden] { display: none !important; }

/* ---------- buttons and inputs ---------- */

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 12px;
  border: 1px solid var(--rule-strong); border-radius: var(--radius);
  background: #fff; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--ledger); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn.primary:hover { background: var(--green-dark); }
.btn.danger { color: var(--danger); border-color: var(--danger); }
.btn.danger:hover { background: var(--danger-tint); }
.btn.quiet { border-color: transparent; background: transparent; }
.btn.quiet:hover { background: var(--pane); }
.btn.small { height: 26px; padding: 0 8px; font-size: var(--step--1); }
.btn[aria-pressed="true"] { background: var(--green-tint); border-color: var(--green); color: var(--green-dark); }

.field { display: grid; gap: 4px; margin-bottom: 14px; }
.field label { font-weight: 600; font-size: var(--step--1); color: var(--ink-soft); }
.input, select.input, textarea.input {
  height: 32px; padding: 0 8px;
  border: 1px solid var(--rule-strong); border-radius: var(--radius);
  background: #fff; width: 100%;
}
textarea.input { height: auto; min-height: 64px; padding: 6px 8px; resize: vertical; }
.input:focus { outline: 2px solid var(--green); outline-offset: -1px; border-color: var(--green); }

.error-text { color: var(--danger); margin: 0 0 12px; white-space: pre-line; }
.muted { color: var(--ink-soft); }

/* ---------- sign-in ---------- */

.login {
  min-height: 100%;
  display: grid; place-items: center;
  background:
    repeating-linear-gradient(to bottom, transparent 0 27px, var(--rule) 27px 28px),
    var(--ledger);
}
.login-sheet {
  width: min(380px, calc(100% - 32px));
  background: #fff;
  border: 1px solid var(--rule-strong);
  border-left: 6px solid var(--green);
  padding: 28px 28px 20px;
}
.login-sheet h1 { font-size: var(--step-2); margin: 0 0 10px; line-height: 1; }
.login-logo { display: block; width: 276px; max-width: 100%; height: auto; }
.login-note { margin: 18px 0 0; font-size: var(--step--2, 12px); color: var(--ink-soft); }
.login-forgot { margin: 10px 0 0; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--green); text-decoration: underline; cursor: pointer; }
.linkish:hover { color: var(--green-dark); }
.login-actions { display: flex; gap: 8px; }
.login-sheet h2 { font-size: var(--step-1); margin: 4px 0 8px; }
.login-sheet p.lead { margin: 0 0 20px; color: var(--ink-soft); }

/* ---------- shell ---------- */

.shell {
  height: 100%;
  display: grid;
  grid-template-rows: 44px minmax(0, 1fr);
  grid-template-columns: 64px 240px minmax(0, 1fr);
  grid-template-areas: "top top top" "rail nav main";
}
.topbar {
  grid-area: top;
  display: flex; align-items: center; gap: 12px;
  padding: 0 12px 0 16px;
  background: var(--green); color: #fff;
}
.topbar .brand { display: flex; align-items: center; }
.brand-logo { display: block; height: 21px; width: auto; }
.brand-mark { display: none; height: 26px; width: 26px; }
@media (max-width: 760px) { .brand-logo { display: none; } .brand-mark { display: block; } }
.topbar .dbname { opacity: .8; }
.topbar .dbname { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; padding-left: 12px; border-left: 1px solid rgba(255,255,255,.3); }

/* choosing a database (after sign-in, or Open another database) */
.chooser-account { display: grid; gap: 6px; margin-bottom: 12px; }
.chooser-account h2 { font-size: var(--step-0); margin: 6px 0 2px; color: var(--green-dark); }
.chooser-db {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
  padding: 10px 12px; border: 1px solid var(--rule-strong); border-radius: var(--radius);
  background: #fff; text-align: left; cursor: pointer; font: inherit;
}
.chooser-db:hover, .chooser-db:focus-visible { border-color: var(--green); background: var(--green-tint); }
.chooser-db .role-badge { background: var(--ledger); color: var(--ink-soft); }
.chooser-name { font-weight: 700; }
.chooser-new { display: grid; gap: 6px; margin: 4px 0 14px; }
.chooser-new-row { display: flex; gap: 8px; }
.chooser-new-row .input { flex: 1; }
.chooser-foot { display: flex; flex-wrap: wrap; gap: 8px; }
.topbar .spacer { flex: 1; }
.topbar .btn.quiet { color: #fff; }
.topbar .btn.quiet:hover { background: var(--green-dark); }
.topbar .nav-toggle { display: none; }
.role-badge {
  font-size: var(--step--1); padding: 1px 6px; border-radius: var(--radius);
  background: rgba(255,255,255,.18);
}

.menu { position: relative; }
.menu-list {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 20;
  min-width: 200px; background: #fff; color: var(--ink);
  border: 1px solid var(--rule-strong); box-shadow: 0 6px 18px rgba(20, 40, 30, .16);
  padding: 4px 0;
}
.menu-list button {
  display: block; width: 100%; text-align: left;
  border: 0; background: none; padding: 7px 14px; cursor: pointer;
}
.menu-list button:hover, .menu-list button:focus-visible { background: var(--ledger); }

/* the Navigation Pane closed (« or the rail's Objects); with the rail hidden too, a narrow bar
   (») brings it back */
.shell.nav-collapsed { grid-template-columns: 64px 0 minmax(0, 1fr); }
.shell.nav-collapsed .nav { display: none; }
.nav-strip { display: none; }
.shell.no-ribbon.nav-collapsed { grid-template-columns: 0 26px minmax(0, 1fr); }
.shell.no-ribbon.nav-collapsed .nav-strip {
  grid-area: nav; display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 6px 0; border: 0; border-right: 1px solid var(--rule-strong); background: var(--pane);
  color: var(--green-dark); cursor: pointer; min-height: 0; overflow: hidden;
}
.nav-strip:hover { background: var(--ledger); }
.nav-strip-arrow { font-size: 16px; line-height: 1; }
.nav-strip-text { writing-mode: vertical-rl; font-weight: 700; white-space: nowrap; }

/* the commands (rail and command bar) and the Navigation Pane can be hidden (the user menu,
   or DoCmd.ShowToolbar "Ribbon" and NavigateTo from code) */
.shell.no-ribbon { grid-template-columns: 0 240px minmax(0, 1fr); }
.shell.no-ribbon .rail, .shell.no-ribbon .cmdbar { display: none; }
.shell.no-nav { grid-template-columns: 64px 0 minmax(0, 1fr); }
.shell.no-nav.no-ribbon { grid-template-columns: 0 0 minmax(0, 1fr); }
.shell.no-nav .nav, .shell.no-nav .nav-strip { display: none; }

/* the rail: Objects, New, Data, Code, Tools, People; File at the foot */
.rail {
  grid-area: rail; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 4px; background: var(--green-dark); min-height: 0; overflow: hidden auto;
}
.rail-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px; width: 56px; flex: none;
  padding: 8px 0 6px; border: 0; border-radius: 6px; background: transparent;
  color: #dceae3; font: inherit; font-size: 11px; line-height: 1.1; cursor: pointer;
}
.rail-btn .icon { width: 23px; height: 23px; }
.rail-btn:hover, .rail-btn:focus-visible { background: rgba(255, 255, 255, .12); color: #fff; outline: none; }
.rail-btn:focus-visible { box-shadow: 0 0 0 2px #f2c94c; }
.rail-btn[aria-pressed="true"] { background: rgba(255, 255, 255, .18); color: #fff; }
.rail-btn:disabled { opacity: .45; cursor: default; }
.rail-spacer { flex: 1; }

/* the command bar: Save, Undo, Redo; the views; what the object in front can do */
.cmdbar { background: var(--paper); border-bottom: 1px solid var(--rule-strong); min-width: 0; }
.cb-row { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; padding: 4px 8px; min-height: 40px; }
.cb-palette { padding-top: 0; min-height: 0; }
.cb-palette[hidden] { display: none; }
.cb-group { display: flex; align-items: center; gap: 1px; }
.cb-sep { width: 1px; height: 22px; background: var(--rule); margin: 0 6px; flex: none; }
.cb-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; min-width: 32px;
  padding: 0 7px; border: 1px solid transparent; border-radius: var(--radius); background: transparent;
  color: var(--ink); font: inherit; cursor: pointer; white-space: nowrap;
}
.cb-btn:hover:not(:disabled) { background: var(--green-tint); }
.cb-btn:focus-visible { outline: 2px solid var(--green); outline-offset: -2px; }
.cb-btn:disabled { opacity: .38; cursor: default; }
.cb-btn[aria-pressed="true"] { background: var(--green-tint); border-color: var(--rule-strong); }
.cb-btn .icon { color: var(--green); width: 18.4px; height: 18.4px; } /* 15% over the usual 16px, to read easily */
.cb-icon { display: inline-flex; }
.cb-split { display: inline-flex; }
.cb-split > .cb-btn:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.cb-arrow { min-width: 18px; padding: 0 3px; font-size: 11px; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.cb-caret { font-size: 11px; color: var(--ink-soft); }
.cb-caption { font-size: var(--step--1); font-weight: 700; color: var(--ink-soft); margin: 0 8px 0 4px; }
.cb-views button { height: 30px; padding: 0 9px; font: inherit; }
.cb-row.tight .cb-btn.worded:not(.cb-menu) .cb-text { display: none; }
.cb-row.tight .cb-btn { min-width: 28px; padding: 0 5px; }
.cb-row.tight .cb-sep { margin: 0 3px; }
.cb-row.tight .cb-views button { padding: 0 7px; }
.menu-heading { padding: 6px 14px 2px; font-size: var(--step--1); font-weight: 700; color: var(--ink-soft); }
.menu-group { break-inside: avoid; }
.menu-group:not(:first-child) > .menu-heading { margin-top: 4px; border-top: 1px solid var(--rule); padding-top: 8px; }

/* Pop Up forms */
.popup-window {
  position: fixed; display: flex; flex-direction: column; background: var(--paper);
  border: 1px solid var(--rule-strong); border-radius: 4px; overflow: hidden;
  box-shadow: 0 18px 48px rgba(20, 40, 30, .28);
}
.pw-bar {
  display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 4px 0 10px; flex: none;
  background: var(--green); color: #fff; cursor: move; user-select: none; touch-action: none;
}
.pw-title { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pw-close { border: 0; background: none; color: #fff; width: 28px; height: 28px; display: grid; place-items: center; cursor: pointer; border-radius: 3px; }
.pw-close:hover { background: var(--danger); }
.pw-design:hover { background: rgba(255, 255, 255, .2); }
.pw-body { flex: 1; min-height: 0; position: relative; }
.pw-grip {
  position: absolute; right: 0; bottom: 0; width: 14px; height: 14px; cursor: nwse-resize; touch-action: none; z-index: 5;
  background: linear-gradient(135deg, transparent 0 55%, var(--rule-strong) 55% 62%, transparent 62% 72%, var(--rule-strong) 72% 79%, transparent 79%);
}
.pw-min:hover, .pw-max:hover { background: rgba(255, 255, 255, .2); }
.pw-min span, .pw-max span { font-size: 15px; line-height: 1; }
/* Border Style: Dialog has a heavier frame, None no title bar; Moveable = No keeps the bar still */
.popup-window.dialog { border-width: 3px; border-radius: 2px; }
.popup-window.bare { border-radius: 0; }
.popup-window.fixed .pw-bar { cursor: default; }
.pw-corner { position: absolute; top: 2px; right: 2px; z-index: 6; }
.pw-corner .pw-close { color: var(--green); background: rgba(255, 255, 255, .85); border: 1px solid var(--rule-strong); }
/* minimised: just the title bar; maximised: the whole browser window */
.popup-window.rolled { height: auto !important; }
.popup-window.rolled .pw-body, .popup-window.rolled .pw-grip { display: none; }
.popup-window.maxed { border-radius: 0; }
.popup-window.maxed .pw-grip { display: none; }
.popup-backdrop { position: fixed; inset: 0; background: rgba(32, 38, 42, .28); }
.popup-window .formdoc > .toolbar { display: none; }

/* quick access toolbar (Save, Undo, Redo) */
.qat { display: flex; gap: 2px; margin-left: 4px; padding-left: 10px; border-left: 1px solid rgba(255,255,255,.25); }
.qat .btn { width: 30px; height: 30px; padding: 0; justify-content: center; }
.qat .btn:disabled { opacity: .4; }
/* Feedback: after its own divider, in every view */
.feedback-slot { display: flex; margin-left: 6px; padding-left: 10px; border-left: 1px solid rgba(255,255,255,.25); }
.feedback-btn { height: 30px; padding: 0 8px; gap: 6px; }
.help-btn { height: 30px; padding: 0 8px; gap: 6px; margin-left: 2px; }
/* Help: the guides in the app */
.doc-pane.help { display: grid; grid-template-columns: 300px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); min-height: 0; overflow: hidden; }
.help-left { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--rule); background: var(--pane); }
.help-searchrow { display: flex; align-items: center; gap: 6px; padding: 10px 10px 6px; color: var(--ink-soft); }
.help-search { flex: 1; min-width: 0; }
.help-side { flex: 1; overflow: auto; padding: 4px 10px 16px; font-size: 13px; }
.help-guide { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 6px; font: inherit; font-weight: 600; color: var(--ink); cursor: pointer; border-radius: 4px; }
.help-guide:hover { background: var(--green-tint); }
.help-guide.open { color: var(--green); }
.help-guide.open::before { content: '▾ '; color: var(--ink-soft); }
.help-guide:not(.open)::before { content: '▸ '; color: var(--ink-soft); }
.help-blurb { margin: 0 6px 6px; font-size: 12px; }
.help-toc { list-style: none; margin: 0 0 10px; padding: 0 0 0 6px; }
.help-toc li.lvl3 { padding-left: 14px; }
.help-toc a { display: block; padding: 3px 6px; color: var(--ink); text-decoration: none; border-radius: 3px; }
.help-toc a:hover { background: var(--green-tint); color: var(--green); }
.help-count { margin: 4px 6px 8px; font-size: 12px; }
.help-hitbtn { display: block; width: 100%; text-align: left; border: 0; border-radius: 4px; background: none; padding: 7px 8px; font: inherit; color: var(--ink); cursor: pointer; }
.help-hitbtn:hover { background: var(--green-tint); }
.help-hitbtn b { display: block; }
.help-hitpath, .help-snippet { display: block; font-size: 12px; color: var(--muted); }
.help-snippet { margin-top: 2px; line-height: 1.35; }
.help mark { background: #fff2a8; color: inherit; padding: 0 1px; border-radius: 2px; }
.help-main { overflow: auto; min-height: 0; }
.help-text { max-width: 860px; padding: 18px 28px 60px; line-height: 1.55; }
.help-text h1 { font-size: 24px; margin: 0 0 12px; }
.help-text h2 { font-size: 20px; margin: 30px 0 8px; padding-top: 8px; border-top: 1px solid var(--rule); }
.help-text h3 { font-size: 16px; margin: 22px 0 6px; }
.help-text h4 { font-size: 14px; margin: 16px 0 4px; }
.help-text h2.help-here, .help-text h3.help-here, .help-text h4.help-here { background: #fff2a8; transition: background 1.2s; }
.help-text p, .help-text li { font-size: 14px; }
.help-text pre { background: var(--ledger); border: 1px solid var(--rule); border-radius: 4px; padding: 10px 12px; overflow: auto; font-size: 12.5px; line-height: 1.45; }
.help-text code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .92em; background: var(--ledger); padding: 1px 4px; border-radius: 3px; }
.help-text pre code { background: none; padding: 0; }
.help-text table { border-collapse: collapse; margin: 10px 0; font-size: 13px; }
.help-text th, .help-text td { border: 1px solid var(--rule-strong); padding: 5px 8px; vertical-align: top; text-align: left; }
.help-text th { background: var(--pane); }
.help-text blockquote { margin: 10px 0; padding: 4px 12px; border-left: 3px solid var(--rule-strong); color: var(--muted); }
.help-text img { max-width: 100%; }
.help-text img.help-logo { height: 28px; width: auto; }
.help-text a { color: var(--green); }
@media (max-width: 760px) {
  .doc-pane.help { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .help-left { max-height: 40vh; border-right: 0; border-bottom: 1px solid var(--rule); }
  .help-label { display: none; }
}
dialog.feedback-dlg { width: min(600px, calc(100% - 32px)); }
/* while the screen is being captured the dialog steps aside */
dialog.feedback-dlg.capturing { opacity: 0; }
dialog.feedback-dlg.capturing::backdrop { opacity: 0; }
.feedback-dlg .fb-text { display: block; width: 100%; resize: vertical; }
.fb-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.fb-preview { margin-top: 10px; max-height: 260px; overflow: auto; border: 1px solid var(--rule-strong); border-radius: 4px; background: var(--ledger); }
.fb-preview img { display: block; max-width: 100%; }
.fb-hint { font-size: 12px; margin: 8px 0 0; }
.fb-page { padding: 12px 16px; overflow: auto; }
.fb-intro { margin: 8px 0 12px; }
.fb-list { display: grid; gap: 12px; max-width: 980px; }
.fb-item { border: 1px solid var(--rule-strong); border-radius: 6px; padding: 10px 12px; background: #fff; }
.fb-item header { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; }
.fb-message { white-space: pre-wrap; margin: 8px 0; }
.fb-issue { margin: 0 0 8px; font-size: 13px; }
.fb-facts { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); margin-bottom: 8px; word-break: break-all; }
.fb-shot { max-width: 100%; max-height: 360px; border: 1px solid var(--rule); border-radius: 4px; }

.ribbon-menu {
  position: fixed; z-index: 40; min-width: 180px; background: #fff; border: 1px solid var(--rule-strong);
  box-shadow: 0 8px 20px rgba(20, 40, 30, .18); padding: 4px 0; column-gap: 0; column-rule: 1px solid var(--rule);
}
.ribbon-menu button { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; padding: 7px 14px; cursor: pointer; text-align: left; font: inherit; }
.ribbon-menu button:hover:not(:disabled), .ribbon-menu button:focus-visible { background: var(--green-tint); outline: none; }
.ribbon-menu button[aria-checked="true"] { font-weight: 600; color: var(--green-dark); }
.ribbon-menu button:disabled { opacity: .4; cursor: default; }
.ribbon-menu .icon { color: var(--green); }

/* navigation pane */
.nav {
  grid-area: nav;
  background: var(--pane);
  border-right: 1px solid var(--rule-strong);
  overflow: auto;
  padding: 10px 0 16px;
}
.nav-head { display: flex; align-items: center; padding: 0 4px 6px 12px; }
.nav-title { flex: 1; font-weight: 700; color: var(--green-dark); }
.nav-collapse { border: 0; background: none; cursor: pointer; color: var(--ink-soft); font-size: 16px; line-height: 1; padding: 2px 6px; }
.nav-collapse:hover { color: var(--green); }
.nav-search.input { margin: 0 10px 10px; height: 30px; width: calc(100% - 20px); }
.nav-group { margin-bottom: 6px; }
.nav-group-head {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 10px 4px 12px;
  font-weight: 700; color: var(--green-dark);
  border-bottom: 1px solid var(--rule);
}
.nav-group-head .count { font-weight: 400; color: var(--ink-soft); font-size: var(--step--1); }
.nav-group-head .btn { margin-left: auto; }
.nav-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 5px 12px 5px 22px; border: 0; background: none; text-align: left; cursor: pointer;
}
.nav-item:hover { background: var(--ledger); }
.nav-item.active { background: var(--green-tint); box-shadow: inset 3px 0 0 var(--green); }
.nav-empty { padding: 4px 12px 4px 22px; color: var(--ink-soft); font-size: var(--step--1); }
.icon { width: 16px; height: 16px; flex: none; }

/* document area */
.main { grid-area: main; display: grid; grid-template-rows: auto auto auto 1fr; min-width: 0; min-height: 0; }
/* each in its own row, so a hidden bar or tab strip leaves the document area its height */
.main > .cmdbar { grid-row: 1; }
.main > .msg-bar { grid-row: 2; }
.main > .doc-tabs { grid-row: 3; }
.main > .doc-body { grid-row: 4; }
.msg-bar { display: flex; align-items: center; gap: 10px; padding: 5px 12px; background: var(--amber-tint); border-bottom: 1px solid var(--rule); font-size: var(--step--1); }
.msg-bar[hidden] { display: none; }
.msg-bar > svg { color: var(--amber); flex: none; }
.msg-bar .msg-close { margin-left: auto; }
.doc-tabs {
  display: flex; gap: 2px; padding: 6px 8px 0;
  background: var(--ledger); border-bottom: 1px solid var(--rule-strong);
  overflow-x: auto;
}
.doc-tab {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 6px 5px 10px; border: 1px solid var(--rule); border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--pane); cursor: pointer; white-space: nowrap;
  min-width: 0; flex: 0 1 auto; /* many tabs share the row: titles shorten rather than run off the end */
}
.doc-tab-title { overflow: hidden; text-overflow: ellipsis; min-width: 2.5em; }
.doc-tab .icon { flex: none; }
.doc-tab .close { flex: none; }
.doc-tab.active { flex-shrink: 0; }
.doc-tab.active { background: var(--paper); border-color: var(--rule-strong); position: relative; top: 1px; }
.doc-tab .close { border: 0; background: none; cursor: pointer; padding: 0 4px; color: var(--ink-soft); font-size: 16px; line-height: 1; }
.doc-tab .close:hover { color: var(--danger); }
.filtered-badge { color: var(--amber); border-color: var(--amber); gap: 4px; }
.filtered-badge .icon { width: 13px; height: 13px; }
.doc-tab .dirty-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); }
.doc-body { min-height: 0; min-width: 0; position: relative; }
.doc-pane { position: absolute; inset: 0; display: flex; flex-direction: column; }

.welcome { padding: 32px; max-width: 640px; }
.welcome h2 { margin: 0 0 8px; font-size: var(--step-2); }
.welcome p { margin: 0 0 12px; }

.toolbar {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 6px 10px; border-bottom: 1px solid var(--rule); background: var(--paper);
}
.toolbar .sep { width: 1px; align-self: stretch; background: var(--rule); margin: 2px 4px; }
.toolbar .spacer { flex: 1; }
.seg { display: inline-flex; border: 1px solid var(--rule-strong); border-radius: var(--radius); overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 0 10px; height: 28px; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--rule-strong); }
.seg button[aria-pressed="true"] { background: var(--green); color: #fff; }

/* ---------- datasheet ---------- */

.sheet-wrap { flex: 1; overflow: auto; min-height: 0; }
.sheet-wrap:focus-visible { outline: none; } /* the focused cell shows where you are */
table.sheet { border-collapse: separate; border-spacing: 0; min-width: 100%; }
.sheet th, .sheet td {
  height: var(--row); padding: 0 8px;
  border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 360px;
  text-align: left;
}
.sheet thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--pane); font-weight: 600;
  border-bottom: 1px solid var(--rule-strong);
  cursor: pointer; user-select: none;
}
.sheet thead th:hover { background: #dbe4dd; }
.sheet thead th .sort { color: var(--green); margin-left: 4px; }
.sheet thead th.selector { cursor: default; }
.sheet .selector {
  position: sticky; left: 0; z-index: 1;
  width: 28px; min-width: 28px; padding: 0; text-align: center;
  background: var(--pane); color: var(--ink-soft); cursor: pointer;
  border-right: 1px solid var(--rule-strong);
}
.sheet thead .selector { z-index: 3; }
.sheet tbody tr:nth-child(even) td:not(.selector) { background: var(--ledger); }
.sheet tbody tr.current td:not(.selector) { background: var(--green-tint); }
.sheet tbody tr.current .selector { color: var(--green); }
.sheet tbody tr.dirty .selector { color: var(--amber); background: var(--amber-tint); }
.sheet tbody tr.selected td { background: #c3dbcf !important; }
.sheet td.num { text-align: right; }
.sheet td.bool { text-align: center; }
.sheet td.cell-focus { outline: 2px solid var(--green); outline-offset: -2px; }
.sheet td.editing { padding: 0; }
.sheet td.editing input {
  width: 100%; height: calc(var(--row) - 1px); border: 0; padding: 0 7px;
  outline: 2px solid var(--green); outline-offset: -2px; background: #fff;
}
.sheet td.editing.num input { text-align: right; }
.sheet tr.new-row td:not(.selector) { background: var(--paper); color: var(--ink-soft); }
.sheet td.null { color: var(--ink-soft); }
.sheet input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--green); cursor: pointer; margin: 0; vertical-align: middle; }

.recordbar {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  padding: 4px 10px; border-top: 1px solid var(--rule-strong); background: var(--pane);
  font-size: var(--step--1);
}
.recordbar .btn { height: 24px; min-width: 26px; padding: 0 6px; justify-content: center; }
.recordbar input { width: 64px; height: 24px; text-align: center; border: 1px solid var(--rule-strong); border-radius: var(--radius); }
.recordbar .spacer { flex: 1; }
.recordbar .status-msg { color: var(--danger); }

/* ---------- table designer ---------- */

.designer { flex: 1; display: grid; grid-template-rows: auto minmax(120px, 1fr) auto; min-height: 0; }
.designer-head {
  display: grid; grid-template-columns: minmax(180px, 280px) 1fr; gap: 12px;
  padding: 10px 12px; border-bottom: 1px solid var(--rule);
}
.designer-head .field { margin: 0; }
.qd-param-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.qd-param-table th { text-align: left; font-size: var(--step--1, 0.85rem); padding: 0 6px 4px 0; }
.qd-param-table td { padding: 0 6px 6px 0; }
.qd-param-table td:first-child { width: 60%; }
.qd-param-table .input { width: 100%; }
.designer-head .qd-props { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.designer-head .qd-props .input { width: 90px; }
.designer-head .qd-props .qd-unique { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; }
.design-grid-wrap { overflow: auto; min-height: 0; }
table.design-grid { border-collapse: separate; border-spacing: 0; width: 100%; }
.design-grid th, .design-grid td {
  height: var(--row); padding: 0; text-align: left;
  border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
}
.design-grid thead th {
  position: sticky; top: 0; z-index: 1; padding: 0 8px; background: var(--pane); font-weight: 600;
  border-bottom: 1px solid var(--rule-strong);
}
.design-grid .selector { width: 32px; text-align: center; background: var(--pane); color: var(--green); cursor: pointer; }
.design-grid td input, .design-grid td select {
  width: 100%; height: calc(var(--row) - 1px); border: 0; padding: 0 8px; background: transparent;
}
.design-grid td input:focus, .design-grid td select:focus { outline: 2px solid var(--green); outline-offset: -2px; background: #fff; }
.design-grid tr.current td { background: var(--green-tint); }
.design-grid col.c-sel { width: 34px; }
.design-grid col.c-name { width: 28%; }
.design-grid col.c-type { width: 18%; }

.props {
  border-top: 1px solid var(--rule-strong); background: var(--ledger);
  padding: 10px 12px 4px;
}
.props h3 { margin: 0 0 8px; font-size: var(--step-0); color: var(--green-dark); }
.props-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 14px; }
.props .field { margin-bottom: 10px; }
.props .hint { grid-column: 1 / -1; color: var(--ink-soft); font-size: var(--step--1); margin: 0 0 8px; }

/* ---------- query designer ---------- */

.qd-body { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }
.qd-data { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }
.qd-data > .doc-pane { position: absolute; inset: 0; }
.qd-design { flex: 1; min-height: 0; display: grid; grid-template-rows: auto minmax(150px, 42%) 1fr; }
.qd-design > .qd-banner { grid-row: 1; }
.qd-design > .qd-tables { grid-row: 2; }
.qd-design > .qd-grid-wrap { grid-row: 3; }
.qd-tables {
  overflow: auto; position: relative;
  border-bottom: 1px solid var(--rule-strong);
  background:
    linear-gradient(var(--rule) 1px, transparent 1px) 0 0 / 100% 28px,
    var(--ledger);
}
.qd-canvas { position: relative; min-width: 100%; min-height: 100%; width: 1400px; height: 520px; }
.qd-joins { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
.qd-join { fill: none; stroke: var(--green); stroke-width: 2; }
.qd-join-hit { fill: none; stroke: transparent; stroke-width: 12; pointer-events: stroke; cursor: pointer; }
.qd-arrow { fill: var(--green); }

.qd-box {
  position: absolute; width: 180px; z-index: 1;
  background: #fff; border: 1px solid var(--rule-strong);
  box-shadow: 0 3px 10px rgba(20, 40, 30, .12);
}
.qd-box.missing { border-color: var(--danger); }
.qd-box-head {
  display: flex; align-items: center; gap: 4px;
  padding: 4px 4px 4px 8px; background: var(--green); color: #fff;
  font-weight: 600; cursor: move; touch-action: none; user-select: none;
}
.qd-box-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qd-box-close { border: 0; background: none; color: #fff; cursor: pointer; font-size: 16px; line-height: 1; padding: 0 4px; }
.qd-fields { list-style: none; margin: 0; padding: 2px 0; max-height: 180px; overflow-y: auto; }
.qd-fields li {
  display: flex; align-items: center; gap: 4px;
  padding: 2px 8px; cursor: default; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.qd-fields li:hover { background: var(--ledger); }
.qd-fields li.drop { background: var(--green-tint); outline: 1px dashed var(--green); }
.qd-fields li .icon { width: 12px; height: 12px; color: var(--green); }

.qd-grid-wrap { overflow: auto; min-height: 0; background: var(--paper); }
table.qd-grid { border-collapse: separate; border-spacing: 0; }
.qd-grid th, .qd-grid td { border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 0; height: var(--row); }
.qd-grid .qd-rowhead {
  position: sticky; left: 0; z-index: 1; min-width: 74px; padding: 0 10px;
  background: var(--pane); text-align: right; font-weight: 600; color: var(--green-dark);
}
.qd-grid thead th { height: 22px; background: var(--pane); }
.qd-grid .qd-colhead { text-align: center; white-space: nowrap; }
.qd-grid .qd-colhead.current { background: var(--green-tint); }
.qd-mini { border: 0; background: none; cursor: pointer; padding: 0 4px; font-size: 11px; color: var(--ink-soft); }
.qd-mini:hover:not(:disabled) { color: var(--green); }
.qd-mini:disabled { opacity: .3; cursor: default; }
.qd-grid td { min-width: 160px; width: 170px; }
.qd-grid td.current { background: var(--green-tint); }
.qd-grid td input:not([type="checkbox"]), .qd-grid td select {
  width: 100%; height: calc(var(--row) - 1px); border: 0; padding: 0 7px; background: transparent;
}
.qd-grid td input[type="checkbox"] { display: block; margin: 0 auto; width: 15px; height: 15px; accent-color: var(--green); }
.qd-grid td input:focus, .qd-grid td select:focus { outline: 2px solid var(--green); outline-offset: -2px; background: #fff; }
.qd-grid td input:disabled, .qd-grid td select:disabled { visibility: hidden; }
.qd-grid tr.or-row .qd-rowhead { font-weight: 400; color: var(--ink-soft); }

.qd-banner { padding: 16px; background: var(--amber-tint); border-bottom: 1px solid var(--rule-strong); }
.qd-banner p { margin: 0 0 10px; }
.qd-banner-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.qd-sql-pane { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 10px 12px; gap: 6px; }
.qd-sql {
  flex: 1; min-height: 160px; resize: none; padding: 10px 12px;
  border: 1px solid var(--rule-strong); border-radius: var(--radius); background: #fff;
  font: 14px/1.5 ui-monospace, 'Cascadia Mono', Consolas, monospace;
}
.qd-sql:focus { outline: 2px solid var(--green); outline-offset: -1px; }
.qd-sql-hint { margin: 0; font-size: var(--step--1); }

.pick-group { border: 1px solid var(--rule); margin: 0 0 12px; padding: 6px 10px 8px; max-height: 220px; overflow: auto; }
.pick-group legend { font-weight: 600; color: var(--green-dark); padding: 0 4px; }
.pick-item { display: flex; align-items: center; gap: 8px; padding: 3px 0; cursor: pointer; }
.pick-item input { accent-color: var(--green); }

/* ---------- forms: shared ---------- */

.formdoc-body { flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column; }
.formdoc-body > .doc-pane, .formdoc-body > .fd { position: absolute; inset: 0; }

/* ---------- Form view ---------- */

.fv-scroll { flex: 1; overflow: auto; padding: 16px; background: var(--ledger); }
.fv-surface { background: #fff; border: 1px solid var(--rule-strong); box-shadow: 0 2px 8px rgba(20, 40, 30, .08); }
.fv-section { position: relative; }
.fv-header { border-bottom: 1px solid var(--rule); }
.fv-footer { border-top: 1px solid var(--rule); }
/* Dividing Lines = No: no lines between sections or records */
.fv-surface.no-dividers > .fv-header, .fv-surface.no-dividers > .fv-footer, .fv-surface.no-dividers .fv-row { border-color: transparent; }
.fv-ctl { position: absolute; box-sizing: border-box; }
.fv-label { display: flex; align-items: center; overflow: hidden; white-space: pre-line; overflow-wrap: anywhere; line-height: 1.2; color: var(--ink); }
.fv-input {
  border: 1px solid var(--rule-strong); border-radius: 2px; padding: 0 6px; background: #fff;
  font: inherit; font-size: inherit; resize: none;
}
textarea.fv-input { padding: 4px 6px; }
.fv-input:focus { outline: 2px solid var(--green); outline-offset: -1px; border-color: var(--green); }
.fv-input[readonly] { background: var(--paper); color: var(--ink-soft); }
.fv-input.num { text-align: right; }
.fv-input.calc { background: var(--ledger); }
.fv-check { display: flex; align-items: center; justify-content: center; }
.fv-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--green); }
.fv-button { justify-content: center; height: auto; font-size: inherit; }
.fv-rect { border: 1px solid var(--rule-strong); }
.fd-sql { font-family: var(--mono, ui-monospace, monospace); font-size: 12px; width: 100%; resize: vertical; }
.fv-message { padding: 10px 12px; margin: 0; }
.fv-note { padding: 6px 12px; background: var(--amber-tint); border-bottom: 1px solid var(--rule); font-size: var(--step--1); }
.fv-editing { color: var(--amber); font-weight: 600; margin-left: 8px; }
.fv-combo { padding: 0 24px 0 4px; }
.fv-combo-wrap { display: flex; }
.fv-combo-wrap .fv-combo { width: 100%; height: 100%; }

.fv-ctl { z-index: 1; }
.fv-list { padding: 2px 0; }
.fv-listbox { padding: 0; overflow: auto; cursor: default; user-select: none; }
.fv-radio {
  appearance: none; -webkit-appearance: none; width: 16px !important; height: 16px !important;
  border: 1.5px solid var(--ink-soft); border-radius: 50%; background: #fff; display: grid; place-items: center; margin: 0;
}
.fv-radio:checked { border-color: var(--green); }
.fv-radio:checked::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.fv-toggle { justify-content: center; font-size: inherit; height: auto; }
.fv-toggle[aria-pressed="true"] { background: var(--green); border-color: var(--green-dark); color: #fff; box-shadow: inset 0 2px 3px rgba(0, 0, 0, .25); }
/* an option group is a frame: its options are controls of their own on top of it */
.fv-group { margin: 0; padding: 0; border: 1px solid var(--rule-strong); border-radius: 2px; }
.fv-group-caption { position: absolute; top: -0.7em; left: 8px; padding: 0 4px; background: #fff; font-weight: 600; font-size: var(--step--1); }
.fv-link { color: var(--green); text-decoration: underline; display: flex; align-items: center; }
.fv-image { display: block; }
.fv-image.zoom { object-fit: contain; }
.fv-image.stretch { object-fit: fill; }
.fv-image.clip { object-fit: none; object-position: top left; }
.fv-image.empty { border: 1px dashed var(--rule-strong); }
/* a slanted line is drawn as an SVG across its box */
.fv-line-slant svg { display: block; width: 100%; height: 100%; overflow: visible; }
.fv-tabctl { z-index: 0 !important; display: flex; flex-direction: column; }
.fv-tabs { display: flex; gap: 2px; height: 30px; align-items: flex-end; flex: none; }
.fv-tab {
  border: 1px solid var(--rule-strong); border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0;
  background: var(--pane); padding: 4px 12px; cursor: pointer; font: inherit; font-size: var(--step--1);
}
.fv-tab[aria-selected="true"] { background: #fff; font-weight: 600; position: relative; top: 1px; }
.fv-tabbody { flex: 1; border: 1px solid var(--rule-strong); background: #fff; }
.fv-subform { border: 1px solid var(--rule-strong); background: var(--paper); overflow: hidden; }
.fv-subform > .doc-pane { position: absolute; inset: 0; }
.fv-subform .toolbar { display: none; }
.fv-subform .fv-message { padding: 12px; }

/* A form fills its window: header at the top, footer at the bottom, the detail between */
.fv.fill .fv-scroll { padding: 0; background: #fff; }
.fv.fill .fv-surface { width: 100%; min-height: 100%; display: flex; flex-direction: column; border: 0; box-shadow: none; box-sizing: border-box; }
.fv.fill .fv-surface > .fv-detail, .fv.fill .fv-surface > .fv-rows { flex: 1 0 auto; }
.fv.fill .fv-surface > .fv-header { position: sticky; top: 0; z-index: 3; background-color: #fff; }
.fv.fill .fv-surface > .fv-footer { position: sticky; bottom: 0; z-index: 3; background-color: #fff; }

/* Continuous forms: a selector strip down the left; header and footer stay in view */
.fv-surface.continuous {
  background: linear-gradient(to right, var(--pane) 18px, #fff 18px);
}
.fv-surface.continuous > .fv-section { margin-left: 18px; background-color: #fff; }
.fv-surface.continuous.no-selectors { background: #fff; }
.fv-surface.no-selectors > .fv-section { margin-left: 0; }
.fv-surface.no-selectors .fv-row-body { left: 0; }
.fv-surface.no-selectors .fv-selector { display: none; }
.fv-surface.continuous > .fv-header { position: sticky; top: -16px; z-index: 3; }
.fv-surface.continuous > .fv-footer { position: sticky; bottom: -16px; z-index: 3; }
.fv-row { position: relative; border-bottom: 1px solid var(--rule); }
.fv-row.current { background-color: #f6faf7; }
.fv-row-body { position: absolute; left: 18px; right: 0; top: 0; bottom: 0; }
.fv-selector {
  /* sticky, so it stays at the left edge when a wide form scrolls sideways */
  position: sticky; left: 0; z-index: 2; height: 100%; width: 18px;
  display: flex; align-items: center; justify-content: center;
  background: var(--pane); border-right: 1px solid var(--rule-strong);
  color: var(--green); font-size: 13px; line-height: 1; cursor: pointer; user-select: none;
}
.fv-selector[data-state="new"], .sheet tr.new-row td.selector { font-size: 20px; font-weight: 700; padding-top: 6px; }
.fv-selector[data-state="dirty"] { font-size: 15px; }
.fv-selector[data-state="dirty"]:hover { background: var(--amber); color: #fff; }
.fv-row.dirty .fv-selector { color: var(--amber); background: var(--amber-tint); }

/* ---------- Form Design view ---------- */

.fd { display: flex; flex-direction: column; min-height: 0; }
.fd-status { padding: 4px 12px; border-top: 1px solid var(--rule); background: var(--paper); font-size: var(--step--1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fd-main.no-side { grid-template-columns: 1fr; }
.fd-main.no-side .fd-side { display: none; }
.fd-canvas.no-grid .fd-section { background-image: none; }
.fd-marquee { position: absolute; z-index: 5; border: 1px dashed var(--green); background: rgba(31, 92, 74, .08); pointer-events: none; }
.fd-main { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 300px; }
.fd-canvas { overflow: auto; padding: 16px 16px 48px; background: var(--ledger); }
.fd-canvas:focus-visible { outline: none; }
.fd-canvas.placing .fd-section { cursor: crosshair; }
.fd-surface { position: relative; background: #fff; border: 1px solid var(--rule-strong); }
.fd-bar {
  height: 22px; padding: 0 8px; display: flex; align-items: center;
  background: var(--pane); border-bottom: 1px solid var(--rule-strong); border-top: 1px solid var(--rule-strong);
  font-size: var(--step--1); font-weight: 600; color: var(--green-dark); cursor: default; user-select: none;
}
.fd-bar:first-child { border-top: 0; }
.fd-bar.selected { background: var(--green); color: #fff; }
.fd-section {
  position: relative; overflow: hidden;
  background-image: radial-gradient(circle, #c9d3cc 1px, transparent 1.2px);
  background-size: 8px 8px; background-color: #fff;
}
.fd-picture { position: absolute; inset: 0; pointer-events: none; }
.fd-prophead { margin: 10px 0 2px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.fd-prophead:first-child { margin-top: 0; }
.fd-grip { height: 5px; margin-top: -3px; position: relative; z-index: 2; cursor: ns-resize; }
.fd-grip:hover { background: var(--green-tint); }
.fd-width-grip { position: absolute; top: 0; right: -4px; width: 7px; height: 100%; cursor: ew-resize; z-index: 3; }
.fd-width-grip:hover { background: var(--green-tint); }

.fd-ctl {
  position: absolute; box-sizing: border-box; cursor: move; user-select: none;
  display: flex; align-items: center; overflow: visible; white-space: nowrap;
}
.fd-ctl.invisible { opacity: .45; }
.fd-label { padding: 0 2px; outline: 1px dashed transparent; white-space: pre-line; overflow: hidden; overflow-wrap: anywhere; line-height: 1.2; }
.fd-label:hover { outline-color: var(--rule-strong); }
.fd-textbox, .fd-combobox { border: 1px solid var(--rule-strong); background: #fff; padding: 0 6px; }
.fd-combobox { justify-content: space-between; }
.fd-arrow { color: var(--ink-soft); padding-left: 4px; }
.fd-source { overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.fd-source.unbound { color: var(--ink-soft); font-style: italic; }
.fd-checkbox { justify-content: center; }
.fd-checkmark { width: 14px; height: 14px; border: 1px solid var(--ink-soft); border-radius: 2px; background: #fff; }
.fd-button { justify-content: center; border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--paper); }
.fd-rectangle { border: 1px solid var(--rule-strong); }
.fd-line { }
.fd-ctl { z-index: 1; }
.fd-ctl.selected { outline: 2px solid var(--green); outline-offset: 1px; z-index: 2; }

/* the newer controls in Design view */
.fd-checkmark.round { border-radius: 50%; }
.fd-optionbutton { justify-content: center; }
.fd-togglebutton { justify-content: center; border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--pane); }
.fd-linktext { color: var(--green); text-decoration: underline; overflow: hidden; text-overflow: ellipsis; }
.fd-listbox { border: 1px solid var(--rule-strong); background: #fff; flex-direction: column; align-items: stretch; padding: 4px 6px; gap: 4px; overflow: hidden; }
.fd-lines { flex: 1; background: repeating-linear-gradient(to bottom, transparent 0 14px, var(--rule) 14px 15px, transparent 15px 20px); }
.fd-optiongroup { border: 1px solid var(--rule-strong); flex-direction: column; align-items: flex-start; justify-content: flex-start; padding: 0 10px 6px; }
.fd-legend { background: #fff; padding: 0 4px; margin: -9px 0 0 -4px; font-weight: 600; line-height: 1.2; }
.fd-options { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.fd-options.horizontal { flex-direction: row; flex-wrap: wrap; gap: 4px 14px; }
.fd-option { display: flex; align-items: center; gap: 6px; }
.fd-mini-toggle { border: 1px solid var(--rule-strong); border-radius: var(--radius); padding: 1px 8px; background: var(--pane); }
.fd-image { border: 1px dashed var(--rule-strong); justify-content: center; gap: 6px; color: var(--ink-soft); overflow: hidden; }
.fd-image img, .fd-image .fd-pic { width: 100%; height: 100%; pointer-events: none; }
.fd-line.fv-line-slant svg { display: block; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.fd-tabcontrol, .fd-tabcontrol.selected { z-index: 0; flex-direction: column; align-items: stretch; }
.fd-tabs { display: flex; gap: 2px; height: 30px; align-items: flex-end; flex: none; overflow: hidden; }
.fd-tab {
  border: 1px solid var(--rule-strong); border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0;
  background: var(--pane); padding: 3px 10px; font-size: var(--step--1); cursor: pointer;
}
.fd-tab.current { background: #fff; font-weight: 600; position: relative; top: 1px; }
.fd-tabbody { flex: 1; border: 1px solid var(--rule-strong); background: rgba(255, 255, 255, .55); }
.fd-subform {
  border: 1px solid var(--rule-strong); background: var(--paper); flex-direction: column;
  align-items: flex-start; justify-content: flex-start; padding: 6px 8px; gap: 4px; overflow: hidden;
}
.fd-subhead { display: flex; gap: 6px; align-items: center; font-weight: 600; color: var(--green-dark); }
.fd-sublink { font-size: var(--step--1); }
.fd-prop textarea.input { height: auto; min-height: 72px; resize: vertical; font: inherit; padding: 4px 6px; }
.fd-file { font-size: var(--step--1); max-width: 100%; min-width: 0; }
.fd-handle {
  position: absolute; width: 8px; height: 8px; background: #fff; border: 1.5px solid var(--green);
  z-index: 2;
}
.fd-handle.nw { left: -6px; top: -6px; cursor: nwse-resize; }
.fd-handle.n { left: calc(50% - 4px); top: -6px; cursor: ns-resize; }
.fd-handle.ne { right: -6px; top: -6px; cursor: nesw-resize; }
.fd-handle.e { right: -6px; top: calc(50% - 4px); cursor: ew-resize; }
.fd-handle.se { right: -6px; bottom: -6px; cursor: nwse-resize; }
.fd-handle.s { left: calc(50% - 4px); bottom: -6px; cursor: ns-resize; }
.fd-handle.sw { left: -6px; bottom: -6px; cursor: nesw-resize; }
.fd-handle.w { left: -6px; top: calc(50% - 4px); cursor: ew-resize; }

.fd-side { border-left: 1px solid var(--rule-strong); background: var(--paper); overflow: auto; }
.fd-side section { padding: 10px 12px; border-bottom: 1px solid var(--rule); }
.fd-side h3 { margin: 0 0 6px; font-size: var(--step-0); color: var(--green-dark); }
.fd-small { font-size: var(--step--1); margin: 0 0 6px; }
.fd-fieldlist { list-style: none; margin: 0; padding: 0; max-height: 220px; overflow: auto; border: 1px solid var(--rule); background: #fff; }
.fd-fieldlist li { display: flex; justify-content: space-between; gap: 8px; padding: 4px 8px; cursor: grab; }
.fd-fieldlist li:hover, .fd-fieldlist li:focus-visible { background: var(--green-tint); }
.fd-fieldlist li .muted { font-size: var(--step--1); }
.fd-side select.input { margin-bottom: 8px; }
.fd-props { display: grid; gap: 6px; }
.fd-proptabs { display: flex; gap: 2px; border-bottom: 1px solid var(--rule); margin: 0 0 8px; }
.fd-proptab { border: 1px solid transparent; border-bottom: 0; background: none; padding: 4px 12px; cursor: pointer; font: inherit; font-size: var(--step--1); border-radius: var(--radius) var(--radius) 0 0; color: var(--ink-soft); }
.fd-proptab[aria-selected="true"] { background: #fff; border-color: var(--rule); color: var(--green-dark); font-weight: 600; position: relative; top: 1px; }
.fd-event-cell { display: flex; gap: 4px; }
.fd-event-cell .input { flex: 1; min-width: 0; background: var(--paper); font-size: var(--step--1); }
.btn.fd-builder { width: 30px; padding: 0; justify-content: center; height: 28px; font-weight: 700; }
.fd-prop { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 8px; }
.fd-prop label { font-size: var(--step--1); color: var(--ink-soft); }
.fd-prop .input { height: 28px; }
.fd-prop input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--green); justify-self: start; }
.fd-colour { display: flex; gap: 6px; align-items: center; }
.fd-colour input[type="color"] { width: 32px; height: 28px; padding: 0; border: 1px solid var(--rule-strong); background: #fff; }
.fd-hex { flex: 1; }

@media (max-width: 900px) {
  .fd-main { grid-template-columns: 1fr; grid-template-rows: 1fr 40%; }
  .fd-side { border-left: 0; border-top: 1px solid var(--rule-strong); }
}

/* ---------- code editor and the Visual Basic window ---------- */

.ce {
  display: grid; grid-template-columns: auto 1fr; height: 100%; min-height: 0; background: #fff;
  font-family: 'Cascadia Mono', Consolas, 'SFMono-Regular', Menlo, 'Liberation Mono', monospace;
  font-size: 14px; line-height: 20px; font-variant-ligatures: none;
}
.ce-gutter { overflow: hidden; background: var(--ledger); border-right: 1px solid var(--rule); color: var(--ink-soft); text-align: right; user-select: none; }
.ce-gutter-inner { padding: 6px 8px 40px 10px; min-width: 30px; }
.ce-ln { height: 20px; font-size: 12px; }
.ce-ln-cur { color: var(--ink); font-weight: 700; }
.ce-ln-err { color: #c62828; font-weight: 700; box-shadow: inset -3px 0 0 #c62828; }
.ce-main { position: relative; overflow: hidden; }
.ce-hl { position: absolute; top: 0; left: 0; padding: 6px 10px 40px; white-space: pre; min-width: 100%; box-sizing: border-box; pointer-events: none; tab-size: 4; color: var(--ink); }
.ce-line { height: 20px; }
.ce-proc { box-shadow: inset 0 1px 0 var(--rule-strong); }
.ce-input {
  position: absolute; inset: 0; width: 100%; height: 100%; box-sizing: border-box; padding: 6px 10px 40px; margin: 0; border: 0;
  resize: none; outline: none; background: transparent; color: transparent; caret-color: var(--ink);
  font: inherit; line-height: inherit; white-space: pre; overflow: auto; tab-size: 4; font-variant-ligatures: none;
}
.ce-input::selection { background: rgba(31, 92, 74, .22); color: transparent; }
.ce-cur { background: #f3f7f4; }
.ce-kw { color: #1b3d9c; }
.ce-com { color: #2e7d32; }
.ce-str { color: #8a3b12; }
.ce-num { color: var(--ink); }
.ce-bad { color: #c62828; }
.ce-err, .ce-err span { color: #c62828; }
.ce-cerr { text-decoration: underline wavy #d97706; text-underline-offset: 4px; text-decoration-skip-ink: none; }

.doc-pane.vbe { display: grid; grid-template-columns: 220px 1fr; }
.vbe-side { border-right: 1px solid var(--rule-strong); background: var(--paper); overflow: auto; }
.vbe-side-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 6px 6px 12px; border-bottom: 1px solid var(--rule); }
.vbe-side-head h3 { margin: 0; font-size: var(--step-0); color: var(--green-dark); }
.vbe-group { padding: 10px 12px 4px; font-size: var(--step--1); font-weight: 700; color: var(--ink-soft); }
.vbe-item { display: flex; align-items: center; gap: 6px; width: 100%; border: 0; background: none; text-align: left; padding: 4px 10px 4px 18px; cursor: pointer; font: inherit; }
.vbe-item:hover { background: var(--ledger); }
.vbe-item.active { background: var(--green-tint); box-shadow: inset 3px 0 0 var(--green); }
.vbe-item.empty { color: var(--ink-soft); }
.vbe-item .icon { color: var(--green); }
.vbe-none { padding: 2px 18px; color: var(--ink-soft); font-size: var(--step--1); }
.vbe-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.vbe-bar { display: flex; gap: 8px; padding: 6px 8px; border-bottom: 1px solid var(--rule); background: var(--paper); }
.vbe-bar select.input { flex: 1; max-width: 320px; height: 28px; }
.vbe-banner { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 12px; background: #fdecea; color: #8e1b14; border-bottom: 1px solid #f0b4ad; }
.vbe-banner[hidden] { display: none; }
.vbe-banner .btn { margin-left: auto; }
.vbe-banner .vbe-banner-acts { margin-left: auto; display: flex; gap: 6px; }
.vbe-banner .vbe-banner-acts .btn { margin-left: 0; }

/* AI help with errors */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
dialog.dlg.ai-dlg { width: min(640px, calc(100% - 32px)); }
dialog.dlg.ai-dlg.wide-ai { width: min(860px, calc(100% - 32px)); }
.ai-error { margin: 0 0 10px; padding: 8px 10px; background: #fdecea; color: #8e1b14; border-left: 3px solid #c0392b; }
.ai-body { min-height: 80px; max-height: 55vh; overflow: auto; }
.ai-text p { margin: 0 0 8px; line-height: 1.5; }
.ai-text ul { margin: 0 0 8px; padding-left: 20px; line-height: 1.5; }
.ai-text code, .ai-text pre { font-family: 'Cascadia Mono', Consolas, 'SFMono-Regular', Menlo, 'Liberation Mono', monospace; font-size: .92em; background: var(--pane); }
.ai-text code { padding: 0 3px; }
.ai-text pre { padding: 8px 10px; overflow: auto; margin: 0 0 8px; }
.ai-wait { display: flex; align-items: center; gap: 10px; color: var(--ink-soft); }
.ai-spin { width: 16px; height: 16px; border: 2px solid var(--rule-strong); border-top-color: var(--green); border-radius: 50%; animation: ai-spin .8s linear infinite; }
@keyframes ai-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ai-spin { animation-duration: 3s; } }
.ai-note { margin: 10px 0 0; font-size: var(--step--1); }
.ai-diff-head { margin: 10px 0 4px; font-weight: 600; }
.ai-diff { margin: 0; border: 1px solid var(--rule); font-family: 'Cascadia Mono', Consolas, 'SFMono-Regular', Menlo, 'Liberation Mono', monospace; font-size: 12.5px; line-height: 1.5; overflow: auto; background: #fff; }
.ai-d { display: flex; white-space: pre; padding: 0 8px 0 0; }
.ai-dmark { width: 18px; flex: none; text-align: center; color: var(--ink-soft); user-select: none; }
.ai-dadd { background: #e6f4ea; }
.ai-dadd .ai-dmark { color: #1e7e34; }
.ai-ddel { background: #fdecea; text-decoration: line-through; text-decoration-color: rgba(142, 27, 20, .35); }
.ai-ddel .ai-dmark { color: #8e1b14; }
.vbe-banner-close { border: 0; background: none; font-size: 18px; line-height: 1; cursor: pointer; color: #8e1b14; padding: 0 6px; }
.vbe-code { flex: 1; min-height: 0; position: relative; }
.vbe-code > .ce { position: absolute; inset: 0; }
.vbe-empty { padding: 24px; color: var(--ink-soft); margin: 0; }
.vbe-bottom { height: 170px; flex: none; border-top: 1px solid var(--rule-strong); display: flex; flex-direction: column; background: #fff; }
.vbe-tabs { display: flex; gap: 2px; background: var(--ledger); border-bottom: 1px solid var(--rule); padding: 3px 6px 0; }
.vbe-tab { border: 1px solid transparent; border-bottom: 0; background: none; padding: 3px 10px; cursor: pointer; font: inherit; font-size: var(--step--1); border-radius: var(--radius) var(--radius) 0 0; }
.vbe-tab[aria-selected="true"] { background: #fff; border-color: var(--rule); font-weight: 600; }
.vbe-imm { flex: 1; display: flex; flex-direction: column; min-height: 0; font-family: 'Cascadia Mono', Consolas, Menlo, monospace; font-size: 13px; }
.vbe-imm[hidden], .vbe-errpane[hidden] { display: none; }
.vbe-log { flex: 1; overflow: auto; padding: 4px 10px; }
.vbe-out { white-space: pre-wrap; }
.vbe-out.in { color: var(--ink-soft); }
.vbe-out.err { color: #c62828; }
.vbe-out.note { color: #8a5a0b; }
.vbe-imm-input { border: 0; border-top: 1px solid var(--rule); padding: 6px 10px; font: inherit; outline: none; }
.vbe-imm-input:focus { box-shadow: inset 0 2px 0 var(--green); }
.vbe-errpane { flex: 1; overflow: auto; }
.vbe-errors { list-style: none; margin: 0; padding: 0; }
.vbe-errors button { display: flex; gap: 12px; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--rule); background: none; padding: 5px 10px; cursor: pointer; font: inherit; }
.vbe-errors button:hover { background: var(--ledger); }
.vbe-errline { color: #c62828; font-weight: 600; min-width: 64px; }
.vbe-ok { padding: 8px 10px; color: var(--green); }
.vbe-status { display: flex; gap: 10px; padding: 3px 10px; border-top: 1px solid var(--rule); background: var(--paper); font-size: var(--step--1); color: var(--ink-soft); }
.vbe-status .spacer { flex: 1; }
@media (max-width: 760px) {
  .doc-pane.vbe { grid-template-columns: 1fr; }
  .vbe-side { display: none; }
}

/* ---------- users ---------- */

.users { padding: 16px; overflow: auto; }
.users h2 { margin: 0 0 12px; font-size: var(--step-1); }
table.list { border-collapse: collapse; width: 100%; max-width: 980px; }
.list th, .list td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--rule); }
.list th { background: var(--pane); font-weight: 600; }
.list td .btn + .btn { margin-left: 4px; }
.pill { font-size: var(--step--1); padding: 1px 7px; border-radius: 10px; background: var(--pane); }
.pill.admin { background: var(--green-tint); color: var(--green-dark); }
.pill.off { background: var(--danger-tint); color: var(--danger); }

/* ---------- dialogs and toasts ---------- */

dialog.dlg {
  border: 1px solid var(--rule-strong); border-top: 4px solid var(--green);
  padding: 20px 22px 16px; width: min(460px, calc(100% - 32px));
  box-shadow: 0 16px 40px rgba(20, 40, 30, .25); color: var(--ink);
}
dialog.dlg.warn { border-top-color: var(--amber); }
/* MsgBox's icons: vbCritical, vbQuestion, vbExclamation, vbInformation */
.msg-row { display: flex; align-items: flex-start; gap: 14px; }
.msg-icon { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 20px; line-height: 1; color: #fff; }
.msg-critical { background: #b3261e; }
.msg-question { background: #1f5fa8; }
.msg-exclamation { background: #b26a00; }
.msg-information { background: #1f5fa8; font-family: Georgia, 'Times New Roman', serif; font-style: italic; }
dialog.dlg::backdrop { background: rgba(32, 38, 42, .35); }
dialog.dlg h2 { margin: 0 0 10px; font-size: var(--step-1); }
dialog.dlg .body { margin-bottom: 16px; }
dialog.dlg ul { margin: 8px 0 0; padding-left: 20px; }
dialog.dlg .actions { display: flex; justify-content: flex-end; gap: 8px; }
dialog.dlg.wide { width: min(980px, calc(100% - 32px)); max-height: calc(100% - 32px); }
dialog.dlg.wide form, dialog.dlg.wide { display: flex; flex-direction: column; }
dialog.dlg.wide:not([open]) { display: none; }
dialog.dlg.wide .body { overflow: auto; min-height: 0; flex: 1; }
/* Tools > References */
dialog.dlg.refs-dlg { width: min(560px, calc(100% - 32px)); }
.refs-label { margin: 0 0 6px; font-weight: 600; }
.refs-list { border: 1px solid var(--rule-strong); height: 250px; overflow: auto; background: #fff; }
.refs-row { display: flex; align-items: center; gap: 8px; padding: 3px 8px; cursor: default; user-select: none; }
.refs-row input { accent-color: var(--green); width: 15px; height: 15px; margin: 0; }
.refs-row.sel { background: var(--green-dark); color: #fff; }
.refs-row .refs-kind { margin-left: auto; font-size: var(--step--1); color: var(--ink-soft); }
.refs-row.sel .refs-kind { color: #dfe9e3; }
.refs-info { border: 1px solid var(--rule); margin-top: 10px; padding: 8px 10px; min-height: 64px; font-size: var(--step--1); }
.refs-info p { margin: 0 0 4px; }
.refs-info b { font-weight: 600; }
.imp h3, .imp-h { margin: 14px 0 6px; font-size: var(--step-0); color: var(--green-dark); }
.imp p { margin: 0 0 10px; }
.imp-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 10px; }
.imp-field { display: flex; align-items: center; gap: 8px; }
.imp-field .input { width: auto; }
.imp-check { display: flex; align-items: center; gap: 8px; padding: 3px 0; flex-wrap: wrap; }
.imp-check input[type="checkbox"], .imp-check input[type="radio"], .imp-list input[type="checkbox"], .imp-fields input[type="checkbox"] { accent-color: var(--green); width: 16px; height: 16px; }
.imp-dest { border: 1px solid var(--rule); padding: 6px 12px 8px; margin: 0 0 10px; }
.imp-dest legend { font-weight: 600; color: var(--green-dark); padding: 0 4px; }
.imp .imp-name { width: 240px; max-width: 100%; height: 30px; flex: none; }
.imp-fields { max-height: 300px; overflow: auto; border: 1px solid var(--rule); }
.imp-fields table.list, .imp-list { max-width: none; }
.imp-fields .input { height: 28px; }
.imp-size { width: 76px; }
.imp-sample { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imp-preview { max-height: 240px; overflow: auto; border: 1px solid var(--rule); }
.imp-preview table.sheet { font-size: var(--step--1); }
.imp-result { border-bottom: 1px solid var(--rule); padding-bottom: 8px; }
.imp-errors { max-height: 200px; overflow: auto; font-size: var(--step--1); }
.list td.num { text-align: right; }
.busy-dlg { width: auto; }
.busy { display: flex; align-items: center; gap: 12px; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--green-tint); border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 50; }
.toast {
  background: var(--ink); color: #fff; padding: 9px 14px; border-radius: var(--radius);
  max-width: 420px; box-shadow: 0 6px 18px rgba(0,0,0,.2);
}
.toast.error { background: var(--danger); }

/* ---------- small screens ---------- */

@media (max-width: 760px) {
  .shell, .shell.nav-collapsed, .shell.no-nav, .shell.no-ribbon, .shell.no-ribbon.nav-collapsed, .shell.no-nav.no-ribbon { grid-template-columns: 1fr; grid-template-areas: "top" "main"; }
  /* the rail joins the Navigation Pane in the drawer that slides in from ☰, as a row of icons */
  .rail {
    position: fixed; top: 44px; left: 0; width: 260px; height: 52px; z-index: 31;
    flex-direction: row; padding: 4px 6px; overflow: auto hidden;
    transform: translateX(-100%); transition: transform .18s ease;
  }
  .shell.nav-open .rail { transform: none; }
  .rail-btn { width: 36px; padding: 8px 0; }
  .rail-label, .rail-spacer { display: none; }
  .qat { display: none; }
  .feedback-slot { border-left: 0; padding-left: 0; }
  .feedback-label { display: none; }
  .topbar .nav-toggle { display: inline-flex; }
  .topbar .dbname { display: none; }
  .nav {
    position: fixed; top: 96px; bottom: 0; left: 0; width: 260px; z-index: 30;
    transform: translateX(-100%); transition: transform .18s ease;
  }
  .shell.nav-open .nav { transform: none; box-shadow: 6px 0 18px rgba(0,0,0,.18); }
  /* the pane slides in from ☰ here, so it has nothing to collapse */
  .shell.no-nav, .shell.nav-collapsed { grid-template-columns: 1fr; }
  .shell.nav-collapsed .nav { display: block; }
  .shell.nav-collapsed .nav-strip, .nav-collapse { display: none; }
  .shell.no-nav .topbar .nav-toggle { display: none; }
  .designer-head { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* DoCmd.Hourglass True / Screen.MousePointer = 11 */
.vba-wait, .vba-wait * { cursor: progress !important; }

/* ---------- conditional formatting ---------- */
dialog.dlg.cf-dlg { width: min(640px, calc(100% - 32px)); }
dialog.dlg.cf-dlg.wide { width: min(720px, calc(100% - 32px)); }
.cf-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0; }
.cf-lbl { color: var(--ink-soft); min-width: 92px; }
.cf-hint { margin: 10px 0 4px; font-weight: 600; }
.cf-buttons { display: flex; gap: 6px; margin: 8px 0; flex-wrap: wrap; }
.cf-list { border: 1px solid var(--rule); border-radius: var(--radius); background: #fff; max-height: 300px; overflow: auto; }
.cf-head, .cf-item { display: grid; grid-template-columns: 1fr 180px; gap: 10px; padding: 5px 8px; align-items: center; }
.cf-head { background: var(--ledger); border-bottom: 1px solid var(--rule); font-weight: 600; font-size: var(--step--1); position: sticky; top: 0; }
.cf-item { cursor: pointer; border-bottom: 1px solid var(--ledger); }
.cf-item.on { background: var(--green-tint); outline: 1px solid var(--green); outline-offset: -1px; }
.cf-item span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-empty { padding: 10px; margin: 0; }
.cf-preview { display: inline-block; min-width: 150px; padding: 3px 8px; border: 1px solid var(--rule); background: #fff; font-size: var(--step--1); text-align: center; }
.cf-preview.cf-disabled { background: #eee; }
.cf-kinds { display: flex; flex-direction: column; border: 1px solid var(--rule); border-radius: var(--radius); background: #fff; }
.cf-kind { text-align: left; border: 0; background: none; padding: 6px 10px; font: inherit; cursor: pointer; }
.cf-kind.on { background: var(--green-tint); font-weight: 600; }
.cf-detail { border: 1px solid var(--rule); border-radius: var(--radius); padding: 4px 10px 8px; background: var(--paper); }
.cf-parts { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.cf-val { width: 130px; }
.cf-expr { width: 320px; max-width: 100%; }
.cf-and { color: var(--ink-soft); }
.cf-toggle { min-width: 30px; }
.cf-toggle.on { background: var(--green-tint); border-color: var(--green); }
.cf-colour { display: inline-flex; align-items: center; gap: 6px; margin-right: 12px; }
.cf-colour input[type=color] { width: 34px; height: 24px; padding: 0; border: 1px solid var(--rule); background: none; }
.cf-none { display: inline-flex; align-items: center; gap: 3px; font-size: var(--step--1); color: var(--ink-soft); }
.fv-ctl.cf-disabled, .fv-ctl .cf-disabled, td.cf-disabled { color: #9a9a9a !important; }
.cf-dlg .input { width: auto; }
.cf-dlg .cf-val { width: 140px; }
.cf-dlg .cf-expr { width: 340px; max-width: 100%; }

/* ---------- PivotTable view ---------- */
.pv-main { flex: 1; min-height: 0; display: flex; }
.pv-area { flex: 1; min-width: 0; overflow: auto; padding: 10px 12px 24px; background: #fff; }
.pv-fields { width: 250px; flex: none; border-left: 1px solid var(--rule); background: var(--paper); overflow: auto; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.pv-fields[hidden] { display: none; }
.pv-fields-head { display: flex; align-items: center; justify-content: space-between; }
.pv-field-list, .pv-field-list ul { list-style: none; margin: 0; padding: 0; }
.pv-field-list { border: 1px solid var(--rule); background: #fff; border-radius: var(--radius); flex: 1; overflow: auto; min-height: 120px; }
.pv-field { display: flex; justify-content: space-between; gap: 6px; padding: 3px 8px; cursor: grab; user-select: none; }
.pv-field:hover { background: var(--ledger); }
.pv-field.on { background: var(--green-tint); }
.pv-ftype { color: var(--ink-soft); font-size: var(--step--1); }
.pv-date { padding: 0 0 2px 14px; font-size: var(--step--1); }
.pv-date .pv-field { padding-left: 12px; }
.pv-addto { display: flex; gap: 6px; }
.pv-addto .input { width: auto; flex: 1; }
.pv-zone { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-height: 28px; padding: 3px 4px; border: 1px dashed transparent; border-radius: var(--radius); }
.pv-zone-filters { margin-bottom: 8px; border-color: var(--rule); background: var(--paper); }
.pv-zone.over { border-color: var(--green); background: var(--green-tint); }
.pv-area:not(.no-zones) .pv-zone { border-color: var(--rule); }
.pv-zone-hint { color: var(--ink-soft); font-size: var(--step--1); font-weight: 400; padding: 0 4px; }
.pv-area.no-zones .pv-zone:not(:has(.pv-chip)) { display: none; }
/* a PivotChart without field buttons and drop zones shows only the chart (Access 2010's toggle) */
.pv-area.no-zones .pc-layout .pv-zone { display: none; }
.pv-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 2px 2px 8px; border: 1px solid var(--rule-strong); border-radius: 3px; background: var(--pane); font-weight: 600; font-size: var(--step--1); cursor: grab; white-space: nowrap; }
.pv-chip.active { outline: 2px solid var(--green); outline-offset: 1px; }
.pv-chip.filtered { color: var(--green-dark); }
.pv-chip svg { width: 12px; height: 12px; }
.pv-chip-btn { border: 0; background: none; cursor: pointer; padding: 0 4px; color: var(--ink-soft); font: inherit; }
.pv-chip-btn:hover { color: var(--ink); }
.pv-note { margin: 6px 0; }
.pv-table-wrap { display: inline-block; min-width: 100%; }
.pv-table { border-collapse: collapse; font-size: var(--step-0); }
.pv-table th, .pv-table td { border: 1px solid var(--rule); padding: 3px 8px; }
.pv-table thead th { background: var(--ledger); font-weight: 600; text-align: left; vertical-align: top; }
.pv-corner { background: #fff !important; vertical-align: bottom !important; min-width: 140px; }
.pv-corner .pv-zone + .pv-zone { margin-top: 4px; }
.pv-zone-cell { background: #fff !important; padding: 2px !important; }
.pv-item { white-space: nowrap; }
tbody .pv-item { background: var(--paper); font-weight: 600; text-align: left; }
.pv-pad { background: var(--paper); }
.pv-toggle { width: 16px; height: 16px; margin-right: 4px; padding: 0; line-height: 14px; border: 1px solid var(--rule-strong); background: #fff; border-radius: 2px; font-size: 12px; cursor: pointer; vertical-align: middle; }
.pv-cell { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 70px; }
.pv-sub { background: #f3f6f4; font-weight: 600; }
.pv-subrow th, .pv-subrow td { background: #f3f6f4; font-weight: 600; }
.pv-grand, .pv-grandrow th, .pv-grandrow td, .pv-grand-h { background: var(--green-tint) !important; font-weight: 700; }
.pv-total-h { font-size: var(--step--1); white-space: nowrap; }
.pv-empty { background: #fafafa; }
.pv-hint { color: var(--ink-soft); padding: 10px !important; text-align: left; }
.pv-pop { position: fixed; z-index: 90; min-width: 200px; max-width: 320px; max-height: 70vh; overflow: auto; background: #fff; border: 1px solid var(--rule-strong); box-shadow: 0 8px 24px rgba(20, 40, 30, .2); padding: 4px 0; border-radius: var(--radius); }
.pv-pop-title { padding: 6px 12px 2px; font-size: var(--step--1); color: var(--ink-soft); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.pv-pop-item { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 5px 12px; font: inherit; cursor: pointer; }
.pv-pop-item:hover, .pv-pop-item:focus-visible { background: var(--ledger); }
.pv-pop-item.on::before { content: '✓ '; color: var(--green); }
.pv-values { padding: 2px 12px 6px; }
.pv-value { display: flex; gap: 6px; align-items: center; padding: 1px 0; }
.pv-value-list { max-height: 200px; overflow: auto; border: 1px solid var(--rule); padding: 2px 6px; margin: 2px 0 6px; }
.pv-all { font-weight: 600; }
.pv-pop-actions { display: flex; gap: 6px; justify-content: flex-end; }
.pv-grandrow th, tbody .pv-item.pv-sub { text-align: left; }

/* ---------- PivotChart view ---------- */
.pc .pv-area { display: flex; flex-direction: column; }
.pc-layout { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 6px; }
.pc-top { display: flex; gap: 8px; flex-wrap: wrap; }
.pc-top .pv-zone { flex: 1; min-width: 200px; }
.pc-middle { flex: 1; min-height: 240px; display: flex; gap: 10px; }
.pc-host { flex: 1; min-width: 0; min-height: 0; overflow: auto; }
.pc-side { width: 200px; flex: none; display: flex; flex-direction: column; gap: 8px; }
.pc-legend-title { font-size: var(--step--1); font-weight: 600; color: #52514e; }
.pc-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: var(--step--1); color: #0b0b0b; }
.pc-legend li { display: flex; align-items: center; gap: 6px; }
.pc-key { flex: none; display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.pc-key.line { height: 2px; width: 14px; border-radius: 1px; }
.pc-grid { display: grid; gap: 12px; }
.pc-title { text-align: center; margin: 2px 0 8px; color: var(--ink); line-height: 1.25; }
.pc-chart { position: relative; }
.pc-chart svg { display: block; overflow: visible; font-family: var(--font); }
.pc-num { font-variant-numeric: tabular-nums; }
.pc-mark { cursor: default; }
.pc-mark:hover, .pc-mark:focus-visible { filter: brightness(1.08); outline: none; }
.pc-mark:focus-visible { stroke: #0b0b0b; stroke-width: 1px; }
.pc-tip { position: absolute; z-index: 5; pointer-events: none; background: #fff; border: 1px solid rgba(11, 11, 11, .12); box-shadow: 0 6px 18px rgba(20, 40, 30, .16); border-radius: 4px; padding: 6px 9px; font-size: var(--step--1); min-width: 120px; white-space: nowrap; }
.pc-tip-head { color: #52514e; margin-bottom: 3px; }
.pc-tip-row { display: flex; align-items: center; gap: 6px; }
.pc-tip-row strong { color: #0b0b0b; font-variant-numeric: tabular-nums; }
.pc-tip-label { color: #52514e; }
.pc-empty { color: #52514e; max-width: 520px; margin: 24px auto; text-align: center; }
.pc .pv-zone-rows { min-height: 30px; }

/* ---------- debugging in the code window ---------- */
.ce-gutter { cursor: pointer; }
.ce-ln { position: relative; }
.ce-ln-bp::before { content: ''; position: absolute; left: -8px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: #9b1c1c; }
.ce-ln-exec::after { content: ''; position: absolute; left: -9px; top: 5px; border: 5px solid transparent; border-left: 8px solid #d4a017; }
.ce-bp { background: #8e2a2a; }
.ce-bp, .ce-bp span { color: #fff !important; }
.ce-exec { background: #fff3a6 !important; }
.ce-exec, .ce-exec span { color: var(--ink) !important; }
.ce-exec-err { box-shadow: inset 3px 0 0 #c62828; }
.ce-tip { position: absolute; z-index: 6; pointer-events: none; background: #ffffe1; border: 1px solid #a8a17a; box-shadow: 0 2px 6px rgba(0, 0, 0, .15); padding: 2px 6px; font-family: system-ui, sans-serif; font-size: 12.5px; white-space: nowrap; color: #111; }
.ce-tip b { font-weight: 700; }

/* ---------- code window: toolbar, Immediate, Locals and Watches ---------- */
.vbe-toolbar { display: flex; align-items: center; gap: 2px; padding: 3px 6px; border-bottom: 1px solid var(--rule); background: var(--paper); flex-wrap: wrap; }
.vbe-tool { width: 28px; height: 26px; display: grid; place-items: center; border: 1px solid transparent; border-radius: var(--radius); background: none; color: var(--green-dark); cursor: pointer; }
.vbe-tool:hover:not(:disabled) { background: var(--ledger); border-color: var(--rule); }
.vbe-tool.on { background: var(--green-tint); border-color: var(--green); }
.vbe-tool:disabled { color: #b7beb9; cursor: default; }
.vbe-tool[data-cmd="code.run"]:not(:disabled) { color: #1a7f37; }
.vbe-tool[data-cmd="code.reset"]:not(:disabled), .vbe-tool[data-cmd="code.breakpoint"]:not(:disabled) { color: #9b1c1c; }
.vbe-sep { width: 1px; height: 18px; background: var(--rule); margin: 0 4px; }
.vbe-run-state { margin-left: auto; align-self: center; font-size: var(--step--1); color: var(--ink-soft); padding: 2px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vbe-run-state.on { color: #7a5b00; background: #fff3a6; border-radius: 3px; font-weight: 600; }
.vbe-bottom { height: 200px; flex-direction: row; }
.vbe-imm { flex: 1; min-width: 0; border-right: 1px solid var(--rule-strong); }
.vbe-pane-title { display: flex; align-items: center; justify-content: space-between; padding: 2px 6px 2px 10px; background: var(--ledger); border-bottom: 1px solid var(--rule); font-family: var(--font); font-size: var(--step--1); font-weight: 600; color: var(--ink-soft); }
.vbe-imm-text { flex: 1; min-height: 0; border: 0; resize: none; outline: none; padding: 4px 10px; font: inherit; line-height: 18px; white-space: pre; overflow: auto; }
.vbe-imm-text:focus { box-shadow: inset 0 2px 0 var(--green); }
.vbe-side-pane { width: 42%; min-width: 280px; display: flex; flex-direction: column; min-height: 0; }
.vbe-pane { flex: 1; overflow: auto; min-height: 0; }
.vbe-pane[hidden] { display: none; }
.vbe-grid { width: 100%; border-collapse: collapse; font-size: var(--step--1); }
.vbe-grid th { text-align: left; background: var(--paper); border-bottom: 1px solid var(--rule); padding: 3px 8px; position: sticky; top: 0; font-weight: 600; color: var(--ink-soft); }
.vbe-grid td { border-bottom: 1px solid var(--ledger); padding: 2px 8px; font-family: 'Cascadia Mono', Consolas, Menlo, monospace; white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.vbe-watch-input { width: 100%; border-radius: 0; border-width: 0 0 1px; height: 28px; }
.vbe-x { border: 0; background: none; color: var(--ink-soft); cursor: pointer; margin-left: 6px; }
.vbe-stack { margin: 0; padding: 6px 10px 6px 30px; font-family: 'Cascadia Mono', Consolas, Menlo, monospace; font-size: var(--step--1); }

/* ---------- code window: the lists offered as you type (IntelliSense) ---------- */
.ce-list { position: absolute; z-index: 7; min-width: 190px; max-width: 360px; max-height: 164px; overflow-y: auto; background: #fff; border: 1px solid #8a948e; box-shadow: 0 3px 10px rgba(0, 0, 0, .18); font-family: system-ui, sans-serif; font-size: 12.5px; color: #111; padding: 1px 0; }
.ce-list-item { display: flex; align-items: center; gap: 6px; height: 20px; padding: 0 8px 0 4px; white-space: nowrap; cursor: default; }
.ce-list-item.sel { background: #1f5c4a; color: #fff; }
.ce-list-item.sel.soft { background: none; color: inherit; outline: 1px dotted #1f5c4a; outline-offset: -1px; }
.ce-list-icon { width: 10px; height: 10px; flex: none; border-radius: 1px; background: #9aa39d; }
.k-method .ce-list-icon { background: #7a3fb0; transform: rotate(45deg) scale(.85); }
.k-property .ce-list-icon, .k-field .ce-list-icon, .k-control .ce-list-icon { background: #2f6db5; border-radius: 2px 5px 2px 5px; }
.k-constant .ce-list-icon, .k-enum .ce-list-icon { background: #8b8f8c; height: 6px; }
.k-class .ce-list-icon, .k-form .ce-list-icon { background: #c27c13; border-radius: 0; box-shadow: inset 0 0 0 2px #e5b867; }
.k-variable .ce-list-icon { background: #1a7f6b; border-radius: 50%; }
.k-keyword .ce-list-icon { background: none; border: 1px solid #555; height: 8px; width: 8px; }
.ce-list-item.sel .ce-list-icon { box-shadow: 0 0 0 1px #fff; }
.vbe-imm { position: relative; } /* the Immediate window's lists sit inside it */

/* ---------- reports ---------- */

.reportdoc-body > .rp-scroll { flex: 1; }
.rp-scroll { flex: 1; min-height: 0; overflow: auto; background: var(--ledger); padding: 20px; }
.rp-scroll:focus-visible { outline: 2px solid var(--green); outline-offset: -2px; }
.rp-continuous { width: fit-content; margin: 0 auto; background: #fff; box-shadow: 0 2px 10px rgba(20, 40, 30, .14); }
.rp-continuous .rp-content { position: relative; }
.rp-pages { display: flex; gap: 24px; justify-content: center; align-items: flex-start; min-width: fit-content; }
.rp-holder { position: relative; flex: none; }
.rp-page { position: absolute; left: 0; top: 0; background: #fff; box-shadow: 0 2px 10px rgba(20, 40, 30, .22); transform-origin: 0 0; overflow: hidden; color: #000; }
.rp-page .rp-content { position: absolute; overflow: hidden; }
.rp-sec { position: absolute; left: 0; overflow: hidden; }
.rp-ctl { position: absolute; box-sizing: border-box; overflow: hidden; }
.rp-label, .rp-text { display: flex; align-items: center; white-space: nowrap; }
.rp-text.multi { display: block; white-space: pre-wrap; overflow-wrap: anywhere; }
.rp-err { color: #b3261e; }
.rp-check { display: flex; align-items: center; justify-content: center; }
.rp-box { width: 13px; height: 13px; border: 1px solid #333; position: relative; }
.rp-box.on::after { content: ''; position: absolute; left: 3.5px; top: .5px; width: 4px; height: 8px; border: solid #000; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.rp-image { display: flex; align-items: center; justify-content: center; }
.rp-image img { width: 100%; height: 100%; }
.rp-rect { border: 1px solid #000; }
.rp-link { display: flex; align-items: center; color: #1a56a8; text-decoration: underline; white-space: nowrap; }
/* a subreport: its own sections, inside its control */
.rp-sub { overflow: hidden; }
.rp-sub-content { position: relative; }
.rp-sub.rp-err { font-size: 12px; padding: 2px 4px; }
.rp-nav { display: flex; align-items: center; gap: 4px; padding: 4px 10px; border-top: 1px solid var(--rule); background: var(--paper); font-size: var(--step--1); }
.rp-nav .rp-pagebox { width: 4em; text-align: center; padding: 2px 4px; }
.rp-nav .rp-zoom { width: auto; padding: 2px 4px; }
.rp-note { margin: 0; padding: 6px 12px; background: var(--amber-tint); border-bottom: 1px solid var(--rule); font-size: var(--step--1); }
.rp-reportview .rp-note { margin: 12px auto 0; width: fit-content; border: 1px solid var(--rule); }

/* Report Design view: the Group, Sort, and Total pane */
.rd-centre { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.rd-centre > .fd-canvas { flex: 1; min-height: 0; }
.rd-groups { flex: none; max-height: 38%; overflow: auto; border-top: 1px solid var(--rule-strong); background: var(--paper); font-size: var(--step--1); }
.rd-groups-head { display: flex; align-items: center; padding: 4px 8px 2px 12px; position: sticky; top: 0; background: var(--paper); }
.rd-groups-head h3 { margin: 0; font-size: var(--step--1); color: var(--green-dark); }
.rd-levels { padding: 2px 8px; }
.rd-level { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; padding: 4px 8px; margin: 2px 0; background: #fff; border: 1px solid var(--rule); border-left: 3px solid var(--green); }
.rd-level.sort { border-left-color: var(--rule-strong); }
.rd-level .input { width: auto; padding: 2px 4px; font-size: var(--step--1); }
.rd-what { font-weight: 600; min-width: 5em; }
.rd-add { display: flex; gap: 8px; padding: 6px 16px 10px; }
.rd-add .btn { display: inline-flex; align-items: center; gap: 4px; }
.fd-bar-note { font-weight: 400; opacity: .75; }

/* printing a report: only its pages, on paper of its size (see reportdoc.js) */
@media screen { .rp-print-root { display: none; } }
@media print {
  body.printing-report > *:not(.rp-print-root) { display: none !important; }
  body.printing-report { margin: 0; background: #fff; }
  .rp-print-root .rp-page { position: relative; box-shadow: none; break-after: page; page-break-after: always; transform: none !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rp-print-root .rp-page:last-child { break-after: auto; page-break-after: auto; }
}

/* Access's Import Objects dialog */
.imp-objects { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: start; }
.imp-tabs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--rule-strong); }
.imp-tab { border: 1px solid var(--rule); border-bottom: 0; background: var(--ledger); padding: 5px 10px; font: inherit; font-size: var(--step--1); cursor: pointer; border-radius: var(--radius) var(--radius) 0 0; }
.imp-tab[aria-selected="true"] { background: #fff; border-color: var(--rule-strong); color: var(--green-dark); font-weight: 600; position: relative; top: 1px; }
.imp-pane { border: 1px solid var(--rule-strong); border-top: 0; padding: 8px; height: 320px; overflow: auto; background: #fff; }
.imp-pane .imp-list { width: 100%; }
.imp-side { display: flex; flex-direction: column; gap: 8px; min-width: 150px; padding-top: 30px; }
.imp-option { display: flex; flex-direction: column; gap: 4px; font-size: var(--step--1); margin-top: 10px; }
.imp-note { font-size: var(--step--1); color: var(--ink-soft); }
.imp-later { padding: 8px 10px; background: var(--amber-tint); font-size: var(--step--1); }
.imp-names { columns: 2; font-size: var(--step--1); margin: 0; padding-left: 20px; }
.imp-queries { font-size: var(--step--1); padding-left: 20px; }
@media (max-width: 760px) { .imp-objects { grid-template-columns: 1fr; } .imp-side { flex-direction: row; flex-wrap: wrap; padding-top: 0; } }
.imp-warn { color: #7a5009; }
.imp-later p { margin: 0 0 6px; }
.imp-later ol { margin: 0 0 8px; padding-left: 20px; }
.imp-later li { margin: 2px 0; }
.imp-choose { display: flex; gap: 8px; flex-wrap: wrap; }

/* a label's Text Orientation (formview.js applyBox). Up reads from bottom to top: only the
   text turns, so the box, its border and (in Design view) its sizing handles stay where they are */
.orient-down, .orient-up { writing-mode: vertical-rl; }
.orient-up { writing-mode: sideways-lr; }
/* a browser without sideways-lr turns the whole box instead: its handles are put back where they belong */
@supports not (writing-mode: sideways-lr) {
  .orient-up { transform: rotate(180deg); }
  .fd-ctl.orient-up > .fd-handle.nw { left: auto; top: auto; right: -6px; bottom: -6px; }
  .fd-ctl.orient-up > .fd-handle.n { top: auto; bottom: -6px; }
  .fd-ctl.orient-up > .fd-handle.ne { right: auto; top: auto; left: -6px; bottom: -6px; }
  .fd-ctl.orient-up > .fd-handle.e { right: auto; left: -6px; }
  .fd-ctl.orient-up > .fd-handle.se { right: auto; bottom: auto; left: -6px; top: -6px; }
  .fd-ctl.orient-up > .fd-handle.s { bottom: auto; top: -6px; }
  .fd-ctl.orient-up > .fd-handle.sw { left: auto; bottom: auto; right: -6px; top: -6px; }
  .fd-ctl.orient-up > .fd-handle.w { left: auto; right: -6px; }
}

/* the Chart control */
.fv-chart, .fd-chart-view { background: #fff; overflow: hidden; }
.fd-chart-view { position: absolute; inset: 0; pointer-events: none; }
.fv-chart .chart-svg, .fd-chart-view .chart-svg { display: block; font-family: inherit; }
.fv-chart-error { position: absolute; left: 6px; right: 6px; bottom: 4px; margin: 0; padding: 4px 6px; font-size: 12px; color: #b3261e; background: rgba(255, 255, 255, .92); }
.fd-prop-head { margin: 10px 0 2px; padding-bottom: 2px; border-bottom: 1px solid var(--rule); font-size: var(--step--1); font-weight: 600; color: var(--green-dark); }

/* ---------- demo mode ---------- */

.demo-box { margin: 4px 0 22px; padding: 14px 16px; background: var(--ledger); border: 1px solid var(--rule-strong); }
.demo-box h2 { font-size: var(--step-1, 18px); margin: 0 0 6px; }
.demo-box p { margin: 0 0 12px; }
.demo-start { width: 100%; justify-content: center; }
.login-ended { margin: 0 0 16px; padding: 8px 10px; background: var(--amber-tint); border-left: 3px solid var(--amber); }
.demo-note { display: flex; align-items: center; gap: 8px; font-size: var(--step--1); }
.demo-text { opacity: .9; }
.topbar .demo-end { background: var(--amber-tint); color: var(--ink); border-color: transparent; }
.topbar .demo-end:hover { background: #fff; }
@media (max-width: 900px) { .demo-text { display: none; } }

/* ---------- TreeView (Microsoft TreeView Control 6.0) ---------- */

.tv {
  --tv-row: 22px; --tv-line: #9aa3a0;
  overflow: auto; background: #fff; color: var(--ink); border: 1px solid var(--rule-strong);
  padding: 2px 0; outline: none; user-select: none; box-sizing: border-box;
}
.tv.tv-flat { border-color: var(--rule); }
.tv.tv-noborder { border-color: transparent; }
.tv.tv-noscroll { overflow: hidden; }
.tv:focus-visible { box-shadow: inset 0 0 0 2px var(--green); }
.tv-row { display: flex; align-items: center; height: var(--tv-row); white-space: nowrap; padding: 0 6px 0 2px; cursor: default; }
.tv-g { position: relative; flex: none; width: var(--tv-indent); height: 100%; }
.tv-lines .tv-g.line::before, .tv-elbow.on::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; border-left: 1px dotted var(--tv-line); }
.tv-elbow.on:not(.more)::before { bottom: 50%; }
.tv-elbow.on.first::before { top: 50%; }
.tv-elbow.on.first:not(.more)::before { display: none; }
.tv-elbow.on::after { content: ''; position: absolute; left: 50%; right: 1px; top: 50%; border-top: 1px dotted var(--tv-line); }
.tv-exp {
  position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; transform: translate(-50%, -50%); z-index: 1;
  background: #fff; border: 1px solid #8a948f; box-sizing: border-box; cursor: pointer;
}
.tv-exp::before { content: ''; position: absolute; left: 1px; right: 1px; top: 3px; border-top: 1px solid #333; }
.tv-exp.plus::after { content: ''; position: absolute; top: 1px; bottom: 1px; left: 3px; border-left: 1px solid #333; }
.tv-check { margin: 0 3px 0 2px; }
.tv-pic { flex: none; margin-right: 4px; object-fit: contain; }
.tv-text { padding: 1px 3px; border: 1px solid transparent; border-radius: 2px; line-height: 1.25; }
.tv-row.selected .tv-text { background: #dde6e1; }
.tv:focus .tv-row.selected .tv-text { background: var(--green); color: #fff; }
.tv-hide-sel:not(:focus) .tv-row.selected .tv-text { background: transparent; }
.tv-fullrow .tv-row.selected { background: #dde6e1; }
.tv-fullrow:focus .tv-row.selected { background: var(--green); }
.tv-fullrow .tv-row.selected .tv-text { background: transparent; }
.tv-fullrow:focus .tv-row.selected .tv-text { color: #fff; }
.tv-hot .tv-row:hover .tv-text { text-decoration: underline; color: #1a5fb4; }
.tv-disabled { color: var(--ink-soft); background: #f4f5f3; }
.tv-edit { font: inherit; padding: 0 2px; border: 1px solid var(--ink); min-width: 90px; height: calc(var(--tv-row) - 3px); box-sizing: border-box; }
/* an ImageList holds pictures for other controls: a small box in Design view, nothing in Form view */
.fd-imagelist { display: grid; place-items: center; background: #f4f5f3; border: 1px dashed var(--rule-strong); color: var(--ink-soft); }
.fd-treeview .tv { width: 100%; height: 100%; pointer-events: none; }
.fv-tree > .tv { width: 100%; height: 100%; }
.fv-imagelist { display: none; }
.fd-images { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; max-height: 260px; overflow: auto; }
.fd-images { min-width: 0; }
.fd-images li { display: grid; grid-template-columns: 18px 22px minmax(0, 1fr) auto auto; gap: 4px; align-items: center; }
.fd-images .input { padding: 2px 4px; min-width: 0; height: 26px; }
.fd-prop.fd-prop-wide { grid-template-columns: minmax(0, 1fr); }
.tv { position: relative; }
.tv-row.drop .tv-text { background: var(--green); color: #fff; }
.ole-ghost {
  position: fixed; z-index: 1000; pointer-events: none; padding: 2px 8px; border-radius: var(--radius);
  background: rgba(255, 255, 255, .92); border: 1px solid var(--rule-strong); box-shadow: 0 2px 6px rgba(0,0,0,.15); font-size: 13px;
}
/* ---------- ListView (Microsoft ListView Control 6.0) ---------- */

.lv {
  position: relative; overflow: auto; background: #fff; color: var(--ink); border: 1px solid var(--rule-strong);
  outline: none; user-select: none; box-sizing: border-box; font-size: 13px; line-height: 1.25;
}
.lv.lv-flat { border-color: var(--rule); }
.lv.lv-noborder { border-color: transparent; }
.lv:focus-visible { box-shadow: inset 0 0 0 2px var(--green); }
.lv-disabled { color: var(--ink-soft); background: #f4f5f3; }
.lv-item { cursor: default; box-sizing: border-box; }
.lv-label { padding: 1px 3px; border-radius: 2px; overflow: hidden; text-overflow: ellipsis; }
.lv-opaque .lv-label, .lv-opaque .lv-sub { background: var(--lv-back); }
.lv-pic { flex: none; margin-right: 4px; object-fit: contain; }
.lv-icon { display: block; margin: 0 auto 3px; object-fit: contain; }
.lv-check { flex: none; margin: 0 4px 0 1px; }
.lv-item.ghosted .lv-pic, .lv-item.ghosted .lv-icon { opacity: .45; }
.lv-item.selected .lv-label { background: #dde6e1; }
.lv:focus .lv-item.selected .lv-label { background: var(--green); color: #fff; }
.lv-hide-sel:not(:focus) .lv-item.selected .lv-label { background: transparent; }
.lv:focus .lv-item.focused .lv-label { outline: 1px dotted var(--ink-soft); outline-offset: -1px; }
.lv-item.drop .lv-label, .lv-item.drop.selected .lv-label { background: var(--green); color: #fff; }
.lv-hot .lv-item:hover .lv-label { text-decoration: underline; color: #1a5fb4; cursor: pointer; }
.lv-edit { font: inherit; padding: 0 2px; border: 1px solid var(--ink); min-width: 80px; height: 18px; box-sizing: border-box; }
/* Icon view: tiles with the picture above the text */
.lv-items { display: flex; flex-wrap: wrap; align-content: flex-start; padding: 2px; }
.lv-items.lv-cols { display: grid; grid-auto-flow: column; grid-auto-columns: max-content; }
.lv-tile { width: 88px; min-height: 64px; padding: 4px 2px 2px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.lv-tile .lv-label { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; max-width: 84px; }
.lv-nowrap .lv-tile .lv-label { display: block; white-space: nowrap; -webkit-line-clamp: unset; }
.lv:focus .lv-tile.focused .lv-label { -webkit-line-clamp: unset; }
.lv-tile .lv-check { align-self: flex-start; margin: 0; }
/* Small Icon and List views: a picture and the text on one line */
.lv-line { display: flex; align-items: center; height: 20px; padding: 0 4px 0 2px; white-space: nowrap; min-width: 0; }
.lv-v1 .lv-items:not(.lv-cols) .lv-line { min-width: 120px; margin-right: 6px; }
.lv-v2 .lv-line { margin-right: 10px; }
/* Report view: column headers over rows of cells */
.lv-head { position: sticky; top: 0; z-index: 2; display: flex; width: max(100%, var(--lv-total)); background: #f4f5f3; border-bottom: 1px solid var(--rule-strong); }
.lv-col {
  position: relative; flex: none; display: flex; align-items: center; height: 22px; padding: 0 6px; box-sizing: border-box;
  border-right: 1px solid var(--rule); overflow: hidden; white-space: nowrap; cursor: default;
}
.lv-col:hover { background: #e8ebe7; }
.lv-col:active { background: #dde1dc; }
.lv-col.moving { opacity: .6; }
.lv-col-text { overflow: hidden; text-overflow: ellipsis; }
.lv-col.a1, .lv-cell.a1 { justify-content: flex-end; }
.lv-col.a2, .lv-cell.a2 { justify-content: center; }
.lv-grip { position: absolute; right: -3px; top: 0; bottom: 0; width: 7px; cursor: col-resize; z-index: 1; }
.lv-marker { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--green); pointer-events: none; }
.lv-rows { width: max(100%, var(--lv-total)); }
.lv-row { display: flex; height: 20px; align-items: stretch; }
.lv-cell { flex: none; display: flex; align-items: center; padding: 0 6px; box-sizing: border-box; overflow: hidden; white-space: nowrap; }
.lv-cell.lv-first { padding-left: 2px; }
.lv-sub { overflow: hidden; text-overflow: ellipsis; }
.lv-grid .lv-cell { border-right: 1px solid #e3e6e2; }
.lv-grid .lv-row { border-bottom: 1px solid #e3e6e2; }
.lv-fullrow .lv-row.selected { background: #dde6e1; }
.lv-fullrow:focus .lv-row.selected { background: var(--green); color: #fff; }
.lv-fullrow.lv-hide-sel:not(:focus) .lv-row.selected { background: transparent; color: inherit; }
.lv-fullrow .lv-row.selected .lv-label, .lv-fullrow:focus .lv-row.selected .lv-label { background: transparent; color: inherit; }
.lv-fullrow .lv-row.drop { background: var(--green); color: #fff; }
.fv-list > .lv { width: 100%; height: 100%; }
.fd-listview .lv { width: 100%; height: 100%; pointer-events: none; }
.fd-listview .lv-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-soft); font-size: 12px; }
.fd-columns { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; max-height: 300px; overflow: auto; min-width: 0; }
.fd-columns li { display: grid; grid-template-columns: 20px minmax(0, 1fr) 64px auto auto; gap: 3px 4px; align-items: center; padding-bottom: 4px; border-bottom: 1px solid var(--rule); }
.fd-columns .fd-col-align { grid-column: 3 / span 3; }
.fd-columns .input { padding: 2px 4px; min-width: 0; height: 26px; }

.opt-form { max-width: 720px; }
.opt-form .field { margin-bottom: 10px; }
.opt-head { margin: 4px 0 8px; font-size: var(--step-0); color: var(--green); }
.opt-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.opt-preview { padding: 8px 10px; background: #f4f5f3; border-radius: var(--radius); font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .opt-grid { grid-template-columns: minmax(0, 1fr); } }
html[data-ole-drag], html[data-ole-drag] * { user-select: none; }
html[data-ole-drag="move"], html[data-ole-drag="move"] * { cursor: move !important; }
html[data-ole-drag="copy"], html[data-ole-drag="copy"] * { cursor: copy !important; }
html[data-ole-drag="none"], html[data-ole-drag="none"] * { cursor: no-drop !important; }

/* Tab Order dialog */
.fd-taborder-dialog .fd-taborder-sections { display: flex; gap: 16px; margin-bottom: 8px; }
.fd-taborder { list-style: none; margin: 8px 0; padding: 2px; border: 1px solid var(--rule-strong); max-height: 280px; min-width: 260px; overflow: auto; }
.fd-taborder li { padding: 4px 8px; cursor: grab; user-select: none; }
.fd-taborder li[aria-selected="true"] { background: var(--green); color: #fff; }
.fd-taborder:focus { outline: 2px solid var(--green); outline-offset: 1px; }
.fd-taborder-buttons { display: flex; gap: 6px; }

/* Status Bar Text, and Display When (formview.js) */
.fv { position: relative; }
.fv-statusbar { position: absolute; left: 8px; bottom: 8px; max-width: calc(100% - 16px); padding: 3px 10px; background: var(--ink); color: #fff; font-size: var(--step--1); border-radius: 3px; pointer-events: none; z-index: 20; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media screen { .fv-ctl.dw-print, .fv-section.dw-print { visibility: hidden; } }
@media print { .fv-ctl.dw-screen, .fv-section.dw-screen { visibility: hidden; } }

/* Data entry (formwidgets.js, richtext.js): Vertical, hyperlinks, the date picker, Rich Text */
.fv-input.fv-vertical { writing-mode: vertical-rl; padding: 6px 2px; }
.fv-input.fv-hyperlink { color: #0563c1; text-decoration: underline; cursor: pointer; }
.fv-input.fv-hyperlink:focus { cursor: text; }
.fv-date-btn { position: absolute; z-index: 5; width: 26px; padding: 0; border: 1px solid var(--rule-strong); border-radius: 2px; background: var(--paper); cursor: pointer; font-size: 14px; line-height: 1; }
.fv-date-btn:hover { background: var(--ledger); }
.fv-date-native { position: absolute; z-index: 4; width: 1px; height: 1px; padding: 0; border: 0; opacity: 0; pointer-events: none; }
.fv-rich { overflow-y: auto; overflow-wrap: anywhere; white-space: pre-wrap; padding: 4px 6px; cursor: text; }
.fv-rich[contenteditable="false"] { background: var(--paper); color: var(--ink-soft); cursor: default; }
.fv-rich:focus { outline: 2px solid var(--green); outline-offset: -1px; }
.fv-rich p, .fv-rich div { margin: 0; }
.rich-bar { position: fixed; z-index: 1000; display: flex; gap: 2px; align-items: center; padding: 3px; background: #fff; border: 1px solid var(--rule-strong); border-radius: 3px; box-shadow: 0 2px 6px rgba(20, 40, 30, .15); }
.rich-bar input[type="color"] { width: 28px; height: 24px; padding: 0 2px; border: 1px solid var(--rule-strong); border-radius: 2px; background: #fff; }
.rp-text p, .rp-text div { margin: 0; }

/* Combo boxes and list boxes (listwidgets.js): columns, Column Heads, the drop-down list */
.fv-combo-btn { position: absolute; top: 1px; right: 1px; bottom: 1px; width: 22px; padding: 0; border: 0; border-left: 1px solid var(--rule); background: var(--paper); cursor: pointer; }
.fv-combo-btn::after { content: ''; position: absolute; left: 50%; top: 50%; margin: -2px 0 0 -4px; border: 4px solid transparent; border-top: 5px solid var(--ink-soft); }
.fv-combo-btn:hover { background: var(--ledger); }
.fv-combo-btn:disabled { cursor: default; opacity: .5; }
.fv-combo-list { position: fixed; z-index: 1000; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--rule-strong); box-shadow: 0 4px 12px rgba(20, 40, 30, .18); }
.fv-lbody { overflow-y: auto; }
.fv-lrow { display: grid; align-items: center; min-height: 1.5em; white-space: nowrap; }
.fv-lcell { overflow: hidden; text-overflow: ellipsis; padding: 1px 6px; }
.fv-lrow[aria-selected="true"] { background: var(--green); color: #fff; }
.fv-lhead { font-weight: 600; background: var(--paper); border-bottom: 1px solid var(--rule); }
.fv-listbox .fv-lhead { position: sticky; top: 0; z-index: 1; }
.fv-lempty { padding: 4px 8px; color: var(--ink-soft); }
.fv-listbox:focus { outline: 2px solid var(--green); outline-offset: -1px; }
.fv-listbox .fv-lrow.caret { outline: 1px dotted currentColor; outline-offset: -2px; }
.fv-listbox.readonly { background: var(--paper); }
.fv-listbox.readonly .fv-lrow[aria-selected="true"] { background: var(--ink-soft); }
.fv-chart:focus-visible { outline: 2px solid var(--green); outline-offset: -2px; }

/* Command and toggle buttons (buttonFace in formwidgets.js): Picture and Picture Caption
   Arrangement, Transparent, hover and pressed colours, Cursor On Hover; Triple State */
.fv-button[data-arrange], .fv-toggle[data-arrange] { gap: 4px; padding: 2px 4px; overflow: hidden; }
.fv-button[data-arrange="top"], .fv-toggle[data-arrange="top"] { flex-direction: column-reverse; }
.fv-button[data-arrange="bottom"], .fv-toggle[data-arrange="bottom"] { flex-direction: column; }
.fv-button[data-arrange="left"], .fv-toggle[data-arrange="left"] { flex-direction: row-reverse; }
.fv-btn-pic { display: block; min-width: 0; min-height: 0; max-width: 100%; max-height: 100%; object-fit: contain; }
.fv-btn-cap { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fv-transparent { background: transparent !important; border-color: transparent !important; color: transparent !important; box-shadow: none !important; }
.fv-transparent > * { visibility: hidden; }
.fv-hand { cursor: pointer; }
.fv-hover-bg:hover:not(:disabled) { background: var(--fv-hover) !important; }
.fv-hover-fg:hover:not(:disabled) { color: var(--fv-hover-fg) !important; }
.fv-pressed-bg:active:not(:disabled), .fv-toggle.fv-pressed-bg[aria-pressed="true"] { background: var(--fv-pressed) !important; }
.fv-pressed-fg:active:not(:disabled), .fv-toggle.fv-pressed-fg[aria-pressed="true"] { color: var(--fv-pressed-fg) !important; }
.fv-toggle[aria-pressed="mixed"] { background: var(--ledger); color: var(--ink-soft); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .15); }
.fv-radio:indeterminate { border-color: var(--ink-soft); background: var(--ledger); }
.fv-radio:indeterminate::before { content: ''; width: 8px; height: 2px; background: var(--ink-soft); }

/* Tab controls: Style, Multi Row, pictures and pages that are hidden or not Enabled */
.fv-tabs:not(.multi) { overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.fv-tabs.multi { flex-wrap: wrap; height: auto; min-height: 30px; }
.fv-tabs.buttons { align-items: center; gap: 4px; }
.fv-tabs.buttons .fv-tab { border: 1px solid var(--rule-strong); border-radius: var(--radius); top: 0; }
.fv-tabs.buttons .fv-tab[aria-selected="true"] { background: var(--green); border-color: var(--green-dark); color: #fff; }
.fv-tab { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.fv-tab:disabled { opacity: .5; cursor: default; }
.fv-tab-pic { width: 16px; height: 16px; object-fit: contain; }

/* SysCmd's status line and progress meter */
#app-status { position: fixed; left: 12px; bottom: 10px; z-index: 40; padding: 5px 10px; border-radius: 4px; background: var(--ink); color: #fff; font-size: 13px; box-shadow: 0 4px 14px rgba(20, 40, 30, .25); pointer-events: none; max-width: 60vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- the File tab and its Backstage view ---------- */


.backstage {
  position: fixed; top: 44px; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: 200px 1fr; background: var(--paper);
}
.bs-nav { display: flex; flex-direction: column; background: var(--green); color: #fff; padding: 12px 0; overflow: auto; }
.bs-back { align-self: flex-start; margin: 0 0 12px 12px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255,255,255,.6); background: none; color: #fff; font-size: 20px; cursor: pointer; }
.bs-back:hover, .bs-back:focus-visible { background: var(--green-dark); }
.bs-item { display: flex; align-items: center; gap: 10px; border: 0; background: none; color: #fff; text-align: left; padding: 11px 20px; font: inherit; cursor: pointer; }
.bs-item .icon { color: #fff; }
.bs-item:hover, .bs-item:focus-visible { background: var(--green-dark); }
.bs-item[aria-current="true"] { background: var(--green-dark); box-shadow: inset 4px 0 0 #fff; font-weight: 700; }
.bs-spacer { flex: 1; }
.bs-content { overflow: auto; padding: 24px 40px 40px; max-width: 920px; outline: none; }
.bs-content h1 { font-size: var(--step-2); font-weight: 400; margin: 0 0 16px; }
.bs-content h2 { font-size: var(--step-0); color: var(--green-dark); margin: 18px 0 8px; }
.bs-dbname { font-size: var(--step-1) !important; color: var(--ink) !important; }
.bs-facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0 0 20px; }
.bs-facts dt { color: var(--ink-soft); }
.bs-facts dd { margin: 0; }
.bs-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin: 0 0 16px; }
.bs-tile { display: flex; gap: 12px; align-items: flex-start; text-align: left; padding: 14px; border: 1px solid var(--rule-strong); border-radius: var(--radius); background: #fff; font: inherit; cursor: pointer; }
.bs-tile:hover, .bs-tile:focus-visible { border-color: var(--green); background: var(--green-tint); }
.bs-tile[aria-pressed="true"] { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); background: var(--green-tint); }
.bs-tile-icon .icon { width: 28px; height: 28px; color: var(--green); }
.bs-tile-text { display: grid; gap: 4px; }
.bs-tile-text span { color: var(--ink-soft); font-size: var(--step--1); }
.bs-form { display: grid; gap: 10px; max-width: 560px; }
.bs-form .btn { justify-self: start; }
.bs-note { color: var(--ink-soft); font-size: var(--step--1); margin: 0; }
.bs-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.bs-row { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--rule); padding: 2px 4px; }
.bs-row.current { background: var(--green-tint); }
.bs-open { flex: 1; display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 9px 6px; text-align: left; font: inherit; cursor: pointer; min-width: 0; }
button.bs-open:hover .bs-row-name, button.bs-open:focus-visible .bs-row-name { text-decoration: underline; }
.bs-binned { cursor: default; color: var(--ink-soft); }
.bs-row-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bs-here { color: var(--ink-soft); font-size: var(--step--1); }
.bs-row .role-badge { background: var(--ledger); color: var(--ink-soft); }
.bs-actions { display: flex; gap: 4px; }
.bs-bin h2 { color: var(--ink-soft); }

@media (max-width: 760px) {
  .backstage { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .bs-nav { flex-direction: row; flex-wrap: wrap; padding: 6px; }
  .bs-back { margin: 0 6px 0 0; width: 34px; height: 34px; }
  .bs-item { padding: 8px 10px; }
  .bs-spacer { display: none; }
  .bs-content { padding: 16px; }
}

/* Administration > Accounts */
.accounts h2 { margin-top: 22px; }
.acc-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px 16px; align-items: end; max-width: 980px; margin-bottom: 8px; }
.acc-form .btn { justify-self: start; }
.input.small { height: 28px; padding: 2px 6px; }
.users .pill + .pill, .users td .pill { margin-left: 6px; }

.bs-share-form { grid-template-columns: 1fr 240px; align-items: end; max-width: 760px; }
.bs-share-form .error-text, .bs-share-form .btn { grid-column: 1 / -1; }
.bs-invite { border: 1px solid var(--green); background: var(--green-tint); border-radius: var(--radius); padding: 12px 14px; margin: 12px 0; max-width: 760px; display: grid; gap: 8px; }
.bs-invite p { margin: 0; }
.bs-row select.input.small { width: auto; }
@media (max-width: 760px) { .bs-share-form { grid-template-columns: 1fr; } }

/* ---------- runtime: forms and reports only ---------- */
.shell.runtime { grid-template-columns: 0 0 minmax(0, 1fr); }
.shell.runtime .rail, .shell.runtime .cmdbar, .shell.runtime .nav, .shell.runtime .nav-strip, .shell.runtime .topbar .nav-toggle { display: none !important; }
.shell.runtime.no-doc-tabs .doc-tabs { display: none; }
.topbar .topbar-file { font-weight: 700; border: 1px solid rgba(255,255,255,.45); }
.app-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 360px; padding-left: 12px; border-left: 1px solid rgba(255,255,255,.3); }
.app-title:empty { display: none; }
.preview-note { display: inline-flex; align-items: center; gap: 8px; background: var(--amber, #b7791f); color: #fff; border-radius: var(--radius); padding: 3px 4px 3px 10px; font-size: var(--step--1); white-space: nowrap; }
.preview-note .btn { color: var(--ink); background: #fff; }
.runtime-start h3 { margin: 18px 0 8px; font-size: var(--step-0); color: var(--green-dark); }
.start-list { display: flex; flex-wrap: wrap; gap: 8px; }
.start-list .btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; }
@media (max-width: 760px) { .shell.runtime { grid-template-columns: 1fr; } .app-title { max-width: 140px; } .preview-note { font-size: 11px; } }

/* ---------- Overlapping Windows: documents in windows inside the document area ---------- */
.shell.mdi .doc-tabs { display: none; }
.shell.mdi .doc-body { overflow: hidden; isolation: isolate; background: var(--ledger); }
.popup-window.doc-window { position: absolute; box-shadow: 0 6px 18px rgba(20, 40, 30, .18); }
.popup-window.doc-window .pw-bar { height: 30px; }
.popup-window.doc-window .doc-pane { position: absolute; inset: 0; }
.popup-window.doc-window.maxed { box-shadow: none; border: 0; }
.popup-window.doc-window:not(.active) .pw-bar { background: #5f7a6d; }

/* File > Errors: the database's error log */
.err-list { gap: 0; }
.err-row { display: grid; gap: 4px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.err-row.resolved { opacity: .65; }
.err-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: var(--step--1); }
.err-kind { padding: 1px 6px; border-radius: var(--radius); background: var(--pane); color: var(--ink); font-weight: 600; }
.err-kind.vba, .err-kind.server { background: var(--danger-tint); color: var(--danger); }
.err-kind.report { background: var(--green-tint); color: var(--green-dark); }
.err-num { color: var(--ink-soft); }
.err-new { padding: 1px 6px; border-radius: var(--radius); background: var(--amber-tint); color: #7a5009; font-weight: 600; }
.err-done { color: var(--green); font-weight: 600; }
.err-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.err-meta { overflow-wrap: anywhere; }
.err-shot { max-width: 260px; max-height: 160px; border: 1px solid var(--rule); border-radius: var(--radius); }
.err-row .bs-actions { justify-content: flex-start; }
.bs-check { display: inline-flex; align-items: center; gap: 4px; margin: 0 0 8px; font-size: var(--step--1); }

/* Outside runtime the command bar does what each object's own toolbar did (views, Save, Run,
   record buttons), so those stay out of sight; runtime people, who have no command bar, keep
   them. A datasheet keeps its notes and Change parameter values. */
.shell:not(.runtime) .doc-toolbar, .shell:not(.runtime) .cmd-dup { display: none !important; }
.shell:not(.runtime) .ds-toolbar:not(:has(.ds-note, .ds-param:not([hidden]))) { display: none; }
dialog.dlg .dlg-note { margin: 10px 0 0; max-width: 46ch; font-size: 13px; }

/* a ProgressBar: Standard scrolling fills in blocks, Smooth as one bar */
.fv-progress { display: flex; align-items: stretch; box-sizing: border-box; padding: 2px; overflow: hidden; background: #fff; border: 1px solid transparent; box-shadow: inset 0 0 0 1px var(--rule-strong); }
.fv-progress.pb-border { border-color: var(--ink); }
.fv-progress.pb-flat { box-shadow: inset 0 0 0 1px var(--rule-strong); }
.fv-progress:not(.pb-flat) { box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.28), inset 0 0 0 1px var(--rule-strong); }
.fv-progress.pb-vertical { flex-direction: column-reverse; }
.fv-progress-fill { flex: none; background: var(--green); transition: width 0.12s linear, height 0.12s linear; }
.fv-progress:not(.pb-smooth) > .fv-progress-fill { -webkit-mask: repeating-linear-gradient(90deg, #000 0 10px, transparent 10px 12px); mask: repeating-linear-gradient(90deg, #000 0 10px, transparent 10px 12px); }
.fv-progress.pb-vertical:not(.pb-smooth) > .fv-progress-fill { -webkit-mask: repeating-linear-gradient(0deg, #000 0 10px, transparent 10px 12px); mask: repeating-linear-gradient(0deg, #000 0 10px, transparent 10px 12px); }
.fv-progress[aria-disabled='true'] > .fv-progress-fill { background: var(--ink-soft); }
@media (prefers-reduced-motion: reduce) { .fv-progress-fill { transition: none; } }
.fd-progressbar > .fv-progress { position: absolute; inset: 0; pointer-events: none; }
/* a selected control that clips what it shows (a label, list box, image) still shows its sizing
   handles whole: they sit just outside its box */
.fd-label.selected, .fd-listbox.selected, .fd-image.selected { overflow: clip; overflow-clip-margin: 8px; }

/* printing a form (formprint.js): a copy of its sections on pages of their own */
.fv-print-root { display: none; }
@media print {
  body.printing-form > *:not(.fv-print-root) { display: none !important; }
  body.printing-form { margin: 0; background: #fff; }
  .fv-print-root { display: block; }
  .fv-print-sheet { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .fv-print-sheet > .fv-section { position: relative; overflow: hidden; break-inside: avoid; page-break-inside: avoid; }
  /* a subform prints its records, not its record navigation or status line */
  .fv-print-root .recordbar, .fv-print-root .fv-statusbar, .fv-print-root .fv-date-btn { display: none !important; }
  .fv-print-root .fv-scroll { overflow: hidden; }
  .fv-print-root .fv-selector { color: transparent; } /* no current-record pointer on paper */
}

/* a Slider: the browser's own range control in the app's colour */
.fv-slider { display: flex; align-items: center; box-sizing: border-box; padding: 0 2px; }
.fv-slider.sl-border { border: 1px solid var(--ink); }
.fv-slider-input { flex: 1; min-width: 0; margin: 0; accent-color: var(--green); }
.fv-slider.sl-vertical { justify-content: center; padding: 2px 0; }
.fv-slider.sl-vertical > .fv-slider-input { writing-mode: vertical-lr; height: 100%; flex: none; }
.fd-slider > .fv-slider, .fd-updown > .fv-updown { position: absolute; inset: 0; pointer-events: none; }
/* an UpDown: two arrows, one above the other (or side by side) */
.fv-updown { display: flex; flex-direction: column; box-sizing: border-box; border: 1px solid var(--rule-strong); background: var(--paper); }
.fv-updown.ud-horizontal { flex-direction: row; }
.fv-ud-btn { flex: 1; min-width: 0; min-height: 0; padding: 0; border: 0; background: none; color: var(--ink); font-size: 8px; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.fv-ud-btn + .fv-ud-btn { border-top: 1px solid var(--rule-strong); }
.fv-updown.ud-horizontal > .fv-ud-btn + .fv-ud-btn { border-top: 0; border-left: 1px solid var(--rule-strong); }
button.fv-ud-btn:hover:not(:disabled) { background: var(--green-tint); }
button.fv-ud-btn:disabled { color: var(--rule-strong); cursor: default; }
/* a Web Browser Control: a web page in a frame, with a way out for a page that won't be framed */
.fv-web { position: relative; box-sizing: border-box; background: #fff; overflow: hidden; }
.fv-web-frame { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
.fv-web > .fv-message { margin: 0; padding: 8px 10px; }
.fv-web-open { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; display: grid; place-items: center; border: 1px solid var(--rule-strong); border-radius: 2px; background: var(--paper); color: var(--green-dark); text-decoration: none; font-size: 14px; opacity: 0; transition: opacity .12s; }
.fv-web:hover > .fv-web-open, .fv-web-open:focus { opacity: 1; }
.fv-web-open[hidden] { display: none; }
.fd-webbrowser { border: 1px dashed var(--rule-strong); background: #f7f9f7; color: var(--ink-soft); align-items: flex-start; overflow: hidden; }

/* Find and Replace (findreplace.js): a small panel that stays beside the records */
.find-dlg { position: fixed; top: 96px; right: 24px; z-index: 60; width: 330px; padding: 10px 12px 12px; background: var(--paper); border: 1px solid var(--rule-strong); border-top: 3px solid var(--green); box-shadow: 0 6px 24px rgba(20, 40, 30, .22); font-size: var(--step--1); }
.find-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.find-tabs { display: flex; gap: 2px; }
.find-tab { border: 1px solid var(--rule); background: var(--ledger); padding: 3px 12px; font: inherit; cursor: pointer; }
.find-tab[aria-selected="true"] { background: #fff; border-color: var(--rule-strong); color: var(--green-dark); font-weight: 600; }
.find-row { display: grid; grid-template-columns: 92px 1fr; align-items: center; gap: 6px; margin-bottom: 6px; }
.find-row[hidden] { display: none; }
.find-row .input { width: 100%; box-sizing: border-box; min-width: 0; }
.find-check { display: flex; align-items: center; gap: 6px; margin: 2px 0 6px 98px; }
.find-status { min-height: 1.3em; margin: 0 0 6px; color: var(--ink-soft); }
.find-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
/* the field Find stopped on in a form */
.fv-ctl.find-hit { outline: 2px solid var(--amber); outline-offset: 1px; }
@media (max-width: 640px) { .find-dlg { left: 8px; right: 8px; width: auto; top: auto; bottom: 8px; } }
.new-source { width: 100%; min-width: 320px; }

/* Filter by Form (filterform.js) */
.ff-dlg .body { width: min(520px, 86vw); }
.ff-help { margin: 0 0 8px; font-size: var(--step--1); }
.ff-help code { background: var(--ledger); padding: 0 3px; }
.ff-tabs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--rule-strong); }
.ff-tab { border: 1px solid var(--rule); border-bottom: 0; background: var(--ledger); padding: 4px 12px; font: inherit; font-size: var(--step--1); cursor: pointer; }
.ff-tab[aria-selected="true"] { background: #fff; border-color: var(--rule-strong); color: var(--green-dark); font-weight: 600; position: relative; top: 1px; }
.ff-tab.ff-add { background: none; border-color: transparent; color: var(--green-dark); }
.ff-grid { max-height: 46vh; overflow: auto; border: 1px solid var(--rule-strong); border-top: 0; padding: 8px; margin-bottom: 8px; background: #fff; }
.ff-row { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; align-items: center; gap: 8px; margin-bottom: 4px; }
.ff-row .input { width: 100%; box-sizing: border-box; min-width: 0; }

/* ---------- a form in Datasheet view ----------
   The form itself as a grid (formview.js, formsheet.js): a row for each record, its bound
   controls as the cells. The header and footer are not shown; their controls are there for code. */
.fv-surface.sheet { background: #fff; font-family: var(--ds-font, inherit); border-top: 1px var(--ds-border, none) var(--ds-grid, var(--rule)); }
.fv-surface.sheet > .fv-section { display: none !important; }
.fv-sheet-head {
  position: sticky; top: 0; z-index: 4; display: flex; flex: none; height: 28px;
  background: var(--pane); border-bottom: 1px var(--ds-head, solid) var(--ds-grid, var(--rule-strong));
  font-size: var(--ds-size, inherit); font-style: var(--ds-style, normal); font-weight: 600; user-select: none;
}
.fv-sheet-corner { position: sticky; left: 0; z-index: 2; flex: none; width: 18px; background: var(--pane); border-right: 1px solid var(--rule-strong); box-sizing: border-box; }
.fv-surface.no-selectors .fv-sheet-corner { display: none; }
.fv-sheet-cap {
  flex: none; display: flex; align-items: center; gap: 4px; padding: 0 8px; box-sizing: border-box;
  background: var(--pane); border-right: 1px solid var(--rule); white-space: nowrap; overflow: hidden; cursor: pointer;
}
.fv-sheet-cap:not([title]) { cursor: default; }
.fv-sheet-cap[title]:hover { background: #dbe4dd; }
.fv-sheet-cap .cap-text { overflow: hidden; text-overflow: ellipsis; }
.fv-sheet-cap .sort { color: var(--green); font-size: 11px; }
.fv-sheet-cap .sort:empty { display: none; }
.fv-sheet-cap.frozen { position: sticky; left: var(--fx); z-index: 1; }
.fv-surface.sheet .fv-row { background-color: #fff; border-bottom: 1px var(--ds-h, solid) var(--ds-grid, var(--rule)); }
.fv-surface.sheet .fv-row:nth-child(even) { background-color: var(--ledger); }
.fv-surface.sheet .fv-row[data-new] { background-color: var(--paper); }
.fv-surface.sheet .fv-row.current { background-color: var(--green-tint) !important; }
.fv-surface.sheet .fv-row-body { display: flex; background-color: inherit; }
/* a cell: no box of its own, the row's colour (so a frozen column covers what scrolls under it) */
.fv-surface.sheet .fv-row .fv-input { border: 0; border-radius: 0; background-color: transparent; color: inherit; padding: 0 8px; }
.fv-surface.sheet .fv-row-body > .fv-ctl { border: 0; border-right: 1px var(--ds-v, solid) var(--ds-grid, var(--rule)); border-radius: 0; background-color: inherit; color: var(--ink); }
.fv-surface.sheet .fv-row-body > .fv-ctl.frozen { position: sticky !important; left: var(--fx) !important; top: auto !important; flex: none; z-index: 2; }
.fv-surface.sheet .fv-row-body > .fv-ctl.frozen-last, .fv-sheet-cap.frozen:has(+ .fv-sheet-cap:not(.frozen)) { border-right: 1px solid var(--rule-strong); }
.fv-surface.sheet .fv-row .fv-input:focus, .fv-surface.sheet .fv-row .fv-check:focus-within { outline: 2px solid var(--green); outline-offset: -2px; }
.fv-surface.sheet .fv-combo { padding-right: 8px; }
.fv-surface.sheet .fv-combo-wrap:focus-within .fv-combo { padding-right: 24px; }
.fv-surface.sheet .fv-combo-btn { display: none; }
.fv-surface.sheet .fv-combo-wrap:focus-within .fv-combo-btn { display: block; }
.fv-surface.sheet.ds-raised .fv-row-body > .fv-ctl { border-top: 1px solid #fff; border-left: 1px solid #fff; border-right: 1px solid #9a9a9a; border-bottom: 1px solid #9a9a9a; }
.fv-surface.sheet.ds-sunken .fv-row-body > .fv-ctl { border-top: 1px solid #9a9a9a; border-left: 1px solid #9a9a9a; border-right: 1px solid #fff; border-bottom: 1px solid #fff; }
/* a datasheet subform: the grid to the edges of its box */
.fv-subform .fv.sheet-view .fv-scroll { background: #fff; }

/* ---------- the macro designer ---------- */
.md { overflow: auto; background: #fff; }
.md-body { max-width: 860px; padding: 16px 20px 40px; }
.md-intro { margin: 0 0 12px; font-size: var(--step--1); }
.md-list { display: flex; flex-direction: column; gap: 4px; }
.md-list .md-list { margin: 4px 0 4px 22px; padding-left: 10px; border-left: 2px solid var(--rule); }
.md-row { border: 1px solid transparent; border-radius: var(--radius); }
.md-row:focus-visible { outline: 2px solid var(--green); outline-offset: 1px; }
.md-action { border-color: var(--rule); background: var(--paper); }
.md-action.open { border-color: var(--green); background: #fff; box-shadow: 0 1px 4px rgba(20, 40, 30, .08); }
.md-head { display: flex; align-items: center; gap: 8px; min-height: 30px; padding: 2px 6px 2px 10px; }
.md-action > .md-head { cursor: pointer; }
.md-name { font-weight: 600; white-space: nowrap; }
.md-summary { flex: 1; min-width: 0; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.md-tools { display: flex; gap: 0; margin-left: auto; opacity: 0; }
.md-row:hover > .md-head > .md-tools, .md-row:focus-within > .md-head > .md-tools, .md-row.open > .md-head > .md-tools { opacity: 1; }
.md-tools .btn { min-width: 26px; padding: 0 4px; justify-content: center; }
.md-args { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 12px; align-items: center; padding: 4px 12px 12px 22px; }
.md-arg { display: contents; }
.md-arg label { color: var(--ink-soft); text-align: right; }
.md-arg .input { width: 100%; max-width: 520px; min-height: 28px; }
.md-arg textarea.input, .md-comment-text { resize: vertical; padding: 4px 8px; font: inherit; height: 30px; min-height: 30px; line-height: 20px; }
@supports (field-sizing: content) { .md-arg textarea.input, .md-comment-text { field-sizing: content; height: auto; } }
.md-problem { margin: 0 12px 6px 22px; color: var(--danger); font-size: var(--step--1); }
.md-comment .md-name { color: #2e7d4f; font-weight: 400; }
.md-comment-text { flex: 1; color: #2e7d4f; border-color: transparent; background: transparent; }
.md-comment-text:hover, .md-comment-text:focus { border-color: var(--rule-strong); background: #fff; }
.md-block > .md-head .input { flex: 1; max-width: 520px; height: 28px; }
.md-block > .md-head .md-name, .md-end { color: var(--green); }
.md-then { color: var(--green); font-weight: 600; }
.md-end { display: flex; align-items: center; gap: 10px; padding: 2px 10px; font-weight: 600; }
.md-link { font-weight: 400; }
.md-adder { padding: 2px 0; }
.md-add { width: 260px; max-width: 100%; height: 28px; color: var(--ink-soft); }

/* ---------- the Relationships window ---------- */
.doc-pane.rel { display: flex; flex-direction: column; min-height: 0; }
.rel-pane { flex: 1; min-height: 0; border-bottom: 1px solid var(--rule-strong); outline-offset: -2px; }
.rel-hint { position: absolute; left: 24px; top: 20px; max-width: 520px; margin: 0; }
.rel-box .qd-fields { max-height: 240px; }
.rel-box .qd-fields li { cursor: grab; }
.rel-line { stroke-width: 1.5; }
.rel-line.enforced { stroke-width: 2.5; }
.rel-line.selected { stroke: var(--amber); stroke-width: 3.5; }
.rel-mark { font-size: 13px; font-weight: 700; fill: var(--green-dark); paint-order: stroke; stroke: var(--ledger); stroke-width: 3px; }
.rel-below { flex: none; max-height: 34%; overflow: auto; background: var(--paper); }
.rel-list-head { margin: 0; padding: 8px 14px 4px; font-size: var(--step--1); color: var(--ink-soft); text-transform: none; }
.rel-list { list-style: none; margin: 0; padding: 0 6px 8px; }
.rel-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 5px 8px; border: 1px solid transparent; }
.rel-row { cursor: default; }
.rel-row:hover { background: var(--ledger); }
.rel-row.selected { background: var(--green-tint); border-color: var(--green); }
.rel-row-text { font-weight: 600; margin-right: 6px; }
.rel-tag { font-size: var(--step--1); color: var(--ink-soft); border: 1px solid var(--rule-strong); border-radius: 10px; padding: 0 8px; background: #fff; white-space: nowrap; }
dialog.dlg.rel-dialog { width: min(600px, calc(100% - 32px)); }
.rel-tables { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rel-tables .field { margin-bottom: 8px; }
.rel-note { margin: 0 0 6px; }
.rel-pairs { display: grid; gap: 4px; margin-bottom: 14px; max-height: 190px; overflow: auto; }
.rel-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rel-pair-head { font-weight: 600; font-size: var(--step--1); color: var(--ink-soft); }
.rel-check { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; cursor: pointer; }
.rel-check input { accent-color: var(--green); }
.rel-check:nth-of-type(n+2) { margin-left: 24px; }
.rel-dialog .field { margin-top: 12px; }
.rel-kind-row { margin: 0; color: var(--ink-soft); }
.rel-kind { font-weight: 700; color: var(--ink); }
