/* BT Yield-only aesthetics overrides
   - Match Basis polish, but with a BTC / yield vibe (orange accent).
   - Light theme only. */

body[data-app="btyield"] {
  color-scheme: light;

  /* BTC / yield accent */
  --primary-color: #f7931a; /* Bitcoin orange */
  --primary-dark: #d97706; /* amber-600 */
  --primary-gradient: linear-gradient(135deg, #f7931a 0%, #f59e0b 55%, #fde047 100%);
  --accent-color: #f7931a;
  --accent-hover: #d97706;

  --bg-primary: #fffaf3;
  --bg-secondary: #ffffff;
  --bg-tertiary: #fff7ed;
  --bg-card: rgba(255, 255, 255, 0.92);
  --bg-glass: rgba(255, 255, 255, 0.74);

  --text-primary: #3b1d0b;
  --text-secondary: #4a2a13;
  --text-muted: #7a4b2a;

  --border-color: rgba(247, 147, 26, 0.20);
  --border-hover: rgba(245, 158, 11, 0.26);

  --shadow-sm: 0 4px 14px rgba(60, 24, 7, 0.06);
  --shadow-md: 0 16px 40px rgba(60, 24, 7, 0.10);
  --shadow-lg: 0 28px 70px rgba(60, 24, 7, 0.14);
  --shadow-glow: 0 0 26px rgba(247, 147, 26, 0.18);

  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
}

body[data-app="btyield"]::before {
  opacity: 0.55;
}

body[data-app="btyield"] {
  background:
    radial-gradient(1100px 520px at 12% 5%, rgba(247, 147, 26, 0.13), transparent 60%),
    radial-gradient(900px 420px at 86% 10%, rgba(253, 224, 71, 0.10), transparent 58%),
    linear-gradient(180deg, #fffaf3 0%, #fff7ed 45%, #fffaf3 100%);
  background-attachment: fixed, fixed, fixed;
}

/* Header polish */
body[data-app="btyield"] .header {
  background: rgba(255, 255, 255, 0.90);
  border-bottom-color: var(--border-color);
  box-shadow: 0 14px 44px rgba(60, 24, 7, 0.08);
}

/* Sign out parity */
body[data-app="btyield"] .signout {
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--border-color);
  background: var(--bg-glass);
  color: var(--text-primary);
  font-weight: 650;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease,
    border-color 0.15s ease, background 0.15s ease;
}

body[data-app="btyield"] .signout:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-hover);
  background: var(--bg-secondary);
}

body[data-app="btyield"] .signout:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

/* Hero */
body[data-app="btyield"] .dashboard-header h1 {
  letter-spacing: -0.03em;
  font-weight: 860;
}

body[data-app="btyield"] .dashboard-header p {
  color: rgba(74, 42, 19, 0.92);
}

body[data-app="btyield"] .btyield-subtitle {
  max-width: 70ch;
  margin: 0 auto;
}

/* Compact “data source” pill */
body[data-app="btyield"] .source-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
  color: var(--text-secondary);
  font-weight: 650;
}

body[data-app="btyield"] .pill-label {
  font-weight: 780;
  color: var(--text-primary);
}

body[data-app="btyield"] .pill-meta {
  font-weight: 650;
}

body[data-app="btyield"] .pill-dot {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: rgba(74, 42, 19, 0.35);
}

/* Live badge */
body[data-app="btyield"] .live-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(247, 147, 26, 0.95);
  box-shadow: 0 0 0 4px rgba(247, 147, 26, 0.14);
}

body[data-app="btyield"] .live-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.70);
  color: var(--text-primary);
  font-weight: 750;
}

/* Download panel */
body[data-app="btyield"] .download-panel {
  border-radius: var(--radius-xl);
  border: 1px solid rgba(247, 147, 26, 0.22);
  background:
    radial-gradient(900px 240px at 10% 10%, rgba(247, 147, 26, 0.10), transparent 60%),
    radial-gradient(700px 200px at 90% 25%, rgba(253, 224, 71, 0.10), transparent 55%),
    rgba(255,255,255,0.86);
  backdrop-filter: blur(16px);
  box-shadow: 0 18px 60px rgba(60, 24, 7, 0.10);
  padding: 16px 16px 14px;
  position: relative;
  overflow: hidden;
}

