@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&amp;family=Space+Grotesk:wght@500;600&amp;display=swap');

body {
  font-family: 'Inter', system_ui, sans-serif;
}

.font-display {
  font-family: 'Space Grotesk', 'Inter', system_ui, sans-serif;
  font-weight: 600;
}

/* Today's Focus — market environment card tints (independent of Study grades) */
.daily-plan-card {
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
/* Score 10 — 10 above 21, both uptrending */
.daily-plan-card--mkt-Aplus {
  background-color: rgba(16, 185, 129, 0.18) !important;
  border-color: rgba(16, 185, 129, 0.65) !important;
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.15), 0 8px 24px -12px rgba(16, 185, 129, 0.35);
}
/* Score 9 — 10 downtrend or 10 under 21 (lighter amber so it reads apart from red) */
.daily-plan-card--mkt-A {
  background-color: rgba(251, 191, 36, 0.22) !important;
  border-color: rgba(252, 211, 77, 0.7) !important;
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.18), 0 8px 24px -12px rgba(251, 191, 36, 0.35);
}
/* Score 8 — 10/21 day downtrend */
.daily-plan-card--mkt-B {
  background-color: rgba(244, 63, 94, 0.16) !important;
  border-color: rgba(244, 63, 94, 0.6) !important;
  box-shadow: 0 0 0 1px rgba(244, 63, 94, 0.12), 0 8px 24px -12px rgba(244, 63, 94, 0.3);
}
.daily-market-select option {
  background-color: #0f172a;
  color: #e2e8f0;
}
.daily-sl-streak-input {
  -moz-appearance: textfield;
}
.daily-sl-streak-input::-webkit-outer-spin-button,
.daily-sl-streak-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.pyramid-card {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.pyramid-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.2), 0 4px 6px -4px rgb(0 0 0 / 0.2);
}

.pyramid-card.dragging {
  opacity: 0.6;
  transform: scale(0.98);
}

.level-section {
  min-height: 220px;
}

/* More breathing room between sections */
.mb-7 {
  margin-bottom: 2.5rem;
}

.position-card {
  background-color: #0f172a;
  border: 1px solid #1f2937;
}

.level-green .position-card { 
  border-color: #166534; 
}
.level-green .position-card:hover { 
  border-color: #4ade80; 
  background-color: #052e16;
}

.level-blue .position-card { 
  border-color: #1e40af; 
}
.level-blue .position-card:hover { 
  border-color: #60a5fa; 
  background-color: #0c2a3d;
}

.level-red .position-card { 
  border-color: #9f1239; 
}
.level-red .position-card:hover { 
  border-color: #fb7185; 
  background-color: #2a1515;
}

.level-trailing .position-card { 
  border-color: #b45309; 
}
.level-trailing .position-card:hover { 
  border-color: #fbbf24; 
  background-color: #451a03;
}

.level-header {
  font-weight: 700;
  letter-spacing: -.02em;
}

.card-ticker {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -.04em;
  font-family: 'Space Grotesk', 'Inter', system_ui, sans-serif;
}

.notes-area {
  background-color: #020617;
  border: 1px solid #1e2937;
  font-size: 0.875rem;
  line-height: 1.35;
}

.pyramid-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.section-header {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -.025em;
}

