/* ============ Токены ============ */
:root {
  --bg: #f6f3fa;
  --bg-2: #eee8f5;
  --surface: #ffffff;
  --surface-2: #faf7fd;
  --text: #1e1626;
  --text-2: #5d5268;
  --text-3: #8e8399;
  --line: #e7e0ef;
  --line-2: #d7cde3;
  --accent: #d81b60;
  --accent-hover: #bf1553;
  --accent-ink: #ffffff;
  --accent-soft: #fbe4ee;
  --green: #14855a;
  --green-soft: #ddf2e8;
  --danger: #c62839;
  --danger-soft: #fde6e8;
  --shadow-sm: 0 1px 2px rgba(48, 18, 70, 0.06);
  --shadow: 0 1px 2px rgba(48, 18, 70, 0.05), 0 10px 28px -14px rgba(72, 24, 104, 0.22);
  --shadow-lg: 0 24px 60px -20px rgba(40, 10, 60, 0.45);
  --radius: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --font-head: 'Bricolage Grotesque', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: 'Public Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --gl: max(16px, env(safe-area-inset-left));
  --gr: max(16px, env(safe-area-inset-right));
  --sb: env(safe-area-inset-bottom, 0px);
  --st: env(safe-area-inset-top, 0px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141017;
    --bg-2: #1b1520;
    --surface: #1f1925;
    --surface-2: #261f2d;
    --text: #f4eff8;
    --text-2: #bfb4ca;
    --text-3: #8d8199;
    --line: #2f2738;
    --line-2: #3f3449;
    --accent: #ff4f8e;
    --accent-hover: #ff6ea2;
    --accent-ink: #1c0612;
    --accent-soft: #3b1528;
    --green: #43d197;
    --green-soft: #133224;
    --danger: #ff6b78;
    --danger-soft: #3a1519;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 12px 30px -16px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, 0.8);
    color-scheme: dark;
  }
}

/* ============ База ============ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0;
  min-height: 100dvh;
  overflow-x: clip;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body.no-scroll { overflow: hidden; }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: inherit; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.mono { font-family: var(--font-mono); font-feature-settings: 'zero' 0; }
.ico { flex: none; display: block; }
.user-text { overflow-wrap: anywhere; white-space: pre-line; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ============ Шапка ============ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding-top: var(--st);
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.topbar-in {
  max-width: 760px;
  margin: 0 auto;
  padding: 10px var(--gr) 10px var(--gl);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.brand-mark {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), #9b1fb8);
  color: #fff;
  box-shadow: 0 6px 16px -8px var(--accent);
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font: 800 20px/1 var(--font-head); letter-spacing: -0.02em; }
.brand-sub { font-size: 11px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 3px; }
.avatar-btn { border: 0; background: none; padding: 2px; border-radius: 999px; flex: none; }

/* ============ Аватар ============ */
.avatar {
  --av: #888;
  display: inline-grid; place-items: center; flex: none;
  border-radius: 999px;
  background: var(--av);
  color: #fff;
  font: 700 14px/1 var(--font-head);
  text-transform: uppercase;
}
.avatar-xs { width: 20px; height: 20px; font-size: 11px; }
.avatar-sm { width: 26px; height: 26px; font-size: 13px; }
.avatar-md { width: 38px; height: 38px; font-size: 16px; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--line-2); }
.avatar-lg { width: 64px; height: 64px; font-size: 28px; }

/* ============ Раскладка ============ */
.view {
  max-width: 760px;
  margin: 0 auto;
  padding: 16px var(--gr) calc(110px + var(--sb)) var(--gl);
  animation: fade 0.25s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.section-title {
  font-size: 13px; font-family: var(--font-body); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-3);
  margin: 26px 0 12px;
}
.stack { display: flex; flex-direction: column; gap: 14px; }

