/* Pawfolio Studio — administration */
.admin-page {
  min-height: 100vh;
  background:
    radial-gradient(900px 500px at 100% 0%, rgba(223, 230, 217, 0.52), transparent 68%),
    radial-gradient(700px 480px at 0% 100%, rgba(242, 221, 206, 0.4), transparent 62%),
    #efeae0;
}

.wordmark--light .wordmark__mark {
  color: var(--ink);
  background: var(--cream);
}

.wordmark--light .wordmark__copy strong {
  color: var(--cream);
}

.wordmark--light .wordmark__copy span {
  color: rgba(255, 250, 242, 0.47);
}

/* ---------- login ---------- */
.login-view {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: clamp(14px, 3vw, 38px);
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(400px, 0.98fr);
  width: min(1120px, 100%);
  min-height: min(700px, calc(100vh - clamp(28px, 6vw, 76px)));
  overflow: hidden;
  background: var(--cream);
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 34px;
  box-shadow: 0 40px 90px -50px rgba(42, 33, 20, 0.72);
}

.login-visual {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 630px;
  overflow: hidden;
  padding: clamp(25px, 3vw, 36px);
  color: var(--cream);
  background: #27342c;
}

.login-visual__photo {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 42%;
  filter: saturate(0.82) contrast(0.98);
  transform: scale(1.015);
  transition: transform 8s var(--ease);
}

.login-visual:hover .login-visual__photo {
  transform: scale(1.055);
}

.login-visual__veil {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(24, 31, 26, 0.8) 0%, rgba(26, 30, 25, 0.07) 37%, rgba(20, 26, 22, 0.9) 100%),
    linear-gradient(90deg, rgba(26, 36, 30, 0.33), transparent 60%);
}

.login-visual__top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.login-visual__badge {
  padding: 7px 10px;
  border: 1px solid rgba(255, 250, 242, 0.24);
  border-radius: 999px;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: rgba(255, 250, 242, 0.7);
  white-space: nowrap;
}

.login-visual__quote {
  position: relative;
  z-index: 1;
  max-width: 420px;
}

.login-visual__quote p {
  font-family: var(--serif);
  font-size: clamp(28px, 3.25vw, 42px);
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: -0.025em;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.2);
}

.login-visual__quote span {
  display: block;
  margin-top: 21px;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: rgba(255, 250, 242, 0.53);
}

.login-panel {
  display: grid;
  place-items: center;
  padding: clamp(34px, 5vw, 64px);
  background:
    radial-gradient(500px 300px at 100% 0%, rgba(242, 221, 206, 0.3), transparent 65%),
    var(--cream);
}

.login-form-wrap {
  width: min(100%, 354px);
}

.login-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.22em;
  color: var(--accent-deep);
}

.login-eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
}

.login-form-wrap h1 {
  margin-top: 17px;
  font-family: var(--serif);
  font-size: clamp(37px, 4vw, 48px);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.login-intro {
  margin-top: 14px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.85;
}

.login-form {
  display: grid;
  gap: 15px;
  margin-top: 29px;
}

.login-form .field > label {
  color: var(--ink-soft);
  letter-spacing: 0.04em;
}

.password-field {
  position: relative;
}

.password-field .input {
  height: 50px;
  padding-right: 64px;
  background: rgba(255, 255, 255, 0.9);
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 7px;
  min-height: 34px;
  padding: 0 10px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 10.5px;
  font-weight: 650;
  transform: translateY(-50%);
}

.password-toggle:hover {
  color: var(--ink);
  background: var(--paper);
}

.login-submit {
  width: 100%;
  min-height: 50px;
  margin-top: 3px;
}

.login-submit .icon {
  width: 16px;
  height: 16px;
}

.login-error {
  padding: 10px 12px;
  color: var(--danger);
  background: var(--danger-soft);
  border-radius: 9px;
  font-size: 12px;
  line-height: 1.55;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 26px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.back-link .icon {
  width: 13px;
  height: 13px;
  transition: transform 0.2s var(--ease);
}

.back-link:hover {
  color: var(--ink);
}

.back-link:hover .icon {
  transform: translateX(-3px);
}

/* ---------- admin shell ---------- */
.admin-app {
  display: grid;
  grid-template-columns: 262px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  padding: 25px 18px 19px;
  color: var(--cream);
  background:
    radial-gradient(520px 340px at 110% 110%, rgba(196, 93, 55, 0.23), transparent 68%),
    radial-gradient(460px 300px at -20% 25%, rgba(95, 112, 91, 0.35), transparent 65%),
    #243029;
}

.sidebar::after {
  content: "";
  position: absolute;
  top: 43%;
  right: -29px;
  width: 120px;
  height: 120px;
  border: 1px dashed rgba(255, 250, 242, 0.13);
  border-radius: 50%;
  pointer-events: none;
}

.sidebar-brand {
  display: block;
  padding: 4px 10px 26px;
  border-radius: 14px;
}

.sidebar-brand .wordmark__mark {
  width: 40px;
  height: 40px;
  color: var(--ink);
  background: var(--cream);
  border-radius: 13px 13px 13px 5px;
}

.sidebar-label {
  padding: 0 12px 10px;
  color: rgba(255, 250, 242, 0.33);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.side-nav {
  display: grid;
  gap: 5px;
}

.side-nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 45px;
  padding: 0 12px;
  color: rgba(255, 250, 242, 0.58);
  border-radius: 11px;
  font-size: 12px;
  font-weight: 600;
  transition:
    color 0.2s var(--ease),
    background 0.2s var(--ease);
}

.side-nav a .icon {
  width: 17px;
  height: 17px;
  opacity: 0.72;
}

.side-nav a:hover {
  color: var(--cream);
  background: rgba(255, 250, 242, 0.06);
}

.side-nav a.is-active {
  color: var(--cream);
  background: rgba(255, 250, 242, 0.1);
}

.side-nav a.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 2px;
  background: #e18b63;
  border-radius: 999px;
}

.sidebar-sync {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: auto;
  margin-bottom: 22px;
  padding: 14px 12px;
  border: 1px solid rgba(255, 250, 242, 0.1);
  border-radius: 13px;
  background: rgba(255, 250, 242, 0.04);
}

.sidebar-sync__dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  margin-top: 4px;
  background: #9bc3a5;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(155, 195, 165, 0.1);
}

