:root {
  --ink: #122132;
  --ink-soft: #34465b;
  --bg-1: #f2f7ff;
  --bg-2: #dfecff;
  --accent: #0f6ab8;
  --accent-2: #5eb9ff;
  --panel: rgba(255, 255, 255, 0.78);
  --line: rgba(12, 38, 66, 0.18);
  --warn: #9a5a00;
  --ok: #116c2f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  background: linear-gradient(145deg, var(--bg-1), var(--bg-2));
}

.backdrop {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 90% 0%, rgba(94, 185, 255, 0.38), transparent 40%),
    radial-gradient(circle at 0% 100%, rgba(15, 106, 184, 0.25), transparent 46%);
  pointer-events: none;
}

.app-shell {
  position: relative;
  z-index: 1;
  max-width: 1150px;
  margin: 0 auto;
  padding: 1rem;
}

.topbar {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  backdrop-filter: blur(4px);
  box-shadow: 0 14px 30px rgba(10, 40, 72, 0.13);
  padding: 0.85rem 1rem;
  position: relative;
  z-index: 100;
}

h1 {
  margin: 0;
  font-size: clamp(1.4rem, 3.8vw, 2.2rem);
}

.subhead {
  margin: 0.3rem 0 0;
  color: var(--ink-soft);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding-block: 2rem;
}

.login-panel {
  width: min(880px, calc(100vw - 2rem));
  padding: clamp(1.1rem, 2.5vw, 1.8rem);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(244, 249, 255, 0.88)),
    radial-gradient(circle at top right, rgba(94, 185, 255, 0.2), transparent 42%);
  backdrop-filter: blur(10px);
  box-shadow: 0 24px 60px rgba(10, 40, 72, 0.16);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.95fr);
  gap: clamp(1.25rem, 3vw, 2.5rem);
  align-items: stretch;
}

.login-panel-loading {
  width: min(640px, calc(100vw - 2rem));
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
}

.login-hero {
  position: relative;
  padding: clamp(1rem, 2.5vw, 1.5rem);
  border-radius: 24px;
  background:
    radial-gradient(circle at top left, rgba(94, 185, 255, 0.24), transparent 34%),
    linear-gradient(160deg, rgba(11, 46, 80, 0.96), rgba(15, 106, 184, 0.88));
  color: #f7fbff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100%;
  overflow: hidden;
}

