body[data-page="home"] {
  --header-height: 64px;
  --home-sidebar-width: 296px;
  --home-content-inline-start: 20px;
  --home-content-inline-end: 12px;
  --home-sidebar-content-gap: 20px;
  --home-sidebar-transition-ms: 180ms;
  --home-sidebar-content-transition-ms: 120ms;
  --home-sidebar-border: rgba(255, 255, 255, 0.1);
  --home-sidebar-border-strong: rgba(148, 163, 184, 0.18);
  --home-sidebar-bg: linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.8));
  --home-sidebar-surface: rgba(255, 255, 255, 0.04);
  --home-sidebar-surface-strong: rgba(255, 255, 255, 0.08);
  --home-sidebar-panel: rgba(255, 255, 255, 0.03);
  --home-sidebar-panel-strong: rgba(255, 255, 255, 0.05);
  --home-sidebar-title: #f8fafc;
  --home-sidebar-text: #e2e8f0;
  --home-sidebar-text-muted: #cbd5e1;
  --home-sidebar-icon: rgba(226, 232, 240, 0.52);
  --home-tag-panel-bg: rgba(15, 23, 42, 0.97);
  --home-card-bg: rgba(15, 23, 42, 0.86);
  --home-card-surface: rgba(255, 255, 255, 0.04);
  --home-card-overlay: linear-gradient(180deg, rgba(2, 6, 23, 0) 0%, rgba(2, 6, 23, 0.28) 28%, rgba(2, 6, 23, 0.82) 72%, rgba(2, 6, 23, 0.94) 100%);
  --home-card-floating-bg: rgba(8, 15, 30, 0.72);
  --home-card-badge-bg: rgba(8, 15, 30, 0.74);
  --home-card-title: #f8fafc;
  --home-card-meta: rgba(226, 232, 240, 0.82);
  --home-state-bg: rgba(15, 23, 42, 0.54);
  --home-state-border: rgba(255, 255, 255, 0.14);
  --home-state-text: rgba(226, 232, 240, 0.72);
}

body[data-page="home"] .app-site-header {
  height: var(--header-height);
  min-height: 0;
  box-sizing: border-box;
}

:root[data-theme="light"] body[data-page="home"] {
  --home-sidebar-border: rgba(15, 23, 42, 0.08);
  --home-sidebar-border-strong: rgba(15, 23, 42, 0.12);
  --home-sidebar-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(244, 247, 251, 0.98));
  --home-sidebar-surface: rgba(15, 23, 42, 0.04);
  --home-sidebar-surface-strong: rgba(15, 23, 42, 0.08);
  --home-sidebar-panel: rgba(255, 255, 255, 0.74);
  --home-sidebar-panel-strong: rgba(255, 255, 255, 0.92);
  --home-sidebar-title: #142033;
  --home-sidebar-text: #22324a;
  --home-sidebar-text-muted: #51627e;
  --home-sidebar-icon: rgba(20, 32, 51, 0.46);
  --home-tag-panel-bg: rgba(255, 255, 255, 0.98);
  --home-card-bg: rgba(255, 255, 255, 0.96);
  --home-card-surface: rgba(15, 23, 42, 0.04);
  --home-card-overlay: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.42) 24%, rgba(255, 255, 255, 0.92) 68%, rgba(255, 255, 255, 0.98) 100%);
  --home-card-floating-bg: rgba(255, 255, 255, 0.82);
  --home-card-badge-bg: rgba(255, 255, 255, 0.82);
  --home-card-title: #142033;
  --home-card-meta: rgba(20, 32, 51, 0.8);
  --home-state-bg: rgba(255, 255, 255, 0.78);
  --home-state-border: rgba(15, 23, 42, 0.14);
  --home-state-text: rgba(20, 32, 51, 0.76);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) body[data-page="home"] {
    --home-sidebar-border: rgba(15, 23, 42, 0.08);
    --home-sidebar-border-strong: rgba(15, 23, 42, 0.12);
    --home-sidebar-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(244, 247, 251, 0.98));
    --home-sidebar-surface: rgba(15, 23, 42, 0.04);
    --home-sidebar-surface-strong: rgba(15, 23, 42, 0.08);
    --home-sidebar-panel: rgba(255, 255, 255, 0.74);
    --home-sidebar-panel-strong: rgba(255, 255, 255, 0.92);
    --home-sidebar-title: #142033;
    --home-sidebar-text: #22324a;
    --home-sidebar-text-muted: #51627e;
    --home-sidebar-icon: rgba(20, 32, 51, 0.46);
    --home-tag-panel-bg: rgba(255, 255, 255, 0.98);
    --home-card-bg: rgba(255, 255, 255, 0.96);
    --home-card-surface: rgba(15, 23, 42, 0.04);
    --home-card-overlay: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.42) 24%, rgba(255, 255, 255, 0.92) 68%, rgba(255, 255, 255, 0.98) 100%);
    --home-card-floating-bg: rgba(255, 255, 255, 0.82);
    --home-card-badge-bg: rgba(255, 255, 255, 0.82);
    --home-card-title: #142033;
    --home-card-meta: rgba(20, 32, 51, 0.8);
    --home-state-bg: rgba(255, 255, 255, 0.78);
    --home-state-border: rgba(15, 23, 42, 0.14);
    --home-state-text: rgba(20, 32, 51, 0.76);
  }
}

