/* Shoe Mate — album / Notes aesthetic: white, airy, one quiet accent */
:root {
  --bg: #F2F2F7;
  --card: #FFFFFF;
  --ink: #1C1C1E;
  --muted: #8E8E93;
  --line: #E5E5EA;
  --line-2: #C7C7CC;
  --accent: #8E8B87;          /* warm gray accent, not loud pink */
  --accent-soft: #EFEDE9;
  --fill: #F7F7F8;
  --danger: #FF3B30;
  --ok: #34C759;
  --r: 12px;
  --r-lg: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
    "Hiragino Sans GB", "Segoe UI", Roboto, "Noto Sans SC", sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
  letter-spacing: -.01em;
}
#app { max-width: 560px; margin: 0 auto; min-height: 100vh; padding-top: var(--safe-t); padding-bottom: calc(20px + var(--safe-b)); }
#app.has-tabs { padding-bottom: calc(88px + var(--safe-b)); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1 { font-size: 28px; font-weight: 700; letter-spacing: -.02em; margin: 0; }
h2, h3, h4 { margin: 0; font-weight: 600; }
small, .small { font-size: 13px; }
.muted { color: var(--muted); }
.pad { padding: 0 20px; }

/* —— headers —— */
.top { display: flex; align-items: flex-end; justify-content: space-between; padding: 8px 16px 2px; gap: 10px; }
.sub { margin: 1px 0 0; color: var(--muted); font-size: 13px; font-weight: 400; }
.pill {
  border: 0; background: none; color: var(--accent); font-size: 15px; font-weight: 500;
  padding: 6px 0; white-space: nowrap;
}
.pill.quiet { color: var(--muted); font-size: 13px; }
.top.slim { padding: 6px 16px 0; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.home-filters { padding-bottom: 2px; }
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: grid; grid-template-columns: 56px 1fr 72px; align-items: center;
  height: 48px; padding: var(--safe-t) 4px 0;
  background: rgba(242, 242, 247, .86); backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
}
.topbar h2 { text-align: center; font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-btn { border: 0; background: none; font-size: 28px; line-height: 1; padding: 8px 12px; color: var(--ink); font-weight: 300; }
.tb-btn.txt { font-size: 17px; font-weight: 400; color: var(--accent); padding: 8px 10px; }
.tb-btn.strong { font-weight: 600; color: var(--ink); }
.tb-right { text-align: right; }

/* —— members / search / filters —— */
.members-row { display: flex; gap: 6px; overflow-x: auto; padding: 6px 16px 0; scrollbar-width: none; }
.members-row::-webkit-scrollbar { display: none; }
.mchip {
  flex: none; border: 0; background: var(--card); border-radius: 999px;
  padding: 4px 11px; white-space: nowrap; color: var(--ink); font-size: 13px; font-weight: 500;
  box-shadow: 0 0 0 1px var(--line);
}
.mchip i { font-style: normal; color: var(--muted); font-size: 12px; font-weight: 400; margin-left: 4px; }
.mchip.on { background: var(--ink); color: #fff; box-shadow: none; }
.mchip.on i { color: rgba(255,255,255,.7); }
.search { padding: 6px 16px 4px; }
.search input {
  width: 100%; border: 0; background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238E8E93' stroke-width='1.6'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m11.5 11.5 3 3'/%3E%3C/svg%3E") 12px center no-repeat;
  border-radius: 10px; padding: 8px 12px 8px 34px; outline: none; box-shadow: 0 0 0 1px var(--line); font-size: 15px;
}
.search input:focus { box-shadow: 0 0 0 1.5px var(--accent); }
.filters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 0 16px 6px; }
.filters select, .panel select {
  appearance: none; -webkit-appearance: none; width: 100%; border: 0;
  background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238E8E93' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") right 8px center no-repeat;
  border-radius: 8px; padding: 6px 22px 6px 10px; font-size: 12px; color: var(--ink);
  box-shadow: 0 0 0 1px var(--line); text-overflow: ellipsis;
}
.result-line { padding: 2px 14px; margin: 0 0 4px; color: var(--muted); font-size: 12px; }
.link { border: 0; background: none; color: var(--accent); padding: 0; font-weight: 500; }

/* —— album grid (Photos-like: big cells, tight gutters) —— */
.grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 2px; padding: 2px 2px 10px;
}
.pad .grid { padding: 8px 0; gap: 8px; }
.grid.one { grid-template-columns: 1fr; gap: 10px; padding: 4px 0; }
.card {
  background: transparent; border-radius: 0; overflow: visible;
  display: flex; flex-direction: column; gap: 0; min-width: 0;
}
.card .ph {
  position: relative; aspect-ratio: 4 / 5; background: var(--fill);
  border-radius: 0; overflow: hidden;
}
.card.big .ph { aspect-ratio: 4 / 5; border-radius: var(--r); }
.card .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph-empty {
  width: 100%; height: 100%; display: grid; place-items: center;
  background: var(--fill); color: var(--line-2);
}
.ph-empty.big { aspect-ratio: 4 / 5; }
.ph-empty svg { width: 36%; height: auto; opacity: .5; }
.ph-empty.big svg { width: 26%; }
.owner {
  position: absolute; left: 8px; top: 8px; z-index: 1;
  background: rgba(255,255,255,.9); border-radius: 999px;
  padding: 2px 7px; font-size: 11px; font-weight: 500; color: var(--ink);
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
/* album caption on the photo — whole cell is image */
.grid.album .card .meta {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1;
  padding: 28px 10px 8px;
  background: linear-gradient(transparent, rgba(0,0,0,.45));
  pointer-events: none;
}
.grid.album .card .meta b {
  font-size: 13px; font-weight: 500; color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,.35);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card .meta {
  padding: 0 6px 2px; display: flex; flex-direction: column; gap: 0; min-width: 0;
}
.card .meta b {
  font-size: 12px; font-weight: 500; line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink);
}
.card .meta small { display: none; }
.card .meta .where { display: none; }
.card.big .meta {
  position: static; background: none; padding: 6px 2px 2px; pointer-events: auto;
}
.card.big .meta small, .card.big .meta .where { display: block; }
.card.big .meta b { font-size: 15px; font-weight: 600; color: var(--ink); text-shadow: none; }
.where {
  align-self: flex-start; margin-top: 2px; font-size: 11px; font-weight: 400;
  padding: 0; border-radius: 0; background: none; color: var(--muted);
}
.where.box, .where.loc { color: var(--muted); font-weight: 400; }
.where.none { color: var(--line-2); }
.where.cta { color: var(--accent); font-weight: 500; display: none; }
.card.sponsor .ph { background: var(--accent-soft); }
.card.sponsor { outline: none; }
.card.sponsor .meta .where.cta { display: none; }
.ad-badge {
  position: absolute; left: 8px; top: 8px; right: auto;
  background: rgba(255,255,255,.9); color: var(--muted);
  font-size: 10px; font-weight: 500; letter-spacing: .02em;
  padding: 3px 7px; border-radius: 6px;
}