.login-hero::after {
  content: '';
  position: absolute;
  inset: auto -4rem -4rem auto;
  width: 11rem;
  height: 11rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.login-copy-block {
  position: relative;
  z-index: 1;
}

.login-kicker {
  margin: 0 0 0.65rem;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.login-panel h1 {
  margin: 0;
  font-size: clamp(2.3rem, 5vw, 3.6rem);
  line-height: 0.95;
}

.login-subhead {
  margin-top: 0.85rem;
  font-size: clamp(1.05rem, 2vw, 1.4rem);
  color: inherit;
}

.login-copy {
  margin: 1rem 0 0;
  max-width: 28rem;
  color: rgba(247, 251, 255, 0.82);
  line-height: 1.6;
}

.login-board {
  position: relative;
  z-index: 1;
  margin-top: 1.4rem;
  min-height: 240px;
  border-radius: 20px;
  padding: 1.1rem 1rem 1rem;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.login-board-tape {
  position: absolute;
  top: -10px;
  width: 72px;
  height: 20px;
  background: rgba(245, 232, 179, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(2px);
}

.login-board-tape-left {
  left: 20px;
  transform: rotate(-9deg);
}

.login-board-tape-right {
  right: 28px;
  transform: rotate(11deg);
}

.login-polaroid {
  position: absolute;
  width: 142px;
  background: #fdfcf8;
  color: #18324b;
  border-radius: 6px;
  padding: 0.45rem 0.45rem 0.8rem;
  box-shadow: 0 14px 26px rgba(3, 16, 28, 0.24);
}

.login-polaroid span {
  display: block;
  margin-top: 0.45rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-polaroid-large {
  top: 20px;
  left: 18px;
  transform: rotate(-7deg);
}

.login-polaroid-tilt-right {
  top: 16px;
  right: 26px;
  transform: rotate(8deg);
}

.login-polaroid-tilt-left {
  bottom: 10px;
  left: 126px;
  transform: rotate(-5deg);
}

.login-photo {
  height: 110px;
  border-radius: 3px;
  background-size: cover;
  background-position: center;
}

.login-photo-one {
  background:
    radial-gradient(circle at 30% 35%, rgba(255, 216, 123, 0.9), transparent 18%),
    linear-gradient(160deg, #8f4f1f 0%, #d58f3a 36%, #f7d694 36%, #7bb0cf 100%);
}

.login-photo-two {
  background:
    radial-gradient(circle at 50% 55%, rgba(255, 220, 120, 0.95), transparent 16%),
    radial-gradient(circle at 28% 54%, rgba(255, 179, 71, 0.92), transparent 14%),
    radial-gradient(circle at 72% 54%, rgba(255, 179, 71, 0.92), transparent 14%),
    linear-gradient(180deg, #22384f, #385874 48%, #ece7d4 48%, #b98b46 100%);
}

.login-photo-three {
  background:
    radial-gradient(circle at 24% 42%, rgba(255, 220, 143, 0.75), transparent 12%),
    radial-gradient(circle at 60% 46%, rgba(255, 220, 143, 0.75), transparent 11%),
    linear-gradient(155deg, #48667d 0%, #8ac1d9 42%, #eef3e8 42%, #748f58 100%);
}

.login-note-card {
  position: absolute;
  right: 138px;
  bottom: 18px;
  width: 138px;
  min-height: 124px;
  padding: 0.9rem 0.9rem 0.75rem;
  border-radius: 4px;
  background: linear-gradient(180deg, #fff0a6, #ffe57d);
  color: #554100;
  box-shadow: 0 16px 24px rgba(6, 20, 32, 0.18);
  transform: rotate(3deg);
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}

.login-note-card strong {
  font-size: 0.86rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-note-card span {
  font-size: 0.92rem;
  font-weight: 700;
}

.login-mark {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.08));
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: #fff;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
  margin-bottom: 1.1rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.95rem;
  padding: clamp(0.75rem, 1.8vw, 1rem);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(240, 247, 255, 0.9));
  border: 1px solid rgba(12, 38, 66, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 12px 30px rgba(10, 40, 72, 0.07);
}

.login-form-head {
  margin-bottom: 0.15rem;
}

.login-form-kicker {
  margin: 0 0 0.35rem;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.login-form-title {
  margin: 0;
  font-size: 1.55rem;
  line-height: 1.05;
}

.login-form-copy {
  margin: 0.45rem 0 0;
  color: var(--ink-soft);
  line-height: 1.5;
}

.login-field {
  margin-bottom: 0;
}

.login-field label {
  margin-bottom: 0.42rem;
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.login-field input {
  min-height: 58px;
  border-radius: 16px;
  border: 1px solid rgba(12, 38, 66, 0.14);
  background: rgba(255, 255, 255, 0.86);
  padding: 0.95rem 1rem;
  font-size: 1.05rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 6px 18px rgba(10, 40, 72, 0.06);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.login-field input:focus {
  outline: none;
  border-color: rgba(15, 106, 184, 0.72);
  box-shadow: 0 0 0 4px rgba(15, 106, 184, 0.14), 0 10px 22px rgba(10, 40, 72, 0.1);
  background: rgba(255, 255, 255, 0.98);
}

.login-field input:-webkit-autofill,
.login-field input:-webkit-autofill:hover,
.login-field input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink);
  box-shadow: 0 0 0 1000px rgba(255, 255, 255, 0.94) inset, 0 10px 22px rgba(10, 40, 72, 0.08);
  transition: background-color 9999s ease-out 0s;
  caret-color: var(--ink);
}

.login-actions {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 0.2rem;
}

.login-submit {
  min-width: 180px;
  min-height: 52px;
  border-radius: 999px;
  padding: 0.9rem 1.35rem;
  box-shadow: 0 14px 26px rgba(15, 106, 184, 0.24);
}

.login-side-note {
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.45;
}

.login-error {
  grid-column: 2;
  margin: 0;
  padding: 0.8rem 0.9rem;
  border-radius: 14px;
  background: rgba(255, 240, 219, 0.9);
  border: 1px solid rgba(154, 90, 0, 0.22);
}

@media (max-width: 760px) {
  .login-panel,
  .login-panel-loading {
    grid-template-columns: 1fr;
  }

  .login-hero {
    min-height: unset;
  }

  .login-board {
    min-height: 420px;
  }

  .login-polaroid-large {
    top: 18px;
    left: 18px;
  }

  .login-polaroid-tilt-right {
    top: 26px;
    right: 18px;
  }

  .login-note-card {
    right: 26px;
    bottom: 34px;
  }

  .login-polaroid-tilt-left {
    left: 34px;
    bottom: 28px;
  }

  .login-error {
    grid-column: auto;
  }

  .login-submit {
    width: 100%;
  }
}

.controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.controls input {
  width: 80px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0.35rem 0.5rem;
}

button {
  border: none;
  border-radius: 10px;
  padding: 0.5rem 0.85rem;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
}

button:hover:not(.nav-btn) {
  transform: translateY(-1px);
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.viewer {
  margin-top: 0.95rem;
  position: relative;
}

.viewer:fullscreen {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  max-width: none;
  gap: 0;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  background: #000;
  z-index: 9999;
  display: flex;
  flex-direction: column;
}

.viewer:fullscreen .nav-btn {
  width: 44px;
  height: 44px;
  font-size: 1.35rem;
  opacity: 0.78;
  background: rgba(8, 16, 28, 0.42);
}

.viewer:fullscreen .fullscreen-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(15, 106, 184, 0.45);
}

.viewer:fullscreen .stage {
  flex: 1;
  border: none;
  border-radius: 0;
  min-height: 100%;
  max-height: 100%;
  background: #000;
  overflow: hidden;
}

.nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  padding: 0;
  min-width: 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(8, 16, 28, 0.28);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(1px);
  opacity: 0.9;
  transition: opacity 0.18s ease, background-color 0.18s ease;
  z-index: 20;
}

.stage:hover .nav-btn,
.stage:focus-within .nav-btn {
  opacity: 1;
}

.nav-btn:hover {
  transform: translateY(-50%);
  background: rgba(8, 16, 28, 0.55);
}

.nav-btn:focus-visible {
  transform: translateY(-50%);
}

.nav-prev {
  left: 0.7rem;
}

.nav-next {
  right: 0.7rem;
}

.fullscreen-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  transform: none;
  width: 42px;
  height: 42px;
  min-width: unset;
  font-size: 1.15rem;
  line-height: 1;
  background: rgba(15, 106, 184, 0.72);
  opacity: 0.88;
  transition: opacity 0.2s ease, transform 0.2s ease;
  padding: 0;
  z-index: 30;
  border-radius: 999px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.22);
}

.fullscreen-btn:hover {
  opacity: 1;
  transform: none;
}

.stage-top-controls {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  z-index: 30;
  background: rgba(4, 12, 22, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  padding: 0.18rem;
  backdrop-filter: blur(3px);
}

.stage-top-btn {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.18);
  color: #f8fbff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.22);
  padding: 0;
}

.stage-top-btn-icon {
  display: inline-block;
  font-size: 1.08rem;
  line-height: 1;
  font-weight: 800;
}

.stage-top-btn:hover {
  background: rgba(255, 255, 255, 0.35);
  color: #fff;
}

.stage-favorite-btn {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.5);
  color: #d7e2f2;
}

.stage-favorite-btn:hover,
.stage-favorite-btn.is-open {
  background: linear-gradient(120deg, #a16207, #eab308);
  border-color: rgba(161, 98, 7, 0.65);
  color: #fff;
}

.stage-pin-btn {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.5);
  color: #d7e2f2;
}

.stage-pin-btn:hover,
.stage-pin-btn.is-open {
  background: linear-gradient(120deg, #334155, #64748b);
  border-color: rgba(51, 65, 85, 0.8);
  color: #fff;
}

.stage {
  position: relative;
}

.stage {
  margin: 0;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.84);
  overflow: hidden;
  min-height: 70vh;
  height: clamp(420px, 74vh, 900px);
  display: flex;
  flex-direction: column;
}

.stage.stage-is-new {
  border-color: rgba(16, 185, 129, 0.9);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.35), 0 10px 24px rgba(16, 185, 129, 0.16);
}

.stage-new-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding: 0 0.65rem;
  border-radius: 999px;
  border: 2px solid rgba(16, 185, 129, 0.75);
  background: linear-gradient(120deg, #10b981, #34d399);
  color: #052e25;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.stage img {
  width: 100%;
  height: 100%;
  flex: 1 1 auto;
  min-height: 0;
  object-fit: contain;
  object-position: center center;
  background: linear-gradient(180deg, #f8fbff, #edf4ff);
}

.viewer:fullscreen .stage img {
  width: 100%;
  height: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center center;
  background: #000;
}

.slide-caption {
  position: static;
  padding: 0.6rem 0.75rem;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  overflow-wrap: anywhere;
}

.viewer:fullscreen .slide-caption {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.85));
  color: #fff;
  border: none;
  padding: 1rem;
}

.caption-title {
  color: var(--ink);
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.viewer:fullscreen .caption-title {
  color: #fff;
}

.caption-desc {
  margin-bottom: 0.35rem;
}

.caption-location {
  color: var(--ink-soft);
}

.viewer:fullscreen .caption-desc {
  color: #ccc;
}

.caption-meta {
  font-size: 0.9rem;
}

.caption-contributor {
  color: var(--accent);
  font-style: italic;
}

.viewer:fullscreen .caption-meta {
  color: #999;
}

.exif-row {
  margin-top: 0.45rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.exif-chip {
  display: inline-block;
  font-size: 0.82rem;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
  background: rgba(255, 255, 255, 0.72);
}

.viewer:fullscreen .exif-chip {
  background: rgba(50, 50, 50, 0.9);
  border-color: rgba(255, 255, 255, 0.2);
  color: #f0f0f0;
}

.panel-grid {
  margin-top: 0.8rem;
  display: grid;
  gap: 0.8rem;
  grid-template-columns: 1fr;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  padding: 0.75rem;
}

.panel h2 {
  margin: 0 0 0.4rem;
}

.manager-bar {
  margin-top: 0.8rem;
}

.manager-bar-compact {
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
}

.manager-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.manager-hint {
  margin-top: 0;
  font-size: 0.84rem;
}

.manager-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.manager-toggle input {
  accent-color: var(--accent);
}

.manager-tag-filter,
.manager-sort {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--ink);
  font: inherit;
  font-size: 0.86rem;
  padding: 0.35rem 0.7rem;
}

.manager-tag-filter {
  min-width: 180px;
}

.manager-btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  font-size: 0.84rem;
  padding: 0.35rem 0.7rem;
  font-weight: 600;
}

.manager-btn:hover {
  background: rgba(255, 255, 255, 0.98);
  transform: none;
}

.manager-link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.manager-active-filters {
  margin-top: 0.55rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.manager-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.16rem 0.5rem;
}

.manager-clear-btn {
  padding: 0.22rem 0.65rem;
}

.small-note {
  margin-top: 0.5rem;
  color: var(--ink-soft);
}

.user-note {
  margin: 0;
  color: var(--ink-soft);
}

/* ── User dropdown menu ── */
.user-menu {
  position: relative;
}

.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255,255,255,0.55) !important;
  border: 1px solid var(--line) !important;
  border-radius: 999px !important;
  padding: 0.3rem 0.7rem 0.3rem 0.3rem !important;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--ink) !important;
  font-weight: 600;
  transition: background 0.15s;
  transform: none !important;
}
.user-menu-trigger:hover {
  background: rgba(255,255,255,0.85) !important;
  transform: none !important;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent) !important;
  color: #fff !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
  line-height: 1;
}
.user-avatar.lg {
  width: 46px;
  height: 46px;
  font-size: 1.25rem;
}

