:root {
  color-scheme: light;
  --ink: #17232a;
  --muted: #647783;
  --line: #d9e6eb;
  --panel: #ffffff;
  --wash: #f5f5f7;
  --accent: #197c72;
  --accent-strong: #075f58;
  --mint: #dff2e7;
  --sky: #8fc7d2;
  --sun: #f7d46d;
  --coral: #e96d5d;
  --warm: #e39a41;
  --danger: #b84b50;
  --shadow: 0 18px 46px rgba(28, 43, 52, 0.1);
  --soft-shadow: 0 8px 22px rgba(28, 43, 52, 0.07);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", ui-sans-serif, system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
  background:
    radial-gradient(circle at 10% 10%, rgba(247, 212, 109, 0.34), transparent 26%),
    radial-gradient(circle at 86% 12%, rgba(143, 199, 210, 0.34), transparent 28%),
    radial-gradient(circle at 78% 78%, rgba(233, 109, 93, 0.12), transparent 30%),
    linear-gradient(135deg, #fbfbfd 0%, #f3f7f6 45%, #fff8e8 100%);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(25, 124, 114, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(25, 124, 114, 0.035) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent 80%);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  min-height: 42px;
  padding: 0 16px;
  box-shadow: 0 8px 18px rgba(7, 95, 88, 0.14);
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease,
    border-color 0.16s ease;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  min-width: 38px;
  min-height: 38px;
  border-radius: 50%;
  padding: 0;
  font-size: 15px;
  line-height: 1;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(7, 95, 88, 0.2);
}

button:active {
  transform: translateY(0);
}

button:disabled {
  cursor: wait;
  opacity: 0.7;
  transform: none;
}

button.secondary {
  background: #e7f1ef;
  color: var(--accent-strong);
  box-shadow: none;
}

button.danger {
  background: #fae9e8;
  color: var(--danger);
  box-shadow: none;
}

button.ghost {
  background: transparent;
  color: var(--accent-strong);
  box-shadow: none;
}

input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease;
}

input::placeholder {
  color: #91a1ab;
  opacity: 1;
}

input:focus,
select:focus {
  border-color: var(--accent);
  outline: 0;
  box-shadow: 0 0 0 4px rgba(25, 124, 114, 0.12);
}

select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 253, 249, 0.96), rgba(255, 253, 249, 0.82)),
    linear-gradient(135deg, rgba(223, 242, 231, 0.7), rgba(255, 255, 255, 0));
  padding: 24px;
  box-shadow: 10px 0 35px rgba(38, 74, 86, 0.06);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.album-context,
.subalbum-context {
  display: none;
}

.album-mode .brand {
  display: none;
}

.album-mode .album-context {
  display: block;
  margin-bottom: 14px;
}

.album-context button {
  min-height: 40px;
  border-radius: 999px;
  padding: 0 14px;
}

.album-mode .album-context > div,
.subalbum-mode .subalbum-context > div {
  display: none;
}

.album-context strong,
.album-context span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.album-context strong {
  color: var(--ink);
  font-size: 20px;
  line-height: 1.1;
}

.album-context span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  position: relative;
  flex: 0 0 auto;
  overflow: hidden;
  background: transparent url("/assets/logo.png?v=transparent-1") center / cover no-repeat;
  border: 1px solid rgba(255, 255, 255, 0.8);
  color: #24465a;
  box-shadow:
    0 14px 30px rgba(45, 91, 128, 0.13),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.brand-mark::before,
.brand-mark::after {
  display: none;
}

.brand-person {
  display: none;
}

.brand-spark {
  display: none;
}

.brand h1,
.brand p,
.topbar h2,
.topbar p,
.empty h3,
.empty p {
  margin: 0;
}

.brand h1 {
  font-size: 22px;
}

.brand h1 span {
  display: block;
  color: #2f74ff;
  font-size: 18px;
  line-height: 1;
}

.brand p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.new-album {
  display: grid;
  gap: 10px;
  margin-bottom: 22px;
  padding: 14px;
  border: 1px solid rgba(217, 230, 235, 0.92);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.66);
}

.inline {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.album-list {
  display: grid;
  gap: 8px;
}

.album-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  min-height: 64px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  padding: 8px;
  text-align: left;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8), var(--soft-shadow);
}

.album-item.active {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(223, 242, 231, 0.92), rgba(255, 253, 249, 0.94));
  box-shadow: inset 4px 0 0 var(--accent), var(--soft-shadow);
}

.subalbum-item {
  grid-template-columns: 1fr;
}

.album-item:hover {
  border-color: rgba(25, 124, 114, 0.35);
  background: #fffdf9;
}

.album-select {
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: 48px;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  padding: 4px 6px;
  text-align: left;
  box-shadow: none;
}

.album-select:hover {
  background: transparent;
  box-shadow: none;
  transform: none;
}

.album-delete {
  align-self: center;
  width: 36px;
  min-width: 36px;
  min-height: 36px;
  border-radius: 50%;
  background: #fae9e8;
  color: var(--danger);
  box-shadow: none;
  font-size: 12px;
  padding: 0;
}

.album-delete:hover {
  background: #f5dddd;
  box-shadow: none;
}

.album-select strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.album-select span {
  color: var(--muted);
  font-size: 12px;
}

.workspace {
  min-width: 0;
  padding: 28px;
}

.topbar {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  padding-bottom: 16px;
}

.topbar::after {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 5px;
  border-radius: 999px;
  content: "";
  background: linear-gradient(90deg, var(--accent), var(--sky), var(--sun), var(--coral));
}

