:root {
  --bg-deep: #041310;
  --bg-panel: #071e19;
  --bg-card: #092620;
  --bg-card-hover: #0d332b;
  --bg-elevated: #0b2d26;
  --bg-input: #041511;
  --gold: #e7c66b;
  --gold-bright: #f6dc8b;
  --gold-dim: rgba(231, 198, 107, 0.30);
  --emerald: #2ec48b;
  --cyan: #3ad6de;
  --text-main: #f3f7f5;
  --text-soft: #c4d7d0;
  --text-muted: #88a89d;
  --ar-bg: rgba(4, 19, 16, 0.72);
  --ar-color: #fff6dc;
  --danger: #ef6461;
  --warn: #f4b942;
  --topbar-h: 88px;
  --strip-w: 16px;
  --dock-h: 68px;
  --ar-font-size: 24px;
}

body.theme-day {
  --bg-deep: #f3f6f2;
  --bg-panel: #e7efe9;
  --bg-card: #ffffff;
  --bg-card-hover: #edf5f0;
  --bg-elevated: #e2ece6;
  --bg-input: #f8fbf9;
  --gold: #8d6812;
  --gold-bright: #6e4f06;
  --gold-dim: rgba(141, 104, 18, 0.28);
  --emerald: #0e7c55;
  --cyan: #0b6e79;
  --text-main: #0f261f;
  --text-soft: #26443b;
  --text-muted: #517066;
  --ar-bg: #f6f3e8;
  --ar-color: #0b241d;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  width: 100%;
  max-width: 100vw;
  min-height: 100vh;
  background: var(--bg-deep);
  color: var(--text-main);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  overflow-x: hidden;
}
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
button, select, input, textarea { font-family: inherit; }

