#hot-words-tab {
  --hw-orange: #ff7043;
  --hw-red: #ff3d4f;
  --hw-amber: #ffb43a;
  --hw-soft: rgba(255, 112, 67, .12);
}

.hot-words-page-header {
  align-items: flex-end;
}

.hot-words-page-header h2 span,
.hot-words-card-heading .eyebrow {
  color: var(--hw-orange);
}

.hot-words-dashboard-status {
  display: inline-flex;
  min-width: 106px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, .035);
  font-size: .78rem;
  font-weight: 750;
  letter-spacing: .02em;
}

.hot-words-dashboard-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.hot-words-dashboard-status.active {
  color: #ff9874;
  border-color: rgba(255, 112, 67, .3);
  background: rgba(255, 112, 67, .09);
}

.hot-words-dashboard-status.active i {
  box-shadow: 0 0 0 5px rgba(255, 112, 67, .1), 0 0 14px currentColor;
  animation: hw-status-pulse 1.5s ease-out infinite;
}

.hot-words-dashboard-status.finished {
  color: var(--hw-amber);
  border-color: rgba(255, 180, 58, .26);
  background: rgba(255, 180, 58, .08);
}

.hot-words-workspace {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
  gap: .9rem;
  align-items: start;
}

.hot-words-control-card,
.hot-words-monitor-card,
.hot-words-chat-card,
.hot-words-overlay-studio {
  position: relative;
  overflow: hidden;
  border-color: rgba(255, 132, 79, .12);
}

.hot-words-control-card::before,
.hot-words-monitor-card::before,
.hot-words-chat-card::before,
.hot-words-overlay-studio::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 116, 67, .48), transparent);
  content: "";
}

.hot-words-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.hot-words-card-heading .eyebrow {
  display: block;
  margin-bottom: .35rem;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .14em;
}

.hot-words-card-heading h3 {
  margin: 0;
  color: var(--text-primary);
  font-size: 1.05rem;
}

.hot-words-form,
.hot-words-overlay-controls {
  display: grid;
  gap: 1rem;
}

.hot-words-field {
  display: grid;
  align-content: start;
  gap: .46rem;
}

.hot-words-field > span,
.hot-words-url-label,
.hot-words-test-form label > span {
  color: var(--text-primary);
  font-size: .78rem;
  font-weight: 700;
}

.hot-words-field > span small {
  margin-left: .25rem;
  color: var(--text-muted);
  font-size: .67rem;
  font-weight: 600;
}

.hot-words-field > small,
.hot-words-test-form label > small {
  color: var(--text-muted);
  font-size: .69rem;
  line-height: 1.45;
}

.hot-words-field input,
.hot-words-field textarea,
.hot-words-field select,
.hot-words-test-form input,
.hot-words-url-row input {
  width: 100%;
  border: 1px solid var(--border-default);
  border-radius: 10px;
  outline: none;
  color: var(--text-primary);
  background: rgba(4, 7, 17, .62);
  font: inherit;
  font-size: .84rem;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.hot-words-field input,
.hot-words-field select,
.hot-words-test-form input,
.hot-words-url-row input {
  min-height: 42px;
  padding: .68rem .78rem;
}

.hot-words-field textarea {
  min-height: 80px;
  padding: .72rem .78rem;
  resize: vertical;
  line-height: 1.45;
}

.hot-words-field input:focus,
.hot-words-field textarea:focus,
.hot-words-field select:focus,
.hot-words-test-form input:focus {
  border-color: rgba(255, 112, 67, .62);
  background: rgba(8, 9, 18, .82);
  box-shadow: 0 0 0 3px rgba(255, 112, 67, .09);
}

.hot-words-field select option {
  color: #fff;
  background: #0b0c15;
}

.hot-words-field select {
  height: 42px;
  align-self: start;
}

.hot-words-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: .85rem;
}

.hot-words-chat-message-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .85rem;
}

.hot-words-chat-card {
  margin-top: .9rem;
}

.hot-words-chat-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: -.15rem;
  padding: .15rem;
  border-radius: 10px;
  cursor: pointer;
  list-style: none;
}

.hot-words-chat-summary::-webkit-details-marker {
  display: none;
}

.hot-words-chat-summary > span:first-child {
  display: grid;
  gap: .32rem;
}

.hot-words-chat-summary strong {
  color: var(--text-primary);
  font-size: 1.05rem;
}

.hot-words-chat-summary-action {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  color: var(--text-muted);
  font-size: .72rem;
  font-weight: 700;
}

.hot-words-chat-summary-chevron {
  width: .65rem;
  height: .65rem;
  border-right: 2px solid #ff936d;
  border-bottom: 2px solid #ff936d;
  transform: rotate(45deg) translateY(-2px);
  transition: transform .2s ease;
}

.hot-words-chat-card[open] .hot-words-chat-summary-chevron {
  transform: rotate(225deg) translate(-2px, -2px);
}

