/* ── Standardized positive/negative change colors ────────────────────
   Use var(--wg-positive) and var(--wg-negative) everywhere instead of
   hard-coded hex values so the palette stays consistent across themes. */
:root {
  --wg-positive: #24a148;
  --wg-negative: #da1e28;
}

body {
  font-family: 'IBM Plex Sans', sans-serif;
  padding: 0px 20px 0px 20px;
  margin: 0;
  color: #124c5f;
  width: auto;
  max-width: 100%;
  background-color: #deecf0;
  display: flex;
  flex-direction: column;
}

/* Ensure form controls and buttons inherit the site font */
button,
input,
select,
textarea {
  font-family: inherit;
}

.profile-page #addTickerInput {
  display: none !important;
}

h2,
h3 {
  margin: 0;
  font-weight: 500;
}

.btn {
  padding: 0px 12px;
  background: #124c5f;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  height: 28px;
}

.btn-ghost {
  padding: 5px 12px;
  background: transparent;
  color: #124c5f;
  border: 1px solid #124c5f26;
}

.btn-ghost:hover {
  background: #124c5f14;
  color: white;
}

.btn:hover {
  background: #3c5b6f;
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
}

/* Profile page - Save and Cancel buttons */
.save-btn {
  background: #124c5f;
  color: #fff;
  border: 1px solid #124c5f;
  border-radius: 12px;
  padding: 12px 24px;
  margin-bottom: 12px;
  font-size: 1em;
  width: 100%;
  font-weight: bold;
  cursor: pointer;
  margin-right: 12px;
}

.save-btn:hover {
  background: #3c5b6f;
}

.cancel-btn {
  background: transparent;
  color: #124c5f;
  border: 1px solid #124c5f;
  border-radius: 12px;
  padding: 12px 24px;
  font-size: 1em;
  width: 100%;
  font-weight: bold;
  cursor: pointer;
}

.cancel-btn:hover {
  background: transparent;
}

/* Profile page layout classes */
.profile-main-content {
  flex: 1;
  min-width: 800px;
  padding-bottom: 50px;
  overflow: visible;
  height: auto;
  max-height: none;
}

.profile-tab-wrapper {
  min-width: 800px;
  background: transparent;
  box-shadow: none;
  padding: 0;
  overflow: visible !important;
  max-height: none !important;
  height: auto !important;
  position: relative !important;
  top: auto !important;
}

.profile-tab-wrapper .tab-content {
  overflow: visible;
  height: auto;
  max-height: none;
}

.profile-container-base {
  min-width: 300px;
  height: fit-content;
  width: 100%;
  max-width: 100%;
}

.main-container {
  display: flex;
  width: 80%;
  height: 85%;
  gap: 50px;
  margin: 0 auto;
  max-width: 1400px;
}

.panel {
  background-color: transparent;
  padding: 20px;
  overflow-y: auto;
  flex-shrink: 1;
  position: sticky;
  align-self: flex-start;
  height: -webkit-fill-available;
  border-left: 1px solid #124c5f26;
}

.panel2 {
  align-items: center;
  margin-bottom: 20px;
  width: -webkit-fill-available;
  padding: 20px;
}

/* Portfolio page: no-portfolios empty state (layout + theme tokens; dark overrides in carbon-styles.css) */
.portfolio-empty-state {
  box-sizing: border-box;
  text-align: center;
  border: 1px solid #124c5f26;
  padding: 32px 20px 24px;
  min-height: min(280px, 58vh);
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
}

.portfolio-empty-state__intro {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  max-width: 40rem;
  padding-bottom: 8px;
}

.portfolio-empty-state__title {
  margin: 0;
  font-size: 1rem;
  line-height: 1.4;
  color: var(--cds-text-primary, #124c5f);
}

.portfolio-empty-state__hint {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--cds-text-secondary, #525252);
}

.portfolio-empty-state__cta {
  flex-shrink: 0;
  align-self: center;
  width: 100%;
  max-width: 360px;
  min-width: 240px;
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 28px 32px;
}

.portfolio-empty-state--positions {
  display: none;
  border: none;
  min-height: min(200px, 40vh);
}

#sideBar {
  position: sticky;
  align-self: flex-start;
  height: -webkit-fill-available;
  width: 400px;
}


.news-item {
  opacity: 0;
  padding-top: 5px;
  font-weight: normal;
  /* Ensure smooth animations */
  transform-origin: center;
  will-change: transform, opacity;
  line-height: 1.6;
}

.news-item--has-thumb {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row-reverse;
  align-items: flex-start;
  gap: 12px;
}

.news-item-thumb {
  flex-shrink: 0;
  width: 96px;
  height: 64px;
  min-width: 96px;
  min-height: 64px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--cds-layer-02, #e0e0e0);
}

.news-item-thumb--empty {
  background: transparent;
}

.news-item-thumb a {
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.news-item-thumb img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  vertical-align: middle;
}

.news-item-body {
  flex: 1;
  min-width: 0;
}

.news-item--has-thumb .news-item-body {
  padding-top: 0;
}

.news-item--has-thumb .line2 {
  flex-basis: 100%;
  width: 100%;
}

.news-item a {
  color: #124c5f;
  font-weight: 600;
}

.news-item a:hover {
  color: #0385b1;
}



.news-item .news-date {
  font-size: 0.9em;
  color: #555;
}

.news-item .news-source {
  font-size: 12px;
}

/* Glassmorphism Card Base */
.glass-card {
  /* Core glassmorphism styling */
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid #ffffffc4;
  border-radius: var(--radius-xl);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg,
      transparent,
      rgba(255, 255, 255, 0.4),
      transparent);
}

.grid {
  flex-grow: 1;
  display: grid;
  margin: 1px;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  align-content: flex-start;
  overflow-y: hidden;
  overflow-x: hidden;
  /* Smooth grid reflow transitions */
  transition: all 1 ease-in;
  position: relative;
}

/* Smooth transitions for grid items */
.grid>* {
  transition: all 1s ease-in-out;
}

/* Related stocks: flex-wrap so each cds-tile width follows content (company name), not equal columns */
#relatedGrid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: stretch;
  min-height: 115px;
  margin-top: 15px;
}

#relatedGrid cds-tile {
  flex: 0 1 auto;
  width: auto;
  min-width: 150px;
  max-width: 100%;
  box-sizing: border-box;
}

#relatedGrid cds-tile .company-name {
  white-space: nowrap;
}

#relatedGrid cds-tile .stock-price {
  font-size: 1.4rem;
}

.lastchild-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 50px;
}

#discussions {
  grid-column: 1 / -1;
}

.range-btn {
  background-color: transparent;
  font-weight: 300;
  border-radius: 8px;
  cursor: pointer;
  vertical-align: middle;
  font-size: 12px;
  border: 1px solid transparent;
  transition: background-color 0.1s, color 0.1s;
  color: #124c5f;
  padding: 6px 12px;
}

/* Prevent horizontal scrolling on range buttons across all breakpoints */
#rangeButtons {
  overflow-x: hidden;
}

#rangeButtons::-webkit-scrollbar {
  display: none;
}


.range-btn:hover {
  background-color: #124c5f;
  transition: background-color 0.1s;
  color: #ffffff;
}

.range-btn:focus {
  background-color: #124c5f;
  color: #ffffff;
  outline: none;
}

.range-btn.active {
  color: #ffffff;
}


.tile {
  min-width: 150px;
  max-height: 400px;
  padding: 20px;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  text-align: left;
  border: 2px solid #124c5f26;
  box-sizing: border-box;
  display: grid;
  font-size: 1.2em;
  position: relative;
  flex-direction: column;

  /* Ensure smooth animations */
  transform-origin: center;
  will-change: transform, opacity;
}

/* Hover state only for clickable tiles */
.tile:hover {
  border: 2px solid #124c5f;
  cursor: pointer;

  transition: transform 0.3s ease,
}

.tile.list {
  min-width: 150px;
  max-height: 400px;
  padding: 20px;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  text-align: left;
  box-sizing: border-box;
  color: #124c5f;
  display: grid;
  border: 1px solid #124c5f;
  font-size: 1.2em;
  position: relative;
  flex-direction: column;

  /* Ensure smooth animations */
  transform-origin: center;
  will-change: transform, opacity;
}

.tile.list:hover {
  border: 1px solid #19cfe7;
  cursor: pointer;
  background-color: #19cfe71e;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Stock Action Button Styles */
.stock-action-btn {
  position: absolute;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.stock-action-btn:hover {
  transform: scale(1.1);
}

.stock-action-btn img {
  width: 25px;
  height: 25px;
}

.ticker {
  font-weight: bold;
  font-size: 1.125rem;
}

.company {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.9375rem;
  font-weight: 300;
}

.price {
  font-size: 25px;
  font-weight: bold;
}

.price.list {
  font-size: 12px;
  font-weight: bold;
}


.icon-btn {
  position: static;
  background-color: transparent;
  border-radius: 50%;
  border: none;
  margin: 0;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Context Menu Styles */
.context-menu {
  background: #124c5f;
  border: 1px solid #124c5f26;
  border-radius: 8px;
  min-width: 120px;
  color: #ffffff;
  font-size: 14px;
  position: fixed;
  z-index: 10000;
}

.context-menu-item {
  padding: 8px 8px;
  cursor: pointer;
  color: #ffffff;
  transition: background-color 0.2s ease;
  display: flex;
  align-items: center;
}

.context-menu-item:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

.context-menu-item:first-child {
  border-radius: 8px 8px 0 0;
}

.context-menu-item:last-child {
  border-radius: 0 0 8px 8px;
}

.context-menu-item:only-child {
  border-radius: 8px;
}

.line {
  height: 1px;
  margin-top: 10px;
  margin-bottom: 10px;
  background-color: #124c5f;
}

.line2 {
  height: 1px;
  margin-top: 5px;
  margin-bottom: 5px;
  background-color: #124c5f26;
}

.line3 {
  height: 1px;
  margin-top: 5px;
  margin-bottom: 5px;
  background-color: #ffffff4d;
}

.current-volume,
.average-volume {
  font-size: 15px;
}

.price-container {
  display: flex;
  justify-content: left;
  align-items: baseline;
  gap: 8px;
}

.percent {
  font-size: 1em;
  font-weight: bold;
}

.percent.up {
  color: var(--wg-positive);
}

.percent.upTile {
  color: var(--wg-positive);
}

.percent.down {
  color: var(--wg-negative);
}

.percent.downTile {
  color: var(--wg-negative);
}

.rsi {
  position: absolute;
  bottom: 20px;
  width: 100%;
  right: 20px;
  text-align: right;
  font-size: 20px;
  font-weight: bold;
}

.switch {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  color: #124c5f;
}

.switch input {
  display: none;
}

/* Radio controls styled similar to switches */
.radio {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  color: #124c5f;
  cursor: pointer;
}

.radio input[type="radio"] {
  display: none;
}

.radio-indicator {
  position: relative;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: transparent;
  border: 1px solid #c9d8dd;
  cursor: pointer;
}

body.cds-theme--g100 .radio-indicator {
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.radio-indicator::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  background-color: transparent;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.2s ease, background-color 0.2s ease;
}

input[type="radio"]:checked+.radio-indicator {
  background-color: #7ee1ee;
  border-color: #7ee1ee;
}

input[type="radio"]:checked+.radio-indicator::after {
  transform: translate(-50%, -50%) scale(1);
  background-color: #124c5f;
}

/* Checkbox controls styled similar to radio */
.checkbox {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  color: #124c5f;
  cursor: pointer;
}

.checkbox input[type="checkbox"] {
  display: none;
}

.checkbox-indicator {
  position: relative;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background-color: transparent;
  border: 1px solid #c9d8dd;
  cursor: pointer;
}

body.cds-theme--g100 .checkbox-indicator {
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.checkbox-indicator::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 10px;
  border: solid #124c5f;
  border-width: 0 2px 2px 0;
  transform: translate(-50%, -60%) rotate(45deg) scale(0);
  transition: transform 0.2s ease;
}

input[type="checkbox"]:checked+.checkbox-indicator {
  background-color: #7ee1ee;
  border-color: #7ee1ee;
}

input[type="checkbox"]:checked+.checkbox-indicator::after {
  transform: translate(-50%, -60%) rotate(45deg) scale(1);
}

.slider {
  position: relative;
  width: 40px;
  height: 21px;
  background-color: #124c5f;
  border-radius: 10px;
  border: 1px solid #ffffff4d;
  transition: 0.3s;
  cursor: pointer;
}

.slider::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: 2px;
  top: 2px;
  background-color: #ffffff4d;
  border-radius: 50%;
  transition: 0.3s;
}

input:checked+.slider {
  background-color: #7ee1ee;
}

input:checked+.slider::before {
  transform: translateX(20px);
  background-color: #124c5f;
}

/* SMA toggle: match the SMA line color (#e6ae16 golden yellow) */
#sma:checked+.slider {
  background-color: #e6ae16;
}

#sma:checked+.slider::before {
  background-color: #fff;
}

