/* Extend ShotBook's shared theme; header, cards, fields and pills use styles.css. */
.shooting-main { display: contents; }
.shooting-page .hero__nav { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.shooting-page .list-card { min-width: 0; }
.session-date-control { position: relative; min-height: 28px; }
#date-trigger { display: block; }
/* A real tap reaches the native control, including on iOS without showPicker support. */
#date { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; box-sizing: border-box; margin: 0; opacity: 0; cursor: pointer; }
#date::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; cursor: pointer; }
.shooting-page select, .shooting-dialog select { width: 100%; min-width: 0; border: 1px solid #342a4d; border-radius: 12px; padding: 12px 14px; font: inherit; font-variant-caps: normal; font-size: 1rem; color: var(--ink); background: var(--surface-soft); }
.shooting-page input, .shooting-dialog input, .shooting-dialog textarea { min-width: 0; width: 100%; }
.shooting-day { min-width: 0; }
.shooting-day + .shooting-day { margin-top: 8px; }
.shooting-session { position: relative; min-width: 0; }
.shooting-session + .shooting-session { margin-top: 10px; }
.shooting-session__row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; background: transparent; cursor: pointer; }
.shooting-session__row .session__date-block { margin-right: auto; }
.shooting-session__row .pill { flex-shrink: 0; }
.shooting-session__row .session-journal-btn { flex-shrink: 0; }
.session-journal-space { flex: 0 0 28px; height: 28px; }
.viewing-shared .shooting-session__row, .viewing-shared .shooting-round--history { cursor: default; }
.shooting-round { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin: 4px 0 8px 12px; padding: 8px 12px; border-left: 1px solid #49365f; cursor: pointer; }
.shooting-round > strong { font-size: .75rem; font-weight: 600; margin-right: auto; }
.shooting-round > small { flex: 1 0 100%; color: #5ed38f; font-size: .56rem; font-weight: 700; text-transform: none; font-variant-caps: all-small-caps; letter-spacing: .08em; }
.shooting-round .pill--score { padding: 4px 10px; min-width: 42px; font-size: .85rem; border-radius: 999px; box-shadow: none; }
.review-note { color: #c9b47e; font-size: .65rem; line-height: 1.45; margin: 5px 4px; flex: 1 0 100%; }
.shooting-dialog { width: calc(100% - 40px); max-width: 440px; max-height: 85vh; overflow: auto; padding: 24px; border: 1px solid #3a2a55; border-radius: 20px; color: var(--ink); background: var(--surface); box-shadow: var(--shadow); }
.shooting-dialog::backdrop { background: rgba(6,4,12,.72); }
.shooting-dialog .modal__title { margin: 0 0 4px; }
.shooting-dialog label { min-width: 0; }
.shooting-dialog p { margin: 0; font-size: .78rem; line-height: 1.5; color: var(--muted); }
.shooting-dialog [role=alert] { color: #f3a497; }
.shooting-dialog p:empty, #message:empty { display: none; }
.shooting-dialog #journal-text, .shooting-dialog .shared-journal-text { min-height: 260px; }
#message { color: #f3a497; font-size: .85rem; }
[hidden] { display: none !important; }
button:disabled { opacity: .55; }
@media (max-width: 380px) { .shooting-session__row { gap: 6px; padding: 10px; } .shooting-round { margin-left: 6px; padding-inline: 8px; } }
.shooting-main > .card { margin-inline: 20px; }
.shooting-dialog #session-edit { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.shooting-dialog h2, .shooting-dialog p, .shooting-dialog #event-label { grid-column: 1 / -1; }
.shooting-dialog label:has(#classification) { grid-column: 1 / -1; }
/* Shared row surface: scores sit inside the session, as in the original history. */
.swipe-record { --record-offset: 0px; position: relative; overflow: hidden; border-radius: 14px; touch-action: pan-y; }
.swipe-record + .swipe-record { margin-top: 8px; }
.swipe-record__content { position: relative; z-index: 1; transform: translateX(var(--record-offset)); transition: transform 180ms ease; background: var(--surface-soft); }
.swipe-record.is-open { --record-offset: -78px; }
.swipe-record.is-dragging > .swipe-record__content { transition: none; }
.shooting-page .swipe-record__delete { position: absolute; inset: 0 0 0 auto; width: 78px; padding: 8px; border-radius: 0 14px 14px 0; background: linear-gradient(135deg,#f04b3a,#cd3a2c); color: white; font-size: .8rem; visibility: hidden; box-shadow: none; }
.swipe-record.is-open > .swipe-record__delete, .swipe-record.is-dragging > .swipe-record__delete { visibility: visible; }
.shooting-session > .swipe-record { border-radius: 0; margin: 0 0 0 12px; }
/* Extend the reveal to the session edge while retaining the closed round inset. */
.shooting-session > .swipe-record > .shooting-round { padding-right: 15px; }
.shooting-page .shooting-session > .swipe-record > .swipe-record__delete { border-radius: 0; }
.shooting-session > .swipe-record:last-child,
.shooting-page .shooting-session > .swipe-record:last-child > .swipe-record__delete { border-bottom-right-radius: 14px; }
.shooting-round { border: 0; margin: 0; padding: 3px 3px 8px; gap: 5px; }
.shooting-round > strong { font-size: .66rem; color: #c5bdd3; }
.shooting-round > small { padding-bottom: 2px; }
.shooting-round .session__arrows { margin-left: auto; }
.shooting-round .pill--score { font-size: .78rem; padding: 4px 10px; }
.session-editor__scores { grid-column: 1 / -1; display: grid; gap: 10px; padding-top: 14px; border-top: 0; }
#session-rounds { display: grid; gap: 8px; }
.shooting-dialog .session-editor__round { text-align: left; color: var(--ink); background: var(--surface-soft); border: 1px solid #342a4d; font: inherit; font-size: .85rem; padding: 10px 12px; }
.swipe-record__content { user-select: none; -webkit-user-select: none; }
.shooting-dialog .counts-form__field {
  font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: none; font-variant-caps: all-small-caps;
}
.shooting-dialog .counts-form__field:not([class*="counts-form__field--"]) { color: var(--ink); }
/* Labels remain bold; selected dropdown values are normal-weight. */
.shooting-page select, .shooting-dialog select, .shooting-page select option, .shooting-dialog select option { font-weight: 400; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.shooting-round > strong { color: #5ed38f; }
.shooting-round > small { color: #c5bdd3; }
.dialog-actions { grid-column: 1 / -1; display: flex; gap: 12px; }
.dialog-actions > button { flex: 1; }
.counts-form__split label:has(#discipline), #session-edit label:has(#edit-discipline) { align-self: end; }

/* Pin the complete shared shell; dialogs retain the browser top layer. */
html:has(.shooting-page), body:has(.shooting-page) { height: 100%; overflow: hidden; overscroll-behavior: none; }
.shooting-page { position: fixed; inset: 0; width: 100%; height: 100dvh; min-height: 0; padding: 0; gap: 0; }
.shooting-page > .hero { position: relative; z-index: 10; flex-shrink: 0; padding-top: calc(24px + env(safe-area-inset-top, 0px)); }
.shooting-page > .app-content { margin-inline: 0; }
.app-content { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; }
/* A pixel of real overflow enables native rubber-banding on short standalone iOS views. */
.app-content__body { min-height: calc(100% + 1px); display: flex; flex-direction: column; gap: 24px; padding: 24px 0 calc(60px + env(safe-area-inset-bottom, 0px)); }
.app-content__body > *, .shooting-main > .card { flex-shrink: 0; }
.app-content__body > :not(.shooting-main) { margin-inline: 20px; }
@media (min-width: 680px) { .app-content__body > :not(.shooting-main) { margin-inline: 28px; } }
.shooting-round--history > strong { color: #5ed38f; font-variant: all-small-caps; font-weight: 600; }
.shooting-round--history > small { color: #c5bdd3; font-variant: all-small-caps; font-weight: 400; text-transform: none; }

.shooting-dialog, #sight-edit-modal .modal__panel { max-height: calc(100dvh - 32px); overflow-y: auto; }

.shooting-round--history { row-gap: 1px; }
.shooting-round--history > strong { font-size: .75rem; }
.shooting-round--history > small { font-size: .66rem; }
.session__date--earlier { font-size: .8rem; overflow-wrap: anywhere; }

/* The score spans both text lines so its height does not open a gap between them. */
.shooting-round--history { display: grid; grid-template-columns: minmax(0, 1fr) auto; row-gap: 0; }
.shooting-round--history > strong, .shooting-round--history > small { line-height: 1.1; }
.shooting-round--history > small { grid-column: 1; padding-bottom: 0; }
.shooting-round--history > .session__arrows { grid-column: 2; grid-row: 1 / span 2; }
.shooting-round--history > .review-note { grid-column: 1 / -1; }
.sessions__title--older { margin-top: 12px; }
.shooting-page .hero__nav-stack { bottom: 0; left: 16px; right: 16px; gap: 6px; }
.shooting-page .hero__nav { flex: 1; min-width: 0; min-height: 33px; padding: 4px 10px; line-height: 1.2; border-radius: 12px 12px 0 0; border-bottom: 0; }

/* One sampled scrolling-surface color also joins the tabs to the content. */
body:has(.shooting-page) { --scroll-surface: #352854; background: var(--scroll-surface); }
.shooting-page > .hero {
  border-bottom: 10px solid var(--scroll-surface);
  padding-bottom: 53px;
  overflow: visible;
  clip-path: none;
  box-shadow: 0 7px 12px rgba(6, 4, 12, .28);
}
.shooting-page .hero__nav { font-size: 1rem; }
#session-entry { row-gap: 14px; }
#session-entry .session-date-control { min-height: 0; margin-bottom: -6px; }
#session-entry .save-button--primary-save {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  display: flex; align-items: center; justify-content: center;
  min-height: 44px; padding-block: 12px; line-height: 1.2;
}
.shooting-page .session__date-sub {
  font-size: .66rem; color: #c5bdd3; font-weight: 400;
  font-variant: all-small-caps; letter-spacing: .08em; line-height: 1.1;
}
.shooting-dialog .session-editor__round { display: flex; align-items: center; gap: 12px; }
.session-editor__round-title { color: #5ed38f; font-variant: all-small-caps; font-weight: 600; text-align: left; overflow-wrap: anywhere; min-width: 0; }
.session-editor__round .pill--score { margin-left: auto; flex-shrink: 0; color: #241800; font-variant-caps: normal; }
#add-session-round { color: #f7d24b; }

.shooting-page .hero__nav.is-active { background: var(--scroll-surface); border-color: var(--scroll-surface); }

/* Keep final-round breathing room inside its clip, including the PB overhang. */
.shooting-session:has(> .swipe-record) {
  display: flow-root;
  border-radius: 14px;
  padding-bottom: 0;
}
.shooting-session > .swipe-record:last-child { margin-bottom: 0; }
.shooting-session > .swipe-record:last-child .shooting-round { padding-bottom: 12px; }
.shooting-session > .swipe-record:last-child .review-note:last-child { margin-bottom: 0; }
@media (max-width: 380px) {
  .shooting-session > .swipe-record:last-child .shooting-round { padding-bottom: 10px; }
}

/* Center the label within the complete exposed round-delete area. */
.shooting-session > .swipe-record > .swipe-record__delete {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-block: 0;
  line-height: 1.2;
}
/* Match Stats badge placement; the row inset preserves swipe clipping clearance. */

/* Field has no target face; dim the complete unavailable field. */
.shooting-dialog label:has(select:disabled) { opacity: .28; }
.shooting-dialog select:disabled { cursor: not-allowed; }


/* Stats: separate comparable distances, with readable format/event/date hierarchy. */
.bests-distance-group { display: grid; gap: 16px; padding: 14px; border-radius: 14px; background: var(--surface-soft); min-width: 0; }
.shooting-round--best { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 12px; padding: 0; cursor: default; }
.shooting-round--best > strong { grid-column: 1; color: #fff; font-size: .95rem; font-weight: 700; line-height: 1.25; }
.shooting-round--best > .session__arrows { grid-column: 2; grid-row: 1 / span 3; align-self: center; }
.shooting-round--best > .bests-round__event { grid-column: 1; color: #5ed38f; font-size: .8rem; font-weight: 600; line-height: 1.25; padding: 0; overflow-wrap: anywhere; }
.shooting-round--best > .bests-round__date { grid-column: 1; color: #c5bdd3; font-size: .66rem; font-weight: 400; line-height: 1.25; padding: 0; }
.shooting-round--best .pill--score { white-space: nowrap; }

/* Confirmation copy matches the new-session Today label. */
#delete-message { color: var(--ink); font-size: 1.05rem; font-weight: 700; }
#delete-dialog button[value="delete"] { background: linear-gradient(135deg,#f04b3a,#cd3a2c); color: white; box-shadow: none; }

/* Overall activity: total, discipline split, then compact activity counts. */
#overall-values { display: grid; gap: 14px; }
.overall-metric { min-width: 0; display: grid; gap: 3px; }
.overall-metric strong { color: var(--ink); font-size: 1.15rem; line-height: 1.2; overflow-wrap: anywhere; }
.overall-metric span { color: var(--muted); font-size: .72rem; }
.overall-total strong { font-size: 1.9rem; }
.overall-split, .overall-counts { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px 20px; }
.overall-indoor strong { color: #a774ff; }
.overall-outdoor strong { color: #4a8dff; }
.overall-counts { border-top: 1px solid #342a4d; padding-top: 14px; }

.overall-rounds strong { color: #efc83d; }
.overall-competitions strong { color: #5ed38f; }

.overall-headline { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; align-items: start; }
.overall-average strong { font-size: 1.9rem; }

/* Compensate for the all-small-caps font’s space above the visible letters. */
#overall-stats, .shooting-main > .list-card { padding-top: 14px; }
.shooting-main .sessions__title { font-size: 1.1rem; }

/* A separate overlay reveals the cue; native scrolling supplies all rubber-band physics. */
.shooting-page > .pull-refresh {
  --pull: 0;
  position: absolute;
  top: var(--refresh-top, 205px);
  left: calc(50% - 20px);
  margin: 0;
  width: 40px;
  height: 40px;
  z-index: 11;
  pointer-events: none;
  color: var(--muted);
  background: var(--surface-soft);
  border-radius: 50%;
  box-shadow: 0 3px 12px rgba(6, 4, 12, .25);
  opacity: var(--pull);
  transform: translateY(calc(var(--pull) * 12px));
}
.pull-refresh svg { width: 24px; height: 24px; margin: 8px; }
.pull-refresh.is-armed, .pull-refresh.is-refreshing { color: #5ed38f; }
.pull-refresh.is-refreshing svg { animation: refresh-spin 800ms linear infinite; }
@keyframes refresh-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .pull-refresh.is-refreshing svg { animation: none; } }

/* Full-width scoring surface, with the same fields and colors as round entry. */
.shooting-page #scoring-trigger { pointer-events: auto; cursor: pointer; padding: 0; border-radius: 0; box-shadow: none; clip-path: inset(28px 24px -40px -40px); }
.scoring-view { min-width: 0; width: 100%; }
.scoring-form { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; padding: 0 20px; }
.scoring-form h2, .scoring-form > p, .scoring-form__event { grid-column: 1 / -1; }
.scoring-form h2 { margin: 0; }
.scoring-form .counts-form__field { min-width: 0; font-size: .72rem; font-weight: 700; letter-spacing: .08em; font-variant-caps: all-small-caps; }
.scoring-form label:not([class*="counts-form__field--"]) { color: var(--ink); }
.scoring-form input { box-sizing: border-box; max-width: 100%; }
.scoring-form [role=alert] { color: #f3a497; font-size: .8rem; }
.scoring-form [role=alert]:empty { display: none; }
.shooting-dialog .scoring-form { padding: 0; }
.scoring-header { display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 8px 16px; width: 100%; padding: 0 20px 20px; border: 0; border-radius: 0; background: transparent; box-shadow: none; text-align: left; color: var(--muted); font: inherit; font-size: .85rem; }
.scoring-header span, .scoring-header strong { overflow-wrap: anywhere; }
.scoring-header__event { grid-column: 1 / -1; color: #5ed38f; font-size: 1.15rem; }
.scoresheet { width: 100%; border-collapse: collapse; table-layout: fixed; color: var(--ink); font-size: .9rem; font-variant-numeric: tabular-nums; }
.scoresheet + .scoresheet { margin-top: 24px; }
.scoresheet td, .scoresheet tbody th { height: 38px; padding: 4px 2px; border: 1px solid #49365f; text-align: center; }
.scoresheet tbody th { width: 28px; font-weight: 400; color: var(--muted); background: transparent; border: 0; }
.scoresheet td { background: var(--surface-soft); }
.scoresheet .scoresheet__total { background: var(--surface); color: #fff; }

.scoring-footer { padding: 20px; }
.scoring-footer > button { width: 100%; background: linear-gradient(135deg,var(--accent),var(--accent-strong)); color: #fff; }
.scoring-finalize { max-width: 300px; padding: 16px; }
.scoring-finalize .scoring-finalize__discard { background: linear-gradient(135deg,#f04b3a,#cd3a2c); color: white; }
.scoring-finalize .scoring-finalize__save { background: #36a969; color: white; }
.scoring-finalize [role=alert]:not(:empty) { margin-top: 12px; }

.scoring-date-control { grid-column: 1 / -1; }
.scoring-date-control { position: relative; min-height: 28px; }
.scoring-date-display { display: block; color: #fff; font-size: 1.05rem; font-weight: 700; }
.scoring-date-control input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.scoring-date-control input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; cursor: pointer; }

.scoring-header > strong:not(.scoring-header__event) { color: #fff; font-weight: 700; }
.scoresheet .scoresheet__total-label { border: 0; background: transparent; text-align: right; padding: 10px 12px; font-weight: 700; color: #fff; }
.scoring-grand-total { display: grid; grid-template-columns: minmax(0,1fr) minmax(132px,max-content); align-items: center; margin-top: 24px; font-size: .9rem; font-variant-numeric: tabular-nums; }
.scoring-grand-total > strong { grid-column: 1; text-align: right; padding-right: 12px; color: #fff; }
.scoring-grand-total__value { grid-column: 2; display: flex; align-items: center; justify-content: flex-end; gap: 4px; min-height: 38px; padding: 4px 8px; border: 1px solid #49365f; background: var(--surface); color: #fff; }

.scoring-header__format { grid-column: 2 / -1; text-align: right; }
.scoring-keypad { flex-shrink: 0; position: relative; z-index: 11; padding: 12px 20px calc(12px + env(safe-area-inset-bottom,0px)); background: var(--surface); border-top: 1px solid #49365f; max-height: 50dvh; overflow-y: auto; box-shadow: 0 -6px 20px rgba(0,0,0,.25); }
.scoring-keypad__keys { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }
.scoring-keypad .scoring-key { min-width: 0; min-height: 44px; padding: 8px; border: 1px solid rgba(255,255,255,.18); border-radius: 10px; font-size: 1.2rem; font-weight: 700; box-shadow: none; font-variant-numeric: tabular-nums; }
.scoring-key--yellow { background: #ffe047; color: #241c0b; }
.scoring-key--red { background: #e64740; color: #fff; }
.scoring-key--blue { background: #2873ce; color: #fff; }
.scoring-key--black { background: #111; color: #fff; }
.scoring-key--white { background: #fff; color: #17151d; }
.scoring-key--grey { background: #777681; color: #fff; }
.scoring-keypad__status { margin: 8px 0 0; min-height: 1.2em; font-size: .8rem; color: var(--ink); }

.scoresheet { cursor: pointer; }
.scoresheet__next { box-shadow: inset 0 0 0 2px var(--accent); }

.shooting-page > .scoring-keypad { margin-inline: 0; }

.scoresheet .scoresheet__score { font-weight: 700; }
.scoresheet .scoresheet__score--yellow { background: #ffe047; color: #241c0b; }
.scoresheet .scoresheet__score--red { background: #e64740; color: #fff; }
.scoresheet .scoresheet__score--blue { background: #2873ce; color: #fff; }
.scoresheet .scoresheet__score--black { background: #111; color: #fff; }
.scoresheet .scoresheet__score--white { background: #fff; color: #17151d; }
.scoresheet .scoresheet__score--grey { background: #777681; color: #fff; }

.scoresheet td.scoresheet__arrow { border: 0; background: transparent; padding: 4px; }
.scoresheet__arrow > .scoresheet__score { display: flex; align-items: center; justify-content: center; min-height: 30px; border-radius: 8px; }
.scoresheet__arrow > .scoresheet__score:not([class*="scoresheet__score--"]) { background: var(--surface-soft); }

/* Borrow space from the end label column for breathing room before subtotals. */
.scoresheet td.scoresheet__arrow:nth-last-child(3) { padding-right: 16px; }

.scoring-view.is-replacing .scoresheet__next { box-shadow: none; }
.scoresheet__score.scoresheet__selected { box-shadow: inset 0 0 0 3px var(--accent), 0 0 0 2px var(--surface); }

.scoring-saved-title { margin: 0 20px 16px; font-size: 1.1rem; }
.scoring-saved-summary { margin: 0 20px 16px; color: var(--ink); }

/* A slow violet corona signals a canonical active sheet across all views. */
#scoring-trigger.has-active-scoring::before,
#scoring-trigger.has-active-scoring::after { content: ""; position: absolute; inset: -14px; border-radius: 50%; pointer-events: none; mask-image: radial-gradient(farthest-side,transparent 78%,#000 86%,transparent 100%); }
#scoring-trigger.has-active-scoring::before { background: conic-gradient(from 0deg,transparent 0deg,#974bff 45deg,#e1b1ff 75deg,transparent 110deg,#7434d9 155deg,#c27aff 185deg,transparent 225deg,#a650f4 275deg,#e0a1ff 310deg,transparent 360deg); filter: blur(4px); opacity: .9; animation: scoring-corona-drift 18s linear infinite; }
#scoring-trigger.has-active-scoring::after { background: #ad66ff; filter: blur(9px); opacity: .4; animation: scoring-corona-breathe 6s ease-in-out infinite; }
@keyframes scoring-corona-drift { to { transform: rotate(360deg); } }
@keyframes scoring-corona-breathe { 0%,100% { opacity: .3; transform: scale(.97); } 50% { opacity: .65; transform: scale(1.06); } }
@media (prefers-reduced-motion: reduce) { #scoring-trigger.has-active-scoring::before, #scoring-trigger.has-active-scoring::after { animation: none; } }

/* Keep cumulative totals clear of the phone edge without adding a card inset. */
.scoring-view > .scoresheet, .scoring-view > .scoring-grand-total { width: calc(100% - 12px); }

/* Brief, view-only gold stardust when an end becomes entirely X/10. */
.perfect-end-burst { position: fixed; z-index: 20; overflow: hidden; pointer-events: none; }
.perfect-end-burst__flash { position: absolute; border-radius: 10px; background: rgba(255,224,114,.25); box-shadow: 0 0 24px 5px rgba(255,199,53,.7); animation: perfect-end-flash 900ms ease-out both; }
.perfect-end-burst__dust { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: #ffe16a; box-shadow: 0 0 7px #ffd34c; animation: perfect-end-dust 1250ms cubic-bezier(.12,.65,.25,1) both; }
.perfect-end-burst__dust:nth-child(3n) { width: 11px; height: 11px; border-radius: 0; background: #fff4c6; clip-path: polygon(50% 0,61% 36%,100% 50%,61% 64%,50% 100%,39% 64%,0 50%,39% 36%); }
.perfect-end-burst__dust:nth-child(4n) { width: 3px; height: 3px; background: #fff; }
@keyframes perfect-end-flash { from { opacity: .9; } to { opacity: 0; } }
@keyframes perfect-end-dust { 0% { opacity: 0; transform: translate(-50%,-50%) scale(.25); } 12% { opacity: 1; } 65% { opacity: .9; } 100% { opacity: 0; transform: translate(calc(-50% + var(--dust-x)),calc(-50% + var(--dust-y) + 25px)) rotate(var(--dust-turn)) scale(.3); } }
.scoresheet__perfect-quiet .scoresheet__score { box-shadow: inset 0 0 0 2px #ffe16a; }
@media (prefers-reduced-motion: reduce) { .perfect-end-burst { display: none; } }

/* A saved sheet keeps its title and Edit action on the same row. */
/* Title spans the flexible space; the final column reserves only Edit button width. */
.scoring-header--saved .scoring-header__event { grid-column: 1 / 3; }
.scoring-edit { grid-column: 3; grid-row: 1; justify-self: end; align-self: start; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 10px; border: 1px solid #77618e; border-radius: 9px; background: var(--surface-soft); color: #fff; box-shadow: none; font: inherit; }
.scoring-edit.is-editing { background: #25834e; border-color: #5ed38f; }
.scoring-grand-total__value.is-mismatched { outline: 2px solid #f05863; box-shadow: 0 0 12px #f0586380; }
.scoring-grand-total__value.is-matched { animation: scoring-total-match 1s ease-out; }
@keyframes scoring-total-match { 0%,40% { outline: 2px solid #5ed38f; box-shadow: 0 0 16px #5ed38faa; } 100% { outline: 2px solid transparent; box-shadow: none; } }
@media (prefers-reduced-motion: reduce) { .scoring-grand-total__value.is-matched { animation: none; outline: 2px solid #5ed38f; } }

.scoring-form label:has(select:disabled) { opacity: .28; }
.scoring-keypad__keys.is-field .scoring-key:last-child { grid-column: span 2; }

.scoring-mode { margin: 0 20px 8px; color: var(--muted); font-size: .7rem; font-variant-caps: all-small-caps; letter-spacing: .08em; }
.scoring-details-link { min-width: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; text-align: left; font: inherit; font-size: 1.15rem; font-weight: 700; overflow-wrap: anywhere; }
.scoring-total-entry { flex: 1; align-self: stretch; min-width: 24px; padding: 0; border: 0; border-radius: 0; background: transparent; color: #fff; box-shadow: none; font: inherit; font-weight: 700; text-align: right; }
.scoring-total-entry:disabled { opacity: 1; cursor: default; }
.scoring-return { margin: 16px 20px 0; }
.scoring-form > p { grid-column: 1 / -1; }

/* Completion is persistent state, independent of the historical-match animation. */
.scoring-grand-total__value.is-complete { animation: none; outline: 2px solid #5ed38f; box-shadow: 0 0 16px #5ed38faa; }

.scoring-add-round { display: block; margin: 16px 20px 0; width: calc(100% - 40px); }

/* Keep the PB star inline and reserve room independently of arrow-column count. */
.scoring-grand-total__value { white-space: nowrap; }
.scoring-grand-total__value > .session-pb-badge { position: static; flex: 0 0 22px; }

.jop-discipline { padding: 0; }
.jop-discipline + .jop-discipline { margin-top: 16px; padding-top: 16px; border-top: 1px solid #342a4d; }
.jop-discipline p { margin: 8px 0 0; line-height: 1.5; overflow-wrap: anywhere; }

.jop-discipline p:first-child { margin-top: 0; }
.jop-next-count { margin-left: .25em; font-size: .75rem; font-weight: 400; font-variant-caps: all-small-caps; white-space: nowrap; }

.jop-discipline--indoor .jop-earned { color: #a774ff; }
.jop-discipline--outdoor .jop-earned { color: #4a8dff; }
.jop-earned { font-weight: 700; }
.jop-discipline .jop-earned-date { color: var(--muted); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; }

button.jop-earned { display: block; width: 100%; padding: 0; border-radius: 0; background: none; box-shadow: none; font: inherit; font-weight: 700; text-align: left; line-height: 1.5; }
button.jop-earned:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.jop-evidence { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows .22s ease, opacity .22s ease; }
.jop-evidence.is-open { grid-template-rows: 1fr; opacity: 1; }
.jop-evidence__clip { min-height: 0; overflow: hidden; }
.jop-evidence__rows { margin-top: 10px; }
.shooting-round--jop > .session__arrows { grid-row: 1 / span 2; }
@media (prefers-reduced-motion: reduce) { .jop-evidence { transition: none; } }

/* Short lanes retain scores for reference, with amber marking their stats exclusion. */
.pill--score.pill--short-distance { background: #f4b544; color: #352100; }
.scoring-distance-notice { grid-column: 1 / -1; margin: 0; color: #f4b544; }

.scoring-exclusion-note { margin: 20px 20px 0; text-align: center; font-style: italic; white-space: pre-line; color: var(--muted); font-size: .8rem; line-height: 1.5; }
.scoring-header--saved .scoring-header__event { align-self: start; margin: 0; padding: 0; line-height: 1.3; }
.scoresheet td.scoresheet__footer-spacer { border: 0; background: transparent; }
.scoresheet .scoresheet__total-label:has(.scoresheet__round-actions) { padding-left: 0; }
.scoresheet__round-actions { display: flex; align-items: center; gap: 8px; }
.scoresheet__round-actions > span { margin-left: auto; }
.scoring-remove-round { padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; color: var(--muted); font: inherit; font-size: .75rem; font-weight: 400; text-align: left; }

.summary--hero .summary__average { display: flex; align-items: baseline; column-gap: 20px; row-gap: 2px; flex-wrap: wrap; }
.summary__weekly-metric { white-space: nowrap; }

.offline-panel { padding: 4px 20px 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.offline-panel .review-note { font-size: .8rem; margin: 0 0 4px; }

.recovery-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.recovery-dialog { max-height: 85dvh; overflow-y: auto; }
.recovery-comparison { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.recovery-dialog dl { font-size: .8rem; font-variant-numeric: tabular-nums; }
.recovery-dialog dt { color: var(--muted); }
.recovery-dialog dd { margin: 0 0 8px; overflow-wrap: anywhere; }
.recovery-dialog article { padding: 12px 0; border-top: 1px solid #49365f; }
@media(max-width: 480px) { .recovery-comparison { grid-template-columns: 1fr; } }

.recovery-dialog { width: min(720px,calc(100vw - 32px)); min-width: 0; box-sizing: border-box; }
.recovery-dialog .dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.recovery-dialog .dialog-actions button { min-width: 0; flex: 1 1 120px; }
.recovery-dialog section { min-width: 0; }

.recovery-dialog { max-width: 720px; }

/* The weekly metrics and profile pill share the header's last row. */
.shooting-page > .hero {
  padding-top: calc(28px + env(safe-area-inset-top, 0px));
  padding-bottom: 45px;
}
.shooting-page .summary--hero {
  grid-template-columns: auto auto minmax(0, 1fr);
  margin-right: -8px;
}
.shooting-page .account-control {
  grid-column: 3;
  grid-row: 3;
  align-self: center;
  justify-self: end;
  min-width: 0;
  max-width: 100%;
  z-index: 12;
}
.shooting-page .account-trigger {
  display: block;
  border: 1px solid #3a2a55;
  border-radius: 12px;
  min-height: 33px;
  font-size: .9rem;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
}
.shooting-page .account-trigger[aria-expanded="true"] {
  border-radius: 12px 12px 0 0;
  border-bottom-color: transparent;
  background: #291c3c;
}
.shooting-page .account-control--wider .account-trigger[aria-expanded="true"] {
  border-bottom-left-radius: 12px;
}
.shooting-page .account-menu {
  box-sizing: border-box;
  inset: calc(100% - 1px) 0 auto auto;
  z-index: -1;
  width: 176px;
  min-width: 0;
  max-height: min(65dvh, calc(100dvh - 170px - env(safe-area-inset-top, 0px)));
  border-color: #3a2a55;
  border-radius: 0 0 12px 12px;
  overscroll-behavior: contain;
}
.viewing-shared #scoring-trigger { visibility: hidden; }
.viewing-shared .offline-panel,
.viewing-shared #equipment-form,
.viewing-shared #gear-recovery,
.viewing-shared #sight-list,
.viewing-shared #sync-status { display: none; }
.shared-journal-text { white-space: pre-wrap; overflow-wrap: anywhere; }
