:root {
  --bg: #fafafb;
  --surface: #ffffff;
  --surface-2: #f3f4f7;
  --text: #0e0f13;
  --muted: #6b7080;
  --line: #e7e8ee;
  --accent: #5b6cff;
  --accent-2: #a35bff;
  --ok: #18a058;
  --danger: #e5484d;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(15, 17, 25, .04), 0 8px 28px rgba(15, 17, 25, .06);
  --shadow-lg: 0 2px 6px rgba(15, 17, 25, .05), 0 24px 60px rgba(15, 17, 25, .12);
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", "Inter", Roboto, "Helvetica Neue", Arial, sans-serif;
  --max: 1180px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0c10;
    --surface: #13151b;
    --surface-2: #1b1e26;
    --text: #f2f3f7;
    --muted: #9196a6;
    --line: #23262f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 28px rgba(0, 0, 0, .25);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, .45);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
main { flex: 1; width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 24px 48px; }
a { color: inherit; }
img { display: block; max-width: 100%; }
h1, h2, h3 { letter-spacing: -0.02em; line-height: 1.15; margin: 0; }
p { margin: 0; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.tiny { font-size: 12px; margin-top: 14px; }
.dot { opacity: .45; padding: 0 2px; }
.hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* ------------------------------------------------ top bar */
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between;
  max-width: var(--max); width: 100%; margin: 0 auto; padding: 18px 24px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(14px);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; letter-spacing: -0.01em; font-size: 17px; }
.brand-mark { width: 30px; height: 30px; }

/* ------------------------------------------------ buttons */
.btn {
  appearance: none; border: 0; cursor: pointer; font: inherit; font-weight: 600; font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: 12px; text-decoration: none; white-space: nowrap;
  transition: transform .12s ease, background .2s ease, box-shadow .2s ease, opacity .2s;
}
.btn:active { transform: scale(.97); }
.btn svg { width: 18px; height: 18px; }
.btn.primary { background: var(--text); color: var(--bg); box-shadow: 0 6px 18px rgba(15, 17, 25, .18); }
.btn.primary:hover { opacity: .9; }
.btn.primary:disabled { opacity: .45; cursor: progress; }
.btn.ghost { background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger-ghost { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--danger) 35%, transparent); }
.btn.wide { width: 100%; margin-top: 12px; }
.btn input[type=file] { display: none; }
.link-btn { background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; padding: 6px; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--text); }
.icon-btn { background: rgba(255, 255, 255, .1); color: inherit; border: 0; width: 38px; height: 38px; border-radius: 50%; font-size: 15px; cursor: pointer; }
.icon-btn:hover { background: rgba(255, 255, 255, .2); }
.small-btn { height: 38px; font-size: 14px; padding: 0 14px; }
.small-btn.light { background: #fff; color: #0e0f13; }

.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }

/* ------------------------------------------------ home */
.hero { text-align: center; padding: 56px 0 34px; }
.hero h1 { font-size: clamp(40px, 7vw, 72px); font-weight: 750; letter-spacing: -0.045em; }
.grad { color: var(--text); }
.lead { margin: 18px auto 0; max-width: 540px; color: var(--muted); font-size: 18px; }

.uploader { max-width: 860px; margin: 0 auto; }
.dropzone {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 300px; padding: 40px 24px; border-radius: 28px; cursor: pointer; text-align: center;
  background: var(--surface);
  box-shadow: var(--shadow), inset 0 0 0 1.5px var(--line);
  transition: box-shadow .2s ease, transform .2s ease;
}
.dropzone:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg), inset 0 0 0 1.5px var(--line); }
.dropzone.drag { transform: scale(1.01); box-shadow: var(--shadow-lg), inset 0 0 0 2px var(--text); }
.dropzone input { display: none; }
.dz-icon { width: 62px; height: 62px; border-radius: 18px; display: grid; place-items: center; color: var(--bg); margin-bottom: 10px;
  background: var(--text); }
