.gateway-shell {
  width: min(1180px, calc(100% - 32px));
  max-width: none;
  margin: 0 auto;
  padding: calc(var(--header-height) + 34px) 0 48px;
}

.gateway-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: center;
  margin-bottom: 20px;
  padding: clamp(24px, 4vw, 34px);
  background: var(--surface);
}

.gateway-heading > div {
  min-width: 0;
}

.gateway-heading h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(32px, 4.5vw, 50px);
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.gateway-heading p:not(.eyebrow) {
  max-width: 820px;
  margin: 16px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.gateway-heading-aside {
  display: grid;
  justify-items: end;
  gap: 12px;
}

.gateway-mode {
  align-self: start;
  padding: 9px 12px;
  background: rgba(96, 165, 250, 0.12);
  color: #bfdbfe;
  font: 600 11px var(--mono);
  text-transform: uppercase;
  white-space: nowrap;
}

.gateway-powershell-feature {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  margin-bottom: 20px;
  padding: clamp(20px, 3vw, 28px);
  overflow: hidden;
  border: 1px solid rgba(96, 165, 250, 0.42);
  border-left: 4px solid #60a5fa;
  background: #101d30;
}

.gateway-powershell-feature::after {
  content: '';
  position: absolute;
  right: -70px;
  bottom: -95px;
  width: 230px;
  height: 230px;
  border: 1px solid rgba(96, 165, 250, 0.1);
  border-radius: 50%;
  pointer-events: none;
}

.gateway-powershell-mark {
  position: relative;
  z-index: 1;
  width: 68px;
  height: 68px;
  display: grid;
  place-content: center;
  gap: 2px;
  border: 1px solid rgba(147, 197, 253, 0.34);
  background: #172a45;
  color: #dbeafe;
  font-family: var(--mono);
  text-align: center;
}

.gateway-powershell-mark span {
  color: #93c5fd;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.gateway-powershell-mark b {
  font-size: 18px;
  font-weight: 600;
}

.gateway-powershell-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.gateway-powershell-copy .eyebrow {
  margin-bottom: 6px;
  color: #93c5fd;
}

.gateway-powershell-copy h2 {
  margin: 0;
  font-size: clamp(24px, 3.1vw, 32px);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.gateway-powershell-copy > p:not(.eyebrow) {
  max-width: 620px;
  margin: 8px 0 14px;
  color: #b7c3d4;
  font-size: 14px;
  line-height: 1.5;
}

.gateway-powershell-points {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.gateway-powershell-points span {
  padding: 5px 7px;
  background: #172a45;
  color: #bfdbfe;
  font: 600 9px var(--mono);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.gateway-powershell-action {
  position: relative;
  z-index: 1;
  min-width: 160px;
  min-height: 46px;
  gap: 12px;
  padding-inline: 18px;
  font-size: 14px;
  justify-content: space-between;
  white-space: nowrap;
}

.gateway-powershell-action span {
  font-size: 17px;
}

.gateway-notice {
  margin-bottom: 20px;
  padding: 14px 16px;
  background: #172033;
  color: #dbeafe;
  line-height: 1.55;
}

.gateway-notice a {
  color: #bfdbfe;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.gateway-error {
  background: #35151a;
  color: #fecdd3;
}

.gateway-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
  gap: 20px;
  align-items: start;
}

.gateway-form,
.gateway-result,
.gateway-history {
  min-width: 0;
  padding: clamp(20px, 2.5vw, 26px);
}

.gateway-form {
  display: grid;
  gap: 18px;
}

.gateway-form .panel-title h1 {
  font-size: 18px;
}

.gateway-form .field {
  display: grid;
  gap: 8px;
}

.gateway-form .field > span {
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}

.gateway-textarea {
  min-height: 190px !important;
}

.gateway-urls {
  min-height: 104px !important;
}

.gateway-upload {
  position: relative;
  min-height: 102px;
  display: grid;
  place-content: center;
  gap: 6px;
  border: 1px dashed var(--border-strong);
  padding: 18px;
  background: var(--surface-2);
  text-align: center;
  cursor: pointer;
}

.gateway-upload:hover {
  border-color: var(--accent);
}

.gateway-upload strong {
  color: var(--text);
}

.gateway-upload span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.gateway-upload input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.gateway-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding-top: 2px;
}

body.vt-tool-page.vt-gateway-page.vt-graphite-theme .gateway-actions .btn {
  width: auto;
  min-height: 36px;
  padding: 8px 13px;
  font-size: 11px;
  line-height: 1.2;
}

.gateway-privacy {
  margin: -2px 0 0;
  color: var(--soft);
  font-size: 12px;
  line-height: 1.6;
}

.gateway-result {
  min-height: 430px;
}

.gateway-decision {
  display: grid;
  grid-template-columns: minmax(160px, 1.25fr) repeat(2, minmax(110px, 0.875fr));
  gap: 10px;
  margin-top: 4px;
}

.gateway-decision > div {
  min-width: 0;
  min-height: 72px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 14px;
  background: var(--surface-2);
}

.gateway-decision span {
  display: block;
  color: var(--soft);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.gateway-decision strong {
  display: block;
  margin-top: 7px;
  overflow-wrap: normal;
  font-size: clamp(13px, 1.25vw, 15px);
  line-height: 1.3;
  text-transform: capitalize;
}

#gateway-recommendation {
  white-space: nowrap;
}

.gateway-result-state {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.gateway-card-loader {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font: 600 9px/1.2 var(--mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.gateway-card-loader[hidden] {
  display: none;
}

.gateway-card-loader::before {
  content: '';
  width: 13px;
  height: 13px;
  border: 2px solid rgba(148, 163, 184, 0.32);
  border-top-color: #60a5fa;
  border-radius: 50%;
  animation: vt-spin 0.75s linear infinite;
}

.gateway-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 16px 0 20px;
}

.gateway-reasons span {
  padding: 6px 8px;
  background: #172033;
  color: #bfdbfe;
  font: 600 10px var(--mono);
}

.gateway-result h3 {
  margin: 20px 0 10px;
  font-size: 15px;
}

.gateway-evidence {
  display: grid;
  gap: 10px;
}

.gateway-evidence article {
  min-width: 0;
  padding: 14px;
  background: var(--surface-2);
}

.gateway-evidence-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  min-width: 0;
}

.gateway-evidence strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 14px;
  text-transform: capitalize;
}

.gateway-evidence-head span {
  flex: 0 0 auto;
  padding: 4px 7px;
  background: rgba(34, 197, 94, 0.09);
  color: #86efac;
  font: 600 9px var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.gateway-evidence-head span[data-status='failed'],
.gateway-evidence-head span[data-status='cancelled'] {
  background: rgba(239, 68, 68, 0.1);
  color: #fca5a5;
}

.gateway-evidence-head span[data-status='queued'],
.gateway-evidence-head span[data-status='processing'],
.gateway-evidence-head span[data-status='accepted'] {
  background: rgba(96, 165, 250, 0.1);
  color: #bfdbfe;
}

.gateway-evidence p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.gateway-result .result-details {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.gateway-result .result-details summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.gateway-result .result-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
  margin-top: 12px;
  overflow-wrap: anywhere;
}

.gateway-history {
  margin-top: 20px;
}

.gateway-history .panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.gateway-history .panel-title h2 {
  font-size: 18px;
}

.gateway-history .panel-title p {
  margin-top: 3px;
  font-size: 11px;
  line-height: 1.45;
}

body.vt-tool-page.vt-gateway-page.vt-graphite-theme .gateway-history .panel-title .btn {
  flex: 0 0 auto;
  align-self: center;
  width: auto;
  min-height: 34px;
  padding: 7px 11px;
  font-size: 10.5px;
  line-height: 1.2;
}

.gateway-history-list {
  display: grid;
  gap: 8px;
}

.gateway-history-list article,
.gateway-history-list .gateway-history-item {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  text-align: left;
}

.gateway-history-list .gateway-history-item {
  appearance: none;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.gateway-history-list .gateway-history-item:hover {
  border-color: var(--border-strong);
  background: var(--surface-3);
}

.gateway-history-list .gateway-history-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.gateway-history-list .gateway-history-item:disabled {
  cursor: default;
  opacity: 1;
}

.gateway-history-list strong {
  overflow-wrap: anywhere;
  font: 600 11px var(--mono);
}

.gateway-history-list span {
  color: var(--muted);
  font-size: 11px;
}

.gateway-history-list em {
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(96, 165, 250, 0.1);
  color: #bfdbfe;
  font: 600 9px var(--mono);
  letter-spacing: 0.035em;
  font-style: normal;
  text-transform: capitalize;
}

.gateway-history-list .gateway-history-item.is-selected {
  border-color: rgba(96, 165, 250, 0.5);
  background: var(--surface-3);
}

.gateway-history-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.gateway-history-pagination[hidden] {
  display: none;
}

.gateway-history-pagination p {
  margin: 0;
  color: var(--soft);
  font-size: 10.5px;
}

body.vt-tool-page.vt-gateway-page.vt-graphite-theme .gateway-history-pagination .btn {
  width: auto;
  min-height: 34px;
  padding: 7px 12px;
  font-size: 10.5px;
}

.gateway-result .tool-result-empty {
  min-height: 300px;
  display: grid;
  place-items: center;
  padding: 32px;
  color: var(--muted);
  text-align: center;
  line-height: 1.65;
}

.gateway-result .tool-result-empty[hidden],
.gateway-result .gateway-output[hidden] {
  display: none !important;
}

.gateway-result.is-loading .tool-result-empty::before {
  content: '';
  width: 24px;
  height: 24px;
  margin-bottom: 10px;
  border: 2px solid #334155;
  border-top-color: #60a5fa;
  border-radius: 50%;
  animation: vt-spin 0.8s linear infinite;
}

@media (max-width: 900px) {
  .gateway-heading {
    grid-template-columns: 1fr;
  }

  .gateway-mode {
    width: max-content;
  }

  .gateway-heading-aside {
    justify-items: start;
  }

  .gateway-powershell-feature {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .gateway-powershell-action {
    grid-column: 1 / -1;
    width: fit-content;
  }

  .gateway-layout {
    grid-template-columns: 1fr;
  }

  .gateway-result {
    min-height: 0;
  }
}

@media (max-width: 600px) {
  .gateway-shell {
    width: min(100% - 20px, 1180px);
    padding-top: calc(var(--header-height) + 14px);
  }

  .gateway-heading,
  .gateway-powershell-feature,
  .gateway-form,
  .gateway-result,
  .gateway-history {
    padding: 20px 17px;
  }

  .gateway-heading h1 {
    font-size: clamp(30px, 10vw, 42px);
  }

  .gateway-powershell-feature {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .gateway-powershell-mark {
    width: 58px;
    height: 58px;
  }

  .gateway-powershell-action {
    grid-column: auto;
    width: 100%;
    min-width: 0;
  }

  .gateway-decision,
  .gateway-result .result-meta {
    grid-template-columns: 1fr;
  }

  #gateway-recommendation {
    white-space: normal;
  }

  .gateway-history .panel-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-direction: row;
  }

  .gateway-history-list article,
  .gateway-history-list .gateway-history-item {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 10px;
    padding: 10px 12px;
  }

  .gateway-history-list span {
    grid-column: 1 / -1;
  }

  body.vt-tool-page.vt-gateway-page.vt-graphite-theme .gateway-actions {
    align-items: center;
    flex-direction: row;
    gap: 8px;
  }

  body.vt-tool-page.vt-gateway-page.vt-graphite-theme .gateway-actions .btn,
  body.vt-tool-page.vt-gateway-page.vt-graphite-theme .gateway-history .btn {
    width: auto;
  }

  .gateway-evidence-head {
    align-items: flex-start;
  }
}

/* Unified Gateway hierarchy refinements. Shared glass comes from glass-system.css. */
body.vt-tool-page.vt-gateway-page.vt-graphite-theme .gateway-shell {
  width: min(1160px, calc(100% - 32px));
  padding-top: calc(var(--header-height) + 3.25rem);
}

body.vt-tool-page.vt-gateway-page.vt-graphite-theme .gateway-heading {
  display: block;
  margin-bottom: 12px;
  padding: clamp(19px, 3vw, 28px);
}

body.vt-tool-page.vt-gateway-page.vt-graphite-theme .gateway-heading-copy {
  max-width: 700px;
}

body.vt-tool-page.vt-gateway-page.vt-graphite-theme .gateway-heading-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

body.vt-tool-page.vt-gateway-page.vt-graphite-theme .gateway-heading-meta .eyebrow {
  margin: 0;
}

body.vt-tool-page.vt-gateway-page.vt-graphite-theme .gateway-heading h1 {
  max-width: 620px;
  font-size: clamp(27px, 3.4vw, 38px);
  line-height: 1.08;
}

body.vt-tool-page.vt-gateway-page.vt-graphite-theme .gateway-heading p:not(.eyebrow) {
  max-width: 620px;
  margin-top: 9px;
  font-style: normal !important;
  line-height: 1.5;
}

body.vt-tool-page.vt-gateway-page.vt-graphite-theme .gateway-mode {
  padding: 5px 8px;
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  font-size: 9px;
  letter-spacing: 0.055em;
}

body.vt-tool-page.vt-gateway-page.vt-graphite-theme .gateway-powershell-feature {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  margin-bottom: 14px;
  padding: 0;
  overflow: visible;
  border: 0 !important;
  background: transparent !important;
}

body.vt-tool-page.vt-gateway-page.vt-graphite-theme .gateway-powershell-feature::after {
  content: none;
}

body.vt-tool-page.vt-gateway-page.vt-graphite-theme .gateway-powershell-copy .eyebrow {
  margin-bottom: 14px;
}

body.vt-tool-page.vt-gateway-page.vt-graphite-theme .gateway-powershell-copy h2 {
  font-size: clamp(24px, 3.1vw, 32px);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

body.vt-tool-page.vt-gateway-page.vt-graphite-theme .gateway-powershell-copy > p:not(.eyebrow) {
  max-width: 620px;
  margin: 8px 0 14px;
  font-size: 14px;
  font-style: normal !important;
  line-height: 1.5;
}

body.vt-tool-page.vt-gateway-page.vt-graphite-theme .gateway-powershell-action {
  min-width: 160px;
  min-height: 46px;
  gap: 12px;
  padding-inline: 18px;
  font-size: 14px;
}

body.vt-tool-page.vt-gateway-page.vt-graphite-theme .gateway-layout {
  gap: 14px;
}

body.vt-tool-page.vt-gateway-page.vt-graphite-theme .gateway-form,
body.vt-tool-page.vt-gateway-page.vt-graphite-theme .gateway-result,
body.vt-tool-page.vt-gateway-page.vt-graphite-theme .gateway-history {
  padding: clamp(19px, 2.4vw, 25px);
}

body.vt-tool-page.vt-gateway-page.vt-graphite-theme .gateway-history {
  margin-top: 14px;
}

body.vt-tool-page.vt-gateway-page.vt-graphite-theme :where(.gateway-upload, .gateway-decision > div, .gateway-evidence article, .gateway-history-list article, .gateway-history-list .gateway-history-item) {
  border: 1px solid rgba(255, 255, 255, 0.075);
  background: rgba(43, 43, 43, 0.68) !important;
}

@media (max-width: 900px) {
  body.vt-tool-page.vt-gateway-page.vt-graphite-theme .gateway-powershell-feature {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  body.vt-tool-page.vt-gateway-page.vt-graphite-theme .gateway-powershell-action {
    grid-column: auto;
  }
}

@media (max-width: 600px) {
  body.vt-tool-page.vt-gateway-page.vt-graphite-theme .gateway-shell {
    width: min(100% - 20px, 1160px);
    padding-top: calc(var(--header-height) + 2rem);
  }

  body.vt-tool-page.vt-gateway-page.vt-graphite-theme .gateway-heading {
    padding: 18px 16px;
  }

  body.vt-tool-page.vt-gateway-page.vt-graphite-theme .gateway-heading-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  body.vt-tool-page.vt-gateway-page.vt-graphite-theme .gateway-powershell-feature {
    grid-template-columns: 1fr;
    gap: 15px;
    padding: 0;
  }

  body.vt-tool-page.vt-gateway-page.vt-graphite-theme .gateway-powershell-action {
    width: 100%;
  }
}
.gateway-layout > *,
.gateway-evidence article,
.gateway-evidence-head > *,
.gateway-decision > div { min-width: 0; }

.gateway-evidence p,
.gateway-evidence li,
.gateway-audit,
.gateway-history-item strong { overflow-wrap: anywhere; }

.gateway-evidence details { margin-top: 12px; }
.gateway-evidence summary { cursor: pointer; padding-block: 8px; }
.gateway-evidence ul { margin: 12px 0; padding-left: 20px; }
