.stand-console {
  --stand-ink: #f2f2e9;
  --stand-muted: #bdc9c2;
  --stand-label: #afc1b8;
  --stand-copper: #efb48a;
  --stand-gutter: clamp(1.35rem, 3.1vw, 3rem);
  color: var(--stand-ink);
  padding: clamp(1rem, 1.8vw, 1.65rem);
  border-radius: 26px;
  background: radial-gradient(ellipse at 87% 0%, #25443d 0, transparent 48%),
    linear-gradient(135deg, #1b302d, #152825 55%, #122521);
  box-shadow: inset 0 1px 0 #e0efcf24, 0 18px 56px -36px #000b;
}

.stand-toolbar,
.stand-role-tabs,
.stand-source-tabs,
.stand-offer,
.stand-decisions {
  display: flex;
  align-items: center;
}

.stand-toolbar {
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .65rem 1rem;
}

.stand-console button {
  border: 0;
  color: var(--stand-muted);
  background: none;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color .16s ease, background .16s ease, box-shadow .16s ease;
}

.stand-console button:focus-visible,
.stand-console [tabindex]:focus-visible {
  outline: 2px solid #ffcca1;
  outline-offset: 3px;
}

.stand-role-tabs {
  max-width: 100%;
  flex-wrap: wrap;
  gap: .2rem;
  border-radius: 999px;
  padding: .28rem;
  background: #081b18;
  box-shadow: inset 0 1px 3px #0004;
}

.stand-role-tabs button {
  min-height: 44px;
  padding: .55rem clamp(.85rem, 1.5vw, 1.6rem);
  border-radius: 999px;
  font-size: .96rem;
  font-weight: 550;
  line-height: 1.25;
  white-space: nowrap;
}

.stand-console button:hover { color: var(--stand-ink); }
.stand-role-tabs button:hover { background: #253a32; }

.stand-role-tabs button[aria-selected="true"] {
  color: #251b14;
  background: #ecc09a;
  box-shadow: inset 0 1px 0 #ffe1c6, 0 2px 5px #0003;
  font-weight: 750;
}

.stand-example,
.stand-label {
  color: var(--stand-label);
  font: 550 .88rem/1.45 var(--sans, sans-serif);
}

.stand-example { padding-inline: 1rem; }

.stand-case {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .98fr);
  gap: clamp(1.65rem, 3.1vw, 3rem);
  align-items: start;
  padding-top: clamp(1.9rem, 3.25vw, 3.25rem);
  border-radius: 18px;
}

.stand-conversation {
  min-width: 0;
  padding-left: calc(var(--stand-gutter) - .65rem);
}

.stand-evidence { min-width: 0; }

.stand-label { margin: 0 0 .68rem; }

.stand-question {
  max-width: 26ch;
  margin: 0;
  color: var(--stand-ink);
  font: 400 clamp(1.65rem, 2.55vw, 2.85rem)/1.16 var(--serif, Georgia, serif);
  letter-spacing: -.042em;
  text-wrap: pretty;
}

.stand-reply { margin-top: clamp(1.45rem, 2.5vw, 2.4rem); }

.stand-speaker {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  color: var(--stand-copper);
  font-size: .95rem;
  font-weight: 700;
}

.stand-speaker img { width: 1.45rem; height: 1.45rem; }

.stand-answer,
.stand-check,
.stand-result-copy,
.stand-proposal {
  max-width: 57ch;
  margin: 0;
  color: var(--stand-ink);
  font-size: 1rem;
  line-height: 1.62;
}

.stand-check { margin-top: .5rem; color: var(--stand-muted); }

.stand-editor {
  overflow: hidden;
  border-radius: 17px;
  background: #0b1c19;
  box-shadow: inset 0 1px 4px #0003;
}

.stand-source-tabs {
  flex-wrap: wrap;
  gap: .15rem;
  padding: .45rem .6rem 0;
  background: #162925;
}

.stand-source-tabs button {
  min-height: 44px;
  padding: .4rem .82rem;
  border-radius: 11px 11px 0 0;
  font: .86rem/1.35 var(--mono, monospace);
  overflow-wrap: anywhere;
}
.stand-source-tabs button:hover { color: var(--stand-ink); background: #213630; }
.stand-source-tabs button[aria-selected="true"] {
  color: var(--stand-copper);
  background: #0b1c19;
  font-weight: 700;
}
.stand-source-tabs button:focus-visible { outline-offset: -4px; }

.stand-source-panel {
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: #677c71 #0b1c19;
}
.stand-source-panel:focus-visible { outline-offset: -4px !important; }

.stand-file {
  margin: 0;
  padding: 1rem 0 1.3rem;
  color: #cfddd3;
  font: .9rem/1.88 var(--mono, monospace);
  text-align: left;
}
.stand-file code { display: block; min-width: max-content; font: inherit; }
.stand-code-line { display: block; padding-inline: 1.15rem; white-space: pre; }
.stand-code-focus {
  color: #ffd5a9;
  background: linear-gradient(90deg, #3d3526, #2c3025);
  box-shadow: inset 3px 0 #e3a477;
}
.stand-line-no {
  display: inline-block;
  width: 2.65em;
  color: #99b1a4;
  font-size: .84em;
  user-select: none;
}

.stand-operation {
  grid-column: 1 / -1;
  padding: clamp(1.1rem, 2vw, 1.85rem) var(--stand-gutter);
  border-radius: 18px;
  background: linear-gradient(110deg, #263b33, #20352e);
  box-shadow: inset 0 1px 0 #e6efd311;
}
.stand-offer, .stand-decisions { flex-wrap: wrap; gap: .72rem 1.1rem; }
.stand-offer { justify-content: space-between; }
.stand-proposal { max-width: 56ch; font-weight: 550; }

.stand-operation button {
  min-height: 46px;
  max-width: 100%;
  padding: .7rem 1.3rem;
  border-radius: 999px;
  font-size: .95rem;
  font-weight: 650;
  line-height: 1.35;
  text-wrap: balance;
}
.stand-operation .stand-action { color: #eaf0e8; background: #3b5347; }
.stand-operation .stand-action:hover { background: #496354; }
.stand-operation .stand-apply { color: #2d1f13; background: #efbd94; }
.stand-operation .stand-apply:hover { color: #24170e; background: #f7cfae; }
.stand-operation .stand-cancel, .stand-operation .stand-reset { color: #d4e0d7; }
.stand-operation .stand-cancel:hover, .stand-operation .stand-reset:hover { background: #344b3e; }

.stand-operation-title {
  margin: 0 0 1.4rem;
  width: fit-content;
  border-radius: 3px;
  font: 400 clamp(1.45rem, 2vw, 2.1rem)/1.2 var(--serif, Georgia, serif);
  letter-spacing: -.035em;
}

.stand-plan-list {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 1rem clamp(1.5rem, 3vw, 3rem);
  margin: 0 0 1.5rem;
}
.stand-plan-list dt {
  margin: 0 0 .35rem;
  color: var(--stand-label);
  font-size: .87rem;
  font-weight: 650;
}
.stand-plan-list dd { margin: 0; overflow-wrap: anywhere; }
.stand-result-copy { max-width: 68ch; }
.stand-result-output {
  display: block;
  margin-block: .9rem;
  color: #f6c99e;
  font: .92rem/1.55 var(--mono, monospace);
  overflow-wrap: anywhere;
}
.stand-operation .stand-reset { margin-left: -.75rem; padding-inline: .75rem; }

@media (max-width: 860px) {
  .stand-case { grid-template-columns: minmax(0, 1fr); }
  .stand-conversation { padding-inline: .5rem; }
  .stand-operation { grid-column: auto; }
  .stand-question { max-width: 36ch; }
  .stand-plan-list { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 600px) {
  .stand-console { padding: .72rem; border-radius: 23px; }
  .stand-toolbar { flex-direction: column-reverse; align-items: stretch; gap: .6rem; }
  .stand-example { padding: .2rem .58rem 0; }
  .stand-role-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, auto)); gap: .08rem; }
  .stand-role-tabs button { padding: .4rem .58rem; font-size: .88rem; }
  .stand-case { padding-top: 1.45rem; gap: 1.35rem; }
  .stand-question { font-size: clamp(1.55rem, 6.7vw, 2rem); }
  .stand-conversation { padding-inline: .58rem; }
  .stand-evidence > .stand-label { margin-left: .58rem; }
  .stand-code-line { padding-inline: .74rem; }
  .stand-source-tabs { padding-inline: .3rem; }
  .stand-source-tabs button { padding-inline: .6rem; font-size: .8rem; }
  .stand-operation { padding: 1.1rem; border-radius: 15px; }
}

@media (max-width: 430px) {
  .stand-role-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); border-radius: 21px; }
  .stand-role-tabs button { border-radius: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .stand-console button { transition: none; }
}

@media (forced-colors: active) {
  .stand-role-tabs button[aria-selected="true"],
  .stand-source-tabs button[aria-selected="true"],
  .stand-code-focus,
  .stand-operation .stand-action { outline: 1px solid currentColor; outline-offset: -2px; }
}