.sidebar-sync strong {
  display: block;
  color: rgba(255, 250, 242, 0.76);
  font-size: 10.5px;
  font-weight: 650;
}

.sidebar-sync p {
  margin-top: 4px;
  color: rgba(255, 250, 242, 0.38);
  font-size: 9.5px;
  line-height: 1.55;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 7px 0;
  border-top: 1px solid rgba(255, 250, 242, 0.1);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.sidebar-user__avatar {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  color: var(--ink);
  background: var(--accent-soft);
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 600;
}

.sidebar-user strong {
  display: block;
  color: rgba(255, 250, 242, 0.8);
  font-size: 10.5px;
  font-weight: 650;
}

.sidebar-user span {
  display: block;
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(255, 250, 242, 0.34);
  font-size: 8.5px;
}

.sidebar-logout {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  color: rgba(255, 250, 242, 0.43);
  background: transparent;
  border: 1px solid rgba(255, 250, 242, 0.12);
  border-radius: 9px;
  transition:
    color 0.2s var(--ease),
    background 0.2s var(--ease);
}

.sidebar-logout .icon {
  width: 15px;
  height: 15px;
}

.sidebar-logout:hover {
  color: var(--cream);
  background: rgba(255, 250, 242, 0.08);
}

.admin-main {
  min-width: 0;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 18px;
  height: 74px;
  padding: 0 clamp(22px, 3.4vw, 48px);
  background: rgba(239, 234, 224, 0.87);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
}

.mobile-brand {
  display: none;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.mobile-brand .wordmark__mark {
  width: 34px;
  height: 34px;
  color: var(--cream);
  background: var(--ink);
  border-radius: 10px 10px 10px 4px;
}

.mobile-brand .icon {
  width: 19px;
  height: 19px;
}

.mobile-brand strong {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
}

.topbar-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 1px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.topbar-status__dot {
  width: 6px;
  height: 6px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(63, 118, 90, 0.09);
}

.topbar-status.is-saving .topbar-status__dot {
  background: var(--gold);
  animation: status-pulse 1s ease-in-out infinite;
}

.topbar-status.is-error .topbar-status__dot {
  background: var(--danger);
}

@keyframes status-pulse {
  50% {
    opacity: 0.4;
  }
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-left: auto;
}

.mobile-logout {
  display: none;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  transition:
    color 0.2s var(--ease),
    background 0.2s var(--ease);
}

.mobile-logout .icon {
  width: 15px;
  height: 15px;
}

.mobile-logout:hover {
  color: var(--ink);
  background: var(--cream);
}

.topbar-actions .btn {
  min-height: 38px;
  font-size: 11.5px;
}

.topbar-actions .btn .icon {
  width: 14px;
  height: 14px;
}

.admin-content {
  width: min(100%, 1340px);
  margin: 0 auto;
  padding: clamp(28px, 3.6vw, 46px) clamp(22px, 3.4vw, 48px) 58px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--accent-deep);
  font-size: 8.5px;
  font-weight: 750;
  letter-spacing: 0.21em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: currentColor;
}

.page-heading h1 {
  margin-top: 12px;
  font-family: var(--serif);
  font-size: clamp(40px, 4.4vw, 57px);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.page-heading p:last-child {
  max-width: 600px;
  margin-top: 11px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.75;
}

.page-heading__row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 29px;
}

.stat-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 13px;
  overflow: hidden;
  padding: 18px 17px 0;
  background: rgba(255, 250, 242, 0.82);
  border: 1px solid var(--line);
  border-radius: 19px;
  box-shadow: 0 8px 24px -24px rgba(54, 44, 31, 0.35);
}

.stat-card::after {
  content: "";
  position: absolute;
  top: -25px;
  right: -22px;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.05;
}

.stat-card__icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
}

.stat-card__icon .icon {
  width: 19px;
  height: 19px;
}

.stat-card > div:nth-child(2) {
  min-width: 0;
}

