:root {
  --color-ink: #0d1345;
  --color-ink-soft: #3d4172;
  --color-muted: #595959;
  --color-line: rgba(13, 19, 69, 0.14);

  --color-page: #f6fae4;
  --color-surface: #ffffff;
  --color-surface-warm: #ebf5c1;

  --color-birnchen: #dffb65;
  --color-birnchen-soft: #ebf5c1;
  --color-berry: #cfb6eb;
  --color-berry-soft: #ede3f7;
  --color-mint: #adc838;
  --color-blue: #3948c4;

  --gradient-accent-a: rgba(223, 251, 101, 0.32);
  --gradient-accent-b: rgba(207, 182, 235, 0.24);
  --surface-translucent: rgba(255, 255, 255, 0.88);
  --surface-translucent-strong: rgba(255, 255, 255, 0.84);

  --error-color: #b91c1c;
  --error-background: #fee2e2;
  --error-text: #991b1b;

  --shadow-soft: 0 22px 80px rgba(13, 19, 69, 0.10);
  --shadow-card: 0 14px 50px rgba(13, 19, 69, 0.07);
  --radius-large: 1.6rem;
  --radius-medium: 1rem;
}

:root[data-theme="dark"] {
  --color-ink: #f4f6ff;
  --color-ink-soft: #c3c8ee;
  --color-muted: #9aa3d6;
  --color-line: rgba(255, 255, 255, 0.16);

  --color-page: #080b28;
  --color-surface: #0d1345;
  --color-surface-warm: #141b44;

  --color-birnchen: #dffb65;
  --color-birnchen-soft: rgba(223, 251, 101, 0.16);
  --color-berry: #cfb6eb;
  --color-berry-soft: rgba(207, 182, 235, 0.18);
  --color-mint: #adc838;
  --color-blue: #a9affe;

  --gradient-accent-a: rgba(223, 251, 101, 0.14);
  --gradient-accent-b: rgba(169, 175, 254, 0.16);
  --surface-translucent: rgba(13, 19, 69, 0.82);
  --surface-translucent-strong: rgba(13, 19, 69, 0.78);

  --error-color: #ff8b8b;
  --error-background: rgba(255, 139, 139, 0.14);
  --error-text: #ff8b8b;

  --shadow-soft: 0 22px 80px rgba(0, 0, 0, 0.45);
  --shadow-card: 0 14px 50px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
          radial-gradient(circle at top left, var(--gradient-accent-a), transparent 34rem),
          radial-gradient(circle at top right, var(--gradient-accent-b), transparent 30rem),
          var(--color-page);
  color: var(--color-ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  transition: background-color 0.2s ease, color 0.2s ease;
}

a {
  color: var(--color-blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

:focus-visible {
  outline: 2px solid var(--color-birnchen);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -5rem;
  z-index: 20;
  border-radius: 999px;
  padding: 0.6rem 1rem;
  background: var(--color-ink);
  color: var(--color-page);
}

.skip-link:focus {
  top: 1rem;
}

.top-ribbon {
  background: var(--color-ink);
  color: var(--color-page);
}

.top-ribbon__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 0.55rem 0;
  font-size: 0.9rem;
}

.top-ribbon a {
  color: var(--color-birnchen);
  font-weight: 700;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--color-line);
  background: var(--surface-translucent);
  backdrop-filter: blur(18px);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1rem 0;
}

.site-header__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--color-ink);
  font-weight: 900;
  letter-spacing: -0.03em;
}

.site-header__brand:hover {
  text-decoration: none;
}

.site-header__brand-mark {
  color: var(--color-birnchen);
  filter: drop-shadow(0 4px 0 var(--gradient-accent-b));
}

.site-header__nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.site-header__nav a {
  color: var(--color-ink-soft);
  font-weight: 650;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--color-line);
  border-radius: 999px;
  padding: 0;
  background: var(--color-surface);
  color: var(--color-ink);
  cursor: pointer;
}

.theme-toggle__icon {
  width: 1.1rem;
  height: 1.1rem;
}

.theme-toggle__icon--moon {
  display: none;
}

:root[data-theme="dark"] .theme-toggle__icon--sun {
  display: none;
}

:root[data-theme="dark"] .theme-toggle__icon--moon {
  display: block;
}

.site-header__login {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--color-line);
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  background: var(--color-surface);
  color: var(--color-ink);
  font-weight: 700;
  box-shadow: var(--shadow-card);
}

.site-header__login:hover {
  text-decoration: none;
}

/* Groups the header actions (admin link plus login/logout) on the right side without
   adding extra items to the space-between layout of .site-header__inner. */
.site-header__actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* The logout POST form must not behave like a block element inside the header row. */
.site-header__actions form {
  display: inline-flex;
  margin: 0;
}

/* The logout submit button reuses .site-header__login; buttons only need the font and
   cursor resets to visually match the header link in both themes. */
