:root {
  color-scheme: dark;
  --app-shell-canvas: #050505;
  --app-shell-surface: #050505;
  --app-shell-surface-soft: #141414;
  --app-shell-surface-raised: #181818;
  --app-shell-border: #2c2c2c;
  --app-shell-divider: #626262;
  --app-shell-text: #f4f4f4;
  --app-shell-muted: #a0a0a0;
  --app-shell-sidebar: #050505;
  --app-shell-sidebar-hover: #202020;
  --app-shell-sidebar-text: #ffffff;
  --app-shell-sidebar-muted: rgba(255, 255, 255, 0.58);
  --app-shell-sidebar-border: rgba(255, 255, 255, 0.14);
  --app-shell-cyan: #ffffff;
  --app-shell-danger: #d84d57;
}

body.logged-in-body {
  min-height: 100vh;
  display: block;
  background: var(--app-shell-canvas);
  color: var(--app-shell-text);
  transition: background-color 0.2s ease, color 0.2s ease;
}

body.logged-in-body.modal-open {
  overflow: hidden;
}

@keyframes card-image-glint {
  0% {
    translate: -120% 0;
  }

  100% {
    translate: 120% 0;
  }
}

.logged-in-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 4rem minmax(0, 1fr);
}

.logged-in-page {
  min-height: calc(100vh - 4rem);
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}

.logged-in-shell-no-sidebar .logged-in-page {
  grid-template-columns: minmax(0, 1fr);
}

.logged-in-sidebar {
  box-sizing: border-box;
  min-height: calc(100vh - 4rem);
  height: calc(100vh - 4rem);
  padding: 0;
  background: var(--app-shell-sidebar);
  color: var(--app-shell-sidebar-text);
  border-right: 1px solid var(--app-shell-divider);
  position: sticky;
  top: 4rem;
}

.logged-in-sidebar-inner {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.logged-in-brand {
  height: 4rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0;
  color: var(--app-shell-sidebar-text);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0;
  text-decoration: none;
}

.logged-in-brand:hover {
  color: var(--app-shell-sidebar-text);
}

.logged-in-brand-icon {
  width: 1.6rem;
  height: 1.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--app-shell-sidebar-text);
  flex-shrink: 0;
}

.logged-in-brand-icon svg {
  width: 100%;
  height: 100%;
  display: block;
  fill: currentColor;
}

.logged-in-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem 0 0;
  flex: 1;
}

.logged-in-sidebar-version {
  display: block;
  color: rgba(255, 255, 255, 0.36);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
}

@keyframes hero-background-blobs-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.logged-in-sidebar-footer {
  display: grid;
  gap: 0.75rem;
  margin: auto 1.25rem 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.logged-in-sidebar-legal {
  color: rgba(255, 255, 255, 0.34);
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.35;
}

.logged-in-nav-label {
  margin: 0;
  padding: 0 1.25rem 0.65rem;
  color: var(--app-shell-sidebar-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: lowercase;
}

.logged-in-sidebar-link + .logged-in-nav-label {
  margin-top: 0.7rem;
}

.logged-in-sidebar-link {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0.75rem;
  padding: 0.55rem 0.8rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--app-shell-sidebar-muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  transition: background-color 0.18s ease, color 0.18s ease;
  cursor: pointer;
}

.logged-in-sidebar-link:hover,
.logged-in-sidebar-link.active,
.logged-in-sidebar-link.active:hover {
  background: var(--app-shell-sidebar-hover);
  color: var(--app-shell-sidebar-text);
}

.logged-in-sidebar-icon {
  width: 1.25rem;
  height: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.logged-in-sidebar-icon svg {
  width: 100%;
  height: 100%;
}

.logged-in-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 4rem);
  background:
    radial-gradient(circle at 18% 16%, rgba(255, 255, 255, 0.055), transparent 34rem),
    radial-gradient(circle at 82% 30%, rgba(255, 255, 255, 0.04), transparent 30rem),
    radial-gradient(circle at 58% 92%, rgba(255, 255, 255, 0.045), transparent 36rem),
    var(--app-shell-canvas);
  background-attachment: fixed;
}

.logged-in-content:has(.hero-show-page) {
  --hero-blob-content-edge: max(14rem, calc((100vw - 1570px) / 2 + 14rem));
  --hero-blob-width: clamp(54rem, 62vw, 68rem);
  --hero-blob-height: clamp(29rem, 35vw, 38rem);
  --hero-blob-y: 92%;
  position: relative;
  isolation: isolate;
  overflow-x: clip;
  background:
    radial-gradient(circle at 18% 16%, rgba(255, 255, 255, 0.055), transparent 34rem),
    radial-gradient(circle at 82% 30%, rgba(255, 255, 255, 0.04), transparent 30rem),
    radial-gradient(circle at 58% 92%, rgba(255, 255, 255, 0.045), transparent 36rem),
    var(--app-shell-canvas);
  background-attachment: fixed;
}

.logged-in-content:has(.hero-show-page)::before {
  content: "";
  position: fixed;
  inset: 4rem 0 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse var(--hero-blob-width) var(--hero-blob-height) at var(--hero-blob-content-edge) var(--hero-blob-y), color-mix(in srgb, var(--hero-secondary) 46%, transparent) 0, transparent 72%),
    radial-gradient(ellipse var(--hero-blob-width) var(--hero-blob-height) at calc(100% - var(--hero-blob-content-edge)) var(--hero-blob-y), color-mix(in srgb, var(--hero-primary) 48%, transparent) 0, transparent 72%);
  animation: hero-background-blobs-in 1s ease-out both;
}

.logged-in-topbar {
  height: 4rem;
  position: sticky;
  top: 0;
  z-index: 40;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 2rem;
  border-bottom: 1px solid var(--app-shell-border);
  background: var(--app-shell-surface);
}

.logged-in-import-launcher {
  margin: 1rem 0.75rem 0.35rem;
}

.logged-in-import-button {
  width: 100%;
  min-height: 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid #f2f2f2;
  border-radius: 999px;
  background: #f2f2f2;
  color: #111111;
  font: inherit;
  font-size: 0.94rem;
  font-weight: 600;
  cursor: pointer;
}

.logged-in-import-button:hover {
  background: #ffffff;
  border-color: #ffffff;
}

.logged-in-import-icon {
  width: 1rem;
  height: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.logged-in-import-icon svg {
  width: 100%;
  height: 100%;
}

.logged-in-sidebar-drawer {
  position: relative;
  z-index: 25;
}

.logged-in-sidebar-drawer-button {
  list-style: none;
  width: 2.45rem;
  height: 2.45rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--app-shell-border);
  border-radius: 8px;
  background: transparent;
  color: var(--app-shell-text);
  cursor: pointer;
}

.logged-in-sidebar-drawer-button::-webkit-details-marker {
  display: none;
}

.logged-in-sidebar-drawer-button:hover {
  background: var(--app-shell-surface-soft);
}

.logged-in-sidebar-drawer-button span {
  width: 1rem;
  height: 1rem;
  display: inline-flex;
}

.logged-in-sidebar-drawer-button svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.logged-in-sidebar-drawer-backdrop {
  display: none;
  opacity: 0;
}

.logged-in-sidebar-drawer[open] .logged-in-sidebar-drawer-backdrop {
  position: fixed;
  inset: 4rem 0 0;
  z-index: 30;
  display: block;
  background: rgba(0, 0, 0, 0.48);
  opacity: 1;
  transition: opacity 0.2s ease;
}

.logged-in-sidebar-drawer[open].is-closing .logged-in-sidebar-drawer-backdrop {
  opacity: 0;
}

.logged-in-sidebar-drawer-panel {
  position: fixed;
  top: 4rem;
  left: 0;
  z-index: 31;
  width: 248px;
  min-height: 0;
  max-height: calc(100vh - 4rem);
  height: calc(100vh - 4rem);
  max-height: calc(100svh - 4rem);
  height: calc(100svh - 4rem);
  overflow: hidden;
  transform: translateX(calc(-100% - 1rem));
  transition: transform 0.2s ease;
}

.logged-in-sidebar-drawer-panel .logged-in-sidebar-inner {
  height: 100%;
  min-height: 0;
}

.logged-in-sidebar-drawer-panel .logged-in-sidebar-nav {
  min-height: 0;
  overflow-y: auto;
}

.logged-in-sidebar-drawer[open] .logged-in-sidebar-drawer-panel {
  transform: translateX(0);
}

.logged-in-sidebar-drawer[open].is-closing .logged-in-sidebar-drawer-panel {
  transform: translateX(calc(-100% - 1rem));
}

.logged-in-mobile-context-menu .logged-in-import-launcher {
  margin: 0.35rem 0.45rem 0.45rem;
}

.logged-in-mobile-context-menu .logged-in-import-button {
  min-height: 2.65rem;
}

.logged-in-topbar-spacer {
  flex: 1;
}

.logged-in-mobile-menu {
  display: none;
  position: relative;
  z-index: 3;
}

.logged-in-mobile-summary {
  list-style: none;
  width: 2.75rem;
  height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--app-shell-text);
  cursor: pointer;
}

.logged-in-mobile-summary::-webkit-details-marker {
  display: none;
}

.logged-in-mobile-summary:hover {
  background: var(--app-shell-surface-soft);
  border-color: var(--app-shell-border);
}

.logged-in-mobile-bars {
  width: 1.1rem;
  height: 0.9rem;
  display: inline-flex;
  flex-direction: column;
  justify-content: space-between;
}

.logged-in-mobile-bars span {
  width: 100%;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  display: block;
}

.logged-in-mobile-context-menu {
  left: 0;
  right: auto;
}

.logged-in-mobile-context-menu::before {
  left: 1rem;
  right: auto;
}

.logged-in-mobile-context-menu .logged-in-context-link.active,
.logged-in-mobile-context-menu .logged-in-context-link.active:hover {
  background: var(--app-shell-surface-soft);
}

.logged-in-topbar-login {
  min-width: 7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.logged-in-topbar-login-icon {
  width: 1rem;
  height: 1rem;
  display: inline-flex;
  flex-shrink: 0;
}

.logged-in-topbar-login-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.logged-in-profile-menu {
  position: relative;
  z-index: 2;
}

.logged-in-profile-menu[open] {
  z-index: 35;
}

.logged-in-profile-summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  height: 2.75rem;
  padding: 0 0.2rem 0 0.85rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--app-shell-text);
  cursor: pointer;
}

.logged-in-profile-summary::-webkit-details-marker {
  display: none;
}

.logged-in-profile-summary:hover {
  background: var(--app-shell-surface-soft);
  border-color: var(--app-shell-border);
}

.logged-in-profile-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--app-shell-text);
  color: var(--app-shell-surface);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.logged-in-profile-name {
  color: var(--app-shell-text);
  font-size: 0.92rem;
  font-weight: 700;
}

.logged-in-context-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.65rem);
  z-index: 10;
  width: 13rem;
  padding: 0.35rem;
  border: 1px solid var(--app-shell-border);
  border-radius: 0.9rem;
  background: var(--app-shell-surface-raised);
  color: var(--app-shell-text);
  box-shadow: 0 18px 28px rgba(0, 0, 0, 0.28);
}

.logged-in-context-menu::before {
  content: "";
  position: absolute;
  right: 1rem;
  top: -0.45rem;
  width: 0.8rem;
  height: 0.8rem;
  background: var(--app-shell-surface-raised);
  border-top: 1px solid var(--app-shell-border);
  border-left: 1px solid var(--app-shell-border);
  rotate: 45deg;
}

.logged-in-context-link,
.logged-in-context-logout {
  width: 100%;
  display: block;
  padding: 0.7rem 0.8rem;
  border: 0;
  background: transparent;
  color: var(--app-shell-text);
  font: inherit;
  font-size: 0.9rem;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.logged-in-context-link:hover,
.logged-in-context-logout:hover {
  background: var(--app-shell-surface-soft);
}

.logged-in-context-menu form {
  margin: 0;
}

.app-flash-stack {
  position: fixed;
  top: 1.25rem;
  left: 50%;
  z-index: 100;
  display: grid;
  gap: 0.75rem;
  width: min(28rem, calc(100vw - 2rem));
  transform: translateX(-50%);
}

.app-flash {
  padding: 0.85rem 1rem;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08), 0 2px 8px rgba(15, 23, 42, 0.06);
  animation: app-flash-enter 0.22s ease-out, app-flash-exit 0.24s ease-in 4.6s forwards;
}

.app-flash-success {
  background: #f0fdf4;
  color: #166534;
  border-color: #bbf7d0;
}

