/* ==========================================================================
   AUST Quiz Preparation Roadmap & Timeline
   Apple iOS Human Interface Design (HIG) Edition
   Includes: iOS Dark/Light Themes, Spring Physics Animations, Inset Cards
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. iOS Design Tokens & Themes
   -------------------------------------------------------------------------- */
:root {
  /* Common Apple SF Font Stack */
  --ios-font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Inter, sans-serif;
  --ios-font-mono: SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Standard Apple Radii */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;
  --radius-full: 9999px;

  /* Apple Spring Animation Curves */
  --spring-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --spring-smooth: cubic-bezier(0.25, 1, 0.5, 1);
  --apple-sheet: cubic-bezier(0.32, 0.72, 0, 1);
  --ios-touch-trans: transform 0.12s cubic-bezier(0.2, 0, 0, 1), background-color 0.2s ease;
}

/* iOS Light Theme (System Grouped) */
body.ios-theme-light {
  --ios-bg: #f2f2f7;
  --ios-card-bg: #ffffff;
  --ios-card-subtle: #f9f9fb;
  --ios-glass-nav: rgba(242, 242, 247, 0.82);
  --ios-glass-card: rgba(255, 255, 255, 0.88);
  --ios-modal-bg: #ffffff;
  --ios-sheet-bg: #f2f2f7;

  --ios-label: #000000;
  --ios-secondary-label: #3c3c43;
  --ios-tertiary-label: #8e8e93;
  --ios-quaternary-label: #c7c7cc;

  --ios-separator: rgba(60, 60, 67, 0.12);
  --ios-separator-opaque: #e5e5ea;

  /* iOS Accent Colors */
  --ios-blue: #007aff;
  --ios-blue-rgb: 0, 122, 255;
  --ios-blue-light: #e5f1ff;

  --ios-green: #34c759;
  --ios-green-rgb: 52, 199, 89;
  --ios-green-light: #eafaf0;

  --ios-orange: #ff9500;
  --ios-orange-rgb: 255, 149, 0;
  --ios-orange-light: #fff6e5;

  --ios-red: #ff3b30;
  --ios-red-rgb: 255, 59, 48;
  --ios-red-light: #ffebe9;

  --ios-purple: #af52de;
  --ios-purple-light: #f6eafc;

  --ios-teal: #5ac8fa;
  --ios-teal-light: #eef9ff;

  --ios-segmented-bg: rgba(118, 118, 128, 0.12);
  --ios-segmented-glider: #ffffff;
  --ios-segmented-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.08);

  --ios-card-shadow: 0 2px 8px rgba(0, 0, 0, 0.04), 0 0.5px 1px rgba(0, 0, 0, 0.06);
  --ios-sheet-shadow: 0 -10px 40px rgba(0, 0, 0, 0.16);

  --ios-ambient-1: rgba(0, 122, 255, 0.08);
  --ios-ambient-2: rgba(52, 199, 89, 0.06);
}

/* iOS Dark Theme */
body.ios-theme-dark {
  --ios-bg: #000000;
  --ios-card-bg: #1c1c1e;
  --ios-card-subtle: #161618;
  --ios-glass-nav: rgba(28, 28, 30, 0.84);
  --ios-glass-card: rgba(28, 28, 30, 0.9);
  --ios-modal-bg: #1c1c1e;
  --ios-sheet-bg: #151517;

  --ios-label: #ffffff;
  --ios-secondary-label: #ebebf5;
  --ios-tertiary-label: #8e8e93;
  --ios-quaternary-label: #48484a;

  --ios-separator: rgba(235, 235, 245, 0.14);
  --ios-separator-opaque: #2c2c2e;

  /* Apple Dark Mode Dynamic Colors */
  --ios-blue: #0a84ff;
  --ios-blue-rgb: 10, 132, 255;
  --ios-blue-light: rgba(10, 132, 255, 0.18);

  --ios-green: #30d158;
  --ios-green-rgb: 48, 209, 88;
  --ios-green-light: rgba(48, 209, 88, 0.18);

  --ios-orange: #ff9f0a;
  --ios-orange-rgb: 255, 159, 10;
  --ios-orange-light: rgba(255, 159, 10, 0.18);

  --ios-red: #ff453a;
  --ios-red-rgb: 255, 69, 58;
  --ios-red-light: rgba(255, 69, 58, 0.2);

  --ios-purple: #bf5af2;
  --ios-purple-light: rgba(191, 90, 242, 0.18);

  --ios-teal: #64d2ff;
  --ios-teal-light: rgba(100, 210, 255, 0.18);

  --ios-segmented-bg: rgba(118, 118, 128, 0.24);
  --ios-segmented-glider: #636366;
  --ios-segmented-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);

  --ios-card-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
  --ios-sheet-shadow: 0 -10px 50px rgba(0, 0, 0, 0.7);

  --ios-ambient-1: rgba(10, 132, 255, 0.12);
  --ios-ambient-2: rgba(48, 209, 88, 0.08);
}

/* --------------------------------------------------------------------------
   2. Reset & Typography
   -------------------------------------------------------------------------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  scrollbar-width: none !important; /* Firefox */
  -ms-overflow-style: none !important; /* IE and Edge */
}

/* Hide scrollbars universally for Chrome, Safari, Opera & Mobile */
*::-webkit-scrollbar,
html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  background: transparent !important;
}

html, body {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

body {
  font-family: var(--ios-font);
  background-color: var(--ios-bg);
  color: var(--ios-label);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Decorative iOS Glows */
.ios-ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  transition: all 0.5s ease;
}

.glow-1 {
  top: -120px;
  right: -80px;
  width: 360px;
  height: 360px;
  background: var(--ios-ambient-1);
}

.glow-2 {
  bottom: -100px;
  left: -80px;
  width: 320px;
  height: 320px;
  background: var(--ios-ambient-2);
}

.hidden {
  display: none !important;
}

/* App Container - Full Screen Expansion */
.ios-app-container {
  width: 96%;
  max-width: 1760px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 4rem 1.5rem;
  position: relative;
  z-index: 1;
}

/* --------------------------------------------------------------------------
   3. iOS Frosted Navigation Bar
   -------------------------------------------------------------------------- */
.ios-nav-bar {
  position: sticky;
  top: 1rem;
  z-index: 50;
  background: var(--ios-glass-nav);
  backdrop-filter: blur(25px) saturate(190%);
  -webkit-backdrop-filter: blur(25px) saturate(190%);
  border: 0.5px solid var(--ios-separator);
  border-radius: var(--radius-xl);
  padding: 0.75rem 1.25rem;
  box-shadow: var(--ios-card-shadow);
  margin-bottom: 1.75rem;
  transition: all 0.3s var(--spring-smooth);
}

.ios-nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.ios-nav-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

/* Official AUST Logo Frame */
.ios-aust-logo-frame {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: transparent;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
  border: 0.5px solid rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
  transition: transform 0.2s var(--spring-bounce);
  overflow: hidden;
}

.ios-aust-logo-frame:hover {
  transform: scale(1.06);
}

.ios-aust-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
}

body.ios-theme-dark .ios-aust-logo-frame {
  background: transparent;
  padding: 0;
  border: 0.5px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}

.ios-app-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: linear-gradient(145deg, var(--ios-blue), #5856d6);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(var(--ios-blue-rgb), 0.35);
  flex-shrink: 0;
  transition: transform 0.2s var(--spring-bounce);
}

.ios-app-icon:hover {
  transform: scale(1.05);
}

.ios-nav-meta {
  display: flex;
  flex-direction: column;
}

.ios-subhead {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ios-blue);
}

.ios-nav-date {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ios-label);
}

.ios-nav-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* iOS Pill Button (Theme Switch) */
.ios-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--ios-card-bg);
  border: 0.5px solid var(--ios-separator);
  color: var(--ios-label);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: var(--ios-touch-trans);
}

.ios-pill-btn:active {
  transform: scale(0.95);
  background: var(--ios-card-subtle);
}

.sync-pill {
  gap: 0.45rem;
}

.reload-btn-top {
  padding: 0.45rem 0.55rem;
  min-width: 36px;
  height: 36px;
  justify-content: center;
}

.sync-dot-indicator {
  width: 7px;
  height: 7px;
  min-width: 7px;
  min-height: 7px;
  aspect-ratio: 1 / 1;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--ios-tertiary-label);
  transition: all 0.25s ease;
}

.sync-dot-indicator.active {
  background: var(--ios-green);
  box-shadow: 0 0 8px rgba(52, 199, 89, 0.8);
}

.sync-dot-indicator.loading {
  background: var(--ios-orange);
  animation: iosPulse 1s infinite alternate;
}

.ios-sync-status-box {
  background: var(--ios-card-subtle);
  border: 1px solid var(--ios-separator);
}

.ios-sync-status-box.success {
  background: var(--ios-green-light);
  color: var(--ios-green);
  border-color: rgba(52, 199, 89, 0.3);
}

.ios-sync-status-box.error {
  background: var(--ios-red-light);
  color: var(--ios-red);
  border-color: rgba(255, 59, 48, 0.3);
}

.classroom-source-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: #e6f4ea;
  color: #137333;
  text-decoration: none;
  border: 0.5px solid rgba(19, 115, 51, 0.25);
  transition: background 0.15s ease;
}

.classroom-source-tag:hover {
  background: #ceead6;
}

