:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #252b30;
  background: #f5f6f8;
  font-size: 14px;
  --surface: #fff;
  --surface-subtle: #f8f9fa;
  --border: #dfe3e6;
  --border-strong: #b8bec3;
  --text-muted: #5f6368;
  --accent: #007782;
  --accent-soft: #e8f4f4;
  --header-height: 58px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-width: 320px;
  line-height: 1.4;
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  color: #202124;
  background: var(--surface);
  cursor: pointer;
}

button:hover {
  background: #f0f2f3;
}

button:disabled {
  cursor: wait;
  opacity: 0.6;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.icon-button {
  display: inline-flex;
  width: 36px;
  height: 36px;
  padding: 8px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
}

button svg { flex-shrink: 0; vertical-align: middle; }
.workspace-expanded .topbar { display: none; }
.controls-collapsed .live-controls { display: none; }

button.primary {
  border-color: #007782;
  color: #fff;
  background: #007782;
}

button.danger {
  border-color: #b3261e;
  color: #b3261e;
}

button.danger-filled {
  border-color: #b3261e;
  color: #fff;
  background: #b3261e;
}

button.danger-filled:hover {
  background: #8c1d18;
}

.topbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  min-height: var(--header-height);
  padding: 8px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.topbar h1 {
  margin: 0;
  font-size: 17px;
  letter-spacing: 0;
}

.topbar > .topbar-actions {
  justify-self: end;
}

.main-nav,
.panel-heading,
.actions,
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.main-nav {
  align-self: stretch;
  gap: 2px;
  min-width: 0;
  overflow-x: auto;
  justify-content: center;
}

.nav-button {
  align-self: stretch;
  min-height: 40px;
  border-color: transparent;
  border-radius: 0;
  color: #5f6368;
  background: transparent;
  white-space: nowrap;
}

.table-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.table-check input {
  width: 16px;
  min-height: 16px;
  margin: 0;
}

.form-actions {
  flex-wrap: wrap;
  margin-top: 14px;
}

.nav-button:hover {
  color: #202124;
  background: #f4f5f6;
}

.nav-button.active {
  border-bottom-color: #007782;
  color: #007782;
  background: #eef7f7;
  font-weight: 600;
}

main {
  width: min(1600px, 100%);
  margin: 0 auto;
  padding: 20px;
}

body[data-view="live"] main {
  width: 100%;
  padding: 14px 16px 24px;
}

.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 54px;
  margin-bottom: 14px;
}

.page-heading h2,
.page-heading p,
.system-row h3,
.system-row p {
  margin: 0;
  letter-spacing: 0;
}

.page-heading h2 {
  margin-bottom: 3px;
  font-size: 22px;
}

.page-heading p,
.system-row p,
.form-hint {
  color: #5f6368;
  font-size: 13px;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid #d7dadd;
  border-radius: 4px;
  background: #d7dadd;
}

.status-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 72px;
  padding: 12px;
  background: #fff;
}

.status-item span {
  color: #5f6368;
  font-size: 13px;
}

.status-item strong {
  font-size: 16px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
}

.metric-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 70px;
  padding: 12px 14px;
  border-right: 1px solid #e2e5e7;
}

.metric-item:last-child {
  border-right: 0;
}

.metric-item span {
  color: #5f6368;
  font-size: 13px;
}

.metric-item strong {
  font-size: 20px;
}

.metric-item.good strong {
  color: #137333;
}

.metric-item.bad strong {
  color: #945e00;
}

.metric-item.wrong strong {
  color: #b3261e;
}

.ok {
  color: #137333;
}

.bad {
  color: #b3261e;
}

.warn {
  color: #945e00;
}

.live-workspace-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  margin: -14px -16px 12px;
  border-bottom: 1px solid var(--border);
  background: rgb(255 255 255 / 96%);
  box-shadow: 0 1px 3px rgb(32 33 36 / 4%);
}

.live-workspace-primary,
.live-controls,
.live-title,
.live-workspace-actions,
.live-summary,
.listing-title-row,
.listing-context {
  display: flex;
  align-items: center;
}

.live-workspace-primary {
  min-height: 50px;
  gap: 14px;
  padding: 7px 16px;
  border-bottom: 1px solid #eceff1;
}