.user-menu-name {
  font-weight: 600;
  white-space: nowrap;
}

.user-chevron {
  transition: transform 0.18s;
  opacity: 0.6;
}
.user-chevron.open {
  transform: rotate(180deg);
}

.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(10,40,72,0.18);
  z-index: 200;
  overflow: hidden;
  padding: 0.5rem 0;
}

.user-menu-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 1rem;
}

.user-menu-fullname {
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
}

.user-menu-sep {
  border: none;
  border-top: 1px solid var(--line);
  margin: 0.25rem 0;
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.6rem 1rem;
  background: none !important;
  border: none !important;
  border-radius: 0 !important;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--ink) !important;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  transition: background 0.12s;
  transform: none !important;
}
.user-menu-item:hover {
  background: var(--bg-1) !important;
  transform: none !important;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(8, 16, 28, 0.38);
}

.password-modal {
  width: min(460px, 96vw);
  border-radius: 14px;
  box-shadow: 0 20px 40px rgba(10, 40, 72, 0.25);
}

.password-modal h3 {
  margin: 0 0 0.8rem;
}

.password-error {
  margin: 0.35rem 0 0;
}

.password-modal-actions {
  margin-top: 0.8rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.upload-field {
  margin-bottom: 0.5rem;
}

.upload-field label {
  display: block;
  margin-bottom: 0.2rem;
  font-weight: 600;
}

.upload-field input,
.upload-field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0.45rem 0.55rem;
  font: inherit;
}

