/* UN Brand Identity quick guide: UN blue #009edb, black, white, Roboto.
   Istemi retains its own product identity. SDG catalog colors stay untouched. */
@font-face { font-family:Roboto; src:url('../fonts/roboto/Roboto-Variable.ttf') format('truetype'); font-style:normal; font-weight:100 900; font-display:swap; }
.brand-login,.brand-home { --un-blue:#009edb; --un-black:#000; --un-white:#fff; --tblr-font-sans-serif:Roboto,Arial,sans-serif; --tblr-body-font-family:Roboto,Arial,sans-serif; font-family:Roboto,Arial,sans-serif; }
.brand-login h1,.brand-login h2,.brand-home h1,.brand-home h2,.brand-home h3,.brand-home h4 { font-family:Roboto,Arial,sans-serif; }
.brand-wordmark { display:inline-flex; align-items:baseline; gap:3px; width:auto; color:inherit; font-size:31px; font-weight:750; line-height:1.1; letter-spacing:-1.3px; text-decoration:none; }
.brand-wordmark::after { content:'.'; color:var(--un-blue); }
.brand-wordmark:hover { color:inherit; text-decoration:none; }
.brand-eyebrow { display:block; margin-bottom:18px; font-size:11px; font-weight:700; letter-spacing:1.8px; text-transform:uppercase; }
.brand-rule { width:56px; height:4px; background:var(--un-blue); margin:22px 0; }
/* Sign-in: a quiet, high-contrast editorial layout with one clear action. */
html.brand-auth-document { height:auto; min-height:100%; position:static; overflow:auto; background:#fff; }
body.brand-login { height:auto; min-height:100dvh; position:static; overflow:auto; color:#000; background:#fff; --istemi-text:#000; --istemi-muted:#525252; --tblr-body-color:#000; --tblr-bg-surface:#fff; --tblr-secondary:#525252; }
.brand-login-shell { min-height:100dvh; max-width:1400px; margin:0 auto; padding:32px 48px 20px; display:flex; flex-direction:column; }
.brand-login-header { display:flex; align-items:center; justify-content:space-between; gap:24px; padding-bottom:26px; border-bottom:1px solid #dedede; }
.brand-login-header > span { color:#525252; font-size:12px; }
.brand-login-main { flex:1; display:grid; grid-template-columns:1.1fr 1fr; align-items:stretch; gap:0; margin:40px 0; min-height:500px; }
.brand-login-intro { display:flex; flex-direction:column; justify-content:space-between; padding:48px; background:var(--un-blue); color:#000; }
.brand-login-intro h1 { font-size:clamp(36px,4.2vw,61px); font-weight:750; line-height:1.04; letter-spacing:-2px; margin:0 0 24px; max-width:530px; }
.brand-login-intro > div > p { font-size:16px; line-height:1.7; max-width:390px; margin:0; }
.brand-login-principles { display:flex; flex-direction:column; gap:13px; padding-top:38px; margin:0; list-style:none; }
.brand-login-principles li { display:flex; align-items:center; gap:16px; font-size:13px; }
.brand-login-principles li span { font-size:10px; font-weight:700; opacity:.7; }
.brand-login-form-panel { padding:48px clamp(26px,4vw,66px); display:flex; flex-direction:column; justify-content:center; border:1px solid #dedede; border-left:0; }
.brand-login-form-panel h2 { font-size:30px; font-weight:700; letter-spacing:-.7px; margin:0 0 10px; }
.brand-login-form-panel > p { color:#525252; font-size:14px; line-height:1.6; margin-bottom:28px; }
.brand-login .form-label { font-size:13px; font-weight:600; margin-bottom:8px; color:#000; }
.brand-login .form-control { border:1px solid #aaa; background:#fff; color:#000; padding:13px 14px; border-radius:3px; font-size:15px; }
.brand-login .form-control::placeholder { color:#696969; opacity:1; }
.brand-login .form-control:focus { border-color:#000; box-shadow:0 0 0 3px #009edb33; }
.brand-login .brand-sign-in { width:100%; display:flex; align-items:center; justify-content:space-between; padding:13px 16px; border:1px solid #009edb; border-radius:3px; background:#009edb; color:#000; font-weight:700; margin-top:26px; }
.brand-login .brand-sign-in:hover { background:#008fc6; border-color:#008fc6; color:#000; }
.brand-login-note { font-size:12px; line-height:1.6; color:#525252; margin-top:20px; }
.brand-login-footer { display:flex; justify-content:space-between; gap:16px; color:#525252; font-size:11px; padding:8px 0 0; }
.brand-login .alert { background:#fff; color:#000; border:1px solid #000; border-left:4px solid #009edb; border-radius:3px; }
.brand-login .alert p:last-child { margin-bottom:0; }
/* Workspace: shared brand tokens, readable controls, original layout and IDs. */
body.brand-home { --istemi-page:#fff; --istemi-surface:#fff; --istemi-soft:#f5f5f5; --istemi-border:#dedede; --istemi-text:#000; --istemi-muted:#545454; --istemi-blue:#006f9b; --istemi-blue-soft:#eaf7fc; --istemi-teal:#006f9b; --istemi-teal-soft:#eaf7fc; --tblr-primary:#009edb; --tblr-primary-rgb:0,158,219; --tblr-body-color:#000; --tblr-bg-surface:#fff; --tblr-bg-surface-secondary:#f5f5f5; --tblr-border-color:#dedede; background:#fff; color:#000; }
body.brand-home[data-bs-theme="dark"] { --istemi-page:#0b0b0b; --istemi-surface:#111; --istemi-soft:#1c1c1c; --istemi-border:#393939; --istemi-text:#fff; --istemi-muted:#c2c2c2; --istemi-blue:#4bc9fa; --istemi-blue-soft:#092733; --istemi-teal:#4bc9fa; --istemi-teal-soft:#092733; --tblr-body-color:#fff; --tblr-bg-surface:#111; --tblr-bg-surface-secondary:#1c1c1c; --tblr-border-color:#393939; background:#0b0b0b; color:#fff; }
.brand-home .chat-layout { border-top:4px solid var(--un-blue); box-sizing:border-box; }
.brand-home .chat-layout main,.brand-home.if-enabled main { background:var(--istemi-page); }
.brand-home #sidebarLeft { background:var(--istemi-surface)!important; color:var(--istemi-text)!important; border-right:1px solid var(--istemi-border); }
.brand-home #sidebarLeft .brand-wordmark { height:36px; max-width:none; font-size:31px; }
.brand-home #sidebarLeft .text-muted { color:var(--istemi-muted)!important; }
.brand-home #sidebarLeft .list-group-item { color:var(--istemi-text); border-radius:3px!important; }
.brand-home #sidebarLeft .list-group-item.active { background:#eaf7fc!important; color:#000!important; box-shadow:inset 3px 0 0 var(--un-blue); }
.brand-home #sidebarLeft .btn-ghost-light { color:var(--istemi-text); }
.brand-home #sidebarLeft .chat-list-container { padding-left:18px!important; padding-right:18px!important; }
.brand-home #sidebarLeft.collapsed .main-logo { display:none!important; }
.brand-home #sidebarLeft .logo-small-icon { display:none!important; }
.brand-home #sidebarLeft .toggle-btn .menu-icon { display:inline-block!important; }
.brand-home #sidebarLeft .user-area:hover { background:var(--istemi-soft); }
.brand-home .btn-primary,.brand-home.if-enabled .btn-primary,.brand-home #sidebarLeft .btn-primary { background:#009edb; border-color:#009edb; color:#000; font-weight:650; box-shadow:none!important; }
.brand-home .btn-primary:hover,.brand-home #sidebarLeft .btn-primary:hover { background:#00a9eb; border-color:#00a9eb; color:#000; }
.brand-home #sidebarLeft .btn-new-chat { border-radius:4px!important; }
.brand-home #sidebarLeft.collapsed .btn-new-chat { border-radius:50%!important; }
.brand-home .chat-bubble-user.bg-primary { background:#009edb!important; color:#000!important; }
.brand-home .chat-bubble-bot { background:var(--istemi-surface)!important; color:var(--istemi-text)!important; border-color:var(--istemi-border)!important; }
.brand-home .chat-layout main>.border-bottom { background:var(--istemi-surface); }
.brand-home .form-control:focus,.brand-home .form-select:focus { border-color:var(--un-blue); box-shadow:0 0 0 3px #009edb33; }
.brand-home .btn-outline-primary,.brand-home.if-enabled .btn-outline-primary { color:var(--istemi-text); border-color:var(--istemi-border); }
.brand-home .coach-switch-admin,.brand-home .coach-switch-ethics { border-left-color:var(--un-blue); }
.brand-home .coach-switch-un { border-left-color:var(--istemi-text); }
.brand-home .coach-switch-un:has(input:checked) { background:var(--istemi-soft); }
.brand-home .coach-card,.brand-home .coach-un { --coach-accent:var(--un-blue); --coach-tint:var(--istemi-blue-soft); }
.brand-home.if-enabled .if-report[data-coach=un] { border-top-color:var(--istemi-text); }
.brand-home .coach-order-dot { background:var(--un-blue); }
.brand-home .coach-order-dot[data-kind=un] { background:var(--istemi-text); }
.brand-home #coachSidebar .coaches-header { border-bottom:0!important; }
.brand-home .coach-workspace-tabs [aria-selected=true] { box-shadow:inset 0 -2px 0 var(--un-blue); }
.brand-home .avatar.bg-primary { background:var(--un-blue)!important; color:#000!important; }
.brand-home button:focus-visible,.brand-home a:focus-visible,.brand-login button:focus-visible,.brand-login a:focus-visible { outline:2px solid var(--istemi-text,#000); outline-offset:3px; }
/* Empty conversation: an editorial welcome, with no extra workflow controls. */
.brand-welcome { max-width:740px; margin:clamp(24px,4vh,48px) auto 24px; padding:0 22px; color:var(--istemi-text); text-align:left; }
.brand-welcome .brand-eyebrow { color:var(--istemi-muted); margin-bottom:16px; }
.brand-welcome h1 { font-size:clamp(32px,4.2vw,56px); font-weight:750; letter-spacing:-1.8px; line-height:1.08; margin:0; max-width:640px; }
.brand-welcome-copy { font-size:16px; line-height:1.7; color:var(--istemi-muted); max-width:550px; margin:0 0 34px; }
.brand-welcome-features { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:24px; padding:0; list-style:none; margin:0; }
.brand-welcome-features li { border-top:1px solid var(--istemi-border); padding-top:15px; }
.brand-welcome-features span { display:block; font-size:11px; font-weight:600; color:var(--istemi-muted); margin-bottom:10px; }
.brand-welcome-features h2 { font-size:14px; line-height:1.5; margin:0 0 5px; font-weight:650; }
.brand-welcome-features p { font-size:12px; line-height:1.6; color:var(--istemi-muted); margin:0; }
.brand-welcome-hint { border-top:1px solid var(--istemi-border); padding-top:14px; margin:22px 0 0; color:var(--istemi-muted); font-size:12px; line-height:1.6; }
@media(max-width:900px) {
 .brand-login-shell { padding:24px; }
 .brand-login-intro { padding:34px; }
 .brand-login-form-panel { padding:34px; }
 .brand-login-main { min-height:460px; margin:28px 0; }
 .brand-login-intro h1 { font-size:40px; }
}
@media(max-width:680px) {
 .brand-login-shell { padding:20px; }
 .brand-login-header { padding-bottom:18px; }
 .brand-login-header > span { font-size:11px; }
 .brand-login-main { grid-template-columns:1fr; margin:24px 0; min-height:0; }
 .brand-login-intro { padding:28px; }
 .brand-login-intro h1 { font-size:36px; letter-spacing:-1px; margin-bottom:16px; }
 .brand-login-intro > div > p { font-size:14px; }
 .brand-login-principles { display:none; }
 .brand-login-intro .brand-eyebrow { margin-bottom:14px; }
 .brand-login-form-panel { padding:28px; border-left:1px solid #dedede; border-top:0; }
 .brand-login-form-panel h2 { font-size:26px; }
 .brand-welcome { margin:28px auto 26px; padding:0 4px; }
 .brand-welcome h1 { font-size:35px; letter-spacing:-1px; }
 .brand-welcome-copy { font-size:14px; margin-bottom:22px; }
 .brand-welcome-features { grid-template-columns:1fr; gap:15px; }
 .brand-welcome-features li { padding-top:12px; }
 .brand-welcome-features p { font-size:12px; }
 .brand-home #messagesContainer { padding:22px 18px!important; }
}

.brand-home { --tblr-body-bg:var(--istemi-page); }
.brand-home #messageInputForm .bg-body { background:var(--istemi-surface)!important; border-color:var(--istemi-border)!important; }

/* Derive wordmark visibility from the actual sidebar state after a reload. */
.brand-home #sidebarLeft:not(.collapsed) .main-logo { display:inline-flex!important; }
.brand-home #sidebarLeft:not(.collapsed) #sidebar-header { justify-content:space-between!important; }

/* Keep copied-text selection distinct from blue message bubbles in both themes. */
body.brand-home::selection,
body.brand-home *::selection {
    background-color: #004b80;
    color: #ffffff;
    text-shadow: none;
}

/* Selected conversations keep black text on their light-blue highlight. */
.brand-home #sidebarLeft .list-group-item.active a,
.brand-home #sidebarLeft .list-group-item.active i,
.brand-home #sidebarLeft .list-group-item.active .text-muted {
    color: #000 !important;
}
