:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --ink: #20242c;
  --muted: #667085;
  --line: #d9dee7;
  --accent: #116466;
  --accent-dark: #0b4b4d;
  --soft: #e9f3f2;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: var(--accent-dark);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.topbar {
  align-items: center;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 24px;
  min-height: 64px;
  padding: 0 28px;
}

.brand {
  color: var(--ink);
  font-size: 20px;
  font-weight: 800;
}

.topbar nav {
  display: flex;
  gap: 16px;
  margin-right: auto;
}

.topbar nav a {
  align-items: center;
  display: inline-flex;
  gap: 8px;
}

.topbar form {
  align-items: center;
  display: flex;
  gap: 10px;
}

main {
  margin: 0 auto;
  max-width: 1480px;
  padding: 28px;
}

h1, h2 {
  letter-spacing: 0;
  margin: 0;
}

h1 {
  font-size: 32px;
}

h2 {
  font-size: 20px;
  margin-bottom: 14px;
}

p {
  color: var(--muted);
  margin: 6px 0 0;
}

button, .link-button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  padding: 10px 14px;
}

.secondary {
  margin-top: 12px;
}

.small {
  min-height: 36px;
  padding: 8px 11px;
}

.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  font-weight: 700;
}

.auth-button {
  display: block;
  text-align: center;
}

.dev-login {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 18px;
}

.icon-button {
  height: 36px;
  padding: 0;
  width: 36px;
}

.login-shell {
  display: grid;
  min-height: calc(100vh - 120px);
  place-items: center;
}

.login-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  max-width: 440px;
  padding: 28px;
  width: 100%;
}

.stack {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.page-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 22px;
}

label {
  color: var(--muted);
  display: grid;
  font-size: 13px;
  font-weight: 700;
  gap: 6px;
}

input, select, textarea {
  background: white;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font: inherit;
  min-height: 42px;
  padding: 9px 11px;
  width: 100%;
}

textarea {
  line-height: 1.45;
  min-height: 160px;
  resize: vertical;
}

.filters {
  align-items: start;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(210px, auto) minmax(220px, 1.4fr) repeat(2, minmax(160px, 1fr));
  margin-bottom: 18px;
}

.projects-filters {
  column-gap: 16px;
  grid-template-columns: minmax(280px, 1.1fr) minmax(320px, 1.5fr) repeat(2, minmax(220px, 1fr));
  margin-bottom: 22px;
}

.filter-group {
  color: var(--muted);
  display: grid;
  font-size: 13px;
  font-weight: 700;
  gap: 6px;
}

.filter-group-view {
  min-width: 0;
}

.filter-field {
  min-width: 0;
}

.filter-field-search {
  min-width: 0;
}

.filter-toggle {
  align-items: center;
  align-self: start;
  color: var(--ink);
  display: flex;
  font-size: 13px;
  font-weight: 700;
  gap: 8px;
  margin-top: 4px;
  min-height: auto;
}

.filter-toggle input {
  margin: 0;
  min-height: auto;
  width: auto;
}

.segmented-control {
  background: #eef2f4;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-height: 42px;
  overflow: hidden;
  width: 100%;
}

.segmented-control.scope-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.segmented-control button {
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 12px;
  white-space: nowrap;
}

.segmented-control button.is-active {
  background: var(--panel);
  color: var(--accent-dark);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.table-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: auto;
}

table {
  border-collapse: collapse;
  min-width: 980px;
  width: 100%;
}

th, td {
  border-bottom: 1px solid var(--line);
  padding: 13px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  background: #f0f3f6;
  color: #384150;
  font-size: 12px;
  text-transform: uppercase;
}

.favorite-column {
  width: 56px;
}

.edit-column {
  width: 56px;
}

.traffic-cell {
  width: 58px;
}

.pm-column,
.pm-cell {
  width: 92px;
}

.files-column,
.files-cell {
  width: 152px;
}

.miro-column,
.miro-cell {
  width: 86px;
}

.jira-cell {
  text-align: center;
}

.sort-button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: inherit;
  display: inline-flex;
  font-size: inherit;
  font-weight: 800;
  gap: 5px;
  min-height: auto;
  padding: 0;
  text-align: left;
  text-transform: inherit;
  white-space: nowrap;
}

.sort-button::after {
  color: var(--muted);
  content: "↕";
  font-size: 11px;
}

.sort-button.is-asc::after {
  content: "↑";
}

.sort-button.is-desc::after {
  content: "↓";
}

.column-filter {
  font-size: 12px;
  font-weight: 800;
  min-height: 30px;
  min-width: 120px;
  padding: 4px 26px 4px 8px;
  text-transform: none;
}

.inline-select {
  background-color: white;
  font-size: 12px;
  font-weight: 800;
  min-height: 34px;
  min-width: 96px;
  padding: 6px 28px 6px 9px;
  transition: border-color 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
}

.manager-select {
  min-width: 88px;
  padding-right: 24px;
}

.manager-select.is-alert {
  background: #fde9e9;
  border-color: #e6a8a8;
  color: #a32020;
}

.inline-select.is-saving {
  opacity: 0.55;
}

.inline-select.is-error {
  border-color: #d83b3b;
  box-shadow: 0 0 0 2px rgb(216 59 59 / 13%);
}