button.site-header__login {
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.site-footer {
  border-top: 1px solid var(--color-line);
  margin-top: 5rem;
  background: var(--surface-translucent);
}

.site-footer__inner {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 1.25rem;
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.5rem 0;
  color: var(--color-muted);
}

.site-footer__inner strong {
  display: block;
  color: var(--color-ink);
}

.site-footer__nav {
  display: flex;
  gap: 1rem;
}

.container {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
}

.hero {
  padding: 5.5rem 0 4.5rem;
}

.hero__content {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  align-items: center;
  gap: 2rem;
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
}

.hero__eyebrow {
  display: inline-flex;
  width: fit-content;
  border: 1px solid var(--color-line);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  background: var(--color-surface);
  color: var(--color-muted);
  font-size: 0.9rem;
  font-weight: 750;
}

.hero h1 {
  max-width: 780px;
  margin: 1rem 0;
  font-size: clamp(3rem, 8vw, 6.5rem);
  line-height: 0.95;
  letter-spacing: -0.075em;
}

.hero p {
  max-width: 690px;
  margin: 0 0 1.5rem;
  color: var(--color-ink-soft);
  font-size: 1.18rem;
}

.hero__actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.hero__panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-large);
  padding: 1.25rem;
  background:
          linear-gradient(145deg, rgba(223, 251, 101, 0.95), rgba(207, 182, 235, 0.82)),
          var(--color-birnchen);
  box-shadow: var(--shadow-soft);
}

.hero__panel::before {
  content: "";
  position: absolute;
  width: 12rem;
  height: 12rem;
  right: -3rem;
  top: -3rem;
  border-radius: 999px;
  background: rgba(13, 19, 69, 0.12);
}

.hero__panel-card {
  position: relative;
  display: grid;
  gap: 0.7rem;
  border-radius: 1.2rem;
  padding: 1.2rem;
  background: rgba(255, 255, 255, 0.86);
  color: #0d1345;
}

.hero__panel-card strong {
  font-size: 1.3rem;
}

.hero__panel-card span {
  color: #3d4172;
}

.section {
  padding: 3rem 0 0;
}

.section__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.section__header h2,
.page-header h1 {
  margin: 0;
  letter-spacing: -0.04em;
}

.section__header h2 {
  font-size: clamp(2rem, 4vw, 3.2rem);
}

.section__header p,
.page-header p {
  margin: 0.35rem 0 0;
  color: var(--color-muted);
}

.page-header {
  padding: 3.2rem 0 1.5rem;
}

.page-header h1 {
  font-size: clamp(2.4rem, 5vw, 4.8rem);
  line-height: 1;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.entity-card {
  display: flex;
  min-height: 15rem;
  flex-direction: column;
  gap: 0.85rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-medium);
  padding: 1.25rem;
  background: var(--surface-translucent-strong);
  box-shadow: var(--shadow-card);
}

.entity-card--company {
  background:
          linear-gradient(180deg, var(--color-birnchen-soft), transparent 70%),
          var(--surface-translucent-strong);
}

.entity-card--news {
  background:
          linear-gradient(180deg, var(--color-berry-soft), transparent 70%),
          var(--surface-translucent-strong);
}

.entity-card__eyebrow {
  width: fit-content;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  background: var(--color-ink);
  color: var(--color-page);
  font-size: 0.78rem;
  font-weight: 800;
}

.entity-card h2,
.entity-card h3 {
  margin: 0;
  letter-spacing: -0.035em;
}

.entity-card p {
  margin: 0;
  color: var(--color-muted);
}

.entity-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
  color: var(--color-muted);
  font-size: 0.9rem;
}

.entity-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: auto;
  font-weight: 750;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  border: 1px solid var(--color-line);
  border-radius: 999px;
  padding: 0.6rem 1rem;
  background: var(--color-surface);
  color: var(--color-ink);
  font-weight: 750;
  text-decoration: none;
  transition: transform 0.15s ease;
}

.button:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.button--primary {
  border-color: var(--color-ink);
  background: var(--color-ink);
  color: var(--color-page);
}

.button--accent {
  border-color: var(--color-birnchen);
  background: var(--color-birnchen);
  color: #0d1345;
}

.prose {
  max-width: 840px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-large);
  padding: clamp(1.25rem, 4vw, 2rem);
  background: var(--surface-translucent-strong);
  box-shadow: var(--shadow-card);
}

.prose p {
  color: var(--color-ink-soft);
  font-size: 1.05rem;
}

.empty-state,
.error-state {
  border: 1px solid var(--color-line);
  border-radius: var(--radius-medium);
  padding: 1.25rem;
  background: var(--surface-translucent-strong);
  color: var(--color-muted);
}

.error-state {
  border-color: var(--error-color);
  background: var(--error-background);
  color: var(--error-text);
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  color: var(--color-muted);
  font-weight: 650;
}

@media (max-width: 900px) {
  .hero__content,
  .site-footer__inner {
    grid-template-columns: 1fr;
  }

  .site-header__inner,
  .section__header {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-header__nav {
    flex-wrap: wrap;
  }

  .grid {
    grid-template-columns: 1fr;
  }
}

.entity-card__avatar {
  width: 4.5rem;
  height: 4.5rem;
  border: 1px solid var(--color-line);
  border-radius: 999px;
  object-fit: cover;
  background: var(--color-surface);
}

.company-detail-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 1.5rem;
}

.company-detail-header__avatar {
  width: clamp(6rem, 14vw, 10rem);
  height: clamp(6rem, 14vw, 10rem);
  border: 1px solid var(--color-line);
  border-radius: 999px;
  object-fit: cover;
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
}

.company-branding-section {
  margin-bottom: 2rem;
}

.company-branding-section h2 {
  margin: 0 0 1rem;
}

