/* PSX Announcements page — card layout aligned with KseAlert mobile */

body.kse-announcements-page {
  background: #f4f7fb;
}

.kse-announcements-page .site-main {
  padding-bottom: 48px;
}

#kseAnncSummary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.kse-annc-summary-card {
  background: #fff;
  border: 1px solid var(--kse-line, #dbe3ec);
  border-radius: 12px;
  padding: 14px 16px;
  border-top: 3px solid #cbd5e1;
}

#kseAnncSummary .kse-annc-summary-card:nth-child(1) {
  border-top-color: #0056b3;
}

#kseAnncSummary .kse-annc-summary-card:nth-child(1) .kse-annc-summary-title,
#kseAnncSummary .kse-annc-summary-card:nth-child(1) .kse-annc-summary-value {
  color: #0056b3;
}

#kseAnncSummary .kse-annc-summary-card:nth-child(2) {
  border-top-color: #0d9488;
}

#kseAnncSummary .kse-annc-summary-card:nth-child(2) .kse-annc-summary-title,
#kseAnncSummary .kse-annc-summary-card:nth-child(2) .kse-annc-summary-value {
  color: #0d9488;
}

#kseAnncSummary .kse-annc-summary-card:nth-child(3) {
  border-top-color: #dc2626;
}

#kseAnncSummary .kse-annc-summary-card:nth-child(3) .kse-annc-summary-title,
#kseAnncSummary .kse-annc-summary-card:nth-child(3) .kse-annc-summary-value {
  color: #dc2626;
}

.kse-annc-summary-title {
  margin: 0 0 6px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

.kse-annc-summary-value {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--kse-text, #0f172a);
  line-height: 1.1;
}

.kse-annc-summary-hint {
  display: block;
  margin-top: 4px;
  font-size: 0.75rem;
  color: #94a3b8;
}

.kse-annc-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
  margin-bottom: 12px;
}

.kse-annc-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px;
  background: #e8eef5;
  border-radius: 10px;
}

.kse-annc-tab {
  border: none;
  background: transparent;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}

.kse-annc-tab.is-active {
  background: #fff;
  color: #0056b3;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.kse-annc-search-wrap {
  flex: 1 1 220px;
  min-width: 200px;
  max-width: 360px;
  margin-left: auto;
}

.kse-annc-meta {
  margin: 0 0 12px;
  font-size: 0.84rem;
  color: #64748b;
}

.kse-annc-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.kse-annc-loading,
.kse-annc-empty {
  padding: 40px 16px;
  text-align: center;
  color: #64748b;
  background: #fff;
  border: 1px solid var(--kse-line, #dbe3ec);
  border-radius: 12px;
}

.kse-annc-empty h3 {
  margin: 0 0 8px;
  color: var(--kse-text, #0f172a);
}

.kse-annc-card {
  background: #fff;
  border: 1px solid var(--kse-line, #dbe3ec);
  border-radius: 12px;
  padding: 14px 16px;
  border-left: 4px solid #f39c12;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.kse-annc-card-brm {
  border-left-color: #0056b3;
}

.kse-annc-card-fr {
  border-left-color: #0d9488;
}

.kse-annc-card-pyt {
  border-left-color: #dc2626;
}

.kse-annc-card-clickable {
  cursor: pointer;
}

.kse-annc-card-clickable:hover {
  border-color: #94a3b8;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.kse-annc-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.kse-annc-card-head .kse-annc-card-title {
  flex: 1;
  min-width: 0;
  margin: 0;
}

.kse-annc-card-head .kse-annc-symbol-badge {
  flex-shrink: 0;
}

.kse-annc-card-type {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #fff;
}

.kse-annc-card-type-brm {
  background: #0056b3;
}

.kse-annc-card-type-fr {
  background: #0d9488;
}

.kse-annc-card-type-pyt {
  background: #dc2626;
}

.kse-annc-card-type-date {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
}

.kse-annc-symbol-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 12px;
  background: #fff3cd;
  color: #856404;
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
}

.kse-annc-symbol-badge:hover {
  background: #ffe69c;
  color: #664d03;
}

.kse-annc-card-title {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  color: #1e3a5f;
}

.kse-annc-card-date {
  font-size: 0.8rem;
  color: #64748b;
  margin-bottom: 10px;
}

.kse-annc-card-detail {
  margin-top: 4px;
  padding: 10px 12px;
  border-radius: 6px;
  background: #f8f9fa;
  border-left: 3px solid #1e40af;
}

.kse-annc-detail-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-bottom: 6px;
  font-size: 0.84rem;
}

.kse-annc-detail-row:last-child {
  margin-bottom: 0;
}

.kse-annc-detail-label {
  color: #0056b3;
  font-weight: 700;
}

.kse-annc-detail-value {
  color: #2c3e50;
  font-weight: 600;
}

.kse-annc-card-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
}