/* EMA toggle: match the EMA line color (#ff6b6b pink-red) */
#ema:checked+.slider {
  background-color: #ff6b6b;
}

#ema:checked+.slider::before {
  background-color: #fff;
}

.label-text {
  margin-left: 5px;
}

.tab-btn {
  padding: 6px 12px;
  font-size: 1em;
  color: #124c5f;
  cursor: pointer;
  background-color: transparent;
  border: 1px solid #124c5f;
  font-weight: normal;
}

.tab-btn .large {
  padding: 12px 24px;
}

.tab-btn.active {
  background-color: #124c5f;
  color: white;
}

/* Tab Navigation Styles */
.tab-navigation {
  display: flex;
  gap: 8px;
}

.tab-navigation .tab-btn {
  border-radius: 8px;
  transition: all 0.2s ease;
  font-size: 14px;
  padding: 6px 16px;
  border: 1px solid #124c5f26;
  background-color: transparent;
  color: #124c5f;
  cursor: pointer;
}

.tab-navigation .tab-btn:hover:not(.active) {
  background-color: #124c5f0d;
  border-color: #124c5f;
}

.tab-navigation .tab-btn.active {
  background-color: #124c5f;
  color: white;
  border-color: #124c5f;
}

/* Tab Content Styles */
.tab-content {
  display: none;
  animation: fadeIn 0.3s ease-in-out;
}

.tab-content.active {
  display: block;
}

/* Sidebar tab contents fill available space so each tab scrolls internally */
#sideBarContent > .tab-content.active {
  height: 100%;
  overflow: hidden;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.placeholder-content {
  min-height: 200px;

  align-items: center;
  justify-content: center;
}

.stocks-list-item {
  position: relative;
  display: flex;
  width: -webkit-fill-available;
  color: #124c5f;
  font-size: 16px;
  justify-content: space-between;
  align-items: center;
  padding: 15px 10px;
  background-color: transparent;
  border: none;
  cursor: pointer;
}

.stocks-list-item.active {
  background-color: #124c5f;
  color: white;
  font-weight: bold;
}

.stocks-list-item:hover:not(.active),
.stocks-list-item:focus:not(.active) {
  background-color: #19cfe71e;
  color: #124c5f;
  cursor: pointer;
}

.stocks-list-item .list-name {
  flex: 1;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

.stocks-list-item .icon-btn {
  color: #124c5f;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  padding: 8px 8px;
  border-radius: 50%;
  transition: opacity 0.2s ease;
  margin-left: 8px;
  flex-shrink: 0;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
}


.stocks-list-item:active .icon-btn,
.stocks-list-item.active .icon-btn {
  color: #ffffff;
}

.stocks-list-item:active .icon-btn:hover,
.stocks-list-item.active .icon-btn:hover {
  background-color: #ffffff57;
}

/* If an inline SVG is used instead of an <img>, force its fill/stroke to white */
.stocks-list-item:active .icon-btn svg,
.stocks-list-item.active .icon-btn svg {
  fill: #ffffff !important;
  stroke: #ffffff !important;
}

.stocks-list-item:active .icon-btn img,
.stocks-list-item.active .icon-btn img {
  filter: brightness(0) invert(1);
}


.stocks-list-item .icon-btn:hover {
  color: #124c5f;
  background-color: rgba(18, 76, 95, 0.1);
}

.stock-list-row .icon-btn {
  border: none;
  background: transparent;
  font-size: 20px;
  color: #124c5f;
}

.stock-list-row .icon-btn:hover {
  border: none;
  background-color: rgba(18, 76, 95, 0.1);
}

.info-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pill {
  width: auto;
  padding: 12px;
  border-radius: 40px;
  text-align: center;
  text-wrap: nowrap;
  border: 1px solid #124c5f26;
}

.pill:hover {
  border: 1px solid #7ee1ee;
  color: #ffffff;
  cursor: pointer;
  background-color: #124c5f;
}

.pill.active {
  border: 1px solid #7ee1ee;
  color: #ffffff;
  background-color: #124c5f;
}

.pill.small {
  padding: 8px 12px 8px 12px;
  border-radius: 20px;
}

.rounded {
  border-radius: 8px;
}

.label {
  font-weight: 600;
  font-size: 14px;
}


/* Global main input style */
.input-main {
  padding: 12px 12px;
  border: 1px solid #124c5f26;
  color: #124c5f;
  font-size: 14px;
  border-radius: 12px;
  background-color: transparent;
  margin-bottom: 10px;
  width: 100%;
  box-sizing: border-box;
}

.input-main:focus {
  outline: none;
  border-color: #3c5b6f;
  box-shadow: 0 0 0 3px rgba(60, 91, 111, 0.1);
  background-color: rgba(255, 255, 255, 0.05);
}

.input-main:active {
  border-color: #2a4a5a;
  box-shadow: 0 0 0 2px rgba(42, 74, 90, 0.15);
}

.input-main:hover {
  border-color: #3c5b6f;
  background-color: rgba(255, 255, 255, 0.02);
}

/* Autosuggest box styling */
/* Global main input style */
.input-autosuggest {
  min-width: 270px;
  padding: 12px 12px;
  border: 1px solid #124c5f26;
  font-size: 14px;
  color: #124c5f;
  border-radius: 8px;
  background-color: transparent;
  color: #124c5f;
}

.input-autosuggest:focus {
  outline: none;
  border-color: #3c5b6f;
  box-shadow: 0 0 0 3px rgba(60, 91, 111, 0.1);
  background-color: rgba(255, 255, 255, 0.05);
}

.input-autosuggest:active {
  border-color: #2a4a5a;
  box-shadow: 0 0 0 2px rgba(42, 74, 90, 0.15);
}

.input-autosuggest:hover {
  border-color: #3c5b6f;
  background-color: rgba(255, 255, 255, 0.02);
}

/* Global dropdown/select option styles - matching autosuggest */
select {
  background-color: #cadfe4;
  color: #124c5f;
  border: 1px solid #124c5f26;
  border-radius: 12px;
  padding: 12px 12px;
  font-size: 14px;
  font-family: 'IBM Plex Sans', sans-serif;
  cursor: pointer;
}

select:focus {
  outline: none;
  border-color: #3c5b6f;
  box-shadow: 0 0 0 3px rgba(60, 91, 111, 0.1);
  background-color: rgba(255, 255, 255, 0.05);
}

select:hover {
  border-color: #3c5b6f;
  background-color: rgba(255, 255, 255, 0.02);
}

/* Select dropdown options - matching autosuggest item styles */
select option {
  background-color: #cadfe4;
  color: #124c5f;
  padding: 12px 15px;
  border: none;
  border-top: 1px solid #124c5f26;
  font-size: 14px;
  font-family: 'IBM Plex Sans', sans-serif;
}

select option:first-child {
  border-top: none;
}

select option:hover,
select option:checked,
select option:focus {
  background-color: #124c5f;
  color: #ffffff;
}

.rating-bar {
  display: flex;
  width: 100%;
  height: 40px;
  font-weight: bold;
  color: white;
  overflow: hidden;
}

.rating {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 12px;
  font-size: 16px;
  white-space: nowrap;
}

.rating span {
  margin-left: 10px;
  font-weight: bold;
  opacity: 0.8;
}

.buy {
  background-color: var(--wg-positive);
  /* LimeGreen */
  color: #ffffff;
}

.hold {
  background-color: #ececec;
  /* Light Gray */
  color: #000000;
}

.sell {
  background-color: var(--wg-negative);
  /* Deep Orange */
  color: #ffffff;
}

::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background-color: #124c5f;
}

/* Optional: Hide scrollbar buttons (arrows), usually unnecessary */
::-webkit-scrollbar-button {
  display: none;
}

/* Firefox support */
* {
  scrollbar-width: thin;
  scrollbar-color: #124c5f transparent;
}



@keyframes flashRed {
  from {
    background-color: #fa5e5e;
  }

  to {
    background-color: white;
  }
}

@keyframes flashGreen {
  from {
    background-color: #87fc87;
  }

  to {
    background-color: white;
  }
}

@keyframes tileScaleIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes tileScaleOut {
  from {
    opacity: 1;
    transform: scale(1);
  }

  to {
    opacity: 0;
    transform: scale(0.8);
  }
}

@keyframes tileCollapse {
  0% {
    opacity: 1;
    transform: scale(1);
    max-height: 400px;
    margin: 0;
    padding: 20px;
  }

  100% {
    opacity: 0;
    transform: scale(0.8);
    max-height: 0;
    margin: 0;
    padding: 0;
  }
}

/* News animation classes */
.news-enter {
  animation: newsFadeIn 0.5s ease-out forwards;
}

.news-exit {
  animation: newsFadeOut 0.3s ease-in forwards;
}

/* Staggered news animation - items start invisible and fade in with delay */
.news-item.news-enter {
  opacity: 0;
  animation: newsFadeIn 0.5s ease-out forwards;
}

@keyframes newsFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes newsFadeOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

.error-full {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
  color: #d32f2f;
  font-size: 18px;
  font-weight: bold;
  text-align: center;
  border: 1px solid #124c5f26;
  background-color: transparent;
  border-radius: 8px;
  margin: 20px;
}

#content-container {
  width: -webkit-fill-available;
}

/* Add padding-top to content container on mobile when search bar wraps */
@media (max-width: 820px) {
  .content-container {
    padding: 0px !important;
  }
}

/* --- STOCK LIST VIEW --- */
.stock-list-view {
  width: auto;
  padding: 5px;
  padding-top: 35px;
}

/* Sortable header row */
.stock-list-header {
  display: flex;
  align-items: center;
  padding: 5px 10px;
  font-size: 14px;
  font-weight: bold;
  color: #124c5f;
  background-color: transparent;
  border: none;
  gap: 0;
}

/* Sortable column headers */
.stock-list-header .stock-list-col {
  flex: 1;
  min-width: 0;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.2s ease;
}

/* Match column flex values with data rows */
.stock-list-header .stock-list-col.company {
  flex: 4;
}

.stock-list-header .stock-list-col.ticker {
  flex: 1.2;
}

.stock-list-header .stock-list-col.price {
  flex: 1.2;
  text-align: right;
}

.stock-list-header .stock-list-col.change {
  flex: 1.2;
  text-align: right;
}

.stock-list-header .stock-list-col.marketcap {
  flex: 1.2;
}

.stock-list-header .stock-list-col:hover {
  background-color: transparent;
}

.stock-list-header .stock-list-col.active {
  background-color: transparent;
  color: #2FA6E7;
}

/* Sort arrows */
.sort-arrow {
  display: inline-block;
  margin-left: 4px;
  font-size: 12px;
  transition: transform 0.2s ease;
}

.sort-arrow.asc::after {
  content: "▲";
}

.sort-arrow.desc::after {
  content: "▼";
}