.empty { text-align: center; padding: 64px 36px; color: var(--muted); }
.empty h3 { color: var(--ink); margin: 14px 0 6px; font-size: 20px; font-weight: 600; }
.empty p { margin: 0; font-size: 15px; line-height: 1.5; }
.empty-ico { display: grid; place-items: center; color: var(--line-2); }
.empty-ico svg { width: 56px; height: 56px; opacity: .7; }

.fab {
  position: fixed; z-index: 6;
  right: max(18px, calc(50% - 262px));
  bottom: calc(72px + var(--safe-b));
  width: 52px; height: 52px; border: 0; border-radius: 50%;
  background: var(--ink); color: #fff; font-size: 28px; font-weight: 300; line-height: 1;
  display: grid; place-items: center;
  box-shadow: 0 4px 16px rgba(0,0,0,.18);
  padding: 0;
}
.fab .fab-label { display: none; }

/* —— tab bar (quiet, iOS-like) —— */
.tabbar {
  position: fixed; z-index: 7; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: center;
  background: rgba(249, 249, 249, .92);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: .5px solid rgba(60,60,67,.18);
  padding: 4px 0 calc(4px + var(--safe-b));
}
.tabbar a {
  flex: 1; max-width: 96px; display: flex; flex-direction: column; align-items: center;
  font-size: 10px; font-weight: 500; color: var(--muted); gap: 1px; padding: 4px 0;
}
.tabbar a .ico { width: 24px; height: 24px; display: grid; place-items: center; }
.tabbar a .ico svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a.on { color: var(--ink); }
.tabbar a.on .ico svg { stroke-width: 1.9; }

