.we-v2-text-workbench {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.we-v2-text-workbench .we-v2-workbench__input,
.we-v2-text-workbench .we-v2-result {
  min-width: 0;
  min-height: 580px;
  display: flex;
  flex-direction: column;
}

.we-v2-text-workbench .we-v2-result {
  background: var(--we-v2-surface-soft);
}

.we-v2-text-workbench__toolbar {
  margin-top: 22px;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  border: 1px solid var(--we-v2-line);
  border-radius: var(--we-v2-radius-md);
  background: var(--we-v2-surface-soft);
}

.we-v2-text-workbench__toolbar button {
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: var(--we-v2-radius-sm);
  background: var(--we-v2-surface);
  color: var(--we-v2-text-soft);
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  transition: border-color 150ms ease-out, background-color 150ms ease-out, color 150ms ease-out;
}

.we-v2-text-workbench__toolbar button:hover {
  border-color: var(--we-v2-primary-line);
  color: var(--we-v2-primary);
}

.we-v2-text-workbench__toolbar button[aria-pressed="true"] {
  border-color: var(--we-v2-primary);
  background: var(--we-v2-primary-soft);
  color: var(--we-v2-primary);
}

.we-v2-text-workbench__toolbar button:last-child {
  grid-column: 1 / -1;
  text-align: center;
}

.we-v2-text-editor {
  min-height: 282px;
  margin-top: 18px;
  display: flex;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--we-v2-line-strong);
  border-radius: var(--we-v2-radius-md);
  background: var(--we-v2-surface);
}

.we-v2-text-editor:focus-within {
  border-color: var(--we-v2-primary);
  box-shadow: 0 0 0 3px var(--we-v2-primary-ring);
}

.we-v2-text-editor > label {
  min-height: 42px;
  padding: 10px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--we-v2-line);
  color: var(--we-v2-text-soft);
  font-size: 12px;
  font-weight: 700;
}

.we-v2-text-editor > label span {
  color: var(--we-v2-muted);
  font-size: 11px;
  font-weight: 600;
}

.we-v2-text-editor textarea {
  width: 100%;
  min-height: 220px;
  padding: 14px;
  flex: 1;
  resize: vertical;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--we-v2-text);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.7;
  tab-size: 2;
}

.we-v2-text-editor textarea::placeholder {
  color: var(--we-v2-faint);
}

.we-v2-text-editor--output {
  margin-top: 22px;
  background: var(--we-v2-surface);
}

.we-v2-text-editor--output textarea {
  background: #fbfcfe;
}

.we-v2-text-workbench__minor-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}

.we-v2-text-workbench__minor-actions button {
  min-height: 40px;
  padding-inline: 13px;
  border: 1px solid var(--we-v2-line);
  border-radius: var(--we-v2-radius-sm);
  background: var(--we-v2-surface);
  color: var(--we-v2-text-soft);
  font-size: 12px;
  font-weight: 700;
}

.we-v2-text-workbench__minor-actions button:hover {
  border-color: var(--we-v2-primary-line);
  color: var(--we-v2-primary);
}

.we-v2-text-result-copy:disabled {
  cursor: not-allowed;
  opacity: .46;
}

.we-v2-text-result-status {
  min-height: 44px;
  margin-top: 12px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: var(--we-v2-radius-sm);
  background: var(--we-v2-surface);
  color: var(--we-v2-muted);
  font-size: 12px;
}

.we-v2-text-result-status > span:first-child {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  color: var(--we-v2-primary);
}

.we-v2-text-privacy {
  margin-top: 18px;
}

.we-v2-text-options {
  margin-top: 20px;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  border: 1px solid var(--we-v2-line);
  border-radius: var(--we-v2-radius-md);
  background: var(--we-v2-surface-soft);
}

.we-v2-text-option--check {
  min-height: 48px;
  padding: 9px 10px;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  border: 1px solid var(--we-v2-line);
  border-radius: var(--we-v2-radius-sm);
  background: var(--we-v2-surface);
  cursor: pointer;
}

