:root {
  color-scheme: light;
  --app-max-width: 430px;
  --bg: #f4f1eb;
  --surface: #ffffff;
  --ink: #1f2328;
  --muted: #69707a;
  --line: #d9d3c9;
  --accent: #176b87;
  --accent-strong: #0f5268;
  --shadow: 0 18px 42px rgba(31, 35, 40, 0.1);
  --overlay-text-shadow:
    0 0 2px rgba(0, 0, 0, 0.38),
    0 0 7px rgba(0, 0, 0, 0.24);
  --overlay-drop-shadow:
    drop-shadow(0 0 2px rgba(0, 0, 0, 0.38))
    drop-shadow(0 0 7px rgba(0, 0, 0, 0.24));
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  height: 100vh;
  height: 100dvh;
  min-width: 320px;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  background: #000;
}

body.is-virtual-tap-dragging {
  cursor: grabbing;
  user-select: none;
}

body.is-virtual-tap-dragging * {
  cursor: grabbing !important;
}

html {
  height: 100%;
}

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

button,
.upload-button,
.ghost-upload {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

button:disabled,
.is-disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.app-shell {
  display: flex;
  flex-direction: column;
  width: min(100vw, var(--app-max-width));
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--bg);
}

.bottom-nav {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  flex: 0 0 auto;
  gap: 3px;
  width: 100%;
  padding: 6px 10px calc(6px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 -8px 24px rgba(31, 35, 40, 0.08);
  backdrop-filter: blur(14px);
}

.bottom-nav.is-home-disabled {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.bottom-nav-item {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  min-height: 56px;
  padding: 5px 3px;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  box-shadow: none;
  font-size: 0.76rem;
  font-weight: 800;
}

.bottom-nav-item.is-active {
  color: var(--accent);
  background: rgba(23, 107, 135, 0.1);
}

.bottom-nav-item:not(.is-active):focus,
.bottom-nav-item:not(.is-active):active {
  color: var(--muted);
  background: transparent;
  box-shadow: none;
}

.bottom-nav-icon {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bottom-nav-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.viewer-uploader.is-profile-link {
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.app-shell.is-expanded-ui-hidden #wall-list-view.is-fyp-home .home-header,
.app-shell.is-expanded-ui-hidden .wall-view:has(.meme-wall.is-expanded) .wall-toolbar,
.app-shell.is-expanded-ui-hidden .expanded-reactions {
  opacity: 0;
  pointer-events: none;
}

.view {
  flex: 1 1 auto;
  min-height: 0;
  width: calc(100% - 24px);
  margin: 0 auto;
  padding: 22px 0 28px;
}

#wall-list-view {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  padding: 0;
  overflow: hidden;
}

#wall-list-view.is-fyp-home {
  width: 100%;
  padding: 0;
}

.home-header,
.home-actions,
.wall-toolbar,
.wall-toolbar-actions,
.home-header-actions,
.upload-toolbar,
.form-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.form-row {
  align-items: stretch;
  flex-direction: column;
}

.home-header,
.wall-toolbar {
  justify-content: space-between;
}

.home-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(44px, auto);
  align-items: center;
  gap: 14px;
  flex: 0 0 auto;
  z-index: 2;
  min-height: 76px;
  width: 100%;
  padding: 12px 14px;
  border-bottom: 0;
  background: var(--bg);
}

.home-header h1 {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  font-size: 1.75rem;
  line-height: 1.08;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-menu {
  justify-self: end;
  position: relative;
}

.home-header-actions {
  justify-self: end;
  gap: 6px;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 58px;
  min-width: 58px;
  min-height: 58px;
  padding: 0;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 10px 24px rgba(31, 35, 40, 0.09);
  font-size: 1.35rem;
}

.icon-button-image {
  display: block;
  width: 32px;
  height: 32px;
  object-fit: contain;
  pointer-events: none;
}

#app-menu-button,
#wall-menu-button,
#back-button,
#create-wall-back-button,
#upload-back-button,
#upload-menu-button,
.upload-icon-button {
  background: transparent;
  box-shadow: none;
}

.menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 5;
  display: grid;
  min-width: 160px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.menu-panel button {
  min-height: 38px;
  padding: 0 12px;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.menu-panel button:hover {
  background: #f2eee7;
}

.menu-panel .menu-logout-button,
.wall-menu-panel .menu-logout-button {
  color: #c62828;
  font-weight: 800;
}

.menu-panel .menu-logout-button:hover,
.wall-menu-panel .menu-logout-button:hover,
.wall-menu-panel .menu-logout-button:focus-visible {
  color: #a31616;
  background: #fff0f0;
}

.home-actions {
  align-items: stretch;
  flex-direction: column;
  justify-content: stretch;
  width: calc(100% - 24px);
  margin: 18px auto 0;
}

.home-actions .search-box {
  flex: 1 1 auto;
  width: 100%;
}

.home-section-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  border-bottom: 1px solid var(--line);
}

.home-section-button {
  position: relative;
  min-height: 42px;
  border-radius: 0;
  color: var(--muted);
  background: transparent;
  box-shadow: none;
  font-weight: 800;
}

.home-section-button::after {
  content: "";
  position: absolute;
  right: 16px;
  bottom: -1px;
  left: 16px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: transparent;
}

.home-section-button.is-active {
  color: var(--accent);
}

.home-section-button.is-active::after {
  background: var(--accent);
}

.home-section-button:hover {
  background: rgba(23, 107, 135, 0.06);
}

.home-search-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.home-search-row input {
  flex: 1 1 auto;
}

.home-create-button {
  flex: 0 0 auto;
  width: auto;
  min-width: 104px;
  padding-inline: 10px;
  font-size: 0.9rem;
  white-space: nowrap;
}

.primary-button,
.upload-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 10px 24px rgba(23, 107, 135, 0.2);
}

.primary-button:not(:disabled):hover,
.upload-button:not(:disabled):hover {
  background: var(--accent-strong);
}

.primary-button,
.upload-button,
.ghost-button,
.ghost-upload,
.toolbar-select {
  width: 100%;
}

.home-search-row .home-create-button {
  width: auto;
  flex: 0 0 auto;
}

.toolbar-select {
  --select-arrow: none;
  min-height: 44px;
  min-width: 116px;
  padding: 0 18px;
  border: 1px solid #1f2328;
  border-radius: 8px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  color: var(--ink);
  background: #fff;
  text-align: center;
  text-align-last: center;
}

.toolbar-select::-ms-expand {
  display: none;
}

.toolbar-select option {
  text-align: center;
}

.ghost-button,
.ghost-upload {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  color: var(--ink);
  background: #ebe4d8;
}

.search-box {
  display: grid;
  gap: 6px;
  width: min(420px, 100%);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.search-box input,
.create-form input,
.auth-card input,
.auth-card select {
  min-width: 0;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
}

.create-form {
  display: grid;
  gap: 10px;
  width: calc(100% - 24px);
  margin: 24px auto 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.create-form label,
.auth-card label {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.privacy-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.privacy-options legend {
  width: 100%;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.privacy-options label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}

.privacy-options input {
  min-height: auto;
}

.empty-state {
  margin-top: 0;
  padding: 42px;
  border: 1px dashed #b8aea1;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  text-align: center;
}

.wall-list-scroll {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  margin-top: 0;
  margin-right: auto;
  margin-left: auto;
  overflow-y: auto;
  padding: 0;
  scrollbar-width: none;
}

.wall-list-scroll::-webkit-scrollbar {
  width: 0;
  height: 0;
}

#wall-list-view.is-fyp-home .home-actions {
  display: none;
}

#wall-list-view.is-fyp-home .home-header {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 8;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(44px, auto);
  width: 100%;
  min-height: 76px;
  padding: 12px 14px;
  background: transparent;
}

#wall-list-view.is-fyp-home .home-header h1 {
  display: block;
  overflow: visible;
  color: #fff;
  filter: var(--overlay-drop-shadow);
  text-overflow: clip;
  text-shadow: none;
  white-space: nowrap;
}

#wall-list-view.is-fyp-home #app-menu-button {
  color: #fff;
  background: transparent;
  box-shadow: none;
}

#wall-list-view.is-fyp-home #app-menu-button .icon-button-image,
.wall-view:has(.meme-wall.is-expanded) #wall-menu-button .icon-button-image {
  content: url("icons/white-hamburger.png");
  width: 32px;
  height: 32px;
  filter: var(--overlay-drop-shadow);
}

.wall-view:has(.meme-wall.is-expanded) #back-button .icon-button-image {
  content: url("icons/white-back.png");
  width: 32px;
  height: 32px;
  filter: var(--overlay-drop-shadow);
}

#wall-list-view.is-fyp-home .home-header {
  overflow: visible;
}

#wall-list-view.is-fyp-home .site-menu {
  display: block;
  justify-self: end;
}

#wall-list-view.is-fyp-home .wall-list-scroll {
  width: 100%;
  height: 100%;
  margin-top: 0;
  overflow: hidden;
  padding: 0;
}