.home-page {
  min-height: calc(100vh - var(--header-height));
  min-height: calc(100dvh - var(--header-height));
  padding: 0;
}

.home-page > .app-container {
  width: 100%;
  max-width: none;
  padding-inline: 0;
}

.home-hero {
  display: none;
}

.home-shell-layout {
  position: relative;
  min-height: calc(100vh - var(--header-height));
  min-height: calc(100dvh - var(--header-height));
  width: 100%;
}

.home-shell-layout__content {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 4px var(--home-content-inline-end) 8px calc(var(--home-sidebar-width) + var(--home-sidebar-content-gap));
  transition: padding-left var(--home-sidebar-transition-ms) ease;
}

.home-shell-layout.is-sidebar-collapsed .home-shell-layout__content {
  padding-left: var(--home-content-inline-start);
}

.home-sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  display: flex;
  flex-direction: column;
  width: var(--home-sidebar-width);
  height: calc(100vh - var(--header-height));
  height: calc(100dvh - var(--header-height));
  border-right: 1px solid var(--home-sidebar-border);
  border-radius: 0;
  background: var(--home-sidebar-bg);
  box-shadow: none;
  overflow: visible;
  z-index: 80;
  transition: width var(--home-sidebar-transition-ms) ease, border-color var(--home-sidebar-transition-ms) ease, padding var(--home-sidebar-transition-ms) ease;
}

.home-sidebar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 80px;
  padding: 20px 18px;
  border-bottom: 1px solid var(--home-sidebar-border);
}

.home-sidebar__brand {
  min-width: 0;
  flex: 1;
}

.home-sidebar__brand,
.home-sidebar__body,
.home-sidebar__close {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  pointer-events: auto;
  transition:
    opacity var(--home-sidebar-content-transition-ms) ease,
    transform var(--home-sidebar-content-transition-ms) ease,
    visibility 0s linear;
}

.home-sidebar.is-content-hidden .home-sidebar__brand,
.home-sidebar.is-content-hidden .home-sidebar__body,
.home-sidebar.is-content-hidden .home-sidebar__close {
  opacity: 0;
  visibility: hidden;
  transform: translateX(-8px);
  pointer-events: none;
}


.home-sidebar__eyebrow {
  color: var(--home-card-meta);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.home-sidebar__title {
  margin-top: 4px;
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--home-sidebar-title);
}

.home-sidebar__close {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 14px;
  border: 1px solid var(--home-sidebar-border-strong);
  background: var(--home-sidebar-surface);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease, opacity 160ms ease;
}

.home-sidebar__close:hover {
  background: var(--home-sidebar-surface-strong);
  border-color: color-mix(in srgb, var(--home-sidebar-border-strong) 120%, transparent);
}