.we-v2-text-option--check input {
  width: 17px;
  height: 17px;
  margin: 3px 0 0;
  accent-color: var(--we-v2-primary);
}

.we-v2-text-option--check > span {
  min-width: 0;
  display: grid;
}

.we-v2-text-option--check b {
  color: var(--we-v2-text-soft);
  font-size: 12px;
}

.we-v2-text-option--check small {
  color: var(--we-v2-muted);
  font-size: 10px;
  line-height: 1.45;
}

.we-v2-text-option .we-v2-control {
  min-height: 44px;
}

.we-v2-text-option .we-v2-control input,
.we-v2-text-option .we-v2-control select {
  height: 42px;
}

.we-v2-text-presets {
  margin-top: 12px;
}

.we-v2-text-result-actions {
  display: flex !important;
  grid-auto-flow: column;
  gap: 6px;
}

.we-v2-text-result-actions button:disabled {
  cursor: not-allowed;
  opacity: .48;
}

.we-v2-text-suite__metrics {
  margin-top: 16px;
}

.we-v2-text-suite__metrics dd {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.we-v2-text-advanced .we-v2-workbench__input,
.we-v2-text-advanced .we-v2-result {
  min-height: 620px;
}

.we-v2-advanced-stat-grid {
  margin: 20px 0 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.we-v2-advanced-stat-grid > div {
  min-height: 78px;
  padding: 13px;
  display: grid;
  align-content: space-between;
  border: 1px solid var(--we-v2-line);
  border-radius: var(--we-v2-radius-sm);
  background: var(--we-v2-surface);
}

.we-v2-advanced-stat-grid dt {
  color: var(--we-v2-muted);
  font-size: 11px;
}

.we-v2-advanced-stat-grid dd {
  margin: 3px 0 0;
  color: var(--we-v2-text);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
}

.we-v2-twitter-limits button:last-child {
  grid-column: auto;
  text-align: left;
}

.we-v2-twitter-option {
  margin-top: 10px;
}

.we-v2-twitter-score {
  margin-top: 24px;
  padding: 26px;
  border: 1px solid var(--we-v2-primary-line);
  border-radius: var(--we-v2-radius-md);
  background: var(--we-v2-surface-blue);
  text-align: center;
}

.we-v2-twitter-score p {
  margin: 0;
  color: var(--we-v2-muted);
  font-size: 12px;
  font-weight: 700;
}

.we-v2-twitter-score strong {
  display: inline-block;
  margin-top: 5px;
  color: var(--we-v2-primary);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 52px;
  line-height: 1;
  letter-spacing: -.06em;
}

.we-v2-twitter-score span {
  margin-left: 7px;
  color: var(--we-v2-muted);
  font-size: 13px;
}

.we-v2-twitter-progress {
  height: 9px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--we-v2-line);
}

.we-v2-twitter-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--we-v2-primary);
  transition: width 160ms ease-out;
}

.we-v2-twitter-progress span[data-over="true"] {
  background: var(--we-v2-danger);
}

.we-v2-twitter-stats,
.we-v2-encode-stats,
.we-v2-diff-stats,
.we-v2-email-stats {
  margin-top: 14px;
}

.we-v2-case-result,
.we-v2-encode-result,
.we-v2-diff-result,
.we-v2-template-result {
  max-height: 860px;
  overflow-y: auto;
}

.we-v2-case-grid,
.we-v2-encode-grid {
  margin-top: 18px;
  display: grid;
  gap: 9px;
}

.we-v2-case-grid article,
.we-v2-encode-grid article {
  overflow: hidden;
  border: 1px solid var(--we-v2-line);
  border-radius: var(--we-v2-radius-sm);
  background: var(--we-v2-surface);
}

.we-v2-case-grid article > header,
.we-v2-encode-grid article > header {
  min-height: 40px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--we-v2-line);
}

.we-v2-case-grid b,
.we-v2-encode-grid b {
  color: var(--we-v2-text-soft);
  font-size: 11px;
}

