.af-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;
}
.af-studio { width: 100%; }

/* Spotlight Sticky Input */
.af-spotlight-wrap {
  position: sticky;
  top: 72px;
  z-index: 25;
  margin-bottom: 18px;
}
.af-spotlight {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  padding: 8px 8px 8px 20px;
  box-shadow: 0 8px 28px rgba(17, 17, 19, 0.07), 0 1px 2px rgba(17, 17, 19, 0.04);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.af-spotlight:focus-within {
  border-color: var(--text);
  box-shadow: 0 12px 34px rgba(17, 17, 19, 0.1), 0 0 0 3px rgba(17, 17, 19, 0.06);
}
.af-input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: clamp(18px, 2.2vw, 22px);
  font-weight: 500;
  letter-spacing: -0.015em;
  padding: 10px 0;
  outline: none;
}
.af-input::placeholder { color: #a1a1aa; font-weight: 400; }
.af-input-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.af-clear-btn {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.af-clear-btn[hidden] { display: none; }
.af-clear-btn:hover { background: var(--surface-hover); color: var(--text); }
.af-customize-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 140ms ease, border-color 140ms ease, transform 100ms ease;
}
.af-customize-btn:hover { background: var(--surface-hover); }
.af-customize-btn:active { transform: scale(0.97); }
.af-customize-btn.is-open {
  background: var(--text);
  border-color: var(--text);
  color: #ffffff;
}
.af-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

/* Collapsible Drawer */
.af-drawer {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 18px;
  margin-bottom: 18px;
}
.af-drawer[hidden] { display: none; }
.af-drawer-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.af-drawer-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}
.af-frame-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 0;
}
.af-frame-chips::-webkit-scrollbar { display: none; }
.af-frame-chip {
  flex: none;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 999px;
  padding: 5px 12px;
  font-family: var(--font-unicode);
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 130ms ease;
}
.af-frame-chip:hover { border-color: var(--text); }
.af-frame-chip.active { background: var(--text); border-color: var(--text); color: #ffffff; }
.af-drawer-divider { height: 1px; background: var(--border); margin: 14px 0; }
.af-bio-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 16px;
  align-items: center;
}
.af-bio-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
}
.af-bio-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.af-bio-tabs { display: flex; gap: 4px; }
.af-bio-tab {
  border: 0;
  background: var(--surface);
  color: var(--muted);
  border-radius: 999px;
  padding: 4px 10px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.af-bio-tab.active { background: var(--text); color: #ffffff; }
.af-bio-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success);
}
.af-bio-badge.is-warn { background: var(--warn-soft); color: var(--warn); }
.af-bio-badge.is-over { background: var(--accent-soft); color: var(--accent); }
.af-bio-handle { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.af-bio-output {
  font-family: var(--font-unicode);
  font-size: 16px;
  line-height: 1.45;
  color: var(--text);
  word-break: break-word;
  white-space: pre-wrap;
}
.af-bio-meter { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.af-bio-note { margin: 0 0 12px; font-size: 12px; color: var(--muted); line-height: 1.5; }
.af-bio-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.af-btn-dark {
  min-height: 36px; padding: 0 14px; border: 0; border-radius: 999px;
  background: var(--text); color: #ffffff; font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.af-btn-light {
  min-height: 36px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 999px;
  background: var(--bg); color: var(--text); font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.af-btn-light:hover { border-color: var(--text); }

/* Discord-Only Native Preview Strip */
.af-dc-strip {
  margin: 0 auto 22px;
  padding: 14px 16px;
  border-radius: 16px;
  background: #1e1f22;
  color: #f2f3f5;
  border: 1px solid #2b2d31;
}
.af-dc-strip[hidden] { display: none; }
.af-dc-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.af-dc-modes { display: flex; flex-wrap: wrap; gap: 4px; }
.af-dc-mode {
  border: 0;
  border-radius: 999px;
  padding: 5px 12px;
  background: transparent;
  color: #b5bac1;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}
.af-dc-mode:hover { color: #ffffff; background: #2b2d31; }
.af-dc-mode.active { background: #35373c; color: #ffffff; }
.af-dc-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(35, 165, 90, 0.18);
  color: #4ade80;
}
.af-dc-badge.is-warn { background: rgba(240, 178, 50, 0.18); color: #fbbf24; }
.af-dc-badge.is-over { background: rgba(242, 63, 66, 0.22); color: #f87171; }
.af-dc-stage {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #2b2d31;
}
.af-dc-stage[hidden], .af-dc-md[hidden] { display: none; }
.af-dc-user { display: flex; align-items: center; gap: 12px; min-width: 0; }
.af-dc-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #5865f2;
  color: #ffffff;
  font-weight: 700;
  font-size: 15px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.af-dc-user-copy { min-width: 0; }
.af-dc-name {
  font-family: var(--font-unicode);
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.3;
  word-break: break-word;
}
.af-dc-handle { font-size: 12px; color: #949ba4; margin-top: 2px; }
.af-dc-chan-left { display: grid; gap: 8px; min-width: 0; }
.af-dc-chan-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 500;
  color: #dbdee1;
  min-width: 0;
}
.af-dc-hash { color: #80848e; font-weight: 700; font-size: 18px; line-height: 1; }
.af-dc-chan-out {
  font-family: var(--font-unicode);
  color: #f2f3f5;
  word-break: break-word;
}
.af-dc-seps { display: flex; flex-wrap: wrap; gap: 6px; }
.af-dc-sep {
  border: 1px solid #3f4147;
  border-radius: 999px;
  padding: 2px 10px;
  background: #1e1f22;
  color: #b5bac1;
  font-family: var(--font-unicode);
  font-size: 12px;
  cursor: pointer;
}
.af-dc-sep.active { border-color: #ffffff; color: #ffffff; background: #35373c; }
.af-dc-copy {
  flex-shrink: 0;
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: #ffffff;
  color: #111113;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.af-dc-copy:hover { opacity: 0.9; }
.af-dc-md-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.af-dc-md-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #3f4147;
  border-radius: 10px;
  padding: 7px 12px;
  background: #2b2d31;
  color: #f2f3f5;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}
.af-dc-md-chip:hover { border-color: #ffffff; background: #35373c; }
.af-dc-md-chip code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: #a5b4fc;
}
@media (max-width: 640px) {
  .af-dc-stage { flex-direction: column; align-items: stretch; }
  .af-dc-copy { width: 100%; }
}

/* Hairline Tabs + Quiet Search */
.af-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.af-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
.af-tabs::-webkit-scrollbar { display: none; }
.af-tab {
  position: relative;
  flex: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 12px 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 140ms ease;
}
.af-tab:hover { color: var(--text); }
.af-tab.active { color: var(--text); font-weight: 700; }
.af-tab.active::after {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -1px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}
.af-search-box {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--faint);
  padding-bottom: 4px;
  width: 190px;
  flex-shrink: 0;
}
.af-search {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  padding: 6px 0;
  outline: none;
}
.af-search::placeholder { color: #a1a1aa; }
.af-script-alert {
  margin: 0 0 16px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
}

/* 2-Column Gallery Specimen Cards (Auto-switches to 1-col for long text > 36 chars) */
.af-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.af-grid.is-single-col {
  grid-template-columns: 1fr;
}
.af-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  min-height: 112px;
  padding: 14px 18px 18px;
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: 16px;
  cursor: pointer;
  user-select: none;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 100ms ease;
}
.af-card:hover {
  background: #ffffff;
  border-color: var(--border-strong);
  box-shadow: 0 6px 20px rgba(17, 17, 19, 0.06);
}
.af-card:active { transform: scale(0.988); }
.af-card.is-copied {
  background: #ffffff;
  border-color: var(--success);
  box-shadow: 0 0 0 3px var(--success-soft);
}
.af-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.af-card-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--faint);
  letter-spacing: 0.01em;
}
.af-card-tools {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.af-mini-icon {
  border: 0;
  background: transparent;
  color: var(--faint);
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  opacity: 0.65;
  transition: opacity 140ms ease, background 140ms ease, color 140ms ease;
}
.af-card:hover .af-mini-icon, .af-mini-icon.is-fav { opacity: 1; }
.af-mini-icon:hover { background: var(--surface-hover); color: var(--text); }
.af-mini-icon.is-fav { color: var(--accent); }
.af-copy-pill {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  transition: background 140ms ease, color 140ms ease;
}
.af-card:hover .af-copy-pill { background: var(--text); color: #ffffff; }
.af-card.is-copied .af-copy-pill { background: var(--success); color: #ffffff; }
.af-card-preview {
  color: var(--text);
  font-family: var(--font-unicode);
  font-size: clamp(20px, 2.2vw, 24px);
  line-height: 1.42;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.af-load-wrap { display: flex; justify-content: center; margin-top: 24px; }
.af-load-btn {
  min-height: 44px;
  padding: 0 24px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
}
.af-load-btn:hover { border-color: var(--text); background: var(--surface); }
.af-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 16px;
  color: var(--muted);
  font-size: 15px;
}

.af-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 80;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--text);
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  white-space: nowrap;
  max-width: calc(100vw - 24px);
}
.af-toast[hidden] { display: none; }
.af-toast-check { color: #4ade80; }

@media (max-width: 760px) {
  .af-spotlight-wrap { top: 66px; margin-bottom: 12px; }
  .af-spotlight { padding: 6px 6px 6px 14px; border-radius: 14px; }
  .af-input { font-size: 17px; padding: 8px 0; }
  .af-customize-btn { min-height: 36px; padding: 0 11px; font-size: 12px; }
  .af-bar { flex-direction: column; align-items: stretch; gap: 6px; border-bottom: 0; margin-bottom: 14px; }
  .af-tabs { border-bottom: 1px solid var(--border); }
  .af-search-box { width: 100%; background: var(--surface); border-radius: 10px; padding: 2px 12px; }
  .af-bio-grid { grid-template-columns: 1fr; }
  .af-grid { grid-template-columns: 1fr; gap: 10px; }
  .af-card { min-height: 92px; padding: 12px 14px 14px; }
  .af-card-preview { font-size: 20px; }
  .af-mini-icon { opacity: 0.9; }
}