.eyebrow {
  color: var(--warm);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.topbar h2 {
  margin-top: 4px;
  font-size: clamp(24px, 3vw, 42px);
  line-height: 1.1;
}

.folder-summary-topbar {
  gap: 0;
  margin-bottom: 12px;
  padding-bottom: 12px;
}

.folder-summary-topbar .eyebrow,
.folder-summary-topbar .stats {
  display: none;
}

.folder-summary-topbar h2 {
  margin-top: 0;
  color: var(--muted);
  font-size: 18px;
  font-weight: 900;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.stat {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.86);
  padding: 8px 11px;
  color: var(--muted);
  font-size: 13px;
  box-shadow: var(--soft-shadow);
}

.empty {
  display: grid;
  place-items: center;
  min-height: 420px;
  border: 1px dashed #b7c8d1;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 253, 249, 0.92), rgba(223, 242, 231, 0.62)),
    #fff;
  padding: 24px;
  text-align: center;
  box-shadow: var(--shadow);
}

.empty div {
  max-width: 620px;
}

.empty h3 {
  font-size: 26px;
}

.empty p {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.7;
}

.empty button {
  margin-top: 18px;
}

.hidden {
  display: none !important;
}

.auth-view {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 28px 18px;
}

.auth-card {
  position: relative;
  width: min(430px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 28px;
  background:
    radial-gradient(circle at 18% 10%, rgba(143, 199, 210, 0.22), transparent 28%),
    radial-gradient(circle at 88% 88%, rgba(247, 212, 109, 0.18), transparent 30%),
    rgba(255, 255, 255, 0.86);
  box-shadow:
    0 26px 70px rgba(35, 55, 66, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  padding: 34px 28px 28px;
  backdrop-filter: blur(22px);
}

.auth-register-card {
  padding-top: 60px;
}

.auth-brand {
  display: grid;
  justify-items: center;
  gap: 24px;
  margin: 0 0 58px;
  text-align: center;
}

.auth-brand-mark {
  width: 160px;
  height: 160px;
  border: 0;
  border-radius: 0;
  background-color: transparent;
  background-size: cover;
  background-position: center;
  box-shadow: none;
}

.auth-brand h1 {
  margin: 0;
  font-size: 31px;
  line-height: 1.08;
}

.auth-brand h1 span {
  color: #428ccc;
}

.auth-brand p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
}

.auth-form {
  display: grid;
  gap: 15px;
}

.auth-form h2,
.auth-register-card h2,
.avatar-upload-copy h3,
.avatar-upload-copy p {
  margin: 0;
}

.auth-form h2,
.auth-register-card h2 {
  color: #07131a;
  font-size: 28px;
  line-height: 1.15;
}

.auth-register-card > h2 {
  margin-bottom: 38px;
  text-align: center;
}

.auth-field {
  position: relative;
  gap: 6px;
}

.auth-field > span {
  color: #91a1ab;
  font-size: 13px;
  font-weight: 700;
  padding-left: 6px;
}

.auth-field input {
  min-height: 62px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  padding-left: 56px;
  padding-right: 54px;
  box-shadow: 0 8px 26px rgba(63, 88, 101, 0.05);
}

.auth-field-icon,
.auth-eye-button {
  position: absolute;
  z-index: 1;
  width: 24px;
  height: 24px;
  color: #7f929e;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auth-field-icon {
  left: 20px;
  top: 40px;
  pointer-events: none;
}

.auth-eye-button {
  right: 20px;
  top: 40px;
  display: grid;
  place-items: center;
  min-width: 24px;
  min-height: 24px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
  cursor: pointer;
}

.auth-eye-button:hover {
  transform: none;
  box-shadow: none;
}

.auth-eye-button svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auth-field small {
  color: #72818a;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
  padding-left: 12px;
}

.auth-field small.is-valid {
  color: #0a8f80;
}

.auth-field small.is-invalid {
  color: var(--danger);
}

.auth-field:focus-within > span {
  color: var(--accent);
}

.auth-field:focus-within .auth-field-icon,
.auth-field:focus-within .auth-eye-button {
  color: var(--accent);
}

.auth-forgot {
  justify-self: end;
  min-height: auto;
  background: transparent;
  color: #0aa7b0;
  padding: 0 4px;
  box-shadow: none;
}

.auth-primary,
.auth-secondary {
  width: 100%;
  min-height: 58px;
  border-radius: 999px;
  font-size: 17px;
}

.auth-primary {
  margin-top: 18px;
  background: linear-gradient(135deg, #11bfca, var(--accent-strong));
  box-shadow: 0 18px 36px rgba(7, 95, 88, 0.22);
}

.auth-secondary {
  border: 1.5px solid #0aa7b0;
  background: rgba(255, 255, 255, 0.72);
  color: var(--accent-strong);
  box-shadow: none;
}

.auth-status {
  min-height: 20px;
  color: var(--danger);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.auth-switch {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  margin: 68px 0 22px;
  color: var(--muted);
  font-weight: 800;
}

.auth-switch span {
  height: 1px;
  background: var(--line);
}

.auth-switch p,
.auth-agreement,
.auth-login-link {
  margin: 0;
}

.auth-agreement,
.auth-login-link {
  margin-top: 24px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.auth-agreement a,
.auth-login-link button {
  border: 0;
  background: transparent;
  color: #158ac6;
  min-height: auto;
  padding: 0;
  box-shadow: none;
  font-weight: 900;
}

.auth-back {
  position: absolute;
  left: 26px;
  top: 28px;
  display: grid;
  place-items: center;
  width: 42px;
  min-width: 42px;
  min-height: 42px;
  border-radius: 50%;
  background: transparent;
  color: #0d171d;
  box-shadow: none;
  font-size: 38px;
  font-weight: 500;
  line-height: 1;
}

.avatar-upload-copy {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.avatar-upload-copy h3 {
  font-size: 21px;
  line-height: 1.2;
}

.avatar-upload-copy p {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.65;
}

.avatar-picker {
  position: relative;
  justify-items: center;
  margin: 4px 0 18px;
  cursor: pointer;
}

.avatar-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.avatar-preview {
  position: relative;
  display: grid;
  place-items: center;
  width: 126px;
  height: 126px;
  border: 5px solid rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.6), transparent 28%),
    linear-gradient(145deg, #dff7f5, #ccebf0);
  background-position: center;
  background-size: cover;
  box-shadow: 0 18px 38px rgba(45, 91, 128, 0.12);
}

.avatar-preview.has-image .avatar-person {
  display: none;
}

.avatar-person {
  position: relative;
  width: 58px;
  height: 58px;
}

.avatar-person::before,
.avatar-person::after {
  position: absolute;
  left: 50%;
  content: "";
  transform: translateX(-50%);
  background: #77c6d0;
}

.avatar-person::before {
  top: 2px;
  width: 31px;
  height: 31px;
  border-radius: 50%;
}

.avatar-person::after {
  bottom: 0;
  width: 58px;
  height: 29px;
  border-radius: 29px 29px 8px 8px;
}

.avatar-picker strong {
  position: absolute;
  right: calc(50% - 78px);
  bottom: 13px;
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  border: 5px solid #fff;
  border-radius: 50%;
  background: #12b9c2;
  color: #fff;
  font-size: 0;
  box-shadow: 0 10px 22px rgba(35, 55, 66, 0.2);
}

.avatar-picker strong::before {
  display: none;
}

.avatar-picker strong svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.album-panel {
  display: grid;
  gap: 22px;
}

.home-albums {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.home-albums .section-heading {
  grid-column: 1 / -1;
}

.home-album-card {
  position: relative;
  overflow: hidden;
  min-height: 174px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--soft-shadow);
  padding: 0;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    border-color 0.16s ease;
}

.home-album-card:hover {
  border-color: rgba(25, 124, 114, 0.34);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.create-album-fab {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 35;
  width: min(420px, calc(100vw - 32px));
  min-height: 54px;
  border-radius: 999px;
  box-shadow: 0 18px 36px rgba(7, 95, 88, 0.24);
  transform: translateX(-50%);
}

.create-album-fab:hover {
  transform: translateX(-50%) translateY(-1px);
}

.create-album-fab:active {
  transform: translateX(-50%);
}

.create-album-dialog {
  width: min(430px, calc(100vw - 32px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: #fffdf9;
  color: var(--ink);
  box-shadow: 0 30px 90px rgba(18, 31, 38, 0.28);
}

.create-album-dialog::backdrop {
  background: rgba(23, 35, 42, 0.42);
  backdrop-filter: blur(10px);
}

.create-album-form {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.create-album-form h3,
.create-album-form p {
  margin: 0;
}

.create-album-form h3 {
  margin-top: 3px;
  font-size: 24px;
  line-height: 1.15;
}

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

.home-album-open {
  display: grid;
  grid-template-rows: auto auto;
  gap: 0;
  width: 100%;
  height: 100%;
  min-height: 174px;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  padding: 0;
  text-align: left;
  box-shadow: none;
}

.home-album-open:hover {
  background: transparent;
  box-shadow: none;
  transform: none;
}

.home-album-faces {
  display: flex;
  gap: 12px;
  min-height: 104px;
  overflow-x: auto;
  padding: 16px 16px 4px;
  scrollbar-width: none;
}

.home-album-faces::-webkit-scrollbar {
  display: none;
}

.home-album-faces.empty-cover {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.home-album-faces i {
  font-style: normal;
}

.home-face {
  display: grid;
  flex: 0 0 62px;
  justify-items: center;
  gap: 7px;
  min-width: 62px;
}

.home-face img {
  width: 56px;
  height: 78px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #edf2f3;
  box-shadow: 0 8px 18px rgba(28, 43, 52, 0.12);
  object-fit: cover;
}

.home-face small {
  width: 72px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-album-meta {
  display: grid;
  gap: 7px;
  padding: 10px 58px 16px 16px;
}

.home-album-meta strong {
  overflow: hidden;
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-album-meta small {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.home-album-rename,
.home-album-delete {
  position: absolute;
  bottom: 16px;
  width: 42px;
  min-width: 42px;
  min-height: 42px;
  border-radius: 50%;
  box-shadow: none;
  padding: 0;
}

.home-album-rename {
  right: 62px;
  background: #eaf4f0;
  color: var(--accent-strong);
}

.home-album-delete {
  right: 14px;
  background: #fae9e8;
  color: var(--danger);
}

.trip-board {
  position: relative;
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(260px, 1fr) auto;
  align-items: center;
  gap: 18px;
  overflow: hidden;
  border: 1px solid rgba(25, 124, 114, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(23, 124, 114, 0.96), rgba(42, 148, 137, 0.9)),
    var(--accent);
  color: #fff;
  padding: 18px;
  box-shadow: var(--shadow);
}

.trip-board::before {
  position: absolute;
  inset: 10px auto 10px 42%;
  width: 2px;
  content: "";
  background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0.58) 45%, transparent 0);
  background-size: 2px 13px;
}

.trip-board::after {
  position: absolute;
  right: -24px;
  top: -30px;
  width: 150px;
  height: 150px;
  border: 18px solid rgba(247, 212, 109, 0.48);
  border-radius: 50%;
  content: "";
}

.trip-copy {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 6px;
}

.trip-copy h3,
.trip-copy p {
  margin: 0;
}

.trip-copy .eyebrow {
  color: #ffe5a0;
}

.trip-copy h3 {
  font-size: clamp(22px, 2.6vw, 34px);
  line-height: 1.1;
}

.trip-copy p:last-child {
  max-width: 560px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 14px;
  line-height: 1.7;
}

.trip-steps {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 9px;
}

.trip-steps span {
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.92);
  font-size: 13px;
  font-weight: 800;
  padding: 6px 10px;
}

.trip-steps b {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #fffdf9;
  color: var(--accent-strong);
  font-size: 13px;
}

.share-tools {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 9px;
  min-width: 172px;
}

.share-tools span {
  display: block;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
  padding: 10px 12px;
}

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

.album-tabs {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 18px;
}

.album-tabs button {
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(20, 184, 166, 0.16);
  border-radius: 8px;
  color: var(--ink);
  display: grid;
  gap: 2px;
  min-height: 56px;
  padding: 8px 6px;
  text-align: center;
}

.album-tabs button.active {
  background: linear-gradient(135deg, #14b8c4, #087568);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 12px 22px rgba(13, 148, 136, 0.2);
}

.album-tabs strong {
  font-size: 0.88rem;
  line-height: 1.2;
}

.album-tabs span {
  color: inherit;
  font-size: 0.76rem;
  font-weight: 800;
  opacity: 0.78;
}

.album-share-card {
  align-items: center;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(20, 184, 166, 0.18);
  border-radius: 18px;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 18px;
  padding: 16px;
}

.album-share-card strong {
  display: block;
  font-size: 1rem;
}

.album-share-card span,
.dialog-status,
.join-hint {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.album-share-actions,
.join-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.share-album-dialog {
  border: 0;
  border-radius: 24px;
  max-width: min(92vw, 420px);
  padding: 0;
}

.share-album-panel {
  background: #fff;
  min-width: min(92vw, 380px);
  padding: 24px;
  position: relative;
}

.share-qr {
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 18px;
  display: block;
  height: 220px;
  margin: 14px auto;
  width: 220px;
}

.share-code {
  background: rgba(20, 184, 166, 0.1);
  border-radius: 14px;
  color: #0f766e;
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
  padding: 12px;
  text-align: center;
}

.share-url-input {
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 12px;
  box-sizing: border-box;
  font: inherit;
  margin-bottom: 14px;
  padding: 12px;
  width: 100%;
}

.join-landing {
  align-items: center;
  background: linear-gradient(135deg, #fff9ed, #e8fbf8, #fff1df);
  display: flex;
  min-height: 100vh;
  padding: 24px;
}

.join-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(20, 184, 166, 0.18);
  border-radius: 28px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.12);
  margin: auto;
  max-width: 460px;
  padding: 28px;
  text-align: center;
}

.join-logo {
  height: 76px;
  width: 76px;
}

.join-code {
  background: rgba(20, 184, 166, 0.12);
  border-radius: 18px;
  color: #0f766e;
  display: inline-block;
  font-size: 2rem;
  letter-spacing: 0.08em;
  margin: 16px 0;
  padding: 12px 18px;
}

.join-primary,
.join-secondary {
  border-radius: 999px;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  padding: 12px 16px;
  text-decoration: none;
}

.join-primary {
  background: linear-gradient(135deg, #14b8a6, #0f766e);
  color: #fff;
}

.join-secondary {
  background: rgba(20, 184, 166, 0.1);
  color: #0f766e;
}

.upload-card {
  display: grid;
  gap: 16px;
  border: 1px solid rgba(25, 124, 114, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(242, 248, 246, 0.84)),
    #fff;
  padding: 18px;
  box-shadow: var(--shadow);
}

.upload-toggle,
.all-photos-entry {
  width: 100%;
  min-height: 56px;
  border-radius: 8px;
}

.upload-toggle {
  margin-top: 2px;
}

.all-photos-entry {
  display: grid;
  place-items: center;
  gap: 3px;
  border: 1px solid rgba(25, 124, 114, 0.16);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(223, 242, 231, 0.68)),
    #fff;
  color: var(--ink);
  padding: 14px 16px;
  text-align: center;
  box-shadow: var(--soft-shadow);
}

.all-photos-entry strong {
  font-size: 18px;
}

.all-photos-entry span {
  color: var(--muted);
  font-size: 13px;
}

.my-photos-panel {
  display: grid;
}

.my-photos-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 76px;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 92px;
  border: 1px solid rgba(25, 124, 114, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(223, 242, 231, 0.74)),
    #fff;
  color: var(--ink);
  padding: 14px;
  text-align: left;
  box-shadow: var(--soft-shadow);
}

.my-photos-card:hover {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 1), rgba(213, 242, 235, 0.86)),
    #fff;
}

.my-photos-avatar,
.my-photos-cover {
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(145deg, #e7f7f4, #d9edf3);
  color: var(--accent-strong);
}

.my-photos-avatar {
  width: 58px;
  height: 58px;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 10px 22px rgba(28, 43, 52, 0.12);
}

.my-photos-avatar img,
.my-photos-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.my-photos-avatar .avatar-person {
  transform: scale(0.56);
}

.my-photos-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.my-photos-copy strong {
  font-size: 20px;
  line-height: 1.15;
}

.my-photos-copy small {
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.my-photos-cover {
  width: 76px;
  height: 64px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 900;
}

.my-photos-cover.empty {
  border: 1px dashed rgba(25, 124, 114, 0.24);
}

.my-photos-empty {
  min-height: 260px;
}

.upload-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(217, 230, 235, 0.85);
  padding-bottom: 14px;
}

.upload-intro h3,
.upload-intro p {
  margin: 0;
}

.upload-intro h3 {
  margin-top: 3px;
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.15;
}

.upload-intro > span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid rgba(25, 124, 114, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  padding: 0 12px;
  white-space: nowrap;
}

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

.dropzone {
  place-items: center;
  min-height: 180px;
  border: 2px dashed rgba(25, 124, 114, 0.34);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(248, 212, 109, 0.24)),
    #f7faf9;
  color: var(--ink);
  cursor: pointer;
  text-align: center;
  transition:
    border-color 0.16s ease,
    transform 0.16s ease,
    background 0.16s ease;
}

.dropzone:hover,
.dropzone:focus-within {
  border-color: var(--accent);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(223, 242, 231, 0.72)),
    #fff;
  transform: translateY(-1px);
}

.dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.dropzone span {
  font-size: clamp(22px, 2.4vw, 32px);
  font-weight: 900;
}

.dropzone small {
  color: var(--muted);
  max-width: 520px;
  line-height: 1.5;
}

.upload-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  flex-wrap: wrap;
}

#uploadStatus {
  border: 1px solid rgba(25, 124, 114, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  padding: 8px 11px;
}

.folders {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}

.album-section {
  display: grid;
  gap: 14px;
}

.section-heading {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.section-heading h3,
.section-heading p {
  margin: 0;
}

.section-heading h3 {
  font-size: clamp(22px, 2.5vw, 32px);
  line-height: 1.1;
}

.section-heading p {
  color: var(--muted);
  font-size: 13px;
}

.all-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.all-photo-grid.masonry {
  display: block;
  column-count: 3;
  column-gap: 12px;
}

.album-photo-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--soft-shadow);
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}

.all-photo-grid.masonry .album-photo-card {
  display: inline-block;
  width: 100%;
  margin: 0 0 12px;
  break-inside: avoid;
}

.album-photo-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.album-photo {
  display: grid;
  width: 100%;
  min-height: 100%;
  color: var(--ink);
  padding: 0;
  text-align: left;
}

.album-photo:hover {
  background: #fff;
  transform: none;
}

.album-photo img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  background: #dce5e8;
  transition: transform 0.22s ease;
}

.all-photo-grid.masonry .album-photo img {
  height: auto;
  aspect-ratio: auto;
}

.album-photo-card:hover .album-photo img {
  transform: scale(1.025);
}

.photo-media {
  position: relative;
  display: block;
  overflow: hidden;
  width: 100%;
  padding: 0;
}

.live-photo-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease;
}

.live-playing .live-photo-video {
  opacity: 1;
}

.live-photo-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  border-radius: 999px;
  background: rgba(17, 24, 28, 0.38);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.01em;
  line-height: 1;
  text-transform: uppercase;
  padding: 5px 7px 5px 6px;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 18px rgba(10, 16, 20, 0.16);
}

.live-photo-badge::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background:
    radial-gradient(circle, currentColor 0 2px, transparent 2.5px),
    radial-gradient(circle, transparent 0 4px, currentColor 4px 5px, transparent 5.5px),
    radial-gradient(circle, transparent 0 7px, currentColor 7px 8px, transparent 8.5px);
  transform: scale(0.94);
}

.live-playing .live-photo-badge,
.photo-viewer.live-playing .viewer-live-play {
  background: rgba(255, 255, 255, 0.86);
  color: #142028;
}

.live-photo-badge:hover {
  background: rgba(17, 24, 28, 0.72);
  transform: none;
}

.album-photo .photo-meta {
  display: grid;
  gap: 3px;
  padding: 9px 10px 11px;
}

.album-photo strong,
.album-photo small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.album-photo strong {
  font-size: 13px;
}

.album-photo small {
  color: var(--muted);
  font-size: 12px;
}

.download-photo-badge,
.delete-photo-badge {
  position: absolute;
  top: 8px;
  width: 34px;
  min-width: 34px;
  min-height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 18px rgba(108, 30, 34, 0.14);
  font-size: 12px;
  font-weight: 900;
  padding: 0;
  text-decoration: none;
}

.download-photo-badge {
  right: 48px;
  color: var(--accent-strong);
}

.delete-photo-badge {
  right: 8px;
  color: var(--danger);
}

.delete-photo-badge:hover {
  background: #fae9e8;
}

.all-photos-toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(14px);
}

