.heatmap-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    align-items: center;
    justify-content: center;
}

.stats-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: end;
    justify-content: center;
    padding: 0.7rem 0.85rem;
    margin-bottom: 0.8rem;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
}

.stats-filter {
    display: grid;
    gap: 0.32rem;
    min-width: 10rem;
}

.stats-filter-label {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.62);
}

.stats-filter-select {
    min-width: 0;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(9, 15, 26, 0.86);
    color: rgba(255, 255, 255, 0.92);
    padding: 0.52rem 0.68rem;
    border-radius: 10px;
    font: inherit;
    font-size: 0.86rem;
    font-weight: 700;
}

.stats-filter-select:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.72);
    outline-offset: 2px;
}

.stats-filter-summary {
    display: inline-flex;
    align-items: center;
    min-height: 2.5rem;
    padding: 0.2rem 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.85rem;
    font-weight: 600;
}

.heatmap-metric-toggle {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.18rem;
    padding: 0.18rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
}

.heatmap-metric-btn {
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.78);
    padding: 0.48rem 0.8rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.heatmap-metric-btn:hover {
    color: #ffffff;
    transform: translateY(-1px);
}

.heatmap-metric-btn.active {
    background: linear-gradient(180deg, rgba(123, 187, 239, 0.95) 0%, rgba(66, 140, 201, 0.95) 100%);
    color: #f8fbff;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.16);
}

.stats-data-actions {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.stats-sync-status {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.78);
    padding: 0.42rem 0.64rem;
    border-radius: 8px;
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1.15;
    max-width: 18rem;
}

.stats-sync-status.success {
    border-color: rgba(63, 204, 116, 0.42);
    background: rgba(63, 204, 116, 0.12);
    color: rgba(222, 255, 232, 0.92);
}

.stats-sync-status.busy {
    border-color: rgba(123, 187, 239, 0.42);
    background: rgba(123, 187, 239, 0.12);
    color: rgba(232, 245, 255, 0.94);
}

.stats-sync-status.error {
    border-color: rgba(238, 113, 92, 0.45);
    background: rgba(238, 113, 92, 0.13);
    color: rgba(255, 230, 226, 0.96);
}

.stats-data-btn {
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.86);
    padding: 0.46rem 0.72rem;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.stats-data-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    transform: translateY(-1px);
}

.stats-data-btn:disabled {
    cursor: not-allowed;
    opacity: 0.48;
    transform: none;
}

.heatmap-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    justify-content: center;
}

.heatmap-legend-item,
.heatmap-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    padding: 0.42rem 0.62rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.88);
}

.heatmap-legend-item {
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.heatmap-legend-item.active {
    border-color: rgba(255, 255, 255, 0.34);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.heatmap-legend-filter {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 0;
    padding: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.heatmap-legend-filter:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.72);
    outline-offset: 3px;
    border-radius: 999px;
}

.heatmap-legend-filter > span:last-child {
    display: inline-flex;
    align-items: center;
    gap: 0.32rem;
}

.legend-swatch {
    width: 0.82rem;
    height: 0.82rem;
    border-radius: 50%;
    flex: 0 0 auto;
}

.heatmap-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    justify-content: center;
}

.heatmap-chip-value {
    font-weight: 800;
    color: #ffffff;
}

.heatmap-detail {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 0.85rem 1rem;
    min-height: 132px;
}

.heatmap-detail-title {
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 0.2rem;
}

.heatmap-detail-subtitle {
    font-size: 0.88rem;
    opacity: 0.76;
    margin-bottom: 0.75rem;
}

.stats-metadata-panel {
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 0.85rem 1rem;
    display: grid;
    gap: 0.75rem;
}

.stats-metadata-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.stats-metadata-title {
    font-size: 0.95rem;
    font-weight: 800;
}

.stats-collapsible-actions {
    display: flex;
    justify-content: flex-end;
}

.stats-metadata-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
}

.stats-metadata-item {
    min-width: 0;
    background: rgba(255, 255, 255, 0.055);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 10px;
    padding: 0.58rem 0.65rem;
}

.stats-metadata-label {
    display: block;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.62);
    margin-bottom: 0.2rem;
}

.stats-metadata-value {
    display: block;
    font-size: 0.92rem;
    font-weight: 800;
    color: #ffffff;
    overflow-wrap: anywhere;
}

.stats-context-charts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.stats-context-chart {
    min-width: 0;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 10px;
    padding: 0.65rem;
    overflow: hidden;
}