.stat-card strong {
  display: block;
  font-family: var(--serif);
  font-size: clamp(29px, 2.6vw, 37px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.03em;
}

.stat-card span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.stat-card > p {
  grid-column: 1 / -1;
  margin-top: 14px;
  padding: 10px 0 12px;
  border-top: 1px solid var(--line);
  color: var(--muted-light);
  font-size: 9px;
  line-height: 1.5;
}

.stat-card--accent {
  color: var(--accent);
}

.stat-card--accent .stat-card__icon {
  color: var(--accent-deep);
  background: var(--accent-soft);
}

.stat-card--sage {
  color: var(--sage);
}

.stat-card--sage .stat-card__icon {
  color: #4e654f;
  background: var(--sage-soft);
}

.stat-card--gold {
  color: var(--gold);
}

.stat-card--gold .stat-card__icon {
  color: #9b7522;
  background: #f3e8cb;
}

.stat-card--ink {
  color: var(--ink-soft);
}

.stat-card--ink .stat-card__icon {
  color: var(--cream);
  background: var(--ink);
}

/* ---------- panel and table ---------- */
.panel {
  margin-top: 21px;
  overflow: hidden;
  background: rgba(255, 250, 242, 0.88);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 15px 40px -35px rgba(54, 44, 31, 0.4);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 21px 23px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2 {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.025em;
}

.panel-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10.5px;
}

.panel-search {
  position: relative;
  width: min(100%, 265px);
  flex: 0 1 265px;
}

.panel-search .icon {
  position: absolute;
  top: 50%;
  left: 12px;
  width: 15px;
  height: 15px;
  color: var(--muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.panel-search input {
  width: 100%;
  height: 38px;
  padding: 0 13px 0 35px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  transition:
    border-color 0.2s var(--ease),
    background 0.2s var(--ease);
}

.panel-search input:focus {
  outline: none;
  background: #fff;
  border-color: var(--accent);
}

.pet-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

.admin-table th {
  padding: 12px 17px;
  color: var(--muted-light);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-align: left;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
}

.admin-table th:first-child,
.admin-table td:first-child {
  padding-left: 23px;
}

.admin-table th:last-child,
.admin-table td:last-child {
  padding-right: 23px;
}

.admin-table th:last-child {
  width: 88px;
  text-align: right;
}

.admin-table tbody tr {
  transition: background 0.18s var(--ease);
}

.admin-table tbody tr:hover {
  background: rgba(245, 240, 230, 0.62);
}

.admin-table td {
  padding: 13px 17px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  font-size: 11.5px;
}

.admin-table tbody tr:last-child td {
  border-bottom: 0;
}

.admin-table .table-loading td {
  padding: 42px 23px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

body.admin-overlay-open {
  overflow: hidden;
}

.pet-cell {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 170px;
}

.pet-cell__cover {
  position: relative;
  width: 43px;
  height: 50px;
  flex: 0 0 auto;
  overflow: hidden;
  background: var(--paper-deep);
  border-radius: 9px;
}

.pet-cell__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pet-cell__cover .icon {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 19px;
  height: 19px;
  color: var(--muted-light);
  transform: translate(-50%, -50%);
}

.pet-cell__copy {
  min-width: 0;
}

.pet-cell__name {
  display: flex;
  align-items: center;
  gap: 5px;
  max-width: 190px;
}

.pet-cell__name strong {
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.pet-cell__star {
  color: var(--gold);
  flex: 0 0 auto;
}

.pet-cell__star .icon {
  width: 12px;
  height: 12px;
}

.pet-cell__copy > span {
  display: block;
  max-width: 190px;
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 9.5px;
  text-overflow: ellipsis;
}

.species-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 25px;
  padding: 0 9px;
  color: var(--ink-soft);
  background: var(--paper);
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 600;
}

.info-cell {
  display: grid;
  gap: 3px;
  color: var(--ink-soft);
  font-size: 10.5px;
}

.info-cell span {
  color: var(--muted-light);
  font-size: 9px;
}

.table-photo-count {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 10.5px;
}

.table-photo-count .icon {
  width: 13px;
  height: 13px;
}

.updated-cell {
  display: grid;
  gap: 3px;
}

.updated-cell strong {
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 600;
}

.updated-cell span {
  color: var(--muted-light);
  font-size: 8.5px;
}

.row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.row-action {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  transition:
    color 0.2s var(--ease),
    background 0.2s var(--ease),
    border-color 0.2s var(--ease);
}

.row-action .icon {
  width: 14px;
  height: 14px;
}

.row-action:hover {
  color: var(--ink);
  background: var(--paper);
  border-color: var(--line);
}

.row-action--danger:hover {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: transparent;
}

.mobile-pet-list {
  display: none;
}

.admin-empty {
  display: grid;
  justify-items: center;
  padding: 64px 24px 68px;
  text-align: center;
}

.admin-empty__icon {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin-bottom: 17px;
  color: var(--accent-deep);
  background: var(--accent-soft);
  border-radius: 50%;
}

.admin-empty__icon .icon {
  width: 26px;
  height: 26px;
}

.admin-empty h2 {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.025em;
}

.admin-empty p {
  max-width: 360px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.75;
}

.admin-empty .btn {
  margin-top: 19px;
}

.admin-content__footnote {
  margin-top: 17px;
  color: var(--muted-light);
  font-size: 9.5px;
  line-height: 1.6;
  text-align: center;
}

/* ---------- group photos ---------- */
.panel-count {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-left: 7px;
  padding: 0 9px;
  color: var(--accent-deep);
  background: var(--accent-soft);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 650;
  letter-spacing: 0;
  vertical-align: middle;
}

.duo-panel .panel-head {
  background:
    radial-gradient(520px 180px at 96% -20%, rgba(223, 230, 217, 0.72), transparent 72%),
    rgba(255, 250, 242, 0.5);
}

.duo-create {
  padding: clamp(20px, 2.6vw, 30px) 23px;
  background: rgba(245, 240, 230, 0.4);
  border-bottom: 1px solid var(--line);
}

.duo-create__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.duo-create__mark {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  flex: 0 0 auto;
  color: var(--accent-deep);
  background: var(--accent-soft);
  border-radius: 9px;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
}

.duo-create__head h3,
.duo-library__head h3 {
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 550;
  letter-spacing: -0.02em;
}

.duo-create__head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.duo-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: end;
  gap: 12px;
  width: min(100%, 720px);
}

.duo-pair .field > label,
.duo-caption-field > label {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.04em;
}

.duo-pair .field > label small,
.duo-caption-field > label small {
  color: var(--muted-light);
  font-weight: 500;
}

.duo-pair__join {
  display: grid;
  place-items: center;
  width: 33px;
  height: 40px;
  color: var(--accent-deep);
  font-family: var(--serif);
  font-size: 20px;
  font-style: italic;
}

.duo-pair .select {
  width: 100%;
}

.duo-pair-hint {
  width: min(100%, 720px);
  margin-top: 8px;
  color: var(--muted-light);
  font-size: 9px;
  line-height: 1.55;
}

.duo-pair-hint.is-error {
  color: var(--danger);
}

.duo-caption-field {
  width: min(100%, 720px);
  margin-top: 13px;
}

.duo-caption-field .input {
  width: 100%;
}

.duo-dropzone {
  position: relative;
  width: min(100%, 720px);
  margin-top: 14px;
}

.duo-dropzone .photo-dropzone__icon {
  color: var(--accent-deep);
}

.duo-file-preview {
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  margin-left: auto;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.duo-create__actions {
  display: flex;
  justify-content: flex-end;
  width: min(100%, 720px);
  margin-top: 12px;
}

.duo-library {
  padding: clamp(20px, 2.6vw, 30px) 23px 26px;
}

.duo-library__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 17px;
}

.duo-library__head > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.duo-library__head p {
  color: var(--muted);
  font-size: 9.5px;
}

.admin-duo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.admin-duo-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 10px 28px -26px rgba(54, 44, 31, 0.5);
  transition:
    border-color 0.2s var(--ease),
    opacity 0.18s var(--ease),
    transform 0.2s var(--ease);
}

.admin-duo-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.admin-duo-card.is-dragging {
  opacity: 0.45;
  transform: scale(0.97);
}

.admin-duo-card.is-drop-before {
  border-color: var(--accent);
  box-shadow: 0 -3px 0 0 var(--accent);
}

.admin-duo-card.is-drop-after {
  border-color: var(--accent);
  box-shadow: 0 3px 0 0 var(--accent);
}

.admin-duo-card__media {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #211b15;
}

.admin-duo-card__media > a {
  display: block;
  width: 100%;
  height: 100%;
}

.admin-duo-card__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.5s var(--ease);
}

.admin-duo-card:hover .admin-duo-card__media img {
  transform: scale(1.01);
}

.admin-duo-card__index,
.admin-duo-card__drag {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  min-width: 25px;
  min-height: 25px;
  color: var(--cream);
  background: rgba(28, 22, 15, 0.5);
  border: 1px solid rgba(255, 250, 242, 0.18);
  border-radius: 7px;
  font-family: var(--mono);
  font-size: 7.5px;
  backdrop-filter: blur(5px);
}

.admin-duo-card__index {
  top: 8px;
  left: 8px;
}

.admin-duo-card__drag {
  right: 8px;
  bottom: 8px;
  cursor: grab;
}

.admin-duo-card__drag:active {
  cursor: grabbing;
}

.admin-duo-card__drag .icon {
  width: 13px;
  height: 13px;
}

.admin-duo-card__order {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 12px 10px;
  border-top: 1px solid var(--line);
  margin-top: 1px;
  padding-top: 8px;
}

.admin-duo-card__order .photo-card__position {
  margin-left: auto;
}

.admin-duo-card__body {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 13px 13px;
}

.admin-duo-card__copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.admin-duo-card__copy strong {
  overflow: hidden;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-duo-card__copy span {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-duo-card__copy small {
  color: var(--muted-light);
  font-family: var(--mono);
  font-size: 7.5px;
}

.admin-duo-card .row-action {
  flex: 0 0 auto;
}

.duo-admin-empty {
  padding: 26px;
  color: var(--muted-light);
  background: rgba(245, 240, 230, 0.42);
  border: 1px dashed var(--line);
  border-radius: 13px;
  font-size: 10px;
  line-height: 1.6;
  text-align: center;
}

/* ---------- editor drawer ---------- */
.editor-root {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  justify-content: flex-end;
}

.editor-overlay {
  position: absolute;
  inset: 0;
  background: rgba(27, 22, 16, 0.5);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.editor-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(820px, 100%);
  height: 100%;
  margin-left: auto;
  background: var(--paper);
  box-shadow: -30px 0 80px -50px rgba(0, 0, 0, 0.55);
  opacity: 0;
  transform: translateX(36px);
  transition:
    opacity 0.3s var(--ease),
    transform 0.3s var(--ease);
}

.editor-root.is-open .editor-overlay {
  opacity: 1;
}

.editor-root.is-open .editor-panel {
  opacity: 1;
  transform: translateX(0);
}

.editor-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex: 0 0 auto;
  padding: 23px 28px 20px;
  background: rgba(245, 240, 230, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.editor-header .eyebrow {
  margin-bottom: 8px;
}

.editor-header h2 {
  font-family: var(--serif);
  font-size: 31px;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.editor-close {
  flex: 0 0 auto;
  margin-top: 2px;
  background: rgba(255, 250, 242, 0.7);
}

.editor-body {
  flex: 1;
  overflow-y: auto;
  padding: 22px 28px 40px;
  overscroll-behavior: contain;
}

.editor-section {
  background: rgba(255, 250, 242, 0.8);
  border: 1px solid var(--line);
  border-radius: 19px;
  padding: 21px;
}

.editor-section + .editor-section {
  margin-top: 16px;
}

.editor-section__head {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}

.editor-section__number {
  padding-top: 3px;
  color: var(--muted-light);
  font-family: var(--mono);
  font-size: 9px;
}

.editor-section__head > div {
  flex: 1;
}

.editor-section__head h3 {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.editor-section__head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.55;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
  margin-top: 19px;
}

.span-2 {
  grid-column: 1 / -1;
}

.form-grid .field > label {
  color: var(--ink-soft);
  font-size: 10px;
  letter-spacing: 0.03em;
}

.form-grid .input,
.form-grid .select,
.form-grid .textarea {
  background: rgba(255, 255, 255, 0.82);
  font-size: 12px;
}

.form-grid .input,
.form-grid .select {
  height: 42px;
}

.form-grid .textarea {
  min-height: 104px;
  font-size: 12px;
}

.required-mark {
  color: var(--accent);
}

.textarea-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.textarea-meta > span {
  flex: 0 0 auto;
  color: var(--muted-light);
  font-family: var(--mono);
  font-size: 9px;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 13px 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 11px;
}

.switch-row > div label,
.switch-row > div {
  display: block;
}

.switch-row > div label {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 650;
}

.switch-row > div p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.55;
}

.switch {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  cursor: pointer;
}

.switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch__track {
  position: relative;
  display: block;
  width: 44px;
  height: 25px;
  background: #d9d0c2;
  border-radius: 999px;
  transition: background 0.2s var(--ease);
}

.switch__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 19px;
  height: 19px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(55, 43, 27, 0.2);
  transition: transform 0.2s var(--ease);
}

.switch input:checked + .switch__track {
  background: var(--accent);
}

.switch input:checked + .switch__track .switch__thumb {
  transform: translateX(19px);
}

.switch input:focus-visible + .switch__track {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.photo-limit {
  flex: 0 0 auto;
  min-height: 24px;
  padding: 0 9px;
  color: var(--muted);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 9px;
  line-height: 23px;
}

.add-mode-photo-hint {
  margin-top: 17px;
  padding: 11px 13px;
  color: #88612b;
  background: #f5ead3;
  border: 1px dashed #d8bc87;
  border-radius: 10px;
  font-size: 10.5px;
  line-height: 1.6;
}

.photo-order-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 10px 12px;
  background: rgba(245, 240, 230, 0.66);
  border: 1px solid var(--line);
  border-radius: 11px;
  transition:
    background 0.2s var(--ease),
    border-color 0.2s var(--ease);
}

.photo-order-bar__mark {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  flex: 0 0 auto;
  color: var(--muted);
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.photo-order-bar__mark .icon {
  width: 15px;
  height: 15px;
}

.photo-order-bar__copy {
  flex: 1;
  min-width: 0;
}

.photo-order-bar__copy strong {
  display: block;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 650;
}

.photo-order-bar__copy p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
}

.photo-order-save {
  flex: 0 0 auto;
}

.photo-order-bar.is-dirty {
  background: #f7ecd5;
  border-color: #dcc18b;
}

.photo-order-bar.is-dirty .photo-order-bar__mark {
  color: #8b6719;
  background: #faedcf;
  border-color: #dcc18b;
}

.photo-order-bar.is-saving {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.photo-order-bar.is-error {
  background: var(--danger-soft);
  border-color: color-mix(in srgb, var(--danger) 30%, transparent);
}

.photo-order-bar.is-error .photo-order-bar__copy p {
  color: var(--danger);
}

.photo-order-bar.is-error .photo-order-bar__mark {
  color: var(--danger);
  background: #fff5f2;
  border-color: color-mix(in srgb, var(--danger) 25%, transparent);
}

.photo-manager {
  margin-top: 16px;
}

.photo-dropzone {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 89px;
  padding: 15px 17px;
  background: rgba(245, 240, 230, 0.55);
  border: 1.5px dashed var(--line-strong);
  border-radius: 13px;
  cursor: pointer;
  transition:
    background 0.2s var(--ease),
    border-color 0.2s var(--ease),
    opacity 0.2s var(--ease);
}

.photo-dropzone:hover,
.photo-dropzone.is-dragover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.photo-dropzone[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}

.photo-dropzone[aria-disabled="true"]:hover {
  background: rgba(245, 240, 230, 0.55);
  border-color: var(--line-strong);
}

.photo-dropzone__icon {
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  flex: 0 0 auto;
  color: var(--accent-deep);
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 11px;
}

.photo-dropzone__icon .icon {
  width: 18px;
  height: 18px;
}

.photo-dropzone strong {
  display: block;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 650;
}

.photo-dropzone span:last-child {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.upload-progress {
  margin-top: 11px;
  padding: 10px 12px;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.upload-progress__top {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  color: var(--muted);
  font-size: 9px;
}

.upload-progress__bar {
  height: 4px;
  margin-top: 7px;
  overflow: hidden;
  background: var(--paper-deep);
  border-radius: 999px;
}

.upload-progress__bar span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
  transition: width 0.2s var(--ease);
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
  margin-top: 15px;
}

.photo-grid-empty {
  margin-top: 15px;
  padding: 19px;
  color: var(--muted-light);
  background: rgba(245, 240, 230, 0.42);
  border: 1px dashed var(--line);
  border-radius: 11px;
  font-size: 10px;
  line-height: 1.6;
  text-align: center;
}

.photo-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  transition:
    border-color 0.18s var(--ease),
    box-shadow 0.18s var(--ease),
    opacity 0.18s var(--ease),
    transform 0.18s var(--ease);
}

.photo-card.is-dragging {
  opacity: 0.45;
  transform: scale(0.97);
}

.photo-card.is-drop-before {
  border-color: var(--accent);
  box-shadow: 0 -3px 0 0 var(--accent);
}

.photo-card.is-drop-after {
  border-color: var(--accent);
  box-shadow: 0 3px 0 0 var(--accent);
}

.photo-card__media {
  position: relative;
  aspect-ratio: 4 / 3.4;
  overflow: hidden;
  background: #211b15;
}

.photo-card__view {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  overflow: hidden;
  background: transparent;
  border: 0;
  cursor: zoom-in;
}

.photo-card__view img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.35s var(--ease);
}

.photo-card__view:hover img,
.photo-card__view:focus-visible img {
  transform: scale(1.01);
}

.photo-card__view-label {
  position: absolute;
  left: 50%;
  bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 23px;
  padding: 0 9px;
  color: #fffdf8;
  background: rgba(30, 25, 20, 0.58);
  border-radius: 999px;
  font-size: 8.5px;
  font-weight: 650;
  opacity: 0;
  transform: translate(-50%, 4px);
  transition:
    opacity 0.2s var(--ease),
    transform 0.2s var(--ease);
  backdrop-filter: blur(5px);
  pointer-events: none;
}

.photo-card__view-label .icon {
  width: 10px;
  height: 10px;
}

.photo-card__view:hover .photo-card__view-label,
.photo-card__view:focus-visible .photo-card__view-label {
  opacity: 1;
  transform: translate(-50%, 0);
}

.photo-card__index {
  position: absolute;
  top: 7px;
  left: 7px;
  min-width: 25px;
  padding: 0 6px;
  color: #fffdf8;
  background: rgba(30, 25, 20, 0.58);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 8px;
  line-height: 21px;
  text-align: center;
  pointer-events: none;
  backdrop-filter: blur(5px);
}

.photo-card__cover {
  position: absolute;
  top: 7px;
  right: 7px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 21px;
  padding: 0 7px;
  color: #6c4d13;
  background: rgba(250, 232, 188, 0.94);
  border-radius: 999px;
  font-size: 8px;
  font-weight: 700;
  pointer-events: none;
  backdrop-filter: blur(5px);
}

.photo-card__cover .icon {
  width: 10px;
  height: 10px;
}

.photo-card__drag {
  position: absolute;
  right: 7px;
  bottom: 7px;
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  padding: 0;
  color: #fffdf8;
  background: rgba(30, 25, 20, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  cursor: grab;
  backdrop-filter: blur(5px);
  transition:
    background 0.18s var(--ease),
    transform 0.18s var(--ease);
}

.photo-card__drag .icon {
  width: 14px;
  height: 14px;
}

.photo-card__drag:hover {
  background: rgba(30, 25, 20, 0.75);
}

.photo-card__drag:active {
  cursor: grabbing;
  transform: scale(0.94);
}

.photo-card__body {
  display: grid;
  gap: 3px;
  padding: 5px;
}

.photo-card__actions {
  display: flex;
  align-items: center;
  gap: 1px;
}

.photo-card__actions .photo-action {
  flex: 1 1 0;
}

.photo-card__order {
  display: flex;
  align-items: center;
  gap: 2px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.photo-order-button {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: 25px;
  padding: 0 5px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-size: 8px;
  font-weight: 600;
  white-space: nowrap;
  transition:
    color 0.18s var(--ease),
    background 0.18s var(--ease);
}

.photo-order-button .icon {
  width: 10px;
  height: 10px;
}

.photo-order-button:hover {
  color: var(--ink);
  background: var(--cream);
}

.photo-order-button:disabled {
  opacity: 0.32;
  cursor: default;
}

.photo-card__position {
  margin-left: auto;
  color: var(--muted-light);
  font-family: var(--mono);
  font-size: 8px;
  white-space: nowrap;
}

.photo-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 27px;
  padding: 0 5px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-size: 8.5px;
  font-weight: 600;
  white-space: nowrap;
  transition:
    color 0.18s var(--ease),
    background 0.18s var(--ease);
}

.photo-action .icon {
  width: 11px;
  height: 11px;
}

.photo-action:hover {
  color: var(--ink);
  background: var(--cream);
}

.photo-action--cover:hover {
  color: #8b6719;
  background: #f7ecd5;
}

.photo-action--delete:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

.photo-action:disabled {
  opacity: 0.4;
  cursor: default;
}

.editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex: 0 0 auto;
  padding: 15px 28px;
  background: rgba(245, 240, 230, 0.95);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.save-state {
  color: var(--muted);
  font-size: 9.5px;
}

.save-state.is-dirty {
  color: #9a7127;
}

.save-state.is-error {
  color: var(--danger);
}

.save-state.is-saved {
  color: var(--success);
}

.editor-footer__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.editor-footer .btn {
  min-height: 39px;
  font-size: 11px;
}

.editor-footer .btn .icon {
  width: 13px;
  height: 13px;
}

/* ---------- photo viewer ---------- */
.photo-viewer-root {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: grid;
  place-items: center;
  padding: 24px;
}

.photo-viewer-overlay {
  position: absolute;
  inset: 0;
  background: rgba(22, 19, 16, 0.82);
  opacity: 0;
  transition: opacity 0.22s var(--ease);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.photo-viewer {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(100%, 900px);
  max-height: min(90vh, 880px);
  padding: 18px;
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 19px;
  box-shadow: 0 35px 100px -40px rgba(0, 0, 0, 0.7);
  opacity: 0;
  transform: translateY(10px) scale(0.985);
  transition:
    opacity 0.22s var(--ease),
    transform 0.22s var(--ease);
}

.photo-viewer-root.is-open .photo-viewer-overlay {
  opacity: 1;
}

.photo-viewer-root.is-open .photo-viewer {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.photo-viewer__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex: 0 0 auto;
  padding: 2px 2px 14px;
}

.photo-viewer__head h2 {
  margin-top: 5px;
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.photo-viewer__head .icon-button {
  flex: 0 0 auto;
  background: var(--cream);
}

.photo-viewer__stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  flex: 1;
  overflow: hidden;
  background: #1f1b17;
  border-radius: 12px;
}

.photo-viewer__frame {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 12px;
}

.photo-viewer__frame img {
  display: block;
  max-width: 100%;
  max-height: min(68vh, 680px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 5px;
}

.photo-viewer__nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  color: #fffdf8;
  background: rgba(30, 25, 20, 0.48);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  transform: translateY(-50%);
  transition:
    background 0.18s var(--ease),
    transform 0.18s var(--ease);
  backdrop-filter: blur(6px);
}

.photo-viewer__nav:hover {
  background: rgba(30, 25, 20, 0.75);
}

.photo-viewer__nav .icon {
  width: 18px;
  height: 18px;
}

.photo-viewer__nav--prev {
  left: 12px;
}

.photo-viewer__nav--next {
  right: 12px;
}

.photo-viewer__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex: 0 0 auto;
  padding: 14px 2px 1px;
}

.photo-viewer__foot strong {
  display: block;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
}

.photo-viewer__foot span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.photo-viewer__counter {
  flex: 0 0 auto;
  min-height: 25px;
  margin-top: 0 !important;
  padding: 0 9px;
  color: var(--muted) !important;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 9px !important;
  line-height: 24px;
}

/* ---------- confirm dialog ---------- */
.confirm-root {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: grid;
  place-items: center;
  padding: 20px;
}

.confirm-overlay {
  position: absolute;
  inset: 0;
  background: rgba(27, 22, 16, 0.54);
  opacity: 0;
  transition: opacity 0.2s var(--ease);
  backdrop-filter: blur(4px);
}

.confirm-dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 395px);
  padding: 27px;
  background: var(--cream);
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 21px;
  box-shadow: 0 30px 80px -40px rgba(0, 0, 0, 0.55);
  opacity: 0;
  transform: translateY(10px) scale(0.985);
  transition:
    opacity 0.2s var(--ease),
    transform 0.2s var(--ease);
}

.confirm-root.is-open .confirm-overlay {
  opacity: 1;
}

.confirm-root.is-open .confirm-dialog {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.confirm-icon {
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  color: var(--danger);
  background: var(--danger-soft);
  border-radius: 50%;
}

.confirm-icon .icon {
  width: 17px;
  height: 17px;
}

.confirm-dialog h2 {
  margin-top: 16px;
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 500;
  letter-spacing: -0.025em;
}

.confirm-dialog p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.7;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 23px;
}

.confirm-actions .btn {
  min-height: 38px;
  font-size: 11px;
}

/* ---------- responsive ---------- */
@media (max-width: 1120px) {
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-duo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat-card > p {
    display: none;
  }

  .stat-card {
    padding-bottom: 17px;
  }
}

.mobile-admin-nav {
  display: none;
}

@media (max-width: 940px) {
  .admin-app {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .mobile-brand {
    display: inline-flex;
  }

  .admin-topbar {
    height: 66px;
  }

  .mobile-logout {
    display: grid;
  }

  .mobile-admin-nav {
    position: sticky;
    top: 66px;
    z-index: 14;
    display: flex;
    gap: 7px;
    padding: 9px 16px;
    background: rgba(239, 234, 224, 0.92);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  .mobile-admin-nav button {
    display: inline-flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 38px;
    padding: 0 12px;
    color: var(--muted);
    background: rgba(255, 250, 242, 0.56);
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 650;
  }

  .mobile-admin-nav button .icon {
    width: 14px;
    height: 14px;
  }

  .mobile-admin-nav button.is-active {
    color: var(--cream);
    background: var(--ink);
    border-color: var(--ink);
  }
}

@media (max-width: 860px) {
  .login-shell {
    grid-template-columns: 1fr;
    width: min(620px, 100%);
    min-height: 0;
  }

  .login-visual {
    min-height: 230px;
    padding: 23px;
  }

  .login-visual__quote p {
    font-size: 27px;
  }

  .login-visual__quote span {
    margin-top: 13px;
  }

  .login-panel {
    padding: 39px 28px 44px;
  }

  .login-form-wrap {
    width: min(100%, 390px);
  }

  .login-form-wrap h1 {
    font-size: 39px;
  }
}

@media (max-width: 820px) {
  .pet-table-wrap {
    display: none;
  }

  .mobile-pet-list {
    display: grid;
  }

  .mobile-pet-card {
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr) auto;
    align-items: center;
    gap: 13px;
    padding: 15px 17px;
    border-bottom: 1px solid var(--line);
  }

  .mobile-pet-card:last-child {
    border-bottom: 0;
  }

  .mobile-pet-card__cover {
    position: relative;
    width: 62px;
    height: 70px;
    overflow: hidden;
    background: var(--paper-deep);
    border-radius: 11px;
  }

  .mobile-pet-card__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .mobile-pet-card__cover .icon {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 22px;
    height: 22px;
    color: var(--muted-light);
    transform: translate(-50%, -50%);
  }

  .mobile-pet-card__name {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
  }

  .mobile-pet-card__name strong {
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: var(--serif);
    font-size: 18px;
    font-weight: 600;
    white-space: nowrap;
  }

  .mobile-pet-card__name .pet-cell__star .icon {
    width: 13px;
    height: 13px;
  }

  .mobile-pet-card__meta {
    margin-top: 3px;
    overflow: hidden;
    color: var(--muted);
    font-size: 9.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-pet-card__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    margin-top: 7px;
    color: var(--muted-light);
    font-size: 8.5px;
  }

  .mobile-pet-card__stats span {
    display: inline-flex;
    align-items: center;
    gap: 3px;
  }

  .mobile-pet-card__stats .icon {
    width: 10px;
    height: 10px;
  }

  .mobile-pet-card__actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .mobile-pet-card__actions .row-action {
    width: 30px;
    height: 30px;
  }

  .panel-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 13px;
  }

  .panel-search {
    width: 100%;
    flex-basis: 100%;
  }

  .panel-search input {
    height: 40px;
  }

  .duo-pair {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .duo-pair__join {
    display: none;
  }
}

@media (max-width: 720px) {
  .admin-content {
    padding-inline: 16px;
  }

  .admin-topbar {
    padding-inline: 16px;
    gap: 12px;
  }

  .topbar-status {
    display: none;
  }

  .topbar-preview {
    display: none;
  }

  .topbar-actions {
    gap: 6px;
  }

  .topbar-actions .topbar-add-duo {
    width: 38px;
    min-width: 38px;
    height: 38px;
    padding: 0;
    gap: 0;
    overflow: hidden;
    font-size: 0;
  }

  .topbar-actions .topbar-add-duo .icon {
    width: 15px;
    height: 15px;
  }

  .duo-create,
  .duo-library {
    padding-inline: 16px;
  }

  .duo-library__head {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .page-heading h1 {
    font-size: 42px;
  }

  .stat-grid {
    gap: 10px;
    margin-top: 23px;
  }

  .stat-card {
    padding: 15px 13px;
  }

  .stat-card__icon {
    width: 33px;
    height: 33px;
  }

  .stat-card strong {
    font-size: 30px;
  }

  .panel {
    border-radius: 19px;
  }

  .panel-head {
    padding: 18px;
  }

  .editor-header {
    padding: 19px 18px 16px;
  }

  .editor-header h2 {
    font-size: 27px;
  }

  .editor-body {
    padding: 16px 14px 30px;
  }

  .editor-section {
    padding: 16px;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 13px;
  }

  .span-2 {
    grid-column: auto;
  }

  .photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .photo-order-bar {
    flex-wrap: wrap;
  }

  .photo-order-save {
    width: 100%;
    justify-content: center;
  }

  .photo-viewer-root {
    padding: 13px;
  }

  .photo-viewer {
    padding: 14px;
    max-height: 94vh;
  }

  .photo-viewer__head h2 {
    font-size: 23px;
  }

  .photo-viewer__frame {
    padding: 7px;
  }

  .photo-viewer__frame img {
    max-height: 62vh;
  }

  .photo-viewer__nav {
    width: 36px;
    height: 36px;
  }

  .photo-viewer__nav--prev {
    left: 7px;
  }

  .photo-viewer__nav--next {
    right: 7px;
  }

  .editor-footer {
    padding: 12px 15px;
  }

  .save-state {
    display: none;
  }

  .editor-footer__actions {
    width: 100%;
    justify-content: flex-end;
  }
}

@media (max-width: 560px) {
  .login-view {
    padding: 0;
  }

  .login-shell {
    min-height: 100vh;
    border-radius: 0;
    border: 0;
  }

  .login-visual {
    min-height: 190px;
    padding: 19px;
  }

  .login-visual__quote p {
    font-size: 23px;
  }

  .login-visual__badge {
    display: none;
  }

  .login-visual__quote span {
    display: none;
  }

  .login-panel {
    padding: 31px 22px 40px;
  }

  .login-form-wrap h1 {
    font-size: 35px;
  }

  .login-intro {
    font-size: 11.5px;
  }

  .mobile-pet-card {
    grid-template-columns: 54px minmax(0, 1fr) auto;
    padding: 14px;
  }

  .mobile-pet-card__cover {
    width: 54px;
    height: 62px;
  }

  .stat-card {
    grid-template-columns: auto 1fr;
  }

  .photo-card__view-label {
    display: none;
  }

  .photo-card__drag {
    width: 24px;
    height: 24px;
    right: 5px;
    bottom: 5px;
  }

  .photo-card__index {
    top: 5px;
    left: 5px;
  }

  .photo-card__cover {
    top: 5px;
    right: 5px;
  }

  .photo-viewer__foot strong {
    font-size: 15px;
  }

  .photo-viewer__foot span {
    max-width: 230px;
  }

  .admin-duo-grid {
    grid-template-columns: 1fr;
  }

  .duo-create__actions .btn {
    width: 100%;
  }
}

@media (max-width: 430px) {
  .login-visual {
    display: none;
  }

  .login-panel {
    place-items: start center;
    padding-top: 46px;
  }

  .admin-topbar .btn--primary {
    padding-inline: 12px;
  }

  .admin-topbar .btn--primary .icon {
    display: none;
  }

  .page-heading h1 {
    font-size: 38px;
  }

  .stat-card__icon {
    display: none;
  }

  .stat-card {
    display: block;
    padding: 14px;
  }

  .stat-card strong {
    font-size: 28px;
  }

  .photo-card__body {
    flex-wrap: wrap;
  }

  .photo-action {
    flex: 1;
    justify-content: flex-start;
  }
}
