.disc { display: flex; flex: 1; min-height: 0; background: var(--bg); }
.disc__main { flex: 1; min-width: 0; overflow: auto; padding: 20px 24px 32px; }
.disc__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.disc__title { margin: 0; font-size: 20px; font-weight: 700; color: var(--ink); }
.disc__tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.disc__seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); }
.disc__seg-btn { border: 0; background: none; color: var(--ink-3); font: inherit; font-size: 13px; padding: 5px 12px; border-radius: 7px; cursor: pointer; }
.disc__seg-btn:hover { color: var(--ink); }
.disc__seg-btn.is-active { background: var(--panel-3); color: var(--ink); }
.disc__search {
  width: 220px; max-width: 100%; padding: 8px 12px; border-radius: 10px; font: inherit; font-size: 13.5px;
  background: var(--panel-2); color: var(--ink); border: 1px solid var(--line-2); outline: none;
}
.disc__search:focus { border-color: var(--accent); }
.disc__search::placeholder { color: var(--ink-4); }

.disc__chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.disc__chip {
  border: 1px solid var(--line-2); background: var(--panel); color: var(--ink-2); font: inherit; font-size: 13px;
  padding: 5px 12px; border-radius: 999px; cursor: pointer; transition: background .15s, border-color .15s;
}
.disc__chip:hover { background: var(--panel-2); color: var(--ink); }
.disc__chip.is-active { background: var(--accent-soft); border-color: var(--accent); color: var(--ink); }
.disc__chip--static { cursor: default; font-size: 12px; padding: 3px 10px; }

.disc__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.disc__card {
  position: relative; display: flex; flex-direction: column; text-align: start; padding: 0; overflow: hidden; cursor: pointer;
  font: inherit; color: inherit; background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.disc__card:hover { transform: translateY(-2px); border-color: var(--line-2); box-shadow: var(--shadow); }
.disc__card.is-selected { border-color: var(--accent); }
.disc__banner, .disc__pane-banner {
  height: 76px; background: linear-gradient(135deg, hsl(var(--h) 55% 45%), hsl(calc(var(--h) + 40) 60% 32%));
}
.disc__banner img, .disc__pane-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.disc__icon, .disc__pane-icon {
  display: grid; place-items: center; overflow: hidden; flex: none; width: 44px; height: 44px; margin: -22px 12px 0;
  border-radius: 12px; border: 3px solid var(--panel); background: hsl(var(--h) 45% 40%); color: #fff; font-weight: 700; font-size: 17px;
}
.disc__icon img, .disc__pane-icon img { width: 100%; height: 100%; object-fit: cover; }
.disc__card-body { display: flex; flex-direction: column; gap: 6px; padding: 8px 12px 12px; min-width: 0; flex: 1; }
.disc__name-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.disc__name { font-weight: 650; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.disc__tag {
  --tc: var(--accent); flex: none; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 6px;
  color: var(--tc); border: 1px solid var(--tc); background: color-mix(in srgb, var(--tc) 14%, transparent);
}
.disc__desc {
  margin: 0; color: var(--ink-3); line-height: 1.6; min-height: 3.2em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.disc__stats { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-top: auto; }
.disc__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.disc__joined { margin-inline-start: auto; color: var(--ok); font-weight: 600; }

.disc__status { display: grid; place-items: center; padding: 24px 0; }
.disc__status:empty { padding: 0; }
.disc__empty { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 24px 0; }

.disc__pane {
  position: relative; flex: none; width: 320px; overflow: auto; background: var(--panel);
  border-inline-start: 1px solid var(--line);
}
.disc__pane[hidden], .disc__backdrop[hidden] { display: none; }
.disc__pane-banner { height: 120px; }
.disc__pane-icon { width: 64px; height: 64px; margin: -32px 16px 0; border-radius: 16px; font-size: 24px; }
.disc__pane-body { display: flex; flex-direction: column; gap: 10px; padding: 10px 16px 18px; }
.disc__pane-name { margin: 0; font-size: 17px; color: var(--ink); overflow-wrap: anywhere; }
.disc__pane-desc { margin: 0; color: var(--ink-2); line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.disc__cat { align-self: flex-start; padding: 2px 9px; border-radius: 6px; background: var(--panel-3); color: var(--ink-2); }
.disc__tags { display: flex; flex-wrap: wrap; gap: 5px; }
.disc__chans { display: flex; flex-direction: column; gap: 2px; padding: 8px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); }
.disc__section { padding: 2px 4px 6px; }
.disc__chan { display: flex; align-items: center; gap: 6px; padding: 4px; color: var(--ink-2); }
.disc__chan svg { width: 15px; height: 15px; flex: none; color: var(--ink-4); }
.disc__chan span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.disc__action { margin-top: 4px; }
.disc__pane > .spinner, .disc__pane-body > .spinner { align-self: center; }
.disc__close {
  position: absolute; top: 10px; inset-inline-end: 10px; z-index: 1; display: none;
  background: var(--panel); border: 1px solid var(--line-2);
}
.disc__close svg { width: 16px; height: 16px; }
.disc__backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .45); }

@media (max-width: 760px) {
  .disc__main { padding: 14px 16px 24px; }
  .disc__tools { width: 100%; }
  .disc__search { flex: 1; width: auto; }
  .disc__chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .disc__chip { flex: none; }
  .disc__grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .disc__pane {
    position: fixed; inset-inline: 0; bottom: 0; z-index: 41; width: auto; max-height: 75vh;
    border: 1px solid var(--line-2); border-bottom: 0; border-radius: 18px 18px 0 0; box-shadow: var(--shadow);
  }
  .disc__pane-banner { border-radius: 18px 18px 0 0; }
  .disc__close { display: inline-grid; }
}
