@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=Orbitron:wght@400;700;900&display=swap');

#embedded-ai-root {
  font-family: 'Share Tech Mono', monospace;
  background: #0A0A0F;
  color: #E8E8F0;
  max-width: 1100px;
  margin: 0 auto;
}

#embedded-ai-root * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Reset the global button rule from com.css (width:119px; height:34px; background:black) */
#embedded-ai-root button {
  width: auto;
  height: auto;
  background-color: transparent;
  border: none;
  padding: 0;
  font-family: 'Share Tech Mono', monospace;
  font-size: inherit;
  color: inherit;
  cursor: pointer;
}

#embedded-ai-root .cr {
  font-family: 'Share Tech Mono', monospace;
  background: #0A0A0F;
  min-height: calc(100vh - 80px);
  color: #E8E8F0;
  position: relative;
  overflow: hidden;
}

/* Scanline overlay — absolute so it clips to .cr */
#embedded-ai-root .scanline {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 255, 156, 0.01) 2px,
    rgba(0, 255, 156, 0.01) 4px
  );
}

/* ── Header ── */
#embedded-ai-root .cr-hdr {
  position: relative;
  z-index: 1;
  padding: 28px 36px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: linear-gradient(180deg, rgba(0, 255, 156, 0.035) 0%, transparent 100%);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

#embedded-ai-root .cr-hdr-label {
  font-family: 'Orbitron', monospace;
  font-size: 8px;
  letter-spacing: 4px;
  color: #00FF9C;
  margin-bottom: 7px;
  opacity: 0.75;
}

#embedded-ai-root .cr-hdr-title {
  font-family: 'Orbitron', monospace;
  font-size: 24px;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.5px;
}

#embedded-ai-root .cr-hdr-title span {
  color: #00FF9C;
}

#embedded-ai-root .cr-hdr-sub {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.3);
  letter-spacing: 1.5px;
  margin-top: 7px;
}

#embedded-ai-root .cr-stats {
  display: flex;
  gap: 28px;
  margin-top: 18px;
  flex-wrap: wrap;
}

#embedded-ai-root .cr-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

#embedded-ai-root .cr-stat-v {
  font-family: 'Orbitron', monospace;
  font-size: 20px;
  font-weight: 700;
  color: #00FF9C;
}

#embedded-ai-root .cr-stat-l {
  font-size: 8px;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.3);
  text-transform: uppercase;
}

/* ── Season toggle ── */
#embedded-ai-root .cr-season-toggle {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

#embedded-ai-root .cr-s-btn {
  width: auto;
  height: auto;
  padding: 6px 14px;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: all 0.15s;
  white-space: nowrap;
}

#embedded-ai-root .cr-s-btn:hover {
  border-color: rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.6);
}

#embedded-ai-root .cr-s-btn.active {
  background: #00FF9C;
  border-color: #00FF9C;
  color: #0A0A0F;
  font-weight: bold;
}

/* ── Phase nav ── */
#embedded-ai-root .cr-phase-nav {
  display: flex;
  gap: 0;
  padding: 14px 36px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  overflow-x: auto;
  scrollbar-width: none;
  position: relative;
  z-index: 1;
  background: rgba(0, 0, 0, 0.2);
}

#embedded-ai-root .cr-phase-nav::-webkit-scrollbar {
  display: none;
}

#embedded-ai-root .cr-p-btn {
  width: auto;
  height: auto;
  flex-shrink: 0;
  padding: 7px 18px;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-right: none;
  color: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  font-family: 'Share Tech Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  transition: all 0.15s;
  white-space: nowrap;
}

#embedded-ai-root .cr-p-btn:first-child {
  border-radius: 4px 0 0 4px;
}

#embedded-ai-root .cr-p-btn:last-child {
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 0 4px 4px 0;
}

#embedded-ai-root .cr-p-btn.active {
  color: #0A0A0F;
  font-weight: bold;
}

#embedded-ai-root .cr-p-btn:hover:not(.active) {
  border-color: rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.55);
}

/* ── Main grid ── */
#embedded-ai-root .cr-main {
  display: grid;
  grid-template-columns: 270px 1fr;
  min-height: 500px;
  max-height: 75vh;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

/* ── Week list (left panel) ── */
#embedded-ai-root .cr-wk-list {
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.08) transparent;
}

#embedded-ai-root .cr-ph-mini {
  padding: 10px 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 6px;
}

#embedded-ai-root .cr-ph-mini-weeks {
  font-size: 8px;
  letter-spacing: 2px;
  opacity: 0.35;
  margin-bottom: 3px;
}

#embedded-ai-root .cr-ph-mini-board {
  font-family: 'Orbitron', monospace;
  font-size: 12px;
  font-weight: 700;
}

#embedded-ai-root .cr-ph-mini-sub {
  font-size: 9px;
  opacity: 0.35;
  margin-top: 2px;
}

#embedded-ai-root .cr-wk-btn {
  width: 100%;
  height: auto;
  text-align: left;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 5px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.15s;
  color: #E8E8F0;
  font-family: 'Share Tech Mono', monospace;
}

#embedded-ai-root .cr-wk-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
}

#embedded-ai-root .cr-wk-btn.active {
  border-color: var(--pc);
  background: rgba(var(--prgb), 0.07);
}

#embedded-ai-root .cr-wk-num {
  font-size: 8px;
  letter-spacing: 2px;
  opacity: 0.38;
  margin-bottom: 3px;
  text-transform: uppercase;
}

#embedded-ai-root .cr-wk-title {
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 0.4px;
  line-height: 1.3;
}

