:root {
  color-scheme: light;
  --bg: #eef2f5;
  --surface: #ffffff;
  --ink: #111318;
  --muted: #667085;
  --line: #d9e0e7;
  --nav: rgba(255, 255, 255, 0.94);
  --accent: #101828;
  --blue: #1d9bf0;
  --green: #00a676;
  --rose: #f04462;
  --yellow: #f3b61f;
  --violet: #8b5cf6;
  --shadow: 0 18px 55px rgba(33, 40, 52, 0.18);
  --bottom-system-safe: env(safe-area-inset-bottom, 0px);
  --bottom-viewport-overlay: 0px;
  --bottom-app-safe: calc(var(--bottom-system-safe) + var(--bottom-viewport-overlay));
}

* {
  box-sizing: border-box;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 20% 8%, rgba(29, 155, 240, 0.14), transparent 28%),
    radial-gradient(circle at 82% 20%, rgba(240, 68, 98, 0.12), transparent 24%),
    linear-gradient(135deg, #f7f8fa, var(--bg));
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  position: relative;
  width: min(100vw, 458px);
  height: min(100vh, 900px);
  height: min(100dvh, 900px);
  min-height: 720px;
  margin: 0 auto;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.top-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 62px;
  padding: 10px 18px 5px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(18px);
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 25px;
  line-height: 1.1;
  font-weight: 760;
}

h2 {
  font-size: 18px;
  line-height: 1.2;
}

.icon-button,
.nav-item,
.action-tile,
.text-button,
.wall-mode-button {
  border: 0;
  background: transparent;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #f2f5f8;
  color: var(--ink);
}

svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.category-strip {
  position: sticky;
  top: 62px;
  z-index: 9;
  display: none;
  gap: 8px;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 18px 12px;
  background: rgba(255, 255, 255, 0.96);
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  touch-action: pan-x;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
}

.category-strip.is-dragging,
.quick-filters.is-dragging {
  cursor: grabbing;
  user-select: none;
}

.category-strip::-webkit-scrollbar,
.page::-webkit-scrollbar,
.quick-filters::-webkit-scrollbar {
  display: none;
}

.category-chip,
.filter-chip {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: #263241;
  background: #fff;
  font-size: 13px;
  font-weight: 650;
  cursor: inherit;
}

.category-chip.is-active,
.filter-chip.is-active {
  color: #fff;
  border-color: var(--ink);
  background: var(--ink);
}

.page {
  display: none;
  height: calc(100% - 62px);
  overflow-y: auto;
  padding: 4px 14px calc(126px + var(--bottom-app-safe));
  scroll-padding-bottom: calc(126px + var(--bottom-app-safe));
  scrollbar-width: none;
}

.page.is-active {
  display: block;
}

#libraryPage {
  overflow: hidden;
  padding-bottom: 0;
}

#libraryPage.is-active {
  display: flex;
  flex-direction: column;
}

#homePage {
  height: calc(100% - 62px);
}

#wallPage {
  overflow: hidden;
  padding: 4px 14px calc(96px + var(--bottom-app-safe));
}

#wallPage.is-active {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 14px;
}

.masonry-feed {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 10px;
}

.mode-card {
  position: relative;
  display: block;
  width: 100%;
  margin: 0;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background: #f2f4f7;
  text-align: left;
  color: #fff;
  cursor: pointer;
  font: inherit;
  user-select: none;
}

.mode-card:focus-visible,
.profile-post:focus-visible {
  outline: 3px solid rgba(29, 155, 240, 0.42);
  outline-offset: 3px;
}

.post-edit-button {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 9;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: #111318;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.22);
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.post-edit-button svg {
  width: 18px;
  height: 18px;
}

.mode-card:hover .post-edit-button,
.mode-card:focus-within .post-edit-button,
.profile-post:hover .post-edit-button,
.profile-post:focus-within .post-edit-button {
  opacity: 1;
  transform: translateY(0);
}

.post-edit-button:focus-visible {
  opacity: 1;
  transform: translateY(0);
  outline: 3px solid rgba(29, 155, 240, 0.42);
  outline-offset: 2px;
}

@media (hover: none) {
  .post-edit-button {
    opacity: 1;
    transform: none;
  }
}

.pixel-picture,
.pixel-thumb {
  position: relative;
  display: block;
  overflow: hidden;
  background: #111820;
}

.pixel-picture {
  --split: 50%;
  isolation: isolate;
  width: 100%;
  aspect-ratio: 3 / 4;
  min-height: 148px;
}

.pixel-thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background-image:
    linear-gradient(to right, rgba(12, 18, 28, 0.72) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(12, 18, 28, 0.72) 1px, transparent 1px);
  background-size: calc(100% / 30) calc(100% / 40);
  pointer-events: none;
}

