.textflow-box {
  /* border: 2px solid #ccc; */
  padding: 1rem;
  margin-top: 1rem;
  background: #f3f3f3;
  /* border-radius: 4px; */
}

.textflow-inline,
.textflow-injected-control {
  margin-top: 10px;
}

.textflow-header {
  font-weight: 600;
  margin-bottom: 8px;
  /* border-bottom: 2px solid #d8e2ee; */
}

.textflow-label {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  color: #333;
}

.textflow-prompt {
  width: 100%;
  min-height: 80px;
  resize: vertical;
}

.textflow-prompt-input {
  min-height: 0;
  height: 36px;
  box-sizing: border-box;
}

.textflow-actions {
  margin-top: 10px;
  padding: 1rem;
  /* border: 1px solid #dce3ec; */
  /* border-radius: 4px; */
  background: #ffffff;
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.textflow-mode {
  min-width: 210px;
}

.textflow-tone {
  min-width: 180px;
}

.textflow-length-mode {
  min-width: 210px;
}

.textflow-length-value {
  width: 110px;
  height: 36px;
  box-sizing: border-box;
}

.textflow-actions .textflow-mode,
.textflow-actions .textflow-tone,
.textflow-actions .textflow-length-mode,
.textflow-actions .textflow-length-value {
  border: 1px solid #cfd8e3;
  border-radius: 4px;
  background: #fdfefe;
  color: #243447;
  padding: 0 10px;
}

.textflow-actions .textflow-mode,
.textflow-actions .textflow-tone,
.textflow-actions .textflow-length-mode {
  height: 36px;
  line-height: 34px;
}

.textflow-actions .textflow-generate {
  border-radius: 4px;
  white-space: nowrap;
  background: #2e385b;
  color: #ffffff;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.textflow-actions .textflow-generate-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.textflow-actions .textflow-generate-icon svg {
  display: block;
  width: 16px;
  height: 16px;
}

.textflow-actions .textflow-generate-label {
  display: inline-block;
}

.textflow-actions .textflow-generate:hover,
.textflow-actions .textflow-generate:focus {
  border-color: #084986;
  background: #084986;
  color: #ffffff;
}

.textflow-actions .textflow-generate.uk-disabled,
.textflow-actions .textflow-generate:disabled {
  border-color: #9cb8d6;
  background: #8eb1d4;
  color: #eef4fb;
}

.textflow-actions .textflow-status {
  flex: 1 1 100%;
  margin-top: 2px;
}

@media (max-width: 900px) {
  .textflow-actions {
    align-items: stretch;
  }

  .textflow-actions .textflow-mode,
  .textflow-actions .textflow-tone,
  .textflow-actions .textflow-length-mode,
  .textflow-actions .textflow-length-value,
  .textflow-actions .textflow-generate {
    flex: 1 1 100%;
    width: 100%;
  }
}

.textflow-status {
  font-size: 12px;
  color: #666;
}

.textflow-status.is-loading {
  color: #1769aa;
}

.textflow-status.is-success {
  color: #2e7d32;
}

.textflow-status.is-error {
  color: #b71c1c;
}

.textflow-meta {
  margin-top: 8px;
  font-size: 12px;
  color: #666;
}

.textflow-dashboard {
  --tf-accent: #0b5cad;
  --tf-accent-soft: #eef5ff;
  --tf-border: #d8e2ee;
  --tf-surface: #f7fafe;
}

.textflow-dash-main {
  border: 1px solid var(--tf-border);
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff 0%, var(--tf-surface) 100%);
}

.textflow-dashboard .uk-card-title {
  color: #102a43;
}

.textflow-stats-grid {
  margin-top: 2px;
}

.textflow-settings-link {
  margin: 6px 0 14px;
}

.textflow-settings-link .uk-button {
  border-color: #bfd4ee;
  background: #ffffff;
  color: #0b5cad;
  border-radius: 999px;
  font-weight: 600;
}

.textflow-settings-link .uk-button:hover {
  border-color: #0b5cad;
  background: #eef5ff;
}

.textflow-stat-card {
  min-height: 160px;
  border: 1px solid var(--tf-border);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(16, 42, 67, 0.06);
}

.textflow-stat-card h4 {
  font-size: 14px;
  color: #0b5cad;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.textflow-budget {
  margin-top: 6px;
  padding: 12px;
  border: 1px solid var(--tf-border);
  border-radius: 8px;
  background: #ffffff;
}

.textflow-budget h3 {
  margin-bottom: 6px;
  color: #102a43;
}

.textflow-dashboard .uk-progress {
  height: 10px;
  border-radius: 999px;
  background: #dbe9fb;
}

.textflow-dashboard .uk-progress::-webkit-progress-value {
  background: linear-gradient(90deg, #0b5cad 0%, #2d84da 100%);
  border-radius: 999px;
}

.textflow-dashboard .uk-progress::-moz-progress-bar {
  background: linear-gradient(90deg, #0b5cad 0%, #2d84da 100%);
  border-radius: 999px;
}

.textflow-top-table,
.textflow-recent {
  border: 1px solid var(--tf-border);
  border-radius: 10px;
  background: #ffffff;
}

.textflow-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #486581;
}

.textflow-table td {
  color: #102a43;
}

.textflow-recent-scroll {
  overflow: auto;
  border-top: 1px solid #e6edf5;
}

.textflow-recent-filters {
  margin: 8px 0 10px;
  padding: 10px;
  border: 1px solid #dce6f2;
  border-radius: 8px;
  background: #f7fbff;
}

.textflow-recent-filters-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr)) auto;
  gap: 10px;
  align-items: end;
}

.textflow-recent-filters label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: #334e68;
}

.textflow-recent-filters input,
.textflow-recent-filters select {
  height: 34px;
  border: 1px solid #cbd7e6;
  border-radius: 6px;
  background: #fff;
  padding: 0 10px;
  color: #102a43;
  box-sizing: border-box;
}

.textflow-recent-filter-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.textflow-recent-meta {
  margin-bottom: 8px;
}

.textflow-recent-pagination {
  margin-top: 10px;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.textflow-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border: 1px solid transparent;
}

.textflow-badge.is-success {
  background: #ebf7ef;
  color: #1b6f3a;
  border-color: #b9e0c5;
}

.textflow-badge.is-error {
  background: #fdf0f0;
  color: #9d1c1c;
  border-color: #f5c0c0;
}

.textflow-badge.is-other,
.textflow-badge.is-mode {
  background: var(--tf-accent-soft);
  color: #0b5cad;
  border-color: #cddff6;
}

@media (max-width: 1100px) {
  .textflow-stat-card {
    min-height: 0;
  }

  .textflow-recent-filters-grid {
    grid-template-columns: 1fr 1fr;
  }

  .textflow-recent-filter-actions {
    grid-column: 1 / -1;
  }
}
