/* TalaKlasi shared presentation components. Host theme tokens remain authoritative.
   This layer is declared before the legacy presentation layer; print sheets retain
   their own geometry. No framework, font, image or network dependency. */
@layer tk-components, tk-minimal;
@layer tk-components {
 @media screen {
  :root {
   --ui-radius:12px;--ui-radius-sm:8px;--ui-radius-lg:16px;
   --ui-space:4px;--ui-control:40px;--ui-font:system-ui,-apple-system,"Segoe UI",sans-serif;
   --ui-page:var(--min-bg,var(--sp-bg,var(--bg-body,var(--legal-bg,Canvas))));
   --ui-surface:var(--min-surface,var(--sp-glass-solid,var(--bg-card,var(--legal-panel,Canvas))));
   --ui-soft:var(--min-soft,var(--sp-lift,var(--bg-lift,Canvas)));
   --ui-text:var(--min-text,var(--sp-text,var(--text-main,var(--legal-text,CanvasText))));
   --ui-muted:var(--min-muted,var(--sp-muted,var(--text-muted,var(--legal-muted,CanvasText))));
   --ui-border:var(--min-line,var(--sp-border,var(--border-color,var(--legal-line,ButtonBorder))));
   --ui-accent:var(--accent-solid,var(--sp-blue,var(--legal-a,Highlight)));
   --ui-danger:var(--min-danger,var(--sp-rose,var(--danger-color,Mark)));
   --ui-overlay:var(--min-overlay,var(--overlay-bg,#0008));
   --ui-on-accent:var(--sp-on-accent,HighlightText);
   --ui-shadow:0 8px 24px color-mix(in srgb,var(--ui-text) 7%,transparent);
  }
  body,dialog,.tk-w,.tk-chat {
   --ui-page:var(--sp-bg,var(--min-bg,var(--bg-body,var(--legal-bg,Canvas))));
   --ui-surface:var(--sp-glass-solid,var(--min-surface,var(--bg-card,var(--legal-panel,Canvas))));
   --ui-soft:var(--sp-lift,var(--min-soft,var(--bg-lift,Canvas)));
   --ui-text:var(--sp-text,var(--min-text,var(--text-main,var(--legal-text,CanvasText))));
   --ui-muted:var(--sp-muted,var(--min-muted,var(--text-muted,var(--legal-muted,CanvasText))));
   --ui-border:var(--sp-border,var(--min-line,var(--border-color,var(--legal-line,ButtonBorder))));
  }
  body {font-family:var(--ui-font)!important;font-size:16px;line-height:1.55;color:var(--ui-text);text-rendering:optimizeLegibility;}
  :is(button,input,select,textarea){font-family:var(--ui-font)!important;}
  :is(h1,h2,h3,.page-title,.sp-view-heading,.db-page h1){font-family:var(--ui-font)!important;font-weight:650!important;letter-spacing:-.025em;line-height:1.3;}
  :is(h1,.page-title,.lm-title,.cu-page-title,.ps-title){font-size:clamp(22px,2.2vw,30px)!important;}
  :is(h2,.page-heading h2){font-size:clamp(18px,1.6vw,23px);}
  :is(button,a,input,select,textarea,summary,[tabindex]):focus-visible{outline:2px solid var(--ui-accent)!important;outline-offset:3px!important;}
  :is(button,[role=button],summary){touch-action:manipulation;}
  :is(button,.btn,.ak-button,.q-btn,.sp-back-btn,.tk-btn,.lm-btn,.att-btn,.ps-btn,.cb,.tk-component-button){
   border-radius:var(--ui-radius-sm)!important;font-weight:600!important;text-shadow:none!important;box-shadow:none!important;transition:border-color .12s;line-height:1.4;
  }
  :is(.btn,.ak-button,.q-btn,.sp-back-btn,.tk-btn,.lm-btn,.att-btn,.ps-btn,.tk-component-button){min-height:var(--ui-control);padding:9px 13px;font-size:14px;gap:8px;}
  :is(.btn-primary,.btn-gradient,.gradient-btn,.btn-accent,.tk-btn-primary,.tk-cta,.ak-primary,.tkn-primary,.sp-continue-btn,.chat-send,.att-btn-save){background:var(--ui-accent)!important;border-color:var(--ui-accent)!important;color:var(--ui-on-accent)!important;}
  :is(.btn-primary,.btn-gradient,.gradient-btn,.btn-accent,.tk-cta,.ak-primary,.tkn-primary,.chat-send) :is(i,span,svg){color:inherit!important;}
  :is(.btn-secondary,.btn-soft,.btn-outline,.btn-ghost,.ak-button:not(.ak-primary):not(.ak-danger)){background:var(--ui-surface)!important;border:1px solid var(--ui-border)!important;color:var(--ui-text)!important;}
  :is(.btn-ghost,.tk-ghost){background:transparent!important;border-color:transparent!important;}
  :is(.btn-danger,.ak-danger,.tk-danger,.btn-delete){color:var(--ui-danger)!important;border:1px solid color-mix(in srgb,var(--ui-danger) 48%,var(--ui-border))!important;background:color-mix(in srgb,var(--ui-danger) 8%,var(--ui-surface))!important;}
  :is(button,.btn,.ak-button):disabled{opacity:.55!important;cursor:not-allowed;box-shadow:none!important;}
  :is(button,.btn,.ak-button)[aria-busy=true]{cursor:progress;opacity:.75;}
  :is(.btn-icon,.tk-x,.chat-back,.sp-close-btn){min-width:40px;min-height:40px;display:inline-flex;align-items:center;justify-content:center;padding:8px;}
  :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=hidden]):not([type=button]):not([type=submit]),select,textarea){
   font-size:14px;line-height:1.5;border-radius:var(--ui-radius-sm)!important;min-width:0;max-width:100%;border-color:var(--ui-border)!important;color:var(--ui-text);box-shadow:none!important;scroll-margin-block:90px;
  }
  :is(.inp,.neu-input,.sp-input,.q-input,.q-select,.q-textarea,.att-input,.att-search-input,.lm-input,.ps-input,.tk-input,.settings-input,.form-control,.form-select){min-height:var(--ui-control)!important;padding:9px 11px!important;}
  textarea{resize:vertical;}
  input[type=file]::file-selector-button{font:600 13px var(--ui-font);color:var(--ui-text);background:var(--ui-soft);border:1px solid var(--ui-border);border-radius:6px;padding:8px 10px;margin-right:10px;cursor:pointer;}
  :is(input[type=checkbox],input[type=radio]){accent-color:var(--ui-accent);min-width:17px;min-height:17px;vertical-align:middle;}
  :is(input,select,textarea)[readonly]{background:var(--ui-soft);cursor:default;}
  [aria-invalid=true]{border-color:var(--ui-danger)!important;}
  :is(.card,.neu-card,.glass-card,.stat-card,.panel,.sp-card,.sp-grade-card,.sp-mat-card,.sp-stat-card,.db-card,.dash-card,.widget,.content-card,.data-card,.section-card,.q-card,.chart-card,.tk-card,.lm-panel,.folder-card,.stud-mat-card,.att-controls-card,.att-table-wrap,.quiz-card,.result-card,.jp-card,.settings-card,.group-card,.score-panel,.tile-card,.cu-filter,.cu-records-wrap,.lm-stat,.ak-card,.portal-record-section){
   border-radius:var(--ui-radius)!important;box-shadow:none!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important;transform:none;
  }
  :is(.db-card,.ak-card,.q-card,.settings-card){padding:16px;}
  :is(.db-page,.att-page-wrap,.cu-page,.lm-page,.ps-page){gap:18px!important;}
  :is(.att-header-bar,.cu-header,.lm-hero,.page-heading){margin-bottom:16px;}
  :is(.db-card,.stat-card,.lm-stat,.cu-stats){min-height:0;}
  :is(.cu-stat-val,.stat-val,.lm-stat-value,.att-stat-value){font-weight:650!important;font-size:clamp(24px,2vw,32px)!important;}
  .db-page>.grid>.db-card:has([id^=stat]){padding:16px!important;min-height:100px!important;}
  .db-page [id^=stat]{font-size:30px!important;font-weight:650!important;}
  :is(.db-table,.sp-tbl,.table,.att-table,.ps-table,.lm-table){font-size:14px;line-height:1.5;}
  :is(.db-table,.sp-tbl,.table,.att-table,.ps-table,.lm-table) :is(th,td){padding:11px 12px;vertical-align:middle;}
  :is(.db-table,.sp-tbl,.table,.att-table,.ps-table,.lm-table) th{font-size:12px;font-weight:650!important;letter-spacing:.015em;}
  :is(.table-responsive,.table-wrap,.att-table-scroll,.sp-tbl-shell){overscroll-behavior-inline:contain;scrollbar-width:thin;max-width:100%;}
  .tk-table-scroll{overflow-x:auto;max-width:100%;min-width:0;overscroll-behavior-inline:contain;}
  .tk-table-scroll:focus-visible{outline-offset:-2px!important;}
  .tk-svg-icon{display:inline-flex!important;align-items:center;justify-content:center;width:1.15em;height:1.15em;vertical-align:-.15em;flex:0 0 auto;font-style:normal;line-height:1;}
  .tk-svg-icon::before{content:none!important;display:none!important;}
  .tk-svg-icon>svg{display:block;width:100%;height:100%;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;}
  .glass-header{width:calc(100% - 32px)!important;margin:12px 16px!important;padding:11px 18px!important;border-radius:var(--ui-radius)!important;box-shadow:none!important;}
  .tk-staff-header{gap:16px!important;}
  .tk-staff-header .tk-staff-brand{width:auto!important;flex-shrink:0;gap:12px!important;}
  .tk-staff-wordmark{display:flex;flex-direction:column;line-height:1.35;white-space:nowrap;}
  .tk-staff-wordmark strong{font-size:18px;font-weight:700;letter-spacing:-.025em;}
  .tk-staff-wordmark span{font-size:12px;color:var(--ui-muted);}
  .tk-staff-header .tk-staff-tools{width:auto!important;flex-direction:row!important;gap:12px!important;min-width:0;}
  .tk-staff-header .tk-staff-mobile-actions{display:none!important;}
  .tk-staff-header .tk-staff-desktop-actions{display:flex!important;gap:6px!important;padding-left:12px!important;}
  .tk-staff-header .tk-staff-account{display:flex!important;min-width:0;max-width:220px;}
  .tk-staff-account .user-name-inline{white-space:normal!important;overflow-wrap:anywhere;font-size:13px!important;}
  .tk-staff-account .role-badge{font-size:10px!important;}
  .tk-staff-notifications .tkn-bar{padding:0!important;margin:0!important;border:0!important;background:transparent!important;gap:0!important;}
  .tk-staff-notifications .tkn-bar>button:first-child{display:inline-flex;align-items:center;justify-content:center;gap:4px;min-width:44px;min-height:40px;padding:8px!important;font-size:0!important;}
  .tk-staff-notifications svg{width:20px;height:20px;}
  .tk-staff-notifications .tkn-count{font-size:11px;}
  .tk-staff-notifications .tkn-bar>:not(:first-child){position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip-path:inset(50%);white-space:nowrap;}
  .tk-staff-notifications .tkn-bar>button:not(:first-child){display:none!important;}
  .tk-social-admin-entry{display:flex!important;flex-wrap:wrap!important;align-items:center;gap:10px!important;padding:14px!important;border-radius:var(--ui-radius)!important;}
  .tk-social-admin-entry>*{min-width:0;max-width:100%;}
  .tk-social-admin-entry :is(button,a){white-space:normal!important;overflow-wrap:anywhere;min-height:40px;padding:9px 12px!important;font-size:14px!important;line-height:1.5!important;}
  .tk-social-admin-entry p{font-size:14px!important;line-height:1.6!important;}
  #mainSidebar{border-radius:var(--ui-radius)!important;box-shadow:none!important;}
  #mainSidebar :is(.side-nav-link,.side-nav-item,.nav-group-header){font-weight:550!important;min-height:40px!important;border-radius:var(--ui-radius-sm)!important;}
  #mainSidebar :is(.side-nav-link,.side-nav-item,.nav-group-header).active,#mainSidebar .side-nav-active{font-weight:650!important;}
  :is(.glass-header,.portal-topbar,.tk-pnav,.tk-login-shell,.tk-auth-card,.auth-card,.tk-brand,.tk-pop,.tk-bot,.tk-modal){backdrop-filter:none!important;-webkit-backdrop-filter:none!important;}
  :is(.header-wave-container,.header-wave-fill,.header-wave-stroke,.tk-orb,.sp-nebula,.portal-space-nebula,.ambient-glow-blue,.ambient-glow-purple,.ambient-glow-emerald,.ambient-glow-amber){display:none!important;}
  .tk-w{--tkbg:var(--ui-surface);--tkbg2:var(--ui-soft);--tkln:var(--ui-border);--tktx:var(--ui-text);--tkmu:var(--ui-muted);}
  :is(.tk-login-shell,.tk-brand,.tk-auth-card,.sp-access-card,.sp-hero-section,.sp-highlight-card){border-radius:var(--ui-radius-lg)!important;box-shadow:none!important;}
  .tk-headline{font-size:clamp(28px,3.3vw,44px)!important;line-height:1.2!important;letter-spacing:-.04em!important;}
  :is(.tk-auth-title,.sp-hero-main-title){font-size:clamp(25px,3vw,38px)!important;line-height:1.25!important;}
  :is(.tk-brand-sub,.tk-auth-sub,.sp-hero-description,.sp-access-description){font-size:15px!important;line-height:1.6!important;}
  .tk-feature-mini{padding:12px!important;min-height:0!important;}
  .portal-account #resStudentName{font-size:13px!important;}
  .portal-account-role{font-size:12px!important;}
  #studentResultsArea :is(.sp-sidebar-route,.sp-sidebar-tool){font-size:14px!important;min-height:42px!important;}
  #studentResultsArea :is(.sp-field-label,.sp-sidebar-caption){font-size:11px!important;}
  #studentResultsArea :is(.sp-card-subj,.sp-mat-title){font-size:15px!important;}
  #studentResultsArea :is(.sp-learning-overview p,.sp-academic-reminder p){font-size:14px!important;}
  #studentResultsArea .sp-academic-reminder summary{font-size:14px!important;}
  :is(.att-field-label,.lm-label,.cu-label,.ps-label,.q-label,.settings-form-group label){font-size:13px!important;font-weight:600!important;letter-spacing:.01em!important;}
  :is(dialog,.tk-dialog-panel) label{font-size:14px!important;}
  .portal-record-section .sp-card-accordion-header{min-height:58px!important;}
  #mydayContainer .chat-day-layout{gap:16px;}
  #mydayContainer .chat-day-topviews,#mydayContainer .chat-day-latest{border-radius:var(--ui-radius);padding:14px;}
  :is(.akh,.chat-knowledge-list,.chat-story-comments){font-family:var(--ui-font)!important;}
  .akh :is(.ak-body,.ak-preview){font-size:15px;line-height:1.7;}
  .chat-knowledge-preview p{font-size:14px!important;}
  :is(.tk-chat,.tk-chat-feature,.ak-dialog,.tkn-dialog,.tk-consent,dialog.editor){border-radius:var(--ui-radius-lg)!important;box-shadow:var(--ui-shadow)!important;backdrop-filter:none!important;}
  .tk-chat{--chat-radius:var(--ui-radius);}
  .tk-chat .chat-layout{min-height:0;}
  .tk-chat :is(.chat-name,.chat-thread-name){font-size:14px!important;}
  .tk-chat :is(.chat-body,.chat-compose textarea){font-size:15px!important;line-height:1.55!important;}
  .tk-chat .chat-contact-search{border-radius:20px!important;font-size:14px!important;}
  .tk-chat .chat-thread{padding:10px 12px!important;min-height:70px;}
  .tk-chat :is(.chat-header,.chat-toolbar){padding:12px 16px;}
  .tk-chat .chat-compose{padding-bottom:max(12px,env(safe-area-inset-bottom));}
  .chat-story-view-media{min-height:0;}
  .chat-story-view-media img{object-fit:contain!important;max-width:100%;max-height:58dvh;}
  .chat-story-stage .chat-story-fullscreen{position:absolute;right:10px;top:10px;z-index:2;background:var(--ui-surface)!important;color:var(--ui-text)!important;border:1px solid var(--ui-border)!important;padding:8px 12px;min-height:40px;font-size:13px;}
  .chat-story-stage:fullscreen{width:100vw!important;height:100dvh!important;max-height:none!important;max-width:none!important;border-radius:0!important;display:grid;place-items:center;background:var(--ui-page)!important;}
  .chat-story-stage:fullscreen img{width:100%!important;height:100%!important;max-height:100dvh!important;object-fit:contain!important;}
  .tk-chat .chat-story-stage .chat-story-navigation{position:absolute;inset:0;z-index:3;display:flex;align-items:center;justify-content:space-between;gap:0;padding:12px;pointer-events:none;}
  .tk-chat .chat-story-stage .chat-story-navigation button{pointer-events:auto;border:0!important;outline-offset:3px;width:42px!important;height:42px!important;min-width:42px!important;min-height:42px!important;max-width:42px!important;max-height:42px!important;padding:0!important;border-radius:50%!important;background:var(--ui-surface)!important;color:var(--ui-text)!important;font-size:30px!important;line-height:1!important;}
  .tk-chat .chat-story-stage .chat-story-counter{position:absolute;bottom:10px;left:50%;transform:translateX(-50%);border-radius:20px;padding:3px 10px;background:var(--ui-surface);color:var(--ui-text);font-size:12px;}
  .tk-chat .chat-story-reactions{flex-wrap:wrap!important;justify-content:center;overflow:visible!important;gap:4px;padding:2px;}
  .tk-chat :is(.chat-emoji-picker,.chat-story-reactions,.chat-reactions) button{border:0!important;background:transparent!important;box-shadow:none!important;border-radius:50%!important;}
  .tk-chat :is(.chat-emoji-picker,.chat-story-reactions) button{display:inline-flex;align-items:center;justify-content:center;gap:3px;min-width:40px;min-height:40px;padding:5px!important;font-size:27px!important;}
  .tk-chat :is(.chat-emoji-picker,.chat-story-reactions,.chat-reactions) button[aria-pressed=true]{background:color-mix(in srgb,var(--ui-accent) 12%,transparent)!important;outline:0!important;}
  .tk-chat :is(.chat-emoji-picker,.chat-story-reactions,.chat-reactions) button:focus-visible{outline:2px solid var(--ui-accent)!important;}
  .tk-chat .chat-reaction-count{font-size:11px;color:var(--ui-muted);}
  .tk-chat .chat-story-view-heading{display:grid!important;grid-template-columns:40px minmax(0,1fr) auto;gap:2px 10px;align-items:center;}
  .tk-chat .chat-story-view-heading>:is(.chat-avatar,.tk-role-portrait){grid-column:1;grid-row:1/3;}
  .tk-chat .chat-story-view-heading>strong{grid-column:2;grid-row:1;}
  .tk-chat .chat-story-view-heading>small{grid-column:2;grid-row:2;margin:0!important;}
  .tk-chat .chat-story-view-heading>.chat-story-reader-menu{grid-column:3;grid-row:1/3;}
  .tk-chat .tk-story-mode .chat-feature-content{gap:10px!important;}
  .tk-chat .tk-story-mode .chat-feature-status:empty{display:none!important;}
  .tk-chat .chat-story-stage:not(:fullscreen){height:min(48dvh,460px)!important;min-height:160px!important;}
  .tk-chat .chat-story-interactions{position:sticky;bottom:-16px;z-index:4;padding:8px 0;background:var(--ui-surface);display:grid;gap:6px;}
  :is(.tk-dialog-panel,dialog:not(.tk-chat):not(.tk-chat-feature)){
   max-width:min(var(--tk-dialog-width,880px),calc(100vw - 24px))!important;max-height:calc(var(--tk-visual-height,100dvh) - 32px)!important;border-radius:var(--ui-radius-lg)!important;background:var(--ui-surface);color:var(--ui-text);border-color:var(--ui-border)!important;box-shadow:var(--ui-shadow)!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important;min-width:0;box-sizing:border-box;
  }
  [data-tk-dialog]:not(dialog){padding:16px!important;overflow:auto!important;overscroll-behavior:contain;background:var(--ui-overlay)!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important;}
  .tk-dialog-panel{width:min(var(--tk-dialog-width,880px),calc(100vw - 24px))!important;overflow:auto!important;overscroll-behavior:contain;scrollbar-width:thin;}
  #authModal .auth-modal-container{--tk-dialog-width:440px!important;padding:0!important;border:1px solid var(--ui-border);}
  #authModal .auth-card{background:var(--ui-surface)!important;color:var(--ui-text)!important;border:0!important;border-radius:0!important;overflow:visible!important;padding:24px!important;gap:0!important;}
  #authModal :is(.card-title,.field-label,.chkline,.switch-text){color:var(--ui-text)!important;}
  #authModal :is(.card-sub,.divider-text,.input-icon,.input-action,#authLoadingHint){color:var(--ui-muted)!important;}
  #authModal :is(.input-container,.lock-icon-circle){background:var(--ui-soft)!important;border-color:var(--ui-border)!important;box-shadow:none!important;}
  #authModal :is(input,select){color:var(--ui-text)!important;background:transparent!important;}
  #authModal select option{background:var(--ui-surface)!important;color:var(--ui-text)!important;}
  #authModal input::placeholder{color:var(--ui-muted)!important;opacity:1!important;}
  #authModal .neu-btn.primary{background:var(--ui-accent)!important;color:var(--ui-on-accent)!important;border-color:var(--ui-accent)!important;}
  #authModal .neu-btn.primary>*{color:inherit!important;}
  #authModal .auth-card>.neu-btn.primary{position:sticky!important;bottom:0!important;z-index:15!important;flex-shrink:0;}
  #authModal .switch-btn{color:var(--ui-accent)!important;}
  #authModal .modal-close-btn{position:sticky!important;top:10px!important;right:10px!important;align-self:flex-end!important;margin:10px 10px -46px auto!important;flex:0 0 36px;z-index:30!important;background:var(--ui-soft)!important;color:var(--ui-text)!important;border-color:var(--ui-border)!important;}
  #authModal .auth-modal-container{display:flex!important;flex-direction:column!important;}
  :is(.ak-dialog,.tk-chat-feature)[open]{display:flex!important;flex-direction:column;overflow:hidden!important;}
  :is(.ak-dialog-head,.chat-feature-heading,.lm-modal-header,.q-modal-header){flex:0 0 auto;position:sticky;top:0;z-index:5;}
  :is(.ak-dialog,.tk-chat-feature)>:is(.ak-dialog-body,.chat-feature-content){flex:1 1 auto;min-height:0;overflow:auto!important;overscroll-behavior:contain;}
  :is(.ak-dialog-body,.chat-feature-content) :is(.ak-actions,.cs-decision-footer):last-child{position:sticky;bottom:-16px;z-index:4;background:var(--ui-surface)!important;border-top:1px solid var(--ui-border);padding:12px 0!important;}
  :is(#modalFooter,#cuModalFooter,.lm-modal-footer,.q-modal-footer){position:sticky;bottom:0;z-index:5;}
  .tkn-dialog.tkn-dialog[open]{max-height:min(680px,calc(var(--tk-visual-height,100dvh) - 32px))!important;}
  :is(.ak-dialog-head,.chat-feature-heading,.lm-modal-header,.q-modal-header,.dialog-head,#modalTitle-wrap){padding:14px 18px!important;background:var(--ui-surface)!important;border-color:var(--ui-border)!important;gap:12px;}
  :is(.ak-dialog-head h2,.chat-feature-heading h2,.lm-modal-header h3,.q-modal-header h3,.dialog-head h2,#modalTitle,#customModalTitle,#deptModalTitle){font-size:18px!important;line-height:1.4!important;font-weight:650!important;}
  :is(.ak-dialog-body,.chat-feature-content,.lm-modal-body,.q-modal-body,#modalBody,#cuModalBody){padding:16px 18px!important;min-height:0;overscroll-behavior:contain;}
  :is(#modalFooter,#cuModalFooter,.lm-modal-footer,.q-modal-footer,.dialog-actions,.cs-decision-footer){padding:12px 18px!important;flex-wrap:wrap;gap:8px;flex-shrink:0;background:var(--ui-surface)!important;border-color:var(--ui-border)!important;}
  :is(#modalBox,#customUserModalBox,#deptModalBox,#switchDeptModalBox){display:flex;flex-direction:column;overflow:hidden!important;}
  :is(#modalBox,#customUserModalBox,#deptModalBox,#switchDeptModalBox)>:first-child{flex-shrink:0;}
  :is(#modalBody,#cuModalBody){overflow:auto!important;flex:1 1 auto;}
  :is(dialog,[data-tk-dialog]) :is(input,select,textarea,[contenteditable=true]){max-width:100%;min-width:0;}
  :is(.ak-dialog,.cs-dialog,.tk-chat-feature,.tkn-dialog,.tk-consent) :is(p,li,label){line-height:1.65;overflow-wrap:anywhere;}
  :is(.ak-dialog,.cs-dialog,.tkn-dialog,.tk-consent) p{font-size:14px;}
  dialog::backdrop{background:var(--ui-overlay)!important;backdrop-filter:none!important;}
  .tk-unsaved-dialog{width:min(420px,calc(100vw - 24px));padding:20px;border:1px solid var(--ui-border);background:var(--ui-surface);color:var(--ui-text);}
  .tk-unsaved-dialog h2{font-size:20px;margin:0 0 8px;}.tk-unsaved-dialog p{font-size:15px;margin:0 0 18px;}.tk-unsaved-actions{display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px;}
  .tk-export-notice{position:fixed;bottom:calc(20px + env(safe-area-inset-bottom));left:16px;right:16px;margin:auto;max-width:460px;padding:14px 16px;border:1px solid var(--ui-danger);border-radius:var(--ui-radius);background:var(--ui-surface);color:var(--ui-text);z-index:2147483200;font:14px/1.6 var(--ui-font);}
  .tk-export-notice button{margin:8px 0 0 12px;padding:7px 10px;border:1px solid var(--ui-border);background:var(--ui-soft);color:inherit;}
  :is(.dropdown-menu,.sb-flyout,.nav-flyout,.sidebar-flyout,.portal-search-results,.chat-directory,[role=menu],[role=listbox]){max-width:calc(100vw - 20px);max-height:65dvh;overflow:auto;overscroll-behavior:contain;overflow-wrap:anywhere;}
  .tk-skip-link{position:fixed;top:8px;left:8px;transform:translateY(-200%);z-index:2147483647;padding:12px 16px;border-radius:8px;background:var(--ui-surface);color:var(--ui-text);border:2px solid var(--ui-accent);font:600 15px var(--ui-font);}
  .tk-skip-link:focus{transform:none;}
  :is(.toast,#toast,#sysToast,#_tkToast,.ak-notice,.chat-notice,.tkn-notice,.tk-network-notice){font:14px/1.6 var(--ui-font)!important;border-radius:var(--ui-radius-sm)!important;box-shadow:none!important;backdrop-filter:none!important;}
  :is(.legal-card,.legal-nav,.module-nav,.metrics .metric,.schedule-panel,.editor){border-radius:var(--ui-radius)!important;box-shadow:none!important;}
  :is(.legal-wrap,.content,.module-nav){font-family:var(--ui-font)!important;}
  .legal-card{font-size:16px;line-height:1.75;}
  .legal-card{padding:clamp(18px,3vw,32px)!important;}
  .tk-diagnostic{padding:clamp(14px,3vw,28px)!important;background:var(--ui-page)!important;color:var(--ui-text)!important;margin:0;box-sizing:border-box;overflow-wrap:anywhere;}
  .tk-diagnostic *{min-width:0;overflow-wrap:anywhere;}.tk-diagnostic code{white-space:normal;word-break:break-word;}
  .tk-diagnostic :is(.sum,th,code){background:var(--ui-surface)!important;color:var(--ui-text)!important;border-color:var(--ui-border)!important;}
  .tk-diagnostic :is(h2,.mut){color:var(--ui-muted)!important;}
  .tk-diagnostic .sum{border-radius:var(--ui-radius);}
  .tk-diagnostic :is(.ok,.bad){font-weight:650;}.tk-diagnostic .ok{color:var(--ui-text)!important;}.tk-diagnostic .bad{color:var(--ui-danger)!important;}
  #bar :is(.cb,.sel){min-height:36px;font-size:14px!important;border-radius:var(--ui-radius-sm)!important;}
  :root[data-tk-workspace=scheduling]{--ink:var(--ui-text);--paper:var(--ui-page);--line:var(--ui-border);--accent:var(--ui-accent);--muted:var(--ui-muted);--bs-body-bg:var(--ui-page);--bs-body-color:var(--ui-text);--bs-border-color:var(--ui-border);--bs-tertiary-bg:var(--ui-soft);}
  [data-tk-workspace=scheduling] body{background:var(--ui-page)!important;background-image:none!important;}
  [data-tk-workspace=scheduling] :is(.app-header,.module-nav,.term-toolbar,.metric,.panel,.editor,.dialog-actions){background:var(--ui-surface)!important;color:var(--ui-text)!important;border-color:var(--ui-border)!important;}
  [data-tk-workspace=scheduling] :is(.form-control,.form-select){background-color:var(--ui-surface)!important;color:var(--ui-text)!important;}
  [data-tk-workspace=scheduling] :is(.nav-label,.hint,.table-foot,.page-heading p,.panel-head p,.metric small,.metric span){color:var(--ui-muted)!important;font-size:13px!important;}
  [data-tk-workspace=scheduling] .module-nav button{color:var(--ui-text)!important;font-size:14px!important;min-height:42px;}
  [data-tk-workspace=scheduling] .module-nav button.active{background:color-mix(in srgb,var(--ui-accent) 10%,var(--ui-surface))!important;color:var(--ui-text)!important;box-shadow:inset 3px 0 0 var(--ui-accent)!important;}
  [data-tk-workspace=scheduling] :is(.timetable th,.timetable .time){background:var(--ui-soft)!important;color:var(--ui-muted)!important;}
  [data-tk-workspace=scheduling] .timetable :is(th,td){border-color:var(--ui-border)!important;}
  [data-tk-workspace=scheduling] .table{--bs-table-bg:var(--ui-surface);--bs-table-color:var(--ui-text);--bs-table-border-color:var(--ui-border);--bs-table-striped-bg:var(--ui-soft);--bs-table-hover-bg:var(--ui-soft);}
  [data-tk-workspace=scheduling] .class-block{background:color-mix(in srgb,var(--ui-accent) 10%,var(--ui-surface))!important;color:var(--ui-text)!important;border-left-color:var(--ui-accent)!important;}
  [data-tk-workspace=scheduling] .class-block.lab{background:color-mix(in srgb,var(--ui-accent) 18%,var(--ui-surface))!important;}
  [data-tk-workspace=scheduling] .content{padding:24px;}
  [data-tk-workspace=scheduling] .term-toolbar label{font-size:13px;}
  :is(.flatpickr-calendar,.flatpickr-months,.flatpickr-month,.flatpickr-current-month,.flatpickr-weekdays,.flatpickr-weekday,.flatpickr-time){background:var(--ui-surface)!important;color:var(--ui-text)!important;border-color:var(--ui-border)!important;box-shadow:none!important;}
  .flatpickr-calendar{border:1px solid var(--ui-border)!important;border-radius:var(--ui-radius)!important;padding:8px;max-width:calc(100vw - 16px);}
  .flatpickr-day{color:var(--ui-text)!important;border-radius:var(--ui-radius-sm)!important;}
  .flatpickr-day:is(.prevMonthDay,.nextMonthDay,.flatpickr-disabled){color:var(--ui-muted)!important;opacity:.5;}
  .flatpickr-day:is(.selected,.startRange,.endRange){background:var(--ui-accent)!important;color:var(--ui-on-accent)!important;border-color:var(--ui-accent)!important;}
  .flatpickr-day:not(.selected):hover{background:var(--ui-soft)!important;border-color:var(--ui-border)!important;}
  .flatpickr-months :is(.flatpickr-prev-month,.flatpickr-next-month){color:var(--ui-text)!important;fill:var(--ui-text)!important;}
  .tk-svg-icon.fa-spin{animation:tk-icon-spin 1s linear infinite;}
  .tk-password-toggle{border:1px solid var(--ui-border);background:var(--ui-soft);color:var(--ui-text);font:600 12px var(--ui-font);padding:7px 10px;min-height:36px;margin-top:6px;}
  @media(min-width:1024px){#mainContentArea{padding:0 16px!important;}.db-page{padding:20px 12px 32px!important;}}
  @media(max-width:1100px){
   .tk-staff-header{flex-direction:column!important;align-items:stretch!important;gap:10px!important;}
   .tk-staff-header .tk-staff-brand{width:100%!important;justify-content:space-between!important;}
   .tk-staff-header .tk-staff-tools{width:100%!important;justify-content:space-between!important;}
   .tk-staff-header .tk-staff-desktop-actions{display:none!important;}
   .tk-staff-header .tk-staff-mobile-actions{display:flex!important;gap:6px!important;}
   .tk-staff-mobile-actions .btn-icon{min-width:36px;min-height:36px;padding:7px!important;}
   .tk-staff-header .tk-staff-account{max-width:45%;flex-shrink:0;}
  }
  @media(max-width:600px){
   .tk-staff-header .tk-staff-tools{display:grid!important;grid-template-columns:minmax(0,1fr) auto;align-items:center!important;gap:8px!important;}
   .tk-staff-tools #sidebarGlobalFilterCard{grid-column:1/-1;grid-row:2;}
   .tk-staff-tools .tk-staff-notifications{grid-column:2;grid-row:1;}
   .tk-staff-header .tk-staff-account{grid-column:1;grid-row:1;max-width:100%!important;align-items:flex-start!important;}
   .tk-staff-account .user-top-row{flex-wrap:wrap;}
   .tk-staff-account .dept-badge{max-width:100%;white-space:normal;}
   .tk-staff-mobile-actions button:has(#themeIconMobile){display:none!important;}
   .tk-staff-brand>div:first-child{gap:10px!important;}
   .tk-staff-wordmark span{font-size:11px;}.tk-staff-wordmark strong{font-size:16px;}
   .tk-social-admin-entry :is(button,a){width:100%!important;justify-content:center;}
   .tk-chat .chat-story-reactions{flex-wrap:nowrap!important;gap:2px!important;}
   .tk-chat .chat-story-reactions button{position:relative;flex:1 1 0!important;min-width:30px!important;max-width:44px;min-height:40px;padding:4px!important;font-size:24px!important;}
   .tk-chat .chat-story-reactions .chat-reaction-count{position:absolute;right:1px;bottom:0;font-size:10px;}
  }
  @media(max-width:768px){
   :root{--ui-control:44px;}body{font-size:16px;}
   :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,textarea){font-size:16px!important;}
   :is(.glass-header){width:calc(100% - 20px)!important;margin:10px!important;padding:10px 12px!important;}
   :is(.db-page,.att-page-wrap,.cu-page,.lm-page,.ps-page){gap:14px!important;}
   :is(.db-card,.ak-card,.q-card,.settings-card){padding:13px!important;}
   :is(dialog:not(.tk-chat):not(.tk-chat-feature),.tk-dialog-panel){max-width:min(var(--tk-dialog-width,880px),calc(100vw - 16px))!important;max-height:calc(var(--tk-visual-height,100dvh) - 16px)!important;}
   [data-tk-dialog]:not(dialog){padding:8px!important;}
   :is(.ak-dialog-head,.chat-feature-heading,.lm-modal-header,.q-modal-header,.dialog-head,#modalTitle-wrap){padding:12px 14px!important;}
   :is(.ak-dialog-body,.chat-feature-content,.lm-modal-body,.q-modal-body,#modalBody,#cuModalBody){padding:14px!important;}
   :is(#modalFooter,#cuModalFooter,.lm-modal-footer,.q-modal-footer,.dialog-actions,.cs-decision-footer){padding:10px 14px!important;}
   .portal-account #resStudentName{max-width:112px;font-size:12px!important;}.portal-account-role{font-size:11px!important;}
   #studentResultsArea :is(.sp-sidebar-route,.sp-sidebar-tool){min-height:44px!important;}
   .tk-chat .chat-compose{padding-bottom:max(10px,env(safe-area-inset-bottom));}
   .tk-chat .chat-compose textarea{font-size:16px!important;}
   .tk-chat .chat-story-stage:not(:fullscreen){height:clamp(170px,calc(var(--tk-visual-height,100dvh) - 420px),360px)!important;}
   :is(.tk-fabs,.chat-fab){bottom:calc(14px + env(safe-area-inset-bottom))!important;}
  }
  @media(prefers-reduced-motion:reduce){html{scroll-behavior:auto!important;}*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important;}}
  [hidden]{display:none!important;}
 }
}
@keyframes tk-icon-spin{to{transform:rotate(360deg);}}