.sort-arrow.inactive::after {
  content: "";
}

.stock-list-row {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  background-color: transparent;
  border: 1px solid #124c5f26;
  gap: 0;
}

.stock-list-row:hover {
  background-color: #c2dbe2;
  cursor: pointer;
  box-shadow: 0 0 4px rgba(0.1, 0.1, 0.1, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Disable row hover in list edit mode */
#stockList.edit-mode .stock-list-row:hover {
  background-color: transparent !important;
  cursor: default;
  box-shadow: none;
}

.stock-list-col {
  flex: 1;
  min-width: 0;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stock-list-col .ticker-tag {
  font-size: 14px;
  width: fit-content;
}

.stock-list-col.company {
  flex: 4;
}

.stock-list-col.ticker {
  flex: 1.2;
  text-align: left;
}

.stock-list-col.price {
  flex: 1.2;
  font-size: 14px;
  text-align: right;
  font-weight: bold;
}

.stock-list-col.change {
  flex: 1.2;
  text-align: right;
}

.stock-list-col.marketcap {
  flex: 1.2;
  text-align: left;
}

.stock-list-col.negative {
  color: var(--wg-negative);
}

.stock-list-col.positive {
  color: var(--wg-positive);
}

.highlight {
  background: #124c5f;
  color: #7ee1ee;
  /* or your preferred highlight */
  font-weight: bold;
}

@media (max-width: 480px) {
  body {
    padding: 10px;
    width: 100%;
    max-width: 100%;
  }

  .main-container {
    flex-direction: column;
    gap: 10px;
    height: auto;
    width: 95%;
    margin: 0 auto;
    max-width: none;
  }

  .panel {
    width: 100%;
    max-width: 100%;
    min-width: auto;
    position: static;
    max-height: none;
  }

  /* On mobile we want a single-column grid, but don't override JS "hide" toggles */
  #stockGrid:not([hidden]):not([style*="display:none"]):not([style*="display: none"]) {
    display: flex !important;
    overflow: auto;
    padding-bottom: 12px;
    grid-template-columns: 1fr !important;
    gap: 16px;
  }

  .price {
    font-size: 28px;
  }

  .price.list {
    font-size: 14px;
  }

  .stock-list-row {
    flex-direction: column;
    gap: 8px;
    padding: 15px;
  }

  .stock-list-col {
    text-align: center;
    font-size: 14px;
  }

  .stock-list-col.company {
    flex: none;
    order: -1;
  }

  .stock-list-col.ticker {
    flex: none;
  }

  .stock-list-col.price {
    flex: none;
  }

  .stock-list-col.change {
    flex: none;
  }

  .stock-list-col.marketcap {
    flex: none;
  }

  /* Hide sort header on mobile by default */
  .stock-list-header {
    display: none;
  }

  .stock-list-header.mobile-visible {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 15px;
  }

  /* Details page mobile styles */
  #details>div {
    flex-direction: column !important;
    gap: 20px !important;
  }

  #details>div>div {
    min-width: auto !important;
    max-width: 100% !important;
  }

  #details h2 {
    font-size: 24px !important;
  }

  #details .price {
    font-size: 28px !important;
  }

  #rangeButtons {
    flex-wrap: nowrap !important;
    display: flex !important;
    flex-direction: row !important;
    gap: 8px !important;
    overflow-x: hidden;
    padding-bottom: 5px;
    margin-right: 0 !important;
  }
  
  /* Override any flex-row wrap rules specifically for rangeButtons */
  #stock-chart-container #rangeButtons.flex-row,
  #details #rangeButtons.flex-row,
  #rangeButtons.flex-row {
    flex-wrap: nowrap !important;
    display: flex !important;
    flex-direction: row !important;
  }

  /* Hide 1Y and 5Y range buttons on mobile */
  #rangeButtons .range-btn-mobile-hide {
    display: none !important;
  }

  /* Hide 1M, 1Y, 5Y, and ALL range buttons on mobile */
  #rangeButtons .range-btn:nth-of-type(3),
  #rangeButtons .range-btn:nth-of-type(7),
  #rangeButtons .range-btn:nth-of-type(8),
  #rangeButtons .range-btn:nth-of-type(9) {
    display: none !important;
  }
  
  /* Hide compare button on mobile */
  #compare-btn {
    display: none !important;
  }

  /* Hide SMA/EMA/RSI toggle group on mobile — it overflows the row */
  #rangeButtons > div[style*="margin-left: auto"] {
    display: none !important;
  }

  /* Ensure range buttons don't overflow */
  #rangeButtons .range-btn {
    flex-shrink: 0;
    display: inline-block !important;
    width: auto !important;
    max-width: none !important;
    font-size: 12px;
    padding: 8px 12px;
    min-height: 36px;
  }

  #rangeButtons>div {
    flex-direction: flex;
    gap: 10px;
  }

  .info-block {
    grid-template-columns: 1fr !important;
  }

  /* Header mobile styles */
  .main-container>div:first-child {
    flex-direction: column;
    gap: 20px;
  }

  #actionbar {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
  }

  #addTickerInput {
    width: 100%;
    max-width: 100%;
  }

  /* Additional mobile improvements */
  .grid {
    display: none;
    grid-template-columns: 1fr !important;
    gap: 10px;
    padding: 5px;
    margin: 1px;
  }

  /* Details page: consistent vertical spacing between sections on mobile */
  #analystRatingsContainer,
  #earningsContainer,
  #relatedStocks,
  #relatedlists-grid,
  #discussions {
    margin-bottom: 24px !important;
  }

  #details h2 {
    margin-bottom: 8px !important;
  }

  /* Related stocks: use table view on small phones, hide desktop grid */
  #relatedStocks .related-grid-desktop {
    display: none !important;
  }

  #relatedStocksTableWrapper {
    display: block !important;
  }

  /* Discussions composer - ensure buttons stay within container on mobile,
     while keeping POST button right-aligned */

  #newPostForm > div:last-child {
    flex-wrap: wrap;
    gap: 8px;
  }

  #newPostForm #postButton.discussion-post-btn,
  #newPostForm .discussion-post-btn {
    margin-left: auto;
    max-width: 140px;
  }

  /* Fix for lastchild-grid layout on mobile */
  .lastchild-grid {
    grid-template-columns: 1fr !important;
    gap: 30px !important;
    margin-bottom: 0 !important;
  }

  .news-item {
    opacity: 0;
    font-size: 14px;
    line-height: 1.4;
  }

  .news-item a {
    word-break: break-word;
  }

  /* Fix for details page chart container */
  #chartContainer {
    height: 300px !important;
  }

  /* Fix chart component overflow on mobile */
  #stock-chart-container {
    width: 100% !important;
    max-width: 100% !important;
    padding: 8px !important;
    margin-bottom: 15px !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    border-radius: 12px !important;
  }

  /* Fix chart header info on mobile */
  #stock-chart-container .flex-row {
    flex-wrap: wrap !important;
    gap: 8px !important;
  }
  
  /* Exception: rangeButtons must stay horizontal */
  #stock-chart-container #rangeButtons.flex-row,
  #rangeButtons.flex-row {
    flex-wrap: nowrap !important;
    display: flex !important;
    flex-direction: row !important;
  }

  #stock-chart-container #logo {
    width: 35px !important;
    height: 35px !important;
  }

  #stock-chart-container h1 {
    font-size: 1rem !important;
  }

  #stock-chart-container #ticker {
    font-size: 0.875rem !important;
  }

  #stock-chart-container .price {
    font-size: 1rem !important;
  }

  #stock-chart-container .percent {
    font-size: 14px !important;
  }

  /* Hide vertical divider on mobile */
  #stock-chart-container > .flex-row > div[style*="width: 1px"] {
    display: none !important;
  }

  /* Fix expand button position */
  #stock-chart-container .flex-row[style*="margin-left: auto"] {
    margin-left: 0 !important;
    flex-basis: auto !important;
  }

  /* Fix About section header on mobile */
  #about-title {
    font-size: 1.25rem !important;
  }

  .panel2 .flex-row {
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  /* Fix compare button area */
  .panel2 .flex-row[style*="margin-left: auto"] {
    margin-left: 0 !important;
    width: 100% !important;
    justify-content: flex-start !important;
  }

  /* Fix compare input */
  #compareTickerInput {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Compare button */
  #compare-btn {
    font-size: 12px !important;
    padding: 6px 12px !important;
  }

  /* Fix range buttons container on mobile */
  #rangeButtons {
    margin-top: 8px !important;
    height: auto !important;
    min-height: 36px;
    flex-wrap: nowrap !important;
    display: flex !important;
    flex-direction: row !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
  }

  /* Ensure action buttons fit on mobile */
  #rangeButtons .icon-btn {
    width: 28px !important;
    height: 28px !important;
    flex-shrink: 0;
  }

  #rangeButtons .icon-btn img {
    width: 20px !important;
    height: 20px !important;
  }

  /* Fix content container overflow */
  .content-container {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Fix main element overflow */
  main {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Fix body overflow – use clip instead of hidden so position:sticky
     on cds-header is not broken (hidden creates a scroll container). */
  body {
    overflow-x: clip !important;
    width: 100% !important;
    max-width: 100vw !important;
  }

  /* Fix html element overflow – same clip rationale as body above */
  html {
    overflow-x: clip !important;
    width: 100% !important;
    max-width: 100vw !important;
  }

  /* Force all flex items with inline min-width to be responsive */
  [style*="min-width: 500px"],
  [style*="min-width:500px"],
  [style*="min-width: 450px"],
  [style*="min-width:450px"] {
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Force flex: 1 1 0% items to be 100% width on mobile */
  [style*="flex: 1 1 0%"] {
    flex: 1 1 100% !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  /* Fix details flex layout on mobile */
  #details {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    display: block !important;
  }

  #details > .flex-row {
    width: 100% !important;
    max-width: 100% !important;
    flex-wrap: wrap !important;
    gap: 20px !important;
  }

  #details .flex-row {
    width: 100% !important;
    max-width: 100% !important;
    flex-wrap: wrap !important;
  }

  /* Override ALL min-width on mobile for details page children */
  #details > .flex-row > div,
  #details .flex-row > div {
    min-width: 0 !important;
    min-width: unset !important;
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 100% !important;
    box-sizing: border-box !important;
  }

  /* Force override inline min-width styles */
  #details [style*="min-width"] {
    min-width: 0 !important;
  }

  /* Target specific problematic divs with inline min-width */
  #details > .flex-row > div[style*="min-width: 500px"],
  #details > .flex-row > div[style*="min-width:500px"],
  #details > .flex-row > div[style*="min-width: 450px"],
  #details > .flex-row > div[style*="min-width:450px"] {
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 100% !important;
  }

  /* Fix panel2 overflow */
  .panel2 {
    width: 100% !important;
    max-width: 100% !important;
    padding: 10px !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }

  /* Override large bottom margins on specific panel2 sections for mobile */
  .panel2[style*="margin-bottom: 50px"] {
    margin-bottom: 20px !important;
  }

  /* Fix grid layouts on mobile */
  .info-block {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Fix lastchild-grid on mobile */
  .lastchild-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 20px !important;
    margin-bottom: 0 !important;
    width: 100% !important;
  }

  .lastchild-grid > div {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Fix all grid layouts on mobile */
  [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
  
  /* About and Stats sections: use 2 columns on mobile for better space utilization */
  .panel2 .flex-col > div[style*="grid-template-columns"],
  .panel2 .flex-col > div[style*="display: grid"],
  #statsContainer > div[style*="grid-template-columns"],
  #statsContainer > div[style*="display: grid"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }
  
  /* Ensure info-blocks in these grids don't take full width */
  .panel2 .flex-col > div[style*="grid-template-columns"] .info-block,
  #statsContainer > div[style*="grid-template-columns"] .info-block {
    width: auto !important;
    max-width: none !important;
  }

  /* Fix gap-50 on mobile */
  .gap-50 {
    gap: 20px !important;
  }

  /* Fix chart containers */
  #ratingDonutContainer,
  #earningsChartContainer {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Fix canvas elements */
  canvas {
    max-width: 100% !important;
    height: auto !important;
  }

  /* Fix discussions section */
  #discussions {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Fix news feed */
  #newsFeedDetails,
  #newsContentDetails {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Fix related stocks */
  #relatedStocks,
  #relatedGrid {
    width: 100% !important;
    max-width: 100% !important;
  }

  #relatedGrid {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  #relatedGrid cds-tile {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Fix related lists */
  #relatedlists-grid,
  #relatedListsGrid {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Fix stats container */
  #statsContainer {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Ensure all divs inside details respect container width */
  #details * {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Better touch targets */
  .range-btn {
    min-height: 44px;
    padding: 12px 16px;
  }

  .stocks-list-item {
    min-height: 44px;
    padding: 15px 10px;
  }

  .stocks-list-item .icon-btn {
    opacity: 1;
    padding: 6px 6px;
    font-size: 14px;
  }

  /* Fix for flex layouts on mobile */
  .main-container>div {
    flex: 1 1 auto;
  }
}