.hot-words-chat-card[open] .hot-words-chat-summary-label {
  font-size: 0;
}

.hot-words-chat-card[open] .hot-words-chat-summary-label::after {
  font-size: .72rem;
  content: "Einstellungen ausblenden";
}

.hot-words-chat-summary:focus-visible {
  outline: 2px solid rgba(255, 132, 79, .8);
  outline-offset: 4px;
}

.hot-words-chat-card > .hot-words-chat-message-grid {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.hot-words-chat-message-card {
  display: grid;
  min-width: 0;
  gap: .8rem;
  margin: 0;
  padding: .85rem;
  border: 1px solid rgba(255, 132, 79, .14);
  border-radius: 12px;
  background: rgba(255, 112, 67, .035);
}

.hot-words-message-card-toolbar strong {
  color: #ffad8f;
  font-size: .73rem;
  font-weight: 800;
  letter-spacing: .02em;
}

.hot-words-chat-message-card .chat-message-enable-toggle input:checked + .chat-message-enable-track {
  border-color: rgba(255, 132, 79, .64);
  background: rgba(255, 112, 67, .2);
  box-shadow: 0 0 12px rgba(255, 112, 67, .14);
}

.hot-words-chat-message-card .chat-message-enable-toggle input:checked + .chat-message-enable-track::after {
  background: #ff844f;
}

.hot-words-chat-message-card textarea {
  min-height: 76px;
}

.hot-words-toggle {
  display: flex;
  min-height: 60px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .75rem .85rem;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: rgba(255, 255, 255, .025);
  cursor: pointer;
}

.hot-words-toggle > span:first-child {
  display: grid;
  gap: .2rem;
}

.hot-words-toggle strong {
  color: var(--text-primary);
  font-size: .78rem;
}

.hot-words-toggle small {
  color: var(--text-muted);
  font-size: .67rem;
  line-height: 1.35;
}

.hot-words-actions,
.hot-words-url-row,
.hot-words-test-form > div {
  display: flex;
  gap: .65rem;
}

.hot-words-actions {
  flex-wrap: wrap;
  padding-top: .1rem;
}

.hot-words-actions .btn {
  min-height: 41px;
}

.hot-words-start {
  flex: 1 1 180px;
  border-color: rgba(255, 110, 59, .42) !important;
  background: linear-gradient(135deg, #ff7a43, #f3424e) !important;
  box-shadow: 0 10px 24px rgba(238, 61, 64, .17);
}

.hot-words-actions .btn:disabled,
.hot-words-test-form .btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.hot-words-feedback {
  display: none;
  margin: -.25rem 0 0;
  padding: .62rem .72rem;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, .025);
  font-size: .72rem;
  line-height: 1.4;
}

.hot-words-feedback:not(:empty) {
  display: block;
}

.hot-words-feedback[data-tone="success"] {
  color: #7de9b1;
  border-color: rgba(81, 232, 154, .2);
  background: rgba(81, 232, 154, .06);
}

.hot-words-feedback[data-tone="error"] {
  color: #ff9a9f;
  border-color: rgba(255, 82, 92, .22);
  background: rgba(255, 82, 92, .06);
}

.hot-words-feedback[data-tone="info"] {
  color: #ffbf83;
  border-color: rgba(255, 128, 70, .2);
  background: rgba(255, 128, 70, .055);
}

.hot-words-test-form {
  display: grid;
  gap: .6rem;
  margin-top: 1.15rem;
  padding-top: 1.05rem;
  border-top: 1px solid var(--border-subtle);
}

.hot-words-test-form label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.hot-words-test-form input {
  flex: 1;
}

.hot-words-monitor-card {
  min-height: 0;
}

.hot-words-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .65rem;
  margin-bottom: 1.15rem;
}

.hot-words-metrics > div {
  display: grid;
  min-height: 70px;
  align-content: center;
  gap: .15rem;
  padding: .65rem .75rem;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  text-align: center;
  background: rgba(255, 255, 255, .025);
}

.hot-words-metrics strong {
  color: var(--text-primary);
  font-size: 1.18rem;
  font-variant-numeric: tabular-nums;
}

.hot-words-metrics span {
  color: var(--text-muted);
  font-size: .66rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: .07em;
}

.hot-words-dashboard-results {
  display: grid;
  gap: .7rem;
}

.hot-words-temperature-note {
  margin: -.45rem 0 .9rem;
  color: var(--text-muted);
  font-size: .68rem;
  line-height: 1.45;
}

.hot-words-dashboard-row {
  --hw-color: hsl(42 94% 58%);
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr) auto;
  align-items: center;
  gap: .8rem;
  padding: .7rem .8rem;
  border: 1px solid color-mix(in srgb, var(--hw-color) 22%, transparent);
  border-radius: 12px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--hw-color) 9%, transparent), rgba(255, 255, 255, .018));
}

.hot-words-dashboard-temp {
  color: var(--hw-color);
  font-size: 1rem;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 15px color-mix(in srgb, var(--hw-color) 24%, transparent);
}