.home-sidebar__body {
  min-height: 0;
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 14px 20px;
  display: grid;
  gap: 18px;
}

.home-sidebar__section {
  display: grid;
  gap: 14px;
}

.home-sidebar__section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.home-sidebar__section-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--home-sidebar-title);
}

.home-sidebar__shortcut-list {
  display: grid;
  gap: 10px;
}

.home-sidebar__shortcut {
  min-height: 42px;
  width: 100%;
  padding: 0 14px;
  border: 1px solid var(--home-sidebar-border-strong);
  border-radius: 14px;
  background: var(--home-sidebar-surface);
  color: var(--home-sidebar-text);
  font-weight: 600;
  text-align: left;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.home-sidebar__shortcut:hover {
  background: var(--home-sidebar-surface-strong);
  border-color: color-mix(in srgb, var(--home-sidebar-border-strong) 120%, transparent);
}

.home-sidebar__shortcut.is-active {
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.24), rgba(59, 130, 246, 0.14));
  border-color: rgba(96, 165, 250, 0.36);
  color: var(--home-sidebar-title);
}

.home-sidebar__clear-button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--home-sidebar-border-strong);
  border-radius: 999px;
  background: var(--home-sidebar-surface);
  color: var(--home-sidebar-text-muted);
  font-size: 0.74rem;
  font-weight: 700;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.home-sidebar__clear-button:hover {
  background: var(--home-sidebar-surface-strong);
  border-color: color-mix(in srgb, var(--home-sidebar-border-strong) 120%, transparent);
  color: var(--home-sidebar-title);
}

.home-filter-block {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--home-sidebar-border);
  border-radius: 16px;
  background: var(--home-sidebar-panel);
}

.home-filter-block__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.home-filter-block__title {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--home-sidebar-title);
}

.home-segmented {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--home-sidebar-border-strong);
  border-radius: 999px;
  background: color-mix(in srgb, var(--home-sidebar-panel) 86%, transparent);
}

.home-segmented__button {
  min-height: 24px;
  padding: 0 10px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--home-sidebar-text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  transition: background-color 160ms ease, color 160ms ease;
}

.home-segmented__button.is-active,
.home-segmented__button[aria-pressed="true"] {
  background: rgba(59, 130, 246, 0.24);
  color: var(--home-sidebar-title);
}

.home-search-field {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.home-search-field__icon {
  position: absolute;
  top: 50%;
  left: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: var(--home-sidebar-icon);
  transform: translateY(-50%);
  pointer-events: none;
}

.home-search-field__icon::before {
  content: "";
  position: absolute;
  top: 1px;
  left: 1px;
  width: 10px;
  height: 10px;
  border: 2px solid currentColor;
  border-radius: 999px;
  box-sizing: border-box;
}

.home-search-field__icon::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 1px;
  width: 7px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform: rotate(45deg);
  transform-origin: center;
}

.home-search-field__icon svg {
  display: none;
}

.home-search-field .app-input {
  padding-left: 38px;
}

.home-search-field .app-input[type="search"] {
  -webkit-appearance: textfield;
  appearance: textfield;
}

.home-search-field .app-input[type="search"]::-webkit-search-decoration,
.home-search-field .app-input[type="search"]::-webkit-search-cancel-button,
.home-search-field .app-input[type="search"]::-webkit-search-results-button,
.home-search-field .app-input[type="search"]::-webkit-search-results-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

.home-search-field .app-input[type="search"]::-ms-clear,
.home-search-field .app-input[type="search"]::-ms-reveal {
  display: none;
  width: 0;
  height: 0;
}

.home-search-field--sidebar .app-input {
  min-height: 36px;
  padding-left: 36px;
  font-size: 0.82rem;
}

.home-search-field--sidebar .home-search-field__icon {
  left: 11px;
  width: 14px;
  height: 14px;
}

.home-search-field--sidebar .home-search-field__icon::before {
  top: 1px;
  left: 1px;
  width: 9px;
  height: 9px;
}

.home-search-field--sidebar .home-search-field__icon::after {
  right: 0;
  bottom: 1px;
  width: 6px;
}