.pixel-picture::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  clip-path: inset(0 0 0 var(--split));
  background-image:
    linear-gradient(to right, rgba(12, 18, 28, 0.72) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(12, 18, 28, 0.72) 1px, transparent 1px);
  background-size: calc(100% / 30) calc(100% / 40);
  pointer-events: none;
}

.pixel-picture::after,
.pixel-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.18), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.06));
  mix-blend-mode: screen;
  pointer-events: none;
}

.mode-card img,
.queue-item img,
.library-item img,
.profile-post img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pixel-picture img,
.pixel-picture canvas,
.pixel-picture video {
  display: block;
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  min-width: 0;
}

.pixel-picture img,
.pixel-picture video {
  object-fit: cover;
}

.pixel-picture canvas {
  object-fit: fill;
}

.original-half {
  clip-path: inset(0 calc(100% - var(--split)) 0 0);
  image-rendering: auto;
}

.pixel-half {
  clip-path: inset(0 0 0 var(--split));
}

.pixel-half,
.queue-item img,
.library-item img,
.profile-post img {
  image-rendering: pixelated;
}

.pixel-picture video {
  background: #111820;
}

.pixel-picture.is-video-pixel-only {
  --split: 0%;
}

.pixel-video-full {
  inset: 0;
  image-rendering: pixelated;
}

.pixel-picture.is-plain-preview::before {
  display: none;
}

.pixel-picture.is-plain-preview .plain-preview-full {
  inset: 0;
  object-fit: cover;
  image-rendering: auto;
}

.profile-post .pixel-picture.is-plain-preview img {
  image-rendering: auto;
}

.pixel-picture .preview-video-source {
  position: absolute;
  inset: auto;
  left: 0;
  top: 0;
  z-index: -1;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.mode-card.tall .pixel-picture {
  min-height: 238px;
}

.mode-card.medium .pixel-picture {
  min-height: 190px;
}

.split-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--split);
  z-index: 5;
  width: 42px;
  outline: 0;
  cursor: ew-resize;
  touch-action: none;
  transform: translateX(-50%);
}

.split-handle::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 3px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), #fff 18%, #fff 82%, rgba(255, 255, 255, 0.18));
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.18),
    0 12px 28px rgba(0, 0, 0, 0.28);
  transform: translateX(-50%);
}

.split-handle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 36px;
  height: 36px;
  aspect-ratio: 1 / 1;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  clip-path: circle(50% at 50% 50%);
  background: rgba(255, 255, 255, 0.82);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.68),
    0 8px 18px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(10px);
  transform: translate(-50%, -50%);
}

.pixel-picture.is-splitting .split-handle::after,
.split-handle:focus-visible::after {
  background: rgba(17, 19, 24, 0.9);
  border-color: rgba(255, 255, 255, 0.28);
}

.split-chevron {
  position: absolute;
  top: 50%;
  z-index: 1;
  width: 7px;
  height: 7px;
  border-color: #172033;
  border-style: solid;
  border-width: 0 0 2px 2px;
}

.split-chevron.is-left {
  left: 11px;
  transform: translateY(-50%) rotate(45deg);
}

.split-chevron.is-right {
  right: 11px;
  transform: translateY(-50%) rotate(225deg);
}

.pixel-picture.is-splitting .split-chevron,
.split-handle:focus-visible .split-chevron {
  border-color: #fff;
}

.mode-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  background: linear-gradient(180deg, transparent 42%, rgba(0, 0, 0, 0.66));
  pointer-events: none;
}

.card-body {
  position: absolute;
  right: 10px;
  bottom: 10px;
  left: 10px;
  z-index: 6;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
}

.card-title {
  display: block;
  font-size: 14px;
  line-height: 1.15;
  font-weight: 780;
}

.card-meta {
  display: block;
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 11px;
  font-weight: 650;
}

.search-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  margin-bottom: 12px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
}

.search-row > svg {
  flex: 0 0 auto;
}

