:root {
  color-scheme: light;
  --paper: #f5efe4;
  --paper-strong: #fff9ef;
  --ink: #2a241f;
  --muted: #756c60;
  --line: rgba(42, 36, 31, 0.14);
  --terracotta: #b9684c;
  --terracotta-dark: #8b4938;
  --olive: #66725a;
  --sage: #a8b49b;
  --fig: #4d3841;
  --shadow: 0 22px 70px rgba(43, 34, 25, 0.18);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background:
    linear-gradient(135deg, rgba(102, 114, 90, 0.22), transparent 36%),
    linear-gradient(315deg, rgba(185, 104, 76, 0.2), transparent 42%),
    var(--paper);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  letter-spacing: 0;
}

button,
input,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.shell {
  width: 100%;
  min-height: 100svh;
  display: grid;
  place-items: stretch;
}

.mobile-frame {
  width: 100%;
  min-height: 100svh;
  position: relative;
  overflow: hidden;
  background: #1f1b17;
  isolation: isolate;
}

@media (min-width: 700px) {
  .shell {
    min-height: 100vh;
    place-items: center;
    padding: 24px;
  }

  .mobile-frame {
    width: min(430px, calc(100vw - 48px));
    min-height: min(860px, calc(100vh - 48px));
    height: min(860px, calc(100vh - 48px));
    border: 1px solid rgba(42, 36, 31, 0.22);
    border-radius: 8px;
    box-shadow: var(--shadow);
  }
}

.lock-screen,
.empty-gallery {
  min-height: 100%;
  display: grid;
  align-content: center;
  gap: 22px;
  padding: calc(32px + var(--safe-top)) 28px calc(32px + var(--safe-bottom));
  background:
    linear-gradient(160deg, rgba(168, 180, 155, 0.34), transparent 42%),
    linear-gradient(20deg, rgba(185, 104, 76, 0.2), transparent 40%),
    var(--paper-strong);
}

.lock-mark {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--fig);
  background: rgba(255, 249, 239, 0.76);
}

.lock-title {
  margin: 0;
  max-width: 11ch;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 42px;
  line-height: 0.96;
  font-weight: 500;
}

.lock-copy,
.form-note,
.empty-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.passcode-form,
.settings-row {
  display: grid;
  gap: 10px;
}

.passcode-input,
.text-input,
.text-area,
.number-input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 249, 239, 0.88);
  color: var(--ink);
  padding: 13px 14px;
  outline: none;
}

.passcode-input:focus,
.text-input:focus,
.text-area:focus,
.number-input:focus {
  border-color: rgba(139, 73, 56, 0.7);
  box-shadow: 0 0 0 4px rgba(185, 104, 76, 0.14);
}

.primary-button,
.secondary-button,
.icon-button,
.danger-button {
  border: 1px solid transparent;
  border-radius: 8px;
  min-height: 42px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--ink);
}

.primary-button {
  background: var(--fig);
  color: var(--paper-strong);
  padding: 0 16px;
}

.secondary-button {
  background: rgba(255, 249, 239, 0.8);
  border-color: var(--line);
  padding: 0 14px;
}

.danger-button {
  background: rgba(139, 73, 56, 0.08);
  border-color: rgba(139, 73, 56, 0.22);
  color: var(--terracotta-dark);
  padding: 0 14px;
}

.status-line,
.error-line {
  min-height: 20px;
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.error-line {
  color: var(--terracotta-dark);
}

.moment-stage {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(160deg, rgba(102, 114, 90, 0.18), transparent 48%),
    #241f1a;
  touch-action: pan-y;
}

.media-plane,
.media-element {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.media-plane {
  transition: filter 420ms ease, transform 420ms ease;
}

.media-plane.is-concealed {
  filter: blur(22px);
  transform: scale(1.08);
}

.media-element {
  object-fit: var(--media-fit, cover);
  background: #211d19;
}

.media-element.fit-contain {
  object-fit: contain;
}

.media-element.fit-cover {
  object-fit: cover;
}

.moment-shadow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.42), transparent 24%),
    linear-gradient(to top, rgba(0, 0, 0, 0.72), transparent 44%);
}

.moment-top,
.moment-bottom {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff8ed;
  text-shadow: 0 1px 18px rgba(0, 0, 0, 0.42);
}

.moment-top {
  top: 0;
  justify-content: space-between;
  padding: calc(16px + var(--safe-top)) 16px 0;
}

.moment-date {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font-size: 13px;
  line-height: 1.2;
  cursor: pointer;
}

