




@font-face {
  font-family: 'Onest';
  src: url('/static/fonts/Onest-cyrillic.woff2?v=20260928-1') format('woff2');
  font-weight: 300 700; font-style: normal; font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Onest';
  src: url('/static/fonts/Onest-latin.woff2?v=20260928-1') format('woff2');
  font-weight: 300 700; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('/static/fonts/IBMPlexMono-cyrillic.woff2?v=20260928-1') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('/static/fonts/IBMPlexMono-latin.woff2?v=20260928-1') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}




:root { --cab-w: 1600px; }


body {
  color-scheme: inherit; background: var(--bg-page);
  line-height: 1.45; -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: var(--font-ui); }
.mono { font-family: var(--font-mono); font-size: .92em; letter-spacing: -.01em; }
.card { border: 0; border-radius: var(--radius-card); }
::selection { background: var(--sp-accent-soft); }



@media (min-width: 768px) {
  .client-main { scrollbar-gutter: stable; }
  

  body.preview-on .client-shell { height: calc(100dvh - 44px); }
}
@media (min-width: 768px) and (hover: hover) and (pointer: fine) {
  .client-shell > .topbar { max-width: calc(var(--cab-w) + var(--scrollbar-w)); padding-right: calc(24px + var(--scrollbar-w)); }
}

.cf-panel, .chat-messages, .select-popover__options, .modal, .drawer-body { overscroll-behavior: contain; }

.modal::-webkit-scrollbar-track:vertical { margin-block: var(--radius-card); }
.table-card::-webkit-scrollbar-track:horizontal { margin-inline: var(--radius-card); }



.topbar {
  width: 100%; max-width: var(--cab-w); margin: 0 auto; height: 60px;
  padding: 0 24px; gap: 14px; background: transparent; border-bottom: 0;
}
.topbar-brand { gap: 14px; color: inherit; text-decoration: none; }
.topbar .logo-img { height: 25px; }
html[data-theme="light"] .logo-on-dark,
html:not([data-theme="light"]) .logo-on-light { display: none; }
.topbar-title { padding-left: 14px; border-left: 1px solid var(--sp-line-2); line-height: 1.25; }
.topbar-name { font-size: var(--fs-body); font-weight: var(--fw-medium); letter-spacing: 0; }
.topbar-sub {
  font-size: var(--fs-small); font-weight: var(--fw-regular); color: var(--sp-ink-3);
  text-transform: none; letter-spacing: 0;
}
.topbar-requisites.btn-ghost { height: 31px; padding: 0 10px; font-size: 14px; }
.topbar-icons { gap: 6px; }
.topbar .bell {
  width: 34px; height: 34px; padding: 0; border-radius: var(--radius-sm);
  color: var(--sp-ink-3); font-size: 18px;
}
.topbar .bell:hover { background: var(--sp-panel-2); color: var(--sp-ink); }
.topbar .bell-season { width: 18px; height: 18px; }
.bell-badge { background: var(--sp-accent); color: var(--sp-on-accent); box-shadow: 0 0 0 2px var(--sp-canvas); }
.topbar .topbar-settings[aria-current="page"] { background: var(--sp-panel-2); color: var(--sp-ink); }
.topbar .logout-btn { width: 34px; height: 34px; padding: 0; justify-content: center; font-size: 18px; }



.theme-switch { display: inline-flex; gap: 2px; padding: 2px; border-radius: var(--radius-sm); background: var(--sp-panel-2); }
.theme-switch button {
  width: 32px; height: 29px; display: grid; place-items: center; padding: 0;
  border: 0; border-radius: 6px; background: none; color: var(--sp-ink-3);
  font-size: 17px; cursor: pointer; transition: color .15s, background .15s;
}
.theme-switch button:hover { color: var(--sp-ink); }
.theme-switch button:focus-visible { outline: 1px solid var(--sp-accent); outline-offset: -1px; }
html[data-theme="light"] .theme-switch [data-theme-set="light"],
html:not([data-theme="light"]) .theme-switch [data-theme-set="dark"] { background: var(--sp-panel-3); color: var(--sp-ink); }



.cab-fab { display: none; }
@media (max-width: 1023px) {
  .tabbar { background: var(--sp-panel); box-shadow: var(--sp-shadow), inset 0 0 0 1px var(--sp-line); }
  .tabbar-item { color: var(--sp-ink-3); }
  .tabbar-item.active { color: var(--sp-accent-text); }
  .tabbar-item:focus-visible { outline-color: var(--sp-accent); }
  .tabbar-badge, .tabbar-dot, .more-badge { background: var(--sp-accent); color: var(--sp-on-accent); }
  .more-scrim { background: var(--overlay-filters); }
  .more-sheet { background: var(--sp-panel); box-shadow: var(--sp-shadow); }
  .more-grab { background: var(--sp-line-2); }
  .more-item { background: var(--sp-panel-2); color: var(--sp-ink); }
  .more-item:hover { background: var(--sp-panel-3); }
  .more-item .ph { color: var(--sp-ink-2); }
  .more-item.active { box-shadow: inset 0 0 0 1px var(--sp-accent); color: var(--sp-accent-text); }
  .more-item.active .ph { color: var(--sp-accent-text); }
  .more-sep { background: var(--sp-line); }
  .more-user-name { color: var(--sp-ink); }
  .more-user-role { color: var(--sp-ink-3); }
  .more-user .logout-btn { width: 34px; height: 34px; padding: 0; justify-content: center; font-size: 18px; color: var(--sp-ink-3); }
  .more-foot .app-version { height: 29px; border-radius: var(--radius-sm); font-family: var(--font-mono); color: var(--sp-ink-3); }
  
  .more-sheet .more-foot .theme-switch { padding: 2px; background: var(--sp-panel-2); }
  .more-sheet .more-foot .theme-switch [data-theme-set] { display: grid; width: 34px; height: 30px; font-size: 17px; }

  

  .topbar :is(.topbar-requisites, .topbar-settings, .theme-switch, .logout-form) { display: none; }

  

  .cab-fab {
    display: grid; place-items: center; position: fixed; right: 16px; bottom: calc(var(--tabbar-space) + 4px); z-index: 37;
    width: 54px; height: 54px; padding: 0; border: 0; border-radius: 18px;
    background: var(--sp-accent); color: var(--sp-on-accent); box-shadow: var(--sp-shadow);
    font-size: 26px; cursor: pointer; -webkit-tap-highlight-color: transparent;
  }
  .cab-fab:hover { background: var(--sp-accent-hover); }
  .cab-fab:focus-visible { outline: 2px solid var(--sp-accent-soft); outline-offset: 2px; }
  .cab-fab:disabled { opacity: .45; cursor: default; }
  .cf-page .cf-layout :is(.cab-table, .mgr-table) tr.row-cta { display: none; }
  
  .cf-main:has(> .cab-fab) .table-card { padding-bottom: 66px; }
}


.preview-banner, .preview-banner .btn-ghost { color: var(--sp-on-accent); }
.preview-banner .btn-ghost:hover { background: var(--sp-overlay-lite); color: var(--sp-on-accent); }


.btn-primary {
  min-height: 36px; padding: 0 14px; border-radius: var(--radius-md);
  font-weight: var(--fw-medium); white-space: nowrap;
}
.btn-primary.btn-cta, .btn-primary.btn-lg {
  width: auto; min-height: 36px; padding: 0 16px; border-radius: var(--radius-md);
  font-size: var(--fs-body); font-weight: var(--fw-medium);
}
.btn-secondary {
  min-height: 36px; padding: 0 14px; border-radius: var(--radius-md);
  background: var(--sp-panel-2); color: var(--sp-ink); font-weight: var(--fw-medium); white-space: nowrap;
}
.btn-secondary:hover { background: var(--sp-panel-3); }
.btn-sm, .btn-secondary.btn-sm, .btn-ghost.btn-sm {
  min-height: 31px; padding: 0 10px; border-radius: var(--radius-sm); font-size: 14px;
}
.btn-ghost { color: var(--sp-ink-2); border-radius: var(--radius-sm); }
.btn-ghost:hover { color: var(--sp-ink); background: var(--sp-panel-2); }
.btn-ghost:disabled:hover { background: none; }
.btn-icon {
  width: 34px; height: 34px; padding: 0; justify-content: center;
  border-radius: var(--radius-sm); color: var(--sp-ink-3);
}
.btn-icon .ph { font-size: 18px; }
.btn-icon:hover { background: var(--sp-panel-2); color: var(--sp-ink); }
.btn-outline { border-color: var(--sp-line-2); border-radius: var(--radius-md); }



.with-copy { display: inline-flex; align-items: center; gap: 2px; min-width: 0; max-width: 100%; vertical-align: middle; }
.with-copy > :first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copy-btn {
  display: inline-grid; place-items: center; flex: none; width: 24px; height: 24px; margin: -4px 0;
  padding: 0; border: 0; border-radius: 6px; background: none; color: var(--sp-ink-3);
  cursor: pointer; vertical-align: middle;
}
.copy-btn .ph { font-size: 15px; }
.copy-btn:hover { background: var(--sp-panel-2); color: var(--sp-ink); }
.copy-btn:focus-visible { outline: 2px solid var(--sp-accent); outline-offset: -2px; }
.copy-btn.copied { color: var(--sp-success); }


:is(.st-title-sub, .log-field) .with-copy > :first-child { white-space: normal; overflow-wrap: anywhere; }


.preview-choice-wrap { position: relative; }
.preview-choice-wrap > .preview-choice { padding-right: 44px; }
.preview-choice-wrap > .copy-btn { position: absolute; right: 10px; bottom: 8px; margin: 0; }



.field-label { font-size: var(--fs-small); color: var(--sp-ink-3); margin-bottom: 6px; }
.field-input {
  min-height: 36px; padding: 0 10px; border: 0; border-radius: var(--radius-sm);
  background: var(--sp-panel-2); font-size: var(--fs-body);
}
textarea.field-input { padding: 8px 10px; }
.field-input:focus { box-shadow: inset 0 0 0 1px var(--sp-accent); }
.field-input::placeholder { color: var(--sp-ink-3); opacity: 1; }
.form-hint { font-size: var(--fs-small); color: var(--sp-ink-3); }

.select-popover__trigger, .date-picker__trigger, .select-popover__chip {
  min-height: 36px; padding: 0 10px; gap: 8px; border: 0; border-radius: var(--radius-sm);
  background: var(--sp-panel-2);
}
.select-popover__trigger:hover:not(:disabled), .date-picker__trigger:hover:not(:disabled) { background: var(--sp-panel-3); }
.select-popover__trigger[aria-expanded="true"], .date-picker__trigger[aria-expanded="true"],
.select-popover__trigger:focus-visible, .date-picker__trigger:focus-visible { box-shadow: inset 0 0 0 1px var(--sp-accent); }
.select-popover__trigger > .ph-caret-down, .date-picker__trigger > .ph-caret-down { font-size: 14.5px; color: var(--sp-ink-3); }
.date-picker__trigger .ph-calendar-blank { color: var(--sp-ink-3); }
.select-popover__panel, .calendar-panel {
  border: 1px solid var(--sp-line-2); border-radius: var(--radius-lg); box-shadow: var(--sp-shadow);
}
.select-popover__option { border-radius: var(--radius-sm); font-size: var(--fs-body); min-height: 36px; }
.select-popover__search { border: 0; background: var(--sp-panel-2); }
.calendar-day, .calendar-footer button, .calendar-nav button { border-radius: var(--radius-sm); }
.calendar-footer { border-top-color: var(--sp-line); }
.status-dot { width: 7px; height: 7px; }


.check-label { gap: 10px; }
.check-box {
  width: 18px; height: 18px; border: 0; border-radius: 5px; background: var(--sp-panel-3);
  color: transparent; font-size: 12.5px;
}
.check-label input:checked + .check-box { background: var(--sp-accent); color: var(--sp-on-accent); }
.check-label input:focus-visible + .check-box { box-shadow: 0 0 0 2px var(--sp-accent-soft), inset 0 0 0 1px var(--sp-accent); }

.check-chip {
  min-height: 31px; padding: 0 12px; border: 0; border-radius: var(--radius-full);
  background: var(--sp-panel-2); color: var(--sp-ink-2); font-size: 14px;
}
.check-chip:hover { color: var(--sp-ink); background: var(--sp-panel-3); }
.check-chip .check-box { display: none; }
.check-chip:has(input:checked) { background: var(--sp-accent-soft); color: var(--sp-accent-text); }
.check-chip input:checked ~ .check-chip-label { color: var(--sp-accent-text); }
.check-chip:has(input:focus-visible) { box-shadow: inset 0 0 0 1px var(--sp-accent); }



.switch-check, .switch { width: 32px; height: 18px; background: var(--sp-panel-3); transition: background .2s; }
.switch-knob { top: 3px; left: 3px; width: 12px; height: 12px; background: var(--sp-on-accent); transition: transform .2s; }
.switch-check:has(input:checked), .switch.on { background: var(--sp-accent); }
.switch-check:has(input:checked) .switch-knob, .switch.on .switch-knob { transform: translateX(14px); }
.switch-check:has(input:focus-visible) { outline: 0; box-shadow: 0 0 0 2px var(--sp-accent-soft); }



.segmented { padding: 2px; gap: 2px; border: 0; border-radius: var(--radius-sm); background: var(--sp-panel-2); }
.segmented-item {
  min-height: 29px; padding: 0 11px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px; font-size: 14px; font-weight: var(--fw-regular); color: var(--sp-ink-2);
}
.segmented-item:hover { color: var(--sp-ink); }
.segmented-item.active { background: var(--sp-panel-3); color: var(--sp-ink); box-shadow: none; }
.cf-toolbar .segmented, .ng-toolbar .segmented { background: var(--sp-panel); }



