/* The shared parts: buttons, chips, tabs, fields, tables, cards and their states, on the design tokens.
   Neutrals, status colors, type, radius and depth come from tokens.css (--hq-*); the company's own color comes as a
   scale (--brand-50 ... --brand-950, written in the page head). White surfaces lit from straight above on a light
   ground; the main button on a screen is charcoal, other actions are white and raised, a picked tab, filter or row is
   pressed in with the company's lightest shade, and a focused field rises to white with a ring in the company color.
   Typed colors stay out of this file except white, the dark-mode palette and a few color-mix() anchors. */

html[data-theme="light"], :root {
  --ce-bg: var(--hq-ground); --ce-surface: var(--hq-white); --ce-surface-2: var(--hq-tray); --ce-border: var(--hq-line);
  --ce-border-strong: rgba(var(--hq-ink), .14);
  --ce-text: var(--hq-charcoal); --ce-text-2: color-mix(in srgb, var(--hq-charcoal) 78%, var(--hq-slate)); --ce-muted: var(--hq-slate);
  --ce-subtle: var(--hq-slate);
  --ce-accent: var(--brand-text); --ce-accent-2: var(--brand-900); --ce-accent-soft: var(--brand-50);
  --ce-header: var(--hq-charcoal); --ce-header-2: color-mix(in srgb, var(--hq-white) 8%, var(--hq-charcoal)); --ce-header-text: var(--hq-white);
  --ce-ok: var(--hq-ok); --ce-warn: var(--hq-warn); --ce-bad: var(--hq-bad);
  --ce-radius: var(--hq-radius-card); --ce-radius-sm: var(--hq-radius-field);
  --ce-shadow: var(--hq-resting);
  --ce-shadow-lg: 0 0 0 1px rgba(var(--hq-ink), .08), 0 3px 6px -2px rgba(var(--hq-ink), .10), 0 20px 40px -16px rgba(var(--hq-ink), .30);
  --ce-font: var(--hq-font-body); --ce-font-display: var(--hq-font-display);
  /* the parts */
  --ce-main: var(--hq-charcoal); --ce-main-hover: color-mix(in srgb, var(--hq-white) 12%, var(--hq-charcoal)); --ce-on-main: var(--hq-white);
  --ce-raised: var(--hq-raised);
  --ce-pressed: inset 0 1px 2px rgba(var(--brand-rgb), .18), inset 0 0 0 1px rgba(var(--brand-rgb), .12);
  --ce-well: var(--hq-line); --ce-well-in: var(--hq-ground);
  --ce-well-shadow: var(--hq-well);
  --ce-focus: 0 0 0 2px var(--brand-ring), 0 2px 6px -2px rgba(var(--hq-ink), .14);
  --ce-pick: var(--brand-50); --ce-on-pick: var(--on-brand-50);  /* a picked tab, filter, row or chip */

  /* Django admin variables, mapped onto the system */
  --primary: var(--ce-main); --secondary: var(--ce-header); --accent: var(--hq-white); --primary-fg: var(--hq-white);
  --body-fg: var(--ce-text-2); --body-bg: var(--ce-bg); --body-quiet-color: var(--ce-muted); --body-loud-color: var(--ce-text);
  --header-color: var(--ce-header-text); --header-branding-color: var(--hq-white); --header-bg: var(--ce-header); --header-link-color: var(--ce-header-text);
  --breadcrumbs-fg: var(--ce-muted); --breadcrumbs-link-fg: var(--ce-text-2); --breadcrumbs-bg: transparent;
  --link-fg: var(--ce-accent); --link-hover-color: var(--ce-accent-2); --link-selected-fg: var(--ce-accent-2);
  --hairline-color: var(--ce-border); --border-color: var(--ce-border-strong);
  --darkened-bg: var(--ce-surface-2); --selected-bg: var(--brand-50); --selected-row: var(--brand-50);
  --button-fg: var(--ce-text); --button-bg: var(--hq-white); --button-hover-bg: var(--hq-tray);
  --default-button-bg: var(--ce-main); --default-button-hover-bg: var(--ce-main-hover);
  --close-button-bg: var(--hq-white); --close-button-hover-bg: var(--hq-tray);
  --delete-button-bg: var(--hq-bad); --delete-button-hover-bg: var(--hq-bad-text);
  --object-tools-fg: var(--ce-text); --object-tools-bg: var(--hq-white); --object-tools-hover-bg: var(--hq-tray);
  --message-success-bg: var(--hq-ok-bg); --message-warning-bg: var(--hq-warn-bg); --message-error-bg: var(--hq-bad-bg);
  --error-fg: var(--hq-bad-text);
  --font-family-primary: var(--ce-font);
}
html[data-theme="dark"] {
  /* dark mode: the product's one dark look, the crew app's and the TV boards' charcoal (tokens.css --hq-dark-*):
     a charcoal ground, cards one step up, fine light lines, white words, quieter words that read at 4.5:1 on any card,
     the company's color in its dark-ground shade, and the status words' dark shades on deep washes */
  --ce-bg: var(--hq-dark-ground); --ce-surface: var(--hq-dark-card); --ce-surface-2: var(--hq-dark-card-2);
  --ce-border: var(--hq-dark-line); --ce-border-strong: var(--hq-dark-rule);
  --ce-text: var(--hq-dark-text); --ce-text-2: var(--hq-dark-soft); --ce-muted: var(--hq-dark-quiet); --ce-subtle: var(--hq-dark-quiet);
  --ce-accent: var(--brand-on-dark); --ce-accent-2: var(--brand-200); --ce-accent-soft: rgba(var(--brand-rgb), .20);
  --ce-header: var(--hq-dark-ground); --ce-header-2: var(--hq-dark-card);
  --ce-ok: var(--hq-dark-ok); --ce-warn: var(--hq-dark-warn); --ce-bad: var(--hq-dark-bad);
  --ce-shadow: 0 0 0 1px var(--hq-dark-line), 0 1px 2px rgba(0,0,0,.4);
  --ce-shadow-lg: 0 0 0 1px var(--hq-dark-rule), 0 20px 40px -16px rgba(0,0,0,.6);
  --ce-main: var(--hq-dark-text); --ce-main-hover: var(--hq-dark-soft); --ce-on-main: var(--hq-dark-ground);
  --ce-raised: 0 0 0 1px var(--hq-dark-rule), 0 1px 2px rgba(0,0,0,.4);
  --ce-pressed: inset 0 1px 2px rgba(0,0,0,.4), inset 0 0 0 1px rgba(var(--brand-rgb), .35);
  --ce-pick: rgba(var(--brand-rgb), .24); --ce-on-pick: var(--hq-dark-text);
  --ce-well: var(--hq-dark-ground); --ce-well-in: var(--hq-dark-ground); --ce-well-shadow: inset 0 1px 2px rgba(0,0,0,.5), inset 0 0 0 1px var(--hq-dark-line);
  --ce-focus: 0 0 0 2px var(--brand-on-dark), 0 2px 6px -2px rgba(0,0,0,.4);
  --primary: var(--ce-main); --secondary: var(--ce-header);
  --body-fg: var(--ce-text-2); --body-bg: var(--ce-bg); --body-quiet-color: var(--ce-muted); --body-loud-color: var(--ce-text);
  --header-bg: var(--ce-header); --breadcrumbs-bg: transparent; --breadcrumbs-fg: var(--ce-muted); --breadcrumbs-link-fg: var(--ce-text-2);
  --link-fg: var(--ce-accent); --link-hover-color: var(--ce-accent-2); --hairline-color: var(--ce-border); --border-color: var(--ce-border-strong);
  --darkened-bg: var(--ce-surface-2); --selected-bg: rgba(var(--brand-rgb), .20); --selected-row: rgba(var(--brand-rgb), .16);
  --button-fg: var(--ce-text); --button-bg: var(--hq-dark-card-2); --button-hover-bg: color-mix(in srgb, var(--hq-dark-text) 8%, var(--hq-dark-card-2));
  --default-button-bg: var(--ce-main); --default-button-hover-bg: var(--ce-main-hover);
  --close-button-bg: var(--hq-dark-card-2); --close-button-hover-bg: color-mix(in srgb, var(--hq-dark-text) 8%, var(--hq-dark-card-2));
  --object-tools-fg: var(--ce-text-2); --object-tools-bg: var(--ce-surface); --object-tools-hover-bg: var(--ce-surface-2);
  --error-fg: var(--hq-dark-bad-text); --message-success-bg: var(--hq-dark-ok-bg); --message-warning-bg: var(--hq-dark-warn-bg); --message-error-bg: var(--hq-dark-bad-bg);
  /* the status tints, dark: a deep wash with a light word, so a warning doesn't glare */
  --hq-ok-bg: var(--hq-dark-ok-bg); --hq-ok-text: var(--hq-dark-ok); --hq-warn-bg: var(--hq-dark-warn-bg); --hq-warn-text: var(--hq-dark-warn);
  --hq-bad-bg: var(--hq-dark-bad-bg); --hq-bad-text: var(--hq-dark-bad);
}

/* ---------- base */
html, body { background: var(--ce-bg); }
body { font-family: var(--ce-font); font-size: var(--hq-text-body); color: var(--ce-text-2); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
h1, h2, h3, h4 { color: var(--ce-text); letter-spacing: -.01em; }
#content > h1, .ce-h1 { font: 700 26px/1.15 var(--ce-font-display); letter-spacing: -.015em; margin: 2px 0 16px; color: var(--ce-text); }
/* focus: a ring in the company color on everything that takes the keyboard */
a:focus-visible, button:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--brand-ring); outline-offset: 2px; }
a:link, a:visited { color: var(--link-fg); }
.ic { width: 16px; height: 16px; flex: none; vertical-align: -3px; stroke-width: 2; }  /* the set sets no line of its own: each place may set its weight */
.ic.lg { width: 20px; height: 20px; }
.muted { color: var(--ce-muted); }
.num { font-variant-numeric: tabular-nums; }

/* ---------- top bar */
#header.ce-top { display: flex; align-items: center; gap: 6px; padding: 0 16px; height: 52px; background: var(--ce-header);
  color: var(--ce-header-text); flex-wrap: nowrap; border-bottom: 1px solid rgba(255,255,255,.06); position: sticky; top: 0; z-index: 900; }
.ce-brand { display: flex; align-items: center; gap: 9px; color: #fff !important; text-decoration: none !important; font-weight: 700;
  font-size: 15px; letter-spacing: -.01em; margin-right: 10px; white-space: nowrap; }
.ce-mark { width: 26px; height: 26px; display: grid; flex: none; place-items: center; }
/* the mark's drawing (core/_mark.html): the lid, white with its ember dot, straight on the charcoal. It is the
   product's own mark: its colors are written into the drawing and the company color never touches it */
.hq-mark { display: block; width: 100%; height: 100%; }
.ce-nav { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; }
.ce-nav > .ce-dd > button, .ce-nav > a { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 7px;
  color: var(--ce-header-text) !important; text-decoration: none !important; font-size: 13.5px; font-weight: 500; background: none;
  border: 0; cursor: pointer; font-family: inherit; white-space: nowrap; }
.ce-nav > .ce-dd > button:hover, .ce-nav > a:hover, .ce-nav > .on, .ce-dd.open > button { background: rgba(255,255,255,.07); color: #fff !important; }
.ce-nav .ic { opacity: .85; }
.ce-dd { position: relative; }
.ce-menu { display: none; position: absolute; top: calc(100% + 6px); left: 0; min-width: 230px; background: var(--ce-surface);
  border: 0; border-radius: 14px; box-shadow: var(--ce-shadow-lg); padding: 6px; z-index: 950; }
.ce-menu.right { left: auto; right: 0; }
/* the initials menu holds Tools, Setup and Look & templates too, so a long menu scrolls inside the window */
.ce-menu { max-height: calc(100 * var(--ce-vh, 1vh) - 72px); overflow-y: auto; }
.ce-dd.open > .ce-menu { display: block; }
.ce-menu a, .ce-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 10px;
  color: var(--ce-text-2) !important; text-decoration: none !important; font-size: 13.5px; background: none; border: 0; cursor: pointer;
  font-family: inherit; text-align: left; }
.ce-menu a:hover, .ce-menu button:hover { background: var(--ce-surface-2); color: var(--ce-text) !important; }
.ce-menu .ic { color: var(--ce-muted); }
.ce-menu small { margin-left: auto; padding-left: 12px; flex: none; color: var(--ce-text); font-weight: 800; font-size: 12px; }
.ce-menu a, .ce-menu button { box-sizing: border-box; }  /* keeps counts inside the menu */
.ce-menu hr { border: 0; border-top: 1px solid var(--ce-border); margin: 6px 4px; }
.ce-menu .lbl { padding: 6px 10px 2px; font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--ce-subtle); font-weight: 600; }
.ce-badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--ce-bad); color: #fff; font-size: 12px;
  font-weight: 700; display: inline-grid; place-items: center; line-height: 1; }
.ce-badge.soft { background: var(--ce-accent-soft); color: var(--ce-accent); }
.ce-search { position: relative; width: clamp(180px, calc(22 * var(--ce-vw, 1vw)), 340px); margin: 0 6px; }
#header .ce-search input[type=search] { width: 100%; box-sizing: border-box; height: 34px; border-radius: 8px; border: 1px solid rgba(255,255,255,.11); background: rgba(255,255,255,.05);
  color: #fff; padding: 0 12px 0 34px; font: 13.5px var(--ce-font); outline: none; }
#header .ce-search input::placeholder { color: rgba(255,255,255,.6); }
#header .ce-search input[type=search]:focus { background: #fff; color: var(--ce-text); border-color: var(--ce-accent); }
.ce-search > .ic { position: absolute; left: 11px; top: 9px; color: rgba(255,255,255,.6); pointer-events: none; }
.ce-search kbd { position: absolute; right: 9px; top: 8px; font: 12px var(--ce-font); color: rgba(255,255,255,.6); border: 1px solid rgba(255,255,255,.14);
  border-radius: 4px; padding: 0 5px; }
.ce-results { display: none; position: absolute; top: 40px; left: 0; right: 0; min-width: 380px; background: var(--ce-surface);
  border: 0; border-radius: 14px; box-shadow: var(--ce-shadow-lg); padding: 6px; z-index: 960;
  max-height: calc(70 * var(--ce-vh, 1vh)); overflow: auto; }
