/* deploy3d desk: readable body, labels and controls; canonical brand colours. */

@font-face {
  font-family: 'Nunito Sans';
  src: url('/assets/NunitoSans-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'Nunito Sans';
  src: url('/assets/NunitoSans-600.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: 'Nunito Sans';
  src: url('/assets/NunitoSans-700.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: 'Nunito Sans';
  src: url('/assets/NunitoSans-800.woff2') format('woff2');
  font-weight: 800;
  font-display: swap;
}

:root {
  --ink: #0C0029;
  --body: #393346;
  --muted: #706A7D;
  --line: #E3DEED;
  --pale: #F4F1FA;
  --pink: #FFF0FA;
  --purple: #AE6ED0;
  --lavender: #8B8BD9;
  --magenta: #FF2ABA;
  --label: #9A398F;
  --white: #FFF;
  --canvas: #FAF9FC;
  --radius: 14px;
  --shadow: 0 12px 40px #190d3910;
  font-family: 'Nunito Sans',sans-serif;
  color: var(--body);
  font-size: 16px;
  line-height: 1.5;
  font-synthesis: none;
  --text-body: 16px;
  --text-secondary: 14px;
  --control-height: 44px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--canvas);
}

button,input,select,textarea {
  font: inherit;
  font-size: 16px;
}

button,a,input,select,textarea {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

a {
  color: var(--label);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button:disabled {
  cursor: wait;
  opacity: .6;
}

button {
  color: inherit;
}

button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible {
  outline: 2px solid transparent;
  outline-offset: 4px;
  box-shadow: 0 0 0 2px white,0 0 0 4px var(--ink);
}

h1,h2,h3,h4,p {
  margin: 0;
}

h1,h2,h3,h4 {
  color: var(--ink);
}

h1 {
  font-size: 32px;
  line-height: 1.2;
  letter-spacing: -1px;
  font-weight: 800;
}

h2 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.3px;
}

h3 {
  font-size: 18px;
  font-weight: 800;
}

small,.small {
  font-size: 14px;
}

svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  vertical-align: middle;
  stroke-width: 1.8;
}

button svg {
  pointer-events: none;
}

.brand-strip {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg,#8B8BD9 0%,#AE6ED0 50%,#FF2ABA 100%);
  z-index: 100;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: -80px;
  z-index: 200;
  padding: 12px;
  background: white;
}

.skip-link:focus {
  top: 12px;
}

.initial-loading {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  color: var(--muted);
}

.loader {
  width: 24px;
  height: 24px;
  border: 2px solid var(--line);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin .9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.sidebar {
  position: fixed;
  top: 6px;
  bottom: 0;
  left: 0;
  width: 260px;
  background: white;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  z-index: 40;
  padding: 22px 16px 18px;
  visibility: visible;
  scroll-padding: 16px;
}

.brand-home {
  display: flex;
  flex-direction: column;
  padding: 0 12px 20px;
  gap: 8px;
}

.brand-home img {
  width: 174px;
  height: auto;
  max-height: 74px;
  object-fit: contain;
}

.brand-home span {
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 1.5px;
  font-weight: 800;
  text-transform: uppercase;
  padding-left: 2px;
}

.nav-label {
  font-size: 14px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--muted);
  padding: 0 16px;
  margin: 13px 0 10px;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 5px;
}

.nav-link {
  width: 100%;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  background: transparent;
  border-radius: 9px;
  color: var(--muted);
  text-align: left;
  font-size: 16px;
  font-weight: 700;
  transition: background .15s,color .15s;
  min-height: 48px;
  line-height: 1.5;
  white-space: normal;
}

.nav-link svg {
  width: 19px;
  height: 19px;
}

.nav-link:hover {
  background: #F8F6FB;
  color: var(--ink);
}

.nav-link.active {
  background: var(--pale);
  color: var(--ink);
}

.nav-link.active svg {
  color: var(--label);
}

.nav-count {
  margin-left: auto;
  font-size: 14px;
  font-weight: 800;
  background: white;
  border: 1px solid var(--line);
  min-width: 26px;
  text-align: center;
  border-radius: 6px;
  padding: 1px 6px;
  color: var(--muted);
}

.nav-link.active .nav-count {
  border-color: #D8CDE7;
  color: var(--label);
}

.sidebar-bottom {
  margin-top: auto;
}

.local-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(145deg,#FBFAFD,var(--pale));
  margin: 22px 7px 18px;
  padding: 15px 13px;
}

.local-card-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
}

.local-card-title svg {
  width: 18px;
  height: 18px;
  color: var(--label);
}

.local-card p {
  font-size: 14px;
  line-height: 1.6;
  margin-top: 7px;
  color: var(--muted);
}

.sidebar-person {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 10px 0;
  border-top: 1px solid var(--line);
}

.avatar {
  width: 34px;
  height: 34px;
  background: var(--ink);
  color: white;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 800;
  flex-shrink: 0;
}

.sidebar-person strong {
  font-size: 14px;
  color: var(--ink);
  display: block;
}

.sidebar-person span {
  font-size: 14px;
  color: var(--muted);
}

.sidebar-person>.icon-button {
  margin-left: auto;
}

.main-shell {
  margin-left: 260px;
  min-height: 100vh;
  padding-top: 6px;
}

.topbar {
  height: auto;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 30px;
  background: #FFFFFFD9;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 6px;
  z-index: 25;
  min-height: 80px;
}

.breadcrumb {
  font-size: 14px;
  display: flex;
  gap: 11px;
  align-items: center;
  color: var(--muted);
  white-space: normal;
  min-width: 0;
  overflow-wrap: anywhere;
}

.breadcrumb svg {
  width: 18px;
  height: 18px;
  color: #B2AABA;
}

.breadcrumb strong {
  font-weight: 700;
  color: var(--ink);
}

.topbar-spacer {
  flex: 1;
}

.search-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  background: var(--canvas);
  padding: 9px 12px;
  border-radius: 8px;
  min-width: 280px;
  text-align: left;
  font-size: 16px;
  color: var(--muted);
  min-height: 44px;
  border-color: var(--muted);
}

.search-trigger svg {
  width: 18px;
  height: 18px;
}

.search-trigger kbd {
  margin-left: auto;
  background: white;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 14px;
  padding: 0 6px;
  font-family: inherit;
  line-height: 24px;
  min-height: 26px;
}

.local-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}

.status-dot {
  width: 6px;
  height: 6px;
  background: var(--purple);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--pale);
}

.mobile-menu {
  display: none;
}

.workspace {
  max-width: 1640px;
  margin: 0 auto;
  padding: 31px 36px 40px;
}

.page-heading {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  justify-content: space-between;
  margin-bottom: 27px;
  flex-wrap: wrap;
}

.eyebrow {
  color: var(--label);
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  display: block;
  margin-bottom: 8px;
}

.page-subtitle {
  font-size: 14px;
  line-height: 1.65;
  color: var(--muted);
  margin-top: 9px;
}

.heading-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
  flex-wrap: wrap;
  max-width: 100%;
  justify-content: flex-end;
}

.btn {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 15px;
  background: white;
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  white-space: normal;
  line-height: 1.5;
  transition: background .15s,transform .15s;
  min-height: 44px;
  max-width: 100%;
  overflow-wrap: anywhere;
  border-color: var(--muted);
}

.btn svg {
  width: 18px;
  height: 18px;
}

.btn:hover {
  background: var(--pale);
  text-decoration: none;
}

.btn.primary {
  background: var(--ink);
  border-color: var(--ink);
  color: white;
  box-shadow: 0 3px 7px #0c002912;
}

.btn.primary:hover {
  background: #261344;
}

.btn.primary:focus-visible {
  outline: 2px solid transparent;
  outline-offset: 4px;
  box-shadow: 0 0 0 2px white,0 0 0 4px var(--ink);
}

.btn.purple {
  background: var(--pale);
  border-color: var(--muted);
  color: #662E81;
}

.btn.small {
  font-size: 16px;
  padding: 10px 12px;
  min-height: 44px;
}

.btn.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  padding: 10px;
  min-height: 44px;
}

.btn.danger {
  color: #A32E55;
  border-color: var(--label);
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  border-radius: 7px;
  padding: 11px;
  color: var(--muted);
  min-width: 44px;
  min-height: 44px;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.icon-button:hover {
  background: var(--pale);
  color: var(--ink);
}

.icon-button svg {
  width: 20px;
  height: 20px;
}

.demo-banner {
  display: grid;
  align-items: start;
  gap: 8px 12px;
  background: var(--pink);
  border: 1px solid #F3D6E9;
  border-radius: 9px;
  padding: 10px 14px;
  margin-bottom: 24px;
  font-size: 14px;
  color: #73405D;
  grid-template-columns: 20px minmax(0,1fr) auto;
}

.demo-banner svg {
  width: 18px;
  height: 18px;
}

.demo-banner a {
  margin-left: auto;
  font-weight: 800;
  color: #762B6B;
  display: inline-flex;
  align-items: center;
  font-size: 16px;
  min-height: 44px;
  padding: 6px 0;
  white-space: normal;
}

.inline-note {
  font-size: 14px;
  color: var(--muted);
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.7;
}

.inline-note svg {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.action-link {
  border: 0;
  background: transparent;
  color: var(--label);
  font-size: 16px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 0;
  min-height: 44px;
  min-width: 44px;
  line-height: 1.5;
  white-space: normal;
  text-align: left;
  overflow-wrap: anywhere;
}

.action-link svg {
  width: 18px;
  height: 18px;
}

.action-link:hover {
  text-decoration: underline;
}

.muted {
  color: var(--muted);
}

.nowrap {
  white-space: nowrap;
}

.numeric {
  font-variant-numeric: tabular-nums;
}

.text-right {
  text-align: right;
}

.upper {
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 14px;
  font-weight: 800;
}

.section-label {
  font-size: 14px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
}

.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 10px 14px;
  justify-content: space-between;
  padding: 21px 22px 18px;
  flex-wrap: wrap;
}

.panel-head h2 {
  font-size: 22px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.panel-head .small {
  font-size: 14px;
}

.panel-pad {
  padding: 20px 22px;
}

.panel-rule {
  border-top: 1px solid var(--line);
}

.count-chip {
  font-size: 14px;
  font-weight: 800;
  min-width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  padding: 1px 7px;
  border-radius: 6px;
  background: var(--pale);
  color: var(--muted);
  margin-left: 5px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 15px;
  margin-bottom: 23px;
}

.metric {
  position: relative;
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 19px 20px 17px;
  min-width: 0;
}

.metric-label {
  font-size: 14px;
  color: var(--muted);
  font-weight: 700;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
  line-height: 1.5;
}

.metric-icon {
  background: var(--pale);
  color: #9361AD;
  border-radius: 8px;
  padding: 6px;
  display: flex;
  flex-shrink: 0;
}

.metric-icon svg {
  width: 18px;
  height: 18px;
}

.metric-value {
  font-size: 32px;
  letter-spacing: -1px;
  line-height: 1.3;
  font-weight: 800;
  color: var(--ink);
  margin-top: 12px;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.metric-foot {
  font-size: 14px;
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.6;
}

.metric-foot strong {
  color: var(--label);
  font-weight: 800;
}

.metric.featured {
  background: var(--ink);
  border-color: var(--ink);
}

.metric.featured .metric-label,.metric.featured .metric-foot {
  color: #C7BBD9;
}

.metric.featured .metric-value {
  color: white;
}

.metric.featured .metric-icon {
  background: #FFFFFF10;
  color: #D1A7E9;
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0,1.45fr) minmax(300px,1fr);
  gap: 23px;
  align-items: start;
}

.stack {
  display: grid;
  gap: 23px;
}

.pipeline-panel {
  grid-column: 1/-1;
}

.pipeline-summary {
  display: grid;
  grid-template-columns: repeat(5,minmax(150px,1fr));
  gap: 0;
  padding: 0 22px 21px;
  overflow-x: auto;
}

.pipeline-step {
  padding: 0 17px;
  border-right: 1px solid var(--line);
}

.pipeline-step:first-child {
  padding-left: 0;
}

.pipeline-step:last-child {
  border: 0;
  padding-right: 0;
}

.pipeline-step-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 9px;
  line-height: 1.5;
  gap: 8px;
}

.pipeline-step-head b {
  color: var(--ink);
  font-size: 14px;
}

.pipeline-step-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -.5px;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.pipeline-bar {
  height: 4px;
  background: var(--pale);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 12px;
}

.pipeline-bar span {
  display: block;
  height: 100%;
  background: var(--lavender);
  min-width: 0;
  border-radius: 3px;
}

.pipeline-step:nth-child(2) .pipeline-bar span {
  background: #AE91D7;
}

.pipeline-step:nth-child(3) .pipeline-bar span {
  background: var(--purple);
}

.pipeline-step:nth-child(4) .pipeline-bar span {
  background: var(--magenta);
}

.pipeline-step:nth-child(5) .pipeline-bar span {
  background: #B6AFBF;
}

.mini-tabs {
  display: flex;
  gap: 8px 20px;
  border-bottom: 1px solid var(--line);
  margin: 0 22px;
  flex-wrap: wrap;
}

.mini-tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  font-weight: 800;
  padding: 10px 0;
  position: relative;
  min-height: 44px;
  line-height: 1.5;
}