.badge {
  min-height: 27px; padding: 0 10px; gap: 7px; border: 0; border-radius: var(--radius-full);
  background: var(--sp-panel-2); color: var(--sp-ink); font-size: 14px; font-weight: var(--fw-regular);
}
.badge.badge-sm { min-height: 25px; padding: 0 9px; font-size: 13.5px; }
.badge::before { width: 6px; height: 6px; }
.tag {
  min-height: 25px; padding: 0 8px; border: 0; border-radius: var(--radius-full);
  background: var(--sp-panel-2); color: var(--sp-ink-2); font-size: 13.5px; font-weight: var(--fw-regular);
}
.tag::before { display: none; }
.tag-group { gap: 4px; }
.badge-new, .badge-urgent, .badge-quote-sent, .badge-deletion,
.client-table .cf-marks > *, .client-project .badge-urgent {
  min-height: 22px; margin: 0; padding: 0 7px; gap: 5px; border: 0; border-radius: var(--radius-full);
  font-size: 13px; font-weight: var(--fw-medium); text-transform: none; letter-spacing: 0;
  background: color-mix(in srgb, var(--badge-accent) 15%, transparent); color: var(--badge-accent);
}
.badge-urgent { color: var(--sp-urgent); background: var(--sp-urgent-soft); }
.badge-urgent::before { background: currentColor; }
.badge-new { color: var(--sp-accent-text); background: var(--sp-accent-soft); }
.badge-new::before, .badge-quote-sent::before { display: none; }
.badge-new-close { display: inline-flex; font-size: 12px; opacity: .7; }
.badge-new-close:hover { opacity: 1; }

.client-project .review-title-row .badge-accepted {
  min-height: 22px; padding: 0 7px; font-size: 13px; font-weight: var(--fw-medium);
  background: var(--sp-success-soft); color: var(--sp-success);
}
.client-project .review-title-row .badge-accepted::before { display: none; }


.client-main > .content { max-width: var(--cab-w); padding: 0 24px 24px; gap: 0; }
.client-main > .content.cf-page { max-width: var(--cab-w); }
.client-main > .content.client-projects { gap: 0; }
.content-head { align-items: baseline; flex-wrap: wrap; gap: 8px 16px; padding: 14px 0 16px; }
.content-head .page-title { font-size: 29px; font-weight: var(--fw-medium); letter-spacing: -.02em; line-height: 1.2; }
.content-meta { gap: 18px; font-size: var(--fs-body); color: var(--sp-ink-3); }
.content-meta b { margin-left: 4px; color: var(--sp-ink); font-weight: var(--fw-medium); }



.cf-layout { grid-template-columns: 285px minmax(0, 1fr); gap: 8px; }


.cf-panel { padding: 12px 10px; border-radius: var(--radius-card); overflow-anchor: none; }
.cf-form { gap: 0; }


.cf-panel-head { min-height: 39px; padding: 2px 6px 10px; }
.cf-panel-title { font-size: 17px; font-weight: var(--fw-medium); color: var(--sp-ink); }
.cf-page .cf-reset { min-height: 27px; padding: 0 8px; font-size: var(--fs-small); }


.cf-sec { padding: 0 0 8px; box-shadow: inset 0 1px 0 var(--sp-line); }
.cf-sec-title {
  float: left; width: 100%; padding: 10px 6px 4px; margin: 0;
  font-size: var(--fs-small); font-weight: var(--fw-regular); color: var(--sp-ink-3);
}


.cf-sec-title:has(.cf-grip) { display: flex; align-items: center; }
.cf-grip {
  flex: none; display: grid; place-items: center; width: 18px; height: 22px; margin: -3px 26px -3px 0;
  padding: 0; border: 0; border-radius: 5px; background: none; color: var(--sp-ink-3); opacity: .55;
  font-size: 16px; cursor: grab; touch-action: none;
}
.cf-grip:hover, .cf-grip:focus-visible { opacity: 1; color: var(--sp-ink-2); }
.cf-grip:focus-visible { outline: 1px solid var(--sp-accent); outline-offset: 1px; }
.cf-sec.is-dragging { position: relative; z-index: 3; border-radius: var(--radius-md); background: var(--sp-panel-2); box-shadow: var(--sp-shadow); }
.cf-sec.is-dragging .cf-grip { opacity: 1; cursor: grabbing; }
@media (max-width: 767px) {
  .cf-grip { display: none; }
}
.cf-opts { gap: 0; }
.cf-opt {
  grid-template-columns: 34px minmax(0, 1fr) auto; column-gap: 10px;
  min-height: 34px; padding: 4px 6px; border-radius: var(--radius-sm);
  font-size: var(--fs-body); color: var(--sp-ink); user-select: none;
}


.cf-opt { position: relative; }
.cf-opt:hover { background: var(--sp-panel-2); }
.cf-opt.is-empty { opacity: .42; }
.cf-opt.is-empty:hover { background: none; }
.cf-slot { gap: 8px; }
.cf-slot > input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.cf-box {
  width: 18px; height: 18px; flex: none; display: grid; place-items: center;
  border-radius: 5px; background: var(--sp-panel-3); color: var(--sp-on-accent);
}
.cf-box .ph { font-size: 12.5px; opacity: 0; }
.cf-box.round { border-radius: 50%; }
.cf-slot > input:checked + .cf-box { background: var(--sp-accent); }
.cf-slot > input:checked + .cf-box .ph { opacity: 1; }
.cf-slot > input:checked + .cf-box.round::after {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--sp-on-accent);
}
.cf-slot > input:focus-visible + .cf-box { box-shadow: 0 0 0 2px var(--sp-accent-soft), inset 0 0 0 1px var(--sp-accent); }
.cf-n { font-size: var(--fs-small); color: var(--sp-ink-3); }


.cf-subopts {
  display: flex; gap: 2px; padding: 2px; margin: 2px 6px 6px 50px;
  border-radius: var(--radius-sm); background: var(--sp-panel-2);
}
.cf-opt.cf-sub {
  flex: 1 1 0; display: flex; align-items: center; justify-content: center; min-width: 0;
  min-height: 27px; padding: 2px 6px; border-radius: 6px;
  font-size: 13px; line-height: 1.2; text-align: center; color: var(--sp-ink-2);
}
.cf-opt.cf-sub:hover { background: none; color: var(--sp-ink); }
.cf-opt.cf-sub .cf-slot { position: absolute; }
.cf-opt.cf-sub:has(input:checked) { background: var(--sp-panel-3); color: var(--sp-ink); }
.cf-opt.cf-sub:has(input:focus-visible) { box-shadow: inset 0 0 0 1px var(--sp-accent); }
.cf-range { gap: 6px; padding: 2px 6px 4px; }
.cf-input {
  height: 34px; padding: 0 10px; border: 0; border-radius: var(--radius-sm);
  background: var(--sp-panel-2); font-size: var(--fs-body);
}
.cf-input:focus { box-shadow: inset 0 0 0 1px var(--sp-accent); }
.cf-input::placeholder { color: var(--sp-ink-3); }



.cf-page { --cf-row-h: 36px; }
.cf-page .cf-main, .cf-page .cf-results { gap: 0; }
.cf-toolbar { gap: 8px; }
.cf-page .cf-toolbar, .cf-page #gantt-native[data-mode=client] .ng-toolbar { flex: none; min-height: 44px; padding: 0 0 8px; }
.cf-page .cf-chips { flex: none; margin-bottom: 8px; }

.cf-search .ph { left: 10px; font-size: 17px; color: var(--sp-ink-2); }
.cf-page .cf-search input {
  height: 36px; padding: 0 12px 0 34px; border: 0; border-radius: var(--radius-sm);
  background: var(--sp-panel); font-size: var(--fs-body);
}
.cf-page .cf-search input:focus { box-shadow: inset 0 0 0 1px var(--sp-accent); }
.cf-page .cf-search input::placeholder { color: var(--sp-ink-2); }


.search-hist {
  position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; right: 0;
  max-height: min(360px, 60vh); overflow-y: auto; overscroll-behavior: contain;
  padding: 6px; border: 1px solid var(--border-hairline); border-radius: var(--radius-md);
  background: var(--sp-pop); box-shadow: var(--sp-shadow);
}
.search-hist[hidden] { display: none; }
.search-hist-title { margin: 0; padding: 6px 10px; font-size: var(--fs-label); color: var(--sp-ink-3); }
.search-hist-item {
  display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 4px 0 10px;
  border-radius: var(--radius-sm); color: var(--sp-ink); font-size: var(--fs-small); cursor: pointer;
}
.search-hist-item:hover, .search-hist-item.is-active { background: var(--sp-pop-hover); }
.search-hist .ph { position: static; transform: none; }
.search-hist-item > .ph { font-size: 17px; color: var(--sp-ink-3); }
.search-hist-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-hist-text mark { background: none; color: inherit; font-weight: var(--fw-bold); }
.search-hist-x {
  flex: none; width: 32px; height: 32px; padding: 0; border: 0; border-radius: var(--radius-sm); background: transparent;
  display: inline-flex; align-items: center; justify-content: center; color: var(--sp-ink-3); cursor: pointer;
}
.search-hist-x .ph { font-size: 15px; color: inherit; }
.search-hist-x:hover { background: var(--sp-line-2); color: var(--sp-ink); }
.cf-page .cf-filters-btn { background: var(--sp-panel); }
.cf-page .cf-filters-btn:hover { background: var(--sp-panel-2); }
.cf-filters-btn .cf-count { background: var(--sp-accent); color: var(--sp-on-accent); }
.cf-chips { gap: 6px; }
.cf-chip {
  min-height: 31px; padding: 0 6px 0 10px; gap: 6px; border-radius: var(--radius-full);
  background: var(--sp-panel); color: var(--sp-ink); font-size: var(--fs-body); font-weight: var(--fw-medium);
}
.cf-chip:hover { background: var(--sp-panel-2); }
.cf-chip-k { color: var(--sp-ink-2); font-weight: var(--fw-regular); }
.cf-chip .ph { font-size: 14.5px; color: var(--sp-ink-3); }