/* Ensure related stocks only use one layout (table) on all mobile and tablet widths
   This matches the JS breakpoint (max-width: 820px) used to toggle the table wrapper. */
@media (max-width: 820px) {
  #relatedStocks .related-grid-desktop {
    display: none !important;
  }

  #relatedStocksTableWrapper {
    display: block !important;
  }
}

/* Medium screen adjustments */
@media (max-width: 1024px) {
  .main-container {
    width: 90%;
    max-width: 1200px;
  }
}

/* Small tablet adjustments */
@media (max-width: 768px) {
  .main-container {
    width: 100%;
    max-width: none;
    height: auto;
    gap: 16px;
    flex-direction: column;
    padding: 0 12px;
  }

  .panel,
  .panel2 {
    width: 100%;
    min-width: 0;
    max-height: none;
    position: static;
    top: auto;
  }

  /* Details page tablet optimizations */
  #details {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  #details > .flex-row > div {
    min-width: 0 !important;
  }

  #details .flex-row {
    flex-wrap: wrap !important;
    width: 100% !important;
  }

  /* Chart component tablet optimizations */
  #stock-chart-container {
    padding: 10px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  #rangeButtons {
    flex-wrap: nowrap !important;
    display: flex !important;
    flex-direction: row !important;
    gap: 8px !important;
    overflow-x: hidden;
  }
  
  /* Override any flex-row wrap rules specifically for rangeButtons */
  #stock-chart-container #rangeButtons.flex-row,
  #details #rangeButtons.flex-row,
  #rangeButtons.flex-row {
    flex-wrap: nowrap !important;
    display: flex !important;
    flex-direction: row !important;
  }

  /* Override inline min-width on tablet */
  #details [style*="min-width: 500px"],
  #details [style*="min-width:500px"],
  #details [style*="min-width: 450px"],
  #details [style*="min-width:450px"] {
    min-width: 0 !important;
    width: 100% !important;
  }

  /* Fix lastchild-grid on tablet */
  .lastchild-grid {
    grid-template-columns: 1fr !important;
  }

  /* Fix all panels on tablet */
  .panel2 {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Hide 1M, 1Y, 5Y, and ALL on tablet too */
  #rangeButtons .range-btn-mobile-hide {
    display: none !important;
  }
  
  #rangeButtons .range-btn:nth-of-type(3),
  #rangeButtons .range-btn:nth-of-type(9) {
    display: none !important;
  }
  
  /* Hide compare button on tablet */
  #compare-btn {
    display: none !important;
  }

  /* Hide SMA/EMA/RSI toggle group on tablet — it overflows the row */
  #rangeButtons > div[style*="margin-left: auto"] {
    display: none !important;
  }
}

/* Flex row for header and containers */
.header-bar {
  display: flex;
  gap: 50px;
  align-items: center;
  position: fixed;
  left: 20px;
  right: 20px;
  z-index: 1000;
  background-color: #cadfe4;
}

#actionbar {
  display: flex;
  align-items: center;
}

.flex-row {
  display: flex;
}

.gap-10 {
  gap: 10px;
}

.gap-20 {
  gap: 20px;
}

.gap-24 {
  gap: 24px;
}

.gap-50 {
  gap: 50px;
}

.bg-primary {
  background: #124c5f;
}

.bg-transparent {
  background-color: transparent;
}

.text-primary {
  color: #124c5f;
}

.text-white {
  color: #fff;
}

.message {
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 0.9em;
}

.message.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.message.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* Notification System Styles */
.notification-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  min-width: 500px;
  pointer-events: none;
  overflow: hidden;
}

.notification {
  background-color: #ffffff4f;
  border: 1px solid #124c5f26;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  font-size: 0.9em;
  line-height: 1.4;
  color: #124c5f;
  pointer-events: auto;
  cursor: pointer;
  transition: all 0.3s ease;
  transform-origin: top right;
  will-change: transform, opacity;
  position: relative;
  overflow: hidden;
}

.notification:hover {
  background-color: #c2dbe2;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.notification.success {
  border-left: 4px solid var(--wg-positive);
  background-color: #d4edda;
  color: #155724;
}

