:root {
  /* Extension Light Academic Theme Tokens */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-border: #bfdbfe;
  
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-hover: #f1f5f9;
  --surface-border: #e2e8f0;
  --surface-border-strong: #cbd5e1;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;

  --danger: #ef4444;
  --danger-light: #fef2f2;
  --danger-border: #fecaca;

  --warning: #f59e0b;
  --warning-light: #fffbeb;

  --success: #10b981;
  --success-light: #ecfdf5;
  --success-border: #a7f3d0;

  /* Permanent Course Colors */
  --course-intro-eng: #7c7c7c;
  --course-calc: #da5234;
  --course-physics: #4b99d2;
  --course-english: #525252;
  --course-islamic: #489160;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.15);

  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg);
  color: var(--text-main);
  line-height: 1.45;
  font-size: 13.5px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  padding-bottom: calc(20px + var(--safe-bottom));
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--surface-border);
  padding-top: var(--safe-top);
  box-shadow: var(--shadow-sm);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 8px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-bolt {
  width: 30px;
  height: 30px;
  background: linear-gradient(135deg, #1e3a8a, #3b82f6);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 16px;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 4px;
}

.brand-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  background: #dbeafe;
  color: #1e40af;
  border-radius: var(--radius-full);
}

.brand-subtitle {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.wifi-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: var(--radius-full);
  background: var(--success-light);
  color: #059669;
  border: 1px solid var(--success-border);
  min-height: 28px;
}

.wifi-status-badge.offline {
  background: var(--warning-light);
  color: #d97706;
  border-color: #fde68a;
}

.wifi-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: currentColor;
}

.btn-icon {
  width: 34px;
  height: 34px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-icon:hover, .btn-icon:active {
  background: var(--bg);
  color: var(--text-main);
  border-color: var(--surface-border-strong);
}

.refresh-icon {
  font-size: 15px;
  display: inline-block;
}

.refresh-spinning {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.sync-banner {
  background: #f1f5f9;
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  padding: 4px 12px;
  border-top: 1px solid var(--surface-border);
  border-bottom: 1px solid var(--surface-border);
}

/* Main Navigation Tabs: Segmented Control (matches extension exactly) */
.app-nav {
  display: flex;
  gap: 4px;
  background: #f1f5f9;
  padding: 3px;
  border-radius: 8px;
  margin: 8px 12px 10px;
}

.nav-item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 44px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
}

.nav-item:active {
  background: rgba(0, 0, 0, 0.04);
}

.nav-item.active {
  background: var(--surface);
  color: #1e40af;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.nav-icon {
  font-size: 15px;
}

.badge-count {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  background: #dbeafe;
  color: #1e40af;
  margin-left: 2px;
}

/* ==========================================================================
   Main Content Layout
   ========================================================================== */
.app-main {
  flex: 1;
  padding: 6px 12px 16px;
  max-width: 580px;
  width: 100%;
  margin: 0 auto;
}

.view-section {
  display: none;
}

.view-section.active {
  display: block;
}

/* ==========================================================================
   VIEW 1: Monthly Calendar (matches extension)
   ========================================================================== */
.calendar-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.month-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.month-heading {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-main);
  min-width: 130px;
}

.cal-nav-btn {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.12s;
}

.cal-nav-btn:hover, .cal-nav-btn:active {
  background: #f1f5f9;
  color: var(--text-main);
}

.btn-today {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0 12px;
  min-height: 44px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.12s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-today:hover, .btn-today:active {
  background: #f1f5f9;
  color: var(--primary);
  border-color: var(--surface-border-strong);
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-subtle);
  padding-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  background: #e2e8f0;
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--surface-border);
  margin-bottom: 10px;
}

.cal-day-cell {
  background: var(--surface);
  min-height: 58px;
  padding: 3px 4px;
  border-radius: 5px;
  display: flex;
  flex-direction: column;
  transition: all 0.12s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  user-select: none;
}

.cal-day-cell:hover, .cal-day-cell:active {
  background: #f8fafc;
  box-shadow: inset 0 0 0 1.5px #cbd5e1;
}

.cal-day-cell.other-month {
  background: #fcfdfd;
  opacity: 0.38;
}

.cal-day-cell.is-today {
  box-shadow: inset 0 0 0 2px var(--primary) !important;
  background: #f0f7ff;
}

.cal-day-cell.is-today .day-number {
  font-weight: 800;
  color: var(--primary);
}

.cal-day-cell.is-selected {
  box-shadow: inset 0 0 0 2px #0f172a !important;
  background: #f8fafc;
}

