/* =========================================================
   Our Story — admin
   ========================================================= */

.admin-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 100% 0, rgba(255, 253, 248, 0.8), transparent 26%),
    var(--paper);
}

.admin-body h1,
.admin-body h2,
.admin-body h3 {
  font-family: var(--serif);
}

.admin-body [hidden] {
  display: none !important;
}

.admin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 19px;
  border: 1px solid transparent;
  border-radius: 2px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.05em;
  white-space: nowrap;
  transition:
    color 0.22s,
    background 0.22s,
    border-color 0.22s,
    transform 0.22s,
    box-shadow 0.22s;
}

.admin-btn svg {
  width: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.admin-btn.primary {
  color: #fff9ee;
  background: var(--ink);
  box-shadow: 0 8px 20px rgba(45, 42, 37, 0.13);
}

.admin-btn.primary:hover {
  background: var(--terracotta-deep);
  box-shadow: 0 10px 24px rgba(147, 75, 56, 0.2);
  transform: translateY(-1px);
}

.admin-btn.secondary {
  border-color: var(--line-strong);
  color: var(--ink);
  background: rgba(255, 253, 249, 0.55);
}

.admin-btn.secondary:hover {
  border-color: var(--ink);
  background: var(--white);
}

.admin-btn.ghost {
  border-color: var(--line);
  color: var(--muted);
  background: transparent;
}

.admin-btn.ghost:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}

.admin-btn.danger {
  color: #fff7f2;
  background: #9c4435;
}

.admin-btn.danger:hover {
  background: #793226;
}

.admin-btn.small {
  min-height: 36px;
  padding: 0 14px;
  font-size: 10px;
}

.admin-btn:disabled {
  cursor: wait;
  opacity: 0.55;
  transform: none !important;
}

/* ---------- loading ---------- */

.admin-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 20px;
  min-height: 100vh;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.12em;
}

.loading-mark {
  position: relative;
  width: 72px;
  height: 46px;
}

.loading-mark span {
  position: absolute;
  top: 0;
  width: 46px;
  height: 46px;
  border: 1px solid var(--terracotta);
  border-radius: 50%;
  animation: loading-pulse 1.5s ease-in-out infinite;
}

.loading-mark span:last-child {
  right: 0;
  border-color: var(--sage);
  animation-delay: 0.25s;
}

@keyframes loading-pulse {
  50% {
    transform: scale(0.92);
    opacity: 0.5;
  }
}

/* ---------- login ---------- */

.login-view {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(0, 1.06fr) minmax(420px, 0.94fr);
}

.login-art {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 44px clamp(38px, 5vw, 76px);
  overflow: hidden;
  color: #f7e9d8;
  background:
    radial-gradient(circle at 86% 8%, rgba(255, 224, 177, 0.18), transparent 26%),
    radial-gradient(circle at 14% 84%, rgba(255, 214, 174, 0.1), transparent 32%),
    linear-gradient(145deg, #ad5a43, #7c3b30 72%, #633026);
}

.login-art::before {
  position: absolute;
  top: 14%;
  right: -28%;
  width: 680px;
  height: 680px;
  border: 1px solid rgba(255, 247, 233, 0.1);
  border-radius: 50%;
  content: "";
}

.login-art::after {
  position: absolute;
  top: 22%;
  right: -16%;
  width: 480px;
  height: 480px;
  border: 1px dashed rgba(255, 247, 233, 0.09);
  border-radius: 50%;
  content: "";
}

.login-art-top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 8px;
  letter-spacing: 0.27em;
}

.login-art-copy {
  position: relative;
  z-index: 2;
  margin-top: clamp(70px, 12vh, 150px);
}

.login-script {
  margin-bottom: 15px;
  color: #f1c7b2;
  font-family: var(--script);
  font-size: clamp(30px, 3.2vw, 44px);
  line-height: 1;
  transform: rotate(-3deg);
}

.login-art h1 {
  font-size: clamp(52px, 5.2vw, 78px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.3;
}

.login-art h1 em {
  color: #f4d3a4;
  font-style: normal;
}

.login-art-copy > p:last-child {
  margin-top: 28px;
  color: rgba(247, 233, 216, 0.62);
  font-size: 11px;
  letter-spacing: 0.04em;
  line-height: 2;
}

.login-photos {
  position: absolute;
  z-index: 2;
  right: 4%;
  bottom: -4%;
  width: 55%;
  height: 43%;
  pointer-events: none;
}

.login-photo {
  position: absolute;
  padding: 9px 9px 37px;
  background: #fff9ef;
  box-shadow: 0 24px 55px rgba(48, 19, 12, 0.34);
}

.login-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.login-photo.one {
  right: 35%;
  bottom: 5%;
  width: 47%;
  height: 67%;
  transform: rotate(-7deg);
}

.login-photo.two {
  right: 0;
  bottom: 0;
  width: 49%;
  height: 58%;
  transform: rotate(5deg);
}

.login-seal {
  position: absolute;
  z-index: 3;
  top: 13%;
  left: 14%;
  display: grid;
  width: 78px;
  height: 78px;
  place-items: center;
  border: 1px solid rgba(183, 97, 74, 0.5);
  border-radius: 50%;
  color: var(--terracotta);
  background: rgba(255, 248, 237, 0.92);
  font-size: 19px;
  box-shadow: 0 8px 18px rgba(48, 19, 12, 0.13);
  transform: rotate(-12deg);
}

.login-seal small {
  position: absolute;
  bottom: 14px;
  font-size: 6px;
  letter-spacing: 0.17em;
}

.login-art-foot {
  position: relative;
  z-index: 3;
  margin-top: auto;
  color: rgba(247, 233, 216, 0.42);
  font-size: 7px;
  letter-spacing: 0.3em;
}

.login-panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  min-height: 100vh;
  padding: 55px clamp(34px, 6vw, 92px);
}

.login-card {
  width: min(100%, 405px);
}

.back-home {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 50px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.06em;
  transition: color 0.2s;
}