.hot-words-dashboard-word {
  min-width: 0;
}

.hot-words-dashboard-word strong {
  display: block;
  overflow: hidden;
  margin-bottom: .35rem;
  color: var(--text-primary);
  font-size: .9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hot-words-dashboard-track {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, .055);
}

.hot-words-dashboard-track i {
  display: block;
  width: calc(var(--hw-temperature) * 1%);
  height: 100%;
  border-radius: inherit;
  background: var(--hw-color);
  box-shadow: 0 0 12px var(--hw-color);
  transition: width .3s ease;
}

.hot-words-dashboard-count {
  color: var(--text-muted);
  font-size: .7rem;
  white-space: nowrap;
}

.hot-words-empty-state {
  display: grid;
  min-height: 205px;
  place-items: center;
  align-content: center;
  padding: 2rem;
  text-align: center;
}

.hot-words-empty-state > span {
  margin-bottom: .75rem;
  font-size: 2.3rem;
  filter: grayscale(.35);
}

.hot-words-empty-state strong {
  margin-bottom: .35rem;
  color: var(--text-primary);
  font-size: .94rem;
}

.hot-words-empty-state p {
  max-width: 315px;
  margin: 0;
  color: var(--text-muted);
  font-size: .75rem;
  line-height: 1.55;
}

.hot-words-overlay-studio {
  margin-top: .9rem;
}

.hot-words-overlay-grid {
  display: grid;
  grid-template-columns: minmax(280px, .75fr) minmax(0, 1.25fr);
  gap: 1.2rem;
  align-items: start;
}

.hot-words-url-label {
  display: block;
  margin-top: .1rem;
  margin-bottom: -.55rem;
}

.hot-words-url-row input {
  min-width: 0;
  color: var(--text-secondary);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: .7rem;
}

.hot-words-url-row .btn {
  flex: none;
}

.hot-words-obs-hint {
  margin: .55rem 0 0;
  padding: .72rem .8rem;
  border: 1px solid rgba(255, 177, 58, .13);
  border-radius: 10px;
  color: #ffd9c4;
  background: rgba(255, 177, 58, .045);
  font-size: .72rem;
  font-weight: 700;
  line-height: 1.5;
}

.hot-words-obs-hint strong {
  color: #ffc36a;
}

.hot-words-preview-panel {
  overflow: hidden;
  border: 1px solid rgba(255, 132, 79, .14);
  border-radius: 14px;
  background: #07080d;
}

.hot-words-preview-toolbar {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .55rem .8rem;
  border-bottom: 1px solid rgba(255, 255, 255, .055);
  color: var(--text-secondary);
  font-size: .65rem;
  font-weight: 750;
  letter-spacing: .08em;
}

.hot-words-preview-toolbar span {
  display: flex;
  align-items: center;
  gap: .45rem;
}

.hot-words-preview-toolbar i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--hw-red);
  box-shadow: 0 0 9px var(--hw-red);
}

.hot-words-preview-toolbar small {
  color: var(--text-muted);
  font-size: .62rem;
}

.hot-words-preview-stage {
  position: relative;
  overflow: hidden;
  width: min(100%, 340px);
  margin-inline: auto;
  aspect-ratio: 340 / 360;
  background:
    linear-gradient(45deg, rgba(255, 255, 255, .025) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, .025) 75%),
    linear-gradient(45deg, rgba(255, 255, 255, .025) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, .025) 75%);
  background-position: 0 0, 10px 10px;
  background-size: 20px 20px;
}

.hot-words-preview-stage iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--hot-words-preview-source-width, 340px);
  height: var(--hot-words-preview-source-height, 360px);
  border: 0;
  transform: scale(var(--hot-words-preview-scale, .5));
  transform-origin: top left;
}

.hot-words-preview-hint {
  display: block;
  padding: .55rem .8rem .65rem;
  border-top: 1px solid rgba(255, 255, 255, .055);
  color: var(--text-muted);
  font-size: .68rem;
  line-height: 1.45;
}

@keyframes hw-status-pulse {
  70%, 100% { box-shadow: 0 0 0 9px rgba(255, 112, 67, 0), 0 0 14px currentColor; }
}

@media (max-width: 1100px) {
  .hot-words-workspace,
  .hot-words-overlay-grid {
    grid-template-columns: 1fr;
  }

  .hot-words-monitor-card {
    min-height: auto;
  }
}

@media (max-width: 680px) {
  .hot-words-page-header {
    align-items: flex-start;
  }

  .hot-words-field-grid,
  .hot-words-chat-message-grid,
  .hot-words-metrics {
    grid-template-columns: 1fr;
  }

  .hot-words-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hot-words-actions,
  .hot-words-url-row,
  .hot-words-test-form > div {
    flex-direction: column;
  }

  .hot-words-url-row .btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  #hot-words-tab *,
  #hot-words-tab *::before,
  #hot-words-tab *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