.app-flash-error {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

.app-flash-warning {
  background: #fefce8;
  color: #a16207;
  border-color: #fde68a;
}

.app-flash-info {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

@keyframes app-flash-enter {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes app-flash-exit {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(-6px);
  }
}

.logged-in-main {
  width: 100%;
  max-width: 1570px;
  box-sizing: border-box;
  min-width: 0;
  margin: 0 auto;
  background: transparent;
  padding: 1.75rem 2.5rem 2.5rem;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.logged-in-main:has(.session-draft-editor) {
  max-width: none;
  height: calc(100vh - 4rem);
  min-height: calc(100vh - 4rem);
  display: grid;
  align-items: stretch;
  padding: 0;
  overflow: hidden;
}

.logged-in-main .btn-primary,
.logged-in-main .btn-login,
.logged-in-body .app-modal .btn-primary,
.logged-in-body .app-modal .btn-login {
  background: var(--app-shell-sidebar);
  color: var(--app-shell-sidebar-text);
  border: 1px solid var(--app-shell-divider);
}

.logged-in-main .btn:hover,
.logged-in-body .app-modal .btn:hover {
  transform: none;
}

.logged-in-main .btn-primary:hover,
.logged-in-main .btn-login:hover,
.logged-in-body .app-modal .btn-primary:hover,
.logged-in-body .app-modal .btn-login:hover {
  background: var(--app-shell-sidebar-hover);
}

.logged-in-main .btn-secondary,
.logged-in-body .app-modal .btn-secondary {
  background: var(--app-shell-surface);
  color: var(--app-shell-text);
  border: 1px solid var(--app-shell-border);
}

.logged-in-main .btn-secondary:hover,
.logged-in-body .app-modal .btn-secondary:hover {
  background: var(--app-shell-surface-soft);
}

.logged-in-main .btn-highlight,
.logged-in-body .app-modal .btn-highlight {
  background: #f2f2f2;
  color: #111111;
  border: 1px solid #f2f2f2;
}

.logged-in-main .btn-highlight:hover,
.logged-in-body .app-modal .btn-highlight:hover {
  background: #ffffff;
  border-color: #ffffff;
}

.logged-in-main .btn-danger,
.logged-in-body .app-modal .btn-danger {
  background: var(--app-shell-danger);
  color: #ffffff;
  border: none;
}

.logged-in-main .btn-danger:hover,
.logged-in-body .app-modal .btn-danger:hover {
  background: #c73f49;
}

.logged-in-main .btn:disabled,
.logged-in-main .btn[disabled],
.logged-in-body .app-modal .btn:disabled,
.logged-in-body .app-modal .btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.logged-in-main .btn-highlight:disabled,
.logged-in-main .btn-highlight[disabled],
.logged-in-body .app-modal .btn-highlight:disabled,
.logged-in-body .app-modal .btn-highlight[disabled] {
  opacity: 1;
  background: #6d6d6d;
  border-color: #6d6d6d;
  color: #ececec;
}

.logged-in-main .badge-user,
.logged-in-main .badge-editor,
.logged-in-main .badge-owner,
.logged-in-main .badge-success,
.logged-in-main .badge-warning {
  background: var(--app-shell-surface-soft);
  color: var(--app-shell-text);
}

.global-search {
  position: relative;
  width: min(46rem, 52vw);
  margin: 0 auto;
}

.global-search-form {
  height: 2.75rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0 0.85rem;
  border: 1px solid var(--app-shell-border);
  border-radius: 999px;
  background: var(--app-shell-surface-soft);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.global-search-form:focus-within {
  border-color: #6b6b6b;
  background: var(--app-shell-surface-raised);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}

.global-search-icon {
  width: 1.05rem;
  height: 1.05rem;
  display: inline-flex;
  flex: 0 0 auto;
  color: var(--app-shell-muted);
}

.global-search-icon svg {
  width: 100%;
  height: 100%;
}

.global-search-input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--app-shell-text);
  font: inherit;
  font-size: 0.9rem;
}

.global-search-input::placeholder {
  color: #858585;
}

.global-search-input::-webkit-search-cancel-button {
  filter: invert(1);
}

.global-search-shortcut {
  min-width: 1.55rem;
  padding: 0.12rem 0.4rem;
  border: 1px solid #3b3b3b;
  border-radius: 5px;
  background: #202020;
  color: #8f8f8f;
  font: inherit;
  font-size: 0.72rem;
  text-align: center;
}

.global-search-results {
  position: absolute;
  top: calc(100% + 0.55rem);
  left: 0;
  right: 0;
  z-index: 50;
  max-height: min(70vh, 38rem);
  overflow-y: auto;
  padding: 0.55rem;
  border: 1px solid var(--app-shell-border);
  border-radius: 16px;
  background: #101010;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

.global-search-result-groups,
.global-search-group {
  display: grid;
  gap: 0.18rem;
}

.global-search-group[hidden] {
  display: none !important;
}

.global-search-tabs,
.filter-radio-tabs {
  display: flex;
  gap: 0.35rem;
}

.global-search-tabs {
  padding: 0.35rem 0.35rem 0.55rem;
  overflow-x: auto;
}

.global-search-tab,
.filter-radio-tab {
  flex: 0 0 auto;
  padding: 0.43rem 0.7rem;
  border: 0;
  border-radius: 9px;
  background: #181818;
  color: var(--app-shell-muted);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
}

.global-search-tab:hover,
.global-search-tab.is-active,
.filter-radio-tab:hover,
.filter-radio-tab:focus-visible,
.filter-radio-tab.is-active {
  background: #f2f2f2;
  color: #111111;
}

.global-search-result-groups {
  gap: 0.7rem;
}

.global-search-group {
  padding-top: 0.65rem;
  border-top: 1px solid var(--app-shell-border);
}

.global-search-group h2 {
  margin: 0;
  padding: 0.2rem 0.55rem 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.42rem;
  color: #858585;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.global-search-group h2 b {
  min-width: 1.15rem;
  padding: 0.08rem 0.34rem;
  border-radius: 999px;
  background: #2b2b2b;
  color: #c9c9c9;
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.4;
  text-align: center;
}

.global-search-result {
  display: grid;
  grid-template-columns: 3.25rem minmax(0, 1fr);
  gap: 0.65rem;
  align-items: center;
  min-height: 3.65rem;
  padding: 0.5rem 0.58rem;
  border-radius: 10px;
  color: var(--app-shell-text);
  text-decoration: none;
}

.global-search-result:hover,
.global-search-result.is-active {
  background: #242424;
}

.global-search-result > span:last-child {
  min-width: 0;
  display: grid;
  gap: 0.1rem;
}

.global-search-result strong,
.global-search-result small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-search-result strong {
  font-size: 0.86rem;
}

.global-search-result small {
  color: var(--app-shell-muted);
  font-size: 0.74rem;
}

.global-search-result-kind {
  display: inline-flex;
  justify-content: center;
  padding: 0.24rem 0.38rem;
  border: 1px solid #373737;
  border-radius: 999px;
  color: #b8b8b8;
  font-size: 0.65rem;
  font-weight: 700;
}

.global-search-result-icon,
.global-search-result-card {
  width: 2.55rem;
  height: 2.55rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 10px;
  background: #2a2a2a;
  color: #d8d8d8;
}

.global-search-result-icon svg,
.global-search-result-card svg {
  width: 1.25rem;
  height: 1.25rem;
}

.global-search-result-icon img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.global-search-result-icon-hero {
  background: linear-gradient(135deg, #2c2c2c, #171717);
  font-size: 0.86rem;
  font-weight: 900;
}

.global-search-result-icon-channel {
  background: #311b1b;
  color: #ff6969;
}

.global-search-result-card {
  width: 2.3rem;
  height: auto;
  aspect-ratio: 63 / 88;
  border-radius: 5px;
}

.global-search-result-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.global-search-hint,
.global-search-empty {
  margin: 0;
  padding: 1rem;
  color: var(--app-shell-muted);
  font-size: 0.84rem;
}

.global-search-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 1.2rem 1rem;
  color: var(--app-shell-muted);
  font-size: 0.84rem;
}

.global-search-loading .button-spinner {
  margin-right: 0;
}

.global-search-empty {
  display: grid;
  gap: 0.25rem;
  text-align: center;
}

.global-search-empty strong {
  color: var(--app-shell-text);
}

.logged-in-main .badge-owner {
  background: rgba(216, 77, 87, 0.18);
  color: #ff8b95;
}

.logged-in-main .form-group input,
.logged-in-main .form-group select,
.logged-in-main .form-group textarea {
  width: 100%;
  background: var(--app-shell-surface);
  color: var(--app-shell-text);
  border-color: var(--app-shell-border);
}

.logged-in-main .form-group select:disabled {
  color: var(--app-shell-muted);
  cursor: not-allowed;
  opacity: 0.72;
}

.logged-in-main .form-group > span:has(> select:disabled) {
  display: block;
}

.logged-in-main .form-select {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.55rem 2.4rem 0.55rem 0.75rem;
  border: 1px solid var(--app-shell-border);
  border-radius: 6px;
  background-color: var(--app-shell-surface);
  color: var(--app-shell-text);
  font: inherit;
}

.logged-in-main .form-group input:focus,
.logged-in-main .form-group select:focus,
.logged-in-main .form-group textarea:focus,
.logged-in-main .form-select:focus {
  outline: none;
  border-color: var(--app-shell-cyan);
  box-shadow: none;
}

.logged-in-main .settings-header h1 {
  color: var(--app-shell-text);
  font-size: 1.35rem;
  line-height: 1.2;
}

.logged-in-main .settings-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.logged-in-main .settings-header-actions {
  margin-left: auto;
  flex-shrink: 0;
}

.settings-header-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.settings-search {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-left: auto;
}

.settings-search input[type="search"] {
  width: min(18rem, 42vw);
  min-height: 2.5rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--app-shell-border);
  border-radius: 6px;
  background: var(--app-shell-surface);
  color: var(--app-shell-text);
  font: inherit;
}

.settings-badge-list {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.settings-muted {
  color: var(--app-shell-muted);
}

.settings-form-label {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--app-shell-muted);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
}

.settings-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1rem;
  color: var(--app-shell-muted);
}

.permission-select {
  position: relative;
}

.permission-select-control {
  width: 100%;
  min-height: 2.75rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.42rem 0.7rem;
  border: 1px solid var(--app-shell-border);
  border-radius: 6px;
  background: var(--app-shell-surface);
  color: var(--app-shell-text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.permission-select-control:focus-visible,
.permission-select.is-open .permission-select-control {
  outline: none;
  border-color: var(--app-shell-cyan);
  box-shadow: none;
}

.permission-select-values {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.permission-select-placeholder {
  color: var(--app-shell-muted);
}

.permission-select-badge {
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.28rem 0.2rem 0.5rem;
  border: 1px solid var(--app-shell-border);
  border-radius: 999px;
  background: var(--app-shell-surface-soft);
  color: var(--app-shell-text);
  font-size: 0.78rem;
  font-weight: 700;
}

.permission-select-badge-remove {
  width: 1.05rem;
  height: 1.05rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--app-shell-surface-raised);
  color: var(--app-shell-muted);
  font: inherit;
  font-size: 0.72rem;
  line-height: 1;
  cursor: pointer;
}

.permission-select-badge-remove:hover {
  color: var(--app-shell-text);
}

.permission-select-caret {
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  rotate: 45deg;
  translate: 0 -0.12rem;
  opacity: 0.7;
}

.permission-select.is-open .permission-select-caret {
  rotate: 225deg;
  translate: 0 0.14rem;
}

.permission-select-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  z-index: 20;
  display: none;
  max-height: 12rem;
  overflow: auto;
  padding: 0.35rem;
  border: 1px solid var(--app-shell-border);
  border-radius: 8px;
  background: var(--app-shell-surface-raised);
  box-shadow: 0 18px 28px rgba(0, 0, 0, 0.28);
}

.permission-select.is-open .permission-select-menu {
  display: grid;
  gap: 0.2rem;
}

.permission-select-option {
  width: 100%;
  padding: 0.65rem 0.7rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--app-shell-text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.permission-select-option:hover,
.permission-select-option:focus-visible {
  outline: none;
  background: var(--app-shell-surface-soft);
}

.permission-select-empty {
  display: none;
  padding: 0.65rem 0.7rem;
  color: var(--app-shell-muted);
}

.permission-select-menu.is-empty .permission-select-empty {
  display: block;
}

.select-dropdowns-native {
  display: none !important;
}

.single-select {
  position: relative;
}

.single-select-control {
  width: 100%;
  min-height: 2.75rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--app-shell-border);
  border-radius: 6px;
  background: var(--app-shell-surface);
  color: var(--app-shell-text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.single-select-control:focus-visible,
.single-select.is-open .single-select-control {
  outline: none;
  border-color: var(--app-shell-cyan);
  box-shadow: none;
}

.single-select.is-disabled .single-select-control {
  color: var(--app-shell-muted);
  cursor: not-allowed;
  opacity: 0.72;
}

.single-select-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.single-select-value.is-placeholder {
  color: var(--app-shell-muted);
}

.single-select-caret {
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  rotate: 45deg;
  translate: 0 -0.12rem;
  opacity: 0.7;
}

.single-select.is-open .single-select-caret {
  rotate: 225deg;
  translate: 0 0.14rem;
}

.single-select-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  z-index: 30;
  display: none;
  max-height: 14rem;
  overflow: auto;
  padding: 0.35rem;
  border: 1px solid var(--app-shell-border);
  border-radius: 8px;
  background: var(--app-shell-surface-raised);
  box-shadow: 0 18px 28px rgba(0, 0, 0, 0.28);
}

.single-select.is-open .single-select-menu {
  display: grid;
  gap: 0.2rem;
}

.single-select-option {
  width: 100%;
  padding: 0.65rem 0.7rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--app-shell-text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.single-select-option:hover,
.single-select-option:focus-visible,
.single-select-option.is-selected {
  outline: none;
  background: var(--app-shell-surface-soft);
}

.single-select-option:disabled {
  color: var(--app-shell-muted);
  cursor: not-allowed;
  opacity: 0.65;
}

.settings-header-actions form {
  margin: 0;
}

.logged-in-main .settings-copy {
  margin-top: 0.65rem;
  max-width: 42rem;
  color: var(--app-shell-muted);
  line-height: 1.6;
}

.logged-in-main .settings-back-link {
  color: var(--app-shell-muted);
}

.logged-in-main .settings-back-link:hover {
  color: var(--app-shell-cyan);
}

.logged-in-main .settings-section {
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.logged-in-main .settings-table th,
.logged-in-main .settings-table td {
  border-bottom-color: var(--app-shell-border);
}

.logged-in-main .settings-table th {
  color: var(--app-shell-muted);
}

.logged-in-main .settings-table td.actions {
  white-space: nowrap;
}

.logged-in-main .settings-form .form-group input.disabled {
  background: var(--app-shell-surface-soft);
}

.logged-in-main .settings-details {
  display: grid;
  gap: 1rem;
}

.logged-in-main .settings-details dt {
  margin-bottom: 0.25rem;
  color: var(--app-shell-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.settings-tooltip {
  position: relative;
  display: inline-flex;
  margin-left: 0.35rem;
  vertical-align: middle;
}

.settings-tooltip-icon {
  width: 1rem;
  height: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--app-shell-border);
  border-radius: 999px;
  color: var(--app-shell-muted);
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 1;
  cursor: help;
}

.settings-tooltip-text {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.45rem);
  z-index: 25;
  width: max-content;
  max-width: 15rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--app-shell-border);
  border-radius: 6px;
  background: var(--app-shell-surface-raised);
  color: var(--app-shell-text);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.35;
  text-transform: none;
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.24);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 0.25rem);
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.settings-tooltip:hover .settings-tooltip-text,
.settings-tooltip:focus-within .settings-tooltip-text {
  opacity: 1;
  transform: translate(-50%, 0);
}

.logged-in-main .settings-details dd {
  color: var(--app-shell-text);
  font-size: 1rem;
}

.logged-in-main .settings-actions,
.logged-in-main .modal-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.logged-in-main .modal-actions-right {
  justify-content: flex-end;
}

.logged-in-main .settings-note,
.logged-in-main .modal-copy {
  margin-top: 1rem;
  color: var(--app-shell-muted);
  line-height: 1.6;
}

.logged-in-main .empty-state {
  color: var(--app-shell-muted);
}

.settings-subnav {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0;
  margin-bottom: 1.5rem;
  background: transparent;
  border: 0;
}

.settings-subnav-link {
  padding: 0.45rem 0;
  margin-right: 1rem;
  color: var(--app-shell-muted);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.settings-subnav-link:hover,
.settings-subnav-link.active {
  color: var(--app-shell-text);
}

.settings-subnav-link.active {
  border-bottom: 2px solid var(--app-shell-sidebar);
}

.settings-modal-group {
  display: inline-flex;
}

.ai-feature-settings-form {
  max-width: 44rem;
}

.ai-feature-provider-status {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin: 0.85rem 0 1.2rem;
}

.ai-feature-provider-status .badge.is-muted {
  color: var(--app-shell-muted);
}

.ai-feature-model-group {
  display: grid;
  gap: 0.75rem;
}

.ai-feature-model-group[hidden] {
  display: none;
}

.ai-feature-model-group-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--app-shell-border);
}

.ai-feature-model-group-header h2 {
  margin: 0;
  color: var(--app-shell-text);
  font-size: 1rem;
  line-height: 1.3;
}

.ai-feature-model-list {
  display: grid;
  gap: 0.55rem;
}

.ai-feature-model-option {
  align-items: flex-start;
}

.ai-feature-model-option span {
  display: grid;
  gap: 0.18rem;
}

.ai-feature-model-option small {
  color: var(--app-shell-muted);
  font-size: 0.78rem;
  font-weight: 500;
}

.session-list {
  display: grid;
  gap: 1rem;
}

.session-card {
  padding: 1.1rem 1.15rem;
  border: 1px solid var(--app-shell-border);
  border-radius: 14px;
  background: var(--app-shell-surface-soft);
}

.session-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.session-card-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.session-card-delete {
  width: 2.4rem;
  height: 2.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--app-shell-border);
  border-radius: 999px;
  background: transparent;
  color: var(--app-shell-muted);
  cursor: pointer;
}

.session-card-delete:hover {
  background: var(--app-shell-surface-raised);
  color: var(--app-shell-text);
}

.session-card-delete-icon {
  width: 1rem;
  height: 1rem;
  display: inline-flex;
}

.session-card-delete-icon svg {
  width: 100%;
  height: 100%;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.session-card-header h2 {
  font-size: 1.05rem;
  color: var(--app-shell-text);
}

.session-card-header h2 a {
  color: inherit;
  text-decoration: none;
}

.session-card-header h2 a:hover {
  text-decoration: underline;
}

.session-card-url {
  margin-top: 0.35rem;
  color: var(--app-shell-muted);
  font-size: 0.9rem;
  word-break: break-all;
}

.session-card-description {
  margin-top: 1rem;
  color: var(--app-shell-muted);
  line-height: 1.7;
}

.matchup-index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
  gap: 1rem;
  align-items: start;
}

.matchup-index-grid-sessions {
  --matchup-index-card-min: clamp(18rem, 22vw, 22rem);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--matchup-index-card-min)), 1fr));
  gap: clamp(1.15rem, 2vw, 1.65rem);
  row-gap: clamp(1.75rem, 3vw, 2.35rem);
}

.matchup-index-card {
  display: grid;
  gap: 0.75rem;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.matchup-index-card:hover .matchup-index-title {
  color: var(--app-shell-cyan);
}

.youtube-video-index-card:hover .matchup-index-title {
  color: var(--app-shell-text);
}

.matchup-index-card:hover .matchup-index-thumb {
  border-color: color-mix(in srgb, var(--app-shell-text) 34%, transparent);
  transform: translateY(-1px);
}

.youtube-video-index-card:hover .matchup-index-thumb {
  border-color: var(--app-shell-border);
  transform: none;
}

.matchup-index-grid-sessions .matchup-index-card {
  position: relative;
  gap: 0.72rem;
  container-type: inline-size;
  padding: clamp(0.6rem, 1.6cqw, 0.85rem);
  border-radius: 14px;
  background: #202020;
  transition: background 0.16s ease, transform 0.16s ease;
}

.matchup-index-grid-sessions .matchup-index-card:hover .matchup-index-title {
  color: var(--app-shell-text);
}

.matchup-index-grid-sessions .matchup-index-card:hover {
  background: #242424;
  transform: translateY(-1px);
}

.matchup-index-media {
  --matchup-thumb-radius: clamp(4px, 1.1cqw, 8px);
  display: block;
}

.matchup-index-grid-sessions .matchup-index-thumb {
  position: relative;
  border: 0;
  border-radius: var(--matchup-thumb-radius);
  transform: none;
}

.matchup-index-grid-sessions .matchup-index-card:hover .matchup-index-thumb {
  border-color: transparent;
  transform: none;
}

.matchup-index-grid-sessions .matchup-index-thumb img {
  transform: scale(1);
  transition: transform 0.24s ease;
  will-change: transform;
}

.matchup-index-grid-sessions .matchup-index-card:hover .matchup-index-thumb img {
  transform: scale(1.045);
}

.matchup-index-thumb-fade {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-bottom: 1px solid var(--app-shell-border);
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(28deg, rgba(0, 0, 0, 0.56) 0%, rgba(0, 0, 0, 0.28) 30%, rgba(0, 0, 0, 0.05) 60%, transparent 78%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.28) 0%, transparent 34%);
}

.matchup-index-player-cards {
  position: absolute;
  right: clamp(0.55rem, 2.2cqw, 0.9rem);
  bottom: clamp(0.38rem, 1.4cqw, 0.62rem);
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: clamp(0.28rem, 1cqw, 0.48rem);
  transform-origin: bottom right;
  transition: transform 0.2s ease;
  pointer-events: none;
}

.matchup-index-grid-sessions .matchup-index-card:hover .matchup-index-player-cards {
  transform: scale(1.08);
}

.matchup-index-player-card {
  position: relative;
  width: clamp(2.75rem, 15cqw, 4.35rem);
  flex: 0 0 auto;
}

.matchup-index-player-card.is-winner {
  width: clamp(3.85rem, 20cqw, 5.9rem);
}

.matchup-index-player-card-frame {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 63 / 88;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--matchup-player-color, #16a34a) 58%, var(--app-shell-border));
  border-radius: 5.59% / 4%;
  background: var(--app-shell-surface-soft);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.3);
}

.matchup-index-player-card.is-winner .matchup-index-player-card-frame::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 48%;
  background: linear-gradient(0deg, color-mix(in srgb, #22c55e 52%, transparent) 0%, transparent 86%);
  pointer-events: none;
}

.matchup-index-player-card-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.matchup-index-winner-crown {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.18rem);
  z-index: 2;
  width: clamp(1.35rem, 6cqw, 2rem);
  height: clamp(1.35rem, 6cqw, 2rem);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #22c55e;
  filter: drop-shadow(0 4px 7px rgba(0, 0, 0, 0.45));
  transform: translateX(-50%);
}

.matchup-index-winner-crown svg {
  width: 100%;
  height: 100%;
  display: block;
}

.matchup-index-winner-crown svg,
.matchup-index-winner-crown svg path {
  fill: currentColor;
}

.matchup-index-thumb {
  aspect-ratio: 16 / 9;
  display: block;
  overflow: hidden;
  border: 1px solid var(--app-shell-border);
  border-radius: 8px;
  background: var(--app-shell-surface-soft);
  transition: border-color 0.16s ease, transform 0.16s ease;
}

.matchup-index-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.matchup-index-body {
  display: grid;
  gap: 0.22rem;
  min-width: 0;
}

.matchup-index-grid-sessions .matchup-index-body {
  min-height: clamp(3.75rem, 12cqw, 5.4rem);
  padding: 0 clamp(8rem, 40cqw, 15rem) 0 0;
}

.matchup-index-title,
.matchup-index-heroes,
.matchup-index-meta,
.matchup-index-winner {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.matchup-index-title {
  color: var(--app-shell-text);
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.25;
}

.matchup-index-heroes {
  color: var(--app-shell-muted);
  font-size: 0.8rem;
  font-weight: 500;
}

.matchup-index-meta,
.matchup-index-winner {
  color: var(--app-shell-muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.site-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: 1rem;
}

.site-stats-card {
  display: grid;
  gap: 1rem;
}

.site-stats-list {
  display: grid;
  gap: 0.75rem;
}

.site-stats-row {
  display: grid;
  gap: 0.35rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--app-shell-border);
}

.site-stats-row:first-child {
  padding-top: 0;
  border-top: 0;
}

.site-stats-row dt {
  color: var(--app-shell-text);
  font-weight: 700;
}

.site-stats-row dd {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  color: var(--app-shell-muted);
}

.hero-index-header {
  margin-bottom: 1rem;
}

.hero-index-header .settings-header-row {
  align-items: center;
  flex-wrap: wrap;
}

.hero-index-header-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.6rem;
}

.hero-index-page {
  display: grid;
  gap: 1.2rem;
}

.hero-index-title-block {
  display: grid;
  gap: 0.85rem;
}

.hero-index-action-button {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.25rem;
  padding: 0 0.85rem;
  border: 1px solid var(--app-shell-border);
  border-radius: 8px;
  background: var(--app-shell-surface-raised);
  color: var(--app-shell-text);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.hero-index-action-button:hover,
.hero-index-action-button:focus-visible {
  border-color: rgba(124, 255, 79, 0.72);
  outline: 0;
}

.hero-index-action-button svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

.hero-index-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  padding: 0;
}

.hero-index-toolbar-divider {
  width: 1px;
  height: 1.65rem;
  background: var(--app-shell-border);
}

.hero-index-control-group {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.hero-index-control {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  text-decoration: none;
}

.hero-index-control.filter-radio-tab {
  padding: 0.43rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 800;
  text-decoration: none;
}

.hero-index-control:hover,
.hero-index-control:focus-visible {
  outline: 0;
}

.hero-index-control.is-active {
  background: #f2f2f2;
  color: #111111;
}

.hero-index-groups {
  display: grid;
  gap: 2rem;
}

.hero-set-section {
  display: grid;
  gap: 0.85rem;
}

.hero-set-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--app-shell-border);
}

.hero-set-header h2 {
  margin: 0;
  color: var(--app-shell-text);
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.2;
}

.hero-set-header p {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.25rem 0 0;
  color: var(--app-shell-muted);
  font-size: 0.82rem;
}

.hero-set-header p span + span::before {
  content: "|";
  margin-right: 0.45rem;
  color: var(--app-shell-border);
}

.hero-index-gallery,
.hero-show-card-grid {
  --hero-card-grid-min: max(10rem, calc((100% - 4.8rem) / 5));
  --hero-card-grid-gap: 1.2rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--hero-card-grid-min), 1fr));
  gap: var(--hero-card-grid-gap);
  width: 100%;
}

.hero-index-gallery {
  justify-content: start;
  align-content: start;
  padding: 0 0 2rem;
}

.hero-gallery-card {
  position: relative;
  z-index: 0;
  display: grid;
  justify-items: center;
  gap: 0.65rem;
  min-width: 0;
  isolation: isolate;
  container-type: inline-size;
}

.hero-gallery-card:hover,
.hero-gallery-card:focus-within {
  z-index: 20;
}

.hero-catalog-card {
  --hero-card-radius-x: 5.59%;
  --hero-card-radius-y: 4%;
  position: relative;
  z-index: 0;
  width: 100%;
  aspect-ratio: 63 / 88;
  border-radius: var(--hero-card-radius-x) / var(--hero-card-radius-y);
  overflow: hidden;
  transform-origin: center center;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  will-change: transform;
}

.hero-catalog-card:hover,
.hero-catalog-card:focus-within {
  z-index: 10;
  transform: scale(1.12);
  box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.35);
}

.hero-catalog-card-with-stack {
  overflow: visible;
}

.hero-catalog-card-with-stack:hover,
.hero-catalog-card-with-stack:focus-within {
  box-shadow: none;
}

.hero-card-stack {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.hero-card-stack-copy {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: var(--hero-card-radius-x) / var(--hero-card-radius-y);
  background: var(--app-shell-surface-raised);
  box-shadow: 0 0.45rem 1rem rgba(0, 0, 0, 0.2);
  transform: translate(0, 0) rotate(0deg);
  transform-origin: 48% 82%;
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: transform;
}

.hero-card-stack-copy:nth-child(1) {
  z-index: 4;
}

.hero-card-stack-copy:nth-child(2) {
  z-index: 3;
}

.hero-card-stack-copy:nth-child(3) {
  z-index: 2;
}

.hero-card-stack-copy:nth-child(n+4) {
  z-index: 1;
}

.hero-card-stack-face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  border-radius: inherit;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.16s ease;
}

.hero-card-stack-face.is-active {
  opacity: 1;
}

.hero-catalog-card-with-stack:hover .hero-card-stack-copy:nth-child(1),
.hero-catalog-card-with-stack:focus-within .hero-card-stack-copy:nth-child(1) {
  transform: translate(0.48rem, 0.08rem) rotate(3.5deg);
}

.hero-catalog-card-with-stack:hover .hero-card-stack-copy:nth-child(2),
.hero-catalog-card-with-stack:focus-within .hero-card-stack-copy:nth-child(2) {
  transform: translate(0.92rem, 0.18rem) rotate(7deg);
}

.hero-catalog-card-with-stack:hover .hero-card-stack-copy:nth-child(3),
.hero-catalog-card-with-stack:focus-within .hero-card-stack-copy:nth-child(3) {
  transform: translate(1.3rem, 0.34rem) rotate(10.5deg);
}

.hero-catalog-card-with-stack:hover .hero-card-stack-copy:nth-child(n+4),
.hero-catalog-card-with-stack:focus-within .hero-card-stack-copy:nth-child(n+4) {
  transform: translate(1.62rem, 0.52rem) rotate(14deg);
}

.hero-catalog-card-media {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  overflow: hidden;
  transition: filter 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0);
}

.hero-catalog-card-with-stack:hover .hero-catalog-card-media,
.hero-catalog-card-with-stack:focus-within .hero-catalog-card-media {
  box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.35);
}

.hero-card-face {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease;
}

.hero-card-face.is-active {
  opacity: 1;
  pointer-events: auto;
}

.hero-catalog-card-link {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
}

.hero-catalog-card-link:focus-visible {
  outline: 2px solid rgba(124, 255, 79, 0.92);
  outline-offset: 3px;
}

.hero-catalog-card-flip-button {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  z-index: 3;
  width: 2.2rem;
  height: 2.2rem;
  display: none;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 9px;
  background: rgba(12, 12, 12, 0.74);
  color: #ffffff;
  cursor: pointer;
}

.hero-catalog-card-flip-button:hover,
.hero-catalog-card-flip-button:focus-visible {
  border-color: rgba(124, 255, 79, 0.75);
  outline: 0;
}

.hero-catalog-card-flip-button svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

@media (hover: none), (pointer: coarse), (max-width: 700px) {
  .hero-catalog-card-flip-button {
    display: grid;
  }
}