.mini-tab.active {
  color: var(--ink);
}

.mini-tab.active:after {
  position: absolute;
  height: 2px;
  background: var(--purple);
  bottom: -1px;
  left: 0;
  right: 0;
  content: '';
}

.attention-list {
  padding: 2px 22px 5px;
}

.attention-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid #F0ECF5;
}

.attention-row:last-child {
  border: 0;
}

.check-control {
  width: 22px;
  height: 22px;
  appearance: auto;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  margin: 0;
  flex-shrink: 0;
  background: transparent;
  position: static;
  min-width: 22px;
  min-height: 22px;
  accent-color: var(--label);
}

.check-control:checked {
  background: transparent;
  border-color: transparent;
}

.attention-body {
  min-width: 0;
  flex: 1;
}

.record-link {
  border: 0;
  background: transparent;
  padding: 6px 0;
  text-align: left;
  color: var(--ink);
  font-weight: 800;
  font-size: 16px;
  line-height: 1.5;
  min-height: 44px;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  white-space: normal;
  overflow-wrap: anywhere;
}

.record-link:hover {
  color: var(--label);
  text-decoration: underline;
}

.attention-meta {
  font-size: 14px;
  color: var(--muted);
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.attention-meta svg {
  width: 18px;
  height: 18px;
}

.due-tag {
  font-size: 14px;
  color: #91446A;
  background: var(--pink);
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 800;
  white-space: normal;
  line-height: 1.5;
}

.due-tag.neutral {
  background: var(--pale);
  color: var(--muted);
}

.project-preview {
  padding: 1px 22px 8px;
}

.project-preview-row {
  padding: 16px 0;
  border-bottom: 1px solid #F0ECF5;
}

.project-preview-row:last-child {
  border: 0;
}

.row-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.project-client {
  font-size: 14px;
  color: var(--muted);
  margin-top: 3px;
}

.progress-track {
  display: flex;
  gap: 4px;
  margin-top: 12px;
}

.progress-track span {
  height: 4px;
  flex: 1;
  background: var(--pale);
  border-radius: 4px;
}

.progress-track span.filled {
  background: var(--purple);
}

.project-preview-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.5;
  flex-wrap: wrap;
  gap: 7px 12px;
}

.activity-list {
  padding: 2px 22px 18px;
}

.activity-item {
  display: flex;
  gap: 12px;
  position: relative;
  padding: 11px 0;
}

.activity-item:before {
  position: absolute;
  left: 12px;
  top: 35px;
  bottom: -10px;
  content: '';
  width: 1px;
  background: var(--line);
}

.activity-item:last-child:before {
  display: none;
}

.activity-symbol {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--pale);
  color: #9C76B7;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.activity-symbol svg {
  width: 18px;
  height: 18px;
}

.activity-text {
  font-size: 16px;
  line-height: 1.65;
  min-width: 0;
  overflow-wrap: anywhere;
}

.activity-time {
  font-size: 14px;
  color: var(--muted);
  margin-top: 3px;
}

.workspace-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 14px;
  color: var(--muted);
  margin-top: 28px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
  line-height: 1.6;
  flex-wrap: wrap;
}

.workspace-footer span {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.workspace-footer svg {
  width: 18px;
  height: 18px;
}

.workspace-footer a {
  font-size: 14px;
  color: var(--muted);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  white-space: normal;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  margin-bottom: 19px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.filter-btn {
  background: white;
  border: 1px solid var(--line);
  font-size: 16px;
  font-weight: 800;
  padding: 9px 13px;
  border-radius: 7px;
  color: var(--muted);
  min-height: 44px;
  line-height: 1.5;
  border-color: var(--muted);
}

.filter-btn.active {
  background: var(--ink);
  border-color: var(--ink);
  color: white;
}

.segmented {
  background: white;
  border: 1px solid var(--line);
  padding: 3px;
  border-radius: 8px;
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
  border-color: var(--muted);
}

.segmented button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 9px 12px;
  border-radius: 5px;
  font-size: 16px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  line-height: 1.5;
}

.segmented button svg {
  width: 18px;
  height: 18px;
}

.segmented button.active {
  background: var(--pale);
  color: var(--ink);
}

.table-wrap {
  overflow: auto;
  overscroll-behavior-inline: contain;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 16px;
  text-align: left;
  min-width: 800px;
}

th {
  color: var(--muted);
  font-size: 14px;
  letter-spacing: .7px;
  text-transform: uppercase;
  font-weight: 800;
  white-space: normal;
  background: #FBFAFD;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  line-height: 1.5;
}

td {
  padding: 16px 18px;
  border-bottom: 1px solid #F0ECF5;
  vertical-align: middle;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

tr:last-child td {
  border-bottom: 0;
}

.table-title {
  font-size: 16px;
  color: var(--ink);
  font-weight: 800;
  max-width: 320px;
}

.table-secondary {
  font-size: 14px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.table-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
}

.table-foot {
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 800;
  padding: 4px 9px;
  border-radius: 5px;
  line-height: 1.5;
  background: var(--pale);
  color: #796786;
}

.badge:before {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  content: '';
}

.badge.new,.badge.planning,.badge.draft {
  background: #F0EEF9;
  color: #73649D;
}

.badge.qualified,.badge.scheduled,.badge.sent {
  background: #F3E8FA;
  color: #6B4586;
}

.badge.quoting,.badge.in-progress {
  background: #FBE8F6;
  color: #AB3A8B;
}

.badge.won,.badge.accepted,.badge.handover {
  background: #EEEAF7;
  color: #6A3D91;
}

.badge.lost,.badge.declined {
  background: #F1EFF3;
  color: var(--muted);
}

.badge.complete {
  background: #EAE6F2;
  color: #58446D;
}

.badge.done {
  background: #EAE6F2;
  color: #58446D;
}

.kanban {
  display: grid;
  grid-template-columns: repeat(5,minmax(260px,1fr));
  gap: 16px;
  overflow: auto;
  padding-bottom: 12px;
  overscroll-behavior-inline: contain;
}

.kanban-column {
  min-height: 370px;
  border-radius: 11px;
  background: #F1EEF6;
  padding: 12px;
  display: flex;
  flex-direction: column;
}

.kanban-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 3px 3px 14px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  gap: 10px;
}

.kanban-heading .count-chip {
  background: white;
  font-size: 14px;
}

.column-total {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  display: block;
  margin-top: 4px;
}

.kanban-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 10px;
  box-shadow: 0 2px 3px #0C002903;
}

.kanban-card:hover {
  border-color: #C9B6D9;
}

.kanban-card .record-link {
  font-size: 16px;
  display: block;
  margin: 9px 0 4px;
}

.card-type {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--label);
  font-weight: 800;
}

.card-client {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 15px;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding-top: 10px;
  border-top: 1px solid var(--pale);
  font-size: 14px;
  color: var(--muted);
  flex-wrap: wrap;
}

.card-value {
  font-size: 16px;
  color: var(--ink);
  font-weight: 800;
}

.card-date {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  line-height: 1.5;
  white-space: normal;
}

.card-date svg {
  width: 18px;
  height: 18px;
}

.stage-select {
  background: var(--pale);
  color: var(--muted);
  font-size: 16px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 5px;
  width: 100%;
  margin-top: 12px;
  min-height: 44px;
  line-height: 1.5;
  border-color: var(--muted);
}

.kanban-empty {
  font-size: 14px;
  color: var(--muted);
  text-align: center;
  padding: 25px 10px;
  border: 1px dashed #DCD5E5;
  border-radius: 8px;
  flex: 1;
  max-height: 100px;
  display: grid;
  place-items: center;
}

.contacts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(min(100%,280px),1fr));
  gap: 17px;
}

.contact-card {
  padding: 21px;
}

.contact-card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 19px;
}

.contact-avatar {
  background: var(--pale);
  color: var(--ink);
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 800;
  flex-shrink: 0;
}

.contact-card-head .icon-button {
  margin-left: auto;
  padding: 1px;
}

.contact-card h2,
.contact-card h3 {
  font-size: 16px;
}

.contact-company {
  font-size: 14px;
  color: var(--muted);
  margin-top: 2px;
}

.contact-info {
  display: grid;
  gap: 11px;
  font-size: 16px;
  color: var(--muted);
  min-height: 49px;
}

.contact-info div {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.contact-info svg {
  width: 18px;
  height: 18px;
  color: #A392B1;
}

.contact-info a {
  overflow-wrap: anywhere;
  color: var(--body);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.contact-stats {
  display: flex;
  gap: 8px 16px;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--muted);
  flex-wrap: wrap;
}

.contact-stats strong {
  font-size: 14px;
  color: var(--ink);
  margin-right: 4px;
}

.empty-state {
  padding: 49px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 640px;
  margin: 0 auto;
}

.empty-icon {
  width: 53px;
  height: 53px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--pale);
  color: #A481B9;
  margin-bottom: 17px;
}

.empty-icon svg {
  width: 25px;
  height: 25px;
}

.empty-state h3,.empty-state h2 {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: normal;
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 16px;
  color: var(--muted);
  line-height: 1.8;
  max-width: 370px;
}

.empty-state .btn {
  margin-top: 20px;
}

.empty-state.compact {
  padding: 33px 22px;
}

.empty-state.compact .empty-icon {
  width: 39px;
  height: 39px;
  border-radius: 12px;
  margin-bottom: 12px;
}

.empty-state.compact .empty-icon svg {
  width: 20px;
  height: 20px;
}

.empty-state.compact h3,.empty-state.compact h2 {
  font-size: 14px;
}

