.entity-workbench-page {
  --entity-frame-width: 1160px;
  --entity-border: rgba(101, 131, 174, 0.24);
  --entity-surface: linear-gradient(180deg, rgba(16, 24, 38, 0.98), rgba(9, 15, 25, 0.98));
  --entity-surface-soft: linear-gradient(180deg, rgba(19, 29, 45, 0.96), rgba(10, 18, 31, 0.98));
  --entity-workbench-surface:
    linear-gradient(90deg, rgba(99, 226, 198, 0.06), transparent 18%, transparent 82%, rgba(121, 158, 255, 0.08)),
    linear-gradient(180deg, rgba(7, 13, 23, 0.98), rgba(5, 10, 18, 0.99));
  --entity-grid-line: rgba(92, 123, 170, 0.08);
  --entity-accent: #9ec8ff;
  --entity-accent-soft: #6fe0cb;
  --entity-success: #89f0d0;
  --entity-warning: #f3c47a;
  --entity-error: #ff8f8f;
  overflow-x: clip;
}

.entity-workbench-page .tool-frame {
  width: 100%;
  max-width: var(--entity-frame-width);
  margin-inline: auto;
}

.entity-workbench-page .tool-header-block {
  max-width: none;
  margin-inline: 0;
  text-align: left;
  padding-top: 8px;
  padding-bottom: 14px;
}

.entity-workbench-page .page-title {
  max-width: none;
  font-size: clamp(2.24rem, 2.7vw, 2.74rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.entity-workbench-page .page-subtitle {
  max-width: 34rem;
  margin-inline: 0;
  font-size: 1rem;
  line-height: 1.5;
  text-wrap: balance;
}

.entity-workbench {
  position: relative;
  padding: 10px;
  border: 1px solid var(--entity-border);
  border-radius: 30px;
  background: var(--entity-workbench-surface);
  box-shadow: 0 28px 76px rgba(2, 8, 18, 0.48);
  overflow: hidden;
}

.entity-workbench::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(var(--entity-grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--entity-grid-line) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, rgba(255, 255, 255, 0.44), transparent 72%);
  pointer-events: none;
}

.entity-deckbar,
.entity-panel__meta,
.entity-summary__chips,
.entity-metrics,
.entity-actions,
.entity-mode-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.entity-chip,
.entity-pill,
.entity-summary__chip,
.entity-trust-pill {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border: 1px solid rgba(134, 170, 221, 0.2);
  border-radius: 999px;
  white-space: nowrap;
  background: rgba(10, 17, 29, 0.78);
  color: var(--color-text-muted);
  font-size: 0.79rem;
}

.entity-chip {
  color: var(--entity-accent-soft);
}

.entity-deckbar {
  position: relative;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 0 2px 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(115, 148, 198, 0.14);
}

.entity-deckbar__eyebrow {
  margin: 0 0 4px;
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(145, 180, 231, 0.82);
}

.entity-deckbar__title {
  margin: 0;
  font-size: 1rem;
  color: rgba(233, 241, 255, 0.96);
}

.entity-workbench__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr);
  gap: 6px;
  align-items: stretch;
}

.entity-panel {
  min-width: 0;
  padding: 14px;
  border-radius: 26px;
  border: 1px solid rgba(103, 135, 182, 0.2);
  background: var(--entity-surface);
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.entity-panel--output {
  background: var(--entity-surface-soft);
}

.entity-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.entity-panel__eyebrow {
  margin: 0 0 4px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--entity-accent);
}

.entity-panel__hint,
.entity-summary__detail {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.99rem;
  line-height: 1.6;
}

.entity-panel__hint {
  max-width: 28ch;
}

.entity-mode {
  appearance: none;
  border: 1px solid rgba(134, 172, 228, 0.2);
  border-radius: 999px;
  padding: 11px 18px;
  background: rgba(11, 20, 31, 0.84);
  color: rgba(216, 230, 251, 0.9);
  font: inherit;
  cursor: pointer;
}

