.as-studio-root {
  display: flex;
  min-height: 80vh;
  background: linear-gradient(180deg, #06060A 0%, #0B0B10 100%);
}

.as-sidebar {
  width: 380px;
  flex-shrink: 0;
  border-right: 1px solid rgba(255,255,255,0.06);
  overflow-y: auto;
  position: sticky;
  top: 0;
  max-height: 90vh;
  padding: 20px 18px 24px;
  background:
    radial-gradient(circle at top right, rgba(200,170,80,0.08), transparent 36%),
    #0D0D14;
}

.as-sidebar-header {
  margin-bottom: 18px;
}

.as-title {
  margin: 0 0 2px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  line-height: 1.1;
  font-weight: 700;
  color: #E8E7E3;
}

.as-subtitle {
  display: block;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7A7A78;
}

.as-main {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  min-width: 0;
  background: linear-gradient(180deg, #06060A 0%, #090910 100%);
}

.as-builder-shell,
.as-analysis {
  font-family: 'Inter', sans-serif;
}

.as-builder-shell {
  min-width: 0;
}

.as-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.as-toolbar button,
.as-tracker-toolbar button {
  appearance: none;
  border: 1px solid rgba(200,170,80,0.15);
  background: transparent;
  color: #A0A09E;
  padding: 7px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.as-toolbar button:hover,
.as-tracker-toolbar button:hover {
  border-color: #C8AA50;
  color: #E8E7E3;
  background: rgba(200,170,80,0.05);
}

.as-load-select {
  flex: 1 1 180px;
  min-width: 180px;
}

.as-field-group {
  margin-bottom: 12px;
}

.as-field-label {
  display: block;
  margin-bottom: 4px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #7A7A78;
}

.as-field-input {
  width: 100%;
  background: #06060A;
  border: 1px solid rgba(200,170,80,0.12);
  color: #E8E7E3;
  padding: 8px 10px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  min-width: 0;
}

.as-field-input:focus {
  outline: none;
  border-color: #C8AA50;
  box-shadow: 0 0 0 3px rgba(200,170,80,0.12);
}

.as-fund-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.as-fund-select {
  flex: 1;
}

.as-add-btn {
  appearance: none;
  border: none;
  background: #C8AA50;
  color: #06060A;
  font-weight: 700;
  border-radius: 4px;
  padding: 8px 14px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}

.as-add-btn:hover {
  background: #d7b85d;
}

.as-notice {
  border: 1px solid rgba(200,170,80,0.12);
  background: rgba(200,170,80,0.05);
  color: #A0A09E;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.5;
  margin-bottom: 12px;
}

.as-position-list {
  margin-top: 12px;
}

.as-position-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 8px;
}

.as-position-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.as-position-ticker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(200,170,80,0.15);
  color: #C8AA50;
  font-weight: 700;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 3px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.04em;
}

.as-position-name {
  font-size: 12px;
  color: #E8E7E3;
  font-weight: 500;
  line-height: 1.45;
  min-width: 0;
}

.as-position-meta {
  font-size: 10px;
  color: #7A7A78;
  margin-bottom: 10px;
  letter-spacing: 0.03em;
}

.as-position-controls {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.as-position-amount-wrap {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.as-inline-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #7A7A78;
}

.as-pos-amount {
  width: 140px;
}

.as-position-weight-wrap {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 60px;
}

.as-position-weight {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: #A0A09E;
}

.as-position-remove {
  appearance: none;
  border: none;
  background: none;
  color: #7A7A78;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  margin-left: auto;
  padding: 8px 4px;
}

.as-position-remove:hover {
  color: #F87171;
}

.as-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 16px 0;
}

.as-metric-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px;
  padding: 10px;
  text-align: center;
  min-width: 0;
}

.as-metric-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #7A7A78;
  margin-bottom: 6px;
}

.as-metric-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 600;
  color: #C8AA50;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.as-run-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #C8AA50, #b09840);
  color: #06060A;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.2s ease;
}