.company-branding-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.company-branding-card {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-medium);
  padding: 1rem;
  background: var(--surface-translucent-strong);
}

.company-branding-card img {
  width: 100%;
  max-height: 7rem;
  object-fit: contain;
}

.company-branding-card figcaption {
  color: var(--color-muted);
  font-size: 0.9rem;
  font-weight: 700;
}

@media (max-width: 900px) {
  .company-detail-header {
    grid-template-columns: 1fr;
  }

  .company-branding-grid {
    grid-template-columns: 1fr;
  }
}

.entity-card__image {
  width: 100%;
  height: 11rem;
  border: 1px solid var(--color-line);
  border-radius: 0.9rem;
  object-fit: cover;
  background: var(--color-surface);
}

.news-detail-image {
  display: block;
  width: 100%;
  max-height: 32rem;
  margin-bottom: 2rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-large);
  object-fit: cover;
  box-shadow: var(--shadow-soft);
}

/* ==========================================================================
   Auth pages (login, change password): centered card with forms and
   provider buttons. Uses only the existing design tokens above.
   ========================================================================== */
button.button {
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
}

.auth-shell {
  display: flex;
  justify-content: center;
  padding: 4rem 1rem 2rem;
}

.auth-card {
  width: 100%;
  max-width: 26rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-large);
  padding: clamp(1.5rem, 4vw, 2.25rem);
  background: var(--surface-translucent-strong);
  box-shadow: var(--shadow-soft);
}

.auth-card h1 {
  margin: 0 0 0.35rem;
  font-size: 1.7rem;
  letter-spacing: -0.03em;
}

.auth-card__brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.auth-card__brand-mark {
  color: var(--color-birnchen);
  filter: drop-shadow(0 4px 0 var(--gradient-accent-b));
}

.auth-subtitle {
  margin: 0 0 1.25rem;
  color: var(--color-muted);
}

.auth-card .error-state {
  margin-bottom: 1.25rem;
  padding: 0.85rem 1rem;
}

/* Form fields: labels wrap their input (see Login/ChangePassword views). */
.auth-form {
  display: grid;
  gap: 1rem;
}

.auth-form label {
  display: grid;
  gap: 0.35rem;
  color: var(--color-ink-soft);
  font-size: 0.95rem;
  font-weight: 650;
}

.auth-form input {
  min-height: 2.6rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-medium);
  padding: 0.55rem 0.85rem;
  background: var(--color-surface);
  color: var(--color-ink);
  font: inherit;
}

.auth-form button {
  margin-top: 0.25rem;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.25rem 0;
  color: var(--color-muted);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--color-line);
}

/* External login provider buttons. */
.provider-list {
  display: grid;
  gap: 0.6rem;
}

.provider-button {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 2.75rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-medium);
  padding: 0.6rem 0.9rem;
  background: var(--color-surface);
  color: var(--color-ink);
  font-weight: 700;
}

a.provider-button:hover {
  border-color: var(--color-ink);
  text-decoration: none;
}

.provider-button--birnchen {
  border-color: var(--color-birnchen);
  background: var(--color-birnchen-soft);
}

.provider-button--disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.provider-button small {
  display: block;
  color: var(--color-muted);
  font-weight: 600;
}

.provider-icon {
  width: 1.35rem;
  height: 1.35rem;
  flex-shrink: 0;
}

/* ==========================================================================
   Alert banners rendered by _WebAlerts.cshtml (TempData messages).
   ========================================================================== */
.web-alerts {
  display: grid;
  gap: 0.75rem;
  width: min(1180px, calc(100% - 2rem));
  margin: 1.25rem auto 0;
}

.web-alert {
  position: relative;
  border: 1px solid var(--color-line);
  border-left-width: 4px;
  border-radius: var(--radius-medium);
  padding: 0.9rem 2.75rem 0.9rem 1.1rem;
  background: var(--surface-translucent-strong);
  box-shadow: var(--shadow-card);
}

.web-alert strong {
  display: block;
}

.web-alert p {
  margin: 0.25rem 0 0;
  color: var(--color-ink-soft);
}

.web-alert--info {
  border-left-color: var(--color-blue);
}

.web-alert--success {
  border-left-color: var(--color-mint);
}

.web-alert--warning {
  border-left-color: var(--color-birnchen);
  background:
          linear-gradient(180deg, var(--color-birnchen-soft), transparent 85%),
          var(--surface-translucent-strong);
}

.web-alert--error {
  border-color: var(--error-color);
  background: var(--error-background);
  color: var(--error-text);
}

.web-alert--error p {
  color: var(--error-text);
}

.web-alert__close {
  position: absolute;
  top: 0.45rem;
  right: 0.55rem;
  border: none;
  padding: 0.25rem 0.45rem;
  background: none;
  color: inherit;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}

/* ==========================================================================
   Simple status/notice pages (access denied, module disabled).
   ========================================================================== */
.status-page {
  max-width: 640px;
  margin: 0 auto;
  padding: 5rem 1rem 2rem;
  text-align: center;
}

.status-page__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4.25rem;
  height: 4.25rem;
  border: 1px solid var(--color-line);
  border-radius: 999px;
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
}

.status-page__icon svg {
  width: 2rem;
  height: 2rem;
}

.status-page__icon--danger {
  color: var(--error-color);
  background: var(--error-background);
}