.chip, .pill-link {
  background: var(--soft);
  border-radius: 999px;
  display: inline-block;
  font-size: 12px;
  margin: 0 4px 4px 0;
  padding: 4px 8px;
}

.chip-alert {
  background: #fde9e9;
  color: #a32020;
}

.meta-inline {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 800;
  margin-top: 3px;
}

.field-hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.traffic-light {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  min-width: 108px;
}

.traffic-picker {
  border-radius: 6px;
  display: inline-block;
  padding: 2px;
  position: relative;
}

.traffic-picker-compact {
  padding: 0;
}

.traffic-picker.is-saving {
  opacity: 0.55;
}

.traffic-picker.is-error {
  box-shadow: 0 0 0 2px rgb(216 59 59 / 18%);
}

.traffic-native-select {
  cursor: pointer;
  inset: 0;
  min-height: auto;
  opacity: 0;
  padding: 0;
  position: absolute;
  width: 100%;
}

.traffic-stack {
  background: #28313d;
  border: 1px solid #151b23;
  border-radius: 999px;
  box-shadow: inset 0 1px 2px rgb(255 255 255 / 12%), 0 1px 2px rgb(0 0 0 / 12%);
  display: inline-flex;
  flex: 0 0 auto;
  gap: 4px;
  padding: 4px;
}

.traffic-light-compact {
  min-width: 0;
}

.traffic-stack-vertical {
  border-radius: 16px;
  flex-direction: column;
  gap: 3px;
  padding: 5px 4px;
}

.traffic-dot {
  background: #5a6270;
  border-radius: 50%;
  box-shadow: inset 0 1px 2px rgb(0 0 0 / 28%);
  display: block;
  height: 12px;
  opacity: 0.42;
  width: 12px;
}

.traffic-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.traffic-red .traffic-dot.red {
  background: #d83b3b;
  box-shadow: 0 0 0 2px rgb(216 59 59 / 16%), 0 0 10px rgb(216 59 59 / 55%);
  opacity: 1;
}

.traffic-yellow .traffic-dot.yellow {
  background: #f3bd21;
  box-shadow: 0 0 0 2px rgb(243 189 33 / 18%), 0 0 10px rgb(243 189 33 / 58%);
  opacity: 1;
}

.traffic-green .traffic-dot.green {
  background: #28a35a;
  box-shadow: 0 0 0 2px rgb(40 163 90 / 16%), 0 0 10px rgb(40 163 90 / 52%);
  opacity: 1;
}

/* „nicht gesetzt": gelbe Lampe blinkt, um zur Pflege aufzufordern. */
@keyframes traffic-blink {
  0%, 44% { opacity: 1; }
  50%, 94% { opacity: 0.15; }
  100% { opacity: 1; }
}

.traffic-unset .traffic-dot.yellow {
  background: #f3bd21;
  box-shadow: 0 0 0 2px rgb(243 189 33 / 18%), 0 0 10px rgb(243 189 33 / 58%);
  opacity: 1;
  animation: traffic-blink 1.2s steps(1, end) infinite;
}

@media (prefers-reduced-motion: reduce) {
  .traffic-unset .traffic-dot.yellow { animation: none; }
}

/* Projekt gestoppt: Ampel ausgegraut – alle Lampen neutral grau (klar von
   „nicht gesetzt" mit blinkender gelber Lampe unterscheidbar). */
.traffic-stopped .traffic-dot {
  background: #9aa2ae;
  box-shadow: 0 0 0 2px rgb(154 162 174 / 16%);
  opacity: 0.85;
}

.traffic-stopped .traffic-label {
  color: #5a6270;
}

.traffic-red .traffic-label {
  color: #9f1d1d;
}

.traffic-yellow .traffic-label {
  color: #765200;
}

.traffic-green .traffic-label {
  color: #176235;
}

.pill-link {
  background: #eef2ff;
  color: #243b7a;
}

.files-cell .pill-link {
  display: inline-block;
  max-width: 118px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: top;
  white-space: nowrap;
}

.vkc-pill {
  max-width: 168px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: top;
  white-space: nowrap;
}

.project-title-line {
  align-items: center;
  display: flex;
  gap: 8px;
}

.favorite-cell {
  text-align: center;
  vertical-align: middle;
  width: 56px;
}

.edit-cell {
  text-align: center;
  vertical-align: middle;
  width: 56px;
}

.icon-link {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--accent-dark);
  display: inline-flex;
  font-size: 17px;
  font-weight: 800;
  height: 34px;
  justify-content: center;
  line-height: 1;
  width: 34px;
}

.favorite-toggle {
  align-items: center;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #b7bfca;
  display: inline-flex;
  flex: 0 0 36px;
  font-size: 18px;
  font-weight: 800;
  height: 36px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  width: 36px;
}

.favorite-toggle span {
  display: block;
  transform: translateY(-1px);
}

.favorite-toggle.is-favorite {
  color: #d4a017;
}

.favorite-toggle.is-error {
  border-color: #f2b8b8;
  color: #9f1d1d;
}

.icon-link:hover {
  background: var(--soft);
  text-decoration: none;
}

