:root {
  --bg: #eef4fb;
  --card: #ffffff;
  --ink: #162033;
  --muted: #61708b;
  --accent: #2d6df6;
  --accent-dark: #1a4ec0;
  --accent-soft: #edf4ff;
  --line: #d8e1ee;
  --shadow: 0 18px 44px rgba(22, 32, 51, 0.09);
  --radius: 20px;
  font-family: "Sora", "Space Grotesk", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top, #f7fbff 0%, #eef4fb 48%, #e1e9f4 100%);
  color: var(--ink);
}

button,
input,
select,
textarea,
a {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.ta-app {
  min-height: 100vh;
  padding: 14px 14px 28px;
}

.ta-topbar,
.ta-shell {
  max-width: 760px;
  margin: 0 auto;
}

.ta-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.ta-topbar h1 {
  margin: 4px 0 0;
  font-size: 2rem;
  line-height: 1;
}

.ta-topbar-actions {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.ta-topbar-session {
  text-align: right;
}

.ta-session-name {
  margin: 0;
  font-weight: 700;
}

.ta-kicker {
  margin: 0;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.ta-card {
  background: var(--card);
  border: 1px solid rgba(26, 78, 192, 0.1);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

.ta-auth-card {
  max-width: 480px;
  margin: 10vh auto 0;
}

.ta-shell {
  display: grid;
  gap: 14px;
}

.ta-card h2,
.ta-card h3 {
  margin: 0;
}

.ta-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.ta-muted {
  color: var(--muted);
}

.ta-small {
  font-size: 0.88rem;
}

label {
  display: block;
  margin: 14px 0 6px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: #fff;
  color: var(--ink);
}

.ta-input-lg {
  font-size: 1.05rem;
}

.ta-primary,
.ta-ghost,
.ta-event-item,
.ta-link-btn {
  border-radius: 14px;
  cursor: pointer;
}

.ta-primary {
  width: 100%;
  margin-top: 16px;
  border: none;
  padding: 14px 16px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(45, 109, 246, 0.28);
}

.ta-primary-inline {
  width: auto;
  margin-top: 0;
}

.ta-primary:disabled,
.ta-ghost:disabled {
  opacity: 0.6;
  cursor: default;
}

.ta-ghost {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  padding: 11px 14px;
}

.ta-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ta-small-btn {
  width: auto;
  margin: 0;
  padding: 8px 12px;
}

.ta-row {
  display: flex;
  align-items: center;
}

.ta-row-spread {
  justify-content: space-between;
}

.ta-gap-sm {
  gap: 10px;
}

.ta-action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.ta-action-row-tight {
  margin-top: 0;
  justify-content: flex-end;
}

.ta-event-picker {
  margin-top: 4px;
}

.ta-event-picker-head strong {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
}

.ta-event-picker-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.ta-event-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.ta-event-form {
  margin: 0;
}

.ta-event-item {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  padding: 14px;
  text-align: left;
  display: grid;
  gap: 4px;
}

.ta-event-item.is-selected {
  border-color: rgba(45, 109, 246, 0.35);
  background: var(--accent-soft);
}

.ta-group-card {
  padding: 0;
  overflow: hidden;
}

.ta-group-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  cursor: pointer;
}

.ta-group-summary::-webkit-details-marker {
  display: none;
}

.ta-group-summary h3 {
  margin-top: 4px;
}

.ta-group-summary-meta {
  display: grid;
  gap: 6px;
  justify-items: end;
}

.ta-group-count {
  font-weight: 800;
}

.ta-group-chevron {
  color: var(--muted);
  font-size: 0.88rem;
}

.ta-group-card[open] .ta-group-chevron {
  color: var(--accent-dark);
}

.ta-group-card[open] .ta-group-chevron::before {
  content: "Hide";
}

.ta-group-card:not([open]) .ta-group-chevron::before {
  content: "Open";
}

.ta-group-chevron {
  font-size: 0;
}

.ta-group-body {
  padding: 0 18px 18px;
  border-top: 1px solid var(--line);
}

.ta-roster-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ta-roster-tile {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 16px;
  padding: 0;
  overflow: hidden;
  text-align: left;
  cursor: pointer;
}

.ta-roster-photo {
  aspect-ratio: 1 / 1;
  background: linear-gradient(180deg, #f4f8ff 0%, #e4ecf8 100%);
}

.ta-roster-photo img,
.ta-modal-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ta-roster-photo-placeholder,
.ta-modal-photo-placeholder {
  width: 100%;
  height: 100%;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}

.ta-roster-tile-body {
  display: grid;
  gap: 6px;
  padding: 12px;
}

.ta-roster-tile-body p {
  margin: 0;
}

.ta-roster-status-row {
  display: grid;
  gap: 6px;
}

.ta-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.8rem;
  font-weight: 800;
}

.ta-status-pill-success {
  background: #e8f8ef;
  color: #17663b;
}

.ta-status-pill-alert {
  background: #fff1df;
  color: #9a4b06;
}

.ta-modal-open {
  overflow: hidden;
}

.ta-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
}

.ta-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(13, 23, 39, 0.62);
}

.ta-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(680px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow: auto;
  margin: 12px auto;
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 28px 60px rgba(13, 23, 39, 0.28);
}

.ta-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 0;
}