.status-page__icon--warning {
  color: var(--color-ink);
  background: var(--color-birnchen-soft);
}

.status-page h1 {
  margin: 1.25rem 0 0.5rem;
  letter-spacing: -0.04em;
}

.status-page p {
  margin: 0;
  color: var(--color-muted);
}

.status-page__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* ==========================================================================
   Global attribute helpers.
   ========================================================================== */
[hidden] {
  display: none !important;
}

.cl-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Leave animation for the auto-dismissing web alerts (see site.js). */
.web-alert--leaving {
  animation: web-alert-out 0.2s ease-in forwards;
}

@keyframes web-alert-out {
  to {
    opacity: 0;
    transform: translateY(-0.35rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .web-alert--leaving {
    animation: none;
    opacity: 0;
  }
}

/* ==========================================================================
   Command library (read-only): filter form, results table, pagination,
   badges, tag chips, native dialogs, command palette and preview dialog.
   Uses only the design tokens defined at the top of this file.
   ========================================================================== */
.page-header--with-actions {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-header__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.cl-card {
  margin-bottom: 1rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-medium);
  padding: 1.25rem;
  background: var(--surface-translucent-strong);
  box-shadow: var(--shadow-card);
}

.cl-card--table {
  padding: 0.5rem 0.75rem;
  overflow-x: auto;
}

/* Filter form (GET): labels wrap their control. */
.cl-filter-form {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1rem;
}

.cl-filter-form label {
  display: grid;
  gap: 0.35rem;
  min-width: 12rem;
  flex: 1 1 12rem;
  color: var(--color-ink-soft);
  font-size: 0.95rem;
  font-weight: 650;
}

.cl-filter-form input,
.cl-filter-form select {
  min-height: 2.5rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-medium);
  padding: 0.5rem 0.8rem;
  background: var(--color-surface);
  color: var(--color-ink);
  font: inherit;
}

/* Results table. */
.cl-table {
  width: 100%;
  border-collapse: collapse;
}

.cl-table th {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--color-line);
  color: var(--color-muted);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.cl-table td {
  padding: 0.7rem 0.75rem;
  border-bottom: 1px solid var(--color-line);
  vertical-align: top;
}

.cl-table tbody tr:last-child td {
  border-bottom: 0;
}

.cl-table__muted {
  display: block;
  max-width: 28rem;
  color: var(--color-muted);
  font-size: 0.9rem;
}

.cl-table__actions {
  text-align: right;
  white-space: nowrap;
}

/* Entry list card: header with content search and save-filter action. */
.cl-table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.5rem 0.25rem 0;
  margin-bottom: 0.75rem;
}

.cl-table-search {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  flex: 1 1 24rem;
}

.cl-table-search__label {
  color: var(--color-ink-soft);
  font-size: 0.95rem;
  font-weight: 650;
}

.cl-table-search input[type="text"] {
  flex: 1 1 14rem;
  min-width: 0;
  min-height: 2.5rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-medium);
  padding: 0.5rem 0.8rem;
  background: var(--color-surface);
  color: var(--color-ink);
  font: inherit;
}

/* Column filters live in the table headers (G19d).
   Filterable headers get a small arrow button that opens a dropdown of GET links, the tags
   header opens the tag picker dialog, and active filters show a small clear icon. */
.cl-th {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.cl-th-host {
  position: relative;
}

.cl-th-menu-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.4rem;
  min-height: 1.4rem;
  border: 1px solid transparent;
  border-radius: 0.35rem;
  padding: 0;
  background: none;
  color: var(--color-muted);
  font-size: 0.75rem;
  line-height: 1;
  cursor: pointer;
}

.cl-th-menu-button:hover,
.cl-th-menu-button[aria-expanded="true"] {
  border-color: var(--color-line);
  background: var(--color-page);
  color: var(--color-ink);
}

.cl-th-menu {
  position: absolute;
  top: calc(100% - 0.4rem);
  left: 0.4rem;
  z-index: 30;
  display: grid;
  gap: 0.15rem;
  min-width: 11rem;
  max-height: 16rem;
  overflow-y: auto;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-medium);
  padding: 0.3rem;
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
}

.cl-th-menu__option {
  display: block;
  border-radius: 0.5rem;
  padding: 0.35rem 0.6rem;
  color: var(--color-ink);
  font-size: 0.9rem;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
}

.cl-th-menu__option:hover {
  background: var(--color-page);
  text-decoration: none;
}

.cl-th-menu__option--active {
  background: var(--color-birnchen-soft);
  outline: 2px solid var(--color-birnchen);
  outline-offset: -2px;
  font-weight: 750;
}

.cl-th-menu__option--active:hover {
  background: var(--color-birnchen-soft);
}

.cl-th-filter-button {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border: 0;
  padding: 0;
  background: none;
  color: var(--color-muted);
  font: inherit;
  cursor: pointer;
}

.cl-th-filter-button:hover {
  color: var(--color-ink);
}

.cl-th-menu-arrow {
  font-size: 0.75em;
  line-height: 1;
}

.cl-filter-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 999px;
  background: var(--color-ink);
  color: var(--color-page);
  font-size: 0.8rem;
  font-weight: 750;
  line-height: 1;
}

.cl-filter-clear:hover {
  text-decoration: none;
  opacity: 0.85;
}