.empty-state.compact p {
  font-size: 16px;
}

.onboarding {
  background: var(--ink);
  border-radius: 14px;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 25px;
  align-items: center;
  padding: 26px 29px;
  margin-bottom: 23px;
  position: relative;
  overflow: hidden;
}

.onboarding:after {
  content: '';
  position: absolute;
  width: 240px;
  height: 240px;
  border: 1px solid #FFFFFF0B;
  border-radius: 50%;
  right: 180px;
  top: -120px;
  box-shadow: 0 0 0 45px #FFFFFF03,0 0 0 90px #FFFFFF03;
  pointer-events: none;
}

.onboarding h2 {
  font-size: 21px;
  color: white;
  margin-bottom: 7px;
  letter-spacing: -.5px;
}

.onboarding p {
  font-size: 16px;
  color: #C2B5D5;
  max-width: 590px;
  line-height: 1.8;
}

.onboarding .eyebrow {
  color: #D3ABEC;
  font-size: 14px;
}

.onboarding-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.onboarding .btn {
  background: white;
  border-color: white;
  color: var(--ink);
}

.onboarding .action-link {
  color: #D1B6DF;
}

.tasks-panel .attention-row {
  padding: 18px 22px;
}

.task-complete .record-link {
  text-decoration: line-through;
  color: var(--muted);
}

.task-group-title {
  font-size: 14px;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--muted);
  padding: 13px 22px;
  background: #FBFAFD;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-weight: 800;
}

.task-group-title:first-child {
  border-top: 0;
}

.task-group-title.overdue {
  color: var(--label);
}

.timeline-list {
  padding: 5px 22px 20px;
}

.timeline-row {
  display: grid;
  grid-template-columns: minmax(180px,1fr) minmax(360px,2fr) 120px;
  gap: 25px;
  align-items: center;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.timeline-row:last-child {
  border: 0;
}

.timeline-progress {
  display: grid;
  grid-template-columns: repeat(5,1fr);
  gap: 4px;
}

.timeline-progress span {
  background: var(--pale);
  height: auto;
  border-radius: 3px;
  font-size: 14px;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 7px 5px;
  line-height: 1.4;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
}

.timeline-progress span.filled {
  background: #E1D3ED;
  color: #6B4586;
}

.timeline-progress span.current {
  background: var(--purple);
  color: var(--ink);
  font-weight: 800;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(min(100%,360px),1fr));
  gap: 22px;
}

.settings-card {
  padding: 24px;
}

.settings-card h2 {
  font-size: 16px;
  margin-top: 13px;
}

.settings-card>p {
  font-size: 16px;
  color: var(--muted);
  line-height: 1.7;
  margin-top: 9px;
}

.settings-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--pale);
  display: grid;
  place-items: center;
  color: #9360AF;
}

.settings-details {
  display: grid;
  gap: 0;
  margin: 20px 0 0;
}

.settings-details div {
  padding: 11px 0;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 8px 16px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  flex-wrap: wrap;
}

.settings-details strong {
  color: var(--ink);
  text-align: right;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.settings-card .btn {
  margin-top: 20px;
}

.settings-card .btn+.btn {
  margin-left: 7px;
}

.settings-full {
  grid-column: 1/-1;
}

.steps-row {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 24px;
  margin-top: 23px;
}

.step-number {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--pale);
  font-size: 14px;
  font-weight: 800;
  color: var(--label);
  margin-bottom: 10px;
}

.steps-row h3 {
  font-size: 14px;
}

.steps-row p {
  font-size: 16px;
  color: var(--muted);
  margin-top: 5px;
  line-height: 1.8;
}

.inline-upload {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.error-panel {
  margin: 20px 0;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
}

.error-panel h1,.error-panel h2 {
  margin: 10px 0;
  font-size: 22px;
  line-height: 1.4;
  letter-spacing: -.3px;
}

.error-panel p {
  font-size: 16px;
  color: var(--muted);
  margin-bottom: 20px;
}

/* Focused record workspace */

.drawer {
  position: fixed;
  inset: 0 0 0 auto;
  margin: 0;
  height: 100dvh;
  max-height: 100dvh;
  width: 700px;
  max-width: 100%;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--line);
  background: var(--canvas);
  box-shadow: -20px 0 70px #0C00291C;
  color: var(--body);
}

.drawer::backdrop,.search-dialog::backdrop {
  background: #0C00294D;
  backdrop-filter: blur(2px);
}

.drawer[open] {
  display: flex;
  flex-direction: column;
  animation: slidein .2s ease-out;
}