.notification.error {
  border-left: 4px solid var(--wg-negative);
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.notification.warning {
  border-left: 4px solid #ffc107;
  background-color: #fff3cd;
  color: #856404;
}

.notification.info {
  border-left: 4px solid #124c5f;
  background-color: #d1ecf1;
  color: #0c5460;
}

.notification-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.notification-title {
  font-weight: bold;
  font-size: 1em;
  margin: 0;
}

.notification-close {
  background: none;
  border: none;
  color: inherit;
  font-size: 1.2em;
  cursor: pointer;
  padding: 0;
  margin-left: 10px;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.notification-close:hover {
  opacity: 1;
}

.notification-message {
  margin: 0;
  word-wrap: break-word;
}

.notification-enter {
  animation: notificationSlideIn 0.3s ease-out;
}

.notification-exit {
  animation: notificationSlideOut 0.3s ease-in;
}

@keyframes notificationSlideIn {
  from {
    transform: translateY(-120px) scale(0.8);
    opacity: 0;
  }

  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes notificationSlideOut {
  from {
    transform: translateY(0) scale(1);
    opacity: 1;
  }

  to {
    transform: translateY(-120px) scale(0.8);
    opacity: 0;
  }
}

/* Mobile responsive notifications */
@media (max-width: 480px) {
  .notification-container {
    top: 10px;
    left: 10px;
    right: 10px;
    transform: none;
    max-width: none;
    min-width: 0;
    width: calc(100vw - 20px);
  }

  .notification {
    padding: 12px 16px;
    font-size: 0.85em;
  }

  .notification:hover {
    transform: none;
  }

  .header-bar {
    gap: 12px;
    left: 8px;
    right: 8px;
  }

  .main-container {
    width: 100%;
    max-width: none;
    gap: 12px;
    padding: 56px 8px 12px;
  }

  .panel,
  .panel2 {
    width: 100%;
    min-width: 0;
    max-height: none;
    position: static;
    top: auto;
  }

  .input-autosuggest {
    min-width: 0;
    width: 100%;
  }
}

/* Panel Notifications Styles */
.notifications-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.notifications-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #124c5f26;
}

.notifications-header h3 {
  color: var(--cds-text-primary, #124c5f);
}

body.cds-theme--g100 .notifications-header h3 {
  color: #ffffff;
}

body.cds-theme--g100 .notifications-header {
  border-bottom-color: rgba(255, 255, 255, 0.15);
}

.clear-notifications-btn:hover {
  background: #3c5b6f !important;
}

.notifications-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.panel-notification {
  background-color: #ffffff4f;
  border: 1px solid #124c5f26;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
  font-size: 0.8em;
  color: var(--cds-text-primary, #124c5f);
  transition: all 0.2s ease;
  animation: panelNotificationSlideIn 0.3s ease-out;
}

.panel-notification.success {
  border-left: 3px solid var(--wg-positive);
  background-color: #d4edda;
  color: #155724;
}

.panel-notification.error {
  border-left: 3px solid var(--wg-negative);
  background-color: #f8d7da;
  color: #721c24;
}

.panel-notification.warning {
  border-left: 3px solid #ffc107;
  background-color: #fff3cd;
  color: #856404;
}

.panel-notification.info {
  border-left: 3px solid #124c5f;
  background-color: #d1ecf1;
  color: #0c5460;
}

/* Hover: intensify border color to match the left accent; border-color only so widths stay intact */
.panel-notification:hover          { border-color: #124c5f; }
.panel-notification.success:hover  { border-color: var(--wg-positive); }
.panel-notification.error:hover    { border-color: var(--wg-negative); }
.panel-notification.warning:hover  { border-color: #ffc107; }
.panel-notification.info:hover     { border-color: #124c5f; }

.panel-notification-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.panel-notification-content {
  flex: 1;
}

.panel-notification-title {
  font-weight: 300;
  font-size: 0.9em;
  margin-bottom: 4px;
}

.panel-notification-message {
  margin-bottom: 4px;
  word-wrap: break-word;
}

.panel-notification-time {
  font-size: 0.75em;
  opacity: 0.7;
  color: inherit;
}

.panel-notification-close {
  background: none;
  border: none;
  color: inherit;
  font-size: 1.1em;
  cursor: pointer;
  padding: 0;
  opacity: 0.7;
  transition: opacity 0.2s ease;
  flex-shrink: 0;
}

/* ── Social notification actor row ─────────────────────────────────────────── */

/* Flex row that places the .avatar_xs circle + name + action inline */
.notif-social-inline {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ── End social notification actor row ─────────────────────────────────────── */

.panel-notification-close:hover {
  opacity: 1;
}

@keyframes panelNotificationSlideIn {
  from {
    transform: translateX(-20px);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Dark theme: ensure notification label text inherits from the notification's own color */
body.cds-theme--g100 .notification .notification-message,
body.cds-theme--g100 .notification .notification-title {
  color: inherit;
}

body.cds-theme--g100 .panel-notification .panel-notification-message,
body.cds-theme--g100 .panel-notification .panel-notification-title {
  color: inherit;
}

/* Standard inline link for all text links inside any notification (actor name, content, list name) */
.notif-link {
  font-weight: 700;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.notif-link:hover {
  opacity: 0.75;
  text-decoration: none;
}

/* Ticker tag pills: one implementation; beats global body a / a:hover (carbon-styles) */
span.ticker-tag,
a.ticker-tag,
a.ticker-tag:visited {
  background-color: #124c5f;
  color: #ffffff;
  text-decoration: none;
  border-radius: 4px;
  font-weight: bold;
  display: inline-block;
  padding: 2px 6px;
  font-size: 11px;
  margin-right: 6px;
}

body.cds-theme--g10 span.ticker-tag,
body.cds-theme--g100 span.ticker-tag,
body.cds-theme--g10 a.ticker-tag,
body.cds-theme--g10 a.ticker-tag:visited,
body.cds-theme--g100 a.ticker-tag,
body.cds-theme--g100 a.ticker-tag:visited {
  background-color: #124c5f;
  color: #ffffff;
  text-decoration: none;
  border-radius: 4px;
  font-weight: bold;
  display: inline-block;
  padding: 2px 6px;
  font-size: 11px;
  margin-right: 6px;
}

body.cds-theme--g10 a.ticker-tag:hover,
body.cds-theme--g10 a.ticker-tag:focus-visible,
body.cds-theme--g100 a.ticker-tag:hover,
body.cds-theme--g100 a.ticker-tag:focus-visible {
  color: #ffffff;
  text-decoration: none;
}

.notification .ticker-tag,
.panel-notification .ticker-tag {
  padding: 1px 5px;
  font-size: 0.85em;
}

/* Notification Badge Styles */
.notification-badge {
  position: absolute;
  top: -15px;
  right: -15px;
  background: #124c5f;
  color: white;
  font-size: 11px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #cadfe4;
  animation: badgePulse 0.3s ease-out;
  z-index: 10;
}

@keyframes badgePulse {
  0% {
    transform: scale(0);
    opacity: 0;
  }

  50% {
    transform: scale(1.2);
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Make tab buttons relative positioned to contain the badge */
.tab-btn {
  position: relative;
}

/* Generic tab count badge, driven by data-count */
.tab-btn[data-count]::after {
  content: attr(data-count);
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  min-width: 18px;
  padding: 0 6px;
  height: 18px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
  background-color: rgba(18, 76, 95, 0.12);
  color: #124c5f;
  border: 1px solid rgba(18, 76, 95, 0.35);
  box-sizing: border-box;
}

.tab-btn.active[data-count]::after {
  background-color: #ffffff;
  color: #124c5f;
  border-color: transparent;
}

/* Dark theme tab count contrast */
body.cds-theme--g100 .tab-btn[data-count]::after {
  background-color: rgba(255, 255, 255, 0.08);
  color: #f4f4f4;
  border-color: rgba(255, 255, 255, 0.25);
}

body.cds-theme--g100 .tab-btn.active[data-count]::after {
  background-color: #f4f4f4;
  color: #124c5f;
  border-color: transparent;
}

/* AI Assistant Styles */
#ai-assistant-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 10000;
}

.ai-toggle-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #ffffff44;
  border: none;
  color: #124c5f;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(18, 76, 95, 0.3);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.ai-toggle-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(18, 76, 95, 0.4);
}

.ai-toggle-btn.ai-toggle-active {
  background: linear-gradient(135deg, #3c5b6f, #124c5f);
}

.ai-toggle-btn-container {
  position: fixed;
  right: 5px;
  bottom: 10px;
  z-index: 10000;
  display: inline-block;
  overflow: visible;
}

.ai-badge {
  position: absolute;
  bottom: 0;
  right: 0;
  background: #136913;
  color: white;
  font-size: 12px;
  border: 1px solid white;
  font-weight: bold;
  padding: 2px 4px;
  border-radius: 8px;
  min-width: 16px;
  text-align: center;
  pointer-events: none;
}

.ai-chat-panel {
  position: absolute;

  right: 10px;
  width: 400px;
  height: 85vh;
  background: transparent;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  width: 0;
  min-width: 0;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    opacity 0.3s ease-out,
    visibility 0.3s ease-out,
    width 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  overflow: hidden;

}

/* Chat tab fills remaining sidebar height so bottom panel stays pinned */
#chat-tab.tab-content.active {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* Notifications tab: flex chain so the list fills panel height (not capped by vh) */
#notifications-tab.tab-content.active {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

#notifications-tab.tab-content.active .placeholder-content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

/* Special styles for AI chat panel in tab context */
#chat-tab .ai-chat-panel {
  position: relative !important;
  width: 100% !important;
  height: 100% !important;
  flex: 1 !important;
  min-height: 0 !important;
  right: auto !important;
  left: auto !important;
  top: auto !important;
  bottom: auto !important;
  opacity: 1 !important;
  visibility: visible !important;
  min-width: 100% !important;
  box-shadow: none !important;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: white;
  margin: 0;
  padding: 0;
}

/* Bottom input + suggestions pinned at bottom of chat panel */
.ai-chat-bottom-fixed {
  flex-shrink: 0;
}

#chat-tab .ai-chat-panel.ai-panel-open {
  width: 100% !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.ai-chat-panel.ai-panel-open {
  opacity: 1;
  visibility: visible;
  width: 400px;
}

.ai-chat-panel.docked-left {
  left: 0 !important;
  right: auto !important;
  box-shadow: 0 4px 24px rgba(18, 76, 95, 0.18), 2px 0 0 #124c5f;
  position: relative !important;
  width: 100% !important;
  height: 100% !important;
  bottom: auto !important;
  top: auto !important;
}

.ai-chat-panel.docked-right {
  right: 0 !important;
  left: auto !important;
  box-shadow: 0 4px 24px rgba(18, 76, 95, 0.18), -2px 0 0 #124c5f;
  position: relative !important;
  width: 100% !important;
  height: 100% !important;
  bottom: auto !important;
  top: auto !important;
}

/* Loading spinner for send button */
.loading-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Dock container styles */
#ai-assistant-dock-left,
#ai-assistant-dock-right {
  position: relative;
  overflow-y: hidden;
  width: 400px;
  height: 70vh;
  display: none;
}

#ai-assistant-dock-left {
  order: -1;
}

#ai-assistant-dock-right {
  order: 1;
  /* Sticky positioning for details page */
  position: sticky;
  top: 120px;
  height: fit-content;
  max-height: calc(100vh - 120px);
  overflow-y: hidden;
}

/* Mobile responsive adjustments for AI assistant dock */
@media (max-width: 768px) {
  #ai-assistant-dock-right {
    position: relative;
    top: auto;
    max-height: none;
    width: 100%;
    margin-top: 20px;
  }
}


/* Optional: visual cue while dragging near edge */
.ai-chat-panel.docking-left {
  box-shadow: 0 0 0 4px #7ee1eeaf, 0 4px 24px rgba(18, 76, 95, 0.18);
}

.ai-chat-panel.docking-right {
  box-shadow: 0 0 0 4px #7ee1eeaf, 0 4px 24px rgba(18, 76, 95, 0.18);
}

.ai-chat-header {
  position: relative;
  box-sizing: border-box;
  padding: 16px 16px;
  background: #124c5f;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 12px 12px 0 0;
}

.ai-header-info h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.ai-ticker-badge {
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  margin-top: 4px;
  display: inline-block;
}

.ai-close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s;
}

.ai-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.ai-chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: block;

  gap: 12px;
  background: #ffffffb2;
}

.ai-message {
  display: flex;
  margin-bottom: 12px;
}

.ai-user-message {
  justify-content: flex-end;
}

.ai-assistant-message {
  justify-content: flex-start;
}

.ai-message-content {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  border: 1px solid #778083;
  word-wrap: break-word;
}

.ai-user-message .ai-message-content {
  background: #124c5f;
  color: white;
  border-bottom-right-radius: 4px;
}

.ai-assistant-message .ai-message-content {
  background: #dff2f8;
  border-top-left-radius: 0px;
  border: 1px solid #124c5f26;
  padding-top: 10px;
}

.ai-assistant-message .ai-message-content p {
  margin: 0 0 12px 0;
}

.ai-assistant-message .ai-message-content p:last-child {
  margin-bottom: 0;
}

.ai-message-content.ai-error {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fecaca;
}

.ai-message-content .ticker-tag {
  padding: 0 4px;
  font-size: 10px;
}

.ai-loading {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-typing-indicator {
  display: flex;
  gap: 2px;
}

.ai-typing-indicator span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #64748b;
  animation: ai-typing 1.4s infinite ease-in-out;
}

.ai-typing-indicator span:nth-child(1) {
  animation-delay: -0.32s;
}

.ai-typing-indicator span:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes ai-typing {

  0%,
  80%,
  100% {
    transform: scale(0.8);
    opacity: 0.5;
  }

  40% {
    transform: scale(1);
    opacity: 1;
  }
}

.ai-chat-input-container {
  padding: 16px;
  border-top: 1px solid #e2e8f0;
  background: white;
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.ai-chat-input {
  flex: 1;
  border: 1px solid #d1d5db;
  font-family: inherit;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 14px;
  resize: auto;
  outline: none;
  transition: border-color 0.2s;
}

.ai-chat-input:focus {
  border-color: #124c5f26;
}

.ai-send-btn {
  background: #ffffff;
  border: 1px solid #124c5f26;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #124c5f;
  transition: all 0.2s;
  flex-shrink: 0;
}

.ai-send-btn:hover:not(:disabled) {
  background: #f3fafc;
  transform: translateY(-1px);
}

.ai-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ai-send-btn.ai-loading {
  animation: ai-spin 1s linear infinite;
}

@keyframes ai-spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.ai-suggestions {
  padding: 12px 16px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ai-suggestion-btn {
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  color: #374151;
}

.ai-suggestion-btn:hover {
  background: #124c5f;
  color: white;
  border-color: #124c5f;
}

.timestamp-text {
  font-size: 0.875rem;
  margin: 0;
}

/* Mobile responsiveness for AI Assistant */
@media (max-width: 480px) {
  .ai-chat-panel {
    width: 350px;
    height: 500px;
    bottom: 70px;
    right: -10px;
  }

  .ai-toggle-btn {
    width: 50px;
    height: 50px;
  }
}

@media (max-width: 480px) {
  #ai-assistant-container {
    bottom: 10px;
    right: 10px;
  }

  .ai-chat-panel {
    width: calc(100vw - 20px);
    height: 70vh;
    bottom: 60px;
    right: -10px;
  }

  .context-menu {
    min-width: 100px !important;
    font-size: 13px !important;
  }

  .context-menu-item {
    padding: 10px 12px !important;
  }
}

/* Price flash animation */
.price-flash {
  animation: priceFlash 1s ease-out;
}

.price-flash-down {
  animation: priceFlash_down 1s ease-out;
}

@keyframes priceFlash {
  0% {
    color: var(--wg-positive);
  }

  50% {
    color: var(--wg-positive);
  }

  100% {
    color: inherit;
  }
}

@keyframes priceFlash_down {
  0% {
    color: var(--wg-negative);
  }

  50% {
    color: var(--wg-negative);
  }

  100% {
    color: inherit;
  }
}

/* ===== MODAL SYSTEM ===== */
/* Base modal overlay */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  transition: opacity 0.3s ease;
}

.modal.show {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  opacity: 1;
}

/* Modal content container */
.modal-content {
  background-color: #cadfe4;
  margin: 0 auto;
  padding: 20px;
  border-radius: 8px;
  width: 300px;
  max-width: 90vw;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  border: 1px solid #124c5f26;
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px) scale(0.9);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Modal header */
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid #124c5f26;
}

.modal-title {
  font-size: 1.2em;
  font-weight: bold;
  color: #124c5f;
  margin: 0;
}

/* Close button */
.close {
  font-size: 28px;
  cursor: pointer;
  color: #124c5f;
  background: none;
  border: none;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.close:hover {
  color: #124c5f;
  background-color: rgba(18, 76, 95, 0.1);
}

.li {
  padding: 12px 12px;
  cursor: pointer;
}

.li:hover {
  background-color: #124c5f26;
}

/* Modal body */
.modal-body {
  color: #124c5f;
}

/* Modal footer */
.modal-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: right;
}

/* Modal buttons */
.modal-btn {
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9em;
  border: none;
  transition: all 0.2s ease;
  font-weight: 500;
  min-width: 80px;
}

.modal-btn.primary {
  background: #124c5f;
  color: white;
}

.modal-btn.primary:hover {
  background: #0e3a47;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(18, 76, 95, 0.3);
}

.modal-btn.secondary {
  background: transparent;
  color: #124c5f;
  border: 1px solid #124c5f;
}

.modal-btn.secondary:hover {
  background: #124c5f;
  color: white;
  transform: translateY(-1px);
}

.modal-btn.danger {
  background: #dc3545;
  color: white;
}

.modal-btn.danger:hover {
  background: #c82333;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.modal-btn.danger-outline {
  background: transparent;
  color: #dc3545;
  border: 1px solid #dc3545;
}

.modal-btn.danger-outline:hover {
  background: #dc3545;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

/* Vertical divider in modal footer — alias of .inline-action-divider (carbon-styles.css) */
.modal-footer-divider {
  width: 1px;
  height: 24px;
  background: var(--cds-border-strong, #124c5f);
  opacity: 0.35;
  flex-shrink: 0;
}

/* Modal input styles */
.modal input[type="text"],
.modal input[type="email"],
.modal input[type="password"],
.modal textarea {
  width: 100%;
  padding: 12px 12px;
  border: 1px solid #124c5f26;
  border-radius: 8px;
  font-size: 14px;
  background-color: transparent;
  color: #124c5f;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
}

.modal input[type="text"]:focus,
.modal input[type="email"]:focus,
.modal input[type="password"]:focus,
.modal textarea:focus {
  outline: none;
  box-shadow: 0 0 0 2px #124c5f;
}

/* Modal label styles */
.modal label {
  display: block;
  margin-bottom: 5px;
  color: #124c5f;
  font-size: 16px;
}

/* Modal form group */
.modal-form-group {
  margin-bottom: 15px;
}

/* Modal variants */
.modal.modal-large .modal-content {
  width: 600px;
  max-width: 95vw;
}

.modal.modal-small .modal-content {
  width: 250px;
}

.modal.modal-wide .modal-content {
  width: 600px;
  max-width: 95vw;
}

/* Portfolio modal specific styles */
.modal#portfolioEditModal .modal-content {
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  margin: 5% auto;
}

.modal#portfolioEditModal .modal-footer {
  flex-shrink: 0;
  margin-top: auto;
}

/* Modal with custom positioning */
.modal.modal-top .modal-content {
  margin: 5% auto;
}

.modal.modal-bottom .modal-content {
  margin: auto auto 5% auto;
}

/* Modal animations */
.modal.modal-fade-in {
  animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal.modal-slide-up .modal-content {
  animation: modalSlideUp 0.3s ease-out;
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Modal backdrop click to close */
.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  cursor: pointer;
}

/* Modal loading state */
.modal-loading .modal-content {
  opacity: 0.7;
  pointer-events: none;
}

.modal-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #124c5f;
  border-radius: 50%;
  animation: modalSpin 1s linear infinite;
  z-index: 1001;
}

@keyframes modalSpin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Mobile responsive modals */
@media (max-width: 480px) {
  .modal.show {
    padding-top: 80px;
  }

  .modal-content {
    width: 95vw;
    margin: 0 auto;
    padding: 15px;
  }

  .modal-header {
    margin-bottom: 15px;
  }

  .modal-title {
    font-size: 1.1em;
  }

  .modal-footer {
    flex-direction: column;
    gap: 8px;
  }

  .modal-btn {
    width: 100%;
    padding: 12px 16px;
    font-size: 1em;
  }

  .modal.modal-large .modal-content,
  .modal.modal-wide .modal-content {
    width: 95vw;
    margin: 0 auto;
  }

  /* Portfolio modal mobile adjustments */
  .modal#portfolioEditModal .modal-content {
    max-height: 85vh;
    margin: 0 auto;
  }
}

/* Tablet-sized mobile modals */
@media (min-width: 481px) and (max-width: 768px) {
  .modal.show {
    padding-top: 100px;
  }

  .modal-content {
    margin: 0 auto;
  }
}

/* Modal accessibility */
.modal:focus {
  outline: none;
}

.modal-content:focus {
  outline: none;
}

/* Modal keyboard navigation */
.modal[tabindex="-1"]:focus {
  outline: none;
}

/* Modal screen reader support */
.modal[aria-hidden="true"] {
  display: none;
}

/* Modal stacking for multiple modals */
.modal.modal-stack-1 {
  z-index: 1000;
}

.modal.modal-stack-2 {
  z-index: 1001;
}

.modal.modal-stack-3 {
  z-index: 1002;
}

.discussion-post .post-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.discussion-post .user-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Updated to use avatar_small class */
.discussion-post .profile-circle,
.discussion-post .profile-circle-clickable {
  width: 32px;
  height: 32px;
  background-color: #124c5f;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 14px;
  cursor: pointer;
  transition: opacity 0.2s ease;
  aspect-ratio: 1 / 1;
}

.discussion-post .profile-circle:hover,
.discussion-post .profile-circle-clickable:hover {
  opacity: 0.8;
}

/* Hide scrollbar utility */
.no-scrollbar {
  scrollbar-width: none;
}
.no-scrollbar::-webkit-scrollbar {
  display: none;
}

/* Clickable user names and @username handles in discussion posts */
.discussion-post .user-name-clickable,
.discussion-post .username-clickable {
  transition: opacity 0.2s ease;
}

.discussion-post .user-name-clickable:hover {
  opacity: 0.8;
}

.discussion-post .username-clickable:hover {
  opacity: 0.6;
}

.discussion-post .user-name {
  font-weight: bold;
  color: #124c5f;
  font-size: 14px;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.discussion-post .user-name:hover {
  opacity: 0.8;
}

.discussion-post .post-time {
  font-size: 12px;
  opacity: 0.8;
}

.discussion-post .username {
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.discussion-post .username:hover {
  opacity: 0.6;
}

.discussion-post .post-content {
  line-height: 1.5;
  font-size: 14px;
  margin-bottom: 12px;
}

.discussion-post .post-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
}

/* Trending Discussions (home) + groups mock grid: same tile/footer rules */
#trending-discussions-content,
.groups-trending-mock {
  align-items: stretch;
  grid-auto-rows: minmax(min-content, 1fr);
}
#trending-discussions-content > cds-tile,
#trending-discussions-content > .discussion-post,
.groups-trending-mock > cds-tile,
.groups-trending-mock > .discussion-post {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
#trending-discussions-content .post-content,
.groups-trending-mock .post-content {
  border-bottom: none;
}
#trending-discussions-content .post-footer,
.groups-trending-mock .post-footer {
  margin-top: auto;
  border-top: 1px solid #124c5f26;
  padding-top: 12px;
}

/* At smaller breakpoints: size rows to content so tiles don't overlap vertically */
@media (max-width: 1024px) {
  #trending-discussions-content,
  .groups-trending-mock {
    align-items: start;
    grid-auto-rows: minmax(min-content, auto);
  }
  #trending-discussions-content > cds-tile,
  #trending-discussions-content > .discussion-post,
  .groups-trending-mock > cds-tile,
  .groups-trending-mock > .discussion-post {
    height: auto;
    min-height: 0;
  }
}

.discussion-post .vote-score {
  display: flex;
  align-items: center;
  gap: 4px;
}

.discussion-post .replies-count {
  display: flex;
  align-items: center;
  gap: 4px;
}

.discussion-post .ticker-tag,
.social-post .ticker-tag,
.post-modal-post .ticker-tag,
.comment-content .ticker-tag {
  margin-right: 4px;
}

.discussion-post .ticker-link {
  text-decoration: none;
  font-weight: bold;
}

.discussion-post .ticker-link:hover {
  text-decoration: underline;
}

/* AI Market Summary fade-in animation */
#aiMarketSummary {
  animation: aiSummaryFadeIn 0.5s ease-out forwards;
}

@keyframes aiSummaryFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#aiMarketSummary .ticker-tag {
  margin-right: 4px;
  padding: 1px 5px;
}

/* Social Feed Styles */
.social-feed-container {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: transparent;
}

.feed-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.feed-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.feed-icon {
  font-size: 18px;
}

.feed-text {
  font-size: 14px;
}

.feed-controls {
  display: flex;
  gap: 8px;
}

.feed-refresh-btn {
  background: transparent;
  border: 1px solid rgba(18, 76, 95, 0.2);
  border-radius: 6px;
  padding: 6px;
  cursor: pointer;
  color: #124c5f;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.feed-refresh-btn:hover {
  background: rgba(18, 76, 95, 0.1);
  border-color: #124c5f;
}

.feed-refresh-btn:active {
  transform: scale(0.95);
}

.feed-refresh-btn.is-loading svg {
  animation: spin 0.8s linear infinite;
}

.feed-refresh-btn.is-loading {
  pointer-events: none;
  opacity: 0.7;
}

.feed-filters {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.filter-btn {
  background: transparent;
  border: 1px solid rgba(18, 76, 95, 0.2);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 11px;
  color: #124c5f;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.filter-btn:hover {
  background: rgba(18, 76, 95, 0.1);
}

.filter-btn.active {
  background: #124c5f;
  color: white;
  border-color: #124c5f;
}

.feed-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  scrollbar-width: none;
}

.feed-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
}

.loading-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(18, 76, 95, 0.2);
  border-top: 2px solid #124c5f;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 12px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.feed-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.6;
}

.feed-empty h4 {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 600;
}

.feed-empty p {
  margin: 0 0 16px 0;
  font-size: 12px;
  opacity: 0.8;
  line-height: 1.4;
}

.connect-btn {
  background: #124c5f;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s;
}

.connect-btn:hover {
  background: #0f3a4a;
}

.feed-posts {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 8px;
  overflow-x: hidden;
}

.feed-post {
  border: 1px solid #124c5f26;
  border-radius: 8px;
  padding: 12px;
  transition: all 0.2s;
  cursor: pointer;
}

.feed-post:hover {
  background: #ffffff4d;
  border-color: transparent;
  transform: translateY(-1px);
}

.post-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.post-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 10px;
  font-weight: bold;
  background-color: #124c5f;
  overflow: hidden;
  flex-shrink: 0;
}

