/* Volta CRM — colours from voltacompliance.com, light + dark */
@font-face {
  font-family: "Mulish"; font-style: normal; font-weight: 200 1000; font-display: swap;
  src: url("/fonts/mulish.woff") format("woff");
}
:root {
  --bg: #F4F4F4;
  --card: #FFFFFF;
  --card-2: #FAFAFA;
  --primary: #0096CF;
  --primary-ink: #FFFFFF;
  --primary-soft: #E3F4FB;
  --secondary: #1863DC;
  --heading: #1C222E;
  --text: #404040;
  --muted: #7A7A7A;
  --border: #EDEDED;
  --border-strong: #D9D9D9;
  --nav-bg: #1C222E;
  --nav-text: #C9CED8;
  --nav-active: #FFFFFF;
  --danger: #D63B3B;
  --danger-soft: #FCEBEB;
  --warn: #B7791F;
  --warn-soft: #FDF3E1;
  --ok: #1F8A5B;
  --ok-soft: #E4F5EC;
  --shadow: 0 1px 2px rgba(28, 34, 46, .06), 0 2px 8px rgba(28, 34, 46, .05);
  --radius: 10px;
  --font: "Mulish", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --series-1: #0096CF; --series-2: #EB6834;   /* charts: validated for colour-blind separation on the card colour */
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1C222E; --card: #252C3A; --card-2: #2A3242; --primary-soft: #16384A;
    --secondary: #4D8BEF; --heading: #FFFFFF; --text: #D5D9E0; --muted: #8A93A3;
    --border: #333B4B; --border-strong: #414A5C; --nav-bg: #151A24;
    --danger: #F07070; --danger-soft: #3D2328; --warn: #E8B25A; --warn-soft: #3A3122;
    --ok: #4FC48E; --ok-soft: #1D3A2F; --shadow: 0 1px 2px rgba(0,0,0,.3);
    --series-2: #D95926;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1C222E; --card: #252C3A; --card-2: #2A3242; --primary-soft: #16384A;
  --secondary: #4D8BEF; --heading: #FFFFFF; --text: #D5D9E0; --muted: #8A93A3;
  --border: #333B4B; --border-strong: #414A5C; --nav-bg: #151A24;
  --danger: #F07070; --danger-soft: #3D2328; --warn: #E8B25A; --warn-soft: #3A3122;
  --ok: #4FC48E; --ok-soft: #1D3A2F; --shadow: 0 1px 2px rgba(0,0,0,.3);
  --series-2: #D95926;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }   /* links to #part-of-a-page land below the sticky top bar */
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased;
}
a { color: var(--secondary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { color: var(--heading); margin: 0; line-height: 1.25; }
h1 { font-size: 1.5rem; font-weight: 800; }
h2 { font-size: 1.1rem; font-weight: 800; }
h3 { font-size: .95rem; font-weight: 700; }
svg.i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- App shell ---------- */
.shell { display: flex; min-height: 100vh; }
.side {
  width: 232px; flex: none; background: var(--nav-bg); color: var(--nav-text);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 18px 12px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; color: #fff; font-weight: 900; letter-spacing: .08em; font-size: 1.15rem; }
.brand .bolt { width: 30px; height: 30px; border-radius: 8px; background: var(--primary); display: grid; place-items: center; }
.brand .bolt svg { width: 18px; height: 18px; fill: #fff; stroke: none; }
.brand small { font-weight: 600; letter-spacing: .02em; color: var(--nav-text); font-size: .8rem; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px;
  color: var(--nav-text); font-weight: 600; margin-bottom: 2px;
}
.nav a:hover { background: rgba(255,255,255,.06); text-decoration: none; color: #fff; }
.nav a.on { background: var(--primary); color: #fff; }
.nav .soon { opacity: .45; pointer-events: none; }
.nav .soon span.tag { margin-left: auto; font-size: .68rem; border: 1px solid currentColor; border-radius: 99px; padding: 0 6px; }
.nav-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; padding: 16px 12px 6px; opacity: .6; }
.side-foot { margin-top: auto; border-top: 1px solid rgba(255,255,255,.08); padding-top: 12px; }
.me { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--secondary); color: #fff; display: grid; place-items: center; font-size: .78rem; font-weight: 800; flex: none; }
.me .who { line-height: 1.2; min-width: 0; }
.me .who b { color: #fff; display: block; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me .who span { font-size: .75rem; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 12px; padding: 18px 28px; position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px);
}
.topbar h1 { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.content { padding: 4px 28px 40px; width: 100%; margin: 0 auto; }   /* full width: wide and ultrawide monitors get the room */
.topbar { width: 100%; margin: 0 auto; }

.icon-btn { background: var(--card); border: 1px solid var(--border); color: var(--heading); width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover { border-color: var(--primary); color: var(--primary); }

/* Mobile tab bar */
.tabbar { display: none; }
@media (max-width: 860px) {
  .side { display: none; }
  .topbar { padding: 14px 16px; }
  .content { padding: 0 16px calc(96px + env(safe-area-inset-bottom)); }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--card);
    border-top: 1px solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .7rem; font-weight: 700; color: var(--muted); padding: 4px 0; }
  .tabbar a.on { color: var(--primary); }
  .tabbar a:hover { text-decoration: none; }
  .tabbar svg.i { width: 22px; height: 22px; }
  h1 { font-size: 1.3rem; }
}

/* ---------- Components ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head h2 { flex: 1; }
.stack > * + * { margin-top: 16px; }
.grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.grid > * { min-width: 0; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-main { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }

.stat { padding: 16px 18px; }
.stat .label { font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.stat .value { font-size: 1.6rem; font-weight: 800; color: var(--heading); margin-top: 4px; }
.stat .value.primary { color: var(--primary); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px;
  border-radius: 8px; border: 1px solid transparent; font: 700 .9rem var(--font); cursor: pointer; white-space: nowrap;
  background: var(--primary); color: var(--primary-ink);
}
.btn:hover { filter: brightness(1.07); text-decoration: none; }
.btn svg.i { width: 18px; height: 18px; }
.btn-ghost { background: var(--card); color: var(--heading); border-color: var(--border-strong); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); filter: none; }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-sm { height: 32px; padding: 0 12px; font-size: .82rem; }
.btn .t { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.btn-row .btn { max-width: 100%; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs a { padding: 7px 14px; border-radius: 99px; font-weight: 700; font-size: .85rem; color: var(--text); background: var(--card); border: 1px solid var(--border); }
.tabs a.on { background: var(--heading); color: var(--bg); border-color: var(--heading); }
.tabs a:hover { text-decoration: none; border-color: var(--primary); }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 9px; border-radius: 99px; font-size: .74rem; font-weight: 800; background: var(--card-2); color: var(--text); border: 1px solid var(--border); white-space: nowrap; }
.badge.blue { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.badge.red { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge.amber { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.green { background: var(--ok-soft); color: var(--ok); border-color: transparent; }

.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-weight: 600; background: var(--ok-soft); color: var(--ok); }
.alert.error { background: var(--danger-soft); color: var(--danger); }

/* Tables → cards on phones */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 800; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--card-2); }
.table .strong { font-weight: 700; color: var(--heading); }
.table .sub, .sub { font-size: .82rem; color: var(--muted); overflow-wrap: anywhere; }
@media (max-width: 720px) {
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { padding: 12px 16px; border-bottom: 1px solid var(--border); }
  .table td { padding: 2px 0; border: 0; }
  .table td[data-hide-mobile] { display: none; }
}

/* Task list */
.tasks { list-style: none; margin: 0; padding: 0; }
.task { display: flex; gap: 12px; align-items: flex-start; padding: 12px 20px; border-bottom: 1px solid var(--border); }
.task:last-child { border-bottom: 0; }
.task .check {
  width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border-strong); background: transparent;
  flex: none; margin-top: 1px; cursor: pointer; display: grid; place-items: center; color: transparent; padding: 0;
}
.task .check:hover { border-color: var(--primary); }
.task.done .check { background: var(--primary); border-color: var(--primary); color: #fff; }
.task .check svg { width: 14px; height: 14px; stroke-width: 3; }
.task .body { flex: 1; min-width: 0; }
.task .subject { font-weight: 700; color: var(--heading); }
.task.done .subject { text-decoration: line-through; color: var(--muted); }
.task .meta { overflow-wrap: anywhere; font-size: .82rem; color: var(--muted); display: flex; gap: 2px 10px; flex-wrap: wrap; align-items: center; margin-top: 2px; }
.task .meta .overdue { color: var(--danger); font-weight: 700; }
.empty { padding: 32px 20px; text-align: center; color: var(--muted); }

/* Forms */
.form-section + .form-section { border-top: 1px solid var(--border); }
.form-section { padding: 20px; }
.form-section h3 { margin-bottom: 14px; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.fields .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .fields { grid-template-columns: 1fr; } }
label.lbl { display: block; font-size: .8rem; font-weight: 700; color: var(--heading); margin-bottom: 5px; }
.input, select.input, textarea.input {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 8px;
  background: var(--card); color: var(--heading); font: 500 .95rem var(--font);
}
textarea.input { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; }
.input:focus { outline: 2px solid color-mix(in srgb, var(--primary) 35%, transparent); border-color: var(--primary); }
.err { color: var(--danger); font-size: .8rem; font-weight: 700; margin-top: 4px; }
.hint { color: var(--muted); font-size: .8rem; margin-top: 4px; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 14px; }
.check-row { display: flex; gap: 8px; align-items: center; font-weight: 600; font-size: .9rem; cursor: pointer; }
.check-row input { width: 18px; height: 18px; accent-color: var(--primary); }
.form-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 16px 20px; border-top: 1px solid var(--border); background: var(--card-2); border-radius: 0 0 var(--radius) var(--radius); }

.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--border-strong); border-radius: 99px; transition: .2s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::after { transform: translateX(18px); }

/* Detail pages */
.dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; margin: 0; }
.dl div { min-width: 0; }
.dl dt { font-size: .74rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.dl dd { margin: 2px 0 0; color: var(--heading); font-weight: 600; overflow-wrap: anywhere; }
.dl dd.pre { white-space: pre-line; font-weight: 500; }
.dl .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .dl { grid-template-columns: 1fr; } }