.ce-results.show { display: block; }
.ce-results .grp { padding: 8px 10px 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--ce-subtle); font-weight: 600; }
.ce-results a { display: flex; gap: 10px; align-items: center; padding: 7px 10px; border-radius: 10px; color: var(--ce-text-2) !important;
  text-decoration: none !important; }
.ce-results a.act, .ce-results a:hover { background: var(--ce-accent-soft); }
.ce-results a span.s { margin-left: auto; color: var(--ce-subtle); font-size: 12px; white-space: nowrap; }
.ce-results .empty { padding: 14px; color: var(--ce-muted); }
.ce-iconbtn { position: relative; display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; color: var(--ce-header-text);
  background: none; border: 0; cursor: pointer; }
.ce-iconbtn:hover, .ce-dd.open > .ce-iconbtn { background: rgba(255,255,255,.07); color: #fff; }
.ce-iconbtn .ce-badge { position: absolute; top: 2px; right: 0; }
.ce-new { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 8px; background: var(--ce-accent);
  color: #fff; border: 0; font: 600 13px var(--ce-font); cursor: pointer; }
.ce-new:hover { background: var(--ce-accent-2); }
.ce-avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 700;
  border: 0; cursor: pointer; }
.ce-userhead { padding: 10px; border-bottom: 1px solid var(--ce-border); margin-bottom: 6px; }
.ce-userhead b { display: block; color: var(--ce-text); }
.ce-userhead span { font-size: 12px; color: var(--ce-muted); }
/* tighter bar on laptop screens: keep the words, drop the arrows, shrink search, brand mark only */
/* html.ce-narrow / ce-tight are set by ceFit from the *scaled* width (a media query would read the raw window). */
html.ce-narrow .ce-nav > .ce-dd > button .ic.sm { display: none; }
html.ce-narrow .ce-nav > .ce-dd > button, html.ce-narrow .ce-nav > a { padding: 7px 8px; gap: 6px; }
html.ce-narrow .ce-brand { font-size: 0; gap: 0; margin-right: 6px; }
html.ce-narrow .ce-search { width: clamp(150px, calc(15 * var(--ce-vw, 1vw)), 220px); }
html.ce-narrow .ce-search kbd { display: none; }
html.ce-tight .ce-nav > a span, html.ce-tight .ce-nav > .ce-dd > button span { display: none; }
@media (max-width: 760px) { .ce-search { display: none; } #header.ce-top { overflow-x: auto; flex-shrink: 0; } }

/* open-screen tabs */
#ce-tabs { display: flex; gap: 2px; overflow-x: auto; padding: 0 16px; background: var(--ce-header); border-bottom: 1px solid var(--ce-border);
  scrollbar-width: thin; }
#ce-tabs:empty { display: none; }
.ce-tab { flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 7px 10px 7px 12px; border-radius: 7px 7px 0 0; margin-top: 4px;
  color: rgba(255,255,255,.62) !important; font-size: 12.5px; font-weight: 500; text-decoration: none !important; white-space: nowrap; }
.ce-tab:hover { color: #fff !important; background: rgba(255,255,255,.05); }
.ce-tab.on { background: var(--ce-bg); color: var(--ce-text) !important; }
.ce-tab .x { opacity: .5; font-size: 14px; line-height: 1; padding: 0 3px; border-radius: 4px; }
.ce-tab .x:hover { opacity: 1; background: rgba(136,136,136,.13); }
@media (max-width: 760px) { #ce-tabs { display: none; } }

/* ---------- admin chrome */
div.breadcrumbs { padding: 12px 24px 0; background: transparent; color: var(--ce-muted); font-size: 12.5px; border: 0; }
div.breadcrumbs a { color: var(--ce-text-2); }
#content { padding: 18px 24px 32px; }
.module, fieldset.module, .inline-group { background: var(--ce-surface); border: 0; border-radius: var(--ce-radius);
  box-shadow: var(--ce-shadow); overflow: hidden; }
.module h2, .module caption, .inline-group h2, fieldset.module h2 { background: var(--ce-surface); color: var(--ce-text); font: 700 15px/1.3 var(--ce-font-display);
  letter-spacing: 0; text-transform: none; padding: 14px 18px; border-bottom: 1px solid var(--ce-border); }
.module caption a, .module h2 a { color: var(--ce-text) !important; }
#nav-sidebar { background: var(--ce-surface); border-right: 1px solid var(--ce-border); }
#nav-sidebar .module { border: 0; box-shadow: none; border-radius: 0; margin-bottom: 6px; background: transparent; }
#nav-sidebar .module caption { background: transparent; border: 0; padding: 12px 14px 4px; font: 600 12px var(--ce-font); text-transform: uppercase;
  letter-spacing: .07em; color: var(--ce-subtle); }
#nav-sidebar .module caption a { color: var(--ce-subtle) !important; }
#nav-sidebar th, #nav-sidebar td { border: 0; padding: 6px 14px; font-size: 13px; }
#nav-sidebar th a { color: var(--ce-text-2) !important; font-weight: 500; }
#nav-sidebar tr.current-model { background: var(--ce-accent-soft); box-shadow: var(--ce-pressed); }
#nav-sidebar tr.current-model th a { color: var(--ce-accent) !important; }
#nav-sidebar .addlink { font-size: 0; }
#nav-sidebar .addlink::before { font-size: 16px; }
#nav-filter { border-radius: var(--hq-radius-field); border: 0; margin: 10px; width: calc(100% - 20px); padding: 7px 10px; }
.toggle-nav-sidebar { background: var(--ce-surface); border-right: 1px solid var(--ce-border); }

/* ---------- fields: a well at rest; focused, it rises to white with a ring in the company color */
input[type=text], input[type=password], input[type=email], input[type=url], input[type=number], input[type=tel], input[type=date],
input[type=time], input[type=search], textarea, select, .vTextField { border: 0; border-radius: var(--hq-radius-field); min-height: 40px; box-sizing: border-box;
  padding: 8px 12px; font-family: var(--ce-font); background: var(--ce-well); color: var(--ce-text); box-shadow: var(--ce-well-shadow);
  transition: background .12s, box-shadow .12s; }
:is(.module, .inline-group, .ce-card, .ce-panel, .submit-row, #changelist-filter, .ce-menu, .ce-window, .ce-drawer, .ev-head) :is(input[type=text],
input[type=password], input[type=email], input[type=url], input[type=number], input[type=tel], input[type=date], input[type=time],
input[type=search], textarea, select, .vTextField) { background: var(--ce-well-in); }
textarea { min-height: 72px; line-height: 1.45; }
select { padding-right: 30px; }
input::placeholder, textarea::placeholder { color: var(--ce-muted); opacity: 1; }
input:focus, textarea:focus, select:focus, input:focus-visible, textarea:focus-visible, select:focus-visible {
  background: var(--ce-surface) !important; outline: 0 !important; border-color: transparent !important; box-shadow: var(--ce-focus) !important; }
input[type=checkbox], input[type=radio] { accent-color: var(--brand-700); }
input[type=checkbox]:focus-visible, input[type=radio]:focus-visible { outline: 2px solid var(--brand-ring); outline-offset: 2px; box-shadow: none !important; }
input:disabled, textarea:disabled, select:disabled { opacity: .6; cursor: not-allowed; }
.errors input, .errors select, .errors textarea, .errorlist + * input { box-shadow: 0 0 0 2px var(--hq-bad) !important; }
ul.errorlist li { color: var(--hq-bad-text); background: var(--hq-bad-bg); border-radius: 8px; padding: 4px 10px; font-size: 13px; font-weight: 600; }
.help, .help-tooltip { color: var(--ce-muted); }

/* ---------- buttons: pills. The main one is charcoal, the rest white and raised; pressed, they go down 1px. A <button> with
   no class of its own, or only "default", is one too (at no weight, so a screen's own button rules still win). */
.button, input[type=submit], input[type=button], .submit-row input, a.button, button.button, .submit-row a.closelink,
:where(#content button:not([class]), #content button.default) {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; box-sizing: border-box; border: 0;
  border-radius: 999px; font: 600 13.5px var(--ce-font); padding: 0 18px; cursor: pointer; text-transform: none; letter-spacing: 0;
  background: var(--ce-surface); color: var(--ce-text); box-shadow: var(--ce-raised); transition: transform .08s, box-shadow .08s, background .12s; }
.button:hover, input[type=submit]:hover, input[type=button]:hover, a.button:hover, button.button:hover, .submit-row a.closelink:hover,
:where(#content button:not([class]):hover) {
  background: var(--ce-surface-2); color: var(--ce-text); }
.button.default, input[type=submit].default, .submit-row input.default, #changelist-search input[type=submit], #toolbar form input[type=submit],
:where(#content button.default) {
  background: var(--ce-main); color: var(--ce-on-main);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), inset 0 -1px 0 rgba(var(--hq-ink), .20), 0 1px 2px rgba(var(--hq-ink), .30), 0 6px 14px -6px rgba(var(--hq-ink), .45); }
.button.default:hover, input[type=submit].default:hover, .submit-row input.default:hover, #changelist-search input[type=submit]:hover,
#toolbar form input[type=submit]:hover, :where(#content button.default:hover) { background: var(--ce-main-hover); color: var(--ce-on-main); }
.button:active, input[type=submit]:active, input[type=button]:active, a.button:active, button.button:active,
:where(#content button:not([class]):active, #content button.default:active) {
  transform: translateY(1px); box-shadow: inset 0 1px 2px rgba(var(--hq-ink), .18), 0 0 0 1px rgba(var(--hq-ink), .08) !important; }
.button:disabled, input[type=submit]:disabled, input[type=button]:disabled, .button.disabled {
  background: var(--ce-surface-2) !important; color: var(--ce-muted) !important; box-shadow: none !important; transform: none; cursor: not-allowed; }
.submit-row a.deletelink, a.deletelink:link, a.deletelink:visited { display: inline-flex; align-items: center; min-height: 40px; box-sizing: border-box;
  border-radius: 999px; padding: 0 18px; background: var(--hq-bad); color: #fff !important; font: 600 13.5px var(--ce-font); text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 1px 2px rgba(var(--hq-ink), .25); }
.submit-row a.deletelink:hover { background: var(--hq-bad-text); }
html .submit-row a.deletelink { display: inline-flex; align-items: center; border-radius: 999px; height: auto; min-height: 40px; padding: 0 18px; line-height: 1; }
.ce-delete-foot { display: none; }  /* the foot-of-form Delete is for phones (below); computers keep Delete in the Save bar */
.submit-row { background: var(--ce-surface-2); border: 0; border-radius: var(--ce-radius); box-shadow: inset 0 1px 0 var(--ce-border); padding: 12px 16px;
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.submit-row input, .submit-row a { margin: 0 !important; height: auto; }

/* the practice-copy and updating bands at the top of a page: a flat warning tint */
.ce-banner { background: var(--hq-warn-bg); color: var(--hq-warn-text); box-shadow: inset 0 -1px 0 rgba(138,90,0,.14); padding: 5px 20px;
  font-size: 13px; text-align: center; }
.ce-banner-strong { padding: 8px 20px; font-weight: 700; text-align: left; }

/* Django's own pieces that load after this file (changelists.css, forms.css) or set their own borders: "html" in front
   so the shared parts win */
html fieldset .fieldset-heading, html fieldset .inline-heading, html :not(.inline-related) .collapse summary {
  border: 0; border-bottom: 1px solid var(--ce-border); background: var(--ce-surface); color: var(--ce-text);
  font: 700 15px/1.3 var(--ce-font-display); padding: 14px 18px; }
html #toolbar form input[type="submit"] { min-height: 40px; padding: 0 18px; border: 0; border-radius: 999px; background: var(--ce-main);
  color: var(--ce-on-main); font: 600 13.5px var(--ce-font);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 1px 2px rgba(var(--hq-ink), .30), 0 6px 14px -6px rgba(var(--hq-ink), .45); }
html #toolbar form input[type="submit"]:hover, html #toolbar form input[type="submit"]:focus { background: var(--ce-main-hover); }
html #changelist .actions { border-radius: var(--ce-radius) var(--ce-radius) 0 0; background: var(--ce-surface-2); }
html #changelist .actions .button, html #changelist .actions button { min-height: 36px; padding: 0 16px; border: 0; border-radius: 999px;
  background: var(--ce-surface); color: var(--ce-text); box-shadow: var(--ce-raised); font: 600 13px var(--ce-font); }
html #changelist-filter h2 { text-transform: none; letter-spacing: 0; font: 700 15px var(--ce-font-display); padding: 14px 16px 10px; }
html #changelist-filter h3 { font: 600 12px var(--ce-font); text-transform: uppercase; letter-spacing: .07em; color: var(--ce-subtle); }
html #changelist-filter li.selected { border-left: 0; padding-left: 0; margin-left: 0; }
html #changelist-filter li.selected a { color: var(--ce-on-pick); }
html #changelist-filter details summary { color: var(--ce-text); font-weight: 600; }
/* the lookup boxes (select2) read as fields too */
html .select2-container--admin-autocomplete .select2-selection { min-height: 40px; border: 0; border-radius: var(--hq-radius-field);
  background: var(--ce-well-in); box-shadow: var(--ce-well-shadow); }
html .select2-container--admin-autocomplete .select2-selection--single .select2-selection__rendered { line-height: 40px; padding-left: 12px; color: var(--ce-text); }
html .select2-container--admin-autocomplete .select2-selection--single .select2-selection__arrow { height: 38px; }
html .select2-container--admin-autocomplete.select2-container--focus .select2-selection,
html .select2-container--admin-autocomplete.select2-container--open .select2-selection { background: var(--ce-surface); box-shadow: var(--ce-focus); }
html .select2-container--admin-autocomplete .select2-dropdown { border: 0; border-radius: 14px; box-shadow: var(--ce-shadow-lg); overflow: hidden; }
html .select2-container--admin-autocomplete .select2-results__option--highlighted[aria-selected] { background: var(--ce-pick); color: var(--ce-on-pick); }

/* ---------- lists: cards at rest, quiet heads, hairlines, the picked row pressed in */
#changelist .actions, #changelist-filter, #changelist .paginator { background: var(--ce-surface); }
#changelist-filter { border: 0; border-radius: var(--ce-radius); box-shadow: var(--ce-shadow); }
#changelist-filter h2 { background: transparent; color: var(--ce-text); text-transform: none; font: 700 15px var(--ce-font-display); border-bottom: 1px solid var(--ce-border); }
#changelist-filter h3 { font: 600 12px var(--ce-font); text-transform: uppercase; letter-spacing: .07em; color: var(--ce-subtle); }
#changelist-filter li a { border-radius: 8px; padding: 4px 8px; }
#changelist-filter li.selected a { color: var(--ce-accent) !important; background: var(--ce-accent-soft); box-shadow: var(--ce-pressed); }
#changelist .results, #changelist .changelist-form-container > div:has(> #result_list) { border-radius: var(--ce-radius); }
#result_list { background: var(--ce-surface); box-shadow: var(--ce-shadow); border-radius: var(--ce-radius); overflow: hidden; border-collapse: separate; border-spacing: 0; }
#changelist table thead th { background: var(--ce-surface-2); color: var(--ce-muted); font: 600 12.5px var(--ce-font); text-transform: none;
  letter-spacing: 0; border-bottom: 1px solid var(--ce-border); }
