/* ImanAtlas Notify System — drawer, bell, settings panels.
   v1.3.0: the v1.2.0 switch carried a sun glyph, which reads as the
   day/night toggle — removed on the user's correction. Same design
   language (wide dark-green pill track + large gold disc knob), but
   the in-track glyph is now a small BELL, matching what these
   switches actually control.
   v1.2.0: notification switches restyled to the user's reference —
   a wide dark-green pill track, a small sun glyph inside the track on
   the side opposite the knob, and a large gold disc knob.
   v1.1.0: design polish pass (brand row + star mark, diamond bullets +
   chevrons on nav rows, section-label rules, refined switches with a
   gold-ring ON knob, pill test button, rounded drawer edge + blur
   backdrop, matching desktop panel finish). No markup/logic changes.
   Breakpoint 1020px matches the theme header (nav.main hides there).
   Colours come from the theme variables (--card, --ink, --line, --gold,
   --emerald, ...), which flip with [data-theme="dark"] automatically. */

.ia-lock { overflow: hidden !important; }

/* ---------- header buttons ---------- */
.ia-burger {
  display: none;
  width: 40px; height: 40px; min-width: 40px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  place-items: center; cursor: pointer; padding: 0; flex: none;
  transition: border-color .2s ease, color .2s ease, background .2s ease;
}
.ia-burger:hover { border-color: var(--gold-bright); color: var(--emerald); }
.ia-burger svg { display: block; }

.ia-bell {
  display: none;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  place-items: center; cursor: pointer; padding: 0; flex: none; position: relative;
  transition: border-color .2s ease, color .2s ease, background .2s ease;
}
.ia-bell:hover { border-color: var(--gold-bright); color: var(--emerald); }
.ia-bell svg { display: block; }
.ia-bell.ia-bell-on { color: var(--gold); border-color: var(--gold-bright); }
.ia-bell .ia-bell-dot {
  position: absolute; top: 8px; right: 9px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--gold-bright); display: none;
  box-shadow: 0 0 0 2px var(--card);
}
.ia-bell.ia-bell-on .ia-bell-dot { display: block; }

@media (max-width: 1020px) {
  .ia-burger { display: grid; }
}
@media (min-width: 1021px) {
  .ia-bell { display: grid; }
}

/* ---------- drawer ---------- */
.ia-drawer-backdrop {
  position: fixed; inset: 0; background: rgba(3, 12, 8, .55);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none; transition: opacity .3s ease;
  z-index: 200;
}
.ia-drawer-backdrop.ia-open { opacity: 1; pointer-events: auto; }

.ia-drawer {
  position: fixed; top: 0; bottom: 0; left: 0;
  width: min(340px, 86vw);
  background: var(--card); color: var(--ink);
  border-right: 1px solid var(--line);
  border-radius: 0 18px 18px 0;
  box-shadow: 18px 0 48px rgba(2, 10, 6, .38);
  transform: translateX(-106%); transition: transform .34s cubic-bezier(.22, .9, .26, 1);
  z-index: 210; display: flex; flex-direction: column;
  overflow-y: auto; overscroll-behavior: contain;
  visibility: hidden;
}
.ia-drawer.ia-open { transform: translateX(0); visibility: visible; }

