:root {
  --after-amber: #e9b75f;
  --after-cyan: #9dd7d3;
  --after-ink: #f2ead8;
  --after-muted: rgba(242, 234, 216, .64);
  --after-line: rgba(242, 234, 216, .2);
  --after-green: #92d6ae;
  --after-red: #ef9b8f;
}

.app-shell.is-after-action-settlement {
  background: #05090b;
  overflow: hidden;
}

.app-shell.is-after-action-settlement .top-bar,
.app-shell.is-after-action-settlement .play-layout,
.app-shell.is-after-action-settlement .log-bar {
  display: none !important;
}

.after-action-settlement {
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow: hidden;
  color: var(--after-ink);
  background: #05090b;
  font-family: "Barlow Condensed", "Noto Sans SC", system-ui, sans-serif;
}

.after-action-backdrop {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(5, 9, 11, .94) 0%, rgba(5, 9, 11, .7) 47%, rgba(5, 9, 11, .38) 100%), linear-gradient(0deg, rgba(5, 9, 11, .85), transparent 48%), url("../assets/art/ui-v2/after-action-debrief-machines-v2.webp?v=after-action-20260814-v2") center / cover no-repeat;
  filter: saturate(.78) contrast(1.06);
}

.after-action-backdrop::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  opacity: .25;
  background: repeating-linear-gradient(0deg, transparent 0, transparent 3px, rgba(255, 255, 255, .035) 4px);
  mix-blend-mode: screen;
}

.after-action-stage-frame {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1920px;
  height: 1080px;
  transform: translate(-50%, -50%) scale(var(--after-action-scale, var(--meta-scale, 1)));
  transform-origin: center center;
  pointer-events: auto;
  box-sizing: border-box;
  overflow: hidden;
  z-index: 2;
}

.after-action-content {
  position: relative;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  width: 1560px;
  height: 1080px;
  min-height: 0;
  margin: 0 auto;
  padding: 56px 0 44px;
  box-sizing: border-box;
}

.after-action-header {
  display: grid;
  gap: 8px;
  max-width: 900px;
}

