@import url("https://fonts.googleapis.com/css2?family=Fraunces:ital,wght@0,300;0,400;1,300&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap");

:root {
  color-scheme: dark;
  --bg: #000;
  --bg-2: #070707;
  --bg-3: #101010;
  --ink: #f2eee6;
  --ink-2: #b8b2a8;
  --ink-3: #716c63;
  --line: rgba(242, 238, 230, 0.1);
  --line-strong: rgba(242, 238, 230, 0.24);
  --accent: #d4a574;
  --danger: #e07070;
  --shadow: rgba(0, 0, 0, 0.72);
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, monospace;
  --font-cn: "PingFang SC", "Songti SC", "Noto Serif SC", serif;
  --max: 1440px;
  --gutter: clamp(20px, 4vw, 56px);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: dark;
    --bg: #000;
    --bg-2: #070707;
    --bg-3: #101010;
    --ink: #f2eee6;
    --ink-2: #b8b2a8;
    --ink-3: #716c63;
    --line: rgba(242, 238, 230, 0.1);
    --line-strong: rgba(242, 238, 230, 0.24);
    --accent: #d4a574;
    --shadow: rgba(0, 0, 0, 0.72);
  }
}

:root[data-theme="light"] {
  color-scheme: dark;
  --bg: #000;
  --bg-2: #070707;
  --bg-3: #101010;
  --ink: #f2eee6;
  --ink-2: #b8b2a8;
  --ink-3: #716c63;
  --line: rgba(242, 238, 230, 0.1);
  --line-strong: rgba(242, 238, 230, 0.24);
  --accent: #d4a574;
  --shadow: rgba(0, 0, 0, 0.72);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background: #000;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  padding: 0;
  color: inherit;
  background: none;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

.app-shell {
  min-height: 100dvh;
}

.home-header {
  max-width: var(--max);
  margin: 0 auto clamp(40px, 5vw, 72px);
  padding: clamp(28px, 4vw, 44px) var(--gutter) clamp(30px, 4vw, 54px);
  display: grid;
  grid-template-columns: auto minmax(220px, 460px) auto;
  align-items: center;
  gap: clamp(16px, 3vw, 32px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 14px;
  min-width: 0;
}

.brand-mark {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(212, 165, 116, 0.12);
  flex: 0 0 auto;
  align-self: center;
}

.brand-title {
  font-family: var(--font-cn);
  font-size: clamp(20px, 2vw, 26px);
  font-weight: 400;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.brand-sub {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  white-space: nowrap;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-2) 84%, transparent);
  border-radius: 4px;
}

.search-box svg {
  width: 15px;
  height: 15px;
  color: var(--ink-3);
  flex: 0 0 auto;
}

.search-input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.search-input::placeholder {
  color: var(--ink-3);
}

.header-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.archive-count {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
}

.theme-toggle {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.22s, border-color 0.22s, color 0.22s, transform 0.22s;
}

.theme-toggle:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #18120a;
  transform: translateY(-1px);
}

.theme-toggle svg {
  width: 16px;
  height: 16px;
}

.home-body,
.detail {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter) clamp(80px, 10vw, 140px);
}

.home-tabs-section {
  margin-top: 0;
}

.tabs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(14px, 3vw, 28px);
  margin-bottom: clamp(28px, 4vw, 44px);
}

.home-tabs {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(145px, 1fr));
  gap: 2px;
  width: min(100%, 720px);
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #050505;
}

.home-tab {
  min-width: 0;
  min-height: 54px;
  padding: 10px 16px;
  border-radius: 2px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  align-items: center;
  color: var(--ink-3);
  text-align: left;
  transition: background 0.2s, color 0.2s;
}

.home-tab:hover {
  color: var(--ink-2);
  background: rgba(242, 238, 230, 0.04);
}

.home-tab.active {
  color: var(--ink);
  background: var(--bg-3);
}

.home-tab-title {
  font-family: var(--font-cn);
  font-size: 16px;
  letter-spacing: 0.05em;
}

