/* ---------- Sign in ---------- */
.login { position: relative; min-height: 100svh; display: grid; place-items: center; padding: 24px 16px; overflow: hidden; }
.login-form { position: relative; width: min(380px, 100%); display: grid; gap: 18px; }
.login-mark { font-size: 26px; color: var(--wood-bright); justify-self: start; }
.login-title { margin: 0 0 10px; font-size: 56px; font-weight: 800; letter-spacing: -0.045em; line-height: 0.95; }
.login-form .error { margin: -6px 0 0; }

/* ---------- Shell ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px var(--gutter); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10; background: rgb(20 16 11 / 0.9); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.top-mark { font-size: 22px; }
.top-nav { display: flex; gap: 22px; font-size: 14px; }
.top-nav a, .top-nav button { color: var(--chalk-dim); text-decoration: none; background: none; border: 0; padding: 0; }
.top-nav a:hover, .top-nav button:hover { color: var(--chalk); }

.page { max-width: 1320px; margin: 0 auto; padding: 48px var(--gutter) 120px; }
.page-head { margin-bottom: 44px; }
.page-title { margin: 0; font-size: clamp(2.4rem, 5vw, 4rem); font-weight: 800; letter-spacing: -0.045em; line-height: 0.95; overflow-wrap: anywhere; }
.page-lede { margin: 14px 0 0; color: var(--chalk-dim); font-size: 17px; }
.section-title { margin: 0 0 18px; font-size: 19px; font-weight: 600; letter-spacing: -0.015em; }
.opt { color: rgb(185 178 163 / 0.65); }

/* ---------- New album ---------- */
.new {
  padding: 26px; border-radius: 20px; margin-bottom: 56px;
  background: linear-gradient(180deg, rgb(var(--amber) / 0.07), transparent 70%), var(--espresso-2);
  border: 1px solid var(--line);
}
.new-fields { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.new-fields .field { min-width: 170px; }
.new-fields .grow { flex: 1 1 260px; }
.new-fields .btn { height: 50px; }
.new .error { margin-top: 10px; }

/* ---------- Album list ---------- */
.albums { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 28px 22px; }
.album-card { display: block; text-decoration: none; }
.album-card-img {
  aspect-ratio: 3 / 2; border-radius: 14px; overflow: hidden; background: var(--espresso-3);
  display: grid; place-items: center; color: var(--chalk-dim); font-size: 14px; position: relative;
}
.album-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.album-card:hover .album-card-img img { transform: scale(1.03); }
.album-card-name { margin: 14px 0 4px; font-size: 18px; font-weight: 600; letter-spacing: -0.015em; }
.album-card-meta { margin: 0; font-size: 14px; color: var(--chalk-dim); display: flex; gap: 14px; flex-wrap: wrap; }
.tag { color: var(--wood-bright); display: inline-flex; align-items: center; gap: 5px; }
.tag svg { width: 14px; height: 14px; }
.empty { color: var(--chalk-dim); padding: 30px 0; grid-column: 1 / -1; }

/* ---------- Album editor ---------- */
.back { display: inline-block; color: var(--chalk-dim); text-decoration: none; font-size: 14px; margin-bottom: 22px; }
.back::before { content: "‹ "; }
.back:hover { color: var(--chalk); }
.album-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 40px; }
.album-head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.album-link { margin: 12px 0 0; font-size: 15px; }
.album-link a { color: var(--wood-bright); text-decoration: none; overflow-wrap: anywhere; }
.album-link a:hover { text-decoration: underline; }
.album-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; align-items: start; }
@media (max-width: 960px) { .album-layout { grid-template-columns: 1fr; } .settings { order: -1; } }

.drop {
  display: grid; place-items: center; text-align: center; gap: 6px; padding: 56px 24px; cursor: pointer;
  border: 1.5px dashed rgb(198 161 105 / 0.45); border-radius: 20px;
  background: radial-gradient(70% 90% at 50% 0%, rgb(var(--amber) / 0.09), transparent 70%);
  transition: border-color .2s, background-color .2s;
}
.drop:hover, .drop.over { border-color: var(--wood-bright); background-color: rgb(var(--amber) / 0.06); }
.drop:focus-within { outline: 2px solid var(--wood-bright); outline-offset: 3px; }
.drop-big { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
.drop-small { font-size: 14px; color: var(--chalk-dim); }

.uploads { margin-top: 18px; padding: 18px 20px; border-radius: 14px; background: var(--espresso-2); border: 1px solid var(--line); }
.uploads-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.uploads-head p { margin: 0; font-size: 15px; font-variant-numeric: tabular-nums; }
.meter { height: 4px; background: rgb(245 243 236 / 0.08); border-radius: 4px; overflow: hidden; margin-top: 12px; }
.meter span { display: block; height: 100%; width: 0; background: var(--green); transition: width .3s; }
.up-errors { list-style: none; margin: 10px 0 0; padding: 0; font-size: 13px; color: #ec9a8e; }
.up-errors:empty { display: none; }

.photos-head { margin-top: 40px; }
.photos { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.photo { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--espresso-3); }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo.is-cover { box-shadow: 0 0 0 2px var(--wood-bright); }
.photo-badge {
  position: absolute; left: 8px; top: 8px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  background: var(--wood-bright); color: var(--espresso);
}
.photo-actions {
  position: absolute; inset: auto 0 0 0; display: flex; gap: 6px; padding: 8px; justify-content: flex-end;
  background: linear-gradient(transparent, rgb(0 0 0 / 0.65)); opacity: 0; transition: opacity .2s;
}
.photo:hover .photo-actions, .photo:focus-within .photo-actions { opacity: 1; }
@media (hover: none) { .photo-actions { opacity: 1; } }
.photo-actions button {
  border: 0; border-radius: 999px; padding: 5px 10px; font-size: 12px; font-weight: 600;
  background: rgb(245 243 236 / 0.9); color: var(--espresso);
}
.photo-actions button.del { background: rgb(189 74 60 / 0.92); color: #fff; }
.photo.pending { opacity: 0.55; }

.settings { position: sticky; top: 90px; padding: 24px; border-radius: 20px; background: var(--espresso-2); border: 1px solid var(--line); }
.settings form { display: grid; gap: 18px; }
.settings .btn-go { width: 100%; }
.linkish { background: none; border: 0; padding: 0; color: #e58a7e; font-size: 13px; justify-self: start; }
.linkish:hover { text-decoration: underline; }
.toggle { display: flex; align-items: center; gap: 12px; font-size: 15px; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; }
.toggle span {
  width: 42px; height: 24px; border-radius: 999px; background: rgb(245 243 236 / 0.15); position: relative; flex: none; transition: background-color .2s;
}
.toggle span::after {
  content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--chalk);
  transition: transform .25s var(--ease);
}
.toggle input:checked + span { background: var(--ivy); }
.toggle input:checked + span::after { transform: translateX(18px); }
.toggle input:focus-visible + span { outline: 2px solid var(--wood-bright); outline-offset: 3px; }
.danger { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); display: grid; gap: 10px; }

.usage { margin-top: 26px; max-width: 420px; display: grid; gap: 8px; }
.usage .meter { margin-top: 0; }
.usage.full .meter span { background: var(--red); }