.post-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.post-meta {
  flex: 1;
  min-width: 0;
}

.post-author {
  font-size: 12px;
  font-weight: 600;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #124c5f;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.post-author:hover {
  opacity: 0.8;
}

/* Social feed usernames - use link color */
.social-post .post-user-info h4,
.social-post .user-name-clickable {
  color: #124c5f;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.social-post .post-user-info h4:hover,
.social-post .user-name-clickable:hover {
  opacity: 0.8;
}

.post-provider {
  font-size: 10px;
  margin: 0;
  margin-left: auto;
}

.provider-icon {
  width: 16px;
  height: 16px;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.provider-icon:hover {
  opacity: 1;
}

.post-content {
  margin-bottom: 8px;
}

.post-text {
  font-size: 12px;
  line-height: 1.4;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-media {
  margin-top: 8px;
  border-radius: 6px;
  overflow: hidden;
}

.post-media img {
  width: 100%;
  height: auto;
  max-height: 120px;
  object-fit: cover;
  background: none;
}

.youtube-media .youtube-thumbnail-container {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.youtube-media .youtube-thumbnail-container:hover {
  transform: scale(1.02);
}

.youtube-media .youtube-play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  pointer-events: none;
  transition: all 0.2s ease;
}

.youtube-media .youtube-thumbnail-container:hover .youtube-play-button {
  background: rgba(255, 0, 0, 0.9);
  transform: translate(-50%, -50%) scale(1.1);
}

/* YouTube posts without headers - ensure proper spacing */
.social-post:has(.youtube-media) .post-content {
  margin-top: 0;
}

.feed-post:has(.youtube-media) .post-content {
  margin-top: 0;
}

.post-engagement {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 10px;
}

.engagement-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.engagement-icon {
  width: 12px;
  height: 12px;
  opacity: 0.6;
}

.post-time {
  font-size: 10px;
  margin-left: auto;
}

/* Social Comments Styles - Modal only */

.social-comment {
  margin-bottom: 8px;
  padding: 8px;
  border-radius: 6px;
  border-left: 1px solid #124c5f26;
}

.comment-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 6px;
}

.comment-user-info {
  display: flex;
  align-items: center;
  gap: 6px;
}

.comment-avatar {
  width: 20px;
  height: 20px;
  background-color: #124c5f;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 10px;
  flex-shrink: 0;
}

/* Simple CSS-only avatar classes — .avatar_xs (18px) · .avatar_small (32px) · .avatar_large (60px) */
.avatar_xs,
.avatar_small,
.avatar_large {
  background-color: #124c5f;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  flex-shrink: 0;
  overflow: hidden;
  color: #ffffff;
  font-weight: 600;
}

/* img fills the circle regardless of size */
.avatar_xs img,
.avatar_small img,
.avatar_large img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

/* Size variants */
.avatar_xs    { width: 18px; height: 18px; font-size: 9px;  }
.avatar_small { width: 32px; height: 32px; font-size: 12px; }
.avatar_large { width: 60px; height: 60px; font-size: 20px; }

.avatar_small svg {
  width: 18px;
  height: 18px;
  fill: none !important;
  color: #ffffff !important;
  stroke: #ffffff !important;
  stroke-width: 2 !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.avatar_small svg path,
.avatar_small svg circle {
  fill: none !important;
  stroke: #ffffff !important;
  stroke-width: 2 !important;
}

/* Ensure icon remains white on g10 theme (important to override any theme styles) */
body.cds-theme--g10 .avatar_xs,
body.cds-theme--g10 .avatar_small,
body.cds-theme--g10 .avatar_large,
.cds-theme--g10 .avatar_xs,
.cds-theme--g10 .avatar_small,
.cds-theme--g10 .avatar_large {
  color: #ffffff !important;
}

body.cds-theme--g10 .avatar_small svg,
body.cds-theme--g10 .avatar_large svg,
.cds-theme--g10 .avatar_small svg,
.cds-theme--g10 .avatar_large svg {
  fill: none !important;
  color: #ffffff !important;
  stroke: #ffffff !important;
  stroke-width: 2 !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.avatar_large {
  width: 60px;
  height: 60px;
  background-color: #d3edf5;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  flex-shrink: 0;
  overflow: hidden;
  color: #ffffff; /* Set color on container so currentColor in SVG works */
}

.avatar_large svg {
  width: 32px;
  height: 32px;
  fill: none !important;
  color: #ffffff !important;
  stroke: #ffffff !important;
  stroke-width: 2 !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.avatar_large svg path,
.avatar_large svg circle {
  fill: none !important;
  stroke: #ffffff !important;
  stroke-width: 2 !important;
}

/* Backward compatibility: .post-avatar uses .avatar_small */
.post-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 10px;
  font-weight: bold;
  background-color: #124c5f;
  overflow: hidden;
  flex-shrink: 0;
  aspect-ratio: 1 / 1;
}

.comment-meta {
  min-width: 0;
}

.comment-author {
  font-size: 11px;
  font-weight: 600;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.comment-time {
  font-size: 9px;
  opacity: 0.7;
  margin: 0;
}

.comment-content {
  font-size: 11px;
  line-height: 1.4;
  margin: 0;
  word-wrap: break-word;
}

.comment-footer {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid #124c5f26;
}

.reply-comment-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 3px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 3px;
  opacity: 0.7;
}

.reply-comment-btn:hover {
  background: rgba(18, 76, 95, 0.1);
  opacity: 1;
}

.reply-icon {
  font-size: 10px;
}

.reply-text {
  font-weight: 500;
}

.comment-actions {
  display: flex;
  gap: 4px;
}

.delete-comment-btn {
  background: none;
  border: none;
  color: #dc3545;
  cursor: pointer;
  padding: 2px;
  border-radius: 3px;
  transition: all 0.2s ease;
  opacity: 0.7;
}

.delete-comment-btn:hover {
  background: rgba(220, 53, 69, 0.1);
  opacity: 1;
}

/* Inline comment form styles removed - using modal instead */

.no-comments {
  text-align: center;
  opacity: 0.7;
  font-size: 11px;
  padding: 12px;
  font-style: italic;
}

.feed-load-more {
  text-align: center;
  flex-shrink: 0;
}

.load-more-btn {
  background: transparent;
  border: 1px solid rgba(18, 76, 95, 0.2);
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 12px;
  color: #124c5f;
  cursor: pointer;
  transition: all 0.2s;
}

.load-more-btn:hover {
  background: rgba(18, 76, 95, 0.1);
  border-color: #124c5f;
}

.discussion-post {
  background-color: transparent;
  border: 1px solid #124c5f26;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
  position: relative;
}

.discussion-post .post-reply {
  border: none;
}

/* Reply post styling */
.discussion-post-reply {
  background-color: transparent;
  margin-bottom: 20px;
  position: relative;
  margin-left: 20px;
  border-left: 1px solid #124c5f26;
  padding-left: 12px;
}


/* Responsive adjustments for sidebar */
@media (max-width: 768px) {
  .feed-filters {
    gap: 2px;
  }

  .filter-btn {
    padding: 3px 6px;
    font-size: 10px;
  }

  .feed-post {
    padding: 10px;
  }

  .post-text {
    font-size: 11px;
  }
}

/* Post Creation Modal Styles */
.post-creation-modal {
  max-width: 600px;
  width: 90vw;
}

.post-creation-modal .modal-body {
  max-height: 70vh;
  overflow-y: auto;
}

.post-creation-modal .form-group {
  margin-bottom: 20px;
  padding: 5px;
}

.post-creation-modal .form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #124c5f;
  font-size: 14px;
}

.post-creation-modal .form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(18, 76, 95, 0.3);
  border-radius: 6px;
  color: #124c5f;
  font-size: 14px;
  transition: all 0.2s ease;
  font-family: inherit;
}

.post-creation-modal .form-control:focus {
  outline: none;
  border-color: #124c5f;
  box-shadow: 0 0 0 2px rgba(18, 76, 95, 0.1);
  background: white;
}

.post-creation-modal .post-content-textarea {
  min-height: 100px;
  max-height: 200px;
  resize: vertical;
  line-height: 1.4;
}

.post-creation-modal .char-counter {
  text-align: left;
  font-size: 12px;
  color: rgba(18, 76, 95, 0.6);
  margin-top: 4px;
}

.post-creation-modal .char-counter.warning {
  color: #f44336;
}

.post-creation-modal .form-help {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: rgba(18, 76, 95, 0.6);
}

.post-creation-modal .post-type-options {
  margin-top: 16px;
  padding: 16px;
  background: rgba(18, 76, 95, 0.05);
  border-radius: 8px;
  border: 1px solid rgba(18, 76, 95, 0.1);
}

.post-creation-modal .post-type-options h5 {
  margin: 0 0 12px 0;
  color: #124c5f;
  font-size: 14px;
  font-weight: 600;
}

.post-creation-modal .selection-grid {
  display: block;
  max-height: 200px;
  overflow-y: auto;
}

.post-creation-modal .selection-grid > * + * {
  margin-top: 8px;
}

.post-creation-modal .selection-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  min-height: 25px;
  border: 1px solid rgba(18, 76, 95, 0.2);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.post-creation-modal .selection-item:hover {
  border-color: #124c5f;
  background: rgba(18, 76, 95, 0.05);
}

.post-creation-modal .selection-item.selected {
  border-color: #124c5f;
  background: rgba(18, 76, 95, 0.1);
  box-shadow: 0 0 0 2px rgba(18, 76, 95, 0.1);
}

.post-creation-modal .selection-preview {
  flex-shrink: 0;
}

.post-creation-modal .selection-preview img {
  width: 28px;
  height: 28px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid rgba(18, 76, 95, 0.2);
}

.post-creation-modal .selection-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: nowrap;
}

.post-creation-modal .selection-info h6 {
  margin: 0;
  color: #124c5f;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1 1 auto;
  min-width: 0;
}

.post-creation-modal .selection-info p {
  margin: 0;
  color: rgba(18, 76, 95, 0.55);
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  flex: 0 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
}

.post-creation-modal .selection-info p::before {
  content: '·';
  margin-right: 0.35rem;
  color: rgba(18, 76, 95, 0.35);
}

.post-creation-modal .image-upload-area {
  text-align: center;
  padding: 20px;
  border: 1px dashed rgba(18, 76, 95, 0.3);
  border-radius: 8px;
  background: rgba(18, 76, 95, 0.02);
}

.post-creation-modal .image-upload-area:hover {
  border-color: #124c5f;
  background: rgba(18, 76, 95, 0.05);
}

.post-creation-modal .image-preview {
  margin-top: 16px;
  text-align: center;
}

.post-creation-modal .image-preview img {
  max-width: 200px;
  max-height: 200px;
  border-radius: 8px;
  border: 1px solid rgba(18, 76, 95, 0.2);
  margin-bottom: 12px;
}

.post-creation-modal .btn.secondary {
  background: transparent;
  color: #124c5f;
  border: 1px solid #124c5f;
}

.post-creation-modal .btn.secondary:hover {
  background: rgba(18, 76, 95, 0.1);
}

.post-creation-modal .btn.small {
  padding: 4px 8px;
  font-size: 12px;
  height: auto;
}

.post-creation-modal .error-message {
  background: #ffebee;
  color: #c62828;
  padding: 12px;
  border-radius: 6px;
  border: 1px solid #ffcdd2;
  margin-top: 16px;
  font-size: 14px;
}

.post-creation-modal .btn-loading {
  display: flex;
  align-items: center;
  justify-content: center;
}

.post-creation-modal .loading-spinner-small {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Post creation footer layout */
.post-creation-footer {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.post-sentiment-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.post-sentiment-row .sentiment-btn {
  flex: 0 0 auto;
  min-width: 72px;
  text-align: center;
}

.post-action-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-left: auto;
}

.post-action-row .modal-btn {
  min-width: 90px;
}

/* Tablet — tighten tab navigation */
@media (max-width: 768px) {
  .post-creation-modal {
    width: 95vw;
    max-width: none;
  }

  .post-creation-modal .selection-item {
    flex-direction: row;
    text-align: left;
  }

  .post-creation-modal .selection-preview img {
    width: 28px;
    height: 28px;
  }

  .post-creation-modal .tab-navigation {
    flex-wrap: wrap;
    gap: 6px;
  }

  .post-creation-modal .tab-navigation .tab-btn {
    flex: 1 1 auto;
    min-width: 0;
    padding: 8px 10px;
    font-size: 13px;
  }
}

/* Mobile — bottom sheet pattern */
@media (max-width: 600px) {
  #postCreationModal.show {
    align-items: flex-end;
    padding-top: 0;
  }

  #postCreationModal .post-creation-modal {
    width: 100vw;
    max-width: 100vw;
    margin: 0;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    animation: postModalSlideUp 0.28s ease-out;
  }

  @keyframes postModalSlideUp {
    from {
      transform: translateY(48px);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }

  /* Drag handle */
  #postCreationModal .post-creation-modal::before {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    background: rgba(18, 76, 95, 0.25);
    border-radius: 2px;
    margin: 12px auto 0;
    flex-shrink: 0;
  }

  #postCreationModal .modal-header {
    flex-shrink: 0;
    padding: 14px 20px 12px;
    margin-bottom: 0;
    border-bottom: 1px solid rgba(18, 76, 95, 0.12);
  }

  #postCreationModal .modal-body {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    max-height: none;
    padding: 16px 20px;
  }

  /* 2×3 grid for the 6 post-type tabs */
  #postCreationModal .tab-navigation {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  #postCreationModal .tab-navigation .tab-btn {
    padding: 9px 4px;
    font-size: 12px;
    text-align: center;
    min-height: 36px;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Prevent iOS from zooming on inputs */
  #postCreationModal .form-control,
  #postCreationModal .input-main,
  #postCreationModal select {
    font-size: 16px;
    min-height: 44px;
  }

  #postCreationModal .post-content-textarea {
    font-size: 16px;
    min-height: 90px;
  }

  /* Footer — single row: sentiment left, actions right */
  #postCreationModal .post-creation-footer {
    flex-shrink: 0;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    padding-bottom: max(16px, env(safe-area-inset-bottom, 16px));
    border-top: 1px solid rgba(18, 76, 95, 0.12);
  }

  #postCreationModal .post-sentiment-row {
    flex-shrink: 0;
    gap: 6px;
  }

  #postCreationModal .post-sentiment-row .sentiment-btn {
    padding: 8px 10px;
    font-size: 12px;
    min-width: 0;
  }

  #postCreationModal .post-action-row {
    margin-left: auto;
    gap: 6px;
  }

  #postCreationModal .post-action-row .modal-btn {
    flex: 0 0 auto;
    width: auto;
    padding: 10px 14px;
    font-size: 14px;
    min-width: 0;
  }


  /* Poll option inputs */
  #postCreationModal .poll-option-item {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
  }

  #postCreationModal .poll-option-item .input-main {
    flex: 1;
  }
}