.dz-icon svg { width: 28px; height: 28px; }
.dz-title { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.dz-sub { color: var(--muted); }
.dz-sub .link { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 18px; }
.chip { font-size: 12.5px; color: var(--muted); padding: 5px 11px; border-radius: 999px; background: var(--surface-2); }

.tray { margin-top: 18px; padding: 20px; }
.tray-head { display: flex; align-items: center; gap: 14px; justify-content: space-between; margin-bottom: 16px; }
.title-input { flex: 1; min-width: 0; font: inherit; font-size: 18px; font-weight: 650; letter-spacing: -0.01em; border: 0; outline: 0; background: transparent; color: var(--text); padding: 6px 2px; }
.title-input::placeholder { color: var(--muted); font-weight: 500; }
.tray-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; max-height: 420px; overflow: auto; padding: 2px; }
.tile { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.tile img { width: 100%; height: 100%; object-fit: cover; }
.tile .ext { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .05em; }
.tile .rm { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(10, 10, 14, .62); color: #fff; font-size: 12px; opacity: 0; transition: opacity .15s; }
.tile:hover .rm { opacity: 1; }
.tile .state { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(10, 10, 14, .35); color: #fff; font-size: 12px; font-weight: 700; opacity: 0; transition: opacity .2s; }
.tile.uploading .state, .tile.failed .state { opacity: 1; }
.tile.failed .state { background: rgba(229, 72, 77, .78); padding: 6px; text-align: center; line-height: 1.25; }
.tile.done::after { content: "✓"; position: absolute; right: 6px; bottom: 6px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ok); color: #fff; font-size: 12px; font-weight: 800; }
.tile .bar { position: absolute; left: 8px; right: 8px; bottom: 8px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .35); overflow: hidden; }
.tile .bar span { display: block; height: 100%; width: 0; background: #fff; transition: width .15s; }
.tray-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 18px; }
.progress { margin-top: 16px; }
.progress-bar { height: 8px; border-radius: 8px; background: var(--surface-2); overflow: hidden; }
.progress-bar span { display: block; height: 100%; width: 0; border-radius: 8px; background: var(--text); transition: width .25s ease; }
.progress-text { margin-top: 8px; }

.result { margin-top: 18px; overflow: hidden; display: grid; grid-template-columns: 1.05fr 1fr; animation: rise .45s cubic-bezier(.2, .8, .2, 1); }
.result-preview { background: #0c0d12; display: grid; place-items: center; }
.result-preview img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 1200/630; }
.result-body { padding: 26px; display: flex; flex-direction: column; gap: 12px; }
.result-badge { display: inline-flex; align-items: center; gap: 8px; color: var(--ok); font-weight: 650; font-size: 13.5px; }
.result h2 { font-size: 26px; }
.copy-row { display: flex; gap: 8px; margin-top: 4px; }
.copy-row input { flex: 1; min-width: 0; height: 44px; border-radius: 12px; border: 0; padding: 0 14px; font: inherit; font-size: 14px;
  background: var(--surface-2); color: var(--text); outline: 0; }
.share-row { display: flex; flex-wrap: wrap; gap: 8px; }
.share-chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 600;
  text-decoration: none; background: var(--surface-2); color: var(--text); border: 0; cursor: pointer; font-family: inherit; }
.share-chip:hover { background: color-mix(in srgb, var(--accent) 14%, var(--surface-2)); }
.share-chip i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.private-box { display: flex; gap: 14px; align-items: center; justify-content: space-between; padding: 14px; border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 8%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 20%, transparent); }
.private-box p { margin-top: 2px; }
#again { align-self: flex-start; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; max-width: 980px; margin: 72px auto 0; }
.feature { padding: 22px; }
.f-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); font-size: 17px; margin-bottom: 14px; }
.feature h3 { font-size: 17px; margin-bottom: 6px; }
.feature p { color: var(--muted); font-size: 14.5px; }

.recent { max-width: 860px; margin: 56px auto 0; }
.recent h3 { font-size: 16px; margin-bottom: 12px; }
.recent-list { display: grid; gap: 8px; }
.recent-item { display: flex; align-items: center; gap: 14px; padding: 10px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.recent-item img { width: 76px; height: 40px; border-radius: 8px; object-fit: cover; background: var(--surface-2); }
.recent-item .grow { flex: 1; min-width: 0; }
.recent-item .grow strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14.5px; }
.recent-item a.small { text-decoration: none; font-weight: 600; padding: 6px 10px; border-radius: 8px; background: var(--surface-2); }

