/* ================================================================
   Lumen — private photo library
   ================================================================ */

:root {
  --bg: #0b0c0f;
  --bg-soft: #0f1116;
  --panel: #13151b;
  --panel-2: #181b23;
  --line: #252a35;
  --line-soft: #1b1f28;
  --text: #f1f2f5;
  --muted: #9aa2b0;
  --muted-2: #6c7482;
  --accent: #f0b46b;
  --accent-soft: #ffd9a8;
  --accent-ink: #1d1305;
  --danger: #ff7b7b;
  --danger-soft: rgba(255, 123, 123, 0.12);
  --ok: #74e0b4;
  --radius: 16px;
  --radius-sm: 11px;
  --shadow-lg: 0 30px 70px rgba(0, 0, 0, 0.55);
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.35);
  --sans: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, ui-serif, serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.no-scroll {
  overflow: hidden;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

input,
textarea,
select {
  font: inherit;
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

::selection {
  background: rgba(240, 180, 107, 0.32);
}

/* Scrollbars ---------------------------------------------------- */
* {
  scrollbar-width: thin;
  scrollbar-color: #2b313d transparent;
}
*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
*::-webkit-scrollbar-thumb {
  background: #2b313d;
  border-radius: 99px;
  border: 3px solid transparent;
  background-clip: content-box;
}

/* ================================================================
   Primitives
   ================================================================ */

.brand {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}
.brand.big {
  font-size: 26px;
}
.brand .dot {
  color: var(--accent);
}

.muted {
  color: var(--muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
  white-space: nowrap;
}
.btn:hover {
  background: #1e222b;
  border-color: #333a48;
}
.btn:active {
  transform: translateY(1px);
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn.primary {
  background: linear-gradient(180deg, var(--accent-soft), var(--accent));
  border-color: transparent;
  color: var(--accent-ink);
  box-shadow: 0 8px 22px rgba(240, 180, 107, 0.18);
}
.btn.primary:hover {
  background: linear-gradient(180deg, #ffe2ba, #f5bd7c);
  border-color: transparent;
}
.btn.ghost {
  background: transparent;
}
.btn.ghost:hover {
  background: rgba(255, 255, 255, 0.04);
}
.btn.danger {
  background: var(--danger-soft);
  border-color: rgba(255, 123, 123, 0.3);
  color: #ffb3b3;
}
.btn.danger:hover {
  background: rgba(255, 123, 123, 0.2);
  border-color: rgba(255, 123, 123, 0.45);
}
.btn.wide {
  width: 100%;
  padding: 12px 18px;
  border-radius: 12px;
}
.btn.small {
  padding: 7px 12px;
  font-size: 13px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  color: var(--muted);
  border: 1px solid transparent;
  font-size: 15px;
  line-height: 1;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.icon-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}
.icon-btn.small {
  width: 26px;
  height: 26px;
  font-size: 17px;
}

.link {
  color: var(--accent);
  font-weight: 600;
  padding: 0;
  border-bottom: 1px solid rgba(240, 180, 107, 0.35);
}
.link:hover {
  color: var(--accent-soft);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.field span {
  letter-spacing: 0.01em;
}
.field small {
  font-weight: 400;
  color: var(--muted-2);
  font-size: 12px;
  line-height: 1.4;
}
.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 11px 13px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: #0d0f14;
  color: var(--text);
  font-size: 14.5px;
  font-weight: 400;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.field textarea {
  resize: vertical;
  min-height: 88px;
  line-height: 1.55;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: rgba(240, 180, 107, 0.6);
  box-shadow: 0 0 0 3px rgba(240, 180, 107, 0.12);
  background: #0f1218;
}
.field input::placeholder,
.field textarea::placeholder {
  color: #545c69;
}

.form-error {
  color: #ffb0b0;
  background: var(--danger-soft);
  border: 1px solid rgba(255, 123, 123, 0.28);
  border-radius: 9px;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 500;
}

/* Boot splash ---------------------------------------------------- */
.boot-splash {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: var(--bg);
  transition: opacity 0.4s ease;
}
.boot-splash.is-hidden {
  opacity: 0;
  pointer-events: none;
}
.boot-bar {
  width: 96px;
  height: 2px;
  border-radius: 99px;
  background: #1e222b;
  overflow: hidden;
}
.boot-bar i {
  display: block;
  width: 40%;
  height: 100%;
  border-radius: 99px;
  background: var(--accent);
  animation: boot-slide 1.1s ease-in-out infinite;
}
@keyframes boot-slide {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(260%); }
}

/* ================================================================
   Auth
   ================================================================ */

.auth-screen {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  min-height: 100dvh;
  background: var(--bg);
}

.auth-art {
  position: relative;
  overflow: hidden;
  padding: 52px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    radial-gradient(120% 90% at 8% 0%, rgba(240, 180, 107, 0.16), transparent 60%),
    radial-gradient(90% 80% at 100% 100%, rgba(126, 106, 255, 0.16), transparent 65%),
    linear-gradient(160deg, #12131a 0%, #0a0b0e 65%);
  border-right: 1px solid var(--line-soft);
}
.art-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(90% 80% at 30% 20%, #000 20%, transparent 80%);
  -webkit-mask-image: radial-gradient(90% 80% at 30% 20%, #000 20%, transparent 80%);
}
.art-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(12px);
  opacity: 0.55;
  pointer-events: none;
}
.art-blob.b1 {
  width: 320px;
  height: 320px;
  right: -70px;
  top: 12%;
  background: radial-gradient(circle at 35% 30%, rgba(240, 180, 107, 0.55), transparent 62%);
}
.art-blob.b2 {
  width: 380px;
  height: 380px;
  left: -120px;
  bottom: -80px;
  background: radial-gradient(circle at 50% 50%, rgba(120, 100, 255, 0.4), transparent 65%);
}
.art-blob.b3 {
  width: 200px;
  height: 200px;
  right: 22%;
  bottom: 22%;
  background: radial-gradient(circle at 50% 50%, rgba(116, 224, 180, 0.25), transparent 65%);
}
.art-content {
  position: relative;
  z-index: 1;
  max-width: 520px;
}
.art-content .brand {
  margin-bottom: 46px;
}
.art-content h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(38px, 4.4vw, 60px);
  line-height: 1.04;
  letter-spacing: -0.03em;
  margin-bottom: 22px;
}
.art-content h1 em {
  font-style: italic;
  color: var(--accent);
}
.art-content .lede {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
  max-width: 430px;
}
.art-points {
  list-style: none;
  margin: 38px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 440px;
}
.art-points li {
  display: flex;
  gap: 14px;
  align-items: baseline;
  font-size: 14px;
  color: #c9cfd9;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 14px;
}
.art-points li span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent);
  min-width: 22px;
}
.art-foot {
  position: relative;
  z-index: 1;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted-2);
  text-transform: uppercase;
}

.auth-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 48px 32px;
}
.auth-card {
  width: 100%;
  max-width: 410px;
  background: rgba(19, 21, 27, 0.85);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 26px;
  box-shadow: var(--shadow-lg);
}
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  background: #0d0f14;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  margin-bottom: 24px;
}
.auth-tab {
  padding: 9px 10px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  transition: background 0.18s ease, color 0.18s ease;
}
.auth-tab:hover {
  color: var(--text);
}
.auth-tab.is-active {
  background: var(--panel-2);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line);
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.auth-form h2 {
  font-size: 23px;
  letter-spacing: -0.025em;
  font-weight: 650;
}
.auth-form .muted {
  font-size: 13.5px;
  margin-top: -10px;
}
.auth-switch {
  text-align: center;
  font-size: 13px;
  color: var(--muted-2);
}
.auth-legal {
  font-size: 12px;
  color: var(--muted-2);
  text-align: center;
  max-width: 340px;
}

