/* Security detail page, shared by /holdings/:name and /securities/:id */
@layer components {
  .security__header {
    margin-block-end: var(--block-space);
  }

  .security__name {
    font-size: var(--text-large);
    font-weight: 700;
  }

  .security__fullname {
    color: var(--color-ink-medium);
    font-size: var(--text-medium);
  }

  .security__price {
    color: var(--color-ink-medium);
  }

  .security__exchange {
    color: var(--color-ink-medium);
    font-size: var(--text-x-small);
  }

  /* Expense ratio
  /* ------------------------------------------------------------------------ */

  .security__stats {
    color: var(--color-ink-medium);
    font-size: var(--text-small);
    margin-block-end: var(--block-space);

    dt {
      font-weight: 600;
    }

    dd {
      margin: 0;
    }
  }

  /* Chart
  /* ------------------------------------------------------------------------ */

  .security__chart {
    block-size: 250px;
  }

  .tradingview-widget-copyright {
    display: none;
  }

  /* Lots table
  /* ------------------------------------------------------------------------ */

  .security__lots {
    container-type: inline-size;

    table {
      max-inline-size: 100%;
    }

    th,
    td {
      box-sizing: content-box;
      white-space: nowrap;
    }

    .col-date { inline-size: 10ch; }
    .col-shares,
    .col-value,
    .col-buy-price,
    .col-cost-basis { text-align: right; }

    /* Hide columns at smaller breakpoints */
    @container (max-width: 400px) {
      .col-buy-price { display: none; }
    }

    @container (max-width: 500px) {
      .col-cost-basis { display: none; }
      .col-tags { display: none; }
    }

    /* Hide the summary row when it would just repeat the single data row */
    .row-summary:nth-last-child(2) {
      display: none;
    }
  }
}