/* Outline action chips on list cards and modal */
.kse-annc-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.kse-annc-chip-primary {
  border: 1px solid #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
}

.kse-annc-chip-primary:hover {
  background: #dbeafe;
  border-color: #1d4ed8;
}

.kse-annc-chip-outline {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #475569;
}

.kse-annc-chip-outline:hover {
  border-color: #94a3b8;
  background: #f8fafc;
  color: #0f172a;
}

.kse-annc-chip-pdf {
  border: 1px solid #fecaca;
  background: #fff5f5;
  color: #db2728;
}

.kse-annc-chip-pdf:hover {
  background: #fee2e2;
  border-color: #f87171;
  color: #b91c1c;
}

.kse-annc-chip-image {
  border: 1px solid #bae6fd;
  background: #f0f9ff;
  color: #2188d1;
}

.kse-annc-chip-image:hover {
  background: #e0f2fe;
  border-color: #38bdf8;
  color: #0369a1;
}

.kse-annc-icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  flex-shrink: 0;
}

.kse-annc-icon-pdf {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23db2728' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3Cpath d='M9 13h6M9 17h6M9 9h1'/%3E%3C/svg%3E");
}

.kse-annc-icon-image {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232188d1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2' ry='2'/%3E%3Ccircle cx='8.5' cy='8.5' r='1.5'/%3E%3Cpolyline points='21 15 16 10 5 21'/%3E%3C/svg%3E");
}

.kse-annc-footer-link {
  display: none;
}

/* Modal */
body.kse-annc-modal-open {
  overflow: hidden;
}

.kse-annc-modal-screen[hidden],
.kse-annc-modal[hidden] {
  display: none !important;
}

.kse-annc-modal-screen:not([hidden]) {
  display: block;
}

.kse-annc-modal:not([hidden]) {
  display: flex;
}

.kse-annc-modal-screen {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 1200;
}

.kse-annc-modal {
  position: fixed;
  left: 50%;
  top: max(16px, 4vh);
  transform: translateX(-50%);
  width: min(600px, calc(100vw - 24px));
  max-height: calc(100vh - 32px);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2);
  z-index: 1201;
  flex-direction: column;
  overflow: hidden;
}

.kse-annc-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
  background: #0a2540;
  color: #fff;
}

.kse-annc-modal-head-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.kse-annc-modal-company {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
}

.kse-annc-modal-date {
  font-size: 0.78rem;
  opacity: 0.85;
  margin-top: 2px;
}