.stats-context-title {
    font-size: 0.78rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.78);
    margin-bottom: 0.5rem;
}

.stats-context-chart svg {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
}

.stats-section-panel {
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 0.85rem 1rem;
    display: grid;
    gap: 0.75rem;
}

.stats-view-panel .heatmap-detail,
.stats-view-panel .stats-section-panel,
.stats-view-panel .stats-metadata-panel {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
}

.stats-collapsible-panel {
    overflow: hidden;
}

.stats-collapsible-panel > summary {
    list-style: none;
}

.stats-collapsible-panel > summary::-webkit-details-marker {
    display: none;
}

.stats-collapsible-panel.stats-section-panel,
.stats-collapsible-panel.stats-metadata-panel,
.stats-collapsible-panel.heatmap-detail {
    padding: 0;
}

.stats-collapsible-panel.heatmap-detail {
    min-height: 0;
}

.stats-collapsible-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    cursor: pointer;
}

.stats-collapsible-summary:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.72);
    outline-offset: -2px;
}

.stats-collapsible-summary-main {
    min-width: 0;
    display: grid;
    gap: 0.16rem;
}

.stats-collapsible-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #ffffff;
}

.stats-collapsible-note {
    color: rgba(234, 239, 247, 0.74);
    font-size: 0.76rem;
    line-height: 1.35;
}

.stats-collapsible-indicator {
    flex: 0 0 auto;
    width: 0.72rem;
    height: 0.72rem;
    border-right: 2px solid rgba(255, 255, 255, 0.78);
    border-bottom: 2px solid rgba(255, 255, 255, 0.78);
    transform: rotate(45deg);
    transition: transform 0.18s ease, opacity 0.18s ease;
    opacity: 0.92;
}

.stats-collapsible-panel[open] > .stats-collapsible-summary .stats-collapsible-indicator {
    transform: rotate(225deg);
}

.stats-collapsible-body {
    display: grid;
    gap: 0.75rem;
    padding: 0 1rem 0.85rem;
}

.stats-section-header,
.stats-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.stats-section-title,
.stats-breakdown-title,
.stats-detail-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #ffffff;
}

.stats-section-note,
.stats-note,
.stats-breakdown-meta,
.stats-detail-subtitle,
.stats-event-meta {
    color: rgba(234, 239, 247, 0.74);
}

.stats-view-panel .stats-note,
.stats-view-panel .stats-section-note,
.stats-view-panel .stats-detail-subtitle,
.stats-view-panel .fluency-insight {
    font-size: 0.76rem;
    line-height: 1.35;
}

.stats-card-grid,
.stats-mini-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
    gap: 0.28rem;
}

.stats-card,
.stats-mini-card {
    min-width: 0;
    display: grid;
    gap: 0.04rem;
    padding: 0.34rem 0.42rem;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.065);
}

.stats-view-panel .stats-card,
.stats-view-panel .stats-mini-card,
.stats-view-panel .stats-detail-card,
.stats-view-panel .stats-breakdown-panel {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.09);
}

.stats-card-label,
.stats-mini-card span {
    display: inline-flex;
    align-items: center;
    gap: 0.22rem;
    color: rgba(255, 255, 255, 0.52);
    font-size: 0.58rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.stats-card-value,
.stats-mini-card strong {
    color: #ffffff;
    font-size: 0.96rem;
    font-weight: 900;
    overflow-wrap: anywhere;
}

.stats-view-panel .stats-card-value,
.stats-view-panel .stats-mini-card strong,
.stats-view-panel .heatmap-chip-value {
    color: #ffffff;
}

.stats-breakdown-grid,
.stats-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 0.75rem;
}

.stats-breakdown-panel,
.stats-detail-card {
    min-width: 0;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 10px;
    padding: 0.65rem;
    display: grid;
    gap: 0.58rem;
}

.stats-breakdown-list {
    display: grid;
    gap: 0.42rem;
}

.fret-summary-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
    gap: 0.28rem;
}

.fret-summary-chip {
    min-width: 0;
    display: grid;
    gap: 0.04rem;
    padding: 0.34rem 0.42rem;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.065);
}

