body.has-site-shell {
    padding-top: 82px;
}

.site-toolbar {
    position: fixed;
    z-index: 9998;
    top: 0;
    left: 0;
    right: 0;
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    background: rgba(255,255,255,.94);
    border-bottom: 1px solid #dbe5f0;
    box-shadow: 0 12px 34px rgba(15,23,42,.08);
    backdrop-filter: blur(16px);
}

.site-toolbar-inner {
    width: min(1320px, 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.site-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: #12304a;
    text-decoration: none;
    font: 800 18px/1.1 "Open Sans", Arial, sans-serif;
}

.site-brand img {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    object-fit: cover;
    border: 1px solid #dbe5f0;
}

.site-brand span {
    display: block;
    white-space: nowrap;
}

.site-brand small {
    display: block;
    margin-top: 3px;
    color: #6b7c90;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.site-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.site-nav a,
.site-nav button,
.site-expiry {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid #d6e1ee;
    background: #fff;
    color: #18324c;
    text-decoration: none;
    font: 800 13px/1 "Open Sans", Arial, sans-serif;
    cursor: pointer;
}

.site-expiry {
    background: #f8fbff;
    color: #475569;
    cursor: default;
}

.site-expiry.is-ok {
    background: #ecfdf5;
    border-color: #bbf7d0;
    color: #166534;
}

.site-expiry.is-off {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.site-nav a.primary {
    background: #0f766e;
    border-color: #0f766e;
    color: #fff;
}

.site-nav a.danger {
    color: #b91c1c;
}

.support-fab {
    position: fixed;
    z-index: 9999;
    right: 20px;
    bottom: 20px;
    width: 58px;
    height: 58px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(145deg, #0f766e 0%, #0d9488 55%, #0f766e 100%);
    color: #fff;
    box-shadow: 0 14px 32px rgba(15,118,110,.32);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease;
}
.ai-fab {
    position: fixed;
    z-index: 9999;
    right: 20px;
    bottom: 86px;
    width: 58px;
    height: 58px;
    border: 1px solid #1d4ed8;
    border-radius: 14px;
    background: #2563eb;
    color: #fff;
    box-shadow: 0 14px 32px rgba(37,99,235,.24);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease;
}
.ai-fab span {
    font: 900 17px/1 "Open Sans", Arial, sans-serif;
    letter-spacing: .03em;
}
.support-fab:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 18px 36px rgba(15,118,110,.4);
}
.ai-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 36px rgba(37,99,235,.34);
}
.support-fab:active {
    transform: translateY(0) scale(.98);
}
.ai-fab:active {
    transform: translateY(0) scale(.98);
}
.support-fab-icon {
    display: block;
    width: 26px;
    height: 26px;
}
.support-head-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.support-head-logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    background: #0f766e;
    color: #fff;
}
.support-head-logo svg {
    display: block;
}

.support-panel {
    position: fixed;
    z-index: 9999;
    right: 20px;
    bottom: 90px;
    width: min(380px, calc(100vw - 28px));
    max-height: min(620px, calc(100vh - 120px));
    display: none;
    grid-template-rows: auto 1fr auto;
    overflow: hidden;
    border: 1px solid #d6e1ee;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 28px 70px rgba(15,23,42,.18);
}
.ai-panel {
    position: fixed;
    z-index: 9999;
    right: 20px;
    bottom: 154px;
    width: min(460px, calc(100vw - 28px));
    height: min(690px, calc(100vh - 180px));
    display: none;
    grid-template-rows: auto auto 1fr auto;
    overflow: hidden;
    border: 1px solid #cbd8e6;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 28px 70px rgba(15,23,42,.2);
}

.support-panel.is-open {
    display: grid;
}
.ai-panel.is-open {
    display: grid;
}
.ai-panel.is-dragging {
    outline: 3px solid rgba(37,99,235,.35);
    outline-offset: -8px;
}
.ai-panel.is-dragging::after {
    content: "Thả ảnh vào đây";
    position: absolute;
    inset: 64px 14px 126px;
    display: grid;
    place-items: center;
    border: 2px dashed #2563eb;
    border-radius: 14px;
    background: rgba(239,246,255,.88);
    color: #1d4ed8;
    font: 900 18px/1 "Open Sans", Arial, sans-serif;
    pointer-events: none;
}

.support-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid #e8eef6;
    background: #f8fbff;
}

.support-head strong {
    display: block;
    color: #12304a;
    font-size: 15px;
}

.support-head span {
    display: block;
    margin-top: 3px;
    color: #6b7c90;
    font-size: 12px;
    font-weight: 700;
}

