:root {
    --nav-bg: rgba(10, 18, 38, 0.86);
    --nav-border: rgba(255, 255, 255, 0.16);
    --nav-text: #eaf0f5;
    --nav-active: #88a9c6;

    --ui-panel-bg: rgba(0, 0, 40, 0.72);
    --ui-border: rgba(255, 255, 255, 0.18);
    --ui-text: #ffffff;
    --ui-title: #e1e6eb;
    --ui-accent: #3a5a7e;
    --ui-accent-hover: #2c4968;
    --ui-input-bg: rgba(255, 255, 255, 0.94);
    --ui-input-text: #2b2b2b;
    --ui-muted: #b8c2cc;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: Arial, sans-serif;
}

.base-layout {
    min-height: 100vh;
    color: var(--ui-text);
}

.navbar {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(6px);
    background: var(--nav-bg);
    border-bottom: 1px solid var(--nav-border);
}

.navbar-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.brand {
    text-decoration: none;
    color: var(--nav-text);
    font-weight: 700;
    letter-spacing: 0.4px;
}

.nav-links {
    display: flex;
    gap: 8px;
}

.nav-link {
    text-decoration: none;
    color: var(--nav-text);
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid transparent;
}

.nav-link:hover {
    border-color: var(--nav-border);
}

.nav-link.active {
    color: var(--nav-active);
    border-color: var(--nav-border);
}

.page-wrap {
    min-height: calc(100vh - 62px);
}

.analyze-bg {
    background: #000000;
}

.tool-page {
    min-height: calc(100vh - 62px);
    padding: 24px;
    color: var(--ui-text);
}

.tool-shell {
    width: min(1200px, 100%);
    margin: 0 auto;
    display: grid;
    gap: 18px;
}

.tool-panel {
    background: #2c2c2c;
    border: 1px solid #3a3a3a;
    border-radius: 14px;
    padding: 20px;
}

.tool-title {
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 8px;
}

.tool-subtitle {
    font-size: 19px;
    font-weight: 700;
    color: #f0f0f0;
    margin: 0 0 12px;
}

.tool-hint {
    color: #d1d1d1;
    font-size: 14px;
    line-height: 1.5;
}

.tool-upload-actions,
.tool-action-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.tool-dropzone {
    margin-top: 12px;
    border: 2px dashed #4d5a66;
    border-radius: 10px;
    padding: 18px;
    text-align: center;
    color: #d8d8d8;
    background: #1b1b1b;
    cursor: pointer;
}

.tool-dropzone.dragover {
    border-color: #87a6c1;
    background: #222b33;
}

.btn,
.cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    background: #2e4963;
    color: #ffffff;
    font-weight: 600;
    padding: 10px 14px;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    font-size: 16px;
    line-height: 1.2;
}

.btn:hover,
.cta-button:hover {
    background: #355674;
    border-color: #4d5a66;
}

.btn-secondary {
    background: #1b1b1b;
}

.btn-secondary:hover {
    background: #252525;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
}

.tool-error,
.error {
    background-color: rgba(120, 0, 0, 0.65);
    color: #ffffff;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 120, 120, 0.35);
    margin-bottom: 14px;
    font-size: 15px;
}

.tool-frame {
    width: 100%;
    background: #1b1b1b;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    overflow: hidden;
}

.tool-canvas-surface {
    background: #ffffff;
    border: 1px solid #2f2f2f;
    border-radius: 8px;
}