.entity-mode--active {
  background: linear-gradient(180deg, rgba(84, 143, 227, 0.24), rgba(57, 103, 188, 0.18));
  border-color: rgba(141, 184, 255, 0.54);
  color: #ffffff;
}

.entity-trust-pill {
  margin-left: auto;
  color: var(--entity-success);
  border-color: rgba(84, 196, 146, 0.28);
}

.entity-textarea {
  width: 100%;
  min-height: 154px;
  padding: 15px 16px;
  border-radius: 20px;
  border: 1px solid rgba(122, 150, 186, 0.18);
  background: rgba(14, 21, 35, 0.88);
  color: var(--color-text);
  resize: vertical;
  font: 500 1.04rem/1.65 "IBM Plex Sans", "Segoe UI", sans-serif;
}

.entity-textarea--output {
  background:
    linear-gradient(180deg, rgba(5, 11, 20, 0.92), rgba(6, 12, 22, 0.96)),
    linear-gradient(90deg, rgba(111, 224, 203, 0.06), transparent);
  min-height: 180px;
}

.entity-action-primary {
  min-width: 156px;
  padding-inline: 24px;
}

.entity-feedback-slot {
  min-height: 26px;
}

.entity-inline-feedback {
  margin: 0;
  font-size: 0.98rem;
  color: var(--color-text-muted);
}

.entity-inline-feedback[data-state="success"] {
  color: var(--entity-success);
}

.entity-inline-feedback[data-state="warning"] {
  color: var(--entity-warning);
}

.entity-inline-feedback[data-state="error"] {
  color: var(--entity-error);
}

.entity-summary {
  padding: 12px;
  border: 1px solid rgba(119, 151, 197, 0.14);
  border-radius: 20px;
  background: rgba(9, 16, 28, 0.6);
  display: grid;
  gap: 10px;
}

.entity-summary__title {
  margin: 0 0 6px;
  font-size: 1.04rem;
  font-weight: 700;
}

.entity-copy {
  align-self: flex-start;
  min-width: 92px;
}

.entity-bridge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding-top: 18px;
}

.entity-bridge__line {
  width: 1px;
  height: 100%;
  min-height: 320px;
  background: linear-gradient(180deg, rgba(111, 224, 203, 0.14), rgba(153, 196, 255, 0.7), rgba(111, 224, 203, 0.14));
}

.entity-bridge__badge {
  position: absolute;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid rgba(121, 162, 220, 0.24);
  background: rgba(9, 17, 29, 0.9);
  box-shadow: 0 10px 20px rgba(2, 8, 18, 0.26);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(232, 240, 255, 0.92);
}

.entity-bridge__copy {
  position: absolute;
  bottom: 24px;
  margin: 0;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(118, 150, 199, 0.68);
}

@media (max-width: 700px) {
  .entity-workbench-page .tool-frame {
    padding-inline: 16px;
  }

  .entity-workbench-page .tool-header-block,
  .entity-workbench-page .page-title,
  .entity-workbench-page .page-subtitle {
    max-width: none;
  }

  .entity-workbench-page .tool-header-block {
    padding-top: 10px;
    padding-bottom: 10px;
    padding-inline: 0;
    text-align: left;
  }

  .entity-workbench-page .page-title {
    max-width: 9.2ch;
    margin-inline: 0;
    font-size: clamp(1.68rem, 6.2vw, 2.04rem);
    line-height: 1.03;
  }

  .entity-workbench-page .page-subtitle {
    max-width: 16ch;
    font-size: 0.9rem;
  }

  .entity-workbench__layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .entity-workbench,
  .entity-panel {
    padding: 12px;
  }

  .entity-textarea {
    min-height: 116px;
  }

  .entity-textarea--output {
    min-height: 128px;
  }

  .entity-trust-pill {
    margin-left: 0;
  }

  .entity-panel__hint {
    font-size: 0.9rem;
    max-width: 32ch;
  }

  .entity-panel--input .entity-panel__hint,
  .entity-panel--output .entity-panel__hint {
    display: none;
  }

  .entity-panel--output {
    gap: 8px;
  }

  .entity-panel--output .entity-panel__header {
    flex-direction: row;
    align-items: center;
  }

  .entity-panel--output .entity-panel__hint {
    display: none;
  }

  .entity-summary__detail {
    font-size: 0.88rem;
  }

  .entity-copy {
    font-size: 0.88rem;
    padding-inline: 12px;
  }

  .entity-feedback-slot {
    min-height: 0;
  }

  .entity-deckbar {
    display: none;
  }

  .entity-bridge {
    display: none;
  }
}