.load-more-photos {
  width: 100%;
}

.photo-end {
  margin: 4px 0 0;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
  font-weight: 800;
}

.folder {
  position: relative;
  display: grid;
  gap: 0;
  align-content: start;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.94)),
    var(--panel);
  cursor: pointer;
  padding: 0;
  box-shadow: var(--soft-shadow);
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}

.folder:hover {
  border-color: #93b8b2;
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.folder:focus-visible {
  outline: 3px solid rgba(35, 124, 116, 0.28);
  outline-offset: 2px;
}

.folder-header {
  order: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-height: 82px;
  padding: 10px 10px 12px;
}

.folder-title {
  min-width: 0;
}

.folder-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}

.folder-actions .icon-button {
  width: 34px;
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 18px rgba(28, 43, 52, 0.12);
  font-size: 12px;
}

.folder-actions .danger {
  color: var(--danger);
}

.folder-actions .rename-folder {
  color: var(--accent-strong);
}

.folder h3 {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
  line-height: 1.15;
}

.folder p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.folder-cover {
  order: 1;
  position: relative;
  overflow: hidden;
  margin: 0;
  aspect-ratio: 1;
  border-radius: 0;
  background: #dce5e8;
}

.folder-cover::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, transparent 44%, rgba(23, 35, 42, 0.52));
  pointer-events: none;
}