.day-number {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1;
  margin-bottom: 2px;
}

/* Event Chips inside calendar cells (matches extension) */
.cal-event-chips-container {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 1px;
  overflow: hidden;
}

.cal-event-chip {
  font-size: 9.5px;
  font-weight: 700;
  line-height: 1.25;
  padding: 2px 4px;
  border-radius: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: white;
  border-left: 2px solid rgba(0, 0, 0, 0.25);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  display: block;
}

.cal-event-chip.is-completed {
  background-color: #94a3b8 !important;
  color: #f8fafc !important;
  text-decoration: line-through;
  opacity: 0.65;
  border-left-color: #64748b !important;
  box-shadow: none;
}

.cal-event-more {
  font-size: 8.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-align: right;
  padding-right: 2px;
}

/* Course Legend Bar (matches extension) */
.course-legend-panel {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin-bottom: 10px;
}

.legend-header {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-subtle);
  text-transform: uppercase;
  flex-shrink: 0;
}

.legend-items {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  padding: 2px 6px;
  border-radius: 4px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.legend-color-box {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.calendar-tip {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  padding: 4px;
}

/* ==========================================================================
   VIEW 2: Deadlines List & Filters (matches extension)
   ========================================================================== */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.stat-pill {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
}

.stat-num {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
}

.stat-txt {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 2px;
}

.stat-urgent .stat-num { color: var(--danger); }
.stat-week .stat-num { color: var(--primary); }
.stat-total .stat-num { color: var(--success); }

.search-toolbar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.search-input-box {
  position: relative;
  width: 100%;
}

.search-field {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px 8px 34px;
  font-size: 12.5px;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-main);
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s;
}

.search-field:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  color: var(--text-subtle);
  pointer-events: none;
}

.filter-chips {
  display: flex;
  gap: 6px;
}

.filter-chip {
  padding: 6px 12px;
  min-height: 38px;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  background: #f1f5f9;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.filter-chip.active {
  background: #dbeafe;
  color: #1e40af;
  border-color: #bfdbfe;
}

.filter-dropdowns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.mobile-select {
  width: 100%;
  min-height: 42px;
  padding: 4px 8px;
  font-size: 11.5px;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-main);
  outline: none;
  cursor: pointer;
  font-family: inherit;
}

/* Task Cards (matches extension) */
.deadlines-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.task-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 11px 13px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  transition: all 0.15s ease;
  border-left-width: 4px;
}

.task-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--surface-border-strong);
}

.task-card.is-completed {
  opacity: 0.65;
  background: #f8fafc;
}

.task-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.course-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  color: #ffffff;
}

.task-due-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  background: #f1f5f9;
  color: var(--text-muted);
}

.task-due-badge.urgent {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid var(--danger-border);
}

.task-title-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.status-checkbox-btn {
  width: 26px;
  height: 26px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  border: 2px solid var(--surface-border-strong);
  background: transparent;
  color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-top: -2px;
  flex-shrink: 0;
  transition: all 0.15s;
}

.status-checkbox-btn:hover {
  border-color: var(--success);
}

.status-checkbox-btn.checked {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
  font-size: 13px;
}

.task-title-text {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
  flex: 1;
}

.task-card.is-completed .task-title-text {
  text-decoration: line-through;
  color: var(--text-muted);
}

.task-metadata-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
}

.meta-pill {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: #f1f5f9;
  color: var(--text-muted);
}

.meta-pill.weight {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.meta-pill.time-class {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

/* Doctor's announcement quote (matches extension) */
.doctor-quote-box {
  background: #f8fafc;
  border: 1px solid var(--surface-border);
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 7px 10px;
  margin-top: 4px;
}

.quote-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: #1e40af;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.quote-body {
  font-size: 11.5px;
  font-style: italic;
  color: var(--text-main);
  line-height: 1.4;
  white-space: pre-line;
}

/* ==========================================================================
   VIEW 3: Schedule & Syllabus Cards (matches extension)
   ========================================================================== */
.info-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
}

.info-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.info-card-title-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-icon {
  font-size: 16px;
}

.info-card-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
}

.info-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

.info-badge.green {
  background: #d1fae5;
  color: #065f46;
}

.info-badge.blue {
  background: #dbeafe;
  color: #1e40af;
}

.info-card-desc {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 10px;
}

.schedule-timeline {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.schedule-row {
  background: #f8fafc;
  border: 1px solid var(--surface-border);
  border-left-width: 4px;
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.schedule-course-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.schedule-course-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
}

.schedule-days-badge {
  font-size: 10.5px;
  color: var(--text-muted);
}

.schedule-time-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  background: #eff6ff;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.syllabus-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.syllabus-item-card {
  background: #f8fafc;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}

.syllabus-item-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 3px;
}