/* Dark mode support for post creation modal */
@media (prefers-color-scheme: dark) {
  .post-creation-modal .form-control {
    background: rgba(0, 0, 0, 0.3);
    color: #e0e0e0;
    border-color: rgba(18, 76, 95, 0.5);
  }

  .post-creation-modal .form-control:focus {
    background: rgba(0, 0, 0, 0.5);
  }

  .post-creation-modal .post-type-options {
    background: rgba(0, 0, 0, 0.2);
    border-color: rgba(18, 76, 95, 0.3);
  }

  .post-creation-modal .selection-item {
    background: rgba(0, 0, 0, 0.2);
    border-color: rgba(18, 76, 95, 0.3);
  }

  .post-creation-modal .selection-item.selected {
    background: rgba(18, 76, 95, 0.25);
    border-color: rgba(18, 76, 95, 0.6);
  }

  .post-creation-modal .selection-info h6 {
    color: #e0e0e0;
  }

  .post-creation-modal .selection-info p {
    color: rgba(255, 255, 255, 0.55);
  }

  .post-creation-modal .selection-info p::before {
    color: rgba(255, 255, 255, 0.3);
  }

  .post-creation-modal .form-group label {
    color: #c0d4da;
  }

  .post-creation-modal .image-upload-area {
    background: rgba(0, 0, 0, 0.1);
    border-color: rgba(18, 76, 95, 0.4);
  }
}