/* ================================================================
   App shell
   ================================================================ */

.app {
  display: flex;
  min-height: 100dvh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 272px;
  flex: 0 0 272px;
  height: 100dvh;
  padding: 22px 16px 16px;
  background: var(--bg-soft);
  border-right: 1px solid var(--line-soft);
  z-index: 40;
}
.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
}
.sidebar-close {
  display: none;
}

.upload-cta {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14.5px;
}
.upload-cta .plus {
  font-size: 17px;
  line-height: 1;
  margin-top: -1px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-item:hover {
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
}
.nav-item.is-active {
  background: rgba(240, 180, 107, 0.11);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(240, 180, 107, 0.18);
}
.nav-item.is-active .nav-icon {
  color: var(--accent);
}
.nav-icon {
  width: 18px;
  text-align: center;
  color: var(--muted-2);
  font-size: 13px;
}
.nav-label {
  flex: 1;
  min-width: 0;
}
.pill {
  min-width: 24px;
  text-align: center;
  padding: 1px 7px;
  border-radius: 99px;
  background: #1d212a;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.nav-item.is-active .pill {
  background: rgba(240, 180, 107, 0.18);
  color: var(--accent-soft);
}

.nav-section {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  gap: 6px;
}
.nav-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 11px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.album-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  min-height: 0;
  padding-bottom: 6px;
}
.album-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 11px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 13.5px;
  transition: background 0.15s ease, color 0.15s ease;
}
.album-item:hover {
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
}
.album-item.is-active {
  background: rgba(240, 180, 107, 0.1);
  color: var(--text);
}
.album-item .album-dot {
  width: 8px;
  height: 8px;
  border-radius: 3px;
  background: #3a4150;
  flex: 0 0 8px;
}
.album-item.is-active .album-dot {
  background: var(--accent);
}
.album-item .album-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.album-item .album-count {
  font-size: 11.5px;
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
}
.album-empty {
  padding: 6px 11px 10px;
  font-size: 12.5px;
  color: var(--muted-2);
  line-height: 1.5;
}