.home-search-field--sidebar .home-search-field__icon svg {
  display: none;
}

.home-filter-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  overflow: hidden;
}

.home-filter-chip {
  min-height: 28px;
  max-width: 100%;
  padding: 0 10px;
  border: 1px solid var(--home-sidebar-border);
  border-radius: 999px;
  background: var(--home-sidebar-surface);
  color: var(--home-sidebar-text);
  font-size: 0.74rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.home-filter-chip.is-active,
.home-filter-chip[aria-pressed="true"] {
  background: rgba(59, 130, 246, 0.18);
  border-color: rgba(96, 165, 250, 0.34);
  color: var(--home-sidebar-title);
}

/* ── Tag search suggestion ──────────────────────────────────────────────── */

.home-tag-search-wrap {
  position: relative;
}

.home-tag-sug-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 100;
  border: 1px solid var(--home-sidebar-border);
  border-radius: 10px;
  background: var(--home-tag-panel-bg);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  overflow-y: auto;
  max-height: calc(10 * 34px);
}

.home-tag-sug-list {
  display: flex;
  flex-direction: column;
  padding: 4px;
}

.home-tag-sug-item {
  display: flex;
  align-items: center;
  padding: 6px 10px;
  border: none;
  background: none;
  font-size: 0.8rem;
  color: var(--home-sidebar-text);
  cursor: pointer;
  border-radius: 6px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.1s ease;
}

.home-tag-sug-item:hover {
  background: var(--home-sidebar-surface-strong);
  color: var(--home-sidebar-title);
}

.home-tag-sug-mark {
  background: none;
  color: var(--home-sidebar-title);
  font-weight: 700;
}

/* ── +more button ───────────────────────────────────────────────────────── */

.home-tag-more-btn {
  font-size: 0.72rem;
  color: rgba(96, 165, 250, 0.8);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color 0.12s ease, background 0.12s ease;
  text-align: left;
}

.home-tag-more-btn:hover {
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.1);
}