.tool-empty-state {
    color: #d1d1d1;
    padding: 28px;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

.tool-table-wrap {
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    background: #1b1b1b;
    overflow: hidden;
}

.tool-table {
    width: 100%;
    border-collapse: collapse;
    background: #1b1b1b;
}

.tool-table th,
.tool-table td {
    border-bottom: 1px solid #303030;
    padding: 9px 10px;
    text-align: center;
    font-size: 14px;
}

.tool-table th {
    background: #222222;
    color: #f0f0f0;
}

.tool-table td {
    color: #e6e6e6;
}

.is-hidden {
    display: none !important;
}

.analyze-upload-panel {
    width: min(1200px, 100%);
    margin: 0 auto 18px auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.analyze-file-input {
    flex: 1 1 280px;
    min-width: 200px;
    background: #1f1f1f;
    color: #fff;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    padding: 8px;
}

.shots-list-wrap {
    min-height: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    box-sizing: border-box;
}

.shots-list-panel {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    width: min(1200px, 100%);
}

.last-shot-logo {
    width: 50%;
    max-width: 360px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.last-second-panel {
    width: 100%;
    background: #1f1f1f;
    border: 1px solid #3a3a3a;
    border-radius: 12px;
    padding: 16px 18px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.last-second-title {
    font-weight: 600;
    letter-spacing: 0.2px;
}

.shots-list-summary-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
    font-size: 16px;
}

.shots-list-summary-column {
    display: grid;
    gap: 8px;
    align-content: start;
}

.shots-list-summary-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
}

.shots-list-summary-subtitle {
    color: #87a6c1;
    font-weight: 700;
    margin-top: 6px;
}

.shots-list-summary-subtitle:first-child {
    margin-top: 0;
}

.last-second-label {
    color: #cfcfcf;
}

.last-second-value {
    color: #ffffff;
    font-weight: 600;
    text-align: right;
    min-width: 120px;
}

.series-table-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    align-items: start;
}

.series-table-wrap {
    overflow: hidden;
}

.series-table {
    width: 100%;
    border-collapse: collapse;
    background: #1b1b1b;
}

.series-table td {
    padding: 8px 10px;
    text-align: left;
    font-size: 14px;
    border-bottom: 1px solid #2f2f2f;
    color: #e6e6e6;
}

.series-table tbody tr {
    cursor: pointer;
    user-select: none;
}

.series-table tbody tr.selected td {
    background: #2a3a4a;
}

.series-table td:last-child {
    text-align: right;
    color: #fff;
    font-weight: 600;
}

.shots-table-wrap {
    width: 100%;
    min-width: 0;
    overflow-x: auto;
}

.shots-table {
    width: 100%;
    border-collapse: collapse;
    background: #1b1b1b;
}

.shots-table th,
.shots-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #2f2f2f;
    text-align: center;
    vertical-align: middle;
    font-size: 14px;
}

.shots-table th {
    background: #222;
    color: #87a6c1;
    font-weight: 600;
    white-space: normal;
    line-height: 1.2;
}

.shots-table td {
    color: #e6e6e6;
}

.shots-table thead tr:first-child th {
    vertical-align: middle;
    border-bottom: 0;
}

.shots-table thead tr:first-child th[colspan] {
    position: relative;
    padding-bottom: 14px;
}

.shots-table thead tr:first-child th[colspan]::after {
    content: "";
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 0;
    height: 3px;
    background: #87a6c1;
    border-radius: 2px;
}

.shots-table tbody tr:nth-child(even) td {
    background: #1f1f1f;
}

.shots-table tbody tr {
    cursor: pointer;
    user-select: none;
}

.shots-table tbody tr.selected td {
    background: #2a3a4a;
}

.delete-shot-link {
    appearance: none;
    border: 0;
    background: transparent;
    color: #ffb3a8;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    padding: 0;
    text-decoration: none;
}

.delete-shot-link:hover {
    color: #ffd5cf;
    text-decoration: underline;
}

.shots-direction-arrow {
    display: inline-block;
    transform: rotate(var(--angle, 0deg));
    transform-origin: center;
    font-size: 16px;
    line-height: 1;
    color: #e6e6e6;
}

.shots-list-content {
    display: block;
}

.shots-big-target-panel {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.trace-target-frame {
    width: 100%;
    background: #1f1f1f;
    border: 1px solid #3a3a3a;
    border-radius: 12px;
    padding: 14px 16px;
    box-sizing: border-box;
}

.shot-target-shell {
    width: min(1280px, 100%);
}

.shot-target-dropzone {
    margin-top: 0;
}

.shot-target-image-frame {
    width: 100%;
    min-height: 420px;
    display: grid;
    place-items: center;
}

.shot-target-canvas {
    width: 100%;
    height: auto;
    display: block;
    background: #111111;
    cursor: crosshair;
}

.shot-target-field {
    display: grid;
    grid-template-columns: auto minmax(320px, 520px);
    gap: 12px;
    align-items: center;
    justify-content: end;
    margin-top: 14px;
}

.shot-target-field label {
    color: #d1d1d1;
    font-size: 14px;
    font-weight: 700;
}

.shot-target-field select {
    width: 100%;
    border: 1px solid #3a3a3a;
    border-radius: 6px;
    background: #f6f6f6;
    color: #1b1b1b;
    font-size: 15px;
    padding: 10px;
}

.shot-target-actions.right {
    justify-content: flex-end;
}

.shot-target-edge-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-top: 14px;
}

.edge-btn.active {
    background: #3b5d7a;
    border-color: #87a6c1;
    color: #ffffff;
}