@keyframes slidein {
  from {
    transform: translateX(30px);
    opacity: .5;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.drawer-header {
  background: white;
  padding: 24px 27px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  flex-shrink: 0;
}

.drawer-header h2 {
  font-size: 26px;
  letter-spacing: -.6px;
  line-height: 1.3;
}

.drawer-header .eyebrow {
  margin-bottom: 5px;
  font-size: 14px;
}

.drawer-header p {
  font-size: 14px;
  color: var(--muted);
  margin-top: 7px;
  line-height: 1.6;
}

.drawer-form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.drawer-scroll {
  padding: 23px 27px;
  overflow: auto;
  flex: 1;
}

.drawer-footer {
  border-top: 1px solid var(--line);
  padding: 17px 27px;
  background: white;
  display: flex;
  justify-content: space-between;
  gap: 10px 14px;
  align-items: center;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.footer-right {
  display: flex;
  gap: 8px;
  margin-left: auto;
  flex-wrap: wrap;
  min-width: 0;
  max-width: 100%;
}

.form-section {
  margin-bottom: 24px;
}

.form-section:last-child {
  margin-bottom: 0;
}

.form-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 15px;
  flex-wrap: wrap;
}

.form-section-heading h3 {
  font-size: 18px;
  font-weight: 800;
}

.form-section-heading span {
  font-size: 14px;
  color: var(--muted);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field.full {
  grid-column: 1/-1;
}

.field>label,.field-label {
  font-size: 14px;
  font-weight: 800;
  color: var(--body);
  line-height: 1.5;
}

.field-label.optional-label {
  color: var(--muted);
  font-weight: 600;
}

.field>label span {
  font-weight: 600;
  color: var(--muted);
  font-size: 14px;
  margin-left: 4px;
}

.field input,.field select,.field textarea {
  border: 1px solid #DCD5E6;
  border-radius: 7px;
  background: white;
  color: var(--body);
  padding: 10px 11px;
  font-size: 16px;
  min-width: 0;
  width: 100%;
  line-height: 1.5;
  min-height: 44px;
  border-color: var(--muted);
}

.field textarea {
  min-height: 87px;
  resize: vertical;
}

.field input::placeholder,.field textarea::placeholder {
  color: var(--muted);
  font-weight: 400;
  opacity: 1;
}

.field-hint {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}

.form-rule {
  height: 1px;
  background: var(--line);
  margin: 24px 0;
}

.form-message {
  padding: 11px 13px;
  border: 1px solid #E6D7EB;
  background: var(--pale);
  border-radius: 8px;
  font-size: 16px;
  color: #796089;
  margin-bottom: 20px;
  display: flex;
  gap: 8px;
  line-height: 1.65;
}

.form-message svg {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.form-error {
  background: var(--pink);
  border: 1px solid #E9C8DC;
  border-radius: 7px;
  padding: 11px;
  font-size: 16px;
  color: #98325F;
  margin-bottom: 16px;
  display: none;
  line-height: 1.6;
}

.form-error.visible {
  display: block;
}

.checkbox-field {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 16px;
  color: var(--muted);
  line-height: 1.6;
  min-height: 44px;
  padding: 6px 0;
  cursor: pointer;
}

.checkbox-field input {
  accent-color: var(--label);
  margin-top: 3px;
}

.danger-text {
  font-size: 16px;
  color: #A34566;
  border: 0;
  background: transparent;
  padding: 10px 0;
  min-height: 44px;
}

.record-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 21px;
}

.quote-drawer {
  width: 820px;
}

.line-items {
  display: grid;
  gap: 12px;
}

.quote-line {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
}

.quote-line-top {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.quote-line-top .field {
  flex: 1;
}

.quote-line .icon-button {
  min-width: 44px;
}

.quote-line-grid {
  display: grid;
}

.quote-line-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.quote-line-bottom .checkbox-field {
  font-size: 14px;
}

.quote-line-total {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
}

.quote-line-meta {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  border-top: 1px solid var(--pale);
}

.quote-line details {
  color: var(--muted);
}

.quote-line summary {
  cursor: pointer;
  font-weight: 700;
}

.quote-line label {
  font-size: 14px;
}

.quote-totals {
  background: var(--ink);
  color: white;
  border-radius: 10px;
  padding: 19px 20px;
  margin-top: 18px;
}

.total-row {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  font-size: 14px;
  padding: 3px 0;
  color: #D9CFE5;
}

.total-row.final {
  font-size: 22px;
  font-weight: 800;
  color: white;
  margin-top: 10px;
  padding-top: 13px;
  border-top: 1px solid #FFFFFF20;
  letter-spacing: -.4px;
}

.quote-internal {
  justify-content: space-between;
}

.check-row {
  display: flex;
  gap: 15px;
  align-items: center;
}

.drawer-link-strip {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 14px;
  color: var(--muted);
  padding: 12px 14px;
  background: var(--pale);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 20px;
}

.drawer-link-strip svg {
  width: 18px;
  height: 18px;
}

.search-dialog {
  top: 12dvh;
  bottom: auto;
  width: 720px;
  max-width: calc(100% - 30px);
  max-height: calc(88dvh - 12px);
  margin: 0 auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 15px;
  box-shadow: var(--shadow);
  background: white;
  color: var(--body);
  overflow: hidden;
}

.search-dialog[open] {
  display: flex;
  flex-direction: column;
}

.search-head {
  display: flex;
  gap: 12px;
  padding: 18px 20px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
  min-width: 0;
}

.search-head svg {
  color: var(--purple);
}

.search-head input {
  border: 0;
  background: transparent;
  font-size: 16px;
  color: var(--ink);
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 8px 6px;
}

.search-head .icon-button {
  padding: 2px;
}

.search-results {
  max-height: 55dvh;
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 8px;
}

.search-group {
  font-size: 14px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 800;
  padding: 11px 12px 6px;
}

.search-result {
  border: 0;
  background: white;
  display: flex;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  text-align: left;
  min-height: 64px;
}

.search-result:hover,.search-result:focus-visible {
  background: var(--pale);
}

.search-result svg {
  width: 18px;
  height: 18px;
  color: #A184B4;
  flex-shrink: 0;
}

.search-result>div {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.search-result strong {
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  display: block;
  overflow-wrap: anywhere;
}

.search-result span {
  font-size: 14px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.search-footer {
  padding: 10px 19px;
  background: var(--canvas);
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  flex: 0 0 auto;
}

.toasts {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: grid;
  gap: 9px;
  z-index: 150;
  max-width: calc(100% - 35px);
}

.toast {
  padding: 13px 18px;
  background: var(--ink);
  color: white;
  border: 1px solid #37234E;
  border-radius: 9px;
  box-shadow: 0 8px 30px #0C00292A;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  animation: toastin .2s ease-out;
  max-width: 460px;
}

.toast svg {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  color: #D4AFE5;
}

.toast>span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.dialog-notices {
  display: grid;
  flex: 0 0 auto;
  align-self: stretch;
  gap: 8px;
  width: 100%;
  min-width: 0;
  min-height: 0;
  max-height: min(30dvh,168px);
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: white;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.dialog-notices:empty {
  display: none;
}

.dialog-notices .toast {
  width: 100%;
  min-width: 0;
  max-width: none;
  padding: 10px 12px;
  align-items: flex-start;
  font-size: 16px;
  line-height: 1.5;
  box-shadow: none;
  animation: none;
}

.dialog-notices .toast>svg {
  flex-shrink: 0;
  margin-top: 3px;
}

.dialog-notices .toast button {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
}

.toast.error {
  background: #682848;
}

.toast button {
  color: #D8CEDF;
  background: transparent;
  border: 0;
  padding: 0;
  margin-left: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  flex-shrink: 0;
}

.toast button svg {
  width: 20px;
  height: 20px;
}

@keyframes toastin {
  from {
    transform: translateY(8px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.nav-link>span:not(.nav-count) {
  min-width: 0;
  flex: 1;
  overflow-wrap: anywhere;
}

.sidebar-person>div:not(.avatar) {
  min-width: 0;
  overflow-wrap: anywhere;
}

.sidebar-close {
  display: none;
  position: absolute;
  top: 12px;
  right: 10px;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 10px;
  border: 0;
  border-radius: 8px;
  background: white;
  color: var(--ink);
}

.page-heading>div:first-child {
  flex: 1 1 380px;
  min-width: 0;
}

.task-check-target {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  flex-shrink: 0;
  border-radius: 8px;
  cursor: pointer;
}

.task-check-target:focus-within {
  outline: 2px solid transparent;
  outline-offset: 4px;
  box-shadow: 0 0 0 2px white,0 0 0 4px var(--ink);
}

.task-check-target .check-control:focus-visible {
  outline: none;
  box-shadow: none;
}

.check-control::before,.check-control::after {
  content: none;
  display: none;
}

.checkbox-field input,.field input[type="checkbox"] {
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  padding: 0;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--label);
}

.kanban:has(>.kanban-column:only-child) {
  grid-template-columns: minmax(260px,1fr);
  max-width: 560px;
}

.contact-card-head>div {
  min-width: 0;
  flex: 1;
  overflow-wrap: anywhere;
}

.table-wrap:focus-visible,.kanban:focus-visible,.calendar-scroll:focus-visible,.pipeline-summary:focus-visible {
  outline: 2px solid transparent;
  outline-offset: -4px;
  box-shadow: inset 0 0 0 2px white,inset 0 0 0 4px var(--ink);
}

.topbar .mobile-menu {
  display: none;
}

.drawer-header>div {
  min-width: 0;
  flex: 1;
  overflow-wrap: anywhere;
}

@media(min-width:1550px) {
  .workspace {
    padding: 35px 43px 45px;
  }

  .topbar {
    padding: 0 43px;
  }

  .metric {
    padding: 22px;
  }

  .overview-grid {
    grid-template-columns: minmax(0,1.45fr) minmax(370px,1fr);
  }
}

@media(max-width:1240px) {
  .sidebar {
    width: 248px;
    padding-left: 12px;
    padding-right: 12px;
  }

  .brand-home {
    padding-left: 13px;
  }

  .brand-home img {
    width: 164px;
  }

  .main-shell {
    margin-left: 248px;
  }

  .workspace {
    padding: 28px 25px 35px;
  }

  .topbar {
    padding: 0 25px;
  }

  .overview-grid {
    grid-template-columns: minmax(0,1.1fr) minmax(280px,1fr);
    gap: 18px;
  }

  .stack {
    gap: 18px;
  }

  .metric-grid {
    gap: 11px;
  }

  .metric {
    padding: 16px;
  }

  .metric-value {
    font-size: 32px;
  }

  .metric-label {
    font-size: 14px;
  }

  .metric-icon {
    padding: 5px;
  }

  .metric-foot {
    font-size: 14px;
  }

  .contacts-grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }

  .onboarding {
    grid-template-columns: 1fr;
    padding: 24px;
  }

  .onboarding-actions {
    margin-top: 0;
  }

  .search-trigger {
    min-width: 240px;
  }

  .page-heading {
    align-items: flex-start;
  }

  .pipeline-step {
    padding: 0 11px;
  }

  .pipeline-step-value {
    font-size: 22px;
  }

  .settings-grid {
    gap: 17px;
  }

  .timeline-row {
    gap: 15px;
    grid-template-columns: minmax(150px,1fr) minmax(180px,1.5fr) 90px;
  }
}

@media(max-width:1000px) {
  .sidebar {
    width: 248px;
    padding-left: 9px;
    padding-right: 9px;
  }

  .brand-home {
    padding-left: 5px;
    padding-right: 5px;
  }

  .brand-home img {
    width: 160px;
  }

  .brand-home span {
    font-size: 14px;
  }

  .main-shell {
    margin-left: 248px;
  }

  .nav-link {
    font-size: 16px;
    padding: 11px 12px;
    gap: 10px;
  }

  .workspace {
    padding: 24px 22px 30px;
  }

  .topbar {
    padding: 0 22px;
    gap: 15px;
  }

  .breadcrumb {
    font-size: 14px;
  }

  .search-trigger {
    min-width: 240px;
    width: 240px;
    font-size: 16px;
  }

  .local-pill {
    display: none;
  }

  .overview-grid {
    grid-template-columns: 1fr;
  }

  .overview-grid>.stack {
    display: contents;
  }

  .pipeline-panel {
    grid-column: auto;
  }

  .metric-grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }

  .metric-value {
    font-size: 32px;
  }

  .metric-label {
    font-size: 14px;
  }

  .metric-foot {
    font-size: 14px;
  }

  .page-heading h1 {
    font-size: 28px;
  }

  .heading-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: 100%;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .settings-full {
    grid-column: auto;
  }

  .toolbar {
    align-items: flex-start;
  }

  .filter-group {
    gap: 5px;
  }

  .filter-btn {
    font-size: 16px;
    padding: 7px 8px;
  }

  .timeline-progress span {
    font-size: 14px;
  }

  .workspace-footer {
    font-size: 14px;
  }

  .workspace-footer a {
    font-size: 14px;
  }
}

@media(max-width:760px) {
  .sidebar {
    transform: translateX(-100%);
    width: 280px;
    transition: transform .2s;
    box-shadow: 10px 0 40px #0C00291A;
    padding: 27px 18px 20px;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .brand-home {
    padding: 0 14px 28px;
  }

  .brand-home img {
    width: 174px;
  }

  .brand-home span {
    font-size: 14px;
  }

  .nav-link {
    font-size: 16px;
    padding: 11px 14px;
  }

  .mobile-scrim {
    position: fixed;
    inset: 0;
    background: #0C002950;
    z-index: 35;
    display: none;
  }

  .mobile-scrim.open {
    display: block;
  }

  .main-shell {
    margin-left: 0;
  }

  .topbar {
    height: 65px;
  }

  .mobile-menu {
    display: inline-flex;
  }

  .breadcrumb {
    gap: 7px;
  }

  .breadcrumb>span,.breadcrumb>svg {
    display: none;
  }

  .search-trigger {
    background: transparent;
    border: 0;
  }

  .search-trigger>span,.search-trigger kbd {
    display: none;
  }

  .search-trigger svg {
    width: 20px;
    height: 20px;
  }

  .topbar-spacer {
    flex: 1;
  }

  .workspace {
    padding: 24px 18px 30px;
  }

  .page-heading {
    gap: 12px;
    flex-direction: column;
    margin-bottom: 22px;
  }

  .page-heading h1 {
    font-size: 28px;
  }

  .heading-actions {
    max-width: 100%;
    justify-content: flex-start;
    flex-wrap: nowrap;
    width: 100%;
  }

  .heading-actions .btn {
    flex: 1;
    font-size: 16px;
    padding: 10px 12px;
  }

  .page-subtitle {
    font-size: 14px;
    margin-top: 7px;
  }

  .eyebrow {
    font-size: 14px;
    margin-bottom: 7px;
  }

  .metric-grid {
    gap: 11px;
    margin-bottom: 18px;
  }

  .metric {
    padding: 15px;
  }

  .metric-value {
    font-size: 32px;
    margin-top: 10px;
  }

  .metric-label {
    font-size: 14px;
    gap: 5px;
  }

  .metric-icon {
    padding: 4px;
  }

  .metric-icon svg {
    width: 18px;
    height: 18px;
  }

  .metric-foot {
    font-size: 14px;
  }

  .overview-grid {
    gap: 18px;
  }

  .pipeline-summary {
    overflow: auto;
    grid-template-columns: repeat(5,minmax(150px,1fr));
    padding: 0 18px 20px;
  }

  .pipeline-step-head {
    font-size: 14px;
  }

  .pipeline-step-value {
    font-size: 22px;
  }

  .panel-head {
    padding: 18px;
  }

  .panel-head h2 {
    font-size: 22px;
  }

  .attention-list,.project-preview,.activity-list {
    padding-left: 18px;
    padding-right: 18px;
  }

  .mini-tabs {
    margin-left: 18px;
    margin-right: 18px;
  }

  .attention-row {
    padding: 16px 0;
  }

  .panel {
    border-radius: 12px;
  }

  .workspace-footer {
    align-items: flex-start;
    line-height: 1.6;
    gap: 12px;
    font-size: 14px;
  }

  .workspace-footer>span {
    max-width: 100%;
  }

  .workspace-footer a {
    white-space: normal;
  }

  .onboarding {
    padding: 22px;
    margin-bottom: 18px;
    gap: 18px;
  }

  .onboarding h2 {
    font-size: 20px;
  }

  .onboarding-actions {
    gap: 15px;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .onboarding p {
    font-size: 16px;
  }

  .demo-banner {
    font-size: 14px;
    align-items: flex-start;
    margin-bottom: 19px;
  }

  .demo-banner a {
    white-space: nowrap;
    font-size: 14px;
  }

  .toolbar {
    gap: 14px;
    flex-wrap: wrap;
  }

  .toolbar>.segmented {
    margin-left: auto;
  }

  .filter-group {
    gap: 6px;
  }

  .filter-btn {
    font-size: 16px;
    padding: 6px 8px;
  }

  .contacts-grid {
    grid-template-columns: 1fr;
  }

  .contact-card {
    padding: 19px;
  }

  .kanban {
    grid-template-columns: repeat(5,minmax(260px,1fr));
    gap: 12px;
    margin-right: -18px;
    padding-right: 18px;
  }

  .kanban-column {
    min-height: 330px;
  }

  .table-wrap table {
    min-width: 800px;
  }

  th {
    padding: 12px 15px;
  }

  td {
    padding: 15px;
  }

  .table-foot {
    font-size: 14px;
  }

  .drawer-header {
    padding: 21px 20px 18px;
  }

  .drawer-header h2 {
    font-size: 22px;
  }

  .drawer-scroll {
    padding: 20px;
  }

  .drawer-footer {
    padding: 15px 20px;
  }

  .drawer-footer .btn {
    padding: 10px 12px;
  }

  .form-grid {
    gap: 14px;
  }

  .field input,.field select,.field textarea {
    font-size: 16px;
    padding: 10px;
  }

  .field>label {
    font-size: 14px;
  }

  .field-hint {
    font-size: 14px;
  }

  .form-section-heading h3 {
    font-size: 18px;
  }

  .drawer-header p {
    font-size: 14px;
  }

  .quote-line-meta .field:last-child {
    grid-column: 1/-1;
  }

  .quote-line .field input,.quote-line .field select {
    font-size: 16px;
  }

  .quote-line label {
    font-size: 14px;
  }

  .quote-line-bottom {
    align-items: flex-start;
  }

  .check-row {
    gap: 8px;
    flex-wrap: wrap;
  }

  .quote-line-bottom .checkbox-field {
    font-size: 14px;
  }

  .quote-line-total {
    font-size: 14px;
  }

  .form-message {
    font-size: 16px;
  }

  .drawer-link-strip {
    font-size: 14px;
  }

  .tasks-panel .attention-row {
    padding: 17px 18px;
  }

  .timeline-row {
    grid-template-columns: 1fr 85px;
    gap: 10px;
    padding: 18px 0;
  }

  .timeline-row>.timeline-progress {
    grid-column: 1/-1;
    grid-row: 2;
  }

  .timeline-progress span {
    font-size: 14px;
  }

  .timeline-row>.text-right {
    grid-column: 2;
    grid-row: 1;
  }

  .timeline-list {
    padding: 0 18px 14px;
  }

  .steps-row {
    grid-template-columns: 1fr;
    gap: 19px;
  }

  .steps-row>div {
    position: relative;
    padding-left: 38px;
  }

  .step-number {
    position: absolute;
    left: 0;
    top: 0;
  }

  .settings-card {
    padding: 21px;
  }

  .settings-details div {
    font-size: 14px;
  }

  .toasts {
    right: 16px;
    bottom: 16px;
  }

  .search-dialog {
    top: 6vh;
  }

  .search-head input {
    font-size: 16px;
  }

  .record-actions .btn {
    font-size: 16px;
  }

  .empty-state {
    padding: 39px 20px;
  }

  .empty-state h3,.empty-state h2 {
    font-size: 15px;
  }

  .empty-state p {
    font-size: 16px;
  }
}

@media(prefers-reduced-motion:reduce) {
  *,*:before,*:after {
    animation: none!important;
    transition: none!important;
    scroll-behavior: auto!important;
  }
}

@media print {
  .sidebar,.topbar,.brand-strip,.workspace-footer,.heading-actions,.toolbar,.drawer,.toasts {
    display: none!important;
  }

  .main-shell {
    margin: 0;
    padding: 0;
  }

  .workspace {
    padding: 0;
  }

  .panel {
    break-inside: avoid;
  }

  body {
    background: white;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none!important;
}

.login-shell {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 35px 20px;
  background: radial-gradient(ellipse at 15% 20%,#EDE5F5,transparent 60%),var(--canvas);
}

.login-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 43px;
  max-width: 470px;
  width: 100%;
  box-shadow: var(--shadow);
}

.login-card>img {
  width: 180px;
  height: auto;
  margin-bottom: 32px;
}

.login-card h1 {
  font-size: 28px;
  margin-top: 12px;
  line-height: 1.2;
}

.login-card>p {
  font-size: 16px;
  color: var(--muted);
  line-height: 1.9;
  margin-top: 13px;
}

.login-card form {
  margin-top: 27px;
}

.login-card .btn {
  width: 100%;
  margin-top: 17px;
  font-size: 16px;
  padding: 12px;
}

.login-card .field input {
  font-size: 16px;
  padding: 12px;
}

.login-card .login-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 25px;
  font-size: 14px;
}

.login-foot svg {
  width: 18px;
  height: 18px;
}

.quote-line details[open] summary {
  color: var(--label);
}

/* Checklists, dates and local mail intake */

.checklist-box {
  padding: 16px;
  background: var(--pale);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.checklist-controls {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.checklist-controls>.field {
  flex: 1 1 240px;
}

.checklist-controls>.btn {
  margin-bottom: 1px;
  padding: 10px 12px;
}

.schedule-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 17px;
}

.calendar-navigation {
  display: flex;
  align-items: center;
  gap: 20px;
}

.calendar-navigation h2 {
  font-size: 22px;
  min-width: 170px;
}

.calendar-nav-buttons {
  display: flex;
  align-items: center;
  gap: 4px;
}

.reverse-icon {
  display: flex;
  transform: rotate(180deg);
}

.schedule-summary {
  display: flex;
  align-items: center;
  gap: 23px;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 17px;
}

.schedule-summary>span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.schedule-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--lavender);
}

.schedule-dot.tasks {
  background: var(--lavender);
}

.schedule-dot.projects {
  background: var(--purple);
}

.schedule-dot.enquiries {
  background: var(--magenta);
}

.calendar-scroll {
  min-width: 0;
  overflow: auto;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7,minmax(150px,1fr));
  min-width: 1050px;
  background: #FBFAFD;
  border-bottom: 1px solid var(--line);
}

.calendar-weekdays span {
  padding: 13px 13px;
  font-size: 14px;
  letter-spacing: .7px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 800;
  border-right: 1px solid #F1ECF6;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7,minmax(150px,1fr));
  min-width: 1050px;
}

.calendar-day {
  min-height: 170px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  background: white;
  min-width: 0;
}

.calendar-day:nth-child(7n) {
  border-right: 0;
}

.calendar-day:nth-last-child(-n+7) {
  border-bottom: 0;
}

.calendar-day.outside {
  background: #FBFAFD;
}

.calendar-day.outside .calendar-day-add {
  color: var(--muted);
}

.calendar-day.is-today {
  background: #FAF5FD;
}

.calendar-day-add {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 0;
  background: transparent;
  width: 100%;
  padding: 0 2px 8px;
  color: var(--body);
  min-height: 44px;
  font-size: 16px;
}

.calendar-day-add>span {
  font-size: 16px;
  font-weight: 800;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 7px;
}

.calendar-day-add svg {
  color: var(--muted);
  width: 20px;
  height: 20px;
  opacity: 1;
  transition: opacity .15s;
}

.calendar-day-add:hover svg,.calendar-day-add:focus-visible svg {
  opacity: 1;
}

.is-today .calendar-day-add>span {
  background: var(--ink);
  color: white;
}

.calendar-events {
  display: grid;
  gap: 4px;
}

.calendar-event {
  border: 1px solid #E7E0F1;
  background: #F4F1FA;
  padding: 8px;
  display: flex;
  align-items: flex-start;
  gap: 7px;
  width: 100%;
  border-radius: 4px;
  text-align: left;
  font-size: 16px;
  color: #67577F;
  line-height: 1.4;
  min-width: 0;
  min-height: 44px;
}

.calendar-event .schedule-dot {
  width: 5px;
  height: 5px;
  margin-top: 8px;
}

.calendar-event span {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow-wrap: anywhere;
}

.calendar-event.projects {
  background: #F6EDF9;
  border-color: #EDDEF2;
  color: #815592;
}

.calendar-event.enquiries {
  background: #FFF0FA;
  border-color: #F5DFEF;
  color: #9D497F;
}

.calendar-event:hover {
  filter: brightness(.98);
  border-color: #C8B6DA;
}

.calendar-more {
  border: 0;
  background: transparent;
  font-size: 16px;
  color: var(--label);
  font-weight: 800;
  text-align: left;
  padding: 8px 4px;
  min-height: 44px;
}

.calendar-mobile-hint {
  display: none;
}

.agenda-date {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 17px 22px;
  background: #FBFAFD;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.agenda-date:first-child {
  border-top: 0;
}

.agenda-date>div {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.agenda-date h2 {
  font-size: 18px;
}

.agenda-date .field-hint {
  font-size: 14px;
}

.agenda-number {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  background: white;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
}

.agenda-number.current {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}

.agenda-item {
  display: flex;
  align-items: center;
  gap: 17px;
  padding: 17px 22px;
  border-bottom: 1px solid #F0ECF5;
}

.agenda-item:last-child {
  border-bottom: 0;
}

.agenda-kind {
  font-size: 14px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 130px;
  line-height: 1.5;
}

.agenda-item .field-hint {
  font-size: 14px;
  margin-top: 3px;
}

.agenda-empty-action {
  padding: 0 22px 25px;
  display: flex;
  justify-content: center;
  margin-top: -20px;
}

.mail-setup-note {
  padding: 14px;
  background: var(--pale);
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.8;
  margin-top: 16px;
}

.mail-setup-note p {
  margin: 0;
}

.mail-setup-note code {
  display: block;
  padding: 9px 10px;
  border: 1px solid var(--line);
  background: white;
  border-radius: 6px;
  color: var(--ink);
  font-size: 14px;
  overflow-wrap: anywhere;
  white-space: normal;
  margin: 10px 0;
  line-height: 1.6;
}

.mail-setup-note .action-link {
  margin-top: 8px;
}

.mail-connection-error {
  display: flex;
  gap: 8px;
  background: var(--pink);
  border: 1px solid #EED7E6;
  border-radius: 8px;
  padding: 12px;
  font-size: 14px;
  color: #9A396F;
  margin-top: 14px;
  overflow-wrap: anywhere;
}

.mail-connection-error svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
}

@media(max-width:1240px) {
  .calendar-navigation {
    gap: 12px;
  }

  .calendar-navigation h2 {
    font-size: 22px;
    min-width: 145px;
  }

  .calendar-day {
    min-height: 170px;
  }

  .calendar-event {
    font-size: 16px;
  }

  .calendar-day-add>span {
    font-size: 16px;
  }

}

@media(max-width:760px) {
  .schedule-toolbar {
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
  }

  .calendar-navigation {
    justify-content: space-between;
    width: 100%;
  }

  .calendar-navigation h2 {
    font-size: 22px;
  }

  .schedule-toolbar>.segmented {
    margin-left: auto;
  }

  .schedule-summary {
    font-size: 14px;
    gap: 16px;
    row-gap: 8px;
  }

  .calendar-mobile-hint {
    display: block;
  }

  .calendar-day {
    min-height: 170px;
  }

  .calendar-event {
    font-size: 16px;
  }

  .calendar-day-add>span {
    font-size: 16px;
  }

  .calendar-day-add svg {
    opacity: 1;
  }

  .calendar-weekdays span {
    font-size: 14px;
  }

  .agenda-date {
    padding: 15px 17px;
  }

  .agenda-date h2 {
    font-size: 18px;
  }

  .agenda-date>.action-link {
    font-size: 16px;
  }

  .agenda-item {
    padding: 16px 17px;
    gap: 10px;
    flex-wrap: wrap;
  }

  .agenda-kind {
    min-width: 100%;
    font-size: 14px;
  }

  .agenda-item .attention-body {
    flex-basis: calc(100% - 110px);
  }

  .agenda-item .record-link {
    font-size: 16px;
  }

  .checklist-box {
    padding: 14px;
  }

  .checklist-controls {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .checklist-controls>.btn {
    align-self: flex-start;
  }

  .checklist-controls .field select {
    font-size: 16px;
  }

  .mail-setup-note,.mail-connection-error {
    font-size: 14px;
  }

  .mail-setup-note code {
    font-size: 14px;
  }
}

.sidebar {
  overflow-y: auto;
  overscroll-behavior: contain;
}

.brand-home,.sidebar-bottom {
  flex-shrink: 0;
}

/* Unsaved edits: focused confirmation without leaving the record workspace. */

.unsaved-dialog {
  position: fixed;
  inset: 0;
  width: min(560px,calc(100% - 32px));
  max-width: 560px;
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  color: var(--body);
  box-shadow: 0 24px 90px #0C002933;
  overflow: hidden;
}

.unsaved-dialog[open] {
  display: flex;
  flex-direction: column;
}

.unsaved-dialog::before {
  content: '';
  display: block;
  flex: 0 0 6px;
  background: linear-gradient(90deg,#8B8BD9 0%,#AE6ED0 50%,#FF2ABA 100%);
}

.unsaved-dialog::backdrop {
  background: #0C002961;
  backdrop-filter: blur(2px);
}

.unsaved-dialog-body {
  padding: 28px 28px 25px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.unsaved-dialog-body>.eyebrow {
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 10px;
}

.unsaved-dialog h2 {
  font-size: 26px;
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: -.6px;
  margin-bottom: 17px;
}

#unsaved-description {
  font-size: 16px;
  line-height: 1.65;
  color: var(--body);
  overflow-wrap: anywhere;
}

#unsaved-save-hint {
  font-size: 14px;
  line-height: 1.65;
  color: var(--muted);
  margin-top: 15px;
  overflow-wrap: anywhere;
}

.unsaved-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 19px 28px 23px;
  background: var(--pale);
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}

.unsaved-dialog-actions .btn {
  min-height: 44px;
  font-size: 16px;
  line-height: 1.4;
  padding: 11px 13px;
  border-color: var(--muted);
  white-space: normal;
}

.unsaved-dialog-actions .btn.primary {
  border-color: var(--ink);
}

.unsaved-dialog-actions .unsaved-discard {
  background: var(--pink);
  border-color: var(--label);
  color: var(--ink);
}

.unsaved-dialog-actions .unsaved-discard:hover {
  background: #F9E2F1;
}

.unsaved-dialog button:focus-visible,.drawer-footer.unsaved-footer button:focus-visible,.unsaved-quote-note a:focus-visible {
  outline: 2px solid transparent;
  outline-offset: 4px;
  box-shadow: 0 0 0 2px white,0 0 0 4px var(--ink);
}

.drawer-footer.unsaved-footer {
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.drawer-footer.unsaved-footer>.footer-right {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: 100%;
  min-width: 0;
}

.drawer-footer.unsaved-footer .btn {
  min-height: 44px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.drawer-footer.unsaved-footer .danger-text {
  min-height: 44px;
  font-size: 16px;
  flex-shrink: 0;
}

.unsaved-indicator {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border-radius: 6px;
  background: var(--pale);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.4;
  font-weight: 700;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.unsaved-indicator::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--label);
  flex-shrink: 0;
}

.unsaved-quote-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 0 0 18px;
  padding: 12px 14px;
  border-left: 3px solid var(--label);
  border-radius: 0 7px 7px 0;
  background: var(--pink);
  font-size: 14px;
  line-height: 1.65;
  color: var(--body);
  overflow-wrap: anywhere;
}

.unsaved-quote-note svg {
  width: 18px;
  height: 18px;
  margin-top: 3px;
  flex-shrink: 0;
  color: var(--label);
}

@media(max-width:560px) {
  .unsaved-dialog {
    width: calc(100% - 24px);
    max-height: calc(100dvh - 24px);
    border-radius: 12px;
  }

  .unsaved-dialog-body {
    padding: 23px 21px;
  }

  .unsaved-dialog h2 {
    font-size: 24px;
  }

  .unsaved-dialog-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 9px;
    padding: 17px 21px 21px;
  }

  .unsaved-dialog-actions>.btn {
    width: 100%;
  }

  .drawer-footer.unsaved-footer {
    gap: 9px 12px;
  }

  .drawer-footer.unsaved-footer>.footer-right {
    width: 100%;
    margin-left: 0;
  }

  .drawer-footer.unsaved-footer>.footer-right>.btn {
    flex: 0 1 auto;
    min-width: 88px;
    font-size: 16px;
  }

  .drawer-footer.unsaved-footer>.footer-right>.btn.primary {
    flex: 1 1 0;
    min-width: 0;
  }

  .unsaved-indicator {
    margin-left: auto;
    font-size: 14px;
  }

  .unsaved-quote-note {
    font-size: 14px;
    padding: 11px 12px;
  }

  .quote-line-meta {
    grid-template-columns: minmax(0,1fr);
  }

  .quote-line-meta .field:last-child {
    grid-column: auto;
  }

  .calendar-navigation {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 12px;
  }

  .calendar-navigation h2 {
    min-width: 0;
    max-width: 100%;
  }

  .calendar-nav-buttons {
    flex: 0 0 auto;
    flex-wrap: nowrap;
    gap: 8px;
    width: auto;
    max-width: 100%;
  }

  .calendar-nav-buttons .icon-button {
    flex: 0 0 44px;
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
  }

  .calendar-nav-buttons .btn {
    flex: 0 0 64px;
    width: 64px;
    min-width: 64px;
    min-height: 44px;
    padding: 9px 8px;
    white-space: nowrap;
  }
}

@media(forced-colors:active) {
  .unsaved-dialog button:focus-visible,.drawer-footer.unsaved-footer button:focus-visible,.unsaved-quote-note a:focus-visible {
    outline: 2px solid Highlight;
    box-shadow: none;
  }
}

@media print {
  .unsaved-dialog {
    display: none!important;
  }
}

/* Next steps: a readable, action-led queue above the business snapshot. */

.next-steps-panel {
  margin-bottom: 23px;
}

.next-steps-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 19px 22px 14px;
}

.next-steps-head>div {
  min-width: 0;
}

.next-steps-head .eyebrow {
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 6px;
}

.next-steps-head h2 {
  font-size: 22px;
  line-height: 1.35;
  letter-spacing: -.35px;
}

.next-steps-head h2 .count-chip {
  font-size: 14px;
  vertical-align: middle;
}

.next-steps-head p {
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
  margin-top: 5px;
  max-width: 78ch;
}

.next-steps-head>.btn {
  font-size: 16px;
  min-height: 44px;
  flex-shrink: 0;
  margin-top: 2px;
}

.next-steps-filters {
  gap: 18px;
  flex-wrap: wrap;
  margin: 0 22px;
}

.next-steps-filters button {
  font-size: 16px;
  line-height: 1.4;
  min-height: 44px;
  padding-top: 8px;
  padding-bottom: 11px;
}

.next-steps-list {
  list-style: none;
  margin: 0;
  padding: 0 22px;
}

.next-step-row {
  display: grid;
  grid-template-columns: 34px minmax(0,1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid #F0ECF5;
}

.next-step-row:last-child {
  border-bottom: 0;
}

.next-step-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--pale);
  color: var(--label);
  align-self: start;
  margin-top: 3px;
}

.next-step-icon svg {
  width: 18px;
  height: 18px;
}

.next-step-body {
  min-width: 0;
}

.next-step-title {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.4;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.next-step-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
  margin-top: 3px;
}

.next-step-meta>span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.next-step-timing {
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
}

.next-step-row.is-overdue .next-step-timing {
  padding: 1px 7px;
  border-radius: 5px;
  background: var(--pink);
  color: #862E66;
}

.next-step-row.is-overdue .next-step-icon {
  background: var(--pink);
}

.next-step-action {
  font-size: 16px;
  line-height: 1.4;
  min-height: 44px;
  min-width: 165px;
  max-width: 240px;
  padding: 10px 13px;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
}

.next-step-action svg {
  width: 18px;
  height: 18px;
}

.next-steps-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 16px;
  padding: 5px 22px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}

.next-steps-footer>.action-link {
  font-size: 16px;
  line-height: 1.4;
  min-height: 44px;
  padding: 8px 0;
  white-space: normal;
  text-align: left;
}

.next-steps-empty {
  padding: 25px 22px;
}

.next-steps-empty h3,.next-steps-empty h2 {
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
}

.next-steps-empty p {
  font-size: 14px;
  line-height: 1.65;
  color: var(--muted);
  margin-top: 6px;
}

.next-steps-empty .empty-state {
  padding: 8px 0;
  max-width: 720px;
}

.next-steps-empty .empty-state h3,.next-steps-empty .empty-state h2 {
  font-size: 16px;
}

.next-steps-empty .empty-state p {
  font-size: 16px;
  max-width: 560px;
}

.next-steps-empty .btn {
  font-size: 16px;
  min-height: 44px;
  white-space: normal;
}

.next-steps-panel button:focus-visible,.next-steps-panel a:focus-visible {
  outline: 2px solid transparent;
  outline-offset: 4px;
  box-shadow: 0 0 0 2px white,0 0 0 4px var(--ink);
}

@media(max-width:760px) {
  .next-steps-panel {
    margin-bottom: 18px;
  }

  .next-steps-head {
    padding: 17px 18px 12px;
    gap: 13px;
  }

  .next-steps-head h2 {
    font-size: 22px;
  }

  .next-steps-head>.btn {
    padding: 10px 11px;
  }

  .next-steps-filters {
    margin: 0 18px;
    gap: 14px;
  }

  .next-steps-list {
    padding: 0 18px;
  }

  .next-step-row {
    grid-template-columns: 30px minmax(0,1fr);
    align-items: start;
    gap: 9px 11px;
    padding: 14px 0;
  }

  .next-step-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    margin-top: 2px;
  }

  .next-step-icon svg {
    width: 18px;
    height: 18px;
  }

  .next-step-title {
    font-size: 16px;
  }

  .next-step-meta {
    font-size: 14px;
    gap: 3px 9px;
  }

  .next-step-action {
    grid-column: 2;
    justify-self: start;
    min-width: 0;
    max-width: 100%;
    min-height: 44px;
    margin-top: 1px;
  }

  .next-steps-footer {
    padding: 7px 18px;
    gap: 4px 12px;
  }

  .next-steps-empty {
    padding: 22px 18px;
  }
}

@media(max-width:460px) {
  .next-steps-head {
    flex-wrap: wrap;
    gap: 10px;
  }

  .next-steps-head>div {
    flex: 1 1 100%;
  }

  .next-steps-head>.btn {
    margin-top: 0;
  }

  .next-steps-filters {
    gap: 12px;
  }

  .next-steps-filters button {
    font-size: 14px;
  }

  .next-step-action {
    width: 100%;
  }

  .next-steps-footer {
    align-items: flex-start;
  }

  .next-steps-footer>span {
    padding-top: 11px;
  }
}

@media(forced-colors:active) {
  .next-steps-panel button:focus-visible,.next-steps-panel a:focus-visible {
    outline: 2px solid Highlight;
    box-shadow: none;
  }
}

/* Quote pricing separates calculation method, inclusion and the amount quoted. */

.quote-line {
  padding: 18px;
}

.quote-line .field>label,.quote-line label {
  font-size: 14px;
  line-height: 1.4;
}

.quote-line .field>label span {
  font-size: 14px;
}

.quote-line .field input,.quote-line .field select {
  min-height: 44px;
  padding: 9px 11px;
  font-size: 16px;
  line-height: 1.5;
  border-color: var(--muted);
}

.quote-line .field-hint {
  font-size: 14px;
  line-height: 1.6;
}

.quote-line .icon-button {
  width: 44px;
  min-height: 44px;
  margin-top: 25px;
  padding: 12px;
  flex-shrink: 0;
}

.quote-line .icon-button svg {
  width: 18px;
  height: 18px;
}

.quote-pricing-choice.field {
  display: grid;
  grid-template-columns: minmax(200px,.8fr) minmax(0,1.2fr);
  align-items: start;
  column-gap: 16px;
  margin-top: 16px;
  max-width: none;
}

.quote-pricing-choice.field>label {
  grid-column: 1/-1;
}

.quote-pricing-choice .field-hint {
  align-self: center;
}

.quote-line-grid {
  grid-template-columns: minmax(72px,.65fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1.2fr);
  gap: 12px;
  margin-top: 16px;
  align-items: start;
}

.quote-line-grid .field>label {
  min-height: 20px;
  display: flex;
  align-items: flex-end;
}

.quote-line .field input[readonly] {
  background: var(--pale);
  color: var(--body);
  border-color: var(--muted);
  cursor: default;
}

.quote-pricing-explanation {
  margin: 13px 0 0;
  padding: 11px 13px;
  border-left: 3px solid var(--lavender);
  border-radius: 0 7px 7px 0;
  background: var(--pale);
  font-size: 14px;
  line-height: 1.65;
  color: var(--body);
  overflow-wrap: anywhere;
}

.quote-line-inclusion {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(170px,.62fr);
  align-items: start;
  gap: 16px;
  margin-top: 17px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.quote-line-inclusion>.field {
  min-width: 0;
}

.quote-line-inclusion .field-hint {
  color: var(--muted);
  margin: 0;
}

.quote-line-amount {
  min-width: 0;
  padding: 12px 15px;
  border-radius: 8px;
  background: var(--pale);
}

.quote-line-amount>[data-line-total-label] {
  display: block;
  font-size: 14px;
  line-height: 1.45;
  font-weight: 600;
  color: var(--muted);
}

.quote-line-amount strong {
  display: block;
  font-size: 22px;
  line-height: 1.3;
  letter-spacing: -.3px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  margin-top: 5px;
  overflow-wrap: anywhere;
}

.quote-line.excluded-extra {
  border-color: #D7BED3;
}

.quote-line.excluded-extra .quote-line-amount {
  background: var(--pink);
}

.quote-extra-summary {
  display: grid;
  gap: 5px;
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--pink);
  border: 1px solid #EBD8E7;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--body);
  overflow-wrap: anywhere;
}

.quote-extra-summary strong {
  color: var(--ink);
  font-weight: 800;
}

.quote-internal {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 7px 18px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  margin-top: 14px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--muted);
}

.quote-internal>* {
  min-width: 0;
  overflow-wrap: anywhere;
}

.quote-internal strong {
  color: var(--ink);
}

.quote-line details {
  font-size: 14px;
  line-height: 1.6;
  margin-top: 14px;
}

.quote-line summary {
  min-height: 44px;
  padding: 11px 0 9px;
  font-size: 14px;
  line-height: 1.6;
}

.quote-line-meta {
  gap: 12px;
  padding-top: 13px;
  margin-top: 0;
  border-top-color: var(--line);
}

.quote-line button:focus-visible,.quote-line input:focus-visible,.quote-line select:focus-visible,.quote-line summary:focus-visible {
  outline: 2px solid transparent;
  outline-offset: 4px;
  box-shadow: 0 0 0 2px white,0 0 0 4px var(--ink);
}

@media(max-width:760px) {
  .quote-line {
    padding: 16px;
  }

  .quote-line-top {
    gap: 9px;
  }

  .quote-pricing-choice.field {
    display: flex;
    max-width: none;
    margin-top: 15px;
  }

  .quote-line-grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 13px 12px;
    margin-top: 15px;
  }

  .quote-line-grid .field>label {
    min-height: 40px;
  }

  .quote-line-inclusion {
    grid-template-columns: minmax(0,1fr);
    gap: 12px;
  }

  .quote-line-amount {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 12px 13px;
  }

  .quote-line-amount>[data-line-total-label] {
    max-width: 60%;
  }

  .quote-line-amount strong {
    font-size: 21px;
    text-align: right;
    margin-top: 0;
    flex-shrink: 0;
    max-width: 60%;
  }

  .quote-pricing-explanation {
    padding: 11px 12px;
    font-size: 14px;
  }

  .quote-internal {
    grid-template-columns: minmax(0,1fr);
    gap: 6px;
    font-size: 16px;
  }

  .quote-extra-summary {
    font-size: 14px;
    padding: 12px;
  }

  .quote-line-meta {
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 13px 12px;
  }

  .sidebar {
    visibility: hidden;
    pointer-events: none;
  }

  .sidebar.open {
    visibility: visible;
    pointer-events: auto;
  }

  .sidebar-close {
    display: inline-flex;
  }

  .topbar {
    padding: 10px 18px;
    min-height: 68px;
    gap: 12px;
  }

  .search-trigger {
    min-width: 44px;
    width: 44px;
    height: 44px;
    padding: 10px;
  }

  .mobile-menu {
    padding: 10px;
    width: 44px;
    height: 44px;
  }

  .drawer-footer>.footer-right {
    width: 100%;
    margin-left: 0;
  }

  .drawer-footer>.footer-right>.btn {
    flex: 1 1 140px;
    min-width: 0;
  }

  .contact-card-head {
    gap: 10px;
  }

  .topbar .mobile-menu {
    display: inline-flex;
  }

  .page-heading>div:first-child {
    flex: 0 1 auto;
    width: 100%;
  }

  .demo-banner {
    grid-template-columns: 20px minmax(0,1fr);
    gap: 6px 10px;
  }

  .demo-banner a {
    grid-column: 2;
    justify-self: start;
    margin-left: 0;
    white-space: normal;
    min-height: 44px;
  }
}