#changelist table thead th a { color: var(--ce-muted) !important; }
#changelist table tbody tr:hover td, #changelist table tbody tr:hover th { background: var(--ce-surface-2); }
#changelist table tbody tr.selected td, #changelist table tbody tr.selected th { background: var(--selected-row); }
#result_list td, #result_list th { border-bottom: 1px solid var(--ce-border); padding: 10px 16px; font-size: 13.5px; vertical-align: middle; }
#result_list tbody tr:last-child td, #result_list tbody tr:last-child th { border-bottom: 0; }
#toolbar { background: transparent; border: 0; padding: 0 0 10px; }
#toolbar form input[type=text] { width: min(420px, calc(60 * var(--ce-vw, 1vw))); height: 40px; border-radius: 999px; padding-left: 16px; }
#changelist .toplinks { padding: 6px 14px 10px; display: flex; flex-wrap: wrap; gap: 4px 18px; }
#changelist .toplinks a { margin: 0; }
/* Age of open proposals and prospects: amber, then red */
.ce-age { white-space: nowrap; }
.ce-age-warn { color: var(--hq-warn-text); font-weight: 800; }
.ce-age-late { color: var(--hq-bad); font-weight: 800; }
html[data-theme="dark"] .ce-age-late { color: var(--hq-bad-text); }
/* words in one of the tones (a giveaway's kind): the tone on white, lifted toward the words on charcoal */
.ce-tone { color: var(--k); }
html[data-theme="dark"] .ce-tone { color: color-mix(in srgb, var(--k) 50%, var(--ce-text)); }
.object-tools a:link, .object-tools a:visited { background: var(--ce-surface); color: var(--ce-text); border: 0; box-shadow: var(--ce-raised);
  border-radius: 999px; text-transform: none; letter-spacing: 0; font: 600 13px var(--ce-font); padding: 0 16px; min-height: 36px; display: inline-flex;
  align-items: center; box-sizing: border-box; }
.object-tools a:hover { background: var(--ce-surface-2); }
.object-tools a.addlink { background: var(--ce-main); color: var(--ce-on-main); box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 1px 2px rgba(var(--hq-ink), .30); }
.object-tools a.addlink:hover { background: var(--ce-main-hover); }
/* messages and warnings: flat tints, never raised */
ul.messagelist li { border-radius: 12px; margin: 0 24px 8px; font-size: 13.5px; font-weight: 600; box-shadow: none; border: 0;
  background: var(--hq-ok-bg); color: var(--hq-ok-text); padding: 10px 14px 10px 40px; background-position: 14px center; }
ul.messagelist li.warning { background-color: var(--hq-warn-bg); color: var(--hq-warn-text); }
ul.messagelist li.error { background-color: var(--hq-bad-bg); color: var(--hq-bad-text); }
.errornote { border: 0; border-radius: 12px; background: var(--hq-bad-bg); color: var(--hq-bad-text); font-weight: 600; padding: 10px 14px; }
.paginator { color: var(--ce-muted); }
.paginator a:link, .paginator a:visited { border-radius: 999px; background: var(--ce-surface); color: var(--ce-text); box-shadow: var(--ce-raised); padding: 4px 10px; }
.paginator .this-page { border-radius: 999px; background: var(--ce-accent-soft); color: var(--ce-accent); box-shadow: var(--ce-pressed); padding: 4px 10px; }
.aligned label { color: var(--ce-text-2); font-weight: 600; }
.form-row { border-bottom: 1px solid var(--ce-border); }
.inline-group .tabular td, .inline-group .tabular th { border-bottom: 1px solid var(--ce-border); }
.inline-group .tabular thead th { background: var(--ce-surface-2); color: var(--ce-muted); font: 600 12.5px var(--ce-font); text-transform: none; letter-spacing: 0; }
#footer { display: none; }

/* ---------- chips. A status, venue or department chip (it carries its own --c) is a colored dot and the word; a
   plain chip (no --c) is a pill in the company's lightest shade. The labels rule further down sets the dot form. */
.chip:not([style*="--c"]), .ce-chip { display: inline-flex !important; align-items: center; gap: 6px; padding: 4px 10px !important; border-radius: 999px !important;
  font: 600 12px/1.3 var(--ce-font) !important; text-transform: none !important; letter-spacing: 0 !important; white-space: nowrap;
  background: var(--ce-pick) !important; color: var(--ce-on-pick) !important; box-shadow: inset 0 0 0 1px var(--brand-100) !important; }

/* status chips and notes: flat tints in the status colors, which never change with the company color. A quiet chip
   is a neutral state ("none yet"). A note is a flat tinted line or box: a warning, a done, a problem or a plain aside. */
.ce-chip.ok { background: var(--hq-ok-bg) !important; color: var(--hq-ok-text) !important; box-shadow: none !important; }
.ce-chip.warn { background: var(--hq-warn-bg) !important; color: var(--hq-warn-text) !important; box-shadow: none !important; }
.ce-chip.bad { background: var(--hq-bad-bg) !important; color: var(--hq-bad-text) !important; box-shadow: none !important; }
.ce-chip.quiet { background: var(--ce-surface-2) !important; color: var(--ce-muted) !important; box-shadow: inset 0 0 0 1px var(--ce-border) !important; }
.ce-note { padding: 10px 14px; border-radius: 12px; font-size: 13.5px; line-height: 1.45; background: var(--ce-surface-2); color: var(--ce-text-2); }
.ce-note.warn { background: var(--hq-warn-bg); color: var(--hq-warn-text); }
.ce-note.ok { background: var(--hq-ok-bg); color: var(--hq-ok-text); }
.ce-note.bad { background: var(--hq-bad-bg); color: var(--hq-bad-text); }
.ce-note.info { background: var(--ce-pick); color: var(--ce-on-pick); }
/* someone else saved first: the box above a form that says what clashed (admin/_ce_editguard.html, the BEO designer) */
.ce-conflict { background: var(--hq-bad-bg); color: var(--hq-bad-text); border: 0; border-radius: 14px; padding: 12px 16px; margin: 0 0 14px; font-size: 13.5px; }
.ce-conflict b { color: inherit; }
.ce-conflict table { margin: 8px 0; border-collapse: collapse; font-size: 13px; }
.ce-conflict th { text-align: left; padding: 2px 12px 2px 0; font-weight: 600; background: none; color: inherit; }
.ce-conflict td { padding: 2px 12px 2px 0; border: 0; background: none; }
.ce-conflict > a { margin-left: 10px; font-weight: 700; color: inherit !important; }
.ce-conflict .keep { background: var(--hq-bad); color: var(--hq-white); border: 0; border-radius: 999px; min-height: 34px; padding: 0 16px; font-weight: 600; cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 1px 2px rgba(var(--hq-ink), .25); }
/* a field's label above its box (the label wraps the box) */
.ce-fl { display: grid; gap: 4px; font: 600 13px/1.3 var(--ce-font); color: var(--ce-text-2); }
/* a card's quiet section label (BEER, SPIRITS, OWNED VENUES) and a dashed "add one" button */
.ce-label { font: 600 12px/1.3 var(--ce-font); text-transform: uppercase; letter-spacing: .07em; color: var(--ce-subtle); }
.ce-add { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 14px; border: 1px dashed var(--ce-border-strong);
  border-radius: 999px; background: transparent; color: var(--ce-text-2); font: 600 13px var(--ce-font); cursor: pointer; }
.ce-add:hover { border-color: var(--brand-500); color: var(--ce-accent); background: var(--ce-accent-soft); }

/* ---------- cards & widgets (shared by dashboard, reports, fleet) */
/* ---------- cards: white at rest, lit from above, a hairline ring and no border */
.ce-card { background: var(--ce-surface); border: 0; border-radius: var(--ce-radius); box-shadow: var(--ce-shadow); }
.ce-card > header { display: flex; align-items: center; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--ce-border); }
.ce-card > header h3 { margin: 0; font: 700 15px/1.3 var(--ce-font-display); color: var(--ce-text); }
.ce-card > header > .ic { display: none; }
.ce-card > header .tools { margin-left: auto; display: flex; gap: 6px; align-items: center; font-size: 12.5px; }
.ce-card > header .tools a { color: var(--ce-accent); font-weight: 600; text-decoration: none; }
.ce-card > header .tools a:hover { color: var(--ce-accent-2); }
.ce-card .body { padding: 14px 18px; }
.ce-list { list-style: none; margin: 0; padding: 0; }
.ce-list > li, .ce-list > a { display: flex; align-items: center; gap: 10px; padding: 11px 18px; border-top: 1px solid var(--ce-border);
  color: var(--ce-text-2); text-decoration: none; font-size: 13.5px; }
.ce-list > li:first-child, .ce-list > a:first-child { border-top: 0; }
.ce-list > a:hover, .ce-list > li:hover { background: var(--ce-surface-2); }
.ce-list .r { margin-left: auto; text-align: right; white-space: nowrap; color: var(--ce-muted); font-size: 12.5px; }
.ce-list .t { font-weight: 550; color: var(--ce-text); }
.ce-list .r.wrap { white-space: normal; min-width: 0; }  /* a long right-hand note may wrap instead of running off a phone */
.ce-list .sub { font-size: 12.5px; color: var(--ce-muted); }
.ce-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--ce-subtle)); flex: none; }
/* empty: a well */
.ce-empty { margin: 10px 14px; padding: 20px 14px; color: var(--ce-muted); text-align: center; font-size: 13px; font-weight: 600;
  background: var(--ce-well-in); box-shadow: var(--ce-well-shadow); border-radius: 14px; }
.ce-stat { padding: 14px 16px; }
.ce-stat .k { font-size: 12.5px; color: var(--ce-muted); display: flex; align-items: center; gap: 6px; }
.ce-stat .v { font: 700 24px/1.15 var(--ce-font-display); color: var(--ce-text); letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.ce-stat .d { font-size: 12px; margin-top: 2px; color: var(--ce-muted); }
.ce-stat .d.up { color: var(--ce-ok); } .ce-stat .d.down { color: var(--ce-bad); }
/* the app's own buttons: white raised pills; .primary is the screen's main one (charcoal); .ghost is a quiet link-like one */
.ce-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 999px; border: 0;
  background: var(--ce-surface); color: var(--ce-text) !important; box-shadow: var(--ce-raised); font: 600 13px var(--ce-font);
  text-decoration: none !important; cursor: pointer; box-sizing: border-box; transition: transform .08s, box-shadow .08s, background .12s; }
.ce-btn:hover { background: var(--ce-surface-2); }
.ce-btn:active { transform: translateY(1px); box-shadow: inset 0 1px 2px rgba(var(--hq-ink), .18), 0 0 0 1px rgba(var(--hq-ink), .08); }
.ce-btn.primary { background: var(--ce-main); color: var(--ce-on-main) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), inset 0 -1px 0 rgba(var(--hq-ink), .20), 0 1px 2px rgba(var(--hq-ink), .30), 0 6px 14px -6px rgba(var(--hq-ink), .45); }
.ce-btn.primary:hover { background: var(--ce-main-hover); }
.ce-btn.ghost { background: transparent; box-shadow: none; color: var(--ce-accent) !important; }
.ce-btn.ghost:hover { background: var(--ce-accent-soft); }
.ce-btn.danger { background: var(--hq-bad); color: #fff !important; box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 1px 2px rgba(var(--hq-ink), .25); }
.ce-btn:disabled, .ce-btn[aria-disabled="true"] { background: var(--ce-surface-2); color: var(--ce-muted) !important; box-shadow: none; transform: none; cursor: not-allowed; }
/* a row of choices (tabs, filters, Everyone / Just mine): pills in a well; the picked one pressed in */
.ce-seg { display: inline-flex; gap: 2px; padding: 3px; border: 0; border-radius: 999px; background: var(--ce-well); box-shadow: var(--ce-well-shadow); }
.ce-seg a, .ce-seg button { display: inline-flex; align-items: center; min-height: 30px; padding: 0 12px; border-radius: 999px; font: 600 12.5px var(--ce-font);
  color: var(--ce-muted) !important; text-decoration: none !important; background: transparent; border: 0; cursor: pointer; box-sizing: border-box; }
.ce-seg a:hover, .ce-seg button:hover { color: var(--ce-text) !important; }
.ce-seg .on { background: var(--ce-pick); color: var(--ce-on-pick) !important; box-shadow: var(--ce-pressed); }
.ce-pagehead { display: flex; align-items: flex-end; gap: 12px 16px; flex-wrap: wrap; margin: 0 0 18px; }
.ce-pagehead h1 { margin: 0; font: 700 28px/1.1 var(--ce-font-display); letter-spacing: -.02em; color: var(--ce-text); }
.ce-pagehead .sub { color: var(--ce-muted); font-size: 13.5px; margin-top: 3px; }
.ce-pagehead .right { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ce-pagehead .ce-btn .ic { stroke-width: 1.75; }  /* an icon beside a word in a button */
a.peek { color: inherit; text-decoration: none; border-bottom: 1px dotted color-mix(in srgb, currentColor 45%, transparent); }
a.peek:hover { color: var(--ce-accent) !important; border-bottom-color: var(--ce-accent); }
.ce-list a.peek, .ce-list .t a.peek { border-bottom: 0; }

/* ---------- quick-look popup (peek) + window popup */
.ce-scrim { position: fixed; inset: 0; background: rgba(var(--hq-ink),.38); backdrop-filter: blur(1px); z-index: 1000; opacity: 0;
  transition: opacity .12s; pointer-events: none; }
.ce-scrim.show { opacity: 1; pointer-events: auto; }
.ce-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, calc(96 * var(--ce-vw, 1vw))); background: var(--ce-surface); z-index: 1001;
  box-shadow: var(--ce-shadow-lg); transform: translateX(102%); transition: transform .16s ease; display: flex; flex-direction: column;
  border-left: 1px solid var(--ce-border); }