.moment-bottom {
  bottom: 0;
  display: grid;
  gap: 12px;
  padding: 0 16px calc(18px + var(--safe-bottom));
}

.caption {
  margin: 0;
  max-width: 100%;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  line-height: 1.22;
  overflow-wrap: anywhere;
}

.song-credit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: rgba(255, 248, 237, 0.86);
  font-size: 13px;
  line-height: 1.35;
}

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

.song-links {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
}

.song-link,
.heart-button,
.corner-button,
.hover-arrow {
  border: 1px solid rgba(255, 248, 237, 0.28);
  border-radius: 999px;
  color: #fff8ed;
  background: rgba(28, 24, 20, 0.34);
  backdrop-filter: blur(14px);
  text-decoration: none;
}

.song-link {
  min-width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  font-size: 12px;
}

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

.heart-button {
  min-width: 62px;
  height: 40px;
  padding: 0 12px;
  font-size: 17px;
}

.heart-button.is-active {
  background: rgba(185, 104, 76, 0.58);
  border-color: rgba(255, 248, 237, 0.54);
}

.corner-button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
}

.corner-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.side-tap {
  position: absolute;
  top: 15%;
  bottom: 18%;
  z-index: 3;
  border: 0;
  background: transparent;
  color: transparent;
  width: 30%;
  cursor: pointer;
}

.side-tap.left {
  left: 0;
}

.side-tap.right {
  right: 0;
}

.center-tap {
  position: absolute;
  inset: 18% 30%;
  z-index: 3;
  border: 0;
  background: transparent;
  color: transparent;
  cursor: pointer;
}

.play-gate {
  position: absolute;
  z-index: 6;
  top: 50%;
  left: 50%;
  width: 58px;
  height: 58px;
  padding: 0;
  border: 1px solid rgba(255, 248, 237, 0.5);
  border-radius: 50%;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  color: #fff8ed;
  background: rgba(28, 24, 20, 0.44);
  backdrop-filter: blur(14px);
  cursor: pointer;
  transition: opacity 180ms ease, transform 180ms ease;
}

.play-gate svg {
  width: 25px;
  height: 25px;
  margin-left: 2px;
  fill: currentColor;
  stroke: none;
}

.play-gate.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.88);
}

.hover-arrow {
  display: none;
}

@media (min-width: 700px) {
  .hover-arrow {
    position: absolute;
    z-index: 5;
    top: 50%;
    width: 40px;
    height: 40px;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 160ms ease;
  }

  .hover-arrow.left {
    left: 12px;
  }

  .hover-arrow.right {
    right: 12px;
  }

  .mobile-frame:hover .hover-arrow {
    display: grid;
    place-items: center;
    opacity: 1;
  }
}

.curator-shell {
  width: min(860px, 100%);
  margin: 0 auto;
  padding: 24px 16px 56px;
}

.curator-header {
  display: grid;
  gap: 8px;
  margin: 0 0 20px;
}

.curator-title {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 40px;
  line-height: 1;
  font-weight: 500;
}

.curator-grid {
  display: grid;
  gap: 16px;
}

@media (min-width: 820px) {
  .curator-grid {
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
    align-items: start;
  }
}

.panel,
.moment-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 249, 239, 0.76);
}

.panel {
  padding: 16px;
  display: grid;
  gap: 16px;
}

.subsection {
  display: grid;
  gap: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.panel-title {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
}

.field-label {
  color: var(--fig);
  font-size: 13px;
  font-weight: 650;
}

.text-area {
  min-height: 92px;
  resize: vertical;
}

.file-input {
  width: 100%;
  padding: 12px;
  border: 1px dashed rgba(102, 114, 90, 0.46);
  border-radius: 8px;
  background: rgba(168, 180, 155, 0.14);
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 249, 239, 0.78);
}

.segment {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}

.segment[aria-pressed="true"] {
  background: var(--olive);
  color: #fff8ed;
}

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

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.media-list,
.moments-list {
  display: grid;
  gap: 10px;
}

.media-row,
.moment-card {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.media-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(245, 239, 228, 0.66);
}

.row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.row-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.tiny-actions {
  display: flex;
  gap: 6px;
}

.tiny-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  width: 34px;
  height: 32px;
  background: rgba(255, 249, 239, 0.8);
  cursor: pointer;
}

.moment-card-title {
  margin: 0;
  font-size: 15px;
  line-height: 1.35;
}

.moment-card-meta {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.status-pill {
  justify-self: start;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  color: #fff8ed;
  background: var(--olive);
}

.status-pill.unpublished {
  background: var(--terracotta);
}

.hidden {
  display: none !important;
}