.support-head button {
    width: 34px;
    height: 34px;
    border: 1px solid #d6e1ee;
    border-radius: 9px;
    background: #fff;
    color: #18324c;
    font-weight: 800;
    cursor: pointer;
}
.ai-head {
    background: #eff6ff;
}
.ai-head-logo {
    background: #2563eb;
    font: 900 13px/1 "Open Sans", Arial, sans-serif;
}
.ai-head-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.ai-head-actions .ai-clear {
    width: auto;
    min-width: 48px;
    padding: 0 10px;
    color: #475569;
}
.ai-suggestions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 10px 12px;
    border-bottom: 1px solid #e8eef6;
    background: #fff;
}
.ai-suggestions button {
    min-height: 32px;
    border: 1px solid #d6e1ee;
    border-radius: 9px;
    background: #f8fbff;
    color: #18324c;
    padding: 0 10px;
    font: 800 12px/1 "Open Sans", Arial, sans-serif;
    cursor: pointer;
}
.ai-suggestions button:hover {
    border-color: #93c5fd;
    background: #eff6ff;
}

.support-messages {
    min-height: 220px;
    overflow: auto;
    padding: 14px;
    background: #f4f7fb;
}

.support-empty {
    padding: 16px;
    border: 1px dashed #cbd8e6;
    border-radius: 12px;
    color: #64748b;
    text-align: center;
    font-weight: 700;
}
.ai-messages {
    min-height: 260px;
    overflow: auto;
    padding: 14px;
    background: #f4f7fb;
}
.ai-msg {
    max-width: 92%;
    margin: 0 0 12px;
    padding: 11px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    color: #18324c;
    box-shadow: 0 4px 14px rgba(15,23,42,.05);
    line-height: 1.5;
    overflow-wrap: anywhere;
    font: 650 14px/1.5 "Open Sans", Arial, sans-serif;
}
.ai-msg.is-user {
    margin-left: auto;
    border-color: #bfdbfe;
    background: #eff6ff;
}
.ai-msg.is-assistant {
    border-left: 4px solid #2563eb;
}
.ai-msg img {
    display: block;
    width: min(220px, 100%);
    max-height: 180px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #dbe5f0;
    margin: 0 0 8px;
}
.ai-msg small {
    display: block;
    margin-top: 6px;
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
}
.ai-msg strong {
    font-weight: 900;
}
.ai-msg em {
    font-style: italic;
}
.ai-msg code {
    display: inline-block;
    padding: 1px 5px;
    border-radius: 6px;
    background: #e2e8f0;
    color: #0f172a;
    font: 800 12px/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.ai-msg ul {
    margin: 8px 0 8px 18px;
    padding: 0;
}
.ai-msg li {
    margin: 4px 0;
}
.ai-msg a {
    color: #2563eb;
    font-weight: 900;
}
.ai-msg .ai-image-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    margin-top: 4px;
    padding: 0 10px;
    border: 1px solid #bfdbfe;
    border-radius: 9px;
    background: #eff6ff;
    color: #1d4ed8;
    text-decoration: none;
    font-size: 12px;
}

.support-msg {
    max-width: 86%;
    margin: 0 0 10px;
    padding: 10px 12px;
    border-radius: 13px;
    background: #fff;
    color: #18324c;
    box-shadow: 0 4px 16px rgba(15,23,42,.06);
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.support-msg.is-user {
    margin-left: auto;
    background: #0f766e;
    color: #fff;
}

.support-msg small {
    display: block;
    margin-top: 5px;
    color: inherit;
    opacity: .72;
    font-size: 11px;
    font-weight: 700;
}

.support-form {
    display: grid;
    gap: 10px;
    padding: 12px;
    border-top: 1px solid #e8eef6;
    background: #fff;
}

.support-form textarea {
    width: 100%;
    min-height: 76px;
    resize: vertical;
    border: 1px solid #cbd8e6;
    border-radius: 12px;
    padding: 10px 12px;
    font: 600 14px/1.45 "Open Sans", Arial, sans-serif;
}

.support-form button,
.support-login-link {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 11px;
    background: #2563eb;
    color: #fff;
    text-decoration: none;
    font: 800 14px/1 "Open Sans", Arial, sans-serif;
    cursor: pointer;
}
.ai-form {
    display: grid;
    gap: 10px;
    padding: 12px;
    border-top: 1px solid #e8eef6;
    background: #fff;
}
.ai-form textarea {
    width: 100%;
    min-height: 86px;
    max-height: 180px;
    resize: vertical;
    border: 1px solid #cbd8e6;
    border-radius: 12px;
    padding: 10px 12px;
    font: 600 14px/1.45 "Open Sans", Arial, sans-serif;
}
.ai-form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.ai-form button[type="submit"],
.ai-file-btn {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    font: 850 14px/1 "Open Sans", Arial, sans-serif;
    cursor: pointer;
}
.ai-form button[type="submit"] {
    min-width: 96px;
    border: 0;
    background: #2563eb;
    color: #fff;
}
.ai-form button[type="submit"]:disabled {
    opacity: .65;
    cursor: wait;
}
.ai-file-btn {
    min-width: 82px;
    border: 1px solid #d6e1ee;
    background: #f8fbff;
    color: #18324c;
}
.ai-file-btn input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}
.ai-attachment {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    background: #eff6ff;
    color: #1e3a8a;
    font: 800 12px/1.3 "Open Sans", Arial, sans-serif;
}
.ai-attachment button {
    border: 0;
    background: transparent;
    color: #b91c1c;
    font: inherit;
    cursor: pointer;
}