@media(max-width:360px) {
  .quote-line {
    padding: 13px;
  }

  .quote-line-grid {
    gap: 12px 10px;
  }

  .quote-line .field input,.quote-line .field select {
    padding-left: 9px;
    padding-right: 9px;
    font-size: 16px;
  }

  .quote-line-amount {
    align-items: flex-start;
  }

  .quote-line-amount strong {
    font-size: 19px;
  }

  .quote-line-meta {
    grid-template-columns: minmax(0,1fr);
  }

  .quote-line-meta .field:last-child {
    grid-column: auto;
  }
}

@media(forced-colors:active) {
  .quote-line button:focus-visible,.quote-line input:focus-visible,.quote-line select:focus-visible,.quote-line summary:focus-visible {
    outline: 2px solid Highlight;
    box-shadow: none;
  }

  .btn.primary:focus-visible,.task-check-target:focus-within,button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible,[tabindex="0"]:focus-visible {
    outline: 2px solid Highlight;
    box-shadow: none;
  }
}

.quote-drawer .quote-totals .total-row {
  font-size: 14px;
}

.quote-drawer .quote-totals .total-row.final {
  font-size: 22px;
}

.quote-drawer #quote-calculation+.field-hint {
  font-size: 14px;
  line-height: 1.6;
}

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

  .attention-row {
    flex-wrap: wrap;
    row-gap: 8px;
  }

  .attention-row>.attention-body {
    flex: 1 1 calc(100% - 60px);
  }
}