.as-run-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.as-run-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.as-swap-controls { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 16px; }
.as-swap-field { flex: 1; }
.as-swap-arrow { font-size: 20px; color: #C8AA50; padding-bottom: 8px; font-weight: 700; }

.as-analysis {
  padding: 0;
}

.as-analysis-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.as-panel {
  background: #0D0D14;
  border: 1px solid rgba(200,170,80,0.08);
  border-radius: 8px;
  padding: 16px 20px;
  min-width: 0;
  opacity: 0;
  animation: as-fade-in 0.28s ease forwards;
}

.as-panel-full {
  grid-column: 1 / -1;
}

.as-panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 600;
  color: #E8E7E3;
}

.as-summary {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #0D0D14;
  border: 1px solid rgba(200,170,80,0.12);
  border-radius: 8px;
  padding: 14px 20px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.as-summary-item {
  min-width: 120px;
}

.as-summary-label {
  display: block;
  margin-bottom: 4px;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #7A7A78;
}

.as-summary-value {
  font-size: 14px;
  font-weight: 600;
  color: #E8E7E3;
  font-family: 'JetBrains Mono', monospace;
}

.as-summary-grade {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 32px;
  line-height: 1;
  font-weight: 700;
}

.as-grade-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 36px;
  font-weight: 700;
  transform: scale(0.84);
  animation: as-scale-in 0.35s ease forwards;
}

.as-tone-green {
  border: 3px solid #4ADE80;
  color: #4ADE80;
}

.as-tone-gold {
  border: 3px solid #C8AA50;
  color: #C8AA50;
}

.as-tone-yellow {
  border: 3px solid #FBBF24;
  color: #FBBF24;
}

.as-tone-red {
  border: 3px solid #F87171;
  color: #F87171;
}

.as-risk-layout {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  align-items: center;
}

.as-risk-main {
  min-width: 0;
}

.as-risk-score-head,
.as-subscore-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 11px;
  color: #A0A09E;
  margin-bottom: 8px;
}

.as-score-bar {
  height: 8px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  overflow: hidden;
}

.as-score-bar-lg {
  margin-bottom: 12px;
}

.as-score-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}

.as-fill-green {
  background: #4ADE80;
}

.as-fill-yellow {
  background: #FBBF24;
}

.as-fill-red {
  background: #F87171;
}

.as-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.as-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 600;
}

.as-pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.as-pill.green {
  background: rgba(74,222,128,0.1);
  color: #4ADE80;
}

.as-pill.yellow {
  background: rgba(251,191,36,0.1);
  color: #FBBF24;
}

.as-pill.red {
  background: rgba(248,113,113,0.1);
  color: #F87171;
}

.as-risk-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.as-risk-card {
  border-left: 3px solid transparent;
  background: rgba(255,255,255,0.02);
  border-radius: 6px;
  padding: 12px;
}

.as-risk-red {
  border-left-color: #F87171;
}

.as-risk-yellow {
  border-left-color: #FBBF24;
}

.as-risk-green {
  border-left-color: #4ADE80;
}

.as-risk-title {
  font-size: 11px;
  font-weight: 600;
  color: #E8E7E3;
  margin-bottom: 6px;
}

.as-risk-text,
.as-summary-text,
.as-disclaimer,
.as-change-summary {
  font-size: 12px;
  color: #A0A09E;
  line-height: 1.55;
}

.as-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.as-kpi {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px;
  padding: 10px 12px;
}

.as-kpi-label {
  display: block;
  margin-bottom: 6px;
  font-size: 10px;
  color: #7A7A78;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.as-kpi-value {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 600;
  color: #E8E7E3;
}

.as-chart-wrap {
  position: relative;
  width: 100%;
  margin-bottom: 14px;
}

.as-chart-wrap-bar {
  height: 250px;
}

.as-chart-wrap-donut {
  height: 200px;
}

