.iad-feed-list{ display:flex; flex-direction:column; gap: 10px; }

.iad-card{
  position: relative;
  display:block;
  padding: 12px;
  border: 1px solid var(--iad-border);
  border-radius: var(--iad-radius);
  background: linear-gradient(180deg, rgba(16,24,39,0.55), rgba(15,20,29,0.75));
  box-shadow: 0 10px 22px rgba(0,0,0,0.25);

  /* HARD KILL any legacy "vote column" layout */
  margin-left: 0 !important;

  /* ✅ HARD CONTAINMENT: nothing may visually escape the card */
  overflow: hidden;

  /* ✅ Long URLs / weird content must wrap */
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Gradient glow layer (stronger than shadow-only) */
.iad-card::before{
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  z-index: 0;
}
.iad-card.is-unread::before{
  opacity: 0.95;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(255, 60, 60, 0.38), rgba(255, 60, 60, 0.00) 60%),
    radial-gradient(120% 140% at 100% 100%, rgba(255, 120, 120, 0.22), rgba(255, 120, 120, 0.00) 58%);
}
.iad-card.is-read::before{
  opacity: 0.85;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(60, 220, 120, 0.26), rgba(60, 220, 120, 0.00) 62%),
    radial-gradient(120% 140% at 100% 100%, rgba(60, 220, 120, 0.16), rgba(60, 220, 120, 0.00) 58%);
}

/* Read / unread glow */
.iad-card.is-unread{
  border-color: rgba(255, 80, 80, 0.45);
  box-shadow:
    0 10px 22px rgba(0,0,0,0.25),
    0 0 0 1px rgba(255, 60, 60, 0.30),
    0 0 18px rgba(255, 60, 60, 0.22);
}
.iad-card.is-read{
  border-color: rgba(60, 220, 120, 0.35);
  box-shadow:
    0 10px 22px rgba(0,0,0,0.25),
    0 0 0 1px rgba(60, 220, 120, 0.22),
    0 0 16px rgba(60, 220, 120, 0.18);
}

.iad-card-main{
  position: relative;
  z-index: 1;
  display: block !important;
  grid-template-columns: none !important;

  /* ✅ belt + braces containment at inner level */
  max-width: 100%;
  overflow: hidden;
}

/* ✅ Global containment for typical offenders inside cards */
.iad-card img,
.iad-card video,
.iad-card iframe,
.iad-card embed,
.iad-card object{
  display: block;
  max-width: 100%;
}

/* iframes/embeds must not force width */
.iad-card iframe,
.iad-card embed,
.iad-card object{
  width: 100%;
}

/* Tables often overflow */
.iad-card table{
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
}

/* Code/Pre often overflow with long URLs */
.iad-card pre{
  max-width: 100%;
  overflow-x: auto;
  white-space: pre;
}
.iad-card code{
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Attachment inline media (video/image rendered in card) */
.iad-attwrap{
  margin: 10px 0 10px;
  display: grid;
  gap: 10px;
  max-width: 100%;
}
.iad-att-media{
  max-width: 100%;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.20);
}
.iad-att-video{
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
}
.iad-att-img{
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
}

/* Desktop: feed attachments should render as previews, not full-width banners */
@media (min-width: 900px){
  .iad-feed-list .iad-att-media{
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
  }
  .iad-feed-list .iad-att-img{
    width: auto;
    max-width: 100%;
    max-height: 320px;
    object-fit: contain;
    margin-left: auto;
    margin-right: auto;
  }
}

/* Feed Sort Dropdown – Reddit-style pill */
/* Ensure the Sort <select> matches IA pill styling (avoid native OS look) */
.ia-discuss-root .iad-feed-controls {
  display:flex;
  align-items:center;
  gap:8px;
  margin: 6px 0 10px 2px;
}

.ia-discuss-root .iad-feed-controls-label {
  font-size: 14px;
  opacity: 0.9;
}

.ia-discuss-root .iad-feed-controls .iad-select {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  border: 1px solid rgba(255,255,255,0.14) !important;
  background-color: rgba(255,255,255,0.06) !important;
  color: rgba(255,255,255,0.92) !important;
  padding: 7px 32px 7px 12px !important;
  border-radius: 999px !important;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.1;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(255,255,255,0.70) 50%),
    linear-gradient(135deg, rgba(255,255,255,0.70) 50%, transparent 50%) !important;
  background-position:
    calc(100% - 16px) 55%,
    calc(100% - 11px) 55% !important;
  background-size: 5px 5px, 5px 5px !important;
  background-repeat: no-repeat !important;
}

.ia-discuss-root .iad-feed-controls .iad-select:hover {
  background-color: rgba(255,255,255,0.10) !important;
  border-color: rgba(255,255,255,0.22) !important;
}

.ia-discuss-root .iad-feed-controls .iad-select:focus {
  outline: none !important;
  border-color: rgba(255,106,0,0.75) !important;
  box-shadow: 0 0 0 2px rgba(255,106,0,0.25) !important;
}

/* Make dropdown options readable in dark mode (many clients default to white background) */
.ia-discuss-root .iad-feed-controls .iad-select option {
  background-color: #111;
  color: #fff;
}

/* Hide legacy arrow where applicable */
.ia-discuss-root .iad-feed-controls .iad-select::-ms-expand { display: none; }

/* Light theme override (real selector used by Discuss) */
.ia-discuss-root[data-iad-theme="light"] .iad-feed-controls .iad-select {
  border-color: rgba(0,0,0,0.14) !important;
  background-color: rgba(255,255,255,0.88) !important;
  color: rgba(0,0,0,0.85) !important;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(0,0,0,0.50) 50%),
    linear-gradient(135deg, rgba(0,0,0,0.50) 50%, transparent 50%) !important;
}
.ia-discuss-root[data-iad-theme="light"] .iad-feed-controls .iad-select option {
  background-color: #fff;
  color: #111;
}
/* /Feed Sort Dropdown – Reddit-style pill */