.back-home svg {
  width: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

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

.login-kicker {
  margin-bottom: 14px;
  color: var(--terracotta);
  font-size: 8px;
  letter-spacing: 0.26em;
}

.login-card h2 {
  font-size: clamp(31px, 3.2vw, 41px);
  font-weight: 500;
  letter-spacing: -0.025em;
}

.login-sub {
  margin: 10px 0 34px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.03em;
}

.login-alert {
  margin-bottom: 17px;
  padding: 10px 13px;
  border-left: 2px solid var(--terracotta);
  color: var(--terracotta-deep);
  background: rgba(183, 97, 74, 0.065);
  font-size: 10px;
  line-height: 1.7;
}

.login-form .field {
  margin-bottom: 16px;
}

.login-form .field input {
  min-height: 48px;
  background: rgba(255, 253, 249, 0.6);
}

.login-submit {
  width: 100%;
  min-height: 50px;
  margin-top: 11px;
  font-size: 12px;
}

.login-submit svg {
  transition: transform 0.25s;
}

.login-submit:hover svg {
  transform: translateX(4px);
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 34px 0 20px;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.12em;
}

.login-divider::before,
.login-divider::after {
  height: 1px;
  background: var(--line);
  content: "";
  flex: 1;
}

.login-divider span {
  white-space: nowrap;
}

.login-note {
  color: var(--muted);
  font-family: var(--serif);
  font-size: 10px;
  letter-spacing: 0.06em;
  line-height: 1.9;
  text-align: center;
}

.login-copyright {
  position: absolute;
  bottom: 26px;
  color: var(--muted);
  font-size: 7px;
  letter-spacing: 0.26em;
  opacity: 0.7;
}

.unconfigured-card {
  display: flex;
  gap: 13px;
  margin: 20px 0 6px;
  padding: 16px;
  border: 1px solid rgba(183, 97, 74, 0.22);
  background: rgba(255, 253, 249, 0.6);
}

.unconfigured-mark {
  color: var(--terracotta);
  font-size: 18px;
}

.unconfigured-card strong {
  display: block;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 500;
}

.unconfigured-card p {
  margin: 4px 0 11px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}

/* ---------- app shell ---------- */

.admin-app {
  min-height: 100vh;
}

.admin-sidebar {
  position: fixed;
  z-index: 70;
  top: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  width: 252px;
  padding: 0 18px 20px;
  overflow-y: auto;
  color: #f2e8d8;
  background:
    radial-gradient(circle at 80% 0, rgba(200, 163, 99, 0.1), transparent 27%),
    #292620;
  transition: transform 0.35s var(--ease);
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 27px 10px 31px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.075);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.sidebar-brand > span:last-child {
  display: flex;
  flex-direction: column;
}

.sidebar-brand strong {
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.07em;
}

.sidebar-brand small {
  margin-top: 2px;
  color: rgba(242, 232, 216, 0.38);
  font-size: 6px;
  letter-spacing: 0.24em;
}

.sidebar-brand .brand-rings {
  transform: scale(0.84);
  transform-origin: left center;
}

.sidebar-close {
  display: none;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  color: rgba(242, 232, 216, 0.65);
  background: rgba(255, 255, 255, 0.05);
  font-size: 20px;
}

.sidebar-label {
  margin: 27px 11px 11px;
  color: rgba(242, 232, 216, 0.32);
  font-size: 7px;
  letter-spacing: 0.26em;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 43px;
  padding: 0 12px;
  border: 0;
  border-radius: 2px;
  color: rgba(242, 232, 216, 0.6);
  background: transparent;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-align: left;
  transition:
    color 0.22s,
    background 0.22s;
}

.nav-item svg {
  width: 17px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.35;
}

.nav-item em {
  margin-left: auto;
  color: rgba(242, 232, 216, 0.27);
  font-size: 8px;
  font-style: normal;
}

.nav-item:hover {
  color: #f8efe1;
  background: rgba(255, 255, 255, 0.04);
}

.nav-item.active {
  color: #2e2a24;
  background: #f2e8d7;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.16);
}

.nav-item.active em {
  color: var(--terracotta);
}

.nav-item.active::before {
  position: absolute;
  left: 0;
  width: 2px;
  height: 17px;
  background: var(--terracotta);
  content: "";
}

.sidebar-quote {
  position: relative;
  margin: 33px 11px 20px;
  padding: 17px 15px 15px;
  border: 1px solid rgba(255, 255, 255, 0.075);
}

.sidebar-quote span {
  position: absolute;
  top: -12px;
  left: 10px;
  color: var(--gold);
  font-family: var(--serif);
  font-size: 30px;
  opacity: 0.6;
}

.sidebar-quote p {
  color: rgba(242, 232, 216, 0.43);
  font-family: var(--serif);
  font-size: 10px;
  letter-spacing: 0.06em;
  line-height: 1.9;
}

.sidebar-foot {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: auto;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.075);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 37px;
  padding: 0 11px;
  border: 0;
  color: rgba(242, 232, 216, 0.42);
  background: transparent;
  font-size: 9px;
  letter-spacing: 0.04em;
  text-align: left;
  transition: color 0.2s;
}

.sidebar-link svg {
  width: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.4;
}

.sidebar-link:hover {
  color: #f7ecdc;
}

.sidebar-scrim {
  position: fixed;
  z-index: 65;
  inset: 0;
  background: rgba(30, 26, 22, 0.52);
  backdrop-filter: blur(3px);
}

.admin-main {
  min-height: 100vh;
  margin-left: 252px;
}

.admin-topbar {
  position: sticky;
  z-index: 50;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 80px;
  padding: 16px clamp(26px, 4vw, 58px);
  border-bottom: 1px solid var(--line);
  background: rgba(245, 239, 229, 0.86);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.topbar-menu {
  display: none;
  width: 40px;
  height: 40px;
  margin-right: 13px;
  padding: 11px 9px;
  border: 1px solid var(--line);
  background: transparent;
}

.topbar-menu span {
  display: block;
  width: 19px;
  height: 1px;
  margin: 4px auto;
  background: var(--ink);
}

.topbar-title {
  margin-right: auto;
}

.topbar-title p {
  margin-bottom: 1px;
  color: var(--terracotta);
  font-size: 7px;
  letter-spacing: 0.26em;
}

.topbar-title h1 {
  font-size: 21px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 22px;
}

.topbar-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.06em;
  transition: color 0.2s;
}

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

.topbar-link svg {
  width: 13px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-left: 22px;
  border-left: 1px solid var(--line);
}

.user-avatar {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  color: #f8eee0;
  background: var(--terracotta);
  font-family: var(--serif);
  font-size: 13px;
}

.user-name {
  font-size: 10px;
  letter-spacing: 0.04em;
}

.admin-content {
  max-width: 1390px;
  margin: 0 auto;
  padding: clamp(30px, 4vw, 50px) clamp(26px, 4vw, 58px) 70px;
}

.admin-panel {
  display: none;
  animation: admin-panel-in 0.45s var(--ease);
}

.admin-panel.active {
  display: block;
}

@keyframes admin-panel-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

/* ---------- overview ---------- */

.overview-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 25px;
  margin-bottom: 31px;
}