.search-row input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
}

.search-voice-button {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #eef3f8;
  color: #344054;
}

.search-voice-button svg {
  width: 19px;
  height: 19px;
}

.quick-filters {
  display: flex;
  gap: 8px;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  margin-bottom: 12px;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  touch-action: pan-x;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
}

.collection-open-header {
  position: sticky;
  top: -12px;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin: 0 -14px 12px;
  padding: 0 14px 12px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(14px);
}

.collection-open-header[hidden] {
  display: none;
}

.collection-back-button {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: #172033;
}

.collection-back-button svg {
  width: 20px;
  height: 20px;
}

.collection-open-title {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.collection-open-title strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.1;
  font-weight: 820;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collection-open-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
}

.collection-card {
  position: relative;
  display: block;
  width: 100%;
  min-height: 132px;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background: #172033;
  color: #fff;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.collection-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(17, 24, 39, 0.1), rgba(17, 24, 39, 0.78)),
    radial-gradient(circle at 18% 20%, rgba(29, 155, 240, 0.4), transparent 38%);
  pointer-events: none;
}

.collection-preview-grid {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  opacity: 0.78;
}

.collection-preview-grid img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: auto;
}

.collection-card-body {
  position: absolute;
  right: 11px;
  bottom: 11px;
  left: 11px;
  z-index: 2;
  display: grid;
  gap: 4px;
}

.collection-card-label {
  width: max-content;
  max-width: 100%;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.86);
  font-size: 10px;
  line-height: 1;
  font-weight: 760;
}

.collection-card-title {
  display: block;
  overflow: hidden;
  font-size: 16px;
  line-height: 1.08;
  font-weight: 820;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collection-card-count {
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  line-height: 1.1;
  font-weight: 650;
}

.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.action-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  min-height: 132px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 16px;
  font-weight: 760;
  box-shadow: 0 10px 26px rgba(18, 25, 38, 0.06);
}

.tile-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: #fff;
}

.action-tile:nth-child(1) .tile-icon { background: var(--blue); }
.action-tile:nth-child(2) .tile-icon { background: var(--rose); }
.action-tile:nth-child(3) .tile-icon { background: var(--green); }
.action-tile:nth-child(4) .tile-icon { background: var(--violet); }

.playlist-strip {
  margin-top: 18px;
}

.queue-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 112px;
  gap: 10px;
  overflow-x: auto;
  margin-top: 10px;
  padding-bottom: 2px;
}

.queue-item,
.library-item {
  overflow: hidden;
  border-radius: 8px;
  background: #f2f4f7;
}

.pixel-thumb {
  height: 92px;
}

.queue-item span,
.library-item span {
  display: block;
  padding: 8px;
  overflow: hidden;
  color: #273244;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.text-button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 17px;
  background: #f2f5f8;
  color: var(--rose);
  font-size: 13px;
  font-weight: 760;
}

.library-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.profile-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 2px 2px 12px;
}

.profile-avatar {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 74px;
  height: 74px;
  overflow: hidden;
  border: 1px solid rgba(16, 24, 40, 0.12);
  border-radius: 50%;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent 45%),
    conic-gradient(from 20deg, var(--rose), var(--yellow), var(--green), var(--blue), var(--violet), var(--rose));
  color: #fff;
  cursor: pointer;
  font-size: 20px;
  font-weight: 820;
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.12);
}

button.profile-avatar {
  padding: 0;
}

.profile-avatar::before {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  background:
    linear-gradient(to right, rgba(255, 255, 255, 0.22) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.22) 1px, transparent 1px),
    rgba(17, 19, 24, 0.28);
  background-size: 9px 9px;
}

.profile-avatar span {
  position: relative;
  z-index: 1;
}

.profile-avatar img {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.profile-avatar-change {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 10px;
  border-radius: 50%;
  background: rgba(17, 19, 24, 0.62);
  color: #fff;
  font-size: 9px;
  font-weight: 820;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.profile-avatar-change svg {
  width: 18px;
  height: 18px;
}

.profile-avatar:hover .profile-avatar-change,
.profile-avatar:focus-visible .profile-avatar-change {
  opacity: 1;
}

.profile-info {
  flex: 1 1 auto;
  min-width: 0;
}

.profile-info h2 {
  font-size: 22px;
  line-height: 1.05;
  font-weight: 820;
}

.profile-info p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
}

.profile-settings {
  position: relative;
  flex: 0 0 auto;
  align-self: flex-start;
}

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

.profile-settings-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.profile-settings-button svg {
  width: 21px;
  height: 21px;
}

.profile-settings-menu {
  position: absolute;
  top: 48px;
  right: 0;
  z-index: 18;
  min-width: 176px;
  padding: 6px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.18);
}

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

