/* 7fivefive OpsPlus styles. Colours are variables at the top; then the base, shared pieces (buttons, forms, pages,
   tables, dialogs, pop-overs), then each area of the app in page order; screen-size rules come last. */

:root {
  --charcoal:      #33363a;
  --charcoal-deep: #25272a;
  --surface:       #2b2e32;
  --surface-2:     #31343a;
  --text:          #e8ebee;
  --accent:        #009999;   /* logo teal: fills, borders, large text */
  --accent-hover:  #00b0b0;
  --accent-text:   #00a8a8;   /* same teal nudged up for small text legibility */
  --second:        #a3a8ae;   /* secondary tone */
  --muted:         #8d9299;   /* labels and hints */
  --title:         #c9cdd2;   /* box titles */
  --line:          rgba(232, 235, 238, 0.10);
  --line-strong:   rgba(232, 235, 238, 0.22);
  --bad:           #d58a7c;
  --warn:          #e3a33b;
  --eng:           #9bb0ff;   /* Engineering needed: blue-violet */
  --yellow:        #e5d14b;   /* v42: a Draft order; a Raised or Publishing invoice (dashed: in limbo) */
  --xero:          #13b5ea;   /* Xero's blue: an invoice In Xero, the Publish button */
  --logo: url("images/logo.png");
}

/* ---------- base ---------- */

* { box-sizing: border-box; }

html, body { margin: 0; }
html { background: var(--charcoal-deep); }

body {
  min-height: 100dvh;
  background: radial-gradient(ellipse at 50% 0%, var(--charcoal) 0%, var(--charcoal-deep) 70%) fixed;
  color: var(--text);
  font: 400 15px/1.5 'Archivo', system-ui, sans-serif;
}

a { color: inherit; }
a[href^="mailto:"], a[href^="tel:"] { text-decoration: none; }
a[href^="mailto:"]:hover, a[href^="tel:"]:hover { text-decoration: underline; }
[hidden] { display: none !important; }
code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 0.78rem; color: var(--accent-text); white-space: nowrap; }

.muted { color: var(--muted); }
.hint { font-size: 0.75rem; color: var(--muted); }
.subline { display: block; color: var(--muted); font-size: 0.8rem; margin-top: 0.1rem; }
.plus { color: var(--accent-text); }
.minus { color: var(--bad); }
.warn-text { color: var(--warn); }
.quiet-link { text-decoration: none; }
.quiet-link:hover { text-decoration: underline; }
.code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 0.82rem; color: var(--accent-text); letter-spacing: 0.03em; white-space: nowrap; }
/* a record's code after its title: "Wood Lane install ORD-E8QC" */
.ref-code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 0.7rem; color: var(--muted); letter-spacing: 0.03em; white-space: nowrap; margin-left: 0.3rem; }
.multi { border-bottom: 1px dotted currentColor; cursor: help; }

/* ---------- gate (sign-in and holding screens) ---------- */

.gate {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
  text-align: center;
}
.gate-inner { max-width: 24rem; width: 100%; }
.panel { animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.3, 1) both; }

.wordmark { font-family: 'Outfit', system-ui, sans-serif; font-weight: 300; margin: 0; line-height: 1; }
.logo { display: block; background: var(--logo) no-repeat center / contain; aspect-ratio: 481 / 107; }
.wordmark .logo { width: 170px; margin: 0 auto 1.1rem; }
.wordmark .product { font-size: clamp(3rem, 13vw, 4.4rem); letter-spacing: -0.02em; }

.lattice { display: block; margin: 1.4rem auto 2.2rem; width: 190px; height: 22px; }
.lattice path {
  stroke: var(--accent); stroke-width: 1.4; fill: none;
  stroke-dasharray: 200; stroke-dashoffset: 200;
  animation: draw 1.1s 0.35s ease-out forwards;
}
.lattice path:nth-child(even) { stroke: var(--second); }

.prompt { font-size: 0.82rem; letter-spacing: 0.02em; color: var(--muted); margin: 0 0 1.1rem; }
.signin { display: flex; justify-content: center; min-height: 44px; }

.reunion { display: flex; align-items: center; justify-content: center; gap: 1.1rem; }
.greeting { font-family: 'Outfit', system-ui, sans-serif; font-weight: 300; font-size: clamp(1.9rem, 8vw, 2.6rem); margin: 0; line-height: 1.1; }
.greeting em { font-style: normal; color: var(--accent); font-weight: 600; }
.note { color: var(--muted); font-size: 0.85rem; margin: 1.6rem 0 0; }
.note:empty { display: none; }
.nothing { font-family: 'Outfit', system-ui, sans-serif; font-weight: 300; font-size: clamp(1.6rem, 7vw, 2.2rem); color: var(--muted); margin: 0; }

/* ---------- avatars (a Google picture, or initials) ---------- */

.avatar {
  width: 58px; height: 58px; border-radius: 50%;
  border: 2px solid var(--accent); padding: 3px;
  object-fit: cover; background: var(--charcoal-deep); flex: none;
}
.avatar.sm { width: 30px; height: 30px; padding: 2px; border-width: 1.5px; }
.avatar.md { width: 48px; height: 48px; }
.initials {
  display: inline-grid; place-items: center;
  font: 600 0.95rem 'Archivo', sans-serif; color: var(--accent);
}
.avatar.sm.initials { font-size: 0.7rem; }
.group-av { font-weight: 600; }

/* ---------- buttons ---------- */

.btn {
  font: 500 0.85rem 'Archivo', system-ui, sans-serif;
  letter-spacing: 0.03em;
  color: var(--text);
  background: transparent;
  border: 1.5px solid var(--accent);
  border-radius: 999px;
  padding: 0.5rem 1.15rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, opacity 0.15s;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { background: var(--accent); color: var(--charcoal-deep); }
.btn.primary { background: var(--accent); color: var(--charcoal-deep); }
.btn.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.quiet { border-color: var(--second); }
.btn.quiet:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.btn.small { padding: 0.3rem 0.8rem; font-size: 0.78rem; }
a.btn { text-decoration: none; display: inline-block; }
.btn.fixed { min-width: 9.5rem; text-align: center; }
.btn:disabled { opacity: 0.45; cursor: default; }
.gate .btn { margin-top: 1.6rem; padding: 0.7rem 1.6rem; }

/* a button that looks like a link (Edit, Remove, Mark all read) */
.link-btn { background: none; border: none; padding: 0 0 0 0.7rem; font: inherit; font-size: 0.78rem; color: var(--accent-text); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: var(--bad); }

/* a status pill you click to change it */
.pill-btn { background: none; border: none; padding: 0; margin: 0; font: inherit; cursor: pointer; border-radius: 999px; vertical-align: baseline; }
.pill-btn:hover .pill, .pill-btn:focus-visible .pill { box-shadow: 0 0 0 3px var(--line-strong); }
.pill-btn:focus-visible { outline: none; }

/* an on / off switch (Edit, Show hidden) */
.switch { display: inline-flex; align-items: center; gap: 0.5rem; background: none; border: none; color: var(--muted); font: inherit;
          font-size: 0.82rem; cursor: pointer; padding: 0.2rem 0; }
.switch .track { width: 2.1rem; height: 1.2rem; border-radius: 999px; background: var(--line-strong); position: relative; transition: background 0.15s; }
.switch .track::after { content: ''; position: absolute; top: 0.15rem; left: 0.15rem; width: 0.9rem; height: 0.9rem; border-radius: 50%;
                        background: var(--text); transition: transform 0.15s; }
.switch[aria-checked="true"] { color: var(--text); }
.switch[aria-checked="true"] .track { background: var(--accent); }
.switch[aria-checked="true"] .track::after { transform: translateX(0.9rem); }
.switch:disabled { opacity: 0.5; cursor: default; }

/* ↑ ↓ and the drag handle, for reordering lines */
.handle { cursor: grab; color: var(--muted); font-size: 1.05rem; padding: 0 0.35rem 0 0; user-select: none; vertical-align: -1px; }
.move-btn { background: none; border: 1px solid var(--line-strong); color: var(--muted); border-radius: 6px; width: 1.6rem; height: 1.6rem;
            cursor: pointer; font-size: 0.75rem; padding: 0; }
.move-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent-text); }
.move-btn:disabled { opacity: 0.3; cursor: default; }

/* ▶ that folds a row's details out */
.fold-btn { background: none; border: none; color: var(--muted); cursor: pointer; padding: 0 0.3rem; font-size: 0.8rem; line-height: 1;
            transition: transform 0.15s; display: inline-block; width: 1.4rem; }
.fold-btn:hover, .fold-btn:focus-visible { color: var(--accent-text); outline: none; }
.fold-btn[aria-expanded="true"] { transform: rotate(90deg); }

/* ---------- form controls ---------- */

input, select, textarea {
  font: inherit;
  color: var(--text);
  background: var(--charcoal-deep);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  width: 100%;
  min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
input::placeholder { color: var(--muted); opacity: 0.7; }
select:disabled, input:disabled { opacity: 0.5; }
textarea { resize: vertical; min-height: 4.5rem; line-height: 1.45; }

label.field { display: grid; align-content: start; gap: 0.3rem; font-size: 0.78rem; color: var(--muted); letter-spacing: 0.02em; }
label.field .req { color: var(--accent); }
.field-block { display: grid; align-content: start; gap: 0.3rem; font-size: 0.78rem; color: var(--muted); letter-spacing: 0.02em; }
.field-block .value { color: var(--text); font-size: 0.95rem; letter-spacing: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.85rem; }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 0.9rem 1rem 1rem; margin: 0; display: grid; gap: 0.85rem; }
legend { font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); padding: 0 0.4rem; }

/* a list of checkboxes (requested by, an object's artifacts) */
.checklist { display: grid; gap: 0.45rem; max-height: 14rem; overflow: auto; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0.65rem 0.75rem; background: var(--charcoal-deep); }
.checklist label { display: flex; gap: 0.55rem; align-items: center; font-size: 0.9rem; color: var(--text); letter-spacing: 0; cursor: pointer; }
.checklist input { width: auto; accent-color: var(--accent); }
.checklist label svg, .checklist label .favicon { width: 18px; height: 18px; flex: none; border-radius: 4px; }

.date-filter { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; color: var(--muted); }
.date-filter input { width: auto; padding: 0.4rem 0.5rem; }

/* ---------- app shell: top bar and tabs ---------- */

.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 1.5rem;
  padding: 0 1.25rem;
  min-height: 60px;
  background: rgba(37, 39, 42, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 0.6rem; font-family: 'Outfit', system-ui, sans-serif; font-size: 1.2rem; font-weight: 400; white-space: nowrap; text-decoration: none; }
.brand .logo { height: 19px; }

.tabs { display: flex; gap: 0.25rem; overflow-x: auto; scrollbar-width: none; }
.tabs a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 1.15rem 0.75rem 1rem;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.tabs a:hover { color: var(--text); }
.tabs a.active { color: var(--text); border-bottom-color: var(--accent); }
/* 1.1.0: staging and dev say so with the bar's colour (body[data-env], from js/config.js); production is unchanged.
   On blue or orange the grey tabs and the teal underline don't read, so they're white there. */