.ios-theme-icon-box {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ios-blue);
}

/* iOS Primary Action Button */
.ios-primary-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--ios-blue);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-full);
  padding: 0.5rem 1.15rem;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(var(--ios-blue-rgb), 0.35);
  transition: var(--ios-touch-trans);
}

.ios-primary-btn:hover {
  filter: brightness(1.05);
}

.ios-primary-btn:active {
  transform: scale(0.95);
}

/* --------------------------------------------------------------------------
   4. iOS Large Title Header
   -------------------------------------------------------------------------- */
.ios-header-section {
  margin-bottom: 1.5rem;
  padding: 0 0.25rem;
}

.ios-dept-badge-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
  flex-wrap: wrap;
}

.ios-aust-crest-small {
  width: 20px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ios-aust-crest-small img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.aust-crest-dark {
  display: none !important;
}

.aust-crest-light {
  display: block !important;
}

body.ios-theme-dark .aust-crest-dark {
  display: block !important;
}

body.ios-theme-dark .aust-crest-light {
  display: none !important;
}

.ios-dept-tag {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ios-tertiary-label);
}

.ios-dept-badge {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: var(--ios-blue-light);
  color: var(--ios-blue);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.sem-sec-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  background: var(--ios-card-subtle);
  border: 0.5px solid var(--ios-separator);
  color: var(--ios-secondary-label);
  white-space: nowrap;
}

.ios-select-input {
  flex: 1;
  width: 100%;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--ios-label);
  outline: none;
  cursor: pointer;
}

.ios-large-title {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.035em;
  color: var(--ios-label);
  line-height: 1.15;
  margin-bottom: 0.25rem;
}

.ios-large-subtitle {
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--ios-tertiary-label);
  max-width: 600px;
}

/* --------------------------------------------------------------------------
   5. iOS Alert Banner (Minimal Warning Type & Apple Spring Physics)
   -------------------------------------------------------------------------- */
.ios-alert-banner {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: linear-gradient(90deg, rgba(255, 149, 0, 0.07) 0%, rgba(255, 255, 255, 0.98) 24%);
  border: 1px solid rgba(255, 149, 0, 0.26);
  border-left: 4px solid var(--ios-orange);
  border-radius: var(--radius-md);
  padding: 0.65rem 1rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 16px rgba(255, 149, 0, 0.09), var(--ios-card-shadow);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: iosAlertSpringIn 0.55s var(--spring-bounce) forwards,
             iosWarningGlow 4s ease-in-out infinite alternate;
  transition: transform 0.2s cubic-bezier(0.25, 1, 0.5, 1),
              box-shadow 0.25s ease;
  position: relative;
  overflow: hidden;
}

body.ios-theme-dark .ios-alert-banner {
  background: linear-gradient(90deg, rgba(255, 159, 10, 0.14) 0%, rgba(28, 28, 30, 0.98) 24%);
  border-color: rgba(255, 159, 10, 0.32);
  border-left-color: var(--ios-orange);
  box-shadow: 0 4px 20px rgba(255, 159, 10, 0.15), 0 1px 2px rgba(0, 0, 0, 0.4);
}

.ios-alert-banner:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255, 149, 0, 0.18), var(--ios-card-shadow);
}

body.ios-theme-dark .ios-alert-banner:hover {
  box-shadow: 0 8px 28px rgba(255, 159, 10, 0.24), 0 2px 6px rgba(0, 0, 0, 0.5);
}

/* Warning Icon Wrap */
.ios-alert-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: rgba(255, 149, 0, 0.14);
  color: var(--ios-orange);
  flex-shrink: 0;
  position: relative;
  animation: iosWarningIconShake 5s infinite ease-in-out;
}

body.ios-theme-dark .ios-alert-icon-wrap {
  background: rgba(255, 159, 10, 0.22);
}

.ios-warning-icon {
  width: 17px;
  height: 17px;
  display: block;
  stroke: var(--ios-orange);
}

/* Alert Body: structured 2-tier layout */
.ios-alert-body {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  flex: 1;
  min-width: 0;
}

/* Row 1: Course + Quiz pill on left, Countdown badge on right */
.ios-alert-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
}

.ios-alert-header-left {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  flex-wrap: nowrap;
}

.ios-alert-course {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--ios-label);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.ios-alert-quiz-badge {
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(255, 149, 0, 0.12);
  color: var(--ios-orange);
  padding: 1px 7px;
  border-radius: var(--radius-xs);
  border: 0.5px solid rgba(255, 149, 0, 0.25);
  white-space: nowrap;
}

body.ios-theme-dark .ios-alert-quiz-badge {
  background: rgba(255, 159, 10, 0.2);
  border-color: rgba(255, 159, 10, 0.35);
}

.ios-alert-sec-badge {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--ios-tertiary-label);
  white-space: nowrap;
}

/* Row 2: Clean Topic title (truncated) + date */
.ios-alert-row-sub {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--ios-secondary-label);
  min-width: 0;
  white-space: nowrap;
}

.ios-alert-topic {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
  color: var(--ios-secondary-label);
  flex-shrink: 1;
  min-width: 0;
}

.ios-alert-date-part {
  color: var(--ios-tertiary-label);
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Status Badge with Live Radar Pulse */
.ios-alert-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: auto;
}

.ios-alert-badge.badge-warning {
  background: var(--ios-orange);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(255, 149, 0, 0.35);
}

.ios-alert-badge.badge-critical {
  background: var(--ios-red);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(255, 59, 48, 0.4);
}

/* Radar pulse dot inside badge */
.ios-live-radar {
  width: 6px;
  height: 6px;
  min-width: 6px;
  min-height: 6px;
  border-radius: 50%;
  background: #ffffff;
  position: relative;
  flex-shrink: 0;
}

.ios-live-radar::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: inherit;
  transform: translate(-50%, -50%);
  animation: iosRadarRing 1.6s ease-out infinite;
}

/* Keyframe Animations */
@keyframes iosAlertSpringIn {
  0% {
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
  }
  60% {
    opacity: 1;
    transform: translateY(2px) scale(1.005);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes iosWarningGlow {
  0% {
    border-color: rgba(255, 149, 0, 0.24);
    box-shadow: 0 3px 12px rgba(255, 149, 0, 0.08);
  }
  100% {
    border-color: rgba(255, 149, 0, 0.42);
    box-shadow: 0 5px 20px rgba(255, 149, 0, 0.18);
  }
}

@keyframes iosWarningIconShake {
  0%, 82%, 100% {
    transform: scale(1) rotate(0deg);
  }
  86% {
    transform: scale(1.15) rotate(-8deg);
  }
  90% {
    transform: scale(1.15) rotate(8deg);
  }
  94% {
    transform: scale(1.1) rotate(-4deg);
  }
  97% {
    transform: scale(1.05) rotate(2deg);
  }
}

@keyframes iosRadarRing {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.8;
  }
  100% {
    transform: translate(-50%, -50%) scale(3.2);
    opacity: 0;
  }
}

/* --------------------------------------------------------------------------
   6. iOS Inset Grouped Stat Widgets
   -------------------------------------------------------------------------- */
.ios-widgets-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.ios-widget {
  background: var(--ios-card-bg);
  border: 0.5px solid var(--ios-separator);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--ios-card-shadow);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: var(--ios-touch-trans), box-shadow 0.2s ease;
  cursor: default;
}

.ios-widget:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.ios-widget:active {
  transform: scale(0.98);
}

.ios-widget-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

.ios-widget-icon-bg {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  flex-shrink: 0;
}

.bg-blue {
  background: linear-gradient(135deg, var(--ios-blue), #2563eb);
}

.bg-green {
  background: linear-gradient(135deg, var(--ios-green), #059669);
}

.bg-orange {
  background: linear-gradient(135deg, var(--ios-orange), #ea580c);
}

.ios-widget-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ios-tertiary-label);
}

.ios-widget-num {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--ios-label);
  margin-bottom: 0.35rem;
}

.ios-widget-caption {
  font-size: 0.8rem;
  color: var(--ios-tertiary-label);
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   7. iOS Controls: Search & Segmented Control
   -------------------------------------------------------------------------- */
.ios-control-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

/* iOS Search Bar */
.ios-search-bar {
  position: relative;
  width: 100%;
}

.ios-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ios-tertiary-label);
  pointer-events: none;
}

.ios-search-bar input {
  width: 100%;
  background: var(--ios-card-bg);
  border: 0.5px solid var(--ios-separator);
  border-radius: var(--radius-md);
  padding: 0.7rem 2.4rem 0.7rem 2.6rem;
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--ios-label);
  outline: none;
  box-shadow: var(--ios-card-shadow);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ios-search-bar input:focus {
  border-color: var(--ios-blue);
  box-shadow: 0 0 0 3px rgba(var(--ios-blue-rgb), 0.2);
}

.ios-search-bar input::placeholder {
  color: var(--ios-tertiary-label);
}

.ios-clear-search {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--ios-quaternary-label);
  border: none;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  color: var(--ios-card-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  cursor: pointer;
  line-height: 1;
}

/* iOS Filter Bar & Segmented Control */
.ios-filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Authentic iOS Segmented Tab */
.ios-segmented-control {
  display: inline-flex;
  position: relative;
  background: var(--ios-segmented-bg);
  padding: 3px;
  border-radius: var(--radius-sm);
  user-select: none;
}

