      * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
      }

      :root {
        --app-visual-height: 100dvh;
        --dashboard-padding-y: 40px;
      }

      body {
        font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
        background: var(--color-bg);
        color: var(--color-text);
        min-height: 100vh;
        min-height: 100dvh;
      }

      /* --- Login page layout --- */
      .page {
        min-height: 100vh;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 20px;
        background:
          radial-gradient(ellipse at 30% 20%, rgba(0,200,83, 0.05) 0%, transparent 60%),
          radial-gradient(ellipse at 70% 80%, rgba(0,143,60, 0.03) 0%, transparent 60%);
      }

      .card {
        background: var(--color-bg-card);
        border: 1px solid var(--color-border);
        border-radius: var(--radius-card);
        padding: 40px;
        width: 100%;
        max-width: 520px;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
      }

      /* --- Dashboard flex layout --- */
      .dashboard-page {
        display: flex;
        height: 100vh;
        height: var(--app-visual-height, 100dvh);
        min-height: 100vh;
        min-height: var(--app-visual-height, 100dvh);
        overflow: hidden;
      }

      /* --- Sidebar --- */
      .sidebar {
        width: 252px;
        background: linear-gradient(180deg, #fff 0%, var(--color-bg-subtle) 100%);
        border-right: 1px solid var(--color-border);
        display: flex;
        flex-direction: column;
        position: sticky;
        top: 0;
        height: 100vh;
        height: var(--app-visual-height, 100dvh);
        flex-shrink: 0;
        z-index: 30;
      }

      .sidebar-brand {
        padding: 14px 14px 8px;
      }

      .sidebar-brand a {
        text-decoration: none;
        display: flex;
        align-items: center;
        gap: 8px;
        min-height: 32px;
        color: var(--color-text);
      }

      .sidebar-brand a img {
        width: 22px;
        height: 22px;
        flex-shrink: 0;
      }

      .sidebar-brand a span {
        font-family: "Courier New", Courier, monospace;
        font-size: 15px;
        font-weight: 600;
        letter-spacing: 0;
        color: var(--color-text-secondary);
      }

      .sidebar-nav {
        flex: 1;
        padding: 4px 8px 8px;
        display: flex;
        flex-direction: column;
        gap: 1px;
        overflow-y: auto;
        scrollbar-width: thin;
      }

      .sidebar-item {
        position: relative;
        display: flex;
        align-items: center;
        gap: 8px;
        min-height: 34px;
        padding: 7px 9px 7px 12px;
        border-radius: var(--radius-small);
        font-size: var(--text-md);
        font-weight: 500;
        line-height: 1.15;
        color: var(--color-text-secondary);
        cursor: pointer;
        transition:
          background 0.15s,
          color 0.15s,
          box-shadow 0.15s;
        text-decoration: none;
        border: none;
        background: none;
        width: 100%;
        text-align: left;
        font-family: inherit;
        white-space: nowrap;
      }

      .sidebar-item--chat-entry {
        white-space: normal;
      }

      .sidebar-item--nested {
        margin-left: 18px;
        width: calc(100% - 18px);
        min-height: 30px;
        padding-top: 6px;
        padding-bottom: 6px;
        font-size: 14px;
      }

      .sidebar-item__label {
        min-width: 0;
      }

      .sidebar-item__text {
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 2px;
      }

      .sidebar-item__title,
      .sidebar-item__sub {
        display: block;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
      }

      .sidebar-item__sub {
        color: var(--color-text-hint);
        font-size: 12px;
        font-weight: 600;
        line-height: 1.15;
      }

      .sidebar-item:hover {
        background: rgba(15, 56, 21, 0.045);
        color: var(--color-text);
      }

      .sidebar-item.active {
        background: linear-gradient(135deg, var(--color-matcha-light) 0%, var(--color-matcha-lighter) 100%);
        color: var(--color-forest);
        font-weight: 700;
        box-shadow:
          inset 0 1px 0 rgba(255, 255, 255, 0.65),
          inset 0 0 0 1px rgba(0, 200, 83, 0.28),
          0 2px 10px rgba(0, 200, 83, 0.16);
      }

      .sidebar-item.active::before {
        content: "";
        position: absolute;
        left: 4px;
        top: 7px;
        bottom: 7px;
        width: 4px;
        border-radius: var(--radius-pill);
        background: linear-gradient(180deg, var(--color-brand) 0%, var(--color-brand-600) 100%);
        box-shadow: 0 0 10px rgba(0, 200, 83, 0.55);
        animation: sidebar-indicator-in 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
      }

      @keyframes sidebar-indicator-in {
        from {
          transform: scaleY(0.4);
          opacity: 0;
        }
        to {
          transform: scaleY(1);
          opacity: 1;
        }
      }

      @media (prefers-reduced-motion: reduce) {
        .sidebar-item.active::before {
          animation: none;
        }
      }

      .sidebar-item.active .sidebar-item__sub {
        color: rgba(15, 56, 21, 0.55);
      }

      .sidebar-item svg {
        width: 17px;
        height: 17px;
        flex-shrink: 0;
        opacity: 0.58;
      }

      .sidebar-item.active svg {
        opacity: 1;
        color: var(--color-brand-600);
      }

      .sidebar-group {
        display: flex;
        align-items: center;
        gap: 8px;
        margin: 13px 10px 5px;
        color: var(--color-text-hint);
        font-size: 10px;
        font-weight: 800;
        letter-spacing: 0.08em;
        line-height: 1;
        text-transform: uppercase;
      }

      .sidebar-group:first-child {
        margin-top: 5px;
      }

      .sidebar-group::after {
        content: "";
        height: 1px;
        flex: 1;
        background: var(--color-border);
        opacity: 0.75;
      }

      .sidebar-badge {
        margin-left: auto;
        background: rgba(0,200,83, 0.12);
        color: var(--color-brand);
        font-size: 13px;
        font-weight: 600;
        line-height: 18px;
        padding: 0 6px;
        border-radius: var(--radius-pill);
        min-width: 18px;
        text-align: center;
      }
      .sidebar-badge--warning {
        background: rgba(217, 119, 6, 0.12);
        color: #d97706;
      }

      .sidebar-social {
        padding: 6px 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        border-top: 1px solid var(--color-border);
      }

      .sidebar-social-label {
        display: none;
      }

      .sidebar-social-links {
        display: flex;
        gap: 8px;
        flex-shrink: 0;
      }

      .sidebar-social-link {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 30px;
        height: 30px;
        border-radius: var(--radius-element);
        text-decoration: none;
        transition: box-shadow 0.15s, transform 0.15s;
      }

      .sidebar-social-link:hover {
        transform: translateY(-1px);
      }

      .sidebar-social-link--vk {
        background: #0077FF;
        color: #fff;
      }

      .sidebar-social-link--vk:hover {
        box-shadow: 0 4px 12px rgba(0, 119, 255, 0.45);
      }

      .sidebar-social-link--tg {
        background: #2AABEE;
        color: #fff;
      }

      .sidebar-social-link--tg:hover {
        box-shadow: 0 4px 12px rgba(42, 171, 238, 0.45);
      }

      .sidebar-footer {
        padding: 10px 12px;
        border-top: 1px solid var(--color-border);
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 4px 8px;
      }

      .sidebar-email {
        font-size: var(--text-base);
        color: var(--color-text-muted);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        min-width: 0;
      }

      .sidebar-account-type {
        display: none;
        font-size: var(--text-xs);
        font-weight: 600;
        color: var(--color-danger);
        background: rgba(124, 58, 237, 0.08);
        padding: 2px 8px;
        border-radius: var(--radius-xs);
        grid-column: 1 / -1;
        justify-self: start;
      }

      .sidebar-account-switcher {
        grid-column: 1 / -1;
        width: 100%;
        min-width: 0;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-small);
        background: var(--color-bg-card);
        color: var(--color-text);
        font-size: var(--text-sm);
        padding: 6px 8px;
      }

      .sidebar-version {
        grid-column: 1 / -1;
        color: var(--color-text-hint);
        font-size: var(--text-xs);
      }

      .sidebar-logout {
        flex-shrink: 0;
        background: none;
        border: none;
        color: var(--color-text-muted);
        cursor: pointer;
        font-size: var(--text-base);
        padding: 4px 6px;
        border-radius: var(--radius-xs);
        transition:
          color 0.2s,
          background 0.2s;
      }

      .sidebar-logout:hover {
        color: var(--color-error);
        background: rgba(220, 38, 38, 0.06);
      }

      .settings-meta {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        padding: 12px 14px;
        background: var(--color-bg-card);
        border: 1px solid var(--color-border);
        border-radius: var(--radius-element);
        font-size: 15px;
      }

      .settings-meta + .settings-meta {
        margin-top: 8px;
      }

      .settings-meta__label {
        color: var(--color-text-muted);
      }

      .settings-meta__value {
        color: var(--color-text);
        font-weight: 600;
        text-align: right;
      }

      .settings-action-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 12px;
        margin-top: 14px;
        padding-top: 14px;
        border-top: 1px solid var(--color-border);
      }

      .settings-link-card {
        display: flex;
        align-items: flex-start;
        gap: 16px;
        padding: 18px 20px;
        background: var(--color-bg-card);
        border: 1px solid var(--color-border);
        border-radius: var(--radius-element);
        text-decoration: none;
        transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
      }

      .settings-link-card:hover {
        border-color: rgba(0,200,83, 0.35);
        box-shadow: 0 8px 24px rgba(15, 56, 21, 0.08);
        transform: translateY(-1px);
      }

      .settings-link-card__icon {
        flex-shrink: 0;
        width: 38px;
        height: 38px;
        border-radius: var(--radius-element);
        background: rgba(0,200,83, 0.08);
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--color-brand);
      }

      .settings-link-card__title {
        font-size: 15px;
        font-weight: 700;
        color: var(--color-text);
        margin-bottom: 3px;
      }

      .settings-link-card__text {
        font-size: 15px;
        color: var(--color-text-muted);
        line-height: 1.45;
      }

      .settings-link-card__arrow {
        flex-shrink: 0;
        margin-top: 8px;
        color: var(--color-text-muted);
      }

      .course-promo-card {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: center;
        gap: 18px;
        padding: 20px 22px;
        background:
          linear-gradient(135deg, rgba(15, 56, 21, 0.04) 0%, rgba(0, 200, 83, 0.08) 100%),
          var(--color-bg-card);
        border: 1px solid rgba(0, 200, 83, 0.24);
        border-radius: var(--radius-element);
        color: inherit;
        text-decoration: none;
        transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
      }

      .course-promo-card:hover {
        border-color: rgba(0, 200, 83, 0.42);
        box-shadow: 0 10px 28px rgba(15, 56, 21, 0.10);
        transform: translateY(-1px);
      }

      .course-promo-card__icon {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 42px;
        height: 42px;
        border-radius: var(--radius-element);
        background: #fff;
        color: var(--color-brand-700);
        border: 1px solid rgba(0, 200, 83, 0.20);
        flex-shrink: 0;
      }

      .course-promo-card__body {
        display: block;
        min-width: 0;
      }

      .course-promo-card__title {
        display: block;
        margin: 0 0 6px;
        color: var(--color-text);
        font-size: 17px;
        font-weight: 800;
        line-height: 1.3;
      }

      .course-promo-card__text {
        display: block;
        margin: 0;
        color: var(--color-text-secondary);
        font-size: 15px;
        line-height: 1.55;
      }

      .course-promo-card__note {
        display: block;
        margin-top: 6px;
        color: var(--color-brand-700);
        font-weight: 700;
      }

      .course-promo-card__cta {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        min-height: 38px;
        padding: 8px 14px;
        border-radius: var(--radius-small);
        background: var(--color-forest);
        color: #fff;
        font-size: 15px;
        font-weight: 700;
        white-space: nowrap;
      }

      .course-promo-card__cta svg {
        flex-shrink: 0;
      }

      @media (max-width: 640px) {
        .course-promo-card {
          grid-template-columns: 1fr;
          align-items: flex-start;
          padding: 18px;
        }

        .course-promo-card__cta {
          width: 100%;
        }
      }

      /* --- Dashboard main content --- */
      .dashboard-main {
        flex: 1;
        padding: 40px;
        height: 100vh;
        height: var(--app-visual-height, 100dvh);
        overflow-y: auto;
        min-width: 0;
        min-height: 0;
        background:
          radial-gradient(ellipse at 30% 20%, rgba(0,200,83, 0.05) 0%, transparent 60%),
          radial-gradient(ellipse at 70% 80%, rgba(0,143,60, 0.03) 0%, transparent 60%);
      }

      .dashboard-section {
        max-width: 640px;
        margin: 0 auto;
      }

      .section-title {
        font-size: var(--text-4xl);
        font-weight: 700;
        color: var(--color-text);
        margin-bottom: 28px;
      }

      .integrations-section {
        max-width: 960px;
      }

      .integration-panel {
        border: 1px solid var(--color-border);
        border-radius: var(--radius-element);
        background: var(--color-bg-card);
        padding: 20px;
      }

      .integration-hero {
        display: grid;
        grid-template-columns: minmax(0, 1.3fr) minmax(260px, 0.7fr);
        gap: 18px;
        align-items: stretch;
        margin-bottom: 18px;
      }

      .integration-hero-main {
        border: 1px solid var(--color-border);
        border-radius: var(--radius-element);
        background: var(--color-bg-card);
        padding: 22px;
      }

      .integration-eyebrow {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        min-height: 26px;
        padding: 4px 10px;
        border-radius: var(--radius-pill);
        background: rgba(0, 200, 83, 0.10);
        color: var(--color-brand-700);
        font-size: 13px;
        font-weight: 800;
        margin-bottom: 12px;
      }

      .integration-hero-title {
        margin: 0 0 8px;
        color: var(--color-text);
        font-size: 30px;
        line-height: 1.16;
        font-weight: 800;
        letter-spacing: 0;
      }

      .integration-hero-subtitle {
        color: var(--color-text-secondary);
        font-size: 16px;
        line-height: 1.55;
        margin: 0;
      }

      .integration-stats {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
      }

      .integration-stat {
        border: 1px solid var(--color-border);
        border-radius: var(--radius-small);
        background: var(--color-bg-subtle);
        padding: 14px;
      }

      .integration-stat-label {
        color: var(--color-text-muted);
        font-size: 13px;
        margin-bottom: 4px;
      }

      .integration-stat-value {
        color: var(--color-text);
        font-size: 22px;
        line-height: 1.2;
        font-weight: 800;
      }

      .integration-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
        gap: 14px;
        margin-top: 14px;
      }

      .integration-grid--stack {
        grid-template-columns: 1fr;
      }

      .integrations-section .integration-grid--stack {
        grid-template-columns: 1fr;
      }

      .integration-list {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
        margin: 12px 0 0;
      }

      .integration-list-item {
        display: flex;
        align-items: flex-start;
        gap: 10px;
        color: var(--color-text-secondary);
        font-size: 15px;
        line-height: 1.45;
      }

      .integration-list-item svg {
        flex: 0 0 auto;
        width: 17px;
        height: 17px;
        margin-top: 2px;
        color: var(--color-brand-700);
      }

      .integration-downloads {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
        gap: 10px;
        margin-top: 12px;
      }

      .integration-downloads--mac {
        margin-top: 10px;
      }

      .integration-download {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        min-height: 44px;
        padding: 10px 12px;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-small);
        color: var(--color-text);
        text-decoration: none;
        font-size: 14px;
        font-weight: 700;
        background: var(--color-bg);
      }

      .integration-download:hover {
        border-color: rgba(0, 200, 83, 0.35);
      }

      .integration-field {
        display: grid;
        grid-template-columns: 120px minmax(0, 1fr);
        gap: 10px;
        align-items: center;
        margin-top: 10px;
      }

      .integration-field span {
        color: var(--color-text-muted);
        font-size: 14px;
        font-weight: 700;
      }

      .integration-field code,
      .integration-code {
        display: block;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-small);
        background: var(--color-bg);
        color: var(--color-text);
        font-family: "Monaco", "Courier New", monospace;
        font-size: 13px;
        padding: 9px 10px;
      }

      .integration-progress {
        height: 8px;
        border-radius: var(--radius-pill);
        background: var(--color-border);
        overflow: hidden;
        margin-top: 8px;
      }

      .integration-progress span {
        display: block;
        height: 100%;
        width: 0;
        border-radius: inherit;
        background: var(--color-brand);
      }

      .integration-key-row,
      .integration-request-row {
        display: grid;
        gap: 10px;
        padding: 10px 0;
        border-top: 1px solid var(--color-border);
      }

      .integration-key-row {
        grid-template-columns: 1fr;
        align-items: start;
      }

      .integration-key-row > * {
        min-width: 0;
      }

      .integration-request-row {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
      }

      .integration-request-row > * {
        min-width: 0;
      }

      .integration-key-row:first-child,
      .integration-request-row:first-child {
        border-top: none;
      }

      .stt-device-summary {
        padding: 10px 0 12px;
        border-bottom: 1px solid var(--color-border);
      }

      .stt-device-slot-actions {
        margin-top: 10px;
      }

      .stt-device-empty {
        padding-top: 10px;
      }

      .stt-device-buy {
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid var(--color-border);
        display: grid;
        gap: 8px;
      }

      .stt-device-buy-hint {
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid var(--color-border);
      }

      .stt-device-buy-controls {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        align-items: center;
      }

      .stt-stepper {
        display: inline-flex;
        align-items: center;
        gap: 8px;
      }

      .stt-stepper-value {
        min-width: 2ch;
        text-align: center;
        font-size: 15px;
        font-weight: 800;
        color: var(--color-text);
      }

      .integration-row-title,
      .integration-row-meta {
        overflow-wrap: anywhere;
      }

      .integration-row-title {
        color: var(--color-text);
        font-size: 14px;
        font-weight: 800;
      }

      .integration-row-meta {
        color: var(--color-text-muted);
        font-size: 13px;
        line-height: 1.45;
        margin-top: 2px;
      }

      .integration-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        align-items: center;
        margin-top: 14px;
      }

      .integration-actions .btn {
        margin-top: 0;
      }

      .integration-key-row .integration-actions {
        max-width: 100%;
        justify-content: flex-start;
      }

      .integration-secret {
        margin-top: 12px;
        padding: 12px;
        border: 1px solid rgba(0, 200, 83, 0.28);
        border-radius: var(--radius-small);
        background: rgba(0, 200, 83, 0.08);
      }

      .integration-secret-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        margin-bottom: 8px;
      }

      @media (max-width: 760px) {
        .integration-hero {
          grid-template-columns: 1fr;
        }

        .integration-field {
          grid-template-columns: 1fr;
        }

        .integration-key-row,
        .integration-request-row {
          grid-template-columns: 1fr;
        }
      }

      /* --- Typography --- */
      h1 {
        font-size: var(--text-5xl);
        margin-bottom: 8px;
        color: var(--color-text);
      }

      h1 span {
        background: linear-gradient(135deg, var(--color-brand) 0%, var(--color-brand-light) 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
      }

      .subtitle {
        color: var(--color-text-muted);
        margin-bottom: 32px;
        font-size: var(--text-lg);
        line-height: 1.55;
      }

      h2 {
        font-size: var(--text-3xl);
        color: var(--color-text);
        margin-bottom: 16px;
      }

      label {
        display: block;
        font-size: var(--text-base);
        color: var(--color-text-muted);
        margin-bottom: 6px;
        font-weight: 500;
      }

      /* --- Inputs --- */
      input[type="email"],
      input[type="text"],
      input[type="password"] {
        width: 100%;
        padding: 14px 16px;
        background: var(--color-bg-card);
        border: 1px solid var(--color-border);
        border-radius: var(--radius-element);
        color: var(--color-text);
        font-size: var(--text-lg);
        transition: border-color 0.3s;
      }

      input:focus {
        outline: none;
        border-color: var(--color-brand-text);
      }

      a:focus-visible,
      button:focus-visible,
      input:focus-visible,
      select:focus-visible,
      textarea:focus-visible,
      [tabindex]:focus-visible {
        outline: 3px solid color-mix(in srgb, var(--color-brand-text) 35%, transparent);
        outline-offset: 2px;
        box-shadow: 0 0 0 1px var(--color-brand-text);
      }

      input[readonly] {
        background: var(--color-bg);
        color: var(--color-text-muted);
        cursor: pointer;
      }

      /* Buttons: see /css/buttons.css */

      /* --- Copy group --- */
      .copy-group {
        display: flex;
        gap: 8px;
        align-items: stretch;
      }

      .copy-group input {
        flex: 1;
        min-width: 0;
      }

      .copy-btn {
        flex-shrink: 0;
        padding: 14px 16px;
        background: rgba(0,200,83, 0.08);
        border: 1px solid rgba(0,200,83, 0.2);
        border-radius: var(--radius-element);
        color: var(--color-brand);
        cursor: pointer;
        font-size: 15px;
        transition: background 0.2s;
      }

      .copy-btn:hover {
        background: rgba(0,200,83, 0.15);
      }

      /* --- Sections --- */
      .section {
        margin-bottom: 32px;
      }

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

      .divider {
        border: none;
        border-top: 1px solid var(--color-border);
        margin: 32px 0;
      }

      .webmaster-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        margin: 16px 0;
      }

      .webmaster-hosts-list {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
        margin-top: 16px;
      }

      .webmaster-host-row {
        display: flex;
        justify-content: space-between;
        gap: 16px;
        padding: 12px 14px;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-small);
        background: var(--color-bg-card);
      }

      .webmaster-host-title {
        color: var(--color-text);
        font-size: 15px;
        font-weight: 700;
        overflow-wrap: anywhere;
      }

      .webmaster-host-meta {
        color: var(--color-text-muted);
        font-size: 13px;
        margin-top: 4px;
        overflow-wrap: anywhere;
      }

      .avito-ads-connection-form {
        display: grid;
        grid-template-columns: 1fr;
        gap: 14px;
        max-width: 560px;
      }

      .avito-ads-label-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin-bottom: 6px;
      }

      .avito-ads-label-row label {
        margin-bottom: 0;
      }

      .avito-ads-help-btn {
        border: none;
        background: transparent;
        color: var(--color-brand-700);
        font: inherit;
        font-size: 14px;
        font-weight: 700;
        cursor: pointer;
        padding: 0;
        white-space: nowrap;
      }

      .avito-ads-help-btn:hover {
        color: var(--color-forest);
        text-decoration: underline;
      }

      .avito-account-help-figure {
        margin: 18px 0;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-element);
        background: var(--color-bg-subtle);
        padding: 16px;
      }

      .avito-account-help-image {
        display: block;
        width: 100%;
        height: auto;
        border-radius: var(--radius-small);
      }

      #section-lidfly {
        max-width: 1040px;
      }

      #section-workspace {
        max-width: 1180px;
      }

      .workspace-page.hidden {
        display: none;
      }

      .workspace-topbar {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 16px;
        margin-bottom: 20px;
      }

      .workspace-tabs-section {
        margin-bottom: 22px;
      }

      .workspace-tabs {
        min-width: 0;
      }

      .workspace-breadcrumbs {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
        align-items: center;
        margin-bottom: 8px;
        color: var(--color-text-hint);
        font-size: var(--text-sm);
      }

      .workspace-breadcrumbs a {
        color: var(--color-brand-text);
        text-decoration: none;
      }

      .workspace-subtitle,
      .workspace-lead {
        margin: 0;
        color: var(--color-text-muted);
        font-size: 15px;
        line-height: 1.55;
      }

      .workspace-actions,
      .workspace-inline-actions {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
        align-items: center;
      }

      .workspace-help-row {
        margin-top: 10px;
      }

      .workspace-kpi-grid {
        display: grid;
        grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: 10px;
        margin-bottom: 22px;
      }

      .workspace-card,
      .workspace-panel,
      .workspace-migration,
      .workspace-prompt {
        background: var(--color-bg-card);
        border: 1px solid var(--color-border);
        border-radius: var(--radius-small);
      }

      .workspace-card,
      .workspace-panel {
        padding: 16px;
      }

      .workspace-kpi-label {
        color: var(--color-text-muted);
        font-size: var(--text-sm);
        margin-bottom: 6px;
      }

      .workspace-kpi-value {
        color: var(--color-text);
        font-size: 28px;
        font-weight: 800;
        line-height: 1;
      }

      .workspace-grid {
        display: grid;
        grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
        gap: 14px;
        margin-bottom: 22px;
      }

      .workspace-panel h2,
      .workspace-card h3 {
        margin: 0 0 10px;
        color: var(--color-text);
        font-size: 17px;
        line-height: 1.35;
      }

      .workspace-card p,
      .workspace-panel p {
        margin: 0;
        color: var(--color-text-muted);
        font-size: 15px;
        line-height: 1.55;
      }

      .workspace-list {
        display: grid;
        gap: 8px;
      }

      .workspace-panel-head {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 16px;
        margin-bottom: 14px;
      }

      .workspace-panel-head .workspace-actions {
        justify-content: flex-end;
        flex: 0 1 420px;
      }

      .workspace-panel-head input[type="search"] {
        min-width: min(260px, 100%);
      }

      .workspace-memory-panel {
        margin-bottom: 22px;
      }

      .workspace-memory-tabs {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        margin-bottom: 16px;
      }

      .workspace-memory-tab {
        display: inline-flex;
        align-items: center;
        gap: 7px;
        min-height: 36px;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-small);
        background: var(--color-bg-card);
        color: var(--color-text-muted);
        padding: 6px 12px;
        font: inherit;
        font-size: 14px;
        font-weight: 600;
        white-space: nowrap;
        cursor: pointer;
        transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
      }

      .workspace-memory-tab:hover {
        border-color: color-mix(in srgb, var(--color-brand-text) 40%, var(--color-border));
        color: var(--color-text);
      }

      .workspace-memory-tab-count {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 20px;
        height: 18px;
        padding: 0 6px;
        border-radius: 999px;
        background: var(--color-bg-subtle);
        color: var(--color-text-muted);
        font-size: 12px;
        font-weight: 700;
        line-height: 1;
      }

      .workspace-memory-tab.is-active {
        border-color: var(--color-brand-text);
        background: var(--color-brand-text);
        color: #fff;
      }

      .workspace-memory-tab.is-active .workspace-memory-tab-count {
        background: rgba(255, 255, 255, 0.24);
        color: #fff;
      }

      .workspace-memory-tab.is-empty .workspace-memory-tab-count {
        opacity: 0.55;
      }

      .workspace-memory-list {
        min-height: 90px;
      }

      .workspace-list-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 12px;
        align-items: center;
        padding: 10px 0;
        border-bottom: 1px solid var(--color-border);
      }

      .workspace-list-row:last-child {
        border-bottom: 0;
      }

      .workspace-row-title {
        color: var(--color-text);
        font-size: 15px;
        font-weight: 700;
        overflow-wrap: anywhere;
      }

      .workspace-row-meta {
        color: var(--color-text-muted);
        font-size: 13px;
        margin-top: 3px;
      }

      .workspace-memory-list.workspace-list {
        gap: 10px;
      }

      .workspace-memory-list .workspace-memory-row {
        display: block;
        grid-template-columns: none;
        padding: 13px 15px;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-small);
        background: var(--color-bg-card);
      }

      a.workspace-memory-row-link {
        color: inherit;
        text-decoration: none;
        cursor: pointer;
        transition: border-color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
      }

      a.workspace-memory-row-link:hover {
        border-color: color-mix(in srgb, var(--color-brand-text) 45%, var(--color-border));
        background: var(--color-bg-subtle);
        box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
      }

      .workspace-memory-row-head {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 6px;
      }

      .workspace-doc-type-badge {
        display: inline-flex;
        align-items: center;
        padding: 2px 8px;
        border-radius: var(--radius-xs, 6px);
        background: color-mix(in srgb, var(--color-brand-text) 10%, transparent);
        color: var(--color-brand-text);
        font-size: 12px;
        font-weight: 700;
        letter-spacing: 0.01em;
      }

      .workspace-memory-row-date {
        color: var(--color-text-muted);
        font-size: 13px;
      }

      .workspace-memory-row .workspace-row-title {
        font-size: 15px;
        line-height: 1.4;
      }

      .workspace-memory-row-wide {
        grid-template-columns: 1fr;
      }

      .workspace-memory-excerpt {
        margin-top: 6px;
        color: var(--color-text-muted);
        font-size: 13px;
        line-height: 1.5;
        overflow-wrap: anywhere;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
      }

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

      .workspace-memory-code {
        margin: 8px 0 0;
        padding: 10px 12px;
        max-height: 240px;
        overflow: auto;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-small);
        background: var(--color-bg-subtle);
        color: var(--color-text-secondary);
        font-family: "Monaco", "Courier New", monospace;
        font-size: var(--text-sm);
        line-height: 1.5;
        white-space: pre-wrap;
        overflow-wrap: anywhere;
      }

      .workspace-context-code {
        max-height: 420px;
      }

      .workspace-memory-link {
        min-height: 32px;
        border: 0;
        background: transparent;
        color: var(--color-brand-text);
        padding: 0;
        font: inherit;
        font-weight: 800;
        cursor: pointer;
        text-align: left;
      }

      .workspace-client-id {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        max-width: 100%;
        margin-top: 4px;
        color: var(--color-text-muted);
        font-size: 12px;
        line-height: 1.35;
      }

      .workspace-client-id code {
        color: var(--color-text-muted);
        font-family: "Monaco", "Courier New", monospace;
        font-size: 11px;
        font-weight: 500;
        overflow-wrap: anywhere;
      }

      .workspace-client-id-copy {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 22px;
        height: 22px;
        flex: 0 0 auto;
        border: 0;
        border-radius: var(--radius-small);
        background: transparent;
        color: var(--color-text-muted);
        cursor: pointer;
        padding: 0;
      }

      .workspace-client-id-copy:hover {
        background: rgba(0, 200, 83, 0.08);
        color: var(--color-brand-text);
      }

      .workspace-client-id-copy svg {
        width: 14px;
        height: 14px;
      }

      .workspace-client-row-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        margin-top: 7px;
      }

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

      .workspace-detail-footer-actions {
        justify-content: flex-end;
        padding-top: 6px;
      }

      .workspace-client-settings-btn {
        padding: 5px 9px;
        font-size: 12px;
        line-height: 1.2;
      }

      .workspace-toolbar {
        display: flex;
        gap: 8px;
        align-items: center;
        flex-wrap: wrap;
        margin-bottom: 14px;
      }

      .workspace-provider-link-form {
        align-items: flex-end;
        margin-top: 12px;
      }

      .workspace-provider-link-form label {
        display: grid;
        gap: 6px;
        flex: 1 1 180px;
        margin: 0;
        color: var(--color-text-muted);
        font-size: var(--text-sm);
        font-weight: 700;
      }

      .workspace-toolbar input,
      .workspace-toolbar select,
      .workspace-form input,
      .workspace-form select,
      .workspace-form textarea {
        border: 1px solid var(--color-border);
        border-radius: var(--radius-small);
        background: var(--color-bg-card);
        color: var(--color-text);
        font-size: var(--text-base);
        padding: 9px 11px;
      }

      .workspace-toolbar input {
        min-width: min(280px, 100%);
        flex: 1 1 260px;
      }

      .workspace-table-wrap {
        overflow-x: auto;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-small);
        background: var(--color-bg-card);
      }

      .workspace-table {
        width: 100%;
        border-collapse: collapse;
        min-width: 760px;
      }

      .workspace-table th,
      .workspace-table td {
        padding: 11px 12px;
        border-bottom: 1px solid var(--color-border);
        text-align: left;
        vertical-align: top;
        font-size: var(--text-base);
      }

      .workspace-table th {
        color: var(--color-text-muted);
        font-size: var(--text-sm);
        font-weight: 700;
        white-space: nowrap;
      }

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

      .workspace-table a {
        color: var(--color-brand-text);
        text-decoration: none;
        font-weight: 700;
      }

      .workspace-status-pill {
        display: inline-flex;
        align-items: center;
        border-radius: var(--radius-inline);
        padding: 3px 8px;
        background: var(--color-bg-subtle);
        color: var(--color-text-muted);
        font-size: var(--text-sm);
        font-weight: 700;
        white-space: nowrap;
      }

      .workspace-status-pill.ready,
      .workspace-status-pill.active {
        background: rgba(0, 200, 83, 0.08);
        color: var(--color-brand-text);
      }

      .workspace-status-pill.partial {
        background: rgba(217, 119, 6, 0.08);
        color: var(--color-warning);
      }

      .workspace-status-pill.empty,
      .workspace-status-pill.error,
      .workspace-status-pill.failed {
        background: rgba(220, 38, 38, 0.08);
        color: var(--color-error);
      }

      .workspace-form {
        display: grid;
        gap: 14px;
        max-width: 760px;
      }

      .workspace-form-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
      }

      .workspace-form label {
        display: grid;
        gap: 6px;
        color: var(--color-text-muted);
        font-size: var(--text-sm);
        font-weight: 700;
      }

      .workspace-form textarea {
        min-height: 92px;
        resize: vertical;
      }

      .workspace-readiness {
        display: grid;
        gap: 8px;
      }

      .workspace-check {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        padding: 9px 0;
        border-bottom: 1px solid var(--color-border);
        color: var(--color-text);
        font-size: 15px;
      }

      .workspace-check:last-child {
        border-bottom: 0;
      }

      .workspace-prompt-list {
        display: grid;
        gap: 8px;
      }

      .workspace-prompt {
        padding: 12px 14px;
        color: var(--color-text);
        font-size: 15px;
        line-height: 1.5;
      }

      .workspace-url-list {
        display: grid;
        gap: 8px;
        margin-top: 12px;
      }

      .workspace-url-list code {
        overflow-wrap: anywhere;
      }

      .workspace-howto-list {
        margin: 0;
        padding-left: 20px;
        color: var(--color-text-muted);
        font-size: 15px;
        line-height: 1.6;
      }

      .workspace-howto-list li + li {
        margin-top: 8px;
      }

      .workspace-howto-list strong {
        color: var(--color-text);
      }

      .workspace-howto-note {
        margin-top: 10px;
      }

      .workspace-howto-actions {
        margin-top: 18px;
      }

      .workspace-migration {
        padding: 28px;
        max-width: 680px;
      }

      .workspace-empty {
        color: var(--color-text-muted);
        font-size: 15px;
        padding: 18px 0;
      }

      .workspace-document-page-panel {
        padding: 24px 28px;
      }

      .workspace-doc-body {
        max-width: 760px;
        color: var(--color-text);
        font-size: 15px;
        line-height: 1.65;
        overflow-wrap: anywhere;
      }

      .workspace-doc-body > *:first-child {
        margin-top: 0;
      }

      .workspace-doc-body > *:last-child {
        margin-bottom: 0;
      }

      .workspace-doc-body p {
        margin: 0 0 12px;
      }

      .workspace-doc-body h2,
      .workspace-doc-body h3,
      .workspace-doc-body h4 {
        margin: 22px 0 10px;
        line-height: 1.3;
        font-weight: 700;
        color: var(--color-text);
      }

      .workspace-doc-body h2 {
        font-size: 20px;
      }

      .workspace-doc-body h3 {
        font-size: 17px;
      }

      .workspace-doc-body h4 {
        font-size: 15px;
      }

      .workspace-doc-body ul,
      .workspace-doc-body ol {
        margin: 0 0 12px;
        padding-left: 22px;
      }

      .workspace-doc-body li {
        margin: 5px 0;
      }

      .workspace-doc-body code {
        font-family: "Monaco", "Courier New", monospace;
        font-size: 13px;
        background: var(--color-bg-subtle);
        border: 1px solid var(--color-border);
        border-radius: 4px;
        padding: 1px 5px;
      }

      .workspace-doc-body pre {
        margin: 0 0 12px;
        padding: 12px 14px;
        overflow-x: auto;
        background: var(--color-bg-subtle);
        border: 1px solid var(--color-border);
        border-radius: var(--radius-small);
      }

      .workspace-doc-body pre code {
        padding: 0;
        border: none;
        background: transparent;
      }

      .workspace-doc-body blockquote {
        margin: 0 0 12px;
        padding: 6px 0 6px 14px;
        border-left: 3px solid var(--color-border);
        color: var(--color-text-muted);
      }

      .workspace-doc-body a {
        color: var(--color-brand-text);
      }

      .workspace-doc-body .chat-table-scroll {
        max-width: 100%;
        margin: 0 0 12px;
        overflow-x: auto;
        scrollbar-width: thin;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-small);
        background: var(--color-bg-card);
      }

      .workspace-doc-body table {
        width: max-content;
        min-width: 100%;
        border-collapse: collapse;
        font-size: 13px;
        line-height: 1.4;
      }

      .workspace-doc-body th,
      .workspace-doc-body td {
        padding: 8px 11px;
        border-bottom: 1px solid var(--color-border);
        text-align: left;
        vertical-align: top;
      }

      .workspace-doc-body th {
        background: var(--color-bg-subtle);
        color: var(--color-text);
        font-weight: 700;
        white-space: nowrap;
      }

      .workspace-doc-body tr:last-child td {
        border-bottom: 0;
      }

      .workspace-doc-body-empty {
        color: var(--color-text-muted);
        font-size: 14px;
      }

      .team-page {
        display: grid;
        gap: 16px;
      }

      .workspace-access-page .team-page {
        max-width: 980px;
      }

      .workspace-analytics-page {
        max-width: 1180px;
      }

      .workspace-analytics-filters {
        display: grid;
        grid-template-columns: repeat(6, minmax(120px, 1fr)) auto;
        gap: 10px;
        align-items: end;
        margin: 0 0 16px;
        padding: 14px;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-small);
        background: var(--color-bg-card);
      }

      .workspace-analytics-filters label {
        display: grid;
        gap: 5px;
        color: var(--color-text-muted);
        font-size: 13px;
        font-weight: 700;
      }

      .workspace-analytics-filters input,
      .workspace-analytics-filters select {
        width: 100%;
        min-height: 38px;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-small);
        background: var(--color-bg);
        color: var(--color-text);
        font: inherit;
      }

      .workspace-analytics-content {
        display: grid;
        gap: 16px;
      }

      .workspace-analytics-kpis {
        margin: 0;
      }

      .workspace-analytics-grid {
        margin: 0;
      }

      .workspace-analytics-days {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
        gap: 10px;
        min-height: 180px;
        align-items: end;
      }

      .workspace-analytics-day {
        display: grid;
        grid-template-rows: 120px auto auto auto;
        gap: 5px;
        min-width: 0;
      }

      .workspace-analytics-day-bar {
        align-self: end;
        width: 100%;
        height: var(--bar-height, 8%);
        min-height: 8px;
        border-radius: var(--radius-xs) var(--radius-xs) 0 0;
        background: var(--color-forest);
      }

      .workspace-analytics-day-date {
        color: var(--color-text);
        font-size: 12px;
        font-weight: 800;
        line-height: 1.25;
      }

      .workspace-analytics-day-meta {
        color: var(--color-text-muted);
        font-size: 12px;
        line-height: 1.25;
      }

      .workspace-analytics-impact {
        display: grid;
        gap: 10px;
      }

      .workspace-analytics-impact-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 10px 0;
        border-bottom: 1px solid var(--color-border);
      }

      .workspace-analytics-impact-row:last-child {
        border-bottom: 0;
      }

      .workspace-analytics-impact-row span {
        color: var(--color-text-muted);
        font-size: 14px;
      }

      .workspace-analytics-impact-row strong {
        color: var(--color-text);
        font-size: 15px;
        text-align: right;
      }

      .workspace-analytics-table td,
      .workspace-analytics-table th {
        white-space: nowrap;
      }

      .workspace-analytics-table td:first-child,
      .workspace-analytics-table th:first-child {
        min-width: 220px;
        white-space: normal;
      }

      .workspace-analytics-member-detail h3 {
        margin: 0 0 10px;
        color: var(--color-text);
        font-size: 15px;
        line-height: 1.35;
      }

      .workspace-analytics-detail-grid,
      .workspace-analytics-methodology-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
      }

      .workspace-analytics-methodology-grid div {
        display: grid;
        gap: 5px;
        padding: 12px;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-small);
        background: var(--color-bg);
      }

      .workspace-analytics-methodology-grid strong {
        color: var(--color-text);
        font-size: 14px;
      }

      .workspace-analytics-methodology-grid span {
        color: var(--color-text-muted);
        font-size: 13px;
        line-height: 1.5;
      }

      .team-section {
        background: var(--color-bg-card);
        border: 1px solid var(--color-border);
        border-radius: var(--radius-small);
        padding: 18px;
      }

      .team-section-head {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
        margin-bottom: 14px;
      }

      .team-section-head h2 {
        margin: 0;
        color: var(--color-text);
        font-size: 17px;
        line-height: 1.35;
      }

      .team-section-note {
        margin: 4px 0 0;
        color: var(--color-text-muted);
        font-size: 14px;
        line-height: 1.5;
      }

      .team-billing-summary {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
        margin-bottom: 14px;
      }

      .team-billing-item {
        min-width: 0;
        padding: 12px;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-small);
        background: var(--color-bg);
      }

      .team-billing-label {
        color: var(--color-text-muted);
        font-size: 13px;
        line-height: 1.35;
      }

      .team-billing-value {
        margin-top: 4px;
        color: var(--color-text);
        font-size: 16px;
        font-weight: 800;
        line-height: 1.25;
        overflow-wrap: anywhere;
      }

      .team-billing-footnote {
        margin: -2px 0 12px;
        color: var(--color-text-muted);
        font-size: 13px;
        line-height: 1.45;
      }

      .billing-accesses {
        margin: 0 0 22px;
        padding: 14px;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-medium);
        background: var(--color-bg);
      }

      .billing-accesses__head {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
        margin-bottom: 12px;
      }

      .billing-accesses__head h3 {
        margin: 0;
        color: var(--color-text);
        font-size: 17px;
        line-height: 1.35;
      }

      .billing-accesses__head p,
      .billing-accesses__empty {
        margin: 4px 0 0;
        color: var(--color-text-muted);
        font-size: 14px;
        line-height: 1.45;
      }

      .billing-accesses__list {
        display: grid;
        gap: 10px;
      }

      .billing-access-card {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 12px;
        align-items: center;
        padding: 12px;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-small);
        background: var(--color-bg-card);
      }

      .billing-access-card__main {
        min-width: 0;
      }

      .billing-access-card__title {
        color: var(--color-text);
        font-size: 15px;
        font-weight: 800;
        line-height: 1.35;
        overflow-wrap: anywhere;
      }

      .billing-access-card__meta,
      .billing-access-card__hint {
        margin-top: 3px;
        color: var(--color-text-muted);
        font-size: 13px;
        line-height: 1.45;
        overflow-wrap: anywhere;
      }

      .billing-access-card__hint {
        color: var(--color-text-hint);
      }

      .team-form {
        display: grid;
        gap: 14px;
      }

      .team-field {
        display: grid;
        gap: 6px;
        margin: 0;
        color: var(--color-text-muted);
        font-size: var(--text-sm);
        font-weight: 700;
      }

      .team-field input {
        border: 1px solid var(--color-border);
        border-radius: var(--radius-small);
        background: var(--color-bg-card);
        color: var(--color-text);
        font-size: var(--text-base);
        padding: 10px 12px;
      }

      .team-access-block {
        display: grid;
        gap: 10px;
      }

      .team-access-head {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        align-items: flex-start;
        padding-top: 2px;
      }

      .team-access-title {
        color: var(--color-text);
        font-size: 15px;
        font-weight: 700;
      }

      .team-access-note {
        color: var(--color-text-muted);
        font-size: 14px;
        line-height: 1.45;
        text-align: right;
      }

      .team-project-access {
        display: grid;
        gap: 10px;
      }

      .team-project-row {
        display: grid;
        gap: 9px;
        padding: 12px;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-small);
        background: var(--color-bg);
      }

      .team-project-row.is-selected {
        border-color: rgba(0, 200, 83, 0.28);
        background: rgba(0, 200, 83, 0.045);
      }

      .team-project-row__top {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
      }

      .team-project-row__main {
        display: flex;
        align-items: center;
        gap: 10px;
        min-width: 0;
      }

      .team-project-row__main input {
        width: 16px;
        height: 16px;
        flex-shrink: 0;
      }

      .team-project-row select {
        width: min(220px, 100%);
        border: 1px solid var(--color-border);
        border-radius: var(--radius-small);
        background: var(--color-bg-card);
        color: var(--color-text);
        font-size: var(--text-base);
        padding: 9px 11px;
      }

      .team-project-row select:disabled {
        opacity: 0.55;
      }

      .team-project-row:not(.is-selected) select {
        display: none;
      }

      .team-tool-policy {
        display: grid;
        gap: 8px;
        padding-left: 26px;
      }

      .team-tool-policy__preset,
      .team-tool-policy__group {
        display: grid;
        gap: 5px;
        color: var(--color-text-muted);
        font-size: 12px;
        font-weight: 700;
      }

      .team-tool-policy__preset {
        max-width: 260px;
      }

      .team-tool-policy__groups {
        display: grid;
        grid-template-columns: repeat(4, minmax(120px, 1fr));
        gap: 8px;
      }

      .team-tool-policy.hidden,
      .team-tool-policy__groups.hidden {
        display: none;
      }

      .team-project-row__text {
        min-width: 0;
      }

      .team-project-row__title,
      .team-member-email {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      .team-member-actions {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
      }

      .team-member-row {
        display: grid;
        gap: 9px;
        padding: 12px 0;
        border-bottom: 1px solid var(--color-border);
      }

      .team-member-row:last-child {
        border-bottom: 0;
      }

      .team-member-main {
        min-width: 0;
      }

      .team-member-access-list {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        margin-top: 8px;
      }

      .team-access-chip {
        display: inline-flex;
        align-items: center;
        min-height: 28px;
        padding: 4px 8px;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-inline);
        background: var(--color-bg);
        color: var(--color-text-muted);
        font-size: 13px;
        font-weight: 600;
        max-width: 100%;
      }

      .team-access-chip span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      .team-email-warning {
        margin-top: 7px;
        color: var(--color-error);
        font-size: 13px;
        font-weight: 700;
      }

      .team-member-billing {
        margin-top: 7px;
        color: var(--color-text-muted);
        font-size: 13px;
        font-weight: 700;
      }

      .team-form-actions {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
      }

      @media (max-width: 980px) {
        .workspace-kpi-grid {
          grid-template-columns: repeat(3, minmax(0, 1fr));
        }
        .workspace-grid {
          grid-template-columns: 1fr;
        }
        .workspace-analytics-filters {
          grid-template-columns: repeat(3, minmax(0, 1fr));
        }
        .workspace-analytics-detail-grid,
        .workspace-analytics-methodology-grid {
          grid-template-columns: 1fr;
        }
      }

      @media (max-width: 640px) {
        .workspace-topbar,
        .workspace-list-row {
          grid-template-columns: 1fr;
          display: grid;
        }
        .workspace-project-actions {
          justify-content: flex-start;
        }
        .workspace-detail-footer-actions {
          justify-content: flex-start;
        }
        .workspace-panel-head {
          display: grid;
          grid-template-columns: 1fr;
        }
        .workspace-panel-head .workspace-actions {
          justify-content: flex-start;
          width: 100%;
        }
        .workspace-memory-actions {
          justify-content: flex-start;
        }
        .workspace-memory-actions .btn {
          width: 100%;
        }
        .workspace-provider-link-form {
          align-items: stretch;
        }
        .workspace-kpi-grid,
        .workspace-form-grid {
          grid-template-columns: 1fr;
        }
        .workspace-analytics-filters {
          grid-template-columns: 1fr;
        }
        .workspace-analytics-days {
          grid-template-columns: repeat(2, minmax(0, 1fr));
        }
        .workspace-actions {
          width: 100%;
        }
        .team-section-head,
        .team-access-head {
          display: grid;
        }
        .team-access-note {
          text-align: left;
        }
        .team-project-row__top {
          display: grid;
        }
        .team-tool-policy {
          padding-left: 0;
        }
        .team-tool-policy__groups {
          grid-template-columns: 1fr;
        }
        .team-billing-summary {
          grid-template-columns: 1fr;
        }
        .billing-accesses__head,
        .billing-access-card {
          grid-template-columns: 1fr;
          display: grid;
        }
        .billing-access-card .btn {
          width: 100%;
        }
      }

      .site-panel,
      .site-scenario,
      .site-capability,
      .site-action-card {
        background: var(--color-bg-card);
        border: 1px solid var(--color-border);
        border-radius: var(--radius-medium);
      }

      .lidfly-back-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        padding: 0;
        margin-bottom: 12px;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-pill);
        background: var(--color-bg-card);
        color: var(--color-text);
        cursor: pointer;
        transition: background 0.2s, border-color 0.2s, transform 0.1s;
        -webkit-tap-highlight-color: transparent;
      }
      .lidfly-back-btn:hover {
        background: var(--color-bg-dark);
        border-color: var(--color-text-muted);
      }
      .lidfly-back-btn:active {
        transform: translateY(1px);
      }
      .lidfly-back-btn svg {
        width: 20px;
        height: 20px;
      }

      .site-management-header {
        display: grid;
        gap: 18px;
        padding: 24px;
        background: var(--color-bg-card);
        border: 1px solid var(--color-border);
        border-radius: var(--radius-medium);
        margin-bottom: 18px;
      }

      .site-management-header__top {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 24px;
        align-items: start;
      }

      .site-management-back-row {
        display: flex;
        align-items: center;
        gap: 10px;
        flex-wrap: wrap;
        margin-bottom: 14px;
      }

      .site-management-kicker {
        margin: 0 0 4px;
        color: var(--color-text-muted);
        font-size: 13px;
        font-weight: 700;
        text-transform: uppercase;
      }

      .site-management-primary {
        min-width: 0;
      }

      .site-management-title {
        margin: 4px 0 6px;
        font-size: var(--text-4xl);
        line-height: 1.15;
        color: var(--color-text);
        word-break: break-word;
      }

      .site-management-meta {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
        color: var(--color-text-muted);
        font-size: 14px;
      }

      .site-management-actions,
      .site-table-actions {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 8px;
        flex-wrap: wrap;
      }

      .site-management-header .site-management-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: stretch;
        width: min(520px, 100%);
      }

      .site-management-header .site-management-actions .btn {
        width: 100%;
        min-height: 44px;
        justify-content: center;
      }

      .site-tabs-section {
        margin-bottom: 24px;
      }

      .site-tabs {
        display: flex;
        align-items: flex-end;
        flex-wrap: wrap;
        gap: 2px 4px;
        padding: 8px 10px 0;
        border: 1px solid color-mix(in srgb, var(--color-brand-text) 16%, var(--color-border));
        border-bottom-color: color-mix(in srgb, var(--color-brand-text) 24%, var(--color-border));
        border-radius: 14px 14px 0 0;
        background:
          linear-gradient(135deg, rgba(0, 200, 83, 0.075), rgba(38, 166, 154, 0.055) 44%, rgba(255, 255, 255, 0.72)),
          var(--color-bg-subtle);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76);
        overflow-x: auto;
        scrollbar-width: thin;
      }

      .site-tabs-more {
        position: relative;
        display: none;
        margin-bottom: -1px;
      }

      .site-tab,
      .site-tabs-more-button {
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 42px;
        padding: 0 14px;
        margin-bottom: -1px;
        border: 1px solid transparent;
        border-bottom: 0;
        border-radius: 10px 10px 0 0;
        color: var(--color-text-muted);
        font-size: 14px;
        font-weight: 750;
        line-height: 1;
        text-decoration: none;
        white-space: nowrap;
        transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
        -webkit-tap-highlight-color: transparent;
      }

      .site-tabs-more-button {
        gap: 6px;
        font-family: inherit;
        cursor: pointer;
      }

      .site-tabs-more-button svg {
        flex: 0 0 auto;
        transition: transform 0.16s ease;
      }

      .site-tab::after,
      .site-tabs-more-button::after {
        content: "";
        position: absolute;
        left: 12px;
        right: 12px;
        bottom: 0;
        height: 3px;
        border-radius: 999px 999px 0 0;
        background: transparent;
      }

      .site-tab:hover,
      .site-tabs-more-button:hover {
        color: var(--color-text);
        background: rgba(255, 255, 255, 0.58);
        border-color: color-mix(in srgb, var(--color-brand-text) 12%, transparent);
      }

      .site-tab:focus-visible,
      .site-tabs-more-button:focus-visible,
      .site-tabs-menu-item:focus-visible {
        outline: 2px solid color-mix(in srgb, var(--color-brand) 58%, white);
        outline-offset: -2px;
      }

      .site-tab.is-active,
      .site-tabs-more.is-active .site-tabs-more-button {
        color: var(--color-text);
        background: rgba(255, 255, 255, 0.92);
        border-color: color-mix(in srgb, var(--color-brand-text) 22%, var(--color-border));
        box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.96), 0 10px 22px rgba(15, 56, 21, 0.06);
      }

      .site-tab.is-active::after,
      .site-tabs-more.is-active .site-tabs-more-button::after {
        background: linear-gradient(90deg, var(--color-brand), var(--color-brand-light));
      }

      .site-tabs-more.is-open .site-tabs-more-button svg {
        transform: rotate(180deg);
      }

      .site-tabs-menu {
        position: absolute;
        top: calc(100% + 8px);
        right: 0;
        z-index: 30;
        min-width: 190px;
        padding: 8px;
        border: 1px solid color-mix(in srgb, var(--color-brand-text) 16%, var(--color-border));
        border-radius: var(--radius-element);
        background: rgba(255, 255, 255, 0.98);
        box-shadow: 0 18px 44px rgba(15, 56, 21, 0.16);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-4px);
        transition: opacity 0.14s ease, transform 0.14s ease, visibility 0.14s ease;
      }

      .site-tabs-more.is-open .site-tabs-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
      }

      .site-tabs-menu-item {
        display: flex;
        align-items: center;
        min-height: 40px;
        padding: 0 12px;
        border-radius: var(--radius-small);
        color: var(--color-text-muted);
        font-size: 14px;
        font-weight: 750;
        text-decoration: none;
        white-space: nowrap;
      }

      .site-tabs-menu-item:hover,
      .site-tabs-menu-item.is-active {
        background: color-mix(in srgb, var(--color-brand) 10%, white);
        color: var(--color-text);
      }

      .site-management-stats {
        display: grid;
        grid-template-columns: repeat(4, minmax(130px, 1fr));
        gap: 0;
        padding-top: 16px;
        border-top: 1px solid var(--color-border);
      }

      .site-management-stat {
        min-width: 0;
        padding: 2px 18px;
      }

      .site-management-stat:first-child {
        padding-left: 0;
      }

      .site-management-stat + .site-management-stat {
        border-left: 1px solid var(--color-border);
      }

      .site-management-stat strong {
        display: block;
        color: var(--color-text);
        font-size: 18px;
        margin-bottom: 2px;
      }

      .site-management-stat span {
        color: var(--color-text-muted);
        font-size: 13px;
      }

      .site-next-step-card {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 18px;
        align-items: center;
        padding: 20px;
        border: 1px solid rgba(0, 200, 83, .24);
        border-radius: var(--radius-medium);
        background: rgba(0, 200, 83, .06);
      }

      .site-next-step-card h2 {
        margin: 4px 0 6px;
        font-size: 22px;
      }

      .site-next-step-card p {
        margin: 0;
        max-width: 760px;
        color: var(--color-text-secondary);
        font-size: 15px;
        line-height: 1.6;
      }

      .site-next-step-actions {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
        justify-content: flex-end;
      }

      .site-ai-choice-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
        margin: 16px 0;
      }

      .site-ai-choice-card {
        display: grid;
        gap: 8px;
        padding: 18px;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-small);
        background: var(--color-bg);
      }

      .site-ai-choice-card h3 {
        margin: 0;
        color: var(--color-text);
        font-size: 17px;
      }

      .site-ai-choice-card p {
        margin: 0;
        color: var(--color-text-muted);
        font-size: 14px;
        line-height: 1.55;
      }

      .site-mcp-manual {
        margin-top: 12px;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-small);
        background: var(--color-bg-card);
        overflow: hidden;
      }

      .site-mcp-manual summary {
        cursor: pointer;
        padding: 14px 16px;
        color: var(--color-text);
        font-size: 15px;
        font-weight: 700;
        list-style: none;
      }

      .site-mcp-manual summary::-webkit-details-marker {
        display: none;
      }

      .site-mcp-manual__body {
        padding: 0 16px 16px;
      }

      .site-mcp-steps {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
        margin: 14px 0;
      }

      .site-mcp-step {
        min-width: 0;
        padding: 12px;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-small);
        background: var(--color-bg);
      }

      .site-mcp-step strong,
      .site-mcp-step span {
        display: block;
      }

      .site-mcp-step strong {
        margin-bottom: 6px;
        color: var(--color-text);
        font-size: 14px;
      }

      .site-mcp-step span {
        color: var(--color-text-muted);
        font-size: 13px;
        line-height: 1.45;
      }

      .site-mcp-config-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
      }

      .site-mcp-config-title {
        margin-bottom: 6px;
        color: var(--color-text);
        font-size: 14px;
        font-weight: 700;
      }

      .site-empty-state {
        padding: 28px;
        border: 1px dashed var(--color-border);
        border-radius: var(--radius-medium);
        background: var(--color-bg);
        text-align: center;
      }

      .site-empty-state h3 {
        margin: 0 0 8px;
        color: var(--color-text);
        font-size: 20px;
      }

      .site-empty-state p {
        margin: 0 auto 16px;
        max-width: 560px;
        color: var(--color-text-muted);
        font-size: 15px;
        line-height: 1.55;
      }

      /* Онбординг-витрина пустого состояния «Ваши сайты» */
      .site-hero {
        padding: 28px;
        border: 1px solid rgba(0, 200, 83, .24);
        border-radius: var(--radius-medium);
        background:
          radial-gradient(ellipse at 100% 0%, rgba(0, 200, 83, .10) 0%, transparent 55%),
          rgba(0, 200, 83, .05);
        margin-bottom: 22px;
      }

      .site-hero__title {
        margin: 4px 0 10px;
        max-width: 640px;
        font-size: 26px;
        line-height: 1.25;
        color: var(--color-text);
      }

      .site-hero__sub {
        margin: 0 0 18px;
        max-width: 620px;
        color: var(--color-text-secondary);
        font-size: 16px;
        line-height: 1.6;
      }

      .site-hero__sub code {
        padding: 1px 6px;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-small);
        background: var(--color-bg-card);
        color: var(--color-text);
        font-size: 14px;
      }

      .site-hero__price {
        display: flex;
        align-items: baseline;
        flex-wrap: wrap;
        gap: 4px 10px;
        margin-bottom: 18px;
        color: var(--color-text-muted);
        font-size: 15px;
      }

      .site-hero__price strong {
        color: var(--color-brand-700);
        font-size: 28px;
        font-weight: 800;
        line-height: 1;
      }

      .site-hero__note {
        margin: 12px 0 0;
        color: var(--color-text-muted);
        font-size: 14px;
        line-height: 1.5;
      }

      .site-includes-title {
        margin: 0 0 12px;
        color: var(--color-text);
        font-size: 17px;
      }

      .site-includes-grid {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 12px;
      }

      .site-include {
        display: flex;
        align-items: flex-start;
        gap: 12px;
        padding: 16px;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-small);
        background: var(--color-bg-card);
      }

      .site-include__icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        width: 38px;
        height: 38px;
        border-radius: var(--radius-small);
        background: rgba(0, 200, 83, .10);
        color: var(--color-brand-700);
      }

      .site-include__icon svg {
        width: 20px;
        height: 20px;
      }

      .site-include__text {
        display: flex;
        flex-direction: column;
        gap: 2px;
        min-width: 0;
      }

      .site-include__text strong {
        color: var(--color-text);
        font-size: 15px;
        font-weight: 700;
      }

      .site-include__text > span {
        color: var(--color-text-muted);
        font-size: 14px;
        line-height: 1.45;
      }

      .site-grid-2,
      .site-grid-3,
      .site-capability-grid,
      .site-action-grid {
        display: grid;
        gap: 12px;
      }

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

      .site-grid-3,
      .site-capability-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
      }

      .site-scenario {
        padding: 20px;
        min-height: 210px;
        display: flex;
        flex-direction: column;
        gap: 12px;
      }

      .site-scenario h3,
      .site-capability h3,
      .site-action-card h3 {
        margin: 0;
        font-size: 18px;
        color: var(--color-text);
      }

      .site-scenario p,
      .site-capability p,
      .site-action-card p {
        color: var(--color-text-muted);
        font-size: 15px;
        line-height: 1.55;
        margin: 0;
      }

      .site-scenario ul {
        margin: 0 0 0 18px;
        color: var(--color-text);
        font-size: 15px;
        line-height: 1.65;
      }

      .site-capability,
      .site-action-card,
      .site-panel {
        padding: 18px;
      }

      .site-capability {
        min-height: 132px;
      }

      .site-kicker {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 4px 10px;
        border-radius: var(--radius-pill);
        background: rgba(0,200,83,0.10);
        color: var(--color-brand);
        font-size: 13px;
        font-weight: 700;
        margin-bottom: 12px;
      }

      .site-status-pill {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 4px 9px;
        border-radius: var(--radius-pill);
        background: var(--color-bg);
        border: 1px solid var(--color-border);
        color: var(--color-text-muted);
        font-size: 13px;
        font-weight: 600;
        white-space: nowrap;
      }

      .site-status-pill.is-active {
        color: var(--color-brand);
        border-color: color-mix(in srgb, var(--color-brand) 24%, transparent);
        background: color-mix(in srgb, var(--color-brand) 8%, transparent);
      }

      .site-address-preview {
        display: inline-flex;
        align-items: center;
        min-height: 36px;
        padding: 8px 12px;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-small);
        background: var(--color-bg);
        color: var(--color-text-muted);
        font-size: 14px;
        word-break: break-all;
      }

      .site-pages-list {
        display: grid;
        gap: 10px;
      }

      .site-page-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 12px;
        align-items: center;
        padding: 14px;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-small);
        background: var(--color-bg-card);
      }

      .site-page-row__title {
        font-weight: 700;
        color: var(--color-text);
        margin-bottom: 3px;
      }

      .site-page-row__meta {
        color: var(--color-text-muted);
        font-size: 14px;
        line-height: 1.45;
        word-break: break-word;
      }

      .site-next-panel {
        display: grid;
        gap: 14px;
        padding: 18px;
        border: 1px solid rgba(0, 200, 83, .24);
        border-radius: var(--radius-medium);
        background: rgba(0, 200, 83, .06);
      }

      .site-next-panel h3 {
        margin: 0;
        font-size: 18px;
        color: var(--color-text);
      }

      .site-next-panel p {
        margin: 0;
        color: var(--color-text-muted);
        font-size: 15px;
        line-height: 1.55;
      }

      .site-next-actions {
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
      }

      .site-mini-note {
        color: var(--color-text-muted);
        font-size: 14px;
        line-height: 1.55;
      }

      .site-settings-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 16px;
        align-items: start;
      }

      .site-favicon-layout {
        display: grid;
        grid-template-columns: 112px minmax(0, 1fr);
        gap: 18px;
        align-items: start;
      }

      .site-favicon-preview {
        width: 96px;
        height: 96px;
        display: grid;
        place-items: center;
        overflow: hidden;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-small);
        background: var(--color-bg);
        color: var(--color-text);
        font-size: 24px;
        font-weight: 800;
        line-height: 1;
      }

      .site-favicon-preview img {
        width: 64px;
        height: 64px;
        object-fit: contain;
        display: block;
      }

      .site-favicon-controls {
        min-width: 0;
        display: grid;
        gap: 12px;
      }

      .site-access-form {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px;
        align-items: end;
      }

      .site-access-form input {
        width: 100%;
        min-width: 0;
      }

      .site-access-role {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin-top: 10px;
      }

      .site-access-role-option {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        gap: 8px;
        align-items: start;
        min-width: 0;
        padding: 10px 12px;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-small);
        background: var(--color-bg);
        cursor: pointer;
      }

      .site-access-role-option:has(input:checked) {
        border-color: var(--color-brand);
        background: rgba(0, 200, 83, 0.08);
      }

      .site-access-role-option span {
        display: grid;
        gap: 2px;
        min-width: 0;
      }

      .site-access-role-option strong {
        color: var(--color-text);
        font-size: 14px;
      }

      .site-access-role-option small {
        color: var(--color-text-muted);
        font-size: 12px;
        line-height: 1.35;
      }

      .site-access-list {
        display: grid;
        gap: 10px;
        margin-top: 14px;
      }

      .site-access-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px;
        align-items: center;
        padding: 10px 0;
        border-top: 1px solid var(--color-border);
      }

      .site-access-email {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        color: var(--color-text);
        font-weight: 700;
      }

      .site-access-meta {
        color: var(--color-text-muted);
        font-size: 13px;
        line-height: 1.45;
      }

      .site-product-form {
        display: grid;
        grid-template-columns: minmax(160px, 1.3fr) minmax(120px, 0.6fr) minmax(96px, 0.45fr);
        gap: 10px;
        align-items: end;
        margin-bottom: 14px;
      }

      .site-product-form textarea {
        width: 100%;
        min-height: 76px;
        padding: 12px 14px;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-small);
        background: var(--color-bg-card);
        color: var(--color-text);
        font: inherit;
        resize: vertical;
      }

      .site-table-wrap {
        overflow-x: auto;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-small);
      }

      .site-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 15px;
      }

      .site-table th,
      .site-table td {
        padding: 10px 12px;
        border-bottom: 1px solid var(--color-border);
        text-align: left;
        vertical-align: top;
      }

      .site-table th {
        color: var(--color-text-muted);
        font-weight: 600;
        background: var(--color-bg);
      }

      .site-table tr:last-child td {
        border-bottom: none;
      }

      .site-ai-guide {
        display: grid;
        grid-template-columns: minmax(0, 1.15fr) minmax(240px, .85fr);
        gap: 14px;
        align-items: stretch;
      }

      .site-ai-guide__box {
        padding: 16px;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-small);
        background: var(--color-bg);
      }

      .site-ai-guide__box h3 {
        margin: 0 0 8px;
        font-size: 16px;
      }

      .site-ai-guide__box p,
      .site-ai-guide__box li {
        color: var(--color-text-muted);
        font-size: 14px;
        line-height: 1.55;
      }

      .site-ai-guide__box ul {
        margin: 8px 0 0 18px;
      }

      .site-prompt-list {
        display: grid;
        gap: 8px;
      }

      .site-prompt-chip {
        border: 1px solid var(--color-border);
        border-radius: var(--radius-small);
        background: var(--color-bg-card);
        padding: 10px 12px;
        color: var(--color-text);
        font-size: 14px;
        line-height: 1.45;
        text-align: left;
        cursor: pointer;
      }

      .site-design-template-field {
        display: grid;
        gap: 10px;
        margin: 16px 0;
      }

      .site-design-template-field__head {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        align-items: flex-start;
      }

      .site-design-template-label {
        display: block;
        color: var(--color-text);
        font-size: 14px;
        font-weight: 700;
        margin-bottom: 4px;
      }

      .site-design-template-field p {
        margin: 0;
        color: var(--color-text-muted);
        font-size: 14px;
        line-height: 1.45;
      }

      .site-design-template-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 10px;
      }

      .site-design-template-card {
        appearance: none;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-small);
        background: var(--color-bg-card);
        color: var(--color-text);
        padding: 12px;
        text-align: left;
        cursor: pointer;
        min-height: 92px;
      }

      .site-design-template-card strong,
      .site-design-template-card span {
        display: block;
      }

      .site-design-template-card strong {
        font-size: 15px;
        margin-bottom: 5px;
      }

      .site-design-template-card span {
        color: var(--color-text-muted);
        font-size: 13px;
        line-height: 1.4;
      }

      .site-design-template-card.is-selected {
        border-color: var(--color-brand);
        box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-brand) 16%, transparent);
      }

      .site-design-template-state {
        color: var(--color-text-muted);
        font-size: 14px;
      }

      .site-products-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 12px;
      }

      .site-product-card {
        border: 1px solid var(--color-border);
        border-radius: var(--radius-small);
        background: var(--color-bg-card);
        overflow: hidden;
      }

      .site-product-card__image {
        height: 150px;
        background: var(--color-bg);
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
      }

      .site-product-card__image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
      }

      .site-product-card__body {
        padding: 14px;
      }

      .site-product-card__title {
        font-weight: 700;
        font-size: 16px;
        color: var(--color-text);
        margin-bottom: 4px;
      }

      .site-product-card__meta {
        color: var(--color-text-muted);
        font-size: 14px;
        line-height: 1.45;
      }

      .site-product-card__actions {
        display: flex;
        gap: 8px;
        margin-top: 12px;
        flex-wrap: wrap;
      }

      .site-product-editor {
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid var(--color-border);
      }

      .site-product-editor-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        margin-bottom: 10px;
      }

      @media (max-width: 900px) {
        .site-grid-2,
        .site-grid-3,
        .site-capability-grid,
        .site-includes-grid,
        .site-ai-choice-grid,
        .site-ai-guide,
        .site-mcp-steps,
        .site-mcp-config-grid,
        .site-product-editor-grid,
        .site-favicon-layout,
        .site-settings-grid,
        .site-access-role,
        .site-product-form {
          grid-template-columns: 1fr;
        }

        .site-management-header__top,
        .site-next-step-card,
        .site-management-stats,
        .site-page-row {
          grid-template-columns: 1fr;
        }

        .site-management-actions,
        .site-table-actions,
        .site-next-step-actions {
          justify-content: flex-start;
        }

        .site-management-header .site-management-actions {
          width: 100%;
        }

        .site-management-stat {
          padding: 10px 0;
        }

        .site-management-stat + .site-management-stat {
          border-left: none;
          border-top: 1px solid var(--color-border);
        }
      }

      @media (max-width: 560px) {
        .site-tabs {
          flex-wrap: wrap;
          padding: 7px 8px 0;
          overflow-x: visible;
        }

        .site-tab,
        .site-tabs-more-button {
          min-height: 40px;
          padding: 0 12px;
          font-size: 13px;
        }

        .site-tab--overflow {
          display: none;
        }

        .site-tabs-more {
          display: inline-flex;
        }

        .site-tabs-menu-item {
          font-size: 13px;
        }

        .site-management-header .site-management-actions {
          grid-template-columns: 1fr;
        }

        .site-access-form,
        .site-access-row {
          grid-template-columns: 1fr;
        }
      }

      /* --- Code block --- */
      .code-block {
        background: var(--color-bg-code);
        border: 1px solid var(--color-border-code);
        border-radius: var(--radius-element);
        padding: 16px;
        font-family: "Monaco", "Courier New", monospace;
        font-size: var(--text-sm);
        line-height: 1.6;
        color: var(--color-text-code);
        overflow-x: auto;
        white-space: pre;
        margin-bottom: 8px;
      }

      .lifehack-tip {
        background: var(--color-tip-bg);
        border: 1px solid var(--color-tip-border);
        border-radius: var(--radius-small);
        padding: 10px 14px;
        font-size: 15px;
        line-height: 1.5;
        color: var(--color-tip-text);
        margin-bottom: 10px;
      }

      .lifehack-tip strong {
        color: var(--color-brand);
      }

      .lifehack-tip a {
        color: var(--color-brand);
        text-decoration: underline;
      }

      /* --- Status --- */
      .status {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 4px 12px;
        border-radius: var(--radius-xs);
        font-size: var(--text-base);
        font-weight: 500;
      }

      .status-ok {
        background: rgba(22, 163, 74, 0.08);
        color: var(--color-success);
      }

      .status-missing {
        background: rgba(217, 119, 6, 0.08);
        color: var(--color-warning);
      }

      .status-trial {
        background: rgba(0, 200, 83, 0.08);
        color: var(--color-brand);
      }

      .status-dot {
        width: 6px;
        height: 6px;
        border-radius: 50%;
      }

      .status-ok .status-dot {
        background: var(--color-success);
      }
      .status-missing .status-dot {
        background: var(--color-warning);
      }
      .status-trial .status-dot {
        background: var(--color-brand);
      }

      /* --- Messages --- */
      .msg {
        padding: 12px;
        border-radius: var(--radius-small);
        margin-top: 12px;
        font-size: var(--text-md);
      }

      .msg-error {
        background: rgba(220, 38, 38, 0.06);
        color: var(--color-error);
        border: 1px solid rgba(220, 38, 38, 0.15);
      }

      .msg-info {
        background: rgba(0,200,83, 0.06);
        color: var(--color-brand);
        border: 1px solid rgba(0,200,83, 0.15);
      }

      .msg-success {
        background: rgba(22, 163, 74, 0.06);
        color: var(--color-success);
        border: 1px solid rgba(22, 163, 74, 0.15);
      }

      .msg-warning {
        background: rgba(234, 179, 8, 0.06);
        color: var(--color-warning);
        border: 1px solid rgba(234, 179, 8, 0.18);
      }

      /* --- Global subscription banner (shown on all sections) --- */
      .global-sub-banner {
        display: flex;
        align-items: center;
        gap: 16px;
        padding: 16px 20px;
        margin: 0 0 20px;
        background: rgba(220, 38, 38, 0.08);
        border: 1px solid rgba(220, 38, 38, 0.2);
        border-left: 4px solid var(--color-error);
        border-radius: var(--radius-card);
        color: var(--color-text);
      }
      .global-sub-banner__icon {
        font-size: 24px;
        line-height: 1;
        flex-shrink: 0;
      }
      .global-sub-banner__body {
        flex: 1;
        min-width: 0;
      }
      .global-sub-banner__title {
        font-weight: 600;
        font-size: 16px;
        margin-bottom: 2px;
      }
      .global-sub-banner__text {
        font-size: 15px;
        color: var(--color-text-muted);
      }
      @media (max-width: 640px) {
        .global-sub-banner {
          flex-wrap: wrap;
          padding: 14px 16px;
        }
        .global-sub-banner__body {
          flex-basis: calc(100% - 40px);
        }
      }

      /* --- Token info --- */
      .info-box {
        background: rgba(0,200,83, 0.04);
        border-left: 3px solid var(--color-brand);
        padding: 14px 16px;
        border-radius: 0 var(--radius-small) var(--radius-small) 0;
        font-size: var(--text-base);
        color: var(--color-text-muted);
        line-height: 1.6;
        margin-bottom: 16px;
      }

      .info-box a {
        color: var(--color-brand);
        text-decoration: none;
      }

      .info-box code {
        background: rgba(0,200,83, 0.08);
        padding: 2px 6px;
        border-radius: var(--radius-inline);
        font-size: var(--text-sm);
        color: var(--color-brand-hover);
      }

      .info-box ol {
        margin: 8px 0 0 18px;
      }

      .info-box li {
        margin: 4px 0;
        font-size: 16px;
        color: var(--color-text);
      }

      .yandex-manual-connect {
        margin-top: 16px;
      }

      .yandex-manual-connect__title {
        color: var(--color-text);
        font-size: 15px;
        font-weight: 700;
        margin: 0 0 4px;
      }

      .yandex-manual-connect__hint {
        color: var(--color-text-muted);
        font-size: 14px;
        line-height: 1.5;
        margin: 0 0 12px;
      }

      .yandex-manual-token-link {
        display: block;
        text-align: center;
        text-decoration: none;
        margin-bottom: 16px;
      }

      .yandex-course-callout {
        margin-bottom: 28px;
        padding: 14px 18px;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-element);
        background: var(--color-bg-card);
        color: var(--color-text-muted);
        font-size: 15px;
        line-height: 1.6;
      }

      .yandex-course-callout a,
      .yandex-pricing-note a {
        color: var(--color-brand);
        text-decoration: none;
        border-bottom: 1px dashed var(--color-brand);
      }

      .yandex-connect-alert {
        margin: 0 0 24px;
        padding: 16px 18px;
        border: 1px solid color-mix(in srgb, var(--color-error) 24%, transparent);
        border-left: 4px solid var(--color-error);
        border-radius: var(--radius-element);
        background: color-mix(in srgb, var(--color-error) 7%, var(--color-bg-card));
        color: var(--color-text);
      }

      .yandex-connect-alert__title {
        margin: 0 0 6px;
        color: var(--color-error);
        font-size: 16px;
        font-weight: 700;
      }

      .yandex-connect-alert p {
        margin: 0 0 10px;
        color: var(--color-text-muted);
        font-size: 15px;
        line-height: 1.5;
      }

      .yandex-connect-alert a {
        color: var(--color-brand);
        font-size: 15px;
        font-weight: 600;
        text-decoration: none;
        border-bottom: 1px dashed var(--color-brand);
      }

      .yandex-accounts-panel {
        margin-top: 18px;
        padding: 16px;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-element);
        background: var(--color-bg);
      }

      .yandex-accounts-head {
        display: flex;
        flex-direction: column;
        gap: 4px;
        margin-bottom: 12px;
      }

      .yandex-accounts-title {
        color: var(--color-text);
        font-size: 16px;
        font-weight: 700;
      }

      .yandex-accounts-hint {
        color: var(--color-text-muted);
        font-size: 14px;
        line-height: 1.5;
        margin: 0;
      }

      .yandex-account-row {
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
        align-items: center;
        padding: 12px;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-small);
        background: var(--color-bg-card);
        margin-bottom: 8px;
      }

      .yandex-account-row > div:first-child {
        flex: 1 1 280px;
        min-width: min(280px, 100%);
      }

      .yandex-account-name {
        color: var(--color-text);
        font-size: 15px;
        font-weight: 700;
        overflow-wrap: anywhere;
      }

      .yandex-account-meta {
        color: var(--color-text-muted);
        font-size: 13px;
        margin-top: 2px;
        line-height: 1.45;
      }

      .yandex-account-actions {
        display: flex;
        flex: 0 1 auto;
        max-width: 100%;
        gap: 8px;
        flex-wrap: wrap;
        justify-content: flex-end;
      }

      .yandex-add-connection-panel {
        margin-top: 18px;
        padding: 16px;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-element);
        background: var(--color-bg-card);
      }

      .yandex-add-connection-title {
        color: var(--color-text);
        font-size: 16px;
        font-weight: 700;
        margin-bottom: 4px;
      }

      .yandex-pricing-note {
        margin: 12px 0 14px;
        color: var(--color-text-muted);
        font-size: 14px;
        line-height: 1.55;
      }

      .yandex-pricing-note__list {
        margin: 0 0 8px;
        padding-left: 18px;
      }

      .yandex-pricing-note__list li + li {
        margin-top: 4px;
      }

      .yandex-account-form {
        display: grid;
        grid-template-columns: minmax(180px, 1fr) minmax(160px, 1fr) auto;
        gap: 8px;
        margin-top: 12px;
        align-items: end;
      }

      .yandex-account-form input {
        margin-bottom: 0;
      }

      @media (max-width: 768px) {
        .yandex-account-form {
          grid-template-columns: 1fr;
        }

        .yandex-account-actions {
          width: 100%;
          justify-content: flex-start;
        }
      }

      /* --- Yandex multi-client module --- */
      .yandex-multi-toggle {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        margin-top: 14px;
        padding: 8px 0;
        background: none;
        border: none;
        cursor: pointer;
        color: var(--color-danger);
        font-size: 15px;
        font-weight: 600;
      }

      .yandex-multi-toggle svg {
        transition: transform 0.15s ease;
      }

      .yandex-multi-toggle.is-open svg {
        transform: rotate(90deg);
      }

      .yandex-multi {
        margin-top: 4px;
        padding-top: 16px;
        border-top: 1px solid var(--color-border);
      }

      .yandex-router-q {
        font-weight: 700;
        font-size: 15px;
        color: var(--color-text);
        margin-bottom: 10px;
      }

      .yandex-router-opt {
        display: flex;
        gap: 10px;
        align-items: flex-start;
        padding: 12px;
        margin-bottom: 8px;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-small);
        background: var(--color-bg-card);
        cursor: pointer;
        transition: border-color 0.15s ease, background 0.15s ease;
      }

      .yandex-router-opt:hover {
        border-color: var(--color-danger);
      }

      .yandex-router-opt input {
        margin-top: 3px;
        flex-shrink: 0;
        accent-color: var(--color-danger);
      }

      .yandex-router-opt b {
        color: var(--color-text);
        font-size: 15px;
      }

      .yandex-router-opt .muted {
        color: var(--color-text-muted);
        font-size: 14px;
        line-height: 1.5;
      }

      .yandex-branch {
        margin-top: 14px;
      }

      .yandex-why {
        margin-top: 10px;
        font-size: 14px;
        color: var(--color-text-muted);
      }

      .yandex-why summary {
        cursor: pointer;
        color: var(--color-danger);
        font-weight: 500;
      }

      .yandex-why p {
        margin: 8px 0 0;
        line-height: 1.5;
      }

      .yandex-upsell {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
        flex-wrap: wrap;
        margin-top: 14px;
        padding: 14px 16px;
        background: rgba(124, 58, 237, 0.06);
        border: 1px solid rgba(124, 58, 237, 0.2);
        border-radius: var(--radius-element);
      }

      .yandex-upsell-text {
        flex: 1;
        min-width: 220px;
        font-size: 14px;
        color: var(--color-text);
        line-height: 1.5;
      }

      .yandex-article-link {
        display: inline-block;
        margin-top: 16px;
        color: var(--color-danger);
        font-size: 14px;
        font-weight: 500;
        text-decoration: none;
        border-bottom: 1px dashed var(--color-danger);
      }

      /* --- VK Ads account settings --- */
      .vk-connected-note {
        margin: 0 0 14px;
        padding: 12px 14px;
        border: 1px solid color-mix(in srgb, var(--color-success) 22%, var(--color-border));
        border-radius: var(--radius-small);
        background: color-mix(in srgb, var(--color-success) 7%, var(--color-bg-card));
        color: var(--color-text);
        font-size: 15px;
        line-height: 1.55;
      }

      .vk-cabinet-panel {
        margin-bottom: 18px;
        padding: 16px;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-medium);
        background: var(--color-bg);
      }

      .vk-cabinet-panel--primary {
        border-color: color-mix(in srgb, var(--color-success) 24%, var(--color-border));
        background: color-mix(in srgb, var(--color-success) 3%, var(--color-bg));
      }

      .vk-cabinet-panel--secondary {
        background: color-mix(in srgb, var(--color-bg-card) 72%, var(--color-bg));
      }

      .vk-cabinet-head {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
        margin-bottom: 14px;
      }

      .vk-cabinet-head .btn {
        min-width: 148px;
        white-space: nowrap;
      }

      .vk-cabinet-actions {
        display: flex;
        justify-content: flex-start;
        margin: 10px 0 14px;
      }

      .vk-cabinet-actions .btn {
        min-width: 0;
        max-width: 100%;
        margin-top: 0;
        white-space: normal;
        line-height: 1.25;
      }

      .vk-connect-methods {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
        gap: 12px;
        margin-bottom: 12px;
      }

      .vk-connect-method,
      .vk-manual-token-form--inline {
        padding: 14px;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-small);
        background: var(--color-bg-card);
      }

      .vk-connect-method h3 {
        margin: 0 0 6px;
        color: var(--color-text);
        font-size: 16px;
        font-weight: 700;
      }

      .vk-connect-method p,
      .vk-manual-token-form p {
        margin: 0 0 12px;
        color: var(--color-text-muted);
        font-size: 14px;
        line-height: 1.55;
      }

      .vk-manual-token-form--inline {
        margin: 2px 0 14px;
      }

      .vk-manual-token-form--inline strong {
        display: block;
        margin-bottom: 4px;
        color: var(--color-text);
        font-size: 15px;
      }

      .vk-manual-token-input {
        width: 100%;
        min-height: 74px;
        resize: vertical;
        padding: 10px 12px;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-small);
        background: var(--color-bg);
        color: var(--color-text);
        font-family: "Monaco", "Courier New", monospace;
        font-size: 13px;
        line-height: 1.45;
      }

      .vk-manual-token-note {
        margin-top: 8px;
        color: var(--color-text-hint);
        font-size: 13px;
        line-height: 1.45;
      }

      .vk-manual-token-msg {
        margin-top: 8px;
      }

      .vk-cabinet-title {
        margin: 0 0 4px;
        color: var(--color-text);
        font-size: 17px;
        font-weight: 700;
      }

      .vk-cabinet-hint {
        margin: 0;
        color: var(--color-text-muted);
        font-size: 14px;
        line-height: 1.5;
      }

      .vk-summary-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 8px;
        margin-bottom: 10px;
      }

      .vk-summary-card {
        padding: 10px 12px;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-small);
        background: var(--color-bg-card);
        min-width: 0;
      }

      .vk-summary-card--current {
        grid-column: 1 / -1;
        padding: 14px 16px;
        border-color: color-mix(in srgb, var(--color-success) 32%, var(--color-border));
        background: color-mix(in srgb, var(--color-success) 7%, var(--color-bg-card));
      }

      .vk-summary-card--wide {
        grid-column: 1 / -1;
      }

      .vk-summary-label {
        display: block;
        margin-bottom: 3px;
        color: var(--color-text-hint);
        font-size: 13px;
        line-height: 1.35;
      }

      .vk-summary-value {
        display: block;
        color: var(--color-text);
        font-size: 15px;
        line-height: 1.45;
        overflow-wrap: anywhere;
      }

      .vk-summary-card--current .vk-summary-value {
        font-size: 18px;
      }

      .vk-summary-desc {
        display: block;
        margin-top: 5px;
        color: var(--color-text-muted);
        font-size: 14px;
        line-height: 1.45;
      }

      .vk-empty-state {
        margin-top: 10px;
        padding: 14px 16px;
        border: 1px dashed var(--color-border);
        border-radius: var(--radius-small);
        background: var(--color-bg-card);
        color: var(--color-text-muted);
        font-size: 15px;
        line-height: 1.55;
      }

      .vk-account-list {
        margin-top: 12px;
      }

      #vk-accounts-tbody,
      #vk-connections-list {
        display: flex;
        flex-direction: column;
        gap: 10px;
      }

      .vk-account-card {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 14px;
        padding: 14px;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-small);
        background: var(--color-bg-card);
      }

      .vk-account-card.is-default {
        border-color: color-mix(in srgb, var(--color-success) 42%, var(--color-border));
        background: color-mix(in srgb, var(--color-success) 5%, var(--color-bg-card));
      }

      .vk-cabinet-panel--secondary .vk-account-card.is-default {
        border-color: color-mix(in srgb, var(--color-border) 84%, var(--color-success));
        background: var(--color-bg-card);
      }

      .vk-account-card.is-muted {
        opacity: 0.74;
      }

      .vk-account-main {
        min-width: 0;
      }

      .vk-account-title-row {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 10px;
        margin-bottom: 4px;
      }

      .vk-account-name {
        color: var(--color-text);
        font-size: 15px;
        font-weight: 700;
        overflow-wrap: anywhere;
      }

      .vk-account-kicker {
        margin-bottom: 2px;
        color: var(--color-text-hint);
        font-size: 12px;
        font-weight: 700;
        line-height: 1.35;
      }

      .vk-account-meta {
        color: var(--color-text-muted);
        font-size: 13px;
        line-height: 1.45;
        overflow-wrap: anywhere;
      }

      .vk-account-badges {
        display: flex;
        gap: 6px;
        flex-wrap: wrap;
        margin-top: 8px;
      }

      .vk-account-badge {
        display: inline-flex;
        align-items: center;
        min-height: 24px;
        padding: 3px 8px;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-inline);
        background: var(--color-bg);
        color: var(--color-text-muted);
        font-size: 12px;
        font-weight: 600;
        line-height: 1.25;
        white-space: nowrap;
      }

      .vk-account-badge--default {
        border-color: color-mix(in srgb, var(--color-success) 38%, var(--color-border));
        background: color-mix(in srgb, var(--color-success) 9%, var(--color-bg-card));
        color: var(--color-success);
      }

      .vk-account-details {
        margin-top: 10px;
        color: var(--color-text-muted);
        font-size: 13px;
        line-height: 1.45;
      }

      .vk-account-details summary {
        width: max-content;
        max-width: 100%;
        cursor: pointer;
        color: var(--color-text-muted);
        font-weight: 600;
      }

      .vk-account-details div {
        margin-top: 6px;
        overflow-wrap: anywhere;
      }

      .vk-account-workspace {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        gap: 8px;
        margin-top: 10px;
        color: var(--color-text-muted);
        font-size: 13px;
        line-height: 1.45;
      }

      .vk-account-workspace a {
        color: var(--color-brand);
        text-decoration: none;
        border-bottom: 1px dashed var(--color-brand);
      }

      .vk-account-error {
        margin-top: 8px;
        color: var(--color-error);
        font-size: 13px;
        line-height: 1.45;
        overflow-wrap: anywhere;
      }

      .vk-account-actions {
        display: flex;
        align-items: flex-start;
        justify-content: flex-end;
        gap: 8px;
        flex-wrap: wrap;
        max-width: 260px;
      }

      .vk-user-id-panel {
        margin-top: 14px;
        padding: 14px;
        border: 1px solid color-mix(in srgb, var(--color-success) 22%, var(--color-border));
        border-radius: var(--radius-small);
        background: color-mix(in srgb, var(--color-success) 4%, var(--color-bg-card));
      }

      .vk-user-id-copy {
        color: var(--color-text-muted);
        font-size: 14px;
        line-height: 1.55;
      }

      .vk-user-id-copy strong {
        display: block;
        margin-bottom: 4px;
        color: var(--color-text);
        font-size: 15px;
      }

      .vk-user-id-copy p {
        margin: 0 0 8px;
      }

      .vk-user-id-form {
        display: grid;
        grid-template-columns: minmax(150px, 1fr) minmax(180px, 1fr) auto;
        gap: 10px;
        align-items: end;
        margin-top: 10px;
      }

      .vk-user-id-form label {
        display: block;
        margin-bottom: 6px;
        color: var(--color-text-muted);
        font-size: 13px;
        font-weight: 600;
      }

      .vk-user-id-form input {
        width: 100%;
        min-width: 0;
        height: 44px;
      }

      .vk-user-id-submit {
        align-self: end;
      }

      .vk-workspace-note {
        margin-top: 12px;
        color: var(--color-text-muted);
        font-size: 14px;
        line-height: 1.55;
      }

      .vk-danger-zone {
        margin-top: 16px;
        color: var(--color-text-muted);
        font-size: 14px;
      }

      .vk-danger-zone summary {
        width: max-content;
        max-width: 100%;
        cursor: pointer;
        color: var(--color-error);
        font-weight: 600;
      }

      .vk-danger-zone__body {
        margin-top: 10px;
        padding: 12px;
        border: 1px solid color-mix(in srgb, var(--color-error) 22%, var(--color-border));
        border-radius: var(--radius-small);
        background: color-mix(in srgb, var(--color-error) 4%, var(--color-bg-card));
      }

      .vk-danger-zone__body p {
        margin: 0 0 10px;
        line-height: 1.5;
      }

      .vk-external-ai-setup {
        margin-top: 24px;
      }

      @media (max-width: 768px) {
        .vk-cabinet-head {
          flex-direction: column;
        }

        .vk-cabinet-head .btn {
          width: 100%;
        }

        .vk-account-card {
          grid-template-columns: 1fr;
        }

        .vk-account-title-row {
          flex-direction: column;
        }

        .vk-account-actions {
          justify-content: stretch;
          max-width: none;
        }

        .vk-account-actions .btn {
          flex: 1 1 180px;
          min-width: 0;
        }

        .vk-user-id-form {
          grid-template-columns: 1fr;
        }

        .vk-account-workspace {
          grid-template-columns: 1fr;
          gap: 2px;
        }
      }

      .flash-highlight {
        animation: flashHighlight 2.2s ease;
      }

      @keyframes flashHighlight {
        0%, 100% { box-shadow: 0 0 0 0 rgba(124, 58, 237, 0); }
        15%, 60% { box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.35); }
      }

      /* --- Toast --- */
      .toast {
        position: fixed;
        bottom: 32px;
        right: 32px;
        background: var(--color-brand);
        color: white;
        padding: 14px 22px;
        border-radius: 12px;
        box-shadow: 0 8px 32px rgba(0,200,83, 0.25);
        font-weight: 500;
        font-size: 15px;
        opacity: 0;
        transform: translateY(20px);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        pointer-events: none;
        z-index: 1000;
      }

      .toast.show {
        opacity: 1;
        transform: translateY(0);
      }

      .toast.error {
        background: var(--color-danger);
        box-shadow: 0 8px 32px color-mix(in srgb, var(--color-danger) 25%, transparent);
      }

      /* --- Confirm modal --- */
      .modal-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.3);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 100;
      }
      .modal-overlay.hidden {
        display: none;
      }
      .modal-box {
        background: var(--color-bg-card);
        border: 1px solid var(--color-border);
        border-radius: var(--radius-card);
        padding: 32px;
        width: 100%;
        max-width: 420px;
        box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
      }
      .modal-box h3 {
        font-size: var(--text-2xl);
        color: var(--color-text);
        margin-bottom: 12px;
      }
      .modal-box p {
        font-size: var(--text-md);
        color: var(--color-text-muted);
        line-height: 1.6;
        margin-bottom: 20px;
      }
      .modal-actions {
        display: flex;
        gap: 8px;
      }
      .modal-actions .btn {
        flex: 1;
      }
      .hidden {
        display: none !important;
      }

      /* --- Prompt rows (agency section) --- */
      .prompt-row {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 10px 14px;
        background: var(--color-bg);
        border: 1px solid var(--color-border);
        border-radius: var(--radius-small);
        transition: border-color 0.2s;
      }
      .prompt-row:hover {
        border-color: rgba(0,200,83, 0.3);
      }
      .prompt-text {
        flex: 1;
        font-size: var(--text-base);
        color: var(--color-text-secondary);
        line-height: 1.4;
      }
      .prompt-copy {
        flex-shrink: 0;
        background: none;
        border: none;
        color: var(--color-brand);
        font-size: var(--text-sm);
        font-weight: 600;
        cursor: pointer;
        padding: 4px 8px;
        border-radius: var(--radius-inline);
        transition: background 0.15s;
        white-space: nowrap;
      }
      .prompt-copy:hover {
        background: rgba(0,200,83, 0.08);
      }

      /* --- Collapsible sections --- */
      details.collapsible {
        border: 1px solid var(--color-border);
        border-radius: 12px;
        overflow: hidden;
      }

      details.collapsible summary {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px 20px;
        cursor: pointer;
        list-style: none;
        background: var(--color-bg-subtle);
        transition: background 0.2s;
        user-select: none;
      }

      details.collapsible summary::-webkit-details-marker {
        display: none;
      }

      details.collapsible summary:hover {
        background: var(--color-bg);
      }

      details.collapsible summary h2 {
        margin: 0;
        font-size: 18px;
      }

      details.collapsible summary .summary-hint {
        font-size: var(--text-base);
        color: var(--color-text-hint);
        font-weight: 400;
      }

      details.collapsible summary .chevron {
        transition: transform 0.25s ease;
        color: var(--color-text-hint);
        flex-shrink: 0;
      }

      details.collapsible[open] summary .chevron {
        transform: rotate(180deg);
      }

      details.collapsible .collapsible-body {
        padding: 20px;
        border-top: 1px solid var(--color-border);
      }

      /* --- Back link --- */
      .back-link {
        display: inline-block;
        color: var(--color-brand);
        text-decoration: none;
        font-size: 15px;
        margin-bottom: 24px;
      }

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

      /* --- Task styles --- */
      .tasks-tabs {
        display: flex;
        gap: 4px;
        margin-bottom: 24px;
        background: var(--color-bg-card);
        border: 1px solid var(--color-border);
        border-radius: 12px;
        padding: 4px;
      }

      .tasks-tab {
        flex: 1;
        padding: 10px 16px;
        border: none;
        background: none;
        border-radius: var(--radius-small);
        font-size: var(--text-md);
        font-weight: 500;
        color: var(--color-text-muted);
        cursor: pointer;
        transition: all 0.2s;
      }

      .tasks-tab:hover {
        background: var(--color-bg);
      }

      .tasks-tab.active {
        background: var(--color-brand);
        color: white;
      }

      .tasks-tab .tasks-tab-badge {
        display: inline-block;
        background: rgba(255, 255, 255, 0.3);
        padding: 1px 7px;
        border-radius: var(--radius-element);
        font-size: var(--text-sm);
        margin-left: 6px;
      }

      .tasks-tab:not(.active) .tasks-tab-badge {
        background: rgba(0,200,83, 0.1);
        color: var(--color-brand);
      }

      .task-card {
        background: var(--color-bg-card);
        border: 1px solid var(--color-border);
        border-radius: 12px;
        padding: 20px;
        margin-bottom: 12px;
        transition: border-color 0.2s;
      }

      .task-card:hover {
        border-color: rgba(0,200,83, 0.3);
      }

      .task-card.overdue {
        border-left: 3px solid var(--color-error);
      }
      .task-card.due-soon {
        border-left: 3px solid var(--color-warning);
      }
      .task-card.future {
        border-left: 3px solid var(--color-success);
      }
      .task-card.completed {
        border-left: 3px solid var(--color-text-hint);
        opacity: 0.7;
      }

      .task-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 12px;
        margin-bottom: 8px;
      }

      .task-title {
        font-size: var(--text-xl);
        font-weight: 600;
        color: var(--color-text);
      }

      .task-due {
        flex-shrink: 0;
        font-size: var(--text-base);
        font-weight: 500;
        padding: 3px 10px;
        border-radius: var(--radius-xs);
        white-space: nowrap;
      }

      .task-due.overdue {
        background: rgba(220, 38, 38, 0.08);
        color: var(--color-error);
      }
      .task-due.today {
        background: rgba(217, 119, 6, 0.08);
        color: var(--color-warning);
      }
      .task-due.future-due {
        background: rgba(22, 163, 74, 0.08);
        color: var(--color-success);
      }
      .task-due.done {
        background: rgba(107, 112, 128, 0.08);
        color: var(--color-text-muted);
      }

      .provider-badge {
        display: inline-flex;
        align-items: center;
        height: 36px;
      }
      .provider-badge img {
        height: 36px;
        width: auto;
        display: block;
      }
      .task-card .provider-badge {
        margin-bottom: 8px;
      }
      .task-meta-info {
        font-size: 15.6px;
        color: var(--color-text);
        font-weight: 500;
        margin-bottom: 12px;
      }
      .task-meta-info span + span::before {
        content: " \00b7  ";
      }

      .filter-bar {
        display: flex;
        gap: 8px;
        margin-bottom: 16px;
        align-items: center;
      }
      .filter-bar label {
        font-size: var(--text-base);
        color: var(--color-text-muted);
        font-weight: 500;
      }
      .filter-bar select {
        padding: 6px 12px;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-small);
        font-size: var(--text-base);
        background: var(--color-bg-card);
        color: var(--color-text);
        cursor: pointer;
      }

      .task-description {
        font-size: var(--text-md);
        color: var(--color-text-secondary);
        line-height: 1.5;
        margin-bottom: 12px;
      }

      .task-prompt-block {
        margin-bottom: 16px;
      }

      .task-prompt-toggle {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        background: none;
        border: none;
        color: var(--color-brand);
        font-size: var(--text-base);
        font-weight: 600;
        cursor: pointer;
        padding: 4px 0;
      }

      .task-prompt-toggle:hover {
        text-decoration: underline;
      }

      .task-prompt-toggle .arrow {
        transition: transform 0.2s;
        font-size: 15px;
      }

      .task-prompt-toggle.open .arrow {
        transform: rotate(90deg);
      }

      .task-prompt-content {
        display: none;
        margin-top: 8px;
        padding: 14px 16px;
        background: var(--color-bg-code);
        border-radius: var(--radius-element);
        font-family: "Monaco", "Courier New", monospace;
        font-size: var(--text-base);
        line-height: 1.6;
        color: var(--color-text-code);
        white-space: pre-wrap;
        word-break: break-word;
        position: relative;
      }

      .task-prompt-content.visible {
        display: block;
      }

      .task-prompt-copy-btn {
        position: absolute;
        top: 8px;
        right: 8px;
        background: rgba(0,200,83, 0.2);
        border: none;
        color: var(--color-brand-light);
        padding: 6px 12px;
        border-radius: var(--radius-xs);
        font-size: var(--text-sm);
        font-weight: 600;
        cursor: pointer;
        transition: background 0.2s;
      }

      .task-prompt-copy-btn:hover {
        background: rgba(0,200,83, 0.4);
      }

      .task-actions {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
      }

      .task-btn {
        padding: 8px 16px;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-small);
        font-size: var(--text-base);
        font-weight: 500;
        cursor: pointer;
        background: var(--color-bg-card);
        color: var(--color-text);
        transition: all 0.2s;
      }

      .task-btn:hover {
        border-color: rgba(0,200,83, 0.3);
        background: var(--color-bg-subtle);
      }

      .task-btn.primary {
        background: var(--color-forest);
        color: white;
        border-color: var(--color-forest);
      }
      .task-btn.primary:hover {
        background: var(--color-brand-hover);
      }

      .task-btn.danger {
        color: var(--color-error);
        border-color: rgba(220, 38, 38, 0.2);
      }
      .task-btn.danger:hover {
        background: rgba(220, 38, 38, 0.06);
      }

      .tasks-empty {
        text-align: center;
        padding: 60px 20px;
        color: var(--color-text-muted);
      }

      .tasks-empty .icon {
        font-size: 48px;
        margin-bottom: 16px;
        opacity: 0.5;
      }

      .tasks-empty p {
        font-size: 15px;
        line-height: 1.6;
      }

      .tasks-loading {
        text-align: center;
        padding: 40px;
        color: var(--color-text-muted);
      }

      .tasks-panel.hidden {
        display: none;
      }

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

      .scheduled-ai-filters {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
      }

      .scheduled-ai-card {
        background: var(--color-bg-card);
        border: 1px solid var(--color-border);
        border-radius: var(--radius-element);
        padding: 18px;
        margin-bottom: 12px;
      }

      .scheduled-ai-card__head {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 12px;
        align-items: start;
        margin-bottom: 10px;
      }

      .scheduled-ai-title {
        font-size: var(--text-lg);
        font-weight: 700;
        color: var(--color-text);
        overflow-wrap: anywhere;
      }

      .scheduled-ai-meta {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
        font-size: var(--text-base);
        color: var(--color-text-muted);
        margin-bottom: 10px;
      }

      .scheduled-ai-status {
        display: inline-flex;
        align-items: center;
        padding: 3px 9px;
        border-radius: var(--radius-inline);
        background: var(--color-bg-subtle);
        color: var(--color-text-muted);
        font-size: var(--text-sm);
        font-weight: 700;
        white-space: nowrap;
      }

      .scheduled-ai-status.active,
      .scheduled-ai-status.completed {
        background: rgba(0, 200, 83, 0.08);
        color: var(--color-brand);
      }

      .scheduled-ai-status.failed,
      .scheduled-ai-status.blocked_insufficient_balance,
      .scheduled-ai-status.blocked_cost_limit {
        background: var(--color-bg-subtle);
        color: var(--color-error);
      }

      .scheduled-ai-plan {
        font-size: var(--text-md);
        color: var(--color-text-secondary);
        line-height: 1.5;
        margin-bottom: 12px;
        white-space: pre-wrap;
        overflow-wrap: anywhere;
      }

      .scheduled-ai-log {
        display: grid;
        gap: 6px;
        margin-top: 10px;
      }

      .scheduled-ai-log-row {
        display: grid;
        grid-template-columns: minmax(130px, auto) minmax(0, 1fr);
        gap: 10px;
        font-size: var(--text-base);
        color: var(--color-text-muted);
      }

      .scheduled-ai-actions {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
      }

      .chat-shell {
        display: grid;
        grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
        gap: 16px;
        flex: 1 1 auto;
        min-height: 0;
      }
      .chat-section {
        display: flex;
        flex-direction: column;
        height: calc(var(--app-visual-height, 100dvh) - (var(--dashboard-padding-y) * 2));
        max-width: none;
        margin: 0;
        min-height: 0;
      }
      .chat-section > .section-title {
        flex: 0 0 auto;
      }
      .chat-topbar {
        flex: 0 0 auto;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        margin-bottom: 16px;
      }
      .chat-topbar .section-title {
        margin: 0;
      }
      .chat-settings-link {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        min-height: 38px;
        padding: 8px 11px;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-small);
        background: var(--color-bg-card);
        color: var(--color-text);
        font-size: 14px;
        font-weight: 650;
        text-decoration: none;
        white-space: nowrap;
        transition:
          border-color 0.18s,
          box-shadow 0.18s,
          color 0.18s;
      }
      .chat-settings-link:hover {
        border-color: rgba(0, 200, 83, 0.3);
        color: var(--color-forest);
        box-shadow: 0 0 0 3px rgba(0, 200, 83, 0.08);
      }
      .chat-settings-link svg {
        width: 17px;
        height: 17px;
        flex: 0 0 auto;
      }
      .chat-billing-banner {
        position: relative;
        flex: 0 0 auto;
        padding: 9px 12px;
        border-bottom: 1px solid rgba(217, 119, 6, 0.22);
        background: #fffbeb;
      }
      .chat-billing-link {
        display: inline-flex;
        align-items: center;
        gap: 7px;
        min-height: 28px;
        padding: 0;
        border: none;
        background: transparent;
        color: #92400e;
        font: inherit;
        font-size: 13px;
        font-weight: 700;
        line-height: 1.25;
        text-align: left;
        text-decoration: underline;
        text-underline-offset: 3px;
        cursor: pointer;
      }
      .chat-billing-link:hover {
        color: #78350f;
      }
      .chat-billing-link svg {
        width: 16px;
        height: 16px;
        flex: 0 0 auto;
      }
      .chat-billing-dialog {
        position: absolute;
        top: calc(100% + 6px);
        left: 12px;
        z-index: 90;
        width: min(620px, calc(100% - 24px));
        max-height: min(520px, 70vh);
        overflow-y: auto;
        border: 1px solid rgba(217, 119, 6, 0.28);
        border-radius: var(--radius-element);
        background: var(--color-bg-card);
        box-shadow: 0 18px 44px rgba(0, 0, 0, 0.16);
      }
      .chat-billing-dialog-head {
        position: sticky;
        top: 0;
        z-index: 1;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 13px 14px;
        border-bottom: 1px solid var(--color-border);
        background: rgba(255, 255, 255, 0.96);
      }
      .chat-billing-dialog-head h2 {
        margin: 0;
        color: var(--color-text);
        font-size: 16px;
        line-height: 1.25;
      }
      .chat-billing-close {
        width: 32px;
        height: 32px;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-small);
        background: var(--color-bg-card);
        color: var(--color-text-muted);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        flex: 0 0 auto;
      }
      .chat-billing-close:hover {
        color: var(--color-forest);
        border-color: rgba(0, 200, 83, 0.3);
        background: rgba(0, 200, 83, 0.08);
      }
      .chat-billing-close svg {
        width: 17px;
        height: 17px;
      }
      .chat-billing-dialog-body {
        display: grid;
        gap: 10px;
        padding: 14px;
        color: var(--color-text-secondary);
        font-size: 14px;
        line-height: 1.5;
      }
      .chat-billing-dialog-body p {
        margin: 0;
      }
      .chat-billing-dialog-body ul {
        margin: 0;
        padding-left: 18px;
      }
      .chat-billing-dialog-body li {
        margin: 5px 0;
      }
      .chat-billing-dialog-body strong {
        color: var(--color-text);
      }
      .chat-billing-dialog-body a {
        color: var(--color-forest);
        font-weight: 700;
      }
      .chat-list-mobile-header,
      .chat-mobile-header {
        display: none;
      }
      .chat-mobile-icon-btn {
        width: 40px;
        height: 40px;
        border: 1px solid var(--color-border);
        border-radius: 999px;
        background: var(--color-bg-card);
        color: var(--color-text);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
      }
      .chat-mobile-icon-btn svg {
        width: 20px;
        height: 20px;
      }
      .chat-sidebar,
      .chat-panel {
        border: 1px solid var(--color-border);
        background: var(--color-bg-card);
        border-radius: var(--radius-element);
        min-height: 0;
      }
      .chat-sidebar {
        display: flex;
        flex-direction: column;
        padding: 12px;
        overflow: hidden;
      }
      .chat-list {
        flex: 1 1 auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
        gap: 6px;
        overflow-y: auto;
        margin-top: 12px;
      }
      .chat-list-item {
        position: relative;
        display: grid;
        grid-template-columns: minmax(0, 1fr) 32px;
        align-items: center;
        gap: 6px;
        width: 100%;
        border: 1px solid transparent;
        background: transparent;
        color: var(--color-text);
        text-align: left;
        font: inherit;
        font-size: var(--text-md);
        line-height: 1.3;
        padding: 9px 10px;
        border-radius: var(--radius-small);
        cursor: pointer;
      }
      .chat-list-item-main {
        min-width: 0;
      }
      .chat-list-item-title {
        display: block;
        overflow: hidden;
        color: inherit;
        font-weight: inherit;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
      .chat-list-item-meta {
        display: block;
        margin-top: 3px;
        overflow: hidden;
        color: var(--color-text-muted);
        font-size: 12px;
        font-weight: 400;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
      .chat-list-menu-btn {
        width: 28px;
        height: 28px;
        border: 1px solid transparent;
        border-radius: var(--radius-small);
        background: transparent;
        color: var(--color-text-muted);
        cursor: pointer;
        font-size: 18px;
        line-height: 1;
      }
      .chat-list-menu-btn:hover,
      .chat-list-menu-btn.active {
        border-color: var(--color-border);
        background: var(--color-bg-card);
        color: var(--color-text);
      }
      .chat-list-menu {
        position: absolute;
        right: 8px;
        top: 40px;
        z-index: 20;
        width: min(320px, calc(100vw - 32px));
        padding: 8px;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-small);
        background: var(--color-bg-card);
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
      }
      .chat-list-menu-id {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: center;
        gap: 6px;
        padding: 6px 8px 8px;
        border-bottom: 1px solid var(--color-border);
        color: var(--color-text-muted);
        font-size: 12px;
      }
      .chat-list-menu-id-label {
        color: var(--color-text-muted);
        font-weight: 600;
      }
      .chat-list-menu-id code {
        display: block;
        overflow: hidden;
        color: var(--color-text);
        font-family: "Monaco", "Courier New", monospace;
        font-size: 11px;
        font-weight: 400;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
      .chat-list-menu-copy,
      .chat-list-menu-action {
        border: none;
        background: transparent;
        color: var(--color-forest);
        cursor: pointer;
        font: inherit;
        font-size: 13px;
        font-weight: 600;
      }
      .chat-list-menu-copy {
        width: 34px;
        height: 34px;
        border-radius: var(--radius-small);
        display: inline-flex;
        align-items: center;
        justify-content: center;
      }
      .chat-list-menu-copy:hover {
        background: rgba(0, 200, 83, 0.08);
      }
      .chat-list-menu-copy svg {
        width: 18px;
        height: 18px;
      }
      .chat-list-menu-action {
        display: block;
        width: 100%;
        margin-top: 6px;
        padding: 8px;
        border-radius: var(--radius-small);
        color: var(--color-text);
        text-align: left;
      }
      .chat-list-menu-action:hover {
        background: var(--color-bg-subtle);
      }
      .chat-list-item:hover {
        background: var(--color-bg-subtle);
      }
      .chat-list-item.active {
        background: rgba(0, 200, 83, 0.08);
        border-color: rgba(0, 200, 83, 0.2);
        color: var(--color-forest);
        font-weight: 600;
      }
      .chat-panel {
        display: flex;
        flex-direction: column;
        height: 100%;
        min-height: 0;
        overflow: hidden;
      }
      .chat-settings-view {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-element);
        background: var(--color-bg-card);
      }
      .chat-settings-view.hidden {
        display: none;
      }
      .chat-settings-head {
        position: sticky;
        top: 0;
        z-index: 2;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 14px 16px;
        border-bottom: 1px solid var(--color-border);
        background: rgba(255, 255, 255, 0.94);
        backdrop-filter: blur(14px);
      }
      .chat-settings-title {
        display: flex;
        align-items: center;
        gap: 10px;
        min-width: 0;
        color: var(--color-text);
        font-size: 17px;
        font-weight: 750;
        line-height: 1.2;
      }
      .chat-settings-title svg {
        width: 19px;
        height: 19px;
        color: var(--color-forest);
        flex: 0 0 auto;
      }
      .chat-settings-close {
        width: 36px;
        height: 36px;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-small);
        background: var(--color-bg-card);
        color: var(--color-text-muted);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
      }
      .chat-settings-close:hover {
        color: var(--color-forest);
        border-color: rgba(0, 200, 83, 0.3);
        background: rgba(0, 200, 83, 0.08);
      }
      .chat-settings-close svg {
        width: 18px;
        height: 18px;
      }
      .chat-settings-body {
        display: grid;
        gap: 14px;
        max-width: 980px;
        padding: 16px;
      }
      .chat-rules-list {
        display: grid;
        gap: 9px;
      }
      .chat-rule-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 36px;
        gap: 8px;
        align-items: start;
      }
      .chat-rule-input {
        width: 100%;
        min-height: 46px;
        max-height: 140px;
        padding: 11px 12px;
        resize: vertical;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-small);
        background: var(--color-bg);
        color: var(--color-text);
        font: inherit;
        font-size: 15px;
        line-height: 1.42;
      }
      .chat-rule-input:focus {
        outline: none;
        border-color: rgba(0, 200, 83, 0.42);
        box-shadow: 0 0 0 3px rgba(0, 200, 83, 0.09);
      }
      .chat-settings-over-limit .chat-rule-input {
        border-color: rgba(220, 38, 38, 0.52);
        background: rgba(220, 38, 38, 0.04);
      }
      .chat-settings-over-limit .chat-rule-input:focus {
        border-color: rgba(220, 38, 38, 0.72);
        box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
      }
      .chat-rule-delete,
      .chat-rule-add {
        border: 1px solid var(--color-border);
        border-radius: var(--radius-small);
        background: var(--color-bg-card);
        color: var(--color-text);
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        transition:
          border-color 0.18s,
          background 0.18s,
          color 0.18s;
      }
      .chat-rule-delete {
        width: 36px;
        height: 46px;
        color: var(--color-text-muted);
      }
      .chat-rule-delete:hover {
        color: var(--color-error);
        border-color: rgba(220, 38, 38, 0.28);
        background: rgba(220, 38, 38, 0.07);
      }
      .chat-rule-add {
        width: 100%;
        min-height: 44px;
        gap: 8px;
        color: var(--color-forest);
        font: inherit;
        font-size: 14px;
        font-weight: 700;
      }
      .chat-rule-add:hover {
        border-color: rgba(0, 200, 83, 0.3);
        background: rgba(0, 200, 83, 0.08);
      }
      .chat-rule-delete svg,
      .chat-rule-add svg {
        width: 17px;
        height: 17px;
      }
      .chat-rule-examples {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 9px;
      }
      .chat-rule-example {
        min-height: 68px;
        padding: 10px 11px;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-small);
        background: var(--color-bg-subtle);
        color: var(--color-text-secondary);
        font: inherit;
        font-size: 13px;
        line-height: 1.35;
        text-align: left;
        cursor: pointer;
      }
      .chat-rule-example:hover {
        color: var(--color-text);
        border-color: rgba(0, 200, 83, 0.26);
        background: rgba(0, 200, 83, 0.06);
      }
      .chat-settings-counter {
        justify-self: end;
        min-height: 18px;
        color: var(--color-text-muted);
        font-size: 13px;
        font-weight: 600;
      }
      .chat-settings-counter.over-limit {
        color: var(--color-error);
      }
      .chat-settings-save-state {
        min-height: 18px;
        color: var(--color-text-muted);
        font-size: 13px;
      }
      .chat-toolbar {
        flex: 0 0 auto;
        display: flex;
        gap: 10px;
        align-items: center;
        flex-wrap: wrap;
        padding: 12px;
        border-bottom: 1px solid var(--color-border);
        background: var(--color-bg-subtle);
      }
      .chat-toolbar > .chat-settings-link {
        display: none;
      }
      .chat-toolbar-field {
        display: flex;
        align-items: center;
        gap: 6px;
        margin: 0;
        min-width: 0;
      }
      .chat-toolbar select {
        padding: 7px 10px;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-small);
        background: var(--color-bg-card);
        color: var(--color-text);
        font-size: var(--text-md);
        max-width: 320px;
      }
	      #chat-target {
	        min-width: 260px;
	      }
	      .chat-target-native {
	        display: none !important;
	      }
	      .chat-search-select {
	        position: relative;
	        width: min(420px, 100%);
	        min-width: 260px;
	        font-size: var(--text-md);
	      }
	      .chat-search-select__button {
	        display: grid;
	        grid-template-columns: minmax(0, 1fr) auto;
	        align-items: center;
	        gap: 8px;
	        width: 100%;
	        min-height: 36px;
	        padding: 7px 10px;
	        border: 1px solid var(--color-border);
	        border-radius: var(--radius-small);
	        background: var(--color-bg-card);
	        color: var(--color-text);
	        font: inherit;
	        text-align: left;
	        cursor: pointer;
	      }
	      .chat-search-select__button:hover,
	      .chat-search-select.open .chat-search-select__button {
	        border-color: rgba(0, 200, 83, 0.3);
	        box-shadow: 0 0 0 3px rgba(0, 200, 83, 0.08);
	      }
	      .chat-search-select__button span {
	        min-width: 0;
	        overflow: hidden;
	        text-overflow: ellipsis;
	        white-space: nowrap;
	      }
	      .chat-search-select__button svg {
	        width: 16px;
	        height: 16px;
	        color: var(--color-text-muted);
	        transition: transform 0.16s;
	      }
	      .chat-search-select.open .chat-search-select__button svg {
	        transform: rotate(180deg);
	      }
	      .chat-search-select__panel {
	        position: absolute;
	        z-index: 60;
	        top: calc(100% + 6px);
	        left: 0;
	        display: none;
	        width: min(720px, calc(100vw - 32px));
	        max-width: max(100%, 720px);
	        overflow: hidden;
	        border: 1px solid var(--color-border);
	        border-radius: var(--radius-small);
	        background: var(--color-bg-card);
	        box-shadow: 0 18px 44px rgba(0, 0, 0, 0.16);
	      }
	      .chat-search-select.open .chat-search-select__panel {
	        display: block;
	      }
	      .chat-search-select__tools {
	        display: grid;
	        grid-template-columns: minmax(180px, 1fr) auto;
	        gap: 8px;
	        align-items: center;
	        padding: 8px;
	        border-bottom: 1px solid var(--color-border);
	        background: var(--color-bg-subtle);
	      }
	      .chat-search-select__tools.single {
	        grid-template-columns: 1fr;
	      }
	      .chat-search-select__search {
	        width: 100%;
	        min-height: 36px;
	        padding: 7px 10px;
	        border: 1px solid var(--color-border);
	        border-radius: var(--radius-small);
	        background: var(--color-bg-card);
	        color: var(--color-text);
	        font: inherit;
	        font-size: 14px;
	      }
	      .chat-search-select__toggle {
	        display: inline-flex;
	        align-items: center;
	        gap: 6px;
	        min-height: 36px;
	        color: var(--color-text-secondary);
	        font-size: 13px;
	        font-weight: 500;
	        white-space: nowrap;
	        cursor: pointer;
	        user-select: none;
	      }
	      .chat-search-select__toggle input {
	        margin: 0;
	        accent-color: var(--color-brand);
	      }
	      .chat-search-select__options {
	        max-height: min(380px, 48vh);
	        overflow-y: auto;
	        padding: 5px;
	      }
	      .chat-search-select__option {
	        display: grid;
	        grid-template-columns: minmax(0, 1fr) auto;
	        align-items: center;
	        gap: 10px;
	        width: 100%;
	        padding: 8px 10px;
	        border: 0;
	        border-radius: var(--radius-small);
	        background: transparent;
	        color: var(--color-text);
	        font: inherit;
	        font-size: 14px;
	        line-height: 1.25;
	        text-align: left;
	        cursor: pointer;
	      }
	      .chat-search-select__option:hover,
	      .chat-search-select__option.active {
	        background: rgba(0, 200, 83, 0.08);
	        color: var(--color-forest);
	      }
	      .chat-search-select__option.disabled {
	        color: var(--color-text-muted);
	        cursor: default;
	        opacity: 0.72;
	      }
	      .chat-search-select__option.inactive {
	        color: var(--color-text-muted);
	      }
	      .chat-search-select__label {
	        min-width: 0;
	        overflow: hidden;
	        text-overflow: ellipsis;
	        white-space: nowrap;
	      }
	      .chat-search-select__badge {
	        padding: 2px 6px;
	        border-radius: var(--radius-xs);
	        background: rgba(107, 112, 128, 0.1);
	        color: var(--color-text-muted);
	        font-size: 12px;
	        font-weight: 600;
	      }
	      .chat-search-select__empty {
	        padding: 18px 12px;
	        color: var(--color-text-muted);
	        font-size: 14px;
	        text-align: center;
	      }
      .chat-messages {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-width: thin;
        padding: 18px;
        display: flex;
        flex-direction: column;
        gap: 14px;
        background: var(--color-bg);
      }
      .chat-message {
        width: 100%;
        max-width: 100%;
        min-width: min(220px, 100%);
        padding: 0;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-element);
        background: var(--color-bg-card);
        font-size: 15px;
      }
      .chat-message.has-table {
        width: 100%;
        max-width: 100%;
      }
      .chat-message-body {
        min-width: 0;
        padding: 12px 14px;
        white-space: pre-wrap;
        line-height: 1.5;
        overflow-wrap: anywhere;
      }
      .chat-message-body.markdown {
        white-space: normal;
      }
      .chat-message-body.markdown p {
        margin: 0 0 10px;
      }
      .chat-message-body.markdown p:last-child,
      .chat-message-body.markdown ul:last-child,
      .chat-message-body.markdown ol:last-child,
      .chat-message-body.markdown pre:last-child {
        margin-bottom: 0;
      }
      .chat-message-body.markdown ul,
      .chat-message-body.markdown ol {
        margin: 0 0 10px 20px;
        padding: 0;
      }
      .chat-message-body.markdown li {
        margin: 4px 0;
      }
      .chat-message-body.markdown h2,
      .chat-message-body.markdown h3,
      .chat-message-body.markdown h4 {
        margin: 12px 0 8px;
        line-height: 1.25;
      }
      .chat-message-body.markdown h2 {
        font-size: 18px;
      }
      .chat-message-body.markdown h3 {
        font-size: 16px;
      }
      .chat-message-body.markdown h4 {
        font-size: 15px;
      }
      .chat-message-body.markdown code {
        font-family: "Monaco", "Courier New", monospace;
        font-size: 13px;
        background: var(--color-bg-subtle);
        border: 1px solid var(--color-border);
        border-radius: 4px;
        padding: 1px 4px;
      }
      .chat-message-body.markdown pre {
        margin: 0 0 10px;
        padding: 10px 12px;
        overflow-x: auto;
        background: var(--color-bg-subtle);
        border: 1px solid var(--color-border);
        border-radius: var(--radius-small);
      }
      .chat-message-body.markdown pre code {
        padding: 0;
        border: none;
        background: transparent;
      }
      .chat-message-body.markdown .chat-table-scroll {
        max-width: 100%;
        margin: 0 0 10px;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-small);
        background: var(--color-bg-card);
      }
      .chat-message-body.markdown .chat-table-scroll:last-child {
        margin-bottom: 0;
      }
      .chat-message-body.markdown table {
        width: max-content;
        min-width: 100%;
        border-collapse: collapse;
        font-size: 13px;
        line-height: 1.35;
      }
      .chat-message-body.markdown th,
      .chat-message-body.markdown td {
        padding: 8px 10px;
        border-bottom: 1px solid var(--color-border);
        text-align: left;
        white-space: nowrap;
        vertical-align: top;
      }
      .chat-message-body.markdown th {
        background: var(--color-bg-subtle);
        color: var(--color-text);
        font-weight: 700;
      }
      .chat-message-body.markdown tr:last-child td {
        border-bottom: 0;
      }
      .chat-message-body.markdown blockquote {
        margin: 0 0 10px;
        padding: 6px 0 6px 12px;
        border-left: 3px solid var(--color-border);
        color: var(--color-text-muted);
      }
      .chat-message-body.markdown a {
        color: var(--color-forest);
      }
      .chat-message.user {
        align-self: flex-end;
        background: rgba(0, 200, 83, 0.08);
        border-color: rgba(0, 200, 83, 0.2);
      }
      .chat-message.assistant {
        align-self: flex-start;
        width: 100%;
        max-width: 100%;
      }
      .chat-message-meta {
        display: flex;
        align-items: center;
        gap: 10px;
        flex-wrap: wrap;
        padding: 7px 12px;
        border-top: 1px solid var(--color-border);
        color: var(--color-text-muted);
        font-size: 12px;
        line-height: 1.25;
        background: rgba(0, 0, 0, 0.015);
      }
      .chat-message-copy {
        border: none;
        background: transparent;
        color: var(--color-forest);
        font: inherit;
        font-weight: 600;
        cursor: pointer;
        padding: 0;
      }
      .chat-message-copy:not(.chat-message-copy-icon):hover {
        text-decoration: underline;
      }
      .chat-message-copy-icon {
        width: 30px;
        height: 30px;
        margin: -7px -6px -7px 0;
        border-radius: var(--radius-small);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        transition:
          background 0.18s,
          color 0.18s,
          transform 0.18s;
      }
      .chat-message-copy-icon:hover {
        background: rgba(0, 200, 83, 0.09);
        color: var(--color-brand);
        transform: translateY(-1px);
      }
      .chat-message-copy-icon:disabled {
        color: var(--color-text-muted);
        cursor: default;
        opacity: 0.45;
        transform: none;
      }
      .chat-message-copy-icon:disabled:hover {
        background: transparent;
      }
      .chat-message-copy-icon svg {
        width: 17px;
        height: 17px;
        flex-shrink: 0;
      }
      .chat-message.thinking {
        border-color: rgba(0, 200, 83, 0.18);
        background:
          linear-gradient(135deg, rgba(0, 200, 83, 0.035), rgba(255, 255, 255, 0.92)),
          var(--color-bg-card);
      }
      .chat-thinking {
        display: inline-flex;
        align-items: center;
        gap: 11px;
        min-height: 32px;
        color: var(--color-forest);
        font-weight: 700;
        letter-spacing: 0;
      }
      .chat-thinking-orb {
        position: relative;
        width: 17px;
        height: 17px;
        border-radius: 50%;
        background:
          radial-gradient(circle at 34% 28%, rgba(237, 255, 242, 0.98) 0 17%, rgba(116, 239, 142, 0.96) 26%, rgba(0, 200, 83, 0.98) 52%, rgba(0, 143, 60, 0.98) 100%);
        box-shadow:
          0 0 0 1px rgba(0, 200, 83, 0.16),
          0 8px 20px rgba(0, 143, 60, 0.22);
        animation: chatThinkingOrb 1.55s cubic-bezier(0.42, 0, 0.18, 1) infinite;
      }
      .chat-thinking-orb::before {
        content: "";
        position: absolute;
        inset: -7px;
        border-radius: inherit;
        background: conic-gradient(from 0deg, rgba(0, 200, 83, 0), rgba(0, 200, 83, 0.42), rgba(104, 239, 120, 0.08), rgba(0, 200, 83, 0));
        filter: blur(1px);
        opacity: 0.74;
        animation: chatThinkingHalo 1.55s linear infinite;
      }
      .chat-thinking-orb::after {
        content: "";
        position: absolute;
        top: 4px;
        left: 5px;
        width: 4px;
        height: 4px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.95);
        box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
      }
      .chat-thinking-text {
        background: linear-gradient(90deg, var(--color-forest), var(--color-brand), #59d66f, var(--color-forest));
        background-size: 260% 100%;
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
        animation: chatThinkingText 2.1s ease-in-out infinite;
      }
      @keyframes chatThinkingOrb {
        0% {
          transform: rotate(0deg) scale(0.9);
          filter: hue-rotate(0deg) saturate(1);
        }
        48% {
          transform: rotate(188deg) scale(1.14);
          filter: hue-rotate(32deg) saturate(1.28);
        }
        100% {
          transform: rotate(360deg) scale(0.9);
          filter: hue-rotate(0deg) saturate(1);
        }
      }
      @keyframes chatThinkingHalo {
        to {
          transform: rotate(360deg);
        }
      }
      @keyframes chatThinkingText {
        0%,
        100% {
          background-position: 0% 50%;
        }
        50% {
          background-position: 100% 50%;
        }
      }
      @media (prefers-reduced-motion: reduce) {
        .chat-thinking-orb,
        .chat-thinking-orb::before,
        .chat-thinking-text {
          animation: none;
        }
      }
      .chat-activity {
        padding: 12px 14px;
        border-bottom: 1px solid var(--color-border);
        background:
          linear-gradient(135deg, rgba(0, 200, 83, 0.055), rgba(255, 255, 255, 0.92)),
          var(--color-bg-card);
      }
      .chat-activity-head {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
      }
      .chat-activity-main {
        min-width: 0;
        display: flex;
        gap: 10px;
        align-items: flex-start;
      }
      .chat-activity-spinner {
        width: 18px;
        height: 18px;
        margin-top: 2px;
        border-radius: 50%;
        border: 2px solid rgba(0, 200, 83, 0.18);
        border-top-color: var(--color-brand);
        flex: 0 0 auto;
        animation: chatActivitySpin 0.85s linear infinite;
      }
      .chat-activity.done .chat-activity-spinner,
      .chat-activity.error .chat-activity-spinner,
      .chat-activity.stopped .chat-activity-spinner {
        animation: none;
        border-color: rgba(0, 200, 83, 0.28);
        background: rgba(0, 200, 83, 0.14);
      }
      .chat-activity.done {
        display: none;
      }
      .chat-activity.error .chat-activity-spinner {
        border-color: rgba(211, 47, 47, 0.3);
        background: rgba(211, 47, 47, 0.12);
      }
      .chat-activity.stopped .chat-activity-spinner {
        border-color: rgba(107, 114, 128, 0.32);
        background: rgba(107, 114, 128, 0.12);
      }
      .chat-activity-title-row {
        display: flex;
        align-items: baseline;
        gap: 8px;
        flex-wrap: wrap;
      }
      .chat-activity-title {
        color: var(--color-forest);
        font-weight: 700;
        font-size: 15px;
      }
      .chat-activity-timer {
        color: var(--color-text-muted);
        font-size: 12px;
        font-variant-numeric: tabular-nums;
      }
      .chat-activity-phase {
        margin-top: 2px;
        color: var(--color-text-secondary);
        font-size: 13px;
        line-height: 1.35;
      }
      .chat-activity-actions {
        display: flex;
        align-items: center;
        gap: 4px;
        flex: 0 0 auto;
      }
      .chat-activity-btn {
        min-height: 30px;
        border: 1px solid transparent;
        border-radius: var(--radius-small);
        background: transparent;
        color: var(--color-text-muted);
        font: inherit;
        font-size: 12px;
        font-weight: 600;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 5px;
        padding: 5px 8px;
      }
      .chat-activity-btn:hover {
        color: var(--color-forest);
        background: rgba(0, 200, 83, 0.08);
      }
      .chat-activity-btn svg {
        width: 15px;
        height: 15px;
        flex-shrink: 0;
      }
      .chat-activity-icon-btn {
        width: 30px;
        padding: 0;
      }
      .chat-activity-progress {
        position: relative;
        height: 2px;
        margin: 10px 0 8px;
        overflow: hidden;
        border-radius: 999px;
        background: rgba(0, 200, 83, 0.12);
      }
      .chat-activity-progress span {
        position: absolute;
        inset: 0;
        width: 42%;
        border-radius: inherit;
        background: linear-gradient(90deg, transparent, var(--color-brand), transparent);
        animation: chatActivityProgress 1.35s ease-in-out infinite;
      }
      .chat-activity.done .chat-activity-progress span,
      .chat-activity.error .chat-activity-progress span,
      .chat-activity.stopped .chat-activity-progress span {
        width: 100%;
        background: rgba(0, 200, 83, 0.36);
        animation: none;
      }
      .chat-activity.error .chat-activity-progress span {
        background: rgba(211, 47, 47, 0.35);
      }
      .chat-activity.stopped .chat-activity-progress span {
        background: rgba(107, 114, 128, 0.35);
      }
      .chat-activity-current {
        color: var(--color-text);
        font-size: 13px;
        line-height: 1.35;
      }
      .chat-activity-list,
      .chat-activity-details {
        margin-top: 8px;
        display: flex;
        flex-direction: column;
        gap: 5px;
      }
      .chat-activity-event {
        display: grid;
        grid-template-columns: 18px minmax(0, 1fr) auto;
        align-items: center;
        gap: 7px;
        min-height: 22px;
        color: var(--color-text-secondary);
        font-size: 13px;
        line-height: 1.35;
      }
      .chat-activity-event-title {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
      .chat-activity-event-detail {
        color: var(--color-text-muted);
      }
      .chat-activity-event-time {
        color: var(--color-text-muted);
        font-size: 12px;
        font-variant-numeric: tabular-nums;
      }
      .chat-activity-event-icon {
        width: 18px;
        height: 18px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: var(--color-brand);
      }
      .chat-activity-event-icon svg {
        width: 15px;
        height: 15px;
      }
      .chat-activity-event.running .chat-activity-event-icon svg {
        animation: chatActivitySpin 0.85s linear infinite;
      }
      .chat-activity-event.error .chat-activity-event-icon {
        color: var(--color-danger);
      }
      .chat-activity-details {
        padding-top: 7px;
        border-top: 1px solid rgba(0, 0, 0, 0.06);
      }
      @keyframes chatActivitySpin {
        to { transform: rotate(360deg); }
      }
      @keyframes chatActivityProgress {
        0% { transform: translateX(-100%); }
        100% { transform: translateX(240%); }
      }
      @media (prefers-reduced-motion: reduce) {
        .chat-activity-spinner,
        .chat-activity-progress span,
        .chat-activity-event.running .chat-activity-event-icon svg {
          animation: none;
        }
      }
      .chat-status {
        flex: 0 0 auto;
        color: var(--color-text-muted);
        font-size: var(--text-md);
        padding: 0 18px 12px;
        min-height: 30px;
      }
      .chat-usage {
        flex: 0 0 auto;
        color: var(--color-text-muted);
        font-size: 13px;
        border-top: 1px solid var(--color-border);
        padding: 10px 12px;
        background: var(--color-bg-subtle);
      }
      .chat-composer {
        flex: 0 0 auto;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px;
        align-items: end;
        width: 100%;
        padding: 12px;
        border-top: 1px solid var(--color-border);
        background: var(--color-bg-card);
        position: sticky;
        bottom: 0;
        z-index: 5;
      }
      .chat-composer textarea {
        width: 100%;
        min-width: 0;
        min-height: 58px;
        max-height: 180px;
        resize: vertical;
        padding: 11px 12px;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-small);
        background: var(--color-bg);
        color: var(--color-text);
        font: inherit;
        font-size: 15px;
        line-height: 1.4;
      }
      .chat-send-icon {
        display: block;
        width: 20px;
        height: 20px;
      }
      #chat-send-btn {
        width: 48px;
        min-width: 48px;
        height: 58px;
        padding: 0;
        border-radius: var(--radius-small);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
      }
      .chat-empty {
        margin: auto;
        color: var(--color-text-muted);
        text-align: center;
        max-width: 520px;
        line-height: 1.6;
      }
      .chat-start-card {
        width: min(640px, 100%);
        margin: auto;
        padding: 20px;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-element);
        background: var(--color-bg-card);
        color: var(--color-text);
        text-align: left;
      }
      .chat-start-notice {
        display: grid;
        gap: 10px;
        margin-bottom: 16px;
        padding: 14px 16px;
        border: 1px solid rgba(217, 119, 6, 0.28);
        border-left: 4px solid #d97706;
        border-radius: var(--radius-small);
        background: #fffbeb;
        color: var(--color-text);
        font-size: 14px;
        line-height: 1.45;
      }
      .chat-start-notice strong {
        color: #92400e;
        font-size: 15px;
      }
      .chat-start-notice p {
        margin: 0;
      }
      .chat-start-notice a {
        color: var(--color-forest);
        font-weight: 600;
      }
      .chat-readiness {
        display: grid;
        gap: 10px;
        margin-bottom: 16px;
      }
      .chat-readiness-head {
        display: grid;
        gap: 4px;
        padding: 14px 16px;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-small);
        background: var(--color-bg-subtle);
      }
      .chat-readiness-title {
        color: var(--color-text);
        font-size: 16px;
        font-weight: 750;
        line-height: 1.25;
      }
      .chat-readiness-summary {
        color: var(--color-text-secondary);
        font-size: 14px;
        line-height: 1.45;
      }
      .chat-readiness-list {
        display: grid;
        gap: 8px;
      }
      .chat-readiness-item {
        display: grid;
        grid-template-columns: 22px minmax(0, 1fr) auto;
        align-items: center;
        gap: 10px;
        min-height: 46px;
        padding: 9px 10px;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-small);
        background: var(--color-bg-card);
      }
      .chat-readiness-item.blocking {
        border-color: rgba(220, 38, 38, 0.28);
        background: rgba(220, 38, 38, 0.04);
      }
      .chat-readiness-item.setup {
        border-color: rgba(217, 119, 6, 0.24);
        background: rgba(217, 119, 6, 0.05);
      }
      .chat-readiness-item.ready {
        border-color: rgba(0, 200, 83, 0.2);
        background: rgba(0, 200, 83, 0.06);
      }
      .chat-readiness-icon {
        width: 22px;
        height: 22px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: var(--color-text-muted);
      }
      .chat-readiness-item.blocking .chat-readiness-icon {
        color: var(--color-error);
      }
      .chat-readiness-item.setup .chat-readiness-icon {
        color: var(--color-warning);
      }
      .chat-readiness-item.ready .chat-readiness-icon {
        color: var(--color-forest);
      }
      .chat-readiness-icon svg {
        width: 19px;
        height: 19px;
      }
      .chat-readiness-copy {
        min-width: 0;
      }
      .chat-readiness-copy strong {
        display: block;
        color: var(--color-text);
        font-size: 14px;
        line-height: 1.25;
      }
      .chat-readiness-copy span {
        display: block;
        margin-top: 2px;
        color: var(--color-text-secondary);
        font-size: 13px;
        line-height: 1.35;
      }
      .chat-readiness-action {
        min-height: 34px;
        padding: 6px 10px;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-small);
        background: var(--color-bg-card);
        color: var(--color-forest);
        font: inherit;
        font-size: 13px;
        font-weight: 700;
        cursor: pointer;
        white-space: nowrap;
      }
      .chat-readiness-action:hover {
        border-color: rgba(0, 200, 83, 0.3);
        background: rgba(0, 200, 83, 0.08);
      }
      .chat-start-card h3 {
        margin: 0 0 14px;
        color: var(--color-text);
        font-size: 18px;
        line-height: 1.25;
      }
      .chat-start-grid {
        display: grid;
        gap: 12px;
      }
      .chat-start-field {
        display: grid;
        gap: 6px;
      }
	      .chat-start-field select {
	        width: 100%;
	        padding: 10px 12px;
	        border: 1px solid var(--color-border);
        border-radius: var(--radius-small);
        background: var(--color-bg);
        color: var(--color-text);
	        font: inherit;
	        font-size: 15px;
	      }
	      .chat-start-field .chat-search-select {
	        width: 100%;
	        min-width: 0;
	        font-size: 15px;
	      }
	      .chat-start-field .chat-search-select__button {
	        min-height: 44px;
	        padding: 10px 12px;
	        background: var(--color-bg);
	        font-size: 15px;
	      }
	      .chat-start-field .chat-search-select__panel {
	        max-width: 100%;
	      }
	      .chat-start-actions {
	        display: flex;
	        justify-content: flex-end;
	        margin-top: 14px;
	      }
      @media (max-width: 900px) {
        .chat-shell {
          grid-template-columns: 1fr;
          grid-template-rows: auto minmax(0, 1fr);
        }
        .chat-list {
          max-height: 180px;
        }
      }

      /* Delete task modal */
      .delete-modal-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        display: none;
        align-items: center;
        justify-content: center;
        z-index: 2000;
      }
      .delete-modal-overlay.visible {
        display: flex;
      }

      .delete-modal-box {
        background: var(--color-bg-card);
        border-radius: var(--radius-card);
        padding: 28px;
        max-width: 400px;
        width: 90%;
        box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
      }
      .delete-modal-box h3 {
        font-size: 17px;
        margin-bottom: 8px;
      }
      .delete-modal-box p {
        font-size: var(--text-md);
        color: var(--color-text-muted);
        margin-bottom: 20px;
        line-height: 1.5;
      }
      .delete-modal-actions {
        display: flex;
        gap: 8px;
        justify-content: flex-end;
      }
      .delete-modal-actions button {
        padding: 10px 20px;
        border-radius: var(--radius-small);
        font-size: var(--text-md);
        font-weight: 500;
        cursor: pointer;
        border: 1px solid var(--color-border);
        background: var(--color-bg-card);
        color: var(--color-text);
        transition: all 0.2s;
      }
      .delete-modal-actions button:hover {
        background: var(--color-bg);
      }
      .delete-modal-actions .delete-modal-btn-danger {
        background: var(--color-error);
        color: white;
        border-color: var(--color-error);
      }
      .delete-modal-actions .delete-modal-btn-danger:hover {
        background: #b91c1c;
      }

      /* --- Mobile: sidebar becomes top nav --- */
      @media (max-width: 768px) {
        :root {
          --dashboard-padding-y: 24px;
        }

        .dashboard-page {
          flex-direction: column;
        }

        .sidebar {
          width: 100%;
          height: auto;
          position: sticky;
          top: 0;
          z-index: 20;
          border-right: none;
          border-bottom: 1px solid var(--color-border);
          flex-direction: row;
          align-items: center;
          padding: 0;
        }

        .sidebar-brand {
          padding: 9px 12px;
          border-bottom: none;
          flex-shrink: 0;
        }

        .sidebar-nav {
          flex-direction: row;
          padding: 7px 8px;
          gap: 4px;
          flex: 1;
          justify-content: flex-start;
          overflow-x: auto;
          overflow-y: hidden;
          scrollbar-width: none;
        }

        .sidebar-nav::-webkit-scrollbar {
          display: none;
        }

        .sidebar-item {
          flex: 0 0 auto;
          min-height: 32px;
          padding: 7px 10px;
          font-size: 15px;
          justify-content: center;
          width: auto;
        }

        .sidebar-item--nested {
          margin-left: 0;
          width: auto;
        }

        .sidebar-item--chat-entry {
          white-space: nowrap;
        }

        .sidebar-item__sub,
        .sidebar-group {
          display: none;
        }

        .sidebar-item svg {
          display: block;
          width: 16px;
          height: 16px;
        }

        .sidebar-item.active::before {
          display: none;
        }

        .sidebar-social {
          display: none;
        }

        .sidebar-footer {
          display: none;
        }

        .sidebar-email {
          display: none;
        }

        .sidebar-account-type {
          display: none !important;
        }

        .dashboard-main {
          flex: 1 1 auto;
          height: auto;
          padding: 24px 16px;
        }

        .geo-trust-grid-app {
          grid-template-columns: 1fr !important;
        }
      }

      @media (max-width: 768px) {
        body.chat-mobile-mode {
          overflow: hidden;
          background: var(--color-bg-card);
        }

        body.chat-mobile-mode .dashboard-page {
          height: var(--app-visual-height, 100dvh);
          min-height: 0;
          overflow: hidden;
        }

        body.chat-mobile-mode .sidebar {
          display: none;
        }

        body.chat-mobile-mode .dashboard-main {
          height: var(--app-visual-height, 100dvh);
          min-height: 0;
          padding: 0;
          overflow: hidden;
          background: var(--color-bg-card);
        }

        body.chat-mobile-mode .global-sub-banner {
          display: none;
        }

        body.chat-mobile-mode #section-chat {
          display: flex;
          flex-direction: column;
          width: 100%;
          height: 100%;
          max-width: none;
          margin: 0;
          overflow: hidden;
        }

        body.chat-mobile-mode #section-chat.hidden {
          display: none !important;
        }

        body.chat-mobile-mode #section-chat > .section-title {
          display: none;
        }

        body.chat-mobile-mode .chat-topbar {
          display: none;
        }

        body.chat-mobile-mode .chat-shell {
          display: block;
          height: 100%;
          min-height: 0;
          overflow: hidden;
        }

        body.chat-mobile-mode .chat-sidebar {
          width: 100%;
          height: 100%;
          border: none;
          border-radius: 0;
          padding: 0;
          display: flex;
          flex-direction: column;
          background: var(--color-bg-card);
        }

        .chat-list-mobile-header {
          display: flex;
          align-items: center;
          justify-content: space-between;
          gap: 12px;
          padding: calc(12px + env(safe-area-inset-top)) 16px 10px;
          border-bottom: 1px solid var(--color-border);
          background: rgba(255, 255, 255, 0.94);
          backdrop-filter: blur(16px);
        }

        .chat-list-mobile-title {
          margin: 0;
          color: var(--color-text);
          font-size: 28px;
          line-height: 1.1;
          font-weight: 750;
        }

        .chat-list-mobile-subtitle {
          margin-top: 3px;
          color: var(--color-text-muted);
          font-size: 14px;
        }

        body.chat-mobile-mode #chat-new-btn {
          width: calc(100% - 32px) !important;
          min-height: 44px;
          margin: 10px 16px 8px !important;
          border-radius: 999px;
        }

        body.chat-mobile-mode .chat-list {
          flex: 1 1 auto;
          max-height: none;
          margin: 0;
          padding: 0 0 calc(16px + env(safe-area-inset-bottom));
          overflow-y: auto;
          gap: 0;
          -webkit-overflow-scrolling: touch;
        }

        body.chat-mobile-mode .chat-list-item {
          position: relative;
          min-height: 70px;
          padding: 13px 18px 13px 16px;
          border: 0;
          border-bottom: 1px solid var(--color-border);
          border-radius: 0;
          background: transparent;
          font-size: 16px;
        }

        body.chat-mobile-mode .chat-list-item:hover,
        body.chat-mobile-mode .chat-list-item.active {
          background: var(--color-bg-subtle);
        }

        .chat-list-item-title {
          display: block;
          overflow: hidden;
          color: var(--color-text);
          font-size: 17px;
          font-weight: 650;
          line-height: 1.25;
          text-overflow: ellipsis;
          white-space: nowrap;
        }

        .chat-list-item-meta {
          display: block;
          margin-top: 5px;
          overflow: hidden;
          color: var(--color-text-muted);
          font-size: 13px;
          line-height: 1.3;
          text-overflow: ellipsis;
          white-space: nowrap;
        }

        body.chat-mobile-mode .chat-panel {
          display: none;
          width: 100%;
          height: 100%;
          min-height: 0;
          border: none;
          border-radius: 0;
          background: var(--color-bg);
        }

        body.chat-mobile-mode.chat-mobile-open .chat-sidebar {
          display: none;
        }

        body.chat-mobile-mode.chat-mobile-open .chat-panel {
          display: flex;
        }

        .chat-mobile-header {
          display: flex;
          align-items: center;
          gap: 10px;
          padding: calc(8px + env(safe-area-inset-top)) 10px 8px;
          border-bottom: 1px solid var(--color-border);
          background: rgba(255, 255, 255, 0.94);
          backdrop-filter: blur(16px);
        }

        .chat-mobile-titlebox {
          flex: 1 1 auto;
          min-width: 0;
          text-align: center;
        }

        .chat-mobile-title {
          overflow: hidden;
          color: var(--color-text);
          font-size: 16px;
          font-weight: 700;
          line-height: 1.2;
          text-overflow: ellipsis;
          white-space: nowrap;
        }

        .chat-mobile-subtitle {
          margin-top: 2px;
          color: var(--color-text-muted);
          font-size: 12px;
          line-height: 1.2;
        }

        .chat-mobile-icon-btn.active {
          color: var(--color-forest);
          border-color: rgba(0, 200, 83, 0.28);
          background: rgba(0, 200, 83, 0.09);
        }

        body.chat-mobile-mode .chat-billing-banner {
          padding: 8px 10px;
        }

        body.chat-mobile-mode .chat-billing-link {
          align-items: flex-start;
          font-size: 13px;
        }

        body.chat-mobile-mode .chat-billing-dialog {
          left: 10px;
          width: calc(100% - 20px);
          max-height: min(460px, 62vh);
        }

        body.chat-mobile-mode .chat-toolbar {
          display: none;
          flex: 0 0 auto;
          max-height: 40vh;
          overflow-y: auto;
          padding: 10px;
          border-bottom: 1px solid var(--color-border);
          background: var(--color-bg-card);
        }

        body.chat-mobile-mode .chat-panel.chat-menu-open .chat-toolbar {
          display: flex;
        }

        body.chat-mobile-mode .chat-toolbar > .chat-settings-link {
          display: inline-flex;
        }

        body.chat-mobile-mode .chat-toolbar-field {
          width: 100%;
          flex: 1 1 100%;
          align-items: stretch;
          flex-direction: column;
          gap: 5px;
        }

	        body.chat-mobile-mode .chat-toolbar select,
	        body.chat-mobile-mode #chat-target,
	        body.chat-mobile-mode .chat-toolbar .chat-search-select {
	          width: 100%;
	          min-width: 0;
	          max-width: none;
	          min-height: 40px;
	        }

	        body.chat-mobile-mode .chat-search-select__panel {
	          width: 100%;
	          max-width: 100%;
	        }

	        body.chat-mobile-mode .chat-search-select__tools {
	          grid-template-columns: 1fr;
	        }

        body.chat-mobile-mode .chat-settings-view {
          height: 100%;
          border: none;
          border-radius: 0;
        }

        body.chat-mobile-mode .chat-settings-body {
          padding: 12px;
        }

        body.chat-mobile-mode .chat-rule-examples {
          grid-template-columns: 1fr;
        }

        body.chat-mobile-mode .chat-messages {
          flex: 1 1 auto;
          min-height: 0;
          padding: 12px 10px;
          gap: 8px;
          overflow-y: auto;
          overscroll-behavior: contain;
          -webkit-overflow-scrolling: touch;
          background:
            linear-gradient(rgba(255,255,255,0.82), rgba(255,255,255,0.82)),
            radial-gradient(circle at 18px 18px, rgba(0,200,83,0.08) 1px, transparent 1px);
          background-size: auto, 28px 28px;
        }

        body.chat-mobile-mode .chat-message {
          max-width: min(86%, 680px);
          min-width: 0;
          border-radius: 18px;
          font-size: 16px;
          box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
        }

        body.chat-mobile-mode .chat-message.has-table {
          max-width: 96%;
          width: 96%;
        }

        body.chat-mobile-mode .chat-message.user {
          border-color: rgba(0, 200, 83, 0.18);
          border-bottom-right-radius: 5px;
          background: linear-gradient(135deg, rgba(0, 200, 83, 0.16), rgba(0, 143, 60, 0.12));
        }

        body.chat-mobile-mode .chat-message.assistant {
          border-bottom-left-radius: 5px;
        }

        body.chat-mobile-mode .chat-message-body {
          padding: 10px 12px;
          line-height: 1.45;
        }

        body.chat-mobile-mode .chat-message-meta {
          justify-content: flex-end;
          gap: 8px;
          padding: 5px 10px;
          font-size: 11px;
        }

        body.chat-mobile-mode .chat-activity {
          padding: 10px 12px;
        }

        body.chat-mobile-mode .chat-activity-head {
          gap: 8px;
        }

        body.chat-mobile-mode .chat-activity-title {
          font-size: 14px;
        }

        body.chat-mobile-mode .chat-activity-actions {
          gap: 2px;
        }

        body.chat-mobile-mode .chat-activity-btn:not(.chat-activity-icon-btn) {
          padding: 5px 6px;
        }

        body.chat-mobile-mode .chat-activity-event {
          grid-template-columns: 18px minmax(0, 1fr);
        }

        body.chat-mobile-mode .chat-activity-event-time {
          display: none;
        }

        body.chat-mobile-mode .chat-status {
          flex: 0 0 auto;
          min-height: 0;
          padding: 0 12px 6px;
          background: var(--color-bg);
          font-size: 13px;
        }

        body.chat-mobile-mode .chat-status:empty {
          display: none;
        }

        body.chat-mobile-mode .chat-usage {
          flex: 0 0 auto;
          max-height: 72px;
          overflow-y: auto;
        }

        body.chat-mobile-mode .chat-composer {
          flex: 0 0 auto;
          display: grid;
          grid-template-columns: minmax(0, 1fr) 44px;
          align-items: end;
          gap: 8px;
          width: 100%;
          max-width: 100vw;
          padding: 8px max(10px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
          border-top: 1px solid var(--color-border);
          background: rgba(255, 255, 255, 0.96);
          backdrop-filter: blur(16px);
        }

        body.chat-mobile-mode .chat-composer textarea {
          min-height: 44px;
          max-height: 132px;
          resize: none;
          overflow-y: auto;
          padding: 11px 14px;
          border-radius: 22px;
          background: var(--color-bg-card);
          font-size: 16px;
        }

        body.chat-mobile-mode #chat-send-btn {
          width: 44px;
          min-width: 44px;
          max-width: 44px;
          height: 44px;
          padding: 0;
          border-radius: 999px;
          display: inline-flex;
          align-items: center;
          justify-content: center;
        }

        body.chat-mobile-mode #chat-send-btn .chat-send-icon {
          display: block;
          width: 20px;
          height: 20px;
        }
      }

      .img-lightbox {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 9999;
        background: rgba(0,0,0,0.85);
        backdrop-filter: blur(8px);
        cursor: zoom-out;
        align-items: center;
        justify-content: center;
        padding: 32px;
      }
      .img-lightbox.active { display: flex; }
      .img-lightbox img {
        max-width: 90vw;
        max-height: 90vh;
        border-radius: 12px;
        box-shadow: 0 16px 64px rgba(0,0,0,0.4);
      }
