:root {
  --haarp-violet-1: #5b21b6;
  --haarp-violet-2: #7c3aed;
  --haarp-violet-3: #a78bfa;
  --haarp-ink: #171225;
  --haarp-white: #ffffff;
}

.ha-app-reader,
.ha-app-reader * {
  box-sizing: border-box;
}

.ha-app-reader {
  position: fixed;
  z-index: 999998;
  top: 50%;
  right: 18px;
  transform: translateY(-50%);
  width: 390px;
  max-width: calc(100vw - 36px);
  font-family: inherit;
  line-height: 1.45;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity .38s ease, visibility .38s ease;
}

.ha-app-reader.is-ready {
  opacity: 1;
  visibility: visible;
}

.ha-app-reader__tab,
.ha-app-reader__panel {
  pointer-events: auto;
}

.ha-app-reader__tab {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 10px 15px 10px 12px;
  border: 1px solid rgba(255,255,255,.45);
  border-radius: 16px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(91,33,182,.98), rgba(124,58,237,.96) 55%, rgba(167,139,250,.92));
  box-shadow:
    0 16px 40px rgba(50,22,93,.30),
    inset 0 1px 0 rgba(255,255,255,.40),
    inset 0 -1px 0 rgba(35,12,78,.25),
    0 0 0 1px rgba(124,58,237,.16);
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition: transform .28s ease, box-shadow .28s ease, opacity .24s ease;
}

.ha-app-reader__tab:hover {
  transform: translateY(-50%) translateX(-2px);
  box-shadow:
    0 20px 48px rgba(50,22,93,.38),
    inset 0 1px 0 rgba(255,255,255,.48),
    inset 0 -1px 0 rgba(35,12,78,.28),
    0 0 0 2px rgba(167,139,250,.16);
}

.ha-app-reader__tab:focus-visible,
.ha-app-reader__close:focus-visible,
.ha-app-reader__cta:focus-visible {
  outline: 3px solid rgba(167,139,250,.55);
  outline-offset: 3px;
}

.ha-app-reader__tab-icon {
  width: 27px;
  height: 27px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.22);
  flex: 0 0 auto;
}

.ha-app-reader__tab-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.ha-app-reader__tab-label {
  font-size: 13px;
  font-weight: 750;
  letter-spacing: .01em;
  white-space: nowrap;
}

.ha-app-reader__tab-shine {
  position: absolute;
  inset: -80% auto -80% -35%;
  width: 30%;
  transform: rotate(16deg);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.42), transparent);
  animation: haarpShine 5.5s ease-in-out infinite;
  z-index: -1;
}

@keyframes haarpShine {
  0%, 70% { left: -40%; opacity: 0; }
  76% { opacity: 1; }
  94% { left: 125%; opacity: 1; }
  100% { left: 125%; opacity: 0; }
}

.ha-app-reader__panel {
  position: relative;
  width: 100%;
  color: var(--haarp-ink);
  background:
    linear-gradient(145deg, rgba(255,255,255,.92), rgba(249,247,255,.84));
  border: 1px solid rgba(124,58,237,.22);
  border-radius: 26px;
  box-shadow:
    0 28px 80px rgba(44,26,74,.24),
    0 8px 24px rgba(54,27,93,.16),
    inset 0 1px 0 rgba(255,255,255,.92),
    0 0 0 1px rgba(255,255,255,.72);
  backdrop-filter: blur(22px) saturate(1.15);
  -webkit-backdrop-filter: blur(22px) saturate(1.15);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateX(26px) scale(.97);
  transform-origin: right center;
  transition: opacity .28s ease, visibility .28s ease, transform .34s cubic-bezier(.2,.75,.25,1);
}

.ha-app-reader.is-open .ha-app-reader__panel {
  opacity: 1;
  visibility: visible;
  transform: translateX(0) scale(1);
}

.ha-app-reader.is-open .ha-app-reader__tab {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.ha-app-reader__panel::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 24px;
  pointer-events: none;
  border: 1px solid rgba(255,255,255,.68);
}

