/* Sub-pages: Rhytoma Academy, AI-Caregiver */
.sub-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  backdrop-filter: blur(16px);
  background: rgba(2, 6, 23, 0.78);
  border-bottom: 1px solid var(--border);
}
.back-link {
  color: var(--cyan-light);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
}
.back-link:hover { text-decoration: underline; }
.sub-title {
  font-weight: 700;
  color: #f8fafc;
  font-size: 0.95rem;
}
.sub-title.bn { font-family: 'Noto Sans Bengali', Inter, sans-serif; }
.manjulab-mini img { border-radius: 8px; border: 1px solid var(--border); }

.header-uap-portal {
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}
.header-portal-mini.portal {
  width: 56px;
  height: 56px;
  display: block;
}
.header-portal-mini .portal-core {
  inset: 10%;
  padding: 0;
  overflow: hidden;
}
.header-uap-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  background: #fff;
}
.school-card--compact {
  grid-template-columns: 1fr;
}

.sub-main {
  position: relative;
  z-index: 5;
  max-width: 960px;
  margin: 0 auto;
  padding: 28px 20px 80px;
}

.hero-block { margin-bottom: 28px; }
.hero-block h1 {
  font-size: clamp(1.75rem, 4vw, 2.4rem);
  color: #f8fafc;
  margin: 8px 0 12px;
}
body.lang-bn .hero-block h1.hero-bn {
  font-family: 'Noto Sans Bengali', Inter, sans-serif;
}

.lang-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.api-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.5);
  margin-bottom: 20px;
}
.api-status .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #64748b;
}
.api-status.online .dot { background: #22c55e; box-shadow: 0 0 8px #22c55e; }
.api-status.offline .dot { background: #f59e0b; }
.api-endpoint {
  font-size: 0.7rem;
  opacity: 0.75;
  margin-left: 4px;
}
.api-status.online .api-endpoint { display: inline !important; }

.embed-offline {
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-disabled {
  opacity: 0.45;
  pointer-events: none;
}
.chat-form textarea:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.school-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  align-items: start;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 20px;
  padding: 22px;
  margin-bottom: 28px;
  backdrop-filter: blur(12px);
}
.school-title-link {
  color: inherit;
  text-decoration: none;
}
.school-title-link:hover { color: var(--cyan-light); }
.school-logo {
  width: 88px;
  height: 88px;
  border-radius: 16px;
  object-fit: contain;
  background: #fff;
  padding: 6px;
  border: 1px solid var(--border);
}
.school-card h2 {
  font-size: 1.15rem;
  color: #f1f5f9;
  margin-bottom: 6px;
}
body.lang-bn .school-card h2 { font-family: 'Noto Sans Bengali', Inter, sans-serif; }
.school-card .meta {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 10px;
}
.school-card p {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.55;
}
.school-card a.wiki {
  color: var(--cyan-light);
  font-size: 0.85rem;
  display: inline-block;
  margin-right: 14px;
  margin-top: 4px;
}
.uap-page-link { font-weight: 600; }
.school-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.school-facts span {
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--cyan-light);
  background: rgba(6, 182, 212, 0.08);
}

.tool-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.tool-tab {
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.55);
  color: var(--muted);
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
}
.tool-tab.active {
  background: var(--cyan);
  color: #020617;
  border-color: transparent;
}

.tool-panel { display: none; }
.tool-panel.active { display: block; animation: rise 0.4s ease both; }

.chat-panel {
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--panel);
  padding: 20px;
  backdrop-filter: blur(12px);
}
.chat-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}
.chat-controls select,
.chat-controls input {
  background: rgba(2, 6, 23, 0.6);
  border: 1px solid var(--border);
  color: #e2e8f0;
  padding: 8px 12px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.88rem;
}
.chat-controls input { flex: 1; min-width: 140px; }
.chat-log {
  min-height: 160px;
  max-height: 320px;
  overflow-y: auto;
  padding: 14px;
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.5);
  border: 1px solid var(--border);
  margin-bottom: 12px;
  font-size: 0.9rem;
}
.chat-msg { margin-bottom: 12px; }
.chat-msg.user { color: var(--cyan-light); }
.chat-msg.bot { color: var(--muted); white-space: pre-wrap; }
.chat-form textarea {
  width: 100%;
  min-height: 80px;
  background: rgba(2, 6, 23, 0.6);
  border: 1px solid var(--border);
  color: #e2e8f0;
  padding: 12px;
  border-radius: 12px;
  font-family: inherit;
  resize: vertical;
}
.chat-form .actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.embed-full iframe {
  width: 100%;
  height: min(640px, 75vh);
  border: none;
  border-radius: 16px;
  background: #f8fafc;
}
.embed-full {
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.5);
}

@media (max-width: 560px) {
  .school-card { grid-template-columns: 1fr; text-align: center; }
  .school-logo { margin: 0 auto; }
}