.empty-state h2,
.empty-state p {
  margin: 0;
}

.empty-state p {
  margin-top: 8px;
  color: var(--muted);
}

.wall-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  margin-top: 0;
}

.wall-grid.is-fyp-feed {
  display: block;
  height: 100%;
  margin-top: 0;
}

.wall-grid.is-fyp-feed .expanded-meme {
  height: 100%;
  min-height: 100%;
}

#wall-list-view.is-fyp-home .empty-state {
  width: min(640px, calc(100% - 32px));
  margin: 24px auto;
}

.compact-grid {
  margin-top: 18px;
}

.wall-card {
  position: relative;
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  align-items: stretch;
  gap: 0;
  min-height: 68px;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--surface);
  box-shadow: 0 12px 28px rgba(31, 35, 40, 0.08);
}

.wall-card.is-openable {
  cursor: pointer;
}

.wall-card.is-openable:hover,
.wall-card.is-openable:focus-visible {
  box-shadow: 0 16px 34px rgba(31, 35, 40, 0.12);
  outline: none;
}

.wall-card-image,
.wall-avatar {
  display: grid;
  place-items: center;
  color: #fff;
  background-color: var(--accent);
  background-position: center;
  background-size: cover;
  font-weight: 900;
}

.wall-card-image {
  width: 58px;
  height: 58px;
  min-width: 0;
  max-width: none;
  margin: 5px;
  aspect-ratio: auto;
  overflow: hidden;
  border-radius: 5px;
  font-size: 1.35rem;
}

.wall-card h2 {
  height: auto;
  margin: 0;
  padding: 0;
  color: var(--ink);
  background: transparent;
  font-size: 1.15rem;
  line-height: 1.2;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wall-card-info {
  display: flex;
  min-width: 0;
  padding: 8px 12px;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.wall-card-subtitle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.2;
}

.wall-privacy-label {
  font-weight: 800;
}

.wall-privacy-label.is-private {
  color: #d97706;
}

.wall-privacy-label.is-public {
  color: #16803c;
}

.wall-privacy-label.is-secret {
  color: #7b4bb7;
}

.wall-card-title-text {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: top;
  white-space: nowrap;
  will-change: transform;
}

.wall-card h2.can-marquee.is-marquee-active .wall-card-title-text {
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  animation: wall-title-marquee var(--marquee-duration, 8s) ease-in-out infinite;
}

.wall-card h2.can-marquee.is-marquee-active.is-fast-marquee .wall-card-title-text {
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  animation: wall-title-marquee var(--marquee-fast-duration, 4s) ease-in-out 1;
}

@keyframes wall-title-marquee {
  0% {
    transform: translateX(0);
  }

  88%,
  94% {
    transform: translateX(var(--marquee-distance, 0));
  }

  100% {
    transform: translateX(0);
  }
}

.wall-view {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  padding: 0;
  overflow: hidden;
  background: #fff;
}

.upload-view,
.create-wall-view {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  padding: 0;
  overflow: hidden;
  background: var(--bg);
}

.create-wall-page-form {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0;
  width: min(420px, calc(100% - 28px));
  min-height: 0;
  margin: 0 auto;
  padding: 12px 0 28px;
  overflow-y: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  scrollbar-width: none;
}

.create-wall-page-form::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.create-wall-page-form #wall-name,
.create-wall-page-form .create-wall-image-picker {
  margin-bottom: 12px;
}

.create-wall-page-form #wall-name {
  text-align: center;
}

.create-wall-page-form #wall-name:focus::placeholder {
  color: transparent;
}

.create-wall-page-form > .primary-button {
  margin-top: auto;
}

.create-wall-page-form .create-wall-image-picker {
  flex: 0 0 auto;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  min-height: 0;
}

.create-wall-page-form .privacy-options {
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
}

.upload-toolbar {
  display: grid;
  grid-template-columns: minmax(44px, auto) minmax(0, 1fr) minmax(44px, auto);
  align-items: center;
  gap: 14px;
  flex: 0 0 auto;
  min-height: 76px;
  padding: 12px 14px;
  background: var(--bg);
}

.upload-project-title {
  justify-self: start;
  width: 100%;
  min-width: 0;
}

.upload-project-title button,
.upload-project-title input {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  color: var(--ink);
  background: transparent;
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1.08;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-project-title input {
  padding-bottom: 2px;
  border-bottom: 1px solid currentColor;
  outline: 0;
}

.upload-project-title button[aria-disabled="true"] {
  cursor: default;
}

.upload-toolbar.is-nav-root {
  grid-template-columns: minmax(0, 1fr) minmax(44px, auto);
}

.upload-toolbar.is-nav-root .upload-project-title {
  grid-column: 1;
}

.upload-toolbar.is-nav-root .upload-site-menu {
  grid-column: 2;
}

.upload-site-menu {
  justify-self: end;
}

.upload-page-form {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 10px;
  width: min(420px, calc(100% - 28px));
  min-height: 0;
  margin: 0 auto;
  padding: 10px 0 14px;
  overflow: hidden;
  scrollbar-width: none;
}

.upload-page-form::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.upload-page-form:has(.upload-drafts-step:not([hidden])) {
  width: 100%;
}

.upload-view.has-edge-preview {
  position: relative;
}

.upload-view.has-edge-preview .upload-toolbar {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 12;
  color: #fff;
  background: transparent;
  pointer-events: none;
}

.upload-view.has-edge-preview .upload-toolbar .upload-project-title,
.upload-view.has-edge-preview .upload-toolbar .icon-button,
.upload-view.has-edge-preview .upload-toolbar .upload-site-menu {
  pointer-events: auto;
}

.upload-view.has-edge-preview .upload-project-title button,
.upload-view.has-edge-preview .upload-project-title input {
  color: #fff;
  text-shadow: var(--overlay-text-shadow);
}

.upload-view.has-edge-preview .upload-toolbar .icon-button-image {
  filter: var(--overlay-drop-shadow);
}

.upload-view.has-edge-preview .upload-page-form,
.upload-view.has-project-edge-preview .upload-page-form {
  width: 100%;
  margin: 0;
  padding: 0 0 14px;
}

.upload-view.has-edge-preview:not(.is-preview-expanded) .upload-page-form {
  padding-top: 76px;
}

.upload-view.has-project-edge-preview .upload-image-step > :not(.timeline-preview),
.upload-view.has-clip-edge-preview .upload-clip-editor-step > :not(.clip-editor-preview-wrap) {
  width: min(420px, calc(100% - 28px));
  margin-inline: auto;
}

.upload-step {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

.upload-drafts-step {
  overflow: hidden;
}

.upload-drafts-step > .upload-create-draft {
  flex: 0 0 46px;
  width: calc(100% - 28px);
  margin-inline: auto;
}

.upload-draft-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: max-content;
  align-content: start;
  flex: 1 1 auto;
  gap: 0;
  min-height: 0;
  padding-bottom: 4px;
  overflow-y: auto;
  scrollbar-width: none;
}

.upload-draft-list::-webkit-scrollbar {
  display: none;
}

.upload-draft-card {
  position: relative;
  display: block;
  aspect-ratio: 1;
  width: 100%;
  min-width: 0;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  color: #fff;
  background: #222;
  text-align: left;
}

.upload-draft-card:hover,
.upload-draft-card:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}

.upload-draft-thumbnail {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.upload-draft-thumbnail-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #aaa;
  font-size: 0.72rem;
}

.upload-drafts-empty {
  margin: auto 0;
  color: var(--muted);
  text-align: center;
}

.upload-image-step {
  height: 100%;
  overflow: hidden;
}

.upload-image-step > .auth-error {
  flex: 0 0 auto;
  height: auto;
  overflow: hidden;
}

.upload-image-step > .auth-error:empty {
  display: none;
}

.upload-image-step > .upload-action-row {
  flex: 0 0 44px;
  height: 44px;
}

.upload-action-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  flex: 0 0 44px;
  height: 44px;
}

.upload-action-row button {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding-inline: 8px;
  font-size: 0.82rem;
  white-space: nowrap;
}

.secondary-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font-weight: 800;
}

.upload-success-step {
  justify-content: center;
  text-align: center;
}

.upload-success-step h2,
.upload-success-step p {
  margin: 0;
}

.upload-image-picker {
  --upload-preview-image: none;
  position: relative;
  display: grid;
  place-items: center;
  flex: 1 1 auto;
  width: 100%;
  min-height: 240px;
  contain: layout paint;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
  cursor: pointer;
}

.upload-image-picker.has-preview {
  background: #000;
}

.upload-image-picker.has-preview::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image: var(--upload-preview-image);
  background-position: center;
  background-size: cover;
  filter: blur(22px);
  transform: scale(1.12);
}

.upload-image-picker.has-preview::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background-image: var(--upload-preview-image);
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

.upload-image-picker input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.upload-image-picker.has-preview .upload-image-prompt {
  display: none;
}

.upload-image-picker.has-video-preview {
  background: #000;
}

