html[data-theme="light"], html[data-theme="dark"], :root {
 color-scheme: light;
 --primary:#1966FF; --secondary:#04034F; --accent:#FFFFFF;
 --primary-fg:#FFFFFF; --body-fg:#04034F; --body-bg:#FFFFFF;
 --body-quiet-color:#475569; --body-medium-color:#334155; --body-loud-color:#04034F;
 --header-color:#FFFFFF; --header-branding-color:#FFFFFF; --header-bg:#04034F; --header-link-color:#FFFFFF;
 --breadcrumbs-fg:#FFFFFF; --breadcrumbs-link-fg:#FFFFFF; --breadcrumbs-bg:#000FFF;
 --link-fg:#1966FF; --link-hover-color:#04034F; --link-selected-fg:#000FFF;
 --hairline-color:#E2E8F0; --border-color:#CBD5E1; --error-fg:#A52222;
 --message-success-bg:#D9F9F3; --message-warning-bg:#FFF2CB; --message-error-bg:#FFE1DE;
 --darkened-bg:#F5FAFF; --selected-bg:#E8F0FF; --selected-row:#E8F0FF;
 --button-fg:#FFFFFF; --button-bg:#000FFF; --button-hover-bg:#04034F;
 --default-button-bg:#000FFF; --default-button-hover-bg:#04034F;
 --close-button-bg:#475569; --close-button-hover-bg:#334155;
 --delete-button-bg:#B52F28; --delete-button-hover-bg:#8A201A;
 --object-tools-fg:#FFFFFF; --object-tools-bg:#04034F; --object-tools-hover-bg:#1966FF;
}
body, #content-start, #nav-sidebar { background:#F5FAFF; }
#header { min-height:64px; padding:16px 28px; box-sizing:border-box; }
.ked-brand { display:flex; align-items:center; gap:14px; text-decoration:none!important; color:#fff!important; }
.ked-brand strong { display:block; font-size:20px; font-weight:700; }
.ked-brand small { display:block; font-size:12px; margin-top:5px; color:#DCE8FF; }
.ked-logo { max-width:115px; max-height:48px; width:auto; height:auto; object-fit:contain; }
.ked-logo[hidden] { display:none!important; }
.module, #changelist, .login #container { background:#FFFFFF; border-radius:10px; }
.module h2, .module caption, .inline-group h2 { background:#1966FF; color:#fff; }
.module caption a { color:#fff; }
.button, input[type=submit], input[type=button], .submit-row input, a.button { border-radius:7px; }
input[type="checkbox"], input[type="radio"] { accent-color:#000FFF; }
input:focus, select:focus, textarea:focus { outline:2px solid #1966FF; outline-offset:2px; }
.theme-toggle { display:none!important; }
.login #header { height:auto; justify-content:center; }
.login #container { min-width:0; width:min(420px,94vw); }
@media(max-width:767px){ #header{padding:12px 16px;} .ked-brand strong{font-size:17px;} .ked-logo{max-width:80px;} }

.ked-logo { background:#fff; padding:7px 10px; border-radius:8px; box-sizing:content-box; }
.login .ked-brand { flex-wrap:wrap; justify-content:center; }
.login .ked-brand span { text-align:center; }

/* Icon-only KED branding */
#site-name .ked-brand .ked-logo { display:block; width:48px; height:44px; max-width:48px; max-height:44px; object-fit:contain; background:transparent; padding:0; border:0; border-radius:0; box-shadow:none; flex:none; }

#site-name .ked-brand .ked-logo {width:220px;max-width: min(220px, 50vw);height:auto;max-height:65px;}
.login #site-name .ked-brand .ked-logo {max-width:240px;width: min(240px, 65vw);}

/* Preserve Django's built-in responsive sidebar and form behavior. */
@media screen and (max-width:767px){
 #header{height:auto;min-height:64px;gap:8px;flex-wrap:wrap}
 #branding,#site-name{min-width:0;max-width:100%}
 #site-name .ked-brand{gap:8px;flex-wrap:wrap}
 #site-name .ked-brand .ked-logo{width: min(190px,55vw);max-width:100%}
 #user-tools{overflow-wrap:anywhere;white-space:normal}
 .login #container{width:min(420px,calc(100% - 24px));max-width:100%;box-sizing:border-box}
 .login #content{padding:16px}
 .login .form-row input{box-sizing:border-box;max-width:100%;font-size:16px}
 #changelist .results{max-width:100%;overflow-x:auto}
}