.profile-settings-menu button {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #b0001b;
  font-size: 13px;
  font-weight: 820;
  text-align: left;
}

.profile-settings-menu button:hover {
  background: #fff0f3;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 0 0 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.profile-stats span {
  padding: 11px 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
  text-align: center;
}

.profile-stats strong {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
  font-size: 18px;
  line-height: 1;
}

.profile-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 12px;
}

.profile-auth-gate {
  display: grid;
  flex: 1;
  min-height: 420px;
  place-items: center;
  padding: 24px 4px 100px;
}

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

.profile-auth-card {
  display: grid;
  gap: 14px;
  width: min(100%, 360px);
  padding: 20px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.1);
}

.profile-auth-card h2 {
  font-size: 28px;
  line-height: 1.05;
  font-weight: 880;
}

.profile-auth-card p {
  color: var(--muted);
  font-size: 14px;
  font-weight: 680;
  line-height: 1.35;
}

.profile-auth-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-auth-actions .pin-primary-button,
.profile-auth-actions .pin-secondary-button {
  width: 100%;
  flex-basis: auto;
}

.profile-hero[hidden],
.profile-stats[hidden],
.profile-actions[hidden],
.profile-feed[hidden],
#profileUploadInput[hidden] {
  display: none;
}

.profile-action-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #263241;
  font-size: 13px;
  font-weight: 760;
}

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

.profile-feed {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  gap: 8px;
  padding-bottom: calc(126px + var(--bottom-app-safe));
  scroll-padding-bottom: calc(126px + var(--bottom-app-safe));
  scrollbar-width: none;
}

.profile-feed::-webkit-scrollbar {
  display: none;
}

.profile-column {
  display: grid;
  gap: 8px;
  align-content: start;
  min-width: 0;
}

.profile-empty-state {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  min-height: 220px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 760;
  text-align: center;
}

.profile-collection-sheet {
  position: absolute;
  inset: 0;
  z-index: 34;
  display: none;
  background:
    radial-gradient(circle at 18% 0%, rgba(29, 155, 240, 0.08), transparent 32%),
    linear-gradient(180deg, #fff 0%, #f7f9fc 62%, #fff 100%);
}

.profile-collection-sheet.is-open {
  display: block;
}

.profile-collection-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 10px 14px 0;
}

.profile-collection-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 -14px;
  padding: 6px 14px 13px;
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(14px);
}