.upload-image-picker.has-video-preview .upload-image-prompt {
  display: none;
}

.generate-video-preview {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: auto;
}

.generate-audio-preview {
  width: 100%;
  min-height: 44px;
}

.upload-audio-picker {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
  cursor: pointer;
}

.upload-audio-picker input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.upload-audio-picker span {
  width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  white-space: nowrap;
}

.timeline-preview {
  flex: 1 1 auto;
  width: 100%;
  min-height: 84px;
  margin-block: 0;
}

.timeline-preview-wrap {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.timeline-preview-stage {
  position: relative;
  display: grid;
  place-items: center;
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  overflow: hidden;
  border-radius: 0;
  color: var(--muted);
  background: #000;
}

.timeline-preview-stage.is-empty {
  border-radius: 0;
}

.timeline-preview-stage img,
.timeline-preview-stage video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.timeline-preview-stage > #timeline-preview-empty {
  position: relative;
  z-index: 2;
}

.timeline-preview-stage > .timeline-preview-backdrop {
  z-index: 0;
  display: none;
  object-fit: cover;
  filter: blur(24px);
  transform: scale(1.12);
}

.app-shell[data-meme-background="blurred"] .timeline-preview-stage > .timeline-preview-backdrop:not([hidden]) {
  display: block;
}

.timeline-preview-stage > #timeline-preview-image,
.timeline-preview-stage > #timeline-preview-video {
  z-index: 1;
}

.timeline-preview-size-button {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 7;
  display: grid;
  place-items: center;
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 5px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.timeline-preview-size-button img {
  position: static;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.75));
  pointer-events: none;
}

.timeline-preview-size-button:hover,
.timeline-preview-size-button:focus-visible,
.timeline-preview-size-button:active {
  background: transparent;
}

.upload-view.is-preview-expanded {
  position: relative;
  background: #000;
}

.upload-view.is-preview-expanded .upload-toolbar {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 12;
  color: #fff;
  background: transparent;
  pointer-events: none;
}

.upload-view.is-preview-expanded .upload-project-title button,
.upload-view.is-preview-expanded .upload-project-title input {
  color: #fff;
  text-shadow: var(--overlay-text-shadow);
}

.upload-view.is-preview-expanded .upload-toolbar .upload-site-menu,
.upload-view.is-preview-expanded .upload-toolbar .icon-button,
.upload-view.is-preview-expanded .upload-project-title {
  pointer-events: auto;
}

.upload-view.is-preview-expanded #upload-back-button {
  visibility: hidden;
  pointer-events: none;
}

.upload-view.is-preview-expanded #upload-menu-button .icon-button-image {
  filter: brightness(0) invert(1) var(--overlay-drop-shadow);
}

.upload-view.is-preview-expanded .upload-page-form {
  width: 100%;
  margin: 0;
  padding: 0;
}

.upload-view.is-preview-expanded .upload-image-step {
  position: relative;
  gap: 0;
}

.upload-view.is-preview-expanded .upload-image-step > :not(.timeline-preview) {
  display: none !important;
}

.upload-view.is-preview-expanded .timeline-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.upload-view.is-preview-expanded .timeline-preview-stage {
  width: 100%;
  height: 100%;
  border-radius: 0;
}

.upload-view.is-preview-expanded .timeline-preview-seek {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 8;
}

.upload-view.is-preview-expanded .timeline-preview-size-button {
  right: 12px;
  bottom: 16px;
}

.timeline-play-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font-weight: 800;
}

.timeline-play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 58px;
  min-height: 58px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: transparent;
  box-shadow: none;
  transform: translate(-50%, -50%);
  font-size: 1.45rem;
}

.timeline-play-button img {
  position: static;
  inset: auto;
  display: block;
  width: 28px;
  height: 28px;
  object-fit: contain;
  pointer-events: none;
}

.timeline-preview-seek {
  --timeline-progress: 0%;
  position: static;
  flex: 0 0 8px;
  width: 100%;
  height: 8px;
  margin: 0;
  z-index: 6;
  appearance: none;
  background: transparent;
  accent-color: var(--accent);
}

.timeline-preview-seek::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 0;
  background: linear-gradient(
    to right,
    var(--accent) 0 var(--timeline-progress),
    #9a9a9a var(--timeline-progress) 100%
  );
}

.timeline-preview-seek::-webkit-slider-thumb {
  width: 4px;
  height: 18px;
  margin-top: -5px;
  border: 0;
  border-radius: 2px;
  appearance: none;
  background: var(--accent);
  opacity: 1;
}

.timeline-preview-seek::-moz-range-track {
  height: 8px;
  border: 0;
  border-radius: 0;
  background: #9a9a9a;
}

.timeline-preview-seek::-moz-range-progress {
  height: 8px;
  border-radius: 0;
  background: var(--accent);
}

.timeline-preview-seek::-moz-range-thumb {
  width: 4px;
  height: 18px;
  border: 0;
  border-radius: 2px;
  background: var(--accent);
  opacity: 1;
}

.timeline-preview-seek:hover::-webkit-slider-thumb,
.timeline-preview-seek:active::-webkit-slider-thumb,
.timeline-preview-seek:focus-visible::-webkit-slider-thumb {
  opacity: 1;
}

.timeline-preview-seek:hover::-moz-range-thumb,
.timeline-preview-seek:active::-moz-range-thumb,
.timeline-preview-seek:focus-visible::-moz-range-thumb {
  opacity: 1;
}

.upload-view.is-preview-expanded .timeline-preview-seek::-webkit-slider-runnable-track {
  border-radius: 0;
}

.upload-view.is-preview-expanded .timeline-preview-seek::-moz-range-track {
  border-radius: 0;
}

.upload-view.is-preview-expanded .timeline-preview-seek::-moz-range-progress {
  border-radius: 0;
}

.timeline-channel {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  min-width: 0;
}

.timeline-channel > header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.timeline-channel h2,
.timeline-channel header span {
  margin: 0;
}

.timeline-channel h2 {
  font-size: 0.98rem;
}

.timeline-channel header span {
  color: var(--muted);
  font-size: 0.76rem;
}

.timeline-channel-strip {
  display: flex;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f7f7f7;
}

.timeline-channel-strip > .timeline-clip-track {
  flex: 1 1 auto;
  width: 0;
  border: 0;
  border-radius: 0;
}

.visual-channel-strip {
  height: 102px;
}

.audio-channel-strip {
  height: 52px;
}

.timeline-clip-track {
  display: flex;
  gap: 8px;
  width: 100%;
  min-height: 72px;
  padding: 7px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f7f7f7;
  scroll-padding-inline: 7px;
  scrollbar-width: none;
  cursor: grab;
}

.timeline-clip-track::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.timeline-clip-track.is-mouse-scrolling {
  cursor: grabbing;
}

.visual-clip-track {
  height: 102px;
  min-height: 102px;
}

.audio-clip-track {
  height: 52px;
  min-height: 52px;
  padding: 5px;
  scroll-padding-inline: 5px;
}

.timeline-clip {
  position: relative;
  display: grid;
  flex: 0 0 92px;
  align-content: end;
  min-width: 0;
  min-height: 86px;
  padding: 6px;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 8px;
  color: #fff;
  background: #222;
  cursor: pointer;
  user-select: none;
  touch-action: pan-x;
}

.timeline-clip-track.is-empty {
  overflow: hidden;
}

.timeline-channel-empty {
  display: grid;
  place-items: center;
  align-self: stretch;
  flex: 1 0 100%;
  min-width: 100%;
  padding: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  pointer-events: none;
}

.timeline-reorder-arrow {
  position: absolute;
  bottom: -13px;
  display: grid;
  place-items: center;
  width: 28px;
  min-width: 28px;
  height: 26px;
  min-height: 26px;
  padding: 0;
  border: 0;
  background: transparent;
  transform: translateX(-50%);
  pointer-events: auto;
}

.timeline-reorder-arrow img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.timeline-reorder-actions {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
}

.timeline-reorder-actions[hidden] {
  display: none;
}

.timeline-reorder-shade {
  position: fixed !important;
  inset: 0;
  z-index: 10000;
  width: 100vw;
  height: 100dvh;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.visual-channel.is-reorder-target {
  position: relative;
  z-index: 10001;
}

.timeline-reorder-floating {
  position: fixed !important;
  z-index: 10002;
  margin: 0;
  pointer-events: none;
  transform: translateX(-50%);
  transition: left 240ms ease, top 240ms ease;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.25);
}

.timeline-reorder-arriving {
  visibility: hidden;
}

.visual-clip-thumbnail {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.timeline-clip::after {
  content: "";
  position: absolute;
  inset: 35% 0 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.86));
  pointer-events: none;
}