@media (prefers-reduced-motion: reduce) {
  .logged-in-content:has(.hero-show-page)::before {
    animation: none;
  }

  .hero-catalog-card {
    transition: none;
  }

  .hero-card-stack-copy {
    transition: none;
  }

  .card-image-frame.is-loading::before {
    opacity: 0.16;
    translate: 0;
    animation: none;
  }

  .cards-hand-card,
  .cards-hand-card.is-dealt,
  .cards-hand-card.is-discarding {
    opacity: 1;
    transform: var(--hand-transform);
    transition: none;
  }
}

.hero-face-frame {
  width: 100%;
  height: 100%;
  aspect-ratio: 63 / 88;
  box-sizing: border-box;
  border: 1px solid var(--app-shell-border);
  border-radius: inherit;
  overflow: hidden;
}

.hero-face-image,
.hero-show-card-image,
.hero-card-detail-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  background: var(--app-shell-surface-raised);
}

.hero-face-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 1rem;
  color: var(--app-shell-muted);
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  text-transform: uppercase;
}

.hero-gallery-card-title,
.hero-show-title-block h1 {
  margin: 0;
  color: var(--app-shell-text);
  letter-spacing: 0;
}

.hero-gallery-card-title {
  width: 100%;
  font-size: 1rem;
  line-height: 1.25;
  text-align: center;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.hero-gallery-card-title small,
.hero-show-title-block h1 small {
  color: var(--app-shell-muted);
  font: inherit;
}

@container (max-width: 9rem) {
  .hero-gallery-card-title {
    font-size: 0.86rem;
  }
}

@container (max-width: 7.25rem) {
  .hero-gallery-card-title {
    font-size: 0.74rem;
  }
}

.hero-show-page {
  --hero-character-card-width: clamp(15rem, 24.75cqi, 21rem);
  --hero-profile-height: clamp(25rem, 37.65cqi, 32rem);
  --hero-banner-height: clamp(9.5rem, 15.1cqi, 12.85rem);
  position: relative;
  isolation: isolate;
  container-type: inline-size;
  display: grid;
  gap: 2.65rem;
  margin-top: -1.75rem;
  padding-bottom: 3rem;
}

.hero-show-profile {
  position: relative;
  isolation: isolate;
  min-height: var(--hero-profile-height);
}

.hero-show-profile::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 5;
  height: 1px;
  background: var(--app-shell-border);
  pointer-events: none;
}

.hero-show-profile-layout {
  min-height: var(--hero-profile-height);
  display: grid;
  grid-template-columns: calc(var(--hero-character-card-width) + 1.375rem) minmax(0, 1fr);
  align-items: stretch;
}

.hero-show-character-card-wrap {
  display: grid;
  align-content: center;
  justify-items: start;
  padding-right: 1.375rem;
}

.hero-show-character-card {
  width: var(--hero-character-card-width);
  box-shadow: 0 1.8rem 3.5rem rgba(0, 0, 0, 0.48);
}

.hero-show-character-card .hero-catalog-card-flip-button {
  display: none;
}

.hero-show-content {
  min-width: 0;
  display: grid;
  grid-template-rows: var(--hero-banner-height) minmax(0, 1fr);
}

.hero-show-banner {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border-bottom: 1px solid var(--app-shell-border);
}

.hero-show-banner-art {
  position: absolute;
  inset: 0 clamp(2rem, 5vw, 5rem);
  background-image:
    radial-gradient(circle at 72% 22%, color-mix(in srgb, var(--hero-tertiary) 68%, transparent), transparent 46%),
    linear-gradient(to bottom, var(--hero-primary), var(--hero-secondary));
  background-position: center;
  background-size: cover;
  filter: saturate(0.9) contrast(1.06);
  -webkit-mask-image:
    linear-gradient(
      to right,
      transparent 0%,
      rgba(0, 0, 0, 0.12) 12%,
      rgba(0, 0, 0, 0.38) 29%,
      rgba(0, 0, 0, 0.72) 48%,
      #000 64%,
      rgba(0, 0, 0, 0.82) 73%,
      rgba(0, 0, 0, 0.42) 85%,
      transparent 100%
    ),
    linear-gradient(
      145deg,
      transparent 0%,
      rgba(0, 0, 0, 0.18) 9%,
      rgba(0, 0, 0, 0.62) 19%,
      #000 31%,
      #000 100%
    );
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(
      to right,
      transparent 0%,
      rgba(0, 0, 0, 0.12) 12%,
      rgba(0, 0, 0, 0.38) 29%,
      rgba(0, 0, 0, 0.72) 48%,
      #000 64%,
      rgba(0, 0, 0, 0.82) 73%,
      rgba(0, 0, 0, 0.42) 85%,
      transparent 100%
    ),
    linear-gradient(
      145deg,
      transparent 0%,
      rgba(0, 0, 0, 0.18) 9%,
      rgba(0, 0, 0, 0.62) 19%,
      #000 31%,
      #000 100%
    );
  mask-composite: intersect;
}

.hero-show-banner-art.has-banner-image {
  background-image: var(--hero-banner-image);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  filter: none;
}

.hero-show-title-block {
  position: relative;
  z-index: 1;
  min-width: 0;
  padding: 1.55rem clamp(1.5rem, 3vw, 2.75rem);
}

.hero-show-title-block h1 {
  max-width: 90%;
  margin: 0;
  color: var(--app-shell-text);
  font-size: clamp(2rem, 4vw, 3.65rem);
  font-weight: 850;
  letter-spacing: -0.04em;
  line-height: 0.96;
  text-wrap: balance;
}

.hero-show-title-wrap {
  position: relative;
  width: fit-content;
  max-width: 90%;
}

.hero-show-title-wrap h1 {
  max-width: 100%;
}

.hero-show-title-image {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  width: clamp(12rem, 21vw, 18.5rem);
  max-width: none;
  height: auto;
  pointer-events: none;
  transform: translate(-50%, -26%);
  user-select: none;
}

.hero-show-title-block p {
  margin: 0 0 0.35rem;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.hero-show-sidekick-names {
  margin-top: 0.42rem;
  color: var(--app-shell-muted);
  font-size: clamp(1rem, 2vw, 1.45rem);
  font-weight: 750;
}

.hero-variant-selector {
  position: absolute;
  right: 0;
  bottom: 0.75rem;
  z-index: 6;
  width: fit-content;
  display: flex;
  gap: 0.2rem;
  padding: 0.2rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(8, 10, 14, 0.72);
  backdrop-filter: blur(0.5rem);
}

.hero-variant-option {
  padding: 0.35rem 0.75rem;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: var(--app-shell-muted);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-decoration: none;
  text-transform: uppercase;
  transition:
    color 150ms ease,
    background-color 150ms ease;
}

.hero-variant-option:hover,
.hero-variant-option:focus-visible,
.hero-variant-option.is-active {
  color: var(--app-shell-text);
  background: rgba(255, 255, 255, 0.14);
}

.hero-variant-secret:disabled {
  position: relative;
  color: var(--app-shell-muted);
  cursor: pointer;
  opacity: 1;
}

.hero-variant-secret:disabled:hover {
  color: var(--app-shell-muted);
  background: transparent;
}

.hero-variant-secret-image {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 3.15rem;
  max-width: none;
  height: auto;
  pointer-events: none;
  transform: translate(-50%, -50%);
  user-select: none;
}

.hero-show-profile:has(.hero-variant-selector) .hero-show-information {
  padding-right: clamp(16rem, 30vw, 19rem);
}

.hero-show-information {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(12rem, 2fr);
  gap: clamp(1.5rem, 3vw, 3rem);
  padding: 1.35rem clamp(1rem, 3vw, 2.75rem) 0.8rem;
}

.hero-show-information:not(:has(.hero-show-sidekick-info)) {
  grid-template-columns: 1fr;
}

.hero-show-fighter-info,
.hero-show-sidekick-info {
  min-width: 0;
  align-content: start;
}

.hero-show-fighter-info {
  display: grid;
  gap: 1rem;
}

.hero-show-sidekick-info {
  display: grid;
  gap: 0.8rem;
}

.hero-show-info-heading {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 1rem;
}

.hero-show-info-heading .hero-combat-title {
  flex: 0 0 auto;
}

.hero-health-pennants {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
}

.hero-health-pennant-wrap {
  position: relative;
  z-index: 2;
  width: 3.25rem;
  min-height: 5.4rem;
  margin-top: -1.35rem;
  overflow: visible;
}

.hero-health-pennant-wrap .hero-health-pennant {
  margin-top: 0;
}

.hero-health-pennant-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  width: 4.65rem;
  max-width: none;
  height: auto;
  pointer-events: none;
  transform: translate(-50%, -35%);
  user-select: none;
}

.hero-health-pennant {
  position: relative;
  z-index: 1;
  width: 3.25rem;
  min-height: 5.4rem;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.05rem;
  margin-top: -1.35rem;
  padding: 1.45rem 0.25rem 0.82rem;
  background: linear-gradient(to bottom, transparent 0, rgba(63, 67, 74, 0.55) 30%, #3f434a 58%);
  color: #ffffff;
  filter: drop-shadow(0 0.45rem 0.55rem rgba(0, 0, 0, 0.3));
  clip-path: polygon(0 0, 100% 0, 100% 82%, 50% 100%, 0 82%);
}

.hero-health-pennant::after {
  content: "";
  position: absolute;
  top: 82%;
  left: 50%;
  width: 1.25rem;
  height: 0.45rem;
  background: var(--app-shell-canvas);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform: translateX(-50%);
}

.hero-health-pennant span {
  font-size: 0.58rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
}

.hero-health-pennant strong {
  font-size: 1.55rem;
  line-height: 1;
}

.hero-combat-title {
  min-width: 0;
  width: clamp(8rem, 11vw, 10.5rem);
  margin-left: -0.175rem;
}

.hero-combat-title svg,
.hero-combat-title-image {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
}

.hero-combat-title-image {
  transform: translateX(-0.3rem);
}

.hero-combat-title strong {
  font-size: clamp(1.6rem, 3vw, 2.5rem);
  text-transform: uppercase;
}

.hero-sidekick-tokens {
  min-height: 4.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.hero-sidekick-token {
  position: relative;
  width: clamp(3.6rem, 5vw, 4.8rem);
  aspect-ratio: 1;
  margin: 0;
  transform: rotate(calc((var(--sidekick-token-index) - 1) * 1.8deg));
  filter: drop-shadow(0 0.7rem 0.75rem rgba(0, 0, 0, 0.38));
}

.hero-sidekick-token:nth-child(even) {
  translate: 0 0.28rem;
}

.hero-sidekick-token img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 50%;
  object-fit: contain;
}

.hero-catalog-card img,
.hero-sidekick-token img,
.cards-index-page img,
.card-image-frame img {
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  user-select: none;
}

.hero-show-ability {
  display: grid;
  gap: 0.65rem;
}

.hero-show-ability h2 {
  margin: 0;
  color: var(--app-shell-text);
  font-size: clamp(1rem, 1.35vw, 1.2rem);
}

.hero-ability-text {
  margin: 0;
  color: #ffffff;
  line-height: 1.6;
}

.hero-card-description-text {
  margin: 0;
  color: var(--app-shell-muted);
  line-height: 1.6;
}

.hero-ability-text,
.hero-card-description-text {
  display: grid;
  gap: 0.18rem;
}

.hero-ability-separator {
  display: block;
  height: 0.3em;
}

.hero-show-sidekick-info h2 {
  margin: 0;
  color: var(--app-shell-muted);
  font-size: clamp(1rem, 1.6vw, 1.3rem);
}

.cards-index-page {
  position: relative;
  min-height: calc(100vh - 8rem);
  display: grid;
  gap: 2rem;
  align-content: center;
}

.cards-search-stage {
  width: min(100%, 56rem);
  display: grid;
  justify-self: center;
  justify-items: center;
  gap: 1.4rem;
}

.cards-search-form {
  width: min(100%, 34rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.7rem;
}

.cards-search-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.cards-search-tooltip {
  margin-left: 0;
}

.cards-search-tooltip .settings-tooltip-icon {
  width: 1.45rem;
  height: 1.45rem;
  font-size: 0.8rem;
}

.cards-search-tooltip .settings-tooltip-text {
  width: 22rem;
  max-width: min(22rem, calc(100vw - 2rem));
  padding: 0.7rem 0.8rem;
}

.cards-search-tooltip code {
  color: var(--app-shell-cyan);
  font-size: 0.72rem;
}

.cards-search-form input[type="search"] {
  min-height: 2.9rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--app-shell-border);
  border-radius: 8px;
  background: var(--app-shell-surface);
  color: var(--app-shell-text);
  font: inherit;
}

.cards-search-form input[type="search"]:focus {
  outline: none;
  border-color: var(--app-shell-cyan);
}

.cards-hand {
  width: min(100%, 44rem);
  display: grid;
  justify-items: center;
  gap: 1.1rem;
}

.cards-hand-fan {
  width: 100%;
  min-height: clamp(17rem, 36vw, 25rem);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: end;
  justify-items: center;
  padding: 1.25rem 0 1.25rem;
  perspective: 60rem;
}

.cards-hand-card {
  --hero-card-radius-x: 5.59%;
  --hero-card-radius-y: 4%;
  --hand-transform: translate(0, 0) rotate(0deg);
  position: relative;
  width: min(11.5rem, 22vw);
  aspect-ratio: 63 / 88;
  overflow: hidden;
  border: 1px solid var(--app-shell-border);
  border-radius: var(--hero-card-radius-x) / var(--hero-card-radius-y);
  background: var(--app-shell-surface-raised);
  box-shadow: 0 1rem 1.9rem rgba(0, 0, 0, 0.32);
  transform-origin: 50% 105%;
  opacity: 0;
  transform: var(--hand-transform) translateY(12rem) scale(0.72);
  transition: opacity 0.28s ease, transform 0.38s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.18s ease;
  will-change: opacity, transform;
}

.cards-hand-card.is-dealt {
  opacity: 1;
  transform: var(--hand-transform);
}

.cards-hand-card.is-discarding {
  opacity: 0;
  transform: var(--hand-transform) translateY(-11rem) rotate(7deg) scale(0.82);
  transition-duration: 0.24s;
}

.cards-hand-card.is-dealt:hover,
.cards-hand-card.is-dealt:focus-within {
  z-index: 10;
  transform: translate(var(--hand-x), var(--hand-y)) rotate(var(--hand-rotation)) translateY(-1.1rem) scale(1.13);
  box-shadow: 0 1.6rem 2.4rem rgba(0, 0, 0, 0.42);
}

.cards-hand-card-0 {
  --hand-x: 4.4rem;
  --hand-y: 1.7rem;
  --hand-rotation: -18deg;
  --hand-transform: translate(var(--hand-x), var(--hand-y)) rotate(var(--hand-rotation));
}

.cards-hand-card-1 {
  --hand-x: 2.1rem;
  --hand-y: 0.58rem;
  --hand-rotation: -8deg;
  --hand-transform: translate(var(--hand-x), var(--hand-y)) rotate(var(--hand-rotation));
}

.cards-hand-card-2 {
  --hand-x: 0;
  --hand-y: 0.05rem;
  --hand-rotation: 0deg;
  --hand-transform: translate(var(--hand-x), var(--hand-y)) rotate(var(--hand-rotation));
  z-index: 2;
}

.cards-hand-card-3 {
  --hand-x: -2.1rem;
  --hand-y: 0.58rem;
  --hand-rotation: 8deg;
  --hand-transform: translate(var(--hand-x), var(--hand-y)) rotate(var(--hand-rotation));
}

.cards-hand-card-4 {
  --hand-x: -4.4rem;
  --hand-y: 1.7rem;
  --hand-rotation: 18deg;
  --hand-transform: translate(var(--hand-x), var(--hand-y)) rotate(var(--hand-rotation));
}

.cards-hand-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.cards-mulligan-button {
  position: relative;
  z-index: 5;
}

.cards-search-results {
  display: grid;
  gap: 1.25rem;
}

.cards-results-header h1 {
  margin: 0;
  color: var(--app-shell-text);
  font-size: clamp(1.8rem, 4vw, 3rem);
}

.cards-results-header p {
  margin: 0.35rem 0 0;
  color: var(--app-shell-muted);
}

.cards-results-grid {
  --hero-card-grid-min: max(10rem, calc((100% - 4.8rem) / 5));
  --hero-card-grid-gap: 1.2rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--hero-card-grid-min), 1fr));
  gap: var(--hero-card-grid-gap);
}

.cards-result-card {
  min-width: 0;
}

.cards-result-card-image .hero-catalog-card-flip-button {
  display: none;
}

.hero-show-cards-section {
  display: grid;
  gap: 1rem;
}

.hero-show-card-grid {
  justify-content: center;
  align-content: start;
  max-width: 100%;
  margin: 0 auto;
}

.hero-show-card-modal-group,
.hero-show-card-button {
  min-width: 0;
}

.hero-show-card-modal-group {
  position: relative;
  z-index: 0;
}

.hero-show-card-modal-group:hover,
.hero-show-card-modal-group:focus-within {
  z-index: 20;
}

.hero-show-card-button {
  width: 100%;
  display: grid;
  gap: 0.55rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--app-shell-text);
  cursor: pointer;
  text-align: center;
}

.hero-show-card-button > span {
  overflow: hidden;
  color: var(--app-shell-text);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-show-card-image-frame {
  --hero-card-radius-x: 5.59%;
  --hero-card-radius-y: 4%;
  width: 100%;
  aspect-ratio: 63 / 88;
  border: 1px solid var(--app-shell-border);
  border-radius: var(--hero-card-radius-x) / var(--hero-card-radius-y);
}

.hero-card-detail-layout {
  display: grid;
  grid-template-columns: minmax(13rem, 18rem) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.hero-card-detail-image-frame {
  --hero-card-radius-x: 5.59%;
  --hero-card-radius-y: 4%;
  width: 100%;
  aspect-ratio: 63 / 88;
  border: 1px solid var(--app-shell-border);
  border-radius: var(--hero-card-radius-x) / var(--hero-card-radius-y);
}

.hero-card-detail-fields {
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
}

.hero-card-detail-description {
  grid-column: 1 / -1;
}

.card-image-frame {
  position: relative;
  display: block;
  overflow: hidden;
  background: #242424;
}

.card-image-frame::before {
  content: "";
  position: absolute;
  inset: -35% -60%;
  z-index: 1;
  background: linear-gradient(
    115deg,
    transparent 48.5%,
    rgba(255, 255, 255, 0.28) 49.5%,
    rgba(255, 255, 255, 0.28) 50.5%,
    transparent 51.5%
  );
  opacity: 0;
  translate: -120% 0;
  pointer-events: none;
}

.card-image-frame.is-loading::before {
  opacity: 1;
  animation: card-image-glint 1.15s ease-in-out infinite;
}

.card-image-frame.is-loading img {
  opacity: 0;
}

.card-image-frame.is-loaded img {
  opacity: 1;
}

.card-image-frame img {
  transition: opacity 160ms ease;
}

.hero-deck-card-image-frame {
  width: 100%;
  aspect-ratio: 63 / 88;
  border-bottom: 1px solid var(--app-shell-border);
}

.hero-card-image {
  width: 100%;
  height: 100%;
  aspect-ratio: 63 / 88;
  display: block;
  object-fit: cover;
  background: var(--app-shell-surface-raised);
}

.card-image-placeholder,
.hero-card-image-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--app-shell-muted);
  font-weight: 700;
}

.hero-form,
.hero-form-section {
  width: 100%;
  max-width: none;
  min-width: 0;
  display: grid;
  gap: 1rem;
}

.hero-form-hero-layout {
  display: grid;
  grid-template-columns: minmax(20rem, 0.8fr) minmax(0, 1.2fr);
  gap: 1rem;
  align-items: start;
}

.hero-form-media-panel {
  align-content: start;
}

.hero-form-face-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.hero-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 1rem;
}

.hero-form-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 1rem;
}

.hero-form-face-upload {
  display: grid;
  gap: 0.65rem;
}

.hero-form-face-frame {
  width: min(100%, 10rem);
  aspect-ratio: 63 / 88;
  border: 1px solid var(--app-shell-border);
  border-radius: 8px;
}

.file-dropzone {
  position: relative;
  min-width: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px dashed rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--app-shell-muted);
  cursor: pointer;
  transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}

.file-dropzone:hover,
.file-dropzone:focus-visible,
.file-dropzone.is-dragging {
  border-color: rgba(124, 255, 79, 0.82);
  background: rgba(124, 255, 79, 0.05);
  color: var(--app-shell-text);
  outline: none;
}

.file-dropzone-card {
  width: 100%;
  aspect-ratio: 63 / 88;
}

.file-dropzone input[type="file"] {
  position: fixed;
  left: -100vw;
  top: 0;
  inline-size: 0;
  block-size: 0;
  opacity: 0;
  pointer-events: none;
}

.file-dropzone-placeholder {
  display: grid;
  justify-items: center;
  gap: 0.45rem;
  padding: 1rem;
  text-align: center;
}

.file-dropzone-icon {
  width: 2.35rem;
  height: 2.35rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: currentColor;
}

.file-dropzone-icon svg {
  width: 1.05rem;
  height: 1.05rem;
  fill: currentColor;
}

.file-dropzone-placeholder > span:not(.file-dropzone-icon) {
  color: var(--app-shell-text);
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.2;
}

.file-dropzone-placeholder small {
  max-width: 8rem;
  color: var(--app-shell-muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.file-dropzone-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background: var(--app-shell-surface-raised);
}

.file-dropzone-preview[hidden],
.file-dropzone.has-file .file-dropzone-placeholder {
  display: none;
}

.file-dropzone-remove {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.58);
  color: #ffffff;
  opacity: 0;
  pointer-events: none;
  cursor: pointer;
  transition: opacity 0.16s ease;
}

.file-dropzone.has-file:hover .file-dropzone-remove,
.file-dropzone.has-file:focus-within .file-dropzone-remove {
  opacity: 1;
  pointer-events: auto;
}

.file-dropzone:not(.has-file) .file-dropzone-remove {
  display: none;
}

.file-dropzone-remove svg {
  width: 2.3rem;
  height: 2.3rem;
  fill: currentColor;
}