/* ------------------------------------------------ gallery */
.album-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding: 28px 0 24px; }
.album-head h1 { font-size: clamp(28px, 4.2vw, 44px); font-weight: 750; letter-spacing: -0.035em; }
.album-head p { margin-top: 8px; }
.owner-note { margin-top: 8px; color: var(--accent); }
.expiry-pill, .live-pill { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; padding: 7px 12px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); animation: pulse 2s infinite; }
.expiry-pill.soon .pulse { background: #f5a524; }

.mosaic { position: relative; width: 100%; }
.mosaic .ph {
  position: absolute; overflow: hidden; border-radius: 14px; background: var(--surface-2);
  -webkit-touch-callout: none; user-select: none; -webkit-user-select: none;
}
.mosaic .ph img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.02); transition: opacity .5s ease, transform .6s cubic-bezier(.2, .8, .2, 1); pointer-events: none; }
.mosaic .ph.loaded img { opacity: 1; transform: none; }
.mosaic .ph::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 60%, rgba(0, 0, 0, .28)); opacity: 0; transition: opacity .25s; }
.mosaic .ph:hover::after { opacity: 1; }
.mosaic .ph .fmt { position: absolute; left: 10px; bottom: 10px; z-index: 2; font-size: 11px; font-weight: 700; letter-spacing: .04em; color: #fff;
  background: rgba(0, 0, 0, .45); padding: 3px 7px; border-radius: 6px; opacity: 0; transition: opacity .25s; backdrop-filter: blur(6px); }
.mosaic .ph:hover .fmt { opacity: 1; }

/* Email box: always open and the main action of an album. */
.email-dock { position: sticky; top: 76px; z-index: 20; margin: 0 0 26px; padding: 18px 18px 16px; border-radius: 22px;
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(1.4) blur(16px);
  box-shadow: var(--shadow-lg), inset 0 0 0 1px var(--line); }
.email-dock.nudge { animation: nudge .5s cubic-bezier(.3, .7, .3, 1); }
.ed-label { display: flex; flex-direction: column; gap: 2px; margin: 0 4px 12px; cursor: text; }
.ed-label strong { font-size: 17px; letter-spacing: -0.01em; }
.ed-label span { color: var(--muted); font-size: 14px; }
.ed-field { position: relative; display: flex; align-items: center; height: 62px; border-radius: 16px; background: var(--surface-2);
  box-shadow: inset 0 0 0 1.5px var(--line); transition: box-shadow .2s; }
.ed-field:focus-within { box-shadow: inset 0 0 0 2px var(--text); }
.ed-icon { width: 22px; height: 22px; margin: 0 4px 0 18px; color: var(--text); flex-shrink: 0; }
.ed-field input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--text);
  font: inherit; font-size: 19px; font-weight: 550; padding: 0 12px; caret-color: var(--accent); }
.ed-field input::placeholder { color: var(--muted); font-weight: 450; }
.ed-send { width: 48px; height: 48px; margin-right: 7px; flex-shrink: 0; border: 0; border-radius: 12px; cursor: pointer; color: var(--bg);
  display: grid; place-items: center; background: var(--text); transition: transform .12s, opacity .2s; }