.timeline-clip-name,
.timeline-clip-time {
  position: relative;
  z-index: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-clip-name {
  display: none;
  font-size: 0.72rem;
  font-weight: 800;
}

.timeline-reorder-floating .timeline-clip-name,
.audio-clip .timeline-clip-name {
  display: block;
}

.timeline-reorder-floating .timeline-clip-name {
  position: absolute;
  top: 6px;
  right: 6px;
  left: 6px;
}

.timeline-clip-time {
  font-size: 0.64rem;
  opacity: 0.84;
}

.audio-clip {
  flex-basis: clamp(102px, calc(30% - 15px), 138px);
  min-height: 40px;
  align-content: center;
  color: var(--ink);
  background: #e8e8e8;
}

.audio-clip::after {
  display: none;
}

.upload-clip-editor-step {
  height: 100%;
  overflow: hidden;
}

.upload-view.is-clip-editor-overlay .upload-clip-editor-step {
  position: absolute;
  inset: 0;
  z-index: 10;
  height: auto;
  padding-top: 76px;
  padding-bottom: 14px;
  background: rgba(0, 0, 0, 0.82);
  transition: background-color 280ms ease;
}

.upload-view.is-clip-editor-overlay.is-clip-editor-overlay-entering .upload-clip-editor-step {
  background: rgba(0, 0, 0, 0);
}

.upload-view.is-clip-editor-overlay.is-clip-editor-overlay-closing .upload-clip-editor-step {
  background: rgba(0, 0, 0, 0);
}

.upload-view.is-clip-editor-overlay .upload-clip-editor-step > :not(.clip-editor-preview-wrap) {
  opacity: 1;
  transition: opacity 220ms ease 80ms;
}

.upload-view.is-clip-editor-overlay.is-clip-editor-overlay-entering .upload-clip-editor-step > :not(.clip-editor-preview-wrap),
.upload-view.is-clip-editor-overlay.is-clip-editor-overlay-closing .upload-clip-editor-step > :not(.clip-editor-preview-wrap),
.upload-view.is-clip-editor-overlay.is-clip-editor-overlay-closing .clip-editor-preview-wrap,
.upload-view.is-clip-editor-overlay.is-clip-editor-overlay-animating .clip-editor-preview-wrap.is-audio {
  opacity: 0;
}

.upload-view.is-clip-editor-overlay .clip-editor-preview-wrap {
  width: min(402px, calc(100% - 28px));
  margin-inline: auto;
  opacity: 1;
  transition: opacity 120ms ease;
}

.upload-view.is-clip-editor-overlay .clip-editor-preview-seek {
  transition: opacity 120ms ease;
}

.upload-view.is-clip-editor-overlay.is-clip-editor-overlay-animating .clip-editor-preview-seek {
  opacity: 0;
}

.upload-view.is-clip-editor-overlay:not(.is-clip-preview-expanded) .clip-editor-preview-wrap:not(.is-audio) {
  gap: 10px;
}

.upload-view.is-clip-editor-overlay .clip-editor-preview:not(.is-audio) {
  border-radius: 12px;
}

.upload-view.is-clip-editor-overlay:not(.is-clip-preview-expanded) .clip-editor-preview-seek:not([hidden]) {
  border-radius: 12px;
}

.upload-view.is-clip-editor-overlay:not(.is-clip-preview-expanded) .clip-editor-preview-seek::-webkit-slider-runnable-track {
  border-radius: 12px;
}

.upload-view.is-clip-editor-overlay:not(.is-clip-preview-expanded) .clip-editor-preview-seek::-moz-range-track,
.upload-view.is-clip-editor-overlay:not(.is-clip-preview-expanded) .clip-editor-preview-seek::-moz-range-progress {
  border-radius: 12px;
}

.upload-view.is-clip-editor-overlay .clip-editor-fields label {
  color: #fff;
  text-shadow: var(--overlay-text-shadow);
}

.upload-view.is-clip-editor-overlay #timeline-preview-play,
.upload-view.is-clip-editor-overlay #timeline-preview-expand,
.upload-view.is-clip-editor-overlay #timeline-preview-minimize {
  opacity: 0;
}

.upload-view.is-clip-editor-overlay.is-clip-editor-project-returning #timeline-preview-play {
  z-index: 12;
  opacity: 1;
}

.upload-view.is-clip-editor-overlay.is-clip-editor-project-returning .upload-project-title button,
.upload-view.is-clip-editor-overlay.is-clip-editor-project-returning .upload-project-title input {
  color: var(--ink);
  text-shadow: none;
}

.upload-view.is-clip-editor-overlay.is-clip-editor-project-returning .upload-toolbar .icon-button-image {
  filter: none;
}

.upload-view:not(.is-preview-expanded) #timeline-preview-seek {
  width: 100%;
  margin: 10px auto 0;
  border-radius: 8px;
}

.upload-view:not(.is-preview-expanded) #timeline-preview-seek::-webkit-slider-runnable-track {
  border-radius: 8px;
}

.upload-view:not(.is-preview-expanded) #timeline-preview-seek::-moz-range-track,
.upload-view:not(.is-preview-expanded) #timeline-preview-seek::-moz-range-progress {
  border-radius: 8px;
}

.upload-view.has-project-edge-preview:not(.is-preview-expanded) .timeline-preview {
  width: min(420px, calc(100% - 28px));
  margin-inline: auto;
}

.upload-view.has-project-edge-preview:not(.is-preview-expanded) .timeline-preview-stage {
  border-radius: 8px;
}

.timeline-clip.is-opening-clip-editor-source {
  opacity: 0;
}

.clip-editor-opening-ghost {
  position: fixed;
  z-index: 11;
  min-width: 0;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  border-radius: 8px;
  background: #000;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  transition:
    top 340ms cubic-bezier(0.22, 1, 0.36, 1),
    left 340ms cubic-bezier(0.22, 1, 0.36, 1),
    width 340ms cubic-bezier(0.22, 1, 0.36, 1),
    height 340ms cubic-bezier(0.22, 1, 0.36, 1),
    border-radius 340ms cubic-bezier(0.22, 1, 0.36, 1);
}

.clip-editor-opening-ghost::after,
.clip-editor-opening-ghost .timeline-clip-name,
.clip-editor-opening-ghost .timeline-clip-time {
  display: none;
}

.clip-editor-opening-ghost .visual-clip-thumbnail {
  object-fit: contain;
}

@media (prefers-reduced-motion: reduce) {
  .upload-view.is-clip-editor-overlay .upload-clip-editor-step,
  .upload-view.is-clip-editor-overlay .upload-clip-editor-step > :not(.clip-editor-preview-wrap),
  .upload-view.is-clip-editor-overlay .clip-editor-preview-wrap,
  .clip-editor-opening-ghost {
    transition: none;
  }
}

.clip-editor-preview-wrap {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 0;
  min-height: 120px;
}

.clip-editor-preview-seek.has-cuts::-webkit-slider-runnable-track {
  background: var(--clip-track-background);
}

.clip-editor-preview-seek.has-cuts::-moz-range-track {
  background: var(--clip-track-background);
}

.clip-editor-preview-seek.has-cuts::-moz-range-progress {
  background: transparent;
}

.clip-editor-preview-wrap.is-audio {
  position: relative;
  display: flex;
  flex: 0 0 38px;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  min-height: 38px;
}

.clip-editor-preview-wrap.is-audio::before {
  content: "";
  position: absolute;
  top: 50%;
  right: 0;
  left: 42px;
  height: 8px;
  border-radius: 999px;
  background: #9a9a9a;
  transform: translateY(-50%);
}

.clip-editor-preview-wrap.is-audio .clip-editor-preview-seek {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  width: auto;
}

.clip-edit-time-markers {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 9;
  height: 8px;
  pointer-events: none;
}

.clip-editor-preview-wrap.is-audio .clip-edit-time-markers {
  top: 50%;
  right: 0;
  bottom: auto;
  left: 42px;
  transform: translateY(-50%);
}

.clip-edit-time-marker {
  position: absolute;
  top: 50%;
  width: 5px;
  height: 22px;
  min-height: 22px;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: #f59e0b;
  box-shadow: 0 0 0 1px rgb(0 0 0 / 25%);
  transform: translate(-50%, -50%);
  cursor: ew-resize;
  pointer-events: auto;
  touch-action: none;
}

.clip-edit-time-marker.is-transition-end {
  background: #fb923c;
}

.clip-editor-preview-wrap.is-audio .clip-editor-preview-seek::-webkit-slider-runnable-track {
  border-radius: 8px;
  background: linear-gradient(
    to right,
    var(--accent) 0 var(--timeline-progress),
    transparent var(--timeline-progress) 100%
  );
}

.clip-editor-preview-wrap.is-audio .clip-editor-preview-seek::-moz-range-track {
  border-radius: 8px;
  background: transparent;
}

.clip-editor-preview-wrap.is-audio .clip-editor-preview-seek::-moz-range-progress {
  border-radius: 8px;
  background: var(--accent);
}

.upload-view.is-clip-editor-overlay .clip-editor-preview-wrap.is-audio .clip-editor-preview-seek {
  border-radius: 999px;
  background: transparent;
}

