/* Verbindungen: the list of deck slide 11, a row opens to what it reads, and a proposal's way through five stages. */
.conn-skeleton { display: flex; flex-direction: column; gap: 14px; padding: 14px; }
.conn-skeleton .skeleton { height: 42px; border-radius: 12px; }
.conn-failed { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.conn-failed .alert { flex: 1 1 240px; }

.conn { border-bottom: 1.5px solid var(--line-soft); }
.conn:last-child { border-bottom: 0; }
.conn.lit:not(.open) { border-bottom-color: transparent; }

.item.conn-head {
  position: relative; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: start; row-gap: 10px; border-color: transparent; border-radius: var(--radius-md);
}
.item.conn-head:not(.focus) { margin-bottom: 2px; }
.conn-head:not(.focus):hover { background: var(--surface); }
.item.conn-head.focus { border-color: var(--line); }
.conn-head .body { min-width: 0; }
.conn-head .acts { min-height: 42px; gap: 12px; }
.conn-head .switch { z-index: 1; }
.conn-head .m { display: block; }
.conn-toggle { display: block; width: 100%; text-align: left; }
.conn-toggle::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius-md); }
.conn-toggle:focus-visible { outline: 0; }
.conn-toggle:focus-visible::after { outline: 2px solid var(--focus); outline-offset: -2px; }
.conn-chev { color: var(--ink-muted); transition: transform var(--duration-quick) var(--ease-out); }
.conn-head.focus .conn-chev { color: var(--on-accent); }
.conn.open .conn-chev { transform: rotate(180deg); }
.conn-head.focus .tag { border-color: var(--on-accent); background: transparent; color: var(--on-accent); }

/* off or waiting: the icon steps back, the words stay readable */
.conn[data-state="aus"] .iconbox { border-color: var(--line-soft); color: var(--ink-muted); }
.conn[data-state="wartet_it"] .iconbox, .conn[data-state="wartet_freigabe"] .iconbox, .conn[data-state="spaeter"] .iconbox { border-style: dashed; }
/* The one way out of the row stands above the row's own click. */
.conn-still { position: relative; z-index: 1; width: fit-content; max-width: 100%; }
.conn-error { grid-column: 2 / -1; line-height: 1.4; }

.conn-panel { padding: 6px 14px 22px 72px; }
.conn-first { margin-bottom: 14px; font-size: 13.5px; line-height: 1.4; }
.conn-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 28px; }
.conn-grid .label { margin-bottom: 6px; }
.conn-lines { display: flex; flex-direction: column; gap: 5px; }
.conn-lines li { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; line-height: 1.4; }
.conn-lines .i { margin-top: 2px; }
.conn-text { font-size: 13.5px; line-height: 1.4; }
.conn-open { margin-top: 8px; font-size: 13.5px; line-height: 1.5; }
.conn-after { margin-top: 12px; }
.conn-grid + .conn-after { margin-top: 18px; }
.conn-after b, .conn-outcome b { font-weight: 700; color: var(--ink); }
.conn-foot { padding: 16px 14px 0; }
.conn-foot + .conn-foot { padding-top: 4px; }

.conn-more { margin-top: 40px; padding: 0 14px; }
.conn-more-line { margin-top: 6px; }
.conn-mine { margin-top: 12px; }
.conn-anon { display: block; margin-top: 2px; }
.proposals { margin-top: 4px; }
.proposal { padding: 14px 0; border-bottom: 1px solid var(--line-soft); overflow-wrap: anywhere; }
.proposal:last-child { border-bottom: 0; }
.proposal .small { margin-top: 2px; }
.proposal .conn-outcome { margin-top: 10px; }

/* five stages: a bar per stage, inked up to where it stands, and the current one is the only name in ink */
.stages { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; margin-top: 10px; }
.stages li {
  display: flex; flex-direction: column; gap: 6px; min-width: 0; font: 500 11px/1.4 var(--font-mono); letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-muted);
}
.stages li::before { content: ""; display: block; height: 6px; border: 1.5px solid var(--line-soft); border-radius: var(--radius-pill); }
.stages li.done::before, .stages li.now::before { background: var(--surface-inverse); border-color: var(--surface-inverse); }
.stages li.now { color: var(--ink); font-weight: 700; }

[data-theme="dark"] .conn-head.focus .switch[aria-checked="true"] { background: var(--on-accent); border-color: var(--on-accent); }
[data-theme="dark"] .conn-head.focus .switch[aria-checked="true"]::after { background: var(--accent); }
.conn-head.focus .conn-toggle:focus-visible::after { outline-color: var(--on-accent); }

@media (max-width: 820px) {
  .item.conn-head { grid-template-columns: 38px minmax(0, 1fr) auto; }
  .conn-head .acts { grid-column: auto; flex-wrap: nowrap; gap: 8px; min-height: 38px; }
  /* The page's main control: a near miss on a phone switches instead of opening the row. */
  .conn-head .switch::before { content: ""; position: absolute; inset: -9px -4px; }
  .conn-panel { padding: 4px 8px 20px; }
  .conn-grid { grid-template-columns: minmax(0, 1fr); }
  .conn-foot { padding: 14px 8px 0; }
  .conn-more { padding: 0 8px; }
}
/* On a phone five names do not fit: only the current one stands under its bar, the others stay for a screen reader. */
@media (max-width: 480px) {
  .stages li:not(.now) span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .stages li.now span { white-space: nowrap; }
  .stages li.now:last-child span { align-self: flex-end; }
}