.page-kicker {
  margin-bottom: 9px;
  color: var(--terracotta);
  font-size: 7px;
  letter-spacing: 0.25em;
}

.overview-intro h2,
.panel-heading h2 {
  font-size: clamp(31px, 3.1vw, 43px);
  font-weight: 500;
  letter-spacing: -0.025em;
}

.overview-intro h2 em {
  color: var(--terracotta);
  font-style: normal;
}

.page-sub {
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.035em;
}

.overview-actions {
  display: flex;
  gap: 9px;
}

.overview-hero {
  position: relative;
  display: grid;
  min-height: 272px;
  padding: clamp(28px, 3vw, 42px);
  overflow: hidden;
  color: #f7ecdc;
  background:
    radial-gradient(circle at 93% 10%, rgba(200, 163, 99, 0.18), transparent 25%),
    radial-gradient(circle at 8% 90%, rgba(183, 97, 74, 0.18), transparent 30%),
    var(--ink);
  grid-template-columns: minmax(0, 1fr) 0.56fr;
}

.overview-hero::before {
  position: absolute;
  top: -160px;
  right: -70px;
  width: 440px;
  height: 440px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  content: "";
}

.overview-hero::after {
  position: absolute;
  top: -95px;
  right: -8px;
  width: 310px;
  height: 310px;
  border: 1px dashed rgba(255, 255, 255, 0.07);
  border-radius: 50%;
  content: "";
}

.overview-hero-copy {
  position: relative;
  z-index: 3;
}

.overview-hero-copy > p:first-child {
  color: rgba(247, 236, 220, 0.42);
  font-size: 7px;
  letter-spacing: 0.27em;
}

.big-days {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 8px 0 2px;
}

.big-days strong {
  font-family: var(--serif);
  font-size: clamp(68px, 8vw, 104px);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1;
}

.big-days span {
  font-family: var(--serif);
  font-size: 15px;
  opacity: 0.6;
}

.overview-hero-sub {
  color: rgba(247, 236, 220, 0.47);
  font-size: 9px;
  letter-spacing: 0.1em;
}

.anniversary-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 33px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(247, 236, 220, 0.44);
  font-size: 8px;
  letter-spacing: 0.07em;
}

.anniversary-line strong {
  color: #f2d09d;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 500;
}

.anniversary-line span:last-child {
  opacity: 0.6;
}

.overview-hero-mark {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 47%;
  color: rgba(200, 163, 99, 0.15);
  transform: translate(-50%, -50%);
}

.big-amp {
  font-family: var(--script);
  font-size: 170px;
  line-height: 1;
}

.overview-hero-photos {
  position: relative;
  z-index: 2;
  min-height: 185px;
}

.overview-hero-photos img {
  position: absolute;
  width: 46%;
  height: 58%;
  border: 5px solid #fbf5ea;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.29);
  object-fit: cover;
}

.overview-hero-photos img:first-child {
  top: 1%;
  right: 29%;
  transform: rotate(-6deg);
}

.overview-hero-photos img:last-child {
  right: 0;
  bottom: 0;
  width: 49%;
  height: 62%;
  transform: rotate(5deg);
}

.overview-hero-star {
  position: absolute;
  z-index: 2;
  top: 23px;
  right: 30px;
  color: var(--gold);
  font-size: 16px;
  opacity: 0.65;
}

.overview-stats {
  display: grid;
  gap: 12px;
  margin-top: 15px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-stat {
  display: grid;
  align-items: center;
  padding: 19px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 249, 0.48);
  grid-template-columns: 34px 1fr;
  grid-template-rows: auto auto;
}

.stat-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  grid-row: 1 / 3;
}

.stat-icon svg {
  width: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.4;
}

.stat-icon.terracotta {
  color: var(--terracotta-deep);
  background: rgba(183, 97, 74, 0.11);
}

.stat-icon.sage {
  color: var(--sage-deep);
  background: rgba(110, 125, 99, 0.14);
}

.stat-icon.gold {
  color: #9a7537;
  background: rgba(200, 163, 99, 0.16);
}

.stat-icon.ink {
  color: var(--ink);
  background: rgba(45, 42, 37, 0.09);
}

.admin-stat > div {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.admin-stat strong {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 500;
  line-height: 1.1;
}

.admin-stat > div span {
  color: var(--muted);
  font-size: 9px;
}

.admin-stat small {
  align-self: start;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.03em;
  opacity: 0.8;
}

.overview-columns {
  display: grid;
  gap: 15px;
  margin-top: 15px;
  grid-template-columns: minmax(0, 1.55fr) minmax(270px, 0.75fr);
}

.panel-card {
  padding: 24px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 249, 0.56);
}

.panel-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 19px;
}

.panel-card-head p {
  margin-bottom: 4px;
  color: var(--terracotta);
  font-size: 7px;
  letter-spacing: 0.22em;
}

.panel-card-head h3 {
  font-size: 20px;
  font-weight: 500;
}

.text-button {
  padding: 4px 0;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  color: var(--muted);
  background: transparent;
  font-size: 8px;
  letter-spacing: 0.06em;
}

.text-button:hover {
  color: var(--terracotta-deep);
  border-color: var(--terracotta);
}

.recent-list {
  display: flex;
  flex-direction: column;
}

.recent-row {
  display: grid;
  align-items: center;
  gap: 13px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
  grid-template-columns: 54px minmax(0, 1fr) auto;
}

.recent-row:first-child {
  padding-top: 0;
  border-top: 0;
}

.recent-thumb {
  width: 54px;
  height: 43px;
  overflow: hidden;
  background: var(--paper-deep);
}

.recent-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recent-thumb.empty {
  display: grid;
  place-items: center;
  color: var(--terracotta);
  font-size: 15px;
}

.recent-info {
  min-width: 0;
}

.recent-info strong {
  display: block;
  overflow: hidden;
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-info span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.04em;
}

.recent-date {
  color: var(--muted);
  font-family: var(--serif);
  font-size: 11px;
  white-space: nowrap;
}

.recent-empty {
  padding: 32px 0 24px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.quill {
  color: var(--terracotta);
  font-size: 18px;
}

.quick-tips {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.quick-tips li {
  display: flex;
  gap: 11px;
}

.quick-tips li > span {
  color: var(--terracotta);
  font-family: var(--serif);
  font-size: 10px;
  line-height: 1.6;
}

.quick-tips p {
  color: var(--ink-soft);
  font-size: 9.5px;
  line-height: 1.75;
}

.quick-card-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 20px;
  padding: 12px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
  color: var(--terracotta-deep);
  background: transparent;
  font-size: 9px;
  letter-spacing: 0.05em;
}

.quick-card-action svg {
  width: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
  transition: transform 0.2s;
}

.quick-card-action:hover svg {
  transform: translateX(4px);
}

/* ---------- shared panel heading ---------- */

.panel-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 25px;
  margin-bottom: 28px;
}