.upload-view.is-clip-editor-overlay .clip-editor-preview-wrap.is-audio .clip-editor-preview-seek::-webkit-slider-runnable-track,
.upload-view.is-clip-editor-overlay .clip-editor-preview-wrap.is-audio .clip-editor-preview-seek::-moz-range-track,
.upload-view.is-clip-editor-overlay .clip-editor-preview-wrap.is-audio .clip-editor-preview-seek::-moz-range-progress {
  border-radius: 999px !important;
  clip-path: inset(0 round 999px);
}

.upload-view.is-clip-editor-overlay .upload-clip-editor-step:has(.clip-editor-preview-wrap.is-audio) {
  justify-content: flex-end;
}

.upload-view.is-clip-editor-overlay .upload-clip-editor-step:has(.clip-editor-preview-wrap.is-audio) .clip-editor-actions {
  margin-top: 0;
}

.clip-editor-preview-wrap.is-audio .clip-editor-preview-seek.has-cuts::-webkit-slider-runnable-track,
.clip-editor-preview-wrap.is-audio .clip-editor-preview-seek.has-cuts::-moz-range-track {
  background: var(--clip-track-background);
}

.clip-editor-preview-wrap.is-audio .clip-editor-preview-seek.has-cuts::-moz-range-progress {
  background: transparent;
}

.clip-editor-preview-wrap.is-audio .clip-editor-preview-seek::-webkit-slider-runnable-track,
.clip-editor-preview-wrap.is-audio .clip-editor-preview-seek::-moz-range-track {
  background-color: transparent;
}

.clip-editor-audio-play {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
}

.clip-editor-audio-play img {
  display: block;
  width: 22px;
  height: 22px;
  filter: brightness(0) invert(1) var(--overlay-drop-shadow);
  object-fit: contain;
  pointer-events: none;
}

.clip-editor-preview {
  position: relative;
  display: grid;
  place-items: center;
  flex: 1 1 auto;
  min-height: 120px;
  overflow: hidden;
  border-radius: 0;
  background: #000;
}

.clip-editor-preview.is-audio {
  flex: 1 1 auto;
  min-height: 82px;
  padding: 12px;
  border-radius: 8px;
}

.clip-edit-channel {
  flex: 0 0 77px;
  height: 77px;
  min-height: 77px;
}

.clip-edit-strip {
  height: 77px;
}

.clip-edit-track {
  height: 77px;
  min-height: 77px;
  padding: 5px;
}

.clip-edit-card {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 65px;
  width: 65px;
  height: 65px;
  min-width: 65px;
  min-height: 65px;
  padding: 5px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.clip-edit-card > img {
  width: 29px;
  height: 29px;
  object-fit: contain;
  transform: translateY(-6px);
}

.clip-edit-time {
  position: absolute;
  right: 3px;
  bottom: 3px;
  left: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.55rem;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clip-cut-editor,
.clip-volume-editor,
.clip-crop-editor {
  --clip-cut-control-size: 44px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 6px;
  width: 100%;
  height: 77px;
  min-height: 77px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f7f7f7;
}

.clip-volume-editor {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.clip-crop-editor {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 3px;
}

.upload-page-form .clip-crop-editor .clip-cut-field {
  font-size: 0.56rem;
}

.upload-page-form .clip-crop-editor .clip-cut-field input {
  padding-inline: 4px;
  font-size: 0.67rem;
}

.clip-cut-field {
  display: grid;
  min-width: 0;
  gap: 3px;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 800;
}

.upload-page-form .clip-cut-field input {
  width: 100%;
  height: var(--clip-cut-control-size);
  min-width: 0;
  min-height: var(--clip-cut-control-size);
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: 0.8rem;
}

.upload-page-form .clip-volume-editor input[type="number"],
.upload-page-form .clip-crop-editor input[type="number"] {
  appearance: textfield;
}

.upload-page-form .clip-volume-editor input[type="number"]::-webkit-inner-spin-button,
.upload-page-form .clip-volume-editor input[type="number"]::-webkit-outer-spin-button,
.upload-page-form .clip-crop-editor input[type="number"]::-webkit-inner-spin-button,
.upload-page-form .clip-crop-editor input[type="number"]::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
}

.clip-editor-visual,
.clip-editor-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.clip-editor-backdrop {
  z-index: 0;
  display: none;
  object-fit: cover;
  filter: blur(24px);
  transform: scale(1.12);
}

.app-shell[data-meme-background="blurred"] .clip-editor-backdrop:not([hidden]) {
  display: block;
}

.clip-editor-visual {
  z-index: 1;
}

.clip-crop-overlay {
  position: absolute;
  z-index: 4;
  touch-action: none;
  pointer-events: none;
}

.clip-crop-box {
  position: absolute;
  box-sizing: border-box;
  border: 2px solid #fff;
  box-shadow: 0 0 0 9999px rgb(0 0 0 / 52%);
  pointer-events: none;
}

.clip-crop-handle {
  position: absolute;
  display: block;
  pointer-events: auto;
  touch-action: none;
}

.clip-crop-handle.is-top,
.clip-crop-handle.is-bottom {
  right: 12px;
  left: 12px;
  height: 20px;
  cursor: ns-resize;
}

.clip-crop-handle.is-top { top: -11px; }
.clip-crop-handle.is-bottom { bottom: -11px; }

.clip-crop-handle.is-left,
.clip-crop-handle.is-right {
  top: 12px;
  bottom: 12px;
  width: 20px;
  cursor: ew-resize;
}

.clip-crop-handle.is-left { left: -11px; }
.clip-crop-handle.is-right { right: -11px; }

.clip-crop-handle.is-top-left,
.clip-crop-handle.is-top-right,
.clip-crop-handle.is-bottom-right,
.clip-crop-handle.is-bottom-left {
  width: 22px;
  height: 22px;
}

.clip-crop-handle.is-top-left { top: -11px; left: -11px; cursor: nwse-resize; }
.clip-crop-handle.is-top-right { top: -11px; right: -11px; cursor: nesw-resize; }
.clip-crop-handle.is-bottom-right { right: -11px; bottom: -11px; cursor: nwse-resize; }
.clip-crop-handle.is-bottom-left { bottom: -11px; left: -11px; cursor: nesw-resize; }

.clip-crop-handle::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  border: 2px solid #111;
  border-radius: 2px;
  background: #fff;
  content: "";
  transform: translate(-50%, -50%);
}

.clip-crop-handle.is-top::after,
.clip-crop-handle.is-bottom::after { width: 20px; height: 6px; }
.clip-crop-handle.is-left::after,
.clip-crop-handle.is-right::after { width: 6px; height: 20px; }

.clip-editor-preview audio {
  position: relative;
  z-index: 1;
  width: 100%;
}

.clip-editor-fields {
  display: grid;
  grid-template-columns: minmax(112px, auto) minmax(0, 1fr);
  align-items: center;
  flex: 0 1 auto;
  gap: 7px 10px;
  min-height: 0;
  overflow-y: auto;
}

.clip-editor-fields:not(:has(> :not([hidden]))) {
  display: none;
}

.clip-editor-fields label,
.clip-editor-fields input {
  margin: 0;
}

.clip-editor-fields input {
  width: 100%;
}

.clip-editor-trim-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-column: 1 / -1;
  gap: 10px;
}

.clip-editor-trim-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.clip-editor-trim-field input {
  width: 100%;
}

.upload-clip-editor-step > .auth-error {
  flex: 0 0 auto;
  margin: 0;
}

.upload-clip-editor-step > .auth-error:empty {
  display: none;
}

.upload-editor-actions,
.clip-editor-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: auto;
}

.clip-editor-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.clip-editor-actions.is-trim-editing {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#delete-clip-editor,
#delete-clip-edit {
  color: #c62828;
}

.bottom-add-button img {
  display: block;
  width: 22px;
  height: 22px;
  margin: 0 auto;
  object-fit: contain;
  pointer-events: none;
}

#upload-add-channel.is-empty-project {
  position: relative;
  z-index: 21;
  transform-origin: center;
  animation: empty-project-add-pulse 1.35s ease-in-out infinite;
}

.upload-view:has(#upload-add-channel.is-empty-project),
.upload-page-form:has(#upload-add-channel.is-empty-project),
.upload-image-step:has(#upload-add-channel.is-empty-project) {
  overflow: visible;
}

@keyframes empty-project-add-pulse {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.08);
  }
}

@media (prefers-reduced-motion: reduce) {
  #upload-add-channel.is-empty-project {
    animation: none;
  }
}

.upload-view.is-clip-preview-expanded .upload-clip-editor-step {
  position: absolute;
  inset: 0;
  gap: 0;
  padding: 0;
}

.clip-crop-handle.is-center {
  top: 50%;
  left: 50%;
  width: 32px;
  height: 32px;
  transform: translate(-50%, -50%);
  cursor: move;
}

