/* ViralSpy dashboard host wrapper — additive chrome around the unchanged app.
   Brand: teal #02403d, lime #d1f811, orange #f77b48. */

.athr-host {
  --athr-teal: #02403d;
  --athr-teal-2: #035c56;
  --athr-lime: #d1f811;
  --athr-orange: #f77b48;
  --athr-ink: #eafaf6;
  position: relative;
  width: 100%;
  min-height: 80vh;
  font-family: system-ui, "Segoe UI", Tahoma, "IBM Plex Sans Arabic", sans-serif;
}

/* ---------- License gate ---------- */
.athr-gate {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
  padding: 24px;
}
.athr-gate-card {
  background: var(--athr-teal);
  color: var(--athr-ink);
  border-radius: 20px;
  padding: 40px 32px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(2, 64, 61, 0.35);
}
.athr-gate-logo {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 18px;
}
.athr-gate-logo span { color: var(--athr-lime); }
.athr-gate-card h2 { margin: 0 0 6px; font-size: 19px; color: var(--athr-lime); }
.athr-gate-card p { margin: 0 0 20px; font-size: 13px; opacity: 0.85; line-height: 1.7; }
.athr-gate-card input {
  width: 100%;
  box-sizing: border-box;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid rgba(209, 248, 17, 0.3);
  background: rgba(255, 255, 255, 0.06);
  color: var(--athr-ink);
  font-size: 15px;
  letter-spacing: 1px;
  text-align: center;
  margin-bottom: 14px;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
}
.athr-gate-card input::placeholder { color: rgba(234, 250, 246, 0.4); }
.athr-gate-card button {
  width: 100%;
  padding: 13px;
  border: 0;
  border-radius: 12px;
  background: var(--athr-lime);
  color: var(--athr-teal);
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.1s, filter 0.1s;
}
.athr-gate-card button:hover { filter: brightness(1.05); }
.athr-gate-card button:active { transform: scale(0.98); }
.athr-gate-card button:disabled { opacity: 0.6; cursor: default; }
.athr-gate-err { color: var(--athr-orange); font-size: 13px; margin-top: 12px; min-height: 18px; }
.athr-gate-btn {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 13px;
  border-radius: 12px;
  background: var(--athr-lime);
  color: var(--athr-teal);
  font-weight: 800;
  font-size: 15px;
  text-decoration: none;
  margin-bottom: 12px;
}
.athr-gate-btn:hover { filter: brightness(1.05); }
.athr-gate-link { display: block; color: var(--athr-lime); font-size: 13px; margin-top: 8px; text-decoration: none; }
.athr-gate-link:hover { text-decoration: underline; }