.folder-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.24s ease;
}

.folder:hover .folder-cover img {
  transform: scale(1.025);
}

.folder-cover figcaption {
  display: none;
}

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

.folder-cover strong {
  font-size: 13px;
}

.folder-cover span {
  color: #d8e2e5;
  font-size: 11px;
}

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

.photo {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1;
  border-radius: 7px;
  background: #dce5e8;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

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

.photo span {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 6px;
  overflow: hidden;
  border-radius: 5px;
  background: rgba(23, 32, 38, 0.72);
  color: #fff;
  font-size: 11px;
  padding: 4px 6px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.open-folder {
  display: none;
  width: 100%;
  background: linear-gradient(135deg, #eef7f3, #fff8dc);
  color: var(--accent-strong);
  box-shadow: none;
}

.folder-detail {
  display: grid;
  gap: 18px;
}

.detail-toolbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  padding: 14px;
  box-shadow: var(--shadow);
}

.detail-title {
  min-width: 0;
}

.rename-row {
  display: grid;
  grid-template-columns: minmax(0, 320px) auto;
  gap: 8px;
  align-items: center;
}

.detail-title h3,
.detail-title p {
  margin: 0;
}

.detail-title h3 {
  overflow: hidden;
  font-size: 24px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-title p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.correction-panel {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 248, 230, 0.82));
  padding: 14px;
  box-shadow: var(--soft-shadow);
}

.correction-panel strong,
.correction-panel span {
  display: block;
}

.correction-panel strong {
  font-size: 14px;
}

.correction-panel span,
#correctionStatus {
  color: var(--muted);
  font-size: 12px;
}

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

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
}