/* Sortable column headers. */
.cl-sort-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--color-muted);
  font-weight: 800;
}

.cl-sort-link:hover {
  color: var(--color-ink);
  text-decoration: none;
}

.cl-table th[aria-sort] .cl-sort-link {
  color: var(--color-ink);
}

.cl-sort-arrow {
  font-size: 0.7em;
  line-height: 1;
}

.cl-table-empty {
  padding: 2rem 0.75rem;
  color: var(--color-muted);
  text-align: center;
}

/* Footer below the table: pagination plus page-size chooser. */
.cl-table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  margin-top: 1rem;
}

.cl-table-footer .pagination {
  flex: 1 1 24rem;
  margin: 0;
}

.cl-page-size {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--color-muted);
  font-size: 0.9rem;
}

.cl-page-size__link--active {
  border-color: var(--color-birnchen);
  background: var(--color-birnchen-soft);
  color: var(--color-ink);
  font-weight: 750;
}

/* Button variants used by the library page. */
.button--small {
  min-height: 2rem;
  padding: 0.3rem 0.75rem;
  font-size: 0.9rem;
}

.button--disabled {
  opacity: 0.45;
  pointer-events: none;
}

.button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

/* Pagination. */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1.5rem 0;
}

.pagination__info {
  color: var(--color-muted);
  font-size: 0.95rem;
}

/* Badges and tag chips. */
.cl-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--color-line);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  background: var(--color-surface);
  color: var(--color-muted);
  font-size: 0.85rem;
  font-weight: 650;
  white-space: nowrap;
}

.cl-tag-list {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.cl-tag-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--color-line);
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
  background: var(--color-berry-soft);
  color: var(--color-ink);
  font-size: 0.82rem;
  font-weight: 650;
  white-space: nowrap;
}

.risk-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--color-line);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
}

.risk-badge--harmless {
  border-color: var(--color-mint);
  background: var(--color-surface);
  color: var(--color-ink-soft);
}

.risk-badge--caution {
  border-color: var(--color-mint);
  background: var(--color-birnchen-soft);
  color: var(--color-ink);
}

.risk-badge--dangerous {
  border-color: var(--error-color);
  background: var(--error-background);
  color: var(--error-text);
}

.risk-badge--destructive {
  border-color: var(--error-color);
  background: var(--error-color);
  color: var(--color-page);
}

/* Keyboard shortcut hints. */
.cl-shortcut {
  display: inline-flex;
  gap: 0.25rem;
  margin-left: 0.5rem;
}

.cl-shortcut kbd,
.command-palette kbd {
  border: 1px solid var(--color-line);
  border-bottom-width: 2px;
  border-radius: 0.3rem;
  padding: 0 0.35rem;
  background: var(--color-surface-warm);
  color: var(--color-ink-soft);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 0.75em;
}

/* Native dialog base. */
.cl-dialog {
  width: min(34rem, calc(100% - 2rem));
  border: 1px solid var(--color-line);
  border-radius: var(--radius-large);
  padding: clamp(1.25rem, 3vw, 1.75rem);
  background: var(--color-surface);
  color: var(--color-ink);
  box-shadow: var(--shadow-soft);
}

.cl-dialog--wide {
  width: min(46rem, calc(100% - 2rem));
}

.cl-dialog::backdrop,
.command-palette::backdrop {
  background: rgba(8, 11, 40, 0.55);
}

.cl-dialog__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.cl-dialog__header h2 {
  margin: 0;
  letter-spacing: -0.03em;
}

.cl-dialog__close {
  border: 0;
  padding: 0.15rem 0.35rem;
  background: none;
  color: var(--color-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.cl-dialog__actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.25rem;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

/* Command palette (signature element). */
.command-palette {
  width: min(38rem, calc(100% - 2rem));
  margin: 8vh auto auto;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-large);
  padding: 0;
  background: var(--color-surface);
  color: var(--color-ink);
  box-shadow: var(--shadow-soft);
}

.command-palette__search {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--color-line);
}

.command-palette__search:focus-within {
  box-shadow: inset 0 -2px 0 var(--color-birnchen);
}

.command-palette__search svg {
  flex-shrink: 0;
  width: 1.1rem;
  height: 1.1rem;
  color: var(--color-muted);
}

.command-palette__search input {
  flex: 1;
  min-width: 0;
  border: 0;
  padding: 0.25rem 0;
  background: none;
  color: var(--color-ink);
  font: inherit;
  font-size: 1.05rem;
}

.command-palette__search input:focus-visible {
  outline: none;
}