.we-v2-case-grid button,
.we-v2-encode-grid button {
  min-height: 30px;
  padding-inline: 9px;
  border: 1px solid var(--we-v2-line);
  border-radius: 6px;
  background: var(--we-v2-surface-soft);
  color: var(--we-v2-primary);
  font-size: 10px;
  font-weight: 700;
}

.we-v2-case-grid button:disabled,
.we-v2-encode-grid button:disabled,
.we-v2-template-result button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.we-v2-case-grid textarea,
.we-v2-encode-grid textarea {
  width: 100%;
  min-height: 60px;
  padding: 10px;
  resize: vertical;
  border: 0;
  outline: 0;
  background: #fbfcfe;
  color: var(--we-v2-text-soft);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
  line-height: 1.55;
}

.we-v2-encode-table .we-v2-record-table {
  min-width: 560px;
}

.we-v2-email-stats,
.we-v2-diff-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.we-v2-email-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.we-v2-email-results .we-v2-text-editor {
  min-height: 250px;
}

.we-v2-diff-options {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.we-v2-diff-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.we-v2-diff-inputs .we-v2-text-editor {
  min-height: 330px;
}

.we-v2-diff-table .we-v2-record-table {
  min-width: 680px;
}

.we-v2-diff-table tr[data-diff-type="mod"] td {
  background: var(--we-v2-warning-soft);
  color: var(--we-v2-warning);
}

.we-v2-diff-table tr[data-diff-type="add"] td:nth-child(n+3) {
  background: var(--we-v2-success-soft);
  color: var(--we-v2-success);
}

.we-v2-diff-table tr[data-diff-type="del"] td:nth-child(-n+2) {
  background: var(--we-v2-danger-soft);
  color: var(--we-v2-danger);
}

.we-v2-template-separator {
  margin-top: 12px;
}

.we-v2-template-variables {
  margin-top: 18px;
  padding: 12px;
  border: 1px solid var(--we-v2-line);
  border-radius: var(--we-v2-radius-sm);
  background: var(--we-v2-surface);
}

.we-v2-template-variables > b {
  color: var(--we-v2-muted);
  font-size: 11px;
}

.we-v2-template-variables > div {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.we-v2-template-variables span {
  padding: 4px 7px;
  border-radius: 6px;
  background: var(--we-v2-primary-soft);
  color: var(--we-v2-primary);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 10px;
  font-weight: 700;
}

@media (max-width: 820px) {
  .we-v2-text-workbench {
    grid-template-columns: 1fr;
  }

  .we-v2-text-workbench .we-v2-workbench__input,
  .we-v2-text-workbench .we-v2-result {
    min-height: auto;
  }

  .we-v2-text-advanced .we-v2-workbench__input,
  .we-v2-text-advanced .we-v2-result {
    min-height: auto;
  }

  .we-v2-case-result,
  .we-v2-encode-result,
  .we-v2-diff-result,
  .we-v2-template-result {
    max-height: none;
    overflow-y: visible;
  }
}

@media (max-width: 640px) {
  .we-v2-text-workbench .we-v2-workbench__input,
  .we-v2-text-workbench .we-v2-result {
    padding: 20px;
  }

  .we-v2-text-workbench__toolbar {
    margin-top: 18px;
    padding: 8px;
    gap: 6px;
  }

  .we-v2-text-workbench__toolbar button {
    min-height: 44px;
    font-size: 11px;
  }

  .we-v2-text-editor textarea {
    min-height: 200px;
  }

  .we-v2-text-options {
    grid-template-columns: 1fr;
  }

  .we-v2-text-suite__metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .we-v2-email-results,
  .we-v2-diff-inputs,
  .we-v2-diff-options {
    grid-template-columns: 1fr;
  }

  .we-v2-email-stats,
  .we-v2-diff-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .we-v2-twitter-score strong {
    font-size: 42px;
  }
}

@media (max-width: 380px) {
  .we-v2-text-workbench__toolbar {
    grid-template-columns: 1fr;
  }

  .we-v2-text-workbench__toolbar button:last-child {
    grid-column: auto;
  }
}
