/* PC simulator is a fixed workspace; only its content panes may scroll. */
@media (min-width: 1101px) {
    html,
    html body {
        height: 100%;
        min-height: 0;
        overflow: hidden; /* viewport-boundary */
    }

    #workspace-shell:not([hidden]) {
        display: flex;
        flex-direction: column;
        width: 100%;
        height: 100vh;
        height: 100dvh;
        min-height: 0;
        overflow: hidden;
    }

    #workspace-shell > .app-header {
        flex: 0 0 58px;
        width: 100%;
        max-width: none;
        padding: 8px 24px;
    }

    #workspace-shell > .app-header .eyebrow {
        display: none;
    }

    #workspace-shell > .app-header h1 {
        font-size: 18px;
    }

    #workspace-shell > .simulator-shell {
        flex: 1 1 auto;
        grid-template-columns: minmax(300px, 0.95fr) minmax(780px, 2.05fr);
        width: 100%;
        max-width: none;
        height: auto;
        min-height: 0;
        padding: 0 18px 18px;
        gap: 12px;
        overflow: hidden;
    }

    #workspace-shell .client-zone,
    #workspace-shell .sales-zone {
        display: flex;
        flex-direction: column;
        height: 100%;
        min-height: 0;
        overflow: hidden;
    }

    #workspace-shell .sales-grid {
        flex: 1 1 auto;
        height: auto;
        min-height: 0;
        overflow: hidden;
    }

    #workspace-shell .contact-rail,
    #workspace-shell .sales-chat,
    #workspace-shell .intelligence-zone,
    #workspace-shell .assistant-panel {
        min-height: 0;
        overflow: hidden;
    }

    #workspace-shell .contact-rail,
    #workspace-shell .sales-chat,
    #workspace-shell .intelligence-zone {
        display: flex;
        flex-direction: column;
    }

    #workspace-shell #contact-list,
    #workspace-shell .message-thread,
    #workspace-shell .coach-output,
    #workspace-shell .profile-scroll {
        min-height: 0;
        overflow-y: auto; /* internal-scroll */
        overscroll-behavior: contain;
    }

    #workspace-shell #contact-list,
    #workspace-shell .message-thread,
    #workspace-shell .coach-output,
    #workspace-shell .profile-scroll {
        scrollbar-width: thin;
        scrollbar-color: #9caea6 transparent;
    }
}

.login-screen {
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
}

.coach-form-actions {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 8px;
}

.analysis-split {
    position: relative;
}

.top-analysis-split {
    margin-left: 4px;
}

.analysis-split-control {
    display: flex;
    align-items: stretch;
}

.analysis-split-control > button {
    min-height: 42px;
    border-color: var(--sales-blue-300);
    color: var(--sales-blue-700);
    background: var(--sales-blue-50);
}

.analysis-split-control > button:hover {
    background: var(--sales-blue-100);
}

.analysis-split-control .analyze-now {
    border-radius: 10px 0 0 10px;
    padding: 0 8px;
    border-color: var(--sales-blue-600);
    background: var(--sales-blue-gradient);
    color: #fff;
    font-weight: 700;
}

.analysis-split-control .analyze-now:hover {
    background: var(--sales-blue-gradient-strong);
}

.analysis-split-control .analysis-mode-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 66px;
    padding: 0 9px;
    border-left: 0;
    border-radius: 0 10px 10px 0;
    font-size: 12px;
}

.analysis-split-control .analyze-now:focus-visible,
.analysis-mode-toggle:focus-visible {
    outline: 3px solid rgb(22 119 255 / 24%);
    outline-offset: 2px;
}

.analysis-mode-toggle svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
}

.analysis-mode-menu {
    position: fixed;
    right: auto;
    top: calc(100% + 8px);
    z-index: 10000;
    width: 286px;
    padding: 6px;
    border: 1px solid var(--sales-blue-200);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 16px 40px rgb(22 119 255 / 18%);
}

.analysis-mode-menu[hidden] {
    display: none;
}

.analysis-mode-menu button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px;
    border: 0;
    border-radius: 8px;
    color: #24342e;
    text-align: left;
    background: var(--sales-blue-50);
    cursor: pointer;
}

.analysis-mode-menu button:hover,
.analysis-mode-menu button[aria-checked="true"] {
    background: var(--sales-blue-50);
}

.analysis-mode-menu button span:first-child {
    display: grid;
    gap: 3px;
}

.analysis-mode-menu small {
    color: #6e7f78;
    font-size: 11px;
}

.analysis-mode-check {
    color: var(--sales-blue-600);
    font-weight: 800;
    opacity: 0;
}

.analysis-mode-menu button[aria-checked="true"] .analysis-mode-check {
    opacity: 1;
}

.follow-up-form {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 12px 16px;
}

#follow-up-dialog .follow-up-tabs[hidden] { display: none; }
.follow-up-tabs {
    display: inline-flex;
    padding: 3px;
    border: 1px solid var(--control-border);
    border-radius: 10px;
    background: var(--control-accent-soft);
}

.follow-up-tabs button {
    min-height: 36px;
    padding: 0 12px;
    border: 0;
    border-radius: 7px;
    color: var(--control-accent);
    background: transparent;
    font-size: 12px;
    font-weight: 800;
}

.follow-up-tabs button[aria-selected="true"] {
    color: #fff;
    background: var(--control-accent);
    box-shadow: 0 5px 14px rgb(128 82 190 / 20%);
}

.follow-up-form label {
    display: grid;
    gap: 6px;
    color: #53645d;
    font-size: 12px;
    font-weight: 700;
}

.follow-up-form input,
.follow-up-form textarea {
    width: 100%;
    border: 1px solid #c8d7d0;
    border-radius: 9px;
    color: #25352f;
    background: #fff;
}

.follow-up-form input {
    min-height: 40px;
    padding: 0 10px;
}

.follow-up-form textarea {
    padding: 9px 10px;
    resize: vertical;
}

.follow-up-form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
}

.follow-up-form-utility { display: flex; align-items: center; gap: 12px; min-width: 0; }
.follow-up-form-commit { display: flex; align-items: center; gap: 9px; margin-left: auto; }

.follow-up-form-actions button {
    min-width: 104px;
}
.follow-up-time-fields { display: grid; grid-template-columns: minmax(0, 1fr) 70px 70px; gap: 10px; margin: 0; padding: 0; border: 0; min-width: 0; }
.follow-up-time-fields legend { margin-bottom: 8px; font-size: 13px; font-weight: 700; }
.follow-up-time-fields label { min-width: 0; }
.follow-up-time-fields input, .follow-up-time-fields select { width: 100%; min-width: 0; height: 44px; padding: 6px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--paper); font: inherit; }
.follow-up-form .follow-up-stop-label { display: inline-flex; flex-direction: row; align-items: center; gap: 7px; margin: 0; white-space: nowrap; }
.follow-up-form .follow-up-stop-label[hidden] { display: none; }
.follow-up-form .follow-up-stop-label input { width: 18px; height: 18px; min-height: 0; padding: 0; }
.follow-up-task-title-row { display: flex; align-items: center; gap: 12px; }
.follow-up-unread-filter { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-600); font-size: 11px; font-weight: 700; cursor: pointer; }
.follow-up-unread-filter input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.follow-up-unread-filter span { position: relative; width: 28px; height: 16px; border-radius: 999px; background: var(--ink-400); transition: background 150ms ease; }
.follow-up-unread-filter span::after { position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(23, 32, 29, 0.24); content: ""; transition: transform 150ms ease; }
.follow-up-unread-filter input:checked + span { background: var(--control-accent); }
.follow-up-unread-filter input:checked + span::after { transform: translateX(12px); }
.follow-up-unread-filter input:focus-visible + span { outline: 3px solid #d9c6f1; outline-offset: 2px; }

.follow-up-list-title {
    margin: 0 0 8px;
    color: #34463f;
    font-size: 13px;
}

:root {
    --ink-950: #17201d;
    --ink-800: #2d3935;
    --ink-600: #62706b;
    --ink-400: #929d99;
    --line: #dbe3df;
    --line-strong: #c7d3ce;
    --paper: #fffefb;
    --paper-soft: #f7f9f7;
    --canvas: #eef3ef;
    --pine-700: #116345;
    --pine-600: #167a55;
    --pine-500: #209567;
    --pine-100: #e3f3ea;
    --amber-700: #985d0a;
    --amber-100: #fff1d6;
    --danger: #b33a35;
    --shadow: 0 22px 60px rgba(29, 54, 43, 0.12);
    --radius-xl: 22px;
    --radius-lg: 16px;
    --radius-md: 11px;
    --font-ui: "HarmonyOS Sans SC", "MiSans", "Source Han Sans SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { min-width: 320px; background: var(--canvas); }

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink-950);
    background:
        radial-gradient(circle at 10% -10%, rgba(32, 149, 103, 0.15), transparent 31rem),
        linear-gradient(145deg, #f6f4ed 0%, var(--canvas) 44%, #e7efeb 100%);
    font-family: var(--font-ui);
    font-size: 15px;
    line-height: 1.55;
}

button, textarea, input, select { font: inherit; }
button { color: inherit; }

button, [role="button"], textarea, input, select { min-height: 44px; }

button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.55; }

:focus-visible {
    outline: 3px solid rgba(32, 149, 103, 0.35);
    outline-offset: 2px;
}

