/* ── MISCH INSTITUTE — SESSION 2 APP ── */
:root {
  --red:       #DB0032;
  --red-light: #FF1A4A;
  --red-dim:   rgba(219,0,50,0.12);
  --bg:        #0D0D0D;
  --surface:   #161616;
  --surface2:  #1E1E1E;
  --surface3:  #262626;
  --border:    rgba(255,255,255,0.07);
  --text:      #F5F5F5;
  --text-sec:  #999999;
  --text-dim:  #666666;
  --white:     #FFFFFF;
  --tab-h:     64px;
  --header-h:  60px;
  --radius:    12px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; overscroll-behavior: none; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  overflow: hidden;
}

/* ── HEADER ── */
.app-header {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 16px;
  z-index: 100;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.header-logo {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  margin-right: 10px; flex-shrink: 0;
}
.header-logo img { width: 100%; height: 100%; object-fit: contain; }

.header-text { flex: 1; min-width: 0; }
.header-title {
  font-size: 15px; font-weight: 700;
  color: var(--white); letter-spacing: -0.2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.header-sub {
  font-size: 11px; color: var(--text-sec);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.header-badge {
  background: var(--red-dim);
  color: var(--red);
  font-size: 11px; font-weight: 600;
  padding: 3px 8px; border-radius: 20px;
  border: 1px solid rgba(219,0,50,0.3);
  flex-shrink: 0; margin-left: 8px;
}

/* ── CONTENT AREA ── */
.content-area {
  position: fixed;
  top: var(--header-h);
  bottom: var(--tab-h);
  left: 0; right: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.tab-panel { display: none; padding: 16px; padding-bottom: 24px; }
.tab-panel.active { display: block; }

/* ── BOTTOM TAB BAR ── */
.tab-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--tab-h);
  background: rgba(13,13,13,0.96);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 100;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.tab-item {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px;
  cursor: pointer;
  transition: all 0.15s ease;
  color: var(--text-dim);
  padding: 0 4px;
  border: none; background: none;
  -webkit-appearance: none;
}
.tab-item.active { color: var(--red); }
.tab-item svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tab-item.active svg { stroke: var(--red); }
.tab-label { font-size: 10px; font-weight: 500; letter-spacing: 0.2px; }

/* ── HOME TAB ── */
.home-logo { display: flex; justify-content: center; padding: 4px 0 16px; }
.home-logo img { width: 60%; max-width: 220px; height: auto; }

.hero {
  background: linear-gradient(135deg, var(--surface) 0%, #1a0008 100%);
  border-radius: var(--radius);
  padding: 24px 20px;
  margin-bottom: 16px;
  border: 1px solid rgba(219,0,50,0.2);
  position: relative; overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; top: -40px; right: -40px;
  width: 150px; height: 150px;
  background: radial-gradient(circle, rgba(219,0,50,0.15) 0%, transparent 70%);
  pointer-events: none;
}
.hero-session {
  font-size: 11px; font-weight: 700; letter-spacing: 1.5px;
  color: var(--red); text-transform: uppercase; margin-bottom: 6px;
}
.hero-title {
  font-size: 22px; font-weight: 800;
  color: var(--white); line-height: 1.2;
  letter-spacing: -0.5px; margin-bottom: 4px;
}
.hero-subtitle {
  font-size: 13px; color: var(--text-sec); margin-bottom: 16px;
}
.hero-meta {
  display: flex; flex-direction: column; gap: 6px;
}
.hero-meta-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-sec);
}
.hero-meta-item svg {
  width: 14px; height: 14px;
  stroke: var(--red); fill: none; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0;
}
.hero-meta-item span { color: var(--text); }

.section-title {
  font-size: 11px; font-weight: 700; letter-spacing: 1px;
  color: var(--text-dim); text-transform: uppercase;
  margin: 20px 0 10px;
}

/* ── CARDS ── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  transition: border-color 0.15s, background 0.15s;
}
.card:active { background: var(--surface2); }

.card-row {
  display: flex; align-items: center; gap: 12px;
}
.card-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.card-icon.red { background: var(--red-dim); }
.card-icon.red svg { stroke: var(--red); fill: none; }
.card-icon.white { background: rgba(255,255,255,0.06); }
.card-icon.white svg { stroke: var(--text-sec); fill: none; }
.card-icon svg { width: 20px; height: 20px; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.card-body { flex: 1; min-width: 0; }
.card-title { font-size: 14px; font-weight: 600; color: var(--white); }
.card-sub { font-size: 12px; color: var(--text-sec); margin-top: 2px; }
.card-arrow { color: var(--text-dim); font-size: 18px; flex-shrink: 0; }

a.card { text-decoration: none; display: block; cursor: pointer; }
a.card:active { opacity: 0.8; }

/* ── SCHEDULE ── */
.day-header {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 0 8px;
}
.day-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--red); flex-shrink: 0;
}
.day-label { font-size: 14px; font-weight: 700; color: var(--white); }
.day-date { font-size: 12px; color: var(--text-sec); margin-left: auto; }