.jira-icon-link {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #1868db;
  display: inline-flex;
  height: 32px;
  justify-content: center;
  transition: background 120ms ease, border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
  width: 32px;
}

.jira-icon-link svg {
  display: block;
  fill: currentColor;
  height: 18px;
  width: 18px;
}

.jira-icon-link:hover {
  background: #eef5ff;
  border-color: #c6d9fb;
  box-shadow: 0 4px 10px rgb(24 104 219 / 10%);
  text-decoration: none;
  transform: translateY(-1px);
}

.vkc-icon-link {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #2ca56f;
  display: inline-flex;
  height: 32px;
  justify-content: center;
  transition: background 120ms ease, border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
  width: 32px;
}

.vkc-icon-link svg {
  display: block;
  fill: currentColor;
  height: 18px;
  width: 18px;
}

.vkc-icon-link:hover {
  background: #eef9f3;
  border-color: #b7e2cb;
  box-shadow: 0 4px 10px rgb(44 165 111 / 12%);
  text-decoration: none;
  transform: translateY(-1px);
}

.miro-cell {
  text-align: center;
}

.miro-icon-link {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #516bff;
  display: inline-flex;
  height: 32px;
  justify-content: center;
  margin: 0 4px 4px 0;
  transition: background 120ms ease, border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
  width: 32px;
}

.miro-icon-link svg {
  display: block;
  fill: currentColor;
  height: 18px;
  width: 18px;
}

.miro-icon-link:hover {
  background: #eef2ff;
  border-color: #c9d3ff;
  box-shadow: 0 4px 10px rgb(81 107 255 / 12%);
  text-decoration: none;
  transform: translateY(-1px);
}

.has-note {
  cursor: help;
}

.note-tooltip {
  background: #20242c;
  border-radius: 6px;
  box-shadow: 0 8px 22px rgb(0 0 0 / 18%);
  color: white;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  max-width: 320px;
  min-width: 180px;
  padding: 8px 10px;
  pointer-events: none;
  position: absolute;
  white-space: pre-line;
  z-index: 1000;
}

.empty {
  color: var(--muted);
  padding: 34px;
  text-align: center;
}

.form-grid {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  padding: 22px;
}

.autosave-status {
  color: var(--muted);
  font-size: 12px;
  min-height: 18px;
  text-align: right;
}

.autosave-status.is-saving {
  color: #765200;
}

.autosave-status.is-saved {
  color: #176235;
}

.autosave-status.is-error {
  color: #9f1d1d;
}

.project-meta {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.wide {
  grid-column: 1 / -1;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0;
  padding: 16px;
}

legend {
  color: #384150;
  font-weight: 800;
  padding: 0 8px;
}

.checkbox-grid {
  display: grid;
  gap: 8px 18px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.checkline {
  align-items: center;
  color: var(--ink);
  display: flex;
  flex-direction: row;
  font-weight: 500;
  gap: 8px;
}

.checkline input {
  min-height: auto;
  width: auto;
}

.project-archive-toggle {
  font-size: 14px;
  font-weight: 700;
}

.link-list {
  display: grid;
  gap: 10px;
}

.link-row {
  display: grid;
  gap: 10px;
  grid-template-columns: 180px 1fr 1fr;
}

.actions {
  align-items: center;
  display: flex;
  gap: 14px;
  justify-content: flex-end;
}

.admin-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
}

.settings-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 14px;
  max-width: 520px;
  padding: 22px;
}

.admin-grid > .notice {
  grid-column: 1 / -1;
}

.admin-grid section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.admin-actions {
  display: grid;
  gap: 12px;
}

