:root{--accent:#1e5fa8;--surface:#f5f7fa}*{box-sizing:border-box}body{margin:0;background:var(--surface);color:#111;font:16px/1.5 system-ui,Arial,sans-serif}.schedule-editor{max-width:1100px;margin:24px auto;padding:24px;background:#fff;border:1px solid #dce3eb;border-left:5px solid var(--accent);border-radius:10px}h1{font:700 26px/1.25 Georgia,serif}fieldset{margin:20px 0;padding:20px;border:1px solid #dce3eb;border-radius:6px}legend{font-weight:700}.fields{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}label{display:flex;flex-direction:column;gap:6px;margin-bottom:12px}input,select,textarea,button{font:inherit}input,select,textarea{width:100%;padding:8px;border:1px solid #9baab8;border-radius:4px}.wide{grid-column:1/-1}.check{flex-direction:row;align-items:center}.check input{width:auto}button{padding:9px 16px;border:0;border-radius:4px;background:var(--accent);color:#fff;cursor:pointer}button:disabled{opacity:.5;cursor:wait}a{color:var(--accent)}table{border-collapse:collapse;width:100%}th,td{text-align:left;padding:8px;border:1px solid #dce3eb}#result{font-weight:600}#login-form{max-width:420px}@media(max-width:700px){.fields{grid-template-columns:1fr}.schedule-editor{margin:8px;padding:16px}}@media print{button,form{display:none}}

/* D82 B3-B4: viewport-safe, keyboard accessible data tables and shared navigation. */
html,body{max-width:100%;overflow-x:clip}
.schedule-editor{width:calc(100% - 16px);min-width:0}
.table-scroll{max-width:100%;width:100%;overflow-x:auto;overscroll-behavior-x:contain;outline-offset:3px}
.table-scroll table{width:max-content;min-width:100%;max-width:none}
.table-scroll:focus-visible,.admin-navigation a:focus-visible{outline:3px solid #1e5fa8}
.admin-navigation{max-width:100%;margin:12px 0 20px;min-width:0}
.admin-navigation nav{display:flex;flex-wrap:wrap;align-items:center;gap:6px 14px;max-width:100%;padding:12px;background:#eff4f9;border:1px solid #dce3eb;border-radius:6px}
.admin-navigation a[aria-current="page"]{font-weight:700;text-decoration:underline;text-underline-offset:3px}
.admin-navigation p{overflow-wrap:anywhere}
.d82b-public-nav{display:flex;flex-wrap:wrap;gap:10px 20px;max-width:100%;padding:12px 18px;background:#eef3f9}
.d82b-public-nav a[aria-current="page"]{font-weight:700;text-decoration:underline}
#lesson-search{max-width:480px}
@media(max-width:700px){.schedule-editor{width:calc(100% - 16px)}.table-scroll{margin-inline:0}.admin-navigation nav{gap:8px}}
@media print{.admin-navigation,.d82b-public-nav,.table-scroll:focus{display:none}}

/* N136 TEST 4 STEP 4: actionable, accessible CMS save confirmation beside the submit button. */
#result:not(:empty){display:block;max-width:68ch;margin:12px 0;padding:11px 14px;border:1px solid #b9c8d6;border-left:5px solid #526375;border-radius:5px;background:#f1f5f9;color:#14283c;overflow-wrap:anywhere}
.account-form-feedback:not(:empty){display:block;max-width:68ch;margin:12px 0 0;padding:11px 14px;border:1px solid #b9c8d6;border-left:5px solid #526375;border-radius:5px;background:#f1f5f9;color:#14283c;overflow-wrap:anywhere}
.account-form-feedback:empty{display:none}
.account-form-feedback[data-feedback="success"]{border-color:#7aa58c;border-left-color:#19663d;background:#edf8f1;color:#174c30}
.account-form-feedback[data-feedback="error"]{border-color:#cfa2a2;border-left-color:#9b2626;background:#fff2f2;color:#702020}
#result[data-feedback="success"]{border-color:#7aa58c;border-left-color:#19663d;background:#edf8f1;color:#174c30}
#result[data-feedback="error"]{border-color:#cfa2a2;border-left-color:#9b2626;background:#fff2f2;color:#702020}
#result[data-feedback="pending"]{border-color:#9aacc7;border-left-color:#3766a1;background:#edf4ff;color:#173b68}
#result[data-feedback="info"]{border-color:#aabac6;border-left-color:#526375;background:#f2f5f8;color:#25394b}
.bell-profile-feedback:not(:empty){display:block;max-width:68ch;margin:8px 0 12px;padding:9px 12px;border:1px solid #7aa58c;border-left:5px solid #19663d;border-radius:5px;background:#edf8f1;color:#174c30;font-weight:600;line-height:1.45;overflow-wrap:anywhere}
.bell-profile-feedback[data-feedback="error"]{border-color:#cfa2a2;border-left-color:#9b2626;background:#fff2f2;color:#702020}
.lesson-publish-feedback:not(:empty){display:block;max-width:68ch;margin:8px 0 12px;padding:9px 12px;border:1px solid #aabac6;border-left:5px solid #526375;border-radius:5px;background:#f2f5f8;color:#25394b;font-weight:600;line-height:1.45;overflow-wrap:anywhere}
.lesson-publish-feedback[data-feedback="success"]{border-color:#7aa58c;border-left-color:#19663d;background:#edf8f1;color:#174c30}
.lesson-publish-feedback[data-feedback="error"]{border-color:#cfa2a2;border-left-color:#9b2626;background:#fff2f2;color:#702020}

/* N137 TEST 81: standalone public login — presentation only, scoped to the login form. */
body:has(#login-form) {
  --login-ink:#123657;
  --login-blue:#194d7d;
  background:#f2f6fb;
  color:var(--login-ink);
}
body:has(#login-form) .schedule-editor { display:flex; flex-direction:column; }
body:has(#login-form) #result { order:1; }
body:has(#login-form) #login-form { order:2; }
body:has(#login-form) .d82b-public-nav {
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:8px;
  width:100%;
  margin:0;
  padding:9px clamp(12px,2.5vw,30px);
  background:#eaf2fa;
  border-bottom:1px solid #cdddeb;
}
body:has(#login-form) .d82b-public-nav a {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:42px;
  padding:9px 14px;
  border:1px solid transparent;
  border-radius:8px;
  color:#19456e;
  font-size:14px;
  font-weight:700;
  line-height:1.35;
  text-decoration:none;
  white-space:normal;
  transition:background-color .15s ease,color .15s ease,border-color .15s ease;
}
body:has(#login-form) .d82b-public-nav a[aria-current="page"] {
  border-color:#194d7d;
  background:#194d7d;
  color:#fff;
  box-shadow:0 2px 0 #bdd4e8;
  text-decoration:none;
}
body:has(#login-form) .d82b-public-nav a:hover,
body:has(#login-form) .d82b-public-nav a:focus-visible {
  background:#205f96;
  border-color:#205f96;
  color:#fff;
  text-decoration:none;
}
body:has(#login-form) .d82b-public-nav a:focus-visible,
body:has(#login-form) #login-form :is(input,button):focus-visible {
  outline:3px solid #19456e;
  outline-offset:3px;
}
body:has(#login-form) .schedule-editor {
  width:min(620px,calc(100% - 32px));
  max-width:620px;
  min-width:0;
  margin:clamp(28px,5vw,64px) auto;
  padding:clamp(22px,3vw,36px);
  border:1px solid #d4e2ee;
  border-top:5px solid #194d7d;
  border-radius:15px;
  box-shadow:0 14px 40px rgba(22,61,102,.08);
  background:#fff;
}
body:has(#login-form) .schedule-editor>h1 {
  margin:0 0 26px;
  padding:0 0 15px;
  border-bottom:1px solid #e4ecf4;
  color:#15395e;
  font:750 clamp(26px,3vw,32px)/1.2 system-ui,Arial,sans-serif;
  letter-spacing:-.025em;
}
body:has(#login-form) #login-form {
  width:100%;
  max-width:none;
  margin:0;
}
body:has(#login-form) #login-form label {
  display:flex;
  flex-direction:column;
  gap:8px;
  margin:0 0 20px;
  color:#173d61;
  font-size:14px;
  font-weight:700;
}
body:has(#login-form) #login-form input:not([type="hidden"]) {
  display:block;
  width:100%;
  height:47px;
  min-width:0;
  padding:11px 13px;
  border:1px solid #b7cbdc;
  border-radius:8px;
  background:#fff;
  color:#17324d;
  font:500 16px/1.35 system-ui,Arial,sans-serif;
  box-shadow:inset 0 1px 2px rgba(30,61,91,.025);
}
body:has(#login-form) #login-form input:is(:hover,:focus) {
  border-color:#3979b1;
}
body:has(#login-form) #login-form button[type="submit"] {
  display:block;
  width:100%;
  min-height:46px;
  margin-top:7px;
  padding:11px 17px;
  border:1px solid #194d7d;
  border-radius:8px;
  background:#194d7d;
  color:#fff;
  font:700 16px/1.3 system-ui,Arial,sans-serif;
  box-shadow:0 3px 9px rgba(20,62,104,.15);
  cursor:pointer;
}
body:has(#login-form) #login-form button[type="submit"]:is(:hover,:focus-visible) {
  border-color:#10395f;
  background:#10395f;
  color:#fff;
}
body:has(#login-form) #login-form button:disabled {opacity:.55;cursor:wait;}
body:has(#login-form) #result:empty {display:none;}
@media(max-width:540px){
  body:has(#login-form) .d82b-public-nav {gap:5px;padding:7px 9px;}
  body:has(#login-form) .d82b-public-nav a {flex:1 1 calc(50% - 5px);min-height:44px;padding:10px 7px;font-size:13px;}
  body:has(#login-form) .schedule-editor {margin:24px auto;padding:24px 18px;}
}
@media print {body:has(#login-form) .d82b-public-nav {display:none!important;}}

/* TEST 9: Publicly styled not-found page; scoped to the generic 404 links. */
body:has(main.schedule-editor .not-found-actions a[href="/prijava/"]) {
  min-height: 100vh;
  background: #f5f7fb;
  color: #17304a;
}
body:has(main.schedule-editor .not-found-actions a[href="/prijava/"]) .schedule-editor {
  width: min(720px, calc(100% - 32px));
  max-width: 720px;
  margin: clamp(24px, 10vh, 96px) auto;
  padding: clamp(24px, 5vw, 48px);
  border: 1px solid #d9e3ee;
  border-top: 4px solid #1b71ac;
  border-left: 0;
  border-radius: 16px;
  box-shadow: 0 18px 48px rgba(23, 60, 97, .12);
}
body:has(main.schedule-editor .not-found-actions a[href="/prijava/"]) .schedule-editor > h1 {
  margin: 0 0 16px;
  color: #123d64;
  font: 750 clamp(2rem, 5vw, 3rem)/1.12 system-ui, sans-serif;
  letter-spacing: -.03em;
}
body:has(main.schedule-editor .not-found-actions a[href="/prijava/"]) .schedule-editor > p {
  color: #526b7e;
}
body:has(main.schedule-editor .not-found-actions a[href="/prijava/"]) .schedule-editor .not-found-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin: 8px 8px 0 0;
  padding: 9px 15px;
  border: 1px solid #b7d2e8;
  border-radius: 9px;
  background: #edf5fc;
  color: #104a75;
  font-weight: 700;
  text-decoration: none;
}
body:has(main.schedule-editor .not-found-actions a[href="/prijava/"]) .schedule-editor .not-found-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 20px 0 0;
}
body:has(main.schedule-editor .not-found-actions a[href="/prijava/"]) .schedule-editor .not-found-actions a.not-found-primary {
  border-color: #1b71ac;
  background: #1b71ac;
  color: #fff;
}
body:has(main.schedule-editor .not-found-actions a[href="/prijava/"]) .schedule-editor .not-found-actions a.not-found-secondary {
  border: 2px solid #1e5fa8;
  background: #edf5fc;
  color: #104a75;
}
body:has(main.schedule-editor .not-found-actions a[href="/prijava/"]) .schedule-editor .not-found-actions a:hover {
  background: #165881;
  border-color: #165881;
  color: #fff;
}
body:has(main.schedule-editor .not-found-actions a[href="/prijava/"]) .schedule-editor a:focus-visible {
  outline: 3px solid #1e5fa8;
  outline-offset: 3px;
}
@media (max-width: 700px) {
  body:has(main.schedule-editor .not-found-actions a[href="/prijava/"]) .schedule-editor {
    width: calc(100% - 24px);
    margin: 16px auto;
    padding: 22px;
  }
  body:has(main.schedule-editor .not-found-actions a[href="/prijava/"]) .schedule-editor .not-found-actions {
    flex-direction: column;
    align-items: stretch;
  }
  body:has(main.schedule-editor .not-found-actions a[href="/prijava/"]) .schedule-editor .not-found-actions a {
    width: 100%;
    margin-right: 0;
  }
}
/* TEST 9: Keep the login and not-found surfaces inside narrow viewports. */
@media (max-width: 540px) {
  body:has(#login-form) .d82b-public-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    min-width: 0;
  }
  body:has(#login-form) .d82b-public-nav a {
    width: auto;
    min-width: 0;
    flex: initial;
    overflow-wrap: anywhere;
  }
  body:has(#login-form) .schedule-editor {
    width: calc(100vw - 24px);
    max-width: 620px;
    min-width: 0;
    margin-inline: auto;
  }
  body:has(#login-form) #login-form,
  body:has(#login-form) #login-form label {
    min-width: 0;
  }
  body:has(main.schedule-editor .not-found-actions a[href="/prijava/"]) .schedule-editor {
    width: calc(100vw - 24px);
    max-width: 720px;
    min-width: 0;
    margin-inline: auto;
  }
  body:has(main.schedule-editor .not-found-actions a[href="/prijava/"]) .schedule-editor > h1 {
    max-width: 100%;
    overflow-wrap: anywhere;
  }
}
/* Lesson entry mode: clear, keyboard-accessible single/block choice. */
@media screen {
  #lesson-form .lesson-entry-mode { border-color:#c7d6e4; background:#f8fbfe; }
  #lesson-form .lesson-entry-mode__options {
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr));
    gap:12px;
  }
  #lesson-form .lesson-mode-option {
    display:flex;
    flex-direction:row;
    align-items:center;
    gap:10px;
    min-width:0;
    min-height:48px;
    margin:0;
    padding:10px 14px;
    border:1px solid #9baab8;
    border-radius:8px;
    background:#fff;
    color:#173b5e;
    font-weight:650;
    cursor:pointer;
  }
  #lesson-form .lesson-mode-option input {
    flex:0 0 auto;
    width:20px;
    height:20px;
    margin:0;
    padding:0;
    accent-color:#1e5fa8;
  }
  #lesson-form .lesson-mode-option:has(input:checked) {
    border:2px solid #1e5fa8;
    background:#eaf2fa;
    color:#123657;
  }
  #lesson-form .lesson-mode-option:focus-within {
    outline:3px solid #1e5fa8;
    outline-offset:2px;
  }
  #lesson-form #lesson-entry-title { margin:18px 0 8px; color:#173b5e; }
  #lesson-form .lesson-entry-help {
    margin:0 0 14px;
    padding:10px 12px;
    border-left:4px solid #1e5fa8;
    background:#eef5fc;
    color:#173b5e;
  }
}
/* Registry-backed class selection; browser autofill is disabled on the input. */
@media screen {
  #lesson-form .lesson-class-picker { position:relative; display:flex; flex-direction:column; gap:6px; min-width:0; margin-bottom:12px; }
  #lesson-form .lesson-class-picker__control { position:relative; min-width:0; }
  #lesson-form .lesson-class-picker__control > input { width:100%; min-width:0; }
  #lesson-form .lesson-class-picker__options { position:absolute; z-index:30; inset-inline:0; top:calc(100% + 4px); max-height:240px; overflow:auto; padding:4px; border:1px solid #7f98b1; border-radius:6px; background:#fff; box-shadow:0 8px 20px rgba(20,48,75,.18); }
  #lesson-form .lesson-class-picker__options[hidden] { display:none; }
  #lesson-form .lesson-class-picker__options [role="option"] { display:block; width:100%; min-height:42px; padding:8px 10px; border:1px solid transparent; border-radius:4px; background:#fff; color:#173b5e; text-align:left; }
  #lesson-form .lesson-class-picker__options [role="option"]:hover:not(:disabled),
  #lesson-form .lesson-class-picker__options [role="option"]:focus:not(:disabled),
  #lesson-form .lesson-class-picker__options [role="option"]:focus-visible:not(:disabled),
  #lesson-form .lesson-class-picker__options [role="option"]:active:not(:disabled),
  #lesson-form .lesson-class-picker__options [role="option"][aria-selected="true"]:not(:disabled) { border-color:#1e5fa8; background:#eaf2fa; color:#123657; }
  #lesson-form .lesson-class-picker__options [role="option"]:disabled { border-color:#aab6c2; background:#f1f3f5; color:#465568; opacity:1; cursor:not-allowed; }
  #lesson-form .lesson-class-picker__help { margin:0; color:#40566b; font-size:13px; }
  #lesson-form .lesson-class-picker input:focus-visible,
  #lesson-form .lesson-class-picker__options [role="option"]:focus-visible { outline:3px solid #1e5fa8; outline-offset:2px; }
}
