/* The interface fonts live on this site, so a visitor's browser never contacts Google. */
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
  src: url('fonts/dm-sans-latin-opsz-normal.woff2') format('woff2');
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
  src: url('fonts/dm-sans-latin-ext-opsz-normal.woff2') format('woff2');
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('fonts/manrope-latin-wght-normal.woff2') format('woff2');
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('fonts/manrope-latin-ext-wght-normal.woff2') format('woff2');
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Grand Vision HQ — one stylesheet. Same film-room neutrals as Grand Vision Review, with the
   HQ logo's Brand Red (#E42121) as the single accent. Layout: sidebar + scrolling main column. */

:root {
  --bg: #0f1013;
  --surface: #16171c;
  --surface-2: #1d1e25;
  --surface-3: #262832;
  --line: #2a2c35;
  --line-2: #3a3c48;
  --text: #ecedf2;
  --muted: #a3a5b4;
  --dim: #767888;
  --red: #e42121;
  --red-hi: #f62928;
  --red-deep: #84070c;
  --red-soft: #3a1b1f;
  --ok: #4cc38a;
  --ok-soft: #13291f;
  --warn: #f2b14a;
  --warn-soft: #2f2412;
  --info: #79a8ff;
  --info-soft: #172338;
  --violet: #b59cff;
  --violet-soft: #241d38;
  --radius: 10px;
  --display: 'Manrope', 'DM Sans', system-ui, sans-serif;
  --body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: dark;
  font-family: var(--body);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
}
[hidden] {
  display: none !important;
}
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
  margin: 0;
  background: var(--bg);
}
a {
  color: var(--red-hi);
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
h1,
h2,
h3 {
  font-family: var(--display);
  margin: 0;
  letter-spacing: -0.01em;
}
h1 {
  font-size: 24px;
  font-weight: 700;
}
h2 {
  font-size: 17px;
  font-weight: 700;
}
h3 {
  font-size: 14px;
  font-weight: 700;
}
.muted {
  color: var(--muted);
}
.dim {
  color: var(--dim);
}
.small {
  font-size: 12px;
}
.booting {
  padding: 40px;
  color: var(--muted);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* Shell */
.shell {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: 236px;
  flex: none;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 18px 12px 12px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 22px;
  text-decoration: none;
  color: var(--text);
}
.brand img {
  width: 32px;
  height: 34px;
}
.brand span {
  font-family: var(--display);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.15;
}
.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  flex: 1;
}
.nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  min-height: 40px;
}
.nav a:hover {
  background: var(--surface-2);
  color: var(--text);
}
.nav a[aria-current='page'] {
  background: var(--red-soft);
  color: #ff8a8d;
  font-weight: 600;
}
.nav .group {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
  padding: 16px 12px 6px;
}
.nav .soon {
  font-size: 10px;
  color: var(--dim);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 1px 6px;
}
.nav .count,
.bell .count {
  background: var(--red);
  color: #fff;
  border-radius: 999px;
  font-size: 11px;
  min-width: 20px;
  text-align: center;
  padding: 1px 6px;
}
.me {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  border-top: 1px solid var(--line);
  margin-top: 8px;
}
.me .who {
  flex: 1;
  min-width: 0;
  font-size: 13px;
}
.me .who b {
  display: block;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* "Online now" in the side panel (our team only) and my status button. */
.online-strip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
  margin-top: 8px;
  padding: 10px 8px 4px;
  border: 0;
  border-top: 1px solid var(--line);
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.online-strip .label {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dim);
}
.online-strip .faces {
  display: flex;
  align-items: center;
  min-height: 26px;
}
.online-strip .faces .avatar {
  margin-right: 4px;
}
.online-strip .more {
  margin-left: 6px;
  font-size: 12px;
  color: var(--muted);
}
.online-strip:hover .label,
.online-strip:focus-visible .label {
  color: var(--text);
}
.me-status {
  border: 0;
  padding: 0;
  background: none;
  border-radius: 50%;
  cursor: pointer;
}
.me-status:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}
.online-list .online-row {
  gap: 10px;
}
.status-choice {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.status-choice b {
  display: block;
  font-weight: 600;
}
.status-choice.on {
  border-color: var(--red);
  background: var(--red-soft);
}
.status-choice .dot {
  width: 12px;
  height: 12px;
  flex: none;
}
.powered {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 8px 2px;
  font-size: 11px;
  color: var(--dim);
  text-decoration: none;
  white-space: nowrap;
}
.powered img {
  height: 26px;
  opacity: 0.9;
}
.powered:hover img {
  opacity: 1;
}
main.page {
  flex: 1;
  min-width: 0;
  padding: 28px 32px 48px;
}
.page-head {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

/* Building blocks */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.row {
  display: flex;
  gap: 12px;
  align-items: center;
}
.grow {
  flex: 1;
  min-width: 0;
}
.btn {
  height: 40px;
  padding: 0 16px;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
a.btn {
  color: var(--text);
  text-decoration: none;
}
.btn:hover {
  border-color: var(--dim);
}
.btn.primary {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  font-weight: 600;
}
.btn.primary:hover {
  background: var(--red-hi);
}
.btn.ghost {
  background: transparent;
}
.btn.small {
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
}
.btn:disabled {
  opacity: 0.5;
  cursor: default;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}
.field input,
.field select,
.field textarea,
.doc-field input:not([type='checkbox']),
.hours-row input,
input.input {
  height: 40px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--text);
  font-size: 14px;
}
.field textarea {
  height: auto;
  min-height: 90px;
  padding: 10px 12px;
  resize: vertical;
}
.field input:focus,
.field select:focus,
.field textarea:focus,
input.input:focus,
.composer textarea:focus {
  outline: 2px solid var(--red);
  outline-offset: -1px;
  border-color: transparent;
}
.check {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 14px;
  color: var(--text);
  min-height: 36px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.form-grid .wide {
  grid-column: 1 / -1;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--muted);
}
.pill.info {
  background: var(--info-soft);
  color: var(--info);
}
.pill.ok {
  background: var(--ok-soft);
  color: var(--ok);
}
.pill.warn {
  background: var(--warn-soft);
  color: var(--warn);
}
.pill.red {
  background: var(--red-soft);
  color: #ff8a8d;
}
.empty {
  padding: 28px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line-2);
  border-radius: 12px;
}

/* Avatars: photo or initials, with a small round badge of the person's company logo. */
.avatar {
  position: relative;
  flex: none;
  display: inline-block;
}
.avatar .face {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #fff;
  background: var(--surface-3);
}
.avatar .face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.avatar .badge {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 46%;
  height: 46%;
  min-width: 14px;
  min-height: 14px;
  border-radius: 50%;
  border: 2px solid var(--surface);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 700;
  color: #fff;
  background: #fff;
}
.avatar .badge img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.avatar .badge.initials {
  font-size: 7px;
}
/* Online status dot, bottom-left of the photo (the company badge is bottom-right). */
.avatar .dot,
.dot {
  display: inline-block;
  width: 30%;
  height: 30%;
  min-width: 9px;
  min-height: 9px;
  max-width: 13px;
  max-height: 13px;
  border-radius: 50%;
  background: var(--dim);
  box-sizing: border-box;
}
.avatar .dot {
  position: absolute;
  left: -2px;
  bottom: -2px;
  border: 2px solid var(--surface);
}
.dot.online {
  background: var(--ok);
}
.dot.away {
  background: var(--warn);
}
.dot.busy {
  background: var(--surface);
  box-shadow: inset 0 0 0 2.5px var(--red);
}
.dot.offline {
  background: var(--line-2);
}
/* Admins only: someone is really online behind Away, Busy or Appear offline. */
.dot.really-online {
  background-image: radial-gradient(circle, var(--ok) 0 32%, transparent 36%);
}
.logo-tile {
  flex: none;
  border-radius: 22%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  background: var(--surface-3);
}
.logo-tile img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
  padding: 12%;
}

/* Clients */
.split {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.list a {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  border: 1px solid transparent;
}
.list a:hover {
  background: var(--surface-2);
}
.list a[aria-current='true'] {
  background: var(--surface-2);
  border-color: #3a2326;
}
.profile-head {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
}
.logo-edit {
  position: relative;
}
.logo-edit .btn {
  position: absolute;
  right: -12px;
  bottom: -10px;
}
.dropzone {
  border: 1px dashed var(--line-2);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
}
.dropzone.over {
  border-color: var(--red);
  background: var(--red-soft);
}
.person-row {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
}
.facts div span {
  display: block;
  font-size: 12px;
  color: var(--dim);
  margin-bottom: 2px;
}

/* Chats */
.chat-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 250px;
  gap: 16px;
  align-items: start;
}
.chat-layout.no-members {
  grid-template-columns: 300px minmax(0, 1fr);
}
.conv-list a {
  padding: 10px;
}
.conv-list .preview {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.thread {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 76px);
  min-height: 420px;
  padding: 0;
}
.thread header {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.msg {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.msg .meta {
  font-size: 13px;
}
.msg .meta b {
  font-weight: 600;
}
.msg .body {
  margin-top: 3px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #d4d6db;
}
.msg.mentions-me {
  margin: -6px -10px;
  padding: 6px 10px;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--red-soft), transparent 75%);
  box-shadow: inset 3px 0 0 var(--red);
}
.msg .meta .pill {
  margin-left: 8px;
  vertical-align: 1px;
}
.mention {
  border-radius: 5px;
  padding: 0 4px;
  font-weight: 600;
  background: color-mix(in srgb, var(--red) 14%, transparent);
  color: #ff9a9a;
}
.mention.mine {
  background: var(--red);
  color: #fff;
}
.composer {
  position: relative;
}
.mention-pop {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: calc(100% - 6px);
  max-width: 420px;
  max-height: 320px;
  overflow-y: auto;
  z-index: 20;
  padding: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}
.mention-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
}
.mention-item .grow {
  min-width: 0;
}
.mention-item b {
  display: block;
  font-weight: 600;
  font-size: 13px;
}
.mention-item.sel,
.mention-item:hover {
  background: var(--surface-3);
}
.mention-all {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  background: var(--red-soft);
  color: #ff9a9a;
}
.mention-sep {
  margin-top: 4px;
  padding: 6px 8px 2px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dim);
}
.mention-ask {
  padding: 8px;
  display: grid;
  gap: 10px;
  font-size: 13px;
}
.mention-ask p {
  margin: 0;
}
.mention-ask .row {
  flex-wrap: wrap;
  gap: 8px;
}
.msg.event {
  font-size: 12px;
  color: var(--dim);
  justify-content: center;
}
.day {
  text-align: center;
  font-size: 11px;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.composer {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  align-items: flex-end;
}
.composer textarea {
  flex: 1;
  min-height: 44px;
  max-height: 160px;
  resize: none;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  color: var(--text);
}
.members .group {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
  margin: 14px 0 8px;
}
.members .group:first-of-type {
  margin-top: 4px;
}
.picker {
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 8px 0;
}
.picker label {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
}
.picker label:hover {
  background: var(--surface-2);
}

/* Sign in */
.auth {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth .card {
  width: min(420px, 100%);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.auth .logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.auth .logo img {
  width: 84px;
}
.auth .logo h1 {
  font-size: 26px;
}
.auth .error {
  color: #ff8a8d;
  font-size: 13px;
  min-height: 18px;
}
.auth .powered {
  justify-content: center;
}

/* Dialogs and toast */
dialog#modal {
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  padding: 22px;
  width: min(560px, calc(100vw - 32px));
}
dialog#modal:has(.gear-dialog) {
  width: min(680px, calc(100vw - 32px));
}
dialog#modal::backdrop {
  background: rgba(0, 0, 0, 0.6);
}
dialog .actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}
#toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--surface-3);
  border: 1px solid var(--line-2);
  padding: 10px 16px;
  border-radius: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
#toast.show {
  opacity: 1;
}
#toast.error {
  border-color: var(--red);
}