.home-tab-sub,
.home-tab-count {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.home-tab-sub {
  grid-column: 1;
}

.home-tab-count {
  grid-column: 2;
  grid-row: 1 / 3;
  color: var(--accent);
  font-feature-settings: "tnum";
}

.tab-refresh.is-hidden {
  visibility: hidden;
  pointer-events: none;
}

.tab-tools {
  min-width: min(100%, 520px);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.photo-order-control {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #050505;
}

.photo-order-control.is-hidden {
  display: none;
}

.photo-order-btn {
  min-height: 30px;
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  transition: background 0.2s, color 0.2s;
}

.photo-order-btn.active {
  background: var(--accent);
  color: #18120a;
}

.photo-size-control.is-hidden {
  display: none;
}

.photo-size-control {
  width: min(100%, 360px);
}

.tab-panel {
  min-height: 60vh;
}

.infinite-status {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.end-label {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.infinite-sentinel {
  width: 100%;
  height: 1px;
}

.home-section {
  margin-top: clamp(72px, 9vw, 128px);
  padding-top: clamp(40px, 5vw, 64px);
  border-top: 1px solid var(--line);
}

.home-section-first {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: clamp(32px, 4vw, 48px);
}

.section-title {
  margin: 0;
  font-family: var(--font-cn);
  font-size: clamp(22px, 2.4vw, 34px);
  font-weight: 400;
  letter-spacing: 0.06em;
}

.section-sub {
  margin: 6px 0 0;
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.albums-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(44px, 6vw, 80px) clamp(18px, 3vw, 40px);
}

.album-pages {
  display: flex;
  flex-direction: column;
  gap: clamp(44px, 6vw, 80px);
}

.album-page {
  contain: layout paint style;
  content-visibility: auto;
  contain-intrinsic-size: 1800px;
}

.album-page.is-placeholder {
  display: block;
  overflow: hidden;
}

.album-card {
  display: block;
  position: relative;
  width: 100%;
  min-width: 0;
  border: 0;
  text-align: left;
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px);
  animation: cardIn 0.62s cubic-bezier(0.2, 0.6, 0.2, 1) forwards;
}

@keyframes cardIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.album-cover {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--bg-2);
  border-radius: 2px;
  box-shadow: 0 0 0 1px var(--line) inset, 0 30px 60px -34px var(--shadow);
  transition: box-shadow 0.6s, transform 0.6s cubic-bezier(0.2, 0.6, 0.2, 1);
}

.album-card:hover .album-cover {
  transform: translateY(-4px);
  box-shadow: 0 0 0 1px var(--line-strong) inset, 0 40px 80px -18px var(--shadow);
}

.album-cover img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  filter: brightness(0.78) saturate(0.92);
  transition: opacity 0.7s, filter 0.5s, transform 1.2s cubic-bezier(0.2, 0.6, 0.2, 1);
}

.album-cover img.loaded {
  opacity: 1;
}

.album-cover img.broken,
.jr-item img.broken,
.lb-img.broken {
  opacity: 0.28;
}

.album-card:hover .album-cover img {
  filter: brightness(1) saturate(1);
  transform: scale(1.03);
}

.album-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(0, 0, 0, 0.8));
  pointer-events: none;
}

.album-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 18px 20px;
  color: #f3ede0;
  pointer-events: none;
}

.album-overlay-title {
  display: -webkit-box;
  overflow: hidden;
  font-family: var(--font-cn);
  font-size: clamp(15px, 1.35vw, 20px);
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.5);
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow-wrap: anywhere;
}

.album-overlay-count {
  margin-top: 6px;
  color: rgba(239, 233, 220, 0.72);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hover-arrow {
  position: absolute;
  z-index: 3;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #18120a;
  opacity: 0;
  transform: translate(-4px, 4px);
  transition: opacity 0.24s, transform 0.24s;
}

.album-card:hover .hover-arrow {
  opacity: 1;
  transform: translate(0);
}

.refresh-btn,
.more-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 10px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: background 0.24s, border-color 0.24s, color 0.24s;
}

.refresh-btn:hover,
.more-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #18120a;
}

.refresh-btn svg {
  width: 13px;
  height: 13px;
}

