/* RepliMee CRM styles.
   Base template from the design handover (tokens, shell, components), followed by
   app components the handover doesn't cover yet, built from the same tokens. */

:root {
  /* Colour (RepliMee) */
  --brand-teal: #0E7C66;
  --brand-mint: #7FE0C3; /* dark backgrounds only: too light for text on white */
  --accent: var(--brand-teal);
  --on-accent: #FFFFFF;
  --on-mint: #0B3B32;
  --dot: #2FB893;
  --accent-hover: #0B6352;
  --link: #0B6352;
  --link-hover: #0B4F42;

  --ground: #F4F6F5;
  --surface: #FFFFFF;
  --text: #141C1A;
  --text-muted: #55605D;
  --border: #E1E6E4;
  --border-strong: #C7CFCC;
  --divider: #EBEFED;
  --fill-subtle: #EDF1EF;

  --sidebar-bg: #10201D;
  --sidebar-text: #C2CECB;
  --sidebar-text-muted: #AEBBB7;
  --sidebar-label: #93A29E;
  --sidebar-hover: rgba(255, 255, 255, 0.06);
  --sidebar-active: rgba(255, 255, 255, 0.10);
  --sidebar-avatar: #24403A;

  --info-bg: #E6F5F0;
  --info-border: #BFE3D8;
  --info-text: #0B4F42;

  --priority-high-bg: #FDE2DD;
  --priority-high-text: #8A1F0F;

  /* Focus ring glow: the brand teal. */
  --focus-glow: rgba(14, 124, 102, 0.25);

  /* Not in the handover yet: status colours for badges and warning notices (AA contrast). */
  --success-bg: #DDF3E8;
  --success-text: #0B5A3A;
  --warning-bg: #FFF1D6;
  --warning-border: #F4D79A;
  --warning-text: #6B4300;

  /* Type */
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --text-xs: 12px;
  --text-sm: 13px;
  --text-md: 14px;
  --text-base: 15px;
  --text-lg: 17px;
  --text-xl: 28px;
  --text-kpi: 32px;

  /* Shape and spacing (4px base) */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-card: 14px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-10: 40px;
  --control-height: 44px;
  --sidebar-width: 248px;
  --content-max: 1280px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--text-base);
  line-height: 1.5;
}

a { color: var(--link); }
a:hover { color: var(--link-hover); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
h1, h2 { margin: 0; }

.icon { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.icon--bold { stroke-width: 2.2; }

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

.app { display: flex; min-height: 100vh; }

.sidebar {
  flex: 0 0 var(--sidebar-width);
  background: var(--sidebar-bg);
  padding: var(--space-6) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar :focus-visible { outline-color: #FFFFFF; }

.main { flex: 1; min-width: 0; padding: 28px var(--space-10) 48px; }

.container {
  max-width: var(--content-max);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}
.view { display: flex; flex-direction: column; gap: var(--space-6); min-width: 0; }

/* ---------- Sidebar ---------- */

.brand { display: block; padding: 4px var(--space-3) 0; }
.brand img { display: block; width: 100%; max-width: 170px; height: auto; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav__label {
  padding: 0 var(--space-3) var(--space-2);
  font-size: var(--text-xs); font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--sidebar-label);
}
.nav__item + .nav__label { padding-top: var(--space-5); }
.nav__item {
  display: flex; align-items: center; gap: var(--space-3);
  min-height: var(--control-height);
  padding: 0 var(--space-3);
  border-radius: var(--radius-md);
  color: var(--sidebar-text);
  font-weight: 500;
  text-decoration: none;
}
.nav__item:hover { color: #FFFFFF; background: var(--sidebar-hover); }
.nav__item[aria-current="page"] { color: #FFFFFF; background: var(--sidebar-active); font-weight: 600; }
.nav__item[aria-current="page"] svg { color: var(--brand-mint); }
.nav__item svg { flex-shrink: 0; }
.nav__text { flex: 1; }
.nav__count {
  min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 11px;
  background: var(--brand-mint); color: var(--on-mint);
  font-size: var(--text-xs); font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

.user {
  margin-top: auto;
  position: relative;
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-lg);
  background: var(--sidebar-hover);
}
.user__avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  background: var(--sidebar-avatar); color: #FFFFFF;
  font-weight: 700; font-size: var(--text-sm);
  display: flex; align-items: center; justify-content: center;
}
.user__meta { flex: 1; min-width: 0; }
.user__name { color: #FFFFFF; font-weight: 600; font-size: var(--text-md); }
.user__role { color: var(--sidebar-text-muted); font-size: var(--text-sm); }

/* Account menu (not in the handover yet): Change password and Log out. */
.menu {
  position: absolute; left: 0; right: 0; bottom: calc(100% + var(--space-2));
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: 0 12px 32px rgba(14, 26, 43, 0.28);
  padding: var(--space-2); display: flex; flex-direction: column; gap: 2px; z-index: 20;
}
.menu button {
  height: var(--control-height); border: 0; background: transparent; border-radius: var(--radius-md);
  text-align: left; padding: 0 var(--space-3); color: var(--text); font-weight: 500; justify-content: flex-start;
}
.menu button:hover { background: var(--ground); }
.sidebar .menu :focus-visible { outline-color: var(--link); }

/* ---------- Buttons ---------- */

.btn, button {
  height: var(--control-height);
  padding: 0 var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-md); font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  white-space: nowrap;
  /* Plain <button> defaults to the secondary style. */
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
}
button:hover { background: var(--ground); }
.btn--primary, button.primary { border: 0; background: var(--accent); color: var(--on-accent); font-size: var(--text-base); padding: 0 18px; }
.btn--primary:hover, button.primary:hover { background: var(--accent-hover); }
.btn--secondary { border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); }
.btn--secondary:hover { background: var(--ground); }
.btn--icon { width: var(--control-height); padding: 0; border: 0; background: transparent; color: var(--sidebar-text); }
.btn--icon:hover { color: #FFFFFF; background: var(--sidebar-hover); }
button.small { padding: 0 var(--space-3); }
button.danger { color: #A1200D; }
button.primary.danger { color: var(--on-accent); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Page header ---------- */

.page-header { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); }
.page-header__titles { flex: 1 1 240px; min-width: 0; }
.page-header h1 { font-size: var(--text-xl); line-height: 1.2; font-weight: 700; letter-spacing: -0.02em; }
.page-header__sub { color: var(--text-muted); }

.search-wrap { position: relative; flex: 1 1 240px; max-width: 340px; }
.search {
  display: flex; align-items: center; gap: 10px;
  height: var(--control-height); padding: 0 14px;
  background: var(--surface);
  border: 1px solid #CFD6D3; border-radius: var(--radius-md);
  color: var(--text-muted);
}
.search:focus-within { border-color: var(--link); box-shadow: 0 0 0 3px var(--focus-glow); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); height: auto; padding: 0; }

/* Search results (not in the handover yet): a dropdown card under the field. */
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; min-width: 300px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: 0 12px 32px rgba(14, 26, 43, 0.14);
  padding: var(--space-2) 0; z-index: 30; max-height: 70vh; overflow-y: auto;
}
.search-results__label {
  padding: var(--space-2) var(--space-4) var(--space-1);
  font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted);
}
.search-results a { display: block; padding: var(--space-2) var(--space-4); color: var(--text); text-decoration: none; }
.search-results a:hover, .search-results a:focus-visible { background: var(--ground); outline-offset: -2px; }
.search-results__meta { font-size: var(--text-sm); color: var(--text-muted); }
.search-results__empty { padding: var(--space-3) var(--space-4); color: var(--text-muted); font-size: var(--text-md); }

/* ---------- Notice banner ---------- */

.notice, .banner {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3);
  padding: 14px var(--space-4);
  background: var(--info-bg); border: 1px solid var(--info-border);
  border-radius: var(--radius-lg);
  color: var(--info-text);
}
.notice svg { flex-shrink: 0; }
.notice__body { flex: 1 1 320px; min-width: 0; }
.notice strong { font-weight: 600; }
.notice a { font-weight: 600; white-space: nowrap; }
.banner.info { background: var(--info-bg); border-color: var(--info-border); color: var(--info-text); }
.notice--warning, .banner:not(.info) { background: var(--warning-bg); border-color: var(--warning-border); color: var(--warning-text); }

/* ---------- Cards ---------- */

.card, .panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--space-5);
  min-width: 0;
}
.card__header { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding-bottom: var(--space-3); }
.card__header h2 { font-size: var(--text-lg); font-weight: 700; }
.card__header a { font-size: var(--text-md); font-weight: 600; white-space: nowrap; }
.panel h2 { font-size: var(--text-lg); font-weight: 700; margin: 0 0 var(--space-3); }
.panel h3 { font-size: var(--text-base); font-weight: 700; margin: var(--space-2) 0; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-4); }
.kpi { display: flex; flex-direction: column; gap: 6px; }
.kpi__label { font-size: var(--text-sm); font-weight: 600; color: var(--text-muted); }
.kpi__value { font-size: var(--text-kpi); line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi__note { font-size: var(--text-md); color: var(--text-muted); }

.panel-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); align-items: start; }

/* ---------- Lists inside cards ---------- */

ul.list { list-style: none; margin: 0; padding: 0; }
ul.list > li { display: flex; align-items: flex-start; gap: var(--space-3); padding: 14px 0; border-top: 1px solid var(--divider); }
ul.list > li:last-child { padding-bottom: 0; }
.list__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--space-1); }
/* A task opens when clicked */
/* A call from the browser, in progress */
.call-live { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--fill-subtle); padding: 12px; margin: 8px 0; }
.task-open { cursor: pointer; }
.task-open:hover .list__title { text-decoration: underline; }
.task-details { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--fill-subtle); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; font-size: var(--text-md); max-height: 50vh; overflow-y: auto; }
.list__title { font-weight: 600; }
.list__meta { font-size: var(--text-md); color: var(--text-muted); }
.list__meta--sm { font-size: var(--text-sm); }
.list__row { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.list__time { font-size: var(--text-sm); color: var(--text-muted); }
.list__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dot); margin-top: 8px; flex-shrink: 0; }
.list strong { font-weight: 600; }

/* Older list markup used by the other pages: rows split by a divider. */
div.list > div { padding: 14px 0; border-top: 1px solid var(--divider); }
div.list > div:first-child { border-top: 0; padding-top: var(--space-1); }