.panel-heading .page-sub {
  margin-top: 6px;
}

/* ---------- moments list ---------- */

.list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 17px;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 9px;
  width: min(355px, 100%);
  min-height: 39px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 249, 0.55);
}

.search-field svg {
  width: 15px;
  flex-shrink: 0;
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.search-field input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 10px;
}

.search-field input::placeholder {
  color: var(--muted);
}

.select-field {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 9px;
}

.select-field select {
  min-height: 39px;
  padding: 0 32px 0 11px;
  border: 1px solid var(--line);
  border-radius: 0;
  background-color: rgba(255, 253, 249, 0.55);
  font-size: 10px;
}

.moments-admin-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.moment-admin-row {
  display: grid;
  align-items: center;
  gap: 17px;
  padding: 11px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 249, 0.54);
  grid-template-columns: 96px minmax(0, 1fr) auto;
  transition:
    background 0.22s,
    border-color 0.22s,
    transform 0.22s;
}

.moment-admin-row:hover {
  border-color: var(--line-strong);
  background: rgba(255, 253, 249, 0.84);
  transform: translateX(2px);
}

.moment-row-thumb {
  position: relative;
  width: 96px;
  height: 72px;
  overflow: hidden;
  background: var(--paper-deep);
}

.moment-row-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.moment-row-thumb.empty {
  display: grid;
  place-items: center;
  color: var(--terracotta);
  font-family: var(--serif);
  font-size: 22px;
}

.moment-row-main {
  min-width: 0;
}

.moment-row-topline {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 4px;
}

.moment-row-category {
  padding: 2px 7px;
  border: 1px solid rgba(183, 97, 74, 0.22);
  border-radius: 999px;
  color: var(--terracotta-deep);
  font-size: 7px;
  letter-spacing: 0.07em;
}

.moment-row-date {
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.07em;
}

.moment-row-main h3 {
  overflow: hidden;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.moment-row-main p {
  display: -webkit-box;
  max-width: 700px;
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.row-actions {
  display: flex;
  gap: 3px;
}

.icon-btn {
  display: grid;
  width: 33px;
  height: 33px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
  transition:
    color 0.2s,
    background 0.2s,
    border-color 0.2s;
}

.icon-btn svg {
  width: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.45;
}

.icon-btn:hover {
  border-color: var(--line);
  color: var(--ink);
  background: var(--paper-soft);
}

.icon-btn.danger:hover {
  border-color: rgba(183, 97, 74, 0.2);
  color: #9c4435;
  background: rgba(183, 97, 74, 0.07);
}

.admin-empty {
  padding: 62px 20px;
  border: 1px dashed var(--line-strong);
  text-align: center;
}

.admin-empty-mark {
  display: block;
  margin-bottom: 12px;
  color: var(--terracotta);
  font-size: 23px;
}

.admin-empty h3 {
  font-size: 23px;
  font-weight: 500;
}

.admin-empty p {
  margin: 7px 0 19px;
  color: var(--muted);
  font-size: 10px;
}

/* ---------- album admin ---------- */

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

.album-admin-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(255, 253, 249, 0.55);
  transition:
    transform 0.25s var(--ease),
    border-color 0.25s,
    box-shadow 0.25s;
}

.album-admin-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 15px 35px rgba(69, 51, 36, 0.08);
  transform: translateY(-2px);
}

.album-admin-cover {
  position: relative;
  height: 175px;
  overflow: hidden;
  background: var(--paper-deep);
}

.album-admin-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease);
}

.album-admin-card:hover .album-admin-cover img {
  transform: scale(1.03);
}

.album-admin-cover.empty {
  display: grid;
  place-items: center;
  color: var(--terracotta);
  background:
    radial-gradient(circle at 25% 20%, rgba(255, 255, 255, 0.6), transparent 42%),
    var(--paper-deep);
  font-family: var(--serif);
  font-size: 28px;
}

.album-admin-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 17px 18px 15px;
}

.album-admin-body h3 {
  font-size: 21px;
  font-weight: 500;
}

.album-admin-description {
  display: -webkit-box;
  min-height: 32px;
  margin-top: 5px;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.75;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.album-admin-meta {
  display: flex;
  gap: 14px;
  margin-top: 13px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.04em;
}

.album-admin-actions {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 11px;
}

.album-admin-actions .text-button {
  margin-right: auto;
  border: 0;
  color: var(--terracotta-deep);
  font-size: 9px;
}

.album-modal {
  width: min(540px, calc(100vw - 30px));
}

.album-modal .modal-body {
  padding-top: 22px;
}

.album-modal textarea {
  min-height: 132px;
}

.upload-zone-actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 11px;
}

.upload-album-select {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 8.5px;
  white-space: nowrap;
}

.upload-album-select select {
  max-width: 150px;
  min-height: 36px;
  padding: 0 27px 0 9px;
  border: 1px solid var(--line);
  border-radius: 0;
  background-color: rgba(255, 253, 249, 0.7);
  font-size: 10px;
}

/* ---------- gallery admin ---------- */

.upload-zone {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 23px 25px;
  border: 1px dashed var(--line-strong);
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(233, 222, 206, 0.16),
      rgba(233, 222, 206, 0.16) 6px,
      transparent 6px,
      transparent 12px
    ),
    rgba(255, 253, 249, 0.38);
  transition:
    border-color 0.25s,
    background 0.25s;
}

.upload-zone.dragging {
  border-color: var(--terracotta);
  background: rgba(183, 97, 74, 0.055);
}

.upload-zone-icon {
  width: 47px;
  flex-shrink: 0;
  color: var(--terracotta);
}

.upload-zone-icon svg {
  width: 100%;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.2;
}

.upload-zone > div:nth-child(2) {
  min-width: 0;
  flex: 1;
}

.upload-zone strong {
  display: block;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 500;
}

.upload-zone p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8.5px;
  letter-spacing: 0.02em;
}

.upload-progress {
  margin-top: 11px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 249, 0.58);
}

.upload-progress-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 8.5px;
}

.upload-progress-head strong {
  color: var(--ink);
  font-weight: 500;
}

.progress-track {
  height: 3px;
  overflow: hidden;
  background: var(--paper-deep);
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--terracotta);
  transition: width 0.25s;
}

.gallery-admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin: 21px 0 13px;
}

