:root {
  --bg: #0f1b2d;
  --bg-soft: #13243a;
  --panel: #16273f;
  --panel-2: #1a2e49;
  --line: #35506e;
  --line-soft: #3f5f81;
  --text: #ecf3fb;
  --muted: #9fb3cb;

  --status-idee: #87909e;
  --status-entwurf: #3e63dd;
  --status-review: #f76808;
  --status-bereit: #ffd43b;
  --status-abgelehnt: #0d1117;
  --status-veroeffentlicht: #1ea46d;

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: radial-gradient(1400px 700px at 20% -10%, #1d3250 0%, transparent 55%), linear-gradient(180deg, #0e1a2b 0%, #122238 100%);
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--text);
}

.hidden { display: none !important; }
.small {
  font-size: 11px;
  color: var(--muted);
}

input, select, textarea, button {
  font: inherit;
  color: inherit;
}

input, select, textarea {
  width: 100%;
  background: #13253d;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 9px 10px;
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: #7ea9dd;
  box-shadow: 0 0 0 2px rgba(126, 169, 221, 0.16);
}

button {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #1a2f4c;
  cursor: pointer;
}

.glass {
  background: color-mix(in srgb, #14263e 90%, transparent);
  backdrop-filter: blur(10px);
}

.boot-splash {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  gap: 10px;
  background: radial-gradient(900px 460px at 50% -15%, rgba(73, 123, 212, 0.35), transparent 60%), #0f1b2d;
  transition: opacity 0.36s ease;
}
.boot-splash.hidden {
  opacity: 0;
  pointer-events: none;
}
.boot-logo {
  font-weight: 700;
  letter-spacing: 0.08em;
}
.boot-spinner {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: #8bb4f0;
  animation: spin 0.8s linear infinite;
}
.boot-text {
  font-size: 12px;
  color: var(--muted);
}
@keyframes spin { to { transform: rotate(360deg); } }

.app {
  max-width: 1780px;
  margin: 0 auto;
  padding: 10px 10px 96px;
}

.topbar {
  position: sticky;
  top: 8px;
  z-index: 40;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 10px;
  margin-bottom: 10px;
}

.top-controls {
  display: grid;
  grid-template-columns: minmax(170px, 230px) minmax(240px, 1fr) minmax(150px, 210px) minmax(145px, 190px) auto;
  gap: 8px;
  align-items: center;
}

.view-mode-select {
  height: 38px;
  border-radius: 12px;
  background: #1a2f4c;
}

.legacy-toggle {
  display: none !important;
}

.top-toggle {
  height: 38px;
  min-width: 74px;
  padding: 0 12px;
  border-radius: 12px;
  background: #1a2f4c;
  color: #d9e6f6;
}
.top-toggle[aria-pressed="true"] {
  background: #294569;
  border-color: #5d81ad;
}
.top-toggle.hidden { display: none; }

.top-meta {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 12px;
  align-items: start;
}

.app.queue-collapsed .workspace {
  grid-template-columns: minmax(0, 1fr) 0;
}
.app.queue-collapsed .queue-panel {
  opacity: 0;
  pointer-events: none;
  transform: translateX(12px);
}

.feed {
  min-height: 300px;
}
.feed.list-view.masonry {
  column-width: 390px;
  column-gap: 12px;
}
.feed.list-view.masonry .entry {
  display: inline-block;
  width: 100%;
  margin: 0 0 12px;
  break-inside: avoid;
}
.feed.list-view.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 12px;
}
.feed.list-view.list {
  display: grid;
  grid-template-columns: minmax(0, 860px);
  justify-content: center;
  gap: 12px;
}

.feed.kanban-view {
  overflow-x: auto;
}
.kanban-board {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  min-height: 40vh;
}
.kanban-col {
  min-width: min(92vw, 420px);
  background: #14263f;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 8px;
}
.kanban-col-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.kanban-col-cards {
  display: grid;
  gap: 10px;
}

