/* =======================================================
   GRIDNET NEWS
   Safe isolated DBFlux / Miniflux panel
   ======================================================= */

.gn-panel {
  width: 100%;
  height: 100%;
  min-height: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gn-section {
  margin-bottom: 0;
  border: 1px solid rgba(120, 160, 230, 0.20);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.24);
  flex: 0 0 auto;
}

.gridnet-news-reader-section {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.gn-header {
  width: 100%;
  height: 28px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 0;
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
  color: #f8fbff;
  background: rgba(15, 23, 42, 0.92);
}

.gn-header-meta {
  font-size: 10px;
  font-weight: 700;
  opacity: 0.68;
}

.gn-section-chevron {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1;
  color: rgba(226, 232, 240, 0.88);
  background: rgba(148, 163, 184, 0.10);
  transition: transform 160ms ease, background 160ms ease;
}

.gn-section.open .gn-section-chevron {
  transform: rotate(180deg);
  background: rgba(96, 165, 250, 0.14);
}

.gn-body {
  display: none;
  padding: 8px;
}

.gn-section.open .gn-body {
  display: block;
}

.gridnet-news-reader-section.open .gridnet-news-reader-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.gn-status {
  margin: 0 0 8px;
  padding: 7px 9px;
  border-radius: 8px;
  font-size: 11px;
  line-height: 1.35;
  color: rgba(235, 245, 255, 0.86);
  background: rgba(96, 165, 250, 0.10);
  border: 1px solid rgba(96, 165, 250, 0.18);
  flex: 0 0 auto;
}

.gn-status-compact {
  margin-top: 8px;
  margin-bottom: 0;
}

.gn-error,
.gn-status.error {
  color: #fecaca;
  background: rgba(239, 68, 68, 0.10);
  border-color: rgba(248, 113, 113, 0.24);
}

.gn-reader-head,
.gridnet-news-reader-head {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.gridnet-news-reader-head strong {
  display: block;
  font-size: 14px;
  color: #f8fafc;
}

.gridnet-news-reader-head small {
  display: block;
  font-size: 11px;
  color: rgba(226, 232, 240, 0.76);
}

.gn-reader-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.gn-reader-actions select {
  min-height: 32px;
  max-width: 160px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.30);
  background: rgba(2, 6, 23, 0.80);
  color: #f8fafc;
  padding: 4px 7px;
}

.gn-news-list {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 2px;
}

.gn-news-list::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
}

/* fallback if the parent drawer gives no usable height */
.ol-left-tools-panel.is-active .gn-news-list {
  max-height: calc(100dvh - 420px);
}

.gn-card {
  padding: 10px;
  border-radius: 10px;
  background: rgba(30, 41, 59, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.16);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.16);
}

.gn-card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 10px;
  color: rgba(226, 232, 240, 0.68);
}

.gn-card-date {
  flex: 0 0 auto;
}

.gn-card-title,
button.gn-card-title,
.gridnet-news-card-title-btn {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  width: 100%;
  margin: 0 0 7px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
  color: #bfdbfe !important;
  font-size: 13px;
  line-height: 1.32;
  font-weight: 900;
  text-align: left;
  text-decoration: none;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.gn-card-title:hover,
.gridnet-news-card-title-btn:hover {
  color: #dbeafe !important;
  text-decoration: underline;
}

.gn-card-body,
.gridnet-news-card-summary {
  color: rgba(241, 245, 249, 0.92);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.gn-card-body p {
  margin: 0 0 8px;
}

.gn-card-body p:last-child {
  margin-bottom: 0;
}

.gn-card-body a {
  color: #60a5fa;
  text-decoration: underline;
  word-break: break-word;
}

.gridnet-news-chip {
  display: inline-flex;
  align-items: center;
  max-width: 150px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.13);
  color: rgba(226, 232, 240, 0.78);
  font-size: 10px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gridnet-news-card-actions {
  display: flex;
  gap: 7px;
  margin-top: 9px;
}

.gn-empty {
  padding: 12px;
  border-radius: 8px;
  font-size: 12px;
  opacity: 0.78;
  background: rgba(148, 163, 184, 0.10);
}

.gn-setting-row {
  margin-bottom: 9px;
}

.gn-setting-row label {
  display: block;
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 800;
  color: rgba(226, 232, 240, 0.84);
}

.gn-setting-row input,
.gn-setting-row select {
  width: 100%;
  min-height: 34px;
  box-sizing: border-box;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  background: rgba(15, 23, 42, 0.84);
  color: #f8fafc;
  font-size: 12px;
}

.gn-mini-label {
  min-height: 34px;
  display: flex;
  align-items: center;
  font-size: 11px;
  color: rgba(226, 232, 240, 0.72);
}

.gn-setting-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.gn-check-list {
  max-height: 120px;
  overflow: auto;
  padding: 6px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(2, 6, 23, 0.22);
}

.gn-check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
  font-size: 12px;
  color: rgba(226, 232, 240, 0.86);
}

.gn-check-row input {
  width: auto;
}

.gridnet-news-feeds-details {
  margin: 0 0 9px;
  color: rgba(226, 232, 240, 0.84);
  font-size: 12px;
}

.gridnet-news-feeds-details summary {
  cursor: pointer;
  font-weight: 800;
  margin-bottom: 6px;
}

.gn-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 7px;
}