@media(max-height:850px) {
  .sidebar-bottom .local-card {
    display: none;
  }
}

@media(max-width:1100px) {
  .timeline-row {
    grid-template-columns: minmax(0,1fr) 120px;
  }

  .timeline-row>.timeline-progress {
    grid-column: 1/-1;
    grid-row: 2;
  }

  .timeline-row>.text-right {
    grid-column: 2;
    grid-row: 1;
  }
}

/* Job amount trail: estimates, quote versions and agreed project values. */
.amount-trail {
  margin: 22px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--pale);
  min-width: 0;
}

.amount-trail h3 {
  font-size: 18px;
  line-height: 1.4;
  margin: 0;
  color: var(--ink);
}

.amount-trail-intro,.amount-trail>p {
  margin-top: 7px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.amount-trail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(min(100%,160px),1fr));
  gap: 13px;
  margin-top: 17px;
  min-width: 0;
}

.amount-card {
  min-width: 0;
  font-size: 16px;
  line-height: 1.6;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
}

.amount-card-label,.amount-card>h4 {
  display: block;
  margin: 0;
  min-height: 42px;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.5;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.amount-card-value {
  display: block;
  margin: 8px 0 0;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -.35px;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  overflow-wrap: anywhere;
  min-width: 0;
}

.amount-basis {
  display: block;
  margin-top: 3px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: normal;
  color: var(--muted);
}

.amount-card-meta {
  margin-top: 9px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.amount-card-detail {
  display: grid;
  gap: 4px;
  margin: 12px 0 0;
  padding-top: 11px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.6;
  color: var(--body);
  overflow-wrap: anywhere;
}

.amount-card-detail>div {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 3px 10px;
  min-width: 0;
}

.amount-card-detail dt,.amount-card-detail dd,.amount-card-detail p {
  margin: 0;
  min-width: 0;
  font-size: 14px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.amount-card .action-link {
  min-height: 44px;
  margin-top: 8px;
  font-size: 16px;
}

.amount-card.is-accepted {
  background: var(--pale);
  border-color: var(--ink);
  box-shadow: inset 0 3px 0 var(--ink);
}

.amount-card.is-accepted .action-link {
  color: var(--ink);
}

.amount-card>h4+.amount-card-meta {
  margin-top: 8px;
  font-size: 16px;
  line-height: 1.6;
}

.amount-trail>.form-section-heading {
  margin-bottom: 0;
  gap: 8px;
}

.amount-trail>.amount-budget {
  margin: 15px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--ink);
  border-radius: 0 7px 7px 0;
  background: white;
  font-size: 14px;
  line-height: 1.65;
  color: var(--body);
  overflow-wrap: anywhere;
}

.amount-budget strong {
  color: var(--ink);
}

.amount-trail-list>h4 {
  margin: 0 0 7px;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.5;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.amount-trail-list {
  display: grid;
  gap: 0;
  margin: 17px 0 0;
  padding: 0;
  list-style: none;
}

.amount-record {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 18px;
  min-width: 0;
  padding: 15px 0;
  border-top: 1px solid var(--line);
}

.amount-record-main {
  flex: 1 1 190px;
  min-width: 0;
}

.amount-record-title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.5;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.amount-record-meta {
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.amount-record-values {
  flex: 0 1 220px;
  min-width: 0;
  text-align: right;
}

.amount-record .money-main {
  font-size: 20px;
}

.amount-record .action-link {
  min-height: 44px;
  font-size: 16px;
}

.money-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-width: 0;
  max-width: 100%;
  font-variant-numeric: tabular-nums;
}

.money-main {
  display: block;
  min-width: 0;
  max-width: 100%;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.45;
  color: var(--ink);
  white-space: normal;
  overflow-wrap: anywhere;
}

.money-detail,.money-label {
  display: block;
  max-width: 100%;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.55;
  color: var(--muted);
  white-space: normal;
  overflow-wrap: anywhere;
}

.text-right .money-cell,.money-cell.text-right,.amount-record-values .money-cell {
  align-items: flex-end;
  text-align: right;
}

.card-footer>.money-cell {
  flex: 1 1 140px;
}

@media(max-width:560px) {
  .amount-trail {
    padding: 15px;
    margin: 19px 0;
  }

  .amount-trail-grid {
    grid-template-columns: minmax(0,1fr);
    gap: 11px;
    margin-top: 14px;
  }

  .amount-card {
    padding: 14px;
  }

  .amount-card-label,.amount-card>h4 {
    min-height: 0;
  }

  .amount-record {
    flex-direction: column;
    align-items: stretch;
    gap: 9px;
  }

  .amount-record-main,.amount-record-values {
    flex: 0 1 auto;
    text-align: left;
  }

  .amount-record-values .money-cell {
    align-items: flex-start;
    text-align: left;
  }
}

.amount-trail-followup {
  margin-top: 14px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  min-width: 0;
}

.amount-trail-followup p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--body);
  overflow-wrap: anywhere;
}

.amount-trail-followup p+p {
  margin-top: 6px;
}

.amount-trail-followup strong {
  color: var(--ink);
  font-weight: 800;
}

.amount-trail-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 8px;
  min-width: 0;
}