/* Projects and tasks */
.code {
  font-family: var(--display);
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.late {
  color: #ff8a8d;
}
.back {
  display: inline-block;
  color: var(--muted);
  margin-bottom: 10px;
}
.section-head {
  margin-bottom: 12px;
}
h2.section-head {
  margin-bottom: 12px;
}
button.link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  text-align: left;
}
button.link:hover {
  color: var(--red-hi);
}
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.tabs a {
  padding: 8px 12px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tabs a[aria-current='true'] {
  color: var(--text);
  border-color: var(--red);
}
.pill.stage {
  background: color-mix(in srgb, var(--stage) 18%, transparent);
  color: var(--stage);
}
.project-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.project-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px 12px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  position: relative;
  overflow: hidden;
}
.project-row::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: var(--stage);
}
.project-row,
.project-row:hover {
  text-decoration: none;
}
.project-row:hover {
  border-color: var(--line-2);
  background: var(--surface-2);
}
.project-row .due-col {
  min-width: 110px;
  text-align: right;
}
.logo-tile.blank {
  background: var(--surface-3);
}
.stage-strip {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 18px;
}
.stage-strip button {
  padding: 9px 6px;
  border: 0;
  border-radius: 6px;
  font-size: 12px;
  background: var(--surface-2);
  color: var(--dim);
  border-top: 3px solid var(--surface-3);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stage-strip button.reached {
  color: var(--muted);
  border-top-color: var(--stage);
}
.stage-strip button[aria-pressed='true'] {
  background: color-mix(in srgb, var(--stage) 22%, var(--surface));
  color: var(--text);
  font-weight: 600;
}
.stage-strip button:disabled {
  cursor: default;
}
.stage-strip button:not(:disabled):hover {
  color: var(--text);
}
.project-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: start;
}
.description {
  white-space: pre-wrap;
  color: var(--muted);
  margin: 16px 0 0;
  line-height: 1.55;
}
.task-list {
  display: flex;
  flex-direction: column;
}
.task {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 2px;
  border-bottom: 1px solid var(--line);
}
.task:last-child {
  border-bottom: 0;
}
.task .tick input {
  width: 18px;
  height: 18px;
  accent-color: var(--red);
  cursor: pointer;
}
.task .meta {
  display: flex;
  gap: 10px;
  margin-top: 2px;
}
.task.done .grow > :first-child {
  text-decoration: line-through;
  color: var(--dim);
}
.task .due {
  min-width: 74px;
  text-align: right;
  color: var(--muted);
}
.task .due.late {
  color: #ff8a8d;
  font-weight: 600;
}
.avatar-gap {
  width: 26px;
  flex: none;
}
.task-group {
  margin-top: 14px;
}
.task-group h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 2px;
}
.task-group h3.late {
  color: #ff8a8d;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table th {
  text-align: left;
  font-weight: 500;
  color: var(--dim);
  font-size: 12px;
  padding: 0 8px 8px 0;
  border-bottom: 1px solid var(--line);
}
.table td {
  padding: 9px 8px 9px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.table tr:last-child td {
  border-bottom: 0;
}
.status-select {
  background: var(--surface-3);
  color: var(--muted);
  border: 0;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
}
.status-select.info {
  background: var(--info-soft);
  color: var(--info);
}
.status-select.warn {
  background: var(--warn-soft);
  color: var(--warn);
}
.status-select.ok {
  background: var(--ok-soft);
  color: var(--ok);
}
.link-row a {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.day-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  align-items: start;
}
.day-grid input.input {
  width: 100%;
}
.note-input {
  width: 100%;
  resize: vertical;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  color: var(--text);
  padding: 10px;
  font: inherit;
}
.note-input:focus {
  outline: none;
  border-color: var(--red);
}
.notes {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}
.note {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px 6px;
}
.note.pinned {
  border-color: color-mix(in srgb, var(--warn) 45%, transparent);
  background: color-mix(in srgb, var(--warn) 7%, var(--surface-2));
}
.note p {
  margin: 0 0 4px;
  white-space: pre-wrap;
  line-height: 1.5;
}

/* Calendar and crew */
.cal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.tabs.inline {
  margin: 0;
  border: 0;
}
.cal-title {
  font-family: var(--display);
  font-size: 16px;
  margin-left: 8px;
  min-width: 150px;
}
.cal-month {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--line);
  gap: 1px;
}
.cal-head {
  background: var(--surface);
  padding: 8px 10px;
  font-size: 12px;
  color: var(--dim);
}
.cal-day {
  background: var(--surface);
  min-height: 112px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.cal-day.other {
  background: #131418;
}
.cal-day.other .num {
  color: var(--dim);
}
.cal-day .num {
  font-size: 12px;
  color: var(--muted);
  padding: 2px 4px;
  align-self: flex-start;
  border-radius: 999px;
}
.cal-day.today .num {
  background: var(--red);
  color: #fff;
  font-weight: 700;
}
.chip,
.more {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: 5px;
  padding: 3px 6px;
  font-size: 11.5px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: var(--surface-3);
  color: var(--text);
  font-family: inherit;
}
.chip.high {
  background: color-mix(in srgb, var(--red) 30%, var(--surface));
  border-left: 3px solid var(--red);
}
.chip.medium {
  background: color-mix(in srgb, var(--warn) 22%, var(--surface));
  border-left: 3px solid var(--warn);
}
.chip.low {
  background: color-mix(in srgb, var(--info) 18%, var(--surface));
  border-left: 3px dashed var(--info);
}
.chip.away {
  background: repeating-linear-gradient(135deg, var(--surface-3) 0 6px, var(--surface-2) 6px 12px);
  color: var(--muted);
}
.chip.project {
  background: transparent;
  color: var(--stage);
  border: 1px solid color-mix(in srgb, var(--stage) 55%, transparent);
}
.chip.deliverable {
  background: var(--violet-soft);
  color: var(--violet);
}
.chip.task {
  background: transparent;
  color: var(--muted);
  border: 1px dashed var(--line-2);
}
.more {
  background: none;
  color: var(--muted);
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  color: var(--muted);
  margin-top: 12px;
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.chip-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
}
.chip-dot.high {
  background: var(--red);
}
.chip-dot.medium {
  background: var(--warn);
}
.chip-dot.low {
  background: var(--info);
}
.chip-dot.away {
  background: repeating-linear-gradient(135deg, var(--line-2) 0 3px, var(--surface-2) 3px 6px);
}
.chip-dot.deliverable {
  background: var(--violet);
}
.chip-dot.task {
  border: 1px dashed var(--muted);
}
.crew-card {
  overflow-x: auto;
}
.crew-grid {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 900px;
}
.crew-row {
  display: grid;
  grid-template-columns: 210px repeat(21, minmax(26px, 1fr));
  gap: 3px;
  align-items: center;
}
.crew-name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  padding-right: 8px;
  position: sticky;
  left: 0;
  background: var(--surface);
  z-index: 1;
  min-height: 36px;
}
.crew-head .crew-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 11px;
  padding: 4px 0;
  border-radius: 6px;
}
.crew-day.weekend {
  opacity: 0.6;
}
.crew-day.today {
  background: var(--red-soft);
  color: #fff;
}
.crew-cell {
  height: 30px;
  border: 0;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 800;
  color: #fff;
  font-size: 13px;
}
.crew-cell.free {
  background: var(--surface-2);
}
.crew-cell.free.weekend {
  background: #1a1b20;
}
.crew-cell.free:hover {
  background: var(--surface-3);
  outline: 1px dashed var(--line-2);
}
.crew-cell.high {
  background: var(--red);
}
.crew-cell.medium {
  background: var(--warn);
  color: #2b1d05;
}
.crew-cell.low {
  background: color-mix(in srgb, var(--info) 45%, var(--surface));
}
.crew-cell.away {
  background: repeating-linear-gradient(135deg, var(--line-2) 0 5px, var(--surface-3) 5px 10px);
}
.crew-cell.clash {
  box-shadow: inset 0 0 0 2px #fff;
}
.row > input.input {
  flex: 1;
  min-width: 0;
}
ul.steps {
  margin: 0;
  padding-left: 18px;
  line-height: 1.8;
  color: var(--muted);
}
.ok-text {
  color: var(--ok);
}
.warn-text {
  color: var(--warn);
}

/* Gear */
.gear-search {
  margin-bottom: 14px;
  gap: 12px;
}
.gear-search .grow {
  max-width: 420px;
}
.gear-search .grow input {
  width: 100%;
}
.gear-search .tabs {
  margin-left: auto;
}
.cal-bar input.input {
  width: auto;
}
.gear-list {
  display: flex;
  flex-direction: column;
}
.gear-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.gear-row:last-child {
  border-bottom: 0;
}
.gear-photo {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  flex: none;
  background: var(--surface-3);
}
.gear-photo.blank {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-weight: 700;
}
.gear-photo.big {
  width: 160px;
  height: 120px;
  border-radius: 10px;
  font-size: 44px;
}
.gear-photo.blank {
  font-size: 24px;
}
.thumb-btn {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  border-radius: 8px;
}
.gear-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.gear-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  min-width: 0;
}
.gear-tile:hover {
  border-color: var(--line-2);
}
.gear-tile b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.gear-photo.tile-photo {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  font-size: 40px;
  margin-bottom: 4px;
}
.gear-status {
  min-width: 170px;
  text-align: right;
}
.out-card {
  border-color: color-mix(in srgb, var(--warn) 40%, var(--line));
  margin-bottom: 16px;
}
.res-row {
  flex-wrap: wrap;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.res-row:last-child {
  border-bottom: 0;
}
h3.sub {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 16px 0 8px;
}

/* Finance */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.tile {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
}
a.tile:hover {
  border-color: var(--line-2);
}
.tile b {
  font-family: var(--display);
  font-size: 24px;
}
.tile.red {
  border-color: color-mix(in srgb, var(--red) 50%, var(--line));
}
.tile.red b {
  color: #ff8a8d;
}
.tile.warn b {
  color: var(--warn);
}
.tile.ok b {
  color: var(--ok);
}
.bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 180px;
  padding-top: 8px;
}
.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  min-width: 0;
}
.bar-pair {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
}
.bar {
  width: 40%;
  max-width: 18px;
  border-radius: 4px 4px 0 0;
  min-height: 2px;
}
.bar.in {
  background: var(--ok);
}
.bar.out {
  background: var(--red);
}
.chip-dot.ok-dot {
  background: var(--ok);
}
.meter {
  height: 6px;
  background: var(--surface-3);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 4px;
}
.meter span {
  display: block;
  height: 100%;
  background: var(--red);
  border-radius: 999px;
}
.table th.num,
.table td.num {
  text-align: right;
  white-space: nowrap;
}
.table tr.clickable {
  cursor: pointer;
}
.table tr.clickable:hover td {
  background: var(--surface-2);
}
.chips-row {
  gap: 6px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.fx-box {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
}
.usd-preview {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 110px;
}
.usd-preview b {
  font-family: var(--display);
  font-size: 20px;
}
dialog#modal:has(.payment-form) {
  width: min(680px, calc(100vw - 32px));
}
.money-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 16px;
}
.money-grid > div > span:first-child {
  display: block;
  font-size: 12px;
  color: var(--dim);
}
.money-grid b {
  font-family: var(--display);
  font-size: 17px;
}