.ios-segment {
  position: relative;
  z-index: 2;
  background: transparent;
  border: none;
  padding: 0.42rem 1.1rem;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ios-secondary-label);
  border-radius: calc(var(--radius-sm) - 2px);
  cursor: pointer;
  transition: color 0.18s ease, transform 0.12s var(--spring-smooth);
  white-space: nowrap;
}

.ios-segment:active {
  transform: scale(0.96);
}

.ios-segment.active {
  color: var(--ios-label);
  background: var(--ios-segmented-glider);
  box-shadow: var(--ios-segmented-shadow);
}

/* Filter Toggle Button */
.ios-filter-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--ios-card-bg);
  border: 0.5px solid var(--ios-separator);
  color: var(--ios-secondary-label);
  padding: 0.42rem 0.95rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.ios-filter-toggle-btn:hover {
  background: var(--ios-card-subtle);
  color: var(--ios-label);
  border-color: var(--ios-quaternary-label);
}

.ios-filter-toggle-btn:active {
  transform: scale(0.96);
}

.ios-filter-toggle-btn.active {
  background: var(--ios-blue-light);
  color: var(--ios-blue);
  border-color: rgba(0, 122, 255, 0.35);
}

.ios-filter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: var(--radius-full);
  background: var(--ios-blue);
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
}

/* Quick Assessment Type Filter Chips Track */
.ios-type-chips-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin: 0.45rem 0 0.15rem 0;
  padding: 2px 0 3px 0;
}

.ios-type-chips-container::-webkit-scrollbar {
  display: none;
}

.ios-type-chips-track {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: max-content;
}

/* Quick Course Filter Chips Track (Momentum Scroll) */
.ios-course-chips-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin: 0.2rem 0 0.1rem 0;
  padding: 2px 0 4px 0;
}

.ios-course-chips-container::-webkit-scrollbar {
  display: none;
}

.ios-course-chips-track {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: max-content;
}

.ios-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--ios-card-bg);
  border: 0.5px solid var(--ios-separator);
  color: var(--ios-secondary-label);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  font-family: inherit;
  font-size: 0.79rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.ios-chip:hover {
  background: var(--ios-card-subtle);
  color: var(--ios-label);
  border-color: var(--ios-quaternary-label);
}

.ios-chip:active {
  transform: scale(0.94);
}

.ios-chip.active {
  background: var(--ios-blue);
  color: #ffffff;
  border-color: var(--ios-blue);
  box-shadow: 0 2px 8px rgba(0, 122, 255, 0.35);
}

.ios-chip-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: var(--radius-full);
  background: var(--ios-card-subtle);
  color: var(--ios-secondary-label);
  margin-left: 0.25rem;
  font-weight: 700;
  transition: all 0.2s ease;
}

.ios-chip.active .ios-chip-count {
  background: rgba(255, 255, 255, 0.26);
  color: #ffffff;
}

/* Collapsible Secondary Filter Drawer */
.ios-filter-drawer {
  width: 100%;
  overflow: hidden;
  transition: max-height 0.32s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.25s ease, margin 0.25s ease;
  max-height: 500px;
  opacity: 1;
  margin-top: 0.5rem;
}

.ios-filter-drawer.hidden {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  pointer-events: none;
}

.ios-filter-drawer-inner {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 0.75rem;
  align-items: flex-end;
  background: var(--ios-card-bg);
  border: 0.5px solid var(--ios-separator);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  box-shadow: var(--ios-card-shadow);
}

.ios-drawer-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.ios-drawer-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ios-tertiary-label);
}

.ios-drawer-actions {
  display: flex;
  align-items: flex-end;
  flex-shrink: 0;
}

.ios-drawer-reset-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--ios-card-subtle);
  border: 0.5px solid var(--ios-separator);
  color: var(--ios-secondary-label);
  padding: 0.46rem 0.85rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.ios-drawer-reset-btn:hover {
  background: var(--ios-red-light);
  color: var(--ios-red);
  border-color: rgba(255, 59, 48, 0.3);
}

.ios-drawer-reset-btn:active {
  transform: scale(0.96);
}

.ios-secondary-filters {
  display: contents;
}

/* ==========================================================================
   Apple iOS Glass Dropdown Component System (Framer Motion Powered)
   ========================================================================== */
.ios-dropdown-container {
  position: relative;
  display: inline-block;
  vertical-align: middle;
  font-family: var(--ios-font);
  flex-shrink: 1;
  min-width: 0;
}

/* Visually conceal original select while retaining full form serialization & accessibility */
.ios-native-select-hidden {
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  z-index: -1 !important;
}

/* Custom Glass Pill Trigger */
.ios-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  background: var(--ios-card-subtle);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border: 0.5px solid var(--ios-separator);
  color: var(--ios-label);
  padding: 0.42rem 0.75rem;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.81rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, transform 0.12s cubic-bezier(0.2, 0, 0, 1);
  white-space: nowrap;
  max-width: 100%;
  user-select: none;
}

.ios-dropdown-trigger:hover {
  background: var(--ios-card-bg);
  border-color: rgba(var(--ios-blue-rgb), 0.35);
}

.ios-dropdown-trigger:active {
  transform: scale(0.97);
}

.ios-dropdown-trigger.open {
  border-color: var(--ios-blue);
  background: var(--ios-card-bg);
  box-shadow: 0 0 0 3px rgba(var(--ios-blue-rgb), 0.18);
}

.ios-dropdown-label {
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 135px;
  text-align: left;
  line-height: 1.25;
}

.ios-dropdown-trigger-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ios-blue);
  flex-shrink: 0;
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ios-dropdown-trigger.open .ios-dropdown-trigger-icon {
  transform: rotate(180deg);
}

/* Floating iOS Glass Popover Menu */
.ios-dropdown-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 200px;
  max-width: 320px;
  max-height: 280px;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--ios-glass-card);
  backdrop-filter: blur(32px) saturate(210%);
  -webkit-backdrop-filter: blur(32px) saturate(210%);
  border: 0.5px solid var(--ios-separator);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.08);
  padding: 0.35rem;
  z-index: 4500;
  outline: none;
  transform-origin: top left;
  scrollbar-width: thin;
  scrollbar-color: var(--ios-tertiary-label) transparent;
}

body.ios-theme-dark .ios-dropdown-popover {
  background: rgba(30, 30, 32, 0.94);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55), 0 2px 10px rgba(0, 0, 0, 0.3);
}

.ios-dropdown-popover.hidden {
  display: none !important;
}

.ios-dropdown-group-header {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--ios-tertiary-label);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.45rem 0.65rem 0.2rem 0.65rem;
  user-select: none;
}

.ios-dropdown-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  font-size: 0.81rem;
  font-weight: 500;
  color: var(--ios-label);
  cursor: pointer;
  transition: background 0.12s ease, transform 0.1s ease;
  user-select: none;
}

.ios-dropdown-option:hover,
.ios-dropdown-option.highlighted {
  background: var(--ios-card-subtle);
}

body.ios-theme-dark .ios-dropdown-option:hover,
body.ios-theme-dark .ios-dropdown-option.highlighted {
  background: rgba(255, 255, 255, 0.08);
}

.ios-dropdown-option.selected {
  font-weight: 700;
  color: var(--ios-blue);
  background: var(--ios-blue-light);
}

body.ios-theme-dark .ios-dropdown-option.selected {
  background: rgba(10, 132, 255, 0.18);
  color: var(--ios-blue);
}

.ios-dropdown-option-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.ios-dropdown-check {
  font-size: 0.82rem;
  color: var(--ios-blue);
  opacity: 0;
  flex-shrink: 0;
  font-weight: 700;
  transition: opacity 0.12s ease;
}

.ios-dropdown-option.selected .ios-dropdown-check {
  opacity: 1;
}

/* Form Row Full Width Dropdowns */
.ios-input-row .ios-dropdown-container {
  flex: 1;
  width: 100%;
}

.ios-input-row .ios-dropdown-trigger {
  width: 100%;
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.85rem;
  font-size: 0.88rem;
}

.ios-input-row .ios-dropdown-label {
  max-width: none;
}

.ios-input-row .ios-dropdown-popover {
  width: 100%;
  max-width: 100%;
}

/* Calendar Month & Year Compact Dropdowns */
.ios-cal-selectors-group .ios-dropdown-container {
  min-width: 84px;
}

.ios-cal-selectors-group .ios-dropdown-trigger {
  padding: 0.32rem 0.58rem;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 8px;
  color: var(--ios-blue);
  background: var(--ios-card-subtle);
  border-color: rgba(var(--ios-blue-rgb), 0.18);
}

.ios-cal-selectors-group .ios-dropdown-label {
  max-width: 65px;
}

.ios-cal-selectors-group .ios-dropdown-popover {
  min-width: 135px;
  max-height: 220px;
}

/* Legacy fallback support */
.ios-select-box {
  position: relative;
  display: inline-block;
  min-width: 0;
}

.ios-icon-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--ios-card-bg);
  border: 0.5px solid var(--ios-separator);
  color: var(--ios-secondary-label);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--ios-card-shadow);
  transition: var(--ios-touch-trans);
}

.ios-icon-action-btn:active {
  transform: scale(0.96);
  background: var(--ios-card-subtle);
}

/* --------------------------------------------------------------------------
   8. iOS Inset Grouped Section & Table
   -------------------------------------------------------------------------- */
.ios-group-section {
  margin-bottom: 2rem;
}

