* {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}
.container {
  box-sizing: border-box;
  color: #333;
  font-family: Inter, sans-serif;
  max-width: 1400px;
  padding: 0;
  margin: 0 auto;
}
.card-section {
  background: #fff;
  border-radius: 12px;
  padding: 25px;
  margin-bottom: 25px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  border: 1px solid #e0e4e8;
}
.summary__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}
.summary__box {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #e0e4e8;
  text-align: center;
  transition: transform 0.2s ease;
}
.summary__label {
  font-size: 14px;
  color: #666;
  font-weight: 500;
  margin-bottom: 10px;
  text-transform: uppercase;
}
.summary__number {
  font-size: 24px;
  font-weight: 600;
  color: #1a3c34;
}
.summary__number.positive {
  color: #28a745;
}
.summary__number.negative {
  color: #dc3545;
}
.summary__percentage {
  font-size: 14px;
  font-weight: 500;
  margin-top: 5px;
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
}
.summary__percentage.positive {
  color: #28a745;
  background: #e6f3e9;
}
.summary__percentage.negative {
  color: #dc3545;
  background: #fce8e9;
}
.portfolio__breakdown {
  display: flex;
  gap: 25px;
  align-items: stretch;
}
.portfolio__piechart-section {
  width: 50%;
  display: flex;
  flex-direction: column;
}
.portfolio__heading {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 15px;
  color: #1a3c34;
}
.portfolio__container {
  display: flex;
  gap: 20px;
  align-items: center;
}
.portfolio__color-meaning {
  max-height: 290px;
  overflow-y: auto;
  padding-left: 10px;
  width: auto;
  scrollbar-width: thin;
  scrollbar-color: #bbb #f5f7fa;
}
.portfolio__color-meaning::-webkit-scrollbar {
  width: 8px;
}
.portfolio__color-meaning::-webkit-scrollbar-track {
  background: #f5f7fa;
  border-radius: 4px;
}
.portfolio__color-meaning::-webkit-scrollbar-thumb {
  background-color: #bbb;
  border-radius: 4px;
  border: 2px solid #f5f7fa;
}
.portfolio__color-meaning::-webkit-scrollbar-thumb:hover {
  background-color: #999;
}
.portfolio__color-box {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}
.portfolio__color {
  width: 8px;
  height: 8px;
  border-radius: 4px;
  margin-right: 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.portfolio__meaning {
  font-size: 14px;
  color: #333;
  font-weight: 500;
}
.portfolio__piechart {
  max-width: 60%;
  flex: 1;
}
.notifications__section {
  flex: 1;
  min-width: 0;
}
.notifications__heading {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 15px;
  color: #1a3c34;
}
.notifications__scrollable {
  height: 300px;
  overflow-y: auto;
  padding: 10px;
  border: 1px solid #e0e4e8;
  border-radius: 6px;
  background: #fafafa;
  scrollbar-width: thin;
  scrollbar-color: #bbb #f5f7fa;
}
.notifications__scrollable::-webkit-scrollbar {
  width: 8px;
}
.notifications__scrollable::-webkit-scrollbar-track {
  background: #f5f7fa;
  border-radius: 4px;
}
.notifications__scrollable::-webkit-scrollbar-thumb {
  background-color: #bbb;
  border-radius: 4px;
  border: 2px solid #f5f7fa;
}
.notifications__scrollable::-webkit-scrollbar-thumb:hover {
  background-color: #999;
}
.notifications__box {
  display: flex;
  align-items: center;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 12px;
  background: #fff;
  transition: all 0.2s ease;
  opacity: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  border-left: 4px solid #000;
}
.notifications__box.show {
  opacity: 1;
}
.notifications__box:hover {
  background: #f9f9f9;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.notifications__box--buy {
  border-left-color: #28a745;
}
.notifications__box--sell {
  border-left-color: #dc3545;
}
.notifications__img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-right: 16px;
  border: 1px solid #eee;
  object-fit: cover;
}
.notifications__content {
  flex-grow: 1;
  min-width: 0;
}
.notifications__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.notifications__title {
  font-size: 15px;
  font-weight: 600;
  color: #1a3c34;
}
.notifications__date {
  font-size: 12px;
  color: #999;
}
.notifications__message {
  font-size: 14px;
  color: #555;
  line-height: 1.5;
  overflow-wrap: break-word;
}
.holdings-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 15px;
}
#stock-search {
  padding: 10px 16px 10px 44px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background-color: #f9f9f9;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='%23999' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 14px center;
  color: #333;
  width: 100%;
  max-width: 360px;
  transition: box-shadow 0.2s ease, background-color 0.2s ease;
}