.refresh-btn.spinning svg {
  animation: spin 0.8s cubic-bezier(0.5, 0, 0.2, 1);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.search-results {
  min-height: 240px;
}

.empty-state {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
  padding: 56px 0;
}

.home-footer {
  margin-top: clamp(56px, 8vw, 96px);
  display: flex;
  justify-content: center;
}

.appreciate {
  position: relative;
  width: 100%;
  max-width: 560px;
  padding: 30px 34px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg-2);
}

.appreciate::before,
.appreciate::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border: 1px solid var(--accent);
}

.appreciate::before {
  top: -1px;
  left: -1px;
  border-right: 0;
  border-bottom: 0;
}

.appreciate::after {
  right: -1px;
  bottom: -1px;
  border-left: 0;
  border-top: 0;
}

.appreciate-label {
  display: block;
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.appreciate-title {
  display: block;
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: 22px;
  font-style: italic;
  font-weight: 300;
  line-height: 1.35;
}

.detail {
  padding-top: clamp(28px, 4vw, 48px);
}

.detail-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: clamp(44px, 6vw, 72px);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: color 0.2s;
}

.back-link:hover {
  color: var(--accent);
}

.back-link .arrow {
  display: flex;
  transition: transform 0.2s;
}

.back-link:hover .arrow {
  transform: translateX(-4px);
}

.detail-top-right {
  display: inline-flex;
  align-items: center;
  gap: clamp(12px, 2vw, 18px);
}

.detail-counter {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  white-space: nowrap;
}

.detail-title {
  max-width: 1180px;
  margin: 0 0 clamp(36px, 5vw, 64px);
  font-family: var(--font-cn);
  font-size: clamp(34px, 5.2vw, 72px);
  font-weight: 300;
  line-height: 1.12;
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
}

.detail-like-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: clamp(-28px, -3vw, -36px) 0 clamp(40px, 5vw, 64px);
}

.detail-like-group {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.album-like {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12px;
  transition: background 0.2s, border-color 0.2s, transform 0.12s;
}

.album-like:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.album-like:active {
  transform: scale(0.96);
}

.album-like svg.popping {
  animation: likePop 0.36s cubic-bezier(0.2, 0.7, 0.3, 1.4);
}

@keyframes likePop {
  40% {
    transform: scale(1.35);
  }
}

.detail-like-hint {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
}

.detail-size-control {
  width: min(100%, 360px);
  min-height: 38px;
  flex: 0 1 360px;
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr) 46px;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #050505;
  color: var(--ink-2);
}

.detail-size-label,
.detail-size-value {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.detail-size-value {
  color: var(--accent);
  text-align: right;
  font-feature-settings: "tnum";
}

.detail-size-control input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.justified-rows {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
}

.jr-item {
  position: relative;
  flex: 0 0 auto;
  max-width: 100%;
  overflow: hidden;
  background: var(--bg-2);
  border-radius: 1px;
  cursor: zoom-in;
}

.jr-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  filter: brightness(0.86);
  transition: opacity 0.6s, filter 0.35s, transform 1s cubic-bezier(0.2, 0.6, 0.2, 1);
}

.jr-item img.loaded {
  opacity: 1;
}

.jr-item:hover img {
  filter: brightness(1);
  transform: scale(1.03);
}

.photos-waterfall {
  min-height: 45vh;
}

.photo-pages {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.detail-photo-pages {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.photo-page,
.detail-photo-page {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
  contain: layout paint style;
  content-visibility: auto;
  contain-intrinsic-size: 1200px;
}

.photo-page.is-placeholder,
.detail-photo-page.is-placeholder {
  overflow: hidden;
}

.photo-tab-item {
  cursor: zoom-in;
}

.detail-loading {
  min-height: 70dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--ink-3);
}

.detail-loading-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.2s ease-in-out infinite;
}

.detail-loading-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.detail-loading-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.3;
  }
  50% {
    opacity: 1;
  }
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  background: rgba(8, 7, 6, 0.97);
  color: #f3ede0;
}