.badge, .tag {
  display: inline-block;
  padding: 2px var(--space-2); border-radius: var(--radius-sm);
  font-size: var(--text-xs); font-weight: 700; line-height: 1.5; white-space: nowrap;
  background: var(--fill-subtle); color: var(--text-muted);
}
.badge--high, .tag.red { background: var(--priority-high-bg); color: var(--priority-high-text); }
/* Not in the handover yet: other statuses. */
.badge--normal, .tag.blue { background: var(--info-bg); color: var(--info-text); }
.badge--low { background: var(--fill-subtle); color: var(--text-muted); }
.tag.green { background: var(--success-bg); color: var(--success-text); }
.tag.orange { background: var(--warning-bg); color: var(--warning-text); }

/* ---------- Empty state ---------- */

.empty {
  display: flex; flex-direction: column; align-items: center; gap: var(--space-3);
  padding: 32px var(--space-4);
  border: 1px dashed var(--border-strong); border-radius: var(--radius-lg);
  text-align: center; color: var(--text-muted);
}
.empty__icon {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--fill-subtle); color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
}
.empty__title { font-weight: 600; color: var(--text); }
.empty__text { font-size: var(--text-md); color: var(--text-muted); }

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

label { display: block; font-size: var(--text-sm); font-weight: 600; color: var(--text); margin-bottom: 6px; }
input, select, textarea {
  width: 100%; min-height: var(--control-height); padding: 0 var(--space-3);
  border: 1px solid #CFD6D3; border-radius: var(--radius-md);
  background: var(--surface); color: var(--text); font-size: var(--text-base);
}
textarea { padding: 10px var(--space-3); min-height: 96px; resize: vertical; line-height: 1.5; }
textarea.code { font-family: ui-monospace, Consolas, monospace; font-size: var(--text-sm); min-height: 140px; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--link); box-shadow: 0 0 0 3px var(--focus-glow); }
input[type="checkbox"] { width: 20px; height: 20px; min-height: 0; padding: 0; accent-color: var(--link); }
.field { margin-bottom: var(--space-4); }
/* Setting up the company */
.setup-progress { height: 8px; border-radius: 999px; background: var(--surface-2, #eef0f3); overflow: hidden; margin: 8px 0 4px; }
.setup-progress > span { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.setup-stage { margin-top: 16px; }
.setup-stage h2 { margin: 0; }
.setup-task { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--border, #e5e7eb); }
.setup-task:first-of-type { border-top: 0; }
.setup-task input { margin-top: 3px; width: 18px; height: 18px; flex: none; }
.setup-task__body { flex: 1; min-width: 0; }
.setup-task--done .setup-task__title { color: var(--text-muted, #6b7280); text-decoration: line-through; }
.setup-task__meta { font-size: var(--text-sm, 13px); color: var(--text-muted, #6b7280); margin-top: 2px; }
.check { display: flex; gap: var(--space-2); align-items: center; font-weight: 500; font-size: var(--text-md); min-height: var(--control-height); margin: 0; }

/* ---------- Tables ---------- */

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: var(--text-sm); color: var(--text-muted); font-weight: 600; padding: 10px var(--space-3); border-bottom: 1px solid var(--border); }
td { padding: var(--space-3); border-top: 1px solid var(--divider); vertical-align: top; }
tr.clickable:hover td { background: var(--ground); cursor: pointer; }

/* ---------- Layout helpers ---------- */

.muted { color: var(--text-muted); }
.small { font-size: var(--text-md); }
.right { text-align: right; }
.row { display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: var(--space-4); }
.grow { flex: 1; }
.hidden { display: none !important; }
.grid { display: grid; gap: var(--space-4); }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
/* In forms, each field's own bottom margin does the vertical spacing. */
form .grid, .modal .grid { row-gap: 0; }
pre.wrap { white-space: pre-wrap; margin: 0; font-family: inherit; }
.timeline .when { color: var(--text-muted); font-size: var(--text-sm); }

/* ---------- Inbox ---------- */

.conv-show { position: sticky; top: 0; z-index: 2; display: flex; gap: 6px; padding: 8px; margin-bottom: 4px; background: var(--surface); border-bottom: 1px solid var(--divider); }
.inbox { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: var(--space-4); height: calc(100vh - 190px); min-height: 480px; }
.conv-list { overflow-y: auto; padding: 0; }
.conv-item { padding: 14px var(--space-4); border-top: 1px solid var(--divider); cursor: pointer; }
.conv-item:first-child { border-top: 0; }
.conv-item:hover { background: var(--ground); }
.conv-item.active { background: var(--info-bg); }
.conv-item .preview { color: var(--text-muted); font-size: var(--text-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: var(--space-1); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dot); display: inline-block; }
.thread { display: flex; flex-direction: column; padding: 0; min-height: 0; overflow: hidden; }
.thread-head { padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--border); }
.messages { flex: 1; overflow-y: auto; padding: var(--space-4) var(--space-5); display: flex; flex-direction: column; gap: var(--space-2); background: var(--ground); min-height: 200px; }
.bubble { max-width: 75%; padding: 10px 14px; border-radius: 16px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }
.bubble.in { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.bubble.out { align-self: flex-end; background: var(--link); color: #FFFFFF; border-bottom-right-radius: 4px; }
.bubble .subject { font-weight: 600; padding-bottom: 4px; margin-bottom: 6px; border-bottom: 1px solid color-mix(in srgb, currentColor 25%, transparent); }
.bubble.out.human { background: #0F6B63; }
.bubble.out.system { background: #4A4546; }
.bubble .meta { font-size: var(--text-xs); opacity: 0.8; margin-top: var(--space-1); }
.composer { border-top: 1px solid var(--border); padding: var(--space-4) var(--space-5); }
.composer textarea { min-height: 64px; }
.typing { align-self: flex-end; color: var(--text-muted); font-size: var(--text-sm); font-style: italic; }

/* ---------- Pipeline board ---------- */

.board { display: grid; grid-template-columns: repeat(7, minmax(200px, 1fr)); gap: var(--space-3); overflow-x: auto; padding-bottom: var(--space-2); }
.column { background: var(--fill-subtle); border-radius: var(--radius-card); padding: var(--space-3); min-height: 320px; }
.column h3 { display: flex; justify-content: space-between; align-items: baseline; text-transform: capitalize; font-size: var(--text-md); margin: var(--space-1) var(--space-1) var(--space-3); }
.board .card { padding: var(--space-3); margin-bottom: var(--space-2); border-radius: var(--radius-lg); }
.board .card select { margin-top: var(--space-2); }

/* ---------- Dialogs and toasts ---------- */

.modal-back { position: fixed; inset: 0; background: rgba(35, 31, 32, 0.5); display: flex; align-items: flex-start; justify-content: center; padding: 60px var(--space-4); z-index: 50; overflow-y: auto; overscroll-behavior: contain; }
/* The page behind an open window doesn't scroll. */
html.modal-open, html.modal-open body { overflow: hidden; }
.modal { background: var(--surface); border-radius: var(--radius-card); padding: var(--space-6); width: 100%; max-width: 580px; box-shadow: 0 24px 60px rgba(14, 26, 43, 0.3); }
.modal h2 { font-size: 20px; margin-bottom: var(--space-4); }
.toast { position: fixed; bottom: var(--space-5); right: var(--space-5); background: var(--sidebar-bg); color: #FFFFFF; padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); z-index: 100; max-width: 420px; box-shadow: 0 12px 32px rgba(14, 26, 43, 0.3); }
.toast.error { background: #A1200D; }
.slot-list { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-2) 0; }
.slot-list button.selected { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

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

.login { max-width: 400px; margin: 14vh auto; }
.login h1 { font-size: 24px; margin-bottom: var(--space-4); }
.login .brand { padding: 0; margin-bottom: var(--space-6); }

/* ---------- Breakpoints ---------- */

@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel-grid { grid-template-columns: minmax(0, 1fr); }
  .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 800px) {
  .app { flex-direction: column; }
  .sidebar { flex-basis: auto; position: static; height: auto; }
  .main { padding: var(--space-5) var(--space-4) 32px; }
  .search-wrap { max-width: none; }
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: minmax(0, 1fr); }
  .inbox { grid-template-columns: minmax(0, 1fr); height: auto; }
  .user .menu { bottom: auto; top: calc(100% + var(--space-2)); }
}

@media (max-width: 520px) {
  .kpi-grid { grid-template-columns: minmax(0, 1fr); }
  .bubble { max-width: 90%; }
}

/* AI agents (Hire page) */
.agents { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-5); align-items: stretch; }
.agents-summary {
  display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card);
  padding: var(--space-3) var(--space-5); margin-bottom: var(--space-5); font-weight: 600;
}
.agents-summary strong { font-size: var(--text-lg); }
.agents-summary small { font-size: var(--text-sm); color: var(--text-muted); font-weight: 500; }

.agent-card {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.agent-card:hover { box-shadow: 0 8px 24px rgba(35, 31, 32, 0.08); transform: translateY(-2px); }
.agent-card--hired { border: 2px solid var(--accent); }
.agent-card__hero { position: relative; display: flex; justify-content: center; padding: var(--space-6) var(--space-4) var(--space-4); }
.agent-card__face { width: 128px; height: 128px; overflow: visible; }
.agent-card--soon .agent-card__face { opacity: 0.8; }
.agent-card__badge {
  position: absolute; top: var(--space-3); right: var(--space-3);
  font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; background: var(--fill-subtle); color: var(--text-muted);
}
.agent-card__badge--hired { background: var(--accent); color: var(--on-accent); }
.agent-card__body { display: flex; flex-direction: column; flex: 1; padding: var(--space-4) var(--space-5) var(--space-5); }
.agent-card__role { font-size: var(--text-lg); font-weight: 800; margin: 0; }
.agent-card__tagline { margin: 2px 0 var(--space-4); color: var(--text-muted); font-size: var(--text-md); }
.agent-card__label { font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: var(--space-2); }
.agent-card__functions { list-style: none; margin: 0 0 var(--space-4); padding: 0; font-size: var(--text-md); }
.agent-card__functions li { position: relative; padding-left: 24px; margin: 6px 0; line-height: 1.4; }
.agent-card__functions li::before {
  content: ""; position: absolute; left: 2px; top: 4px; width: 12px; height: 7px;
  border-left: 2.5px solid var(--success-text); border-bottom: 2.5px solid var(--success-text); transform: rotate(-45deg);
}
.agent-card__price { margin-top: auto; padding-top: var(--space-4); border-top: 1px solid var(--divider); }
.agent-card__amount { font-size: var(--text-xl); font-weight: 800; letter-spacing: -0.02em; }
.agent-card__per { color: var(--text-muted); font-weight: 600; margin-left: 2px; }
.agent-card__terms { font-size: var(--text-sm); color: var(--text-muted); }
.agent-card__needs { margin-top: var(--space-3); font-size: var(--text-sm); background: var(--warning-bg); color: var(--warning-text); border-radius: var(--radius-sm); padding: var(--space-2) var(--space-3); }
.agent-card__action { padding-top: var(--space-4); }
.agent-card__action button { width: 100%; }
/* Ticking agents to hire together */
.agent-pick { display: flex; width: 100%; justify-content: center; align-items: center; gap: 8px; cursor: pointer; }
.agent-pick input { width: auto; margin: 0; }
.agent-pick--on { background: var(--accent); color: #fff; border-color: var(--accent); }
.agent-pick__note { margin-top: 6px; text-align: center; }
.agent-pick__note:empty { display: none; }
.agent-card--picked { border: 2px solid var(--accent); }
/* Above the floating Assistant button */
.hire-bar { position: sticky; bottom: 76px; z-index: 5; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; padding: 12px 16px; background: var(--surface); border: 2px solid var(--accent); border-radius: var(--radius-card); box-shadow: 0 8px 24px rgba(35, 31, 32, 0.12); }

[hidden] { display: none !important; }

/* PA seats */
.agent-card__seats { margin-top: var(--space-3); display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; font-size: var(--text-md); }
.agent-card__seats button { margin-left: auto; }
.seat-list { max-height: 50vh; overflow: auto; }
/* Choosing skills */
.skill-picker__menu { position: relative; }
.skill-picker__summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: var(--control-height); padding: 6px 36px 6px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); position: relative; }
.skill-picker__summary::-webkit-details-marker { display: none; }
.skill-picker__summary::after { content: "▾"; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.skill-picker__menu[open] .skill-picker__summary { border-color: var(--accent); }
.skill-picker__list { max-height: 220px; overflow: auto; padding: 6px 12px; border: 1px solid var(--border); border-top: 0; background: var(--surface); }
.skill-picker__add { gap: 6px; padding: 8px 12px; border: 1px solid var(--border); border-top: 0; border-radius: 0 0 var(--radius-sm) var(--radius-sm); background: var(--surface); }
.skill-picker__add input { flex: 1; }
.seat { display: flex; gap: var(--space-3); align-items: center; padding: var(--space-2) 0; }

/* Personal Assistant panel */
.assistant-fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 40;
  display: flex; align-items: center; gap: 8px; height: 52px; padding: 0 18px 0 6px;
  border: 0; border-radius: 999px; background: var(--sidebar-bg); color: #fff; font-weight: 700;
  box-shadow: 0 8px 24px rgba(35, 31, 32, 0.25); cursor: pointer;
}
.assistant-fab:hover { background: #1B332E; }
.assistant-fab__face svg, .assistant__face svg { width: 40px; height: 40px; display: block; overflow: visible; }
.assistant {
  position: fixed; right: 20px; bottom: 84px; z-index: 41; width: min(420px, calc(100vw - 32px)); height: min(640px, calc(100vh - 110px));
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card);
  box-shadow: 0 16px 48px rgba(35, 31, 32, 0.2); overflow: hidden;
}
.assistant__head { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-3) var(--space-3); border-bottom: 1px solid var(--divider); background: var(--info-bg); }
.assistant__titles { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.assistant__titles select { height: 28px; font-size: var(--text-sm); padding: 0 6px; border-radius: var(--radius-sm); max-width: 100%; }
.assistant__head .btn--icon {
  width: 36px; height: 36px; padding: 0; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text);
}
.assistant__head .btn--icon:hover { background: var(--fill-subtle); color: var(--text); }
.assistant__msgs { flex: 1; overflow-y: auto; padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-3); }
.assistant__empty p { margin: 0 0 var(--space-3); font-size: var(--text-md); }
.assistant__suggestions { display: flex; flex-direction: column; gap: var(--space-2); }
.assistant__suggestions button { text-align: left; height: auto; padding: 10px 12px; font-size: var(--text-md); }
.assistant__form { display: flex; gap: var(--space-2); padding: var(--space-3); border-top: 1px solid var(--divider); align-items: flex-end; }
.assistant__form textarea { flex: 1; resize: none; min-height: 44px; max-height: 160px; padding: 11px 12px; font: inherit; line-height: 1.4; }
.assistant__form button { width: 44px; padding: 0; flex-shrink: 0; }

.bubble { max-width: 88%; padding: 10px 14px; border-radius: 14px; font-size: var(--text-md); line-height: 1.45; overflow-wrap: anywhere; }
.bubble--me { align-self: flex-end; background: var(--sidebar-bg); color: #fff; border-bottom-right-radius: 4px; white-space: pre-wrap; }
.bubble--ai { align-self: flex-start; background: var(--fill-subtle); border-bottom-left-radius: 4px; }
.md p { margin: 0 0 8px; } .md p:last-child { margin-bottom: 0; }
.md ul, .md ol { margin: 4px 0 8px; padding-left: 1.3em; }
.md code { background: rgba(0,0,0,0.06); padding: 1px 4px; border-radius: 4px; font-size: 0.92em; }
.md-table { overflow-x: auto; margin: 4px 0 8px; }
.md-table table { font-size: var(--text-sm); }
.md-table th, .md-table td { padding: 6px 8px; text-align: left; border-bottom: 1px solid var(--divider); white-space: nowrap; }
.draft { position: relative; background: var(--surface); border-left: 3px solid var(--accent); border-radius: var(--radius-sm); padding: 10px 12px; margin: 6px 0 8px; }
.draft__copy { position: absolute; top: 6px; right: 6px; height: 26px; padding: 0 8px; font-size: var(--text-xs); }
.draft__text { padding-right: 56px; white-space: normal; }
.typing { display: flex; gap: 4px; padding: 14px; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--text-muted); opacity: 0.4; animation: typing 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: 0.2s; } .typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing { 0%, 60%, 100% { opacity: 0.3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .typing span { animation: none; } .agent-card { transition: none; } }

/* Bookkeeping */
.xero-bar { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); flex-wrap: wrap; }
.xero-bar svg { width: 52px; height: 52px; overflow: visible; }
.bk-ask { display: flex; flex-direction: column; }
.bk-ask__msgs { flex: 1; min-height: 160px; max-height: 420px; overflow-y: auto; display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-3); }
td.right, th.right { text-align: right; }
@media (max-width: 800px) { .assistant { right: 16px; bottom: 80px; } .assistant-fab { right: 16px; bottom: 16px; } }

/* Receipts */
.snap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: var(--space-5); align-items: start; }
.snap__intro { display: flex; gap: var(--space-3); }
.snap__intro h2 { margin-bottom: 4px; }
.snap__intro .icon { color: var(--accent); flex-shrink: 0; margin-top: 2px; }
.snap__form .row button { flex: 1; }
.receipt-list { display: flex; flex-direction: column; }
.receipt-row {
  display: grid; grid-template-columns: 52px minmax(0, 1fr) auto auto; gap: var(--space-3); align-items: center;
  width: 100%; height: auto; padding: var(--space-2) 0; border: 0; border-bottom: 1px solid var(--divider); border-radius: 0;
  background: none; text-align: left; font: inherit; color: inherit;
}
.receipt-row:hover { background: var(--fill-subtle); }
.receipt-row__thumb { width: 52px; height: 52px; object-fit: cover; border-radius: var(--radius-sm); background: var(--fill-subtle); }
.receipt-row__main { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.receipt-row__main > * { overflow: hidden; text-overflow: ellipsis; }
.receipt-row__amount { font-weight: 700; font-variant-numeric: tabular-nums; }
.receipt-row__warn { color: var(--warning-text); display: inline-flex; gap: 4px; align-items: center; }
.modal:has(.receipt-review) { max-width: 980px; }
.receipt-review { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: var(--space-6); }
.receipt-review__image img { width: 100%; max-height: 70vh; object-fit: contain; border-radius: var(--radius-md); background: var(--fill-subtle); }
.receipt-warnings { margin: 0; padding: var(--space-2) var(--space-3) var(--space-2) 2em; background: var(--warning-bg); color: var(--warning-text); border-radius: var(--radius-sm); font-size: var(--text-md); }
.receipt-facts { display: grid; grid-template-columns: auto 1fr; gap: 6px var(--space-4); margin: 0; }
.receipt-facts dt { color: var(--text-muted); font-weight: 600; }
.receipt-facts dd { margin: 0; }
.segmented { position: relative; display: flex; gap: 0; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.segmented label { flex: 1; display: flex; margin: 0; align-self: stretch; align-items: center; justify-content: center; text-align: center; gap: 6px; padding: 10px; cursor: pointer; font-weight: 600; font-size: var(--text-md); }
.segmented label:has(input:checked) { background: var(--sidebar-bg); color: #fff; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label:has(input:focus-visible) { outline: 2px solid var(--focus-glow); }
@media (max-width: 800px) {
  .snap, .receipt-review { grid-template-columns: 1fr; }
  .receipt-row { grid-template-columns: 44px minmax(0, 1fr) auto; }
  .receipt-row > span:last-child { grid-column: 2 / -1; }
}
.receipt-row__pdf { display: flex; align-items: center; justify-content: center; font-size: var(--text-xs); font-weight: 800; color: var(--text-muted); }
.tabs { display: flex; gap: var(--space-1); border-bottom: 1px solid var(--border); margin-bottom: 0; }
/* More tabs than fit: they scroll sideways inside the bar, not the whole page */
.tabs { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs button, .tabs a.tab { flex-shrink: 0; white-space: nowrap; }
.tabs button, .tabs a.tab { display: inline-flex; align-items: center; text-decoration: none; border: 0; border-radius: var(--radius-sm) var(--radius-sm) 0 0; background: none; height: 40px; padding: 0 var(--space-4); font-weight: 600; color: var(--text-muted); }
.tabs button[aria-selected="true"], .tabs a.tab[aria-selected="true"] { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-bottom-color: var(--surface); margin-bottom: -1px; }
@media (max-width: 640px) { .tabs { overflow-x: auto; scrollbar-width: none; } .tabs button, .tabs a.tab { flex-shrink: 0; white-space: nowrap; padding: 0 var(--space-3); } }
/* Long links and keys (e.g. the lead webhook address) wrap instead of widening the page on phones */
.panel code { overflow-wrap: anywhere; }

/* Notifications */
.bell-wrap { position: relative; }
/* Switching company, at the top of the side menu (it takes the place of the "Workspace" heading) */
.company-switch { position: relative; margin-bottom: var(--space-3); }
.company-switch:not(.hidden) + .nav .nav__label[data-group="workspace"] { display: none; }
.company-switch__btn { display: flex; align-items: center; gap: 8px; width: 100%; height: var(--control-height); padding: 0 12px; border: 1px solid rgba(255, 255, 255, 0.16); border-radius: var(--radius-md); background: var(--sidebar-hover); color: #FFFFFF; font-weight: 600; justify-content: flex-start; }
.company-switch__btn:hover { background: var(--sidebar-active); }
.company-switch__btn { height: auto; min-height: var(--control-height); padding-top: 6px; padding-bottom: 6px; }
.company-switch__name { flex: 1; min-width: 0; text-align: left; line-height: 1.25; white-space: normal; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.company-switch__dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: #7FE0C3; }
.company-switch__menu { left: 0; right: 0; bottom: auto; top: calc(100% + var(--space-2)); max-height: 60vh; overflow-y: auto; }
.company-switch__menu button { display: flex; align-items: center; gap: 8px; flex: none; }
.company-switch__menu button:disabled { opacity: 1; cursor: default; }
.company-switch__item { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bell {
  position: relative; width: var(--control-height); height: var(--control-height); padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-strong); border-radius: var(--radius-md); background: var(--surface); color: var(--text);
}
.bell:hover { background: var(--fill-subtle); }
.bell__count {
  position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px;
  background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 800; line-height: 20px; text-align: center;
}
.bell-panel {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 45; width: min(400px, calc(100vw - 32px));
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: 0 16px 48px rgba(35, 31, 32, 0.18);
  overflow: hidden;
}
.bell-panel__head { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--divider); }
.bell-panel__list { max-height: min(480px, 70vh); overflow-y: auto; }
.notif {
  display: flex; justify-content: flex-start; align-items: flex-start; gap: var(--space-3); width: 100%; height: auto;
  padding: var(--space-3) var(--space-4); text-align: left; white-space: normal; font-weight: 400;
  border: 0; border-bottom: 1px solid var(--divider); border-radius: 0; background: none; font: inherit; color: inherit;
}
.notif__main { flex: 1; overflow-wrap: anywhere; }
.bell-panel__list { overflow-x: hidden; }
.notif:hover { background: var(--fill-subtle); }
.notif--unread { background: #EEF8F4; }
.notif__main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.notif__dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; background: var(--border-strong); }
.notif__dot--urgent { background: #D2361F; }
.notif__dot--action { background: var(--accent); }
.notif__dot--info { background: var(--sidebar-label); }
.np-device { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); padding: var(--space-4); }
.np-group { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.np-group legend { font-weight: 700; margin-bottom: var(--space-2); }
.np-group .check { align-items: flex-start; }

/* Phone layout: compact top bar, menu behind a button */
.sidebar__top { display: flex; align-items: center; justify-content: space-between; }
.sidebar__body { display: flex; flex-direction: column; gap: 28px; flex: 1; }
.nav-toggle { display: none; }
@media (max-width: 800px) {
  .app { flex-direction: column; }
  .sidebar { position: sticky; top: 0; z-index: 30; height: auto; flex-basis: auto; padding: 10px var(--space-4); gap: 0; overflow: visible; }
  .sidebar .brand img { width: 150px; height: auto; }
  .nav-toggle {
    display: inline-flex; position: relative; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0;
    border: 0; border-radius: var(--radius-md); background: transparent; color: #FFFFFF;
  }
  .nav-toggle:hover { background: var(--sidebar-hover); }
  .nav-toggle__dot { position: absolute; top: 9px; right: 9px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
  .sidebar__body { display: none; }
  body.nav-open .sidebar__body {
    display: flex; position: fixed; inset: 64px 0 0 0; z-index: 30; overflow-y: auto;
    background: var(--sidebar-bg); padding: var(--space-4) var(--space-4) var(--space-6);
  }
  body.nav-open { overflow: hidden; }
  .page-header { flex-wrap: wrap; }
  .bell-panel { position: fixed; left: 16px; right: 16px; top: 72px; width: auto; }
}
.np-times input { width: auto; flex: 0 0 auto; }
.np-times span { color: var(--text-muted); }
body.nav-open .assistant-fab, body.nav-open .assistant { display: none; }

/* An agent's own page */
.train { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: var(--space-4); align-items: start; }
.train-chat { display: flex; flex-direction: column; padding: 0; overflow: hidden; height: calc(100vh - 170px); min-height: 520px; position: sticky; top: 16px; }
.train-chat__head { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-4) var(--space-4) var(--space-3); border-bottom: 1px solid var(--divider); }
.train-chat__head svg { width: 52px; height: 52px; flex-shrink: 0; overflow: visible; }
.train-chat__head h2 { margin: 0; }
.train-chat__head p { margin: 2px 0 0; }
.train-chat__head > div { flex: 1; }
.train-chat__msgs { flex: 1; }
.train-change { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin-top: 8px; padding: 6px 10px; border-radius: var(--radius-sm); background: var(--info-bg); color: var(--info-text); font-size: var(--text-sm); }
.train-coaching { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); margin: 0 var(--space-3); padding: 8px 12px; border-radius: var(--radius-sm); background: var(--warning-bg); color: var(--warning-text); font-size: var(--text-sm); }
.instr-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.instr { padding: var(--space-3) 0; border-bottom: 1px solid var(--divider); display: grid; grid-template-columns: 1fr auto; gap: 4px var(--space-3); }
.instr__text { font-size: var(--text-md); }
.instr__meta { grid-column: 1; }
.instr__actions { grid-row: 1 / span 2; grid-column: 2; display: flex; gap: var(--space-2); align-items: flex-start; }
.instr--off .instr__text { color: var(--text-muted); text-decoration: line-through; }
.work-list { display: flex; flex-direction: column; }
.work-row { display: flex; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) 0; border-bottom: 1px solid var(--divider); }
.work-row .row { flex-shrink: 0; align-items: flex-start; }
.agent-card__action .row .btn { justify-content: center; }
.assistant__head a.btn--icon { color: var(--text); }
@media (max-width: 1000px) {
  .train { grid-template-columns: minmax(0, 1fr); }
  .train-chat { position: static; height: 70vh; }
  .instr { grid-template-columns: 1fr; }
  .instr__actions { grid-row: auto; grid-column: 1; }
}

/* ---------- Support tickets ---------- */
.support-link { margin-bottom: var(--space-4); }
.conv-filter { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--divider); position: sticky; top: 0; background: var(--surface); display: flex; flex-direction: column; gap: var(--space-2); }
.ticket-controls { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--space-2) var(--space-3); }
.ticket-controls label { display: flex; flex-direction: column; gap: 2px; font-weight: 600; }
.ticket-controls select { width: 100%; min-height: 36px; padding: 4px 8px; }
/* A ticket scrolls as one page, so the reply box is always reachable on smaller screens. */
.thread.ticket-view { overflow-y: auto; }
.ticket-view .messages { flex: none; overflow: visible; min-height: 120px; }
.bubble.note { align-self: stretch; max-width: none; background: var(--warning-bg); color: var(--warning-text); border: 1px solid var(--warning-border); }

/* ---------- Calendar (Appointments page) ---------- */
.cal-toolbar { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-4); }
.cal-toolbar .row { gap: var(--space-2); flex-wrap: wrap; }
.cal-toolbar select { width: auto; }
.cal-title { font-size: var(--text-lg); margin: 0 0 0 var(--space-2); }
.btn--icon-text { min-width: 40px; font-size: 20px; line-height: 1; }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-md); overflow: hidden; }
.seg button { border: 0; border-radius: 0; background: var(--surface); }
.seg button + button { border-left: 1px solid var(--border-strong); }
.seg button.on { background: var(--info-bg); color: var(--info-text); font-weight: 700; }
.cal-wrap { padding: 0; overflow-x: auto; }
.cal { min-width: calc(56px + var(--cols) * 120px); }
.cal-head, .cal-body { display: grid; grid-template-columns: 56px repeat(var(--cols), minmax(120px, 1fr)); }
.cal-head { position: sticky; top: 0; z-index: 3; background: var(--surface); border-bottom: 1px solid var(--border); }
.cal-colhead { padding: 10px 8px; border-left: 1px solid var(--divider); display: flex; flex-direction: column; min-width: 0; }
.cal-colhead strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-colhead span { font-size: var(--text-xs); color: var(--text-muted); }
.cal-colhead.today strong { color: var(--accent); }
.cal-times { position: relative; }
.cal-times span { position: absolute; right: 8px; transform: translateY(-50%); font-size: var(--text-xs); color: var(--text-muted); }
.cal-times span:first-child { transform: none; }
.cal-col { position: relative; border-left: 1px solid var(--divider); cursor: pointer;
  background-image: repeating-linear-gradient(to bottom, var(--border) 0 1px, transparent 1px var(--hour)); }
.cal-col:hover { background-color: color-mix(in srgb, var(--accent) 3%, transparent); }
.cal-off { position: absolute; left: 0; right: 0; background: color-mix(in srgb, var(--text) 6%, transparent); pointer-events: none; }
.cal-busy { position: absolute; border-radius: var(--radius-sm); border: 1px dashed var(--border-strong); pointer-events: none;
  background: repeating-linear-gradient(135deg, var(--fill-subtle) 0 6px, var(--surface) 6px 12px); font-size: var(--text-xs); color: var(--text-muted); padding: 2px 6px; overflow: hidden; }
.cal-event { position: absolute; z-index: 1; text-align: left; border: 0; border-left: 4px solid var(--c); border-radius: var(--radius-sm); padding: 3px 6px;
  background: color-mix(in srgb, var(--c) 14%, var(--surface)); color: var(--text); font-size: var(--text-xs); line-height: 1.3; overflow: hidden; min-height: 0; cursor: pointer; display: flex; flex-direction: column; align-items: flex-start; }
.cal-event:hover { background: color-mix(in srgb, var(--c) 24%, var(--surface)); }
.cal-event strong, .cal-event span { display: block; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-event--short { justify-content: center; padding-top: 0; padding-bottom: 0; }
.cal-event--done { opacity: 0.6; }
.cal-now { position: absolute; left: 0; right: 0; height: 2px; background: #D93F2B; z-index: 2; pointer-events: none; }
.cal-now::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: #D93F2B; }
.cal-legend { margin-top: var(--space-2); }
/* Your own Outlook events (details only you can see) */
.cal-mine { pointer-events: auto; cursor: pointer; text-align: left; border-style: solid; border-color: var(--border-strong); background: var(--fill-subtle); color: var(--text); display: flex; flex-direction: column; align-items: flex-start; min-height: 0; line-height: 1.3; z-index: 1; }
.cal-mine:hover { background: var(--border); }
.cal-mine strong, .cal-mine span { display: block; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-mine span { color: var(--text-muted); }
.cal-mine--free { background: var(--surface); border-style: dashed; }
.cal-allday { display: block; margin-top: 4px; padding: 2px 6px; border-radius: var(--radius-sm); font-size: var(--text-xs); font-style: normal; text-align: left; min-height: 0; border: 1px solid var(--border-strong); background: var(--fill-subtle); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; width: 100%; }
button.cal-allday { cursor: pointer; }

/* ---------- Working hours picker (Team) ---------- */
.hours-picker { border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-2) var(--space-3); }
.hours-row { display: grid; grid-template-columns: 130px minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: var(--space-2); padding: 4px 0; }
.hours-row + .hours-row { border-top: 1px solid var(--divider); }
.hours-row input[type="time"] { min-height: 38px; padding: 4px 8px; }
.hours-day { margin: 0; font-weight: 600; }
.hours-to { color: var(--text-muted); font-size: var(--text-sm); }
.hours-off { display: none; grid-column: 2 / -1; }
.hours-row--off input[type="time"], .hours-row--off .hours-to { display: none; }
.hours-row--off .hours-off { display: block; }
.hours-actions { flex-wrap: wrap; gap: var(--space-2); padding-top: var(--space-2); border-top: 1px solid var(--divider); margin-top: 4px; }
@media (max-width: 480px) { .hours-row { grid-template-columns: 1fr 1fr; } .hours-day { grid-column: 1 / -1; } .hours-to { display: none; } }

/* ---------- Appointment types picker (Team) ---------- */
.types-picker { border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-1) var(--space-3); }
.types-row { display: flex; align-items: flex-start; gap: var(--space-2); padding: 8px 0; margin: 0; }
.types-row + .types-row { border-top: 1px solid var(--divider); }
.types-row input { margin-top: 3px; }
.types-skill { display: block; color: var(--warning-text); }
.types-skill:empty { display: none; }

/* ---------- My calendars ---------- */
.mycal-section { padding: var(--space-3) 0; border-top: 1px solid var(--divider); }
.mycal-section:first-of-type { border-top: 0; padding-top: 0; }
.mycal-section h3 { font-size: var(--text-md); margin: 0 0 var(--space-2); }
.mycal-row { display: flex; align-items: center; gap: var(--space-3); padding: 8px 0; }
.mycal-row + .mycal-row { border-top: 1px solid var(--divider); }
.mycal-main { flex: 1; min-width: 0; }
.mycal-error { color: var(--warning-text); }
.mycal-add select { flex: 1; min-width: 0; }
.mycal-help { margin-top: var(--space-3); }
.mycal-help p { margin: 6px 0; }

/* Your own calendars, colour-coded (--mc: that calendar's colour) */
.cal-mine { border: 1px solid color-mix(in srgb, var(--mc, #57534E) 35%, transparent); border-left: 4px solid var(--mc, #57534E); background: color-mix(in srgb, var(--mc, #57534E) 10%, var(--surface)); }
.cal-mine:hover { background: color-mix(in srgb, var(--mc, #57534E) 18%, var(--surface)); }
.cal-mine--free { border-style: dashed; border-left-style: solid; background: var(--surface); }
.cal-allday--mine { border-color: color-mix(in srgb, var(--mc) 35%, transparent); border-left: 4px solid var(--mc); background: color-mix(in srgb, var(--mc) 10%, var(--surface)); }
.cal-key { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); margin: 0 0 var(--space-3); font-size: var(--text-sm); color: var(--text-muted); }
.cal-key__item { display: inline-flex; align-items: center; gap: 6px; }
.cal-key__dot { width: 12px; height: 12px; border-radius: 3px; background: color-mix(in srgb, var(--mc) 25%, var(--surface)); border-left: 4px solid var(--mc); }
.cal-key__dot--booking { --mc: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--surface)); }

/* RepliMee bookings are solid blocks, so they never look like an outside calendar's event */
.cal-event { background: var(--c); color: #FFFFFF; border-left-color: color-mix(in srgb, var(--c) 60%, #000); }
.cal-event:hover { background: color-mix(in srgb, var(--c) 85%, #000); }
.cal-event--done { opacity: 0.55; }
.cal-key__dot--booking { background: var(--mc); border-left-color: color-mix(in srgb, var(--mc) 60%, #000); }

/* Train agents page */
.train-card .agent-card__face { width: 56px; height: 56px; flex: none; }
.agent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-4); }

/* ---------- Search-as-you-type picker ---------- */
.picker { position: relative; }
.picker__chosen { display: flex; align-items: center; gap: var(--space-2); min-height: var(--control-height); padding: 6px 6px 6px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-md); background: var(--fill-subtle); }
.picker__chosen strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker__kind { font-size: var(--text-xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.picker__kind:empty { display: none; }
.picker__list { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); max-height: 280px; overflow-y: auto; margin: 0; padding: 4px; list-style: none; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-md); box-shadow: 0 12px 32px rgba(14, 26, 43, 0.18); }
.picker__option { padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer; display: flex; flex-direction: column; }
.picker__option span { font-size: var(--text-sm); color: var(--text-muted); }
.picker__option.active, .picker__option:hover { background: var(--info-bg); }
.picker__group { padding: 8px 10px 2px; font-size: var(--text-xs); font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.picker__note { padding: 10px; color: var(--text-muted); font-size: var(--text-sm); }
.ticket-tasks { padding: var(--space-3) var(--space-5); border-top: 1px solid var(--border); }

/* ---------- Billing ---------- */
.checkout__head { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.checkout__head .agent-card__face { width: 52px; height: 52px; flex: none; }
.checkout__card { display: flex; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.checkout__card > div { flex: 1; }
.bill-table { width: 100%; border-collapse: collapse; margin: var(--space-3) 0; }
.bill-table td { padding: 6px 0; border-bottom: 1px solid var(--divider); }
.bill-table .num { text-align: right; white-space: nowrap; }
.bill-table .bill-sub td { color: var(--text-muted); }
.bill-table .bill-total td { font-weight: 700; border-bottom: 0; padding-top: 10px; }
.card__actions { margin-top: 6px; }

/* ---------- Files in agent training ---------- */
.file-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.pending-files { padding: var(--space-2) var(--space-4) 0; margin: 0; }
.file-chip { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-sm); background: var(--fill-subtle); color: var(--text); border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bubble--me .file-chip { background: rgba(255, 255, 255, 0.18); color: inherit; border-color: rgba(255, 255, 255, 0.3); }
.file-chip__x { border: 0; background: none; min-height: 0; padding: 0 2px; font-size: 16px; line-height: 1; cursor: pointer; color: var(--text-muted); }
.attach-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; padding: 0 10px; cursor: pointer; font-size: 18px; }
.ref-content { max-height: 60vh; overflow-y: auto; background: var(--fill-subtle); padding: var(--space-3); border-radius: var(--radius-md); font-size: var(--text-sm); }

/* Tasks done by AI agents */
/* Marketing */
/* Solar Designer */
.sd-roof { position: relative; margin-top: 10px; border-radius: var(--radius-sm); overflow: hidden; aspect-ratio: 1; background: #222; }
.sd-roof img, .sd-roof svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.sd-roof polygon { fill: rgba(14, 124, 102, 0.6); stroke: #fff; stroke-width: 1.2; }
.sd-roof polygon.spot-panel { cursor: pointer; }
.sd-roof polygon.spot-panel:hover { fill: rgba(180, 35, 24, 0.55); }
.sd-roof polygon.spot-spare { fill: rgba(255, 255, 255, 0.08); stroke: rgba(255, 255, 255, 0.55); stroke-dasharray: 4 3; }
.sd-roof polygon.spot-removed { fill: rgba(180, 35, 24, 0.15); stroke: #ff6b5e; stroke-width: 2; cursor: pointer; }
.sd-roof polygon.spot-removed:hover { fill: rgba(14, 124, 102, 0.45); }
.sd-roof polygon.obstruction-active { fill: rgba(255, 150, 0, 0.25); stroke: #ff9600; stroke-width: 2.5; cursor: pointer; }
.sd-roof polygon.obstruction-active:hover { fill: rgba(255, 150, 0, 0.5); }
.sd-roof polygon.spot-doubt { stroke: #f5a524; stroke-width: 3; stroke-dasharray: none; }
.sd-roof polygon.spot-check { stroke: #4cc9f0; stroke-width: 3; }
.sd-roof polygon.suggest { fill: rgba(236, 72, 153, 0.15); stroke: #ec4899; stroke-width: 2.5; stroke-dasharray: 5 4; cursor: pointer; }
.sd-roof polygon.suggest:hover { fill: rgba(236, 72, 153, 0.35); }
.sd-roof circle.missed { fill: none; stroke: #4cc9f0; stroke-width: 2.5; stroke-dasharray: 6 4; }
.sd-check { margin: 6px 0 0; padding-left: 18px; font-size: 14px; }
.sd-check li { margin: 4px 0; }
.sd-roof .face-rank { pointer-events: none; }
.sd-roof .face-rank circle { fill: rgba(17, 24, 39, 0.75); stroke: #fff; stroke-width: 2; }
.sd-roof .face-rank text { fill: #fff; font: 700 16px system-ui, sans-serif; text-anchor: middle; dominant-baseline: central; }
.sd-faces { width: 100%; margin-top: 10px; border-collapse: collapse; font-size: 14px; }
.sd-faces th, .sd-faces td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border, #e5e7eb); }
.sd-faces tr.muted td { opacity: 0.6; }
.face-badge { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: #111827; color: #fff; font-weight: 700; font-size: 12px; }
.sd-roof polygon.obstruction-ignored { fill: none; stroke: rgba(255, 150, 0, 0.7); stroke-width: 2; stroke-dasharray: 3 3; cursor: pointer; }
.sd-chart { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; align-items: end; height: 140px; margin: 10px 0 6px; }
.sd-month { display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; }
.sd-bars { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.sd-bars span { width: 40%; border-radius: 2px 2px 0 0; }
.sd-gen { background: #F2B233; }
.sd-use { background: #B9C4C0; }
.sd-key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: middle; margin: 0 4px 0 8px; }
.sd-equip input:not([type="checkbox"]), .sd-equip select { width: 100%; min-width: 60px; }

/* Knowledge base folders */
.kb-source { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; }
.kb-pick-list { display: grid; gap: 6px; max-height: 45vh; overflow: auto; }
.kb-pick { text-align: left; justify-content: flex-start; width: 100%; }
.kb-pick-here { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.mk-list { display: grid; gap: 8px; }
.research__summary { padding: var(--space-3) var(--space-4); margin: 12px 0; background: var(--ground); border-radius: var(--radius-sm); }
.research h3 { margin: 18px 0 6px; }
.research__sources { padding-left: 22px; }
.research__sources a { overflow-wrap: anywhere; }
.research dd.md p { margin: 0; }
.mk-item { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; }
.mk-item summary { cursor: pointer; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mk-item__body { white-space: pre-wrap; margin: 10px 0; line-height: 1.5; }
.mk-advice { display: flex; gap: 12px; align-items: flex-start; margin-top: 12px; padding: 12px; border-radius: var(--radius-sm); background: var(--ground); }
.mk-advice .agent-card__face { width: 44px; height: 44px; flex: none; }
.mk-advice .mk-item__body { margin: 0; }
.mk-activity { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
#mk-write .segmented { flex-wrap: wrap; }
#mk-write .segmented label { flex: 1 1 auto; white-space: nowrap; }

.agent-task { margin-top: 6px; }
.agent-task details { margin-top: 4px; }
.agent-task pre { background: var(--fill-subtle); padding: 8px 10px; border-radius: var(--radius-sm); margin: 4px 0 0; }

/* A click outside a dialog with unsaved changes: a small nudge instead of closing */
@keyframes modal-nudge { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.modal--nudge { animation: modal-nudge 0.25s ease-in-out 2; }
@media (prefers-reduced-motion: reduce) { .modal--nudge { animation: none; } }

/* Messages from an agent to its trainers */
.note-row { padding: 10px 0; border-bottom: 1px solid var(--border); }
.note-row:last-child { border-bottom: 0; }
.note-row__text { white-space: pre-wrap; }
.note-row--done { padding: 6px 0; }
.bubble--note { border-left: 3px solid #f5a524; white-space: pre-wrap; }

/* Product serial numbers on support tickets */
.serials { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.serial-row { display: flex; gap: 6px; width: 100%; max-width: 360px; }
.serial-row input { flex: 1; }
.serial-x { min-width: 32px; }

/* Website (Web Developer) */
.web { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(0, 1.6fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .web { grid-template-columns: 1fr; } }
.web-section { border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 10px; }
.web-items { display: grid; gap: 8px; margin-top: 6px; }
.web-item { display: grid; grid-template-columns: 1fr 2fr auto; gap: 6px; align-items: start; }
@media (max-width: 640px) { .web-item { grid-template-columns: 1fr; } }
.web-thumb { width: 72px; height: 52px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }
.web-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.web-photo { position: relative; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; padding: 0; background: none; }
.web-photo img { width: 100%; height: 76px; object-fit: cover; display: block; }
.web-photo .danger { position: absolute; top: 4px; right: 4px; }
.web-photo.pick { cursor: pointer; }
.web-photo.pick:hover { outline: 3px solid var(--accent, #1F6F5C); }
.web-preview { width: 100%; height: 640px; border: 1px solid var(--border); border-radius: 10px; margin-top: 10px; background: #fff; }
table.dns { width: 100%; border-collapse: collapse; font-size: 14px; margin: 8px 0; }
table.dns th, table.dns td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); }

table.files { width: 100%; border-collapse: collapse; font-size: 14px; }
table.files td { padding: 8px 6px; border-bottom: 1px solid var(--border); vertical-align: top; word-break: break-all; }
details.sub { border-bottom: 1px solid var(--border); padding: 8px 0; }
details.sub dl { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; font-size: 13px; margin: 8px 0; }
details.sub dt { color: var(--text-muted); }

/* Website chat (Web Developer → Website tab) */
.wd-chat { margin-bottom: var(--space-4); }
.wd-chat__log { display: flex; flex-direction: column; gap: var(--space-2); max-height: 340px; overflow-y: auto; margin: var(--space-3) 0; }
.wd-chat__log:empty { display: none; }
.wd-chat__form { display: flex; gap: var(--space-2); align-items: flex-end; }
.wd-chat__form textarea { flex: 1; min-height: 44px; resize: vertical; }
@media (max-width: 600px) { .wd-chat__form { flex-direction: column; align-items: stretch; } }

/* Personal Assistant: files waiting to be sent, and the get-to-know-you card */
.assistant__pending { padding: var(--space-2) var(--space-3) 0; margin: 0; border-top: 1px solid var(--divider); }
.assistant__pending + .assistant__form { border-top: 0; }
.assistant__form .attach-btn { width: 44px; min-width: 44px; height: 44px; }
.assistant__intro { border: 1px solid var(--border); border-radius: var(--radius); padding: var(--space-3); margin-bottom: var(--space-3); background: var(--fill-subtle); }
.assistant__intro p { margin: 0 0 var(--space-2); }

/* Personal Assistant routines */
.routine-list { margin-top: var(--space-3); }
.routine { padding: var(--space-3) 0; border-top: 1px solid var(--divider); }
.routine:first-child { border-top: 0; }
.routine--paused { opacity: 0.65; }
.routine__what { margin: 4px 0; }
.routine details { margin-top: 6px; }
.routine-day { gap: 4px; }
.routine-templates { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-3); }
.routine-template { display: flex; flex-direction: column; justify-content: space-between; gap: var(--space-2); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--space-3); }

/* Every dialog's close button: stays in the top corner while a tall dialog scrolls */
.modal__x { position: sticky; top: 0; float: right; z-index: 2; width: 36px; height: 36px; margin: -12px -12px 0 8px; padding: 0; border: 0; border-radius: 999px; background: var(--surface); color: var(--text-muted); font-size: 24px; line-height: 1; cursor: pointer; }
.modal__x:hover { background: var(--fill-subtle); color: var(--text); }

/* Installed systems (customer page) */
.system { padding: var(--space-3) 0; border-top: 1px solid var(--divider); }
.system:first-of-type { border-top: 0; }
.system__parts { width: 100%; border-collapse: collapse; margin: 8px 0; }
.system__parts td { padding: 6px 8px 6px 0; vertical-align: top; border-top: 1px solid var(--divider); }
.system__parts tr:first-child td { border-top: 0; }
.system-part { border: 1px solid var(--border); border-radius: var(--radius); padding: var(--space-3); margin-bottom: var(--space-2); }

/* Proposal templates and the proposal editor */
.tpl-layout { grid-template-columns: minmax(200px, 260px) minmax(0, 1fr); gap: var(--space-4); align-items: start; }
@media (max-width: 800px) { .tpl-layout { grid-template-columns: 1fr; } }
.tpl-item { display: block; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; }
.tpl-item--on { background: var(--fill-subtle); font-weight: 600; }
.tpl-sec { border: 1px solid var(--border); border-radius: var(--radius); padding: var(--space-3); margin-bottom: var(--space-2); }
.tpl-sec--off { opacity: 0.55; }
.ed-sec { border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px; margin-bottom: 8px; }
.ed-sec summary { cursor: pointer; }
.ed-opt { border: 1px solid var(--border); border-radius: var(--radius); padding: var(--space-3); margin-bottom: var(--space-2); }
.ed-opt textarea { width: 100%; }

/* Solar equipment: approval status under each product */
.equip-meta { margin-top: 4px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.cat-results { max-height: 50vh; overflow-y: auto; }
.cat-results > .row { padding: 8px 0; border-top: 1px solid var(--divider); }
.cat-results > .row:first-child { border-top: 0; }
.specs-grid { margin-top: 8px; }
.cp-specs { margin-top: 12px; border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px; }
.cp-specs summary { cursor: pointer; }
.unit-input { position: relative; display: flex; align-items: center; }
.unit-input input { width: 100%; }
.unit-input span { position: absolute; right: 10px; color: var(--text-muted); font-size: var(--text-sm); pointer-events: none; }
.unit-input input:has(+ span) { padding-right: 52px; }

/* Ad campaigns: image choices and the branded previews */
.ad-thumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ad-thumbs--grid { max-height: 60vh; overflow-y: auto; }
.ad-thumb { position: relative; width: 72px; height: 72px; padding: 0; border: 2px solid transparent; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2, #eee); cursor: pointer; }
.ad-thumbs--grid .ad-thumb { width: 110px; height: 110px; }
.ad-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ad-thumb.is-on { border-color: var(--primary, #0E7C66); }
.ad-thumb__x { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 50%; background: rgba(0,0,0,0.6); color: #fff; font-size: 14px; line-height: 20px; text-align: center; }
.ad-previews { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; align-items: flex-end; }
.ad-previews figure { margin: 0; }
.ad-previews canvas { display: block; width: 150px; height: auto; border-radius: var(--radius-sm); box-shadow: 0 1px 4px rgba(0,0,0,0.15); }
.ad-concept textarea, .ad-concept input, .ad-concept select { width: 100%; margin-bottom: 4px; }
.ad-steps li { margin-bottom: 6px; }

/* Settings: Your companies */
.company-card { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; }
.company-card__facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 10px 0 0; }
.company-card__facts dt { color: var(--text-muted); }
.company-card__facts dd { margin: 0; overflow-wrap: anywhere; }
.company-add { display: flex; align-items: center; gap: 12px; width: 100%; height: auto; padding: 14px; border: 1.5px dashed var(--border-strong); border-radius: var(--radius-sm); background: transparent; color: var(--text); text-align: left; cursor: pointer; font: inherit; }
.company-add:hover { background: var(--ground); border-color: var(--accent); }
.company-add { justify-content: flex-start; white-space: normal; }
.company-add > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }

/* A company's page: a field per row, each edited on its own */
.company-page { display: grid; gap: var(--space-4, 16px); max-width: 900px; }
.field-rows { display: flex; flex-direction: column; }
.field-row { display: grid; grid-template-columns: 220px 1fr auto; gap: 8px 16px; align-items: start; padding: 12px 0; border-top: 1px solid var(--divider); }
.field-row:first-child { border-top: 0; }
.field-row__label { font-weight: 600; }
.field-row__value { min-width: 0; overflow-wrap: anywhere; }
.field-row--editing { grid-template-columns: 220px 1fr; background: var(--ground); margin: 0 -12px; padding: 12px; border-radius: var(--radius-sm); }
.field-row__edit .field { margin-bottom: 8px; }
.pre-wrap { white-space: pre-wrap; }
@media (max-width: 640px) {
  .field-row, .field-row--editing { grid-template-columns: 1fr auto; }
  .field-row__value, .field-row__edit { grid-column: 1 / -1; }
  .field-row .btn { grid-row: 1; grid-column: 2; }
}

/* Training page: which office it's being trained for */
.train-office { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; padding: 10px 14px; background: var(--info-bg); border: 1px solid var(--info-border); border-radius: var(--radius-md); }
.train-office .segmented { flex: none; background: var(--surface); }
.train-office .segmented label { padding: 6px 12px; }

/* Raise an invoice: its lines */
.ri-lines { width: 100%; border-collapse: collapse; }
.ri-lines th { text-align: left; font-size: var(--text-sm, 13px); color: var(--text-muted); font-weight: 600; padding: 4px; }
.ri-lines td { padding: 4px; }
.ri-lines input { width: 100%; }

/* Raise an invoice: choosing the customer in Xero */
.ri-xero-option { align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.ri-xero-option:has(input:checked) { border-color: var(--accent); background: var(--info-bg); }
.ri-xero-option input[type="radio"] { flex: none; width: 20px; height: 20px; min-height: 0; padding: 0; margin-top: 2px; accent-color: var(--link); }

/* Raise a purchase order */
.modal:has(#po-form) { max-width: 760px; }
.po-lines { min-width: 600px; }
.po-lines select { width: 100%; }

/* Account menu: switching company */
.menu__label { padding: 6px var(--space-3) 2px; font-size: var(--text-xs, 12px); font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.menu__divider { border: 0; border-top: 1px solid var(--divider); margin: 4px 0; }
.menu button[aria-current] { font-weight: 700; opacity: 1; cursor: default; color: var(--text); }
#account-menu { max-height: calc(100vh - 120px); overflow-y: auto; }
#company-switch button { height: auto; min-height: var(--control-height); padding-top: 8px; padding-bottom: 8px; white-space: normal; text-align: left; display: flex; gap: 8px; align-items: flex-start; line-height: 1.3; }
.menu__tick { width: 14px; flex: none; color: var(--accent); }

/* The phone apps: billing and hiring agents are on the website only */
.in-app a[href="#/agents"],
.in-app a[href="#/billing"] { display: none !important; }
#account-menu .menu__danger { color: var(--danger, #b42318); }

/* Specifications filled in from a datasheet, for the person to check */
.specs-grid input.is-filled { background: var(--warning-bg); }
label.btn.is-busy { opacity: 0.6; pointer-events: none; }

/* Placing panels by hand on the roof picture */
/* Placing panels by hand: the picture with its panels, the outlines where more would fit, and the handles */
.sd-roof--edit svg { touch-action: none; cursor: default; user-select: none; }
.sd-roof--edit svg[data-tool="add"] { cursor: crosshair; }
.sd-roof--edit svg[data-tool="pan"] { cursor: grab; }
.sd-roof--edit svg[data-tool="pan"]:active { cursor: grabbing; }
.sd-roof--edit polygon.le-panel { fill: rgba(16, 24, 39, 0.82); stroke: #ffc400; cursor: move; }
.sd-roof--edit polygon.le-selected { fill: rgba(255, 196, 0, 0.55); stroke: #fff; }
.sd-roof--edit polygon.le-ghost { fill: rgba(255, 255, 255, 0.06); stroke: rgba(255, 255, 255, 0.85); cursor: pointer; }
.sd-roof--edit polygon.le-ghost:hover { fill: rgba(255, 196, 0, 0.45); stroke: #ffc400; }
.sd-roof--edit svg[data-tool="pan"] polygon { pointer-events: none; }
.sd-roof--edit .le-marquee { fill: rgba(76, 201, 240, 0.15); stroke: #4cc9f0; stroke-dasharray: 6 4; pointer-events: none; }
.sd-roof--edit .le-handle { cursor: grab; }
.sd-roof--edit .le-handle circle { fill: #fff; stroke: rgba(16, 24, 39, 0.35); stroke-width: 1; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.45)); }
.sd-roof--edit .le-handle text { fill: #101827; font-weight: 700; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.sd-roof--edit .le-handle:hover circle { fill: #ffc400; }
.le-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }
.le-tools { display: inline-flex; gap: 0; }
.le-tools button { border-radius: 0; margin-left: -1px; }
.le-tools button:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); margin-left: 0; }
.le-tools button:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.le-sep { width: 1px; align-self: stretch; background: var(--divider, #e2e7e5); margin: 0 2px; }

/* New design: other products and extras to tick, with how many */
.sd-picks { margin-top: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 12px; }
.sd-picks summary { cursor: pointer; }
.sd-pick-row { display: flex; align-items: center; gap: 8px; margin: 6px 0 0; font-weight: 400; }
.sd-pick-row input[type="checkbox"] { width: auto; }

/* Month by month: their use by where it comes from */
.sd-use-stack { width: 40%; display: flex; flex-direction: column-reverse; border-radius: 2px 2px 0 0; overflow: hidden; }
.sd-use-stack i { display: block; flex: none; }
.sd-self { background: #F7D27E; }
.sd-batt { background: #0E7C66; }
.sd-night { background: #5868D9; }

/* Follow-up sequences: each one's steps, in order */
.seq-card { margin-bottom: 12px; }
.seq-steps { margin: 10px 0; padding-left: 20px; display: grid; gap: 6px; }
.seq-steps li { line-height: 1.4; }
.seq-steps li > .muted:first-child { display: block; }

/* Facebook comments in the Inbox: each one still to answer, with the AI's draft */
#fb-panel { display: grid; gap: 14px; }
.fb-comment { border: 1px solid var(--line, #e2e7e5); border-radius: 12px; padding: 12px; }
.fb-comment textarea { width: 100%; }
.fb-quote { margin: 6px 0 8px; padding: 8px 12px; border-left: 3px solid #1877f2; background: rgba(24, 119, 242, 0.06); border-radius: 0 8px 8px 0; white-space: pre-wrap; }

/* Call quality: a call's review in the Inbox, and the Receptionist's 30-day picture */
.call-review { padding: 10px; background: #fbfcfd; margin-top: 8px; }
.cq-stats { display: flex; flex-wrap: wrap; gap: 12px; margin: 12px 0; }
.cq-stat { flex: 1 1 120px; border: 1px solid var(--line, #e2e7e5); border-radius: 12px; padding: 10px 12px; }
.cq-stat__value { font-size: 24px; font-weight: 800; line-height: 1.2; }
.cq-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.cq-cols h3 { margin: 0 0 6px; }
.cq-bar { display: grid; grid-template-columns: minmax(120px, 1.4fr) 1fr auto; gap: 8px; align-items: center; padding: 3px 0; }
.cq-bar__track { height: 8px; background: var(--divider, #eef1f0); border-radius: 4px; overflow: hidden; }
.cq-bar__track > span { display: block; height: 100%; background: #0e7c66; border-radius: 4px; }

/* The softphone: an incoming call from one of this person's customers, and the call while it's on */
.softphone { position: fixed; right: var(--space-5); bottom: var(--space-5); z-index: 120; width: min(340px, calc(100vw - 32px)); background: #fff; border: 1px solid var(--line, #e2e7e5); border-left: 4px solid #0e7c66; border-radius: 12px; padding: 14px 16px; box-shadow: 0 16px 40px rgba(14, 26, 43, 0.28); }
.softphone__head { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: #0e7c66; margin-bottom: 4px; }

/* Marketing results: channels with their campaigns beneath */
.results-channel td { background: #f6f8f7; }
.table-scroll { overflow-x: auto; }

/* Quick start: six steps on the Setup page, the one to do next open */
.quick-start { border-left: 4px solid #0e7c66; }
.qs-step { border-top: 1px solid var(--divider, #e2e7e5); }
.qs-step__head { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 0; background: none; border: 0; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.qs-step__n { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; background: #e6f5f0; color: #0b4f42; }
.qs-step--done .qs-step__n { background: #0e7c66; color: #fff; }
.qs-step__title { flex: 1; font-weight: 700; }
.qs-step--done .qs-step__title { font-weight: 500; color: var(--muted, #55605d); }
.qs-step__body { padding: 0 0 16px 40px; }
.qs-step__body p { margin: 0 0 10px; }
.qs-how { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 6px; }
@media (max-width: 640px) { .qs-step__body { padding-left: 0; } }

/* The free trial's box at the top of the quick start */
.qs-trial { margin: 0 0 14px; padding: 14px 16px; border-radius: 10px; background: #e6f5f0; border: 1px solid #b7e0d4; color: #0b3b32; }
.qs-trial h3 { margin: 0 0 6px; font-size: 16px; }
.qs-trial p { margin: 0 0 10px; }
.qs-trial p:last-child { margin-bottom: 0; }
.qs-trial .muted { color: #2f5a50; }
.qs-trial a { color: #0b4f42; font-weight: 600; }
.qs-trial--over { background: var(--warning-bg, #fff7e6); border-color: var(--warning-border, #f0d48a); color: var(--warning-text, #6b4e00); }

/* Notes on a task */
.task-note { padding: 8px 0; border-top: 1px solid var(--divider, #e2e7e5); }
.task-note__body { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 2px; }
.linklike { background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; }

/* The customer's link to a proposal, shown in full with a copy button */
.share-box { margin: 8px 0 12px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2, #f1f4f3); display: grid; gap: 6px; }
.share-box input { flex: 1; min-width: 0; font-size: 14px; background: #fff; }

/* A connected Facebook Page: its name, then its switches lined up underneath */
.fb-pages { display: grid; gap: 10px; margin-bottom: 12px; }
.fb-page { border: 1px solid var(--divider, #e2e7e5); border-radius: 10px; padding: 10px 14px; }
.fb-page__name { margin-bottom: 2px; }
.fb-page__row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fb-page__row .check { min-height: 36px; }

/* "Ask for changes" on a campaign plan */
.revise-box { border-left: 4px solid #0e7c66; }
.revise-box textarea { width: 100%; }

/* iPhones zoom the whole page in when a field with text under 16px is tapped, and leave it zoomed (the page then sits
   a little too wide for the screen). On iPhones and iPads every field is 16px, so nothing zooms. */
@supports (-webkit-touch-callout: none) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea { font-size: 16px !important; }
}

/* Writing emails: the formatted message box, attached files, templates and signature */
.rich { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.rich:focus-within { border-color: var(--link); box-shadow: 0 0 0 3px color-mix(in srgb, var(--link) 18%, transparent); }
.rich__bar { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; padding: 6px; border-bottom: 1px solid var(--border); }
.rich__bar button { min-height: 30px; height: 30px; padding: 0 10px; font-size: 13px; }
.rich__bar select { min-height: 30px; height: 30px; padding: 0 8px; font-size: 13px; }
.rich__body { padding: 10px 12px; outline: none; overflow-y: auto; max-height: 45vh; line-height: 1.45; overflow-wrap: anywhere; }
.rich__body:empty::before { content: attr(data-placeholder); color: var(--text-muted); pointer-events: none; }
.rich__body ul, .rich__body ol, .bubble__email ul, .bubble__email ol { margin: 4px 0; padding-left: 22px; }
.rich__body a { color: var(--link); }
.bubble__email { white-space: normal; }
.bubble__email a { color: inherit; text-decoration: underline; }
.file-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 10px; border: 1px solid var(--border); border-radius: 999px; font-size: 13px; background: var(--surface); max-width: 100%; }
.file-chip button { min-height: 0; height: 22px; width: 22px; padding: 0; border-radius: 50%; line-height: 1; }
.modal:has(#email-setup) { max-width: 860px; }
.modal:has(#email-form) { max-width: 680px; }
.email-setup { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; align-items: start; }
.email-setup__item { display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; text-align: left; margin-bottom: 4px; height: auto; min-height: 38px; padding: 6px 10px; }
.email-setup__item span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.email-setup__item[aria-pressed="true"] { border-color: var(--link); background: color-mix(in srgb, var(--link) 8%, var(--surface)); }
@media (max-width: 700px) { .email-setup { grid-template-columns: 1fr; } }
button.link { background: none; border: 0; padding: 0; min-height: 0; height: auto; color: var(--link); text-decoration: underline; font-weight: 500; }

/* The phone window: floats over the page (which stays usable behind it), stays put across pages, can be dragged */
.phone { position: fixed; right: var(--space-5); bottom: var(--space-5); z-index: 130; width: min(300px, calc(100vw - 16px)); background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 16px 40px rgba(14, 26, 43, 0.28); overflow: hidden; }
.phone--busy { border-color: #0e7c66; }
.phone__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 8px 8px 14px; background: var(--sidebar-bg); color: #fff; cursor: move; user-select: none; touch-action: none; }
.phone__title { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phone__state { font-weight: 500; opacity: 0.85; margin-left: 6px; }
.phone__tools { display: flex; gap: 2px; flex: none; }
.phone__tools button { min-height: 0; height: 28px; width: 28px; padding: 0; border: 0; background: transparent; color: #fff; font-size: 16px; line-height: 1; border-radius: 6px; }
.phone__tools button:hover { background: rgba(255, 255, 255, 0.15); }
.phone__body { padding: 14px; max-height: calc(100vh - 80px); overflow-y: auto; }
.phone__who { display: flex; flex-direction: column; gap: 2px; }
.phone__who strong { font-size: 16px; overflow-wrap: anywhere; }
.phone__note { margin: 10px 0 0; }
.phone__keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.phone__keys button { height: 40px; min-height: 0; padding: 0; font-size: 17px; font-weight: 600; }
.phone__matches { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.phone__matches:empty { display: none; }
.phone__matches button { display: flex; flex-direction: column; align-items: flex-start; gap: 0; height: auto; min-height: 0; padding: 6px 10px; text-align: left; }
@media (max-width: 599px) { .phone { left: 8px; right: 8px; bottom: 8px; width: auto; } .phone__head { cursor: default; } }

/* Pages under a long table: how many rows, which page, rows per page */
.pg-hide { display: none !important; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 2px 0; font-size: 13px; color: var(--text-muted); }
.pager__size { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 400; }
.pager__size select { width: auto; min-height: 30px; height: 30px; padding: 0 8px; font-size: 13px; }
.pager__nav { display: inline-flex; align-items: center; gap: 8px; }
@media print { .pg-hide { display: table-row !important; } .pager { display: none; } }

/* Pipeline: cards can be dragged to another stage */
.board .card[draggable="true"] { cursor: grab; }
.board .card[draggable="true"]:active { cursor: grabbing; }
.board .card.dragging { opacity: 0.4; }
.board .column { transition: background 0.12s, outline-color 0.12s; outline: 2px dashed transparent; outline-offset: 2px; }
.board .column.drop { outline-color: var(--link); background: color-mix(in srgb, var(--link) 7%, transparent); }

/* Pipeline: the filter bar above the board */
.pipe-filter { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: var(--space-3); }
.pipe-filter select, .pipe-filter input { width: auto; max-width: 100%; }
.pipe-filter [data-count] { margin-left: auto; white-space: nowrap; }

/* Platform: problems on calls across companies */
.cq-problem { padding: var(--space-2) 0; border-bottom: 1px solid var(--divider); }
.cq-problem summary { cursor: pointer; }
.cq-problem ul { margin: var(--space-2) 0 0; padding-left: 20px; }

/* The Website tab, for someone who edits the draft but doesn't manage the website */
.wd-note { margin-bottom: var(--space-3); border-left: 3px solid var(--accent); }

/* Platform health: what investigating a problem found */
.alert-found { margin-top: var(--space-2); padding: var(--space-3); background: var(--bg, #f5f7f6); border-radius: 8px; }
.alert-found p { margin: 6px 0 0; }
.alert-found ol { margin: 0 0 8px; padding-left: 20px; }

/* Billing: paying what's owed and bringing stopped agents back */
.bill-restore { margin-bottom: var(--space-4); border-left: 3px solid var(--danger, #B42318); }
.bill-restore h3 { margin: 10px 0 6px; }

/* Jobs: the stages a job goes through, and the list of jobs */
.job-stages { display: flex; flex-wrap: wrap; gap: 6px; }
.job-stage { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface, #fff); font-size: 13px; color: var(--text-muted); }
.job-stage__n { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--divider); font-size: 11px; font-weight: 700; color: var(--text-muted); }
.job-stage.is-done { color: var(--text); }
.job-stage.is-done .job-stage__n { background: #D3E9C6; color: #2F6B3A; }
.job-stage.is-now { border-color: var(--primary, #0E7C66); color: var(--text); font-weight: 700; }
.job-stage.is-now .job-stage__n { background: var(--primary, #0E7C66); color: #fff; }
.job-stage:disabled { cursor: default; opacity: 1; }
a.work-row { color: inherit; text-decoration: none; }
a.work-row:hover strong { text-decoration: underline; }
.job-row__side { text-align: right; flex-shrink: 0; }
.job-kind { border: 1px solid var(--border); border-radius: 10px; padding: 10px; margin-bottom: 8px; }

/* Jobs: what's recorded at a stage, photographs, the equipment list, the schedule */
.job-item { padding: 8px 0; border-bottom: 1px solid var(--divider); }
.job-item:last-of-type { border-bottom: 0; }
.job-files { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.job-file { position: relative; }
.job-file img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); display: block; }
.job-file__doc { display: inline-flex; align-items: center; gap: 6px; padding: 8px 28px 8px 10px; border: 1px solid var(--border); border-radius: 8px; }
.job-file__x { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; padding: 0; border-radius: 50%; line-height: 1; }
.job-signoff { margin-top: 10px; padding: 12px; border-radius: 10px; background: #FFF6E5; }
.job-now { border-left: 3px solid var(--primary, #0E7C66); }
.job-checklist .row { padding: 4px 0; }
.job-ticked { text-decoration: line-through; color: var(--text-muted); }
.job-stage-rec { padding: 8px 0; border-bottom: 1px solid var(--divider); }
.job-stage-rec summary { cursor: pointer; }
.job-kind summary { cursor: pointer; }
.job-set-stage { padding: 8px 0; border-top: 1px solid var(--divider); }
.sched-wrap { overflow-x: auto; margin-top: 12px; }
.sched { width: 100%; border-collapse: collapse; min-width: 760px; table-layout: fixed; }
.sched th, .sched td { border: 1px solid var(--divider); padding: 6px; vertical-align: top; font-size: 13px; text-align: left; }
.sched thead th { font-weight: 600; color: var(--text-muted); }
.sched tbody th { width: 120px; font-weight: 600; }
.sched .is-today { background: #F2FAF7; }
.sched-visit { display: block; padding: 4px 6px; margin-bottom: 4px; border-radius: 6px; background: #E6F5F0; color: inherit; text-decoration: none; overflow: hidden; }
.sched-visit--other { background: var(--divider); }
.sched-visit div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-muted); }
.sched-add { width: 100%; padding: 0; height: 22px; border-style: dashed; color: var(--text-muted); opacity: .55; }
.sched-add:hover { opacity: 1; }
button.pj-row { width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--divider); border-radius: 0; }

/* Time & expenses (the Bookkeeper's staff requests) */
.rq-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; }
.rq-thumb { flex: 0 0 64px; width: 64px; height: 64px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border-strong); background: var(--fill-subtle); display: flex; align-items: center; justify-content: center; font-size: var(--text-xs); color: var(--text-muted); text-decoration: none; }
.rq-thumb img { width: 100%; height: 100%; object-fit: cover; }
.rq-fields { display: flex; gap: 8px; flex-wrap: wrap; }
.rq-fields label { flex: 1 1 130px; font-size: var(--text-xs); color: var(--text-muted); display: flex; flex-direction: column; gap: 2px; }
.rq-fields input { width: 100%; }
.rq-balances { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.rq-balance { border: 1px solid var(--divider); border-radius: 10px; padding: 10px 12px; }
.rq-balance__n { font-size: 1.5rem; font-weight: 600; line-height: 1.3; }
.rq-balance__n span { font-size: var(--text-xs); font-weight: 400; color: var(--text-muted); }
.ts-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.ts-table th, .ts-table td { padding: 6px 8px; border-bottom: 1px solid var(--divider); text-align: left; vertical-align: middle; font-weight: 400; }
.ts-table thead th { font-size: var(--text-xs); color: var(--text-muted); }
.ts-table tbody th { white-space: nowrap; font-weight: 600; }
.ts-table td input[type="number"] { width: 90px; }
.ts-table td input:not([type="number"]) { width: 100%; }
.ts-table--team td { text-align: right; white-space: nowrap; }
.ts-table--team td:last-child { text-align: left; }
.sched-leave { background: repeating-linear-gradient(135deg, var(--fill-subtle), var(--fill-subtle) 6px, transparent 6px, transparent 12px); color: var(--text-muted); font-size: var(--text-xs); text-align: center; vertical-align: middle; }
.cal-allday--leave { border-style: dashed; color: var(--text-muted); }
@media (max-width: 640px) { .rq-balances { grid-template-columns: 1fr; } .ts-table td input[type="number"] { width: 70px; } }