.syllabus-item-details {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.35;
}

/* ==========================================================================
   VIEW 4: Cloud Settings, Push Alerts & WebCal
   ========================================================================== */
.settings-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
}

.settings-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 8px;
}

.settings-icon-title {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.settings-card-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
}

.settings-card-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

.settings-card-desc {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 10px;
}

/* Toggle Switch */
.toggle-control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  border: 1px solid var(--surface-border);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  min-height: 52px;
}

.toggle-text-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toggle-main-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-main);
}

.toggle-status-desc {
  font-size: 11px;
  color: var(--text-muted);
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
  flex-shrink: 0;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: .25s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .25s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

input:checked + .slider {
  background-color: var(--primary);
}

input:checked + .slider:before {
  transform: translateX(22px);
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

.notification-timing-notes {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 11px;
  color: var(--text-main);
  background: #f8fafc;
  border: 1px solid var(--surface-border);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
}

.timing-item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  line-height: 1.35;
}

.timing-bullet {
  font-size: 11.5px;
  flex-shrink: 0;
}

/* Action Buttons */
.card-action-bar {
  display: flex;
  gap: 8px;
}

.calendar-action-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.btn-primary-action {
  min-height: 44px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(135deg, #1e40af, #2563eb);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
  transition: all 0.15s ease;
}

.btn-primary-action:hover, .btn-primary-action:active {
  background: linear-gradient(135deg, #1d4ed8, #3b82f6);
  transform: translateY(-1px);
}

.btn-outline-action {
  min-height: 44px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-outline-action:hover, .btn-outline-action:active {
  background: #f1f5f9;
  border-color: var(--surface-border-strong);
}

.feed-url-display {
  background: #f8fafc;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  margin-bottom: 10px;
}

.feed-url-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-subtle);
  display: block;
  margin-bottom: 3px;
}

.feed-url-code {
  font-size: 11px;
  font-family: monospace;
  color: #1e40af;
  word-break: break-all;
  line-height: 1.35;
}

.instructions-details {
  border-top: 1px solid var(--surface-border);
  padding-top: 8px;
  margin-top: 8px;
}

.instructions-summary {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  padding: 4px 0;
}

.instructions-content {
  padding: 6px 0;
  font-size: 11.5px;
  color: var(--text-muted);
}

.steps-list {
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  line-height: 1.4;
}

.sync-metrics {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #f8fafc;
  border: 1px solid var(--surface-border);
  padding: 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
}

.metric-label {
  color: var(--text-muted);
}

.metric-val {
  font-weight: 600;
  color: var(--text-main);
}

/* ==========================================================================
   DAY DRAWER (Bottom Sheet)
   ========================================================================== */
.day-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  z-index: 90;
  transition: opacity 0.2s ease;
}

.day-sheet-backdrop.hidden {
  display: none;
  opacity: 0;
}

.day-sheet-drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 580px;
  margin: 0 auto;
  background: var(--surface);
  border-top: 1px solid var(--surface-border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  z-index: 100;
  padding: 12px 16px calc(24px + var(--safe-bottom));
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  transform: translateY(0);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.day-sheet-drawer.hidden {
  display: none;
  transform: translateY(100%);
}

.day-sheet-drag-handle {
  display: flex;
  justify-content: center;
  padding-bottom: 6px;
}

.drag-pill {
  width: 36px;
  height: 4px;
  background: #cbd5e1;
  border-radius: 2px;
}

.day-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--surface-border);
  padding-bottom: 8px;
}

.day-sheet-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-main);
}

.day-sheet-count {
  font-size: 11.5px;
  color: var(--text-muted);
  display: block;
}

.btn-icon-close {
  width: 32px;
  height: 32px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
  border: 1px solid var(--surface-border);
  border-radius: 50%;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
}

.day-sheet-items {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 2px;
}

/* Empty, Loading, Error States */
.state-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
}

.state-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.state-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.state-desc {
  font-size: 12px;
  color: var(--text-muted);
  max-width: 280px;
  line-height: 1.4;
}

/* Toast Alerts */
.toast-container {
  position: fixed;
  bottom: calc(20px + var(--safe-bottom));
  left: 16px;
  right: 16px;
  max-width: 380px;
  margin: 0 auto;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: #0f172a;
  border: 1px solid #1e293b;
  color: #fff;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastIn 0.2s ease-out;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