.ios-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 0.5rem 0.6rem 0.5rem;
}

.ios-section-title-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ios-status-dot {
  width: 8px;
  height: 8px;
  min-width: 8px;
  min-height: 8px;
  aspect-ratio: 1 / 1;
  flex-shrink: 0;
  border-radius: 50%;
}

.dot-active {
  background: var(--ios-blue);
  box-shadow: 0 0 0 3px rgba(var(--ios-blue-rgb), 0.25);
  animation: iosPulseDot 2s infinite;
}

.dot-passed {
  background: var(--ios-tertiary-label);
}

.ios-section-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ios-label);
}

.ios-count-bubble {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: var(--ios-blue-light);
  color: var(--ios-blue);
}

.bubble-muted {
  background: var(--ios-card-subtle);
  color: var(--ios-tertiary-label);
  border: 0.5px solid var(--ios-separator);
}

.ios-section-caption {
  font-size: 0.82rem;
  color: var(--ios-tertiary-label);
}

.ios-section-header-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.ios-section-reload-btn {
  background: var(--ios-card-bg);
  border: 0.5px solid var(--ios-separator);
  color: var(--ios-secondary-label);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s var(--spring-bounce);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.ios-section-reload-btn:hover {
  background: var(--ios-card-subtle);
  color: var(--ios-blue);
  transform: scale(1.08);
  border-color: rgba(var(--ios-blue-rgb), 0.35);
}

.ios-section-reload-btn:active {
  transform: scale(0.92);
}

.reload-svg {
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.app-reload-trigger.is-spinning .reload-svg {
  animation: iosSpinReload 0.75s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes iosSpinReload {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* iOS Inset Card (Table Container) */
.ios-inset-card {
  background: var(--ios-card-bg);
  border: 0.5px solid var(--ios-separator);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  overflow-y: hidden;
  box-shadow: var(--ios-card-shadow);
  transition: all 0.3s ease;
  scrollbar-width: none;
}

/* iOS Table - Compact & Professional */
.ios-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  table-layout: auto;
}

.ios-table th {
  background: var(--ios-card-subtle);
  color: var(--ios-tertiary-label);
  font-size: 0.70rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.58rem 0.55rem;
  border-bottom: 0.5px solid var(--ios-separator);
  white-space: nowrap;
}

.ios-table td {
  padding: 0.58rem 0.55rem;
  font-size: 0.83rem;
  color: var(--ios-label);
  border-bottom: 0.5px solid var(--ios-separator);
  vertical-align: middle;
  transition: background-color 0.15s ease, opacity 0.25s ease;
}

.ios-table th:first-child,
.ios-table td:first-child {
  padding-left: 0.75rem;
  padding-right: 0.35rem;
}

.ios-table th:last-child,
.ios-table td:last-child {
  padding-right: 0.85rem;
  text-align: right;
  width: 66px;
  min-width: 66px;
}

.ios-table tbody tr {
  transition: background-color 0.15s ease, transform 0.2s var(--spring-smooth);
}

.ios-table tbody tr:hover {
  background-color: var(--ios-card-subtle);
}

.ios-table tbody tr:last-child td {
  border-bottom: none;
}

.quiz-title-cell {
  font-size: 0.83rem;
  color: var(--ios-label);
  line-height: 1.25;
  max-width: 140px;
  word-break: break-word;
}

.date-cell {
  white-space: nowrap !important;
  font-variant-numeric: tabular-nums;
  font-size: 0.80rem;
  color: var(--ios-secondary-label);
}

.date-cell.exam-date {
  font-weight: 700;
  color: var(--ios-label);
}

.syllabus-cell {
  padding-left: 0.85rem !important;
  padding-right: 0.85rem !important;
  min-width: 280px;
  width: auto;
}

.syllabus-clamp {
  display: -webkit-box;
  -webkit-line-clamp: 4; /* Show 4 full lines on desktop */
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.45;
  font-size: 0.83rem;
  color: var(--ios-label);
  max-width: none;
  word-break: break-word;
  transition: all 0.2s ease;
}

.syllabus-clamp:hover {
  -webkit-line-clamp: 8;
  background: var(--ios-card-subtle);
  border-radius: 4px;
}

/* iOS Reminders Style Circular Checkbox */
.ios-check-btn {
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  aspect-ratio: 1 / 1;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid var(--ios-tertiary-label);
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  transition: all 0.2s var(--spring-bounce);
  padding: 0;
  outline: none;
  box-sizing: content-box;
  position: relative;
}

/* Fitts' Law Apple HIG 44px Touch Target */
.ios-check-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
  background: transparent;
}

.ios-check-btn:hover {
  border-color: var(--ios-blue);
  background: var(--ios-blue-light);
}

.ios-check-btn:active {
  transform: scale(0.85);
}

.ios-check-btn.checked {
  background: var(--ios-blue);
  border-color: var(--ios-blue);
  color: #ffffff;
  animation: iosCheckBounce 0.35s var(--spring-bounce);
}

/* Course Pill Badges */
.ios-course-pill {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  white-space: nowrap;
}

.pill-cse {
  background: var(--ios-blue-light);
  color: var(--ios-blue);
}

.pill-math {
  background: var(--ios-purple-light);
  color: var(--ios-purple);
}

.pill-phys {
  background: var(--ios-teal-light);
  color: var(--ios-teal);
}

.pill-chem {
  background: var(--ios-orange-light);
  color: var(--ios-orange);
}

.pill-hum {
  background: var(--ios-green-light);
  color: var(--ios-green);
}

/* Quiz Number Badges */
.quiz-no-pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  background: var(--ios-orange-light);
  color: var(--ios-orange);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.quiz-no-pill.quiz-lab {
  background: var(--ios-purple-light);
  color: var(--ios-purple);
}

.quiz-no-pill.quiz-eval {
  background: var(--ios-teal-light);
  color: var(--ios-teal);
}

.quiz-no-pill.quiz-final {
  background: var(--ios-red-light);
  color: var(--ios-red);
}

/* Countdown Badges */
.ios-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.badge-urgent {
  background: var(--ios-red-light);
  color: var(--ios-red);
}

.badge-medium {
  background: var(--ios-orange-light);
  color: var(--ios-orange);
}

.badge-safe {
  background: var(--ios-green-light);
  color: var(--ios-green);
}

.badge-passed {
  background: var(--ios-card-subtle);
  color: var(--ios-tertiary-label);
  border: 0.5px solid var(--ios-separator);
}

/* Action Icons */
.ios-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  white-space: nowrap;
}

.ios-icon-btn {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--ios-tertiary-label);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--ios-touch-trans);
  flex-shrink: 0;
}

.ios-icon-btn:hover {
  background: var(--ios-card-subtle);
  color: var(--ios-label);
}

.ios-icon-btn:active {
  transform: scale(0.88);
}

.edit-btn:hover {
  color: var(--ios-blue);
  background: var(--ios-blue-light);
}

.delete-btn:hover {
  color: var(--ios-red);
  background: var(--ios-red-light);
}

/* --------------------------------------------------------------------------
   9. Crossed Out & Expired Bottom Section (Requested Animation!)
   -------------------------------------------------------------------------- */
.ios-expired-section {
  padding-top: 1.5rem;
  border-top: 1px dashed var(--ios-separator-opaque);
}

.ios-collapsible-header {
  cursor: pointer;
  user-select: none;
}

.ios-header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ios-chevron-btn {
  background: var(--ios-card-bg);
  border: 0.5px solid var(--ios-separator);
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  aspect-ratio: 1 / 1;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ios-tertiary-label);
  cursor: pointer;
  transition: transform 0.25s var(--spring-smooth);
}

.ios-chevron-btn.rotated svg {
  transform: rotate(-90deg);
}

/* Strikethrough Effect */
.row-expired td,
.card-expired {
  opacity: 0.68;
  background-color: var(--ios-card-subtle);
}

.row-expired .quiz-title-cell,
.row-expired .syllabus-cell,
.row-expired .date-cell,
.card-expired .ios-card-title,
.card-expired .ios-card-topics,
.card-expired .ios-card-dates {
  position: relative;
  text-decoration: line-through;
  text-decoration-color: var(--ios-tertiary-label);
  text-decoration-thickness: 1.5px;
  color: var(--ios-tertiary-label) !important;
}

.row-expired .ios-course-pill,
.card-expired .ios-course-pill {
  filter: grayscale(0.5);
  opacity: 0.7;
}

/* Smooth transition when moving to expired */
.item-animating-complete {
  animation: iosDisappearDown 0.4s var(--apple-sheet) forwards;
}

/* --------------------------------------------------------------------------
   10. Mobile Inset Cards (Phone Screens)
   -------------------------------------------------------------------------- */
.mobile-view {
  display: none;
}

.ios-card {
  background: var(--ios-card-bg);
  border: 0.5px solid var(--ios-separator);
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
  margin-bottom: 0.75rem;
  box-shadow: var(--ios-card-shadow);
  transition: var(--ios-touch-trans), opacity 0.25s ease;
}

.ios-card:active {
  transform: scale(0.98);
}

.ios-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}

.ios-card-left {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

.ios-card-identity {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1;
  min-width: 0;
}

.ios-card-pills-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.ios-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ios-label);
  line-height: 1.3;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.ios-card-badge-wrap {
  flex-shrink: 0;
}