.feed.channel-view {
  display: grid;
  gap: 12px;
}
.channel-group {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #13263f;
  padding: 8px;
}
.channel-group-drop {
  border: 0;
}
.channel-group-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  list-style: none;
}
.channel-group-head::-webkit-details-marker { display: none; }
.channel-group-cards {
  margin-top: 8px;
  display: grid;
  gap: 10px;
}

.empty {
  border: 1px dashed var(--line-soft);
  border-radius: 14px;
  padding: 20px;
  text-align: center;
  color: var(--muted);
}

.queue-panel {
  position: sticky;
  top: 78px;
  max-height: calc(100dvh - 92px);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #13243b;
  overflow: hidden;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.queue-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-bottom: 1px solid var(--line);
}
.queue-body {
  padding: 8px;
  max-height: calc(100dvh - 140px);
  overflow: auto;
  display: grid;
  gap: 8px;
}

.queue-section {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  overflow: hidden;
}
.queue-section > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 9px;
  background: #182e4a;
  font-size: 12px;
}
.queue-section.ready > summary { background: color-mix(in srgb, #29b172 25%, #182e4a); }
.queue-section.scheduled > summary { background: color-mix(in srgb, #4f88ff 22%, #182e4a); }
.queue-section.plannable > summary { background: color-mix(in srgb, #f2b63d 22%, #182e4a); }
.queue-section.published > summary { background: color-mix(in srgb, #909bac 20%, #182e4a); }
.queue-section > summary::-webkit-details-marker { display: none; }
.queue-summary-left {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.queue-caret {
  display: inline-block;
  transition: transform 0.14s ease;
}
.queue-section[open] .queue-caret {
  transform: rotate(90deg);
}
.queue-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
}
.queue-dot.ready { background: #29b172; }
.queue-dot.scheduled { background: #4f88ff; }
.queue-dot.plannable { background: #f2b63d; }
.queue-dot.published { background: #909bac; }
.queue-list {
  padding: 8px;
  display: grid;
  gap: 8px;
}
.queue-empty {
  background: #152942;
}
.queue-empty-row {
  padding: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}

.queue-mini-card {
  background: #0f1f34;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 7px;
  display: grid;
  gap: 5px;
  cursor: pointer;
}
.queue-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.queue-head-right {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.queue-move {
  min-width: 26px;
  padding: 4px 6px;
  font-size: 11px;
  border-radius: 8px;
}
.queue-mini-card.dragging {
  opacity: 0.45;
}
.queue-drop-target.drag-over {
  outline: 2px dashed #7fa8dd;
  outline-offset: -2px;
  background: rgba(127, 168, 221, 0.08);
  border-radius: 10px;
}
.queue-item-title {
  font-size: 12px;
  font-weight: 620;
  line-height: 1.3;
}
.queue-item-caption {
  font-size: 11px;
  color: #c7d6e8;
  line-height: 1.35;
}
.queue-item-time {
  font-size: 10px;
  color: #9fb2c9;
}
.queue-timer {
  white-space: pre;
  font-size: 10px;
  color: #ffd870;
}
.queue-mini-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.entry {
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: #182c46;
  padding: 10px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.25);
}
.entry.is-focused {
  border-color: #7ea9dd;
  box-shadow: 0 0 0 2px rgba(126, 169, 221, 0.16), 0 10px 22px rgba(0, 0, 0, 0.25);
}

.entry.idee { background: color-mix(in srgb, var(--status-idee) 14%, #182c46); }
.entry.entwurf { background: color-mix(in srgb, var(--status-entwurf) 14%, #182c46); }
.entry.review { background: color-mix(in srgb, var(--status-review) 14%, #182c46); }
.entry.bereit { background: color-mix(in srgb, var(--status-bereit) 14%, #182c46); }
.entry.abgelehnt { background: color-mix(in srgb, var(--status-abgelehnt) 16%, #182c46); }
.entry.veroeffentlicht { background: color-mix(in srgb, var(--status-veroeffentlicht) 16%, #182c46); }

.entry-top {
  display: grid;
  gap: 8px;
}
.entry-title-input {
  border: 0;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  color: #eff5ff;
  font-size: 14px;
  font-weight: 620;
  padding: 8px 10px;
}
.entry-title-input[readonly] { cursor: pointer; }

.desc-inline-block {
  position: relative;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  padding: 6px;
}
.desc-inline-wrap {
  position: relative;
}
.desc-inline {
  border: 0;
  background: transparent;
  color: #d6e3f2;
  resize: none;
  min-height: 52px;
  padding: 0;
  line-height: 1.35;
  font-size: 12px;
}
.desc-inline.overlay-text[readonly] { cursor: pointer; }
.desc-inline-block.empty .desc-inline { color: #9eb2c9; }

.desc-inline-block.collapsed .desc-inline-wrap {
  max-height: 84px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, #000 64%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 64%, transparent 100%);
}
.desc-inline-block.collapsed .desc-fade {
  display: none;
}
.desc-inline-block.expanded .desc-inline-wrap {
  max-height: 360px;
  -webkit-mask-image: none;
  mask-image: none;
}

.edit-inline {
  position: absolute;
  right: 6px;
  bottom: 6px;
  padding: 4px 8px;
  font-size: 11px;
}
.desc-more {
  margin-top: 3px;
  display: none;
  font-size: 9px;
  color: #7f93aa;
  background: transparent;
  border: 0;
  padding: 0;
  min-height: 0;
  line-height: 1.05;
  opacity: 0.78;
  justify-content: flex-start;
}
.desc-more:hover { opacity: 1; }
.desc-fade {
  display: none;
}

.entry-subrow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.status-tab {
  border: 0;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 620;
  display: inline-flex;
  align-items: center;
  line-height: 1;
}
.status-tab.idee { background: var(--status-idee); color: #1a1f28; }
.status-tab.entwurf { background: var(--status-entwurf); color: #fff; }
.status-tab.review { background: var(--status-review); color: #fff; }
.status-tab.bereit { background: var(--status-bereit); color: #2d2400; }
.status-tab.abgelehnt { background: var(--status-abgelehnt); color: #fff; }
.status-tab.veroeffentlicht { background: var(--status-veroeffentlicht); color: #fff; }

.risk-guard {
  margin-top: 8px;
  border: 1px dashed #e58f8f;
  border-radius: 10px;
  padding: 7px;
  background: rgba(177, 58, 58, 0.12);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.post-card {
  margin-top: 8px;
  border: 1px solid #ccdaec;
  border-radius: 13px;
  background: #ffffff;
  color: #1b2a40;
  padding: 9px;
}
.post-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}
.post-author {
  display: flex;
  align-items: center;
  gap: 8px;
}
.avatar {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: #4f637d;
  background: #edf4ff;
  border: 1px solid #d5e1f0;
}
.author-name {
  font-size: 12px;
  font-weight: 640;
}
.author-handle {
  font-size: 10px;
  color: #71829a;
}

.edit-wrap {
  position: relative;
}
.overlay-text[readonly] {
  cursor: pointer;
}
.edit-overlay {
  position: absolute;
  inset: 0;
  cursor: pointer;
}
.edit-wrap.editing .edit-overlay {
  display: none;
}

.entry .edit-head,
.entry .edit-inline {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease;
}
.entry:hover .edit-head,
.entry:hover .edit-inline,
.entry:focus-within .edit-head,
.entry:focus-within .edit-inline {
  opacity: 1;
  pointer-events: auto;
}

.post-text {
  border: 0;
  background: transparent;
  color: #1b2a40;
  resize: none;
  min-height: 120px;
  line-height: 1.45;
  font-size: 15px;
  padding: 2px 0;
  overflow: hidden;
}

.post-meta-row {
  margin-top: 8px;
  border: 1px solid #d5e0ee;
  border-radius: 10px;
  background: #f8fbff;
  padding: 6px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.ready-badge,
.char-badge {
  font-size: 11px;
  color: #516985;
}
.char-badge.danger {
  color: #bb1f1f;
  font-weight: 700;
}

.post-channels {
  margin-top: 8px;
  border: 1px solid #d5e0ee;
  border-radius: 10px;
  background: #f8fbff;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  position: relative;
}
.post-channels .menu-kanal {
  position: relative;
}
.post-channels .menu-kanal > summary {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.editor-modal .post-channels .menu-kanal .menu-list,
.create-modal .post-channels .menu-kanal .menu-list {
  left: 0;
  right: auto;
  min-width: min(90vw, 360px);
  max-width: calc(100vw - 26px);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.chip {
  border: 1px solid #cdd9ea;
  border-radius: 999px;
  padding: 2px 8px;
  background: #fff;
  font-size: 11px;
  color: #5a6f89;
}
.chip.edit {
  cursor: pointer;
  color: #35506f;
  font-weight: 620;
}

.chip.kanal-webflow { border-color: #7f9ae6; color: #2b4aa6; background: #eef3ff; }
.chip.kanal-linkedin { border-color: #6f9ed8; color: #1d5899; background: #edf6ff; }
.chip.kanal-newsletter { border-color: #e5b56b; color: #8a5b16; background: #fff7e8; }
.chip.kanal-instagram { border-color: #d89acf; color: #7f2f7a; background: #fff0fd; }
.chip.kanal-twitter { border-color: #89b0e8; color: #1d4f99; background: #eef5ff; }
.chip.kanal-threads { border-color: #9ea7b6; color: #444f62; background: #f3f5f8; }
.chip.kanal-bluesky { border-color: #82a8e8; color: #1f4c9c; background: #eef4ff; }
.chip.kanal-mastodon { border-color: #a093e2; color: #4a359e; background: #f2efff; }

.menu {
  position: relative;
}
.menu summary {
  list-style: none;
  cursor: pointer;
}
.menu summary::-webkit-details-marker { display: none; }
.menu-list {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 80;
  min-width: 220px;
  max-width: min(86vw, 320px);
  background: #ffffff;
  color: #1c2b41;
  border: 1px solid #ccd9ea;
  border-radius: 10px;
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.22);
  padding: 8px;
  display: grid;
  gap: 5px;
}
.menu-status .menu-list {
  min-width: 180px;
}

.channel-list {
  max-height: 250px;
  overflow: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.channel-tag-item {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.channel-tag-item input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.channel-tag-item .chip {
  transition: opacity 0.15s ease, filter 0.15s ease;
}
.channel-tag-item.inactive .chip {
  opacity: 0.35;
  filter: grayscale(0.45);
}
.channel-tag-item.active .chip {
  opacity: 1;
  filter: none;
}

.status-option {
  width: 100%;
  text-align: left;
  padding: 7px 8px;
  border-radius: 8px;
  font-size: 12px;
  border: 1px solid #d3deec;
  background: #f7fbff;
  color: #1d2a3e;
}
.status-option:hover {
  background: #eef5fd;
}

.time-block {
  margin-top: 8px;
  border: 1px solid #d5e0ee;
  border-radius: 10px;
  background: #f8fbff;
  padding: 7px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.time-block.is-ready {
  border-color: #1ea46d;
  box-shadow: 0 0 0 1px rgba(30, 164, 109, 0.25);
}
.time-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.time-mini-actions {
  display: inline-flex;
  gap: 5px;
  flex-wrap: wrap;
}
.time-clear-inline {
  margin-top: 5px;
  border: 0;
  background: transparent;
  color: #6f8098;
  font-size: 10px;
  padding: 0;
  min-height: 0;
  line-height: 1.1;
}
.time-clear-inline:hover {
  color: #53677f;
}
.time-hidden-input {
  position: fixed;
  left: -9999px;
  bottom: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: auto;
}
.time-proxy-picker {
  position: fixed;
  left: 8px;
  bottom: 8px;
  width: min(320px, calc(100vw - 16px));
  height: 42px;
  opacity: 0.01;
  z-index: 260;
}
.mobile-time-layer {
  position: fixed;
  inset: 0;
  z-index: 280;
  background: rgba(8, 14, 24, 0.72);
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 10px;
}
.mobile-time-layer.open {
  display: flex;
}
.mobile-time-card {
  width: min(520px, 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #12243b;
  padding: 10px;
  display: grid;
  gap: 8px;
}
.mobile-time-card input {
  background: #fff;
  color: #11233a;
}
.mobile-time-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.icon-only {
  min-width: 30px;
  padding: 6px;
}
.is-ready-button {
  background: linear-gradient(180deg, #23b576, #169762);
  border-color: #168d5d;
  color: #fff;
}
.time-block.is-ready:hover .is-ready-button {
  background: linear-gradient(180deg, #db4f4f, #bf3131);
  border-color: #ac2b2b;
}

.control-box {
  margin-top: 8px;
}
.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.save-note {
  margin-top: 5px;
  font-size: 11px;
  color: #9fb3cb;
}
.save-note.saving {
  color: #ffcf66;
}
.save-note.error {
  color: #ff8e8e;
}

.tiny {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 640;
  padding: 6px 10px;
  background: #edf5ff;
  color: #28435f;
  border: 1px solid #b8cbdf;
}
.tiny:hover { filter: brightness(0.98); }
.tiny.link {
  text-decoration: none;
}
.tiny.ok {
  background: #1ea46d;
  border-color: #1a8b5d;
  color: #fff;
}
.tiny.review {
  background: #f76808;
  border-color: #d95c07;
  color: #fff;
}
.tiny.ready {
  background: #ffd43b;
  border-color: #f0c627;
  color: #2c2504;
}
.tiny.danger,
.tiny.trash {
  background: #cf3b3b;
  border-color: #b23333;
  color: #fff;
}
.tiny.subtle {
  background: #dce6f2;
  border-color: #bdcfe2;
  color: #2e4865;
}

.entry.preview-left { box-shadow: inset 0 0 0 2px rgba(208, 52, 52, 0.5); }
.entry.preview-right { box-shadow: inset 0 0 0 2px rgba(247, 104, 8, 0.5); }
.entry.preview-up { box-shadow: inset 0 0 0 2px rgba(255, 212, 59, 0.55); }

.bottom-dock {
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 90;
  max-width: 720px;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 8px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 48px;
  gap: 8px;
  align-items: center;
  background: color-mix(in srgb, #15263d 92%, transparent);
}

.dock-icon,
.dock-plus {
  width: 100%;
  height: 42px;
  border-radius: 12px;
  padding: 0;
}
.dock-icon {
  font-size: 17px;
  background: #1a2f4c;
}
.dock-plus {
  font-size: 24px;
  line-height: 1;
  background: linear-gradient(180deg, #3f74ff, #2f5edb);
  border-color: #6f93ff;
  color: #fff;
}

.dock-status-summary {
  height: 42px;
  border-radius: 12px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  padding: 8px;
  background: #1a2f4c;
}
.dock-status-summary .sq {
  border-radius: 3px;
  border: 1.5px solid transparent;
  background: transparent;
  opacity: 0.35;
}
.dock-status-summary .sq.active {
  opacity: 1;
}
.dock-status-summary .sq.idee { border-color: var(--status-idee); }
.dock-status-summary .sq.entwurf { border-color: var(--status-entwurf); }
.dock-status-summary .sq.review { border-color: var(--status-review); }
.dock-status-summary .sq.bereit { border-color: var(--status-bereit); }
.dock-status-summary .sq.abgelehnt { border-color: var(--status-abgelehnt); }
.dock-status-summary .sq.veroeffentlicht { border-color: var(--status-veroeffentlicht); }

.dock-status-summary .sq.idee.active { background: var(--status-idee); }
.dock-status-summary .sq.entwurf.active { background: var(--status-entwurf); }
.dock-status-summary .sq.review.active { background: var(--status-review); }
.dock-status-summary .sq.bereit.active { background: var(--status-bereit); }
.dock-status-summary .sq.abgelehnt.active { background: var(--status-abgelehnt); }
.dock-status-summary .sq.veroeffentlicht.active { background: var(--status-veroeffentlicht); }

.filter-sheet {
  position: fixed;
  right: 10px;
  bottom: 66px;
  width: min(370px, calc(100vw - 20px));
  z-index: 95;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  background: #14263f;
  display: block;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.97);
  transform-origin: bottom center;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}
.filter-sheet.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.sheet-grid {
  display: grid;
  gap: 9px;
}
.sheet-grid label {
  display: grid;
  gap: 5px;
}
.status-multi {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #102036;
  padding: 6px;
  max-height: 190px;
  overflow: auto;
  display: grid;
  gap: 4px;
}
.status-multi-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  padding: 4px 6px;
  border-radius: 8px;
}
.status-multi-item.active {
  background: rgba(100, 152, 222, 0.17);
}
.status-filter-tag {
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 620;
  border: 1px solid transparent;
}
.status-filter-tag.inactive {
  opacity: 0.38;
  filter: saturate(0.7);
}
.status-filter-tag.active {
  opacity: 1;
}
.status-filter-tag.idee { background: var(--status-idee); color: #212936; }
.status-filter-tag.entwurf { background: var(--status-entwurf); color: #fff; }
.status-filter-tag.review { background: var(--status-review); color: #fff; }
.status-filter-tag.bereit { background: var(--status-bereit); color: #2f2700; }
.status-filter-tag.abgelehnt { background: var(--status-abgelehnt); color: #fff; }
.status-filter-tag.veroeffentlicht { background: var(--status-veroeffentlicht); color: #fff; }
.sheet-actions {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
}

#filtersToggle.has-indicator::after {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #ffd04d;
  position: absolute;
  transform: translate(7px, -8px);
}
#filtersToggle {
  position: relative;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(4, 10, 18, 0.72);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 10px;
  opacity: 0;
  transition: opacity 0.18s ease;
}
.modal.open {
  display: flex;
  opacity: 1;
}
.create-modal { z-index: 120; }
.editor-modal { z-index: 150; }
.plan-modal { z-index: 200; }
.modal-card {
  width: min(980px, 100%);
  max-height: calc(100dvh - 20px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #12243b;
  padding: 12px;
  transform: translateY(12px) scale(0.98);
  transition: transform 0.2s ease;
}
.modal.open .modal-card {
  transform: translateY(0) scale(1);
}
.modal-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.plan-card {
  width: min(640px, 100%);
}
.plan-preview-text {
  white-space: pre-wrap;
  line-height: 1.45;
  margin-bottom: 6px;
}

.editor-card {
  padding-top: 28px;
  position: relative;
}
.editor-close-x {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  padding: 0;
  line-height: 1;
  position: absolute;
  right: 12px;
  top: 10px;
}
.editor-head-actions {
  display: inline-flex;
  gap: 6px;
}
#editorReadyWarn {
  margin-top: 6px;
}
.prominent-error {
  margin-top: 6px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid #de7e7e;
  background: #fff1f1;
  color: #a53131;
  font-weight: 620;
}
.editor-footer-actions {
  position: sticky;
  bottom: -12px;
  margin: 10px -12px -12px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  background: #12243b;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.create-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.create-entry {
  margin: 0;
}
.create-post-card .post-text {
  min-height: 180px;
}
.create-kanal-menu .menu-list {
  min-width: min(86vw, 320px);
}

.theo-inline-panel {
  margin-top: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  padding: 8px;
}
.theo-inline-panel.collapsed { display: none; }
.theo-mode-row,
.theo-topic-row,
.theo-draft-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.theo-topic-row {
  margin-top: 8px;
}
.theo-topic-row input {
  flex: 1;
  min-width: 180px;
  background: #fff;
  color: #1b2a40;
}
.theo-generating {
  margin-top: 6px;
  font-size: 12px;
  color: #d4e4f5;
}
.theo-generating span::after {
  content: '';
  animation: dots 1.2s steps(4, end) infinite;
}
@keyframes dots {
  0% { content: ''; }
  25% { content: ' .'; }
  50% { content: ' ..'; }
  100% { content: ' ...'; }
}
.theo-suggestions {
  margin-top: 8px;
  display: grid;
  gap: 8px;
}
.theo-draft-card {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  padding: 8px;
  display: grid;
  gap: 7px;
}
.theo-draft-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.theo-draft-caption {
  white-space: pre-wrap;
  line-height: 1.4;
  font-size: 13px;
  color: #dce8f6;
}

.toast {
  position: fixed;
  z-index: 240;
  left: 50%;
  bottom: 74px;
  transform: translateX(-50%);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #1a2f4b;
  color: #e8f0fb;
  padding: 8px 12px;
  font-size: 13px;
  display: none;
  min-width: min(92vw, 320px);
}
.toast.show { display: block; }
.toast.error {
  border-color: #de7e7e;
  background: #5b1e2a;
}
.toast.success {
  border-color: #52b48b;
  background: #1a3a36;
}
.toast-actions {
  margin-top: 7px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

@media (hover: none) {
  .entry .edit-head,
  .entry .edit-inline {
    opacity: 1;
    pointer-events: auto;
  }
}

@media (max-width: 1320px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr) 300px;
  }
  .feed.list-view.grid {
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  }
}

@media (max-width: 1180px) {
  .top-controls {
    grid-template-columns: minmax(150px, 210px) 1fr minmax(138px, 175px) auto;
  }
  #savedView {
    display: none;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .queue-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    height: 100dvh;
    width: min(92vw, 420px);
    transform: translateX(100%);
    z-index: 115;
    max-height: none;
    border-radius: 0;
  }

  .app.queue-open-mobile .queue-panel {
    transform: translateX(0);
  }

  .app.queue-collapsed .queue-panel {
    opacity: 1;
    pointer-events: auto;
  }
}

@media (max-width: 767px) {
  .app {
    padding: 0 0 92px;
  }

  .topbar {
    top: 0;
    margin: 0 0 8px;
    border-left: 0;
    border-right: 0;
    border-radius: 0;
    padding: 8px 8px 6px;
  }

  .top-controls {
    grid-template-columns: minmax(120px, 160px) 1fr auto;
  }
  #savedView,
  #viewModeSelect {
    display: none;
  }

  .feed.list-view.masonry {
    column-width: auto;
    column-count: 1;
  }
  .feed.list-view.grid {
    grid-template-columns: 1fr;
  }
  .feed.list-view.list {
    grid-template-columns: 1fr;
  }

  .post-channels {
    flex-direction: column;
    align-items: flex-start;
  }
  .post-channels .menu-kanal .menu-list {
    left: 0;
    right: auto;
    min-width: min(94vw, 360px);
    max-width: calc(100vw - 20px);
  }

  .editor-modal .post-channels .menu-kanal .menu-list,
  .create-modal .post-channels .menu-kanal .menu-list {
    position: fixed;
    left: 8px;
    right: 8px;
    top: auto;
    bottom: calc(76px + env(safe-area-inset-bottom));
    width: auto;
    min-width: 0;
    max-width: none;
  }

  .bottom-dock {
    left: 0;
    right: 0;
    bottom: 0;
    max-width: none;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    border-radius: 0;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  }

  .filter-sheet {
    right: 0;
    left: 0;
    bottom: 58px;
    width: 100vw;
    border-left: 0;
    border-right: 0;
    border-radius: 12px 12px 0 0;
  }

  .editor-footer-actions {
    flex-direction: column;
  }
}