.home-filter-color-list {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.home-filter-color {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 2px solid color-mix(in srgb, var(--home-sidebar-border-strong) 110%, transparent);
  background: var(--filter-color, rgba(255, 255, 255, 0.1));
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.home-filter-color.is-active,
.home-filter-color[aria-pressed="true"] {
  border-color: var(--home-sidebar-title);
  box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.22);
  transform: translateY(-1px);
}

.home-filter-preset-list {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.home-filter-preset {
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid var(--home-sidebar-border-strong);
  border-radius: 999px;
  background: var(--home-sidebar-surface);
  color: var(--home-sidebar-text);
  font-size: 0.72rem;
  font-weight: 700;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.home-filter-preset.is-active,
.home-filter-preset[aria-pressed="true"] {
  background: rgba(59, 130, 246, 0.18);
  border-color: rgba(96, 165, 250, 0.34);
  color: var(--home-sidebar-title);
}

.home-filter-date-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.home-filter-date-grid .app-input {
  min-height: 36px;
  font-size: 0.8rem;
}

.home-archive-list {
  display: grid;
  gap: 12px;
}

.home-archive-year {
  overflow: hidden;
  border: 1px solid var(--home-sidebar-border);
  border-radius: 14px;
  background: var(--home-sidebar-panel);
}

.home-archive-year[open] {
  background: var(--home-sidebar-panel-strong);
}

.home-archive-year__summary {
  list-style: none;
  padding: 12px 14px;
  cursor: pointer;
  color: var(--home-sidebar-title);
  font-size: 0.82rem;
  font-weight: 700;
}

.home-archive-year__summary::-webkit-details-marker {
  display: none;
}

.home-archive-year__summary::after {
  content: "▾";
  float: right;
  color: var(--home-sidebar-text-muted);
  transition: transform 160ms ease;
}

.home-archive-year:not([open]) .home-archive-year__summary::after {
  transform: rotate(-90deg);
}

.home-archive-months {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  padding: 0 14px 14px;
}

.home-archive-month {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--home-sidebar-border-strong);
  border-radius: 10px;
  background: var(--home-sidebar-surface);
  color: var(--home-sidebar-text-muted);
  font-size: 0.76rem;
  font-weight: 700;
  text-align: left;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.home-archive-month.is-active,
.home-archive-month[aria-pressed="true"] {
  background: rgba(59, 130, 246, 0.18);
  border-color: rgba(96, 165, 250, 0.34);
  color: var(--home-sidebar-title);
}

.home-sidebar.is-collapsed {
  width: 0;
  padding: 0;
  border-right-color: transparent;
  background: transparent;
  overflow: hidden;
}


.home-sidebar.is-collapsed .home-sidebar__header {
  min-height: 0;
  padding: 0;
  border-bottom: none;
}

.app-shell-toggle {
  position: fixed;
  top: calc(var(--header-height) + 18px);
  left: 0;
  z-index: 90;
  transition: opacity 160ms ease, transform 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

body:not(.is-home-sidebar-collapsed) .app-shell-toggle {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-12px);
}

body.is-home-sidebar-collapsed .app-shell-toggle {
  width: 30px;
  height: 72px;
  padding: 0;
  border-radius: 0 999px 999px 0;
  border: 1px solid color-mix(in srgb, var(--home-sidebar-border-strong) 110%, transparent);
  background: var(--home-sidebar-bg);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transform: translateX(-12px);
  opacity: 0;
  pointer-events: none;
  z-index: 90;
}

body.is-home-sidebar-collapsed .app-shell-toggle span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.96rem;
  font-weight: 700;
  transform: translateX(1px);
}

body.is-home-sidebar-collapsed.is-home-sidebar-edge-peek .app-shell-toggle,
body.is-home-sidebar-collapsed .app-shell-toggle:focus-visible {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}


.home-status {
  margin-bottom: 6px;
  padding-inline: 4px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.home-status__summary {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1 1 420px;
}

.home-status__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.home-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--home-sidebar-border);
  border-radius: 999px;
  background: var(--home-sidebar-panel);
  color: var(--home-sidebar-text);
}

.home-status-chip__label {
  color: var(--home-sidebar-text-muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.home-status-chip__value {
  color: var(--home-sidebar-title);
  font-size: 0.78rem;
  font-weight: 700;
}

.home-status__actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.home-status__sort-field {
  margin: 0;
  min-width: 148px;
}

.home-grid-columns {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.home-grid-columns__button {
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--home-sidebar-border-strong);
  border-radius: 12px;
  background: var(--home-sidebar-surface);
  color: var(--home-sidebar-text-muted);
  font-weight: 700;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.home-grid-columns__button:hover {
  background: var(--home-sidebar-surface-strong);
  border-color: color-mix(in srgb, var(--home-sidebar-border-strong) 120%, transparent);
}

.home-grid-columns__button.is-active {
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.24), rgba(59, 130, 246, 0.16));
  border-color: rgba(96, 165, 250, 0.36);
  color: var(--home-sidebar-title);
}

.home-gallery-section {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.home-shell-layout__content.is-home-empty-layout {
  height: calc(100vh - var(--header-height));
  height: calc(100dvh - var(--header-height));
  box-sizing: border-box;
  overflow: hidden;
}

.home-state-card {
  padding: 18px 20px;
  border: 1px dashed var(--home-state-border);
  border-radius: 18px;
  background: var(--home-state-bg);
  color: var(--home-state-text);
}

.home-state-card--error {
  border-style: solid;
  color: #fca5a5;
}

.home-state-card--loading,
.home-state-card--empty {
  flex: 1 1 auto;
  min-height: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-align: center;
}

.home-state-card--empty {
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

.home-loading-state__spinner {
  width: 64px;
  height: 64px;
  border: 5px solid color-mix(in srgb, var(--home-state-border) 92%, transparent);
  border-top-color: color-mix(in srgb, var(--home-sidebar-title) 86%, transparent);
  border-radius: 50%;
  animation: home-loading-spin 0.9s linear infinite;
}

.home-empty-state__icon {
  position: relative;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  margin: 0;
  color: color-mix(in srgb, var(--home-state-text) 78%, transparent);
}

.home-empty-state__icon::before {
  content: "";
  position: absolute;
  top: 5px;
  left: 5px;
  width: 22px;
  height: 22px;
  border: 3px solid currentColor;
  border-radius: 50%;
  box-sizing: border-box;
}

.home-empty-state__icon::after {
  content: "";
  position: absolute;
  left: 24px;
  top: 24px;
  width: 14px;
  height: 3px;
  border-radius: 999px;
  background: currentColor;
  transform: rotate(45deg);
  transform-origin: left center;
}

.home-loading-state__message,
.home-empty-state__message {
  color: var(--home-sidebar-title);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
}

@keyframes home-loading-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.home-gallery-grid {
  --home-grid-columns: 3;
  --home-card-media-ratio: 5 / 4;
  display: grid;
  grid-template-columns: repeat(var(--home-grid-columns), minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.home-gallery-grid[data-grid-cols="1"] {
  --home-grid-columns: 1;
  --home-card-media-ratio: 16 / 9;
}

.home-gallery-grid[data-grid-cols="2"] {
  --home-grid-columns: 2;
  --home-card-media-ratio: 4 / 3;
}

.home-gallery-grid[data-grid-cols="3"] {
  --home-grid-columns: 3;
}

.home-gallery-grid[data-grid-cols="4"] {
  --home-grid-columns: 4;
  --home-card-media-ratio: 1 / 1;
}

.home-gallery-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--home-sidebar-border);
  border-radius: 18px;
  background: var(--home-card-bg);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.24);
}

.home-gallery-card__media {
  display: block;
  height: auto;
  aspect-ratio: var(--home-card-media-ratio);
  background: var(--home-card-surface);
}

.home-gallery-grid[data-grid-cols="1"] .home-gallery-card__media {
  aspect-ratio: var(--home-card-media-ratio);
}

.home-gallery-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.home-gallery-card__image-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--home-state-text);
}
.home-gallery-card__badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  min-width: 42px;
  height: 28px;
  padding: 0 10px 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  border-radius: 999px;
  background: var(--home-card-badge-bg);
  border: 1px solid color-mix(in srgb, var(--home-sidebar-border-strong) 120%, transparent);
  color: var(--home-card-title);
  font-size: 0.76rem;
  font-weight: 700;
  backdrop-filter: blur(10px);
  pointer-events: none;
}