.detail-grid.masonry {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.detail-photo-card {
  position: relative;
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--soft-shadow);
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}

.detail-grid.masonry .detail-photo-card {
  display: grid;
  width: 100%;
  margin: 0;
}

.detail-photo-card:hover {
  border-color: rgba(25, 124, 114, 0.42);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.detail-photo {
  position: relative;
  display: grid;
  overflow: hidden;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  padding: 0;
  text-align: left;
}

.detail-photo:hover {
  background: #fff;
  transform: none;
}

.detail-photo img {
  width: 100%;
  min-height: 180px;
  height: auto;
  object-fit: cover;
  display: block;
  background: #dce5e8;
  transition: transform 0.22s ease;
}

.detail-photo img:not([src]),
.detail-photo img[src=""] {
  aspect-ratio: 1;
}

.detail-photo-card:hover .detail-photo img {
  transform: scale(1.025);
}

.detail-photo .photo-meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  gap: 4px;
  background: linear-gradient(180deg, transparent, rgba(20, 28, 34, 0.76));
  color: #fff;
  padding: 34px 10px 10px;
}

.detail-photo strong,
.detail-photo small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-photo strong {
  font-size: 13px;
}

.detail-photo small {
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
}

.photo-menu-toggle {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  width: 34px;
  min-width: 34px;
  min-height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  box-shadow: 0 8px 18px rgba(28, 43, 52, 0.14);
  backdrop-filter: blur(14px);
  font-size: 15px;
  line-height: 1;
  padding: 0;
}

