/* ─── admin auth prompt ─────────────────────────────────────────────── */

.admin-auth {
  position: fixed;
  inset: 0;
  z-index: 220;
  background: rgba(8, 8, 10, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: admin-auth-in 320ms ease both;
}
@keyframes admin-auth-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.admin-auth-card {
  width: min(360px, 100%);
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #f0f0f0;
  text-align: center;
  gap: 16px;
}
.admin-auth-kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.36em;
  opacity: 0.55;
}
.admin-auth-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.28em;
  padding-left: 0.28em;
  margin: 0 0 12px;
}
.admin-auth-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(240,240,240,0.4);
  color: #f0f0f0;
  font-family: var(--font-mono);
  font-size: 15px;
  letter-spacing: 0.14em;
  text-align: center;
  padding: 10px 0;
  outline: none;
  caret-color: #f0f0f0;
}
.admin-auth-input:focus {
  border-bottom-color: #f0f0f0;
}
.admin-auth-err {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  height: 14px;
  opacity: 0;
  color: #f0a0a0;
  transition: opacity 200ms ease;
}
.admin-auth-err.visible { opacity: 0.9; }
.admin-auth-row {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}
.admin-auth-btn {
  background: #f0f0f0;
  color: #0a0a0a;
  border: 1px solid #f0f0f0;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.26em;
  padding: 10px 18px;
  cursor: pointer;
  transition: opacity 200ms ease;
}
.admin-auth-btn:hover { opacity: 0.85; }
.admin-auth-btn.ghost {
  background: transparent;
  color: #f0f0f0;
}
.admin-auth-btn.ghost:hover { background: rgba(255,255,255,0.06); }

/* ─── mobile (≤ 720px) ───────────────────────────────────────────────── */

@media (max-width: 720px) {
  .admin {
    /* full-screen on phones */
  }
  .adm-header {
    padding: 14px 16px;
    flex-wrap: wrap;
    gap: 12px;
  }
  .adm-header-left {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .adm-brand { font-size: 11px; }
  .adm-saved { font-size: 9px; }
  .adm-header-right { width: 100%; justify-content: stretch; flex-wrap: wrap; }
  .adm-btn { padding: 8px 12px; font-size: 9px; letter-spacing: 0.18em; flex: 1; }
  .adm-btn.icon { flex: 0; }
  .adm-tabs {
    padding: 0 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .adm-tabs::-webkit-scrollbar { display: none; }
  .adm-tab { padding: 14px 0; margin-right: 20px; font-size: 10px; white-space: nowrap; }
  .adm-body { padding: 24px 16px 80px; }
  .adm-grid-2 { grid-template-columns: 1fr; gap: 14px; }
  .adm-list-row {
    grid-template-columns: 32px 1fr;
    gap: 10px;
  }
  .adm-list-actions {
    grid-column: 1 / -1;
    flex-wrap: wrap;
  }
  .adm-list-actions button { flex: 1; padding: 8px; }
  .adm-arc-row {
    grid-template-columns: 60px 1fr;
    gap: 8px;
    padding: 14px 0;
  }
  .adm-arc-row .adm-input { grid-column: 1 / -1; }
  .adm-arc-row .adm-input.tight { width: 60px; }
  .adm-current { grid-column: 1 / -1; }
  .adm-export { font-size: 10px; }
}

.admin-dot {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 80;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  font-size: 18px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.18;
  transition: opacity 200ms ease, transform 200ms ease;
}
.admin-dot:hover {
  opacity: 0.85;
  transform: scale(1.1);
}

.edit-pill {
  position: fixed;
  bottom: 28px;
  right: 36px;
  z-index: 80;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid currentColor;
  color: inherit;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.28em;
  padding: 10px 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  opacity: 0.8;
  transition: opacity 200ms ease, transform 200ms ease;
}
.edit-pill:hover {
  opacity: 1;
  transform: translateY(-1px);
}
.ep-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  animation: dot-pulse 2.6s ease-in-out infinite;
}

/* ─── panel shell ───────────────────────────────────────────────────── */

.admin {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #0a0a0a;
  color: #f0f0f0;
  font-family: var(--font-display, system-ui, sans-serif);
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 500ms cubic-bezier(.4, 0, .2, 1);
  pointer-events: none;
}
.admin.open {
  transform: translateY(0);
  pointer-events: auto;
}

.adm-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 32px;
  border-bottom: 1px solid #1f1f1f;
  gap: 24px;
  flex-shrink: 0;
}
.adm-header-left {
  display: flex;
  align-items: baseline;
  gap: 20px;
}
.adm-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.adm-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.28em;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.adm-saved {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #888;
}

.adm-btn {
  background: #f0f0f0;
  color: #0a0a0a;
  border: 1px solid #f0f0f0;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  padding: 10px 16px;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 200ms ease, transform 200ms ease;
}
.adm-btn:hover { opacity: 0.85; }
.adm-btn.ghost {
  background: transparent;
  color: #f0f0f0;
}
.adm-btn.ghost:hover { background: rgba(255,255,255,0.05); }
.adm-btn.icon {
  padding: 8px 12px;
  font-size: 18px;
  letter-spacing: 0;
}