.import-form {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.import-form input[type="file"] {
  grid-column: 1 / -1;
  min-width: 0;
  width: 100%;
}

.import-form select {
  min-width: 0;
}

.team-admin-section {
  grid-column: 1 / -1;
}

.inline-form {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(120px, 180px) 1fr auto;
  margin-bottom: 14px;
}

.list {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.list li {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding-top: 8px;
}

.list span {
  color: var(--muted);
  font-size: 12px;
  order: 2;
}

.user-list-item {
  align-items: flex-start !important;
}

.user-list-main {
  display: grid;
  gap: 4px;
}

.user-list-meta {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.user-list-meta span {
  order: 0;
}

.online-badge {
  background: #e8f5ea;
  border: 1px solid #b8dfc4;
  border-radius: 999px;
  color: #176235 !important;
  display: inline-flex;
  font-weight: 800;
  padding: 3px 8px;
}

.member-admin-list, .status-admin-list {
  display: grid;
  gap: 4px;
}

.member-admin-row, .status-admin-row {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-top: 6px;
}

.member-admin-row.is-inactive, .status-admin-row.is-inactive {
  opacity: 0.68;
}

.member-edit-form, .status-edit-form {
  align-items: center;
  display: grid;
  flex: 1;
  gap: 8px;
  grid-template-columns: minmax(100px, 0.8fr) minmax(150px, 1fr) 66px minmax(330px, auto) 340px auto;
  min-width: 1180px;
}

.status-edit-form {
  grid-template-columns: minmax(150px, 1fr) 72px 96px;
  min-width: 440px;
}

.member-edit-form input, .status-edit-form input {
  min-height: 34px;
  padding: 6px 8px;
}

.member-active {
  align-items: center;
  color: var(--ink);
  display: flex;
  font-size: 12px;
  gap: 5px;
}

.role-checkboxes {
  align-items: center;
  display: flex;
  gap: 10px;
  min-width: max-content;
}

.role-checkboxes .checkline {
  align-items: center;
  font-size: 12px;
  gap: 4px;
  white-space: nowrap;
}

.role-checkboxes input {
  margin: 0;
}

.member-meta {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.member-delete-form {
  flex: 0 0 auto;
}

.drag-handle {
  align-items: center;
  border-color: transparent;
  color: var(--muted);
  cursor: grab;
  display: inline-flex;
  flex: 0 0 auto;
  height: 34px;
  justify-content: center;
  padding: 0;
  width: 34px;
}

.drag-handle:active {
  cursor: grabbing;
}

.status-admin-row.is-dragging {
  opacity: 0.48;
}

.status-admin-row.is-drop-target {
  box-shadow: inset 0 2px 0 var(--accent);
}

.autosave-inline {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.autosave-inline.is-saving {
  color: #765200;
}

.autosave-inline.is-saved {
  color: #176235;
}

.autosave-inline.is-error {
  color: #9f1d1d;
}

.danger {
  border-color: #f2b8b8;
  color: #9f1d1d;
}

.alert {
  background: #fff0f0;
  border: 1px solid #f2b8b8;
  border-radius: 6px;
  color: #9f1d1d;
  margin-top: 18px;
  padding: 10px 12px;
}

.notice {
  border-radius: 6px;
  padding: 10px 12px;
}

.notice.success {
  background: #eef8f2;
  border: 1px solid #b8dfc4;
  color: #1f6b3b;
}

.notice.error {
  background: #fff0f0;
  border: 1px solid #f2b8b8;
  color: #9f1d1d;
}

.flash {
  border-radius: 6px;
  margin-bottom: 16px;
  padding: 10px 12px;
}

.flash.success {
  background: #eef8f2;
  border: 1px solid #b8dfc4;
  color: #1f6b3b;
}

.flash.error {
  background: #fff0f0;
  border: 1px solid #f2b8b8;
  color: #9f1d1d;
}

.muted {
  color: var(--muted);
}

.admin-tabs {
  display: flex;
  gap: 8px;
  margin: -8px 0 18px;
}

.admin-tabs a {
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  padding: 8px 11px;
}

.admin-tabs a.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.admin-panel, .release-note-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.panel, .subpanel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.subpanel {
  background: #fbfcfd;
}

.release-list {
  display: grid;
  gap: 14px;
}

.compact-form-grid {
  border: 0;
  padding: 0;
}

.rich-toolbar {
  align-items: center;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
}

.rich-toolbar button {
  min-height: 32px;
  padding: 6px 9px;
}

.rich-editor {
  background: white;
  border: 1px solid var(--line);
  border-radius: 0 0 6px 6px;
  line-height: 1.45;
  min-height: 180px;
  padding: 12px;
}

.rich-content {
  line-height: 1.5;
}

.rich-content h2, .rich-content h3,
.rich-editor h2, .rich-editor h3 {
  margin: 10px 0 8px;
}

.rich-content ul, .rich-content ol,
.rich-editor ul, .rich-editor ol {
  margin: 8px 0 8px 22px;
  padding: 0;
}

.release-note-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 6px;
}

.modal-backdrop {
  align-items: center;
  background: rgb(32 36 44 / 55%);
  inset: 0;
  display: flex;
  justify-content: center;
  padding: 24px;
  position: fixed;
  z-index: 2000;
}

.release-modal {
  background: var(--panel);
  border-radius: 8px;
  box-shadow: 0 20px 70px rgb(0 0 0 / 28%);
  max-height: min(760px, calc(100vh - 48px));
  max-width: 760px;
  overflow: auto;
  width: min(100%, 760px);
}

.release-modal-head,
.release-modal-actions {
  border-bottom: 1px solid var(--line);
  padding: 18px;
}

.release-modal-actions {
  border-bottom: 0;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
}

.release-modal-body {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.history-list {
  display: grid;
  gap: 8px;
}

.history-row {
  align-items: start;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 8px;
  grid-template-columns: 132px 72px minmax(140px, 0.8fr) minmax(260px, 2fr);
  padding: 10px 0;
}

.history-row time,
.history-row strong,
.history-row span {
  font-size: 12px;
  font-weight: 800;
}

.history-row time {
  color: var(--muted);
}

.history-row p {
  color: var(--ink);
  margin: 0;
}

.nav-badge {
  align-items: center;
  background: var(--accent);
  border-radius: 999px;
  color: white;
  display: inline-flex;
  font-size: 11px;
  font-weight: 800;
  height: 20px;
  justify-content: center;
  min-width: 20px;
  padding: 0 6px;
}

.improvements-filters {
  grid-template-columns: minmax(210px, auto) minmax(180px, 240px);
}

.improvements-page {
  display: grid;
  gap: 18px;
}

.section-head {
  align-items: start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-head p {
  margin: 4px 0 0;
}

.improvement-create-form {
  align-items: end;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(220px, 360px) minmax(0, 1fr) auto;
}

.improvement-list-panel .improvements-filters {
  margin-bottom: 0;
}

.improvement-topic-list {
  display: grid;
  gap: 10px;
}

.improvement-topic-row {
  align-items: center;
  background: #fbfcfd;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 14px 16px;
}

.improvement-topic-row:hover {
  border-color: #b7c5d6;
}

.improvement-topic-row.is-active {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.improvement-topic-main {
  display: grid;
  gap: 8px;
}

.improvement-topic-title-row,
.improvement-detail-title-row,
.improvement-topic-meta,
.comment-meta,
.improvement-actions,
.admin-subpanel-head {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.improvement-topic-title-row,
.improvement-detail-title-row {
  align-items: flex-start;
}

.comment-meta,
.improvement-topic-meta {
  margin: 0;
}

.improvement-topic-meta,
.comment-meta {
  color: var(--muted);
  font-size: 12px;
}

.improvement-topic-metrics {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.improvement-topic-row strong {
  font-size: 15px;
  line-height: 1.35;
}

.new-activity {
  color: #176235;
  font-weight: 800;
}

.status-pill {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 10px;
  white-space: nowrap;
}

.status-open {
  background: #eef4ff;
  color: #204d9b;
}

.status-review {
  background: #fff3e5;
  color: #8a4a00;
}

.status-planned {
  background: #ecf7ef;
  color: #176235;
}

.status-done {
  background: #e8f5ea;
  color: #14532d;
}

.status-rejected {
  background: #fbecec;
  color: #8b1e1e;
}

.due-pill {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 9px;
  white-space: nowrap;
}

.due-ok {
  background: #e8f5ea;
  color: #176235;
}

.due-soon {
  background: #fff3d8;
  color: #765200;
}

.due-overdue {
  background: #fde9e9;
  color: #9f1d1d;
}

.due-unset {
  background: #eef2f4;
  color: var(--muted);
}

.rich-copy {
  line-height: 1.55;
}

.inline-vote-form {
  margin: 0;
}

.improvement-actions {
  justify-content: flex-start;
}

.improvement-status-form {
  max-width: 280px;
}

.icon-vote-button {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  min-height: 36px;
  min-width: 54px;
  padding: 8px 10px;
}

.icon-vote-button span:first-child {
  font-size: 12px;
  font-weight: 800;
}

.icon-vote-button span:last-child {
  font-size: 13px;
  font-weight: 800;
}

.icon-vote-button.is-selected {
  background: var(--soft);
  border-color: var(--accent);
  color: var(--accent-dark);
}

.improvement-count-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  min-height: 36px;
  padding: 8px 12px;
}

.admin-subpanel {
  gap: 14px;
}

.admin-subpanel h3 {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.edit-toggle-row,
.edit-form-actions {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.edit-toggle-row h3 {
  margin: 0;
}

.edit-form-actions {
  justify-content: flex-start;
}

.is-hidden {
  display: none !important;
}

.improvement-modal-backdrop {
  align-items: center;
  padding: 24px;
}

.improvement-modal {
  background: var(--panel);
  border-radius: 8px;
  box-shadow: 0 20px 70px rgb(0 0 0 / 28%);
  max-height: min(860px, calc(100vh - 48px));
  max-width: 920px;
  overflow: auto;
  width: min(100%, 920px);
}

.improvement-modal-head {
  align-items: start;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 18px;
}

.improvement-modal-head p {
  margin: 6px 0 0;
}

.improvement-modal-body {
  display: grid;
  gap: 18px;
  padding: 18px;
}

.modal-close-button {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 24px;
  height: 36px;
  justify-content: center;
  line-height: 1;
  width: 36px;
}

.modal-close-button:hover {
  text-decoration: none;
}

.comment-list {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.comment-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 14px;
}

.empty-state {
  min-height: 320px;
}

@media (max-width: 900px) {
  .topbar, .page-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .filters, .form-grid, .admin-grid, .inline-form, .import-form, .link-row, .improvement-create-form, .improvement-topic-row {
    grid-template-columns: 1fr;
  }

  .history-row {
    grid-template-columns: 1fr;
  }

  .section-head {
    flex-direction: column;
  }

  .improvement-topic-metrics {
    justify-content: flex-start;
  }

  main {
    padding: 18px;
  }
}

/* Project detail page */
.project-detail-link {
  color: var(--ink);
  text-decoration: none;
}

.project-detail-link:hover strong {
  color: var(--accent);
  text-decoration: underline;
}

.detail-breadcrumb {
  margin: 0 0 4px;
  font-size: 13px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.detail-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px;
}

.detail-card h2 {
  margin: 0 0 14px;
  font-size: 16px;
}

.detail-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px 18px;
  margin: 0;
}

.detail-facts dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 4px;
}

.detail-facts dd {
  margin: 0;
}

.detail-notes {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.detail-notes h3 {
  margin: 0 0 6px;
  font-size: 14px;
}

.detail-notes p {
  margin: 0;
  white-space: pre-line;
  color: var(--ink);
}

.detail-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.traffic-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: var(--soft);
  color: var(--accent-dark);
}

.traffic-badge.traffic-green { background: #e3f4e7; color: #1b7a3b; }
.traffic-badge.traffic-yellow { background: #fdf3d8; color: #9a7207; }
.traffic-badge.traffic-red { background: #fbe4e4; color: #b02a2a; }
.traffic-badge.traffic-stopped { background: #eceef1; color: #5a6270; }

.documents-card {
  margin-bottom: 24px;
}

.documents-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.documents-head h2 {
  margin: 0;
}

.documents-count {
  background: var(--soft);
  color: var(--accent-dark);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 13px;
  font-weight: 700;
}

.document-upload {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.document-upload-row {
  display: grid;
  grid-template-columns: auto 1fr 1fr;
  gap: 12px;
}

.document-upload-actions {
  display: flex;
  justify-content: flex-end;
}

.document-table {
  width: 100%;
  border-collapse: collapse;
}

.document-table th {
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding: 6px 10px;
}

.document-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.document-table tbody tr:hover {
  background: var(--bg);
}

.doc-col-date { white-space: nowrap; width: 1%; }
.doc-col-meta { color: var(--muted); font-size: 12px; white-space: nowrap; width: 1%; }
.doc-col-type { width: 1%; }
.doc-col-actions { width: 1%; white-space: nowrap; }

.doc-cell-note {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.doc-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.doc-row-actions form { display: inline-flex; margin: 0; }

button.icon-link,
a.icon-link {
  background: #fff;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
}

.icon-link.danger { color: #b02a2a; }
button.icon-link.danger:hover { background: #fbe4e4; }

/* Overlay (Ansehen / Metadaten bearbeiten) */
.doc-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  background: rgb(32 36 44 / 55%);
  overflow-y: auto;
}

/* Das hidden-Attribut muss die display-Regel schlagen (sonst Overlay/Editor immer sichtbar). */
.doc-modal[hidden] { display: none; }

body.doc-modal-open { overflow: hidden; }

.doc-modal-dialog {
  background: var(--panel);
  border-radius: 12px;
  width: 100%;
  max-width: 560px;
  box-shadow: 0 12px 40px rgb(0 0 0 / 25%);
  display: flex;
  flex-direction: column;
}

.doc-modal-wide .doc-modal-dialog { max-width: min(1200px, 94vw); }

.doc-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.doc-modal-head h3 { margin: 0; font-size: 16px; }

.doc-modal-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.doc-modal-close {
  background: none;
  border: none;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  padding: 4px 6px;
}

.doc-modal-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.doc-modal-body .rich-content {
  max-height: 65vh;
  overflow: auto;
}

.document-badge {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 28px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: var(--accent);
  color: #fff;
}

.document-badge-docx { background: #2b579a; }
.document-badge-md { background: var(--accent); }

.document-content-form {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.document-content-form[hidden] { display: none; }

.document-content-editor {
  width: 100%;
  min-height: 200px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
}

/* WYSIWYG-Editor: volle Overlay-Breite nutzen, kein horizontaler Überlauf.
   Flex-Kinder müssen unter ihre Inhaltsbreite schrumpfen dürfen (min-width:0),
   sonst „drückt" der Editor das Overlay auf und erzeugt einen H-Scrollbalken. */
.doc-modal-body,
.document-content-form { min-width: 0; }

.tui-editor-mount {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.tui-editor-mount .toastui-editor-defaultUI {
  max-width: 100%;
}

/* Editor-Interna dürfen nicht horizontal überlaufen; langer Text bricht um. */
.toastui-editor-defaultUI { max-width: 100%; }
.toastui-editor-ww-container,
.toastui-editor-md-container { min-width: 0; }
.toastui-editor-contents { overflow-wrap: anywhere; }
.toastui-editor-contents pre,
.toastui-editor-contents code { white-space: pre-wrap; word-break: break-word; }

.document-add {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 4px 14px;
  margin-bottom: 16px;
}

.document-add summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--accent);
  padding: 8px 0;
}

.document-add[open] summary { margin-bottom: 8px; }

.document-add-actions {
  align-items: center;
  gap: 14px;
}

.document-import {
  margin-right: auto;
  color: var(--muted);
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.entry-type-tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

/* Teilen-Menü (fixed positioniertes Popover) */
.share-menu {
  position: fixed;
  z-index: 60;
  min-width: 220px;
  padding: 5px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgb(0 0 0 / 16%);
}

.share-item {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  min-height: 0;
  text-align: left;
  padding: 8px 12px;
  border: 0;
  border-radius: 6px;
  background: none;
  font: inherit;
  font-size: 13px;
  line-height: 1.3;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.share-item:hover {
  background: var(--soft);
  text-decoration: none;
}

.share-item[hidden] { display: none; }

@media (max-width: 720px) {
  .document-upload-row {
    grid-template-columns: 1fr;
  }

  .doc-col-meta { display: none; }

  .doc-modal { padding: 16px 8px; }
}

/* API tokens (admin) */
.token-reveal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.token-value,
.token-meta code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.token-value {
  background: rgb(17 100 102 / 12%);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 13px;
  word-break: break-all;
  user-select: all;
}

.token-list {
  margin-top: 12px;
}

.token-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.token-item.is-revoked {
  opacity: 0.55;
}

.token-meta {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.token-revoked-label {
  color: #b02a2a;
  font-weight: 700;
}

/* ── OpenAI-Kosten je Lizenz ─────────────────────────────────────────────── */
/* Lizenzname, der die OpenAI-Kostenansicht öffnet – als klickbar erkennbar. */
.license-cost-link {
  border: 0;
  background: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: 700;
  color: var(--accent);
  cursor: pointer;
  text-align: left;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
}
.license-cost-link:hover { text-decoration-style: solid; }

.oc-periods { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.oc-periods button.is-active { background: var(--accent); color: #fff; border-color: var(--accent); }

.oc-custom { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
/* hidden-Attribut muss die display-Regel schlagen (Datumsfeld nur bei „Frei"). */
.oc-custom[hidden] { display: none; }
.oc-custom span { color: var(--muted); }

.oc-status { min-height: 1.2em; color: var(--muted); font-size: 13px; }
.oc-error { color: #b02a2a; font-weight: 600; }

.oc-total { font-size: 44px; font-weight: 800; line-height: 1.1; margin: 2px 0; color: var(--ink); }
.oc-total #oc-total-cur { font-size: 18px; font-weight: 600; color: var(--muted); }

.oc-tokens { margin-top: 12px; min-width: 0; }
.oc-tokens summary { cursor: pointer; font-weight: 600; }
#oc-tokens-body { overflow-x: auto; }
.oc-token-table { width: 100%; min-width: 460px; border-collapse: collapse; margin-top: 8px; font-size: 13px; }
.oc-token-table th, .oc-token-table td { border-bottom: 1px solid var(--line); padding: 5px 8px; text-align: left; }
.oc-token-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.oc-token-table tfoot th { border-top: 2px solid var(--line); }

.oc-sync { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 6px 0 10px; }
.oc-sync .field-hint { margin: 0; }

/* ── Budget / Burn-down im Kosten-Panel ──────────────────────────────────── */
#oc-budget { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin-bottom: 12px; }
.oc-budget-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.oc-badge { font-size: 12px; font-weight: 800; padding: 2px 8px; border-radius: 999px; color: #fff; }
.oc-badge.oc-ok { background: var(--accent); }
.oc-badge.oc-warn { background: #c07a15; }
.oc-badge.oc-high { background: #b02a2a; }
.oc-bar { position: relative; height: 12px; border-radius: 999px; background: #eef2f4; overflow: hidden; margin: 4px 0 10px; }
.oc-bar-fill { height: 100%; border-radius: 999px; }
.oc-bar-fill.oc-ok { background: var(--accent); }
.oc-bar-fill.oc-warn { background: #c07a15; }
.oc-bar-fill.oc-high { background: #b02a2a; }
.oc-bar-mark { position: absolute; top: -2px; bottom: -2px; width: 2px; background: #98a2b3; }
.oc-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 14px; margin: 6px 0; }
.oc-kpi { display: flex; flex-direction: column; }
.oc-kpi span { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; }
.oc-kpi strong { font-size: 15px; font-variant-numeric: tabular-nums; }
.oc-burndown { width: 100%; height: auto; margin-top: 10px; }
.oc-legend { display: flex; gap: 14px; font-size: 11px; color: var(--muted); margin-top: 2px; }
.oc-legend .oc-l-actual { color: var(--accent); font-weight: 700; }
.oc-anomaly-flag { color: #b02a2a; font-weight: 700; font-size: 13px; margin-bottom: 6px; }

#oc-endprice { margin-top: 4px; font-size: 13px; }
.oc-endprice-val { font-weight: 800; color: var(--accent-dark); }

/* ── Prompt-Assistent ────────────────────────────────────────────────────── */
.pa-layout {
  align-items: start;
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

@media (max-width: 980px) {
  .pa-layout { grid-template-columns: minmax(0, 1fr); }
}

.pa-field { margin-bottom: 18px; }
.pa-field:last-child { margin-bottom: 0; }

.pa-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
}

/* Aufgaben-Umschalter: Spaltenzahl richtet sich nach der Anzahl der Aufgaben */
.pa-tasks {
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  grid-template-columns: none;
}

.pa-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pa-options {
  display: grid;
  gap: 4px 16px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.pa-option {
  align-items: center;
  display: flex;
  font-size: 13px;
  gap: 6px;
  margin: 0;
  padding: 3px 0;
}

.pa-output { position: sticky; top: 16px; }

.pa-output-head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 10px;
}

.pa-output-head h2 { font-size: 15px; margin: 0; }

.pa-output-actions { display: flex; gap: 8px; }

.pa-prompt {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  line-height: 1.55;
  margin: 0;
  max-height: 62vh;
  overflow: auto;
  padding: 14px;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Admin: verschachtelte Gruppen/Optionen */
.pa-admin-group {
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-bottom: 12px;
  padding: 12px;
}

.pa-admin-group > h4 { font-size: 14px; margin: 0 0 8px; }

.pa-admin-option {
  border-top: 1px dashed var(--line);
  padding-top: 8px;
  margin-top: 8px;
}

.pa-admin-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Globale width:100%-Regel für Formularfelder hier bewusst aufheben,
   damit die Admin-Zeilen nebeneinander statt gestapelt stehen. */
.pa-admin-row input[type="text"],
.pa-admin-row input[type="number"],
.pa-admin-row select {
  flex: 1 1 180px;
  min-width: 130px;
  width: auto;
}

.pa-admin-row input[type="number"] { flex: 0 0 80px; }
.pa-admin-row .checkline { flex: 0 0 auto; margin: 0; white-space: nowrap; }
.pa-admin-row button { flex: 0 0 auto; }
.pa-admin-row textarea { flex: 1 1 100%; min-height: 54px; width: 100%; }

.pa-template { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; min-height: 200px; width: 100%; }

/* Kennzeichnung fuer Beta-Menuepunkte (kleines rotes Badge im Navigationslink) */
.nav-beta {
  background: #9f1d1d;
  border-radius: 999px;
  color: #fff;
  display: inline-block;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1;
  margin-left: 5px;
  padding: 3px 5px;
  vertical-align: 2px;
}

/* ── Linksammlung ─────────────────────────────────────────────────────────── */
.head-actions { display: flex; gap: 10px; align-items: center; }
.link-favorites { margin: 2px 0 20px; }
.link-favorites h2 { font-size: 15px; margin-bottom: 8px; }
.link-fav-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.link-fav-pill {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
  padding: 6px 12px;
}
.link-fav-pill:hover { border-color: var(--accent); text-decoration: none; }
.link-url { color: var(--muted); font-weight: 600; word-break: break-all; }
.favorite-cell form, .link-actions form { margin: 0; }
.link-actions { white-space: nowrap; }

/* ── Admin: OpenAI-Kosten-Übersicht ──────────────────────────────────────── */
.oa-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.oa-periods { display: flex; gap: 6px; }
.oa-periods a { text-decoration: none; }
.oa-periods a.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.oa-sync { display: flex; align-items: center; gap: 10px; }
.oa-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 22px; }
.oa-kpis .oc-kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.oa-kpis .oc-kpi strong { font-size: 20px; }
.oa-up { color: #176235; }
.oa-down { color: #b02a2a; }
.oa-zero { color: var(--muted); }
.oa-table th.num, .oa-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.oa-chart { display: flex; align-items: flex-end; gap: 10px; height: 200px; padding-top: 8px; }
.oa-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; flex: 1; min-width: 34px; height: 100%; }
.oa-col-val { font-size: 11px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.oa-bar-track { display: flex; align-items: flex-end; height: 140px; width: 100%; }
.oa-bar { width: 68%; margin: 0 auto; min-height: 2px; background: var(--accent); border-radius: 5px 5px 0 0; }
.oa-col-label { font-size: 11px; color: var(--muted); white-space: nowrap; }

.oa-busy { display: flex; align-items: center; gap: 10px; background: var(--soft); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin-bottom: 16px; font-weight: 700; font-size: 13px; color: var(--accent-dark); }
.oa-busy[hidden] { display: none; }
.oa-spinner { width: 16px; height: 16px; flex: 0 0 auto; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: oa-spin 0.8s linear infinite; }
@keyframes oa-spin { to { transform: rotate(360deg); } }

/* Festes Raster: alle Kacheln gleich breit, letzte Zeile linksbündig. */
.oa-top { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.oa-top-card { display: flex; align-items: stretch; gap: 10px; min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.oa-top-rank { font-size: 22px; font-weight: 800; color: var(--accent); min-width: 24px; line-height: 1; }
.oa-top-body { min-width: 0; }
.oa-top-name { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oa-top-val { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; margin-top: 2px; }
.oa-top-cur { font-size: 13px; font-weight: 600; color: var(--muted); }
.oa-top-wow { font-size: 12px; font-weight: 700; color: var(--muted); margin-top: 2px; }

.oa-toggle { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-weight: 700; }
.oa-toggle input { width: auto; min-height: 0; margin: 0; }

.oa-activity-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.oa-activity-head h2 { margin: 0; }
.oa-activity-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #eef2f4; }
.oa-activity-toggle button { border: 0; border-radius: 0; background: transparent; font-size: 13px; font-weight: 700; padding: 7px 16px; min-height: 34px; }
.oa-activity-toggle button.is-active { background: var(--panel); color: var(--accent-dark); box-shadow: inset 0 0 0 1px var(--accent); }

/* hidden-Attribut muss die display:flex-Regel der Kachel schlagen. */
.oa-top-card[hidden] { display: none; }
.oa-more-wrap { display: flex; justify-content: flex-end; margin-top: 10px; }
.oa-more-btn { border: 0; background: transparent; color: var(--accent-dark); font-weight: 700; font-size: 13px; padding: 4px 2px; cursor: pointer; }
.oa-more-btn:hover { text-decoration: underline; }

.test-badge { display: inline-block; margin-top: 4px; background: #fdf3d8; color: #8a6d00; border-radius: 999px; padding: 2px 8px; font-size: 11px; font-weight: 800; }
.oa-nolic { color: #b02a2a; font-weight: 700; }

/* Reiter der Kundenaktivität */
.ca-tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.ca-tabs button { border: 0; background: transparent; padding: 10px 14px; font-weight: 700; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; }
.ca-tabs button:hover { color: var(--ink); }
.ca-tabs button.is-active { color: var(--ink); border-bottom-color: var(--accent); }
[data-tab][hidden] { display: none; }

.showcase-badge { background: #e6eefb; color: #1f4fb0; }