.client-shell:has(#gantt-native) { height: 100dvh; min-height: 0; overflow: hidden; }
body.preview-on .client-shell:has(#gantt-native) { height: calc(100dvh - 44px); }
.client-main:has(#gantt-native) { overflow: hidden; }
.client-main > .content.cf-page:has(#gantt-native) { height: 100%; }
.cf-page:has(#gantt-native) .cf-layout { flex: 1 1 0; min-height: 0; align-items: stretch; }
.cf-page:has(#gantt-native) .cf-main { flex: 1 1 0; min-height: 0; }
@media (min-width: 768px) {
  .client-shell:has(.cf-page) { height: 100dvh; min-height: 0; overflow: hidden; }
  body.preview-on .client-shell:has(.cf-page) { height: calc(100dvh - 44px); }
  .client-main:has(.cf-page) { overflow: hidden; }
  .client-main > .content.cf-page { height: 100%; }
  .cf-page .content-head { flex: none; height: 65px; }
  .cf-page .cf-layout { flex: 1 1 0; min-height: 0; align-items: stretch; }
  .cf-page .cf-main { flex: 1 1 0; min-height: 0; }
  

  .cf-main > .cf-results { flex: 0 1 auto; min-height: 0; display: flex; flex-direction: column; }
  .cf-page .cf-results > .table-card { flex: 0 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; }
  

  .cf-page .cab-table thead th {
    position: sticky; top: 0; z-index: 2;
    background: var(--sp-panel); box-shadow: inset 0 -1px 0 var(--sp-line);
  }
}

@media (min-width: 1440px) {
  .cf-page.client-projects .cf-panel { position: static; max-height: none; min-height: 0; overflow-y: auto; }
}
@media (max-width: 767px) {
  

  .client-main:not(:has(#gantt-native)), .client-main:has(.project-work) { overflow: visible; }
  .cf-page .cf-toolbar {
    position: sticky; top: 0; z-index: 6; padding: 8px 0; margin-top: -8px; background: var(--sp-canvas);
  }
}

@media (max-width: 1439px) {
  .cf-page.cf-open .cf-panel {
    width: 324px; padding: 12px 10px 0; border: 0; border-radius: 0 var(--radius-card) var(--radius-card) 0;
    box-shadow: var(--sp-shadow);
  }
  .cf-sheet-foot { margin: auto -10px 0; padding: 12px 10px; background: var(--sp-panel); border-top: 1px solid var(--sp-line); }
  .cf-sheet-foot .btn-primary { padding: 0 14px; }
}





.cf-layout .table-card { overflow: clip; padding: 0; }
.cf-layout table.cab-table { table-layout: fixed; min-width: 972px; }
.cab-col-num { width: 52px; }
.cab-col-state { width: 168px; }
.cab-col-date { width: 112px; }
.cab-col-cost { width: 118px; }
.cab-col-paid { width: 86px; } 
.cab-col-svc { width: 150px; }
.cab-col-act { width: 121px; }
.cf-layout .cab-table th {
  padding: 10px 8px; border: 0; white-space: nowrap;
  font-size: var(--fs-small); font-weight: var(--fw-regular); color: var(--sp-ink-3);
  text-transform: none; letter-spacing: 0;
}
.cf-layout .cab-table td { padding: 12px 8px; border: 0; border-top: 1px solid var(--sp-line); font-size: var(--fs-body); }
.cf-layout .cab-table th:first-child, .cf-layout .cab-table td:first-child { padding-left: 16px; }
.cf-layout .cab-table th:last-child, .cf-layout .cab-table td:last-child { padding-right: 16px; }
.cab-table .table-sort { gap: 4px; }
.cab-table .table-sort .ph { font-size: 13.5px; }
.cab-table .table-sort.is-active { color: var(--sp-ink); }
.cab-table tbody tr:hover { background: none; }
.cab-table tbody tr.row-clickable { cursor: pointer; }
.cab-table tbody tr.row-clickable:hover td { background: var(--sp-panel-2); }
.cab-table tbody tr.row-clickable:hover :is(.badge, .tag:not(.tag-more)) { background: var(--sp-panel-3); }
.cab-table tr.is-done td { opacity: .6; }
.cab-table td.cell-num { font-family: var(--font-mono); font-size: 13.5px; color: var(--sp-ink-3); }
.cab-table td.cell-name { font-weight: var(--fw-medium); color: var(--sp-ink); }
.client-table.cab-table td.cell-date { color: var(--sp-ink); font-weight: var(--fw-regular); }
.client-table.cab-table td.cell-date.cell-overdue { color: var(--overdue); }
.client-table.cab-table td.cell-cost { color: var(--sp-ink); font-weight: var(--fw-regular); }
.client-table.cab-table td.cell-cost.is-empty,
.client-table.cab-table td.cell-date.is-empty { color: var(--sp-ink-3); font-weight: var(--fw-regular); }


.cf-paid { gap: 6px; font-size: var(--fs-body); vertical-align: middle; }
.cf-paid .ph { font-size: 19px; }
.cf-paid.yes { color: var(--sp-success); font-weight: var(--fw-regular); }
.cf-paid.no { color: var(--sp-ink-3); }
.cf-paid.no .ph { opacity: .75; }
.cf-layout .cab-table .cf-paid > span {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}


.cf-layout .cab-table .row-actions { gap: 2px; justify-content: flex-end; }
.cab-table .btn-action {
  width: 34px; height: 34px; justify-content: center; border-radius: var(--radius-sm);
  color: var(--sp-ink-3);
}
.cab-table .btn-action .ph { font-size: 18px; }
.cab-table .btn-action > span:not(.cf-chat-badge) { display: none; }
.cab-table .btn-action:hover { background: var(--sp-panel-3); color: var(--sp-ink); }
.cab-table .btn-action.ready { color: var(--sp-accent-text); }
.cab-table .btn-action:disabled { opacity: .35; background: none; color: var(--sp-ink-3); cursor: default; }
.cab-table .btn-action.cf-chat.has-unread { color: var(--sp-ink); }
.cf-layout .cab-table .cf-chat-badge {
  position: absolute; top: 1px; right: 0; left: auto; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: var(--radius-full); background: var(--sp-accent); color: var(--sp-on-accent);
  font-size: 11px; font-weight: var(--fw-semibold); line-height: 17px; box-shadow: none;
}

.cab-table tr.row-cta:hover { background: none; }
.cf-layout .cab-table tr.row-cta td { padding: 8px 16px; border-top: 0; }
.cab-table tr.row-cta .dashed-cta {
  min-height: 45px; padding: 0 12px; border: 1px dashed var(--sp-line-2); border-radius: var(--radius-md);
  color: var(--sp-ink-2); font-weight: var(--fw-regular);
}
.cab-table tr.row-cta .dashed-cta:hover { background: var(--sp-panel-2); color: var(--sp-ink); }
.cab-table .dashed-cta .ph { font-size: 18px; }
.cab-table .empty-state { padding: 28px 16px; color: var(--sp-ink-3); }



:is(.cab-table, .mgr-table) :is(th, td) { text-align: left; }
:is(.cab-table, .mgr-table) :is(th, td).cell-r { text-align: right; }
:is(.cab-table, .mgr-table) :is(th, td).cell-c { text-align: center; }
:is(.cab-table, .mgr-table) :is(th, td):first-child { padding-right: 12px; }
:is(.cab-table, .mgr-table) .table-sort { position: relative; }
:is(.cab-table, .mgr-table) .table-sort .ph { position: absolute; top: 50%; left: 100%; margin: -7px 0 0 4px; }
:is(.cab-table, .mgr-table) th.cell-r .table-sort .ph { left: auto; right: 100%; margin: -7px 4px 0 0; }

:is(.cab-table, .mgr-table) tbody tr.row-clickable > td { height: 62px; padding-top: 8px; padding-bottom: 8px; }
:is(.cab-table, .mgr-table) .row-link { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
:is(.cab-table, .mgr-table) .cell-sub {
  display: block; margin-top: 2px; font-size: var(--fs-small); font-weight: var(--fw-regular); color: var(--sp-ink-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
:is(.cab-table, .mgr-table) .cf-state { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
:is(.cab-table, .mgr-table) .cf-marks .badge-new-close { padding: 0; border: 0; background: none; line-height: 1; }
:is(.cab-table, .mgr-table) .cf-marks { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 0 10px; padding-left: 2px; }
:is(.cab-table, .mgr-table) .cf-marks > * {
  min-height: 0; margin: 0; padding: 0; gap: 3px; border: 0; border-radius: 0; background: none;
  font-size: 13px; line-height: 16px; font-weight: var(--fw-medium); white-space: nowrap;
}
:is(.cab-table, .mgr-table) .cf-marks > *::before { display: none; }
:is(.cab-table, .mgr-table) .cf-marks > .badge-urgent { color: var(--sp-urgent); }
:is(.cab-table, .mgr-table) .cf-marks > :is(.badge-new, .badge-quote-sent) { color: var(--sp-accent-text); }
:is(.cab-table, .mgr-table) .cf-marks > .badge-quote-ok { color: var(--sp-success); }
:is(.cab-table, .mgr-table) .cf-marks > .badge-deletion { color: var(--sp-danger); }
:is(.cab-table, .mgr-table) td.cell-date { white-space: nowrap; font-variant-numeric: tabular-nums; }
:is(.cab-table, .mgr-table) .cf-date { display: flex; flex-direction: column; align-items: flex-start; }
:is(.cab-table, .mgr-table) .cf-date-note { margin-top: 2px; font-size: 13px; line-height: 16px; }
:is(.cab-table, .mgr-table) td.cell-cost { white-space: nowrap; font-variant-numeric: tabular-nums; }
:is(.cab-table, .mgr-table) .cost-kop { font-size: 13px; color: var(--sp-ink-3); }
:is(.cab-table, .mgr-table) .tag-group { display: flex; flex-wrap: nowrap; justify-content: flex-start; gap: 4px; min-width: 0; }
:is(.cab-table, .mgr-table) .tag {
  display: block; flex: 0 1 auto; min-width: 0; line-height: 25px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
:is(.cab-table, .mgr-table) .tag-extra { display: none; }
:is(.cab-table, .mgr-table) .tag-more { flex: none; padding: 0 4px; background: none; color: var(--sp-ink-3); }


:is(.cab-table, .mgr-table) .v-row { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
:is(.cab-table, .mgr-table) :is(.svc-line, .paid-word) { display: none; }



@container (max-width: 1000px) {
  .cf-layout table.cab-table { display: block; width: 100%; min-width: 0; }
  .cf-layout .cab-table colgroup, .cf-layout .cab-table thead { display: none; }
  .cf-layout .cab-table tbody, .cf-layout .cab-table tr:not(.row-clickable) { display: block; }
  .cf-layout .cab-table tbody tr.row-clickable {
    display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 4px 12px; align-items: center;
    grid-template-areas: "name name date" "name name cost" "state state paid" "svc num act";
    padding: 12px 16px; border-top: 1px solid var(--sp-line);
  }
  .cf-layout .cab-table tbody tr.row-clickable:hover { background: var(--sp-panel-2); }
  .cf-layout .cab-table tbody tr.row-clickable:hover td { background: none; }
  .cf-layout .cab-table td,
  .cf-layout .cab-table td:first-child,
  .cf-layout .cab-table td:last-child { display: block; min-width: 0; padding: 0; border: 0; text-align: left; }
  .cf-layout .cab-table tbody tr.row-clickable > td { height: auto; padding: 0; }
  .cf-layout .cab-table .v-table { display: none; }
  .cf-layout .cab-table .v-row { position: static; width: auto; height: auto; overflow: visible; clip-path: none; }
  .cf-layout .cab-table td.cell-name { grid-area: name; align-self: start; }
  .cf-layout .cab-table .row-link { font-size: 15.5px; }
  .cf-layout .cab-table .cell-sub { margin-top: 1px; }
  .cf-layout .cab-table td.cell-state { grid-area: state; }
  .cf-layout .cab-table .cf-state { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
  .cf-layout .cab-table .cf-marks { padding-left: 0; }
  .cf-layout .cab-table td.cell-date { grid-area: date; justify-self: end; text-align: right; }
  .cf-layout .cab-table .cf-date { display: inline; }
  .cf-layout .cab-table .cf-date-note { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .cf-layout .cab-table td.cell-cost { grid-area: cost; justify-self: end; text-align: right; font-weight: var(--fw-medium); }
  .client-table.cab-table td:is(.cell-date, .cell-cost).is-empty { font-weight: var(--fw-regular); color: var(--sp-ink-3); }
  .cf-layout .cab-table td.cell-paid { grid-area: paid; justify-self: end; }
  .cf-layout .cab-table .cf-paid { gap: 5px; font-size: var(--fs-small); }
  .cf-layout .cab-table .cf-paid .ph { font-size: 17px; }
  .cf-layout .cab-table .cf-paid > span { position: static; width: auto; height: auto; overflow: visible; clip-path: none; }
  .cf-layout .cab-table td.cell-svc { grid-area: svc; font-size: var(--fs-small); color: var(--sp-ink-3); }
  .cf-layout .cab-table td.cell-svc .tag-group { display: none; }
  .cf-layout .cab-table .svc-line { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cf-layout .cab-table td.cell-num { grid-area: num; justify-self: end; width: auto; font-size: 13px; }
  .cf-layout .cab-table td.cell-num::before { content: "№\00a0"; font-family: var(--font-ui); }
  .cf-layout .cab-table td.cell-act { grid-area: act; justify-self: end; margin: -8px -8px -8px 0; }
  .cf-layout .cab-table .row-actions { justify-content: flex-end; gap: 2px; }
  .cf-layout .cab-table .btn-action[disabled] { display: none; }
  .cf-layout .cab-table .btn-action.ready { width: auto; padding: 0 10px; gap: 6px; font-size: 14px; background: var(--sp-accent-soft); }
  .cf-layout .cab-table .btn-action.ready > span { display: inline; }
  .cf-layout .cab-table .cf-chat-badge { top: 0; right: -2px; }
  .cf-layout .cab-table tr.is-done td { opacity: 1; }
  .cf-layout .cab-table tr.is-done { opacity: .6; }
}



@media (min-width: 1100px) {
  .client-main:has(.project-work) { overflow-y: auto; }
  

  .client-project {
    --rail-h: calc(100dvh - 60px - 44px - 24px);
    display: grid; grid-template-columns: minmax(0, 1fr) 8px min(var(--chat-rail-w, 380px), calc(100% - 408px));
    grid-template-rows: auto auto 1fr;
    column-gap: 0; align-items: start;
    width: 100%; max-width: var(--cab-w); height: auto; margin: 0 auto; padding: 0 24px 24px;
  }
  body.preview-on .client-project { --rail-h: calc(100dvh - 44px - 60px - 44px - 24px); }
  .client-project-head, .client-project .project-body { display: contents; }
  .client-project-head .back-inline { grid-column: 1 / -1; grid-row: 1; }
  .client-project-headline { grid-column: 1; grid-row: 2; margin-bottom: 8px; }
  .client-project .project-work { grid-column: 1; grid-row: 3; overflow: visible; padding: 0; }
  

  .client-project .project-rail {
    grid-column: 3; grid-row: 2 / span 2; position: sticky; top: 44px;
    height: var(--rail-h);
  }
  .client-project .project-body:has(.project-work) .aside-resizer {
    grid-column: 2; grid-row: 2 / span 2; align-self: start; position: sticky; top: 44px; z-index: 1;
    width: auto; height: var(--rail-h); margin-inline: -4px;
  }
}


.dm-resizer {
  position: relative; z-index: 1; margin-inline: -4px; touch-action: none; cursor: col-resize;
  display: flex; align-items: center; justify-content: center;
}
.client-project .project-body:has(.project-work) .aside-resizer::before,
.dm-resizer::before {
  content: ''; width: 5px; height: 56px; border-radius: var(--radius-full);
  background: var(--sp-ink-2); opacity: .7;
  transition: opacity .15s, height .15s, background .15s;
}
.client-project .project-body:has(.project-work) .aside-resizer:hover::before,
.dm-resizer:hover::before { opacity: 1; height: 80px; background: var(--sp-ink-2); }
body.aside-resizing .client-project .project-body:has(.project-work) .aside-resizer::before,
body.aside-resizing .dm-resizer::before { opacity: 1; height: 80px; background: var(--sp-accent); }
.client-project-head { gap: 0; padding: 0; }
.client-project-head .back-inline {
  align-self: flex-start; min-height: 44px; padding: 0; align-items: center;
  background: none; gap: 6px; font-weight: var(--fw-regular);
}
.client-project-head .back-inline:hover { background: none; }
.client-project-headline {
  display: block; padding: 14px 16px 16px; border-radius: var(--radius-card); background: var(--sp-panel);
}
.client-project-headtext { gap: 0; }
.review-title-row { gap: 8px 10px; }
.review-title { font-size: 24.5px; font-weight: var(--fw-medium); letter-spacing: -.015em; line-height: 1.2; }
.review-title .project-number { color: var(--sp-ink-3); font-weight: var(--fw-regular); }
.client-project #project-status-badge { display: none; }
.client-project-actions { display: flex; align-items: center; gap: 2px; margin-left: auto; flex: none; }
.client-project .demo-open {
  min-height: 34px; padding: 0 12px; gap: 8px; margin-right: 6px; border: 0; border-radius: var(--radius-md);
  background: var(--sp-panel-2); font-size: var(--fs-body);
}
.client-project .demo-open:hover { background: var(--sp-panel-3); }
.client-project .demo-open .ph { font-size: 18px; }
.review-sub {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; margin-top: 6px;
  font-size: 14px; color: var(--sp-ink-2);
}
.review-sub > span + span::before {
  content: ""; display: inline-block; width: 3px; height: 3px; margin: 0 10px 3px;
  border-radius: 50%; background: var(--sp-ink-3); vertical-align: middle;
}


.client-project .project-controls { gap: 12px; padding: 0; margin-top: 16px; align-items: flex-end; }
.client-project .project-control { flex: 1 1 190px; width: auto; min-width: 0; }
.client-project .project-control .field-label {
  min-height: 0; padding-left: 0; margin-bottom: 6px; gap: 8px; white-space: nowrap;
}
.client-project .project-control .deadline-note { font-size: var(--fs-small); }
.client-project .project-cost-value {
  min-height: 36px; padding: 0 2px 0 10px; justify-content: space-between; gap: 6px;
  border-radius: var(--radius-sm); background: var(--sp-panel-2); font-weight: var(--fw-medium);
}
.client-project .project-cost-value .cost-edit { width: 32px; height: 32px; margin: 0; }
.client-project .project-cost-value.is-locked { justify-content: flex-start; padding-right: 10px; }


.client-project .project-control:has(> .project-cost-value.is-locked) { flex-basis: 330px; }
.client-project .project-cost-value > .ph-lock-simple { font-size: 16px; color: var(--sp-ink-3); }
.project-cost-sum { white-space: nowrap; }
.project-cost-lock {
  margin-left: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 13px; font-weight: var(--fw-regular); color: var(--sp-ink-3);
}
.client-project .project-control:has(> .project-cost-value) { flex: 1 1 170px; min-width: 0; }

.client-project .project-control-check {
  flex: 0 0 auto; min-height: 36px; padding: 0 4px; align-items: center; color: var(--sp-ink-2);
}
.client-project .project-control-check .check-box {
  position: relative; width: 32px; height: 18px; border-radius: var(--radius-full); background: var(--sp-panel-3);
  transition: background .2s;
}
.client-project .project-control-check .check-box .ph { display: none; }
.client-project .project-control-check .check-box::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--sp-on-accent); transition: transform .2s;
}
.client-project .project-control-check input:checked + .check-box { background: var(--sp-accent); }
.client-project .project-control-check input:checked + .check-box::after { transform: translateX(14px); }
.client-project .project-control-check:has(input:checked) { color: var(--sp-ink); }

.client-project .project-control.pay-control { flex: 1 1 250px; }


.role-client .client-project .project-control.pay-control { flex: 0 1 340px; }
.pay-summary {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 36px;
  padding: 0 2px 0 10px; border: 0; border-radius: var(--radius-sm);
  background: var(--sp-panel-2); color: var(--sp-ink); font: inherit;
  font-weight: var(--fw-medium); text-align: left; cursor: pointer;
}
.pay-summary:hover { background: var(--sp-panel-3); }
.pay-summary:focus-visible { outline: 1px solid var(--sp-accent); outline-offset: -1px; }
.pay-summary-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pay-ico { flex: 0 0 auto; font-size: 19px; color: var(--sp-ink-3); }
.pay-summary.is-part .pay-ico { color: var(--sp-ink-2); }
.pay-summary.is-done .pay-ico { color: var(--sp-success); }
.pay-summary-edit {
  flex: 0 0 auto; display: grid; place-items: center; width: 32px; height: 32px;
  margin-left: auto; font-size: 16px; color: var(--sp-ink-3);
}
.pay-summary:hover .pay-summary-edit { color: var(--sp-ink); }



.pay-meta { margin: 0; color: var(--sp-ink-2); }
.pay-meta b { color: var(--sp-ink); font-weight: var(--fw-medium); }
.pay-body { display: flex; flex-direction: column; gap: 16px; }
.pay-count { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pay-count .field-label { margin: 0; padding: 0; min-height: 0; }
.pay-stepper { display: inline-flex; align-items: center; gap: 4px; }
.pay-stepper .field-input { width: 56px; text-align: center; font-variant-numeric: tabular-nums; }
.pay-stepper .btn-icon { width: 36px; height: 36px; }
.pay-table {
  display: grid; grid-template-columns: auto 92px minmax(0, 1fr) auto;
  column-gap: 16px; row-gap: 8px; align-items: center;
}
.pay-row { display: contents; }
.pay-head { font-size: var(--fs-small); color: var(--sp-ink-3); }
.pay-head.r, .pay-sum { text-align: right; }
.pay-head.c { text-align: center; }
.pay-name { white-space: nowrap; }
.pay-pct { position: relative; }
.pay-pct .field-input { width: 100%; padding-right: 28px; text-align: right; font-variant-numeric: tabular-nums; }
.pay-pct-unit {
  position: absolute; right: 11px; top: 50%; transform: translateY(-50%);
  color: var(--sp-ink-3); pointer-events: none;
}
.pay-sum { white-space: nowrap; font-variant-numeric: tabular-nums; }
.pay-sum.is-none { color: var(--sp-ink-3); }
.pay-table:not(.pay-ro) .pay-paid-cell { justify-self: center; }
.pay-ro .pay-pct { text-align: right; font-variant-numeric: tabular-nums; }
.pay-state { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; color: var(--sp-ink-3); }
.pay-state .ph { font-size: 18px; }
.pay-state.is-paid { color: var(--sp-success); }
.pay-total {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding-top: 12px; border-top: 1px solid var(--sp-line);
}
.pay-total-pct { font-weight: var(--fw-medium); }
.pay-total.is-ok .pay-total-pct { color: var(--sp-success); }
.pay-total.is-bad .pay-total-pct { color: var(--sp-danger); }
.pay-total-sum { color: var(--sp-ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pay-body .modal-actions { margin-top: 0; }



.pay-part { color: var(--sp-ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.mgr-paid.is-static { cursor: default; }
.mgr-paid.is-static:hover { background: transparent; }

@media (max-width: 767px) {
  .role-client .client-project .project-control.pay-control { flex-basis: 100%; }
  

  .client-project .project-controls > #project-cost { flex: 1 1 100%; }
  .pay-table { display: flex; flex-direction: column; align-items: stretch; gap: 12px; }
  .pay-head { display: none; }
  .pay-row {
    display: grid; grid-template-columns: minmax(0, 1fr) 84px auto; column-gap: 10px; row-gap: 2px;
    align-items: center; grid-template-areas: "name pct paid" "sum pct paid";
  }
  .pay-ro .pay-row { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "name pct paid" "sum sum paid"; }
  .pay-name { grid-area: name; }
  .pay-pct { grid-area: pct; }
  .pay-sum { grid-area: sum; text-align: left; font-size: var(--fs-small); color: var(--sp-ink-2); }
  .pay-paid-cell { grid-area: paid; }
}

.client-project .notice-inline.notice-row {
  margin: 14px 0 0; padding: 8px 8px 8px 12px; border: 0; border-radius: var(--radius-md);
  background: var(--sp-panel-2); color: var(--sp-ink-2);
}



.client-project .project-work { gap: 8px; }
.client-project .client-files { display: contents; }
.client-project .cab-ready { order: -1; }


.cab-ready {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 16px;
  border-radius: var(--radius-card); background: var(--sp-accent-soft); box-shadow: inset 0 0 0 1px var(--sp-accent);
}
.cab-ready > .ph { font-size: 29px; color: var(--sp-accent-text); }
.cab-ready-text { flex: 1 1 260px; min-width: 0; }
.cab-ready-text h2 { font-size: 15.5px; font-weight: var(--fw-medium); color: var(--sp-ink); }
.cab-ready-text p { color: var(--sp-ink-2); }
.cab-ready-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.cab-ready .btn-secondary { background: var(--sp-panel); }
.cab-ready .btn-secondary:hover { background: var(--sp-panel-2); }
.cab-ready.is-waiting { background: var(--sp-panel); box-shadow: none; }
.cab-ready.is-waiting > .ph { color: var(--sp-ink-3); }



.client-project .quote-section, .client-project .result-group { padding: 0; }
.client-project .quote-summary,
.client-project .result-group > .section-head {
  min-height: 48px; padding: 0 14px; margin: 0; gap: 8px; cursor: pointer; list-style: none; user-select: none;
}
.client-project .result-group > .section-head::-webkit-details-marker { display: none; }
.client-project :is(.quote-summary, .result-group > .section-head) .section-title {
  font-size: 15.5px; font-weight: var(--fw-medium); text-transform: none; letter-spacing: 0; color: var(--sp-ink);
}
.client-project .quote-summary-icon { display: none; }
.client-project .quote-chev { order: -1; font-size: 14.5px; color: var(--sp-ink-3); transform: rotate(-90deg); }
.client-project .quote-section[open] .quote-chev { transform: none; }
.client-project .quote-summary .badge { margin-left: auto; }
.client-project .quote-summary-gap { display: none; }
.client-project .quote-summary-total { font-weight: var(--fw-medium); color: var(--sp-ink); }
.client-project .quote-summary .badge + .quote-summary-gap + .quote-summary-total { margin-left: 6px; }
.client-project .quote-summary > .section-title + .quote-summary-gap + .quote-summary-total { margin-left: auto; }
.result-group-chev { font-size: 14.5px; color: var(--sp-ink-3); transition: transform .15s; }
.result-group:not([open]) .result-group-chev { transform: rotate(-90deg); }
.result-group-count { color: var(--sp-ink-3); }
.client-project .result-group .section-head-action { margin-left: auto; }
.client-project .quote-section-body { padding: 0 14px 14px; gap: 12px; border-top: 0; }
.client-project .result-group > :not(summary) { margin-left: 14px; margin-right: 14px; }
.client-project .result-group[open] { padding-bottom: 14px; }

.client-project .section-grip { margin: 0; font-size: 16px; color: var(--sp-ink-3); opacity: .55; cursor: grab; }
.client-project .project-work > details > summary:hover .section-grip { color: var(--sp-ink-2); opacity: 1; }
.client-project .quote-summary .section-grip { order: -2; }



.slot-days { display: flex; flex-direction: column; gap: 10px; }
.slot-day { display: flex; flex-direction: column; gap: 6px; }
.slot-day-head { display: flex; align-items: baseline; gap: 6px; padding: 0 4px; font-size: 12.5px; color: var(--sp-ink-3); }
.slot-day-label { color: var(--sp-ink-2); font-weight: var(--fw-medium); }
.slot-day-n::before { content: "· "; }
.slot-day-rows { display: flex; flex-direction: column; gap: 2px; padding: 4px; border-radius: var(--radius-lg); background: var(--sp-panel-2); }
.client-project .slot-day-rows > :is(.result-row, .file-tile) { background: transparent; }
.client-project .slot-day-rows > :is(.result-row, .file-tile) + :is(.result-row, .file-tile) { box-shadow: 0 -1px 0 var(--sp-line); }
@media (min-width: 768px) {
  .client-project .slot-days {
    max-height: 440px; overflow-y: auto; scrollbar-gutter: stable;
    padding-right: 6px; margin-right: calc(-6px - var(--scrollbar-w));
  }
  .client-project .result-group > .slot-days { margin-right: calc(14px - 6px - var(--scrollbar-w)); }
  .client-project .slot-days::-webkit-scrollbar-track:vertical { margin-block: 8px; }
  .client-project .slot-day-head { position: sticky; top: 0; z-index: 1; padding-block: 4px; background: var(--bg-card); }
  .client-project .slot-day { gap: 2px; }
}


.client-project .kp-imgs { grid-template-columns: repeat(auto-fill, minmax(238px, 1fr)); gap: 8px; }
.client-project .kp-img {
  aspect-ratio: auto; height: 205px; border: 0; border-radius: var(--radius-md);
  background: var(--doc-bg); outline: 1px solid var(--sp-line-2); outline-offset: -1px;
}
.client-project .kp-img img { object-position: top; }
.client-project .kp-spec { gap: 0; }
.client-project .kp-spec-row { padding: 10px 2px; border-bottom: 0; border-top: 1px solid var(--sp-line); }
.client-project .kp-spec-row:first-child { border-top: 0; }
.client-project .kp-spec-row .name { color: var(--sp-ink-2); }
.client-project .kp-spec-row .val { font-weight: var(--fw-regular); }
.client-project .kp-total { align-items: baseline; padding: 12px 2px 4px; border-top: 1px solid var(--sp-line-2); }
.client-project .kp-total .name { font-size: var(--fs-body); font-weight: var(--fw-regular); }
.client-project .kp-total .val { font-size: 24.5px; font-weight: var(--fw-medium); letter-spacing: -.01em; }
.client-project .kp-actions { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; }
.client-project .kp-approved { margin-right: auto; color: var(--sp-ink-3); font-size: var(--fs-body); text-align: left; }
.client-project .kp-actions > a.btn-ghost { margin-left: auto; min-height: 31px; padding: 0 10px; font-size: 14px; }


.client-project .input-dropzone { margin-bottom: 8px; }
.client-project .input-dropzone-target { min-height: 45px; padding: 0 12px; flex-direction: row; gap: 8px; font-size: var(--fs-body); }
.client-project .input-dropzone-target .ph { font-size: 18px; }


.client-project .input-add { display: flex; gap: 8px; margin-bottom: 8px; }
.client-project .input-add .input-dropzone { flex: 1; min-width: 0; margin-bottom: 0; }
.client-project .input-link-add { min-height: 45px; padding: 0 18px; gap: 8px; border-radius: var(--radius-md); font-size: var(--fs-body); }
.client-project .input-link-add .ph { font-size: 18px; }
@media (max-width: 767px) {
  .client-project .input-add { flex-direction: column; }
  .client-project .input-link-add { justify-content: center; }
}
.client-project .input-upload-status { font-size: var(--fs-small); }
.client-project .result-row {
  padding: 9px 10px 9px 12px; gap: 12px; border: 0; border-radius: var(--radius-md); background: var(--sp-panel-2);
}
.client-project .result-main { gap: 12px; }
.client-project .result-icon {
  width: 38px; height: 38px; border-radius: var(--radius-sm); background: var(--sp-panel-3);
  color: var(--sp-ink-2); font-size: 18px;
}
.result-ext { font-family: var(--font-mono); font-size: 10.5px; font-weight: var(--fw-regular); letter-spacing: 0; }
.client-project .result-row.is-empty .result-icon { background: none; box-shadow: inset 0 0 0 1px var(--sp-line-2); color: var(--sp-ink-3); }
.client-project .result-name { font-size: var(--fs-body); font-weight: var(--fw-medium); color: var(--sp-ink); }
.client-project .result-meta { font-size: var(--fs-small); color: var(--sp-ink-3); }
.client-project .result-row .row-actions { gap: 2px; }
.client-project .result-row .btn-secondary { background: var(--sp-panel-3); }
.client-project .result-row .btn-secondary:hover { background: var(--sp-line-2); }
.client-project .result-row .btn-icon:hover { background: var(--sp-panel-3); }
.client-project .slot-required { color: var(--sp-danger); }


.client-project .chat-card { padding: 10px; border: 0; border-radius: var(--radius-card); }
.client-project .chat-head {
  padding: 4px 6px 12px; border-bottom: 0; gap: 8px;
  font-size: var(--fs-body); font-weight: var(--fw-medium); color: var(--sp-ink);
}
.client-project .chat-head .ph { color: var(--sp-ink-3); font-size: 18px; }
.client-project .chat-messages { --chat-gap: 14px; padding: 10px 4px; }
.client-project .chat-author {
  padding-left: 2px; font-size: var(--fs-small); font-weight: var(--fw-medium); color: var(--sp-ink);
  text-transform: none; letter-spacing: 0;
}
.client-project .chat-stamp { font-family: var(--font-mono); font-size: 11.5px; color: var(--sp-ink-3); }
.client-project .chat-bubble { max-width: 86%; padding: 7px 12px; border: 0; border-radius: 12px; }
.client-project .chat-own .chat-bubble { border-radius: 12px; }
.client-project .chat-body { font-size: var(--fs-body); line-height: 1.45; }
.client-project .chat-body-link { color: var(--sp-accent-text); }
.client-project .chat-bubble .chat-file { background: var(--sp-panel); border: 0; }
.client-project .chat-own .chat-bubble .chat-file { background: var(--sp-panel); }
.client-project .chat-divider::before, .client-project .chat-divider::after { background: var(--sp-line); }
.client-project .chat-divider span { font-size: 12.5px; text-transform: none; letter-spacing: 0; font-weight: var(--fw-regular); color: var(--sp-ink-3); }
.client-project .chat-composer {
  margin: 0; padding: 5px; gap: 6px; border: 0; border-radius: 12px; background: var(--sp-panel-2);
}
.client-project .chat-input { padding: 0 4px; font-size: var(--fs-body); }
.client-project .chat-input::placeholder { color: var(--sp-ink-3); opacity: 1; }
.client-project .chat-attach { width: 34px; height: 34px; padding: 0; justify-content: center; }
.client-project .chat-attach .ph { font-size: 18px; }
.client-project .chat-send {
  width: 34px; height: 34px; border-radius: var(--radius-sm); background: var(--sp-accent); color: var(--sp-on-accent);
}
.client-project .chat-send:hover { background: var(--sp-accent-hover); }
.client-project .chat-preview-note { border-top: 0; padding: 8px 6px 0; }



.client-project .chat-head-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-project .chat-head .chat-dot { margin-left: 0; }
.client-project .chat-head .chat-back {
  position: relative; width: 32px; height: 32px; margin: -6px 0 -6px -4px; padding: 0; justify-content: center;
}
.client-project .chat-head .chat-back .ph { color: var(--sp-ink-2); }
.client-project .chat-head .chat-back .chat-dot { position: absolute; top: 4px; right: 3px; width: 7px; height: 7px; }
.client-project .chat-new {
  flex: none; height: 32px; margin: -6px 0; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px;
  border: 0; border-radius: var(--radius-sm); background: var(--sp-panel-2); color: var(--sp-ink);
  font: inherit; font-size: var(--fs-small); font-weight: var(--fw-medium); cursor: pointer;
}
.client-project .chat-head .chat-new .ph { font-size: 16px; color: var(--sp-ink-2); }
.client-project .chat-new:hover { background: var(--sp-panel-3); }

.client-project .chat-list {
  flex: 1; min-height: 0; margin: 0; padding: 0 0 4px; list-style: none;
  overflow-y: auto; overscroll-behavior: contain;
}
.client-project .chat-list-group { padding: 14px 10px 4px; font-size: var(--fs-label); color: var(--sp-ink-3); }
.client-project .chat-list-sep { height: 1px; margin: 6px 10px; background: var(--sp-line); }
.client-project .chat-row {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 9px 10px;
  border: 0; border-radius: 12px; background: transparent; color: var(--sp-ink);
  font: inherit; text-align: left; cursor: pointer;
}
.client-project .chat-row:hover { background: var(--sp-panel-2); }
.client-project .chat-row:focus-visible { outline: 2px solid var(--border-focus); outline-offset: -2px; }
.client-project .chat-row-icon {
  width: 38px; height: 38px; flex: none; display: flex; align-items: center; justify-content: center;
  border-radius: 11px; background: var(--sp-panel-2); color: var(--sp-ink-2); font-size: 18px;
}
.client-project .chat-row:hover .chat-row-icon { background: var(--sp-panel-3); }
.client-project .chat-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.client-project .chat-row-top,
.client-project .chat-row-sub { display: flex; align-items: center; gap: 8px; min-width: 0; }
.client-project .chat-row-name {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: var(--fs-body); font-weight: var(--fw-medium);
}
.client-project .chat-row-tag { flex: none; font-size: var(--fs-label); color: var(--sp-ink-3); }
.client-project .chat-row-time { flex: none; font-family: var(--font-mono); font-size: 11.5px; color: var(--sp-ink-3); }
.client-project .chat-row-last {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: var(--fs-small); color: var(--sp-ink-3);
}
.client-project .chat-row.is-unread .chat-row-last { color: var(--sp-ink-2); }
.client-project .chat-row .chat-dot { margin-left: 0; }


:is(.client-project, .dm) .chat-bar {
  position: relative; flex: none; display: flex; align-items: center; gap: 6px; min-height: 42px;
  padding: 0 2px 8px; border-bottom: 1px solid var(--sp-line);
}
:is(.client-project, .dm) .chat-scope {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding-left: 6px;
  font-size: var(--fs-small); color: var(--sp-ink-3);
}
:is(.client-project, .dm) .chat-scope .ph { flex: none; font-size: 16px; }
:is(.client-project, .dm) .chat-scope span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
:is(.client-project, .dm) .chat-pop { min-width: 0; }
:is(.client-project, .dm) .chat-people { flex: 1; }
:is(.client-project, .dm) .chat-pop > summary { list-style: none; cursor: pointer; }
:is(.client-project, .dm) .chat-pop > summary::-webkit-details-marker { display: none; }
:is(.client-project, .dm) .chat-people-summary {
  height: 34px; display: flex; align-items: center; gap: 8px; padding: 0 8px 0 4px;
  border-radius: var(--radius-sm); font-size: var(--fs-small); color: var(--sp-ink-2);
}
:is(.client-project, .dm) .chat-people-summary:hover,
:is(.client-project, .dm) .chat-people[open] .chat-people-summary { background: var(--sp-panel-2); color: var(--sp-ink); }
:is(.client-project, .dm) .chat-people-summary .ph { font-size: 16px; color: var(--sp-ink-3); }
:is(.client-project, .dm) .chat-people-names { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
:is(.client-project, .dm) .chat-bar .avatar-stack .avatar { border-color: var(--sp-panel); }
:is(.client-project, .dm) .chat-attach-btn {
  flex: none; height: 34px; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px;
  border: 0; border-radius: var(--radius-sm); background: var(--sp-accent-soft); color: var(--sp-accent-text);
  font: inherit; font-size: var(--fs-small); font-weight: var(--fw-medium); white-space: nowrap; cursor: pointer;
}
:is(.client-project, .dm) .chat-attach-btn .ph { font-size: 16px; color: inherit; }
:is(.client-project, .dm) .chat-attach-btn.is-on { background: var(--sp-panel-2); color: var(--sp-ink-2); }
:is(.client-project, .dm) .chat-attach-btn.is-on:hover { background: var(--sp-panel-3); color: var(--sp-ink); }
:is(.client-project, .dm) .chat-menu > summary {
  width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
}
:is(.client-project, .dm) .chat-menu[open] > summary { background: var(--sp-panel-2); }



:is(.client-project, .dm) .chat-pop-panel {
  position: absolute; z-index: 5; top: calc(100% - 4px); left: 0; right: 0;
  max-height: min(320px, 60vh); overflow-y: auto; overscroll-behavior: contain;
  padding: 6px; border: 1px solid var(--border-hairline); border-radius: var(--radius-md);
  background: var(--sp-pop); box-shadow: var(--sp-shadow);
}
:is(.client-project, .dm) .chat-menu-panel { left: auto; width: 230px; }
:is(.client-project, .dm) .chat-pop-title { margin: 0; padding: 6px 10px 8px; font-size: var(--fs-small); font-weight: var(--fw-medium); color: var(--sp-ink); }
:is(.client-project, .dm) .chat-pop-label { margin: 0; padding: 10px 10px 4px; font-size: var(--fs-label); color: var(--sp-ink-3); }
:is(.client-project, .dm) .chat-pop-note { margin: 0; padding: 8px 10px 4px; font-size: var(--fs-label); color: var(--sp-ink-3); }
:is(.client-project, .dm) .chat-people-list { margin: 0; padding: 0; list-style: none; }
:is(.client-project, .dm) .chat-person {
  width: 100%; min-height: 44px; display: flex; align-items: center; gap: 10px; padding: 4px 4px 4px 10px;
  border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--sp-ink);
  font: inherit; text-align: left;
}
:is(.client-project, .dm) .chat-person-add { padding-right: 10px; cursor: pointer; }
:is(.client-project, .dm) .chat-person-add:hover { background: var(--sp-panel-2); }
:is(.client-project, .dm) .chat-person-add .ph-plus { margin-left: auto; color: var(--sp-accent-text); }
:is(.client-project, .dm) .chat-person-x { margin-left: auto; }
:is(.client-project, .dm) .chat-menu-item {
  width: 100%; min-height: 40px; display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--sp-ink);
  font: inherit; font-size: var(--fs-small); text-align: left; cursor: pointer;
}
:is(.client-project, .dm) .chat-menu-item:hover { background: var(--sp-panel-2); }
:is(.client-project, .dm) .chat-menu-item .ph { font-size: 17px; color: var(--sp-ink-3); }

:is(.client-project, .dm) .chat-hint { flex: none; margin: 4px 6px 6px; font-size: var(--fs-label); color: var(--sp-accent-text); }
:is(.client-project, .dm) .chat-hint:empty { display: none; }
:is(.client-project, .dm) .chat-archived {
  flex: none; display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px;
  border-radius: 12px; background: var(--sp-panel-2); font-size: var(--fs-small); color: var(--sp-ink-2);
}
:is(.client-project, .dm) .chat-archived .ph { flex: none; font-size: 18px; color: var(--sp-ink-3); }
:is(.client-project, .dm) .chat-archived span { flex: 1; min-width: 0; }



.chat-author-org { margin-left: 4px; font-weight: var(--fw-regular); color: var(--sp-ink-3); }
.chat-edited { margin-right: 2px; }
.rooms-msg-body > .chat-edited { margin-left: 6px; font-size: var(--fs-micro); color: var(--sp-ink-3); }



.chat-quote {
  display: flex; flex-direction: column; gap: 1px; width: 100%; min-width: 0;
  margin: 2px 0 6px; padding: 4px 10px 5px 11px; border: 0; border-radius: 8px;
  background: color-mix(in srgb, var(--sp-accent) 9%, transparent);
  box-shadow: inset 3px 0 0 var(--sp-accent);
  font: inherit; text-align: left; cursor: pointer;
}
.chat-quote:hover { background: color-mix(in srgb, var(--sp-accent) 15%, transparent); }
.chat-quote-author { font-size: var(--fs-label); font-weight: var(--fw-medium); color: var(--sp-accent-text); }
.chat-quote-text { font-size: var(--fs-small); color: var(--sp-ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-quote.is-deleted .chat-quote-text { font-style: italic; color: var(--sp-ink-3); }
.rooms-msg-body > .chat-quote { max-width: 560px; }


.chat-bubble.is-deleted { background: transparent; box-shadow: inset 0 0 0 1px var(--sp-line-2); }
.chat-deleted { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-small); font-style: italic; color: var(--sp-ink-3); }
.chat-deleted .ph { font-size: 15px; font-style: normal; }



.chat-msg.is-flash > .chat-bubble, .rooms-row.is-flash .rooms-msg {
  clip-path: inset(0 -100vmax); animation: chat-flash 1.8s ease-out;
}
@keyframes chat-flash {
  0%, 40% { box-shadow: 0 0 0 100vmax var(--sp-accent-soft); }
  100% { box-shadow: 0 0 0 100vmax transparent; }
}



.chat-bubble, .rooms-msg-body { position: relative; }
.msg-tools {
  position: absolute; top: 0; left: calc(100% + 6px); z-index: 2;
  display: inline-flex; gap: 2px; padding: 2px; border-radius: 10px;
  background: var(--sp-pop); box-shadow: 0 0 0 1px var(--sp-line-2), var(--sp-shadow);
  opacity: 0; visibility: hidden; pointer-events: none; transform: translateX(-8px);
  transition: opacity .14s ease, transform .14s ease, visibility 0s linear .14s;
}
.chat-own .msg-tools { left: auto; right: calc(100% + 6px); transform: translateX(8px); }
.rooms-msg-body > .msg-tools { top: -22px; left: auto; right: 0; transform: translateY(4px); }
.chat-msg:hover .msg-tools, .rooms-row:hover .msg-tools, .msg-tools:focus-within {
  opacity: 1; visibility: visible; pointer-events: auto; transform: none;
  transition: opacity .14s ease, transform .14s ease, visibility 0s;
}




@media (hover: hover) {
  .chat-msg > .chat-bubble { max-width: min(85%, calc(100% - 112px)); }
}
@media (prefers-reduced-motion: reduce) {
  .msg-tools, .chat-msg:hover .msg-tools, .rooms-row:hover .msg-tools { transition: none; transform: none; }
}
.msg-tools button {
  width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--sp-ink-2); font-size: 16px; cursor: pointer;
}
.msg-tools button:hover { background: var(--sp-pop-hover); color: var(--sp-ink); }
.msg-tools button.danger:hover { color: var(--sp-danger); }

@media (hover: none) { .msg-tools { display: none !important; } }


.msg-menu {
  position: fixed; z-index: 1000; min-width: 210px; padding: 6px;
  border: 1px solid var(--border-hairline); border-radius: var(--radius-md);
  background: var(--sp-pop); box-shadow: var(--sp-shadow);
}
.msg-menu button {
  width: 100%; min-height: 40px; display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--sp-ink);
  font: inherit; font-size: var(--fs-small); text-align: left; cursor: pointer;
}
.msg-menu button:hover, .msg-menu button:focus-visible { background: var(--sp-pop-hover); outline: none; }
.msg-menu .ph { font-size: 17px; color: var(--sp-ink-3); }
.msg-menu .danger, .msg-menu .danger .ph { color: var(--sp-danger); }


.chat-compose-ctx {
  display: flex; align-items: center; gap: 10px; flex: none;
  margin: 6px 0 4px; padding: 6px 4px 6px 10px; border-radius: 12px; background: var(--sp-panel-2);
}
.dm .chat-compose-ctx, .rooms-main .chat-compose-ctx { margin: 0 12px 4px; }
.chat-compose-ctx > .ph { font-size: 18px; color: var(--sp-accent-text); }
.chat-compose-ctx-main {
  flex: 1; min-width: 0; display: flex; flex-direction: column;
  padding-left: 9px; box-shadow: inset 2px 0 0 var(--sp-accent);
}
.chat-compose-ctx-title { font-size: var(--fs-label); font-weight: var(--fw-medium); color: var(--sp-accent-text); }
.chat-compose-ctx-text { font-size: var(--fs-small); color: var(--sp-ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-compose-ctx .btn-icon { flex: none; }


.chat-compose-files {
  display: flex; flex-direction: column; gap: 4px; flex: none;
  max-height: 212px; overflow-y: auto; margin: 6px 0 4px;
}
.dm .chat-compose-files, .rooms-main .chat-compose-files { margin: 0 12px 4px; }
.chat-compose-files > .chat-compose-ctx { margin: 0; }
.chat-compose-file .chat-compose-ctx-main { padding-left: 0; box-shadow: none; }
.chat-compose-file .chat-compose-ctx-title {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--sp-ink);
}
.chat-compose-file > .ph { color: var(--sp-ink-3); }
.chat-compose-file.is-image { cursor: pointer; }
.chat-compose-file.is-image:hover { background: var(--sp-panel-3); }
.chat-compose-file.is-image:focus-visible { outline: 1px solid var(--sp-accent); outline-offset: -1px; }
.chat-compose-thumb {
  flex: none; display: block; width: 40px; height: 40px; overflow: hidden;
  border-radius: 8px; background: var(--sp-panel-3);
}
.chat-compose-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }


.chat-drop { position: relative; }
.chat-drop::after {
  content: "Отпустите, чтобы приложить файлы";
  position: absolute; inset: 6px; z-index: 20; display: grid; place-items: center;
  border-radius: 16px; background: var(--sp-panel); color: var(--sp-accent-text);
  box-shadow: inset 0 0 0 2px var(--sp-accent); font-weight: var(--fw-medium);
  pointer-events: none;
}


.chat-pick { min-width: 0; margin: 0; padding: 0; border: 0; }
.chat-pick-label { margin: 0; padding: 8px 2px 2px; font-size: var(--fs-label); color: var(--sp-ink-3); }
.chat-pick-row {
  display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 4px 8px;
  border-radius: var(--radius-sm); cursor: pointer;
}
.chat-pick-row:hover { background: var(--sp-panel-2); }
.chat-pick-name { flex: 1; min-width: 0; font-size: var(--fs-small); color: var(--sp-ink); }
.chat-pick-row input { width: 16px; height: 16px; accent-color: var(--sp-accent); }
.chat-form-note { margin: 0; font-size: var(--fs-small); color: var(--sp-ink-3); }


.modal { padding: 20px; border: 0; border-radius: var(--radius-card); }
.modal-head { margin-bottom: 18px; }
.modal-title { font-size: 18px; font-weight: var(--fw-medium); }
.drawer { border-left: 0; background: var(--sp-panel); }
.drawer-head, .drawer-footer { border-color: var(--sp-line); }
.drawer-title { font-size: var(--fs-body); font-weight: var(--fw-medium); }
.drawer-footer.drawer-footer-row { flex-direction: row; align-items: center; justify-content: flex-end; }



.drawer-backdrop:has(+ .notif-panel) { background: transparent; }
.drawer.notif-panel {
  top: 54px; bottom: auto; right: calc(max(0px, (100vw - var(--cab-w)) / 2) + 24px);
  width: 400px; max-height: min(600px, calc(100dvh - 70px));
  border-radius: var(--radius-card); background: var(--sp-pop);
  box-shadow: var(--sp-shadow), inset 0 0 0 1px var(--sp-line-2); overflow: hidden;
}
@media (min-width: 768px) and (hover: hover) and (pointer: fine) {
  .drawer.notif-panel { right: calc(max(0px, (100vw - var(--cab-w) - var(--scrollbar-w)) / 2) + 24px + var(--scrollbar-w)); }
}
.notif-panel .drawer-head { min-height: 56px; padding: 0 10px 0 18px; }
.notif-panel .drawer-title { font-size: 17px; }
.notif-head-actions { gap: 2px; }
.notif-head-actions .btn-ghost:not(.btn-icon) { min-height: 31px; padding: 0 10px; font-size: 14px; }
.notif-count-badge { border-radius: var(--radius-full); background: var(--sp-accent); color: var(--sp-on-accent); box-shadow: none; }
.notif-panel .notif-list { min-height: 0; padding: 6px; overscroll-behavior: contain; }
.notif-panel .notif-row { gap: 12px; padding: 10px; border: 0; border-radius: var(--radius-md); background: none; }
.notif-panel .notif-row:hover { background: var(--sp-panel-3); }
.notif-panel .notif-unread-bar { display: none; }
.notif-panel .notif-icon-tile { width: 36px; height: 36px; font-size: 18px; background: var(--sp-panel-3); }
.notif-panel .notif-icon-tile--read { color: var(--sp-ink-3); }
.notif-panel .notif-title { font-size: var(--fs-body); font-weight: var(--fw-medium); color: var(--sp-ink); }
.notif-panel .notif-title--read { font-weight: var(--fw-regular); color: var(--sp-ink-2); }
.notif-panel .notif-body {
  font-size: var(--fs-small); color: var(--sp-ink-3); white-space: normal;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.notif-panel .notif-time { flex: none; display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-small); color: var(--sp-ink-3); }
.notif-panel .notif-row--unread .notif-time::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--sp-accent); }


.drawer.requisites-drawer {
  top: 50%; left: 50%; right: auto; bottom: auto; transform: translate(-50%, -50%);
  width: min(640px, calc(100vw - 32px)); max-height: calc(100dvh - 48px);
  border-radius: var(--radius-card); box-shadow: var(--sp-shadow); overflow: hidden;
}
.requisites-drawer .drawer-head { min-height: 56px; padding: 0 10px 0 18px; }
.requisites-drawer .drawer-title { font-size: 17px; }
.requisites-drawer .drawer-body { min-height: 0; padding: 18px; gap: 14px; }
.requisites-drawer .modal-form { gap: 14px; }
.requisites-drawer .company-section-title { margin: 8px 0 0; font-size: var(--fs-small); font-weight: var(--fw-regular); color: var(--sp-ink-3); }
.requisites-drawer .drawer-grid { gap: 12px; }
.requisites-drawer .field-input:disabled { color: var(--sp-ink-2); }
.requisites-drawer .contact-edit { padding: 10px; border-radius: var(--radius-md); background: var(--sp-panel-2); }
.requisites-drawer .contact-edit .field-input { background: var(--sp-panel-3); }
.requisites-drawer .drawer-footer { padding: 12px 18px; gap: 8px; }
@media (max-width: 767px) {
  

  .drawer-backdrop:has(+ .notif-panel) { background: var(--sp-overlay-lite); }
  .drawer.notif-panel { top: 56px; left: 8px; right: 8px; width: auto; max-height: calc(100dvh - 120px); }
  .drawer.requisites-drawer {
    top: auto; left: 8px; right: 8px; bottom: 8px; transform: none; width: auto; max-height: calc(100dvh - 16px);
  }
  .requisites-drawer .drawer-grid { grid-template-columns: 1fr; }
  .requisites-drawer .drawer-grid .span-2 { grid-column: auto; }
}
.company-section-title {
  font-size: var(--fs-body); font-weight: var(--fw-medium); color: var(--sp-ink);
  text-transform: none; letter-spacing: 0;
}

.input-dropzone-target { border: 0; border-radius: var(--radius-md); background: var(--sp-panel-2); color: var(--sp-ink-3); }
.input-dropzone-target:hover,
.input-dropzone:focus-within .input-dropzone-target { color: var(--sp-ink-2); background: var(--sp-panel-3); border: 0; }
.input-dropzone.drag-active .input-dropzone-target {
  color: var(--sp-accent-text); background: var(--sp-accent-soft); box-shadow: inset 0 0 0 1px var(--sp-accent);
}
.notif-row { border-bottom-color: var(--sp-line); }
.notif-row--unread { background: var(--sp-panel-2); }
.notif-icon-tile { border-radius: var(--radius-md); }
.notif-count-badge { border-radius: var(--radius-full); color: var(--sp-on-accent); }
.app-toast { border-radius: var(--radius-md); }



.client-main > .settings-back,
.client-main > .page-header,
.client-main > .settings-wrap { width: 100%; max-width: var(--cab-w); margin-inline: auto; padding-inline: 24px; }
.client-main > .settings-back { padding-top: 6px; }
.settings-back .back-inline { min-height: 29px; padding: 0 8px 0 4px; margin-left: -4px; gap: 6px; color: var(--sp-ink-3); font-size: var(--fs-body); }
.settings-back .back-inline:hover { color: var(--sp-ink); background: none; }
.role-client .page-header { height: auto; padding-top: 4px; padding-bottom: 16px; border-bottom: 0; }
.role-client .page-header .page-title { font-size: 29px; font-weight: var(--fw-medium); letter-spacing: -.02em; line-height: 1.2; }
.client-main > .settings-wrap { padding-top: 0; padding-bottom: 24px; gap: 32px; }
.role-client .settings-section-title,
.role-client .table th { text-transform: none; letter-spacing: 0; font-size: var(--fs-small); font-weight: var(--fw-regular); color: var(--sp-ink-3); }
.settings-section { gap: 10px; }
.role-client .card.card-pad { padding: 18px 20px; }
.settings-password-form {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 340px);
  align-items: center; column-gap: 24px; row-gap: 12px; max-width: none;
}
.settings-password-form .settings-tz-label,
.settings-password-form .settings-tz-label:first-child { margin: 0; font-size: var(--fs-body); color: var(--sp-ink); }
.settings-password-form .form-error { grid-column: 1 / -1; margin: 0; }
.settings-password-form .form-hint { margin: 0; }
.settings-password-form button { margin: 0; justify-self: end; }


.settings-tz-form .settings-tz-label { flex: 1; font-size: var(--fs-body); color: var(--sp-ink); }
.settings-tz-form .select-popover { flex: none; }
.settings-tz-form .select-popover__trigger, .settings-tz-select { min-width: 240px; }
.notif-toggle, .settings-doc-row { padding: 16px 20px; border-bottom-color: var(--sp-line); }
.notif-settings-card { border-radius: var(--radius-card); }
.notif-push-card { padding: 18px 20px; gap: 18px; }
.notif-icon-tile { background: var(--sp-panel-2); color: var(--sp-ink-2); }
.toggle-switch, .notif-sound-row input[type="checkbox"] { width: 32px; height: 18px; background: var(--sp-panel-3); }
.toggle-switch--on, .notif-sound-row input[type="checkbox"]:checked { background: var(--sp-accent); }
.toggle-knob, .notif-sound-row input[type="checkbox"]::after {
  top: 3px; left: 3px; width: 12px; height: 12px; background: var(--sp-on-accent); transition: transform .2s;
}
.toggle-switch--on .toggle-knob, .notif-sound-row input[type="checkbox"]:checked::after { left: 3px; transform: translateX(14px); }

.settings-index { padding: 8px; gap: 2px; border: 0; border-radius: var(--radius-card); background: var(--sp-panel); }
.settings-index-row {
  min-height: 42px; padding: 0 10px; gap: 10px; border: 0; border-radius: var(--radius-sm);
  color: var(--sp-ink); transition: background .12s;
}
.settings-index-row:hover { background: var(--sp-panel-2); }
.settings-index-icon { font-size: 18px; color: var(--sp-ink-3); }
.settings-index-value, .settings-index-chev { color: var(--sp-ink-3); }
@media (min-width: 768px) {
  .client-shell:has(.settings-wrap) { height: 100dvh; min-height: 0; }
  .client-main:has(.settings-wrap) { overflow: hidden; display: flex; flex-direction: column; }
  .client-main > .settings-back, .client-main > .page-header { flex: none; }
  .client-main > .settings-wrap {
    flex: 1 1 0; min-height: 0; display: grid; gap: 8px; align-items: start;
    grid-template-columns: 285px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr);
  }
  .settings-index { display: flex; grid-area: 1 / 1; }
  .settings-index-chev { display: none; }
  .settings-index-row[aria-current="page"],
  .settings-wrap:not([data-focus]) .settings-index-row[href$="s=profile"] { background: var(--sp-panel-2); }
  .settings-index-row[aria-current="page"] .settings-index-icon,
  .settings-wrap:not([data-focus]) .settings-index-row[href$="s=profile"] .settings-index-icon { color: var(--sp-accent-text); }
  .settings-wrap .set-group, .settings-wrap .set-pair, .settings-wrap .set-stack { display: contents; }
  .settings-wrap .set-group-head { display: none; }
  

  .settings-wrap .settings-section {
    display: none; grid-area: 1 / 2; max-height: 100%; min-height: 0; gap: 0;
    border-radius: var(--radius-card); background: var(--sp-panel); overflow: hidden;
  }
  

  .settings-wrap:not([data-focus]) .settings-section[data-s="profile"],
  .settings-wrap[data-focus="profile"] .settings-section[data-s="profile"],
  .settings-wrap[data-focus="password"] .settings-section[data-s="password"],
  .settings-wrap[data-focus="logins"] .settings-section[data-s="logins"],
  .settings-wrap[data-focus="docs"] .settings-section[data-s="docs"],
  .settings-wrap[data-focus="notifications"] .settings-section[data-s="notifications"],
  .settings-wrap[data-focus="push"] .settings-section[data-s="push"],
  .settings-wrap[data-focus="sound"] .settings-section[data-s="sound"],
  .settings-wrap[data-focus="telegram"] .settings-section[data-s="telegram"],
  .settings-wrap[data-focus="calendar"] .settings-section[data-s="calendar"] { display: flex; }
  

  .role-client .settings-section-title {
    flex: none; display: flex; align-items: center; min-height: 50px; padding: 8px 20px 0;
    font-size: 17px; font-weight: var(--fw-medium); line-height: 1.2; color: var(--sp-ink);
    box-shadow: inset 0 -1px 0 var(--sp-line);
  }
  .settings-section > .card {
    flex: 0 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain;
    border-radius: 0; background: none;
  }
  .settings-section > .form-hint { flex: none; margin: 0; padding: 12px 20px 14px; box-shadow: inset 0 1px 0 var(--sp-line); }
  [data-s="logins"] .table :is(th, td):first-child { padding-left: 20px; }
  [data-s="logins"] thead th {
    position: sticky; top: 0; z-index: 1; background: var(--sp-panel); box-shadow: inset 0 -1px 0 var(--sp-line);
  }
  [data-s="logins"] .table td { padding-top: 12px; padding-bottom: 12px; }
}
@media (max-width: 767px) {
  .client-main > .settings-back,
  .client-main > .page-header,
  .client-main > .settings-wrap { padding-inline: 12px; }
  .role-client .page-header .page-title { font-size: 24.5px; }
  .client-main > .settings-wrap { gap: 16px; }
  .settings-password-form { grid-template-columns: 1fr; row-gap: 6px; }
  .settings-password-form .settings-tz-label,
  .settings-password-form .settings-tz-label:first-child { margin-top: 8px; font-size: var(--fs-small); color: var(--sp-ink-3); }
  .settings-password-form .settings-tz-label:first-child { margin-top: 0; }
  

  [data-s="logins"] table.cards-mobile tbody tr {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px;
    padding: 12px 16px; border-bottom-color: var(--sp-line);
  }
  [data-s="logins"] table.cards-mobile tbody td { display: block; padding: 0; }
  [data-s="logins"] table.cards-mobile tbody td::before { content: none; }
  [data-s="logins"] table.cards-mobile td.cell-date { grid-column: 1 / -1; color: var(--sp-ink); }
  [data-s="logins"] table.cards-mobile td + td { font-size: var(--fs-small); color: var(--sp-ink-3); }
  .settings-password-form .form-hint { margin-top: 8px; }
  .settings-password-form button { justify-self: start; margin-top: 8px; }
  .settings-tz-form { flex-wrap: wrap; }
  .settings-tz-form .settings-tz-label { flex: 0 0 100%; }
}



#gantt-native[data-mode=client] .ng-toolbar { gap: 8px; }
#gantt-native[data-mode=client] .ng-toolbar > .cf-search { flex: 0 1 400px; }
#gantt-native[data-mode=client] .ng-toolbar .btn-secondary { background: var(--sp-panel); }
#gantt-native[data-mode=client] .ng-toolbar .btn-secondary:hover { background: var(--sp-panel-2); }
#gantt-native[data-mode=client] .ng-shell { border: 0; }

#gantt-native[data-mode=client] .ng-urgent-mark { color: var(--sp-urgent); }


#gantt-native[data-mode=client] .ng-table-head .ng-head-cell {
  justify-content: flex-start;
  font-size: var(--fs-small); text-transform: none; letter-spacing: 0; color: var(--sp-ink-2);
}


@media (max-width: 1099px) {
  #gantt-native[data-mode=client] .ng-names-label { display: none; }
}
@media (max-width: 767px) {
  #gantt-native[data-mode=client] .ng-toolbar { flex-wrap: wrap; row-gap: 12px; }
  #gantt-native[data-mode=client] .ng-toolbar > * { order: 2; }
  #gantt-native[data-mode=client] .ng-toolbar > :is(.client-view-tabs, .cf-filters-btn) { order: 0; }
  #gantt-native[data-mode=client] .ng-toolbar > .client-view-tabs { flex: 1 1 0; min-width: 0; }
  #gantt-native[data-mode=client] .ng-toolbar > .cf-search { order: 1; flex: 0 0 100%; min-width: 0; }
  #gantt-native[data-mode=client] .ng-toolbar > .ng-toolbar-spacer { display: none; }
}


@media (max-width: 1099px) {
  

  .client-main:has(.project-work) { overflow-y: auto; }
  .client-project { height: auto; }
  .client-project { padding: 0 24px 24px; max-width: var(--cab-w); margin: 0 auto; width: 100%; }
  .client-project .project-body { padding: 0; gap: 8px; }
  .client-project-headline { margin-bottom: 8px; }
  .client-project .project-rail .chat-card { height: 560px; }
}


@media (max-width: 767px) {
  .topbar { height: auto; padding: 10px 12px; gap: 10px 6px; }
  .topbar .logo-img { height: 22px; }
  .topbar-requisites.btn-ghost { width: 34px; height: 34px; padding: 0; justify-content: center; }
  .topbar-icons { gap: 4px; }
  
  .theme-switch { padding: 0; background: none; }
  .theme-switch button { width: 34px; height: 34px; font-size: 18px; }
  html[data-theme="light"] .theme-switch [data-theme-set="light"],
  html:not([data-theme="light"]) .theme-switch [data-theme-set="dark"] { display: none; }
  .client-main > .content { padding: 0 12px 24px; }
  .content-head { padding: 10px 0 12px; }
  .content-head .page-title { font-size: 24.5px; }
  .content-meta { gap: 4px 14px; font-size: var(--fs-small); }
  

  .cf-page .content-head { padding: 6px 0 10px; row-gap: 2px; }
  .cf-page .content-head .page-title { font-size: 23px; }
  .cf-page .content-meta { gap: 4px 12px; }
  .cf-page .content-meta b { margin-left: 3px; }
  .cf-page.cf-open .cf-panel { width: auto; border-radius: var(--radius-card) var(--radius-card) 0 0; }

  .client-project { padding: 0 12px 16px; }
  .client-project-head { padding: 0; }
  .client-project-headline { padding: 12px; }
  .review-title { font-size: 20px; }
  
  .review-sub { flex-direction: column; align-items: flex-start; }
  .review-sub > span + span::before { display: none; }
  .client-project-actions { margin-left: auto; }
  .client-project .project-controls { gap: 10px; }
  .client-project .project-control { flex-basis: 100%; }
  .client-project .project-control:has(> .project-cost-value) { flex-basis: 100%; }
  .cpane-switch { margin: 0 0 8px; }
  .client-project .project-body { padding: 0; }
  .client-project:has(#cpane-chat:checked) .project-body { padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }
  #cpane-work:checked ~ .cpane-switch label[for="cpane-work"],
  #cpane-chat:checked ~ .cpane-switch label[for="cpane-chat"] { background: var(--sp-panel-3); box-shadow: none; }
  .client-project .result-row { padding: 10px; }
  .cab-ready { padding: 12px; }
  .cab-ready-btns { width: 100%; }
  .cab-ready-btns > * { flex: 1 1 auto; }
  .client-project .kp-actions > a.btn-ghost { margin-left: 0; }
}



.dm {
  flex: 1; min-height: 0;
  
  display: grid; grid-template-columns: min(var(--dm-side-w, 320px), calc(100% - 428px)) 8px minmax(0, 1fr); gap: 0;
  overflow: hidden;
}
.role-studio .dm { padding: 8px 8px 8px 0; background: var(--sp-canvas); }
.dm-side, .dm-main {
  display: flex; flex-direction: column; min-width: 0; min-height: 0;
  border-radius: var(--radius-card); background: var(--sp-panel); overflow: hidden;
}
.dm-head {
  flex-shrink: 0; min-height: 60px;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 10px 10px 16px;
}
.dm-title { flex: 1; min-width: 0; margin: 0; font-size: var(--fs-body); font-weight: var(--fw-semibold); color: var(--text-bright); }
.dm-new { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; font-size: var(--fs-small); }
.dm-list { flex: 1; min-height: 0; overflow-y: auto; padding: 0 8px 8px; }
.dm-empty-list { margin: 8px 10px; color: var(--sp-ink-2); font-size: var(--fs-small); }


.dm-item {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; column-gap: 10px; row-gap: 1px;
  align-items: center;
  padding: 8px 10px; border-radius: var(--radius-md);
  color: inherit; text-decoration: none;
}
.dm-item:hover { background: var(--bg-row-hover); }
.dm-item.open { background: var(--sp-panel-2); }
.dm-item .avatar { grid-row: 1 / span 3; width: 40px; height: 40px; }
.dm-item-name, .dm-item-who, .dm-item-last { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-item-name { color: var(--text-bright); font-weight: var(--fw-medium); font-size: var(--fs-body); }
.dm-item-time { justify-self: end; font-size: var(--fs-micro); color: var(--sp-ink-3); font-variant-numeric: tabular-nums; }
.dm-item-who { grid-column: 2 / span 2; font-size: var(--fs-micro); color: var(--sp-ink-3); }
.dm-item-last { grid-column: 2; font-size: var(--fs-small); color: var(--sp-ink-2); }
.dm-item.unread .dm-item-last { color: var(--text-bright); }


.dm-item-copy { position: relative; }
.dm-item-link { text-decoration: none; }
.dm-item-link::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius-md); }
.dm-item-link:focus-visible { outline: 0; }
.dm-item-link:focus-visible::after { box-shadow: inset 0 0 0 2px var(--sp-accent); }
.dm-item-copy .copy-btn { position: relative; z-index: 1; }
.dm-item-copy .copy-btn:hover { background: var(--sp-panel-3); }
.dm-item-who.with-copy { overflow: visible; justify-self: start; }
.dm-count, .topbar-messages-count {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--radius-full);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--sp-accent); color: var(--sp-on-accent);
  font-size: var(--fs-nano); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums;
}
.dm-count { grid-column: 3; justify-self: end; }


.dm-main-head .avatar { width: 36px; height: 36px; flex-shrink: 0; }
.dm-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dm-who-name, .dm-who-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-who-name { color: var(--text-bright); font-weight: var(--fw-semibold); font-size: var(--fs-body); }
.dm-who-sub { font-size: var(--fs-micro); color: var(--sp-ink-2); }
.dm-who-sub.with-copy { overflow: visible; }
.dm-back { display: none; }
.dm .chat-messages { padding: 8px 20px 12px; }
.dm .chat-composer { margin: 0 12px 12px; padding: 5px; gap: 6px; border: 0; border-radius: 12px; background: var(--sp-panel-2); }
.dm .chat-composer .chat-input::placeholder { color: var(--sp-ink-3); opacity: 1; }
.dm .chat-file { border: 0; background: var(--sp-panel-2); }
.dm .chat-own .chat-file { background: var(--bg-card); }
.dm .chat-divider::before, .dm .chat-divider::after { background: var(--sp-line); }
.dm .chat-preview-note { margin: 0 12px 12px; }
.dm-blank { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; text-align: center; }
.dm-blank-icon { font-size: 40px; color: var(--sp-ink-3); }
.dm-blank p { margin: 0; max-width: 340px; color: var(--sp-ink-2); text-wrap: balance; }


.dm-folders { flex-shrink: 0; display: flex; margin: 0 12px 8px; }
.dm-folders .segmented-item {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  text-decoration: none;
}
.dm-folders .dm-count { height: 18px; min-width: 18px; padding: 0 5px; }





.dm-search-field { flex: none; margin: 0 12px 8px; }
.dm-search-field .ph { left: 10px; font-size: 17px; color: var(--sp-ink-2); }

.dm-side .dm-search-field input {
  width: 100%; height: 36px; padding: 0 12px 0 34px; border: 0; border-radius: var(--radius-sm);
  background: var(--sp-panel-2); font-size: var(--fs-body);
}
.dm-search-field input:focus { box-shadow: inset 0 0 0 1px var(--sp-accent); }
.dm-search-field input::placeholder { color: var(--sp-ink-2); }
.dm-search { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.dm-search:empty { display: none; }
.dm-side:has(#dm-search:not(:empty)) > :is(.dm-folders, .dm-list) { display: none; }
.dm-search-tabs .segmented-item { cursor: pointer; }
.dm-search-tabs input { position: absolute; opacity: 0; pointer-events: none; }
.dm-search-tabs .segmented-item:has(input:checked) { background: var(--sp-panel-3); color: var(--sp-ink); }
.dm-search-tabs .segmented-item:has(input:focus-visible) { outline: 2px solid var(--border-focus); outline-offset: -2px; }
.dm-search-hits { font-size: var(--fs-micro); color: var(--sp-ink-3); font-variant-numeric: tabular-nums; }
.dm-search:has(input[value="direct"]:checked) [data-set="projects"],
.dm-search:has(input[value="projects"]:checked) [data-set="direct"] { display: none; }
.dm-search .dm-pick-group:first-child { margin-top: 4px; }
.dm-search mark { padding: 0 1px; border-radius: 3px; background: var(--sp-accent-soft); color: inherit; }



.chat-history-bar {
  flex: none; display: flex; align-items: center; gap: 10px; margin: 0 12px 12px; padding: 8px 8px 8px 12px;
  border-radius: 12px; background: var(--sp-panel-2); font-size: var(--fs-small); color: var(--sp-ink-2);
}
.chat-history-bar .ph { flex: none; font-size: 18px; color: var(--sp-ink-3); }
.chat-history-bar span { flex: 1; min-width: 0; }
.chat-messages.is-history .msg-tools { display: none; }



.dm-proj > summary { list-style: none; cursor: pointer; }
.dm-proj > summary::-webkit-details-marker { display: none; }
.dm-proj[open] > summary { background: var(--sp-panel-2); border-radius: var(--radius-md) var(--radius-md) 0 0; }
.dm-proj-chat { color: var(--sp-ink); font-weight: var(--fw-medium); }
.dm-proj-chat::after { content: " ·"; color: var(--sp-ink-3); font-weight: var(--fw-regular); }



.dm-proj > .dm-item .avatar, .dm-item-proj .avatar { grid-row: 1 / span 2; }
.dm-proj-letter { border: 0; font-size: 16px; font-weight: var(--fw-semibold); }


.dm-proj .dm-item-name, .dm-item-proj .dm-item-name { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; height: 1lh; }
.dm-item-title { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.dm-item-client { flex: none; font-size: var(--fs-micro); font-weight: var(--fw-regular); color: var(--sp-ink-3); }


.dm-side > .dm-list .dm-item:not(.unread) .dm-item-name { color: var(--sp-ink-2); font-weight: var(--fw-regular); }
.dm-side > .dm-list .dm-item:not(.unread) .dm-item-last { color: var(--sp-ink-3); }
.dm-side > .dm-list .dm-item:not(.unread) .dm-proj-chat { color: var(--sp-ink-2); }
.dm-side > .dm-list .dm-item.unread .dm-item-name { font-weight: var(--fw-semibold); }
.dm-side > .dm-list .dm-item.unread .dm-item-time { color: var(--sp-accent); }


.dm-list .dm-count { animation: none; }


.dm-readall {
  flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin: -2px 12px 6px; padding-left: 4px; min-height: 28px;
  font-size: var(--fs-small); color: var(--sp-ink-2); white-space: nowrap;
}
.dm-readall span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.dm-readall-btn {
  flex: none; display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px;
  border: 0; border-radius: var(--radius-sm); background: transparent;
  color: var(--sp-accent); font: inherit; font-weight: var(--fw-medium); cursor: pointer;
}
.dm-readall-btn:hover { background: var(--sp-panel-2); }
.dm-readall-btn:focus-visible { outline: 2px solid var(--border-focus); outline-offset: -2px; }
.dm-side:has(#dm-search:not(:empty)) > .dm-readall { display: none; }
.dm-proj-chats {
  margin-bottom: 6px; padding: 2px 4px 6px 20px;
  border-radius: 0 0 var(--radius-md) var(--radius-md); background: var(--sp-panel-2);
}
.dm-proj-chats .dm-empty-list { margin: 6px 8px; }
.dm-chat {
  display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; column-gap: 10px; row-gap: 1px;
  align-items: center; padding: 6px 8px; border-radius: var(--radius-sm);
  color: inherit; text-decoration: none;
}
.dm-chat:hover { background: var(--sp-panel-3); }
.dm-chat.open { background: var(--sp-panel); }
.dm-chat-icon {
  width: 32px; height: 32px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  border-radius: 10px; background: var(--sp-panel); color: var(--sp-ink-2); font-size: 16px;
}
.dm-chat .dm-chat-icon { grid-row: 1 / span 2; }
.dm-chat.open .dm-chat-icon { background: var(--sp-panel-2); }
.dm-chat-name {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--text-bright); font-size: var(--fs-small); font-weight: var(--fw-medium);
}
.dm-chat-tag { font-size: var(--fs-label); font-weight: var(--fw-regular); color: var(--sp-ink-3); }
.dm-chat.unread .dm-item-last { color: var(--text-bright); }
.dm-chat .chat-dot { grid-column: 3; justify-self: end; margin: 0; }



.dm-main-head .dm-chat-icon { width: 36px; height: 36px; background: var(--sp-panel-2); font-size: 18px; }
.dm-goto { flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; font-size: var(--fs-small); text-decoration: none; }
.dm .chat-bar { margin: 0 12px; }
.dm .chat-hint { margin: 4px 16px 6px; }
.dm .chat-archived { margin: 0 12px 12px; }


.main:has(.dm) { overflow: hidden; }


.client-shell:has(.dm) { height: 100dvh; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
body.preview-on .client-shell:has(.dm) { height: calc(100dvh - 44px); }
.client-main:has(.dm) { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.client-main > .content.dm-page { flex: 1; min-height: 0; width: 100%; display: flex; flex-direction: column; margin: 0 auto; padding: 0 24px 24px; }
.dm-page .content-head { flex-shrink: 0; }
.dm-page > .card.dm-blank { flex: 0 0 auto; }


.topbar .topbar-messages.active { background: var(--sp-panel-2); color: var(--sp-ink); }
.topbar-messages-count { height: 18px; min-width: 18px; padding: 0 5px; }


.dm-pick-search input { width: 100%; }
.dm-pick-list { max-height: min(420px, 60vh); overflow-y: auto; margin: 0 -8px; padding: 0 8px; }
.dm-pick-group {
  margin: 12px 0 4px; padding: 0 8px;
  font-size: var(--fs-micro); color: var(--sp-ink-3);
  text-transform: uppercase; letter-spacing: var(--ls-wide); font-weight: var(--fw-medium);
}
.dm-pick-row {
  position: relative;
  display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; column-gap: 10px; align-items: center;
  padding: 8px; border-radius: var(--radius-md); color: inherit; text-decoration: none;
}
.dm-pick-row:hover { background: var(--sp-panel-2); }
.dm-pick-row .avatar { grid-row: span 2; width: 36px; height: 36px; }
.dm-pick-name, .dm-pick-sub { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-pick-name { color: var(--text-bright); font-weight: var(--fw-medium); text-decoration: none; }


.dm-pick-name::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius-md); }
.dm-pick-name:focus-visible { outline: 0; }
.dm-pick-name:focus-visible::after { box-shadow: inset 0 0 0 2px var(--sp-accent); }
.dm-pick-row .copy-btn { position: relative; z-index: 1; }

.dm-pick-row .copy-btn:hover { background: var(--sp-panel-3); }
.dm-pick-sub { grid-column: 2; font-size: var(--fs-micro); color: var(--sp-ink-2); }
.dm-pick-sub.with-copy { overflow: visible; justify-self: start; }
.dm-pick-tag { grid-row: 1 / span 2; grid-column: 3; font-size: var(--fs-micro); color: var(--sp-ink-3); }

@media (max-width: 767px) {
  .dm { grid-template-columns: minmax(0, 1fr); }
  .dm-resizer { display: none; }
  .role-studio .dm { padding: 0 8px 8px; }
  .dm:not(.panel-main) .dm-main { display: none; }
  .dm.panel-main .dm-side { display: none; }
  .dm-back { display: inline-flex; }
  

  

  .role-studio .app:has(.dm) { height: 100vh; height: 100svh; min-height: 0; overflow: hidden; }
  .role-studio .main:has(.dm) { flex: 1; height: auto; min-height: 0; overflow: hidden; }
  .client-shell:has(.dm) { height: 100vh; height: 100svh; }
  .client-main > .content.dm-page { padding: 0 8px 8px; }
  .dm-page .content-head { display: none; }
  .dm .chat-messages { padding: 8px 12px 12px; }
  .dm .chat-composer { margin-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  .dm-goto span { display: none; }
}




.files-kind {
  display: inline-grid; place-items: center; flex-shrink: 0; width: 28px; height: 28px;
  border-radius: 8px; font-size: 16px; color: var(--text-inverse);
}
.files-kind.is-input { background: var(--sp-accent); }
.files-kind.is-result { background: var(--sp-success); }

.client-project .side-card-head > .section-head-action { margin-left: auto; font-size: 14px; }
.client-project .side-card-head > .section-head-action + .btn-icon { margin-left: 0; }



.client-project .disk-folders { margin-bottom: 14px; }
.client-project .disk-folder-head { align-items: center; min-height: 30px; }
.client-project .disk-folder-head > .ph { font-size: 17px; color: var(--sp-success); }
.client-project .disk-folder-head .slot-day-label { color: var(--sp-ink); font-size: 14px; font-weight: var(--fw-semibold); overflow-wrap: anywhere; }
.client-project .disk-folder-actions { display: flex; gap: 2px; margin-left: auto; }
.client-project .disk-folder-actions .btn-icon { width: 30px; height: 30px; font-size: 16px; }
.client-project .disk-note { margin: 0; padding: 10px; font-size: var(--fs-small); color: var(--sp-ink-3); }
.client-project .disk-note.is-error { color: var(--sp-danger); }

.client-project .disk-dir > summary { list-style: none; cursor: pointer; }
.client-project .disk-dir > summary::-webkit-details-marker { display: none; }
.client-project .disk-dir > summary :is(.file-icon, .result-icon) { background: var(--sp-panel-3); color: var(--sp-ink-2); }
.client-project .disk-chev { transition: transform .15s; }
.client-project .disk-dir[open] .disk-chev { transform: rotate(180deg); }
.client-project .slot-day-rows .disk-nested { padding-left: 40px; }
.client-project .slot-day-rows .disk-nested :is(.file-icon, .result-icon) { width: 30px; height: 30px; font-size: 15px; }
.client-project .slot-day-rows > * + .disk-dir,
.client-project .slot-day-rows > .disk-dir + *,
.client-project .disk-dir > * + :is(.result-row, .file-tile) { box-shadow: 0 -1px 0 var(--sp-line); }

.client-project .files-sub { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; padding: 0 4px; font-size: var(--fs-small); color: var(--sp-ink-3); }
.client-project .files-sub .ph { font-size: 17px; color: var(--sp-success); }
.client-project .files-sub b { color: var(--sp-ink); font-weight: var(--fw-semibold); font-size: 14px; }


.disk-pick-root { display: flex; align-items: center; gap: 6px; margin: 0 2px; font-size: var(--fs-small); color: var(--sp-ink-3); }
.disk-pick-list {
  display: flex; flex-direction: column; gap: 2px; max-height: 360px; overflow-y: auto;
  padding: 4px; border-radius: var(--radius-lg); background: var(--sp-panel-2);
}
.disk-pick-opt { position: relative; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius-md); cursor: pointer; font-size: 14px; color: var(--sp-ink); }
.disk-pick-opt[hidden] { display: none; }
.disk-pick-opt:hover, .disk-pick-opt:has(input:checked) { background: var(--sp-panel-3); }
.disk-pick-opt:has(input:focus-visible) { outline: 2px solid var(--border-focus); outline-offset: -2px; }
.disk-pick-opt input { position: absolute; opacity: 0; pointer-events: none; }
.disk-pick-opt .ph { flex-shrink: 0; color: var(--sp-ink-2); font-size: 17px; }
.disk-pick-opt > span { min-width: 0; overflow-wrap: anywhere; }
.disk-pick-opt small { margin-left: auto; padding-left: 10px; white-space: nowrap; color: var(--sp-ink-3); font-size: 12px; }
.disk-pick-opt.is-taken { color: var(--sp-ink-3); cursor: default; }
.disk-pick-opt.is-taken:hover { background: none; }
.disk-pick-opt .disk-pick-check { margin-left: auto; color: var(--sp-accent); visibility: hidden; }
.disk-pick-opt:has(input:checked) .disk-pick-check { visibility: visible; }
.disk-pick-hint { margin: 0 2px; font-size: var(--fs-small); color: var(--sp-ink-3); line-height: 1.45; }