.ios-card-topics {
  font-size: 0.84rem;
  color: var(--ios-secondary-label);
  background: var(--ios-card-subtle);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
  line-height: 1.35;
}

.ios-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.6rem;
  border-top: 0.5px solid var(--ios-separator);
  font-size: 0.8rem;
}

.ios-card-dates {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--ios-tertiary-label);
}

.ios-card-dates strong {
  color: var(--ios-label);
}

/* --------------------------------------------------------------------------
   11. iOS Floating Action Button (FAB)
   -------------------------------------------------------------------------- */
.ios-fab {
  display: none;
  position: fixed;
  bottom: 2rem;
  right: 1.75rem;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--ios-blue);
  color: #ffffff;
  border: none;
  box-shadow: 0 8px 24px rgba(var(--ios-blue-rgb), 0.45);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 100;
  transition: transform 0.2s var(--spring-bounce);
}

.ios-fab:active {
  transform: scale(0.9);
}

/* --------------------------------------------------------------------------
   12. iOS Modal Sheet (Slide-Up with Spring Physics)
   -------------------------------------------------------------------------- */
.ios-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 1000;
  animation: iosFadeIn 0.2s ease-out;
}

.ios-bottom-sheet {
  background: var(--ios-sheet-bg);
  border: 0.5px solid var(--ios-separator);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 500px;
  /* flex column: handle + header + scrollable form + sticky publish bar */
  display: flex;
  flex-direction: column;
  box-shadow: var(--ios-sheet-shadow);
  max-height: 92vh;
  overflow: hidden; /* children manage their own scroll */
  animation: iosSheetSlideUp 0.35s var(--apple-sheet);
  padding: 0.75rem 0 0 0; /* top padding only, sides via children */
}

/* Form body scrolls independently */
.ios-sheet-body {
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1 1 auto;
  padding: 0 1.25rem 0.5rem 1.25rem;
  scrollbar-width: none;
}

.ios-sheet-body::-webkit-scrollbar {
  display: none;
}

/* Handle and header get horizontal padding */
.ios-sheet-handle {
  margin: 0 auto 0.75rem auto;
}

/* Sticky Publish Button Bar */
.ios-sheet-publish-bar {
  flex-shrink: 0;
  padding: 0.75rem 1.25rem calc(0.75rem + env(safe-area-inset-bottom, 0px)) 1.25rem;
  background: var(--ios-sheet-bg);
  border-top: 0.5px solid var(--ios-separator);
}

.ios-publish-bottom-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  background: var(--ios-blue);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.82rem 1.25rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(var(--ios-blue-rgb), 0.38);
  transition: transform 0.14s cubic-bezier(0.2, 0, 0, 1), background 0.15s ease, box-shadow 0.15s ease;
}

.ios-publish-bottom-btn:hover {
  background: #0065d9;
  box-shadow: 0 6px 18px rgba(var(--ios-blue-rgb), 0.45);
}

.ios-publish-bottom-btn:active {
  transform: scale(0.97);
  box-shadow: 0 2px 8px rgba(var(--ios-blue-rgb), 0.3);
}

/* Drag Handle Bar */
.ios-sheet-handle {
  width: 38px;
  height: 5px;
  border-radius: 3px;
  background: var(--ios-quaternary-label);
  margin: 0 auto 0.75rem auto;
}

.ios-sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding: 0 1rem;
  flex-shrink: 0;
}

.ios-sheet-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ios-label);
}

.ios-text-action-btn {
  background: transparent;
  border: none;
  color: var(--ios-blue);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  transition: opacity 0.15s ease;
}

.ios-text-action-btn:active {
  opacity: 0.5;
}

.btn-bold {
  font-weight: 700;
}

/* iOS Inset Form Groups */
.ios-form-group-card {
  background: var(--ios-card-bg);
  border-radius: var(--radius-md);
  border: 0.5px solid var(--ios-separator);
  margin-bottom: 0.85rem;
  position: relative;
}

.ios-form-group-card > .ios-input-row:first-child {
  border-top-left-radius: var(--radius-md);
  border-top-right-radius: var(--radius-md);
}

.ios-form-group-card > .ios-input-row:last-child {
  border-bottom-left-radius: var(--radius-md);
  border-bottom-right-radius: var(--radius-md);
}

.ios-input-row {
  display: flex;
  align-items: center;
  padding: 0.8rem 1rem;
  min-height: 48px;
}

.ios-input-row.vertical-layout {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}

.ios-row-divider {
  height: 0.5px;
  background-color: var(--ios-separator);
  margin-left: 1rem;
}

.ios-input-label {
  width: 105px;
  flex-shrink: 0;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ios-label);
}

.ios-text-input,
.ios-date-input,
.ios-textarea-input {
  flex: 1;
  width: 100%;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--ios-label);
  outline: none;
}

.ios-textarea-input {
  resize: none;
  padding-top: 0.2rem;
  min-height: 64px;
}

.ios-text-input::placeholder,
.ios-textarea-input::placeholder {
  color: var(--ios-tertiary-label);
}

/* iOS Autocomplete & Suggestions Wrapper */
.ios-input-wrapper,
.ios-textarea-wrapper {
  position: relative;
  flex: 1;
  width: 100%;
}

.ios-field-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 0.35rem;
}

.ios-field-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.ios-micro-btn {
  background: var(--ios-card-subtle);
  border: 0.5px solid var(--ios-separator);
  color: var(--ios-blue);
  border-radius: var(--radius-full);
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ios-micro-btn:hover {
  background: var(--ios-blue-light);
}

.ios-micro-btn:active {
  transform: scale(0.92);
}

/* Apple Spotlight Style Course & Topic Suggestions (Apple HIG) */
.ios-fade-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--ios-card-bg);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid var(--ios-separator);
  border-radius: var(--radius-md);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
  max-height: 220px;
  overflow-y: auto;
  z-index: 2500;
  animation: iosFadeInDown 0.18s var(--spring-smooth);
}

.topic-dropdown {
  top: calc(100% + 4px);
  max-height: 170px;
}

.ios-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  border-bottom: 0.5px solid var(--ios-separator);
  cursor: pointer;
  font-size: 0.80rem;
  color: var(--ios-label);
  transition: background-color 0.14s ease;
  gap: 0.6rem;
}

.ios-dropdown-item:last-child {
  border-bottom: none;
}

.ios-dropdown-item:hover,
.ios-dropdown-item.focused {
  background-color: var(--ios-card-subtle);
}

.course-item-main {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
  min-width: 0;
}

.course-item-header {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.course-item-title {
  font-weight: 600;
  color: var(--ios-label);
  font-size: 0.80rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.course-item-sub {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.73rem;
  color: var(--ios-secondary-label);
}

.course-credit-tag {
  font-weight: 700;
  color: var(--ios-blue);
  background: var(--ios-blue-light);
  padding: 1px 6px;
  border-radius: 4px;
}

.course-teacher-tag {
  color: var(--ios-tertiary-label);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.course-sem-badge {
  font-size: 0.68rem;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--ios-card-subtle);
  color: var(--ios-secondary-label);
  border: 0.5px solid var(--ios-separator);
  font-weight: 600;
  white-space: nowrap;
}

.ios-tab-badge {
  font-size: 0.66rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--ios-blue-light);
  color: var(--ios-blue);
  border: 0.5px solid var(--ios-blue);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* ==========================================================================
   Apple iOS Authentic Calendar Date Picker
   ========================================================================== */
.ios-date-row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.ios-date-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--ios-blue-light);
}

/* Modern Typeable & Expandable Apple iOS Date Picker */
.ios-date-input-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 0.6rem;
}

.ios-date-interactive-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex: 1;
  justify-content: flex-end;
}

.ios-date-type-input {
  border: 1px solid var(--ios-separator);
  background: var(--ios-card-subtle);
  border-radius: var(--radius-sm);
  padding: 0.32rem 0.6rem;
  font-family: inherit;
  font-size: 0.80rem;
  font-weight: 600;
  color: var(--ios-label);
  width: 132px;
  outline: none;
  transition: all 0.16s ease;
}

.ios-date-type-input:focus {
  border-color: var(--ios-blue);
  background: var(--ios-card-bg);
  box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.2);
}

.ios-date-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--ios-blue-light);
  border: 1px solid rgba(0, 122, 255, 0.25);
  border-radius: var(--radius-full);
  padding: 0.32rem 0.65rem;
  color: var(--ios-blue);
  font-family: inherit;
  font-size: 0.80rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.ios-date-pill-btn:hover,
.ios-date-pill-btn.active {
  background: var(--ios-blue);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.ios-date-chevron {
  transition: transform 0.2s var(--spring-smooth);
}

.ios-date-chevron.rotated {
  transform: rotate(180deg);
}

.ios-calendar-sheet {
  background: var(--ios-glass-card);
  backdrop-filter: blur(28px) saturate(200%);
  -webkit-backdrop-filter: blur(28px) saturate(200%);
  border: 0.5px solid var(--ios-separator);
  border-radius: 16px;
  padding: 0.85rem;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.04);
  width: 100%;
  margin-top: 0.5rem;
  transform-origin: top center;
}

body.ios-theme-dark .ios-calendar-sheet {
  background: rgba(28, 28, 30, 0.92);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.5);
}

.ios-calendar-sheet.hidden {
  display: none !important;
}

.ios-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.45rem;
  padding: 0 0.1rem;
  gap: 0.5rem;
}