.after-action-eyebrow,
.after-action-kicker {
  color: var(--after-cyan);
  font-size: 13px;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.after-action-header h1 {
  margin: 0;
  color: var(--after-ink);
  font-size: 64px;
  font-weight: 800;
  line-height: .98;
}

.after-action-stage h2 {
  margin: 0;
  color: var(--after-ink);
  font-size: 56px;
  font-weight: 800;
  line-height: 1.05;
}

.after-action-header p,
.after-action-lede,
.after-action-stage-note {
  margin: 0;
  color: var(--after-muted);
  font-size: 15px;
  line-height: 1.5;
}

.after-action-phase-rail {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin: 34px 0 0;
  padding: 0;
  border-bottom: 1px solid var(--after-line);
  list-style: none;
}

.after-action-phase-rail li {
  display: flex;
  align-items: stretch;
  min-height: 38px;
  padding: 0;
  border-bottom: 2px solid transparent;
}

.after-action-phase-btn {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 9px;
  align-items: center;
  width: 100%;
  min-height: 38px;
  padding: 0 0 11px;
  border: 0;
  background: transparent;
  color: rgba(242, 234, 216, .38);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: color .18s ease;
}

.app-shell.is-after-action-settlement .after-action-phase-btn {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.after-action-phase-btn:hover,
.after-action-phase-btn:focus-visible {
  color: var(--after-ink);
  outline: none;
}

.after-action-phase-btn span {
  color: inherit;
  font-size: 11px;
}

.after-action-phase-btn strong {
  font-size: 14px;
  font-weight: 600;
}

.after-action-phase-rail li.is-active {
  border-bottom-color: var(--after-amber);
}

.after-action-phase-rail li.is-active .after-action-phase-btn {
  color: var(--after-ink);
  cursor: default;
}

.after-action-phase-rail li.is-active span,
.after-action-phase-rail li.is-complete span {
  color: var(--after-amber);
}

.after-action-phase-rail li.is-complete .after-action-phase-btn:hover {
  color: var(--after-amber);
}

.after-action-main {
  min-height: 0;
  padding: 22px 0 16px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(233, 183, 95, .3) transparent;
}

.after-action-main::-webkit-scrollbar {
  width: 6px;
}

.after-action-main::-webkit-scrollbar-track {
  background: transparent;
}

.after-action-main::-webkit-scrollbar-thumb {
  background: rgba(233, 183, 95, .25);
  border-radius: 3px;
}

.after-action-main::-webkit-scrollbar-thumb:hover {
  background: rgba(233, 183, 95, .45);
}

.after-action-stage {
  display: grid;
  align-content: start;
  gap: 15px;
  max-width: 1560px;
  height: 100%;
  min-height: 0;
}

.after-action-stage--result {
  align-content: center;
  max-width: 900px;
}

.after-action-stage--result h2 {
  font-size: 56px;
}

.after-action-result-advice {
  max-width: 680px;
  margin: 0;
  padding-left: 14px;
  border-left: 2px solid var(--after-amber);
  color: var(--after-ink);
  font-size: 16px;
  line-height: 1.55;
}

.after-action-result-line {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin-top: 20px;
  padding: 17px 0;
  border-block: 1px solid var(--after-line);
}

.after-action-result-line span {
  color: var(--after-cyan);
  font-size: 13px;
}

.after-action-result-line strong {
  color: var(--after-amber);
  font-size: 24px;
}

.after-action-mvp-layout {
  display: grid;
  grid-template-columns: 560px minmax(0, 1fr);
  gap: 48px;
  align-items: start;
  margin-top: 14px;
}

.after-action-mvp-hero,
.after-action-personal {
  min-width: 0;
}

.after-action-mvp-mark,
.after-action-subhead {
  color: var(--after-amber);
  font-size: 13px;
  letter-spacing: .08em;
}

.after-action-mvp-hero h2 {
  margin: 0;
  font-size: 56px;
  line-height: 1.08;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.after-action-mvp-identity {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.after-action-mvp-hero p,
.after-action-personal p {
  margin: 0;
  color: var(--after-muted);
  line-height: 1.45;
}

.after-action-mvp-role {
  min-height: 1.45em;
}

.after-action-mvp-hero > strong {
  display: block;
  margin-top: 24px;
  color: var(--after-amber);
  font-size: 88px;
  line-height: .8;
}

.after-action-mvp-hero > small {
  color: var(--after-muted);
  font-size: 11px;
}

.after-action-reasons {
  display: grid;
  gap: 8px;
  margin-top: 26px;
  padding-left: 13px;
  border-left: 2px solid var(--after-amber);
}

.after-action-reasons span {
  color: var(--after-ink);
  font-size: 14px;
}

.after-action-personal {
  padding-left: 36px;
  border-left: 1px solid var(--after-line);
}

.after-action-personal h3 {
  margin: 10px 0 4px;
  color: var(--after-ink);
  font-size: 24px;
}

.after-action-meters {
  display: grid;
  gap: 13px;
  margin-top: 30px;
}

.after-action-meter {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 30px;
  gap: 12px;
  align-items: center;
  color: var(--after-muted);
  font-size: 12px;
}

.after-action-meter i {
  display: block;
  height: 4px;
  overflow: hidden;
  background: rgba(242, 234, 216, .12);
}

.after-action-meter b {
  display: block;
  height: 100%;
  background: var(--after-cyan);
}

.after-action-meter strong {
  color: var(--after-ink);
  text-align: right;
}

/* MVP Tactical Telemetry Preview */
.after-action-mvp-telemetry-preview {
  margin-top: 22px;
  padding: 10px 14px 12px;
  background: rgba(233, 183, 95, .06);
  border: 1px solid rgba(233, 183, 95, .22);
  border-radius: 4px;
}

.after-action-mvp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.after-action-mvp-chip {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 5px 10px;
  background: rgba(5, 9, 11, .65);
  border: 1px solid rgba(233, 183, 95, .25);
  border-radius: 3px;
  min-width: 84px;
}

.after-action-mvp-chip span {
  font-size: 11px;
  color: var(--after-muted);
}

.after-action-mvp-chip strong {
  font-size: 15px;
  font-weight: 700;
  color: var(--after-amber);
}

.after-action-mvp-chip small {
  font-size: 11px;
  font-weight: 400;
  color: var(--after-muted);
  margin-left: 2px;
}

/* Personal Tactical Telemetry Grid */
.after-action-telemetry-block {
  margin-top: 8px;
}

.after-action-telemetry-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  border-bottom: 1px solid rgba(242, 234, 216, .12);
  padding-bottom: 3px;
}

.after-action-telemetry-kicker {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--after-amber);
  margin: 0;
}

.after-action-telemetry-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.after-action-telemetry-card {
  position: relative;
  background: linear-gradient(135deg, rgba(20, 26, 30, .78) 0%, rgba(10, 15, 18, .88) 100%);
  border: 1px solid rgba(242, 234, 216, .16);
  border-radius: 4px;
  padding: 6px 10px;
  box-sizing: border-box;
  transition: border-color .18s ease, background-color .18s ease;
}

.after-action-telemetry-card:hover {
  border-color: rgba(157, 215, 211, .55);
  background: rgba(20, 32, 38, .92);
}

.after-action-telemetry-card-inner {
  display: flex;
  align-items: center;
  gap: 8px;
}

.after-action-telemetry-icon {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
  filter: drop-shadow(0 0 4px rgba(157, 215, 211, .3));
}

.after-action-telemetry-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.after-action-telemetry-label {
  font-size: 11px;
  color: var(--after-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: .02em;
}

.after-action-telemetry-val {
  font-size: 16px;
  font-weight: 700;
  color: var(--after-cyan);
  line-height: 1.2;
  font-feature-settings: "tnum";
}

.after-action-telemetry-val small {
  font-size: 11px;
  font-weight: 400;
  color: var(--after-muted);
  margin-left: 2px;
}

/* Personal Special Feats Grid */
.after-action-special-block {
  margin-top: 8px;
}

.after-action-special-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.after-action-special-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(35, 28, 16, .8) 0%, rgba(20, 16, 10, .85) 100%);
  border: 1px solid rgba(233, 183, 95, .35);
  border-radius: 4px;
  padding: 5px 8px 5px;
  box-sizing: border-box;
  box-shadow: inset 0 0 12px rgba(233, 183, 95, .05);
  min-height: 46px;
}

.after-action-special-label {
  font-size: 11px;
  color: var(--after-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: .02em;
}

.after-action-special-content {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.after-action-special-icon {
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
}

.after-action-special-val {
  font-size: 16px;
  font-weight: 700;
  color: var(--after-amber);
  line-height: 1.2;
  font-feature-settings: "tnum";
}

.after-action-special-val small {
  font-size: 11px;
  font-weight: 400;
  color: var(--after-muted);
  margin-left: 2px;
}

.after-action-special-badge {
  margin-left: auto;
  font-size: 9px;
  font-weight: 700;
  color: var(--after-amber);
  background: rgba(233, 183, 95, .15);
  border: 1px solid rgba(233, 183, 95, .3);
  border-radius: 2px;
  padding: 1px 4px;
  letter-spacing: .04em;
  white-space: nowrap;
  flex-shrink: 0;
}

.after-action-growth-track {
  display: grid;
  min-width: 0;
  margin-top: 10px;
}

.after-action-growth-layout {
  display: grid;
  grid-template-columns: minmax(540px, 1fr) 460px;
  gap: 56px;
  align-items: start;
  min-height: 0;
  margin-top: 16px;
}

.after-action-growth-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto minmax(140px, .8fr);
  gap: 18px;
  align-items: baseline;
  min-height: 44px;
  padding: 10px 0;
  border-bottom: 1px solid var(--after-line);
  color: var(--after-muted);
}

.after-action-growth-row strong {
  color: var(--after-ink);
}

.after-action-growth-row small {
  color: var(--after-muted);
  text-align: right;
}

.after-action-growth-row.is-level-up strong,
.after-action-growth-row.is-level-up small {
  color: var(--after-green);
}

.after-action-unlocks {
  margin-top: 20px;
}

.after-action-unlocks h3 {
  margin: 0 0 10px;
  color: var(--after-amber);
  font-size: 15px;
  font-weight: 600;
}

.after-action-unlock-ledger {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 28px;
}

.after-action-unlock-hero {
  position: relative;
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  padding: 12px 0 14px 22px;
  border-left: 1px solid var(--after-amber);
  overflow: hidden;
}

.after-action-unlock-kicker {
  margin: 0;
  color: var(--after-amber);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .08em;
}

.after-action-unlock-hero img {
  display: block;
  width: min(180px, 100%);
  height: auto;
  min-height: 100px;
  object-fit: contain;
  object-position: left center;
  filter: grayscale(1) brightness(.8);
  border: 1px solid rgba(242, 234, 216, .26);
  transition: filter 240ms ease, border-color 240ms ease, box-shadow 240ms ease;
}

.after-action-unlock-hero[data-unlock-state="unlocked"] img {
  filter: grayscale(0) saturate(1.08) brightness(1.02);
  border-color: var(--after-amber);
  box-shadow: 0 0 24px rgba(233, 183, 95, .28);
}

.after-action-unlock-hero h3 {
  margin: 0;
  color: var(--after-ink);
  font-size: 22px;
}

.after-action-unlock-hero p,
.after-action-unlock-hero small {
  margin: 0;
  color: var(--after-muted);
  font-size: 12px;
  line-height: 1.45;
}

.after-action-unlock-sweep {
  position: absolute;
  inset: 0 auto 0 -2px;
  width: 2px;
  pointer-events: none;
  background: var(--after-amber);
  opacity: .8;
  animation: after-action-unlock-scan 1.1s ease-out both;
}

.after-action-unlock-more {
  color: var(--after-muted);
  font-size: 12px;
}

@keyframes after-action-unlock-scan {
  from { transform: translateY(-110%); opacity: 0; }
  35% { opacity: .85; }
  to { transform: translateY(110%); opacity: 0; }
}

.after-action-unlock-ledger article {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 64px;
  border-bottom: 1px solid var(--after-line);
}

.after-action-unlock-ledger img {
  width: 72px;
  height: 48px;
  object-fit: cover;
  filter: grayscale(.2) saturate(.85);
}

.after-action-unlock-ledger div {
  display: grid;
  gap: 4px;
}

.after-action-unlock-ledger strong {
  color: var(--after-ink);
  font-size: 14px;
}

.after-action-unlock-ledger small {
  color: var(--after-muted);
  font-size: 11px;
}

.after-action-empty {
  color: var(--after-muted);
}

.after-action-archive-ledger {
  display: grid;
  max-width: 960px;
  margin-top: 16px;
}

.after-action-archive-row {
  display: grid;
  grid-template-columns: minmax(130px, .45fr) 1fr;
  gap: 20px;
  align-items: baseline;
  min-height: 46px;
  padding: 11px 0;
  border-bottom: 1px solid var(--after-line);
}

.after-action-archive-row span {
  color: var(--after-muted);
  font-size: 12px;
}

.after-action-archive-row strong {
  color: var(--after-ink);
  font-size: 14px;
}

.after-action-archive-row[data-tone="support"] strong { color: var(--after-green); }
.after-action-archive-row[data-tone="danger"] strong { color: var(--after-red); }

.after-action-footer {
  display: flex;
  align-items: center;
  gap: 22px;
  min-height: 50px;
  padding-top: 16px;
  border-top: 1px solid var(--after-line);
}

.after-action-primary {
  min-width: 190px;
  min-height: 46px;
  padding: 0 24px;
  border: 1px solid #f5ca7a;
  border-radius: 0;
  background: var(--after-amber);
  color: #17120b;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.app-shell.is-after-action-settlement .after-action-primary {
  border-color: #f5ca7a !important;
  background: var(--after-amber) !important;
  color: #17120b !important;
  box-shadow: none !important;
}

.app-shell.is-after-action-settlement .after-action-primary:hover,
.app-shell.is-after-action-settlement .after-action-primary:focus-visible {
  border-color: #ffe0a0;
  background: #f4c875;
  color: #17120b;
  outline: 1px solid #f5ca7a;
  outline-offset: 2px;
}

.after-action-primary:disabled {
  cursor: wait;
  opacity: .55;
}

.after-action-command {
  min-height: 28px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--after-muted);
  font-size: 12px;
  cursor: pointer;
}

.app-shell.is-after-action-settlement .after-action-command {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.after-action-command:hover,
.after-action-command:focus-visible {
  border-bottom-color: var(--after-amber);
  color: var(--after-ink);
  outline: 0;
}

.after-action-command.after-action-prev {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 4px;
  color: var(--after-cyan);
  font-weight: 600;
}

.after-action-command.after-action-prev:hover,
.after-action-command.after-action-prev:focus-visible {
  border-bottom-color: var(--after-cyan);
  color: #c0f4f0;
}

.after-action-keyhint {
  margin-left: auto;
  color: rgba(242, 234, 216, .4);
  font-size: 11px;
}

@media (prefers-reduced-motion: reduce) {
  .after-action-settlement *, .after-action-settlement *::before, .after-action-settlement *::after { animation: none !important; transition: none !important; }
}
