/* Agent District prototype — demo stage.
   The one dark surface on the site, so the demo reads as "the main event".
   Left: conversation (and the plan sheet for the plan project). Right: the agent's steps. */

.stage { background: var(--stage); color: #e8ebf0; border-radius: var(--r-xl); padding: 10px; box-shadow: var(--shadow-2); }
.stage-bar { display: flex; align-items: center; gap: 14px; padding: 12px 14px 14px; font-size: 13.5px; flex-wrap: wrap; }
.stage-badge { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 13px; border-radius: 999px; background: #fff; color: var(--ink); font-weight: 600; font-size: 13px; }
.stage-badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; box-shadow: inset 0 0 0 1.8px var(--ink); }
.stage-ctx { color: rgba(255, 255, 255, .8); }
.stage-note { margin-left: auto; color: rgba(255, 255, 255, .55); }

.stage-scn { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 6px 10px; }
.stage-scn > div { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.stage-scn [role="tab"] { height: 40px; padding: 0 16px; border-radius: 999px; background: rgba(255, 255, 255, .07); color: rgba(255, 255, 255, .78); font-size: 14px; font-weight: 500; white-space: nowrap; transition: background .2s, color .2s; }
.stage-scn [role="tab"]:hover { background: rgba(255, 255, 255, .13); }
.stage-scn [role="tab"][aria-selected="true"] { background: #fff; color: var(--ink); }
.stage-restart { display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px; border-radius: 999px; color: rgba(255, 255, 255, .7); font-size: 14px; font-weight: 500; flex: none; }
.stage-restart:hover { color: #fff; background: rgba(255, 255, 255, .08); }

.stage-body { display: grid; grid-template-columns: 1.3fr .7fr; gap: 10px; }
.pane { background: var(--stage-2); border-radius: 24px; min-height: 460px; display: flex; flex-direction: column; overflow: hidden; }
.pane-h { padding: 18px 20px 6px; font-size: 13px; font-weight: 600; color: rgba(255, 255, 255, .55); }

/* Conversation */
.feed { flex: 1; padding: 22px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; max-height: 520px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .2) transparent; }
.has-canvas .feed { max-height: 300px; }
.msg, .appr, .tr li, .sched tr { opacity: 0; transform: translateY(8px); transition: opacity .4s var(--ease), transform .4s var(--ease); }
.msg.in, .appr.in, .tr li.in, .sched tr.in { opacity: 1; transform: none; }
.msg { max-width: 82%; display: grid; gap: 5px; }
.msg small { font-size: 12px; font-weight: 550; color: rgba(255, 255, 255, .5); padding: 0 4px; }
.msg p { padding: 12px 16px; border-radius: 20px; font-size: 15px; line-height: 1.45; }
.msg.guest { align-self: flex-end; justify-items: end; }
.msg.guest p { background: #fff; color: var(--ink); border-bottom-right-radius: 6px; }
.msg.agent p { background: rgba(255, 255, 255, .09); border-bottom-left-radius: 6px; }
.msg.system { max-width: 100%; }
.msg.system p { background: none; box-shadow: inset 0 0 0 1px var(--stage-line); color: rgba(255, 255, 255, .8); font-size: 14px; border-radius: 14px; }
.cites { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 2px; }
.cites span { font-size: 12px; font-weight: 500; padding: 3px 9px; border-radius: 999px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2); color: rgba(255, 255, 255, .75); }
.typing p { display: inline-flex; gap: 5px; padding: 16px; width: max-content; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, .6); animation: blink 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
.msg.typing { opacity: 1; transform: none; }
@keyframes blink { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }

/* Approval card — the moment a person takes over. Uses the project hue so it stands apart. */
.appr { background: #fff; color: var(--ink); border-radius: 22px; padding: 20px; display: grid; gap: 10px; box-shadow: 0 0 0 4px color-mix(in srgb, var(--m) 55%, transparent); }
.appr small { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--d); }
.appr small .ic { width: 15px; height: 15px; }
.appr > b { font-size: 18px; letter-spacing: -.02em; font-weight: 600; }
.appr li { font-size: 14px; color: var(--ink-2); padding: 7px 0; border-top: 1px solid var(--line); }
.appr > div { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.appr .btn-light { background: var(--ink); color: #fff; }
.appr .btn-dim { background: var(--sunk); color: var(--ink); }
.appr .btn[disabled] { opacity: .3; }
.appr .btn.chosen { opacity: 1; box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--d); }

/* Trace */
.tr { padding: 8px 12px 16px; display: grid; gap: 4px; align-content: start; overflow-y: auto; max-height: 560px; flex: 1; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .2) transparent; }
.tr li { display: grid; grid-template-columns: 32px 1fr; gap: 12px; padding: 10px 8px; border-radius: 14px; }
.tr i { width: 32px; height: 32px; border-radius: 10px; background: rgba(255, 255, 255, .08); display: grid; place-items: center; color: rgba(255, 255, 255, .85); }
.tr i .ic { width: 16px; height: 16px; }
.tr small { display: block; font-size: 11.5px; font-weight: 600; color: rgba(255, 255, 255, .6); }
.tr b { display: block; font-size: 14px; font-weight: 600; letter-spacing: -.01em; line-height: 1.3; }
.tr span { display: block; font-size: 12.5px; line-height: 1.45; color: rgba(255, 255, 255, .6); margin-top: 2px; }
.tr .k-policy i, .tr .k-human i { background: var(--m); color: var(--ink); }
.tr .k-done i { background: #fff; color: var(--ink); }
.tr .waiting { background: rgba(255, 255, 255, .05); }
.tr .waiting i { animation: blink 1.6s infinite; }
.tr:empty::after { content: "Steps appear here as the scenario plays."; padding: 10px 8px; font-size: 13.5px; color: rgba(255, 255, 255, .6); }

/* Plan canvas */
.canvas { padding: 14px 14px 0; display: grid; grid-template-columns: 1.25fr .75fr; gap: 14px; align-items: start; }
.canvas svg { border-radius: 12px; }
.sched { width: 100%; border-collapse: collapse; font-size: 13px; }
.sched th { text-align: left; font-size: 11.5px; font-weight: 600; color: rgba(255, 255, 255, .6); padding: 4px 8px 8px 0; }
.sched td { padding: 9px 8px 9px 0; border-top: 1px solid var(--stage-line); color: rgba(255, 255, 255, .88); }
.sched td:nth-child(2) { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.sched td:last-child { color: rgba(255, 255, 255, .55); }
.sched tr.flag td { color: var(--m); }
.sched tbody:empty::after { content: "The schedule fills in as the sheet is read."; display: block; padding: 8px 0; color: rgba(255, 255, 255, .6); }

@media (max-width: 900px) {
  .stage-body { grid-template-columns: 1fr; }
  .pane { min-height: 0; }
  .pane.talk { min-height: 340px; }
  .canvas { grid-template-columns: 1fr; }
  .stage-note { margin-left: 0; width: 100%; }
  .feed { max-height: 440px; }
  .tr { max-height: 320px; }
}
@media (max-width: 560px) {
  .stage { padding: 6px; border-radius: var(--r-lg); }
  .pane { border-radius: 18px; }
  .feed { padding: 16px; }
  .msg { max-width: 92%; }
  .stage-restart { padding: 0 8px; }
}