/* —— detail: photo-first —— */
.gallery {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
  gap: 0; padding: 0; background: #fff;
}
.gallery img, .gallery .ph-empty {
  flex: none; width: 100%; aspect-ratio: 1 / 1; object-fit: cover;
  border-radius: 0; scroll-snap-align: center; background: var(--fill);
}
.shoe-name { font-size: 28px; font-weight: 700; letter-spacing: -.02em; margin: 4px 0 2px; }
.shoe-sub { color: var(--muted); font-size: 15px; margin: 0 0 14px; font-weight: 400; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 0; background: var(--fill); border-radius: 8px;
  padding: 6px 11px; font-size: 13px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 5px; color: var(--ink);
  box-shadow: none;
}
.chip.on { background: var(--ink); color: #fff; }
.chip.add { background: transparent; box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); font-weight: 400; }
.dot { width: 10px; height: 10px; border-radius: 50%; border: 1px solid rgba(0,0,0,.08); display: inline-block; }
.where-card {
  display: flex; align-items: center; gap: 12px; margin: 18px 0;
  padding: 14px 0; background: transparent; border-radius: 0;
  box-shadow: none; border: 0; border-top: .5px solid var(--line); border-bottom: .5px solid var(--line);
}
.where-card.muted { opacity: .85; }
.where-card div { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.where-card b { font-size: 17px; font-weight: 600; }
.where-card small { color: var(--muted); font-size: 13px; }
.big-ico { width: 28px; height: 28px; color: var(--muted); display: grid; place-items: center; flex: none; }
.big-ico svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.chev { color: var(--line-2); font-size: 20px; font-weight: 300; }
.info {
  margin: 0; background: transparent; border-radius: 0; padding: 0;
  box-shadow: none; border-top: .5px solid var(--line);
}
.info div { display: flex; justify-content: space-between; gap: 16px; padding: 13px 0; border-bottom: .5px solid var(--line); }
.info div:last-child { border: 0; }
.info dt { color: var(--muted); flex: none; font-size: 15px; font-weight: 400; }
.info dd { margin: 0; text-align: right; white-space: pre-wrap; font-size: 15px; font-weight: 400; }
.hint {
  margin: 14px 0; padding: 12px 0; border-radius: 0;
  background: transparent; color: var(--muted); font-size: 14px;
  border-top: .5px solid var(--line);
}
.hint.strong { color: var(--ink); }
.actions { display: flex; gap: 10px; margin: 16px 0 8px; }
.actions .btn { flex: 1; }
.actions.sm { margin: 8px 0 0; }
.btn {
  border: 0; background: var(--fill); border-radius: 10px;
  padding: 12px 14px; font-weight: 500; text-align: center; display: inline-block; font-size: 15px;
}
.btn.sm { padding: 7px 12px; font-size: 13px; border-radius: 8px; flex: none; }
.btn.primary { background: var(--ink); color: #fff; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger.ghost { background: transparent; color: var(--danger); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.block { display: block; width: 100%; margin: 10px 0; }
.ai-btn {
  width: 100%; border: 0; border-radius: 10px; padding: 11px 12px;
  font-weight: 500; color: var(--ink); background: var(--fill);
  display: flex; justify-content: center; align-items: center; gap: 6px; font-size: 14px;
}
.ai-btn.soft { margin: 4px 0 8px; color: var(--muted); }
.pro-tag {
  background: var(--accent-soft); color: var(--accent); border-radius: 4px;
  padding: 1px 5px; font-size: 10px; letter-spacing: .04em; font-weight: 600;
}
.btn .pro-tag { background: var(--accent-soft); color: var(--accent); }

/* —— form (note-like) —— */
.form.pad { padding-top: 8px; padding-bottom: 28px; }
.form section, .form > label { display: block; margin: 0; }
.form .sec {
  background: var(--card); border-radius: var(--r-lg);
  padding: 14px 16px; margin: 10px 0; box-shadow: 0 0 0 .5px var(--line);
}
.form .sec h4, .form label > h4 {
  font-size: 12px; color: var(--muted); font-weight: 500;
  text-transform: none; letter-spacing: .01em; margin: 0 0 10px;
}
.form h4 small { font-weight: 400; }
.form input:not([type=checkbox]):not([type=file]), .form textarea, .form select, .dlg-input {
  width: 100%; border: 0; background: transparent; border-radius: 0;
  padding: 4px 0; outline: none; font-size: 17px;
  border-bottom: .5px solid var(--line);
}
.form textarea { border-bottom: 0; resize: vertical; min-height: 72px; }
.form input:focus, .form textarea:focus, .dlg-input:focus { border-color: var(--accent); }
.dlg-input { background: var(--fill) !important; border-radius: 10px !important; padding: 12px !important; border: 0 !important; }
.row2 { display: grid !important; grid-template-columns: 1.5fr 1fr; gap: 14px; }
.row2 label { display: block; }
.photos { display: flex; gap: 10px; padding: 2px 0 4px; }
.thumb {
  position: relative; width: 31%; aspect-ratio: 1; border-radius: 12px;
  overflow: hidden; background: var(--fill);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .x {
  position: absolute; right: 6px; top: 6px; width: 22px; height: 22px;
  border-radius: 50%; border: 0; background: rgba(0,0,0,.45); color: #fff; line-height: 1; font-size: 14px;
}
.thumb.add {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 0; background: var(--fill); color: var(--muted); cursor: pointer; gap: 2px;
}
.thumb.add span { font-size: 22px; font-weight: 300; }
.thumb.add small { font-size: 11px; }
.swatches { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px 4px; }
.sw { border: 0; background: none; padding: 2px 0; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.sw i { width: 26px; height: 26px; border-radius: 50%; border: 1px solid rgba(0,0,0,.08); }
.sw small { font-size: 10px; color: var(--muted); white-space: nowrap; }
.sw.on i { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--ink); }
.sw.on small { color: var(--ink); font-weight: 500; }
.seg { display: flex; background: var(--fill); border-radius: 9px; padding: 2px; margin-bottom: 10px; }
.seg button { flex: 1; border: 0; background: none; padding: 7px 4px; border-radius: 7px; font-size: 13px; color: var(--muted); font-weight: 500; }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.inline { display: flex; gap: 8px; align-items: center; }
.inline input { flex: 1; text-transform: uppercase; background: var(--fill) !important; border-radius: 10px !important; padding: 10px 12px !important; border: 0 !important; }
.more-toggle {
  width: 100%; border: 0; background: transparent; color: var(--accent);
  font-size: 15px; font-weight: 500; padding: 14px 0 6px; text-align: left;
}
.more-body { display: none; }
.more-body.open { display: block; }

/* —— boxes —— */
.list { padding: 4px 16px; display: flex; flex-direction: column; gap: 0; }
.pad .list { padding: 8px 0; }
.box-row {
  display: flex; align-items: center; gap: 14px; background: var(--card);
  border: 0; border-radius: 0; padding: 14px 16px; text-align: left; width: 100%;
  box-shadow: none; border-bottom: .5px solid var(--line);
}
.box-row:first-child { border-radius: var(--r-lg) var(--r-lg) 0 0; }
.box-row:last-child { border-radius: 0 0 var(--r-lg) var(--r-lg); border-bottom: 0; }
.box-row:only-child { border-radius: var(--r-lg); }
.box-row.hl { margin: 0 16px 10px; width: auto; border-radius: var(--r-lg); box-shadow: 0 0 0 1.5px var(--ink); border: 0; }
.box-row .num {
  flex: none; min-width: 44px; height: 44px; padding: 0 4px; border-radius: 10px;
  background: var(--fill); color: var(--ink); display: grid; place-items: center;
  font-weight: 600; font-size: 15px; letter-spacing: .02em;
}
.box-row div { flex: 1; display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.box-row b { font-size: 16px; font-weight: 600; }
.box-row small { color: var(--muted); font-size: 13px; }
.box-row .tag {
  font-size: 12px; color: var(--muted); background: none; padding: 0;
  border-radius: 0; white-space: nowrap; max-width: 36%; overflow: hidden; text-overflow: ellipsis;
}
.box-row .tag.on { color: var(--ink); }
.note-card {
  margin: 8px 20px 12px; padding: 0; border-radius: 0;
  background: transparent; color: var(--muted); font-size: 13px; line-height: 1.45;
}
.pad .note-card, .sheet .note-card { margin: 8px 0; }
.tag-card {
  background: var(--card); border-radius: var(--r-lg); padding: 16px;
  box-shadow: 0 0 0 .5px var(--line); margin: 10px 0;
}
.tag-id { font-size: 22px; font-weight: 600; letter-spacing: .04em; margin: 0; font-variant-numeric: tabular-nums; }
.tag-hero {
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
  background: var(--card); border-radius: var(--r-lg); padding: 28px 18px;
  margin: 6px 0 12px; color: var(--muted); box-shadow: 0 0 0 .5px var(--line);
}
.tag-hero b { color: var(--ink); font-size: 20px; font-weight: 600; }
.promo {
  text-align: center; background: var(--card); border-radius: var(--r-lg);
  padding: 28px 20px; margin: 8px 0 12px; box-shadow: 0 0 0 .5px var(--line);
}
.promo img { border-radius: 14px; }
.promo h3 { margin: 12px 0 6px; font-size: 20px; }
.promo p { color: var(--muted); margin: 0 0 16px; font-size: 15px; }
.store-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 10px 0; }
.store-btn {
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px;
  font-weight: 500; display: inline-flex; flex-direction: column; align-items: center; min-width: 130px; font-size: 14px;
}
.store-btn.off { opacity: .45; }
.store-btn small { font-weight: 400; font-size: 11px; opacity: .8; }

/* —— tidy —— */
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 6px 0 14px; }
.kpis div {
  background: var(--card); border-radius: var(--r-lg); padding: 14px 8px; text-align: center;
  box-shadow: 0 0 0 .5px var(--line); display: flex; flex-direction: column; gap: 2px;
}
.kpis b { font-size: 22px; color: var(--ink); font-weight: 600; }
.kpis small { color: var(--muted); font-size: 12px; }
.panel {
  background: var(--card); border-radius: var(--r-lg); padding: 16px;
  margin: 10px 0; box-shadow: 0 0 0 .5px var(--line);
}
.panel h4 { margin-bottom: 12px; font-size: 15px; font-weight: 600; }
.panel > p { margin: 0 0 10px; }
.bar { display: grid; grid-template-columns: 88px 1fr 28px; align-items: center; gap: 8px; margin: 8px 0; font-size: 13px; }
.bar span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.bar i { height: 4px; border-radius: 999px; background: var(--fill); position: relative; overflow: hidden; }
.bar i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--ink); border-radius: 999px; opacity: .35; }
.bar b { text-align: right; font-weight: 500; }
.sug { display: flex; gap: 12px; padding: 12px 0; border-top: .5px solid var(--line); }
.sug:first-of-type { border-top: 0; }
.sug > div { flex: 1; display: flex; flex-direction: column; }
.sug small { color: var(--muted); font-size: 13px; }
.sug.strong small { color: var(--ink); }
.sug-ph { flex: none; width: 56px; height: 56px; border-radius: 10px; overflow: hidden; background: var(--fill); display: block; }
.sug-ph img { width: 100%; height: 100%; object-fit: cover; }
.sug-ph .ph-empty svg { width: 50%; }
.ok { color: var(--muted); margin: 6px 0 0; font-size: 14px; }