.amount-trail-actions .action-link {
  min-height: 44px;
  max-width: 100%;
  font-size: 16px;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* Email review keeps the source message readable in the drawer's own scroll. */
.email-message-first {
  min-width: 0;
  margin: 0 0 20px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--white);
  color: var(--body);
}

.email-message-heading {
  min-width: 0;
  overflow-wrap: anywhere;
}

.email-message-heading h3,h3.email-message-heading {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.4;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.email-message-meta,.email-message-meta dl {
  display: grid;
  grid-template-columns: minmax(55px,max-content) minmax(0,1fr);
  gap: 5px 12px;
  min-width: 0;
  margin: 13px 0 0;
  font-size: 14px;
  line-height: 1.6;
}

.email-message-meta:has(>dl) {
  display: block;
  margin: 0;
}

.email-message-meta dt,.email-message-meta dd {
  min-width: 0;
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.email-message-meta dt {
  color: var(--muted);
  font-weight: 600;
}

.email-message-meta dd {
  color: var(--body);
}

.email-message-body {
  min-width: 0;
  max-width: 100%;
  max-height: none;
  margin: 19px 0 0;
  padding: 17px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  overflow: visible;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.7;
  color: var(--body);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: normal;
  tab-size: 4;
}

.email-message-body pre {
  min-width: 0;
  max-width: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
  font: inherit;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: normal;
  tab-size: 4;
}

.email-review-details {
  min-width: 0;
  margin: 20px 0;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--white);
}

.email-review-details[open] {
  padding-bottom: 16px;
}

.email-review-details>summary {
  min-height: 48px;
  margin: 0 -16px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--ink);
  cursor: pointer;
  overflow-wrap: anywhere;
}

