.crop-workspace { overflow:hidden; padding:32px; background:#d6dce0; border-radius:16px; }
.crop-window { position:relative; margin:auto; touch-action:none; cursor:grab; }
.crop-window img { position:absolute; max-width:none; user-select:none; pointer-events:none; }
.crop-mask { position:absolute; inset:0; border:2px solid white; box-shadow:0 0 0 2000px #657079aa; pointer-events:none; }
.crop-window:focus-visible { outline:3px solid var(--accent); outline-offset:4px; }
#cropDialog .dialog-panel { overflow:hidden; }
.text-color-preview { padding:18px; border-radius:14px; margin:8px 0 18px; background:#E8F2EF; }
.card-interest[style*="--text-ink"] .card-content,
.card-interest[style*="--text-ink"] .card-content p,
.card-interest[style*="--text-ink"] .card-kicker { color:var(--text-ink); }
.card-interest[style*="--text-ink:#FFFFFF"] .interest-icon-image { filter:invert(1); }
input[type="file"] { box-sizing:border-box; width:100%; min-width:0; padding:10px 12px; line-height:32px; overflow:hidden; }
input[type="file"]::file-selector-button { padding:6px 12px; margin:0 12px 0 0; border:1px solid #c9d4d8; border-radius:8px; background:white; font:inherit; line-height:20px; vertical-align:middle; }
.stage .card-social.card-half .card-content,
.stage[data-preview="mobile"] .card-social.card-half .card-content { display:flex; flex-direction:row; align-items:center; justify-content:flex-start; height:100%; box-sizing:border-box; gap:10px; padding:8px 38px 8px 14px; }
.card-social.card-half .card-icon { flex:0 0 28px; width:28px; height:28px; margin:0; }
.card-social.card-half .card-content > span:not(.card-icon):not(.card-arrow) { min-width:0; }
.card-social.card-half .card-kicker,.card-social.card-half .card-content p { display:none; }
.card-social.card-half h3 { font-size:14px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.stage .card-social.card-half .card-content h3 { margin:0; line-height:1.3; }
.card-social.card-half .card-arrow { top:50%; bottom:auto; transform:translateY(-50%); right:12px; }
.card-controls [data-manage-album] { right:45px; }
#albumThumbnails { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin:16px 0; }
#albumThumbnails button { min-width:0; padding:8px; border:2px solid transparent; border-radius:12px; background:#eef3f5; }
#albumThumbnails button[aria-pressed="true"] { border-color:var(--accent); }
#albumThumbnails img { display:block; width:100%; height:110px; object-fit:cover; border-radius:8px; }
#albumThumbnails span { display:block; padding:8px; }
#albumAddCategory { margin-top:10px; }
.visitor-preview .prototype-bar,
.visitor-preview .profile-footer,
.visitor-preview [data-editor-only],
.visitor-preview .edit-hint,
.visitor-preview .add-card { display:none !important; }
.album-item { min-width:0; }
.album-item > button { width:100%; }
.album-item-actions { display:flex; flex-wrap:wrap; gap:4px; margin-top:6px; }
#albumThumbnails .album-item-actions button { flex:1; min-height:44px; padding:4px; font-size:12px; }
#albumThumbnails button:disabled { opacity:.4; cursor:default; }
:root {
  color-scheme: light;
  --ink: #1c2a32;
  --muted: #65747d;
  --surface: rgba(255, 255, 255, 0.64);
  --surface-strong: rgba(255, 255, 255, 0.82);
  --line: rgba(45, 65, 76, 0.12);
  --shadow: 0 24px 70px rgba(32, 56, 67, 0.14);
  --accent: #254f5b;
  --accent-soft: #d7ebee;
  --amber: #dd8e4c;
  --radius-xl: 42px;
  --radius-lg: 28px;
  --radius-md: 20px;
  --gap: 14px;
  --row: 128px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  background: #dfe8ed;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 10%, rgba(255, 255, 255, 0.96), transparent 34rem),
    linear-gradient(145deg, #eaf0f3 0%, #dce7ea 48%, #cddde1 100%);
  overflow-x: hidden;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(41, 105, 122, 0.35);
  outline-offset: 3px;
}

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(10px);
  pointer-events: none;
}

.ambient-one {
  top: 10%;
  right: -8rem;
  width: 28rem;
  height: 28rem;
  background: rgba(118, 178, 187, 0.28);
}

.ambient-two {
  bottom: -8rem;
  left: -5rem;
  width: 24rem;
  height: 24rem;
  background: rgba(232, 171, 109, 0.22);
}

.prototype-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 68px;
  padding: 12px clamp(16px, 4vw, 48px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.56);
  background: rgba(237, 244, 246, 0.72);
  backdrop-filter: blur(22px) saturate(130%);
  -webkit-backdrop-filter: blur(22px) saturate(130%);
}

.prototype-brand,
.prototype-actions,
.view-switch,
.dialog-actions {
  display: flex;
  align-items: center;
}

.prototype-brand {
  gap: 10px;
  color: #40525c;
  font-size: 0.875rem;
  font-weight: 720;
  letter-spacing: 0.02em;
}

.prototype-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 5px rgba(221, 142, 76, 0.14);
}

.prototype-actions {
  gap: 10px;
}

.view-switch {
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
}

.view-button,
.button,
.icon-button,
.add-card,
.album-tab {
  border: 0;
  cursor: pointer;
}

.view-button {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 650;
}

.view-button.is-active {
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  box-shadow: 0 2px 10px rgba(37, 60, 70, 0.08);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  white-space: nowrap;
  min-height: 40px;
  padding: 0 17px;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 700;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 8px 18px rgba(37, 79, 91, 0.2);
}

.button-ghost {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
}

.save-banner {
  position: fixed;
  top: 82px;
  left: 50%;
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 30px rgba(25, 47, 58, 0.13);
  color: #40545d;
  font-size: 0.8125rem;
  font-weight: 650;
  transform: translateX(-50%);
  backdrop-filter: blur(20px);
}

.save-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3f8f79;
}

.stage {
  width: 100%;
  padding: clamp(24px, 6vw, 72px) 20px 88px;
  transition: padding 240ms ease;
}

.profile-shell {
  width: min(100%, 850px);
  min-height: 720px;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 54px);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: var(--radius-xl);
  background: rgba(247, 250, 251, 0.62);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(28px) saturate(122%);
  -webkit-backdrop-filter: blur(28px) saturate(122%);
  transition: width 280ms ease, padding 280ms ease, border-radius 280ms ease;
}

.profile-intro {
  position: relative;
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  max-width: 670px;
  margin-bottom: 38px;
}

.avatar {
  overflow: hidden;
  display: grid;
  place-items: center;
  width: 82px;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.84);
  border-radius: 50%;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.66), rgba(255, 255, 255, 0.12)),
    linear-gradient(145deg, #8bbbc2, #efd2a6);
  box-shadow: 0 12px 24px rgba(50, 87, 96, 0.15);
  color: rgba(31, 53, 61, 0.84);
  font-size: 1.45rem;
  font-weight: 800;
}