.ce-drawer.show { transform: none; }
.ce-drawer > header { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--ce-border); }
.ce-drawer > header .k { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--ce-subtle); font-weight: 600; }
.ce-drawer > header .sp { flex: 1; }
.ce-drawer .scroll { overflow: auto; flex: 1; }
.ce-window { position: fixed; inset: calc(4 * var(--ce-vh, 1vh)) calc(4 * var(--ce-vw, 1vw)); background: var(--ce-surface); z-index: 1002; border-radius: var(--ce-radius); box-shadow: var(--ce-shadow-lg);
  display: none; flex-direction: column; overflow: hidden; border: 0; }
.ce-window.show { display: flex; }
/* The Event Quick Look (quick add / event summary): about two thirds of the screen; full screen on a phone */
.ce-window[data-size="quick-look"] { inset: calc(5 * var(--ce-vh, 1vh)) max(calc(14 * var(--ce-vw, 1vw)), calc(50vw - 640px)); }
@media (max-width: 760px) { .ce-window[data-size="quick-look"] { inset: 0; border-radius: 0; } }
.ce-window > header { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-bottom: 1px solid var(--ce-border); background: var(--ce-surface-2); }
.ce-window > header b { font-size: 13.5px; color: var(--ce-text); }
.ce-window iframe { flex: 1; border: 0; width: 100%; background: #fff; }
.pk-head { padding: 18px 18px 12px; }
.pk-head .eyebrow { font-size: 12px; color: var(--ce-muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pk-head h2 { margin: 6px 0 4px; font: 700 20px/1.2 var(--ce-font-display); letter-spacing: -.01em; color: var(--ce-text); }
.pk-head.who { display: flex; gap: 14px; align-items: center; }
.pk-head.who h2 { margin: 4px 0 0; }
.pk-head .ce-avatar.big { width: 52px; height: 52px; font-size: 18px; flex: none; }
.pk-head .pre, .pk-note { white-space: pre-line; }
.pk-note { padding: 0 18px 14px; }
.pk-alert { margin: 0 18px 12px; padding: 9px 14px; border-radius: 12px; background: var(--hq-bad-bg); color: var(--hq-bad-text); font-weight: 600; font-size: 13px; }
.pk-chips { padding: 0 18px 10px; display: flex; gap: 6px 10px; flex-wrap: wrap; align-items: center; }
.pk-chips .ce-btn { height: 26px; font-size: 12px; padding: 0 10px; }
.pk-photos { display: flex; gap: 6px; padding: 0 18px 12px; flex-wrap: wrap; }
.pk-photos img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; }
.pk-photos .muted { font-size: 12.5px; }
.pk-actions .ce-btn .ic { stroke-width: 1.75; }
.pk-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 18px 14px; }
.pk-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--ce-border); }
.pk-grid > div { padding: 10px 18px; border-bottom: 1px solid var(--ce-border); }
.pk-grid > div:nth-child(odd) { border-right: 1px solid var(--ce-border); }
.pk-grid .k { font-size: 12px; color: var(--ce-muted); }
.pk-grid .v { font-size: 13.5px; color: var(--ce-text); font-weight: 500; margin-top: 2px; word-break: break-word; }
.pk-sec { padding: 14px 18px 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--ce-subtle); font-weight: 600; }
.pk-money { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border-top: 1px solid var(--ce-border); border-bottom: 1px solid var(--ce-border); }
.pk-money > div { padding: 12px 18px; border-right: 1px solid var(--ce-border); }
.pk-money > div:last-child { border-right: 0; }
.pk-money .k { font-size: 12px; color: var(--ce-muted); }
.pk-money .v { font: 700 16px/1.3 var(--ce-font-display); color: var(--ce-text); font-variant-numeric: tabular-nums; }
.pk-money .v.sm { font: 600 13.5px/1.4 var(--ce-font); }
.pk-money .v.owed { color: var(--hq-bad-text); }
.pk-grid .v .muted { font-weight: 400; }
.pk-grid > .wide { grid-column: 1 / -1; border-right: 0; }
.pk-photo { width: 100%; max-height: 220px; object-fit: cover; border-bottom: 1px solid var(--ce-border); }
.pk-loading { padding: 40px; text-align: center; color: var(--ce-muted); }

/* ---------- dashboard grid */
/* Home: two equal columns with one shared middle gutter; a card is Half or Full. Cards side by side match heights. */
.ce-dash { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(12px, calc(1.2 * var(--ce-vw, 1vw)), 20px); align-items: stretch; }
.ce-w { grid-column: span 1; min-width: 0; position: relative; display: flex; flex-direction: column; }
.ce-w[data-w="12"] { grid-column: 1 / -1; }
.ce-w[hidden] { display: none !important; }  /* widgets turned off in Customize stay off */
.ce-w > .ce-card { flex: 1; display: flex; flex-direction: column; min-height: 0; }
html.ce-onecol .ce-dash { grid-template-columns: minmax(0, 1fr); }
.ce-dash.editing .ce-w { outline: 2px dashed var(--ce-border-strong); outline-offset: 3px; border-radius: var(--ce-radius); cursor: grab; }
.ce-dash.editing .ce-w.drag { opacity: .45; }
.ce-dash.editing .ce-w.over { outline-color: var(--ce-accent); }
.ce-wtools { display: none; position: absolute; top: 8px; right: 8px; z-index: 5; gap: 4px; background: var(--ce-surface); border: 0;
  border-radius: 999px; padding: 3px; box-shadow: var(--ce-raised); }
.ce-dash.editing .ce-wtools { display: flex; }
.ce-wtools button { border: 0; background: none; color: var(--ce-muted); cursor: pointer; padding: 4px 10px; border-radius: 999px; font: 600 12px var(--ce-font); }
.ce-wtools button:hover, .ce-wtools button.on { background: var(--ce-pick); color: var(--ce-on-pick); box-shadow: var(--ce-pressed); }
.ce-dash.editing .ce-card { pointer-events: none; }
.ce-panel { display: none; margin-bottom: 16px; }
.ce-panel.show { display: block; }
.ce-panel .opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; padding: 12px 14px; }
.ce-panel label { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 0; border-radius: 12px; cursor: pointer;
  font-size: 13px; color: var(--ce-text-2); background: var(--ce-surface-2); box-shadow: inset 0 0 0 1px var(--ce-border); }
.ce-panel label:has(input:checked) { background: var(--ce-pick); color: var(--ce-on-pick); box-shadow: var(--ce-pressed); }
.ce-panel label:hover { background: var(--ce-surface-2); }
.ce-ring { --p: 0; width: 84px; height: 84px; border-radius: 50%; background: conic-gradient(var(--rc, var(--ce-accent)) calc(var(--p) * 1%), var(--ce-border) 0);
  display: grid; place-items: center; flex: none; }
.ce-ring > div { width: 68px; height: 68px; border-radius: 50%; background: var(--ce-surface); display: grid; place-items: center; font-weight: 700;
  color: var(--ce-text); font-size: 16px; }
.ce-bar { height: 6px; border-radius: 999px; background: var(--ce-border); overflow: hidden; }
.ce-bar > i { display: block; height: 100%; background: var(--c, var(--ce-accent)); border-radius: 999px; }
.ce-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; padding: 12px 14px; }
.ce-week > a { border: 0; border-radius: 14px; padding: 8px; text-decoration: none; color: var(--ce-text-2); min-height: 64px; box-shadow: inset 0 0 0 1px var(--ce-border); }
.ce-week > a:hover { box-shadow: inset 0 0 0 1px var(--brand-300); }
.ce-week .d { font-size: 12px; color: var(--ce-muted); }
.ce-week .n { font: 700 20px var(--ce-font-display); color: var(--ce-text); }
.ce-week .today { background: var(--ce-pick); box-shadow: var(--ce-pressed); }
.ce-week .bars { display: flex; gap: 2px; margin-top: 6px; flex-wrap: wrap; }
.ce-week .bars i { width: 8px; height: 8px; border-radius: 2px; background: var(--c); }
.ce-quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; padding: 12px 14px; }
.ce-quick a { display: flex; align-items: center; gap: 9px; padding: 10px; border: 1px solid var(--ce-border); border-radius: 8px; text-decoration: none;
  color: var(--ce-text-2) !important; font-size: 13px; font-weight: 550;
  background: var(--ce-surface); box-shadow: 0 1px 2px rgba(var(--hq-ink), .06), 0 2px 5px rgba(var(--hq-ink), .08);
  transition: box-shadow .15s ease, transform .15s ease, border-color .15s ease; }
.ce-quick a:hover { border-color: var(--ce-accent); background: var(--ce-accent-soft); color: var(--ce-accent) !important;
  box-shadow: 0 3px 6px rgba(var(--hq-ink), .08), 0 6px 14px rgba(var(--hq-ink), .10); transform: translateY(-1px); }
.ce-quick a:active { box-shadow: 0 1px 2px rgba(var(--hq-ink), .08); transform: translateY(0); }
.ce-quick a .ic { color: var(--qc, var(--ce-muted)); }
.ce-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.ce-kpis > a { border-right: 1px solid var(--ce-border); text-decoration: none; color: inherit; }
.ce-kpis > a:last-child { border-right: 0; }
.ce-kpis > a:hover { background: var(--ce-surface-2); }

/* inside a popup window (iframe): no app chrome, the page reads like a dialog */
html.ce-in-window #header, html.ce-in-window #ce-tabs, html.ce-in-window div.breadcrumbs, html.ce-in-window #nav-sidebar,
html.ce-in-window .toggle-nav-sidebar { display: none !important; }
html.ce-in-window #ce-az { display: none !important; }
html.ce-in-window .main.shifted > #nav-sidebar + .content, html.ce-in-window .main > .content { max-width: 100%; }
html.ce-in-window #content { padding-top: 14px; }

#header .ce-search input[type=search] { padding-left: 34px !important; }
#header .ce-search input:focus ~ kbd, #header .ce-search input:not(:placeholder-shown) ~ kbd { display: none; }
#header .ce-search input[type=search]:focus + kbd { display: none; }
.ce-search:focus-within > .ic { color: var(--ce-muted); z-index: 1; }
.ce-results a span.s { max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.ce-results a > span:nth-child(2) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

#dietary_needs-group td.original p { display: none; }
#dietary_needs-group { border-left: 3px solid var(--ce-bad); }


/* Labels (status, venue, theme, department…): a colored dot and the word in the normal flow, no bubbles. The status
   colors never change with the company color. */
.chip[style*="--c"], .pill, .ns-state, .st { display: inline !important; background: none !important; border: 0 !important; border-radius: 0 !important;
  padding: 0 !important; box-shadow: none !important; font-weight: 600 !important; text-transform: none; letter-spacing: 0;
  font-size: max(12px, .92em) !important; white-space: nowrap; line-height: inherit !important; color: var(--ce-text-2) !important; }
.chip[style*="--c"]::before, .pill[style*="--c"]::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--c); margin-right: 6px; vertical-align: 1px; }
.chip i, .pill i { display: none !important; }
.ce-badge, .ce-badge.soft { background: none !important; color: var(--ce-bad) !important; padding: 0 !important; min-width: 0 !important;
  height: auto !important; border-radius: 0 !important; font-weight: 800 !important; font-size: 12px !important; }
.ce-badge.soft { color: var(--ce-accent) !important; }
.ce-badge:not(.soft) { color: var(--ce-accent) !important; }  /* a count on a screen; on the rail it is a warm red, in a menu a deep red */
#header .ce-badge, .ce-top .ce-badge { color: color-mix(in srgb, var(--hq-bad) 55%, #fff) !important; }
#header .ce-menu .ce-badge:not(.soft), .ce-menu .ce-badge:not(.soft) { color: var(--hq-bad-text) !important; }

/* back · refresh · forward, after Fleet */
.ce-histnav { display: inline-flex; gap: 2px; margin-left: 6px; padding-left: 8px; border-left: 1px solid rgba(255,255,255,.12); }
.ce-histnav button { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 0; border-radius: 7px;
  background: transparent; color: rgba(255,255,255,.78); cursor: pointer; }