.hero-sidekick-list {
  display: grid;
  gap: 0.75rem;
}

.hero-sidekick-list:empty::before {
  content: "No sidekicks yet. Use + Add sidekick if this hero has one.";
  color: var(--app-shell-muted);
}

.hero-sidekick-row {
  display: grid;
  grid-template-columns: minmax(10rem, 1fr) minmax(7rem, 0.7fr) minmax(6rem, 0.6fr) minmax(5rem, 0.5fr) 2.5rem;
  gap: 0.75rem;
  align-items: end;
  padding: 0.85rem;
  border: 1px solid var(--app-shell-border);
  border-radius: 12px;
  background: var(--app-shell-surface);
}

.hero-sidekick-row .form-group {
  margin: 0;
}

.hero-card-list {
  display: grid;
  border: 1px solid var(--app-shell-border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--app-shell-surface-soft);
}

.hero-card-list:empty::before {
  content: "No cards yet. Use + Add card to create the first row.";
  padding: 1rem;
  color: var(--app-shell-muted);
}

.hero-card-list-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 2.5rem;
  gap: 0.65rem;
  align-items: stretch;
  padding: 0.65rem;
  border-top: 1px solid var(--app-shell-border);
}

.hero-card-list-row:focus-within {
  background: rgba(255, 255, 255, 0.03);
}

.hero-card-list-row:first-child {
  border-top: 0;
}

.hero-card-list-row .form-group {
  margin: 0;
}

.hero-card-row-image {
  align-self: stretch;
  width: auto;
  min-width: 6rem;
  max-width: 8.8rem;
  aspect-ratio: 63 / 88;
}

.hero-card-row-image .file-dropzone {
  height: 100%;
}

.hero-card-row-fields {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
}

.hero-card-row-main {
  display: grid;
  grid-template-columns: minmax(12rem, 1fr) minmax(10rem, 0.55fr);
  gap: 0.6rem;
}

.hero-card-row-stats {
  display: grid;
  grid-template-columns: minmax(4.5rem, 0.5fr) minmax(9rem, 1fr) minmax(5rem, 0.55fr) minmax(5rem, 0.55fr);
  gap: 0.6rem;
}

.hero-add-row {
  min-height: 3.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.85rem 1rem;
  border: 1px dashed rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--app-shell-muted);
  font: inherit;
  cursor: pointer;
}

.hero-add-row:hover {
  border-color: rgba(124, 255, 79, 0.82);
  background: rgba(124, 255, 79, 0.05);
  color: var(--app-shell-text);
}

.hero-add-row span {
  width: 1.55rem;
  height: 1.55rem;
  display: grid;
  place-items: center;
  color: inherit;
  font-size: 1.25rem;
  line-height: 1;
}

.hero-add-row-card {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

@media (max-width: 900px) {
  .logged-in-content:has(.hero-show-page) {
    --hero-blob-content-edge: 4%;
    --hero-blob-width: 38rem;
    --hero-blob-height: 24rem;
    --hero-blob-bottom-overscan: calc(12rem + env(safe-area-inset-bottom, 0px));
    --hero-blob-y: calc(100% - var(--hero-blob-bottom-overscan));
  }

  .logged-in-content:has(.hero-show-page)::before {
    bottom: calc(-1 * var(--hero-blob-bottom-overscan));
  }

  .hero-show-profile-layout,
  .hero-card-detail-layout,
  .hero-form-hero-layout,
  .hero-card-row-main,
  .hero-card-row-stats {
    grid-template-columns: 1fr;
  }

  .hero-show-profile {
    min-height: 0;
  }

  .hero-show-banner {
    width: 100%;
    height: 8rem;
  }

  .hero-show-profile-layout {
    gap: 1.25rem;
    padding-top: 0;
  }

  .hero-show-content {
    display: contents;
  }

  .hero-show-banner {
    grid-row: 1;
  }

  .hero-show-character-card-wrap {
    grid-row: 2;
    padding-top: 1.5rem;
  }

  .hero-show-character-card {
    justify-self: center;
    width: min(62vw, 18rem);
  }

  .hero-show-information {
    grid-row: 3;
    grid-template-columns: minmax(0, 3fr) minmax(11rem, 2fr);
  }

  .hero-card-list-row {
    grid-template-columns: 5.5rem minmax(0, 1fr);
  }

  .hero-card-list-row > .hero-card-remove-button {
    grid-column: 2;
    justify-self: end;
  }
}

.hero-card-list-row .form-group label {
  margin-bottom: 0.28rem;
  font-size: 0.68rem;
  line-height: 1;
}

.hero-card-list-row .form-group input,
.hero-card-list-row .form-group select {
  min-height: 2.15rem;
  padding-block: 0.38rem;
  font-size: 0.92rem;
}

.hero-card-list-row textarea {
  min-height: 2.15rem;
  padding-block: 0.38rem;
  font-size: 0.92rem;
  resize: none;
}

.hero-form textarea[data-autosize] {
  min-height: calc(2lh + 1rem);
  max-height: calc(10lh + 1rem);
  resize: none;
}

.hero-card-paste-target {
  display: grid;
  gap: 0.35rem;
}

.hero-card-form-preview {
  width: 4.5rem;
  height: 100%;
  aspect-ratio: 63 / 88;
  display: block;
  object-fit: cover;
  border: 1px solid var(--app-shell-border);
  border-radius: 8px;
  background: var(--app-shell-surface-raised);
}

.hero-card-form-preview-frame {
  width: 4.5rem;
  aspect-ratio: 63 / 88;
  border-radius: 8px;
}

.hero-card-form-preview-frame .hero-card-form-preview {
  width: 100%;
  border: 0;
}

.hero-card-form-preview[hidden] {
  display: none;
}

.hero-card-paste-hint {
  color: var(--app-shell-muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.hero-card-remove-button {
  width: 2.4rem;
  height: 2.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--app-shell-border);
  border-radius: 999px;
  background: transparent;
  color: var(--app-shell-muted);
  cursor: pointer;
}

.hero-card-remove-button:hover {
  background: var(--app-shell-surface-raised);
  color: var(--app-shell-text);
}

.hero-card-remove-button svg {
  width: 1rem;
  height: 1rem;
}

.site-stats-value {
  margin-top: 0.8rem;
  color: var(--app-shell-text);
  font-size: 2rem;
  font-weight: 800;
}

.session-import-form {
  width: 100%;
  max-width: none;
  display: grid;
  gap: 1rem;
}

.session-import-preview {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(16rem, 1fr);
  gap: 1rem;
  align-items: stretch;
}

.session-import-frame {
  position: relative;
  min-height: 100%;
}

.session-import-frame iframe {
  position: relative;
  z-index: 1;
}

.session-import-frame iframe[hidden] {
  display: none;
}

.session-import-placeholder[hidden] {
  display: none;
}

.session-import-placeholder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  padding: 1.5rem;
  color: var(--app-shell-muted);
  text-align: center;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.02) 100%);
  pointer-events: none;
  z-index: 2;
}

.session-import-meta {
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100%;
  overflow: hidden;
}

.session-import-meta-header {
  margin-bottom: 0;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--app-shell-border);
}

.session-import-meta-body {
  flex: 1;
  min-height: 0;
  padding-top: 0.9rem;
  overflow-y: auto;
}

.session-import-description {
  margin-top: 0;
  margin-bottom: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.session-import-placeholder-spinner {
  width: 1.65rem;
  height: 1.65rem;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-top-color: #ffffff;
  border-radius: 999px;
  animation: button-spinner-spin 0.75s linear infinite;
}

.session-import-placeholder[data-state="loading"] {
  color: var(--app-shell-text);
}

.session-import-placeholder[data-state="error"] {
  color: #ff9c9c;
}

.preview-section {
  margin-top: 2rem;
}

.preview-status-card {
  margin-top: 1rem;
}

.preview-processing {
  margin-top: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--app-shell-muted);
}

.preview-status-badge {
  text-transform: capitalize;
}

.player-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.player-pill {
  min-width: 11rem;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--app-shell-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--app-shell-text);
}

.player-pill-button {
  font: inherit;
  cursor: pointer;
}

.player-pill.is-winner {
  border-color: #84cc16;
  box-shadow: inset 0 0 0 1px rgba(132, 204, 22, 0.2);
}

.player-pill.is-loser {
  border-color: #ef4444;
  box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.16);
}

.player-pill-index {
  width: 1.6rem;
  height: 1.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--app-shell-text);
  color: var(--app-shell-surface);
  font-size: 0.78rem;
  font-weight: 800;
}

.player-pill-character,
.player-pill-meta {
  color: var(--app-shell-muted);
  font-size: 0.88rem;
}

.session-editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 750px) minmax(20rem, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.session-draft-header-row {
  margin-bottom: 1rem;
}

.session-draft-actions {
  margin-top: 0;
  justify-content: flex-end;
}

.session-draft-list-actions {
  margin-top: 0;
  margin-bottom: 1rem;
}

.session-draft-index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, clamp(18rem, 22vw, 22rem)), 1fr));
  gap: clamp(1.15rem, 2vw, 1.65rem);
  row-gap: clamp(1.75rem, 3vw, 2.35rem);
  align-items: start;
}

.session-draft-index-card {
  display: grid;
  gap: 0.85rem;
  min-width: 0;
  padding: 0.75rem;
  border: 0;
  border-radius: 8px;
  background: var(--app-shell-surface-soft);
}

.session-draft-index-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  min-width: 0;
}

.session-draft-index-card-meta > span {
  min-width: 0;
}

.session-draft-index-preview {
  position: relative;
  display: grid;
  gap: 0.72rem;
  color: inherit;
  text-decoration: none;
}

.session-draft-index-preview:hover .session-draft-index-title {
  color: var(--app-shell-text);
}

.session-draft-index-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  overflow: hidden;
  border-radius: 8px;
  background: #141414;
}

.session-draft-index-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transform: scale(1);
  transition: transform 0.24s ease;
}

.session-draft-index-preview:hover .session-draft-index-thumb img {
  transform: scale(1.045);
}

.session-draft-index-thumb-fade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.44), transparent 58%);
  pointer-events: none;
}

.session-draft-index-body {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.session-draft-index-title {
  min-width: 0;
  overflow: hidden;
  color: var(--app-shell-text);
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.16s ease;
}

.session-draft-index-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  flex-wrap: wrap;
  padding-top: 0.15rem;
}

.session-draft-index-actions form {
  margin: 0;
}

.session-draft-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.session-draft-grid-single {
  grid-template-columns: 1fr;
}

.session-draft-players {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.session-draft-players .session-card h2 {
  margin-bottom: 0.85rem;
}

.session-draft-player-editor {
  margin-top: 1.25rem;
}

.session-draft-player-editor h2 {
  margin-bottom: 0.85rem;
}

.settings-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.35rem;
  color: var(--app-shell-text);
  font-weight: 600;
}

.settings-checkbox input {
  margin: 0;
}

.draft-status-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--app-shell-border);
  border-radius: 14px;
  background: var(--app-shell-surface-soft);
}

.draft-status-card.is-running {
  border-color: rgba(255, 255, 255, 0.28);
}

.draft-status-card.is-error {
  border-color: rgba(216, 77, 87, 0.68);
}

.session-draft-editor {
  display: grid;
  grid-template-columns: 12.5rem minmax(0, 1fr) 12.5rem;
  grid-template-rows: minmax(0, 1fr) auto;
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
}

.logged-in-main:has(.session-layout-lab) {
  --session-layout-page-gutter: clamp(0.5rem, 2vw, 1.5rem);
  max-width: none;
  min-height: calc(100vh - 4rem);
  display: flex;
  box-sizing: border-box;
  padding: 1.5rem var(--session-layout-page-gutter);
  overflow-x: hidden;
  overflow-y: auto;
}

.session-layout-shell {
  display: contents;
}

.session-layout-lab {
  --session-layout-gap: 0.75rem;
  --session-layout-media-max: 1100px;
  --session-layout-info-min: 22rem;
  --session-layout-timeline-height: 7.25rem;
  width: min(100%, 1850px);
  min-height: min(calc(100vh - 7rem), 900px);
  max-height: 900px;
  display: grid;
  grid-template-columns:
    minmax(0, min(var(--session-layout-media-max), calc(100% - var(--session-layout-info-min) - var(--session-layout-gap))))
    minmax(var(--session-layout-info-min), 1fr);
  grid-template-rows: auto var(--session-layout-timeline-height);
  grid-template-areas:
    "media info"
    "timeline timeline";
  gap: var(--session-layout-gap);
  align-content: start;
  margin: 0 auto;
}

.session-layout-lab > * {
  min-width: 0;
  min-height: 0;
}

.session-layout-lab-media {
  position: relative;
  z-index: 2;
  grid-area: media;
  width: 100%;
  max-width: var(--session-layout-media-max);
  min-height: 0;
  display: grid;
  grid-template-rows: auto 4.25rem;
  row-gap: var(--session-layout-gap);
  align-items: stretch;
  justify-content: stretch;
  background: transparent;
}

.session-layout-lab-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  overflow: hidden;
  background: transparent;
}

.session-layout-lab-title {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  overflow: visible;
}

.session-layout-lab-info {
  position: relative;
  z-index: 1;
  grid-area: info;
  background: transparent;
}

.session-layout-lab-timeline {
  grid-area: timeline;
  min-height: 0;
  height: 100%;
  background: transparent;
}

.session-layout-match-tab.is-selected .session-layout-match-line {
  background: #ffffff;
}

.session-layout-match-tab.is-selected .session-layout-match-glow {
  --session-layout-glow-opacity: 0.28;
  opacity: var(--session-layout-glow-opacity);
  animation: session-layout-glow-in 0.9s ease-out both;
}

@keyframes session-layout-glow-in {
  from {
    opacity: 0;
  }

  to {
    opacity: var(--session-layout-glow-opacity, 1);
  }
}

.session-draft-layout-editor {
  flex: 1 1 auto;
  display: block;
  width: 100%;
  max-width: 1850px;
  min-height: 0;
  height: auto;
  overflow: visible;
  margin: 0 auto;
}

.session-draft-layout-editor .session-layout-lab {
  width: min(100%, 1850px);
}

.session-draft-editor > turbo-cable-stream-source,
.session-draft-editor > template {
  display: none;
}

.session-draft-rail-layout {
  position: relative;
  min-height: 0;
  display: contents;
}

.session-draft-step-rail {
  grid-column: 1;
  grid-row: 1 / -1;
  height: 100%;
  min-height: 0;
  display: grid;
  align-items: center;
  background: transparent;
}

.session-draft-editor-grid {
  position: relative;
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  width: min(100%, 1900px);
  display: grid;
  grid-template-columns: minmax(30rem, 1fr) minmax(30rem, 39rem);
  gap: clamp(1rem, 3vh, 2.5rem) 1.25rem;
  align-items: start;
  align-content: center;
  min-height: 100%;
  overflow: auto;
  padding: 0 2.5rem 1.5rem;
}

.session-draft-editor-media,
.session-draft-match-list,
.session-draft-match-config,
.session-draft-player-grid,
.session-draft-selected-empty {
  min-width: 0;
}

.session-draft-editor-media,
.session-draft-match-list {
  padding-top: 0;
  padding-bottom: 0;
}

.session-draft-editor-media {
  grid-column: 1;
  align-self: start;
}

.session-draft-stepper {
  display: grid;
  justify-items: start;
  gap: 0.3rem;
  min-width: 9rem;
  margin-left: 2rem;
}

.session-draft-step {
  display: inline-grid;
  grid-template-columns: 1.55rem auto;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.35rem;
  padding: 0.34rem 0.75rem 0.34rem 0.45rem;
  border-radius: 999px;
  background: #181818;
  color: var(--app-shell-muted);
  text-decoration: none;
  transition: background 0.16s ease, color 0.16s ease;
}

.session-draft-step:not(a) {
  pointer-events: none;
}

.session-draft-step.is-locked {
  pointer-events: auto;
  cursor: help;
}

.session-draft-step-marker {
  width: 1.55rem;
  height: 1.55rem;
  display: grid;
  place-items: center;
  border: 1px solid #3a3a3a;
  border-radius: 999px;
  color: currentColor;
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1;
}

.session-draft-step-label {
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1;
  text-transform: capitalize;
}

.session-draft-step:hover,
.session-draft-step.is-current {
  background: #f2f2f2;
  color: #111111;
}

.session-draft-step.is-current .session-draft-step-label {
  color: currentColor;
}

.session-draft-step.is-reached .session-draft-step-marker {
  border-color: currentColor;
}

.session-draft-step.is-locked:not(.is-reached) .session-draft-step-marker {
  color: currentColor;
}

.session-draft-step.is-locked .session-draft-step-marker svg {
  width: 0.86rem;
  height: 0.86rem;
  display: block;
  fill: currentColor;
}

.session-draft-step.is-locked:not(.is-current):hover .session-draft-step-label {
  color: currentColor;
}

.session-draft-step.is-locked:not(.is-current) {
  color: #5f5f5f;
}

.session-draft-step.is-locked:not(.is-current):hover {
  background: #181818;
  color: #5f5f5f;
}

.session-draft-step-connector {
  position: relative;
  width: 2.55rem;
  height: 2.65rem;
}

.session-draft-step-connector::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0.15rem;
  bottom: 0.15rem;
  width: 0.16rem;
  translate: -50% 0;
  border-radius: 999px;
  background: #6d747d;
}

.session-draft-step-connector.is-locked::before {
  background: linear-gradient(
    to bottom,
    #6d747d 0,
    #6d747d calc(50% - 0.9rem),
    transparent calc(50% - 0.9rem),
    transparent calc(50% + 0.9rem),
    #6d747d calc(50% + 0.9rem),
    #6d747d 100%
  );
}

.session-draft-step-connector.is-before-current::before {
  background: #ffffff;
}

.session-draft-step-connector.is-locked.is-before-current::before {
  background: linear-gradient(
    to bottom,
    #ffffff 0,
    #ffffff calc(50% - 0.9rem),
    transparent calc(50% - 0.9rem),
    transparent calc(50% + 0.9rem),
    #ffffff calc(50% + 0.9rem),
    #ffffff 100%
  );
}

.session-draft-step-lock {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1rem;
  height: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  translate: -50% -50%;
  background: var(--app-shell-surface);
  color: #6d747d;
  z-index: 1;
}

.session-draft-step-lock svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.session-draft-editor-media-inner {
  display: grid;
  align-content: start;
  gap: 1rem;
}

.session-draft-player-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: clamp(22rem, 52vh, 42rem);
  max-height: 42rem;
  overflow: hidden;
  border: 1px solid var(--app-shell-border);
  border-radius: 16px;
  background: #000000;
}

.session-draft-player-frame iframe {
  width: 100%;
  height: 100%;
}

.session-draft-timeline-block {
  position: relative;
  grid-column: 1 / -1;
  grid-row: 2;
  z-index: 1;
  padding: 0.35rem clamp(1.25rem, 3vw, 2.5rem) 2.25rem;
  background: transparent;
}

.session-draft-timeline-block > * {
  pointer-events: auto;
}

.session-draft-timeline-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1550px) auto;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
}

.session-draft-timeline-time {
  color: var(--app-shell-muted);
  font: 0.82rem ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  white-space: nowrap;
}

.session-draft-events-side-labels {
  display: grid;
  grid-template-rows: auto auto auto;
  justify-items: center;
  gap: 0.34rem;
  max-width: 8rem;
}

.session-draft-events-side-name {
  max-width: 100%;
  overflow: hidden;
  color: var(--app-shell-muted);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-draft-events-time-actions {
  position: relative;
  display: grid;
  grid-template-rows: auto auto auto;
  justify-items: center;
  gap: 0.34rem;
  width: max-content;
}

.session-draft-events-add-row {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 0.36rem;
}

.session-draft-events-add-label {
  display: none;
  width: 0;
  overflow: hidden;
  color: var(--app-shell-muted);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-draft-events-add-button {
  width: 1.85rem;
  height: 1.85rem;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--app-shell-border);
  border-radius: 4px;
  background: var(--app-shell-surface-soft);
  color: var(--app-shell-text);
  font: inherit;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.session-draft-events-add-button svg {
  width: 1.05rem;
  height: 1.05rem;
  display: block;
  fill: currentColor;
}

.session-draft-events-add-button-attack {
  color: #ff3434;
}

.session-draft-events-add-button-scheme {
  color: #f5c84b;
}

.session-draft-events-add-button:hover {
  border-color: rgba(255, 255, 255, 0.46);
  background: var(--app-shell-surface-raised);
}

.session-draft-events-add-button:disabled,
.session-draft-events-add-button[aria-disabled="true"] {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.025);
  color: rgba(255, 255, 255, 0.24);
  cursor: not-allowed;
  opacity: 0.72;
}

.session-draft-events-add-button:disabled:hover,
.session-draft-events-add-button[aria-disabled="true"]:hover {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.025);
}

.session-draft-full-timeline {
  position: relative;
  min-height: clamp(6.4rem, 15vh, 7.8rem);
  display: grid;
  align-items: center;
  cursor: pointer;
}

.session-draft-timeline-track {
  position: relative;
  min-height: clamp(6rem, 14vh, 7.4rem);
  background: transparent;
}

.session-draft-playback-track {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 0.28rem;
  display: flex;
  overflow: hidden;
  translate: 0 -50%;
  border-radius: 999px;
  pointer-events: none;
  z-index: 0;
}

.session-draft-playback-segment {
  position: relative;
  height: 100%;
  min-width: 0;
  background: rgba(255, 255, 255, 0.16);
  opacity: 0.58;
  transition: opacity 0.18s ease, background-color 0.18s ease;
}

.session-show-editor .session-draft-playback-segment[data-phase-name="setup"],
.session-show-editor .session-draft-playback-segment[data-phase-name="breakdown"],
.session-draft-events .session-draft-playback-segment[data-phase-name="setup"],
.session-draft-events .session-draft-playback-segment[data-phase-name="breakdown"] {
  max-width: 100px;
}