.ha-app-reader__panel-glow {
  position: absolute;
  width: 190px;
  height: 190px;
  right: -78px;
  top: -82px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(167,139,250,.34), rgba(124,58,237,.12) 45%, transparent 72%);
  pointer-events: none;
}

.ha-app-reader__header {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 17px 17px 13px;
  border-bottom: 1px solid rgba(100,70,150,.10);
}

.ha-app-reader__brandmark {
  width: 41px;
  height: 41px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, var(--haarp-violet-1), var(--haarp-violet-2) 60%, var(--haarp-violet-3));
  border: 1px solid rgba(255,255,255,.62);
  box-shadow:
    0 9px 22px rgba(91,33,182,.23),
    inset 0 1px 0 rgba(255,255,255,.45);
  flex: 0 0 auto;
}

.ha-app-reader__brandmark svg {
  width: 23px;
  height: 23px;
  fill: currentColor;
}

.ha-app-reader__heading {
  min-width: 0;
  flex: 1 1 auto;
}

.ha-app-reader__eyebrow {
  color: var(--haarp-violet-2);
  text-transform: uppercase;
  font-size: 10px;
  line-height: 1.2;
  font-weight: 850;
  letter-spacing: .13em;
  margin-bottom: 3px;
}

.ha-app-reader__mini-title {
  color: #241839;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
}

.ha-app-reader__close {
  position: relative;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border: 1px solid rgba(91,33,182,.12);
  border-radius: 12px;
  background: rgba(255,255,255,.58);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9);
  cursor: pointer;
  transition: background .2s ease, transform .2s ease, border-color .2s ease;
}

.ha-app-reader__close:hover {
  background: rgba(124,58,237,.08);
  border-color: rgba(124,58,237,.22);
  transform: rotate(3deg);
}

.ha-app-reader__close span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 15px;
  height: 1.7px;
  border-radius: 999px;
  background: #4b356f;
}

.ha-app-reader__close span:first-child { transform: translate(-50%,-50%) rotate(45deg); }
.ha-app-reader__close span:last-child { transform: translate(-50%,-50%) rotate(-45deg); }

.ha-app-reader__body {
  position: relative;
  padding: 18px 18px 17px;
}

.ha-app-reader__title {
  margin: 0 0 9px;
  padding: 0;
  font-size: clamp(20px, 2vw, 24px);
  line-height: 1.16;
  font-weight: 850;
  letter-spacing: -.025em;
  color: #1f1730;
}

.ha-app-reader__description {
  margin: 0 0 14px;
  color: #5a4f6c;
  font-size: 13.6px;
  line-height: 1.6;
}

.ha-app-reader__article-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 11px;
  margin-bottom: 13px;
  border: 1px solid rgba(124,58,237,.12);
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(124,58,237,.055), rgba(167,139,250,.07));
  color: #4b3b64;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.35;
}

.ha-app-reader__article-chip > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ha-app-reader__article-chip-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: var(--haarp-violet-2);
  box-shadow: 0 0 0 4px rgba(124,58,237,.10);
}

.ha-app-reader__features {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: grid;
  gap: 8px;
}

.ha-app-reader__features li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  padding: 0;
  color: #453a55;
  font-size: 12.5px;
  line-height: 1.45;
}

.ha-app-reader__check {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  background: linear-gradient(145deg, var(--haarp-violet-1), var(--haarp-violet-2));
  box-shadow: 0 5px 12px rgba(91,33,182,.18);
}

.ha-app-reader__cta {
  position: relative;
  min-height: 48px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 15px;
  border-radius: 15px;
  border: 1px solid rgba(255,255,255,.52);
  color: #fff !important;
  text-decoration: none !important;
  font-size: 13.5px;
  line-height: 1.25;
  font-weight: 820;
  text-align: center;
  background: linear-gradient(135deg, var(--haarp-violet-1), var(--haarp-violet-2) 58%, #8b5cf6);
  box-shadow:
    0 13px 28px rgba(91,33,182,.24),
    inset 0 1px 0 rgba(255,255,255,.38),
    inset 0 -1px 0 rgba(44,17,94,.24);
  transition: transform .22s ease, box-shadow .22s ease, filter .22s ease;
}

.ha-app-reader__cta:hover {
  color: #fff !important;
  text-decoration: none !important;
  transform: translateY(-1px);
  filter: saturate(1.05);
  box-shadow:
    0 17px 34px rgba(91,33,182,.31),
    inset 0 1px 0 rgba(255,255,255,.44),
    inset 0 -1px 0 rgba(44,17,94,.26);
}

.ha-app-reader__cta svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex: 0 0 auto;
}