.modal {
  animation: modalPop 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalPop {
  from { transform: scale(0.92) translateY(15px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.stat-pill {
  background-color: #0f172a;
  border: 1px solid #334155;
}

.drop-zone {
  transition: background-color 0.15s ease;
}

.drop-zone.drag-over {
  background-color: #1e2937;
  border-color: #64748b;
}

.pyramid-card.drop-target {
  outline: 2px dashed #64748b;
  outline-offset: -3px;
}

.nav-tab {
  transition: all 0.15s ease;
}

.nav-tab.active {
  background-color: #1e2937;
  color: #fff;
  border-bottom: 2px solid #10b981;
  border-radius: 0.75rem;
}

.subnav-pill {
  transition: all 0.15s ease;
}
.subnav-pill.active {
  background-color: #334155;
  color: #fff;
  border-color: #10b981;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  border: 1px solid #334155;
  background: #0f172a;
  color: #94a3b8;
  text-transform: uppercase;
}
.status-chip.on {
  border-color: rgba(16, 185, 129, 0.45);
  color: #34d399;
  background: rgba(6, 78, 59, 0.35);
}
.status-chip.warn {
  border-color: rgba(251, 191, 36, 0.4);
  color: #fbbf24;
}

.linked-highlight {
  border-color: #64748b;
  box-shadow: 0 0 0 2px rgba(100, 116, 139, 0.15);
}

/* ==================== STUDY ==================== */
.study-tool-btn.active {
  background-color: rgba(16, 185, 129, 0.2);
  border-color: #10b981;
  color: #6ee7b7;
}

.study-card {
  cursor: pointer;
}

.study-card-delete {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}
.study-card:hover .study-card-delete,
.study-card:focus-within .study-card-delete {
  opacity: 1;
  pointer-events: auto;
}

/* Setup grade on library cards (bottom-right; same colors as editor final badge) */
.study-card-grade {
  position: absolute;
  right: 0.5rem;
  bottom: 0.5rem;
  z-index: 5;
  font-size: 0.75rem;
  min-width: 1.75rem;
  padding: 0.1rem 0.4rem;
  line-height: 1.2;
  pointer-events: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}
.study-card-grade.study-grade-empty {
  font-size: 0.7rem;
  opacity: 0.85;
}

.study-card-thumb {
  min-height: 120px;
}

.study-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
  border: 1px solid #334155;
  color: #94a3b8;
  background: #0f172a;
}

#study-canvas-wrap.study-drop-active {
  outline: 2px dashed #10b981;
  outline-offset: -4px;
  background-color: rgba(6, 78, 59, 0.25);
}

#study-draw-canvas {
  touch-action: none;
}

#study-canvas-wrap {
  width: 100%;
  /* overflow-auto set in HTML for pan-when-zoomed */
}

#study-zoom-stage {
  position: relative;
  margin-left: auto;
  margin-right: auto;
}

#study-image {
  display: block;
  margin: 0;
}

#study-zoom-controls button:disabled {
  cursor: default;
}

/* Daily Report Card */
.drc-select,
.drc-input {
  background-color: #020617;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  color: #e2e8f0;
  font-size: 0.8rem;
  padding: 0.35rem 0.45rem;
  outline: none;
}
.drc-select:focus,
.drc-input:focus {
  border-color: #10b981;
}
.drc-input {
  min-width: 8rem;
}

/* DRC archive sidebar */
.drc-archive-month-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  text-align: left;
  padding: 0.4rem 0.35rem;
  border-radius: 0.5rem;
  border: none;
  background: transparent;
  color: #cbd5e1;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}
.drc-archive-month-btn:hover {
  background: rgba(30, 41, 59, 0.8);
  color: #f1f5f9;
}
.drc-archive-chevron {
  font-size: 0.55rem;
  color: #64748b;
  width: 0.75rem;
}
.drc-archive-count {
  margin-left: auto;
  font-size: 0.65rem;
  font-weight: 500;
  color: #64748b;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 999px;
  padding: 0.05rem 0.4rem;
}
.drc-archive-days {
  list-style: none;
  margin: 0 0 0.35rem 0;
  padding: 0 0 0 0.85rem;
}
.drc-archive-day {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  text-align: left;
  padding: 0.3rem 0.4rem;
  margin: 0.1rem 0;
  border-radius: 0.45rem;
  border: 1px solid transparent;
  background: transparent;
  color: #94a3b8;
  font-size: 0.75rem;
  cursor: pointer;
}
.drc-archive-day:hover {
  background: rgba(16, 185, 129, 0.08);
  color: #e2e8f0;
  border-color: rgba(16, 185, 129, 0.25);
}
.drc-archive-day.active {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.4);
  font-weight: 600;
}
.drc-archive-grade {
  font-size: 0.65rem;
  font-weight: 700;
  color: #64748b;
}
.drc-archive-day.active .drc-archive-grade {
  color: #34d399;
}

