/* Snezhik — แกลเลอรี
   Direction: snowy paper, ink blue, warm bell gold. Quiet chrome, the images carry the color.
   Credit for the process: unslop by Damir Sokolovsky (@heydamir), CC BY 4.0 */

:root {
  color-scheme: light;

  --bg: #f5f7fa;
  --card: #ffffff;
  --raised: #eceff4;
  --line: rgba(17, 24, 39, 0.09);
  --line-strong: rgba(17, 24, 39, 0.16);

  --ink: #111827;
  --ink-2: #4b5565;
  --ink-3: #6b7487;

  --accent: #c08a1e;
  --accent-ink: #8a5f10;
  --danger: #b42318;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --fast: 160ms;
  --slow: 380ms;

  --font-ui: "Anuphan", "Segoe UI", Tahoma, sans-serif;
  --font-display: "Instrument Serif", Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }

/* Ensure `hidden` always wins over display: grid/flex from classes */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body.age-locked { overflow: hidden; }

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.shell {
  width: min(1120px, 100% - 48px);
  margin-inline: auto;
}

.meta {
  margin: 0;
  color: var(--ink-3);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- age gate ---------- */

.age-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(245, 247, 250, 0.92);
  backdrop-filter: blur(8px);
}

html.age-ok .age-gate { display: none; }

.age-gate-card {
  width: min(100%, 380px);
  padding: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 48px rgba(17, 24, 39, 0.12);
}

.age-gate-logo {
  width: 72px;
  height: 72px;
  border-radius: 0;
  border: 1px solid var(--line);
  object-fit: cover;
  background: var(--raised);
}

.age-gate-card h2 {
  margin: 4px 0 0;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--ink);
}

.age-gate-q {
  margin: 8px 0 4px;
  font-family: var(--font-display);
  font-size: 40px;
  line-height: 1;
  color: var(--accent-ink);
  letter-spacing: -0.02em;
}

.age-gate-actions {
  display: flex;
  gap: 8px;
  width: 100%;
  justify-content: center;
}

.age-gate-actions .btn { min-width: 96px; min-height: 44px; font-size: 15px; }
.age-gate-actions .btn:disabled { cursor: wait; opacity: 0.72; }

.age-gate-error {
  margin: 0;
  color: var(--danger);
  font-size: 13px;
}

.age-gate-card.is-wrong {
  animation: shake 320ms var(--ease);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(245, 247, 250, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 0;
  object-fit: cover;
  background: transparent;
  border: 0;
  flex: none;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color var(--fast) var(--ease),
              border-color var(--fast) var(--ease),
              color var(--fast) var(--ease),
              transform var(--fast) var(--ease);
}

.btn:active { transform: scale(0.98); }

.btn-primary { color: #fff; background: var(--ink); }
.btn-primary:hover { background: #1f2937; }

.btn-quiet {
  color: var(--ink);
  background: var(--card);
  border-color: var(--line-strong);
}
.btn-quiet:hover { background: var(--raised); border-color: var(--ink-3); }

.icon-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--card);
  color: var(--ink-2);
  cursor: pointer;
  transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease);
}

.icon-btn:hover { background: var(--raised); color: var(--ink); }

/* ---------- page head ---------- */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-block: 48px 24px;
}

.page-title {
  margin: 8px 0 12px;
  font-size: clamp(32px, 4.2vw, 48px);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.display {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--accent-ink);
  letter-spacing: 0;
}

.lede {
  max-width: 34rem;
  margin: 0;
  color: var(--ink-2);
  font-size: 15px;
}

.post-count {
  margin: 0;
  color: var(--ink-3);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------- filters ---------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-block: 8px 24px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 32px;
}

.filters[hidden] { display: none; }

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--ink-2);
  font-size: 13px;
  cursor: pointer;
  transition: background-color var(--fast) var(--ease),
              color var(--fast) var(--ease),
              border-color var(--fast) var(--ease);
}

.chip:hover { background: var(--raised); color: var(--ink); }

.chip[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

/* ---------- grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  padding-bottom: 96px;
  align-items: start;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}

.card:hover { border-color: var(--line-strong); box-shadow: 0 8px 24px rgba(17, 24, 39, 0.06); }

.card-media {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: var(--raised);
  aspect-ratio: 1 / 1;
  overflow: hidden;
  cursor: zoom-in;
}

.card-media img,
.card-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--slow) var(--ease);
}

.card-media:hover img,
.card-media:hover video { transform: scale(1.03); }

.card-media-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  aspect-ratio: 1;
  gap: 2px;
  overflow: hidden;
  background: var(--raised);
}

.card-media-tile {
  position: relative;
  min-width: 0;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: var(--raised);
  cursor: zoom-in;
}

.card-media-tile img,
.card-media-tile video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-media-tile span {
  position: absolute;
  right: 6px;
  bottom: 6px;
  padding: 3px 6px;
  border-radius: 5px;
  background: rgba(17, 24, 39, 0.76);
  color: #fff;
  font-size: 12px;
}

.card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  background: rgba(17, 24, 39, 0.72);
  color: #fff;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.card-body {
  padding: 16px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-caption {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-caption:empty::before {
  content: "ไม่มีคำบรรยาย";
  color: var(--ink-3);
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0 16px 12px;
  list-style: none;
}

.card-tags button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink-3);
  font-size: 12px;
  cursor: pointer;
}

.card-tags button:hover { color: var(--accent-ink); }

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 16px 12px;
  color: var(--ink-3);
  font-size: 12px;
  border-top: 1px solid var(--line);
}

.card-foot .time { font-variant-numeric: tabular-nums; }

.card-actions {
  display: inline-flex;
  gap: 4px;
}

.card-actions .icon-btn {
  width: 28px;
  height: 28px;
  border-color: transparent;
  background: transparent;
}

.card-actions .icon-btn:hover { background: var(--raised); }

.card-actions .icon-btn.is-liked { color: var(--accent-ink); }

/* ---------- empty ---------- */

.empty {
  display: grid;
  place-items: center;
  gap: 12px;
  padding: 80px 24px;
  margin-bottom: 96px;
  color: var(--ink-3);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  text-align: center;
}

.empty svg { color: var(--ink-3); }
.empty p { margin: 0; }

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 13px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding-block: 24px;
}

/* ---------- composer dialog ---------- */