.profile-collection-back {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.profile-collection-back svg {
  width: 21px;
  height: 21px;
}

.profile-collection-header h2 {
  font-size: 25px;
  line-height: 1.05;
  font-weight: 860;
}

.profile-collection-header span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.profile-collection-feed {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  gap: 8px;
  padding: 8px 0 calc(18px + var(--bottom-app-safe));
  scrollbar-width: none;
}

.profile-collection-feed::-webkit-scrollbar {
  display: none;
}

.profile-collection-feed.is-author-profile {
  display: block;
  padding: 10px 0 calc(18px + var(--bottom-app-safe));
}

.profile-collection-feed.is-subscriptions {
  display: grid;
  grid-template-columns: 1fr;
  align-content: start;
  gap: 0;
  padding: 6px 0 calc(18px + var(--bottom-app-safe));
}

.author-profile-hero {
  margin: 4px 0 14px;
}

.author-profile-stats {
  margin-bottom: 12px;
}

.author-profile-actions {
  margin-bottom: 12px;
}

.author-profile-feed {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.subscription-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 66px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.subscription-row:last-child {
  border-bottom: 0;
}

.subscription-user-button {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  flex: 1 1 auto;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.subscription-avatar {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  overflow: hidden;
  border-radius: 50%;
  background: conic-gradient(from 220deg, #24c6dc, #514a9d, #ff5f6d, #ffc371, #24c6dc);
  color: #fff;
  font-size: 15px;
  font-weight: 860;
}

.subscription-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.subscription-info {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.subscription-info strong,
.subscription-info span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.subscription-info strong {
  font-size: 15px;
  font-weight: 820;
}

.subscription-info span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.subscription-follow-button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 999px;
  background: #f5f7fa;
  color: #1f2937;
  font-size: 12px;
  font-weight: 790;
}

.profile-post {
  position: relative;
  display: block;
  width: 100%;
  margin: 0;
  overflow: hidden;
  border-radius: 8px;
  background: #111820;
  cursor: pointer;
}

.profile-post .pixel-picture {
  min-height: 0;
}

.profile-post-preview {
  aspect-ratio: 3 / 4;
}

.profile-post.tall .profile-post-preview {
  aspect-ratio: 3 / 5;
}

.profile-post.medium .profile-post-preview {
  aspect-ratio: 4 / 5;
}

.profile-post .split-handle {
  width: 34px;
}

.profile-post .split-handle::after {
  width: 30px;
  height: 30px;
}

.profile-post::after {
  content: "";
  position: absolute;
  inset: 46% 0 0;
  z-index: 4;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.62));
  pointer-events: none;
}

.profile-post-picture {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  overflow: hidden;
}

.profile-post.tall .profile-post-picture {
  aspect-ratio: 3 / 5;
}

.profile-post.medium .profile-post-picture {
  aspect-ratio: 4 / 5;
}

.profile-post-picture::before,
.profile-post-picture::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.profile-post-picture::before {
  z-index: 1;
  background-image:
    linear-gradient(to right, rgba(12, 18, 28, 0.64) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(12, 18, 28, 0.64) 1px, transparent 1px);
  background-size: calc(100% / 30) calc(100% / 40);
}

.profile-post-picture::after {
  z-index: 2;
  background: linear-gradient(180deg, transparent 54%, rgba(0, 0, 0, 0.58));
}

.profile-post-meta {
  position: absolute;
  right: 7px;
  bottom: 7px;
  left: 7px;
  z-index: 6;
  display: grid;
  gap: 5px;
  color: rgba(255, 255, 255, 0.9);
}

.profile-post-title {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  line-height: 1.1;
  font-weight: 820;
}

.profile-post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}

.profile-post-tag {
  max-width: 100%;
  overflow: hidden;
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.88);
  font-size: 9px;
  line-height: 1;
  font-weight: 740;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-post-tag.is-draft {
  background: rgba(230, 0, 35, 0.78);
  color: #fff;
}

.media-kind-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 7;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(17, 19, 24, 0.72);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}

.profile-post.has-edit-button .media-kind-badge {
  top: 48px;
}

.media-kind-badge::before {
  content: "";
  width: 0;
  height: 0;
  margin-left: 2px;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 9px solid #fff;
}

.wall-preview {
  position: relative;
  align-self: center;
  width: min(100%, calc((100dvh - 300px - var(--bottom-app-safe)) * 0.75), 430px);
  aspect-ratio: 3 / 4;
  margin: 0 auto;
}

.wall-matrix {
  position: absolute;
  inset: 22px;
  display: grid;
  grid-template-columns: repeat(30, 1fr);
  grid-template-rows: repeat(40, 1fr);
  gap: 1px;
  padding: 4px;
  border: 1px solid #c7d0dc;
  background: #172033;
}

.pixelated-wall {
  gap: 1px;
}

.pixel {
  min-width: 0;
  min-height: 0;
  border-radius: 1px;
}

.backlight {
  position: absolute;
  border-radius: 8px;
  opacity: 0.86;
}