.home-gallery-card__badge::before,
.home-gallery-card__badge::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 12px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.08);
  left: 10px;
}

.home-gallery-card__badge::before {
  transform: translate(-3px, 1px);
  opacity: 0.56;
}

.home-gallery-card__badge::after {
  transform: translate(0, -1px);
}

.home-gallery-card__badge-count {
  margin-left: 12px;
}


.home-gallery-card__body {
  position: absolute;
  inset: auto 0 0 0;
  display: grid;
  gap: 8px;
  padding: 34px 14px 14px;
  background: var(--home-card-overlay);
  pointer-events: none;
}

.home-gallery-card__title {
  font-weight: 700;
  color: var(--home-card-title);
  word-break: break-word;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.home-gallery-card__meta {
  color: var(--home-card-meta);
  font-size: 0.8rem;
  word-break: break-word;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-gallery-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.home-gallery-card__meta {
  min-width: 0;
  flex: 1 1 auto;
}

.home-gallery-card__user {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid color-mix(in srgb, var(--home-sidebar-border-strong) 120%, transparent);
  border-radius: 50%;
  background: var(--home-card-floating-bg);
  color: var(--home-card-title);
  cursor: pointer;
  pointer-events: auto;
  overflow: hidden;
  flex-shrink: 0;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.home-gallery-card__user:hover {
  border-color: rgba(255, 255, 255, 0.4);
  transform: scale(1.05);
}

.home-gallery-card__user-avatar {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
}

.home-gallery-card__user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-gallery-card__like {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 62px;
  height: 34px;
  padding: 0 11px;
  border: 1px solid color-mix(in srgb, var(--home-sidebar-border-strong) 120%, transparent);
  border-radius: 999px;
  background: var(--home-card-floating-bg);
  color: var(--home-card-title);
  cursor: pointer;
  pointer-events: auto;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.home-gallery-card__like:hover {
  transform: translateY(-1px);
  background: rgba(15, 23, 42, 0.9);
}

.home-gallery-card__like.is-active {
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(127, 29, 29, 0.72);
  color: #fecaca;
}

.home-gallery-card__like.is-pending {
  opacity: 0.72;
  pointer-events: none;
}

.home-gallery-card__like-icon {
  font-size: 15px;
  line-height: 1;
}

.home-gallery-card__like-count {
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
}

.home-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 8px;
  padding-inline: 4px;
}

.home-pagination__meta {
  color: var(--home-state-text);
  font-size: 0.88rem;
}

@media (max-width: 980px) {
  .home-page > .app-container {
    padding-inline: 8px;
  }

  .home-status__actions {
    width: 100%;
    justify-content: space-between;
  }

  .home-status__summary {
    flex-basis: 100%;
  }

  .home-status__sort-field {
    flex: 1 1 180px;
  }

  .home-shell-layout {
    min-height: 0;
  }

  .home-shell-layout__content,
  .home-shell-layout.is-sidebar-collapsed .home-shell-layout__content {
    padding: 12px 0 0;
    min-height: 0;
  }

  .home-shell-layout__content.is-home-empty-layout,
  .home-shell-layout.is-sidebar-collapsed .home-shell-layout__content.is-home-empty-layout {
    height: auto;
    overflow: visible;
  }

  .home-sidebar {
    position: static;
    top: auto;
    left: auto;
    width: auto;
    height: auto;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: auto;
  }

  .home-gallery-grid {
    grid-template-columns: 1fr;
  }

  .home-gallery-grid[data-grid-cols="1"],
  .home-gallery-grid[data-grid-cols="2"],
  .home-gallery-grid[data-grid-cols="3"],
  .home-gallery-grid[data-grid-cols="4"] {
    --home-grid-columns: 1;
  }

  .home-grid-columns,
  .home-grid-columns__button {
    display: none !important;
  }

  body.is-home-sidebar-collapsed .app-shell-toggle {
    top: calc(var(--header-height) + 14px);
  }
}

@media (max-width: 720px) {
  .home-status,
  .home-pagination {
    align-items: stretch;
  }

  .home-status__meta {
    gap: 6px;
  }

  .home-status-chip {
    width: 100%;
    justify-content: space-between;
  }

  .home-status__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .home-segmented,
  .home-filter-preset-list,
  .home-filter-date-grid {
    width: 100%;
  }

  .home-filter-date-grid {
    grid-template-columns: 1fr;
  }

  .home-gallery-grid {
    --home-card-media-ratio: 4 / 3;
  }
}

/* ── Header search field with owner badge ───────────────────────────────── */

.home-header-search-field {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.home-header-search-field .home-search-owner-badge {
  position: absolute;
  left: 36px;
  z-index: 2;
  pointer-events: auto;
}

.home-header-search-input {
  flex: 1 1 0;
  min-width: 0;
}


/* ── Header search suggest ──────────────────────────────────────────────── */

.home-header-search-wrap {
  position: relative;
  width: 100%;
}

.home-search-sug-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 110;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg-elevated);
  box-shadow: var(--shadow-2);
  overflow: hidden;
}

.home-search-sug-section {
  padding: 4px 0;
}

.home-search-sug-section + .home-search-sug-section {
  border-top: 1px solid var(--color-border);
}

.home-search-sug-section__heading {
  padding: 6px 14px 2px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-faint);
}

.home-search-sug-section__list {
  display: flex;
  flex-direction: column;
}

.home-search-sug-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  border: none;
  background: none;
  color: var(--color-text-muted);
  font-size: 0.875rem;
  cursor: pointer;
  text-align: left;
  transition: background 0.1s ease, color 0.1s ease;
}

