:root {
  --primary: #0b3d91;
  --primary-deep: #082b68;
  --secondary: #e65100;
  --bg: #f4f7fb;
  --card: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --border: #cbd5e1;
}

* {
  box-sizing: border-box;
  font-family: 'Segoe UI', system-ui, sans-serif;
}

body {
  background: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 15px;
}

.irpwm-container {
  max-width: 1000px;
  margin: 0 auto;
}

.hub-header {
  background: linear-gradient(135deg, var(--primary-deep), var(--primary), #1e56b3);
  color: white;
  padding: 24px;
  border-radius: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  box-shadow: 0 8px 24px rgba(11, 61, 145, 0.18);
}

.hub-eyebrow {
  margin: 0 0 8px;
  color: #bfeaff;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 1.4px;
}

.hub-header h1 {
  margin: 0;
  font-size: clamp(1.25rem, 3vw, 1.8rem);
  line-height: 1.3;
}

.hub-header p:not(.hub-eyebrow) {
  margin: 7px 0 0;
  font-size: 0.92rem;
  line-height: 1.5;
  opacity: 0.92;
}

.lang-btn {
  background: var(--secondary);
  color: white;
  border: 0;
  padding: 11px 16px;
  border-radius: 9px;
  font-weight: 800;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.2s, transform 0.2s;
}

.lang-btn:hover {
  background: #bf360c;
  transform: translateY(-1px);
}

.hub-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 16px 2px 4px;
}

.back-link {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
  font-size: 0.9rem;
}

.back-link:hover { text-decoration: underline; }

.library-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.search-box { margin: 18px 0; }

.search-box input {
  width: 100%;
  padding: 15px 18px;
  font-size: 1rem;
  border: 2px solid var(--primary);
  border-radius: 11px;
  outline: none;
  background: #fff;
  box-shadow: 0 3px 10px rgba(0,0,0,0.05);
}

.search-box input:focus {
  border-color: #168bd2;
  box-shadow: 0 0 0 3px rgba(22,139,210,0.14);
}

.folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.folder-card {
  width: 100%;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 5px solid var(--primary);
  border-radius: 11px;
  padding: 17px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
  box-shadow: 0 2px 7px rgba(0,0,0,0.04);
}

.folder-card:hover,
.folder-card.active {
  transform: translateY(-2px);
  border-left-color: var(--secondary);
  background: #fff8f3;
  box-shadow: 0 7px 16px rgba(15, 23, 42, 0.08);
}

.folder-title {
  display: block;
  font-weight: 800;
  font-size: 1rem;
  line-height: 1.45;
  color: var(--primary);
  margin-bottom: 5px;
}

.folder-desc {
  display: block;
  font-size: 0.84rem;
  line-height: 1.5;
  color: #475569;
}

.content-panel {
  background: var(--card);
  border-radius: 13px;
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  min-height: 140px;
}

.panel-heading {
  margin: 0 0 6px;
  color: var(--secondary);
  font-size: 1.12rem;
  border-bottom: 2px solid #f1f5f9;
  padding-bottom: 10px;
}

.rule-item {
  border-bottom: 1px solid #e2e8f0;
  padding: 16px 0;
}

.rule-item:last-child { border-bottom: 0; }

.rule-badge {
  display: inline-block;
  background: #e0e7ff;
  color: var(--primary);
  font-size: 0.74rem;
  font-weight: 800;
  padding: 4px 9px;
  border-radius: 5px;
  margin-bottom: 7px;
}

.rule-heading {
  font-size: 1.02rem;
  font-weight: 800;
  line-height: 1.45;
  margin: 0 0 7px;
  color: #0f172a;
}

.rule-text {
  font-size: 0.91rem;
  line-height: 1.7;
  margin: 0 0 8px;
  color: #334155;
  white-space: pre-line;
}

.action-link {
  display: inline-block;
  background: var(--primary);
  color: white;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 7px;
  font-size: 0.82rem;
  font-weight: 700;
  margin-top: 5px;
}

.action-link:hover { background: var(--primary-deep); }