/* Brand row: gold eight-point star + wordmark + close, gold hairline under. */
.ia-drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 17px 18px 13px;
  border-bottom: 1px solid var(--line-soft);
  border-bottom: 1px solid color-mix(in srgb, var(--gold) 42%, var(--line-soft));
}
.ia-drawer-title {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: Marcellus, Georgia, serif; font-size: 1.25rem; letter-spacing: .01em;
}
.ia-drawer-title::before {
  content: ""; flex: none; width: 21px; height: 21px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23c9a227' d='M12 1l2.3 6.2L19.8 4.2 17 9.7 23 12l-6 2.3 2.8 5.5-5.5-3L12 23l-2.3-6.2L4.2 19.8 7 14.3 1 12l6-2.3L4.2 4.2l5.5 3z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.ia-drawer-title em { color: var(--gold); font-style: normal; }
.ia-drawer-close {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  display: grid; place-items: center; cursor: pointer; padding: 0;
  transition: border-color .2s ease, color .2s ease, background .2s ease;
}
.ia-drawer-close:hover { border-color: var(--gold-bright); color: var(--emerald); }

/* Category rows: gold diamond bullet, hairline separators, chevron. */
.ia-drawer-nav { padding: 8px 0; }
.ia-drawer-nav a {
  display: flex; align-items: center; gap: 11px;
  min-height: 48px; padding: 11px 18px; text-decoration: none;
  color: var(--ink); font-weight: 600; font-size: .98rem;
  border-bottom: 1px solid var(--line-soft);
  transition: background .15s ease, color .15s ease;
}
.ia-drawer-nav a::before {
  content: ""; flex: none; width: 7px; height: 7px; border-radius: 1px;
  background: var(--gold); opacity: .85; transform: rotate(45deg);
}
.ia-drawer-nav a::after {
  content: ""; flex: none; margin-left: auto; width: 8px; height: 8px;
  border-top: 1.6px solid var(--ink-faint); border-right: 1.6px solid var(--ink-faint);
  transform: rotate(45deg); opacity: .65;
  transition: border-color .15s ease, opacity .15s ease;
}
.ia-drawer-nav a:last-child { border-bottom: none; }
.ia-drawer-nav a:hover { background: var(--bg-soft); color: var(--emerald); }
.ia-drawer-nav a:hover::after { border-color: var(--gold-bright); opacity: 1; }
.ia-drawer-nav a:active { background: var(--gold-soft); }

.ia-drawer-settings {
  margin-top: auto;
  border-top: 1px solid var(--line);
  border-top: 1px solid color-mix(in srgb, var(--gold) 32%, var(--line));
  padding: 14px 18px 20px; background: var(--bg-soft);
}

/* Section labels: gold letterspaced text + hairline rule running out. */
.ia-drawer-settings h2, .ia-ntf-panel h2 {
  display: flex; align-items: center; gap: 10px;
  font-size: .72rem; font-weight: 700; letter-spacing: .18em;
  text-transform: uppercase; color: var(--gold); margin: 0 0 10px;
}
.ia-drawer-settings h2::after, .ia-ntf-panel h2::after {
  content: ""; flex: 1; height: 1px; background: var(--line);
  background: linear-gradient(90deg, color-mix(in srgb, var(--gold) 55%, transparent), transparent);
}

/* ---------- desktop dropdown panel ---------- */
.ia-ntf-panel {
  position: fixed; width: 324px; max-width: calc(100vw - 24px);
  background: var(--card); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius, 18px);
  box-shadow: 0 18px 44px rgba(2, 10, 6, .26), var(--shadow-lg);
  z-index: 205;
  padding: 16px 18px 14px; display: none;
}
.ia-ntf-panel.ia-open { display: block; }

/* ---------- settings block (shared by drawer + panel) ---------- */
.ia-ntf-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 7px 0;
}
.ia-ntf-row .ia-ntf-label { font-weight: 600; font-size: .95rem; }
.ia-ntf-row .ia-ntf-sub { display: block; font-weight: 400; font-size: .8rem; color: var(--ink-faint); margin-top: 1px; }
.ia-ntf-master .ia-ntf-label { font-size: 1rem; }
.ia-ntf-subs { border-top: 1px solid var(--line-soft); margin-top: 6px; padding-top: 4px; }
.ia-ntf-off .ia-ntf-subs, .ia-ntf-off .ia-ntf-actions { opacity: .45; }
.ia-ntf-off .ia-ntf-subs .ia-sw, .ia-ntf-off .ia-ntf-actions button { pointer-events: none; }

/* Reference-style switch (user's screenshot; v1.3.0 glyph corrected):
   wide dark-green pill track, a small BELL glyph inside the track on
   the side opposite the knob (a sun glyph read as the day/night
   toggle — never use it on these switches), and a large gold disc
   knob that fills the track height.
   Same .ia-sw / .ia-sw-knob hooks the JS builds. */