.photo-correction {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  z-index: 2;
  display: none;
  grid-template-columns: minmax(0, 1fr) repeat(3, 36px);
  gap: 6px;
  border-top: 0;
  padding: 0;
}

.detail-photo-card.menu-open .photo-correction {
  display: grid;
}

.detail-photo-card.menu-open .detail-photo .photo-meta {
  padding-bottom: 56px;
}

.photo-correction select {
  min-height: 36px;
  border-color: rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  padding: 0 28px 0 10px;
  backdrop-filter: blur(16px);
}

.photo-correction a {
  display: inline-grid;
  min-height: 36px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 900;
  text-decoration: none;
  backdrop-filter: blur(16px);
}

.photo-correction .icon-button {
  width: 36px;
  min-width: 36px;
  min-height: 36px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  font-size: 12px;
}

.photo-viewer {
  width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  border: 0;
  border-radius: 0;
  background: #101619;
  color: #fff;
  padding: 0;
}

.photo-viewer::backdrop {
  background: rgba(15, 22, 26, 0.72);
}

.viewer-media {
  position: relative;
  display: grid;
  align-items: start;
  height: calc(100dvh - 112px);
  background: #101619;
  padding-top: max(58px, env(safe-area-inset-top));
}

.photo-viewer img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
  object-fit: contain;
  object-position: center top;
  background: #101619;
}

.viewer-video {
  position: absolute;
  left: 0;
  right: 0;
  top: max(58px, env(safe-area-inset-top));
  bottom: 0;
  width: 100%;
  height: calc(100% - max(58px, env(safe-area-inset-top)));
  object-fit: contain;
  object-position: center top;
  background: #101619;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease;
}

.photo-viewer.live-playing .viewer-video {
  opacity: 1;
}

.photo-viewer.loading img {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.05)),
    #101619;
  background-size: 220% 100%;
  animation: viewer-loading 1.1s ease-in-out infinite;
}

@keyframes viewer-loading {
  from {
    background-position: 120% 0;
  }

  to {
    background-position: -120% 0;
  }
}

.viewer-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 42px;
  min-height: 42px;
  padding: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 26px;
  line-height: 1;
}

.viewer-live-play {
  position: absolute;
  left: 12px;
  top: calc(max(58px, env(safe-area-inset-top)) + 12px);
  z-index: 3;
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  padding: 0 12px;
  backdrop-filter: blur(12px);
}

.viewer-live-play:hover {
  background: rgba(255, 255, 255, 0.24);
  transform: none;
}

.viewer-download {
  position: absolute;
  top: 10px;
  z-index: 2;
  display: inline-grid;
  min-width: 42px;
  min-height: 42px;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
}

.viewer-download {
  right: 60px;
}

.viewer-delete {
  position: absolute;
  top: 10px;
  right: 110px;
  z-index: 2;
  width: 42px;
  min-width: 42px;
  min-height: 42px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  padding: 0;
}

.viewer-meta {
  display: none;
}

.viewer-filmstrip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  min-height: 70px;
  padding: 8px 18px calc(10px + env(safe-area-inset-bottom));
  background: #101619;
  scrollbar-width: none;
}

.viewer-filmstrip::-webkit-scrollbar {
  display: none;
}

.viewer-thumb {
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  min-width: 54px;
  min-height: 54px;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.14);
  padding: 0;
}

.viewer-thumb.active {
  border-color: #fff;
}

.viewer-thumb img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
}