#embedded-ai-root .cr-ai-tag {
  display: inline-block;
  margin-top: 5px;
  font-size: 7px;
  letter-spacing: 1.5px;
  padding: 2px 6px;
  border-radius: 2px;
  text-transform: uppercase;
  opacity: 0.8;
}

/* ── Detail panel (right) ── */
#embedded-ai-root .cr-detail {
  overflow-y: auto;
  padding: 28px 36px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.08) transparent;
}

#embedded-ai-root .cr-ph-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 300px;
  opacity: 0.18;
  gap: 12px;
}

#embedded-ai-root .cr-ph-icon {
  font-size: 44px;
}

#embedded-ai-root .cr-ph-txt {
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
}

#embedded-ai-root .cr-ph-hint {
  font-size: 9px;
  opacity: 0.5;
  text-align: center;
  max-width: 220px;
  line-height: 1.6;
}

/* ── Detail content ── */
#embedded-ai-root .cr-d-wknum {
  font-size: 9px;
  letter-spacing: 3px;
  opacity: 0.35;
  margin-bottom: 5px;
}

#embedded-ai-root .cr-d-title {
  font-family: 'Orbitron', monospace;
  font-size: 20px;
  font-weight: 900;
  margin-bottom: 5px;
  line-height: 1.2;
}

#embedded-ai-root .cr-d-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 9px;
  letter-spacing: 2px;
  padding: 3px 10px;
  border-radius: 3px;
  border: 1px solid;
  text-transform: uppercase;
  margin-bottom: 24px;
  opacity: 0.8;
}

#embedded-ai-root .cr-sec-lbl {
  font-size: 8px;
  letter-spacing: 3px;
  text-transform: uppercase;
  opacity: 0.35;
  margin-bottom: 9px;
  padding-bottom: 5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

#embedded-ai-root .cr-topics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-bottom: 24px;
}

#embedded-ai-root .cr-topic {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 10px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.6);
  padding: 7px 9px;
  background: rgba(255, 255, 255, 0.025);
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

#embedded-ai-root .cr-tdot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}

#embedded-ai-root .cr-ai-card {
  padding: 18px 22px;
  border-radius: 7px;
  border-left: 3px solid;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

#embedded-ai-root .cr-ai-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.035) 0%, transparent 60%);
  pointer-events: none;
}

#embedded-ai-root .cr-ai-ctag {
  font-size: 7px;
  letter-spacing: 3px;
  text-transform: uppercase;
  opacity: 0.55;
  margin-bottom: 5px;
}

#embedded-ai-root .cr-ai-ctitle {
  font-family: 'Orbitron', monospace;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
}

#embedded-ai-root .cr-ai-cdesc {
  font-size: 10px;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.62);
}

#embedded-ai-root .cr-hw-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.025);
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 10px;
  color: rgba(255, 255, 255, 0.45);
}

#embedded-ai-root .cr-hw-lbl {
  font-size: 8px;
  letter-spacing: 2px;
  opacity: 0.38;
  text-transform: uppercase;
  display: block;
  margin-bottom: 1px;
}

/* ── Progress bar ── */
#embedded-ai-root .cr-progress {
  padding: 8px 36px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  background: rgba(0,0,0,0.15);
}

#embedded-ai-root .cr-progress-bar {
  height: 3px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
  display: flex;
  margin-bottom: 5px;
}

#embedded-ai-root .cr-progress-done {
  height: 100%;
  background: #00FF9C;
  transition: width 0.5s ease;
}

#embedded-ai-root .cr-progress-inprog {
  height: 100%;
  background: #FBBF24;
  transition: width 0.5s ease;
}

#embedded-ai-root .cr-progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.25);
}

/* ── Status badge (week list) ── */
#embedded-ai-root .cr-status {
  font-size: 8px;
  letter-spacing: 1px;
  padding: 2px 5px;
  border-radius: 2px;
  font-weight: bold;
}

#embedded-ai-root .cr-status--done   { background: rgba(0,255,156,0.15); color: #00FF9C; }
#embedded-ai-root .cr-status--inprog { background: rgba(251,191,36,0.15); color: #FBBF24; }

/* ── Wiki article links ── */
#embedded-ai-root .cr-wiki-links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

#embedded-ai-root .cr-wiki-link {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.5px;
  padding: 4px 12px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  transition: all 0.15s;
  background: rgba(255, 255, 255, 0.04);
}

#embedded-ai-root .cr-wiki-link:hover {
  border-color: rgba(255, 255, 255, 0.35);
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.08);
}

/* ── Scrollbar ── */
#embedded-ai-root ::-webkit-scrollbar {
  width: 3px;
}

#embedded-ai-root ::-webkit-scrollbar-track {
  background: transparent;
}

#embedded-ai-root ::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.09);
  border-radius: 2px;
}

/* ── Season badge ── */
#embedded-ai-root .cr-season-badge {
  display: inline-block;
  font-size: 7px;
  letter-spacing: 2px;
  padding: 2px 7px;
  border-radius: 2px;
  text-transform: uppercase;
  margin-left: 8px;
  vertical-align: middle;
  border: 1px solid;
  opacity: 0.7;
}

/* ── Responsive ── */
@media (max-width: 700px) {
  #embedded-ai-root .cr-main {
    grid-template-columns: 1fr;
    max-height: none;
  }

  #embedded-ai-root .cr-wk-list {
    max-height: 260px;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  #embedded-ai-root .cr-hdr {
    padding: 18px 16px 14px;
  }

  #embedded-ai-root .cr-phase-nav {
    padding: 10px 16px;
  }

  #embedded-ai-root .cr-detail {
    padding: 18px 16px;
  }

  #embedded-ai-root .cr-topics {
    grid-template-columns: 1fr;
  }
}