/* Quotes and invoices */
.notice {
  background: var(--warn-soft);
  color: var(--warn);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  margin-bottom: 14px;
}
.doc-totals .row {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 5px 0;
  font-variant-numeric: tabular-nums;
}
.doc-totals .row.big {
  border-top: 1px solid var(--line);
  margin-top: 4px;
  padding-top: 10px;
  font-size: 17px;
}
.doc-totals .row.internal {
  border-top: 1px dashed var(--line-2);
  margin-top: 8px;
  padding-top: 10px;
  font-size: 13px;
}
.lines-table td {
  vertical-align: top;
}
.lines-table input,
.lines-table textarea,
.rate-table input {
  width: 100%;
  min-width: 0;
  padding: 7px 9px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  font: inherit;
  font-size: 13px;
}
.lines-table input:focus,
.lines-table textarea:focus,
.rate-table input:focus {
  outline: 2px solid var(--red);
  outline-offset: -1px;
  border-color: transparent;
}
.lines-table :disabled,
.rate-table :disabled {
  background: transparent;
  border-color: transparent;
  resize: none;
}
.lines-table td:nth-child(1) {
  width: 15%;
}
.lines-table td:nth-child(3) {
  width: 70px;
}
.lines-table td:nth-child(4),
.lines-table td:nth-child(5) {
  width: 100px;
}
.lines-table textarea {
  resize: vertical;
}
.rate-table td:nth-child(n + 3):nth-child(-n + 7) input {
  width: 90px;
}
.split.even {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.card .table {
  width: 100%;
}
.table-scroll {
  overflow-x: auto;
}

/* Analytics. Two series colours, checked for colour-blind separation on the dark surface:
   A (revenue, single series) blue, B (costs) orange. */
:root {
  --viz-a: #5a8eec;
  --viz-b: #d96d41;
}
.red-text {
  color: #ff8a8d;
}
.ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.preset-row {
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  align-items: center;
}
.chip-btn {
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.chip-btn:hover {
  color: var(--text);
}
.chip-btn[aria-pressed='true'] {
  background: var(--surface-3);
  color: var(--text);
  border-color: var(--line-2);
}
.viz-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.viz-card.wide {
  grid-column: 1 / -1;
}
.viz-sub {
  margin: -6px 0 10px;
}
.viz-box {
  position: relative;
}
.viz {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.viz-grid-line {
  stroke: var(--line);
  stroke-width: 1;
}
.viz-zero {
  stroke: var(--line-2);
  stroke-width: 1;
}
.viz-axis {
  fill: var(--dim);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.viz-a {
  fill: var(--viz-a);
}
.viz-b {
  fill: var(--viz-b);
}
.viz-hit {
  fill: transparent;
}
.viz-hit-group:hover .viz-hit {
  fill: color-mix(in srgb, var(--text) 5%, transparent);
}
.viz-line {
  fill: none;
  stroke: var(--viz-a);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.viz-area {
  fill: color-mix(in srgb, var(--viz-a) 14%, transparent);
}
.viz-dot {
  fill: var(--viz-a);
  stroke: var(--surface);
  stroke-width: 2;
  pointer-events: none;
}
.viz-cross {
  stroke: var(--line-2);
  stroke-width: 1;
  pointer-events: none;
}
.viz-tip {
  position: absolute;
  pointer-events: none;
  background: var(--surface-3);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  min-width: 150px;
  box-shadow: 0 6px 20px rgb(0 0 0 / 0.35);
  z-index: 2;
}
.tip-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}
.tip-row b {
  margin-left: auto;
  padding-left: 12px;
  font-variant-numeric: tabular-nums;
}
.key {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
}
.key.a {
  background: var(--viz-a);
}
.key.b {
  background: var(--viz-b);
}
.viz-legend {
  margin: 0 0 8px;
}
.viz-headline {
  font-family: var(--display);
  font-size: 22px;
  margin: 0 0 6px;
}
.viz-table {
  margin-top: 10px;
}
.viz-table summary {
  cursor: pointer;
  color: var(--muted);
}
.viz-table table {
  margin-top: 8px;
}
.viz-bars {
  gap: 10px;
}
.viz-bar-row {
  display: block;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
}
a.viz-bar-row:hover .grow {
  text-decoration: underline;
}
.viz-meter {
  height: 8px;
  margin-top: 5px;
  border-radius: 4px;
  overflow: hidden;
}
.viz-meter span {
  display: block;
  height: 100%;
  background: var(--viz-a);
  border-radius: 0 4px 4px 0;
}
.viz-meter.b span {
  background: var(--viz-b);
}
.viz-meter.a,
.viz-meter.b {
  margin: 8px 0 2px;
}
.mini-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.mini-stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.mini-stat b {
  font-family: var(--display);
  font-size: 22px;
}

@media (max-width: 1100px) {
  .chat-layout,
  .chat-layout.no-members {
    grid-template-columns: 260px minmax(0, 1fr);
  }
  .chat-layout .members {
    display: none;
  }
}
@media (max-width: 820px) {
  .shell {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    height: auto;
    position: static;
  }
  .nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .nav .group {
    display: none;
  }
  main.page {
    padding: 20px 16px 40px;
  }
  .split,
  .viz-grid,
  .chat-layout,
  .chat-layout.no-members,
  .form-grid,
  .project-grid,
  .day-grid {
    grid-template-columns: 1fr;
  }
  .stage-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .project-row .due-col,
  .gear-status {
    display: none;
  }
  .thread {
    height: 70vh;
  }
}

/* My account */
.me .who {
  color: inherit;
  text-decoration: none;
}
.me .who:hover b {
  text-decoration: underline;
}
.account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
  gap: 16px;
  align-items: start;
}
.steps {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 10px;
}
.secret-key {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 15px;
  letter-spacing: 0.06em;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 8px 0 4px;
  word-break: break-all;
  user-select: all;
}
.backup-codes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.backup-codes code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--surface-2);
  border-radius: 6px;
  padding: 8px;
  text-align: center;
  font-size: 15px;
}
.account-grid .actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Leads */
.lead-board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(200px, 1fr);
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  align-items: start;
}
.lead-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--stage);
  border-radius: var(--radius);
  padding: 10px;
}
.lead-col-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 2px 4px 4px;
}
.lead-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
}
.lead-card:hover {
  border-color: var(--line-2);
}
.lead-card .row {
  gap: 8px;
}
.lead-notes {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.lead-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

/* Forecast */
.bar.stack-bar {
  display: flex;
  flex-direction: column-reverse;
  overflow: hidden;
}
.bar.stack-bar .seg {
  display: block;
  flex-basis: 0;
}
.seg.invoiced,
.chip-dot.seg-invoiced {
  background: var(--ok);
}
.seg.confirmed,
.chip-dot.seg-confirmed {
  background: #6fbfb4;
}
.seg.likely,
.chip-dot.seg-likely {
  background: repeating-linear-gradient(45deg, var(--ok) 0 3px, color-mix(in srgb, var(--ok) 30%, transparent) 3px 7px);
}

/* Notes page */
.note-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 12px;
  align-items: start;
}
.note-grid > .empty {
  grid-column: 1 / -1;
}
.note-card {
  --note: var(--line-2);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--note);
  border-radius: var(--radius);
  cursor: pointer;
  min-width: 0;
}
.note-card:hover,
.note-card:focus-visible {
  border-color: var(--line-2);
  border-top-color: var(--note);
}
.note-card.c-red {
  --note: var(--red);
}
.note-card.c-amber {
  --note: var(--warn);
}
.note-card.c-green {
  --note: var(--ok);
}
.note-card.c-blue {
  --note: var(--info);
}
.note-card.c-violet {
  --note: var(--violet);
}
.note-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  color: var(--muted, inherit);
}
.note-check {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  cursor: pointer;
}
.note-check input {
  margin-top: 4px;
  accent-color: var(--red);
}
.note-check.done span {
  text-decoration: line-through;
  color: var(--dim);
}
.note-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.note-meta .chip {
  display: inline-block;
  width: auto;
  max-width: 160px;
  text-decoration: none;
}
.note-editor {
  width: 100%;
  min-height: 200px;
  resize: vertical;
  font: inherit;
  line-height: 1.5;
}
.note-form {
  width: min(640px, 100%);
}

/* Search */
.search-open {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 4px 0 12px;
  padding: 8px 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--dim);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
}
.search-open:hover {
  border-color: var(--line-2);
  color: var(--text);
}
.search-open kbd {
  font-family: inherit;
  font-size: 11px;
  padding: 1px 5px;
  border: 1px solid var(--line-2);
  border-radius: 4px;
}
.search-box {
  width: min(620px, 100%);
}
.search-input {
  width: 100%;
  font-size: 16px;
  padding: 12px 14px;
}
.search-results {
  max-height: min(60vh, 520px);
  overflow-y: auto;
  margin-top: 8px;
}
.search-kind {
  padding: 10px 6px 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.search-hit {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
}
a.search-hit:hover,
a.search-hit:focus {
  background: var(--surface-2);
  outline: none;
}
@media (max-width: 700px) {
  .search-open kbd {
    display: none;
  }
}

/* My Day: drag handle to put tasks in my own order, and the optional time on a due date. */
.drag-handle {
  flex: none;
  width: 18px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: -2px;
  cursor: grab;
  touch-action: none;
  opacity: 0.5;
}
.task:hover .drag-handle,
.drag-handle:focus-visible {
  opacity: 1;
}
.task.dragging {
  background: var(--surface-2);
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  position: relative;
  z-index: 2;
}
.task.dragging .drag-handle {
  cursor: grabbing;
}
.task-time {
  font-variant-numeric: tabular-nums;
}
.due-pair {
  gap: 8px;
}
.due-pair input[type='date'] {
  flex: 1;
  min-width: 0;
}
.due-pair input[type='time'] {
  width: 128px;
  flex: none;
}

/* Chat: ticks on my messages, "seen by" under my latest group message, message info, sound switch. */
.ticks {
  margin-left: 6px;
  padding: 0 2px;
  border: 0;
  background: none;
  font: inherit;
  cursor: pointer;
  line-height: 1;
}
.tick-mark {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -3px;
  padding-right: 3px;
  color: var(--dim);
}
.tick-mark.sent {
  opacity: 0.7;
}
.tick-mark.read {
  color: var(--info);
}
.seen-by {
  text-align: right;
  margin: -4px 4px 8px;
}
.receipt-body {
  white-space: pre-line;
  margin: 0 0 8px;
}
.receipt-head {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 14px 0 6px;
}
.receipt-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.receipt-list li {
  display: flex;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.sound-switch {
  font-size: 15px;
  padding: 4px 8px;
}

/* A checkbox with its label on one line (sign-in "Trust this device", task "No specific time"). */
.check-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 2px;
  font-size: 13px;
  cursor: pointer;
}
.check-line input {
  width: 16px;
  height: 16px;
  accent-color: var(--red);
  flex: none;
}

/* Day/month/year date box: a text box, a calendar button, and the browser's picker behind it. */
.date-field {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 100%;
  min-width: 0;
}
.date-field > input[type='text'] {
  width: 100%;
  padding-right: 34px;
  font-variant-numeric: tabular-nums;
}
.date-field .date-pick {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  padding: 4px 6px;
  border: 0;
  background: none;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  filter: grayscale(1);
  opacity: 0.75;
}
.date-field .date-pick:hover {
  opacity: 1;
}
.date-field .date-native {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  border: 0;
  padding: 0;
}
.cal-bar .date-field,
.gear-dates .date-field {
  width: 150px;
}

/* Calendar layout: the small month and legend on the left, the calendar on the right. */
.cal-layout {
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.cal-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: 12px;
}
.cal-side .legend {
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin: 0;
}
.mini-hint {
  margin: 0;
  line-height: 1.45;
}
.cal-bar select {
  width: auto;
  min-width: 170px;
}
.range-adjust {
  gap: 4px;
}
@media (max-width: 900px) {
  .cal-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .cal-side {
    position: static;
    order: 2; /* on phones the calendar comes first, the small month below it */
  }
  .cal-views {
    flex-wrap: nowrap;
    overflow-x: auto;
    max-width: 100%;
  }
  .cal-views a {
    white-space: nowrap;
  }
  .cal-side .legend {
    flex-direction: row;
    flex-wrap: wrap;
  }
}
.mini-month {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  user-select: none;
}
.mini-head {
  gap: 4px;
  margin-bottom: 6px;
  font-size: 13px;
  text-align: center;
}
.mini-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px 0;
}
.mini-dow {
  text-align: center;
  font-size: 10px;
  color: var(--dim);
  padding: 2px 0;
}
.mini-day {
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  height: 28px;
  cursor: pointer;
  touch-action: none;
  font-variant-numeric: tabular-nums;
}
.mini-day.other {
  color: var(--dim);
}
.mini-day:hover {
  background: var(--surface-3);
  border-radius: 6px;
}
.mini-day.sel,
.mini-day.picking {
  background: var(--red-soft);
}
.mini-day.picking {
  background: var(--red-deep);
  color: #fff;
}
.mini-day.today {
  color: var(--red-hi);
  font-weight: 700;
}

/* Hours from top to bottom (Day to Week views and short custom ranges). */
.tg-card {
  padding: 0;
  overflow: hidden;
}
.tg-card > p {
  padding: 0 14px 12px;
}
.tg-scroll {
  overflow: auto;
  max-height: calc(100vh - 240px);
  min-height: 420px;
}
.tg-top {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--surface);
  border-bottom: 1px solid var(--line-2);
}
.tg-row {
  display: grid;
}
.tg-corner {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--surface);
  padding: 6px 4px;
  text-align: right;
}
.tg-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 8px 4px 6px;
  border: 0;
  border-left: 1px solid var(--line);
  background: none;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.tg-day b {
  font-size: 18px;
  font-family: var(--display);
  width: 32px;
  height: 32px;
  line-height: 32px;
  border-radius: 999px;
}
.tg-day.today b {
  background: var(--red);
  color: #fff;
}
.tg-day span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.tg-day:hover b {
  background: var(--surface-3);
}
.tg-day.today:hover b {
  background: var(--red-hi);
}
.tg-person {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border-left: 1px solid var(--line);
  font-size: 12px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}