.fret-summary-chip span {
    display: inline-flex;
    align-items: center;
    gap: 0.22rem;
    color: rgba(255, 255, 255, 0.52);
    font-size: 0.58rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.fret-summary-chip strong {
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 900;
    overflow-wrap: anywhere;
}

.fret-summary-chip small {
    color: rgba(255, 255, 255, 0.58);
    font-size: 0.64rem;
    font-weight: 700;
    line-height: 1.2;
}

.stats-breakdown-list-compact {
    gap: 0.3rem;
}

.stats-breakdown-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.48rem 0.55rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.stats-breakdown-row-compact {
    padding: 0.36rem 0.44rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
}

.stats-breakdown-label {
    font-weight: 800;
    color: #ffffff;
}

.stats-breakdown-row-compact .stats-breakdown-label {
    font-size: 0.86rem;
}

.stats-breakdown-row-compact .stats-breakdown-meta {
    font-size: 0.74rem;
}

.stats-breakdown-value {
    font-size: 0.92rem;
    font-weight: 800;
    color: #ffffff;
}

.stats-breakdown-row-compact .stats-breakdown-value {
    font-size: 0.82rem;
}

.stats-fact-group {
    display: grid;
    gap: 0.34rem;
}

.stats-fact-group-title {
    color: rgba(255, 255, 255, 0.54);
    font-size: 0.64rem;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.stats-fact-list {
    display: grid;
    gap: 0.3rem;
}

.stats-fact-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.6rem;
    padding: 0.34rem 0.42rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stats-fact-row strong {
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 800;
}

.stats-fact-row span {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.76rem;
    font-weight: 700;
    text-align: right;
}

.stats-pill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.28rem;
}

.stats-pill {
    display: inline-flex;
    gap: 0.32rem;
    align-items: center;
    padding: 0.24rem 0.4rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.stats-pill strong {
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 900;
}

.stats-pill span {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.68rem;
    font-weight: 800;
}

.position-events-title {
    font-size: 0.78rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.78);
}

.position-event-log {
    margin-top: 0.85rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.position-event-log-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.52rem 0.62rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    list-style: none;
}

.position-event-log-summary::-webkit-details-marker {
    display: none;
}

.position-event-log-summary::after {
    content: '+';
    color: rgba(255, 255, 255, 0.64);
    font-weight: 900;
    line-height: 1;
}

.position-event-log[open] > .position-event-log-summary::after {
    content: '-';
}

.position-event-log-count {
    margin-left: auto;
    color: rgba(255, 255, 255, 0.58);
    font-size: 0.74rem;
    font-weight: 800;
}

.position-event-log > .heatmap-empty {
    margin-top: 0.6rem;
}

.position-event-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.6rem;
    margin-bottom: 0.6rem;
}

.position-event-summary span {
    display: inline-flex;
    gap: 0.28rem;
    align-items: center;
    padding: 0.34rem 0.5rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.76rem;
    font-weight: 700;
}

.position-event-summary strong {
    color: #ffffff;
}

.position-event-list {
    display: grid;
    gap: 0.34rem;
}

.position-event-item {
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow: hidden;
}

.position-event-item > summary {
    display: grid;
    grid-template-columns: minmax(9rem, 1fr) auto minmax(13rem, 1.2fr);
    gap: 0.55rem;
    align-items: center;
    padding: 0.46rem 0.58rem;
    cursor: pointer;
    list-style: none;
}

.position-event-item > summary::-webkit-details-marker {
    display: none;
}

.position-event-date {
    display: inline-flex;
    align-items: center;
    gap: 0.36rem;
    color: rgba(255, 255, 255, 0.84);
    font-size: 0.78rem;
    font-weight: 800;
    min-width: 0;
}

.position-event-date small {
    color: rgba(255, 255, 255, 0.52);
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1;
}

.position-event-pill {
    justify-self: start;
    padding: 0.18rem 0.42rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
    background: rgba(223, 91, 84, 0.18);
    color: #ffd7d3;
    border: 1px solid rgba(223, 91, 84, 0.28);
}

.position-event-pill.correct {
    background: rgba(40, 199, 214, 0.14);
    color: #d8fbff;
    border-color: rgba(40, 199, 214, 0.26);
}

.position-event-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.28rem 0.45rem;
    color: rgba(255, 255, 255, 0.66);
    font-size: 0.76rem;
    font-weight: 700;
    text-align: right;
}

.position-event-meta span {
    white-space: nowrap;
}

.position-event-body {
    padding: 0 0.58rem 0.58rem;
    display: grid;
    gap: 0.48rem;
}

.position-event-section-title {
    color: rgba(255, 255, 255, 0.58);
    font-size: 0.66rem;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.position-event-round-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.42rem;
}

.position-event-round-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.24rem 0.42rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.07);
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.68rem;
    font-weight: 800;
}

.position-event-round-meta strong {
    color: rgba(255, 255, 255, 0.86);
    font-size: 0.86rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-weight: 800;
}