.ha-app-reader__note {
  margin-top: 10px;
  text-align: center;
  color: #786b8a;
  font-size: 10.5px;
  line-height: 1.45;
}

@media (prefers-color-scheme: dark) {
  .ha-app-reader__panel {
    color: #f6f1ff;
    background: linear-gradient(145deg, rgba(30,23,43,.94), rgba(22,17,32,.90));
    border-color: rgba(167,139,250,.25);
    box-shadow:
      0 30px 82px rgba(0,0,0,.50),
      0 8px 28px rgba(0,0,0,.26),
      inset 0 1px 0 rgba(255,255,255,.08),
      0 0 0 1px rgba(255,255,255,.035);
  }

  .ha-app-reader__panel::before { border-color: rgba(255,255,255,.055); }
  .ha-app-reader__header { border-bottom-color: rgba(255,255,255,.07); }
  .ha-app-reader__mini-title,
  .ha-app-reader__title { color: #f8f4ff; }
  .ha-app-reader__description { color: #c8bed8; }
  .ha-app-reader__article-chip {
    color: #d9cee9;
    border-color: rgba(167,139,250,.15);
    background: linear-gradient(135deg, rgba(124,58,237,.10), rgba(167,139,250,.08));
  }
  .ha-app-reader__features li { color: #d6cde3; }
  .ha-app-reader__close {
    background: rgba(255,255,255,.045);
    border-color: rgba(255,255,255,.08);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.07);
  }
  .ha-app-reader__close:hover { background: rgba(167,139,250,.10); }
  .ha-app-reader__close span { background: #d8c9ee; }
  .ha-app-reader__note { color: #a99abf; }
}

@media (max-width: 782px) {
  .ha-app-reader {
    top: auto;
    right: 10px;
    bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    width: min(430px, calc(100vw - 20px));
    max-width: calc(100vw - 20px);
    transform: none;
  }

  .ha-app-reader__tab {
    position: absolute;
    top: auto;
    right: 0;
    bottom: 0;
    transform: none;
    min-height: 46px;
    border-radius: 15px;
    padding: 9px 13px 9px 10px;
  }

  .ha-app-reader__tab:hover {
    transform: translateY(-1px);
  }

  .ha-app-reader__panel {
    border-radius: 24px;
    transform: translateY(20px) scale(.98);
    transform-origin: right bottom;
    max-height: min(72vh, 590px);
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }

  .ha-app-reader.is-open .ha-app-reader__panel {
    transform: translateY(0) scale(1);
  }

  .ha-app-reader__panel::before { border-radius: 22px; }
  .ha-app-reader__header { position: sticky; top: 0; z-index: 2; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
  .ha-app-reader__body { padding: 17px 16px 16px; }
  .ha-app-reader__title { font-size: 21px; }
  .ha-app-reader__description { font-size: 13.2px; }
}

@media (max-width: 430px) {
  .ha-app-reader__tab-label { font-size: 12px; }
  .ha-app-reader__tab-icon { width: 25px; height: 25px; }
  .ha-app-reader__header { padding: 14px 14px 12px; }
  .ha-app-reader__brandmark { width: 38px; height: 38px; border-radius: 13px; }
  .ha-app-reader__body { padding: 15px 14px 14px; }
  .ha-app-reader__features { gap: 7px; }
  .ha-app-reader__features li { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .ha-app-reader,
  .ha-app-reader__panel,
  .ha-app-reader__tab,
  .ha-app-reader__cta,
  .ha-app-reader__close {
    transition: none !important;
  }
  .ha-app-reader__tab-shine { animation: none !important; }
}