body[data-app="btyield"] .download-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.65);
}

/* Factsheet button (BT Yield) */
body[data-app="btyield"] #factsheet-btn.factsheet-btn {
  border-color: rgba(247, 147, 26, 0.35);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 28px rgba(247, 147, 26, 0.14);
}

body[data-app="btyield"] #factsheet-btn.factsheet-btn:hover {
  border-color: rgba(247, 147, 26, 0.48);
  background: #ffffff;
  box-shadow: 0 14px 36px rgba(247, 147, 26, 0.16);
}

/* BTC icon */
body[data-app="btyield"] .btc-icon {
  width: 22px;
  height: 22px;
  margin-right: 8px;
  vertical-align: -5px;
  border-radius: 8px;
  object-fit: cover;
  background: rgba(255,255,255,0.75);
  box-shadow: 0 10px 22px rgba(60, 24, 7, 0.10);
  filter: saturate(1.05) drop-shadow(0 10px 22px rgba(247,147,26,0.12));
}

/* Hero watermark */
body[data-app="btyield"] .btc-watermark {
  position: absolute;
  left: 50%;
  top: -28px;
  transform: translateX(-50%) rotate(-10deg);
  width: min(520px, 86vw);
  max-width: 620px;
  opacity: 0.12;
  z-index: -1;
  pointer-events: none;
  user-select: none;
  filter: blur(0.2px) drop-shadow(0 40px 70px rgba(247, 147, 26, 0.10));
}

@media (max-width: 640px) {
  body[data-app="btyield"] .btc-watermark {
    top: -10px;
    opacity: 0.08;
  }
}

/* Hero logo (explicit branding) */
body[data-app="btyield"] .hero-logo {
  display: block;
  width: 58px;
  height: 58px;
  margin: 0 auto 10px;
  border-radius: 18px;
  object-fit: cover;
  background: rgba(255,255,255,0.9);
  box-shadow: 0 22px 50px rgba(60, 24, 7, 0.14);
}

/* Range / denom row (Basis parity) */
body[data-app="btyield"] .range-row {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}

body[data-app="btyield"] .range-row .chart-controls {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
}

body[data-app="btyield"] .denom-controls .time-button.active {
  background: linear-gradient(135deg, rgba(247, 147, 26, 0.18), rgba(253, 224, 71, 0.18));
  border-color: rgba(247, 147, 26, 0.34);
  color: color-mix(in srgb, var(--primary-color) 72%, var(--text-primary));
  box-shadow: 0 14px 34px rgba(247, 147, 26, 0.18);
}

/* Two-column layout (Basis parity) */
body[data-app="btyield"] .two-col {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 22px;
  margin-top: 22px;
}

@media (max-width: 1100px) {
  body[data-app="btyield"] .two-col { grid-template-columns: 1fr; }
}

/* Download panel structure (Basis parity) */
body[data-app="btyield"] .download-panel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

body[data-app="btyield"] .download-panel-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr auto;
  gap: 12px;
}

@media (max-width: 900px) {
  body[data-app="btyield"] .download-panel-grid { grid-template-columns: 1fr; }
}

body[data-app="btyield"] #dw-status {
  margin: 0;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(247, 147, 26, 0.22);
  background: rgba(247, 147, 26, 0.08);
  color: var(--text-primary);
  font-weight: 850;
  font-size: 12px;
}

body[data-app="btyield"] .download-panel .dw-presets {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

body[data-app="btyield"] .download-panel .dw-presets button {
  border: 1px solid rgba(247, 147, 26, 0.22);
  background: rgba(255,255,255,0.88);
  border-radius: 999px;
  padding: 9px 12px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  color: var(--text-primary);
  box-shadow: 0 10px 24px rgba(60, 24, 7, 0.06);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, background .15s ease;
}

body[data-app="btyield"] .download-panel .dw-presets button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(60, 24, 7, 0.10);
  border-color: rgba(245, 158, 11, 0.36);
}