.clip-crop-handle.is-center::after {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.upload-view.is-clip-preview-expanded .upload-clip-editor-step > :not(.clip-editor-preview-wrap) {
  display: none !important;
}

.upload-view.is-clip-preview-expanded .clip-editor-preview-wrap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.upload-view.is-clip-preview-expanded .clip-editor-preview {
  width: 100%;
  height: 100%;
  border-radius: 0;
}

.clip-delete-confirm-card {
  gap: 12px;
}

.clip-delete-confirm-card h2,
.clip-delete-confirm-card p {
  margin: 0;
}

.export-card {
  gap: 12px;
}

.export-card h2,
.export-card p {
  margin: 0;
}

.export-status {
  min-height: 20px;
  color: var(--muted);
  font-size: 0.9rem;
}

.export-status.is-error {
  color: #b44545;
}

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

.media-source-card {
  gap: 14px;
}

.publish-card {
  gap: 14px;
}

.publish-card > h2,
.publish-card > p {
  margin: 0;
}

.publish-card > p:not(.auth-error) {
  color: var(--muted);
  text-align: center;
}

.publish-card > .auth-error:empty {
  display: none;
}

.publish-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.media-source-card > .auth-error:empty {
  display: none;
}

.media-source-choices {
  display: grid;
  gap: 10px;
}

.clip-edit-type-card {
  gap: 14px;
}

.clip-edit-type-options {
  display: grid;
  gap: 10px;
}

.clip-edit-type-card > .media-link-help {
  padding: 8px 0;
  text-align: center;
}

.media-link-form {
  display: grid;
  gap: 10px;
}

.media-link-help {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.4;
}

.media-link-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.media-import-loading::backdrop {
  background: rgba(31, 35, 40, 0.42);
}

.media-import-loading {
  width: min(330px, calc(100vw - 32px));
  max-width: none;
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: transparent;
}

.media-import-loading-card {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 28px 22px;
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
  text-align: center;
}

.media-import-loading-card h2,
.media-import-loading-card p {
  margin: 0;
}

.media-import-loading-card p {
  color: var(--muted);
}

.media-import-spinner {
  width: 36px;
  height: 36px;
  border: 4px solid #d9e7eb;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: media-import-spin 750ms linear infinite;
}

@keyframes media-import-spin {
  to { transform: rotate(360deg); }
}

.upload-image-prompt {
  position: relative;
  z-index: 3;
  font-size: 1rem;
  font-weight: 900;
}

.upload-page-form select,
.upload-page-form input:not([type="checkbox"]):not([type="file"]) {
  min-width: 0;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.upload-page-form input.timeline-preview-seek[type="range"] {
  min-height: 8px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.upload-page-form label {
  font-size: 0.9rem;
  font-weight: 800;
}

.upload-page-form.is-edit-keyboard-active {
  overflow-y: auto;
  overscroll-behavior-y: contain;
}

.upload-page-form.is-edit-keyboard-active .upload-clip-editor-step {
  flex: 0 0 auto;
  min-height: 100%;
  padding-bottom: var(--edit-keyboard-inset, 0px);
  overflow: visible;
}

.wall-toolbar {
  display: grid;
  grid-template-columns: minmax(44px, auto) minmax(0, 1fr) minmax(44px, auto);
  align-items: center;
  gap: 14px;
  flex: 0 0 auto;
  z-index: 2;
  min-height: 76px;
  padding: 12px 14px;
  border-bottom: 1px solid #ececec;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
}

#back-button {
  grid-column: 1;
  justify-self: start;
}

.wall-avatar {
  display: none;
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 8px;
}

.wall-heading {
  min-width: 0;
  grid-column: 2;
  justify-self: start;
  width: auto;
  max-width: 100%;
}

.wall-profile-trigger {
  border: 0;
  text-align: left;
}

.wall-profile-trigger.is-static-profile {
  cursor: default;
}

.wall-heading.wall-profile-trigger {
  display: block;
  min-height: 44px;
  padding: 0 4px;
  color: inherit;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.wall-heading h1 {
  margin: 0;
  max-width: 100%;
  font-size: 1.75rem;
  line-height: 1.08;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wall-toolbar-actions {
  grid-column: 3;
  justify-self: end;
  justify-content: end;
  gap: 6px;
}

.wall-toolbar.is-own-profile-root {
  grid-template-columns: minmax(0, 1fr) minmax(44px, auto);
}

.wall-toolbar.is-own-profile-root .wall-heading {
  grid-column: 1;
}

.wall-toolbar.is-own-profile-root .wall-toolbar-actions {
  grid-column: 2;
}

.wall-action-button {
  width: auto;
  min-width: 64px;
  padding-inline: 10px;
  font-size: 0.9rem;
}

.wall-menu {
  position: relative;
}

.wall-menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 5;
  display: grid;
  min-width: 176px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.wall-menu-panel button {
  min-height: 40px;
  padding: 0 12px;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.wall-menu-panel button:hover,
.wall-menu-panel button:focus-visible {
  background: #f2eee7;
  outline: none;
}

.wall-menu-option.is-selected {
  color: var(--accent);
  background: #edf6f5;
  font-weight: 900;
}

.upload-button input,
.ghost-upload input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.meme-wall {
  --meme-column-count: 3;
  --meme-tile-size: 1px;
  display: grid;
  grid-template-columns: repeat(var(--meme-column-count), minmax(0, 1fr));
  grid-auto-rows: var(--meme-tile-size);
  align-content: start;
  gap: 0;
  width: 100%;
  margin: 0 auto;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0;
  background: #f4f1eb;
  scrollbar-width: none;
}

.meme-wall::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.meme-wall.is-expanded {
  display: block;
  overflow: hidden;
}

.wall-view:has(.meme-wall.is-expanded) .wall-toolbar {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  border-bottom: 0;
  background: transparent;
  backdrop-filter: none;
}

.wall-view:has(.meme-wall.is-expanded) .meme-wall {
  height: 100%;
}

.wall-view:has(.meme-wall.is-expanded) .wall-heading h1 {
  overflow: hidden;
  color: #fff;
  filter: var(--overlay-drop-shadow);
  text-overflow: ellipsis;
  text-shadow: none;
  white-space: nowrap;
}

.wall-view:has(.meme-wall.is-expanded) #back-button,
.wall-view:has(.meme-wall.is-expanded) #wall-menu-button {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 10px 24px rgba(31, 35, 40, 0.09);
}

.wall-view:has(.meme-wall.is-expanded) #wall-menu-button {
  color: #fff;
  background: transparent;
  box-shadow: none;
}

.wall-view:has(.meme-wall.is-expanded) #back-button {
  color: #fff;
  background: transparent;
  box-shadow: none;
}

.meme-card {
  position: relative;
  display: block;
  width: 100%;
  height: var(--meme-tile-size);
  min-width: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
  -webkit-touch-callout: none;
  cursor: pointer;
}

.meme-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  pointer-events: none;
  transition: background 140ms ease;
}

.meme-card:hover::after,
.meme-card:focus-visible::after {
  background: rgba(0, 0, 0, 0.18);
}

.meme-card:focus-visible {
  outline: none;
}

.meme-image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #f8f8f8;
  -webkit-user-drag: none;
  user-select: none;
  pointer-events: none;
}

.upload-tile {
  display: grid;
  place-content: center;
  gap: 10px;
  color: var(--accent);
  background: rgba(255, 255, 255, 0.72);
  font-weight: 900;
}

.upload-tile:hover,
.upload-tile:focus-visible {
  background: rgba(255, 255, 255, 0.92);
  outline: 2px solid rgba(23, 107, 135, 0.42);
  outline-offset: -2px;
}

.upload-tile-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin: 0 auto;
  border: 2px solid currentColor;
  border-radius: 50%;
  font-size: 2rem;
  line-height: 1;
}

.expanded-meme {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  background: #f4f1eb;
}

.fyp-start-gate {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  color: #fff;
  background: #000;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.fyp-start-gate:active {
  cursor: grabbing;
}

.fyp-start-slide {
  background: #000;
}

.fyp-start-content {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  color: #fff;
  text-align: center;
  pointer-events: none;
}

.fyp-start-content p {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.25;
  text-shadow: var(--overlay-text-shadow);
}

.fyp-start-arrow {
  font-size: 2.15rem;
  font-weight: 500;
  line-height: 1;
  text-shadow: var(--overlay-text-shadow);
}

.viewer-uploader.expanded-uploader {
  color: #fff;
  font-size: 1.5rem;
  font-weight: 900;
  display: block;
  filter: var(--overlay-drop-shadow);
}

.expanded-image-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  touch-action: none;
}

.expanded-track {
  position: relative;
  width: 100%;
  height: 100%;
  transform: translateY(0);
}

.expanded-track.is-settling {
  transition: transform 180ms ease-out;
}

.expanded-track.is-previewing {
  transition: transform 140ms ease-out;
}

.expanded-slide {
  background: #000;
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
  padding: 16px 0;
  align-content: stretch;
  place-items: stretch center;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  pointer-events: none;
}

.expanded-slide-image-space {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  width: 100%;
  max-width: none;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-radius: 0;
}