.composer,
.lightbox {
  width: min(92vw, 520px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: 0 24px 64px rgba(17, 24, 39, 0.2);
}

.composer::backdrop,
.lightbox::backdrop { background: rgba(17, 24, 39, 0.55); }

.composer-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px;
}

.composer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.composer-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.dropzone {
  display: block;
  cursor: pointer;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--raised);
  overflow: hidden;
  transition: border-color var(--fast) var(--ease), background-color var(--fast) var(--ease);
}

.dropzone:hover,
.dropzone.is-drag { border-color: var(--ink-3); background: var(--card); }

.dropzone-empty {
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 32px 16px;
  color: var(--ink-2);
  text-align: center;
}

.dropzone-empty strong { font-weight: 500; color: var(--ink); }
.dropzone-empty span { font-size: 13px; color: var(--ink-3); }
.dropzone-empty svg { color: var(--ink-3); }

.dropzone-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
  max-height: 320px;
  overflow: auto;
  padding: 10px;
}

.dropzone-preview-item {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--card);
}

.dropzone-preview-item img,
.dropzone-preview-item video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--card);
}

.dropzone-preview-item span {
  position: absolute;
  right: 4px;
  bottom: 4px;
  max-width: calc(100% - 8px);
  overflow: hidden;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(17, 24, 39, 0.72);
  color: #fff;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-2);
}

.field small { color: var(--ink-3); font-weight: 400; }

.field textarea,
.field input[type="text"],
.field input[type="password"] {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  resize: vertical;
  transition: border-color var(--fast) var(--ease);
}

.field textarea:focus,
.field input[type="text"]:focus,
.field input[type="password"]:focus {
  outline: 2px solid var(--accent);
  outline-offset: 0;
  border-color: transparent;
}

.form-error {
  margin: 0;
  color: var(--danger);
  font-size: 13px;
}

.composer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ---------- lightbox ---------- */

.lightbox {
  width: min(92vw, 720px);
  padding: 12px;
  position: relative;
}

.lightbox figure { margin: 0; }

.lightbox img,
.lightbox video {
  width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  background: var(--raised);
}

.lightbox figcaption {
  padding: 12px 4px 4px;
  color: var(--ink-2);
  font-size: 13px;
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--card);
  color: var(--ink-2);
  cursor: pointer;
}

.lightbox-close:hover { background: var(--raised); color: var(--ink); }

.lightbox-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
}

.lightbox-prev { left: 18px; }
.lightbox-next { right: 18px; }
.lightbox-nav:hover { background: #fff; }

/* ---------- responsive ---------- */

@media (max-width: 640px) {
  .shell { width: min(100% - 36px, 560px); }

  .page-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding-block: 40px 20px;
  }

  .page-title { font-size: 32px; }

  .grid { gap: 16px; padding-bottom: 64px; }

  .composer-form { padding: 16px; gap: 16px; }

  .age-gate-card { padding: 24px; }
  .age-gate-q { font-size: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   Auth, Profile, Feed additions (v2)
   ============================================================ */

/* ---- header with nav + user ---- */

.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
}

.nav-link {
  padding: 6px 12px;
  border-radius: var(--radius-md);
  color: var(--ink-2);
  transition: color var(--fast) var(--ease), background-color var(--fast) var(--ease);
}

.nav-link:hover { color: var(--ink); background: var(--raised); }
.nav-link[aria-current="page"] { color: var(--ink); background: var(--raised); }

.header-user {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-search {
  position: relative;
}

.header-search-toggle {
  white-space: nowrap;
}

.header-search-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 40;
  width: min(360px, calc(100vw - 24px));
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: 0 12px 32px rgba(17, 24, 39, 0.14);
}

.header-search-panel .search-bar {
  margin: 0;
}

.header-avatar {
  display: block;
  width: 32px;
  height: 32px;
  box-sizing: border-box;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: var(--raised);
  flex: none;
  transition: border-color var(--fast) var(--ease);
}

.header-avatar:hover { border-color: var(--ink-3); }

.header-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.header-profile-menu {
  position: relative;
}

.header-profile-menu::after {
  content: "";
  position: absolute;
  top: 100%;
  left: -8px;
  right: -8px;
  height: 8px;
}

.header-profile-popup {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  min-width: 150px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--card);
  box-shadow: 0 12px 32px rgba(17, 24, 39, 0.12);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 160ms var(--ease), transform 160ms var(--ease);
}

.header-profile-menu:hover .header-profile-popup,
.header-profile-menu:focus-within .header-profile-popup {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.header-profile-popup a {
  display: block;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  font-size: 13px;
  white-space: nowrap;
}

.header-profile-popup a:hover,
.header-profile-popup a:focus-visible {
  background: var(--raised);
  color: var(--ink);
}

@media (max-width: 640px) {
  .header-nav { display: none; }
  .header-user > .btn-quiet { display: none; }
}

@media (max-width: 420px) {
  .header-search-toggle { width: 40px; padding-inline: 0; }
  .header-search-toggle span { display: none; }
}

/* ---- auth page ---- */

.auth-main {
  display: grid;
  place-items: center;
  padding-block: 64px;
  min-height: calc(100vh - 64px);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 32px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(17, 24, 39, 0.06);
}

.auth-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  margin-bottom: 24px;
}

.auth-logo {
  width: 120px;
  height: 120px;
  border-radius: 0;
  object-fit: cover;
  border: 0;
  background: transparent;
}

.auth-head h1 {
  margin: 8px 0 0;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.auth-sub {
  margin: 0;
  color: var(--ink-3);
  font-size: 13px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin-bottom: 20px;
  background: var(--raised);
  border-radius: var(--radius-md);
}

.auth-tab {
  padding: 8px 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease);
}

.auth-tab:hover { color: var(--ink); }

.auth-tab.is-active {
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.05);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-form[hidden] { display: none; }

.auth-submit {
  width: 100%;
  min-height: 44px;
  margin-top: 4px;
}

.btn-google {
  width: 100%;
  min-height: 44px;
  margin-top: 4px;
  background: var(--card);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  gap: 10px;
}

.btn-google:hover { background: var(--raised); border-color: var(--ink-3); }

.btn-prayid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--raised);
  color: var(--ink-2);
}

.btn-prayid:disabled {
  cursor: not-allowed;
  opacity: .72;
}