.mini-tool {
  background: #f8fafc;
  border: 1px dashed var(--secondary);
  padding: 13px;
  border-radius: 9px;
  margin-top: 12px;
}

.mini-tool select {
  max-width: 100%;
  margin-top: 8px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.protection-result {
  margin-top: 9px;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--primary);
  font-weight: 700;
}

.empty-result {
  text-align: center;
  color: var(--muted);
  padding: 20px 8px;
}

.disclaimer {
  margin-top: 18px;
  font-size: 0.79rem;
  line-height: 1.6;
  color: #475569;
  background: #e8eef6;
  padding: 13px 15px;
  border-radius: 9px;
  border-left: 4px solid #64748b;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 600px) {
  body { padding: 10px; }
  .hub-header { padding: 18px; border-radius: 13px; }
  .hub-header > div { width: 100%; }
  .lang-btn { width: 100%; }
  .content-panel { padding: 15px; }
  .folder-grid { grid-template-columns: 1fr; }
}


/* Detailed P-Way knowledge pages */
.detailed-topic { padding: 20px 0; }
.detail-intro { font-weight: 600; color: #24364b; background: #f1f6fc; border-left: 4px solid var(--primary); border-radius: 7px; padding: 13px 15px; }
.detail-section { margin: 16px 0; padding: 14px 16px; background: #fbfdff; border: 1px solid #e2e8f0; border-radius: 9px; }
.detail-subheading { margin: 0 0 8px; color: var(--primary); font-size: 1rem; line-height: 1.5; }
.detail-body { margin: 0; white-space: pre-line; color: #334155; font-size: .94rem; line-height: 1.8; }
.search-folder-heading { margin: 22px 0 6px; padding: 10px 12px; border-radius: 8px; background: #eaf1fb; color: var(--primary); font-size: 1rem; }


/* Official source links shown at the top of the P-Way library */
.official-reference {
  margin: 14px 0 10px;
  padding: 14px;
  background: #eaf2ff;
  border: 1px solid #bfd3f2;
  border-radius: 12px;
}
.official-reference-title {
  margin: 0 0 9px;
  color: var(--primary-deep);
  font-size: .76rem;
  font-weight: 900;
  letter-spacing: .7px;
}
.official-reference-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 8px 0;
  padding: 12px 14px;
  border-radius: 9px;
  color: #fff;
  text-decoration: none;
  font-size: .9rem;
  line-height: 1.4;
  font-weight: 800;
  box-shadow: 0 3px 8px rgba(8,43,104,.12);
}
.official-reference-link span {
  flex: 0 0 auto;
  font-size: .75rem;
  font-weight: 700;
  opacity: .95;
}
.iricen-link { background: linear-gradient(110deg, #0b3d91, #1763bd); }
.board-link { background: linear-gradient(110deg, #125b45, #16805e); }
.official-reference small {
  display: block;
  margin-top: 8px;
  color: #475569;
  font-size: .74rem;
  line-height: 1.5;
}
@media (max-width: 600px) {
  .official-reference-link { align-items: flex-start; flex-direction: column; }
}

/* Hindi study reader */
.hindi-reader{margin:18px 0;padding:18px;border:1px solid #b8d5f5;border-radius:16px;background:linear-gradient(135deg,rgba(12,57,120,.08),rgba(0,188,212,.07))}
.hindi-reader-head{display:flex;gap:12px;align-items:center;justify-content:space-between;flex-wrap:wrap}
.hindi-reader h2{margin:0 0 8px;color:var(--primary,#0b3d91)}
.hindi-reader .reader-note{font-size:.88rem;opacity:.82;margin:8px 0 14px}
.reader-chapter{padding:14px;margin-top:12px;border-radius:12px;background:rgba(255,255,255,.72);border:1px solid rgba(80,130,190,.2)}
.reader-chapter h3{margin:0 0 10px}
.reader-chapter h4{margin:14px 0 6px}
.reader-chapter p{line-height:1.75;white-space:pre-line}
.reader-ref{font-size:.82rem;font-weight:700;color:#1261a0}
.reader-source{display:inline-block;margin-top:10px;font-weight:600}