.ce-histnav button:hover { background: rgba(255,255,255,.08); color: #fff; }
/* A–Z quick find under the top bar */
.ce-az { flex: none; position: sticky; top: 52px; z-index: 899; display: flex; align-items: center; gap: 2px; padding: 3px 16px; background: var(--hq-charcoal); border-bottom: 1px solid rgba(255,255,255,.08); overflow-x: auto; max-width: 100%; box-sizing: border-box; }
.ce-az b { color: var(--hq-warn); font-size: 12px; font-weight: 800; letter-spacing: .06em; margin-right: 8px; white-space: nowrap; }
.ce-az button { min-width: 26px; height: 24px; border: 0; border-radius: 5px; background: transparent; color: rgba(255,255,255,.78); font: 700 12.5px var(--ce-font);
  cursor: pointer; padding: 0 5px; }
.ce-az button:hover, .ce-az button.on { background: var(--brand-700); color: var(--on-brand-700); }
@media print { .ce-az, .ce-histnav { display: none !important; } }

/* Click-to-call (core/phone.py, ce.js initTel) */
a.ce-tel { color: inherit; text-decoration: none; border-bottom: 1px dotted color-mix(in srgb, currentColor 45%, transparent); white-space: nowrap; }
a.ce-tel:hover { color: var(--ce-accent) !important; border-bottom-color: var(--ce-accent); }
.ce-tel-wrap { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; vertical-align: middle; }
.ce-tel-wrap > input { flex: 1 1 auto; min-width: 0; }
a.ce-tel-btn { display: inline-grid; place-items: center; flex: none; width: 30px; height: 30px; vertical-align: middle;
  border-radius: 8px; border: 1px solid var(--hairline-color); color: var(--ce-accent) !important; background: var(--body-bg); }
a.ce-tel-btn:hover { background: color-mix(in srgb, var(--ce-accent) 12%, var(--body-bg)); }
a.ce-tel-btn[hidden] { display: none; }
a.ce-tel-btn .ic { width: 15px; height: 15px; opacity: 1; }

/* Event tab row: the same on the event page, the Menu & Items builder, Staffing and Floor plan (events/tabs.py) */
.ev-tabs { display: flex; flex-wrap: nowrap; gap: 2px; padding: 0 10px; border-top: 1px solid var(--ce-border); position: relative; z-index: 5; }  /* one line; what doesn't fit goes under More */
.ev-tabs { padding: 6px 10px; align-items: center; }
.ev-tabs a, .ev-tabs button { position: relative; display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 14px; white-space: nowrap;
  box-sizing: border-box; text-decoration: none; font: 600 13.5px var(--ce-font, inherit); color: var(--ce-muted); border: 0; border-radius: 999px;
  background: none; cursor: pointer; }
.ev-tabs a:hover, .ev-tabs button:hover, .ev-tabs a:focus-visible, .ev-tabs button:focus-visible { color: var(--ce-text); }
.ev-tabs a.on, .ev-tabs button.on { color: var(--ce-on-pick); background: var(--ce-pick); box-shadow: var(--ce-pressed); }
.ev-tabs i { font-style: normal; width: 9px; height: 9px; border-radius: 50%; background: var(--t); display: inline-block; flex: none; }
.ev-tabs small { font-size: 12px; font-weight: 700; background: color-mix(in srgb, var(--t) 14%, transparent); color: color-mix(in srgb, var(--t) 55%, var(--ce-text)); border-radius: 999px; padding: 1px 7px; }
.ev-tabs a.err::after { content: "!"; position: absolute; top: 4px; right: 2px; width: 15px; height: 15px; border-radius: 50%; background: var(--hq-bad); color: #fff;
  font-size: 12px; display: flex; align-items: center; justify-content: center; }
.ev-tabs a.go::after { content: "↗"; font-size: 12px; opacity: .6; }
.ev-tabs .sep { width: 1px; flex: none; background: var(--ce-border); margin: 9px 4px; }
.ev-tabs .ev-more { position: relative; display: flex; margin-left: auto; }
.ev-tabs .ev-more[hidden] { display: none; }
.ev-tabs .ev-more-btn b { font-size: 12px; opacity: .7; }
.ev-tabs .ev-more-menu { display: none; position: absolute; right: 0; top: 100%; min-width: 220px; padding: 6px; background: var(--ce-surface);
  border: 0; border-radius: 14px; box-shadow: var(--ce-shadow-lg); flex-direction: column; z-index: 50; }
.ev-tabs .ev-more-menu.open { display: flex; }
.ev-tabs .ev-more-menu a, .ev-tabs .ev-more-menu button { border-left: 3px solid transparent; border-radius: 10px; padding: 8px 10px; min-height: 0; width: 100%; text-align: left; }
.ev-tabs .ev-more-menu a:hover, .ev-tabs .ev-more-menu button:hover { background: var(--ce-surface-2); }
.ev-tabs .ev-more-menu .on { border-left-color: var(--t); background: var(--ce-pick); box-shadow: none; }
.ev-tabs .ev-more-menu .sep { width: auto; height: 1px; margin: 4px 6px; }

/* ---------- the event header: one component on the event page, the builder, Staffing and Floor plan (events/_event_head.html) */
  .ev-head { position: sticky; top: 0; z-index: 30; background: var(--ce-surface); border: 0;
    border-radius: var(--ce-radius); box-shadow: var(--ce-shadow); margin: 0 0 14px; }
  .ev-top { display: flex; align-items: center; gap: 14px; padding: 12px 16px 8px; flex-wrap: wrap; }
  .ev-top h1 { margin: 0; font-size: 20px; line-height: 1.2; color: var(--ce-text); display: block !important; }
  .ev-top .meta { font-size: 13px; color: var(--ce-muted); margin-top: 3px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
  .ev-top .meta b { color: var(--ce-text); font-weight: 600; }
  .ev-money { display: flex; gap: 16px; margin-left: auto; align-items: center; }
  .ev-money div { text-align: right; } .ev-money span { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ce-muted); }
  .ev-money b { font-size: 17px; } .ev-money .due { color: var(--hq-bad-text); } .ev-money .paid { color: var(--hq-ok-text); }
  .ev-nav a { display: inline-flex; width: 34px; height: 34px; align-items: center; justify-content: center; border: 0; box-shadow: var(--ce-raised);
    background: var(--ce-surface); border-radius: 999px; text-decoration: none; font-size: 18px; color: var(--ce-text); }
  .ev-acts { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 10px; align-items: center; }
  .ev-acts .b, .ev-acts .ce-dd > button { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 999px;
    border: 0; background: var(--ce-surface); color: var(--ce-text) !important; box-shadow: var(--ce-raised);
    font: 600 13px var(--ce-font, inherit); text-decoration: none; cursor: pointer; }  /* one raised style; the icon carries the color */
  .ev-acts .b:hover, .ev-acts .ce-dd > button:hover { background: var(--ce-surface-2); }
  .ev-acts .b:active, .ev-acts .ce-dd > button:active { transform: translateY(1px); box-shadow: inset 0 1px 2px rgba(var(--hq-ink), .18), 0 0 0 1px rgba(var(--hq-ink), .08); }
  .ev-acts .b svg, .ev-acts .ce-dd > button svg { width: 15px; height: 15px; color: var(--c); }
  .ev-acts .b.main { background: var(--ce-main); border-color: transparent; color: var(--ce-on-main) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 1px 2px rgba(var(--hq-ink), .30), 0 6px 14px -6px rgba(var(--hq-ink), .45); }
  .ev-acts .b.main:hover { background: var(--ce-main-hover); } .ev-acts .b.main svg { color: var(--ce-on-main); }
  .ev-acts .ce-dd { position: relative; } .ev-acts .sp { flex: 1; }
  .ev-acts .ce-menu a svg { color: var(--c); }
  @media (max-width: 900px) { .ev-money { margin-left: 0; width: 100%; } .ev-acts .sp { display: none; } }
.ev-head[data-here="items"], .ev-head[data-here="staffing"], .ev-head[data-here="layout"] { margin: 10px clamp(10px, calc(1.6 * var(--ce-vw, 1vw)), 28px) 12px; }
.ev-head .ev-tabs { border-top: 1px solid var(--ce-border); }
.ev-back { align-self: flex-start; margin-top: 3px; color: var(--ce-muted); text-decoration: none; font-weight: 600; font-size: 13px; white-space: nowrap; }
.ev-back:hover { color: var(--ce-accent); }
/* the save pill: same words and place on all four screens */
.ev-save { display: inline-flex; align-items: center; gap: 8px; margin-left: 4px; font-size: 12.5px; color: var(--ce-muted); white-space: nowrap; }
.ev-save::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--hq-ok); flex: none; }
.ev-save[data-state="dirty"] { color: var(--hq-warn-text); font-weight: 700; } .ev-save[data-state="dirty"]::before { background: var(--hq-warn); }
.ev-save[data-state="saving"]::before { background: var(--hq-warn); animation: ev-pulse 1s infinite; }
.ev-save[data-state="err"] { color: var(--hq-bad-text); font-weight: 700; } .ev-save[data-state="err"]::before { background: var(--hq-bad); }
@keyframes ev-pulse { 50% { opacity: .3; } }
.ev-save-btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; border-radius: 999px; border: 0; background: var(--ce-main);
  color: var(--ce-on-main); font: 700 12.5px var(--ce-font); cursor: pointer; box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 1px 2px rgba(var(--hq-ink), .30); }
.ev-save-btn[hidden] { display: none; }
.ev-save-btn kbd { font: 600 12px var(--ce-font); opacity: .8; border: 1px solid rgba(255,255,255,.33); border-radius: 4px; padding: 0 4px; }

/* ---------- Readability and screen fit */
/* links inside sentences and breadcrumbs are underlined, so they don't depend on color alone */
div.breadcrumbs a, ul.messagelist a,
:is(#content p, #content .help, #content div.help, .ev-tabhint span) a:not(.button, .ce-btn, .b, .b2, .addlink, .chip, .bc-chip, .f) {
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
/* IDs, dates, money and names stay on one line; name columns get room */
#result_list td.field-number, #result_list th.field-number, #result_list td.field-event_date_dow, #result_list td.field-total,
#result_list td.field-balance, #result_list td.field-rep, #result_list td.field-ce_link_rep, #result_list td.field-guests_planned,
#result_list td.field-rac_id, #result_list th.field-rac_id, #result_list td.field-ce_link_sales_rep, #result_list td.field-sales_rep,
#result_list td.field-phone, #result_list td.field-next_action_date, #result_list td.field-price, #result_list td.field-cost,
#result_list td.field-margin, #result_list td.field-added_col, #result_list td.field-sent_col, #result_list td.field-age_col,
#result_list td.field-event_count, #result_list td.field-referral_count { white-space: nowrap; }
#result_list td.field-name, #result_list th.field-name { min-width: 190px; }
#result_list td.field-ce_link_account, #result_list td.field-account { min-width: 150px; }
#result_list td.field-tag_chips { min-width: 150px; }
#result_list td.field-email { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#result_list td.field-price input, #result_list td.field-cost input { width: 90px; min-width: 0; box-sizing: border-box; }
/* optional columns (Columns menu) */
#result_list .ce-col-off { display: none !important; }
/* Filters and Columns buttons next to the search box; the panel folds away */
.ce-filters-btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; margin-left: 8px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  border: 0; background: var(--ce-surface); color: var(--ce-text); box-shadow: var(--ce-raised); font: 600 13px var(--ce-font); vertical-align: middle; }
.ce-filters-btn .ic { width: 15px; height: 15px; }
.ce-list-tools { padding: 8px 0 10px; }
.ce-list-tools .ce-filters-btn:first-child { margin-left: 0; }
.ce-filters-btn b { min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--brand-700); color: var(--on-brand-700); font-size: 12px; line-height: 18px; text-align: center; }
.ce-filters-btn:hover { background: var(--ce-surface-2); }
.ce-filters-btn.on { background: var(--ce-pick); color: var(--ce-on-pick); box-shadow: var(--ce-pressed); }
#changelist.ce-filters-off #changelist-filter { display: none; }
.ce-dd.ce-cols { position: relative; display: inline-block; }
.ce-dd.ce-cols .ce-menu { left: 8px; right: auto; top: 40px; min-width: 240px; padding: 8px; }
.ce-dd.ce-cols .ce-menu label { display: flex; align-items: center; gap: 8px; padding: 7px 8px; font-size: 13.5px; color: var(--ce-text); cursor: pointer; border-radius: 6px; }
.ce-dd.ce-cols .ce-menu label:hover { background: var(--ce-surface-2); }
.ce-dd.ce-cols .ce-menu [data-col-reset] { margin-top: 4px; width: 100%; border: 0; background: none; color: var(--ce-accent); font: 600 12.5px var(--ce-font); text-align: left; padding: 6px 8px; cursor: pointer; }
/* buttons say "Save", not "SAVE" */
.submit-row input, .submit-row input.default, .submit-row a.closelink, .submit-row a.deletelink { text-transform: none !important; letter-spacing: 0 !important; }
/* ✦ AI assistant (and </>) in the top bar */
#header #ai-fab.ce-in-bar { position: static; width: 34px; height: 34px; border-radius: 9px; font-size: 16px; box-shadow: none; flex: none; align-self: center; }
#header #dv-fab.ce-in-bar { position: static !important; width: 34px !important; height: 34px !important; border-radius: 9px !important; box-shadow: none !important; flex: none; align-self: center; font-size: 12px !important; }
#header #ai-fab.ce-in-bar:hover { transform: none; filter: brightness(1.1); }
#ai-panel { top: 60px; bottom: auto !important; }
/* event form rows 48–52px on desktop */
#event_form fieldset.module .form-row { padding-top: 5px; padding-bottom: 5px; }
#event_form fieldset.module .form-row .help, #event_form fieldset.module .form-row div.help { margin-top: 2px; margin-bottom: 0; padding-top: 0; }
#event_form fieldset.module .form-multiline { row-gap: 8px; }
#event_form fieldset.module .form-multiline > div, #event_form fieldset.module .related-widget-wrapper { margin-bottom: 0; }
#event_form fieldset.module .form-row select, #event_form fieldset.module .form-row input { margin-bottom: 0; }
@media (pointer: coarse) { #event_form .form-row input, #event_form .form-row select { min-height: 44px; } }
/* the More tab keeps one width */
.ev-tabs .ev-more-btn { width: 150px; justify-content: space-between; }
.ev-tabs .ev-more-btn .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; text-align: left; }
/* lookup fields keep a quiet grey + and an "Open" link instead of icons */
.related-widget-wrapper-link.add-related img, .related-widget-wrapper-link.view-related img { display: none; }
.related-widget-wrapper-link.add-related::before { content: "+"; display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 999px;
  background: var(--ce-surface); box-shadow: var(--ce-raised); color: var(--ce-muted); font: 600 16px/1 var(--ce-font); }
.related-widget-wrapper-link.add-related:hover::before { color: var(--ce-text); }
.related-widget-wrapper-link.view-related::before { content: "Open"; font: 600 12.5px var(--ce-font); color: var(--ce-accent); text-decoration: underline; text-underline-offset: 2px; }
.related-widget-wrapper-link.view-related[href=""], .related-widget-wrapper-link.view-related:not([href]) { display: none; }
.related-widget-wrapper { gap: 4px 8px; align-items: center; }
/* tips that can be put away */
[data-tip] { position: relative; }
[data-tip]:not(.ce-tip-off) { padding-right: 40px !important; }
.ce-tip-x { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 7px; border: 0; background: transparent; color: var(--ce-muted);
  font: 600 14px/1 var(--ce-font); cursor: pointer; }
.ce-tip-x:hover { background: var(--ce-surface-2); color: var(--ce-text); }
.ce-tip-off { background: none !important; border: 0 !important; padding: 0 !important; margin: 0 0 4px !important; min-height: 28px; box-shadow: none !important; }
.ce-tip-off > :not(.ce-tip-x) { display: none !important; }
.ce-tip-off > .ce-tip-x { position: static; border: 1px solid var(--ce-border-strong); border-radius: 999px; width: 26px; height: 26px; }
/* A–Z letters are at least 28 × 28 */
.ce-az button { min-width: 28px; height: 28px; }
/* the avatar shows the Waiting-on-you count when the bell isn't there */
.ce-avatar { position: relative; }
.ce-avatar .ce-badge { position: absolute; top: -5px; right: -7px; }

/* ---------- Type size */
/* Nothing a person reads is under 12px. Django's own small text (help lines, inline table heads, "View on site"
   lines, result counts) is lifted here; the app's own rules are 12px or more. */