.prayid-status {
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--card);
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 500;
}

.auth-divider {
  position: relative;
  text-align: center;
  margin: 20px 0 16px;
  color: var(--ink-3);
  font-size: 12px;
}

.auth-divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--line);
}

.auth-divider span {
  position: relative;
  padding: 0 8px;
  background: var(--card);
}

.auth-note {
  margin: 16px 0 0;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  background: #fdecea;
  color: var(--danger);
  font-size: 13px;
  text-align: center;
}

/* ---- profile page ---- */

.profile-main { padding-bottom: 96px; }

.profile-banner {
  margin-top: 32px;
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.banner-art {
  height: 200px;
  max-height: 200px;
  overflow: hidden;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  background-color: #e6ecf6;
  margin: -24px -24px 20px;
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  border-bottom: 1px solid var(--line);
}

.profile-head {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: -60px;
  position: relative;
}

.profile-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--raised);
  border: 4px solid var(--card);
  box-shadow: 0 4px 12px rgba(17, 24, 39, 0.08);
  flex: none;
}

.profile-head-info {
  flex: 1;
  min-width: 0;
  padding-top: 56px;
}

.profile-name {
  margin: 0;
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-username {
  margin: 4px 0 0;
  color: var(--ink-3);
  font-size: 13px;
}

.profile-actions {
  padding-top: 56px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.profile-actions .btn { min-height: 40px; }

.account-delete-dialog {
  width: min(92vw, 460px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 24px 64px rgba(17, 24, 39, 0.2);
}

.account-delete-dialog::backdrop {
  background: rgba(17, 24, 39, 0.48);
  backdrop-filter: blur(5px);
}

.account-delete-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 28px;
}

.account-delete-content h2 {
  margin: 0;
  text-align: center;
  font-size: 19px;
}

.account-delete-content > p:not(.form-error) {
  margin: 0;
  color: var(--ink-2);
  text-align: center;
  font-size: 14px;
}

.account-delete-content .field { margin: 0; }
.account-delete-actions { display: flex; gap: 8px; }
.account-delete-actions .btn { flex: 1; min-height: 42px; }
.account-delete-actions .btn:disabled { cursor: not-allowed; opacity: .55; }

.profile-bio {
  margin: 16px 0 0;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.profile-bio:empty { display: none; }

.profile-stats {
  display: flex;
  gap: 24px;
  margin: 20px 0 0;
  padding: 16px 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.profile-stats li {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.stat-num {
  font-size: 18px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  color: var(--ink-3);
  font-size: 12px;
}

/* ---- profile settings ---- */

.profile-settings {
  margin-top: 24px;
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.profile-settings[hidden] { display: none; }

.profile-settings h2 {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 500;
}

.profile-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.avatar-upload {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.avatar-upload img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line-strong);
  background: var(--raised);
}

.upload-status {
  color: var(--ink-3);
  font-size: 12px;
}

.profile-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ---- profile tabs ---- */

.profile-tabs {
  display: flex;
  gap: 4px;
  margin-top: 32px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.profile-tab {
  padding: 8px 14px;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease);
}

.profile-tab:hover { background: var(--raised); color: var(--ink); }

.profile-tab.is-active { background: var(--ink); color: #fff; }

.profile-tab-add {
  margin-left: auto;
  color: var(--accent-ink);
}

.profile-tab-add:hover { background: #fbf3df; }

/* ---- profile add ---- */

.profile-add {
  margin-top: 24px;
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.profile-add[hidden] { display: none; }

/* ---- profile grid ---- */

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 24px;
  align-items: start;
}

.profile-grid[hidden] { display: none; }

/* ---- card additions: author, like, text post ---- */

.card-author {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px 8px;
  font-size: 13px;
}

.card-author img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--raised);
  border: 1px solid var(--line);
  flex: none;
}

.card-author-name {
  color: var(--ink);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-author-name:hover { color: var(--accent-ink); }

.card-type {
  margin-left: auto;
  color: var(--ink-3);
  font-size: 11px;
}

.card-text {
  padding: 0 16px 16px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.card-text a { color: var(--accent-ink); }

.card-like {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-3);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: color var(--fast) var(--ease), background-color var(--fast) var(--ease);
}

.card-like:hover { background: var(--raised); color: var(--ink); }

.card-like.is-liked { color: var(--accent-ink); }

.card-like svg { flex: none; }

@media (max-width: 640px) {
  .profile-head { flex-direction: column; align-items: flex-start; margin-top: -48px; }
  .profile-avatar { width: 96px; height: 96px; }
  .profile-head-info { padding-top: 8px; width: 100%; }
  .profile-actions { padding-top: 8px; }
  .profile-name { font-size: 20px; }
  .profile-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .auth-card { padding: 24px; }
}

/* ---- first-time setup modal ---- */

.setup-modal {
  width: min(92vw, 440px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: 0 24px 64px rgba(17, 24, 39, 0.2);
  opacity: 0;
  transform: translateY(8px) scale(0.96);
  transition: opacity 220ms var(--ease), transform 220ms var(--ease);
}

.setup-modal[open] {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.setup-modal::backdrop { background: rgba(17, 24, 39, 0.55); }

.setup-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 28px;
}

.setup-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  margin-bottom: 4px;
}

.setup-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--line-strong);
  background: var(--raised);
  margin-bottom: 8px;
}

.setup-head h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 500;
}

.setup-head p {
  margin: 0;
  color: var(--ink-3);
  font-size: 13px;
}

.setup-submit { width: 100%; min-height: 44px; margin-top: 4px; }

/* ---- refined confirm/alert dialog ---- */

.ui-dialog {
  width: min(92vw, 420px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
  box-shadow: 0 24px 64px rgba(17, 24, 39, 0.24), 0 8px 16px rgba(17, 24, 39, 0.10);
  overflow: hidden;
  opacity: 0;
  transform: translateY(8px) scale(0.96);
  transition: opacity 220ms var(--ease), transform 220ms var(--ease);
}

.ui-dialog[open] {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.ui-dialog::backdrop {
  background: rgba(17, 24, 39, 0.45);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 220ms var(--ease);
}

.ui-dialog[open]::backdrop {
  opacity: 1;
}

.ui-dialog-body {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ui-dialog-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: 0 auto;
}

.ui-dialog-icon[data-variant="danger"] { background: #fdecea; color: #b42318; }
.ui-dialog-icon[data-variant="info"]   { background: #eef2f9; color: #4b5565; }
.ui-dialog-icon[data-variant="warn"]   { background: #fef3c7; color: #b45309; }

.ui-dialog-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ui-dialog-title {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.ui-dialog-msg {
  margin: 0;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.ui-dialog-actions {
  display: flex;
  gap: 8px;
}

.ui-dialog-actions .btn {
  flex: 1;
  min-height: 42px;
}

.btn-danger {
  color: #fff;
  background: var(--danger);
}

.btn-danger:hover { background: #991b1b; }

/* ---- followers / following list modal ---- */

.userlist-modal {
  width: min(92vw, 420px);
  max-height: 80vh;
  min-height: 220px;
  margin: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: 0 24px 64px rgba(17, 24, 39, 0.2);
  overflow: hidden;
  opacity: 0;
  transform: translateY(8px) scale(0.96);
  transition: opacity 220ms var(--ease), transform 220ms var(--ease);
}

.userlist-modal[open] {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.userlist-modal[open] {
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0;
  margin: auto;
  height: fit-content;
}

.userlist-modal::backdrop { background: rgba(17, 24, 39, 0.55); }

.userlist-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.userlist-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
}

.userlist-body {
  padding: 8px;
  overflow-y: auto;
  flex: 1;
  min-height: 140px;
}

.userlist-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  transition: background-color var(--fast) var(--ease);
}

.userlist-row:hover { background: var(--raised); }

.userlist-row img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--raised);
  border: 1px solid var(--line);
  flex: none;
}

.userlist-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}

.verified-badge {
  display: inline-block;
  width: 17px;
  height: 17px;
  max-width: none;
  margin-left: 5px;
  object-fit: contain;
  vertical-align: middle;
  transform: translateY(-3px);
  flex: none;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.card-author .verified-badge {
  width: 13px;
  height: 13px;
  margin-left: 3px;
  transform: translateY(-1px);
}

.verify-popup {
  width: min(420px, calc(100vw - 28px));
  padding: 30px 28px 26px;
  border: 1px solid rgba(255, 255, 255, .68);
  border-radius: 22px;
  color: var(--ink);
  text-align: center;
  background: linear-gradient(150deg, rgba(255,255,255,.98), rgba(246,249,255,.95));
  box-shadow: 0 28px 90px rgba(17, 24, 39, .26), inset 0 1px 0 rgba(255,255,255,.9);
  overflow: visible;
  opacity: 0;
  transform: translateY(12px) scale(.97);
  transition: opacity 220ms ease, transform 220ms var(--ease);
}
.verify-popup[open] { opacity: 1; transform: translateY(0) scale(1); }
.verify-popup::backdrop {
  background: rgba(15, 23, 42, .42);
  backdrop-filter: blur(9px) saturate(115%);
  -webkit-backdrop-filter: blur(9px) saturate(115%);
}
.verify-popup__mark {
  display: grid;
  width: 66px;
  height: 66px;
  margin: 0 auto 14px;
  place-items: center;
  border: 1px solid rgba(75, 132, 218, .16);
  border-radius: 50%;
  background: linear-gradient(145deg, #eef5ff, #dceaff);
  box-shadow: 0 8px 24px rgba(48, 103, 187, .15);
}
.verify-popup__mark img { display: block; width: 34px; height: 34px; object-fit: contain; }
.verify-popup__eyebrow { margin: 0 0 6px; color: #4778bd; font-size: 12px; font-weight: 700; letter-spacing: .08em; }
.verify-popup h2 { margin: 0; font-size: clamp(20px, 5vw, 25px); line-height: 1.35; }
.verify-popup__copy { max-width: 310px; margin: 10px auto 22px; color: var(--ink-2); font-size: 14px; line-height: 1.65; }
.verify-popup__claim { width: 100%; min-height: 48px; border-radius: 12px; background: linear-gradient(135deg, #4f86d3, #326bb7); box-shadow: 0 8px 20px rgba(50,107,183,.24); }
.verify-popup__claim:hover { background: linear-gradient(135deg, #467bc6, #2d60a5); }
@media (max-width: 420px) {
  .verify-popup { padding: 26px 20px 20px; border-radius: 18px; }
}

.userlist-username {
  font-size: 12px;
  color: var(--ink-3);
}

.userlist-empty {
  padding: 56px 16px;
  text-align: center;
  color: var(--ink-3);
  font-size: 13px;
}

.profile-stats li.is-clickable { cursor: pointer; transition: opacity var(--fast) var(--ease); }
.profile-stats li.is-clickable:hover { opacity: 0.7; }

/* ============================================================
   Custom video player
   ============================================================ */

.szp-wrap {
  position: relative;
  width: 100%;
  background: #000;
  border-radius: inherit;
  overflow: hidden;
  isolation: isolate;
  line-height: 0;
}

.szp-wrap video {
  display: block;
  width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 0;
  background: #000;
  cursor: pointer;
}

/* center play button */
.szp-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 76px;
  height: 76px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #111827;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  transition: transform 160ms var(--ease), background-color 160ms var(--ease);
  z-index: 3;
}

.szp-center:hover { transform: translate(-50%, -50%) scale(1.06); background: #fff; }
.szp-center svg { margin-left: 4px; }
.szp-center[hidden] { display: none; }

/* control bar */
.szp-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px 12px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.15) 60%, transparent);
  color: #fff;
  opacity: 1;
  transition: opacity 220ms var(--ease);
  z-index: 2;
}

.szp-wrap.is-playing:not(:hover) .szp-bar {
  opacity: 0.9;
}

.szp-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  border-radius: 8px;
  transition: background-color 140ms var(--ease);
}

.szp-btn:hover { background: rgba(255, 255, 255, 0.16); }

.szp-time {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.9);
  min-width: 34px;
  text-align: center;
  line-height: 1;
}

/* progress bar */
.szp-progress {
  flex: 1;
  height: 16px;
  display: flex;
  align-items: center;
  cursor: pointer;
  outline: none;
}

.szp-track {
  position: relative;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  transition: height 120ms var(--ease);
}

.szp-progress:hover .szp-track { height: 6px; }

.szp-buffer {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: rgba(255, 255, 255, 0.35);
  border-radius: inherit;
}

.szp-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: #fff;
  border-radius: inherit;
}

.szp-thumb {
  position: absolute;
  top: 50%;
  left: 0;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  margin-top: -6px;
  background: #fff;
  border-radius: 50%;
  transform: scale(0);
  transition: transform 140ms var(--ease);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.szp-progress:hover .szp-thumb,
.szp-progress:focus-visible .szp-thumb { transform: scale(1); }

/* volume */
.szp-volume {
  display: flex;
  align-items: center;
  gap: 4px;
}

.szp-vol-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  outline: none;
  opacity: 0;
  transition: width 200ms var(--ease), opacity 200ms var(--ease);
  cursor: pointer;
}

.szp-volume:hover .szp-vol-slider,
.szp-vol-slider:focus-visible { width: 70px; opacity: 1; }

.szp-vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  cursor: pointer;
}

.szp-vol-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
}

/* fullscreen */
.szp-wrap.is-fs {
  border-radius: 0;
}

.szp-wrap.is-fs video { max-height: 100vh; }

/* inline (card thumbnail) */
.szp-wrap.szp-inline { background: var(--raised); }
.szp-wrap.szp-inline video { pointer-events: none; }

.szp-inline-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 52px;
  height: 52px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #111827;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  transition: transform 160ms var(--ease);
}

.szp-inline-play svg { margin-left: 2px; }
.szp-inline-play:hover { transform: translate(-50%, -50%) scale(1.06); }

@media (max-width: 640px) {
  .szp-time.szp-duration { display: none; }
  .szp-vol-slider { display: none; }
  .szp-center { width: 60px; height: 60px; }
}

/* ============================================================
   Snezhik video player (v2) — .vp-* classes
   ============================================================ */

.vp {
  position: relative;
  width: 100%;
  background: #000;
  line-height: 0;
  overflow: hidden;
  isolation: isolate;
}

.vp video {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 80vh;
  object-fit: contain;
  background: #000;
  cursor: pointer;
}

/* ---------- overlay & controls ---------- */

.vp-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.vp-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 72px;
  height: 72px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: #111827;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  transition: transform 160ms cubic-bezier(0.22, 1, 0.36, 1), background-color 160ms cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: auto;
}

.vp-center:hover { transform: translate(-50%, -50%) scale(1.06); background: #fff; }
.vp-center svg { margin-left: 3px; }

.vp-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.45) 60%, transparent);
  color: #fff;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 200ms cubic-bezier(0.22, 1, 0.36, 1), transform 200ms cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: auto;
}

.vp:hover .vp-controls,
.vp.is-playing:hover .vp-controls,
.vp:focus-within .vp-controls {
  opacity: 1;
  transform: translateY(0);
}

/* Always show controls when paused */
.vp:not(.is-playing) .vp-controls {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- progress ---------- */

.vp-progress {
  height: 18px;
  display: flex;
  align-items: center;
  cursor: pointer;
  outline: none;
}

.vp-progress__track {
  position: relative;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  transition: height 120ms ease;
}

.vp-progress:hover .vp-progress__track { height: 5px; }

.vp-progress__buffer {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: rgba(255, 255, 255, 0.35);
  border-radius: inherit;
}

.vp-progress__filled {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: #fff;
  border-radius: inherit;
}

.vp-progress__thumb {
  position: absolute;
  top: 50%;
  left: 0;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  margin-top: -6px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
  transform: scale(0);
  transition: transform 140ms ease;
}

.vp-progress:hover .vp-progress__thumb,
.vp-progress:focus-visible .vp-progress__thumb { transform: scale(1); }

/* ---------- buttons row ---------- */

.vp-buttons {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 36px;
}

.vp-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 140ms ease;
}

.vp-btn:hover { background: rgba(255, 255, 255, 0.15); }

.vp-time {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.94);
  padding: 0 6px;
  line-height: 1;
  user-select: none;
}

.vp-spacer { flex: 1; }

/* ---------- volume ---------- */

.vp-volume {
  display: flex;
  align-items: center;
  gap: 4px;
}

.vp-volume__slider-wrap {
  width: 0;
  overflow: hidden;
  transition: width 200ms cubic-bezier(0.22, 1, 0.36, 1);
}

.vp-volume:hover .vp-volume__slider-wrap,
.vp-volume:focus-within .vp-volume__slider-wrap { width: 70px; }

.vp-volume__slider {
  -webkit-appearance: none;
  appearance: none;
  width: 70px;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  outline: none;
  cursor: pointer;
}

.vp-volume__slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
}