.eyebrow {
  margin: 0 0 7px;
  color: #63757d;
  font-size: 0.75rem;
  font-weight: 760;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  letter-spacing: -0.035em;
}

.intro-copy {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-width: 520px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
}

.intro-edit {
  position: absolute;
  top: 0;
  right: 0;
}

.edit-hint {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px dashed rgba(37, 79, 91, 0.26);
  border-radius: 16px;
  background: rgba(215, 235, 238, 0.42);
  color: #4d626b;
  font-size: 0.8125rem;
  line-height: 1.4;
}

.card-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-flow: dense;
  grid-auto-rows: var(--row);
  gap: var(--gap);
}

.card {
  position: relative;
  isolation: isolate;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: 0 11px 28px rgba(37, 62, 72, 0.09), inset 0 1px 0 rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px) saturate(120%);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.card.card-heading,
.card.card-heading:not(.is-editing):hover {
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transform: none;
  display: flex;
  align-items: flex-end;
  padding: 24px 0 8px;
}
.card.card-heading::after { display: none; }
.section-heading { margin: 0; font-size: clamp(18px, 2.2vw, 24px); line-height: 1.35; overflow-wrap: anywhere; }
.card-heading.is-editing .section-heading { padding-right: 84px; }

/* Avoid nested, viewport-sized blur surfaces on desktop photo-heavy pages. */
@media (min-width: 701px) {
  .profile-shell, .prototype-bar, .card {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .prototype-bar { background: rgba(237, 244, 246, .97); }
}

.media-library-item { display:flex; align-items:center; gap:12px; flex-wrap:wrap; border-bottom:1px solid var(--line); padding:12px 0; }
.media-library-item img { width:84px; height:84px; object-fit:contain; border-radius:8px; }
.media-library-item p { flex:1; min-width:120px; font-size:14px; }

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.3), transparent 52%);
  pointer-events: none;
}