@media (max-width: 960px) {
  .entity-workbench-page .tool-header-block {
    padding-bottom: 10px;
  }

  .entity-workbench-page .page-title {
    max-width: none;
    font-size: 2.28rem;
  }

  .entity-workbench-page .page-subtitle {
    max-width: 30rem;
    font-size: 1rem;
  }

  .entity-workbench {
    padding: 8px;
  }

  .entity-deckbar {
    padding-bottom: 8px;
    margin-bottom: 8px;
  }

  .entity-deckbar__eyebrow {
    font-size: 0.68rem;
  }

  .entity-deckbar__title {
    font-size: 0.92rem;
  }

  .entity-chip,
  .entity-pill,
  .entity-summary__chip,
  .entity-trust-pill {
    padding: 6px 10px;
    font-size: 0.73rem;
  }

  .entity-panel {
    padding: 12px;
    gap: 8px;
  }

  .entity-panel__hint,
  .entity-summary__detail {
    font-size: 0.86rem;
  }

  .entity-textarea {
    min-height: 136px;
    font-size: 0.98rem;
  }

  .entity-textarea--output {
    min-height: 180px;
  }

  .entity-summary {
    padding: 10px;
  }

  .entity-summary__detail {
    display: none;
  }

  .entity-inline-feedback {
    font-size: 0.88rem;
  }

  .entity-action-primary {
    min-width: 134px;
  }
}

@media (min-width: 701px) and (max-width: 820px) {
  .entity-workbench-page .page-title {
    font-size: 2.32rem;
  }

  .entity-workbench-page .page-subtitle {
    max-width: none;
    font-size: 1rem;
  }

  .entity-workbench__layout {
    grid-template-columns: minmax(0, 1fr) 20px minmax(0, 1fr);
  }

  .entity-workbench,
  .entity-panel {
    padding: 9px;
  }

  .entity-textarea {
    min-height: 132px;
  }

  .entity-textarea--output {
    min-height: 180px;
  }

  .entity-panel__hint,
  .entity-summary__detail {
    font-size: 0.85rem;
  }

  .entity-panel {
    gap: 10px;
  }

  .entity-deckbar {
    padding-bottom: 6px;
    margin-bottom: 6px;
  }

  .entity-deckbar__title {
    font-size: 0.86rem;
  }

  .entity-chip,
  .entity-pill,
  .entity-summary__chip,
  .entity-trust-pill {
    padding: 6px 10px;
    font-size: 0.77rem;
  }

  .entity-bridge__line {
    min-height: 248px;
  }
}

@media (max-width: 560px) {
  .entity-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .entity-actions .button {
    width: 100%;
    min-width: 0;
  }

  .entity-action-primary {
    grid-column: 1 / -1;
    order: 3;
  }

  .entity-panel__header {
    flex-direction: column;
  }

  .entity-panel__meta,
  .entity-metrics,
  .entity-summary__chips {
    gap: 6px;
  }

  .entity-chip,
  .entity-pill,
  .entity-summary__chip,
  .entity-trust-pill {
    padding: 6px 10px;
    font-size: 0.77rem;
  }
}