.album-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.album-pill {
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-size: 8.5px;
  transition:
    color 0.2s,
    background 0.2s,
    border-color 0.2s;
}

.album-pill span {
  margin-left: 3px;
  opacity: 0.55;
}

.album-pill:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.album-pill.active {
  border-color: var(--ink);
  color: var(--paper-soft);
  background: var(--ink);
}

.gallery-admin-summary {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 2px;
}

.gallery-admin-count {
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.gallery-admin-hint {
  color: var(--terracotta);
  font-size: 7px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  opacity: 0.75;
}

.admin-photo-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-photo-card {
  position: relative;
  overflow: hidden;
  background: var(--paper-deep);
  aspect-ratio: 4 / 3;
}

.admin-photo-card > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease);
}

.admin-photo-card:hover > img {
  transform: scale(1.035);
}

.photo-card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  padding: 11px;
  background: linear-gradient(to top, rgba(25, 20, 16, 0.74), transparent 58%);
  opacity: 0;
  transition: opacity 0.3s;
}

.admin-photo-card:hover .photo-card-overlay,
.admin-photo-card:focus-within .photo-card-overlay {
  opacity: 1;
}

.photo-card-info {
  min-width: 0;
  color: #fff7ea;
}

.photo-card-info strong {
  display: block;
  overflow: hidden;
  font-family: var(--serif);
  font-size: 11px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-card-info span {
  display: block;
  color: rgba(255, 247, 234, 0.62);
  font-size: 7px;
}

.photo-card-actions {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
}

.photo-card-actions .icon-btn {
  width: 29px;
  height: 29px;
  border-color: rgba(255, 255, 255, 0.18);
  color: #fff7ea;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(4px);
}

.photo-card-actions .icon-btn:hover {
  border-color: rgba(255, 255, 255, 0.3);
  color: white;
  background: rgba(255, 255, 255, 0.18);
}

.photo-card-actions .icon-btn.danger:hover {
  color: #ffd9ce;
  background: rgba(156, 68, 53, 0.42);
}

.photo-fav-badge {
  position: absolute;
  z-index: 2;
  top: 9px;
  left: 9px;
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 50%;
  color: var(--terracotta-deep);
  background: rgba(255, 251, 243, 0.9);
  font-size: 11px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.13);
}

.phone-access-card {
  display: flex;
  align-items: center;
  gap: 17px;
  margin-top: 15px;
  padding: 19px 22px;
  border: 1px solid rgba(110, 125, 99, 0.24);
  background:
    linear-gradient(90deg, rgba(110, 125, 99, 0.08), rgba(255, 253, 249, 0.58) 65%);
}

.phone-access-icon {
  display: grid;
  width: 43px;
  height: 43px;
  flex-shrink: 0;
  place-items: center;
  border-radius: 50%;
  color: var(--sage-deep);
  background: rgba(110, 125, 99, 0.13);
}

.phone-access-icon svg {
  width: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.4;
}

.phone-access-copy {
  min-width: 0;
  flex: 1;
}

.phone-access-copy > p {
  margin-bottom: 3px;
  color: var(--sage-deep);
  font-size: 7px;
  letter-spacing: 0.2em;
}

.phone-access-copy h3 {
  font-size: 17px;
  font-weight: 500;
}

.phone-access-copy code {
  display: inline-block;
  margin: 4px 0 3px;
  padding: 3px 7px;
  color: var(--terracotta-deep);
  background: rgba(183, 97, 74, 0.07);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.01em;
  user-select: all;
  word-break: break-all;
}

.phone-access-copy small {
  display: block;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.65;
}

.phone-access-card > .admin-btn {
  flex-shrink: 0;
}

/* ---------- interactions ---------- */

.interaction-summary {
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.interaction-summary-card {
  padding: 18px 20px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 249, 0.55);
}

.interaction-summary-card strong {
  display: block;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 500;
  line-height: 1.15;
}

.interaction-summary-card span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.06em;
}

.interaction-summary-card.like-summary {
  border-color: rgba(183, 97, 74, 0.19);
  background: rgba(183, 97, 74, 0.055);
}

.interaction-summary-card.like-summary strong {
  color: var(--terracotta-deep);
}

.interaction-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 13px;
}

.interaction-tabs {
  display: flex;
  gap: 6px;
}

.interaction-tab {
  padding: 6px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-size: 8.5px;
  transition:
    color 0.2s,
    background 0.2s,
    border-color 0.2s;
}

.interaction-tab:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.interaction-tab.active {
  border-color: var(--ink);
  color: var(--paper-soft);
  background: var(--ink);
}

.interaction-tip {
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.03em;
}

.comments-admin-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.comment-admin-row {
  display: grid;
  align-items: start;
  gap: 14px;
  padding: 17px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 249, 0.55);
  grid-template-columns: 38px minmax(0, 1fr) auto;
  transition:
    background 0.2s,
    opacity 0.2s;
}

.comment-admin-row.is-hidden {
  background: rgba(233, 222, 206, 0.26);
  opacity: 0.72;
}

.comment-admin-avatar {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  color: #fff7eb;
  background: var(--sage);
  font-family: var(--serif);
  font-size: 14px;
}

.comment-admin-row:nth-child(3n + 2) .comment-admin-avatar {
  background: var(--terracotta);
}

.comment-admin-row:nth-child(3n) .comment-admin-avatar {
  color: var(--ink);
  background: var(--gold);
}

.comment-admin-body {
  min-width: 0;
}

.comment-admin-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 15px;
}

.comment-admin-who {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.comment-admin-who strong {
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 500;
}

.comment-admin-head time {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.05em;
}

.comment-admin-target {
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 6.5px;
}

.comment-hidden-badge {
  padding: 2px 6px;
  border-radius: 999px;
  color: #7b625e;
  background: rgba(45, 42, 37, 0.08);
  font-size: 6.5px;
}

.comment-admin-text {
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.8;
  white-space: pre-line;
  word-break: break-word;
}

.comment-admin-actions {
  display: flex;
  gap: 3px;
}

/* ---------- settings ---------- */

.settings-layout {
  display: grid;
  align-items: start;
  gap: 22px;
  grid-template-columns: minmax(0, 1fr) 295px;
}

.settings-main {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.form-card {
  padding: clamp(22px, 3vw, 31px);
  border: 1px solid var(--line);
  background: rgba(255, 253, 249, 0.55);
}

.form-card-head {
  display: flex;
  gap: 13px;
  margin-bottom: 22px;
}

.form-card-number {
  padding-top: 2px;
  color: var(--terracotta);
  font-family: var(--serif);
  font-size: 10px;
}

.form-card-head h3 {
  font-size: 19px;
  font-weight: 500;
}

.form-card-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8.5px;
}

.form-card .field {
  margin-bottom: 16px;
}

.form-card .field input,
.form-card .field textarea,
.form-card .field select {
  background: rgba(255, 253, 249, 0.7);
}

.settings-save-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 17px 20px;
  border: 1px solid var(--line);
  background: var(--paper);
  position: sticky;
  z-index: 5;
  bottom: 14px;
  box-shadow: 0 13px 30px rgba(69, 51, 36, 0.09);
}