.tg-allday {
  border-top: 1px solid var(--line);
}
.tg-allcell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 3px;
  border-left: 1px solid var(--line);
  min-height: 28px;
  max-height: 96px;
  overflow-y: auto;
  min-width: 0;
}
.tg-body {
  position: relative;
}
.tg-gutter {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--surface);
}
.tg-hour {
  font-size: 10px;
  color: var(--dim);
  text-align: right;
  padding-right: 8px;
  transform: translateY(-6px);
  font-variant-numeric: tabular-nums;
}
.tg-col {
  position: relative;
  border-left: 1px solid var(--line);
  background-image: linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size:
    100% 44px,
    100% 22px;
  cursor: cell;
}
.tg-col.weekend {
  background-color: rgba(255, 255, 255, 0.015);
}
.tg-col.today {
  background-color: rgba(228, 33, 33, 0.04);
}
.tg-col.day-start,
.tg-people .tg-person:nth-child(1) {
  border-left-color: var(--line-2);
}
.chip.tg-event {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 3px 6px;
  overflow: hidden;
  white-space: normal;
  line-height: 1.25;
  z-index: 1;
  box-shadow: 0 0 0 1px var(--surface);
}
.chip.tg-event:hover {
  z-index: 2;
}
.tg-time {
  font-size: 10px;
  opacity: 0.85;
  font-variant-numeric: tabular-nums;
}
.tg-label {
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chip-time {
  font-variant-numeric: tabular-nums;
  opacity: 0.85;
}
.tg-now {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--red);
  z-index: 2;
  pointer-events: none;
}
.tg-now::before {
  content: '';
  position: absolute;
  left: -5px;
  top: -4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--red);
}
.hours-row {
  gap: 8px;
  margin-top: 6px;
}
.hours-row input {
  width: 130px;
}

/* Quote and invoice editor: client fields, printed-line switches and the live preview. */
.project-grid.doc-layout {
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 1fr);
}
.doc-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.doc-field {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr) auto auto;
  gap: 8px;
  align-items: center;
}
.doc-field .check-line {
  margin: 0;
}
.doc-field.off input:not([type='checkbox']) {
  opacity: 0.55;
  text-decoration: line-through;
}
.print-switches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 0 12px;
}
.preview-card {
  position: sticky;
  top: 12px;
}
.preview-wrap {
  background: #e9eaee;
  border-radius: 8px;
  overflow: hidden;
}
.doc-preview {
  display: block;
  width: 100%;
  height: 520px;
  border: 0;
  background: #e9eaee;
}
.zoom-label {
  min-width: 40px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 1100px) {
  .project-grid.doc-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .preview-card {
    position: static;
  }
}
.doc-field.two {
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr) auto;
}
.field-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.rate-head {
  gap: 16px;
  align-items: flex-end;
  margin-bottom: 14px;
}
.rate-head .field select {
  min-width: 260px;
}
.rate-head p {
  margin: 0 0 10px;
}
.rate-table td:first-child input {
  min-width: 190px;
}
.rate-table {
  display: block;
  overflow-x: auto;
}

/* Costs and receipts: period shortcuts, filters, totals, months. */
.sub-tabs {
  margin-bottom: 14px;
}
.period-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.period-bar .chip-btn[aria-pressed='true'] {
  background: var(--red-soft);
  border-color: var(--red);
  color: #fff;
}
.period-custom {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px dashed var(--line-2);
}
.period-custom.on {
  border-style: solid;
  border-color: var(--red);
}
.period-custom .date-field {
  width: 140px;
}
.cost-filters {
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.cost-filters select {
  height: 36px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--text);
  max-width: 260px;
}
.cost-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.cost-kpis .kpi {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.cost-kpis .kpi b {
  font-family: var(--display);
  font-size: 20px;
}
.cost-kpis .kpi.warn b {
  color: var(--warn);
}
.cost-kpis .kpi.ok b {
  color: var(--ok);
}
.cost-month {
  margin-bottom: 14px;
}
.muted-row td {
  opacity: 0.6;
}
.actions-cell {
  white-space: nowrap;
  text-align: right;
}

/* Finance dashboard: the ladder of money in and coming in, target, what we owe, running costs, past years. */
.section-title {
  font-size: 15px;
  margin: 22px 0 12px;
  color: var(--muted);
}
.sheet-card {
  margin-bottom: 16px;
}
.ladder {
  display: flex;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-3);
  margin: 6px 0 14px;
  gap: 2px;
}
.ladder-part {
  flex-basis: 0;
  min-width: 0;
}
.ladder-part.received,
.ladder-dot.received {
  background: var(--ok);
}
.ladder-part.payable,
.ladder-dot.payable {
  background: var(--warn);
}
.ladder-part.invoice,
.ladder-dot.invoice {
  background: var(--info);
}
.ladder-part.agreed,
.ladder-dot.agreed {
  background: var(--violet);
}
.ladder-part.forecast,
.ladder-dot.forecast {
  background: repeating-linear-gradient(45deg, var(--dim) 0 4px, transparent 4px 8px);
  border: 1px solid var(--dim);
}
.ladder-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}
.ladder-tile {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.ladder-tile b {
  font-family: var(--display);
  font-size: 20px;
}
.ladder-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 3px;
  margin-right: 6px;
  vertical-align: 0;
}
.forecast-clients {
  margin-top: 12px;
}
.forecast-clients summary {
  cursor: pointer;
  color: var(--muted);
}
.sheet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.big-figure {
  font-family: var(--display);
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}
.target-figures b {
  font-family: var(--display);
  font-size: 22px;
}
.target-bar {
  display: flex;
  height: 12px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
  margin: 10px 0 8px;
}
.target-bar .got {
  background: var(--ok);
}
.target-bar .secured {
  background: var(--warn);
}
.target-parts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 4px;
}
.target-part {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.target-part b {
  font-family: var(--display);
  font-size: 16px;
}
.target-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 6px;
}
.target-dot.got {
  background: var(--ok);
}
.target-dot.secured {
  background: var(--warn);
}
.target-dot.left {
  background: var(--surface-3);
  box-shadow: inset 0 0 0 1px var(--line-2);
}
@media (max-width: 520px) {
  .target-parts {
    grid-template-columns: 1fr;
  }
}
.past-years {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 8px;
}
.past-row {
  display: grid;
  grid-template-columns: 44px 1fr 80px;
  gap: 10px;
  align-items: center;
}
.past-row > span {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.past-bars {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.bar-h {
  display: block;
  height: 8px;
  border-radius: 4px;
  min-width: 2px;
}
.bar-h.in {
  background: var(--ok);
}
.bar-h.out {
  background: var(--red);
}

/* Team and access: who sees what, and the finance access log. */
.table-scroll {
  overflow-x: auto;
}
.access-table select {
  height: 32px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  padding: 0 8px;
}
.access-table .chosen {
  margin-top: 4px;
  color: var(--muted);
}
.ok-text {
  color: var(--ok);
  font-weight: 600;
}
.alert-row td {
  background: color-mix(in srgb, var(--red) 8%, transparent);
}
.inline-count {
  margin-left: 6px;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
}
.pick-list {
  max-height: 320px;
  overflow-y: auto;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
}
.pick-list .check-line {
  margin: 0;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.alert-notice {
  display: block;
  margin-bottom: 14px;
  background: var(--red-soft);
  border: 1px solid var(--red);
  color: var(--text);
  text-decoration: none;
}

/* View as: the banner that stays on top while an admin sees HQ as someone else. */
.view-as-banner {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 8px 16px;
  background: var(--warn);
  color: #1a1408;
  font-size: 14px;
}
.view-as-banner .btn {
  background: #1a1408;
  color: #fff;
  border-color: #1a1408;
}
.shell.viewing {
  min-height: calc(100vh - 42px);
}

/* Notifications: the bell in the side panel and its list */
.search-open.bell {
  margin-top: -6px;
}
.feed {
  width: min(560px, 100%);
}
.feed-list {
  display: flex;
  flex-direction: column;
  max-height: 60vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.feed-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
}
.feed-item:last-child {
  border-bottom: 0;
}
.feed-item:hover {
  background: var(--surface-2);
}
.feed-item b {
  font-weight: 500;
}
.feed-item.unseen b {
  font-weight: 700;
}
.feed-item.unseen .feed-icon {
  color: var(--red);
}
.feed-icon {
  width: 20px;
  text-align: center;
  flex: none;
}

/* Tenders */
.tender-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
}
.tender-row:last-child {
  border-bottom: 0;
}
.tender-row:hover {
  background: var(--surface-2);
}
.pre {
  white-space: pre-line;
}
.note-line {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

/* Attachments in chats and on projects */
.attachment {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
  color: var(--text);
  text-decoration: none;
  max-width: 100%;
}
.attachment img {
  max-width: 260px;
  max-height: 200px;
  border-radius: 8px;
  border: 1px solid var(--line);
  object-fit: cover;
}
.attachment:hover span {
  text-decoration: underline;
}

/* Boards: a free canvas of blocks */
.board-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--text);
  text-decoration: none;
  border-top: 3px solid var(--note, var(--line-2));
}
.board-card.c-red, .block.c-red { --note: var(--red); }
.board-card.c-amber, .block.c-amber { --note: var(--warn); }
.board-card.c-green, .block.c-green { --note: var(--ok); }
.board-card.c-blue, .block.c-blue { --note: var(--info); }
.board-card.c-violet, .block.c-violet { --note: var(--violet); }
.board-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.board-scroll {
  overflow: auto;
  height: calc(100vh - 220px);
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background-color: var(--surface);
  background-image: radial-gradient(var(--line) 1px, transparent 1px);
  background-size: 22px 22px;
}
.board-canvas {
  position: relative;
  width: 4000px;
  height: 3000px;
}
.block {
  position: absolute;
  display: flex;
  flex-direction: column;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-top: 3px solid var(--note, var(--line-2));
  border-radius: 10px;
  box-shadow: 0 6px 18px rgb(0 0 0 / 0.18);
  overflow: hidden;
}
.block-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px 4px 10px;
  font-size: 11px;
  color: var(--dim);
  cursor: grab;
  user-select: none;
  touch-action: none;
}
.block-bar:active {
  cursor: grabbing;
}
.block-btn {
  background: none;
  border: 0;
  color: var(--dim);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  padding: 0 4px;
}
.block-btn:hover {
  color: var(--text);
}
.block .block-btn[title='Colour'] {
  color: var(--note, var(--dim));
}
.block-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px 10px 12px;
  overflow: auto;
}
.block-body input,
.block-body textarea {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  padding: 3px 5px;
  min-width: 0;
}
.block-body input:focus,
.block-body textarea:focus {
  border-color: var(--line-2);
  outline: none;
}
.block-text {
  flex: 1;
  resize: none;
  line-height: 1.5;
}
.k-heading .block-text {
  font-size: 22px;
  font-weight: 700;
}
.block-title {
  font-weight: 600;
}
.block-link {
  font-weight: 600;
  overflow-wrap: anywhere;
}
.block-img {
  width: 100%;
  flex: 1;
  min-height: 0;
  object-fit: cover;
  border-radius: 6px;
}
.check-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.check-row input[type='text'],
.check-row input:not([type]) {
  flex: 1;
}
.block-table {
  border-collapse: collapse;
  width: 100%;
}
.block-table td {
  border: 1px solid var(--line);
  padding: 0;
}
.block-table input {
  width: 100%;
}
.tl-row {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 4px 0;
  border-left: 2px solid var(--note, var(--red));
  padding-left: 10px;
}
.mood-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 6px;
}
.mood-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
}
.mood-add {
  aspect-ratio: 1;
  border: 1px dashed var(--line-2);
  border-radius: 6px;
  background: none;
  color: var(--dim);
  font-size: 22px;
  cursor: pointer;
}
.block-resize {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 14px;
  height: 14px;
  cursor: nwse-resize;
  touch-action: none;
  background: linear-gradient(135deg, transparent 50%, var(--line-2) 50%);
}
.board-people {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 6px;
  max-height: 220px;
  overflow: auto;
}
.score {
  min-width: 34px;
  text-align: center;
  font-weight: 700;
  border-radius: 8px;
  padding: 3px 6px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
}
.score.big {
  font-size: 20px;
  padding: 6px 10px;
}
.breakdown {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 8px;
}
.breakdown > div {
  display: flex;
  flex-direction: column;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
/* Many tabs (Tenders): one scrolling row, each tab on one line */
.tabs {
  overflow-x: auto;
  scrollbar-width: thin;
}
.tabs a {
  white-space: nowrap;
  flex: none;
}

/* Side panel icons */
.nav-label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.icon {
  flex: none;
  opacity: 0.85;
}
.nav a[aria-current='page'] .icon {
  opacity: 1;
}

/* Checklists (boards and notes) */
.checklist {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.check-line {
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 6px;
  padding: 1px 2px;
}
.check-line.dragging {
  opacity: 0.4;
}
.check-line.drop-here {
  box-shadow: inset 0 2px 0 var(--red);
}
.check-line .check-text,
.check-add {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  padding: 3px 5px;
}
.check-line .check-text:focus,
.check-add:focus {
  border-color: var(--line-2);
  outline: none;
}
.check-line.done .check-text {
  text-decoration: line-through;
  color: var(--dim);
}
.check-handle {
  display: inline-flex;
  width: 14px;
  color: var(--dim);
  cursor: grab;
  opacity: 0;
}
.check-line:hover .check-handle,
.check-line:focus-within .check-handle {
  opacity: 1;
}
.check-handle.off {
  cursor: default;
}
.check-del {
  display: inline-flex;
  background: none;
  border: 0;
  color: var(--dim);
  cursor: pointer;
  padding: 2px;
  opacity: 0.5;
}
.check-del:hover {
  color: var(--red);
  opacity: 1;
}
.check-line:not(.done) .check-del {
  opacity: 0;
}
.check-line:not(.done):hover .check-del,
.check-line:not(.done):focus-within .check-del {
  opacity: 0.6;
}
.check-done-head {
  margin-top: 6px;
  font-size: 11px;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.note-check.done span {
  text-decoration: line-through;
  color: var(--dim);
}
.note-check {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Board text toolbar: shown above the selected block */
.block {
  overflow: visible;
}
.block-body {
  border-radius: 0 0 10px 10px;
}
.block-tools {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  z-index: 5;
  align-items: center;
  gap: 2px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  box-shadow: 0 6px 18px rgb(0 0 0 / 0.25);
  white-space: nowrap;
}
.block.selected .block-tools {
  display: flex;
}
.block.selected {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}
.tool-btn {
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-style: normal;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
}
.tool-btn:hover,
.tool-btn.on {
  background: var(--surface-2);
}
.tool-btn.on {
  color: var(--red);
}
.tool-sep {
  width: 1px;
  height: 18px;
  margin: 0 3px;
  background: var(--line-2);
}
.tool-swatch {
  width: 18px;
  height: 18px;
  margin: 0 1px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: var(--note, transparent);
  cursor: pointer;
}
.tool-swatch.c-red { --note: var(--red); }
.tool-swatch.c-amber { --note: var(--warn); }
.tool-swatch.c-green { --note: var(--ok); }
.tool-swatch.c-blue { --note: var(--info); }
.tool-swatch.c-violet { --note: var(--violet); }
.k-heading .block-body {
  font-size: 22px;
  font-weight: 700;
}
.k-heading .block-text {
  font-size: inherit;
  font-weight: inherit;
}
.block-body input,
.block-body textarea {
  text-align: inherit;
  font-style: inherit;
}
.block-body.drop-target {
  outline: 2px dashed var(--red);
  outline-offset: -4px;
}
.block.selected {
  z-index: 100000 !important;
}
.question {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.answer {
  margin-top: 4px;
  padding: 8px 10px;
  border-left: 3px solid var(--ok);
  background: var(--surface-2);
  border-radius: 6px;
}
.ask-box {
  padding: 10px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--surface-2);
}
.toast-undo {
  margin-left: 14px;
  padding: 3px 10px;
  border: 1px solid currentColor;
  border-radius: 6px;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.task .task-del {
  opacity: 0;
}
.task:hover .task-del,
.task .task-del:focus {
  opacity: 0.7;
}
.task.done .task-del {
  opacity: 0.6;
}
@media (hover: none) {
  .task .task-del {
    opacity: 0.6;
  }
}
#toast.show.with-undo {
  pointer-events: auto;
  display: flex;
  align-items: center;
}
.tender-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.tender-filters input[type='search'] {
  flex: 1 1 260px;
}
.tender-filters select {
  flex: 0 1 auto;
  max-width: 200px;
}
.closed-group {
  margin-top: 6px;
}
.closed-group summary {
  cursor: pointer;
  color: var(--dim);
  padding: 8px 2px;
}
.score.empty {
  color: var(--dim);
  font-weight: 400;
}
.row-actions {
  display: inline-flex;
  gap: 2px;
  opacity: 0;
}
.tender-row:hover .row-actions,
.row-actions:focus-within {
  opacity: 1;
}
@media (hover: none) {
  .row-actions {
    opacity: 0.7;
  }
}
.board-peek {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--surface-2);
  font-size: 12px;
  color: var(--muted, var(--dim));
}
.board-peek span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.voice-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.voice-note audio {
  height: 34px;
  max-width: 260px;
}
.voice-btn {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.voice-btn.recording {
  color: #fff;
  background: var(--red);
  border-color: var(--red);
  font-variant-numeric: tabular-nums;
}

/* The no-login upload page */
.upload-page {
  min-height: 100vh;
}
.up-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 16px 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.up-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.up-mark {
  width: 40px;
  height: 40px;
}
.up-title {
  display: flex;
  flex-direction: column;
  flex: 1;
}
.up-title b {
  font-size: 17px;
}
.up-client {
  max-height: 34px;
  max-width: 120px;
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
  padding: 3px 6px;
}
.up-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.up-card h1 {
  font-size: 22px;
  margin: 0;
}
.up-note {
  white-space: pre-line;
  padding: 10px 12px;
  border-left: 3px solid var(--red);
  background: var(--surface-2);
  border-radius: 6px;
}
.up-warn {
  color: var(--warn);
}
.up-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  padding: 32px 16px;
  border: 2px dashed var(--line-2);
  border-radius: 14px;
  transition: border-color 0.15s, background 0.15s;
}
.up-drop.over {
  border-color: var(--red);
  background: var(--red-soft);
}
.up-drop-big {
  font-size: 18px;
  font-weight: 600;
}
.up-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 6px;
}
.up-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.up-file {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.up-file-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.up-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.up-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}
.up-bar-fill {
  height: 100%;
  width: 0;
  background: var(--red);
  transition: width 0.3s;
}
.up-bar-fill.ok {
  background: var(--ok);
}
.up-bar-fill.bad {
  background: var(--warn);
}
.up-powered {
  align-self: center;
}
.new-client {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
  padding: 10px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--surface-2);
  grid-column: 1 / -1;
}
.money-figs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.money-fig {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-2);
}
.money-fig b {
  font-size: 18px;
}
.money-fig.ok b {
  color: var(--ok);
}
.money-fig.warn b {
  color: var(--warn);
}
.money-fig.late b {
  color: var(--red);
}
.warn-text {
  color: var(--warn);
}

