/* View-specific layout; data and existing delegated controls remain native. */
.af-dashboard .dashboard-layout { display:grid; grid-template-columns:minmax(0, 2.5fr) minmax(255px, 1fr); gap:24px; align-items:start; }
.af-dashboard .dashboard-primary-column, .af-dashboard .dashboard-analytics-column { display:grid; grid-template-columns:minmax(0, 1fr); gap:16px; min-width:0; }
.af-dashboard .formula-dashboard-card { height:auto; min-height:560px; }
.af-dashboard .dashboard-formula-stage { height:auto; min-height:490px; padding:20px 12px; }
.af-summary-title { margin:4px 0 0; color:var(--text-primary, #eeeaf8); font-size:16px; font-weight:600; }
.af-dashboard .dashboard-metric-grid { display:grid!important; grid-template-columns:minmax(0, 1fr)!important; overflow:visible!important; gap:0; }
.af-dashboard .dashboard-metric-grid .metric-card, .af-extra-metrics .metric-card { display:block!important; width:auto!important; height:auto!important; min-height:0!important; min-width:0!important; padding:18px 0; border:0; border-bottom:1px solid rgba(171,161,204,.14); border-radius:0; background:none; box-shadow:none; }
.af-dashboard .metric-card-head { gap:10px; font-size:13px; }
.af-dashboard .metric-card>strong { display:block; margin-top:8px; font-size:28px!important; line-height:1.2; }
.af-dashboard .metric-card>small { display:block; margin-top:7px; font-size:12px; line-height:1.55; }
.af-dashboard .metric-help-toggle { min-width:32px; min-height:32px; background:transparent; }
.af-dashboard .metric-help-toggle b { right:0; bottom:0; }
.af-dashboard .metric-explainer { font-size:13px; line-height:1.55; }
.af-statistics { min-width:0; padding-top:2px; }
.af-statistics>summary, .af-location-details>summary { cursor:pointer; color:#c7b4f2; font-size:13px; line-height:1.5; padding:10px 0; }
.af-statistics>summary:focus-visible, .af-location-details>summary:focus-visible, .af-transit-parameters>summary:focus-visible, .af-phase-controls button:focus-visible { outline:2px solid #c7b4f2; outline-offset:5px; border-radius:6px; }
.af-extra-metrics { display:grid; min-width:0; }
.af-statistics .planet-ranking-card { display:block!important; width:100%; min-height:0; padding:18px 0 0; border:0; background:none; box-shadow:none; }
.af-statistics .rank-row { min-height:42px; }
.af-statistics .rank-row :is(strong,span,small) { font-size:12px; }
.af-dashboard .dashboard-auxiliary-card { background:none; box-shadow:none; border:0; padding-inline:0; }

.af-location-details { min-width:0; grid-column:1/-1; border-top:1px solid rgba(171,161,204,.14); }
.af-location-summary { grid-column:1/-1; margin:0; color:#a8a1b8; font-size:12px; line-height:1.6; overflow-wrap:anywhere; }
.af-location-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; padding:12px 0 8px; }
.af-location-fields>.full { grid-column:1/-1; }
.af-location-details .form-field { min-width:0; }
.relation-person .af-location-details { padding-top:0; }
.relation-person .af-location-details>summary { font-size:13px; }
.relation-person .af-location-summary { margin-top:-4px; }
.relation-person:has(.af-location-details) .relation-place>small, #parameters-form:has(.af-location-details) .form-field:has(#place-name)>small { display:none; }
#parameters-form>.location-attribution { font-size:11px; line-height:1.6; color:#928a9f; }

.af-phase-controls { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; margin:20px 0 18px; }
.af-phase-tabs { display:flex; gap:4px; padding:4px; border:1px solid rgba(171,161,204,.16); border-radius:12px; background:rgba(17,16,29,.55); }
.af-phase-controls button { min-height:42px; padding:10px 20px; border:0; border-radius:8px; font:inherit; font-size:14px; color:#aca5bf; background:transparent; cursor:pointer; }
.af-phase-tabs button[aria-selected="true"] { background:rgba(169,139,228,.18); color:#e4d6fc; box-shadow:inset 0 0 0 1px rgba(186,155,243,.18); }
.af-phase-controls .af-phase-compare { padding-inline:12px; color:#c7b4f2; border:1px solid rgba(171,161,204,.2); }
html[data-soulgraph-layout] .af-phases .transition-state-grid, .af-phases .transition-state-grid { display:grid; grid-template-columns:minmax(0,1fr); overflow:visible; gap:16px; padding:0; }
.af-phases .transition-state { width:100%; max-width:none; min-height:0; grid-template-rows:auto minmax(0,1fr) auto; background:var(--surface,rgba(25,23,37,.68)); border:1px solid rgba(171,161,204,.18); box-shadow:none; }
.af-phases [data-transition-state][hidden] { display:none!important; }
.af-phases .transition-mini-stage { height:740px!important; min-height:0!important; max-height:none!important; padding:20px!important; background:none; }
.af-phases .transition-mini-stage .transition-state-graph, .af-phases .transition-mini-stage .transition-compact-map { height:100%!important; width:100%!important; }
.af-phases .transition-mini-stage .transition-compact-map>.formula-svg { width:100%!important; height:100%!important; max-width:100%!important; min-width:0!important; }
.af-phases .transition-state>header { min-height:76px; padding:18px 22px; }
.af-phases .transition-state-moment time, .af-phases .transition-state footer strong { font-size:13px; }
.af-phases .transition-state-identity span, .af-phases .transition-state-moment span, .af-phases .transition-state-score span, .af-phases .transition-state footer span { font-size:11px; }
.af-phases .transition-state footer { padding:16px 22px; }
.af-phases .transition-state-identity strong { font-size:26px; }
html[data-soulgraph-layout] .af-phases.af-compare-phases .transition-state-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
.af-phases.af-compare-phases .transition-mini-stage { height:420px!important; padding:10px!important; }
.af-phases.af-compare-phases .transition-state>header { display:flex; flex-wrap:wrap; gap:12px; padding:16px; }
.af-phases.af-compare-phases .transition-state-moment { flex:1 1 140px; }
.af-phases.af-compare-phases .transition-state-score { display:none; }
.af-phases .dynamics-top-controls { padding:0; background:none; border:0; box-shadow:none; }
.af-phases .dynamics-legend { font-size:11px; }
.af-phases .dynamics-summary-grid { gap:16px; margin-top:20px; }

.af-transits { gap:16px; }
.af-transit-parameters { margin:0; border:1px solid rgba(171,161,204,.2); border-radius:14px; background:rgba(25,23,37,.6); }
.af-transit-parameters>summary { display:flex; align-items:center; justify-content:space-between; gap:20px; padding:18px 22px; cursor:pointer; list-style:none; }
.af-transit-parameters>summary::-webkit-details-marker { display:none; }
.af-transit-moment { display:grid; gap:6px; min-width:0; }
.af-transit-moment strong { font-size:18px; color:#eeeaf8; }
.af-transit-moment small { font-size:12px; color:#a8a1b8; overflow-wrap:anywhere; }
.af-transit-edit { font-size:13px; color:#c7b4f2; white-space:nowrap; }
.af-transit-edit::after { content:" ↓"; }
.af-transit-parameters[open] .af-transit-edit::after { content:" ↑"; }
.af-transit-parameters .transit-control-card { display:block; padding:20px 22px; border:0; border-top:1px solid rgba(171,161,204,.14); border-radius:0 0 14px 14px; margin:0; background:transparent; box-shadow:none; }
.af-transit-parameters .transit-fields { width:100%; grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(150px,.65fr); }
.af-transit-parameters .transit-presets { margin-top:16px; }
.af-transit-parameters .transit-control-copy { display:none; }
.af-transits .transit-hero[hidden] { display:none!important; }
.af-transits .transit-section-nav { margin-bottom:0; padding:0 0 8px; background:none; border:0; border-bottom:1px solid rgba(171,161,204,.14); border-radius:0; box-shadow:none; }
.af-transits .transit-section-nav a { font-size:13px; }
.af-transits .transit-overview { margin:0; }
.af-transits .transit-overview>header { display:none; }
.af-transits .transit-metrics { gap:0; border:1px solid rgba(171,161,204,.14); border-radius:14px; overflow:hidden; }
.af-transits .transit-metrics>article { display:flex; flex-direction:column; gap:6px; min-height:0; border:0; border-radius:0; border-right:1px solid rgba(171,161,204,.12); padding:14px 16px; background:rgba(25,23,37,.45); box-shadow:none; }
.af-transits .transit-metrics>article>i { display:none; }
.af-transits .transit-metrics>article>span { max-width:none; font-size:12px; }
.af-transits .transit-metrics>article>strong { font-size:26px; }
.af-transits .transit-metrics>article>small { font-size:11px; }
.af-transits .transit-analysis-grid { margin-top:0; grid-template-columns:minmax(0,1.5fr) minmax(300px,1fr); gap:20px; }
.af-transits .transit-aspect-planets b, .af-transits .transit-aspect-kind strong { font-size:12px; }
.af-transits .transit-aspect-planets small, .af-transits .transit-aspect-kind small { font-size:11px; }
.af-transits .transit-advice-panel { margin-top:24px; }
.af-transits [id^="transit-"] { scroll-margin-top:110px; }

@media (max-width:1199px) {
  .af-dashboard .dashboard-layout { grid-template-columns:minmax(0,2fr) minmax(230px,1fr); gap:18px; }
  html[data-soulgraph-layout] .af-phases.af-compare-phases .transition-state-grid { grid-template-columns:minmax(0,1fr); }
  .af-phases.af-compare-phases .transition-mini-stage { height:500px!important; }
}
@media (max-width:980px) {
  .af-dashboard .dashboard-layout { grid-template-columns:minmax(0,1fr); }
  .af-dashboard .dashboard-primary-column, .af-dashboard .dashboard-analytics-column { display:grid; }
  .af-dashboard .dashboard-analytics-column { order:1; }
  .af-dashboard .dashboard-metric-grid { grid-template-columns:repeat(3,minmax(0,1fr))!important; gap:16px; }
  .af-dashboard .dashboard-formula-stage { min-height:0; }
  .af-dashboard .formula-dashboard-card { min-height:0; }
  .af-transits .transit-analysis-grid { grid-template-columns:minmax(0,1fr); }
}
@media (max-width:767px) {
  .af-dashboard .dashboard-metric-grid { gap:10px; }
  .af-dashboard .metric-card>strong { font-size:23px!important; }
  .af-dashboard .metric-card-head { font-size:11px; }
  .af-dashboard .metric-card>small { font-size:10px; }
  .af-phase-controls { align-items:stretch; }
  .af-phase-tabs { flex:1 1 100%; }
  .af-phase-tabs button { flex:1; padding:10px 8px; font-size:13px; }
  .af-phase-controls .af-phase-compare { width:100%; }
  .af-phases .transition-mini-stage, .af-phases.af-compare-phases .transition-mini-stage { height:auto!important; padding:12px!important; }
  .af-phases .transition-mini-stage .transition-state-graph { height:auto!important; }
  .af-phases .transition-mini-stage .transition-compact-map { display:none!important; }
  .af-phases .transition-state>header { padding:14px; }
  .af-phases .transition-state footer { padding:14px; }
  .af-transit-parameters>summary { align-items:flex-start; flex-direction:column; gap:12px; padding:16px; }
  .af-transit-moment strong { font-size:16px; }
  .af-transit-parameters .transit-fields { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .af-transit-parameters .transit-fields>button { grid-column:1/-1; }
  .af-transits .transit-metrics { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .af-transits .transit-metrics>article { padding:12px; }
}
@media (prefers-reduced-motion:no-preference) {
  .af-phases:not(.af-compare-phases) .transition-state:not([hidden]) { animation:af-phase-enter .24s ease-out; }
  @keyframes af-phase-enter { from { opacity:.45; transform:translateY(5px); } to { opacity:1; transform:translateY(0); } }
}