.settings-save-bar span {
  color: var(--muted);
  font-size: 8.5px;
}

.settings-preview {
  position: sticky;
  top: 101px;
}

.preview-card {
  position: relative;
  padding: 12px 12px 23px;
  border: 1px solid var(--line);
  background: var(--white);
  box-shadow: 0 18px 45px rgba(69, 51, 36, 0.12);
  transform: rotate(1.2deg);
}

.preview-photo {
  height: 145px;
  overflow: hidden;
  background: var(--paper-deep);
}

.preview-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-label {
  display: block;
  margin-top: 17px;
  color: var(--muted);
  font-size: 6px;
  letter-spacing: 0.22em;
  text-align: center;
}

.preview-card h3 {
  margin-top: 6px;
  font-size: 25px;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-align: center;
}

.preview-card > p {
  margin: 8px 12px 16px;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.7;
  text-align: center;
}

.preview-days {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.preview-days strong {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
}

.preview-days span {
  color: var(--muted);
  font-size: 9px;
}

.preview-card > small {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 6px;
  letter-spacing: 0.15em;
  text-align: center;
}

.preview-tip {
  margin-top: 17px;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.7;
  text-align: center;
}

/* ---------- account ---------- */

.account-layout {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr 1fr;
}

.account-layout .backup-card {
  grid-column: 1 / -1;
}

.profile-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
  padding-bottom: 21px;
  border-bottom: 1px solid var(--line);
}

.profile-avatar {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 50%;
  color: #fff7ea;
  background: var(--terracotta);
  font-family: var(--serif);
  font-size: 22px;
  box-shadow: 0 8px 18px rgba(183, 97, 74, 0.22);
}

.profile-row strong {
  display: block;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
}

.profile-row span:not(.profile-avatar) {
  color: var(--muted);
  font-size: 9px;
}

.members-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.member-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px;
  border: 1px solid var(--line);
  background: rgba(245, 239, 229, 0.54);
}

.member-avatar {
  display: grid;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  place-items: center;
  border-radius: 50%;
  color: #f9efe1;
  background: var(--sage);
  font-family: var(--serif);
  font-size: 14px;
}

.member-card:nth-child(even) .member-avatar {
  background: var(--terracotta);
}

.member-info strong {
  display: block;
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 500;
}

.member-info span {
  color: var(--muted);
  font-size: 8px;
}

.member-info {
  flex: 1;
}

.member-role {
  padding: 3px 7px;
  border: 1px solid rgba(183, 97, 74, 0.24);
  border-radius: 999px;
  color: var(--terracotta-deep);
  background: rgba(183, 97, 74, 0.06);
  font-size: 7px;
  white-space: nowrap;
}

.member-you {
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 7px;
  white-space: nowrap;
}

.backup-copy {
  margin-bottom: 17px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.8;
}

.backup-copy code {
  padding: 2px 5px;
  color: var(--terracotta-deep);
  background: rgba(183, 97, 74, 0.07);
  font-size: 8px;
}

/* ---------- modals ---------- */

.admin-modal {
  width: min(760px, calc(100vw - 30px));
  max-width: none;
  max-height: calc(100vh - 40px);
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 3px;
  background: var(--paper-soft);
  box-shadow: 0 30px 100px rgba(24, 19, 15, 0.38);
}

.admin-modal[open] {
  display: flex;
  flex-direction: column;
}

.admin-modal::backdrop {
  background: rgba(31, 27, 23, 0.66);
  backdrop-filter: blur(9px);
}

.admin-modal form {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 40px);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 26px 30px 21px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 {
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.modal-close {
  display: grid;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
  font-size: 21px;
  line-height: 1;
  transition:
    color 0.2s,
    background 0.2s,
    transform 0.25s;
}

.modal-close:hover {
  color: var(--ink);
  background: var(--paper);
  transform: rotate(90deg);
}

.modal-body {
  padding: 25px 30px;
  overflow-y: auto;
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  padding: 16px 30px;
  border-top: 1px solid var(--line);
  background: rgba(245, 239, 229, 0.48);
}

.modal-alert {
  margin-bottom: 17px;
  padding: 9px 12px;
  border-left: 2px solid var(--terracotta);
  color: var(--terracotta-deep);
  background: rgba(183, 97, 74, 0.065);
  font-size: 10px;
  line-height: 1.6;
}

.cover-field {
  display: grid;
  align-items: start;
  gap: 15px;
  padding-top: 4px;
  grid-template-columns: 150px 1fr;
}

.cover-preview {
  display: grid;
  width: 100%;
  height: 104px;
  overflow: hidden;
  place-items: center;
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  background: var(--paper);
  font-size: 9px;
}

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

.cover-select-wrap .field {
  margin-bottom: 6px;
}

.cover-select-wrap > p {
  color: var(--muted);
  font-size: 8px;
  line-height: 1.6;
}

.photo-modal {
  width: min(880px, calc(100vw - 30px));
}

.photo-modal-body {
  display: grid;
  gap: 26px;
  grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr);
}

.photo-modal-image {
  position: relative;
  align-self: start;
  overflow: hidden;
  background: var(--paper-deep);
}

.photo-modal-image img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.photo-replace {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 7px 11px;
  border: 0;
  color: #fff8ed;
  background: rgba(30, 25, 21, 0.67);
  font-size: 8px;
  letter-spacing: 0.06em;
  backdrop-filter: blur(5px);
}

.photo-replace:hover {
  background: rgba(30, 25, 21, 0.85);
}

.photo-modal-fields .field {
  margin-bottom: 14px;
}

.check-field {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 10px;
  cursor: pointer;
}

.check-field input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.check-box {
  position: relative;
  display: block;
  width: 17px;
  height: 17px;
  border: 1px solid var(--line-strong);
  background: var(--white);
}

.check-field input:checked + .check-box {
  border-color: var(--terracotta);
  background: var(--terracotta);
}

.check-field input:checked + .check-box::after {
  position: absolute;
  top: 2px;
  left: 5px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 1.5px 1.5px 0;
  content: "";
  transform: rotate(45deg);
}