/* Formatted text */
.rt-editor {
  outline: none;
  min-height: 1.5em;
  line-height: 1.5;
  overflow-wrap: anywhere;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 3px 5px;
}
.rt-editor:focus {
  border-color: var(--line-2);
}
.rt-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--dim);
}
.rt-editor.single {
  white-space: nowrap;
  overflow: hidden;
  flex: 1;
  min-width: 0;
}
.note-editor.rt-editor {
  min-height: 120px;
  border-color: var(--line);
  padding: 10px 12px;
  background: var(--surface-2);
}
.block-text.rt-editor {
  flex: 1;
  overflow: auto;
}
.rt-toolbar {
  position: absolute;
  z-index: 200000;
  display: none;
  align-items: center;
  gap: 2px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  box-shadow: 0 8px 22px rgb(0 0 0 / 0.3);
  white-space: nowrap;
}
.rt-toolbar.show {
  display: flex;
}
.rt-btn {
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.rt-btn:hover {
  background: var(--surface-2);
}
.rt-swatches {
  display: inline-flex;
  gap: 1px;
}
.rt-swatch {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  cursor: pointer;
  padding: 0;
}
.rt-label {
  font-size: 11px;
  color: var(--dim);
  padding: 0 2px 0 4px;
}
.tc-red { color: #ff6b6b; } .rt-swatch.tc-red, .rt-swatch.hl-red { background: #ff6b6b; }
.tc-orange { color: #ff9f43; } .rt-swatch.tc-orange, .rt-swatch.hl-orange { background: #ff9f43; }
.tc-amber { color: #f5c542; } .rt-swatch.tc-amber, .rt-swatch.hl-amber { background: #f5c542; }
.tc-green { color: #4cd38a; } .rt-swatch.tc-green, .rt-swatch.hl-green { background: #4cd38a; }
.tc-teal { color: #2ec4b6; } .rt-swatch.tc-teal, .rt-swatch.hl-teal { background: #2ec4b6; }
.tc-blue { color: #5aa9ff; } .rt-swatch.tc-blue, .rt-swatch.hl-blue { background: #5aa9ff; }
.tc-violet { color: #a78bfa; } .rt-swatch.tc-violet, .rt-swatch.hl-violet { background: #a78bfa; }
.tc-pink { color: #f472b6; } .rt-swatch.tc-pink, .rt-swatch.hl-pink { background: #f472b6; }
.tc-grey { color: #9aa0a6; } .rt-swatch.tc-grey, .rt-swatch.hl-grey { background: #9aa0a6; }
.hl-red { background: rgb(255 107 107 / 0.3); }
.hl-orange { background: rgb(255 159 67 / 0.3); }
.hl-amber { background: rgb(245 197 66 / 0.35); }
.hl-green { background: rgb(76 211 138 / 0.3); }
.hl-teal { background: rgb(46 196 182 / 0.3); }
.hl-blue { background: rgb(90 169 255 / 0.3); }
.hl-violet { background: rgb(167 139 250 / 0.3); }
.hl-pink { background: rgb(244 114 182 / 0.3); }
.hl-grey { background: rgb(154 160 166 / 0.3); }
.sz-s { font-size: 0.8em; }
.sz-m { font-size: 1.1em; }
.sz-l { font-size: 1.45em; }
.sz-xl { font-size: 2em; line-height: 1.2; }
.rt-editor a,
.note-body a {
  color: var(--info);
  text-decoration: underline;
}

/* The deadline on a task row: a quick menu (Today, Tomorrow, Next Monday, Choose a date) */
.due-menu {
  font: inherit;
  font-size: 12px;
  min-width: 74px;
  max-width: 150px;
  text-align: right;
  text-align-last: right;
  padding: 3px 8px;
  flex: none;
  border-radius: 8px;
  border: 1px solid transparent;
  background-color: transparent;
  color: var(--muted);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition:
    border-color 0.15s,
    background-color 0.15s;
}
.due-menu:hover,
.due-menu:focus-visible {
  border-color: var(--line);
  background-color: var(--surface-2);
  color: var(--text);
}
.due-menu.empty {
  border: 1px dashed var(--line);
  color: var(--dim);
}
.due-menu.late {
  color: #ff8a8d;
  font-weight: 600;
}
.due-menu option {
  font-weight: normal;
  text-align: left;
}
.task-private {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--warn);
}
.private-line .check-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.private-line .dim {
  margin: 2px 0 0 26px;
}

/* "Move to…" on a late task */
.move-wrap {
  position: relative;
  flex: none;
}
.move-task {
  font: inherit;
  font-size: 12px;
  padding: 3px 6px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: inherit;
  cursor: pointer;
}
.move-date {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

/* Projects list: open on top, invoiced and closed below */
.project-half + .project-half {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.project-half .section-head {
  margin: 0 0 10px;
}
.target-notes {
  margin: 8px 0 0;
  padding-left: 18px;
  line-height: 1.5;
}

/* Money in: one summary tile per stage, tap to hide or show */
.money-summary {
  margin-bottom: 14px;
}
.money-bar {
  display: flex;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-3);
  margin-bottom: 12px;
}
.money-bar .expected,
.money-dot.expected {
  background: var(--info);
}
.money-bar .invoiced,
.money-dot.invoiced {
  background: var(--warn);
}
.money-bar .paid,
.money-dot.paid {
  background: var(--ok);
}
.money-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.money-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.money-tile b {
  font-family: var(--display);
  font-size: 18px;
}
.money-tile[aria-pressed='false'] {
  opacity: 0.45;
  background: transparent;
  border-style: dashed;
}
.money-tile:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}
.money-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 6px;
}
.money-foot {
  margin-top: 10px;
  gap: 14px;
  flex-wrap: wrap;
}
@media (max-width: 560px) {
  .money-tiles {
    grid-template-columns: 1fr;
  }
}

/* ------------------------------------------------------------------------------------------------------------------
   Motion and polish. Light, quick and never in the way: everything here is switched off for people who ask their
   device for less motion (the block at the very end).
   ------------------------------------------------------------------------------------------------------------------ */
:root {
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --fast: 0.14s;
  --calm: 0.26s;
}
::selection {
  background: rgba(228, 33, 33, 0.38);
  color: #fff;
}
* {
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}
:focus-visible {
  outline: 2px solid var(--red-hi);
  outline-offset: 2px;
}

/* A page arrives: its sections rise a few pixels into place, one just after the other. */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
@keyframes pop {
  0% {
    transform: scale(0.6);
    opacity: 0;
  }
  70% {
    transform: scale(1.12);
  }
}
@keyframes grow-x {
  from {
    transform: scaleX(0);
  }
}
@keyframes grow-y {
  from {
    transform: scaleY(0);
  }
}
main.page > *,
main.page > .stack > * {
  animation: rise var(--calm) var(--ease) backwards;
}
main.page > :nth-child(2),
main.page > .stack > :nth-child(2) {
  animation-delay: 0.04s;
}
main.page > :nth-child(3),
main.page > .stack > :nth-child(3) {
  animation-delay: 0.08s;
}
main.page > :nth-child(n + 4),
main.page > .stack > :nth-child(n + 4) {
  animation-delay: 0.12s;
}

/* While a page fetches its data: a thin red line runs along the top (only if it takes a moment). */
@keyframes loading-run {
  0% {
    transform: translateX(-100%) scaleX(0.4);
  }
  100% {
    transform: translateX(100%) scaleX(0.9);
  }
}
main.page.loading::before {
  content: '';
  position: fixed;
  z-index: 60;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--red-hi), transparent);
  animation:
    fade 0.2s 0.25s backwards,
    loading-run 1.1s 0.25s var(--ease) infinite backwards;
}

/* Things you can press answer the pointer. */
.btn,
.chip-btn,
.search-open,
.nav a,
.tabs a,
.list a,
.stage-strip button,
.project-row,
.lead-card,
.note-card,
.tender-row,
.feed-item,
.card.clickable,
.table tr.clickable {
  transition:
    background-color var(--fast) var(--ease),
    border-color var(--fast) var(--ease),
    color var(--fast) var(--ease),
    box-shadow var(--calm) var(--ease),
    transform var(--fast) var(--ease);
}
.btn:not(:disabled):active,
.chip-btn:active,
.stage-strip button:not(:disabled):active {
  transform: scale(0.97);
}
.btn.primary {
  box-shadow: 0 0 0 0 rgba(228, 33, 33, 0);
}
.btn.primary:not(:disabled):hover {
  box-shadow: 0 6px 18px -8px rgba(246, 41, 40, 0.75);
}
.project-row:hover,
.lead-card:hover,
.note-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -18px rgba(0, 0, 0, 0.9);
}
.nav a .icon,
.search-open .icon {
  transition: transform var(--calm) var(--ease);
}
.nav a:hover .icon {
  transform: translateX(2px);
}
.nav a[aria-current='page'] {
  box-shadow: inset 3px 0 0 var(--red);
}
.tabs a {
  position: relative;
}
/* The logo's slate claps: it lifts from its hinge on the left and snaps shut, on hover and on click.
   The arch never moves. Calm-motion settings switch this off (see the rule at the end). */
.brand-mark {
  position: relative;
  display: block;
  flex: none;
}
.brand-mark .arch {
  position: absolute;
  inset: 0;
}
.brand-mark .slate {
  display: block;
  transform-origin: 8% 52%;
}
.brand:hover .brand-mark .slate {
  animation: slate-clap 0.5s var(--ease);
}
/* Hover: the slate lifts from its hinge and snaps back. */
@keyframes slate-clap {
  0%,
  100% {
    transform: rotate(0deg);
  }
  40% {
    transform: rotate(-14deg);
  }
  62% {
    transform: rotate(1.5deg);
  }
  78% {
    transform: rotate(0deg);
  }
}
/* A click is a real clap, cartoon style: the slate winds up (anticipation), hangs for a beat, slams
   shut onto the arch (fast ease-in), the whole mark squashes on impact and stretches back, then the
   slate swings up past its resting place and settles (follow-through). */
.brand .brand-mark.clap,
.brand:hover .brand-mark.clap {
  transform-origin: 50% 100%;
  animation: mark-slap 0.9s linear var(--clap-delay, 0s);
}
.brand .brand-mark.clap .slate,
.brand:hover .brand-mark.clap .slate {
  animation: slate-slap 0.9s linear var(--clap-delay, 0s);
}
@keyframes slate-slap {
  0% {
    transform: rotate(0deg);
    animation-timing-function: cubic-bezier(0.3, 0, 0.2, 1);
  }
  24% {
    transform: rotate(-26deg);
    animation-timing-function: ease-in-out;
  }
  32% {
    transform: rotate(-28deg);
    animation-timing-function: cubic-bezier(0.6, 0, 1, 0.6);
  }
  40% {
    transform: rotate(var(--slate-shut, 18.5deg));
    animation-timing-function: ease-out;
  }
  44% {
    transform: rotate(calc(var(--slate-shut, 18.5deg) - 3deg));
    animation-timing-function: ease-in;
  }
  48% {
    transform: rotate(var(--slate-shut, 18.5deg));
    animation-timing-function: cubic-bezier(0.2, 0, 0.2, 1);
  }
  56% {
    transform: rotate(var(--slate-shut, 18.5deg));
    animation-timing-function: cubic-bezier(0.25, 0, 0.2, 1);
  }
  76% {
    transform: rotate(-6deg);
    animation-timing-function: ease-in-out;
  }
  89% {
    transform: rotate(1.5deg);
    animation-timing-function: ease-in-out;
  }
  100% {
    transform: rotate(0deg);
  }
}
@keyframes mark-slap {
  0% {
    transform: none;
    animation-timing-function: ease-out;
  }
  24% {
    transform: scale(0.97, 1.04);
    animation-timing-function: ease-in-out;
  }
  36% {
    transform: none;
    animation-timing-function: ease-in;
  }
  40% {
    transform: translateY(1px) scale(1.1, 0.88);
    animation-timing-function: ease-out;
  }
  50% {
    transform: scale(0.97, 1.04);
    animation-timing-function: ease-in-out;
  }
  60% {
    transform: none;
  }
  100% {
    transform: none;
  }
}

/* Counts pop in when there is something new. */
.nav .count,
.bell .count,
.tabbar .count {
  animation: pop 0.32s var(--ease) backwards;
}

/* Dialogs, the search box and messages settle in rather than appear. */
@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
}
dialog[open] {
  animation: dialog-in var(--calm) var(--ease);
}
dialog[open]::backdrop {
  animation: fade var(--calm) ease-out;
  backdrop-filter: blur(3px);
}
#toast {
  transform: translate(-50%, 10px);
  transition:
    opacity 0.2s,
    transform var(--calm) var(--ease);
  box-shadow: 0 12px 30px -14px rgba(0, 0, 0, 0.9);
}
#toast.show {
  transform: translate(-50%, 0);
}
.msg:not(.event) {
  animation: rise 0.2s var(--ease) backwards;
}
.feed-item.unseen {
  animation: fade 0.4s ease-out backwards;
}

/* Bars fill from the start, so the eye follows the money. */
.ladder-part,
.target-bar > *,
.meter span,
.bar-h {
  transform-origin: left center;
  animation: grow-x 0.7s var(--ease) backwards;
}
.ladder-part:nth-child(2),
.target-bar > :nth-child(2) {
  animation-delay: 0.12s;
}
.ladder-part:nth-child(3),
.target-bar > :nth-child(3) {
  animation-delay: 0.22s;
}
.ladder-part:nth-child(n + 4) {
  animation-delay: 0.3s;
}
.bar-pair .bar,
.bar.stack-bar {
  transform-origin: center bottom;
  animation: grow-y 0.6s var(--ease) backwards;
}

/* A finished task: the line is drawn through, the row eases back. */
.task .grow > :first-child {
  transition: color var(--calm) var(--ease);
}
.task .tick input {
  transition: transform var(--fast) var(--ease);
}
.task .tick input:active {
  transform: scale(0.85);
}
.task.done {
  animation: fade 0.3s ease-out;
}
.stage-strip button[aria-pressed='true'] {
  box-shadow: 0 6px 18px -12px currentColor;
}

/* Tender scores read at a glance: strong, fair, weak. */
.score.strong {
  color: var(--ok);
  border-color: rgba(76, 195, 138, 0.45);
  background: var(--ok-soft);
}
.score.fair {
  color: var(--warn);
  border-color: rgba(242, 177, 74, 0.4);
  background: var(--warn-soft);
}
.score.weak {
  color: var(--muted);
}

/* Dropdowns everywhere match the rest of HQ (the browser's own arrow and frame are replaced). */
:where(select) {
  height: 36px;
  background-color: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding-left: 10px;
  color: var(--text);
  cursor: pointer;
  transition: border-color var(--fast) var(--ease);
}
:where(select):hover {
  border-color: var(--line-2);
}
select:not([multiple]) {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a3a5b4' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 10px center !important;
  padding-right: 30px !important;
}

/* Sign-in: a soft red glow breathes behind the card and the logo settles in. */
@keyframes glow {
  0%,
  100% {
    opacity: 0.55;
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    opacity: 0.9;
    transform: translate(-50%, -52%) scale(1.08);
  }
}
@keyframes logo-in {
  from {
    opacity: 0;
    transform: translateY(8px) rotate(-8deg) scale(0.9);
  }
}
.auth {
  position: relative;
  overflow: hidden;
}
.auth::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 42%;
  width: min(760px, 120vw);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(228, 33, 33, 0.2), rgba(228, 33, 33, 0.05) 55%, transparent);
  transform: translate(-50%, -50%);
  animation: glow 9s ease-in-out infinite;
  pointer-events: none;
}
.auth .card {
  position: relative;
  animation: rise 0.45s var(--ease) backwards;
  box-shadow: 0 30px 80px -40px rgba(0, 0, 0, 0.9);
}
.auth .logo img {
  animation: logo-in 0.7s 0.1s var(--ease) backwards;
  transform-origin: 30% 80%;
}
.empty {
  animation: fade 0.4s ease-out backwards;
}