.backlight.top {
  top: 6px;
  right: 22px;
  left: 22px;
  height: 9px;
  background: linear-gradient(90deg, #ff3d5a, #f3b61f, #00a676, #1d9bf0);
}

.backlight.bottom {
  right: 22px;
  bottom: 6px;
  left: 22px;
  height: 9px;
  background: linear-gradient(90deg, #8b5cf6, #1d9bf0, #00a676, #f3b61f);
}

.backlight.left {
  top: 22px;
  bottom: 22px;
  left: 6px;
  width: 9px;
  background: linear-gradient(180deg, #ff3d5a, #1d9bf0);
}

.backlight.right {
  top: 22px;
  right: 6px;
  bottom: 22px;
  width: 9px;
  background: linear-gradient(180deg, #00a676, #f3b61f);
}

.wall-mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.wall-mode-button {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 58px;
  padding: 0 12px;
  border-radius: 8px;
  background: #f6f8fb;
  color: #182230;
  font-size: 13px;
  font-weight: 780;
  text-align: left;
}

.wall-mode-button svg {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  color: #344054;
}

.wall-mode-button span {
  min-width: 0;
  line-height: 1.15;
}

.pin-sheet {
  position: absolute;
  inset: 0;
  z-index: 35;
  display: none;
  background:
    radial-gradient(circle at 22% 0%, rgba(230, 0, 35, 0.08), transparent 30%),
    linear-gradient(180deg, #fff 0%, #f7f9fc 54%, #fff 100%);
}

.pin-sheet.is-open {
  display: block;
}

.pin-panel {
  height: 100%;
  overflow-y: auto;
  padding: 4px 14px calc(28px + var(--bottom-app-safe));
  scrollbar-width: none;
}

.pin-panel::-webkit-scrollbar {
  display: none;
}

.pin-header {
  position: sticky;
  top: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 -14px 2px;
  padding: 0 14px 4px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(14px);
}

.pin-round-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.1);
}

.pin-round-button svg {
  width: 21px;
  height: 21px;
}

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

.pin-header-actions [hidden] {
  display: none;
}

.pin-preview {
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  background: #111820;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.16);
}

.pin-preview .pixel-picture {
  min-height: 0;
  border-radius: 8px;
}

.pin-content {
  display: grid;
  gap: 10px;
  padding: 15px 2px 0;
}

.pin-content h2 {
  font-size: 27px;
  line-height: 1.04;
  font-weight: 880;
}

.pin-content p {
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.pin-content p[hidden] {
  display: none;
}

.pin-author-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  max-width: 100%;
  min-height: 36px;
  margin: 0 0 5px;
  padding: 0 10px 0 4px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
}

.pin-author-button:hover {
  color: #b0001b;
}

.pin-author-avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background:
    linear-gradient(135deg, #1d9bf0, #8b5cf6 45%, #f04462 70%, #f3b61f);
  color: #fff;
  font-size: 13px;
  font-weight: 880;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
}

.pin-author-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.pin-author-text {
  display: grid;
  gap: 1px;
  min-width: 0;
  text-align: left;
}

.pin-author-text span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
}

.pin-author-text strong {
  overflow: hidden;
  color: currentColor;
  font-size: 13px;
  font-weight: 860;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pin-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding-top: 2px;
}

.pin-tags span {
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  background: #fff;
  color: #344054;
  font-size: 12px;
  font-weight: 760;
  box-shadow: 0 5px 16px rgba(15, 23, 42, 0.05);
}

.pin-tags span.is-media-kind {
  border-color: rgba(230, 0, 35, 0.14);
  background: #fff0f3;
  color: #b0001b;
}

.pin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 2px 0 7px;
}

.pin-primary-button,
.pin-secondary-button {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 820;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.pin-primary-button {
  flex: 1 1 132px;
  border: 0;
  background: linear-gradient(180deg, #f01836, #d90020);
  color: #fff;
}

.pin-secondary-button {
  flex: 1 1 118px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
}

.pin-secondary-button.is-active {
  border-color: #e60023;
  background: #fff0f3;
  color: #b0001b;
}

.auth-sheet {
  position: absolute;
  inset: 0;
  z-index: 45;
  display: none;
}

.auth-sheet.is-open {
  display: block;
}

.auth-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(15, 23, 42, 0.22);
  backdrop-filter: blur(8px);
}

.auth-panel {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: calc(96px + var(--bottom-app-safe));
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.24);
}

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

.auth-header h2 {
  font-size: 24px;
  line-height: 1.05;
}

.auth-fields {
  display: grid;
  gap: 10px;
}

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

.auth-fields label {
  display: grid;
  gap: 6px;
  color: #475467;
  font-size: 12px;
  font-weight: 800;
}

.auth-fields input {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
}

.auth-qr-placeholder {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 4px 0 2px;
  text-align: center;
}

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

.auth-qr-art {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 28px);
  grid-template-rows: repeat(3, 28px);
  gap: 8px;
  width: 152px;
  height: 152px;
  padding: 16px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 18px;
  background:
    linear-gradient(90deg, #111318 10px, transparent 10px 18px, #111318 18px 24px, transparent 24px 32px, #111318 32px 42px, transparent 42px),
    linear-gradient(#111318 10px, transparent 10px 18px, #111318 18px 24px, transparent 24px 32px, #111318 32px 42px, transparent 42px),
    #fff;
  background-size: 56px 56px;
  background-position: 72px 72px;
  box-shadow: 0 16px 42px rgba(15, 23, 42, 0.12);
}

.auth-qr-art span {
  position: relative;
  display: block;
  border: 8px solid #111318;
  border-radius: 4px;
  background: #fff;
}

.auth-qr-art span::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 2px;
  background: #111318;
}

.auth-qr-art span:nth-child(2) {
  grid-column: 3;
}

.auth-qr-art span:nth-child(3) {
  grid-row: 3;
}

.auth-qr-placeholder h3 {
  margin: 0;
  font-size: 21px;
  line-height: 1.08;
  font-weight: 880;
}

.auth-qr-placeholder p {
  max-width: 310px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
}

.auth-camera-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 820;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.auth-camera-button svg {
  width: 20px;
  height: 20px;
}

.auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.auth-note {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
}

.editor-sheet {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: none;
}

.editor-sheet.is-open {
  display: block;
}

.editor-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.38);
  backdrop-filter: blur(8px);
}