.session-show-editor .session-draft-playback-segment[data-phase-name="gameplay"],
.session-draft-events .session-draft-playback-segment[data-phase-name="gameplay"] {
  flex-grow: 1;
}

.session-draft-playback-segment + .session-draft-playback-segment {
  box-shadow: inset 1px 0 0 rgba(5, 5, 5, 0.85);
}

.session-draft-playback-segment.is-active {
  opacity: 1;
  background: rgba(255, 255, 255, 0.2);
}

.session-draft-playback-segment.is-inactive .session-draft-playback-fill {
  width: 0 !important;
}

.session-draft-playback-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
}

.session-draft-playback-fill-loaded {
  background: rgba(255, 84, 84, 0.24);
}

.session-draft-playback-fill-played {
  background: linear-gradient(90deg, #ff4a4a 0%, #ff2323 100%);
}

.session-draft-match-segment.is-selected .session-draft-segment-phase-setup,
.session-draft-match-segment.is-selected .session-draft-segment-phase-breakdown {
  background: linear-gradient(90deg, rgba(124, 255, 79, 0.24), rgba(124, 255, 79, 0.44));
}

.session-draft-match-segment.is-selected .session-draft-segment-phase-game {
  background: linear-gradient(90deg, #62e944 0%, #9cff70 100%);
}

.session-draft-match-segment {
  position: absolute;
  height: 1.6rem;
  display: flex;
  align-items: center;
  overflow: hidden;
  translate: 0 -50%;
  padding: 0;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  z-index: 2;
  transition: top 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.session-draft-match-segment-top {
  top: 31%;
  background: transparent;
}

.session-draft-match-segment-bottom {
  top: 69%;
  background: transparent;
}

.session-draft-match-segment.is-selected {
  box-shadow: none;
}

.session-draft-segment-phase {
  height: 0.42rem;
  min-width: 0;
  pointer-events: none;
  transition: background-color 0.2s ease;
}

.session-draft-segment-phase:first-child {
  border-radius: 999px 0 0 999px;
}

.session-draft-segment-phase:last-child {
  border-radius: 0 999px 999px 0;
}

.session-draft-segment-phase-setup,
.session-draft-segment-phase-breakdown {
  background: #6f757d;
}

.session-draft-segment-phase-game {
  background: #9aa1aa;
}

.session-draft-timeline-cursor {
  position: absolute;
  top: 50%;
  width: 0.1rem;
  height: 1.15rem;
  translate: -50% -50%;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 0 0 2px rgba(255, 74, 74, 0.14);
  pointer-events: none;
  z-index: 4;
}

.session-draft-timeline-handle {
  position: absolute;
  top: 50%;
  width: 0.26rem;
  height: 1.25rem;
  translate: -50% -50%;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #d9dde3;
  cursor: ew-resize;
  z-index: 7;
}

.session-draft-timeline-track > .session-draft-timeline-handle {
  top: 50%;
}

.session-draft-timeline-track > .session-draft-timeline-handle-top {
  top: 31%;
}

.session-draft-timeline-track > .session-draft-timeline-handle-bottom {
  top: 69%;
}

.session-draft-timeline-handle-end {
  background: #ffffff;
}

.session-draft-timeline-handle:disabled {
  cursor: default;
  opacity: 0.6;
}

.session-draft-timeline-handle-inner {
  width: 0.18rem;
  height: 0.9rem;
  background: #ffeded;
  box-shadow: 0 0 0 2px rgba(255, 74, 74, 0.18);
  z-index: 6;
}

.session-draft-timeline-handle-game-end {
  background: #ffffff;
}

.session-draft-selected-time-label {
  position: absolute;
  top: 69%;
  translate: -50% 0;
  color: var(--app-shell-muted);
  font: 0.74rem ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  line-height: 1;
  pointer-events: none;
  white-space: nowrap;
  z-index: 4;
}

.session-draft-selected-time-label-start {
  translate: calc(-100% - 0.45rem) -50%;
}

.session-draft-selected-time-label-end {
  translate: 0.45rem -50%;
}

.session-draft-selected-time-label-inner {
  top: calc(69% + 0.62rem);
  translate: -50% 0;
}

.session-draft-phase-bracket {
  --session-draft-phase-bracket-color: rgba(124, 255, 79, 0.62);
  position: absolute;
  top: calc(69% + 1.65rem);
  min-width: 0;
  padding-top: 0.5rem;
  background: linear-gradient(var(--session-draft-phase-bracket-color), var(--session-draft-phase-bracket-color)) no-repeat calc(0.5rem + 0.5px) 0 / calc(100% - 1rem - 1px) 1px;
  color: var(--app-shell-muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
  pointer-events: none;
  white-space: nowrap;
  z-index: 4;
}

.session-draft-phase-bracket::before,
.session-draft-phase-bracket::after {
  content: "";
  position: absolute;
  top: -0.48rem;
  width: 0.5rem;
  height: 0.48rem;
  border-color: var(--session-draft-phase-bracket-color);
  border-style: solid;
  pointer-events: none;
}

.session-draft-phase-bracket-setup,
.session-draft-phase-bracket-breakdown {
  --session-draft-phase-bracket-color: rgba(255, 255, 255, 0.46);
}

.session-draft-phase-bracket::before {
  left: 0;
  border-width: 0 0 1px 1px;
  border-radius: 0 0 0 0.5rem;
}

.session-draft-phase-bracket::after {
  right: 0;
  border-width: 0 1px 1px 0;
  border-radius: 0 0 0.5rem;
}

.session-draft-match-list {
  grid-column: 2;
  display: grid;
  grid-template-rows: auto auto;
  align-self: start;
  box-sizing: border-box;
  align-content: start;
  gap: 0;
  min-height: 0;
}

.session-draft-extraction-panel {
  min-height: 2.6rem;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.5rem 0.65rem 0.45rem;
  border: 1px solid var(--app-shell-border);
  border-bottom: 0;
  border-radius: 0;
  border-style: dashed;
  background: rgba(255, 255, 255, 0.025);
  color: var(--app-shell-muted);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  box-sizing: border-box;
  cursor: default;
  user-select: none;
}

.session-draft-extraction-panel .button-spinner {
  width: 0.82rem;
  height: 0.82rem;
  margin-right: 0;
  border-width: 1.5px;
}

.session-draft-match-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  align-items: flex-end;
  gap: 0;
  min-width: 0;
  overflow: visible;
  padding: 0;
}

.session-draft-events-timeline-block .session-draft-timeline-row {
  grid-template-columns: auto minmax(0, 1550px) auto;
}

.session-layout-lab-title .session-draft-match-tabs {
  width: 100%;
  height: 100%;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  grid-template-columns: none;
  gap: 1.4rem;
}

.session-layout-lab-title .session-draft-match-tab-shell {
  position: relative;
  min-width: 0;
  height: 100%;
}

.session-layout-lab-title .session-draft-match-tab-shell > .session-draft-match-tab,
.session-layout-lab-title .session-draft-match-tab-add {
  width: 100%;
  height: 100%;
}

.session-draft-match-tab-remove {
  position: absolute;
  top: 50%;
  right: 0.45rem;
  z-index: 4;
  transform: translateY(-50%);
}

.session-draft-match-tab-remove img {
  width: 0.88rem;
  height: 0.88rem;
  opacity: 0.45;
  filter: brightness(0) invert(1);
  transition: opacity 0.12s ease, filter 0.12s ease;
}

.session-draft-match-tab-remove:hover img,
.session-draft-match-tab-remove:focus-visible img {
  opacity: 1;
  filter: invert(18%) sepia(97%) saturate(6200%) hue-rotate(357deg) brightness(112%) contrast(115%);
}

.session-draft-match-tab-shell .session-layout-match-content {
  padding-right: 2.6rem;
}

.session-draft-match-tab {
  min-width: 0;
  min-height: 2.6rem;
  display: grid;
  align-content: start;
  gap: 0.15rem;
  padding: 0.5rem 0.65rem 0.45rem;
  border: 0;
  border-bottom: 0;
  border-radius: 9px;
  background: #181818;
  color: var(--app-shell-muted);
  text-align: left;
  cursor: pointer;
}

.session-layout-lab-title .session-draft-match-tab {
  position: relative;
  min-height: 0;
  display: block;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: #181818;
  color: var(--app-shell-muted);
  text-align: left;
  overflow: hidden;
}

.session-layout-lab-title .session-draft-match-tab:hover,
.session-layout-lab-title .session-draft-match-tab.is-active,
.session-layout-lab-title .session-draft-match-tab.is-selected {
  background: #f2f2f2;
  color: #111111;
  box-shadow: none;
}

.session-layout-lab-title .session-draft-match-tab.is-selected {
  margin-bottom: 0;
}

.session-layout-lab-title .session-draft-match-tab .session-layout-match-line {
  display: none;
}

.session-layout-lab-title .session-draft-match-tab:hover .session-layout-match-line {
  background: transparent;
}

.session-layout-lab-title .session-draft-match-tab .session-layout-match-glow {
  display: none;
}

.session-layout-lab-title .session-draft-match-tab .session-layout-match-content {
  position: relative;
  z-index: 1;
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 0.2rem;
  height: 100%;
  padding: 0.75rem 0.85rem 0.5rem;
  color: inherit;
  text-decoration: none;
}

.session-layout-lab-title .session-draft-match-tab .session-layout-match-tab-title,
.session-layout-lab-title .session-draft-match-tab .session-layout-match-tab-players {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-layout-lab-title .session-draft-match-tab .session-layout-match-tab-title {
  color: currentColor;
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.25;
  transition: color 0.3s ease;
}

.session-layout-lab-title .session-draft-match-tab .session-layout-match-tab-players {
  color: currentColor;
  opacity: 0.72;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.25;
  transition: color 0.3s ease;
}

.session-layout-lab-title .session-draft-match-tab.is-selected .session-layout-match-tab-title {
  color: currentColor;
}

.session-layout-lab-title .session-draft-match-tab.is-selected .session-layout-match-tab-players {
  color: currentColor;
}

.session-draft-match-tab span,
.session-draft-match-tab small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-draft-match-tab span {
  color: inherit;
  font-weight: 700;
}

.session-draft-match-tab small {
  color: inherit;
  font-size: 0.75rem;
}

.session-draft-match-tab:hover,
.session-draft-match-tab.is-active {
  background: #f2f2f2;
  color: #111111;
}

.session-draft-match-tab.is-selected {
  position: relative;
  z-index: 2;
  margin-bottom: -1px;
  background: #f2f2f2;
  box-shadow: none;
  color: #111111;
}

.session-draft-match-tab-add {
  min-height: 2.6rem;
  place-items: center;
  align-content: center;
  border: 1px dashed #3f3f46;
  background: transparent;
  color: var(--app-shell-muted);
  font-size: 1.35rem;
  line-height: 1;
  text-align: center;
}

.session-draft-match-tab-add span {
  font-weight: 400;
}

.session-draft-match-tab-add:hover {
  border-color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.session-layout-lab-title .session-draft-match-tab-add {
  border: 0;
  background:
    repeating-linear-gradient(90deg, #3f3f46 0 0.7rem, transparent 0.7rem 1.25rem) top / 100% 2px no-repeat,
    repeating-linear-gradient(90deg, #3f3f46 0 0.7rem, transparent 0.7rem 1.25rem) bottom / 100% 2px no-repeat,
    repeating-linear-gradient(180deg, #3f3f46 0 0.7rem, transparent 0.7rem 1.25rem) left / 2px 100% no-repeat,
    repeating-linear-gradient(180deg, #3f3f46 0 0.7rem, transparent 0.7rem 1.25rem) right / 2px 100% no-repeat;
  color: #71717a;
}

.session-layout-lab-title .session-draft-match-tab-add:hover {
  background:
    repeating-linear-gradient(90deg, #ffffff 0 0.7rem, transparent 0.7rem 1.25rem) top / 100% 2px no-repeat,
    repeating-linear-gradient(90deg, #ffffff 0 0.7rem, transparent 0.7rem 1.25rem) bottom / 100% 2px no-repeat,
    repeating-linear-gradient(180deg, #ffffff 0 0.7rem, transparent 0.7rem 1.25rem) left / 2px 100% no-repeat,
    repeating-linear-gradient(180deg, #ffffff 0 0.7rem, transparent 0.7rem 1.25rem) right / 2px 100% no-repeat;
  color: #ffffff;
}

.session-layout-lab-title .session-draft-match-tab-add .session-layout-match-line {
  height: 0;
  border-top: 1px dashed #3f3f46;
  background: transparent;
}

.session-layout-lab-title .session-draft-match-tab-add:hover .session-layout-match-line {
  border-top-color: #ffffff;
  background: transparent;
}

.session-layout-lab-title .session-draft-match-tab-add .session-layout-match-content {
  place-items: center;
  text-align: center;
}

.session-layout-lab-title .session-draft-match-tab-add .session-layout-match-tab-title {
  font-size: 1.8rem;
  font-weight: 500;
}

.session-draft-match-warning {
  position: absolute;
  top: 0.45rem;
  right: 0.55rem;
  z-index: 5;
  width: 1rem;
  height: 1rem;
  display: grid;
  place-items: center;
}

.session-draft-match-tab-shell .session-draft-match-warning {
  right: 2.35rem;
}

.session-draft-match-warning img {
  width: 100%;
  height: 100%;
  display: block;
  filter: invert(82%) sepia(68%) saturate(515%) hue-rotate(351deg) brightness(103%) contrast(92%);
}

.session-draft-layout-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.1rem;
  align-items: center;
  margin-bottom: 1rem;
  padding: 0 0 1rem;
  border-bottom: 1px solid var(--app-shell-border);
}

.session-draft-layout-steps-top {
  display: none;
}

.session-draft-layout-step {
  position: relative;
  min-width: 0;
  min-height: 2.35rem;
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #181818;
  color: var(--app-shell-muted);
  text-decoration: none;
  overflow: visible;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.session-draft-layout-step:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 100%;
  top: 50%;
  width: 1.1rem;
  height: 1px;
  background: var(--app-shell-border);
  transform: translateY(-50%);
}

.session-draft-layout-step .session-layout-match-line {
  display: none;
}

.session-draft-layout-step:hover,
.session-draft-layout-step.is-selected {
  background: #f2f2f2;
  color: #111111;
}

.session-draft-layout-step.is-locked {
  cursor: default;
}

.session-draft-layout-step.is-locked:not(.is-selected):hover {
  background: #181818;
  color: #5f5f5f;
}

.session-draft-layout-step .session-layout-match-content {
  min-width: 0;
  height: 100%;
  display: grid;
  align-content: center;
  gap: 0.05rem;
  padding: 0.42rem 1.75rem 0.42rem 0.82rem;
}

.session-draft-layout-step .session-layout-match-tab-title,
.session-draft-layout-step .session-layout-match-tab-players {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-draft-layout-step .session-layout-match-tab-title {
  color: currentColor;
  font-size: 0.74rem;
  font-weight: 800;
}

.session-draft-layout-step .session-layout-match-tab-players {
  color: currentColor;
  opacity: 0.72;
  font-size: 0.64rem;
  font-weight: 700;
}

.session-draft-layout-step.is-locked .session-layout-match-tab-title {
  color: currentColor;
}

.session-draft-layout-step.is-locked .session-layout-match-tab-players {
  color: currentColor;
}

.session-draft-layout-step.is-selected .session-layout-match-tab-title {
  color: currentColor;
}

.session-draft-layout-step.is-selected .session-layout-match-tab-players {
  color: currentColor;
}

.session-draft-layout-step-lock {
  position: absolute;
  top: 50%;
  right: 0.45rem;
  width: 0.8rem;
  height: 0.8rem;
  color: currentColor;
  transform: translateY(-50%);
}

.session-draft-layout-step-lock svg {
  width: 100%;
  height: 100%;
  display: block;
  fill: currentColor;
}

.session-draft-selected-empty {
  display: grid;
  place-items: center;
  min-height: 12rem;
  padding: 1rem;
  border: 1px solid var(--app-shell-border);
  border-radius: 0 0 8px 8px;
  background: var(--app-shell-surface-soft);
  color: var(--app-shell-muted);
  font-weight: 700;
}

.session-draft-match-config {
  display: grid;
  align-content: start;
  gap: 1.1rem;
  padding: 1rem;
  border: 1px solid var(--app-shell-border);
  border-radius: 0 0 8px 8px;
  background: var(--app-shell-surface-soft);
}

.session-draft-match-config:not([hidden]) {
  border-color: #7cff4f;
  box-shadow: 0 0 0 1px rgba(124, 255, 79, 0.24);
}

.session-draft-match-config[hidden],
.session-draft-selected-empty[hidden] {
  display: none;
}

.session-draft-match-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(8rem, 12rem);
  gap: 0.8rem;
}

.session-draft-match-config-actions {
  display: flex;
  justify-content: flex-end;
}

.session-draft-events .session-draft-match-list {
  grid-template-rows: auto auto auto;
  align-self: start;
}

.session-draft-events .session-draft-match-config {
  gap: 0;
  padding: 0.85rem;
}

.session-draft-layout-lab .session-draft-editor-media {
  grid-column: auto;
  align-self: stretch;
}

.session-draft-layout-lab .session-draft-player-frame {
  width: 100%;
  height: 100%;
  max-height: none;
  display: block;
  border: 0;
  border-radius: 0;
}

.session-draft-layout-lab .session-draft-player-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.session-draft-layout-lab .session-draft-match-list {
  grid-column: auto;
  width: 100%;
  height: 100%;
  display: grid;
  align-content: start;
  gap: 1rem;
  padding: clamp(0.75rem, 2vw, 1.5rem);
  overflow: auto;
}

.session-draft-layout-lab .session-draft-match-config,
.session-draft-layout-lab .session-draft-selected-empty {
  align-self: center;
}

.session-draft-layout-lab .session-draft-selected-empty,
.session-draft-layout-lab .session-draft-match-config {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.session-draft-layout-lab .session-draft-selected-empty {
  min-height: 100%;
}

.session-draft-layout-lab .session-draft-match-config {
  padding: 0;
}

.session-draft-layout-lab .session-draft-match-config:not([hidden]) {
  border-color: transparent;
  box-shadow: none;
}

.session-draft-layout-lab .session-draft-match-fields {
  grid-template-columns: minmax(0, 1fr) minmax(8rem, 12rem);
}

.session-draft-layout-lab .session-draft-player-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.session-draft-player-editor-card {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 0.55rem;
}

.session-draft-player-editor-card .form-group {
  margin-bottom: 0;
}

.session-draft-player-hero {
  width: min(100%, 12rem);
  justify-self: center;
  display: grid;
  gap: 0.45rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--app-shell-muted);
  cursor: pointer;
}

.session-draft-player-hero-image {
  --hero-card-radius-x: 5.59%;
  --hero-card-radius-y: 4%;
  position: relative;
  width: 100%;
  aspect-ratio: 5 / 7;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 2px dashed transparent;
  border-radius: var(--hero-card-radius-x) / var(--hero-card-radius-y);
  background: #1a1a1a;
}

.session-draft-player-hero:hover .session-draft-player-hero-image,
.session-draft-player-hero:focus-visible .session-draft-player-hero-image {
  border-color: #71717a;
  border-style: dashed;
  outline: 3px dashed rgba(113, 113, 122, 0.42);
  outline-offset: 5px;
}

.session-draft-player-hero-image > img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.session-draft-player-hero-placeholder,
.session-draft-hero-placeholder {
  width: 42%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  color: #0a0a0a;
}

.session-draft-player-hero-placeholder img,
.session-draft-hero-placeholder svg {
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0.7;
}

.session-draft-player-hero-name {
  overflow: hidden;
  color: var(--app-shell-muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-draft-player-winner {
  justify-self: center;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  padding: 0 0.8rem;
  border: 1px solid var(--app-shell-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--app-shell-muted);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}

.session-draft-player-winner input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.session-draft-player-winner:has(input:checked) {
  border-color: #7cff4f;
  background: rgba(124, 255, 79, 0.14);
  color: #d9ffd0;
}

.session-draft-player-winner:has(input:focus-visible) {
  outline: 2px solid rgba(124, 255, 79, 0.42);
  outline-offset: 2px;
}

.session-draft-player-winner:has(input:disabled) {
  cursor: not-allowed;
  opacity: 0.68;
}

.session-draft-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 78;
  border: 0;
  background: rgba(0, 0, 0, 0.48);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.session-draft-drawer-backdrop.is-open {
  opacity: 1;
}

.session-draft-hero-drawer {
  position: fixed;
  top: calc(var(--logged-in-header-height, 4.5rem) + 1rem);
  right: 0;
  bottom: 1rem;
  z-index: 79;
  width: min(28rem, 100vw);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 1rem;
  padding: 1rem;
  overflow: auto;
  border: 1px solid var(--app-shell-border);
  border-right: 0;
  border-radius: 22px 0 0 22px;
  background: rgba(12, 12, 12, 0.96);
  box-shadow: -0.8rem 0 2.2rem rgba(0, 0, 0, 0.34);
  opacity: 0;
  transform: translateX(100%);
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.session-draft-hero-drawer.is-open {
  opacity: 1;
  transform: translateX(0);
}

.session-draft-drawer-backdrop[hidden],
.session-draft-hero-drawer[hidden] {
  display: none;
}

.session-draft-hero-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.session-draft-hero-drawer-header h2,
.session-draft-hero-drawer-header p {
  margin: 0;
}

.session-draft-hero-drawer-header p {
  margin-top: 0.2rem;
  color: var(--app-shell-muted);
  font-size: 0.78rem;
}

.session-draft-drawer-close {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--app-shell-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.session-draft-drawer-close:hover {
  color: #ffffff;
}

.session-draft-hero-search input {
  width: 100%;
  height: 2.45rem;
  border: 1px solid var(--app-shell-border);
  border-radius: 8px;
  background: var(--app-shell-surface-soft);
  color: var(--app-shell-text);
  padding: 0 0.75rem;
  font: inherit;
}

.session-draft-hero-search input:focus {
  border-color: rgba(124, 255, 79, 0.6);
  outline: none;
  box-shadow: 0 0 0 2px rgba(124, 255, 79, 0.18);
}

.session-draft-hero-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: start;
  gap: 0.8rem;
  overflow: auto;
  padding-right: 0.25rem;
}

.session-draft-hero-option {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 0.4rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--app-shell-muted);
  font-size: 0.7rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.session-draft-hero-option[hidden] {
  display: none;
}

.session-draft-hero-option-image {
  aspect-ratio: 5 / 7;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px dashed transparent;
  background: #1a1a1a;
}

.session-draft-hero-option:hover .session-draft-hero-option-image,
.session-draft-hero-option:focus-visible .session-draft-hero-option-image {
  border-color: #ffffff;
}

.session-draft-hero-option-image > img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.session-draft-layout-lab .session-draft-timeline-block {
  grid-area: timeline;
  width: 100%;
  height: 100%;
  display: grid;
  align-items: center;
  padding: 0.75rem clamp(1rem, 3vw, 2rem);
}

.session-draft-layout-lab .session-draft-timeline-row {
  width: 100%;
}

.session-draft-layout-lab .session-draft-full-timeline,
.session-draft-layout-lab .session-draft-events-timeline {
  min-width: 0;
}

.session-draft-layout-lab .session-draft-events-summary {
  display: none;
  align-self: start;
}

.session-draft-layout-lab .session-draft-events-detail-card {
  min-height: 100%;
  border: 0;
  background: transparent;
  padding: 0;
}

.session-draft-layout-lab .session-draft-events-timeline {
  min-height: 6.4rem;
}

.session-draft-layout-lab .session-draft-events-timeline-track {
  min-height: 6rem;
}

@media (max-width: 1450px) {
  .session-draft-layout-editor > .session-draft-layout-steps-top {
    display: block;
    width: min(100%, 1850px);
    margin: 0.75rem auto 0.75rem;
    padding-inline: clamp(0.75rem, 2vw, 1.5rem);
    box-sizing: border-box;
  }

  .session-draft-layout-editor > .session-draft-layout-steps-top .session-draft-layout-steps {
    margin-bottom: 0;
  }

  .session-draft-layout-lab .session-draft-match-list > .session-draft-layout-steps {
    display: none;
  }

  .session-layout-lab {
    grid-template-columns: minmax(0, 1fr);
    height: auto;
    min-height: 0;
    max-height: none;
    grid-template-rows: auto var(--session-layout-timeline-height) minmax(16rem, auto);
    grid-template-areas:
      "media"
      "timeline"
      "info";
  }

  .session-layout-lab-media {
    max-width: none;
    justify-self: start;
  }

  .session-layout-lab-info {
    width: auto;
    box-sizing: border-box;
    justify-self: stretch;
  }
}

@media (min-width: 1451px) and (max-height: 850px) {
  .session-layout-lab {
    --session-layout-media-max: 980px;
  }
}

@media (min-width: 1451px) and (max-height: 760px) {
  .session-layout-lab {
    --session-layout-media-max: 860px;
  }
}

@media (min-width: 1451px) and (max-height: 680px) {
  .session-layout-lab {
    --session-layout-media-max: 760px;
  }
}

@media (max-width: 640px) {
  .logged-in-main:has(.session-layout-lab) {
    padding: 0 0 1.5rem;
    overflow-x: hidden;
  }

  .session-layout-lab {
    width: 100%;
    height: auto;
    min-height: 0;
  }

  .session-layout-lab-video {
    width: 100%;
    margin-left: 0;
  }

  .session-layout-lab-title,
  .session-layout-lab-timeline,
  .session-layout-lab-info {
    margin-inline: var(--session-layout-page-gutter);
  }

  .session-layout-lab-title .session-draft-match-tabs {
    gap: 0.75rem;
  }

  .session-draft-layout-lab .session-draft-player-grid,
  .session-draft-layout-lab .session-draft-match-fields,
  .session-draft-events-player-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 960px) {
  .hero-show-page {
    margin-top: -1.5rem;
  }
}

@media (max-width: 700px) {
  .cards-index-page {
    min-height: calc(100vh - 6rem);
    align-content: start;
  }

  .cards-search-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .cards-search-tooltip .settings-tooltip-text {
    top: calc(100% + 0.45rem);
    right: 0;
    bottom: auto;
    left: auto;
    transform: translateY(0.25rem);
  }

  .cards-search-tooltip:hover .settings-tooltip-text,
  .cards-search-tooltip:focus-within .settings-tooltip-text {
    transform: translateY(0);
  }

  .cards-hand-fan {
    min-height: 16rem;
    padding: 0.5rem 0 1rem;
  }

  .cards-hand-card {
    width: min(8.5rem, 31vw);
  }

  .cards-hand-card-0 {
    --hand-x: 3.7rem;
    --hand-y: 1.35rem;
  }

  .cards-hand-card-1 {
    --hand-x: 1.85rem;
    --hand-y: 0.48rem;
  }

  .cards-hand-card-3 {
    --hand-x: -1.85rem;
    --hand-y: 0.48rem;
  }

  .cards-hand-card-4 {
    --hand-x: -3.7rem;
    --hand-y: 1.35rem;
  }

  .cards-results-grid {
    --hero-card-grid-min: min(10rem, calc((100% - 1.2rem) / 2));
  }

  .hero-index-gallery,
  .hero-show-card-grid {
    --hero-card-grid-min: min(10rem, calc((100% - 1.2rem) / 2));
  }

  .hero-show-deck-card .hero-catalog-card-flip-button {
    display: none;
  }
}

@media (max-width: 600px) {
  .hero-show-page {
    --hero-mobile-gutter: 1rem;
    gap: 2rem;
    margin-top: -1rem;
  }

  .hero-show-banner-art {
    right: 0;
    -webkit-mask-image:
      linear-gradient(
        to right,
        transparent 0%,
        rgba(0, 0, 0, 0.12) 12%,
        rgba(0, 0, 0, 0.38) 29%,
        rgba(0, 0, 0, 0.72) 48%,
        #000 64%,
        #000 100%
      ),
      linear-gradient(
        145deg,
        transparent 0%,
        rgba(0, 0, 0, 0.18) 9%,
        rgba(0, 0, 0, 0.62) 19%,
        #000 31%,
        #000 100%
      );
    mask-image:
      linear-gradient(
        to right,
        transparent 0%,
        rgba(0, 0, 0, 0.12) 12%,
        rgba(0, 0, 0, 0.38) 29%,
        rgba(0, 0, 0, 0.72) 48%,
        #000 64%,
        #000 100%
      ),
      linear-gradient(
        145deg,
        transparent 0%,
        rgba(0, 0, 0, 0.18) 9%,
        rgba(0, 0, 0, 0.62) 19%,
        #000 31%,
        #000 100%
      );
  }

  .hero-show-profile-layout {
    padding-inline: 0;
  }

  .hero-variant-selector {
    position: relative;
    right: auto;
    bottom: auto;
    justify-self: end;
    margin-top: 0.75rem;
  }

  .hero-variant-option {
    padding-inline: 0.55rem;
    font-size: 0.65rem;
  }

  .hero-show-profile:has(.hero-variant-selector) {
    display: grid;
    padding-bottom: 0.75rem;
  }

  .hero-show-profile:has(.hero-variant-selector) .hero-show-information {
    padding-right: clamp(1rem, 3vw, 2.75rem);
  }

  .hero-show-banner {
    width: calc(100% + (var(--hero-mobile-gutter) * 2));
    margin-inline: calc(var(--hero-mobile-gutter) * -1);
  }

  .hero-show-character-card {
    width: min(74vw, 17rem);
  }

  .hero-show-information {
    grid-template-columns: 1fr;
  }

  .hero-show-info-heading {
    display: grid;
    grid-template-columns: minmax(0, 10.5rem) auto;
    align-items: center;
  }

  .hero-show-info-heading .hero-health-pennant {
    width: 3.25rem;
    min-height: 5.4rem;
  }

  .hero-show-info-heading .hero-combat-title {
    width: min(100%, 10.5rem);
  }

  .hero-sidekick-tokens {
    justify-content: center;
  }
}

.session-draft-events .session-draft-editor-grid,
.session-show-editor-grid {
  overflow: visible;
}

.session-draft-events-player-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  min-width: 0;
}

.session-draft-events-player {
  min-width: 0;
  min-height: 3.25rem;
  display: grid;
  align-content: center;
  gap: 0.2rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--app-shell-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.session-draft-events-player span,
.session-draft-events-player small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-draft-events-player span {
  color: var(--app-shell-text);
  font-weight: 700;
}

.session-draft-events-player small {
  color: var(--app-shell-muted);
}

.session-draft-events-player-empty {
  grid-column: 1 / -1;
  color: var(--app-shell-muted);
  font-size: 0.9rem;
}

.session-draft-events-timeline {
  position: relative;
  min-height: clamp(6.4rem, 15vh, 7.8rem);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

.session-draft-events-timeline-track {
  position: relative;
  min-height: clamp(6rem, 14vh, 7.4rem);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

.session-draft-events-timeline *,
.session-draft-events-timeline *::before,
.session-draft-events-timeline *::after {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

.session-draft-events-timeline ::selection {
  background: transparent;
}

.session-draft-events-timeline-track .youtube-player-marker-rail {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 4.1rem;
  translate: 0 -50%;
}

.session-draft-events-timeline-track .youtube-player-marker {
  z-index: 5;
  width: 2.05rem;
  height: 2.12rem;
  top: auto;
  bottom: auto;
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  pointer-events: none;
  touch-action: none;
}

.session-draft-events-timeline-track .youtube-player-marker:focus,
.session-draft-events-timeline-track .youtube-player-marker:focus-visible {
  outline: none;
  box-shadow: none;
}

.session-draft-events-timeline-track .youtube-player-marker::-moz-focus-inner {
  border: 0;
  padding: 0;
}

.session-draft-events-timeline-track .youtube-player-marker-top {
  bottom: 50%;
}

.session-draft-events-timeline-track .youtube-player-marker-bottom {
  top: 50%;
}

.session-draft-events-timeline-track .youtube-player-marker-line {
  height: 0.42rem;
}

.session-draft-events-timeline-track .youtube-player-marker-top .youtube-player-marker-line {
  top: auto;
  bottom: 0;
  translate: -50% 0;
}

.session-draft-events-timeline-track .youtube-player-marker-bottom .youtube-player-marker-line {
  top: 0;
  bottom: auto;
  translate: -50% 0;
}

.session-draft-events-timeline-track .youtube-player-marker.is-selected {
  filter: none;
}

.session-draft-events-timeline-track .youtube-player-marker.is-dragging {
  cursor: grabbing;
}

.session-draft-events-timeline-track .youtube-player-marker.is-selected .youtube-player-marker-label {
  --marker-border: rgba(124, 255, 79, 0.9);
  filter: drop-shadow(0 0 0.18rem rgba(124, 255, 79, 0.22)) drop-shadow(0 0.45rem 1rem rgba(0, 0, 0, 0.38));
}

.session-draft-events-timeline-track .youtube-player-marker:hover .youtube-player-marker-label {
  --marker-bg: #222222;
  --marker-border: rgba(255, 255, 255, 0.46);
  transform: translateY(-1px);
  filter: drop-shadow(0 0.3rem 0.75rem rgba(0, 0, 0, 0.28));
}

.session-draft-events-timeline-track .youtube-player-marker.is-selected:hover .youtube-player-marker-label {
  --marker-border: rgba(124, 255, 79, 0.9);
  filter: drop-shadow(0 0 0.18rem rgba(124, 255, 79, 0.22)) drop-shadow(0 0.45rem 1rem rgba(0, 0, 0, 0.38));
}

.session-draft-events-timeline-track .youtube-player-marker-pending {
  color: #ffffff;
}

.session-draft-events-timeline-track .youtube-player-marker-pending .youtube-player-marker-label,
.session-draft-events-timeline-track .youtube-player-marker-pending.is-selected .youtube-player-marker-label,
.session-draft-events-timeline-track .youtube-player-marker-pending:hover .youtube-player-marker-label {
  --marker-bg: #151515;
  --marker-border: rgba(255, 68, 68, 0.95);
  filter: drop-shadow(0 0 0.2rem rgba(255, 68, 68, 0.26)) drop-shadow(0 0.45rem 1rem rgba(0, 0, 0, 0.38));
}

.youtube-player-marker-question {
  font-size: 0.8rem;
  font-weight: 900;
  line-height: 1;
}

.session-draft-events-timeline-track .youtube-player-marker-top .youtube-player-marker-label {
  translate: 0 calc(var(--marker-default-offset-index, 0) * -0.7rem);
}

.session-draft-events-timeline-track .youtube-player-marker-bottom .youtube-player-marker-label {
  translate: 0 calc(var(--marker-default-offset-index, 0) * 0.7rem);
}

.session-draft-events-detail-card {
  display: grid;
  align-content: stretch;
  gap: 0.75rem;
  padding: 0.9rem;
  border: 1px solid var(--app-shell-border);
  border-radius: 16px;
  background: var(--app-shell-surface-soft);
}

.session-draft-quick-add-drawer {
  position: fixed;
  right: 0;
  top: calc(var(--logged-in-header-height, 4.5rem) + 1rem);
  bottom: 1rem;
  z-index: 79;
  width: min(24rem, calc(100vw - 2rem));
  display: grid;
  align-content: start;
  gap: 1rem;
  padding: 1rem;
  overflow: auto;
  border: 1px solid var(--app-shell-border);
  border-right: 0;
  border-radius: 22px 0 0 22px;
  background: rgba(12, 12, 12, 0.96);
  box-shadow: -0.8rem 0 2.2rem rgba(0, 0, 0, 0.34);
  opacity: 0;
  pointer-events: none;
  transform: translateX(105%);
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.session-draft-quick-add-drawer.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.session-draft-quick-add-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
}

.session-draft-quick-add-title {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.7rem;
}

.session-draft-quick-add-kind {
  width: 1.65rem;
  height: 1.65rem;
  display: grid;
  place-items: center;
}

.session-draft-quick-add-kind-icon {
  width: 1.35rem;
  height: 1.35rem;
  display: block;
  color: inherit;
  background: currentColor;
  mask: var(--quick-add-kind-icon) center / contain no-repeat;
  -webkit-mask: var(--quick-add-kind-icon) center / contain no-repeat;
}

.session-draft-quick-add-header .session-draft-quick-add-kind-icon {
  color: inherit;
}

.session-draft-quick-add-header .session-draft-quick-add-kind-attack {
  --quick-add-kind-icon: url("/icons/attack.svg");
  color: #ff3434;
}

.session-draft-quick-add-header .session-draft-quick-add-kind-scheme {
  --quick-add-kind-icon: url("/icons/scheme.svg");
  color: #f5c84b;
}

.session-draft-quick-add-header .session-draft-quick-add-kind-defence {
  --quick-add-kind-icon: url("/icons/defence.svg");
  color: #4da3ff;
}

.session-draft-quick-add-title div,
.session-draft-quick-add-subtitle {
  display: grid;
  gap: 0.22rem;
}

.session-draft-quick-add-header span {
  color: var(--app-shell-muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.session-draft-quick-add-header small,
.session-draft-quick-add-status,
.session-draft-quick-add-empty {
  color: var(--app-shell-muted);
}

.session-draft-quick-add-subtitle {
  grid-column: 1 / -1;
}

.session-draft-quick-add-player {
  display: grid;
  gap: 0.35rem;
}

.session-draft-quick-add-player select {
  width: 100%;
  min-height: 2.35rem;
  padding: 0 0.7rem;
  border: 1px solid var(--app-shell-border);
  border-radius: 8px;
  background: #151515;
  color: var(--app-shell-text);
  font: inherit;
}

.session-draft-quick-add-close {
  width: 2rem;
  height: 2rem;
  grid-column: 2;
  grid-row: 1;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--app-shell-border);
  border-radius: 999px;
  background: var(--app-shell-surface-soft);
  color: var(--app-shell-text);
  cursor: pointer;
}

.session-draft-quick-add-close:hover {
  border-color: rgba(255, 255, 255, 0.42);
  background: var(--app-shell-surface-raised);
}

.session-draft-quick-add-close:disabled {
  cursor: progress;
  opacity: 0.55;
}

.session-draft-quick-add-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 0.7rem;
}

.session-draft-quick-add-card {
  --hero-card-radius-x: 5.59%;
  --hero-card-radius-y: 4%;
  min-width: 0;
  width: 100%;
  display: grid;
  gap: 0.45rem;
  padding: 0;
  border: 1px solid var(--app-shell-border);
  border-radius: var(--hero-card-radius-x) / var(--hero-card-radius-y);
  background: var(--app-shell-surface-soft);
  color: var(--app-shell-text);
  text-align: center;
  cursor: pointer;
  overflow: hidden;
}

.session-draft-quick-add-card:hover {
  border-color: rgba(255, 255, 255, 0.42);
  background: var(--app-shell-surface-raised);
}

.session-draft-quick-add-card:disabled {
  cursor: progress;
  opacity: 0.65;
}

.session-draft-quick-add-card-image {
  aspect-ratio: 5 / 7;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: inherit;
  background: #101010;
}

.session-draft-events-detail-panel {
  min-height: 100%;
  display: grid;
  align-items: center;
}

.session-draft-quick-add-card-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.session-draft-quick-add-card-placeholder {
  width: 100%;
  height: 100%;
  display: block;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 44%),
    var(--app-shell-surface-raised);
}

.session-draft-quick-add-card-title {
  min-height: 2.4rem;
  display: grid;
  align-items: start;
  padding: 0 0.42rem 0.5rem;
  overflow-wrap: anywhere;
  color: var(--app-shell-text);
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.2;
}

.session-draft-quick-add-error {
  margin: 0;
  padding: 0.7rem 0.8rem;
  border: 1px solid rgba(255, 68, 68, 0.36);
  border-radius: 14px;
  background: rgba(255, 68, 68, 0.1);
  color: #ff8a8a;
  font-size: 0.86rem;
}

.session-draft-editor.session-draft-save {
  display: block;
  width: 100%;
  height: auto;
  min-height: calc(100vh - 4rem);
  overflow: auto;
}

.session-draft-save-content {
  --session-draft-save-gap: 1rem;
  justify-self: center;
  width: min(100%, 1900px);
  min-height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  justify-items: center;
  gap: 1rem;
  overflow: auto;
  padding: clamp(1rem, 4vh, 3rem) 2.5rem 1.75rem;
}

.session-draft-save-content > .session-draft-layout-steps {
  width: min(100%, var(--session-draft-save-occupied-width));
}

.session-draft-save-banners {
  width: min(100%, var(--session-draft-save-occupied-width));
  max-width: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(var(--matchup-count), minmax(0, 1fr));
  gap: var(--session-draft-save-gap);
  align-items: stretch;
  justify-content: center;
}

.session-draft-save-banner {
  width: 100%;
  max-width: 550px;
  justify-self: center;
  min-height: min(32rem, calc(100vh - 17rem));
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--app-shell-border);
  border-radius: 18px;
  background: linear-gradient(180deg, #1c1c1c 0%, #0d0d0d 100%);
}

.session-draft-save-banner-main {
  display: grid;
  align-content: start;
  gap: 0.75rem;
}

.session-draft-save-kicker {
  color: var(--app-shell-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.session-draft-save-banner h2 {
  color: var(--app-shell-text);
  font-size: clamp(1.25rem, 2vw, 2rem);
  line-height: 1.05;
}

.session-draft-save-total {
  align-self: end;
  color: var(--app-shell-text);
  font-size: 0.95rem;
  font-weight: 700;
}

.session-draft-save-stats {
  display: grid;
  gap: 0.4rem;
  margin: 0;
}

.session-draft-save-stats div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--app-shell-border);
}

.session-draft-save-stats dt {
  color: var(--app-shell-muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.session-draft-save-stats dd {
  margin: 0;
  color: var(--app-shell-text);
  font-size: 1.1rem;
  font-weight: 800;
}

.session-draft-verification-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  padding: 0.25rem;
  border: 1px solid var(--app-shell-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
}

.session-draft-verification-option {
  min-height: 2.2rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--app-shell-muted);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: lowercase;
  cursor: pointer;
}

.session-draft-verification-option.is-selected {
  background: #f2f2f2;
  color: #111111;
}

.session-draft-verification-option:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

.session-draft-save-actions {
  width: min(100%, var(--session-draft-save-occupied-width));
  max-width: 100%;
  justify-self: center;
  display: flex;
  justify-content: flex-end;
}

.session-draft-publish-button {
  min-width: 9rem;
}

.session-draft-events-detail-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
}

.session-draft-events-detail-header h2,
.session-draft-events-empty-panel h3 {
  margin: 0;
  color: var(--app-shell-text);
}

.session-draft-events-empty-panel {
  align-self: center;
  justify-items: center;
  display: grid;
  gap: 0.65rem;
  padding: 0.65rem 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: center;
}

.session-draft-events-empty-icon {
  width: 3.4rem;
  height: 3.4rem;
  display: grid;
  place-items: center;
  background: #71717a;
  opacity: 0.72;
  -webkit-mask: url("/icons/brand.svg") center / contain no-repeat;
  mask: url("/icons/brand.svg") center / contain no-repeat;
}

.session-draft-events-empty-icon img {
  display: none;
}

.session-draft-events-empty-panel form {
  margin-top: 0.25rem;
}

.session-draft-auto-extract-control {
  display: grid;
  justify-items: center;
  gap: 0.45rem;
  margin-top: 0.2rem;
}

.session-draft-auto-extract-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border-color: var(--app-shell-border);
  background: var(--app-shell-surface-soft);
  color: var(--app-shell-text);
}

.session-draft-auto-extract-button:disabled {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.045);
  color: rgba(255, 255, 255, 0.46);
}

.session-draft-event-inline-form {
  width: 100%;
  max-width: none;
  gap: 0.75rem;
  padding: 0;
  border: 0;
  background: transparent;
}

.session-draft-event-inline-form .form-group {
  min-width: 0;
  margin-bottom: 0;
}

.session-draft-event-inline-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.session-draft-event-combat-values {
  justify-items: center;
}

.session-draft-event-combat-values .form-group {
  width: min(100%, 12rem);
}

.session-draft-event-combat-participants {
  grid-template-columns: minmax(0, 1fr) 2.35rem minmax(0, 1fr);
  align-items: end;
}

.session-draft-combat-swap-button {
  width: 2.35rem;
  height: 2.35rem;
  align-self: end;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--app-shell-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--app-shell-text);
  cursor: pointer;
}

.session-draft-combat-swap-button:hover,
.session-draft-combat-swap-button:focus-visible {
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.08);
}

.session-draft-combat-swap-button span {
  width: 1rem;
  height: 1rem;
  background: currentColor;
  -webkit-mask: url("/icons/left-right-solid-full.svg") center / contain no-repeat;
  mask: url("/icons/left-right-solid-full.svg") center / contain no-repeat;
}

.session-draft-selected-event-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
}

.session-draft-selected-event-header h3 {
  margin: 0;
  color: var(--app-shell-text);
  font-size: 0.98rem;
  line-height: 1.2;
}

.session-draft-selected-event-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.session-draft-selected-event-meta span {
  display: grid;
  gap: 0.2rem;
  padding: 0.65rem;
  border: 1px solid var(--app-shell-border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--app-shell-text);
}

.session-draft-selected-event-meta strong {
  color: var(--app-shell-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.session-draft-event-delete-button {
  width: 2.35rem;
  height: 2.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(216, 77, 87, 0.45);
  border-radius: 999px;
  background: rgba(216, 77, 87, 0.08);
  color: var(--app-shell-danger);
  cursor: pointer;
}

.session-draft-event-delete-button:hover {
  background: rgba(216, 77, 87, 0.16);
  border-color: rgba(216, 77, 87, 0.7);
}

.session-draft-event-delete-button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.session-draft-event-delete-button span {
  width: 1rem;
  height: 1rem;
  display: block;
  background: currentColor;
  mask: url("/icons/trash.svg") center / contain no-repeat;
  -webkit-mask: url("/icons/trash.svg") center / contain no-repeat;
}

.session-draft-secondary-events-toggle {
  margin: 0.15rem 0 0.35rem;
}

.session-draft-event-card-field {
  display: grid;
  justify-items: center;
  gap: 0.45rem;
}

.session-draft-event-card-field .form-label {
  width: min(100%, 12rem);
  color: var(--app-shell-muted);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
}

.session-draft-event-card-picker {
  width: min(100%, 12rem);
}

.session-draft-event-card-picker:hover,
.session-draft-event-card-picker:focus-visible {
  background: transparent;
}

.session-draft-event-card-picker:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.session-draft-event-card-picker-image {
  width: 100%;
}

.session-draft-event-card-picker-placeholder {
  color: var(--app-shell-muted);
  font-size: 2.2rem;
  font-weight: 600;
  line-height: 1;
}

.session-draft-event-card-choice.is-selected {
  border-color: #7cff4f;
  box-shadow: 0 0 0 1px rgba(124, 255, 79, 0.25);
}

.session-draft-event-card-empty-choice {
  color: var(--app-shell-muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.session-draft-events-timeline {
  display: grid;
  align-items: center;
  cursor: pointer;
}

.session-draft-match-fields input,
.session-draft-match-fields select {
  width: 100%;
  height: 2.45rem;
  border: 1px solid var(--app-shell-border);
  border-radius: 8px;
  background: var(--app-shell-surface-soft);
  color: var(--app-shell-text);
  padding: 0 0.75rem;
}

.session-draft-player-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  align-content: start;
  min-width: 0;
  margin-top: 0.15rem;
}

.session-draft-player-slot {
  width: 100%;
  min-width: 0;
  min-height: 4.2rem;
  display: grid;
  align-content: center;
  gap: 0.25rem;
  padding: 0.75rem;
  border: 1px solid var(--app-shell-border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--app-shell-text);
  cursor: pointer;
}

.session-draft-player-slot span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-draft-player-slot span:last-child {
  color: var(--app-shell-muted);
  font-size: 0.85rem;
}

.session-draft-player-slot:hover {
  background: rgba(255, 255, 255, 0.04);
}

.session-draft-player-slot:disabled {
  border-style: dashed;
  background: transparent;
  color: var(--app-shell-muted);
  cursor: default;
}

.session-draft-player-slot:disabled:hover {
  background: transparent;
}

.button-spinner {
  width: 1rem;
  height: 1rem;
  display: inline-block;
  margin-right: 0.55rem;
  vertical-align: text-bottom;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: button-spinner-spin 0.75s linear infinite;
}

@keyframes button-spinner-spin {
  to {
    transform: rotate(360deg);
  }
}

.match-media-layout {
  display: grid;
  grid-template-columns: minmax(0, 750px) minmax(18rem, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.match-event-filter-bar {
  grid-column: 1 / -1;
  padding: 1rem 1.05rem;
  border: 1px solid var(--app-shell-border);
  border-radius: 16px;
  background: var(--app-shell-surface-soft);
}

.youtube-player-column {
  min-width: 0;
}

.youtube-player-shell {
  width: 100%;
  max-width: 750px;
  display: grid;
  gap: 0.9rem;
}

.youtube-player-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--app-shell-border);
  border-radius: 16px;
  background: #000000;
}

.youtube-player-frame iframe {
  width: 100%;
  height: 100%;
}

.youtube-player-frame-prime-host {
  position: relative;
}

.youtube-player-frame-prime-overlay {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 3;
  display: block;
  aspect-ratio: 16 / 9;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.youtube-player-frame-prime-overlay[hidden] {
  display: none;
}

.youtube-player-controls {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.85rem;
}

.draft-match-controls {
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: end;
}

.draft-match-timeline-actions {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.55rem;
}

.draft-match-add-event {
  min-width: 6.5rem;
}

.youtube-player-timeline {
  min-height: 3.55rem;
  display: grid;
}

.youtube-player-track-shell {
  position: relative;
  min-height: 2.8rem;
  display: grid;
  align-items: center;
}

.youtube-player-track {
  position: absolute;
  inset-inline: 0;
  top: 50%;
  height: 0.28rem;
  translate: 0 -50%;
  border-radius: 999px;
  display: flex;
  overflow: hidden;
}

.youtube-player-track-segment {
  position: relative;
  height: 100%;
  background: rgba(255, 255, 255, 0.16);
  opacity: 0.58;
  transition: opacity 0.18s ease, background-color 0.18s ease;
}

.youtube-player-track-segment + .youtube-player-track-segment {
  box-shadow: inset 1px 0 0 rgba(5, 5, 5, 0.85);
}

.youtube-player-track-segment.is-active {
  opacity: 1;
  background: rgba(255, 255, 255, 0.2);
}

.youtube-player-track-segment.is-inactive .youtube-player-track-fill {
  width: 0 !important;
}

.youtube-player-track-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
}

.youtube-player-track-fill-loaded {
  background: rgba(255, 84, 84, 0.24);
}

.youtube-player-track-fill-played {
  background: linear-gradient(90deg, #ff4a4a 0%, #ff2323 100%);
}

.youtube-player-marker-rail {
  position: absolute;
  left: 0;
  right: 0;
  inset-block: 0;
}

.youtube-player-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  translate: -50% 0;
  width: 0.95rem;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 0.18rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  appearance: none;
  -webkit-appearance: none;
  color: #ff3434;
  cursor: pointer;
}

.youtube-player-marker::-moz-focus-inner {
  border: 0;
  padding: 0;
}

.youtube-player-marker[hidden] {
  display: none;
}

.youtube-player-marker-top {
  justify-content: flex-start;
}

.youtube-player-marker-bottom {
  justify-content: flex-end;
}

.youtube-player-marker-line {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1px;
  height: 1.1rem;
  translate: -50% -50%;
  background: rgba(255, 255, 255, 0.22);
  pointer-events: none;
}

.youtube-player-marker:not(.shows-shared-line) .youtube-player-marker-line {
  display: none;
}

.youtube-player-marker:hover {
  color: #ff6a6a;
}

.youtube-player-marker-defence {
  color: #3a86bf;
}

.youtube-player-marker-defence:hover {
  color: #5a9bd0;
}

.youtube-player-marker-defence .youtube-player-marker-icon {
  width: 0.76rem;
  height: 0.76rem;
}

.youtube-player-marker-scheme {
  color: #ffce5c;
}

.youtube-player-marker-scheme:hover {
  color: #ffe08f;
}

.youtube-player-marker-draw,
.youtube-player-marker-discard.is-boosted {
  color: #ffffff;
}

.youtube-player-marker-draw:hover,
.youtube-player-marker-discard.is-boosted:hover {
  color: #f0f0f0;
}

.youtube-player-marker-discard {
  color: #8e8e8e;
}

.youtube-player-marker-discard:hover {
  color: #b0b0b0;
}

.youtube-player-marker-icon {
  width: 0.88rem;
  height: 0.88rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
}

.youtube-player-marker-label {
  --marker-bg: #171717;
  --marker-border: rgba(255, 255, 255, 0.16);
  width: 1.38rem;
  height: 1.68rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  border: 0;
  background: transparent;
  color: currentColor;
  cursor: pointer;
  pointer-events: auto;
  transition: box-shadow 0.16s ease, transform 0.16s ease, translate 0.16s ease;
}

.youtube-player-marker-label::before,
.youtube-player-marker-label::after {
  content: "";
  position: absolute;
  inset: 0;
  transition: background-color 0.16s ease;
}

.youtube-player-marker-label::before {
  background: var(--marker-border);
}

.youtube-player-marker-label::after {
  inset: 1px;
  background: var(--marker-bg);
}

.youtube-player-marker-top .youtube-player-marker-label::before,
.youtube-player-marker-top .youtube-player-marker-label::after {
  clip-path: polygon(0 0, 100% 0, 100% 72%, 50% 100%, 0 72%);
}

.youtube-player-marker-top .youtube-player-marker-label {
  clip-path: polygon(0 0, 100% 0, 100% 72%, 50% 100%, 0 72%);
}

.youtube-player-marker-bottom .youtube-player-marker-label::before,
.youtube-player-marker-bottom .youtube-player-marker-label::after {
  clip-path: polygon(0 28%, 50% 0, 100% 28%, 100% 100%, 0 100%);
}

.youtube-player-marker-bottom .youtube-player-marker-label {
  clip-path: polygon(0 28%, 50% 0, 100% 28%, 100% 100%, 0 100%);
}

.youtube-player-marker-slot {
  width: 0.95rem;
  height: 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.youtube-player-marker-top .youtube-player-marker-slot-bottom {
  visibility: hidden;
}

.youtube-player-marker-bottom .youtube-player-marker-slot-top {
  visibility: hidden;
}

.youtube-player-marker-icon svg {
  width: 100%;
  height: 100%;
  display: block;
  fill: currentColor;
}

.youtube-player-marker-fallback {
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 999px;
  background: currentColor;
}

.timeline-marker-card-preview {
  --timeline-marker-preview-arrow-left: 50%;
  position: fixed;
  z-index: 1200;
  width: 4.75rem;
  aspect-ratio: 5 / 7;
  padding: 0.18rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 7px;
  background: rgba(15, 15, 15, 0.92);
  box-shadow: 0 0.85rem 1.8rem rgba(0, 0, 0, 0.42);
  pointer-events: none;
}

.timeline-marker-card-preview[hidden] {
  display: none;
}

.timeline-marker-card-preview::after {
  content: "";
  position: absolute;
  left: var(--timeline-marker-preview-arrow-left);
  bottom: -0.43rem;
  width: 0.72rem;
  height: 0.72rem;
  translate: -50% 0;
  rotate: 45deg;
  border-right: 1px solid rgba(255, 255, 255, 0.18);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(15, 15, 15, 0.92);
}

.timeline-marker-card-preview-image {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 5px;
  object-fit: cover;
  background: #111111;
}

.youtube-player-time {
  color: var(--app-shell-muted);
  font: 0.88rem ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.youtube-player-controls input[type="range"] {
  width: 100%;
  margin-top: 0;
  appearance: none;
  background: transparent;
  position: relative;
  z-index: 2;
}

.youtube-player-controls input[type="range"]::-webkit-slider-runnable-track {
  height: 0.28rem;
  background: transparent;
}

.youtube-player-controls input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 0.18rem;
  height: 1.15rem;
  margin-top: -0.44rem;
  border: 0;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 0 0 2px rgba(255, 74, 74, 0.14);
}

.youtube-player-controls input[type="range"]::-moz-range-track {
  height: 0.28rem;
  background: transparent;
  border: 0;
}

.youtube-player-controls input[type="range"]::-moz-range-thumb {
  width: 0.18rem;
  height: 1.15rem;
  border: 0;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 0 0 2px rgba(255, 74, 74, 0.14);
}

.match-event-log {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--app-shell-border);
  border-radius: 16px;
  background: var(--app-shell-surface-soft);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.match-event-log .settings-header {
  margin-bottom: 0.5rem;
}

.match-event-heading {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.match-event-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.8rem;
  height: 1.45rem;
  padding: 0 0.45rem;
  border: 1px solid var(--app-shell-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--app-shell-muted);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
}

.match-event-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  padding: 0;
  margin: 0;
  border: 0;
}

.match-event-filters-title {
  width: 100%;
  margin-bottom: 0.15rem;
  color: var(--app-shell-muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.match-event-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--app-shell-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--app-shell-text);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
}

.match-event-filter input {
  margin: 0;
  accent-color: #ff4a4a;
}

.match-event-log-list {
  display: grid;
  gap: 0.55rem;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 0.15rem;
}

.match-event-filter-empty {
  margin-top: 0.9rem;
}

.match-event-row {
  width: 100%;
  border: 1px solid var(--app-shell-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--app-shell-muted);
}

.match-event-row[hidden] {
  display: none;
}

.match-event-summary {
  display: grid;
  grid-template-columns: auto auto auto minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.8rem;
  text-align: left;
  cursor: pointer;
  list-style: none;
}

.match-event-summary::-webkit-details-marker {
  display: none;
}

.match-event-row:hover,
.match-event-row[open] {
  background: var(--app-shell-surface-raised);
  color: var(--app-shell-text);
}

.match-event-row.is-complete {
  border-color: rgba(255, 84, 84, 0.42);
  color: var(--app-shell-text);
}

.match-event-row.is-active {
  background: rgba(255, 74, 74, 0.12);
  border-color: #ff4a4a;
}

.match-event-row:has(.match-event-type-defence).is-complete {
  border-color: rgba(58, 134, 191, 0.46);
}

.match-event-row:has(.match-event-type-defence).is-active {
  background: rgba(58, 134, 191, 0.14);
  border-color: #3a86bf;
}

.match-event-time {
  font: 0.82rem ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.match-event-icon {
  width: 1rem;
  height: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ff3434;
  flex-shrink: 0;
}

.match-event-icon svg {
  width: 100%;
  height: 100%;
  display: block;
  fill: currentColor;
}

.match-event-icon-fallback {
  width: 0.38rem;
  height: 0.38rem;
  border-radius: 999px;
  background: currentColor;
}

.match-event-row:has(.match-event-type-defence) .match-event-icon {
  color: #3a86bf;
}

.match-event-row:has(.match-event-type-defence) .match-event-icon svg {
  width: 0.88rem;
  height: 0.88rem;
}

.match-event-row:has(.match-event-type-scheme) .match-event-icon {
  color: #ffce5c;
}

.match-event-row:has(.match-event-type-draw) .match-event-icon,
.match-event-row.is-boosted .match-event-icon {
  color: #ffffff;
}

.match-event-row:has(.match-event-type-discard) .match-event-icon {
  color: #8e8e8e;
}

.match-event-type {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.match-event-type-attack,
.match-event-type-health_changed {
  color: #ff8a8a;
}

.match-event-type-defence {
  color: #8abbe0;
}

.match-event-type-scheme {
  color: #ffe08f;
}

.match-event-type-draw {
  color: #efefef;
}

.match-event-type-discard {
  color: #9d9d9d;
}

.match-event-row.is-boosted .match-event-type-discard {
  color: #efefef;
}

.match-event-label {
  min-width: 0;
}

.match-event-details {
  display: grid;
  gap: 0.45rem;
  margin: 0;
  padding: 0 0.8rem 0.8rem 3.65rem;
}

.draft-event-actions {
  display: flex;
  gap: 0.65rem;
  padding: 0 0.8rem 0.8rem 3.65rem;
  flex-wrap: wrap;
}

.match-event-detail {
  display: grid;
  grid-template-columns: minmax(5.5rem, auto) minmax(0, 1fr);
  gap: 0.75rem;
  align-items: baseline;
}

.match-event-detail dt {
  color: var(--app-shell-muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.match-event-detail dd {
  min-width: 0;
  margin: 0;
  color: var(--app-shell-text);
  overflow-wrap: anywhere;
}

.app-modal {
  width: min(100%, 32rem);
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}

.app-modal-wide {
  width: min(100%, 64rem);
}

.app-modal::backdrop {
  background: rgba(0, 0, 0, 0.78);
}

.app-modal-card {
  padding: 1.5rem;
  border: 1px solid var(--app-shell-border);
  border-radius: 18px;
  background: var(--app-shell-surface-soft);
  box-shadow: 0 28px 48px rgba(0, 0, 0, 0.35);
  overflow: visible;
}

.app-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.app-modal-header h2 {
  color: var(--app-shell-text);
  font-size: 1.2rem;
}

.app-modal-title-with-icon {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.app-modal-title-icon {
  width: 1.35rem;
  height: 1.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.app-modal-title-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.app-modal-title-icon-scheme {
  color: #facc15;
}

.app-modal-header p {
  margin-top: 0.45rem;
  color: var(--app-shell-muted);
  line-height: 1.6;
}

@media (prefers-reduced-motion: reduce) {
  .app-flash {
    animation: app-flash-exit 0.18s linear 4.6s forwards;
  }

  body.logged-in-body,
  .logged-in-sidebar,
  .logged-in-main {
    transition: none;
  }
}

@media (max-width: 960px) {
  .hero-hero-sidekick-grid {
    grid-template-columns: 1fr;
  }

  .hero-sidekick-row {
    grid-template-columns: minmax(10rem, 1fr) minmax(7rem, 0.7fr) minmax(6rem, 0.6fr) 2.5rem;
  }

  .hero-sidekick-row .form-group:nth-of-type(4) {
    grid-column: 1 / -2;
  }

  .hero-card-list-row {
    grid-template-columns: 4.5rem minmax(12rem, 1fr) minmax(9rem, 0.8fr) 5rem 5rem minmax(8rem, 0.8fr) 2.5rem;
  }

  .hero-card-description-field,
  .hero-card-list-row .form-group:has(input[type="file"]) {
    grid-column: 1 / -1;
  }

  .logged-in-page {
    grid-template-columns: 1fr;
  }

  .logged-in-sidebar {
    display: none;
  }

  .logged-in-sidebar-drawer-panel {
    display: block;
  }

  .logged-in-main {
    padding: 1.5rem;
  }

  .logged-in-mobile-menu {
    display: block;
  }

  .logged-in-shell-no-sidebar .logged-in-mobile-menu {
    display: none;
  }

  .logged-in-topbar-spacer {
    display: none;
  }

  .logged-in-profile-name {
    display: none;
  }

  .match-media-layout {
    grid-template-columns: 1fr;
  }

  .session-editor-layout {
    grid-template-columns: 1fr;
  }

  .session-draft-editor {
    display: block;
    height: auto;
    min-height: 100%;
    overflow: auto;
  }

  .session-draft-editor-grid {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    gap: 1rem;
    overflow: visible;
    padding: 1.5rem;
  }

  .session-draft-editor-media,
  .session-draft-match-list {
    grid-column: 1;
  }

  .session-draft-timeline-block {
    padding: 0.35rem 0 0;
    background: transparent;
  }

  .session-draft-rail-layout {
    display: grid;
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .session-draft-step-rail {
    min-height: auto;
    padding: 1rem 1.5rem 0;
    border-right: 0;
  }

  .session-draft-stepper {
    margin-left: 0;
  }

  .session-draft-save-content {
    overflow: visible;
    padding: 1.5rem;
  }

  .session-draft-save-banner {
    min-height: 18rem;
  }

  .session-draft-selected-empty {
    min-height: 9rem;
  }

  .session-import-preview {
    grid-template-columns: 1fr;
  }

  .youtube-player-shell {
    max-width: none;
  }
}

@media (max-width: 1500px) {
  .session-draft-editor {
    grid-template-columns: 12.5rem minmax(0, 1fr) 0;
  }
}

@media (min-width: 901px) and (max-width: 1150px) {
  .session-draft-editor {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    height: 100%;
    min-height: 100%;
    overflow: hidden;
  }

  .session-draft-rail-layout {
    display: contents;
    overflow: visible;
  }

  .session-draft-step-rail {
    grid-column: 1;
    grid-row: 1;
    height: auto;
    min-height: auto;
    display: flex;
    justify-content: center;
    padding: 1rem 1.5rem 0.5rem;
    background: transparent;
  }

  .session-draft-stepper {
    min-width: 0;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: auto;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    margin-left: 0;
  }

  .session-draft-step {
    grid-template-columns: auto;
    gap: 0;
  }

  .session-draft-step-label {
    display: none;
  }

  .session-draft-step-connector {
    width: clamp(2.4rem, 8vw, 5rem);
    height: 2.55rem;
  }

  .session-draft-step-connector::before {
    left: 0.15rem;
    right: 0.15rem;
    top: 50%;
    bottom: auto;
    width: auto;
    height: 0.16rem;
    translate: 0 -50%;
  }

  .session-draft-step-connector.is-locked::before {
    background: linear-gradient(
      to right,
      #6d747d 0,
      #6d747d calc(50% - 0.9rem),
      transparent calc(50% - 0.9rem),
      transparent calc(50% + 0.9rem),
      #6d747d calc(50% + 0.9rem),
      #6d747d 100%
    );
  }

  .session-draft-step-connector.is-before-current::before {
    background: #ffffff;
  }

  .session-draft-step-connector.is-locked.is-before-current::before {
    background: linear-gradient(
      to right,
      #ffffff 0,
      #ffffff calc(50% - 0.9rem),
      transparent calc(50% - 0.9rem),
      transparent calc(50% + 0.9rem),
      #ffffff calc(50% + 0.9rem),
      #ffffff 100%
    );
  }

  .session-draft-editor-grid {
    grid-column: 1;
    grid-row: 2;
    width: min(100%, 1900px);
    grid-template-columns: minmax(0, 1fr) minmax(20rem, 28rem);
    gap: 1rem;
    align-content: center;
    overflow: auto;
    padding: 0 1.5rem 1.5rem;
  }

  .session-draft-events .session-draft-editor-grid {
    overflow: visible;
  }

  .session-draft-editor-media {
    grid-column: 1;
  }

  .session-draft-match-list {
    grid-column: 2;
  }

  .session-draft-save-content {
    grid-column: 1;
    grid-row: 2 / -1;
    width: min(100%, 1900px);
    overflow: auto;
    padding: 1.5rem;
  }

  .session-draft-timeline-block {
    grid-column: 1;
    grid-row: 3;
    padding: 0.35rem clamp(1rem, 3vw, 1.5rem) 2.25rem;
    background: transparent;
  }
}

@media (max-width: 900px) {
  .session-draft-editor {
    display: block;
    height: auto;
    min-height: 100%;
    overflow: auto;
  }

  .session-draft-editor-grid {
    grid-column: 1;
    grid-row: auto;
    justify-self: stretch;
    width: 100%;
    grid-template-columns: 1fr;
    grid-template-rows: none;
    align-content: start;
    gap: 1rem;
    overflow: visible;
    padding: 1.5rem;
  }

  .session-draft-editor-media,
  .session-draft-match-list {
    grid-column: 1;
  }

  .session-draft-timeline-block {
    padding: 0.35rem 0 0;
    background: transparent;
  }

  .session-draft-player-frame {
    height: calc((100vw - 3rem) * 9 / 16);
    max-height: none;
  }

  .session-draft-events-timeline-block {
    padding: 0.45rem 1rem 0.85rem;
  }

  .session-draft-events-timeline-block .session-draft-timeline-row {
    grid-template-columns: 1fr 1fr;
    justify-content: stretch;
    gap: 0.28rem 0.75rem;
  }

  .session-draft-events-timeline-block .session-draft-events-time-actions {
    display: contents;
  }

  .session-draft-events-timeline-block .session-draft-events-add-row {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.32rem;
  }

  .session-draft-events-timeline-block .session-draft-events-add-row:first-child {
    order: 3;
    bottom: auto;
  }

  .session-draft-events-timeline-block .session-draft-events-add-row:last-child {
    order: 4;
    top: auto;
  }

  .session-draft-events-timeline-block .session-draft-events-add-label {
    display: none;
  }

  .session-draft-events-timeline-block .session-draft-events-timeline {
    grid-column: 1 / -1;
    order: 1;
    min-height: 4.4rem;
  }

  .session-draft-events-timeline-block .session-draft-events-timeline-track {
    min-height: 4rem;
  }

  .session-draft-events-timeline-block .session-draft-events-side-labels {
    grid-column: 1;
    order: 2;
    justify-self: start;
    align-items: center;
    justify-items: start;
  }

  .session-draft-events-timeline-block .session-draft-events-time-actions > .session-draft-timeline-time {
    grid-column: 2;
    order: 2;
    justify-self: end;
  }

  .session-draft-events-timeline-track .youtube-player-marker-rail {
    height: 3rem;
  }

  .session-draft-events-timeline-track .youtube-player-marker {
    width: 1.35rem;
    height: 1.45rem;
  }

  .session-draft-events-timeline-track .youtube-player-marker-line {
    height: 0.3rem;
  }

  .session-draft-events-timeline-track .youtube-player-marker-label {
    width: 0.96rem;
    height: 1.14rem;
  }

  .session-draft-events-timeline-track .youtube-player-marker-icon,
  .session-draft-events-timeline-track .youtube-player-marker-defence .youtube-player-marker-icon {
    width: 0.62rem;
    height: 0.62rem;
  }

  .session-draft-events-timeline-track .youtube-player-marker-top .youtube-player-marker-label {
    translate: 0 calc(var(--marker-default-offset-index, 0) * -0.44rem);
  }

  .session-draft-events-timeline-track .youtube-player-marker-bottom .youtube-player-marker-label {
    translate: 0 calc(var(--marker-default-offset-index, 0) * 0.44rem);
  }

  .session-draft-rail-layout {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    overflow: auto;
  }

  .session-draft-step-rail {
    grid-column: 1;
    grid-row: auto;
    height: auto;
    min-height: auto;
    display: flex;
    justify-content: center;
    padding: 1rem 1.5rem 0;
    border-right: 0;
  }

  .session-draft-stepper {
    min-width: 0;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: auto;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    margin-left: 0;
  }

  .session-draft-step {
    grid-template-columns: auto;
    gap: 0;
  }

  .session-draft-step-label {
    display: none;
  }

  .session-draft-step-connector {
    width: clamp(2.4rem, 8vw, 5rem);
    height: 2.55rem;
  }

  .session-draft-step-connector::before {
    left: 0.15rem;
    right: 0.15rem;
    top: 50%;
    bottom: auto;
    width: auto;
    height: 0.16rem;
    translate: 0 -50%;
  }

  .session-draft-step-connector.is-locked::before {
    background: linear-gradient(
      to right,
      #6d747d 0,
      #6d747d calc(50% - 0.9rem),
      transparent calc(50% - 0.9rem),
      transparent calc(50% + 0.9rem),
      #6d747d calc(50% + 0.9rem),
      #6d747d 100%
    );
  }

  .session-draft-step-connector.is-before-current::before {
    background: #ffffff;
  }

  .session-draft-step-connector.is-locked.is-before-current::before {
    background: linear-gradient(
      to right,
      #ffffff 0,
      #ffffff calc(50% - 0.9rem),
      transparent calc(50% - 0.9rem),
      transparent calc(50% + 0.9rem),
      #ffffff calc(50% + 0.9rem),
      #ffffff 100%
    );
  }

  .session-draft-save-content {
    grid-column: 1;
    grid-row: auto;
    width: 100%;
    justify-self: stretch;
    overflow: visible;
    padding: 1.5rem;
  }

  .session-draft-save-banner {
    min-height: 18rem;
  }

  .session-draft-selected-empty {
    min-height: 9rem;
  }
}

/* The basics/events editors now use the session show layout. Keep legacy draft
   breakpoints from changing that wrapper or sizing the player independently. */
.session-draft-editor.session-draft-layout-editor {
  display: block;
  width: 100%;
  max-width: 1850px;
  height: auto;
  min-height: 0;
  overflow: visible;
}

.session-draft-layout-lab .session-layout-lab-video {
  position: relative;
  width: 100%;
  height: auto;
  min-height: 0;
  aspect-ratio: 16 / 9;
}

.session-draft-layout-lab .session-draft-player-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
}

.session-show-editor.session-draft-editor {
  position: relative;
  --session-show-side-gutter: clamp(1rem, 7vw, 12.5rem);
  --session-show-grid-padding-x: 2.5rem;
  --session-show-radius: 8px;
  --session-show-event-panel-width: clamp(9.5rem, 13vw, 14rem);
  grid-template-columns: clamp(1rem, 7vw, 12.5rem) minmax(0, 1fr) clamp(1rem, 7vw, 12.5rem);
  grid-template-rows: auto auto;
  align-content: start;
}

.session-show-actions-menu {
  position: relative;
  display: inline-flex;
}

.session-show-actions-button {
  width: 2.65rem;
  height: 2.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--app-shell-border);
  border-radius: 8px;
  background: var(--app-shell-surface-raised);
  color: #ffffff;
  cursor: pointer;
  list-style: none;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

.session-show-actions-button::-webkit-details-marker {
  display: none;
}

.session-show-actions-button span,
.session-show-actions-button svg {
  width: 1rem;
  height: 1rem;
  display: inline-flex;
}

.session-show-actions-button svg,
.session-show-actions-button svg path {
  fill: currentColor;
}

.session-show-actions-button:hover {
  background: var(--app-shell-surface-soft);
}

.session-show-context-menu {
  z-index: 30;
}

.session-show-context-modal {
  display: block;
}

.session-show-context-modal .app-modal-backdrop,
.session-show-context-modal .app-modal {
  position: fixed;
}

.session-show-context-danger {
  color: var(--app-shell-danger);
}

.session-history-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0, 0, 0, 0.42);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.session-history-drawer-backdrop.is-open {
  opacity: 1;
}

.session-history-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 81;
  width: min(38rem, 100vw);
  height: 100vh;
  background: var(--app-shell-surface);
  border-left: 1px solid var(--app-shell-border);
  box-shadow: -24px 0 42px rgba(0, 0, 0, 0.26);
  transform: translateX(102%);
  transition: transform 0.2s ease;
}

.session-history-drawer.is-open {
  transform: translateX(0);
}

.session-history-drawer-backdrop[hidden],
.session-history-drawer[hidden] {
  display: none;
}

.session-history-drawer-shell {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.session-history-drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem;
  border-bottom: 1px solid var(--app-shell-border);
}

.session-history-drawer-header span,
.session-history-drawer-title span {
  color: var(--app-shell-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.session-history-drawer-header h2,
.session-history-drawer-title h2 {
  margin: 0.25rem 0 0;
  color: var(--app-shell-text);
  font-size: 1.05rem;
}

.session-history-drawer-content,
.session-history-drawer-loading {
  padding: 1.25rem;
}

.session-history-drawer turbo-frame,
#session_history_drawer {
  min-height: 0;
  overflow-y: auto;
}

.session-history-drawer-content {
  display: grid;
  gap: 1rem;
  min-height: 0;
}

.session-history-drawer-loading {
  color: var(--app-shell-muted);
}

.session-history-list {
  position: relative;
  display: grid;
  gap: 1.05rem;
  padding-left: 2rem;
}

.session-history-list::before {
  content: "";
  position: absolute;
  top: 0.65rem;
  bottom: 0.65rem;
  left: 0.55rem;
  width: 1px;
  background: rgba(255, 255, 255, 0.18);
}

.session-history-entry {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.session-history-entry-marker {
  position: absolute;
  top: -0.05rem;
  left: -1.94rem;
  z-index: 1;
  width: 1.15rem;
  height: 1.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--app-shell-surface);
  color: var(--app-shell-text);
  box-shadow: 0 0 0 4px var(--app-shell-surface);
}

.session-history-entry-marker svg {
  width: 0.95rem;
  height: 0.95rem;
  display: block;
}

.session-history-entry-marker svg,
.session-history-entry-marker svg path {
  fill: currentColor;
}

.session-history-entry-body {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

.session-history-entry h2 {
  margin: 0;
  color: var(--app-shell-text);
  font-size: 0.94rem;
  font-weight: 800;
  line-height: 1.25;
}

.session-history-entry p {
  margin: 0;
  color: var(--app-shell-muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.session-history-entry-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--app-shell-muted);
  font-size: 0.82rem;
}

.session-history-calendar-icon {
  position: relative;
  width: 0.9rem;
  height: 0.9rem;
  flex: 0 0 auto;
  border: 1.5px solid currentColor;
  border-radius: 0.18rem;
  opacity: 0.82;
}

.session-history-calendar-icon::before {
  content: "";
  position: absolute;
  top: 0.22rem;
  left: -1.5px;
  right: -1.5px;
  height: 1.5px;
  background: currentColor;
}

.session-history-calendar-icon::after {
  content: "";
  position: absolute;
  top: -0.18rem;
  left: 0.16rem;
  width: 0.44rem;
  height: 0.28rem;
  border-left: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
}

.session-show-editor-grid {
  grid-column: 2;
  width: min(100%, 2100px);
  grid-template-columns: minmax(0, 1fr) var(--session-show-event-panel-width);
  align-content: start;
  gap: 1rem;
  padding-top: 1.25rem;
}

.session-show-editor .session-draft-player-frame {
  border: 0;
  border-radius: var(--session-show-radius);
  height: auto;
  max-height: none;
  aspect-ratio: 16 / 9;
}

.session-show-match-tabs {
  display: flex;
  gap: 0.75rem;
  grid-template-columns: none;
  overflow-x: auto;
}

.session-show-match-tabs .session-show-match-selector {
  flex: 0 0 auto;
  min-width: min(16rem, 100%);
  border: 0;
  border-radius: var(--session-show-radius);
  background: rgba(255, 255, 255, 0.045);
  text-decoration: none;
}

.session-show-match-tabs .session-show-match-selector.is-selected {
  margin-bottom: 0;
  border: 0;
  background: var(--app-shell-surface-soft);
  color: var(--app-shell-text);
  box-shadow: none;
}

.session-show-match-tabs .session-draft-match-tab.is-selected {
  border-color: transparent;
  border-bottom: 0;
  box-shadow: none;
}

.session-show-match-tabs .session-show-match-selector:not(a) {
  cursor: default;
}

.session-show-match-panel {
  min-height: 0;
  align-self: start;
}

.session-show-match-panel .session-draft-match-tab {
  text-decoration: none;
}

.session-show-panel-header {
  display: grid;
  gap: 0.85rem;
}

.session-show-panel-header span {
  color: var(--app-shell-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.session-show-panel-header small {
  color: var(--app-shell-muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.session-show-event-card {
  display: grid;
  gap: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.session-show-event-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--app-shell-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.session-show-event-card h2 {
  margin: 0;
  color: var(--app-shell-text);
  font-size: 1rem;
  line-height: 1.2;
}

.session-show-event-card-images {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  align-items: start;
  justify-content: stretch;
}

.session-show-event-card-image {
  min-width: 0;
  display: grid;
  gap: 0.35rem;
  margin: 0;
}

.session-show-event-card-image .card-image-frame {
  width: 100%;
  max-width: none;
  aspect-ratio: 63 / 88;
  border: 1px solid var(--app-shell-border);
  border-radius: 6px;
  justify-self: center;
}

.session-show-event-card-image .card-image-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.session-show-event-card-image figcaption {
  max-width: 3.75rem;
  color: var(--app-shell-muted);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  overflow-wrap: anywhere;
}

.session-show-event-card-placeholder {
  width: 100%;
  aspect-ratio: var(--hero-card-aspect-ratio, 5 / 7);
  display: block;
  border: 1px dashed var(--app-shell-border);
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.035);
}

.session-show-event-card p,
.session-show-event-card small {
  margin: 0;
  color: var(--app-shell-muted);
  line-height: 1.35;
}

.session-show-event-card small {
  overflow-wrap: anywhere;
}

.session-show-player-stack {
  min-width: 0;
}

.session-show-player-stack .session-draft-events-add-label {
  max-width: 11rem;
}

.session-show-player-row {
  translate: calc(-50% - 3.9rem) 0;
}

.session-show-button-spacer {
  width: 1.45rem;
  height: 1.45rem;
  display: block;
  visibility: hidden;
}

.session-show-editor .session-draft-events-timeline-track .youtube-player-marker-rail {
  z-index: 6;
}

.session-show-editor .session-draft-events-timeline-track .youtube-player-marker:focus-visible .youtube-player-marker-label {
  --marker-bg: #222222;
  --marker-border: rgba(124, 255, 79, 0.9);
  transform: translateY(-1px);
  filter: drop-shadow(0 0 0.18rem rgba(124, 255, 79, 0.22)) drop-shadow(0 0.45rem 1rem rgba(0, 0, 0, 0.38));
}

.session-show-timeline-range {
  position: absolute;
  inset: -1rem 0;
  z-index: 1;
  width: 100%;
  opacity: 0;
  cursor: pointer;
}

.session-show-editor .session-draft-timeline-cursor {
  z-index: 4;
}

@media (max-width: 1150px) {
  .session-show-editor.session-draft-editor {
    --session-show-side-gutter: 1rem;
    --session-show-grid-padding-x: 1.5rem;
    display: grid;
    grid-template-columns: minmax(1rem, 1fr) minmax(0, 1900px) minmax(1rem, 1fr);
    grid-template-rows: auto auto auto;
    height: 100%;
    min-height: 100%;
    overflow: hidden;
  }

  .session-show-editor-grid {
    grid-column: 2;
    grid-row: 1;
    grid-template-columns: minmax(0, 1fr);
    overflow: visible;
    padding: 1.5rem 1.5rem 0;
  }

  .session-show-editor .session-draft-timeline-block {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .session-show-match-panel {
    grid-column: 2;
    grid-row: 3;
    width: min(100%, 20rem);
    justify-self: center;
    padding: 0 1.5rem 1.5rem;
  }
}

@media (max-width: 900px) {
  .logged-in-main:has(.session-show-editor) {
    height: auto;
    min-height: calc(100vh - 4rem);
    display: flex;
    flex-direction: column;
    overflow: visible;
    padding: 0;
  }

  .session-show-editor.session-draft-editor {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    height: auto;
    min-height: calc(100vh - 4rem);
    overflow: visible;
  }

  .session-show-editor-grid {
    width: 100%;
    display: contents;
  }

  .session-show-actions-button {
    width: 2rem;
    height: 2rem;
    border-radius: 6px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
  }

  .session-show-actions-button span,
  .session-show-actions-button svg {
    width: 0.78rem;
    height: 0.78rem;
  }

  .session-show-context-menu {
    right: 0;
  }

  .session-show-editor .session-draft-editor-media {
    order: 1;
    width: 100%;
    align-self: start;
    flex: 0 0 auto;
  }

  .session-show-editor .session-draft-editor-media-inner {
    gap: 0.75rem;
  }

  .session-show-editor .session-draft-player-frame {
    width: 100%;
    height: 56.25vw;
    max-height: none;
    aspect-ratio: 16 / 9;
    border: 0;
    border-radius: 6px;
    contain: layout paint;
  }

  .session-show-match-tabs {
    margin: 0 1rem;
    overflow-x: auto;
    grid-auto-flow: column;
    grid-auto-columns: minmax(9rem, 1fr);
    grid-template-columns: none;
  }

  .session-show-editor .session-draft-timeline-block {
    order: 2;
    width: 100%;
    flex: 0 0 auto;
    margin-top: 0.75rem;
    padding: 0.35rem 0 0.85rem;
    background: transparent;
    z-index: 1;
  }

  .session-show-editor .session-draft-timeline-row {
    width: 100%;
    gap: 0.28rem 0;
    padding: 0;
  }

  .session-show-editor .session-draft-events-timeline {
    width: 100%;
    min-height: 4.4rem;
  }

  .session-show-editor .session-draft-events-timeline-track {
    min-height: 4rem;
    touch-action: none;
  }

  .session-show-match-panel {
    order: 3;
    width: 100%;
    flex: 0 0 auto;
    min-height: 0;
    margin: 0;
    padding: 0 1rem 1rem;
  }

  .session-show-player-row {
    display: none;
  }

  .session-show-button-spacer {
    display: none;
  }

  .session-show-timeline-range {
    display: none;
    pointer-events: none;
  }
}

@media (max-width: 720px) {
  .app-flash-stack {
    top: 1rem;
  }

  .logged-in-topbar {
    padding: 0 1rem;
    gap: 0.55rem;
  }

  .logged-in-brand span:last-child,
  .logged-in-profile-name,
  .global-search-shortcut {
    display: none;
  }

  .global-search {
    width: auto;
    flex: 1 1 auto;
  }

  .global-search-input {
    font-size: 0.82rem;
  }

  .global-search-results {
    position: fixed;
    top: 4.35rem;
    left: 0.65rem;
    right: 0.65rem;
  }
}

@media (max-width: 640px) {
  .logged-in-main {
    padding: 1rem;
  }

  .logged-in-main .settings-table {
    display: block;
    overflow-x: auto;
  }

  .logged-in-main .form-row,
  .logged-in-main .settings-actions,
  .logged-in-main .modal-actions,
  .logged-in-main .settings-header-row,
  .app-modal-header,
  .session-card-header {
    flex-direction: column;
    align-items: stretch;
  }

  .logged-in-main .settings-header-actions {
    margin-left: 0;
  }

  .settings-subnav {
    width: 100%;
    justify-content: space-between;
  }

  .session-draft-grid {
    grid-template-columns: 1fr;
  }

  .session-draft-match-fields,
  .session-draft-player-grid {
    grid-template-columns: 1fr;
  }

  .hero-card-list-row {
    grid-template-columns: 1fr;
  }

  .hero-sidekick-row {
    grid-template-columns: 1fr;
  }

  .hero-card-remove-button {
    justify-self: end;
  }

  .youtube-player-controls {
    grid-template-columns: 1fr;
  }

  .draft-match-controls {
    grid-template-columns: 1fr;
  }

  .draft-match-timeline-actions {
    align-items: stretch;
  }
}

@media (max-width: 700px) {
  .hero-index-header .settings-header-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
  }

  .hero-index-header-actions {
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 0.45rem;
    min-width: 0;
    margin-left: 0;
  }

  .hero-index-toolbar {
    flex-wrap: wrap;
    gap: 0.4rem;
    min-width: 0;
  }

  .hero-index-control-group {
    flex: 0 1 auto;
    gap: 0.2rem;
  }

  .hero-index-control {
    min-height: 2rem;
    padding: 0 0.45rem;
    font-size: 0.8rem;
  }

  .hero-index-action-button {
    flex: 0 0 auto;
    min-width: 2.25rem;
    padding: 0 0.55rem;
  }
}

@media (max-width: 430px) {
  .hero-index-action-button span {
    display: none;
  }

  .hero-index-toolbar {
    justify-content: flex-start;
  }
}
