

.aoc-ep {
  --font-size-xs: 12px;
  --color-surface: var(--pebble-5);
  --color-text-secondary: hsla(0, 0%, 93%, 0.8);
  --color-text-tertiary: var(--pebble-50);
  --spacing-smd: 12px;
  --color-border-light: var(--pebble-10);
}

.aoc-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;
}


.aoc-ep {
  z-index: 60;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  padding: var(--spacing-smd);
  border: var(--border-normal) solid var(--color-border-light);
  border-radius: var(--radius-lg);
  background: var(--color-surface-overlay);
  box-shadow: var(--shadow-lg);
  color: var(--color-text-primary);
  font-family: var(--font-body);
}

.aoc-ep-pop {
  position: fixed;
  
  width: min(342px, calc(100vw - 32px));
  max-height: min(380px, 60dvh);
}

.aoc-ep-pop.aoc-ep-fixed {
  width: auto;
}

.aoc-ep-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: min(60dvh, 480px);
  padding-bottom: calc(var(--spacing-smd) + env(safe-area-inset-bottom));
  border-bottom: 0;
  border-radius: var(--radius-panel) var(--radius-panel) 0 0;
}

.aoc-ep-sheet.aoc-ep-fixed {
  height: auto;
}

.aoc-ep-scrim {
  position: fixed;
  inset: 0;
  z-index: 59;
  background: var(--charcoal-70);
  -webkit-backdrop-filter: blur(var(--blur-sm));
  backdrop-filter: blur(var(--blur-sm));
}

.aoc-ep-grabber {
  position: relative;
  flex-shrink: 0;
  width: 36px;
  height: 4px;
  margin: 0 auto;
  border-radius: var(--radius-full);
  background: var(--pebble-20);
}

.aoc-ep-grabber::before {
  content: "";
  position: absolute;
  inset: -14px -40px;
}

.aoc-ep-search-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  height: 36px;
  padding: 0 var(--spacing-smd);
  border-radius: var(--radius-max);
  background: var(--color-surface);
  cursor: text;
}

.aoc-ep-search-bar:focus-within {
  box-shadow: 0 0 0 2px var(--color-accent);
}

.aoc-ep-search-icon {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  color: var(--color-text-tertiary);
}

.aoc-ep-search {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--color-text-primary);
  font-family: inherit;
  font-size: 16px;
}

@media (hover: hover) and (pointer: fine) {
  .aoc-ep-search {
    font-size: 14px;
  }
}

.aoc-ep-search::placeholder {
  color: var(--color-text-tertiary);
}

.aoc-ep-nav {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
}

.aoc-ep-nav[hidden] {
  display: none;
}

.aoc-ep-nav-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-md);
  background: none;
  color: var(--color-text-tertiary);
  cursor: pointer;
}

.aoc-ep-nav-icon {
  width: 18px;
  height: 18px;
}

@media (hover: hover) {
  .aoc-ep-nav-btn:hover {
    color: var(--color-text-secondary);
  }
}

.aoc-ep-nav-on,
.aoc-ep-nav-on:hover {
  color: var(--color-text-primary);
}

.aoc-ep-nav-on::after {
  content: "";
  position: absolute;
  left: 9px;
  right: 9px;
  bottom: 2px;
  height: 2px;
  border-radius: var(--radius-full);
  background: var(--pebble);
}

.aoc-ep-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: var(--spacing-smd);
  scroll-padding-bottom: var(--spacing-smd);
}

.aoc-ep-fixed .aoc-ep-body {
  overflow: visible;
  padding-bottom: 0;
}

.aoc-ep-label {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 6px 0 4px;
  background: var(--color-surface-overlay);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  line-height: 16px;
  color: var(--color-text-tertiary);
}

.aoc-ep-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 36px);
  justify-content: space-between;
  gap: 4px;
}

.aoc-ep-sheet .aoc-ep-grid {
  grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
}

.aoc-ep-grid-fixed,
.aoc-ep-sheet .aoc-ep-grid-fixed {
  grid-template-columns: repeat(6, 40px);
  justify-content: center;
}

.aoc-ep-emoji {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0;
  border: var(--border-normal) solid transparent;
  border-radius: var(--radius-md);
  background: none;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.08s ease;
}

.aoc-ep-sheet .aoc-ep-emoji,
.aoc-ep-fixed .aoc-ep-emoji {
  height: 40px;
}


.aoc-ep-sheet .aoc-ep-emoji {
  font-size: 24px;
}

@media (hover: hover) {
  .aoc-ep-emoji:hover {
    background: var(--pebble-10);
  }
}

.aoc-ep-emoji-mine,
.aoc-ep-emoji-mine:hover {
  border-color: var(--pebble);
  background: var(--pebble-15);
}

.aoc-ep-emoji:active {
  transform: scale(0.96);
}

.aoc-ep-emoji:focus-visible,
.aoc-ep-nav-btn:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px var(--charcoal),
    0 0 0 4px var(--color-accent);
}

.aoc-ep-empty {
  margin: 0;
  padding: var(--spacing-lg) 0;
  text-align: center;
  font-size: var(--font-size-xs);
  line-height: 16px;
  color: var(--color-text-tertiary);
}