/* Sentiment Button Styles */
.sentiment-btn {
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  margin-left: auto;
  font-weight: 500;
}

/* Display sentiment buttons in posts (always filled, no hover, not clickable) */
.post-engagement .sentiment-btn.bullish,
.post-modal-post .sentiment-btn.bullish,
.social-post .sentiment-btn.bullish {
  background-color: var(--wg-positive);
  color: white;
  border: none;
  cursor: default;
}

.post-engagement .sentiment-btn.bearish,
.post-modal-post .sentiment-btn.bearish,
.social-post .sentiment-btn.bearish {
  background-color: var(--wg-negative);
  color: white;
  border: none;
  cursor: default;
}

/* Form sentiment buttons (interactive, can be selected) - default state */
.post-creation-modal .sentiment-btn.bullish,
#sentimentBullish:not(.post-engagement .sentiment-btn):not(.post-modal-post .sentiment-btn) {
  border: 1px solid var(--wg-positive);
  background: transparent;
  color: var(--wg-positive);
  cursor: pointer;
  transition: all 0.2s ease;
}

.post-creation-modal .sentiment-btn.bullish:hover,
#sentimentBullish:hover:not(.post-engagement .sentiment-btn):not(.post-modal-post .sentiment-btn) {
  background-color: var(--wg-positive);
  color: white;
}

.post-creation-modal .sentiment-btn.bearish,
#sentimentBearish:not(.post-engagement .sentiment-btn):not(.post-modal-post .sentiment-btn) {
  border: 1px solid var(--wg-negative);
  background: transparent;
  color: var(--wg-negative);
  cursor: pointer;
  transition: all 0.2s ease;
}

.post-creation-modal .sentiment-btn.bearish:hover,
#sentimentBearish:hover:not(.post-engagement .sentiment-btn):not(.post-modal-post .sentiment-btn) {
  background-color: var(--wg-negative);
  color: white;
}

/* Selected state for sentiment buttons (for form inputs) */
.sentiment-btn.selected.bullish {
  background-color: var(--wg-positive);
  color: white;
  border-color: var(--wg-positive);
}

.sentiment-btn.selected.bearish {
  background-color: var(--wg-negative);
  color: white;
  border-color: var(--wg-negative);
}

/* Details discussions composer: POST = outlined / see-through like sentiment toggles */
#newPostForm .discussion-post-btn {
  box-sizing: border-box;
  padding: 6px 20px;
  margin-left: 15px;
  height: 28px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: normal;
  font-family: 'IBM Plex Sans', sans-serif;
  background: transparent !important;
  border: 1px solid rgba(18, 76, 95, 0.45);
  color: #6b7b83;
  cursor: pointer;
  transition: all 0.2s ease;
}

#newPostForm .discussion-post-btn:disabled {
  border-color: rgba(107, 123, 131, 0.45);
  color: rgba(107, 123, 131, 0.85);
  cursor: not-allowed;
}

/* Valid composer content: match primary .btn */
#newPostForm .discussion-post-btn:not(:disabled) {
  padding: 0 12px;
  background: #124c5f !important;
  color: #fff !important;
  border: none !important;
  border-radius: 8px;
  cursor: pointer;
}

#newPostForm .discussion-post-btn:not(:disabled):hover {
  background: #3c5b6f !important;
}

#newPostForm .discussion-post-btn:not(:disabled):active {
  transform: scale(0.98);
}

/* Poll Options Styles */
.poll-option-item {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}

.poll-option-item .poll-option-input {
  flex: 1;
}

.poll-option-item .remove-option-btn {
  flex-shrink: 0;
  padding: 6px 12px;
  font-size: 12px;
}

#pollOptionsList {
  margin-bottom: 12px;
}

#addPollOptionBtn {
  width: 100%;
  margin-top: 8px;
}


.post-modal-post .post-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

/* Match feed / .avatar_small: square circle (40px + global flex-basis 32px caused 32×40 ovals in the modal) */
.post-modal-post .post-avatar {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  flex-shrink: 0;
  position: relative;
  aspect-ratio: 1 / 1;
}

.post-modal-post .post-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.post-modal-post .avatar-circle {
  width: 32px;
  height: 32px;
  background: #124c5f;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 12px;
  aspect-ratio: 1 / 1;
}

.post-modal-post .post-meta,
.post-modal-post .post-user-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}

.post-modal-post .post-author {
  font-weight: 600;
  font-size: 12px;
  color: #124c5f;
  cursor: pointer;
  transition: opacity 0.2s ease;
  display: block;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.post-modal-post .post-author:hover {
  opacity: 0.8;
}

.post-modal-post .post-user-sub {
  font-size: 11px;
  color: var(--cds-text-secondary, #124c5f);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.post-modal-post .post-time {
  font-size: 10px;
  margin-top: 0;
  margin-left: 0;
  flex-shrink: 0;
  display: inline-block;
}

.post-modal-post .post-content {
  line-height: 1.5;
  font-size: 14px;
}

.post-modal-post .post-actions {
  margin-left: auto;
}

.post-modal-post .post-context-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.post-modal-post .post-context-btn:hover {
  background: rgba(18, 76, 95, 0.1);
}

.comments-section {
  max-height: 400px;
  overflow-y: auto;
  border-radius: 8px;
}

.comment-form-container {
  width: 100%;
  padding-top: 12px;
}

/* Inline comment form styles removed - using modal instead */

.char-counter {
  font-size: 12px;
}

.comment-buttons {
  display: flex;
  gap: 8px;
  padding-top: 12px;
  justify-content: right;
}

/* Comment items in modal */
.comments-section .social-comment {
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 12px;
}

.comments-section .social-comment:last-child {
  margin-bottom: 0;
}

.comments-section .comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.comments-section .comment-user-info {
  display: flex;
  align-items: center;
}

.comments-section .comment-avatar {
  width: 32px;
  height: 32px;
  background: #124c5f;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 12px;
  margin-right: 8px;
  aspect-ratio: 1 / 1;
}

.comments-section .comment-meta {
  display: flex;
  flex-direction: column;
}

.comments-section .comment-author {
  font-weight: bold;
  color: #124c5f;
  font-size: 13px;
}

.comments-section .comment-time {
  font-size: 11px;
  margin-top: 2px;
}

.comments-section .comment-content {
  color: #124c5f;
  font-size: 13px;
  line-height: 1.4;
  margin-bottom: 8px;
}

.comments-section .comment-footer {
  display: flex;
  gap: 8px;
}

.comments-section .reply-comment-btn,
.comments-section .delete-comment-btn {
  background: none;
  border: none;
  font-size: 11px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.comments-section .reply-comment-btn:hover {
  background: #f0f0f0;
  color: #124c5f;
}

.comments-section .delete-comment-btn:hover {
  background: #ffe6e6;
  color: #dc3545;
}

/* ===== POST DETAIL MODAL LAYOUT ===== */
/* Vertically center the post modal overlay and allow it to grow up to 98vh */
#postModal.show {
  align-items: center;
}

#postModal .modal-content {
  max-height: 98vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#postModal .modal-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

#postModal .post-modal-post,
#postModal .comments-section-header {
  flex-shrink: 0;
}

#postModal .comments-section {
  flex: 1;
  max-height: none;
  min-height: 0;
  overflow-y: auto;
}

#postModal .modal-footer {
  flex-shrink: 0;
}

/* Responsive post modal */
@media (max-width: 768px) {
  .modal.modal-large .modal-content {
    margin: 10px;
    max-height: calc(100vh - 20px);
  }

  .comments-section {
    max-height: 300px;
  }

  #postModal .modal-content {
    max-height: 98vh;
    margin: 4px;
  }

  #postModal .comments-section {
    max-height: none;
  }

  /* Inline comment form styles removed - using modal instead */

  .comment-buttons {
    justify-content: center;
  }
}

.stats-section {
  margin-bottom: 30px;
}

.stats-section:last-child {
  margin-bottom: 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
  margin-top: 20px;
}

.stats-grid .panel {
  display: flex !important;
  flex-direction: column !important;
}

.stat-item {
  display: flex;
  flex-direction: column;
  padding: 15px;
  background-color: white;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
}

.stat-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  font-weight: 500;
  display: block;
}

.stat-value {
  font-weight: 600;
  display: block;
  margin-top: 4px;
}

.stat-value.positive {
  color: var(--wg-positive);
}

.stat-value.negative {
  color: var(--wg-negative);
}

.top-performers {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 15px;
}

.top-performers .panel {
  display: flex;
  flex-direction: column;
  padding: 20px;
  flex: 1;
  min-width: 200px;
}

.performer-item {
  display: flex;
  flex-direction: column;
  padding: 12px 15px;
  background-color: white;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
  flex: 1;
  min-width: 200px;
}

.performer-label {
  font-size: 14px;
  font-weight: 500;
  display: block;
  margin-bottom: 4px;
}

.performer-symbol {
  font-size: 16px;
  font-weight: 600;
  color: #124c5f;
  display: inline-block;
}

.performer-change {
  font-size: 16px;
  font-weight: 600;
  display: inline-block;
  margin-left: 8px;
}

.performer-change.positive {
  color: var(--wg-positive);
}

.performer-change.negative {
  color: var(--wg-negative);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .top-performers {
    flex-direction: column;
  }
  
  .performer-item {
    min-width: 100%;
  }
}

/* ── Sidebar component styles ──────────────────────────────────────────── */
.theme-radio-container {
  display: flex;
  align-items: center;
  gap: 24px;
}

.theme-radio-container .radio {
  cursor: pointer;
}

body.cds-theme--g100 .theme-radio-container .radio {
  color: #f4f4f4;
}

/* Lists tab needs flex layout when active so theme switcher stays at bottom */
#lists-tab.tab-content.active {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.sidebar-lists-empty-state {
  text-align: center;
  padding: 32px 16px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.sidebar-lists-empty-state__title {
  margin: 0;
  font-size: 1rem;
  line-height: 1.4;
  color: var(--cds-text-primary, #161616);
}

.sidebar-lists-empty-state__hint {
  margin: 8px 0 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--cds-text-secondary, #525252);
}

.sidebar-lists-empty-state__cta {
  margin-top: 20px;
  min-width: 160px;
}

body.cds-theme--g100 .sidebar-lists-empty-state__title {
  color: var(--cds-text-primary, #ffffff);
}

body.cds-theme--g100 .sidebar-lists-empty-state__hint {
  color: var(--cds-text-secondary, #c6c6c6);
}