.native-label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin: 7px 0;
}
.native-label select {
  display: block;
  width: 100%;
  margin-top: 5px;
  font-size: 12px;
}
#history-search {
  width: 100%;
  font-size: 12px;
}
#workspace-warning,
#history-error {
  color: var(--warn);
  margin: 6px 0;
  font-size: 11px;
}
#history-error:empty,
#workspace-warning:empty {
  display: none;
}
#history-refresh {
  font-size: 11px;
  text-align: left;
}
.history-item .provider-mark {
  font-size: 10px;
  color: var(--muted);
}
#production-prompt {
  white-space: pre-wrap;
  max-height: 200px;
  overflow: auto;
}
.rail {
  min-height: 0;
}
.rail-footer {
  flex-shrink: 0;
}
#history {
  min-height: 100px;
}
.workspace-name {
  display: none;
}
#worktree-status {
  overflow-wrap: anywhere;
  margin: 4px 0;
}
/* Færdig og godkendt rodsamtale: grøn titel med flueben. Kun ud fra chatDone. */
.history-item strong.history-done {
  color: var(--ok);
}
.history-entry.is-done .history-item {
  box-shadow: inset 2px 0 0 var(--ok);
}
/* Venter på Kenneth (spørgsmål eller godkendelse, også via en worker): rød
   venstrekant, rød prik og rød statustekst. Også når chatten er åben. */
.history-entry.is-waiting .history-item {
  box-shadow: inset 3px 0 0 var(--wait);
}
.history-entry.is-waiting .history-item.selected {
  background: var(--wait-bg);
  border-color: var(--wait-line);
}
.history-meta.waiting {
  color: var(--wait);
  font-weight: 500;
}
.history-meta.waiting::before {
  content: "\25cf ";
}
/* Tilstande fra chat-state.js (Kenneth 4/11): rød = venter på dig (ovenfor),
   rav = ikke i mål, blå = klar til test, grøn = godkendt af dig, grå = stoppet. */
.history-entry.state-attention .history-item {
  box-shadow: inset 3px 0 0 var(--warn);
}
.history-entry.state-attention .history-meta.state {
  color: var(--warn);
  font-weight: 500;
}
.history-entry.state-attention .history-meta.state::before {
  content: "\25b2 ";
}
.history-entry.state-test .history-item {
  box-shadow: inset 3px 0 0 var(--info);
}
.history-entry.state-test .history-meta.state {
  color: var(--info);
  font-weight: 500;
}
.history-entry.state-test .history-meta.state::before {
  content: "\25cf ";
}
.history-entry.state-accepted .history-meta.state {
  color: var(--ok);
}
.history-entry.state-stopped .history-item strong,
.history-entry.state-stopped .history-meta.state {
  color: var(--muted);
}
/* Filteret over listen: Alle, Kræver dig, Arbejder, Godkendt. */
.history-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 2px 0 8px;
}
.history-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
}
.history-chip:hover {
  border-color: var(--green);
  color: var(--text);
}
.history-chip.is-on {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.history-chip-count {
  font-weight: 600;
}
/* "Venter på svar" står forrest på sin egen linje og lyser rødt, når en
   agent står stille og venter på Kenneth. */
.history-chip.chip-waiting {
  flex: 1 0 100%;
  justify-content: space-between;
  font-weight: 500;
}
.history-chip.chip-waiting.has-items:not(.is-on) {
  border-color: var(--wait);
  background: var(--wait-bg);
  color: var(--wait);
}
.history-chip.chip-waiting.has-items:not(.is-on) span::before {
  content: "\25cf ";
}
.history-chip.chip-waiting.has-items.is-on {
  background: var(--wait);
  border-color: var(--wait);
}
.history-chip.chip-test.is-on {
  background: var(--info);
  border-color: var(--info);
}
.history-chip.chip-attention.is-on {
  background: var(--warn);
  border-color: var(--warn);
}
/* Status under titlen står helt; model og dato afkortes. */
.history-entry .history-meta {
  display: flex;
  min-width: 0;
}
.history-status {
  flex: none;
}
.history-rest {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Titlen må fylde to linjer. */
.history-entry .history-item strong {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
/* "Slet chat" på hovedchats: diskret, tydelig ved hover og tastaturfokus. */
.history-delete,
.history-flag {
  flex: none;
  width: 22px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 11px;
  opacity: 0.35;
  border-radius: 4px;
}
.history-entry:hover .history-delete,
.history-delete:focus-visible,
.history-entry:hover .history-flag,
.history-flag:focus-visible {
  opacity: 1;
}
.history-delete:hover,
.history-flag:hover {
  background: var(--raised);
}
.history-delete:hover {
  color: var(--bad);
}
/* Flag (Kenneth 26/10): dæmpet når slået fra, accentfarve når slået til.
   Ventende chats beholder deres røde markering. Laks i den mørke variant:
   --peach giver kun 2:1 mod hvidt, --peach-ink 5:1 (ikoner kræver 3:1). */
.history-flag.is-flagged,
.flag-toggle.is-flagged,
.mobile-flag.is-flagged {
  color: var(--peach-ink);
  opacity: 1;
}
.history-section {
  margin: 8px 0 4px 16px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--muted);
}
.history-section-end {
  margin: 4px 0;
  border-top: 1px solid var(--line);
}
.history-rest {
  white-space: pre;
}
.history-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 0 14px;
}
.history-toggles .history-flat-toggle {
  margin: 0 0 6px;
}
/* "＋ Generator": de tre generatorer i én menu (generators.js). */
.gen-menu {
  position: relative;
  margin-top: 8px;
}
.gen-menu-toggle {
  width: 100%;
  padding: 7px 12px;
  font-size: 12px;
  text-align: left;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--green);
  font-weight: 500;
}
.gen-menu-toggle:hover,
.gen-menu-toggle[aria-expanded="true"] {
  background: var(--raised);
  border-color: var(--peach-line);
}
.gen-buttons.gen-menu-list {
  position: absolute;
  z-index: 30;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 6px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
}
.gen-buttons.gen-menu-list[hidden] {
  display: none;
}
/* Overskriften "SAMTALER 14" med opdatér-knappen (↻) i højre side. */
.history-heading {
  align-items: center;
}
.history-heading #history-refresh {
  padding: 0 4px;
  font-size: 14px;
  letter-spacing: 0;
}
.rail-footer {
  padding-top: 8px;
}
/* Tættere sidepanel, så flere chats er synlige (Kenneth 12/11). */
.rail-block.collapsed .rail-block-summary {
  padding: 12px 0 4px;
}
.rail .history-heading {
  padding-top: 10px;
  padding-bottom: 6px;
}
#history-search {
  margin-bottom: 6px;
}
.history-entry .history-item {
  padding-top: 3px;
  padding-bottom: 3px;
}