.ios-cal-selectors-group {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.ios-cal-select {
  background: var(--ios-card-subtle);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: none;
  color: var(--ios-blue);
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  outline: none;
  transition: all 0.15s ease;
}

.ios-cal-select:hover {
  background: var(--ios-blue-light);
}

.ios-cal-select option {
  background: var(--ios-card-bg);
  color: var(--ios-label);
}

.ios-cal-month-title {
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ios-label);
}

.ios-cal-nav-btn {
  background: var(--ios-card-subtle);
  border: none;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  min-width: 26px;
  min-height: 26px;
  aspect-ratio: 1 / 1;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ios-blue);
  cursor: pointer;
  transition: background 0.15s ease;
}

.ios-cal-nav-btn:hover {
  background: var(--ios-blue-light);
}

.ios-cal-quick-actions {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.55rem;
  padding-bottom: 0.45rem;
  border-bottom: 0.5px solid var(--ios-separator);
  overflow-x: auto;
  scrollbar-width: none;
}

.ios-cal-quick-pill {
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--ios-card-subtle);
  border: 0.5px solid var(--ios-separator);
  font-size: 0.70rem;
  font-weight: 600;
  color: var(--ios-secondary-label);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.ios-cal-quick-pill:hover,
.ios-cal-quick-pill.active {
  background: var(--ios-blue);
  color: #ffffff;
  border-color: var(--ios-blue);
}

.ios-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--ios-tertiary-label);
  margin-bottom: 0.35rem;
  letter-spacing: 0.04em;
}

.ios-cal-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.ios-cal-day {
  aspect-ratio: 1;
  max-width: 32px;
  max-height: 32px;
  margin: 0 auto;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.80rem;
  font-weight: 500;
  border: none;
  background: transparent;
  color: var(--ios-label);
  cursor: pointer;
  transition: all 0.14s ease;
  padding: 0;
  width: 100%;
}

.ios-cal-day:hover:not(:disabled) {
  background: var(--ios-card-subtle);
}

.ios-cal-day.other-month {
  color: var(--ios-tertiary-label);
  opacity: 0.35;
}

.ios-cal-day.today:not(.selected) {
  color: var(--ios-blue);
  font-weight: 800;
  box-shadow: inset 0 0 0 1.5px var(--ios-blue);
}

.ios-cal-day.selected {
  background: var(--ios-blue) !important;
  color: #ffffff !important;
  font-weight: 700;
  box-shadow: 0 3px 8px rgba(0, 122, 255, 0.4);
}

.ios-cal-sheet-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.55rem;
  padding-top: 0.45rem;
  border-top: 0.5px solid var(--ios-separator);
}

.ios-cal-footer-text {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--ios-secondary-label);
}

.ios-cal-done-btn {
  background: var(--ios-blue);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.22rem 0.75rem;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease;
}

.ios-cal-done-btn:active {
  transform: scale(0.95);
}

/* Topic Suggestion Pills Container */
.ios-topic-suggestions-container {
  width: 100%;
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 0.5px dashed var(--ios-separator);
  animation: iosFadeIn 0.28s ease;
}

.ios-topic-sug-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
  gap: 4px;
}

.ios-topic-sug-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ios-tertiary-label);
}

.ios-topic-sug-hint {
  font-size: 0.72rem;
  color: var(--ios-tertiary-label);
  font-style: italic;
}

.ios-topic-pills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  max-height: 140px;
  overflow-y: auto;
  padding-right: 2px;
}

.ios-topic-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--ios-card-subtle);
  border: 0.5px solid var(--ios-separator);
  color: var(--ios-secondary-label);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.12s var(--spring-bounce), background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  user-select: none;
  animation: iosFadeIn 0.2s ease-out;
}

.ios-topic-pill:hover {
  background: var(--ios-blue-light);
  border-color: var(--ios-blue);
  color: var(--ios-blue);
}

.ios-topic-pill:active {
  transform: scale(0.92);
}

.ios-topic-pill.selected {
  background: var(--ios-blue) !important;
  color: #ffffff !important;
  border-color: var(--ios-blue) !important;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(var(--ios-blue-rgb), 0.35);
}

.ios-topic-pill .pill-check {
  font-size: 0.75rem;
  font-weight: 700;
}

@keyframes iosFadeInDown {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Authentic iOS Toggle Switch */
.switch-row {
  justify-content: space-between;
}

.ios-switch-text {
  display: flex;
  flex-direction: column;
}

.ios-switch-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ios-label);
}

.ios-switch-caption {
  font-size: 0.75rem;
  color: var(--ios-tertiary-label);
}

.ios-switch {
  position: relative;
  display: inline-block;
  width: 51px;
  height: 31px;
  flex-shrink: 0;
}

.ios-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.ios-switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--ios-separator-opaque);
  border-radius: 31px;
  transition: 0.3s cubic-bezier(0.2, 0.85, 0.32, 1.2);
}

.ios-switch-slider:before {
  position: absolute;
  content: "";
  height: 27px;
  width: 27px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  transition: 0.3s cubic-bezier(0.2, 0.85, 0.32, 1.2);
}

.ios-switch input:checked + .ios-switch-slider {
  background-color: var(--ios-green);
}

.ios-switch input:checked + .ios-switch-slider:before {
  transform: translateX(20px);
}

/* --------------------------------------------------------------------------
   13. iOS Action Sheet (Delete Confirmation)
   -------------------------------------------------------------------------- */
.ios-action-sheet {
  width: 100%;
  max-width: 380px;
  animation: iosSheetSlideUp 0.3s var(--apple-sheet);
}

.ios-action-sheet-group {
  background: var(--ios-glass-card);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 0.6rem;
  border: 0.5px solid var(--ios-separator);
}

.ios-action-sheet-header {
  padding: 1.25rem 1rem;
  text-align: center;
  border-bottom: 0.5px solid var(--ios-separator);
}

.ios-sheet-warning-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--ios-red-light);
  color: var(--ios-red);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.6rem auto;
}

.ios-action-sheet-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ios-label);
  margin-bottom: 0.25rem;
}

.ios-action-sheet-desc {
  font-size: 0.82rem;
  color: var(--ios-tertiary-label);
}

.ios-sheet-btn {
  width: 100%;
  padding: 0.95rem;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.ios-sheet-btn:active {
  background-color: var(--ios-card-subtle);
}

.btn-destructive {
  color: var(--ios-red);
}

.ios-action-sheet-cancel-group {
  background: var(--ios-card-bg);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 0.5px solid var(--ios-separator);
}

.btn-cancel {
  color: var(--ios-blue);
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   14. iOS Dynamic Toast Island
   -------------------------------------------------------------------------- */
.ios-toast-island {
  position: fixed;
  top: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: #1c1c1e;
  color: #ffffff;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-full);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  z-index: 1100;
  animation: iosIslandPop 0.35s var(--spring-bounce);
}

.ios-toast-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ios-green);
}

/* Empty State */
.ios-empty-state {
  padding: 3rem 1.5rem;
  text-align: center;
}

.ios-empty-icon {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
}

.ios-empty-state h3 {
  font-size: 1.05rem;
  color: var(--ios-label);
  margin-bottom: 0.25rem;
}

.ios-empty-state p {
  font-size: 0.85rem;
  color: var(--ios-tertiary-label);
}

/* Footer */
.ios-footer {
  text-align: center;
  margin-top: 3rem;
  color: var(--ios-tertiary-label);
  font-size: 0.82rem;
}

.ios-footer span {
  font-size: 0.75rem;
  opacity: 0.75;
  display: block;
  margin-top: 0.25rem;
}

/* --------------------------------------------------------------------------
   15. Keyframe Animations (Apple Spring & Curves)
   -------------------------------------------------------------------------- */