/* —— me —— */
.pro-card {
  width: 100%; border: 0; text-align: left; color: var(--ink);
  border-radius: var(--r-lg); padding: 16px 18px; margin: 6px 0 8px;
  background: var(--card); display: grid; grid-template-columns: 1fr auto;
  box-shadow: 0 0 0 .5px var(--line);
}
.pro-card b { font-size: 17px; font-weight: 600; }
.pro-card span { grid-row: 2; color: var(--muted); font-size: 13px; margin-top: 2px; }
.pro-card i { grid-row: 1 / 3; grid-column: 2; align-self: center; font-style: normal; font-size: 20px; color: var(--line-2); font-weight: 300; }
.li { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: .5px solid var(--line); }
.li:last-of-type { border-bottom: 0; }
.about { text-align: center; color: var(--muted); font-size: 12px; margin: 20px 0 8px; }
.site-footer { text-align: center; padding: 8px 16px 0; }
.icp { font-size: 11px; color: var(--muted); margin: 0; }
.icp a { color: var(--muted); }

/* —— sheets —— */
.sheet-wrap {
  position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.28);
  display: flex; align-items: flex-end; justify-content: center; animation: fade .15s;
}
.sheet {
  width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto;
  background: var(--bg); border-radius: 14px 14px 0 0;
  padding: 18px 20px calc(18px + var(--safe-b)); animation: up .2s ease-out;
}
.sheet h3 { font-size: 20px; font-weight: 600; margin-bottom: 6px; }
.sheet p { margin: 6px 0 10px; color: var(--muted); font-size: 15px; }
.emoji-pick { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.emoji-pick button {
  width: 40px; height: 40px; border-radius: 10px; border: 0;
  background: var(--card); font-size: 20px; box-shadow: 0 0 0 .5px var(--line);
}
.emoji-pick button.on { box-shadow: 0 0 0 1.5px var(--ink); }
.pick-list { display: flex; flex-direction: column; gap: 0; margin: 10px 0; background: var(--card); border-radius: var(--r-lg); overflow: hidden; }
.pick-row {
  display: flex; align-items: center; gap: 10px; background: transparent;
  border-radius: 0; padding: 10px 12px; border-bottom: .5px solid var(--line);
}
.pick-row:last-child { border: 0; }
.pick-row > span:last-child { display: flex; flex-direction: column; }
.pick-row input { width: 18px; height: 18px; accent-color: var(--ink); }
.styles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 10px 0; }
.style-opt {
  border: 0; background: var(--card); border-radius: 12px; padding: 12px 4px;
  font-size: 12px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  box-shadow: 0 0 0 .5px var(--line); color: var(--ink);
}
.style-opt span { font-size: 20px; }
.paywall { text-align: center; }
.pw-badge {
  display: inline-block; background: var(--fill); color: var(--ink);
  font-weight: 600; letter-spacing: .08em; padding: 4px 10px; border-radius: 999px; font-size: 11px;
}
.paywall h3 { margin: 12px 0 6px; font-size: 22px; }
.pw-list { list-style: none; padding: 0; margin: 12px 0; text-align: left; }
.pw-list li { background: var(--card); border-radius: 10px; padding: 12px 14px; margin: 6px 0; font-size: 14px; box-shadow: 0 0 0 .5px var(--line); }
.pw-price { font-weight: 600; color: var(--ink) !important; }
.toast {
  position: fixed; z-index: 30; left: 50%; bottom: calc(96px + var(--safe-b));
  transform: translateX(-50%); background: rgba(28,28,30,.92); color: #fff;
  padding: 10px 16px; border-radius: 10px; font-size: 14px; max-width: 86vw; text-align: center;
  transition: opacity .4s;
}
.toast.out { opacity: 0; }
@keyframes up { from { transform: translateY(24px); opacity: .5; } }
@keyframes fade { from { opacity: 0; } }