.as-data-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(255,255,255,0.01);
  border-radius: 6px;
  overflow: hidden;
}

.as-data-table th {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #7A7A78;
  padding: 8px;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.as-data-table td {
  font-size: 12px;
  color: #E8E7E3;
  padding: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

.as-num {
  font-family: 'JetBrains Mono', monospace;
}

.as-heatmap {
  width: 100%;
  border-collapse: collapse;
}

.as-heatmap th {
  font-size: 10px;
  text-transform: uppercase;
  color: #7A7A78;
  padding: 6px 8px;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.as-heatmap td {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  padding: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

.as-cell-green {
  background: rgba(74,222,128,0.08);
  color: #4ADE80;
}

.as-cell-yellow {
  background: rgba(251,191,36,0.08);
  color: #FBBF24;
}

.as-cell-red {
  background: rgba(248,113,113,0.08);
  color: #F87171;
}

.as-overlap-top {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.as-overlap-score {
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.as-overlap-score.as-red {
  border-color: rgba(248,113,113,0.24);
}

.as-overlap-score.as-yellow {
  border-color: rgba(251,191,36,0.24);
}

.as-overlap-score.as-green {
  border-color: rgba(74,222,128,0.24);
}

.as-overlap-score-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #7A7A78;
  margin-bottom: 6px;
}

.as-overlap-score-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 32px;
  line-height: 1;
  font-weight: 700;
  color: #E8E7E3;
}

.as-overlap-bars {
  display: grid;
  gap: 10px;
}

.as-subscore {
  min-width: 0;
}

.as-overlap-grid,
.as-tracker-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.as-overlap-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px;
  padding: 12px;
  min-width: 0;
}

.as-mini-title {
  font-size: 11px;
  font-weight: 600;
  color: #E8E7E3;
  margin-bottom: 10px;
}

.as-inline-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.as-inline-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 12px;
  color: #A0A09E;
}

.as-callout-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.as-callout {
  flex: 1 1 220px;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 11px;
  line-height: 1.5;
}

.as-callout-green {
  background: rgba(74,222,128,0.08);
  border: 1px solid rgba(74,222,128,0.2);
  color: #4ADE80;
}

.as-callout-yellow {
  background: rgba(251,191,36,0.08);
  border: 1px solid rgba(251,191,36,0.2);
  color: #FBBF24;
}

.as-callout-red {
  background: rgba(248,113,113,0.08);
  border: 1px solid rgba(248,113,113,0.2);
  color: #F87171;
}

.as-stress-card {
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 12px;
}

.as-stress-grid,
.as-tracker-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.as-improvement-grid {
  display: grid;
  gap: 10px;
}

.as-improvement-card {
  border: 1px solid rgba(200,170,80,0.12);
  background: rgba(200,170,80,0.05);
  border-radius: 6px;
  padding: 12px;
  color: #E8E7E3;
  font-size: 12px;
  line-height: 1.55;
}

.as-tracker-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.as-tracker-meta {
  margin-bottom: 12px;
}

.as-change-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.as-change-item {
  border-bottom: 1px solid rgba(255,255,255,0.04);
  padding: 8px 0;
  font-size: 12px;
  color: #A0A09E;
}

.as-change-red {
  color: #F87171;
}

.as-change-yellow {
  color: #FBBF24;
}

.as-empty {
  text-align: center;
  padding: 60px 20px;
}

.as-empty-icon {
  font-size: 48px;
  opacity: 0.3;
  margin-bottom: 16px;
}

.as-empty h3 {
  font-size: 18px;
  color: #E8E7E3;
  margin-bottom: 8px;
}

.as-empty p {
  font-size: 13px;
  color: #7A7A78;
  max-width: 400px;
  margin: 0 auto;
}

.as-empty-mini {
  font-size: 12px;
  color: #7A7A78;
  padding: 14px 12px;
  text-align: center;
  border: 1px dashed rgba(255,255,255,0.08);
  border-radius: 6px;
}

@keyframes as-fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes as-scale-in {
  from {
    transform: scale(0.8);
  }
  to {
    transform: scale(1);
  }
}

@media (max-width: 1280px) {
  .as-risk-grid {
    grid-template-columns: 1fr;
  }

  .as-metrics {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 1024px) {
  .as-studio-root {
    flex-direction: column;
  }

  .as-sidebar {
    width: 100%;
    position: static;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }

  .as-analysis-grid {
    grid-template-columns: 1fr;
  }

  .as-panel-full {
    grid-column: auto;
  }

  .as-summary {
    position: static;
  }
}

@media (max-width: 720px) {
  .as-main,
  .as-sidebar {
    padding: 16px;
  }

  .as-position-controls,
  .as-overlap-top,
  .as-overlap-grid,
  .as-tracker-grid,
  .as-risk-layout {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .as-position-controls {
    align-items: stretch;
  }

  .as-position-remove {
    margin-left: 0;
    align-self: flex-start;
  }

  .as-metrics {
    grid-template-columns: 1fr;
  }

  .as-fund-row {
    flex-direction: column;
    align-items: stretch;
  }

  .as-add-btn {
    width: 100%;
  }

  .as-chart-wrap-bar {
    height: 220px;
  }
}

/* Comparison mode */
.as-compare-selector { display: flex; align-items: flex-end; gap: 16px; padding: 20px; background: rgba(200,170,80,0.04); border: 1px solid rgba(200,170,80,0.12); border-radius: 8px; margin-bottom: 20px; }
.as-compare-col { flex: 1; }
.as-compare-vs { font-size: 14px; font-weight: 700; color: #C8AA50; padding-bottom: 8px; }
.as-run-compare { flex-shrink: 0; }
.as-compare-results { margin-top: 0; }
.as-compare-table td:nth-child(2), .as-compare-table td:nth-child(3) { text-align: center; font-weight: 600; }
.as-delta { font-weight: 700; font-size: 12px; }
.as-delta-better { color: #4ADE80; }
.as-delta-worse { color: #F87171; }
.as-delta-neutral { color: #7A7A78; }
.as-diff-a { background: rgba(200,170,80,0.06); }
.as-diff-b { background: rgba(96,165,250,0.06); }
.as-compare-callouts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 12px; }
.as-compare-callout-col { min-width: 0; }
.as-row-highlight td { font-weight: 700; border-bottom: 2px solid rgba(200,170,80,0.2); }

.as-btn-active { border-color: #C8AA50 !important; color: #C8AA50 !important; background: rgba(200,170,80,0.1) !important; }

/* Export bar */
.as-export-bar { display: flex; justify-content: flex-end; padding: 0 0 12px; }
.as-export-btn {
  appearance: none;
  border: 1px solid rgba(200,170,80,0.2);
  background: rgba(200,170,80,0.08);
  color: #C8AA50;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: border-color 0.2s, background 0.2s;
}
.as-export-btn:hover {
  border-color: #C8AA50;
  background: rgba(200,170,80,0.15);
  color: #E8E7E3;
}

/* Print / PDF export styles */
@media print {
  body > *:not(.tab-content),
  .dirigon-header,
  .tab-bar,
  .as-sidebar,
  .as-export-bar,
  .as-tracker-toolbar,
  nav,
  footer,
  .alert-bar,
  .health-bar,
  #as-empty-state {
    display: none !important;
  }

  .as-studio-root {
    display: block !important;
  }

  .as-main {
    padding: 0 !important;
    overflow: visible !important;
    width: 100% !important;
  }

  body, .as-main, .as-studio-root, .as-panel, .as-summary {
    background: white !important;
    color: #1a1a1a !important;
  }

  .as-panel {
    border: 1px solid #ddd !important;
    box-shadow: none !important;
    break-inside: avoid;
    margin-bottom: 16px !important;
  }

  .as-panel-title {
    color: #1a1a1a !important;
    border-bottom: 2px solid #C8AA50 !important;
    padding-bottom: 4px !important;
    margin-bottom: 12px !important;
  }

  .as-summary {
    border: 1px solid #ddd !important;
    padding: 12px !important;
  }
  .as-summary-label { color: #666 !important; }
  .as-summary-value, .as-summary-grade { color: #1a1a1a !important; }

  .as-data-table, .as-heatmap {
    border-collapse: collapse !important;
  }
  .as-data-table th, .as-heatmap th {
    background: #f5f5f5 !important;
    color: #1a1a1a !important;
    border-bottom: 2px solid #ddd !important;
  }
  .as-data-table td, .as-heatmap td {
    color: #1a1a1a !important;
    border-bottom: 1px solid #eee !important;
  }

  .as-grade-circle {
    border: 2px solid #C8AA50 !important;
    color: #1a1a1a !important;
    background: #faf6eb !important;
  }

  .as-pill { border: 1px solid #ddd !important; }

  .as-kpi-value { color: #1a1a1a !important; }
  .as-kpi-label { color: #666 !important; }

  canvas { max-width: 100% !important; }

  .as-score-bar { background: #eee !important; }

  .as-analysis::before {
    content: 'DIRIGON | Allocator Studio Report';
    display: block;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    border-bottom: 3px solid #C8AA50;
    padding-bottom: 8px;
    margin-bottom: 20px;
  }
  .as-analysis::after {
    content: 'Generated ' attr(data-date) ' | dirigon-81v.pages.dev';
    display: block;
    font-size: 10px;
    color: #999;
    text-align: center;
    margin-top: 20px;
    padding-top: 12px;
    border-top: 1px solid #ddd;
  }

  @page {
    margin: 0.75in;
    size: letter;
  }

  .as-analysis-grid {
    display: block !important;
  }

  .as-panel-full, .as-panel {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* Empty state hero */
.as-hero { text-align: center; padding: 40px 20px 24px; }
.as-hero-icon { font-size: 36px; margin-bottom: 12px; opacity: 0.5; }
.as-hero-title { font-family: 'Space Grotesk', sans-serif; font-size: 24px; font-weight: 700; color: #E8E7E3; margin: 0 0 8px; }
.as-hero-desc { font-size: 13px; color: #7A7A78; max-width: 520px; margin: 0 auto; line-height: 1.5; }

/* How it works steps */
.as-how-it-works { display: flex; justify-content: center; gap: 32px; padding: 20px 0 28px; }
.as-step { text-align: center; }
.as-step-num { width: 32px; height: 32px; border-radius: 50%; background: rgba(200,170,80,0.15); color: #C8AA50; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; margin: 0 auto 8px; }
.as-step-label { font-size: 12px; font-weight: 700; color: #E8E7E3; letter-spacing: 0.04em; text-transform: uppercase; }
.as-step-text { font-size: 11px; color: #7A7A78; margin-top: 2px; }

/* Templates */
.as-templates-header { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #7A7A78; padding: 0 20px; margin-bottom: 12px; }
.as-template-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 0 20px 40px; }
.as-template-card { background: rgba(200,170,80,0.04); border: 1px solid rgba(200,170,80,0.12); border-radius: 8px; padding: 16px; cursor: pointer; transition: border-color 0.2s, background 0.2s; }
.as-template-card:hover { border-color: #C8AA50; background: rgba(200,170,80,0.08); }
.as-template-name { font-weight: 700; font-size: 14px; color: #E8E7E3; margin-bottom: 4px; }
.as-template-desc { font-size: 12px; color: #7A7A78; line-height: 1.4; margin-bottom: 8px; }
.as-template-meta { font-size: 11px; color: #C8AA50; }

/* Sub-tab navigation */
.as-subtab-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 20px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.as-subtab {
  appearance: none;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: #7A7A78;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s;
  font-family: 'Inter', sans-serif;
}

.as-subtab:hover:not(:disabled) {
  color: #E8E7E3;
}

.as-subtab-active {
  color: #4ADE80;
  border-bottom-color: #4ADE80;
}

.as-subtab-disabled {
  color: #3A3A38;
  cursor: not-allowed;
}

.as-subtab-content {
  min-height: 300px;
}

/* Global KPI bar */
.as-global-kpi-bar { display: flex; gap: 0; border: 1px solid rgba(255,255,255,0.08); border-radius: 8px; overflow: hidden; margin-bottom: 12px; }
.as-gkpi { flex: 1; padding: 12px 16px; text-align: center; border-right: 1px solid rgba(255,255,255,0.06); }
.as-gkpi:last-child { border-right: none; }
.as-gkpi-value { font-size: 20px; font-weight: 700; color: #E8E7E3; font-family: 'Space Grotesk', sans-serif; }
.as-gkpi-label { font-size: 10px; color: #7A7A78; text-transform: uppercase; letter-spacing: 0.06em; margin-top: 2px; }

/* Alert banner */
.as-alert-banner { padding: 8px 16px; border-radius: 6px; font-size: 12px; font-weight: 600; margin-bottom: 12px; }
.as-alert-red { background: rgba(248,113,113,0.1); border: 1px solid rgba(248,113,113,0.3); color: #F87171; }
.as-alert-yellow { background: rgba(251,191,36,0.1); border: 1px solid rgba(251,191,36,0.3); color: #FBBF24; }
.as-alert-green { background: rgba(74,222,128,0.1); border: 1px solid rgba(74,222,128,0.3); color: #4ADE80; }

/* Tab header + verdict */
.as-tab-header { margin-bottom: 16px; }
.as-verdict { font-size: 13px; color: #A0A09E; line-height: 1.5; padding: 12px 16px; background: rgba(255,255,255,0.03); border-radius: 6px; border-left: 3px solid #C8AA50; }
.as-tab-subtitle { font-size: 11px; color: #7A7A78; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 12px; }

/* Scores row */
.as-scores-row { display: flex; gap: 12px; margin-bottom: 16px; }
.as-score-card { flex: 1; padding: 16px; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08); border-radius: 8px; text-align: center; }
.as-score-card-value { font-size: 28px; font-weight: 700; color: #E8E7E3; font-family: 'Space Grotesk', sans-serif; }
.as-score-of { font-size: 14px; color: #7A7A78; font-weight: 400; }
.as-score-card-label { font-size: 11px; color: #7A7A78; text-transform: uppercase; letter-spacing: 0.06em; margin-top: 4px; }

/* Depth buckets */
.as-depth-buckets { display: flex; gap: 12px; margin-bottom: 16px; }
.as-depth-bucket { flex: 1; padding: 12px; border: 1px solid rgba(200,170,80,0.15); border-radius: 6px; text-align: center; }
.as-depth-value { font-size: 22px; font-weight: 700; color: #C8AA50; }
.as-depth-label { font-size: 11px; color: #7A7A78; margin-top: 2px; }
.as-more-note { font-size: 11px; color: #7A7A78; padding: 8px 0; font-style: italic; }

/* Data caveat */
.as-caveat { font-size: 12px; color: #FBBF24; background: rgba(251,191,36,0.08); border: 1px solid rgba(251,191,36,0.2); border-radius: 6px; padding: 10px 14px; margin-bottom: 12px; line-height: 1.4; }

/* Fund profile cards */
.as-fund-profiles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.as-fund-profile-card { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08); border-radius: 8px; padding: 14px; }
.as-fpc-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.as-fpc-ticker { font-weight: 700; font-size: 14px; color: #E8E7E3; }
.as-fpc-source { font-size: 10px; color: #7A7A78; background: rgba(255,255,255,0.05); padding: 2px 6px; border-radius: 3px; }
.as-fpc-strategy { font-size: 12px; color: #C8AA50; margin-bottom: 8px; }
.as-fpc-metrics { display: flex; gap: 12px; }
.as-fpc-metric-label { display: block; font-size: 9px; color: #7A7A78; text-transform: uppercase; letter-spacing: 0.05em; }
.as-fpc-metric-value { font-size: 14px; font-weight: 600; color: #E8E7E3; }

/* Snapshot tiles */
.as-snapshot-tiles { display: flex; gap: 8px; margin-bottom: 16px; }
.as-tile { flex: 1; padding: 10px 12px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.08); }
.as-tile-label { font-size: 10px; color: #7A7A78; text-transform: uppercase; letter-spacing: 0.06em; }
.as-tile-value { font-size: 13px; font-weight: 600; color: #E8E7E3; margin-top: 2px; }
.as-tile-green { border-color: rgba(74,222,128,0.3); background: rgba(74,222,128,0.05); }
.as-tile-yellow { border-color: rgba(251,191,36,0.3); background: rgba(251,191,36,0.05); }
.as-tile-red { border-color: rgba(248,113,113,0.3); background: rgba(248,113,113,0.05); }

/* Improve list */
.as-improve-list { list-style: none; padding: 0; margin: 0; }
.as-improve-list li { padding: 8px 12px; border-left: 3px solid #C8AA50; margin-bottom: 6px; font-size: 13px; color: #A0A09E; background: rgba(200,170,80,0.04); border-radius: 0 4px 4px 0; }

/* Concentration flags */
.as-flag { padding: 8px 12px; font-size: 13px; color: #A0A09E; border-bottom: 1px solid rgba(255,255,255,0.06); }
.as-flag-label { font-weight: 700; color: #FBBF24; }

/* HHI note */
.as-hhi-note { font-size: 11px; color: #7A7A78; padding: 6px 0; font-style: italic; }

/* Report tab */
.as-report-wrapper { position: relative; }
.as-report-draft-watermark { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) rotate(-30deg); font-size: 120px; font-weight: 900; color: rgba(255,255,255,0.03); pointer-events: none; z-index: 0; letter-spacing: 0.1em; }
.as-report-header { text-align: center; padding: 24px 0 20px; border-bottom: 2px solid #C8AA50; margin-bottom: 20px; }
.as-report-brand { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: #C8AA50; margin-bottom: 4px; }
.as-report-title { font-size: 22px; font-weight: 700; color: #E8E7E3; font-family: 'Space Grotesk', sans-serif; }
.as-report-subtitle { font-size: 11px; color: #7A7A78; margin-top: 4px; }
.as-report-prose { font-size: 13px; line-height: 1.6; color: #A0A09E; margin: 0; }
.as-report-line { font-size: 13px; color: #A0A09E; padding: 4px 0; }
.as-report-line strong { color: #E8E7E3; }
.as-report-footer { text-align: center; font-size: 10px; color: #7A7A78; padding: 20px 0; margin-top: 20px; border-top: 1px solid rgba(255,255,255,0.06); }

/* Alternative fund cards */
.as-alt-card { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08); border-radius: 8px; padding: 14px; }
.as-alt-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.as-alt-ticker { font-weight: 700; font-size: 16px; color: #E8E7E3; }
.as-alt-name { font-size: 12px; color: #7A7A78; margin-bottom: 8px; }
.as-alt-metrics { display: flex; gap: 14px; font-size: 12px; color: #A0A09E; }
.as-alt-metrics strong { color: #7A7A78; }

/* Borrower-Fund Connection Matrix */
.as-matrix-scroll { overflow-x: auto; }
.as-matrix-table { white-space: nowrap; }
.as-matrix-ticker { font-size: 11px; writing-mode: vertical-rl; text-orientation: mixed; padding: 4px 6px !important; text-align: center; }
.as-matrix-borrower { font-size: 12px; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.as-matrix-cell { text-align: center; width: 40px; min-width: 40px; font-size: 14px; color: #3A3A38; }
.as-matrix-hit { color: #C8AA50; background: rgba(200,170,80,0.1); font-weight: 700; }