.adm-tabs {
  display: flex;
  gap: 0;
  padding: 0 32px;
  border-bottom: 1px solid #1f1f1f;
  flex-shrink: 0;
}
.adm-tab {
  background: none;
  border: none;
  color: #888;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  padding: 16px 0;
  margin-right: 36px;
  cursor: pointer;
  border-bottom: 1px solid transparent;
  transition: color 200ms ease, border-color 200ms ease;
  text-transform: uppercase;
}
.adm-tab:hover { color: #ccc; }
.adm-tab.active {
  color: #f0f0f0;
  border-bottom-color: #f0f0f0;
}

.adm-body {
  flex: 1;
  overflow: auto;
  padding: 36px 32px 80px;
}

/* ─── forms ─────────────────────────────────────────────────────────── */

.adm-form {
  max-width: 880px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.adm-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.adm-field-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #888;
}
.adm-field-hint {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: #666;
  margin-top: 4px;
}

.adm-input {
  background: #141414;
  border: 1px solid #2a2a2a;
  color: #f0f0f0;
  font-family: var(--font-display);
  font-size: 15px;
  padding: 12px 14px;
  outline: none;
  width: 100%;
  transition: border-color 180ms ease, background 180ms ease;
}
.adm-input:focus {
  border-color: #555;
  background: #181818;
}
.adm-input.mono {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.02em;
}
.adm-input.tight {
  width: 80px;
  text-align: center;
}
.adm-area {
  resize: vertical;
  line-height: 1.5;
}

.adm-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.adm-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.adm-row,
.adm-para-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.adm-row > .adm-input,
.adm-para-row > .adm-input {
  flex: 1;
}

.adm-x {
  background: transparent;
  border: 1px solid #2a2a2a;
  color: #888;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease;
}
.adm-x:hover {
  color: #f0f0f0;
  border-color: #555;
  background: #181818;
}

.adm-add {
  background: transparent;
  border: 1px dashed #333;
  color: #888;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  padding: 10px 14px;
  cursor: pointer;
  align-self: flex-start;
  white-space: nowrap;
  transition: color 180ms ease, border-color 180ms ease;
}
.adm-add:hover {
  color: #f0f0f0;
  border-color: #555;
}
.adm-add:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.adm-add.small {
  padding: 6px 12px;
  font-size: 10px;
}

.adm-back {
  background: transparent;
  border: none;
  color: #888;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  align-self: flex-start;
  padding: 4px 0;
  margin-bottom: 8px;
  transition: color 180ms ease;
}
.adm-back:hover { color: #f0f0f0; }

.adm-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid #1f1f1f;
}
.adm-section-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #888;
}

/* ─── lists ─────────────────────────────────────────────────────────── */

.adm-list {
  display: flex;
  flex-direction: column;
}
.adm-list-row {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid #1a1a1a;
}
.adm-list-num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #555;
  letter-spacing: 0.1em;
}
.adm-list-main {
  cursor: pointer;
  min-width: 0;
}
.adm-list-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 2px;
}
.adm-list-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #777;
  letter-spacing: 0.04em;
}
.adm-list-actions {
  display: flex;
  gap: 6px;
}
.adm-list-actions button {
  background: transparent;
  border: 1px solid #2a2a2a;
  color: #888;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  padding: 6px 10px;
  cursor: pointer;
  min-width: 28px;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease;
}
.adm-list-actions button:hover:not(:disabled) {
  color: #f0f0f0;
  border-color: #555;
  background: #181818;
}
.adm-list-actions button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.adm-empty {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #555;
  padding: 24px 0;
  text-align: center;
}

/* ─── archive rows ──────────────────────────────────────────────────── */

.adm-arc-row {
  display: grid;
  grid-template-columns: 80px 140px 1fr 80px 80px auto auto;
  gap: 8px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #1a1a1a;
}
.adm-current {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: #888;
  cursor: pointer;
  white-space: nowrap;
}
.adm-current input {
  accent-color: #f0f0f0;
}

/* ─── export tab ────────────────────────────────────────────────────── */

.adm-image {
  position: relative;
  background: #141414;
  border: 1px dashed #2a2a2a;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 200ms ease, background 200ms ease;
}
.adm-image.dragging {
  border-color: #f0f0f0;
  background: #1a1a1a;
}
.adm-image.has-image {
  cursor: default;
  border-style: solid;
}
.adm-image img,
.adm-image video,
.adm-image iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border: 0;
}
.adm-image-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #666;
  padding: 32px;
  text-align: center;
}
.adm-image-prompt {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  color: #888;
}
.adm-image-hint {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: #555;
}
.adm-image-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 6px;
  padding: 12px;
  opacity: 0;
  transition: opacity 200ms ease;
  background: linear-gradient(to top, rgba(0,0,0,0.55), transparent 40%);
}
.adm-image:hover .adm-image-overlay {
  opacity: 1;
}
.adm-image-overlay button {
  background: rgba(10,10,10,0.85);
  color: #f0f0f0;
  border: 1px solid rgba(255,255,255,0.3);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  padding: 8px 12px;
  cursor: pointer;
  transition: background 180ms ease;
}
.adm-image-overlay button:hover { background: rgba(255,255,255,0.15); }
.adm-image-row {
  margin-top: 6px;
}

.adm-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}
.adm-gallery-item {
  display: flex;
  flex-direction: column;
}

/* ─── export tab ────────────────────────────────────────────────────── */

.adm-help {
  background: #141414;
  border: 1px solid #2a2a2a;
  padding: 16px 20px;
  font-family: var(--font-display);
  font-size: 14px;
  line-height: 1.5;
  color: #ccc;
}
.adm-help code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: #222;
  padding: 2px 6px;
  border-radius: 2px;
  color: #f0f0f0;
}
.adm-help p { margin: 0; }

.adm-export {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  min-height: 400px;
  background: #0a0a0a;
  white-space: pre;
}