@keyframes iosFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes iosSheetSlideUp {
  from { transform: translateY(100%) scale(0.96); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes iosSpringDown {
  from { transform: translateY(-15px) scale(0.97); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes iosIslandPop {
  from { transform: translate(-50%, -20px) scale(0.9); opacity: 0; }
  to { transform: translate(-50%, 0) scale(1); opacity: 1; }
}

@keyframes iosCheckBounce {
  0% { transform: scale(0.7); }
  50% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

@keyframes iosDisappearDown {
  0% { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(20px) scale(0.95); opacity: 0; }
}

@keyframes iosPulseDot {
  0% { box-shadow: 0 0 0 0 rgba(var(--ios-blue-rgb), 0.5); }
  70% { box-shadow: 0 0 0 6px rgba(var(--ios-blue-rgb), 0); }
  100% { box-shadow: 0 0 0 0 rgba(var(--ios-blue-rgb), 0); }
}

@keyframes iosPulseIcon {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.8; }
}

/* Responsive overhaul is at the bottom of this file */

/* Past Quizzes crossed out */
.row-expired td.quiz-title-cell,
.row-expired td.syllabus-cell,
.row-expired td.date-cell,
.card-expired .ios-card-title,
.card-expired .ios-card-topics,
.card-expired .ios-card-dates {
  text-decoration: line-through;
  opacity: 0.6;
}

/* ==========================================================================
   COMPREHENSIVE MOBILE RESPONSIVE OVERHAUL
   Fixes: Navbar, filter layout, card view, bottom sheet, safe-area insets
   ========================================================================== */

/* ---- Tablet (≤860px): Compact stat row ---- */
@media (max-width: 860px) {
  .ios-widgets-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.5rem !important;
    margin-bottom: 1.15rem;
  }
  .ios-widget {
    padding: 0.7rem 0.45rem !important;
    border-radius: var(--radius-md) !important;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .ios-widget-header {
    flex-direction: column;
    gap: 0.2rem;
    margin-bottom: 0.3rem;
  }
  .ios-widget-icon-bg { width: 26px; height: 26px; }
  .ios-widget-icon-bg svg { width: 14px; height: 14px; }
  .ios-widget-label { font-size: 0.58rem; letter-spacing: 0.02em; white-space: nowrap; }
  .ios-widget-num { font-size: 1.45rem; font-weight: 800; line-height: 1; margin-bottom: 0.1rem; }
  .ios-widget-caption { display: none; }
}

/* ---- Phone (≤768px): Main mobile breakpoint ---- */
@media (max-width: 768px) {

  /* App Container */
  .ios-app-container {
    width: 100%;
    padding: 0.5rem 0.65rem 7rem 0.65rem;
  }

  /* NAVBAR: single-line compact row */
  .ios-nav-bar {
    top: 0.4rem;
    padding: 0.42rem 0.65rem;
    border-radius: var(--radius-lg);
    margin-bottom: 0.9rem;
  }
  .ios-nav-content {
    gap: 0.35rem;
    flex-wrap: nowrap;
    align-items: center;
  }
  .ios-nav-left {
    flex: 1 1 auto;
    min-width: 0;
    gap: 0.45rem;
    overflow: hidden;
  }
  .ios-aust-logo-frame {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
  }
  .ios-nav-meta {
    min-width: 0;
    flex: 1;
    overflow: hidden;
  }
  .ios-subhead {
    font-size: 0.57rem;
    letter-spacing: 0.05em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    max-width: 100%;
  }
  .ios-nav-date {
    font-size: 0.67rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
  }
  .ios-nav-right {
    gap: 0.28rem;
    flex-shrink: 0;
  }

  /* Sync & theme buttons: icon only, hide text */
  .ios-pill-btn {
    padding: 0.32rem 0.5rem;
    font-size: 0.74rem;
    gap: 0.28rem;
  }
  #syncStatusLabel { display: none; }
  #themeLabelText { display: none; }

  /* Hide desktop add button — FAB replaces it */
  #openAddModalBtn { display: none !important; }
  .ios-nav-right #openAddModalBtn { display: none !important; }

  /* FAB */
  .ios-fab {
    display: flex;
    width: 54px;
    height: 54px;
    right: 1.1rem;
    bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
    z-index: 200;
  }

  /* HEADER SECTION */
  .ios-header-section { padding: 0.3rem 0 0.85rem 0; }
  .ios-dept-badge-row { flex-wrap: wrap; gap: 0.3rem; margin-bottom: 0.4rem; }
  .ios-dept-tag { display: none; }
  .ios-dept-badge { font-size: 0.66rem; }
  .ios-large-title { font-size: 1.6rem; line-height: 1.2; margin-bottom: 0.2rem; }
  .ios-large-subtitle { font-size: 0.79rem; line-height: 1.35; }

  /* ALERT BANNER */
  .ios-alert-banner { padding: 0.55rem 0.75rem; margin-bottom: 0.9rem; gap: 0.55rem; }
  .ios-alert-icon-wrap { width: 28px; height: 28px; min-width: 28px; min-height: 28px; }
  .ios-warning-icon { width: 15px; height: 15px; }
  .ios-alert-course { font-size: 0.82rem; }
  .ios-alert-quiz-badge { font-size: 0.68rem; padding: 1px 5px; }
  .ios-alert-badge { font-size: 0.7rem; padding: 2px 7px; }
  .ios-alert-topic { max-width: 160px; font-size: 0.76rem; }
  .ios-alert-date-part { font-size: 0.73rem; }

  /* SEARCH */
  .ios-search-bar input {
    font-size: 0.83rem;
    padding: 0.6rem 2rem 0.6rem 2.3rem;
  }

  /* FILTER BAR */
  .ios-control-section { gap: 0.5rem; margin-bottom: 1.1rem; }
  .ios-filter-bar { flex-direction: row; align-items: center; justify-content: space-between; gap: 0.5rem; }
  .ios-segmented-control { flex: 1; display: flex; }
  .ios-segment {
    flex: 1;
    text-align: center;
    padding: 0.42rem 0.1rem;
    font-size: 0.77rem;
  }
  .ios-filter-toggle-btn {
    padding: 0.42rem 0.75rem;
    font-size: 0.78rem;
    flex-shrink: 0;
  }

  /* Filter Drawer Mobile 2-column Grid */
  .ios-filter-drawer-inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    padding: 0.75rem;
  }
  .ios-filter-drawer-inner .ios-dropdown-container {
    width: 100%;
    min-width: 0;
  }
  .ios-filter-drawer-inner .ios-dropdown-trigger {
    width: 100%;
    min-height: 38px;
    padding: 0.4rem 0.55rem;
    font-size: 0.76rem;
    border-radius: 10px;
  }
  .ios-filter-drawer-inner .ios-dropdown-label {
    max-width: 100%;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  /* Right-column popovers anchor right to prevent overflow */
  .ios-filter-drawer-inner .ios-drawer-field:nth-child(2n) .ios-dropdown-popover {
    left: auto !important;
    right: 0 !important;
    transform-origin: top right !important;
  }
  /* Reset button full width */
  .ios-drawer-actions {
    grid-column: 1 / -1;
    width: 100%;
  }
  .ios-drawer-reset-btn {
    width: 100%;
    justify-content: center;
    min-height: 36px;
    font-size: 0.8rem;
  }
  /* Popover width cap */
  .ios-dropdown-popover {
    max-width: calc(100vw - 1rem);
    min-width: 155px;
  }

  /* TABLE → CARD VIEW */
  .desktop-view { display: none !important; }
  .mobile-view { display: block !important; }

  /* SECTION HEADER */
  .ios-section-header { padding: 0 0.2rem 0.45rem 0.2rem; flex-wrap: wrap; gap: 0.3rem; }
  .ios-section-title { font-size: 0.98rem; }
  .ios-section-caption { font-size: 0.75rem; }

  /* MOBILE CARDS */
  .ios-card { padding: 0.8rem 0.85rem; margin-bottom: 0.55rem; }
  .ios-card-top { gap: 0.55rem; margin-bottom: 0.45rem; }
  .ios-card-title { font-size: 0.9rem; line-height: 1.3; }
  .ios-card-topics {
    font-size: 0.78rem;
    padding: 0.4rem 0.6rem;
    margin-bottom: 0.55rem;
    line-height: 1.35;
  }
  .ios-card-footer { padding-top: 0.45rem; font-size: 0.74rem; flex-wrap: wrap; gap: 0.35rem; }
  .ios-card-dates { font-size: 0.74rem; }

  /* DATE PICKER */
  .ios-date-input-container { flex-direction: column; align-items: stretch; gap: 0.4rem; }
  .ios-date-interactive-bar { width: 100%; justify-content: flex-start; flex-wrap: wrap; gap: 0.35rem; }
  .ios-date-type-input { flex: 1; min-width: 110px; width: auto; font-size: 0.79rem; padding: 0.36rem 0.55rem; }
  .ios-date-pill-btn { padding: 0.36rem 0.58rem; font-size: 0.75rem; }
  .ios-calendar-sheet { padding: 0.65rem 0.45rem; border-radius: 13px; }
  .ios-cal-days-grid { gap: 1px; }
  .ios-cal-day { max-width: 36px; max-height: 36px; min-height: 32px; font-size: 0.8rem; }

  /* MODAL → bottom sheet */
  .ios-modal-backdrop { align-items: flex-end; padding: 0; }
  .ios-bottom-sheet {
    max-height: 92vh;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-top-left-radius: var(--radius-xl);
    border-top-right-radius: var(--radius-xl);
    width: 100%;
    max-width: 100%;
    padding: 0.7rem 1rem calc(1.5rem + env(safe-area-inset-bottom, 0px)) 1rem;
    animation: iosSheetSlideUp 0.3s var(--apple-sheet);
  }

  /* FORM FIELDS */
  .ios-input-label { width: 88px; font-size: 0.82rem; }
  .ios-text-input, .ios-textarea-input { font-size: 0.86rem; }

  /* EXPIRED SECTION */
  .ios-expired-section { padding-top: 0.9rem; }
}

/* ---- Small Phone (≤430px) ---- */
@media (max-width: 430px) {
  .ios-app-container { padding: 0.4rem 0.5rem 7rem 0.5rem; }

  .ios-nav-bar { padding: 0.38rem 0.55rem; top: 0.28rem; }
  .ios-aust-logo-frame { width: 27px; height: 27px; border-radius: 7px; }
  .ios-subhead { font-size: 0.52rem; }
  .ios-nav-date { font-size: 0.62rem; }
  .ios-pill-btn { padding: 0.3rem 0.4rem; }

  .ios-large-title { font-size: 1.4rem; }
  .ios-large-subtitle { font-size: 0.74rem; }

  .ios-widgets-grid { gap: 0.28rem !important; }
  .ios-widget { padding: 0.55rem 0.25rem !important; }
  .ios-widget-icon-bg { width: 20px; height: 20px; }
  .ios-widget-icon-bg svg { width: 11px; height: 11px; }
  .ios-widget-label { font-size: 0.49rem; }
  .ios-widget-num { font-size: 1.2rem; }

  .ios-secondary-filters .ios-dropdown-trigger { font-size: 0.72rem; padding: 0.36rem 0.45rem; }
  .ios-secondary-filters .ios-dropdown-label { max-width: 78px; }

  .ios-card { padding: 0.7rem 0.72rem; }
  .ios-card-title { font-size: 0.85rem; }
  .ios-card-topics { font-size: 0.74rem; }
  .ios-section-title { font-size: 0.9rem; }

  .ios-fab { width: 50px; height: 50px; right: 0.9rem; }
}

/* ---- Extra-small (≤360px) ---- */
@media (max-width: 360px) {
  .ios-subhead { display: none; }
  .ios-nav-date { font-size: 0.64rem; font-weight: 700; }
  .ios-aust-logo-frame { width: 25px; height: 25px; }
  .ios-large-title { font-size: 1.25rem; }
  .ios-secondary-filters .ios-dropdown-label { max-width: 65px; font-size: 0.68rem; }
}

/* ==========================================================================
   AUST CSE Floating Footer & Ambient CTA Banner (Apple HIG Edition)
   ========================================================================== */
.graphy-footer-section {
  width: 100%;
  max-width: 1220px;
  margin: 3.8rem auto 1rem auto;
  position: relative;
  z-index: 2;
  box-sizing: border-box;
}

/* --- 1. Compact Glowing Ambient CTA Card --- */
.graphy-cta-card {
  position: relative;
  border-radius: var(--radius-xl);
  background: radial-gradient(ellipse 90% 80% at 50% -20%, #20232a 0%, #111317 65%, #08090b 100%);
  padding: 3.4rem 1.8rem 3.6rem 1.8rem;
  overflow: hidden;
  text-align: center;
  box-shadow: 0 16px 45px -12px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  border: 0.5px solid rgba(255, 255, 255, 0.1);
  transition: transform 0.25s var(--spring-smooth);
}

.graphy-cta-radial-glow {
  position: absolute;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 280px;
  background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.03) 50%, transparent 75%);
  filter: blur(40px);
  pointer-events: none;
}

.graphy-cta-inner {
  position: relative;
  z-index: 2;
  max-width: 600px;
  margin: 0 auto;
}

.graphy-cta-title {
  font-family: var(--ios-font);
  font-size: clamp(1.75rem, 3.2vw, 2.45rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.18;
  color: #ffffff;
  margin-bottom: 0.75rem;
}

.graphy-cta-sub {
  font-size: clamp(0.9rem, 1.4vw, 1.02rem);
  line-height: 1.55;
  color: #989eb0;
  max-width: 520px;
  margin: 0 auto 1.8rem auto;
}

.graphy-cta-action-row {
  display: flex;
  justify-content: center;
  align-items: center;
}

.graphy-cta-pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  color: #0b0c0e;
  font-family: var(--ios-font);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.78rem 1.9rem;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2), 0 0 20px rgba(255, 255, 255, 0.15);
  transition: transform 0.2s var(--spring-bounce), box-shadow 0.2s ease, background-color 0.2s ease;
}

.graphy-cta-pill-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3), 0 0 25px rgba(255, 255, 255, 0.22);
  background: #f4f4f7;
}