/* TOP TWO-ROW COMMAND HEADER (10 DISTINCT CENTERS + TOOLS) */
.hak-topbar {
  position: fixed; top: 0; left: 0; right: 0; min-height: var(--topbar-h);
  background: linear-gradient(90deg, var(--bg-panel) 0%, var(--bg-elevated) 55%, var(--bg-panel) 100%);
  border-bottom: 1px solid var(--gold-dim);
  display: flex; flex-direction: column; justify-content: center;
  padding: 5px 12px 5px 8px; z-index: 1300; gap: 5px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.35);
}
.hak-top-row1, .hak-top-row2 {
  display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap;
}
.hak-top-centers {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap; flex: 1; min-width: 0;
}
.hak-center-btn {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(13,51,43,0.55); border: 1px solid var(--gold-dim);
  color: var(--text-main); border-radius: 7px; padding: 4px 8px;
  font-size: 11.2px; font-weight: 700; cursor: pointer; white-space: nowrap; transition: 0.14s;
  text-decoration: none !important;
}
body.theme-day .hak-center-btn { background: #ffffff; }
.hak-center-btn:hover { border-color: var(--gold); background: rgba(46,196,139,0.16); }
.hak-center-btn.active {
  background: linear-gradient(135deg, #165242, #0d362c);
  color: #f9e498; border-color: #e7c66b;
  box-shadow: 0 0 0 1px rgba(231,198,107,0.35);
}
body.theme-day .hak-center-btn.active {
  background: linear-gradient(135deg, #0e6b4a, #094d35);
  color: #fff8df;
}
.hak-menu-btn {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(231,198,107,0.12); border: 1px solid var(--gold-dim);
  color: var(--gold-bright); border-radius: 7px; padding: 4px 8px;
  font-size: 11.5px; font-weight: 800; cursor: pointer;
}
.hak-brand-link {
  display: inline-flex; align-items: center; gap: 7px;
  text-decoration: none !important; padding: 2px 7px 2px 3px;
  border-radius: 9px; border: 1px solid rgba(58,214,222,0.34);
  background: rgba(4,25,41,0.72);
}
body.theme-day .hak-brand-link { background: #072838; }
.hak-brand-logo { width: 28px; height: 28px; flex-shrink: 0; display: block; }
.hak-brand-txt { display: flex; flex-direction: column; line-height: 1.08; }
.hak-brand-title { font-size: 12px; font-weight: 800; letter-spacing: 0.5px; color: #ffffff; }
.hak-brand-sub { font-size: 9px; color: #9beCF4; font-weight: 600; }

.hak-quick-jump {
  display: inline-flex; align-items: center; background: var(--bg-input);
  border: 1px solid var(--gold-dim); border-radius: 7px; padding: 2px 4px 2px 7px; gap: 4px;
}
.hak-quick-jump input {
  width: 142px; background: transparent; border: none; color: var(--gold-bright);
  font-size: 11.5px; outline: none; font-weight: 600;
}
.hak-quick-jump button {
  background: var(--gold); color: #051814; border: none; border-radius: 5px;
  padding: 3px 7px; font-size: 10.5px; font-weight: 800; cursor: pointer;
}
body.theme-day .hak-quick-jump button { color: #ffffff; }

.hak-top-pill {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--bg-card); border: 1px solid var(--gold-dim);
  color: var(--text-main); border-radius: 7px; padding: 3px 8px;
  font-size: 11px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: 0.14s;
}
.hak-top-pill:hover, .hak-top-pill.active { border-color: var(--gold); background: var(--bg-card-hover); }
.hak-top-pill.toggle-on {
  background: rgba(46,196,139,0.22); border-color: var(--emerald); color: var(--gold-bright);
}
.hak-top-pill .gold { color: var(--gold-bright); font-weight: 800; }
.hak-lang-sel {
  background: var(--bg-input); color: var(--gold-bright); border: 1px solid var(--gold-dim);
  border-radius: 7px; padding: 3px 7px; font-size: 11px; font-weight: 700; cursor: pointer;
}

/* OPENCPN AUTO-HIDE STRIP & SLIDING DRAWER */
.hak-opencpn-strip {
  position: fixed; top: var(--topbar-h); left: 0; bottom: var(--dock-h); width: var(--strip-w);
  background: linear-gradient(180deg, #07241e 0%, #041511 50%, #07241e 100%);
  border-right: 1px solid rgba(231,198,107,0.42);
  z-index: 1180; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  user-select: none;
}
.hak-opencpn-strip:hover { background: #0d382f; width: 20px; }
.hak-strip-badge {
  writing-mode: vertical-rl; text-orientation: mixed; transform: rotate(180deg);
  font-size: 9.5px; font-weight: 800; letter-spacing: 1.4px; color: #e7c66b;
}
.hak-strip-chevron {
  width: 12px; height: 32px; border-radius: 0 6px 6px 0;
  background: rgba(231,198,107,0.18); border: 1px solid rgba(231,198,107,0.5);
  border-left: none; display: flex; align-items: center; justify-content: center;
  color: #f6dc8b; font-size: 10px; font-weight: 900;
}

.hak-left-drawer {
  position: fixed; top: var(--topbar-h); left: 0; bottom: var(--dock-h); width: 324px;
  background: linear-gradient(180deg, #061d18 0%, #041411 100%);
  border-right: 1px solid rgba(231,198,107,0.45);
  z-index: 1220; transform: translateX(-102%);
  transition: transform 0.18s cubic-bezier(0.2, 0.85, 0.25, 1);
  display: flex; flex-direction: column;
  box-shadow: 12px 0 36px rgba(0,0,0,0.65); color: #f3f7f5;
}
.hak-left-drawer.open, .hak-left-drawer.pinned { transform: translateX(0); }
.hak-drawer-head {
  padding: 8px 9px; border-bottom: 1px solid rgba(231,198,107,0.2);
  display: flex; align-items: center; gap: 5px; background: rgba(0,0,0,0.25); flex-wrap: wrap;
}
.hak-drawer-search {
  flex: 1; min-width: 130px; background: #03100d; border: 1px solid rgba(231,198,107,0.3);
  border-radius: 7px; padding: 5px 8px; color: #f3f7f5; font-size: 11.5px; outline: none;
}
.hak-pin-btn {
  background: rgba(231,198,107,0.12); border: 1px solid rgba(231,198,107,0.35);
  color: #e7c66b; border-radius: 6px; padding: 4px 7px; font-size: 10.5px;
  font-weight: 700; cursor: pointer; white-space: nowrap;
}
.hak-pin-btn.active { background: #e7c66b; color: #041511; }
.hak-drawer-list { flex: 1; overflow-y: auto; padding: 6px 7px 16px; }
.hak-nav-group-lbl {
  font-size: 9.5px; font-weight: 800; letter-spacing: 0.9px; color: #e7c66b;
  opacity: 0.85; padding: 8px 6px 4px; text-transform: uppercase;
}
.hak-nav-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; margin-bottom: 2px; border-radius: 8px;
  border: 1px solid transparent; cursor: pointer; transition: 0.12s; color: #bfd1ca;
}
.hak-nav-item:hover, .hak-nav-item.flyout-active {
  background: rgba(231,198,107,0.14); border-color: rgba(231,198,107,0.4); color: #ffffff;
}
.hak-nav-item.active {
  background: linear-gradient(90deg, rgba(46,196,139,0.25), rgba(231,198,107,0.16));
  border-color: #e7c66b; color: #ffffff;
}
.hak-nav-num {
  font-size: 10px; font-weight: 800; color: #f6dc8b;
  background: rgba(4,20,17,0.88); border: 1px solid rgba(231,198,107,0.38);
  border-radius: 5px; padding: 2px 5px; min-width: 24px; text-align: center;
}
.hak-nav-svg { width: 22px; height: 22px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.hak-nav-svg svg { width: 21px; height: 21px; display: block; }
.hak-nav-title { flex: 1; font-size: 12px; font-weight: 600; line-height: 1.25; }
.hak-nav-arrow { font-size: 10px; color: #e7c66b; }

.hak-flyout {
  position: fixed; top: var(--topbar-h); left: 324px; width: 380px;
  max-height: calc(100vh - var(--topbar-h) - var(--dock-h) - 6px);
  background: linear-gradient(180deg, #07231d 0%, #051814 100%);
  border: 1px solid rgba(231,198,107,0.55); border-left: none;
  border-radius: 0 0 12px 0; z-index: 1230; display: none; flex-direction: column;
  box-shadow: 16px 12px 40px rgba(0,0,0,0.72); color: #f3f7f5;
}
.hak-flyout.open { display: flex; }
.hak-flyout-head {
  padding: 10px 13px; border-bottom: 1px solid rgba(231,198,107,0.24);
  background: rgba(0,0,0,0.25); display: flex; align-items: center; gap: 10px;
}
.hak-flyout-head svg { width: 26px; height: 26px; flex-shrink: 0; }
.hak-flyout-htitle { font-size: 13px; font-weight: 800; color: #f6dc8b; }
.hak-flyout-hsub { font-size: 11px; color: #9ab8ae; margin-top: 2px; }
.hak-flyout-body { overflow-y: auto; padding: 8px 10px 14px; display: flex; flex-direction: column; gap: 4px; }
.hak-sub-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; text-align: left; background: rgba(9,38,32,0.82);
  border: 1px solid rgba(231,198,107,0.2); border-radius: 8px;
  padding: 6.5px 9px; color: #f3f7f5; font-size: 11.8px; font-weight: 600; cursor: pointer;
}
.hak-sub-btn:hover { background: rgba(231,198,107,0.2); border-color: #e7c66b; color: #f6dc8b; }
.hak-sub-btn .meta { font-size: 10.5px; color: #3ad6de; font-weight: 700; white-space: nowrap; }

/* MAIN STAGE */
.hak-main {
  margin-top: var(--topbar-h);
  margin-left: var(--strip-w);
  width: calc(100% - var(--strip-w));
  min-height: calc(100vh - var(--topbar-h) - var(--dock-h));
  padding: 16px 20px calc(var(--dock-h) + 36px);
  transition: margin-left 0.18s, width 0.18s;
}
body.drawer-pinned .hak-main {
  margin-left: 324px;
  width: calc(100% - 324px);
}

/* HERO, SHOWCASE CARDS & PANELS */
.hak-hero {
  position: relative; border-radius: 16px; overflow: hidden;
  border: 1px solid var(--gold-dim);
  background: radial-gradient(circle at 82% 28%, rgba(46,196,139,0.22), transparent 55%),
              linear-gradient(125deg, #06211b 0%, #092c24 55%, #051915 100%);
  padding: 22px 26px; margin-bottom: 14px; color: #f3f7f5;
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
}
.hak-hero-kicker {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 10.5px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase;
  color: #f6dc8b; background: rgba(231,198,107,0.14);
  border: 1px solid rgba(231,198,107,0.34); border-radius: 99px; padding: 3px 11px; margin-bottom: 8px;
}
.hak-hero h1 {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(22px, 2.4vw, 33px); color: #fff6dc; line-height: 1.18; margin-bottom: 7px;
}
.hak-hero p { color: #c9ddd6; font-size: 13.5px; max-width: 820px; line-height: 1.52; margin-bottom: 14px; }
.hak-hero-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.btn-gold {
  background: linear-gradient(135deg, #ebd07c, #c9a243); color: #041511;
  border: none; border-radius: 8px; padding: 8px 14px; font-size: 12.5px; font-weight: 800;
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.btn-gold:hover { filter: brightness(1.06); }
.btn-outline {
  background: var(--bg-card); color: var(--gold-bright);
  border: 1px solid var(--gold-dim); border-radius: 8px;
  padding: 7px 12px; font-size: 12px; font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
}
.btn-outline:hover { background: rgba(231,198,107,0.16); border-color: var(--gold); }
.btn-outline.active { background: var(--gold); color: #041511; border-color: var(--gold); }
body.theme-day .btn-outline.active { color: #ffffff; }
.btn-outline:disabled { opacity: 0.45; cursor: not-allowed; }

.hak-kpi-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px; margin-bottom: 14px;
}
.hak-kpi {
  background: var(--bg-card); border: 1px solid var(--gold-dim);
  border-radius: 12px; padding: 11px 13px; cursor: pointer; transition: 0.15s;
}
.hak-kpi:hover { border-color: var(--gold); transform: translateY(-1px); }
.hak-kpi .val { font-size: 16px; font-weight: 800; color: var(--gold-bright); margin-bottom: 2px; }
.hak-kpi .lbl { font-size: 11.2px; color: var(--text-soft); line-height: 1.35; }

/* EQUAL-HEIGHT SHOWCASE CARDS */
.hak-mod-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(265px, 1fr)); gap: 13px;
}
.hak-mod-card {
  background: var(--bg-card); border: 1px solid var(--gold-dim);
  border-radius: 13px; overflow: hidden; cursor: pointer; transition: 0.16s;
  display: flex; flex-direction: column; min-height: 248px;
}
.hak-mod-card:hover { border-color: var(--gold); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.32); }
.hak-mod-visual {
  height: 118px; position: relative; background: linear-gradient(135deg, #07261f, #041511);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  border-bottom: 1px solid var(--gold-dim); flex-shrink: 0;
}
.hak-mod-visual img { width: 100%; height: 100%; object-fit: cover; opacity: 0.85; }
.hak-mod-visual .emblem-fallback { width: 52px; height: 52px; }
.hak-mod-num-chip {
  position: absolute; top: 8px; left: 8px; background: rgba(4,20,17,0.90);
  border: 1px solid #e7c66b; color: #f6dc8b; font-size: 11px; font-weight: 800;
  padding: 2px 7px; border-radius: 6px; display: inline-flex; align-items: center; gap: 4px;
}
.hak-mod-num-chip svg { width: 14px; height: 14px; }
.hak-mod-meta-chip {
  position: absolute; bottom: 8px; right: 8px; background: rgba(4,20,17,0.90);
  border: 1px solid rgba(58,214,222,0.5); color: #3ad6de; font-size: 10.2px; font-weight: 700;
  padding: 2px 7px; border-radius: 6px;
}
.hak-mod-body { padding: 12px 14px 14px; flex: 1; display: flex; flex-direction: column; }
.hak-mod-cat { font-size: 10px; font-weight: 800; color: var(--emerald); letter-spacing: 0.7px; text-transform: uppercase; margin-bottom: 4px; }
.hak-mod-body h3 { font-size: 14.8px; font-weight: 800; color: var(--text-main); margin-bottom: 5px; }
.hak-mod-body p { font-size: 12px; color: var(--text-soft); line-height: 1.46; flex: 1; }

/* MODULE HEADERS & PANELS */
.mod-head {
  background: linear-gradient(90deg, var(--bg-panel), var(--bg-elevated));
  border: 1px solid var(--gold-dim); border-radius: 14px;
  padding: 13px 16px; margin-bottom: 13px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.mod-head-left { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; }
.mod-head-emblem {
  width: 40px; height: 40px; border-radius: 10px; background: #041511;
  border: 1px solid #e7c66b; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.mod-head-emblem svg { width: 26px; height: 26px; }
.mod-head h2 { font-size: 17.5px; font-weight: 800; color: var(--gold-bright); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mod-head .sub { font-size: 12px; color: var(--text-soft); margin-top: 2px; }
.mod-subtabs { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 13px; }

.panel-box {
  background: var(--bg-card); border: 1px solid var(--gold-dim);
  border-radius: 13px; padding: 15px 17px; margin-bottom: 13px;
}
.toolbar-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.hak-input, .hak-select {
  background: var(--bg-input); color: var(--text-main); border: 1px solid var(--gold-dim);
  border-radius: 8px; padding: 7px 10px; font-size: 12.8px; outline: none; max-width: 100%;
}
.hak-input:focus, .hak-select:focus { border-color: var(--gold); }

/* ARABIC WORD LAYOUT, SPACIOUS 14px-18px GAP & INTERACTIVE .hak-ar-word TOKENS (QURAN & ALL HADITHS) */
.ar-text {
  font-family: 'Amiri', 'Traditional Arabic', 'Scheherazade New', 'Noto Naskh Arabic', serif;
  direction: rtl; text-align: right; font-size: var(--ar-font-size); line-height: 2.08;
  color: var(--ar-color); padding: 12px 16px; background: var(--ar-bg);
  border-right: 3px solid var(--gold); border-radius: 8px; margin: 8px 0;
}
.hak-ar-flow {
  display: flex; flex-wrap: wrap; direction: rtl; align-items: baseline;
  column-gap: 16px; row-gap: 10px;
}
.hak-ar-word {
  display: inline-block; padding: 2px 6px; margin: 1px 4px;
  border-radius: 6px; border: 1px solid transparent;
  cursor: pointer; transition: background 0.12s, border-color 0.12s, color 0.12s, transform 0.12s;
  font-family: 'Amiri', 'Traditional Arabic', 'Scheherazade New', 'Noto Naskh Arabic', serif;
}
.hak-ar-flow .hak-ar-word { margin: 0; }
.hak-ar-word:hover {
  background: rgba(46, 196, 139, 0.22);
  border-color: var(--gold);
  color: #fff9e2;
  transform: translateY(-1px);
}
body.theme-day .hak-ar-word:hover {
  background: rgba(14, 124, 85, 0.16);
  color: #06281d;
}

/* LIVE KARAOKE WORD-BY-WORD GLOW DURING RECITATION (`timeupdate` SYNC) */
.hak-word-reading-active,
.wbw-token.hak-word-reading-active {
  background: linear-gradient(135deg, rgba(246, 220, 139, 0.36), rgba(46, 196, 139, 0.42)) !important;
  border-color: #f6dc8b !important;
  box-shadow: 0 0 18px rgba(246, 220, 139, 0.68), 0 0 6px rgba(46, 196, 139, 0.55) !important;
  transform: translateY(-2px) scale(1.04) !important;
}
.wbw-token.hak-word-reading-active .wbw-ar,
.wbw-token.hak-word-reading-active .wbw-tr,
.hak-ar-word.hak-word-reading-active {
  color: #fff8dc !important;
  text-shadow: 0 0 10px rgba(246, 220, 139, 0.72);
}
body.theme-day .wbw-token.hak-word-reading-active .wbw-ar,
body.theme-day .wbw-token.hak-word-reading-active .wbw-tr,
body.theme-day .hak-ar-word.hak-word-reading-active {
  color: #06291e !important;
  text-shadow: none;
}

.tr-text { font-size: 14.3px; line-height: 1.66; color: var(--text-main); padding: 6px 2px; }
.en-text { font-size: 13.4px; line-height: 1.6; color: var(--cyan); padding: 4px 2px; font-style: italic; }
.footnote-box {
  background: rgba(58,214,222,0.08); border-left: 3px solid var(--cyan);
  padding: 9px 12px; border-radius: 6px; font-size: 12.4px; color: var(--text-soft);
  line-height: 1.58; margin-top: 6px;
}

/* SPACIOUS 16px GAP WBW GRID + EXPLICIT VISIBLE ROOT BADGE */
.wbw-grid {
  display: flex; flex-wrap: wrap; direction: rtl; gap: 16px;
  padding: 13px 14px; background: var(--ar-bg); border-radius: 10px;
  border: 1px solid var(--gold-dim); margin: 8px 0;
}
.wbw-token {
  display: inline-flex; flex-direction: column; align-items: center;
  padding: 8px 12px; border-radius: 9px; background: rgba(9,38,32,0.72);
  border: 1px solid rgba(231,198,107,0.28); cursor: pointer; transition: 0.14s;
  min-width: 78px; text-align: center;
}
body.theme-day .wbw-token { background: #ffffff; border-color: rgba(14,124,85,0.28); }
.wbw-token:hover { transform: translateY(-2px); border-color: var(--gold); box-shadow: 0 5px 14px rgba(0,0,0,0.35); }
.wbw-ar {
  font-family: 'Amiri', 'Traditional Arabic', serif;
  font-size: calc(var(--ar-font-size) * 0.98); font-weight: 700; line-height: 1.55;
}
.wbw-ar-bare {
  font-family: 'Amiri', 'Traditional Arabic', serif;
  font-size: calc(var(--ar-font-size) * 0.78); color: var(--cyan); line-height: 1.35; margin-top: 1px;
}
.wbw-tr { font-size: 11.4px; font-weight: 700; line-height: 1.32; margin-top: 4px; direction: ltr; }
.wbw-meta {
  font-size: 10.3px; font-weight: 700; color: var(--gold-bright);
  background: rgba(231,198,107,0.11); border: 1px solid rgba(231,198,107,0.25);
  border-radius: 5px; padding: 1px 6px; margin-top: 4px; direction: ltr;
}

/* 8 Jewel Color Pairs for WBW Arabic + Turkish Alignment */
.wbw-c0 .wbw-ar, .wbw-c0 .wbw-tr { color: #f6dc8b; }
.wbw-c1 .wbw-ar, .wbw-c1 .wbw-tr { color: #5ef2be; }
.wbw-c2 .wbw-ar, .wbw-c2 .wbw-tr { color: #6be4ff; }
.wbw-c3 .wbw-ar, .wbw-c3 .wbw-tr { color: #ffb978; }
.wbw-c4 .wbw-ar, .wbw-c4 .wbw-tr { color: #d6a8ff; }
.wbw-c5 .wbw-ar, .wbw-c5 .wbw-tr { color: #ff98b6; }
.wbw-c6 .wbw-ar, .wbw-c6 .wbw-tr { color: #b5f476; }
.wbw-c7 .wbw-ar, .wbw-c7 .wbw-tr { color: #8fd2ff; }
body.theme-day .wbw-c0 .wbw-ar, body.theme-day .wbw-c0 .wbw-tr { color: #8a5b00; }
body.theme-day .wbw-c1 .wbw-ar, body.theme-day .wbw-c1 .wbw-tr { color: #096e4b; }
body.theme-day .wbw-c2 .wbw-ar, body.theme-day .wbw-c2 .wbw-tr { color: #005f78; }
body.theme-day .wbw-c3 .wbw-ar, body.theme-day .wbw-c3 .wbw-tr { color: #9c4300; }
body.theme-day .wbw-c4 .wbw-ar, body.theme-day .wbw-c4 .wbw-tr { color: #5c2594; }
body.theme-day .wbw-c5 .wbw-ar, body.theme-day .wbw-c5 .wbw-tr { color: #941c47; }
body.theme-day .wbw-c6 .wbw-ar, body.theme-day .wbw-c6 .wbw-tr { color: #366900; }
body.theme-day .wbw-c7 .wbw-ar, body.theme-day .wbw-c7 .wbw-tr { color: #0b4a8c; }

/* CONTINUOUS SURAH READING FLOW */
.hak-continuous-surah {
  background: var(--ar-bg);
  border: 1.5px solid var(--gold-dim);
  border-radius: 14px;
  padding: 20px 22px;
  margin-bottom: 14px;
}
.hak-cont-ayah {
  display: inline;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.14s;
}
.hak-cont-ayah:hover {
  background: rgba(231, 198, 107, 0.10);
}
.hak-cont-ayah-marker {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 28px; height: 28px; padding: 0 6px; margin: 0 8px;
  border-radius: 99px; border: 1.4px solid var(--gold);
  background: rgba(231, 198, 107, 0.16); color: var(--gold-bright);
  font-size: 12px; font-weight: 900; cursor: pointer; vertical-align: middle;
}
.hak-cont-ayah-marker:hover {
  background: var(--gold); color: #041511;
}

/* VERSE CLICK DETAILED INSPECTOR & 3 RESEARCH SECTIONS */
.hak-verse-detail-panel {
  margin-top: 11px; padding: 14px 16px;
  background: linear-gradient(180deg, rgba(6,33,27,0.96), rgba(4,20,16,0.98));
  border: 1.5px solid var(--gold); border-radius: 12px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.42);
}
body.theme-day .hak-verse-detail-panel {
  background: linear-gradient(180deg, #f3f9f5, #e6f2ec);
}
.hak-3sec-stack {
  display: flex; flex-direction: column; gap: 11px; margin-top: 12px;
}
.hak-res-sec {
  background: var(--bg-input); border: 1px solid var(--gold-dim);
  border-radius: 10px; padding: 12px 14px;
}
.hak-res-sec.sec-hadith { border-left: 4px solid var(--emerald); }
.hak-res-sec.sec-hakai { border-left: 4px solid var(--gold); }
.hak-res-sec.sec-future1000 { border-left: 4px solid var(--cyan); }

/* BADGES */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 6px; font-size: 11px; font-weight: 800;
}
.badge-gold { background: rgba(231,198,107,0.18); border: 1px solid var(--gold); color: var(--gold-bright); }
.badge-green { background: rgba(46,196,139,0.18); border: 1px solid var(--emerald); color: var(--emerald); }
body:not(.theme-day) .badge-green { color: #7bf1c2; }
.badge-cyan { background: rgba(58,214,222,0.15); border: 1px solid var(--cyan); color: var(--cyan); }
body:not(.theme-day) .badge-cyan { color: #9beCF4; }
.badge-warn { background: rgba(244,185,66,0.18); border: 1px solid var(--warn); color: #b87a00; }
body:not(.theme-day) .badge-warn { color: #ffd984; }
.badge-red { background: rgba(239,100,97,0.18); border: 1px solid var(--danger); color: #c42824; }
body:not(.theme-day) .badge-red { color: #ffaba8; }

/* MODEL 2: RADIAL CONNECTED VERSE NETWORK + FIXED Z-INDEX 99999 HOVER POPUP */
.radial-stage-wrap {
  position: relative; width: 100%; min-height: 490px;
  background: radial-gradient(circle at 50% 50%, rgba(46,196,139,0.12), rgba(4,19,16,0.95) 72%);
  border: 1px solid var(--gold-dim); border-radius: 14px; overflow: hidden; margin: 10px 0;
}
body.theme-day .radial-stage-wrap {
  background: radial-gradient(circle at 50% 50%, rgba(14,124,85,0.10), #eef4f0 75%);
}
.radial-canvas {
  position: relative; width: 100%; height: 470px; max-width: 940px; margin: 0 auto;
}
.radial-svg-lines {
  position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none;
}
.radial-center-node {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 96px; height: 96px; border-radius: 50%;
  background: radial-gradient(circle, #6c4d10, #2c1e04);
  border: 2.5px solid #f6dc8b; color: #fff8df;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-weight: 900; font-size: 14px; text-align: center; z-index: 5;
  box-shadow: 0 0 28px rgba(231,198,107,0.45); cursor: pointer;
}
.radial-leaf-node {
  position: absolute; transform: translate(-50%, -50%);
  min-width: 92px; padding: 5px 10px; border-radius: 8px;
  background: #06211b; border: 1.5px solid #2ec48b; color: #eaf7f2;
  font-size: 11.5px; font-weight: 800; text-align: center; cursor: pointer;
  z-index: 4; transition: transform 0.14s, border-color 0.14s, box-shadow 0.14s;
  white-space: nowrap;
}
.radial-leaf-node.hak-ai-edge {
  border-color: #3ad6de; border-style: dashed; background: #061f29;
}
.radial-leaf-node:hover, .radial-leaf-node.hovered {
  transform: translate(-50%, -50%) scale(1.09);
  border-color: #f6dc8b; box-shadow: 0 0 18px rgba(231,198,107,0.5); z-index: 9;
}

.hak-radial-popup {
  position: fixed;
  z-index: 99999;
  pointer-events: none;
  display: none;
  width: 410px;
  max-width: calc(100vw - 20px);
  background: linear-gradient(180deg, #072820 0%, #041511 100%);
  border: 1.8px solid #f6dc8b;
  border-radius: 14px;
  padding: 13px 15px;
  color: #f3f7f5;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.88), 0 0 0 1px rgba(46, 196, 139, 0.35);
}
.hak-radial-popup.show { display: block; }

/* UNIVERSAL [1] [2] ... [50] BOTTOM PAGINATION BAR */
.hak-pag50-wrap {
  background: var(--bg-card); border: 1px solid var(--gold-dim);
  border-radius: 13px; padding: 13px 15px; margin-top: 14px;
}
.hak-pag50-top {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 10px;
}
.hak-pag50-grid {
  display: flex; flex-wrap: wrap; gap: 4px; align-items: center;
}
.hak-pag50-btn {
  min-width: 32px; height: 28px; padding: 0 6px;
  border-radius: 6px; border: 1px solid var(--gold-dim);
  background: var(--bg-input); color: var(--text-soft);
  font-size: 11.2px; font-weight: 700; cursor: pointer; transition: 0.12s;
  font-variant-numeric: tabular-nums;
}
.hak-pag50-btn:hover { border-color: var(--gold); color: var(--gold-bright); }
.hak-pag50-btn.active {
  background: var(--gold); color: #041511; border-color: var(--gold); font-weight: 900;
}
body.theme-day .hak-pag50-btn.active { color: #ffffff; }

/* 5 COLLAPSED HADITH TOPIC ACCORDION CATEGORIES */
.hadith-cat5-acc {
  border: 1px solid var(--gold-dim); border-radius: 12px;
  background: var(--bg-card); margin-bottom: 9px; overflow: hidden;
}
.hadith-cat5-hdr {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 15px; background: linear-gradient(90deg, var(--bg-panel), var(--bg-card));
  border: none; color: var(--text-main); cursor: pointer; text-align: left; font-size: 13.5px; font-weight: 800;
}
.hadith-cat5-hdr:hover { background: var(--bg-card-hover); }
.hadith-cat5-body {
  display: none; padding: 12px 15px; border-top: 1px solid var(--gold-dim);
}
.hadith-cat5-acc.expanded .hadith-cat5-body { display: block; }

/* 6-CLUSTER ASSOCIATIVE SEARCH CARDS */
.hak-cluster6-box {
  background: var(--bg-card);
  border: 1.4px solid var(--gold-dim);
  border-radius: 14px;
  padding: 15px 17px;
  margin-bottom: 14px;
}
.hak-cluster6-hdr {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 8px; margin-bottom: 10px;
  padding-bottom: 8px; border-bottom: 1px solid var(--gold-dim);
}

/* 2-STAGE & 3-LAYER HADITH VERIFICATION & RAVI CHAIN */
.tahkik-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.tahkik-grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
@media (max-width: 1024px) {
  .tahkik-grid, .tahkik-grid3 { grid-template-columns: 1fr; }
}
.stage-card {
  background: var(--bg-input); border: 1px solid var(--gold-dim);
  border-radius: 10px; padding: 11px 13px;
}
.stage-title { font-size: 11.8px; font-weight: 800; color: var(--gold-bright); margin-bottom: 6px; display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.ravi-chain { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 7px; }
.ravi-node {
  background: var(--bg-card); border: 1px solid var(--gold-dim); border-radius: 8px;
  padding: 5px 8px; font-size: 11.5px; cursor: pointer; transition: 0.12s;
}
.ravi-node:hover { border-color: var(--cyan); }
.ravi-arrow { color: var(--gold); font-weight: 900; font-size: 12px; }

/* HAK DNA DOUBLE-HELIX SHOWCASE */
.dna-helix-showcase {
  max-width: 920px; margin: 0 auto 16px;
  background: linear-gradient(180deg, #061c18 0%, #041310 100%);
  border: 1.5px solid rgba(231,198,107,0.42); border-radius: 18px;
  padding: 22px 26px; color: #f3f7f5; box-shadow: 0 12px 38px rgba(0,0,0,0.45);
}
.dna-ar-hero {
  font-family: 'Amiri', 'Traditional Arabic', serif;
  direction: rtl; text-align: right; font-size: clamp(26px, 3vw, 36px);
  color: #ffffff; background: rgba(3, 14, 12, 0.82);
  border: 1px solid rgba(231,198,107,0.35); border-radius: 12px;
  padding: 18px 22px; margin: 14px 0; line-height: 1.85;
}

/* KUR'AN OLCULU ASTRONOMIK VAKIT SISTEMI GRID */
.vakit-grid8 {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 10px; margin: 12px 0;
}
.vakit-card {
  background: var(--bg-card); border: 1px solid var(--gold-dim);
  border-radius: 12px; padding: 12px 10px; text-align: center;
}
.vakit-card.active { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.vakit-card .v-name { font-size: 11.8px; font-weight: 800; color: var(--gold-bright); }
.vakit-card .v-deg { font-size: 10.2px; color: var(--cyan); margin: 2px 0 5px; font-weight: 600; }
.vakit-card .v-time { font-size: 23px; font-weight: 900; color: var(--text-main); font-variant-numeric: tabular-nums; }
.vakit-card .v-desc { font-size: 10.2px; color: var(--text-muted); margin-top: 4px; }

/* PERSISTENT BOTTOM STUDIO AUDIO DOCK */
.hak-audio-dock {
  position: fixed; left: 0; right: 0; bottom: 0; min-height: var(--dock-h);
  background: linear-gradient(90deg, #041511 0%, #08261f 50%, #041511 100%);
  border-top: 1.5px solid rgba(231,198,107,0.48);
  z-index: 1400; padding: 6px 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  color: #f3f7f5; box-shadow: 0 -6px 26px rgba(0,0,0,0.55);
}
.hak-dock-left, .hak-dock-center, .hak-dock-right {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.hak-dock-play {
  background: linear-gradient(135deg, #f3c64f, #d49b27); color: #041511;
  border: none; border-radius: 8px; padding: 6px 13px; font-size: 12px; font-weight: 900; cursor: pointer;
}
.hak-dock-btn {
  background: rgba(255,255,255,0.08); color: #f6dc8b; border: 1px solid rgba(231,198,107,0.34);
  border-radius: 7px; padding: 5px 9px; font-size: 11.5px; font-weight: 700; cursor: pointer;
}
.hak-dock-sel {
  background: #03110e; color: #f6dc8b; border: 1px solid rgba(231,198,107,0.36);
  border-radius: 7px; padding: 5px 8px; font-size: 11.1px; font-weight: 700; max-width: 245px;
}

/* FLOATING TEXT SELECTION -> AJANDAYA EKLE PILL */
.hak-sel-pill {
  position: fixed; z-index: 9995; display: none; align-items: center; gap: 6px;
  background: linear-gradient(135deg, #124d3d, #082920);
  border: 1.5px solid #f6dc8b; color: #fff8df;
  padding: 6px 12px; border-radius: 99px; font-size: 12px; font-weight: 800;
  box-shadow: 0 8px 24px rgba(0,0,0,0.65); cursor: pointer;
}
.hak-sel-pill.show { display: inline-flex; }

/* RIGHT-CLICK MENUS (GENERAL + 9-ITEM ARABIC WORD MENU), MODALS & TOAST */
.hak-ctx-menu {
  position: fixed; z-index: 99998; width: 355px; max-width: calc(100vw - 16px);
  background: linear-gradient(180deg, #07241e, #041411);
  border: 1.5px solid #e7c66b; border-radius: 12px;
  box-shadow: 0 14px 42px rgba(0,0,0,0.85); padding: 6px; display: none; color: #f3f7f5;
}
.hak-word-ctx-menu {
  z-index: 100000;
  width: 385px;
  border-color: #f6dc8b;
}
.hak-ctx-menu.open { display: block; }
.hak-ctx-hdr {
  padding: 6px 10px; border-bottom: 1px solid rgba(231,198,107,0.25);
  font-size: 11.5px; font-weight: 800; color: #f6dc8b;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px;
}
.hak-ctx-item {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  background: transparent; border: none; color: #f3f7f5;
  padding: 7px 10px; border-radius: 8px; font-size: 11.8px; font-weight: 600; cursor: pointer;
}
.hak-ctx-item:hover { background: rgba(231,198,107,0.18); color: #f6dc8b; }
.hak-ctx-sep { height: 1px; background: rgba(231,198,107,0.18); margin: 4px 6px; }

.hak-modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.75);
  z-index: 99990; display: none; align-items: center; justify-content: center; padding: 16px;
}
.hak-modal-backdrop.open { display: flex; }
.hak-modal-card {
  width: 100%; max-width: 720px; max-height: 88vh; overflow-y: auto;
  background: linear-gradient(180deg, #08261f, #041511);
  border: 1.5px solid #e7c66b; border-radius: 16px; padding: 20px 22px; color: #f3f7f5;
  box-shadow: 0 20px 60px rgba(0,0,0,0.85);
}

.hak-wbw-tooltip {
  position: fixed; z-index: 99999; pointer-events: none; display: none;
  max-width: 380px; background: linear-gradient(180deg, #06241d, #041410);
  border: 1.6px solid #f6dc8b;
  border-radius: 12px; padding: 10px 13px; color: #f3f7f5; font-size: 12px;
  box-shadow: 0 14px 36px rgba(0,0,0,0.85), 0 0 0 1px rgba(46,196,139,0.3);
}
.hak-wbw-tooltip.show { display: block; }

.hak-toast {
  position: fixed; bottom: calc(var(--dock-h) + 14px); right: 18px; z-index: 99997;
  background: #082b23; border: 1px solid #e7c66b; color: #fff;
  padding: 9px 15px; border-radius: 10px; font-size: 12.2px; font-weight: 700;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6); display: none; max-width: 90vw;
}
.hak-toast.show { display: block; }

table.hak-table { width: 100%; border-collapse: collapse; font-size: 12.3px; }
table.hak-table th, table.hak-table td {
  padding: 7px 9px; border-bottom: 1px solid var(--gold-dim); text-align: left;
}
table.hak-table th { color: var(--gold-bright); font-weight: 800; background: rgba(0,0,0,0.16); }

/* RESPONSIVE RULES */
@media (max-width: 980px) {
  :root { --topbar-h: 118px; --dock-h: 90px; }
  .hak-flyout { left: 0; width: min(340px, 94vw); z-index: 1250; }
}
@media (max-width: 600px) {
  :root { --topbar-h: 146px; --dock-h: 108px; --strip-w: 12px; }
  .hak-main { padding: 12px 10px calc(var(--dock-h) + 28px); }
  .hak-hero { padding: 15px 14px; }
  .radial-canvas { height: 390px; transform: scale(0.84); transform-origin: center center; }
  .hak-left-drawer { width: min(300px, 92vw); }
}

button, .panel-box, .hadith-cat5-acc, .hadith-cat5-hdr { scroll-margin-top: 108px; scroll-margin-bottom: 96px; }