.vp-volume__slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
}

/* ---------- fullscreen ---------- */

.vp:fullscreen { border-radius: 0; }
.vp:fullscreen video { max-height: 100vh; }

/* ---------- inline (card thumbnail) ---------- */

.vp--inline { background: #000; }
.vp--inline video { pointer-events: none; }

.vp-center-inline {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 52px;
  height: 52px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: #111827;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
  transition: transform 160ms cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 2;
}

.vp-center-inline svg { margin-left: 2px; }
.vp-center-inline:hover { transform: translate(-50%, -50%) scale(1.06); }

@media (max-width: 640px) {
  .vp-time .vp-sep,
  .vp-total { display: none; }
  .vp-volume__slider-wrap { display: none; }
  .vp-center { width: 58px; height: 58px; }
}

/* ---------- EXTRA: force-hide ALL native video controls everywhere ---------- */
.lightbox video::-webkit-media-controls,
.lightbox video::-webkit-media-controls-panel,
.lightbox video::-webkit-media-controls-play-button,
.lightbox video::-webkit-media-controls-start-playback-button,
.lightbox video::-webkit-media-controls-enclosure {
  display: none !important;
  -webkit-appearance: none !important;
}

.lightbox video::-webkit-media-controls-overlay-play-button {
  display: none !important;
}

.vp video::-webkit-media-controls,
.vp video::-webkit-media-controls-panel,
.vp video::-webkit-media-controls-enclosure {
  display: none !important;
  -webkit-appearance: none !important;
}

/* ---------- Hide native video chrome globally (defensive) ---------- */
video::-webkit-media-controls,
video::-webkit-media-controls-panel,
video::-webkit-media-controls-play-button,
video::-webkit-media-controls-start-playback-button,
video::-webkit-media-controls-enclosure,
video::-webkit-media-controls-overlay-play-button {
  display: none !important;
  -webkit-appearance: none !important;
}

/* Fullscreen player: ensure everything is visible */
.vp--full .vp-controls {
  position: absolute !important;
  left: 0; right: 0; bottom: 0;
}

.vp--full .vp-buttons {
  display: flex !important;
}

/* ---------- BULLETPROOF: hide native video chrome everywhere ---------- */
video::-webkit-media-controls,
video::-webkit-media-controls-panel,
video::-webkit-media-controls-play-button,
video::-webkit-media-controls-start-playback-button,
video::-webkit-media-controls-enclosure,
video::-webkit-media-controls-timeline,
video::-webkit-media-controls-current-time-display,
video::-webkit-media-controls-time-remaining-display,
video::-webkit-media-controls-mute-button,
video::-webkit-media-controls-toggle-closed-captions-button,
video::-webkit-media-controls-volume-slider,
video::-webkit-media-controls-fullscreen-button,
video::-webkit-media-controls-overflow-button,
video::-webkit-media-controls-picture-in-picture-button,
video::-webkit-media-controls-download-button,
video::-webkit-media-controls-panel-container,
video::-internal-media-controls-download-button,
video::-internal-media-controls-overflow-button {
  display: none !important;
  -webkit-appearance: none !important;
  opacity: 0 !important;
  width: 0 !important;
  height: 0 !important;
  pointer-events: none !important;
}


/* ============================================================
   Snezhik video player (v3) — modern glass redesign (overrides v2)
   ============================================================ */

.vp {
  position: relative;
  width: 100%;
  background: #000;
  line-height: 0;
  overflow: hidden;
  isolation: isolate;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.22);
}