.live-title {
  flex: 1 1 auto;
  min-width: 180px;
  gap: 10px;
}

.live-title h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0;
}

.live-status {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 6px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}

.live-status::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9aa0a6;
  content: '';
}

.live-status.ok::before { background: #137333; }
.live-status.warn::before { background: #945e00; }
.live-status.bad::before { background: #b3261e; }

.segmented-control {
  display: inline-grid;
  grid-template-columns: repeat(4, 1fr);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: var(--surface);
}

.segmented-control button {
  min-height: 36px;
  height: 36px;
  border: 0;
  border-right: 1px solid var(--border);
  border-radius: 0;
  color: var(--text-muted);
  background: transparent;
}

.segmented-control button:last-child { border-right: 0; }

.segmented-control button.active {
  color: #005f67;
  background: var(--accent-soft);
  font-weight: 650;
}

.live-workspace-actions {
  justify-content: flex-end;
  gap: 8px;
}

.live-workspace-actions button:not(.icon-button) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
}

.live-controls {
  min-height: 58px;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 16px 10px;
}

.live-control-field {
  position: relative;
  display: flex;
  min-width: 190px;
  flex: 1 1 240px;
  flex-direction: column;
  gap: 3px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
}

.live-control-field > select,
.filter-picker > summary {
  width: 100%;
  min-height: 36px;
  height: 36px;
  padding: 5px 9px;
  color: #202124;
  font-size: 13px;
  font-weight: 400;
}

.filter-picker {
  position: relative;
}

.filter-picker > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: var(--surface);
  cursor: pointer;
  list-style: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-picker > summary::-webkit-details-marker { display: none; }
.filter-picker > summary::after { content: '\25BE'; }
.filter-picker[open] > summary { border-color: var(--accent); }

.filter-picker-menu {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  z-index: 30;
  width: min(420px, calc(100vw - 32px));
  padding: 10px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgb(32 33 36 / 18%);
}

.filter-picker-menu input[type="search"] {
  min-height: 34px;
}

.filter-picker-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 8px 0;
}

.filter-picker-actions button {
  min-height: 30px;
  padding: 4px 7px;
  font-size: 12px;
}

.filter-picker-options {
  max-height: min(360px, 50vh);
  overflow-y: auto;
  border-top: 1px solid #eceff1;
}

.filter-picker-option {
  display: grid;
  grid-template-columns: 18px 22px minmax(0, 1fr) auto;
  min-height: 34px;
  grid-template-rows: 1fr;
  align-items: center;
  gap: 7px;
  padding: 5px 3px;
  border-bottom: 1px solid #f1f3f4;
  cursor: pointer;
}

.filter-picker-option:hover { background: var(--surface-subtle); }

.filter-picker-option input {
  width: 16px;
  min-height: 16px;
  margin: 0;
}

.filter-picker-option > span:nth-of-type(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-picker-option small { color: #137333; }

.marketplace-mark {
  display: inline-grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 3px;
  color: #fff;
  background: #5f6368;
  font-size: 10px;
  font-weight: 700;
}

.filter-picker-empty {
  padding: 18px 8px 8px;
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
}

.compact-toggle {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  align-self: flex-end;
  flex-direction: row;
  gap: 7px;
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: #3c4043;
  background: var(--surface-subtle);
  white-space: nowrap;
}

.compact-toggle input {
  width: 16px;
  min-height: 16px;
  margin: 0;
}

.live-summary {
  position: relative;
  z-index: 2;
  min-height: 30px;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  padding: 0 2px;
  color: var(--text-muted);
  font-size: 12px;
}

.live-summary > div {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 10px;
}

.live-summary strong {
  flex: 0 0 auto;
  color: #202124;
  font-size: 14px;
}

.live-summary span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.new-listings-button {
  position: fixed;
  right: 50%;
  bottom: 18px;
  z-index: 40;
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
  box-shadow: 0 5px 18px rgb(32 33 36 / 24%);
  font-weight: 650;
  transform: translateX(50%);
}

.new-listings-button:hover { background: #00646d; }

.live-feed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
  align-items: start;
}

body[data-feed-profile="focus"] .live-feed-grid {
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
}

.live-empty {
  padding: 56px 16px;
  border: 1px dashed #b8bec3;
  color: #5f6368;
  text-align: center;
  background: #fff;
}

.listing-card {
  overflow: hidden;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgb(32 33 36 / 5%);
}


.filter-preview-dialog {
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
}

.filter-preview-dialog::backdrop {
  background: rgb(32 33 36 / 55%);
}

.filter-preview-heading {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.filter-preview-heading h2,
.filter-preview-heading p {
  margin: 0;
  letter-spacing: 0;
}

.filter-preview-heading h2 { font-size: 17px; }
.filter-preview-heading p { margin-top: 3px; color: #6f7478; font-size: 12px; }
.filter-preview-content { padding: 12px; }
.filter-preview-result { margin: 0 0 8px; color: #3c4043; font-size: 13px; }
.filter-preview-warning { color: #945e00; font-size: 12px; }
.filter-preview-empty { display: grid; gap: 8px; padding: 28px 12px; text-align: center; }
.filter-preview-empty span { color: #6f7478; font-size: 12px; }

.listing-media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #eef0f1;
}

.listing-image {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: #5f6368;
  text-decoration: none;
}

.listing-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.listing-image-empty {
  font-size: 13px;
}

.image-count {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 3px 6px;
  border-radius: 3px;
  color: #fff;
  background: rgb(32 33 36 / 78%);
  font-size: 11px;
}

.image-nav {
  position: absolute;
  top: 50%;
  z-index: 1;
  display: grid;
  width: 30px;
  height: 38px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 3px;
  color: #fff;
  background: rgb(32 33 36 / 72%);
  font-size: 26px;
  line-height: 1;
  transform: translateY(-50%);
}

.image-previous { left: 6px; }
.image-next { right: 6px; }

.image-nav:hover,
.image-nav:focus-visible {
  background: rgb(32 33 36 / 92%);
}

.listing-content {
  padding: 11px;
}

.listing-title-row {
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-height: 42px;
}

.listing-title-row h3 {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  font-size: 15px;
  line-height: 1.3;
  letter-spacing: 0;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.listing-title-row h3 a {
  color: #006c75;
  text-decoration: none;
}

.listing-title-row strong {
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 15px;
}

.listing-meta {
  min-height: 20px;
  margin: 5px 0;
  overflow: hidden;
  color: #3c4043;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.listing-context {
  flex-wrap: wrap;
  gap: 4px 8px;
  min-height: 34px;
  color: #6f7478;
  font-size: 11px;
}

.listing-context span,
.listing-context time {
  overflow: hidden;
  max-width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.listing-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.listing-actions button,
.listing-actions .open-listing {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid #b8bec3;
  border-radius: 4px;
  font-size: 12px;
  text-decoration: none;
}

.listing-actions > :only-child {
  grid-column: 1 / -1;
}

.label-good {
  border-color: #137333 !important;
  color: #137333;
}

.label-bad {
  border-color: #945e00 !important;
  color: #754a00;
}

.label-wrong {
  border-color: #b3261e !important;
  color: #b3261e;
}

.open-listing {
  color: #fff;
  background: #007782;
}

.open-listing:hover {
  background: #00646d;
}

.notice {
  margin-bottom: 16px;
  padding: 10px 12px;
  border: 1px solid #9aa0a6;
  border-radius: 4px;
  background: #fff;
}

.notice.error {
  border-color: #b3261e;
  color: #8c1d18;
  background: #fce8e6;
}

.notice.success {
  border-color: #137333;
  color: #0d652d;
  background: #e6f4ea;
}

.panel {
  margin-bottom: 24px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.panel-heading {
  justify-content: space-between;
  min-height: 48px;
  padding: 8px 14px;
  border-bottom: 1px solid #e2e5e7;
}

.panel-heading h2,
.panel-heading h3 {
  margin: 0;
  font-size: 16px;
  letter-spacing: 0;
}

form {
  padding: 14px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.compact-grid {
  grid-template-columns: repeat(2, minmax(220px, 360px));
}

label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  color: #3c4043;
  font-size: 13px;
}

.form-hint {
  margin: 12px 0 0;
}

input,
select {
  width: 100%;
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid #b8bec3;
  border-radius: 4px;
  color: #202124;
  background: #fff;
}

input:focus,
select:focus {
  border-color: #007782;
  outline: 2px solid rgb(0 119 130 / 18%);
}

.id-text {
  display: block;
  margin-top: 2px;
  color: #6f7478;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
}

.span-2 {
  grid-column: span 2;
}

.checkbox-row {
  flex-wrap: wrap;
  margin: 14px 0;
}

.checkbox-row label {
  flex-direction: row;
  align-items: center;
}

.checkbox-row input {
  width: 18px;
  min-height: 18px;
}

.form-grid .inline-check {
  flex-direction: row;
  align-items: center;
  align-self: end;
  min-height: 38px;
}

.form-grid .inline-check input {
  width: 18px;
  min-height: 18px;
  margin: 0;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid #e2e5e7;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  color: #5f6368;
  background: #f8f9fa;
  font-weight: 600;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover { background: #f4f8f9; }

.status-pill {
  display: inline-block;
  min-width: 60px;
  padding: 3px 7px;
  border-radius: 3px;
  text-align: center;
  font-size: 12px;
}

.status-pill.active {
  color: #0d652d;
  background: #e6f4ea;
}

.status-pill.inactive {
  color: #5f6368;
  background: #eceff1;
}

.actions button {
  min-height: 30px;
  padding: 4px 8px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.discord-switch {
  padding: 14px;
}

.discord-switch .inline-check {
  flex-direction: row;
  align-items: center;
  font-size: 14px;
}

.discord-switch .inline-check input {
  width: 18px;
  min-height: 18px;
  margin: 0;
}

/* Filterliste: alle Spalten und Aktionen ab ca. 1280 px ohne Querscrollen */
.filter-table th,
.filter-table td {
  padding: 8px 8px;
}

.filter-table td small {
  display: block;
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 12px;
}

.filter-table .col-select {
  width: 28px;
  padding-right: 0;
}

.filter-table .col-select input {
  width: 16px;
  min-height: 16px;
  margin: 0;
}

.filter-table .col-filter strong,
.filter-table .col-filter small {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.filter-table .col-filter strong {
  display: block;
}

.filter-table .col-filter .status-pill {
  min-width: 0;
  margin-right: 4px;
  padding: 1px 5px;
  font-size: 11px;
}

.filter-table .col-target,
.filter-table .col-ai {
  max-width: 170px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.filter-table .col-delivery .table-check {
  display: flex;
  flex-direction: row;
}

.filter-table .col-delivery .table-check + .table-check {
  margin-top: 4px;
}

.filter-table .filter-rating-mode {
  width: auto;
  min-width: 0;
  min-height: 32px;
  padding: 4px 6px;
}

.filter-actions {
  flex-wrap: nowrap;
  gap: 4px;
}

.filter-actions .icon-button {
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 6px;
}

.filter-rating-mode {
  width: auto;
  min-width: 104px;
  min-height: 30px;
  padding: 4px 28px 4px 8px;
  font-size: 12px;
}

.empty {
  padding: 24px;
  color: #5f6368;
  text-align: center;
}

.system-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px;
  border-bottom: 1px solid #e2e5e7;
}

.system-row:last-child {
  border-bottom: 0;
}

.system-row h3 {
  margin-bottom: 4px;
  font-size: 15px;
}

.system-action {
  display: flex;
  align-items: center;
  gap: 12px;
}

.live-feed-grid.dense {
  grid-template-columns: repeat(auto-fill, minmax(225px, 1fr));
  gap: 9px;
}

.live-feed-grid.dense .listing-media {
  height: 138px;
  aspect-ratio: auto;
}

.live-feed-grid.dense .listing-content { padding: 8px; }
.live-feed-grid.dense .listing-title-row h3 { font-size: 13px; }
.live-feed-grid.dense .listing-title-row { min-height: 34px; }
.live-feed-grid.dense .listing-meta { min-height: 0; margin: 3px 0; }
.live-feed-grid.dense .listing-context { min-height: 26px; }
.live-feed-grid.dense .listing-actions { gap: 4px; margin-top: 6px; }
.live-feed-grid.dense .listing-actions button,
.live-feed-grid.dense .listing-actions .open-listing { min-height: 30px; padding: 4px 6px; }

.actions label { flex-direction: row; }
.actions input[type="checkbox"],
[data-select-filter] { width: 16px; height: 16px; min-height: 0; }

form > button[type="submit"] { margin-top: 14px; }

.command-panel > h3 {
  margin: 0;
  padding: 14px 14px 0;
  font-size: 16px;
  letter-spacing: 0;
}

details > summary { cursor: pointer; }

@media (max-width: 900px) {
  .topbar { grid-template-columns: 1fr auto; }
  .main-nav { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; }
  .status-grid, .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .metric-item { border-bottom: 1px solid #e2e5e7; }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .live-workspace-primary { flex-wrap: wrap; }
  .live-title { min-width: 150px; }
  .live-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .compact-toggle { align-self: end; }
  .live-feed-grid { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
  body[data-feed-profile="focus"] .live-feed-grid { grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); }
}

@media (max-width: 560px) {
  main { padding: 10px; }
  .panel-heading, .panel-heading .actions { flex-wrap: wrap; }
  .current-user { display: none; }
  .nav-button { border: 1px solid var(--border); border-radius: 4px; }
  .nav-button.active { border-color: var(--accent); }
  .page-heading, .system-row, .system-action { align-items: stretch; flex-direction: column; }
  .page-heading > button, .system-row button, .system-action button { width: 100%; }
  .status-grid, .metric-grid, .form-grid, .compact-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .topbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 10px; align-items: center; }
  .topbar h1 { font-size: 16px; }
  .topbar > .topbar-actions { grid-column: 2; grid-row: 1; align-self: center; }
  .main-nav { display: flex; max-width: 100%; flex-wrap: nowrap; overflow-x: auto; }
  .main-nav button { min-height: 32px; flex: 0 0 auto; padding: 6px 8px; }
  body[data-view="live"] main { padding: 10px; }
  .live-workspace-bar { position: static; margin: -10px -10px 10px; }
  .live-workspace-primary { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 9px 10px; }
  .live-title { min-width: 0; }
  .live-title h2 { font-size: 17px; }
  .segmented-control { grid-column: 1 / -1; grid-row: 2; }
  .live-workspace-actions { grid-column: 1 / -1; grid-row: 3; justify-content: flex-start; }
  .live-workspace-actions button:not(.icon-button) { flex: 1 1 0; }
  .live-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; padding: 8px 10px 10px; }
  .live-control-field { min-width: 0; }
  .compact-toggle { align-self: stretch; justify-content: center; }
  .filter-picker-menu { width: calc(100vw - 20px); }
  .live-summary > div { align-items: flex-start; flex-direction: column; gap: 1px; }
  .new-listings-button { right: 10px; bottom: 10px; transform: none; }
  .live-feed-grid,
  .live-feed-grid.dense,
  body[data-feed-profile="focus"] .live-feed-grid { grid-template-columns: 1fr; }
  .live-feed-grid.dense .listing-media { height: 190px; }
}

@media (max-width: 380px) {
  #liveFeedOpenTabButton { flex: 0 0 36px; width: 36px; padding: 8px; }
  #liveFeedOpenTabButton span { display: none; }
}

/* Anmeldung */
.login-main {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 16px;
}

.login-panel {
  width: min(380px, 100%);
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.login-panel h1 {
  margin: 0;
  font-size: 17px;
}

.login-panel form {
  display: grid;
  gap: 14px;
}

.login-panel .notice {
  margin: 0;
}

/* Rollen: Freunde sehen alles, aber keine System-Funktionen */
body:not([data-role="member"]) [data-member-only],
body[data-role="member"] [data-admin-only],
body[data-role="member"] #aiConnectionRows button,
body[data-role="member"] #aiWorkflowRows button {
  display: none !important;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.current-user {
  color: var(--text-muted);
  font-size: 13px;
  white-space: nowrap;
}

.user-form-actions {
  align-self: end;
  flex-wrap: wrap;
}