.card:not(.is-editing):hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 36px rgba(37, 62, 72, 0.13), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.card.is-editing {
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.card.is-editing .card-content { cursor: grab; }
.card.drag-ready { transform: translateY(-3px); box-shadow: 0 18px 40px #16354144; }

.profile-intro h1 { margin-left: 0; padding: 0; letter-spacing: 0; line-height: 1.2; }
.profile-intro > div:not(.avatar) { min-width: 0; padding-right: 36px; }
.profile-intro h1 { overflow-wrap: anywhere; }
.profile-intro .intro-copy { margin-left: 0; padding: 0; }
.resize-handle { touch-action: none; user-select: none; }
.card .resize-handle { position: absolute; right: 0; bottom: 0; width: 44px; height: 44px; padding: 0; border: 0; cursor: nwse-resize; background: transparent; color: var(--accent); z-index: 12; box-shadow: none; border-radius: 0; }
.resize-handle::after { content: ''; position: absolute; right: 5px; bottom: 5px; width: 21px; height: 21px; border-right: 5px solid currentColor; border-bottom: 5px solid currentColor; border-bottom-right-radius: 19px; filter: drop-shadow(0 0 2px white); }
.card.is-editing .card-control, .card.is-editing .resize-handle, .card.is-editing .size-badge { opacity: 0; pointer-events: none; transition: opacity 120ms ease; }
.card.is-editing:is(.is-selected, :focus-within) .card-control, .card.is-editing:is(.is-selected, :focus-within) .resize-handle, .card.is-editing:is(.is-selected, :focus-within) .size-badge { opacity: 1; pointer-events: auto; }
@media (hover: hover) {
  .card.is-editing:hover .card-control, .card.is-editing:hover .resize-handle, .card.is-editing:hover .size-badge { opacity: 1; pointer-events: auto; }
}
.card-controls { display: contents !important; }
.card-controls .card-control { position: absolute; top: 9px; z-index: 12; }
.card-controls [data-delete] { right: 9px; }
.card-controls [data-crop-photo] { top:9px; left:9px; }
.card-controls [data-edit-card] { right: 45px; }
.card [data-edit-card] .ui-icon { position: static; width: 18px; height: 18px; object-fit: contain; }
.card-controls [data-drag] { right: 45px; cursor: grab; }
.card-controls [data-move] { right: 81px; }
.card .size-badge { right: 50px; }
.drop-preview { position: absolute; pointer-events: none; border: 2px dashed var(--accent); background: #9bc4ca55; border-radius: 18px; z-index: 20; }
.card.gesture-ghost { position: fixed; margin: 0; z-index: 1000; pointer-events: none; transition: none; opacity: .96; box-shadow: 0 18px 45px #16354144; will-change: transform, width, height; }
.gesture-ghost .card-controls, .gesture-ghost .size-badge { display: none !important; }
.card.gesture-placeholder { opacity: .25; outline: 2px dashed var(--accent); }

.card.is-editing:active {
  cursor: grabbing;
}

.card.is-dragging {
  opacity: 0.42;
  transform: scale(0.98);
}

.card.is-drop-target {
  box-shadow: 0 0 0 3px rgba(37, 79, 91, 0.22), 0 18px 36px rgba(37, 62, 72, 0.13);
}

.card-content {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 100%;
  height: 100%;
  padding: 18px;
  color: inherit;
  text-align: left;
}

button.card-content {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.card-kicker {
  color: rgba(27, 49, 58, 0.62);
  font-size: 0.7rem;
  font-weight: 760;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card h3 {
  max-width: 14ch;
  margin: 5px 0 5px;
  font-size: clamp(1rem, 2vw, 1.3rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.card p {
  margin-bottom: 0;
  color: rgba(33, 54, 63, 0.68);
  font-size: 0.78rem;
  line-height: 1.45;
}

.card-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 5px 13px rgba(41, 65, 74, 0.09);
  font-size: 0.92rem;
  font-weight: 800;
}

.card-arrow {
  position: absolute;
  right: 16px;
  bottom: 16px;
  line-height: 1;
  font-size: 1.25rem;
}
.card-spotify { background: linear-gradient(135deg,#e3f3e9dd,#c6e8d4aa); }
.spotify-content { position:relative; height:100%; padding:0; min-width:0; }
.spotify-cover-button { position:relative; display:block; width:100%; height:100%; min-height:0; min-width:0; border:0; border-radius:inherit; padding:0; background:var(--surface); cursor:pointer; overflow:hidden; }
.spotify-artwork { display:block; width:100%; height:100%; }
.card .spotify-artwork .spotify-cover { position:static; width:100%; height:100%; object-fit:cover; }
.card .spotify-artwork .spotify-cover-placeholder { position:static; width:100%; height:100%; padding:12px; object-fit:contain; opacity:.35; }
.spotify-cover-button:focus-visible { outline:3px solid var(--accent); outline-offset:-3px; }
.spotify-caption { position:absolute; bottom:0; left:0; right:0; display:flex; align-items:center; flex-wrap:wrap; gap:0 8px; min-width:0; padding:32px 14px 12px; background:linear-gradient(transparent,rgba(12,23,35,.92)); color:#fff; pointer-events:none; }
.spotify-caption a { pointer-events:auto; }
.card-spotify.is-editing .spotify-content { padding:0; }
.spotify-caption h3 { flex:1 1 60px; min-width:0; margin:0; font-size:14px; line-height:20px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.spotify-caption .spotify-link { flex:0 0 auto; font-size:11px; color:#254f3a; line-height:24px; }
.spotify-compact { display:flex; align-items:center; gap:8px; height:100%; min-width:0; padding:10px 14px; }
.spotify-compact-text { flex:1; min-width:0; }
.card .spotify-compact h3 { margin:0; font-size:14px; line-height:20px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.spotify-compact .spotify-link { font-size:11px; line-height:18px; color:var(--accent); }
.spotify-play { flex:none; width:36px; height:36px; padding:0; border:0; border-radius:50%; background:var(--ink); color:var(--surface); cursor:pointer; }
.card-spotify.is-editing .spotify-compact { padding-top:30px; padding-bottom:4px; }
.ui-icon { display: block; width: 24px; height: 24px; object-fit: contain; }
.upload-preview { display:block; width:100%; height:180px; object-fit:contain; background:#e6edef; border-radius:12px; margin:12px 0; }
.photo-fields p { font-size:14px; line-height:1.5; }
.photo-fields select { width:100%; padding:12px; border:1px solid var(--line); border-radius:12px; background:white; color:var(--text); font:inherit; }
.type-option > span { pointer-events: none; }
.card .card-icon .interest-icon-image { position: static; width: 24px; height: 24px; object-fit: contain; border-radius: 0; }
.card-interest .card-icon { flex: 0 0 24px; width: 24px; height: 24px; place-items: start; background: none; box-shadow: none; }
.card-interest { container-type: size; }
.card-interest .card-content { padding: 16px; justify-content: flex-start; gap: 6px; min-height: 0; }
.card-interest .card-content > span:last-child { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; width: 100%; }
.card-interest .card-content h3 { flex-shrink: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 3px 0; line-height: 1.3; }
.card-interest .card-kicker { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex-shrink: 0; }
.card-photo .card-content { justify-content: flex-end; }
@container (max-height: 160px) {
  .card-interest .card-content { padding: 12px 16px; gap: 4px; }
  .card-interest .card-kicker { display: none; }
  .card-interest .card-content p { -webkit-line-clamp: 1 !important; flex-shrink: 0; line-height: 1.4; }
}
.card .card-icon .social-icon-image { position: static; width: 28px; height: 28px; object-fit: contain; border-radius: 0; }
.card-social { container-type: size; }
.card-social .card-content { padding: 16px 16px 40px; gap: 6px; justify-content: flex-start; overflow: hidden; }
.card-social .card-content > span:not(.card-icon):not(.card-arrow) { min-width: 0; width: 100%; overflow: hidden; }
.card-social .card-content h3, .card-social .card-content p, .card-social .card-kicker { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.card-social .card-icon { flex: 0 0 28px; width: 28px; height: 28px; background: none; box-shadow: none; }
.social-logo { display: block; width: 40px; height: 40px; background-image: url('./assets/social-sheet.png'); background-repeat: no-repeat; transform: scale(.7); }
.card-interest .card-content p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
@container (max-height: 160px) {
  .card-social .card-kicker { display: none; }
  .card-social .card-content { gap: 4px; padding-top: 12px; }
  .card-social .card-content h3 { margin: 0; line-height: 1.3; }
  .card-social .card-content p { margin: 2px 0 0; line-height: 1.3; }
}









.card-social[data-platform="instagram"] {
  background: linear-gradient(145deg, rgba(247, 221, 229, 0.75), rgba(241, 202, 215, 0.48));
}

.card-social[data-platform="facebook"] {
  background: linear-gradient(145deg, rgba(217, 230, 247, 0.78), rgba(197, 218, 242, 0.5));
}

.card-social[data-platform="twitter"] {
  background: linear-gradient(145deg, rgba(224, 232, 236, 0.8), rgba(203, 217, 224, 0.54));
}

.card-social[data-platform="youtube"] {
  background: linear-gradient(145deg, rgba(249, 224, 218, 0.76), rgba(242, 201, 193, 0.48));
}

.card-interest {
  background: linear-gradient(145deg, rgba(222, 239, 229, 0.8), rgba(205, 231, 219, 0.5));
}

.card-photo,
.card-album {
  background: #26373e;
  color: white;
}

.card-photo img,
.card-album img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-photo.photo-no-caption::before,
.card-photo.photo-no-caption::after { display: none; }
.card-photo.photo-no-caption .card-content { display: none; }
.card-photo,
.card-album { backdrop-filter: none; -webkit-backdrop-filter: none; }

.card-album::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(11, 24, 29, 0.04), rgba(11, 24, 29, 0.74));
}

.card-photo::before, .card-photo::after { display:none; }
.stage .card.card-photo .card-content {
  position:absolute; inset:auto 0 0; height:auto; padding:14px;
  isolation:isolate; text-shadow:0 1px 3px rgba(0,0,0,.35);
}
.card-photo .card-content::before {
  content:""; position:absolute; inset:-22px 0 0; z-index:-1;
  background:linear-gradient(to bottom,transparent,rgba(0,0,0,.4));
  pointer-events:none;
}
.card-photo .card-content > span { display:flex; flex-direction:column; gap:6px; min-width:0; }
.card-photo .card-content h3, .card-photo .card-content p { margin:0; }
.photo-card-link { position:absolute; inset:0; z-index:2; border-radius:inherit; }
.photo-card-link:focus-visible { outline:3px solid var(--accent); outline-offset:-4px; }

.card-photo .card-kicker,
.card-album .card-kicker,
.card-photo p,
.card-album p {
  color: rgba(255, 255, 255, 0.78);
}

.card-album .card-content {
  justify-content: flex-end;
}

.card-album h3 {
  max-width: none;
}

.card-controls {
  position: absolute;
  top: 9px;
  right: 9px;
  z-index: 5;
  display: flex;
  gap: 5px;
}

.card-control {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 10px;
  background: rgba(250, 252, 252, 0.88);
  box-shadow: 0 5px 12px rgba(26, 43, 49, 0.12);
  color: #304750;
  cursor: pointer;
  backdrop-filter: blur(12px);
}

.size-badge {
  position: absolute;
  right: 11px;
  bottom: 10px;
  z-index: 4;
  padding: 4px 7px;
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 8px;
  background: rgba(250, 252, 252, 0.84);
  color: #46606a;
  font-size: 0.66rem;
  font-weight: 800;
  backdrop-filter: blur(10px);
}

.add-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 54px;
  margin-top: 14px;
  border: 1px dashed rgba(37, 79, 91, 0.35);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.36);
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 760;
}

.add-card:hover {
  background: rgba(255, 255, 255, 0.62);
}

.profile-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding-top: 26px;
  color: #78878e;
  font-size: 0.75rem;
}

.dialog {
  width: min(calc(100% - 32px), 820px);
  max-height: min(88vh, 900px);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
}

.dialog::backdrop {
  background: rgba(22, 35, 41, 0.48);
  backdrop-filter: blur(8px);
}

.dialog[open] {
  animation: dialog-in 240ms cubic-bezier(0.22, 0.9, 0.27, 1);
}

.dialog-panel {
  overflow: auto;
  max-height: inherit;
  padding: clamp(22px, 4vw, 38px);
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 30px;
  background: rgba(245, 249, 250, 0.9);
  box-shadow: 0 32px 90px rgba(21, 37, 44, 0.3);
  backdrop-filter: blur(26px) saturate(125%);
}

#siteTools section { margin: 24px 0; padding-bottom: 24px; border-bottom: 1px solid rgba(44,68,78,.15); }
#siteTools .field { display: grid; gap: 8px; margin: 16px 0; }
#siteTools p { line-height: 1.65; overflow-wrap: anywhere; }
#siteTools button { margin: 4px 4px 4px 0; }
#backupCards { max-height: 150px; overflow: auto; }
#backupImages { max-height: 180px; overflow: auto; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar[role="button"] { cursor: pointer; }
.avatar[role="button"]:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; }
#avatarPreview { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; }
.dialog-mobile-close-bar { display: none; }
@media (max-width: 700px) {
  .dialog-mobile-close-bar { display: flex; justify-content: flex-end; position: sticky; top: 0; z-index: 10; height: 44px; margin-bottom: 8px; pointer-events: none; }
  .dialog-mobile-close { pointer-events: auto; width: 44px; height: 44px; flex-shrink: 0; border: 1px solid rgba(44,68,78,.2); border-radius: 50%; background: #f5f9fa; color: var(--ink); font-size: 28px; line-height: 1; cursor: pointer; }
  .dialog-header > .icon-button[data-close-dialog] { display: none; }
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.icon-button {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.66);
  font-size: 1.25rem;
}

.album-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
  overflow-x: auto;
}

.album-tab {
  padding: 9px 15px;
  border-radius: 999px;
  background: rgba(217, 229, 233, 0.62);
  color: #5c6d75;
  font-size: 0.82rem;
  font-weight: 720;
}

.album-tab.is-active {
  background: var(--accent);
  color: white;
}

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

.album-photo {
  position: relative;
  min-height: 220px;
  margin: 0;
  overflow: hidden;
  border-radius: 20px;
  background: #d7e0e3;
}

.album-photo-wide {
  grid-column: 1 / -1;
  min-height: 330px;
}

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

.album-photo-tall img {
  object-position: 64% center;
}

.album-photo:not(.album-photo-tall):not(.album-photo-wide) img {
  object-position: 10% center;
}

.album-photo figcaption {
  position: absolute;
  right: 12px;
  bottom: 12px;
  left: 12px;
  padding: 9px 11px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 12px;
  background: rgba(17, 30, 36, 0.56);
  color: white;
  font-size: 0.75rem;
  backdrop-filter: blur(10px);
}

.add-panel {
  width: min(100%, 640px);
  margin: 0 auto;
}

.type-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.type-option {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
}

.type-option.is-selected {
  border-color: rgba(37, 79, 91, 0.45);
  background: rgba(215, 235, 238, 0.7);
  box-shadow: 0 0 0 2px rgba(37, 79, 91, 0.08);
}

.type-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.type-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.76);
  font-weight: 800;
}

.type-option strong,
.type-option small {
  display: block;
}

.type-option strong {
  margin-bottom: 3px;
  font-size: 0.875rem;
}

.type-option small {
  color: var(--muted);
  font-size: 0.72rem;
}

.field {
  display: grid;
  gap: 7px;
  margin-top: 14px;
  color: #495e67;
  font-size: 0.8rem;
  font-weight: 720;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid rgba(44, 68, 78, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font-size: 1rem;
}

.field input,
.field select {
  min-height: 46px;
  padding: 0 13px;
}

.field textarea {
  padding: 12px 13px;
  resize: vertical;
  line-height: 1.5;
}

/* Keep native file controls vertically padded after the shared input rules. */
.field input[type="file"] {
  height: auto;
  min-height: 54px;
  padding: 10px 12px;
  line-height: 32px;
}

#albumDeleteCategory {
  margin-top: 12px;
}

.photo-upload-progress { display:block; width:100%; height:12px; margin-top:14px; accent-color:var(--ink); }

.dialog-actions {
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 80;
  max-width: min(360px, calc(100% - 40px));
  padding: 13px 16px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 14px;
  background: rgba(28, 42, 50, 0.9);
  box-shadow: 0 16px 44px rgba(22, 34, 40, 0.24);
  color: white;
  font-size: 0.84rem;
  line-height: 1.45;
  backdrop-filter: blur(14px);
}

.stage[data-preview="mobile"] {
  padding-top: 32px;
}

.stage[data-preview="mobile"] .profile-shell {
  width: min(100%, 410px);
  padding: 24px 20px;
  border-radius: 34px;
}

.stage[data-preview="mobile"] .profile-intro {
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 15px;
  margin-bottom: 26px;
}

.stage[data-preview="mobile"] .avatar {
  width: 96px;
}

.stage[data-preview="mobile"] h1 {
  font-size: 1.5rem;
}

.stage[data-preview="mobile"] .intro-copy {
  font-size: 0.85rem;
  margin-top:6px;
  line-height:1.5;
}
.stage[data-preview="mobile"] .profile-intro > div:not(.avatar) { padding-right:0; }
.stage[data-preview="mobile"] .profile-intro .intro-edit { top:-18px; right:-8px; }

.stage[data-preview="mobile"] .card-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: var(--row);
  gap: 11px;
}

.stage[data-preview="mobile"] .card-content {
  padding: 14px;
}
.stage[data-preview="mobile"] .card-social .card-content { padding: 12px 14px 30px; }
.stage[data-preview="mobile"] .card-social .card-content p { max-width: calc(100% - 24px); }

.stage[data-preview="mobile"] .card {
  border-radius: 18px;
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 700px) {
  .prototype-bar {
    position: relative;
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .prototype-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .view-switch {
    margin-right: auto;
  }

  .stage {
    padding: 18px 10px 52px;
  }

  .profile-shell {
    width: min(100%, 430px);
    padding: 24px 20px;
    border-radius: 32px;
  }

  .profile-intro {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 15px;
    margin-bottom: 26px;
  }

  .avatar {
    width: 64px;
  }

  h1 {
    font-size: 2rem;
  }

  .intro-copy {
    font-size: 0.9rem;
  }

  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: var(--row);
    gap: 11px;
  }

  .card {
    border-radius: 18px;
  }

  .card-content {
    padding: 14px;
  }
  .card-social .card-content { padding: 12px 14px 30px; }
  .card-social .card-content p { max-width: calc(100% - 24px); }
  .view-button[data-view="desktop"] { display: none; }

  .edit-hint {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .dialog.album-dialog {
    width: 100%;
    max-width: none;
    max-height: 100dvh;
    height: 100dvh;
    margin: 0;
  }

  .album-dialog .dialog-panel {
    min-height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }

  .album-grid {
    grid-template-columns: 1fr;
  }

  .album-photo-wide {
    min-height: 270px;
  }

  .type-picker {
    grid-template-columns: 1fr;
  }

  .save-banner {
    top: 126px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .prototype-bar,
  .profile-shell,
  .card,
  .dialog-panel,
  .save-banner {
    background: rgba(247, 250, 251, 0.97);
  }
}