.command-palette__close {
  border: 0;
  background: none;
  color: var(--color-muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.command-palette__results {
  display: grid;
  gap: 0.15rem;
  list-style: none;
  margin: 0;
  padding: 0.4rem;
  max-height: 22rem;
  overflow-y: auto;
}

.command-palette__results:empty {
  display: none;
}

.command-palette__option {
  display: grid;
  gap: 0.15rem;
  border-radius: var(--radius-medium);
  padding: 0.55rem 0.7rem;
  cursor: pointer;
}

.command-palette__option--selected {
  background: var(--color-birnchen-soft);
  outline: 2px solid var(--color-birnchen);
  outline-offset: -2px;
}

.command-palette__option-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.command-palette__option-title {
  font-weight: 700;
}

.command-palette__option-desc {
  overflow: hidden;
  color: var(--color-muted);
  font-size: 0.85rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.command-palette__status {
  margin: 0;
  padding: 0.75rem 1.1rem;
  color: var(--color-muted);
}

.command-palette__hints {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0.6rem 1.1rem;
  border-top: 1px solid var(--color-line);
  color: var(--color-muted);
  font-size: 0.8rem;
}

@media (prefers-reduced-motion: no-preference) {
  .command-palette[open] {
    animation: command-palette-in 0.15s ease-out;
  }

  @keyframes command-palette-in {
    from {
      opacity: 0;
      transform: translateY(-0.5rem);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

/* Preview / copy dialog. */
.command-preview__content {
  display: grid;
  gap: 1rem;
}

.command-preview__status {
  margin: 0;
  color: var(--color-muted);
}

.command-preview__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.command-preview__tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.command-preview__description {
  margin: 0;
  color: var(--color-ink-soft);
}

.command-preview__section-title {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.command-preview__warning {
  display: grid;
  gap: 0.6rem;
  border: 1px solid var(--color-mint);
  border-radius: var(--radius-medium);
  padding: 0.8rem 1rem;
  background: var(--color-birnchen-soft);
  color: var(--color-ink);
}

.command-preview__warning--danger {
  border-color: var(--error-color);
  background: var(--error-background);
  color: var(--error-text);
}

.command-preview__warning p {
  margin: 0;
  font-weight: 700;
}

.command-preview__warning .checkbox-label {
  color: inherit;
  font-weight: 650;
}

/* Risk confirm control: the label sits at the bottom-right of the warning box, with the
   checkbox to the right of its text and rendered at double size (explicit width/height
   instead of transform:scale so the hit area stays crisp). */
.command-preview__confirm {
  justify-self: end;
  align-self: end;
  flex-direction: row-reverse;
  text-align: right;
}

.command-preview__confirm input[type="checkbox"] {
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  margin: 0;
}

.command-preview__placeholder-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 0.6rem;
}

.command-preview__placeholder {
  display: grid;
  gap: 0.25rem;
  color: var(--color-ink-soft);
  font-size: 0.9rem;
  font-weight: 650;
}

.command-preview__placeholder input {
  border: 1px solid var(--color-line);
  border-radius: var(--radius-medium);
  padding: 0.45rem 0.6rem;
  background: var(--color-surface);
  color: var(--color-ink);
  font: inherit;
  font-size: 0.9rem;
}

.command-preview__body {
  margin: 0;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-medium);
  padding: 0.9rem 1rem;
  max-height: 16rem;
  overflow: auto;
  background: var(--color-page);
  color: var(--color-ink);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 0.9rem;
  line-height: 1.5;
}

.command-preview__actions {
  align-items: center;
}

.cl-copy-feedback {
  margin-right: auto;
  color: var(--color-ink);
  font-weight: 750;
}

@media (max-width: 900px) {
  .page-header--with-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .cl-filter-form {
    align-items: stretch;
    flex-direction: column;
  }

  .cl-filter-form label {
    min-width: 0;
  }
}

/* Danger button variant (destructive confirm actions, e.g. filter delete). */
.button--danger {
  border-color: var(--error-color);
  background: var(--error-color);
  color: var(--color-page);
}

/* Two-column page layout with local sidebar (CommandLibrary page only).
   The sidebar column is wide enough that no button label wraps to two lines. */
.cl-page {
  display: grid;
  grid-template-columns: 19rem minmax(0, 1fr);
  gap: 1.25rem;
  /* Stretch both columns to the row height so the main table card can reach the bottom
     edge of the last sidebar section ("Meine Filter"). In single-column mode the row
     height equals the content height, so nothing is stretched artificially. */
  align-items: stretch;
}

.cl-sidebar {
  display: grid;
  gap: 1rem;
  /* Keep the sidebar sections at their natural height at the top even when the column
     is taller than its content (extra space must not be distributed between sections). */
  align-content: start;
}

/* The main column fills the grid row height and its table card grows with it, so the
   card's bottom edge reaches at least the bottom of the sidebar. Footer/pagination stay
   directly under the table; the card may simply have empty space at the bottom. */
.cl-main {
  display: flex;
  flex-direction: column;
}

.cl-main > .cl-card--table {
  flex: 1 0 auto;
  margin-bottom: 0;
}

.cl-sidebar__section {
  margin-bottom: 0;
}

.cl-sidebar__title {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.cl-sidebar__items {
  display: grid;
  gap: 0.5rem;
}

.cl-sidebar__item {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  white-space: nowrap;
}

/* Saved filter list in the sidebar. */
.cl-filter-search {
  display: block;
  margin-bottom: 0.75rem;
}

.cl-filter-search input {
  width: 100%;
  min-height: 2.25rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-medium);
  padding: 0.4rem 0.7rem;
  background: var(--color-surface);
  color: var(--color-ink);
  font: inherit;
  font-size: 0.9rem;
}

.cl-filter-list {
  display: grid;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.cl-filter-link {
  display: block;
  border-radius: var(--radius-medium);
  padding: 0.4rem 0.6rem;
  color: var(--color-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cl-filter-link:hover {
  background: var(--color-surface-warm);
  text-decoration: none;
}

.cl-filter-link--active {
  background: var(--color-birnchen-soft);
  outline: 2px solid var(--color-birnchen);
  outline-offset: -2px;
  font-weight: 750;
}

.cl-filter-link--active:hover {
  background: var(--color-birnchen-soft);
}

.cl-empty-hint {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.95rem;
}

.cl-dialog-hint {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.95rem;
}

/* Saved filter manage dialog (enlarged: toolbar, prefilled create form, searchable list). */
.cl-filter-manage {
  width: min(54rem, calc(100% - 2rem));
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
}

.cl-filter-manage__toolbar {
  margin-bottom: 1rem;
}

.cl-filter-manage__subtitle {
  margin: 0;
  font-size: 1rem;
}

.cl-filter-manage__create {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-medium);
  padding: 1rem;
  background: var(--color-page);
}

.cl-filter-manage__create label {
  display: grid;
  gap: 0.35rem;
  color: var(--color-ink-soft);
  font-size: 0.95rem;
  font-weight: 650;
}

.cl-filter-manage__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 1rem;
}

.cl-filter-manage__field--full {
  grid-column: 1 / -1;
}

@media (max-width: 640px) {
  .cl-filter-manage__grid {
    grid-template-columns: 1fr;
  }
}

.cl-filter-manage input[type="text"] {
  min-height: 2.5rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-medium);
  padding: 0.5rem 0.8rem;
  background: var(--color-surface);
  color: var(--color-ink);
  font: inherit;
}

.cl-filter-manage__create select {
  min-height: 2.5rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-medium);
  padding: 0.5rem 0.8rem;
  background: var(--color-surface);
  color: var(--color-ink);
  font: inherit;
}

/* Non-label field wrapper in the create grid (caption plus tag summary control). */
.cl-filter-manage__field {
  display: grid;
  gap: 0.35rem;
  color: var(--color-ink-soft);
  font-size: 0.95rem;
  font-weight: 650;
}

/* Single-line tag summary control in the create-filter form (G19b): opens the tag picker. */
.cl-tag-summary {
  display: block;
  width: 100%;
  min-height: 2.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-medium);
  padding: 0.5rem 0.8rem;
  background: var(--color-surface);
  color: var(--color-ink);
  font: inherit;
  font-weight: 400;
  cursor: pointer;
}

.cl-tag-summary:hover {
  border-color: var(--color-muted);
}

.cl-filter-manage__list {
  display: grid;
  gap: 0.25rem;
  border-top: 1px solid var(--color-line);
  padding-top: 1rem;
}

.cl-filter-manage__entries {
  display: grid;
  gap: 0.25rem;
  max-height: 20rem;
  overflow-y: auto;
}

.cl-filter-manage__entry {
  display: grid;
  gap: 0.35rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--color-line);
}

.cl-filter-manage__entry:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.cl-filter-manage__row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cl-filter-manage__name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--color-ink);
}