#stock-search:focus {
  background-color: #fff;
  outline: none;
  border-color: #c2c2c2;
  box-shadow: 0 0 0 2px rgba(100, 100, 100, 0.08);
}
#fund2_stock-table {
  border-radius: 0;
  width: 100%;
  overflow-x: auto;
}
/* For Search To not shrink the section */
.card-section:has(#fund2_stock-table) {
  min-height: 750px;
}
.tabulator .tabulator-header {
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 600;
  background: #dae7eb;
  color: #333;
  border-bottom: 2px solid #ccc;
}
.tabulator .tabulator-header .tabulator-col {
  padding: 10px;
  white-space: nowrap;
}
.tabulator .tabulator-cell {
  padding: 10px;
  font-size: 14px;
  color: #333;
  border-right: 1px solid #e5e5e5;
  white-space: nowrap;
}
.tabulator .tabulator-row:nth-child(even) {
  background-color: #f9f9f9;
}
.tabulator .tabulator-row:hover {
  background-color: #fff9cc;
}
.tabulator .tabulator-footer {
  background-color: #fff;
  border-top: 2px solid #ddd;
}
.tabulator {
  background-color: #f5f7fa !important;
}
#fund2_skeleton-loader {
  padding: 15px;
  background-color: #fff;
}
.skeleton-line {
  height: 30px;
  background-color: #f0f3f5;
  border-radius: 4px;
  margin-bottom: 12px;
  animation: pulse 1.5s infinite;
}
.skeleton-line:first-child {
  background-color: #e4e9ed;
  height: 40px;
  margin-bottom: 20px;
}
.skeleton-line:last-child {
  margin-bottom: 0;
}
@keyframes pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
  100% {
    opacity: 1;
  }
}
.ntf-toggle {
  margin-top: 12px;
  font-size: 0.9rem;
  color: #39808d;
  cursor: pointer;
  text-decoration: underline;
  transition: transform 0.2s ease;
}
.ntf-toggle:hover {
  transform: translateY(-2px);
}
.cash-position__section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.cash-position__details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}
.cash-position__box {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #e0e4e8;
  text-align: center;
}
.cash-position__label {
  font-size: 14px;
  color: #666;
  font-weight: 500;
  margin-bottom: 10px;
  text-transform: uppercase;
}
.cash-position__value {
  font-size: 24px;
  font-weight: 600;
  color: #1a3c34;
}

.cash-position__formula {
  font-size: 13px;
  color: #777;
  margin-top: 8px;
  font-style: italic;
  min-height: 2.5em;
  line-height: 1.4em;
}
/* Make "Accumulated Interest" formula text bigger and uniform */
.cash-position__formula[data-cash-formula="Accumulated Interest"] {
  font-size: 13px;
}

/* Styles for RFCP percentage to mimic summary__percentage - This block might be less relevant now for the multi-line display */
.cash-position__formula.summary__percentage {
  font-size: 14px;
  font-weight: 500;
  margin-top: 8px;
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-style: normal;
  min-height: auto;
  line-height: normal;
}

.cash-position__chart {
  height: 65px;
}

@media (max-width: 768px) {
  .card-section {
    padding: 20px 8px;
  }
  .summary__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .summary__box {
    padding: 12px 8px;
  }
  .summary__label {
    font-size: 12px;
  }
  .summary__number {
    font-size: 18px;
  }
  .summary__percentage {
    font-size: 12px;
    margin-top: 5px;
  }
  .portfolio__breakdown {
    flex-direction: column;
    gap: 0;
  }
  .portfolio__piechart-section {
    width: 100%;
  }
  .portfolio__container {
    flex-direction: row;
    gap: 30px;
    justify-content: start;
  }
  .portfolio__piechart {
    max-width: 200px;
  }
  .portfolio__color-meaning {
    width: auto;
    max-height: 150px;
    padding-right: 5px;
  }
  .portfolio__meaning {
    font-size: 10px;
  }
  .notifications__scrollable {
    height: 300px;
    padding: 8px;
  }
  .notifications__box {
    padding: 10px;
  }
  .notifications__img {
    width: 32px;
    height: 32px;
    margin-right: 12px;
  }
  .notifications__title {
    font-size: 14px;
  }
  .notifications__date {
    font-size: 11px;
  }
  .notifications__message {
    font-size: 13px;
  }
  .holdings-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }
  #stock-search {
    max-width: 100%;
  }
  .cash-position__details {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .cash-position__box {
    padding: 12px 8px;
  }
  .cash-position__label {
    font-size: 12px;
  }
  .cash-position__value {
    font-size: 18px;
  }
  .cash-position__formula {
    font-size: 10px;
    line-height: 1.3em;
  }
  .cash-position__formula.summary__percentage {
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .summary__number {
    font-size: 16px;
  }
  .summary__grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .portfolio__piechart {
    max-width: 50%;
    max-height: 210px;
  }
  .portfolio__color-meaning {
    width: auto;
  }
  .portfolio__color-box {
    margin-bottom: 6px;
  }
  .notifications__box {
    padding: 8px;
  }
  .notifications__img {
    width: 28px;
    height: 28px;
    margin-right: 10px;
  }
  .notifications__title {
    font-size: 13px;
  }
  .notifications__date {
    font-size: 10px;
  }
  .notifications__message {
    font-size: 12px;
  }
  .cash-position__value {
    font-size: 16px;
  }
  .cash-position__formula {
    font-size: 9px;
    line-height: 1.3em;
  }
  .cash-position__formula.summary__percentage {
    font-size: 10px;
  }
  .cash-position__details {
    grid-template-columns: repeat(2, 1fr);
  }
}

.mobile-data-card {
  font-family: sans-serif;
  padding: 12px;
  background-color: #fff;
  border: 1px solid #eee;
  border-radius: 5px;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  font-size: 12px;
}
.card-asset-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.card-asset-name {
  font-size: 16px;
  font-weight: 400;
  color: #333;
}
.card-loss {
  color: #e57373;
  font-weight: 400;
}
.card-data-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.card-pairs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.card-pair {
  display: flex;
  gap: 4px;
}
.card-label {
  font-weight: 400;
  color: #666;
}
.card-value {
  font-weight: 500;
  color: #666;
}
.card-percentage {
  color: #e57373;
  font-weight: 500;
}
.card-data-row:last-child {
  border-top: 1px solid #eee;
  padding-top: 8px;
  margin-top: 8px;
}
@media (max-width: 600px) {
  #fund2_stock-table {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0;
    max-width: 100%;
  }
  .card-section:has(#fund2_stock-table) {
    min-height: 0px;
  }
  .mobile-data-card {
    padding: 10px;
  }
}