/* Plan badge in the history sidebar */
.athr-plan-badge {
  margin: 0 12px 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(247, 123, 72, 0.15);
  color: #ffd9c7;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.athr-plan-badge.paid { background: rgba(209, 248, 17, 0.14); color: var(--athr-lime); }
.athr-upgrade {
  background: var(--athr-lime);
  color: var(--athr-teal);
  padding: 4px 10px;
  border-radius: 8px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}
.athr-upgrade:hover { filter: brightness(1.05); }

/* ---------- Capture button (top of sidebar) + compact footer ---------- */
.athr-capture-top { padding: 14px 12px 8px; text-align: center; }
.athr-capture-btn {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 13px 12px;
  border: 0;
  border-radius: 12px;
  background: var(--athr-lime);
  color: var(--athr-teal);
  font-weight: 800;
  font-size: 14px;
  text-align: center;
  text-decoration: none;
  cursor: grab;
  transition: filter 0.1s, transform 0.1s;
}
.athr-capture-btn:hover { filter: brightness(1.05); }
.athr-capture-btn:active { cursor: grabbing; transform: scale(0.98); }
.athr-capture-hint {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  opacity: 0.55;
  color: var(--athr-ink);
}
.athr-side-bottom { border-top: 1px solid rgba(255, 255, 255, 0.08); }
.athr-history-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  font-size: 12px;
}
.athr-foot-plan { color: #ffd9c7; opacity: 0.85; }
.athr-foot-plan.paid { color: var(--athr-teal); background: var(--athr-lime); font-weight: 800; padding: 3px 10px; border-radius: 999px; opacity: 1; }

/* Crown / PRO banner */
.athr-pro-banner {
  margin: 12px 12px 4px;
  padding: 9px 12px;
  border-radius: 12px;
  background: linear-gradient(90deg, #d1f811, #b5e000);
  color: #02403d;
  font-weight: 800;
  font-size: 13px;
  text-align: center;
  box-shadow: 0 4px 14px rgba(209, 248, 17, 0.3);
}

/* Serial box */
.athr-serial-box { padding: 8px 12px; }
.athr-serial-label { display: block; font-size: 10px; opacity: 0.55; margin-bottom: 3px; }
.athr-serial {
  display: block; font-size: 12px; letter-spacing: 0.5px;
  color: var(--athr-lime); background: rgba(255, 255, 255, 0.05);
  border: 1px dashed rgba(209, 248, 17, 0.4); border-radius: 8px; padding: 7px 8px;
  word-break: break-all; user-select: all;
}

/* Redeem */
.athr-redeem { padding: 8px 12px; font-size: 12px; }
.athr-redeem summary { cursor: pointer; color: var(--athr-lime); }
.athr-redeem input {
  width: 100%; box-sizing: border-box; margin-top: 8px; padding: 9px 10px;
  border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06); color: var(--athr-ink);
  font-family: ui-monospace, Menlo, monospace; text-align: center;
}
.athr-redeem button {
  width: 100%; margin-top: 6px; padding: 9px; border: 0; border-radius: 8px;
  background: var(--athr-lime); color: var(--athr-teal); font-weight: 800; cursor: pointer;
}
.athr-redeem-ok { margin: 8px 12px; padding: 8px; border-radius: 8px; background: rgba(209,248,17,.15); color: var(--athr-lime); font-size: 12px; text-align: center; }
.athr-redeem-err { margin: 8px 12px; padding: 8px; border-radius: 8px; background: rgba(247,123,72,.18); color: #ffd9c7; font-size: 12px; text-align: center; }

/* ---------- Pricing + checkout page ---------- */
.athr-pricing {
  --athr-teal: #02403d;
  --athr-lime: #d1f811;
  max-width: 920px;
  margin: 0 auto;
  font-family: system-ui, "Segoe UI", Tahoma, "IBM Plex Sans Arabic", sans-serif;
  direction: rtl;
  color: #123;
}
.athr-pay-error { background: #fde8e2; color: #b3270f; padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; }
.athr-pay-ok { background: #e8f7ec; color: #1c7a3b; padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; }
.athr-pay-ok a { color: #02403d; font-weight: 700; }
.athr-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: stretch; }
.athr-card {
  position: relative;
  border: 1px solid #d8e3e0;
  border-radius: 18px;
  padding: 26px 22px;
  background: #fff;
  display: flex;
  flex-direction: column;
}
.athr-card.best { border: 2px solid #1c7a3b; box-shadow: 0 16px 40px rgba(2, 64, 61, 0.12); }
.athr-card-badge {
  position: absolute; top: -13px; inset-inline-start: 50%; transform: translateX(50%);
  background: #1c7a3b; color: #fff; font-weight: 700; font-size: 12px;
  padding: 5px 14px; border-radius: 999px;
}
.athr-card-name { font-weight: 800; color: #02403d; margin-bottom: 8px; }
.athr-card-price { font-size: 15px; color: #123; margin-bottom: 2px; }
.athr-card-price strong { font-size: 34px; }
.athr-card-price .cur { font-size: 14px; opacity: 0.7; }
.athr-card-sub { font-size: 13px; opacity: 0.7; }
.athr-card-eq { font-size: 13px; font-weight: 700; color: #02403d; margin-top: 8px; }
.athr-card-save { display: inline-block; background: #eaf7ee; color: #1c7a3b; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 8px; margin-top: 8px; }
.athr-card-feats { list-style: none; padding: 0; margin: 16px 0; font-size: 14px; line-height: 2; flex: 1; }
.athr-card-cta {
  display: block; text-align: center; cursor: pointer;
  padding: 13px; border-radius: 12px; border: 1px solid #1c7a3b;
  background: #fff; color: #1c7a3b; font-weight: 800; font-size: 15px; text-decoration: none;
}
.athr-card-cta.primary { background: #1c7a3b; color: #fff; }
.athr-card-cta:hover { filter: brightness(0.97); }
.athr-cards-note { text-align: center; font-size: 13px; opacity: 0.65; margin: 18px 0 26px; }

.athr-checkout {
  background: #fff; border: 1px solid #d8e3e0; border-radius: 18px;
  padding: 26px; max-width: 560px; margin: 0 auto; box-shadow: 0 16px 40px rgba(2, 64, 61, 0.08);
}
.athr-checkout h3 { margin: 0 0 16px; color: #02403d; }
.athr-co-hint { font-size: 14px; opacity: 0.8; }
.athr-checkout input {
  width: 100%; box-sizing: border-box; padding: 13px 14px; margin-bottom: 12px;
  border: 1px solid #cdd; border-radius: 10px; font-size: 15px;
}
.athr-co-login { font-size: 13px; margin-bottom: 12px; }
.athr-co-login a, .athr-co-pay strong { color: #02403d; }
.athr-co-pay { background: #eef7f4; border-radius: 10px; padding: 12px 14px; font-size: 13px; margin: 8px 0 16px; }
.athr-co-submit {
  width: 100%; padding: 15px; border: 0; border-radius: 12px;
  background: #1c7a3b; color: #fff; font-weight: 800; font-size: 16px; cursor: pointer;
}
.athr-co-submit:hover { filter: brightness(1.05); }
@media (max-width: 760px) { .athr-cards { grid-template-columns: 1fr; } }

/* ---------- Capture modal ---------- */
.athr-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(2, 32, 30, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.athr-modal[hidden] { display: none; }
.athr-modal-card {
  position: relative;
  background: #fff;
  color: #123;
  border-radius: 16px;
  padding: 26px;
  max-width: 560px;
  width: 100%;
  max-height: 88vh;
  overflow: auto;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.4);
  direction: rtl;
  text-align: right;
}
.athr-modal-card h2 { margin: 0 0 10px; color: #02403d; }
.athr-modal-x {
  position: absolute;
  inset-inline-start: 14px;
  top: 12px;
  border: 0;
  background: #eef3f2;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  color: #02403d;
}
.athr-modal-x:hover { background: #f77b48; color: #fff; }

/* ---------- Shell: history sidebar + iframe ---------- */
/* Full-screen: the dashboard fills the whole viewport like the native report,
   breaking out of the theme's narrow content column. inset:0 stretches it to
   all four edges (no 100vw — that would add the scrollbar width and overflow). */
.athr-shell {
  position: fixed;
  inset: 0;
  display: flex;
  gap: 0;
  border-radius: 0;
  overflow: hidden;
  background: var(--athr-teal);
  z-index: 99990;
}
/* Keep the WordPress admin bar usable when logged in. */
body.admin-bar .athr-shell { top: 32px; }
@media screen and (max-width: 782px) {
  body.admin-bar .athr-shell { top: 46px; }
}
.athr-history {
  width: 260px;
  flex: 0 0 260px;
  background: var(--athr-teal);
  color: var(--athr-ink);
  display: flex;
  flex-direction: column;
  border-inline-end: 1px solid rgba(255, 255, 255, 0.08);
}
.athr-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 12px;
  font-weight: 800;
  font-size: 15px;
  color: var(--athr-lime);
}
.athr-logout {
  background: rgba(255, 255, 255, 0.08);
  border: 0;
  color: var(--athr-ink);
  width: 28px;
  height: 28px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}
.athr-logout:hover { background: rgba(247, 123, 72, 0.25); }
.athr-history-actions { padding: 0 12px 10px; }
.athr-newscan {
  display: block;
  text-align: center;
  padding: 10px;
  border-radius: 10px;
  background: var(--athr-lime);
  color: var(--athr-teal);
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
}
.athr-newscan:hover { filter: brightness(1.05); }
.athr-history-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 10px 16px;
}
.athr-empty {
  padding: 24px 10px;
  text-align: center;
  font-size: 13px;
  opacity: 0.6;
  line-height: 1.8;
}
.athr-acct { margin-bottom: 14px; }
.athr-acct-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 6px 8px;
}
.athr-acct-name { font-weight: 700; font-size: 13px; }
.athr-acct-meta { font-size: 11px; opacity: 0.6; }
.athr-scan {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 10px;
  margin: 2px 0;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--athr-ink);
  cursor: pointer;
  text-align: start;
  font-size: 12px;
  transition: background 0.12s;
}
.athr-scan:hover { background: rgba(255, 255, 255, 0.1); }
.athr-scan.is-active {
  background: rgba(209, 248, 17, 0.16);
  box-shadow: inset 2px 0 0 var(--athr-lime);
}
.athr-scan-when { font-weight: 600; }
.athr-scan-meta { opacity: 0.6; font-size: 11px; }

.athr-frame-wrap { flex: 1; min-width: 0; background: #fff; position: relative; }

/* Scripts button in sidebar */
.athr-scripts-btn {
  display: block;
  margin: 0 12px 8px;
  padding: 10px;
  text-align: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--athr-lime);
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  border: 1px solid rgba(209, 248, 17, 0.25);
}
.athr-scripts-btn:hover { background: rgba(209, 248, 17, 0.12); }

/* Transcription usage meter */
.athr-usage { margin: 0 12px 10px; font-size: 11px; color: var(--athr-ink); }
.athr-usage[hidden] { display: none; }
.athr-usage-row { display: flex; justify-content: space-between; opacity: 0.8; margin-bottom: 4px; }
.athr-usage-bar { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.athr-usage-bar i { display: block; height: 100%; background: var(--athr-lime); border-radius: 999px; }

/* Scripts panel (overlays the report area) */
.athr-scripts-panel {
  position: absolute;
  inset: 0;
  background: #f4f7f6;
  z-index: 5;
  display: flex;
  flex-direction: column;
  direction: rtl;
}
.athr-scripts-panel[hidden] { display: none; }
.athr-scripts-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  background: var(--athr-teal);
  color: #fff;
}
.athr-scripts-head h2 { margin: 0; font-size: 18px; color: var(--athr-lime); }
.athr-scripts-close {
  width: 34px; height: 34px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, 0.12); color: #fff; font-size: 20px; cursor: pointer;
}
.athr-scripts-close:hover { background: var(--athr-orange); }
.athr-scripts-list { flex: 1; overflow-y: auto; padding: 22px; }

.athr-sc-card {
  background: #fff;
  border: 1px solid #e3eae8;
  border-radius: 16px;
  padding: 18px;
  margin: 0 auto 18px;
  max-width: 760px;
  box-shadow: 0 6px 20px rgba(2, 64, 61, 0.05);
}
.athr-sc-top { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.athr-sc-thumb { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; flex: 0 0 64px; background: #02403d; }
.athr-sc-thumb.ph { display: flex; align-items: center; justify-content: center; font-size: 26px; color: #d1f811; }
.athr-sc-meta { flex: 1; min-width: 0; }
.athr-sc-user { font-weight: 800; color: #02403d; }
.athr-sc-cap { color: #5a6b65; font-size: 13px; margin: 2px 0 6px; }
.athr-sc-open { color: #1c7a3b; font-weight: 700; font-size: 13px; }
.athr-sc-block {
  position: relative;
  background: #f6f8f7;
  border: 1px solid #e6ece9;
  border-radius: 12px;
  padding: 14px 14px 14px;
  margin-top: 10px;
}
.athr-sc-block.gen { background: #eef7f4; border-color: #cfe9df; }
.athr-sc-label { font-weight: 800; color: #02403d; font-size: 13px; margin-bottom: 8px; }
.athr-sc-text { white-space: pre-wrap; font-size: 14px; line-height: 1.9; color: #1b2b26; max-height: 360px; overflow-y: auto; }
.athr-sc-copy {
  position: absolute; top: 10px; inset-inline-start: 12px;
  border: 0; background: #02403d; color: #d1f811; font-weight: 700;
  padding: 5px 12px; border-radius: 8px; font-size: 12px; cursor: pointer;
}
.athr-sc-copy:hover { filter: brightness(1.1); }
.athr-sc-date { text-align: left; color: #9aa8a3; font-size: 11px; margin-top: 10px; }
.athr-frame-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* ---------- Bookmarklet page ---------- */
.athr-book {
  max-width: 640px;
  margin: 0 auto;
  font-family: system-ui, "Segoe UI", Tahoma, "IBM Plex Sans Arabic", sans-serif;
  color: #123;
}
.athr-book h2 { color: #02403d; }
.athr-book-steps { font-size: 15px; }
.athr-book input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #cdd;
  font-size: 15px;
  letter-spacing: 1px;
  font-family: ui-monospace, Menlo, monospace;
  margin-bottom: 8px;
}
.athr-book-status { color: #f77b48; font-size: 13px; min-height: 18px; margin-bottom: 8px; }
.athr-book-btn {
  display: inline-block;
  padding: 14px 22px;
  border-radius: 12px;
  background: #d1f811;
  color: #02403d;
  font-weight: 800;
  font-size: 16px;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(2, 64, 61, 0.18);
  cursor: grab;
}
.athr-book-or { font-size: 13px; opacity: 0.7; margin-top: 18px; }
.athr-book textarea {
  width: 100%;
  box-sizing: border-box;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 11px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #cdd;
  resize: vertical;
}
.athr-book-copy {
  margin-top: 8px;
  padding: 10px 18px;
  border: 0;
  border-radius: 10px;
  background: #02403d;
  color: #eafaf6;
  font-weight: 700;
  cursor: pointer;
}
.athr-book-how { margin-top: 28px; padding: 18px; background: #f3faf8; border-radius: 12px; }
.athr-book-how h3 { margin-top: 0; color: #02403d; }
.athr-book-how ol { line-height: 2; }

.athr-book-btn.small { font-size: 14px; padding: 9px 16px; margin-inline-end: 6px; }
.athr-step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: #f3faf8;
  border-radius: 14px;
  padding: 18px;
  margin: 14px 0;
}
.athr-step-num {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #02403d;
  color: #d1f811;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
}
.athr-step-body { flex: 1; }
.athr-step-body h3 { margin: 2px 0 8px; color: #02403d; }
.athr-step-body p { margin: 6px 0; }
.athr-book-fallback { margin-top: 22px; font-size: 14px; }
.athr-book-fallback summary { cursor: pointer; color: #02403d; font-weight: 600; }
.athr-book-fallback input[type="file"] { margin: 10px 0; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .athr-shell { flex-direction: column; height: auto; }
  .athr-history { width: 100%; flex: none; max-height: 240px; }
  .athr-frame-wrap { height: 80vh; }
}