.vp--inline {
  border-radius: inherit;
  box-shadow: none;
}

.vp video {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 80vh;
  object-fit: contain;
  background: #000;
  cursor: pointer;
}

/* ---- center play button with pulse ring ---- */

.vp-center {
  width: 84px;
  height: 84px;
  background: linear-gradient(145deg, #ffffff 0%, #eef2f8 100%);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.42),
    0 4px 12px rgba(0, 0, 0, 0.22),
    inset 0 -2px 4px rgba(0, 0, 0, 0.06);
  transition:
    transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.vp-center::before {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  pointer-events: none;
}

.vp-center::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.55);
  pointer-events: none;
  animation: vp-pulse 2.6s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}

@keyframes vp-pulse {
  0%   { transform: scale(1);   opacity: 0.65; }
  70%  { transform: scale(1.4); opacity: 0; }
  100% { transform: scale(1.4); opacity: 0; }
}

.vp-center svg { margin-left: 4px; position: relative; z-index: 1; }

.vp-center:hover {
  transform: translate(-50%, -50%) scale(1.08);
  box-shadow:
    0 0 0 10px rgba(255, 255, 255, 0.14),
    0 18px 52px rgba(0, 0, 0, 0.5),
    0 6px 16px rgba(0, 0, 0, 0.3);
}