.gn-btn-primary,
.gn-btn-secondary {
  min-height: 34px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

.gn-btn-primary {
  border: 1px solid rgba(96, 165, 250, 0.60);
  color: #fff;
  background: linear-gradient(180deg, #2563eb, #1d4ed8);
}

.gn-btn-secondary {
  border: 1px solid rgba(148, 163, 184, 0.24);
  color: #e5eefb;
  background: rgba(15, 23, 42, 0.82);
}

.gn-btn-secondary:disabled {
  opacity: 0.55;
  cursor: default;
}

.ol-news-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  min-width: 46px;
  margin-right: 8px;
  padding: 0 9px;
  border-radius: 999px;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  line-height: 1;
  background: linear-gradient(135deg, #2563eb, #38bdf8);
  box-shadow: 0 0 10px rgba(56, 189, 248, .42);
}

.ol-news-badge.gn-news-badge-hot {
  background: linear-gradient(135deg, #f97316, #ef4444);
  box-shadow: 0 0 14px rgba(249, 115, 22, .58);
}

@media (max-width: 560px) {
  .gn-setting-grid,
  .gn-actions {
    grid-template-columns: 1fr;
  }

  .gn-reader-actions {
    width: 100%;
  }

  .gn-reader-actions select,
  .gn-reader-actions button {
    flex: 1 1 auto;
  }

  .ol-left-tools-panel.is-active .gn-news-list {
    max-height: calc(100dvh - 440px);
  }
}

/* Alert state: clicking the animated Personalized pill opens News filtered to that category. */
#mainContentToggle.gridnet-news-alert-pill {
  cursor: pointer;
}


/* Floating readable article preview opened by the News card View button. */
.gn-reader-preview {
  position: fixed;
  z-index: 5015;
  box-sizing: border-box;
  padding: 14px 14px 16px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  border-radius: 14px;
  border: 1px solid rgba(147, 197, 253, 0.48);
  color: #f8fbff;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.99), rgba(5, 12, 25, 0.99));
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.58), 0 0 0 1px rgba(15, 23, 42, 0.75) inset;
}

.gn-reader-preview::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
}

.gn-reader-preview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
}

.gn-reader-preview-meta span {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1.2;
  font-weight: 850;
  color: rgba(226, 232, 240, 0.88);
  background: rgba(96, 165, 250, 0.13);
  border: 1px solid rgba(147, 197, 253, 0.16);
}

.gn-reader-preview-title {
  margin: 0 0 12px;
  color: #dbeafe;
  font-size: 21px;
  line-height: 1.22;
  font-weight: 950;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
}

.gn-reader-preview-body {
  color: rgba(248, 250, 252, 0.96);
  font-size: 18px;
  line-height: 1.68;
  font-weight: 650;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.gn-news-view-btn.is-preview-open {
  color: #ffffff;
  border-color: rgba(147, 197, 253, 0.56);
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.96), rgba(29, 78, 216, 0.96));
  box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.16), 0 0 16px rgba(59, 130, 246, 0.28);
}