.edge-btn:disabled,
#add-shot-btn:disabled,
#export-target-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.shot-target-summary {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #444444;
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    align-items: center;
}

.shot-target-stat-label {
    color: #cfcfcf;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.shot-target-stat-value {
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.shot-target-stat {
    display: inline-flex;
    gap: 8px;
    min-width: 0;
    align-items: baseline;
}

.shot-table-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.shot-table-wrap {
    margin-top: 12px;
    max-height: 340px;
    overflow-y: auto;
}

.shot-target-session-canvas {
    margin-top: 14px;
    width: 100%;
    aspect-ratio: 1 / 1;
    display: block;
}

.shot-direction {
    display: inline-block;
    color: #ffffff;
    font-size: 18px;
    font-weight: 700;
    transform: rotate(var(--shot-angle, 0deg));
    transform-origin: center;
    line-height: 1;
}

.shot-delete-link {
    color: #f09a9a;
    background: transparent;
    border: 0;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
}

.home-bg {
    background: radial-gradient(circle at 20% 20%, #2d4d6b 0%, #122133 45%, #0a1422 100%);
}

.home-card {
    max-width: 760px;
    margin: 84px auto;
    background: rgba(9, 23, 44, 0.74);
    border: 1px solid var(--ui-border);
    border-radius: 14px;
    padding: 42px;
    text-align: center;
}

.home-card h1 {
    margin: 0 0 18px;
    font-size: 40px;
    color: var(--ui-title);
}

.home-card p {
    margin: 0 0 28px;
    line-height: 1.5;
    color: #d3dde8;
}

.home-cta-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.home-cta-row .cta-button {
    padding: 14px 22px;
}

.cta-alt {
    background: #365f4a;
}

.cta-alt:hover {
    background: #2b4e3d;
}

.training-bg {
    background-image: url('../images/backgrounds/shooter_background.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

.moving-target-bg {
    background-image: linear-gradient(rgba(0, 0, 0, 0.22), rgba(0, 0, 0, 0.58)), url('../images/backgrounds/moving_target_background.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

.target-page-shell {
    min-height: calc(100vh - 62px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    color: var(--ui-text);
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.6);
    padding-top: clamp(22px, 6.5vh, 80px);
    padding-bottom: clamp(18px, 4vh, 56px);
    padding-left: 16px;
    padding-right: 16px;
}

.container {
    width: 100%;
    max-width: 520px;
    background-color: var(--ui-panel-bg);
    border: 1px solid var(--ui-border);
    border-radius: 10px;
    padding: 26px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

.container h1 {
    text-align: center;
    margin: 0 0 40px 0;
    color: var(--ui-title);
    font-size: 36px;
    font-weight: 700;
}

.training-target-page {
    justify-content: flex-start;
    gap: 18px;
}

.training-target-title {
    width: min(520px, 100%);
    margin: 0;
    color: var(--ui-title);
    font-size: 36px;
    font-weight: 700;
    text-align: left;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.65);
}

.training-target-container {
    background-color: rgba(0, 0, 0, 0.42);
}

.training-target-actions {
    width: min(520px, 100%);
    display: flex;
    justify-content: flex-end;
}

.moving-target-page {
    justify-content: flex-start;
    gap: 18px;
}

.moving-target-form {
    width: min(620px, 100%);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.moving-target-section {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    padding: 18px 20px;
    background: rgba(0, 0, 0, 0.42);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
}

.moving-target-section-title {
    font-size: 18px;
    font-weight: 700;
    color: #f3f6f8;
    margin-bottom: 14px;
}

.moving-target-section-title.speed-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.moving-target-note {
    margin: -4px 0 14px;
    color: var(--ui-muted);
    font-size: 14px;
    line-height: 1.4;
    text-align: left;
}

#boar-speed-value {
    font-size: 18px;
    font-weight: 700;
    color: #f3f6f8;
    white-space: nowrap;
}

.moving-target-grid {
    display: grid;
    gap: 14px;
}

.moving-target-grid.two-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.moving-target-grid.three-col {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.moving-target-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.moving-target-field label {
    font-size: 14px;
    font-weight: 700;
    color: #dce4eb;
}

.moving-target-field input,
.moving-target-field select {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid #c8d0d8;
    border-radius: 6px;
    background-color: var(--ui-input-bg);
    color: var(--ui-input-text);
    font-size: 15px;
}

.moving-target-field input[readonly] {
    color: #4c5862;
    background: rgba(255, 255, 255, 0.78);
}

.moving-target-speed-row {
    display: grid;
    grid-template-columns: auto minmax(130px, 1fr) auto;
    gap: 12px;
    align-items: center;
    color: #dce4eb;
    font-size: 14px;
    font-weight: 700;
}

.moving-target-speed-row input[type='range'] {
    width: 100%;
    accent-color: var(--ui-accent);
}

.moving-target-readouts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.moving-target-readouts div {
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    padding: 12px;
    min-width: 0;
}

.moving-target-readouts span {
    display: block;
    color: var(--ui-muted);
    font-size: 12px;
    margin-bottom: 5px;
}

.moving-target-readouts strong {
    display: block;
    color: #ffffff;
    font-size: 15px;
    overflow-wrap: anywhere;
}

.moving-target-status {
    width: 100%;
    min-height: 20px;
    color: var(--ui-muted);
    font-size: 14px;
    text-align: center;
}

.moving-target-error {
    width: min(620px, 100%);
}

.moving-target-status.error-state {
    color: #ffb8b8;
}

form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.form-group label {
    flex: 1;
    text-align: right;
    font-size: 16px;
    font-weight: 500;
    min-width: 150px;
}

.control {
    flex: 1;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.control input,
.control select {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background-color: var(--ui-input-bg);
    color: var(--ui-input-text);
}

.control input.readonly-field {
    background: rgba(255, 255, 255, 0.82);
    color: #2f3a44;
    border-color: rgba(255, 255, 255, 0.35);
    cursor: not-allowed;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

input[type='number']::-webkit-outer-spin-button,
input[type='number']::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type='number'] {
    -moz-appearance: textfield;
    appearance: textfield;
}

input[type='checkbox'] {
    accent-color: var(--ui-accent);
    width: auto;
    transform: scale(1.18);
    cursor: pointer;
}

.stepper-btn {
    width: 48px;
    height: 42px;
    border-radius: 6px;
    border: 1px solid var(--ui-border);
    background-color: rgba(255, 255, 255, 0.12);
    color: var(--ui-text);
    cursor: pointer;
    font-size: 20px;
    font-weight: 700;
    flex: 0 0 auto;
}

.stepper-btn:hover {
    background-color: rgba(255, 255, 255, 0.18);
}

.stepper-input {
    text-align: center;
}

input[type='color'] {
    width: 100%;
    height: 44px;
    padding: 0;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: var(--ui-input-bg);
    cursor: pointer;
}

footer {
    width: 100%;
    max-width: 760px;
    background-color: var(--ui-panel-bg);
    border: 1px solid var(--ui-border);
    border-radius: 10px;
    padding: 14px 0;
    margin-bottom: clamp(14px, 2vh, 32px);
}

.footer-inner {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.footer-label {
    font-size: 15px;
    color: var(--ui-muted);
    font-weight: 400;
}

.footer-logo {
    height: 42px;
    filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.6));
    cursor: pointer;
    display: block;
}

@media (max-width: 700px) {
    .navbar-inner {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 520px) {
    .tool-page {
        padding: 14px;
    }

    .tool-panel {
        padding: 16px;
    }

    .tool-title {
        font-size: 22px;
    }

    .tool-subtitle {
        font-size: 18px;
    }

    .home-card {
        margin: 36px 14px;
        padding: 24px;
    }

    .home-card h1 {
        font-size: 30px;
    }

    .container {
        padding: 20px;
    }

    .container h1 {
        font-size: 28px;
        margin-bottom: 30px;
    }

    .moving-target-container {
        padding: 20px;
    }

    .moving-target-container h1 {
        font-size: 28px;
    }

    .moving-target-grid.two-col,
    .moving-target-grid.three-col,
    .moving-target-readouts {
        grid-template-columns: 1fr;
    }

    .form-group label {
        min-width: 120px;
    }

    .footer-logo {
        height: 36px;
    }

    .stepper-btn {
        width: 46px;
    }
}

/* analyze_traces template-specific */
    .tt-frame-shell {
        position: relative;
        width: 100%;
        aspect-ratio: 1 / 1;
    }

    .shots-big-target-shell {
        width: 100%;
        align-self: center;
    }

    .review-shots-controls {
        position: absolute;
        left: 10px;
        bottom: 12px;
        z-index: 3;
        display: flex;
        gap: 8px;
    }

    .review-shots-navigation {
        position: absolute;
        right: 12px;
        bottom: 14px;
        z-index: 3;
        display: flex;
        gap: 10px;
    }

    .review-shots-nav-btn {
        border: 1px solid #3a3a3a;
        border-radius: 999px;
        background: rgba(0, 0, 0, 0.72);
        color: #fff;
        font: inherit;
        font-weight: 600;
        padding: 7px 12px;
        cursor: pointer;
    }

    .review-shots-nav-btn:disabled {
        opacity: 0.45;
        cursor: default;
    }

    .review-shots-play-btn {
        border: 1px solid #3a3a3a;
        border-radius: 999px;
        background: rgba(0, 0, 0, 0.7);
        color: #fff;
        font: inherit;
        font-weight: 600;
        font-size: 16px;
        line-height: 1;
        width: 38px;
        height: 38px;
        padding: 0;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .review-shots-icon {
        position: relative;
        display: block;
        width: 16px;
        height: 16px;
    }

    .review-shots-icon-play::before {
        content: "";
        position: absolute;
        left: 4px;
        top: 2px;
        width: 0;
        height: 0;
        border-top: 6px solid transparent;
        border-bottom: 6px solid transparent;
        border-left: 9px solid #fff;
    }

    .review-shots-play-btn.is-pause .review-shots-icon-play::before,
    .review-shots-play-btn.is-pause .review-shots-icon-play::after {
        content: "";
        position: absolute;
        top: 2px;
        width: 4px;
        height: 12px;
        background: #fff;
        border-radius: 1px;
    }

    .review-shots-play-btn.is-pause .review-shots-icon-play::before {
        left: 3px;
        border: 0;
    }

    .review-shots-play-btn.is-pause .review-shots-icon-play::after {
        right: 3px;
    }

    .review-shots-icon-stop::before {
        content: "";
        position: absolute;
        left: 3px;
        top: 3px;
        width: 10px;
        height: 10px;
        background: #fff;
        border-radius: 1px;
    }

    .shots-big-target-canvas {
        width: 100%;
        height: 100%;
        display: block;
        background: #ffffff;
        border-radius: 8px;
        border: 1px solid #2f2f2f;
    }

    .trace-source-row {
        margin-top: 10px;
        display: flex;
        justify-content: flex-end;
        width: 100%;
    }

    .trace-source-select {
        border: 1px solid #4d5a66;
        border-radius: 6px;
        background: #1b1b1b;
        color: #d8d8d8;
        font-size: 13px;
        font-weight: 700;
        padding: 8px 12px;
        cursor: pointer;
        min-width: 180px;
    }

    .trace-source-select:focus-visible {
        outline: 2px solid #87a6c1;
        outline-offset: 2px;
    }

    .shots-legend {
        margin-top: 10px;
        background: #1b1b1b;
        border: 1px solid #323232;
        border-radius: 8px;
        padding: 10px 12px;
        width: 100%;
        box-sizing: border-box;
    }

    .shots-legend-title {
        font-size: 13px;
        font-weight: 700;
        color: #ececec;
        margin-bottom: 6px;
    }

    .shots-legend-list {
        margin: 0;
        padding-left: 18px;
        color: #d6d6d6;
        font-size: 12px;
        line-height: 1.35;
    }

    .shots-legend-list li + li {
        margin-top: 4px;
    }

    .legend-swatch {
        display: inline-block;
        width: 10px;
        height: 10px;
        border-radius: 2px;
        border: 1px solid rgba(255, 255, 255, 0.3);
        vertical-align: -1px;
        margin-right: 5px;
    }

    .legend-swatch.pre {
        background: linear-gradient(90deg, #0a63d1 0%, #1fae70 100%);
    }

    .legend-swatch.last-second {
        background: #f2bc2e;
    }

    .legend-swatch.after-shot {
        background: #c93a33;
    }

    .legend-crosshair {
        color: #2c9cff;
        font-weight: 700;
        margin-right: 5px;
    }

    .shot-diagnostics {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 14px;
        margin-top: 14px;
    }

    .shot-diagnostic-panel {
        background: #1f1f1f;
        border: 1px solid #3a3a3a;
        border-radius: 8px;
        padding: 12px;
        min-width: 0;
        box-sizing: border-box;
    }

    .shot-diagnostic-title {
        color: #ececec;
        font-size: 13px;
        font-weight: 700;
        margin-bottom: 10px;
    }

    .shot-image-wrap {
        position: relative;
        width: 100%;
        aspect-ratio: 1 / 1;
        background: #111;
        border: 1px solid #3a3a3a;
        border-radius: 8px;
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .shot-image-canvas {
        display: none;
        width: 100%;
        height: 100%;
        object-fit: contain;
        aspect-ratio: 1 / 1;
    }

    .shot-image-empty {
        color: #bdbdbd;
        font-size: 12px;
        padding: 0 12px;
        text-align: center;
    }

    .imu-graph-canvas {
        width: 100%;
        height: 220px;
        display: block;
        background: #111;
        border: 1px solid #3a3a3a;
        border-radius: 8px;
    }

    .no-data {
        color: #d1d1d1;
        text-align: center;
        padding: 18px;
    }

    .analyze-export-panel {
        width: 100%;
        background: #1f1f1f;
        border: 1px solid #3a3a3a;
        border-radius: 12px;
        padding: 14px 16px;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    .session-target-canvas {
        width: 100%;
        aspect-ratio: 1 / 1;
        display: block;
        background: #ffffff;
        border-radius: 8px;
        border: 1px solid #2f2f2f;
    }

    @media (max-width: 900px) {
        .shots-list-summary-grid {
            grid-template-columns: minmax(0, 1fr);
        }

        .shot-diagnostics {
            grid-template-columns: minmax(0, 1fr);
        }

        .series-table-row {
            grid-template-columns: 1fr;
        }
    }

/* analyze_shot_target template-specific */
    .shot-target-shell {
        width: min(1280px, 100%);
    }

    .shot-target-dropzone {
        margin-top: 0;
    }

    .shot-target-image-frame {
        width: 100%;
        min-height: 420px;
        display: grid;
        place-items: center;
    }

    .shot-target-canvas {
        width: 100%;
        height: auto;
        display: block;
        background: #111111;
        cursor: crosshair;
    }

    .shot-target-field {
        display: grid;
        grid-template-columns: auto minmax(320px, 520px);
        gap: 12px;
        align-items: center;
        justify-content: end;
        margin-top: 14px;
    }

    .shot-target-field label {
        color: #d1d1d1;
        font-size: 14px;
        font-weight: 700;
    }

    .shot-target-field select {
        width: 100%;
        border: 1px solid #3a3a3a;
        border-radius: 6px;
        background: #f6f6f6;
        color: #1b1b1b;
        font-size: 15px;
        padding: 10px;
    }

    .shot-target-actions.right {
        justify-content: flex-end;
    }

    .shot-target-edge-actions {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 8px;
        margin-top: 14px;
    }

    .shot-target-btn.active {
        background: #3b5d7a;
        border-color: #87a6c1;
        color: #ffffff;
    }

    .shot-target-btn:disabled {
        opacity: 0.45;
        cursor: not-allowed;
    }

    .shot-target-summary {
        margin-top: 16px;
        padding-top: 12px;
        border-top: 1px solid #444444;
        display: flex;
        flex-wrap: wrap;
        gap: 12px 24px;
        align-items: center;
    }

    .shot-target-stat-label {
        color: #cfcfcf;
        font-size: 12px;
        font-weight: 700;
        text-transform: uppercase;
    }

    .shot-target-stat-value {
        color: #ffffff;
        font-size: 14px;
        font-weight: 700;
        overflow-wrap: anywhere;
    }

    .shot-target-stat {
        display: inline-flex;
        gap: 8px;
        min-width: 0;
        align-items: baseline;
    }

    .shot-table-toolbar {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        align-items: center;
        flex-wrap: wrap;
    }

    .shot-table-wrap {
        margin-top: 12px;
        max-height: 340px;
        overflow-y: auto;
    }

    .shot-target-session-canvas {
        margin-top: 14px;
        width: 100%;
        aspect-ratio: 1 / 1;
        display: block;
    }

    .shot-direction {
        display: inline-block;
        color: #ffffff;
        font-size: 18px;
        font-weight: 700;
        transform: rotate(var(--shot-angle, 0deg));
        transform-origin: center;
        line-height: 1;
    }

    .shot-delete-link {
        color: #f09a9a;
        background: transparent;
        border: 0;
        font: inherit;
        font-weight: 700;
        cursor: pointer;
        padding: 0;
    }

    @media (max-width: 760px) {
        .shot-target-page {
            padding: 14px;
        }

        .shot-target-summary {
            align-items: flex-start;
            flex-direction: column;
        }

        .shot-target-field {
            grid-template-columns: 1fr;
        }

        .shot-target-edge-actions {
            grid-template-columns: 1fr;
        }
    }
</style>