.expanded-image-backdrop {
  position: absolute;
  inset: -24px;
  display: none;
  z-index: 0;
  width: calc(100% + 48px);
  height: calc(100% + 48px);
  object-fit: cover;
  filter: blur(22px);
  opacity: 1;
  transform: scale(1.04);
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.expanded-uploader,
.expanded-reactions {
  position: relative;
  z-index: 2;
}

.expanded-uploader {
  position: absolute;
  right: 70px;
  bottom: calc(6px + env(safe-area-inset-bottom, 0px));
  left: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.expanded-uploader-button {
  z-index: 4;
  width: auto;
  max-width: none;
  min-height: 44px;
  padding: 0 8px;
  border: 0;
  border-radius: 0;
  background: rgba(0, 0, 0, 0.01);
  box-shadow: none;
  text-align: left;
  touch-action: manipulation;
}

.expanded-uploader-button:hover,
.expanded-uploader-button:active {
  background: rgba(0, 0, 0, 0.08);
}

.expanded-video-backdrop {
  background: #000;
  filter: blur(22px);
  opacity: 1;
}

.expanded-slide audio {
  display: none;
}

.expanded-slide-image-space {
  z-index: 1;
}

.media-playback-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  padding: 0;
  border: 0;
  opacity: 0;
  color: #fff;
  background: transparent;
  box-shadow: none;
  font-size: 1.9rem;
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.72);
}

.media-playback-indicator.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  transition: opacity 140ms ease, transform 140ms ease;
}

.media-playback-indicator img {
  display: block;
  width: 36px;
  height: 36px;
  object-fit: contain;
  pointer-events: none;
}

.expanded-reactions {
  position: absolute;
  top: auto;
  right: 6px;
  bottom: calc(6px + env(safe-area-inset-bottom, 0px));
  left: auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  width: 44px;
  transform: none;
}

.expanded-slide-previous {
  z-index: 1;
  transform: translateY(-100%);
}

.expanded-slide-current {
  z-index: 2;
  transform: translateY(0);
  pointer-events: auto;
}

.expanded-slide-current .expanded-uploader,
.expanded-slide-current .expanded-slide-image-space,
.expanded-slide-current .expanded-reactions {
  pointer-events: auto;
}

.expanded-slide-current .expanded-reactions,
.expanded-slide-current .expanded-reactions * {
  pointer-events: auto;
}

.expanded-slide-next {
  z-index: 1;
  transform: translateY(100%);
}

.expanded-image {
  position: relative;
  z-index: 1;
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 0;
  user-select: none;
  -webkit-user-drag: none;
}

.app-shell[data-meme-background="blurred"] .expanded-slide {
  background: #000;
}

.app-shell[data-meme-background="blurred"] .expanded-image-backdrop {
  display: block;
}

.expanded-reactions {
  justify-self: auto;
  align-self: auto;
}

@media (orientation: portrait) {
  .expanded-meme {
    padding: 0;
  }

  .expanded-track {
    transform: translateY(0);
  }

  .expanded-slide {
    padding-right: 0;
    padding-left: 0;
  }

  .expanded-slide-previous {
    transform: translateY(-100%);
  }

  .expanded-slide-current {
    transform: translateY(0);
  }

  .expanded-slide-next {
    transform: translateY(100%);
  }

  .expanded-reactions {
    top: auto;
    right: 6px;
    bottom: calc(6px + env(safe-area-inset-bottom, 0px));
    left: auto;
    grid-template-columns: 1fr;
    width: 44px;
    transform: none;
  }

  .expanded-reactions .viewer-reaction-button {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0 6px;
    font-size: 1rem;
  }
}

.reaction-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  min-height: 48px;
  padding: 6px;
  border-top: 1px solid #efefef;
}

.reaction-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 36px;
  border: 1px solid #e3e3e3;
  background: #fafafa;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 800;
}

.empty-wall {
  display: grid;
  place-content: center;
  grid-column: 1 / -1;
  height: 100%;
  min-height: 320px;
  color: #8a8f96;
  text-align: center;
}

.empty-wall h2,
.empty-wall p {
  margin: 0;
}

.empty-wall p {
  margin-top: 10px;
}

.auth-modal {
  width: min(390px, calc(100% - 28px), calc(var(--app-max-width) - 28px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.group-modal {
  width: min(540px, calc(100% - 28px), calc(var(--app-max-width) - 28px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.meme-viewer {
  width: min(100dvw, var(--app-max-width));
  max-width: var(--app-max-width);
  height: 100dvh;
  max-height: 100dvh;
  margin: auto;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: rgba(10, 12, 14, 0.94);
}

.meme-viewer::backdrop {
  background: #000;
}

.meme-viewer[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  place-items: center;
  gap: 16px;
  padding: 22px;
  overflow: hidden;
}

.viewer-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 48px;
  min-height: 48px;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  font-size: 2rem;
}

.viewer-nav {
  position: absolute;
  z-index: 2;
  display: none;
  width: 76px;
  min-height: 76px;
  padding: 0;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.68);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.36);
}

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

.viewer-prev {
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
}

.viewer-next {
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
}

.meme-viewer.is-portrait .viewer-nav {
  display: none;
}

.viewer-uploader {
  margin: 0;
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
}

#viewer-image {
  display: block;
  width: auto;
  height: auto;
  max-width: min(calc(100vw - 32px), calc(var(--app-max-width) - 32px));
  height: auto;
  max-height: calc(100dvh - 190px);
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.4);
  touch-action: none;
}

@media (max-width: 720px) {
  .wall-toolbar {
    align-items: center;
  }

  .wall-toolbar-actions {
    justify-content: flex-end;
  }

  #viewer-image {
    max-width: calc(100vw - 32px);
    height: auto;
  }
}

@media (max-width: 640px) {
  .wall-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .wall-card {
    gap: 0;
    padding: 0;
  }

  .wall-card h2 {
    height: auto;
    font-size: 1.15rem;
    line-height: 1.2;
  }

  .wall-card-image {
    font-size: 1.35rem;
  }

  .meme-wall {
    --meme-column-count: 3;
  }

  .reaction-button {
    font-size: 0.95rem;
  }
}

.viewer-reactions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: min(386px, calc(100% - 44px));
}

.viewer-reactions.expanded-reactions {
  display: grid;
  grid-template-columns: 1fr;
  width: 58px;
}

.viewer-reaction-button {
  min-height: 62px;
  font-size: 1.55rem;
}

.reaction-icon,
.reaction-count {
  line-height: 1;
}

.reaction-image {
  width: 22px;
  height: 22px;
  object-fit: contain;
  pointer-events: none;
}

.viewer-like-button {
  overflow: visible;
}

.viewer-comment-button {
  overflow: visible;
}

.viewer-options-button {
  overflow: visible;
}

.comment-icon {
  width: 30px;
  height: 30px;
  object-fit: contain;
  pointer-events: none;
}

.options-icon {
  width: 30px;
  height: 30px;
  object-fit: contain;
  pointer-events: none;
}

.viewer-like-button,
.viewer-comment-button,
.viewer-options-button,
.viewer-uploader.is-profile-link {
  touch-action: manipulation;
}

.expanded-reactions .viewer-reaction-button {
  flex-direction: column;
  width: 58px;
  height: 58px;
  min-width: 58px;
  min-height: 58px;
  padding: 0 7px;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #fff;
  font-size: 1.15rem;
  gap: 5px;
}

.expanded-reactions .reaction-count {
  color: #fff;
  filter: var(--overlay-drop-shadow);
  font-size: 1.08rem;
  font-weight: 900;
  text-shadow: none;
}

.expanded-reactions .reaction-image {
  width: 32px;
  height: 32px;
  filter: var(--overlay-drop-shadow);
}

.expanded-reactions .comment-icon {
  width: 32px;
  height: 32px;
  color: #fff;
  filter: var(--overlay-drop-shadow);
}

.expanded-reactions .options-icon {
  width: 32px;
  height: 32px;
  filter: var(--overlay-drop-shadow);
}

.group-modal::backdrop,
.auth-modal::backdrop,
.comments-modal::backdrop,
.ai-editor-modal::backdrop,
.meme-options-modal::backdrop {
  background: rgba(31, 35, 40, 0.28);
}

.ai-editor-modal {
  box-sizing: border-box;
  width: min(430px, 100vw);
  max-width: none;
  height: min(72vh, 680px);
  max-height: calc(100dvh - 78px);
  margin: auto auto 64px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 16px 16px 0 0;
  background: transparent;
  color: var(--ink);
}