.gn-news-star-btn { min-width: 82px; }
.gn-news-star-btn.is-starred {
  color: #fff7ed;
  border-color: rgba(251, 191, 36, 0.72);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.96), rgba(217, 119, 6, 0.96));
  box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.14), 0 0 14px rgba(245, 158, 11, 0.28);
}

.gn-star-visual {
  margin-top: 9px;
  padding: 9px 10px 10px;
  border-radius: 13px;
  border: 1px solid rgba(96, 165, 250, 0.18);
  background: rgba(15, 23, 42, 0.56);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16) inset;
}
.gn-star-visual[hidden] { display: none !important; }
.gn-star-visual-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; color: #f8fafc; font-size: 11px; line-height: 1.15; font-weight: 950; }
.gn-star-visual-count { color: rgba(226, 232, 240, 0.84); font-weight: 850; }
.gn-star-visual-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 7px; }
.gn-star-visual-bar { height: 17px; display: block; overflow: hidden; border-radius: 999px; background: rgba(30, 41, 59, 0.96); box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.16) inset; }
.gn-star-visual-bar span { height: 100%; display: block; min-width: 18%; border-radius: inherit; background: linear-gradient(90deg, #22c55e, #38bdf8); box-shadow: 0 0 10px rgba(56, 189, 248, 0.32); transition: width 180ms ease; }
.gn-star-visual-label { min-width: 22px; color: #f8fafc; font-size: 12px; line-height: 1; font-weight: 950; text-align: right; }

@media (max-width: 560px) {
  .gridnet-news-card-actions { grid-template-columns: 1fr; }
  .gn-reader-preview { padding: 13px 13px 15px; border-radius: 13px; }
  .gn-reader-preview-title { font-size: 22px; line-height: 1.2; }
  .gn-reader-preview-body { font-size: 19px; line-height: 1.72; font-weight: 700; }
  .gn-news-star-btn { min-width: 0; }
  .gn-star-visual { padding: 10px; }
  .gn-star-visual-bar { height: 18px; }
}

#mainContentToggle .gridnet-news-pill-overlay {
  font-size: 13px;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

#mainContentToggle .gridnet-news-pill-overlay strong {
  color: #ffffff;
  margin-right: 2px;
}


/* GRIDNET News standalone backend / Starred reader additions */
.gridnet-news-starred-section { flex: 0 0 auto; }
.gridnet-news-starred-section.open .gridnet-news-starred-body { display: block; }
.gridnet-news-starred-list { max-height: 220px; overflow-y: auto; }
.gridnet-news-starred-list .gn-card { background: rgba(30, 41, 59, 0.92); border-color: rgba(251, 191, 36, 0.22); }
.gridnet-news-reader-section .gn-header .gn-section-chevron { margin-left: 4px; }
.gridnet-search-btn, button.gridnet-search-btn, #gridnetSearchBtn { border: 1px solid rgba(147, 197, 253, 0.62) !important; box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.18), 0 0 12px rgba(59, 130, 246, 0.16) !important; }
@media (max-width: 560px) { .gridnet-news-starred-list { max-height: 190px; } }


/* News clean-up: settings are nested inside RSS News in the Features card. */
#olGridnetFeatureList #olGridnetNewsSettingsMount {
  margin: 8px 0 8px 12px;
}

#olGridnetFeatureList #olGridnetNewsSettingsMount .gridnet-news-settings-section {
  margin-top: 0;
  background: rgba(15, 23, 42, 0.34);
  border-color: rgba(120, 160, 230, 0.22);
}

#olGridnetFeatureList #olGridnetNewsSettingsMount .gridnet-news-settings-section .gn-body {
  padding: 10px;
}

.gridnet-news-reader-head {
  justify-content: flex-start;
  align-items: center;
}

.gridnet-news-reader-head .gn-reader-actions,
.gridnet-news-reader-head .gn-reader-actions select {
  width: 100%;
  max-width: none;
}

.gn-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 560px) {
  .gn-actions {
    grid-template-columns: 1fr;
  }
}