.email-review-details>summary:hover {
  background: var(--pale);
}

.email-review-details[open]>summary {
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
}

.email-review-details>summary:focus-visible {
  outline: 2px solid transparent;
  outline-offset: 4px;
  box-shadow: 0 0 0 2px white,0 0 0 4px var(--ink);
}

.email-contact-preview {
  min-width: 0;
  margin: 20px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--pale);
  color: var(--body);
}

.email-contact-preview h3 {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.45;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.email-contact-status {
  max-width: 100%;
  margin: 0 0 9px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.6;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.email-contact-name {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.55;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.email-contact-details,.email-contact-note,.email-contact-error {
  min-width: 0;
  margin: 5px 0 0;
  font-size: 14px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.email-contact-details {
  color: var(--body);
}

.email-contact-details a {
  overflow-wrap: anywhere;
}

.email-contact-note {
  margin-top: 10px;
  color: var(--muted);
}

.email-contact-error {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #E9C8DC;
  border-radius: 7px;
  background: var(--pink);
  color: #98325F;
}

.email-contact-preview .btn {
  min-height: 44px;
  max-width: 100%;
  margin-top: 12px;
  font-size: 16px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.email-review-notice {
  min-width: 0;
  margin: 16px 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--purple);
  border-radius: 0 7px 7px 0;
  background: var(--pale);
  font-size: 14px;
  line-height: 1.65;
  color: var(--body);
  overflow-wrap: anywhere;
}

.email-review-notice p {
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
}

.email-review-notice p+p {
  margin-top: 6px;
}

@media(max-width:560px) {
  .email-message-first {
    padding: 15px;
  }

  .email-message-heading h3,h3.email-message-heading {
    font-size: 18px;
  }

  .email-message-meta,.email-message-meta dl {
    gap: 4px 9px;
  }

  .email-contact-preview {
    padding: 15px;
  }

  .email-contact-preview .btn {
    width: 100%;
  }
}

@media(forced-colors:active) {
  .email-review-details>summary:focus-visible {
    outline-color: Highlight;
    box-shadow: none;
  }
}

/* Keep the reviewed contact visible above this email's footer actions. */
.footer-right:has(>#email-contact-footer) {
  flex: 1 1 280px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

.footer-right>.email-footer-contact {
  display: block;
  flex: 1 0 100%;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.6;
  color: var(--ink);
  white-space: normal;
  overflow-wrap: anywhere;
}

/* The accepted project snapshot stays distinct from editable working notes. */
.agreed-scope {
  min-width: 0;
  max-width: 100%;
  margin: 22px 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--pale);
  box-shadow: inset 0 3px 0 var(--ink);
  color: var(--body);
}

.agreed-scope-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  min-width: 0;
}

.agreed-scope-heading h3 {
  min-width: 0;
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.4;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.agreed-scope-badge {
  max-width: 100%;
  padding: 5px 9px;
  border-radius: 6px;
  background: var(--ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--white);
  white-space: normal;
  overflow-wrap: anywhere;
}

.agreed-scope-intro,.agreed-scope-reference,.agreed-scope-note {
  min-width: 0;
  margin: 11px 0 0;
  font-size: 14px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.agreed-scope-intro {
  color: var(--body);
}

.agreed-scope-reference {
  font-weight: 700;
  color: var(--ink);
}

.agreed-scope-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(min(100%,210px),1fr));
  gap: 12px 18px;
  min-width: 0;
  margin: 16px 0 0;
}

.agreed-scope-meta>div {
  min-width: 0;
}

.agreed-scope-meta dt,.agreed-scope-meta dd {
  min-width: 0;
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.agreed-scope-meta dt {
  font-weight: 600;
  color: var(--muted);
}

.agreed-scope-meta dd {
  margin-top: 2px;
  color: var(--body);
  white-space: pre-wrap;
}

.agreed-scope-content {
  display: grid;
  gap: 13px;
  min-width: 0;
  margin-top: 18px;
}

.agreed-scope-content>section {
  min-width: 0;
  max-width: 100%;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.agreed-scope-content h4 {
  min-width: 0;
  margin: 0 0 7px;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.5;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.agreed-scope-text {
  min-width: 0;
  max-width: 100%;
  margin: 0;
  font-size: 16px;
  line-height: 1.7;
  color: var(--body);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.agreed-scope-evidence {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin: 16px 0 0;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.agreed-scope-evidence[open] {
  padding-bottom: 14px;
}

.agreed-scope-evidence>summary {
  min-height: 48px;
  margin: 0 -14px;
  padding: 12px 14px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.6;
  color: var(--ink);
  cursor: pointer;
  overflow-wrap: anywhere;
}

.agreed-scope-evidence>summary:hover {
  background: var(--pale);
}

.agreed-scope-evidence[open]>summary {
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
  border-radius: 7px 7px 0 0;
}

.agreed-scope-evidence>summary:focus-visible {
  outline: 2px solid transparent;
  outline-offset: 4px;
  box-shadow: 0 0 0 2px white,0 0 0 4px var(--ink);
}

.agreed-scope-note {
  margin-top: 17px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--body);
}

.agreed-scope-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-top: 15px;
}

.agreed-scope-actions .btn {
  min-height: 44px;
  min-width: 0;
  max-width: 100%;
  font-size: 16px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.agreed-scope-actions .btn:focus-visible {
  outline: 2px solid transparent;
  outline-offset: 4px;
  box-shadow: 0 0 0 2px white,0 0 0 4px var(--ink);
}

.project-working-notice {
  min-width: 0;
  margin: 0 0 16px;
  padding: 12px 14px;
  border-left: 3px solid var(--purple);
  border-radius: 0 7px 7px 0;
  background: var(--pale);
  font-size: 14px;
  line-height: 1.65;
  color: var(--body);
  overflow-wrap: anywhere;
}

.project-working-notice p {
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.project-working-notice p+p {
  margin-top: 6px;
}

@media(max-width:560px) {
  .agreed-scope {
    padding: 15px;
  }

  .agreed-scope-heading {
    align-items: flex-start;
  }

  .agreed-scope-heading h3 {
    font-size: 18px;
  }

  .agreed-scope-meta {
    grid-template-columns: minmax(0,1fr);
  }

  .agreed-scope-content>section {
    padding: 13px;
  }

  .agreed-scope-actions .btn {
    width: 100%;
  }
}

@media(forced-colors:active) {
  .agreed-scope-actions .btn:focus-visible,.agreed-scope-evidence>summary:focus-visible {
    outline-color: Highlight;
    box-shadow: none;
  }
}

/* Delivery stages describe the workflow; task counts stay separate. */
.delivery-stage {
  min-width: 0;
  max-width: 100%;
  margin-top: 12px;
}

.delivery-stage-caption {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  min-width: 0;
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}

.delivery-stage-caption>span,.delivery-stage-caption>strong {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.delivery-stage-caption>strong {
  flex: 1 1 auto;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.5;
  color: var(--ink);
}

.delivery-stage-step {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.delivery-stage .progress-track {
  margin-top: 7px;
}

.delivery-stage-note {
  min-width: 0;
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.project-stage-note {
  display: block;
  min-width: 0;
  max-width: 100%;
  margin: 5px 0 0;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.55;
  color: var(--muted);
  white-space: normal;
  overflow-wrap: anywhere;
}

.project-stage-guide {
  min-width: 0;
  margin: 0 0 17px;
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--pale);
  font-size: 14px;
  line-height: 1.65;
  color: var(--body);
  overflow-wrap: anywhere;
}

.project-stage-guide p {
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
}

.project-stage-guide p+p {
  margin-top: 6px;
}

.timeline-stage-caption {
  display: block;
  min-width: 0;
  max-width: 100%;
  margin: 0 0 7px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.kanban-stage-note {
  display: block;
  min-width: 0;
  max-width: 100%;
  margin: 5px 0 0;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.55;
  color: var(--body);
  overflow-wrap: anywhere;
}

.kanban-column>.kanban-stage-note {
  margin: -5px 3px 12px;
}

.timeline-stage-block {
  min-width: 0;
}

@media(max-width:1100px) {
  .timeline-row>.timeline-stage-block {
    grid-column: 1/-1;
    grid-row: 2;
  }
}

@media(max-width:560px) {
  .timeline-stage-block .timeline-progress {
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 6px;
    min-width: 0;
  }

  .timeline-stage-block .timeline-progress span {
    min-width: 0;
    min-height: 44px;
    padding: 10px 12px;
    font-size: 14px;
    line-height: 1.5;
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal;
    hyphens: none;
  }
}

/* Short viewports keep every record field and action in one reachable scroll. */
@media(max-height:600px) {
  .drawer[open] {
    display: block;
    overflow-y: auto;
    overscroll-behavior: contain;
    scroll-padding-block: 16px;
  }

  .drawer-form {
    display: block;
  }

  .drawer-scroll {
    overflow: visible;
  }
}

@media(max-height:360px) {
  .search-dialog {
    top: 12px;
    max-height: calc(100dvh - 24px);
  }

  .search-footer {
    display: none;
  }

  .unsaved-dialog[open] {
    display: block;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .unsaved-dialog::before {
    height: 6px;
  }

  .unsaved-dialog-body {
    overflow: visible;
  }
}