.sidebar-foot {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-top: 1px solid var(--line-soft);
  padding-top: 14px;
}
.storage {
  padding: 0 4px;
}
.storage-row {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--muted-2);
  margin-bottom: 7px;
}
.storage-bar {
  height: 4px;
  border-radius: 99px;
  background: #1c2029;
  overflow: hidden;
}
.storage-bar i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, #d79a51, var(--accent));
  transition: width 0.4s ease;
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.user-chip:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line-soft);
}
.user-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  line-height: 1.3;
}
.user-meta strong {
  font-size: 13.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-meta small {
  font-size: 11.5px;
  color: var(--muted-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chev {
  color: var(--muted-2);
  font-size: 16px;
}

.avatar {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(150deg, #3a3324, #1f232c);
  color: var(--accent-soft);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.avatar.small {
  width: 32px;
  height: 32px;
  flex-basis: 32px;
  font-size: 12px;
}
.avatar.xl {
  width: 92px;
  height: 92px;
  flex-basis: 92px;
  font-size: 30px;
}

/* Main ---------------------------------------------------------- */
.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 26px;
  background: rgba(11, 12, 15, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.menu-btn {
  display: none;
}
.search-wrap {
  position: relative;
  flex: 1;
  max-width: 460px;
  display: flex;
  align-items: center;
}
.search-icon {
  position: absolute;
  left: 12px;
  color: var(--muted-2);
  font-size: 15px;
  pointer-events: none;
}
.search-wrap input {
  width: 100%;
  padding: 9px 34px 9px 34px;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: #0e1015;
  color: var(--text);
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.search-wrap input::-webkit-search-cancel-button {
  display: none;
}
.search-wrap input:focus {
  border-color: #38404f;
  background: #101319;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.04);
}
.search-clear {
  position: absolute;
  right: 8px;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  color: var(--muted-2);
  font-size: 11px;
}
.search-clear:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}
.topbar-actions .add {
  padding: 9px 15px;
  font-size: 13.5px;
}

.view {
  padding: 28px 30px 80px;
  outline: none;
  flex: 1;
}

/* View header --------------------------------------------------- */
.view-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.view-head .eyebrow {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 8px;
}
.view-head h1 {
  font-size: clamp(25px, 2.6vw, 33px);
  letter-spacing: -0.035em;
  font-weight: 650;
  line-height: 1.1;
}
.view-head .sub {
  color: var(--muted);
  font-size: 13.5px;
  margin-top: 7px;
}
.view-head .head-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Grid ---------------------------------------------------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
  gap: 12px;
}
@media (min-width: 1500px) {
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 14px;
  }
}

.tile {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 11px;
  overflow: hidden;
  background: var(--tile-bg, #181b21);
  padding: 0;
  isolation: isolate;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  animation: tile-in 0.35s ease both;
}
@keyframes tile-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.3s ease;
  opacity: 0;
}
.tile img.is-loaded {
  opacity: 1;
}
.tile:hover img {
  transform: scale(1.045);
}
.tile:hover {
  box-shadow: inset 0 0 0 1px rgba(240, 180, 107, 0.5), 0 12px 30px rgba(0, 0, 0, 0.35);
}
.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(5, 6, 9, 0.78), rgba(5, 6, 9, 0) 52%);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}
.tile:hover::after {
  opacity: 1;
}
.tile-caption {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 9px;
  font-size: 12.5px;
  line-height: 1.35;
  color: #eef1f6;
  text-align: left;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 2;
  pointer-events: none;
}
.tile:hover .tile-caption {
  opacity: 1;
  transform: none;
}
.tile-fav {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(8, 9, 12, 0.6);
  color: var(--accent);
  font-size: 11px;
  backdrop-filter: blur(6px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.tile-menu {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 3;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(8, 9, 12, 0.55);
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.18s ease, background 0.18s ease;
}
.tile:hover .tile-menu,
.tile-menu:focus-visible {
  opacity: 1;
}
.tile-menu:hover {
  background: rgba(240, 180, 107, 0.9);
  color: var(--accent-ink);
}

/* Skeletons ----------------------------------------------------- */
.skeleton {
  border-radius: 11px;
  aspect-ratio: 1 / 1;
  background: linear-gradient(100deg, #14171d 20%, #1b1f27 42%, #14171d 62%);
  background-size: 220% 100%;
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer {
  to {
    background-position: -220% 0;
  }
}

/* Empty state --------------------------------------------------- */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 76px 20px 60px;
  gap: 8px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  background: radial-gradient(80% 120% at 50% 0%, rgba(240, 180, 107, 0.05), transparent 70%);
}
.empty .empty-icon {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: rgba(240, 180, 107, 0.1);
  color: var(--accent);
  font-size: 24px;
  margin-bottom: 10px;
  box-shadow: inset 0 0 0 1px rgba(240, 180, 107, 0.18);
}
.empty h2 {
  font-size: 20px;
  letter-spacing: -0.02em;
  font-weight: 650;
}
.empty p {
  color: var(--muted);
  font-size: 14px;
  max-width: 420px;
  line-height: 1.6;
}
.empty .btn {
  margin-top: 14px;
}

.load-more {
  display: flex;
  justify-content: center;
  padding: 28px 0 6px;
}

/* ================================================================
   Lightbox
   ================================================================ */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 356px;
  background: rgba(6, 7, 10, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  animation: fade-in 0.18s ease both;
}
@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.lb-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 34px 26px;
  min-width: 0;
}
.lb-image {
  max-width: 100%;
  max-height: calc(100dvh - 68px);
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  background: #101216;
}
.lb-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(20, 23, 29, 0.85);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 16px;
}
.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(20, 23, 29, 0.8);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  display: grid;
  place-items: center;
  z-index: 2;
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}
.lb-nav:hover {
  background: var(--panel-2);
  border-color: #3a4252;
}
.lb-nav.prev {
  left: 16px;
}
.lb-nav.next {
  right: 16px;
}
.lb-nav:disabled {
  opacity: 0.3;
  cursor: default;
}

.lb-panel {
  display: flex;
  flex-direction: column;
  background: var(--bg-soft);
  border-left: 1px solid var(--line-soft);
  height: 100dvh;
  overflow-y: auto;
}
.lb-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line-soft);
}
.lb-count {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
  font-weight: 600;
}
.lb-panel-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.lb-date {
  font-size: 12.5px;
  color: var(--muted-2);
}
.lb-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.lb-actions .btn {
  padding: 9px 12px;
  font-size: 13px;
}
.lb-actions .btn.is-on {
  background: rgba(240, 180, 107, 0.14);
  border-color: rgba(240, 180, 107, 0.4);
  color: var(--accent-soft);
}
.lb-section-title {
  font-size: 11px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted-2);
  font-weight: 700;
  margin-bottom: 9px;
}
.lb-details {
  display: grid;
  gap: 6px;
  font-size: 12.5px;
  color: var(--muted);
  border-top: 1px solid var(--line-soft);
  padding-top: 16px;
}
.lb-details div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.lb-details span:last-child {
  color: #c3cad6;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 62%;
}
.album-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.album-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: #0f1218;
  font-size: 12px;
  color: var(--muted);
  transition: all 0.15s ease;
}
.album-chip:hover {
  border-color: #3a4252;
  color: var(--text);
}
.album-chip.is-on {
  background: rgba(240, 180, 107, 0.14);
  border-color: rgba(240, 180, 107, 0.4);
  color: var(--accent-soft);
}
.album-chip .check {
  font-size: 10px;
  opacity: 0.9;
}
.lb-caption-saved {
  font-size: 11.5px;
  color: var(--ok);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.lb-caption-saved.is-visible {
  opacity: 1;
}

/* ================================================================
   Profile
   ================================================================ */

.profile-hero {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 26px;
  border-radius: 20px;
  border: 1px solid var(--line-soft);
  background:
    radial-gradient(90% 140% at 0% 0%, rgba(240, 180, 107, 0.11), transparent 60%),
    linear-gradient(180deg, #14161d, #101218);
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.profile-hero .avatar-wrap {
  position: relative;
}
.avatar-edit {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  font-size: 13px;
  border: 3px solid #12141a;
}
.profile-identity {
  flex: 1;
  min-width: 200px;
}
.profile-identity h1 {
  font-size: 28px;
  letter-spacing: -0.035em;
  font-weight: 650;
  line-height: 1.15;
}
.profile-identity .handle {
  color: var(--muted);
  font-size: 13.5px;
  margin-top: 3px;
}
.profile-identity .bio {
  color: #c6ccd7;
  font-size: 14px;
  line-height: 1.6;
  margin-top: 11px;
  max-width: 560px;
  white-space: pre-wrap;
}
.profile-badges {
  display: flex;
  gap: 8px;
  margin-top: 13px;
  flex-wrap: wrap;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 500;
}
.badge .spark {
  color: var(--accent);
}

.profile-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 16px;
  align-items: start;
}
.card {
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: var(--panel);
  padding: 22px;
}
.card h2 {
  font-size: 16px;
  letter-spacing: -0.02em;
  font-weight: 650;
  margin-bottom: 4px;
}
.card .card-sub {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 18px;
}
.card-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.card .row-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 2px;
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.stat {
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  padding: 14px 15px;
  background: #101218;
}
.stat .stat-value {
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.stat .stat-label {
  font-size: 11.5px;
  color: var(--muted-2);
  margin-top: 3px;
  letter-spacing: 0.02em;
}
.completeness {
  margin-top: 16px;
}
.completeness-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted-2);
  margin-bottom: 7px;
}
.card.danger {
  border-color: rgba(255, 123, 123, 0.18);
  background: linear-gradient(180deg, rgba(255, 123, 123, 0.04), transparent 70%), var(--panel);
}
.card.danger h2 {
  color: #ffb3b3;
}

/* ================================================================
   Modal, toast, upload
   ================================================================ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 5, 8, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fade-in 0.15s ease both;
}
.modal {
  width: 100%;
  max-width: 400px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #12141a;
  box-shadow: var(--shadow-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: modal-in 0.2s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.modal h3 {
  font-size: 17.5px;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.modal p {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.55;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 4px;
}

.toast-root {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 9px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
  max-width: 340px;
  padding: 11px 15px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #171a21;
  box-shadow: var(--shadow-sm);
  font-size: 13.5px;
  color: var(--text);
  animation: toast-in 0.22s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.toast.leaving {
  animation: toast-out 0.2s ease both;
}
.toast .toast-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  flex: 0 0 7px;
}
.toast.error .toast-dot {
  background: var(--danger);
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(6px);
  }
}

.upload-panel {
  position: fixed;
  z-index: 150;
  right: 20px;
  bottom: 20px;
  width: 290px;
  padding: 14px 16px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: #171a21;
  box-shadow: var(--shadow-lg);
}
.upload-panel-head {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  margin-bottom: 9px;
  color: var(--muted);
}
.upload-panel-head #upload-percent {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.upload-bar {
  height: 5px;
  border-radius: 99px;
  background: #232833;
  overflow: hidden;
}
.upload-bar i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, #d79a51, var(--accent-soft));
  transition: width 0.2s ease;
}

.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 180;
  display: grid;
  place-items: center;
  background: rgba(6, 7, 10, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}
.drop-overlay {
  visibility: hidden;
}
.drop-overlay.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.drop-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  padding: 46px 58px;
  border-radius: 20px;
  border: 2px dashed rgba(240, 180, 107, 0.5);
  background: rgba(240, 180, 107, 0.06);
  text-align: center;
}
.drop-icon {
  font-size: 28px;
  color: var(--accent);
}
.drop-card strong {
  font-size: 17px;
  letter-spacing: -0.02em;
}
.drop-card small {
  font-size: 12.5px;
  color: var(--muted);
}

/* ================================================================
   Responsive
   ================================================================ */

@media (max-width: 1080px) {
  .profile-grid {
    grid-template-columns: 1fr;
  }
  .auth-art {
    padding: 40px;
  }
}

@media (max-width: 900px) {
  .auth-screen {
    grid-template-columns: 1fr;
  }
  .auth-art {
    padding: 34px 26px 26px;
    gap: 24px;
    min-height: auto;
  }
  .art-content .brand {
    margin-bottom: 22px;
  }
  .art-content h1 {
    font-size: 38px;
  }
  .art-points {
    display: none;
  }
  .auth-panel {
    padding: 26px 20px 48px;
  }
  .art-foot {
    display: none;
  }

  .app {
    display: block;
  }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-102%);
    transition: transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: var(--shadow-lg);
    width: 286px;
    flex-basis: 286px;
  }
  .sidebar.is-open {
    transform: none;
  }
  .sidebar-close,
  .menu-btn {
    display: inline-flex;
  }
  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(4, 5, 8, 0.6);
    backdrop-filter: blur(3px);
  }
  .view {
    padding: 20px 18px 70px;
  }
  .topbar {
    padding: 11px 16px;
  }
  .topbar-actions .add {
    display: none;
  }
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    gap: 9px;
  }

  .lightbox {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
    overflow-y: auto;
  }
  .lb-stage {
    padding: 20px 12px 8px;
    min-height: 42vh;
  }
  .lb-image {
    max-height: 56dvh;
  }
  .lb-panel {
    height: auto;
    max-height: none;
    border-left: 0;
    border-top: 1px solid var(--line-soft);
  }
  .lb-panel-head {
    padding: 13px 16px;
  }
  .lb-panel-body {
    padding: 16px;
  }
  .lb-nav {
    width: 36px;
    height: 36px;
    font-size: 19px;
  }
  .lb-nav.prev {
    left: 8px;
  }
  .lb-nav.next {
    right: 8px;
  }
  .lb-close {
    top: 10px;
    right: 10px;
  }
  .profile-hero {
    padding: 20px;
    gap: 16px;
  }
  .profile-identity h1 {
    font-size: 23px;
  }
  .avatar.xl {
    width: 72px;
    height: 72px;
    flex-basis: 72px;
    font-size: 24px;
  }
  .toast-root {
    right: 12px;
    left: 12px;
    bottom: 12px;
  }
  .toast {
    max-width: none;
  }
  .upload-panel {
    right: 12px;
    left: 12px;
    width: auto;
    bottom: 12px;
  }
}

