.feed-intro {
  margin-bottom: 52px;
}

/* Keep the existing site navigation inside the phone viewport. */
.site-header { flex-wrap: wrap; gap: 8px 20px; }

.feed-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0 10px;
  margin-top: 22px;
  color: var(--muted);
  font-size: 13px;
}

.feed-controls[hidden] {
  display: none;
}

.feed-controls a:not(.active) {
  color: var(--muted);
}

.feed-controls .active {
  color: var(--accent);
}

.feed-controls button {
  appearance: none;
  border: 0;
  padding: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}

.feed-controls button:hover,
.feed-controls button.active {
  color: var(--accent);
}

.search-form {
  margin-top: 34px;
  margin-bottom: 24px;
  max-width: 720px;
}

.search-wide {
  display: grid;
  gap: 11px;
}

.search-wide label,
.search-pairs label {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  align-items: baseline;
  gap: 16px;
}

.search-pairs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px 32px;
  margin-top: 24px;
}

.search-pairs label {
  grid-template-columns: 110px minmax(0, 1fr);
}

.search-form label > span {
  color: var(--muted);
  font-size: 12px;
}

.search-form input,
.search-form select {
  width: 100%;
  border: 0;
  border-bottom: 1px solid #282828;
  border-radius: 0;
  padding: 3px 0 5px;
  outline: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

.search-form input:focus,
.search-form select:focus {
  border-bottom-color: var(--accent);
}

.search-form select {
  appearance: none;
}

.search-help {
  margin-top: 22px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 11px;
}

.search-actions {
  display: flex;
  gap: 24px;
  margin-top: 16px;
}

.search-actions button {
  appearance: none;
  border: 0;
  padding: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.search-actions button:last-child {
  color: var(--muted);
}

.feed-section {
  margin-top: 0;
}

.feed-head,
.message-header {
  display: grid;
  grid-template-columns:
    176px
    52px
    74px
    72px
    112px
    52px
    38px
    86px
    50px;
  column-gap: 12px;
}

.feed-head {
  padding-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
}

.message {
  padding: 8px 0 9px;
}

.message-header {
  color: var(--text);
  font-size: 12px;
  line-height: 1.5;
}

.message-header span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-body {
  display: block;
  width: 40ch;
  max-width: 100%;
  margin: 5px 0 18px;
  max-height: none;
  overflow: visible;
  color: #aaa;
  font: inherit;
  font-size: 12px;
  line-height: 1.55;

  /* Preserve received whitespace and hard line breaks.
     Any received line longer than 40 columns folds visually
     at the narrow-format cockpit-printer width. */
  white-space: pre-wrap;
  overflow-x: visible;
  overflow-y: visible;
  overflow-wrap: normal;
  word-break: break-all;
  tab-size: 4;
}

.message.no-text .message-header {
  color: #a2a2a2;
}

.message-frame {
  color: var(--muted);
}

.message-decoded { max-width: 78ch; margin: 6px 0; color: #aaa; font: inherit; font-size: 12px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.message-warning { margin-top: 6px; color: var(--accent); font-size: 12px; }
.message-details { margin: 5px 0 16px; max-width: 80ch; color: #aaa; font-size: 12px; overflow-wrap: anywhere; }
.message-details summary { color: var(--accent); cursor: pointer; font-size: 11px; }
.message-details[open] summary { margin-bottom: 12px; }
.message-detail-section { margin: 0 0 14px; }
.detail-title { color: var(--muted); font-size: 11px; margin-bottom: 5px; }
.message-details dl { display: grid; grid-template-columns: minmax(0, 180px) minmax(0, 1fr); gap: 4px 16px; margin: 0; }
.message-details dt { color: var(--muted); }
.message-details dd { margin: 0; white-space: pre-wrap; }
.message-details .message-body { margin-bottom: 12px; }
@media (max-width: 480px) {
  .message-details dl { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .message-details dd { margin-bottom: 8px; }
}

.feed-empty,
.feed-error {
  margin-top: 18px;
  color: var(--muted);
  font-size: 13px;
}

.feed-error {
  color: var(--accent);
}

@media (max-width: 760px) {
  .search-pairs {
    grid-template-columns: 1fr;
  }

  .search-wide label,
  .search-pairs label {
    grid-template-columns: 105px minmax(0, 1fr);
  }

  .feed-section {
    overflow-x: auto;
  }
}


/* ------------------------------------------------------------------
   Compact mobile metadata
   ------------------------------------------------------------------ */

.message-header-mobile {
  display: none;
}

@media (max-width: 760px) {

  /*
   * Desktop column headings no longer make sense once each record
   * becomes its own two-line metadata block.
   */
  .feed-head,
  .message-header-desktop {
    display: none;
  }

  /*
   * Undo the old horizontally scrolling table behavior.
   */
  .feed-section {
    overflow-x: visible;
  }

  .message-header-mobile {
    display: block;
    color: var(--text);
    font-size: 11px;
    line-height: 1.5;
  }

  .mobile-meta-line {
    display: flex;
    align-items: baseline;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
  }

  .mobile-meta-line + .mobile-meta-line {
    margin-top: 1px;
    color: var(--text);
  }

  .mobile-meta-line span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-meta-line span + span::before {
    content: "·";
    display: inline-block;
    margin: 0 7px;
    color: var(--muted);
  }

  .mobile-meta-line .mobile-mil {
    color: var(--accent);
  }

  .message {
    padding: 9px 0 11px;
  }

  .message-body {
    margin-top: 6px;
    margin-bottom: 18px;
    font-size: 11px;
    line-height: 1.55;
  }
}