.help, div.help, p.help, .help div, .helptext, span.small.quiet, span.small.quiet a, .inline-group thead th, .inline-group .tabular th,
td.original p, td.original p a, .inlinechangelink, .datetimeshortcuts, .datetimeshortcuts a, #changelist-filter li, #changelist-filter a,
.paginator, .object-tools a, .selector .selector-filter, .timezonewarning, fieldset .fieldBox .help { font-size: max(12px, 1em) !important; }
.help, div.help, p.help, .help div { font-size: 12px !important; }
small { font-size: max(12px, .83em); }
/* text, as the look spec sets it: body 15/22 in Instrument Sans 400, tables 14, field labels 13 at 600, every figure
   tabular. Line heights are unitless so headings and big numbers keep their own. Compact (My settings → Density)
   keeps 14 body and 13.5 tables and tightens the padding; the 12px floor applies to both. */
body { font-size: var(--hq-text-body); line-height: 1.4667; font-weight: 400; }
p, li, dt, dd { font-size: inherit; line-height: inherit; }
td, th { font-size: 14px; line-height: 1.43; }
label:not(:has(input, select, textarea)), .aligned label, .form-row label:not(.vCheckboxLabel) { font-size: 13px; font-weight: 600; }
#content-main :is(input[type=text], input[type=number], input[type=email], input[type=tel], input[type=date], input[type=time],
  input[type=url], input[type=password], input[type=search], select, textarea), .form-row .readonly { font-size: var(--hq-text-body); }
#content-main :is(td, th) :is(input[type=text], input[type=number], input[type=email], input[type=tel], input[type=date],
  input[type=time], select, textarea) { font-size: 14px; }
html[data-density="compact"] body { font-size: 14px; line-height: 1.43; }
html[data-density="compact"] :is(td, th) { font-size: 13.5px; }
html[data-density="compact"] #content-main :is(input, select, textarea) { font-size: 14px; }
html[data-density="compact"] #result_list td, html[data-density="compact"] #result_list th { padding: 5px 8px; }
html[data-density="compact"] #event_form fieldset.module .form-row { padding-top: 3px; padding-bottom: 3px; }
html[data-density="compact"] .ev-top { padding-top: 8px; padding-bottom: 4px; }
/* dietary tags on one line, "+N" opens all of them with names (click or Enter, not hover) */
.ce-tags { white-space: nowrap; } .ce-tags .ce-tag { color: var(--ce-text); letter-spacing: .03em; }
details.ce-tags summary { list-style: none; cursor: pointer; } details.ce-tags summary::-webkit-details-marker { display: none; }
details.ce-tags .more { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 999px; border: 1px solid var(--ce-border-strong);
  font-size: 12px; font-weight: 700; color: var(--ce-text-2); }
details.ce-tags[open] .more { background: var(--ce-surface-2); }
details.ce-tags ul { margin: 6px 0 0; padding: 6px 8px; list-style: none; white-space: normal; background: var(--ce-surface-2); border-radius: 8px; min-width: 180px; }
details.ce-tags li { font-size: 13px; padding: 1px 0; } details.ce-tags li b { display: inline-block; min-width: 48px; }
/* very wide screens (layout width 2200px+, set by ceFit). Home goes to three columns; forms stop at 1400px so Save and
   Delete stay close, except the event screen, whose Payments table uses the full width. Lists, Calendar Glance, the builder and the floor plan keep the full width. */
html.ce-wide .ce-dash { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-flow: row dense; }  /* half-width widgets fill the gaps */
html.ce-wide body.change-form:not(.model-event) #content { max-width: 1400px; }
html.ce-wide body.change-form:not(.model-event) .submit-row { max-width: 1400px; box-sizing: border-box; }
/* A–Z quick find inside the search box */
.ce-azpop .ce-azgrid { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 4px; padding: 4px 10px 8px; }
.ce-azpop .ce-azgrid button { min-height: 32px; border: 0; border-radius: 10px; background: var(--ce-surface-2); color: var(--ce-text);
  box-shadow: inset 0 0 0 1px var(--ce-border); font: 700 13px var(--ce-font); cursor: pointer; }
.ce-azpop .ce-azgrid button:hover, .ce-azpop .ce-azgrid button.on { background: var(--ce-pick); color: var(--ce-on-pick); box-shadow: var(--ce-pressed); }
.ce-azfoot { padding: 6px 12px 10px; font-size: 12px; color: var(--ce-muted); border-top: 1px solid var(--ce-border); }
html .ce-search .ce-azfoot kbd { display: inline; position: static; color: var(--ce-text-2); font: 600 12px var(--ce-font); border: 1px solid var(--ce-border-strong); border-radius: 4px; padding: 0 4px; }
html.ce-rail .ce-topspace { min-height: 52px; padding: 0 !important; }
/* the ? shortcut list and the J/K row highlight */
.ce-keys { display: none; position: fixed; inset: 0; z-index: 1200; background: rgba(var(--hq-ink),.35); }
.ce-keys.show { display: grid; place-items: center; }
.ce-keys .in { background: var(--ce-surface); color: var(--ce-text); border-radius: 14px; box-shadow: var(--ce-shadow-lg); width: min(460px, calc(100% - 32px)); max-height: 80vh; overflow: auto; }
.ce-keys header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--ce-border); }
.ce-keys header button { border: 0; background: none; font-size: 16px; cursor: pointer; color: var(--ce-muted); width: 32px; height: 32px; border-radius: 8px; }
.ce-keys table { width: 100%; border-collapse: collapse; } .ce-keys td { padding: 8px 16px; border-bottom: 1px solid var(--ce-border); font-size: 14px; }
.ce-keys td:last-child { text-align: right; white-space: nowrap; }
.ce-keys kbd { font: 600 12.5px var(--ce-font); border: 1px solid var(--ce-border-strong); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; background: var(--ce-surface-2); }
#result_list tr.ce-kbd-row td, #result_list tr.ce-kbd-row th { background: var(--ce-pick) !important; }
#result_list tr.ce-kbd-row td:first-child { box-shadow: inset 3px 0 0 var(--brand-700); }
/* every record page (not only events): shorter rows */
body.change-form fieldset.module .form-row { padding-top: 5px; padding-bottom: 5px; }
body.change-form fieldset.module .form-multiline { row-gap: 8px; }
body.change-form fieldset.module .form-multiline > div, body.change-form fieldset.module .related-widget-wrapper { margin-bottom: 0; }
html[data-density="compact"] body.change-form fieldset.module .form-row { padding-top: 3px; padding-bottom: 3px; }
/* phone-only pieces of the bottom bar stay hidden everywhere else */
.ce-morebtn, .ce-nav > .ce-phone-only { display: none !important; }
/* the event header on a phone: the main button, an Actions menu for the rest, the save dot, and a link to the phone view */
.ev-acts-toggle, .ev-phone-link { display: none !important; }
.ev-headmore { display: none; }  /* the Details button is for phones only (shown in the 640 px block further down) */
@media (max-width: 760px) {
  .ev-acts:not(.open) > :not(.main):not(.ev-acts-toggle):not(.ev-save) { display: none !important; }
  .ev-acts.open { flex-direction: column; align-items: stretch; }
  .ev-acts.open > .b, .ev-acts.open > .ce-dd > button, .ev-acts.open > form > .b { width: 100%; box-sizing: border-box; height: 40px; justify-content: flex-start; }
  .ev-acts .ev-acts-toggle { display: inline-flex !important; }
  .ev-acts .sp, #ev-customize, #ev-customize-x { display: none !important; }
  .ev-phone-link { display: block !important; margin: 0 16px 10px; padding: 10px 12px; border-radius: 10px; background: var(--ce-accent-soft);
    color: var(--ce-accent) !important; font-weight: 700; text-decoration: none !important; }
  .ev-top { padding: 12px 14px 8px; } .ev-top h1 { font-size: 19px; }
  /* on a phone the event header is too tall to stay pinned; it scrolls away with the page */
  html .ev-head, html .ws-head { position: static; }
  .ev-money { gap: 12px; }
  /* record pages: fields stack instead of running off the right edge */
  body.change-form fieldset.module .form-row .flex-container, body.change-form fieldset.module .form-multiline { flex-wrap: wrap; }
  body.change-form fieldset.module .fieldBox { width: 100%; margin-right: 0 !important; flex-wrap: wrap; }
  body.change-form fieldset.module .form-row select, body.change-form fieldset.module .form-row input[type=text],
  body.change-form fieldset.module .form-row textarea, body.change-form .related-widget-wrapper { max-width: 100%; min-width: 0; }
  body.change-form fieldset.module .form-row label { width: auto; min-width: 0; padding-right: 8px; }
  #content { padding-left: 12px !important; padding-right: 12px !important; }
  /* wide tables scroll inside their card, not the whole page */
  /* "html" in front so a page's own <style> (.fn { overflow: hidden }) can't undo this */
  html .cm-card, html .fn, html .ws-body .card, html #changelist .results, html .sc-list-wrap { overflow-x: auto; }
  .ce-dash { gap: 12px; }
  .ce-week { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; padding: 10px 8px; }
  .ce-week > a { padding: 6px 3px; min-width: 0; overflow: hidden; }
  .ce-week .n { font-size: 17px; }
  .ev-money { flex-wrap: wrap; row-gap: 6px; }
  .ce-w, .ce-card { min-width: 0; }
  /* list search bar: box and Search on one line, the count and Filters/Columns on the next */
  html #changelist-search > div { flex-wrap: wrap; gap: 8px; max-width: none; align-items: center; }
  html #toolbar form #searchbar { flex: 1 1 140px; width: auto; min-width: 0; height: 34px; margin: 0; }
  html #toolbar form input[type=submit] { height: 34px; padding: 0 12px; }
  html #changelist-search .small.quiet { flex: 1 0 100%; width: auto; order: 3; margin: 0; }
  #changelist-search .ce-filters-btn, #changelist-search .ce-cols { order: 2; }
  #changelist .actions { flex-wrap: wrap; row-gap: 6px; }
}
/* Vendor manager: insurance status on the event's Vendors tab. House label style (bold uppercase colored words),
   with the icon kept so it never relies on color alone. */
.ce-ins { display:inline-flex; gap:5px; align-items:baseline; font-weight:800; text-transform:uppercase; letter-spacing:.04em;
          font-size:max(12px, .86em); text-decoration:none !important; white-space:normal; line-height:1.35; }
.ce-ins.ok { color:var(--hq-ok-text) !important; } .ce-ins.warn { color:var(--hq-warn-text) !important; } .ce-ins.info { color:var(--brand-text) !important; }
.ce-ins.bad { color:var(--hq-bad-text) !important; } .ce-ins.none { color:var(--hq-slate) !important; }
html[data-theme="dark"] .ce-ins.info { color:var(--ce-accent) !important; } html[data-theme="dark"] .ce-ins.none { color:var(--ce-muted) !important; }
#vendors-group td.field-insurance { min-width:160px; max-width:240px; }
#vendors-group td.field-name input, #vendors-group td.field-notes input { width:150px; }
#vendors-group td.field-contact input { width:190px; } #vendors-group td.field-override_reason input { width:220px; }

/* ---------- the brand band: overview pages only (Home, an event, a client), never a working screen or a form.
   The page marks itself with body.hq-banded. The strips above the page (the room under the search pill, the practice-copy
   line, the messages) take the band's color, so the band runs up to the top of the window. The company's 800 step
   with fine 135 degree lines; text on it is the scale's pick for 800 (--on-brand-800), quieter text --brand-band-soft.
   The first row under the band rises about 40px over its lower edge. */
body.hq-banded { --hq-gutter: clamp(14px, calc(2.4 * var(--ce-vw, 1vw)), 36px);
  --hq-band-lines: repeating-linear-gradient(135deg, var(--brand-band-lines) 0 1px, transparent 1px 8px);
  --hq-onband: 0 0 0 1px rgba(var(--hq-ink), .10), 0 1px 2px rgba(var(--hq-ink), .18), 0 6px 14px -8px rgba(var(--hq-ink), .35); }
html.ce-rail body.hq-banded .ce-az, body.hq-banded .ce-practice, body.hq-banded ul.messagelist, .hq-band {
  background-color: var(--brand-800); background-image: var(--hq-band-lines); }
/* on a computer the strip under the search pill stays at the top in the band's color, so the band shrinks to a bar
   as the page scrolls; the lines are fixed to the window, so the strip and the band join without a seam */
@media (min-width: 761px) {
  html.ce-rail:not(.ce-in-window) body.hq-banded .ce-az { position: fixed; top: 0; left: var(--dock-rail); right: 0; height: 52px; min-height: 52px; }
  html.ce-rail:not(.ce-in-window) body.hq-banded #container { padding-top: 52px; }
  html.ce-rail body.hq-banded :is(.ce-az, .ce-practice, ul.messagelist, .hq-band) { background-attachment: fixed; }
}
body.hq-banded .ce-practice { color: var(--brand-band-soft); box-shadow: none; padding-left: var(--hq-gutter); }
body.hq-banded .ce-practice b { color: var(--on-brand-800); }
body.hq-banded ul.messagelist { margin: 0; padding: 8px var(--hq-gutter) 0; }
body.hq-banded ul.messagelist li { margin: 0 0 6px; border-radius: 14px; }
body.hq-banded #content { padding-top: 0; padding-left: var(--hq-gutter); padding-right: var(--hq-gutter); }
.hq-band { position: relative; z-index: 0; box-sizing: border-box; margin: 0 calc(-1 * var(--hq-gutter)) -40px;
  padding: 12px var(--hq-gutter) 64px; color: var(--on-brand-800); }
.hq-band + *, .hq-rise { position: relative; z-index: 1; }
.hq-band .hq-soft { color: var(--brand-band-soft); }
.hq-band h1, .hq-band .hq-title { margin: 0; font: 700 30px/1.08 var(--hq-font-display); letter-spacing: -.025em; color: var(--on-brand-800); }
.hq-band a:not(.hq-onband, .hq-ghost, .ce-btn, .chip) { color: inherit; }
.hq-band :is(a, button):focus-visible { outline: 2px solid var(--on-brand-800); outline-offset: 2px; }
/* on the band: chips are a soft wash of the band's text color; a status chip keeps its dot */
.hq-band .hq-bchip, .hq-band .chip { display: inline-flex; align-items: center; gap: 6px; font: 600 13px/1.2 var(--hq-font-body);
  border-radius: 999px; padding: 6px 12px; background: color-mix(in srgb, var(--on-brand-800) 12%, transparent);
  color: var(--on-brand-800) !important; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--on-brand-800) 14%, transparent); white-space: nowrap; }
