    :root {
      --bg: #f3f7fb;
      --panel: #ffffff;
      --panel-soft: #f8fbff;
      --ink: #172033;
      --muted: #66758d;
      --line: #dce7f4;
      --brand-navy: #00355f;
      --brand-blue: #075ea8;
      --brand-sky: #e7f3ff;
      --brand-orange: #ff8a1f;
      --brand-orange-soft: #fff2e3;
      --green: #0f9f7a;
      --green-soft: #dcf7ef;
      --coral: #ff6b4a;
      --amber: #f5b841;
      --blue: #1677c8;
      --shadow: 0 18px 48px rgba(0, 53, 95, .08);
      --surface: var(--panel);
      --surface-soft: var(--panel-soft);
      --border: var(--line);
      --border-strong: #bdd0e5;
      --text: var(--ink);
      --muted-2: #93a4ba;
      --primary: var(--brand-blue);
      --primary-soft: var(--brand-sky);
      --success: #16a34a;
      --success-soft: var(--green-soft);
      --warning: #d97706;
      --warning-soft: #fffbeb;
      --danger: #dc2626;
      --danger-soft: #fef2f2;
      --ai: #2554a4;
      --ai-soft: #edf4ff;
      --radius-sm: 8px;
      --radius-md: 12px;
      --radius-lg: 16px;
      --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
      --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
      color-scheme: light;
      font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    }

    * { box-sizing: border-box; }
    body {
      margin: 0;
      min-height: 100vh;
      background:
        radial-gradient(circle at 8% -10%, rgba(255, 138, 31, .10), transparent 32%),
        linear-gradient(180deg, #f8fbff 0%, var(--bg) 46%, #eef5fb 100%);
      color: var(--ink);
      letter-spacing: 0;
    }
    button, input, select, textarea { font: inherit; letter-spacing: 0; }
    button { cursor: pointer; }
    .shell {
      display: grid;
      grid-template-columns: 276px minmax(0, 1fr);
      height: 100vh;
      min-height: 0;
      overflow: hidden;
    }
    .sidebar {
      border-right: 1px solid rgba(13, 95, 168, .12);
      background: linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(247, 251, 255, .92));
      padding: 18px 14px;
      position: sticky;
      top: 0;
      height: 100vh;
      display: flex;
      flex-direction: column;
      min-height: 0;
      overflow: hidden;
      box-shadow: 8px 0 34px rgba(0, 53, 95, .05);
    }
    .sidebar-header {
      flex-shrink: 0;
    }
    .brand {
      display: flex;
      align-items: center;
      gap: 12px;
      margin-bottom: 16px;
      padding: 10px;
      min-height: 62px;
      border: 1px solid rgba(13, 95, 168, .12);
      border-radius: 14px;
      background: rgba(255, 255, 255, .78);
      box-shadow: 0 10px 26px rgba(0, 53, 95, .06);
      font-weight: 760;
    }
    .brand-logo {
      width: 46px;
      height: 46px;
      object-fit: cover;
      border-radius: 12px;
      background: var(--brand-navy);
      flex: 0 0 auto;
      box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14);
    }
    .brand-copy {
      display: grid;
      gap: 2px;
      min-width: 0;
    }
    .brand-copy strong {
      color: var(--brand-navy);
      font-size: 16px;
      line-height: 1.1;
      white-space: nowrap;
    }
    .brand-copy span {
      color: var(--muted);
      font-size: 12px;
      font-weight: 650;
      text-transform: uppercase;
      letter-spacing: 0;
    }
    .brand-mark { display: none; }
    .nav {
      display: grid;
      gap: 10px;
      flex: 1;
      min-height: 0;
      max-height: calc(100vh - 148px);
      overflow-y: auto;
      overscroll-behavior: contain;
      scrollbar-width: none;
      padding: 2px 2px 8px 0;
      padding-bottom: 8px;
      -webkit-overflow-scrolling: touch;
    }
    .nav::-webkit-scrollbar { width: 0; height: 0; }
    .nav-section {
      display: grid;
      gap: 4px;
    }
    .nav-section-title {
      padding: 0 10px 2px;
      color: #7a8ca4;
      font-size: 11px;
      font-weight: 800;
      line-height: 1.3;
      text-transform: uppercase;
      letter-spacing: 0;
    }
    .nav button {
      position: relative;
      border: 1px solid transparent;
      background: transparent;
      color: var(--muted);
      border-radius: 10px;
      padding: 8px 10px 8px 32px;
      min-height: 34px;
      text-align: left;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      font-weight: 650;
      transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
    }
    .nav button::before {
      content: "";
      position: absolute;
      left: 11px;
      top: 50%;
      width: 9px;
      height: 9px;
      border-radius: 50%;
      background: rgba(13, 95, 168, .28);
      transform: translateY(-50%);
    }
    .nav button.active,
    .nav button:hover {
      background: rgba(231, 243, 255, .86);
      border-color: rgba(13, 95, 168, .18);
      color: var(--brand-navy);
      transform: translateX(1px);
    }
    .nav button.active::before {
      background: linear-gradient(180deg, var(--brand-orange), #ffb15c);
      box-shadow: 0 0 0 4px rgba(255, 138, 31, .16);
    }
    .nav-badge {
      display: none;
      min-width: 20px;
      height: 20px;
      padding: 0 6px;
      border-radius: 999px;
      background: var(--danger-soft);
      color: var(--danger);
      font-size: 11px;
      line-height: 20px;
      text-align: center;
      font-weight: 700;
    }
    .nav-badge.show { display: inline-flex; align-items: center; justify-content: center; }
    .side-note {
      flex-shrink: 0;
      margin-top: 14px;
      padding: 12px;
      border: 1px solid rgba(13, 95, 168, .12);
      border-radius: 12px;
      background: rgba(255, 255, 255, .72);
      color: var(--muted);
      font-size: 12px;
      line-height: 1.5;
    }
    main {
      min-width: 0;
      height: 100vh;
      min-height: 0;
      padding: 22px 28px 34px;
      display: flex;
      flex-direction: column;
      overflow: auto;
    }
    .topbar {
      display: grid;
      grid-template-columns: minmax(220px, 1fr) minmax(280px, 520px) auto;
      align-items: center;
      gap: 16px;
      margin-bottom: 22px;
      position: sticky;
      top: 0;
      z-index: 20;
      padding: 10px 0 12px;
      background: rgba(243, 247, 251, .88);
      backdrop-filter: blur(16px);
      flex: 0 0 auto;
    }
    h1 {
      margin: 0;
      font-size: 24px;
      line-height: 1.15;
      font-weight: 760;
    }
    .subtitle {
      margin-top: 6px;
      color: var(--muted);
      font-size: 14px;
    }
    .actions {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      justify-content: flex-end;
    }
    .topbar .actions {
      align-items: center;
      max-width: 520px;
    }
    .topbar-search {
      position: relative;
      min-width: 260px;
    }
    .topbar-search .field {
      width: 100%;
      min-height: 46px;
      padding-left: 42px;
      padding-right: 14px;
      border-radius: 999px;
      background: rgba(255, 255, 255, .88);
      border-color: rgba(13, 95, 168, .18);
      box-shadow: 0 12px 26px rgba(0, 53, 95, .06);
    }
    .topbar-search::before {
      content: "⌕";
      position: absolute;
      left: 17px;
      top: 11px;
      color: var(--brand-blue);
      font-size: 18px;
      z-index: 1;
    }
    .global-search-results {
      display: none;
      position: absolute;
      top: calc(100% + 8px);
      left: 0;
      right: 0;
      max-height: 430px;
      overflow: auto;
      background: white;
      border: 1px solid rgba(13, 95, 168, .16);
      border-radius: 14px;
      box-shadow: var(--shadow-md);
      padding: 8px;
      z-index: 40;
    }
    .global-search-results.show { display: grid; gap: 6px; }
    .search-group-title {
      color: var(--muted);
      font-size: 11px;
      font-weight: 700;
      text-transform: uppercase;
      padding: 6px 8px 2px;
    }
    .search-result {
      border: 0;
      background: transparent;
      border-radius: 8px;
      padding: 8px;
      text-align: left;
      display: grid;
      gap: 2px;
      color: var(--ink);
    }
    .search-result:hover { background: var(--panel-soft); }
    .topbar-status {
      display: inline-flex;
      align-items: center;
      min-height: 30px;
      padding: 4px 9px;
      border-radius: 999px;
      background: rgba(237, 244, 255, .92);
      color: var(--brand-blue);
      font-size: 12px;
      font-weight: 650;
      border: 1px solid rgba(13, 95, 168, .12);
    }
    .btn {
      border: 1px solid rgba(13, 95, 168, .16);
      background: rgba(255, 255, 255, .78);
      color: var(--brand-navy);
      border-radius: 10px;
      padding: 10px 13px;
      min-height: 40px;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      box-shadow: 0 8px 18px rgba(0, 53, 95, .05);
      font-weight: 680;
      transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
    }
    .btn[disabled] {
      cursor: wait;
      opacity: .72;
      transform: none;
    }
    .btn.is-loading {
      position: relative;
      pointer-events: none;
      white-space: nowrap;
    }
    .btn.primary {
      border-color: transparent;
      background: linear-gradient(135deg, var(--brand-blue), #0d7fca 58%, var(--brand-orange));
      color: white;
      box-shadow: 0 14px 30px rgba(13, 95, 168, .20);
    }
    .btn:hover:not([disabled]) {
      transform: translateY(-1px);
      border-color: rgba(13, 95, 168, .28);
      box-shadow: 0 12px 24px rgba(0, 53, 95, .09);
    }
    .loading-spinner {
      width: 14px;
      height: 14px;
      border: 2px solid currentColor;
      border-right-color: transparent;
      border-radius: 50%;
      display: inline-block;
      flex: 0 0 auto;
      animation: spin .72s linear infinite;
    }
    .operation-status {
      display: none;
      align-items: center;
      gap: 7px;
      min-height: 30px;
      padding: 4px 9px;
      border-radius: 999px;
      background: var(--warning-soft);
      color: var(--warning);
      font-size: 12px;
      font-weight: 700;
      white-space: nowrap;
    }
    .operation-status.show { display: inline-flex; }
    @keyframes spin {
      to { transform: rotate(360deg); }
    }
    .grid {
      display: grid;
      gap: 14px;
    }
    .kpis {
      grid-template-columns: repeat(5, minmax(140px, 1fr));
      margin-bottom: 16px;
    }
    .card {
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 10px;
      box-shadow: var(--shadow);
    }
    .kpi {
      padding: 15px;
      min-height: 96px;
    }
    .kpi-label {
      color: var(--muted);
      font-size: 12px;
      margin-bottom: 10px;
    }
    .kpi-value {
      font-size: 28px;
      font-weight: 760;
    }
    .kpi:nth-child(2) .kpi-value { color: var(--green); }
    .kpi:nth-child(4) .kpi-value { color: var(--coral); }
    .stat-grid {
      grid-template-columns: repeat(3, minmax(180px, 1fr));
    }
    .stat-card {
      padding: 14px;
      min-height: 120px;
    }
    .stat-card h3 {
      margin: 0 0 12px;
      font-size: 14px;
    }
    .stat-row {
      display: flex;
      justify-content: space-between;
      gap: 12px;
      padding: 7px 0;
      border-bottom: 1px solid var(--line);
      color: var(--muted);
      font-size: 13px;
    }
    .stat-row:last-child {
      border-bottom: 0;
    }
    .stat-row strong {
      color: var(--ink);
    }
    .partner-platform-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
      gap: 14px;
    }
    .partner-platform-grid .empty {
      grid-column: 1 / -1;
    }
    .partner-platform-card {
      padding: 14px;
      min-height: 230px;
    }
    .partner-platform-head {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 12px;
      margin-bottom: 10px;
    }
    .partner-platform-head h3 {
      margin: 0;
      font-size: 14px;
      line-height: 1.25;
    }
    .partner-platform-subtitle {
      color: var(--muted);
      font-size: 12px;
      margin-top: 5px;
    }
    .partner-platform-block-title {
      margin: 12px 0 3px;
      color: var(--brand-navy);
      font-size: 12px;
      font-weight: 760;
    }
    .partner-platform-card .stat-row {
      padding: 6px 0;
    }
    .compact-section {
      margin-top: 8px;
    }
    .compact-stat-grid {
      grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
      gap: 8px;
    }
    .compact-stat-grid .stat-card {
      padding: 9px;
      min-height: auto;
    }
    .compact-stat-grid .stat-card h3 {
      margin-bottom: 7px;
      font-size: 13px;
    }
    .compact-stat-grid .stat-row {
      padding: 4px 0;
      gap: 8px;
      font-size: 12px;
    }
    .compact-offer {
      padding: 7px 8px;
    }
    .compact-offer .offer-title {
      font-size: 13px;
      line-height: 1.25;
    }
    .compact-offer .detail-grid {
      grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
      gap: 6px;
      margin: 7px 0 0;
    }
    .compact-offer .mini {
      min-height: 44px;
      padding: 6px;
    }
    .compact-metric-row {
      display: flex;
      flex-wrap: wrap;
      gap: 6px 16px;
      margin-top: 5px;
      color: var(--muted);
      font-size: 12px;
    }
    .compact-metric-row strong {
      margin-left: 4px;
      color: var(--ink);
    }
    #analyticsPage .chart {
      min-height: 138px;
      padding: 10px;
    }
    #analyticsPage .chart-row {
      padding: 4px 0;
    }
    #partnerPlatformStats {
      grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
      gap: 8px;
    }
    #partnerPlatformStats .partner-platform-card {
      min-height: auto;
      padding: 9px;
    }
    #partnerPlatformStats .partner-platform-head {
      margin-bottom: 6px;
      gap: 8px;
    }
    #partnerPlatformStats .partner-platform-block-title {
      margin: 7px 0 1px;
    }
    #partnerPlatformStats .stat-row {
      padding: 4px 0;
      font-size: 12px;
    }
    .ai-mode-card {
      padding: 14px;
      min-height: 150px;
    }
    .ai-mode-list,
    .ai-warning-list {
      display: grid;
      gap: 8px;
    }
    .ai-mode-step {
      display: flex;
      align-items: flex-start;
      gap: 10px;
      padding: 8px 0;
      border-bottom: 1px solid var(--line);
    }
    .ai-mode-step:last-child {
      border-bottom: 0;
    }
    .ai-mode-dot {
      width: 10px;
      height: 10px;
      border-radius: 999px;
      background: #cbd5e1;
      margin-top: 4px;
      flex: 0 0 auto;
    }
    .ai-mode-step.active .ai-mode-dot {
      background: var(--green);
      box-shadow: 0 0 0 4px var(--green-soft);
    }
    .ai-warning {
      border: 1px solid #fed7aa;
      border-radius: 8px;
      background: var(--warning-soft);
      color: #8a4b08;
      padding: 8px 9px;
      font-size: 13px;
      line-height: 1.4;
      overflow-wrap: anywhere;
    }
    .pagination {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      margin-top: 10px;
      flex-wrap: wrap;
    }
    .pager-actions {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }
    .pager-pages {
      display: flex;
      align-items: center;
      gap: 4px;
      flex-wrap: wrap;
    }
    .pager-actions .btn {
      min-height: 34px;
      padding: 7px 10px;
    }
    .pager-page {
      min-width: 34px;
      padding-left: 8px;
      padding-right: 8px;
    }
    .pager-gap {
      color: var(--muted);
      padding: 0 2px;
      min-width: 18px;
      text-align: center;
    }
    .pager-size {
      width: 92px;
      min-height: 34px;
      padding: 6px 8px;
    }
    .analytics-source-grid {
      grid-template-columns: repeat(2, minmax(320px, 1fr));
      margin-bottom: 12px;
    }
    .analytics-source-card {
      padding: 14px;
    }
    .analytics-columns {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 14px;
      align-items: start;
    }
    .analytics-column h4 {
      margin: 0 0 8px;
      font-size: 13px;
    }
    .bot-analytics-grid {
      grid-template-columns: 1fr;
    }
    .recommendation-list {
      display: grid;
      gap: 7px;
      color: var(--muted);
      font-size: 13px;
      line-height: 1.45;
    }
    .recommendation-list div {
      padding: 8px 9px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--panel-soft);
    }
    .chart-grid {
      grid-template-columns: repeat(2, minmax(240px, 1fr));
      margin-bottom: 16px;
    }
    .chart {
      padding: 14px;
      min-height: 180px;
    }
    .chart h3 {
      margin: 0 0 12px;
      font-size: 14px;
    }
    .chart-row {
      display: grid;
      grid-template-columns: minmax(84px, 150px) minmax(120px, 1fr) 48px;
      gap: 10px;
      align-items: center;
      padding: 7px 0;
      color: var(--muted);
      font-size: 13px;
    }
    .chart-label,
    .chart-value {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .chart-value {
      color: var(--ink);
      text-align: right;
      font-weight: 650;
    }
    .chart-track {
      height: 9px;
      border-radius: 999px;
      background: #edf0f4;
      overflow: hidden;
    }
    .chart-fill {
      display: block;
      height: 100%;
      min-width: 4px;
      border-radius: inherit;
      background: linear-gradient(90deg, var(--green), var(--blue));
    }
    .content-grid {
      grid-template-columns: minmax(0, 1.45fr) minmax(320px, .72fr);
      align-items: start;
    }
    .candidates-layout {
      grid-template-columns: minmax(0, 1.35fr) minmax(360px, .78fr);
      grid-template-rows: minmax(0, 1fr);
      align-items: stretch;
      height: 100%;
      min-height: 0;
      overflow: hidden;
    }
    #candidatesPage.active {
      display: flex;
      flex: 1 1 auto;
      height: auto;
      min-height: 0;
      overflow: hidden;
    }
    #candidatesPage > .candidates-layout {
      flex: 1 1 auto;
      width: 100%;
    }
    .candidate-list-section,
    .candidate-detail-section {
      margin-top: 0;
      height: 100%;
      max-height: 100%;
      min-height: 0;
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }
    .candidate-table-wrap {
      flex: 1;
      min-height: 0;
      height: auto;
      max-height: none;
      overflow-y: auto;
      overflow-x: auto;
      overscroll-behavior: contain;
      scrollbar-gutter: stable;
      touch-action: pan-y;
    }
    .candidate-list-section .candidate-top-pagination {
      margin-top: 0;
      margin-bottom: 10px;
      padding-bottom: 10px;
      border-bottom: 1px solid var(--line);
    }
    .candidate-top-pagination > .muted {
      display: none;
    }
    .candidate-top-pagination .pager-actions {
      width: 100%;
      flex-wrap: nowrap;
      gap: 4px;
    }
    .candidate-top-pagination .pager-actions .btn {
      min-height: 28px;
      padding: 4px 6px;
      font-size: 11px;
    }
    .candidate-top-pagination [data-page-action$=":first"],
    .candidate-top-pagination [data-page-action$=":last"] {
      display: none;
    }
    .candidate-top-pagination .pager-size {
      width: 58px;
      min-height: 28px;
      padding: 4px 5px;
      font-size: 11px;
    }
    .candidate-detail-section {
      position: sticky;
      top: 18px;
      height: 100%;
      max-height: none;
    }
    .candidate-detail-panel {
      flex: 1;
      min-height: 0;
      overflow: auto;
      max-height: none;
    }
    .candidate-detail-panel .detail-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .candidate-detail-panel .section-title {
      margin-top: 12px !important;
    }
    .candidate-detail-panel .activity {
      padding: 7px 8px;
    }
    .section {
      margin-top: 16px;
    }
    .page {
      display: none;
    }
    .page.active {
      display: block;
    }
    .page-title {
      margin: 18px 0 10px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
    }
    .page-title h2 {
      margin: 0;
      font-size: 16px;
      color: var(--brand-navy);
    }
    .section-title {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin: 0 0 10px;
    }
    .section-title h2 {
      margin: 0;
      font-size: 16px;
      line-height: 1.2;
    }
    .filters {
      display: grid;
      grid-template-columns: minmax(200px, 1fr) 160px 170px;
      gap: 8px;
      margin-bottom: 10px;
    }
    .field {
      width: 100%;
      min-height: 40px;
      border: 1px solid rgba(13, 95, 168, .16);
      border-radius: 10px;
      background: rgba(255, 255, 255, .92);
      color: var(--ink);
      padding: 9px 11px;
      outline: none;
    }
    .field:focus {
      border-color: rgba(13, 95, 168, .48);
      box-shadow: 0 0 0 4px rgba(13, 95, 168, .11);
    }
    .table-wrap {
      overflow: auto;
      border-radius: 8px;
      border: 1px solid var(--line);
      background: white;
      max-height: min(70vh, 760px);
      scrollbar-width: thin;
      scrollbar-color: #cbd5e1 transparent;
    }
    .table-wrap::-webkit-scrollbar,
    .candidate-table-wrap::-webkit-scrollbar {
      width: 8px;
      height: 8px;
    }
    .table-wrap::-webkit-scrollbar-thumb,
    .candidate-table-wrap::-webkit-scrollbar-thumb {
      background: #cbd5e1;
      border-radius: 999px;
    }
    table {
      width: 100%;
      border-collapse: collapse;
      min-width: 760px;
      table-layout: fixed;
    }
    th, td {
      padding: 12px 11px;
      border-bottom: 1px solid var(--line);
      text-align: left;
      vertical-align: middle;
      font-size: 13px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    th {
      color: var(--muted);
      background: var(--panel-soft);
      font-weight: 650;
      position: sticky;
      top: 0;
      z-index: 1;
    }
    tbody tr { transition: background .15s ease; }
    tbody tr:hover,
    tbody tr.selected { background: #f1f7f5; }
    tbody tr.clickable { cursor: pointer; }
    .candidate-table-wrap th:first-child,
    .candidate-table-wrap td:first-child,
    #vacanciesPage .table-wrap th:first-child,
    #vacanciesPage .table-wrap td:first-child {
      position: sticky;
      left: 0;
      z-index: 2;
      background: inherit;
    }
    .candidate-table-wrap th:first-child,
    #vacanciesPage .table-wrap th:first-child {
      z-index: 3;
      background: var(--panel-soft);
    }
    tbody tr:nth-child(even) td { background-color: rgba(248, 250, 252, .45); }
    tbody tr:hover td,
    tbody tr.selected td { background: #f1f7f5; }
    .pill {
      display: inline-flex;
      align-items: center;
      min-height: 24px;
      border-radius: 999px;
      padding: 3px 9px;
      background: #eef2f6;
      color: var(--ink);
      font-size: 12px;
      max-width: 100%;
    }
    .pill.green { background: var(--green-soft); color: #08765c; }
    .pill.amber { background: #fff1cb; color: #85620d; }
    .pill.coral { background: #ffe7e1; color: #a43b24; }
    .detail {
      padding: 16px;
      min-height: 430px;
    }
    .detail-name {
      margin: 0 0 6px;
      font-size: 20px;
      line-height: 1.2;
      overflow-wrap: anywhere;
    }
    .muted {
      color: var(--muted);
      font-size: 13px;
    }
    .danger {
      color: var(--danger);
    }
    .detail-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
      margin: 16px 0;
    }
    .mini {
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 10px;
      background: var(--panel-soft);
      min-height: 66px;
    }
    .mini-label {
      color: var(--muted);
      font-size: 11px;
      margin-bottom: 5px;
    }
    .mini-value {
      font-size: 14px;
      overflow-wrap: anywhere;
      word-break: break-word;
    }
    .prewrap {
      white-space: pre-wrap;
      line-height: 1.5;
    }
    .pipeline {
      display: grid;
      grid-template-columns: 1fr;
      gap: 8px;
      margin-bottom: 16px;
    }
    .source-row {
      padding: 13px;
    }
    .source-row-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 10px;
    }
    .source-row-title {
      font-weight: 760;
    }
    .source-metrics {
      display: grid;
      grid-template-columns: repeat(6, minmax(110px, 1fr));
      gap: 8px;
    }
    .pipe-step {
      padding: 11px;
      min-height: 84px;
    }
    .pipe-count {
      font-weight: 760;
      font-size: 22px;
      margin-top: 8px;
    }
    .bar {
      height: 7px;
      width: 100%;
      background: #edf0f4;
      border-radius: 999px;
      overflow: hidden;
      margin-top: 10px;
    }
    .bar span {
      display: block;
      height: 100%;
      background: linear-gradient(90deg, var(--green), var(--blue));
      border-radius: inherit;
    }
    .integration-list,
    .activity-list,
    .offer-list {
      display: grid;
      gap: 8px;
    }
    .integration,
    .activity,
    .offer {
      border: 1px solid var(--line);
      border-radius: 8px;
      background: white;
      padding: 12px;
      min-width: 0;
    }
    .integration-head,
    .offer-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      margin-bottom: 4px;
    }
    .integration-title,
    .offer-title {
      font-weight: 700;
      overflow-wrap: anywhere;
    }
    .broker-field-grid {
      display: grid;
      gap: 8px;
      margin-top: 10px;
    }
    .broker-field-row {
      display: grid;
      grid-template-columns: minmax(140px, 220px) minmax(0, 1fr);
      gap: 10px;
      align-items: center;
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 9px 10px;
      background: #fbfcfd;
    }
    .broker-field-label {
      font-weight: 700;
      overflow-wrap: anywhere;
    }
    .broker-field-key {
      color: var(--muted);
      font-size: 12px;
      margin-top: 2px;
      overflow-wrap: anywhere;
    }
    .broker-field-value {
      overflow-wrap: anywhere;
      white-space: pre-wrap;
    }
    .broker-schema-list {
      display: grid;
      gap: 8px;
    }
    .broker-schema-row {
      display: grid;
      grid-template-columns: minmax(150px, 1fr) minmax(120px, 1fr) minmax(140px, 1fr);
      gap: 8px;
      align-items: center;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #fbfcfd;
      padding: 8px;
    }
    .empty {
      border: 1px dashed #cfd6df;
      color: var(--muted);
      border-radius: 8px;
      padding: 22px;
      text-align: center;
      background: rgba(255,255,255,.64);
    }
    .toast {
      position: fixed;
      right: 22px;
      bottom: 20px;
      max-width: 360px;
      background: #202123;
      color: white;
      border-radius: 8px;
      padding: 12px 14px;
      box-shadow: var(--shadow);
      opacity: 0;
      pointer-events: none;
      transform: translateY(8px);
      transition: .18s ease;
      z-index: 10;
    }
    .toast.show {
      opacity: 1;
      transform: translateY(0);
    }
    .modal-backdrop {
      position: fixed;
      inset: 0;
      display: none;
      align-items: flex-start;
      justify-content: flex-end;
      padding: 18px;
      background: rgba(32, 33, 35, .28);
      z-index: 20;
      overflow: auto;
    }
    .modal-backdrop.show { display: flex; }
    .modal {
      width: min(920px, 100%);
      max-height: calc(100vh - 36px);
      overflow: hidden;
      display: flex;
      flex-direction: column;
      background: white;
      border: 1px solid var(--line);
      border-radius: 8px;
      box-shadow: var(--shadow);
      padding: 16px;
    }
    .modal-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 12px;
    }
    .modal-head h2 {
      margin: 0;
      font-size: 17px;
    }
    #modalBody {
      flex: 1 1 auto;
      min-height: 0;
      overflow-y: auto;
      padding-right: 4px;
      overscroll-behavior: contain;
    }
    .ad-draft-compare-grid {
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
      gap: 8px;
      align-items: start;
    }
    .ad-draft-change-list {
      display: grid;
      gap: 8px;
      margin: 12px 0;
    }
    .ad-draft-change {
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #fbfcfd;
      padding: 12px;
      min-width: 0;
    }
    .ad-draft-change-title {
      font-weight: 760;
      margin-bottom: 8px;
      overflow-wrap: anywhere;
    }
    .ad-draft-change-grid {
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
      gap: 8px;
    }
    .ad-draft-change-value {
      border: 1px solid var(--line);
      border-radius: 8px;
      background: white;
      padding: 9px;
      min-height: 54px;
      overflow-wrap: anywhere;
    }
    .ad-draft-final {
      border: 1px solid var(--line);
      border-radius: 8px;
      background: white;
      padding: 12px;
      margin-bottom: 8px;
    }
    .icon-btn {
      width: 34px;
      height: 34px;
      display: grid;
      place-items: center;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: white;
      color: var(--ink);
      font-size: 18px;
      line-height: 1;
    }
    .raw-grid { display: grid; gap: 8px; }
    .raw-row {
      display: grid;
      grid-template-columns: 150px minmax(0, 1fr);
      gap: 10px;
      padding: 8px 0;
      border-bottom: 1px solid var(--line);
      font-size: 13px;
    }
    .raw-key { color: var(--muted); }
    .raw-value {
      overflow-wrap: anywhere;
      word-break: break-word;
      white-space: pre-wrap;
    }
    .detail a,
    .modal a,
    .activity a,
    .mini a {
      overflow-wrap: anywhere;
      word-break: break-word;
    }
    .hidden { display: none !important; }
    .role-hidden { display: none !important; }
    .auth-screen {
      min-height: 100vh;
      display: grid;
      place-items: center;
      padding: 22px;
      background: var(--bg);
    }
    .auth-screen.hidden { display: none !important; }
    .auth-card {
      width: min(420px, 100%);
      padding: 22px;
    }
    .auth-card h1 {
      margin: 0 0 8px;
      font-size: 22px;
    }
    .auth-form {
      display: grid;
      gap: 10px;
      margin-top: 16px;
    }
    .auth-error {
      min-height: 18px;
      color: var(--coral);
      font-size: 13px;
    }
    .shell.locked { display: none; }
    .user-chip {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      min-height: 40px;
      border: 1px solid rgba(13, 95, 168, .14);
      border-radius: 999px;
      padding: 8px 10px;
      background: rgba(255, 255, 255, .74);
      color: var(--muted);
      font-size: 13px;
    }
    .form-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px;
    }
    .bot-layout {
      grid-template-columns: minmax(0, 1fr);
      align-items: start;
    }
    .textarea {
      min-height: 128px;
      resize: vertical;
      line-height: 1.45;
    }
    .scenario-list {
      display: grid;
      gap: 10px;
    }
    .scenario-card {
      padding: 10px;
      cursor: pointer;
    }
    .scenario-card.selected {
      border-color: rgba(16, 163, 127, .45);
      background: #f3fbf8;
    }
    .chatbot-scenario-strip {
      grid-auto-flow: column;
      grid-auto-columns: minmax(240px, 320px);
      grid-template-columns: none;
      align-items: stretch;
      overflow-x: auto;
      padding-bottom: 4px;
      scrollbar-width: thin;
      scrollbar-color: #cbd5e1 transparent;
    }
    .chatbot-scenario-strip .scenario-card {
      min-height: 96px;
    }
    .message-list {
      display: grid;
      gap: 12px;
      margin-top: 10px;
    }
    .message-card {
      padding: 12px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--panel-soft);
    }
    .chatbot-tree {
      display: grid;
      gap: 12px;
    }
    .chatbot-branch {
      border: 1px solid var(--line);
      border-radius: 8px;
      background: white;
      padding: 12px;
      min-width: 0;
    }
    .chatbot-branch.main {
      background: #fbfcfd;
    }
    .chatbot-branch-list {
      display: grid;
      gap: 12px;
    }
    .branch-split {
      position: relative;
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
      gap: 12px;
      margin: 10px 0 16px 22px;
      padding-left: 20px;
      border-left: 2px solid rgba(185, 28, 28, .72);
    }
    .branch-split::before {
      content: "";
      position: absolute;
      left: -2px;
      top: 22px;
      width: 22px;
      border-top: 2px solid rgba(185, 28, 28, .72);
    }
    .branch-condition {
      display: grid;
      grid-template-columns: 170px minmax(0, 1fr);
      gap: 8px;
      margin-bottom: 10px;
    }
    .branch-head,
    .message-head,
    .attachment-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      margin-bottom: 8px;
    }
    .branch-fields {
      display: grid;
      gap: 8px;
      margin-bottom: 10px;
    }
    .branch-fields.two {
      grid-template-columns: minmax(0, 1fr) 180px;
    }
    .branch-keywords {
      min-height: 72px;
      resize: vertical;
    }
    .chatbot-branch .branch-split {
      grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
    .delay-grid {
      display: grid;
      grid-template-columns: minmax(90px, 1fr) minmax(90px, 1fr) minmax(120px, 1fr);
      gap: 8px;
      margin-top: 8px;
    }
    .manual-vacancy-grid {
      display: grid;
      grid-template-columns: 130px 150px minmax(180px, 1fr) minmax(150px, .8fr) minmax(150px, .8fr);
      gap: 8px;
      margin-bottom: 10px;
    }
    .kb-form-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(160px, 1fr));
      gap: 8px;
      margin-bottom: 10px;
    }
    .kb-field {
      display: grid;
      gap: 4px;
      min-width: 0;
    }
    .kb-field.wide {
      grid-column: span 2;
    }
    .kb-field.full {
      grid-column: 1 / -1;
    }
    .kb-field label {
      color: var(--muted);
      font-size: 12px;
    }
    .kb-inline {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      align-items: center;
    }
    .kb-inline.full {
      grid-column: 1 / -1;
    }
    .day-grid {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin-top: 8px;
    }
    .day-chip {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      min-height: 30px;
      padding: 5px 8px;
      border: 1px solid var(--line);
      border-radius: 999px;
      background: white;
      font-size: 12px;
    }
    .checkbox-list {
      display: grid;
      gap: 8px;
      max-height: 360px;
      overflow: auto;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: white;
      padding: 8px;
    }
    .checkbox-row {
      display: grid;
      grid-template-columns: 22px minmax(0, 1fr);
      gap: 8px;
      align-items: start;
      padding: 8px;
      border-radius: 8px;
    }
    .checkbox-row:hover { background: var(--panel-soft); }
    .checkbox-row.is-inactive {
      opacity: .72;
      background: #fbfcfd;
    }
    .security-grid {
      grid-template-columns: minmax(260px, .8fr) minmax(420px, 1.2fr);
      align-items: start;
    }
    .security-user-form {
      display: grid;
      grid-template-columns: minmax(180px, 1fr) minmax(150px, .55fr) minmax(220px, 1fr) auto;
      gap: 10px;
      align-items: end;
      margin-bottom: 14px;
    }
    .security-user-form .auth-error { grid-column: 1 / -1; }
    .manager-mode .admin-only { display: none !important; }
    .attention-layout {
      grid-template-columns: minmax(320px, .9fr) minmax(420px, 1.1fr);
      align-items: start;
    }
    .attention-item {
      display: grid;
      gap: 6px;
      padding: 12px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: white;
      cursor: pointer;
    }
    .attention-item:hover,
    .attention-item.selected {
      border-color: rgba(37, 99, 235, .35);
      background: var(--primary-soft);
    }
    .soft-panel {
      background: var(--ai-soft);
      border: 1px solid #ddd6fe;
      border-radius: 12px;
      padding: 12px;
    }
    .clickable-card {
      width: 100%;
      text-align: left;
      font: inherit;
      color: inherit;
      border: 1px solid var(--line);
      background: white;
    }
    .clickable-card:hover {
      border-color: rgba(37, 99, 235, .35);
      background: var(--primary-soft);
    }
    .direct-chart {
      position: relative;
      display: grid;
      grid-auto-flow: column;
      grid-auto-columns: minmax(64px, 1fr);
      align-items: stretch;
      gap: 8px;
      min-height: 430px;
      overflow-x: auto;
      padding: 22px 12px 12px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background:
        linear-gradient(to top, rgba(148, 163, 184, .16) 1px, transparent 1px) 0 22px / 100% 72px,
        white;
    }
    .direct-chart.metric {
      grid-auto-columns: minmax(46px, 1fr);
      min-height: 230px;
      padding-top: 16px;
      background:
        linear-gradient(to top, rgba(148, 163, 184, .14) 1px, transparent 1px) 0 18px / 100% 42px,
        white;
    }
    .direct-chart-day {
      position: relative;
      display: grid;
      grid-template-rows: 1fr auto;
      min-width: 64px;
      height: 390px;
      outline: 1px solid transparent;
      border-radius: 8px;
      padding: 0 2px 4px;
      transition: background .16s ease, outline-color .16s ease;
    }
    .direct-chart.metric .direct-chart-day {
      min-width: 46px;
      height: 192px;
    }
    .direct-chart-day:hover,
    .direct-chart-day:focus-within {
      background: rgba(37, 99, 235, .08);
      outline-color: rgba(37, 99, 235, .35);
    }
    .direct-bars {
      display: flex;
      align-items: flex-end;
      justify-content: center;
      gap: 4px;
      min-height: 330px;
    }
    .direct-chart.metric .direct-bars { min-height: 136px; }
    .direct-bar {
      display: block;
      width: 9px;
      min-height: 4px;
      border-radius: 4px 4px 0 0;
      border: 1px solid transparent;
      transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
    }
    .direct-chart.metric .direct-bar { width: 18px; }
    .direct-chart-day:hover .direct-bar {
      transform: translateY(-2px);
      border-color: rgba(15, 23, 42, .28);
      box-shadow: 0 8px 18px rgba(15, 23, 42, .14);
    }
    .direct-bar.cost { background: #2563eb; }
    .direct-bar.conv { background: #16a34a; }
    .direct-bar.impressions { background: #f97316; }
    .direct-bar.clicks { background: #7c3aed; }
    .direct-chart-label {
      min-height: 28px;
      color: #64748b;
      font-size: 11px;
      line-height: 1.1;
      text-align: center;
      white-space: nowrap;
    }
    .direct-chart-tooltip {
      position: fixed;
      left: var(--tooltip-x, -9999px);
      top: var(--tooltip-y, -9999px);
      min-width: 180px;
      padding: 10px 12px;
      border: 1px solid rgba(15, 23, 42, .12);
      border-radius: 8px;
      background: #fff;
      box-shadow: 0 18px 40px rgba(15, 23, 42, .18);
      transform: translate(12px, 12px);
      opacity: 0;
      pointer-events: none;
      z-index: 60;
      transition: opacity .16s ease, transform .16s ease;
    }
    .direct-chart-day:hover .direct-chart-tooltip,
    .direct-chart-day:focus-within .direct-chart-tooltip {
      opacity: 1;
      transform: translate(var(--tooltip-shift-x, 12px), var(--tooltip-shift-y, 12px));
    }
    .direct-chart-tooltip strong {
      display: block;
      margin-bottom: 6px;
      color: var(--text);
      font-size: 12px;
    }
    .direct-chart-tooltip span {
      display: flex;
      justify-content: space-between;
      gap: 12px;
      color: #475569;
      font-size: 12px;
    }
    .direct-chart-legend {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      align-items: center;
      margin: 10px 0 0;
      color: var(--muted);
      font-size: 12px;
    }
    .direct-legend-dot {
      display: inline-block;
      width: 9px;
      height: 9px;
      border-radius: 999px;
      margin-right: 5px;
      vertical-align: -1px;
    }
    .direct-tabs {
      position: sticky;
      top: 0;
      z-index: 4;
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      padding: 8px 0 12px;
      background: var(--bg);
    }
    .direct-tab-panel.hidden { display: none !important; }
    .direct-tab-panel {
      min-width: 0;
    }
    .direct-chart-card {
      width: 100%;
      padding: 12px;
    }
    .direct-dynamics-insights {
      display: grid;
      grid-template-columns: repeat(4, minmax(170px, 1fr));
      gap: 10px;
      margin-bottom: 12px;
    }
    .direct-metric-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(260px, 1fr));
      gap: 12px;
      margin-top: 12px;
    }
    .direct-metric-card {
      min-width: 0;
      padding: 12px;
    }
    .modal.wide {
      width: min(1120px, 100%);
    }

    /* Compact density layer for operational CRM screens. */
    .sidebar { padding: 14px 10px; }
    .brand { gap: 8px; padding: 8px; min-height: 52px; border-radius: 10px; box-shadow: none; }
    .brand-logo { width: 36px; height: 36px; border-radius: 8px; }
    .brand-copy strong { font-size: 14px; }
    .brand-copy span { font-size: 10px; }
    .nav { gap: 6px; max-height: calc(100vh - 118px); padding-bottom: 4px; }
    .nav-section { gap: 2px; }
    .nav-section-title { padding: 0 8px 1px; font-size: 10px; }
    .nav button { min-height: 28px; padding: 5px 8px 5px 24px; border-radius: 8px; gap: 6px; font-size: 13px; }
    .nav button::before { left: 9px; width: 7px; height: 7px; }
    .side-note { margin-top: 8px; padding: 8px; border-radius: 8px; font-size: 11px; line-height: 1.35; }
    main { padding: 14px 18px 22px; }
    .topbar { gap: 10px; margin-bottom: 12px; padding: 6px 0 8px; grid-template-columns: minmax(180px, 1fr) minmax(240px, 420px) auto; }
    h1 { font-size: 20px; }
    .subtitle { margin-top: 3px; font-size: 12px; }
    .actions { gap: 6px; }
    .topbar .actions { max-width: 620px; }
    .topbar-search .field { min-height: 34px; padding-left: 32px; border-radius: 999px; box-shadow: none; }
    .topbar-search::before { left: 12px; top: 7px; font-size: 15px; }
    .topbar-status,
    .user-chip { min-height: 30px; padding: 4px 8px; font-size: 11px; }
    .btn { min-height: 32px; padding: 6px 9px; border-radius: 8px; gap: 6px; font-size: 13px; box-shadow: none; }
    .field { min-height: 34px; padding: 7px 9px; border-radius: 8px; font-size: 13px; }
    .textarea { min-height: 92px; line-height: 1.35; }
    .card { padding: 10px; border-radius: 8px; box-shadow: none; }
    .section { margin-top: 10px; }
    .page-title { margin: 10px 0 6px; gap: 8px; }
    .page-title h2,
    .section-title h2 { font-size: 14px; }
    .section-title { gap: 8px; margin: 0 0 6px; }
    .filters { gap: 6px; margin-bottom: 8px; }
    .table-wrap { max-height: min(74vh, 820px); }
    th, td { padding: 7px 8px; font-size: 12px; }
    .pill { min-height: 20px; padding: 2px 7px; font-size: 11px; }
    .detail { padding: 10px; min-height: 320px; }
    .detail-name { margin-bottom: 4px; font-size: 17px; }
    .muted { font-size: 12px; }
    .detail-grid { gap: 7px; margin: 10px 0; }
    .mini { min-height: 50px; padding: 7px; }
    .mini-label { margin-bottom: 3px; font-size: 10px; }
    .mini-value { font-size: 12px; }
    .source-row,
    .integration,
    .activity,
    .offer { padding: 8px; }
    .integration-list,
    .activity-list,
    .offer-list,
    .scenario-list { gap: 6px; }
    .pipe-step { min-height: 62px; padding: 8px; }
    .pipe-count { font-size: 18px; margin-top: 5px; }
    .stat-card { min-height: auto; }
    .form-grid,
    .kb-form-grid,
    .manual-vacancy-grid { gap: 6px; margin-bottom: 8px; }
    .scenario-card { padding: 7px; }
    .chatbot-scenario-strip { grid-auto-columns: minmax(210px, 280px); padding-bottom: 2px; }
    .chatbot-scenario-strip .scenario-card { min-height: 68px; }
    #chatbotsPage .bot-layout {
      grid-template-columns: minmax(260px, 0.38fr) minmax(0, 1fr);
      gap: 10px;
      align-items: start;
    }
    #chatbotsPage .bot-layout > .section:first-child { grid-column: 1; }
    #chatbotsPage .bot-layout > .section:nth-child(2) { grid-column: 2; grid-row: 1 / span 2; }
    #chatbotsPage .binding-section { grid-column: 1; }
    #chatbotsPage .chatbot-scenario-strip {
      grid-auto-flow: row;
      grid-auto-columns: auto;
      grid-template-columns: 1fr;
      max-height: calc(100vh - 210px);
      overflow-x: hidden;
      overflow-y: auto;
    }
    #chatbotsPage .checkbox-list {
      max-height: min(38vh, 360px);
      overflow-y: auto;
    }
    #chatbotsPage #chatbotMessages .textarea { min-height: 72px; }
    .message-list,
    .chatbot-tree,
    .chatbot-branch-list { gap: 8px; margin-top: 8px; }
    .message-card,
    .chatbot-branch { padding: 8px; }
    .branch-head,
    .message-head,
    .attachment-row { gap: 6px; margin-bottom: 6px; }
    .branch-condition { grid-template-columns: 132px minmax(0, 1fr); gap: 6px; margin-bottom: 6px; }
    .branch-fields { gap: 6px; margin-bottom: 6px; }
    .branch-keywords { min-height: 54px; }
    .delay-grid { grid-template-columns: minmax(70px, 1fr) minmax(70px, 1fr) minmax(96px, 1fr); gap: 6px; margin-top: 6px; }
    .day-grid { gap: 5px; margin-top: 6px; }
    .day-chip { min-height: 28px; padding: 4px 7px; font-size: 12px; }
    .branch-split { gap: 8px; margin: 8px 0 10px 14px; padding-left: 14px; }
    .chatbot-branch .branch-split { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
    .empty { padding: 14px; }
    .modal { padding: 10px; }
    .modal-head { margin-bottom: 8px; }
    .modal-head h2 { font-size: 15px; }

    @media (max-width: 1280px) {
      .topbar {
        grid-template-columns: 1fr;
        align-items: stretch;
      }
      .topbar .actions {
        justify-content: flex-start;
        max-width: none;
      }
      .topbar-search {
        max-width: none;
      }
    }
    @media (max-height: 760px) {
      .sidebar-footer { display: none; }
      .nav { max-height: calc(100vh - 104px); }
    }
    @media (max-width: 1120px) {
      .shell { height: auto; min-height: 100vh; overflow: visible; }
      main { height: auto; min-height: 100vh; display: block; overflow: visible; }
      .kpis { grid-template-columns: repeat(3, minmax(140px, 1fr)); }
      .content-grid { grid-template-columns: 1fr; }
      #candidatesPage.active { display: block; height: auto; min-height: 0; overflow: visible; }
      .candidates-layout { height: auto; min-height: 0; }
      .candidate-list-section,
      .candidate-detail-section { min-height: auto; }
      .candidate-detail-section { position: static; max-height: none; }
      .candidate-detail-panel { max-height: 70vh; overflow: auto; }
      .candidate-table-wrap { max-height: 60vh; min-height: 320px; }
      .direct-dynamics-insights { grid-template-columns: repeat(2, minmax(170px, 1fr)); }
      .direct-metric-grid { grid-template-columns: 1fr; }
      .bot-layout { grid-template-columns: 1fr; }
      #chatbotsPage .bot-layout { grid-template-columns: 1fr; }
      #chatbotsPage .bot-layout > .section:first-child,
      #chatbotsPage .bot-layout > .section:nth-child(2),
      #chatbotsPage .binding-section { grid-column: auto; grid-row: auto; }
      #chatbotsPage .chatbot-scenario-strip {
        grid-auto-flow: column;
        grid-auto-columns: minmax(210px, 280px);
        grid-template-columns: none;
        max-height: none;
        overflow-x: auto;
        overflow-y: hidden;
      }
      .chatbot-tree { grid-template-columns: 1fr; }
      .branch-split { grid-template-columns: 1fr; }
      .branch-condition { grid-template-columns: 1fr; }
      .manual-vacancy-grid { grid-template-columns: 1fr 1fr; }
      .kb-form-grid { grid-template-columns: 1fr 1fr; }
      .kb-field.wide { grid-column: span 2; }
      .source-metrics { grid-template-columns: repeat(3, minmax(120px, 1fr)); }
      .analytics-columns,
      .analytics-source-grid { grid-template-columns: 1fr; }
      .security-grid { grid-template-columns: 1fr; }
      .security-user-form { grid-template-columns: 1fr; }
      .security-user-form .auth-error { grid-column: auto; }
    }
    @media (max-width: 760px) {
      .shell { grid-template-columns: 1fr; }
      .sidebar {
        position: static;
        height: auto;
        border-right: 0;
        border-bottom: 1px solid var(--line);
      }
      .nav { max-height: 260px; }
      main { padding: 18px 14px 26px; }
      .topbar { align-items: stretch; }
      .actions { justify-content: flex-start; }
      .kpis,
      .pipeline,
      .source-metrics,
      .filters,
      .detail-grid,
      .chart-grid,
      .stat-grid { grid-template-columns: 1fr; }
      .ad-draft-compare-grid { grid-template-columns: 1fr; }
      .ad-draft-change-grid { grid-template-columns: 1fr; }
      .kb-form-grid { grid-template-columns: 1fr; }
      .kb-field.wide { grid-column: auto; }
      .broker-field-row { grid-template-columns: 1fr; }
      .broker-schema-row { grid-template-columns: 1fr; }
      .modal-backdrop { padding: 8px; }
      .raw-row { grid-template-columns: 1fr; }
      h1 { font-size: 22px; }
    }