.skip-link {
    position: fixed;
    z-index: 100;
    top: 8px;
    left: 8px;
    padding: 8px 12px;
    color: #fff;
    background: var(--pine-700);
    transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

.page-atmosphere {
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.28;
    background-image: linear-gradient(rgba(17, 99, 69, 0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(17, 99, 69, 0.04) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: linear-gradient(to bottom, #000, transparent 75%);
}

.app-header {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: end;
    justify-content: space-between;
    max-width: 1820px;
    margin: 0 auto;
    padding: 22px 28px 15px;
}

.app-header h1, .zone-header h2, .dialog-header h2 { margin: 0; letter-spacing: -0.035em; }
.app-header h1 { font-size: clamp(22px, 2.2vw, 34px); font-weight: 760; }
.eyebrow, .zone-kicker { margin: 0 0 2px; color: var(--pine-600); font-size: 11px; font-weight: 800; letter-spacing: 0.16em; }

.header-status, .connection-state, .account-pill, .manual-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--ink-600);
    font-size: 12px;
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pine-500); box-shadow: 0 0 0 5px var(--pine-100); }

.simulator-shell {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(280px, 0.72fr) minmax(760px, 2.28fr);
    gap: 14px;
    max-width: 1820px;
    min-height: calc(100vh - 104px);
    margin: 0 auto;
    padding: 0 18px 18px;
}

.app-surface {
    overflow: hidden;
    border: 0;
    border-radius: var(--radius-xl);
    background: rgba(255, 254, 251, 0.91);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.client-zone, .sales-zone { display: flex; min-height: 0; flex-direction: column; }
.zone-header { display: flex; min-height: 70px; align-items: center; justify-content: space-between; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.zone-header h2 { font-size: 18px; }
.connection-state { color: var(--pine-700); }
.account-pill, .manual-badge { padding: 5px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper-soft); }

.contact-title {
    display: flex;
    min-height: 58px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 14px;
    border-bottom: 1px solid var(--line);
    background: var(--paper);
}
.contact-title > div:first-child, .compact-title { display: flex; flex-direction: column; }
.contact-title strong { font-size: 16px; }
.contact-title span { color: var(--ink-600); font-size: 12px; }

.message-thread {
    overflow-y: auto;
    min-height: 0;
    flex: 1;
    padding: 16px 14px;
    scrollbar-color: var(--line-strong) transparent;
    scrollbar-width: thin;
}

.message-row { display: flex; margin: 0 0 14px; }
.message-row.outgoing { justify-content: flex-end; }
.message-bubble { max-width: 84%; padding: 9px 11px; border-radius: 4px 14px 14px; background: #fff; box-shadow: 0 3px 14px rgba(37, 59, 49, 0.08); white-space: pre-wrap; overflow-wrap: anywhere; }
.message-row.outgoing .message-bubble { border-radius: 14px 4px 14px 14px; background: #c9f0d6; }
.message-time { display: block; margin-top: 4px; color: var(--ink-400); font-size: 10px; text-align: right; }
.coach-reply-outcome { position: relative; z-index: 5; margin: 0 12px 10px; overflow: visible; border: 1px solid var(--sales-blue-200); border-radius: 10px; background: var(--sales-blue-50); }
.coach-reply-outcome.is-expanded { z-index: 15; }
.coach-reply-outcome-header { display: flex; align-items: stretch; min-width: 0; }
.coach-reply-outcome-toggle { display: grid; flex: 1; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; min-width: 0; min-height: 44px; padding: 7px 10px; gap: 8px; border: 0; color: var(--ink-700); background: transparent; text-align: left; cursor: pointer; }
.coach-reply-outcome-toggle:hover, .coach-reply-outcome-toggle:focus-visible { background: var(--sales-blue-100); }
.coach-reply-outcome-label { color: var(--ink-500); font-size: 12px; font-weight: 750; white-space: nowrap; }
.coach-reply-outcome-status { display: inline-flex; align-items: center; min-height: 23px; padding: 2px 9px; border-radius: 999px; font-size: 12px; line-height: 1; white-space: nowrap; }
.coach-reply-outcome.is-progressed .coach-reply-outcome-status { color: var(--sales-blue-700); background: var(--sales-blue-100); }
.coach-reply-outcome.is-steady .coach-reply-outcome-status { color: #59645f; background: #edf0ee; }
.coach-reply-outcome.is-regressed .coach-reply-outcome-status { color: #a52d2d; background: #ffe5e2; }
.coach-reply-outcome-summary { min-width: 0; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.coach-reply-outcome-chevron { display: grid; width: 20px; height: 20px; place-items: center; transition: transform 180ms ease; }
.coach-reply-outcome-chevron svg { width: 14px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.coach-reply-outcome.is-expanded .coach-reply-outcome-chevron { transform: rotate(180deg); }
.coach-reply-outcome-asset { align-self: center; min-height: 36px; margin: 4px 7px 4px 0; padding: 5px 9px; border: 1px solid var(--sales-blue-300); border-radius: 8px; color: var(--sales-blue-700); background: #fff; font-size: 11px; font-weight: 800; white-space: nowrap; cursor: pointer; }
.coach-reply-outcome-asset:hover, .coach-reply-outcome-asset:focus-visible { color: #fff; background: var(--sales-blue-gradient); }
.coach-reply-outcome-details { position: absolute; right: 0; bottom: calc(100% + 6px); left: 0; z-index: 13; padding: 9px 10px; border: 1px solid var(--sales-blue-200); border-radius: 10px; background: #fff; box-shadow: 0 16px 34px rgba(22, 119, 255, 0.16); pointer-events: none; }
.coach-reply-outcome-details .coach-brief-row { margin: 0 0 7px; }
.coach-reply-outcome-details .coach-brief-row:last-child { margin-bottom: 0; }
.coach-reply-outcome-details .coach-brief-row strong { font-size: 11px; }
.coach-reply-outcome-details .coach-brief-row span { font-size: 12px; line-height: 1.55; }
@media (prefers-reduced-motion: reduce) { .coach-reply-outcome-chevron { transition: none; } }

.chat-composer, .coach-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; padding: 12px; border-top: 1px solid var(--line); background: var(--paper); }
.customer-composer-tools {display:flex; align-items:center; gap:7px; flex:none; padding:5px 14px 2px; background:#fff; border-top:1px solid var(--line);}
.customer-composer-tools .composer-tool {display:grid; place-items:center; width:34px; height:34px; min-height:0; padding:6px; border:0; border-radius:8px; background:transparent; color:#606367; box-shadow:none; cursor:pointer;}
.customer-composer-tools .composer-tool:hover, .customer-composer-tools .composer-tool[aria-expanded="true"] {background:#f0f1f3; color:#1e965b;}
.customer-composer-tools .composer-tool:focus-visible {outline:2px solid #53b889; outline-offset:2px;}
.composer-tool svg {width:23px; height:23px; fill:none; stroke:currentColor; stroke-width:1.65; stroke-linecap:round; stroke-linejoin:round;}
.customer-question-menu {position:fixed; inset:auto; margin:0; box-sizing:border-box; padding:8px; border:1px solid #e4e5e8; border-radius:14px; background:#fff; box-shadow:0 8px 30px rgb(30 40 50 / 14%); overflow:auto; overscroll-behavior:contain;}
.customer-question-menu::backdrop {background:transparent;}
.customer-question-menu p {margin:3px 9px 7px; font-size:12px; color:#86868b;}
.customer-question-menu button {display:block; width:100%; min-height:36px; text-align:left; padding:8px 10px; border:0; border-radius:8px; background:transparent; color:#343840; box-shadow:none; font-size:13px; font-weight:400; cursor:pointer;}
.customer-question-menu button:hover, .customer-question-menu button:focus-visible {background:#edf7f1; outline:none; color:#137946;}
.customer-image-preview {display:flex; align-items:center; gap:10px; flex:none; padding:8px 16px; background:#fff; font-size:12px; color:#6e6e73;}
.customer-image-preview[hidden] {display:none;}
.customer-image-preview img {width:58px; height:58px; object-fit:cover; border:1px solid #e5e5ea; border-radius:8px;}
.customer-image-preview button {margin-left:auto; width:28px; min-height:28px; padding:0; border:0; background:#f3f3f5; border-radius:50%; color:#6e6e73;}
.message-image {display:block; width:200px; max-width:100%; max-height:260px; min-height:80px; object-fit:contain; border-radius:9px; background:rgb(255 255 255 / 70%); margin-bottom:5px;}
.coach-chat-answer-paragraph { margin: 0; }
.coach-chat-answer-paragraph + .coach-chat-answer-paragraph { margin-top: 16px; }
.coach-chat-answer-paragraph:first-child { margin-top: 0; }
.coach-chat-answer-lead { color: inherit; font-weight: inherit; }
.coach-chat-answer-list { margin: 16px 0 0; padding-left: 1.25em; }
.coach-chat-answer-list li + li { margin-top: 6px; }
.coach-chat-answer-list li span { display: block; }
.coach-chat-answer-list li span + span { margin-top: 16px; }
.coach-raw-reply-item { display: flex; align-items: stretch; gap: 8px; }
#app .coach-raw-reply-item.has-reply-feedback, #app .reply-option.has-reply-feedback { position: relative; padding-bottom: 34px; }
.reply-feedback { position: absolute; right: 6px; bottom: 3px; display: flex; gap: 6px; height: 28px; }
.reply-feedback-button { display: inline-flex; align-items: center; justify-content: center; width: 30px; min-width: 30px; height: 28px; min-height: 28px; padding: 5px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--ink-600); cursor: pointer; }
.reply-feedback-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.reply-feedback-button[data-reply-vote="-1"] svg { transform: rotate(180deg); }
.reply-feedback-button:hover, .reply-feedback-button:focus-visible { color: var(--sales-blue-700); border-color: var(--sales-blue-300); background: var(--sales-blue-50); outline: none; }
.reply-feedback-button[aria-pressed="true"] { color: var(--sales-blue-700); border-color: var(--sales-blue-300); background: var(--sales-blue-100); }
.reply-feedback-button:disabled { opacity: 0.45; cursor: not-allowed; }
@media (pointer: coarse) { .reply-feedback { height: 36px; } .reply-feedback-button { width: 36px; height: 36px; } #app .coach-raw-reply-item.has-reply-feedback, #app .reply-option.has-reply-feedback { padding-bottom: 42px; } }
.coach-raw-reply { display: block; width: 100%; min-width: 0; margin: 0; padding: 8px 10px; border: 0; border-radius: 6px; color: inherit; background: transparent; font: inherit; line-height: inherit; text-align: left; cursor: pointer; transition: background 140ms ease, box-shadow 140ms ease; }
.coach-raw-reply:hover, .coach-raw-reply:focus-visible { outline: none; background: var(--sales-blue-100); box-shadow: inset 3px 0 0 var(--sales-blue-500); }
.coach-chat-loading { display: inline-flex; align-items: center; gap: 5px; min-height: 18px; }
.coach-chat-loading-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--pine-600); animation: coach-chat-dot 1.1s ease-in-out infinite; }
.coach-chat-loading-dot:nth-child(2) { animation-delay: 0.14s; }
.coach-chat-loading-dot:nth-child(3) { animation-delay: 0.28s; }
@keyframes coach-chat-dot { 0%, 60%, 100% { opacity: 0.3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
textarea, input, select { width: 100%; border: 1px solid var(--line-strong); border-radius: var(--radius-md); color: var(--ink-950); background: #fff; }
textarea { min-height: 72px; padding: 10px 11px; line-height: 1.55; resize: vertical; }
input, select { padding: 9px 11px; }
textarea::placeholder, input::placeholder { color: var(--ink-400); }

#coach-output .reply-option {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
    gap: 8px;
    padding: 0;
    border-top: 1px solid var(--line);
    background: transparent;
    transition: background-color 150ms ease, box-shadow 150ms ease;
}

#coach-output .reply-option:hover,
#coach-output .reply-option:focus-within {
    background: var(--sales-blue-50);
    box-shadow: inset 3px 0 0 var(--sales-blue-500);
}

.reply-option-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 13px 6px 13px 14px;
    border: 0;
    color: var(--ink-950);
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.reply-option-main:disabled { cursor: default; }

#sales-coach-panel .sales-stage-progress,
#sales-coach-panel .coach-sales-brief { display: none !important; }

#current-account-name .account-switch-button:nth-child(n + 2) { display: none !important; }

.reply-option-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    justify-content: flex-start;
    width: 26px;
    flex: 0 0 26px;
    padding: 4px 0;
}

.reply-option-icon {
    display: grid;
    width: 30px;
    height: 30px;
    min-height: 30px;
    flex: 0 0 30px;
    place-items: center;
    border: 0;
    border-radius: 50%;
    color: var(--pine-700);
    background: var(--sales-blue-50);
    cursor: pointer;
}

.reply-option-icon:hover,
.reply-option-icon:focus-visible {
    color: #fff;
    background: var(--pine-600);
}

.reply-option-icon svg {
    width: 17px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.coach-raw-reply {
    position: relative;
    padding-right: 38px;
}

.coach-raw-reply-asset {
    position: absolute;
    top: 4px;
    right: 0;
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 7px;
    color: var(--pine-700);
    background: transparent;
    cursor: pointer;
}

.coach-raw-reply-asset:hover,
.coach-raw-reply-asset:focus-visible {
    color: #fff;
    background: var(--pine-600);
}

.coach-raw-reply-asset svg {
    width: 17px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.coach-draft-asset-button {
    align-self: end;
    min-width: 108px;
    padding: 10px 14px;
    border: 1px solid var(--pine-500);
    border-radius: var(--radius-md);
    color: var(--pine-700);
    background: #fff;
    font-weight: 700;
    cursor: pointer;
}

.coach-draft-asset-button:hover { background: var(--pine-100); }

.ai-zone-header { min-height: 58px; }

.intelligence-zone {
    grid-template-rows: auto minmax(0, 1fr);
}

.intelligence-zone .assistant-panel {
    min-height: 0;
}

.intelligence-zone .coach-panel {
    grid-template-rows: minmax(0, 1fr) auto auto;
}

.assistant-header-actions,
.assistant-icon-tabs {
    display: flex;
    align-items: center;
    gap: 1px;
}

.assistant-header-actions { margin-left: auto; }
#app .zone-header > .assistant-header-actions { gap: 1px; }
#app .zone-header > .assistant-header-actions > #open-personal-ai-settings { width: 38px; min-width: 38px; height: 44px; border-radius: 12px; }

.assistant-icon-button,
.coach-settings-button {
    display: grid;
    width: 38px;
    min-width: 38px;
    height: 44px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 12px;
    color: var(--ink-500);
    background: transparent;
    cursor: pointer;
    transition: color 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
}

.assistant-icon-button:hover,
.assistant-icon-button:focus-visible,
.coach-settings-button:hover,
.coach-settings-button:focus-visible {
    color: var(--pine-700);
    background: var(--pine-100);
    box-shadow: inset 0 0 0 1px var(--sales-blue-200);
}

.assistant-icon-button[aria-selected="true"] {
    color: #fff;
    background: var(--pine-600);
}

.assistant-icon-button svg {
    width: 23px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.grading-tab-icon {
    display: grid;
    width: 23px;
    height: 23px;
    place-items: center;
    color: currentColor;
}
.grading-tab-icon > svg { display: block; width: 23px; height: 23px; }
.grading-tab-letter { display: none; font-size: 20px; font-weight: 900; line-height: 1; }
.grading-tab-icon.is-graded > svg { display: none; }
.grading-tab-icon.is-graded .grading-tab-letter { display: block; }
.grading-tab-icon .grading-tab-star { display: none; width: 10px; height: 10px; margin-right: 1px; color: #e9a300; }
.grading-tab-icon.is-priority { display: flex; align-items: center; justify-content: center; width: 29px; }
.grading-tab-icon.is-priority .grading-tab-star { display: block; }
.grading-tab-icon.is-priority .grading-tab-letter { font-size: 18px; }
.assistant-icon-button .grading-tab-icon.is-graded { color: #6e6e73; }

.assistant-icon-button.follow-up-button {
    position: relative;
    color: var(--pine-700);
    background: transparent;
}

.assistant-icon-button.follow-up-button:hover,
.assistant-icon-button.follow-up-button:focus-visible { background: var(--pine-100); }

.coach-panel .coach-toolbar {
    flex: 0 0 auto;
    padding: 8px 12px;
    border-top: 1px solid var(--line);
    border-bottom: 0;
    background: var(--paper);
}

.coach-panel .coach-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
}
#reply-action-status { align-self: center; margin-left: 6px; color: #8e8e93; font-size: 12px; font-weight: 400; }

.coach-panel .coach-quick-actions .text-button {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 6px 10px;
    border: 1px solid var(--sales-blue-300);
    border-radius: 9px;
    color: var(--pine-700);
    background: #fff;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.coach-icon-action {
    display: grid;
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: var(--pine-700);
    background: transparent;
    cursor: pointer;
    transition: color 140ms ease, background-color 140ms ease;
}

.coach-icon-action:hover,
.coach-icon-action:focus-visible {
    color: #fff;
    background: var(--pine-600);
}

.coach-icon-action:disabled {
    cursor: default;
    opacity: 0.45;
}

.coach-icon-action svg {
    width: 19px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.coach-icon-action svg .coach-icon-glyph {
    fill: currentColor;
    stroke: none;
    font-family: "Microsoft YaHei", "微软雅黑", sans-serif;
    font-size: 16px;
    font-weight: 850;
}

.coach-panel .coach-quick-actions .text-button:hover,
.coach-panel .coach-quick-actions .text-button:focus-visible {
    color: #fff;
    background: var(--pine-600);
}


.contact-delete-button {
    display: grid;
    width: 26px;
    min-width: 26px;
    height: 26px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 7px;
    color: #aab5b0;
    background: transparent;
    opacity: 0.58;
    cursor: pointer;
}

.contact-delete-button svg {
    width: 15px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-width: 1.7;
}

.contact-delete-button:hover,
.contact-delete-button:focus-visible {
    color: #c93030;
    background: transparent;
    opacity: 1;
}

@media (max-width: 1180px) {
}

.primary-button {
    align-self: end;
    min-width: 78px;
    padding: 10px 16px;
    border: 0;
    border-radius: var(--radius-md);
    color: #fff;
    background: linear-gradient(135deg, var(--pine-500), var(--pine-700));
    box-shadow: 0 7px 18px rgba(17, 99, 69, 0.2);
}
.primary-button:hover { filter: brightness(1.04); }

.sales-grid { display: grid; grid-template-columns: 190px minmax(285px, 0.85fr) minmax(390px, 1.15fr); min-height: 0; flex: 1; }
.contact-rail, .sales-chat, .intelligence-zone { min-width: 0; min-height: 0; }
.contact-rail { overflow-y: auto; border-right: 1px solid var(--line); background: var(--paper-soft); }
.rail-heading { display: flex; align-items: center; justify-content: space-between; padding: 13px 12px 8px; color: var(--ink-600); font-size: 12px; }
.rail-heading span { min-width: 22px; border-radius: 999px; color: var(--pine-700); background: var(--pine-100); text-align: center; }

/* contact-delete-overlay */
.contact-row { position: relative; display: block; }
.contact-item { display: block; width: 100%; min-width: 0; min-height: 64px; padding: 10px 38px 10px 12px; border: 0; border-left: 3px solid transparent; background: transparent; text-align: left; }
.contact-item:hover { background: rgba(228, 240, 255, 0.65); }
.contact-item.is-selected { border-left-color: var(--sales-blue-500); background: var(--sales-blue-100); }
.contact-delete-button { position: absolute; top: 5px; right: 5px; z-index: 1; width: 26px; min-width: 26px; height: 26px; margin: 0; padding: 0; border: 1px solid transparent; border-radius: 7px; color: var(--ink-600); background: transparent; font-size: 10px; opacity: 0.5; }
.contact-row:hover .contact-delete-button, .contact-delete-button:focus-visible { border-color: transparent; color: var(--ink-600); background: transparent; opacity: 1; }
.contact-delete-button:hover { border-color: transparent; color: #c93030; background: transparent; }
.contact-delete-button:disabled { cursor: not-allowed; opacity: 0.45; }
.contact-item-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.contact-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-preview { display: block; overflow: hidden; margin-top: 3px; color: var(--ink-600); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.contact-sales-names { display: block; overflow: hidden; margin-top: 3px; color: var(--ink-600); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }

.sales-chat { display: flex; flex-direction: column; border-right: 1px solid var(--line); background: #f2f5f3; }
.sales-composer textarea { min-height: 92px; }

.intelligence-zone { display: flex; flex-direction: column; background: linear-gradient(180deg, #f7fbff 0%, #ffffff 28%, #f4f9ff 100%); }
.ai-zone-header { position: relative; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 8px; overflow: visible; }
.coach-settings-button { display: inline-grid; width: 38px; min-width: 38px; height: 44px; place-items: center; padding: 0; border: 0; border-radius: 12px; color: var(--pine-700); background: transparent; }
.coach-settings-button:hover { background: var(--pine-100); }
.coach-settings-button svg { width: 23px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
#app #open-personal-ai-settings svg { display: block; width: 23px; height: 23px; }
.follow-up-button { position: relative; display: grid; width: 38px; min-width: 38px; place-items: center; border: 0; border-radius: 12px; color: var(--pine-600); background: var(--pine-100); }
.follow-up-button svg { width: 23px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; transform: translateY(.5px); }
.notification-badge { position: absolute; z-index: 30; top: -4px; right: -4px; left: auto; min-width: 16px; height: 16px; padding: 0 3px; border: 1px solid var(--paper); border-radius: 999px; color: #fff; background: #2f6bff; font-size: 9px; line-height: 14px; text-align: center; }

.assistant-tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.assistant-tabs button { position: relative; border: 0; color: var(--ink-600); background: transparent; font-size: 15px; font-weight: 680; }
.assistant-tabs button[aria-selected="true"] { color: var(--pine-700); }
.assistant-tabs button[aria-selected="true"]::after { position: absolute; right: 24%; bottom: -1px; left: 24%; height: 3px; border-radius: 3px 3px 0 0; background: var(--pine-500); content: ""; }

.assistant-panel { min-height: 0; flex: 1; }
.coach-panel { display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.coach-toolbar { display: flex; min-height: 38px; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 12px; border-bottom: 1px solid var(--line); color: var(--ink-600); font-size: 11px; }
.coach-toolbar > div { display: flex; gap: 4px; }
.coach-source-status { min-width: 0; align-items: center; }
.personal-preference-applied { max-width: 175px; overflow: hidden; padding: 2px 6px; border: 1px solid var(--pine-200); border-radius: 999px; color: var(--pine-700); background: var(--pine-50); font-size: 10px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.text-button { min-height: 32px; padding: 3px 7px; border: 0; color: var(--pine-700); background: transparent; font-size: 12px; font-weight: 700; }
.text-button:hover { text-decoration: underline; }

.coach-output, .profile-scroll { overflow-y: auto; min-height: 0; padding: 14px 16px 22px; scrollbar-color: var(--line-strong) transparent; scrollbar-width: thin; }
#sales-coach-panel .coach-output { padding-top: 3px; }
.coach-output h3, .profile-scroll h3 { margin: 15px 0 4px; font-size: 14px; letter-spacing: -0.01em; }
.coach-output h3:first-child, .profile-scroll h3:first-child { margin-top: 0; }
.coach-output p, .coach-output li { margin: 0; white-space: pre-wrap; }
.sales-stage-progress { position: relative; z-index: 4; margin-bottom: 5px; }
.stage-progress-toggle { display: grid; width: 100%; min-height: 58px; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 9px; padding: 7px 9px; border: 0; border-radius: 9px; color: var(--ink-800); background: var(--pine-50); text-align: left; cursor: pointer; }
.stage-progress-title { color: var(--pine-700); font-weight: 850; white-space: nowrap; }
.stage-progress-milestones { display: grid; min-width: 0; grid-template-columns: repeat(4, minmax(42px, 1fr)); gap: 2px; margin: 0; padding: 0; list-style: none; }
.stage-progress-step { display: grid; min-width: 0; grid-template-columns: 18px minmax(0, 1fr); align-items: center; column-gap: 4px; padding: 5px 8px 5px 12px; border: 0; border-radius: 6px; color: var(--ink-500); background: rgba(255, 255, 255, 0.72); }
.stage-progress-step:first-child { padding-left: 7px; }
.stage-progress-step-marker { display: grid; width: 18px; height: 18px; place-items: center; border-radius: 50%; color: var(--ink-500); background: var(--paper-soft); font-size: 10px; font-weight: 900; }
.stage-progress-step strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.stage-progress-step-state { grid-column: 2; color: inherit; font-size: 9px; line-height: 1; white-space: nowrap; }
.stage-progress-step:not(.is-current):not(.is-complete) { border-color: #e3e7e5; color: #9ba4a0; background: #f4f6f5; }
.stage-progress-step.is-complete { border-color: #b9dfcf; color: var(--pine-700); background: #eefaf4; }
.stage-progress-step.is-complete .stage-progress-step-marker { color: #fff; background: var(--pine-600); }
.stage-progress-step.is-current { border-color: var(--pine-600); color: #fff; background: linear-gradient(135deg, var(--pine-600), var(--pine-700)); box-shadow: 0 4px 10px rgba(22, 124, 82, 0.18); }
.stage-progress-step.is-current .stage-progress-step-marker { color: var(--pine-700); background: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.22); }
.stage-progress-step.is-current strong { color: #fff; font-size: 13px; font-weight: 900; }
.stage-progress-step.is-current .stage-progress-step-state { color: rgba(255, 255, 255, 0.9); font-size: 10px; font-weight: 750; }
.sales-stage-progress.has-exception .stage-progress-step.is-current { color: #fff; background: linear-gradient(135deg, #d58a00, #b86d00); box-shadow: 0 4px 10px rgba(184, 109, 0, 0.2); }
.sales-stage-progress.has-ended .stage-progress-step.is-current { background: #727b77; box-shadow: none; }
.stage-objection-branch { display: flex; align-items: center; gap: 8px; margin: 5px 24px 0 auto; width: max-content; max-width: calc(100% - 48px); padding: 6px 10px 6px 26px; border: 1px solid #edc270; border-radius: 0 0 9px 9px; color: #835000; background: #fff7e6; font-size: 11px; position: relative; }
.stage-objection-branch::before { position: absolute; top: -10px; left: 10px; width: 12px; height: 14px; border-bottom: 2px solid #d58a00; border-left: 2px solid #d58a00; content: ""; }
.stage-objection-branch strong { font-size: 12px; }
.stage-objection-branch span { color: #9b6509; }
.has-ended .stage-objection-branch { border-color: #cfd5d2; color: #59615d; background: #f1f3f2; }
.has-ended .stage-objection-branch::before { border-color: #858d89; }
.customer-emotion { border-radius: 10px; }
.customer-emotion.is-positive { color: #0d6b45; background: #dff6e9; }
.customer-emotion.is-neutral { color: #56615c; background: #edf0ee; }
.customer-emotion.is-unknown { color: #56615c; background: #edf0ee; }
.customer-emotion.is-cautious { color: #805800; background: #fff1bc; }
.customer-emotion.is-resistant { color: #a32626; background: #ffe0dc; }
.customer-insight-rail { display: flex; width: 72px; grid-row: 1 / span 3; grid-column: 1; align-self: start; flex-direction: column; align-items: stretch; gap: 4px; }
.customer-emotion.is-brief { display: grid; width: 72px; height: 72px; min-width: 72px; flex: 0 0 72px; place-content: center; justify-items: center; gap: 3px; padding: 0; box-sizing: border-box; }
.customer-emotion-emoji { font-size: 27px; line-height: 1; }
.customer-emotion-label { font-size: 13px; font-weight: 900; line-height: 1.1; }
.customer-profile-tag { display: block; overflow: hidden; padding: 4px 3px; border-radius: 5px; color: var(--sales-blue-700); background: var(--sales-blue-100); font-size: 11px; font-weight: 800; line-height: 1.15; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.sales-stage-progress.has-exception .stage-progress-toggle { background: #fff8e9; }
.sales-stage-progress.has-exception .stage-progress-title { color: var(--ink-700); }
.stage-progress-popover { display: none; position: absolute; top: calc(100% + 6px); right: 0; left: 0; z-index: 12; padding: 13px; border: 1px solid var(--line-strong); border-radius: 11px; background: var(--paper); box-shadow: 0 16px 34px rgba(18, 43, 32, 0.17); pointer-events: none; }
.sales-stage-progress.is-expanded .stage-progress-popover { display: block; }
.stage-popover-current { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding-bottom: 9px; border-bottom: 1px solid var(--line); }
.stage-popover-current span { color: var(--ink-600); font-size: 11px; }
.stage-popover-current strong { color: var(--pine-700); font-size: 14px; }
.stage-group-label { margin: 11px 0 6px !important; color: var(--ink-600); font-size: 11px; font-weight: 750; }
.stage-main-map, .stage-exception-map { display: grid; margin: 0; padding: 0; list-style: none; }
.stage-main-map { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
.stage-exception-map { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
.stage-map-item { display: grid; min-width: 0; gap: 2px; padding: 7px 3px; border-radius: 7px; color: var(--ink-600); background: var(--paper-soft); text-align: center; }
.stage-map-code { font-size: 10px; font-weight: 800; }
.stage-map-item strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.stage-map-item.is-complete { color: var(--pine-700); background: var(--pine-50); }
.stage-map-item.is-current { color: #fff; background: var(--pine-700); }
.stage-exception-map .stage-map-item.is-current { color: #fff; background: var(--amber-700); }
.coach-sales-brief { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 7px 10px; padding: 2px 0 10px; border-bottom: 1px solid var(--line); }
.coach-sales-brief > .coach-brief-row { grid-column: 2; }
.coach-sales-brief > .coach-brief-risk { grid-column: 2; }
.coach-sales-brief.has-no-insight > .coach-brief-row { grid-column: 1 / -1; }
.coach-brief-row { display: grid; grid-template-columns: 68px minmax(0, 1fr); gap: 8px; align-items: start; line-height: 1.55; }
.coach-brief-row strong { color: var(--ink-600); font-size: 12px; }
.coach-brief-row span { color: var(--ink-800); }
.coach-brief-state span { color: var(--pine-700); font-weight: 800; }
.coach-brief-risk span { color: var(--amber-700); font-weight: 700; }
#app #coach-output h3 { margin: 14px 0 6px; padding-top: 10px; border-top: 1px solid var(--line); line-height: 1.55; }
#app #coach-output section:first-of-type h3 { margin-top: 0; padding-top: 0; border-top: 0; }
#app #coach-output h3 + p { margin-bottom: 13px; line-height: 1.7; }
.coach-output ul { margin: 4px 0 0; padding-left: 18px; }
.coach-output li { margin: 3px 0; }
.accent-heading { color: var(--pine-700); }
.warning-heading { color: var(--amber-700); }
.coach-follow-up { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; margin-top: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.coach-follow-up h3 { margin: 0 0 3px; color: var(--amber-700); }
.coach-follow-up strong { font-size: 13px; }
.coach-follow-up p { margin-top: 3px; color: var(--ink-600); font-size: 12px; }
.follow-up-suggestion-action { min-height: 34px; padding: 4px 10px; border: 1px solid var(--amber-500); border-radius: 9px; color: var(--amber-700); background: #fffaf0; font-weight: 750; }
.follow-up-suggestion-action:hover { color: #fff; background: var(--amber-700); }
.analysis-retry-button { margin-left: auto; min-height: 28px; padding: 3px 10px; border: 1px solid var(--pine-500); border-radius: 8px; color: var(--pine-700); background: var(--paper); font: inherit; font-weight: 750; cursor: pointer; }
.analysis-retry-button:hover { color: #fff; background: var(--pine-600); }
.reply-option { display: grid; width: 100%; grid-template-columns: minmax(0, 1fr) 42px; align-items: center; gap: 10px; margin-top: 8px; padding: 13px 0 10px; border: 0; border-top: 1px solid var(--line); color: var(--ink-800); background: transparent; font: inherit; text-align: left; cursor: pointer; }
.reply-option:hover:not(:disabled) { padding-right: 8px; padding-left: 8px; border-radius: 8px; background: var(--pine-100); }
.reply-option.is-hovered:not(:disabled) { padding-right: 8px; padding-left: 8px; border-radius: 8px; background: var(--sales-blue-100); box-shadow: inset 0 0 0 1px rgb(22 119 255 / 22%), 0 3px 10px rgb(22 119 255 / 8%); }
.reply-option:focus-visible { outline: 2px solid var(--pine-500); outline-offset: -2px; }
.reply-option:disabled { cursor: default; }
.reply-option-text { white-space: pre-wrap; }
.coach-empty { display: grid; min-height: 220px; place-items: center; color: var(--ink-600); text-align: center; }
.coach-form textarea { min-height: 68px; max-height: 180px; overflow-y: hidden; resize: none; }
.coach-send { min-width: 82px; }

#app .coach-output-scroll { min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-color: var(--line-strong) transparent; scrollbar-width: thin; }
#app .coach-output-scroll > .coach-output { min-height: auto; overflow: visible; padding-bottom: 6px; }
#app .coach-output-scroll > .coach-toolbar { position: static; margin-top: 0; border-top: 0; border-bottom: 0; background: #fff; }
#app .coach-output-scroll > .coach-toolbar .coach-quick-actions { justify-content: flex-start; }

.coach-analysis-document { margin: 0; padding: 12px 0 20px; border: 0; background: transparent; color: var(--ink-900); }
#app #coach-output .coach-analysis-document .coach-chat-markdown-heading { margin: 0 0 10px; padding-top: 0; border-top: 0; }
#app #coach-output .coach-analysis-document > .coach-chat-markdown-heading { margin-bottom: 18px; }
.coach-analysis-section + .coach-analysis-section { margin-top: 22px; }
.coach-analysis-document .coach-chat-answer-paragraph { line-height: 1.8; white-space: pre-wrap; }
.coach-analysis-document .coach-chat-answer-list { margin-top: 8px; line-height: 1.75; }

.profile-panel:not([hidden]) { display: flex; flex-direction: column; overflow: hidden; }
.profile-panel .profile-scroll { display: flex; flex-direction: column; gap: 12px; flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
.profile-section { padding: 14px 0; border-bottom: 1px solid var(--line); }
.profile-section:first-child { padding-top: 0; }
.customer-grading-manual-override { display: grid; grid-template-columns: 68px minmax(0, 1fr); gap: 10px; align-items: start; margin-top: 14px; }
.customer-priority-choice { display: flex; align-items: center; gap: 6px; min-width: 0; min-height: 44px; color: #48484a; font-size: 13px; font-weight: 600; cursor: pointer; }
.customer-priority-caption { white-space: nowrap; }
.customer-priority-choice .follow-up-star { display: grid; place-items: center; width: 30px; height: 44px; }
.customer-priority-choice input { top: 7px; left: 0; width: 30px; height: 30px; margin: 0; }
.customer-priority-choice .star-glyph { width: 24px; height: 24px; color: #aeaeb2; }
.customer-priority-choice input:checked + .star-glyph { color: #e9a300; }
.customer-grading-grade-field { display: grid; gap: 8px; min-width: 0; color: #53645d; font-size: 13px; font-weight: 700; }
.customer-grading-grade-field .follow-up-grade-choices { grid-template-columns: repeat(4,minmax(42px,1fr)); }
.customer-grading-manual-override button { min-height: 44px; }
.profile-manual-section { flex: none; padding: 0 0 2px; border-bottom: 0; }
.profile-manual-section .customer-grading-manual-override { margin: 0; }
.profile-overview-section { flex: 1 0 auto; width: 100%; min-height: 240px; padding: 18px; border: 1px solid #e6e3ed; border-radius: 18px; background: linear-gradient(180deg, #fff, #fcfbfe); box-shadow: 0 3px 14px rgb(35 24 50 / 4%); }
.profile-portrait-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid #eeecf3; }
.profile-portrait-header h3 { margin: 0; }
.profile-portrait-header button { flex: 0 0 auto; min-height: 32px; padding: 5px 11px; border: 1px solid #7955c8; border-radius: 9px; background: linear-gradient(135deg, #7955c8, #ad70d6 65%, #c77fbe); color: #fff; font: inherit; font-size: 12px; font-weight: 650; cursor: pointer; }
.profile-portrait-header button:hover { background: linear-gradient(135deg, #704bc0, #a367cf 65%, #bb72b4); border-color: #704bc0; }
.profile-portrait-header button:focus-visible { outline: 2px solid #7955c8; outline-offset: 2px; }
.profile-portrait-body { width: 100%; margin: 16px 0 0; color: #303036; font-size: 14px; line-height: 1.8; overflow-wrap: anywhere; }
.profile-portrait-body.is-empty { color: #8a8793; }
.profile-portrait-body p { margin: 0 0 16px; white-space: pre-wrap; }
.profile-portrait-body strong { color: #24242b; font-weight: 700; }
.profile-portrait-actions { display: flex; justify-content: flex-end; margin-top: 12px; }
.profile-portrait-actions button { min-height: 32px; padding: 5px 11px; border: 1px solid #d7d7df; border-radius: 9px; background: #fff; color: #45454e; font: inherit; font-size: 12px; font-weight: 650; cursor: pointer; }
.profile-portrait-actions button:hover { border-color: #a9abbb; background: #f2f2f7; }
.profile-portrait-actions button:focus-visible { outline: 2px solid var(--control-accent); outline-offset: 2px; }

.mobile-mode-tabs { display: none; }

.login-screen { position: relative; z-index: 5; display: grid; min-height: 100vh; place-items: center; padding: 24px; }
.login-card { width: min(430px, 100%); padding: 30px; border: 1px solid rgba(199, 211, 206, 0.88); border-radius: var(--radius-xl); background: rgba(255, 254, 251, 0.94); box-shadow: var(--shadow); backdrop-filter: blur(20px); }
.login-card h1 { margin: 3px 0 4px; font-size: 30px; letter-spacing: -0.04em; }
.login-card > p:not(.eyebrow):not(.login-error) { margin: 0 0 20px; color: var(--ink-600); }
.login-card label, #create-contact-form > label { display: block; margin-top: 13px; font-size: 13px; font-weight: 750; }
.login-card input, #create-contact-form input, #create-contact-form select { display: block; margin-top: 5px; font-weight: 400; }
.login-card .full-button { width: 100%; margin: 8px 0 0; }
.login-error { min-height: 24px; margin: 8px 0 0; color: var(--danger); font-size: 12px; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.model-switcher { position: static; display: inline-flex; align-items: center; gap: 7px; margin-left: 20px; color: var(--ink-600); font-size: 12px; font-weight: 700; white-space: nowrap; }
.model-switcher select { min-width: 174px; height: 34px; padding: 0 28px 0 10px; border: 1px solid var(--pine-300); border-radius: 9px; color: var(--pine-700); background: var(--paper); font: inherit; font-weight: 700; cursor: pointer; }
.model-switcher select:disabled { color: var(--ink-500); border-color: var(--line); background: var(--paper-soft); cursor: not-allowed; }
.model-switcher select:focus-visible { outline: 3px solid rgba(32, 149, 103, 0.22); outline-offset: 2px; }
.contact-title-actions { display: flex; align-items: center; gap: 8px; }
.compact-action { min-height: 30px; padding: 0 9px; font-size: 12px; }
#create-contact-form { padding-bottom: 2px; }
#create-contact-form > label { padding-inline: 18px; }

dialog { width: min(560px, calc(100vw - 28px)); max-height: calc(100vh - 40px); overflow-y: auto; padding: 0; border: 1px solid var(--line-strong); border-radius: var(--radius-lg); color: var(--ink-950); background: var(--paper); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(16, 28, 23, 0.42); backdrop-filter: blur(3px); }
.dialog-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.dialog-header h2 { font-size: 20px; }
.icon-button { width: 44px; min-width: 44px; padding: 0; border: 0; border-radius: 50%; color: var(--ink-600); background: var(--paper-soft); font-size: 25px; }
#asset-form > label { display: block; padding: 11px 18px 0; font-size: 13px; font-weight: 700; }
#asset-form textarea, #asset-form input { display: block; margin-top: 5px; font-weight: 400; }
#conversation-import-dialog { width: min(680px, calc(100vw - 28px)); }
#conversation-import-form > label { display: block; padding: 11px 18px 0; font-size: 13px; font-weight: 700; }
#conversation-import-form select, #conversation-import-form textarea { display: block; margin-top: 5px; font-weight: 400; }
#conversation-import-content { min-height: 220px; resize: vertical; line-height: 1.65; }
.form-hint { margin: 12px 18px; color: var(--ink-600); font-size: 12px; }
.full-button { width: calc(100% - 36px); margin: 0 18px 18px; }
.follow-up-item { position: relative; display: grid; width: 100%; min-height: 76px; grid-template-columns: 28px 38px minmax(0, 1fr); align-items: center; gap: 4px; padding: 0 10px; border: 0; border-bottom: 1px solid var(--line); text-align: left; }
.follow-up-item.is-stopped { grid-template-columns: 38px minmax(0, 1fr) auto; }
.follow-up-task-select { width: 18px; height: 18px; min-height: 0; margin: 0 auto; accent-color: var(--control-accent); cursor: pointer; }
.follow-up-open { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; min-width: 0; min-height: 76px; padding: 12px 5px 12px 16px; border: 0; background: transparent; color: inherit; text-align: left; }
.follow-up-star { position: relative; display: grid; place-items: center; width: 36px; height: 44px; cursor: pointer; }
.follow-up-star input { position: absolute; opacity: 0; width: 30px; height: 30px; cursor: pointer; }
.star-glyph { display: inline-block; flex: none; width: 20px; height: 20px; background: currentColor; mask-image: url("/assets/Star.svg"); -webkit-mask-image: url("/assets/Star.svg"); mask-size: contain; -webkit-mask-size: contain; mask-position: center; -webkit-mask-position: center; mask-repeat: no-repeat; -webkit-mask-repeat: no-repeat; vertical-align: -0.2em; }
.follow-up-history-entry .star-glyph, .admin-data-table .star-glyph { width: 15px; height: 15px; margin-right: 4px; color: #e9a300; }
.follow-up-history-entry .follow-up-history-star { width: 15px; height: 15px; margin-right: 0; align-self: center; }
.follow-up-star .star-glyph { width: 24px; height: 24px; color: #aeaeb2; }
.follow-up-star input:checked + .star-glyph { color: #e9a300; }
.follow-up-star input:focus-visible + span { outline: 2px solid var(--control-accent); outline-offset: 3px; border-radius: 4px; }
.follow-up-item:last-child { border-bottom: 0; }
p.follow-up-item { display: block; padding: 16px; }
.follow-up-item time { color: var(--amber-700); font-weight: 800; }
.follow-up-item p { margin: 4px 0 0; color: var(--ink-600); }
.dialog-header-actions { display: flex; align-items: center; gap: 8px; }
#follow-up-dialog { left: max(8px, calc(50% - 480px)); width: min(960px, calc(100vw - 16px)); height: min(720px, calc(100dvh - 90px)); max-height: calc(100dvh - 16px); overflow: hidden; }
#follow-up-dialog[open] { display: flex; flex-direction: column; }
#follow-up-dialog > .dialog-header { display: grid; flex: 0 0 auto; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr); align-items: center; gap: 0; }
#follow-up-dialog > .dialog-header > .follow-up-header-leading { display: flex; min-width: 0; align-items: center; gap: 10px; justify-self: start; }
.follow-up-header-leading h2 { margin: 0; }
#follow-up-dialog > .dialog-header > .dialog-header-actions { justify-self: end; }
.follow-up-customer-identity { display: flex; align-items: center; justify-content: center; min-width: 0; gap: 6px; }
.follow-up-rename-button { width: 22px !important; height: 22px !important; min-width: 22px; padding: 2px !important; color: #6b5b95; background: transparent !important; border: 0 !important; }
.follow-up-rename-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#follow-up-contact-id { width: 22px !important; height: 22px !important; min-width: 22px; min-height: 22px; padding: 2px !important; border: 0 !important; background: transparent !important; box-shadow: none; color: var(--muted); overflow: visible; }
#follow-up-contact-id svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#follow-up-title { display: block; min-width: 0; overflow: hidden; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
#follow-up-form-panel { display: flex; flex-direction: column; flex: 1 1 0; min-height: 0; }
#follow-up-form-panel[hidden], #follow-up-tasks-panel[hidden] { display: none; }
#follow-up-form { flex: 0 0 auto; gap: 10px; }
#follow-up-note { min-height: 72px; max-height: 120px; }
.follow-up-history { display: flex; flex-direction: column; flex: 1 1 0; min-height: 60px; margin: 0 16px 16px; border-top: 1px solid var(--line); }
#follow-up-history-more { align-self: center; margin: 6px 0 12px; color: var(--control-accent); font-weight: 500; }
#follow-up-history-more:hover { color: var(--control-accent-hover); background: var(--control-accent-soft); }
#follow-up-history-title { flex: 0 0 auto; margin: 10px 0 6px; font-size: 13px; }
.follow-up-history-heading { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px 0 6px; }
.follow-up-history-heading #follow-up-history-title { margin: 0; }
#follow-up-ai-guidance { min-height: 30px; padding: 4px 14px; border: 1px solid #d9c6f1; border-radius: 10px; background: var(--control-accent-soft); color: var(--control-accent); font-size: 13px; font-weight: 600; }
#follow-up-ai-guidance:hover, #follow-up-ai-guidance:focus-visible { background: #ede2f9; border-color: #c8b9dd; }
#follow-up-history-list { flex: 1 1 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.follow-up-history-entry { margin: 0 0 10px; padding: 14px 16px 12px; border: 1px solid #e5e5ea; border-radius: 14px; background: #fff; box-shadow: 0 1px 3px rgb(28 28 30 / 4%); }
.follow-up-history-meta { color: #86868b; font-size: 12px; font-weight: 400; line-height: 1.45; white-space: nowrap; }
.follow-up-history-entry header { color: #6e6e73; }
.follow-up-history-times { display: grid; grid-template-columns: repeat(2, max-content); justify-content: space-between; gap: 12px; overflow-x: auto; }
@media (max-width: 600px) { .follow-up-history-times { grid-template-columns: minmax(0, 1fr); gap: 4px; overflow-x: visible; } }
.follow-up-history-times time { display: flex; flex-wrap: nowrap; align-items: center; column-gap: 7px; min-width: 0; font-size: 12px; line-height: 1.45; }
.follow-up-history-date-label { color: #86868b; white-space: nowrap; }
.follow-up-history-date-value { color: #48484a; font-variant-numeric: tabular-nums; white-space: nowrap; }
.follow-up-history-entry p.is-empty { color: var(--ink-500); }
.follow-up-history-entry p { margin: 12px 0 0; padding-top: 11px; border-top: 1px solid #eeeef1; color: #1d1d1f; font-size: 13px; font-weight: 400; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.follow-up-history-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.follow-up-history-actions button { min-height: 30px; padding: 3px 10px; border-radius: 9px; background: #f5f5f7; color: var(--control-accent); font-size: 12px; font-weight: 600; }
.follow-up-history-actions button:hover { background: var(--control-accent-soft); color: var(--control-accent-hover); }
.follow-up-create-options[hidden], #follow-up-tasks-tab[hidden], #follow-up-outline[hidden] { display: none !important; }
.follow-up-history-empty { margin: 12px 0; color: var(--ink-600); font-size: 13px; }
#follow-up-tasks-panel { flex: 1 1 0; min-height: 0; overflow-y: auto; }
#personal-ai-settings-dialog { width: min(620px, calc(100vw - 28px)); }
#personal-ai-settings-form > label { display: grid; gap: 7px; margin-top: 14px; color: var(--ink-800); font-size: 13px; font-weight: 750; }
#personal-ai-settings-form textarea { min-height: 84px; resize: vertical; }
.personal-settings-status { min-height: 19px; margin: 12px 0; color: var(--ink-600); font-size: 12px; }
#follow-up-list { max-height: 300px; overflow-y: auto; scrollbar-gutter: stable; border: 1px solid var(--line); border-radius: 12px; }
#follow-up-tasks-panel { padding: 0 16px 16px; }
.follow-up-bulk-toolbar, .follow-up-pagination { display: flex; align-items: center; gap: 12px; padding: 10px 2px; color: #6e6e73; font-size: 12px; }
.follow-up-bulk-toolbar { flex-wrap: wrap; border-top: 1px solid #ededf1; }
.follow-up-bulk-toolbar label, .follow-up-pagination label { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.follow-up-bulk-toolbar input { width: 18px; height: 18px; min-height: 0; margin: 0; accent-color: var(--control-accent); }
.follow-up-bulk-actions { display: flex; gap: 8px; margin-left: auto; }
.follow-up-pagination { justify-content: space-between; flex-wrap: wrap; }
.follow-up-pagination > div { display: flex; gap: 6px; }
.follow-up-pagination select { min-height: 34px; padding: 4px 8px; border: 1px solid #d2d2d7; border-radius: 9px; background: #fff; color: #1d1d1f; font: inherit; }
.follow-up-pagination button, .follow-up-bulk-toolbar button { min-height: 34px; padding: 5px 10px; border: 1px solid var(--control-border); border-radius: 9px; background: #f5f5f7; color: var(--control-accent); font-size: 12px; font-weight: 600; }
.follow-up-pagination button:hover:not(:disabled), .follow-up-bulk-toolbar button:hover:not(:disabled) { border-color: #c8b9dd; background: var(--control-accent-soft); color: var(--control-accent-hover); }
.follow-up-pagination button:disabled, .follow-up-bulk-toolbar button:disabled { opacity: .46; cursor: default; }
.follow-up-item { background: var(--paper); }
.follow-up-item:hover, .follow-up-item:focus-visible { background: var(--control-accent-soft); }
.follow-up-item.is-due { background: #faf7fe; }
.follow-up-item header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.follow-up-item header strong { color: var(--ink-950); font-size: 14px; }
.follow-up-item small { display: block; margin-top: 2px; color: var(--ink-500); }
.follow-up-item-content { min-width: 0; }
.follow-up-item-content p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.follow-up-unread-dot { position: absolute; top: 50%; left: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--control-accent); box-shadow: 0 0 0 3px #e8daf8; transform: translateY(-50%); }
.follow-up-item-chevron { color: var(--ink-400); font-size: 25px; line-height: 1; }
.follow-up-item-action { flex: none; color: var(--control-accent); font-size: 12px; font-weight: 600; }
button.follow-up-item-action { border: 0; background: transparent; color: var(--control-accent); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; padding: 6px 8px; }
.follow-up-item-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.follow-up-item-actions button { min-height: 34px; padding: 0 11px; }

.toast { position: fixed; z-index: 120; top: auto; left: auto; right: 22px; bottom: 22px; margin: 0; border: 0; max-width: min(390px, calc(100vw - 32px)); padding: 11px 14px; border-radius: var(--radius-md); color: #fff; background: var(--ink-950); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translateY(12px); transition: opacity 180ms ease, transform 180ms ease; }
.toast.is-visible { opacity: 1; transform: translateY(0); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; margin: -1px; padding: 0; border: 0; clip: rect(0 0 0 0); white-space: nowrap; }

#composer-context-status { color: var(--ink-600); font-size: 12px; }
@media (max-width: 1100px) {
    textarea, input, select { font-size: 16px; }
}

@media (max-width: 1240px) {
    .simulator-shell { grid-template-columns: 285px minmax(680px, 1fr); }
    .sales-grid { grid-template-columns: 150px minmax(260px, 0.78fr) minmax(370px, 1.22fr); }
    .contact-item { padding-inline: 9px; }
}

@media (max-width: 980px) {
    .simulator-shell { grid-template-columns: 250px minmax(620px, 1fr); overflow-x: auto; }
    .contact-rail { display: none; }
    .sales-grid { grid-template-columns: minmax(260px, 0.8fr) minmax(360px, 1.2fr); }
}

@media (min-width: 721px) and (max-width: 1500px) {
    .stage-progress-step { min-height: 76px; grid-template-columns: 1fr; grid-template-rows: 18px auto auto; justify-items: center; align-content: center; row-gap: 3px; padding: 7px 5px; }
    .stage-progress-step:first-child { padding-left: 5px; }
    .stage-progress-step-marker { grid-column: 1; }
    .stage-progress-step strong { grid-column: 1; overflow: visible; font-size: 12px; letter-spacing: 2px; text-overflow: clip; white-space: normal; writing-mode: vertical-rl; text-orientation: upright; }
    .stage-progress-step-state { grid-column: 1; font-size: 9px; }
    .stage-progress-step.is-current strong { font-size: 14px; }
}

@media (max-width: 1100px) {
    body { min-height: 100dvh; padding-bottom: 0; }
    #workspace-shell:not([hidden]) { display: flex; flex-direction: column; height: 100dvh; min-height: 0; overflow: hidden; }
    .app-header { align-items: center; padding: 13px 14px 8px; }
    .app-header h1 { font-size: 20px; }
    .model-switcher { max-width: 26vw; margin-left: 7px; }
    .model-switcher > span { display: none; }
    .model-switcher select { min-width: 0; max-width: 26vw; }
    .eyebrow, .header-status { display: none; }
    .mobile-mode-tabs { position: relative; z-index: 3; display: grid; flex: 0 0 auto; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; margin: 8px 12px 0; padding: 4px; padding-bottom: max(4px, env(safe-area-inset-bottom)); border: 1px solid var(--sales-blue-200); border-radius: 14px 14px 0 0; background: rgba(255, 255, 255, 0.96); box-shadow: 0 -8px 24px rgba(22, 119, 255, 0.1); }
    .mobile-mode-tabs button { min-height: 48px; border: 0; border-radius: 10px; color: var(--ink-600); background: transparent; font-weight: 800; }
    body[data-mobile-mode="client"] .mobile-mode-tabs [data-mobile-mode="client"], body[data-mobile-mode="sales"] .mobile-mode-tabs [data-mobile-mode="sales"], body[data-mobile-mode="coach"] .mobile-mode-tabs [data-mobile-mode="coach"] { color: #fff; background: var(--sales-blue-gradient); }
    .simulator-shell { display: grid; flex: 1 1 auto; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); width: 100%; height: auto; min-height: 0; padding: 0 8px; overflow: hidden; }
    .client-zone, .sales-zone, .intelligence-zone { grid-column: 1; grid-row: 1; }
    body[data-mobile-mode="client"] .sales-zone,
    body[data-mobile-mode="client"] .intelligence-zone,
    body[data-mobile-mode="sales"] .client-zone,
    body[data-mobile-mode="sales"] .intelligence-zone,
    body[data-mobile-mode="coach"] .client-zone,
    body[data-mobile-mode="coach"] .sales-zone { display: none; }
    .app-surface { height: 100%; min-height: 0; border-radius: 15px; }
    .zone-header { min-height: 58px; padding: 9px 13px; }
    .zone-kicker { display: none; }
    .zone-header h2 { font-size: 17px; }
    .customer-thread { min-height: 0; flex: 1 1 auto; overflow-y: auto; }
    .sales-grid { display: block; height: 100%; min-height: 0; overflow: hidden; }
    .contact-rail { display: none; }
    .sales-chat { min-height: 0; height: 100%; max-height: none; overflow: hidden; border-right: 0; border-bottom: 1px solid var(--line); }
    .sales-chat .contact-title { min-height: 46px; }
    .sales-chat .message-thread { min-height: 0; flex: 1 1 auto; padding-block: 8px; }
    .sales-chat .sales-composer { display: grid; padding: 8px; }
    .sales-chat .sales-composer textarea { min-height: 68px; max-height: 112px; }
    .intelligence-zone { min-height: 0; overflow-y: auto; }
    .assistant-tabs button { font-size: 16px; }
    .coach-output { min-height: 0; max-height: none; padding: 12px 13px 18px; }
    .profile-scroll { min-height: 0; max-height: none; }
    /* mobile-coach-form-stack */
    .coach-form { position: sticky; bottom: 0; grid-template-columns: minmax(0, 1fr); padding-bottom: 10px; }
    .coach-form > textarea { grid-column: 1; grid-row: 1; min-height: 68px; }
    .coach-form-actions { grid-column: 1; grid-row: 2; width: 100%; }
    .reply-option { grid-template-columns: minmax(0, 1fr) 44px; padding-block: 14px 11px; }
    .toast { right: 16px; bottom: calc(76px + env(safe-area-inset-bottom)); left: 16px; }
}

@media (max-width: 420px) {
    body { font-size: 14px; }
    .account-pill { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .coach-toolbar { align-items: flex-start; }
    .coach-toolbar > span { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .chat-composer { grid-template-columns: minmax(0, 1fr) 70px; padding: 9px; }
    .coach-form { grid-template-columns: minmax(0, 1fr); padding: 9px; }
    .primary-button { min-width: 66px; padding-inline: 10px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
    .coach-chat-loading-dot {
        animation-name: coach-chat-dot !important;
        animation-duration: 1.1s !important;
        animation-timing-function: ease-in-out !important;
        animation-iteration-count: infinite !important;
    }
}

.coach-icon-action { background: var(--sales-blue-50); }
.coach-icon-action:active { transform: translateY(1px); }

#coach-output .reply-option.is-library,
#coach-output .reply-option.is-library:hover,
#coach-output .reply-option.is-library:focus-within {
    background: var(--pine-50);
    box-shadow: inset 3px 0 0 var(--pine-500);
}

#coach-output .reply-option.is-library .reply-option-icon {
    color: var(--pine-700);
    background: var(--pine-100);
}

#coach-output .reply-option.is-library .reply-option-icon:hover,
#coach-output .reply-option.is-library .reply-option-icon:focus-visible {
    color: #fff;
    background: var(--pine-600);
}
/* Active AI analysis feedback */
.coach-stream-status {
    position: relative;
    overflow: hidden;
    padding-bottom: 10px;
    color: #7546a8;
}

.coach-stream-pulse {
    position: relative;
    color: #9b65c9;
    background: linear-gradient(135deg, #7955d2, #b36cd5 65%, #d38bbb);
    animation: coach-status-pulse 1.15s ease-in-out infinite;
}

.coach-stream-pulse::after {
    position: absolute;
    inset: -5px;
    border: 2px solid currentColor;
    border-radius: 50%;
    opacity: 0;
    content: "";
    animation: coach-status-halo 1.15s ease-out infinite;
}

.coach-stream-status::after {
    position: absolute;
    right: auto;
    bottom: 2px;
    left: 0;
    width: 42%;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent 0%, rgba(121, 85, 210, 0.18) 27%, rgba(146, 89, 210, 0.88) 48%, rgba(207, 127, 189, 0.7) 65%, transparent 100%);
    content: "";
    animation: coach-status-sweep 1.25s ease-in-out infinite;
}

.coach-reply-pending {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    margin: 10px 18px 14px;
    padding: 10px 14px;
    gap: 10px;
    border: 1px solid #e2d5f3;
    border-radius: 12px;
    color: #7546a8;
    background: linear-gradient(105deg, #f7f0fd, #fdf3fa);
    text-align: center;
    font-size: 13px;
    font-weight: 700;
}

.coach-reply-pending::before {
    width: 42px;
    height: 24px;
    flex: 0 0 auto;
    border: 1px solid #e2d5f3;
    border-radius: 999px;
    background:
        radial-gradient(circle at 9px 50%, #7955d2 0 3px, transparent 3.5px),
        radial-gradient(circle at 21px 50%, #a46ad8 0 3px, transparent 3.5px),
        radial-gradient(circle at 33px 50%, #cb8cc8 0 3px, transparent 3.5px);
    background-color: rgba(150, 97, 211, 0.11);
    content: "";
    animation: coach-status-pulse 1.15s ease-in-out infinite;
}

.coach-reply-pending::after {
    display: none;
    content: "";
}

@keyframes coach-status-pulse {
    0%, 100% {
        transform: scale(0.82);
        opacity: 0.62;
    }
    50% {
        transform: scale(1.12);
        opacity: 1;
    }
}

@keyframes coach-status-halo {
    0% {
        transform: scale(0.65);
        opacity: 0.42;
    }
    75%, 100% {
        transform: scale(1.35);
        opacity: 0;
    }
}

@keyframes coach-status-sweep {
    0% {
        transform: translateX(-110%);
    }
    100% {
        transform: translateX(250%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .coach-stream-pulse {
        animation-name: coach-status-pulse !important;
        animation-duration: 1.8s !important;
        animation-timing-function: ease-in-out !important;
        animation-iteration-count: infinite !important;
    }

    .coach-stream-pulse::after {
        animation: none;
    }

    .coach-stream-status::after {
        animation-name: coach-status-sweep !important;
        animation-duration: 2.4s !important;
        animation-timing-function: ease-in-out !important;
        animation-iteration-count: infinite !important;
    }
}
.coach-chat-markdown-heading {
    margin: 24px 0 12px;
    color: var(--ink-900);
    line-height: 1.35;
}

.coach-chat-markdown-heading:first-child {
    margin-top: 0;
}

.coach-chat-markdown-heading.level-1 {
    font-size: 22px;
    font-weight: 850;
}

.coach-chat-markdown-heading.level-2 {
    font-size: 18px;
    font-weight: 800;
}

.coach-chat-markdown-heading.level-3,
.coach-chat-markdown-heading.level-4 {
    font-size: 16px;
    font-weight: 760;
}

.coach-chat-markdown-quote {
    margin: 16px 0;
    padding: 10px 14px;
    border-left: 3px solid var(--pine-400);
    background: var(--pine-50);
    color: var(--ink-700);
}

.coach-chat-markdown-rule {
    margin: 20px 0;
    border: 0;
    border-top: 1px solid var(--line);
}

.coach-chat-markdown-code {
    margin: 16px 0;
    padding: 14px;
    overflow-x: auto;
    border-radius: 10px;
    background: var(--sales-blue-50);
    color: #17372d;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    white-space: pre;
}

.coach-chat-inline-code {
    padding: 1px 5px;
    border-radius: 4px;
    background: var(--sales-blue-50);
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

:root {
    --sales-blue-50: #f2f8ff;
    --sales-blue-100: #e3f0ff;
    --sales-blue-200: #c6e1ff;
    --sales-blue-300: #98c9ff;
    --sales-blue-400: #66adff;
    --sales-blue-500: #338fff;
    --sales-blue-600: #1677ff;
    --sales-blue-700: #0f5fcc;
    --sales-blue-800: #0c4ba1;
    --sales-blue-900: #0a376f;
    --sales-blue-gradient: linear-gradient(135deg, #1677ff 0%, #4ea8ff 100%);
    --sales-blue-gradient-strong: linear-gradient(135deg, #0f64dc 0%, #278dff 58%, #66b8ff 100%);
    --pine-50: var(--sales-blue-50);
    --pine-100: var(--sales-blue-100);
    --pine-200: var(--sales-blue-200);
    --pine-300: var(--sales-blue-300);
    --pine-400: var(--sales-blue-400);
    --pine-500: var(--sales-blue-500);
    --pine-600: var(--sales-blue-600);
    --pine-700: var(--sales-blue-700);
    --pine-800: var(--sales-blue-800);
    --pine-900: var(--sales-blue-900);
}

body {
    background:
        radial-gradient(circle at 8% 6%, rgba(78, 168, 255, 0.18), transparent 32%),
        radial-gradient(circle at 92% 88%, rgba(22, 119, 255, 0.12), transparent 34%),
        linear-gradient(155deg, #f8fbff 0%, #edf5ff 48%, #fbfdff 100%);
}

.primary-button,
.coach-view-tab.is-active,
.sales-stage-step.is-active {
    border-color: var(--sales-blue-600);
    background: var(--sales-blue-gradient);
    color: #fff;
}

.primary-button:hover,
.coach-view-tab.is-active:hover,
.sales-stage-step.is-active:hover {
    background: var(--sales-blue-gradient-strong);
}

.analysis-split-control {
    min-height: 38px;
}

.analysis-split-control > button {
    height: 36px;
    min-height: 36px;
    padding-top: 0;
    padding-bottom: 0;
}

/* Multi-turn questions and answers share the existing AI output, without a second pane. */
.coach-dialogue-message { min-width: 0; margin: 0 0 22px; overflow-wrap: anywhere; }
.coach-dialogue-message.is-user { box-sizing: border-box; display: flex; flex-direction: column; align-items: flex-end; width: 100%; max-width: 100%; margin-left: 0; }
.coach-user-bubble { position: relative; box-sizing: border-box; width: fit-content; max-width: min(90%, 100%); padding: 10px 40px 10px 14px; border: 1px solid var(--sales-blue-200); border-radius: 16px 16px 5px 16px; background: var(--sales-blue-50); white-space: pre-wrap; overflow-wrap: anywhere; }
#app .seller-requirement-add { position: absolute; right: 7px; bottom: 7px; display: grid; place-items: center; box-sizing: border-box; width: 26px; min-width: 26px; height: 26px; min-height: 26px; padding: 0; border: 0; border-radius: 50%; background: rgb(128 82 190 / 9%); color: var(--control-accent); font-size: 20px; font-weight: 400; line-height: 1; cursor: pointer; transition: background-color 160ms ease, color 160ms ease, box-shadow 160ms ease; }
.seller-requirement-add:hover, .seller-requirement-add:focus-visible { background: var(--control-accent); color: #fff; box-shadow: 0 2px 8px rgb(128 82 190 / 24%); }
.seller-requirement-add:focus-visible { outline: 2px solid var(--control-accent); outline-offset: 2px; }
.seller-requirement-add:disabled { cursor: default; opacity: .6; }
.coach-dialogue-message.is-assistant { width: 100%; }
.coach-dialogue-message.is-error { color: #9d2e23; }
#app [data-save-raw-reply-asset],
#app [data-save-reply-asset],
#app [data-outcome-asset-message],
#app #save-coach-draft-asset { display: none !important; }

/* Customer windows remain usable alongside the selected WeCom conversation. */
.floating-window {position:fixed; inset:auto; left:calc(50% - 280px); top:70px; margin:0; width:min(560px,calc(100vw - 16px)); height:min(680px,calc(100dvh - 90px)); max-width:calc(100vw - 16px); max-height:calc(100dvh - 16px); padding:0; overflow:hidden; box-shadow:0 12px 60px #17395f40;}
.floating-window[open] {display:flex; flex-direction:column;}
.floating-window .dialog-header {cursor:move; touch-action:none; padding:12px 16px; flex:none;}
.floating-window h2 {font-size:18px; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.floating-window .dialog-header button {min-height:32px; padding:4px 10px;}
.floating-window .dialog-header .admin-history-button { min-height: 38px; padding: 0; }
@media (max-width: 600px) {
    #follow-up-dialog > .dialog-header { grid-template-columns: minmax(0, 1fr) auto; row-gap: 6px; }
    #follow-up-dialog .follow-up-customer-identity { grid-row: 2; grid-column: 1 / -1; }
    #follow-up-dialog > .dialog-header > .dialog-header-actions { grid-row: 1; grid-column: 2; }
}
.floating-resize {position:absolute; bottom:0; right:0; width:26px; height:26px; cursor:nwse-resize; touch-action:none; background:linear-gradient(135deg,transparent 65%,#77a7da 66%,transparent 72%,#77a7da 73%,transparent 79%);}
#floating-window-dock {position:fixed; bottom:10px; left:10px; z-index:900; display:flex; gap:8px;}
#follow-up-form-panel {overflow:auto; padding-bottom:72px; overscroll-behavior:contain;}
#follow-up-scroll-top {
    position:absolute; right:24px; bottom:20px; z-index:2;
    display:flex; flex-direction:column; align-items:center; justify-content:center; gap:1px;
    width:48px; height:52px; min-height:0; padding:6px; border:1px solid #ded2ed; border-radius:15px;
    background:#faf7fe; color:var(--control-accent); box-shadow:0 4px 16px rgb(75 42 111 / 15%);
    font-size:10px; font-weight:650; letter-spacing:.6px; line-height:1; cursor:pointer;
}
#follow-up-scroll-top[hidden] {display:none;}
#follow-up-scroll-top svg {width:21px; height:21px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round;}
#follow-up-scroll-top:hover {background:#efe6fa; border-color:#cbb5e3;}
#follow-up-scroll-top:focus-visible {outline:3px solid #cdb5e8; outline-offset:3px;}
#follow-up-history-list {flex:1 0 auto; overflow:visible;}
.follow-up-history {flex:1 0 auto;}
#follow-up-list {max-height:none; overflow:visible;}
.follow-up-create-options {display:grid; grid-template-columns:36px minmax(0,1fr); grid-template-rows:auto; column-gap:16px; align-items:center;}
.follow-up-grade-choices {display:grid; grid-template-columns:repeat(4,minmax(42px,1fr)); gap:6px; width:100%;}
.follow-up-grade-choices button {min-width:0; min-height:42px; padding:6px 4px; border:1px solid #d2d2d7; border-radius:12px; background:#f5f5f7; color:#1d1d1f; font-size:20px; font-weight:700; line-height:1; cursor:pointer;}
.follow-up-grade-choices button[data-customer-grade="pending"] {font-size:13px; font-weight:600;}
.follow-up-grade-choices button:hover {border-color:var(--control-accent); background:var(--control-accent-soft);}
.follow-up-grade-choices button[aria-pressed="true"] {border-color:var(--control-accent); background:var(--control-accent); color:#fff; box-shadow:0 2px 8px rgb(128 82 190 / 18%);}
.follow-up-grade-choices button:focus-visible {outline:3px solid #d9c6f1; outline-offset:2px;}
.follow-up-create-options .follow-up-star {width:36px; min-height:44px; display:inline-flex; align-items:center; justify-content:center;}
#follow-up-outline-status { margin: -4px 0 0; min-height: 0; line-height: 1.45; }
#follow-up-outline-status:empty { display: none; }
.follow-up-history-entry.is-cancelled p {text-decoration:line-through; color:var(--ink-500);}
.follow-up-item.is-current-customer {box-shadow:inset 3px 0 var(--control-accent);}
@media(max-width:600px) {.floating-window {left:8px;top:60px;} #follow-up-dialog {left:8px; height:min(720px,calc(100dvh - 74px));} .floating-window .dialog-header {gap:5px;} .dialog-header-actions {gap:3px;} .follow-up-create-options {grid-template-columns:36px minmax(0,1fr); column-gap:10px;} .follow-up-grade-choices {grid-template-columns:repeat(4,minmax(34px,1fr));}}
.console-inline {display:flex; align-items:end; gap:12px; flex-wrap:wrap; margin:14px 0;}
.console-inline label {display:grid;gap:6px;}
.console-inline input,.console-inline select {max-width:200px;}
.admin-panel label {display:grid;gap:7px;}
#ai-policy-form textarea {width:100%;resize:vertical;}
#tenant-usage-table input[type=number] {width:120px;}
#tenant-usage-table progress {width:110px;height:12px;}
#tenant-usage-table td small {display:block;}
#tenant-usage-table td {vertical-align:middle;}
#admin-followup-detail {width:min(640px,calc(100vw - 24px));max-height:90dvh;overflow:auto;}
#admin-followup-edit {display:grid;gap:12px;}
#admin-followup-events {font-size:12px;white-space:pre-wrap;}
#provider-settings-dialog {width:min(760px,calc(100vw - 24px));}
.admin-tabs [data-admin-tab="advanced"] { position: sticky; right: 0; z-index: 1; margin-left: auto; background: #fff; box-shadow: -10px 0 12px #fff; }
.admin-advanced-panel { padding: 4px 0 12px; }
.admin-advanced-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0 16px; }
.admin-advanced-heading h3 { margin: 0 0 4px; }
.admin-advanced-heading p { margin: 0; color: #6e6e73; font-size: 12px; }
.admin-advanced-heading button { min-height: 38px; padding: 0 14px; border: 1px solid #d2d2d7; border-radius: 10px; background: #fff; color: var(--control-accent); font: inherit; font-weight: 650; cursor: pointer; }
#advanced-pending-holds:not(:empty) { margin-bottom: 14px; }
#platform-admin-frame { display: block; width: 100%; height: min(680px, 68vh); border: 1px solid #e5e5ea; border-radius: 14px; background: #f5f5f7; }
#recharge-checkout img {width:220px;height:220px;}

/* Compact task filters share one baseline; narrow windows wrap whole controls. */
#follow-up-tasks-panel .follow-up-task-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; padding: 12px 0 18px; }
#follow-up-tasks-panel .follow-up-task-filters > label { display: grid; flex: 0 0 104px; min-width: 0; gap: 6px; color: #6e6e73; font-size: 12px; font-weight: 400; }
#follow-up-tasks-panel .follow-up-task-filters :is(input:not([type=checkbox]),select,summary,button) { box-sizing: border-box; height: 38px; min-height: 38px; margin: 0; padding: 7px 10px; border: 1px solid var(--control-border); border-radius: 10px; background: #fff; color: #48484a; font-size: 12px; font-weight: 400; white-space: nowrap; }
#follow-up-tasks-panel .follow-up-task-filters :is(input:not([type=checkbox]),select) { width: 100%; max-width: 100%; }
#follow-up-tasks-panel .follow-up-task-filters > .follow-up-task-search { flex-basis: 150px; }
#follow-up-tasks-panel .follow-up-task-filters > .follow-up-task-star { position: relative; display: flex; flex: 0 0 28px; height: 38px; align-items: center; justify-content: center; cursor: pointer; }
.follow-up-task-star input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.follow-up-task-star span { font-size: 24px; color: #b5bac2; }
.follow-up-task-star input:checked + span { color: #f0a900; }
.follow-up-task-star input:focus-visible + span { outline: 2px solid var(--control-accent); outline-offset: 3px; border-radius: 4px; }
#follow-up-tasks-panel .follow-up-task-filters > .follow-up-task-unread { display: flex; flex: 0 0 auto; align-items: center; gap: 6px; height: 38px; white-space: nowrap; }
#follow-up-tasks-panel .follow-up-task-unread input { width: 16px; height: 16px; min-height: 0; margin: 0; }
.follow-up-task-range { flex: 0 0 100px; }
.follow-up-task-range summary { display: flex; align-items: center; justify-content: center; list-style: none; cursor: pointer; }
#follow-up-range-menu { position: fixed; inset: auto; z-index: 201; box-sizing: border-box; width: 260px; max-width: calc(100vw - 16px); padding: 14px; border: 1px solid var(--control-border); border-radius: 14px; background: #fff; box-shadow: 0 12px 32px #30234024; }
#follow-up-range-menu:popover-open { display: grid; gap: 12px; }
#follow-up-range-menu label { display: grid; gap: 6px; color: #6e6e73; font-size: 12px; }
.follow-up-range-heading { display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
#follow-up-range-menu #follow-up-close-dates { min-width: 28px; padding: 0; border: 0; background: transparent; box-shadow: none; color: var(--control-accent); }
.seller-requirement-saved { margin: 8px 0 0; color: #6e6e73; font-size: 12px; font-weight: 400; line-height: 1.6; }

#app .seller-requirement-add svg { display: block; width: 16px; height: 16px; margin: 0; pointer-events: none; }

#follow-up-title { line-height: 1; }
.follow-up-customer-identity .follow-up-rename-button, .follow-up-customer-identity .follow-up-contact-id-button { align-self: center; display: inline-flex; align-items: center; justify-content: center; margin: 0; line-height: 1; transform: translateY(-1px); }
.follow-up-contact-id-button { position: relative; }
.follow-up-contact-id-button::after { content: attr(data-tooltip); position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); z-index: 130; max-width: min(70vw, 420px); padding: 6px 9px; border-radius: 6px; background: #2c2c2e; color: #fff; font-size: 12px; line-height: 1.35; white-space: normal; overflow-wrap: anywhere; opacity: 0; visibility: hidden; pointer-events: none; transition: none; }
.follow-up-contact-id-button[data-tooltip=""]::after { display: none; }
.follow-up-contact-id-button:hover::after, .follow-up-contact-id-button:focus-visible::after { opacity: 1; visibility: visible; }

.follow-up-rename-button, .follow-up-contact-id-button { color: #6b6b70 !important; }
.follow-up-rename-button svg, .follow-up-contact-id-button svg { fill: currentColor; stroke: none; }

.follow-up-contact-id-button::after { width: max-content; max-width: min(80vw, 420px); white-space: nowrap; overflow-wrap: normal; word-break: normal; background: #ffffff; color: #3c3c43; border: 1px solid #e2e2e7; box-shadow: 0 4px 14px rgba(0,0,0,.12); padding: 7px 10px; border-radius: 8px; font-size: 12px; font-weight: 500; }

.follow-up-name-input, .manager-follow-up-name-input { min-width: 120px; max-width: 260px; height: 24px; padding: 1px 6px; border: 1px solid #d4c6e6; border-radius: 5px; background: #fff; color: inherit; font: inherit; text-align: center; outline: 2px solid rgba(137,89,203,.18); }
.manager-follow-up-name-input { text-align: left; }
.stop-reason-popover { position: fixed; z-index: 2147483647; width: min(260px, calc(100vw - 16px)); padding: 12px; border: 1px solid #e5d8f2; border-radius: 12px; background: #fff; box-shadow: 0 12px 32px #2b183f2e; }
.stop-reason-popover > p:first-child { margin: 0 0 8px; color: #3d3348; font-size: 13px; line-height: 1.35; }
.stop-reason-popover textarea { box-sizing: border-box; width: 100%; min-height: 52px; resize: none; padding: 8px 9px; border: 1px solid #d8cde6; border-radius: 8px; color: #27232e; font: inherit; font-size: 13px; }
.stop-reason-popover textarea:focus { outline: 2px solid #e7d8f7; outline-offset: 1px; border-color: #b78bd8; }
.stop-reason-popover .stop-reason-error { margin: 5px 0 0; color: #c0392b; font-size: 12px; }
.stop-reason-popover .stop-reason-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.follow-up-loading { display: flex; align-items: center; gap: 8px; padding: 10px 14px; color: #673899; font-size: 13px; }
.follow-up-loading[hidden] { display: none !important; }
.follow-up-item-author { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-500); font-size: 11px; font-weight: 500; }
.follow-up-history-note.is-edited strong { font-weight: 700; }
.follow-up-history-previous { margin-top: 4px !important; padding-top: 0 !important; border-top: 0 !important; color: #86868b !important; font-size: 12px !important; line-height: 1.4; }
