.portfolio-layout {
      display: grid;
      grid-template-columns: minmax(0, 1.45fr) minmax(280px, .75fr);
      gap: 22px;
      align-items: start;
    }

.asset-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 14px;
    }

.asset-table th,
    .asset-table td {
      padding: 10px 6px;
      border-bottom: 1px solid var(--line);
      text-align: right;
      vertical-align: middle;
    }

.asset-table th:first-child,
    .asset-table td:first-child {
      text-align: left;
    }

.asset-table th {
      color: var(--muted);
      font-size: 12px;
      white-space: nowrap;
    }

.asset-table .col-asset { width: 14%; }

.asset-table .col-compact { width: 11%; }

.asset-table .col-allocation { width: 13%; }

.asset-table .col-amount { width: 19%; }

.asset-table input {
      min-height: 40px;
      padding: 8px 42px 8px 10px;
      font-size: 14px;
    }

.asset-reference-value {
      white-space: nowrap;
    }

.asset-table td:nth-child(5) .input-wrap {
      width: 88px;
      margin-left: auto;
    }

.asset-table td:nth-child(5) input {
      width: 100%;
      text-align: right;
    }

.asset-table td:nth-child(6) {
      min-width: 118px;
      padding-left: 16px;
      white-space: nowrap;
    }

.asset-table th:first-child,
    .asset-table td:first-child,
    .asset-table th:nth-child(5),
    .asset-table td:nth-child(5) {
      padding-right: 3px;
    }

.asset-table th:nth-child(2),
    .asset-table td:nth-child(2),
    .asset-table th:nth-child(6),
    .asset-table td:nth-child(6) {
      padding-left: 3px;
    }

.asset-name {
      font-weight: 800;
      white-space: nowrap;
    }

@media (max-width: 700px) {
      .portfolio-layout .asset-table {
        display: block;
        min-width: 0;
        white-space: normal;
      }

      .asset-table colgroup,
      .asset-table thead {
        display: none;
      }

      .asset-table tbody {
        display: grid;
        gap: 10px;
      }

      .asset-table tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        padding: 12px;
        border: 1px solid var(--line);
        border-radius: 12px;
        background: #f8fafc;
      }

      .asset-table td {
        min-width: 0;
        padding: 0;
        border: 0;
        text-align: left;
      }

      .asset-table td:first-child,
      .asset-table td:nth-child(2),
      .asset-table td:nth-child(5) {
        padding: 0;
      }

      .asset-table td:first-child {
        grid-column: 1 / -1;
      }

      .asset-table td:not(:first-child)::before {
        display: block;
        margin-bottom: 2px;
        color: var(--muted);
        font-size: 11px;
        font-weight: 700;
      }

      .asset-table td:nth-child(2)::before { content: "平均利回り"; }
      .asset-table td:nth-child(3)::before { content: "年率リスク"; }
      .asset-table td:nth-child(4)::before { content: "最大下落率"; }
      .asset-table td:nth-child(5)::before { content: "配分"; }
      .asset-table td:nth-child(6)::before { content: "金額"; }

      .asset-table td:nth-child(5) .input-wrap {
        width: 100%;
        margin-left: 0;
      }

      .asset-table td:nth-child(6) {
        min-width: 0;
        padding-left: 0;
      }
    }

.portfolio-summary {
      display: grid;
      gap: 12px;
    }

.pie-chart-wrap {
      display: grid;
      grid-template-columns: 220px 1fr;
      gap: 16px;
      align-items: center;
      margin-top: 10px;
    }

.pie-canvas-box {
      width: 220px;
      height: 220px;
      margin: 0 auto;
    }

.pie-canvas-box canvas {
      width: 100%;
      height: 100%;
      display: block;
    }

.pie-legend {
      display: grid;
      gap: 8px;
    }

.pie-legend-item {
      display: grid;
      grid-template-columns: 12px 1fr auto;
      gap: 8px;
      align-items: center;
      font-size: 13px;
    }

.pie-legend-color {
      width: 12px;
      height: 12px;
      border-radius: 50%;
    }

.summary-meter {
      height: 14px;
      border-radius: 999px;
      overflow: hidden;
      background: #e5e7eb;
      margin-top: 10px;
    }

.summary-meter > div {
      height: 100%;
      width: 0;
      background: var(--primary);
      transition: width .25s ease;
    }

.allocation-status {
      margin-top: 12px;
      padding: 12px 14px;
      border-radius: 12px;
      font-weight: 800;
      font-size: 14px;
    }

.allocation-status.ok {
      background: var(--safe-soft);
      color: var(--safe);
    }

.allocation-status.bad {
      background: var(--danger-soft);
      color: var(--danger);
    }

.portfolio-footnote {
      margin-top: 16px;
      padding: 13px;
      border-radius: 12px;
      background: #f8fafc;
      color: var(--muted);
      font-size: 12px;
    }
