:root {
  --canvas: #f6f6f8;
  --paper: #fff;
  --ink: #202026;
  --muted: #666570;
  --line: #e7e7ed;
  --accent: #4c4ed0;
  --radius: 20px;
  font: 16px/1.5 Inter, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
h1, h2, h3, p, ol, ul, dl, dd, blockquote { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button, summary, select { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #8184ef; outline-offset: 3px; }
a { color: inherit; text-decoration: none; }
svg { flex: none; }
small { font-size: .8125rem; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.topbar { background: var(--paper); border-bottom: 1px solid var(--line); }
.top-inner { position: relative; max-width: 1512px; min-height: 66px; margin: auto; padding: 0 44px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.logo { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.punk-name { font: italic 850 1.45rem/1 "Segoe UI", Arial, sans-serif; letter-spacing: -.075em; }
.punk-name em { color: #993376; font-style: inherit; }
.logo-crm { font-size: .95rem; letter-spacing: -.02em; color: #777683; font-weight: 550; }
.punk-sigil { position: relative; flex: none; width: 34px; height: 32px; }
.punk-sigil::before, .punk-sigil::after { content: ''; position: absolute; }
.punk-sigil::before {
  inset: 3px 1px 8px;
  border: 1px solid #ce91ff;
  border-radius: 4px 4px 2px 2px;
  background: radial-gradient(circle, #67f3ea 0 1px, transparent 1.5px) right 4px top 4px / 4px 4px no-repeat,
    linear-gradient(90deg, #67f3ea, #bd82ff 38%, #ff66c4) center bottom 4px / 77% 2px no-repeat, #231334;
}
.punk-sigil::after {
  inset: 18px 8px 1px;
  background: linear-gradient(#1b102e, #1b102e) left 4px top 4px / 56% 1px no-repeat,
    linear-gradient(#1b102e, #1b102e) left 4px top 7px / 38% 1px no-repeat,
    linear-gradient(120deg, #e1b9ff, #fa78cc);
  clip-path: polygon(0 0, 100% 0, 100% 72%, 79% 100%, 0 100%);
}
.topbar nav { display: flex; align-items: center; gap: 5px; }
.topbar nav button { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 9px; background: transparent; padding: 9px 14px; color: var(--muted); font-size: .875rem; font-weight: 625; white-space: nowrap; }
.topbar nav button:hover, .topbar nav button[aria-current] { background: #efeff4; color: #242430; }
.topbar nav button[aria-current] svg { color: var(--accent); }
.account { display: flex; align-items: center; gap: 12px; }
.environment { display: inline-flex; gap: 7px; align-items: center; border: 1px solid var(--line); border-radius: 20px; padding: 5px 10px; color: var(--muted); font-size: .8125rem; font-weight: 600; white-space: nowrap; }
.environment i { width: 6px; height: 6px; border-radius: 50%; background: #7173cf; }
.workspace { max-width: 1512px; margin: auto; padding: 41px 44px 48px; }
.heading { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 18px; margin-bottom: 27px; }
.heading h1, .login-info h1 { font-size: clamp(2.5rem, 5vw, 4.25rem); font-weight: 750; letter-spacing: -.07em; line-height: 1.04; }
.heading p { color: var(--muted); margin-top: 10px; }
.button, .icon-button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 41px; padding: 9px 15px; border-radius: 10px; border: 1px solid transparent; font-size: .875rem; font-weight: 650; white-space: nowrap; }
.button.primary { background: #24242b; color: white; border-color: #24242b; }
.button.primary:hover { background: #383840; }
.button.secondary, .icon-button { background: #fff; border-color: #dfdfe7; }
.button.secondary:hover:not(:disabled), .icon-button:hover { background: #f0f0f6; }
.icon-button { padding: 0; width: 38px; min-height: 38px; }
.exit { width: 33px; min-height: 33px; border-color: transparent; color: var(--muted); }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 23px; }
.metric { min-width: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 17px; padding: 16px 19px 15px; display: grid; gap: 3px; }
.metric > span { color: #4d4c58; font-size: .875rem; font-weight: 635; }
.metric strong { font-size: clamp(1.45rem, 2.8vw, 2.35rem); line-height: 1.2; letter-spacing: -.059em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metric.featured { background: #272731; color: #fff; border-color: #272731; }
.metric.featured > span, .metric.featured small { color: #cfcedd; }
.board-shell { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.toolbar, .section-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.toolbar { padding: 14px 15px; border-bottom: 1px solid var(--line); }
.controls { display: flex; align-items: center; gap: 6px; min-width: 0; }
select, input, textarea { min-width: 0; width: 100%; min-height: 41px; padding: 9px 12px; background: #fff; border: 1px solid #dedee7; border-radius: 10px; }
select { appearance: none; padding-right: 34px; font-size: .875rem; background-image: linear-gradient(45deg, transparent 50%, #6d6d79 50%), linear-gradient(135deg, #6d6d79 50%, transparent 50%); background-position: calc(100% - 15px) 17px, calc(100% - 10px) 17px; background-size: 5px 5px; background-repeat: no-repeat; }
.controls select { width: 207px; font-weight: 650; }
.controls { flex-wrap: wrap; }
.pipeline-picker, .rename-form { display: flex; align-items: center; gap: 4px; min-width: 0; }
.rename-pipeline { opacity: 0; }
.pipeline-picker:hover .rename-pipeline, .pipeline-picker:focus-within .rename-pipeline { opacity: 1; }
.rename-form input { width: min(205px, 34vw); }
.deal-tasks { list-style: none; padding: 0; }
.deal-tasks li, .deal-tasks label { display: flex; align-items: center; gap: 8px; }
.deal-tasks li { justify-content: space-between; }
.deal-tasks input { width: 17px; height: 17px; min-height: 0; }
.deal-tasks input:checked + span { text-decoration: line-through; color: var(--muted); }
#task-form { margin-top: 8px; }
@media (hover: none) { .rename-pipeline { opacity: 1; } }
.add-pipeline { padding-inline: 10px; }
.search { max-width: 240px; min-width: 175px; width: 30%; display: flex; align-items: center; gap: 8px; padding: 0 11px; border: 1px solid var(--line); border-radius: 10px; color: #6b6975; }
.search:focus-within { outline: 2px solid #8184ef; }
.search input { min-height: 39px; padding: 0; border: 0; background: none; font-size: .875rem; outline: 0; }
.board { display: grid; grid-template-columns: repeat(var(--columns), minmax(198px, 1fr)); gap: 9px; padding: 10px; overflow-x: auto; }
.column { min-width: 0; min-height: 285px; background: #f7f7f9; border: 1px solid #f0f0f4; border-radius: 13px; padding: 8px; transition: background .15s, border-color .15s; }
.column.drop { background: #eeeefe; border-color: #8a8ae2; }
.column > header { padding: 7px 5px 10px; }
.column > header div { display: flex; gap: 7px; align-items: center; }
.column h2 { font-size: .9rem; font-weight: 700; overflow-wrap: anywhere; }
.column > header i { width: 7px; height: 7px; flex: none; background: #7779cc; border-radius: 50%; }
.column[data-tone="middle"] > header i { background: #bd8736; }
.column[data-tone="late"] > header i { background: #9c73b9; }
.column[data-tone="won"] > header i { background: #52936f; }
.column[data-tone="lost"] > header i { background: #b46772; }
.column > header span { margin-left: auto; color: #565463; background: #ebebf0; border-radius: 6px; padding: 0 6px; font-size: .8125rem; font-weight: 650; }
.column > header small { display: block; margin: 3px 0 0 14px; }
.cards { display: grid; gap: 7px; }
.deal-card { width: 100%; min-width: 0; display: grid; gap: 3px; padding: 11px; text-align: left; background: #fff; border: 1px solid #e6e6ed; border-radius: 10px; box-shadow: 0 1px 2px #27283c0b; cursor: grab; user-select: none; }
.deal-card:hover { border-color: #aaa9db; }
.deal-card.dragging { opacity: .4; cursor: grabbing; }
.card-title { font-size: .9rem; line-height: 1.25; font-weight: 700; overflow-wrap: anywhere; }
.contact { color: var(--muted); font-size: .8125rem; overflow-wrap: anywhere; }
.amount { font-size: .9375rem; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.card-foot { display: flex; justify-content: space-between; align-items: center; gap: 4px; margin-top: 4px; }
.card-foot time { color: var(--muted); white-space: nowrap; font-size: .75rem; }
.tag { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-radius: 6px; background: #eeeef2; color: #555360; padding: 3px 6px; font-size: .75rem; font-weight: 675; }
.tag.seo { background: #e8e7fb; color: #5044a1; }
.tag.paid { background: #fff0dc; color: #8a5315; }
.tag.referral { background: #e6f3ed; color: #2d694d; }
.empty-column { padding: 14px 6px; color: var(--muted); font-size: .875rem; text-align: center; }
.add-card { border: 0; display: flex; align-items: center; justify-content: center; width: 100%; gap: 4px; margin-top: 6px; min-height: 34px; background: none; border-radius: 7px; font-size: .8125rem; color: var(--muted); }
.add-card:hover { background: #ececf3; color: var(--ink); }
.report-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 15px; }
.report-controls small { margin-left: 4px; }
.article-filters label { display: grid; gap: 5px; }
.article-filters label:first-child { flex: 1 1 220px; }
.article-report .page-cell { min-width: 230px; max-width: 390px; }
.article-report td { white-space: nowrap; }
.article-search-sample { display: block; opacity: .7; }
.article-pages { justify-content: flex-end; margin: 16px 0 0; }
.report-card { min-width: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.report-card h2 { font-size: 1.25rem; line-height: 1.25; letter-spacing: -.035em; }
.report-card p { color: var(--muted); margin-top: 5px; }
.report-grid, .integration-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.table-scroll { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; margin-top: 10px; }
th, td { border-bottom: 1px solid #eeeef3; padding: 9px 8px; text-align: right; }
th:first-child { text-align: left; padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
tbody tr:last-child th, tbody tr:last-child td { border: 0; }
thead th { color: var(--muted); font-size: .8125rem; font-weight: 625; }
td { white-space: nowrap; font-variant-numeric: tabular-nums; }
.page-cell { font-weight: 600; overflow-wrap: anywhere; min-width: 100px; }
.bar-cell { display: flex; justify-content: flex-end; align-items: center; gap: 9px; }
.chart-bar { display: block; width: min(110px, 10vw); min-width: 30px; height: 6px; border-radius: 6px; background: #f0f0f6; }
.chart-bar i { display: block; height: 100%; border-radius: 6px; background: #9695b0; }
.chart-bar i.seo { background: #7273d3; }
.chart-bar i.paid { background: #ce9b59; }
.chart-bar i.referral { background: #6da68d; }
.report-note { margin-top: 12px; color: var(--muted); font-size: .875rem; }
.report-card .empty { padding: 14px 0 3px; }
.sites, .field-list { list-style: none; padding: 0; }
.sites li, .field-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.sites li:last-child, .field-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.sites small { display: block; }
.integration-icon { width: 35px; height: 35px; display: grid; place-items: center; background: #eeeef7; color: #4e43a1; border-radius: 9px; font-weight: 750; margin-bottom: 12px; }
.chat-icon::before { content: ''; width: 15px; height: 12px; border: 1.5px solid currentColor; border-radius: 4px 4px 4px 0; }
.direct-icon { color: #a53334; background: #fae9e8; }
.integration .tag { margin-top: 13px; }
dialog { color: var(--ink); border: 1px solid var(--line); padding: 0; box-shadow: 0 24px 80px #20202d26; }
dialog::backdrop { background: rgb(29 28 42 / 33%); }
.modal { width: min(92vw, 540px); border-radius: var(--radius); max-height: 90dvh; }
.drawer { width: min(100%, 490px); max-width: 100%; height: 100dvh; max-height: 100dvh; margin: 0 0 0 auto; border-radius: 18px 0 0 18px; }
.panel-head { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; padding: 19px 22px; border-bottom: 1px solid var(--line); background: var(--paper); }
.panel-head h2 { line-height: 1.19; font-size: 1.5rem; letter-spacing: -.045em; padding-top: 4px; overflow-wrap: anywhere; }
.panel-head button { flex: none; }
.panel-body { padding: 18px 22px 24px; }
.form, .form label, .stage-label { display: grid; gap: 6px; min-width: 0; }
.form [hidden] { display: none; }

.workspace-switch {
  display: grid;
  gap: 4px;
  margin: 8px 0;
  padding: 14px 12px;
  overflow-wrap: anywhere;
}
.workspace-switch span { color: var(--muted); font-size: .75rem; }
.platform-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8125rem; }
.sidebar-return { display: block; padding: 10px 12px; font-size: .875rem; }
.sidebar-return:hover { text-decoration: underline; }
.platform-main .heading { margin-bottom: 24px; }
.platform-metrics { margin-bottom: 20px; }
.platform-spaces { display: grid; gap: 12px; }
.platform-space { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.platform-space h2 { margin: 0 0 5px; font-size: 1.05rem; }
.platform-space p { margin: 4px 0 0; color: var(--muted); overflow-wrap: anywhere; }
.platform-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.platform-space .license-id { font-family: ui-monospace, monospace; font-size: .8rem; }
.platform-space .license-live { color: #2e785b; background: #e5f4ea; }
.chooser { max-width: 840px; margin: auto; }
.chooser .report-card { margin-bottom: 12px; }

@media (max-width: 720px) {
  .workspace-switch { display: none; }
  .sidebar-return { padding: 7px 10px; }
  .platform-space { align-items: flex-start; }
}
.form { gap: 12px; }
.form label, .stage-label, legend { font-size: .875rem; font-weight: 650; }
.form input, .form textarea { font-size: 1rem; font-weight: 400; }
textarea { resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; }
.form-error { color: #a42e49; font-size: .875rem; }
.form-error:empty { display: none; }
.link { width: fit-content; display: inline-flex; align-items: center; justify-content: center; gap: 5px; border: 0; background: transparent; padding: 3px 0; color: var(--accent); font-weight: 675; font-size: .875rem; }
.link:hover { text-decoration: underline; }
.lead-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 15px; }
.lead-details dt { color: var(--muted); font-size: .8125rem; }
.lead-details dd { overflow-wrap: anywhere; font-size: .9rem; }
.activity-meta { color: var(--muted); font-size: .8125rem; overflow-wrap: anywhere; }
.activity-meta time { margin-left: 4px; }
fieldset { margin: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; }
.stage-edit-row { display: flex; align-items: center; gap: 5px; margin-bottom: 5px; }
.stage-edit-row button { flex: none; }
.muted { color: var(--muted); font-size: .9rem; }
.field-list li span { color: var(--muted); font-size: .875rem; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; background: #f4f4f7; padding: 10px; border-radius: 9px; font-size: .8125rem; }
.login-layout { max-width: 1260px; margin: 0 auto; padding: clamp(42px, 8vw, 120px) 44px 44px; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(330px, 420px); align-items: center; gap: clamp(25px, 6vw, 100px); }
.eyebrow { color: var(--accent); font-size: .8125rem; letter-spacing: .09em; font-weight: 740; }
.login-info h1 { font-size: clamp(3.1rem, 5.6vw, 5.6rem); margin-top: 13px; line-height: 1.01; }
.login-info h1 span { color: #6462b0; }
.login-info > p { color: var(--muted); font-size: 1.125rem; margin-top: 17px; max-width: 370px; }
.flow-preview { margin-top: 33px; max-width: 440px; padding: 15px 20px; border: 1px solid #383848; background: #292933; border-radius: 16px; color: #dddcec; }
.flow-preview div { display: flex; justify-content: space-between; align-items: center; gap: 5px; font-size: .875rem; }
.flow-preview .flow-track { height: 43px; margin-bottom: 5px; }
.flow-track i { flex: 1; height: 5px; border-radius: 40px; background: #8987e3; opacity: .7; }
.flow-track i:nth-child(3n + 1) { height: 20px; opacity: .45; }
.flow-track i:nth-child(3n + 2) { height: 30px; opacity: .8; }
.flow-track i:nth-child(4n + 3) { height: 40px; }
.login-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 14px 40px #28283b08; padding: 25px; }
.login-card h2 { margin-bottom: 15px; font-size: 1.625rem; letter-spacing: -.05em; }
.login-card .button { width: 100%; }
.login-card > .button { margin-top: 8px; }
.google-mark { font-weight: 800; color: #4d57ab; }
.demo-login { text-align: center; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.demo-login small { display: block; }
.loading { padding: 30px; text-align: center; }
#toast { position: fixed; z-index: 2; bottom: 18px; left: 50%; translate: -50%; padding: 9px 14px; border-radius: 9px; background: #24242d; color: #fff; font-size: .875rem; opacity: 0; pointer-events: none; max-width: 90vw; }
#toast.show { opacity: 1; }
@media (max-width: 880px) {
  .top-inner, .workspace { padding-inline: 20px; }
  .report-grid { grid-template-columns: 1fr; }
}
@media (max-width: 670px) {
  .top-inner { flex-wrap: wrap; padding: 8px 13px 6px; gap: 5px; }
  .topbar nav { order: 2; width: 100%; justify-content: space-between; gap: 2px; }
  .topbar nav button { flex: 1; justify-content: center; padding-inline: 4px; gap: 5px; }
  .account { gap: 4px; }
  .workspace { padding: 23px 12px; }
  .heading { margin-bottom: 17px; }
  .metrics, .integration-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .metric { padding: 11px; }
  .metric strong { font-size: 1.45rem; }
  .metrics { margin-bottom: 13px; }
  .toolbar { padding: 8px; }
  .search { width: 100%; max-width: none; }
  .controls { width: 100%; }
  .controls select { width: auto; max-width: 100%; flex: 1; }
  .board { padding: 7px; }
  .report-card { padding: 14px 10px; }
  .login-layout { grid-template-columns: 1fr; padding: 26px 15px; }
  .flow-preview { display: none; }
}
@media (max-width: 375px) {
  .edit-pipeline span { display: none; }
  .integration-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.crm-layout { display: grid; grid-template-columns: 202px minmax(0, 1fr); min-height: 100dvh; }
.sidebar { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 24px; padding: 20px 12px 12px; background: #fff; border-right: 1px solid var(--line); }
.sidebar .logo { margin-inline: 6px; }
.sidebar nav { display: grid; gap: 3px; }
.sidebar nav button { display: flex; align-items: center; gap: 10px; min-height: 43px; width: 100%; background: none; border: 0; border-radius: 9px; padding: 8px 12px; color: var(--muted); font-weight: 630; font-size: .875rem; text-align: left; }
.sidebar nav button:hover { background: #f5f5f8; color: var(--ink); }
.sidebar nav button[aria-current] { background: #ecebfa; color: #42418b; }
.sidebar-account { display: flex; align-items: center; gap: 7px; margin-top: auto; padding-top: 11px; border-top: 1px solid var(--line); }
.account-initial { display: grid; place-items: center; width: 31px; height: 31px; flex: none; border-radius: 9px; color: #5349a2; background: #eeebfb; font-weight: 750; text-transform: uppercase; }
.account-copy { flex: 1; min-width: 0; font-size: .875rem; }
.account-copy strong, .account-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-layout .workspace { width: 100%; margin: 0 auto; padding: 32px 24px 42px; }
.crm-layout .heading h1 { font-size: clamp(2.25rem, 4vw, 3.75rem); }
.crm-layout .board { grid-template-columns: repeat(var(--columns), minmax(175px, 1fr)); }
.board-filters { display: flex; flex-wrap: wrap; gap: 7px; width: auto; }
.board-filters select, .board-filters .search { width: min(182px, 42vw); }
.card-title { display: flex; justify-content: space-between; gap: 5px; }
.drag-grip { align-self: start; color: #77758a; padding: 0 2px; touch-action: none; }
.dragging { opacity: .25; }
.drag-ghost { position: fixed; z-index: 6; top: 0; left: 0; pointer-events: none; box-shadow: 0 12px 26px #27283a38; background: #fff; border-color: #a09cec; will-change: transform; }
.column.drop { box-shadow: inset 0 0 0 1px #a09cec; }
.card-status { display: flex; justify-content: space-between; gap: 4px; border-top: 1px solid var(--line); padding-top: 5px; margin-top: 3px; font-size: .75rem; color: var(--muted); min-width: 0; }
.card-status span:first-child { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.card-status span:last-child { display: flex; align-items: center; gap: 3px; }
.card-status svg { width: 13px; }
.overdue { color: #a42e49; }
.editable-details { margin-top: 9px; }
.inline-value { display: inline-flex; align-items: center; gap: 5px; min-width: 0; max-width: 100%; }
.editable-text { overflow-wrap: anywhere; cursor: text; }
.editable-text.unset { color: var(--muted); }
.inline-pencil { display: inline-grid; place-items: center; width: 27px; height: 27px; flex: none; border: 0; border-radius: 6px; background: #f0eff8; color: #514c91; padding: 0; }
.inline-value > .inline-pencil { opacity: .55; }
.inline-value:hover > .inline-pencil, .inline-value:focus-within > .inline-pencil { opacity: 1; }
.inline-pencil:hover { background: #e5e2fa; }
.inline-pencil svg { width: 14px; }
.column > header > div { position: relative; }
.stage-pencil { position: absolute; right: 0; top: 24px; width: 22px; height: 22px; opacity: 0; }
.column header:hover .stage-pencil, .stage-pencil:focus-visible { opacity: 1; }
.column [hidden] { display: none; }
.stage-name-form { flex: 1; }
.stage-name-form input { font-size: .8125rem; }
.quick-deal { margin-top: 7px; padding: 8px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
@media (hover: none) { .stage-pencil { opacity: 1; } }
.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; width: 100%; min-width: 0; font-size: .875rem; line-height: 1.5; }
.inline-form input, .inline-form select { flex: 1; width: 75px; min-height: 34px; padding-block: 5px; }
.inline-form .form-error { flex-basis: 100%; }
.panel-head h2 { flex: 1; min-width: 0; }
.panel-head h2 .inline-value:has(form) { width: 100%; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.deal-tasks li > div { display: flex; align-items: center; gap: 5px; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tabs button[aria-pressed="true"] { background: #ecebfa; border-color: #dad7f5; color: #42418b; }
.workspace-list { list-style: none; padding: 0; margin-top: 9px; }
.workspace-list > li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.workspace-list > li:last-child { border-bottom: 0; padding-bottom: 0; }
.workspace-list small { display: block; }
.workspace-list input[type="checkbox"], .form .check-label input { width: 17px; height: 17px; min-height: 0; }
.task-check, .form .check-label { display: flex; align-items: center; gap: 6px; }
.settings-fields { margin-top: 12px; }
.analytics-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.analytics-nav button { color: var(--muted); border-color: var(--line); background: white; }
.analytics-nav button.current { border-color: #d9d5f5; color: #414087; background: #edebfb; }
.sales-filter { display: flex; align-items: end; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.sales-filter label { display: grid; gap: 3px; flex: 1 1 125px; min-width: 0; font-size: .875rem; font-weight: 650; }
.sales-filter .form-error { flex-basis: 100%; }
.sales-metrics { grid-template-columns: repeat(5,minmax(0,1fr)); margin-bottom: 12px; }
.sales-visuals { display: grid; grid-template-columns: minmax(0,2fr) minmax(220px,1fr); gap: 12px; }
.sales-visuals, .sales-visuals ~ .report-card { margin-bottom: 12px; }
.sales-key { display: flex; flex-wrap: wrap; gap: 5px 12px; }
.sales-key span { font-size: .8125rem; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.sales-key span::before { content: ''; display: block; width: 9px; height: 9px; border-radius: 3px; background: #aaaab7; }
.sales-key .outsource::before, .sales-bar .outsource { background: #625fca; }
.sales-key .oneoff::before, .sales-bar .oneoff { background: #b8a9ef; }
.sales-key .unspecified::before, .sales-bar .unspecified { background: #a8adba; }
.sales-months { display: flex; align-items: end; gap: 10px; overflow-x: auto; margin-top: 12px; padding-bottom: 4px; }
.sales-month { display: grid; justify-items: center; gap: 3px; min-width: 64px; flex: 1; }
.sales-month strong { font-size: .875rem; }
.sales-month time { font-size: .8125rem; color: var(--muted); white-space: nowrap; }
.sales-bar { display: flex; flex-direction: column-reverse; height: 127px; width: min(58px,90%); border-radius: 7px; overflow: hidden; background: repeating-linear-gradient(#f4f3f9 0 1px,transparent 1px 25%); }
.sales-bar i { display: block; }
.sales-mix { list-style: none; margin: 8px 0 13px; padding: 0; }
.sales-mix li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.sales-mix li:last-child { border: 0; }
.row-action { text-align: left; overflow-wrap: anywhere; }
.register small { display: block; }
.register th:first-child { min-width: 155px; }
.register td:first-of-type { white-space: nowrap; }
.register-pages { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 9px; }
@media (max-width: 1100px) { .sales-metrics { grid-template-columns: repeat(3,minmax(0,1fr)); } }
@media (max-width: 700px) { .sales-visuals { grid-template-columns: 1fr; } .sales-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); } }

.deal-screen { position: fixed; inset: 0; z-index: 3; overflow: auto; background: var(--canvas); }
#toast { z-index: 4; }
.deal-screen[hidden], #app[hidden] { display: none; }
.deal-top { position: sticky; z-index: 2; top: 0; background: #fff; border-bottom: 1px solid var(--line); }
.deal-top-inner { max-width: 1480px; min-height: 72px; margin: auto; padding: 8px 24px; display: flex; align-items: center; gap: 16px; }
.deal-caption { flex: 1; min-width: 0; }
.deal-caption small { display: block; font-size: .8125rem; }
.deal-caption h1 { font-size: clamp(1.2rem, 2.4vw, 1.8rem); line-height: 1.14; letter-spacing: -.045em; overflow-wrap: anywhere; }
.deal-caption h1:focus { outline: 0; }
.deal-caption .inline-value:has(form) { width: min(100%, 480px); }
.deal-top-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.deal-columns { max-width: 1480px; margin: 0 auto; display: grid; grid-template-columns: minmax(300px, .82fr) minmax(0, 1.4fr); gap: 15px; padding: 18px 24px; align-items: start; }
.deal-information { display: grid; gap: 11px; min-width: 0; }
.deal-block { padding: 15px 17px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.deal-block h2, .deal-conversation h2 { font-size: 1.095rem; letter-spacing: -.025em; line-height: 1.25; }
.deal-block h3 { font-size: .875rem; font-weight: 695; margin-top: 12px; }
.deal-section-head { display: flex; justify-content: space-between; gap: 8px; align-items: start; margin-bottom: 10px; }
.deal-section-head .tag { max-width: 48%; }
.deal-block .lead-details { margin-top: 9px; }
.deal-block details { margin-top: 12px; font-size: .875rem; }
.deal-block .stage-label select { max-width: 360px; }
.deal-block .contact-actions { margin-top: 7px; }
.deal-block .deal-tasks { display: grid; gap: 8px; margin-top: 8px; }
.deal-block .deal-tasks small { display: block; }
.deal-conversation { position: sticky; top: 90px; display: flex; flex-direction: column; height: calc(100dvh - 108px); min-height: 380px; border: 1px solid var(--line); border-radius: 14px; background: #fff; overflow: hidden; min-width: 0; }
.deal-conversation > header { border-bottom: 1px solid var(--line); padding: 15px 17px; }
.deal-feed { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 17px; background: #f8f8fb; }
.deal-feed ol { list-style: none; padding: 0; display: grid; gap: 9px; }
.history-date { justify-self: center; font-size: .75rem; border-radius: 12px; padding: 3px 8px; color: var(--muted); background: #eeeef4; }
.history-row { display: flex; }
.history-row.note { justify-content: flex-end; }
.history-bubble { min-width: 0; max-width: min(90%, 570px); padding: 8px 11px; border: 1px solid #e8e7ef; border-radius: 11px 11px 11px 4px; background: white; overflow-wrap: anywhere; }
.history-row.note .history-bubble { background: #eeecfb; border-color: #e4dff8; border-radius: 11px 11px 4px 11px; }
.history-row.event .history-bubble { background: transparent; border: 0; padding-block: 2px; color: var(--muted); }
.history-bubble p { font-size: .9rem; white-space: pre-wrap; }
.history-row.event p { font-size: .8125rem; }
.history-bubble .activity-meta { display: flex; flex-wrap: wrap; gap: 5px; }
.deal-composer { padding: 9px 17px 12px; border-top: 1px solid var(--line); }
.composer-tabs { display: flex; gap: 6px; margin-bottom: 8px; }
.composer-tabs button { border-radius: 8px; padding: 5px 8px; color: var(--muted); }
.composer-tabs button[aria-pressed="true"] { background: #eeecfb; color: #42418b; }
#deal-compose { gap: 7px; }
#deal-compose textarea { max-height: 115px; }
.composer-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.task-check #only-mine { width: 17px; height: 17px; min-height: 0; }
@media (max-width: 720px) {
  .deal-top { position: relative; }
  .deal-top-inner { flex-wrap: wrap; gap: 6px; padding: 8px 10px; }
  .deal-caption { order: 2; flex-basis: 100%; padding: 5px 2px 0; }
  .deal-top-actions { margin-left: auto; }
  .deal-columns { display: flex; flex-direction: column; gap: 10px; padding: 10px; }
  .deal-information, .deal-conversation { width: 100%; }
  .deal-conversation { order: -1; position: static; height: auto; min-height: 0; }
  .deal-feed { min-height: 150px; max-height: 42dvh; }
  .deal-block, .deal-conversation > header, .deal-composer, .deal-feed { padding-inline: 11px; }
  .composer-footer { flex-wrap: wrap; }
}
@media (max-width: 940px) {
  .crm-layout { grid-template-columns: 66px minmax(0, 1fr); }
  .sidebar { align-items: center; padding-inline: 8px; }
  .sidebar .logo { margin: 0; }
  .sidebar .punk-name, .sidebar .logo-crm, .sidebar .account-copy { display: none; }
  .sidebar nav { width: 100%; }
  .sidebar nav button { justify-content: center; }
  .sidebar nav button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .sidebar-account { flex-direction: column; }
}
@media (max-width: 610px) {
  .crm-layout { display: block; }
  .sidebar { position: sticky; top: 0; z-index: 2; flex-direction: row; height: auto; padding: 5px 9px; border-right: 0; border-bottom: 1px solid var(--line); gap: 10px; }
  .sidebar nav { display: flex; justify-content: space-between; gap: 1px; }
  .sidebar nav button { width: auto; flex: 1; padding-inline: 5px; }
  .sidebar-account { padding-top: 0; margin: 0; border: 0; }
  .sidebar-account .account-initial { display: none; }
  .crm-layout .workspace { padding: 20px 12px; }
  .board-filters, .board-filters .search { width: 100%; }
  .board-filters select { width: 100%; }
}