.ta-modal-body {
  display: grid;
  gap: 16px;
  padding: 16px;
}

.ta-modal-photo {
  overflow: hidden;
  border-radius: 18px;
  background: linear-gradient(180deg, #f4f8ff 0%, #e4ecf8 100%);
}

.ta-modal-meta {
  display: grid;
  gap: 10px;
}

.ta-modal-meta p {
  margin: 0;
}

.ta-admin-panel {
  display: grid;
  gap: 12px;
  padding-top: 4px;
}

.ta-admin-panel h4 {
  margin: 0;
}

.ta-admin-form {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #f9fbff;
}

.ta-admin-form label {
  margin: 0;
}

.ta-checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.ta-checkbox-row input {
  width: auto;
  margin: 0;
}

@media (min-width: 720px) {
  .ta-modal-body {
    grid-template-columns: minmax(0, 1.2fr) minmax(240px, 0.8fr);
    align-items: start;
  }
}

.ta-event-date {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-dark);
  font-weight: 800;
}

.ta-tool-list {
  display: grid;
  gap: 12px;
}

.ta-tool-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: #fff;
}

.ta-tool-card-muted {
  background: #f7faff;
}

.ta-tool-arrow {
  flex-shrink: 0;
  color: var(--accent-dark);
  font-weight: 800;
}

.ta-error {
  margin-top: 14px;
  color: #b42318;
}

.ta-status {
  margin-top: 12px;
  font-weight: 700;
}

.ta-status.is-error {
  color: #b42318;
}

.ta-status.is-success {
  color: #156f30;
}

.ta-primary-status {
  margin: 14px 0 18px;
  border-radius: 18px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  background: #f6f9ff;
}

.ta-primary-status h2 {
  margin: 4px 0 6px;
  font-size: 1.5rem;
}

.ta-primary-status-meta {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
}

.ta-primary-status-success {
  background: #edf9f0;
  border-color: #cae8d2;
}

.ta-primary-status-success .ta-kicker,
.ta-primary-status-success h2 {
  color: #156f30;
}

.ta-primary-status-alert {
  background: #fff1ee;
  border-color: #f0c8bf;
}

.ta-primary-status-alert .ta-kicker,
.ta-primary-status-alert h2 {
  color: #b53016;
}

.ta-primary-status-pending {
  background: var(--accent-soft);
  border-color: rgba(45, 109, 246, 0.18);
}

.ta-video-wrap {
  margin-top: 16px;
}

#scanVideo {
  width: 100%;
  max-width: 420px;
  border-radius: 14px;
  background: #111;
}

.ta-result-grid {
  display: grid;
  gap: 8px;
}

.ta-result-grid p {
  margin: 0;
}

.ta-photo-panel {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.ta-camera-wrap {
  margin-top: 14px;
}

.ta-camera-video {
  width: 100%;
  max-width: 420px;
  border-radius: 14px;
  background: #111;
  display: block;
}

.ta-photo-panel input[type="file"] {
  display: block;
  margin-top: 12px;
}

.ta-preview {
  margin-top: 12px;
}

.ta-photo-thumb-card {
  display: grid;
  gap: 8px;
}

.ta-photo-thumb-card p {
  margin: 0;
}

.ta-photo-thumb-link {
  display: inline-block;
}

.ta-photo-thumb {
  width: min(100%, 220px);
  border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: block;
}

.ta-preview a {
  color: var(--accent-dark);
}

@media (max-width: 640px) {
  .ta-topbar,
  .ta-row-spread {
    align-items: stretch;
  }

  .ta-topbar,
  .ta-row-spread,
  .ta-topbar-actions,
  .ta-event-picker-actions {
    flex-direction: column;
  }

  .ta-topbar-session {
    text-align: left;
  }
}