/* ---- Phones: the page comes first. A slim bar on top, the main places along the bottom, the full menu in a drawer. */
.topbar,
.tabbar,
.scrim {
  display: none;
}
@media (max-width: 820px) {
  .topbar {
    display: flex;
    align-items: center;
    gap: 8px;
    position: sticky;
    top: 0;
    z-index: 30;
    padding: 8px 12px;
    padding-top: calc(8px + env(safe-area-inset-top));
    background: rgba(22, 23, 28, 0.88);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
  }
  .topbar .brand {
    padding: 0;
    flex: 1;
    min-width: 0;
  }
  .topbar .brand img {
    width: 26px;
    height: 28px;
  }
  .topbar .brand span {
    font-size: 15px;
  }
  .icon-btn {
    width: 40px;
    height: 40px;
    display: inline-grid;
    place-items: center;
    border-radius: 10px;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    position: relative;
  }
  .icon-btn:active {
    background: var(--surface-2);
  }
  .sidebar {
    position: fixed;
    z-index: 50;
    inset: 0 auto 0 0;
    width: min(320px, 86vw);
    height: 100dvh;
    padding-top: calc(18px + env(safe-area-inset-top));
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    transform: translateX(-102%);
    transition: transform 0.28s var(--ease);
    box-shadow: 30px 0 60px -30px rgba(0, 0, 0, 0.9);
  }
  .nav {
    flex-direction: column;
    flex-wrap: nowrap;
  }
  .nav .group {
    display: block;
  }
  .shell.menu-open .sidebar {
    transform: none;
  }
  .scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 40;
    border: 0;
    padding: 0;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease-out;
  }
  .shell.menu-open .scrim {
    opacity: 1;
    pointer-events: auto;
  }
  .tabbar {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    position: fixed;
    z-index: 30;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: rgba(22, 23, 28, 0.92);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
  }
  .tabbar a,
  .tabbar button {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 2px 4px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--dim);
    font-size: 11px;
    text-decoration: none;
    position: relative;
    cursor: pointer;
    transition:
      color var(--fast) var(--ease),
      transform var(--fast) var(--ease);
  }
  .tabbar a:active,
  .tabbar button:active {
    transform: scale(0.94);
  }
  .tabbar a[aria-current='page'] {
    color: #ff8a8d;
    font-weight: 600;
  }
  .tabbar a[aria-current='page']::before {
    content: '';
    position: absolute;
    top: -7px;
    width: 22px;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: var(--red);
    animation: grow-x 0.3s var(--ease);
  }
  .tabbar .count {
    position: absolute;
    top: 0;
    left: calc(50% + 6px);
    background: var(--red);
    color: #fff;
    border-radius: 999px;
    font-size: 10px;
    min-width: 17px;
    line-height: 15px;
    padding: 1px 4px;
    text-align: center;
  }
  .has-unseen .tabbar .more::after,
  .has-unseen .topbar .menu-open-btn::after {
    content: '';
    position: absolute;
    top: 6px;
    left: calc(50% + 8px);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--red);
  }
  main.page {
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }
  #toast {
    bottom: calc(84px + env(safe-area-inset-bottom));
    max-width: calc(100vw - 24px);
  }
  /* Nothing may push a page wider than the phone. */
  .day-grid > *,
  .split > *,
  .project-grid > *,
  .viz-grid > *,
  .chat-layout > * {
    min-width: 0;
  }
  .page-head {
    gap: 8px;
  }
  .tabs {
    overflow-x: auto;
    scrollbar-width: none;
  }
  /* Wide tables scroll sideways inside their own card. */
  .card:has(> .table),
  .card:has(> table) {
    overflow-x: auto;
  }
  /* A task: its title gets the full line, the details sit underneath. */
  .task {
    flex-wrap: wrap;
    row-gap: 4px;
  }
  .task > .grow {
    flex-basis: calc(100% - 70px);
  }
  .task .due {
    min-width: 0;
    text-align: left;
  }
  .task > .pill {
    margin-left: 38px;
  }
  .task .avatar-gap {
    display: none;
  }
  .tender-row {
    flex-wrap: wrap;
    row-gap: 6px;
  }
  .tender-row > .grow {
    flex-basis: calc(100% - 60px);
  }
}