.hq-band .chip[style*="--c"] { display: inline-flex !important; align-items: center; padding: 6px 12px !important; border-radius: 999px !important;
  background: color-mix(in srgb, var(--on-brand-800) 12%, transparent) !important; color: var(--on-brand-800) !important; font-size: 13px !important;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--on-brand-800) 14%, transparent) !important; }
.hq-band .chip[style*="--c"]::before { box-shadow: 0 0 0 2px color-mix(in srgb, var(--on-brand-800) 22%, transparent); }
.ev-id .meta > span { display: inline-block; font: 600 13px/1.2 var(--hq-font-body); border-radius: 999px; padding: 6px 12px;
  background: color-mix(in srgb, var(--on-brand-800) 12%, transparent); color: var(--on-brand-800);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--on-brand-800) 14%, transparent); white-space: nowrap; }
.ev-id .meta > span.due { background: var(--hq-bad-bg); color: var(--hq-bad-text); box-shadow: none; }
.ev-id .meta > span.soon { background: var(--hq-warn-bg); color: var(--hq-warn-text); box-shadow: none; }
.hq-band .hq-bchip.due { background: var(--hq-bad-bg); color: var(--hq-bad-text) !important; box-shadow: none; }
.hq-band .hq-bchip.soon { background: var(--hq-warn-bg); color: var(--hq-warn-text) !important; box-shadow: none; }
/* buttons on the band: white and raised (the search pill's look), or a ring in the band's text color */
.hq-onband, .hq-ghost { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px;
  box-sizing: border-box; border: 0; border-radius: 999px; font: 600 14px var(--hq-font-body); text-decoration: none !important;
  white-space: nowrap; cursor: pointer; transition: transform .08s, box-shadow .08s; }
.hq-onband { background: var(--ce-surface); color: var(--ce-text) !important; box-shadow: var(--hq-onband); }
.hq-ghost { background: transparent; color: var(--on-brand-800) !important; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--on-brand-800) 35%, transparent); }
.hq-ghost:hover { background: color-mix(in srgb, var(--on-brand-800) 8%, transparent); }
:is(.hq-onband, .hq-ghost):active { transform: translateY(1px); }
.hq-onband .ic, .hq-ghost .ic { width: 16px; height: 16px; }
.hq-onband.round { width: 44px; padding: 0; position: relative; }
.hq-onband .dot { position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand-700);
  box-shadow: 0 0 0 2px var(--ce-surface); }
/* cards that sit on or rise over the band */
.hq-card { background: var(--ce-surface); border-radius: var(--hq-radius-card); box-shadow: var(--hq-resting); color: var(--ce-text); }
.hq-card.on-band { box-shadow: var(--hq-raised); }
.hq-k { font-size: 12px; font-weight: 500; color: var(--ce-muted); }
.hq-big { font: 700 26px/1.05 var(--hq-font-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--ce-text); }
.hq-meter { height: 6px; border-radius: 999px; background: var(--hq-line); box-shadow: var(--hq-well); overflow: hidden; }
.hq-meter > i { display: block; height: 100%; border-radius: 999px; background: var(--brand-700); box-shadow: inset 0 1px 0 rgba(255,255,255,.28); }
html[data-theme="dark"] .hq-meter { background: var(--hq-dark-ground); }
html[data-theme="dark"] :is(#ev-hold-bar > b, .dk-tile:not(.today), .cl-av, .ev-date .mo) { color: var(--ce-on-pick); }
@media (max-width: 760px) {
  body.hq-banded { --hq-gutter: 12px; }
  .hq-band { padding-top: 10px; padding-bottom: 56px; }
  .hq-band h1, .hq-band .hq-title { font-size: 24px; }
}

/* ---------- an event on the band (events/_event_head.html on the event page). The header's own box steps aside
   (display: contents): the band, the four cards that rise over it and the bar of actions and tabs are each their own
   part. The bar stays in reach under the strip at the top while the page scrolls. */
.ev-head.ev-banded { display: contents; }
.ev-band-top { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; min-height: 44px; }
.ev-band { padding-top: 14px; }
.ev-band-top .sp { flex: 1; }
.ev-crumb { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; margin-right: 4px; }
.ev-crumb a { color: var(--brand-band-soft) !important; text-decoration: none; }
.ev-crumb a:hover { color: var(--on-brand-800) !important; text-decoration: underline; }
.ev-crumb b { color: var(--on-brand-800); font-weight: 700; }
.ev-band-main { display: flex; align-items: flex-start; gap: 24px; }
.ev-date { flex: none; width: 132px; box-sizing: border-box; padding: 14px 10px 12px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.ev-date .mo { font-size: 12.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--brand-text); }
.ev-date .dd { font: 700 56px/1 var(--hq-font-display); letter-spacing: -.04em; color: var(--ce-text); font-variant-numeric: tabular-nums; margin: 4px 0 6px; }
.ev-date .dw { font-size: 12.5px; color: var(--ce-muted); }
.ev-date .out { font-size: 12px; color: var(--ce-muted); margin-top: 4px; }
.ev-id { flex: 1; min-width: 0; }
.ev-id h1 { display: block !important; margin-top: 8px; }
.ev-id .ev-no { color: var(--brand-band-soft); }
.ev-id .meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.ev-id .meta b { font-weight: 700; color: inherit; }
.ev-id .meta a { color: inherit !important; }
/* the four cards that rise over the band: balance, menu, venue and floor plan, the night */
.ev-glance { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 0 0 16px; }
.ev-gl { position: relative; display: flex; flex-direction: column; gap: 6px; min-width: 0; min-height: 136px; padding: 16px 18px; box-sizing: border-box; }
.ev-gl .hq-big small { font: 500 13px var(--hq-font-body); color: var(--ce-muted); letter-spacing: 0; }
.ev-gl-note { font-size: 12.5px; color: var(--ce-muted); line-height: 1.4; }
.ev-gl-money .ev-money { display: flex; flex-direction: column; align-items: stretch; gap: 6px; margin: 0; }
.ev-gl-money .ev-money span { display: inline; text-transform: none; letter-spacing: 0; }
.ev-gl-money .ev-money .hq-k { font-size: 12px; color: var(--ce-muted); }
.ev-gl-money .ev-money b.hq-big { font-size: 28px; color: var(--ce-text); }
.ev-gl-money .ev-gl-of b { font-size: 12px; font-weight: 600; color: var(--ce-text); }
.ev-gl-money .hq-meter { margin-top: 4px; }
.ev-gl-money .ev-nav { position: absolute; top: 10px; right: 10px; display: flex; gap: 4px; }
.ev-gl-money .ev-nav a { width: 30px; height: 30px; font-size: 16px; }
.ev-gl-menu .ce-btn { align-self: flex-start; margin-top: auto; }
.ev-gl-place { font: 700 17px/1.25 var(--hq-font-display); color: var(--ce-text); overflow: hidden; text-overflow: ellipsis; }
.ev-gl-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: auto; }
.ev-gl-row > span { display: flex; flex-direction: column; }
.ev-gl-row b { font: 700 20px/1.1 var(--hq-font-display); font-variant-numeric: tabular-nums; }
.ev-gl-row a { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; color: var(--ce-accent) !important; text-decoration: none; }
.ev-gl-times { list-style: none; margin: 2px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.ev-gl-times li { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--ce-muted); padding: 3px 0; }
.ev-gl-times li + li { box-shadow: inset 0 1px 0 var(--ce-border); }
.ev-gl-times b { color: var(--ce-text); font-weight: 600; }
/* the bar: the actions, the unsent-changes note and the tabs */
.ev-bar { position: sticky; top: 52px; z-index: 30; margin: 0 0 14px; }
html.ce-in-window .ev-bar { top: 0; }
.ev-glance + .ev-bar { margin-top: 0; }
.ev-bar .ev-acts { padding-top: 12px; }
#ev-hold-bar { margin: 0 16px 10px; padding: 9px 14px; border-radius: 14px; background: var(--ce-pick); color: var(--ce-text);
  display: flex; gap: 8px 12px; align-items: center; flex-wrap: wrap; }
#ev-hold-bar > b { color: var(--brand-text); }
#ev-hold-bar > span:last-child { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
#ev-hold-bar .b { display: inline-flex; gap: 6px; align-items: center; height: 34px; padding: 0 14px; border: 0; border-radius: 999px;
  background: var(--ce-surface); color: var(--ce-text) !important; box-shadow: var(--ce-raised); font: 600 13px var(--ce-font);
  cursor: pointer; text-decoration: none; white-space: nowrap; }