.check-field input:focus-visible + .check-box {
  outline: 2px solid var(--terracotta);
  outline-offset: 3px;
}

/* photo preview */

.admin-preview {
  width: 100%;
  max-width: 100vw;
  height: 100%;
  max-height: 100vh;
  padding: 0;
  border: 0;
  background: transparent;
}

.admin-preview::backdrop {
  background: rgba(24, 20, 16, 0.91);
  backdrop-filter: blur(12px);
}

.admin-preview[open] {
  display: grid;
  place-items: center;
}

.admin-preview-shell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 46px 96px;
  color: #f8efe1;
}

.admin-preview figure {
  display: flex;
  align-items: center;
  flex-direction: column;
  width: min(1050px, 84vw);
  max-width: min(1050px, 84vw);
}

.admin-preview-image-wrap {
  display: grid;
  width: 100%;
  max-height: 72vh;
  place-items: center;
}

.admin-preview-image-wrap img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 72vh;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45);
  object-fit: contain;
}

.admin-preview figcaption {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  width: 100%;
  max-width: 860px;
  margin-top: 20px;
}

.admin-preview h3 {
  font-size: 22px;
  font-weight: 500;
}

.admin-preview figcaption p {
  margin-top: 4px;
  color: rgba(248, 239, 225, 0.6);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.admin-preview-actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 13px;
}