.home-search-sug-item:hover,
.home-search-sug-item.is-focused {
  background: var(--color-surface);
  color: var(--color-text);
}

.home-search-sug-item__thumb {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--color-surface);
}

.home-search-sug-item__thumb--avatar {
  border-radius: 999px;
}

.home-search-sug-item__thumb--initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-primary) 24%, transparent);
}

.home-search-sug-item__thumb--tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text-faint);
  background: var(--color-surface-strong);
}

.home-search-sug-item__text {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-search-sug-item__sub {
  font-size: 0.75rem;
  color: var(--color-text-faint);
  flex-shrink: 0;
}

.home-search-sug-mark {
  font-weight: 700;
  color: var(--color-text);
  background: none;
}

.home-search-sug-empty {
  padding: 5px 14px;
  font-size: 0.8rem;
  color: var(--color-text-faint);
}

.home-search-sug-noresult {
  padding: 12px 14px;
  font-size: 0.84rem;
  color: var(--color-text-faint);
  text-align: center;
}

/* ── User filter badge ──────────────────────────────────────────────────── */

.home-search-owner-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  height: 22px;
  padding: 0 4px 0 8px;
  border-radius: var(--radius-round);
  background: color-mix(in srgb, var(--color-primary) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-primary) 36%, transparent);
  font-size: 0.75rem;
  color: var(--color-primary-strong);
  white-space: nowrap;
}

