/* Taskwell — Anand C Johny & Associates
   ACJ brand colours: Evergreen Ink #1C2826 · Ledger Paper #F5F2EB · Laterite #A4532E
   Hill Mist #E3E5DE · Slate #5A6560 · Cardamom #6E7F63 · Forest Night #26332F
   Granite #A3A9A2 · Laterite Light #D08A64
   Type: Noto Sans throughout; Noto Serif only for the ACJ monogram.

   Six ready-made themes (since 1.4.40), set with data-theme on <html>; their colours are in
   themes.css, generated by tools/build_themes.py. Custom themes add a few colours on <html>.
   No data-theme = follow the device (Paper white by day, Graphite by night).
   Laterite is kept for what needs attention: overdue, the active marker. */

/* ---------- Shared tokens (colours are in themes.css) ---------- */

:root {
  --sans: "Noto Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --serif: "Noto Serif", Georgia, serif;
  --radius: 8px;
  --radius-lg: 12px;
  --ctl-h: 38px;
}

/* ---------- Base ---------- */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background-color: var(--bg);
  /* A gentle background: two soft glows in the theme's colours and a fine paper grain */
  background-image: var(--bg-grain), var(--bg-glow);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent-soft); }

h1, h2, h3, h4 { margin: 0; font-family: var(--sans); color: var(--text); letter-spacing: -0.01em; }
h1 { font-size: 24px; line-height: 1.25; font-weight: 600; }
h2 { font-size: 17px; line-height: 1.35; font-weight: 600; }
h3 { font-size: 15px; font-weight: 600; }
h4 { font-size: 14px; font-weight: 600; }

.muted { color: var(--text-2); }
.small { font-size: 13px; }
.hidden { display: none !important; }

/* The brand's double rule: two equal strokes */
.double-rule { display: block; height: 10px; border-top: 2px solid var(--accent); border-bottom: 2px solid var(--accent); }

/* ---------- Shell ---------- */

.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns 0.2s ease; }

.side {
  background: var(--side-bg);
  color: var(--side-text);
  display: flex; flex-direction: column;
  padding: 22px 14px 18px;
  position: sticky; top: 0; height: 100vh;
  border-right: 1px solid var(--side-line);
}
.wordmark {
  display: inline-flex; flex-direction: column; align-items: flex-start; gap: 7px;
  padding: 2px 12px 26px; text-decoration: none; color: var(--side-text);
}
.wordmark .acj { font-family: var(--serif); font-weight: 500; font-size: 26px; line-height: 1; letter-spacing: 0.07em; }
.wordmark .double-rule { width: 52px; height: 8px; border-width: 2px 0; border-color: var(--side-accent); }
.wordmark .app { font-size: 12.5px; font-weight: 500; color: var(--side-muted); letter-spacing: 0.02em; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  height: 38px; padding: 0 12px;
  border-radius: var(--radius);
  text-decoration: none; color: var(--side-muted); font-weight: 500; font-size: 14px;
  transition: background 0.12s, color 0.12s;
}
.nav a svg { width: 18px; height: 18px; flex: none; opacity: 0.9; color: var(--side-icon, currentColor); }
.nav a:hover { color: var(--side-text); background: var(--side-raise); }
.nav a.active { color: var(--side-text); background: var(--side-raise); }
.nav a.active svg { color: var(--side-icon, var(--side-accent)); opacity: 1; }
.nav-sub { display: flex; flex-direction: column; gap: 1px; margin: 1px 0 6px; }
.nav .nav-sub a { height: 31px; padding: 0 12px 0 41px; font-size: 13.5px; font-weight: 500; position: relative; }
.nav .nav-sub a::before { content: ""; position: absolute; left: 20px; top: 0; bottom: 0; border-left: 1px solid var(--side-line); }
.nav .nav-sub a.active { background: transparent; color: var(--side-text); font-weight: 600; }
.nav .nav-sub a.active::before { border-left: 2px solid var(--side-accent); left: 19.5px; top: 6px; bottom: 6px; }
.nav .nav-sub a:hover { background: var(--side-raise); }
.nav-head {
  display: flex; align-items: center; gap: 11px; width: 100%; height: 38px; padding: 0 12px;
  border: 0; border-radius: var(--radius); background: transparent; cursor: pointer; text-align: left;
  font: inherit; font-weight: 500; font-size: 14px; color: var(--side-muted); transition: background 0.12s, color 0.12s;
}
.nav-head svg { width: 18px; height: 18px; flex: none; opacity: 0.9; color: var(--side-icon, currentColor); }
.nav-head span { flex: 1; }
.nav-head:hover { color: var(--side-text); background: var(--side-raise); }
.nav-head:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.nav-group.on > .nav-head { color: var(--side-text); }
.nav-group.on > .nav-head svg { color: var(--side-icon, var(--side-accent)); opacity: 1; }
.chev { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid currentColor; opacity: 0.7; transition: transform 0.15s; transform: rotate(-90deg); }
.nav-group.open .chev { transform: none; }
/* Sub-menus open and close with a short height change and fade (1.5.31). A closed one is
   hidden from the Tab key (visibility), after the closing has finished. */
.nav-sub { overflow: hidden; max-height: 420px; opacity: 1; visibility: visible; transition: max-height 0.2s ease, opacity 0.18s ease, margin 0.2s ease, visibility 0s; }
.nav-group:not(.open) > .nav-sub { max-height: 0; opacity: 0; margin-top: 0; margin-bottom: 0; visibility: hidden; transition: max-height 0.18s ease, opacity 0.14s ease, margin 0.18s ease, visibility 0s 0.18s; }
.subtabs { display: none; }

.side-foot { padding: 14px 6px 0; border-top: 1px solid var(--side-line); font-size: 13px; color: var(--side-muted); }
.me { display: flex; align-items: center; gap: 10px; min-width: 0; }
.me-av {
  width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: color-mix(in srgb, var(--rc) 45%, var(--side-bg)); color: var(--side-text); font-size: 12.5px; font-weight: 700; letter-spacing: 0.02em;
}
.me-t { display: flex; flex-direction: column; min-width: 0; }
.me-t .who { color: var(--side-text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-t .role { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.foot-actions { display: flex; gap: 4px; margin-top: 10px; }
.side-foot button {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 9px; border-radius: var(--radius);
  background: none; border: 0; color: var(--side-muted); cursor: pointer; font-size: 13px;
}
.side-foot button svg { width: 16px; height: 16px; flex: none; color: var(--side-icon, currentColor); }
.side-foot button span { white-space: nowrap; }
.side-foot button:hover { color: var(--side-text); background: var(--side-raise); }
.side-foot .ver { color: var(--side-muted); text-decoration: none; }
.side-foot .ver:hover { color: var(--side-text); text-decoration: underline; }

.main { padding: 30px 40px 72px; min-width: 0; max-width: 1480px; width: 100%; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head p { margin: 4px 0 0; }

@media (max-width: 860px) {
  .subtabs:not(.hidden) {
    display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin: -6px 0 16px;
    border-bottom: 1px solid var(--border);
  }
  .subtabs::-webkit-scrollbar { display: none; }
  .subtabs a { padding: 9px 12px; white-space: nowrap; text-decoration: none; color: var(--text-2); font-weight: 500; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
  .subtabs a.on { color: var(--text); border-bottom-color: var(--accent); }
  h1 { font-size: 22px; }
}

/* ---------- Buttons ---------- */
/* Main buttons take the theme's accent (--main-btn-*); other filled controls keep --btn-*.
   No borders on buttons (1.4.56): the main button is solid, the others a soft fill. */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: var(--ctl-h); padding: 0 16px;
  border-radius: var(--radius);
  border: 0;
  background: var(--main-btn-bg); color: var(--main-btn-text);
  font-weight: 500; font-size: 14px; line-height: 1;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background 0.12s, box-shadow 0.12s, transform 0.06s;
}
.btn:hover { background: var(--main-btn-hover); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.btn.secondary { background: color-mix(in srgb, var(--text) 7%, transparent); color: var(--text); }
.btn.secondary:hover { background: color-mix(in srgb, var(--text) 12%, transparent); }
.btn.danger { background: var(--accent-soft); color: var(--accent); }
.btn.danger:hover { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.btn.small { height: 32px; padding: 0 12px; font-size: 13px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.link-btn {
  background: none; border: 0; padding: 0;
  color: var(--text); text-decoration: underline; text-decoration-color: var(--text-3); text-underline-offset: 3px;
  cursor: pointer;
}
.link-btn:hover { text-decoration-color: var(--text); }

/* ---------- Forms ---------- */

label.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--text-2); min-width: 0; }
label.field span.req::after { content: " *"; color: var(--accent); }

input[type=text], input[type=email], input[type=password], input[type=date], input[type=time],
input[type=number], input[type=search], input[type=tel], select, textarea {
  width: 100%;
  height: var(--ctl-h);
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text);
  font-size: 14.5px; font-weight: 400;
  transition: border-color 0.12s, box-shadow 0.12s;
}
textarea { height: auto; min-height: 84px; padding: 9px 12px; resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--text-3); }
input:hover, select:hover, textarea:hover { border-color: var(--text-3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
input:disabled, select:disabled, textarea:disabled { background: var(--surface); color: var(--text-2); border-color: var(--border); cursor: not-allowed; }
select {
  appearance: none; -webkit-appearance: none;
  padding-right: 34px;
  background-image: var(--chev); background-repeat: no-repeat; background-position: right 12px center;
  cursor: pointer;
}
input[type=search]::-webkit-search-cancel-button { cursor: pointer; }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; accent-color: var(--btn-bg); margin: 0; flex: none; }
input[type=number]::-webkit-inner-spin-button { opacity: 0.4; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid .full { grid-column: 1 / -1; }
/* One-time client from New task (1.4.43) */
.once-box { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; padding: 12px 14px; border: 1px dashed var(--text-3); border-radius: var(--radius); background: var(--surface); }
.once-box.hidden { display: none; }
.once-box p { grid-column: 1 / -1; margin: 0; }
@media (max-width: 600px) { .once-box { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }

.filters { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; align-items: flex-end; }
.filters > * { flex: 0 1 auto; }
.filters input[type=search] { min-width: 240px; }
.filters select { width: auto; min-width: 150px; }
@media (max-width: 600px) { .filters > * { flex: 1 1 140px; } .filters input[type=search] { min-width: 0; } .filters select { width: 100%; } }

/* Segmented control */
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); }
.seg button {
  background: transparent; border: 0; height: 30px; padding: 0 12px; border-radius: 6px;
  cursor: pointer; color: var(--text-2); font-weight: 500; font-size: 13.5px;
}
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--card); color: var(--text); box-shadow: var(--shadow); }

/* ---------- Date picker (desktop) ---------- */

.dp-wrap { position: relative; display: block; }
.dp-wrap input[type=date] { padding-right: 40px; }
.dp-wrap input[type=date]::-webkit-calendar-picker-indicator { display: none; }
.dp-btn {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 30px; border: 0; border-radius: 6px; background: transparent;
  color: var(--text-2); cursor: pointer; display: grid; place-items: center;
}
.dp-btn:hover { background: var(--surface); color: var(--text); }
.dp-btn svg { width: 17px; height: 17px; }
.dp-wrap input:disabled + .dp-btn { display: none; }
.dp {
  position: fixed; z-index: 1000; width: 296px; padding: 12px;
  background: var(--card); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  font-size: 13.5px;
}
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dp-title { font-weight: 600; font-size: 14.5px; padding-left: 6px; }
.dp-nav { display: flex; gap: 2px; }
.dp-nav button {
  width: 30px; height: 30px; border: 0; border-radius: 6px; background: transparent; cursor: pointer;
  color: var(--text-2); display: grid; place-items: center;
}
.dp-nav button:hover { background: var(--surface); color: var(--text); }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-wd { text-align: center; font-size: 11.5px; font-weight: 600; color: var(--text-3); padding: 4px 0 6px; }
.dp-day {
  height: 36px; border: 0; border-radius: 8px; background: transparent; cursor: pointer;
  color: var(--text); font-size: 13.5px; font-variant-numeric: tabular-nums;
}
.dp-day:hover { background: var(--surface); }
.dp-day.out { color: var(--text-3); }
.dp-day.today { box-shadow: inset 0 0 0 1px var(--text-3); font-weight: 600; }
.dp-day.sel { background: var(--btn-bg); color: var(--btn-text); font-weight: 600; box-shadow: none; }
.dp-day:disabled { color: var(--text-3); opacity: 0.4; cursor: not-allowed; background: transparent; }
.dp-day:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--accent); }
.dp-foot { display: flex; justify-content: space-between; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--rule-soft); }
.dp-foot button { border: 0; background: transparent; color: var(--text); font-weight: 500; cursor: pointer; padding: 4px 8px; border-radius: 6px; font-size: 13px; }
.dp-foot button:hover { background: var(--surface); }
.dp-foot .dp-clear { color: var(--text-2); }

/* ---------- Cards and tables ---------- */

.table-wrap {
  overflow-x: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
table.data { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
table.data th {
  text-align: left; font-weight: 500; color: var(--text-2); font-size: 12.5px;
  padding: 11px 14px; background: var(--surface); white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
table.data td { padding: 13px 14px; border-top: 1px solid var(--rule-soft); vertical-align: top; }
table.data tr:first-child td { border-top: 0; }
table.data tr.clickable { cursor: pointer; }
table.data tr.clickable:hover td { background: var(--hover); }
table.data td.num, table.data th.num { text-align: right; }
table.data .sub { display: block; color: var(--text-2); font-size: 12.5px; margin-top: 1px; }
table.data th .sub { display: block; font-weight: 400; color: var(--text-2); font-size: 12px; }
.table-foot { padding: 10px 14px; border-top: 1px solid var(--rule-soft); }

.empty { padding: 40px 16px; text-align: center; color: var(--text-2); }
.empty .btn { margin-top: 14px; }

/* ---------- Status pill: coloured dot, soft background ---------- */

.st {
  display: inline-flex; align-items: center; gap: 7px;
  height: 24px; padding: 0 10px 0 9px; border-radius: 999px;
  background: var(--surface);
  font-size: 12.5px; font-weight: 500; white-space: nowrap; color: var(--text);
}
.st::before { content: ""; width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--dot, var(--dot-none)); }
.st.not_started { --dot: var(--dot-none); color: var(--text-2); }
.st.awaiting_client, .st.client_review, .st.tax_payment { --dot: var(--dot-wait); }
.st.in_progress { --dot: var(--dot-prog); }
.st.under_review::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--dot-review); }
.st.completed { --dot: var(--dot-done); }
.st.pending_invoice::before { background: linear-gradient(90deg, var(--dot-done) 50%, transparent 50%); box-shadow: inset 0 0 0 1.5px var(--dot-done); }
.st.payment_due::before { background: var(--dot-done); box-shadow: 0 0 0 1.5px var(--card), 0 0 0 3px var(--dot-wait); }
.st.cancelled { --dot: var(--dot-none); color: var(--text-2); text-decoration: line-through; }

.tag {
  display: inline-flex; align-items: center; height: 20px; padding: 0 8px;
  border-radius: 999px; background: var(--surface);
  font-size: 11.5px; font-weight: 500; color: var(--text-2); white-space: nowrap; vertical-align: 1px;
}
.tag.warn { background: var(--accent-soft); color: var(--accent); }

.due-late { color: var(--accent); font-weight: 600; }

/* ---------- Dashboard ---------- */

.tally { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 28px; }
.tally button {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 16px 18px; text-align: left; cursor: pointer;
  transition: border-color 0.12s, transform 0.12s;
}
.tally button:hover { border-color: var(--text-3); }
.tally .n { display: block; font-size: 28px; font-weight: 600; line-height: 1.1; letter-spacing: -0.02em; }
.tally .l { display: block; font-size: 13px; font-weight: 500; color: var(--text-2); margin-top: 6px; }
.tally .late .n { color: var(--accent); }
.tally .late { border-color: var(--accent-soft); }
.tally .inv .n { color: color-mix(in srgb, var(--chart) 75%, var(--text)); }
.tally .total { background: var(--btn-bg); border-color: var(--btn-bg); }
.tally .total .n, .tally .total .l { color: var(--btn-text); }
.tally .total .l { opacity: 0.75; }
.tally .total:hover { background: var(--btn-hover); }
@media (max-width: 600px) { .tally { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .tally .n { font-size: 24px; } .tally button { padding: 13px 14px; } }

.two-col { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.two-col > * { min-width: 0; }
@media (max-width: 1100px) { .two-col { grid-template-columns: minmax(0, 1fr); } }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }

.ledger { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; }
.ledger .empty { padding: 36px 16px; }
.ledger-day { display: grid; grid-template-columns: 96px minmax(0, 1fr); border-top: 1px solid var(--rule-soft); }
.ledger-day:first-child { border-top: 0; }
.ledger-date { padding: 14px 14px 14px 18px; border-right: 1px solid var(--rule-soft); }
.ledger-date .d { font-size: 20px; font-weight: 600; line-height: 1.15; letter-spacing: -0.02em; }
.ledger-date .m { font-size: 12px; color: var(--text-2); }
.ledger-day.late .ledger-date { background: var(--accent-soft); }
.ledger-day.late .ledger-date .d, .ledger-day.late .ledger-date .m { color: var(--accent); }
.ledger-day.today .ledger-date .m { color: var(--text); font-weight: 600; }
.ledger-items { min-width: 0; }
.ledger-item {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 14px;
  padding: 12px 16px; border-top: 1px solid var(--rule-soft); cursor: pointer;
}
.ledger-item:first-child { border-top: 0; }
.ledger-item:hover { background: var(--hover); }
.ledger-item .t { font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.ledger-item .c { color: var(--text-2); font-size: 13px; }
.ledger-item .r { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 12.5px; }
/* My Day: status drop-down and clock on each row (1.4.49) */
.lq { display: inline-flex; align-items: center; gap: 4px; }
.lq .st-select { max-width: 150px; }
.md-list li .r { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 600px) {
  .lq .st-select { max-width: 150px; }
  /* Phones: the status and clock go on their own line under the title */
  .ledger-item:has(.lq) { grid-template-columns: minmax(0, 1fr); }
  .ledger-item:has(.lq) .r { flex-direction: row-reverse; justify-content: space-between; align-items: center; }
  .md-list li:has(.lq) { flex-wrap: wrap; }
  .md-list li:has(.lq) .r { width: 100%; justify-content: space-between; }
}
@media (max-width: 600px) {
  .ledger-day { grid-template-columns: 62px minmax(0, 1fr); }
  .ledger-date { padding: 12px 8px 12px 12px; }
  .ledger-date .d { font-size: 17px; }
  .ledger-item { padding: 11px 12px; }
}

.panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 18px 20px; }
.panel + .panel { margin-top: 16px; }
.panel h2 { font-size: 15.5px; }
.panel .scroll-x { overflow-x: auto; }
.panel table.data th { background: transparent; padding-top: 8px; }
.panel table.data td { border-top-color: var(--rule-soft); }
table.data.compact th, table.data.compact td { padding: 8px 8px; }
table.data.compact td:first-child, table.data.compact th:first-child { padding-left: 0; min-width: 120px; }
table.data.compact td:last-child, table.data.compact th:last-child { padding-right: 0; }
.big-figure { margin: 6px 0 0; font-size: 26px; font-weight: 600; letter-spacing: -0.02em; }

/* ---------- Client page ---------- */

.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px 24px; margin: 0; }
.facts div { min-width: 0; }
.facts dt { font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.facts dd { margin: 3px 0 0; overflow-wrap: anywhere; }

.back { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 14px; color: var(--text-2); text-decoration: none; font-size: 13.5px; font-weight: 500; }
.back:hover { color: var(--text); }

/* ---------- Dialogs ---------- */

dialog {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0;
  background: var(--card);
  color: var(--text);
  width: min(640px, calc(100vw - 24px));
  max-height: calc(100vh - 40px);
  box-shadow: var(--shadow-lg);
}
dialog::backdrop { background: rgba(12, 18, 17, 0.45); }
dialog .d-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px 16px; border-bottom: 1px solid var(--rule-soft); }
dialog .d-head h2 { font-size: 17px; }
dialog .d-body { padding: 20px 22px; overflow-y: auto; max-height: calc(100vh - 170px); }
dialog .d-foot { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--rule-soft); background: var(--card); }
dialog .x {
  width: 32px; height: 32px; border-radius: 8px; border: 0; background: transparent;
  font-size: 22px; line-height: 1; cursor: pointer; color: var(--text-2); display: grid; place-items: center;
}
dialog .x:hover { background: var(--surface); color: var(--text); }
dialog.wide { width: min(920px, calc(100vw - 24px)); }

dialog.drawer {
  margin: 0 0 0 auto;
  height: 100vh; max-height: 100vh;
  width: min(600px, 100vw);
  border-radius: 0; border-width: 0 0 0 1px;
  display: none; flex-direction: column;
}
dialog.drawer[open] { display: flex; }
dialog.drawer .d-body { flex: 1; max-height: none; }
dialog[open] { animation: rise 0.16s ease-out; }
dialog.drawer[open] { animation: slide 0.18s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(8px) scale(0.99); } to { opacity: 1; transform: none; } }
@keyframes slide { from { transform: translateX(28px); opacity: 0.6; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { dialog[open], dialog.drawer[open] { animation: none; } }

.status-bar { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 18px; }
.status-bar button {
  height: 32px; padding: 0 12px; border: 1px solid var(--border); background: var(--card); border-radius: 999px;
  font-size: 13px; font-weight: 500; cursor: pointer; color: var(--text-2);
}
.status-bar button:hover { border-color: var(--text-3); color: var(--text); }
.status-bar button.on { background: var(--btn-bg); color: var(--btn-text); border-color: var(--btn-bg); }

.thread { display: flex; flex-direction: column; gap: 10px; margin: 10px 0; }
.thread .msg { background: var(--surface); border-radius: 10px; padding: 10px 12px; }
.thread .msg .meta { font-size: 12px; color: var(--text-2); font-weight: 500; }
.thread .msg p { margin: 3px 0 0; white-space: pre-wrap; }

.subhead { margin: 26px 0 10px; padding-top: 18px; border-top: 1px solid var(--rule-soft); display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }

.inline-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.inline-form > * { flex: 1 1 120px; }
.inline-form .btn { flex: 0 0 auto; }
.inline-form .field:has(input[type=date]) { flex: 1 1 165px; }

/* ---------- Sign in ---------- */

.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); background: var(--card); }
.auth-brand {
  background: #1C2826; color: #F5F2EB;
  padding: 56px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.auth-brand .monogram { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.auth-brand .acj { font-family: var(--serif); font-weight: 500; font-size: 96px; line-height: 1; letter-spacing: 0.06em; }
.auth-brand .double-rule { width: 100%; height: 12px; border-width: 3px 0; border-color: #D08A64; }
.auth-brand .firm { margin-top: 26px; font-size: 13px; letter-spacing: 0.2em; text-transform: uppercase; color: #F5F2EB; }
.auth-brand .firm span { display: block; color: #A3A9A2; margin-top: 4px; }
.auth-brand .place { font-size: 13px; color: #A3A9A2; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.auth-form form { width: min(380px, 100%); display: flex; flex-direction: column; gap: 16px; }
.auth-form h1 { font-size: 28px; }
.auth-form .btn { height: 42px; }
@media (max-width: 760px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-brand { padding: 28px 20px; gap: 18px; }
  .auth-brand .acj { font-size: 56px; }
  .auth-brand .firm { margin-top: 14px; }
  .auth-brand .place { display: none; }
}

.notice { padding: 11px 14px; border-radius: 10px; font-size: 14px; background: var(--surface); border: 1px solid var(--border); }
.notice.err { background: var(--accent-soft); border-color: transparent; color: var(--text); }
.notice.ok { border-left: 3px solid var(--chart); }
.notice.info { }

/* ---------- Toast ---------- */

#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: #1C2826; color: #F5F2EB;
  padding: 11px 18px; border-radius: 10px;
  font-size: 14px; font-weight: 500; z-index: 1100; max-width: calc(100vw - 32px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}
#toast.err { box-shadow: inset 4px 0 0 #D08A64, 0 10px 30px rgba(0, 0, 0, 0.25); }

/* ---------- Opening screen (1.4.39): the ACJ mark, its double rule drawing itself ---------- */

.splash { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 24px; background: var(--bg); color: var(--text); }
.sp-mark { display: flex; flex-direction: column; align-items: center; gap: 10px; animation: sp-in 0.5s ease-out both; }
.sp-acj { font-family: var(--serif); font-weight: 500; font-size: 54px; line-height: 1; letter-spacing: 0.07em; padding-left: 0.07em; }
.sp-rule { position: relative; display: block; width: 116px; height: 11px; }
.sp-rule i { position: absolute; left: 0; right: 0; height: 2px; background: var(--rule); overflow: hidden; }
.sp-rule i:first-child { top: 0; }
.sp-rule i:last-child { bottom: 0; }
.sp-rule i::after { content: ""; position: absolute; inset: 0; background: var(--accent); transform-origin: left; animation: sp-draw 1.6s cubic-bezier(0.65, 0, 0.35, 1) infinite; }
.sp-rule i:last-child::after { animation-delay: 0.18s; }
.sp-app { font-size: 13px; font-weight: 500; color: var(--text-2); letter-spacing: 0.14em; text-transform: uppercase; padding-left: 0.14em; }
.sp-note { position: relative; margin: 0; min-height: 20px; font-size: 13px; color: var(--text-3); text-align: center; }
.sp-now { animation: sp-fade 0.3s 0.8s both; }
.sp-slow { position: absolute; left: 50%; top: 0; transform: translateX(-50%); white-space: nowrap; opacity: 0; animation: sp-fade 0.4s 7s forwards; }
.sp-note:has(.sp-slow) .sp-now { animation: sp-fade 0.3s 0.8s both, sp-out 0.3s 6.8s forwards; }
@keyframes sp-draw { 0% { transform: scaleX(0); transform-origin: left; } 45% { transform: scaleX(1); transform-origin: left; } 55% { transform: scaleX(1); transform-origin: right; } 100% { transform: scaleX(0); transform-origin: right; } }
@keyframes sp-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes sp-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sp-out { to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .sp-mark, .sp-now { animation: none; }
  .sp-rule i::after { animation: none; transform: none; }
}

/* ---------- Loading: skeleton while a page's data arrives ---------- */

.loading { padding: 40px 0; color: var(--text-2); }
.skel { display: flex; flex-direction: column; gap: 14px; }
.skel i {
  display: block; border-radius: 10px; background: var(--surface);
  background-image: linear-gradient(90deg, transparent 0, rgba(255, 255, 255, 0.35) 50%, transparent 100%);
  background-size: 200% 100%; background-repeat: no-repeat;
  animation: shimmer 1.2s ease-in-out infinite;
}
.skel .s-title { width: 220px; height: 28px; }
.skel .s-line { width: 340px; max-width: 70%; height: 14px; }
.skel .s-card { height: 120px; border-radius: var(--radius-lg); margin-top: 10px; }
.skel .s-card.tall { height: 320px; }
@keyframes shimmer { from { background-position: 150% 0; } to { background-position: -50% 0; } }
@media (prefers-reduced-motion: reduce) { .skel i { animation: none; } }

/* ---------- Settings ---------- */

.settings { max-width: 860px; }
.set-tabs {
  display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;
  border-bottom: 1px solid var(--border); margin-bottom: 18px;
}
.set-tabs::-webkit-scrollbar { display: none; }
.set-tabs button {
  padding: 10px 14px; white-space: nowrap; border: 0; background: transparent; cursor: pointer; font: inherit;
  color: var(--text-2); font-weight: 500; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.set-tabs button:hover { color: var(--text); }
.set-tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.set-tabs button:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--ring); border-radius: var(--radius) var(--radius) 0 0; }
.set-block[hidden] { display: none; }
.set-block {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow);
  padding: 22px 24px 24px; margin: 0 0 18px; scroll-margin-top: 20px;
}
.set-block h2 { margin-bottom: 4px; }
.set-block > p { margin: 0 0 16px; }
.set-sub { margin: 26px 0 12px; }

.theme-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.theme-group { font-size: 12.5px; font-weight: 600; color: var(--text-2); margin: 16px 0 8px; }
.theme-group:first-of-type { margin-top: 4px; }
.theme-choice {
  display: flex; flex-direction: column; gap: 8px; align-items: stretch;
  padding: 8px 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--card); cursor: pointer; color: var(--text); text-align: left; font-size: 13.5px; font-weight: 500;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.theme-choice:hover { border-color: var(--text-3); }
.theme-choice.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.theme-choice > span:last-child { padding: 0 4px; }
.swatch { position: relative; display: block; width: 100%; height: 70px; border-radius: 8px; overflow: hidden; border: 1px solid rgba(0, 0, 0, 0.08); background: var(--sw-bg); }
.swatch i { position: absolute; left: 0; top: 0; bottom: 0; width: 26%; background: var(--sw-side); }
.swatch b { position: absolute; left: 34%; right: 8%; top: 16%; height: 26%; border-radius: 4px; background: var(--sw-card); }
.swatch u { position: absolute; left: 34%; width: 28%; top: 54%; height: 16%; border-radius: 4px; background: var(--sw-btn); }
.swatch s { position: absolute; left: 66%; width: 10%; top: 54%; height: 16%; border-radius: 4px; background: var(--sw-acc); }
/* Your themes (1.4.40): a custom theme card with Edit and Delete under it, and the Add card */
.theme-mine { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.theme-choice em { font-style: normal; font-weight: 400; color: var(--text-2); }
.thm-acts { display: flex; gap: 14px; padding: 0 6px; font-size: 13px; }
.thm-acts .link-btn { color: var(--text-2); }
.thm-acts .link-btn:hover { color: var(--text); }
.theme-add {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 112px;
  border: 1px dashed var(--text-3); border-radius: var(--radius-lg); background: transparent;
  color: var(--text-2); font: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer;
}
.theme-add span { font-size: 22px; line-height: 1; font-weight: 400; }
.theme-add:hover { color: var(--text); border-color: var(--text-2); background: var(--hover); }
.theme-add:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
/* The custom theme editor: Light / Dark, then tabs Sidebar | Background | Accent (1.4.56) */
.ct-set { border: 0; padding: 0; margin: 0 0 4px; min-width: 0; }
.ct-set legend { font-size: 13px; font-weight: 600; color: var(--text-2); padding: 0; margin-bottom: 8px; }
.ct-modes { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); }
.ct-modes label { position: relative; cursor: pointer; }
.ct-modes input, .ct-col input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.ct-modes span { display: block; padding: 6px 18px; border-radius: calc(var(--radius) - 2px); font-size: 13.5px; font-weight: 500; color: var(--text-2); }
.ct-modes input:checked + span { background: var(--card); color: var(--text); box-shadow: var(--shadow); }
.ct-modes input:focus-visible + span { box-shadow: 0 0 0 3px var(--ring); }
.ct-colours { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px 4px; }
.ct-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: end; }
.ct-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: var(--radius-lg, 12px); background: color-mix(in srgb, var(--text) 6%, transparent); }
.ct-tab { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 8px; align-items: center; text-align: left;
  padding: 7px 10px; border: 0; border-radius: var(--radius); background: transparent; color: var(--text-2); cursor: pointer; min-width: 0; font: inherit; }
.ct-tab:hover { color: var(--text); }
.ct-tab.on { background: var(--card); color: var(--text); box-shadow: var(--shadow); }
.ct-tab:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.ct-tdot { grid-row: 1 / 3; width: 20px; height: 20px; border-radius: 50%; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 22%, transparent); }
.ct-tl { font-size: 13.5px; font-weight: 600; }
.ct-tv { font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-panel { min-height: 120px; }
.ct-hint { margin: 2px 0 4px; }
.ct-gl { margin: 12px 0 4px; font-size: 12px; font-weight: 600; letter-spacing: 0.02em; color: var(--text-2); }
.ct-try { margin-top: 10px; width: 100%; }
.ctp-btns { display: inline-flex; gap: 5px; }
.ctp-card em { font-style: normal; }
.ct-col { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 2px 5px; border-radius: var(--radius); cursor: pointer; min-width: 0; }
.ct-col:hover { background: var(--hover); }
.ct-dot { width: 28px; height: 28px; border-radius: 50%; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 24%, transparent); }
.ct-name { font-size: 11.5px; color: var(--text-2); text-align: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-col input:checked ~ .ct-dot { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--text); }
.ct-col input:checked ~ .ct-dot::after { content: ""; display: block; width: 8px; height: 8px; margin: 10px auto 0; border-radius: 50%; background: var(--card); box-shadow: 0 0 0 1.5px var(--text); }
.ct-col input:checked ~ .ct-name { color: var(--text); font-weight: 600; }
.ct-col input:focus-visible ~ .ct-dot { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--accent); }
/* Custom theme form (1.4.50): choices on the left, a preview that follows them on the right */
.ct-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
.ct-form { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.ct-form .ct-colours + .ct-colours { margin-top: 2px; }
.ct-prev-box { position: sticky; top: 0; }
.ct-prev { display: grid; grid-template-columns: 84px minmax(0, 1fr); height: 230px; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); }
.ctp-side { display: flex; flex-direction: column; gap: 4px; padding: 12px 6px; font-size: 11px; }
.ctp-side b { font-family: 'Noto Serif', serif; font-size: 14px; padding: 0 6px 6px; }
.ctp-side span { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 6px; }
.ctp-side i { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.ctp-main { display: flex; flex-direction: column; gap: 7px; padding: 12px; min-width: 0; }
.ctp-head { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; }
.ctp-head b { overflow: hidden; text-overflow: ellipsis; }
.ctp-btn { font-size: 11px; font-weight: 500; padding: 4px 9px; border-radius: 6px; white-space: nowrap; }
.ctp-card { display: flex; flex-direction: column; gap: 1px; padding: 7px 9px; border-radius: 8px; border: 1px solid; font-size: 11.5px; min-width: 0; }
.ctp-card span, .ctp-card small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctp-card small { font-size: 11px; }
@media (max-width: 760px) {
  .ct-wrap { grid-template-columns: minmax(0, 1fr); }
  .ct-prev-box { position: sticky; top: -1px; order: -1; z-index: 2; background: var(--card); padding-bottom: 8px; }
  .ct-prev-box > p { display: none; }
  .ct-prev { height: 150px; }
  .ct-try { margin-top: 8px; }
  .ct-top { grid-template-columns: minmax(0, 1fr); }
  .ct-tab { padding: 6px 7px; column-gap: 6px; }
  .ct-tdot { width: 16px; height: 16px; }
  .ct-tl { font-size: 12.5px; }
  .ct-tv { font-size: 11px; }
}

@media (max-width: 860px) {
  .set-tabs button { padding: 9px 11px; font-size: 13.5px; }
  .set-block { padding: 18px 16px 20px; }
  .theme-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .swatch { height: 56px; }
  .theme-add { min-height: 96px; }
  .ct-colours { gap: 2px; }
  .ct-col { padding: 6px 0 5px; }
  .ct-name { font-size: 11px; letter-spacing: -0.01em; }
}
@media (max-width: 600px) {
  /* Phones: three themes to a row, so each Light / Dark set is one row */
  .theme-choices { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .theme-choice { padding: 6px 6px 8px; font-size: 12.5px; gap: 6px; }
  .theme-choice .swatch { height: 48px; }
  .theme-choice em { display: block; }
  .thm-acts { gap: 10px; padding: 0 4px; font-size: 12.5px; }
  .theme-add { min-height: 84px; font-size: 12.5px; text-align: center; padding: 6px; }
}

/* ---------- Services reference ---------- */

.tabs {
  display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;
  border-bottom: 1px solid var(--border); margin-bottom: 18px;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  padding: 10px 12px; white-space: nowrap; text-decoration: none; color: var(--text-2); font-weight: 500; font-size: 14px;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs a:hover { color: var(--text); }
.tabs a.on { color: var(--text); border-bottom-color: var(--accent); }

.ref { display: grid; grid-template-columns: minmax(230px, 310px) minmax(0, 1fr); gap: 18px; align-items: start; }
/* Search across all services (1.4.42) */
.svc-search { margin: 0 0 12px; max-width: 560px; }
.svc-search input { width: 100%; }
.svc-found { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 12px 8px; font-size: 12.5px; font-weight: 600; color: var(--text-2); border-bottom: 1px solid var(--rule-soft); margin-bottom: 4px; }
.ref-item .svc-hit { color: var(--text); opacity: 0.85; }
.ref-list { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 6px; }
.ref-item { display: block; padding: 10px 12px; text-decoration: none; color: var(--text); border-radius: var(--radius); }
.ref-item + .ref-item { margin-top: 1px; }
.ref-item:hover { background: var(--hover); }
.ref-item.on { background: var(--surface); box-shadow: inset 3px 0 0 var(--accent); }
.ref-item .nm { display: block; font-weight: 500; }
.ref-item .mt { display: block; font-size: 12.5px; color: var(--text-2); margin-top: 1px; }

.ref-detail { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 22px 26px 26px; min-width: 0; scroll-margin-top: 70px; }
.ref-detail:empty { display: none; }
.rd-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.rd-head h2 { font-size: 20px; }
.rd-desc { margin: 8px 0 0; color: var(--text-2); max-width: 70ch; }
.rd-facts { margin: 18px 0 0; padding: 16px 0; border-top: 1px solid var(--rule-soft); border-bottom: 1px solid var(--rule-soft); }
.rd-note { margin: 10px 0 0; font-size: 13px; color: var(--text-2); }
.rd-docs { margin-top: 24px; }
.rd-docs-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.rd-docs h3 { font-size: 16px; }
.rd-docs h4 { margin: 18px 0 6px; font-size: 13px; font-weight: 600; color: var(--accent); }
.rd-foot { margin-top: 18px; }
.rd-ext { margin: 16px 0 0; }
.rd-ext ul.ext { margin: 0; padding-left: 18px; }

.doclist { margin: 0; padding: 0 0 0 24px; max-width: 72ch; }
.doclist li { padding: 8px 0 8px 4px; border-bottom: 1px solid var(--rule-soft); }
.doclist li::marker { color: var(--text-3); font-variant-numeric: tabular-nums; }
.doclist .note { display: block; font-size: 13px; color: var(--text-2); margin-top: 1px; }

@media (max-width: 860px) {
  .ref { grid-template-columns: minmax(0, 1fr); }
  .ref-detail { padding: 18px 16px 22px; }
}

/* Editors (documents, sections) */
.form-sub { margin: 8px 0 0; font-weight: 600; color: var(--text); font-size: 14px; border-top: 1px solid var(--rule-soft); padding-top: 16px; }
.doc-rows { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.doc-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto auto; gap: 6px; align-items: center; }
.sec-row { grid-template-columns: minmax(0, 1fr) auto auto; }
.doc-row input[type=text] { height: 34px; font-size: 14px; }
.doc-opt { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.doc-btns { display: inline-flex; gap: 2px; }
.doc-btns button {
  width: 30px; height: 30px; border: 1px solid var(--border); background: var(--card); color: var(--text-2);
  border-radius: 7px; cursor: pointer; line-height: 1;
}
.doc-btns button:hover { color: var(--text); background: var(--hover); }
@media (max-width: 600px) {
  .doc-row { grid-template-columns: minmax(0, 1fr) auto; }
  .doc-row [data-k=note] { grid-column: 1 / 2; }
  .sec-row { grid-template-columns: minmax(0, 1fr) auto auto; }
}

/* ---------- PDF / print layout for document lists ---------- */
#print-area { display: none; }
@media print {
  @page { size: A4; margin: 18mm 18mm 20mm; }
  body { background: #fff !important; }
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block; color: #1C2826; font-family: "Noto Sans", Arial, sans-serif; font-size: 11pt; line-height: 1.45; }
  #print-area .pa-break { break-before: page; }
  #print-area .pa-sec { margin: 0 0 4pt; font-size: 9.5pt; color: #5A6560; }
  #print-area h1 { font-family: "Noto Sans", Arial, sans-serif; font-weight: 600; font-size: 18pt; margin: 0; color: #1C2826; }
  #print-area .pa-rule { width: 36pt; height: 6pt; border-top: 1.2pt solid #A4532E; border-bottom: 1.2pt solid #A4532E; margin: 8pt 0 14pt; }
  #print-area h2 { font-family: "Noto Sans", Arial, sans-serif; font-size: 10.5pt; font-weight: 600; color: #A4532E; margin: 12pt 0 4pt; }
  #print-area ol { margin: 0; padding-left: 18pt; }
  #print-area li { padding: 3pt 0; border-bottom: 0.5pt solid #E3E5DE; break-inside: avoid; }
  #print-area li em { display: block; font-style: normal; font-size: 9.5pt; color: #5A6560; }
}
.role-help p { margin: 2px 0; }
.temp-pw { font-family: Consolas, "SFMono-Regular", Menlo, monospace; font-size: 18px; letter-spacing: 1px; font-weight: 600; }

/* ---------- Folder pane (Tasks, Clients, Team) ---------- */

.explorer {
  display: grid; grid-template-columns: 280px minmax(0, 1fr); align-items: start;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.folder-toggle { display: none; }
.folders {
  position: sticky; top: 0; max-height: 100vh; overflow-y: auto;
  border-right: 1px solid var(--rule-soft); padding: 14px 8px 20px 10px;
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}
.ff-find { padding: 0 2px 10px; }
.ff-find input { height: 34px; font-size: 13.5px; }

.ftree, .ftree ul { list-style: none; margin: 0; padding: 0; }
.frow { display: flex; align-items: center; padding-left: calc(var(--lvl) * 14px); border-radius: var(--radius); margin: 1px 0; }
.frow:hover { background: var(--hover); }
.frow.on { background: var(--surface); box-shadow: inset 3px 0 0 var(--accent); }
.tw, .tw-sp { flex: none; width: 22px; height: 32px; }
.tw { border: 0; background: transparent; cursor: pointer; color: var(--text-3); position: relative; padding: 0; }
.tw::before {
  content: ""; position: absolute; left: 9px; top: 12px;
  border-left: 5px solid currentColor; border-top: 4px solid transparent; border-bottom: 4px solid transparent;
  transition: transform 0.12s ease;
}
li[aria-expanded="true"] > .frow > .tw::before { transform: rotate(90deg); }
.tw:hover { color: var(--text); }
.fl {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px;
  border: 0; background: transparent; cursor: pointer; text-align: left;
  padding: 6px 10px 6px 2px; color: var(--text-2); font-size: 13.5px;
}
.fl .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.frow.has .fl { color: var(--text); font-weight: 600; }
.frow.on .fl { color: var(--text); }
li[aria-level="1"] > .frow .fl { font-size: 14px; font-weight: 600; color: var(--text); }
.cnt {
  flex: none; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 999px;
  display: inline-grid; place-items: center;
  background: var(--surface); font-size: 12px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums;
}
.frow.on .cnt { background: var(--card); }
.cnt.late { background: var(--accent-soft); color: var(--accent); }
.fempty { padding: 4px 0 6px 50px; font-size: 13px; color: var(--text-2); }

.xlist { min-width: 0; padding: 18px 20px 20px; }
.xlist .table-wrap { box-shadow: none; }
.xhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.crumbs { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; min-width: 0; color: var(--text-2); font-size: 13.5px; }
.crumbs h2 { font-size: 18px; color: var(--text); }
.crumbs .sep { color: var(--text-3); }

@media (max-width: 860px) {
  .explorer { grid-template-columns: minmax(0, 1fr); background: transparent; border: 0; box-shadow: none; }
  .folder-toggle {
    display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%;
    height: 44px; padding: 0 14px; border: 1px solid var(--border); border-radius: var(--radius-lg);
    background: var(--card); box-shadow: var(--shadow);
    color: var(--text); font-size: 14px; font-weight: 500; text-align: left; cursor: pointer;
  }
  .folder-toggle::before { content: "Folder"; color: var(--text-2); font-size: 12.5px; font-weight: 500; flex: none; }
  .folder-toggle::after {
    content: ""; flex: none; margin-left: auto;
    border-top: 5px solid var(--text-2); border-left: 4px solid transparent; border-right: 4px solid transparent;
  }
  .folders {
    display: none; position: static; max-height: 60vh; margin-top: 8px;
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  }
  .folders.show { display: block; }
  .xlist { padding: 16px 0 0; }
  .xlist .table-wrap { box-shadow: var(--shadow); }
}
/* Columns dropped on phones (Clients and Team lists) */
.show-sm { display: none; }
@media (max-width: 600px) {
  .hide-sm { display: none; }
  .show-sm { display: inline; }
  table.data th, table.data td { padding-left: 12px; padding-right: 12px; }
}

/* ---------- Recurring work ---------- */

label.field.check { flex-direction: row; align-items: center; gap: 10px; color: var(--text); font-size: 14px; font-weight: 400; }

.sub-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 16px 18px 12px; }
.sub-card + .sub-card { margin-top: 12px; }
.sub-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.sub-head h3 { font-size: 15.5px; margin: 0; }
.sub-head p { margin: 4px 0 0; }
.strip { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 4px 12px; align-items: center; margin: 12px 0 4px; }
.strip .sf { font-size: 13px; color: var(--text-2); font-weight: 500; }
.strip .cells { display: flex; flex-wrap: wrap; gap: 4px; }
.strip .ss { grid-column: 2; color: var(--text-2); }
.pc {
  display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 28px; padding: 0 4px;
  border: 1px solid var(--border); border-radius: 7px; font-size: 11.5px; font-weight: 500; color: var(--text-2);
}
.pc.done { background: var(--chart); border-color: var(--chart); color: #FFFFFF; }
.pc.pending { border: 1.5px solid var(--text); color: var(--text); }
.pc.late { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.pc.off { border-style: dashed; opacity: 0.45; }
.strip-key { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 10px 0 0; }
.strip-key .pc { min-width: 12px; width: 12px; height: 12px; padding: 0; border-radius: 3px; vertical-align: middle; }
@media (max-width: 600px) {
  .strip { grid-template-columns: minmax(0, 1fr); }
  .strip .ss { grid-column: 1; }
  .pc { min-width: 26px; height: 26px; font-size: 11px; }
  .sub-card { padding: 14px 14px 10px; }
}

details.upcoming { margin-top: 18px; }
details.upcoming summary { display: flex; align-items: baseline; gap: 12px; cursor: pointer; margin-bottom: 10px; list-style: none; }
details.upcoming summary::-webkit-details-marker { display: none; }
details.upcoming summary::before { content: ""; align-self: center; border-left: 6px solid var(--text-2); border-top: 4.5px solid transparent; border-bottom: 4.5px solid transparent; transition: transform .15s; }
details.upcoming[open] summary::before { transform: rotate(90deg); }
details.upcoming summary h2 { font-size: 17px; }

.group-list { list-style: none; margin: 0; padding: 0; }
.group-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--rule-soft); }
.group-list li.me { font-weight: 600; }

/* Packages page */
.pk-sec { font-size: 15px; margin: 26px 0 12px; color: var(--text-2); }
.pk-sec:first-of-type { margin-top: 4px; }
.pk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.pk-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 18px 20px; min-width: 0; }
.pk-card header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.pk-card h3 { margin: 0; font-size: 15.5px; }
.pk-card > p { margin: 6px 0 10px; }
.pk-card table.data td { vertical-align: top; }
.pk-card table.data td:first-child { min-width: 0; padding-left: 0; }
.pk-foot { margin: 10px 0 0; }
.pk-pick { max-height: 320px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius); padding: 4px 12px 10px; }
.pk-pick fieldset { border: 0; padding: 0; margin: 8px 0 0; }
.pk-pick legend { font-weight: 600; font-size: 13px; padding: 0; margin-bottom: 4px; }
.pk-pick label { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 14px; }
.pk-pick label[hidden] { display: none; }
@media (max-width: 600px) { .pk-grid { grid-template-columns: minmax(0, 1fr); } }

/* Dashboard: ready to bill */
.bill-list { list-style: none; margin: 8px 0 0; padding: 0; }
.bill-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--rule-soft); }
.bill-list a { color: var(--text); text-decoration: none; min-width: 0; }
.bill-list a .t { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.bill-list .sub { display: block; color: var(--text-2); font-size: 12.5px; }
.bill-list .num { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Settings: About ---------- */
.about-ver { display: flex; flex-wrap: wrap; gap: 14px 40px; padding: 14px 16px; background: var(--surface); border-radius: var(--radius); }
.about-ver div { display: flex; flex-direction: column; gap: 2px; }
.about-ver b { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.about-list { margin: 0; padding-left: 20px; }
.about-list li { margin: 4px 0; }
.about-old { margin-top: 14px; }
.about-old summary { cursor: pointer; color: var(--text-2); font-size: 14px; font-weight: 500; }
.about-old h4 { margin: 14px 0 4px; font-size: 14.5px; }
.about-db { list-style: none; margin: 0; padding: 0; }
.about-db li { padding: 8px 0; border-top: 1px solid var(--rule-soft); }
.about-db .mk { display: inline-block; width: 18px; font-weight: 600; color: var(--chart); }
.about-db li.no .mk { color: var(--accent); }

/* ---------- Calendar ---------- */

.cal-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-nav h2 { min-width: 120px; text-align: center; font-size: 18px; }
.cal-nav .btn[data-step] { width: 32px; padding: 0; font-size: 18px; }
.cal-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.cal-filters select { width: auto; min-width: 150px; height: 34px; font-size: 13.5px; }

.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.cal-month { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-head span { padding: 10px 10px 8px; font-size: 12px; font-weight: 600; color: var(--text-2); background: var(--surface); border-bottom: 1px solid var(--border); }
.cal-day {
  position: relative; display: flex; flex-direction: column; gap: 4px; align-items: stretch; text-align: left;
  min-height: 112px; padding: 8px 8px 8px; min-width: 0;
  background: var(--card); color: var(--text); border: 0; border-right: 1px solid var(--rule-soft); border-bottom: 1px solid var(--rule-soft);
  cursor: pointer; font: inherit;
}
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day:hover { background: var(--hover); }
.cal-day.out { background: var(--surface); }
.cal-day.out .cal-dn { color: var(--text-3); }
.cal-day.late { background: var(--accent-soft); }
.cal-day.sel { box-shadow: inset 0 0 0 2px var(--btn-bg); z-index: 1; }
.cal-dn { display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 600; }
.cal-day.today .cal-dn { color: var(--accent); }
.cal-day.today .cal-dn::before { content: "Today"; order: 2; margin-left: auto; margin-right: 6px; font-size: 11px; font-weight: 600; color: var(--accent); }
.cal-n { order: 3; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center; background: var(--surface); font-size: 11.5px; }
.cal-n.late { background: var(--accent); color: var(--bg); }
.cal-ok { order: 3; font-size: 12px; color: var(--chart); }
.cal-chips { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-chip {
  display: block; padding: 2px 6px; border-radius: 5px; font-size: 11.5px; line-height: 1.35;
  background: var(--surface); color: var(--text); overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  border-left: 3px solid var(--text-2);
}
.cal-chip em { display: none; }
.cal-chip.up { background: transparent; border: 1px dashed var(--border); border-left: 3px dashed var(--text-3); color: var(--text-2); }
.cal-chip.late { border-left-color: var(--accent); }
.cal-more { font-size: 11px; color: var(--text-2); padding-left: 4px; }
.cal-dots { display: none; }
.cal-key { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 10px 14px; margin: 0; border-top: 1px solid var(--rule-soft); }
.cal-key span { display: inline-flex; align-items: center; gap: 6px; }
.cal-key i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.cal-key .k-late { background: var(--accent); }
.cal-key .k-pend { background: var(--text-2); }
.cal-key .k-up { border: 1px dashed var(--text-3); }

.cal-side { position: sticky; top: 16px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 18px 18px 14px; max-height: calc(100vh - 32px); overflow-y: auto; scroll-margin-top: 60px; }
.cs-head { padding-bottom: 12px; border-bottom: 1px solid var(--rule-soft); }
.cs-rel { font-size: 12px; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: 0.06em; }
.cs-head h2 { font-size: 20px; margin-top: 2px; }
.cs-head p { margin: 2px 0 0; }
.cs-sub { display: flex; justify-content: space-between; margin: 16px 0 6px; font-size: 13px; color: var(--text-2); }
.cs-sub.late { color: var(--accent); }
.cs-sub span, .cs-done summary span { font-variant-numeric: tabular-nums; }
.cs-empty { margin: 16px 0 6px; }
.cal-list { list-style: none; margin: 0; padding: 0; }
.cal-task { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 10px 8px; margin: 0 -8px; border-radius: var(--radius); cursor: pointer; }
.cal-task + .cal-task { border-top: 1px solid var(--rule-soft); }
.cal-task:hover { background: var(--hover); }
.ct-main { min-width: 0; }
.ct-main .t { display: block; font-weight: 500; font-size: 14px; }
.ct-main .c { display: block; font-size: 12.5px; color: var(--text-2); }
.ct-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.cs-done { margin-top: 14px; }
.cs-done summary { display: flex; justify-content: space-between; cursor: pointer; font-size: 13px; color: var(--text-2); font-weight: 600; padding: 4px 0; }

@media (max-width: 1000px) {
  .cal-layout { grid-template-columns: minmax(0, 1fr); }
  .cal-side { position: static; max-height: none; }
}
@media (max-width: 600px) {
  .cal-bar { flex-direction: column; align-items: stretch; }
  .cal-nav { justify-content: space-between; }
  .cal-filters select { flex: 1 1 140px; }
  .cal-head span { padding: 8px 0; text-align: center; font-size: 11px; }
  .cal-day { min-height: 58px; padding: 6px 4px; align-items: center; gap: 5px; }
  .cal-dn { justify-content: center; font-size: 13px; }
  .cal-day.today .cal-dn::before { display: none; }
  .cal-day.today .cal-dn { width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); }
  .cal-n, .cal-ok { display: none; }
  .cal-chips { display: none; }
  .cal-dots { display: flex; gap: 3px; justify-content: center; flex-wrap: wrap; }
  .cal-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-2); }
  .cal-dots i.late { background: var(--accent); }
  .cal-dots i.up { background: transparent; box-shadow: inset 0 0 0 1px var(--text-3); }
  .cal-side { padding: 16px 14px 10px; }
}

/* ---------- Data: imports, backup ---------- */
.notice.remind { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; background: var(--accent-soft); border-color: transparent; }
.imp-steps { margin: 0 0 16px; padding-left: 20px; }
.imp-steps li { margin-bottom: 14px; }
.imp-steps input[type=file] { font-size: 13.5px; }
.imp-sum { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 10px; }
.imp-sum span { padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--surface); }
.imp-sum .ok { color: var(--chart); }
.imp-sum .bad { color: var(--accent); background: var(--accent-soft); }
.imp-table { max-height: 46vh; overflow: auto; }
.imp-table table.data.compact td:first-child, .imp-table table.data.compact th:first-child { min-width: 0; padding-left: 12px; }
.imp-table tr.imp-bad td { background: var(--accent-soft); }
.imp-ok { color: var(--chart); font-weight: 600; }
.rs-guard { margin-top: 16px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.rs-table td:first-child, .rs-table th:first-child { padding-left: 12px !important; }
input[type=file] { max-width: 100%; }
.btn svg { flex: none; }
@media (max-width: 600px) { .page-head .btn-row .btn span { display: none; } .page-head .btn-row .btn svg + span { display: none; } }
.rs-table td:last-child, .rs-table th:last-child { padding-right: 12px !important; }
input[type=file] { font-size: 13.5px; color: var(--text-2); }
input[type=file]::file-selector-button {
  height: 34px; padding: 0 14px; margin-right: 10px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--card); color: var(--text); font: inherit; font-weight: 500; cursor: pointer;
}
input[type=file]::file-selector-button:hover { background: var(--hover); }

/* ---------- Search everything (1.4.4) ---------- */
.side-search {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; margin: 0 0 14px; padding: 0 10px 0 12px;
  border: 1px solid var(--side-line); border-radius: var(--radius); background: transparent;
  color: var(--side-muted); font: inherit; font-size: 13.5px; cursor: pointer; text-align: left;
}
.side-search:hover { color: var(--side-text); background: var(--side-raise); }
.side-search:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.side-search svg { width: 16px; height: 16px; flex: none; color: var(--side-icon, currentColor); }
.side-search span { flex: 1; }
.side-search kbd, .sq-x {
  font: inherit; font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 5px;
  border: 1px solid var(--side-line); color: var(--side-muted); background: transparent;
}

dialog.search-dlg {
  width: min(640px, calc(100vw - 24px)); margin: 10vh auto auto; max-height: 76vh;
  display: none; flex-direction: column; overflow: hidden;
}
dialog.search-dlg[open] { display: flex; }
.sq { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--rule-soft); }
.sq svg { width: 20px; height: 20px; color: var(--text-2); flex: none; }
.sq input { flex: 1; min-width: 0; border: 0; box-shadow: none; background: transparent; height: 36px; padding: 0; font-size: 16px; }
.sq input:focus { outline: none; box-shadow: none; }
.sq-x { cursor: pointer; border-color: var(--border); color: var(--text-2); }
.sr { overflow-y: auto; padding: 6px 8px 10px; }
.sr-tip { padding: 14px 10px; margin: 0; }
.sr-h { padding: 10px 10px 4px; font-size: 11.5px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-2); }
.sr-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
  padding: 8px 10px; border: 0; border-radius: var(--radius); background: transparent; color: var(--text);
  font: inherit; text-align: left; cursor: pointer;
}
.sr-item.on { background: var(--surface); box-shadow: inset 3px 0 0 var(--accent); }
.sr-main { min-width: 0; display: flex; flex-direction: column; }
.sr-l { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-s { font-size: 12.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-item .st { flex: none; }
@media (max-width: 600px) { dialog.search-dlg { margin-top: 12px; max-height: calc(100vh - 24px); } .sr-item .st { display: none; } }

/* ---------- Dashboard: office closed ---------- */
.md-hols { list-style: none; margin: 8px 0 10px; padding: 0; }
.md-hols li { display: flex; gap: 10px; padding: 7px 0; border-top: 1px solid var(--rule-soft); font-size: 14px; }
.md-hols li:first-child { border-top: 0; }
.md-hols b { flex: none; min-width: 74px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Select many tasks ---------- */
table.data th.pick, table.data td.pick { width: 34px; padding-right: 0; }
table.data td.pick { cursor: default; }
table.data .pick input { width: 17px; height: 17px; margin: 1px 0 0; accent-color: var(--btn-bg); cursor: pointer; }
table.data tr.picked td { background: var(--accent-soft); }
.bulk-bar {
  position: sticky; top: 8px; z-index: 5; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 0 0 12px; padding: 10px 14px; border-radius: var(--radius-lg);
  background: var(--btn-bg); color: var(--btn-text); box-shadow: var(--shadow-lg);
}
.bulk-bar b { margin-right: auto; font-weight: 600; }
.bulk-bar .btn { background: var(--btn-text); color: var(--btn-bg); }
.bulk-bar .btn.secondary { background: color-mix(in srgb, var(--btn-text) 14%, transparent); color: var(--btn-text); }
.bulk-bar .link-btn { color: var(--btn-text); opacity: 0.85; }
@media (max-width: 860px) { .bulk-bar { top: 58px; } }
@media (max-width: 600px) { .bulk-bar b { flex-basis: 100%; } }

/* ---------- Client groups ---------- */
.grp-pick { max-height: 300px; overflow-y: auto; margin-top: 8px; border: 1px solid var(--border); border-radius: var(--radius); padding: 4px 0; background: var(--card); }
.grp-row { display: flex; align-items: flex-start; gap: 10px; padding: 7px 12px; cursor: pointer; font-size: 14px; color: var(--text); }
.grp-row:hover { background: var(--hover); }
.grp-row input { width: 16px; height: 16px; margin-top: 2px; flex: none; accent-color: var(--btn-bg); }
.grp-row[hidden] { display: none; }
.grp-mates { margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.grp-mates .grp-all { margin-left: auto; }

/* ---------- Office holidays ---------- */
.hol-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin: 0 0 18px; }
.hol-form .field { flex: 0 1 170px; }
.hol-form .hol-name { flex: 1 1 220px; }
.hol-list { list-style: none; margin: 0; padding: 0; }
.hol-list li { display: flex; gap: 14px; align-items: baseline; padding: 9px 0; border-top: 1px solid var(--rule-soft); }
.hol-list .hd { flex: none; min-width: 150px; font-weight: 600; font-variant-numeric: tabular-nums; }
.hol-list .hn { flex: 1; min-width: 0; }
@media (max-width: 600px) { .hol-list li { flex-wrap: wrap; gap: 2px 12px; } .hol-list .hd { min-width: 0; } .hol-form .field { flex: 1 1 140px; } }
.cal-hol { display: block; padding: 2px 6px; border-radius: 5px; font-size: 11.5px; line-height: 1.35; font-weight: 600; color: var(--accent); background: var(--accent-soft); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cal-day.hol:not(.late) { background: repeating-linear-gradient(135deg, var(--card) 0 7px, var(--surface) 7px 8px); }
.cal-day.hol:not(.late):hover { background: var(--hover); }
.cal-key .k-hol { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.cs-hol { margin: 6px 0 2px; font-size: 13px; font-weight: 600; color: var(--accent); }
.ledger-date .closed { margin-top: 4px; font-size: 11px; font-weight: 600; color: var(--accent); line-height: 1.2; }
@media (max-width: 600px) { .cal-day.hol .cal-dn { text-decoration: underline wavy var(--accent); text-underline-offset: 3px; } }
.sq input::-webkit-search-cancel-button { display: none; }

/* ---------- Team → Holidays (1.4.5) ---------- */
.hy-nav { display: inline-flex; align-items: center; gap: 8px; }
.hy-nav b { min-width: 48px; text-align: center; font-size: 17px; font-variant-numeric: tabular-nums; }
.hy-nav .btn { width: 32px; padding: 0; font-size: 18px; }
.hy-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.hy-months { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px 24px; }
.hy-name { font-weight: 600; font-size: 14px; padding-bottom: 6px; margin-bottom: 6px; border-bottom: 1px solid var(--rule-soft); }
.hy-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; text-align: center; font-size: 12px; font-variant-numeric: tabular-nums; }
.hy-w { font-size: 11px; font-weight: 600; color: var(--text-2); padding-bottom: 2px; }
.hy-w:first-child { color: var(--accent); }
.hy-c { height: 24px; display: grid; place-items: center; border-radius: 6px; color: var(--text); }
.hy-c.out { visibility: hidden; }
.hy-c.sun { background: var(--surface); color: var(--text-2); }
.hy-c.hol { background: var(--accent); color: var(--card); font-weight: 600; cursor: help; }
.hy-c.today { box-shadow: inset 0 0 0 1.5px var(--text); }
.hy-key { display: flex; gap: 18px; margin: 18px 0 0; padding-top: 12px; border-top: 1px solid var(--rule-soft); }
.hy-key span { display: inline-flex; align-items: center; gap: 6px; }
.hy-key i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.hy-key .k-hol { background: var(--accent); }
.hy-key .k-sun { background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); }
.hy-side { position: sticky; top: 16px; }
.hy-side h2 { font-size: 15.5px; margin-bottom: 8px; }
.hy-side .hol-list li:first-child { border-top: 0; }
.hy-side .hol-list .hd { min-width: 96px; }
.hol-list li.past { opacity: 0.6; }
@media (max-width: 1200px) { .hy-months { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1000px) { .hy-layout { grid-template-columns: minmax(0, 1fr); } .hy-side { position: static; } }
@media (max-width: 600px) {
  .hy-months { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 14px; }
  .hy-c { height: 21px; font-size: 11px; }
  .hy-year.panel { padding: 14px 12px; }
}
.hy-layout > .panel + .panel { margin-top: 0; }
@media (max-width: 1000px) { .hy-side { order: -1; } }

/* Settings → Holidays */
.hol-import { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: -4px 0 6px; }

/* ---------- Tasks: status drop-down, quick time, people (1.4.9) ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.st-select {
  width: auto; height: 28px; padding: 0 26px 0 22px; border-radius: 999px; font-size: 12.5px; font-weight: 500;
  border: 1px solid transparent; background-color: var(--surface); color: var(--text); cursor: pointer;
  background-image: radial-gradient(circle at 11px 50%, var(--dot, var(--dot-none)) 3.5px, transparent 4px), var(--chev);
  background-repeat: no-repeat; background-position: 0 0, right 8px center; background-size: auto, 10px;
}
.st-select:hover { border-color: var(--border); }
.st-select:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.st-select.not_started { --dot: var(--dot-none); color: var(--text-2); }
.st-select.awaiting_client, .st-select.client_review, .st-select.tax_payment { --dot: var(--dot-wait); }
.st-select.in_progress { --dot: var(--dot-prog); }
.st-select.under_review { --dot: var(--dot-review); }
.st-select.completed { --dot: var(--dot-done); }
.st-select.pending_invoice { --dot: var(--dot-done); }
.st-select.payment_due { --dot: var(--dot-wait); }
.st-select.cancelled { --dot: var(--dot-none); color: var(--text-2); }
.st-select:disabled { opacity: 0.6; }
table.data td.st-cell { cursor: default; }
table.data td.tl-col, table.data th.tl-col { width: 40px; padding-left: 0; padding-right: 10px; text-align: right; }
.tl-btn {
  width: 32px; height: 30px; display: inline-grid; place-items: center; border: 1px solid transparent; border-radius: var(--radius);
  background: transparent; color: var(--text-2); cursor: pointer;
}
.tl-btn:hover { background: var(--surface); color: var(--text); border-color: var(--border); }
.more-people { display: inline-block; padding: 0 6px; border-radius: 999px; background: var(--surface); font-size: 11.5px; font-weight: 600; color: var(--text-2); }
.st-quick { margin: 0 0 14px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.st-quick::-webkit-scrollbar { display: none; }
.st-quick button { flex: none; white-space: nowrap; }
.tl-box { margin-top: 12px; }
.tl-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tl-chip {
  height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--card);
  color: var(--text); font: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer; font-variant-numeric: tabular-nums;
}
.tl-chip:hover { border-color: var(--text-3); background: var(--hover); }
.tl-chip:active { transform: translateY(1px); }
.tl-chip:disabled { opacity: 0.5; }
.tl-more { margin-top: 12px; }
.tl-more summary { cursor: pointer; font-size: 13px; color: var(--text-2); }
.tl-form { margin-top: 10px; }
.tl-form .tl-n { flex: 0 1 80px; }
.tl-form .tl-note { flex: 1 1 180px; }
.tl-for { margin: 0 0 4px; display: flex; flex-direction: column; gap: 2px; }
dialog.narrow { width: min(520px, calc(100vw - 24px)); }
.people-pick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pp { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px 5px 8px; border: 1px solid var(--border); border-radius: 999px; font-size: 13px; color: var(--text); cursor: pointer; background: var(--card); }
.pp input { width: 15px; height: 15px; margin: 0; accent-color: var(--btn-bg); }
.pp:has(input:checked) { border-color: var(--text-3); background: var(--surface); }
.pp:has(input:disabled) { opacity: 0.45; cursor: default; }
.next-code { display: flex; align-items: center; height: var(--ctl-h); font-size: 16px; font-variant-numeric: tabular-nums; }

/* ---------- Tab strips with scroll buttons (1.4.9) ---------- */
.tab-scroll { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; min-width: 0; }
.tab-scroll > .tabs, .tab-scroll > .set-tabs { flex: 1; min-width: 0; border-bottom: 0; margin-bottom: 0; position: relative; }
.ts-btn {
  display: none; flex: none; width: 30px; height: 30px; place-items: center; border-radius: 50%;
  border: 1px solid var(--border); background: var(--card); color: var(--text); font-size: 18px; line-height: 1; cursor: pointer; box-shadow: var(--shadow);
}
.tab-scroll.overflow .ts-btn { display: grid; }
.ts-btn:hover:not(:disabled) { background: var(--hover); border-color: var(--text-3); }
.ts-btn:disabled { opacity: 0.35; cursor: default; box-shadow: none; }
@media (max-width: 600px) {
  #task-table .st-select { max-width: 104px; height: 26px; font-size: 12px; padding: 0 20px 0 19px; background-position: 0 0, right 6px center; }
  #task-table td.tl-col { width: 30px; padding-right: 6px; }
  #task-table .tl-btn { width: 28px; }
}

/* ---------- Time: log from–to, Team → Time logs and Daily timelog (1.4.10) ---------- */
.tl2 { display: grid; gap: 12px; }
.tl2-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.tl2-dur { margin: -4px 0 0; font-size: 13.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.tl2-dur.bad { color: var(--accent); }
.tl2 textarea { resize: vertical; }
.tl2-count { display: block; margin-top: 4px; font-size: 12px; }
.tl2-day p { margin: 0 0 4px; }
.tl2-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: 13px; }
.tl2-list li { display: flex; gap: 10px; min-width: 0; }
.tl2-list .num { flex: none; color: var(--text-2); font-variant-numeric: tabular-nums; }
.tl2-list span + span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl2 .notice.err { margin: 0; }
@media (max-width: 480px) { .tl2-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .tl2-row .tl2-date { grid-column: 1 / -1; } }

.tally.stats .stat { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 16px 18px; min-width: 0; }
.tally.stats .stat small { font-size: 15px; font-weight: 500; color: var(--text-2); }
.tally.stats .total { background: var(--btn-bg); border-color: var(--btn-bg); }
.tally.stats .total .n, .tally.stats .total .l { color: var(--btn-text); }
.tally.stats .total .l { opacity: 0.75; }
@media (max-width: 600px) { .tally.stats .stat { padding: 13px 14px; } }
.num { font-variant-numeric: tabular-nums; }
.panel h2 { margin-top: 0; }
.panel + .two-col, .two-col + .panel { margin-top: 16px; }
.two-col.tlg-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.two-col.tlg-split .panel + .panel { margin-top: 0; }
@media (max-width: 860px) { .two-col.tlg-split { grid-template-columns: minmax(0, 1fr); } .two-col.tlg-split .panel + .panel { margin-top: 0; } }

/* By day: one column per day */
.tlg-days { display: flex; gap: 6px; align-items: stretch; height: 190px; }
.tlg-days.many { gap: 2px; }
.tlg-day { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; border-radius: 6px; padding: 2px 0; }
.tlg-day.off { background: var(--surface); }
.tlg-day .v { height: 16px; font-size: 11.5px; color: var(--text-2); white-space: nowrap; }
.tlg-day .b { flex: 1; width: 100%; max-width: 38px; display: flex; align-items: flex-end; }
.tlg-day .b i { display: block; width: 100%; min-height: 0; background: var(--chart); border-radius: 4px 4px 1px 1px; }
.tlg-day.today .b i { background: var(--accent); }
.tlg-day .d { display: flex; flex-direction: column; align-items: center; line-height: 1.15; font-size: 12px; }
.tlg-day .d b { font-weight: 600; font-variant-numeric: tabular-nums; }
.tlg-day .d small { color: var(--text-3); font-size: 11px; }
.tlg-days.many .v { font-size: 0; }
.tlg-days.many .d small { display: none; }
.tlg-days.many .tlg-day:nth-child(even) .d b { visibility: hidden; }
@media (max-width: 600px) {
  .tlg-days { gap: 3px; height: 160px; }
  .tlg-days .v { font-size: 11px; }
  .tlg-days.many { gap: 1px; }
  .tlg-days.many .d b { font-size: 11px; }
}

/* Horizontal bars (by person, work, client) */
.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.hb { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "l v" "t t"; gap: 4px 12px; align-items: baseline; }
.hb-l { grid-area: l; min-width: 0; display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; overflow-wrap: anywhere; }
.hb-l .link-btn { font-weight: 600; }
.hb-v { grid-area: v; font-size: 13.5px; white-space: nowrap; }
.hb-t { grid-area: t; height: 8px; background: var(--surface); border-radius: 999px; overflow: hidden; }
.hb-t i { display: block; height: 100%; background: var(--chart); border-radius: 999px; }

/* Entries */
.tle-list { list-style: none; margin: 0; padding: 0; }
.tle { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 4px 16px; padding: 11px 6px; border-top: 1px solid var(--rule-soft); align-items: start; border-radius: 6px; }
.tle:first-child { border-top: 0; }
.tle[data-task] { cursor: pointer; }
.tle[data-task]:hover, .tle[data-task]:focus-visible { background: var(--hover); }
.tle-when { display: flex; flex-direction: column; font-size: 13px; }
.tle-when b { font-weight: 600; }
.tle-when .num { color: var(--text-2); }
.tle-what { min-width: 0; }
.tle-what .t { font-weight: 500; }
.tle-what .c { font-size: 13px; }
.tle-what .n { font-size: 13.5px; margin-top: 3px; color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.tle-dur { font-size: 13.5px; white-space: nowrap; font-weight: 500; }
.tle.gone .tle-what .t { color: var(--text-3); }
@media (max-width: 600px) {
  .tle { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "w d" "x x"; }
  .tle-when { grid-area: w; flex-direction: row; gap: 8px; flex-wrap: wrap; }
  .tle-dur { grid-area: d; }
  .tle-what { grid-area: x; }
}

/* Daily timelog: a row per person, bars from–to */
#dl-date { width: auto; height: 32px; }
.dl-panel { padding: 14px 0 14px; }
.dl-panel > p { padding: 0 20px; }
.dl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.dl-chart { min-width: 760px; padding: 0 20px 0 0; }
.dl-row { display: grid; grid-template-columns: 170px minmax(0, 1fr); align-items: stretch; border-top: 1px solid var(--rule-soft); }
.dl-row.dl-axis { border-top: 0; height: 26px; }
.dl-name { position: sticky; left: 0; z-index: 2; background: var(--card); padding: 10px 12px 10px 20px; display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.dl-name b { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-row.none .dl-name b { color: var(--text-2); font-weight: 500; }
.dl-track { position: relative; min-height: 50px;
  background-image: linear-gradient(to right, var(--rule-soft) 1px, transparent 1px);
  background-size: calc(100% / var(--cols)) 100%; border-right: 1px solid var(--rule-soft); }
.dl-axis .dl-track { min-height: 0; background: none; border-right: 0; }
.dl-axis .dl-track span { position: absolute; top: 4px; transform: translateX(-50%); font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
.dl-axis .dl-track span:first-child { transform: none; }
.dl-axis .dl-track span:last-child { transform: translateX(-100%); }
.dl-bar {
  position: absolute; top: 9px; bottom: 9px; min-width: 4px; padding: 0 7px; overflow: hidden;
  border: 1px solid var(--chart); border-radius: 6px; background: color-mix(in srgb, var(--chart) 26%, var(--card));
  color: var(--text); font: inherit; font-size: 12px; font-weight: 500; text-align: left; cursor: pointer;
}
.dl-bar span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-bar:hover, .dl-bar:focus-visible { background: color-mix(in srgb, var(--chart) 42%, var(--card)); z-index: 1; }
.dl-now { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--accent); opacity: 0.8; }
@media (max-width: 600px) {
  .dl-row { grid-template-columns: 112px minmax(0, 1fr); }
  .dl-name { padding: 8px 8px 8px 14px; }
  .dl-name b { font-size: 13px; }
  .dl-chart { min-width: 680px; }
  .dl-panel > p { padding: 0 14px; }
}

/* ---------- Task window and time log window (1.4.11) ---------- */
dialog .d-title { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
dialog .d-kicker { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13.5px; min-width: 0; }
dialog .d-kicker .code {
  font-size: 12px; font-weight: 600; letter-spacing: 0.03em; font-variant-numeric: tabular-nums;
  padding: 2px 8px; border-radius: 6px; background: var(--surface); border: 1px solid var(--border); color: var(--text);
}
dialog .d-kicker a { color: var(--text-2); font-weight: 500; text-decoration: none; overflow-wrap: anywhere; }
dialog .d-kicker a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
dialog .d-title h2 { font-size: 19px; line-height: 1.3; letter-spacing: -0.01em; overflow-wrap: anywhere; }
dialog.tk-drawer .d-head { align-items: flex-start; padding: 20px 24px 18px; }
dialog.tk-drawer .d-body { padding: 20px 24px 28px; }

/* Key facts: status, due, priority */
.tk-key {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 0.8fr); gap: 4px 18px;
  padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface);
}
.tk-k { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.tk-k .l, .tk-tm .l, .tlw-tile .l { font-size: 11.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-2); }
.tk-k .v { font-size: 15px; font-weight: 500; min-height: 34px; display: flex; align-items: center; }
.tk-k .s { font-size: 12.5px; margin-top: -4px; }
.st-select.tk-st { height: 34px; font-size: 14px; padding: 0 30px 0 26px; background-color: var(--card); border-color: var(--border); max-width: 100%;
  background-image: radial-gradient(circle at 13px 50%, var(--dot, var(--dot-none)) 4px, transparent 4.5px), var(--chev); }
.prio { font-size: 14px; }
.prio.high, .prio.urgent { color: var(--accent); font-weight: 600; }
.prio.low { color: var(--text-2); }
.tk-note { margin: 14px 0 0; }

/* Sections */
.tk-sec { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--rule-soft); }
.tk-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; min-height: 32px; }
.tk-sec-head h3, .tlw-sec-head h3 { font-size: 12px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-2); margin: 0; }
.tk-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 24px; margin: 0; }
.tk-facts dt { font-size: 12.5px; color: var(--text-2); }
.tk-facts dd { margin: 2px 0 0; font-size: 14.5px; overflow-wrap: anywhere; }
.tk-notes { margin: 0; white-space: pre-wrap; font-size: 14.5px; line-height: 1.55; }

/* Time: estimated against actual */
.tk-time { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tk-tm { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
.tk-tm .v { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.tk-tm .v .muted { font-size: 15px; font-weight: 500; }
.tk-tm .s { font-size: 12px; color: var(--text-2); }
.tk-tm .link-btn { align-self: flex-start; margin-top: 2px; }
.tk-tm.over .v { color: var(--accent); }
.tk-est-form { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.tk-est-form input { width: 84px; height: 32px; }
.tk-bar { display: block; height: 6px; margin-top: 12px; border-radius: 999px; background: var(--surface); overflow: hidden; }
.tk-bar i { display: block; height: 100%; border-radius: 999px; background: var(--chart); }
.tk-bar.over i { background: var(--accent); }
.tk-time-foot { margin: 10px 0 0; }
.tk-sec .btn.small svg { width: 15px; height: 15px; }
.tk-sec .btn.small { gap: 6px; }

/* Comments */
.tk-drawer .thread { margin: 0 0 12px; }
.tk-drawer .thread .msg { border: 1px solid var(--rule-soft); }
.tk-drawer .thread .msg .meta { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.tk-drawer .thread .msg .meta b { color: var(--text); font-weight: 600; }
.tk-comment { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.tk-comment textarea { min-height: 64px; }
@media (max-width: 600px) {
  dialog.tk-drawer .d-head, dialog.tk-drawer .d-body { padding-left: 16px; padding-right: 16px; }
  .tk-key { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 12px 14px; }
  .tk-k-status { grid-column: 1 / -1; }
  .tk-time { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .tk-time .tk-tm:first-child:nth-last-child(3) { grid-column: 1 / -1; }
  .tk-facts { gap: 12px 16px; }
}

/* Time log window */
dialog.tlw { width: min(680px, calc(100vw - 24px)); }
dialog.tlw .d-head { align-items: flex-start; }
.tlw-tiles { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 0.8fr) minmax(0, 0.8fr) minmax(0, 1.3fr); gap: 10px; }
.tlw-tile { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card); }
.tlw-tile.main { background: var(--surface); }
.tlw-tile .v { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
.tlw-tile .v.sm { font-size: 15px; line-height: 1.35; }
.tlw-tile .s { font-size: 12.5px; color: var(--text-2); overflow-wrap: anywhere; }
.tlw-tile .tk-bar { margin-top: 6px; background: var(--card); }
.tlw-people { margin-top: 14px; }
.tlw-sec { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--rule-soft); }
.tlw-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.tlw-add.editing { border-radius: var(--radius-lg); }
.tlw-add.editing { background: var(--accent-soft); border-top-color: transparent; padding: 14px 14px 12px; margin-top: 18px; }
.tl2-actions { justify-content: flex-end; align-items: center; }
.tl2-actions .danger-link { margin-right: auto; }
.danger-link { color: var(--accent); }
.tlw-list { list-style: none; margin: 0; padding: 0; }
.tlw-e { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 12px; padding: 12px 0; border-top: 1px solid var(--rule-soft); align-items: start; }
.tlw-e:first-child { border-top: 0; padding-top: 4px; }
.tlw-e.editing { opacity: 0.55; }
.av {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--surface); border: 1px solid var(--border); font-size: 11.5px; font-weight: 600; letter-spacing: 0.02em; color: var(--text);
}
.tlw-e-main { min-width: 0; }
.tlw-e-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.tlw-e-top b { font-weight: 600; font-size: 14px; }
.tlw-e-top .dur { font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.tlw-e-when { font-size: 12.5px; margin-top: 1px; }
.tlw-e-main p { margin: 5px 0 0; font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.tlw-e-act { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; padding-top: 1px; min-width: 30px; }
.tlw-none { padding: 10px 0; font-size: 14px; }
@media (max-width: 600px) {
  .tlw-tiles { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .tlw-tile.main, .tlw-tile.wide { grid-column: 1 / -1; }
  .tlw-tile .v { font-size: 19px; }
  .tlw-e { grid-template-columns: 28px minmax(0, 1fr); gap: 10px; }
  .tlw-e .av { width: 28px; height: 28px; font-size: 11px; }
  .tlw-e-act { grid-column: 2; flex-direction: row; justify-content: flex-start; padding: 0; }
}

/* Tasks: Status folders */
.st-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--dot, var(--dot-none)); margin-right: 2px; }
.st-dot.awaiting_client, .st-dot.client_review, .st-dot.tax_payment { --dot: var(--dot-wait); }
.st-dot.in_progress { --dot: var(--dot-prog); }
.st-dot.under_review { background: transparent; box-shadow: inset 0 0 0 1.5px var(--dot-review); }
.st-dot.completed { --dot: var(--dot-done); }
.st-dot.pending_invoice { background: linear-gradient(90deg, var(--dot-done) 50%, transparent 50%); box-shadow: inset 0 0 0 1.5px var(--dot-done); }
.st-dot.payment_due { background: var(--dot-done); box-shadow: 0 0 0 1.5px var(--card), 0 0 0 3px var(--dot-wait); }
.st-dot.upcoming { background: transparent; box-shadow: inset 0 0 0 1.5px var(--dot-none); }
.cnt.quiet { background: transparent; color: var(--text-3); font-weight: 500; }

/* Daily timelog: role headings */
.dl-row.dl-group { border-top: 1px solid var(--border); background: var(--surface); }
.dl-row.dl-group .dl-name { grid-column: 1 / -1; background: var(--surface); padding-top: 7px; padding-bottom: 7px; flex-direction: row; align-items: baseline; justify-content: flex-start; gap: 12px; white-space: nowrap; }
.dl-row.dl-group .dl-name b { font-size: 11.5px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-2); }
.dl-row.dl-group .dl-track { min-height: 0; background: none; border-right: 0; }
dialog .d-title h2:focus { outline: none; }
dialog.tlw[open] { display: flex; flex-direction: column; max-height: calc(100vh - 32px); }
dialog.tlw .d-body { flex: 1; min-height: 0; max-height: none; }

/* ---------- Delete client / recurring work (1.4.12) ---------- */
.del-list { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: 14px; }
.del-choice { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px 12px; margin: 0; display: grid; gap: 8px; }
.del-choice legend { font-size: 13px; font-weight: 600; color: var(--text-2); padding: 0 4px; }
.del-choice label { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.del-choice input { width: 16px; height: 16px; margin: 0; accent-color: var(--btn-bg); }
dialog .d-foot .btn.danger:disabled { opacity: 0.45; cursor: default; }
@media (max-width: 600px) { .page-head .btn-row #del-client { order: 9; } }

/* ---------- Team: role colours, row buttons, edit window (1.4.13) ---------- */
.role-chip {
  --rc: #5A6560;
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px 0 8px; border-radius: 999px; white-space: nowrap; vertical-align: 1px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.01em;
  color: color-mix(in srgb, var(--rc) 46%, var(--text));
  background: color-mix(in srgb, var(--rc) 12%, var(--card));
  border: 1px solid color-mix(in srgb, var(--rc) 34%, var(--card));
}
.role-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--rc); flex: none; }
#team-table td.tm-act, #team-table th.tm-act { width: 1%; white-space: nowrap; text-align: right; }
.tm-btns { display: inline-flex; gap: 6px; justify-content: flex-end; }
.tm-btns .btn.small { height: 30px; padding: 0 12px; }
#team-table tr.off .tm-name { color: var(--text-2); }
#team-table .tm-sm { display: none; }
.tm-who { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0; font-size: 14px; }
.tm-status { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px 12px; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tm-status legend { font-size: 13px; font-weight: 600; color: var(--text-2); padding: 0 4px; }
.tm-status label { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; padding: 8px 10px; border: 1px solid var(--rule-soft); border-radius: var(--radius); }
.tm-status label:has(input:checked) { border-color: var(--text-3); background: var(--surface); }
.tm-status input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--btn-bg); flex: none; }
.tm-status span { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.tm-status small { font-size: 12.5px; color: var(--text-2); }
.tm-status[disabled] { opacity: 0.55; }
.tm-pw { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: var(--radius); background: var(--surface); }
@media (max-width: 600px) {
  .tm-status { grid-template-columns: minmax(0, 1fr); }
  #team-table .tm-sm { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
  #team-table .tm-sm .tm-btns { gap: 6px; }
  .tm-btns .btn.small { height: 28px; padding: 0 11px; font-size: 12.5px; }
}
/* Settings → Firm → Role colours */
.rc-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--rule-soft); }
.rc-row:first-of-type { border-top: 0; }
.rc-prev { min-width: 96px; }
.rc-swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.rc-sw { position: relative; cursor: pointer; }
.rc-sw input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rc-sw i { display: block; width: 26px; height: 26px; border-radius: 50%; background: var(--rc); box-shadow: inset 0 0 0 2px var(--card); border: 2px solid transparent; }
.rc-sw input:checked + i { border-color: var(--text); }
.rc-sw input:focus-visible + i { outline: 3px solid var(--ring); outline-offset: 1px; }
.rc-sw input:disabled + i { cursor: default; opacity: 0.6; }
.rc-sw input:disabled:checked + i { opacity: 1; }
/* Team table: Task and Review groups (1.4.14) */
#team-table thead th { vertical-align: bottom; }
#team-table thead tr.tm-group th { border-bottom: 0; padding-bottom: 4px; }
#team-table thead tr.tm-sub th { padding-top: 4px; font-size: 12px; }
#team-table th.tm-gh { text-align: center; position: relative; }
#team-table th.tm-gh::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 0; border-bottom: 1px solid var(--border); }
#team-table .tm-gs { border-left: 1px solid var(--rule-soft); }
#team-table .tm-role { margin-top: 5px; }
#team-table td.tm-email { color: var(--text-2); }
@media (max-width: 600px) {
  #team-table th.num, #team-table td.num { padding-left: 6px; padding-right: 6px; }
  #team-table thead tr.tm-sub th { font-size: 11px; }
  #team-table th.tm-gh::after { left: 6px; right: 6px; }
}
#team-table .tm-xs { display: none; }
@media (max-width: 600px) {
  #team-table .tm-lg { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  #team-table .tm-xs { display: inline; }
  #team-table th.num, #team-table td.num { padding-left: 5px; padding-right: 5px; width: 40px; }
  #team-table td:first-child, #team-table th:first-child { padding-right: 6px; }
  #team-table .tm-sm .btn.small { padding: 0 9px; }
}

/* ---------- My Day and Dashboard (1.4.15) ---------- */
.md-panel { margin-top: 16px; }
.two-col > section > .panel:first-of-type { margin-top: 16px; }
.md-ph { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.md-ph h2, .md-ph h3 { margin: 0; }
.md-ph h3 { font-size: 13.5px; font-weight: 600; }
.panel h2 .muted { font-weight: 400; margin-left: 6px; }
.md-list { list-style: none; margin: 0; padding: 0; }
.md-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 6px; border-top: 1px solid var(--rule-soft); cursor: pointer; border-radius: 6px; }
.md-list li:first-child { border-top: 0; }
.md-list li:hover, .md-list li:focus-visible { background: var(--hover); }
.md-list .t { font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.md-list .r { display: flex; align-items: center; gap: 8px; flex: none; }
.md-time { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.md-time li { display: flex; gap: 10px; font-size: 13.5px; padding: 5px 4px; border-radius: 6px; cursor: pointer; }
.md-time li:hover { background: var(--hover); }
.md-time .num { flex: none; min-width: 128px; }
.md-time .t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.md-ph b.num { font-size: 18px; }
.md-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.md-stats > div { padding: 10px 12px; border-radius: var(--radius); background: var(--surface); display: flex; flex-direction: column; gap: 2px; }
.md-stats .n { font-size: 20px; font-weight: 600; }
.md-stats .l { font-size: 12px; color: var(--text-2); }
@media (max-width: 600px) { .md-stats { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .md-time .num { min-width: 110px; } }

/* Dashboard grid */
.db-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.db-grid > .panel { margin: 0; min-width: 0; }
.db-grid > .db-wide { grid-column: 1 / -1; }
@media (max-width: 1000px) { .db-grid { grid-template-columns: minmax(0, 1fr); } }
.db-att + .db-att { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--rule-soft); }
.db-att .md-ph { margin-bottom: 4px; }
.db-team .sub .role-chip { margin-top: 3px; }

/* Charts (charts.js) */
.ch-empty { margin: 6px 0 0; }
.ch-cols { display: flex; align-items: stretch; gap: 4px; height: calc(var(--h) + 34px); }
.ch-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.ch-col .v { height: 14px; font-size: 11px; color: var(--text-2); white-space: nowrap; }
.ch-col .b { flex: 1; width: 100%; max-width: 30px; display: flex; align-items: flex-end; border-bottom: 1px solid var(--rule); }
.ch-col .b i { display: block; width: 100%; background: var(--chart); border-radius: 4px 4px 0 0; min-height: 0; }
.ch-col.on .b i { background: var(--text-2); }
.ch-col .l { display: flex; flex-direction: column; align-items: center; line-height: 1.15; font-size: 11px; color: var(--text-2); white-space: nowrap; }
.ch-col .l small { font-size: 11px; color: var(--text-3); }
.ch-col.on .l { color: var(--text); font-weight: 600; }
@media (max-width: 600px) { .ch-cols { gap: 2px; } .ch-col .v { font-size: 11px; } .ch-col .l { font-size: 11px; } }
.ch-legend { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--text-2); }
.ch-legend li { display: inline-flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.sw.late, .ch-st i.late { background: var(--accent); }
.sw.soon, .ch-st i.soon { background: var(--chart); }
.sw.later, .ch-st i.later { background: color-mix(in srgb, var(--text-3) 55%, var(--card)); }
.ch-stack { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ch-stack li > a, .ch-stack li > div { display: grid; grid-template-columns: minmax(110px, 0.9fr) minmax(0, 2fr) 34px; align-items: center; gap: 10px; padding: 5px 4px; border-radius: 6px; color: var(--text); text-decoration: none; }
.ch-stack li > a:hover { background: var(--hover); }
.ch-sl { min-width: 0; font-size: 13.5px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; overflow-wrap: anywhere; }
.ch-sl .role-chip { height: 19px; font-size: 11px; padding: 0 7px 0 6px; }
.ch-st { display: flex; gap: 2px; height: 12px; }
.ch-st i { display: block; height: 100%; border-radius: 3px; min-width: 3px; }
.ch-sv { text-align: right; font-size: 13px; font-weight: 600; }
@media (max-width: 600px) { .ch-stack li > a, .ch-stack li > div { grid-template-columns: minmax(0, 1fr) 30px; grid-template-areas: "l v" "s s"; gap: 4px 8px; } .ch-sl { grid-area: l; } .ch-st { grid-area: s; } .ch-sv { grid-area: v; } }
.ch-ring { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.ch-ring .r { --p: 0; width: 64px; height: 64px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: conic-gradient(var(--chart) calc(var(--p) * 1%), var(--surface) 0); }
.ch-ring .r b { width: 48px; height: 48px; border-radius: 50%; background: var(--card); display: grid; place-items: center; font-size: 14px; }
.ch-ring .t { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.ch-ring .t small { font-size: 12.5px; color: var(--text-2); }
@media (max-width: 600px) { .md-list li { flex-wrap: wrap; gap: 4px 10px; } .md-list .r { flex: 1 1 100%; justify-content: flex-start; } }

/* ---------- My Day rework (1.4.16) ---------- */
.mt-panel { margin-bottom: 24px; padding: 16px 0 12px; }
.mt-head { display: flex; align-items: center; gap: 12px 20px; flex-wrap: wrap; padding: 0 20px 10px; }
.mt-head > div:first-child { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-right: auto; }
.mt-head h2 { margin: 0; }
.mt-total { display: flex; align-items: baseline; gap: 8px; }
.mt-total b { font-size: 20px; font-weight: 600; }
.mt-head .hy-nav { flex-wrap: wrap; }
.mt-head #mt-date { width: auto; height: 32px; }
.mt-wrap { padding: 0 20px; }
.mt-chart { min-width: 560px; padding: 0; }
.mt-chart .dl-row { grid-template-columns: minmax(0, 1fr); }
.mt-chart .dl-row:not(.dl-axis) .dl-track { min-height: 54px; border-left: 1px solid var(--rule-soft); border-radius: 6px; background-color: color-mix(in srgb, var(--surface) 55%, transparent); }
.mt-foot { margin: 8px 20px 0; }
@media (max-width: 600px) { .mt-head, .mt-wrap { padding-left: 14px; padding-right: 14px; } .mt-foot { margin-left: 14px; margin-right: 14px; } .mt-chart { min-width: 520px; } }
.md-cols > section > .md-panel { margin-top: 16px; }
.md-lhead { align-items: flex-end; }
.md-lhead > div { display: flex; flex-direction: column; gap: 2px; }
.md-sort { display: flex; align-items: center; gap: 8px; }
.md-sort select { width: auto; height: 32px; font-size: 13.5px; }
.lg-panel { padding: 8px 16px 12px; }
.lg-group + .lg-group { margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--border); }
.lg-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 6px 4px; }
.lg-head b { font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-2); }
.md-hours { margin: 16px 0 6px; padding-top: 12px; border-top: 1px solid var(--rule-soft); }
.na-list { list-style: none; margin: 0; padding: 0; }
.na-list li { padding: 11px 8px; border-top: 1px solid var(--rule-soft); cursor: pointer; border-radius: 6px; }
.na-list li:first-child { border-top: 0; }
.na-list li:hover, .na-list li:focus-visible { background: var(--hover); }
.na-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.na-top .t { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.na-top .st { flex: none; }
.na-client { margin-top: 2px; }
.na-meta { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 0.8fr); gap: 4px 12px; margin: 8px 0 0; }
.na-meta dd small { display: block; font-size: 12px; color: var(--text-2); }
.na-meta dt { font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-3); }
.na-meta dd { margin: 1px 0 0; font-size: 13px; overflow-wrap: anywhere; }

.mt-head .mt-today { flex: none; height: 32px; padding: 0 14px; }

/* My Day: compact Newly allocated, review bulk status (1.4.18) */
.na-list li { display: grid; grid-template-columns: 28px minmax(0, 1fr) 30px; align-items: center; gap: 6px; padding: 7px 2px; cursor: default; }
.na-list li:hover { background: transparent; }
.na-main { min-width: 0; overflow: hidden; cursor: pointer; border-radius: 6px; padding: 2px 4px; }
.na-main:hover, .na-main:focus-visible { background: var(--hover); }
.na-l1 { display: flex; align-items: center; gap: 8px; min-width: 0; }
.na-l1 .t { flex: 1; font-size: 13.5px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.na-l1 .st { flex: none; height: 20px; font-size: 11.5px; padding: 0 8px; }

.na-l2 { display: flex; align-items: center; gap: 10px; margin-top: 2px; white-space: nowrap; min-width: 0; }
.na-l2 > span { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.na-l2 > .c { flex: 0 1000 auto; }
.na-l2 > .a { flex: 0 10 auto; }
.na-l2 > .e, .na-l2 > .d { flex: none; }
.na-ic { width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 6px; background: transparent; color: var(--text-3); cursor: pointer; }
.na-ic:hover { background: var(--surface); color: var(--text); }
.na-star[aria-pressed="true"] { color: var(--accent); --fill: var(--accent); }
.na-read[aria-pressed="true"] { color: var(--chart); }
.na-list li.read .na-main { opacity: 0.55; }
.na-list li.read .na-l1 .t { font-weight: 500; }
.rv-all { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--text-2); }
.rv-all input, .rv-pick { width: 16px; height: 16px; margin: 0; accent-color: var(--btn-bg); flex: none; }
.rv-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 10px; margin-bottom: 6px; border-radius: var(--radius); background: var(--surface); }
.rv-bar b { font-size: 13px; margin-right: 4px; }
.rv-bar select { width: auto; height: 32px; font-size: 13.5px; }
.rv-list li { cursor: default; padding: 4px 4px 4px 6px; gap: 10px; justify-content: flex-start; }
.rv-list li:hover { background: transparent; }
.rv-main { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 6px; border-radius: 6px; cursor: pointer; }
.rv-main:hover, .rv-main:focus-visible { background: var(--hover); }
@media (max-width: 600px) { .rv-main { flex-wrap: wrap; } .rv-main .r { flex: 1 1 100%; justify-content: flex-start; } .na-l2 { flex-wrap: wrap; gap: 2px 10px; } .na-l2 > .c { flex-basis: 100%; } }

/* ---------- Installed app (1.4.19): offline and new-version notes ---------- */
.app-note {
  position: fixed; left: 50%; top: 12px; transform: translateX(-50%); z-index: 1090;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: 10px;
  background: #1C2826; color: #F5F2EB; font-size: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}
#net-note b { color: #D08A64; }
#ver-note { top: auto; bottom: 24px; }
.app-note .link-btn { color: #F5F2EB; font-weight: 600; }
.app-note-x { border: 0; background: transparent; color: #F5F2EB; font-size: 18px; line-height: 1; padding: 2px 4px; cursor: pointer; opacity: 0.7; }
.app-note-x:hover { opacity: 1; }
@media (display-mode: standalone) { body { overscroll-behavior-y: none; } }

/* ---------- Inbox (1.4.20) ---------- */
.nav-badge {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  display: inline-grid; place-items: center; background: var(--side-accent); color: var(--side-bg);
  font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1;
}
.nav-badge.hidden { display: none; }
.nav-head .nav-badge { margin-left: auto; margin-right: 6px; }
.nav-group.open > .nav-head .nav-badge { display: none; }   /* shown on Inbox itself while Desk is open */
.nav .nav-sub a { display: flex; align-items: center; gap: 8px; }
.nav-sub .nav-badge { height: 18px; min-width: 18px; font-size: 11px; }

.ib {
  display: grid; grid-template-columns: 216px 340px minmax(0, 1fr);
  height: calc(100vh - 168px); min-height: 540px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden;
}
.ib-folders { border-right: 1px solid var(--rule-soft); padding: 12px 8px; overflow-y: auto; }
.ib-fl { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.ib-fsep { height: 1px; background: var(--rule-soft); margin: 8px 6px; }
.ib-f {
  width: 100%; display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px;
  border: 0; border-radius: var(--radius); background: transparent; color: var(--text-2);
  font-size: 13.5px; text-align: left; cursor: pointer;
}
.ib-f svg { width: 17px; height: 17px; flex: none; }
.ib-f .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-f:hover { background: var(--hover); color: var(--text); }
.ib-f.has { color: var(--text); font-weight: 600; }
.ib-f.on { background: var(--surface); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
.ib-f.on svg { color: var(--accent); }
.cnt.quiet { background: transparent; color: var(--text-2); font-weight: 500; }

.ib-chips { display: none; gap: 6px; overflow-x: auto; padding: 0 0 12px; scrollbar-width: none; }
.ib-chips::-webkit-scrollbar { display: none; }
.ib-chip {
  flex: none; height: 32px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--card); color: var(--text-2); font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.ib-chip b { color: var(--accent); margin-left: 3px; font-variant-numeric: tabular-nums; }
.ib-chip.on { background: var(--btn-bg); border-color: var(--btn-bg); color: var(--btn-text); }
.ib-chip.on b { color: inherit; }

.ib-list { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--rule-soft); }
.ib-search { padding: 12px 12px 8px; }
.ib-search input { height: 36px; font-size: 13.5px; }
.ib-threads { list-style: none; margin: 0; padding: 0 6px 10px; overflow-y: auto; flex: 1; min-height: 0; }
.ib-row > button {
  width: 100%; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 11px; align-items: start;
  padding: 10px 8px; border: 0; border-radius: var(--radius); background: transparent; text-align: left; cursor: pointer; color: var(--text);
}
.ib-row + .ib-row > button { box-shadow: 0 -1px 0 var(--rule-soft); }
.ib-row > button:hover { background: var(--hover); box-shadow: none; }
.ib-row.on > button { background: var(--surface); box-shadow: none; }
.ib-av {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: color-mix(in srgb, var(--rc) 18%, var(--card)); color: color-mix(in srgb, var(--rc) 55%, var(--text));
  font-size: 13.5px; font-weight: 700; letter-spacing: 0.02em;
}
.ib-av.tw { background: var(--btn-bg); color: var(--btn-text); font-size: 12px; }
.ib-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ib-l1 { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.ib-l1 .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 500; }
.ib-l1 time { flex: none; font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.ib-l2 { font-size: 12.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-l3 { display: flex; align-items: center; gap: 6px; min-width: 0; margin-top: 1px; }
.ib-l3 .p { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--text-2); }
.ib-row.unread .ib-l1 .t { font-weight: 700; }
.ib-row.unread .ib-l1 time { color: var(--accent); font-weight: 600; }
.ib-row.unread .ib-l3 .p { color: var(--text); }
.ib-flag { display: inline-flex; color: var(--accent); }
.ib-flag svg { width: 14px; height: 14px; }
.ib-empty { padding: 28px 12px; text-align: center; color: var(--text-2); font-size: 13.5px; }

.ib-pane { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.ib-none { flex: 1; display: grid; place-items: center; padding: 30px; text-align: center; }
.ib-phead { display: flex; align-items: flex-start; gap: 12px; padding: 14px 18px 12px; border-bottom: 1px solid var(--rule-soft); }
.ib-back { display: none; }
.ib-pt { flex: 1; min-width: 0; }
.ib-pt .kicker { display: block; font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-pt h2 { font-size: 17px; margin: 1px 0 6px; line-height: 1.3; }
.ib-acts { display: flex; align-items: center; gap: 4px; flex: none; }
.ib-ic {
  width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: var(--radius);
  background: transparent; color: var(--text-2); cursor: pointer;
}
.ib-ic svg { width: 18px; height: 18px; }
.ib-ic:hover { background: var(--hover); color: var(--text); }
.ib-ic[aria-pressed="true"] { color: var(--accent); }
.ib-acts .btn { margin-left: 6px; }
.ib-body { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 18px 22px; display: flex; flex-direction: column; gap: 14px;
  background: color-mix(in srgb, var(--surface) 45%, var(--card)); }
.ib-body > * { flex: none; }
.ib-card { background: var(--card); border: 1px solid var(--rule-soft); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; }
.ib-card-h { padding: 14px 16px 12px; border-bottom: 1px solid var(--rule-soft); }
.ib-card-h .kicker, .ib-sum .kicker { display: block; font-size: 12px; color: var(--text-2); }
.ib-card-h .kicker b, .ib-sum .kicker b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.ib-card-h h3 { margin: 3px 0 8px; font-size: 16.5px; line-height: 1.3; }
.ib-pills, .ib-sum-f { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; font-size: 12.5px; color: var(--text-2); }
.ib-pills .st, .ib-sum-f .st { height: 22px; font-size: 12px; }
.ib-prio { font-size: 12px; font-weight: 600; color: var(--text-2); }
.ib-prio.high, .ib-prio.urgent { color: var(--accent); }
.ib-due { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--rule-soft); }
.ib-due .l, .ib-notes .l { display: block; font-size: 11.5px; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.ib-due b { font-size: 18px; font-variant-numeric: tabular-nums; }
.ib-due .rel { padding: 3px 10px; border-radius: 999px; background: var(--surface); font-size: 12.5px; font-weight: 600; color: var(--text); white-space: nowrap; }
.ib-due.late { background: var(--accent-soft); }
.ib-due.late .rel { background: var(--accent); color: var(--card); }
.ib-dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin: 0; }
.ib-dl > div { padding: 9px 16px; border-bottom: 1px solid var(--rule-soft); min-width: 0; }
.ib-dl > div:nth-child(odd):not(.wide) { border-right: 1px solid var(--rule-soft); }
.ib-dl > div.wide { grid-column: 1 / -1; }
.ib-dl dt { font-size: 11.5px; color: var(--text-2); margin-bottom: 1px; }
.ib-dl dd { margin: 0; font-size: 13.5px; color: var(--text); overflow-wrap: anywhere; }
.ib-notes { padding: 10px 16px 14px; }
.ib-notes p { margin: 3px 0 0; font-size: 13.5px; white-space: pre-wrap; }
.ib-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid var(--rule-soft); }
.ib-stats > div { padding: 10px 16px; display: flex; flex-direction: column; min-width: 0; }
.ib-stats > div + div { border-left: 1px solid var(--rule-soft); }
.ib-stats b { font-size: 18px; font-variant-numeric: tabular-nums; }
.ib-stats span { font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-stats .late b { color: var(--accent); }
.ib-change { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13.5px; }
.ib-change span { padding: 4px 10px; border-radius: 8px; background: var(--card); border: 1px solid var(--rule-soft); color: var(--text-2); text-decoration: line-through; text-decoration-color: var(--text-3); }
.ib-change b { padding: 4px 10px; border-radius: 8px; background: var(--card); border: 1px solid var(--border); }
.ib-change i { font-style: normal; color: var(--text-3); }
.ib-quote { margin: 0; padding: 12px 16px 14px; background: var(--card); border: 1px solid var(--rule-soft); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.ib-quote.at-me { box-shadow: inset 3px 0 0 var(--accent), var(--shadow); }
.ib-quote figcaption { display: flex; align-items: center; gap: 10px; font-size: 13.5px; margin-bottom: 8px; }
.ib-quote figcaption .ib-av { width: 30px; height: 30px; font-size: 11.5px; }
.ib-quote blockquote { margin: 0; font-size: 14.5px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.ib-sum { padding: 12px 16px; background: var(--card); border: 1px solid var(--rule-soft); border-radius: var(--radius-lg); }
.ib-sum .t { display: block; font-size: 14.5px; margin: 2px 0 6px; }
.ib-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.ib-grp { padding: 10px 10px 4px; font-size: 11.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-2); }
.ib-grp + .ib-row > button { box-shadow: none; }
.ib-av.rmd { border-radius: 10px; flex-direction: column; display: flex; align-items: center; justify-content: center; gap: 0; font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; background: var(--surface); color: var(--text-2); }
.ib-av.rmd b { font-size: 15px; line-height: 1.05; color: var(--text); letter-spacing: 0; }
.ib-av.rmd.late b { color: var(--accent); }
.ib-av.star { background: color-mix(in srgb, var(--accent) 14%, var(--card)); color: var(--accent); }
.ib-av.star svg { width: 18px; height: 18px; fill: currentColor; }
.ib-flag svg { fill: currentColor; }
.ib-ic[aria-pressed="true"] svg { fill: currentColor; }
.mention { font-weight: 600; color: color-mix(in srgb, var(--chart) 70%, var(--text)); }
.mention.me { color: var(--accent); }

/* People list for @-mentions */
.mention-pop {
  position: absolute; left: 0; bottom: calc(100% + 4px); z-index: 30; min-width: 220px; max-width: 320px;
  list-style: none; margin: 0; padding: 4px; border-radius: var(--radius); background: var(--card);
  border: 1px solid var(--border); box-shadow: var(--shadow-lg);
}
.mention-pop.hidden { display: none; }
.mention-pop li { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 13.5px; color: var(--text); }
.mention-pop li.on, .mention-pop li:hover { background: var(--surface); }
.mp-dot {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 11px; font-weight: 700;
  background: color-mix(in srgb, var(--rc) 18%, var(--card)); color: color-mix(in srgb, var(--rc) 55%, var(--text));
}

@media (max-width: 1240px) {
  .ib { grid-template-columns: 320px minmax(0, 1fr); }
  .ib-folders { display: none; }
  .ib-chips { display: flex; }
}
@media (max-width: 860px) {
  .ib { grid-template-columns: minmax(0, 1fr); height: auto; min-height: 0; overflow: visible; }
  .ib-list { border-right: 0; }
  .ib-threads { overflow: visible; }
  .ib-pane { display: none; }
  .ib.reading .ib-list { display: none; }
  .ib-page.reading .page-head, .ib-page.reading .ib-chips { display: none; }
  .ib.reading .ib-pane { display: flex; min-height: calc(100vh - 210px); }
  .ib-back {
    display: grid; place-items: center; width: 34px; height: 34px; flex: none; margin: -2px 0 0 -8px;
    border: 0; border-radius: var(--radius); background: transparent; color: var(--text); font-size: 26px; line-height: 1; cursor: pointer;
  }
  .ib-phead { flex-wrap: wrap; padding: 12px 14px 10px; }
  .ib-pt { flex-basis: calc(100% - 40px); }
  .ib-acts { width: 100%; justify-content: flex-end; }
  .ib-body { padding: 12px; }
  .ib-dl { grid-template-columns: minmax(0, 1fr); }
  .ib-dl > div:nth-child(odd):not(.wide) { border-right: 0; }
}

/* ---------- Menu: collapsible on computers, an app on phones (1.4.24) ---------- */
.side { overflow-y: auto; scrollbar-width: thin; }
.side-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }
.side-toggle, .side-close {
  width: 32px; height: 32px; flex: none; display: grid; place-items: center; margin-top: -2px;
  border: 0; border-radius: var(--radius); background: transparent; color: var(--side-muted); cursor: pointer;
}
.side-toggle svg, .side-close svg { width: 19px; height: 19px; }
.side-toggle:hover, .side-close:hover { background: var(--side-raise); color: var(--side-text); }
.side-close, .appbar, .tabbar, .scrim { display: none; }
.nav-head { position: relative; }

/* Collapsed: an icon rail; headings open their pages as a small panel */
@media (min-width: 861px) {
  .shell.rail { grid-template-columns: 72px minmax(0, 1fr); }
  .rail .side { padding: 18px 10px 14px; overflow: visible; }
  .rail .side-top { flex-direction: column; align-items: center; gap: 12px; margin-bottom: 14px; }
  .rail .wordmark { padding: 0; align-items: center; gap: 5px; }
  .rail .wordmark .acj { font-size: 16px; }
  .rail .wordmark .double-rule { width: 30px; height: 6px; }
  .rail .wordmark .app { display: none; }
  .rail .side-toggle svg { transform: scaleX(-1); }
  .rail .side-search { justify-content: center; padding: 0; }
  .rail .side-search span, .rail .side-search kbd { display: none; }
  .rail .nav > .nav-group > .nav-top { justify-content: center; padding: 0; }
  .rail .nav > .nav-group > .nav-top > span, .rail .chev { display: none; }
  .rail .nav-group { position: relative; }
  .rail .nav-group.on > .nav-head { background: var(--side-raise); }
  .rail .nav-group > .nav-sub {
    display: none; position: absolute; left: calc(100% + 4px); top: -6px; z-index: 40; min-width: 200px; margin: 0; padding: 8px;
    background: var(--side-bg); border: 1px solid var(--side-line); border-radius: 10px; box-shadow: var(--shadow-lg);
  }
  .rail .nav-group > .nav-sub::after { content: ""; position: absolute; left: -10px; top: 0; bottom: 0; width: 10px; }
  .rail .nav-group:hover > .nav-sub, .rail .nav-group:focus-within > .nav-sub { display: flex; }
  .rail .nav-sub::before { content: attr(data-label); padding: 2px 10px 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--side-muted); }
  .rail .nav .nav-sub a { padding: 0 10px; }
  .rail .nav .nav-sub a::before { display: none; }
  .rail .nav .nav-sub a.active { background: var(--side-raise); }
  .rail .nav-head .nav-badge { position: absolute; top: 2px; right: 4px; height: 16px; min-width: 16px; padding: 0 4px; margin: 0; font-size: 11px; }
  .rail .nav-group.open > .nav-head .nav-badge:not(.hidden) { display: inline-grid; }
  .rail .side-foot { padding: 12px 0 0; display: flex; flex-direction: column; align-items: center; }
  .rail .me-t, .rail .side-foot button span { display: none; }
  .rail .foot-actions { flex-direction: column; align-items: center; }
  .rail .side-foot button { width: 36px; height: 36px; padding: 0; justify-content: center; }
}

/* Phones: an app bar on top, tabs at the bottom, the menu slides in */
@media (max-width: 860px) {
  .shell, .shell.rail { grid-template-columns: minmax(0, 1fr); align-content: start; }   /* short pages: no gap under the top bar */
  .appbar {
    display: flex; align-items: center; gap: 2px; position: sticky; top: 0; z-index: 30;
    height: calc(56px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 6px 0;
    background: color-mix(in srgb, var(--bg) 86%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--rule-soft);
  }
  .ab-btn { width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 12px; background: transparent; color: var(--text); cursor: pointer; }
  .ab-btn svg { width: 22px; height: 22px; }
  .ab-btn:active { background: var(--hover); }
  .ab-title { flex: 1; min-width: 0; text-align: center; font-size: 17px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  .side {
    position: fixed; z-index: 50; top: 0; bottom: 0; left: 0; width: min(304px, 86vw); height: 100%;
    padding: calc(18px + env(safe-area-inset-top)) 12px calc(14px + env(safe-area-inset-bottom));
    border-right: 0; border-radius: 0 18px 18px 0;
    transform: translateX(-104%); transition: transform 0.26s cubic-bezier(0.2, 0.8, 0.2, 1);
    visibility: hidden;
  }
  .drawer-open .side { transform: none; visibility: visible; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35); }
  .scrim { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(10, 16, 15, 0.45); opacity: 0; pointer-events: none; transition: opacity 0.22s; }
  .drawer-open .scrim { opacity: 1; pointer-events: auto; }
  .side { overflow: hidden; }
  .side .nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin: 0 -6px; padding: 0 6px 8px; }
  .side-foot { flex: none; }
  .side-search kbd { display: none; }
  .side-toggle { display: none; }
  .side-close { display: grid; }
  .wordmark { padding-bottom: 20px; }
  .nav a, .nav-head { height: 42px; font-size: 15px; }
  .nav .nav-sub a { height: 38px; font-size: 14.5px; }
  .side-search { height: 42px; }
  .side-foot button { height: 38px; font-size: 14px; }

  .tabbar {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    height: calc(62px + env(safe-area-inset-bottom)); padding: 0 4px env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--card) 97%, transparent); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
    border-top: 1px solid var(--rule-soft);
  }
  .tb {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    border: 0; background: transparent; color: var(--text-2); text-decoration: none; font-size: 11px; font-weight: 600; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .tb svg { position: relative; z-index: 1; width: 22px; height: 22px; }
  .tb span { position: relative; z-index: 1; }
  .tb::before { content: ""; position: absolute; top: 7px; left: 50%; width: 54px; height: 30px; margin-left: -27px; border-radius: 15px; background: transparent; transition: background 0.15s; }
  .tb.on { color: var(--text); }
  .tb.on::before { background: var(--accent-soft); }
  .tb.on svg { color: var(--accent); }
  .tb .nav-badge { position: absolute; z-index: 2; top: 4px; left: calc(50% + 5px); height: 17px; min-width: 17px; padding: 0 5px; margin: 0; font-size: 11px; background: var(--accent); color: var(--card); box-shadow: 0 0 0 2px var(--card); }

  .main { padding: 16px 16px calc(86px + env(safe-area-inset-bottom)); }
  #toast, #ver-note { bottom: calc(76px + env(safe-area-inset-bottom)); }
  body.no-scroll { overflow: hidden; }
}

/* My Day: Pending for invoice (1.4.25) */
.inv-list li { grid-template-columns: 28px minmax(0, 1fr) auto; }
.inv-ic { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700;
  background: color-mix(in srgb, var(--chart) 16%, var(--card)); color: color-mix(in srgb, var(--chart) 75%, var(--text)); }
.inv-fee { flex: none; font-size: 12.5px; font-weight: 600; color: var(--text); }
.inv-done { height: 30px; padding: 0 11px; }

/* Inbox: My clients (1.4.25) */
.ib-av.cl { border-radius: 10px; background: color-mix(in srgb, var(--chart) 16%, var(--card)); color: color-mix(in srgb, var(--chart) 70%, var(--text)); font-size: 12.5px; }
.ib-tag { flex: none; padding: 1px 8px; border-radius: 999px; background: var(--surface); color: var(--text-2); font-size: 11.5px; font-weight: 600; }
.ib-stats.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ib-sec { padding: 12px 0 4px; }
.ib-sec h4 { padding: 0 16px 8px; font-size: 13.5px; }
.ib-sec h4 .muted { font-weight: 500; }
.ib-sec > p { padding: 0 16px 8px; margin: 0; }
.ib-work { list-style: none; margin: 0; padding: 0; }
.ib-work li { border-top: 1px solid var(--rule-soft); }
.ib-work li > button, .ib-work .w-row {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 16px;
  border: 0; background: transparent; text-align: left; color: var(--text); font: inherit;
}
.ib-work li > button { cursor: pointer; }
.ib-work li > button:hover { background: var(--hover); }
.w-main { display: flex; flex-direction: column; min-width: 0; }
.w-main b { font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-side { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: none; }
.w-side .st { height: 20px; font-size: 11.5px; }
@media (max-width: 600px) { .ib-stats.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ib-stats.four > div:nth-child(3) { border-left: 0; } .ib-stats.four > div:nth-child(n+3) { border-top: 1px solid var(--rule-soft); } }

/* Reminders and notes (1.4.26) */
.rm-list { list-style: none; margin: 0; padding: 0; }
.rm-list li { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 10px 16px; border-top: 1px solid var(--rule-soft); }
.panel .rm-list li { padding: 10px 0; }
.panel .rm-list li:first-child { border-top: 0; }
.rm-date { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 10px;
  background: var(--surface); line-height: 1.1; font-variant-numeric: tabular-nums; }
.rm-date b { font-size: 16px; }
.rm-date span { font-size: 11px; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.04em; }
.rm-date.today { background: var(--btn-bg); }
.rm-date.today b, .rm-date.today span { color: var(--btn-text); }
.rm-list li.late .rm-date { background: var(--accent-soft); }
.rm-list li.late .rm-date b { color: var(--accent); }
.rm-main { min-width: 0; }
.rm-note { margin: 0; font-size: 14px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.rm-meta { display: flex; flex-wrap: wrap; gap: 2px 10px; margin-top: 3px; }
.rm-acts { display: flex; align-items: center; gap: 2px; }
.rm-list li.done .rm-note { text-decoration: line-through; text-decoration-color: var(--text-3); color: var(--text-2); }
.rm-list li.done { opacity: 0.7; }
.rm-list li.star .na-star { color: var(--accent); --fill: var(--accent); }
.rm-empty { padding: 0 16px 10px; margin: 0; }
.panel .rm-empty { padding: 0; }
.ib-sec h4 { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ib-quote-acts { margin-top: 10px; display: flex; gap: 8px; }
.md-ph .link-btn { white-space: nowrap; }
/* Reminders and notes since update 26 (1.4.41): heading and details, people, replies */
.rm-open { display: block; width: 100%; padding: 0; border: 0; background: none; text-align: left; color: var(--text); font: inherit; cursor: pointer; }
.rm-open:hover .rm-title { text-decoration: underline; text-decoration-color: var(--text-3); text-underline-offset: 3px; }
.rm-open:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); border-radius: 4px; }
.rm-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 14px; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.rm-det { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; margin-top: 1px; font-size: 13px; color: var(--text-2); overflow-wrap: anywhere; }
.rm-list li.done .rm-title { text-decoration: line-through; text-decoration-color: var(--text-3); color: var(--text-2); }
.rm-date.rm-nodate { color: var(--text-2); }
.rm-rep { color: var(--text-2); }
.ib-av.rmd.note { color: var(--text-2); }
.rm-people { border: 0; padding: 0; margin: 0; min-width: 0; }
.rm-people legend { font-size: 13px; font-weight: 600; color: var(--text-2); padding: 0; margin-bottom: 6px; }
.rm-pp { display: flex; flex-wrap: wrap; gap: 6px; }
.rm-pp label { position: relative; cursor: pointer; }
.rm-pp input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.rm-pp span { display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--card); font-size: 13.5px; color: var(--text-2); }
.rm-pp span::before { content: ""; width: 14px; height: 14px; margin-right: 7px; border-radius: 50%; border: 1.5px solid var(--text-3); box-sizing: border-box; }
.rm-pp input:checked + span { border-color: var(--text); color: var(--text); font-weight: 500; background: var(--surface); }
.rm-pp input:checked + span::before { border: 4px solid var(--text); }
.rm-pp input:focus-visible + span { box-shadow: 0 0 0 3px var(--ring); }
.rm-count { text-align: right; }
/* One reminder in full (dialog and Inbox) */
.rp { display: flex; flex-direction: column; gap: 12px; }
.rp-kind { margin: 0; font-size: 12.5px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.rp-star { color: var(--accent); --fill: var(--accent); display: inline-flex; }
.rp-title { margin: -6px 0 0; font-size: 18px; line-height: 1.35; overflow-wrap: anywhere; }
.rp-note { margin: 0; font-size: 14.5px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.rp-facts { margin: 0; display: grid; gap: 4px; font-size: 13.5px; }
.rp-facts > div { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 10px; }
.rp-facts dt { color: var(--text-2); }
.rp-facts dd { margin: 0; overflow-wrap: anywhere; }
.rp-people { list-style: none; margin: 0; padding: 0; border: 1px solid var(--rule-soft); border-radius: var(--radius); }
.rp-people li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--rule-soft); font-size: 13.5px; }
.rp-people li:first-child { border-top: 0; }
.rp-people .rp-st { color: var(--text-2); display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.rp-people li.done .rp-st { color: var(--chart); }
.rp-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.rp-starbtn svg { width: 15px; height: 15px; }
.rp-starbtn[aria-pressed="true"] svg { color: var(--accent); --fill: var(--accent); }
.rp-thread { border-top: 1px solid var(--rule-soft); padding-top: 12px; }
.rp-thread h4 { margin: 0 0 10px; font-size: 14px; }
.rp-thread ol { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rp-thread li { display: block; padding: 8px 12px 9px; border-radius: var(--radius); background: var(--surface); }
dialog .rp-kind { display: none; }   /* the dialog's own title says it */
.ib-body .rp-title { display: none; }   /* the Inbox pane's title says it */
.rp-thread li.me { background: var(--hover); border: 1px solid var(--rule-soft); }
.rp-qh { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.rp-qh time { color: var(--text-2); font-size: 12.5px; }
.rp-qh .link-btn { margin-left: auto; color: var(--text-2); font-size: 12.5px; }
.rp-thread li p { margin: 3px 0 0; font-size: 14px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.rp-none { margin: 0 0 10px; }
.rp-reply textarea { width: 100%; resize: vertical; min-height: 60px; }
.rp-rf { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.ib-body .rp { background: var(--card); border: 1px solid var(--rule-soft); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 14px 16px 16px; }
@media (max-width: 600px) { .rm-list li { grid-template-columns: 40px minmax(0, 1fr); } .rm-acts { grid-column: 2; justify-content: flex-start; margin-top: -4px; } .rm-date { width: 40px; height: 40px; } }

/* Clients → Client view (partners; folders since 1.4.28) */
.ib.cv { grid-template-columns: 250px 340px minmax(0, 1fr); position: relative; }
.cv-folders { position: static; max-height: none; min-height: 0; overflow-y: auto; border-radius: 0; padding: 12px 8px 16px; }
.cv-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 14px 14px 0; }
.cv-head .crumbs { font-size: 12.5px; }
.cv-head .crumbs h2 { font-size: 16px; }
.cv-tools { display: flex; flex-direction: column; gap: 8px; }
.cv-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cv-filters select { height: 34px; font-size: 13px; }
.cv-count { margin: 0; padding: 8px 14px 12px; border-top: 1px solid var(--rule-soft); }
@media (max-width: 1240px) {
  .ib.cv { grid-template-columns: 320px minmax(0, 1fr); }
  .cv-ftog {
    display: flex; align-items: center; gap: 10px; width: 100%; max-width: 420px; margin: 0 0 10px;
    height: 42px; padding: 0 14px; border: 1px solid var(--border); border-radius: var(--radius-lg);
    background: var(--card); box-shadow: var(--shadow);
    color: var(--text); font-size: 14px; font-weight: 500; text-align: left; cursor: pointer;
  }
  .cv-ftog::before { content: "Folder"; color: var(--text-2); font-size: 12.5px; font-weight: 500; flex: none; }
  .cv-ftog::after { content: ""; flex: none; margin-left: auto; border-top: 5px solid var(--text-2); border-left: 4px solid transparent; border-right: 4px solid transparent; }
  .cv-folders, .cv-folders.show {
    position: absolute; z-index: 20; left: 0; top: 0; width: min(320px, 100%); max-height: min(70vh, 100%); margin: 0;
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  }
  .cv-folders { display: none; }
  .cv-folders.show { display: block; }
}
@media (max-width: 860px) {
  .ib.cv { grid-template-columns: minmax(0, 1fr); }
  .cv-ftog { max-width: none; }
  .cv-folders, .cv-folders.show { max-height: 70vh; width: 100%; }
  .ib-page.reading .cv-ftog { display: none; }
}

/* Settings → Data → Storage (1.4.26) */
.st-meter { margin-top: 4px; }
.st-bar { position: relative; height: 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--rule-soft); }
.st-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: var(--chart); min-width: 4px; }
.st-bar b { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--accent); }
.st-legend { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 6px; font-size: 13px; }
.st-more { margin-top: 10px; }
.st-more table { margin-top: 8px; }

/* ---------- Services → Firm details (1.4.31) ---------- */
.fd-all { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.fd-all h2 { margin: 0; }
.fd-all p { margin: 2px 0 0; }
.fd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: 16px; align-items: start; }
.fd-grid > .panel { margin: 0; min-width: 0; }
.fd-h { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.fd-h h2 { margin: 0; line-height: 1.25; }
.fd-h p { margin: 1px 0 0; }
.fd-mono, .fd-ic {
  flex: none; width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center;
  background: var(--btn-bg); color: var(--btn-text);
}
.fd-mono { font-family: var(--serif); font-weight: 500; font-size: 14px; letter-spacing: 0.06em; }
.fd-ic { background: var(--surface); color: var(--accent); font-size: 18px; font-weight: 700; }
.fd-ic svg { width: 20px; height: 20px; }
.fd-dl { margin: 0; }
.fd-dl > div { display: grid; grid-template-columns: 38% minmax(0, 1fr); gap: 10px; align-items: start; padding: 8px 0; border-top: 1px solid var(--rule-soft); }
.fd-dl dt { font-size: 12.5px; color: var(--text-2); padding-top: 2px; }
.fd-dl dd { margin: 0; display: flex; align-items: flex-start; gap: 6px; min-width: 0; }
.fd-dl .v { flex: 1; min-width: 0; font-size: 14px; font-weight: 500; color: var(--text); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.fd-copy {
  flex: none; width: 28px; height: 28px; margin: -4px -4px 0 0; display: grid; place-items: center;
  border: 0; border-radius: var(--radius); background: transparent; color: var(--text-3); cursor: pointer;
}
.fd-copy:hover { background: var(--hover); color: var(--text); }
.fd-stamp { margin: 10px 0 0; }
.fd-share { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.fd-share .btn { display: inline-flex; align-items: center; gap: 6px; }

@media (max-width: 600px) { .fd-dl > div { grid-template-columns: minmax(0, 1fr); gap: 2px; } .fd-share .btn { flex: 1 1 calc(50% - 6px); justify-content: center; } }

/* ---------- Dashboard, rebuilt (1.4.32) ---------- */
.db-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.db-card {
  min-width: 0; display: flex; flex-direction: column; gap: 10px; padding: 16px 18px 14px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.db-k { font-size: 11.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-2); }
.db-big { display: flex; align-items: baseline; gap: 8px; color: var(--text); text-decoration: none; }
a.db-big:hover b { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.db-big b { font-size: 34px; font-weight: 600; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.db-big span { font-size: 13px; color: var(--text-2); }
.db-minis { display: flex; gap: 8px; margin-top: auto; }
.db-minis.three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.db-mini {
  flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 1px; padding: 7px 9px; border-radius: var(--radius);
  background: var(--surface); color: var(--text); text-decoration: none;
}
.db-mini:hover { background: var(--hover); }
.db-mini b { font-size: 18px; font-weight: 600; line-height: 1.2; }
.db-mini span { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db-mini small { font-size: 11.5px; color: var(--text-3); }
.db-minis.three { gap: 6px; }
.db-minis.three .db-mini { padding: 7px 8px; }
.db-minis.three .db-mini span { white-space: normal; overflow: visible; line-height: 1.25; font-size: 11.5px; }
.db-minis.three .db-mini b { display: flex; align-items: center; gap: 6px; }
.db-minis.three .db-mini b::before { content: ""; width: 8px; height: 8px; border-radius: 2px; flex: none; }
.k-na b::before, .db-seg.na { background: var(--accent); }
.k-ns b::before, .db-seg.ns { background: color-mix(in srgb, var(--text-3) 60%, var(--card)); }
.k-ac b::before, .db-seg.ac { background: var(--chart); }
.db-minis.stack { flex-direction: column; gap: 6px; margin-top: 0; }
.db-minis.stack .db-mini { flex-direction: row; align-items: baseline; gap: 10px; padding: 8px 10px; }
.db-minis.stack .db-mini b { min-width: 30px; }
.db-minis.stack .db-mini span { flex: 1; font-size: 13px; color: var(--text); }
.db-minis.stack .db-mini small { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.db-bar { display: flex; gap: 2px; height: 10px; border-radius: 999px; overflow: hidden; background: var(--surface); }
.db-seg { display: block; min-width: 4px; }
.db-seg.none { flex: 1; background: transparent; }
.db-card.dark { background: var(--btn-bg); border-color: var(--btn-bg); }
.db-card.dark .db-k, .db-card.dark .db-big span { color: color-mix(in srgb, var(--btn-text) 72%, transparent); }
.db-card.dark .db-big { color: var(--btn-text); }
.db-card.dark .db-mini { background: color-mix(in srgb, var(--btn-text) 10%, transparent); color: var(--btn-text); }
.db-card.dark .db-mini:hover { background: color-mix(in srgb, var(--btn-text) 16%, transparent); }
.db-card.dark .db-mini span, .db-card.dark .db-mini small { color: color-mix(in srgb, var(--btn-text) 72%, transparent); }
.db-card.alert { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.db-card.alert .db-big b { color: var(--accent); }

.db-split.db-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; }
.db-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.db-col > .panel { margin: 0; }
.db-split > .db-wide { grid-column: 1 / -1; margin: 0; }
.md-sort { display: inline-flex; align-items: center; gap: 8px; }
.md-sort select { height: 32px; font-size: 13px; width: auto; }

.db-rows { list-style: none; margin: 0; padding: 0; }
.db-rows li[data-task] {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 8px 6px; border-radius: var(--radius); cursor: pointer;
}
.db-rows li + li { box-shadow: 0 -1px 0 var(--rule-soft); }
.db-rows li[data-task]:hover { background: var(--hover); box-shadow: none; }
.db-date { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 40px; border-radius: 8px; background: var(--surface); line-height: 1.1; }
.db-date b { font-size: 15px; font-weight: 600; }
.db-date span { font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-2); }
.db-rows li.late .db-date { background: var(--accent-soft); }
.db-rows li.late .db-date b, .db-rows li.late .db-date span { color: var(--accent); }
.db-rows li.today .db-date { background: var(--btn-bg); }
.db-rows li.today .db-date b, .db-rows li.today .db-date span { color: var(--btn-text); }
.db-main { display: flex; flex-direction: column; min-width: 0; }
.db-main .t { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db-main .c { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db-side { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.db-empty { padding: 14px 4px; }
.db-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--rule-soft); min-height: 32px; }
.db-pager { display: inline-flex; align-items: center; gap: 6px; }
.db-pager .btn { width: 32px; padding: 0; justify-content: center; }
#db-works .ch-sl { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#db-works .ch-sl small { font-size: 11.5px; color: var(--text-3); margin-left: 6px; }
#db-works .ch-stack li > a { grid-template-columns: minmax(120px, 0.95fr) minmax(0, 1.6fr) 34px; }

.db-tabs { display: flex; width: 100%; margin-bottom: 12px; overflow-x: auto; scrollbar-width: none; }
.db-tabs button { flex: 1 0 auto; white-space: nowrap; }
.db-tabs b { margin-left: 4px; font-weight: 600; color: var(--text-2); }
.db-tabs button.on b { color: inherit; }
.db-bill-top { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.db-bill-top > div { display: flex; flex-direction: column; padding: 8px 10px; border-radius: var(--radius); background: var(--surface); }
.db-bill-top b { font-size: 18px; font-weight: 600; }
.db-bill-sum { margin: 8px 0 0; }

.dc-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.dc-h { text-align: center; font-size: 11px; font-weight: 600; color: var(--text-3); padding-bottom: 2px; }
.dc-h.sun { color: var(--accent); }
.dc-cell {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 1px;
  min-height: 38px; padding: 4px 0 3px; border-radius: 7px; color: var(--text); text-decoration: none; font-variant-numeric: tabular-nums;
}
a.dc-cell:hover { background: var(--hover); }
.dc-cell .dn { font-size: 12.5px; line-height: 1.2; }
.dc-cell.past { color: var(--text-3); }
.dc-cell.shut { background: color-mix(in srgb, var(--surface) 70%, transparent); color: var(--text-3); }
.dc-cell.today { box-shadow: inset 0 0 0 1.5px var(--accent); font-weight: 600; }
.dc-n {
  font-style: normal; font-size: 11px; font-weight: 600; line-height: 16px; min-width: 18px; padding: 0 4px; border-radius: 999px; text-align: center;
  background: color-mix(in srgb, var(--chart) calc(var(--w) * 100%), var(--card)); color: color-mix(in srgb, var(--chart) 40%, var(--text));
}
.dc-cell.late .dc-n { background: var(--accent-soft); color: var(--accent); }
.dc-sum { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--rule-soft); color: var(--text-2); }
.dc-sum b { color: var(--text); }

.sw.s-not_started, .sb-t i.s-not_started { background: color-mix(in srgb, var(--text-3) 50%, var(--card)); }
.sw.s-awaiting_client, .sb-t i.s-awaiting_client, .sw.s-client_review, .sb-t i.s-client_review, .sw.s-tax_payment, .sb-t i.s-tax_payment { background: var(--dot-wait); }
.sw.s-in_progress, .sb-t i.s-in_progress { background: var(--dot-prog); }
.sw.s-under_review, .sb-t i.s-under_review { background: var(--dot-review); }
.sw.s-pending_invoice, .sb-t i.s-pending_invoice { background: color-mix(in srgb, var(--dot-done) 55%, var(--card)); }
.sw.s-payment_due, .sb-t i.s-payment_due { background: repeating-linear-gradient(135deg, var(--dot-done) 0 3px, color-mix(in srgb, var(--dot-done) 35%, var(--card)) 3px 6px); }
.sw.s-completed, .sb-t i.s-completed { background: var(--dot-done); }
.ch-legend.sts { margin-bottom: 14px; }
.sb-chart { display: flex; flex-direction: column; gap: 2px; }
.sb-row, .sb-axis { display: grid; grid-template-columns: minmax(120px, 290px) minmax(0, 1fr) 44px; gap: 12px; align-items: center; }   /* room for service names (1.4.44) */
.sb-row { padding: 6px 4px; border-radius: 6px; color: var(--text); text-decoration: none; }
.sb-row:hover { background: var(--hover); }
/* Work by status grouped by section (1.4.44) */
.sb-sec { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 12px 0 2px; padding: 4px 4px 4px; border-bottom: 1px solid var(--rule-soft); color: var(--text); text-decoration: none; font-size: 13px; }
.sb-sec:first-child { margin-top: 0; }
.sb-sec b { font-weight: 600; letter-spacing: 0.01em; }
.sb-sec span { color: var(--text-2); font-weight: 600; }
.sb-sec:hover b { text-decoration: underline; text-decoration-color: var(--text-3); text-underline-offset: 3px; }
.sb-row.sb-sub .sb-l { padding-left: 12px; color: var(--text); }
@media (max-width: 600px) {
  /* Phones: the service name on its own line, the bar and count below it */
  .sb-row.sb-sub { grid-template-columns: minmax(0, 1fr) 36px; gap: 2px 10px; }
  .sb-row.sb-sub .sb-l { grid-column: 1 / -1; padding-left: 8px; white-space: normal; }
  .sb-row.sb-sub .sb-t { margin-left: 8px; }
  .sb-chart .sb-axis { grid-template-columns: 0 minmax(0, 1fr) 36px; gap: 0 10px; }
}
.sb-l { font-size: 13.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-t { display: flex; gap: 2px; height: 20px; }
.sb-t i { display: block; height: 100%; min-width: 3px; border-radius: 3px; }
.sb-v { text-align: right; font-size: 13px; font-weight: 600; }
.sb-axis { padding: 4px 4px 0; }
.sb-ticks { position: relative; height: 18px; border-top: 1px solid var(--rule-soft); }
.sb-ticks i { position: absolute; top: 3px; transform: translateX(-50%); font-style: normal; font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.sb-ticks i::before { content: ""; position: absolute; left: 50%; top: -4px; height: 4px; border-left: 1px solid var(--rule-soft); }
.sb-cap { text-align: center; margin: 2px 0 0; }

@media (max-width: 1240px) { .db-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1000px) { .db-split.db-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) {
  .db-cards { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .db-big b { font-size: 30px; }
  .sb-row, .sb-axis { grid-template-columns: 92px minmax(0, 1fr) 30px; gap: 8px; }
  .sb-l { font-size: 12.5px; }
  .db-rows li[data-task] { grid-template-columns: 40px minmax(0, 1fr); }
  .db-side { grid-column: 2; flex-direction: row; align-items: center; justify-content: flex-start; gap: 8px; }
  .db-foot { flex-wrap: wrap; }
}

/* Dashboard → Team workload (1.4.32) */
.db-tt { font-size: 13px; table-layout: auto; }
.db-tt th { font-size: 11.5px !important; }
.db-tt th { padding: 6px 4px 8px !important; }
.db-tt th button { border: 0; background: transparent; padding: 0; font: inherit; color: inherit; cursor: pointer; white-space: nowrap; }
.db-tt th button:hover { color: var(--text); }
.db-tt th.on button { color: var(--text); font-weight: 600; }
.db-tt th.on button { box-shadow: inset 0 -2px 0 var(--accent); }
.db-tt td { padding: 8px 4px !important; vertical-align: middle; font-variant-numeric: tabular-nums; }
.db-tt td:first-child, .db-tt th:first-child { min-width: 120px; padding-left: 0 !important; }
.db-tt td:last-child, .db-tt th:last-child { padding-right: 0 !important; }
.db-tn { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.db-tsub { display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.db-tsub .role-chip { height: 18px; font-size: 11px; padding: 0 6px 0 5px; }
.db-load {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; height: 18px; padding: 0 7px; border-radius: 999px;
  font-size: 11px; font-weight: 600; background: var(--surface); color: var(--text-2); isolation: isolate;
}
.db-load i { position: absolute; inset: 0 auto 0 0; z-index: -1; background: color-mix(in srgb, var(--chart) 22%, transparent); }
.db-load.heavy { color: var(--accent); }
.db-load.heavy i { background: var(--accent-soft); }
.db-load.light { color: var(--text-3); }
#db-team .md-sort select { max-width: 150px; }

/* Settings → Client types (1.4.35) */
.ct-head, .ct-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.2fr) 52px 204px; gap: 8px; align-items: center; }
.ct-head { padding: 0 2px 4px; }
.ct-head span:nth-child(3) { text-align: right; }
.ct-rows { display: flex; flex-direction: column; gap: 6px; }
.ct-row input[type=text] { height: 36px; font-size: 14px; }
.ct-n { text-align: right; font-size: 13px; color: var(--text-2); }
.ct-acts { display: flex; align-items: center; gap: 4px; }
.ct-acts .doc-opt { margin-right: 4px; white-space: nowrap; }
.ct-b { width: 30px; height: 30px; border: 0; border-radius: var(--radius); background: color-mix(in srgb, var(--text) 7%, transparent); color: var(--text-2); cursor: pointer; }
.ct-b:hover:not(:disabled) { color: var(--text); background: color-mix(in srgb, var(--text) 12%, transparent); }
.ct-b:disabled { opacity: 0.35; cursor: not-allowed; }
@media (max-width: 700px) {
  .ct-head { display: none; }
  .ct-row { grid-template-columns: minmax(0, 1fr) 40px; padding: 10px 0; border-top: 1px solid var(--rule-soft); }
  .ct-row [data-k=plural] { grid-column: 1; }
  .ct-row .ct-n { grid-column: 2; grid-row: 1; }
  .ct-acts { grid-column: 1 / -1; }
}
@media (max-width: 700px) { .ct-n::after { content: " clients"; } }
/* With a code start for each type (1.4.54, update 31) */
.ct-codes .ct-row, .ct-head.ct-codes { grid-template-columns: minmax(0, 1.2fr) 104px minmax(0, 1.2fr) 52px 204px; }
.ct-head.ct-codes span:nth-child(3) { text-align: left; }
.ct-head.ct-codes span:nth-child(4) { text-align: right; }
.ct-row [data-k=code_prefix] { text-transform: uppercase; font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }
.ct-row [data-k=code_prefix]::placeholder { text-transform: none; letter-spacing: 0; }
@media (max-width: 700px) {
  .ct-codes .ct-row { grid-template-columns: 84px minmax(0, 1fr) 64px; }
  .ct-codes .ct-row [data-k=name] { grid-column: 1 / 3; grid-row: 1; }
  .ct-codes .ct-row .ct-n { grid-column: 3; grid-row: 1; }
  .ct-codes .ct-row [data-k=code_prefix] { grid-column: 1; grid-row: 2; }
  .ct-codes .ct-row [data-k=plural] { grid-column: 2 / 4; grid-row: 2; }
  .ct-codes .ct-row .ct-acts { grid-column: 1 / -1; grid-row: 3; }
}

/* Team: Super Admin (1.4.36) */
.tag.sa-tag { background: color-mix(in srgb, var(--accent) 14%, var(--card)); color: var(--accent); font-weight: 600; margin-left: 4px; }

/* Firm details: bank account tabs (1.4.37) */
.fd-tabs { display: flex; width: 100%; overflow-x: auto; scrollbar-width: none; margin-bottom: 8px; }
.fd-tabs::-webkit-scrollbar { display: none; }
.fd-tabs button { flex: 1 0 auto; white-space: nowrap; }
.fd-blabel { margin: 0 0 4px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.bk-list { list-style: none; margin: 0 0 12px; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-lg); }
.bk-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; }
.bk-list li + li { border-top: 1px solid var(--rule-soft); }
.bk-main { display: flex; flex-direction: column; min-width: 0; }
.bk-main .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-acts { display: flex; align-items: center; gap: 4px; flex: none; }

/* Services → Favourites (1.4.37) */
.tabs .fav-tab { display: inline-flex; align-items: center; gap: 6px; }
.tabs .fav-tab svg { color: var(--accent); }
.tabs .fav-tab.on svg { --fill: var(--accent); }
.tabs .fav-tab b { font-weight: 600; color: var(--text-2); }
.ref-star { display: inline-flex; vertical-align: -2px; margin-left: 6px; color: var(--accent); --fill: var(--accent); }
.ref-star svg { width: 13px; height: 13px; }
.svc-fav { display: inline-flex; align-items: center; gap: 6px; }
.svc-fav svg { color: var(--accent); }
.svc-fav.on { --fill: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.rd-head .btn-row { flex-wrap: wrap; justify-content: flex-end; }

/* Settings → Roles (1.4.38): powers down the side, a column for each role */
.rl-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
.rl-grid { width: 100%; border-collapse: collapse; font-size: 14px; }
.rl-grid th, .rl-grid td { padding: 8px 10px; border-top: 1px solid var(--rule-soft); vertical-align: middle; }
.rl-grid thead th { border-top: 0; text-align: center; font-weight: 600; vertical-align: bottom; min-width: 124px; border-bottom: 2px solid color-mix(in srgb, var(--rc, var(--text-3)) 65%, var(--card)); }
.rl-grid thead th input { width: 100%; height: 32px; font-size: 13.5px; font-weight: 600; text-align: center; padding: 0 6px; }
.rl-grid thead th .muted { display: block; margin-top: 4px; font-weight: 400; }
.rl-grid thead th.rl-pw { text-align: left; color: var(--text-2); font-size: 13px; border-bottom-color: var(--rule); }
.rl-grid .rl-pw { text-align: left; width: 34%; min-width: 190px; position: sticky; left: 0; background: var(--card); z-index: 1; }
.rl-grid tbody .rl-pw b { display: block; font-weight: 600; }
.rl-grid .rl-pw small { display: block; font-size: 12.5px; font-weight: 400; color: var(--text-2); line-height: 1.4; }
.rl-grid td { text-align: center; }
.rl-grid tbody tr:hover td, .rl-grid tbody tr:hover th { background: var(--surface); }
.rl-grid td input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--btn-bg); cursor: pointer; }
.rl-grid td input:disabled { cursor: default; opacity: 0.6; }
.rl-grid tfoot td, .rl-grid tfoot th { border-top: 1px solid var(--rule); }
.rl-acts { display: inline-flex; gap: 4px; }
#rl-dirty { align-self: center; }
@media (max-width: 700px) {
  .rl-grid .rl-pw { min-width: 140px; width: auto; }
  .rl-grid .rl-pw small { font-size: 12px; }
  .rl-grid thead th { min-width: 92px; }
  .rl-grid [data-col=partner], .rl-grid .rl-partner { display: none; }   /* always everything; not needed on a small screen */
  .rl-grid th, .rl-grid td { padding: 8px 6px; }
}

/* ---------- Attendance (1.4.45) ---------- */
.at-tabs { margin-bottom: 16px; }
.at-n { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; background: var(--accent); color: var(--card); font-size: 11px; }
.at-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.at-grid .panel { margin: 0; }
.at-grid .panel h2 { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.at-cal, .at-chart { grid-row: span 2; }
.at-mark { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.at-mark .btn:last-child:nth-child(odd) { grid-column: 1 / -1; }
.at-mark .btn.on { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--text); }
.at-done { margin: 0; }
/* Kinds of day off (1.4.47): the same soft colours on screen and in the Excel register */
:root { --day-mix: 17%; }
:root[data-theme="graphite"], :root[data-theme="forest-gold"], :root[data-theme="dusk-teal"] { --day-mix: 24%; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) { --day-mix: 24%; } }
.k-week { --day: #D9534A; }
.k-hol { --day: #E8892B; }
.k-att { --day: #DDB91C; }
.at-sw[class*="k-"] { background: color-mix(in srgb, var(--day) calc(var(--day-mix) + 8%), var(--card)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--day) 60%, var(--card)); width: 12px; height: 12px; }
/* Attendance marks (1.5.52): their own colours, light and dark sets made and checked by tools/build_themes.py (--att-*). */
.s-present { --at: var(--att-p); }
.s-wfh { --at: var(--att-wh); }
.s-out_audit { --at: var(--att-oa); }
.s-half_day { --at: var(--att-hd); }
.s-casual_leave { --at: var(--att-cl); }
.s-sick_leave { --at: var(--att-sl); }
.s-study_leave { --at: var(--att-st); }
/* Worked on a day off: gold with a star (1.5.50) */
.at-c.offwork { background: linear-gradient(135deg, color-mix(in srgb, #E3B24A 40%, var(--card)), color-mix(in srgb, #E3B24A 62%, var(--card))) !important; border: 1.5px solid #C9972E !important; position: relative; }
.at-c.offwork span, .at-c.offwork b { color: var(--text) !important; }
.at-c.offwork::after { content: "★"; position: absolute; top: 2px; right: 5px; font-size: 10px; color: #A8741A; }
td.offwork { background: color-mix(in srgb, #E3B24A 45%, var(--card)) !important; box-shadow: inset 0 0 0 1.5px #C9972E; }
td.offwork span::after { content: " ★"; color: #A8741A; font-size: 9px; }
.at-sw.offwork { background: linear-gradient(135deg, #E3B24A, #C9972E); }
.s-off { --at: var(--text-3); }
/* Out audit: choosing the clients (1.4.53) */
.oa-q { width: 100%; margin-bottom: 8px; }
.oa-list { display: flex; flex-direction: column; max-height: 320px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.oa-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--rule-soft); cursor: pointer; font-size: 14px; }
.oa-row:first-child { border-top: 0; }
.oa-row:hover { background: var(--hover); }
.oa-row span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* "Other (not a client)" above the list, with the place typed (1.4.58) */
.oa-other { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; }
.oa-other .oa-row { grid-template-columns: auto minmax(0, 1fr); font-weight: 600; }
.oa-other .oa-place { width: auto; min-width: 0; align-self: stretch; box-sizing: border-box; margin: 0 12px 10px; }
.oa-place.hidden { display: none; }
.oa-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.at-lv-grid .at-oa { grid-column: 1 / -1; }
.at-chip { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: color-mix(in srgb, var(--at, var(--text-3)) 22%, var(--card)); color: var(--text); white-space: nowrap; }
.at-sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--at, var(--text-3)); margin-right: 6px; vertical-align: -1px; }
.at-sw.miss, .at-bars i.miss { background: transparent; box-shadow: inset 0 0 0 1.5px var(--accent); }
.at-bals { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.at-bals > div { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--rule-soft); border-radius: var(--radius); background: var(--surface); }
.at-bals .l { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.at-bals .v { font-size: 26px; font-weight: 600; line-height: 1.1; }
.at-bals .s { font-size: 12.5px; color: var(--text-2); }
/* Month calendar */
.at-cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.at-w { text-align: center; font-size: 11.5px; font-weight: 600; color: var(--text-3); padding-bottom: 2px; }
.at-c { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 48px; padding: 4px 0; border: 1px solid var(--rule-soft); border-radius: 8px; background: var(--card); color: var(--text); font: inherit; cursor: pointer; }
.at-c.out { border: 0; background: transparent; cursor: default; }
.at-c b { font-size: 13px; font-weight: 600; }
.at-c span { font-size: 11px; font-weight: 600; color: var(--text-2); min-height: 13px; }
.at-c[class*=" s-"] { background: color-mix(in srgb, var(--at) 26%, var(--card)); border-color: color-mix(in srgb, var(--at) 45%, var(--card)); }
.at-c[class*=" s-"] span { color: var(--text); }
.at-c.off { background: color-mix(in srgb, var(--day, var(--text-3)) var(--day-mix), var(--card)); border-color: color-mix(in srgb, var(--day, var(--text-3)) calc(var(--day-mix) * 2), var(--card)); }
.at-c.off span { color: var(--text-3); font-weight: 500; }
.at-c.miss { border: 1.5px dashed var(--accent); }
.at-c.miss span { color: var(--accent); }
.at-c.today { box-shadow: 0 0 0 2px var(--text); }
.at-c:hover:not(.out) { border-color: var(--text-3); }
.at-c:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.at-dot { position: absolute; top: 5px; right: 5px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.at-sum { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 12px 0 0; padding: 0; }
.at-sum b { margin-left: 4px; }
/* Six-month chart */
.at-bars { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.at-bars li { display: grid; grid-template-columns: 34px minmax(0, 1fr) 34px; gap: 10px; align-items: center; font-size: 13px; }
.at-bars .t { display: flex; gap: 2px; height: 16px; }
.at-bars i { display: block; height: 100%; border-radius: 3px; min-width: 3px; background: var(--at); }
.at-bars .v { text-align: right; font-weight: 600; }
/* Lists */
.at-list { list-style: none; margin: 0; padding: 0; }
.at-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 8px 0; border-top: 1px solid var(--rule-soft); font-size: 13.5px; }
.at-list li:first-child { border-top: 0; }
.at-list .d { min-width: 92px; }
.at-list .n { flex-basis: 100%; }
.at-state { font-size: 12px; font-weight: 600; color: var(--text-2); }
.at-state.approved { color: var(--chart); }
.at-state.rejected { color: var(--accent); }
.at-rqs { list-style: none; margin: 0; padding: 0; }
.at-rq { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--rule-soft); }
.at-rq:first-child { border-top: 0; }
.at-rq .m { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
/* My Day: the Mark attendance button (once marked it shows the mark with a tick) */
.md-att-btn { display: inline-flex; align-items: center; gap: 6px; }
.md-att-btn.done svg { color: var(--dot-done); }
@media (max-width: 600px) { .page-head .btn-row .btn.md-att-btn span, .page-head .btn-row .btn.md-att-btn svg + span { display: inline; } }
.md-att-pick .btn { min-height: 44px; }
/* Leave lists under the register */
.at-lv-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 18px; align-items: start; margin-top: 18px; }
.at-lv-grid .panel { margin: 0; }
.at-lv h2 { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.at-lv td { vertical-align: middle; }
.at-lv .nowrap { white-space: nowrap; }
@media (max-width: 1100px) { .at-lv-grid { grid-template-columns: minmax(0, 1fr); } }
/* Office register */
table.data.at-reg { width: auto; min-width: 100%; }
table.data.at-reg th, table.data.at-reg td { text-align: center; padding: 0; min-width: 27px; width: 27px; border-top: 1px solid var(--rule-soft); vertical-align: middle; }
table.data.at-reg thead th { border-top: 0; }
table.data.at-reg th.who { text-align: left; padding: 6px 10px 6px 0; min-width: 140px; width: auto; position: sticky; left: 0; background: var(--card); z-index: 2; font-weight: 600; white-space: nowrap; }
table.data.at-reg thead th { font-weight: 600; font-size: 12px; padding: 4px 0; }
table.data.at-reg thead th b { display: block; font-size: 12.5px; }
table.data.at-reg thead th small { display: block; color: var(--text-3); font-size: 11px; font-weight: 500; }
/* Days off down the whole column: soft red (Sunday, second Saturday), orange (office holiday), yellow (attendance holiday) */
table.data.at-reg th.off, table.data.at-reg td.off { background: color-mix(in srgb, var(--day, var(--text-3)) var(--day-mix), var(--card)); }
table.data.at-reg thead th.off small { color: var(--text-2); }
table.data.at-reg th.today { box-shadow: inset 0 -2px 0 var(--text); }
table.data.at-reg td button { display: flex; align-items: center; justify-content: center; width: 100%; height: 32px; padding: 0; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 11.5px; font-weight: 600; cursor: pointer; }
table.data.at-reg td button span { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 2px; border-radius: 6px; }
table.data.at-reg td[class*="s-"] button span { background: color-mix(in srgb, var(--at) 38%, var(--card)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--at) 55%, var(--card)); }
table.data.at-reg td.miss button { color: var(--accent); }
table.data.at-reg td button:hover { box-shadow: inset 0 0 0 1.5px var(--text-3); }
/* Totals: kept in view at the right while the days scroll (wide screens) */
table.data.at-reg td.t, table.data.at-reg th.t { min-width: 36px; width: 36px; padding: 0 2px; font-size: 12.5px; background: var(--card); }
table.data.at-reg .t.wd { border-left: 2px solid var(--rule); font-weight: 600; }
@media (min-width: 901px) {
  table.data.at-reg .t { position: sticky; right: calc(var(--r) * 36px); z-index: 1; }
}
.at-reg-foot { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.at-reg-foot p { margin: 0; }
.at-reg-foot .ch-legend { margin: 0; }
.at-hols { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--text-2); }
.at-hols li { display: inline-flex; align-items: center; gap: 4px; }
.at-hols .num { font-weight: 600; color: var(--text); }
.at-kinds { margin: 8px 0 0; }
/* Settings */
.at-roles { margin-bottom: 10px; gap: 6px 8px; }
.at-set input[type=number] { width: 76px; text-align: right; }
.at-set input[type=date] { width: 150px; }
.at-hform { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 6px; }
@media (max-width: 900px) {
  .at-grid { grid-template-columns: minmax(0, 1fr); }
  .at-cal, .at-chart { grid-row: auto; }
}
@media (max-width: 600px) {
  .at-c { min-height: 42px; }
  .at-rq { flex-direction: column; align-items: stretch; }
}

/* Firm overview (1.4.53) */
.ov-period { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ov-period select { min-width: 190px; }
.ov-dates { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ov-dates input[type=date] { width: 150px; }
.ov-story { border-left: 3px solid var(--main-btn-bg); border-radius: 0 var(--radius-lg) var(--radius-lg) 0; }
.ov-story h2 { margin-bottom: 8px; }
.ov-story p { margin: 0 0 6px; font-size: 15px; line-height: 1.6; color: var(--text); max-width: 920px; }
.ov-story p:last-child { margin-bottom: 0; }
.ov-late { color: var(--accent); }
.ov-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 18px 0; }
.ov-tile { display: flex; flex-direction: column; gap: 3px; padding: 14px 16px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); min-width: 0; }
.ov-tile .l { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.ov-tile .v { font-size: 26px; font-weight: 600; line-height: 1.15; }
.ov-tile .s { font-size: 12.5px; color: var(--text-2); display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.ov-tile.warn .v { color: var(--accent); }
.ov-d { display: inline-flex; padding: 1px 7px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.ov-d.good { background: color-mix(in srgb, var(--chart) 20%, var(--card)); color: var(--text); }
.ov-d.bad { background: var(--accent-soft); color: var(--accent); }
.ov-d.flat, .ov-d.up { background: var(--surface); color: var(--text-2); }
.ov-tips ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.ov-tips a { margin-left: 4px; }
.ov-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; align-items: start; }
.ov-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ov-grid > .panel { margin: 0; }
.ov-page > .panel, .ov-page > .ov-grid, .ov-page > .ov-tiles { margin: 0 0 18px; }
.ov-h3 { font-size: 13px; font-weight: 600; color: var(--text-2); margin: 16px 0 8px; }
/* charts */
.ov-chart svg { width: 100%; height: 170px; display: block; }
.ov-axis { stroke: var(--border); stroke-width: 1; }
.ov-tick { fill: var(--text-3); font-size: 11px; font-family: inherit; }
.ov-sa { fill: color-mix(in srgb, var(--text) 30%, var(--card)); background: color-mix(in srgb, var(--text) 30%, var(--card)); }
.ov-sb { fill: var(--chart); background: var(--chart); }
.ov-leg { margin: 8px 0 0; }
.ov-sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.ov-bridge { display: flex; flex-direction: column; gap: 8px; }
.ov-br { display: grid; grid-template-columns: 150px minmax(0, 1fr) 46px; gap: 10px; align-items: center; font-size: 13px; }
.ov-br .t { position: relative; height: 18px; background: var(--surface); border-radius: 4px; }
.ov-br .t i { position: absolute; top: 0; bottom: 0; border-radius: 4px; }
.ov-br.base .t i { background: color-mix(in srgb, var(--text) 45%, var(--card)); }
.ov-br.up .t i { background: color-mix(in srgb, var(--text) 25%, var(--card)); }
.ov-br.down .t i { background: var(--chart); }
.ov-br b { text-align: right; }
.ov-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.ov-facts.two { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 0; }
.ov-facts > div { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; background: var(--surface); border-radius: var(--radius); }
.ov-facts b { font-size: 20px; font-weight: 600; }
.ov-facts span { font-size: 12.5px; color: var(--text-2); }
.ov-pipe { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ov-pipe > * { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); text-decoration: none; background: var(--card); }
.ov-pipe a:hover { border-color: var(--text-3); background: var(--hover); }
.ov-pipe .l { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.ov-pipe b { font-size: 20px; font-weight: 600; }
.ov-pipe .s { font-size: 12px; color: var(--text-2); }
.ov-age { display: flex; height: 14px; border-radius: 4px; overflow: hidden; background: var(--surface); gap: 2px; }
.ov-age i, .ov-age-l .ov-sw { display: block; }
.a1 { background: var(--chart); } .a2 { background: color-mix(in srgb, var(--dot-wait) 60%, var(--card)); }
.a3 { background: var(--dot-wait); } .a4 { background: var(--accent); }
.ov-age-l { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; font-size: 12.5px; }
.ov-age-l li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 6px; align-items: center; }
.ov-age-l b { grid-column: 2; font-weight: 600; }
.ov-hb { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.ov-hb li { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 64px; gap: 8px; align-items: center; font-size: 13px; }
.ov-hb li[data-href] { cursor: pointer; border-radius: 4px; }
.ov-hb li[data-href]:hover .l { text-decoration: underline; }
.ov-hb .l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-hb .t { height: 10px; background: var(--surface); border-radius: 3px; overflow: hidden; }
.ov-hb .t i { display: block; height: 100%; background: color-mix(in srgb, var(--text) 40%, var(--card)); border-radius: 3px; }
.ov-hb.late .t i { background: var(--accent); }
.ov-hb b { text-align: right; font-weight: 600; }
.ov-mix, .ov-load, .ov-days { display: flex; height: 10px; min-width: 120px; background: var(--surface); border-radius: 3px; overflow: hidden; }
.ov-mix i, .ov-load i, .ov-days i { display: block; height: 100%; }
.ov-mix .c, .ov-sw.c { background: var(--chart); }
.ov-mix .o, .ov-load .o, .ov-sw.o { background: var(--accent); }
.ov-mix .p, .ov-load .p, .ov-sw.p { background: color-mix(in srgb, var(--text) 30%, var(--card)); }
.ov-days i { background: var(--at, var(--text-3)); }
.ov-days i.miss { background: color-mix(in srgb, var(--accent) 45%, var(--card)); }
.ov-areas td, .ov-people td, .ov-att td { vertical-align: middle; }
.ov-areas .ov-svc td { color: var(--text-2); font-size: 13px; padding-top: 4px; padding-bottom: 4px; }
.ov-areas .ov-svc td:first-child { padding-left: 18px; }
.ov-x { font-weight: 600; text-decoration: none; }
.ov-x::after { content: ' ▸'; color: var(--text-3); font-size: 11px; }
.ov-x[aria-expanded="true"]::after { content: ' ▾'; }
.ov-mix-h, .ov-load-h { min-width: 130px; }
.ov-list { list-style: none; margin: 0; padding: 0; }
.ov-list li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-top: 1px solid var(--rule-soft); font-size: 13.5px; cursor: pointer; }
.ov-list li:first-child { border-top: 0; }
.ov-list li:hover span:first-child { text-decoration: underline; }
@media (max-width: 1100px) { .ov-grid.three { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) { .ov-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) {
  .ov-period, .ov-period select { width: 100%; }
  .ov-br { grid-template-columns: 112px minmax(0, 1fr) 38px; font-size: 12.5px; }
  .ov-pipe { grid-template-columns: minmax(0, 1fr); }
  .ov-age-l { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ov-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ov-tile .v { font-size: 22px; }
}

/* Clients table: Code | Client | PAN | GST | Contact person | Phone | Pending tasks (1.4.54) */
table.cl-tbl th, table.cl-tbl td { padding-left: 8px; padding-right: 8px; }
table.cl-tbl th:first-child, table.cl-tbl td:first-child { padding-left: 14px; }
table.cl-tbl th:last-child, table.cl-tbl td:last-child { padding-right: 14px; }
table.cl-tbl td:nth-child(2) { min-width: 170px; }
table.cl-tbl .cl-id { font-size: 12.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.cl-tbl .cl-cp { font-size: 13px; max-width: 150px; overflow-wrap: anywhere; }
table.cl-tbl th.cl-pend { white-space: normal; width: 62px; line-height: 1.25; }
@media (max-width: 760px) { table.cl-tbl td:nth-child(2) { min-width: 0; } }

/* Live updates (1.4.55): the note, and changed rows glowing for a moment */
.live-note { gap: 6px 12px; }
.live-note .live-wait { color: #C9CFC9; }
@media (max-width: 600px) { .live-note { top: calc(62px + env(safe-area-inset-top)); width: calc(100vw - 32px); justify-content: space-between; } .live-note .live-wait { display: none; } }
@keyframes live-flash { 0%, 35% { background-color: color-mix(in srgb, var(--chart, #6E7F63) 22%, transparent); } 100% { background-color: transparent; } }
.live-flash, tr.live-flash > td { animation: live-flash 2.4s ease-out; }
tr.live-flash { animation: none; }
@media (prefers-reduced-motion: reduce) { .live-flash, tr.live-flash > td { animation-duration: 0.01s; } }


/* The ITR desk (1.4.57, update 33) */
.itr-y { flex-direction: row; align-items: center; gap: 8px; }
.itr-y > span { white-space: nowrap; }
.itr-y select { width: auto; min-width: 190px; }
a.ov-tile { text-decoration: none; color: inherit; }
a.ov-tile:hover { border-color: var(--text-3); }
.itr-stages .t i.itr-bar { background: var(--dot-none); }
.itr-stages .t i.itr-bar.awaiting_client { background: var(--dot-wait); }
.itr-stages .t i.itr-bar.in_progress { background: var(--dot-prog); }
.itr-stages .t i.itr-bar.under_review { background: var(--dot-review); }
.itr-stages .t i.itr-bar.completed { background: var(--dot-done); }
.itr-dues, .itr-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.itr-dues li { display: grid; grid-template-columns: minmax(0, 1.3fr) auto minmax(0, 1fr) 40px; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--rule-soft); font-size: 13.5px; }
.itr-dues li:first-child, .itr-list li:first-child { border-top: 0; }
.itr-dues .d { font-variant-numeric: tabular-nums; white-space: nowrap; }
.itr-dues b, .itr-list b { text-align: right; }
.itr-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 7px 0; border-top: 1px solid var(--rule-soft); font-size: 13.5px; }
.itr-list li > :last-child { white-space: nowrap; font-size: 12.5px; }
.due-soon { color: var(--accent); }
.itr-chg { font-size: 11px; vertical-align: 1px; }
.itr-chg.up { color: var(--chart); }
.itr-chg.down { color: var(--accent); }
table.itr-years tr.itr-sub td { border-top-style: dashed; }
table.itr-years td:first-child { white-space: nowrap; }
.itr-fams { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--rule-soft); }
.itr-fams p { margin: 4px 0; }
.cl-tags-line { margin: 10px 0 0; }
.tag.itr-tag { font-size: 11px; font-weight: 600; letter-spacing: 0.03em; }
/* Families in the ITR client form */
.fam-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto auto; gap: 8px; align-items: center; margin-top: 6px; }
.fam-row [data-newfam] { grid-column: 1 / -1; grid-row: 2; }
.fam-main { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--text-2); white-space: nowrap; }
@media (max-width: 600px) { .fam-row { grid-template-columns: minmax(0, 1fr) auto auto; } .fam-row [data-rel] { grid-column: 1 / -1; grid-row: 3; } }
/* Tags field */
.tags-box { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: var(--ctl-h); padding: 4px 8px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
.tags-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.tags-chips { display: contents; }
.tag-chip { display: inline-flex; align-items: center; gap: 2px; height: 26px; padding: 0 4px 0 10px; border-radius: 999px; background: color-mix(in srgb, var(--text) 8%, transparent); font-size: 13px; font-weight: 500; color: var(--text); }
.tag-chip button { border: 0; background: transparent; color: var(--text-2); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 5px; border-radius: 999px; }
.tag-chip button:hover { color: var(--text); background: color-mix(in srgb, var(--text) 10%, transparent); }
.tags-box .tags-in { flex: 1; min-width: 140px; border: 0 !important; box-shadow: none !important; height: 30px; padding: 0 4px; background: transparent; }
.tags-sugg { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; font-weight: 400; }
.tag-sg { border: 0; border-radius: 999px; padding: 3px 10px; background: color-mix(in srgb, var(--text) 6%, transparent); color: var(--text); font-size: 12.5px; cursor: pointer; }
.tag-sg:hover { background: color-mix(in srgb, var(--text) 12%, transparent); }
/* WhatsApp messages */
.wa-list { display: flex; flex-direction: column; gap: 12px; }
.wa-msg { padding: 12px 14px; border-radius: var(--radius-lg); background: var(--surface); }
.wa-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.wa-text { margin: 8px 0 0; white-space: pre-wrap; font-size: 13.5px; color: var(--text-2); }
.imp-errs { margin: 8px 0 0; padding-left: 18px; color: var(--text-2); }
@media (max-width: 600px) {
  .itr-y select { min-width: 0; width: 100%; }
  .itr-y { flex: 1 1 100%; }
  .itr-dues li { grid-template-columns: minmax(0, 1fr) auto 36px; }
  .itr-dues li > :nth-child(3) { grid-column: 1 / -1; grid-row: 2; font-size: 12px; }
}
table.data .sub.show-sm { display: none; }
@media (max-width: 600px) { table.data .sub.show-sm { display: block; } }
/* A dialog with a line above its title (the task window, WhatsApp messages): keep the foot in view */
dialog:not(.drawer):has(.d-kicker) .d-body { max-height: calc(100vh - 196px); }
@media (max-width: 600px) {
  table.itr-reg .st-select, table.itr-ntc .st-select { max-width: 128px; }
  table.itr-reg td:nth-child(2) { white-space: normal; }
}

/* ------------------------------------------------------------------
   Returns (1.4.59): one dashboard per group of recurring returns
   ------------------------------------------------------------------ */
.rg-nav { display: flex; align-items: center; gap: 8px; }
.rg-nav .btn { min-width: 36px; padding: 0 10px; font-size: 16px; }
.rg-mon { min-width: 84px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.rg-tabs { max-width: 100%; overflow-x: auto; scrollbar-width: none; margin: 0 0 14px; }
.rg-tabs::-webkit-scrollbar { display: none; }
.rg-tabs button { white-space: nowrap; }
.rg-n { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 4px; border-radius: 999px; background: var(--accent); color: var(--bg); font-size: 11px; font-weight: 700; }
.rg-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 0 0 14px; }
.rg-t { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 14px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); cursor: pointer; text-align: left; font: inherit; }
.rg-t .v { font-size: 24px; font-weight: 650; line-height: 1.1; }
.rg-t .l { font-size: 12.5px; color: var(--text-2); }
.rg-t:hover { background: var(--hover); }
.rg-t.warn .v { color: var(--accent); }
.rg-t.on { box-shadow: inset 0 0 0 2px var(--text); }
.rg-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 0 0 10px; }
.rg-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rg-chips .chip { padding: 5px 12px; border-radius: 999px; background: var(--surface); color: var(--text-2); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; border: 0; }
.rg-chips .chip:hover { color: var(--text); }
.rg-chips .chip.on { background: var(--text); color: var(--bg); }
.rg-tools .rg-find { width: 220px; max-width: 100%; flex: 0 0 auto; margin-left: auto; }
.rg-wrap { overflow-x: auto; }
table.rg { table-layout: fixed; }
table.rg th.rg-c, table.rg td.rg-c { width: 30%; }
table.rg th { white-space: nowrap; }
table.rg th.rg-today { color: var(--text); }
table.rg th.rg-today::after { content: ''; display: block; width: 18px; height: 2px; margin-top: 3px; background: var(--accent); border-radius: 2px; }
table.rg td { vertical-align: top; }
table.rg td.rg-c a { color: var(--text); text-decoration: none; font-weight: 500; }
table.rg td.rg-c a:hover { text-decoration: underline; }
table.rg td.rg-c .sub { display: block; }
.rg-cell { line-height: 0; }
.rg-p { display: inline-flex; align-items: center; gap: 4px; height: 26px; margin: 0 4px 4px 0; padding: 0 8px; border: 1px solid var(--border); border-radius: 7px; background: transparent; color: var(--text-2); font: inherit; font-size: 12px; font-weight: 500; line-height: 1; cursor: pointer; white-space: nowrap; }
.rg-p b { font-size: 11px; font-weight: 700; }
.rg-p:hover { filter: brightness(0.97); box-shadow: var(--shadow); }
.rg-p.s-done { background: var(--chart); border-color: var(--chart); color: #FFFFFF; }
.rg-p.s-late { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.rg-p.s-open, .rg-p.s-wait { border: 1.5px solid var(--text); color: var(--text); }
.rg-p.s-come { color: var(--text-2); }
.rg-p.s-wait { border-color: var(--dot-wait); }
.rg-p.s-miss { border: 1.5px dashed var(--accent); color: var(--accent); background: transparent; }
.rg-p.s-na { border-style: dashed; opacity: 0.5; }
.rg-none { display: inline-block; width: 16px; height: 2px; margin: 12px 0; background: var(--border); border-radius: 2px; }
.rg-key { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 0 0; }
.rg-key .k { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; margin-right: 4px; border-radius: 5px; border: 1px solid var(--border); font-size: 11px; }
.rg-key .k.s-done { background: var(--chart); border-color: var(--chart); color: #FFFFFF; }
.rg-key .k.s-late { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.rg-key .k.s-open { border: 1.5px solid var(--text); color: var(--text); }
.rg-key .k.s-miss { border: 1.5px dashed var(--accent); color: var(--accent); }
.rg-key .k.s-na { border-style: dashed; opacity: 0.6; }
table.rg .rg-phone { display: none; }
@media (max-width: 760px) {
  /* Phones: one month at a time (the arrows move it), plus Earlier */
  table.rg th.rg-other, table.rg td.rg-other { display: none; }
  table.rg .rg-desk { display: none; }
  table.rg th.rg-phone, table.rg td.rg-phone { display: table-cell; }
  table.rg th.rg-c, table.rg td.rg-c { width: 40%; }
  .rg-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rg-tools .rg-find { width: 100%; margin-left: 0; }
  .rg-tools { flex-direction: column; align-items: stretch; }
}

/* Recurring work: the returns this client needs (update 35) */
.sub-need { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 4px 0 0; }
.sub-need label { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; }

/* Inbox: an attendance request, approved or rejected there (1.4.60) */
.ib-att { margin: 14px 0 0; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
.ib-att-facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 12px; font-size: 14px; }
.ib-att-facts dt { color: var(--text-2); }
.ib-att-facts dd { margin: 0; overflow-wrap: anywhere; }
.ib-att .field { margin: 0 0 10px; }
.ib-att-done { margin: 0; font-weight: 600; }
.ib-att-done.ok { color: var(--chart); }
.ib-att-done.no { color: var(--accent); }

/* Tasks: the period filter's own dates (1.5.0) */
.f-custom { display: flex; gap: 12px; flex-wrap: wrap; }
.f-custom.hidden { display: none; }
.f-custom .field input { width: 150px; }

/* Settings → Firm: branches (1.5.0) */
.br-list { display: flex; flex-direction: column; gap: 12px; }
.br-list:empty { display: none; }
.br-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
.br-row .br-addr { grid-column: 1 / -1; }
.br-row .br-del { justify-self: start; grid-column: 1 / -1; }
@media (max-width: 760px) { .br-row { grid-template-columns: minmax(0, 1fr); } }
.fd-offices { margin: 0 0 10px; }

/* Client page: tabs and the Billing tab (1.5.0) */
.cl-tabs { max-width: 100%; overflow-x: auto; scrollbar-width: none; margin: 22px 0 16px; }
.cl-tabs::-webkit-scrollbar { display: none; }
.cl-tabs button { white-space: nowrap; }
.cl-tabs .cnt { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 4px; border-radius: 999px; background: var(--surface); color: var(--text-2); font-size: 11px; font-weight: 700; }
.cl-tabs .cnt.late { background: var(--accent); color: var(--bg); }
.cl-pane.hidden { display: none; }
.cl-pane > .section-head:first-child, .cl-pane > .panel:first-child { margin-top: 0 !important; }
.cl-addwork { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cl-addwork h2 { margin: 0 0 2px; font-size: 16px; }
.cl-addwork p { margin: 0; }
.cl-bks { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 0 0 14px; }
.cl-bk { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
.cl-bk .v { font-size: 22px; font-weight: 650; }
.cl-bk .l { font-size: 12.5px; color: var(--text-2); }
.cl-bk.warn .v { color: var(--accent); }
.cl-bchart h3, .cl-blists h3 { margin: 0 0 10px; font-size: 14px; }
.cl-bars { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; height: 120px; align-items: end; }
.cl-bars .b { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.cl-bars .b i { display: block; width: 100%; max-width: 26px; min-height: 2px; background: var(--chart); border-radius: 4px 4px 0 0; }
.cl-bars .b span { font-size: 11px; color: var(--text-3, var(--text-2)); }
.cl-blists { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin: 16px 0 10px; }

/* ------------------------------------------------------------------
   Firm overview (1.5.0): period chips, the Area, summary cards
   ------------------------------------------------------------------ */
.ov-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 16px; }
.ov-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; max-width: 100%; padding: 2px 0; }
.ov-chips::-webkit-scrollbar { display: none; }
.ov-chip { flex: 0 0 auto; padding: 7px 14px; border: 0; border-radius: 999px; background: var(--surface); color: var(--text-2); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.ov-chip:hover { color: var(--text); }
.ov-chip.on { background: var(--text); color: var(--bg); }
.ov-area select { min-width: 180px; }
.ov-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; margin: 0 0 18px; }
.ov-cards > .ov-card, .ov-cards > .ov-card + .ov-card { margin: 0; display: flex; flex-direction: column; }
.ov-card header { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 0 12px; }
.ov-card h2 { margin: 0; font-size: 15px; }
.ov-figs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.ov-fig { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ov-fig .l { font-size: 12px; color: var(--text-2); }
.ov-fig .v { font-size: 22px; font-weight: 650; line-height: 1.15; }
.ov-fig .v .of { font-size: 13px; font-weight: 500; color: var(--text-2); }
.ov-fig .d { font-size: 12px; }
.ov-fig.late .v { color: var(--accent); }
.ov-fig.warn .v { color: var(--dot-wait); }
.ov-note { margin: 12px 0 0; }
.ov-more { margin: 4px 0 0; }
.ov-more > summary { cursor: pointer; font-weight: 600; padding: 10px 0; color: var(--text-2); }
.ov-more[open] > summary { margin-bottom: 8px; }
.io-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 6px; }
@media (max-width: 760px) {
  .ov-cards { grid-template-columns: minmax(0, 1fr); }
  .ov-area, .ov-area select { width: 100%; }
}

/* The custom range calendar (slides up on phones) */
.rs-dialog { width: min(640px, calc(100vw - 24px)); }
.rs { position: relative; }
.rs-nav { display: flex; justify-content: space-between; margin: 0 0 6px; }
.rs-ms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.rs-t { font-weight: 600; text-align: center; margin: 0 0 8px; }
.rs-g { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.rs-h { font-size: 11px; color: var(--text-2); text-align: center; padding: 2px 0 6px; }
.rs-d { height: 36px; border: 0; border-radius: 8px; background: transparent; color: var(--text); font: inherit; font-size: 13.5px; cursor: pointer; font-variant-numeric: tabular-nums; }
.rs-d:hover { background: var(--hover); }
.rs-d.today { box-shadow: inset 0 0 0 1px var(--border); }
.rs-d.in { background: var(--surface); border-radius: 0; }
.rs-d.end { background: var(--text); color: var(--bg); font-weight: 650; }
.rs-pick { margin: 10px 0 0; }
@media (max-width: 600px) {
  .rs-ms .rs-m + .rs-m { display: none; }
  .rs-ms { grid-template-columns: minmax(0, 1fr); }
  dialog.rs-dialog { margin: auto auto 0; width: 100vw; max-width: 100vw; border-radius: 18px 18px 0 0; }
}

/* Retainers (1.5.0) */
.rt-kind { border: 0; }
.rt-kind label { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: calc(var(--radius) - 2px); cursor: pointer; font-size: 14px; color: var(--muted); }
.rt-kind label:has(input:checked) { background: var(--card); color: var(--text); box-shadow: var(--shadow); }
.rt-kind input { margin: 0; }
.rt-fee { font-variant-numeric: tabular-nums; color: var(--text); }
.rt-hist { margin: 8px 0 0; color: var(--muted); font-variant-numeric: tabular-nums; }
.rt-card.ended { opacity: .75; }
.rt-prev td.num, .rt-table td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 640px) {
  .cl-tabs { display: flex; flex-wrap: wrap; overflow: visible; }
  .cl-tabs button { flex: 1 1 auto; }
}

/* Retainer plans and covered services (1.5.1) */
.rt-tabs { margin: 0 0 16px; }
.rt-tag { background: var(--surface); color: var(--text-2); }
.rt-tax { margin: 2px 0 0; }
.rt-scope { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 6px 24px; margin: 10px 0 0; }
.rt-scope h4 { margin: 0 0 4px; font-size: 12px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; }
.rt-scope ul { margin: 0; padding: 0; list-style: none; font-size: 13.5px; }
.rt-scope li { padding: 2px 0 2px 20px; position: relative; }
.rt-ticks li::before { content: '✓'; position: absolute; left: 2px; color: var(--ok, var(--text-2)); font-weight: 700; }
.rt-not li { color: var(--text-2); }
.rt-not li::before { content: '–'; position: absolute; left: 4px; }
.rt-plans .sub-card + .sub-card { margin-top: 12px; }
.rt-svc-q { margin: 2px 0 6px; }
.rt-svcs { max-height: 280px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 12px 10px; background: var(--card); }
.rt-grp { border: 0; margin: 6px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0 14px; }
.rt-grp legend { font-size: 12px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; padding: 6px 0 2px; }
.rt-svc { display: flex; align-items: flex-start; gap: 8px; padding: 4px 0; font-size: 13.5px; color: var(--text); cursor: pointer; }
.rt-svc input { margin-top: 2px; flex: none; }
.rt-cover { background: var(--surface); border-radius: var(--radius); padding: 10px 12px; }
.rt-cover .field.check { margin-top: 6px; }
.cl-taxline { margin: 12px 0 4px; font-variant-numeric: tabular-nums; }

/* Bills (1.5.2) */
.bill-chip { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; line-height: 18px; white-space: nowrap; background: var(--surface); color: var(--text-2); vertical-align: 1px; }
.bill-chip.s-to_invoice { background: color-mix(in srgb, var(--dot-review) 10%, transparent); color: var(--text); }
.bill-chip.s-due { background: color-mix(in srgb, var(--dot-wait) 16%, transparent); color: var(--text); }
.bill-chip.s-part_received { background: color-mix(in srgb, var(--dot-wait) 22%, transparent); color: var(--text); }
.bill-chip.s-overdue { background: var(--accent-soft); color: var(--accent); }
.bill-chip.s-received { background: color-mix(in srgb, var(--dot-done) 18%, transparent); color: var(--text); }
.bill-chip.s-waived, .bill-chip.s-cancelled, .bill-chip.s-covered { background: var(--surface); color: var(--text-2); font-weight: 500; }
.bill-tabs { margin: 0 0 14px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.bill-tabs button { white-space: nowrap; }
.bill-tabs .cnt { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 4px; border-radius: 999px; background: var(--surface); color: var(--text-2); font-size: 11px; font-weight: 700; }
.bill-tabs .cnt.late { background: var(--accent); color: var(--bg); }
.bill-filters { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 12px; }
.bill-filters .field { min-width: 180px; flex: 1 1 180px; max-width: 320px; }
.bill-sum { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 0 0 12px; color: var(--text-2); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.bill-sum b { color: var(--text); }
.bill-bulk { display: flex; align-items: center; gap: 12px; margin: 0 0 10px; }
.bill-table td.num, .bp-table td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.bp-table input { width: 110px; text-align: right; }
.bill-head span { color: var(--text-2); }
.bill-glance { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.bill-glance a { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: var(--radius); background: var(--surface); color: var(--text-2); text-decoration: none; font-size: 13px; }
.bill-glance a b { font-size: 20px; color: var(--text); }
.bill-glance a span { color: var(--text); font-weight: 600; }
.bill-glance a.late b, .bill-glance a.late span { color: var(--accent); }
.bill-glance a:hover { background: var(--hover); }
.md-bills { margin: 0 0 16px; }
@media (max-width: 640px) {
  .bill-glance { grid-template-columns: minmax(0, 1fr); }
  .bill-filters .field { max-width: none; }
  .bp-table input { width: 84px; }
}

/* Firm overview, redesigned (1.5.4): filters, four cards, summary and
   needs attention, four sections with small SVG charts. Evergreen (the ink)
   for the main series, Cardamom for the second, a soft grey for context,
   Laterite only for problems. */
.ov-page, .ovp-dialog {
  --ov-1: color-mix(in srgb, var(--text) 86%, var(--card));
  --ov-2: var(--chart);
  --ov-3: color-mix(in srgb, var(--text) 28%, var(--card));
}
.ov-svg .ov-tick { font-size: 12.5px; }
.ov-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 16px; }
/* The period button stands out: dark on light themes, light on dark ones (1.5.7). */
.ov-pbtn { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 7px 14px; border: 0; border-radius: 10px; background: var(--text); color: var(--bg); font: inherit; font-size: 14px; cursor: pointer; max-width: 100%; }
.ov-pbtn:hover { background: color-mix(in srgb, var(--text) 86%, var(--bg)); }
.ov-pbtn .k { font-weight: 600; white-space: nowrap; }
.ov-pbtn .r { color: color-mix(in srgb, var(--bg) 78%, var(--text)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.ov-pbtn .c { color: color-mix(in srgb, var(--bg) 70%, var(--text)); font-size: 11px; }
.ov-sel select { min-width: 170px; }
.ov-wchips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ov-wchip { display: inline-flex; align-items: center; gap: 2px; padding: 3px 3px 3px 11px; border-radius: 999px; background: var(--surface); font-size: 13px; font-weight: 500; }
.ov-wchip button { width: 24px; height: 24px; border: 0; border-radius: 50%; background: transparent; color: var(--text-2); font-size: 16px; line-height: 1; cursor: pointer; }
.ov-wchip button:hover { background: var(--hover); color: var(--text); }
.ov-page .ov-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ov-page .ov-card { padding-bottom: 14px; }
.ov-page .ov-fig .v { font-size: 20px; }
.ov-wide-note { grid-column: 1 / -1; margin: 0; }
.ov-sparkrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 12px; }
.ov-card .ov-sparkrow { border-top: 1px solid var(--border); margin-top: auto; }   /* (1.5.11) the 12-month lines line up at the bottom of every card */
.ov-card .ov-figs { margin-bottom: 14px; }
.ov-sparkrow.big { margin: 12px 0 4px; padding-top: 0; }
.ov-spark { width: 120px; height: 30px; flex: 0 0 auto; overflow: visible; }
.ov-spark polyline { fill: none; stroke: var(--ov-1); stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.ov-spark circle { fill: var(--ov-1); }
.ov-row2 { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 28px; margin: 0 0 18px; }
.ov-row2 h2 { font-size: 15px; margin: 0 0 10px; }
.ov-sum p { margin: 0 0 7px; font-size: 14.5px; line-height: 1.6; color: var(--text); }
.ov-sum p:last-child { margin-bottom: 0; }
.ov-need { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; counter-reset: need; }
.ov-need li a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius); background: var(--surface); color: var(--text); text-decoration: none; font-size: 14px; line-height: 1.4; }
.ov-need li a::before { counter-increment: need; content: counter(need); flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11.5px; font-weight: 650; background: var(--card); color: var(--text-2); }
.ov-need li:first-child a::before { background: var(--accent); color: var(--card); }
.ov-need li a:hover { background: var(--hover); }
.ov-need .go { margin-left: auto; color: var(--text-3); font-size: 18px; }
.ov-calm { margin: 0; }
.ov-secbar { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 4px 0 14px; padding: 2px 0; }
.ov-secbar::-webkit-scrollbar { display: none; }
.ov-secbar button { flex: 0 0 auto; padding: 7px 14px; border: 0; border-radius: 999px; background: var(--surface); color: var(--text-2); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.ov-secbar button:hover { color: var(--text); background: var(--hover); }
.ov-sec { margin: 0 0 18px; scroll-margin-top: 70px; }
.ov-sec > summary { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; cursor: pointer; list-style: none; padding: 8px 0 12px; }
.ov-sec > summary::-webkit-details-marker { display: none; }
.ov-sec > summary h2 { margin: 0; font-size: 17px; }
.ov-sec > summary h2::before { content: '▸'; display: inline-block; width: 16px; color: var(--text-3); font-size: 12px; transition: transform .15s; }
.ov-sec[open] > summary h2::before { transform: rotate(90deg); }
.ov-sg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.ov-sg > .panel, .ov-sg > .panel + .panel { margin: 0; min-width: 0; }
.ov-span { grid-column: 1 / -1; }
.ov-p h3 { font-size: 15px; font-weight: 600; margin: 0 0 14px; line-height: 1.35; }
.ov-p[data-href] { cursor: pointer; }
.ov-h4 { font-size: 12.5px; font-weight: 600; color: var(--text-2); margin: 16px 0 8px; }
.ov-cap { margin: 10px 0 0; }
.ov-foot { margin: 6px 0 0; }
.ov-svg { width: 100%; height: auto; display: block; overflow: visible; }
.ov-grid-l { stroke: var(--border); stroke-width: 1; stroke-dasharray: 2 3; }
.ov-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ov-line.ov-l1 { stroke: var(--ov-1); }
.ov-line.ov-l2 { stroke: var(--ov-2); }
.ov-pt { stroke: var(--card); stroke-width: 1.5; }
.ov-pt.ov-l1 { fill: var(--ov-1); }
.ov-pt.ov-l2 { fill: var(--ov-2); }
.ov-line.ov-recv { stroke: var(--text-2); stroke-dasharray: 4 3; stroke-width: 1.8; }
.ov-pt.ov-recv { fill: var(--text-2); }
.ov-end { fill: var(--text); font-size: 13px; font-weight: 600; font-family: inherit; }
.ov-lab { fill: var(--text); font-size: 12.5px; font-family: inherit; }
.ov-hit { fill: transparent; cursor: pointer; }
.ov-hit:hover, .ov-hit:focus { fill: color-mix(in srgb, var(--text) 6%, transparent); outline: none; }
.ov-c1 { fill: var(--ov-1); background: var(--ov-1); }
.ov-c2 { fill: var(--ov-2); background: var(--ov-2); }
.ov-c3 { fill: var(--ov-3); background: var(--ov-3); }
.ov-a1 { background: color-mix(in srgb, var(--text) 22%, var(--card)); }
.ov-a2 { background: color-mix(in srgb, var(--text) 42%, var(--card)); }
.ov-a3 { background: color-mix(in srgb, var(--text) 64%, var(--card)); }
.ov-a4 { background: var(--accent); }
.ov-sw.ov-line-sw { height: 0; width: 14px; border-top: 2px dashed var(--text-2); border-radius: 0; }
.ov-dot { fill: var(--ov-1); stroke: var(--card); stroke-width: 2; }
.ov-dotg { cursor: pointer; }
.ov-dotg:not(.named) .ov-dot { fill: var(--ov-2); }
.ov-dotg.low .ov-dot { fill: var(--accent); }
.ov-dot-hit { fill: transparent; }
.ov-dotg:hover .ov-dot, .ov-dotg:focus .ov-dot { stroke: var(--text); }
.ov-dotg:focus { outline: none; }
.ov-avg { stroke: var(--text-3); stroke-width: 1.5; stroke-dasharray: 5 4; }
.ov-narrow { display: none; }
.ov-parts { display: flex; height: 16px; gap: 2px; border-radius: 4px; overflow: hidden; background: var(--surface); }
.ov-parts i { display: block; height: 100%; }
.ov-parts i[data-href] { cursor: pointer; }
.ov-parts-l { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px 16px; font-size: 13px; }
.ov-parts-l li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 1px 7px; align-items: center; }
.ov-parts-l li[data-href] { cursor: pointer; }
.ov-parts-l li[data-href]:hover span:not(.muted) { text-decoration: underline; }
.ov-parts-l b { grid-column: 2; font-weight: 600; }
.ov-parts-l .muted { grid-column: 3; grid-row: 1 / span 2; font-size: 12px; }
.ov-tb { display: inline-flex; align-items: center; gap: 8px; min-width: 150px; width: 100%; }
.ov-tb .t { position: relative; flex: 1; height: 8px; background: var(--surface); border-radius: 4px; }
.ov-tb .t i { display: block; height: 100%; background: var(--ov-2); border-radius: 4px; }
.ov-tb .t b { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--text); border-radius: 1px; }
.ov-tb.low .t i { background: var(--accent); }
.ov-tb .num { min-width: 38px; text-align: right; font-weight: 600; font-size: 13px; }
.ov-wf { display: flex; flex-direction: column; gap: 8px; }
.ov-wf-r { display: grid; grid-template-columns: 140px minmax(0, 1fr) 44px; gap: 10px; align-items: center; font-size: 13px; }
.ov-wf-r .t { position: relative; height: 20px; background: var(--surface); border-radius: 4px; }
.ov-wf-r .t i { position: absolute; top: 0; bottom: 0; border-radius: 4px; }
.ov-wf-r.base .t i { background: var(--ov-1); }
.ov-wf-r.up .t i { background: var(--ov-3); }
.ov-wf-r.down .t i { background: var(--ov-2); }
.ov-wf-r.out .t i { background: color-mix(in srgb, var(--text) 12%, var(--card)); }
.ov-wf-r b { text-align: right; font-weight: 600; }
.ov-prog { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.ov-prog li { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) 72px; gap: 10px; align-items: center; font-size: 13px; }
.ov-prog li[data-href] { cursor: pointer; }
.ov-prog li[data-href]:hover .l { text-decoration: underline; }
.ov-prog .l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-prog .t { display: flex; height: 10px; gap: 2px; background: var(--ov-3); border-radius: 3px; overflow: hidden; }
.ov-prog .t i { display: block; height: 100%; }
.ov-prog .t i.c, .ov-page .ov-sw.c, .ov-page .ov-mix .c { background: var(--ov-1); }
.ov-prog .t i.o, .ov-page .ov-sw.o { background: var(--accent); }
.ov-page .ov-sw.p, .ov-page .ov-mix .p { background: var(--ov-3); }
.ov-page .ov-mix { gap: 2px; }
.ov-prog b { text-align: right; font-weight: 600; }
.ov-prog .of { color: var(--text-2); font-weight: 500; }
.ov-tbl td { vertical-align: middle; }
.ov-barh { min-width: 150px; }
.ov-cellbar { position: relative; white-space: nowrap; }
.ov-toptbl td:first-child { min-width: 150px; }
.ov-cellbar .b { position: absolute; right: 8px; bottom: 4px; height: 3px; max-width: calc(100% - 16px); background: color-mix(in srgb, var(--chart) 70%, transparent); border-radius: 2px; }
.ov-inbar { display: flex; align-items: center; gap: 8px; min-width: 140px; }
.ov-inbar i { display: block; height: 10px; min-width: 2px; max-width: calc(100% - 40px); background: var(--ov-2); border-radius: 3px; }
.ov-inbar b { font-weight: 600; font-size: 13px; }
.ov-cellbar .v { position: relative; }
.ov-cellbar.low .v { color: var(--accent); font-weight: 600; }
.ov-sort { border: 0; background: transparent; color: inherit; font: inherit; font-weight: inherit; padding: 0; cursor: pointer; white-space: nowrap; }
.ov-sort.on { color: var(--text); }
.ov-seg { display: inline-flex; gap: 2px; padding: 3px; margin: 0 0 12px; background: var(--surface); border-radius: var(--radius); }
.ov-seg button { border: 0; padding: 5px 12px; border-radius: calc(var(--radius) - 2px); background: transparent; color: var(--text-2); font: inherit; font-size: 13px; cursor: pointer; }
.ov-seg button.on { background: var(--card); color: var(--text); box-shadow: var(--shadow); font-weight: 600; }
.ov-pair { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ov-pair li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) 40px; gap: 10px; align-items: center; font-size: 13px; }
.ov-pair .l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-pair .bars { display: flex; flex-direction: column; gap: 3px; }
.ov-pair .t { height: 7px; background: var(--surface); border-radius: 3px; overflow: hidden; }
.ov-pair .t i { display: block; height: 100%; border-radius: 3px; }
.ov-pair .n { font-size: 11.5px; line-height: 1.25; text-align: right; color: var(--text-2); }
.ov-hb.ov-mt { margin-top: 12px; }
.ov-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; }
.ov-list li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-top: 1px solid var(--border); font-size: 13.5px; cursor: pointer; }
.ov-list li:hover span:first-child { text-decoration: underline; }
/* The period panel */
dialog.ovp-dialog { width: min(760px, calc(100vw - 24px)); }
.ovp { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 20px; }
.ovp-pre { list-style: none; margin: 0; padding: 0 16px 0 0; border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; }
.ovp-pre button { width: 100%; text-align: left; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--text); font: inherit; font-size: 14px; cursor: pointer; }
.ovp-pre button:hover { background: var(--hover); }
.ovp-pre button.on { background: var(--surface); font-weight: 600; }
.ovp-dialog .d-foot { justify-content: space-between; align-items: center; }
.ovp-sum { font-size: 13.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.ovp-sum b { color: var(--text); font-weight: 600; }
.ovp-btns { display: inline-flex; gap: 8px; margin-left: auto; }
@media (max-width: 1200px) { .ov-page .ov-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .ov-row2 { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .ov-sg { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .ovp { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .ovp-pre { flex-direction: row; overflow-x: auto; scrollbar-width: none; border-right: 0; padding: 0 0 4px; gap: 6px; }
  .ovp-pre button { white-space: nowrap; background: var(--surface); border-radius: 999px; padding: 7px 12px; font-size: 13px; }
  .ovp-pre button.on { background: var(--text); color: var(--bg); }
  .ovp-cal .rs-ms .rs-m + .rs-m { display: none; }
  .ovp-cal .rs-ms { grid-template-columns: minmax(0, 1fr); }
  dialog.ovp-dialog { margin: auto auto 0; width: 100vw; max-width: 100vw; border-radius: 18px 18px 0 0; }
  .ovp-dialog .d-foot { flex-direction: column; align-items: stretch; }
  .ovp-btns { margin-left: 0; justify-content: flex-end; }
}
@media (max-width: 640px) {
  .ov-page .ov-cards { grid-template-columns: minmax(0, 1fr); }
  .ov-wide { display: none; }
  .ov-narrow { display: block; }
  .ov-filters > * { flex: 1 1 100%; }
  .ov-pbtn { justify-content: space-between; }
  .ov-sel, .ov-sel select { width: 100%; }
  .ov-wf-r { grid-template-columns: 110px minmax(0, 1fr) 38px; }
  .ov-prog li { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 60px; }
}

/* Bills (1.5.6): four cards on every bill, which also switch the tab; period filter; "Fee to fill". */
.bill-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0 0 14px; }
.bill-card { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; padding: 12px 14px; border: 0; border-radius: var(--radius); background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; box-shadow: inset 0 0 0 1.5px transparent; }
.bill-card:hover { background: var(--hover); }
.bill-card.on { background: var(--card); box-shadow: inset 0 0 0 1.5px var(--text), var(--shadow); }
.bill-card .l { font-size: 13px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.bill-card.on .l { color: var(--text); }
.bill-card .cnt { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--card); color: var(--text-2); font-size: 11px; font-weight: 700; }
.bill-card.on .cnt { background: var(--surface); }
.bill-card.late .cnt { background: var(--accent); color: var(--bg); }
.bill-card.late .v { color: var(--accent); }
.bill-card .v { font-size: 20px; font-weight: 650; line-height: 1.2; }
.bill-card .s { font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.bill-pbtn { flex: 0 1 auto; }
.bill-partly { margin: 0 0 12px; }
.fee-fill { display: inline-block; padding: 1px 8px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); font-size: 12px; font-weight: 600; white-space: nowrap; }
@media (max-width: 760px) { .bill-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } .bill-card .v { font-size: 18px; } }
@media (max-width: 640px) { .bill-pbtn { width: 100%; justify-content: space-between; } }

/* Attendance (1.5.6): a day's heading opens "Mark people Off"; the people to tick. */
.at-dayhead { display: flex; flex-direction: column; align-items: center; width: 100%; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; border-radius: 4px; }
.at-dayhead:hover { background: var(--hover); }
.at-offpick { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px 14px; }
.rt-time { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 8px 0 0; padding: 8px 0 0; border-top: 1px solid var(--rule-soft); }

/* Firm overview (1.5.6): the top (title, filters, section bar) stays in view on a computer;
   Cardamom bars; the people lines under Needs attention. */
@media (min-width: 861px) {
  /* The background runs on to the right edge of the window (past the page's width), not over the menu. */
  /* (1.5.10) The background is a layer behind the strip that runs on to the right edge, and stops at
     the strip's bottom, so nothing below is covered; the page frame clips what runs past the window. */
  .shell:has(.ov-top) { overflow-x: clip; }
  /* (1.5.11) The strip has its own background, with a gap of it under the section bar, so the cards
     start below it and slide under it; a plain layer to its right carries the colour to the window edge. */
  .ov-top { position: sticky; top: -18px; z-index: 20; margin: -30px -40px 0; padding: 30px 40px 14px; background: var(--bg); isolation: isolate; }
  .ov-top::before { content: ''; position: absolute; top: 0; bottom: 0; left: 100%; width: 100vmax; background: var(--bg); pointer-events: none; }
  /* 1.5.22: the shadow under the frozen top is drawn only while stuck (no fading layer, which could keep an old picture of the page in the installed app) */
  .ov-top::after { content: none; }
  .ov-top.stuck::after { content: ''; position: absolute; left: 0; right: -100vmax; top: 100%; height: 12px; pointer-events: none; background: linear-gradient(rgba(0, 0, 0, .10), rgba(0, 0, 0, 0)); }
  .ov-top .page-head { margin-bottom: 14px; }
  .ov-top .ov-filters { margin-bottom: 8px; }
  .ov-top .ov-secbar { margin: 0; }
  .ov-top + .ov-page { padding-top: 10px; }   /* (1.5.12) the same gap under the strip at the top as when scrolled */
  .ov-sec { scroll-margin-top: 190px; }
}
.ov-page .ov-hb .t i { background: var(--ov-2); }
.ov-people li a::before { content: none; }

/* ITR client code (1.5.9): ITR is fixed, only the number is typed. */
.code-in { display: flex; align-items: stretch; }
.code-in b { display: flex; align-items: center; padding: 0 10px; border-radius: var(--radius) 0 0 var(--radius); background: var(--surface); color: var(--text-2); font-weight: 600; font-size: 14px; }
.code-in input { flex: 1; min-width: 0; border-top-left-radius: 0 !important; border-bottom-left-radius: 0 !important; }

/* Dashboard (1.5.11): how many due items a page. */
.db-foot-r { display: inline-flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.db-size { display: inline-flex; align-items: center; gap: 6px; }
.db-size select { width: auto; min-width: 64px; padding-top: 4px; padding-bottom: 4px; font-size: 13px; }

/* Bills (1.5.12): the next step at the end of each line. */
.bill-act { text-align: right; white-space: nowrap; width: 1%; }
/* Beside the folder pane the list is narrower: the raised date and TDS (both in the line above the table) give way so the next-step button stays in view. */
@media (max-width: 1500px) { .bill-table .bill-mid { display: none; } }
@media (min-width: 861px) and (max-width: 1400px) { table.data.bill-table th, table.data.bill-table td { padding-left: 9px; padding-right: 9px; } }
.bill-act .btn { padding: 3px 10px; }

/* Firm overview (1.5.13): tabs below the summary; short card headings with a note
   under them and the method behind a small "i"; the Tasks tab (work by, held up,
   on time, top clients and people). Cards in a row are the same height. */
.ov-tabs button.on { background: var(--card); color: var(--text); font-weight: 600; box-shadow: var(--shadow), inset 0 0 0 1px var(--border); }
.ov-tabbody { margin-top: 4px; }
.ov-tabbody > .ov-sg { gap: 20px; align-items: stretch; }
.ov-tabbody .ov-sg > .panel { display: flex; flex-direction: column; }
.ov-ph { margin: 0 0 16px; }
.ov-p .ov-ph h3 { margin: 0; font-size: 15.5px; display: flex; align-items: center; gap: 6px; }
.ov-note { margin: 3px 0 0; font-size: 13px; color: var(--text-2); line-height: 1.45; }
.ov-i { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); color: var(--text-3); font-size: 11px; font-weight: 700; font-style: italic; cursor: help; }
.ov-ph-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.ov-ph-row .link-btn { white-space: nowrap; margin-top: 2px; }
.ov-tabbody .ov-wf, .ov-tabbody .ov-ot, .ov-tabbody .ov-hold { margin-top: auto; margin-bottom: auto; }
.ov-svg .ov-val { font-size: 12px; font-weight: 600; fill: var(--text); }
/* Ring colours: five muted hues that sit with the brand, and grey for the rest. */
.ov-page { --pie-1: #2F5F55; --pie-2: #C49B55; --pie-3: #55708A; --pie-4: #8FA866; --pie-5: #A0739C; --pie-o: color-mix(in srgb, var(--text) 16%, var(--card)); }
:root[data-theme="graphite"] .ov-page, :root[data-theme="forest-gold"] .ov-page, :root[data-theme="dusk-teal"] .ov-page { --pie-1: #4F8F80; --pie-2: #C29A52; --pie-3: #6F8DB0; --pie-4: #93AC6B; --pie-5: #B07FAC; --pie-o: color-mix(in srgb, var(--text) 24%, var(--card)); }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .ov-page { --pie-1: #4F8F80; --pie-2: #C29A52; --pie-3: #6F8DB0; --pie-4: #93AC6B; --pie-5: #B07FAC; --pie-o: color-mix(in srgb, var(--text) 24%, var(--card)); } }
.ov-pie1 { --pc: var(--pie-1); } .ov-pie2 { --pc: var(--pie-2); } .ov-pie3 { --pc: var(--pie-3); } .ov-pie4 { --pc: var(--pie-4); } .ov-pie5 { --pc: var(--pie-5); } .ov-pieo { --pc: var(--pie-o); }
.ov-page .ov-sw[class*="ov-pie"], .ov-dot2 { background: var(--pc, transparent); }
.ov-dot2 { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; }
.ov-ring { width: 200px; height: auto; flex: none; display: block; }
.ov-ring path.ov-pie { fill: var(--pc); stroke: var(--card); stroke-width: 2; }
.ov-ring circle.ov-pie { stroke: var(--pc); }
.ov-ring .ov-ring-none { stroke: var(--pie-o); }
.ov-ring .ov-ring-n { font-size: 32px; font-weight: 650; fill: var(--text); font-variant-numeric: tabular-nums; }
.ov-ring .ov-ring-w { font-size: 13px; fill: var(--text-2); }
.ov-wb { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.ov-wb .ov-seg { margin: 0 0 14px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.ov-wb .ov-seg button { white-space: nowrap; }
.ov-wb-ring { display: flex; align-items: center; gap: 28px; margin-top: 8px; }
.ov-plist { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 0; font-size: 13.5px; }
.ov-plist li { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto 42px; gap: 6px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--rule-soft); }
.ov-plist li:last-child { border-bottom: 0; }
.ov-plist li > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-plist .ov-sw { width: 10px; height: 10px; border-radius: 3px; }
.ov-plist b { text-align: right; font-weight: 600; } .ov-plist .muted { text-align: right; }
.ov-wbt th.hl, .ov-wbt td.hl { background: color-mix(in srgb, var(--text) 5%, transparent); }
.ov-wbt th.hl { color: var(--text); }
.ov-wbt td.hl { font-weight: 600; }
.ov-wbt tr.zero td, .ov-wbt td.z, .ov-tp td.z { color: var(--text-3); }
.ov-wbt tfoot td { font-weight: 600; border-top: 1px solid var(--border); }
.ov-wbt td:first-child { white-space: nowrap; }
.ov-ot { display: flex; align-items: center; gap: 36px; }
.ov-ot-big { display: flex; flex-direction: column; gap: 6px; font-size: 44px; font-weight: 650; line-height: 1; color: var(--text); }
.ov-ot-big span { font-size: 13px; font-weight: 400; color: var(--text-2); }
.ov-ot-l { list-style: none; margin: 0; padding: 0 0 0 28px; border-left: 1px solid var(--border); display: grid; gap: 9px; font-size: 14px; color: var(--text-2); }
.ov-ot-l b { color: var(--text); font-weight: 600; }
.ov-hold { display: grid; gap: 8px; }
.ov-hold a { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; column-gap: 10px; align-items: center; padding: 10px 14px; border-radius: 10px; background: var(--surface); color: var(--text); text-decoration: none; font-size: 14px; }
.ov-hold a:hover { background: var(--hover); }
.ov-hold a b { font-size: 22px; font-weight: 650; text-align: center; }
.ov-hold a small { display: block; font-size: 12.5px; color: var(--text-2); }
.ov-hold a i { font-style: normal; color: var(--text-3); font-size: 18px; }
.ov-tp td:first-child { white-space: normal; min-width: 140px; }
.ov-lightest { margin: auto 0 0; padding-top: 14px; font-size: 13px; color: var(--text-2); }
.ov-lightest b { color: var(--text); font-weight: 600; }
.ov-ret2 { display: block; column-count: 2; column-gap: 48px; }
.ov-ret2 li { break-inside: avoid; padding: 6px 0; border-bottom: 1px solid var(--rule-soft); }
.ov-ret2 li.zero { color: var(--text-3); }
.ov-ret2 li.zero .t { background: var(--rule-soft); }
.ov-more { align-self: flex-start; margin-top: 12px; }
@media (max-width: 1250px) { .ov-wb-ring { flex-direction: column; align-items: stretch; } .ov-wb-ring .ov-ring { margin: 0 auto; width: 190px; } }
@media (max-width: 900px) {
  .ov-wb { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .ov-wb-p { order: -1; }
  .ov-ret2 { column-count: 1; }
}
@media (max-width: 640px) {
  .ov-ot { gap: 20px; } .ov-ot-big { font-size: 38px; } .ov-ot-l { padding-left: 18px; font-size: 13.5px; }
  .ov-wb .ov-seg { display: flex; width: 100%; } .ov-wb .ov-seg button { flex: 1 0 auto; padding: 6px 8px; }
  .ov-wbt td:first-child { white-space: normal; }
  .ov-wbt th, .ov-wbt td, .ov-tp th, .ov-tp td { padding-left: 6px; padding-right: 6px; }
}
/* Work in and out (1.5.13): thin bars; open work grey, new work Cardamom, completed Evergreen. */
.ov-tabbody .ov-wf { gap: 14px; }
.ov-tabbody .ov-wf-r { font-size: 13.5px; }
.ov-tabbody .ov-wf-r .l { color: var(--text-2); }
.ov-tabbody .ov-wf-r .t { height: 10px; border-radius: 5px; background: var(--rule-soft); }
.ov-tabbody .ov-wf-r .t i { border-radius: 5px; }
.ov-tabbody .ov-wf-r.base .t i { background: color-mix(in srgb, var(--text) 58%, var(--card)); }
.ov-tabbody .ov-wf-r.up .t i { background: var(--ov-2); }
.ov-tabbody .ov-wf-r.down .t i { background: var(--ov-1); }
/* (1.5.15) The cards and the summary sit in the Summary tab. */
.ov-tabbody > .ov-cards, .ov-tabbody > .panel { margin: 0 0 18px; }

/* Firm overview, Clients and Billing tabs (1.5.18) */
.ov-pielate { --pc: var(--accent); }
.ov-ph-row > .ov-seg { margin: 0; flex: 0 0 auto; }
.ov-ph-row > .ov-spk .ov-spark { width: 110px; height: 28px; }
.ov-plnote { margin: 0 0 12px; }
.ov-facts.two.ov-mt { margin-top: 10px; }
.ov-facts b:not(.num) { font-size: 16px; }
.ov-bd { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-size: 11px; font-weight: 700; letter-spacing: .02em;
  background: color-mix(in srgb, var(--pc, var(--text-3)) 24%, var(--card)); color: color-mix(in srgb, var(--pc, var(--text-3)) 55%, var(--text)); }
.ov-newtbl { table-layout: fixed; width: 100%; }
.ov-newtbl col.c-sn { width: 44px; } .ov-newtbl col.c-ty { width: 56px; } .ov-newtbl col.c-dt { width: 84px; }
.ov-newtbl th, .ov-newtbl td { vertical-align: middle !important; padding-top: 8px; padding-bottom: 8px; text-align: left; }
.ov-newtbl .r { text-align: right; } .ov-newtbl .c-sn { text-align: center; padding-left: 0; padding-right: 0; }
.ov-newtbl .nm, .ov-newtbl .sub { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-newtbl .sub { font-size: 12px; color: var(--text-3); margin-top: 1px; }
.ov-owers { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ov-owers li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 8px 10px; background: var(--surface); border-radius: var(--radius); font-size: 13.5px; }
.ov-owers li[data-href] { cursor: pointer; } .ov-owers li[data-href]:hover { background: var(--hover); }
.ov-owers li span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .ov-owers .muted { text-align: right; min-width: 52px; }
.ov-hold + .ov-h4 { margin-top: 20px; }
.ov-tabbody .ov-hold-w { margin-top: 0; margin-bottom: 0; }
.ov-hold-w a { grid-template-columns: 104px minmax(0, 1fr) auto; } .ov-hold-w a b { font-size: 19px; text-align: left; white-space: nowrap; }
.ov-owe { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 24px; align-items: center; }
.ov-owe .ov-ring { width: 170px; height: 170px; } .ov-owe .ov-plist li[data-href] { cursor: pointer; }
.ov-ring .ov-ring-n.ov-ring-money { font-size: 26px; }
.ov-agetbl { margin-top: 12px; } .ov-agetbl .ov-sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: -1px; margin-right: 4px; }
.ov-fly { margin-top: 18px; display: flex; flex-direction: column; gap: 7px; font-size: 13px; }
.ov-fly-h, .ov-fly-r { display: grid; grid-template-columns: 24px minmax(0, 1fr) 118px minmax(0, 1fr) 24px; gap: 8px; align-items: center; }
.ov-fly-h { font-size: 12px; color: var(--text-2); font-weight: 600; } .ov-fly-h span:nth-child(2) { text-align: right; }
.ov-fly .lt, .ov-fly .rt { display: flex; height: 14px; } .ov-fly .lt { justify-content: flex-end; }
.ov-fly .lt i, .ov-fly .rt i { display: block; height: 100%; border-radius: 3px; flex: 0 0 auto; }
.ov-fly .m { text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-fly b { font-weight: 600; } .ov-fly-r > b:first-child { text-align: right; } .ov-fly b.z { color: var(--text-3); }
@media (max-width: 860px) {
  .ov-hide-sm { display: none; }
  .ov-newtbl col.c-sn { width: 0; } .ov-newtbl .c-sn { display: none; }
  .ov-hold-w a { grid-template-columns: 92px minmax(0, 1fr) auto; } .ov-hold-w a b { font-size: 17px; }
  .ov-owe { grid-template-columns: minmax(0, 1fr); justify-items: center; } .ov-owe .ov-plist { width: 100%; }
  .ov-fly-h, .ov-fly-r { grid-template-columns: 20px minmax(0, 1fr) 104px minmax(0, 1fr) 20px; gap: 6px; }
  .ov-fly .m { font-size: 12px; white-space: normal; line-height: 1.2; }
  .ov-ph-row { flex-wrap: wrap; }
}

/* Bill history and Bills → Activity (1.5.19, update 43) */
dialog.bill-wide { width: min(1220px, calc(100vw - 24px)); }
.bill-split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.bill-histbox { position: sticky; top: 0; padding: 16px 18px; background: var(--surface); border-radius: var(--radius); min-width: 0; }
.bill-histbox h4 { margin: 0 0 10px; font-size: 13px; color: var(--text-2); font-weight: 600; }
.bill-hist { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--rule-soft); display: flex; flex-direction: column; gap: 10px; }
.bill-hist li { position: relative; font-size: 13.5px; line-height: 1.4; overflow-wrap: anywhere; }
.bill-hist li::before { content: ''; position: absolute; left: -20px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--card); box-shadow: inset 0 0 0 2px var(--text-3); }
.bill-hist li.k::before { box-shadow: inset 0 0 0 5px var(--text); }
.bill-hist .w { display: block; font-size: 12px; color: var(--text-3); }
.bill-cards.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.bill-actp { padding: 16px 20px; }
.bill-actf { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 0 0 6px; }
.bill-actf select { width: auto; min-width: 140px; }
.bill-act-l { list-style: none; margin: 0; padding: 0; }
.bill-act-l li { display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 2px; border-bottom: 1px solid var(--rule-soft); font-size: 13.5px; }
.bill-act-l li.clickable { cursor: pointer; } .bill-act-l li.clickable:hover { background: var(--hover); }
.bill-act-l .t { color: var(--text-3); font-size: 12.5px; } .bill-act-l .sub { display: block; font-size: 12.5px; color: var(--text-2); }
.bill-act-l li.day { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); padding: 14px 0 2px; border: 0; }
@media (max-width: 860px) {
  .bill-split { grid-template-columns: minmax(0, 1fr); } .bill-histbox { position: static; }
  .bill-cards.five { grid-template-columns: repeat(2, minmax(0, 1fr)); } .bill-cards.five [data-bt=act] { grid-column: 1 / -1; }
  .bill-act-l li { grid-template-columns: 60px minmax(0, 1fr); } .bill-act-l .a { grid-column: 2; }
}

/* Firm overview, Time and attendance tab (1.5.19) */
.ov-svg .ov-val.ov-low { fill: var(--accent); }
.ov-db { display: flex; flex-direction: column; gap: 4px; }
.ov-db-h, .ov-db-r { display: grid; grid-template-columns: 128px minmax(0, 1fr) 64px; gap: 14px; align-items: center; }
.ov-db-h { font-size: 11.5px; color: var(--text-3); height: 18px; } .ov-db-h .ax { position: relative; height: 100%; }
.ov-db-h .ax i { position: absolute; transform: translateX(-50%); font-style: normal; } .ov-db-h .ax i:first-child { transform: none; } .ov-db-h .ax i:last-child { transform: translateX(-100%); }
.ov-db-h .r, .ov-db-r .r { text-align: right; }
.ov-db-r { padding: 7px 0; border-top: 1px solid var(--rule-soft); }
.ov-db-r .l { min-width: 0; } .ov-db-r .l b { display: block; font-weight: 500; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-db-r .l small { display: block; font-size: 11.5px; color: var(--text-3); }
.ov-db-r .tr { position: relative; height: 22px; background: linear-gradient(to right, var(--rule-soft) 1px, transparent 1px) 0 0 / 25% 100%; border-radius: 3px; }
.ov-db-r .ln { position: absolute; top: 9px; height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--text) 25%, var(--card)); }
.ov-db-r .ln.bad { background: color-mix(in srgb, var(--accent) 55%, var(--card)); }
.ov-db-r .dt { position: absolute; top: 4px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; }
.ov-db-r .dt.t { background: var(--card); box-shadow: inset 0 0 0 3px var(--ov-1); }
.ov-db-r .dt.f { background: var(--ov-2); } .ov-db-r .dt.f.bad { background: var(--accent); }
.ov-k { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: -1px; margin-right: 4px; }
.ov-k.t { box-shadow: inset 0 0 0 3px var(--ov-1); } .ov-k.f { background: var(--ov-2); } .ov-k.bad { background: var(--accent); }
@media (max-width: 860px) { .ov-db-h, .ov-db-r { grid-template-columns: 92px minmax(0, 1fr) 52px; gap: 8px; } .ov-db-r .l small { display: none; } }
.ov-wf-h .ov-wf-r { grid-template-columns: 140px minmax(0, 1fr) 72px; } .ov-wf-h .ov-wf-r b { white-space: nowrap; }

/* Firm overview → ITR tab (1.5.21) */
.ov-season { align-items: center; }
.ov-season-l { font-size: 13px; color: var(--text-2); font-weight: 600; }
.ov-season .ov-seg { margin: 0; flex-wrap: nowrap; }
.ov-season .ov-seg button { white-space: nowrap; }
.ov-season select { border: 0; background: transparent; font: inherit; font-size: 13px; color: var(--text-2); padding: 5px 8px; border-radius: calc(var(--radius) - 2px); width: auto; }
.ov-season select.on { background: var(--card); color: var(--text); font-weight: 600; box-shadow: var(--shadow); }
.ov-itr-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: stretch; }
.ov-itr-top > .panel, .ov-itr-col > .panel { margin: 0; display: flex; flex-direction: column; }
.ov-itr-col { display: flex; flex-direction: column; gap: 20px; }
.ov-itr-col > .panel { flex: 1 1 auto; }
.ov-itr-col .ov-hold { margin-top: 0; margin-bottom: 0; }
.ov-itr-ring { display: flex; justify-content: center; } .ov-itr-ring .ov-ring { width: 190px; height: 190px; }
.ov-pie2b { background: var(--pie-2); } .ov-sw.ov-pie2b { background: var(--pie-2); }
@media (max-width: 860px) {
  .ov-itr-top { grid-template-columns: minmax(0, 1fr); }
  .ov-season-l { display: none; } .ov-season .ov-seg { width: 100%; } .ov-season .ov-seg button { flex: 1; font-size: 12.5px; padding: 6px 4px; }
}
/* 1.5.22: ITR season list beside the people filter; TDS beside amounts owed */
.ov-filters .ov-pbtn:disabled, .ov-filters select:disabled { opacity: .45; cursor: not-allowed; }
.ov-tds { font-weight: 400; white-space: nowrap; }
.ov-agetbl td .sub { display: block; font-size: 11.5px; color: var(--text-3); font-weight: 400; }
.ov-wait { padding: 24px 4px; }

.ov-hb li.late .t i { background: var(--accent); }

/* Firm overview → Collections (1.5.24) */
.ov-cfigs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0 0 18px; }
.ov-cfig { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; border-radius: var(--radius); background: var(--surface); min-width: 0; }
.ov-cfig .l { font-size: 12.5px; color: var(--text-2); } .ov-cfig b { font-size: 22px; font-weight: 650; }
.ov-cfig .s { font-size: 12px; color: var(--text-3); } .ov-cfig .d { align-self: flex-start; } .ov-cfig.late b { color: var(--accent); }
.ov-ctwo { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.ov-h4-top { margin-top: 0; }
.ov-ins { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ov-eq { align-self: stretch; display: flex; flex-direction: column; }
.ov-eq > .ov-hb-eq { flex: 1; justify-content: space-evenly; gap: 14px; } .ov-eq > .ov-hb-eq .t { height: 16px; }
.ov-hb li.late .t i { background: var(--accent); }
.ov-cols { flex: 1; display: flex; align-items: flex-end; gap: 22px; min-height: 150px; padding: 8px 4px 0; border-bottom: 1px solid var(--line); }
.ov-cols > div { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; align-self: stretch; gap: 4px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.ov-cols i { display: block; width: 56%; min-height: 2px; background: var(--ov-1); border-radius: 3px 3px 0 0; } .ov-cols i.late { background: var(--accent); }
.ov-colsl { display: flex; gap: 22px; padding: 6px 4px 0; } .ov-colsl > span { flex: 1; text-align: center; font-size: 12px; color: var(--text-2); line-height: 1.35; }
.ov-c4 { fill: color-mix(in srgb, var(--text) 10%, var(--card)); background: color-mix(in srgb, var(--text) 10%, var(--card)); }
.ov-tdsq { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 32px; align-items: center; }
.ov-100 { display: flex; height: 34px; border-radius: 4px; overflow: hidden; background: var(--surface); margin: 0 0 12px; }
.ov-100 i { display: flex; align-items: center; justify-content: center; font-style: normal; font-size: 12.5px; font-weight: 600; color: var(--card); min-width: 2px; }
.ov-100 i.ov-c3, .ov-100 i.ov-c4 { color: var(--text); }
.ov-seg-wrap { flex-wrap: wrap; } .ov-seg-wrap button { white-space: nowrap; }
.ov-pc { display: inline-block; width: 60px; height: 8px; background: var(--surface); border-radius: 3px; vertical-align: middle; margin-left: 6px; overflow: hidden; }
.ov-pc i { display: block; height: 100%; background: var(--ov-1); } .ov-pc.low i { background: var(--accent); }
.ov-tag { font-size: 11px; padding: 1px 6px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); margin-left: 6px; white-space: nowrap; }
.ov-sort { border: 0; background: none; font: inherit; color: inherit; padding: 0; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; white-space: nowrap; }
.ov-sort .ar { font-size: 11px; color: var(--text-3); } .ov-sort.on { color: var(--text); font-weight: 600; } .ov-sort.on .ar { color: var(--text); }
.ov-cfoot { display: flex; align-items: center; gap: 14px; margin-top: 12px; flex-wrap: wrap; } .ov-cfoot select { margin-left: 6px; }
.ov-cpg { margin-left: auto; display: inline-flex; gap: 6px; }
.ov-conc { display: grid; gap: 10px; } .ov-conc .row { display: grid; grid-template-columns: 150px minmax(0, 1fr) 46px; gap: 8px; align-items: center; font-size: 13px; }
.ov-conc .bar { height: 14px; background: var(--surface); border-radius: 3px; overflow: hidden; display: flex; }
.ov-conc .bar i { background: var(--ov-1); } .ov-conc .bar i.o { background: var(--accent); } .ov-conc b { text-align: right; }
@media (max-width: 860px) {
  .ov-cfigs { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ov-ctwo, .ov-tdsq { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .ov-ins { grid-template-columns: minmax(0, 1fr); } .ov-cols, .ov-colsl { gap: 10px; } .ov-conc .row { grid-template-columns: 110px minmax(0, 1fr) 40px; }
}

/* Bills → Money today and payment reminders (1.5.26) */
.bill-cards.six { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.bill-card .v.late { color: var(--accent); }
.mt-panel { padding: 18px 20px; }
.mt-figs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0 0 18px; }
.mt-fig { text-align: left; border: 0; background: var(--surface); border-radius: var(--radius); padding: 12px 14px; font: inherit; color: var(--text); cursor: pointer; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mt-fig:hover { background: var(--hover); }
.mt-fig b { font-size: 21px; font-weight: 650; } .mt-fig .l { font-size: 12.5px; color: var(--text-2); } .mt-fig .s { font-size: 12px; color: var(--text-3); }
.mt-fig.late b { color: var(--accent); }
.mt-two { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.mt-h { font-size: 14px; margin: 0 0 2px; } .mt-n { font-size: 12.5px; color: var(--text-2); margin: 0 0 8px; } .mt-none { margin: 8px 0; }
.mt-list { list-style: none; margin: 0; padding: 0; }
.mt-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 12px; align-items: center; padding: 9px 0; border-top: 1px solid var(--rule-soft); font-size: 13.5px; }
.mt-list li > div { min-width: 0; } .mt-list .nm { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-list small { display: block; color: var(--text-2); font-size: 12px; } .mt-list .amt { font-weight: 600; text-align: right; }
.mt-side li { grid-template-columns: minmax(0, 1fr) auto auto; }
.mt-more { font-size: 13px; margin: 8px 0 0; display: inline-block; }
.rm-chip { font-size: 11.5px; padding: 2px 8px; border-radius: 10px; background: var(--surface); color: var(--text-2); white-space: nowrap; }
.rm-chip.no { background: var(--accent-soft); color: var(--accent); }
.rm-under { display: block; margin-top: 4px; } .rm-under .rm-chip { background: transparent; padding: 0; } .rm-under .rm-chip.no { background: transparent; }
.bill-act .btn + .btn { margin-left: 6px; }
.bill-rmh { margin-top: 14px; }
.rm-split { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 22px; }
.rm-bills { list-style: none; margin: 0 0 14px; padding: 0; border: 1px solid var(--rule-soft); border-radius: var(--radius); }
.rm-bills li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 12px; border-top: 1px solid var(--rule-soft); font-size: 13.5px; }
.rm-bills li:first-child { border-top: 0; } .rm-bills small { display: block; color: var(--text-2); font-size: 12px; }
.rm-bills .r { text-align: right; } .rm-bills .r b { display: block; }
.rm-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin: 0 0 12px; } .rm-row .lbl { font-size: 13px; color: var(--text-2); min-width: 64px; }
.rm-row label { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; } .rm-seg { margin: 0; }
.rm-msg { width: 100%; min-height: 440px; font: inherit; font-size: 13.5px; line-height: 1.5; padding: 10px 12px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); color: var(--text); box-sizing: border-box; resize: vertical; }
.rm-to { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 4px 0 10px; }
.rm-hist { font-size: 12.5px; color: var(--text-2); margin: 4px 0 0; }
@media (max-width: 860px) {
  .bill-cards.six { grid-template-columns: repeat(2, minmax(0, 1fr)); } .bill-cards.six [data-bt=act] { grid-column: auto; }
  .mt-figs { grid-template-columns: repeat(2, minmax(0, 1fr)); } .mt-two { grid-template-columns: minmax(0, 1fr); }
  .mt-list li { grid-template-columns: minmax(0, 1fr) auto; row-gap: 6px; } .mt-list .rm-chip { grid-column: 1; justify-self: start; }
  .mt-side li { grid-template-columns: minmax(0, 1fr) auto; } .mt-side li .btn { grid-column: 2; }
  .rm-split, .rm-to { grid-template-columns: minmax(0, 1fr); } .rm-msg { min-height: 300px; }
}

/* My Day tabs, timers, Save my time (1.5.27) */
.md-tabs { display: flex; gap: 6px; margin: -6px 0 18px; flex-wrap: wrap; }
.md-tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 16px; border-radius: 999px; background: var(--surface); color: var(--text-2); font-size: 14px; text-decoration: none; }
.md-tabs a:hover { color: var(--text); }
.md-tabs a.on { background: var(--card); color: var(--text); font-weight: 600; box-shadow: var(--shadow); }
.md-tabs .nav-badge { position: static; margin: 0; }
#md-logtime svg { width: 16px; height: 16px; }
.tally.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 860px) { .tally.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tm-wrap { display: inline-flex; align-items: center; gap: 4px; }
.tm-el { font-size: 12px; font-weight: 600; color: var(--text); }
.tm-el:empty { display: none; }
.tm-play { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; flex: none; border-radius: 50%; border: 0; background: var(--surface); color: var(--text); cursor: pointer; }
.tm-play:hover { background: var(--hover); }
.tm-play.on { background: var(--text); color: var(--card); }
.ledger-item.tm-run, li.tm-run > .rv-main { box-shadow: inset 3px 0 0 var(--ov-2, var(--text-3)); }
.tm-pill { position: fixed; right: 24px; bottom: 24px; z-index: 60; display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 999px; border: 0; background: var(--text); color: var(--card); box-shadow: 0 8px 24px rgba(0, 0, 0, .18); font: inherit; font-size: 14px; cursor: pointer; }
.tm-pill.idle { background: var(--card); color: var(--text); box-shadow: var(--shadow), 0 6px 18px rgba(0, 0, 0, .12); }
.tm-dot { width: 8px; height: 8px; border-radius: 50%; background: #6fcf97; box-shadow: 0 0 0 3px rgba(111, 207, 151, .25); }
.tm-dot.off { background: var(--text-3); box-shadow: none; }
.tm-panel { position: fixed; right: 24px; bottom: 80px; z-index: 61; width: 390px; max-width: calc(100vw - 32px); max-height: calc(100vh - 140px); overflow: auto; background: var(--card); color: var(--text); border-radius: 14px; box-shadow: 0 12px 36px rgba(0, 0, 0, .22); padding: 14px 16px; }
.tm-panel h3 { margin: 0 0 2px; font-size: 15px; display: flex; justify-content: space-between; gap: 8px; } .tm-panel h3 span { font-weight: 400; color: var(--text-2); font-size: 13px; }
.tm-panel .sub, .tm-hint { font-size: 12px; color: var(--text-2); margin: 0 0 8px; } .tm-hint { margin: 8px 0 0; }
.tm-rows { list-style: none; margin: 0; padding: 0; }
.tm-rows li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--rule-soft); }
.tm-rows li.p { opacity: .75; }
.tm-name { border: 0; background: none; padding: 0; text-align: left; font: inherit; color: inherit; cursor: pointer; min-width: 0; }
.tm-name .t { display: block; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .tm-name small { display: block; color: var(--text-2); font-size: 12px; }
.tm-name:hover .t { text-decoration: underline; }
.tm-rows .el { font-weight: 600; font-size: 13px; } .tm-rows .tm-el { display: none; }
.tm-acts { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; } .tm-acts > * { flex: 1; } .tm-acts .btn { width: 100%; }
.tm-gen-w { position: relative; }
.tm-menu { position: absolute; bottom: calc(100% + 6px); left: 0; z-index: 2; display: flex; flex-direction: column; min-width: 160px; padding: 6px; border-radius: 10px; background: var(--card); box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }
.tm-menu button { border: 0; background: none; text-align: left; padding: 7px 10px; border-radius: 6px; font: inherit; font-size: 13.5px; color: var(--text); cursor: pointer; } .tm-menu button:hover { background: var(--surface); }
.sv-tbl td { vertical-align: middle; } .sv-tbl .sv-rm { width: 40%; }
.sv-in { width: 100%; font: inherit; font-size: 13px; padding: 6px 8px; border-radius: 6px; border: 1px solid var(--line); background: var(--card); color: var(--text); box-sizing: border-box; }
.sv-in.need { border-color: var(--accent); } .sv-need { display: block; font-size: 11.5px; color: var(--accent); margin-top: 3px; } .sv-need:empty { display: none; }
.sv-auto { font-size: 12.5px; color: var(--text-3); font-style: italic; }
.sv-tag { font-size: 11px; padding: 1px 6px; border-radius: 8px; background: var(--surface); color: var(--text-2); margin-left: 6px; }
.sv-del { border: 0; background: none; color: var(--text-3); font-size: 18px; cursor: pointer; } .sv-off td { opacity: .5; }
.sv-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; flex-wrap: wrap; }
@media (max-width: 860px) { .tm-pill { right: 16px; bottom: 84px; } .tm-panel { right: 16px; bottom: 140px; } }
/* Inbox groups; calendars (1.5.27) */
.ib-sub .ib-f { padding-left: 38px; font-size: 13px; }
.ib-bar { display: flex; justify-content: flex-end; margin: 0 0 10px; }
.cal-who { display: flex; justify-content: flex-end; gap: 10px; margin: 0 0 12px; flex-wrap: wrap; }
.back-link { display: inline-block; font-size: 13px; color: var(--text-2); text-decoration: none; margin-bottom: 4px; } .back-link:hover { color: var(--text); }
/* Firm details (1.5.27) */
@media (min-width: 1000px) { .fd-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; } }
.fd-dl2 > div { grid-template-columns: 34% minmax(0, 1fr); }
.fd-acts { display: inline-flex; gap: 2px; flex: none; }
.fd-acts a.fd-copy { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.fd-dl .v.ml { line-height: 1.55; }
.fd-many { flex-direction: column; gap: 6px; } .fd-one { display: flex; align-items: center; gap: 6px; width: 100%; }
.fd-sub { font-size: 12px; color: var(--text-3); font-weight: 400; margin-left: 4px; }
.fd-link { color: var(--text); text-decoration: none; border-bottom: 1px dotted var(--text-3); overflow-wrap: anywhere; }
.fd-ph { font-size: 13px; color: var(--text-2); font-weight: 600; margin: 14px 0 4px; }
.fd-pt { width: 100%; border-collapse: collapse; font-size: 14px; }
.fd-pt th { text-align: left; font-size: 12px; color: var(--text-2); font-weight: 500; padding: 6px 0; border-bottom: 1px solid var(--rule-soft); }
.fd-pt td { padding: 6px 0; border-bottom: 1px solid var(--rule-soft); } .fd-pt td.c { width: 34px; text-align: right; } .fd-pt b { font-weight: 600; }
.fd-qr { display: flex; gap: 14px; align-items: center; margin: 14px 0 0; padding: 12px; border-radius: var(--radius); background: var(--surface); flex-wrap: wrap; }
.fd-qr.none { justify-content: space-between; }
.fd-qr b { display: block; font-size: 14px; } .fd-qr .btn-row { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.fd-qr-img { width: 120px; height: 120px; padding: 6px; border: 0; border-radius: 8px; background: #fff; cursor: zoom-in; flex: none; }
.fd-qr-img img, .fd-qr-img svg, .fd-qr-svg svg { width: 100%; height: 100%; display: block; } .fd-qr-svg { display: block; width: 100%; height: 100%; }
.fd-qr-large { background: #fff; padding: 16px; border-radius: 12px; display: flex; justify-content: center; }
.fd-qr-large img, .fd-qr-large svg { width: min(78vw, 420px); height: auto; aspect-ratio: 1; }
.fd-up { cursor: pointer; }
.pt-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; gap: 10px; align-items: end; margin-bottom: 8px; }
@media (max-width: 600px) { .pt-row { grid-template-columns: minmax(0, 1fr); } }
.nav-top .nav-badge { margin-left: auto; }
.fd-qr > div { flex: 1; min-width: 180px; }
.sv-tbl td.num { white-space: nowrap; }
.na-list .tm-play { width: 24px; height: 24px; } .na-list .tm-wrap { flex: none; }
.na-list li:has(.tm-wrap) { grid-template-columns: 28px minmax(0, 1fr) auto 30px; }
.ledger-item .r .due-late { white-space: nowrap; }

/* Firm details pinned above the profile (1.5.28) */
.nav-pin { margin: auto 0 8px; padding-top: 10px; }   /* Firm details: at the bottom of the menu, above the line (1.5.29) */
.nav-pin .nav-group { margin: 0; }

/* Fixed-fee packages (1.5.28) */
.rs-strip { display: grid; grid-template-columns: repeat(2, minmax(0, 220px)); gap: 12px; margin: 0 0 16px; }
.rs-strip div { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 18px; }
.rs-strip b { display: block; font-size: 28px; font-weight: 600; line-height: 1.1; }
.rs-strip span { font-size: 13px; color: var(--text-2); }
.rt-row { cursor: pointer; } .rt-row:hover td { background: var(--hover); }
.rd-sec { margin: 16px 0 0; } .rd-sec h3 { font-size: 13px; color: var(--text-2); margin: 0 0 6px; font-weight: 600; }
.rd-list { list-style: none; margin: 0; padding: 0; font-size: 13.5px; } .rd-list li { display: flex; gap: 10px; justify-content: space-between; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--rule-soft); } .rd-list li > span:first-child { flex: 1; }
@media (max-width: 600px) { .rs-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Dashboard → Returns, a report (1.5.28) */
.dash-tabs { margin-top: -6px; }
.rq-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 0 12px; flex-wrap: wrap; }
.rq-sec { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface); border-radius: 10px; flex-wrap: wrap; }
.rq-sec a { padding: 6px 14px; border-radius: 8px; font-size: 13.5px; color: var(--text-2); text-decoration: none; }
.rq-sec a.on { background: var(--card); color: var(--text); font-weight: 600; box-shadow: var(--shadow); }
.rq-sec .d, .rq-strip a.dot::after { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-left: 5px; vertical-align: middle; }
.rq-mon { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rq-mon .arr { width: 34px; height: 34px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow); display: inline-flex; align-items: center; justify-content: center; font-size: 16px; color: var(--text); text-decoration: none; }
.rq-mon .cur { min-width: 170px; text-align: center; padding: 6px 14px; border-radius: 999px; background: var(--card); box-shadow: var(--shadow); font-weight: 650; font-size: 14.5px; }
.rq-mon .cur small { display: block; font-size: 11px; font-weight: 500; color: var(--text-3); }
.rq-strip { display: inline-flex; gap: 4px; }
.rq-strip a { position: relative; padding: 4px 9px; border-radius: 8px; font-size: 12px; color: var(--text-2); background: var(--surface); text-decoration: none; }
.rq-strip a.on { background: var(--text); color: var(--card); }
.rq-strip a.dot::after { content: ''; position: absolute; top: 2px; right: 2px; margin: 0; }
.rq-line { font-size: 13.5px; color: var(--text-2); margin: 0 0 12px; display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.rq-line b { color: var(--text); } .rq-line .late, .rq-plist .late { color: var(--accent); } .rq-line .late b { color: var(--accent); }
.rq-pend { margin-left: auto; border: 0; background: none; padding: 0; font: inherit; font-weight: 600; color: var(--accent); cursor: pointer; }
.rq-plist { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); margin: 0 0 14px; }
.rq-plist ul { list-style: none; margin: 0; padding: 0; }
.rq-plist li { display: grid; grid-template-columns: 120px minmax(0, 1fr) 160px 220px; gap: 10px; padding: 8px 16px; border-top: 1px solid var(--rule-soft); font-size: 13.5px; align-items: center; cursor: pointer; }
.rq-plist li:first-child { border-top: 0; } .rq-plist li:hover { background: var(--hover); }
.rq-chips { display: flex; gap: 8px; align-items: center; margin: 0 0 10px; flex-wrap: wrap; font-size: 13px; }
.rq-chip { border: 0; padding: 4px 10px; border-radius: 999px; background: var(--card); box-shadow: var(--shadow); font: inherit; font-size: 13px; color: var(--text); cursor: pointer; } .rq-chip b { margin-left: 6px; color: var(--text-3); }
.rq-chips .muted { margin-left: auto; }
.rq-hm { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: visible; }
.rq-t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.rq-t th { position: relative; font-size: 12px; color: var(--text-2); font-weight: 600; padding: 10px; text-align: center; border-bottom: 1px solid var(--rule-soft); width: 122px; white-space: nowrap; vertical-align: top; }
.rq-t th small { display: block; font-size: 11px; font-weight: 400; color: var(--text-3); } .rq-t th.act .rq-h { color: var(--text); } .rq-t th.act .cv { color: var(--accent); }
.rq-t th.rq-cl, .rq-t td.rq-cl { text-align: left; padding-left: 16px; width: auto; white-space: normal; }
.rq-t td { padding: 7px 10px; border-bottom: 1px solid var(--rule-soft); text-align: center; } .rq-t td.rq-cl a { color: var(--text); text-decoration: none; }
.rq-t tbody tr:last-child td { border-bottom: 0; }
.rq-h { border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; } .rq-h .cv { font-size: 11px; color: var(--text-3); margin-left: 3px; }
.rq-tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 0 6px; border-radius: 8px; background: var(--surface); color: var(--text-2); margin-top: 2px; }
.ri { display: inline-flex; width: 24px; height: 24px; box-sizing: border-box; flex: none; border-radius: 50%; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; border: 0; padding: 0; color: var(--text); background: none; cursor: pointer; font-family: inherit; }
.ri.f { background: var(--ri-ok); color: var(--ri-ok-ink); }
.ri.fl { background: var(--ri-late); color: var(--ri-late-ink); position: relative; }
/* Filed late: a small clock beside the tick, so it differs by shape and not only by colour (1.5.29). */
.ri.fl::after { content: ''; position: absolute; right: -4px; bottom: -4px; width: 11px; height: 11px; border-radius: 50%; background: var(--card);
  -webkit-mask: none; box-shadow: inset 0 0 0 1.5px var(--ri-late);
  background-image: linear-gradient(var(--ri-late), var(--ri-late)), linear-gradient(var(--ri-late), var(--ri-late));
  background-size: 1.5px 3.5px, 3px 1.5px; background-position: 4.75px 2.25px, 4.75px 4.75px; background-repeat: no-repeat; }
.ri.w { background: linear-gradient(90deg, var(--ri-prog) 50%, transparent 50%); box-shadow: inset 0 0 0 2px var(--ri-prog); color: transparent; }
.ri.n { box-shadow: inset 0 0 0 2px var(--ri-ring); } .ri.o { background: var(--accent); color: var(--ri-over-ink); } .ri.m { border: 2px dashed var(--accent); color: var(--accent); font-weight: 800; }
.rq-leg { display: flex; gap: 16px; align-items: center; font-size: 12.5px; color: var(--text-2); margin: 12px 2px 0; flex-wrap: wrap; } .rq-leg > span { display: inline-flex; gap: 6px; align-items: center; } .rq-leg .ri { cursor: default; }
.rq-menu { position: absolute; z-index: 20; top: calc(100% + 2px); right: 0; width: 240px; text-align: left; background: var(--card); border-radius: 12px; box-shadow: 0 12px 30px rgba(0, 0, 0, .18); padding: 10px; font-weight: 400; color: var(--text); white-space: normal; }
.rq-cl .rq-menu { left: 8px; right: auto; }
.rq-menu h4 { margin: 4px 6px 6px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.rq-menu > a { display: block; padding: 6px 8px; border-radius: 6px; font-size: 13px; color: var(--text); text-decoration: none; } .rq-menu > a.on { background: var(--surface); font-weight: 600; }
.rq-ck { display: flex; gap: 8px; align-items: center; padding: 5px 8px; font-size: 13px; } .rq-ck .ri { width: 18px; height: 18px; font-size: 11px; cursor: default; }
.rq-menu .field { margin: 4px 0; } .rq-menu .field input, .rq-menu .field select { width: 100%; }
.rq-menu .sep { height: 1px; background: var(--rule-soft); margin: 6px 4px; } .rq-menu .acts { display: flex; justify-content: space-between; padding: 4px 6px 0; font-size: 12.5px; }
@media (max-width: 860px) { .rq-hm { overflow-x: auto; } .rq-plist li { grid-template-columns: minmax(0, 1fr) auto; } .rq-plist li > :nth-child(3) { display: none; } .rq-strip { display: none; } .rq-pend { margin-left: 0; } }

/* Bills (1.5.28): Summary · Bills · History; the Bills tab like the Inbox */
.bill-tabs { margin-top: -6px; }
.bx { display: grid; grid-template-columns: 250px minmax(0, 1.25fr) minmax(0, 1fr); background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); min-height: 600px; overflow: hidden; }
.bx-side { border-right: 1px solid var(--rule-soft); padding: 10px 8px; }
.bx-fl { list-style: none; margin: 0; padding: 0; }
.bx-f { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1px 8px; align-items: center; width: 100%; border: 0; background: none; text-align: left; padding: 7px 10px; border-radius: 8px; font: inherit; color: var(--text-2); cursor: pointer; }
.bx-f:hover { background: var(--hover); } .bx-f.on { background: var(--surface); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
.bx-f .nm { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .bx-f .cnt { font-size: 12px; font-weight: 600; color: var(--text); }
.bx-f .amt { grid-column: 1 / -1; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; } .bx-f .amt.late { color: var(--accent); }
.bx-sub .bx-f { padding-left: 22px; } .bx-sub2 .bx-f { padding-left: 34px; } .bx-sub2 .bx-f .nm { font-size: 13px; }
.bx-h button { display: flex; align-items: center; gap: 6px; width: 100%; border: 0; background: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--text); margin: 10px 0 2px; padding: 6px 10px 6px 4px; border-radius: 8px; cursor: pointer; text-align: left; }
.bx-h button:hover { background: var(--hover); }
/* the folder triangle (as in the Clients tree), turned down when open */
.tw-tw { flex: none; width: 14px; height: 14px; position: relative; color: var(--text-2); }
.tw-tw::before { content: ""; position: absolute; left: 4px; top: 3px; border-left: 5px solid currentColor; border-top: 4px solid transparent; border-bottom: 4px solid transparent; transition: transform 0.15s ease; }
[aria-expanded="true"] > .tw-tw::before { transform: rotate(90deg); }
.bx-list { border-right: 1px solid var(--rule-soft); display: flex; flex-direction: column; min-width: 0; }
.bx-chips { display: none; gap: 6px; overflow-x: auto; padding: 10px 12px 0; }
.bx-chips button { border: 0; padding: 6px 12px; border-radius: 999px; background: var(--surface); font: inherit; font-size: 13px; white-space: nowrap; color: var(--text-2); cursor: pointer; } .bx-chips button.on { background: var(--text); color: var(--card); }
.bx-tools { display: flex; gap: 8px; padding: 12px; border-bottom: 1px solid var(--rule-soft); flex-wrap: wrap; }
.bx-tools input { flex: 1; min-width: 140px; font: inherit; font-size: 13.5px; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--text); }
.bx-per { border: 0; padding: 7px 12px; border-radius: 8px; background: var(--text); color: var(--card); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.bx-sum { padding: 8px 14px; font-size: 13px; color: var(--text-2); border-bottom: 1px solid var(--rule-soft); display: flex; gap: 14px; flex-wrap: wrap; } .bx-sum b { color: var(--text); }
.bx-bulk { display: flex; gap: 10px; align-items: center; padding: 8px 14px; border-bottom: 1px solid var(--rule-soft); }
.bx-rows { list-style: none; margin: 0; padding: 0; overflow: auto; }
.bx-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 10px 14px; border-bottom: 1px solid var(--rule-soft); cursor: pointer; position: relative; }
.bx-row:has(input[data-pick]) { grid-template-columns: 22px minmax(0, 1fr) auto; } .bx-row input[data-pick] { grid-row: 1 / 3; align-self: center; width: 16px; height: 16px; }
.bx-row:hover { background: var(--hover); } .bx-row.on { background: var(--surface); box-shadow: inset 3px 0 0 var(--accent); }
.bx-row .t { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .bx-row .a { font-weight: 600; text-align: right; }
.bx-row .s { font-size: 12.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .bx-row .d { font-size: 12px; text-align: right; color: var(--text-2); white-space: nowrap; }
.bx-none { padding: 18px 14px; font-size: 13.5px; }
.bx-tag { font-size: 11px; padding: 1px 6px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); margin-right: 6px; font-weight: 500; } .bx-tag.q { background: var(--surface); color: var(--text-2); }
.bx-pane { padding: 16px 18px; min-width: 0; }
.bx-pane .k { font-size: 12px; color: var(--text-2); } .bx-pane h2 { margin: 2px 0 2px; font-size: 18px; } .bx-pane .cl { color: var(--text-2); font-size: 13.5px; text-decoration: none; }
.bx-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 14px 0; }
.bx-facts div { background: var(--surface); border-radius: 8px; padding: 8px 10px; } .bx-facts span { display: block; font-size: 12px; color: var(--text-2); }
.bx-acts { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.bx-ph { font-size: 13px; font-weight: 600; color: var(--text-2); margin: 10px 0 8px; }
.bx-work { list-style: none; margin: 0; padding: 0; font-size: 13.5px; } .bx-work li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--rule-soft); }
.bx-choose { margin: 40px 0; text-align: center; }
@media (max-width: 1100px) { .bx { grid-template-columns: 220px minmax(0, 1fr); } .bx-pane { display: none; } }
@media (max-width: 760px) { .bx { grid-template-columns: minmax(0, 1fr); } .bx-side { display: none; } .bx-chips { display: flex; } }
.bx-all { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; margin-right: 8px; }
@media (max-width: 760px) { .bx { min-height: 0; } }
/* Returns (1.5.29): a blank mark in the filter list; the Monthly / QRMP switch */
.ri.b { box-shadow: inset 0 0 0 1px var(--rule-soft); background: var(--card); cursor: default; }
.rq-kind { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--surface); margin: 0 0 10px; font-size: 13px; }
.rq-kind a { padding: 5px 12px; border-radius: 999px; color: var(--text-2); text-decoration: none; }
.rq-kind a.on { background: var(--card); color: var(--text); font-weight: 600; box-shadow: var(--shadow); }

/* The foot of the menu (1.5.29): Mark attendance above the name; Sign out beside it */
.me .me-out { margin-left: auto; width: 34px; height: 34px; padding: 0; justify-content: center; flex: none; }
.me .me-out svg { width: 17px; height: 17px; }
.side-att { position: relative; margin: 0 0 12px; }
.side-att.sa-top { display: none; }
.sa-btn { display: flex; align-items: stretch; border-radius: 10px; overflow: hidden; }
.side-foot .sa-btn button, .side-att .sa-btn button { height: 38px; border-radius: 0; font-size: 13.5px; font-weight: 600; color: inherit; background: none; border: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.sa-btn .sa-go { flex: 1; min-width: 0; padding: 0 12px; text-align: left; }
.sa-btn .sa-go span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sa-btn .sa-ar { width: 34px; padding: 0; justify-content: center; border-left: 1px solid var(--side-line) !important; }
.sa-btn.todo { background: var(--side-raise); color: var(--side-text); }
.sa-btn.late { background: var(--accent); color: var(--ri-over-ink, #fff); }
.sa-btn.late .sa-ar { border-left-color: color-mix(in srgb, currentColor 30%, transparent) !important; }
.side-foot .sa-btn button:hover, .side-att .sa-btn button:hover { background: color-mix(in srgb, currentColor 10%, transparent); color: inherit; }
.sa-done { display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 10px; font-size: 13px; color: var(--side-muted); min-width: 0; }
.sa-done svg { color: var(--side-icon, var(--side-accent)); flex: none; }
.sa-done .sa-w { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sa-done b { color: var(--side-text); font-weight: 600; }
.side-foot .sa-done .sa-ch, .side-att .sa-done .sa-ch { margin-left: auto; height: auto; padding: 2px 4px; font-size: 12px; color: var(--side-muted); text-decoration: underline; }
.sa-menu { position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); z-index: 50; background: var(--card); color: var(--text); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 6px; display: flex; flex-direction: column; }
.sa-top .sa-menu { bottom: auto; top: calc(100% + 6px); }
.side-foot .sa-menu button, .side-att .sa-menu button, .sa-menu a { display: block; width: 100%; height: auto; padding: 8px 10px; border-radius: 6px; text-align: left; font-size: 13.5px; font-weight: 500; color: var(--text); background: none; border: 0; cursor: pointer; text-decoration: none; }
.side-foot .sa-menu button:hover, .side-att .sa-menu button:hover, .sa-menu a:hover { background: var(--hover); color: var(--text); }
.sa-menu button.on { font-weight: 700; }
.sa-menu .sa-mine { border-top: 1px solid var(--rule-soft); border-radius: 0 0 6px 6px; margin-top: 4px; color: var(--text-2); font-size: 13px; }
.tb { position: relative; }
.tb-dot { position: absolute; top: 6px; left: calc(50% + 8px); width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--bg); }
@media (min-width: 861px) {
  .rail .nav-pin { align-self: stretch; }
  .rail .side-att { align-self: center; margin-bottom: 10px; }
  .rail .sa-btn .sa-go { width: 36px; padding: 0; justify-content: center; }
  .rail .sa-btn .sa-go span, .rail .sa-btn .sa-ar, .rail .sa-done .sa-w, .rail .sa-done .sa-ch { display: none; }
  .rail .sa-btn.late { position: relative; overflow: visible; }
  .rail .sa-btn.late::after { content: ''; position: absolute; top: -3px; right: -3px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--side-bg); }
  .rail .sa-done { padding: 0; justify-content: center; width: 36px; height: 30px; }
  .rail .sa-menu { left: calc(100% + 8px); right: auto; bottom: 0; width: 200px; }
  .rail .me { flex-direction: column; gap: 6px; }
}
@media (max-width: 860px) {
  .side-att.sa-foot { display: none !important; }
  .side-att.sa-top:not(.hidden) { display: block; margin: 4px 0 12px; }
}

/* One style for every folder pane (1.5.30): headings and the top line bold in the main text colour,
   items in the main text colour, details in the secondary colour. */
.bx-f { color: var(--text); }
.bx-f[data-fold="all"] .nm { font-weight: 600; }
.bx-f .amt:not(.late) { color: var(--text-2); }
.ib-f { color: var(--text); }
.ib-f.grp, .ib-f[data-f="all"] { font-weight: 600; font-size: 14px; }
.fl { color: var(--text); }
li[aria-level="1"] > .frow .fl .nm { font-weight: 600; }

/* The person at the foot of the menu (1.5.30): name, role, version on three lines; Sign out on the right */
.me { align-items: center; }
.me-t { gap: 1px; }
.me-t .role { font-size: 12px; color: var(--side-muted); }
.me-t .ver { font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Smoothness (1.5.30): loading lines, page fade, menus, presses ---------- */
.tw-load { display: flex; justify-content: center; align-items: center; min-height: 46vh; animation: sp-fade 0.25s ease-out both; }
.tw-load .sp-rule { width: 96px; height: 10px; }
.tw-bar { position: sticky; top: 0; z-index: 20; height: 7px; width: 120px; margin: -12px 0 5px; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.tw-bar.on { opacity: 1; }
.tw-bar i { position: absolute; left: 0; right: 0; height: 2px; background: var(--rule); overflow: hidden; }
.tw-bar i:first-child { top: 0; } .tw-bar i:last-child { bottom: 0; }
.tw-bar i::after { content: ""; position: absolute; inset: 0; background: var(--accent); transform-origin: left; animation: sp-draw 1.6s cubic-bezier(0.65, 0, 0.35, 1) infinite; }
.tw-bar i:last-child::after { animation-delay: 0.18s; }
@keyframes tw-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes tw-drop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes tw-fade { from { opacity: 0; } to { opacity: 1; } }
#view.tw-in { animation: tw-in 0.16s ease-out; }
/* Menus: sub-menus open with a short drop; labels fade back in when the menu widens. */
.side .nav-top > span, .side .nav-head > span, .side-search span, .side-search kbd, .me-t, .side-att { animation: tw-fade 0.22s ease-out; }
.chev { transition: transform 0.18s ease; }
/* Presses and hovers */
.btn, .ri, .sa-btn button, .bx-f, .ib-f, .fl, .nav a, .nav-head { transition: background-color 0.15s, color 0.15s, box-shadow 0.15s, transform 0.08s; }
.btn:active, .sa-btn button:active { transform: scale(0.97); }
tr, .bx-row, .ib-row > button, .frow { transition: background-color 0.15s; }
/* Side panes: the chosen bill and the chosen message slide in */
#bx-pane > *, .ib-pane > * { animation: slide 0.2s ease-out; }
@media (prefers-reduced-motion: reduce) {
  .nav-sub, .nav-group:not(.open) > .nav-sub { transition: none; }
  #view.tw-in, .side .nav-top > span, .side .nav-head > span, .side-search span, .side-search kbd, .me-t, .side-att, #bx-pane > *, .ib-pane > * { animation: none; }
  .btn:active, .sa-btn button:active { transform: none; }
  /* the loading lines stay still and simply fade in */
  .tw-load .sp-rule i::after, .tw-bar i::after { animation: none; transform: none; }
}
@media (max-width: 860px) { .tw-bar { top: calc(56px + env(safe-area-inset-top)); margin: -8px 0 1px; } }
.bx-their { font-size: 12.5px; margin-left: 8px; color: var(--text-2); }
/* The collapsed menu keeps its hover pop-out: no height change there (1.5.31). */
@media (min-width: 861px) {
  .rail .nav-group > .nav-sub, .rail .nav-group:not(.open) > .nav-sub { max-height: none; opacity: 1; visibility: visible; overflow: visible; transition: none; margin: 0; }
}

/* Settings groups (1.5.32): You · Office · Clients · System as pill tabs, their pages under them */
.md-tabs button { display: inline-flex; align-items: center; gap: 6px; padding: 7px 16px; border-radius: 999px; border: 0; background: var(--surface); color: var(--text-2); font: inherit; font-size: 14px; cursor: pointer; }
.md-tabs button:hover { color: var(--text); }
.md-tabs button.on { background: var(--card); color: var(--text); font-weight: 600; box-shadow: var(--shadow); }
.set-groups { margin: 0 0 10px; }
.set-tabs.one { display: none; }
.tab-scroll:has(> .set-tabs.one) { display: none; }

/* Dashboard heading on one line (1.5.32): title, tabs, buttons */
.dash-head { align-items: center; margin-bottom: 18px; }
.dash-head .dh-ttl { display: flex; align-items: center; gap: 10px 22px; flex-wrap: wrap; min-width: 0; }
.dash-head h1 { margin: 0; }
.dash-head .dash-tabs { margin: 0; }
.dl-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 16px; }
.dl-head p { margin: 0; }
@media (max-width: 760px) {
  .dash-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; }
  .dash-head .dh-ttl { display: contents; }
  .dash-head .dash-tabs { grid-column: 1 / -1; grid-row: 2; }
}

/* Returns (1.5.32): the filer switch and the facts on one tinted strip; the table with Sl. No.,
   an even spread of return columns, a frozen and readable heading, and alternate rows. */
.rq-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px 18px; flex-wrap: wrap; background: var(--surface); border-radius: 12px; padding: 6px 12px 6px 6px; margin: 0 0 12px; }
.rq-bar .rq-kind { margin: 0; background: var(--card); }
.rq-bar .rq-line { margin: 0 0 0 auto; justify-content: flex-end; }
.rq-bar:not(:has(.rq-kind)) { padding-left: 12px; }
.rq-hm { max-height: calc(100vh - 230px); overflow: auto; }
.rq-t { table-layout: fixed; width: 100%; }
.rq-t col.rq-c-sl { width: 64px; } .rq-t col.rq-c-cl { width: 340px; }
.rq-t th, .rq-t td { width: auto; }
.rq-t thead th { position: sticky; top: 0; z-index: 2; background: var(--surface); border-bottom: 1.5px solid var(--border); padding: 12px 10px; color: var(--text); }
.rq-t thead th .rq-h { font-size: 14px; font-weight: 700; color: var(--text); }
.rq-t thead th small { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.rq-t .rq-sl { text-align: right; padding-right: 14px; color: var(--text-2); font-variant-numeric: tabular-nums; font-size: 13px; width: auto; }
.rq-t thead th.rq-sl { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.rq-t tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--surface) 55%, var(--card)); }
.rq-t tbody tr:hover td { background: var(--hover); }
@media (max-width: 860px) {
  .rq-hm { max-height: none; overflow-x: auto; }
  .rq-t { table-layout: auto; min-width: 100%; }
  .rq-t col.rq-c-cl { width: auto; } .rq-t col.rq-c-sl { width: 40px; }
  .rq-t thead th { top: calc(56px + env(safe-area-inset-top)); }
}
.rq-menu { position: fixed; z-index: 60; right: auto; }

/* Today's date and the tax year under the wordmark (1.5.32) */
.side-date { margin: -16px 12px 16px; font-size: 12px; color: var(--side-muted); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-date .sd-short { display: none; }
@media (min-width: 861px) {
  .rail .side-date { margin: -10px 0 12px; text-align: center; }
  .rail .side-date .sd-long { display: none; } .rail .side-date .sd-short { display: inline; }
}
/* My attendance as a side panel (1.5.32) */
.atm-drawer .at-grid { display: flex; flex-direction: column; gap: 14px; }
.atm-drawer .panel { margin: 0; box-shadow: none; border: 1px solid var(--rule-soft); }
.sa-done .sa-w[data-sa-mine] { cursor: pointer; }
.sa-done .sa-w[data-sa-mine]:hover b { text-decoration: underline; }
.side-date .sd-long { display: flex; flex-direction: column; gap: 1px; line-height: 1.35; }
.atm-drawer .at-grid { align-items: stretch; }
.atm-drawer .at-grid > .panel { width: auto; align-self: stretch; grid-column: auto; }

/* Attendance in the menu (1.5.33): "My attendance" opens the panel; the box marks today.
   Full colour only while today is not marked after office time; a soft tint once marked. */
.ma { position: relative; display: flex; align-items: center; gap: 4px; height: 40px; padding: 0 5px 0 0; border-radius: 10px; background: var(--side-raise); color: var(--side-text); }
.ma .ma-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px 0 12px; border: 0; background: none; color: inherit; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; border-radius: 10px; text-align: left; }
.ma .ma-open span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ma .ma-open svg { width: 17px; height: 17px; flex: none; color: var(--side-icon, currentColor); }
.side-foot .ma .ma-box, .side-att .ma .ma-box { flex: none; width: 32px; height: 28px; padding: 0; border: 0; border-radius: 7px; display: grid; place-items: center; font: inherit; font-size: 11.5px; font-weight: 700; cursor: pointer; background: transparent; color: var(--side-text); box-shadow: inset 0 0 0 1.5px var(--side-muted); }
.ma .ma-box:disabled { cursor: default; opacity: 0.6; box-shadow: inset 0 0 0 1px var(--side-line); color: var(--side-muted); }
.ma.s-done { background: color-mix(in srgb, var(--mc) 18%, var(--side-raise)); }
.side-foot .ma.s-done .ma-box, .side-att .ma.s-done .ma-box { background: var(--mc); color: #fff; box-shadow: none; }
.ma.s-late { background: var(--accent); color: var(--ri-over-ink, #fff); }
.ma.s-late .ma-open svg { color: currentColor; }
.side-foot .ma.s-late .ma-box, .side-att .ma.s-late .ma-box { background: rgba(255, 255, 255, 0.2); color: inherit; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, currentColor 60%, transparent); }
.ma.s-dayoff .ma-open { font-weight: 500; }
.ma .ma-open:hover { background: color-mix(in srgb, currentColor 8%, transparent); }
.ma-list { left: auto; right: 0; width: 200px; }
.ma-list h5 { margin: 4px 8px 6px; font-size: 11.5px; font-weight: 600; color: var(--text-2); }
.side-foot .ma-list button, .side-att .ma-list button { display: flex; align-items: center; gap: 10px; }
.ma-list button b { width: 28px; height: 20px; border-radius: 5px; display: grid; place-items: center; font-size: 11px; color: #fff; flex: none; }
.ma-list button.on { background: var(--surface); }
@media (min-width: 861px) {
  .rail .ma { flex-direction: column; height: auto; padding: 4px; gap: 4px; background: none; }
  .rail .ma .ma-open { width: 36px; height: 30px; padding: 0; justify-content: center; }
  .rail .ma .ma-open span { display: none; }
  .rail .ma-list { left: calc(100% + 8px); right: auto; bottom: 0; }
}
/* The date in the menu: a little larger and clearer (1.5.33) */
.side-date .sd-long span:first-child { font-size: 13px; font-weight: 600; color: var(--side-text); }
.side-date .sd-long span:last-child { font-size: 12.5px; }

/* Birthdays, work anniversaries and important dates on the Dashboard calendar (1.5.33) */
.cal-ev { display: block; font-size: 11.5px; line-height: 1.3; padding: 1px 6px; border-radius: 5px; background: color-mix(in srgb, var(--chart) 14%, var(--card)); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 2px; }
.cal-ev.date { background: color-mix(in srgb, var(--accent) 12%, var(--card)); }
.cs-ev { margin: 4px 0 0; font-size: 14px; color: var(--text); }

/* Team → People (1.5.33) */
.pp-find { margin: 0 0 12px; max-width: 520px; } .pp-find input { width: 100%; }
.pp-t tr[data-person] { cursor: pointer; }
.pp-t tr[data-person]:hover td { background: var(--hover); }
.pp-t tr.pp-g th { background: var(--surface); font-size: 14px; font-weight: 700; color: var(--text); text-align: left; padding: 8px 12px; }
.pp-bg { display: inline-block; min-width: 34px; text-align: center; padding: 1px 6px; border-radius: 6px; background: color-mix(in srgb, var(--accent) 12%, var(--card)); font-weight: 600; font-size: 12.5px; }
.pp-contact a { color: var(--text); text-decoration: none; } .pp-contact a.muted { color: var(--text-2); font-size: 12.5px; }
.pp-off { margin-top: 14px; } .pp-off summary { cursor: pointer; font-weight: 600; margin-bottom: 8px; }
.pp-panel h3 { font-size: 13px; text-transform: none; color: var(--text-2); margin: 16px 0 6px; font-weight: 600; }
.pp-dl { display: grid; grid-template-columns: 1fr; gap: 6px; margin: 0; }
.pp-dl > div { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 10px; }
.pp-dl dt { color: var(--text-2); font-size: 13px; } .pp-dl dd { margin: 0; font-size: 14px; }
.pp-acts { margin-top: 18px; flex-wrap: wrap; }
@media (max-width: 760px) { .pp-t th:nth-child(3), .pp-t td:nth-child(3), .pp-t th:nth-child(4), .pp-t td:nth-child(4) { display: none; } .pp-t tr.pp-g th { display: table-cell; } }
@media (max-width: 760px) { .pp-t { width: 100%; } .pp-contact { word-break: break-word; } .pp-contact a.muted { display: none; } .pp-contact br { display: none; } }
@media (max-width: 760px) { .pp-t td, .pp-t th { padding-left: 6px; padding-right: 6px; } .pp-t .tag { display: none; } }

/* My attendance page, redesigned (1.5.36): month card + Today, then two rows of equal pairs; one card rhythm. */
.mat { display: flex; flex-direction: column; gap: 20px; }
.ma-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
.ma-row.ma-top { grid-template-columns: minmax(0, 2.1fr) minmax(280px, 1fr); }
.mat .ma-card { grid-row: auto; margin: 0; padding: 24px; border-radius: 16px; display: flex; flex-direction: column; min-width: 0; }
.mat .ma-card h2, .mat .ma-card .md-ph h2 { font-size: 16px; font-weight: 700; margin: 0 0 16px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.mat .ma-card .md-ph { margin: 0 0 16px; } .mat .ma-card .md-ph h2 { margin: 0; }
.ma-mhead { display: flex; align-items: center; gap: 8px; margin: 0 0 16px; flex-wrap: wrap; }
.mp { position: relative; }
.mp-btn { display: inline-flex; align-items: center; justify-content: space-between; gap: 14px; min-width: 190px; height: 36px; padding: 0 12px; border: 0; border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.mp-btn:hover { background: var(--hover); }
.mp-btn svg { width: 17px; height: 17px; fill: none; stroke: var(--text-2); stroke-width: 1.8; stroke-linecap: round; }
.mp-btn:focus-visible, .mp-y:focus-visible, .mp-m:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.mp-card { position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; width: 300px; padding: 14px 14px 12px; background: var(--card); border-radius: 14px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18), 0 0 0 1px var(--rule-soft); }
.mp-head { display: flex; align-items: center; justify-content: space-between; margin: 0 0 10px; }
.mp-head b { font-size: 17px; font-weight: 700; }
.mp-y { width: 34px; height: 34px; border: 0; border-radius: 9px; background: none; color: var(--text); font-size: 20px; line-height: 1; cursor: pointer; }
.mp-y:hover:not([disabled]) { background: var(--hover); }
.mp-y[disabled] { color: var(--text-3); cursor: default; }
.mp-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.mp-m { height: 40px; border: 0; border-radius: 9px; background: none; color: var(--text); font: inherit; font-size: 14.5px; cursor: pointer; }
.mp-m:hover:not([disabled]) { background: var(--hover); }
.mp-m.now { font-weight: 700; }
.mp-m.on { background: var(--main-btn-bg, var(--text)); color: var(--main-btn-text, var(--card)); font-weight: 700; }
.mp-m[disabled] { color: var(--text-3); opacity: 0.45; cursor: default; }
.ma-mhead .btn { min-width: 34px; justify-content: center; }
.ma-mbody { flex: 1; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(210px, 1fr); gap: 24px; }
.ma-calbox { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ma-calbox .at-cal-grid { flex: 1; grid-template-rows: auto; grid-auto-rows: minmax(48px, 1fr); }
.ma-calbox .at-cal-grid .at-w { align-self: end; }
.ma-calbox .at-kinds { margin: 2px 0 0; }
.at-cal-grid.hl-on .at-c[data-day]:not(.hl) { opacity: 0.32; }
.at-cal-grid.hl-on .at-c.hl { box-shadow: 0 0 0 2px var(--text); }
.ma-counts { border-left: 1px solid var(--rule-soft); padding-left: 24px; min-width: 0; }
.ma-counts h3 { margin: 0 0 8px; font-size: 13.5px; font-weight: 700; }
.ma-ct.at-sum { display: table; width: 100%; margin: 0; border-collapse: collapse; font-size: 14px; }
.ma-ct td { padding: 7px 6px; border-radius: 6px; }
.ma-ct td .at-sw { margin-right: 8px; vertical-align: -1px; }
.ma-ct td.num { text-align: right; font-weight: 600; width: 1%; white-space: nowrap; }
.ma-ct tr { cursor: pointer; }
.ma-ct tr:hover td, .ma-ct tr.on td { background: var(--hover); }
.ma-ct .ma-strong td { font-weight: 700; }
.ma-ct .ma-ct2 tr:first-child td { border-top: 1px solid var(--rule-soft); padding-top: 11px; }
.ma-ct .ma-ct2::before { content: ''; display: table-row; height: 6px; }
.mat .at-today .at-mark { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.ma-mk { flex: 1; min-height: 44px; display: flex; align-items: center; gap: 12px; padding: 6px 12px; border: 0; border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; font-size: 14.5px; font-weight: 600; cursor: pointer; text-align: left; }
.ma-mk:hover { background: var(--hover); }
.ma-mk b { flex: none; width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-size: 12.5px; font-weight: 700; background: var(--at); color: var(--at-ink); }
.ma-mk.on { background: var(--at); color: var(--at-ink); }
.ma-mk.on b { background: color-mix(in srgb, var(--at-ink) 16%, transparent); color: var(--at-ink); }
/* Text on the full attendance colours: dark ink, or the card colour where that reads better (at least 4:1 in Paper white and Graphite). */
.ma-mk { --at-ink: var(--att-ink); }
.ma-mk.on:hover { background: var(--at); }
.ma-mk:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.ma-tline { margin: 12px 0 0; font-size: 13px; }
.mat .at-today.is-off .at-mark { display: none; }
.mat .at-today.is-off .ma-tline { font-size: 15px; font-weight: 600; margin: 4px 0 14px; }
.ma-anyway { align-self: flex-start; }
.ma-bals { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.ma-bals > .ma-bal { flex: 1; display: flex; flex-direction: row; align-items: center; text-align: left; border: 0; justify-content: space-between; gap: 12px; padding: 12px 16px; border-radius: 12px; background: var(--surface); }
.ma-bals .ma-bal .l { font-weight: 600; font-size: 14px; }
.ma-bals .ma-bal .r { display: flex; align-items: baseline; gap: 10px; text-align: right; }
.ma-bals .ma-bal .v { font-size: 24px; font-weight: 700; line-height: 1; }
.ma-bals .ma-bal .s { font-size: 12.5px; color: var(--text-2); }
.mat .at-chart .at-bars { flex: 1; justify-content: space-between; }
.mat .at-list { margin: 0; }
@media (max-width: 1100px) {
  .ma-row, .ma-row.ma-top { grid-template-columns: minmax(0, 1fr); }
  .ma-row.ma-top .at-today { order: -1; }
}
@media (max-width: 700px) {
  .mat { gap: 14px; } .ma-row { gap: 14px; }
  .mat .ma-card { padding: 16px; }
  .ma-mbody { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .ma-counts { border-left: 0; padding-left: 0; border-top: 1px solid var(--rule-soft); padding-top: 14px; }
  .mp { flex: 1; } .mp-btn { width: 100%; min-width: 0; } .mp-card { width: min(300px, calc(100vw - 64px)); }
  .ma-calbox .at-cal-grid { grid-auto-rows: minmax(42px, 1fr); }
  .ma-mk { min-height: 44px; }
}

/* The person side panel (1.5.34) */
dialog.drawer.pp3-drawer { width: min(460px, 100vw); box-shadow: -20px 0 60px rgba(0, 0, 0, 0.18); }
.pp3-drawer .d-head { position: absolute; top: 12px; right: 12px; padding: 0; border: 0; background: none; z-index: 2; }
.pp3-drawer .d-head h2 { display: none; }
.pp3-drawer .d-head .x { width: 34px; height: 34px; border-radius: 50%; background: var(--surface); font-size: 19px; }
.pp3-drawer .d-body { padding: 0; display: flex; flex-direction: column; overflow: auto; }
.pp3-drawer .d-foot { padding: 14px 24px; border-top: 1px solid var(--rule-soft); display: flex; gap: 10px; justify-content: stretch; }
.pp3-drawer .d-foot .btn { height: 42px; padding: 0 20px; font-size: 14px; }
.pp3-drawer .d-foot .btn.main { flex: 1; justify-content: center; }
.pp3 { display: flex; flex-direction: column; min-height: 100%; }
.pp3-head { display: grid; grid-template-columns: 56px minmax(0, 1fr); grid-template-rows: auto auto; gap: 4px 14px; align-items: center; padding: 26px 24px 18px; border-bottom: 1px solid var(--rule-soft); }
.pp3-av { grid-row: span 2; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 19px; color: #fff; background: var(--rc, var(--chart)); }
.pp3-who { min-width: 0; padding-right: 36px; }
.pp3-who h2 { margin: 0; font-size: 20px; line-height: 1.2; overflow-wrap: anywhere; }
.pp3-who .sub { color: var(--text-2); font-size: 13.5px; margin-top: 3px; }
.pp3-sw { justify-self: start; display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; padding: 4px 0; font: inherit; font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.pp3-sw i { width: 38px; height: 22px; border-radius: 999px; background: var(--border); position: relative; transition: background 0.15s; flex: none; }
.pp3-sw i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); transition: left 0.15s; }
.pp3-sw.on { color: var(--ri-ok); } .pp3-sw.on i { background: var(--ri-ok); } .pp3-sw.on i::after { left: 19px; }
.pp3-sw:disabled { cursor: default; opacity: 0.7; }
.pp3-quick { display: flex; gap: 10px; padding: 16px 24px; border-bottom: 1px solid var(--rule-soft); }
.pp3-quick a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 0; border-radius: 12px; background: var(--surface); color: var(--text); text-decoration: none; font-size: 12.5px; font-weight: 600; }
.pp3-quick a:hover { background: var(--hover); }
.pp3-quick a svg { width: 20px; height: 20px; }
.pp3-quick a.dim { opacity: 0.45; pointer-events: none; }
.pp3-body { flex: 1; padding: 16px 24px 24px; display: flex; flex-direction: column; gap: 12px; background: color-mix(in srgb, var(--surface) 35%, var(--card)); }
.pp3-card { background: var(--card); border-radius: 14px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 0 0 1px var(--rule-soft); padding: 14px 16px; }
.pp3-card h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 13.5px; font-weight: 700; color: var(--text); text-transform: none; letter-spacing: 0; }
.pp3-card h3 svg { width: 16px; height: 16px; color: var(--text-2); }
.pp3-row { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 12px; padding: 8px 0; border-top: 1px solid var(--rule-soft); font-size: 14px; }
.pp3-card h3 + .pp3-row { border-top: 0; }
.pp3-row > span:first-child { color: var(--text-2); font-size: 13px; }
.pp3-row a { color: var(--text); }
.pp3-row small { color: var(--text-2); }
.pp3-na { color: var(--text-3); }
.pp3-add { font-size: 13px; color: var(--text-2); }
.pp3-note { margin: 6px 0 0; font-size: 12.5px; color: var(--text-2); }
.pp3-addr { white-space: pre-line; }
#my-details .md-h { margin: 10px 0 -2px; font-size: 13.5px; font-weight: 700; color: var(--text); }
#my-details .md-h:first-child { margin-top: 0; }
.pp3-morebox { position: relative; }
.pp3-more { position: absolute; right: 0; bottom: calc(100% + 8px); width: 230px; background: var(--card); border-radius: 12px; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.16); padding: 6px; display: flex; flex-direction: column; z-index: 5; }
.pp3-more > * { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 8px; border: 0; background: none; font: inherit; font-size: 13.5px; color: var(--text); text-decoration: none; cursor: pointer; }
.pp3-more > *:hover { background: var(--hover); }
.pp3-more .del { color: var(--accent); }
@media (max-width: 760px) { .pp3-row { grid-template-columns: 110px minmax(0, 1fr); } }

/* Clients list (1.5.38): folders card on the left, one tidy list card on the right. */
.cl-page .explorer { grid-template-columns: 250px minmax(0, 1fr); gap: 24px; background: transparent; border: 0; box-shadow: none; }
.cl-page .folders { background: var(--card); border: 0; border-radius: 16px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 0 0 1px var(--rule-soft); padding: 12px 8px 14px; top: 16px; max-height: calc(100vh - 32px); }
.cl-page .frow.on { box-shadow: inset 3px 0 0 var(--text); }
.cl-page .xlist { padding: 0; }
.cl-page .xhead { margin: 0 0 12px; }
.cl-page .crumbs h2 { font-size: 16px; }
.cl-tools { display: flex; gap: 10px; align-items: center; margin: 0 0 14px; }
.cl-tools input[type=search] { flex: 1; min-width: 0; height: 42px; border-radius: 12px; padding: 0 14px; font-size: 14px; }
.cl-fbox { position: relative; }
.cl-tools .btn { height: 42px; }
#cl-filters.on, #tk-filters.on { background: var(--main-btn-bg, var(--text)); color: var(--main-btn-text, var(--card)); }
#cl-filters b, #tk-filters b { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: 6px; padding: 0 6px; border-radius: 999px; background: var(--card); color: var(--text); font-size: 11.5px; }
.cl-sort { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 4px 0 12px; border-radius: 12px; background: var(--surface); font-size: 13px; color: var(--text-2); }
.cl-sort select { width: auto; height: 36px; border: 0; background: transparent; font-weight: 600; color: var(--text); padding-right: 26px; }
.cl-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 4px 4px 12px; border-radius: 999px; background: var(--surface); font-size: 13px; font-weight: 600; }
.cl-chip button { width: 22px; height: 22px; border: 0; border-radius: 50%; background: none; color: var(--text-2); cursor: pointer; font-size: 12px; }
.cl-chip button:hover { background: var(--hover); color: var(--text); }
.cl-chip-acts { display: inline-flex; gap: 12px; margin-left: auto; }
.cl-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; width: min(540px, calc(100vw - 32px)); padding: 20px; background: var(--card); border-radius: 16px; box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18), 0 0 0 1px var(--rule-soft); }
.cl-pop .field { margin: 0 0 14px; }
.cl-pop .field > span { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.cl-pop-h { display: flex; justify-content: space-between; align-items: center; margin: 0 0 14px; }
.cl-pop-h b { font-size: 16px; }
.cl-pop-g { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.cl-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.cl-seg button { height: 34px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--surface); color: var(--text); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.cl-seg button.on { background: var(--main-btn-bg, var(--text)); color: var(--main-btn-text, var(--card)); }
.cl-checks { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.cl-checks .check { margin: 0; display: inline-flex; align-items: center; gap: 6px; }
.cl-pop-f { display: flex; justify-content: flex-end; gap: 10px; padding-top: 14px; border-top: 1px solid var(--rule-soft); }
.cl-morebox { position: relative; }
.cl-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; min-width: 220px; padding: 6px; background: var(--card); border-radius: 12px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16), 0 0 0 1px var(--rule-soft); display: flex; flex-direction: column; }
.cl-menu > button { padding: 9px 12px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.cl-menu > button:hover, .cl-menu > button:focus-visible { background: var(--hover); outline: none; }
table.cl-tbl { width: 100%; table-layout: fixed; }
table.cl-tbl th { height: 44px; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-2); background: color-mix(in srgb, var(--surface) 60%, var(--card)); }
table.cl-tbl td, table.cl-tbl th { padding: 12px 14px; vertical-align: middle; }
table.cl-tbl td:first-child, table.cl-tbl th:first-child { padding-left: 22px; }
table.cl-tbl tbody tr { height: 66px; }
table.cl-tbl tbody tr:hover { background: var(--hover); }
table.cl-tbl .cl-c { width: 86px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
table.cl-tbl .cl-p { width: 128px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; letter-spacing: 0.02em; white-space: nowrap; }
table.cl-tbl th.cl-p { font-family: inherit; letter-spacing: 0.04em; }
table.cl-tbl .cl-k { width: 200px; }
table.cl-tbl .cl-w { width: 170px; white-space: nowrap; }
table.cl-tbl .cl-nl { display: flex; align-items: center; gap: 8px; min-width: 0; }
table.cl-tbl .cl-nl b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
table.cl-tbl .sub { display: block; margin-top: 2px; font-size: 12.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.cl-tbl .cl-k b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.cl-tbl .cl-k a { color: inherit; text-decoration: none; }
table.cl-tbl .cl-k a:hover { text-decoration: underline; }
table.cl-tbl .cl-none { color: var(--text-3); }
.cl-st { flex: none; padding: 2px 9px; border-radius: 999px; background: var(--surface); color: var(--text-2); font-size: 11.5px; font-weight: 700; }
.cl-st.st-dormant { background: color-mix(in srgb, #C9A35B 24%, var(--card)); color: var(--text); }
@media (max-width: 1100px) { table.cl-tbl .cl-p { display: none; } }
@media (max-width: 860px) {
  .cl-page .explorer { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .cl-page .folders { position: static; max-height: 60vh; }
  .cl-page .folders { box-shadow: var(--shadow); }
  .cl-tools { flex-wrap: wrap; }
  .cl-tools input[type=search] { flex-basis: 100%; }
  .cl-fbox { flex: 1; } .cl-fbox > .btn { width: 100%; justify-content: center; }
  .cl-pop { right: auto; left: 0; }
  .cl-pop-g { grid-template-columns: minmax(0, 1fr); }
  /* Each client a card on a phone: code and name; type and PAN; contact; work. */
  table.cl-tbl, table.cl-tbl tbody { display: block; }
  table.cl-tbl thead { display: none; }
  table.cl-tbl tbody tr { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; height: auto; padding: 14px 16px; border-bottom: 1px solid var(--rule-soft); }
  table.cl-tbl td { padding: 0 !important; border: 0; width: auto !important; }
  table.cl-tbl td.cl-c { grid-row: 1; grid-column: 1; align-self: start; padding-top: 1px !important; }
  table.cl-tbl td.cl-n { grid-row: 1; grid-column: 2; }
  table.cl-tbl td.cl-p { display: block; grid-column: 2; font-size: 12.5px; color: var(--text-2); }
  table.cl-tbl td.cl-k { grid-column: 2; font-size: 13px; }
  table.cl-tbl td.cl-k b, table.cl-tbl td.cl-k .sub { display: inline; margin: 0; }
  table.cl-tbl td.cl-k .sub::before { content: " · "; }
  table.cl-tbl td.cl-w { grid-column: 2; font-size: 13px; margin-top: 4px; }
  table.cl-tbl td.cl-p .cl-none, table.cl-tbl td.cl-k .cl-none { display: none; }
}

/* Clients list 1.5.39: one top row that stays in place (title and counts, search · Filters · Sort, ⋯ More · Add client);
   below it the folders and the list, the same top and height, filling the screen; the rows scroll inside the list. */
.cl-top { position: relative; z-index: 30; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 24px; align-items: center; margin: 0 0 16px; padding: 6px 0; }
.cl-title h1 { margin: 0; font-size: 24px; }
.cl-title p { margin: 2px 0 0; font-size: 13.5px; white-space: nowrap; }
.cl-title p b { color: var(--text); font-weight: 600; }
.cl-top .cl-tools { margin: 0; min-width: 0; }
.cl-top .cl-acts { flex-wrap: nowrap; }
.cl-page .xhead { display: none; }
.cl-page .explorer { align-items: stretch; }
@media (min-width: 861px) {
  .cl-page .explorer { height: var(--cl-h, calc(100vh - 150px)); }
  .cl-page .folders { position: static; height: 100%; max-height: none; }
  .cl-page .xlist { display: flex; flex-direction: column; min-height: 0; }
  .cl-page .cl-card { flex: 1; min-height: 0; }
}
.cl-page .cl-card { display: flex; flex-direction: column; background: var(--card); border-radius: 16px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 0 0 1px var(--rule-soft); overflow: hidden; }
.cl-card-h { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; min-height: 56px; padding: 10px 22px; border-bottom: 1px solid var(--rule-soft); }
.cl-card-h h2 { margin: 0; font-size: 16px; }
.cl-shown { font-size: 13px; color: var(--text-2); margin-right: 4px; }
.cl-card-h .cl-chips { display: contents; }
.cl-card-h .cl-chip { font-size: 12.5px; }
.cl-card-h .cl-chip-acts { margin-left: auto; }
.cl-scroll { flex: 1; min-height: 0; overflow: auto; }
.cl-scroll .empty { margin: 24px; }
.cl-page .cl-card .table-foot { padding: 12px 22px; border-top: 1px solid var(--rule-soft); }
table.cl-tbl thead th { position: sticky; top: 0; z-index: 2; }
table.cl-tbl tbody tr:nth-child(even) { background: color-mix(in srgb, var(--surface) 55%, var(--card)); }
table.cl-tbl tbody tr:hover { background: var(--hover); }
@media (max-width: 1180px) { .cl-top { grid-template-columns: minmax(0, 1fr) auto; } .cl-top .cl-tools { grid-column: 1 / -1; grid-row: 2; } }
@media (max-width: 860px) {
  .cl-top { position: static; grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .cl-top .cl-tools { grid-row: auto; }
  .cl-title p { white-space: normal; }
  .cl-card-h { padding: 10px 16px; }
  table.cl-tbl tbody tr:nth-child(even) { background: transparent; }
}
/* Clients (1.5.40): on a PC the page itself never scrolls; only the folders and the rows do. */
@media (min-width: 861px) {
  .main:has(.cl-page) { padding-bottom: 24px; }
  html:has(.cl-page), body:has(.cl-page) { overflow-y: hidden; }
}

/* Tasks (1.5.41): laid out like Clients (.cl-top, .cl-page, .cl-card); the list in bands by due date. */
.tk-page .bulk-bar { margin: 0; padding: 10px 22px; border-bottom: 1px solid var(--rule-soft); border-radius: 0; }
table.tk-tbl { width: 100%; table-layout: fixed; }
table.tk-tbl th { position: sticky; top: 0; z-index: 2; height: 44px; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-2); background: color-mix(in srgb, var(--surface) 60%, var(--card)); }
table.tk-tbl td, table.tk-tbl th { padding: 10px 12px; vertical-align: middle; }
table.tk-tbl th.pick, table.tk-tbl td.pick { width: 52px; padding-left: 22px; }
table.tk-tbl .tk-due { width: 112px; white-space: nowrap; }
table.tk-tbl td.tk-due b { display: block; font-weight: 600; }
table.tk-tbl td.tk-due small { display: block; font-size: 12px; color: var(--text-2); margin-top: 1px; }
table.tk-tbl td.tk-due.due-late b, table.tk-tbl td.tk-due.due-late small { color: var(--accent); }
table.tk-tbl .tk-who { width: 150px; }
table.tk-tbl .tk-asg { width: 120px; }
table.tk-tbl td.tk-asg b { display: block; font-weight: 500; white-space: nowrap; }
table.tk-tbl td.tk-asg .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
table.tk-tbl td.tk-who { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
table.tk-tbl .st-cell { width: 190px; }
table.tk-tbl .tl-col { width: 52px; }
table.tk-tbl .cl-nl { display: flex; align-items: center; gap: 8px; min-width: 0; }
table.tk-tbl .cl-nl > b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
table.tk-tbl .cl-nl .bill-chip, table.tk-tbl .cl-nl .tag { flex: none; }
table.tk-tbl .sub { display: block; margin-top: 2px; font-size: 12.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-urg { flex: none; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 11.5px; font-weight: 700; }
table.tk-tbl tbody tr[data-task]:nth-child(even) { background: color-mix(in srgb, var(--surface) 55%, var(--card)); }
table.tk-tbl tbody tr[data-task]:hover { background: var(--hover); }
table.tk-tbl tbody tr.picked { background: color-mix(in srgb, var(--accent) 8%, var(--card)); }
table.tk-tbl tr.tk-band td { padding: 14px 22px 6px; background: var(--card); font-size: 12.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-2); border-bottom: 0; }
table.tk-tbl tr.tk-band.late td { color: var(--accent); }
table.tk-tbl tr.tk-band i { font-style: normal; margin-left: 8px; opacity: 0.85; }
.tk-pop .cl-pop-full { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.tk-pop .cl-pop-full.hidden { display: none; }
.tk-pop .cl-pop-f { border-top: 0; padding-top: 4px; }
@media (max-width: 1180px) { table.tk-tbl .tk-who { width: 130px; } table.tk-tbl .st-cell { width: 170px; } table.tk-tbl .tk-asg { display: none; } }
@media (max-width: 860px) {
  /* Each task a card on a phone: due and status; the task; the client and the person. */
  table.tk-tbl, table.tk-tbl tbody { display: block; }
  table.tk-tbl thead { display: none; }
  table.tk-tbl tbody tr[data-task] { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 4px 10px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--rule-soft); background: transparent !important; }
  table.tk-tbl td { padding: 0 !important; border: 0; width: auto !important; }
  table.tk-tbl td.pick { grid-row: 1 / span 3; grid-column: 1; align-self: start; padding-top: 2px !important; }
  table.tk-tbl td.tk-due { grid-row: 1; grid-column: 2 / -1; display: flex; gap: 8px; align-items: baseline; }
  table.tk-tbl td.tk-due small { margin: 0; }
  table.tk-tbl td.tk-name { grid-row: 2; grid-column: 2 / -1; }
  table.tk-tbl td.tk-name .cl-nl > b { white-space: normal; }
  table.tk-tbl td.tk-who { grid-row: 3; grid-column: 2; font-size: 12.5px; color: var(--text-2); }
  table.tk-tbl td.st-cell { grid-row: 3; grid-column: 3; justify-self: end; }
  table.tk-tbl td.st-cell .st-select { max-width: none; min-width: 140px; }
  table.tk-tbl td.tl-col { grid-row: 3; grid-column: 4; justify-self: end; }
  table.tk-tbl tr.tk-band { display: block; }
  table.tk-tbl tr.tk-band td { display: block; padding: 12px 14px 4px !important; }
  .tk-page .bulk-bar { padding: 10px 14px; flex-wrap: wrap; }
}


/* A client's own page (1.5.42): top part and tabs stay in place; tabs drawn one at a time. */
.cp-top.page-head { display: flex; flex-wrap: nowrap; justify-content: space-between; align-items: flex-end; gap: 20px; margin: -6px 0 0; padding: 6px 0 12px; }
.cp-who { min-width: 0; }
.cp-who .back { display: inline-block; margin: 0 0 4px; }
.cp-who h1 { margin: 0; font-size: 24px; overflow-wrap: anywhere; }
.cp-who p { margin: 4px 0 0; font-size: 13.5px; }
.cp-stchip { margin-left: 4px; vertical-align: 1px; }
.cl-st.st-active { background: color-mix(in srgb, var(--dot-done) 20%, var(--card)); color: var(--text); }
.cl-st.st-inactive { background: var(--surface); color: var(--text-2); }
.cp-acts { flex: none; flex-wrap: nowrap; }
.cl-menu .del { color: var(--accent); }
.cp-tabs { display: flex; gap: 2px; margin: 0 0 18px; border-bottom: 1px solid var(--rule-soft); overflow-x: auto; scrollbar-width: none; }
/* On a computer the page never scrolls: the top part and the tabs stay; the tab's content scrolls inside. */
@media (min-width: 861px) {
  .main:has(.cp-pane) { padding-bottom: 24px; }
  html:has(.cp-pane), body:has(.cp-pane) { overflow-y: hidden; }
  .cp-pane.cp-details, .cp-pane.cp-setup, .cp-pane.cp-hours { height: var(--cp-h, 600px); overflow-y: auto; margin: 0 -6px; padding: 2px 6px 6px; }
}
.cp-pane { --ov-1: var(--text); --ov-2: var(--dot-done); }
.cp-tabs::-webkit-scrollbar { display: none; }
.cp-tabs button { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; color: var(--text-2); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.cp-tabs button:hover { color: var(--text); }
.cp-tabs button.on { color: var(--text); border-bottom-color: var(--text); }
.cp-tabs .cp-late { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 11.5px; }
/* Details */
.cp-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
.cp-card { background: var(--card); border-radius: 16px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 0 0 1px var(--rule-soft); padding: 18px 22px; min-width: 0; }
.cp-card h3 { margin: 0 0 6px; font-size: 15px; font-weight: 700; }
.cp-r { display: grid; grid-template-columns: 124px minmax(0, 1fr); gap: 10px; padding: 8px 0; border-top: 1px solid var(--rule-soft); font-size: 14px; }
.cp-card h3 + .cp-r { border-top: 0; }
.cp-r > span:first-child { color: var(--text-2); font-size: 13px; }
.cp-r > span { min-width: 0; overflow-wrap: anywhere; }
.cp-r .mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; letter-spacing: 0.02em; }
.cp-r small { color: var(--text-2); font-size: 12.5px; }
.cp-r a { color: var(--text); }
.cp-na { color: var(--text-3); }
.cp-na .link-btn { margin-left: 6px; }
.cp-notes { margin-top: 20px; }
.cp-notes p { margin: 0; white-space: pre-wrap; font-size: 14px; }
/* Setup */
.cp-addrow { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.cp-list { background: var(--card); border-radius: 16px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 0 0 1px var(--rule-soft); margin: 0 0 20px; overflow: visible; }
.cp-lh { display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 10px 22px; border-bottom: 1px solid var(--rule-soft); }
.cp-lh h3 { margin: 0; font-size: 16px; }
.cp-lh span { font-size: 13px; color: var(--text-2); }
table.cp-t { width: 100%; border-collapse: collapse; table-layout: fixed; }
table.cp-t th { text-align: left; height: 42px; padding: 0 14px; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-2); background: color-mix(in srgb, var(--surface) 60%, var(--card)); }
table.cp-t td { padding: 11px 14px; font-size: 14px; border-top: 1px solid var(--rule-soft); vertical-align: middle; }
table.cp-t th:first-child, table.cp-t td:first-child { padding-left: 22px; width: 32%; }
table.cp-t td b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.cp-t td small { display: block; font-size: 12.5px; color: var(--text-2); margin-top: 2px; }
table.cp-t .n { text-align: right; font-variant-numeric: tabular-nums; }
table.cp-t tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--surface) 55%, var(--card)); }
table.cp-t tbody tr.clickable:hover td { background: var(--hover); }
table.cp-t .cp-dcell { width: 56px; text-align: center; }
.cp-chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--surface); color: var(--text-2); }
.cp-chip.run { background: color-mix(in srgb, var(--dot-done) 20%, var(--card)); color: var(--text); }
.cp-chip.pz { background: color-mix(in srgb, #C9A35B 24%, var(--card)); color: var(--text); }
.cp-none { padding: 16px 22px; font-size: 14px; color: var(--text-2); }
.cp-none .link-btn { margin-left: 6px; color: var(--text); font-weight: 600; }
.cp-dotbox { position: relative; display: inline-block; }
.cp-dots { width: 32px; height: 30px; border: 0; border-radius: 8px; background: none; color: var(--text-2); font: inherit; font-size: 16px; cursor: pointer; }
.cp-dots:hover { background: var(--hover); color: var(--text); }
.cp-dmenu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; min-width: 170px; padding: 6px; background: var(--card); border-radius: 12px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16), 0 0 0 1px var(--rule-soft); display: flex; flex-direction: column; text-align: left; }
.cp-dmenu.hidden { display: none; }
.cp-dmenu > button { padding: 8px 12px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.cp-dmenu > button:hover { background: var(--hover); }
.cp-dmenu .del { color: var(--accent); }
/* Work, Billing: the explorer fills the window under the tabs */
.cp-tools { margin: 0 0 14px; }
.cp-explorer .explorer { grid-template-columns: 240px minmax(0, 1fr); }
@media (min-width: 861px) { .cp-explorer .explorer { height: var(--cl-h, 560px); } }
.cp-inline { margin-left: 10px; }
.cp-rm, .cp-oa { padding: 8px 22px 16px; }
/* Billing and Hours: four figures beside a graph, the same height */
.cp-figrow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 20px; margin: 0 0 18px; align-items: stretch; }
.cp-figs { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cp-fig { background: var(--card); border-radius: 16px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 0 0 1px var(--rule-soft); padding: 14px 20px; min-width: 0; }
.cp-fig small { display: block; font-size: 13px; color: var(--text-2); }
.cp-fig b { display: block; margin: 2px 0; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-fig span { font-size: 12.5px; color: var(--text-2); }
.cp-fig.bad b { color: var(--accent); }
.cp-chart { display: flex; flex-direction: column; justify-content: space-between; min-width: 0; background: var(--card); border-radius: 16px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 0 0 1px var(--rule-soft); padding: 14px 22px 10px; }
.cp-chh { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; margin: 0 0 8px; }
.cp-chh b { font-size: 15px; }
.cp-chh span { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.cp-chh i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-left: 6px; }
.cp-chh i.k1 { background: var(--ov-1); } .cp-chh i.k2 { background: var(--ov-2); } .cp-chh i.ln { height: 3px; }
.cp-chh small { margin-left: auto; font-size: 12.5px; color: var(--text-2); }
.cp-svg { width: 100%; height: 150px; display: block; }
.cp-svg .s1 { fill: var(--ov-1); } .cp-svg .s2 { fill: var(--ov-2); }
.cp-svg .ln { stroke: var(--ov-1); stroke-width: 2; vector-effect: non-scaling-stroke; } .cp-svg .dot { fill: var(--ov-1); }
.cp-svg text { font-size: 11px; fill: var(--text-2); }
table.cp-bt { width: 100%; table-layout: fixed; }
table.cp-bt th { position: sticky; top: 0; z-index: 2; height: 44px; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-2); background: color-mix(in srgb, var(--surface) 60%, var(--card)); }
table.cp-bt td, table.cp-bt th { padding: 10px 12px; vertical-align: middle; }
table.cp-bt .cb-d { width: 150px; padding-left: 22px; }
table.cp-bt td.cb-d b { display: block; font-weight: 600; }
table.cp-bt td.cb-d small { display: block; font-size: 12px; color: var(--text-2); white-space: nowrap; }
table.cp-bt td.cb-d.due-late b, table.cp-bt td.cb-d.due-late small { color: var(--accent); }
table.cp-bt .n { width: 110px; text-align: right; font-variant-numeric: tabular-nums; }
table.cp-bt .cb-tds { width: 90px; }
table.cp-bt .cb-st { width: 130px; }
table.cp-bt .cb-a { width: 150px; text-align: right; padding-right: 22px; }
table.cp-bt .cl-nl > b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
table.cp-bt .sub { display: block; font-size: 12.5px; color: var(--text-2); }
table.cp-bt tbody tr:nth-child(even) { background: color-mix(in srgb, var(--surface) 55%, var(--card)); }
table.cp-bt tbody tr:hover { background: var(--hover); }
.cp-hfil { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 16px; }
@media (max-width: 1100px) { .cp-figrow { grid-template-columns: minmax(0, 1fr); } table.cp-bt .cb-tds { display: none; } }
@media (max-width: 860px) {
  .cp-top { position: static; flex-direction: column; align-items: stretch; gap: 12px; }
  .cp-acts { justify-content: flex-start; }
  .cp-tabs { top: 0; }
  .cp-cards { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .cp-explorer .explorer { grid-template-columns: minmax(0, 1fr); }
  table.cp-t { table-layout: auto; }
  table.cp-t thead { display: none; }
  table.cp-t, table.cp-t tbody { display: block; }
  table.cp-t tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 12px 16px; border-top: 1px solid var(--rule-soft); }
  table.cp-t td { padding: 0 !important; border: 0; width: auto !important; background: transparent !important; font-size: 13px; }
  table.cp-t td:first-child { grid-column: 1 / -1; font-size: 14px; }
  table.cp-t td.n { text-align: left; }
  table.cp-bt thead { display: none; }
  table.cp-bt, table.cp-bt tbody { display: block; }
  table.cp-bt tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 12px 14px; border-bottom: 1px solid var(--rule-soft); }
  table.cp-bt td { padding: 0 !important; width: auto !important; }
  table.cp-bt td.tk-name { grid-column: 1 / -1; grid-row: 2; }
  table.cp-bt td.cb-a { text-align: left; }
  .cp-figs { gap: 12px; }
  .cp-fig b { font-size: 19px; }
}

/* 1.5.44: work pending from the client; the ledgers' filter; timers on more rows; no due date at the end */
.lf-seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--surface); flex: none; }
.lf-seg button { border: 0; background: none; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--text-2); padding: 5px 10px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.lf-seg button:hover { color: var(--text); }
.lf-seg button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
.lf-seg button b { font-weight: 600; margin-left: 5px; opacity: 0.75; }
.lf-seg button.cs b { color: color-mix(in srgb, var(--dot-wait) 75%, var(--text)); opacity: 1; }
#db-ledger .md-ph { flex-wrap: wrap; gap: 12px; }
#db-ledger .md-ph > div:first-child { flex: 1 1 100%; }
.db-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px 12px; flex-wrap: wrap; width: 100%; }
.db-rows li[data-task] .db-side { flex-direction: row; align-items: center; gap: 10px; }
.db-sx { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.db-rows li.db-band { display: flex; justify-content: space-between; align-items: baseline; padding: 16px 6px 6px; font-size: 12px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-2); box-shadow: none; }
.db-rows li.db-band small { font-size: 12px; font-weight: 600; text-transform: none; letter-spacing: 0; }
.db-rows li.db-band + li { box-shadow: none; }
.db-date.nd b { color: var(--text-3); }
.ledger-day.nodate .ledger-date .d { color: var(--text-3); }
.md-lhead { flex-wrap: wrap; gap: 10px 12px; }
.md-lhead > div:first-child { flex: 1 1 200px; }
.md-lhead > .lf-seg { flex-direction: row; gap: 2px; }
.tk-sec-acts { display: inline-flex; align-items: center; gap: 8px; }
table.tk-tbl th.tl-col, table.tk-tbl td.tl-col { width: 88px; white-space: nowrap; padding-left: 4px; }
table.tk-tbl td.tl-col .tm-wrap { display: inline-flex; vertical-align: middle; margin-right: 4px; }
table.tk-tbl td.tl-col .tl-btn { vertical-align: middle; }
table.tk-tbl td.tl-col .tm-el:empty { display: none; }
.tk-wait { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--dot-wait) 12%, var(--card)); }
.tk-wait-h { font-size: 13px; font-weight: 600; color: color-mix(in srgb, var(--dot-wait) 55%, var(--text)); }
.tk-wait input { width: 100%; box-sizing: border-box; font: inherit; font-size: 14px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--text); }
.sv-in.sv-ed { color: var(--text-2); }
.sv-in.sv-ed.ch { color: var(--text); }
.sv-hint { display: block; font-size: 11.5px; color: var(--text-3); margin-top: 3px; }
/* Dashboard → Client pending */
.cpg { display: flex; flex-direction: column; background: var(--card); border-radius: 16px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 0 0 1px var(--rule-soft); overflow: hidden; }
.cpg-h { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding: 14px 22px; border-bottom: 1px solid var(--rule-soft); }
.cpg-h h2 { margin: 0; font-size: 16px; }
.cpg-sp { flex: 1; }
.cpg-scroll { overflow-x: auto; }
table.cpg-t { width: 100%; border-collapse: collapse; table-layout: fixed; min-width: 860px; }
.cpg-t th { height: 40px; text-align: left; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-2); background: color-mix(in srgb, var(--surface) 60%, var(--card)); padding: 0 12px; border-bottom: 1px solid var(--rule-soft); }
.cpg-t th:nth-child(1) { width: 28%; } .cpg-t th:nth-child(3) { width: 110px; } .cpg-t th:nth-child(4) { width: 64px; } .cpg-t th:nth-child(5) { width: 150px; } .cpg-t th:nth-child(6) { width: 200px; }
.cpg-t td { padding: 11px 12px; font-size: 14px; vertical-align: middle; border-bottom: 1px solid var(--rule-soft); }
.cpg-t th:first-child, .cpg-t td:first-child { padding-left: 22px; }
.cpg-t th:last-child, .cpg-t td:last-child { padding-right: 22px; }
.cpg-t th.num, .cpg-t td.num { text-align: right; }
.cpg-t tr.r { cursor: pointer; }
.cpg-t tr.r:hover td { background: var(--hover); }
.cpg-t tr.r:nth-of-type(even) td { background: color-mix(in srgb, var(--surface) 55%, var(--card)); }
.cpg-t td b { font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cpg-t td small { display: block; font-size: 12.5px; color: var(--text-2); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cpg-t td.cpg-ms { overflow: hidden; text-overflow: ellipsis; }
.cpg-t td.cpg-who { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cpg-t td.cpg-d { font-weight: 700; }
.cpg-t td.cpg-d.long { color: var(--accent); }
.cpg-t tr.cpg-band td { padding: 16px 22px 6px; font-size: 12.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: color-mix(in srgb, var(--dot-wait) 60%, var(--text)); background: var(--card); border-bottom: 0; }
.cpg-t tr.cpg-band td i { font-style: normal; color: var(--text-2); font-weight: 600; margin-left: 8px; }
.cpg-ac > div { display: flex; gap: 6px; justify-content: flex-end; }
.cpg-f { padding: 12px 22px; }
.cpg .empty { padding: 28px 22px; }
@media (max-width: 760px) {
  .cpg-h { padding: 12px 16px; }
  table.cpg-t { min-width: 0; }
  .cpg-t thead { display: none; }
  .cpg-t tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 12px 16px; border-bottom: 1px solid var(--rule-soft); }
  .cpg-t tr.cpg-band { padding: 14px 16px 4px; border-bottom: 0; }
  .cpg-t td { padding: 0 !important; border: 0; background: none !important; }
  .cpg-t td:nth-child(1) { grid-column: 1 / -1; }
  .cpg-t td.cpg-ms { grid-column: 1 / -1; font-size: 13px; }
  .cpg-t td:nth-child(3) { text-align: left; color: var(--text-2); font-size: 13px; }
  .cpg-t td:nth-child(3)::before { content: "Since "; }
  .cpg-t td.cpg-d::after { content: " days"; font-weight: 600; }
  .cpg-t td.cpg-who { display: none; }
  .cpg-t td.cpg-ac { grid-column: 1 / -1; margin-top: 6px; }
  .cpg-t td.cpg-ac > div { justify-content: flex-start; }
  .cpg-t td.cpg-ac .btn { min-height: 40px; }
  .cpg-f { padding: 12px 16px; }
}

/* 1.5.45: the DSC register (dsc.js) */
:root { --dx-amber-bg: #f6ecd9; --dx-amber: #7a5512; }
:root[data-theme="graphite"], :root[data-theme="forest-gold"], :root[data-theme="dusk-teal"] { --dx-amber-bg: #3d3322; --dx-amber: #e7c27d; }
.nav-badge.dsc-n { background: var(--dx-amber-bg); color: var(--dx-amber); }
.dx-amber { color: var(--dx-amber); }
table.dx-tbl { table-layout: fixed; }
table.dx-tbl .dx-c1 { width: 22%; } table.dx-tbl .dx-c3 { width: 165px; } table.dx-tbl .dx-c4 { width: 195px; } table.dx-tbl .dx-c5 { width: 135px; }
.dx-h { display: flex; align-items: center; gap: 12px; min-width: 0; }
.dx-h > div { min-width: 0; }
.dx-av { width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 12.5px; font-weight: 700; letter-spacing: 0.02em; background: var(--surface); color: var(--text-2); }
.dx-av.big { width: 48px; height: 48px; font-size: 15px; background: var(--btn-bg); color: var(--btn-text); }
.dx-h b, .dx-cl b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dx-cl b { font-weight: 500; }
.dx-h small, .dx-cl small, .dx-moved small { display: block; font-size: 12.5px; color: var(--text-2); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dx-exp b, .dx-moved b { display: block; font-weight: 600; font-variant-numeric: tabular-nums; }
.dx-moved b { font-weight: 500; }
.dx-pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; margin-top: 4px; background: var(--surface); color: var(--text-2); }
.dx-pill i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.dx-pill.soon { background: var(--dx-amber-bg); color: var(--dx-amber); }
.dx-pill.late { background: var(--accent-soft); color: var(--accent); }
.dx-where { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.dx-where svg { width: 16px; height: 16px; color: var(--text-3); flex: none; }
.dx-box { display: inline-grid; place-items: center; min-width: 46px; height: 28px; padding: 0 8px; border-radius: 8px; background: var(--card); box-shadow: inset 0 0 0 1.5px var(--rule); font-weight: 700; font-size: 13px; letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.dx-tag { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--surface); color: var(--text-2); }
.dx-remind { display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin: 0 0 16px; border-radius: 14px; background: var(--dx-amber-bg); color: var(--dx-amber); font-size: 14px; }
.dx-remind > svg { width: 18px; height: 18px; flex: none; }
.dx-remind > span { flex: 1; min-width: 0; }
.dx-remind b.late { color: var(--accent); }
.dx-remind .muted { color: inherit; opacity: 0.8; }
/* the window */
.px { display: flex; flex-direction: column; gap: 16px; }
.px-head { display: flex; align-items: center; gap: 14px; }
.px-head > div { min-width: 0; }
.px-head h3 { margin: 0; font-size: 18px; }
.px-head p { margin: 2px 0 0; font-size: 13px; color: var(--text-2); }
.px-head .dx-pill { margin: 0 0 0 auto; height: 28px; font-size: 12.5px; }
.px-card { border-radius: 14px; background: var(--card); box-shadow: 0 0 0 1px var(--rule-soft); padding: 16px 18px 18px; }
.px-card h4 { margin: 0 0 14px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-2); }
.px-g { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.px-g .full, .px-g > .full { grid-column: 1 / -1; }
.px-f { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.px-f > span:first-child { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.px-f[hidden], .px-g[hidden], .dx-note[hidden] { display: none; }
.px .pxi { width: 100%; box-sizing: border-box; height: 44px; padding: 0 14px; border-radius: 10px; border: 0; background: color-mix(in srgb, var(--surface) 70%, var(--card)); box-shadow: inset 0 0 0 1px var(--rule-soft); font: inherit; font-size: 14.5px; color: var(--text); outline: none; transition: box-shadow 0.15s, background 0.15s; }
.px select.pxi { appearance: none; padding-right: 38px; background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%); background-position: calc(100% - 20px) 19px, calc(100% - 15px) 19px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.px .pxi:focus { background-color: var(--card); box-shadow: inset 0 0 0 1.5px var(--text), 0 0 0 4px color-mix(in srgb, var(--text) 8%, transparent); }
.px .pxi:disabled { opacity: 0.85; }
.px .pxi.big { font-size: 18px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.px .pxi.big::placeholder { font-size: 14.5px; font-weight: 400; letter-spacing: 0; text-transform: none; }
.px-hint { margin: 0; font-size: 12.5px; color: var(--text-2); }
.dx-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface); }
.dx-seg button { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; border: 0; border-radius: 9px; background: none; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--text-2); cursor: pointer; padding: 0 8px; }
.dx-seg button svg { width: 16px; height: 16px; flex: none; }
.dx-seg button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); }
.dx-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.dx-chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; border: 0; background: color-mix(in srgb, var(--surface) 70%, var(--card)); box-shadow: inset 0 0 0 1px var(--rule-soft); font: inherit; font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.dx-chip.on { background: var(--btn-bg); color: var(--btn-text); box-shadow: none; }
.dx-chip.on::before { content: "✓"; font-size: 12px; }
.dx-chip.box { letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.dx-chip.box small { font-weight: 500; opacity: 0.75; letter-spacing: 0; }
.dx-note { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; font-size: 13px; line-height: 1.4; }
.dx-note svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.dx-note.amber { background: var(--dx-amber-bg); color: var(--dx-amber); }
.dx-note.calm { background: var(--surface); color: var(--text-2); }
.dx-bar { display: flex; flex-direction: column; gap: 6px; }
.dx-bar .t { height: 8px; border-radius: 999px; background: var(--surface); overflow: hidden; }
.dx-bar .t i { display: block; height: 100%; border-radius: 999px; background: var(--dot-done); }
.dx-bar .t i.soon { background: linear-gradient(90deg, var(--dot-done), #c9933a); }
.dx-bar .t i.late { background: var(--accent); }
.dx-bar .l { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-2); }
.dx-bar .l b.soon { color: var(--dx-amber); } .dx-bar .l b.late { color: var(--accent); }
.dx-moved-line { margin: 0; display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: var(--text-2); }
.dx-moved-line svg { width: 14px; height: 14px; flex: none; }
.dx-copyw { position: relative; display: block; }
.dx-copyw .pxi { padding-right: 46px; }
.dx-copy { position: absolute; right: 6px; top: 6px; width: 32px; height: 32px; border: 0; border-radius: 8px; background: none; color: var(--text-3); cursor: pointer; display: grid; place-items: center; }
.dx-copy:hover { background: var(--hover); color: var(--text); }
.dx-copy svg { width: 16px; height: 16px; }
.px-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; flex-wrap: wrap; }
.btn.ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1.5px var(--rule); }
.dx-del { color: var(--accent); margin-left: 4px; }
.rn-ar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.rn-ar > svg { width: 20px; height: 20px; color: var(--text-3); }
.rn-d { border-radius: 12px; padding: 12px 14px; background: var(--surface); }
.rn-d span { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-2); }
.rn-d b { display: block; font-size: 17px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.rn-d small { font-size: 12.5px; color: var(--text-2); }
.rn-d.new { background: color-mix(in srgb, var(--dot-done) 14%, var(--card)); }
/* the client's page */
.cp-dsc .dx-cph { display: flex; justify-content: space-between; align-items: baseline; }
.cp-dsc .dx-cph h3 { margin: 0 0 10px; }
.dx-cpl { list-style: none; margin: 0; padding: 0; }
.dx-cpl li { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-radius: 10px; cursor: pointer; }
.dx-cpl li + li { box-shadow: 0 -1px 0 var(--rule-soft); }
.dx-cpl li:hover { background: var(--hover); box-shadow: none; }
.dx-cpn { flex: 1; min-width: 0; }
.dx-cpn b { display: block; font-weight: 600; }
.dx-cpn small { display: block; font-size: 12.5px; color: var(--text-2); }
.dx-cpl .dx-pill { margin: 0; }
@media (max-width: 760px) {
  .px-g { grid-template-columns: 1fr; }
  .dx-seg { grid-template-columns: 1fr; }
  .rn-ar { grid-template-columns: 1fr; } .rn-ar > svg { transform: rotate(90deg); justify-self: center; }
  .dx-remind { flex-wrap: wrap; }
  table.dx-tbl, table.dx-tbl tbody { display: block; }
  table.dx-tbl thead { display: none; }
  table.dx-tbl tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; padding: 12px 16px; border-bottom: 1px solid var(--rule-soft); }
  table.dx-tbl td { display: block; padding: 0 !important; border: 0 !important; width: auto !important; background: none !important; }
  table.dx-tbl td.dx-c1 { grid-column: 1; }
  table.dx-tbl td.dx-c3 { grid-column: 2; grid-row: 1; text-align: right; }
  table.dx-tbl td.dx-cl { grid-column: 1 / -1; padding-left: 48px !important; }
  table.dx-tbl td.dx-c4 { grid-column: 1 / -1; padding-left: 48px !important; }
  table.dx-tbl td.dx-c5 { display: none; }
}

/* 1.5.46: the DSC window in the centre, the client picker, the login */
dialog.dx-win { width: min(960px, calc(100vw - 32px)); }
.px-two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.px-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.px .req { color: var(--accent); font-style: normal; margin-left: 2px; }
.dx-seg button span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dx-pick { position: relative; }
.px .dx-pickbtn { display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; cursor: pointer; }
.dx-pickbtn .v { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dx-pickbtn .v small { font-size: 12.5px; color: var(--text-2); margin-left: 6px; }
.dx-pickbtn .ph { color: var(--text-3); }
.dx-pickbtn svg { width: 16px; height: 16px; color: var(--text-3); flex: none; }
.dx-pickmenu { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20; background: var(--card); border-radius: 12px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18), 0 0 0 1px var(--rule-soft); padding: 6px; }
.dx-pickmenu[hidden] { display: none; }
.dx-picksearch { width: 100%; box-sizing: border-box; height: 38px; border: 0; border-radius: 8px; background: var(--surface); padding: 0 12px; font: inherit; font-size: 13.5px; color: var(--text); outline: none; margin-bottom: 6px; }
.dx-pickl { max-height: 260px; overflow: auto; }
.dx-pickl .g { font-size: 11px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-2); padding: 8px 10px 4px; }
.dx-pickl .o { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: 8px; background: none; font: inherit; font-size: 14px; color: var(--text); text-align: left; cursor: pointer; }
.dx-pickl .o span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dx-pickl .o small { color: var(--text-2); font-size: 12px; flex: none; }
.dx-pickl .o:hover, .dx-pickl .o:focus-visible { background: var(--hover); outline: none; }
.dx-pickl .o.new { font-weight: 700; background: color-mix(in srgb, var(--dot-done) 14%, var(--card)); }
.dx-sec .pxi { padding-right: 84px; }
.dx-sec .pxi[type="password"] { letter-spacing: 0.12em; }
.dx-eye, .dx-copy2 { position: absolute; top: 6px; width: 32px; height: 32px; border: 0; border-radius: 8px; background: none; color: var(--text-3); cursor: pointer; display: grid; place-items: center; }
.dx-eye { right: 42px; } .dx-copy2 { right: 6px; }
.dx-eye:hover, .dx-copy2:hover { background: var(--hover); color: var(--text); }
.dx-eye svg, .dx-copy2 svg { width: 16px; height: 16px; }
@media (max-width: 860px) { .px-two { grid-template-columns: 1fr; } }
@media (max-width: 860px) { .dx-pickl .o.new small { display: none; } }
/* 1.5.47: DSC numbers */
.dx-no { font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.dx-nochip { display: inline-block; vertical-align: 2px; margin-left: 8px; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; padding: 2px 8px; border-radius: 6px; background: var(--surface); color: var(--text-2); }

/* 1.5.50: My time today: Start, recent chips, lanes for shared time, gaps, live stretches; the search; usage */
.mt-head .mt-total .mt-gapn { margin-left: 8px; font-size: 12.5px; font-weight: 600; color: var(--accent); }
.mt-start { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 20px 12px; }
.mt-startb, .mt-chip { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px 0 8px; border: 0; border-radius: 999px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; max-width: 100%; }
.mt-startb { background: var(--main-btn-bg, var(--btn-bg)); color: var(--main-btn-text, var(--btn-text)); }
.mt-chip { background: var(--surface); color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.mt-startb i, .mt-chip i { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 8px; flex: none; }
.mt-startb i { background: rgba(255, 255, 255, 0.2); } .mt-chip i { background: var(--card); }
.mt-chart .dl-track.mt-lanes { min-height: 96px; }
.dl-bar small { display: block; font-size: 11px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-bar.mt-shared { border-style: dashed; }
.dl-bar.mt-live { cursor: default; background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--chart) 20%, var(--card)) 0 8px, color-mix(in srgb, var(--chart) 34%, var(--card)) 8px 16px); }
.dl-bar.mt-live.on { box-shadow: 0 0 0 2px var(--dot-done); }
.mt-gap { position: absolute; top: 9px; bottom: 9px; border: 1.5px dashed color-mix(in srgb, var(--accent) 55%, transparent); border-radius: 6px; background: transparent; color: var(--accent); font: inherit; font-size: 11.5px; font-weight: 600; cursor: pointer; overflow: hidden; padding: 0 4px; }
.mt-gap span { white-space: nowrap; }
.mt-gap:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.tm-pick { position: absolute; z-index: 60; background: var(--card); border-radius: 14px; box-shadow: 0 14px 36px rgba(0, 0, 0, 0.18), 0 0 0 1px var(--rule-soft); padding: 8px; }
.tm-pick-q { width: 100%; box-sizing: border-box; height: 40px; border-radius: 9px; border: 0; box-shadow: inset 0 0 0 1.5px var(--text); background: var(--card); padding: 0 12px; font: inherit; font-size: 14px; color: var(--text); outline: none; }
.tm-pick-l { max-height: 340px; overflow: auto; margin-top: 4px; }
.tm-pick-l .g { font-size: 11px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-2); padding: 10px 10px 4px; }
.tm-pick-l .o { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: 8px; background: none; font: inherit; font-size: 13.5px; color: var(--text); text-align: left; cursor: pointer; }
.tm-pick-l .o span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-pick-l .o i { font-style: normal; font-size: 9px; margin-right: 8px; color: var(--text-2); }
.tm-pick-l .o small { color: var(--text-2); font-size: 12px; white-space: nowrap; flex: none; }
.tm-pick-l .o:hover, .tm-pick-l .o:focus-visible { background: var(--hover); outline: none; }
.tm-pick-hint { margin: 8px 10px; }
.tm-pickbtn { display: flex; align-items: center; justify-content: space-between; text-align: left; cursor: pointer; }
.tm-pickbtn .ph { color: var(--text-3); }
.dx-seg.two { grid-template-columns: 1fr 1fr; }
.ab-t { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13px; }
.ab-t td { padding: 5px 2px; border-top: 1px solid color-mix(in srgb, currentColor 18%, transparent); }
.ab-t td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ab-t small { opacity: 0.8; margin-left: 4px; }
.sv-use { display: inline-block; min-width: 40px; text-align: center; font-weight: 700; font-size: 12px; padding: 1px 7px; border-radius: 999px; background: var(--surface); }
.sv-use.half { background: var(--dx-amber-bg); color: var(--dx-amber); }
@media (max-width: 600px) { .mt-start { padding: 0 14px 12px; } }

/* My attendance 1.5.51: the calendar of whole days, Today with Present ▾ | Absent ▾, the month summary in a line. */
.mx { gap: 20px; }
.mx-top { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: stretch; }
.mx-side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.mx-bot { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
.mat.mx .ma-card { border: 0; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 0 0 1px var(--rule-soft); }
.mat .ma-card h2.mx-h { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-2); }
.mx-ch { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 16px; }
.mx-cal .ma-mhead { margin-bottom: 14px; }
.mx-grid { gap: 6px; margin-bottom: 14px; }
.mx-grid .at-w { text-align: left; padding: 0 4px 4px; font-size: 12px; }
.mx .at-c { min-height: 76px; align-items: flex-start; justify-content: space-between; gap: 6px; padding: 10px 12px; border: 0; border-radius: 12px; background: transparent; box-shadow: inset 0 0 0 1px var(--rule-soft); text-align: left; }
.mx .at-c b { font-size: 16px; font-variant-numeric: tabular-nums; }
.mx .at-c span { font-size: 12px; font-weight: 600; color: var(--text-2); min-height: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.mx .at-c.out { box-shadow: none; }
.mx .at-c[class*=" s-"] { background: color-mix(in srgb, var(--at) 22%, var(--card)); box-shadow: none; }
.mx .at-c[class*=" s-"] span { color: color-mix(in srgb, var(--at) 85%, var(--text)); }
.mx .at-c.off { background: var(--surface); box-shadow: none; }
.mx .at-c.off b, .mx .at-c.off span { color: var(--text-3); font-weight: 500; }
.mx .at-c.offwork { background: color-mix(in srgb, #E3B24A 38%, var(--card)) !important; border: 0 !important; }
.mx .at-c.offwork b { font-weight: 600; }
.mx .at-c.offwork::after { top: 8px; right: 10px; font-size: 11px; }
.mx .at-c.miss { border: 0; background: transparent; box-shadow: inset 0 0 0 1.5px var(--accent); }
.mx .at-c.miss span { color: var(--accent); }
.mx .at-c.blank b { color: var(--text-2); font-weight: 500; }
.mx .at-c.today { box-shadow: 0 0 0 2px var(--text); }
.mx .at-c:hover:not(.out) { filter: brightness(0.97); }
.mx .at-c .at-dot { top: 10px; right: 10px; }
.mx-leg { margin: 0 0 8px; }
.mx-leg .at-sw.miss { background: transparent; }
/* Today */
.mx-today { gap: 16px; overflow: visible; }
.mx-tdr { display: flex; align-items: center; gap: 16px; }
.mx-badge { flex: none; width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; font-size: 18px; font-weight: 700; background: color-mix(in srgb, var(--at, var(--text-3)) 20%, var(--card)); color: color-mix(in srgb, var(--at, var(--text-3)) 85%, var(--text)); }
.mx-badge.nm { background: transparent; box-shadow: inset 0 0 0 1.5px var(--accent); color: var(--accent); }
.mx-tst { font-size: 18px; font-weight: 700; }
.mx-today .ma-tline { margin: 2px 0 0; font-size: 13px; }
.mx-mk { position: relative; display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface); }
.mat .at-today .mx-mk { flex: none; flex-direction: row; gap: 4px; }
.mx-mk.hidden { display: none; }
.mk-half { --at-ink: var(--att-ink); flex: 1; min-width: 0; display: flex; align-items: center; border-radius: 999px; }
.mk-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; height: 40px; padding: 0 4px 0 16px; border: 0; border-radius: 999px; background: none; color: var(--text); font: inherit; font-size: 14.5px; font-weight: 600; cursor: pointer; text-align: left; }
.mk-main i { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--at); }
.mk-cv { flex: none; width: 28px; height: 28px; margin-right: 6px; border: 0; border-radius: 50%; background: none; color: var(--text-2); font-size: 11px; cursor: pointer; display: grid; place-items: center; }
.mk-half:not(.on):hover { background: var(--hover); }
.mk-half.on { background: var(--at); }
.mk-half.on .mk-main { color: var(--at-ink); }
.mk-half.on .mk-main i { background: var(--at-ink); }
.mk-half.on .mk-cv { background: color-mix(in srgb, var(--at-ink) 18%, transparent); color: var(--at-ink); }
.mk-main:focus-visible, .mk-cv:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.mk-menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 40; width: 250px; padding: 6px; background: var(--card); border-radius: 12px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16), 0 0 0 1px var(--rule-soft); display: flex; flex-direction: column; gap: 2px; }
.mk-menu[data-for="a"] { left: auto; right: 0; }
.mk-menu.hidden { display: none; }
.mk-menu h5 { margin: 6px 10px 4px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-2); }
.mk-menu .ma-mk { flex: none; min-height: 40px; padding: 6px 10px; gap: 10px; border-radius: 8px; background: none; color: var(--text); font-size: 14px; font-weight: 500; }
.mk-menu .ma-mk b { width: 30px; height: 22px; border-radius: 6px; font-size: 11px; }
.mk-menu .ma-mk:hover, .mk-menu .ma-mk.on, .mk-menu .ma-mk.on:hover { background: var(--hover); color: var(--text); }
.mk-menu .ma-mk.on b { background: var(--at); color: var(--at-ink); }
.mk-menu .tick { margin-left: auto; font-style: normal; font-weight: 700; color: var(--text-2); }
/* Last six months */
.mx-chart { flex: 1; }
.mx-pct { display: flex; align-items: baseline; gap: 10px; }
.mx-pct b { font-size: 40px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; }
.mat .at-chart .mx-bars { flex: 1; flex-direction: row; justify-content: space-between; gap: 12px; margin: 18px 0 0; min-height: 110px; }
.mx .mx-bars li { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); }
.mx .mx-bars .t { flex: 1; width: 100%; max-width: 30px; height: auto; display: flex; flex-direction: column-reverse; gap: 2px; border-radius: 8px; background: var(--surface); overflow: hidden; }
.mx .mx-bars i { width: 100%; min-width: 0; min-height: 3px; border-radius: 0; }
/* The month summary */
.mat .ma-card.mx-sum { padding: 20px 0 0; }
.mx-sum .mx-ch { padding: 0 24px; margin-bottom: 12px; }
.mx-scroll { overflow-x: auto; }
.ma-ct.mx-st { display: table; width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 14px; }
.mx-st th { padding: 10px 24px 8px; text-align: left; font-size: 11.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; white-space: nowrap; border-bottom: 1px solid var(--rule-soft); }
.mx-st .gp { color: var(--att-p); background: color-mix(in srgb, var(--att-p) 8%, var(--card)); }
.mx-st .ga { color: var(--att-cl); background: color-mix(in srgb, var(--att-cl) 8%, var(--card)); border-left: 1px solid var(--rule-soft); }
.mx-st .gn, .mx-st .go { color: var(--accent); border-left: 1px solid var(--rule-soft); padding-left: 18px; }
.mx-st .go { color: var(--text-2); }
.mx-st td { padding: 16px 8px 20px 24px; vertical-align: top; border-radius: 0; cursor: pointer; }
.mx-st td.g1 { border-left: 1px solid var(--rule-soft); }
.mx-st td:last-child { padding-left: 18px; }
.mx-st td:hover, .mx-st td.on { background: var(--hover); }
.mx-st .sv { font-size: 22px; font-weight: 700; line-height: 34px; height: 34px; }
.mx-st .tt .sv { font-size: 28px; }
.mx-st .sv.p { color: var(--att-p); }
.mx-st .sv.a { color: var(--att-cl); }
.mx-st .sv.n { color: var(--accent); }
.mx-st .sk { margin-top: 4px; font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Leave taken, My requests */
.mx-bot .ma-card { display: flex; flex-direction: column; }
.mx-lv.at-bals { display: flex; flex-direction: column; gap: 14px; }
.mx-lv > .mx-lr { display: grid; grid-template-columns: 70px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 0; border: 0; background: none; font-size: 14px; }
.mx-lr .bar { height: 8px; border-radius: 999px; background: var(--surface); overflow: hidden; }
.mx-lr .bar i { display: block; height: 100%; border-radius: 999px; background: var(--att-cl); }
.mx-lr b { font-weight: 600; text-align: right; white-space: nowrap; }
.mx-tot { display: flex; justify-content: space-between; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--rule-soft); font-weight: 700; font-size: 14px; }
.mx-bot .at-bals { margin-bottom: 16px; }
.mx-rq li { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto auto; gap: 4px 12px; align-items: center; padding: 11px 0; flex-wrap: nowrap; }
.mx-rq li:first-child { border-top: 1px solid var(--rule-soft); }
.mx-rq li.hidden { display: none; }
.mx-rq .d { font-weight: 700; min-width: 0; }
.mx-rq .k { min-width: 0; display: flex; flex-direction: column; }
.mx-rq .k .n { flex-basis: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mx-pill { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; background: color-mix(in srgb, #E3B24A 30%, var(--card)); color: var(--text); }
.mx-pill.approved { background: color-mix(in srgb, var(--att-p) 20%, var(--card)); color: var(--text); }
.mx-pill.rejected { background: color-mix(in srgb, var(--accent) 16%, var(--card)); color: var(--text); }
@media (max-width: 1180px) {
  .mx-top { grid-template-columns: minmax(0, 1fr) 320px; }
}
@media (max-width: 980px) {
  .mx-top, .mx-bot { grid-template-columns: minmax(0, 1fr); }
  .mx-side { order: -1; }
}
@media (max-width: 640px) {
  .mx, .mx-side, .mx-top, .mx-bot { gap: 14px; }
  .mx .at-c { min-height: 50px; padding: 6px 7px; border-radius: 9px; gap: 2px; }
  .mx .at-c b { font-size: 13.5px; }
  .mx .at-c span { font-size: 0; }
  .mx .at-c span::after { content: attr(data-s); font-size: 11px; }
  .mx-grid { gap: 4px; }
  .mx-grid .at-w { font-size: 11px; padding: 0 2px 2px; }
  .mx .at-c.offwork::after { top: 3px; right: 5px; }
  .mat .ma-card.mx-sum { padding: 16px 0 6px; }
  .mx-sum .mx-ch { padding: 0 16px; }
  .mx-st thead { display: none; }
  .mx-st, .mx-st tbody { display: block; }
  .mx-st tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mx-st td, .mx-st td:last-child, .mx-st td.g1 { padding: 10px 16px; border-left: 0; }
  .mx-st .sk[data-ph] { font-size: 0; }
  .mx-st .sk[data-ph]::after { content: attr(data-ph); font-size: 12.5px; }
  .mx-rq li { grid-template-columns: 78px minmax(0, 1fr) auto; }
  .mx-rq li [data-withdraw], .mx-rq li > span:empty { grid-column: 2; grid-row: 2; justify-self: start; }
  .mk-menu, .mk-menu[data-for="a"] { left: 0; right: 0; width: auto; }
}
.mx-st col.cn { width: 136px; }
@media (max-width: 640px) { .mx-st colgroup { display: none; } }
@media (max-width: 640px) { .mx-st td.g1 { grid-column-start: 1; border-top: 1px solid var(--rule-soft); } }

/* Bills 1.5.53: Overview, the three-pane Bills tab with one header, ⋯ More. */
.dash-head .bill-tabs { margin: 0; }
.bx-more { position: relative; display: inline-flex; }
.bx-more > .btn { min-width: 42px; justify-content: center; }
.bx-mmenu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; width: 270px; padding: 6px; background: var(--card); border-radius: 12px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16), 0 0 0 1px var(--rule-soft); display: flex; flex-direction: column; }
.bx-mmenu.hidden { display: none; }
.bx-mmenu button { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; border: 0; background: none; padding: 9px 12px; border-radius: 8px; font: inherit; color: var(--text); text-align: left; cursor: pointer; }
.bx-mmenu button:hover, .bx-mmenu button:focus-visible { background: var(--hover); outline: none; }
.bx-mmenu b { font-size: 14px; font-weight: 600; } .bx-mmenu span { font-size: 12px; color: var(--text-2); }
.bx-mmenu button + button:last-child { border-top: 1px solid var(--rule-soft); border-radius: 0 0 8px 8px; margin-top: 2px; }
/* Overview */
.bo { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.bo-ring, .bo-card { background: var(--card); border-radius: 16px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 0 0 1px var(--rule-soft); padding: 22px 24px; min-width: 0; }
.bo-ring { grid-row: span 2; display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 14px; }
.bo-rh { align-self: stretch; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bo-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-2); }
.bo-h i { font-style: normal; color: var(--text-3); font-size: 14px; letter-spacing: 0; }
.bo-leg { list-style: none; margin: 0; padding: 0; align-self: stretch; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.bo-leg li { display: flex; align-items: center; gap: 10px; } .bo-leg i { width: 10px; height: 10px; border-radius: 3px; flex: none; } .bo-leg b { margin-left: auto; }
.bo-tot { align-self: stretch; display: flex; justify-content: space-between; padding-top: 12px; border-top: 1px solid var(--rule-soft); font-size: 13.5px; color: var(--text-2); } .bo-tot b { color: var(--text); }
.bo-card { display: flex; flex-direction: column; justify-content: space-between; gap: 22px; border: 0; font: inherit; color: var(--text); text-align: left; cursor: pointer; }
.bo-card:hover { box-shadow: 0 4px 14px rgba(0, 0, 0, 0.07), 0 0 0 1px var(--rule-soft); }
.bo-card:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.bo-v { display: block; font-size: 30px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.1; }
.bo-s { display: block; margin-top: -14px; font-size: 13px; color: var(--text-2); }
.bo-card.bad .bo-v { color: var(--accent); }
/* The Bills tab: one card, one header across the three panes */
.bxw { background: var(--card); border-radius: 16px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 0 0 1px var(--rule-soft); overflow: hidden; }
.bxw-h { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--rule-soft); }
.bxw-t { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; min-width: 0; flex: 1; }
.bxw-t h2 { margin: 0; font-size: 17px; white-space: nowrap; }
.bxw-t .bx-sum { padding: 0; border: 0; gap: 12px; }
.bx-chip { border: 0; height: 28px; padding: 0 10px; border-radius: 999px; background: var(--surface); font: inherit; font-size: 12.5px; font-weight: 600; color: var(--text); cursor: pointer; white-space: nowrap; }
.bx-chip:hover { background: var(--hover); }
.bxw-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bxw-tools input[type=search] { width: 280px; height: 38px; padding: 0 12px; border: 0; border-radius: 10px; background: var(--surface); font: inherit; font-size: 14px; color: var(--text); }
.bxw-tools .btn, .bx-sort { height: 38px; }
.bxw-tools .bx-per { background: var(--btn-bg); color: var(--btn-text); }
.bx-sort { border: 0; border-radius: 10px; background-color: var(--btn-bg); color: var(--btn-text); font: inherit; font-size: 14px; font-weight: 600; padding: 0 32px 0 12px; cursor: pointer; }
.bx-fw { position: relative; }
.bx-fpop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; width: 300px; padding: 14px; background: var(--card); border-radius: 12px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16), 0 0 0 1px var(--rule-soft); display: flex; flex-direction: column; gap: 10px; }
.bx-fpop.hidden { display: none; }
.bxw .bx { box-shadow: none; border-radius: 0; min-height: 560px; height: calc(100vh - 230px); grid-template-columns: 250px minmax(0, 1fr) minmax(340px, 400px); }
.bxw .bx > * { min-height: 0; overflow: auto; }
.bxw .bx-side { padding: 12px 10px; }
.bxw .bx-f { grid-template-columns: 10px minmax(0, 1fr) auto; gap: 1px 10px; padding: 9px 12px; border-radius: 10px; }
.bxw .bx-f.on { background: var(--hover); box-shadow: none; }
.bxw .bx-f.on .nm { font-weight: 700; }
.bxw .bx-f .amt { grid-column: 2 / -1; }
.bxw .bx-f .cnt { color: var(--text-2); }
.bx-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.bxw .bx-f .bx-dot { grid-row: 1 / 3; align-self: center; }
.bxw .bx-f[data-fold="all"] { margin-bottom: 8px; }
.bx-gh { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); padding: 16px 12px 6px; }
.bx-f.warn .nm, .bx-f.warn .cnt { color: var(--accent); }
.bxw .bx-list { border-right: 1px solid var(--rule-soft); }
.bxw .bx-row { grid-template-columns: 36px minmax(0, 1fr) auto; gap: 2px 12px; padding: 12px 18px; }
.bxw .bx-row:has(input[data-pick]) { grid-template-columns: 20px 36px minmax(0, 1fr) auto; }
.bxw .bx-row .bx-av { grid-row: 1 / 3; align-self: center; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--text-2); font-size: 12px; font-weight: 700; }
.bxw .bx-row .t { font-size: 14.5px; } .bxw .bx-row .a { font-size: 14.5px; }
.bxw .bx-row .d { display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; }
.bxw .bx-row .d.late { color: var(--accent); font-weight: 600; }
.bxw .bx-row.on { background: color-mix(in srgb, var(--chart) 10%, var(--card)); box-shadow: inset 3px 0 0 var(--text); }
.bxw .bx-pane { padding: 22px 24px; background: color-mix(in srgb, var(--surface) 30%, var(--card)); }
.bx-pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--surface); color: var(--text); }
.bx-pill.s-late { background: color-mix(in srgb, var(--accent) 13%, var(--card)); color: var(--accent); }
.bx-kind { margin-left: 8px; font-size: 12.5px; color: var(--text-2); }
.bxw .bx-pane h2 { margin: 10px 0 2px; font-size: 20px; line-height: 1.25; }
.bx-amt { display: flex; align-items: baseline; gap: 10px; margin: 16px 0 4px; } .bx-amt b { font-size: 30px; } .bx-amt span { font-size: 13px; color: var(--text-2); }
.bx-steps { list-style: none; display: flex; margin: 16px 0 6px; padding: 0; }
.bx-steps li { flex: 1; position: relative; padding-top: 20px; text-align: center; font-size: 12.5px; font-weight: 600; color: var(--text-3); }
.bx-steps li::before { content: ""; position: absolute; top: 4px; left: 50%; transform: translateX(-50%); width: 12px; height: 12px; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 2px var(--rule); z-index: 1; }
.bx-steps li::after { content: ""; position: absolute; top: 9px; left: 50%; right: -50%; height: 2px; background: var(--rule-soft); }
.bx-steps li:last-child::after { display: none; }
.bx-steps li.done { color: var(--text); } .bx-steps li.done::before { background: var(--chart); box-shadow: none; } .bx-steps li.done::after { background: var(--chart); }
.bx-steps li.now { color: var(--text); } .bx-steps li.now::before { background: var(--card); box-shadow: inset 0 0 0 3px var(--text); }
.bxw .bx-facts { gap: 10px; margin: 16px 0; }
.bxw .bx-facts div { background: var(--card); box-shadow: 0 0 0 1px var(--rule-soft); border-radius: 12px; padding: 10px 14px; }
.bxw .bx-acts { gap: 8px; margin: 0 0 12px; }
.bxw .bx-acts .btn { white-space: nowrap; }
@media (max-width: 1280px) { .bxw .bx { grid-template-columns: 220px minmax(0, 1fr) minmax(300px, 340px); } .bxw-tools input[type=search] { width: 200px; } }
@media (max-width: 1100px) {
  .bo { grid-template-columns: repeat(2, minmax(0, 1fr)); } .bo-ring { grid-row: auto; grid-column: 1 / -1; }
  .bxw .bx { grid-template-columns: 220px minmax(0, 1fr); height: auto; } .bxw .bx-pane { display: none; }
}
@media (max-width: 760px) {
  .bo { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .bxw .bx { grid-template-columns: minmax(0, 1fr); } .bxw .bx-side { border-right: 0; border-bottom: 1px solid var(--rule-soft); }
  .bxw .bx-side .bx-fl { display: flex; gap: 6px; overflow-x: auto; } .bxw .bx-side .bx-fl li { flex: none; } .bx-gh { display: none; }
  .bxw .bx-f { grid-template-columns: 10px auto auto; } .bxw .bx-f .amt { display: none; }
  .bxw-tools { width: 100%; } .bxw-tools input[type=search] { flex: 1 1 100%; width: auto; }
  .bx-fpop { right: auto; left: 0; width: min(300px, calc(100vw - 48px)); }
}
.bxw-tools .bx-sort { width: auto; flex: none; -webkit-appearance: none; appearance: none; background-image: var(--chev); background-repeat: no-repeat; background-position: right 10px center; }
.bxw-tools .bx-per, .bxw-tools .bx-sort { background-color: color-mix(in srgb, var(--text) 7%, transparent); color: var(--text); }
@media (max-width: 760px) {
  .bxw .bx-side { display: block; padding: 10px; }
  .bxw .bx-row { grid-template-columns: 36px minmax(0, 1fr) auto; padding: 12px 14px; }
  .bxw .bx-row .s, .bxw .bx-row .d { grid-column: 2 / -1; } .bxw .bx-row .d { justify-content: flex-start; }
  .bxw .bx-row .bx-av { grid-row: 1 / 4; align-self: start; }
  .bxw-tools .bx-sort { flex: 1; }
}
@media (max-width: 760px) { .bxw .bx { min-height: 0; height: auto; grid-template-rows: auto auto; } .bxw .bx-side { overflow-x: auto; overflow-y: hidden; } }

/* Question windows 1.5.54 (core.js ask / choose / tell / askText): in place of the browser's boxes. */
dialog.qd { width: min(440px, calc(100vw - 32px)); max-width: none; padding: 26px 26px 20px; border-radius: 18px; border: 0; background: var(--card); color: var(--text); box-shadow: 0 24px 70px rgba(0, 0, 0, 0.25); overflow: visible; }
dialog.qd.wide { width: min(520px, calc(100vw - 32px)); }
dialog.qd::backdrop { background: rgba(28, 40, 38, 0.32); backdrop-filter: blur(2px); }
.qd-x { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border: 0; border-radius: 9px; background: none; color: var(--text-3); font-size: 15px; cursor: pointer; display: grid; place-items: center; }
.qd-x:hover { background: var(--hover); color: var(--text); }
.qd-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 14px; background: var(--surface); color: var(--text); }
.qd-ic.warn { background: color-mix(in srgb, var(--accent) 13%, var(--card)); color: var(--accent); }
dialog.qd h2 { margin: 0 0 8px; padding-right: 30px; font-size: 19px; line-height: 1.3; }
dialog.qd p { margin: 0; color: var(--text-2); font-size: 14.5px; line-height: 1.5; overflow-wrap: anywhere; }
.qd-acts { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.qd-acts .btn { min-height: 42px; padding: 0 18px; }
.qd-acts .btn.danger { background: var(--accent); color: #fff; }
.qd-acts .btn.danger:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.qd-acts.stack { flex-direction: column; align-items: stretch; gap: 8px; margin-top: 20px; }
.qd-acts.stack .btn { justify-content: center; min-height: 44px; }
.qd-acts.stack .link-btn { min-height: 34px; color: var(--text-2); text-decoration: none; font-weight: 500; }
.qd-in { width: 100%; height: 42px; margin-top: 14px; padding: 0 12px; border: 0; border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; font-size: 14.5px; }
.qd-in:focus { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.qd-match { display: flex; gap: 14px; align-items: center; margin-top: 14px; padding: 14px 16px; border-radius: 12px; box-shadow: 0 0 0 1px var(--rule-soft); }
.qd-av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--text-2); font-weight: 700; font-size: 13px; flex: none; }
.qd-match b { font-size: 15px; } .qd-match small { display: block; margin-top: 2px; color: var(--text-2); font-size: 12.5px; }
.qd-tags { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; } .qd-tags span { font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: color-mix(in srgb, #C9972E 26%, var(--card)); color: var(--text); }
@media (max-width: 560px) { dialog.qd { padding: 22px 18px 16px; } .qd-acts { flex-direction: column-reverse; align-items: stretch; } .qd-acts.stack { flex-direction: column; } .qd-acts .btn { justify-content: center; } }

/* 1.5.55 (update 57): two-way choices, the Quotations card, Reimbursements, Merge clients */
.seg2 { display: inline-flex; gap: 4px; padding: 4px; border-radius: 11px; background: var(--surface); flex-wrap: wrap; }
.seg2 label, .seg2 button { position: relative; display: inline-flex; margin: 0; border: 0; background: none; font: inherit; cursor: pointer; }
.seg2 input { position: absolute; opacity: 0; pointer-events: none; }
.seg2 label span, .seg2 button { padding: 7px 16px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--text-2); }
.seg2 input:checked + span, .seg2 button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); }
.seg2 input:focus-visible + span, .seg2 button:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.field > .seg2 { align-self: flex-start; }
.q-seg { margin: 14px 0 4px; }
.check-row { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; color: var(--text); cursor: pointer; }
.check-row input { margin-top: 3px; flex: none; }
.chip { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border: 0; border-radius: 999px; background: var(--surface); color: var(--text); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.bo-q { gap: 14px; }
.bo-q .bo-qs { margin-top: 6px; }
.bo-qbar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; gap: 3px; }
.bo-qbar i { display: block; }
.bo-qleg { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; font-size: 12px; color: var(--text-2); }
.bo-qleg span { display: inline-flex; align-items: center; gap: 5px; } .bo-qleg i { width: 8px; height: 8px; border-radius: 50%; }
/* Reimbursements */
.ftree-h { list-style: none; padding: 14px 12px 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.rbx-band .rbx-in { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.rbx-band .rbx-bal { margin-left: auto; font-size: 12.5px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--text-2); }
.rbx-band .rbx-bal b { color: var(--text); }
.rbx-band .btn { height: 28px; padding: 0 12px; letter-spacing: 0; text-transform: none; }
.rbx-st { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.rbx-st i { width: 8px; height: 8px; border-radius: 50%; }
tr.rbx-paid td { opacity: 0.55; }
.rb-tbl td.rb-d, .rb-tbl td.rb-t { white-space: nowrap; }
.rb-tbl td .sub { display: block; font-size: 12.5px; }
/* Merge clients */
.mvl { margin: 6px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.mvl li { padding: 10px 12px; border-radius: 10px; background: var(--surface); font-size: 13.5px; color: var(--text-2); }
.mvl b { display: block; font-size: 18px; color: var(--text); }
.mg-fill { display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 860px) {
  table.rb-tbl tbody tr[data-rb] { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 3px 10px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--rule-soft); }
  table.rb-tbl tbody tr[data-rb] td { padding: 0 !important; border: 0; width: auto !important; }
  table.rb-tbl td.pick { grid-row: 1 / span 3; grid-column: 1; align-self: start; padding-top: 2px !important; }
  table.rb-tbl td.rb-d { grid-row: 1; grid-column: 2; }
  table.rb-tbl td.num { grid-row: 1; grid-column: 3; text-align: right; }
  table.rb-tbl td.rb-n { grid-row: 2; grid-column: 2 / -1; }
  table.rb-tbl td.rb-c, table.rb-tbl td.rb-t { display: none; }
  table.rb-tbl td:last-child { grid-row: 3; grid-column: 2 / -1; }
  .rbx-band .rbx-in { flex-wrap: wrap; white-space: normal; }
  .rbx-band .rbx-bal { margin-left: 0; flex: 1 1 auto; }
  .mvl { grid-template-columns: minmax(0, 1fr); }
}

.about-list li { overflow-wrap: anywhere; }

/* Rate per hour in the task window (1.5.56) */
.tk-rate { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 12px; padding: 10px 14px; border-radius: 10px; background: var(--surface); }
.tk-rt { display: flex; flex-direction: column; gap: 2px; }
.tk-rt .l { font-size: 12px; color: var(--text-2); }
.tk-rt b { font-size: 15px; font-weight: 600; color: var(--text); }
.tk-rt.low b { color: var(--accent); }

/* ---------- 1.5.57: jobs with steps (update 58) ---------- */
.tag.job-tag { background: var(--surface); color: var(--text-2); font-weight: 600; white-space: nowrap; }
.tag.job-late { background: var(--accent-soft); color: var(--accent); font-weight: 600; white-space: nowrap; }
.job-cur-n { color: var(--text); font-weight: 500; }
.job-l { display: block; margin-top: 6px; }
.job-bar { display: inline-flex; gap: 2px; width: 140px; max-width: 100%; height: 5px; border-radius: 999px; overflow: hidden; background: var(--surface); vertical-align: middle; }
.job-bar i { flex: 1; background: var(--rule); }
.job-bar i.d { background: var(--chart); }
.job-bar i.c { background: var(--text); }
.btn.small.job-done { white-space: nowrap; border-radius: 999px; padding: 4px 11px; font-size: 12.5px; }
.lq .job-done { margin: 0 2px; }
.db-side .job-done { margin-right: 4px; }
.job-sec .tk-sec-head { gap: 10px; }
.js-list { list-style: none; margin: 4px 0 0; padding: 0; }
.js-list li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 12px; position: relative; padding-bottom: 12px; }
.js-list li:not(:last-child)::before { content: ''; position: absolute; left: 12px; top: 26px; bottom: 0; width: 2px; background: var(--rule); }
.js-list li.d:not(:last-child)::before { background: var(--chart); }
.js-dot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--rule); background: var(--card); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--text-3); }
.js-list li.d .js-dot { background: var(--chart); border-color: var(--chart); color: #fff; }
.js-list li.c .js-dot { background: var(--text); border-color: var(--text); color: var(--card); }
.js-list li.x .js-dot { border-style: dashed; }
.js-n { font-size: 14.5px; font-weight: 600; padding-top: 3px; line-height: 1.5; }
.js-list li.o .js-n { font-weight: 500; color: var(--text-2); }
.js-list li.x .js-n { font-weight: 500; color: var(--text-3); text-decoration: line-through; }
.js-m { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.js-when { font-size: 12.5px; color: var(--text-3); padding-top: 4px; text-align: right; white-space: nowrap; }
.js-chip { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 500; background: var(--surface); color: var(--text-2); vertical-align: 1px; }
.js-chip.ahead { color: var(--chart); font-weight: 600; }
.js-cur { margin-top: 8px; padding: 10px 12px; border-radius: 12px; background: var(--surface); display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.js-cur .muted b { color: var(--text); }
.js-acts { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; }
.js-list li:not(.c) .js-acts { margin: 4px 0 0; }
.job-next { padding: 12px 14px; border-radius: 12px; background: var(--surface); font-size: 13.5px; line-height: 1.6; }
.tf-job { margin: -4px 0 2px; }
.tf-job .link-btn { font-size: 13.5px; }
.jf-steps { border: 1px solid var(--rule); border-radius: 12px; padding: 0 0 10px; overflow: hidden; }
.jf-steps .jf-h { display: flex; gap: 10px; align-items: baseline; padding: 10px 14px; font-size: 13px; color: var(--text-2); border-bottom: 1px solid var(--rule-soft); }
.jf-steps .jf-h b { margin-left: auto; color: var(--text); white-space: nowrap; }
.jf-steps table { margin: 0; } .jf-steps td { vertical-align: middle; }
.jf-steps input[type=date] { width: 100%; }
.jf-steps p { padding: 0 14px; }
.pk-tabs { margin-top: -6px; }
.jp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.jp-steps { margin: 0; padding-left: 20px; font-size: 13.5px; line-height: 1.8; }
.jp-h { display: flex; gap: 12px; align-items: baseline; margin-bottom: 8px; }
.jp-tbl input, .jp-tbl select { width: 100%; min-width: 0; }
.jp-tbl td:nth-child(2) { min-width: 220px; width: 40%; }
.jp-tbl input[data-k=days] { width: 64px; }
.jp-tbl select[data-k=opens_as] { width: 150px; }
.jp-tbl input[data-k=ask_label] { width: 96px; }
.jp-tbl td.jp-law { white-space: nowrap; }
.jp-tbl td.jp-law input { width: 54px; display: inline-block; }
.jp-tbl [data-k=waiting_for] { margin-top: 4px; }
@media (max-width: 760px) {
  .js-list li { grid-template-columns: 26px minmax(0, 1fr); }
  .js-when { grid-column: 2; text-align: left; padding-top: 0; }
  .js-acts { margin-left: 0; }
  .jf-steps td:nth-child(2) .js-chip { display: none; }
}
.jp-tbl th:first-child, .jp-tbl td:first-child { width: 28px; padding-left: 10px; padding-right: 4px; }
.jp-tbl td:nth-child(2) { min-width: 190px; }
.jp-tbl select[data-k=opens_as] { width: 140px; }
.jp-tbl td.jp-law input { width: 48px; }
.jp-tbl td:last-child { white-space: nowrap; width: 52px; }

/* ---------- 1.5.58: billing and collection (update 59) ---------- */
.cx-sum { margin: 4px 2px 14px; font-size: 13.5px; color: var(--text-2); } .cx-sum b { color: var(--text); }
.cx-cols { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.cx-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.cx-p { padding: 16px 20px; }
.cx-ph { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; } .cx-ph h2 { margin: 0; font-size: 16px; } .cx-ph .r { margin-left: auto; }
.cx-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--rule-soft); cursor: pointer; }
.cx-row:first-of-type { border-top: 0; }
.cx-av { width: 32px; height: 32px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-size: 11.5px; font-weight: 700; color: var(--text-2); }
.cx-m { min-width: 0; } .cx-m b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-m .sub, .cx-tbl .sub { display: block; font-size: 12px; color: var(--text-3); margin-top: 1px; }
.cx-amt { font-weight: 600; white-space: nowrap; } .cx-amt.late { color: var(--accent); }
.cx-acts { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.cx-pill { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface); color: var(--text-2); white-space: nowrap; }
.cx-pill.late { background: var(--accent-soft); color: var(--accent); } .cx-pill.ok { color: var(--chart); } .cx-pill.pr { background: color-mix(in srgb, #3D6A8F 14%, var(--card)); color: var(--text); }
.cx-tl { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--rule-soft); font-size: 13.5px; cursor: pointer; }
.cx-tl:first-of-type { border-top: 0; } .cx-tl span { flex: 1; min-width: 0; } .cx-tl.done span { color: var(--text-3); text-decoration: line-through; }
.cx-nm { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-top: 1px solid var(--rule-soft); font-size: 13.5px; color: var(--text); text-decoration: none; }
.cx-nm:first-of-type { border-top: 0; } .cx-nm b.late { color: var(--accent); }
.cx-none { margin: 6px 0; }
.cx-age { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 0; overflow: hidden; }
.cx-age > div { padding: 14px 16px; border-right: 1px solid var(--rule-soft); display: flex; flex-direction: column; gap: 3px; } .cx-age > div:last-child { border-right: 0; }
.cx-age .l { font-size: 12.5px; color: var(--text-2); } .cx-age b { font-size: 19px; font-weight: 600; } .cx-age .bad b, .cx-age .bad .l { color: var(--accent); }
.cx-bar { height: 6px; border-radius: 999px; background: var(--surface); overflow: hidden; margin-top: 6px; } .cx-bar i { display: block; height: 100%; }
.cx-tblp { margin-top: 16px; padding: 14px 18px; }
.cx-tbl td { vertical-align: middle; } .cx-tbl tr[data-client] { cursor: pointer; }
.cx-acc-h { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.cx-figs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.cx-figs .panel { padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; } .cx-figs small { color: var(--text-2); font-size: 12.5px; } .cx-figs b { font-size: 19px; font-weight: 600; } .cx-figs span { font-size: 12px; color: var(--text-3); }
.cx-figs .bad b { color: var(--accent); }
.cx-led { margin-top: 14px; padding: 0; } .cx-led tr.cx-rc td { background: color-mix(in srgb, var(--chart) 9%, var(--card)); }
.cx-led tr.cx-tot td { font-weight: 600; text-align: right; }
.cx-led tr.cx-tot td.num { text-align: right; }
.rc-apply .rc-h { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-2); margin-bottom: 4px; }
.rc-tbl td { vertical-align: middle; } .rc-tbl .sub { display: block; font-size: 12px; color: var(--text-3); }
.rc-tbl input[type=number] { width: 120px; text-align: right; }
.rc-note { margin: 8px 0 0; padding: 9px 12px; border-radius: 10px; background: color-mix(in srgb, var(--chart) 12%, var(--card)); font-size: 13px; }
.rc-note.err { background: var(--accent-soft); color: var(--accent); }
.bx-x { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin: 0 0 12px; font-size: 13px; color: var(--text-2); }
.bx-pnb { display: contents; color: inherit; text-decoration: none; }
.about-dbl .about-ok { font-size: 12px; font-weight: 600; color: var(--chart); margin-left: 6px; }
.about-dbl > span:last-child { display: block; max-width: 340px; }
.about-dbd .about-db li { display: grid; grid-template-columns: 18px 32px minmax(0, 1fr) auto auto; gap: 10px; align-items: baseline; }
@media (max-width: 900px) {
  .cx-cols { grid-template-columns: minmax(0, 1fr); }
  .cx-figs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cx-age { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cx-age > div { border-right: 0; border-bottom: 1px solid var(--rule-soft); }
  .about-dbd .about-db li { grid-template-columns: 18px 28px minmax(0, 1fr); } .about-dbd .about-db li .d, .about-dbd .about-db li > span:last-child { grid-column: 3; }
}
@media (max-width: 640px) {
  .cx-row { grid-template-columns: 32px minmax(0, 1fr) auto; } .cx-row .cx-acts { grid-column: 2 / -1; justify-content: flex-start; }
  .cx-tbl thead { display: none; } .cx-tbl, .cx-tbl tbody, .cx-tbl tr, .cx-tbl td { display: block; } .cx-tbl tr { padding: 10px 0; border-bottom: 1px solid var(--rule-soft); } .cx-tbl td { padding: 2px 0; border: 0; text-align: left !important; }
  .cx-led table thead { display: none; } .cx-led table, .cx-led tbody, .cx-led tr, .cx-led td { display: block; } .cx-led tr { padding: 10px 12px; border-bottom: 1px solid var(--rule-soft); } .cx-led td { padding: 1px 0; border: 0; text-align: left !important; }
  .rc-tbl input[type=number] { width: 90px; }
}

.cx-figs .panel { margin: 0; }
.rc-tbl td:first-child { width: 34px; }
.rc-tbl td:nth-child(2) { text-align: left; }


/* ---------- 1.5.60: New ▾, closed days, out-audit place, Tally check, scorecard ---------- */
.nw { position: relative; display: inline-block; }
form.nw { display: block; width: 100%; }   /* the new windows' form shares the class with New ▾: keep it full width */
.nw-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 250px; padding: 6px; border-radius: 14px; background: var(--card); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; }
.nw-menu button { all: unset; cursor: pointer; display: flex; flex-direction: column; gap: 1px; padding: 8px 12px; border-radius: 10px; }
.nw-menu button:hover, .nw-menu button:focus-visible { background: var(--hover); }
.nw-menu b { font-size: 14px; font-weight: 600; color: var(--text); } .nw-menu span { font-size: 12px; color: var(--text-3); }
@media (max-width: 640px) { .nw-menu { right: auto; left: 0; } }
.ld-closed { margin-top: 3px; font-size: 11px; font-weight: 600; color: var(--accent); display: block; }
.db-date .ld-closed { margin: 1px 0 0; }
.at-where { display: block; font-size: 11px; line-height: 1.2; color: var(--text-2); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-tbl input[type=number] { width: 130px; text-align: right; }
.tc-foot { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; justify-content: flex-end; margin-top: 12px; } .tc-foot .field { flex: 1 1 260px; margin: 0; }
.sc-g { grid-template-columns: minmax(0, 1fr); }
.sc-h { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: baseline; } .sc-h .ov-note { flex: 1 1 260px; }
.sc-sw { display: flex; flex-wrap: wrap; gap: 8px; }
.sc-tbl tr.on td { background: color-mix(in srgb, var(--chart) 10%, var(--card)); } .sc-tbl td.sc-top { font-weight: 700; color: var(--text); }
.sc-webw { display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: center; }
.sw { width: 100%; max-width: 440px; height: auto; }
.sw-r { fill: none; stroke: var(--rule); } .sw-a { stroke: var(--rule); }
.sw-p { fill: color-mix(in srgb, var(--chart) 28%, transparent); stroke: var(--chart); stroke-width: 2; } .sw-d { fill: var(--chart); }
.sw-l { font-size: 11.5px; fill: var(--text-2); } .sw-l.z { fill: var(--text-3); }
.sc-pr { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 14px; background: var(--surface); min-width: 220px; } .sc-pr span { font-size: 13px; color: var(--text-2); }

/* ---------- 1.5.61 (update 62): fee preview, edit window, upcoming bills, statement, retainer and plan windows ---------- */
.tw-no { font-variant-numeric: tabular-nums; color: var(--text-2); font-weight: 500; }
.rt-code { display: inline-block; font-size: 12px; font-weight: 600; color: var(--text-2); background: var(--surface); border-radius: 6px; padding: 1px 7px; vertical-align: 2px; font-variant-numeric: tabular-nums; }
.fv-pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; background: var(--surface); color: var(--text-2); }
.fv-pill.due { background: color-mix(in srgb, #C9972E 16%, var(--card)); color: var(--text); }
.fv-pill.late { background: var(--accent-soft); color: var(--accent); }
.fv-pill.ok { color: var(--chart); }
.fv-pill.up { background: color-mix(in srgb, #3D6A8F 14%, var(--card)); color: var(--text); }
dialog.fv-dlg, dialog.st-dlg, dialog.rf-dlg { width: min(1240px, calc(100vw - 24px)); }
.fv { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 22px; align-items: start; }
.fv-paper, .st-paper { background: color-mix(in srgb, var(--surface) 70%, var(--bg)); border-radius: 12px; padding: 18px; display: flex; justify-content: center; overflow: auto; }
.fv-page, .st-page { width: 100%; max-width: 680px; aspect-ratio: 210 / 297; background: #fff; color: #1C2826; box-shadow: 0 2px 14px rgba(28, 40, 38, 0.12); padding: 40px 44px 26px; font-size: 12.5px; display: flex; flex-direction: column; font-variant-numeric: tabular-nums; }
.fv-page .muted, .st-page .muted { color: #5A6560; }
.fv-k, .st-k { display: block; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 700; color: #47514C; }
.fv-hd { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; padding-bottom: 14px; border-bottom: 2px solid #1C2826; }
.fv-no { font-size: 22px; font-weight: 600; margin-top: 3px; }
.fv-for { color: #3F4A45; margin-top: 3px; }
.fv-bal { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.fv-bal b { font-size: 22px; } .fv-bal > span:not(.fv-pill) { font-size: 11.5px; color: #47514C; }
.fv-page .fv-pill { margin-top: 4px; }
.fv-page .fv-pill.due { background: #F5EEDC; color: #6B4A10; } .fv-page .fv-pill.late { background: #F6E6DE; color: #8E4426; } .fv-page .fv-pill.ok { background: #EAF0E6; color: #45603F; } .fv-page .fv-pill.up { background: #E6ECF2; color: #2E4A66; } .fv-page .fv-pill.mute { background: #EEF0EC; color: #47514C; }
.fv-two { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; padding: 14px 0; border-bottom: 1px solid #E3E6E0; }
.fv-cl b { display: block; font-size: 13.5px; margin: 6px 0 3px; } .fv-cl div { color: #3F4A45; line-height: 1.6; }
.fv-kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 6px 0 0; }
.fv-kv dt { color: #47514C; } .fv-kv dd { margin: 0; text-align: right; font-weight: 500; }
.fv-l { color: #2E4A66; font-weight: 600; }
.fv-it { width: 100%; border-collapse: collapse; table-layout: fixed; margin-top: 14px; }
.fv-it th { background: none; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: #47514C; padding: 0 0 7px; border-bottom: 1.5px solid #1C2826; text-align: left; font-weight: 700; }
.fv-it td { padding: 10px 0; border-bottom: 1px solid #E3E6E0; vertical-align: top; background: none !important; font-size: 12.5px; color: #1C2826; }
.fv-it td .s { display: block; color: #47514C; font-size: 11.5px; margin-top: 2px; }
.fv-it .num, .fv-tot .num, .fv-pay .num, .st-tbl .num { text-align: right; }
.fv-tg { display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 999px; background: #EEF0EC; color: #3F4A45; } .fv-tg.o { background: #F5EEDC; color: #6B4A10; }
.fv-ft { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 26px; margin-top: 12px; }
.fv-note { color: #3F4A45; line-height: 1.55; } .fv-note .fv-k { margin-bottom: 4px; }
.fv-tot div { display: flex; justify-content: space-between; padding: 3px 0; } .fv-tot .m { color: #47514C; }
.fv-tot .g, .st-tot .g { background: #1C2826; color: #fff; font-weight: 700; font-size: 14px; padding: 8px 11px; margin-top: 6px; border-radius: 5px; }
.fv-pay { margin-top: 20px; } .fv-pay table { width: 100%; border-collapse: collapse; margin-top: 6px; }
.fv-pay th { background: none; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: #47514C; padding: 0 0 5px; border-bottom: 1px solid #C9CEC6; text-align: left; font-weight: 700; }
.fv-pay td { font-size: 12px; padding: 6px 0; border-bottom: 1px solid #E3E6E0; background: none !important; color: #1C2826; }
.fv-foot, .st-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid #E3E6E0; display: flex; justify-content: space-between; gap: 12px; color: #47514C; font-size: 11px; }
.fv-side, .rf-side, .st-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.fv-card { background: var(--card); border: 1px solid var(--rule-soft); border-radius: 14px; padding: 14px 16px; font-size: 13px; }
.fv-card h4 { margin: 0 0 8px; font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-2); }
.fv-ln { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 5px 0; border-top: 1px solid var(--rule-soft); }
.fv-ln:first-of-type { border-top: 0; } .fv-ln .sub { display: block; font-size: 11.5px; color: var(--text-3); }
.fv-ln .link-btn { font-weight: 600; text-align: right; }
.fv-add { margin-top: 8px; font-weight: 600; }
.fv-sw { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.fv-hist .bill-hist { margin: 0; }
.fv-more { position: relative; }
.fv-menu { position: absolute; bottom: calc(100% + 6px); left: 0; background: var(--card); border: 1px solid var(--rule-soft); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; min-width: 210px; z-index: 5; display: flex; flex-direction: column; }
.fv-menu button { border: 0; background: none; text-align: left; padding: 9px 12px; border-radius: 8px; font: inherit; color: var(--text); cursor: pointer; }
.fv-menu button:hover { background: var(--hover); } .fv-menu button.danger { color: var(--accent); }
@media (max-width: 960px) { .fv { grid-template-columns: 1fr; } .fv-paper, .st-paper { padding: 0; background: none; } .fv-page, .st-page { aspect-ratio: auto; padding: 22px 18px; box-shadow: none; border: 1px solid var(--rule-soft); border-radius: 12px; } .fv-two, .fv-ft { grid-template-columns: 1fr; gap: 12px; } .fv-hd { flex-direction: column; } .fv-bal { align-items: flex-start; text-align: left; } }
/* the edit window */
.fe-h { margin: 8px 0 -2px; font-size: 11px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--text-3); font-weight: 700; border-top: 1px solid var(--rule-soft); padding-top: 12px; }
.form-grid > .fe-h:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.fe-ro { padding: 8px 0; font-weight: 600; }
/* upcoming bills, the client account */
.up-list { list-style: none; margin: 0; padding: 0; }
.up-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 4px 12px; align-items: center; padding: 9px 0; border-top: 1px solid var(--rule-soft); }
.up-list li:first-child { border-top: 0; } .up-list li[data-upbill] { cursor: pointer; }
.up-m { min-width: 0; } .up-m b { display: block; } .up-m .sub { display: block; font-size: 12.5px; color: var(--text-3); }
.cx-figs.ac4 { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 14px; }
.ac-list { padding: 14px 16px 6px; margin-top: 0; }
.ac-tbl td, .ac-tbl th { vertical-align: middle; }
.ac-tbl .ac-no { width: 130px; white-space: nowrap; } .ac-tbl .ac-d { width: 70px; white-space: nowrap; } .ac-tbl .ac-st { width: 170px; } .ac-tbl .ac-ed { width: 86px; text-align: right; }
.ac-tbl tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--surface) 35%, var(--card)); }
.ac-two { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 14px; margin-top: 14px; }
.ac-two .panel { padding: 14px 16px; margin: 0; }
@media (max-width: 900px) { .cx-figs.ac4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ac-two { grid-template-columns: 1fr; } .ac-tbl .ac-hide, .ac-tbl .ac-d { display: none; } .ac-tbl .ac-no { width: auto; } .ac-tbl .ac-st { width: auto; } }
@media (max-width: 560px) { .ac-tbl .ac-st { display: none; } }
.bx.bx-np { grid-template-columns: 250px minmax(0, 1fr); } .bx.bx-np .bx-pane { display: none; }
/* the statement of fees due */
.st-win { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
.st-lh { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; }
.st-firm { display: flex; flex-direction: column; gap: 2px; color: #3F4A45; font-size: 11.5px; } .st-firm b { font-size: 15px; color: #1C2826; }
.st-ttl { text-align: right; display: flex; flex-direction: column; gap: 4px; } .st-ttl b { font-size: 15px; letter-spacing: 0.14em; } .st-ttl span { color: #3F4A45; font-size: 11.5px; }
.st-rule { height: 5px; border-top: 2px solid #1C2826; border-bottom: 1px solid #1C2826; margin: 14px 0 14px; }
.st-to { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: start; }
.st-to b { display: block; font-size: 13.5px; margin: 4px 0 2px; } .st-to span:not(.st-k) { color: #3F4A45; font-size: 11.5px; }
.st-due { background: #F4F5F2; border-radius: 6px; padding: 10px 14px; text-align: right; min-width: 200px; } .st-due b { font-size: 19px; }
.st-tbl { width: 100%; border-collapse: collapse; table-layout: fixed; margin-top: 16px; }
.st-tbl th { background: none; font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase; color: #47514C; padding: 0 6px 6px; border-bottom: 1.5px solid #1C2826; text-align: left; font-weight: 700; }
.st-tbl td { font-size: 12px; padding: 9px 6px; border-bottom: 1px solid #E3E6E0; vertical-align: top; background: none !important; color: #1C2826; }
.st-tbl td .s { display: block; font-size: 10.5px; color: #47514C; margin-top: 2px; } .st-tbl td .s.late { color: #8E4426; font-weight: 600; }
.st-tot { width: 270px; margin: 14px 0 0 auto; font-size: 12px; } .st-tot div { display: flex; justify-content: space-between; padding: 4px 6px; }
.st-bank { margin-top: 20px; padding: 12px 14px; background: #F7F8F5; border-radius: 6px; }
.st-bank dl { display: grid; grid-template-columns: 90px minmax(0, 1fr) 70px minmax(0, 1fr); gap: 4px 10px; margin: 6px 0 0; font-size: 11px; } .st-bank dt { color: #47514C; } .st-bank dd { margin: 0; font-weight: 600; }
.st-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.st-chips button { border: 0; background: var(--surface); color: var(--text); font: inherit; font-size: 13px; padding: 6px 12px; border-radius: 999px; cursor: pointer; }
.st-chips button.on { background: var(--btn-bg); color: var(--btn-text); font-weight: 600; }
.st-cust { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.st-side textarea { width: 100%; font-size: 13px; }
.st-acts { display: flex; flex-direction: column; gap: 8px; } .st-acts .btn { width: 100%; }
@media (max-width: 960px) { .st-win { grid-template-columns: 1fr; } .st-to { grid-template-columns: 1fr; } .st-due { text-align: left; } .st-bank dl { grid-template-columns: 90px minmax(0, 1fr); } }
/* the retainer and plan windows */
.rf-split { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
.rf-side { position: sticky; top: 0; }
.rf-dlg .form-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.rf-dlg .form-grid > .rf-name { grid-column: span 2; }
.rf-dlg .form-grid > .field.full, .rf-dlg .form-grid > .full { grid-column: 1 / -1; }
.rf-dlg .form-grid > label.field:has(textarea[name=activities]), .rf-dlg .form-grid > label.field:has(textarea[name=excluded]) { grid-column: span 2; }
.rf-plans { display: flex; flex-wrap: wrap; gap: 8px; }
.rf-plan { border: 0; background: var(--surface); color: var(--text); font: inherit; font-size: 13.5px; padding: 8px 14px; border-radius: 10px; cursor: pointer; }
.rf-plan small { color: var(--text-3); margin-left: 6px; font-size: 12px; }
.rf-plan.on { background: var(--btn-bg); color: var(--btn-text); font-weight: 600; } .rf-plan.on small { color: inherit; opacity: 0.8; }
.rf-ch { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rf-card { display: flex; flex-direction: column; gap: 4px; border: 1.5px solid var(--rule); border-radius: 12px; padding: 12px 14px; cursor: pointer; font-size: 12.5px; color: var(--text-2); position: relative; }
.rf-card input[type=radio][name=rf_mode] { position: absolute; top: 14px; left: 14px; margin: 0; accent-color: var(--btn-bg); }
.rf-card b { padding-left: 24px; font-size: 14px; color: var(--text); }
.rf-card > span { padding-left: 24px; }
.rf-card.on { border-color: var(--text); background: color-mix(in srgb, var(--surface) 55%, var(--card)); }
.rf-card.off { opacity: 0.5; cursor: not-allowed; }
.rf-card select { margin-top: 6px; }
.rf-note { color: var(--text-3); font-size: 12px; margin-top: 4px; }
.rf-seg { display: inline-flex; gap: 6px; margin-top: 8px; padding-left: 24px; }
.rf-seg label { display: inline-flex; } .rf-seg input { position: absolute; opacity: 0; pointer-events: none; }
.rf-seg span { padding: 6px 12px; border-radius: 999px; background: var(--surface); color: var(--text); font-size: 13px; cursor: pointer; }
.rf-seg input:checked + span { background: var(--btn-bg); color: var(--btn-text); font-weight: 600; }
.rf-seg input:focus-visible + span { outline: 2px solid var(--ring); outline-offset: 2px; }
.rf-chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 2px 0 8px; }
.rf-chip { display: inline-flex; align-items: center; gap: 4px; padding: 5px 6px 5px 11px; border-radius: 999px; background: color-mix(in srgb, var(--chart) 14%, var(--card)); font-size: 13px; color: var(--text); border: 0; font: inherit; font-size: 13px; }
.rf-chip button { border: 0; background: none; color: var(--text-3); cursor: pointer; font-size: 12px; padding: 0 4px; }
.rf-chip.add { background: none; border: 1px dashed var(--rule); color: var(--text); font-weight: 600; padding: 5px 12px; cursor: pointer; }
.rf-pick { margin-bottom: 8px; } .rf-pick .rt-svcs { max-height: 260px; }
.rf-big { font-size: 24px; font-weight: 700; margin-bottom: 8px; } .rf-big span { font-size: 13px; font-weight: 500; color: var(--text-3); }
.rf-tl { position: relative; padding-left: 18px; }
.rf-tl::before { content: ''; position: absolute; left: 4px; top: 8px; bottom: 14px; border-left: 1.5px solid var(--rule); }
.rf-tl > div { position: relative; padding: 0 0 12px; line-height: 1.45; }
.rf-tl > div::before { content: ''; position: absolute; left: -18px; top: 5px; width: 9px; height: 9px; border-radius: 50%; background: var(--text); }
.rf-tl > div.w::before { background: var(--card); border: 1.5px dashed var(--text-3); width: 7px; height: 7px; }
.rf-tl b { display: block; font-size: 13px; } .rf-tl span { color: var(--text-3); font-size: 12px; }
@media (max-width: 960px) { .rf-split { grid-template-columns: 1fr; } .rf-side { position: static; } .rf-dlg .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .rf-ch { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .rf-dlg .form-grid { grid-template-columns: 1fr; } .rf-dlg .form-grid > .rf-name, .rf-dlg .form-grid > label.field:has(textarea) { grid-column: auto; } }
.ac-tbl .ac-ed .btn { margin: 0; }
.rf-dlg .form-grid > .check-row { display: flex; flex-direction: row; align-items: center; gap: 8px; align-self: end; min-height: 40px; }
.rf-dlg .form-grid > .check-row:not(.full) { grid-column: span 2; }
dialog.fv-dlg .d-foot { flex-wrap: wrap; row-gap: 8px; }
@media (max-width: 560px) { .fv-it th:nth-child(3), .fv-it td:nth-child(3) { display: none; } .fv-pay th:nth-child(3), .fv-pay td:nth-child(3) { display: none; } .st-tbl th:nth-child(4), .st-tbl td:nth-child(4) { display: none; } }
/* 1.5.62: the fee window exactly as pictured — top bar with the number, status and actions; grey desk; white side cards */
dialog.fv-dlg { width: min(1380px, calc(100vw - 24px)); padding: 0; }
dialog.fv-dlg .d-head.fv-head { display: flex; align-items: center; gap: 12px; padding: 14px 22px; border-bottom: 1px solid var(--rule-soft); background: var(--card); }
dialog.fv-dlg .fv-head h2 { margin: 0; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fv-head .fv-pill { font-size: 13px; padding: 4px 12px; }
.fv-sp { flex: 1; }
.fv-acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.fv-acts .btn { margin: 0; }
.fv-acts .fv-menu { top: calc(100% + 6px); bottom: auto; right: 0; left: auto; }
dialog.fv-dlg .d-body { background: color-mix(in srgb, var(--surface) 75%, var(--bg)); padding: 22px 30px 26px; }
dialog.fv-dlg .fv { grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; }
dialog.fv-dlg .fv-paper { background: none; padding: 0; flex-direction: column; align-items: center; }
.fv-a4 { width: 100%; max-width: 680px; text-align: right; font-size: 11px; color: var(--text-3); margin: 0 0 6px; }
dialog.fv-dlg .fv-page { max-width: 680px; padding: 42px 46px 24px; font-size: 12.5px; }
.fv-page .fv-k { font-size: 9.5px; letter-spacing: 0.14em; }
.fv-page .fv-no { font-size: 22px; } .fv-page .fv-bal b { font-size: 22px; }
.fv-page .fv-pill.sm { font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 700; padding: 2px 9px; margin-top: 6px; }
.fv-page .fv-pill.sm.due, .fv-page .fv-pill.sm.up { background: #E6ECF2; color: #2E4A66; }
.fv-page .fv-two { gap: 30px; padding: 16px 0 14px; }
.fv-page .fv-kv { gap: 4px 12px; } .fv-page .fv-kv dd { white-space: nowrap; }
.fv-page .fv-l { color: #2E4A66; font-weight: 500; }
.fv-page .fv-it td { padding: 10px 0; }
.fv-page .fv-tot div { padding: 3.5px 0; color: #1C2826; }
.fv-page .fv-tot .g { margin-top: 10px; padding: 9px 12px; font-size: 14px; }
.fv-page .fv-pay td:first-child.fv-l { color: #2E4A66; }
dialog.fv-dlg .fv-side { gap: 16px; }
dialog.fv-dlg .fv-card { background: var(--card); border: 0; border-radius: 16px; padding: 18px 20px; box-shadow: 0 1px 2px rgba(28, 40, 38, 0.05); }
dialog.fv-dlg .fv-card h4 { font-size: 11px; letter-spacing: 0.1em; color: var(--text-2); margin-bottom: 12px; }
.fv-lk { border: 0; background: none; padding: 0; font: inherit; font-weight: 600; color: color-mix(in srgb, #2E4A66 80%, var(--text)); cursor: pointer; text-align: right; }
.fv-lk:hover { text-decoration: underline; }
.fv-ln { padding: 8px 0; }
.fv-pl { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0 8px; }
.fv-pl .sub, .fv-pl .num .sub { display: block; font-size: 12.5px; color: var(--text-2); font-weight: 400; }
.fv-pl .num { text-align: right; }
.fv-pl .fv-l { color: color-mix(in srgb, #2E4A66 80%, var(--text)); font-weight: 600; }
.fv-add { margin-top: 10px; display: inline-block; }
.fv-none { margin: 0; color: var(--text-2); font-size: 13px; }
.fv-sw { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.fv-sw input { position: absolute; opacity: 0; pointer-events: none; }
.fv-sw i { width: 34px; height: 20px; border-radius: 999px; background: var(--rule); position: relative; flex: none; transition: background 0.15s; }
.fv-sw i::after { content: ''; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: left 0.15s; }
.fv-sw input:checked + i { background: var(--btn-bg); } .fv-sw input:checked + i::after { left: 17px; }
.fv-sw input:focus-visible + i { outline: 2px solid var(--ring); outline-offset: 2px; }
.fv-hl { list-style: none; margin: 0; padding: 0; font-size: 13px; line-height: 1.75; color: var(--text-2); } .fv-hl b { color: var(--text); font-weight: 600; }
@media (max-width: 960px) {
  dialog.fv-dlg .d-head.fv-head { flex-wrap: wrap; padding: 12px 14px; }
  .fv-sp { display: none; } .fv-acts { order: 3; width: 100%; justify-content: flex-start; }
  dialog.fv-dlg .d-body { padding: 14px; } dialog.fv-dlg .fv { grid-template-columns: 1fr; }
  .fv-a4 { display: none; } dialog.fv-dlg .fv-page { padding: 22px 18px; }
  .fv-page .fv-kv dd { white-space: normal; }
}
/* the lines in the edit window */
.fe-lines { display: flex; flex-direction: column; gap: 6px; }
.fe-lh, .fe-ln { display: grid; grid-template-columns: 22px minmax(0, 1fr) 160px 130px 28px; gap: 8px; align-items: center; }
.fe-lh { font-size: 12px; color: var(--text-2); } .fe-lh .num, .fe-ln .num { text-align: right; }
.fe-n { color: var(--text-3); text-align: center; }
.fe-x { border: 0; background: none; color: var(--text-3); cursor: pointer; font-size: 14px; } .fe-x:disabled { visibility: hidden; }
.fe-addl { align-self: flex-start; margin: 6px 0 4px; font-weight: 600; }
@media (max-width: 640px) { .fe-lh { display: none; } .fe-ln { grid-template-columns: 18px minmax(0, 1fr) 96px 24px; } .fe-ln select { grid-column: 2 / 3; grid-row: 2; } }
.fv-page .fv-tot .g { color: #fff; }
.fe-addl { display: block; } .fe-addl + small { display: block; }
/* 1.5.63: Billing → Fees in three columns; the short preview; the fee window; one scroll bar */
.bxw .bx.bx3 { grid-template-columns: 240px minmax(0, 1fr) minmax(340px, 390px); }
.bx3 .sp { width: 100%; }
.bx3 .bx-pane { display: block; border-left: 1px solid var(--rule-soft); padding: 0; }
.bx-fl5 .bx-f .nm { font-weight: 500; }
.bx-hist { display: block; padding: 10px 12px; font-size: 13px; color: var(--text-2); text-decoration: none; }
.bx-hist:hover { color: var(--text); text-decoration: underline; }
.bx3 .bx-row .d .ok { color: var(--chart); font-weight: 600; } .bx3 .bx-row .d .due-late { font-weight: 600; }
.sp { padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; font-size: 13.5px; position: sticky; top: 0; }
.sp-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; } .sp-no { font-size: 16px; font-variant-numeric: tabular-nums; }
.sp-cl { color: color-mix(in srgb, #2E4A66 80%, var(--text)); font-weight: 600; font-size: 14.5px; text-decoration: none; } .sp-cl:hover { text-decoration: underline; }
.sp-amt b { display: block; font-size: 28px; font-weight: 700; } .sp-amt span { color: var(--text-3); font-size: 12.5px; }
.sp-kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; padding: 12px 0; border-top: 1px solid var(--rule-soft); border-bottom: 1px solid var(--rule-soft); }
.sp-kv dt { color: var(--text-3); } .sp-kv dd { margin: 0; text-align: right; font-weight: 500; }
.sp-lines h5 { margin: 0 0 6px; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); }
.sp-lines div { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; } .sp-more { margin: 2px 0 0; color: var(--text-3); font-size: 12.5px; }
.sp-money div { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; } .sp-money .m { color: var(--text-3); }
.sp-money .g { font-weight: 700; font-size: 14.5px; border-top: 1px solid var(--rule-soft); margin-top: 4px; padding-top: 9px; color: var(--text); }
.sp-acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; } .sp-acts .btn { margin: 0; }
.sp-acts .fv-menu { top: calc(100% + 6px); bottom: auto; left: 0; right: auto; max-width: calc(100vw - 32px); }
.sp-foot { display: flex; justify-content: space-between; align-items: center; padding-top: 12px; border-top: 1px solid var(--rule-soft); }
.bx-new { position: relative; }
.bx-nmenu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 260px; background: var(--card); border: 1px solid var(--rule-soft); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 20; display: flex; flex-direction: column; }
.bx-nmenu.hidden { display: none; }
.bx-nmenu button { border: 0; background: none; text-align: left; padding: 9px 12px; border-radius: 9px; font: inherit; color: var(--text); cursor: pointer; }
.bx-nmenu button:hover, .bx-nmenu button:focus-visible { background: var(--hover); }
.bx-nmenu b { display: block; font-weight: 600; } .bx-nmenu span { display: block; font-size: 12.5px; color: var(--text-3); }
/* one scroll bar in these windows: only the middle scrolls */
dialog.fe2-dlg, dialog.fv-dlg, dialog.rf-dlg, dialog.st-dlg { max-height: calc(100vh - 32px); overflow: hidden; display: flex; flex-direction: column; }
dialog.fe2-dlg[open], dialog.fv-dlg[open], dialog.rf-dlg[open], dialog.st-dlg[open] { display: flex; }
dialog.fe2-dlg .d-body, dialog.fv-dlg .d-body, dialog.rf-dlg .d-body, dialog.st-dlg .d-body { max-height: none; flex: 1 1 auto; min-height: 0; overflow-y: auto; }
dialog.fe2-dlg .d-head, dialog.fe2-dlg .d-foot, dialog.fv-dlg .d-head { flex: none; }
/* the fee window */
dialog.fe2-dlg { width: min(1160px, calc(100vw - 24px)); }
dialog.fe2-dlg .d-head { display: flex; align-items: center; gap: 10px; } dialog.fe2-dlg .d-head h2 { margin: 0; }
.fe2-who { color: var(--text-3); font-size: 13px; }
dialog.fe2-dlg .d-body { padding: 0; }
.fe2 { display: grid; grid-template-columns: minmax(0, 1fr) 310px; min-height: 100%; }
.fe2-main { padding: 6px 24px 14px; min-width: 0; }
.fe2-side { background: color-mix(in srgb, var(--surface) 70%, var(--bg)); border-left: 1px solid var(--rule-soft); padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.fe2-sec { padding: 14px 0; border-bottom: 1px solid var(--rule-soft); } .fe2-sec:last-child { border-bottom: 0; }
.fe2-sec h5, .fe2-card h5 { margin: 0 0 10px; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); font-weight: 700; }
.fe2-g { display: grid; gap: 10px 14px; } .fe2-g1 { grid-template-columns: 1fr; margin-bottom: 10px; } .fe2-g21 { grid-template-columns: 2fr 1fr; } .fe2-g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .fe2-g311 { grid-template-columns: 1.6fr 1fr 1fr; }
.fe2 .field { margin: 0; }
.fe2-sec textarea { width: 100%; }
.fe2-hint { margin: 8px 0 0; font-size: 12px; color: var(--text-3); } .fe2-l { color: color-mix(in srgb, #2E4A66 80%, var(--text)); }
.fe2-card { background: var(--card); border-radius: 14px; padding: 14px 16px; }
.fe2-sw { display: flex; align-items: center; gap: 10px; padding: 6px 0; cursor: pointer; font-size: 13.5px; }
.fe2-sw input { position: absolute; opacity: 0; pointer-events: none; }
.fe2-sw i { width: 34px; height: 20px; border-radius: 999px; background: var(--rule); position: relative; flex: none; transition: background 0.15s; }
.fe2-sw i::after { content: ''; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: left 0.15s; }
.fe2-sw input:checked + i { background: var(--btn-bg); } .fe2-sw input:checked + i::after { left: 17px; }
.fe2-sw input:focus-visible + i { outline: 2px solid var(--ring); outline-offset: 2px; }
.fe2-sw small { color: var(--text-3); font-size: 12px; }
.fe2-sub { width: calc(100% - 44px); margin: 0 0 6px 44px; }
.fe2-ln { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; font-variant-numeric: tabular-nums; } .fe2-ln.m { color: var(--text-3); }
.fe2-ln.g { font-weight: 700; font-size: 15px; border-top: 1px solid var(--rule-soft); margin-top: 4px; padding-top: 9px; }
.fe2-hist { list-style: none; margin: 0; padding: 0 0 0 12px; border-left: 2px solid var(--rule-soft); display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.fe2-hist small { display: block; color: var(--text-3); font-size: 12px; margin-top: 1px; }
.fe2-none { margin: 0; color: var(--text-3); font-size: 13px; }
.fe2-del { color: var(--accent); font-weight: 600; }
dialog.fe2-dlg .d-foot { justify-content: flex-start; align-items: center; }
@media (max-width: 900px) { .fe2 { grid-template-columns: 1fr; } .fe2-side { border-left: 0; border-top: 1px solid var(--rule-soft); } .fe2-g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .fe2-g21, .fe2-g311 { grid-template-columns: 1fr; } .fe2-who { display: none; } }
.fe2-sub { display: block; box-sizing: border-box; min-width: 0; max-width: calc(100% - 44px); }

/* ---------- 1.5.64: Billing tabs, Receipts, the receipt and outlay windows, retainer check ---------- */
.cx-seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 11px; background: var(--surface); margin: 0 0 14px; }
.cx-seg a { padding: 6px 14px; border-radius: 8px; font-size: 13.5px; color: var(--text-2); text-decoration: none; }
.cx-seg a.on { background: var(--card); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06); }
.bo-check { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 18px; margin: 0 0 16px; border-radius: 16px; background: var(--card); box-shadow: inset 3px 0 0 var(--accent); }
.bo-check span { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; } .bo-check small { color: var(--text-2); font-size: 12.5px; }
.bo-check i { font-style: normal; font-weight: 600; color: var(--accent); white-space: nowrap; }
.bo-check:hover { background: var(--hover); } .bo-check:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.bx-gh2 { list-style: none; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); padding: 16px 18px 6px; border-bottom: 1px solid var(--rule-soft); }
.bx-row.bx-up .d.late { color: var(--accent); }
/* Receipts register */
.rx { display: flex; flex-direction: column; gap: 14px; }
.rx-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rx-bar input[type=search] { flex: 0 1 340px; min-width: 0; } .rx-sp { flex: 1; }
.rx-figs { margin: 0; }
.rx-card { padding: 0; overflow: hidden; margin: 0; }
.rx-scroll { overflow: auto; max-height: calc(100vh - 360px); min-height: 160px; }
.rx-tbl { width: 100%; margin: 0; }
.rx-tbl thead th { position: sticky; top: 0; z-index: 1; background: var(--card); }
.rx-tbl tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--surface) 45%, var(--card)); }
.rx-tbl td { vertical-align: middle; } .rx-tbl .sub { display: block; color: var(--text-3); font-size: 12px; font-weight: 400; }
.rx-no b { color: color-mix(in srgb, #2E4A66 80%, var(--text)); font-weight: 600; white-space: nowrap; }
.rx-d, .rx-m { white-space: nowrap; } .rx-e { width: 1%; text-align: right; white-space: nowrap; }
.rx-to { color: var(--text-2); font-size: 13px; } .rx-adv { color: var(--chart); font-weight: 600; }
.rx-foot { display: flex; justify-content: space-between; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--rule-soft); color: var(--text-2); font-size: 13px; }
.rx-none { padding: 24px 16px !important; text-align: center; }
@media (max-width: 860px) { .rx-to, .rx-t, .rx-m { display: none; } .rx-scroll { max-height: none; } .rx-bar input[type=search] { flex: 1 1 100%; } }
@media (max-width: 560px) { .rx-no { display: none; } .rx-e .btn { padding: 4px 8px; } }
/* The receipt and outlay windows (the fee window's layout) */
.rc2-g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 10px; }
.rc2-amt { font-size: 17px; font-weight: 600; text-align: right; }
.rc2-ro { padding: 8px 0; font-weight: 600; } .rc2-ro small { color: var(--text-3); font-weight: 400; margin-left: 6px; }
.rc2-seg { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.rc2-seg label { position: relative; cursor: pointer; margin: 0; }
.rc2-seg input { position: absolute; opacity: 0; pointer-events: none; }
.rc2-seg span { display: inline-block; padding: 7px 14px; border-radius: 999px; background: var(--surface); font-size: 13.5px; }
.rc2-seg input:checked + span { background: var(--btn-bg); color: var(--btn-text); font-weight: 600; }
.rc2-seg input:focus-visible + span { outline: 2px solid var(--ring); outline-offset: 2px; }
.rc2-h { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 12px; }
.rc2-ln { display: grid; grid-template-columns: 22px minmax(0, 1fr) 130px; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--rule-soft); font-size: 13.5px; }
.rc2-ln:first-child { border-top: 0; } .rc2-ln input[type=checkbox] { width: 16px; height: 16px; }
.rc2-t small { display: block; color: var(--text-3); font-size: 12px; } .rc2-t small.late { color: var(--accent); font-weight: 600; }
.rc2-ln input[type=number] { text-align: right; }
.rc2-info { color: var(--text-2); font-size: 12.5px; line-height: 1.5; }
.fe2-ln.g.bad { color: var(--accent); }
dialog.rc2-dlg { width: min(1060px, calc(100vw - 24px)); }
@media (max-width: 900px) { .rc2-g3 { grid-template-columns: 1fr 1fr; } .rc2-ln { grid-template-columns: 22px minmax(0, 1fr) 100px; } }
/* Check your retainers */
dialog.rk-dlg { width: min(1080px, calc(100vw - 24px)); }
dialog.rk-dlg .d-head { display: flex; align-items: center; gap: 10px; } dialog.rk-dlg .d-head h2 { margin: 0; }
.rk-sub { color: var(--text-3); font-size: 13px; flex: 1; }
.rk-intro { margin: 0 0 12px; color: var(--text-2); font-size: 13.5px; }
.rk-scroll { overflow-x: auto; }
.rk-tbl { width: 100%; margin: 0; } .rk-tbl td { vertical-align: middle; } .rk-tbl .sub { display: block; color: var(--text-3); font-size: 12px; }
.rk-seg { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.rk-seg label { position: relative; cursor: pointer; margin: 0; } .rk-seg input { position: absolute; opacity: 0; pointer-events: none; }
.rk-seg span { display: inline-block; padding: 6px 12px; border-radius: 999px; background: var(--surface); font-size: 13px; white-space: nowrap; }
.rk-seg input:checked + span { background: var(--btn-bg); color: var(--btn-text); font-weight: 600; }
.rk-seg input:disabled + span { opacity: 0.45; cursor: not-allowed; }
.rk-seg input:focus-visible + span { outline: 2px solid var(--ring); outline-offset: 2px; }
.rk-svc { display: block; margin-top: 6px; max-width: 280px; }
.rk-cd { width: 96px; }
dialog.rk-dlg .d-foot { align-items: center; }
@media (max-width: 760px) { .rk-tbl thead { display: none; } .rk-tbl tr { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--rule-soft); } .rk-tbl td { border: 0; padding: 0; } .rk-tbl td:nth-child(3) { grid-column: 1 / -1; } }
.rx-bar select { width: auto; flex: none; }
.rc2 div.field { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.bo-nm { margin-top: 20px; }
.bo-nml { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 28px; }
@media (max-width: 1000px) { .bo-nml { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .bo-nml { grid-template-columns: 1fr; } }

/* ---------- 1.5.65: Firm overview → Scorecard (layout B) ---------- */
.sc-g { display: flex; flex-direction: column; gap: 14px; }
.sc-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; } .sc-who { font-size: 13px; color: var(--text-2); font-weight: 600; }
.sc-ks { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.sc-k { background: var(--card); border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow-sm, 0 1px 3px rgba(28, 40, 38, 0.06)); }
.sc-k small { font-size: 12.5px; color: var(--text-2); } .sc-k b { font-size: 22px; font-weight: 700; } .sc-k span { font-size: 12px; color: var(--text-3); }
.sc-body { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 14px; align-items: start; }
.sc-body .panel { margin: 0; }
.sc-ph { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; } .sc-ph h3 { margin: 0; font-size: 15px; }
.sc-webw { display: flex; justify-content: center; } .sc-sw2 { width: 100%; max-width: 480px; height: auto; }
.sc-cap { margin: 6px 0 0; text-align: center; } .sc-barp .sc-cap { text-align: left; }
.sc-bars { display: flex; flex-direction: column; gap: 2px; }
.sc-bar { display: grid; grid-template-columns: minmax(90px, 150px) minmax(0, 1fr) 76px; gap: 12px; align-items: center; padding: 6px 0; font-size: 13.5px; }
.sc-bn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-bt { height: 10px; border-radius: 999px; background: var(--surface); overflow: hidden; } .sc-bt i { display: block; height: 100%; border-radius: 999px; background: var(--ov-1, var(--chart)); }
.sc-bar b { text-align: right; font-weight: 600; }
@media (max-width: 1100px) { .sc-ks { grid-template-columns: repeat(3, minmax(0, 1fr)); } .sc-body { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .sc-ks { grid-template-columns: repeat(2, minmax(0, 1fr)); } .sc-bar { grid-template-columns: minmax(80px, 110px) minmax(0, 1fr) 64px; gap: 8px; } .sc-ph .ov-seg { flex-wrap: wrap; } }
.sc-sw2 .sw-l { font-size: 13px; }
/* 1.5.66: Scorecard in one card */
.sc-one .sc-body { display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); gap: 24px; align-items: center; }
.sc-one .sc-bar { border-bottom: 1px solid var(--rule-soft); }
.sc-bar.z .sc-bn, .sc-bar.z b { color: var(--text-3); font-weight: 400; } .sc-bar.top .sc-bn { font-weight: 700; }
@media (max-width: 1100px) { .sc-one .sc-body { grid-template-columns: minmax(0, 1fr); } }
/* 1.5.67: six totals */
.sc-ks { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1100px) { .sc-ks { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .sc-ks { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- 1.5.68: Billing → Overview → Check and Month end ---------- */
.bt-n { display: inline-block; min-width: 18px; padding: 0 6px; margin-left: 6px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; text-align: center; line-height: 18px; }
.nav-sub a .chk-n { margin-left: auto; }
.ck { display: flex; flex-direction: column; gap: 14px; }
.ck-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; } .ck-sp { flex: 1; }
.ck-grp { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.ck-grp a { padding: 7px 14px; border-radius: 999px; background: var(--card); font-size: 13.5px; color: var(--text); text-decoration: none; }
.ck-grp a.on { background: var(--btn-bg); color: var(--btn-text); font-weight: 600; } .ck-grp a b { margin-left: 4px; color: var(--accent); } .ck-grp a.on b { color: inherit; opacity: 0.85; }
.ck-bar select { width: auto; }
.ck-pop { width: min(380px, calc(100vw - 32px)); display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; } .ck-pop.hidden { display: none; } .ck-pop .field { margin: 0; }
.ck-card { padding: 0; margin: 0; overflow: hidden; }
.ck-h { display: flex; align-items: baseline; gap: 10px; padding: 14px 20px 10px; } .ck-h h3 { margin: 0; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.ck-row { border-top: 1px solid var(--rule-soft); }
.ck-row > summary { list-style: none; display: grid; grid-template-columns: 10px minmax(0, 1fr) 60px 110px 16px; gap: 14px; align-items: center; padding: 13px 20px; cursor: pointer; }
.ck-row > summary::-webkit-details-marker { display: none; }
.ck-row > summary:hover { background: var(--hover); }
.ck-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.ck-n { display: flex; flex-direction: column; gap: 1px; min-width: 0; } .ck-n b { font-weight: 600; font-size: 14px; } .ck-n span { color: var(--text-3); font-size: 12.5px; }
.ck-c, .ck-a { text-align: right; font-weight: 600; } .ck-c { color: var(--text-2); }
.ck-chev { color: var(--text-3); font-style: normal; transition: transform 0.15s; } .ck-row[open] .ck-chev { transform: rotate(90deg); }
.ck-items { background: color-mix(in srgb, var(--surface) 40%, var(--card)); padding: 4px 20px 14px 44px; border-top: 1px solid var(--rule-soft); display: flex; flex-direction: column; gap: 10px; }
.ck-item { background: var(--card); border-radius: 12px; padding: 10px 14px; box-shadow: inset 0 0 0 1px var(--rule-soft); } .ck-item.ans { opacity: 0.7; }
.ck-it { font-size: 13.5px; font-weight: 600; } .ck-ok { color: var(--chart); font-weight: 500; font-size: 12px; margin-left: 6px; }
.ck-rows { margin-top: 6px; display: flex; flex-direction: column; gap: 2px; }
.ck-r { display: grid; grid-template-columns: minmax(110px, 140px) 70px minmax(0, 1fr) 100px auto; gap: 10px; align-items: center; font-size: 13px; padding: 3px 0; } .ck-r b { color: color-mix(in srgb, #2E4A66 80%, var(--text)); font-weight: 600; } .ck-r .num { text-align: right; font-weight: 600; }
.ck-del { color: var(--accent); }
.ck-acts { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 8px; }
.ck-clear { margin: 0; padding: 12px 20px; border-top: 1px solid var(--rule-soft); color: var(--chart); font-size: 13.5px; }
@media (max-width: 700px) { .ck-row > summary { grid-template-columns: 10px minmax(0, 1fr) 40px 16px; } .ck-a { display: none; } .ck-items { padding-left: 14px; padding-right: 14px; } .ck-r { grid-template-columns: 1fr auto; } .ck-r span { display: none; } .ck-r .num { display: block; } }
.mend { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; align-items: start; }
.mend .panel { margin: 0; }
.me-card { padding: 0; overflow: hidden; }
.me-h { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--rule-soft); flex-wrap: wrap; } .me-h h2 { margin: 0; font-size: 18px; } .me-sp { flex: 1; }
.me-nav { display: inline-flex; align-items: center; gap: 4px; padding: 4px; border-radius: 10px; background: var(--surface); font-size: 13.5px; } .me-nav a, .me-nav .me-off { padding: 4px 10px; text-decoration: none; color: var(--text); } .me-nav .me-off { color: var(--text-3); } .me-nav b { padding: 4px 12px; background: var(--card); border-radius: 8px; }
.me-step { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 16px 20px; border-bottom: 1px solid var(--rule-soft); }
.me-n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; background: var(--accent); color: #fff; } .me-n.ok { background: var(--chart); }
.me-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; } .me-t b { font-size: 14.5px; } .me-t > span { color: var(--text-2); font-size: 12.5px; } .me-list { margin-top: 4px; font-size: 12.5px; color: var(--text-2); }
.me-f { display: flex; align-items: center; gap: 10px; padding: 14px 20px; }
.me-side { padding: 16px 18px; } .me-side h5 { margin: 0 0 8px; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); font-weight: 700; }
.me-l { display: flex; justify-content: space-between; gap: 8px; padding: 7px 0; font-size: 13.5px; color: var(--text); text-decoration: none; } .me-l span { color: var(--text-2); } .me-l b.ok { color: var(--chart); font-weight: 600; } .me-l b.op { color: var(--accent); font-weight: 600; }
.me-m { border-radius: 8px; padding-left: 6px; padding-right: 6px; } .me-m.on { background: var(--surface); }
@media (max-width: 900px) { .mend { grid-template-columns: minmax(0, 1fr); } .me-step { grid-template-columns: 28px minmax(0, 1fr); } .me-step > :last-child { grid-column: 2; justify-self: start; } }

/* ---------- 1.5.69: how completed work is billed, task groups ---------- */
dialog.hw-dlg { width: min(640px, calc(100vw - 24px)); }
dialog.hw-dlg .d-foot { align-items: center; } .hw-foot { white-space: nowrap; }
.hw-what { margin: 0 0 12px; color: var(--text-2); font-size: 13.5px; }
.hw-list { display: flex; flex-direction: column; gap: 8px; }
.hw-opt { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 13px 14px; border-radius: 12px; background: var(--surface); cursor: pointer; position: relative; }
.hw-opt > input { position: absolute; opacity: 0; pointer-events: none; }
.hw-opt.on { background: var(--card); box-shadow: inset 0 0 0 2px var(--btn-bg); }
.hw-rd { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--text-3); margin-top: 2px; box-sizing: border-box; } .hw-opt.on .hw-rd { border: 6px solid var(--btn-bg); }
.hw-opt > input:focus-visible ~ .hw-rd { outline: 2px solid var(--ring); outline-offset: 2px; }
.hw-tx { display: flex; flex-direction: column; gap: 2px; min-width: 0; } .hw-tx > b { font-size: 14.5px; } .hw-tx > span { color: var(--text-2); font-size: 12.5px; }
.hw-amt { font-size: 15px; }
.hw-x { display: none; } .hw-opt.on .hw-x { display: block; }
.hw-sub { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; padding: 12px 14px; border-radius: 10px; background: var(--card); box-shadow: inset 0 0 0 1px var(--rule-soft); font-size: 13px; color: var(--text); }
.hw-gl { display: flex; flex-direction: column; gap: 6px; }
.hw-g { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 9px; background: var(--surface); cursor: pointer; } .hw-g small { margin-left: auto; color: var(--text-3); font-size: 12px; }
.hw-note { color: var(--text-2); font-size: 12.5px; }
.hw-cover { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, #C9972E 16%, var(--card)); cursor: pointer; }
.hw-sub input[type=text] { width: 100%; }
dialog.gw-dlg { width: min(1100px, calc(100vw - 24px)); }
.gw-tl { display: grid; grid-template-columns: 14px minmax(0, 1fr) 70px 60px 110px 24px; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--rule-soft); font-size: 13.5px; }
.gw-th { border-top: 0; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); font-weight: 700; padding: 0 0 4px; }
.gw-tl small { display: block; color: var(--text-3); font-size: 12px; } .gw-tl b { font-weight: 600; } .gw-tl input { text-align: right; width: 100%; }
.gw-tt { border-top: 2px solid var(--rule-soft); }
.gw-dot { width: 10px; height: 10px; border-radius: 50%; } .gw-dot.d { background: var(--chart); } .gw-dot.o { background: #C9972E; }
.gw-add { margin-top: 10px; } .gw-add select { width: auto; max-width: 100%; }
.gw-hint { display: block; color: var(--text-3); font-size: 12px; margin-top: 4px; }
.gw-bar { height: 8px; border-radius: 999px; background: var(--surface); overflow: hidden; margin: 6px 0 4px; } .gw-bar i { display: block; height: 100%; background: var(--chart); }
.tk-bg { margin: 8px 0 0; font-size: 13px; color: var(--text-2); }
.fv-tq { margin: 0; padding: 0 4px; font-size: 12.5px; color: var(--text-3); }
.sp-tl { color: var(--text-3); font-size: 12.5px; }
@media (max-width: 700px) { .gw-tl { grid-template-columns: 12px minmax(0, 1fr) 90px 22px; } .gw-tl > :nth-child(3), .gw-tl > :nth-child(4) { display: none; } }

/* 1.5.70: statement sections */
.st-tbl tr.st-gh td { font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #5A6560; padding-top: 12px; border-bottom: 0; }
.st-tbl tr.st-sub td { border-bottom: 2px solid #DDE1DA; }

/* ---------- 1.5.70: one bill paid in parts, warnings ---------- */
.bx-pp { display: inline-flex; gap: 3px; margin-right: 6px; vertical-align: middle; } .bx-pp i { width: 14px; height: 5px; border-radius: 999px; background: var(--rule); }
.bx-pp i.ok { background: var(--chart); } .bx-pp i.due { background: #C9972E; } .bx-pp i.late { background: var(--accent); }
dialog.pp-dlg, dialog.pv2-dlg { width: min(1100px, calc(100vw - 24px)); }
.pp-top { margin-bottom: 4px; } .gq { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 12px; }
.pp-pre { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.pp-chip { border: 0; padding: 6px 12px; border-radius: 999px; background: var(--surface); font: inherit; font-size: 12.5px; color: var(--text); cursor: pointer; } .pp-chip:hover { background: var(--hover); }
.pp-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, 1.1fr) 64px 100px 130px 22px; gap: 8px; align-items: center; padding: 6px 0; font-size: 13px; border-top: 1px solid var(--rule-soft); }
.pp-row.pp-h { border-top: 0; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); font-weight: 700; }
.pp-row input, .pp-row select { width: 100%; min-width: 0; } .pp-row .num { text-align: right; }
.pp-n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11.5px; font-weight: 700; background: var(--surface); color: var(--text-2); }
.pp-n.ok { background: var(--chart); color: #fff; } .pp-n.due { background: #C9972E; color: #fff; }
.pp-ro { color: var(--text-2); font-size: 12.5px; } .pp-ok { color: var(--chart); }
.pp-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--rule-soft); font-size: 13.5px; }
.pp-x { display: grid; grid-template-columns: minmax(0, 1fr) 120px 22px; gap: 8px; align-items: center; margin-bottom: 6px; } .pp-x .num { text-align: right; }
.pv-row { grid-template-columns: 22px minmax(0, 1.1fr) minmax(0, 1.2fr) 56px 100px 150px; padding: 9px 0; }
.pv-orow { grid-template-columns: 22px minmax(0, 1.4fr) minmax(0, 1.1fr) 100px 150px; padding: 9px 0; } .pv-orow.exp b, .pv-orow.exp .num { font-style: italic; font-weight: 500; }
.pv-row small, .pv-orow small { display: block; color: var(--text-3); font-size: 12px; }
.pv-open { border: 0; cursor: pointer; font: inherit; font-size: 12px; }
.sub2 { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0 0; margin-top: 4px; border-top: 1px dashed var(--rule-soft); font-size: 13px; color: var(--text-2); } .sub2 b { color: var(--text); }
.pv-bar { display: flex; } .pv-bar i { height: 100%; background: var(--rule); } .pv-bar i.ok { background: var(--chart); } .pv-bar i.due, .pv-bar i.late { background: #C9972E; }
.pv-tot { background: var(--btn-bg); color: var(--btn-text); border-radius: 14px; padding: 12px 14px; font-size: 12.5px; } .pv-tot b { display: flex; justify-content: space-between; font-size: 17px; margin-top: 4px; }
.sp-plan { margin: 8px 0 0; font-size: 12.5px; color: var(--text-2); }
dialog.ak-dlg { width: min(980px, calc(100vw - 24px)); } dialog.ak-dlg .d-foot { align-items: center; }
.ak { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; } .ak-h { margin: 0 0 10px; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); }
.ak textarea { width: 100%; min-height: 300px; font-size: 13px; line-height: 1.5; }
.pp-line { margin-top: 6px; }
.warn-set { border: 0; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 4px; } .warn-set legend { font-weight: 600; font-size: 13.5px; margin-bottom: 6px; }
@media (max-width: 800px) { .ak { grid-template-columns: 1fr; } .pp-row { grid-template-columns: 22px minmax(0, 1fr) 90px 22px; } .pp-row > :nth-child(3), .pp-row > :nth-child(4), .pp-row > :nth-child(5), .pp-row > :nth-child(7) { display: none; } .pv-row, .pv-orow { grid-template-columns: 22px minmax(0, 1fr) 90px; } .pv-row > :nth-child(3), .pv-row > :nth-child(4), .pv-orow > :nth-child(3) { display: none; } }
dialog.pp-dlg .d-body { padding: 14px 24px; }

/* ---- 1.5.71: filterable drop-down, phone box, the new client and task windows ---- */
.cb-wrap { position: relative; display: block; min-width: 0; }
.cb-wrap .cb-native { position: absolute; inset: 0; opacity: 0; pointer-events: none; z-index: 0; }
.cb-wrap .cb-in { position: relative; z-index: 1; padding-right: 32px; cursor: text; text-overflow: ellipsis; }
.cb-caret { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); z-index: 2; color: var(--text-3); font-size: 11px; cursor: pointer; }
.cb-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 60; background: var(--card); border-radius: 12px; box-shadow: 0 18px 44px rgba(0, 0, 0, 0.18), 0 0 0 1px var(--rule-soft); max-height: 300px; overflow-y: auto; padding: 4px 0; }
.cb-list.wide { min-width: 360px; }
.cb-gh { font-size: 10.5px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--text-3); font-weight: 700; padding: 9px 14px 3px; }
.cb-it { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 7px 14px; cursor: pointer; font-size: 13.5px; color: var(--text); }
.cb-it small { color: var(--text-3); font-size: 12px; white-space: nowrap; }
.cb-it.on { background: var(--surface); } .cb-it.cur span { font-weight: 600; }
.cb-it.first { font-weight: 700; border-bottom: 1px solid var(--rule-soft); }
.cb-it mark { background: color-mix(in srgb, var(--accent) 16%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.cb-none { padding: 10px 14px; color: var(--text-3); font-size: 13px; }
.ph-box { display: flex; align-items: stretch; position: relative; min-width: 0; }
.ph-box .ph-cc { position: absolute; left: 0; top: 0; bottom: 0; width: 76px; opacity: 0; z-index: 2; cursor: pointer; }
.ph-dial { flex: none; width: 76px; display: flex; align-items: center; justify-content: center; gap: 4px; border: 1px solid var(--border); border-right: 0; border-radius: var(--radius) 0 0 var(--radius); background: var(--surface); font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.ph-dial::after { content: '▾'; font-size: 10px; color: var(--text-3); }
.ph-box input[type=tel] { border-radius: 0 var(--radius) var(--radius) 0; min-width: 0; }
.ph-box .ph-cc:focus-visible + .ph-dial { outline: 2px solid var(--ring); }
.ph-note { color: var(--accent); font-size: 12px; font-weight: 400; }
dialog.nw-dlg { width: min(1080px, calc(100vw - 24px)); }
dialog.nw-dlg .d-body { padding: 0; }
.nw-types { display: flex; gap: 8px; padding: 14px 24px; border-bottom: 1px solid var(--rule-soft); }
.nw-type { flex: 1; display: flex; align-items: center; gap: 10px; border-radius: 12px; background: var(--surface); padding: 9px 14px; cursor: pointer; position: relative; min-width: 0; }
.nw-type input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.nw-type b { display: block; font-size: 14px; } .nw-type small { display: block; color: var(--text-3); font-size: 12px; }
.nw-type .nw-ic { width: 30px; height: 30px; border-radius: 9px; background: var(--card); display: grid; place-items: center; flex: none; font-size: 15px; }
.nw-type.on { background: var(--btn-bg); color: var(--btn-text); } .nw-type.on small { color: color-mix(in srgb, var(--btn-text) 75%, transparent); }
.nw-type.on .nw-ic { background: color-mix(in srgb, var(--btn-text) 14%, transparent); color: inherit; }
.nw-type input:focus-visible ~ .nw-ic { outline: 2px solid var(--ring); }
.nw .fe2-sec h5 { display: flex; align-items: center; gap: 8px; }
.nw-n { width: 20px; height: 20px; border-radius: 50%; background: var(--surface); font-style: normal; font-size: 11px; display: grid; place-items: center; color: var(--text-2); letter-spacing: 0; }
.nw-g { display: grid; gap: 10px 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); } .nw-g2 { grid-template-columns: 1.6fr 1fr; } .nw-g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .nw-g + .nw-g { margin-top: 10px; }
.nw .field { margin: 0; } .nw .full { grid-column: 1 / -1; }
.nw-ok { font-size: 11.5px; font-weight: 700; color: color-mix(in srgb, var(--ok, #4F6B47) 90%, var(--text)); margin-left: 4px; }
.nw-code { font-size: 30px; font-weight: 800; letter-spacing: 0.04em; margin: 2px 0 4px; font-variant-numeric: tabular-nums; }
.fe2-card input.nw-code-in { font-size: 28px; width: 100%; font-weight: 800; letter-spacing: 0.04em; height: auto; padding: 2px 8px; border-color: transparent; background: transparent; }
.fe2-card input.nw-code-in[readonly] { cursor: default; padding: 0; } .fe2-card input.nw-code-in[readonly]:hover, .fe2-card input.nw-code-in[readonly]:focus { border-color: transparent; box-shadow: none; }
.fe2-card input.nw-code-in::placeholder { color: var(--text); opacity: 1; }
.nw-was { color: var(--text-3); text-decoration: line-through; font-weight: 700; font-size: 13px; }
.nw-side-p { margin: 4px 0 0; font-size: 12.5px; color: var(--text-3); }
.nw-ck { display: flex; gap: 9px; align-items: flex-start; padding: 6px 0; font-size: 13px; border-top: 1px solid var(--rule-soft); } .nw-ck:first-of-type { border-top: 0; }
.nw-ck i { font-style: normal; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; flex: none; background: color-mix(in srgb, #6E7F63 18%, transparent); color: color-mix(in srgb, #3F5A37 85%, var(--text)); }
.nw-ck i.w { background: color-mix(in srgb, #C9972E 22%, transparent); color: color-mix(in srgb, #6B4A10 85%, var(--text)); } .nw-ck i.o { background: var(--surface); color: var(--text-3); }
.nw-ck small { display: block; color: var(--text-3); font-size: 12px; }
.nw-dup { margin: 10px 0 0; background: color-mix(in srgb, #2E4A66 10%, var(--card)); color: var(--text); border-radius: 10px; padding: 9px 12px; font-size: 13px; }
.nw-dup button { margin-left: 6px; }
.nw-hide { display: none !important; }
.nw-sum { flex: 1; font-size: 13px; color: var(--text-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .nw-sum b { color: var(--text); }
dialog.nw-dlg .d-foot { justify-content: flex-start; align-items: center; gap: 10px; }
.nw-tabs { display: flex; gap: 22px; padding: 0 24px; border-bottom: 1px solid var(--rule-soft); }
.nw-tabs button { background: none; border: 0; padding: 10px 0; font-size: 14px; color: var(--text-3); cursor: pointer; }
.nw-tabs button.on { color: var(--text); font-weight: 600; box-shadow: inset 0 -2px 0 var(--text); }
.nw-hw { display: flex; flex-direction: column; gap: 6px; }
.nw-hw label { border: 1px solid var(--rule); border-radius: 11px; padding: 8px 11px; font-size: 13.5px; display: flex; gap: 10px; align-items: flex-start; cursor: pointer; background: var(--card); }
.nw-hw label.on { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
.nw-hw label.off { opacity: 0.55; cursor: not-allowed; }
.nw-hw input { margin-top: 3px; } .nw-hw b { display: block; font-weight: 600; } .nw-hw small { display: block; color: var(--text-3); font-size: 12px; }
.nw-hw select { margin-top: 6px; height: 34px; font-size: 13px; }
.nw-chips { display: flex; gap: 5px; flex-wrap: wrap; }
.nw-chips label { position: relative; }
.nw-chips input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.nw-chips span { display: inline-block; padding: 7px 11px; border-radius: 9px; background: var(--surface); font-size: 13px; cursor: pointer; white-space: nowrap; }
.nw-chips input:checked + span { background: var(--btn-bg); color: var(--btn-text); font-weight: 600; }
.nw-chips input:focus-visible + span { outline: 2px solid var(--ring); }
.nw-prv { background: var(--surface); border-radius: 12px; padding: 6px 14px; margin-top: 10px; font-size: 13px; }
.nw-prv div { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--rule-soft); } .nw-prv div:last-child { border-bottom: 0; } .nw-prv .m { color: var(--text-3); }
.nw-warn { margin-top: 10px; background: color-mix(in srgb, #C9972E 14%, var(--card)); border-radius: 10px; padding: 8px 12px; font-size: 13px; }
.nw-fold > summary { cursor: pointer; font-weight: 600; font-size: 13.5px; list-style: none; } .nw-fold > summary::before { content: '▸ '; color: var(--text-3); } .nw-fold[open] > summary::before { content: '▾ '; }
.nw-fold > summary small { color: var(--text-3); font-weight: 400; } .nw-fold[open] > .nw-g { margin-top: 10px; }
.nw-g4.ab { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 900px) {
  .nw-types { padding: 10px 14px; gap: 6px; } .nw-type small, .nw-type .nw-ic { display: none; } .nw-type { justify-content: center; text-align: center; padding: 10px 8px; } .nw-type b { font-size: 13px; }
  .cb-it { flex-wrap: wrap; } .cb-it small { white-space: normal; }
  .nw-g, .nw-g2, .nw-g4 { grid-template-columns: 1fr; }
  .nw-sum { display: none; }
}
.tw-cc { display: flex; gap: 12px; align-items: center; background: var(--surface); border-radius: 12px; padding: 8px 14px; min-height: var(--ctl-h); margin-top: 22px; }
.tw-cc b { display: block; font-size: 14px; } .tw-cc small { display: block; color: var(--text-3); font-size: 12px; }
.tw-av { width: 32px; height: 32px; border-radius: 50%; background: var(--card); display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--text-2); flex: none; }
.tw-ccard > .nw-side-p { margin: 30px 0 0; }
.tw-hints { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; } .tw-hints:empty { display: none; }
.tw-hints span { font-size: 12px; padding: 2px 9px; border-radius: 99px; background: color-mix(in srgb, #C9972E 20%, var(--card)); color: var(--text); font-weight: 600; }
.tw-hints span.i { background: color-mix(in srgb, #2E4A66 12%, var(--card)); }
.nw-dim { opacity: 0.5; }
.tw-st td { vertical-align: middle; } .tw-st input[type=date] { height: 34px; font-size: 13px; }
dialog.tw-dlg .d-head h2 .tw-no, dialog.cw-dlg .d-head h2 .tw-no { font-size: 12.5px; vertical-align: 3px; margin-right: 4px; }
@media (max-width: 900px) { .tw-cc { margin-top: 0; } .tw-ccard > .nw-side-p { margin: 0; } }

/* ---- 1.5.72: the proforma page (always paper colours, like a printout), the group page, the proforma list ---- */
.pf-paper { background: #E9EBE7; border-radius: 12px; padding: 16px; overflow-x: auto; }
.pf-page { background: #fff; color: #1C2826; width: 100%; max-width: 720px; margin: 0 auto; border-radius: 4px; box-shadow: 0 2px 14px rgba(0, 0, 0, 0.1); font-size: 12px; overflow: hidden; font-variant-numeric: tabular-nums; }
.pf-band { background: #1C2826; color: #F5F2EB; display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; padding: 24px 32px 18px; }
.pf-band > div:first-child { display: flex; flex-direction: column; gap: 2px; } .pf-firm { font-size: 16px; letter-spacing: 0.05em; } .pf-band span { color: #E8E4DA; font-size: 11px; } .pf-band .pf-addr { color: #D3D8D2; font-size: 10px; }
.pf-ttl { text-align: right; display: flex; flex-direction: column; gap: 4px; } .pf-ttl b { font-weight: 300; font-size: 14px; letter-spacing: 0.3em; } .pf-ttl span { color: #D08A64 !important; font-size: 9.5px !important; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.pf-line { height: 3px; background: #A4532E; }
.pf-body { padding: 20px 32px 12px; }
.pf-k { display: block; font-size: 8.5px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 700; color: #34403C; margin-bottom: 4px; }
.pf-to { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 20px; align-items: start; }
.pf-to > div { display: flex; flex-direction: column; gap: 2px; } .pf-to span:not(.pf-k) { color: #34403C; font-size: 11px; } .pf-cn { font-size: 13.5px; }
.pf-meta { background: #F5F2EB; border-radius: 8px; padding: 10px 14px; display: grid; grid-template-columns: auto 1fr; gap: 5px 10px; margin: 0; font-size: 11px; } .pf-meta dt { color: #34403C; } .pf-meta dd { margin: 0; text-align: right; font-weight: 700; }
.pf-tbl { width: 100%; border-collapse: collapse; margin-top: 16px; }
.pf-tbl th { background: #F5F2EB; color: #1C2826; font-size: 8.5px; letter-spacing: 0.14em; text-transform: uppercase; text-align: left; padding: 8px 10px; font-weight: 700; }
.pf-tbl th.num, .pf-tbl td.num { text-align: right; }
.pf-tbl td { padding: 7px 10px; border-bottom: 1px solid #E6E3DA; background: none !important; color: #1C2826; font-size: 11.5px; vertical-align: middle; }
.pf-tbl td b { font-weight: 600; } .pf-n { width: 26px; color: #34403C; }
.pf-s { display: block; color: #34403C; font-size: 9.5px; margin-top: 1px; }
.pf-gh td { border: 0; padding: 12px 10px 4px; font-size: 8.5px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 700; color: #A4532E !important; }
.pf-sub td { font-weight: 700; border-bottom: 0; }
.pf-sum { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-top: 10px; }
.pf-words { margin: 0 0 8px; color: #34403C; font-size: 10px; } .pf-words b { color: #1C2826; }
.pf-tot { width: 290px; flex: none; } .pf-tot div { display: flex; justify-content: space-between; padding: 5px 12px; } .pf-tot .m { color: #34403C; } .pf-tot .g { background: #1C2826; color: #fff; font-weight: 800; font-size: 13.5px; }
.pf-sch { margin-top: 18px; }
.pf-foot2 { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 22px; margin-top: 18px; align-items: start; }
.pf-terms ol { margin: 0; padding-left: 16px; color: #34403C; font-size: 9.5px; line-height: 1.55; }
.pf-bank { border: 1px solid #E6E3DA; border-left: 3px solid #A4532E; border-radius: 6px; padding: 10px 14px; } .pf-bank > b { display: block; font-size: 12px; margin-bottom: 4px; }
.pf-bank dl { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 3px 8px; margin: 0; font-size: 10px; } .pf-bank dt { color: #34403C; } .pf-bank dd { margin: 0; font-weight: 600; }
.pf-end { text-align: center; color: #34403C; font-size: 9px; padding: 10px 0 16px; }
dialog.pf-dlg { width: min(1180px, calc(100vw - 24px)); }
.fe2-sw.off { opacity: 0.5; cursor: not-allowed; }
@media (max-width: 960px) { .pf-to, .pf-foot2 { grid-template-columns: 1fr; } .pf-band { flex-direction: column; align-items: flex-start; padding: 18px; } .pf-ttl { text-align: left; } .pf-body { padding: 14px 16px; } .pf-sum { flex-direction: column; align-items: stretch; } .pf-tot { width: auto; } }
dialog.gp-dlg { width: min(1120px, calc(100vw - 24px)); }
dialog.gp-dlg .d-head h2 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gp-st { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 99px; background: var(--surface); } .gp-st.ok { background: color-mix(in srgb, #6E7F63 20%, var(--card)); } .gp-st.due { background: color-mix(in srgb, #C9972E 22%, var(--card)); } .gp-st.off { opacity: 0.7; }
.gp-sub { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--text-3); }
.gp-tbl td { vertical-align: middle; } .gp-tbl .sub { display: block; color: var(--text-3); font-size: 12px; }
.gp-t { font-weight: 600; text-align: left; padding: 0; }
.gp-dot i { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--rule); }
.gp-dot.ok i { background: #6E7F63; border-color: #6E7F63; } .gp-dot.now i { background: var(--text); border-color: var(--text); box-shadow: inset 0 0 0 2px var(--card); }
.gp-acts select { height: 30px; width: 54px; padding: 0 6px; font-size: 13px; background-image: none; text-align: center; }
.gp-tot td { border-bottom: 0; }
.gp-add { margin: 10px 0 0; display: flex; gap: 18px; }
.gp-pill { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--surface); } .gp-pill.ok { background: color-mix(in srgb, #6E7F63 20%, var(--card)); } .gp-pill.late { background: color-mix(in srgb, #A4532E 18%, var(--card)); } .gp-pill.due { background: color-mix(in srgb, #C9972E 22%, var(--card)); }
.gp-move { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow-y: auto; }
.gp-mi { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--rule); border-radius: 10px; padding: 8px 12px; cursor: pointer; } .gp-mi small { display: block; color: var(--text-3); font-size: 12px; } .gp-mi input { margin-top: 3px; }
.pfl-h { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; } .pfl-h input[type=search] { max-width: 280px; } .pfl-h select { width: auto; }
.pfl-cust { display: flex; gap: 6px; } .pfl-cust input { width: 150px; }
.pfl-n { margin-left: auto; color: var(--text-3); font-size: 13px; }
.pfl-tbl .sub { display: block; color: var(--text-3); font-size: 12px; }
.pfl-tag { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: color-mix(in srgb, #6E7F63 20%, var(--card)); } .pfl-tag.old { background: var(--surface); color: var(--text-3); }
table.tk-tbl tr.tk-band.grp td { background: color-mix(in srgb, var(--surface) 80%, var(--card)); text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 400; color: var(--text); padding: 12px 22px; }
.tk-band.grp .gb-h { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; } .tk-band.grp .gb-h b { font-size: 14px; } .tk-band.grp .gb-m { color: var(--text-3); font-size: 12.5px; } .tk-band.grp .gb-sp { flex: 1; } .tk-band.grp .link-btn { font-size: 13px; }

/* 1.5.73: the one-time client box in the task window — four even fields; Source and Name as search boxes */
.once-box > .tw-once-g { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.once-box > .tw-once-g .ph-box { width: 100%; } .once-box > .tw-once-g .ph-box input[type=tel] { flex: 1 1 auto; width: 100%; }
@media (max-width: 600px) { .once-box > .tw-once-g { grid-template-columns: minmax(0, 1fr); } }
.cb-it.cb-add { color: var(--text-1); font-weight: 600; border-top: 1px solid var(--rule-soft); }
.cb-it.cb-add small { font-weight: 400; }

/* 1.5.74: how it is paid (chips), the Billing tab, the change preview */
.tw-pay { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.tw-pc { border: 0; padding: 7px 10px; border-radius: 9px; background: var(--surface); font: inherit; font-size: 12.5px; color: var(--text); cursor: pointer; white-space: nowrap; }
.tw-pc:hover { background: var(--hover); }
.tw-pc.on { background: var(--main-btn-bg); color: var(--main-btn-text); font-weight: 600; }
.tw-sched { margin-top: 10px; border-top: 1px solid var(--rule-soft); padding-top: 8px; }
.tw-sched .fe2-ln { font-size: 12.5px; }
.tw-sched-n { margin: 6px 0 0; font-size: 12.5px; color: var(--text-2); }
.pp-check { margin: 10px 0 0; border-radius: 10px; padding: 8px 12px; font-size: 12.5px; font-weight: 600; }
.pp-check.ok { background: color-mix(in srgb, var(--ok, #45603F) 14%, var(--card)); color: var(--text); }
.pp-check.bad { background: color-mix(in srgb, var(--accent) 14%, var(--card)); color: var(--text); }
.pp-xh { margin: 16px 0 6px; font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-2); }
.tw-kv { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.tw-kv > div { background: var(--surface); border-radius: 12px; padding: 10px 12px; }
.tw-kv span { display: block; font-size: 11.5px; color: var(--text-3); font-weight: 600; }
.tw-kv b { font-size: 16px; font-variant-numeric: tabular-nums; }
@media (max-width: 600px) { .tw-kv { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
dialog.cpv-dlg { width: min(720px, calc(100vw - 24px)); }
.cpv-p { margin: 0 0 12px; color: var(--text-2); font-size: 13.5px; }
.cpv-tbl { width: 100%; margin-bottom: 8px; }
.cpv-tbl tr.hl td { background: color-mix(in srgb, var(--wait, #C9972E) 16%, var(--card)); }
.cpv-tbl tfoot td { font-weight: 700; }
.cpv-st { font-size: 12.5px; font-weight: 600; color: var(--text-2); } .cpv-st.ok { color: var(--text); } .cpv-st.due { color: var(--accent); }
dialog.cpv-dlg .d-foot { align-items: center; }
/* the parts editor inside the task window: room for names and %, no spinners */
.tw-pane .pp-row { grid-template-columns: 22px minmax(0, 1.5fr) minmax(0, 1.2fr) minmax(0, 1.1fr) 70px 92px 118px 22px; }
.pp-row input[type=number] { -moz-appearance: textfield; appearance: textfield; padding-left: 8px; padding-right: 8px; }
.pp-row input[type=number]::-webkit-inner-spin-button, .pp-row input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.pp-xh { display: block; margin-top: 20px !important; }
@media (max-width: 700px) { .tw-pane .pp-row { grid-template-columns: 22px minmax(0, 1fr) 70px 92px; } .tw-pane .pp-row > :nth-child(3), .tw-pane .pp-row > :nth-child(4), .tw-pane .pp-row > :nth-child(7), .tw-pane .pp-row > :nth-child(8) { display: none; } }

/* 1.5.75: a group's Billing tab */
.gp-tabs { margin: 0; }
.gb-tw { overflow-x: auto; }
.gp-btbl tfoot tr.gb-tot td { font-weight: 700; }
@media (max-width: 600px) { .gp-btbl .gb-note, .gp-btbl th:nth-child(2), .gp-btbl td:nth-child(2) { display: none; } }
.gp-ask { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 14px 0 0; padding: 10px 14px; border-radius: 12px; background: color-mix(in srgb, var(--wait, #C9972E) 16%, var(--card)); font-size: 13px; }
.gp-ask span { flex: 1 1 260px; }
.gp-btbl { width: 100%; }
.gp-btbl tfoot td { border-top: 1px solid var(--rule-soft); }
.gp-done { color: var(--text); font-weight: 600; font-size: 12.5px; }
.by-tw { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 6px; background: var(--surface); color: var(--text-2); vertical-align: 1px; white-space: nowrap; }
.gb-work { min-height: 40px; display: flex; align-items: center; padding: 8px 12px; border-radius: 10px; background: var(--surface); font-size: 13.5px; }
.gb-modes label small { display: block; }
dialog.gp-dlg .d-foot .nw-sum { font-size: 13px; color: var(--text-2); }

/* 1.5.76: packages as templates; the client's own copy */
.pk-tpl { margin: 6px 0 0; color: var(--text-2); }
.pk-line { display: flex; flex-direction: column; gap: 4px; }
.pk-wd { display: flex; justify-content: space-between; gap: 12px; padding: 9px 12px; border: 1px dashed var(--rule); border-radius: 10px; background: var(--surface); font-size: 13.5px; }
.pk-avg { display: flex; flex-direction: column; gap: 6px; }
.pk-avr { display: grid; grid-template-columns: minmax(0, 1fr) 84px 14px; gap: 8px; align-items: center; font-size: 13.5px; }
.pk-avr input { width: 100%; text-align: right; }
.sub-copy { display: flex; flex-direction: column; gap: 2px; }
.sc-row { display: grid; grid-template-columns: minmax(0, 1fr) 96px 22px; gap: 8px; align-items: center; padding: 4px 0; border-bottom: 1px solid var(--rule-soft); font-size: 13.5px; }
.sc-row label { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sc-h { display: flex; align-items: center; gap: 4px; color: var(--text-3); font-size: 12.5px; } .sc-h input { width: 64px; text-align: right; }
.sub-add { margin-top: 8px; } .sub-add select { max-width: 100%; }
.ag-row { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin: 2px 0 8px; font-size: 13px; }
.ag-wd { padding: 5px 10px; border: 1px dashed var(--rule); border-radius: 8px; background: var(--surface); }
.ag-wd i { font-style: normal; color: var(--text-3); font-weight: 400; }
.ag-k { color: var(--text-2); }
.cp-t td small.cp-ag { display: block; margin-top: 2px; color: var(--text-2); }
.pk-avr input, .sc-h input { -moz-appearance: textfield; appearance: textfield; }
.pk-avr input::-webkit-inner-spin-button, .sc-h input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* The sandbox (config.js SANDBOX): a red band on every page */
html.is-sandbox::before { content: 'SANDBOX · made-up test data · not the office database'; font-family: 'Noto Sans', system-ui, sans-serif; position: fixed; top: 0; left: 0; right: 0; z-index: 9999; height: 22px; display: flex; align-items: center; justify-content: center; background: #B3261E; color: #fff; font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; pointer-events: none; }
html.is-sandbox body { padding-top: 22px; }
html.is-sandbox dialog[open] { margin-top: 30px; }