/* ============ Кнопки ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600; font-size: 15px;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s, transform 0.1s, opacity 0.15s;
  user-select: none;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.55; cursor: default; transform: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 20px -10px var(--accent); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-ghost { background: var(--surface); border-color: var(--line-2); color: var(--text); }
.btn-ghost:hover:not(:disabled) { border-color: var(--text-3); }
.btn-soft { background: var(--accent-soft); color: var(--accent); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger-ghost { background: transparent; border-color: color-mix(in srgb, var(--danger) 40%, transparent); color: var(--danger); }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn-block { width: 100%; }
.icon-btn {
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  border-radius: 999px; border: 0;
  background: transparent; color: var(--text-2);
}
.icon-btn:hover { background: var(--bg-2); color: var(--text); }

/* ============ Формы ============ */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field-hint { font-size: 12.5px; color: var(--text-3); }
.input, .textarea, .select {
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-md);
  background: var(--surface);
  font-size: 16px; /* иначе iOS зумит поле */
  transition: border-color 0.15s, box-shadow 0.15s;
}
.textarea { resize: vertical; min-height: 92px; line-height: 1.45; }
.select { appearance: none; -webkit-appearance: none; padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: calc(100% - 19px) 50%, calc(100% - 14px) 50%;
  background-size: 5px 5px; background-repeat: no-repeat; }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.row { display: flex; gap: 10px; min-width: 0; }
.row > * { flex: 1; min-width: 0; }
.row > .w-auto { flex: 0 0 auto; }
.form-error {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 14px; font-weight: 500;
}
.form-ok { padding: 10px 14px; border-radius: var(--radius-sm); background: var(--green-soft); color: var(--green); font-size: 14px; font-weight: 500; }

.range-wrap { display: flex; align-items: center; gap: 14px; }
.range { flex: 1; accent-color: var(--accent); height: 28px; min-width: 0; }
.range-value { font: 600 18px/1 var(--font-mono); color: var(--accent); width: 2.2ch; text-align: right; }

.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch {
  width: 36px; height: 36px; border-radius: 999px;
  border: 0; background: var(--sw);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.25);
  display: grid; place-items: center; color: #fff;
}
.swatch[aria-pressed='true'] { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--sw); }