.position-event-section {
    display: grid;
    gap: 0.42rem;
}

.position-event-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
    gap: 0.32rem;
}

.position-event-fact {
    min-width: 0;
    display: grid;
    gap: 0.08rem;
    padding: 0.34rem 0.42rem;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.055);
}

.position-event-fact span {
    color: rgba(255, 255, 255, 0.48);
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.position-event-fact strong {
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.82rem;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.position-event-side-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    gap: 0.34rem;
}

.position-event-side-card {
    min-width: 0;
    display: grid;
    gap: 0.12rem;
    padding: 0.4rem 0.46rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.032);
    border: 1px solid rgba(255, 255, 255, 0.055);
}

.position-event-side-label {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.position-event-side-value {
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.position-event-side-meta {
    color: rgba(255, 255, 255, 0.58);
    font-size: 0.72rem;
    font-weight: 700;
}

.position-event-inline-details {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 0.34rem;
}

.position-event-inline-details summary {
    width: max-content;
    max-width: 100%;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.58);
    font-size: 0.68rem;
    font-weight: 800;
}

.position-event-inline-details .position-event-body-grid {
    margin-top: 0.45rem;
}

.position-event-body-grid {
    display: grid;
    grid-template-columns: 7rem minmax(0, 1fr);
    gap: 0.28rem 0.6rem;
    font-size: 0.74rem;
}

.position-event-body-grid span {
    color: rgba(255, 255, 255, 0.58);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.position-event-body-grid strong {
    min-width: 0;
    color: rgba(255, 255, 255, 0.84);
    font-weight: 800;
    overflow-wrap: anywhere;
}

.position-event-attempts {
    display: grid;
    gap: 0.28rem;
}

.position-event-attempt {
    display: grid;
    grid-template-columns: 1.75rem minmax(0, 1fr) auto auto;
    gap: 0.45rem;
    align-items: center;
    padding: 0.32rem 0.42rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.74rem;
    font-weight: 700;
}

.position-event-attempt.correct {
    border-color: rgba(40, 199, 214, 0.18);
    background: rgba(40, 199, 214, 0.075);
}

.position-event-attempt.wrong {
    border-color: rgba(223, 91, 84, 0.18);
    background: rgba(223, 91, 84, 0.065);
}

.position-event-attempt.empty {
    grid-template-columns: 1fr;
}

.position-event-attempt-marker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.45rem;
    height: 1.45rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.09);
    color: rgba(255, 255, 255, 0.82);
    font-weight: 900;
}

.position-event-attempt-main {
    min-width: 0;
    display: grid;
    gap: 0.04rem;
}

.position-event-attempt-main strong {
    color: #ffffff;
    font-size: 0.88rem;
    overflow-wrap: anywhere;
}

.position-event-attempt-main small {
    color: rgba(255, 255, 255, 0.56);
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1;
}

.position-event-attempt-time {
    color: rgba(255, 255, 255, 0.82);
    font-weight: 900;
    white-space: nowrap;
}

.position-event-attempt-result {
    min-width: 2rem;
    justify-self: end;
    padding: 0.16rem 0.3rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.86rem;
    font-weight: 900;
    text-align: center;
    line-height: 1;
}

.position-event-attempt.correct .position-event-attempt-result {
    background: rgba(40, 199, 214, 0.16);
    color: #d8fbff;
}

.position-event-attempt.wrong .position-event-attempt-result {
    background: rgba(223, 91, 84, 0.16);
    color: #ffd7d3;
}

.position-event-technical {
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    padding-top: 0.42rem;
}

.position-event-technical summary {
    width: max-content;
    max-width: 100%;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.58);
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.position-event-technical .position-event-body-grid {
    margin-top: 0.5rem;
}

.position-event-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.42rem;
    margin: 0.48rem 0;
}

.position-event-pagination span {
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.72rem;
    font-weight: 800;
}

.position-event-page-btn {
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.84);
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 900;
    padding: 0.28rem 0.52rem;
}

.position-event-page-btn:disabled {
    cursor: default;
    opacity: 0.38;
}

.fluency-breakdown {
    margin-top: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 0.75rem;
}

.fluency-compact-summary {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    align-items: center;
    gap: 0.45rem;
    padding: 0.44rem 0.58rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.075);
}