/* ---- Tenders → Map: a quiet dark world, red where the work is. */
.seg {
  display: inline-flex;
  margin-left: auto;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.seg button {
  height: 30px;
  padding: 0 14px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition:
    background-color var(--fast) var(--ease),
    color var(--fast) var(--ease);
}
.seg button[aria-pressed='true'] {
  background: var(--surface-3);
  color: var(--text);
  font-weight: 600;
}
.tmap {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.tmap.with-panel {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
}
.tmap-main {
  min-width: 0;
}
.tmap-stage {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(121, 168, 255, 0.07), transparent 60%),
    radial-gradient(80% 70% at 60% 60%, rgba(228, 33, 33, 0.05), transparent 70%), #0c0d11;
  aspect-ratio: 1000 / 440;
  min-height: 300px;
}
.tmap-wait {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
}
.tmap-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
  user-select: none;
  animation: fade 0.6s ease-out;
}
.tmap-svg.dragging {
  cursor: grabbing;
}
.tmap-svg .land {
  fill: #1b1d25;
  stroke: #2b2e3a;
  stroke-width: 0.6;
  vector-effect: non-scaling-stroke;
  transition:
    fill 0.25s var(--ease),
    stroke 0.25s var(--ease);
}
.tmap-svg .land.has {
  cursor: pointer;
  stroke: rgba(246, 41, 40, 0.55);
  outline: none;
}
.tmap-svg .land.t1 {
  fill: #3a1b1f;
}
.tmap-svg .land.t2 {
  fill: #5a1a1d;
}
.tmap-svg .land.t3 {
  fill: #7d171a;
}
.tmap-svg .land.has:hover,
.tmap-svg .land.has:focus-visible {
  fill: #a31a1c;
  stroke: #ff8a8d;
}
.tmap-svg .land.on {
  fill: var(--red);
  stroke: #ffd0d1;
  stroke-width: 1.2;
}
.tmap-svg .pin {
  pointer-events: none;
}
.tmap-svg .pin .dot {
  fill: var(--red);
  stroke: #0c0d11;
  stroke-width: 2;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.7));
}
.tmap-svg .pin .halo {
  fill: rgba(246, 41, 40, 0.22);
  transform-box: fill-box;
  transform-origin: center;
}
@keyframes pin-in {
  from {
    opacity: 0;
    transform: scale(0.2);
  }
}
@keyframes pulse {
  0% {
    transform: scale(0.7);
    opacity: 0.9;
  }
  100% {
    transform: scale(1.9);
    opacity: 0;
  }
}
.tmap-svg .pin .dot,
.tmap-svg .pin .num {
  transform-box: fill-box;
  transform-origin: center;
  animation: pin-in 0.5s 0.5s var(--ease) backwards;
}
.tmap-svg .pin.urgent .halo {
  animation: pulse 1.8s ease-out infinite;
}
.tmap-svg .pin .num {
  fill: #fff;
  font: 700 11px var(--body);
}
.tmap-svg .pin .where,
.tmap-svg .pin .who {
  opacity: 0;
  paint-order: stroke;
  stroke: #0c0d11;
  stroke-width: 4;
  stroke-linejoin: round;
  transition: opacity 0.3s var(--ease);
}
.tmap-svg .pin .where {
  fill: var(--text);
  font: 700 13px var(--display);
}
.tmap-svg .pin .who {
  fill: var(--muted);
  font: 500 11.5px var(--body);
}
.tmap-svg .pin.named .where,
.tmap-svg.closer .pin.named .who {
  opacity: 1;
}
.tmap-legend {
  position: absolute;
  left: 14px;
  top: 12px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  color: var(--muted);
  background: rgba(15, 16, 19, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  pointer-events: none;
}
.tmap-legend b {
  color: var(--text);
}
.tmap-controls {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: flex;
  gap: 6px;
}
.tmap-controls button {
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: 9px;
  border: 1px solid var(--line-2);
  background: rgba(22, 23, 28, 0.85);
  backdrop-filter: blur(8px);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  transition:
    border-color var(--fast) var(--ease),
    transform var(--fast) var(--ease);
}
.tmap-controls button.wide {
  font-size: 12px;
}
.tmap-controls button:hover {
  border-color: var(--dim);
}
.tmap-controls button:active {
  transform: scale(0.94);
}
.tmap-tip {
  position: absolute;
  z-index: 2;
  max-width: 220px;
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(29, 30, 37, 0.96);
  border: 1px solid var(--line-2);
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, 0.9);
  pointer-events: none;
  font-size: 13px;
}
.tmap-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.tmap-chips .chip-btn b {
  color: #ff8a8d;
}
.tmap-panel {
  animation: rise var(--calm) var(--ease) backwards;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.tmap-list .tender-row {
  flex-wrap: wrap;
  row-gap: 6px;
}
.tmap-list .tender-row > .grow {
  flex-basis: calc(100% - 60px);
}
@media (max-width: 1100px) {
  .tmap.with-panel {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 820px) {
  .seg {
    margin-left: 0;
  }
  .tmap-stage {
    aspect-ratio: 1000 / 760;
    min-height: 0;
  }
}

/* ---- Time strips (Tenders → Deadlines, Projects → Timeline): days run left to right, today is the red line. */
.tl.card {
  padding: 0;
  overflow: hidden;
}
.tl-scroll {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  outline-offset: -2px;
}
.tl-canvas {
  position: relative;
  min-width: 100%;
}
.tl-axis {
  position: relative;
  height: 54px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.tl-months span,
.tl-weeks span {
  position: absolute;
  box-sizing: border-box;
  padding-left: 8px;
  white-space: nowrap;
}
/* The month's name stays in sight while its days scroll past. */
.tl-months em {
  position: sticky;
  left: var(--tl-pin, 8px);
  font-style: normal;
}
.tl-months span {
  top: 8px;
  font-size: 13px;
  color: var(--muted);
  border-left: 1px solid var(--line-2);
  height: 46px;
}
.tl-months b {
  color: var(--text);
  font-family: var(--display);
}
.tl-weeks span {
  top: 31px;
  font-size: 11.5px;
  color: var(--dim);
  padding-left: 6px;
}
.tl-weeks span.now {
  color: #ff8a8d;
  font-weight: 700;
}
.tl-field {
  position: relative;
  padding: 14px 0 10px;
}
.tl-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(to right, var(--line) 1px, transparent 1px);
  opacity: 0.55;
  pointer-events: none;
}
.tl-today {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0;
  border-left: 2px solid var(--red);
  z-index: 2;
  pointer-events: none;
  transform-origin: top;
  animation: grow-y 0.6s var(--ease) backwards;
}
.tl-today span {
  position: absolute;
  top: 0;
  left: 0;
  transform: translate(-50%, -100%);
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.tdl {
  display: grid;
  gap: 14px;
}
.tdl-sum {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.tdl-sum div {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.tdl-sum b {
  font: 700 24px var(--display);
}
.tdl-sum span {
  font-size: 12.5px;
  color: var(--muted);
}
.tdl-sum div:first-child b {
  color: #ff8a8d;
}
.tdl-sum div.none b {
  color: var(--dim);
}
.tdl-body {
  position: relative;
}
.tdl-item {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  padding: 0 10px 0 0;
  margin-left: -6px;
  border-radius: 999px;
  color: var(--text);
  font-size: 13px;
  white-space: nowrap;
  text-decoration: none;
  z-index: 1;
  animation: rise 0.4s var(--ease) backwards;
  transition: background-color var(--fast) var(--ease);
}
.tdl-item:hover,
.tdl-item:focus-visible {
  background: var(--surface-3);
  z-index: 3;
}
.tdl-item i {
  flex: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--dim);
  box-shadow: 0 0 0 3px var(--surface);
}
.tdl-item.strong i {
  background: var(--ok);
}
.tdl-item.fair i {
  background: var(--warn);
}
.tdl-item.soon i {
  box-shadow:
    0 0 0 3px var(--surface),
    0 0 0 5px rgba(246, 41, 40, 0.7);
}
.tdl-item b {
  font-size: 12px;
  color: var(--muted);
}
.tdl-item.strong b {
  color: var(--ok);
}
.tdl-item.fair b {
  color: var(--warn);
}
@media (max-width: 820px) {
  .tdl-sum {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---- Projects → Timeline */
.tabs-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.tabs-row {
  margin-bottom: 16px;
}
.tabs-row > .tabs {
  flex: 1 1 auto;
  min-width: 0;
  margin-bottom: 0;
}
.seg.small button {
  height: 26px;
  padding: 0 11px;
  font-size: 12.5px;
}
.ptl {
  display: grid;
  gap: 12px;
}
.ptl-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 12.5px;
  color: var(--muted);
}
.ptl-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.ptl-legend i {
  display: inline-block;
}
.ptl-legend i.bar {
  width: 22px;
  height: 10px;
  border-radius: 5px;
  background: var(--info);
}
.ptl-legend i.crew {
  width: 22px;
  height: 5px;
  border-radius: 3px;
  background: rgba(236, 237, 242, 0.75);
}
.ptl-legend i.gem,
.ptl-gem {
  width: 9px;
  height: 9px;
  background: var(--text);
  transform: rotate(45deg);
  border-radius: 2px;
}
.ptl-legend i.late {
  width: 22px;
  height: 10px;
  border-radius: 5px;
  border: 1.5px dashed #ff8a8d;
}
.ptl-canvas {
  --tl-pin: 260px;
  position: relative;
  width: max-content;
  min-width: 100%;
}
.ptl-head,
.ptl-row {
  display: flex;
  align-items: stretch;
}
.ptl-head {
  position: relative;
  z-index: 4;
}
.ptl-name {
  position: sticky;
  left: 0;
  z-index: 3;
  flex: none;
  box-sizing: border-box;
  width: 250px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  min-width: 0;
}
.ptl-head .ptl-name {
  border-bottom: 1px solid var(--line);
}
.ptl-name .grow {
  min-width: 0;
}
.ptl-name b,
.ptl-name .small {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ptl-rows {
  position: relative;
}
.ptl-back {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 250px;
  pointer-events: none;
}
.ptl-row {
  position: relative;
  height: 54px;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  transition: background-color var(--fast) var(--ease);
}
.ptl-row:last-child {
  border-bottom: 0;
}
.ptl-row:hover,
.ptl-row:focus-visible {
  background: rgba(255, 255, 255, 0.025);
}
.ptl-row:hover .ptl-name {
  background: var(--surface-2);
}
.ptl-track {
  position: relative;
  flex: none;
}
.ptl-bar {
  position: absolute;
  top: 13px;
  height: 22px;
  box-sizing: border-box;
  border-radius: 7px;
  overflow: clip;
  background: color-mix(in srgb, var(--stage) 30%, var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--stage) 65%, transparent);
  transform-origin: left;
  animation: grow-x 0.55s var(--ease) backwards;
}
/* The part of the project already behind us is the solid colour. */
.ptl-bar i {
  position: absolute;
  inset: 0 auto 0 0;
  background: color-mix(in srgb, var(--stage) 78%, #000);
}
.ptl-bar span {
  position: sticky;
  left: var(--tl-pin);
  z-index: 1;
  display: inline-block;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 600;
  line-height: 20px;
  white-space: nowrap;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}
.ptl-bar.open {
  border-right: 0;
  border-radius: 7px 0 0 7px;
  mask-image: linear-gradient(to right, #000 55%, transparent);
}
.ptl-row.late .ptl-bar {
  border: 1.5px dashed #ff8a8d;
}
.ptl-row.done .ptl-bar {
  opacity: 0.55;
}
.ptl-crew {
  position: absolute;
  top: 39px;
  height: 5px;
  border-radius: 3px;
  background: rgba(236, 237, 242, 0.75);
}
.ptl-gem {
  position: absolute;
  top: 19px;
  margin-left: -5px;
  box-shadow: 0 0 0 2px var(--surface);
  z-index: 1;
}
.ptl-gem.ok {
  background: var(--ok);
}
.ptl-gem.late {
  background: #ff8a8d;
}
@media (max-width: 820px) {
  .ptl-name {
    width: 132px;
    padding: 0 10px;
  }
  .ptl-name .logo-tile {
    display: none;
  }
  .ptl-back {
    left: 132px;
  }
  .ptl-canvas {
    --tl-pin: 140px;
  }
}

/* ---- Clients → Map (the tender map, showing clients) */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

/* ---- Finance → Calendar: money in and out, day by day. */
.mcal-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.mcal-title {
  min-width: 150px;
  text-align: center;
  font: 700 17px var(--display);
}
.mcal-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.mcal-tile {
  display: grid;
  gap: 3px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.mcal-tile b {
  font: 700 21px var(--display);
}
.mcal-tile.in b {
  color: var(--ok);
}
.mcal-tile.out b {
  color: #ff8a8d;
}
.mcal-tile.open b {
  opacity: 0.75;
}
.mcal-tile.net.down b {
  color: #ff8a8d;
}
.mcal {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 16px;
  align-items: start;
  margin-bottom: 10px;
}
.mcal-card {
  padding: 12px;
}
.mcal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}
.mcal-day-name {
  padding: 2px 8px 6px;
  font-size: 11.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--dim);
}
.mcal-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-height: 92px;
  padding: 8px 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  animation: rise 0.35s var(--ease) backwards;
  transition:
    border-color var(--fast) var(--ease),
    background-color var(--fast) var(--ease),
    transform var(--fast) var(--ease);
}
.mcal-cell:not(.has) {
  background: transparent;
}
.mcal-cell.past:not(.has) .mcal-num {
  color: var(--dim);
}
.mcal-cell:hover {
  border-color: var(--line-2);
  background: var(--surface-3);
}
.mcal-cell:active {
  transform: scale(0.98);
}
.mcal-cell[aria-pressed='true'] {
  border-color: var(--text);
}
.mcal-cell.today .mcal-num {
  background: var(--red);
  color: #fff;
}
.mcal-num {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  margin: -2px 0 2px -4px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}
.mcal-late {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ff8a8d;
}
.mcal-chip {
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.mcal-chip.in {
  background: var(--ok-soft);
  color: var(--ok);
}
.mcal-chip.out {
  background: var(--red-soft);
  color: #ff8a8d;
}
.mcal-chip.open {
  background: transparent;
  border-style: dashed;
  border-color: currentColor;
  font-weight: 600;
}
.mcal-bars {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
}
.mcal-bars i {
  display: block;
  height: 3px;
  transform-origin: left;
  animation: grow-x 0.6s 0.2s var(--ease) backwards;
}
.mcal-bars i.in {
  background: var(--ok);
}
.mcal-bars i.out {
  background: #ff8a8d;
}
.mcal-panel .list {
  display: grid;
}
.mcal-entry:hover {
  background: var(--surface-2);
}
.mcal-entry {
  padding: 10px;
  border-radius: 10px;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.mcal-dot {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--ok);
  background: var(--ok);
}
.mcal-dot.out {
  border-color: #ff8a8d;
  background: #ff8a8d;
}
.mcal-dot.open {
  background: transparent;
}
.mcal-amount {
  white-space: nowrap;
}
.mcal-amount.in {
  color: var(--ok);
}
.mcal-amount.out {
  color: #ff8a8d;
}
@media (max-width: 1100px) {
  .mcal {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 820px) {
  .mcal-card {
    padding: 8px;
  }
  .mcal-grid {
    gap: 3px;
  }
  .mcal-day-name {
    padding: 2px 2px 4px;
    font-size: 10px;
    text-align: center;
  }
  .mcal-cell {
    min-height: 66px;
    padding: 5px 3px 8px;
    gap: 2px;
    border-radius: 8px;
  }
  .mcal-num {
    margin: -1px 0 1px -1px;
    font-size: 11.5px;
  }
  .mcal-chip {
    padding: 0 3px;
    font-size: 9.5px;
    letter-spacing: -0.02em;
  }
  .mcal-nav {
    width: 100%;
  }
  .mcal-title {
    flex: 1;
    white-space: nowrap;
  }
}

/* ---- The List / Map / … switches: the chosen view is red, so it is plain there are other views. */
.seg.accent button[aria-pressed='true'] {
  background: var(--red);
  color: #fff;
  box-shadow: 0 2px 10px rgba(228, 33, 33, 0.35);
}
.seg.accent button:not([aria-pressed='true']):hover {
  color: var(--text);
  background: var(--surface-2);
}
/* ---- Scores on the tender map: green strong, amber fair, grey weak (the same colours as the list). */
.tmap-svg .pin .best rect {
  fill: #8b8d9c;
  stroke: #0c0d11;
  stroke-width: 1.5;
}
.tmap-svg .pin .best.strong rect {
  fill: var(--ok);
}
.tmap-svg .pin .best.fair rect {
  fill: var(--warn);
}
.tmap-svg .pin .best text {
  fill: #0c0d11;
  font: 800 9.5px var(--body);
}
.tmap-svg .pin .best {
  animation: fade 0.5s 0.8s var(--ease) backwards;
}
.tmap-svg .pin .sc {
  fill: #a3a5b4;
  font: 700 11.5px var(--body);
}
.tmap-svg .pin .sc.strong {
  fill: var(--ok);
}
.tmap-svg .pin .sc.fair {
  fill: var(--warn);
}
.tmap-key {
  position: absolute;
  left: 14px;
  bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  color: var(--muted);
  background: rgba(15, 16, 19, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  pointer-events: none;
}
.tmap-key span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.tmap-key i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #8b8d9c;
}
.tmap-key i.strong {
  background: var(--ok);
}
.tmap-key i.fair {
  background: var(--warn);
}
.tmap-chips .chip-btn em,
.tmap-tip-scores em {
  display: inline-block;
  margin-left: 7px;
  padding: 0 6px;
  border-radius: 999px;
  font-style: normal;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  background: var(--surface-3);
}
.tmap-chips .chip-btn em.strong,
.tmap-tip-scores em.strong {
  color: var(--ok);
  background: var(--ok-soft);
}
.tmap-chips .chip-btn em.fair,
.tmap-tip-scores em.fair {
  color: var(--warn);
  background: var(--warn-soft);
}
.tmap-tip-scores {
  margin-top: 4px;
}
.tmap-tip-scores em {
  margin: 0 4px 0 0;
}
/* ---- Money calendar: costs still to pay are amber, so they stand apart from what is already paid. */
.mcal-chip.out.open,
.mcal-amount.out.open,
.mcal-tile.out.open b {
  color: var(--warn);
  opacity: 1;
}
.mcal-dot.out.open {
  border-color: var(--warn);
}
@media (max-width: 820px) {
  .tmap-key span:first-child {
    display: none;
  }
}

/* ---- Costs inside a booking (optional). */
.cost-box {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px dashed var(--line-2);
  border-radius: 12px;
}
.cost-box p {
  margin: 0;
}
.cost-line {
  display: grid;
  grid-template-columns: minmax(150px, 1.5fr) minmax(86px, 0.9fr) 84px minmax(0, 1.4fr) 28px;
  gap: 6px;
  align-items: center;
  animation: rise 0.2s var(--ease) backwards;
}
.cost-line .input {
  width: 100%;
  min-width: 0;
}
.cost-box .check-del {
  font-size: 18px;
  color: var(--muted);
}
.cost-kept {
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--surface-2);
}
@media (max-width: 620px) {
  .cost-line {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 28px;
  }
  .cost-line > :nth-child(3) {
    grid-column: 1;
    grid-row: 2;
    width: 100%;
  }
  .cost-line > :nth-child(4) {
    grid-column: 2 / 4;
    grid-row: 2;
  }
  .cost-line > :nth-child(5) {
    grid-column: 3;
    grid-row: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .brand-mark,
  .brand-mark .slate {
    animation: none !important;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001s !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
}

/* ---- Grand Vision Review: deliverable review chips, the client's Reviews page --------------- */
.review-cell {
  white-space: nowrap;
}
.review-cell a.pill {
  text-decoration: none;
}
.review-cell .link.small {
  margin-left: 6px;
  color: var(--dim, #8a8c99);
}
.review-links {
  display: grid;
  gap: 10px;
}
a.review-link {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
a.review-link:hover {
  transform: translateY(-1px);
}
a.review-link .grow {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
a.review-link.waiting {
  border-left: 3px solid #e42121;
}
@media (prefers-reduced-motion: reduce) {
  a.review-link {
    transition: none;
  }
  a.review-link:hover {
    transform: none;
  }
}

/* Bids: the workspace on a tender (checklist, drafts), the bid mode badge */
.bid-items {
  display: flex;
  flex-direction: column;
}
.bid-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.bid-item:first-child {
  border-top: 0;
}
.bid-item.done b {
  text-decoration: line-through;
  color: var(--muted);
}
.bid-tick input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}
.bid-item-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 6px;
}
.bid-item-controls select {
  max-width: 220px;
}
.bid-add select {
  max-width: 170px;
}
.drafts-warning {
  margin: 0;
  padding: 8px 12px;
  border-left: 3px solid var(--warn);
  background: var(--warn-soft);
  border-radius: 6px;
  font-size: 13px;
}
.draft {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.draft summary {
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.draft[open] summary {
  margin-bottom: 8px;
}
.draft-text {
  width: 100%;
  min-height: 180px;
  font: inherit;
  line-height: 1.5;
}
.pill.bid-mode.none {
  background: var(--surface-3);
  color: var(--muted);
}
@media (max-width: 640px) {
  .bid-item-controls select {
    max-width: 100%;
    flex: 1 1 100%;
  }
}