.kse-annc-modal-head .kse-annc-symbol-badge {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.kse-annc-modal-close {
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.kse-annc-modal-body {
  flex: 1;
  min-height: 0;
  padding: 20px 18px 18px;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.kse-annc-modal-summary {
  margin: 0 0 14px;
  padding-top: 2px;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--kse-text, #0f172a);
}

.kse-annc-summary-block {
  margin-bottom: 14px;
}

.kse-annc-summary-headline {
  margin: 0 0 10px;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.35;
  color: #0a2540;
}

.kse-annc-summary-text {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.6;
  color: #334155;
  width: 100%;
  max-width: none;
}

.kse-annc-findings {
  margin: 14px 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-left: 3px solid #0d9488;
}

.kse-annc-findings-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #0d9488;
  margin-bottom: 8px;
}

.kse-annc-findings ul {
  margin: 0;
  padding-left: 18px;
}

.kse-annc-findings li {
  margin-bottom: 6px;
  font-size: 0.86rem;
  line-height: 1.5;
  color: #334155;
}

.kse-annc-findings li:last-child {
  margin-bottom: 0;
}

.kse-annc-modal-title {
  margin: 0 0 12px;
  font-size: 1.05rem;
  line-height: 1.35;
  color: #0a2540;
  font-weight: 800;
}

/* Stock quote card in announcement modal (matches news / mobile snapshot link) */
.kse-annc-modal-body .knp-stock-card {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px 16px;
  margin: 0 0 14px;
  padding: 14px 18px;
  border: 1px solid #dbe3ec;
  border-radius: 10px;
  background: linear-gradient(90deg, #f6f9fc 0%, #f2f7fd 100%);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.kse-annc-modal-body .knp-stock-card:hover {
  background: linear-gradient(90deg, #eef5fc 0%, #e8f2fb 100%);
  box-shadow: inset 0 0 0 1px #cfe3f7;
}

.kse-annc-modal-body .knp-stock-card-main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  min-width: 0;
}

.kse-annc-modal-body .knp-stock-symbol {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: 999px;
  background: #e3f2fd;
  color: #0d47a1;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.kse-annc-modal-body .knp-stock-card-quote {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  text-align: right;
}

.kse-annc-modal-body .knp-stock-price {
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f2438;
}

.kse-annc-modal-body .knp-stock-change {
  font-size: 0.8rem;
  font-weight: 700;
}

.kse-annc-modal-body .knp-stock-change.kse-up {
  color: var(--kse-up, #0b8a4b);
}

.kse-annc-modal-body .knp-stock-change.kse-down {
  color: var(--kse-down, #c62828);
}

.kse-annc-modal-body .knp-stock-change.kse-flat {
  color: #6f8599;
}

.kse-annc-modal-body .knp-stock-card-chevron {
  color: #89a8c4;
  font-size: 1.2rem;
}

.kse-annc-compare,
.kse-annc-pyt-block {
  margin-top: 14px;
}

.kse-annc-compare-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #1e40af;
  margin-bottom: 8px;
}

.kse-annc-compare-ref {
  font-size: 0.8rem;
  color: #475569;
  margin-bottom: 10px;
}

.kse-annc-compare-ref.muted {
  color: #94a3b8;
}

.kse-annc-pyt-block {
  padding: 12px 14px;
  border-radius: 10px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-left: 3px solid #dc2626;
}

.kse-annc-pyt-block .kse-annc-compare-label {
  color: #dc2626;
}

.kse-annc-pyt-block .kse-annc-detail-label {
  color: #b91c1c;
}

.kse-annc-pyt-block .kse-annc-detail-value {
  color: #7f1d1d;
  font-weight: 700;
}

.kse-annc-compare-table-wrap {
  overflow-x: auto;
  margin-top: 4px;
}

.kse-annc-compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.kse-annc-compare-table th {
  padding: 8px 10px;
  text-align: left;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
  border-bottom: 1px solid #f1f5f9;
}

.kse-annc-compare-table th:last-child,
.kse-annc-compare-table td.kse-annc-compare-change {
  text-align: right;
}

.kse-annc-compare-table td {
  padding: 10px;
  vertical-align: middle;
  border-bottom: 1px solid #f8fafc;
}

.kse-annc-compare-table tr:last-child td {
  border-bottom: none;
}

.kse-annc-compare-metric {
  color: #1e40af;
  font-weight: 700;
}

.kse-annc-compare-current strong {
  color: var(--kse-text, #0f172a);
  font-weight: 800;
}

.kse-annc-compare-prior {
  color: #94a3b8;
  font-weight: 600;
}

.kse-annc-badge-new {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eff6ff;
  color: #2563eb;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.kse-annc-trend.kse-up {
  color: #16a34a;
  font-weight: 700;
}

.kse-annc-trend.kse-down {
  color: #dc2626;
  font-weight: 700;
}

.kse-annc-trend.kse-flat {
  color: #94a3b8;
  font-weight: 600;
}

.kse-annc-compare-row {
  display: none;
}

.kse-annc-compare-row-top {
  display: none;
}

.kse-annc-compare-values {
  display: none;
}

@media (max-width: 768px) {
  #kseAnncSummary {
    grid-template-columns: 1fr;
  }

  .kse-annc-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .kse-annc-search-wrap {
    max-width: none;
    margin-left: 0;
  }

  .kse-annc-tabs {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
  }
}

/* Dashboard widget (#lw-section-announcements) — compact mobile-style cards */
#lw-section-announcements .lw-annc-list {
  gap: 8px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 2px;
}

#lw-section-announcements .kse-annc-card {
  padding: 10px 12px;
  border-radius: 10px;
  background: #f8fafc;
}

#lw-section-announcements .kse-annc-card-title {
  font-size: 0.82rem;
  line-height: 1.35;
  margin: 0;
}

#lw-section-announcements .kse-annc-card-date {
  font-size: 0.72rem;
  margin-bottom: 6px;
}

#lw-section-announcements .kse-annc-card-detail {
  font-size: 0.74rem;
}

#lw-section-announcements .kse-annc-detail-row {
  padding: 2px 0;
}

#lw-section-announcements .kse-annc-card-footer {
  margin-top: 8px;
  gap: 6px;
}

#lw-section-announcements .kse-annc-chip {
  font-size: 0.68rem;
  padding: 3px 8px;
}

#lw-section-announcements .kse-annc-loading,
#lw-section-announcements .kse-annc-empty {
  padding: 20px 12px;
  border-radius: 10px;
  background: #f8fafc;
}

#lw-section-announcements .kse-annc-empty h3 {
  font-size: 0.88rem;
}

#lw-section-announcements .kse-annc-empty p {
  font-size: 0.75rem;
  margin: 0;
}

.kse-annc-card-head-symbol-only {
  justify-content: flex-end;
}