.fluency-compact-title {
    display: inline-flex;
    align-items: center;
    gap: 0.32rem;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.stats-view-panel .stats-card-label,
.stats-view-panel .stats-mini-card span,
.stats-view-panel .stats-note,
.stats-view-panel .stats-section-note,
.stats-view-panel .stats-detail-subtitle {
    color: rgba(240, 246, 255, 0.8);
}

.fluency-compact-summary > strong {
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 900;
}

.fluency-compact-summary > span:last-child {
    min-width: 0;
    color: rgba(255, 255, 255, 0.66);
    font-size: 0.74rem;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.fluency-insight {
    margin-top: 0.42rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1.35;
}

.fluency-advanced {
    margin-top: 0.42rem;
}

.fluency-advanced > summary {
    width: max-content;
    max-width: 100%;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.fluency-advanced-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.42rem;
}

.fluency-advanced-grid span,
.fluency-context-line {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.28rem;
    align-items: center;
    padding: 0.28rem 0.4rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.64);
    font-size: 0.68rem;
    font-weight: 700;
}

.fluency-advanced-grid strong,
.fluency-context-line strong {
    color: #ffffff;
    font-weight: 900;
}

.fluency-context-lines {
    display: grid;
    gap: 0.28rem;
    margin-top: 0.36rem;
}

.stats-event-list {
    display: grid;
    gap: 0.48rem;
    margin-top: 0.48rem;
}

.stats-event-item {
    padding: 0.58rem 0.65rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.stats-event-title {
    font-weight: 800;
    color: #ffffff;
}

.stats-event-meta {
    margin-top: 0.32rem;
    font-size: 0.76rem;
    line-height: 1.35;
}

.stats-pagination {
    display: flex;
    justify-content: space-between;
    gap: 0.42rem;
    margin: 0.48rem 0;
}

.stats-pagination span {
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.72rem;
    font-weight: 800;
}

.stats-pagination button {
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.84);
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 900;
    padding: 0.28rem 0.52rem;
}

.stats-pagination button:disabled {
    cursor: default;
    opacity: 0.38;
}

@media (max-width: 768px) {
    .fret-summary-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .heatmap-legend,
    .heatmap-summary {
        gap: 0.35rem;
    }

    .heatmap-legend-item,
    .heatmap-chip {
        font-size: 0.74rem;
        padding: 0.34rem 0.52rem;
    }

    .heatmap-detail,
    .stats-section-panel,
    .stats-metadata-panel {
        padding: 0.75rem 0.8rem;
    }

    .heatmap-detail {
        min-height: 0;
    }

    .heatmap-detail-title {
        font-size: 0.92rem;
    }

    .heatmap-detail-subtitle {
        font-size: 0.8rem;
        margin-bottom: 0.62rem;
    }

    .stats-metadata-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .position-event-item > summary {
        grid-template-columns: 1fr;
    }

    .position-event-meta {
        justify-content: flex-start;
        text-align: left;
    }

    .fluency-compact-summary {
        grid-template-columns: 1fr;
        gap: 0.24rem;
    }

    .stats-context-charts,
    .stats-breakdown-grid,
    .stats-detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .fret-summary-strip {
        grid-template-columns: 1fr;
    }

    .stats-metadata-header,
    .stats-section-header,
    .stats-detail-header {
        align-items: stretch;
    }

    .stats-metadata-title,
    .stats-section-title {
        width: 100%;
    }

    .stats-data-actions {
        width: 100%;
    }

    .stats-data-btn {
        flex: 1 1 0;
    }

    .heatmap-detail {
        padding: 0.68rem 0.72rem;
    }

    .heatmap-detail-title {
        font-size: 0.88rem;
    }

    .stats-metadata-grid {
        grid-template-columns: 1fr;
    }

    .position-event-body-grid {
        grid-template-columns: 1fr;
    }

    .position-event-round-meta span {
        width: 100%;
        justify-content: space-between;
    }

    .position-event-attempt {
        grid-template-columns: 1.6rem minmax(0, 1fr) auto;
        gap: 0.3rem;
    }

    .position-event-attempt-result {
        grid-column: 2 / -1;
        justify-self: start;
        min-width: 0;
    }
}

@media (max-width: 768px) and (orientation: portrait) {
    .heatmap-legend-item,
    .heatmap-chip {
        padding: 0.28rem 0.42rem;
        font-size: 0.68rem;
    }

    .heatmap-detail {
        padding: 0.58rem 0.62rem;
    }

    .heatmap-detail-title {
        font-size: 0.82rem;
    }

    .heatmap-detail-subtitle {
        font-size: 0.72rem;
        margin-bottom: 0.48rem;
    }
}