.aoc-sp-pop {
  width: min(360px, calc(100vw - 32px));
  max-height: min(400px, 60dvh);
}


.aoc-sp-nav {
  justify-content: flex-start;
  gap: var(--spacing-xs);
  padding-bottom: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.aoc-sp-tab {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
}

.aoc-sp-tab.aoc-ep-nav-on {
  background: var(--pebble-10);
}

.aoc-sp-tab.aoc-ep-nav-on::after {
  left: 12px;
  right: 12px;
  bottom: -5px;
}

.aoc-sp-tab-img {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  object-fit: cover;
}

.aoc-sp-section + .aoc-sp-section {
  margin-top: var(--spacing-md);
}

.aoc-sp-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  min-height: 44px;
  padding: 6px 0;
  background: var(--color-surface-overlay);
}

.aoc-sp-head-name {
  font-size: 14px;
  font-weight: var(--font-weight-medium);
  line-height: 18px;
  color: var(--color-text-primary);
}

.aoc-sp-head-count {
  font-size: 12px;
  line-height: 16px;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-tertiary);
}

.aoc-sp-state-link,
.aoc-sp-state-retry {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--spacing-sm);
  font-size: 12px;
  font-weight: var(--font-weight-semibold);
  line-height: 16px;
  color: var(--color-accent);
  text-decoration: none;
}

.aoc-sp-head-get {
  margin-left: auto;
}

.aoc-sp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 4px;
}

.aoc-ep-sheet .aoc-sp-grid {
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
}

.aoc-sp-cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  padding: var(--spacing-xs);
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  cursor: pointer;
}

@media (hover: hover) {
  .aoc-sp-cell:hover {
    background: var(--pebble-10);
  }
}

.aoc-sp-cell:focus-visible {
  outline: none;
  background: var(--pebble-10);
  box-shadow:
    0 0 0 2px var(--charcoal),
    0 0 0 4px var(--color-accent);
}

.aoc-sp-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.aoc-sp-locked {
  cursor: default;
}

.aoc-sp-locked .aoc-sp-img {
  opacity: 0.35;
}

.aoc-sp-test-chip {
  position: absolute;
  top: 2px;
  left: 2px;
  z-index: 1;
  padding: 1px var(--spacing-xs);
  border-radius: var(--radius-sm);
  background: var(--color-tester);
  color: var(--color-on-tester);
  font: 700 12px/16px var(--font-body);
}

.aoc-sp-lock-badge {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background: var(--charcoal-70);
  color: var(--color-text-primary);
}

.aoc-sp-lock-icon {
  width: 16px;
  height: 16px;
}

.aoc-sp-lock {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-smd);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.aoc-sp-lock[hidden] {
  display: none;
}

.aoc-sp-lock-img {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.aoc-sp-lock-text {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  line-height: 18px;
  color: var(--color-text-secondary);
}

.aoc-sp-head-get,
.aoc-sp-lock-get {
  position: relative;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 var(--spacing-smd);
  border-radius: var(--radius-full);
  background: var(--pebble);
  color: var(--charcoal);
  font-size: 14px;
  font-weight: var(--font-weight-semibold);
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.aoc-sp-head-get::after,
.aoc-sp-lock-get::after {
  content: "";
  position: absolute;
  inset: -6px 0;
}

@media (hover: hover) {
  .aoc-sp-head-get:hover,
  .aoc-sp-lock-get:hover {
    opacity: 0.8;
  }
}

.aoc-sp-head-get:active,
.aoc-sp-lock-get:active {
  transform: scale(0.98);
}

@media (prefers-reduced-motion: reduce) {
  .aoc-sp-head-get:active,
  .aoc-sp-lock-get:active {
    transform: none;
  }
}

.aoc-sp-head-get:focus-visible,
.aoc-sp-lock-get:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px var(--charcoal),
    0 0 0 4px var(--color-accent);
}

.aoc-sp-lock-send {
  border: none;
  font-family: inherit;
  cursor: pointer;
}

.aoc-sp-state-link:focus-visible,
.aoc-sp-state-retry:focus-visible {
  outline: none;
  border-radius: var(--radius-sm);
  box-shadow:
    0 0 0 2px var(--charcoal),
    0 0 0 4px var(--color-accent);
}

.aoc-sp-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-xl) 0;
  text-align: center;
}

.aoc-sp-state-text {
  margin: 0;
  font-size: 14px;
  line-height: 18px;
  color: var(--color-text-secondary);
}

.aoc-sp-state-retry {
  border: none;
  background: none;
  cursor: pointer;
}

.aoc-sp-skel-tab,
.aoc-sp-skel-cell {
  display: block;
  background: var(--pebble-10);
  animation: aoc-skel-pulse 1.4s ease-in-out infinite;
}

.aoc-sp-skel-tab {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
}

.aoc-sp-skel-cell {
  aspect-ratio: 1;
  border-radius: var(--radius-md);
}

@media (prefers-reduced-motion: reduce) {
  .aoc-sp-skel-tab,
  .aoc-sp-skel-cell {
    animation: none;
  }
}
