:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  --nav: #111a31;
  --nav-ink: #ecf0ff;
  --ink: #17213a;
  --muted: #525f78;
  --canvas: #f3f5fa;
  --panel: #fff;
  --line: #dce2ee;
  --blue: #4054c4;
  --blue-hover: #3044b2;
  --lavender: #eef1ff;
  --success: #176944;
  --error: #a12a3c;
  --warning: #815208;
  --radius: 14px;
  --shadow: 0 14px 40px #1b2b5210;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; color: var(--ink); background: var(--canvas); font-size: .94rem; line-height: 1.5; }
h1, h2, h3, p, ul, ol { margin: 0; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.032em; }
h1 { font-size: clamp(2rem, 3.4vw, 3.15rem); font-weight: 770; }
h2 { font-size: 1.38rem; font-weight: 750; }
h3 { font-size: 1.02rem; font-weight: 720; }
a { color: var(--blue); text-underline-offset: .19em; }
a:hover { color: var(--blue-hover); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button[disabled] { cursor: wait; opacity: .65; }
:focus-visible { outline: 3px solid #7084ee; outline-offset: 3px; }
img { display: block; max-width: 100%; height: auto; }
.skip { position: fixed; z-index: 20; top: .5rem; left: .5rem; padding: .6rem 1rem; border-radius: .45rem; color: var(--ink); background: white; transform: translateY(-160%); }
.skip:focus { transform: none; }
.workspace { min-height: 100svh; }
.workspace.is-active { display: grid; grid-template-columns: 246px minmax(0, 1fr); }
.workspace-body { min-width: 0; }
.sidebar {
  position: sticky;
  top: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100svh;
  min-width: 0;
  color: var(--nav-ink);
  background: radial-gradient(ellipse at 0 0, #20325e, transparent 42%), var(--nav);
}
.sidebar-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 14px 12px; border-bottom: 1px solid #344265; }
.brand { display: flex; align-items: center; gap: 8px; width: fit-content; min-height: 44px; min-width: 0; color: var(--nav-ink); text-decoration: none; }
.brand img { width: clamp(104px, 12vw, 138px); }
.brand span { border: 1px solid #596a98; border-radius: 5px; padding: 2px 5px; font-size: 10px; line-height: 1.45; font-weight: 750; letter-spacing: .07em; }
.sidebar nav { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #55638c transparent; padding: 11px 11px 15px; }
.nav-group { list-style: none; padding: 0; }
.nav-group + .nav-group { margin-top: 11px; padding-top: 9px; border-top: 1px solid #2e3b5a; }
.nav-heading { margin: 0 9px 3px; color: #bdc9e7; font-size: .73rem; font-weight: 680; }
.nav-link {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 7px 9px;
  color: #e2e8f9;
  border: 1px solid transparent;
  border-radius: 8px;
  text-decoration: none;
  font-size: .86rem;
  font-weight: 620;
  line-height: 1.3;
}
.nav-link svg { color: #aebce5; }
.nav-link:hover { background: #263557; color: white; }
.nav-link[aria-current="page"] { color: white; background: linear-gradient(105deg,#374e86,#293b67); border-color: #52689d; }
.nav-link[aria-current="page"] svg { color: #d9e2ff; }
.nav-link[aria-current="page"]::before { content: ""; position: absolute; inset: 9px auto 9px -1px; width: 3px; border-radius: 3px; background: #a9baff; }
.nav-count { padding: .10rem .38rem; border-radius: 5px; background: #435a94; color: white; font-size: .72rem; font-variant-numeric: tabular-nums; }
.sidebar-foot { padding: 7px 11px; padding-bottom: max(7px, env(safe-area-inset-bottom)); border-top: 1px solid #344265; }
.sidebar-foot a { display: flex; align-items: center; gap: 9px; min-height: 44px; padding: 7px 9px; border-radius: 8px; color: #e0e7fb; font-size: .84rem; font-weight: 660; text-decoration: none; }
.sidebar-foot a:hover { color: white; background: #263557; }
.menu-toggle, .drawer-close, .drawer-scrim, .mobile-dock { display: none; }
.menu-toggle svg, .drawer-close svg, .nav-link svg, .sidebar-foot svg, .account-toggle svg, .account-panel svg, .mobile-dock svg {
  flex: none;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.workspace-header { position: sticky; top: 0; z-index: 14; }
.topbar { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 70px; padding: 8px clamp(1rem, 3vw, 2.25rem); background: white; border-bottom: 1px solid var(--line); }
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.context { display: grid; gap: 3px; min-width: 0; line-height: 1.25; }
.context span { color: var(--muted); font-size: .72rem; font-weight: 660; }
.context strong { overflow: hidden; color: var(--ink); font-size: .94rem; font-weight: 740; text-overflow: ellipsis; white-space: nowrap; }
.topbar-account { position: relative; flex: none; }
.account-toggle { display: flex; align-items: center; min-width: 44px; min-height: 44px; gap: 8px; padding: 4px 8px 4px 4px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: white; text-align: start; }
.account-toggle:hover, .account-toggle[aria-expanded="true"] { border-color: #b6c2ef; background: #f5f7ff; }
.account-toggle > svg { color: #546188; transition: transform 160ms ease; }
.account-toggle[aria-expanded="true"] > svg { transform: rotate(180deg); }
.avatar { display: grid; place-items: center; flex: 0 0 32px; width: 32px; height: 32px; border: 1px solid #cbd5f9; border-radius: 50%; background: linear-gradient(145deg,#f1f3ff,#e6ebff); color: #30439b; font-size: .75rem; font-weight: 800; }
.account-trigger-text { display: grid; min-width: 0; line-height: 1.2; }
.account-trigger-text strong, .account-trigger-text small { max-width: 165px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-trigger-text strong { font-size: .81rem; }
.account-trigger-text small { color: var(--muted); font-size: .7rem; }
.account-panel { position: absolute; z-index: 18; right: 0; top: calc(100% + 9px); width: min(312px, calc(100vw - 24px)); max-height: calc(100dvh - 82px); overflow-y: auto; overscroll-behavior: contain; padding: 6px; border: 1px solid var(--line); border-radius: 13px; background: white; box-shadow: 0 12px 34px #1b2b5226; animation: account-in 165ms ease both; }
@keyframes account-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.account-profile { display: flex; align-items: start; gap: 10px; padding: 9px 8px 10px; }
.account-profile .avatar { flex-basis: 36px; width: 36px; height: 36px; }
.account-profile > div { min-width: 0; display: grid; gap: 3px; }
.account-profile strong, .account-profile small { overflow-wrap: anywhere; line-height: 1.28; }
.account-profile small { color: var(--muted); font-size: .8rem; }
.account-role { justify-self: start; border-radius: 4px; padding: 1px 5px; color: #3546a2; background: var(--lavender); font-size: .68rem; font-weight: 720; }
.account-actions { display: grid; padding-top: 3px; border-top: 1px solid var(--line); }
.account-actions + .account-actions { margin-top: 3px; }
.account-actions :is(button, a) { display: flex; width: 100%; align-items: center; gap: 9px; min-height: 44px; padding: 6px 8px; border: 0; border-radius: 7px; color: var(--ink); background: white; font-size: .85rem; font-weight: 660; text-align: start; text-decoration: none; }
.account-actions :is(button, a):hover { color: #3045a2; background: var(--lavender); }
.account-actions svg { color: #596891; }
.preview-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .55rem 1rem; padding: .58rem clamp(1rem, 3vw, 2.25rem); background: #eef2ff; color: #243776; border-bottom: 1px solid #cbd6f8; }
.preview-bar-info { display: flex; flex-wrap: wrap; align-items: center; gap: .26rem .64rem; min-width: 0; font-size: .85rem; }
.preview-bar-info strong { overflow-wrap: anywhere; }
.preview-bar-info span { padding: .1rem .45rem; border: 1px solid #c7d2f3; border-radius: 5px; background: white; font-size: .72rem; font-weight: 720; }
.preview-bar-actions, .account-row-actions { display: flex; gap: .42rem; align-items: center; justify-content: end; flex-wrap: wrap; }
.has-client-preview .main-content button:disabled { cursor: not-allowed; opacity: .55; }
.preview-disabled { opacity: .62; cursor: not-allowed; }
.preview-picker-body { display: grid; align-content: start; min-height: 15rem; gap: .8rem; padding: 1rem; }
.preview-picker-body > p { color: var(--muted); }
.preview-picker-status { min-height: 1.5em; font-size: .85rem; }
.preview-picker-results { display: grid; gap: .4rem; padding: 0; list-style: none; }
.preview-picker-results button { display: flex; align-items: center; justify-content: space-between; gap: .6rem; width: 100%; min-height: 48px; padding: .56rem .68rem; border: 1px solid var(--line); border-radius: 8px; background: #f8faff; color: var(--ink); text-align: start; }
.preview-picker-results button:hover, .preview-picker-results button[aria-current] { background: var(--lavender); border-color: #c5d2f9; }
.preview-picker-results button strong, .preview-picker-results button small { display: block; overflow-wrap: anywhere; }
.preview-picker-results button small { color: var(--muted); }
.preview-picker-results button > span:last-child { flex-shrink: 0; color: var(--blue-hover); font-size: .8rem; font-weight: 700; }
.main-content { margin: 0 auto; width: min(100%, 1480px); padding: clamp(1rem, 3vw, 2.25rem); }
.view-header { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 1.05rem; margin-bottom: 1.25rem; }
.view-header p { color: var(--muted); margin-top: .38rem; max-width: 68ch; }
.back-link { display: inline-block; color: var(--muted); font-weight: 670; margin-bottom: .62rem; font-size: .85rem; }
.view-actions { display: flex; gap: .55rem; align-items: center; flex-wrap: wrap; }
.hero { position: relative; isolation: isolate; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, .7fr); align-items: center; min-height: 202px; padding: clamp(1.35rem, 3vw, 2.15rem); border-radius: var(--radius); margin-bottom: 1rem; color: #f3f5ff; background: linear-gradient(118deg, #182449 6%, #202d59 51%, #111a35 100%); box-shadow: var(--shadow); }
.hero > div { z-index: 1; }
.hero h1 { font-size: clamp(1.9rem, 4vw, 3.1rem); }
.hero p { margin: .68rem 0 1rem; max-width: 55ch; color: #d1dcfb; }
.hero img { width: min(100%, 295px); justify-self: end; object-fit: contain; opacity: .91; mix-blend-mode: screen; }
.hero .button { background: #dce5ff; color: #283974; border-color: #dce5ff; }
.hero .button:hover { background: #f0f3ff; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.stat { min-height: 100px; padding: .95rem; display: flex; flex-direction: column; align-items: start; justify-content: space-between; border-radius: 12px; background: white; border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.stat:hover { border-color: #8694db; }
.stat span { color: var(--muted); font-weight: 640; font-size: .85rem; }
.stat strong { font-size: 1.87rem; line-height: 1.06; font-variant-numeric: tabular-nums; }
.columns { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .9rem; align-items: start; }
.task-board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; align-items: start; }
.task-board .panel { margin-top: 0; }
.task-board h2 { font-size: 1.05rem; }
.task-modes { display: flex; gap: .3rem; }
.panel { min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.panel + .panel, .columns + .panel, .summary + .panel, .panel + .columns { margin-top: .9rem; }
.panel-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .8rem; padding: 1rem 1.1rem; border-bottom: 1px solid var(--line); }
.panel-header p { color: var(--muted); margin-top: .2rem; font-size: .85rem; }
.panel-body { padding: 1.05rem; }
.record-list { display: grid; gap: 0; }
.record-link { display: flex; align-items: center; justify-content: space-between; padding: .78rem 1.06rem; gap: .75rem; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
.record-link:last-child { border-bottom: 0; }
.record-link:hover { background: #f3f5ff; color: var(--blue); }
.record-link > span:first-child { display: grid; gap: .23rem; min-width: 0; }
.record-link small { color: var(--muted); overflow-wrap: anywhere; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 41px; gap: .34rem; border: 1px solid transparent; border-radius: 8px; text-decoration: none; font-size: .86rem; font-weight: 730; line-height: 1.32; padding: .55rem .83rem; white-space: normal; }
.button.primary { background: var(--blue); color: #fff; border-color: var(--blue); }
.button.primary:hover { background: var(--blue-hover); }
.button.secondary { background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 8px; }
.button.secondary:hover { background: #f1f3fd; color: var(--blue); border-color: #a5b1e4; }
.button.subtle { background: var(--lavender); color: #304298; }
.button.subtle:hover { background: #e5eafd; }
.button.small { min-height: 34px; padding: .37rem .59rem; font-size: .8rem; }
.icon-button { padding: 0; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--ink); font-size: 1.48rem; line-height: 1; }
.icon-button:hover { background: var(--lavender); }
.text-link { font-size: .86rem; font-weight: 680; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .89rem; }
th, td { padding: .72rem 1.06rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: #f7f8fc; color: #465572; font-size: .76rem; white-space: nowrap; font-weight: 730; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f8faff; }
td:first-child { min-width: 9rem; max-width: 23rem; overflow-wrap: anywhere; }
td a { font-weight: 680; }
td button { white-space: nowrap; }
td small { display: block; color: var(--muted); font-size: .78rem; }
.cell-actions { text-align: right; white-space: nowrap; }
.empty { padding: 1.35rem 1.06rem; color: var(--muted); }
.empty .button { margin-top: .6rem; }
.search { min-width: min(100%, 13rem); }
.search input { width: 100%; }
.search-empty { padding: .65rem 1.06rem; color: var(--muted); }
.tag { display: inline-block; padding: .19rem .48rem; border: 1px solid #d1d9ee; background: #f0f3fa; color: #35466a; border-radius: 6px; font-size: .74rem; font-weight: 740; white-space: nowrap; }
.tag.blue { color: #30449f; background: #eef1ff; border-color: #cbd4f7; }
.tag.green { color: var(--success); background: #eaf7ef; border-color: #b9dfca; }
.tag.amber { color: var(--warning); background: #fff6e3; border-color: #f1d8a2; }
.tag.red { color: var(--error); background: #fff1f3; border-color: #edc4cb; }
.summary { display: flex; justify-content: space-between; align-items: start; gap: 1rem; padding: 1.15rem; }
.summary p { margin-top: .42rem; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--muted); }
.meta { display: flex; justify-content: end; flex-wrap: wrap; gap: .35rem .6rem; color: var(--muted); font-size: .83rem; }
.detail { margin-top: .88rem; }
.message-list { display: grid; gap: .63rem; padding: .9rem 1rem; }
.message { min-width: 0; padding: .82rem .93rem; border: 1px solid #dce5f5; border-radius: 10px; background: #f7f9fd; }
.message.internal { background: #fffaed; border-color: #eddaa9; }
.message header { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; }
.message time { color: var(--muted); font-size: .8rem; }
.message p { margin-top: .34rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.inline-form { display: grid; gap: .63rem; padding: .95rem 1rem; border-top: 1px solid var(--line); }
.inline-form .view-actions { margin-top: .12rem; justify-content: end; }
.label { display: grid; min-width: 0; align-content: start; gap: .32rem; font-weight: 680; font-size: .87rem; color: var(--ink); }
.label span { line-height: 1.4; }
input:not([type="checkbox"]), select, textarea { width: 100%; min-width: 0; border: 1px solid #cbd4e5; border-radius: 7px; padding: .52rem .58rem; background: white; color: var(--ink); font-weight: 480; }
textarea { resize: vertical; min-height: 88px; }
input[type="checkbox"] { width: 1.1rem; height: 1.1rem; accent-color: var(--blue); }
.label.check { display: flex; align-items: center; gap: .48rem; margin: .25rem 0; }
.editor { width: min(calc(100% - 1.6rem), 598px); max-height: min(89vh, 820px); padding: 0; border: 1px solid #c4d0e7; border-radius: var(--radius); color: var(--ink); box-shadow: 0 22px 80px #101c4470; }
#editor { overflow: hidden; max-height: min(calc(100dvh - 1.6rem), 820px); }
#editor-form { display: flex; flex-direction: column; max-height: min(calc(89vh - 2px), 818px); max-height: min(calc(100dvh - 1.6rem - 2px), 818px); }
#editor-form .editor-header, #editor-form .editor-footer { flex: 0 0 auto; }
#editor-fields { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.editor::backdrop { background: #111a33ab; }
.editor-header, .editor-footer { display: flex; padding: .82rem 1rem; gap: .55rem; align-items: center; }
.editor-header { justify-content: space-between; border-bottom: 1px solid var(--line); }
.editor-heading { min-width: 0; }
.editor-context { margin-top: .2rem; color: var(--muted); font-size: .82rem; overflow-wrap: anywhere; }
.editor-header .icon-button { flex-shrink: 0; }
.editor-footer { justify-content: end; border-top: 1px solid var(--line); }
.editor-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .83rem; padding: 1rem; }
.editor-fields .wide { grid-column: 1 / -1; }
.form-status { color: var(--error); font-size: .85rem; font-weight: 610; }
.editor .form-status { padding: 0 1rem .66rem; }
.editor .form-status:empty { display: none; }
#editor-status { flex: 0 0 auto; max-height: 6rem; overflow-y: auto; padding: .65rem 1rem; border-top: 1px solid #f2ccd3; background: #fff4f5; overflow-wrap: anywhere; }
.toast { position: fixed; z-index: 10; right: 1rem; bottom: 1rem; max-width: min(415px, calc(100% - 2rem)); border-radius: 8px; padding: .72rem .9rem; color: #fff; background: #263761; box-shadow: var(--shadow); font-weight: 640; }
.toast:empty { display: none; }
.crm-loader {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  padding: 24px 16px;
  color: #f2f5ff;
  background: radial-gradient(ellipse at 48% 28%, #273864 0%, #10182e 46%, #0b1020 85%);
}
.crm-loader::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(138deg, #7389da15, #a6b6ff03 60%, #8197f015);
  clip-path: polygon(0 0, 100% 0, 100% 32%, 62% 53%, 100% 100%, 0 100%, 33% 56%, 0 27%);
}
.crm-loader-card {
  display: grid;
  justify-items: center;
  gap: clamp(20px, 5vw, 28px);
  width: min(100%, 394px);
  padding: clamp(25px, 7vw, 42px) 18px;
  border: 1px solid #8d9fd144;
  border-radius: 22px;
  background: linear-gradient(155deg, #1c2a4eea, #121b32ed);
  box-shadow: 0 20px 65px #04091d70, inset 0 1px #c9d4ff19;
  text-align: center;
}
.crm-loader-logo img { width: 144px; height: auto; }
.crm-loader-object {
  position: relative;
  display: grid;
  place-items: center;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: radial-gradient(circle, #6684ff35, transparent 72%);
}
.crm-loader-orbit {
  position: absolute;
  inset: 4px;
  border: 1px solid #7485be59;
  border-radius: 50%;
}
.crm-loader-orbit::before {
  content: "";
  position: absolute;
  inset: -1px;
  border: 2px solid transparent;
  border-top-color: #c5d0ff;
  border-right-color: #778ef060;
  border-radius: inherit;
  transform: rotate(-25deg);
}
.crm-loader-crystal {
  position: relative;
  width: 46px;
  height: 54px;
  background: conic-gradient(from -32deg at 50% 54%, #8699ff 0deg 65deg, #bec8ff 65deg 131deg, #3d55c4 131deg 207deg, #27378a 207deg 278deg, #6c83ec 278deg);
  clip-path: polygon(50% 0, 100% 28%, 87% 74%, 50% 100%, 13% 74%, 0 28%);
}
.crm-loader-crystal::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(149deg, #f0f3ff91, #839cff09 80%);
  clip-path: polygon(50% 0, 100% 28%, 50% 54%, 0 28%);
}
.crm-loader-status h1 { color: #ecf0ff; font-size: clamp(1.02rem, 4.3vw, 1.25rem); font-weight: 680; letter-spacing: -.02em; }
.crm-loader-noscript { max-width: 27ch; color: #cdd7f6; font-size: .89rem; }
.crm-loader:has(.crm-loader-noscript) :is(.crm-loader-object, .crm-loader-status) { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .crm-loader-orbit::before { animation: crm-load-orbit 1.45s linear infinite; }
  .crm-loader-crystal { animation: crm-load-crystal 1.9s ease-in-out infinite alternate; }
}
@keyframes crm-load-orbit { to { transform: rotate(335deg); } }
@keyframes crm-load-crystal { to { transform: translateY(-3px); filter: brightness(1.17); } }
.session-screen { min-height: 100svh; display: grid; place-items: center; padding: 1.4rem; background: radial-gradient(ellipse at 90% 6%, #283c83, #131c35 60%); }
.session-card { width: min(100%, 490px); padding: clamp(1.22rem, 4vw, 2.2rem); background: #fff; border-radius: 20px; box-shadow: 0 20px 80px #070f29a0; }
.session-card h1 { font-size: clamp(1.6rem, 5vw, 2.6rem); }
.session-card p { margin: .55rem 0 1rem; color: var(--muted); }
.session-brand { display: inline-block; margin-bottom: .85rem; }
.session-brand img { width: 156px; }
.session-card form { display: grid; gap: .6rem; }
.session-card .form-status { margin: 0; color: var(--error); }
.session-card .view-actions { margin-top: .7rem; }
.preserve { white-space: pre-wrap; overflow-wrap: anywhere; }
.invite-result { display: grid; gap: .7rem; }
.invite-result button { justify-self: start; }
.invite-summary { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .5rem 1rem; margin: 0; padding: .75rem; border: 1px solid var(--line); border-radius: 9px; background: #f5f7ff; }
.invite-summary dt { color: var(--muted); font-size: .75rem; }
.invite-summary dd { margin: .15rem 0 0; font-size: .88rem; font-weight: 660; overflow-wrap: anywhere; }
.invite-draft summary { color: var(--blue-hover); cursor: pointer; font-weight: 680; }
.invite-draft .label { margin: .4rem 0; }
@media (max-width: 380px) { .invite-summary { grid-template-columns: 1fr; } }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.text-button { padding: 0; border: 0; background: transparent; color: var(--blue); font-size: .86rem; font-weight: 680; text-decoration: underline; text-underline-offset: .19em; }
.text-button:hover { color: var(--blue-hover); }
.session-card .session-note { margin: .75rem 0 .4rem; font-size: .86rem; line-height: 1.55; }
.session-card form .session-note { margin: 0; padding: .75rem .85rem; border: 1px solid #dce4f9; border-radius: 8px; background: #f4f7fd; }
.session-card .form-status:empty { display: none; }
.session-card input[name="token"] { padding: .72rem .65rem; }
.session-card .view-actions { column-gap: .85rem; row-gap: .55rem; }
.hero-link { display: inline-flex; align-items: center; min-height: 41px; margin-left: .8rem; color: #e9eeff; font-size: .86rem; font-weight: 700; }
.hero-link:hover { color: #fff; }
.org-logo { display: grid; place-items: center; flex: none; width: 2.65rem; height: 2.65rem; padding: .25rem; border: 1px solid #dde4f4; border-radius: 9px; background: #f1f4fd; color: #3c4d9c; font-size: .82rem; font-weight: 760; }
.org-logo img { width: 100%; height: 100%; object-fit: contain; }
.org-cell { display: flex; align-items: center; gap: .7rem; }
.org-cell > div { min-width: 0; }
.org-image-panel { display: flex; align-items: center; flex-wrap: wrap; gap: 1rem; padding: 1rem 1.1rem; }
.org-image-panel .org-logo { width: 4.4rem; height: 4.4rem; padding: .5rem; font-size: 1rem; }
.list-filters { display: grid; grid-template-columns: minmax(12rem, 1fr) repeat(2, minmax(0, .58fr)); gap: .55rem; padding: .85rem 1rem 0; }
.list-filters label { min-width: 0; }
.tracking-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16.5rem), 1fr)); gap: .7rem; padding: .85rem 1rem; }
.tracking-card { display: flex; flex-direction: column; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.tracking-card:hover { border-color: #aebbe8; }
.tracking-content { flex: 1; display: flex; flex-direction: column; gap: .34rem; padding: .8rem .88rem; }
.tracking-content p { color: var(--muted); font-size: .84rem; overflow-wrap: anywhere; }
.tracking-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .46rem; align-items: start; }
.tracking-heading h3 { overflow-wrap: anywhere; }
.tracking-heading h3 a { color: var(--ink); text-decoration: none; }
.tracking-heading h3 a:hover { color: var(--blue); text-decoration: underline; }
.tracking-links { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; margin-top: auto; padding-top: .48rem; overflow-wrap: anywhere; }
.website-cover { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: radial-gradient(ellipse at 67% 37%, #293874, #141c35 68%); }
.website-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.website-cover:not(.has-image) img { mix-blend-mode: screen; }
.website-cover.has-image { background: #eef2fc; }
.website-cover.has-image img { object-position: center top; }
.site-client { display: flex; align-items: flex-start; gap: .85rem; overflow-wrap: anywhere; }
.site-client > div { min-width: 0; }
.site-client dl { display: grid; gap: .45rem; margin: .55rem 0 0; }
.site-client dt, .site-resources p, .site-agreement p { color: var(--muted); font-size: .8rem; }
.site-client dd { margin: 0; }
.site-resources { display: grid; gap: .6rem; }
.site-agreements { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); gap: .7rem; padding: .8rem; }
.site-agreement { display: grid; gap: .55rem; padding: .75rem; border: 1px solid var(--line); border-radius: 9px; overflow-wrap: anywhere; }
.project-brief { display: grid; gap: 1rem; }
.project-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); gap: .75rem; margin: 0; }
.project-facts > div { min-width: 0; border: 1px solid #e2e8f5; border-radius: 9px; padding: .65rem .75rem; background: #f6f8fd; }
.project-facts dt { color: var(--muted); font-size: .76rem; font-weight: 680; }
.project-facts dd { margin: .18rem 0 0; font-weight: 670; overflow-wrap: anywhere; }
.brief-text p { margin-top: .4rem; color: var(--muted); font-size: .92rem; }
.intake-facts { padding-top: .9rem; border-top: 1px solid var(--line); }
@media (max-width: 1100px) {
  .task-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workspace.is-active { grid-template-columns: 214px minmax(0,1fr); }
}
@media (max-width: 860px) {
  :root {
    --dock-height: 64px;
    --dock-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    --dock-clearance: calc(var(--dock-height) + var(--dock-bottom) + 10px);
    scroll-padding-bottom: var(--dock-clearance);
  }
  body.drawer-active { overflow: hidden; }
  .workspace.is-active { display: block; }
  .workspace.is-active .workspace-body { padding-bottom: var(--dock-clearance); }
  .workspace.is-active ~ .toast { bottom: var(--dock-clearance); }
  .mobile-dock {
    position: fixed;
    z-index: 12;
    inset: auto 0 var(--dock-bottom);
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 3px;
    width: min(500px, calc(100% - 24px));
    height: var(--dock-height);
    margin-inline: auto;
    padding: 4px;
    border: 1px solid #d8e0f4;
    border-radius: 18px;
    background: #f9fbff;
    box-shadow: 0 8px 30px #1a2b5430, inset 0 1px #fff;
  }
  @supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .mobile-dock {
      background: linear-gradient(115deg, #fffffff2, #eef2ffd9);
      -webkit-backdrop-filter: blur(18px) saturate(1.35);
      backdrop-filter: blur(18px) saturate(1.35);
    }
  }
  .workspace.menu-open .mobile-dock { visibility: hidden; }
  .mobile-dock :is(a,button) {
    display: grid;
    grid-template-rows: 20px auto;
    place-content: center;
    justify-items: center;
    gap: 4px;
    min-width: 0;
    min-height: 44px;
    padding: 4px 2px;
    border: 1px solid transparent;
    border-radius: 13px;
    background: transparent;
    color: #455374;
    font-size: .69rem;
    font-weight: 680;
    line-height: 1.15;
    text-align: center;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-dock span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-dock svg { width: 20px; height: 20px; }
  .mobile-dock :is(a,button):active { background: #eaf0ff; }
  .mobile-dock :is([aria-current="page"], .is-current) { border-color: #d2dbfa; background: #e7edff; color: #293e9c; }
  .mobile-dock :focus-visible { outline-offset: -1px; }
  @media (prefers-reduced-transparency: reduce) {
    .mobile-dock { background: #f9fbff; -webkit-backdrop-filter: none; backdrop-filter: none; }
  }
  .sidebar {
    position: fixed;
    z-index: 26;
    inset: 0 auto 0 0;
    width: min(332px, calc(100% - 28px));
    height: 100vh;
    height: 100dvh;
    visibility: hidden;
    transform: translateX(-100%);
    transition: transform 205ms cubic-bezier(.2,.75,.24,1), visibility 0s 205ms;
    box-shadow: 10px 0 40px #0b132e33;
  }
  .workspace.menu-open .sidebar { visibility: visible; transform: none; transition-delay: 0s; }
  .sidebar-header { padding: 10px 13px; padding-top: max(10px, env(safe-area-inset-top)); }
  .brand img { width: 128px; }
  .drawer-close, .menu-toggle { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: white; }
  .menu-toggle:hover { color: var(--blue); background: var(--lavender); }
  .drawer-close { color: var(--nav-ink); background: #223252; border-color: #4c608b; }
  .drawer-close:hover { background: #354a77; }
  .menu-toggle svg, .drawer-close svg { width: 20px; height: 20px; }
  .drawer-scrim { display: block; position: fixed; z-index: 25; inset: 0; visibility: hidden; pointer-events: none; opacity: 0; background: #0b142b7a; transition: opacity 190ms ease, visibility 0s 190ms; }
  .workspace.menu-open .drawer-scrim { opacity: 1; visibility: visible; pointer-events: auto; transition-delay: 0s; }
  .topbar { min-height: 64px; gap: 8px; padding: 7px 12px; }
  .topbar-left { gap: 10px; }
  .account-toggle { justify-content: center; width: 44px; padding: 0; }
  .account-toggle > svg, .account-trigger-text { display: none; }
  .preview-bar { padding: .52rem .75rem; }
}
@media (max-width: 760px) {
  .columns, .hero { grid-template-columns: 1fr; }
  .hero { min-height: 166px; }
  .hero img { position: absolute; width: 160px; right: 0; top: 0; opacity: .26; }
  .list-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .list-filters .search { grid-column: 1 / -1; }
  td, th { padding: .58rem .7rem; }
}
@media (max-width: 440px) {
  .task-board { grid-template-columns: 1fr; }
  .main-content { padding: .75rem; }
  .editor-fields { grid-template-columns: 1fr; }
  .view-actions .search { width: 100%; }
  .summary { display: grid; }
  .meta { justify-content: start; }
  .stats { gap: .5rem; }
  .stat { padding: .72rem; min-height: 92px; }
  .tracking-grid, .list-filters { padding-inline: .7rem; }
  .tracking-heading { grid-template-columns: minmax(0, 1fr) auto; }
  .hero-link { display: flex; width: fit-content; margin: .3rem 0 0; }
  .preview-bar-actions { justify-content: start; }
  .preview-bar-actions .button { min-height: 40px; }
  .session-screen { padding: .85rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
  .account-panel { animation: none; }
}
.session-site { display: inline-block; margin-top: 1rem; }
.session-links { display: flex; flex-wrap: wrap; gap: 0 18px; }
.session-links .session-site { display: inline-flex; align-items: center; min-height: 44px; }
.role-picker-body { justify-items: start; }
.editor-plan { display: grid; gap: .56rem; padding: .8rem; border: 1px solid #cbd6ef; border-radius: 9px; background: #f5f7ff; }
.editor-plan p { color: var(--muted); font-size: .84rem; }
.editor-plan label small { color: var(--muted); font-size: .78rem; font-weight: 480; }
.plan-checklists { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .7rem; }
.plan-checklists:empty { display: none; }
.plan-checklists fieldset { display: grid; align-content: start; gap: .42rem; min-width: 0; margin: 0; padding: .6rem; border: 1px solid var(--line); border-radius: 7px; background: white; }
.plan-checklists legend { padding: 0 .25rem; font-size: .83rem; font-weight: 750; }
.plan-checklists label { display: flex; align-items: start; gap: .4rem; font-size: .82rem; line-height: 1.35; }
.plan-checklists input { flex: none; margin: .08rem 0 0; }
.editor-monthly { min-width: 0; margin: 0; }
.editor-monthly legend { padding-inline: .25rem; font-weight: 730; }
.maintenance-options { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .65rem; min-width: 0; margin: 0; padding: 0; border: 0; }
.editor-note { color: var(--muted); font-size: .86rem; }
.maintenance-periods { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); gap: .7rem; padding: .8rem; }
.maintenance-period { display: grid; align-content: start; gap: .65rem; min-width: 0; padding: .8rem; border: 1px solid var(--line); border-radius: 10px; background: #f9faff; }
.maintenance-period-heading { display: flex; align-items: start; justify-content: space-between; flex-wrap: wrap; gap: .35rem; }
.maintenance-hours { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: .3rem; margin: 0; }
.maintenance-hours dt, .maintenance-sent { color: var(--muted); font-size: .75rem; }
.maintenance-hours dd { margin: .15rem 0 0; font-size: .85rem; font-weight: 690; overflow-wrap: anywhere; }
@media (max-width: 440px) { .maintenance-options { grid-template-columns: 1fr; } }
@media (max-width: 440px) { .plan-checklists { grid-template-columns: 1fr; } }

.client-dashboard { display: grid; gap: 20px; }
.client-welcome {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: #fff;
  border: 1px solid #344560;
  border-radius: 22px;
  background: #111a2c;
  box-shadow: 0 14px 36px #14244213;
}
.client-welcome-cover {
  position: absolute;
  z-index: -2;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 12%;
  opacity: .65;
}
.client-welcome::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, #0c1428f5 0%, #111c32ed 31%, #142039a6 60%, #15213852 100%),
    linear-gradient(0deg, #0e172ce0, transparent 76%);
  pointer-events: none;
}
.client-welcome:not(.has-brand-cover) .client-welcome-cover { object-fit: contain; object-position: right center; opacity: .5; }
.client-welcome-body { display: grid; gap: 42px; min-height: 310px; padding: clamp(20px, 3vw, 35px); }
.client-welcome-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.client-company { display: flex; align-items: center; gap: 11px; min-width: 0; font-size: .87rem; font-weight: 680; }
.client-company > span:last-child { max-width: 30ch; overflow-wrap: anywhere; }
.client-company .org-logo {
  display: grid;
  place-items: center;
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  padding: 5px;
  border: 1px solid #ffffff3b;
  border-radius: 12px;
  background: #fff;
  color: #34457e;
  font-size: .83rem;
}
.client-company .org-logo img { width: 100%; height: 100%; object-fit: contain; border-radius: 5px; }
.client-site-picker { display: grid; gap: 5px; max-width: 240px; min-width: 0; flex: 0 1 240px; }
.client-site-picker > span { font-size: .7rem; font-weight: 660; color: #d5dff3; }
.client-site-picker select { min-height: 42px; width: 100%; border-radius: 9px; padding: 8px 10px; background: #142039ee; border-color: #8092b47d; color: #f5f7ff; font-size: .82rem; }
.client-site-picker option { background: #142039; color: white; }
.client-welcome-copy { width: min(100%, 620px); padding-bottom: 4px; }
.client-welcome-date { display: flex; align-items: center; gap: 8px; color: #cad7f1; font-size: .78rem; line-height: 1.4; }
.client-welcome-date svg { display: block; width: 20px; height: 20px; color: #d3deff; }
.client-welcome h1 { margin: 13px 0 12px; font-size: clamp(1.9rem, 3.7vw, 3.2rem); line-height: 1.12; letter-spacing: -.045em; overflow-wrap: anywhere; }
.client-welcome-copy > p:last-child { max-width: 39ch; font-size: 1rem; line-height: 1.6; color: #e0e6f3; }
.client-site-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 18px clamp(20px, 3vw, 35px);
  border-top: 1px solid #d1dfff29;
  background: #111b2fe8;
  backdrop-filter: blur(12px);
}
.client-site-bar > div:first-child { display: grid; gap: 4px; min-width: 0; }
.client-site-bar span { color: #c5d0e6; font-size: .72rem; font-weight: 630; }
.client-site-bar strong { font-size: clamp(1.05rem, 1.85vw, 1.45rem); line-height: 1.2; overflow-wrap: anywhere; }
.client-site-bar small { color: #c5d0e6; font-size: .75rem; }
.client-site-actions { display: flex; flex-wrap: wrap; gap: 8px; flex: none; }
.client-site-actions .button { min-height: 44px; }
.client-site-actions .primary { background: #dce5ff; border-color: #dce5ff; color: #24376f; }
.client-site-actions .primary:hover { background: #fff; border-color: #fff; color: #172b61; }
.client-site-actions .client-site-visit { border-color: #95a6cd69; background: #ffffff0a; color: #f1f5ff; }
.client-site-actions .client-site-visit:hover { border-color: #bdcbeb; background: #ffffff17; color: #fff; }

.client-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.client-stats > a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  text-decoration: none;
  color: var(--ink);
}
.client-stats a:hover { background: #f9faff; border-color: #a1afe1; }
.client-stats strong { grid-column: 1; font-size: 1.9rem; font-weight: 740; line-height: 1; font-variant-numeric: tabular-nums; }
.client-stats span { grid-column: 1; font-size: .8rem; line-height: 1.4; color: var(--muted); font-weight: 640; }
.client-stats svg { grid-column: 2; grid-row: 1 / 3; align-self: center; width: 21px; height: 21px; fill: none; stroke: #5364a8; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.client-dashboard [id] { scroll-margin-top: 110px; }
.client-dashboard-columns { gap: 18px; }
.client-dashboard-columns > div { min-width: 0; }
.client-approval-note { padding-inline: 3px; color: var(--muted); font-size: .81rem; }
.client-next-step { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px 25px; padding: 17px 20px; border: 1px solid #d9e1f5; border-radius: 12px; background: #eef2ff; }
.client-next-step strong { font-size: .87rem; }
.client-next-step p { margin-top: 3px; font-size: .81rem; color: var(--muted); }
.client-next-step a { display: inline-flex; align-items: center; min-height: 44px; }

@media (max-width: 1100px) {
  .client-site-bar { align-items: flex-start; flex-direction: column; gap: 14px; }
}
@media (max-width: 650px) {
  .client-dashboard { gap: 16px; }
  .client-welcome { border-radius: 17px; }
  .client-welcome-body { min-height: 290px; padding: 21px; gap: 32px; }
  .client-welcome-top { flex-wrap: wrap; gap: 15px; }
  .client-company { font-size: .81rem; }
  .client-company .org-logo { flex-basis: 42px; width: 42px; height: 42px; }
  .client-site-picker { max-width: none; flex: 1 1 100%; }
  .client-site-picker select { min-height: 44px; }
  .client-welcome h1 { font-size: clamp(1.8rem, 7.8vw, 2.65rem); margin-top: 12px; }
  .client-welcome-copy > p:last-child { font-size: .9rem; line-height: 1.55; max-width: 31ch; }
  .client-welcome::before { background: linear-gradient(90deg, #0c1428f2, #111c32d9 62%, #142039b0), linear-gradient(0deg, #0e172ca0, transparent); }
  .client-site-bar { padding: 17px 21px; }
  .client-site-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .client-site-actions .button { padding-inline: 9px; font-size: .78rem; }
  .client-stats { gap: 8px; }
  .client-stats > a { display: flex; flex-direction: column; padding: 15px 10px; gap: 9px; border-radius: 11px; }
  .client-stats strong { font-size: 1.7rem; }
  .client-stats span { font-size: .7rem; }
  .client-stats svg { display: none; }
  .client-dashboard-columns { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .client-next-step { align-items: flex-start; flex-direction: column; padding: 15px 18px; gap: 7px; }
}
@media (prefers-reduced-motion: no-preference) {
  .client-welcome-copy { animation: client-welcome-in 350ms ease-out both; }
  @keyframes client-welcome-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
}

/* 1.4.13: preserve native CRM controls within narrow dialogs. */
input:is([type=checkbox],[type=radio]) {width:1.1rem;min-width:1.1rem;max-width:1.1rem;height:1.1rem;padding:0;flex:none;accent-color:var(--blue)}
.label.check {align-items:flex-start;min-width:0;overflow-wrap:anywhere}
.label.check input {margin-top:.15rem}
.editor-fields > *, .inline-form > * {min-width:0;max-width:100%}
.editor-footer,.inline-form .view-actions {flex-wrap:wrap}
.editor-footer button,.inline-form .view-actions button {max-width:100%;white-space:normal;overflow-wrap:anywhere}
@media(max-width:480px){.editor-fields{grid-template-columns:minmax(0,1fr)}.editor-fields .wide{grid-column:1/-1}.editor-fields :is(input:not([type=checkbox]):not([type=radio]),textarea,select){font-size:16px}}