@media (max-width: 760px) {
    body.has-site-shell {
        padding-top: 116px;
    }
    .site-toolbar-inner {
        align-items: flex-start;
        flex-direction: column;
    }
    .site-nav {
        width: 100%;
        justify-content: flex-start;
    }
    .site-nav a,
    .site-nav button {
        flex: 1 1 auto;
    }
    .site-brand span {
        white-space: normal;
    }
    .ai-fab {
        right: 14px;
        bottom: 80px;
    }
    .support-fab {
        right: 14px;
        bottom: 14px;
    }
    .ai-panel {
        right: 14px;
        bottom: 146px;
        width: calc(100vw - 28px);
        height: min(620px, calc(100vh - 162px));
    }
    .support-panel {
        right: 14px;
        bottom: 78px;
    }
}


/* ===== Site footer ===== */
.site-footer{
    margin-top:48px;
    background:#0b1f3a;
    color:#dbe7f5;
    border-top:1px solid rgba(255,255,255,.06);
}
.site-footer-inner{
    width:min(1180px, calc(100% - 32px));
    margin:0 auto;
    padding:36px 0 28px;
    display:grid;
    grid-template-columns:1.4fr 1fr 1fr 1.1fr;
    gap:28px 24px;
}
.site-footer .sf-logo{
    font-size:22px;
    font-weight:800;
    color:#fff;
    letter-spacing:.02em;
    margin-bottom:10px;
}
.site-footer .sf-brand p{
    margin:0;
    font-size:13.5px;
    line-height:1.6;
    color:#9fb2c9;
    font-weight:600;
    max-width:320px;
}
.site-footer h4{
    margin:0 0 12px;
    font-size:13px;
    font-weight:800;
    letter-spacing:.06em;
    text-transform:uppercase;
    color:#fff;
}
.site-footer .sf-col a{
    display:flex;
    align-items:center;
    gap:8px;
    color:#c9d8ea;
    text-decoration:none;
    font-size:13.5px;
    font-weight:700;
    min-height:28px;
}
.site-footer .sf-col a:hover{color:#fff}
.site-footer .sf-ico{opacity:.85}
.sf-btns{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
}
.sf-btn{
    display:inline-flex !important;
    align-items:center;
    justify-content:center;
    min-height:36px !important;
    padding:0 12px !important;
    border:1px solid rgba(255,255,255,.18);
    border-radius:8px;
    background:rgba(255,255,255,.04);
    color:#e8f0fa !important;
    font-size:12.5px !important;
    font-weight:800 !important;
}
.sf-btn.primary{
    background:#0f766e;
    border-color:#0f766e;
    color:#fff !important;
}
.sf-btn:hover{background:rgba(255,255,255,.1)}
.sf-btn.primary:hover{background:#0d9488}
.site-footer-bottom{
    border-top:1px solid rgba(255,255,255,.08);
    padding:14px 0 18px;
    text-align:center;
    font-size:12px;
    font-weight:700;
    color:#8aa0b8;
}
body.has-site-shell{
    /* keep room for footer naturally */
}
@media (max-width:960px){
    .site-footer-inner{grid-template-columns:1fr 1fr; gap:22px}
}
@media (max-width:640px){
    .site-footer-inner{grid-template-columns:1fr; padding-top:28px}
    .sf-btns{width:100%}
    .sf-btn{flex:1 1 calc(50% - 8px)}
}


/* footer hard overrides — win over page-local `a` styles */
.site-footer,
.site-footer * {
    box-sizing: border-box;
}
.site-footer {
    display: block !important;
    width: 100% !important;
    margin-top: 48px !important;
    background: #0b1f3a !important;
    color: #dbe7f5 !important;
}
.site-footer a {
    color: #c9d8ea !important;
    text-decoration: none !important;
    font-weight: 700 !important;
}
.site-footer a:hover {
    color: #ffffff !important;
}
.site-footer .sf-btn {
    color: #e8f0fa !important;
}
.site-footer .sf-btn.primary {
    color: #ffffff !important;
}
.site-footer h4 {
    color: #ffffff !important;
}
.site-footer-bottom {
    color: #8aa0b8 !important;
}
