:root{
  --fp-primary:#1e3a8a;
  --fp-primary-dark:#172554;
  --fp-bg:#f5f7ff;
  --fp-card:#ffffff;
  --fp-text:#0f172a;
  --fp-muted:#64748b;
  --fp-border:#e2e8f0;
  --fp-radius:18px;
}

*{box-sizing:border-box}
body{
  margin:0;
  font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,sans-serif;
  background:linear-gradient(180deg,#f7f9ff 0%, #f3f6ff 60%, #f7f9ff 100%);
  color:var(--fp-text);
  overflow-x:hidden; /* vertical-only scrolling */
}

.fp-shell{
  min-height:100svh;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  padding:
    calc(18px + env(safe-area-inset-top))
    calc(14px + env(safe-area-inset-right))
    calc(22px + env(safe-area-inset-bottom))
    calc(14px + env(safe-area-inset-left));
}

.fp-login{
  width:min(520px,100%);
  margin:0 auto;
  text-align:center;
}

.fp-title{
  font-weight:900;
  font-size:32px;
  color:var(--fp-primary);
  letter-spacing:-0.02em;
  margin-top:10px;
}
.fp-subtitle{
  margin-top:10px;
  font-weight:800;
  font-size:22px;
  color:#1f2937;
}

.fp-card{
  margin-top:22px;
  background:var(--fp-card);
  border:1px solid var(--fp-border);
  border-radius:var(--fp-radius);
  padding:26px 22px;
  box-shadow:0 18px 50px rgba(15,23,42,.08);
  width:100%;
  max-width:100%;
}
.fp-card-title{font-weight:900;font-size:18px}
.fp-card-sub{margin-top:8px;color:var(--fp-muted);font-size:14px;line-height:1.5}
.fp-hint{margin-top:12px;color:var(--fp-muted);font-size:13px}

.atos-install-banner{
  position:fixed;
  z-index:1000;
  left:14px;
  right:14px;
  bottom:calc(14px + env(safe-area-inset-bottom));
  display:flex;
  align-items:center;
  gap:10px;
  padding:12px 14px;
  border:1px solid #bfdbfe;
  border-radius:16px;
  background:#eff6ff;
  box-shadow:0 14px 38px rgba(15,23,42,.18);
  color:#1e3a8a;
  font-size:13px;
  font-weight:700;
}
.atos-install-banner[hidden]{display:none}
.atos-install-banner span{flex:1;line-height:1.35}
.atos-install-action,.atos-install-dismiss{
  border:0;
  border-radius:9px;
  padding:8px 10px;
  font:inherit;
  font-weight:900;
  white-space:nowrap;
  cursor:pointer;
}
.atos-install-action{background:#1e3a8a;color:#fff}
.atos-install-dismiss{background:transparent;color:#475569}

.fp-btn{
  width:100%;
  padding:16px 16px;
  border-radius:14px;
  border:1px solid var(--fp-border);
  font-weight:900;
  font-size:18px;
  cursor:pointer;
}
.fp-btn-primary{
  border:none;
  color:#fff;
  background:linear-gradient(135deg,var(--fp-primary) 0%, #2563eb 100%);
  box-shadow:0 10px 28px rgba(30,58,138,.25);
}
.fp-btn-secondary{
  background:#fff;
  color:var(--fp-primary);
  border:3px solid var(--fp-primary);
}
.fp-btn-outline{
  border-style:dashed;
}
.fp-btn + .fp-btn{margin-top:12px}

.fp-page{
  width:min(560px,100%);
  margin:0 auto;
  display:flex;
  flex-direction:column;
  align-items:stretch;
  max-width:100%;
}

.fp-header{
  text-align:center;
  padding:6px 6px 12px;
  margin-bottom: 14px; /* keep headings clearly above the form */
  width:100%;
}

.fp-app-title{
  font-size:12px;
  font-weight:900;
  letter-spacing:0.06em;
  text-transform:uppercase;
  color:#334155;
  margin-bottom:10px;
}
.fp-h1{
  margin:0;
  color:var(--fp-primary);
  font-size:34px;
  font-weight:900;
  letter-spacing:-0.02em;
}
.fp-h2{
  margin-top:10px;
  font-size:22px;
  font-weight:900;
  color:#1f2937;
}

#fpDepartmentTitle{
  /* If department is empty, JS hides it. */
}
.fp-h3{
  margin-top:12px;
  font-size:16px;
  color:var(--fp-muted);
}

.fp-app-title{
  font-size:12px;
  font-weight:950;
  letter-spacing:0.08em;
  text-transform:uppercase;
  color:#334155;
  margin-bottom:10px;
}
.fp-user{
  margin-top:14px;
  display:flex;
  justify-content:center;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
  color:var(--fp-muted);
  font-size:13px;
}
.fp-link{
  background:transparent;
  border:none;
  color:var(--fp-primary);
  font-weight:900;
  cursor:pointer;
  padding:6px 10px;
  border-radius:12px;
}
.fp-link:hover{background:rgba(30,58,138,.08)}

.fp-form .fp-label{
  display:block;
  text-align:left;
  font-weight:900;
  margin:14px 2px 10px;
  font-size:16px;
}

.fp-label-muted{
  color:#1f2937;
}

/* Make the form feel "native" on phones */
.fp-form{
  padding:18px 16px;
}

.fp-form--mobile{
  border-radius:22px;
}

.fp-form-section-title{
  font-size:12px;
  font-weight:900;
  letter-spacing:0.08em;
  text-transform:uppercase;
  color:#334155;
}

.fp-form-section-title--muted{
  color:#64748b;
}

.fp-action-stack{
  display:flex;
  flex-direction:column;
  gap:12px;
  margin-top:16px;
}

.fp-hidden{
  display:none !important;
}

.fp-form-divider{
  height: 1px;
  background: #e6eaf5;
  margin: 14px 0 6px;
  border-radius: 999px;
}
.fp-select{
  width:100%;
  padding:16px 16px;
  border-radius:14px;
  border:1.5px solid #cbd5e1;
  background:#fff;
  font-size:18px;
}
.fp-search-input{
  margin-bottom:10px;
}
.fp-search-input::placeholder{
  color:#94a3b8;
}
.fp-inline-actions{
  display:flex;
  gap:8px;
  margin-top:2px;
  margin-bottom:8px;
  flex-wrap:wrap;
}
.fp-mini-btn{
  flex:1 1 140px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid #cbd5e1;
  background:#eff6ff;
  color:#1e3a8a;
  font-size:13px;
  font-weight:900;
  cursor:pointer;
}
.fp-mini-btn-muted{
  background:#fff;
  color:#475569;
}
.fp-inline-hint{
  font-size:12px;
  color:#64748b;
  margin-bottom:4px;
}
.fp-admin-panel{
  margin-top:12px;
  padding-top:4px;
}
.fp-admin-tools-heading{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  margin:4px 2px 10px;
}
.fp-admin-tools-heading p{
  margin:5px 0 0;
  color:#64748b;
  font-size:12px;
  line-height:1.4;
}
.fp-admin-tabs{
  display:flex;
  gap:6px;
  padding:5px;
  border-radius:13px;
  background:#eef4ff;
}
.fp-admin-tab{
  flex:1 1 0;
  min-width:0;
  padding:10px 8px;
  border:0;
  border-radius:9px;
  background:transparent;
  color:#64748b;
  font-size:13px;
  font-weight:900;
  cursor:pointer;
}
.fp-admin-tab.active{
  color:#fff;
  background:#1e3a8a;
  box-shadow:0 3px 8px rgba(30,58,138,.2);
}
.fp-admin-tab:focus-visible{
  outline:3px solid #93c5fd;
  outline-offset:2px;
}
.fp-admin-tab-panel{
  margin-top:10px;
  border:1px solid #dbe4f0;
  border-radius:14px;
  background:#fff;
}
.fp-admin-tab-panel[hidden]{display:none}
.fp-admin-tab-panel.active{
  animation:fp-admin-panel-in .16s ease-out;
}
@keyframes fp-admin-panel-in{
  from{opacity:0;transform:translateY(-3px)}
  to{opacity:1;transform:translateY(0)}
}
.fp-admin-tool-content{
  padding:2px 14px 14px;
}
.fp-directory-sort{
  appearance:none;
  border:0;
  padding:0;
  background:transparent;
  color:inherit;
  font:inherit;
  font-weight:inherit;
  cursor:pointer;
  text-align:left;
}
.fp-directory-sort:hover{ text-decoration:underline; }
.fp-admin-tool-content .fp-btn:first-child{
  margin-top:12px;
}

.fp-results{
  margin-top:14px;
  width:100%;
  max-width:100%;
}

.fp-desktop-layout{
  display:block;
  width:100%;
}

.fp-desktop-sidebar,
.fp-desktop-content{
  min-width:0;
}

/* Timetable table grid (mobile-friendly; scroll inside only) */
.fp-tt-table-wrap{
  margin-top: 12px;
  border-radius: 16px;
  border: 1px solid var(--fp-border);
  background: #fff;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.fp-tt-table{
  border-collapse: collapse;
  width: 100%;
  min-width: 820px; /* allow horizontal scroll inside wrap */
}

.fp-tt-table th,
.fp-tt-table td{
  border: 1px solid #cbd5e1;
  padding: 10px 8px;
  vertical-align: middle;
  text-align: center;
}

.fp-tt-table thead th{
  background: #1e3a8a;
  color: #fff;
  font-weight: 950;
  font-size: 12px;
}

.fp-tt-sticky-col{
  position: sticky;
  left: 0;
  z-index: 2;
}

.fp-tt-table thead .fp-tt-sticky-col{
  z-index: 3;
}

.fp-tt-day{
  background: #f8fafc;
  font-weight: 950;
  color: #0f172a;
  font-size: 14px;
  width: 78px;
}

.fp-tt-cell{
  font-weight: 500;
  font-size: 12px;
  background: #ffffff;
  color: #0f172a;
}

.fp-tt-lab{
  /* A single merged lab block */
  background: #ffffff;
}

.fp-tt-group{
  display:inline-block;
  margin-left:6px;
  padding:2px 8px;
  border-radius:999px;
  background: rgba(30, 58, 138, 0.12);
  color: #1e3a8a;
  font-weight: 600;
  font-size: 11px;
  vertical-align: middle;
}

.fp-tt-multi-sep{
  height: 1px;
  background: rgba(148, 163, 184, 0.45);
  margin: 8px 0;
}

.fp-tt-free{
  background: #dcfce7;
  color: #166534;
}

.fp-tt-lunch{
  background: #ffffff;
  color: #0f172a;
}

.fp-tt-busy{
  background: #ffffff;
  color: #0f172a;
}

.fp-tt-lines{
  line-height: 1.25;
}
.fp-tt-line{
  font-weight: 500;
  font-size: 12px;
}

/* Distinct colors per line inside a slot (no bold) */
.fp-tt-line--subject{
  /* Subject: strong purple for quick scanning */
  color:#6d28d9;
  font-weight:500;
}
.fp-tt-line--who{
  /* Faculty/Class: teal */
  color:#0f766e;
}
.fp-tt-line--room{
  /* Room: orange */
  color:#c2410c;
}

.fp-tt-remark{
  color:#000000;
  font-size:12px;
  font-weight:800;
  line-height:1.25;
}

/* Remarks are information, not an available/free lesson slot. */
.fp-tt-table td.fp-tt-free:has(.fp-tt-remark){
  background:#ffffff !important;
  color:#000000 !important;
}

/* Ensure table grid colors are not overridden by legacy styles below */
.fp-tt-table td.fp-tt-free{
  background: #dcfce7 !important;
  color: #166534 !important;
}
.fp-tt-table td.fp-tt-lunch{
  background: #ffffff !important;
  color: #0f172a !important;
}
.fp-tt-table td.fp-tt-busy,
.fp-tt-table td.fp-tt-lab{
  background: #ffffff !important;
  color: #0f172a !important;
}
.fp-tt-table th.sp-current-slot-header,
.fp-tt-table td.sp-current-slot-header{
  background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%) !important;
  color: #ffffff !important;
}
.fp-tt-table td.sp-current-slot-cell{
  background: linear-gradient(180deg, #fff7ed 0%, #ffedd5 100%) !important;
  box-shadow: inset 0 0 0 3px #f97316;
}
.sp-current-slot-banner{
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.12) 0%, rgba(245, 158, 11, 0.18) 100%);
  border: 1px solid rgba(249, 115, 22, 0.28);
  color: #9a3412;
  font-size: 13px;
  font-weight: 700;
}
.sp-current-slot-banner--muted{
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #475569;
}
.fp-tt-row{
  display:grid;
  grid-template-columns: 140px 1fr;
  gap:10px;
  align-items:start;
  padding-top:10px;
  border-top:1px solid #eef2ff;
}
.fp-tt-row:first-child{
  border-top:none;
  padding-top:0;
}
.fp-tt-row-label{
  font-size:12px;
  font-weight:950;
  color:#334155;
}
.fp-tt-row-body{
  min-width:0;
}
.fp-tt-free{
  color:#64748b;
  font-weight:900;
  font-size:12px;
  padding:10px 12px;
  border-radius:14px;
  background:#f8fafc;
  border:1px solid #e2e8f0;
}
.fp-tt-lunch{
  color:#92400e;
  font-weight:900;
  font-size:12px;
  padding:10px 12px;
  border-radius:14px;
  background:#fff7ed;
  border:1px solid #fed7aa;
}

/* Slot card inside timetable list */
.fp-slot{
  background:rgba(30,58,138,0.04);
  border:1px solid rgba(30,58,138,0.12);
  border-radius:14px;
  padding:10px 12px;
}
.fp-slot-subject{font-size:13px}
.fp-slot-class{font-size:12px}
.fp-slot-room{font-size:12px}
.fp-slot-faculty{font-size:12px}

/* Results card styles (used by facultyPortal.js render) */
.fp-result-card{
  background:#fff;
  border:1px solid var(--fp-border);
  border-radius:var(--fp-radius);
  padding:16px 14px;
  box-shadow:0 14px 40px rgba(15,23,42,.08);
}
.fp-result-card h3{margin:0 0 10px 0}
.fp-result-card h4{
  margin:18px 0 10px;
  font-size:15px;
  color:#1e293b;
}
.fp-avail-badge{
  display:inline-block;
  padding:6px 10px;
  border-radius:999px;
  font-weight:900;
  font-size:12px;
  margin-top:6px;
}
.fp-avail-badge.available{background:rgba(16,185,129,.14);color:#065f46;border:1px solid rgba(16,185,129,.3)}
.fp-avail-badge.busy{background:rgba(239,68,68,.12);color:#7f1d1d;border:1px solid rgba(239,68,68,.25)}
.fp-avail-detail{margin-top:10px;color:#334155;font-size:13px;line-height:1.5}
.fp-class-metadata{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:10px;
}
.fp-class-metadata span{
  padding:6px 9px;
  border:1px solid #bfdbfe;
  border-radius:999px;
  background:#eff6ff;
  color:#1e3a8a;
  font-size:12px;
}

/* Clickable availability rows */
.fp-avail-item{
  width:100%;
  text-align:left;
  padding:10px 10px;
  border-radius:12px;
  border:1px solid #f1f5f9;
  background:#fff;
  cursor:pointer;
  font-size:13px;
  color:#0f172a;
}
.fp-avail-item:hover{
  background:#f8fafc;
}
.fp-avail-item + .fp-avail-item{
  margin-top:6px;
}
.fp-data-table-wrap{
  margin-top:12px;
  overflow:auto;
  border:1px solid var(--fp-border);
  border-radius:14px;
  background:#fff;
}
.fp-data-table{
  width:100%;
  border-collapse:collapse;
  min-width:560px;
}
.fp-data-table th,
.fp-data-table td{
  padding:10px 12px;
  border-bottom:1px solid #e2e8f0;
  text-align:left;
  font-size:13px;
  vertical-align:top;
}
.fp-data-table th{
  background:#f8fafc;
  font-weight:900;
  color:#0f172a;
}
.fp-data-table tr:last-child td{
  border-bottom:none;
}
.fp-class-strength-table{
  min-width:440px;
}
.fp-class-strength-table th,
.fp-class-strength-table td{
  padding:8px 10px;
  font-size:12px;
  vertical-align:middle;
}
.fp-class-strength-table th:nth-child(1){width:48%}
.fp-class-strength-table th:nth-child(2),
.fp-class-strength-table td:nth-child(2){
  width:88px;
  text-align:center;
  white-space:nowrap;
}
.fp-class-strength-table th:nth-child(3){width:32%}
.fp-workload-search-label{
  display:block;
  margin-top:16px;
  color:#334155;
  font-size:13px;
  font-weight:900;
}
.fp-workload-search{
  width:100%;
  margin-top:6px;
}
.fp-workload-search-status{
  margin-top:7px;
}
.fp-workload-row{
  cursor:pointer;
}
.fp-workload-row:hover,
.fp-workload-row:focus-visible{
  background:#eff6ff;
  outline:none;
}
.fp-directory-id,
.fp-directory-subtle{
  color:#64748b;
  font-size:12px;
}
.fp-directory-link{
  color:#1d4ed8;
  font-weight:700;
  word-break:break-word;
}
.fp-call-btn{
  display:inline-block;
  margin-left:6px;
  padding:3px 7px;
  border-radius:7px;
  background:#dcfce7;
  color:#166534;
  font-size:11px;
  font-weight:900;
  text-decoration:none;
}
.fp-workload-summary{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:10px;
  margin-top:12px;
}
.fp-workload-summary > div{
  padding:10px;
  border:1px solid #dbeafe;
  border-radius:12px;
  background:#f8fbff;
}
.fp-workload-summary span{
  display:block;
  color:#64748b;
  font-size:11px;
  font-weight:800;
}
.fp-workload-summary strong{
  display:block;
  margin-top:3px;
  color:#0f172a;
  font-size:19px;
}
.fp-workload-summary .fp-workload-summary-total{
  border-color:#86efac;
  background:#f0fdf4;
}
.fp-workload-summary-total strong{
  color:#166534;
}
.fp-modal-open{
  overflow:hidden;
}
.fp-modal-backdrop{
  position:fixed;
  inset:0;
  z-index:1000;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:18px;
  background:rgba(15,23,42,.58);
}
.fp-modal{
  width:min(920px, 100%);
  max-height:min(760px, calc(100vh - 36px));
  display:flex;
  flex-direction:column;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.6);
  border-radius:18px;
  background:#fff;
  box-shadow:0 24px 70px rgba(15,23,42,.35);
}
.fp-modal-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:16px 18px;
  border-bottom:1px solid var(--fp-border);
}
.fp-modal-head h3{
  margin:0;
  color:#0f172a;
  font-size:18px;
}
.fp-modal-close{
  flex:0 0 auto;
  border:1px solid #cbd5e1;
  border-radius:9px;
  padding:7px 10px;
  background:#f8fafc;
  color:#0f172a;
  font:inherit;
  font-size:13px;
  font-weight:900;
  cursor:pointer;
}
.fp-modal-close:hover,
.fp-modal-close:focus-visible{
  border-color:var(--fp-primary);
  color:var(--fp-primary);
  outline:none;
}
.fp-modal-body{
  overflow:auto;
  padding:4px 18px 18px;
}
@media (max-width:420px){
  .fp-workload-summary{
    grid-template-columns:1fr;
  }
}
.fp-chip-list{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-top:8px;
}
.fp-chip{
  display:inline-flex;
  align-items:center;
  padding:5px 9px;
  border-radius:999px;
  background:#eff6ff;
  color:#1e3a8a;
  font-size:12px;
  font-weight:800;
}

/* Timetable */
.fp-tt-back{
  border:none;
  background:transparent;
  color:var(--fp-primary);
  font-weight:900;
  cursor:pointer;
  margin-bottom:10px;
}
.fp-tt-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}
.fp-tt-controls{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.fp-tt-title{
  margin:0;
  font-size:16px;
  font-weight:950;
}
.sp-class-coordinator{
  margin-top:4px;
  color:#475569;
  font-size:13px;
  font-weight:600;
}
.fp-zoom-controls{
  display:flex;
  align-items:center;
  gap:8px;
  padding:6px 8px;
  border:1px solid var(--fp-border);
  border-radius:12px;
  background:#fff;
}
.fp-zoom-btn{
  border:1px solid #cbd5e1;
  background:#f8fafc;
  color:#0f172a;
  border-radius:10px;
  min-width:38px;
  padding:8px 10px;
  font-size:13px;
  font-weight:900;
  cursor:pointer;
}
.fp-zoom-btn:disabled{
  opacity:.45;
  cursor:not-allowed;
}
.fp-class-summary-btn{
  border:1px solid #1d4ed8;
  border-radius:10px;
  padding:7px 11px;
  background:#1d4ed8;
  color:#ffffff;
  font:inherit;
  font-size:13px;
  font-weight:900;
  cursor:pointer;
}
.fp-class-summary-btn:hover,
.fp-class-summary-btn:focus-visible{
  background:#1e40af;
  outline:2px solid #93c5fd;
  outline-offset:2px;
}
.fp-zoom-value{
  min-width:48px;
  text-align:center;
  font-size:12px;
  font-weight:900;
  color:#334155;
}
.fp-orientation-toggle{
  display:flex;
  align-items:center;
  gap:8px;
  font-size:13px;
  font-weight:800;
  color:#334155;
  user-select:none;
}
.fp-timetable-wrap{
  margin-top:10px;
  overflow:auto;
  border-radius:14px;
  border:1px solid var(--fp-border);
  background:#fff;
}
.fp-timetable{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  min-width:640px;
  table-layout:fixed;
}
.fp-timetable th,
.fp-timetable td{
  padding:10px 8px;
  border-bottom:1px solid #eef2ff;
  border-right:1px solid #eef2ff;
  vertical-align:top;
  font-size:12px;
  word-break:break-word;
}
.fp-timetable th{
  position:sticky;
  top:0;
  background:#f8fafc;
  font-weight:950;
  z-index:1;
}
.fp-day-cell{
  font-weight:950;
  background:#fbfdff;
  white-space:nowrap;
}
.fp-lunch-cell{
  text-align:center;
  color:#64748b;
  font-weight:900;
  background:#fff7ed;
}
.fp-free-cell{
  color:#64748b;
  font-weight:800;
}
.fp-slot-subject{font-weight:600;color:#0f172a}
.fp-slot-class{margin-top:3px;color:#0f766e;font-weight:500}
.fp-slot-room{margin-top:3px;color:#c2410c;font-weight:500}
.fp-slot-faculty{margin-top:3px;color:#6d28d9;font-weight:500}

.fp-tt-table-wrap.fp-tt-zoom-out .fp-tt-table{
  min-width:700px;
}
.fp-tt-table-wrap.fp-tt-zoom-out .fp-tt-table th,
.fp-tt-table-wrap.fp-tt-zoom-out .fp-tt-table td{
  padding:8px 6px;
}
.fp-tt-table-wrap.fp-tt-zoom-out .fp-tt-cell,
.fp-tt-table-wrap.fp-tt-zoom-out .fp-tt-line{
  font-size:11px;
}
.fp-tt-table-wrap.fp-tt-zoom-out .fp-tt-day{
  width:70px;
  font-size:13px;
}

.fp-tt-table-wrap.fp-tt-zoom-normal .fp-tt-table{
  min-width:820px;
}

.fp-tt-table-wrap.fp-tt-zoom-in .fp-tt-table{
  min-width:980px;
}
.fp-tt-table-wrap.fp-tt-zoom-in .fp-tt-table th,
.fp-tt-table-wrap.fp-tt-zoom-in .fp-tt-table td{
  padding:12px 9px;
}
.fp-tt-table-wrap.fp-tt-zoom-in .fp-tt-cell,
.fp-tt-table-wrap.fp-tt-zoom-in .fp-tt-line{
  font-size:13px;
}
.fp-tt-table-wrap.fp-tt-zoom-in .fp-tt-day{
  width:92px;
  font-size:15px;
}

.fp-tt-table-wrap.fp-tt-zoom-in-2 .fp-tt-table{
  min-width:1120px;
}
.fp-tt-table-wrap.fp-tt-zoom-in-2 .fp-tt-table th,
.fp-tt-table-wrap.fp-tt-zoom-in-2 .fp-tt-table td{
  padding:14px 10px;
}
.fp-tt-table-wrap.fp-tt-zoom-in-2 .fp-tt-cell,
.fp-tt-table-wrap.fp-tt-zoom-in-2 .fp-tt-line{
  font-size:14px;
}
.fp-tt-table-wrap.fp-tt-zoom-in-2 .fp-tt-day{
  width:104px;
  font-size:16px;
}

.fp-inst-list{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.fp-inst-item{
  width:100%;
  text-align:left;
  border:1px solid var(--fp-border);
  background:#fff;
  border-radius:14px;
  padding:14px 14px;
  cursor:pointer;
  font-weight:900;
}
.fp-inst-item small{
  display:block;
  margin-top:4px;
  color:var(--fp-muted);
  font-weight:700;
}

.fp-footer {
  margin-top: auto;
  padding: 32px 0 20px;
  text-align: center;
}

#fpMobileNav,
.fp-mobile-more-sheet,
.fp-mobile-anchor {
  display:none;
}

@media (max-width: 767px) {
  body{
    padding-bottom:78px;
    background:#f4f7fb;
  }
  .fp-shell{
    justify-content:flex-start;
    padding:0 10px calc(14px + env(safe-area-inset-bottom));
  }
  body.faculty-portal-mode .atos-install-banner{
    bottom:calc(82px + env(safe-area-inset-bottom));
  }
  .fp-page{
    width:100%;
  }
  .fp-header{
    margin:0 -10px 12px;
    padding:calc(15px + env(safe-area-inset-top)) 16px 15px;
    border-radius:0 0 18px 18px;
    background:#173a7a;
    box-shadow:0 6px 18px rgba(23,58,122,.22);
    text-align:left;
  }
  .fp-app-title{
    margin-bottom:5px;
    color:#fbbf24;
    font-size:10px;
  }
  .fp-h1{
    color:#fff;
    font-size:23px;
    line-height:1.2;
  }
  .fp-h2{
    margin-top:5px;
    color:#dbeafe;
    font-size:15px;
  }
  .fp-h3{
    margin-top:6px;
    color:#bfdbfe;
    font-size:12px;
  }
  .fp-user{
    justify-content:flex-start;
    margin-top:9px;
    color:#dbeafe;
    font-size:11px;
  }
  .fp-link{
    padding:4px 7px;
    border:1px solid rgba(255,255,255,.22);
    color:#fff;
    font-size:11px;
  }
  .fp-form{
    margin-top:0;
    padding:15px 13px;
    border-radius:16px;
    box-shadow:0 4px 14px rgba(15,23,42,.06);
  }
  .fp-form .fp-label{
    margin-top:12px;
    margin-bottom:6px;
    font-size:13px;
  }
  .fp-form-section-title{
    color:#1e3a8a;
  }
  .fp-select{
    padding:12px;
    border-radius:11px;
    font-size:14px;
  }
  .fp-search-input{
    margin-bottom:7px;
  }
  .fp-btn{
    padding:12px;
    border-radius:11px;
    font-size:14px;
  }
  .fp-inline-actions{
    gap:7px;
    margin-bottom:5px;
  }
  .fp-mini-btn{
    min-height:36px;
    padding:8px;
    border-radius:10px;
    font-size:11px;
  }
  .fp-mobile-anchor{
    display:block;
    scroll-margin-top:12px;
  }
  body.faculty-portal-mode #fpMobileNav{
    position:fixed;
    right:0;
    bottom:0;
    left:0;
    z-index:1000;
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    min-height:68px;
    padding:5px 4px calc(5px + env(safe-area-inset-bottom));
    border-top:1px solid #dbe4f0;
    background:rgba(255,255,255,.97);
    box-shadow:0 -8px 24px rgba(15,23,42,.1);
    backdrop-filter:blur(12px);
    -webkit-backdrop-filter:blur(12px);
  }
  #fpMobileNav button{
    display:flex;
    min-width:0;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:2px;
    padding:5px 2px;
    border:0;
    background:transparent;
    color:#64748b;
    font:inherit;
    font-size:10px;
    font-weight:800;
    cursor:pointer;
  }
  #fpMobileNav button > span:first-child{
    height:23px;
    color:#334155;
    font-size:21px;
    font-weight:900;
    line-height:1;
  }
  #fpMobileNav button.active,
  #fpMobileNav button.active > span:first-child{
    color:#2563eb;
  }
  .fp-footer{
    padding:20px 0 8px;
  }
  .fp-mobile-more-sheet.active{
    position:fixed;
    inset:0;
    z-index:1100;
    display:block;
  }
  .fp-mobile-more-backdrop{
    position:absolute;
    inset:0;
    width:100%;
    border:0;
    background:rgba(15,23,42,.5);
  }
  .fp-mobile-more-panel{
    position:absolute;
    right:0;
    bottom:0;
    left:0;
    padding:8px 16px calc(18px + env(safe-area-inset-bottom));
    border-radius:20px 20px 0 0;
    background:#fff;
    box-shadow:0 -12px 32px rgba(15,23,42,.2);
  }
  .fp-mobile-more-handle{
    width:42px;
    height:4px;
    margin:0 auto 10px;
    border-radius:999px;
    background:#cbd5e1;
  }
  .fp-mobile-more-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    margin-bottom:10px;
  }
  .fp-mobile-more-head h2{
    margin:0;
    color:#0f172a;
    font-size:17px;
  }
  .fp-mobile-more-head button{
    border:0;
    background:transparent;
    color:#2563eb;
    font:inherit;
    font-size:13px;
    font-weight:800;
    cursor:pointer;
  }
  .fp-mobile-more-action{
    display:block;
    width:100%;
    margin-top:8px;
    padding:13px 14px;
    border:1px solid #dbe4f0;
    border-radius:12px;
    background:#f8fafc;
    color:#0f172a;
    font:inherit;
    font-size:14px;
    font-weight:800;
    text-align:left;
    text-decoration:none;
    cursor:pointer;
  }
  .fp-mobile-more-danger{
    border-color:#fecaca;
    background:#fff1f2;
    color:#b91c1c;
  }
}

.fp-admin-link {
  display: inline-block;
  color: var(--fp-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 10px;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.fp-admin-link:hover {
  color: var(--fp-primary);
  background: rgba(30, 58, 138, 0.05);
  border-color: var(--fp-border);
}

.fp-attribution {
  margin-top: 12px;
  font-size: 13px;
  color: var(--fp-muted);
  font-weight: 500;
}

.fp-attribution strong {
  color: var(--fp-primary);
  font-weight: 700;
}

@media (min-width: 980px){
  .fp-shell{
    align-items:stretch;
    justify-content:flex-start;
    padding:36px 40px 28px;
  }

  .fp-page{
    width:min(1380px,100%);
  }

  .fp-header{
    text-align:left;
    padding:0 4px 20px;
    margin-bottom:18px;
    display:grid;
    grid-template-columns:minmax(0, 1fr) auto;
    gap:12px 20px;
    align-items:end;
  }

  .fp-app-title,
  .fp-h1,
  .fp-h2,
  .fp-h3{
    grid-column:1;
  }

  .fp-app-title{
    font-size:13px;
    margin-bottom:0;
  }

  .fp-h1{
    font-size:42px;
  }

  .fp-h2{
    margin-top:0;
    font-size:24px;
  }

  .fp-h3{
    margin-top:0;
    font-size:15px;
  }

  .fp-user{
    grid-column:2;
    grid-row:1 / span 4;
    margin-top:0;
    justify-content:flex-end;
    align-self:start;
    text-align:right;
    max-width:320px;
  }

  .fp-desktop-layout{
    display:grid;
    grid-template-columns:minmax(320px, 380px) minmax(0, 1fr);
    gap:24px;
    align-items:start;
  }

  .fp-desktop-sidebar{
    position:sticky;
    top:24px;
  }

  .fp-form{
    padding:22px 20px;
  }

  .fp-form .fp-label{
    margin-top:16px;
    margin-bottom:8px;
    font-size:14px;
  }

  .fp-select{
    font-size:16px;
    padding:14px 15px;
  }

  .fp-btn{
    font-size:16px;
    padding:14px 14px;
  }

  .fp-btn + .fp-btn{
    margin-top:0;
  }

  .fp-results{
    margin-top:0;
  }

  .fp-desktop-content{
    display:flex;
    flex-direction:column;
    gap:18px;
  }

  .fp-result-card{
    padding:20px 20px;
  }

  .fp-tt-head{
    align-items:flex-start;
  }

  .fp-tt-controls{
    gap:12px;
  }

  .fp-tt-title{
    font-size:20px;
  }

  .fp-tt-table-wrap{
    border-radius:20px;
  }

  .fp-tt-table{
    min-width:1040px;
  }

  .fp-tt-table th,
  .fp-tt-table td{
    padding:14px 10px;
  }

  .fp-tt-day{
    width:110px;
    font-size:15px;
  }

  .fp-tt-cell,
  .fp-tt-line{
    font-size:13px;
  }

  .fp-footer{
    width:min(1380px,100%);
    margin:24px auto 0;
    padding:24px 4px 10px;
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:16px;
    text-align:left;
  }

  .fp-attribution{
    margin-top:0;
  }
}

@media (max-width:480px){
  .fp-shell{
    padding:
      calc(10px + env(safe-area-inset-top))
      calc(10px + env(safe-area-inset-right))
      calc(14px + env(safe-area-inset-bottom))
      calc(10px + env(safe-area-inset-left));
  }
  .fp-title{font-size:26px}
  .fp-subtitle{font-size:18px}
  .fp-h1{font-size:26px}
  .fp-h2{font-size:18px}
  .fp-h3{font-size:14px}
  .fp-btn{font-size:16px;padding:14px 12px}
  .fp-select{font-size:16px;padding:14px 12px}
  .fp-card{padding:20px 16px; border-radius: 16px;}
  .fp-form{padding:14px 12px}
  .fp-tt-table{min-width: 700px}
  .fp-tt-table th, .fp-tt-table td { padding: 8px 4px; font-size: 11px; }
  .fp-tt-day { width: 60px; font-size: 12px; }
  .fp-tt-line { font-size: 11px; }
  .fp-tt-group { padding: 1px 6px; font-size: 10px; }
  .fp-tt-back { font-size: 14px; }
  .fp-tt-head { display:block; }
  .fp-tt-controls {
    display:grid;
    grid-template-columns:minmax(0, 1fr) auto;
    width:100%;
    margin-top:12px;
    gap:10px;
    align-items:center;
  }
  .fp-zoom-controls {
    grid-column:1 / -1;
    justify-content:center;
  }
  .fp-orientation-toggle { justify-self:start; }
  .fp-class-summary-btn {
    justify-self:end;
    min-height:38px;
    padding:8px 10px;
  }
  .fp-footer { padding: 24px 0 16px; }
}

/* Landscape: keep single-column layout (no side-by-side). */
@media (orientation: landscape) and (max-height: 520px){
  .fp-page{width:min(560px,100%)}
  .fp-card{margin-top:14px}
  .fp-form{display:block}
}