@media (max-width: 520px) {
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
    gap: 7px;
  }
  .view-head h1 {
    font-size: 24px;
  }
  .auth-form h2 {
    font-size: 21px;
  }
  .auth-card {
    padding: 20px;
    border-radius: 17px;
  }
  .stat-grid {
    gap: 8px;
  }
  .stat {
    padding: 12px;
  }
  .stat .stat-value {
    font-size: 19px;
  }
  .profile-hero {
    flex-direction: row;
    align-items: flex-start;
  }
  .lb-actions {
    grid-template-columns: 1fr;
  }
}

@media (hover: none) {
  .tile-menu {
    opacity: 0.85;
  }
  .tile::after {
    opacity: 1;
    background: linear-gradient(to top, rgba(5, 6, 9, 0.55), rgba(5, 6, 9, 0) 42%);
  }
  .tile-caption {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* Activity list (profile) ---------------------------------------- */
.activity-list {
  display: flex;
  flex-direction: column;
}
.activity-item {
  display: flex;
  gap: 11px;
  padding: 9px 0;
  border-top: 1px solid var(--line-soft);
}
.activity-item:first-child {
  border-top: 0;
  padding-top: 2px;
}
.activity-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  flex: 0 0 7px;
  margin-top: 6px;
}
.activity-item.tone-danger .activity-dot {
  background: var(--danger);
}
.activity-item.tone-muted .activity-dot {
  background: var(--muted-2);
}
.activity-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.activity-body strong {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}
.activity-body small {
  font-size: 11.5px;
  color: var(--muted-2);
}
.activity-detail {
  color: var(--muted);
  font-weight: 500;
}
.activity-empty {
  font-size: 12.5px;
  color: var(--muted-2);
  line-height: 1.5;
}

/* Sign in button — pink ------------------------------------------- */
#login-form .btn.primary {
  background: linear-gradient(180deg, #ffb8d4, #f27aae);
  border-color: transparent;
  color: #2b0a1a;
  box-shadow: 0 8px 22px rgba(242, 122, 174, 0.28);
}
#login-form .btn.primary:hover {
  background: linear-gradient(180deg, #ffc7de, #f68ab8);
  box-shadow: 0 10px 26px rgba(242, 122, 174, 0.36);
}
#login-form .btn.primary:active {
  background: linear-gradient(180deg, #f27aae, #e4659d);
}
#login-form .btn.primary:focus-visible {
  outline: 2px solid #ffd0e3;
  outline-offset: 2px;
}
#login-form .btn.primary:disabled {
  background: linear-gradient(180deg, #ffb8d4, #f27aae);
  color: #2b0a1a;
}