.admin-preview-actions > span {
  color: rgba(248, 239, 225, 0.5);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.admin-preview-actions a {
  color: rgba(248, 239, 225, 0.62);
  font-size: 9px;
  letter-spacing: 0.04em;
  text-decoration: underline;
  text-decoration-color: rgba(248, 239, 225, 0.25);
  text-underline-offset: 3px;
}

.admin-preview-actions a:hover {
  color: #fff8ed;
}

.admin-preview-actions .admin-btn {
  min-height: 34px;
  border-color: rgba(255, 255, 255, 0.24);
  color: #f8efe1;
  background: rgba(255, 255, 255, 0.06);
}

.admin-preview-close {
  position: absolute;
  z-index: 4;
  top: 24px;
  right: 29px;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  color: #f8efe1;
  background: rgba(255, 255, 255, 0.04);
  font-size: 24px;
}

.admin-preview-close:hover {
  background: rgba(255, 255, 255, 0.12);
}

.admin-preview-nav {
  position: absolute;
  z-index: 3;
  top: 50%;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 50%;
  color: #f8efe1;
  background: rgba(255, 255, 255, 0.04);
  transform: translateY(-50%);
}

.admin-preview-nav:hover {
  background: rgba(255, 255, 255, 0.12);
}

.admin-preview-nav svg {
  width: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.admin-preview-nav.prev {
  left: 27px;
}

.admin-preview-nav.next {
  right: 27px;
}

/* confirm */

.confirm-dialog {
  width: min(380px, calc(100vw - 32px));
  padding: 30px;
  border: 0;
  border-radius: 3px;
  background: var(--paper-soft);
  box-shadow: 0 30px 80px rgba(24, 19, 15, 0.35);
  text-align: center;
}

.confirm-dialog::backdrop {
  background: rgba(31, 27, 23, 0.62);
  backdrop-filter: blur(7px);
}

.confirm-mark {
  display: grid;
  width: 44px;
  height: 44px;
  margin: 0 auto 15px;
  place-items: center;
  border: 1px solid rgba(156, 68, 53, 0.25);
  border-radius: 50%;
  color: #9c4435;
  background: rgba(156, 68, 53, 0.07);
  font-family: var(--serif);
  font-size: 20px;
}

.confirm-dialog h3 {
  font-size: 23px;
  font-weight: 500;
}

.confirm-dialog p {
  margin: 8px 0 22px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}

.confirm-actions {
  display: flex;
  justify-content: center;
  gap: 9px;
}

/* toast */

.admin-toast {
  position: fixed;
  z-index: 1200;
  right: 28px;
  bottom: 28px;
  max-width: min(390px, calc(100vw - 40px));
  padding: 12px 18px;
  color: #f8eee0;
  background: var(--ink);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.22);
  font-size: 10px;
  letter-spacing: 0.035em;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition:
    opacity 0.3s,
    transform 0.3s var(--ease);
}

.admin-toast.show {
  opacity: 1;
  transform: none;
}

.admin-toast.error {
  background: #8b3d30;
}

/* =========================================================
   responsive
   ========================================================= */

@media (max-width: 1180px) {
  .album-admin-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

  .overview-columns {
    grid-template-columns: 1fr;
  }

  .quick-card {
    display: grid;
    gap: 0 30px;
    grid-template-columns: 1fr 1fr;
  }

  .quick-card .panel-card-head,
  .quick-card .quick-tips {
    grid-column: 1;
  }

  .quick-card .quick-card-action {
    align-self: end;
    grid-column: 2;
    grid-row: 1 / 3;
    margin: 0;
    border-top: 0;
    border-left: 1px solid var(--line);
    padding: 10px 0 10px 22px;
  }

  .settings-layout {
    grid-template-columns: 1fr;
  }

  .settings-preview {
    position: static;
    display: none;
  }
}

@media (max-width: 920px) {
  .login-view {
    grid-template-columns: 1fr;
  }

  .login-art {
    display: none;
  }

  .login-panel {
    background:
      radial-gradient(circle at 90% 6%, rgba(231, 209, 185, 0.55), transparent 28%),
      radial-gradient(circle at 5% 95%, rgba(183, 97, 74, 0.09), transparent 26%),
      var(--paper);
  }

  .login-panel::before {
    position: absolute;
    top: 28px;
    left: 28px;
    width: 55px;
    height: 32px;
    background:
      radial-gradient(circle at 14px 16px, transparent 12px, var(--terracotta) 12.5px 13px, transparent 13.5px),
      radial-gradient(circle at 35px 16px, transparent 12px, var(--sage) 12.5px 13px, transparent 13.5px);
    content: "";
    opacity: 0.8;
  }

  .admin-sidebar {
    transform: translateX(-100%);
  }

  .admin-sidebar.open {
    transform: none;
  }

  .sidebar-close {
    display: block;
  }

  .admin-main {
    margin-left: 0;
  }

  .topbar-menu {
    display: block;
  }

  .admin-topbar {
    justify-content: flex-start;
  }

  .topbar-actions {
    margin-left: auto;
  }
}

@media (max-width: 720px) {
  .admin-topbar {
    min-height: 68px;
    padding: 12px 18px;
  }

  .topbar-title p {
    display: none;
  }

  .topbar-title h1 {
    font-size: 18px;
  }

  .topbar-actions {
    gap: 12px;
  }

  .topbar-link {
    display: none;
  }

  .topbar-user {
    padding-left: 12px;
  }

  .user-name {
    display: none;
  }

  .admin-content {
    padding: 24px 18px 55px;
  }

  .overview-intro {
    align-items: flex-start;
    flex-direction: column;
    gap: 17px;
  }

  .overview-intro h2,
  .panel-heading h2 {
    font-size: 32px;
  }

  .overview-actions {
    width: 100%;
  }

  .overview-actions .admin-btn {
    flex: 1;
  }

  .overview-hero {
    display: block;
    min-height: 290px;
    padding: 25px;
  }

  .overview-hero-photos {
    position: absolute;
    right: 22px;
    bottom: 22px;
    width: 38%;
    min-height: 130px;
    opacity: 0.55;
  }

  .overview-hero-photos img {
    border-width: 3px;
  }

  .overview-hero-mark {
    left: 73%;
    opacity: 0.6;
  }

  .big-amp {
    font-size: 110px;
  }

  .big-days strong {
    font-size: 75px;
  }

  .anniversary-line {
    position: relative;
    z-index: 3;
    max-width: 250px;
  }

  .overview-stats {
    gap: 8px;
  }

  .admin-stat {
    padding: 13px;
    grid-template-columns: 28px 1fr;
  }

  .stat-icon {
    width: 25px;
    height: 25px;
  }

  .admin-stat strong {
    font-size: 22px;
  }

  .panel-card {
    padding: 18px;
  }

  .phone-access-card {
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 17px;
  }

  .phone-access-copy {
    flex-basis: calc(100% - 60px);
  }

  .phone-access-card > .admin-btn {
    width: 100%;
  }

  .quick-card {
    display: block;
  }

  .quick-card .quick-card-action {
    margin-top: 18px;
    padding: 12px 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }

  .panel-heading > .admin-btn {
    width: 100%;
  }

  .list-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .search-field {
    width: 100%;
  }

  .select-field {
    justify-content: space-between;
  }

  .select-field select {
    flex: 1;
  }

  .moment-admin-row {
    align-items: start;
    gap: 12px;
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .moment-row-thumb {
    width: 72px;
    height: 72px;
  }

  .row-actions {
    grid-column: 2;
    justify-content: flex-end;
    margin-top: -2px;
  }

  .upload-zone {
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 18px;
  }

  .upload-zone-icon {
    width: 36px;
  }

  .upload-zone > div:nth-child(2) {
    flex: 1 1 calc(100% - 58px);
  }

  .upload-zone .admin-btn {
    width: 100%;
  }

  .gallery-admin-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
  }

  .gallery-admin-summary {
    align-items: flex-start;
    flex-direction: row;
    gap: 8px;
  }

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

  .album-admin-cover {
    height: 170px;
  }

  .upload-zone-actions {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }

  .upload-album-select {
    justify-content: space-between;
  }

  .upload-album-select select {
    max-width: none;
    flex: 1;
  }

  .upload-zone-actions .admin-btn {
    width: 100%;
  }

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

  .photo-card-overlay {
    padding: 8px;
    opacity: 1;
  }

  .photo-card-info {
    display: none;
  }

  .photo-card-actions {
    margin-left: auto;
  }

  .photo-card-actions .icon-btn {
    width: 30px;
    height: 30px;
  }

  .photo-card-actions {
    gap: 2px;
  }

  .admin-preview-shell {
    padding: 44px 12px 60px;
  }

  .admin-preview figure {
    width: 100%;
    max-width: 100%;
  }

  .admin-preview-image-wrap img {
    max-height: 64vh;
  }

  .admin-preview figcaption {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .admin-preview-actions {
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
  }

  .admin-preview-nav {
    top: auto;
    bottom: 14px;
    width: 42px;
    height: 42px;
  }

  .admin-preview-nav.prev {
    left: 16px;
  }

  .admin-preview-nav.next {
    right: 16px;
  }

  .admin-preview-close {
    top: 11px;
    right: 12px;
  }

  .icon-btn {
    width: 38px;
    height: 38px;
  }

  .sidebar-close {
    width: 40px;
    height: 40px;
  }

  .admin-modal {
    width: calc(100vw - 12px);
    max-height: calc(100dvh - 16px);
  }

  .admin-modal form {
    max-height: calc(100dvh - 16px);
  }

  .modal-head h2 {
    font-size: 22px;
  }

  .field input,
  .field textarea,
  .field select,
  .search-field input,
  .select-field select {
    min-height: 48px;
    font-size: 16px;
  }

  .comment-admin-actions .icon-btn {
    width: 36px;
    height: 36px;
  }

  .settings-save-bar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .settings-save-bar .admin-btn {
    width: 100%;
  }

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

  .interaction-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
  }

  .comment-admin-row {
    gap: 11px;
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .comment-admin-avatar {
    width: 30px;
    height: 30px;
    font-size: 12px;
  }

  .comment-admin-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .comment-admin-actions {
    margin-top: -4px;
    margin-left: auto;
    grid-column: 2;
  }

  .account-layout {
    grid-template-columns: 1fr;
  }

  .account-layout .backup-card {
    grid-column: auto;
  }

  .modal-head {
    padding: 20px 18px 16px;
  }

  .modal-head h2 {
    font-size: 23px;
  }

  .modal-body {
    padding: 18px;
  }

  .modal-foot {
    padding: 13px 18px;
  }

  .modal-foot .admin-btn {
    flex: 1;
  }

  .cover-field {
    grid-template-columns: 110px 1fr;
  }

  .photo-modal-body {
    display: block;
  }

  .photo-modal-image {
    max-height: 230px;
    margin-bottom: 20px;
  }

  .photo-modal-image img {
    max-height: 230px;
  }

  .modal-close {
    width: 40px;
    height: 40px;
  }

  .admin-toast {
    right: 18px;
    bottom: 18px;
    left: 18px;
    max-width: none;
    text-align: center;
  }

  .login-panel {
    padding: 55px 24px 70px;
  }

  .back-home {
    margin-bottom: 37px;
  }
}

@media (max-width: 430px) {
  .overview-stats {
    grid-template-columns: 1fr 1fr;
  }

  .admin-stat small {
    display: none;
  }

  .anniversary-line {
    flex-wrap: wrap;
    gap: 4px 9px;
  }

  .cover-field {
    grid-template-columns: 1fr;
  }

  .cover-preview {
    height: 130px;
  }

  .confirm-actions {
    flex-direction: column-reverse;
  }

  .confirm-actions .admin-btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-view *,
  .admin-app *,
  .admin-modal * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