.upload-field textarea {
  resize: vertical;
  min-height: 80px;
}

.image-actions {
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.action-group {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.action-group + .action-group {
  border-left: 1px solid var(--line);
  padding-left: 0.6rem;
}

.interval-select {
  appearance: none;
  -webkit-appearance: none;
  background: rgba(255,255,255,0.55) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2334465b'/%3E%3C/svg%3E") no-repeat right 0.5rem center / 10px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 1.75rem 0.35rem 0.85rem;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: background-color 0.15s;
  min-width: 52px;
}
.interval-select:hover {
  background-color: rgba(255,255,255,0.85);
}
.interval-select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.action-btn {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 9px;
  padding: 0.3rem 0.75rem;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
}

.action-btn:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-1px);
}

.exif-icon-btn {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 999px;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  border: 2px solid rgba(13, 90, 156, 0.65);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(10, 40, 72, 0.22);
}

.exif-icon-btn:hover {
  background: linear-gradient(120deg, #0d5a9c, #3d9ce6);
  color: #ffffff;
}

.exif-icon-btn.is-open {
  box-shadow: 0 0 0 2px rgba(15, 106, 184, 0.25), 0 2px 8px rgba(10, 40, 72, 0.22);
}

.download-btn {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 999px;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  border: 2px solid rgba(13, 90, 156, 0.65);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(10, 40, 72, 0.22);
  text-decoration: none;
  flex-shrink: 0;
}
.download-btn:hover {
  background: linear-gradient(120deg, #0d5a9c, #3d9ce6);
  color: #ffffff;
  transform: translateY(-1px);
}

.favorite-icon-btn,
.restore-icon-btn,
.pin-icon-btn,
.queue-icon-btn {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 999px;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(10, 40, 72, 0.22);
}

.favorite-icon-btn {
  background: linear-gradient(120deg, #ca8a04, #facc15);
  border: 2px solid rgba(146, 90, 0, 0.55);
}

.favorite-icon-btn:hover,
.favorite-icon-btn.is-open {
  background: linear-gradient(120deg, #a16207, #eab308);
  color: #ffffff;
}

.restore-icon-btn {
  background: linear-gradient(120deg, #0f6ab8, #5eb9ff);
  border: 2px solid rgba(13, 90, 156, 0.65);
}

.restore-icon-btn:hover {
  background: linear-gradient(120deg, #0d5a9c, #3d9ce6);
  color: #ffffff;
}

.pin-icon-btn {
  background: linear-gradient(120deg, #475569, #94a3b8);
  border: 2px solid rgba(51, 65, 85, 0.55);
}

.pin-icon-btn:hover,
.pin-icon-btn.is-open {
  background: linear-gradient(120deg, #334155, #64748b);
  color: #ffffff;
}

.queue-icon-btn {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  border: 2px solid rgba(13, 90, 156, 0.65);
}

.queue-icon-btn:hover,
.queue-icon-btn.is-open {
  background: linear-gradient(120deg, #0d5a9c, #3d9ce6);
  color: #ffffff;
}

.queue-icon-btn.is-open {
  box-shadow: 0 0 0 2px rgba(15, 106, 184, 0.25), 0 2px 8px rgba(10, 40, 72, 0.22);
}

.pin-move-btn {
  min-width: 34px;
  height: 34px;
  border-radius: 999px;
  padding: 0;
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink);
  border: 1px solid var(--line);
}

.pin-move-btn:hover {
  background: rgba(255, 255, 255, 0.98);
  color: var(--ink);
  transform: none;
}

.upload-icon-btn {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 999px;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  border: 2px solid rgba(13, 90, 156, 0.65);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(10, 40, 72, 0.22);
}
.upload-icon-btn:hover {
  background: linear-gradient(120deg, #0d5a9c, #3d9ce6);
  color: #ffffff;
}
.upload-icon-btn.is-open {
  box-shadow: 0 0 0 2px rgba(15, 106, 184, 0.25), 0 2px 8px rgba(10, 40, 72, 0.22);
}

.edit-icon-btn {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 999px;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  border: 2px solid rgba(13, 90, 156, 0.65);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(10, 40, 72, 0.22);
}

.edit-icon-btn:hover {
  background: linear-gradient(120deg, #0d5a9c, #3d9ce6);
  border-color: rgba(13, 90, 156, 0.8);
  color: #ffffff;
}

.edit-icon-btn.is-open {
  background: linear-gradient(120deg, #0d5a9c, #3d9ce6);
  border-color: rgba(13, 90, 156, 0.9);
  color: #ffffff;
  box-shadow: 0 0 0 2px rgba(15, 106, 184, 0.25), 0 2px 8px rgba(10, 40, 72, 0.22);
}

.delete-icon-btn {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 999px;
  background: linear-gradient(120deg, #b91c1c, #ef4444);
  border: 2px solid rgba(120, 10, 10, 0.55);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(120, 10, 10, 0.22);
}
.delete-icon-btn:hover {
  background: linear-gradient(120deg, #991b1b, #dc2626);
  color: #ffffff;
  transform: translateY(-1px);
}
.delete-icon-btn.is-open {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.3), 0 2px 8px rgba(120, 10, 10, 0.22);
}

.confirm-strip {
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: center;
  background: rgba(254, 226, 226, 0.85);
  border: 1px solid rgba(185, 28, 28, 0.25);
  border-radius: 10px;
  padding: 0.55rem 0.9rem;
  animation: slideDown 0.15s ease;
}

.confirm-strip-text {
  font-size: 0.92rem;
  color: #7f1d1d;
  flex: 1 1 auto;
  min-width: 0;
}

.confirm-strip-yes {
  background: linear-gradient(120deg, #b91c1c, #ef4444) !important;
  border: 2px solid rgba(120, 10, 10, 0.4) !important;
  color: #fff !important;
  border-radius: 999px !important;
  padding: 0.3rem 0.85rem !important;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  white-space: nowrap;
  transform: none !important;
}
.confirm-strip-yes:hover {
  background: linear-gradient(120deg, #991b1b, #dc2626) !important;
  transform: none !important;
}
.confirm-strip-yes:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.confirm-strip-cancel {
  background: rgba(255,255,255,0.7) !important;
  border: 1px solid var(--line) !important;
  color: var(--ink) !important;
  border-radius: 999px !important;
  padding: 0.3rem 0.85rem !important;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  white-space: nowrap;
  transform: none !important;
}
.confirm-strip-cancel:hover {
  background: rgba(255,255,255,0.95) !important;
  transform: none !important;
}
.confirm-strip-cancel:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.edit-drawer,
.exif-panel {
  margin-top: 0.6rem;
  animation: slideDown 0.18s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.edit-drawer h3,
.exif-panel h3 {
  margin: 0 0 0.6rem;
  font-size: 1rem;
}

.exif-panel {
  overflow-x: auto;
}

.exif-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.exif-table th,
.exif-table td {
  text-align: left;
  padding: 0.3rem 0.5rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.exif-table th {
  width: 38%;
  color: var(--ink-soft);
  font-weight: 600;
  white-space: nowrap;
}

.exif-table td {
  overflow-wrap: anywhere;
}

.exif-empty {
  color: var(--ink-soft);
  font-style: italic;
  margin: 0;
}

.queue-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 360px;
  overflow-y: auto;
}

.queue-manager {
  margin-top: 0.8rem;
}

.queue-manager-controls {
  margin-top: 0.35rem;
  padding: 0.5rem 0.55rem;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.42);
}

.queue-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.queue-bulk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.5rem 0 0.65rem;
}

.queue-bulk-actions button {
  border-radius: 999px;
  padding: 0.34rem 0.72rem;
  font-size: 0.82rem;
}

.queue-item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 0.55rem;
  align-items: center;
  border-bottom: 1px dashed var(--line);
  padding: 0.4rem 0;
}

.queue-select {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.queue-main {
  min-width: 0;
}

.queue-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.queue-meta {
  color: var(--ink-soft);
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}

.queue-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.08rem 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
}

.queue-badge.trash {
  background: rgba(254, 226, 226, 0.8);
  border-color: rgba(185, 28, 28, 0.25);
  color: #7f1d1d;
}

.queue-badge.favorite {
  background: rgba(254, 240, 138, 0.8);
  border-color: rgba(161, 98, 7, 0.25);
  color: #713f12;
}

.queue-badge.pin {
  background: rgba(226, 232, 240, 0.85);
  border-color: rgba(71, 85, 105, 0.25);
  color: #334155;
}

.queue-row-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.queue-mini-btn {
  border-radius: 999px;
  padding: 0.22rem 0.62rem;
  font-size: 0.78rem;
  font-weight: 700;
}

.queue-mini-icon-btn {
  min-width: 42px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem;
}

.queue-icon {
  line-height: 1;
  font-size: 1rem;
}

.queue-mini-favorite-btn {
  background: rgba(255, 255, 255, 0.82);
  color: #7c5a00;
  border: 1px solid rgba(161, 98, 7, 0.28);
}

.queue-mini-favorite-btn:hover,
.queue-mini-favorite-btn.is-open {
  background: linear-gradient(120deg, #ca8a04, #facc15);
  color: #ffffff;
  border-color: rgba(146, 90, 0, 0.5);
}

.queue-mini-btn.danger {
  background: linear-gradient(120deg, #b91c1c, #ef4444);
  color: #fff;
}

.queue-mini-btn.danger:hover {
  background: linear-gradient(120deg, #991b1b, #dc2626);
}

.trash-panel {
  margin-top: 0.8rem;
}

.trash-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.55rem;
}

.trash-panel .queue-item {
  grid-template-columns: 1fr auto;
}

.warn {
  color: var(--warn);
}

.ok {
  color: var(--ok);
}

/* ── Star ratings (stage top-controls pill) ── */
.stage-rating-row {
  display: inline-flex;
  align-items: center;
  gap: 0;
  margin-left: -0.08rem;
}

.stage-rating-btn {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.28);
  font-size: 0.86rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: color 0.12s, background 0.12s;
  box-shadow: none;
}

.stage-rating-btn:hover {
  color: #fbbf24;
  background: rgba(255, 255, 255, 0.08);
}

.stage-rating-btn.is-on {
  color: #f5c518;
}

/* ── Star ratings (queue row) ── */
.queue-row-stars {
  display: inline-flex;
  align-items: center;
  gap: 0;
}

.queue-star-btn {
  width: 22px;
  height: 22px;
  padding: 0;
  background: transparent;
  border: none;
  color: #c9a807;
  font-size: 0.88rem;
  cursor: pointer;
  opacity: 0.3;
  line-height: 1;
  border-radius: 3px;
  transition: opacity 0.12s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.queue-star-btn:hover,
.queue-star-btn.is-on {
  opacity: 1;
  transform: none;
}

.queue-badge.rating {
  background: rgba(254, 240, 138, 0.8);
  border-color: rgba(161, 98, 7, 0.25);
  color: #713f12;
  letter-spacing: 0.02em;
}

/* ── Caption rating display ── */
.caption-rating {
  margin-top: 0.2rem;
  font-size: 0.82rem;
  color: #92510a;
}

.viewer:fullscreen .caption-rating {
  color: #fbbf24;
}

/* ── Caption themes ── */
.slide-caption-theme-contrast {
  background: rgba(8, 16, 28, 0.88) !important;
  color: #e5eeff !important;
  border-top-color: transparent !important;
}

.slide-caption-theme-contrast .caption-title {
  color: #fff !important;
}

.slide-caption-theme-contrast .caption-meta,
.slide-caption-theme-contrast .caption-desc,
.slide-caption-theme-contrast .caption-location {
  color: #9db4d4 !important;
}

.slide-caption-theme-warm {
  background: rgba(255, 248, 230, 0.96) !important;
  border-top-color: rgba(180, 120, 30, 0.2) !important;
  color: #5c3a0e !important;
}

.slide-caption-theme-warm .caption-title {
  color: #7c460c !important;
}

.slide-caption-theme-warm .caption-meta,
.slide-caption-theme-warm .caption-location {
  color: #9a6020 !important;
}

.slide-caption-theme-warm .caption-rating {
  color: #a05c00;
}

/* ── Batch metadata editor ── */
.batch-editor {
  margin: 0.5rem 0 0.65rem;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.42);
}

.batch-editor-summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink);
  border-radius: 12px;
  user-select: none;
}

.batch-editor-summary::-webkit-details-marker { display: none; }

.batch-editor-summary::before {
  content: '▶';
  font-size: 0.65rem;
  color: var(--ink-soft);
  flex-shrink: 0;
  transition: transform 0.15s;
}

details[open] > .batch-editor-summary::before {
  transform: rotate(90deg);
}

.batch-editor-hint {
  color: var(--ink-soft);
  font-weight: 400;
  font-size: 0.82rem;
}

.batch-editor-body {
  padding: 0.65rem 0.75rem 0.75rem;
  border-top: 1px solid var(--line);
}

.batch-editor-fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.55rem;
}

.batch-editor-field {
  margin-bottom: 0;
}

.batch-editor-apply {
  margin-top: 0.65rem;
  border-radius: 999px;
  padding: 0.4rem 1rem;
  font-size: 0.88rem;
}

/* ── Schedule mode controls ── */
.queue-schedule-row {
  margin-top: 0.45rem;
  padding: 0.45rem 0.55rem;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.32);
}

.manager-time {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--ink);
  font: inherit;
  font-size: 0.86rem;
  padding: 0.3rem 0.7rem;
}

/* ── Duplicate groups panel ── */
.dupes-panel {
  margin-top: 0.8rem;
}

.dupe-group {
  margin-top: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.dupe-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.55);
  border-bottom: 1px solid var(--line);
}

.dupe-group-label {
  font-size: 0.84rem;
  color: var(--ink-soft);
  font-weight: 600;
}

.dupe-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dupe-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.38rem 0.75rem;
  border-bottom: 1px dashed var(--line);
  flex-wrap: wrap;
}

.dupe-item:last-child {
  border-bottom: none;
}

.dupe-item-keep {
  background: rgba(16, 185, 129, 0.06);
}

.dupe-item-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.06rem 0.45rem;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(226, 232, 240, 0.8);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  flex-shrink: 0;
}

.dupe-item-keep .dupe-item-badge {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.45);
  color: #065f46;
}

.dupe-item-name {
  font-size: 0.9rem;
  font-weight: 600;
  flex: 1 1 160px;
  overflow-wrap: anywhere;
}

.dupe-item-meta {
  font-size: 0.76rem;
  color: var(--ink-soft);
  flex: 2 1 200px;
  overflow-wrap: anywhere;
}

@media (max-width: 860px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .nav-btn {
    width: 38px;
    height: 38px;
    opacity: 0.85;
  }

  .panel-grid {
    grid-template-columns: 1fr;
  }

  .action-group + .action-group {
    border-left: 0;
    padding-left: 0;
  }

  .queue-manager-controls .manager-tag-filter {
    min-width: 100%;
  }
}