.ai-editor-card {
  box-sizing: border-box;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  height: 100%;
  padding: 16px;
  background: var(--surface, #fff);
  box-shadow: 0 -14px 42px rgba(0, 0, 0, 0.24);
}

.ai-editor-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

.ai-editor-header h2,
.ai-editor-header p {
  margin: 0;
}

.ai-editor-header p {
  margin-top: 3px;
  color: var(--muted, #666);
  font-size: 0.85rem;
}

.ai-editor-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  padding: 14px 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.ai-message {
  align-self: flex-start;
  max-width: 86%;
  padding: 10px 12px;
  border-radius: 14px;
  background: #ededed;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ai-message.is-user {
  align-self: flex-end;
  background: #171717;
  color: #fff;
}

.ai-message-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.ai-message-actions button {
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid currentColor;
  border-radius: 9px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.ai-message-actions .is-danger {
  color: #c51d2b;
}

.ai-editor-status {
  min-height: 20px;
  margin: 0 0 6px;
  color: var(--muted, #666);
  font-size: 0.82rem;
}

.ai-editor-status.is-error {
  color: #c51d2b;
}

.ai-editor-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
}

.ai-editor-form textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 46px;
  max-height: 130px;
  padding: 11px 14px;
  resize: vertical;
  border: 1px solid rgba(0, 0, 0, 0.22);
  border-radius: 12px;
  background: #fff;
  color: #111;
  font: inherit;
}

.ai-editor-form button {
  min-height: 46px;
}

.meme-options-modal {
  width: min(220px, calc(100vw - 32px));
  max-width: none;
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: transparent;
}

.meme-options-modal:has(.meme-delete-confirm:not([hidden])) {
  width: min(340px, calc(100vw - 32px));
}

.meme-options-card {
  display: grid;
  width: 100%;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.meme-delete-confirm h3,
.meme-delete-confirm p {
  margin: 0;
}

.meme-options-list {
  display: grid;
}

.meme-option-button {
  min-height: 40px;
  padding: 0 12px;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.meme-option-button:hover,
.meme-option-button:focus-visible {
  background: #f2eee7;
  outline: none;
}

.meme-option-button.is-danger,
.primary-button.is-danger {
  color: #c62828;
}

.primary-button.is-danger {
  background: #fff0f0;
  box-shadow: none;
}

.meme-delete-confirm {
  display: grid;
  gap: 12px;
  width: min(312px, calc(100vw - 50px));
  padding: 14px;
}

.meme-delete-confirm p {
  color: var(--muted);
}

.meme-confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.meme-options-card > .auth-error {
  margin: 0 16px 14px;
}

.meme-options-card > .auth-error:empty {
  display: none;
}

.comments-modal {
  position: fixed;
  inset: auto auto 0 50%;
  width: min(100vw, var(--app-max-width));
  max-width: none;
  height: 60vh;
  height: 60dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 18px 18px 0 0;
  background: transparent;
  transform: translateX(-50%);
}

.comments-card {
  display: grid;
  grid-template-rows: auto minmax(160px, 1fr) auto auto;
  width: 100%;
  height: 100%;
  max-height: none;
  overflow: hidden;
  border-radius: 18px 18px 0 0;
  background: #fff;
  box-shadow: 0 24px 70px rgba(31, 35, 40, 0.22);
}

.comments-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  padding: 8px 56px;
  border-bottom: 1px solid #ececec;
}

.comments-header h2 {
  margin: 0;
  font-size: 1.12rem;
}

.comments-header .close-button {
  top: 10px;
  right: 12px;
}

.comments-list {
  min-height: 160px;
  overflow-y: auto;
  padding: 8px 16px;
}

.comments-empty {
  margin: 38px 0;
  color: var(--muted);
  text-align: center;
}

.comment-item {
  padding: 12px 2px;
  border-bottom: 1px solid #f0f0f0;
}

.comment-children {
  margin-left: 22px;
  padding-left: 10px;
  border-left: 2px solid #ececec;
}

.comment-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 5px;
}

.comment-meta time {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.76rem;
}

.comment-body {
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.comment-actions {
  display: flex;
  gap: 14px;
  margin-top: 7px;
}

.comment-action {
  min-height: 30px;
  padding: 2px 0;
  color: var(--muted);
  background: transparent;
  font-size: 0.82rem;
  font-weight: 800;
}

.comment-action.is-liked {
  color: #e53935;
}

.comment-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid #ececec;
}

.comment-form input {
  min-width: 0;
  padding-right: 24px;
  padding-left: 24px;
  border-radius: 8px;
}

.comment-form .primary-button {
  min-width: 72px;
}

.comment-reply-context {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.82rem;
}

.comment-reply-context button {
  min-height: 30px;
  padding: 2px 0;
  color: var(--accent);
  background: transparent;
  font-weight: 800;
}

.comments-card > .auth-error {
  min-height: 0;
  margin: -4px 16px 10px;
}

.auth-card,
.group-card {
  position: relative;
  display: grid;
  gap: 10px;
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  padding: 24px;
  background: #fff;
  scrollbar-width: none;
}

.group-card::-webkit-scrollbar {
  display: none;
}

.auth-card h2,
.group-card h2,
.group-card h3 {
  margin: 0 0 8px;
}

.auth-switch-copy {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  text-align: center;
}

.auth-switch-link {
  color: var(--ink);
  font-weight: 800;
  text-underline-offset: 3px;
}

.auth-switch-link:hover {
  text-decoration-thickness: 2px;
}

.group-setting {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 14px;
  font-weight: 700;
}

.group-setting[hidden] {
  display: none;
}

.group-setting input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.auth-card textarea,
.group-card textarea {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
}

.generate-preview {
  display: none;
}

.generate-preview-backdrop {
  display: none;
}

.form-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.group-icon {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border-radius: 8px;
  color: #fff;
  background-color: var(--accent);
  background-position: center;
  background-size: cover;
  font-size: 2rem;
  font-weight: 900;
}

.group-icon.is-editable {
  cursor: pointer;
}

.group-header-text {
  margin-top: -70px;
  margin-left: 90px;
  min-height: 74px;
}

.group-header-text h2.is-editable {
  cursor: pointer;
}

.group-header-text h2.is-editing {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px 40px;
  align-items: center;
  gap: 8px;
}

.group-title-input {
  min-width: 0;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.group-title-action {
  display: grid;
  place-items: center;
  width: 40px;
  min-height: 40px;
  padding: 0;
  color: var(--ink);
  background: #ebe4d8;
  font-size: 1.2rem;
  font-weight: 900;
}

.group-header-text p {
  margin: 0;
  color: var(--muted);
}

.member-list {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
  scrollbar-width: none;
}

.member-list::-webkit-scrollbar {
  display: none;
}

.member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border: 1px solid #ececec;
  border-radius: 8px;
}

.member-label {
  min-width: 0;
}

.member-request-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.member-action-button {
  min-width: 74px;
  min-height: 36px;
  padding: 0 10px;
  box-shadow: none;
}

.member-request-actions .member-action-button,
.member-row .member-action-button {
  width: auto;
}

.member-row span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.86rem;
}

.danger-button {
  min-height: 44px;
  border: 1px solid rgba(178, 58, 72, 0.35);
  background: #fff1f1;
  color: #b23a48;
  font-weight: 900;
}

.danger-button:hover {
  background: #ffe8e8;
}

.auth-error {
  min-height: 20px;
  margin: 0;
  color: #b44545;
  font-size: 0.92rem;
}

.close-button {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  min-height: 36px;
  background: #f2eee7;
}

@media (max-width: 720px) {
  .view {
    width: min(100% - 24px, 1120px);
    padding-top: 22px;
  }

  .wall-view,
  .upload-view,
  .create-wall-view {
    width: 100%;
    margin: 0;
    padding-top: 0;
  }

  .form-row {
    align-items: stretch;
    flex-direction: column;
  }

  .home-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .home-search-row {
    gap: 8px;
  }

  .home-create-button {
    width: auto;
    min-width: 104px;
    padding-inline: 10px;
    font-size: 0.9rem;
  }

  .primary-button,
  .upload-button,
  .ghost-button,
  .ghost-upload,
  .toolbar-select {
    width: 100%;
  }

  .home-search-row .home-create-button {
    width: auto;
    flex: 0 0 auto;
  }

  .wall-toolbar {
    display: grid;
    grid-template-columns: minmax(44px, auto) minmax(0, 1fr) minmax(44px, auto);
  }

  .wall-toolbar-actions {
    justify-content: end;
    gap: 6px;
  }

  .wall-toolbar-actions .wall-action-button {
    width: auto;
    min-width: 64px;
    padding-inline: 10px;
    font-size: 0.9rem;
  }

  .member-request-actions .member-action-button {
    width: auto;
  }

  .member-row .member-action-button {
    width: auto;
  }

}
.post-timeline-stage {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 100%;
  background: #000;
}

.post-timeline-image,
.post-timeline-video {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.post-timeline-backdrop {
  position: absolute;
  inset: -24px;
  z-index: 0;
  display: none;
  width: calc(100% + 48px);
  height: calc(100% + 48px);
  object-fit: cover;
  filter: blur(22px);
  opacity: 1;
  transform: scale(1.04);
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.app-shell[data-meme-background="blurred"] .post-timeline-backdrop:not([hidden]) {
  display: block;
}

.timeline-backdrop {
  display: none;
}