/* ---- floating glass control bar ---- */

.vp-controls {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  padding: 10px 14px 8px;
  gap: 4px;
  background: linear-gradient(
    to top,
    rgba(15, 20, 30, 0.86) 0%,
    rgba(15, 20, 30, 0.62) 55%,
    rgba(15, 20, 30, 0.18) 100%
  );
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  transform: translateY(8px);
  transition:
    opacity 220ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.vp:hover .vp-controls,
.vp:focus-within .vp-controls,
.vp:not(.is-playing) .vp-controls {
  opacity: 1;
  transform: translateY(0);
}

/* ---- progress bar ---- */

.vp-progress {
  height: 20px;
  padding: 6px 0;
}

.vp-progress__track {
  height: 4px;
  background: rgba(255, 255, 255, 0.18);
  transition:
    height 160ms cubic-bezier(0.22, 1, 0.36, 1),
    background-color 160ms ease;
}

.vp-progress:hover .vp-progress__track,
.vp-progress:focus-visible .vp-progress__track {
  height: 6px;
  background: rgba(255, 255, 255, 0.22);
}

.vp-progress__buffer {
  background: rgba(255, 255, 255, 0.28);
  transition: width 240ms linear;
}

.vp-progress__filled {
  background: linear-gradient(90deg, #f0c874 0%, #d29a2b 100%);
  transition: width 80ms linear;
}

.vp-progress__thumb {
  width: 14px;
  height: 14px;
  margin-left: -7px;
  margin-top: -7px;
  box-shadow:
    0 0 0 3px rgba(210, 154, 43, 0.32),
    0 2px 10px rgba(0, 0, 0, 0.5);
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---- buttons ---- */

.vp-buttons { gap: 2px; }

.vp-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  transition: background-color 140ms ease, transform 140ms ease;
}

.vp-btn:hover { background: rgba(255, 255, 255, 0.14); }
.vp-btn:active { transform: scale(0.92); }
.vp-btn svg { display: block; }

.vp-time {
  display: inline-flex;
  align-items: center;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 0 8px;
}

.vp-time .vp-current { color: #fff; }
.vp-time .vp-total   { color: rgba(255, 255, 255, 0.55); }
.vp-time .vp-sep     { color: rgba(255, 255, 255, 0.4); margin: 0 4px; }

/* ---- volume ---- */

.vp-volume__slider-wrap {
  transition: width 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

.vp-volume:hover .vp-volume__slider-wrap,
.vp-volume:focus-within .vp-volume__slider-wrap {
  width: 76px;
}

.vp-volume__slider {
  width: 68px;
  margin-left: 4px;
  background: rgba(255, 255, 255, 0.24);
}

.vp-volume__slider::-webkit-slider-thumb {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.vp-volume__slider::-moz-range-thumb {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* ---- fullscreen ---- */

.vp:fullscreen {
  border-radius: 0;
  background: #000;
}

.vp:fullscreen video { max-height: 100vh; }

.vp:fullscreen .vp-controls {
  left: 20px;
  right: 20px;
  bottom: 20px;
}

/* ---- inline card thumbnail ---- */

.vp-center-inline {
  width: 56px;
  height: 56px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.32);
  transition:
    transform 180ms cubic-bezier(0.22, 1, 0.36, 1),
    background-color 180ms ease;
}

.vp-center-inline:hover {
  transform: translate(-50%, -50%) scale(1.1);
  background: #fff;
}

/* ---- mobile ---- */

@media (max-width: 640px) {
  .vp { border-radius: 12px; }
  .vp-center { width: 64px; height: 64px; }
  .vp-center::after { display: none; }
  .vp-controls {
    left: 8px;
    right: 8px;
    bottom: 8px;
    padding: 8px 10px 6px;
    border-radius: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .vp-center::after { animation: none; }
}

/* Counter the old .vp--full !important pinned-to-bottom rule so the new floating glass bar shows */
.vp--full .vp-controls {
  left: 12px !important;
  right: 12px !important;
  bottom: 12px !important;
  border-radius: 14px;
}

.vp--full:fullscreen .vp-controls {
  left: 20px !important;
  right: 20px !important;
  bottom: 20px !important;
}

@media (max-width: 640px) {
  .vp--full .vp-controls {
    left: 8px !important;
    right: 8px !important;
    bottom: 8px !important;
    border-radius: 12px;
  }
}

/* Settings menu for playback speed and available source qualities. */
.vp-settings { position: relative; line-height: 1; }
.vp-settings-menu {
  position: absolute;
  z-index: 5;
  right: 0;
  bottom: calc(100% + 12px);
  width: 190px;
  max-height: min(60vh, 360px);
  overflow: auto;
  padding: 10px;
  color: #f8fafc;
  background: rgba(12, 16, 24, .96);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(0,0,0,.42);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  line-height: 1.35;
}
.vp-settings-menu[hidden] { display: none; }
.vp-menu-section + .vp-menu-section { margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.1); }
.vp-menu-heading { display: block; padding: 3px 8px 5px; color: rgba(255,255,255,.55); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.vp-menu-option { display: block; width: 100%; padding: 7px 9px; border: 0; border-radius: 7px; background: transparent; color: inherit; text-align: left; font: inherit; font-size: 13px; cursor: pointer; }
.vp-menu-option:hover:not(:disabled), .vp-menu-option[aria-pressed="true"] { background: rgba(255,255,255,.12); }
.vp-menu-option[aria-pressed="true"]::before { content: "✓"; display: inline-block; width: 18px; color: #f0c874; }
.vp-menu-option:disabled { padding-left: 27px; color: rgba(255,255,255,.45); cursor: default; }
.vp-settings-toggle[aria-expanded="true"] { background: rgba(255,255,255,.14); }
@media (max-width: 420px) {
  .vp-controls { left: 5px; right: 5px; bottom: 5px; padding: 7px 7px 5px; }
  .vp-btn { width: 30px; height: 30px; }
  .vp-volume__slider-wrap { display: none; }
}

/* Layout safeguards for narrow phones, landscape phones, and tablets. */
@media (max-width: 900px) {
  .shell { width: min(100% - 32px, 760px); }
  .grid, .profile-grid { gap: 12px; }
  .card-body { min-width: 0; }
  .profile-banner { padding: 20px; }
}
@media (max-width: 640px) {
  .shell { width: calc(100% - 24px); }
  .header-inner { min-height: 58px; gap: 8px; }
  .brand { min-width: 0; }
  .header-user { margin-left: auto; }
  .page-head { padding-top: 28px; }
  .page-title { font-size: clamp(26px, 8vw, 34px); overflow-wrap: anywhere; }
  .filters { max-width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 6px; }
  .filters .chip { flex: none; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .profile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card-caption, .card-text { overflow-wrap: anywhere; }
  .composer, .lightbox { width: calc(100vw - 16px); max-width: none; max-height: calc(100dvh - 16px); margin: auto; }
  .composer-form { max-height: calc(100dvh - 16px); overflow-y: auto; }
  .lightbox figure { max-height: calc(100dvh - 32px); }
  .lightbox img, .lightbox video { max-height: calc(100dvh - 100px); }
  .profile-banner { margin-top: 16px; padding: 16px; }
  .banner-art { margin: -16px -16px 18px; }
  .profile-actions { width: 100%; }
  .profile-actions .btn { flex: 1 1 auto; }
  .auth-main { padding: 20px 0; }
}
@media (max-width: 380px) {
  .grid, .profile-grid { grid-template-columns: minmax(0, 1fr); }
  .composer-actions { flex-wrap: wrap; }
  .composer-actions .btn { flex: 1 1 120px; }
  .profile-name { white-space: normal; overflow-wrap: anywhere; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .age-gate { overflow-y: auto; align-items: start; }
  .age-gate-card { margin-block: auto; }
  .composer, .lightbox { max-height: calc(100dvh - 12px); overflow-y: auto; }
  .lightbox img, .lightbox video { max-height: calc(100dvh - 90px); }
}

/* ============ v9: search bar, type filters, blue tag links ============ */

.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin-block: 8px 16px;
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}

.search-bar:focus-within {
  border-color: var(--ink-3);
  box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.06);
}

.search-bar svg { color: var(--ink-3); flex: none; }

.search-bar input {
  flex: 1;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  padding: 4px 0;
}

.search-bar input::placeholder { color: var(--ink-3); }

.search-clear {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--raised);
  color: var(--ink-2);
  cursor: pointer;
  flex: none;
}

.search-clear:hover { background: var(--line-strong); color: var(--ink); }

.type-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-block: 4px 12px;
}

.active-tag-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-block: 4px 16px;
  font-size: 13px;
  color: var(--ink-2);
}

.active-tag-bar[hidden] { display: none; }

.active-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border: 1px solid #b8d4f5;
  border-radius: 999px;
  background: #e8f2fe;
  color: #1e6fd9;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color var(--fast) var(--ease);
}

.active-tag:hover { background: #d4e6fb; }

.active-tag::after {
  content: " ×";
  margin-left: 4px;
  font-weight: 400;
}

/* blue clickable hashtag */
.tag-link {
  color: #1e6fd9;
  font-weight: 500;
  transition: color var(--fast) var(--ease);
}

.tag-link:hover { color: #0d4ea3; text-decoration: underline; }

.card-tags .tag-link {
  padding: 2px 8px;
  border-radius: 999px;
  background: #e8f2fe;
  font-size: 12px;
  border: 0;
  cursor: pointer;
}

.card-tags .tag-link:hover { background: #d4e6fb; text-decoration: none; }

/* settings menu additions (profile) */
.profile-menu {
  position: relative;
  margin-left: auto;
}

.profile-menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--card);
  color: var(--ink-2);
  font-size: 13px;
  cursor: pointer;
  transition: background-color var(--fast) var(--ease);
}

.profile-menu-btn:hover { background: var(--raised); color: var(--ink); }

.profile-menu-popup {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 200px;
  padding: 6px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(17, 24, 39, 0.12);
  z-index: 30;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 160ms var(--ease), transform 160ms var(--ease);
}

.profile-menu.is-open .profile-menu-popup {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.profile-menu-popup button,
.profile-menu-popup a {
  display: block;
  width: 100%;
  padding: 8px 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-2);
  text-align: left;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease);
}

.profile-menu-popup button:hover,
.profile-menu-popup a:hover {
  background: var(--raised);
  color: var(--ink);
}

.profile-menu-popup .menu-danger { color: var(--danger); }
.profile-menu-popup .menu-danger:hover { background: #fdecea; color: var(--danger); }

/* favorites tab */
.profile-tab-fav {
  color: #b45309;
}

.profile-tab-fav:hover { background: #fef3c7; }

.profile-tab-fav.is-active { background: #b45309; color: #fff; }

/* ============================================================
   v10: Disable text selection except content areas
   ============================================================ */

body {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Form fields always selectable */
input, textarea, select, [contenteditable] {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

/* Content areas selectable */
.card-caption,
.card-text,
.profile-bio,
.profile-name,
.profile-username,
.card-author-name,
.userlist-name,
.userlist-username,
.age-gate-card h2,
.age-gate-q,
.lightbox figcaption,
.card-tags button,
.card-tags .tag-link,
.ui-dialog-title,
.ui-dialog-msg {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

/* ============ v13: vp-active auto-hide + theme ============ */

/* Make sure overlay never blocks the video */
.vp-overlay {
  pointer-events: none !important;
}

.vp-overlay > * {
  pointer-events: auto;
}

/* Default: controls hidden (for inline player) */
.vp .vp-controls {
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity 300ms cubic-bezier(0.22, 1, 0.36, 1), transform 300ms cubic-bezier(0.22, 1, 0.36, 1);
}

.vp .vp-controls * {
  pointer-events: auto;
}

/* Show controls when vp-active is present OR when paused */
.vp.vp-active .vp-controls,
.vp:not(.is-playing) .vp-controls {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.vp.is-playing:not(.vp-active) .vp-controls {
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
}

.vp.is-playing:not(.vp-active) .vp-controls * {
  pointer-events: none;
}

/* The center button shows when paused, hides when playing */
.vp.is-playing .vp-center {
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms cubic-bezier(0.22, 1, 0.36, 1);
}

.vp:not(.is-playing) .vp-center {
  opacity: 1;
  pointer-events: auto;
}

/* Theme-tinted palette (ink + warm off-white) to match the site */
.vp-controls {
  color: #f0ede4;
  background: linear-gradient(to top, rgba(17, 24, 39, 0.94) 0%, rgba(17, 24, 39, 0.65) 50%, transparent 100%);
}

.vp-progress__track {
  background: rgba(240, 237, 228, 0.24);
}

.vp-progress__buffer {
  background: rgba(240, 237, 228, 0.4);
}

.vp-progress__filled {
  background: #f0ede4;
}

.vp-progress__thumb {
  background: #f0ede4;
}

.vp-btn,
.vp-play,
.vp-mute,
.vp-fs {
  color: #f0ede4;
}

.vp-btn:hover {
  background: rgba(240, 237, 228, 0.18);
}

.vp-time {
  color: rgba(240, 237, 228, 0.92);
  font-variant-numeric: tabular-nums;
}

.vp-center {
  background: rgba(240, 237, 228, 0.96);
  color: #111827;
  box-shadow: 0 8px 32px rgba(17, 24, 39, 0.45);
}

.vp-center:hover {
  background: #ffffff;
}

.vp-volume__slider {
  background: rgba(240, 237, 228, 0.3);
}

.vp-volume__slider::-webkit-slider-thumb {
  background: #f0ede4;
}

.vp-volume__slider::-moz-range-thumb {
  background: #f0ede4;
}

/* Inline cards keep a smaller play button, always visible when not playing */
.vp--inline .vp-center-inline {
  opacity: 1;
  transition: opacity 200ms cubic-bezier(0.22, 1, 0.36, 1);
}

.vp--inline.is-playing .vp-center-inline {
  opacity: 0;
  pointer-events: none;
}

/* ============ v14: banner ============ */

.profile-banner .banner-art {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.banner-art.has-image {
  background-color: #e6ecf6;
}

.banner-upload {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.banner-upload img {
  width: 180px;
  height: 60px;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 1px solid var(--line-strong);
  background: var(--raised);
}

.banner-crop-dialog {
  width: min(92vw, 680px);
  max-height: 92vh;
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 24px 64px rgba(17, 24, 39, 0.2);
}

.banner-crop-dialog::backdrop {
  background: rgba(17, 24, 39, 0.55);
  backdrop-filter: blur(5px);
}

.banner-crop-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
}

.banner-crop-head,
.banner-crop-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.banner-crop-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.banner-crop-content .field { margin: 0; }

.banner-crop-stage {
  position: relative;
  max-width: 100%;
  margin-inline: auto;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background-color: #171923;
  background-image: linear-gradient(45deg, #242735 25%, transparent 25%), linear-gradient(-45deg, #242735 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #242735 75%), linear-gradient(-45deg, transparent 75%, #242735 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.banner-crop-stage.is-dragging { cursor: grabbing; }

.avatar-crop-stage {
  width: min(70vw, 420px);
  aspect-ratio: 1 / 1;
}

.banner-crop-stage img {
  position: absolute;
  top: 0;
  left: 0;
  max-width: none;
  height: auto;
  pointer-events: none;
  user-select: none;
}

.banner-zoom input { width: 100%; }

.banner-crop-hint {
  margin: -8px 0 0;
  color: var(--ink-3);
  font-size: 12px;
  text-align: center;
}

.banner-crop-actions .btn { flex: 1; min-height: 42px; }

@media (max-width: 640px) {
  .banner-crop-content { padding: 18px; }
}
