.pre-market-briefing {
  width: min(1180px, calc(100% - 40px));
  margin: 18px auto 14px;
  color: #f5fbf8;
}

.feature-navigation-ready.fold-none .pre-market-briefing {
  display: block;
}

.pre-market-shell {
  border: 1px solid rgba(105, 224, 205, 0.24);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(20, 68, 64, 0.96), rgba(19, 38, 48, 0.98) 58%, rgba(17, 30, 39, 0.98)),
    #152632;
  box-shadow: 0 22px 52px rgba(8, 19, 27, 0.2);
  overflow: hidden;
}

.pre-market-shell[open] {
  border-color: rgba(105, 224, 205, 0.36);
}

.pre-market-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  gap: 12px;
  align-items: center;
  padding: 18px 22px;
  cursor: pointer;
  list-style: none;
}

.pre-market-summary::-webkit-details-marker {
  display: none;
}

.pre-market-kicker {
  color: #9bd5cb;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  white-space: nowrap;
}

.pre-market-title-wrap {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.pre-market-title-wrap strong {
  color: #ffffff;
  font-size: 1.22rem;
  line-height: 1.2;
}

.pre-market-title-wrap em {
  overflow: hidden;
  color: #bfd9d5;
  font-size: 0.95rem;
  font-style: normal;
  line-height: 1.55;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pre-market-count,
.pre-market-update,
.pre-market-toggle {
  padding: 8px 12px;
  border: 1px solid rgba(154, 217, 206, 0.24);
  border-radius: 999px;
  background: rgba(10, 24, 34, 0.48);
  color: #b7ddd6;
  font-size: 0.84rem;
  font-weight: 900;
  white-space: nowrap;
}

.pre-market-update {
  border-color: rgba(117, 175, 166, 0.28);
  background: rgba(136, 167, 160, 0.16);
  color: #d4e6e2;
  font-size: 0.78rem;
}

.pre-market-toggle {
  border-color: rgba(231, 212, 107, 0.28);
  background: rgba(231, 212, 107, 0.12);
  color: #f2df89;
}

.pre-market-content {
  display: grid;
  gap: 14px;
  padding: 0 22px 22px;
}

.pre-market-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pre-market-tabs button {
  border: 1px solid rgba(123, 199, 189, 0.2);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(5, 18, 28, 0.42);
  color: #bcd7d3;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 900;
  cursor: pointer;
}

.pre-market-tabs button.is-active {
  border-color: rgba(255, 117, 84, 0.36);
  background: rgba(255, 117, 84, 0.16);
  color: #ffb79f;
}

.pre-market-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.pre-market-card {
  display: grid;
  gap: 10px;
  grid-template-rows: auto auto 1fr auto;
  min-height: 190px;
  border: 1px solid rgba(112, 215, 199, 0.18);
  border-radius: 16px;
  padding: 16px;
  background: rgba(9, 27, 38, 0.55);
}

.pre-market-card[hidden] {
  display: none;
}

.pre-market-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.pre-market-card-head em {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  border-radius: 999px;
  padding: 5px 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #a7cbc5;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.pre-market-card > span,
.pre-market-area-badge {
  width: fit-content;
  border-radius: 999px;
  padding: 5px 8px;
  background: rgba(126, 214, 202, 0.1);
  color: #9bd5cb;
  font-size: 0.74rem;
  font-weight: 900;
}

.pre-market-area-badge {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  min-height: 34px;
  font-size: 1.08rem;
  line-height: 1;
}

.pre-market-card.taiwan .pre-market-area-badge {
  background: rgba(255, 117, 84, 0.12);
  color: #ffb39b;
}

.pre-market-card h4 {
  margin: 0;
  color: #ffffff;
  font-size: 1rem;
  line-height: 1.35;
}

.pre-market-card p {
  margin: 0;
  color: #d9ece8;
  font-size: 0.93rem;
  line-height: 1.68;
}

.pre-market-links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: auto;
}

.pre-market-card-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
}

.pre-market-links a {
  border: 1px solid rgba(123, 199, 189, 0.2);
  border-radius: 999px;
  padding: 7px 9px;
  background: rgba(5, 18, 28, 0.56);
  color: #eafaf6;
  font-size: 0.8rem;
  font-weight: 900;
  text-decoration: none;
}

.pre-market-source {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 7px 9px;
  color: #9ed1f1;
  font-size: 0.74rem;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

html[data-theme='soft-light'] .pre-market-briefing {
  color: #09232a;
}

html[data-theme='soft-light'] .pre-market-shell {
  border-color: rgba(63, 99, 92, 0.22);
  background:
    linear-gradient(135deg, rgba(222, 234, 225, 0.96), rgba(213, 226, 219, 0.98)),
    #dce8df;
  box-shadow: 0 18px 42px rgba(47, 70, 65, 0.14);
}

html[data-theme='soft-light'] .pre-market-title-wrap strong,
html[data-theme='soft-light'] .pre-market-card h4 {
  color: #09232a;
}

html[data-theme='soft-light'] .pre-market-title-wrap em,
html[data-theme='soft-light'] .pre-market-card p,
html[data-theme='soft-light'] .pre-market-count,
html[data-theme='soft-light'] .pre-market-update {
  color: #365f59;
}

html[data-theme='soft-light'] .pre-market-card,
html[data-theme='soft-light'] .pre-market-links a,
html[data-theme='soft-light'] .pre-market-tabs button,
html[data-theme='soft-light'] .pre-market-source {
  border-color: rgba(58, 91, 86, 0.18);
  background: rgba(245, 248, 242, 0.46);
  color: #173940;
}

html[data-theme='soft-light'] .pre-market-card-head em {
  background: rgba(34, 70, 66, 0.08);
  color: #315b55;
}

html[data-theme='soft-light'] .pre-market-toggle,
html[data-theme='soft-light'] .pre-market-tabs button.is-active {
  border-color: rgba(172, 88, 67, 0.24);
  background: rgba(255, 117, 84, 0.13);
  color: #a44735;
}

html[data-reading='large'] .pre-market-briefing {
  font-size: 1.1rem;
}

html[data-reading='large'] .pre-market-card {
  min-height: 190px;
}

@media (max-width: 900px) {
  .pre-market-briefing {
    width: min(100% - 26px, 720px);
  }

  .pre-market-summary {
    grid-template-columns: 1fr auto;
  }

  .pre-market-kicker,
  .pre-market-count {
    display: none;
  }

  .pre-market-update {
    grid-column: 1 / -1;
    justify-self: start;
    width: fit-content;
  }

  .pre-market-grid {
    grid-template-columns: 1fr;
  }

  .pre-market-card {
    min-height: auto;
  }

  .pre-market-card-foot {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .pre-market-briefing {
    width: min(100% - 20px, 480px);
  }

  .pre-market-summary,
  .pre-market-content {
    padding-left: 16px;
    padding-right: 16px;
  }

  .pre-market-title-wrap em {
    white-space: normal;
  }
}

/* Unified notice-row component: pre-market, after-market and week-ahead share one rhythm. */
.pre-market-shell,
.market-bulletin-shell,
.weekly-outlook-shell {
  border-color: rgba(147, 213, 202, .18) !important;
  background: linear-gradient(135deg, rgba(14, 69, 63, .94), rgba(13, 30, 42, .96)) !important;
  box-shadow: 0 18px 42px rgba(0, 0, 0, .20) !important;
}

.pre-market-summary,
.market-bulletin-summary,
.weekly-outlook-summary {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto auto auto !important;
  align-items: center !important;
  gap: 18px !important;
  min-height: 92px !important;
  padding: 18px 22px !important;
}

.pre-market-title-wrap,
.market-bulletin-title-wrap,
.weekly-outlook-title {
  grid-column: 1 !important;
  min-width: 0 !important;
}

.pre-market-kicker,
.market-bulletin-kicker,
.weekly-outlook-kicker {
  display: none !important;
}

.pre-market-title-wrap strong,
.market-bulletin-title-wrap strong,
.weekly-outlook-title strong {
  color: #f4fbf8 !important;
  font-size: clamp(1.22rem, 2.1vw, 1.68rem) !important;
  line-height: 1.18 !important;
}

.pre-market-title-wrap em,
.market-bulletin-title-wrap em,
.weekly-outlook-title em {
  display: -webkit-box !important;
  max-width: 100% !important;
  color: #c7ddd8 !important;
  font-size: clamp(.9rem, 1.4vw, 1.05rem) !important;
  line-height: 1.55 !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
}

.pre-market-count,
.pre-market-update,
.market-bulletin-date,
.weekly-outlook-range {
  justify-self: end !important;
  max-width: 100% !important;
  padding: 8px 15px !important;
  border: 1px solid rgba(184, 224, 215, .18) !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, .055) !important;
  color: #cfe7e2 !important;
  font-size: .88rem !important;
  font-weight: 950 !important;
  white-space: nowrap !important;
}

.pre-market-count {
  grid-column: 2 !important;
}

.pre-market-update,
.market-bulletin-date,
.weekly-outlook-range {
  grid-column: 3 !important;
}

.pre-market-toggle,
.market-bulletin-toggle,
.weekly-outlook-toggle {
  grid-column: 4 !important;
  justify-self: end !important;
  min-width: 64px !important;
  padding: 8px 14px !important;
  border: 1px solid rgba(255, 151, 118, .32) !important;
  border-radius: 999px !important;
  background: rgba(255, 112, 87, .10) !important;
  color: #ffad98 !important;
  font-size: .9rem !important;
  font-weight: 950 !important;
}

.pre-market-content,
.market-bulletin-content,
.weekly-outlook-content {
  padding: 16px 22px 22px !important;
}

html[data-theme="soft-light"] .pre-market-shell,
html[data-theme="soft-light"] .market-bulletin-shell,
html[data-theme="soft-light"] .weekly-outlook-shell {
  border-color: rgba(72, 111, 104, .18) !important;
  background: linear-gradient(135deg, rgba(225, 237, 229, .96), rgba(207, 224, 216, .92)) !important;
  box-shadow: 0 16px 34px rgba(52, 81, 72, .13) !important;
}

html[data-theme="soft-light"] .pre-market-kicker,
html[data-theme="soft-light"] .market-bulletin-kicker,
html[data-theme="soft-light"] .weekly-outlook-kicker {
  color: #2d8179 !important;
}

html[data-theme="soft-light"] .pre-market-title-wrap strong,
html[data-theme="soft-light"] .market-bulletin-title-wrap strong,
html[data-theme="soft-light"] .weekly-outlook-title strong {
  color: #0e2930 !important;
}

html[data-theme="soft-light"] .pre-market-title-wrap em,
html[data-theme="soft-light"] .market-bulletin-title-wrap em,
html[data-theme="soft-light"] .weekly-outlook-title em {
  color: #315952 !important;
}

html[data-theme="soft-light"] .pre-market-count,
html[data-theme="soft-light"] .pre-market-update,
html[data-theme="soft-light"] .market-bulletin-date,
html[data-theme="soft-light"] .weekly-outlook-range {
  border-color: rgba(50, 86, 79, .15) !important;
  background: rgba(255, 255, 255, .46) !important;
  color: #294f4a !important;
}

@media(max-width:760px){
  .pre-market-summary,
  .market-bulletin-summary,
  .weekly-outlook-summary {
    grid-template-columns: minmax(0, 1fr) auto auto !important;
    align-items: center !important;
    gap: 0 6px !important;
    min-height: 0 !important;
    padding: 8px 10px !important;
  }

  .pre-market-kicker,
  .market-bulletin-kicker,
  .weekly-outlook-kicker {
    display: none !important;
  }

  .pre-market-title-wrap,
  .market-bulletin-title-wrap,
  .weekly-outlook-title {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
  }

  .pre-market-title-wrap strong,
  .market-bulletin-title-wrap strong,
  .weekly-outlook-title strong {
    display: block !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 17px !important;
    line-height: 1.05 !important;
  }

  .pre-market-title-wrap em,
  .market-bulletin-title-wrap em,
  .weekly-outlook-title em {
    display: none !important;
  }

  .pre-market-count {
    display: none !important;
  }

  .pre-market-count,
  .market-bulletin-date,
  .weekly-outlook-range {
    grid-column: 2;
    grid-row: 1;
    justify-self: start !important;
    align-self: center !important;
    max-width: 132px !important;
    min-height: 24px !important;
    overflow: hidden !important;
    padding: 4px 7px !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: .56rem !important;
    line-height: 1 !important;
  }

  .pre-market-update {
    grid-column: 2;
    grid-row: 1;
    justify-self: end !important;
    align-self: center !important;
    max-width: 150px !important;
    min-height: 24px !important;
    overflow: hidden !important;
    padding: 4px 7px !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: .56rem !important;
    line-height: 1 !important;
  }

  .pre-market-toggle,
  .market-bulletin-toggle,
  .weekly-outlook-toggle {
    grid-column: 3;
    grid-row: 1;
    align-self: center;
    min-width: 42px !important;
    min-height: 26px !important;
    padding: 4px 8px !important;
    font-size: .68rem !important;
  }
}

@media(max-width:520px){
  .pre-market-summary,
  .market-bulletin-summary,
  .weekly-outlook-summary {
    padding: 7px 9px !important;
  }

  .pre-market-title-wrap strong,
  .market-bulletin-title-wrap strong,
  .weekly-outlook-title strong {
    font-size: 17px !important;
  }

  .pre-market-update {
    max-width: 124px !important;
  }

  .market-bulletin-date,
  .weekly-outlook-range {
    max-width: 112px !important;
  }
}