/* Research stats — percent must stay readable without relying on Tailwind JIT */
.research-result-card {
  background-color: #020617;
  border: 1px solid rgba(16, 185, 129, 0.35);
}
.research-result-pct {
  display: block;
  font-size: 3.25rem;
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #34d399;
  min-height: 1.1em;
  min-width: 4ch;
}
.research-result-count {
  font-size: 0.95rem;
  font-weight: 500;
  color: #e2e8f0;
}
.research-result-track {
  background-color: #1e293b;
}
.research-result-bar {
  transition: width 0.25s ease;
  background: linear-gradient(90deg, #059669, #34d399);
  min-height: 100%;
}
.research-mini-grade {
  font-size: 10px;
  min-width: 1.6rem;
  padding: 0.1rem 0.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Setup scorecard */
.study-grade-row {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.study-grade-label {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 500;
}
.study-grade-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.study-grade-btn {
  min-width: 2.1rem;
  padding: 0.25rem 0.45rem;
  font-size: 11px;
  font-weight: 700;
  border-radius: 0.5rem;
  border: 1px solid #334155;
  background: #0f172a;
  color: #94a3b8;
  line-height: 1.2;
}
.study-grade-btn:hover {
  border-color: #64748b;
  color: #e2e8f0;
}
.study-grade-btn-wide {
  min-width: 6.5rem;
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.01em;
}
/* Lowest score (C / 80–84 / market 10&21↓+3SL) — red */
.study-grade-btn.active[data-grade="C"] {
  border-color: #fb7185;
  background: rgba(244, 63, 94, 0.15);
  color: #fda4af;
}
.study-grade-btn.active[data-grade="B"] {
  border-color: #38bdf8;
  background: rgba(14, 165, 233, 0.2);
  color: #7dd3fc;
}
.study-grade-btn.active[data-grade="A"] {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
}
.study-grade-btn.active[data-grade="A+"] {
  border-color: #fbbf24;
  background: rgba(251, 191, 36, 0.18);
  color: #fcd34d;
}
.study-grade-final-badge {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  min-width: 2.5rem;
  text-align: center;
  padding: 0.15rem 0.55rem;
  border-radius: 0.5rem;
  border: 1px solid #334155;
}
.study-grade-final-badge.study-grade-empty {
  color: #64748b;
  font-size: 0.95rem;
  font-weight: 600;
}
.study-grade-final-badge.grade-F {
  color: #fda4af;
  border-color: #fb7185;
  background: rgba(244, 63, 94, 0.15);
}
.study-grade-final-badge.grade-C {
  color: #fda4af;
  border-color: #fb7185;
  background: rgba(244, 63, 94, 0.18);
}
.study-grade-final-badge.grade-B {
  color: #7dd3fc;
  border-color: #38bdf8;
  background: rgba(14, 165, 233, 0.15);
}
.study-grade-final-badge.grade-A {
  color: #6ee7b7;
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.15);
}
.study-grade-final-badge.grade-Aplus {
  color: #fcd34d;
  border-color: #fbbf24;
  background: rgba(251, 191, 36, 0.15);
}

#study-tag-legend .study-tag {
  margin-top: 1px;
}

/* Multi-image strip in study editor */
.study-img-thumb {
  width: 56px;
  height: 40px;
  border-radius: 0.5rem;
  border: 1px solid #334155;
  background: #0f172a;
  overflow: hidden;
  padding: 0;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.study-img-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.study-img-thumb.active {
  border-color: #10b981;
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.45);
}
.study-img-thumb:hover {
  border-color: #64748b;
}

.study-nav-overlay {
  transition: opacity 0.15s ease, background-color 0.15s ease;
  opacity: 0.55;
}
#study-canvas-wrap:hover ~ .study-nav-overlay:not(:disabled),
.study-nav-overlay:hover:not(:disabled) {
  opacity: 1;
}
/* parent hover also reveals nav */
.relative:hover > .study-nav-overlay:not(:disabled) {
  opacity: 1;
}

.study-folder-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
  border: 1px solid #334155;
  color: #94a3b8;
  background: #0f172a;
}

#study-folder {
  color-scheme: dark;
}

.link-target {
  outline: 2px solid #64748b;
  outline-offset: -2px;
}

/* Hide native date picker calendar icon */
input[type="date"]::-webkit-calendar-picker-indicator {
  display: none;
  -webkit-appearance: none;
}
input[type="date"] {
  color-scheme: dark;
}
/* Cloud sync (Phase E1) */
.cloud-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid #334155;
  background: #0f172a;
  color: #94a3b8;
}
.cloud-status-ok {
  border-color: rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.12);
  color: #6ee7b7;
}
.cloud-status-warn {
  border-color: rgba(251, 191, 36, 0.45);
  background: rgba(251, 191, 36, 0.1);
  color: #fcd34d;
}
.cloud-status-muted {
  border-color: #334155;
  color: #94a3b8;
}
#status-chip-cloud.status-chip-on {
  border-color: rgba(56, 189, 248, 0.4);
  color: #7dd3fc;
}