.home-search-owner-badge__label {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-search-owner-badge__clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  font-size: 0.7rem;
  line-height: 1;
  color: var(--color-primary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.1s ease;
}

.home-search-owner-badge__clear:hover {
  background: color-mix(in srgb, var(--color-primary) 20%, transparent);
}

/* ── Mobile sidebar drawer ──────────────────────────────────────────────── */

.home-sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 190;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
}

/* ── Mobile toolbar ─────────────────────────────────────────────────────── */

.home-mobile-toolbar {
  display: none;
}

/* ── Mobile search modal ────────────────────────────────────────────────── */

.home-mobile-search-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
}

.home-mobile-search-modal__inner {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.home-mobile-search-modal__header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.home-mobile-search-modal__field-wrap {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
}

.home-mobile-search-modal__input {
  flex: 1 1 0;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 0;
  height: 100%;
}

.home-mobile-search-modal__close {
  flex-shrink: 0;
  font-size: 1.1rem;
}

.home-search-sug-panel--mobile {
  position: static;
  border: none;
  border-radius: 0;
  box-shadow: none;
  flex: 1 1 0;
  overflow-y: auto;
}

@media (max-width: 768px) {
  /* Mobile toolbar visible */
  .home-mobile-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px 4px;
  }

  .home-mobile-toolbar__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 14px;
    border-radius: var(--radius-round);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text-muted);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
  }

  .home-mobile-toolbar__btn:hover,
  .home-mobile-toolbar__btn.is-active {
    background: var(--color-surface-strong);
    color: var(--color-text);
  }

  /* Search icon */
  .home-mobile-toolbar__icon--search::before {
    content: "🔍";
    font-size: 0.9rem;
  }

  /* Filter icon */
  .home-mobile-toolbar__icon--filter::before {
    content: "⊟";
    font-size: 1rem;
  }

  /* Sidebar becomes drawer overlay */
  .home-sidebar {
    position: fixed !important;
    top: var(--header-height) !important;
    left: 0 !important;
    width: min(296px, 88vw) !important;
    height: calc(100dvh - var(--header-height)) !important;
    border-right: 1px solid var(--color-border) !important;
    border-bottom: none !important;
    z-index: 200 !important;
    transform: translateX(-110%);
    transition: transform 200ms ease !important;
  }

  .home-sidebar:not(.is-collapsed) {
    transform: translateX(0);
  }

  /* Content always full width */
  .home-shell-layout__content,
  .home-shell-layout.is-sidebar-collapsed .home-shell-layout__content {
    padding: 0 4px 0 !important;
  }

  /* Hide desktop sidebar toggle */
  .app-shell-toggle {
    display: none !important;
  }
}