body[data-app="btyield"] .download-panel .dw-presets button.active {
  border-color: rgba(247, 147, 26, 0.34);
  background: linear-gradient(135deg, rgba(247, 147, 26, 0.14), rgba(253, 224, 71, 0.14));
  box-shadow: 0 18px 38px rgba(247, 147, 26, 0.16);
}

body[data-app="btyield"] .download-panel .dw-field .dw-label {
  display: block;
  margin-bottom: 8px;
}

body[data-app="btyield"] .download-panel input[type="date"],
body[data-app="btyield"] .download-panel select {
  border: 1px solid rgba(247, 147, 26, 0.22);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.92);
  color: var(--text-primary);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.55);
}

body[data-app="btyield"] .download-panel .dw-cta {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

body[data-app="btyield"] .download-panel .dw-cta .primary {
  width: 100%;
  min-width: 160px;
}

body[data-app="btyield"] #dw-download[disabled],
body[data-app="btyield"] #factsheet-btn.factsheet-btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  filter: grayscale(0.15);
  transform: none !important;
}

body[data-app="btyield"] #dw-download.primary {
  background: linear-gradient(135deg, #f7931a 0%, #f59e0b 55%, #fde047 100%);
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 900;
  letter-spacing: 0.02em;
  color: #2a1207;
  box-shadow: 0 18px 44px rgba(247, 147, 26, 0.22);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}

body[data-app="btyield"] #dw-download.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 26px 60px rgba(247, 147, 26, 0.30);
  filter: brightness(1.02);
}

body[data-app="btyield"] #dw-download.primary::before {
  content: "↓";
  font-weight: 900;
  margin-right: 10px;
}

body[data-app="btyield"] .dw-raw-links {
  margin-top: 8px;
  font-size: 12px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

body[data-app="btyield"] .dw-raw-links a {
  text-decoration: none;
  color: rgba(74, 42, 19, 0.82);
  border-bottom: 1px dashed rgba(247, 147, 26, 0.40);
  padding-bottom: 1px;
}

body[data-app="btyield"] .dw-raw-links a:hover {
  color: rgba(59, 29, 11, 0.95);
  border-bottom-style: solid;
}

/* Monthly tiles */
body[data-app="btyield"] .heatmap {
  display: grid;
  grid-template-columns: repeat(4, minmax(200px, 1fr));
  gap: 14px;
}

@media (max-width: 1100px) {
  body[data-app="btyield"] .heatmap { grid-template-columns: repeat(2, minmax(220px, 1fr)); }
}

@media (max-width: 650px) {
  body[data-app="btyield"] .heatmap { grid-template-columns: 1fr; }
}

body[data-app="btyield"] .month-card {
  border-radius: 18px;
  border: 1px solid rgba(247, 147, 26, 0.18);
  background: #ffffff;
  box-shadow: 0 14px 44px rgba(60, 24, 7, 0.08);
  padding: 14px 14px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 78px;
}

body[data-app="btyield"] .month-card.pos {
  background:
    radial-gradient(420px 140px at 10% 10%, rgba(22, 163, 74, 0.16), transparent 55%),
    linear-gradient(180deg, #ffffff 0%, rgba(22, 163, 74, 0.06) 100%);
  border-color: rgba(22, 163, 74, 0.24);
}

body[data-app="btyield"] .month-card.neg {
  background:
    radial-gradient(420px 140px at 10% 10%, rgba(239, 68, 68, 0.14), transparent 55%),
    linear-gradient(180deg, #ffffff 0%, rgba(239, 68, 68, 0.05) 100%);
  border-color: rgba(239, 68, 68, 0.22);
}

body[data-app="btyield"] .month-name {
  font-weight: 900;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  font-size: 14px;
}

body[data-app="btyield"] .month-val {
  font-size: 26px;
  font-weight: 900;
}

/* Footer disclaimer */
body[data-app="btyield"] .btyield-footer {
  margin: 18px 0 40px;
}

body[data-app="btyield"] .btyield-disclaimer {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(247, 147, 26, 0.18);
  background: rgba(255,255,255,0.84);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
  padding: 14px 16px;
  color: rgba(74, 42, 19, 0.84);
  font-size: 12px;
  line-height: 1.55;
}