body[data-env="staging"] .topbar { background: rgba(31, 58, 147, 0.9); border-bottom-color: rgba(255, 255, 255, 0.14); }
body[data-env="dev"] .topbar { background: rgba(168, 68, 0, 0.9); border-bottom-color: rgba(255, 255, 255, 0.14); }
body[data-env] .topbar .tabs a { color: rgba(255, 255, 255, 0.85); }
body[data-env] .topbar .tabs a:hover, body[data-env] .topbar .tabs a.active { color: #fff; }
body[data-env] .topbar .tabs a.active { border-bottom-color: #fff; }

.spacer { flex: 1; }
/* v45: Ask Keith, a new Claude chat on OpsPlus: far right of the bar, dark inside, Claude's orange outline, mark and text */
.keith-btn { align-self: center; display: inline-flex; align-items: center; gap: 0.45rem; white-space: nowrap; text-decoration: none;
  background: #0f1011; color: #d97757; border: 1px solid #d97757; font-size: 0.85rem; font-weight: 500; border-radius: 999px;
  padding: 0.34rem 0.9rem 0.34rem 0.65rem; }
.keith-btn:hover { background: #1c1512; color: #e8896a; border-color: #e8896a; }
.keith-mark { width: 16px; height: 16px; flex: none; }
.keith-btn[hidden] { display: none; }
.keith-btn { font-family: inherit; cursor: pointer; }
/* v46: only the avatar on the bar, at the far right (Ask Keith just inboard of it); it grows on hover, its ring teal
   while its menu is open. The menu holds who you are, Admin, Sign out and the version. */
.me { display: inline-flex; align-items: center; background: none; border: 0; padding: 2px; margin: 0; cursor: pointer; border-radius: 50%; flex: none; }
.me #me-avatar { display: inline-flex; transition: transform 0.15s ease; }
.me:hover #me-avatar, .me[aria-expanded="true"] #me-avatar, .me:focus-visible #me-avatar { transform: scale(1.14); }
.me:hover .avatar, .me[aria-expanded="true"] .avatar { border-color: var(--accent); }
.me:focus-visible { outline: none; }
.topbar .keith-btn { margin-right: -0.6rem; }
.menu.me-menu { min-width: 0; width: 250px; padding: 0.4rem; }
.me-who { padding: 0.45rem 0.55rem 0.55rem; }
.me-who b { display: block; font-weight: 600; }
.me-who span { display: block; color: var(--muted); font-size: 0.78rem; margin-top: 0.1rem; overflow-wrap: anywhere; }
.me-who .me-role { display: inline-block; margin-top: 0.4rem; font-size: 0.64rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-text);
  border: 1.5px solid var(--accent); border-radius: 999px; padding: 0.08rem 0.5rem; }
.menu-sep { height: 1px; background: var(--line); margin: 0.3rem 0; }
.me-menu a.menu-item { text-decoration: none; color: var(--text); }
.me-ver { padding: 0.35rem 0.55rem 0.2rem; color: var(--muted); font-size: 0.72rem; letter-spacing: 0.06em; }

/* ---------- pages: heading, breadcrumbs, cards ---------- */

.content { max-width: 1100px; margin: 0 auto; padding: 2rem 1.25rem 4rem; }
.content.wide { max-width: 1580px; }   /* record pages, with comments in a rail on the right */
.page-split { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 1.25rem; align-items: start; }
/* the rail runs the page's full height so its comments card can stay in view (sticky) while the post-its above
   it scroll away with the page (v40) */
.rail { align-self: stretch; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-head h1 { font-family: 'Outfit', system-ui, sans-serif; font-weight: 300; font-size: 2rem; margin: 0; line-height: 1.1; }
.page-head .sub { color: var(--muted); font-size: 0.85rem; margin-top: 0.35rem; }
.head-actions { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.toolbar .sub { color: var(--muted); font-size: 0.85rem; }
.subtabs { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.subtabs a { text-decoration: none; font-size: 0.85rem; padding: 0.4rem 0.95rem; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--muted); }
.subtabs a.active { border-color: var(--accent); color: var(--text); }
.segmented { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; padding: 3px; }
.segmented a { text-decoration: none; padding: 0.32rem 0.9rem; border-radius: 999px; font-size: 0.85rem; color: var(--muted); }
.segmented a.active { background: var(--accent); color: var(--charcoal-deep); font-weight: 500; }

.crumb { display: inline-block; color: var(--muted); text-decoration: none; font-size: 0.82rem; margin-bottom: 0.9rem; }
.crumb:hover { color: var(--text); }
.crumbs { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.15rem 0.5rem; font-size: 0.82rem; color: var(--muted); margin-bottom: 0.9rem; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.crumbs .sep { opacity: 0.55; }
.crumbs [aria-current] { color: var(--second); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.25rem;
}
.card + .card { margin-top: 1.25rem; }
.card h2 { font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--title); font-weight: 500; margin: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.card-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.empty { text-align: center; padding: 3.5rem 1rem; color: var(--muted); }
.empty h2 { font-family: 'Outfit', system-ui, sans-serif; font-weight: 300; color: var(--text); font-size: 1.6rem; margin: 0 0 0.4rem; text-transform: none; letter-spacing: 0; }
.loading { color: var(--muted); padding: 2rem 0; }
.error-box { border: 1px solid var(--bad); color: var(--bad); border-radius: 10px; padding: 0.75rem 1rem; font-size: 0.88rem; }
#page-error { margin-bottom: 1rem; }   /* an action's error, above the page */
.more-row { display: flex; justify-content: center; margin-top: 1rem; }

.pill {
  display: inline-block;
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 0.18rem 0.55rem; border-radius: 999px;
  border: 1px solid currentColor;
  white-space: nowrap;
}
.pill.ok { color: var(--accent-text); }
.pill.warn { color: var(--text); }
.pill.off { color: var(--muted); }
.pill.done { color: var(--second); }
.pill.bad { color: var(--bad); }
.pill.legacy { color: var(--second); border-style: dashed; }   /* an imported Salesforce order (v40) */
.pill.eng { color: var(--eng); }                                /* Engineering needed (v40) */
.eng-dot { display: inline-grid; place-items: center; width: 1.25rem; height: 1.25rem; margin-left: 0.3rem; vertical-align: 1px;
  border: 1px solid var(--eng); border-radius: 50%; color: var(--eng); font-size: 0.62rem; font-weight: 700; line-height: 1; cursor: default; }

/* end dates: amber within 90 days, red within 30, magenta within 3; grey once ended */
.end-amber { color: var(--warn); font-weight: 500; }
.end-red { color: #f0625d; font-weight: 500; }
.end-magenta { color: #ea4fd2; font-weight: 600; }
.end-past { color: var(--muted); }

/* ---------- a record's details ---------- */

dl.details { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.25rem 2rem; margin: 0; container-type: inline-size; }
dl.details div { min-width: 0; }
dl.details dt { font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.3rem; }
dl.details dd { margin: 0; overflow-wrap: anywhere; }
dl.details > .fin-item { grid-column: -2 / -1; }               /* financials: the last column */
@container (min-width: 492px) { dl.details > .sched-item { grid-column: -3 / -2; } }   /* the schedule just before it */
dl.details > .inv-notes-item { grid-column: 1 / -2; }
dl.details > .inv-total-item { grid-column: -2 / -1; }
.stamp { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--line); font-size: 0.78rem; color: var(--muted); }

/* turnover, cost of goods sold, gross profit */
.fin-table { border-collapse: collapse; width: 100%; max-width: 19rem; font-variant-numeric: tabular-nums; }
.fin-table td { padding: 0.08rem 0; }
.fin-table td:first-child { color: var(--second); padding-right: 0.75rem; }
.fin-table td.num { text-align: right; white-space: nowrap; }

/* a credit balance that opens its movements */
.balance-btn { background: none; border: none; padding: 0; font: inherit; color: inherit; cursor: pointer; border-bottom: 1px dotted var(--second); }
.balance-btn:hover, .balance-btn:focus-visible { border-bottom-style: solid; outline: none; }
.balance-btn.minus, dd .minus { color: var(--bad); }

/* ---------- tables ---------- */

.table-wrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.list th {
  text-align: left; font-weight: 500; color: var(--muted);
  font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 0 0.75rem 0.6rem; border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
}
table.list td { padding: 0.75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list tr:last-child td { border-bottom: none; }
table.list tr.link { cursor: pointer; }
table.list tr.link:hover td { background: var(--surface-2); }
table.list .muted { color: var(--muted); }
table.list td.actions { text-align: right; white-space: nowrap; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.dim td { opacity: 0.55; }

/* click a heading to sort */
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover, th.sorted { color: var(--text); }
th .arrow { display: inline-block; width: 1em; margin-left: 0.3rem; font-size: 0.6rem; color: var(--accent-text); }

/* rows that fold out (a contract's orders, a customer's contracts) */
table.list td.fold-cell { width: 1.6rem; padding-right: 0; }
tr.fold-row > td { background: var(--charcoal-deep); padding: 0.5rem 0.75rem 0.85rem; }

/* ---------- search boxes and their tips ---------- */

.search { width: 20rem; max-width: 100%; }
.search-wrap { position: relative; }
.search-hint { display: none; position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: min(26rem, 88vw);
               background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 12px; padding: 0.85rem 1rem;
               box-shadow: 0 14px 34px rgba(0, 0, 0, 0.4); font-size: 0.8rem; color: var(--muted); text-align: left; }
.search-wrap:hover .search-hint, .search-wrap:focus-within .search-hint { display: block; }
.search-wrap.has-value .search-hint { display: none; }
.search-hint .hint-title { color: var(--text); font-weight: 500; margin-bottom: 0.45rem; }
.search-hint table { border-collapse: collapse; width: 100%; }
.search-hint td { padding: 0.2rem 0.75rem 0.2rem 0; vertical-align: top; }
.search-hint .hint-eg { margin-top: 0.55rem; padding-top: 0.55rem; border-top: 1px solid var(--line); }
.search-warn { color: var(--bad); margin-left: 0.6rem; }
.search-warn:empty { display: none; }

/* ---------- menus (status, add line, add object, task time) ---------- */

.menu { position: absolute; z-index: 30; min-width: 12.5rem; background: var(--surface-2); border: 1px solid var(--line-strong);
        border-radius: 12px; padding: 0.35rem; box-shadow: 0 14px 34px rgba(0, 0, 0, 0.4); }
.menu-item { display: flex; align-items: center; gap: 0.5rem; width: 100%; background: none; border: none; padding: 0.45rem 0.55rem;
             border-radius: 8px; cursor: pointer; color: inherit; font: inherit; text-align: left; }
.menu-item:hover:not(:disabled), .menu-item:focus-visible { background: var(--surface); outline: none; }
.menu-item:disabled { opacity: 0.4; cursor: default; }
.menu-item .tick { width: 1em; color: var(--accent-text); font-size: 0.85rem; }
.menu-note, .menu-err { font-size: 0.75rem; color: var(--muted); margin: 0.35rem 0.55rem 0.25rem; max-width: 14rem; }
.menu-err { color: var(--bad); }
.menu-err:empty { display: none; }

/* ---------- pop-over boxes (journal changes, an artifact, credit movements) ---------- */

.pop { position: absolute; z-index: 40; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 12px;
       padding: 0.75rem 0.9rem; box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45); font-size: 0.82rem; max-width: calc(100vw - 24px); }
.pop-title { font-weight: 600; color: var(--text); margin-bottom: 0.2rem; overflow-wrap: anywhere; }
.pop-artifact { width: 19rem; }
.pop-journal { max-width: min(34rem, calc(100vw - 24px)); }
.pop-ledger, .pop-custledger { width: min(46rem, calc(100vw - 24px)); max-height: 60vh; overflow: auto; padding-bottom: 0.4rem; }
.pop-ledger table.list, .pop-custledger table.list { font-size: 0.82rem; }
.pop .doc-note { margin-top: 0.45rem; }
.pop .doc-meta { margin-top: 0.5rem; }
.pop-actions { margin-top: 0.55rem; }
.pop-actions .link-btn:first-child { padding-left: 0; }

/* ---------- dialogs: forms (#modal), questions (#ask) and the side sheet (#sheet) ---------- */

dialog {
  width: min(720px, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem);
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
}
dialog::backdrop { background: rgba(15, 16, 18, 0.65); backdrop-filter: blur(2px); }
.modal-head { padding: 1.25rem 1.5rem 0; }
.modal-head h2 { font-family: 'Outfit', system-ui, sans-serif; font-weight: 300; font-size: 1.5rem; margin: 0; }
.modal-body { padding: 1.25rem 1.5rem; display: grid; gap: 1rem; }
.modal-foot { display: flex; justify-content: flex-end; gap: 0.6rem; padding: 1rem 1.5rem 1.25rem; border-top: 1px solid var(--line); }
#ask { width: min(600px, calc(100vw - 2rem)); }
#ask .modal-foot { flex-wrap: wrap; }

dialog#sheet { width: min(920px, calc(100vw - 2rem)); }
.sheet-head { display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; padding: 1.25rem 1.5rem 1rem; border-bottom: 1px solid var(--line); }
.sheet-head h2 { font-family: 'Outfit', system-ui, sans-serif; font-weight: 300; font-size: 1.5rem; margin: 0; }
.sheet-head .btn { margin-left: auto; }
.sheet-body { padding: 1rem 1.5rem 1.5rem; max-height: calc(100dvh - 9rem); overflow: auto; }
.sheet-foot { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; padding: 0.9rem 1.5rem 1.1rem; border-top: 1px solid var(--line); }
.sheet-foot .pick-sum { color: var(--second); font-size: 0.88rem; margin-right: auto; }
.sheet-foot .error-box { flex-basis: 100%; }

/* ---------- comments and @mentions ---------- */

.comment { display: flex; gap: 0.8rem; padding: 0.9rem 0; border-bottom: 1px solid var(--line); }
.comment.system { padding: 0.45rem 0; font-size: 0.78rem; }
.comment.flash { animation: flash 2.4s ease-out; border-radius: 8px; }   /* the one a link jumped to */
.comment-body { flex: 1; min-width: 0; }
.comment-meta { font-size: 0.78rem; color: var(--muted); }
.comment-meta strong { color: var(--text); font-weight: 600; }
.comment-text { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 0.3rem; }
.comment-edit { display: grid; gap: 0.5rem; margin-top: 0.4rem; }
.comment-form { display: grid; gap: 0.6rem; margin-top: 1.1rem; }

/* threads: a comment with its replies indented under it; a resolved thread dims */
.thread { border-bottom: 1px solid var(--line); padding-bottom: 0.2rem; }
.thread .comment { border-bottom: none; }
.thread:first-child > .comment:first-child { padding-top: 0; }   /* the first thread sits flush under the heading */
.thread.resolved > .comment:first-child, .thread.resolved .replies { opacity: 0.65; }
.replies { margin-left: 2.4rem; border-left: 2px solid var(--line); padding-left: 0.8rem; }
.comment.reply { padding: 0.5rem 0; }
.comment.system.reply { padding: 0.3rem 0; }
.comment.system .link-btn { font-size: 0.75rem; }
.reply-form { display: grid; gap: 0.45rem; margin: 0.3rem 0 0.8rem 3.2rem; }
.reply-form textarea { min-height: 3rem; }
/* assigning */
.assign-row { display: flex; align-items: center; gap: 0.6rem; font-size: 0.85rem; color: var(--second); }
.assign-row label { display: inline-flex; align-items: center; gap: 0.4rem; cursor: pointer; white-space: nowrap; }
.assign-row input { width: auto; accent-color: var(--accent); }
.assign-row select { width: auto; min-width: 10rem; padding: 0.3rem 0.5rem; }
.assignment { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.45rem; font-size: 0.8rem;
              color: var(--accent-text); font-weight: 500; }
.assignment.done { color: var(--muted); font-weight: 400; }
.open-count { font-size: 0.72rem; font-weight: 600; color: var(--accent-text); border: 1px solid currentColor; border-radius: 999px;
              padding: 0.05rem 0.5rem; white-space: nowrap; }

/* in the rail: the card stays in view as the page scrolls, up to the screen's height; its list scrolls by itself,
   clear of the top bar, with the form kept below it */
.rail .comments-card { display: flex; flex-direction: column; position: sticky; top: 76px; max-height: calc(100dvh - 96px); }
.rail .comments-card #comments { flex: 1 1 auto; overflow-y: auto; min-height: 6rem; padding-right: 0.3rem; }

/* post-its (v38): a company's comment as a canary-yellow note stuck on at a slight angle, above the comments */
.postits { display: grid; gap: 1.2rem; margin: 0.3rem 0.2rem 1.7rem; }
.postit-wrap { position: relative; width: 94%; transform: rotate(-1.6deg); }
.postit-wrap:nth-child(3n+2) { transform: rotate(1.3deg); margin-left: 5%; }
.postit-wrap:nth-child(3n+3) { transform: rotate(-0.7deg); margin-left: 2%; }
.postit-wrap::before, .postit-wrap::after { content: ''; position: absolute; bottom: 9px; width: 46%; height: 30%;
  box-shadow: 0 12px 12px rgba(0, 0, 0, 0.55); }
.postit-wrap::before { left: 5px; transform: rotate(-3deg); }
.postit-wrap::after { right: 5px; transform: rotate(3deg); }
.postit { position: relative; z-index: 1; background: linear-gradient(178deg, #fff59a 0%, #fdee72 60%, #f8e55e 100%); color: #33312a;
  padding: 1.35rem 1.15rem 0.85rem; font-size: 0.88rem; line-height: 1.45; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); overflow-wrap: anywhere; }
.postit::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 1.05rem;
  background: linear-gradient(rgba(140, 110, 0, 0.14), rgba(140, 110, 0, 0)); }
.postit .pi-text { cursor: pointer; white-space: pre-wrap; }
.postit .pi-text .mention { color: #6b4c00; font-weight: 600; }
.postit .pi-text a { color: #6b4c00; }
.postit .pi-foot { display: flex; justify-content: space-between; gap: 0.6rem; margin-top: 0.6rem; font-size: 0.72rem; color: #6d6650; }
/* the × dismisses it for you; its "until …" (Operations and up) changes the expiry or takes it down (v40) */
.postit .pi-dismiss { position: absolute; top: 0.15rem; right: 0.35rem; background: none; border: none; color: #8a8160;
  font-size: 1.15rem; line-height: 1; cursor: pointer; padding: 0.1rem 0.3rem; border-radius: 4px; }
.postit .pi-dismiss:hover, .postit .pi-dismiss:focus-visible { background: rgba(0, 0, 0, 0.07); color: #33312a; }
.postit .pi-until { background: none; border: none; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.postit .pi-until:hover, .postit .pi-until:focus-visible { text-decoration: underline; color: #33312a; outline: none; }
.postit-more { justify-self: end; margin: -0.3rem 0.3rem 0 0; background: #fdee72; color: #33312a; font-size: 0.72rem; font-weight: 600;
  padding: 0.3rem 0.65rem; transform: rotate(2deg); box-shadow: 0 4px 8px rgba(0, 0, 0, 0.45); border: none; cursor: pointer; }
.postit-tag { display: inline-block; font-size: 0.66rem; font-weight: 600; letter-spacing: 0.04em; color: #33312a; background: #fdee72;
  padding: 0.05rem 0.4rem; margin-right: 0.3rem; transform: rotate(-2deg); }
.expiry-picks { display: grid; gap: 0.45rem; }
.expiry-pick { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; color: var(--text); letter-spacing: 0; }
.expiry-pick input[type=radio] { width: auto; accent-color: var(--accent); }
.expiry-pick input[type=date] { width: auto; padding: 0.3rem 0.5rem; }
.rail .postits { padding: 0.35rem 0.4rem 0; }
.rail .comments-card .comment-form { flex: none; }

.mention { color: var(--accent-text); font-weight: 500; }
.mention.group { border-bottom: 1px dotted currentColor; cursor: help; }
.mention-menu { position: absolute; z-index: 60; min-width: 15rem; max-width: 22rem; background: var(--surface-2);
                border: 1px solid var(--line-strong); border-radius: 10px; padding: 0.3rem;
                box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45); }
.mention-item { display: flex; align-items: center; gap: 0.55rem; width: 100%; background: none; border: none; color: inherit;
                font: inherit; font-size: 0.88rem; padding: 0.4rem 0.5rem; border-radius: 7px; cursor: pointer; text-align: left; }
.mention-item.active, .mention-item:hover { background: var(--surface); }
.mention-item.inactive { opacity: 0.55; }
.mention-item small { color: var(--muted); margin-left: auto; font-size: 0.72rem; }

/* MHD- / LENS- ticket numbers, linked to Jira */
.ticket { color: var(--accent-text); text-decoration: none; cursor: pointer; white-space: nowrap; }
.ticket:hover { text-decoration: underline; }

/* ---------- artifacts (Drive files, Confluence, Jira, web pages) ---------- */

.art-grid { display: grid; grid-template-columns: repeat(auto-fill, 7.5rem); gap: 0.75rem; }
.art-tile { display: grid; justify-items: center; align-content: start; gap: 0.5rem; padding: 0.7rem 0.35rem 0.6rem; border-radius: 10px;
            text-decoration: none; text-align: center; color: var(--text); }
.art-tile:hover, .art-tile:focus-visible { background: var(--surface-2); outline: none; }
.art-icon { position: relative; width: 56px; height: 56px; }
.art-icon svg { width: 56px; height: 56px; display: block; }
.art-icon .avatar { position: absolute; right: -8px; bottom: -4px; width: 22px; height: 22px; padding: 0; border-width: 1.5px; font-size: 0.5rem; }
.art-icon .favicon { width: 44px; height: 44px; margin: 6px; }
.art-name { font-size: 0.8rem; line-height: 1.3; overflow-wrap: anywhere; overflow: hidden;
            display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.art-ref { color: var(--accent-text); text-decoration: none; font-weight: 500; }   /* an artifact named in text */
.art-ref:hover { text-decoration: underline; }
textarea.art-over { outline: 2px dashed var(--accent); outline-offset: -1px; }
/* a web page's own icon, on a light tile */
.favicon { display: grid; place-items: center; border-radius: 22%; background: #e8ebee; overflow: hidden; }
.favicon img { width: 62%; height: 62%; object-fit: contain; display: block; }
/* the artifact form and pop-over */
.doc-icon { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px;
            background: var(--surface-2); border: 1px solid var(--line); }
.doc-icon svg { width: 24px; height: 24px; display: block; }
.doc-icon .favicon { width: 24px; height: 24px; border-radius: 5px; }
.doc-note { margin-top: 0.2rem; overflow-wrap: anywhere; }
.doc-meta { margin-top: 0.3rem; font-size: 0.78rem; color: var(--muted); display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.doc-meta .avatar { width: 18px; height: 18px; padding: 0; border-width: 1px; font-size: 0.5rem; }
.doc-picked { display: flex; gap: 0.8rem; align-items: center; padding: 0.75rem; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--charcoal-deep); }
.doc-picked .doc-icon { background: var(--surface); }

/* ---------- orders: line items ---------- */

table.lines tr.sub-line td { padding-top: 0.35rem; }
table.lines tbody.line-group tr:not(:last-child) td { border-bottom: none; }
table.lines tbody.line-group:not(:last-of-type) tr:last-child td { border-bottom: 1px solid var(--line); }
table.lines .indent { padding-left: 2rem; position: relative; }     /* a line's discount, or a resale line's buy side */
table.lines .indent::before { content: '↳'; position: absolute; left: 0.9rem; color: var(--muted); }
table.lines tfoot td { border-bottom: none; padding: 0.35rem 0.75rem; }
table.lines tfoot tr:first-child td { border-top: 1px solid var(--line-strong); padding-top: 0.75rem; }
table.lines tfoot .label { text-align: right; color: var(--muted); font-size: 0.85rem; }
table.lines tfoot .grand td { font-weight: 600; font-size: 1rem; }
table.lines tfoot .grand .label { color: var(--text); }
table.lines tr.buy-line td { padding-top: 0.2rem; color: var(--muted); font-size: 0.8rem; }
.buy-label { color: var(--second); font-weight: 500; letter-spacing: 0.02em; }
/* v39: the sell side's pointer to its buy side, and the Buy side box's two totals */
.buy-tag { display: inline-block; margin-left: 0.3rem; padding: 0 0.45rem; border: 1px solid var(--line-strong); border-radius: 999px;
           font-size: 0.68rem; line-height: 1.35rem; color: var(--second); letter-spacing: 0.02em; vertical-align: 1px; white-space: nowrap; }
table.buy-lines tfoot tr.grand + tr.grand td { border-top: none; padding-top: 0.2rem; }
.held { font-size: 0.78rem; color: var(--muted); }                  /* "On INX-…": the line is on an invoice */
.held a { color: var(--accent-text); text-decoration: none; }
.line-calc { margin: 0; font-size: 0.88rem; color: var(--second); min-height: 1.3em; }   /* the sum under a line form */
.line-calc strong { color: var(--text); font-weight: 600; }
/* a contract's order fold-outs: the same table, smaller */
table.lines.compact { font-size: 0.84rem; }
table.lines.compact td, table.lines.compact th { padding: 0.45rem 0.6rem; }
table.lines.compact tfoot td { padding: 0.25rem 0.6rem; }
table.lines.compact td.indent { padding-left: 2rem; }

/* Edit on: drag a line (with its discounts) or use ↑ ↓ */
table.lines td.handle-cell, table.inv-lines td.handle-cell { width: 5.5rem; white-space: nowrap; padding-right: 0; }
tbody.line-group.reorderable { cursor: grab; }
tbody.line-group.dragging { opacity: 0.4; }
tbody.line-group.drop-before tr:first-child td { box-shadow: inset 0 2px 0 var(--accent); }
tbody.line-group.drop-after tr:last-child td { box-shadow: inset 0 -2px 0 var(--accent); }

/* ---------- the invoice schedule, and picking its lines for an invoice ---------- */

.inv-event { border-top: 1px solid var(--line); padding: 0.75rem 0 0.6rem; }
.inv-event:first-child { border-top: none; padding-top: 0; }
.inv-head { display: flex; align-items: baseline; gap: 0.9rem; margin-bottom: 0.35rem; }
.inv-head label { display: inline-flex; align-items: center; gap: 0.45rem; cursor: pointer; }
.inv-no { font-weight: 600; }
.inv-date { color: var(--second); font-size: 0.88rem; }
.inv-total { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }
table.inv-parts { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
table.inv-parts td { padding: 0.3rem 0 0.3rem 1.1rem; vertical-align: top; }
table.inv-parts td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; padding-left: 1rem; color: var(--second); }
table.inv-parts td.inv-status { width: 12rem; text-align: right; color: var(--muted); font-size: 0.78rem; white-space: nowrap; }
table.inv-parts td.inv-status a { color: var(--accent-text); text-decoration: none; font-family: ui-monospace, 'SF Mono', Menlo, monospace; }
table.inv-parts td.inv-status a:hover { text-decoration: underline; }
table.inv-parts tr.disc td.desc { padding-left: 2.3rem; position: relative; }
table.inv-parts tr.disc td.desc::before { content: '↳'; position: absolute; left: 1.3rem; color: var(--muted); }
table.inv-parts tr.off td { opacity: 0.55; }                       /* can't go on this invoice */
table.inv-parts td.pick { width: 1.6rem; padding-left: 0; }
table.inv-parts td.pick input, .inv-head input { width: auto; accent-color: var(--accent); margin: 0; }
.pick-order + .pick-order { margin-top: 1.4rem; padding-top: 1rem; border-top: 1px solid var(--line-strong); }
.pick-order-head { font-weight: 600; margin-bottom: 0.5rem; }
.pick-order-head .subline { font-weight: 400; }

/* ---------- invoices ---------- */

.inv-pill { display: inline-block; font-size: 0.62rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
            padding: 0.08rem 0.4rem; border-radius: 999px; border: 1px solid currentColor; color: var(--muted); margin-left: 0.45rem; vertical-align: 0.1em; }
.inv-pill.credits, .inv-pill.applied { color: var(--accent-text); }
.inv-pill.raised { color: var(--yellow); border-style: dashed; }   /* v42 */
.inv-notes { white-space: pre-wrap; overflow-wrap: anywhere; }

/* a draft's date, PO reference and notes: click to change */
.click-edit { display: block; width: calc(100% + 0.8rem); background: none; border: 1px solid transparent; border-radius: 6px;
              padding: 0.15rem 0.4rem; margin: -0.2rem -0.4rem; font: inherit; color: inherit; text-align: left; cursor: text; }
.click-edit:hover, .click-edit:focus-visible { border-color: var(--line-strong); background: var(--surface-2); outline: none; }
.click-edit .inv-notes { display: block; }
.click-editor { display: grid; gap: 0.45rem; }
.click-editor-actions { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }
.click-editor input[type=date] { max-width: 12rem; }
/* a contract's Notes box (v39): the notes as written, click to change */
.notes-card .click-edit.notes-edit { min-height: 2.2rem; }
.notes-card .pre { display: block; }
.nowrap { white-space: nowrap; }
/* an SF Import line's tag (v40): a Salesforce order line from the orders import, never invoiced */
.sf-tag { display: inline-block; font-size: 0.62rem; font-weight: 700; letter-spacing: 0.06em; color: var(--second);
  border: 1px dashed var(--second); border-radius: 4px; padding: 0 0.3rem; margin-right: 0.4rem; vertical-align: 1px; }

/* the lines: one box per order they come from, with the headings once above the boxes and fixed column widths
   so the figures line up down the page */
.inv-boxes { min-width: 38rem; display: grid; gap: 0.9rem; }
.inv-boxes table.list.inv-lines { table-layout: fixed; }
.inv-boxes col.c-handle { width: 5.5rem; } .inv-boxes col.c-qty { width: 4.5rem; } .inv-boxes col.c-months { width: 5.5rem; }
.inv-boxes col.c-price { width: 8.5rem; } .inv-boxes col.c-total { width: 8rem; } .inv-boxes col.c-actions { width: 9.5rem; }
table.list.inv-lines td { padding-top: 0.6rem; padding-bottom: 0.6rem; }
table.list.inv-lines tr.disc td.line-cell { padding-left: 2.2rem; position: relative; }
table.list.inv-lines tr.disc td.line-cell::before { content: '↳'; position: absolute; left: 1.1rem; color: var(--muted); }
.inv-heads { margin: 0 1px -0.5rem; }
.inv-heads th { border-bottom: none !important; padding-bottom: 0 !important; }
.inv-heads th.num { text-align: right; }
.inv-box { border: 1px solid var(--line-strong); border-radius: 12px; overflow: hidden; background: var(--charcoal-deep); }
.inv-box-head { display: flex; align-items: center; gap: 0.5rem; padding: 0.6rem 0.75rem; background: var(--surface-2);
                border-bottom: 1px solid var(--line-strong); }
.inv-box-head[draggable="true"] { cursor: grab; }
.inv-box-title { flex: 1; min-width: 0; font-weight: 500; }
.inv-box-label { font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-right: 0.55rem; }
.inv-box-contract { color: var(--muted); font-weight: 400; font-size: 0.82rem; margin-left: 0.6rem; }
.inv-box-move { font-size: 0.72rem; color: var(--muted); white-space: nowrap; }
.inv-box table.list td { padding-top: 0.55rem; padding-bottom: 0.55rem; }
.inv-box tr.inv-sub td { border-top: 1px solid var(--line-strong); color: var(--second); font-size: 0.85rem; }
.inv-box tr.inv-sub td.num { color: var(--text); font-weight: 500; }
.inv-grand { margin: -0.3rem 1px 0; }
.inv-grand tr.grand td { border-bottom: none; font-weight: 600; }
/* Edit on: dragging a line, or a whole order's box (the boxes fold to their header bars meanwhile) */
#inv-lines-card tr.inv-drop-before td { box-shadow: inset 0 2px 0 var(--accent); }
#inv-lines-card tr.inv-drop-after td { box-shadow: inset 0 -2px 0 var(--accent); }
#inv-lines-card .dragging, #inv-lines-card .dragging td { opacity: 0.45; }
#inv-lines-card .inv-box.inv-drop-before { box-shadow: 0 -3px 0 var(--accent); }
#inv-lines-card .inv-box.inv-drop-after { box-shadow: 0 3px 0 var(--accent); }
#inv-lines-card.dragging-order .inv-box table { display: none; }
#inv-lines-card.dragging-order .inv-box-head { border-bottom: none; }

/* ---------- companies and contracts ---------- */

/* a customer's contracts and orders */
table.list.work-table tr.work-row { cursor: pointer; }
table.list.work-table tr.work-row:hover td { background: var(--surface-2); }
table.list.work-table tr.work-row a { text-decoration: none; font-weight: 500; }
table.list.work-table tr.work-row a:hover { text-decoration: underline; }

/* the contract objects register: an object's artifacts */
.obj-arts { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.obj-art { display: inline-flex; align-items: center; gap: 0.3rem; max-width: 11rem; padding: 0.15rem 0.55rem 0.15rem 0.3rem;
           border: 1px solid var(--line-strong); border-radius: 999px; font-size: 0.75rem; text-decoration: none; }
.obj-art:hover { border-color: var(--accent); }
.obj-art span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.obj-art svg, .obj-art .favicon { width: 16px; height: 16px; flex: none; border-radius: 3px; }
.table-tools { display: flex; justify-content: flex-end; align-items: center; gap: 0.8rem; }
.table-tools:not(:empty) { margin-bottom: 0.6rem; }
table.list.objects-table tr.clickable { cursor: pointer; }
table.list.objects-table tr.clickable:hover td, table.list.objects-table tr.clickable:focus-visible td { background: var(--surface-2); }
table.list.objects-table tr.clickable:focus-visible { outline: none; }
/* split objects (v39): the singles sit in a bracket under their header */
table.list.objects-table tr.split-head td { border-bottom: none; }
table.list.objects-table tr.split-kid td { border-bottom: none; padding-top: 0.35rem; padding-bottom: 0.35rem; }
table.list.objects-table tr.split-kid td:first-child { position: relative; padding-left: 2.1rem; }
table.list.objects-table tr.split-kid td:first-child::before { content: ''; position: absolute; left: 0.95rem; top: 0; bottom: 0;
  border-left: 2px solid var(--line-strong); }
table.list.objects-table tr.split-kid td:first-child::after { content: ''; position: absolute; left: 0.95rem; top: 1.05rem; width: 0.65rem;
  border-top: 2px solid var(--line-strong); }
table.list.objects-table tr.split-kid.split-last td:first-child::before { bottom: auto; height: 1.05rem; }
table.list.objects-table tr.split-kid.split-last td { border-bottom: 1px solid var(--line); padding-bottom: 0.7rem; }
.follows-tag { display: inline-block; margin-left: 0.35rem; padding: 0 0.4rem; border-radius: 999px; font-size: 0.64rem; letter-spacing: 0.02em;
               text-transform: none; color: var(--accent-text); border: 1px solid currentColor; line-height: 1.25rem; vertical-align: 1px; }

/* an object's detail pop-up, and notes on a record (kept as written, line by line) */
.object-detail { display: grid; gap: 1.25rem; }
.object-detail dl.details { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.detail-notes { margin-top: 1.1rem; }
.object-detail .detail-notes { margin-top: 0; }
.detail-label { font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.3rem; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.object-detail .stamp { margin-top: 0; }
.danger-text { color: var(--bad); }
#object-detail-msg { margin-left: auto; }

/* the supplier picker (Resale lines, contract objects) and Add new partner */
div.field { display: grid; align-content: start; gap: 0.3rem; font-size: 0.78rem; color: var(--muted); letter-spacing: 0.02em; }
.supplier-pick { position: relative; }
.pick-row { display: flex; gap: 0.6rem; align-items: center; }
.pick-row input { flex: 1; min-width: 0; }
.pick-list { position: absolute; z-index: 5; left: 0; right: 0; top: 100%; margin-top: 0.25rem; max-height: 16rem; overflow: auto;
             background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 10px; padding: 0.3rem;
             box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); }
.pick-item { display: flex; justify-content: space-between; align-items: baseline; gap: 0.6rem; width: 100%; text-align: left;
             background: none; border: none; color: var(--text); font: inherit; font-size: 0.9rem; padding: 0.45rem 0.6rem;
             border-radius: 7px; cursor: pointer; }
.pick-item:hover, .pick-item.active { background: var(--surface); }
.pick-none { padding: 0.5rem 0.6rem; font-size: 0.85rem; color: var(--muted); }
.unlinked { color: var(--warn); }
#partner { width: min(520px, calc(100vw - 2rem)); }
.partner-found { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; flex-wrap: wrap;
                 border: 1px solid var(--line-strong); border-radius: 10px; padding: 0.7rem 0.85rem; font-size: 0.88rem; }

/* contract status: Renewal n days takes the renewal colour */
.pill.renew { font-weight: 600; }

/* ---------- dashboard ---------- */

.widgets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; align-items: start; }
.widgets .card + .card { margin-top: 0; }
.widget .card-head { margin-bottom: 0.6rem; }
.count { display: inline-block; min-width: 1.4rem; padding: 0 0.4rem; margin-left: 0.4rem; border-radius: 999px;
         background: var(--accent); color: var(--charcoal-deep); font-size: 0.7rem; font-weight: 600; text-align: center;
         letter-spacing: 0; vertical-align: 1px; }
.renew-row { display: flex; align-items: center; gap: 0.8rem; padding: 0.6rem 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.renew-row:hover .renew-name { text-decoration: underline; }
.renew-row .renew-name { flex: 1; min-width: 0; }
.renew-row .muted { font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.mention-row { display: flex; gap: 0.65rem; padding: 0.7rem 0; border-bottom: 1px solid var(--line); }
.mention-row:last-child { border-bottom: none; }
.mention-row .body { flex: 1; min-width: 0; text-decoration: none; }
.mention-row .body:hover .what { text-decoration: underline; }
.mention-row .what { font-size: 0.85rem; }
.mention-row .excerpt { color: var(--muted); font-size: 0.8rem; margin-top: 0.15rem; overflow: hidden; display: -webkit-box;
                        -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.mention-row .when { color: var(--muted); font-size: 0.72rem; margin-top: 0.2rem; }
.mention-row.assigned { background: rgba(0, 153, 153, 0.08); border-radius: 10px; padding-left: 0.5rem; padding-right: 0.5rem; }
.assigned-flag { display: inline-block; font-size: 0.66rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
                 color: var(--accent-text); border: 1px solid currentColor; border-radius: 999px; padding: 0 0.4rem; margin-right: 0.45rem; }
.tick-btn { flex: none; align-self: flex-start; background: none; border: 1px solid var(--line-strong); color: var(--muted);
            border-radius: 999px; width: 1.7rem; height: 1.7rem; cursor: pointer; font-size: 0.8rem; }
.tick-btn:hover { border-color: var(--accent); color: var(--accent-text); }
.renew-head { font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 0.2rem 0 0.3rem; }
.renew-none { color: var(--muted); font-size: 0.85rem; margin: 0 0 0.8rem; }
.renew-group + .renew-head { margin-top: 1rem; }

/* ---------- admin ---------- */

.users { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1rem; }
.user-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 1.15rem; display: grid; gap: 1rem; }
.user-card.pending { border-color: var(--accent); }
.user-card.gone { opacity: 0.7; }
.user-top { display: flex; gap: 0.85rem; align-items: center; min-width: 0; }
.user-top .who { min-width: 0; flex: 1; }
.user-top strong { display: block; font-weight: 600; }
.user-top .email { color: var(--muted); font-size: 0.82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-controls { display: grid; grid-template-columns: 1fr auto; gap: 0.6rem; align-items: end; }
.user-groups { display: flex; flex-wrap: wrap; gap: 0.35rem 1rem; align-items: center; font-size: 0.82rem; color: var(--muted); }
.user-groups label { display: inline-flex; gap: 0.35rem; align-items: center; color: var(--text); cursor: pointer; }
.user-groups input { width: auto; accent-color: var(--accent); }
.user-msg { font-size: 0.78rem; color: var(--muted); min-height: 1em; margin: 0; }
.user-msg.err { color: var(--bad); }

.journal-row td:first-child { white-space: nowrap; color: var(--muted); font-size: 0.82rem; }
.changes-btn { display: inline-grid; place-items: center; width: 1.45rem; height: 1.25rem; margin-left: 0.4rem; padding: 0; vertical-align: -3px;
               background: none; border: 1px solid var(--line-strong); border-radius: 6px; color: var(--muted); cursor: pointer; }
.changes-btn:hover, .changes-btn:focus-visible { border-color: var(--accent); color: var(--accent-text); outline: none; }
.changes-btn svg { width: 12px; height: 12px; display: block; }
.changes-table { border-collapse: collapse; }
.changes-table td { padding: 0.2rem 0.75rem 0.2rem 0; vertical-align: top; }
.changes-table td:first-child { color: var(--muted); white-space: nowrap; }

table.rates { max-width: 34rem; }
table.rates td { vertical-align: middle; }
table.rates td.cur { font-weight: 500; white-space: nowrap; }
table.rates td.carry { color: var(--muted); font-size: 0.8rem; }
table.rates th.num { text-align: right; }
table.rates input { width: 7rem; text-align: right; }
table.rates input::placeholder { color: var(--muted); opacity: 0.6; }

/* Data › Import: a row per module (its guide, Choose file); under the row, the file's problems, or the plan and Import, then the summary */
.data-card { max-width: 60rem; }
.import-module { border-top: 1px solid var(--line); padding: 0.9rem 0; }
.import-module:last-child { padding-bottom: 0; }
.import-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 1rem; }   /* v44: all line up */
.import-about { display: flex; flex-direction: column; gap: 0.15rem; }
.import-about .muted { font-size: 0.85rem; }
.import-buttons { display: flex; align-items: center; gap: 0.6rem; white-space: nowrap; }
@media (max-width: 640px) { .import-row { grid-template-columns: minmax(0, 1fr); } .import-buttons { flex-wrap: wrap; } }
.import-modules.busy .import-buttons label { opacity: 0.45; pointer-events: none; }
.import-name { font-size: 0.85rem; margin-top: 0.6rem; }
.import-name:empty { display: none; }
.import-result:not(:empty) { margin-top: 0.8rem; }
.import-head { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
.bad-text { color: var(--bad); }
.import-list { max-height: 24rem; overflow: auto; }
.import-actions { display: flex; gap: 0.6rem; margin-top: 1rem; }
.import-progress { display: flex; align-items: center; gap: 0.8rem; margin-top: 1rem; font-size: 0.85rem; color: var(--muted); }
.import-progress progress { flex: 1; max-width: 24rem; accent-color: var(--accent); }

/* ---------- performance ---------- */

.perf-nav { display: flex; align-items: center; gap: 0.4rem; }      /* ‹ quarter › (and the rates' year) */
.perf-nav .fy { font-weight: 600; min-width: 3.6rem; text-align: center; }
.perf-kpi { display: flex; align-items: baseline; gap: 0.6rem 1.25rem; flex-wrap: wrap; margin: 0 0 1.1rem; }
.perf-kpi .label { font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--title); font-weight: 500; width: 100%; }
.perf-kpi .big { font-family: 'Outfit', system-ui, sans-serif; font-size: 2.6rem; font-weight: 300; color: var(--text); line-height: 1.1; }
.perf-kpi .small { color: var(--muted); font-size: 0.9rem; }
table.perf-sum td { vertical-align: top; }
table.perf-sum td.gp { font-size: 1.05rem; font-weight: 500; }
table.perf-sum td.aside { color: var(--muted); font-size: 0.82rem; white-space: nowrap; width: 1%; }
table.perf-sum tr.total td { border-top: 1px solid var(--line-strong); font-weight: 600; }
table.perf-sum tr.total td.gp { font-size: 1.15rem; }
table.perf-list td.date { white-space: nowrap; }
table.perf-list td.line { min-width: 8rem; }
table.perf-list th.num, table.perf-list td.num { text-align: right; }
table.perf-list tfoot td { border-top: 1px solid var(--line-strong); font-weight: 600; }
table.perf-list tr.not-counted td { color: var(--muted); }
.perf-cur { font-size: 0.68rem; letter-spacing: 0.08em; color: var(--muted); margin-left: 0.35rem; }
.perf-place { color: var(--second); }
.perf-flags { margin: 1rem 0 0; padding: 0; list-style: none; font-size: 0.85rem; color: var(--second); display: grid; gap: 0.3rem; }
.perf-flags li.warn { color: var(--bad); }

/* ---------- screen sizes ---------- */

/* ---------- v42 ---------- */

/* statuses: teal = work still to close out; white = rolling money (Upcoming, ARR); grey = done; yellow = Draft */
.pill.white { color: var(--text); }
.pill.draft { color: var(--yellow); }

/* a line's open / complete circle (Line items and Buy side) */
th.lc-cell, td.lc-cell { width: 30px; padding-right: 0 !important; vertical-align: top; }
.lc { display: inline-flex; align-items: center; justify-content: center; width: 17px; height: 17px; border-radius: 50%;
      border: 1.7px solid var(--accent-text); box-sizing: border-box; margin-top: 2px; padding: 0; background: none; color: inherit;
      font: 700 11px/1 'Archivo', system-ui, sans-serif; cursor: default; }
button.lc { cursor: pointer; }
button.lc:hover:not(:disabled) { box-shadow: 0 0 0 4px rgba(0, 168, 168, 0.25); }
button.lc:disabled { opacity: 0.5; cursor: progress; }
.lc:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.lc.done { background: var(--second); border-color: var(--second); color: var(--charcoal-deep); }
.lc.auto { opacity: 0.5; }                                               /* Add credits: complete itself */
.lc.mirror { border-style: dotted; border-width: 2px; }                  /* follows its sell line */
.lc.done.mirror { background: transparent; border-color: var(--second); color: var(--second); }
.lc-count { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em; margin-left: 0.6rem; vertical-align: 0.12em;
            color: var(--accent-text); border: 1px solid currentColor; border-radius: 999px; padding: 0.05rem 0.45rem; text-transform: none; }
.lc-count.all { color: var(--second); }
.open-note { color: var(--accent-text); font-weight: 600; }

/* invoice blocks: due labels, the picker's Not yet due fold */
.due-label { font-size: 0.8rem; }
.inv-date.due-later, .due-label.due-later { color: var(--muted); font-weight: 400; }
.inv-date.due-done { color: var(--muted); }
.pick-fold { margin-top: 0.35rem; }
.pick-fold > summary { cursor: pointer; color: var(--muted); font-size: 0.85rem; padding: 0.2rem 0; }
.pick-fold > summary:hover { color: var(--text); }
.pick-fold[open] > summary { margin-bottom: 0.45rem; }

/* a form opened for a reason (a Legacy order needs a contact first) */
.form-lead { margin: 0 0 0.9rem; padding: 0.55rem 0.75rem; border-left: 3px solid var(--accent); background: var(--surface-2);
             border-radius: 4px; font-size: 0.9rem; }

/* busy: a button whose action is still loading */
.busy, .busy:hover { opacity: 0.55; cursor: progress; }

/* Notes boxes: links and names inside open themselves */
.notes-edit a, .notes-edit .ticket { cursor: pointer; }
.notes-card.flash { animation: flash 2.4s ease-out; }

/* below 1400px the comments rail drops under the page */
@media (max-width: 1399px) {
  .content.wide { max-width: 1100px; }
  .page-split { display: block; }
  .rail { margin-top: 1.25rem; }
  .rail .comments-card { display: block; position: static; max-height: none; }
  .rail .comments-card #comments { overflow: visible; }
}

/* ---------- v41: invoicing due, Raise and Publish to Xero, Performance Classic, QTR to date ---------- */

/* overdue (red) and due within 30 days (amber), in lists and as pills */
.due-over { color: #f0625d; font-weight: 500; }
.due-soon { color: var(--warn); font-weight: 500; }
td .subline.due-over, td .subline.due-soon { font-size: 0.8rem; }
.pill.inv-over { color: #f0625d; }
.pill.inv-due { color: var(--warn); }
[data-pop="orderdue"], [data-pop="contractdue"] { cursor: help; }
.pop-orderdue, .pop-contractdue { width: min(27rem, calc(100vw - 24px)); }
.pop-classic { width: min(30rem, calc(100vw - 24px)); }
table.due-table { width: 100%; border-collapse: collapse; margin-top: 0.35rem; font-size: 0.86rem; }
table.due-table td { padding: 0.28rem 0; vertical-align: top; }
table.due-table td.when { text-align: right; white-space: nowrap; padding-left: 1rem; }
table.due-table .subline { font-size: 0.76rem; }

/* invoice statuses (v42): Draft grey, Raised and Publishing dashed yellow, In Xero Xero blue, Applied and Credits teal, Deleted struck */
.inv-pill.publishing { color: var(--yellow); border-style: dashed; }
.inv-pill.in_xero { color: var(--xero); }
.inv-pill.deleted { color: var(--muted); text-decoration: line-through; }
.pill-btn .pill-caret { margin-left: 0.25rem; font-size: 0.55rem; color: var(--muted); vertical-align: 0.15em; }
.btn.xero { background: #13b5ea; border-color: #13b5ea; color: #fff; font-weight: 600; }
.btn.xero:hover:not(:disabled) { background: #0fa3d4; border-color: #0fa3d4; color: #fff; }
.xero-link { color: #3fc4ef; font-size: 0.82rem; white-space: nowrap; }
.count-badge { display: inline-block; margin-left: 0.5rem; min-width: 1.3rem; padding: 0 0.35rem; border-radius: 999px; background: var(--accent);
  color: var(--charcoal-deep); font-size: 0.7rem; font-weight: 700; line-height: 1.3rem; text-align: center; }
.pub-banner { display: flex; align-items: center; gap: 0.9rem; border: 1px solid var(--warn); border-radius: 12px; padding: 0.7rem 1rem;
  margin: -0.5rem 0 1.25rem; background: rgba(227, 163, 59, 0.07); font-size: 0.9rem; }
.pub-banner .dot { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--warn); flex: none; }
.pub-banner .btn { margin-left: auto; }
.pub-done { color: var(--accent-text); }
.deleted-banner { border: 1px solid var(--line-strong); border-radius: 12px; padding: 0.65rem 1rem; margin: -0.5rem 0 1.25rem; color: var(--second); }
dl.details.mini { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.8rem 1.5rem; padding: 0.8rem 1rem;
  border: 1px solid var(--line); border-radius: 10px; }
.warn-box { border: 1px solid var(--warn); border-radius: 10px; padding: 0.75rem 1rem; font-size: 0.88rem; color: var(--text);
  background: rgba(227, 163, 59, 0.07); }
.warn-box strong { color: var(--warn); }
.warn-box .btn { margin-left: 0.4rem; }

/* the Publish to Xero wizard */
.wiz-steps { display: flex; align-items: center; gap: 0.5rem; padding: 0.9rem 1.5rem; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.wiz-step { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.85rem; color: var(--muted); }
.wiz-step b { display: inline-grid; place-items: center; width: 1.45rem; height: 1.45rem; border-radius: 50%; border: 1px solid var(--line-strong);
  font-size: 0.72rem; font-weight: 600; }
.wiz-step.on { color: var(--text); font-weight: 500; }
.wiz-step.on b { background: var(--accent); border-color: var(--accent); color: var(--charcoal-deep); }
.wiz-step.done { color: var(--accent-text); }
.wiz-step.done b { border-color: var(--accent); }
.wiz-sep { width: 2rem; height: 1px; background: var(--line-strong); }
.wiz-lead { margin: 0 0 0.9rem; color: var(--second); }
.wiz-note { color: var(--second); font-size: 0.88rem; margin: 1rem 0 0; }
.wiz-q { font-family: 'Outfit', system-ui, sans-serif; font-weight: 300; font-size: 1.35rem; margin: 0 0 1rem; }
table.pub-list td.pick { width: 1.8rem; }
table.pub-list input { width: auto; accent-color: var(--accent); margin: 0; }
.file-card { display: flex; align-items: center; gap: 1.1rem; border: 1px solid var(--line-strong); border-radius: 12px; padding: 1rem 1.2rem; flex-wrap: wrap; }
.file-card .btn { margin-left: auto; }
.file-icon { width: 2.6rem; height: 3.1rem; border: 1.5px solid var(--accent); border-radius: 6px; display: grid; place-items: center;
  font-size: 0.66rem; font-weight: 700; color: var(--accent-text); letter-spacing: 0.06em; }
.file-name { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 0.92rem; overflow-wrap: anywhere; }
.xero-open { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.xero-open .btn { padding: 0.65rem 1.4rem; }
.xero-open .subline { margin: 0; }
.wiz-list { margin: 0; padding-left: 1.3rem; display: grid; gap: 0.7rem; line-height: 1.55; }
.wiz-list li::marker { color: var(--accent-text); font-weight: 600; }
.choices { display: grid; gap: 0.6rem; }
.choice-card { display: flex; align-items: flex-start; gap: 0.8rem; border: 1px solid var(--line-strong); border-radius: 12px; padding: 0.8rem 1rem; cursor: pointer; }
.choice-card input { width: auto; margin: 0.25rem 0 0; accent-color: var(--accent); }
.choice-card.on, .choice-card:has(input:checked) { border-color: var(--accent); background: rgba(0, 153, 153, 0.08); }
fieldset.choice-set { display: grid; gap: 0.6rem; }

/* Performance > Classic */
.classic-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 0.9rem 1.4rem; margin: 0 0 1.5rem; }
.classic-step { display: flex; align-items: center; gap: 0.35rem; }
.classic-step .arrow { min-width: 2.1rem; padding-left: 0; padding-right: 0; text-align: center; font-size: 1.05rem; }
.classic-step .arrow[aria-disabled="true"] { opacity: 0.35; pointer-events: none; }
.classic-label { background: none; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--text); font: inherit;
  font-weight: 600; padding: 0.32rem 0.75rem; cursor: pointer; min-width: 7.5rem; text-align: center; }
.classic-label .caret { color: var(--muted); font-weight: 400; margin-left: 0.35rem; font-size: 0.8rem; }
.classic-dates { width: 100%; color: var(--muted); font-size: 0.85rem; margin-top: -0.4rem; }
.classic-dates strong { color: var(--text); font-weight: 500; }
/* v45: the period's gross profit, top right beside the period controls; under them on narrow windows */
.classic-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.classic-top-left { flex: 1 1 30rem; min-width: 0; }
.classic-top .classic-bar { margin-bottom: 0; }
.qtd.classic-gp { margin: 0; min-width: 18rem; }
.classic-range { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.classic-range label { display: flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; color: var(--muted); }
.classic-range input[type=date] { width: auto; padding: 0.3rem 0.5rem; }
.menu.classic-jump { min-width: 15rem; max-height: 22rem; overflow-y: auto; }
.classic-jump .fy-head { font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--title); margin: 0.5rem 0.55rem 0.2rem; }
.classic-jump a.menu-item { text-decoration: none; color: var(--text); }
.classic-jump .menu-item .when { margin-left: auto; color: var(--muted); font-size: 0.78rem; }
.classic-jump .menu-item.now { color: var(--accent-text); }
table.classic td.num, table.classic th.num { text-align: right; white-space: nowrap; }
table.classic td.when { white-space: nowrap; }
table.classic .conv { font-style: italic; border-bottom: 1px dotted var(--muted); cursor: help; }
table.classic tfoot td { border-top: 1px solid var(--line-strong); border-bottom: none; font-weight: 600; font-size: 1rem; padding-top: 0.85rem; }
table.classic tfoot td.label { text-align: right; color: var(--text); }
.classic-note { color: var(--muted); font-size: 0.8rem; margin: 0.8rem 0 0; }

/* the Dashboard's QTR to date tile */
.qtd { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.qtd-label { font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--title); }
.qtd-label .fy { color: var(--muted); }
.qtd-value { font: 600 3.3rem/1.05 'Archivo', system-ui, sans-serif; margin: 0.45rem 0 0.4rem; letter-spacing: -0.01em; }
.qtd-sub { color: var(--muted); font-size: 0.88rem; }
.qtd-sub strong { color: var(--second); font-weight: 500; }
@media (max-width: 720px) { .qtd-value { font-size: 2.4rem; } .pub-banner { flex-wrap: wrap; } .pub-banner .btn { margin-left: 0; } }

/* the dashboard's two widgets: side by side and tall; stacked on narrower screens */
@media (min-width: 961px) {
  .widgets { align-items: stretch; }
  .widgets .widget { aspect-ratio: 3 / 4; }
}
@media (max-width: 960px) { .widgets { grid-template-columns: 1fr; } }

/* phones */
@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; gap: 0 1rem; padding-top: 0.5rem; }
  .tabs { order: 3; width: 100%; }
  .tabs a { padding: 0.7rem 0.6rem; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .user-controls .btn { grid-column: span 2; }
  .content { padding-top: 1.5rem; }
}

/* ---------- v43: opportunities ---------- */

/* the timeline: five stages, then Probability at the top right of the main column */
.opp-timeline { display: flex; align-items: center; margin: 0 0 1.25rem; flex-wrap: wrap; row-gap: 0.6rem; column-gap: 1rem; }
.opp-steps { display: flex; align-items: center; position: relative; flex-wrap: wrap; row-gap: 0.6rem; }
.opp-step { min-width: 8.6rem; padding: 0.55rem 0.9rem; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface);
            display: flex; flex-direction: column; gap: 0.15rem; }
.opp-step .st { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.opp-step .dt { font-size: 0.8rem; color: var(--muted); white-space: nowrap; }
.opp-step.reached { border-color: var(--second); }
.opp-step.reached .st { color: var(--text); }
.opp-step.current { border-width: 2px; padding: calc(0.55rem - 1px) calc(0.9rem - 1px); background: var(--surface-2); }
.opp-step.current.white { border-color: var(--text); }
.opp-step.current.yellow { border-color: var(--yellow); }
.opp-step.current.yellow .st { color: var(--yellow); }
.opp-step.current.teal { border-color: var(--accent); }
.opp-step.current.teal .st { color: var(--accent-text); }
.opp-step.future { border-style: dashed; background: none; }
.opp-step.future .st { color: var(--muted); }
.opp-step.skipped { border-style: dashed; background: none; opacity: 0.7; }
.opp-step.skipped .st { color: var(--muted); text-decoration: line-through; }
.opp-arrow { align-self: center; color: var(--muted); padding: 0 0.55rem; font-size: 1.05rem; }
/* Died / Superseded: the whole timeline dims, with the status and its date over it */
.opp-steps.ended .opp-step, .opp-steps.ended .opp-arrow { opacity: 0.32; }
.opp-over { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.opp-over > span { display: inline-flex; align-items: center; gap: 0.6rem; padding: 0.4rem 0.8rem; border-radius: 10px; background: var(--surface-2);
                   border: 1px solid var(--line-strong); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35); }
.opp-over .dt { font-size: 0.85rem; color: var(--text); }
.opp-prob { margin-left: auto; align-self: center; width: 13rem; padding: 0.5rem 0.9rem 0.6rem; border: 1px solid var(--line-strong);
            border-radius: 10px; background: var(--surface); display: flex; flex-direction: column; gap: 0.3rem; cursor: pointer;
            font: inherit; color: inherit; text-align: left; }
.opp-prob:hover, .opp-prob:focus-visible { border-color: var(--text); background: var(--surface-2); }
.opp-prob .lb { display: flex; justify-content: space-between; align-items: baseline; gap: 0.8rem; }
.opp-prob .st { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.opp-prob .pv { font-size: 1.7rem; font-weight: 600; line-height: 1; color: var(--text); font-variant-numeric: tabular-nums; }
.opp-prob .bar { display: block; height: 6px; border-radius: 3px; background: var(--line-strong); overflow: hidden; }
.opp-prob .bar > span { display: block; height: 100%; background: var(--accent); }
.opp-prob.auto { cursor: default; }
.opp-prob.auto:hover { border-color: var(--line-strong); background: var(--surface); }
.opp-timeline > .click-editor { margin-left: auto; width: 13rem; }
@media (max-width: 720px) { .opp-prob, .opp-timeline > .click-editor { margin-left: 0; } .opp-arrow { padding: 0 0.3rem; } }

/* the list's filter, and narrow number columns */
.segmented button { border: 0; background: none; font: inherit; cursor: pointer; padding: 0.32rem 0.9rem; border-radius: 999px;
                    font-size: 0.85rem; color: var(--muted); }
.segmented button.active { background: var(--accent); color: var(--charcoal-deep); font-weight: 500; }
.segmented button:not(.active):hover { color: var(--text); }
.seg-count { margin-left: 0.3rem; opacity: 0.75; font-variant-numeric: tabular-nums; }
.table-tools .segmented { margin-right: auto; }     /* the opportunities list's filter sits on the left (mockup) */
th.narrow, td.narrow { width: 6.5rem; }

/* Create contract and Promote to order: what to carry over */
.carry-box { display: grid; gap: 0.35rem; }
.carry-head { display: flex; justify-content: space-between; align-items: baseline; }
.carry-head > span { font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.carry-tick { display: flex; align-items: center; gap: 0.55rem; font-size: 0.9rem; color: var(--text); margin: 0.2rem 0 0.9rem; cursor: pointer; }
.carry-tick input { width: auto; accent-color: var(--accent); margin: 0; }
.form-warn { margin: 0 0 0.9rem; padding: 0.55rem 0.75rem; border-left: 3px solid var(--warn); background: var(--surface-2); border-radius: 4px;
             font-size: 0.88rem; }
.form-warn ul { margin: 0.3rem 0 0; padding-left: 1.1rem; }
.stage-grid { margin-bottom: 0.3rem; }

/* OPP- and ORD- codes: links with a small hover */
a.code-link { color: var(--accent-text); text-decoration: none; font-family: ui-monospace, Menlo, monospace; font-size: 0.92em;
              border-bottom: 1px dotted currentColor; white-space: nowrap; }
a.code-link:hover { border-bottom-style: solid; }
.pop-ref { width: 17rem; }
.pop-ref .row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; font-size: 0.85rem; padding: 0.2rem 0; }
.pop-ref .row > span:first-child { color: var(--muted); }

/* ---------- v44: renewals, the Dashboard's rail, closed objects, shared artifacts ---------- */

/* renewals take a lime of their own: REN- codes, New renewal and Create renewal, the Renewals headings */
:root { --renew: #a6d65a; }
.ren-code, .code.ren-code, .ref-code.ren-code { color: var(--renew); }
a.code-link.ren { color: var(--renew); }
.btn.renew { border-color: var(--renew); }
.btn.renew:hover:not(:disabled) { background: var(--renew); color: var(--charcoal-deep); }

/* Opportunities: the kind and status filters side by side */
.seg-row { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; margin-right: auto; }
.table-tools .seg-row .segmented { margin-right: 0; }

/* the Dashboard: boxes in the main area, Mentions in the rail (on top below 1400px, where assignments are acted on) */
.renew-head.ren-h { color: var(--renew); }
.renew-row .renew-when { text-align: right; white-space: nowrap; }
.rail .mentions-card { position: sticky; top: 76px; }
.tick-btn.x { font-size: 1rem; line-height: 1; }
@media (max-width: 1399px) {
  .dash-split { display: flex; flex-direction: column; }
  .dash-split .rail { order: -1; margin: 0 0 1.25rem; }
  .rail .mentions-card { position: static; }
}

/* the company page's Opportunities box: its renewals folded into a line of their own */
.ren-fold-row td { padding: 0; }
.ren-fold { display: flex; gap: 0.7rem; align-items: baseline; width: 100%; background: none; border: 0; padding: 0.75rem;
            color: var(--text); font: inherit; font-size: 0.9rem; cursor: pointer; text-align: left; }
.ren-fold:hover { background: var(--surface-2); }
.ren-fold .tri { display: inline-block; width: 0.9rem; color: var(--renew); font-size: 0.72rem; transition: transform 0.15s; }
.ren-fold.open .tri { transform: rotate(90deg); }
.ren-fold .lbl { color: var(--renew); font-weight: 500; }
.ren-fold .next { font-size: 0.85rem; }

/* New renewal: the orders that can take one, by customer */
.ren-cust { max-width: 26rem; margin-bottom: 1.1rem; }
.ren-cust .chosen { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.75rem; border: 1px solid var(--line-strong);
                    border-radius: 8px; background: var(--surface-2); color: var(--text); font-size: 0.95rem; letter-spacing: 0; }
.ren-cust .chosen button { margin-left: auto; background: none; border: 0; color: var(--muted); font-size: 1.05rem; cursor: pointer; }
.ren-cust .chosen button:hover { color: var(--text); }
.pick-group + .pick-group { margin-top: 1.1rem; }
.pick-group-head { font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.35rem; }
.ren-pick { display: grid; grid-template-columns: minmax(0, 1fr) 11rem minmax(0, 13rem) 10rem; gap: 1rem; align-items: center; width: 100%;
            padding: 0.6rem 0.7rem; border: 0; border-top: 1px solid var(--line); background: none; color: var(--text); font: inherit;
            text-align: left; cursor: pointer; border-radius: 6px; }
.ren-pick:hover:not(:disabled) { background: var(--surface-2); }
.ren-pick.off { opacity: 0.5; cursor: default; }
.ren-pick .ren-contract { font-size: 0.85rem; }
.ren-pick .end { text-align: right; font-size: 0.85rem; white-space: nowrap; }
@media (max-width: 720px) { .ren-pick { grid-template-columns: minmax(0, 1fr) auto; } .ren-pick .ren-contract { display: none; } }

/* Create renewal: the order's lines, rolled on a term, and what comes over */
table.ren-lines td.pick { width: 1.6rem; padding-left: 0; }
table.ren-lines td.pick input { width: auto; accent-color: var(--accent); margin: 0; }
table.ren-lines tr.off td:not(.pick) { color: var(--muted); }
table.ren-lines td.indent { padding-left: 2rem; position: relative; }
table.ren-lines td.indent::before { content: '↳'; position: absolute; left: 0.9rem; color: var(--muted); }
.was { color: var(--muted); font-size: 0.78rem; display: block; }
.ren-form { display: grid; gap: 1rem; margin-top: 1.25rem; }
.ren-form .carry-tick { margin: 0.2rem 0 0; }

/* a renewal's page: Probability on its own (no timeline); Project forward's (i) */
.prob-only { display: flex; justify-content: flex-end; margin: 0 0 1.25rem; }
.prob-only > .click-editor { width: 13rem; }
/* 1.1.0: the copy button, the same everywhere: a small round button with the copy icon and no text, at the top right
   of the box it copies. Its label ("Copy" and what) shows at once on hover or focus, drawn like the (i) hovers; after
   a click the icon is a tick for a moment. */
.copy-btn { position: relative; width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center;
            padding: 0; flex: none; background: transparent; border: 1px solid var(--line-strong); color: var(--second);
            cursor: pointer; }
.copy-btn svg { width: 14px; height: 14px; display: block; }
.copy-btn:hover, .copy-btn:focus-visible { border-color: var(--accent); color: var(--text); outline: none; }
.copy-btn.done { border-color: var(--accent); color: var(--accent-text); }
.copy-btn:hover::after, .copy-btn:focus-visible::after { content: attr(data-tip); position: absolute; z-index: 30;
            top: calc(100% + 8px); right: 0; white-space: nowrap; padding: 0.3rem 0.6rem; background: var(--surface-2);
            border: 1px solid var(--line-strong); border-radius: 8px; color: var(--text);
            font: 400 0.78rem/1.4 'Archivo', system-ui, sans-serif; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
            pointer-events: none; }
.copy-btn.done::after { content: none; }
.info-i { display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; border-radius: 50%;
          border: 1px solid var(--muted); color: var(--muted); font: italic 600 0.62rem Georgia, serif; margin-left: 0.45rem;
          vertical-align: 0.1em; cursor: help; position: relative; }
.info-i:hover, .info-i:focus-visible { border-color: var(--text); color: var(--text); }
.info-i:hover::after, .info-i:focus-visible::after { content: attr(data-tip); position: absolute; z-index: 30; top: 1.4rem; left: -1rem;
          width: 16rem; padding: 0.6rem 0.75rem; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 10px;
          color: var(--text); font: 400 0.82rem/1.45 'Archivo', system-ui, sans-serif; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); }

/* an order's Renewal, in Details: the hovers */
.pop-renref, .pop-renewedas { width: 19rem; }
.pop-renref .row, .pop-renewedas .row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; font-size: 0.85rem; padding: 0.2rem 0; }
.pop-renref .row > span:first-child, .pop-renewedas .row > span:first-child { color: var(--muted); white-space: nowrap; }
.pop-renref .row > :last-child, .pop-renewedas .row > :last-child { text-align: right; }

/* contract objects: closed against their end date */
.dealt { display: inline-flex; align-items: center; gap: 0.4rem; margin-left: 0.55rem; vertical-align: -0.2em; }
.dealt .lc { width: 16px; height: 16px; font-size: 0.65rem; margin-top: 0; }
td .dealt-by { display: block; color: var(--muted); font-size: 0.75rem; }
.end-done { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(141, 146, 153, 0.6); }
#objects-card { scroll-margin-top: 76px; }

/* shared artifacts: where else a link is, and a link already in OpsPlus */
.art-places { margin-top: 0.5rem; padding-top: 0.45rem; border-top: 1px solid var(--line); display: grid; gap: 0.25rem; font-size: 0.82rem; }
.art-places .lbl { font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.already { padding: 0.6rem 0.8rem; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 4px; font-size: 0.88rem;
           margin-bottom: 0.9rem; }
.already ul { margin: 0.35rem 0 0; padding-left: 1.1rem; }

/* ---------- animations ---------- */

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes flash { 0%, 30% { background: rgba(0, 153, 153, 0.18); } 100% { background: transparent; } }
@media (prefers-reduced-motion: reduce) {
  .panel, .lattice path { animation: none; }
  .lattice path { stroke-dashoffset: 0; }
}

/* ---------- v45 mock: wide lists; narrow windows drop low-priority columns ---------- */
.inv-dot { display: none; width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; box-sizing: border-box;
           color: var(--second); vertical-align: -1px; }
.inv-dot.part { background: linear-gradient(90deg, currentColor 50%, transparent 50%); }
.inv-dot.full { background: currentColor; }
.inv-dot.due { color: var(--warn); }
.inv-dot.over { color: #f0625d; }
.label-short { display: none; }
@media (max-width: 999px) {
  table.list .drop1 { display: none; }
  .inv-text { display: none; }
  .inv-dot { display: inline-block; }
  /* the column shrinks to its icon: a small round heading (Invoicing on hover), still a sort */
  .label-full { display: none; }
  .label-short { display: inline-block; }
  table.list th.inv-col, table.list td.inv-col { width: 1%; white-space: nowrap; text-align: center; }
  /* short columns (status, money, dates, codes) hug their content, so names and customers get the room */
  table.list .fit { width: 1%; white-space: nowrap; }
}
@media (max-width: 759px) {
  table.list .drop2 { display: none; }
  /* a little less space between columns, so the names wrap less */
  table.list th, table.list td { padding-left: 0.5rem; padding-right: 0.5rem; }
}

/* ---- Admin › Claude (v45) ---- */
.claude-card { margin-bottom: 1.25rem; }
.claude-card p { margin: 0.5rem 0; color: var(--second); }
.claude-details { display: grid; gap: 0.6rem; margin: 0.9rem 0; }
.claude-details div { display: grid; grid-template-columns: 13rem 1fr; gap: 1rem; }
.claude-details dt { color: var(--muted); }
.claude-details dd { margin: 0; }
@media (max-width: 720px) { .claude-details div { grid-template-columns: 1fr; gap: 0.15rem; } }
/* 1.1.0: Import an export (staging and dev): the file picker is a label styled as a button; the pop-up's summary */
label.btn { cursor: pointer; display: inline-flex; align-items: center; }
.import-summary { display: grid; gap: 0.35rem; margin: 0; }
.import-summary div { display: grid; grid-template-columns: 9rem 1fr; gap: 1rem; }
.import-summary dt { color: var(--muted); }
.import-summary dd { margin: 0; font-variant-numeric: tabular-nums; }
.claude-people { list-style: none; padding: 0; margin: 0.5rem 0; display: grid; gap: 0.5rem; }
.claude-people li { display: flex; align-items: center; gap: 0.6rem; }
.user-keith { margin-top: 0.35rem; }

/* v46: the opportunities list's type chips (Leads · Opportunities · Renewals) and Show concluded */
.chips { display: inline-flex; gap: 0.4rem; flex-wrap: wrap; }
.chip { border: 1px solid var(--line-strong); background: none; color: var(--muted); font: inherit; font-size: 0.85rem; cursor: pointer;
  padding: 0.3rem 0.85rem; border-radius: 999px; display: inline-flex; align-items: center; gap: 0.3rem; }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--charcoal-deep); font-weight: 500; }
.chip:not(.on):hover { color: var(--text); }
.chip .tick { font-size: 0.75rem; }
.seg-row .switch { margin-left: 0.5rem; }

/* ---------- v46: Performance's header boxes (Classic and Modern) ---------- */

/* right of the title and tabs, faint boxes: the period, the switches; Classic's Gross profit box at the far right */
.perf-ctl { display: flex; align-items: stretch; gap: 0.5rem; flex-wrap: wrap; justify-content: flex-end; }
.perf-box { display: flex; align-items: center; gap: 0.7rem; border: 1px solid var(--line); border-radius: 10px; background: rgba(232, 235, 238, 0.025); position: relative; }
.perf-box.period { flex-direction: column; align-items: stretch; justify-content: space-between; gap: 0.35rem; padding: 0.4rem 0.45rem; }
.perf-box.period .classic-step { justify-content: space-between; gap: 0.3rem; }
.perf-box.period .classic-step .arrow { min-width: 1.7rem; font-size: 0.9rem; padding-top: 0.12rem; padding-bottom: 0.12rem; }
.perf-box.period .classic-label { flex: 1; font-size: 0.8rem; padding: 0.22rem 0.6rem; min-width: 0; display: flex; justify-content: space-between; align-items: center; white-space: nowrap; }
.perf-box.period .segmented { padding: 2px; }
.perf-box.period .segmented a, .perf-box.period .segmented button { font-size: 0.74rem; padding: 0.17rem 0.75rem; flex: 1; text-align: center; }
.perf-box.period .classic-range { gap: 0.35rem; }
.perf-box.period .classic-range input[type=date] { padding: 0.15rem 0.35rem; font-size: 0.78rem; }
.perf-box.switches { display: grid; grid-template-columns: auto; gap: 0.45rem; align-content: center; padding: 0.45rem 0.9rem; }
.perf-box.switches.two { grid-template-columns: auto auto; column-gap: 1.2rem; }
.perf-box .switch { font-size: 0.76rem; padding: 0.1rem 0; gap: 0.4rem; white-space: nowrap; }
.perf-box .switch .track { width: 1.75rem; height: 1rem; }
.perf-box .switch .track::after { width: 0.72rem; height: 0.72rem; top: 0.14rem; left: 0.14rem; }
.perf-box .switch[aria-checked="true"] .track::after { transform: translateX(0.75rem); }
.perf-box .switch.ev[aria-checked="true"] .track { background: var(--warn); }   /* as the amber (due) diamonds */
.qtd.classic-gp.perf-gp { margin: 0; min-width: 0; padding: 0.55rem 1.1rem; display: flex; align-items: center; }
.perf-gp .qtd-value { font-size: 2.1rem; margin: 0.2rem 0 0; }
.perf-gp .qtd-label { font-size: 0.66rem; }
.classic-top-left { flex: 1 1 20rem; }
.h2-range { color: var(--muted); font-weight: 400; }

/* the three-way switch: off, on, weighted; dashed lime as the renewal bars once on */
.tri { display: inline-flex; align-items: center; gap: 0.4rem; background: none; border: none; color: var(--muted); font: inherit; font-size: 0.76rem; cursor: pointer; padding: 0.1rem 0; }
.tri .ttrack { width: 2.65rem; height: 1rem; border-radius: 999px; background: var(--line-strong); position: relative; flex: none; box-sizing: border-box; border: 1.5px solid transparent; }
.tri .stop { position: absolute; top: 50%; width: 4px; height: 4px; margin: -2px 0 0 -2px; border-radius: 50%; background: rgba(232, 235, 238, 0.35); }
.tri .s0 { left: 0.5rem; } .tri .s1 { left: 50%; } .tri .s2 { left: calc(100% - 0.5rem); }
.tri .knob { position: absolute; top: calc(0.14rem - 1.5px); left: calc(0.14rem - 1.5px); width: 0.72rem; height: 0.72rem; border-radius: 50%; background: #e8ebee; transition: transform 0.15s; }
.tri.full .knob { transform: translateX(0.825rem); } .tri.weighted .knob { transform: translateX(1.65rem); }
.tri.full .ttrack, .tri.weighted .ttrack { background: rgba(166, 214, 90, 0.12); border: 1.5px dashed var(--renew); }
.tri.full .stop, .tri.weighted .stop { background: rgba(166, 214, 90, 0.55); }
.tri.full, .tri.weighted { color: var(--text); }
.tri .tlabel { min-width: 7.2rem; text-align: left; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .tri .knob, .switch .track::after { transition: none; } }

/* Classic's renewal rows (v46) */
table.classic tr.classic-group td { color: var(--muted); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; padding-top: 1rem; border-bottom: 1px dashed var(--renew); }
table.classic .ren-code { color: var(--renew); }
table.classic tfoot tr.subtotal td { font-size: 0.9rem; font-weight: 500; color: var(--second); }
table.classic tfoot tr.subtotal + tr td { border-top: none; padding-top: 0.35rem; }

/* v46: Assign existing Xero invoice */
.cv-sum { display: flex; justify-content: space-between; gap: 1rem; padding: 0.6rem 0.8rem; border: 1px solid var(--line); border-radius: 10px; background: rgba(232, 235, 238, 0.03); font-size: 0.86rem; flex-wrap: wrap; }
.cv-sum b { font-weight: 600; } .cv-sum span { color: var(--muted); }
.cv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.2rem; }
.cv-grid .wide { grid-column: 1 / -1; }
.cv-check { font-size: 0.8rem; letter-spacing: 0; }
.cv-check.ok { color: var(--accent-text); } .cv-check.warn { color: var(--warn); } .cv-check.bad { color: var(--bad); }
label.field input.cv-bad { border-color: var(--bad); } label.field input.cv-warn { border-color: var(--warn); }
.cv-list { margin: 0.2rem 0 0; padding-left: 1.1rem; display: grid; gap: 0.35rem; }
.cv-note { color: var(--muted); font-size: 0.8rem; }
@media (max-width: 720px) { .cv-grid { grid-template-columns: 1fr; } }

/* ---------- v46: Performance › Modern, the timeline ---------- */

.tl-top { margin-bottom: 1.25rem; }
.tl-card-wrap { padding: 1rem 26px 1rem; }
.tl { display: grid; grid-template-columns: var(--tl-left) var(--tl-fig) minmax(0, 1fr); border: 1px solid var(--line); border-radius: 10px; overflow: clip; background: #212326; }
.tl-left { background: var(--surface); }
.tl-figs { background: var(--surface); border-left: 1px solid var(--line); border-right: 1px solid var(--line-strong); }
.tl-grid { overflow: clip; position: relative; }
.tl-inner { position: relative; }
.tl-n, .tl-l, .tl-r, .tl-fc { height: 38px; position: relative; }
.tl-head-l, .tl-head-f, .tl-head-r { height: 36px; border-bottom: 1px solid var(--line-strong); position: sticky; top: var(--bar-h, 60px); z-index: 7; }
.tl-head-l, .tl-head-f { display: flex; align-items: center; padding: 0 0.8rem; color: var(--muted); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; background: var(--surface); }
.tl-head-l { display: grid; grid-template-columns: 140px 1fr; padding: 0; }
.tl-head-l span { padding: 0 0.8rem; align-self: center; }
.tl-head-f { justify-content: flex-end; text-align: right; line-height: 1.15; color: var(--text); }
.tl-head-r { background: #212326; }
.tl-h { position: absolute; top: 0; height: 36px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 0.78rem; gap: 0.15rem; white-space: nowrap; }
.tl-h.focus { color: var(--text); font-weight: 500; }
.tl-h .two { font-size: 0.72rem; line-height: 1.15; text-align: center; }
.tl-h .step { border: 0; background: none; color: var(--muted); opacity: 0.6; font-size: 0.85rem; padding: 0 0.3rem; cursor: pointer; font-family: inherit; }
.tl-h .step:hover, .tl-h .step:focus-visible { opacity: 1; color: var(--accent-text); outline: none; }
.tl-focus { position: absolute; top: 2px; bottom: 2px; left: 1px; border: 2px solid rgba(0, 153, 153, 0.6); border-radius: 7px; pointer-events: none; z-index: 8; }
.tl-h.focus { background: rgba(0, 153, 153, 0.08); }
.tl-gl { position: absolute; top: 36px; bottom: 0; width: 1px; background: rgba(232, 235, 238, 0.06); }
.tl-today { position: absolute; top: 36px; bottom: 0; width: 0; border-left: 2px dashed var(--accent); opacity: 0.5; z-index: 1; }
.tl-total { border-top: 1px solid var(--line-strong); background: #24312f; position: sticky; bottom: 0; z-index: 7; }
.tl-r.tl-total { background: #1e2c2e; }
.tl-l.tl-total { display: flex; align-items: center; padding: 0 0.8rem; font-weight: 600; }
.tl.stuck-top .tl-head-l, .tl.stuck-top .tl-head-f, .tl.stuck-top .tl-head-r { box-shadow: 0 8px 14px -6px rgba(0, 0, 0, 0.55); }
.tl.stuck-bottom .tl-total { box-shadow: 0 -8px 14px -6px rgba(0, 0, 0, 0.55); }
.tl-f { height: 100%; display: flex; align-items: center; justify-content: flex-end; padding: 0 0.8rem; font-variant-numeric: tabular-nums; font-size: 0.84rem; color: var(--text); }
.tl-fc.folded .tl-f { font-weight: 600; }
.tl-fc.tl-total .tl-f { color: var(--accent-text); font-weight: 600; }
.tl-cell { z-index: 2; position: absolute; top: 0; height: 38px; display: flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums;
  font-size: 0.82rem; color: var(--accent-text); font-weight: 600; cursor: default; }
.tl-cell:hover { background: rgba(0, 153, 153, 0.22); border-radius: 6px; }

/* names: Customer (wrapping only across its own rows), then Contract › order chain */
.tl-n { display: grid; grid-template-columns: 140px 1fr; align-items: start; font-size: 0.84rem; }
.tl-n > div { position: relative; height: 38px; min-width: 0; }
.tl-n .nch { display: flex; align-items: center; padding: 0 0.8rem 0 0.4rem; white-space: nowrap; overflow: hidden; color: var(--second); gap: 0.35rem; }
.tl-n .nch .chn, .tl-n .nch .kn, .tl-n .nch .lane { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tl-n .nch .kn { flex: 0 1 auto; max-width: 55%; }
.tl-n .nch .knote { margin-left: 0.3rem; font-size: 0.78rem; flex: none; }
.tl-n .span { position: absolute; top: 0; left: 0; right: 0; z-index: 2; display: flex; align-items: flex-start; gap: 0.3rem; padding: 0.62rem 0.4rem 0 0.5rem; line-height: 1.25; overflow: hidden; }
.tl-n .span.one { white-space: nowrap; height: 38px !important; align-items: center; padding-top: 0; }
.tl-n .span.one .cn { overflow: hidden; text-overflow: ellipsis; min-width: 0; display: block; }
.tl-n .cn { font-weight: 600; color: var(--text); font-size: 0.86rem; text-decoration: none; }
.tl-n .kn { color: var(--title); text-decoration: none; }
.tl-n a.cn:hover, .tl-n a.kn:hover { text-decoration: underline; }
.tl-n .lane { font-style: italic; color: var(--muted); }
.tl-n .sep { color: var(--muted); opacity: 0.7; }
.tl-n .ind { width: 1.15rem; flex: none; }
.tl-tri { background: none; border: 0; color: var(--muted); width: 0.95rem; padding: 0; font: inherit; font-size: 0.8rem; cursor: pointer; flex: none; line-height: 1; }
.tl-tri:hover, .tl-tri:focus-visible { color: var(--accent-text); outline: none; }
.tl-n.band, .tl-fc.band { background: rgba(232, 235, 238, 0.045); }
.tl-r.band { background: rgba(232, 235, 238, 0.035); }
.tl-n.firstc, .tl-fc.firstc, .tl-r.firstc { box-shadow: inset 0 1px 0 var(--line); }
.tl-empty { margin: 1rem 0 0; }
.tl-note { margin-top: 0.8rem; }
.tl-in { animation: tl-in 200ms ease-out; }
@keyframes tl-in { from { opacity: 0; } to { opacity: 1; } }

/* bars: earlier grey, running teal, an Awaiting renewal dashed lime, projected fainter */
.tl-bar { position: absolute; top: 5px; height: 28px; border-radius: 5px; display: flex; align-items: center; gap: 0.5rem; padding: 0 0.55rem;
  font: inherit; font-size: 0.74rem; overflow: hidden; white-space: nowrap; z-index: 2; cursor: pointer; text-align: left; }
.tl-bar .what { overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; min-width: 0; }
.tl-bar .code { font-family: ui-monospace, monospace; font-size: 0.66rem; opacity: 0.75; flex: 0 100000 auto; min-width: 0; overflow: hidden; }   /* cut first */
.tl-bar.live { background: #137f80; border: 1px solid #1aa3a3; color: #eafafa; }
.tl-bar.live .code { color: #bfeeee; }
.tl-bar.past { background: #474b51; border: 1px solid #5a5f66; color: #c9cdd2; }
.tl-bar.renewal { background: rgba(166, 214, 90, 0.12); border: 1.5px dashed var(--renew); color: var(--renew); }
.tl-bar.proj { background: rgba(166, 214, 90, 0.05); border: 1.5px dashed rgba(166, 214, 90, 0.45); color: rgba(166, 214, 90, 0.6); font-style: italic; }
.tl-bar.cut, .tl-merged.cut, .tl-merged.cut .seg:first-child { border-top-left-radius: 0 !important; border-bottom-left-radius: 0 !important; }
.tl-bar.selected, .tl-bar:focus-visible { box-shadow: 0 0 0 2px #fff; outline: none; }
.tl-merged { position: absolute; top: 5px; height: 26px; z-index: 2; box-shadow: 0 4px 0 -1px rgba(232, 235, 238, 0.16); border-radius: 5px; overflow: hidden; }
.tl-merged .seg { position: absolute; top: 0; height: 26px; }
.tl-merged .seg.live { background: #137f80; }
.tl-merged .seg.past { background: #474b51; }
.tl-merged .seg.renewal { background: rgba(166, 214, 90, 0.12); outline: 1.5px dashed var(--renew); outline-offset: -1.5px; }
.tl-merged .seg.proj { background: rgba(166, 214, 90, 0.05); outline: 1.5px dashed rgba(166, 214, 90, 0.45); outline-offset: -1.5px; }
.tl-merged .seg.withren::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; border-bottom: 2.5px dashed var(--renew); }
.tl-merged .seam { position: absolute; top: 3px; bottom: 3px; width: 0; border-left: 1px solid rgba(0, 0, 0, 0.45); }
.tl-merged .seam span { position: absolute; top: -1px; left: 2px; font-size: 7px; line-height: 1; color: rgba(255, 255, 255, 0.75); }

/* pills: one month wide on the claim date; Multiple stacks right and down */
.tl-pill { position: absolute; top: 9px; height: 20px; border-radius: 10px; background: #b4bac0; z-index: 3; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35); border: 0; padding: 0;
  display: flex; align-items: center; justify-content: center; overflow: hidden; cursor: pointer; font: inherit; }
.tl-pill .pc { font-family: ui-monospace, monospace; font-size: 0.53rem; letter-spacing: -0.02em; color: #24272b; font-weight: 600; white-space: nowrap; }
.tl-pill.multi { box-shadow: 3px 3px 0 -1px #2a2d31, 3px 3px 0 0 #868c92, 0 1px 2px rgba(0, 0, 0, 0.35); }
.tl-pill.multi span { color: #24272b; font-size: 0.56rem; font-weight: 700; letter-spacing: 0.02em; }
.tl-pill.ren { background: rgba(166, 214, 90, 0.16); border: 1.5px dashed var(--renew); box-shadow: none; }
.tl-pill.ren .pc, .tl-pill.ren span { color: var(--renew); }
.tl-pill.ren.proj { background: rgba(166, 214, 90, 0.05); border-color: rgba(166, 214, 90, 0.45); }
.tl-pill.ren.proj .pc { color: rgba(166, 214, 90, 0.6); }
.tl-pill.ren.multi { box-shadow: 3px 3px 0 -1px #2a2d31, 3px 3px 0 0 rgba(166, 214, 90, 0.5); }
.tl-pill.selected, .tl-pill:hover, .tl-pill:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* invoice events */
.tl-dia { position: absolute; top: 28px; width: 9px; height: 9px; transform: rotate(45deg); z-index: 5; box-shadow: 0 0 0 1.5px #212326; cursor: default; }
.tl-dia.inv { background: #a3a8ae; }
.tl-dia.due { background: var(--warn); }
.tl-dia.over { background: #e0625a; }
.tl-dia.later { background: #212326; border: 1.5px solid #c9cdd2; box-sizing: border-box; }
.tl-dia:hover, .tl-dia:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.tl-dia-n { position: absolute; top: 27px; font-size: 0.6rem; line-height: 1; padding: 1px 3px; border-radius: 4px; background: #3a3e43; color: var(--text); z-index: 6; font-weight: 600; pointer-events: none; }

/* hovers and cards */
.tl-tip { position: absolute; z-index: 60; background: #2f3236; border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  padding: 0.45rem 0.8rem; font-size: 0.8rem; color: var(--text); pointer-events: none; }
.tl-tip.tip-pill { width: 340px; } .tl-tip.tip-events { width: 300px; padding: 0.35rem 0.75rem; } .tl-tip.tip-total { width: 260px; padding: 0.6rem 0.8rem; }
.pt-h { display: flex; justify-content: space-between; gap: 1rem; font-weight: 600; padding-bottom: 0.35rem; border-bottom: 1px solid var(--line); margin-bottom: 0.2rem; }
.pt-h span:last-child, .pt-a { font-variant-numeric: tabular-nums; }
.pt-i { display: grid; grid-template-columns: 1fr auto; gap: 0.05rem 0.6rem; padding: 0.35rem 0; }
.pt-i + .pt-i { border-top: 1px solid var(--line); }
.pt-a { font-weight: 600; text-align: right; }
.pt-s { color: var(--muted); font-size: 0.74rem; grid-column: 1 / -1; }
.pt-s code { font-family: ui-monospace, monospace; font-size: 0.7rem; } .pt-s code.ren { color: var(--renew); }
.dt-item { padding: 0.45rem 0; } .dt-item + .dt-item { border-top: 1px solid var(--line); }
.dt-top { display: flex; justify-content: space-between; font-weight: 600; }
.dt-code { font-family: ui-monospace, monospace; font-size: 0.72rem; color: var(--muted); font-weight: 400; }
.dt-what { color: var(--second); margin: 0.1rem 0 0.25rem; }
.dt-bot { display: flex; gap: 0.5rem; align-items: center; }
.dt-note { color: var(--muted); font-size: 0.74rem; flex: 1; }
.dt-amt { font-variant-numeric: tabular-nums; font-weight: 600; }
.dt-st { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.72rem; }
.dt-st i { width: 7px; height: 7px; transform: rotate(45deg); display: inline-block; }
.dt-st.inv i { background: #a3a8ae; } .dt-st.due i { background: var(--warn); } .dt-st.over i { background: #e0625a; }
.dt-st.later i { border: 1.5px solid #c9cdd2; box-sizing: border-box; }
.dt-st.due { color: var(--warn); } .dt-st.over { color: #f08a83; }
.tip-row { display: flex; justify-content: space-between; padding: 0.12rem 0 0.12rem 0.6rem; font-variant-numeric: tabular-nums; color: var(--second); }
.tip-row.head { padding-left: 0; color: var(--text); font-weight: 600; border-bottom: 1px solid var(--line); padding-bottom: 0.35rem; margin-bottom: 0.25rem; }
.tip-h { color: var(--muted); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; margin-top: 0.35rem; }
.tl-card { position: absolute; width: 430px; max-width: calc(100vw - 24px); background: #2f3236; border: 1px solid var(--line-strong); border-radius: 12px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5); padding: 0.85rem 1rem 0.75rem; z-index: 50; font-size: 0.84rem; color: var(--text); }
.tl-card::before { content: ''; position: absolute; top: -7px; left: var(--arrow, 40px); width: 12px; height: 12px; background: #2f3236;
  border-left: 1px solid var(--line-strong); border-top: 1px solid var(--line-strong); transform: rotate(45deg); }
.ov-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.6rem; }
.ov-title { font-weight: 600; font-size: 0.98rem; }
.ov-code { font-family: ui-monospace, monospace; font-size: 0.72rem; color: var(--muted); font-weight: 400; margin-left: 0.3rem; }
.ov-code.ren, .tl-card a.ren { color: var(--renew); font-family: ui-monospace, monospace; font-size: 0.76rem; }
.ov-sub { color: var(--muted); font-size: 0.8rem; margin: 0.15rem 0 0.6rem; }
.ov-row { display: grid; grid-template-columns: 88px 1fr; gap: 0.6rem; padding: 0.32rem 0; border-top: 1px solid var(--line); line-height: 1.35; }
.ov-row.ov-multi { grid-template-columns: 1fr auto; }
.ov-amt { font-variant-numeric: tabular-nums; font-weight: 600; }
.ov-l { color: var(--muted); font-size: 0.76rem; padding-top: 0.08rem; }
.tl-card .muted { color: var(--muted); }
.ov-note { font-size: 0.78rem; border-top: 1px solid var(--line); padding-top: 0.45rem; margin-top: 0.1rem; }
.ov-foot { border-top: 1px solid var(--line); padding-top: 0.5rem; margin-top: 0.1rem; text-align: right; }
.ov-foot a { color: var(--accent-text); text-decoration: none; font-weight: 500; }
.ov-pill { font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase; padding: 0.12rem 0.5rem; border-radius: 999px; border: 1.5px solid; white-space: nowrap; }
.ov-pill.red { color: #f08a83; border-color: #e0625a; }
.ov-pill.proj { color: rgba(166, 214, 90, 0.75); border-color: rgba(166, 214, 90, 0.5); border-style: dashed; }
.menu.tl-period-menu { min-width: 13rem; }
.tl-period-menu .menu-item .when { margin-left: auto; color: var(--muted); font-size: 0.78rem; }
@media (prefers-reduced-motion: reduce) { .tl-in { animation: none; } .tl-inner { transition: none !important; } }
.content.full { max-width: none; }   /* v46: the timeline uses the window's whole width */

/* v47: Performance › Accounting: Timeline's rows as a spreadsheet; every period column the same width */
.tl.ac { grid-template-columns: var(--tl-left) minmax(0, 1fr); }
.tl.ac .tl-r { box-shadow: inset 0 -1px 0 rgba(232, 235, 238, 0.05); }
.tl.ac .tl-r.firstc { box-shadow: inset 0 1px 0 var(--line), inset 0 -1px 0 rgba(232, 235, 238, 0.05); }
.tl.ac .tl-gl { background: rgba(232, 235, 238, 0.09); }
.ac-cell { position: absolute; top: 0; height: 38px; z-index: 2; display: flex; align-items: center; justify-content: flex-end;
           padding: 0 0.7rem; border: 0; background: none; font: inherit; font-size: 0.84rem; font-variant-numeric: tabular-nums;
           color: var(--text); cursor: pointer; }
.ac-cell:hover, .ac-cell.selected { background: rgba(0, 153, 153, 0.16); }
.ac-cell:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.tl.ac .tl-r.folded .ac-cell { font-weight: 600; }
.tl.ac .tl-r.tl-total .ac-cell { font-weight: 600; color: var(--accent-text); }
.ac-card .ov-row.ov-multi { align-items: start; }
.ac-card .tip-row { padding-left: 0.6rem; }
.ac-card .tip-row.head { padding-left: 0; }
.tl-card.up::before { display: none; }
.perf-box.switches .ac-export { justify-self: start; align-self: center; }

/* v47: the top bar's avatar 44 px (50 on hover, as the 1.14 grow above); the bar stays 60 px deep */
.topbar .avatar.sm { width: 44px; height: 44px; padding: 3px; border-width: 2px; }
.topbar .avatar.sm.initials { font-size: 1.03rem; }

/* v47: the Invoices list's code by where the invoice is: white still to do, Xero blue in Xero (darker: assigned by hand
   to an existing Xero invoice), teal credits applied, grey deleted */
.code.code-todo { color: var(--text); }
.code.code-xero { color: var(--xero); }
.code.code-xero-hand { color: #0b86b0; }
.code.code-applied { color: var(--accent-text); }
.code.code-deleted { color: var(--muted); }
.pill-quiet { display: inline; }

/* v47: the Dashboard's Invoice events box: Renewals' rows; plain white within 30 days; a quiet dashed tag for an
   invoice that isn't in Xero yet */
.ie-white { color: var(--text); }
.ie-flow { display: inline-block; margin-left: 0.45rem; font-size: 0.66rem; color: var(--muted); border: 1px dashed var(--line-strong);
           border-radius: 999px; padding: 0 0.42rem; vertical-align: 1px; white-space: nowrap; }
.ie-flow code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 0.64rem; margin-left: 0.25rem; color: var(--text);
                background: none; padding: 0; }