#ev-hold-bar .b:hover { background: var(--ce-surface-2); }
#ev-hold-bar .b svg { width: 14px; height: 14px; color: var(--c); }
.ev-here { margin: 6px 16px 10px; padding: 5px 12px; border-radius: 10px; background: var(--ce-pick); color: var(--ce-on-pick); font-size: 13px; font-weight: 600; }
@media (max-width: 1180px) {
  .ev-glance { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .ev-bar { position: relative; z-index: 1; top: auto; }
  .ev-band-main { gap: 14px; margin-top: 8px; }
  .ev-date { width: 84px; padding: 10px 6px; }
  .ev-date .dd { font-size: 38px; margin: 2px 0 4px; }
  .ev-date .dw, .ev-date .out { font-size: 11.5px; }
  .ev-band-beo { display: none !important; }
  .ev-id .meta { margin-top: 10px; gap: 6px; }
  .ev-glance { gap: 10px; }
  .ev-gl { min-height: 0; padding: 14px; }
}
@media screen and (max-width: 640px) {
  /* folded on a phone (Details opens it): the band keeps the crumb, the date, the name and the status; the cards wait */
  body:not(:has(#tr-card:not([hidden]))) .ev-head:not(.ev-open) .ev-glance { display: none !important; }
  /* the phone keeps the band short: no crumb (the bar at the bottom has Events) and no date tile (the date is a chip) */
  .ev-band .ev-crumb, .ev-band .ev-date { display: none; }
  .ev-band { padding-top: 8px; }
  .ev-band .hq-title, .ev-band h1 { font-size: 21px; margin-top: 6px; }
  .ev-id .meta { margin-top: 8px; }
  .ev-id .meta > span { padding: 5px 10px; font-size: 12.5px; }
  .ev-band-top .ev-headmore { order: 5; margin-left: auto; background: var(--ce-surface); }
  .ev-band .b.main { order: 6; }
}

/* ---------- a client on the band (templates/admin/crm/account/change_form.html): the band, then the money, events,
   contacts and notes cards, then the form */
.cl-band-top { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; min-height: 44px; }
.cl-band { padding-top: 14px; }
.cl-band-top .sp { flex: 1; }
.cl-band h1 { margin-top: 8px; }
.cl-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.cl-meta .ic { width: 14px; height: 14px; }
.cl-glance { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(0, 2.4fr); grid-template-areas: "money events" "people events" "notes events";
  gap: 16px; align-items: start; margin: 0 0 18px; }
.cl-glance > .cl-money { grid-area: money; } .cl-glance > .cm-card { grid-area: events; margin: 0; }
.cl-glance > .cl-people { grid-area: people; } .cl-glance > .cl-notes { grid-area: notes; }
.cl-glance:not(:has(.cm-card)) { grid-template-areas: "people notes"; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cl-money { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; }
.cl-money .hq-big small { font: 500 13px var(--hq-font-body); color: var(--ce-muted); letter-spacing: 0; }
.cl-dl { margin: 8px 0 0; display: flex; flex-direction: column; }
.cl-dl > div { padding: 9px 0; box-shadow: inset 0 1px 0 var(--ce-border); }
.cl-dl dt { font-size: 12px; color: var(--ce-muted); font-weight: 500; }
.cl-dl dd { margin: 2px 0 0; font: 700 19px/1.2 var(--hq-font-display); color: var(--ce-text); font-variant-numeric: tabular-nums; }
.cl-dl dd.due { color: var(--hq-bad-text); }
.cl-dl dd small { display: block; font: 400 12.5px var(--hq-font-body); color: var(--ce-muted); margin-top: 2px; }
.cl-people, .cl-notes { padding: 4px 18px 10px; }
.cl-people > header, .cl-notes > header { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 12px 0 6px; }
.cl-people h3, .cl-notes h3 { margin: 0; font: 700 15px/1.3 var(--ce-font-display); color: var(--ce-text); }
.cl-people > header a, .cl-notes > header a { font-size: 12.5px; font-weight: 600; color: var(--ce-accent) !important; text-decoration: none; }
.cl-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.cl-row + .cl-row { box-shadow: inset 0 1px 0 var(--ce-border); }
.cl-av { width: 32px; height: 32px; flex: none; border-radius: 50%; display: grid; place-items: center; font: 600 12px var(--ce-font);
  background: var(--ce-pick); color: var(--brand-text); box-shadow: inset 0 0 0 1px var(--brand-100); text-transform: uppercase; }
.cl-w { min-width: 0; display: flex; flex-direction: column; }
.cl-w b { font-size: 14px; font-weight: 600; color: var(--ce-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-w b small { font-weight: 500; color: var(--ce-muted); font-size: 12px; }
.cl-w > small { font-size: 12.5px; color: var(--ce-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-none { margin: 4px 0 6px; font-size: 13px; color: var(--ce-muted); }
@media (max-width: 1100px) {
  .cl-glance { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "money people" "events events" "notes notes"; }
}
@media (max-width: 760px) {
  .cl-meta .cl-code { display: none; }
  .cl-glance { grid-template-columns: minmax(0, 1fr); grid-template-areas: "money" "events" "people" "notes"; gap: 10px; }
  .cl-glance:not(:has(.cm-card)) { grid-template-columns: minmax(0, 1fr); grid-template-areas: "people" "notes"; }
}

/* ===== mobile-cleanup: phones and tablets only, screen only. Nothing here applies on a laptop or in print. ===== */
/* Menu & Items and Charges at tablet width: the item table scrolls inside its card instead of widening the page */
@media screen and (max-width: 900px) {
  .ws-body .card { overflow-x: auto; }
}
@media screen and (max-width: 640px) {
  /* the ✦ button sits at the top beside the search bar (dock.css), never over the page's rows */
  html.ce-rail body #header #ai-fab.ce-in-bar { top: 8px !important; right: 12px !important; bottom: auto !important; }
  /* while the assistant panel is open on a phone the button would sit on its footer; the panel's own X and Esc close it */
  body:has(#ai-panel.on) #header #ai-fab.ce-in-bar { visibility: hidden; }
  /* Timeline & Checklist: each row becomes a small card with a label over every field, instead of a table 1800 px wide */
  #timeline-group thead, #checklist-group thead, #timeline-group td.original, #checklist-group td.original { display: none; }
  #timeline-group table, #timeline-group tbody, #timeline-group tr:not(.empty-form), #timeline-group td,
  #checklist-group table, #checklist-group tbody, #checklist-group tr:not(.empty-form), #checklist-group td { display: block; width: auto; box-sizing: border-box; }
  #timeline-group tr:not(.empty-form), #checklist-group tr:not(.empty-form) { padding: 8px 12px; border-bottom: 1px solid var(--ce-border); }
  #timeline-group td, #checklist-group td { border-bottom: 0 !important; padding: 4px 0 !important; }
  #timeline-group td::before, #checklist-group td::before { display: block; margin-bottom: 2px; font-size: 12px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .04em; color: var(--ce-muted); }
  #timeline-group td.field-time::before { content: "Time"; } #timeline-group td.field-what::before { content: "What"; }
  #timeline-group td.field-department::before, #checklist-group td.field-department::before { content: "Department"; }
  #timeline-group td.field-show_to_client::before { content: "Show to client"; }
  #checklist-group td.field-task::before { content: "Task"; } #checklist-group td.field-assigned_to::before { content: "Assigned to"; }
  #checklist-group td.field-due_date::before { content: "Due date"; } #checklist-group td.field-done_on::before { content: "Done on"; }
  #checklist-group td.field-done_by::before { content: "Done by"; } #checklist-group td.field-done_at::before { content: "Done at"; }
  #checklist-group td.field-photo::before { content: "Photo"; } #checklist-group td.field-note::before { content: "Note"; }
  #timeline-group td.delete::before, #checklist-group td.delete::before { content: "Remove"; }
  #timeline-group td input[type=text], #checklist-group td input[type=text], #checklist-group td textarea { width: 100%; max-width: 100%; box-sizing: border-box; }
  #timeline-group td select, #checklist-group td select { max-width: 100%; }
}

/* a short event header on a phone. One line of number and name, one of status, date and guests, then the
   tabs. Totals, the place and client, the phone-view link, the actions and the unsent-changes bar fold under Details.
   While a lesson is running the header stays whole, as before, so its steps still find what they point at. */
@media screen and (max-width: 640px) {
  .ev-headmore { display: inline-flex; align-items: center; gap: 4px; flex: none; align-self: flex-start; height: 36px; padding: 0 10px; margin-left: auto;
    border: 1px solid var(--ce-border-strong); border-radius: 8px; background: var(--ce-surface); color: var(--ce-text);
    font: 600 13.5px var(--ce-font); cursor: pointer; position: relative; }
  .ev-headmore svg { width: 15px; height: 15px; transition: transform .15s; }
  .ev-head.ev-open .ev-headmore svg { transform: rotate(180deg); }
  .ev-head:has(#ev-hold-bar, .pp-changed) .ev-headmore::after { content: ""; position: absolute; top: -4px; right: -4px; width: 10px; height: 10px; border-radius: 50%;
    background: var(--brand-700); border: 2px solid var(--ce-surface); }
  body:has(#tr-card:not([hidden])) .ev-headmore { display: none; }
  .ev-head[data-here="items"], .ev-head[data-here="staffing"], .ev-head[data-here="layout"] { margin-top: 6px; margin-bottom: 8px; }
  body.model-event.change-form div.breadcrumbs { display: none; }
  .ev-top { align-items: flex-start; gap: 6px 8px; }
  .ev-top > .ev-back { flex: 0 0 100%; }
  .ev-top > div:first-of-type { flex: 1 1 0; min-width: 0; }
  body:not(:has(#tr-card:not([hidden]))) .ev-head:not(.ev-open) .ev-top { padding-bottom: 6px; }
  body:not(:has(#tr-card:not([hidden]))) .ev-head:not(.ev-open) .ev-top h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 18px; }
  body:not(:has(#tr-card:not([hidden]))) .ev-head:not(.ev-open) .ev-top .meta { gap: 2px 8px; margin-top: 2px; font-size: 12.5px; }
  body:not(:has(#tr-card:not([hidden]))) .ev-head:not(.ev-open) .ev-back, body:not(:has(#tr-card:not([hidden]))) .ev-head:not(.ev-open) .ev-m-more, body:not(:has(#tr-card:not([hidden]))) .ev-head:not(.ev-open) .ev-money, body:not(:has(#tr-card:not([hidden]))) .ev-head:not(.ev-open) .ev-phone-link, body:not(:has(#tr-card:not([hidden]))) .ev-head:not(.ev-open) #ev-hold-bar, body:not(:has(#tr-card:not([hidden]))) .ev-head:not(.ev-open) .pp,
  body:not(:has(#tr-card:not([hidden]))) .ev-head:not(.ev-open) .ev-acts > :not(.ev-save) { display: none !important; }
  body:not(:has(#tr-card:not([hidden]))) .ev-head:not(.ev-open) .ev-acts:has(.ev-save[data-state="saved"]) { display: none; }
  body:not(:has(#tr-card:not([hidden]))) .ev-head:not(.ev-open) .ev-acts { padding-bottom: 6px; }
}
/* on a phone a wide table that has no card of its own scrolls inside this box, not the whole page
   (phones only, so a sticky table header on a computer keeps sticking to the page) */
@media screen and (max-width: 760px) { .ce-scroll-x { overflow-x: auto; max-width: 100%; } }
/* record pages on a phone. Boxes and wrappers inside a row never run wider than the row (notes boxes were
   610 px wide, tax schedule pickers ran under the edge); a checklist photo box fits its card. */
@media screen and (max-width: 760px) {
  body.change-form fieldset.module .form-row .form-multiline > div, body.change-form fieldset.module .form-row .fieldBox,
  body.change-form fieldset.module .form-row .related-widget-wrapper { min-width: 0; max-width: 100%; }
  body.change-form fieldset.module .form-row textarea { width: 100% !important; box-sizing: border-box; }
  body.change-form fieldset.module .form-row .related-widget-wrapper { flex-wrap: wrap; }
  body.change-form fieldset.module .form-row .related-widget-wrapper select { min-width: 0; max-width: 100%; flex: 1 1 160px; }
  #checklist-group td input[type=file] { max-width: 100%; }
}
/* a row of choices (.ce-seg) wraps on a phone instead of cutting off the last ones */
@media screen and (max-width: 640px) { .ce-seg { flex-wrap: wrap; max-width: 100%; } }
/* on a phone, pickers, boxes and buttons in the page are at least 44 px tall, so a finger can hit them (36 before
   look step 7a). Boxes take 16 px text, so a phone doesn't zoom in when one is tapped. Links in text, tick boxes, the
   leaderboard dots and arrows, and the two-list pickers' arrow buttons keep their size. */
@media screen and (max-width: 640px) {
  #content select:not([multiple]),
  #content input:is(:not([type]), [type=text], [type=number], [type=email], [type=tel], [type=search], [type=date], [type=time], [type=password], [type=url], [type=submit], [type=button]),
  #content button:not(.lbx-dot):not(.lbx-arrow):not(.ce-tip-x):not([class*="selector-"]) { min-height: 44px; }
  #content select:not([multiple]), #content textarea,
  #content input:is(:not([type]), [type=text], [type=number], [type=email], [type=tel], [type=search], [type=date], [type=time], [type=password], [type=url]) { font-size: 16px; }
  #content button:not(.lbx-dot):not(.lbx-arrow):not(.ce-tip-x):not([class*="selector-"]), #content input:is([type=submit], [type=button]) { min-width: 44px; }
  #content select:not([multiple]) { max-width: 100%; }  /* the bigger text never pushes a picker past the screen */
  #content [style*="display:grid"] > label { min-width: 0; }  /* ...nor a grid of labelled boxes (Budgets' new budget) */
}
/* number and date boxes on record pages show their whole value on a phone */
@media screen and (max-width: 640px) {
  body.change-form fieldset.module .form-row input:is([type=number], .vIntegerField, .vBigIntegerField) { min-width: 96px; }
  body.change-form .inline-group fieldset.module td input[type=text]:is(.vDateField, .vTimeField) { min-width: 104px; }
}

/* ---------- the staff screens on a phone (look step 7a, as the M-Mobile artboard). Home keeps a short band; an event
   and a form are working screens with no band; a form's fields are 44 to 48 px and its Save bar is held at the bottom,
   above the bar of sections; page-head buttons wrap under the heading; nothing a finger taps is under 44 px. */
@media screen and (max-width: 640px) {
  /* an event: the band steps aside, so the head sits on the page's ground like any working screen */
  body.hq-banded:has(.ev-band) :is(.ce-az, .ce-practice, ul.messagelist) { background: none; }
  body.hq-banded:has(.ev-band) .ce-practice { color: var(--ce-muted); }
  body.hq-banded:has(.ev-band) .ce-practice b { color: var(--ce-text); }
  .hq-band.ev-band { background: none; color: var(--ce-text); margin-bottom: 0; padding-bottom: 6px; }
  .ev-band :is(h1, .hq-title), .ev-band .ev-crumb b { color: var(--ce-text); }
  .ev-band .ev-id .ev-no, .ev-band .hq-soft { color: var(--ce-muted); }
  .ev-band :is(.hq-bchip, .chip, .ev-id .meta > span:not(.due, .soon)),
  .ev-band .chip[style*="--c"] { background: var(--ce-surface) !important; color: var(--ce-text) !important; box-shadow: var(--ce-raised) !important; }
  .ev-band .chip[style*="--c"]::before { box-shadow: none; }
  .ev-band .hq-ghost { color: var(--ce-text) !important; box-shadow: var(--ce-raised); background: var(--ce-surface); }
  .ev-band :is(a, button):focus-visible { outline-color: var(--brand-ring); }

  /* page heads: the buttons wrap under the heading, starting at the left */
  .ce-pagehead { align-items: flex-start; }
  .ce-pagehead:not(.hq-band) .right { margin-left: 0; flex: 1 0 100%; }
  #content-main > ul.object-tools, #content > ul.object-tools { float: none; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 8px; }
  #content-main > ul.object-tools li, #content > ul.object-tools li { margin: 0; }

  /* links that act as buttons are 44 px: the page-head tools, add and history links, the add / change / view
     beside a picker, the page numbers, the choices in a row, list rows, the breadcrumbs and the color swatches */
  #content :is(.object-tools a, a.addlink, a.changelink, a.historylink, a.deletelink, .paginator a, .ce-seg a, a.ce-btn, a.button),
  div.breadcrumbs a { display: inline-flex; align-items: center; min-height: 44px; box-sizing: border-box; }
  #content .related-widget-wrapper-link { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; box-sizing: border-box; }
  #content .paginator a { justify-content: center; min-width: 44px; }
  #content .paginator { line-height: 44px; }
  #content #result_list :is(th, td) > a:not(.peek-auto) { display: inline-flex; align-items: center; min-height: 44px; }
  #content a.peek-auto { min-width: 44px; min-height: 44px; }
  #content input[type=color] { min-width: 44px; min-height: 44px; }
  #content select.select2-hidden-accessible + .select2 .select2-selection { min-height: 44px; display: flex; align-items: center; }
  #content :is(.ce-w, .ce-card) > header a:not(.ce-btn) { display: inline-flex; align-items: center; min-height: 44px; }
  /* tabs, filter choices and rows that are already boxes: 44 tall (Books' and Items' tabs, the events list's views,
     tries and date choices, the setup steps' buttons, Home's schedule rows) */
  #content :is(.lg-tabs a, .it-tabs a, .es-tab, .es-try, .es-month, .es-season, .es-year, .es-btn, .es-fbtn, .su-act a, a.go,
    .sw-dh, .sw-ev, .ev-acts a.b) { min-height: 44px; box-sizing: border-box; }
  #content #result_list thead th .text a { display: flex; align-items: center; min-height: 44px; }
  html #toolbar form #searchbar, html #toolbar form input[type=submit] { height: 44px; }
  /* tick boxes are 22 px with their label beside them */
  #content input:is([type=checkbox], [type=radio]) { width: 22px; height: 22px; }

  /* Home: a short band. A short date and the tools share one row (the company and role and the notices button wait
     for a computer: the summary line under the greeting links to the same notices) */
  .hq-home-band .hq-home-long, .hq-home-band .hq-onband.round { display: none; }
  html .hq-home-band .hq-home-short { display: inline; }  /* the short date (dock.css hides it on a computer) */
  .hq-home-top { flex-wrap: nowrap; gap: 8px; }
  .hq-home-top .right { margin-left: auto; flex-wrap: nowrap; gap: 6px; }
  .hq-home-band .hq-home-date { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .hq-home-band .ce-seg a { min-height: 44px; padding: 0 12px; }
  .hq-home-band .hq-ghost { width: 44px; height: 44px; padding: 0; }
  .hq-home-band .hq-ghost.primary { width: auto; padding: 0 16px; }  /* "Done" while Home is being arranged */
  .hq-home-band .hq-ghost .hq-lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  html.ce-rail .hq-home-band h1 { font-size: 32px; margin-top: 6px; }
  .hq-home-band .hq-lede { font-size: 15px; margin-top: 6px; }
  .hq-band.hq-home-band { padding-top: 4px; padding-bottom: 50px; }
}
/* a form's Save bar stays in reach at the bottom of a phone, just above the bar of sections: one row, Save first,
   the other buttons scroll beside it */
@media screen and (max-width: 760px) {
  html.ce-rail body.change-form #content .submit-row { position: sticky; bottom: var(--ce-bar-h); z-index: 25; margin: 14px 0 0;
    flex-direction: row; flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; border-radius: 14px 14px 0 0; background: var(--ce-surface);
    box-shadow: 0 -1px 0 var(--ce-border), 0 -8px 18px -10px rgba(var(--hq-ink), .22); padding: 10px 12px; }
  html.ce-rail body.change-form #content .submit-row > * { flex: none; }
  html.ce-rail body.change-form #content .submit-row input.default { order: -1; min-height: 48px; padding: 0 22px; }
  /* Delete leaves the bar (a slip there is too easy) and sits at the foot of the form, as on a computer */
  html.ce-rail body.change-form #content .submit-row a.deletelink { display: none; }
  html.ce-rail body.change-form #content .ce-delete-foot { display: flex; justify-content: flex-start; margin: 18px 0 0; }
}