.cl-filter-manage__criteria {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.85rem;
}

/* Tag picker dialogs (G19b): searchable checkbox list for the table filter and create form. */
.cl-tag-picker .cl-dialog-hint {
  margin: 0.25rem 0 0.75rem;
}

.cl-tag-picker__list {
  display: grid;
  gap: 0.15rem;
  max-height: 16rem;
  overflow-y: auto;
}

.cl-tag-picker__item {
  margin: 0;
  border-radius: 0.5rem;
  padding: 0.35rem 0.5rem;
  color: var(--color-ink);
}

.cl-tag-picker__item:hover {
  background: var(--color-page);
}

.cl-tag-picker__item input {
  flex-shrink: 0;
}

.cl-tag-picker .cl-empty-hint {
  margin: 0.75rem 0 0;
}

/* Preview view mode toggle. */
.command-preview__body-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.command-preview__body-head .command-preview__section-title {
  margin: 0;
}

.cl-view-toggle {
  display: inline-flex;
  border: 1px solid var(--color-line);
  border-radius: 999px;
  overflow: hidden;
}

.cl-view-toggle__button {
  border: 0;
  padding: 0.35rem 0.8rem;
  background: none;
  color: var(--color-muted);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 650;
  cursor: pointer;
}

.cl-view-toggle__button + .cl-view-toggle__button {
  border-left: 1px solid var(--color-line);
}

.cl-view-toggle__button:focus-visible {
  outline-offset: -2px;
}

.cl-view-toggle__button--active {
  background: var(--color-ink);
  color: var(--color-page);
}

/* Fixed (non-overridable) placeholders in the preview. */
.command-preview__placeholder--fixed input {
  background: var(--color-surface-warm);
  color: var(--color-muted);
  cursor: default;
}

.cl-ph-fixed {
  display: inline-flex;
  align-items: center;
  margin-left: 0.35rem;
  border: 1px solid var(--color-line);
  border-radius: 999px;
  padding: 0 0.4rem;
  background: var(--color-surface);
  color: var(--color-muted);
  font-size: 0.75em;
  font-weight: 650;
}

/* Secret placeholders (P4b): masked inputs and admin-only reveal toggles. */
.cl-secret-field {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.cl-secret-field input {
  flex: 1 1 auto;
  min-width: 0;
}

.command-preview__body-tools {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.cl-reveal-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--color-line);
  border-radius: 999px;
  padding: 0;
  background: var(--color-surface);
  color: var(--color-muted);
  cursor: pointer;
}