@media (max-width: 860px) {
  .shell {
    align-content: start;
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 14px;
    backdrop-filter: blur(16px);
    background:
      linear-gradient(180deg, rgba(255, 253, 249, 0.96), rgba(255, 253, 249, 0.88)),
      linear-gradient(135deg, rgba(223, 242, 231, 0.72), rgba(255, 255, 255, 0));
  }

  .subalbum-mode {
    padding-bottom: 10px;
  }

  .album-mode .brand,
  .subalbum-mode .brand,
  .subalbum-mode .album-context,
  .subalbum-mode .new-album {
    display: none;
  }

  .album-mode .album-context,
  .subalbum-mode .subalbum-context {
    display: block;
    margin-bottom: 10px;
  }

  .album-mode .album-context button,
  .subalbum-mode .subalbum-context button {
    min-height: 38px;
    border-radius: 999px;
    padding: 0 13px;
  }

  .album-context strong,
  .album-context span,
  .subalbum-context strong,
  .subalbum-context span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .album-context strong,
  .subalbum-context strong {
    color: var(--ink);
    font-size: 18px;
    line-height: 1.1;
  }

  .album-context span,
  .subalbum-context span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
  }

  .workspace {
    padding: 16px 14px 112px;
  }

  .topbar,
  .upload-actions,
  .upload-intro {
    align-items: stretch;
    flex-direction: column;
  }

  .trip-board {
    grid-template-columns: 1fr;
  }

  .trip-board::before {
    inset: auto 18px 116px;
    width: auto;
    height: 2px;
    background-image: linear-gradient(to right, rgba(255, 255, 255, 0.58) 45%, transparent 0);
    background-size: 13px 2px;
  }

  .trip-steps {
    grid-template-columns: 1fr;
  }

  .upload-intro > span {
    width: fit-content;
    white-space: normal;
  }

  .stats {
    justify-content: flex-start;
  }

  .form-grid,
  .inline,
  .detail-toolbar,
  .correction-panel,
  .rename-row {
    grid-template-columns: 1fr;
  }

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

  .photo-correction {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  button,
  input,
  select {
    font-size: 16px;
  }

  .auth-view {
    align-items: stretch;
    padding: 0;
  }

  .auth-card {
    width: 100%;
    min-height: 100vh;
    border: 0;
    border-radius: 0;
    padding: calc(28px + env(safe-area-inset-top)) 28px calc(28px + env(safe-area-inset-bottom));
    box-shadow: none;
  }

  .auth-register-card {
    padding-top: calc(64px + env(safe-area-inset-top));
  }

  .auth-brand {
    margin: 0 0 54px;
  }

  .brand-mark.auth-brand-mark {
    width: 160px;
    height: 160px;
    border: 0;
    border-radius: 0;
    background-color: transparent;
    box-shadow: none;
    font-size: inherit;
  }

  .auth-switch {
    margin-top: 72px;
  }

  .auth-field input {
    min-height: 60px;
  }

  button,
  input,
  select {
    min-height: 48px;
  }

  button {
    padding: 0 14px;
  }

  .brand {
    gap: 10px;
    margin-bottom: 12px;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
    font-size: 14px;
  }

  .brand h1 {
    font-size: 20px;
  }

  .brand p {
    font-size: 12px;
  }

  .new-album {
    gap: 8px;
    margin-bottom: 12px;
    padding: 10px;
  }

  .new-album label {
    font-size: 12px;
  }

  .inline {
    grid-template-columns: minmax(0, 1fr) 72px;
  }

  .album-list {
    display: flex;
    gap: 10px;
    margin: 0 -14px;
    overflow-x: auto;
    padding: 0 14px 4px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

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

  .album-item {
    flex: 0 0 196px;
    min-height: 58px;
    padding: 10px 11px;
    scroll-snap-align: start;
  }

  .subalbum-item {
    flex-basis: 150px;
    min-height: 54px;
    padding: 8px 10px;
  }

  .album-delete {
    padding: 0 9px;
  }

  .album-item.active {
    box-shadow: inset 0 -4px 0 var(--accent), var(--soft-shadow);
  }

  .topbar {
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
  }

  .topbar h2 {
    font-size: 30px;
  }

  .stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }

  .stat {
    display: grid;
    place-items: center;
    min-height: 42px;
    padding: 7px 6px;
    text-align: center;
    font-size: 12px;
    line-height: 1.25;
  }

  .empty {
    min-height: 340px;
    padding: 22px 18px;
  }

  .empty h3 {
    font-size: 24px;
    line-height: 1.15;
  }

  .empty p {
    font-size: 14px;
  }

  .album-panel {
    gap: 16px;
  }

  .home-albums {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .home-album-card {
    min-height: 168px;
  }

  .home-album-open {
    min-height: 168px;
  }

  .home-album-faces {
    min-height: 100px;
    padding: 14px 14px 2px;
  }

  .home-album-meta strong {
    font-size: 24px;
  }

  .trip-board {
    gap: 14px;
    padding: 16px;
  }

  .trip-board::before {
    display: none;
  }

  .trip-board::after {
    right: -46px;
    top: -48px;
    width: 132px;
    height: 132px;
  }

  .trip-copy h3 {
    font-size: 26px;
  }

  .trip-copy p:last-child {
    font-size: 13px;
    line-height: 1.6;
  }

  .trip-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }

  .trip-steps span {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    min-height: 86px;
    gap: 6px;
    padding: 9px 6px;
    text-align: center;
    font-size: 12px;
    line-height: 1.25;
  }

  .trip-steps b {
    width: 28px;
    height: 28px;
  }

  .share-tools {
    min-width: 0;
  }

  .upload-card {
    gap: 14px;
    padding: 16px;
  }

  .upload-toggle,
  .all-photos-entry,
  .my-photos-card {
    min-height: 54px;
  }

  .my-photos-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .my-photos-cover {
    display: none;
  }

  .upload-intro {
    gap: 10px;
    padding-bottom: 12px;
  }

  .upload-intro h3 {
    font-size: 24px;
  }

  .upload-intro > span {
    min-height: 30px;
    font-size: 12px;
  }

  .form-grid {
    gap: 10px;
  }

  .dropzone {
    min-height: 142px;
    padding: 18px;
  }

  .dropzone span {
    font-size: 24px;
    line-height: 1.15;
  }

  .dropzone small {
    font-size: 13px;
  }

  .upload-actions {
    position: sticky;
    bottom: 0;
    z-index: 15;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin: 0 -16px -16px;
    border-top: 1px solid rgba(217, 230, 235, 0.82);
    background: rgba(255, 253, 249, 0.94);
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    backdrop-filter: blur(16px);
  }

  .upload-actions button {
    width: 100%;
  }

  #uploadStatus {
    display: block;
    border-radius: 7px;
    text-align: center;
    line-height: 1.4;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .section-heading h3 {
    font-size: 26px;
  }

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

  .folder {
    gap: 0;
    padding: 0;
  }

  .folder-header {
    min-height: 76px;
    padding: 9px;
  }

  .folder-actions {
    gap: 6px;
  }

  .folder-actions button {
    min-height: 40px;
    font-size: 14px;
  }

  .folder-actions .icon-button {
    width: 32px;
    min-width: 32px;
    min-height: 32px;
    padding: 0;
  }

  .folder-cover {
    aspect-ratio: 1;
  }

  .thumbs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
  }

  .open-folder {
    min-height: 48px;
  }

  .all-photo-grid,
  .detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .all-photo-grid.masonry,
  .detail-grid.masonry {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .all-photo-grid.masonry .album-photo-card,
  .detail-grid.masonry .detail-photo-card {
    margin-bottom: 8px;
  }

  .album-photo .photo-meta {
    padding: 8px;
  }

  .detail-photo .photo-meta {
    padding: 30px 8px 8px;
  }

  .album-photo strong,
  .detail-photo strong {
    font-size: 12px;
  }

  .album-photo small,
  .detail-photo small {
    font-size: 11px;
  }

  .download-photo-badge,
  .delete-photo-badge {
    width: 32px;
    min-width: 32px;
    min-height: 32px;
    padding: 0;
    font-size: 12px;
  }

  .download-photo-badge {
    right: 44px;
  }

  .photo-correction {
    left: 6px;
    right: 6px;
    bottom: 6px;
    grid-template-columns: minmax(0, 1fr) repeat(3, 34px);
    gap: 5px;
  }

  .detail-photo-card.menu-open .detail-photo .photo-meta {
    padding-bottom: 52px;
  }

  .photo-correction .icon-button {
    width: 34px;
    min-width: 34px;
    min-height: 34px;
    padding: 0;
  }

  .photo-correction select {
    min-height: 34px;
    font-size: 12px;
  }

  .photo-correction a {
    min-height: 34px;
    font-size: 10px;
  }

  .detail-toolbar {
    gap: 10px;
    padding: 12px;
  }

  .detail-toolbar > a,
  .detail-toolbar > a button,
  #deleteCurrentFolder,
  #backToFolders {
    width: 100%;
  }

  .detail-title h3 {
    font-size: 22px;
  }

  .correction-panel {
    padding: 12px;
  }

  .detail-photo img {
    aspect-ratio: 1;
  }

  .photo-viewer {
    width: 100vw;
    max-height: 100vh;
    border-radius: 0;
  }

  .photo-viewer img {
    max-height: none;
  }

  .viewer-meta {
    display: none;
  }
}

