#yearly {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 12px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.yearly-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.yearly-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

#yearlyYearLabel {
  min-width: 64px;
  text-align: center;
  font-weight: 700;
}

.year-table-wrapper {
  width: 100%;
  overflow-x: auto;
  position: relative;
  isolation: isolate;
  -webkit-overflow-scrolling: touch;
}

.year-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.year-table th,
.year-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  text-align: center;
  background: var(--surface);
}

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

.year-table th:last-child,
.year-table td:last-child {
  text-align: right;
}

.year-table thead th {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  transform: translateZ(0);
  backface-visibility: hidden;
}

.year-table th:first-child,
.year-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 60;
  background: var(--surface);
  box-shadow: 6px 0 10px rgba(0, 0, 0, 0.08);
  transform: translateZ(0);
  backface-visibility: hidden;
  will-change: transform;
}

.year-table thead th:first-child {
  z-index: 80;
}

.year-total-row th,
.year-total-row td {
  font-weight: 700;
  border-top: 2px solid var(--border);
  background: color-mix(in srgb, var(--surface) 92%, var(--text) 8%);
}

.year-table tbody tr:last-child th,
.year-table tbody tr:last-child td {
  border-bottom: 0;
}

.year-total-row th:first-child,
.year-total-row td:first-child {
  border-top: 2px solid var(--border);
}

.h-short {
  display: none;
}

@media (min-width: 900px) {
  #yearly {
    width: var(--content-page-width);
    max-width: var(--content-max-width);
    margin: 12px auto;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.06);
  }
}

@media (max-width: 768px) {
  .h-full { display: none; }
  .h-short { display: inline; }

  .year-table th,
  .year-table td {
    padding: 5px 6px;
    font-size: 12px;
    line-height: 1.35;
  }

  .year-table th:first-child,
  .year-table td:first-child {
    position: static;
    box-shadow: none;
    transform: none;
    backface-visibility: visible;
    will-change: auto;
  }

  .year-split {
    display: flex;
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--surface);
  }

  .year-fixed-col {
    flex: 0 0 auto;
    position: relative;
    z-index: 1;
    box-shadow: 4px 0 8px rgba(0, 0, 0, 0.08);
  }

  .year-scroll-col {
    flex: 1 1 auto;
    min-width: 0;
    padding-bottom: 4px;
  }

  .year-scroll-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .year-fixed-table,
  .year-scroll-table {
    border-collapse: separate;
    border-spacing: 0;
    background: var(--surface);
    table-layout: fixed;
  }

  .year-fixed-table {
    width: max-content;
  }

  .year-scroll-table {
    width: max-content;
    min-width: 100%;
  }

  .year-fixed-table th,
  .year-fixed-table td,
  .year-scroll-table th,
  .year-scroll-table td {
    padding: 5px 6px;
    font-size: 12px;
    line-height: 1.35;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    background: var(--surface);
    text-align: center;
  }

  .year-fixed-table th,
  .year-fixed-table td {
    text-align: left;
  }

  .year-scroll-table th:last-child,
  .year-scroll-table td:last-child {
    text-align: right;
  }

  .year-fixed-table tbody tr:last-child th,
  .year-scroll-table tbody tr:last-child td {
    border-bottom: 0;
  }

  .year-fixed-table .year-total-row th,
  .year-scroll-table .year-total-row td {
    font-weight: 700;
    border-top: 2px solid var(--border);
    background: color-mix(in srgb, var(--surface) 92%, var(--text) 8%);
  }
}