.lb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  color: rgba(239, 233, 220, 0.72);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.lb-close,
.lb-nav {
  border: 1px solid rgba(239, 233, 220, 0.16);
  color: #f3ede0;
  background: rgba(239, 233, 220, 0.04);
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.lb-close:hover,
.lb-nav:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #18120a;
}

.lb-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lb-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 80px;
}

.lb-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.35s;
}

.lb-img.loaded {
  opacity: 1;
}

.lb-nav {
  position: absolute;
  top: 50%;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: translateY(-50%);
}

.lb-nav.prev {
  left: 16px;
}

.lb-nav.next {
  right: 16px;
}

.lb-nav:disabled {
  opacity: 0.24;
  cursor: default;
}

.lb-nav:disabled:hover {
  border-color: rgba(239, 233, 220, 0.16);
  background: rgba(239, 233, 220, 0.04);
  color: #f3ede0;
}

.lb-footer {
  display: flex;
  justify-content: center;
  padding: 12px 16px 22px;
}

.lb-thumbs {
  display: flex;
  gap: 8px;
  max-width: 100%;
  overflow-x: auto;
  padding: 4px 2px;
  scroll-behavior: smooth;
}

.lb-thumb {
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 2px;
  opacity: 0.42;
  transition: opacity 0.2s, border-color 0.2s;
}

.lb-thumb:hover {
  opacity: 0.8;
}

.lb-thumb.active {
  border-color: var(--accent);
  opacity: 1;
}

.lb-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lb-heart {
  position: absolute;
  z-index: 20;
  color: #ff4d6d;
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: lbHeart 0.72s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}

@keyframes lbHeart {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.3);
  }
  25% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.15);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -130%) scale(0.9);
  }
}

.error-panel {
  max-width: 620px;
  margin: 18vh auto;
  padding: 0 var(--gutter);
  text-align: center;
}

.error-panel h1 {
  margin: 0 0 12px;
  font-family: var(--font-cn);
  font-weight: 400;
}

.error-panel p {
  margin: 0 0 24px;
  color: var(--ink-2);
}

@media (max-width: 1100px) {
  .albums-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .home-header {
    grid-template-columns: 1fr auto;
  }

  .search-box {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .archive-count {
    display: none;
  }
}

@media (max-width: 760px) {
  .albums-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 40px 16px;
  }

  .album-pages {
    gap: 40px;
  }

  .tabs-head {
    align-items: stretch;
    flex-direction: column;
  }

  .home-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .tab-tools {
    width: 100%;
    min-width: 0;
    flex-wrap: wrap;
    justify-content: stretch;
  }

  .photo-order-control {
    width: fit-content;
  }

  .photo-size-control {
    flex: 1 1 260px;
  }

  .tab-refresh {
    width: fit-content;
  }

  .tab-refresh.is-hidden {
    display: none;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .lb-stage {
    padding: 0 16px;
  }

  .lb-nav {
    width: 42px;
    height: 42px;
  }

  .lb-nav.prev {
    left: 8px;
  }

  .lb-nav.next {
    right: 8px;
  }
}

@media (max-width: 520px) {
  .home-header {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .brand {
    align-items: center;
  }

  .brand-sub {
    display: none;
  }

  .albums-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .album-pages {
    gap: 36px;
  }

  .home-tabs {
    grid-template-columns: 1fr;
  }

  .home-tab {
    min-height: 50px;
  }

  .album-overlay {
    padding: 18px;
  }

  .detail-top {
    align-items: flex-start;
  }

  .detail-counter {
    display: none;
  }

  .detail-like-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .detail-like-group {
    align-items: flex-start;
    flex-direction: column;
  }

  .detail-size-control {
    width: 100%;
    flex-basis: auto;
    grid-template-columns: 1fr;
    border-radius: 4px;
  }

  .detail-size-value {
    text-align: left;
  }

  .justified-rows {
    gap: 5px;
  }

  .photo-pages,
  .photo-page {
    gap: 5px;
  }

  .lb-header {
    padding: 16px;
  }

  .lb-thumb {
    width: 44px;
    height: 44px;
  }
}