.photo-library-grid {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  gap: 0;
  touch-action: pan-y;
}

.icloud-selection-toolbar {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  padding: 10px 0;
  background: linear-gradient(180deg, rgba(250, 252, 247, 0.96), rgba(250, 252, 247, 0.76));
  backdrop-filter: blur(16px);
}

.icloud-selection-toolbar button {
  min-height: 38px;
  border-radius: 999px;
}

.photo-library-grid.is-pinching {
  touch-action: none;
}

.photo-library-grid .photo-library-tile {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  margin: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #dce5e8;
  box-shadow: none;
}

.photo-library-grid .photo-library-tile.selection-mode::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: rgba(0, 0, 0, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.photo-library-grid .photo-library-tile.selection-mode.is-selected::after {
  opacity: 1;
}

.photo-library-grid:not(.is-pinching),
.photo-library-grid:not(.is-pinching) .photo-library-tile {
  transition:
    height 0.22s cubic-bezier(0.2, 0.8, 0.2, 1),
    width 0.22s cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.photo-library-grid.is-pinching,
.photo-library-grid.is-pinching .photo-library-tile {
  transition: none;
}

.photo-library-grid .photo-library-button {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.photo-selection-check {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 4;
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: transparent;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
  opacity: 0;
  transform: scale(0.88);
  transition:
    opacity 0.15s ease,
    transform 0.15s ease,
    background 0.15s ease,
    color 0.15s ease;
}

.photo-library-tile.selection-mode .photo-selection-check {
  opacity: 1;
}

.photo-library-tile.is-selected .photo-selection-check {
  background: #1677ff;
  color: #fff;
  transform: scale(1);
}

.photo-library-tile.selection-mode .photo-menu-toggle,
.photo-library-tile.selection-mode .photo-correction {
  display: none !important;
}

.photo-library-grid .photo-library-button:hover,
.photo-library-grid .photo-library-button:active {
  background: transparent;
  box-shadow: none;
  transform: none;
}

.photo-library-grid .photo-media,
.photo-library-grid .photo-media img,
.photo-library-grid .photo-library-button img {
  width: 100%;
  height: 100%;
  min-height: 0;
  aspect-ratio: auto;
  object-fit: cover;
  display: block;
}

.photo-library-grid .photo-library-tile:hover,
.photo-library-grid .photo-library-tile:hover .photo-library-button img {
  border-color: transparent;
  box-shadow: none;
  transform: none;
}

.photo-library-grid .photo-library-meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  gap: 4px;
  background: linear-gradient(180deg, transparent, rgba(12, 19, 24, 0.72));
  color: #fff;
  padding: 34px 9px 9px;
}

.photo-library-grid .photo-library-meta strong {
  font-size: 13px;
}

.photo-library-grid .photo-library-meta small {
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
}

.photo-library-grid.compact-grid .photo-library-meta {
  display: none;
}

.photo-library-grid .photo-correction {
  left: auto;
  right: 7px;
  bottom: 7px;
  display: none;
  grid-template-columns: repeat(2, 36px);
  width: max-content;
}

.photo-library-grid .photo-library-tile.has-move .photo-correction {
  left: 7px;
  right: 7px;
  grid-template-columns: minmax(0, 1fr) repeat(3, 36px);
  width: auto;
}

.photo-library-grid .photo-library-tile.menu-open .photo-correction {
  display: grid;
}

.photo-library-grid.compact-grid .photo-menu-toggle {
  width: 28px;
  min-width: 28px;
  min-height: 28px;
  font-size: 13px;
}

.photo-library-grid.compact-grid .photo-correction {
  right: 4px;
  bottom: 4px;
  grid-template-columns: repeat(2, 30px);
}

.photo-library-grid.compact-grid .photo-library-tile.has-move .photo-correction {
  left: 4px;
  grid-template-columns: minmax(0, 1fr) repeat(3, 30px);
}

.photo-library-grid.compact-grid .photo-correction a,
.photo-library-grid.compact-grid .photo-correction .icon-button {
  width: 30px;
  min-width: 30px;
  min-height: 30px;
}

.icloud-selection-bar {
  position: sticky;
  bottom: 0;
  z-index: 9;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  margin-top: 12px;
  padding: 10px 76px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(210, 225, 231, 0.9);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  backdrop-filter: blur(18px);
}

.icloud-selection-bar strong {
  font-size: 17px;
}

.selection-actions {
  position: absolute;
  right: 12px;
  display: flex;
  gap: 8px;
}

.selection-actions button {
  display: grid;
  width: 42px;
  min-width: 42px;
  min-height: 42px;
  place-items: center;
  border-radius: 14px;
  padding: 0;
}

.selection-sheet {
  position: absolute;
  right: 12px;
  bottom: calc(70px + env(safe-area-inset-bottom));
  display: grid;
  min-width: min(310px, calc(100vw - 28px));
  overflow: hidden;
  border: 1px solid rgba(210, 225, 231, 0.9);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 22px 50px rgba(35, 45, 52, 0.18);
  backdrop-filter: blur(18px);
}

.selection-sheet button {
  justify-content: start;
  min-height: 54px;
  border-radius: 0;
  background: transparent;
  color: var(--accent-strong);
  box-shadow: none;
  padding: 0 22px;
  text-align: left;
}

.selection-sheet button + button {
  border-top: 1px solid rgba(210, 225, 231, 0.78);
}