.path { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.path span { flex: 1; min-width: 96px; text-align: center; padding: 8px 10px; font-size: .78rem; font-weight: 800; background: var(--card-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.path span:first-child { border-radius: 99px 0 0 99px; }
.path span:last-child { border-radius: 0 99px 99px 0; }
.path span.done { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.path span.now { background: var(--primary); color: #fff; border-color: var(--primary); }

.pager { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; font-size: .85rem; color: var(--muted); }
.search { display: flex; gap: 8px; flex: 1; max-width: 420px; }

/* Login */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--nav-bg); }
.auth .card { width: 100%; max-width: 400px; }
.auth .brand { justify-content: center; padding: 0 0 20px; }

.muted { color: var(--muted); }
.row { display: flex; align-items: center; gap: 12px; }
.spacer { flex: 1; }
.mt { margin-top: 16px; }
.hide-mobile { }
.hide-desktop { display: none !important; }
@media (max-width: 860px) { .hide-desktop { display: block !important; } }
@media (max-width: 860px) { .hide-mobile { display: none !important; } }

/* Lookup (search-as-you-type picker) */
.lookup { position: relative; }
.lookup-menu { position: absolute; left: 0; right: 0; top: 100%; margin-top: 4px; z-index: 30; background: var(--card); border: 1px solid var(--border-strong); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12); max-height: 280px; overflow: auto; }
.lookup-menu button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 9px 12px; font: 600 .9rem var(--font); color: var(--heading); cursor: pointer; }
.lookup-menu button:hover, .lookup-menu button.on { background: var(--primary-soft); }
.lookup-menu small { display: block; color: var(--muted); font-weight: 500; }
.lookup-menu .none { padding: 9px 12px; color: var(--muted); font-size: .9rem; }

/* Pipeline board */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.col { background: var(--card-2); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; min-height: 200px; }
.col-head { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.col-head b { color: var(--heading); display: block; }
.col-head span { font-size: .8rem; color: var(--muted); font-weight: 700; }
.col-body { padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.opp-card { display: block; background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; color: inherit; box-shadow: var(--shadow); }
.opp-card:hover { border-color: var(--primary); text-decoration: none; }
.opp-card .t { font-weight: 700; color: var(--heading); font-size: .9rem; }
.opp-card .m { font-size: .8rem; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; margin-top: 4px; }
.opp-card .amt { font-weight: 800; color: var(--heading); }

/* Clickable stage path */
.path button { flex: 1; min-width: 96px; padding: 8px 10px; font: 800 .76rem var(--font); background: var(--card-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; cursor: pointer; }
.path button:first-child { border-radius: 99px 0 0 99px; }
.path button:last-child { border-radius: 0 99px 99px 0; }
.path button.done { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.path button.now { background: var(--primary); color: #fff; border-color: var(--primary); }
.path button.lost.now { background: var(--danger); border-color: var(--danger); }
.path a { flex: 1; min-width: 96px; padding: 8px 10px; font: 800 .76rem var(--font); background: var(--card-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; text-align: center; text-decoration: none; }
.path a:first-child { border-radius: 99px 0 0 99px; } .path a:last-child { border-radius: 0 99px 99px 0; }
.path a.done { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.path a.lost.now { background: var(--danger); color: #fff; border-color: var(--danger); }
.path a:hover:not(.now) { border-color: var(--danger); color: var(--danger); text-decoration: none; }
.path span.locked { cursor: not-allowed; opacity: .7; }
.path button:hover:not(.now) { border-color: var(--primary); color: var(--primary); }

.money { font-variant-numeric: tabular-nums; }
.lines input.input { height: 34px; }
.lines td { vertical-align: middle; }
.callout { border-radius: var(--radius); padding: 14px 16px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.callout.amber { background: var(--warn-soft); color: var(--warn); }
.callout.green { background: var(--ok-soft); color: var(--ok); }
.callout.red { background: var(--danger-soft); color: var(--danger); }
.callout.blue { background: var(--primary-soft); color: var(--primary); }
.callout b { color: inherit; }
@media (max-width: 860px) {
  .search { flex: 1 1 100%; max-width: none; }
  .board { grid-auto-columns: 82%; scroll-snap-type: x mandatory; }
  .col { scroll-snap-align: start; }
  .stat .value { font-size: 1.35rem; }
}

/* ---------- Chatter + activity timeline ---------- */
.composer { display: block; }
.composer-box { position: relative; }
.composer textarea.input { min-height: 0; resize: vertical; line-height: 1.45; }
.composer.reply textarea.input { min-height: 38px; }
.composer-bar { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.composer-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.composer-files span { font-size: .78rem; font-weight: 700; background: var(--primary-soft); color: var(--primary); border-radius: 99px; padding: 2px 10px; }
.mention-menu { top: auto; }
.timeline { padding: 4px 0; }
.post, .tl-item { display: flex; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--border); }
.timeline > :first-child { border-top: 0; }
.post .post { padding: 10px 0 0; border-top: 0; }
.post-main { flex: 1; min-width: 0; }
.post-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; font-size: .9rem; }
.post-head b { color: var(--heading); }
.post-title { font-weight: 800; color: var(--heading); margin-top: 4px; }
.post-body { margin-top: 4px; overflow-wrap: anywhere; color: var(--text); }
.post.system .post-body { color: var(--muted); font-style: italic; }
.post-del { margin-left: auto; }
.mention { color: var(--primary); font-weight: 700; background: var(--primary-soft); border-radius: 4px; padding: 0 3px; }
.avatar.sm { width: 30px; height: 30px; font-size: .7rem; }
.post .post .avatar.sm { width: 26px; height: 26px; font-size: .65rem; }
.linkish { background: none; border: 0; padding: 0; color: var(--secondary); font: 700 .82rem var(--font); cursor: pointer; }
.linkish:hover { text-decoration: underline; }
.reply-toggle { margin-top: 6px; }
.reply-toggle > summary { list-style: none; display: inline-block; }
.reply-toggle > summary::-webkit-details-marker { display: none; }
.reply-toggle[open] > summary { display: none; }
.tl-icon { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--card-2); color: var(--muted); border: 1px solid var(--border); }
.tl-icon svg.i { width: 16px; height: 16px; }
.tl-icon.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.tl-icon.blue { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.tl-icon.amber { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.tl-item b { color: var(--heading); }
.tl-meta { font-size: .8rem; }
.tl-text { margin-top: 4px; white-space: pre-line; font-size: .9rem; }
.email-body { max-height: 360px; overflow: auto; background: var(--card-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin: 8px 0 0 42px; }
.tl-item.email { display: block; }
.file-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.file-thumb img { display: block; width: 120px; height: 90px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.file-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--card); color: var(--heading); font-size: .85rem; max-width: 100%; }
.file-chip:hover { border-color: var(--primary); text-decoration: none; }
.file-chip .ext { font-size: .68rem; font-weight: 900; background: var(--heading); color: var(--card); border-radius: 4px; padding: 1px 5px; }
.file-chip .fn { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.upload-inline { margin: 0; }
@media (max-width: 860px) { .post, .tl-item { padding: 12px 14px; } .email-body { margin-left: 0; } .file-thumb img { width: 96px; height: 72px; } }
.post-del .linkish { color: var(--muted); font-weight: 600; }

/* ---------- Screen sizes ---------- */
.input.grow { flex: 1 1 200px; min-width: 0; width: auto; }

/* Product lines (opportunity) */
.line { display: grid; grid-template-columns: minmax(0, 1fr) auto 110px auto; grid-template-areas: "name edit total del";
  gap: 8px 14px; align-items: center; padding: 12px 20px; border-top: 1px solid var(--border); }
.line-head { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 800; padding-top: 10px; padding-bottom: 10px; border-top: 0; }
.line-head .r, .line-total { text-align: right; }
.line-name { grid-area: name; min-width: 0; }
.line-name .strong { font-weight: 700; color: var(--heading); }
.line-edit { grid-area: edit; display: flex; align-items: center; gap: 6px; }
.line-edit .input { height: 34px; width: 80px; }
.line-edit .input[name=unit_price] { width: 110px; }
.line-total { grid-area: total; font-weight: 700; color: var(--heading); }
.line-del { grid-area: del; }
.add-line { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) auto; align-items: start; }
/* Products fits whichever column it's arranged into: in a narrow one (the side column, a phone) each line stacks. */
section[data-panel="products"] { container: products / inline-size; }
@container products (max-width: 600px) {
  .line { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name total" "edit del"; gap: 8px 10px; padding: 12px 16px; }
  .line-head { display: none; }
  .line-edit { min-width: 0; }
  .line-edit .input { flex: 1 1 0; width: auto; min-width: 0; padding: 0 8px; }
  .line-edit .input[name=unit_price] { width: auto; flex: 1.8 1 0; }
  .line-edit .btn { padding: 0 10px; }
  .add-line { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding-left: 0; padding-right: 0; }
  .add-line > :first-child { grid-column: 1 / -1; }
  .add-line > :last-child { grid-column: 1 / -1; padding-top: 0; }
  .add-line > :last-child .btn { width: 100%; justify-content: center; }
}
.add-line > :last-child { padding-top: 24px; }

/* Sidebar: Full (icon strip on smaller laptops), Icons only, or Auto-hide. Chosen per device, stored on <html data-nav>. */
@media (min-width: 861px) and (max-width: 1199px) {
  html:not([data-nav="hidden"]) .side { width: 72px; padding: 18px 10px; align-items: center; }
  html:not([data-nav="hidden"]) .side .nl, html:not([data-nav="hidden"]) .nav-label, html:not([data-nav="hidden"]) .me .who { display: none !important; }
  html:not([data-nav="hidden"]) .brand { padding: 4px 0 22px; }
  html:not([data-nav="hidden"]) .nav { width: 100%; }
  html:not([data-nav="hidden"]) .nav a { justify-content: center; padding: 11px 0; }
  html:not([data-nav="hidden"]) .me { padding: 8px 0; flex-direction: column; gap: 8px; }
  html:not([data-nav="hidden"]) .me form { margin: 0 !important; }
  .topbar { padding: 18px 24px; }
  .content { padding: 4px 24px 40px; }
}
@media (min-width: 861px) {
  html[data-nav="icons"] .side { width: 72px; padding: 18px 10px; align-items: center; }
  html[data-nav="icons"] .side .nl, html[data-nav="icons"] .nav-label, html[data-nav="icons"] .me .who { display: none !important; }
  html[data-nav="icons"] .brand { padding: 4px 0 22px; }
  html[data-nav="icons"] .nav { width: 100%; }
  html[data-nav="icons"] .nav a { justify-content: center; padding: 11px 0; }
  html[data-nav="icons"] .me { padding: 8px 0; flex-direction: column; gap: 8px; }
  html[data-nav="icons"] .me form { margin: 0 !important; }
  html[data-nav="icons"] .nav-mode-label { display: none; }

  /* Auto-hide: the menu slides in from the left edge or the menu button, over the page. */
  html[data-nav="hidden"] .side { position: fixed; left: 0; top: 0; bottom: 0; z-index: 40; transform: translateX(-100%);
    transition: transform .18s ease; box-shadow: 0 0 0 rgba(0,0,0,0); }
  html[data-nav="hidden"] .side.open { transform: none; box-shadow: 8px 0 30px rgba(0,0,0,.25); }
  html[data-nav="hidden"] .menu-btn { display: grid; }
  html[data-nav="hidden"] .nav-edge { display: block; }
}
.menu-btn { display: none; }
.nav-edge { display: none; position: fixed; left: 0; top: 0; bottom: 0; width: 10px; z-index: 39; }
.nav-mode { position: relative; margin-bottom: 6px; }
.nav-mode > button { width: 100%; display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 8px; background: none; border: 0;
  color: var(--nav-text); font: 600 .85rem var(--font); cursor: pointer; opacity: .8; }
.nav-mode > button:hover { background: rgba(255,255,255,.06); opacity: 1; color: #fff; }
html[data-nav="icons"] .nav-mode > button, html:not([data-nav="hidden"]) .nav-mode > button { justify-content: flex-start; }
@media (min-width: 861px) and (max-width: 1199px) { html:not([data-nav="hidden"]) .nav-mode > button { justify-content: center; padding: 9px 0; } html:not([data-nav="hidden"]) .nav-mode-label { display: none; } }
html[data-nav="icons"] .nav-mode > button { justify-content: center; padding: 9px 0; }
.nav-mode-menu { position: absolute; left: 0; bottom: calc(100% + 6px); min-width: 210px; background: var(--card); color: var(--heading); border: 1px solid var(--border-strong);
  border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.25); padding: 6px; z-index: 50; }
.nav-mode-menu button { display: flex; width: 100%; gap: 10px; align-items: center; padding: 8px 10px; border: 0; background: none; border-radius: 6px;
  font: 600 .88rem var(--font); color: var(--heading); cursor: pointer; text-align: left; }
.nav-mode-menu button:hover { background: var(--primary-soft); }
.nav-mode-menu button .tick { width: 16px; color: var(--primary); font-weight: 900; }
.nav-mode-menu small { display: block; color: var(--muted); font-weight: 500; font-size: .76rem; }
/* Two-column record pages need ~1000px of content */
@media (min-width: 1000px) and (max-width: 1100px) { .grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } }

/* Phones and small tablets */
@media (max-width: 860px) {
  .input, select.input, textarea.input { font-size: 16px; }   /* stops iPhone zooming in on tap */
  .topbar h1 { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 1.2rem; }
  .topbar .btn { padding: 0 12px; }
  .card-pad { padding: 16px; }
  .card-head { padding: 14px 16px; }
  .form-section { padding: 16px; }
  .form-foot { padding: 14px 16px; position: sticky; bottom: calc(64px + env(safe-area-inset-bottom)); z-index: 4; }
  .task { padding: 12px 16px; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -16px; margin-right: -16px; padding: 0 16px; }
  .tabs::-webkit-scrollbar, .path::-webkit-scrollbar { display: none; }
  .tabs a { flex: none; }
}
@media (max-width: 640px) {
  .grid-4 { gap: 10px; }
  .stat { padding: 12px 14px; }
  .stat .label { font-size: .7rem; }
  .stat .value { font-size: 1.2rem; }
  .line { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name total" "edit del"; padding: 12px 16px; }
  .line-edit .input { flex: 1 1 0; width: auto; min-width: 0; padding: 0 8px; }
  .line-edit .input[name=unit_price] { width: auto; flex: 1.8 1 0; }
  .line-edit .btn { padding: 0 10px; }
  .line-edit { min-width: 0; }
  .add-line { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
  .add-line > :first-child { grid-column: 1 / -1; }
  .callout form { width: 100%; }
}
/* Big screens: a little more breathing room */
@media (min-width: 1600px) {
  .topbar { padding: 22px 36px; }
  .content { padding: 4px 36px 48px; }
}
.line-edit input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.line-edit input[type=number]::-webkit-inner-spin-button, .line-edit input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.path button, .path span { flex: 1 0 auto; }

/* ---------- Activity tabs, Notes and Files panels ---------- */
.tab-head { gap: 4px; padding-top: 10px; padding-bottom: 0; align-items: flex-end; }
.tab-btn { background: none; border: 0; border-bottom: 3px solid transparent; padding: 8px 12px 10px; font: 800 .95rem var(--font); color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.tab-btn.on { color: var(--heading); border-bottom-color: var(--primary); }
.tab-btn:hover { color: var(--heading); }
.count { font-size: .72rem; font-weight: 800; background: var(--card-2); border: 1px solid var(--border); color: var(--muted); border-radius: 99px; padding: 0 7px; line-height: 1.6; }
.card-head h2 { display: flex; align-items: center; gap: 8px; }
.card-head h2 svg.i { width: 18px; height: 18px; color: var(--primary); }
.tl-group { font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--card-2); padding: 6px 20px; border-top: 1px solid var(--border); }
.timeline > .tl-group:first-child { border-top: 0; }
.tl-group + .tl-item, .tl-group + details.tl-item { border-top: 0; }
.tl-main { flex: 1; min-width: 0; }
.tl-text-sys { color: var(--text); }
.tl-icon.teal { background: #E0F5F3; color: #13867A; border-color: transparent; }
:root[data-theme="dark"] .tl-icon.teal { background: #17393A; color: #4CC9B9; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tl-icon.teal { background: #17393A; color: #4CC9B9; } }
.clamp { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
details.tl-item > summary { list-style: none; display: flex; gap: 12px; cursor: pointer; }
details.tl-item > summary::-webkit-details-marker { display: none; }
details.tl-item[open] > summary b { color: var(--primary); }

.pinned .card-head { padding-top: 12px; padding-bottom: 12px; }
.empty.sm { padding: 16px 20px; text-align: left; font-size: .9rem; }
.note-form { padding: 12px 20px; border-bottom: 1px solid var(--border); display: grid; gap: 8px; background: var(--card-2); }
.note-form textarea.input { min-height: 110px; }
.note { border-top: 1px solid var(--border); }
.card-head + .note, .note-form + .note { border-top: 0; }
.note > summary { list-style: none; cursor: pointer; padding: 12px 20px; display: grid; gap: 2px; }
.note > summary::-webkit-details-marker { display: none; }
.note > summary:hover { background: var(--card-2); }
.note-title { color: var(--secondary); overflow-wrap: anywhere; }
.note-meta { font-size: .78rem; }
.note-preview { font-size: .86rem; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.note[open] .note-preview { display: none; }
.note-body { padding: 0 20px 12px; white-space: pre-line; overflow-wrap: anywhere; font-size: .92rem; color: var(--heading); }
.note-actions { padding: 0 20px 12px; gap: 14px; }
.note .note-form { border-top: 1px solid var(--border); border-bottom: 0; }
.linkish.danger { color: var(--danger); }

.file-row { display: flex; align-items: center; gap: 12px; padding: 10px 20px; border-top: 1px solid var(--border); }
.card-head + .file-row, .err + .file-row { border-top: 0; }
.file-ico { width: 40px; height: 40px; flex: none; border-radius: 6px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-size: .66rem; font-weight: 900; text-transform: uppercase; overflow: hidden; text-decoration: none !important; }
.file-ico.img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.file-info { flex: 1; min-width: 0; }
.file-name { display: block; font-weight: 700; color: var(--secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .9rem; }
.file-meta { font-size: .78rem; overflow-wrap: anywhere; }
.file-del { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 6px; font-size: .9rem; }
.file-del:hover { color: var(--danger); }
.show-more { display: block; width: 100%; border: 0; border-top: 1px solid var(--border); background: none; padding: 10px; font: 700 .85rem var(--font); color: var(--secondary); cursor: pointer; border-radius: 0 0 var(--radius) var(--radius); }
.show-more:hover { background: var(--card-2); }

/* One column (phones, small laptops): Notes and Files come straight after the first card, not at the very bottom. */
@media (max-width: 999px) {
  .grid-main > .stack { display: contents; }
  .grid-main > .stack > * + * { margin-top: 0; }
  .grid-main > .stack:first-child > :first-child { order: -2; }
  .grid-main .pinned { order: -1; }
}
@media (min-width: 1000px) and (max-width: 1100px) { .grid-main > .stack { display: block; } }
@media (max-width: 860px) {
  .tl-group, .note > summary, .note-body, .note-actions, .note-form, .file-row { padding-left: 16px; padding-right: 16px; }
  .tab-head { padding-left: 10px; }
}

/* Log a call */
.tab-btn svg.i { width: 16px; height: 16px; }
.tab-head { overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; }
.tab-head::-webkit-scrollbar { display: none; }
.tab-btn { flex: none; white-space: nowrap; }
.call-form { padding: 16px 20px 18px; }
.choice-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.choice { cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span { display: inline-block; padding: 8px 14px; border-radius: 99px; border: 1px solid var(--border-strong); background: var(--card); font-weight: 700; font-size: .88rem; color: var(--heading); }
.choice input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; }
.choice input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.input.as-text { display: flex; align-items: center; background: var(--card-2); }
[data-expand] { cursor: pointer; }
@media (max-width: 860px) { .call-form { padding: 14px 16px 16px; } }
#activity, #notes, #files, [id^="note-"], [id^="post-"] { scroll-margin-top: 90px; }

/* ---------- Projects ---------- */
.stat .value.danger, .hours b.danger { color: var(--danger); }
.hours { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 14px 20px 8px; }
.hours div { display: grid; gap: 2px; }
.hours span { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.hours b { font-size: 1.25rem; color: var(--heading); font-variant-numeric: tabular-nums; }
.hours-bar { height: 8px; background: var(--card-2); border: 1px solid var(--border); border-radius: 99px; overflow: hidden; margin: 4px 20px 14px; }
.hours-bar span { display: block; height: 100%; background: var(--primary); border-radius: 99px; }
.hours-bar span.over { background: var(--danger); }
.hours-bar.sm { height: 5px; margin: 8px 0 0; }
.time-form { padding: 14px 20px; border-top: 1px solid var(--border); background: var(--card-2); }
.time-grid { display: grid; grid-template-columns: 150px minmax(170px, 1.4fr) 90px minmax(0, 1.4fr) auto; gap: 10px; align-items: end; }
.time-grid [hidden] { display: none; }
.time-row, .visit-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 20px; border-top: 1px solid var(--border); }
.time-when { width: 84px; flex: none; font-size: .85rem; font-weight: 700; color: var(--muted); padding-top: 2px; }
.time-what { flex: 1; min-width: 0; }
.time-what .badge { margin-left: 6px; }
.visit-row .check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border-strong); background: transparent; display: grid; place-items: center; color: transparent; cursor: pointer; padding: 0; margin-top: 1px; }
.visit-row .check svg { width: 14px; height: 14px; stroke-width: 3; }
.visit-row.done .check { background: var(--ok); border-color: var(--ok); color: #fff; }
.visit-row.done b { color: var(--muted); text-decoration: line-through; }
.due-soon { color: var(--primary); font-weight: 800; }
@media (max-width: 860px) {
  .time-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .time-grid .t-type, .time-grid .t-notes { grid-column: 1 / -1; }
  .time-grid .t-type { order: 3; } .time-grid .t-notes { order: 4; } .time-grid .t-add { order: 5; grid-column: 1 / -1; }
  .time-grid .t-add .btn { width: 100%; }
  .hours { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px 16px 6px; }
  .hours-bar { margin: 4px 16px 12px; }
  .time-form, .time-row, .visit-row { padding-left: 16px; padding-right: 16px; }
}
.hide-desktop-flex { display: none !important; }
@media (max-width: 860px) { .hide-desktop-flex { display: grid !important; } }

/* ---------- Calendar ---------- */
.cal { position: relative; --k-project: var(--primary); --k-survey: #D9822B; --k-other: #7A7F8C; }
.cal-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 10px; }
.cal-bar .icon-btn { font-size: 1.3rem; line-height: 1; }
.cal-title { font-size: 1.1rem; margin-left: 4px; white-space: nowrap; }
select.input.cal-who { width: 200px; flex: none; height: 34px; }
.cal-bar > .btn-row { flex-wrap: nowrap; }
.cal-legend [data-legend-kinds], .cal-legend [data-legend-people] { display: inline-flex; flex-wrap: wrap; gap: 4px 16px; }
.cal-legend [hidden] { display: none; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .8rem; margin-bottom: 10px; align-items: center; }
.cal-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.cal-legend .k-project { background: var(--k-project); } .cal-legend .k-survey { background: var(--k-survey); } .cal-legend .k-other { background: var(--k-other); }
.cal-hint { margin-left: auto; }
.cal-body { overflow: hidden; }
.cal-grid { display: grid; grid-template-rows: auto auto 1fr; }
.cal-head, .cal-allday { display: grid; grid-template-columns: 54px repeat(var(--days), minmax(0, 1fr)); border-bottom: 1px solid var(--border); }
.cal-gutter { font-size: .7rem; color: var(--muted); text-align: right; padding-right: 6px; }
.cal-allday .cal-gutter { padding-top: 6px; }
.cal-dayhead { text-align: center; padding: 8px 0; border-left: 1px solid var(--border); }
.cal-dayhead a { color: var(--muted); display: inline-flex; flex-direction: column; align-items: center; text-decoration: none; }
.cal-dayhead span { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.cal-dayhead b { font-size: 1.25rem; color: var(--heading); width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; }
.cal-dayhead.today b { background: var(--primary); color: #fff; }
.cal-allday-cell { border-left: 1px solid var(--border); padding: 3px; min-height: 30px; display: grid; gap: 2px; align-content: start; cursor: pointer; }
.cal-scroll { max-height: calc(100vh - 290px); min-height: 360px; overflow-y: auto; position: relative; }
.cal-hours { display: grid; grid-template-columns: 54px repeat(var(--days), minmax(0, 1fr)); position: relative; }
.cal-hour { position: relative; } .cal-hour span { position: absolute; top: -7px; right: 6px; font-size: .7rem; color: var(--muted); }
.cal-hour:first-child span { display: none; }
.cal-col { position: relative; border-left: 1px solid var(--border); cursor: pointer; }
.cal-col.today { background: color-mix(in srgb, var(--primary) 4%, transparent); }
.cal-slot { border-top: 1px solid var(--border); }
.cal-slot:first-child { border-top: 0; }
.cal-ev { position: absolute; border-radius: 6px; padding: 3px 6px; font-size: .76rem; line-height: 1.25; overflow: hidden; cursor: pointer;
  background: color-mix(in srgb, var(--ev) 16%, var(--card)); border-left: 3px solid var(--ev); color: var(--heading); z-index: 1; }
.cal-ev b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 800; }
.cal-ev span { display: block; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-ev:hover, .cal-chip:hover { filter: brightness(.97); box-shadow: var(--shadow); }
.drag { touch-action: none; user-select: none; }
@media (pointer: coarse) { .drag, .cal-ev, .cal-chip { touch-action: auto; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; } .drag.armed { outline: 2px solid var(--primary); outline-offset: 1px; } }
.dragging { opacity: .85; z-index: 5; box-shadow: 0 8px 20px rgba(0,0,0,.18); cursor: grabbing; }
.k-project { --ev: var(--k-project); } .k-survey { --ev: var(--k-survey); } .k-other { --ev: var(--k-other); }
.k-leave, .k-leave-pending { --ev: #1E8E3E; }
.cal-chip.pending { background-image: repeating-linear-gradient(135deg, transparent 0 6px, color-mix(in srgb, var(--ev) 18%, transparent) 6px 12px); font-style: italic; }
.cal-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); z-index: 2; pointer-events: none; }
.cal-now::before { content: ""; position: absolute; left: -4px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }
.cal-chip { border-radius: 5px; padding: 1px 6px; font-size: .74rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
  background: color-mix(in srgb, var(--ev) 16%, var(--card)); border-left: 3px solid var(--ev); color: var(--heading); }
.cal-chip span { color: var(--muted); font-weight: 600; }
.cal-month .cal-mhead { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--border); }
.cal-month .cal-mhead div { padding: 8px; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.cal-mgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-mday { min-height: 108px; border-left: 1px solid var(--border); border-top: 1px solid var(--border); padding: 4px; display: grid; gap: 2px; align-content: start; grid-auto-rows: max-content; cursor: pointer; min-width: 0; overflow: hidden; }
.cal-mday > [hidden] { display: none; }
.cal-mday:nth-child(7n+1) { border-left: 0; }
.cal-mday.out { background: var(--card-2); } .cal-mday.out .cal-mnum { color: var(--muted); }
.cal-mnum { font-size: .8rem; font-weight: 800; color: var(--heading); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; text-decoration: none !important; }
.cal-mday.today .cal-mnum { background: var(--primary); color: #fff; }
.cal-more { font-size: .74rem; font-weight: 700; padding-left: 4px; white-space: nowrap; }
.drop { outline: 2px dashed var(--primary); outline-offset: -2px; }
.cal-pop { position: absolute; z-index: 30; padding: 14px 16px; display: grid; gap: 4px; font-size: .9rem; box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.cal-pop b { color: var(--heading); font-size: 1rem; padding-right: 20px; }
.cal-pop.sheet { position: fixed; left: 8px; right: 8px; top: auto; bottom: calc(72px + env(safe-area-inset-bottom)); z-index: 60;
  max-height: 70vh; overflow: auto; border-radius: 16px; box-shadow: 0 -6px 30px rgba(0,0,0,.28); animation: cal-sheet-up .18s ease-out; }
@keyframes cal-sheet-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.cal-pop-x { position: absolute; top: 8px; right: 8px; background: none; border: 0; color: var(--muted); cursor: pointer; font-size: .9rem; }
.cal-flash { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--heading); color: var(--bg); padding: 10px 16px; border-radius: 8px;
  font-weight: 700; font-size: .9rem; opacity: 0; transition: .25s; z-index: 60; pointer-events: none; max-width: calc(100% - 32px); }
.cal-flash.on { opacity: 1; transform: translate(-50%, 0); } .cal-flash.bad { background: var(--danger); color: #fff; }
@media (max-width: 860px) {
  .cal-bar { gap: 8px; } .cal-bar > .btn-row:first-child { flex-wrap: wrap; } .cal-bar > .btn-row:last-child { width: 100%; flex-wrap: nowrap; } select.input.cal-who { flex: 1; width: auto; min-width: 0; }
  .cal-title { font-size: .98rem; }
  .cal-scroll { max-height: calc(100vh - 330px); }
  .cal-mday { min-height: 74px; padding: 2px; } .cal-chip { font-size: .66rem; padding: 1px 3px; }
  .cal-flash { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .cal-head, .cal-allday, .cal-hours { grid-template-columns: 40px repeat(var(--days), minmax(0, 1fr)); }
}
.tab-link { text-decoration: none !important; margin-left: auto; color: var(--secondary); }
.tab-link ~ .tab-link { margin-left: 0; }   /* Book and Meet now sit together on the right */

/* ---------- Availability ---------- */
.av-controls { display: grid; gap: 12px; }
.av-people { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.av-people .lbl { margin-right: 6px !important; }
.choice.sm span { padding: 5px 11px; font-size: .82rem; }
.choice small { font-weight: 600; opacity: .7; }
.choice input:checked + span small { opacity: .9; }
.av-together { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 12px 20px; background: var(--ok-soft); color: var(--ok); font-weight: 700; }
.av-together b { font-size: 1.15rem; color: var(--heading); }
.av-together .btn { margin-left: auto; }
.av-next { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.av-person .tl-main b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.av-person { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--border); }
.av-date { font-weight: 800; color: var(--primary); white-space: nowrap; }
.av-table .r { text-align: right; }
.av-bar { height: 8px; background: var(--card-2); border: 1px solid var(--border); border-radius: 99px; overflow: hidden; display: inline-block; width: calc(100% - 46px); vertical-align: middle; margin-right: 6px; }
.av-bar span { display: block; height: 100%; background: var(--primary); }
.av-bar span.hi { background: var(--warn); }
.av-weeks { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 10px; padding: 16px 20px 10px; height: 230px; align-items: end; }
.av-week { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; color: var(--heading); text-decoration: none !important; }
.av-stack { width: 100%; max-width: 64px; display: flex; flex-direction: column; border-radius: 6px 6px 2px 2px; overflow: hidden; min-height: 4px; }
.av-stack .free { background: var(--ok); } .av-stack .booked { background: var(--border-strong); }
.av-week b { font-size: .85rem; } .av-week small { font-size: .7rem; color: var(--muted); white-space: nowrap; }
.av-week:hover .av-stack { filter: brightness(1.08); }
.av-grid-wrap { overflow-x: auto; }
.av-grid { border-collapse: collapse; width: 100%; font-size: .8rem; }
.av-grid th, .av-grid td { border: 1px solid var(--border); text-align: center; padding: 0; height: 34px; min-width: 28px; }
.av-grid thead th { font-weight: 800; color: var(--heading); padding: 4px 2px; line-height: 1.1; }
.av-grid thead th span { display: block; font-size: .65rem; color: var(--muted); }
.av-grid thead th.today { background: var(--primary); color: #fff; } .av-grid thead th.today span { color: #fff; }
.av-grid th.who { text-align: left; padding: 0 10px; white-space: nowrap; position: sticky; left: 0; background: var(--card); z-index: 1; font-weight: 700; min-width: 140px; }
.av-grid th.wk, .av-grid th.bh, .av-grid td.off { background: var(--card-2); color: var(--muted); min-width: 12px; }
.av-grid th.wk { font-size: .65rem; }
.av-grid td a { display: grid; place-items: center; height: 100%; min-height: 32px; color: inherit; font-weight: 800; text-decoration: none; }
.av-grid td.free { background: var(--ok-soft); color: var(--ok); }
.av-grid td.part { background: var(--warn-soft); color: var(--warn); }
.av-grid td.full { background: var(--danger-soft); color: var(--danger); }
.av-grid td.tot, .av-grid th.tot { padding: 0 8px; white-space: nowrap; font-weight: 800; min-width: 60px; }
.av-grid tr.team td, .av-grid tr.team th { font-weight: 800; background: var(--card-2); }
@media (max-width: 860px) {
  .av-next { grid-template-columns: 1fr; }
  .av-weeks { gap: 4px; padding: 12px 10px 8px; height: 200px; } .av-week small { font-size: .6rem; }
  .av-person, .av-together { padding-left: 16px; padding-right: 16px; }
  .av-grid th.who { min-width: 100px; padding: 0 6px; }
}

/* Email tab */
.email-people { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { border: 1px solid var(--border); background: var(--card-2); color: var(--text); border-radius: 999px; padding: 4px 10px; font: 600 .82rem var(--font); cursor: pointer; }
.chip:hover { border-color: var(--primary); color: var(--heading); }
.email-files { display: grid; gap: 4px; max-height: 220px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; }
.email-file { display: flex; align-items: center; gap: 8px; min-width: 0; cursor: pointer; padding: 3px 0; }
.email-file .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.email-file .muted { flex: none; font-size: .82rem; }

/* Installed on an iPhone the page runs under the status bar (clock, signal, battery):
   keep the top bar and the slide-in menu clear of it. The border shows the bar's own background. */
.topbar { border-top: calc(env(safe-area-inset-top, 0px) * 1.12) solid transparent; }
.side { padding-top: calc(18px + env(safe-area-inset-top, 0px)); }

/* File viewer (photos and PDFs) with a Back button */
.viewer { position: fixed; inset: 0; z-index: 100; background: var(--bg); display: flex; flex-direction: column; }
.viewer[hidden] { display: none; }
.viewer-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--card);
  border-top: calc(env(safe-area-inset-top, 0px) * 1.12) solid transparent; flex: none; }
.viewer-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; text-align: center; }
.viewer-body { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; padding: 12px 8px calc(24px + env(safe-area-inset-bottom, 0px)); text-align: center; outline: none; }
.viewer-img { max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in; border-radius: 4px; }
.viewer-img.full { max-width: none; max-height: none; cursor: zoom-out; }
.viewer-page { display: block; margin: 0 auto 12px; max-width: 100%; height: auto; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.viewer-note { color: var(--muted); margin: 18px 0; }
.viewer-body { touch-action: pan-y pinch-zoom; }
.viewer-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 64px; border: 0; border-radius: 12px; background: color-mix(in srgb, var(--card) 85%, transparent);
  color: var(--heading); font-size: 34px; line-height: 1; cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,.18); z-index: 2; }
.viewer-nav.prev { left: 10px; } .viewer-nav.next { right: 10px; }
.viewer-nav[hidden] { display: none; }
@media (hover: none) { .viewer-nav { width: 36px; height: 52px; font-size: 28px; opacity: .8; } }
html.viewer-open, html.viewer-open body { overflow: hidden; }

/* ---------------------------------------------------------------- Reports */
.rep-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.rep-tabs a { white-space: nowrap; }
.rep-bar { gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.rep-target { position: relative; }
.rep-target summary { list-style: none; }
.rep-target summary::-webkit-details-marker { display: none; }
.rep-target form { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; flex-wrap: wrap; width: max-content; max-width: 90vw; }
.rep-grid { display: grid; gap: 16px; grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: stretch; grid-auto-flow: row dense; }
.rep-grid > * { min-width: 0; }
.rep-w { display: flex; flex-direction: column; padding: 16px 18px; gap: 10px; }
.rep-w.size-kpi { grid-column: span var(--kpi-span, 3); }
.rep-w.size-half { grid-column: span 6; }
.rep-w.size-full { grid-column: 1 / -1; }
.size-kpi .rep-head h2, .size-kpi .rep-head .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 860px) { .rep-w.size-half { grid-column: 1 / -1; } }
@media (max-width: 860px) {
  .rep-grid { gap: 10px; } .rep-w { padding: 14px; }
  .rep-w.size-kpi { grid-column: span 6; } .rep-w.size-kpi.odd-last { grid-column: 1 / -1; }
  .k-metric .rep-big, .k-gauge .rep-big { font-size: 1.35rem; } .size-kpi .rep-head .sub { font-size: .74rem; }
}
.rep-head h2 { font-size: .95rem; margin: 0; }
.rep-head .sub { margin-top: 2px; }
.rep-metric { display: flex; flex-direction: column; gap: 2px; color: inherit; }
.rep-metric:hover { text-decoration: none; }
.rep-metric:hover .rep-big { color: var(--primary); }
.rep-big { font-size: 1.9rem; font-weight: 800; color: var(--heading); line-height: 1.15; font-variant-numeric: tabular-nums; }
.rep-gauge { height: 10px; border-radius: 99px; background: var(--card-2); border: 1px solid var(--border); overflow: hidden; }
.rep-gauge span { display: block; height: 100%; background: var(--series-1); border-radius: 99px; }
.rep-gauge-l { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.rep-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .8rem; color: var(--text); }
.rep-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.s1 { background: var(--series-1); }
.s2 { background: var(--series-2); }
.rep-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.rep-bar-row { display: grid; grid-template-columns: minmax(0, 38%) minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 6px 6px; border-radius: 8px; color: inherit; }
.rep-bar-row:hover { background: var(--card-2); text-decoration: none; }
.rep-bar-l { font-size: .85rem; font-weight: 700; color: var(--heading); overflow: hidden; text-overflow: ellipsis; }
.rep-bar-l small { display: block; font-weight: 400; color: var(--muted); font-size: .76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rep-track { display: flex; flex-direction: column; gap: 2px; justify-content: center; min-height: 12px; }
.rep-fill { display: block; height: 12px; border-radius: 0 4px 4px 0; min-width: 2px; }
.rep-fill.thin { height: 7px; }
.rep-bar-v { font-size: .82rem; font-weight: 700; color: var(--text); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 700px) { .rep-bar-row { grid-template-columns: minmax(0, 1fr) auto; } .rep-bar-row .rep-track { grid-column: 1 / -1; grid-row: 2; } }
.rep-cols { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 6px; height: 200px; align-items: end; border-bottom: 1px solid var(--border-strong); padding-top: 18px; }
.rep-cols.dense { gap: 2px; height: 150px; }
.rep-col { position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; height: 100%; color: inherit; border-radius: 6px 6px 0 0; }
.rep-col:hover { background: var(--card-2); text-decoration: none; }
.rep-col-bar { display: flex; flex-direction: column; gap: 2px; min-height: 0; }
.rep-seg { display: block; min-height: 2px; }
.rep-col-bar .rep-seg:first-child { border-radius: 4px 4px 0 0; }
.rep-col-v { font-size: .7rem; font-weight: 700; color: var(--text); text-align: center; white-space: nowrap; margin-bottom: 3px; font-variant-numeric: tabular-nums; }
.rep-col-l { position: absolute; top: 100%; left: 0; right: 0; text-align: center; font-size: .72rem; color: var(--muted); padding-top: 4px; white-space: nowrap; }
.rep-col.now .rep-col-l { color: var(--heading); font-weight: 800; }
.rep-col-l small { display: block; font-size: .66rem; color: var(--muted); font-weight: 700; }
.rep-cols.grouped { margin-bottom: 36px; }
.rep-cols.grouped .rep-col:has(small) { box-shadow: -1px 0 0 var(--border); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.rep-cols { margin-bottom: 22px; }
.rep-cols.dense .rep-col:not(:nth-child(5n+1)):not(.now) .rep-col-l { visibility: hidden; }
@media (max-width: 700px) { .rep-cols:not(.dense) .rep-col-v { display: none; } .rep-cols { gap: 3px; } }
[data-tip] { position: relative; }
[data-tip]:hover::after, [data-tip]:focus-visible::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); z-index: 30;
  background: var(--heading); color: var(--bg); font-size: .76rem; font-weight: 700; padding: 6px 9px; border-radius: 6px;
  white-space: nowrap; pointer-events: none; box-shadow: var(--shadow);
}
.rep-col[data-tip]:hover::after { bottom: auto; top: -8px; transform: translate(-50%, -100%); }
.rep-cols .rep-col:first-child[data-tip]:hover::after, .rep-cols .rep-col:nth-child(2)[data-tip]:hover::after { left: 0; transform: translate(0, -100%); }
.rep-cols .rep-col:last-child[data-tip]:hover::after, .rep-cols .rep-col:nth-last-child(2)[data-tip]:hover::after { left: auto; right: 0; transform: translate(0, -100%); }
.rep-more { font-size: .82rem; font-weight: 700; margin-top: auto; padding-top: 4px; }
.rep-table-sum { font-size: .9rem; }
.rep-scroll { overflow-x: auto; margin: 0 -18px; }
.card > .rep-scroll { margin: 0; }   /* a full-page report list sits straight in its card: no padding to stretch into */
.rep-scroll .table th:first-child, .rep-scroll .table td:first-child { padding-left: 18px; }
.table .num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.rep-matrix td, .rep-matrix th { white-space: nowrap; padding: 10px 10px; }
.rep-matrix th { font-size: .68rem; letter-spacing: .03em; }
.quote-row { display: flex; align-items: flex-start; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.quote-row:last-of-type { border-bottom: 0; }

/* Proposal editor */
.li-wrap { overflow-x: auto; }
.li-table { width: 100%; border-collapse: collapse; min-width: 560px; }
.li-table th { text-align: left; font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 4px 6px; }
.li-table td { padding: 3px; vertical-align: middle; }
.li-table td:first-child { width: 32%; }
.li-table td.c, .li-table th:nth-child(5), .li-table th:nth-child(6) { text-align: center; width: 56px; }
.li-table .input.num, .li-table th.num { width: 90px; text-align: right; }
.sec-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sec-list li { border: 1px solid var(--border); border-radius: 10px; padding: 6px 8px 6px 12px; gap: 6px; background: var(--card); }
.sec-list .grow { flex: 1 1 auto; min-width: 0; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 14px; margin-top: 6px; font-size: .9rem; }

/* Global search (top bar) */
.gsearch { position: relative; flex: 0 1 340px; min-width: 0; display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--border); border-radius: 99px; padding: 0 12px; height: 38px; }
.gsearch:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.gsearch > svg.i { width: 17px; height: 17px; color: var(--muted); flex: none; }
.gsearch input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); font: inherit; outline: none; height: 100%; }
.gsearch input::-webkit-search-cancel-button { cursor: pointer; }
.gsearch kbd, .content kbd { font: 700 .72rem var(--font); color: var(--muted); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; }
.gsearch-results { position: absolute; top: calc(100% + 6px); right: 0; width: min(560px, 92vw); max-height: min(70vh, 620px); overflow: auto; background: var(--card); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 18px 40px rgba(0,0,0,.18); padding: 6px; z-index: 40; }
.gsearch-results h4 { font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 8px 10px 4px; }
.gsearch-results a.hit { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; color: inherit; text-decoration: none; }
.gsearch-results a.hit .t { font-weight: 700; color: var(--heading); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gsearch-results a.hit .s { font-size: .8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gsearch-results a.hit .w { flex: 1; min-width: 0; display: grid; }
.gsearch-results a.hit.on, .gsearch-results a.hit:hover { background: var(--primary-soft); }
.gsearch-results .all { display: block; padding: 10px; text-align: center; font-weight: 700; font-size: .85rem; border-top: 1px solid var(--border); margin-top: 6px; }
.gsearch-results .none { padding: 14px 10px; color: var(--muted); }
.gsearch-btn { display: none; }
@media (max-width: 860px) {
  .gsearch { display: none; }
  .gsearch-btn { display: grid; }
}

/* Daily leads */
.lead-picks { display: grid; gap: 12px; }
.lead-pick { padding: 16px 20px; scroll-margin-top: 80px; }
.lead-pick.dealt { opacity: .72; }
.lp-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lp-score { margin-left: auto; font-weight: 900; font-size: .9rem; color: var(--heading); background: var(--card-2); border: 1px solid var(--border); border-radius: 99px; min-width: 36px; text-align: center; padding: 1px 8px; }
.lp-title { margin: 8px 0 0; font-size: 1.05rem; overflow-wrap: anywhere; }
.lp-title a { color: var(--heading); }
.lp-sub { font-size: .88rem; margin-top: 2px; overflow-wrap: anywhere; }
.lp-why { margin: 10px 0 0; padding-left: 18px; font-size: .9rem; display: grid; gap: 3px; }
.lp-why li::marker { color: var(--primary); }
.lp-reach { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.lp-person { font-weight: 700; margin-right: 4px; }
.lp-reach .btn .i, .lp-actions .btn .i { width: 15px; height: 15px; }
.lp-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: flex-start; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.lp-actions form { margin: 0; }
.lp-menu { position: relative; }
.lp-menu > summary { list-style: none; cursor: pointer; }
.lp-menu > summary::-webkit-details-marker { display: none; }
.lp-pop { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; background: var(--card); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.14); padding: 10px; display: flex; flex-wrap: wrap; gap: 6px; width: max-content; max-width: min(320px, calc(100vw - 48px)); }
form.lp-pop { flex-direction: column; align-items: stretch; width: min(320px, calc(100vw - 48px)); }
@media (max-width: 640px) { .lead-pick { padding: 14px 16px; } .lp-pop { position: static; margin-top: 6px; box-shadow: none; } }

/* Arrange: panels on record pages that people can reorder, move between columns and hide. */
[data-hidden-panel] { display: none !important; }
.arrange-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; position: sticky; top: 8px; z-index: 6; border: 2px solid var(--primary); }
.arranging > .stack { min-height: 160px; border-radius: var(--radius); outline: 2px dashed var(--border-strong); outline-offset: 6px; }
.arranging [data-panel] { border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); overflow: hidden; }
.arranging [data-panel][data-hidden-panel] { display: block !important; opacity: .5; }
.arranging [data-panel] > :not(.panel-bar) { display: none !important; }   /* just the bars while arranging: short and easy to drag */
.arranging > .stack > [data-panel] + [data-panel] { margin-top: 10px; }
.arranging [data-panel].dragging { opacity: .4; }
.panel-bar { display: flex; align-items: center; gap: 6px; padding: 6px 8px 6px 12px; background: var(--primary); color: var(--primary-ink); cursor: grab; font-size: .9rem; user-select: none; }
.panel-bar .grip { font-size: 1.1rem; line-height: 1; }
.panel-bar button { min-width: 36px; min-height: 34px; border: 0; border-radius: 6px; background: rgba(255,255,255,.18); color: inherit; font: 700 .85rem var(--font); cursor: pointer; padding: 0 8px; }
.panel-bar button:hover { background: rgba(255,255,255,.32); }
@media (max-width: 999px) {
  .grid-main [data-panel]:has(> .pinned) { order: -1; }
  .arranging .panel-bar [data-m="swap"] { display: none; }
}

/* Back button (top bar, on pages below the main menu) */
.back-btn { flex: none; color: var(--heading); text-decoration: none !important; }
.back-btn .i { width: 20px; height: 20px; }

/* Home dashboards (one per role) */
.home-as { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin: -4px 0 12px; font-size: .85rem; }
.home-as-seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 99px; background: var(--card-2); border: 1px solid var(--border); }
.home-as-seg a { padding: 5px 14px; border-radius: 99px; color: var(--text); text-decoration: none; font-weight: 700; text-align: center; white-space: nowrap; }
.home-as-seg a:hover { color: var(--heading); text-decoration: none; }
.home-as-seg a.on { background: var(--primary); color: var(--primary-ink); box-shadow: 0 1px 3px rgba(0,0,0,.15); }
@media (max-width: 600px) {
  .home-as { display: block; }
  .home-as > .muted { display: block; margin-bottom: 6px; }
  .home-as-seg { display: flex; width: 100%; }
  .home-as-seg a { flex: 1; padding: 7px 4px; font-size: .82rem; }
}
.home-sum { margin: 0 0 14px; color: var(--muted); font-weight: 700; }
.home-kpis { margin-bottom: 0; }
.home-ev, .home-flag, .home-lead { display: flex; gap: 12px; align-items: center; padding: 11px 20px; border-top: 1px solid var(--border); color: inherit; text-decoration: none; }
.card-head + .home-ev, .card-head + .home-flag, .card-head + .home-lead { border-top: 0; }
a.home-ev:hover, a.home-flag:hover { background: var(--card-2); }
.home-ev .body, .home-flag .body, .home-lead .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.home-ev .meta, .home-flag .meta, .home-lead .meta { font-size: .82rem; color: var(--muted); overflow-wrap: anywhere; }
.home-flag a.meta { color: var(--secondary); }
.home-time { width: 52px; flex: none; font-weight: 800; color: var(--heading); font-size: .9rem; }
.home-mark { width: 4px; align-self: stretch; border-radius: 2px; background: var(--primary); flex: none; }
.home-mark.k-site-survey { background: var(--series-2); }
.home-mark.k-appointment { background: var(--muted); }
.home-num { min-width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 900; flex: none; background: var(--primary-soft); color: var(--primary); }
.home-num.amber { background: var(--warn-soft); color: var(--warn); }
.home-num.red { background: var(--danger-soft); color: var(--danger); }
.home-num.green { background: var(--ok-soft); color: var(--ok); }
.home-sub { display: block; padding: 6px 20px 6px 66px; font-size: .85rem; color: var(--secondary); text-decoration: none; }
.home-sub:last-child { padding-bottom: 12px; }
.home-lead .lp-score { margin-left: 0; flex: none; }
.home-date { width: 44px; flex: none; text-align: center; font-size: .72rem; color: var(--muted); font-weight: 700; line-height: 1.1; }
.home-date b { display: block; font-size: 1.15rem; color: var(--heading); }
.home-job { overflow: hidden; }
.home-job-head { background: var(--nav-bg); color: #fff; padding: 14px 20px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.home-job-head h2 { color: #fff; width: 100%; margin: 6px 0 0; font-size: 1.2rem; }
.home-job-head > span:not(.badge), .home-job-head > div { color: #C9CED8; font-size: .88rem; }
.home-job-head > div { width: 100%; }
.home-job-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.home-job-btns .btn { flex: 1 1 120px; justify-content: center; min-height: 44px; }
[data-panel="jobs"] > * + * { margin-top: 16px; }

/* Say a task (microphone in the top bar) */
dialog.voice { border: 0; padding: 0; border-radius: 16px; width: min(520px, calc(100vw - 24px)); background: var(--card); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
dialog.voice::backdrop { background: rgba(20, 24, 32, .55); }
.voice-box { padding: 18px 20px 20px; }
.voice-eg { font-size: .88rem; margin: 6px 0 14px; }
.voice-mic { display: grid; place-items: center; width: 84px; height: 84px; margin: 4px auto 8px; border-radius: 50%; border: 0; background: var(--primary); color: var(--primary-ink); cursor: pointer; }
.voice-mic .i { width: 36px; height: 36px; }
.voice-mic.on { background: var(--danger); animation: voice-pulse 1.2s ease-in-out infinite; }
@keyframes voice-pulse { 50% { box-shadow: 0 0 0 14px color-mix(in srgb, var(--danger) 18%, transparent); } }
@media (prefers-reduced-motion: reduce) { .voice-mic.on { animation: none; } }
.voice-state { text-align: center; margin: 0 0 12px; font-size: .9rem; }
/* Phones: the light/dark switch lives in Settings, leaving room in the top bar for the title, the microphone and search. */
@media (max-width: 600px) { .topbar-theme { display: none; } }

/* Very wide screens: the side column of record and home pages gets a little more of the extra room. */
@media (min-width: 2000px) {
  .grid-main { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
  .topbar { padding: 22px 48px; }
  .content { padding: 4px 48px 48px; }
}

.note-files { padding: 0 20px 12px; }

.lead-next { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; }
.lead-next form { display: contents; }
.lead-edit-form { border-top: 1px solid var(--border); }
section.editing > .card-pad, section.editing > .card-head [data-lead-edit] { display: none; }

.invite-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { border: 1px solid var(--border-strong); background: var(--card); color: var(--text); border-radius: 99px; padding: 5px 11px; font: 700 .82rem var(--font); cursor: pointer; }
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }

.ev-more { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; }
.ev-more > summary { cursor: pointer; font-weight: 800; color: var(--heading); }
.meet-line { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin-top: 6px; font-size: .85rem; }
.meet-line .i { width: 15px; height: 15px; vertical-align: -3px; }
.meet-notes { margin-top: 10px; padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--card-2); font-size: .9rem; }
.meet-notes > summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.meet-notes h4 { margin: 12px 0 4px; font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.meet-notes ul { margin: 0; padding-left: 18px; }
.meet-notes li { margin: 2px 0; }
.meet-notes p { margin: 8px 0 0; }
.meet-notes .small { font-size: .78rem; margin-top: 12px; }
.meet-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 18px; }
.meet-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px 18px; margin: 10px 0 0; }
.meet-facts dt { font-size: .78rem; color: var(--muted); font-weight: 700; }
.meet-facts dd { margin: 0; }
.meet-actions { list-style: none; padding-left: 0 !important; }
.meet-actions li { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 5px 0; border-top: 1px solid var(--border-strong); }
.meet-actions li:first-child { border-top: 0; }
.meet-actions .btn { flex: none; }
form.inline { display: inline; }
/* Meeting notes on the timeline: title, a three-line summary, full notes on demand, tasks to approve. */
.meet-notes .mn-head { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.meet-notes .mn-title { color: var(--heading); font-size: .95rem; flex: 1 1 220px; }
.meet-notes .mn-summary { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin: 6px 0 0; }
.meet-notes .mn-more { margin-top: 4px; }
.meet-notes .mn-more > summary { list-style: none; display: inline-block; cursor: pointer; font-size: .85rem; margin-top: 2px; }
.meet-notes .mn-more > summary::-webkit-details-marker { display: none; }
.meet-notes .mn-more .mn-close, .meet-notes .mn-more[open] .mn-open { display: none; }
.meet-notes .mn-more[open] .mn-close { display: inline; }
.meet-notes:has(.mn-more[open]) .mn-summary { -webkit-line-clamp: unset; display: block; }
.mn-tasks { margin-top: 12px; border-top: 1px solid var(--border-strong); padding-top: 10px; }
.mn-row { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 8px 14px; align-items: center; }
.mn-row > .mn-cell:only-child { grid-column: 1 / -1; }
.mn-tasks-head { margin-bottom: 4px; }
.mn-tasks-head .mn-cell { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.mn-tasks-head b { display: inline-flex; gap: 6px; align-items: center; color: var(--heading); }
.mn-task { padding: 8px 0; border-top: 1px solid var(--border); }
.mn-tasks-head + .mn-task { border-top: 0; }
.mn-subject { resize: none; field-sizing: content; min-height: 1.6em; line-height: 1.35; display: block; width: 100%; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--text); font: inherit; font-weight: 700; padding: 3px 6px; margin-left: -6px; }
.mn-subject:hover, .mn-subject:focus { border-color: var(--border-strong); background: var(--card); outline: none; }
.mn-task-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; font-size: .82rem; }
.mn-task-meta select, .mn-task-meta input { font: inherit; color: var(--text); background: var(--card); border: 1px solid var(--border-strong); border-radius: 6px; padding: 3px 6px; min-height: 30px; }
.mn-field { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
.mn-field .i { width: 15px; height: 15px; }
.mn-field input:not(:focus):placeholder-shown, .mn-field input[value=""]:not(:focus) { color: var(--muted); }
.mn-task-act { display: flex; gap: 6px; }
.mn-task-act .btn:first-child { flex: 1; justify-content: center; white-space: nowrap; }
.mn-spacer { visibility: hidden; }
.mn-task.done .mn-cell { display: flex; gap: 8px; align-items: center; color: var(--ok); }
.mn-task.done a { font-weight: 700; }
.mn-task.done .muted .i { width: 13px; height: 13px; vertical-align: -2px; }
.mn-task.gone .mn-cell { display: flex; gap: 8px; align-items: center; font-size: .85rem; }
@media (max-width: 560px) { .mn-row { grid-template-columns: 1fr; } .mn-task-act .btn { flex: 1; justify-content: center; } .mn-spacer { display: none; } }

/* Pull to refresh (installed app only, see app.js) */
.ptr { position: fixed; left: 50%; top: env(safe-area-inset-top, 0px); z-index: 300; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; background: var(--card); color: var(--muted); box-shadow: 0 2px 10px rgba(0,0,0,.18);
  transform: translate(-50%, -50px); opacity: 0; pointer-events: none; transition: transform .2s, opacity .2s, color .15s; }
.ptr.ready { color: var(--primary); }
.ptr.spin svg { animation: ptr-spin .7s linear infinite; }
@keyframes ptr-spin { to { transform: rotate(360deg); } }

/* Ask Alessandro */
.ask { max-width: 860px; margin: 0 auto; min-height: calc(100vh - 160px); display: flex; flex-direction: column; }
.ask-thread { flex: 1; }
.ask-thread { display: flex; flex-direction: column; gap: 18px; }
.ask-avatar { width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #3FD0FF, var(--primary) 55%, #0A5E86); box-shadow: 0 1px 4px rgba(0,0,0,.18); }
.ask-avatar svg { width: 19px; height: 19px; fill: currentColor; stroke: currentColor; stroke-width: 1; stroke-linejoin: round; }
.ask-avatar.lg { width: 52px; height: 52px; }
.ask-avatar.lg svg { width: 28px; height: 28px; }
.ask-examples { display: flex; flex-wrap: wrap; gap: 8px; }
.ask-examples .chip { text-align: left; white-space: normal; }
.ask-q { display: flex; justify-content: flex-end; }
.ask-q span { background: var(--primary); color: #fff; padding: 10px 14px; border-radius: 16px 16px 4px 16px; max-width: 80%; white-space: pre-wrap; overflow-wrap: anywhere; }
.ask-a { display: flex; gap: 10px; margin-top: 10px; align-items: flex-start; }
.ask-body { flex: 1; min-width: 0; }
.ask-text { background: var(--card); border: 1px solid var(--border); padding: 10px 14px; border-radius: 4px 16px 16px 16px; color: var(--text); line-height: 1.5; }
.ask-text.ask-failed { border-color: var(--danger); }
.ask-meta { font-size: .82rem; color: var(--muted); margin: 10px 2px 6px; }
.ask-rows { display: grid; gap: 8px; }
.ask-row { display: flex; flex-direction: column; gap: 3px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px;
  color: inherit; text-decoration: none; }
a.ask-row:hover { border-color: var(--primary); }
.ask-row-title { font-weight: 800; color: var(--heading); }
.ask-row-sub { font-size: .88rem; color: var(--muted); }
.ask-facts { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .84rem; margin-top: 2px; }
.ask-facts i { font-style: normal; color: var(--muted); margin-right: 3px; }
.ask-groups { margin-top: 10px; overflow-x: auto; }
.ask-rate { display: flex; gap: 6px; margin-top: 6px; align-items: center; font-size: .82rem; }
.icon-btn.sm { width: 30px; height: 30px; font-size: .9rem; }
.ask-box { position: sticky; z-index: 40; bottom: 16px; margin-top: 18px;
  display: flex; gap: 8px; align-items: flex-end; padding: 8px; box-shadow: 0 6px 24px rgba(0,0,0,.14); }
.ask-box textarea { flex: 1; resize: none; min-height: 40px; max-height: 160px; border: 0; background: transparent; box-shadow: none; }
.ask-box textarea:focus { outline: none; box-shadow: none; }
.ask-box [data-ask-mic].on { background: var(--danger); color: #fff; border-color: transparent; }
.ask-thinking { display: flex; gap: 10px; align-items: center; color: var(--muted); margin-top: 14px; }
.ask-thinking[hidden] { display: none; }
.ask-thinking .dots { display: inline-flex; gap: 4px; }
.ask-thinking .dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); animation: ask-dot 1s infinite ease-in-out; }
.ask-thinking .dots i:nth-child(2) { animation-delay: .15s; } .ask-thinking .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes ask-dot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (max-width: 899px) { .ask-box { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); } }

/* Theme dimmer: hold the top-bar button */
.topbar-theme { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation; }
.topbar-theme.dimming { box-shadow: 0 0 0 3px var(--primary-soft), 0 0 14px var(--primary); color: var(--primary); }

/* Voltaforce logo: the full logo in the menu, just the mark when the menu is icons only */
.brand-logo { display: block; width: 132px; height: auto; }
.brand-mark { display: none; width: 30px; height: auto; }
@media (min-width: 861px) and (max-width: 1199px) { html:not([data-nav="hidden"]) .brand-mark { display: block; } }
@media (min-width: 861px) { html[data-nav="icons"] .brand-mark { display: block; } }
.auth-logo { display: block; width: 185px; max-width: 80vw; height: auto; margin: 0 auto; }

/* Ask Alessandro on phones: a round button above the tab bar (the top bar has no room for it) */
.ask-fab { display: none; }
@media (max-width: 860px) {
  .ask-top { display: none !important; }
  .ask-fab { display: grid; place-items: center; position: fixed; z-index: 21; right: 16px; bottom: calc(78px + env(safe-area-inset-bottom, 0px));
    width: 52px; height: 52px; border-radius: 50%; color: #fff; background: linear-gradient(135deg, #3FD0FF, var(--primary) 55%, #0A5E86);
    box-shadow: 0 6px 18px rgba(0, 150, 207, .35), 0 2px 6px rgba(0,0,0,.2); }
  .ask-fab svg { width: 26px; height: 26px; fill: currentColor; stroke: currentColor; stroke-width: 1; stroke-linejoin: round; }
  .ask-fab:active { transform: scale(.94); }
  .content { padding-bottom: calc(150px + env(safe-area-inset-bottom)); }
}

/* Phones: every icon-only button in the top bar is the same round shape and size (the words are hidden on phones) */
@media (max-width: 860px) {
  .topbar { gap: 8px; }
  .topbar .btn:has(> .hide-mobile) { width: 38px; min-width: 38px; padding: 0; border-radius: 50%; gap: 0; flex: none; }
  .topbar .btn:has(> .hide-mobile).btn-ghost { background: var(--card); border: 1px solid var(--border); }
  .topbar form:has(> .btn > .hide-mobile) { flex: none; }
}
@media (max-width: 420px) {
  .topbar { gap: 6px; }
  .topbar .icon-btn, .topbar .btn:has(> .hide-mobile) { width: 36px; min-width: 36px; height: 36px; }
  .topbar h1 { font-size: 1.1rem; }
}

/* Report click-through lists on phones: the same clean cards as the main lists (name, then stage and amount on one line) */
@media (max-width: 720px) {
  .rep-scroll { margin: 0; overflow: visible; }
  .rep-scroll .table th:first-child, .rep-scroll .table td:first-child { padding-left: 0; }
  .rep-scroll .table tr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
  .rep-scroll .table td { width: auto; }
  .rep-scroll .table td:first-child { width: 100%; }
  .rep-scroll .table td.num { margin-left: auto; font-weight: 800; color: var(--heading); }
}

/* Tabs and filters everywhere: one segmented switch (the same look as the Home page switch). On phones each switch is a
   full-width track; short ones share the width equally, long ones scroll sideways inside their own track. */
.tabs { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 99px; background: var(--card-2); border: 1px solid var(--border); }
.tabs a { padding: 6px 14px; border-radius: 99px; border: 0; background: transparent; color: var(--text); white-space: nowrap; text-align: center; }
.tabs a:hover { color: var(--heading); text-decoration: none; }
.tabs a.on { background: var(--primary); color: var(--primary-ink); box-shadow: 0 1px 3px rgba(0,0,0,.15); border: 0; }
.rep-tabs { flex-wrap: nowrap; max-width: 100%; }
@media (max-width: 860px) {
  .tabs { display: flex; width: 100%; flex-wrap: nowrap; overflow-x: auto; margin-left: 0; margin-right: 0; padding: 3px; scroll-padding: 0 3px; }
  .tabs a { flex: 1 0 auto; padding: 8px 12px; font-size: .84rem; }
  /* toolbars with two switches (Pipeline/List and Everyone/Mine): side by side, half each; the search goes underneath */
  .row:has(> .tabs + .tabs) { flex-wrap: wrap !important; gap: 8px !important; }
  .row:has(> .tabs + .tabs) > .tabs { flex: 1 1 0; width: auto; min-width: 0; }
  .row:has(> .tabs) > .spacer { display: none; }
  .row:has(> .tabs) > .search, .row:has(> .tabs) > form.search { flex: 1 1 100%; }
  .row:has(> .tabs) > .search .input { width: 100%; }
}
@media (max-width: 860px) {
  .cal-bar .btn-row:has(> .tabs) { width: 100%; flex-wrap: nowrap; gap: 8px; }
  .cal-bar .cal-who { flex: 0 0 38%; min-width: 0; }
  .cal-bar .btn-row > .tabs a { padding: 8px 6px; }
  .cal-bar .btn-row > .tabs { flex: 1 1 0; width: auto; min-width: 0; }
}

/* Chatter: automatic updates as small grey one-liners between the team's posts; "Hide updates" leaves just the conversation */
.post-update { display: flex; align-items: baseline; gap: 8px; padding: 7px 20px 7px 30px; border-top: 1px solid var(--border); font-size: .84rem; color: var(--muted); }
.post-update .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border-strong); flex: none; transform: translateY(-1px); }
.post-update .txt { flex: 1; min-width: 0; overflow-wrap: anywhere; color: var(--text); opacity: .85; }
.post-update .when { flex: none; font-size: .78rem; white-space: nowrap; }
@media (max-width: 600px) { .post-update { flex-wrap: wrap; padding-left: 20px; } .post-update .when { width: 100%; padding-left: 15px; } }
.chatter-filter { display: flex; align-items: center; gap: 8px; padding: 4px 20px 10px; font-size: .85rem; font-weight: 600; cursor: pointer; }
.chatter-filter .muted { font-weight: 500; }
[data-chatter-list].no-updates [data-update] { display: none; }

/* Sidebar: the sign-out row is always on screen; if the menu is longer than the window, the menu scrolls instead */
.side { height: 100vh; height: 100dvh; }
.side .nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.side .side-foot { flex: none; margin-top: 8px; }
.side .brand { flex: none; }
@media (max-height: 800px) and (min-width: 861px) {
  .side .nav a { padding-top: 8px; padding-bottom: 8px; }
  .side .nav-label { padding-top: 10px; }
  .side .brand { padding-bottom: 14px; }
}
/* Seven tabs on the phone tab bar: a little narrower so every label fits */
@media (max-width: 860px) { .tabbar a { min-width: 0; font-size: .66rem; letter-spacing: -.01em; } .tabbar svg.i { width: 21px; height: 21px; } }
.alert.practice { background: var(--warn-soft); color: var(--warn); border-color: transparent; }

.cal-who-pick { position: relative; }
.cal-who-pick .cal-who { text-align: left; min-width: 180px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; padding-right: 28px;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.cal-who-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: 280px; max-height: min(70vh, 520px); overflow: auto; padding: 10px; }
.cal-who-quick { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 8px; margin-bottom: 6px; border-bottom: 1px solid var(--border); }
.cal-who-list { display: grid; gap: 2px; }
.cal-who-list .choice { margin: 0; }
@media (max-width: 860px) { .cal-who-menu { right: auto; left: 0; width: min(280px, calc(100vw - 32px)); } .cal-bar .cal-who-pick { flex: 0 0 38%; min-width: 0; } .cal-who-pick .cal-who { min-width: 0; width: 100%; max-width: none; } }
.cal-locked { font-size: .8rem; margin-top: 6px; }
/* People on an opportunity / project */
.people { display: grid; }
.person { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-top: 1px solid var(--border); }
.person:first-child { border-top: 0; }
.person-main { flex: 1; min-width: 0; }
.person-main .badge { margin-left: 6px; }
.person-roles { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.person-roles .badge { margin: 0; }
.person-edit { flex: none; }
.person-edit[open] { flex-basis: 100%; }
.person-edit summary { list-style: none; cursor: pointer; }
.person-edit summary::-webkit-details-marker { display: none; }
.person:has(.person-edit[open]) { flex-wrap: wrap; }
.person-form { display: flex; flex-wrap: wrap; gap: 6px 12px; padding: 10px 0 6px; }
.person-form .btn-row { flex-basis: 100%; }
.person-new-roles { display: flex; flex-wrap: wrap; gap: 6px 12px; }


/* Formatted text: editor and display */
.rich-field .rich-bar { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; padding: 6px; border: 1px solid var(--border); border-bottom: 0; border-radius: 8px 8px 0 0; background: var(--card-2); }
.rich-bar button { border: 1px solid transparent; background: none; color: var(--text); border-radius: 6px; padding: 4px 8px; font: inherit; font-size: .85rem; cursor: pointer; min-width: 30px; }
.rich-bar button:hover { background: var(--card); border-color: var(--border); }
.rich-bar select { font: inherit; font-size: .85rem; border: 1px solid var(--border); border-radius: 6px; padding: 3px 6px; background: var(--card); color: var(--text); }
.rich-sep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }
.rich-colours { display: inline-flex; gap: 3px; margin: 0 4px; }
.rich-colours button, .rich-colours button:hover { width: 20px; height: 20px; min-width: 0; padding: 0; border-radius: 50%; background: var(--c); border: 2px solid var(--card); box-shadow: 0 0 0 1px var(--border); }
.rich-colours button:hover { transform: scale(1.15); }
.rich-edit { border-radius: 0 0 8px 8px; height: auto; max-height: 520px; overflow: auto; line-height: 1.5; white-space: normal; padding: 10px 12px; }
.rich-edit:focus { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent); }
.rich, .rich-edit { overflow-wrap: anywhere; }
.rich p, .rich-edit p { margin: 0 0 .5em; }
.rich ul, .rich ol, .rich-edit ul, .rich-edit ol { margin: 0 0 .5em; padding-left: 1.4em; }
.rich li, .rich-edit li { margin: .15em 0; }
.rich > :last-child { margin-bottom: 0; }
.addr-finder { position: relative; }
.addr-menu .lookup-item small { display: block; color: var(--muted); font-weight: 500; }
.addr-biz { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--primary); }

/* Holidays */
.leave-row { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--border); }
.card-head + .leave-row { border-top: 0; }
.leave-main { min-width: 0; }
.leave-actions { display: flex; gap: 6px; align-items: flex-start; flex-wrap: wrap; justify-content: flex-end; }
.leave-actions details summary { list-style: none; } .leave-actions details summary::-webkit-details-marker { display: none; }
.leave-decline { display: flex; gap: 6px; margin-top: 6px; }
.leave-halves { display: grid; gap: 6px; }
.btn-google { background: #fff; color: #1F1F1F; border: 1px solid #DADCE0; gap: 10px; }
.btn-google:hover { background: #F8F9FA; color: #1F1F1F; }
.auth-or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .8rem; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }


/* Activity: the "emails log automatically / find older emails" strip at the top of the panel */
.tl-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0; padding: 8px 16px; background: var(--card-2); border-bottom: 1px solid var(--border); font-size: .84rem; }
.tl-bar-text { flex: 1; min-width: 0; display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.tl-bar-text svg, .tl-bar-btn svg { width: 15px; height: 15px; flex: none; }
.tl-bar-btn { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border: 0; border-radius: 99px; background: transparent; color: var(--primary); font: inherit; font-weight: 700; cursor: pointer; white-space: nowrap; }
.tl-bar-btn:hover { background: var(--primary-soft); }
.tl-bar-btn[disabled] { opacity: .6; cursor: progress; }
@media (max-width: 520px) { .tl-bar-text { display: none; } .tl-bar { justify-content: flex-end; padding: 6px 10px; } }

/* Likes and emoji reactions on Chatter posts */
.reactions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 8px 0 2px; }
.reactions button { font: inherit; cursor: pointer; }
.react-like { border: 0; background: none; padding: 2px 4px; color: var(--muted); font-weight: 700; font-size: .84rem; }
.react-like:hover, .react-like.on { color: var(--primary); }
.react-pick { position: relative; }
.react-pick > summary { list-style: none; display: inline-flex; align-items: center; gap: 1px; padding: 2px 8px; border-radius: 99px; color: var(--muted); font-size: .95rem; cursor: pointer; }
.react-pick > summary::-webkit-details-marker { display: none; }
.react-pick > summary .plus { font-size: .7rem; font-weight: 800; }
.react-pick > summary:hover, .react-pick[open] > summary { background: var(--card-2); color: var(--text); }
.react-menu { position: absolute; z-index: 30; bottom: calc(100% + 6px); left: 0; display: grid; grid-template-columns: repeat(5, 38px); gap: 2px; padding: 6px;
  background: var(--card); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.14); }
.react-menu button { border: 0; background: none; border-radius: 10px; font-size: 1.3rem; line-height: 1; padding: 6px 0; transition: transform .1s; }
.react-menu button:hover { background: var(--card-2); transform: scale(1.18); }
.react-menu button.on { background: var(--primary-soft); }
.react-chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 9px 1px 7px; border-radius: 99px; border: 1px solid var(--border); background: var(--card-2); color: var(--text); font-size: .82rem; }
.react-chip .e { font-size: .95rem; }
.react-chip .n { font-weight: 700; }
.react-chip.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.reactions.busy { opacity: .6; pointer-events: none; }

/* Editing a Chatter post in place */
.post-edit-btn { margin-left: auto; color: var(--muted); font-weight: 600; }
.post-edit-btn + .post-del { margin-left: 10px; }
.post-edit { margin: 6px 0 4px; }
.post-edit textarea { min-height: 72px; }

/* Pitch presentation builder (opportunities → Pitch presentation) */
.pitch-list { list-style: none; margin: 0; padding: 0; }
.pitch-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.pitch-row:last-child { border-bottom: 0; }
.pitch-move { display: flex; flex-direction: column; gap: 2px; padding-top: 1px; }
.pitch-move .linkish { font-size: .7rem; color: var(--muted); padding: 2px 4px; line-height: 1; }
.pitch-move .linkish:hover { color: var(--primary); }
.pitch-main { flex: 1; min-width: 0; }
.pitch-on { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.pitch-on input[type=checkbox] { margin-top: 3px; width: 18px; height: 18px; flex: none; }
.pitch-on .sub { display: block; font-size: .84rem; color: var(--muted); }
.pitch-edit { margin: 4px 0 0 28px; }
.pitch-edit > summary { font-size: .8rem; cursor: pointer; color: var(--muted); font-weight: 600; }
.pitch-edit > summary:hover, .pitch-edit[open] > summary { color: var(--primary); }
.pitch-remove { color: var(--danger); font-size: .84rem; }
.pitch-row:has(input[type=checkbox]:not(:checked)) .pitch-on b { color: var(--muted); font-weight: 600; }

.pitch-eye { color: var(--muted); padding: 2px 4px; } .pitch-eye:hover { color: var(--primary); }
.pitch-eye svg { width: 17px; height: 17px; }
dialog.pitch-preview { width: min(1200px, 94vw); aspect-ratio: 16 / 9; max-height: 90vh; padding: 0; border: 0; border-radius: 14px; background: #0E1219; overflow: hidden; box-shadow: 0 30px 90px rgba(0,0,0,.5); }
dialog.pitch-preview::backdrop { background: rgba(10, 14, 20, .7); }
dialog.pitch-preview iframe { width: 100%; height: 100%; border: 0; display: block; }

/* Product line description (opportunity Products panel) */
.line-desc { grid-column: 1 / -1; margin-top: -4px; }
.line-desc > summary { font-size: .8rem; color: var(--muted); font-weight: 600; cursor: pointer; }
.line-desc > summary:hover, .line-desc[open] > summary { color: var(--primary); }
.line-desc textarea { margin-top: 6px; }
.line-desc-text { white-space: pre-line; }
.add-line .full { grid-column: 1 / -1; }

/* Proposal send: tick people on the opportunity into Cc */
.cc-people { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.cc-chip { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-weight: 500; }
.cc-chip input { margin: 0; }
.cc-chip:has(input:checked) { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }

/* --- Pre-launch polish (5 Nov) --- */
/* Record titles keep room next to the search box and buttons; the search box gives way first. */
@media (min-width: 861px) {
  .topbar h1 { min-width: min(28vw, 340px); }
  .gsearch { flex: 0 3 340px; min-width: 150px; }
}
/* Phones: Ask Alessandro sits above a form's Save bar instead of on top of its button. */
@media (max-width: 860px) {
  body:has(.form-foot:not([hidden] .form-foot)) .ask-fab { bottom: calc(146px + env(safe-area-inset-bottom, 0px)); width: 46px; height: 46px; }
}
/* Phones, on a record or form: the title gets the room (search and Say a task are on the main pages). */
@media (max-width: 860px) { .topbar .sub-page-hide { display: none; } }

/* In-app tips (app.js): a bubble pointing at a button on computers, a card above the tab bar on phones */
.tip { position: fixed; z-index: 60; width: min(330px, calc(100vw - 24px)); background: var(--card); color: var(--text); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: 0 14px 40px rgba(0,0,0,.22); padding: 14px 16px 12px; animation: tip-in .2s ease-out; }
@keyframes tip-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.tip::before { content: ""; position: absolute; left: calc(var(--arrow, 50%) - 8px); width: 14px; height: 14px; background: var(--card); border: 1px solid var(--border); transform: rotate(45deg); }
.tip[data-side="below"]::before { top: -8px; border-right: 0; border-bottom: 0; }
.tip[data-side="above"]::before { bottom: -8px; border-left: 0; border-top: 0; }
.tip.tip-sheet::before { display: none; }
.tip-head { display: flex; align-items: center; gap: 8px; }
.tip-head b { flex: 1; color: var(--heading); font-size: .98rem; }
.tip-badge { font-size: .66rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: #fff; background: var(--primary); border-radius: 99px; padding: 2px 8px; }
.tip-x { border: 0; background: none; color: var(--muted); font-size: 1.3rem; line-height: 1; cursor: pointer; padding: 0 2px; }
.tip p { margin: 8px 0 12px; font-size: .9rem; line-height: 1.5; color: var(--text); }
.tip-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tip-off { border: 0; background: none; color: var(--muted); font: 600 .8rem var(--font); cursor: pointer; padding: 0; }
.tip-off:hover { color: var(--danger); }
.tip-ring { position: fixed; z-index: 59; pointer-events: none; border-radius: 12px; box-shadow: 0 0 0 3px var(--primary), 0 0 0 9px color-mix(in srgb, var(--primary) 22%, transparent);
  animation: tip-pulse 1.6s ease-in-out infinite; transition: all .15s; }
@keyframes tip-pulse { 50% { box-shadow: 0 0 0 3px var(--primary), 0 0 0 14px color-mix(in srgb, var(--primary) 8%, transparent); } }
@media (prefers-reduced-motion: reduce) { .tip, .tip-ring { animation: none; } }
.tip.tip-sheet { left: 12px !important; right: 12px; top: auto !important; width: auto; bottom: calc(78px + env(safe-area-inset-bottom, 0px)); }
.tip.tip-note { padding: 12px 16px; font-size: .9rem; }
@media (min-width: 861px) { .tip.tip-note { left: auto !important; right: 24px; bottom: 24px; width: 330px; } }

/* Attachments saved from logged emails */
.tl-clip { display: inline-flex; align-items: center; gap: 2px; margin-left: 6px; color: var(--muted); font-size: .8rem; font-weight: 600; vertical-align: middle; }
.tl-clip svg { width: 13px; height: 13px; }
.email-files { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.email-file { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: .84rem; color: var(--text); text-decoration: none; max-width: 100%; }
.email-file span:first-of-type { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.email-file:hover { border-color: var(--primary); color: var(--primary); }
.email-file svg { width: 14px; height: 14px; flex: none; }

/* Laptops: a top bar with several buttons (Calendar, record pages) keeps the title, search and every button on screen;
   buttons that are icons on phones are icons here too, and the search box gives way a little further. */
@media (min-width: 861px) and (max-width: 1440px) {
  .topbar h1 { min-width: min(22vw, 300px); }
  .gsearch { min-width: 120px; }
  .topbar .btn:has(> .hide-mobile) > .hide-mobile { display: none; }
  .topbar .btn:has(> .hide-mobile) { width: 38px; min-width: 38px; padding: 0; border-radius: 50%; gap: 0; flex: none; justify-content: center; }
  .topbar .btn:has(> .hide-mobile).btn-ghost { background: var(--card); border: 1px solid var(--border); }
}
/* Tablets and small laptops: wide tables drop their least-needed columns rather than running off the screen */
@media (min-width: 721px) and (max-width: 1200px) { .table [data-hide-md] { display: none; } .table th, .table td { padding-left: 10px; padding-right: 10px; } }
/* Lists on wider screens: headings, dates, times, people, amounts and stages stay on one line; names and accounts wrap */
@media (min-width: 721px) {
  .table th { white-space: nowrap; }
  .table td.nw { white-space: nowrap; }
}
@media (min-width: 721px) and (max-width: 1400px) { .table [data-hide-lg] { display: none; } }
.table-scroll { overflow-x: auto; }   /* a wide table scrolls inside its card instead of pushing the page sideways */
@media (max-width: 720px) { .table-scroll { overflow: visible; } }
/* Project: other engineers */
.crew-add > summary { list-style: none; cursor: pointer; }
.crew-add > summary::-webkit-details-marker { display: none; }
.crew-add[open] > summary { display: none; }
.crew-row > summary { cursor: pointer; padding: 6px 0; }
.crew-row { border-bottom: 1px solid var(--border); padding-bottom: 6px; }

/* Tasks list: tick boxes and the "Change due date" bar */
.bulk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 20px; border-bottom: 1px solid var(--border); }
.bulk-all { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.bulk-move { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
.bulk-move .input { width: auto; min-width: 0; }
.bulk-bar input[type=checkbox], .task-pick input { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }
.task-pick { display: flex; align-items: center; padding: 2px 0 0 6px; cursor: pointer; }
@media (max-width: 560px) { .bulk-move { margin-left: 0; width: 100%; flex-wrap: wrap; } .bulk-move .input { flex: 1; min-width: 10em; } .bulk-bar { padding: 10px 14px; } }

/* "Show all N" under a shortened history */
.collapse-more { display: block; width: calc(100% - 40px); margin: 4px 20px 16px; padding: 9px; border: 1px dashed var(--border-strong); border-radius: 10px;
  background: none; color: var(--primary); font: inherit; font-weight: 700; font-size: .88rem; cursor: pointer; }
.collapse-more:hover { background: var(--primary-soft); border-color: var(--primary); }

/* Email form: Insert link */
.email-body-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.email-body-head .lbl { margin: 0; }
.email-link { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px; margin-bottom: 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--card-2); }
.email-link .input { flex: 1 1 180px; }
.email-link .err { flex-basis: 100%; }

/* Drag and drop files */
[data-drop-zone] { position: relative; }
[data-drop-zone].drop-on { outline: 2px dashed var(--primary); outline-offset: -6px; }
[data-drop-zone].drop-on::after { content: attr(data-drop-zone); position: absolute; inset: 6px; display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--primary-soft) 88%, transparent); color: var(--primary); font-weight: 800; border-radius: 10px; z-index: 6; pointer-events: none; }

/* Reply / Reply all / Forward under an email */
.email-answer { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0 44px; }
@media (max-width: 860px) { .email-answer { margin-left: 0; } }
.email-replying { margin: 0 0 10px; font-size: .88rem; font-weight: 600; }

/* Notifications: bell in the top bar and the list */
.bell-btn { position: relative; }
.bell-btn.on { border-color: var(--primary); color: var(--primary); }
.bell-count { position: absolute; top: -5px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger, #D93A3A);
  color: #fff; font-size: .68rem; font-weight: 800; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--bg); }
.notif-row { display: flex; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--border); color: inherit; text-decoration: none; }
.notif-row:hover { background: var(--card-2); }
.notif-row.new { background: color-mix(in srgb, var(--primary-soft) 60%, transparent); }
.notif-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; background: transparent; }
.notif-row.new .notif-dot { background: var(--primary); }
.notif-main { display: grid; gap: 2px; min-width: 0; }
.notif-main b { color: var(--heading); }
.notif-body { color: var(--text); overflow-wrap: anywhere; }
.notif-meta { font-size: .8rem; }
.notif-warn { color: var(--warn, #B26B00); font-weight: 600; }
@media (max-width: 860px) { .notif-row { padding: 12px 14px; } }

/* Settings → Automation ideas */
.idea { padding: 14px 20px; border-top: 1px solid var(--border); }
.idea p { margin: 6px 0; }
.idea-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.idea-head b { color: var(--heading); font-size: 1.02rem; }
.idea-build { background: color-mix(in srgb, var(--primary-soft) 55%, transparent); }
.idea-not_now { opacity: .65; }
.idea-stats { max-height: 360px; overflow: auto; font-size: .78rem; background: var(--card-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px; white-space: pre-wrap; }
@media (max-width: 860px) { .idea { padding: 12px 14px; } }

/* Holidays: allowance, booked, left */
.hol-sum { margin-bottom: 16px; }
.hol-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; padding: 4px 20px 16px; }
.hol-tile { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--card-2); }
.hol-tile .lbl { margin: 0; }
.hol-tile b { font-size: 1.6rem; color: var(--heading); line-height: 1.2; }
.hol-tile .muted { font-size: .82rem; }
.hol-tile.left { border-color: var(--primary); background: var(--primary-soft); }
.hol-tile.left b { color: var(--primary); }
.hol-tile.low, .hol-low b { color: var(--danger) !important; }
.hol-tile.low { border-color: var(--danger); background: var(--danger-soft); }
.hol-tile.low b { color: var(--danger); }
.hol-note { margin: 0; padding: 0 20px 14px; font-size: .85rem; }
@media (max-width: 860px) { .hol-tiles { padding: 4px 14px 14px; grid-template-columns: 1fr 1fr; } .hol-note { padding: 0 14px 12px; } }

/* Everyone's holiday: stays a small table on phones (name, allowance, left) */
@media (max-width: 720px) {
  .table.hol-table { display: table; }
  .table.hol-table thead { display: table-header-group; }
  .table.hol-table tbody { display: table-row-group; }
  .table.hol-table tr { display: table-row; padding: 0; }
  .table.hol-table td, .table.hol-table th { display: table-cell; width: auto; padding: 10px 12px; border-bottom: 1px solid var(--border); }
  .table.hol-table [data-hide-mobile] { display: none; }
}

/* Reports → Pipeline review */
.pr-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 14px; }
.pr-filters .input { width: auto; min-width: 160px; height: 38px; }
.pr-filters input[type=search] { flex: 1 1 220px; }
.pr-total { margin-left: auto; color: var(--muted); }
.pr-total b { color: var(--heading); }
.pr-move { position: sticky; top: 76px; z-index: 6; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 16px; margin-bottom: 14px; border-color: var(--primary); }
.pr-move [data-pr-count] { font-weight: 800; color: var(--heading); }
.pr-move-opts { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; }
.pr-move .input { width: auto; height: 34px; }
.pr-section { margin-bottom: 16px; }
.pr-section h2 { display: flex; align-items: center; gap: 8px; }
.pr-all input, .pr-pick input { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }
.pr-row { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--border); }
.pr-pick { padding-top: 2px; }
.pr-main { min-width: 0; display: grid; gap: 3px; }
.pr-title a { color: var(--heading); }
.pr-meta { font-size: .85rem; }
.pr-quiet { color: var(--warn); font-weight: 600; }
.pr-latest { font-size: .85rem; font-style: italic; overflow-wrap: anywhere; }
.pr-by { font-style: normal; }
.pr-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; }
.pr-saved { font-size: .85rem; font-weight: 700; color: var(--ok); }
.pr-saved.bad { color: var(--danger); }
.pr-form { display: grid; gap: 8px; margin-top: 8px; padding: 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--card-2); }
.pr-form-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pr-form-row .input { width: auto; }
.pr-side { display: grid; justify-items: end; align-content: start; gap: 2px; text-align: right; }
.pr-amount { font-size: 1.1rem; color: var(--heading); }
.pr-prob { font-size: .8rem; }
.pr-close-lbl { margin: 6px 0 0; font-size: .75rem; }
.pr-close { width: 150px; height: 34px; }
.pr-close.saved { border-color: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
@media (max-width: 720px) {
  .pr-row { grid-template-columns: auto 1fr; padding: 12px 14px; }
  .pr-side { grid-column: 2; justify-items: start; text-align: left; grid-template-columns: auto auto; align-items: center; gap: 4px 10px; }
  .pr-close-lbl { margin: 0; }
  .pr-total { margin-left: 0; width: 100%; }
  .pr-filters .input { flex: 1 1 140px; min-width: 0; }
  .pr-move { top: 64px; }
  .pr-move-opts { margin-left: 0; }
  .pr-section .card-head { flex-wrap: wrap; row-gap: 2px; }
  .pr-section .card-head h2 { flex: 1 1 100%; }
  .pr-sum { font-size: .85rem; }
}

/* Tasks: stage / order / search */
.task-filters { display: flex; flex-wrap: wrap; gap: 8px; max-width: none; flex: 0 1 auto; }
.task-filters select.input { width: auto; min-width: 150px; }
@media (max-width: 720px) { .task-filters { width: 100%; } .task-filters select.input { flex: 1 1 140px; } .task-filters input[type=search] { flex: 1 1 100%; } }

/* ---- Reports → Timesheets ---- */
.ts-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 14px; }
.ts-label { color: var(--heading); font-size: 1.02rem; min-width: 150px; text-align: center; }
.ts-seg { margin: 0; flex-wrap: nowrap; }
.ts-who .input { width: auto; min-width: 200px; height: 34px; }
.ts-stats { margin-bottom: 16px; }
.ts-stats .sub { margin-top: 2px; }
.stat .value.warn { color: var(--warn); }
.ts-card { margin-bottom: 16px; }
.ts-grid { width: 100%; border-collapse: collapse; }
.ts-grid th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 800; border-bottom: 1px solid var(--border); }
.ts-grid td { border-bottom: 1px solid var(--border); vertical-align: middle; }
.ts-grid .strong { font-weight: 700; color: var(--heading); }
.ts-grid .num { text-align: right; font-variant-numeric: tabular-nums; }
.ts-grid th, .ts-grid td { padding: 8px 6px; }
.ts-grid .ts-name { padding-left: 16px; min-width: 150px; white-space: nowrap; position: sticky; left: 0; background: var(--card); z-index: 1; }
.ts-grid tbody tr:hover .ts-name { background: var(--card-2); }
.ts-grid th.ts-day { text-align: center; min-width: 74px; }
.ts-grid th.ts-day span { display: block; font-size: .68rem; }
.ts-grid th.ts-today { color: var(--primary); }
.ts-grid th.num, .ts-grid td.num { padding-right: 14px; white-space: nowrap; }
.ts-grid tfoot td { border-top: 2px solid var(--border); border-bottom: 0; }
.ts-cell { text-align: center; vertical-align: middle; font-variant-numeric: tabular-nums; border-left: 3px solid var(--card); }
.ts-cell b { display: block; font-size: .95rem; color: var(--heading); }
.ts-mini { display: block; font-size: .7rem; font-weight: 700; line-height: 1.25; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 96px; margin: 0 auto; }
.ts-ok { background: var(--ok-soft); }
.ts-ok b { color: var(--ok); }
.ts-short, .ts-part { background: var(--warn-soft); }
.ts-short b { color: var(--warn); }
.ts-missed { background: var(--danger-soft); }
.ts-missed b, .ts-missed .ts-job { color: var(--danger); }
.ts-leave { background: var(--primary-soft); }
.ts-leave .ts-mini { color: var(--primary); }
.ts-extra { background: var(--ok-soft); }
.ts-weekend, .ts-bank, .ts-off { background: var(--card-2); }
.ts-future { background: transparent; }
.ts-month th.ts-day { min-width: 34px; padding: 8px 2px; }
.ts-month .ts-cell { padding: 8px 2px; border-left-width: 1px; }
.ts-month .ts-cell b { font-size: .8rem; }
.ts-under { color: var(--danger) !important; }
.ts-over { color: var(--ok) !important; }
.ts-tag { display: inline-block; font-size: .7rem; font-weight: 800; border-radius: 99px; padding: 0 7px; margin-top: 2px; }
.ts-tag.missed { background: var(--danger-soft); color: var(--danger); }
.ts-tag.short { background: var(--warn-soft); color: var(--warn); }
.ts-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 12px 16px; border-top: 1px solid var(--border); font-size: .8rem; }
.ts-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ts-legend span:last-child { margin-left: auto; }
.ts-key { width: 12px; height: 12px; border-radius: 3px; display: inline-block; border: 1px solid color-mix(in srgb, var(--text) 18%, transparent); }
.ts-miss { display: grid; grid-template-columns: 110px 170px 250px 1fr; gap: 6px 12px; align-items: center; padding: 10px 20px; border-top: 1px solid var(--border); }
.ts-miss-what { display: flex; flex-wrap: wrap; gap: 6px; }
.ts-miss-jobs { font-size: .9rem; }
.card-head + .ts-miss { border-top: 0; }
.ts-entries .nowrap, .nowrap { white-space: nowrap; }
@media (max-width: 720px) {
  .ts-label { min-width: 0; flex: 1; }
  .ts-who { width: 100%; } .ts-who .input { width: 100%; }
  .ts-legend span:last-child { margin-left: 0; }
  .ts-miss { grid-template-columns: auto 1fr; padding: 10px 14px; }
  .ts-grid .ts-name { min-width: 120px; padding-left: 12px; white-space: normal; }
  .ts-grid th.ts-day { min-width: 58px; }
  .ts-card .card-head { flex-wrap: wrap; } .ts-card .card-head > .muted { font-size: .8rem; }
  .ts-miss-what, .ts-miss-jobs { grid-column: 1 / -1; }
}

/* Bank holidays in the calendar: the day is shaded and named, so it isn't booked by mistake (booking still works, after a check) */
.cal-col.bank, .cal-allday-cell.bank, .cal-mday.bank {
  background-image: repeating-linear-gradient(135deg, color-mix(in srgb, var(--warn) 9%, transparent) 0 6px, transparent 6px 12px);
}
.cal-dayhead.bank span, .cal-dayhead.bank b { color: var(--warn); }
.cal-bank { font-size: .72rem; font-weight: 800; color: var(--warn); background: var(--warn-soft); border-radius: 6px; padding: 2px 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: default; }
.cal-mday .cal-bank { margin: 0 0 2px; }

/* The test copy (VOLTA_TEST_COPY=true): a strip across the top so nobody mistakes it for the live system */
.test-copy-banner { position: sticky; top: 0; z-index: 1000; background: #d97706; color: #fff; text-align: center; font-weight: 800;
  font-size: .8rem; padding: calc(4px + env(safe-area-inset-top)) 12px 4px; letter-spacing: .02em; }

/* Task rows: the linked record is a link, the latest note shows, and a quick edit opens in place */
.task .meta a.task-rel { color: inherit; text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 2px; }
.task .meta a.task-rel:hover { color: var(--primary); }
.task-note { font-size: .84rem; color: var(--muted); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.task-quick { margin-top: 4px; }
.task-quick > summary { list-style: none; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; font-size: .78rem; font-weight: 700; color: var(--muted); }
.task-quick > summary::-webkit-details-marker { display: none; }
.task-quick > summary .i { width: 14px; height: 14px; }
.task-quick[open] > summary { color: var(--primary); }
.task-quick-form { display: grid; grid-template-columns: minmax(0, 2fr) 150px minmax(0, 1fr) auto; gap: 6px; margin-top: 6px; align-items: center; }
@media (max-width: 720px) { .task-quick-form { grid-template-columns: 1fr 1fr; } .task-quick-form input[name=subject] { grid-column: 1 / -1; } }
.snooze { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.task-snooze { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: .8rem; }
.renewal-card { margin-bottom: 16px; border-left: 4px solid var(--ok); }
.home-more { display: block; padding: 10px 18px; font-size: .85rem; font-weight: 700; border-top: 1px solid var(--border); }
.gsearch-results a.hit .p { font-size: .78rem; color: var(--primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gsearch-results a.hit .k { font-size: .7rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-left: 4px; }
.peek { color: var(--primary); }

/* Proposal editor with the live preview beside it (wide screens) */
.proposal-edit.live-on { max-width: none !important; }
.proposal-edit.live-on .live-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.live-pane { position: sticky; top: 12px; overflow: hidden; }
.live-pane iframe { width: 100%; height: calc(100vh - 120px); border: 0; display: block; background: #fff; }
[data-live-toggle].on { color: var(--primary); }
.note-edited { font-size: .78rem; margin: 6px 0 0; }
.tl-edit { float: right; display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; font-weight: 700; color: var(--muted); } .tl-edit .i { width: 14px; height: 14px; } .tl-edit:hover { color: var(--primary); }

/* Several people's calendars at once: stronger colour per person so they're easy to tell apart */
.cal.several .cal-ev, .cal.several .cal-chip { background: color-mix(in srgb, var(--ev) 30%, var(--card)); border-left-width: 5px; }

/* Long record names (opportunities, projects): up to two lines in the top bar, a little smaller, instead of being cut off */
.topbar h1.long { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.2; font-size: 1.15rem; overflow-wrap: anywhere; }
.topbar h1.very-long { font-size: 1rem; }
@media (max-width: 860px) { .topbar h1.long { font-size: 1.05rem; } .topbar h1.very-long { font-size: .95rem; -webkit-line-clamp: 3; } }
.callout.easycompli-flag { align-items: center; gap: 10px; margin-bottom: 14px; background: var(--warn-soft, #FFF4DB); color: var(--text); border: 1px solid color-mix(in srgb, var(--warn, #E8A200) 45%, transparent); border-left: 5px solid var(--warn, #E8A200); }
.callout.easycompli-flag .i { color: var(--warn, #E8A200); flex: none; }
.title-badge { flex: none; text-decoration: none; white-space: nowrap; }
.easycompli-note { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 10px 20px 0; padding: 8px 12px; border-radius: 10px; font-size: 13px; background: var(--warn-soft, #FFF4DB); border: 1px solid color-mix(in srgb, var(--warn, #E8A200) 40%, transparent); }

/* Email To/Cc: suggestions as you type, and one-click Cc chips */
.email-suggest { position: absolute; z-index: 30; margin-top: 4px; min-width: min(420px, 100%); max-width: 100%; background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.15); overflow: hidden; }
.email-suggest button { display: grid; grid-template-columns: auto 1fr; gap: 0 8px; width: 100%; text-align: left; padding: 8px 12px; border: 0; background: none; cursor: pointer; color: var(--text); }
.email-suggest button span { color: var(--muted); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.email-suggest button small { grid-column: 1 / -1; color: var(--muted); font-size: .75rem; }
.email-suggest button.on, .email-suggest button:hover { background: var(--primary-soft); }
.email-form .full { position: relative; }
.cc-people { margin-top: 6px; }
.pchip { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 999px; background: var(--card); font-size: 12.5px; overflow: hidden; }
.pchip-name { padding: 4px 6px 4px 10px; color: var(--text); white-space: nowrap; }
.pchip button { border: 0; border-left: 1px solid var(--border); background: transparent; color: var(--muted); font: inherit; font-weight: 700; font-size: 11px; padding: 5px 8px; cursor: pointer; }
.pchip button:hover { background: var(--primary-soft); color: var(--primary); }
.pchip button.on { background: var(--primary); color: #fff; }
.pchip.chip-team .pchip-name { color: var(--muted); }
.upload-status { font-size: .8rem; margin-right: 8px; }

/* Calendar people list: each person's colour (click the dot to change it) */
.cal-who-row { display: flex; align-items: center; gap: 6px; }
.cal-who-row .choice { flex: 1; min-width: 0; }
.cal-swatch { position: relative; width: 18px; height: 18px; border-radius: 50%; flex: none; cursor: pointer; box-shadow: 0 0 0 2px var(--card), 0 0 0 3px var(--border); }
.cal-swatch input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; border: 0; padding: 0; }
.cal-who-hint { font-size: 12px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }

/* Campaign page: how far people got */
.camp-steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.camp-step { display: flex; flex-direction: column; gap: 4px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; color: var(--text); text-decoration: none; }
.camp-step:hover, .camp-step.on { border-color: var(--primary); text-decoration: none; }
.camp-step-n { font-size: 1.5rem; font-weight: 800; color: var(--heading); line-height: 1.1; }
.camp-step-l { font-weight: 700; }
.camp-step-bar { height: 6px; border-radius: 3px; background: var(--card-2); overflow: hidden; }
.camp-step-bar i { display: block; height: 100%; background: var(--primary); border-radius: 3px; }
@media (max-width: 760px) { .camp-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Reason to call (lead page) */
.call-brief .cb-summary { margin: 0 0 8px; font-weight: 600; color: var(--heading); }
.cb-reasons { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 10px; }
.cb-reasons li > div { margin-top: 2px; }
.cb-part { border-top: 1px solid var(--border); padding: 8px 0; }
.cb-part summary { cursor: pointer; font-weight: 700; display: flex; align-items: center; gap: 8px; list-style: none; }
.cb-part summary::-webkit-details-marker { display: none; }
.cb-part summary::before { content: '▸'; color: var(--muted); }
.cb-part[open] summary::before { content: '▾'; }
.cb-part summary .btn { margin-left: auto; }
.cb-part p, .cb-part ul { margin: 8px 0 0; }
.cb-label { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: -4px !important; }
.cb-stat { margin: 10px 0 0; padding: 8px 12px; border-radius: 10px; background: var(--card-2); font-size: 13px; }
.cb-cautions { margin-top: 10px; padding: 8px 12px; border-radius: 10px; font-size: 13px; background: var(--warn-soft, #FFF4DB); }
.cb-cautions ul { margin: 4px 0 0; padding-left: 18px; }
.cb-foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 12px; padding-top: 8px; border-top: 1px solid var(--border); }
.cb-links { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 10px; }
.cb-wait { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.cb-spin { width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--primary); animation: cbspin 0.9s linear infinite; flex: none; }
@keyframes cbspin { to { transform: rotate(360deg); } }

/* Find new businesses (Companies House) */
.fb-group { margin-bottom: 16px; }
.fb-label { font-weight: 800; color: var(--heading); font-size: .85rem; margin-bottom: 6px; }
.fb-picks { display: flex; flex-wrap: wrap; gap: 6px; }
.fb-pick { display: inline-flex; align-items: center; border: 1px solid var(--border-strong); background: var(--card); color: var(--text); border-radius: 99px; padding: 5px 11px; font: 700 .82rem var(--font); cursor: pointer; }
.fb-pick input { position: absolute; opacity: 0; pointer-events: none; }
.fb-pick:hover { border-color: var(--primary); }
.fb-pick:has(input:checked) { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.fb-pick:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.fb-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 12px 20px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--card); z-index: 2; }
.fb-figs { min-width: 170px; }
.fb-figs .badge { margin-left: 4px; }

/* Voltaforce health (super admin) */
.health-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.health-tile { display: flex; align-items: center; gap: 14px; }
.ht-big { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font: 800 1.2rem var(--font); flex: none; }
.health-tile.ok .ht-big { background: var(--ok-soft); color: var(--ok); }
.health-tile.warn .ht-big { background: var(--warn-soft); color: var(--warn); }
.health-tile.bad .ht-big { background: var(--danger-soft); color: var(--danger); }

/* Reports → Won & commission: editable rate / paid */
.won-edit.input { width: auto; min-width: 74px; height: 32px; padding: 2px 8px; }
.won-paid { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
tr.won-saved td { background: var(--ok-soft); transition: background .3s; }
tr.won-failed td { background: var(--danger-soft); }
.won-gbp { display: inline-flex; align-items: center; gap: 3px; }
.won-amount.input { min-width: 0; width: 96px; text-align: right; }
.won-amount::placeholder { color: var(--muted); opacity: .8; }