/* ============ Главная ============ */
.search-wrap { position: relative; }
.search-wrap .ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search-input { padding-left: 44px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-sm); }
.search-input::-webkit-search-cancel-button { -webkit-appearance: none; }
.chips { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.chip {
  min-height: 36px; padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  font-size: 14px; font-weight: 600; color: var(--text-2);
}
.chip[aria-pressed='true'] { background: var(--text); border-color: var(--text); color: var(--bg); }

.feed {
  display: flex; gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  margin: 0 calc(-1 * var(--gr)) 0 calc(-1 * var(--gl));
  padding: 2px var(--gr) 8px var(--gl);
  scroll-padding-left: var(--gl);
  scrollbar-width: none;
}
.feed::-webkit-scrollbar { display: none; }
.feed-card {
  --list-accent: var(--accent);
  flex: 0 0 148px;
  scroll-snap-align: start;
  text-decoration: none;
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.feed-thumb { aspect-ratio: 4 / 3; background: color-mix(in srgb, var(--list-accent) 16%, var(--surface)); display: grid; place-items: center; color: var(--list-accent); overflow: hidden; }
.feed-thumb img { width: 100%; height: 100%; object-fit: cover; }
.feed-info { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.feed-title { font-weight: 600; font-size: 14px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.feed-sub { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-price { font: 600 13px/1.2 var(--font-mono); color: var(--text-2); margin-top: 4px; }

.cards { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 620px) { .cards { grid-template-columns: 1fr 1fr; } }
.card {
  --list-accent: var(--accent);
  position: relative;
  display: flex; flex-direction: column;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
  min-width: 0;
}
.card:active { transform: scale(0.985); }
.card-stripe { height: 8px; background: var(--list-accent); background: linear-gradient(90deg, var(--list-accent), color-mix(in srgb, var(--list-accent) 55%, #ffffff)); }
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.card-title { font-size: 20px; font-weight: 700; overflow-wrap: anywhere; }
.card-note { color: var(--text-2); font-size: 14.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 13px; color: var(--text-2); }
.meta-item { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.meta-item .ico { color: var(--text-3); }
.taken-badge {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--green-soft); color: var(--green);
  font-size: 12.5px; font-weight: 700;
}
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--bg-2);
  color: var(--text-2);
  font-size: 12.5px; font-weight: 500;
  overflow-wrap: anywhere;
}

.fab {
  position: fixed;
  right: var(--gr);
  bottom: calc(18px + var(--sb));
  z-index: 15;
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 54px;
  padding: 0 22px 0 18px;
  border: 0; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
  font: 700 16px/1 var(--font-head);
  box-shadow: 0 14px 30px -10px var(--accent), var(--shadow);
  transition: transform 0.12s;
}
.fab:active { transform: scale(0.95); }
@media (min-width: 800px) { .fab { right: calc((100vw - 760px) / 2 + 16px); } }

/* ============ Вишлист ============ */
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); text-decoration: none; font-weight: 600; font-size: 14px; margin: 0 0 12px -4px; padding: 6px 4px; }
.hero { --list-accent: var(--accent); background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.hero-stripe { height: 10px; background: linear-gradient(90deg, var(--list-accent), color-mix(in srgb, var(--list-accent) 50%, #ffffff)); }
.hero-body { padding: 18px 18px 20px; display: flex; flex-direction: column; gap: 10px; }
.hero-author { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-2); font-weight: 500; }
.hero-title { font-size: clamp(26px, 7vw, 34px); font-weight: 800; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.hero-note { color: var(--text-2); }
.deadline { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 14px; font-weight: 500; }
.countdown { padding: 3px 10px; border-radius: 999px; background: color-mix(in srgb, var(--list-accent) 14%, var(--surface)); color: var(--list-accent); font: 600 13px/1.3 var(--font-mono); }
.countdown.past { background: var(--bg-2); color: var(--text-3); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 14px; }
.tile { background: var(--surface); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); border: 1px solid var(--line); padding: 14px 16px; min-width: 0; }
.tile-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-3); }
.tile-value { font: 600 20px/1.25 var(--font-mono); margin-top: 6px; overflow-wrap: anywhere; }
.tile-value.free { color: var(--green); }
.tile-sub { font-size: 12.5px; color: var(--text-3); margin-top: 4px; }

.items { display: flex; flex-direction: column; gap: 12px; }
.item {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  min-width: 0;
  transition: opacity 0.2s;
}
.item.is-reserved { opacity: 0.62; box-shadow: var(--shadow-sm); }
.item.is-reserved.by-me { opacity: 1; box-shadow: inset 0 0 0 2px var(--green), var(--shadow-sm); }
.item-main { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 14px; }
@media (min-width: 520px) { .item-main { grid-template-columns: 112px minmax(0, 1fr); } }
.item-cover {
  aspect-ratio: 1; width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 0; padding: 0;
  background: color-mix(in srgb, var(--list-accent, var(--accent)) 12%, var(--surface-2));
  color: var(--list-accent, var(--accent));
  display: grid; place-items: center;
}
.item-cover img { width: 100%; height: 100%; object-fit: cover; }
.item-body { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.item-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.item-title { font-size: 17.5px; font-weight: 700; overflow-wrap: anywhere; }
.item-desc { color: var(--text-2); font-size: 14.5px; }
.links { display: flex; flex-wrap: wrap; gap: 6px; }
.link-chip {
  display: inline-flex; align-items: center; gap: 5px; max-width: 100%;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  font-size: 13px; font-weight: 600;
  text-decoration: none; color: var(--text);
}
.link-chip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-chip:hover { border-color: var(--accent); color: var(--accent); }
.item-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; margin-top: 2px; }
.price { font: 600 17px/1.2 var(--font-mono); }
.price.empty { color: var(--text-3); font-weight: 400; font-size: 14px; }
.prio { display: inline-flex; align-items: center; gap: 8px; }
.prio-bar { display: grid; grid-template-columns: repeat(10, 6px); gap: 3px; }
.prio-bar i { height: 14px; border-radius: 2px; background: var(--line-2); }
.prio-bar i.on { background: var(--accent); }
.prio-num { font: 600 12.5px/1 var(--font-mono); color: var(--text-3); }
.item-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; }
.taken {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--green-soft); color: var(--green);
  font-size: 13.5px; font-weight: 700;
  overflow-wrap: anywhere;
}
.photo-strip { display: flex; gap: 8px; overflow-x: auto; margin-top: 12px; padding-bottom: 2px; scrollbar-width: none; }
.photo-strip::-webkit-scrollbar { display: none; }
.photo-thumb { flex: 0 0 68px; height: 68px; border-radius: var(--radius-sm); overflow: hidden; border: 0; padding: 0; background: var(--surface-2); display: grid; place-items: center; color: var(--text-3); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.img-ph { display: grid; place-items: center; width: 100%; height: 100%; color: var(--text-3); }

/* ============ Нижняя панель ============ */
.sheet-root { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(20, 8, 28, 0.45); opacity: 0; transition: opacity 0.22s; }
.sheet {
  position: relative;
  width: 100%; max-width: 640px;
  max-height: calc(94dvh - var(--st));
  display: flex; flex-direction: column;
  background: var(--surface);
  border-radius: 24px 24px 0 0;
  box-shadow: var(--shadow-lg);
  transform: translateY(100%);
  transition: transform 0.26s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.sheet-root.open .sheet-backdrop { opacity: 1; }
.sheet-root.open .sheet { transform: none; }
.sheet-grip { width: 40px; height: 5px; border-radius: 99px; background: var(--line-2); margin: 8px auto 0; flex: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px 6px 20px; flex: none; }
.sheet-title { font-size: 21px; font-weight: 750; }
.sheet-body { overflow-y: auto; overscroll-behavior: contain; padding: 8px 20px 20px; -webkit-overflow-scrolling: touch; }
.sheet-foot {
  flex: none;
  display: flex; gap: 10px; flex-wrap: wrap;
  padding: 12px 20px calc(12px + var(--sb));
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.sheet-foot .grow { flex: 1; }
.sheet-foot .btn { flex: 1 1 auto; }
@media (min-width: 700px) {
  .sheet-root { align-items: center; }
  .sheet { border-radius: 24px; max-height: 88dvh; transform: translateY(30px); opacity: 0; transition: transform 0.22s, opacity 0.22s; }
  .sheet-root.open .sheet { opacity: 1; }
  .sheet-foot { padding-bottom: 14px; border-radius: 0 0 24px 24px; }
}
.confirm-text { color: var(--text-2); overflow-wrap: anywhere; }

/* Фото в редакторе */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.photo-cell { position: relative; aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); }
.photo-cell img { width: 100%; height: 100%; object-fit: cover; }
.photo-cell .badge { position: absolute; left: 5px; bottom: 5px; padding: 2px 6px; border-radius: 6px; background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 10.5px; font-weight: 600; }
.photo-remove {
  position: absolute; top: 4px; right: 4px;
  width: 28px; height: 28px;
  border-radius: 999px; border: 0;
  background: rgba(0, 0, 0, 0.62); color: #fff;
  display: grid; place-items: center;
}
.photo-add {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  border: 1.5px dashed var(--line-2);
  background: transparent;
  color: var(--text-2);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  position: relative;
}
.photo-add input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-add:hover { border-color: var(--accent); color: var(--accent); }

/* ============ Вход ============ */
.auth {
  min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: calc(24px + var(--st)) var(--gr) calc(24px + var(--sb)) var(--gl);
  background:
    radial-gradient(120% 60% at 100% 0%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 60%),
    radial-gradient(90% 50% at 0% 100%, color-mix(in srgb, #8e44ec 14%, transparent), transparent 60%),
    var(--bg);
}
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border-radius: 26px; box-shadow: var(--shadow); padding: 26px 22px 24px; }
.auth-brand { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; margin-bottom: 22px; }
.auth-logo { width: 60px; height: 60px; border-radius: 19px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--accent), #9b1fb8); box-shadow: 0 14px 30px -12px var(--accent); }
.auth-title { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; }
.auth-sub { color: var(--text-3); font-size: 13px; }
.auth-tagline { color: var(--text-2); font-size: 14.5px; max-width: 30ch; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 999px; background: var(--bg-2); margin-bottom: 18px; }
.tab { min-height: 40px; border: 0; border-radius: 999px; background: transparent; font-weight: 600; color: var(--text-2); }
.tab[aria-selected='true'] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ============ Профиль ============ */
.profile-head { display: flex; align-items: center; gap: 16px; padding: 4px 0 18px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.profile-nick { font: 700 22px/1.2 var(--font-head); overflow-wrap: anywhere; }
.profile-hint { font-size: 13px; color: var(--text-3); margin-top: 2px; }
.sub-title { font-size: 17px; font-weight: 700; margin-bottom: 12px; }
.logout { margin-top: 22px; }

/* ============ Состояния ============ */
.state { text-align: center; padding: 48px 16px; display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--text-2); }
.state .ico { color: var(--text-3); }
.state h2 { color: var(--text); font-size: 22px; }
.state p { max-width: 34ch; }
.state-full { min-height: 100dvh; justify-content: center; padding: calc(24px + var(--st)) var(--gr) calc(24px + var(--sb)) var(--gl); }
.empty { padding: 32px 18px; border: 1.5px dashed var(--line-2); border-radius: var(--radius); text-align: center; color: var(--text-2); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty .ico { color: var(--text-3); }
.boot { min-height: 100dvh; display: grid; place-items: center; }
.spinner { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--line-2); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--bg-2) 25%, var(--surface-2) 50%, var(--bg-2) 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: var(--radius); }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ============ Тосты ============ */
#toasts {
  position: fixed; left: 0; right: 0;
  bottom: calc(86px + var(--sb));
  z-index: 70;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 0 var(--gr) 0 var(--gl);
  pointer-events: none;
}
.toast {
  max-width: 420px;
  padding: 12px 18px;
  border-radius: 14px;
  background: var(--text); color: var(--bg);
  font-size: 14.5px; font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.2s ease;
  overflow-wrap: anywhere;
}
.toast.error { background: var(--danger); color: #fff; }
.toast.leave { opacity: 0; transform: translateY(8px); transition: opacity 0.2s, transform 0.2s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ============ Просмотр фото ============ */
.lightbox {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(8, 4, 12, 0.94);
  display: flex; align-items: center; justify-content: center;
  padding: calc(56px + var(--st)) var(--gr) calc(56px + var(--sb)) var(--gl);
  animation: fade 0.18s ease;
}
.lb-stage { width: 100%; height: 100%; display: grid; place-items: center; }
.lb-img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }
.lb-btn { position: absolute; width: 46px; height: 46px; border-radius: 999px; border: 0; background: rgba(255, 255, 255, 0.12); color: #fff; display: grid; place-items: center; }
.lb-close { top: calc(10px + var(--st)); right: var(--gr); }
.lb-prev { left: var(--gl); top: 50%; transform: translateY(-50%); }
.lb-next { right: var(--gr); top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; bottom: calc(18px + var(--sb)); left: 0; right: 0; text-align: center; color: rgba(255, 255, 255, 0.8); font: 500 14px/1 var(--font-mono); }

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