@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@400;500;600;700&display=swap');

/* Final, screen-only SIS layer. Load after AdminLTE, module CSS and inline styles.
   No print rules, element visibility changes, fixed grid widths or icon font resets. */
@media screen {
  :root {
    --sis-font: "Noto Sans Thai", Tahoma, "Leelawadee UI", sans-serif;
    --sis-heading: #352044;
    --sis-heading-soft: #6b4d68;
    --sis-primary: #3f2258;
    --sis-primary-dark: #2d183f;
    --sis-gold: #ffc451;
    --sis-bg: #fff4d5;
    --sis-surface: #fff9eb;
    --sis-sidebar: #fff1bd;
    --sis-sidebar-ink: #604353;
    --sis-plum-soft: #f0e8f5;
    --sis-peach-soft: #fff0dd;
    --sis-blue-soft: #eaf2ff;
    --sis-mint-soft: #e7f6ef;
    --sis-orange-soft: #fff0e0;
    --sis-canvas: linear-gradient(125deg, #ffe087 0%, #ffeab5 55%, #ffe087 100%);
    --sis-hero: linear-gradient(115deg, #ffc456 0%, #ffe77e 100%);
    --sis-text: #352044;
    --sis-muted: #76624a;
    --sis-border: #e7d3a4;
    --sis-radius: 12px;
    --sis-shadow: 0 5px 20px rgba(111, 74, 29, .075);
    --ict-wine: var(--sis-primary);
    --ict-wine-dark: var(--sis-primary-dark);
    --ict-gold: var(--sis-gold);
    --ict-gold-soft: #fff2cc;
    --ict-paper: var(--sis-bg);
    --ict-ink: var(--sis-text);
    --ict-muted: var(--sis-muted);
    --ict-line: var(--sis-border);
    --ict-shadow: var(--sis-shadow);
  }

  html { font-size: 16px; scroll-padding-top: 84px; }
  html body {
    font-family: var(--sis-font) !important;
    font-size: 16px !important;
    line-height: 1.65;
    color: var(--sis-text);
    background: var(--sis-canvas);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }
  /* Old modules contain font[face], font[size] and inline serif declarations.
     Exclude icon-font hosts; their pseudo-elements must retain their font. */
  body :where(div, section, main, article, aside, header, footer, nav, p, a, span,
    strong, b, em, small, label, legend, fieldset, button, input, select, option,
    textarea, table, caption, thead, tbody, tfoot, tr, th, td, ul, ol, li, dl, dt,
    dd, summary, details, h1, h2, h3, h4, h5, h6, font, i):not(:where(
      .fa, .fas, .far, .fab, .fal, .fad, .fat, .fass, .fasr, .fasl, .fast,
      .fa-solid, .fa-regular, .fa-brands, .fa-light, .fa-thin, .fa-duotone,
      [class^="fa-"], [class*=" fa-"], [class^="glyphicon-"], [class*=" glyphicon-"],
      .glyphicon, .ion, [class^="ion-"], [class*=" ion-"], .bi,
      .material-icons, .material-icons-outlined, .material-icons-round,
      .material-icons-sharp, .material-icons-two-tone,
      .material-symbols-outlined, .material-symbols-rounded, .material-symbols-sharp)) {
    font-family: var(--sis-font) !important;
  }
  body font[face], body font[size] { font-size: inherit !important; line-height: inherit !important; }
  body :where(code, pre, kbd, samp), body :where(code, pre, kbd, samp) * {
    font-family: ui-monospace, Consolas, "Liberation Mono", monospace !important;
  }
  body :where(h1, .h1) { font-size: 1.75rem !important; }
  body :where(h2, .h2) { font-size: 1.35rem !important; }
  body :where(h3, .h3) { font-size: 1.125rem !important; }
  body :where(h4, .h4) { font-size: 1.0625rem !important; }
  body :where(h5, .h5, h6, .h6) { font-size: 1rem !important; }
  body :where(h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6) {
    font-weight: 700;
    line-height: 1.45 !important;
    letter-spacing: 0 !important;
    overflow-wrap: anywhere;
  }
  body :where(.display-1, .display-2, .display-3, .display-4) {
    font-size: clamp(1.5rem, 2.1vw, 2rem) !important;
    line-height: 1.45 !important;
  }
  body small, body .small { font-size: .8125rem; }
  body a { color: var(--sis-primary); text-underline-offset: 3px; }
  body a:hover { color: var(--sis-primary-dark); }
  body :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 3px solid #69407d !important;
    outline-offset: 3px !important;
  }
  body button, body a, body input, body select { touch-action: manipulation; }

  /* AdminLTE shell: retain its collapse/overlay behavior and 250px sidebar geometry. */
  body .content-wrapper { background: var(--sis-bg) !important; }
  body .main-header.navbar {
    height: 68px !important;
    min-height: 68px;
    padding: 0 24px;
    background: #fff9eb !important;
    border: 0;
    border-bottom: 1px solid var(--sis-border);
    box-shadow: none;
  }
  body.layout-navbar-fixed .wrapper .content-wrapper { margin-top: 68px; }
  body .ict-header-title { font-size: 1rem; color: var(--sis-heading); font-weight: 700; }
  body .ict-header-title small { font-size: .6875rem; color: var(--sis-muted); letter-spacing: 1px; }
  body .ict-menu-toggle { width: 40px; height: 40px !important; border-radius: 9px; background: #fff6df; }
  body .ict-header-tools { gap: 16px; min-width: 0; }
  body .ict-term { padding: 6px 11px; border: 1px solid #ecd7a3; border-radius: 9px; background: #fff2ce; color: #78512e; }
  body .ict-term strong { font-size: .9375rem; }
  body .ict-term small { font-size: .75rem; color: #795c40; }
  body .ict-user-name { font-size: .875rem; font-weight: 600; max-width: 190px; }
  body .ict-user span small { font-size: .75rem; color: var(--sis-muted); }
  body .ict-avatar { width: 36px; height: 36px; border: 0; box-shadow: none; background: #ffedbf; color: var(--sis-primary); }
  body .ict-logout { font-size: .8125rem; padding-left: 15px; }
  body .main-sidebar { background: var(--sis-sidebar) !important; color: var(--sis-sidebar-ink); border-right: 1px solid var(--sis-border); box-shadow: 1px 0 18px #3f225804 !important; }
  body .main-sidebar .brand-link { height: 68px !important; padding: 14px 17px; background: transparent !important; border-bottom: 1px solid var(--sis-border); color: var(--sis-heading) !important; }
  body .brand-link .brand-image { width: 36px; height: 36px; max-height: 36px; border-radius: 8px; }
  body .ict-brand-copy strong { font-size: 1rem; letter-spacing: .7px; color: var(--sis-heading); }
  body .ict-brand-copy small { font-size: .6875rem; color: #684a36; letter-spacing: .2px; }
  body .main-sidebar .sidebar { padding: 12px 10px 24px; }
  body .main-sidebar .nav-header { color: #7b6048 !important; font-size: .6875rem; font-weight: 600; padding: 17px 11px 8px; letter-spacing: .3px; }
  body .main-sidebar .nav-sidebar > .nav-item > .nav-link {
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 10px 11px;
    min-height: 43px;
    margin-bottom: 3px;
    font-size: .875rem;
    font-weight: 500;
    line-height: 1.5;
    color: var(--sis-sidebar-ink) !important;
  }
  body .main-sidebar .nav-sidebar .nav-link p { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 0; line-height: 1.55; }
  body .main-sidebar .nav-sidebar .has-treeview > .nav-link p { padding-right: 18px; }
  body .main-sidebar .nav-sidebar .nav-link > .nav-icon,
  body .main-sidebar .nav-sidebar .nav-link > i { width: 20px; font-size: .9375rem; color: #86644b !important; margin-right: 9px; }
  body .main-sidebar .nav-sidebar .nav-link:hover { border-color: #ebd8ae; background: #ffebae !important; color: var(--sis-primary-dark) !important; }
  body .main-sidebar .nav-sidebar > .nav-item > .nav-link.active { background: var(--sis-gold) !important; color: var(--sis-heading) !important; box-shadow: 0 4px 12px #ba842019 !important; border-color: var(--sis-gold); font-weight: 700; }
  body .main-sidebar .nav-sidebar > .nav-item > .nav-link.active > .nav-icon,
  body .main-sidebar .nav-sidebar > .nav-item > .nav-link.active > i { color: var(--sis-heading) !important; }
  body .main-sidebar .nav-treeview { padding: 4px 0; background: #fff5d7 !important; border: 0; border-radius: 8px; margin-bottom: 6px; }
  body .main-sidebar .nav-treeview > .nav-item > .nav-link { min-height: 38px; padding: 8px 10px; font-size: .8125rem; color: #765841 !important; }
  body .main-sidebar .nav-treeview > .nav-item > .nav-link.active { color: var(--sis-primary-dark) !important; background: #ffe4a1 !important; }
  body .main-sidebar .nav-sidebar .nav-link.text-danger { color: #b03b66 !important; }
  body .main-sidebar .nav-sidebar .right { top: 13px; right: 12px; }
  body .content-header { padding: 21px 24px 12px; }
  body .content-header h1, body .content-header h5 { font-size: 1.5rem !important; color: var(--sis-heading); margin: 0; }
  body .content-header .breadcrumb { font-size: .8125rem; padding-top: 5px; margin-bottom: 0; }
  body .content-wrapper > .content { padding: 0 24px 24px; }
  body .main-footer { padding: 16px 24px; border-color: var(--sis-border); color: var(--sis-muted); font-size: .75rem; background: transparent; }

  /* Shared surfaces, controls and feedback. Colors retain their success/error meaning. */
  body .card { background: var(--sis-surface); border: 1px solid var(--sis-border); border-radius: var(--sis-radius); box-shadow: var(--sis-shadow); margin-bottom: 18px; }
  body .card-header { padding: 16px 20px; border-color: var(--sis-border); border-radius: 11px 11px 0 0; }
  body .card-body { padding: 20px; }
  body .card-title { font-size: 1.0625rem !important; font-weight: 700; line-height: 1.5; }
  body .card-footer { background: #fffcf2; padding: 14px 20px; border-color: var(--sis-border); }
  body .card-primary:not(.card-outline) > .card-header { background: #ffedbb; color: var(--sis-primary-dark); }
  body .card-primary:not(.card-outline) > .card-header .card-title { color: var(--sis-primary-dark); }
  body .card-primary.card-outline { border-top: 3px solid var(--sis-primary); }
  body .card-warning.card-outline { border-top: 3px solid var(--sis-gold); }
  body .btn { font-size: .9375rem !important; font-weight: 600; line-height: 1.45; min-height: 42px; padding: 9px 15px; border-radius: 8px; box-shadow: none !important; white-space: normal; }
  body .btn-sm { min-height: 36px; padding: 6px 11px; font-size: .8125rem !important; }
  body .btn-lg { min-height: 48px; padding: 12px 20px; font-size: 1rem !important; }
  body .btn-primary { color: #fff; background: var(--sis-primary); border-color: var(--sis-primary); }
  body .btn-primary:hover, body .btn-primary:focus { color: #fff; background: var(--sis-primary-dark); border-color: var(--sis-primary-dark); }
  body .btn-outline-primary { color: var(--sis-primary); border-color: var(--sis-primary); background: transparent; }
  body .btn-outline-primary:hover { color: #fff; background: var(--sis-primary); border-color: var(--sis-primary); }
  body .btn-success { color: #fff; background: #167759; border-color: #167759; }
  body .btn-success:hover, body .btn-success:focus { color: #fff; background: #116047; border-color: #116047; }
  body .btn-danger { color: #fff; background: #ad334c; border-color: #ad334c; }
  body .btn-danger:hover, body .btn-danger:focus { color: #fff; background: #8e293f; border-color: #8e293f; }
  body .btn-warning { color: #493718; background: var(--sis-gold); border-color: var(--sis-gold); }
  body .btn-warning:hover { color: #493718; background: #e4bc63; border-color: #e4bc63; }
  body .btn-info { color: #fff; background: #236a8e; border-color: #236a8e; }
  body .btn-secondary, body .btn-default { color: #71583f; background: #fff2d4; border-color: #ead6a8; }
  body .btn-secondary:hover, body .btn-default:hover { color: #563b43; background: #f8e7bd; border-color: #dfc58c; }
  body .btn:disabled, body button:disabled { opacity: .55; cursor: not-allowed; }
  body .form-control, body .custom-select { min-height: 42px; border: 1px solid #dbc499; border-radius: 8px; padding: 8px 12px; color: var(--sis-text); background: #fff; font-size: 1rem !important; line-height: 1.5; }
  body textarea.form-control { min-height: 100px; height: auto; }
  body .form-control:focus, body .custom-select:focus { border-color: #a87d43; box-shadow: 0 0 0 3px #3f225816; }
  body .form-control.is-invalid { border-color: #b43d55; }
  body .form-control.is-invalid:focus { border-color: #b43d55; box-shadow: 0 0 0 3px #b43d5518; }
  body .form-control.is-valid { border-color: #167759; }
  body .form-control.is-valid:focus { border-color: #167759; box-shadow: 0 0 0 3px #16775918; }
  body label { color: #6e543d; font-size: .875rem; font-weight: 600; margin-bottom: 6px; }
  body .form-group { margin-bottom: 16px; }
  body .input-group-text { background: #fff5dd; color: var(--sis-muted); border-color: #dbc499; border-radius: 8px; font-size: .9375rem; }
  body .form-text, body .invalid-feedback, body .valid-feedback { font-size: .8125rem; line-height: 1.6; }
  body .select2-container--default .select2-selection--single { height: 42px; min-height: 42px; border: 1px solid #dbc499; border-radius: 8px; }
  body .select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 40px; padding-left: 12px; font-size: 1rem; color: var(--sis-text); }
  body .select2-container--default .select2-selection--single .select2-selection__arrow { height: 40px; }
  body .select2-container--default .select2-selection--multiple { min-height: 42px; border-color: #dbc499; border-radius: 8px; }
  body .select2-dropdown { border-color: #dbc499; border-radius: 8px; box-shadow: 0 8px 24px #3f225812; }
  body .alert { border-radius: 10px; font-size: .9375rem; line-height: 1.65; padding: 13px 16px; }
  body .alert-success { color: #185a42; background: #eaf6ef; border-color: #c1dfcf; }
  body .alert-danger { color: #8c293e; background: #fff0f2; border-color: #ecc7ce; }
  body .alert-warning { color: #765719; background: #fff7e4; border-color: #efdeb0; }
  body .alert-info { color: #2c587b; background: #edf5fb; border-color: #cddfec; }
  body .badge { border-radius: 6px; font-size: .75rem; font-weight: 600; line-height: 1.5; padding: 4px 8px; }
  body .badge-success { background: #e5f3eb; color: #166047; }
  body .badge-danger { background: #fbe8ec; color: #9b2d44; }
  body .badge-warning { background: #fff2d2; color: #7b5b1b; }
  body .badge-info { background: #e8f1fa; color: #2b6187; }

  /* Tables retain real table semantics; only the existing tagged mobile tables stack. */
  body .table, body .academic-app table { color: var(--sis-text); font-size: .9375rem; line-height: 1.6; }
  body .table thead th, body .academic-app table th { padding: 12px 13px; background: #fff0c8; color: #786146; font-size: .8125rem; font-weight: 700; border-color: var(--sis-border); white-space: normal; vertical-align: middle; }
  body .table td, body .academic-app table td { padding: 12px 13px; border-color: #f2e4c7; line-height: 1.6; vertical-align: middle; font-size: .9375rem; }
  body .table-striped tbody tr:nth-of-type(odd) { background: #fffdf6; }
  body .table-hover tbody tr:hover, body .academic-app tbody tr:hover { background: #fff0c8; }
  body .table-bordered, body .table-bordered th, body .table-bordered td { border-color: var(--sis-border); }
  body .table-responsive, body .academic-app .table-scroll { border-radius: 9px; scrollbar-width: thin; overscroll-behavior-x: contain; }
  body .academic-app .table-scroll { border: 1px solid var(--sis-border); }
  body .table td small, body .academic-app td small { color: var(--sis-muted); font-size: .8125rem; }
  body .dataTables_wrapper .row { row-gap: 10px; }
  body .dataTables_wrapper .dataTables_filter input { width: 210px; min-width: 130px; margin-left: 8px; }
  body .dataTables_wrapper .dataTables_info { font-size: .8125rem; color: var(--sis-muted); }
  body .page-link { padding: 8px 12px; color: var(--sis-primary); border-color: var(--sis-border); font-size: .875rem; line-height: 1.5; }
  body .page-item.active .page-link { background: var(--sis-primary); border-color: var(--sis-primary); color: #fff; }
  body .dt-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
  body .modal-content { border: 1px solid var(--sis-border); border-radius: 14px; box-shadow: 0 18px 65px #3f22581c; }
  body .modal-header { padding: 17px 20px; background: #fffaf0; border-radius: 13px 13px 0 0; border-color: var(--sis-border); }
  body .modal-title { font-size: 1.25rem !important; }
  body .modal-body { padding: 20px; }
  body .modal-footer { padding: 14px 20px; border-color: var(--sis-border); }
  body .swal2-popup { border-radius: 14px !important; padding: 24px !important; }
  body .swal2-title { font-size: 1.375rem !important; line-height: 1.5; }
  body .swal2-html-container, body .swal2-content { font-size: 1rem !important; line-height: 1.65; }
  body .swal2-actions button { border-radius: 8px !important; font-size: .9375rem !important; min-height: 42px; }
  body .small-box, body .info-box { border-radius: var(--sis-radius); box-shadow: var(--sis-shadow); }
  body .small-box h3 { font-size: 2rem !important; line-height: 1.3 !important; }
  body .info-box { padding: 12px; border-color: var(--sis-border); }
  body .info-box-icon { border-radius: 9px; }

  /* Academic workspace. Override accumulated module/inline styles at final load. */
  body .academic-app { --academic-border: var(--sis-border); font-size: 1rem; color: var(--sis-text); }
  body .academic-app main { padding: 2px 0 0 !important; }
  body .academic-app .intro { margin-bottom: 18px; gap: 14px; }
  body .academic-app .intro h1 { font-size: 1.625rem !important; margin-bottom: 7px; color: var(--sis-heading); }
  body .academic-app .intro p { font-size: .9375rem; color: var(--sis-muted); line-height: 1.7; }
  body .academic-app .panel { padding: 20px; border: 1px solid var(--sis-border); border-radius: var(--sis-radius); box-shadow: var(--sis-shadow); margin-bottom: 18px; background: var(--sis-surface); min-width: 0; }
  body .academic-app .section-heading { gap: 12px; margin-bottom: 14px; }
  body .academic-app h2 { font-size: 1.1875rem !important; color: var(--sis-heading); line-height: 1.5; }
  body .academic-app h3 { font-size: 1.0625rem !important; line-height: 1.5; }
  body .academic-app .hint, body .academic-app .footnote { font-size: .8125rem; color: var(--sis-muted); line-height: 1.7; }
  body .academic-app .tabs { gap: 4px; padding: 4px; margin-bottom: 18px; border-radius: 10px; border-color: var(--sis-border); }
  body .academic-app .tabs a { padding: 9px 13px; border-radius: 7px; font-size: .875rem; line-height: 1.5; color: #76624a; }
  body .academic-app .tabs a.active { color: #fff; background: var(--sis-primary); }
  body .academic-app .tabs a:hover { background: #fff4d5; }
  body .academic-app .tabs a.active:hover { background: var(--sis-primary-dark); }
  body .academic-app .dashboard-hero, body .academic-app .intro.dashboard-hero {
    background: var(--sis-hero) !important;
    color: var(--sis-heading);
    border: 1px solid #ebca7e;
    border-radius: 14px;
    padding: 23px 26px;
    min-height: 0 !important;
    margin-bottom: 20px;
    box-shadow: none;
  }
  body .academic-app .dashboard-hero::after { display: none; }
  body .academic-app .dashboard-hero h1, body .academic-app .dashboard-hero h2 { color: var(--sis-heading); font-size: 1.625rem !important; line-height: 1.5 !important; }
  body .academic-app .dashboard-hero p { margin-top: 7px; color: #684a36; font-size: .9375rem; }
  body .academic-app .hero-eyebrow { color: var(--sis-primary-dark); font-size: .6875rem; letter-spacing: 1.5px; margin-bottom: 7px; }
  body .academic-app .section-eyebrow { font-size: .6875rem; color: #5b365f; letter-spacing: 1px; margin-bottom: 4px; }
  body .academic-app .dashboard-hero .badge { background: #ffffffa8; color: #69462f; border: 1px solid #eccb80; }
  body .academic-app .filters { gap: 14px; align-items: flex-end; }
  body .academic-app .filters label { color: #6d533f; font-size: .8125rem; }
  body .academic-app label > input:not([type=checkbox]):not([type=radio]), body .academic-app label > select { margin-top: 6px; }
  body .academic-app input:not([type=checkbox]):not([type=radio]):not([type=hidden]),
  body .academic-app select, body .academic-app textarea {
    min-height: 42px;
    border: 1px solid #dbc499;
    border-radius: 8px;
    padding: 8px 11px;
    font-size: 1rem !important;
    line-height: 1.5;
    color: var(--sis-text);
    background: #fff;
  }
  body .academic-app input:focus, body .academic-app select:focus, body .academic-app textarea:focus { border-color: #a87d43; box-shadow: 0 0 0 3px #3f225816; }
  body .academic-app input[type=checkbox], body .academic-app input[type=radio] { width: 18px; height: 18px; min-height: 18px; accent-color: var(--sis-primary); }
  body .academic-app button, body .academic-app .button { min-height: 42px; padding: 9px 14px; border-radius: 8px; font-size: .9375rem !important; line-height: 1.5; background: var(--sis-primary); color: #fff; border: 1px solid var(--sis-primary); }
  body .academic-app button:hover, body .academic-app .button:hover { background: var(--sis-primary-dark); border-color: var(--sis-primary-dark); }
  body .academic-app button.secondary, body .academic-app .button.secondary { color: #6c513e; background: #fff4d5; border-color: #ead6a8; }
  body .academic-app button.secondary:hover { background: #f7e6bd; }
  body .academic-app button.danger { color: #fff; background: #ad334c; border-color: #ad334c; }
  body .academic-app button.link-button { color: var(--sis-primary); background: transparent; border-color: transparent; }
  body .academic-app .badge { font-size: .75rem; padding: 5px 9px; border-radius: 6px; background: #fff0ca; color: #76624a; }
  body .academic-app .badge.published { color: #166047; background: #e5f3eb; }
  body .academic-app .badge.pending { color: #7b5b1b; background: #fff2d2; }
  body .academic-app .stat-card, body .academic-app .dashboard-stat { border-radius: var(--sis-radius); padding: 18px; border-color: var(--sis-border); min-height: 132px; margin-bottom: 16px; box-shadow: var(--sis-shadow); background: var(--sis-surface); }
  body .academic-app .stat-title { color: #76624a; font-size: .875rem; padding-right: 35px; }
  body .academic-app .stat-icon { width: 32px; height: 32px; top: 17px; right: 17px; border-radius: 9px; font-size: 1rem; }
  body .academic-app .stat-icon.wine { color: #3f2258; background: #fff0c9; }
  body .academic-app .stat-icon.gold { color: #a66022; background: #fff0e0; }
  body .academic-app .stat-icon.sand { color: #4473a7; background: #e7f0ff; }
  body .academic-app .stat-icon.rose { color: #a35e32; background: #ffead5; }
  body .academic-app .stat-value { margin: 9px 0 3px; gap: 7px; }
  body .academic-app .stat-value strong { font-size: 2rem !important; line-height: 1.25; letter-spacing: -.5px; color: var(--sis-heading); }
  body .academic-app .stat-value span, body .academic-app .stat-note { color: var(--sis-muted); font-size: .75rem; }
  body .academic-app .grade-overview { gap: 20px; padding: 14px 0 5px; }
  body .academic-app .grade-donut { width: 168px; height: 168px; background: #efe0b9; }
  body .academic-app .grade-donut > div { width: 132px; height: 132px; }
  body .academic-app .grade-donut strong { font-size: 1.625rem; color: var(--sis-heading); }
  body .academic-app .grade-donut span { font-size: .75rem; color: var(--sis-muted); }
  body .academic-app .grade-legend > div { font-size: .875rem; padding: 11px 0; border-color: #f5e9cf; }
  body .academic-app .grade-legend strong { font-size: 1.125rem; }
  body .academic-app .grade-legend small { font-size: .75rem; color: var(--sis-muted); }
  body .academic-app .quick-actions > a { border: 1px solid var(--sis-border); background: var(--sis-surface); border-radius: 9px; padding: 12px; margin-bottom: 8px; }
  body .academic-app .quick-actions > a:hover { border-color: #dec18a; background: #fffaf0; }
  body .academic-app .quick-icon { width: 34px; height: 34px; border-radius: 8px; background: #fff0c9; color: var(--sis-primary); }
  body .academic-app .quick-actions > a:nth-child(4n+2) .quick-icon { color: #a35e32; background: #ffead5; }
  body .academic-app .quick-actions > a:nth-child(4n+3) .quick-icon { color: #4473a7; background: #e7f0ff; }
  body .academic-app .quick-actions > a:nth-child(4n+4) .quick-icon { color: #217759; background: #e4f5ec; }
  body .academic-app .quick-actions strong, body .academic-app .course-heading strong, body .academic-app .activity-item strong { font-size: .875rem; }
  body .academic-app .quick-actions small, body .academic-app .course-heading small, body .academic-app .course-meta, body .academic-app .activity-item small { font-size: .75rem; color: var(--sis-muted); }
  body .academic-app .course-item, body .academic-app .activity-item { padding: 12px 0; }
  body .academic-app .dashboard-empty { font-size: .875rem; padding: 20px 14px; background: #fff7e5; color: var(--sis-muted); border-radius: 9px; }
  body .academic-app .workflow-stats { gap: 10px; margin: 14px 0; }
  body .academic-app .workflow-stats button { color: #72551f; background: #fff8e8; border-color: #f4d9b9; padding: 12px; font-size: .8125rem !important; }
  body .academic-app .workflow-stats strong { font-size: 1.5rem; }
  body .academic-app .student-summary { gap: 14px; }
  body .academic-app .student-summary > div { min-width: 160px; padding: 18px; border-radius: 11px; font-size: .875rem; color: var(--sis-muted); border-color: var(--sis-border); }
  body .academic-app .student-summary strong { color: var(--sis-heading); font-size: 1.875rem; margin-top: 8px; }
  body .academic-app .advisor-policy { padding: 13px 16px; border-radius: 10px; background: #edf3fb; border-color: #d4e3fa; color: #466b98; font-size: .9375rem; }
  body .academic-app .registration-grid { gap: 20px; }
  body .academic-app .registration-grid > div + div { padding-left: 20px; }
  body .academic-app .import-panel { gap: 20px; }
  body .academic-app .import-panel form { padding: 16px; background: #fff7ec; border-radius: 10px; border-color: #edd2b0; }
  body .academic-app .assignment { padding: 16px; border-radius: 10px; background: #fff8e8; }
  body .academic-app .chip { padding: 5px 10px; background: #fff0df; border-radius: 7px; font-size: .8125rem; }
  body .academic-app .chip button { min-height: 32px; min-width: 32px; padding: 2px 6px; background: transparent; color: var(--sis-primary); border-color: transparent; }
  body .academic-app .notice { border-radius: 10px; box-shadow: 0 6px 24px #3f225818; font-size: .875rem; padding: 13px 16px; }
  body .academic-app dialog { padding: 22px; border-radius: 14px; border-color: var(--sis-border); box-shadow: 0 18px 65px #3f22581c; }
  body .academic-app dialog::backdrop { background: #1422388c; }
  body .academic-app .history-context { padding: 12px 14px; background: #fff8e8; border-radius: 9px; font-size: .9375rem; }
  body .academic-app .history-item { padding: 17px 0; }
  body .academic-app .history-changes > section { padding: 15px; background: #fffaf0; border-color: var(--sis-border); }
  body .academic-app .history-changes > section:last-child { background: #fff8e7; }
  body .academic-app .history-fields { font-size: .9375rem; }
  body .academic-app .history-meta, body .academic-app .history-note, body .academic-app .history-fields dt { color: var(--sis-muted); font-size: .8125rem; }

  /* Existing membership and student pages inside the same shell. */
  body .member-shell { max-width: 1540px; }
  body .member-hero { border-radius: 14px; background: var(--sis-hero) !important; color: var(--sis-heading); border: 1px solid #ebca7e; box-shadow: none; padding: 24px; }
  body .member-hero h1, body .member-hero h2 { color: var(--sis-heading); font-size: 1.625rem !important; }
  body .member-hero p, body .member-hero small { color: #684a36; }
  body .member-hero .member-eyebrow { color: var(--sis-primary-dark); }
  body .member-panel, body .member-stat { border-radius: var(--sis-radius); border-color: var(--sis-border); box-shadow: var(--sis-shadow); }
  body .member-table th { background: #fff0c8; color: #786146; font-size: .8125rem; }
  body .ict-student-hero { background: var(--sis-hero) !important; color: var(--sis-heading); border: 1px solid #ebca7e; border-radius: 14px; padding: 24px !important; margin-bottom: 20px !important; }
  body .ict-student-hero h1 { color: var(--sis-heading) !important; font-size: 1.625rem !important; }
  body .ict-student-hero p { color: #684a36 !important; font-size: .9375rem; }
  body .ict-student-hero .ict-page-kicker { color: var(--sis-primary-dark); }
  body.layout-top-nav .main-header.navbar { height: auto !important; min-height: 68px; }
  body.layout-top-nav .navbar-brand { font-size: 1.0625rem; }
  body.layout-top-nav .navbar-nav .nav-link { font-size: .875rem; }
  body.layout-top-nav .content-wrapper { margin-top: 0 !important; }

  /* Opt-in standalone pages: the installer adds sis-standalone to their body.
     No global main/.container rules are applied to unrelated applications. */
  body.sis-standalone { margin: 0; min-height: 100vh; padding: 24px 18px; background: var(--sis-canvas) !important; }
  body.sis-standalone > main, body.sis-standalone > .container,
  body.sis-standalone > .shell, body.sis-standalone > .profile-shell {
    max-width: 1120px;
    width: 100%;
    margin: 0 auto;
    min-width: 0;
  }
  body.sis-standalone > .wrap, body.sis-standalone > .wrapper { margin-left: auto; margin-right: auto; max-width: 1120px; }
  body.sis-standalone :where(.panel, .card, .profile-card, .password-card, .reset-card, .student-card) { background: var(--sis-surface); border: 1px solid var(--sis-border); border-radius: var(--sis-radius); box-shadow: var(--sis-shadow); padding: 22px; margin-bottom: 18px; min-width: 0; }
  body.sis-standalone :where(.password-card, .reset-card, .password-shell, .login-box) { max-width: 560px; margin-left: auto; margin-right: auto; }
  body.sis-standalone :where(.hero, .profile-hero, .page-hero) { background: var(--sis-hero) !important; border: 1px solid #ebca7e; border-radius: 14px; color: var(--sis-heading); padding: 23px 26px; margin-bottom: 20px; }
  body.sis-standalone :where(.hero, .profile-hero, .page-hero) :where(h1, h2, h3) { color: var(--sis-heading); font-size: 1.625rem !important; }
  body.sis-standalone :where(.hero, .profile-hero, .page-hero) p { color: #684a36; font-size: .9375rem; }
  body.sis-standalone :where(p, label, th, td, input, select, textarea) { line-height: 1.65; }
  body.sis-standalone label { display: block; font-size: .875rem; margin-bottom: 7px; }
  body.sis-standalone label > :where(input, select, textarea) { margin-top: 6px; }
  body.sis-standalone input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=submit]):not([type=button]),
  body.sis-standalone select, body.sis-standalone textarea {
    max-width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid #dbc499; border-radius: 8px; color: var(--sis-text); background: #fff; font-size: 1rem !important; line-height: 1.5;
  }
  body.sis-standalone textarea { min-height: 100px; }
  body.sis-standalone input[type=checkbox], body.sis-standalone input[type=radio] { width: 18px; height: 18px; accent-color: var(--sis-primary); }
  body.sis-standalone input:focus, body.sis-standalone select:focus, body.sis-standalone textarea:focus { border-color: #a87d43; box-shadow: 0 0 0 3px #3f225816; }
  body.sis-standalone button:not(.btn), body.sis-standalone .button:not(.btn) { min-height: 42px; border-radius: 8px; border: 1px solid var(--sis-primary); padding: 10px 16px; background: var(--sis-primary); color: #fff; font-size: .9375rem !important; line-height: 1.5; font-weight: 600; }
  body.sis-standalone button.secondary, body.sis-standalone .button.secondary { color: #6c513e; background: #fff4d5; border-color: #ead6a8; }
  body.sis-standalone button.danger, body.sis-standalone .button.danger { background: #ad334c; border-color: #ad334c; color: #fff; }
  body.sis-standalone button.success, body.sis-standalone .button.success { background: #167759; border-color: #167759; color: #fff; }
  body.sis-standalone :where(.hint, .muted, .help, .form-hint, .footnote) { color: var(--sis-muted); font-size: .8125rem; }
  body.sis-standalone :where(.actions, .form-actions) { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
  body.sis-standalone table { width: 100%; font-size: .9375rem; border-collapse: collapse; }
  body.sis-standalone th, body.sis-standalone td { padding: 12px; border-bottom: 1px solid var(--sis-border); vertical-align: middle; }
  body.sis-standalone th { background: #fff0c8; color: #786146; font-size: .8125rem; }
  body.sis-standalone :where(.table-scroll, .table-responsive) { max-width: 100%; overflow-x: auto; border-radius: 9px; }
  body.sis-standalone :where(.profile-avatar, .avatar, .profile-photo) { object-fit: cover; border-radius: 14px; }
  body.login-page { background: var(--sis-canvas) !important; }
  body.login-page .card, body.login-page .ict-login-card { border: 1px solid var(--sis-border); border-radius: 16px; box-shadow: 0 12px 40px #3f225810; }
  body.login-page .login-card-body { padding: 28px; border-radius: 15px; }

  /* Anchor buttons must establish a real box, including when a label wraps.
     Old app.css styled only <button>, so inline anchors painted split fragments. */
  body .academic-app a.button, body.sis-standalone a.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    max-width: 100%;
    margin: 0 6px 10px 0;
    vertical-align: middle;
    white-space: normal;
    text-align: center;
    text-decoration: none;
    overflow-wrap: anywhere;
  }
  body .academic-app .panel p { margin-top: 0; margin-bottom: 12px; line-height: 1.7; }
  body .academic-app .panel p:last-child { margin-bottom: 0; }
  body .academic-app .actions { gap: 10px; }
  body .academic-app .actions a.button, body.sis-standalone .actions a.button { margin-bottom: 0; }
  body .academic-app .correction-nav { gap: 14px; margin: 18px 0; }
  body .academic-app .correction-nav a {
    min-height: 92px;
    padding: 17px 19px;
    gap: 14px;
    border: 1px solid var(--sis-border);
    border-radius: 12px;
    box-shadow: var(--sis-shadow);
    background: var(--sis-surface);
    color: var(--sis-primary);
  }
  body .academic-app .correction-nav a[aria-current=page] { background: var(--sis-primary); color: #fff; border-color: var(--sis-primary); }
  body .academic-app .correction-nav a:hover { background: #fff2cf; color: var(--sis-primary); border-color: #dfbc6d; }
  body .academic-app .correction-nav a[aria-current=page]:hover { background: var(--sis-primary-dark); color: #fff; border-color: var(--sis-primary-dark); }
  body .academic-app .correction-nav i { font-size: 1.5rem; color: #a57a3d; }
  body .academic-app .correction-nav a[aria-current=page] i { color: #fff; }
  body .academic-app .correction-nav strong { font-size: 1rem; line-height: 1.55; }
  body .academic-app .correction-nav small { font-size: .8125rem; line-height: 1.6; margin-top: 4px; }
  body .academic-app .correction-search { gap: 14px; }
  body .academic-app .correction-search button { min-height: 42px; min-width: 150px; font-size: .9375rem !important; }

  /* Exact standalone profile/reset/safety structures observed on SIS. */
  body.sis-standalone { max-width: none !important; }
  body.sis-standalone > header { max-width: 1020px; margin: 0 auto 18px; padding: 12px 17px; border: 1px solid var(--sis-border); border-radius: 10px; background: var(--sis-surface); font-size: .875rem; }
  body.sis-standalone > main:not(.login-shell) { max-width: 1020px; padding-left: 0; padding-right: 0; }
  body.sis-standalone main.container.py-4, body.sis-standalone main.container.py-5 { padding-top: 12px !important; padding-bottom: 18px !important; }
  body.sis-standalone .card.hero { align-items: center; gap: 20px; padding: 22px; }
  body.sis-standalone .card.hero > div { min-width: 0; }
  body.sis-standalone .card.hero .muted { color: #684a36; font-size: .875rem; }
  body.sis-standalone .card.hero .avatar { width: 88px; height: 104px; border: 1px solid #ffffffcf; flex-shrink: 0; }
  body.sis-standalone .grid { gap: 17px; }
  body.sis-standalone .photo-grid { grid-template-columns: 112px minmax(0, 1fr); gap: 20px; align-items: start; }
  body.sis-standalone .photo-grid .avatar { width: 104px; height: 120px; }
  body.sis-standalone .readonly { background: #fff6df !important; }
  body.sis-standalone .readonly dl { gap: 14px; margin: 8px 0 12px; }
  body.sis-standalone .readonly dt { color: var(--sis-muted); font-weight: 400; font-size: .8125rem; }
  body.sis-standalone .readonly dd { color: var(--sis-text); font-size: .9375rem; overflow-wrap: anywhere; }
  body.sis-standalone label.checkbox { display: flex; align-items: center; gap: 9px; font-size: .875rem; font-weight: 400; }
  body.sis-standalone label.checkbox input { margin: 0 !important; width: 18px; height: 18px; flex-shrink: 0; }
  body.sis-standalone input[type=file] { font-size: .875rem !important; }
  body.sis-standalone input::file-selector-button { border: 0; border-radius: 5px; background: #ffedbf; color: var(--sis-primary); padding: 5px 8px; margin-right: 8px; font-family: var(--sis-font); }
  body.sis-standalone .notice { padding: 13px 16px; border-radius: 10px; font-size: .9375rem; line-height: 1.65; }
  body.sis-standalone.sis-safety > main.sis-safety-content { max-width: 1100px; overflow-x: auto; padding: 22px; border: 1px solid var(--sis-border); border-radius: 12px; background: var(--sis-surface); box-shadow: var(--sis-shadow); }
  body.sis-standalone.sis-safety .note { padding: 15px 17px; margin-bottom: 16px; border: 1px solid #efdeb0; border-radius: 9px; background: #fff7e4; color: #765719; line-height: 1.65; }
  body.sis-standalone.sis-safety pre { max-height: 32rem; overflow: auto; background: #fff5dd; border: 1px solid var(--sis-border); border-radius: 8px; padding: 14px; font-size: .8125rem; white-space: pre-wrap; overflow-wrap: anywhere; }

  /* Actual staff/student login uses ict-login rather than AdminLTE login-page. */
  body.ict-login { background: var(--sis-canvas) !important; padding: 24px; }
  body.ict-login .login-shell { width: min(980px, 100%); min-height: 570px; border: 1px solid var(--sis-border); border-radius: 16px; box-shadow: 0 12px 40px #3f225810; }
  body.ict-login .login-brand { background: var(--sis-hero) !important; color: var(--sis-heading); padding: 32px; border-right: 1px solid #ebd8ae; }
  body.ict-login .login-brand::after { display: none; }
  body.ict-login .login-brand-name { font-size: 1.125rem; color: var(--sis-heading); }
  body.ict-login .login-brand-name img { width: 48px; height: 48px; }
  body.ict-login .login-brand-name small { font-size: .8125rem; color: #684a36; }
  body.ict-login .login-brand h1 > span { color: var(--sis-primary); }
  body.ict-login .login-brand .login-eyebrow { color: var(--sis-primary-dark); }
  body.ict-login .login-features i { color: #3f2258; }
  body.ict-login .login-brand-content { padding: 25px 0; }
  body.ict-login .login-brand h1 { font-size: 2rem !important; line-height: 1.55 !important; color: var(--sis-heading); }
  body.ict-login .login-brand p { margin-top: 16px; font-size: .9375rem; line-height: 1.8; color: #684a36; }
  body.ict-login .login-features { gap: 18px; margin-top: 25px; }
  body.ict-login .login-features span { font-size: .8125rem; color: #684a36; }
  body.ict-login .login-features i { margin-bottom: 9px; font-size: 1.25rem; }
  body.ict-login .login-brand-footer { font-size: .6875rem; color: #684a36; letter-spacing: 1.5px; }
  body.ict-login .login-form-panel { padding: 36px; }
  body.ict-login .login-form-panel h2 { font-size: 1.5rem !important; color: var(--sis-heading); margin-bottom: 10px; }
  body.ict-login .login-form-panel .login-eyebrow { color: var(--sis-primary-dark); }
  body.ict-login .login-description { color: var(--sis-muted); font-size: .9375rem; margin-bottom: 22px; }
  body.ict-login .login-form-panel label { font-size: .875rem; margin-bottom: 7px; }
  body.ict-login .login-form-panel .form-control { height: 46px; border-radius: 8px; border-color: #dbc499; }
  body.ict-login .login-form-panel .btn { height: 46px; border-radius: 8px; background: var(--sis-primary); border-color: var(--sis-primary); margin-top: 6px; }
  body.ict-login .login-form-panel .btn:hover { background: var(--sis-primary-dark); }
  body.ict-login .login-form-icon { width: 44px; height: 44px; border-radius: 10px; background: #ffedbf; color: var(--sis-primary); margin-bottom: 18px; }
  body.ict-login .login-help, body.ict-login .login-switch span { color: var(--sis-muted); font-size: .8125rem; }
  body.ict-login .login-help { margin: 16px 0 20px; }
  body.ict-login .login-switch { padding-top: 18px; border-color: var(--sis-border); font-size: .875rem; }
  body.ict-login .login-footer { color: var(--sis-muted); font-size: .75rem; margin-top: 16px; }

  @media (min-width: 992px) and (max-width: 1399.98px) {
    body .ict-header-title small { display: none; }
    body .ict-user-name { max-width: 145px; }
    body .ict-header-tools { gap: 10px; }
  }
  @media (max-width: 1199.98px) {
    body .academic-app .registration-grid { grid-template-columns: minmax(0, 1fr); }
    body .academic-app .registration-grid > div + div { padding: 17px 0 0; border-left: 0; border-top: 1px solid var(--sis-border); }
    body .academic-app .import-panel { grid-template-columns: minmax(0, 1fr); }
  }
  @media (max-width: 991.98px) {
    body .main-header.navbar { padding-left: 16px; padding-right: 16px; }
    body .content-header { padding: 18px 18px 12px; }
    body .content-wrapper > .content { padding: 0 18px 22px; }
    body .academic-app .grade-overview { flex-wrap: wrap; }
    body .academic-app #advisorFilters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    body .academic-app #advisorFilters > button { grid-column: 1 / -1; }
  }
  @media (max-width: 767.98px) {
    html { scroll-padding-top: 76px; }
    body :where(h1, .h1), body .academic-app .intro h1 { font-size: 1.4rem !important; }
    body .content-header h1, body .content-header h5 { font-size: 1.375rem !important; }
    body .main-header.navbar { padding: 0 13px; }
    body .content-header { padding: 18px 14px 12px; }
    body .content-wrapper > .content { padding: 0 14px 20px; }
    body .card-body, body .academic-app .panel { padding: 17px; }
    body .card-header { padding: 15px 17px; }
    body .academic-app .dashboard-hero, body .academic-app .intro.dashboard-hero { padding: 21px 20px; border-radius: 12px; }
    body .academic-app .dashboard-hero h1, body .academic-app .dashboard-hero h2 { font-size: 1.4rem !important; }
    body .academic-app .filters { display: flex; flex-direction: column; align-items: stretch; gap: 13px; }
    body .academic-app .filters > label { width: 100%; min-width: 0; }
    body .academic-app .filters > button { width: 100%; }
    body .academic-app .intro, body .academic-app .section-heading { gap: 12px; }
    body .academic-app .stat-card { padding: 16px; min-height: 130px; }
    body .academic-app .stat-value strong { font-size: 1.75rem !important; }
    body .academic-app .ict-responsive-table tr[data-stacked-row] { border-color: var(--sis-border); border-radius: 10px; padding: 6px; }
    body .academic-app .ict-responsive-table tr[data-stacked-row] td { padding: 9px; border: 0; font-size: .9375rem; }
    body .academic-app .ict-responsive-table tr[data-stacked-row] td::before { color: var(--sis-muted); font-size: .75rem; }
    body .academic-app .table-scroll:has(.ict-responsive-table) { overflow: visible; border: 0; }
    body .table td, body .table thead th { padding: 10px 11px; }
    body .dataTables_wrapper .dataTables_filter input { width: min(220px, 58vw); min-width: 120px; }
    body .modal-dialog { margin: 10px; }
    body .modal-body { padding: 17px; }
    body .modal-header, body .modal-footer { padding: 14px 17px; }
    body .academic-app dialog { padding: 17px; }
    body .academic-app .history-changes { grid-template-columns: minmax(0, 1fr); }
    body .member-shell { padding-left: 0; padding-right: 0; }
    body .member-hero { padding: 21px; }
    body.sis-standalone { padding: 18px 13px; }
    body.sis-standalone :where(.panel, .card, .profile-card, .password-card, .reset-card, .student-card) { padding: 18px; }
    body.sis-standalone :where(.hero, .profile-hero, .page-hero) { padding: 21px; }
    body.sis-standalone :where(.hero, .profile-hero, .page-hero) :where(h1, h2, h3) { font-size: 1.4rem !important; }
  }
  @media (max-width: 575.98px) {
    body .main-header.navbar { height: 64px !important; min-height: 64px; padding-left: 12px; padding-right: 12px; }
    body.layout-navbar-fixed .wrapper .content-wrapper { margin-top: 64px; }
    body .main-sidebar .brand-link { height: 64px !important; }
    body .ict-header-tools { gap: 9px; }
    body .ict-term { padding: 6px 9px; }
    body .ict-term strong { font-size: .875rem; }
    body .ict-term small { font-size: .6875rem; }
    body .ict-avatar { width: 32px; height: 32px; }
    body .ict-logout { border-left: 0; padding-left: 6px; }
    body .main-footer { padding: 15px 14px; }
    body .academic-app #advisorFilters { grid-template-columns: minmax(0, 1fr); }
    body .academic-app .grade-overview { flex-direction: column; gap: 12px; padding-top: 10px; }
    body .academic-app .grade-legend { width: 100%; max-width: none; }
    body .academic-app .grade-donut { width: 156px; height: 156px; }
    body .academic-app .grade-donut > div { width: 122px; height: 122px; }
    body .academic-app .student-summary { gap: 10px; }
    body .academic-app .student-summary > div { min-width: 135px; padding: 16px; }
    body .academic-app .actions > button { flex: 1 1 150px; }
    body .academic-app .notice { right: 12px; max-width: calc(100vw - 24px); }
    body .ict-student-hero { padding: 21px !important; }
    body .ict-student-hero h1 { font-size: 1.4rem !important; }
    body.layout-top-nav .main-header.navbar { height: auto !important; }
    body.layout-top-nav .navbar-brand { font-size: .9375rem; }
    body .btn, body .academic-app button, body.sis-standalone button:not(.btn) { min-height: 44px; }
    body .btn-sm { min-height: 38px; }
  }
  @media (max-width: 359.98px) {
    body .main-header.navbar { padding-left: 8px; padding-right: 8px; }
    body .ict-header-tools { gap: 6px; }
    body .ict-term { padding-left: 7px; padding-right: 7px; }
    body .academic-app .stat-card { padding: 13px; }
    body .academic-app .stat-value strong { font-size: 1.625rem !important; }
    body .academic-app .student-summary > div { min-width: 100%; }
    body .academic-app .ict-responsive-table tr[data-stacked-row] { grid-template-columns: minmax(0, 1fr); }
    body .academic-app .ict-responsive-table tr[data-stacked-row] td[data-label="เลือก"] { grid-column: 1; }
  }
  @media (max-width: 767.98px) {
    body .academic-app .correction-nav { grid-template-columns: minmax(0, 1fr); gap: 10px; }
    body .academic-app .correction-nav a { padding: 15px 16px; min-height: 82px; }
    body .academic-app .correction-search { flex-direction: column; align-items: stretch; }
    body .academic-app .correction-search button { width: 100%; min-width: 0; }
    body .academic-app .panel > a.button { width: 100%; margin-right: 0; }
    body .academic-app .panel p > a.button { max-width: 100%; }
    body.sis-standalone .grid { grid-template-columns: minmax(0, 1fr); }
    body.sis-standalone .photo-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    body.sis-standalone .readonly dl { grid-template-columns: minmax(0, 1fr); }
    body.sis-standalone .card.hero { padding: 18px; gap: 15px; }
    body.sis-standalone .card.hero .avatar { width: 72px; height: 88px; }
    body.sis-standalone .card.hero h1 { font-size: 1.25rem !important; }
    body.sis-standalone .actions .muted { flex-basis: 100%; }
    body.sis-standalone.sis-safety > main.sis-safety-content { padding: 17px; }
    body.ict-login { padding: 18px 12px; justify-content: flex-start; }
    body.ict-login .login-shell { display: block; width: min(480px, 100%); min-height: 0; border-radius: 14px; }
    body.ict-login .login-brand { padding: 22px; }
    body.ict-login .login-brand-name { font-size: 1rem; }
    body.ict-login .login-brand-name img { width: 42px; height: 42px; }
    body.ict-login .login-brand-content, body.ict-login .login-brand-footer { display: none; }
    body.ict-login .login-form-panel { padding: 26px 23px; }
    body.ict-login .login-form-panel h2 { font-size: 1.375rem !important; }
  }
  @media (prefers-reduced-motion: reduce) {
    body *, body *::before, body *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
  }
}
