/** ChallengeFlow: 04-controls.css */
@layer components {
  /* Buttons und Bedienelemente */
  .danger-button.small {
    padding: 4px 8px;
  }
  .small-control {
    min-height: 34px;
    padding: 6px 10px;
    font-size: 11.5px;
  }
  .icon-button.edit-action {
    color: var(--muted);
  }
  .icon-button.edit-action:hover {
    color: var(--text);
    background: var(--soft);
  }
  .icon-button span {
    filter: grayscale(1) opacity(.75);
    font-size: 14px;
  }
  .icon-button.send span {
    filter: none;
  }
  .icon-button.is-liked span {
    filter: none;
  }
  .world-icon-button {
    width: 40px;
    height: 40px;
    min-width: 40px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 0;
    display: grid;
    place-items: center;
    background: rgba(255,255,255,.94);
    color: #0a0a0a;
    box-shadow: 0 8px 24px rgba(0,0,0,.15);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    transition: transform .18s ease,background-color .18s ease,color .18s ease,box-shadow .18s ease;
  }
  .world-icon-button:hover {
    transform: translateY(-1px);
    background: #fff;
  }
  .world-icon-button:active {
    transform: scale(.96);
  }
  .world-icon-button svg {
    width: 20px;
    height: 20px;
    display: block;
    overflow: visible;
  }
  .world-icon-button circle, .world-icon-button path {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .world-icon-button.is-active {
    color: #fff;
    background: var(--accent);
    border-color: transparent;
    box-shadow: 0 10px 28px rgba(0,102,204,.35);
  }
  .feed-autocomplete input::-webkit-search-cancel-button, .feed-autocomplete input::-webkit-calendar-picker-indicator {
    display: none;
    -webkit-appearance: none;
  }
  button, input, textarea, select {
    font: inherit;
    font-family: inherit;
  }
  .primary-action, .pill-button, .ghost-button, .danger-button, .filter-chip {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    font-weight: 600;
    letter-spacing: -.01em;
    transition: background-color .18s ease,border-color .18s ease,color .18s ease,transform .18s ease,box-shadow .18s ease;
  }
  .primary-action:active, .pill-button:active, .ghost-button:active, .danger-button:active {
    transform: scale(.975);
  }
  .primary-action.small {
    min-height: 38px;
    padding: 0 16px;
    font-size: 13px;
  }
  .ghost-button.small {
    min-height: 32px;
    padding: 0 12px;
    font-size: 12px;
  }
  .badge {
    font-family: var(--font-data);
    display: inline-flex;
    border-radius: 0;
    color: var(--accent);
    padding: 5px 10px;
    background: var(--accent-soft);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .01em;
    font-variant-numeric: tabular-nums;
  }
  .badge.ghost {
    background: var(--soft);
    color: var(--muted);
  }
  .actionbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
  }
  .icon-button:active {
    transform: scale(.95);
  }
  .icon-button-symbol {
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    filter: none;
  }
  .icon-button em {
    font-style: normal;
    font-size: 12px;
    font-weight: 600;
    color: inherit;
  }
  .icon-button.send:hover {
    background: var(--accent-deep);
  }
  .icon-button.is-liked .ui-icon {
    fill: currentColor;
  }
  .icon-button.is-liked em {
    color: inherit;
  }
  .update-card>.actionbar {
    padding: 12px 2px 2px;
    gap: 6px;
    flex-wrap: wrap;
    border-top: 1px solid var(--line);
  }
  /* Aktionsbuttons behalten eine feste Breite. Dadurch verschieben sich
     Kommentar, Öffnen und Challenge-Link nicht, wenn ein Zähler wächst. */
  .update-card > .actionbar .icon-button,
  .update-detail-card > .actionbar .icon-button {
    flex: 0 0 auto;
    width: auto;
    min-width: 56px;
    justify-content: center;
    padding-inline: 10px;
  }
  .update-card > .actionbar .icon-button em,
  .update-detail-card > .actionbar .icon-button em {
    width: 3ch;
    text-align: left;
    font-variant-numeric: tabular-nums;
  }
  .logout-button {
    width: 100%;
    justify-content: center;
    display: flex;
    min-height: 44px;
  }
  .segmented-control {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px;
    border-radius: 0;
    background: var(--soft);
  }
  .segment-button {
    min-height: 36px;
    padding: 0 16px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #3a3a3a;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: -.01em;
    transition: background-color .18s ease,color .18s ease,box-shadow .18s ease,transform .18s ease;
  }
  .segment-button:hover {
    background: rgba(255,255,255,.56);
    color: var(--text);
  }
  .segment-button:active {
    transform: scale(.97);
  }
  .ghost-button, .pill-button, .primary-action, .danger-button, .segment-button, .filter-chip, .overlay-close, .timeline-toggle, .media-arrow {
    font-weight: 600;
  }
  .world-toolbar .ghost-button {
    border: 0;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    color: #0a0a0a;
    background: rgba(255,255,255,.92);
  }
  .world-toolbar .ghost-button:hover {
    background: #fff;
    color: #000;
  }
  .world-toolbar .ghost-button:focus-visible {
    box-shadow: 0 0 0 4px var(--accent-glow);
  }
  .primary-action {
    border: none;
    border-radius: 0;
    font-weight: 800;
    padding: 0 19px;
    box-shadow: none;
    font-size: 14px;
    background: var(--accent);
    color: #fff;
  }
  .primary-action:hover {
    background: var(--accent-deep);
  }
  .pill-button {
    border-radius: 0;
    font-weight: 700;
    padding: 0 16px;
    font-size: 13px;
    background: #e8ecff;
    color: var(--accent-deep);
    border: 1px solid rgba(0,38,196,.10);
  }
  .pill-button:hover {
    background: #d5ddff;
    color: var(--accent-deep);
  }
  .ghost-button {
    border-radius: 0;
    font-weight: 700;
    padding: 0 16px;
    border: 1px solid var(--line);
    font-size: 13px;
    box-shadow: 0 1px 1px rgba(0,0,0,.02);
    background: #fff;
    color: #0a0a0a;
    border-color: rgba(0,0,0,.18);
  }
  .ghost-button:hover {
    background: #0a0a0a;
    color: #000;
    border-color: rgba(0,0,0,.28);
  }
  .danger-button {
    border: none;
    border-radius: 0;
    font-weight: 700;
    min-height: 34px;
    padding: 0 13px;
    font-size: 12px;
    color: #7d0016;
    background: #fff0f1;
  }
  .danger-button:hover {
    background: #ffe1e4;
  }
  .filter-chip, .segment-button {
    color: #0a0a0a;
    background: #f4f4f4;
  }
  .filter-chip:hover, .segment-button:hover {
    color: #0a0a0a;
    background: #d3d5cc;
  }
  .segment-button.active {
    color: #fff;
    background: #0a0a0a;
    box-shadow: 0 1px 2px rgba(0,0,0,.12),0 6px 18px rgba(0,0,0,.08);
  }
  .icon-button {
    display: flex;
    align-items: center;
    font-size: 14px;
    min-width: 40px;
    min-height: 40px;
    padding: 0 12px;
    gap: 6px;
    border: 0;
    border-radius: 0;
    transition: background-color .18s ease,color .18s ease,transform .18s ease;
    color: #0a0a0a;
    background: #f4f4f4;
  }
  .icon-button:hover {
    color: #111;
    background: #d3d5cc;
  }
  .icon-button.is-liked {
    border-color: rgba(239,68,68,.4);
    border: 0;
    color: #7d0016;
    background: #ffe9eb;
  }
  .icon-button.is-leave-action {
    border: 0;
    color: #7d0016;
    background: #ffe9eb;
  }
  .icon-button.is-leave-action:hover {
    color: #7d0010;
    background: #ffd8dc;
  }
  .participation-action-button.is-pending {
    opacity: .58;
    cursor: wait;
  }
  .icon-button.send {
    flex: 0 0 auto;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
    font-size: 15px;
    width: 40px;
    height: 40px;
    min-height: 40px;
    box-shadow: none;
    color: #fff;
    background: var(--accent);
  }
  .challenge-detail-actions .icon-button {
    min-width: 48px;
    min-height: 46px;
    padding: 0 14px;
    gap: 7px;
  }
  .challenge-detail-actions .icon-button-symbol,
  .challenge-detail-actions .ui-icon {
    width: 20px;
    height: 20px;
  }
  .challenge-detail-actions .vote-control {
    min-height: 46px;
  }
  .challenge-detail-actions .vote-button {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
    font-size: 16px;
  }
  .challenge-detail-actions .vote-score {
    min-width: 42px;
    padding: 0 8px;
    font-size: 13px;
  }
  .world-toolbar .ghost-button, .world-toolbar .pill-button {
    color: #111;
    background: rgba(255,255,255,.96);
    border: 1px solid var(--line);
  }
  .world-toolbar .ghost-button:hover, .world-toolbar .pill-button:hover {
    color: #000;
    background: #fff;
  }
  .world-link-button {
    flex: 0 0 42px;
    width: 42px;
    min-width: 42px;
    padding: 0;
    display: inline-grid;
    place-items: center;
  }
  .world-link-button svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .challenge-card .actionbar {
    margin-top: auto;
    flex-wrap: wrap;
  }

  .vote-control {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    border: 1px solid var(--line-strong);
    background: var(--card);
    color: var(--text);
  }
  .vote-control.is-compact { min-height: 34px; }
  .vote-button {
    width: 36px;
    min-width: 36px;
    min-height: 36px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 14px;
    line-height: 1;
  }
  .vote-control.is-compact .vote-button { width: 32px; min-width: 32px; min-height: 32px; }
  .vote-control.is-pending { opacity: .66; }
  .vote-button:hover, .vote-button:focus-visible { background: var(--soft); color: var(--text); outline: none; }
  .vote-button.vote-up.is-active { background: var(--vote-up); color: #fff; }
  .vote-button.vote-down.is-active { background: var(--vote-down); color: #fff; }
  .vote-score {
    min-width: 36px;
    padding: 0 7px;
    text-align: center;
    font-family: var(--font-data);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
  }
  /* Gesamtwertung: ein Zeichen fuer die Richtung, eine Zahl fuer die
     Menge. Die Farbe wird aus Stimmungslage und Stimmenzahl berechnet und
     als Variable mitgegeben; hier steht nur, wie hell sie sein darf. */
  .ranking-badge {
    --rank-hue: 0;
    --rank-sat: 0%;
    --rank-light: 34%;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    border: 0;
    background: transparent;
    color: var(--text);
    padding: 2px 0;
    font-family: var(--font-data);
    font-size: 12px;
    font-weight: 700;
  }
  .ranking-badge-mark {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
    fill: hsl(var(--rank-hue) var(--rank-sat) var(--rank-light));
    color: hsl(var(--rank-hue) var(--rank-sat) var(--rank-light));
  }
  .ranking-badge b {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
  }
  .ranking-badge.is-compact { padding: 0; font-size: 11px; }
  .ranking-badge.is-compact .ranking-badge-mark { width: 13px; height: 13px; }
}
