/* Novachat shared visual system. Routes and module behaviours remain owned by PHP. */
.novachat-app, .novachat-public {
    --nc-accent: #4f57dc;
    --nc-accent-hover: #3e45bb;
    --nc-ink: #202a43;
    --nc-muted: #66738b;
    --nc-border: #e4e9f2;
    --nc-surface: #fff;
    --nc-soft: #f2f4fc;
    --nc-canvas: #f5f7fb;
    --nc-shadow: 0 4px 20px rgb(30 45 80 / 4%);
    --nc-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    font-family: var(--nc-font);
}
.novachat-app[data-theme=light] {
    --sp-primary: #4f57dc;
    --sp-primary-rgb: 79, 87, 220;
    --sp-primary-active: #3e45bb;
    --sp-primary-light: #eef0ff;
    --sp-text-primary: #4f57dc;
    --sp-app-bg-color: #f5f7fb;
    --sp-text-gray-500: #69768c;
    --sp-text-gray-600: #647189;
    --sp-text-gray-700: #4e5b73;
    --sp-text-gray-800: #293550;
    --sp-text-gray-900: #202a43;
}
.novachat-app[data-theme=dark] {
    --nc-ink: #e5e9f6;
    --nc-muted: #a6b0c9;
    --nc-border: #343b52;
    --nc-surface: #22283b;
    --nc-soft: #2d344d;
    --nc-canvas: #191e2e;
    --nc-accent: #9298ff;
}
.novachat-app body, .novachat-app h1, .novachat-app h2, .novachat-app h3,
.novachat-app h4, .novachat-app h5, .novachat-app h6,
.novachat-public, .novachat-public h1, .novachat-public h2, .novachat-public h3,
.novachat-public h4, .novachat-public h5, .novachat-public h6,
.novachat-public .header { font-family: var(--nc-font); }
.novachat-app body { background: var(--nc-canvas); color: var(--nc-ink); }
.novachat-app .btn, .novachat-public .btn {
    border-radius: 12px !important;
    font-weight: 600;
    line-height: 1.4;
    transition: background-color .15s, border-color .15s, box-shadow .15s;
}
.novachat-public .btn-primary, .novachat-app .btn-primary {
    background: #4f57dc !important; border-color: #4f57dc !important; color: #fff !important;
}
.novachat-public .btn-primary:hover, .novachat-app .btn-primary:hover { background: #3e45bb !important; border-color: #3e45bb !important; }
.novachat-public .btn-dark { background: #202a43 !important; border-color: #202a43 !important; }
.novachat-app :is(a, button, input, textarea, select, summary):focus-visible,
.novachat-public :is(a, button, input, textarea, select, summary):focus-visible {
    outline: 3px solid #8088f1; outline-offset: 3px;
}
.novachat-app :is(.form-control, .form-select), .novachat-public :is(.form-control, .form-select) {
    border-radius: 10px; border-color: var(--nc-border); min-height: 44px;
}
.novachat-app :is(.form-control, .form-select):focus, .novachat-public :is(.form-control, .form-select):focus {
    border-color: #8389ed; box-shadow: 0 0 0 3px rgb(79 87 220 / 12%);
}
.novachat-app .card { border: 1px solid var(--nc-border); border-radius: 18px !important; box-shadow: var(--nc-shadow); background: var(--nc-surface); }
.novachat-app .card-header { border-bottom-color: var(--nc-border); min-height: 64px; gap: 12px; flex-wrap: wrap; }
.novachat-app .card-title { color: var(--nc-ink); font-weight: 650; }
.novachat-app .text-primary { color: var(--nc-accent) !important; }
.novachat-app .card-body { min-width: 0; }
.novachat-app .main-wrapper > .container { max-width: 1440px; padding: 28px !important; }
.novachat-app .table { color: var(--nc-ink); }
.novachat-app .table th { color: var(--nc-muted); font-weight: 600; background: var(--nc-soft); }
.novachat-app .table td { vertical-align: middle; }
.novachat-app .table > :not(caption) > * > * { padding-top: 14px; padding-bottom: 14px; border-bottom-color: var(--nc-border); }
.novachat-app .dropdown-menu { border: 1px solid var(--nc-border); border-radius: 14px; padding: 8px; box-shadow: 0 12px 36px rgb(20 30 55 / 14%); }
.novachat-app .dropdown-item { border-radius: 8px; min-height: 44px; }
.novachat-app .nav-tabs, .novachat-app .nav-pills { gap: 6px; }
.novachat-app .nav-pills .nav-link { border-radius: 10px; }
.novachat-app .sidebar { box-shadow: none; border-inline-end: 1px solid var(--nc-border); }
.novachat-app .sidebar-logo { border-bottom: 1px solid var(--nc-border); margin-bottom: 12px; }
.novachat-app .sidebar .nav-link { border-radius: 12px !important; min-height: 44px; }
.novachat-app .sidebar .nav-link.active { box-shadow: inset 3px 0 var(--nc-accent); }
.novachat-app .sidebar .nav-link:hover { background-color: var(--nc-soft); }
.novachat-app .sub-sidebar { box-shadow: none; border-color: var(--nc-border); }
.novachat-app .sub-sidebar .sp-menu-item { border-radius: 12px !important; }
.novachat-app .main-wrapper { min-width: 0; }

/* Header: primary actions always fit; optional tools have their own panel. */
.novachat-app .nc-header { box-shadow: none; border-bottom: 1px solid var(--nc-border); background: var(--nc-surface) !important; }
.novachat-app body .nc-header { width: calc(100% - 80px) !important; }
.novachat-app body.sidebar-open .nc-header { width: calc(100% - 250px) !important; }
.novachat-app body:has(.sub-sidebar) .nc-header { width: calc(100% - 345px) !important; }
.novachat-app body.sidebar-open:has(.sub-sidebar) .nc-header { width: calc(100% - 515px) !important; }
.nc-header-inner { display: flex; align-items: center; justify-content: space-between; height: 100%; padding-inline: 24px; gap: 16px; }
.nc-navigation, .nc-header-actions, .nc-header-tools-panel { display: flex; align-items: center; gap: 12px; min-width: 0; }
.nc-navigation { flex: 1; }
.nc-page-title { color: var(--nc-ink); font-size: 17px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nc-header-actions { flex: 0 0 auto; }
.nc-header-tools { position: relative; }
.nc-header-tools > summary { display: none; list-style: none; }
.nc-header-tools > summary::-webkit-details-marker { display: none; }
.nc-header :is(.btn, .dropdown-toggle, summary) { min-height: 44px; }
.nc-header :is(.dropdown-toggle, summary) { display: flex !important; align-items: center; justify-content: center; min-width: 44px; }
.nc-header .nc-header-tools > summary { display: none !important; }
.nc-header .nc-header-actions .ms-1, .nc-header .nc-header-actions .ms-2, .nc-header .nc-header-actions .ms-3 { margin-inline-start: 0 !important; }
.nc-header-profile { display: flex; align-items: center; gap: 6px; }
.nc-header .nc-token { border-radius: 12px !important; padding-block: 0 !important; }
.nc-header .nc-token .btn { width: 44px !important; height: 44px !important; }
.nc-header .nc-header-profile img { width: 36px !important; height: 36px !important; }
.nc-header .nc-header-profile .dropdown-menu { min-width: 230px; }
.nc-header .nc-subscription { gap: 12px; }
.nc-header .nc-subscription .btn { display: inline-flex; align-items: center; justify-content: center; }
.nc-header .nc-subscription > .me-2 { margin: 0 !important; color: var(--nc-muted); font-size: 12px; }

/* Dashboard and profile no longer rely on horizontal strips. */
.novachat-app .nc-welcome-card { background: linear-gradient(125deg, #253559, #494ca2) !important; box-shadow: none !important; min-height: 216px; height: 100%; overflow: hidden; position: relative; }
.nc-welcome-column > .card { height: 100%; }
.nc-welcome-copy { min-width: 0; z-index: 1; }
.nc-welcome-name { display: block; overflow-wrap: anywhere; line-height: 1.5; }
.nc-welcome-art { width: 78px; flex: 0 0 78px; opacity: .6; }
.nc-welcome-art img { width: 78px !important; }
.nc-channel-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.novachat-app .nc-channel-grid .dashboard-channel-card { min-width: 0 !important; margin: 0 !important; padding: 20px 10px !important; border-radius: 14px !important; background: var(--nc-canvas) !important; transition: border-color .15s, background .15s; }
.novachat-app .nc-channel-grid .dashboard-channel-card:hover { border-color: var(--nc-accent) !important; background: var(--nc-soft) !important; }
.novachat-app .dashboard-channel-status { font-size: 12px; line-height: 1.4; }
.novachat-app .dashboard-channel-status.text-secondary { color: var(--nc-muted) !important; }
.nc-profile-page > .d-flex > div { min-width: 0; overflow-wrap: anywhere; }
.novachat-app .nc-profile-page #pills-tab { padding: 6px; background: var(--nc-soft) !important; }
.novachat-app .nc-profile-page #pills-tab .nav-link.active { box-shadow: var(--nc-shadow); color: var(--nc-accent) !important; background: var(--nc-surface) !important; }

/* Public pages: typography, spacing and the same controls as the cabinet. */
.novachat-public { background: #fff; color: var(--nc-ink); line-height: 1.65; }
.novachat-public .container { max-width: 1240px; }
.novachat-public h1 { font-size: clamp(30px, 3.6vw, 46px); line-height: 1.15; letter-spacing: -.035em; color: var(--nc-ink); }
.novachat-public h4 { line-height: 1.3; }
.novachat-public .text-gray-500, .novachat-public .text-gray-600 { color: var(--nc-muted) !important; }
.novachat-public .header { background: rgb(255 255 255 / 97%); border-bottom: 1px solid var(--nc-border); box-shadow: none; }
.novachat-public .header .navbar { min-height: 80px; padding-block: 12px !important; }
.novachat-public .header .logo { height: 34px; }
.novachat-public .header .navbar-nav > .nav-item > .nav-link { text-transform: none; font-size: 15px; font-weight: 600; padding: 12px !important; color: var(--nc-muted); }
.novachat-public .header .navbar-nav > .nav-item > .nav-link:hover { color: var(--nc-accent); }
.novachat-public .navbar-toggler { border: 1px solid var(--nc-border); border-radius: 12px; }
.novachat-public .nav-btn-login { display: flex; gap: 10px; padding-block: 0 !important; margin-inline-end: 0 !important; }
.novachat-public .nav-btn-login .btn { margin: 0 !important; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.novachat-public .banner { margin: 104px 20px 72px; padding: 64px 24px; border: 1px solid #e6e9fa; border-radius: 28px; background: linear-gradient(120deg, #f4f6ff 0%, #f8faff 60%, #eef5fc 100%); }
.novachat-public .banner .title { font-size: clamp(34px, 4.2vw, 58px); line-height: 1.1; letter-spacing: -.045em; font-weight: 750; color: #253456 !important; }
.novachat-public .banner .desc { font-size: 18px; line-height: 1.7; }
.novachat-public .banner .circles, .novachat-public .banner-circle-shape, .novachat-public .banner-circle-shape-2 { display: none; }
.novachat-public .mobile-hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.novachat-public .mobile-hero-actions .btn { margin: 0 !important; min-height: 48px; padding: 14px 20px; text-transform: none !important; font-size: 15px; box-shadow: none; }
.novachat-public .section { scroll-margin-top: 100px; }
.novachat-public .section.m-b-100, .novachat-public .section.m-b-120 { margin-bottom: 72px !important; }
.novachat-public .features .item { padding: 28px !important; border-radius: 20px !important; border: 1px solid var(--nc-border); background: #f8faff !important; }
.novachat-public .features .icon { background: #edf0ff !important; color: var(--nc-accent) !important; border-radius: 16px !important; }
.novachat-public .headline h5 { color: var(--nc-accent); font-size: 14px; font-weight: 650; line-height: 1.6; }
.novachat-public .headline { padding-inline: 12px; }
.novachat-public .pricing-compact-card { border-radius: 20px; background: #fff; box-shadow: var(--nc-shadow); }
.novachat-public .pricing-compact-card .plan-name { font-size: clamp(26px, 2.4vw, 34px); line-height: 1.2; overflow-wrap: anywhere; }
.novachat-public .pricing-compact-card .pricing-price-line { flex-wrap: wrap; row-gap: 8px; }
.novachat-public .pricing-compact-card .pricing-price-value { font-size: 42px; }
.novachat-public .login { margin-top: 104px; padding-block: 32px; border: 0 !important; }
.novachat-public .login > .shadow { box-shadow: 0 12px 48px rgb(30 45 80 / 8%) !important; border: 1px solid var(--nc-border); overflow: hidden; border-radius: 24px !important; }
.novachat-public .login .headline { text-align: start; padding: 0; }
.novachat-public .login .bg-login-page { background: linear-gradient(135deg, #253559, #494ca2) !important; }
.novachat-public .login .bg-login-page h1 { color: #fff; }
.novachat-public .login a:not(.btn) { color: var(--nc-accent); }
.novachat-public .footer { background: #f5f7fc; border-top: 1px solid var(--nc-border); padding-top: 48px; }
.novachat-public .blogs h3 a { color: var(--nc-ink); }
.novachat-public #gdpr-cookie-message { position: fixed; inset: auto auto 16px 16px; width: min(480px, calc(100vw - 32px)); max-height: calc(100dvh - 104px); overflow-y: auto; background: #fff !important; color: var(--nc-ink); border: 1px solid var(--nc-border); border-radius: 18px; padding: 22px; box-shadow: 0 12px 48px rgb(30 45 80 / 20%); z-index: 1000000; }
.novachat-public #gdpr-cookie-message .container { padding: 0; }
.novachat-public #gdpr-cookie-message :is(p, label, h4, h5) { color: var(--nc-ink); }
.novachat-public #gdpr-cookie-message h4 { font-size: 18px; }
.novachat-public #gdpr-cookie-message p { font-size: 13px; line-height: 1.6; }
.novachat-public #gdpr-cookie-message a { color: var(--nc-accent); }
.novachat-public #gdpr-cookie-message p:last-child { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 0; }
.novachat-public #gdpr-cookie-message .btn { margin: 0 !important; min-height: 44px; }

/* The support launcher stays small on phones and toggles with a click. */
.nc-chat-ready .chat-options { opacity: 0 !important; visibility: hidden !important; pointer-events: none !important; }
.nc-chat-ready.nc-chat-open .chat-options { opacity: 1 !important; visibility: visible !important; pointer-events: auto !important; transform: translateY(0); }
.novachat-app .chat-main-button, .novachat-public .chat-main-button { background: #4f57dc; border-radius: 16px; box-shadow: 0 6px 24px rgb(40 50 100 / 18%); }

@media (max-width: 1399.98px) {
    .nc-header .nc-header-tools > summary { display: flex !important; cursor: pointer; width: 44px; height: 44px; border-radius: 12px; background: var(--nc-soft); color: var(--nc-ink); }
    .nc-header-tools[open] > summary { box-shadow: inset 0 0 0 2px var(--nc-accent); }
    .nc-header-tools-panel { position: fixed; top: 73px; inset-inline-end: 12px; width: min(360px, calc(100vw - 24px)); padding: 16px; background: var(--nc-surface); border: 1px solid var(--nc-border); box-shadow: 0 12px 36px rgb(20 30 55 / 16%); border-radius: 16px; flex-wrap: wrap; z-index: 51; }
    .nc-header-tools-panel > div { max-width: 100%; }
    .nc-header-tools-panel > div > .gap-2 { flex-wrap: wrap; }
    .nc-header .nc-subscription > .me-2 { display: none !important; }
    .nc-header-inner { gap: 12px; padding-inline: 16px; }
    .nc-header-actions { gap: 8px; }
    .novachat-public .header .navbar-expand-lg { flex-wrap: wrap; }
    .novachat-public .header .nav-link { padding-inline: 8px !important; }
}
@media (max-width: 991.98px) {
    .novachat-public .header .navbar-nav { margin-top: 12px; }
    .novachat-public .header .navbar-collapse { padding-bottom: 12px; }
    .novachat-public .nav-btn-login { flex-wrap: wrap; }
    .novachat-public .banner { padding: 40px 20px; }
    .novachat-public .banner .row > .col-md-6 { width: 100%; }
    .novachat-public .banner picture { display: block; max-width: 580px; margin: 20px auto 0; }
    .nc-channel-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
    .novachat-app body .nc-header,
    .novachat-app body.sidebar-open .nc-header,
    .novachat-app body:has(.sub-sidebar) .nc-header,
    .novachat-app body.sidebar-open:has(.sub-sidebar) .nc-header { width: 100% !important; }
    .nc-header-inner { padding-inline: 12px; gap: 8px; }
    .nc-navigation { flex: 0 0 auto; gap: 6px; }
    .nc-page-title { display: none; }
    .nc-header-actions { gap: 6px; }
    .nc-header .nc-subscription { gap: 0; }
    .nc-header .nc-subscription .btn { padding: 10px 12px !important; font-size: 12px; }
    .nc-header .nc-header-profile .dropdown-menu { position: fixed; top: 73px !important; inset-inline: 12px; width: auto; max-width: none; max-height: calc(100dvh - 90px); overflow-y: auto; }
    .nc-header-tools-panel .dropdown-menu { inset-inline-end: 0; max-width: calc(100vw - 56px); }
    .novachat-app .main-wrapper > .container { padding: 20px 16px !important; margin-block: 0 !important; }
    .novachat-app .main-wrapper.n-scroll { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
    .novachat-app .card-header, .novachat-app .card-body:not(.p-0):not(.nc-welcome-card):not(.nc-channel-grid) { padding: 18px; }
    .novachat-app .nc-channel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .novachat-app .nc-channel-grid .dashboard-channel-card { min-height: 150px; padding: 16px 8px !important; }
    .novachat-app .nc-profile-page #pills-tab { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .novachat-app .nc-profile-page #pills-tab .nav-link { width: 100%; height: 100% !important; white-space: normal; padding: 12px 8px !important; text-align: start; }
    .nc-welcome-art { width: 60px; flex-basis: 60px; }
    .nc-welcome-art img { width: 60px !important; }
    .novachat-app .nc-welcome-copy { padding: 22px !important; }
    .novachat-public .container { padding-inline: 20px; }
    .novachat-public .header .logo { height: 30px; }
    .novachat-public .header .navbar { min-height: 72px; }
    .novachat-public .banner { margin: 88px 12px 48px; padding: 30px 0 16px; border-radius: 22px; }
    .novachat-public .banner .title { font-size: clamp(30px, 8.5vw, 42px); }
    .novachat-public .banner .desc { font-size: 16px; }
    .novachat-public .mobile-hero-actions { flex-direction: column; }
    .novachat-public .mobile-hero-actions .btn { width: 100%; text-align: center; }
    .novachat-public .features .item { padding: 24px !important; }
    .novachat-public .features .headline { margin-bottom: 32px; }
    .novachat-public .section.m-b-100, .novachat-public .section.m-b-120 { margin-bottom: 48px !important; }
    .novachat-public .login { margin-top: 88px; padding-top: 16px; }
    .novachat-public .login .bg-login-page { min-height: 0 !important; }
    .novachat-public #gdpr-cookie-message { max-height: min(460px, calc(100dvh - 104px)); padding: 18px; }
    .novachat-public .scroll-top { bottom: 80px; right: 16px; }
    .novachat-public .login .p-50 { padding: 28px 20px !important; }
    .novachat-app .chat-main-button, .novachat-public .chat-main-button { width: 48px; min-width: 48px; height: 48px; padding: 0; font-size: 0; }
    .novachat-app .chat-main-button::after, .novachat-public .chat-main-button::after { content: '?'; font: 700 24px/1 var(--nc-font); }
    .novachat-app .chat-widget, .novachat-public .chat-widget { right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
    .novachat-public [data-aos] { opacity: 1 !important; transform: none !important; transition: none !important; }
    .novachat-public .circles li, .novachat-app .animate__animated { animation: none !important; }
}