.ed-send:hover { opacity: .9; }
.ed-send svg { width: 22px; height: 22px; }
.ed-send:active { transform: scale(.94); }
.email-dock.sending .ed-send { opacity: .5; cursor: progress; }
.email-dock.sending .ed-send svg { animation: spin .9s linear infinite; }
.email-dock .form-error { margin: 10px 4px 0; }
.ed-done { display: flex; align-items: center; gap: 14px; min-height: 62px; }
.ed-done > div { flex: 1; color: var(--muted); font-size: 14.5px; }
.ed-done strong { color: var(--text); font-size: 16px; }
.ed-check { width: 40px; height: 40px; flex-shrink: 0; border-radius: 12px; display: grid; place-items: center; background: var(--ok); color: #fff; font-weight: 800; }
.album-list .album-open { text-align: left; padding: 0; text-decoration: none; font-weight: 600; }
.album-detail { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.album-detail h3 { font-size: 15px; margin: 0 0 8px; }
.album-detail .kpis { margin: 12px 0; }
@keyframes nudge { 30% { transform: translateY(-4px) scale(1.01); } 60% { transform: translateY(1px); } }

.modal { border: 0; padding: 0; border-radius: 24px; width: min(420px, calc(100vw - 32px)); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
.modal::backdrop { background: rgba(8, 9, 12, .55); backdrop-filter: blur(6px); }
.modal[open] { animation: rise .3s cubic-bezier(.2, .8, .2, 1); }
.modal form, .modal-done { padding: 28px; position: relative; }
.modal h2 { font-size: 22px; margin: 4px 0 6px; }
.modal-x { position: absolute; top: 14px; right: 14px; background: var(--surface-2); color: var(--muted); }
.modal-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 20px; color: var(--bg); margin-bottom: 12px;
  background: var(--text); }
.modal-icon.ok { background: var(--ok); }
.field { width: 100%; height: 48px; margin-top: 18px; border-radius: 12px; border: 0; padding: 0 14px; font: inherit; background: var(--surface-2); color: var(--text);
  outline: 0; box-shadow: inset 0 0 0 1.5px transparent; transition: box-shadow .15s; }
.field:focus { box-shadow: inset 0 0 0 1.5px var(--accent); }
.form-error { color: var(--danger); font-size: 13.5px; min-height: 0; margin-top: 8px; }
.form-error:empty { display: none; }
.radio-list { display: grid; gap: 8px; margin: 16px 0 4px; }
.radio-list label { display: flex; gap: 10px; align-items: center; padding: 12px; border-radius: 12px; background: var(--surface-2); cursor: pointer; font-size: 14.5px; }

/* ------------------------------------------------ animated collage */
.collage { position: relative; width: 100%; aspect-ratio: 1200 / 630; border-radius: 24px; overflow: hidden; background: #0c0d12;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; isolation: isolate; }
.collage .cbg { position: absolute; inset: -40px; width: calc(100% + 80px); height: calc(100% + 80px); max-width: none;
  object-fit: cover; filter: blur(40px) saturate(1.2); opacity: .45; pointer-events: none; }
.ctile { position: absolute; perspective: 1100px; }
.ctile:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 16px; }
.ccard { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform 1s cubic-bezier(.5, .05, .2, 1); }
.cface { position: absolute; inset: 0; border-radius: 16px; overflow: hidden; background-color: #1b1e26;
  backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
.cface.front { transform: rotateY(0deg); }
.cface.back { transform: rotateY(180deg); }
.cphoto { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 50% 42%;
  pointer-events: none; -webkit-user-drag: none; }
.ctile:hover .cphoto { filter: brightness(1.06); }
.ctile .more { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; border-radius: 16px; pointer-events: none;
  background: rgba(0, 0, 0, .55); color: #fff; font-weight: 800; font-size: clamp(22px, 4vw, 46px); letter-spacing: -0.02em; }
.collage.single .ccard { transform-style: flat; }
.collage.single .cface { backface-visibility: visible; -webkit-backface-visibility: visible; transform: none; }
.collage.single .cface.back { display: none; }
.collage.single .cphoto { animation: kenburns 16s ease-in-out infinite alternate; }
.cbadge { position: absolute; left: 4%; bottom: 6%; z-index: 3; display: inline-flex; align-items: center; gap: 9px; pointer-events: none;
  padding: 8px 16px 8px 9px; border-radius: 999px; background: rgba(10, 10, 14, .78); color: #c8ccdc; font-size: 13px; backdrop-filter: blur(8px); }
.cbadge strong { color: #fff; font-size: 14.5px; }
.cdot { width: 20px; height: 20px; border-radius: 50%; background: #fff; }
.collage-hero { margin: 0; box-shadow: var(--shadow-lg); }
.result-preview .collage { border-radius: 0; height: 100%; aspect-ratio: auto; min-height: 260px; }
@keyframes kenburns { from { transform: scale(1); } to { transform: scale(1.08) translate(-1%, -1%); } }
@media (max-width: 560px) {
  .collage { aspect-ratio: 4 / 3; border-radius: 16px; }
  .cface, .ctile .more { border-radius: 10px; }
  .cbadge { font-size: 11px; padding: 6px 12px 6px 7px; }
  .cbadge strong { font-size: 12px; }
  .cdot { width: 16px; height: 16px; }
}

/* ------------------------------------------------ insights */
.ins-head { display: grid; grid-template-columns: 300px 1fr auto; gap: 24px; padding: 18px; align-items: center; margin-top: 12px; }
.ins-thumb img { width: 100%; aspect-ratio: 1200/630; object-fit: cover; border-radius: 14px; background: var(--surface-2); }
.ins-info h1 { font-size: 28px; margin: 4px 0 4px; }
.ins-info .copy-row { margin-top: 14px; max-width: 520px; }
.ins-actions { display: flex; gap: 8px; margin-top: 10px; }
.ins-title-row { padding: 28px 0 8px; }
.ins-title-row h1 { font-size: 32px; }
.ring { position: relative; width: 132px; height: 132px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 9; }
.ring-bg { stroke: var(--surface-2); }
.ring-fg { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 326.7; stroke-dashoffset: 0; transition: stroke-dashoffset .6s ease; }
.ring-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-text strong { font-size: 20px; font-variant-numeric: tabular-nums; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 16px 0; }
.kpi { padding: 18px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.kpi .label { font-size: 13px; color: var(--muted); font-weight: 600; }
.kpi .value { font-size: 30px; font-weight: 750; letter-spacing: -0.03em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.kpi.live .value { color: var(--ok); }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.panel { padding: 20px; min-width: 0; }
.span-2 { grid-column: span 2; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.panel-head h3 { font-size: 15.5px; }
.hint { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--muted); background: var(--surface-2); cursor: help; }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); }
.lg::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; vertical-align: -0.5px; }
.lg.view::before { background: var(--accent); } .lg.preview::before { background: var(--accent-2); } .lg.open::before { background: #22c3a6; }
.chart { height: 220px; position: relative; color: var(--muted); }
.chart svg { width: 100%; height: 100%; overflow: visible; }
.chart .axis { fill: var(--muted); font-size: 11px; }
.chart .gridline { stroke: var(--line); stroke-width: 1; }
.chart .tip { position: absolute; pointer-events: none; background: var(--text); color: var(--bg); font-size: 12px; padding: 6px 9px; border-radius: 8px; white-space: nowrap; transform: translate(-50%, -110%); opacity: 0; transition: opacity .1s; }

.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; font-size: 14px; }
.bar-row .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row .num { font-weight: 650; font-variant-numeric: tabular-nums; }
.bar-row .track { grid-column: span 2; height: 7px; border-radius: 7px; background: var(--surface-2); overflow: hidden; }
.bar-row .track span { display: block; height: 100%; border-radius: 7px; background: var(--text); width: 0; transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.empty { color: var(--muted); font-size: 14px; padding: 18px 0; text-align: center; }

.funnel { display: grid; gap: 10px; }
.funnel-step { position: relative; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); overflow: hidden; display: flex; justify-content: space-between; font-size: 14px; }
.funnel-step .fill { position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, var(--accent) 18%, transparent); transition: width .6s ease; }
.funnel-step span { position: relative; } .funnel-step strong { position: relative; font-variant-numeric: tabular-nums; }

.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: 420px; overflow: auto; }
.feed li { display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; align-items: center; padding: 9px 4px; border-bottom: 1px solid var(--line); font-size: 14px; }
.feed li:last-child { border-bottom: 0; }
.feed .ic { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; font-size: 13px; background: var(--surface-2); }
.feed .t { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.feed .d { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.limits { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; margin: 0; font-size: 14px; }
.limits dt { color: var(--muted); } .limits dd { margin: 0; font-weight: 650; text-align: right; }

/* ------------------------------------------------ misc */
.empty-state { text-align: center; padding: 110px 0; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.empty-state h1 { font-size: 36px; }
.empty-state .btn { margin-top: 12px; }
.empty-cloud { width: 120px; color: var(--muted); animation: float 4s ease-in-out infinite; }
.footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 28px 24px 34px; color: var(--muted); font-size: 13px; }
.footer a { text-decoration: none; } .footer a:hover { color: var(--text); }
.tiny-link { font-size: 13px; padding: 0; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); z-index: 200; background: var(--text); color: var(--bg); padding: 11px 18px;
  border-radius: 12px; font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s, transform .25s; box-shadow: var(--shadow-lg); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); } 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes float { 50% { transform: translateY(-8px); } }

@media (max-width: 860px) {
  .result { grid-template-columns: 1fr; }
  .result-preview .collage { height: auto; min-height: 0; aspect-ratio: 1200 / 630; }
  .features { grid-template-columns: 1fr; margin-top: 48px; }
  .album-head { flex-direction: column; align-items: flex-start; }
  .ins-head { grid-template-columns: 1fr; }
  .ins-expiry { justify-self: center; }
  .grid-2 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
}
@media (max-width: 560px) {
  main { padding: 0 14px 40px; }
  .topbar { padding: 14px; }
  .hero { padding: 34px 0 24px; }
  .dropzone { min-height: 240px; }
  .email-dock { top: 64px; padding: 14px 12px 12px; border-radius: 18px; }
  .ed-label strong { font-size: 15.5px; }
  .ed-label span { font-size: 13px; }
  .ed-field { height: 56px; }
  .ed-field input { font-size: 17px; padding: 0 8px; }
  .ed-icon { margin-left: 14px; }
  .ed-send { width: 44px; height: 44px; margin-right: 6px; }
  .private-box { flex-direction: column; align-items: stretch; }
  .mosaic .ph { border-radius: 8px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media print { .mosaic, .collage { display: none !important; } }