.graphy-cta-pill-btn:active {
  transform: scale(0.96);
}

/* --- 2. Main Floating Footer Card --- */
.graphy-footer-card {
  position: relative;
  z-index: 2;
  margin-top: 1.4rem;
  background: var(--ios-card-bg);
  border-radius: var(--radius-xl);
  border: 0.5px solid var(--ios-separator);
  box-shadow: 0 14px 38px -10px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.02);
  padding: 3rem 3.2rem 2rem 3.2rem;
  box-sizing: border-box;
  transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

body.ios-theme-dark .graphy-footer-card {
  background: #18191c;
  border: 0.5px solid var(--ios-separator);
  box-shadow: 0 18px 45px -12px rgba(0, 0, 0, 0.55);
}

.graphy-footer-content-grid {
  display: grid;
  grid-template-columns: 1.25fr 1.75fr;
  gap: 3.5rem;
  align-items: start;
}

/* Left Brand Col */
.graphy-brand-col {
  display: flex;
  flex-direction: column;
}

.graphy-brand-header {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.85rem;
}

.graphy-brand-badge {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: #0b0c0e;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
  transition: transform 0.2s var(--spring-bounce);
}

body.ios-theme-dark .graphy-brand-badge {
  background: #ffffff;
  color: #0b0c0e;
}

.graphy-brand-title {
  font-size: 1.24rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--ios-label);
}

.graphy-brand-tagline {
  font-size: 0.85rem;
  line-height: 1.52;
  color: var(--ios-secondary-label);
  opacity: 0.85;
  max-width: 360px;
  margin-bottom: 1.35rem;
}

.graphy-social-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.graphy-social-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 33px;
  height: 33px;
  border-radius: var(--radius-sm);
  color: var(--ios-label);
  opacity: 0.75;
  background: var(--ios-card-subtle);
  border: 0.5px solid var(--ios-separator);
  transition: all 0.2s var(--spring-smooth);
  text-decoration: none;
  cursor: pointer;
}

.graphy-social-icon-btn:hover {
  opacity: 1;
  color: var(--ios-blue);
  border-color: var(--ios-blue);
  transform: translateY(-2px);
}

/* Right Links Columns */
.graphy-links-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.2rem;
}

.graphy-column {
  display: flex;
  flex-direction: column;
}

.graphy-col-header {
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ios-label);
  margin-bottom: 1rem;
}

.graphy-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.72rem;
}

.graphy-nav-link {
  font-size: 0.84rem;
  color: var(--ios-secondary-label);
  opacity: 0.8;
  text-decoration: none;
  transition: color 0.18s ease, transform 0.18s ease, opacity 0.18s ease;
  display: inline-block;
  cursor: pointer;
}

.graphy-nav-link:hover {
  color: var(--ios-blue);
  opacity: 1;
  transform: translateX(2px);
}

/* Divider */
.graphy-card-divider {
  width: 100%;
  height: 0.5px;
  background: var(--ios-separator);
  margin: 2.4rem 0 1.4rem 0;
}

/* Bottom Bar */
.graphy-footer-bottom-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.graphy-copyright-text {
  font-size: 0.8rem;
  color: var(--ios-tertiary-label);
  font-weight: 400;
}

.graphy-legal-group {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.graphy-legal-badge {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.18rem 0.55rem;
  border-radius: var(--radius-full);
  background: var(--ios-card-subtle);
  color: var(--ios-secondary-label);
  border: 0.5px solid var(--ios-separator);
}

.graphy-legal-item {
  font-size: 0.8rem;
  color: var(--ios-secondary-label);
  opacity: 0.85;
  text-decoration: none;
  transition: color 0.16s ease;
  cursor: pointer;
}

.graphy-legal-item:hover {
  color: var(--ios-label);
  opacity: 1;
  text-decoration: underline;
}

.graphy-back-to-top {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: transparent;
  border: none;
  font-family: var(--ios-font);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ios-blue);
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-xs);
  transition: transform 0.2s var(--spring-bounce), opacity 0.15s ease;
}

.graphy-back-to-top:hover {
  transform: translateY(-2px);
  opacity: 0.85;
}

/* --- 3. Giant Faint Background Watermark Typography --- */
.graphy-watermark-container {
  position: relative;
  width: 100%;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  margin-top: -50px;
  height: 130px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 1;
}

.graphy-watermark-text {
  font-family: var(--ios-font);
  font-size: clamp(3.8rem, 11.5vw, 9.5rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 0.72;
  text-align: center;
  color: rgba(60, 60, 67, 0.045);
  -webkit-text-stroke: 1px rgba(60, 60, 67, 0.04);
  transform: translateY(6%);
  white-space: nowrap;
}

body.ios-theme-dark .graphy-watermark-text {
  color: rgba(255, 255, 255, 0.035);
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.03);
}

/* --- Responsive Breakpoints for Graphy Footer --- */
@media (max-width: 960px) {
  .graphy-footer-content-grid {
    grid-template-columns: 1fr;
    gap: 2.2rem;
  }
  .graphy-cta-card {
    padding: 3rem 1.4rem;
  }
  .graphy-footer-card {
    padding: 2.5rem 1.8rem 1.8rem 1.8rem;
  }
  .graphy-watermark-container {
    margin-top: -30px;
    height: 95px;
  }
}

@media (max-width: 640px) {
  .graphy-footer-section {
    margin-top: 2.8rem;
    margin-bottom: 5.5rem;
  }
  .graphy-links-columns {
    grid-template-columns: 1fr 1fr;
    gap: 1.6rem;
  }
  .graphy-footer-bottom-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
  }
  .graphy-legal-group {
    flex-wrap: wrap;
    gap: 0.9rem;
  }
  .graphy-cta-title {
    font-size: 1.65rem;
  }
  .graphy-footer-card {
    padding: 2rem 1.25rem 1.6rem 1.25rem;
    border-radius: var(--radius-lg);
  }
  .graphy-cta-card {
    border-radius: var(--radius-lg);
    padding: 2.6rem 1.1rem;
  }
  .graphy-watermark-container {
    margin-top: -15px;
    height: 70px;
  }
}