.ia-sw {
  width: 74px; height: 42px; min-width: 74px; border-radius: 999px;
  border: 1px solid #2a3d33;
  background: linear-gradient(180deg, #16281f, #0c1c14);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .55), inset 0 -1px 0 rgba(255, 255, 255, .05);
  position: relative; cursor: pointer; padding: 0; flex: none;
  transition: background .25s ease, border-color .25s ease;
}
.ia-sw::before {
  content: ""; position: absolute; top: 50%; right: 11px;
  width: 19px; height: 19px; transform: translateY(-50%);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239fb0a5' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 9a6 6 0 1 0-12 0c0 6-2.5 7-2.5 7h17S18 15 18 9'/%3E%3Cpath d='M10 20a2.2 2.2 0 0 0 4 0'/%3E%3C/svg%3E") center / contain no-repeat;
  opacity: .75; transition: left .25s cubic-bezier(.22, .9, .26, 1), right .25s cubic-bezier(.22, .9, .26, 1), opacity .25s ease;
}
.ia-sw .ia-sw-knob {
  position: absolute; top: 3px; left: 3px; width: 34px; height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #e8c877, #d9a441 58%, #c1912f);
  border: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .45), inset 0 1px 1px rgba(255, 255, 255, .35);
  transition: left .25s cubic-bezier(.22, .9, .26, 1), background .25s ease,
    border-color .25s ease, box-shadow .25s ease, opacity .25s ease;
  z-index: 1;
}
.ia-sw[aria-checked="false"] .ia-sw-knob { opacity: .45; filter: saturate(.45); }
.ia-sw[aria-checked="true"] {
  background: linear-gradient(180deg, #1a2f24, #0e2016);
  border-color: #38503f;
}
.ia-sw[aria-checked="true"]::before { right: auto; left: 11px; opacity: .9; }
/* The drawer's Night-mode row is the one place a moon glyph belongs —
   it is a theme switch, not a notification switch (v1.3.1). */
.ia-sw.ia-sw-theme::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239fb0a5' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 13.2A8.1 8.1 0 0 1 10.8 4 8.5 8.5 0 1 0 20 13.2z'/%3E%3C/svg%3E");
}
.ia-sw[aria-checked="true"] .ia-sw-knob { left: 35px; opacity: 1; filter: none; }
.ia-sw:focus-visible, .ia-burger:focus-visible, .ia-bell:focus-visible,
.ia-drawer-close:focus-visible, .ia-ntf-test:focus-visible {
  outline: 2px solid var(--gold-bright); outline-offset: 2px;
}

/* Status / permission lines: smaller, muted, hairline above the block. */
.ia-ntf-status {
  font-size: .8rem; color: var(--ink-soft); line-height: 1.45;
  border-top: 1px solid var(--line-soft); margin: 12px 0 0; padding-top: 10px;
}
.ia-ntf-perm { font-size: .8rem; margin: 5px 0 0; line-height: 1.45; color: var(--ink-faint); }
.ia-ntf-perm.ia-denied { color: #b3261e; font-weight: 600; }
[data-theme="dark"] .ia-ntf-perm.ia-denied { color: #f2b8b5; }
.ia-ntf-actions { margin-top: 12px; }
.ia-ntf-test {
  border: 1px solid var(--gold-bright); background: transparent;
  color: var(--emerald); font-weight: 600; font-size: .88rem;
  border-radius: 999px; padding: 10px 18px; cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.ia-ntf-test:hover { background: var(--gold-soft); }
.ia-ntf-test:active { background: var(--gold-soft); border-color: var(--gold); }
.ia-ntf-note { font-size: .78rem; color: var(--ink-faint); line-height: 1.5; margin: 10px 0 0; }

@media (prefers-reduced-motion: reduce) {
  .ia-drawer, .ia-drawer-backdrop, .ia-sw, .ia-sw .ia-sw-knob,
  .ia-burger, .ia-bell, .ia-drawer-close, .ia-ntf-test, .ia-drawer-nav a {
    transition: none;
  }
}
