:root {
  color-scheme: light;
  --ink: #172026;
  --muted: #64717c;
  --line: #d9e1e7;
  --paper: #f7f9fb;
  --panel: #ffffff;
  --navy: #10243a;
  --cyan: #0099b8;
  --green: #15875f;
  --red: #b84d4d;
  --yellow: #e0a21a;
  --shadow: 0 16px 40px rgba(16, 36, 58, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  background: var(--paper);
  color: var(--ink);
  letter-spacing: 0;
}

.site-header {
  background:
    linear-gradient(rgba(16, 36, 58, 0.76), rgba(16, 36, 58, 0.52)),
    url("./assets/semiconductor-board.svg");
  background-size: cover;
  background-position: center;
  color: #fff;
  min-height: 360px;
  display: flex;
  align-items: flex-end;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.header-inner {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 72px 0 44px;
}

.eyebrow {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  color: #9de5ef;
}

h1 {
  margin: 0;
  font-size: 76px;
  line-height: 1.02;
  font-weight: 800;
}

.lead {
  max-width: 980px;
  margin: 18px 0 0;
  font-size: 18px;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.9);
}

main {
  width: min(1120px, calc(100% - 32px));
  margin: -36px auto 72px;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.status-strip > div {
  background: var(--panel);
  padding: 22px;
}

.label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}

.status-strip strong {
  font-size: 32px;
  line-height: 1.1;
}

.subvalue {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 20px;
  margin-top: 20px;
}

.panel,
.notice {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel {
  padding: 24px;
}

.panel-head h2,
.section-head h2,
.notice h2 {
  margin: 0;
  font-size: 24px;
}

.panel-head p,
.section-head p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.allocation-chart {
  margin-top: 24px;
}

.bar-row {
  display: grid;
  grid-template-columns: 76px 1fr 68px;
  gap: 12px;
  align-items: center;
  margin: 12px 0;
}

.ticker {
  font-weight: 800;
}

.ticker small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.bar-track {
  height: 14px;
  background: #e7eef3;
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  display: block;
  height: 100%;
  background: var(--cyan);
}

.bar-fill.variable {
  background: var(--yellow);
}

.bucket-list {
  margin-top: 22px;
  display: grid;
  gap: 12px;
}

.bucket-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.bucket-item strong {
  display: block;
  margin-bottom: 6px;
}

.bucket-item span {
  color: var(--muted);
  line-height: 1.6;
}

.section {
  margin-top: 34px;
}

.section-head {
  margin-bottom: 14px;
}

.table-wrap {
  overflow-x: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 840px;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}

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

.note-buys-table th:last-child,
.memo-head {
  text-align: left;
}

.note-buys-table th,
.note-buys-table th:first-child,
.note-buys-table th:last-child,
.note-buys-table .memo-head {
  text-align: center;
}

.sort-button {
  appearance: none;
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.sort-button:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 4px;
  border-radius: 4px;
}

.sort-mark {
  min-width: 10px;
  color: var(--cyan);
  font-weight: 900;
}

th {
  font-size: 12px;
  color: var(--muted);
}

td {
  font-size: 15px;
}

.memo-cell {
  min-width: 320px;
  max-width: 520px;
  text-align: left;
  white-space: normal;
  line-height: 1.7;
}

.memo-cell a {
  color: var(--cyan);
  font-weight: 700;
  text-decoration: none;
}

.memo-cell a:hover {
  text-decoration: underline;
}

.positive {
  color: var(--green);
  font-weight: 800;
}

.negative {
  color: var(--red);
  font-weight: 800;
}

.holding-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.holding-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.holding-card h3 {
  margin: 0 0 8px;
  font-size: 20px;
}

.holding-card .role {
  display: inline-block;
  margin-bottom: 12px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #e8f7f9;
  color: #006d82;
  font-size: 12px;
  font-weight: 800;
}

.holding-card p {
  margin: 10px 0 0;
  line-height: 1.75;
}

.holding-card .risk {
  color: var(--muted);
}

.watch-themes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.watch-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.watch-card h3 {
  margin: 0 0 10px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 800;
}

.notice {
  margin-top: 34px;
  padding: 24px;
}

.notice p {
  margin: 12px 0 0;
  line-height: 1.8;
  color: var(--muted);
}

@media (max-width: 860px) {
  .site-header {
    min-height: 310px;
  }

  h1 {
    font-size: 36px;
    line-height: 1.08;
  }

  .lead {
    font-size: 16px;
  }

  .status-strip strong {
    font-size: 24px;
  }

  .status-strip,
  .portfolio-grid,
  .holding-cards,
  .watch-themes {
    grid-template-columns: 1fr;
  }

  main {
    margin-top: -24px;
  }
}