.cl-reveal-toggle:hover {
  color: var(--color-ink);
}

.cl-reveal-toggle svg {
  width: 1.1rem;
  height: 1.1rem;
}

.cl-reveal-toggle .cl-reveal-toggle__slash {
  visibility: hidden;
}

.cl-reveal-toggle--revealed .cl-reveal-toggle__slash {
  visibility: visible;
}

/* Entry log dialog (P7b): copy statistics header and paginated event table. */
.cl-log-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.75rem;
  margin: 0 0 1rem;
}

.cl-log-stats__item {
  border: 1px solid var(--color-line);
  border-radius: var(--radius-medium);
  padding: 0.6rem 0.8rem;
  background: var(--color-page);
}

.cl-log-stats__item dt {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.cl-log-stats__item dd {
  margin: 0.2rem 0 0;
  color: var(--color-ink);
  font-weight: 700;
}

.cl-log-status {
  margin: 0 0 0.75rem;
  color: var(--color-muted);
}

.cl-log-table {
  margin-bottom: 1rem;
}

.cl-log-empty {
  padding: 1rem 0.75rem;
  color: var(--color-muted);
  text-align: center;
}

.cl-log-detail-line {
  display: block;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 0.85rem;
}

.cl-log-pagination {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Version history (P9b): tab switcher, version selection table and diff rendering
   inside the entry log dialog. */
.cl-log-tabs {
  display: inline-flex;
  border: 1px solid var(--color-line);
  border-radius: 999px;
  overflow: hidden;
  margin: 0 0 1rem;
}

.cl-log-tab {
  border: 0;
  padding: 0.4rem 1rem;
  background: none;
  color: var(--color-muted);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 650;
  cursor: pointer;
}

.cl-log-tab + .cl-log-tab {
  border-left: 1px solid var(--color-line);
}

.cl-log-tab:focus-visible {
  outline-offset: -2px;
}

.cl-log-tab--active {
  background: var(--color-ink);
  color: var(--color-page);
}

.cl-version-table__choice {
  width: 3.5rem;
  text-align: center;
}

.cl-diff__heading {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.cl-diff__section-title {
  margin: 1rem 0 0.4rem;
  color: var(--color-muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.cl-diff-empty {
  margin: 0;
  color: var(--color-muted);
}

.cl-diff-fields {
  display: grid;
  gap: 0.4rem;
}

.cl-diff-field {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-medium);
  padding: 0.45rem 0.7rem;
  background: var(--color-page);
}

.cl-diff-field__label {
  flex-shrink: 0;
  font-weight: 700;
}

.cl-diff-field__note,
.cl-diff-field__arrow {
  flex-shrink: 0;
  color: var(--color-muted);
}

.cl-diff-field__value {
  flex: 1 1 10rem;
  min-width: 0;
  max-height: 5.5rem;
  overflow-y: auto;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  border-radius: var(--radius-small, 0.35rem);
  padding: 0.1rem 0.35rem;
  font-size: 0.9rem;
}

.cl-diff-field__value--old {
  background: color-mix(in srgb, var(--error-color) 14%, transparent);
}

.cl-diff-field__value--new {
  background: color-mix(in srgb, var(--color-mint) 22%, transparent);
}

.cl-diff-lines {
  max-height: 22rem;
  overflow: auto;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-medium);
  padding: 0.5rem 0;
  background: var(--color-page);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 0.85rem;
}

.cl-diff-lines .cl-diff-empty {
  padding: 0 0.75rem;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.cl-diff-line {
  display: block;
  border-left: 3px solid transparent;
  padding: 0 0.75rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.cl-diff-line--added {
  border-left-color: var(--color-mint);
  background: color-mix(in srgb, var(--color-mint) 22%, transparent);
}

.cl-diff-line--removed {
  border-left-color: var(--error-color);
  background: color-mix(in srgb, var(--error-color) 14%, transparent);
}

/* Favorites (P8b): star toggle in table rows and palette options, sidebar entry lists
   ("Favoriten" / "Zuletzt verwendet") and the palette group heading for recent entries. */
.cl-fav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.6rem;
  height: 1.6rem;
  border: 0;
  border-radius: var(--radius-small, 0.35rem);
  padding: 0;
  background: none;
  color: var(--color-muted);
  cursor: pointer;
}

.cl-fav-toggle:hover {
  color: var(--color-mint);
}

.cl-fav-toggle svg {
  width: 1.05rem;
  height: 1.05rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linejoin: round;
}

.cl-fav-toggle--active {
  color: var(--color-mint);
}

.cl-fav-toggle--active svg {
  fill: currentColor;
}

.cl-entry-name {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
}

.cl-entry-name__text {
  min-width: 0;
}

.cl-entry-list {
  display: grid;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.cl-entry-list__item {
  min-width: 0;
}

.cl-entry-link {
  display: block;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
  border: 0;
  border-radius: var(--radius-medium);
  padding: 0.4rem 0.6rem;
  background: none;
  color: var(--color-ink);
  font: inherit;
  cursor: pointer;
}

.cl-entry-link:hover {
  background: var(--color-surface-warm);
}

.command-palette__group-title {
  padding: 0.4rem 0.7rem 0.1rem;
  color: var(--color-muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

@media (max-width: 1000px) {
  .cl-page {
    grid-template-columns: 1fr;
  }
}