.rotate-hint { display: none; }
@media (orientation: landscape) and (max-height: 500px) {
  .rotate-hint { display: grid; place-items: center; position: fixed; inset: 0; z-index: 50; background: var(--bg); font-size: 40px; color: var(--muted); }
}


/* —— home photo stack (bilateral peek, ~15% each side) —— */
.stack-stage {
  position: relative;
  margin: 4px 0 0;
  padding: 8px 0 4px;
  min-height: min(74vh, 620px);
  display: flex; align-items: center; justify-content: center;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  overflow: visible;
}
.stack-deck {
  /* Center card size; peeks stick out left/right beyond this box (overflow visible).
     Aspect 2/3 (taller 「长」card vs previous 4/5). CSS mirrors stack.js CARD_ASPECT_*. */
  position: relative;
  width: min(68vw, 300px);
  aspect-ratio: 2 / 3;
  max-height: min(64vh, 540px);
  margin: 0 auto;
  overflow: visible;
  /* CSS vars mirrored from core/js/stack.js PEEK_* */
  --peek-shift: 21%;
  --peek-scale: 0.88;
  --peek-rot: 4deg;
  --peek-y: 2%;
}
.stack-card {
  position: absolute; inset: 0;
  border-radius: 16px;
  overflow: hidden;
  background: var(--fill);
  box-shadow: 0 8px 24px rgba(0,0,0,.10), 0 1px 2px rgba(0,0,0,.04);
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1), opacity 180ms ease, filter 180ms ease;
  will-change: transform;
  transform-origin: center center;
}
.stack-card .stack-face {
  display: block; width: 100%; height: 100%; position: relative;
  color: inherit; background: var(--fill);
}
.stack-card .stack-face img { -webkit-user-drag: none; user-select: none; pointer-events: none; }
.stack-card .stack-face img,
.stack-card .stack-face .ph-empty {
  width: 100%; height: 100%; object-fit: cover; display: block;
  border-radius: 0; aspect-ratio: auto;
}
.stack-card .stack-face .ph-empty { position: absolute; inset: 0; }
.stack-card .owner { left: 12px; top: 12px; }
.stack-card.cur {
  z-index: 4;
  transform: translate3d(0, 0, 0) scale(1);
  box-shadow: 0 14px 36px rgba(0,0,0,.14), 0 2px 6px rgba(0,0,0,.06);
}
/* Compressed neighbors: ~15% of deck width sticks out past the center card on each side */
.stack-card.prev {
  z-index: 2;
  transform: translate3d(calc(-1 * var(--peek-shift)), var(--peek-y), 0)
             scale(var(--peek-scale)) rotate(calc(-1 * var(--peek-rot)));
  filter: brightness(.96);
  pointer-events: none;
}
.stack-card.next {
  z-index: 2;
  transform: translate3d(var(--peek-shift), var(--peek-y), 0)
             scale(var(--peek-scale)) rotate(var(--peek-rot));
  filter: brightness(.96);
  pointer-events: none;
}
.stack-deck.dragging .stack-card { transition: none; }
.stack-deck.dragging .stack-card.cur {
  /* inline transform set in JS with drag px */
}
.stack-deck.dragging .stack-card.prev {
  transform: translate3d(
      calc(-1 * var(--peek-shift) + var(--drag, 0px) * .22),
      var(--peek-y), 0)
    scale(var(--peek-scale)) rotate(calc(-1 * var(--peek-rot)));
}
.stack-deck.dragging .stack-card.next {
  transform: translate3d(
      calc(var(--peek-shift) + var(--drag, 0px) * .22),
      var(--peek-y), 0)
    scale(var(--peek-scale)) rotate(var(--peek-rot));
}
.stack-deck.settling .stack-card.prev {
  transform: translate3d(
      calc(-1 * var(--peek-shift) + var(--drag, 0px) * .22),
      var(--peek-y), 0)
    scale(var(--peek-scale)) rotate(calc(-1 * var(--peek-rot)));
}
.stack-deck.settling .stack-card.next {
  transform: translate3d(
      calc(var(--peek-shift) + var(--drag, 0px) * .22),
      var(--peek-y), 0)
    scale(var(--peek-scale)) rotate(var(--peek-rot));
}

.stack-caption {
  text-align: center; padding: 12px 24px 4px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.stack-caption b {
  font-size: 20px; font-weight: 600; letter-spacing: -.01em;
  max-width: 90%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.stack-caption small { color: var(--muted); font-size: 13px; }
.stack-count { margin: 8px 0 0; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.stack-hint { margin: 4px 0 0; color: var(--line-2); font-size: 11px; font-weight: 400; }
.stack-empty { padding-top: 48px; min-height: 50vh; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.stack-card .ad-badge { top: 12px; left: 12px; }