.editor-panel {
  position: absolute;
  right: 0;
  bottom: var(--bottom-viewport-overlay);
  left: 0;
  max-height: calc(100% - 24px);
  overflow-y: auto;
  padding: 16px 14px calc(22px + var(--bottom-system-safe));
  border-radius: 22px 22px 0 0;
  background: #fff;
  box-shadow: 0 -20px 48px rgba(15, 23, 42, 0.24);
  scrollbar-width: none;
}

.editor-panel::-webkit-scrollbar {
  display: none;
}

.editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.editor-heading {
  min-width: 0;
  flex: 1;
}

.editor-title-row {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

.editor-title-measure {
  position: absolute;
  visibility: hidden;
  pointer-events: none;
  white-space: pre;
  font: inherit;
  font-size: 24px;
  font-weight: 880;
}

.editor-title-input {
  flex: 0 1 auto;
  width: var(--editor-title-width, 12ch);
  max-width: calc(100% - 40px);
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 24px;
  font-weight: 880;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-title-input:focus {
  border-radius: 6px;
  box-shadow: 0 0 0 3px rgba(29, 155, 240, 0.14);
}

.title-edit-button {
  display: grid;
  place-items: center;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: #f1f4f8;
  color: #536274;
}

.title-edit-button svg {
  width: 17px;
  height: 17px;
}

.editor-preview {
  display: grid;
  place-items: center;
  padding: 8px 0 12px;
}

.editor-picture {
  width: min(100%, 270px);
  min-height: 0;
  aspect-ratio: 3 / 4;
  border-radius: 8px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.18);
}

.editor-picture {
  cursor: grab;
  touch-action: none;
}

.editor-picture.is-panning {
  cursor: grabbing;
}

.editor-picture .original-half {
  object-fit: cover;
}

.editor-picture .pixel-half {
  object-fit: fill;
  filter: none;
  transform: none;
}

.editor-picture.fit-contain .original-half {
  object-fit: contain;
}

.editor-picture.fit-stretch .original-half {
  object-fit: fill;
}

.editor-controls {
  display: grid;
  gap: 10px;
}

.editor-segment {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  border-radius: 8px;
  background: #f1f4f8;
}

.editor-segment button,
.editor-button-grid button {
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  font-weight: 760;
}

.editor-segment button {
  min-height: 36px;
  font-size: 12px;
}

.editor-segment button.is-active {
  background: #fff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.editor-button-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.editor-button-grid button {
  display: grid;
  place-items: center;
  min-height: 66px;
  padding: 7px 5px;
  background: #f8fafc;
  color: #273244;
  font-size: 11px;
}

.editor-button-grid svg {
  width: 20px;
  height: 20px;
}

.editor-button-grid .danger {
  color: var(--rose);
  background: #fff1f4;
}

.editor-slider,
.tag-editor {
  display: grid;
  gap: 7px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #273244;
  font-size: 13px;
  font-weight: 740;
}

.editor-slider input {
  width: 100%;
  accent-color: var(--blue);
}

.tag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag-chips button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 15px;
  background: #eef3f8;
  color: #273244;
  font-size: 12px;
  font-weight: 760;
}