.schedule-item {
  display: flex; gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.schedule-item:last-child { border-bottom: none; }
.sched-time {
  width: 68px; flex-shrink: 0;
  font-size: 12px; font-weight: 600; color: var(--text-sec);
  padding-top: 1px;
}
.sched-body { flex: 1; }
.sched-title { font-size: 14px; font-weight: 600; color: var(--white); }
.sched-sub { font-size: 12px; color: var(--text-sec); margin-top: 2px; }
.sched-tag {
  display: inline-block;
  font-size: 10px; font-weight: 600;
  padding: 2px 7px; border-radius: 4px;
  margin-top: 4px; text-transform: uppercase; letter-spacing: 0.5px;
}
.sched-tag.lecture { background: rgba(255,255,255,0.06); color: var(--text-sec); }
.sched-tag.lab { background: var(--red-dim); color: var(--red); }
.sched-tag.break { background: rgba(255,255,255,0.03); color: var(--text-dim); }
.sched-tag.social { background: rgba(100,200,100,0.1); color: #5cba6a; }

.day-block {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 4px 14px 14px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
}

/* ── FACULTY ── */
.faculty-card {
  display: flex; gap: 14px; align-items: flex-start;
}
.faculty-avatar {
  position: relative; overflow: hidden;
  width: 48px; height: 48px; border-radius: 24px;
  background: var(--red-dim);
  border: 2px solid rgba(219,0,50,0.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; color: var(--red);
  flex-shrink: 0;
}
.faculty-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.faculty-name { font-size: 15px; font-weight: 700; color: var(--white); }
.faculty-creds { font-size: 12px; color: var(--text-sec); margin-top: 2px; }
.faculty-role {
  display: inline-block; margin-top: 6px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.8px;
  padding: 2px 8px; border-radius: 4px; text-transform: uppercase;
}
.faculty-role.primary { background: var(--red-dim); color: var(--red); }
.faculty-role.secondary { background: rgba(255,255,255,0.06); color: var(--text-sec); }

/* ── FACULTY BIO ── */
.faculty-link { cursor: pointer; }
.faculty-chevron {
  width: 20px; height: 20px; margin-left: auto; align-self: center;
  stroke: var(--text-dim); fill: none; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0;
}

.bio-overlay {
  position: fixed; inset: 0;
  background: var(--bg);
  z-index: 300;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.28s cubic-bezier(0.32,0.72,0,1), visibility 0s linear 0.28s;
}
.bio-overlay.active {
  transform: translateX(0);
  visibility: visible;
  transition: transform 0.28s cubic-bezier(0.32,0.72,0,1);
}

.bio-topbar {
  position: sticky; top: 0; z-index: 2;
  background: rgba(13,13,13,0.92);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding-top: env(safe-area-inset-top, 0px);
  height: calc(var(--header-h) + env(safe-area-inset-top, 0px));
  display: flex; align-items: center;
}
.bio-back {
  display: flex; align-items: center; gap: 4px;
  background: none; border: none; cursor: pointer;
  color: var(--red); font-size: 16px; font-weight: 600;
  padding: 0 12px; height: 100%; font-family: inherit;
}
.bio-back svg {
  width: 22px; height: 22px; stroke: var(--red); fill: none;
  stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
}

.bio-body {
  padding: 28px 22px calc(40px + env(safe-area-inset-bottom, 0px));
  max-width: 640px; margin: 0 auto;
}
.bio-photo {
  position: relative;
  width: 104px; height: 104px; border-radius: 52px;
  margin: 0 auto 18px;
  background: rgba(255,255,255,0.06);
  border: 2px solid rgba(255,255,255,0.1);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  font-size: 34px; font-weight: 700; color: var(--text-sec);
}
.bio-photo.primary {
  background: var(--red-dim);
  border-color: rgba(219,0,50,0.3);
  color: var(--red);
}
.bio-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.bio-name { text-align: center; font-size: 22px; font-weight: 800; color: var(--white); letter-spacing: -0.3px; }
.bio-creds { text-align: center; font-size: 13px; color: var(--text-sec); margin-top: 4px; }
.bio-role {
  display: block; width: fit-content; margin: 12px auto 0;
  font-size: 10px; font-weight: 700; letter-spacing: 0.8px;
  padding: 3px 10px; border-radius: 4px; text-transform: uppercase;
  background: rgba(255,255,255,0.06); color: var(--text-sec);
}
.bio-role.primary { background: var(--red-dim); color: var(--red); }

.bio-text { margin-top: 24px; color: var(--text); font-size: 15px; line-height: 1.7; }
.bio-text p { margin-bottom: 14px; }
.bio-text p:last-child { margin-bottom: 0; }
.bio-placeholder { color: var(--text-dim); font-style: italic; text-align: center; }

.bio-video-label {
  margin: 26px 0 10px;
  font-size: 11px; font-weight: 700; letter-spacing: 1px;
  color: var(--text-dim); text-transform: uppercase;
}
.bio-video {
  width: 100%; display: block;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

/* ── EVAL BUTTON ── */
.eval-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 16px;
  background: var(--red);
  color: white; font-size: 15px; font-weight: 700;
  border-radius: var(--radius); border: none;
  cursor: pointer; text-decoration: none;
  letter-spacing: -0.2px;
  transition: opacity 0.15s;
  margin-top: 8px;
}
.eval-btn:active { opacity: 0.85; }
.eval-btn svg { width: 20px; height: 20px; stroke: white; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.eval-note {
  text-align: center; font-size: 12px; color: var(--text-dim);
  margin-top: 10px; padding: 0 20px; line-height: 1.6;
}

/* ── DIVIDER ── */
.divider { height: 1px; background: var(--border); margin: 8px 0; }

/* ── PILL CHIPS ── */
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip {
  font-size: 11px; font-weight: 600;
  padding: 4px 10px; border-radius: 20px;
  background: rgba(255,255,255,0.06);
  color: var(--text-sec); border: 1px solid var(--border);
}
.chip.red { background: var(--red-dim); color: var(--red); border-color: rgba(219,0,50,0.2); }
