      #chat-new-host {
        --ui-scale: 1.2;
        --font-ui: "Plus Jakarta Sans", "Helvetica Neue", Arial, sans-serif;
        --font-ui-ar: "IBM Plex Sans Arabic", "Plus Jakarta Sans", "Helvetica Neue", Arial, sans-serif;
        --bg-1: #f6f3ea;
        --bg-2: #e9d6c1;
        --ink: #1f1b16;
        --muted: #6c6258;
        --brand: #d65f2b;
        --brand-strong: #b14516;
        --panel: #fffdf8;
        --line: #dfd7cc;
        --assistant: #f7ede3;
        --user: #b06f1f;
        font-family: var(--font-ui);
        color: var(--ink);
      }

      #chat-new-host,
      #chat-new-host * {
        box-sizing: border-box;
      }

      .bg-grid {
        position: fixed;
        inset: 0;
        pointer-events: none;
        opacity: 0.2;
        background-image:
          linear-gradient(to right, rgba(76, 61, 42, 0.08) 1px, transparent 1px),
          linear-gradient(to bottom, rgba(76, 61, 42, 0.08) 1px, transparent 1px);
        background-size: 38px 38px;
      }

      .launcher {
        position: fixed;
        right: 24px;
        bottom: 24px;
        border: none;
        border-radius: 999px;
        width: 64px;
        height: 64px;
        background: transparent;
        color: #fff;
        cursor: pointer;
        box-shadow: 0 10px 28px rgba(155, 65, 20, 0.3);
        transition: transform 180ms ease, box-shadow 180ms ease;
        z-index: 20;
        overflow: hidden;
      }

      .launcher:hover {
        transform: translateY(-2px);
        box-shadow: 0 14px 32px rgba(155, 65, 20, 0.35);
      }

      .launcher img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        display: block;
      }

      .launcher-hint {
        position: fixed;
        right: 24px;
        bottom: 98px;
        max-width: min(320px, calc(100vw - 36px));
        border: 1px solid #d8c7b4;
        border-radius: 999px;
        background: #fffdf8;
        color: #5a4027;
        padding: 12px 20px;
        font: inherit;
        font-size: calc(16px * var(--ui-scale));
        font-weight: 400;
        line-height: 1.15;
        letter-spacing: 0.2px;
        box-shadow: 0 8px 20px rgba(26, 17, 8, 0.12);
        cursor: pointer;
        transition: opacity 180ms ease, transform 180ms ease;
        z-index: 21;
      }

      .launcher-hint.hidden {
        opacity: 0;
        transform: translateY(6px);
        pointer-events: none;
      }

      .chat {
        position: fixed;
        right: 24px;
        bottom: 100px;
        width: min(calc(380px * var(--ui-scale)), calc(100vw - 24px));
        height: min(calc(600px * var(--ui-scale)), calc(100vh - 132px));
        border-radius: 18px;
        border: 1px solid var(--line);
        background: var(--panel);
        box-shadow: 0 24px 50px rgba(26, 17, 8, 0.22);
        display: grid;
        grid-template-rows: auto minmax(0, 1fr) auto auto auto;
        overflow: hidden;
        transform: translateY(24px) scale(0.98);
        opacity: 0;
        pointer-events: none;
        transition: opacity 180ms ease, transform 180ms ease;
        z-index: 30;
      }

      .chat.open {
        transform: translateY(0) scale(1);
        opacity: 1;
        pointer-events: auto;
      }

      .chat-head {
        padding: 14px 16px;
        border-bottom: 1px solid var(--line);
        background: #774718;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 10px;
      }

      .chat-head h1 {
        font-size: calc(15px * var(--ui-scale));
        margin: 0;
        color: #fff;
        letter-spacing: 0.2px;
        min-width: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }

      .chat-head-actions {
        display: flex;
        align-items: center;
        gap: 10px;
      }

      .head-icon-btn {
        width: 34px;
        height: 34px;
        border-radius: 999px;
        border: 1px solid #d8c7b4;
        background: linear-gradient(160deg, #fffaf3, #f7ecdf);
        color: #744622;
        display: grid;
        place-items: center;
        cursor: pointer;
        font: inherit;
        font-size: 14px;
        line-height: 1;
        transition: transform 140ms ease, background 140ms ease, box-shadow 140ms ease;
        box-shadow: inset 0 -1px 0 rgba(167, 119, 68, 0.18);
      }

      .head-icon-btn:hover {
        background: linear-gradient(160deg, #fffefb, #f8efdf);
        box-shadow: 0 1px 6px rgba(167, 119, 68, 0.18);
      }

      .head-icon-btn:active {
        transform: scale(0.97);
      }

      .head-icon-btn svg {
        width: 15px;
        height: 15px;
        display: block;
        stroke: currentColor;
        fill: none;
        stroke-width: 2.2;
        stroke-linecap: round;
        stroke-linejoin: round;
      }

      .status {
        font-size: calc(12px * var(--ui-scale));
        color: #fff;
        display: flex;
        align-items: center;
        gap: 6px;
        min-width: 0;
      }

      .status span:last-child {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      .dot {
        width: 8px;
        height: 8px;
        border-radius: 999px;
        background: #34c759;
        box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.45);
        animation: pulse 1.5s infinite;
      }

      @keyframes pulse {
        0% {
          box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.45);
        }

        70% {
          box-shadow: 0 0 0 8px rgba(52, 199, 89, 0);
        }

        100% {
          box-shadow: 0 0 0 0 rgba(52, 199, 89, 0);
        }
      }

      @keyframes typing-dot-float {
        0%,
        80%,
        100% {
          transform: translateY(0);
          opacity: 0.35;
        }

        40% {
          transform: translateY(-4px);
          opacity: 1;
        }
      }

      .messages {
        padding: 14px;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
        gap: 12px;
      }

      .quick-replies {
        padding: 10px 12px 10px;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        border-top: 1px solid var(--line);
        background: #fff;
        max-width: 100%;
        overflow-x: auto;
      }

      .quick-reply {
        border: 1px solid #d8c4af;
        background: #fff7ee;
        color: #5e2a11;
        border-radius: 999px;
        font: inherit;
        font-size: calc(13px * var(--ui-scale));
        padding: 6px 12px;
        max-width: 100%;
        white-space: normal;
        line-height: 1.2;
        cursor: pointer;
      }

      .quick-reply:hover {
        background: #ffe9d6;
      }

      .callback-overlay {
        position: absolute;
        inset: 0;
        z-index: 50;
        background: rgba(30, 24, 18, 0.2);
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 10px;
      }

      .callback-overlay[hidden] {
        display: none;
      }

      .callback-form-card {
        margin-top: 10px;
        border: 1px solid #dbc8b5;
        border-radius: 14px;
        background: #fff9f3;
        padding: 12px;
      }

      .callback-form-modal {
        margin: 0;
        width: 100%;
        max-height: 100%;
        overflow-y: auto;
        box-shadow: 0 16px 34px rgba(26, 17, 8, 0.24);
      }

      .callback-form-title {
        margin: 0 0 2px;
        font-size: 20px;
        font-weight: 700;
        color: #2d2016;
      }

      .callback-form-desc {
        margin: 0 0 12px;
        color: #5a5046;
      }

      .callback-form-field {
        margin-bottom: 10px;
      }

      .callback-form-label {
        display: block;
        margin-bottom: 6px;
        font-size: 13px;
        font-weight: 700;
        color: #2f2318;
      }

      .callback-form-input,
      .callback-form-textarea {
        width: 100%;
        border: 1px solid #d8c8b7;
        border-radius: 12px;
        background: #fff;
        color: #2f2318;
        font: inherit;
      }

      .callback-form-input {
        height: 42px;
        padding: 0 12px;
      }

      .callback-form-textarea {
        min-height: 110px;
        resize: vertical;
        padding: 10px 12px;
      }

      .callback-form-help {
        margin: 6px 0 0;
        font-size: 12px;
        color: #726559;
      }

      .callback-file-input {
        display: none;
      }

      .callback-file-row {
        width: 100%;
        min-height: 42px;
        border: 1px solid #d8c8b7;
        border-radius: 12px;
        background: #fff;
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 6px 10px;
      }

      .callback-file-trigger {
        border: 1px solid #ccb59b;
        border-radius: 8px;
        background: #f7efe6;
        color: #4d3420;
        font: inherit;
        font-size: 13px;
        line-height: 1.1;
        padding: 4px 10px;
        cursor: pointer;
        white-space: nowrap;
      }

      .callback-file-trigger:hover {
        background: #f3e5d6;
      }

      .callback-file-name {
        min-width: 0;
        flex: 1 1 auto;
        color: #7b6a5a;
        font-size: 13px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }

      .callback-file-row.has-file .callback-file-name {
        color: #2f2318;
      }

      .callback-form-actions {
        display: flex;
        justify-content: flex-end;
        gap: 6px;
        margin-top: 10px;
      }

      .callback-btn {
        border-radius: 999px;
        padding: 6px 12px;
        font: inherit;
        font-weight: 600;
        font-size: 13px;
        line-height: 1.1;
        cursor: pointer;
      }

      .callback-btn.secondary {
        border: 1px solid #c7a06f;
        background: #fff;
        color: #7c582f;
      }

      .callback-btn.primary {
        border: none;
        background: linear-gradient(140deg, #b7874f, #8f683d);
        color: #fff;
      }

      .callback-feedback {
        margin: 10px 0 0;
        font-size: 12px;
        color: #7c582f;
      }

      .callback-feedback.error {
        color: #b3261e;
      }

      .callback-progress {
        margin-top: 10px;
      }

      .callback-progress[hidden] {
        display: none;
      }

      .callback-progress-track {
        width: 100%;
        height: 6px;
        border-radius: 999px;
        background: #eadbc8;
        overflow: hidden;
      }

      .callback-progress-bar {
        width: 40%;
        height: 100%;
        border-radius: 999px;
        background: linear-gradient(90deg, #b7874f, #8f683d);
        animation: callback-progress-slide 1.1s ease-in-out infinite;
      }

      .callback-progress-text {
        margin: 6px 0 0;
        font-size: 12px;
        color: #7c582f;
      }

      @keyframes callback-progress-slide {
        0% {
          transform: translateX(-110%);
        }

        100% {
          transform: translateX(260%);
        }
      }

      .msg-row {
        display: flex;
        align-items: flex-end;
        gap: 8px;
        width: 100%;
        animation: msg-in 220ms ease both;
      }

      @keyframes msg-in {
        from {
          opacity: 0;
          transform: translateY(8px);
        }

        to {
          opacity: 1;
          transform: translateY(0);
        }
      }

      .msg-row.user {
        justify-content: flex-end;
      }

      .msg-row.user .avatar {
        order: 2;
      }

      .msg-row.user .msg {
        order: 1;
      }

      .avatar {
        width: 34px;
        height: 34px;
        flex: 0 0 34px;
        border-radius: 999px;
        border: 1px solid #d5c9bc;
        display: grid;
        place-items: center;
        font-size: 25px;
        line-height: 1;
        background: #ffffff00;
        overflow: hidden;
      }

      .avatar.bot {
        padding: 2px;
      }

      .avatar.bot img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 999px;
      }

      .avatar.user {
        background: #ffffff;
        border-color: #2b251f;
      }

      .msg {
        max-width: min(72%, calc(292px * var(--ui-scale)));
        padding: 8px 10px;
        border-radius: 13px;
        font-size: calc(14px * var(--ui-scale));
        line-height: 1.55;
        word-break: break-word;
      }

      .msg.assistant {
        align-self: flex-start;
        max-width: min(88%, calc(360px * var(--ui-scale)));
        background: var(--assistant);
        border: 1px solid #e8dccf;
      }

      .msg.assistant .msg-content {
        display: grid;
        gap: 10px;
      }

      .msg.assistant .typing-indicator {
        display: none;
        align-items: center;
        gap: 4px;
        margin-top: 6px;
      }

      .msg.assistant.streaming .typing-indicator {
        display: inline-flex;
      }

      .msg.assistant .typing-dot {
        width: 6px;
        height: 6px;
        border-radius: 999px;
        background: #8f3716;
        animation: typing-dot-float 1.2s ease-in-out infinite;
      }

      .msg.assistant .typing-dot:nth-child(2) {
        animation-delay: 0.16s;
      }

      .msg.assistant .typing-dot:nth-child(3) {
        animation-delay: 0.32s;
      }

      .msg.assistant p {
        margin: 0;
        line-height: 1.65;
      }

      .msg.assistant h2,
      .msg.assistant h3 {
        margin: 0;
        line-height: 1.3;
      }

      .msg.assistant h2 {
        font-size: 16px;
        font-weight: 700;
      }

      .msg.assistant h3 {
        font-size: 15px;
        font-weight: 700;
      }

      .msg.assistant a {
        color: #8f3716;
        text-decoration: none;
      }

      .msg.assistant a:hover {
        text-decoration: underline;
      }

      .msg.assistant .link-list {
        margin-top: 10px;
        display: grid;
        gap: 8px;
      }

      .msg.assistant .link-card {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 8px;
        border: 1px solid #ddccb9;
        border-radius: 10px;
        background: #fff8ef;
      }

      .msg.assistant .link-card:hover {
        text-decoration: none;
        background: #fff3e4;
      }

      .msg.assistant .link-icon {
        width: 18px;
        height: 18px;
        object-fit: contain;
        flex-shrink: 0;
      }

      .msg.assistant .inline-image {
        display: block;
        max-width: 100%;
        height: auto;
        border-radius: 10px;
        border: 1px solid #d9c8b5;
        margin: 8px 0;
      }

      .msg.assistant .inline-link-icon-wrap {
        display: inline-flex;
        vertical-align: middle;
      }

      .msg.assistant .inline-link-icon {
        width: 28px;
        height: 28px;
        object-fit: contain;
        border: 0;
        border-radius: 6px;
        margin: 0 8px 0 0;
        vertical-align: middle;
      }

      .msg.assistant table {
        width: 100%;
        border-collapse: collapse;
        font-size: 13px;
      }

      .msg.assistant .table-wrap {
        width: 100%;
        overflow-x: auto;
        border-radius: 8px;
      }

      .msg.assistant ul,
      .msg.assistant ol {
        margin: 0;
        padding-left: 20px;
      }

      .msg.assistant li + li {
        margin-top: 4px;
      }

      .msg.assistant hr {
        width: 100%;
        margin: 2px 0;
        border: 0;
        border-top: 1px solid #ddccb9;
      }

      .msg.assistant th,
      .msg.assistant td {
        border: 1px solid #d9c8b5;
        padding: 6px 8px;
        text-align: left;
      }

      .msg.assistant th {
        background: #fff6ec;
      }

      .msg.user {
        align-self: flex-end;
        background: var(--user);
        color: #fdf8f2;
      }

      .composer {
        border-top: 1px solid var(--line);
        padding: 12px;
        background: #fff;
        max-width: 100%;
      }

      .composer-bar {
        display: flex;
        align-items: center;
        gap: 6px;
        min-width: 0;
        width: 100%;
      }

      .composer-input {
        flex: 1 1 0;
        min-width: 0;
        width: 0;
        border: 1px solid #d8c5ad;
        border-radius: 30px;
        padding: 12px 16px;
        outline: none;
        font: inherit;
        font-size: calc(14px * var(--ui-scale));
      }

      .composer-input:focus {
        border-color: #be9f8a;
      }

      .control-btn {
        border: none;
        border-radius: 999px;
        font: inherit;
        font-weight: 700;
        cursor: pointer;
        display: grid;
        place-items: center;
        flex-shrink: 0;
      }

      .lang-btn {
        min-width: 72px;
        width: auto;
        height: 36px;
        padding: 0 10px;
        background: #f2ede4;
        color: #22160d;
        font-size: calc(13px * var(--ui-scale));
        letter-spacing: 0.3px;
      }

      .lang-btn span {
        display: inline-block;
        font-size: calc(13px * var(--ui-scale));
        line-height: 1;
        white-space: nowrap;
      }

      .voice-btn {
        width: clamp(28px, 12%, 36px);
        height: clamp(28px, 12%, 36px);
        background: #f2ede4;
        color: #5f3c20;
        font-size: 18px;
      }

      .voice-btn svg {
        width: 22px;
        height: 22px;
        display: block;
      }

      .voice-btn.recording {
        background: #ffe0d0;
        color: #992f00;
        box-shadow: 0 0 0 4px rgba(214, 95, 43, 0.18);
      }

      .send-btn {
        width: clamp(32px, 14%, 42px);
        height: clamp(32px, 14%, 42px);
        background: linear-gradient(140deg, #c58b45, #b7782f);
        color: #fff;
        font-size: 22px;
      }

      .send-btn span {
        transform: translateX(1px);
      }

      .composer .control-btn:disabled,
      .composer .composer-input:disabled {
        opacity: 0.5;
        cursor: not-allowed;
      }

      .privacy-notice {
        border-top: 1px solid #c49058;
        background: linear-gradient(180deg, #fffaf2, #fff5e9);
        padding: 8px 12px 9px;
        font-size: calc(12px * var(--ui-scale));
        color: #2e2116;
        line-height: 1.45;
        text-align: center;
      }

      .privacy-notice-link {
        border: 0;
        padding: 0;
        margin: 0;
        background: none;
        color: #4d3929;
        text-decoration: underline;
        text-underline-offset: 2px;
        text-decoration-thickness: 1px;
        font: inherit;
        font-weight: 500;
        cursor: pointer;
      }

      .privacy-notice-link:hover {
        color: #3f2d20;
      }

      .privacy-modal {
        position: absolute;
        inset: 0;
        z-index: 60;
        background: rgba(23, 16, 10, 0.38);
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 10px;
      }

      .privacy-modal[hidden] {
        display: none;
      }

      .privacy-modal-card {
        width: min(100%, calc(500px * var(--ui-scale)));
        max-height: calc(100% - 8px);
        border: 1px solid #dcc9b4;
        border-radius: 14px;
        background: #fffdf8;
        box-shadow: 0 18px 34px rgba(26, 17, 8, 0.26);
        display: grid;
        grid-template-rows: auto minmax(0, 1fr);
        overflow: hidden;
      }

      .privacy-modal-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        padding: 10px 12px;
        border-bottom: 1px solid #e6d8c9;
        background: #fff7ee;
      }

      .privacy-modal-title {
        margin: 0;
        font-size: calc(16px * var(--ui-scale));
        color: #2f2217;
      }

      .privacy-modal-close {
        border: 1px solid #d9c4ae;
        width: 30px;
        height: 30px;
        border-radius: 999px;
        background: #fff;
        color: #684122;
        font-size: 15px;
        line-height: 1;
        display: grid;
        place-items: center;
        cursor: pointer;
      }

      .privacy-modal-close:hover {
        background: #fff5ea;
      }

      .privacy-modal-body {
        overflow-y: auto;
        padding: 12px;
        color: #3a2a1c;
        font-size: calc(13px * var(--ui-scale));
        line-height: 1.55;
      }

      .privacy-modal-body > :first-child {
        margin-top: 0;
      }

      .privacy-modal-body > :last-child {
        margin-bottom: 0;
      }

      .privacy-modal-body h2,
      .privacy-modal-body h3 {
        margin: 0 0 8px;
        line-height: 1.35;
      }

      .privacy-modal-body h2 {
        font-size: calc(17px * var(--ui-scale));
      }

      .privacy-modal-body h3 {
        font-size: calc(14px * var(--ui-scale));
      }

      .privacy-modal-body p {
        margin: 0 0 10px;
      }

      .privacy-modal-body ul {
        margin: 0 0 10px;
        padding-left: 18px;
      }

      .privacy-modal-body li + li {
        margin-top: 4px;
      }

      .privacy-modal-body a {
        color: #7f3212;
      }

      .privacy-modal-body a:hover {
        color: #5f250d;
      }

      .chat[data-lang="ar"] {
        direction: rtl;
        font-family: var(--font-ui-ar);
      }

      .chat[data-lang="ar"] .composer-bar {
        flex-direction: row-reverse;
      }

      .chat[data-lang="ar"] .composer-input {
        text-align: right;
      }

      .chat[data-lang="ar"] .lang-btn {
        min-width: 88px;
      }

      .chat[data-lang="ar"] .lang-btn span {
        direction: ltr;
        unicode-bidi: isolate;
      }

      .chat[data-lang="ar"] .privacy-notice {
        text-align: right;
        font-family: var(--font-ui-ar);
      }

      .chat[data-lang="ar"] .privacy-modal-title,
      .chat[data-lang="ar"] .privacy-modal-body {
        text-align: right;
        font-family: var(--font-ui-ar);
      }

      .chat[data-lang="ar"] .privacy-modal-body ul {
        padding-left: 0;
        padding-right: 18px;
      }

      .chat[data-lang="ar"] .msg.assistant th,
      .chat[data-lang="ar"] .msg.assistant td {
        text-align: right;
      }

      .chat[data-lang="ar"] .msg.assistant ul {
        padding-left: 0;
        padding-right: 18px;
      }

      .chat[data-lang="ar"] .msg.assistant ol {
        padding-left: 0;
        padding-right: 20px;
      }

      @media (max-width: 620px) {
        .launcher {
          right: 14px;
          bottom: 14px;
        }

        .launcher-hint {
          right: 12px;
          bottom: 84px;
          padding: 10px 16px;
          font-size: calc(14px * var(--ui-scale));
        }

        .chat {
          right: 10px;
          left: 10px;
          width: auto;
          bottom: 86px;
          height: min(72vh, 580px);
        }

        .callback-overlay {
          padding: 8px;
        }

        .lang-btn {
          min-width: 66px;
          width: auto;
          height: 34px;
          padding: 0 8px;
        }

        .chat[data-lang="ar"] .lang-btn {
          min-width: 80px;
        }

        .voice-btn {
          width: clamp(26px, 12%, 34px);
          height: clamp(26px, 12%, 34px);
          font-size: 16px;
        }
        .voice-btn svg {
          width: 20px;
          height: 20px;
        }

        .send-btn {
          width: clamp(30px, 14%, 38px);
          height: clamp(30px, 14%, 38px);
          font-size: 19px;
        }

        .privacy-notice {
          padding: 7px 9px 8px;
          font-size: calc(11px * var(--ui-scale));
        }

        .privacy-modal {
          padding: 8px;
        }

        .privacy-modal-body {
          padding: 10px;
          font-size: calc(12px * var(--ui-scale));
        }

        .msg.assistant {
          max-width: 92%;
        }
      }

      @media (max-width: 420px) {
        .chat-head {
          padding: 10px 12px;
        }

        .chat-head-actions {
          gap: 6px;
        }

        .status span:last-child {
          display: none;
        }

        .composer {
          padding: 8px;
        }

        .composer-bar {
          gap: 6px;
        }

        .composer-input {
          padding: 9px 12px;
        }

        .lang-btn span {
          font-size: 11px;
        }

        .send-btn {
          font-size: 17px;
        }
      }