.tag-chips button.is-active {
  border-color: rgba(29, 155, 240, 0.32);
  background: #e5f2ff;
  color: #0a66b7;
  box-shadow: inset 0 0 0 1px rgba(29, 155, 240, 0.08);
}

.bottom-nav {
  position: absolute;
  right: 0;
  bottom: var(--bottom-viewport-overlay);
  left: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  min-height: calc(76px + var(--bottom-system-safe));
  padding: 8px 14px calc(12px + var(--bottom-system-safe));
  border-top: 1px solid rgba(218, 224, 231, 0.82);
  background: var(--nav);
  backdrop-filter: blur(18px);
}

.nav-item {
  display: grid;
  place-items: center;
  min-height: 52px;
  color: #4c596a;
  font-size: 11px;
  font-weight: 730;
}

.nav-item svg {
  width: 23px;
  height: 23px;
}

.nav-item.is-active {
  color: #05070a;
}

.nav-upload-button {
  gap: 4px;
  color: #05070a;
}

.nav-upload-button svg {
  width: 44px;
  height: 44px;
  padding: 11px;
  border-radius: 50%;
  background: #05070a;
  color: #fff;
  box-shadow: 0 10px 22px rgba(5, 7, 10, 0.24);
}

.upload-action-sheet {
  position: absolute;
  inset: 0;
  z-index: 29;
  display: none;
}

.upload-action-sheet.is-open {
  display: block;
}

.upload-action-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(17, 24, 39, 0.22);
}

.upload-action-panel {
  position: absolute;
  right: 14px;
  bottom: calc(90px + var(--bottom-app-safe));
  left: 14px;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(218, 224, 231, 0.9);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.2);
}

.upload-action {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 50px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: #f7f9fb;
  color: #162033;
  font-weight: 760;
  text-align: left;
}

.upload-action:hover {
  background: #eef3f8;
}

.upload-action svg {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  color: #344054;
}

.toast {
  position: absolute;
  right: 18px;
  bottom: calc(92px + var(--bottom-app-safe));
  left: 18px;
  z-index: 30;
  min-height: 42px;
  padding: 12px 14px;
  border-radius: 8px;
  background: rgba(17, 19, 24, 0.92);
  color: #fff;
  font-size: 14px;
  font-weight: 720;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.progress-toast {
  position: absolute;
  right: 18px;
  bottom: calc(92px + var(--bottom-app-safe));
  left: 18px;
  z-index: 55;
  display: grid;
  gap: 9px;
  padding: 12px 14px;
  border-radius: 8px;
  background: rgba(17, 19, 24, 0.94);
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.progress-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  font-weight: 760;
}

.progress-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-row strong {
  font-size: 12px;
}

.progress-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
}

.progress-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--green));
  transition: width 120ms linear;
}

@media (min-width: 760px) {
  body {
    display: grid;
    place-items: center;
    padding: 24px;
  }

  .app-shell {
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 28px;
  }
}

@media (max-width: 430px) {
  :root {
    --bottom-system-safe: max(1px, env(safe-area-inset-bottom, 0px));
  }

  .app-shell {
    width: 100vw;
    height: 100dvh;
    min-height: 0;
  }

  #wallPage {
    padding: 6px 14px calc(86px + var(--bottom-app-safe));
  }

  #wallPage.is-active {
    gap: 8px;
  }

  .wall-preview {
    width: min(100%, calc((100dvh - 318px - var(--bottom-app-safe)) * 0.75), 330px);
  }

  .wall-matrix {
    inset: 18px;
    padding: 3px;
  }

  .backlight.top,
  .backlight.bottom {
    right: 18px;
    left: 18px;
    height: 7px;
  }

  .backlight.top {
    top: 5px;
  }

  .backlight.bottom {
    bottom: 5px;
  }

  .backlight.left,
  .backlight.right {
    top: 18px;
    bottom: 18px;
    width: 7px;
  }

  .backlight.left {
    left: 5px;
  }

  .backlight.right {
    right: 5px;
  }

  .wall-mode-grid {
    gap: 8px;
  }

  .wall-mode-button {
    gap: 9px;
    min-height: 52px;
    padding: 0 10px;
    font-size: 12px;
  }

  .wall-mode-button svg {
    flex-basis: 22px;
    width: 22px;
    height: 22px;
  }
}
