:root {
  --bg: #ffffff;
  --ink: #1C1C1E;
  --paper: #F4F1EA;
  --ink2: #6e6e73;
  --surface: #f5f5f7;
  --card: #f7f7f9;
  --track: #e5e5ea;
  --line: rgba(0, 0, 0, 0.06);
  --control: #8e8e93;
  --danger: #d70015;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --top: env(safe-area-inset-top, 0px);
  --bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", system-ui, "Inter", sans-serif;
  font-size: 17px; line-height: 1.4; -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation; caret-color: var(--ink);
}
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
::selection { background: #dbe6f6; }
.gbtn, .tab, .tool, .btn, .menu-item, .lb-btn { user-select: none; -webkit-user-select: none; }

#view { opacity: 0; transition: opacity 0.3s var(--ease); }
body.ready #view { opacity: 1; }

/* ---------- Liquid glass ----------
   Blur stays light so the photos behind still read. The rim catches light like a bevel,
   a soft sheen sits on top, and the shadow lifts it off the page. In Chromium the rim also
   refracts what is behind it (see js/glass.js). */
.glass {
  position: relative; isolation: isolate;
  background: rgba(255, 255, 255, 0.46);
  -webkit-backdrop-filter: blur(10px) saturate(1.9) brightness(1.06);
  backdrop-filter: blur(10px) saturate(1.9) brightness(1.06);
  box-shadow:
    0 1px 1px rgba(0, 0, 0, 0.05),
    0 8px 26px rgba(0, 0, 0, 0.11),
    0 22px 44px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(255, 255, 255, 0.4),
    inset 0 0 16px rgba(255, 255, 255, 0.42);
}
.glass::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.3px; pointer-events: none; z-index: 2;
  background: linear-gradient(142deg, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0.18) 30%, rgba(255, 255, 255, 0.04) 55%, rgba(255, 255, 255, 0.7) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.glass::after {
  content: ""; position: absolute; inset: 1px; border-radius: inherit; pointer-events: none; z-index: 2;
  background: radial-gradient(130% 80% at 22% -12%, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0) 58%);
  opacity: 0.75;
}
.glass > * { position: relative; z-index: 1; }
.glass > .capsule { position: absolute; z-index: 0; }
.has-lens .lens-tabs {
  -webkit-backdrop-filter: url(#lens-tabs) blur(1.5px) saturate(1.9) brightness(1.07);
  backdrop-filter: url(#lens-tabs) blur(1.5px) saturate(1.9) brightness(1.07);
}
.has-lens .lens-toolbar {
  -webkit-backdrop-filter: url(#lens-toolbar) blur(1.5px) saturate(1.9) brightness(1.07);
  backdrop-filter: url(#lens-toolbar) blur(1.5px) saturate(1.9) brightness(1.07);
}

/* ---------- Floating top controls ---------- */
.topbar {
  position: fixed; z-index: 30; top: calc(var(--top) + 12px); left: 16px; right: 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; pointer-events: none;
}
.tb-left, .tb-right { display: flex; gap: 10px; pointer-events: auto; }
.gbtn {
  appearance: none; border: 0; cursor: pointer; text-decoration: none;
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--ink);
  background: rgba(255, 255, 255, 0.4);
  transition: transform 0.25s var(--drawer);
}
.gbtn:active { transform: scale(0.9); }
.gbtn.text { width: auto; padding: 0 20px; border-radius: 999px; font-size: 16px; font-weight: 600; }
.tb-title {
  position: absolute; left: 50%; max-width: 46vw; transform: translateX(-50%) translateY(-6px);
  padding: 10px 20px; border-radius: 999px; font-size: 15px; font-weight: 600; letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; pointer-events: none;
  transition: opacity 0.25s var(--ease), transform 0.35s var(--drawer);
}
body.scrolled .tb-title { opacity: 1; transform: translateX(-50%); }

/* ---------- Pages ---------- */
.page { max-width: 1100px; margin: 0 auto; padding: calc(var(--top) + 92px) 20px calc(150px + var(--bottom)); }
.head { margin-bottom: 8px; }
.title { margin: 0; font-size: 42px; font-weight: 700; letter-spacing: -0.045em; line-height: 1.04; text-wrap: balance; overflow-wrap: anywhere; }
.sub { margin: 8px 0 0; color: var(--ink2); font-size: 16px; letter-spacing: -0.01em; }
.section { margin: 38px 0 14px; font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink2); }

.enter .row, .enter .card, .enter .section, .enter .empty { animation: up 0.5s var(--ease) both; animation-delay: calc(var(--i, 0) * 50ms); }
@keyframes up { from { opacity: 0; transform: translateY(16px); } }

/* Goals: big editorial rows with a stack of the goal's photos */
.row {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  margin-bottom: 12px; padding: 22px 26px; border-radius: 30px; background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line); text-decoration: none;
  transition: transform 0.4s var(--ease), background-color 0.25s var(--ease), box-shadow 0.4s var(--ease);
}
.row:active { transform: scale(0.985); }
.row-name { font-size: 27px; font-weight: 600; letter-spacing: -0.035em; line-height: 1.12; overflow-wrap: anywhere; }
.stack3 { position: relative; flex: none; width: 152px; height: 86px; }
.sp {
  position: absolute; top: 6px; width: 72px; height: 72px; border-radius: 18px; overflow: hidden;
  background: #ececef; border: 3px solid #fff; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
  transition: transform 0.45s var(--drawer);
}
.sp img { display: block; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.4s var(--ease); }
.sp.loaded img { opacity: 1; }
.sp.s0 { right: 0; transform: rotate(-3deg); z-index: 3; }
.sp.s1 { right: 34px; transform: rotate(5deg); z-index: 2; }
.sp.s2 { right: 68px; transform: rotate(-8deg); z-index: 1; }
.sp.ghost { background: transparent; border: 2px dashed #d2d2d7; box-shadow: none; }
@media (hover: hover) and (pointer: fine) {
  .row:hover { transform: translateY(-3px); background: #f1f1f4; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05), 0 16px 34px rgba(0, 0, 0, 0.08); }
  .row:hover .s1 { transform: rotate(9deg) translateX(-8px); }
  .row:hover .s2 { transform: rotate(-14deg) translateX(-16px); }
}

/* Moodboards: mosaic cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 26px 18px; margin-top: 30px; }
.card { display: block; text-decoration: none; transition: transform 0.45s var(--ease); }
.card:active { transform: scale(0.985); }
.mosaic {
  position: relative; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 3px;
  aspect-ratio: 1 / 1; border-radius: 28px; overflow: hidden; background: #fff;
}
.mosaic::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.07); pointer-events: none; }
.cell { overflow: hidden; background: #ededf0; }
.cell img { display: block; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.4s var(--ease), transform 0.55s var(--ease); }
.cell.loaded img { opacity: 1; }
.card-name { margin-top: 14px; font-size: 20px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.2; overflow-wrap: anywhere; }
.card-sub { margin-top: 2px; color: var(--ink2); font-size: 14px; }
.card.new { appearance: none; border: 0; background: none; padding: 0; text-align: left; cursor: pointer; color: inherit; font: inherit; }
.card.new .mosaic { display: grid; place-items: center; grid-template-columns: 1fr; grid-template-rows: 1fr; background: #fafafa; border: 2px dashed #d2d2d7; color: var(--ink2); }
.card.new .mosaic::after { display: none; }
@media (hover: hover) and (pointer: fine) {
  .card:hover { transform: translateY(-5px); }
  .card:hover .cell.loaded img { transform: scale(1.06); }
  .card:hover .mosaic { box-shadow: 0 18px 40px rgba(0, 0, 0, 0.12); }
}

.empty { padding: 56px 0 0; text-align: center; color: var(--ink2); }
.empty-ic { width: 76px; height: 76px; margin: 0 auto 20px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--control); }
.empty h2 { margin: 0 0 6px; color: var(--ink); font-size: 22px; font-weight: 700; letter-spacing: -0.03em; }
.empty p { margin: 0 auto 24px; max-width: 30ch; font-size: 16px; text-wrap: balance; }

/* ---------- Buttons ---------- */
.btn {
  appearance: none; border: 0; cursor: pointer; padding: 15px 26px; border-radius: 999px;
  background: var(--ink); color: #fff; font-size: 16px; font-weight: 600; letter-spacing: -0.01em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 6px 16px rgba(0, 0, 0, 0.16);
  transition: transform 0.18s var(--ease), opacity 0.18s var(--ease);
}
.btn:active { transform: scale(0.97); }
.btn[disabled] { opacity: 0.3; cursor: default; }
.btn.secondary { background: var(--surface); color: var(--ink); box-shadow: none; }
.btn.danger { background: var(--surface); color: var(--danger); box-shadow: none; }
.btn.ghost { background: none; color: var(--ink2); box-shadow: none; }
.btn.block { width: 100%; }

/* ---------- Bottom: tabs and the selection toolbar ---------- */
.tabs, .toolbar {
  position: fixed; left: 50%; bottom: calc(18px + var(--bottom)); transform: translateX(-50%);
  padding: 6px; border-radius: 36px; z-index: 30; --i: 0;
}
.tabs { display: grid; grid-template-columns: 1fr 1fr; }
.capsule {
  top: 6px; bottom: 6px; left: 6px; width: calc((100% - 12px) / 2); border-radius: 30px;
  background: rgba(255, 255, 255, 0.78);
  -webkit-backdrop-filter: blur(6px) saturate(1.7); backdrop-filter: blur(6px) saturate(1.7);
  box-shadow: inset 0 1px 0 #fff, inset 0 0 0 1px rgba(255, 255, 255, 0.6), 0 3px 12px rgba(0, 0, 0, 0.12);
  transform: translateX(calc(var(--i) * 100%)); transition: transform 0.45s var(--drawer);
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 120px;
  padding: 9px 14px 8px; border-radius: 30px; color: var(--ink2); font-size: 11px; font-weight: 600; text-decoration: none;
  transition: color 0.25s var(--ease), transform 0.2s var(--ease);
}
.tab:active { transform: scale(0.96); }
.tab[aria-current="page"] { color: var(--ink); }
.toolbar { display: flex; animation: rise 0.4s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateX(-50%) translateY(10px) scale(0.96); } }
.tool {
  appearance: none; border: 0; background: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px;
  min-width: 120px; padding: 9px 14px 8px; border-radius: 30px; color: var(--ink); font-size: 11px; font-weight: 600;
  transition: background-color 0.2s var(--ease), transform 0.18s var(--ease), opacity 0.2s var(--ease);
}
.tool:active:not([disabled]) { transform: scale(0.95); background: rgba(255, 255, 255, 0.6); }
.tool[disabled] { opacity: 0.35; cursor: default; }
.tool.danger { color: var(--danger); }

.status {
  position: fixed; left: 50%; top: calc(var(--top) + 70px); z-index: 25; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; padding: 9px 18px; border-radius: 999px;
  font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; animation: drop 0.4s var(--ease) both;
}
@keyframes drop { from { opacity: 0; transform: translate(-50%, -8px); } }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--track); border-top-color: var(--ink); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: fixed; left: 50%; bottom: calc(108px + var(--bottom)); z-index: 60;
  display: flex; align-items: center; gap: 16px; padding: 12px 12px 12px 20px; border-radius: 999px;
  background: rgba(29, 29, 31, 0.94); color: #fff; font-size: 15px; font-weight: 500;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22); transform: translateX(-50%); animation: toast-in 0.4s var(--ease) both;
}
.toast.out { animation: toast-out 0.25s var(--ease) both; }
.toast button { appearance: none; border: 0; cursor: pointer; padding: 7px 14px; border-radius: 999px; background: rgba(255, 255, 255, 0.16); color: #fff; font-size: 14px; font-weight: 600; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px); } }
@keyframes toast-out { to { opacity: 0; transform: translate(-50%, 8px); } }

/* ---------- Moodboard grid ---------- */
.grid { position: relative; width: 100%; margin-top: 26px; }
.tile {
  position: absolute; left: 0; top: 0; display: block; padding: 0; border: 0; margin: 0;
  background: none; cursor: zoom-in; touch-action: pan-y;
  transition: transform 0.5s var(--ease); will-change: transform;
}
.t-in {
  position: absolute; inset: 0; border-radius: 22px; overflow: hidden; background: #ececef;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.t-in::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06); pointer-events: none; }
.t-in img {
  display: block; width: 100%; height: 100%; object-fit: cover; opacity: 0;
  -webkit-user-drag: none; user-select: none; -webkit-touch-callout: none;
  transition: opacity 0.4s var(--ease), transform 0.55s var(--ease);
}
.t-in.loaded img { opacity: 1; }
.t-in.instant img { transition: transform 0.55s var(--ease); }
@media (hover: hover) and (pointer: fine) { .tile:hover .t-in img { transform: scale(1.045); } }
.tile:active .t-in { transform: scale(0.985); }
.tile.pop .t-in { animation: pop 0.5s var(--ease) both; }
@keyframes pop { from { opacity: 0; transform: scale(0.92); } }
.tile.dragging { z-index: 20; transition: none; cursor: grabbing; }
.tile.dragging .t-in { transform: scale(1.04); box-shadow: 0 24px 52px rgba(0, 0, 0, 0.26); }
.grid.dragging-any .tile:not(.dragging) { cursor: grabbing; }

.t-check {
  position: absolute; bottom: 10px; right: 10px; width: 26px; height: 26px; border-radius: 50%; z-index: 2;
  display: grid; place-items: center; color: #fff; border: 2px solid #fff; background: rgba(0, 0, 0, 0.2);
  opacity: 0; transform: scale(0.8);
  transition: opacity 0.2s var(--ease), transform 0.3s var(--drawer), background-color 0.2s var(--ease);
}
.t-check svg { opacity: 0; transition: opacity 0.15s var(--ease); }
.grid.selecting .t-check { opacity: 1; transform: none; }
.tile.selected .t-check { background: var(--ink); border-color: var(--ink); }
.tile.selected .t-check svg { opacity: 1; }
.grid.selecting .tile .t-in { transition: transform 0.3s var(--drawer); }
.grid.selecting .tile.selected .t-in { transform: scale(0.92); }
.grid.selecting .tile { cursor: pointer; }

/* ---------- Menus and dialogs: they grow out of where you tapped, never from the bottom ---------- */
.menu {
  position: fixed; z-index: 55; min-width: 230px; padding: 6px; border-radius: 24px;
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: blur(24px) saturate(1.9); backdrop-filter: blur(24px) saturate(1.9);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05), 0 18px 50px rgba(0, 0, 0, 0.2), inset 0 0 0 1px rgba(255, 255, 255, 0.7);
  opacity: 0; transform: scale(0.9); transition: opacity 0.18s var(--ease), transform 0.35s var(--drawer);
}
.menu.open { opacity: 1; transform: none; }
.menu-item {
  appearance: none; border: 0; background: none; cursor: pointer; display: block; width: 100%; text-align: left;
  padding: 13px 16px; border-radius: 18px; font-size: 17px; font-weight: 500; letter-spacing: -0.01em;
  transition: background-color 0.15s var(--ease);
}
@media (hover: hover) and (pointer: fine) { .menu-item:hover { background: rgba(0, 0, 0, 0.06); } }
.menu-item:active { background: rgba(0, 0, 0, 0.1); }
.menu-item.danger { color: var(--danger); }
.menu-sep { height: 1px; margin: 4px 14px; background: var(--line); }

.scrim {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px;
  background: rgba(0, 0, 0, 0.3); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  opacity: 0; transition: opacity 0.3s var(--ease);
}
.scrim.open { opacity: 1; }
.dialog {
  width: min(420px, 100%); max-height: 86vh; overflow: auto; overscroll-behavior: contain;
  padding: 28px 24px 22px; border-radius: 34px; background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 34px 90px rgba(0, 0, 0, 0.28);
  opacity: 0; transform: translateY(10px) scale(0.94);
  transition: opacity 0.25s var(--ease), transform 0.45s var(--drawer);
}
.scrim.open .dialog { opacity: 1; transform: none; }
.dialog-title { margin: 0 0 6px; font-size: 24px; font-weight: 700; letter-spacing: -0.035em; text-align: center; text-wrap: balance; }
.dialog-text { margin: 0 0 20px; color: var(--ink2); font-size: 15px; text-align: center; text-wrap: balance; }
.dialog .form, .dialog .stack { margin-top: 22px; }
.dialog-text + .form, .dialog-text + .stack { margin-top: 0; }
.form { display: flex; flex-direction: column; gap: 18px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.field label, .field .label { display: block; margin-bottom: 7px; color: var(--ink2); font-size: 13px; font-weight: 600; letter-spacing: -0.005em; }
.input {
  width: 100%; padding: 15px 16px; border-radius: 16px; border: 1px solid var(--control); background: #fff;
  font: inherit; font-size: 17px; color: var(--ink); appearance: none; -webkit-appearance: none;
}
.input:focus { outline: 2px solid var(--ink); outline-offset: 1px; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice {
  appearance: none; border: 0; cursor: pointer; padding: 11px 17px; border-radius: 999px; background: var(--surface);
  font-size: 15px; font-weight: 500; transition: background-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.16s var(--ease);
}
.choice:active { transform: scale(0.96); }
.choice[aria-pressed="true"] { background: var(--ink); color: #fff; }

/* ---------- Photo viewer ---------- */
.lb {
  position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; overflow: hidden;
  overscroll-behavior: contain; visibility: hidden; pointer-events: none; transition: visibility 0s linear 0.36s;
}
.lb.open { visibility: visible; pointer-events: auto; transition-delay: 0s; }
.lb-bg {
  position: absolute; inset: 0; background: color-mix(in srgb, var(--tint, #ffffff) 13%, #ffffff);
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); opacity: 0; transition: opacity 0.3s var(--ease), background-color 0.6s var(--ease);
}
.lb.open .lb-bg { opacity: var(--o, 1); }
.lb img {
  position: relative; display: block; border-radius: 22px; touch-action: none;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.16); user-select: none; -webkit-user-drag: none; will-change: transform;
}
/* The neighbours wait next to the photo, so swiping drags them in like pages */
.lb img { grid-area: 1 / 1; }
.lb .lb-side { will-change: transform; }
.lb-btn {
  position: absolute; appearance: none; border: 0; cursor: pointer; width: 44px; height: 44px; border-radius: 50%;
  background: var(--surface); color: var(--ink); display: grid; place-items: center; opacity: 0;
  transition: opacity 0.25s var(--ease), transform 0.16s var(--ease);
}
.lb.open .lb-btn { opacity: 1; }
.lb-btn:active { transform: scale(0.92); }
.lb-close { top: calc(var(--top) + 16px); right: 16px; }
.lb-nav { top: 50%; margin-top: -22px; }
.lb-nav.prev { left: 16px; }
.lb-nav.next { right: 16px; }
.lb-pin { bottom: calc(24px + var(--bottom)); left: 50%; margin-left: -56px; }
.lb-del { bottom: calc(24px + var(--bottom)); left: 50%; margin-left: 12px; }

.drop {
  position: fixed; inset: 12px; z-index: 50; display: grid; place-items: center;
  border: 2px dashed var(--ink); border-radius: 30px; background: rgba(255, 255, 255, 0.9);
  font-size: 20px; font-weight: 600; letter-spacing: -0.01em; opacity: 0; pointer-events: none; transition: opacity 0.2s var(--ease);
}
.drop.on { opacity: 1; }
.drop p { margin: 0; }

/* ---------- Pins and list cards ---------- */
:root { --link: #007aff; }
.t-pin {
  position: absolute; top: 10px; right: 10px; z-index: 2; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; color: var(--ink); background: rgba(255, 255, 255, 0.88);
  -webkit-backdrop-filter: blur(10px) saturate(1.8); backdrop-filter: blur(10px) saturate(1.8);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18), inset 0 0 0 1px rgba(255, 255, 255, 0.7);
  opacity: 0; transform: scale(0.6) rotate(-30deg); transition: opacity 0.25s var(--ease), transform 0.5s var(--drawer);
}
.t-pin svg { width: 16px; height: 16px; }
.t-pin .pinhead { fill: currentColor; }
.tile.pinned .t-pin { opacity: 1; transform: none; }
@media (hover: hover) and (pointer: fine) { .tile.pinned:hover .t-pin { transform: scale(1.12) rotate(-12deg); } }

/* Which goal an item belongs to, on the combined "Doelen" moodboard */
.t-goal {
  position: absolute; left: 10px; bottom: 10px; z-index: 2; max-width: calc(100% - 56px);
  padding: 5px 11px; border-radius: 999px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  font-size: 12px; font-weight: 600; letter-spacing: -0.005em; color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: blur(10px) saturate(1.8); backdrop-filter: blur(10px) saturate(1.8);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12), inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.t-in.note-in { background: #f7f7f9; padding: 18px 18px 0; cursor: pointer; }
.t-in.note-in::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 52px; z-index: 1; pointer-events: none;
  background: linear-gradient(to top, #f7f7f9 12%, rgba(247, 247, 249, 0)); opacity: 0; transition: opacity 0.3s var(--ease);
}
.t-in.note-in.clip::before { opacity: 1; }
@media (hover: hover) and (pointer: fine) {
  .tile:hover .t-in.note-in { transform: translateY(-3px); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06), 0 16px 36px rgba(0, 0, 0, 0.1); }
}
.tile:active .t-in.note-in { transform: scale(0.985); }
.tile { text-align: left; }
.tile .note-body { pointer-events: none; text-align: left; }

/* Apple Notes feel: system font, bold title on the first line, quiet list styling */
.note-body, .ed { font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", system-ui, "Inter", sans-serif; }
.note-body { height: 100%; overflow: hidden; font-size: 14.5px; line-height: 1.36; letter-spacing: -0.01em; word-break: break-word; }
.note-body ul, .ed ul { margin: 3px 0; padding-left: 22px; }
.note-body ul.check, .ed ul.check { list-style: none; padding-left: 0; }
.note-body ul.check li { position: relative; min-height: 20px; padding-left: 26px; margin: 3px 0; }
.note-body ul.check li::before { content: ""; position: absolute; left: 1px; top: calc((1.36em - 16px) / 2); width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--control); }
.note-body ul.check li[data-done]::before { background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 10px no-repeat; }
.note-body ul.check li[data-done] { color: var(--control); }
.note-body a { color: var(--link); }
.note-measure { position: absolute; left: -9999px; top: 0; visibility: hidden; height: auto; overflow: visible; padding: 18px 18px 20px; box-sizing: border-box; }

.peek { position: fixed; z-index: 47; padding: 18px 18px 0; box-sizing: border-box; overflow: hidden; pointer-events: none; will-change: transform, opacity; }

/* The list editor: grows out of its card */
.nv {
  position: fixed; inset: 0; z-index: 45; display: flex; flex-direction: column; align-items: center; overflow: hidden;
  overscroll-behavior: contain; visibility: hidden; pointer-events: none; transition: visibility 0s linear 0.7s;
}
.nv.open { visibility: visible; pointer-events: auto; transition-delay: 0s; }
.nv-bg { position: absolute; inset: 0; background: rgba(255, 255, 255, 0.97); opacity: 0; transition: opacity 0.35s var(--ease); }
.nv.open .nv-bg { opacity: 1; }
.nv-top, .nv-fmt { position: relative; opacity: 0; transition: opacity 0.25s var(--ease); }
.nv.open .nv-top, .nv.open .nv-fmt { opacity: 1; }
.nv-top { width: 100%; display: flex; justify-content: flex-end; gap: 10px; padding: calc(var(--top) + 12px) 16px 0; }
.nv-fmt { margin-top: 12px; display: flex; gap: 2px; padding: 5px; border-radius: 999px; }
.fbtn {
  appearance: none; border: 0; background: none; cursor: pointer; width: 46px; height: 38px; border-radius: 999px;
  display: grid; place-items: center; color: var(--ink); font-size: 18px; user-select: none; -webkit-user-select: none;
  transition: background-color 0.2s var(--ease), transform 0.16s var(--ease);
}
.fbtn:active { transform: scale(0.92); }
.fbtn[aria-pressed="true"] { background: rgba(0, 0, 0, 0.09); }
.fbtn i { font-family: "New York", Georgia, serif; font-size: 20px; }
.nv-card {
  position: relative; flex: 1; min-height: 0; width: min(680px, calc(100% - 32px)); transform-origin: 0 0; will-change: transform;
  margin: 14px 16px calc(24px + var(--bottom)); overflow: auto; overscroll-behavior: contain; background: #fff; border-radius: 30px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 30px 80px rgba(0, 0, 0, 0.16), inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}
.ed {
  transform-origin: 0 0; min-height: 100%; padding: 30px 30px 90px; outline: none; caret-color: var(--ink); text-align: left;
  font-size: 17px; line-height: 1.35; letter-spacing: -0.012em; white-space: pre-wrap; word-break: break-word;
}
.ed ::selection, .ed::selection { background: rgba(0, 122, 255, 0.2); }
.ed ul.check li { position: relative; min-height: 25px; padding-left: 34px; margin: 3px 0; }
.ed ul.check li::before {
  content: ""; position: absolute; left: 4px; top: calc((1.35em - 21px) / 2); width: 21px; height: 21px; border-radius: 50%;
  border: 1.7px solid var(--control); cursor: pointer; transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.ed ul.check li[data-done]::before { background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 13px no-repeat; }
.ed ul.check li[data-done] { color: var(--control); }
.ed a { color: var(--link); text-decoration: underline; text-decoration-color: rgba(0, 122, 255, 0.35); text-underline-offset: 3px; }
.link-draft { color: var(--control); }
[aria-pressed="true"] svg .pinhead { fill: currentColor; }

@media (max-width: 560px) {
  .title { font-size: 36px; }
  .row { padding: 18px 18px 18px 20px; }
  .row-name { font-size: 22px; }
  .stack3 { width: 124px; height: 72px; }
  .stack3 .sp { top: 5px; width: 60px; height: 60px; border-radius: 15px; }
  .sp.s1 { right: 28px; }
  .sp.s2 { right: 56px; }
  .tab, .tool { min-width: 108px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 14px; }
}

@media (prefers-reduced-transparency: reduce) {
  .glass, .menu, .capsule, .scrim, .lb-bg { background: #fff; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
}

/* Reduced motion: fewer and gentler, not zero. Keep fades, drop movement. */
@media (prefers-reduced-motion: reduce) {
  .tile, .sp, .capsule { transition: none; }
  .t-in img, .cell img { transition: opacity 0.25s linear; }
  .tile:hover .t-in img, .card:hover .cell img { transform: none !important; }
  .enter .row, .enter .card, .enter .section, .enter .empty, .tile.pop .t-in, .toolbar, .toast, .status { animation-name: fade; }
  @keyframes fade { from { opacity: 0; } }
  .menu, .dialog { transform: none; }
}

/* ---------- Extra tiles (preview): link/product, book, color, quote ---------- */
.t-in.card-in { display: flex; flex-direction: column; background: #fff; cursor: pointer; text-align: left; }
.tile .cv { position: relative; flex: 1; min-height: 0; overflow: hidden; background: #ececef; }
.tile .cv img { position: absolute; inset: 0; }
.cv.nocover { display: grid; place-items: center; padding: 14px; background: #f3f3f5; color: var(--ink2); font-size: 15px; font-weight: 600; text-align: center; letter-spacing: -0.01em; }
.cap { flex: none; padding: 11px 14px 13px; display: flex; flex-direction: column; justify-content: center; gap: 2px; background: #fff; text-align: left; }
.card-in .cap { height: 68px; }
.card-in.plain .cap { height: 100%; justify-content: flex-start; padding-top: 16px; }
.cap-t { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-in.plain .cap-t { -webkit-line-clamp: 3; font-size: 15px; }
.cap-s { font-size: 12.5px; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; gap: 6px; }
.cap-s b { font-weight: 700; color: var(--ink); }
.tile .t-in.card-in .t-goal { bottom: auto; top: 10px; }
@media (hover: hover) and (pointer: fine) { .tile:hover .t-in.card-in, .tile:hover .t-in.quote-in { transform: translateY(-3px); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06), 0 16px 36px rgba(0, 0, 0, 0.1); } .tile:hover .t-in.color-in { transform: translateY(-3px); } }

.t-in.color-in { display: flex; align-items: flex-end; padding: 16px; cursor: copy; text-align: left; }
.t-in.color-in::after { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08); }
.col-meta { display: flex; flex-direction: column; gap: 2px; text-align: left; }
.col-name { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.col-hex { font-size: 12.5px; font-weight: 500; letter-spacing: 0.04em; opacity: 0.72; font-variant-numeric: tabular-nums; }

.t-in.quote-in { display: flex; flex-direction: column; justify-content: center; gap: 12px; padding: 22px 22px 20px; background: #f7f7f9; cursor: copy; text-align: left; }
.q { font-family: ui-serif, "New York", "Iowan Old Style", Georgia, serif; font-size: 18px; line-height: 1.38; letter-spacing: -0.012em; color: var(--ink); overflow: hidden; white-space: pre-wrap; word-break: break-word; }
.q-a { font-size: 12.5px; color: var(--ink2); font-weight: 500; letter-spacing: 0.01em; }

.pick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; max-height: 190px; overflow: auto; padding: 3px; }
.pick { appearance: none; padding: 0; border: 0; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: #ececef; cursor: pointer; transition: transform 0.25s var(--ease); }
.pick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pick:active { transform: scale(0.95); }
.pick[aria-pressed="true"] { outline: 2.5px solid var(--ink); outline-offset: 2px; }
.res-list { display: flex; flex-direction: column; gap: 4px; max-height: 320px; overflow: auto; }
.res { appearance: none; border: 0; background: none; display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 14px; text-align: left; cursor: pointer; font: inherit; color: var(--ink); transition: background-color 0.2s var(--ease); }
.res:hover { background: var(--surface); }
.res img, .res-none { flex: none; width: 38px; height: 57px; border-radius: 5px; object-fit: cover; background: #ececef; }
.res-t { display: flex; flex-direction: column; min-width: 0; font-size: 13px; color: var(--ink2); }
.res-t b { color: var(--ink); font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.color-row { display: flex; gap: 10px; align-items: center; }
.swatch { flex: none; width: 52px; height: 48px; padding: 0; border: 0; border-radius: 14px; background: none; cursor: pointer; }
.swatch::-webkit-color-swatch-wrapper { padding: 0; }
.swatch::-webkit-color-swatch { border: 1px solid rgba(0, 0, 0, 0.08); border-radius: 14px; }
.swatch::-moz-color-swatch { border: 1px solid rgba(0, 0, 0, 0.08); border-radius: 14px; }
.color-row .input { flex: 1; font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }

/* video badge, palette, word poster */

.t-in.pal-in { display: flex; cursor: copy; background: #fff; }
.t-in.pal-in i { flex: 1; display: block; transition: flex 0.5s var(--ease); }
@media (hover: hover) and (pointer: fine) { .tile:hover .t-in.pal-in i:hover { flex: 1.7; } }

.t-in.word-in { container-type: inline-size; display: flex; flex-direction: column; justify-content: center; gap: 10px; padding: 0 28px; background: #fff; cursor: copy; text-align: left; }
.t-in.word-in::after { box-shadow: inset 0 0 0 5px #1C1C1E; }
.w-word { font-family: ui-serif, "New York", "Iowan Old Style", Georgia, serif; font-weight: 600; letter-spacing: -0.03em; line-height: 1.05; color: #111; white-space: nowrap; }
.w-pron { font-family: ui-serif, "New York", "Iowan Old Style", Georgia, serif; font-size: 12.5px; color: #1C1C1E; display: flex; gap: 5px; flex-wrap: wrap; }
.w-pron em { font-style: italic; }
.w-def { margin-top: 10px; font-family: ui-serif, "New York", "Iowan Old Style", Georgia, serif; font-size: 11.5px; line-height: 1.45; color: #3a3a3c; display: -webkit-box; -webkit-line-clamp: 7; -webkit-box-orient: vertical; overflow: hidden; }

/* cleaner tiles: pictures alone, a small name chip where needed */
.t-label {
  position: absolute; left: 10px; bottom: 10px; z-index: 2; max-width: calc(100% - 56px);
  padding: 6px 12px; border-radius: 999px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  font-size: 12.5px; font-weight: 600; letter-spacing: -0.005em; color: var(--ink); text-align: left;
  background: rgba(255, 255, 255, 0.84);
  -webkit-backdrop-filter: blur(10px) saturate(1.8); backdrop-filter: blur(10px) saturate(1.8);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12), inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}
.t-in.has-label .t-goal { bottom: auto; top: 10px; }
.t-in .play {
  position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; z-index: 1;
  background: rgba(255, 255, 255, 0.92) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9.5 7.2v9.6a.8.8 0 001.2.7l7.6-4.8a.8.8 0 000-1.4L10.7 6.5a.8.8 0 00-1.2.7z' fill='%231d1d1f'/%3E%3C/svg%3E") 54% 50% / 24px no-repeat;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22); pointer-events: none; transition: transform 0.35s var(--drawer);
}
@media (hover: hover) and (pointer: fine) { .tile:hover .t-in .play { transform: scale(1.08); } }
.t-in.nocover-in { display: grid; place-items: center; padding: 16px; background: #f3f3f5; color: var(--ink2); font-size: 15px; font-weight: 600; text-align: center; letter-spacing: -0.01em; cursor: pointer; }
.t-in.quote-in { background: #f3f3f5; padding: 20px 22px; gap: 10px; }
.t-in.quote-in::after { display: none; }
.q { line-height: 1.38; }

/* ---------- one design language for the extra tiles ---------- */
.dialog-title:empty { display: none; }
.dialog:has(.detail) { width: min(400px, calc(100vw - 32px)); }

/* quote: paper, stone or ink, with a small opening mark */
.quote-in { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 6px; text-align: left; }
.t-in.quote-in { padding: 18px 22px 20px; cursor: copy; }
.tone-paper { background: #f4f1ea; color: #1C1C1E; }
.tone-stone { background: #ebebee; color: #1C1C1E; }
.tone-ink { background: #1c1c1e; color: #f5f5f7; }
.tone-ink .q, .tone-ink .q-a { color: #f5f5f7; }
.tone-ink .q-a { opacity: 0.6; }
.tone-paper .q, .tone-stone .q { color: #1C1C1E; }
.q-mark { font-family: ui-serif, "New York", "Iowan Old Style", Georgia, serif; font-size: 40px; line-height: 0.7; height: 18px; opacity: 0.28; margin-bottom: 2px; }
.q-a { margin-top: 4px; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.55; color: inherit; }
.q-a::before { content: "— "; }
.d-quote { padding: 28px 28px 30px; border-radius: 22px; }
.d-quote .q { font-size: 21px !important; line-height: 1.4; }
.d-quote .q-mark { font-size: 54px; height: 26px; }

/* word: a framed print */
.word-in { container-type: inline-size; display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 0 32px; background: #fff; text-align: left; }
.t-in.word-in { cursor: copy; }
.word-in::after, .t-in.word-in::after { content: ""; position: absolute; inset: 9px; border-radius: 15px; border: 1.5px solid #1C1C1E; box-shadow: none; pointer-events: none; }
.t-in.word-in::after { inset: 9px; }
.w-word { font-size: 34px; }
.w-pron { font-size: 12.5px; opacity: 0.85; }
.w-def { margin-top: 12px; padding-top: 14px; position: relative; font-size: 11.5px; }
.w-def::before { content: ""; position: absolute; left: 0; top: 0; width: 22px; height: 1.5px; background: #1C1C1E; opacity: 0.8; }
.d-poster { position: relative; aspect-ratio: 3 / 3.7; border-radius: 22px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08); }
.d-poster .w-def { -webkit-line-clamp: 12; }

/* palette: little rounded swatches */
.t-in.pal-in { gap: 4px; padding: 4px; background: #fff; }
.t-in.pal-in i { border-radius: 18px; }
.t-in.pal-in::after { display: none; }

/* place chip with a marker */
.t-label { display: inline-flex; align-items: center; gap: 5px; }
.t-label .ic { display: inline-flex; flex: none; opacity: 0.7; }

/* product caption */
.cap { padding: 12px 15px 14px; gap: 3px; }
.cap-t { font-size: 13.5px; font-weight: 500; color: var(--ink2); }
.cap-s b { font-size: 15px; letter-spacing: -0.02em; }
.cap-s { align-items: baseline; }

/* detail view */
.detail { display: flex; flex-direction: column; gap: 12px; margin-top: 0; }
.d-cover { display: grid; place-items: center; border-radius: 20px; overflow: hidden; max-height: 46vh; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06); }
.d-cover img { display: block; max-width: 100%; max-height: 46vh; object-fit: contain; }
.d-head { display: flex; flex-direction: column; gap: 4px; align-items: center; padding: 6px 4px 8px; text-align: center; }
.d-t { font-size: 22px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.2; text-wrap: balance; }
.d-price { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.d-s { font-size: 14px; color: var(--ink2); }
.d-swatch { height: 200px; border-radius: 22px; padding: 20px; display: flex; flex-direction: column; justify-content: flex-end; text-align: left; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06); }
.d-palette { display: flex; flex-direction: column; gap: 4px; }
.d-chip { appearance: none; border: 0; height: 52px; padding: 0 18px; border-radius: 16px; text-align: left; font: inherit; font-size: 13.5px; font-weight: 600; letter-spacing: 0.05em; cursor: pointer; transition: transform 0.25s var(--ease); }
.d-chip:first-child { border-radius: 22px 22px 16px 16px; }
.d-chip:last-child { border-radius: 16px 16px 22px 22px; }
.d-chip:active { transform: scale(0.98); }

/* word: no frame, a calm paper tone, only as tall as it needs to be */
.word-in::after, .t-in.word-in::after { display: none; }
.word-in { background: #f4f1ea; padding: 22px 26px; gap: 6px; }
.w-def { margin-top: 10px; padding-top: 12px; }
.d-poster { aspect-ratio: auto; min-height: 240px; padding: 34px 30px; box-shadow: none; }

/* stack: three cards, the top one a little forward */
.t-in.stack-in { overflow: visible; background: none; }
.t-in.stack-in::after { display: none; }
.sl { position: absolute; overflow: hidden; border-radius: 22px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06); }
.sl img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.4s var(--ease); }
.sl.loaded img { opacity: 1; }
.sl2 { left: 18px; right: 18px; top: 0; bottom: 20px; filter: brightness(0.96); }
.sl1 { left: 9px; right: 9px; top: 8px; bottom: 10px; filter: brightness(0.98); }
.sl0 { left: 0; right: 0; top: 16px; bottom: 0; }
.tile { --lift: 0px; }
@media (hover: hover) and (pointer: fine) { .tile:hover .t-in.stack-in .sl0 { transform: translateY(2px); } .tile:hover .t-in.stack-in .sl2 { transform: translateY(-3px); } }
.sl { transition: transform 0.4s var(--ease); }

/* dragging onto another tile: it opens up, the dragged one shrinks */
.tile.stack-target .t-in { transform: scale(1.05); box-shadow: 0 0 0 3px var(--ink), 0 18px 40px rgba(0, 0, 0, 0.18); transition: transform 0.35s var(--drawer), box-shadow 0.3s var(--ease); }
.tile.dragging.will-stack .t-in { transform: scale(0.8); opacity: 0.88; transition: transform 0.35s var(--drawer), opacity 0.3s var(--ease); }

.tile.stack-hint .t-in { transform: scale(1.025); transition: transform 0.3s var(--drawer), box-shadow 0.3s var(--ease); }
.tile.stack-target .t-in { transform: scale(1.06); }

/* stack: a swipeable pile with dots */
.st-strip { left: 0; right: 0; top: 16px; bottom: 0; }
.st-slide { position: absolute; inset: 0; will-change: transform; }
.st-slide img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.4s var(--ease); }
.st-slide.loaded img { opacity: 1; }
.st-dots {
  position: absolute; left: 50%; bottom: 10px; z-index: 3; display: flex; padding: 0 6px; border-radius: 999px; transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.28); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.st-dot { width: 14px; height: 20px; display: grid; place-items: center; cursor: pointer; }
.st-dot::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, 0.5); transition: transform 0.3s var(--drawer), background-color 0.2s var(--ease); }
.st-dot.on::after { background: #fff; transform: scale(1.3); }
.tile { touch-action: pan-y; }

/* ---------- stack: calmer ---------- */
.sl2, .sl1 { filter: none; }
.sl2 { left: 22px; right: 22px; top: 0; bottom: 24px; }
.sl1 { left: 11px; right: 11px; top: 7px; bottom: 12px; }
.st-strip { top: 14px; }
.st-slide { will-change: auto; }
.tile.stack-hint .t-in { transform: scale(1.02); transition: transform 0.45s var(--drawer); }
.tile.stack-target .t-in { transform: scale(1.045); box-shadow: 0 22px 44px rgba(0, 0, 0, 0.16); transition: transform 0.45s var(--drawer), box-shadow 0.45s var(--ease); }
.tile.dragging.will-stack .t-in { transform: scale(0.9); opacity: 0.92; transition: transform 0.45s var(--drawer), opacity 0.3s var(--ease); }
.tile.settle .t-in { animation: settle 0.42s var(--drawer) both; }
@keyframes settle { from { transform: scale(0.965); opacity: 0.7; } }

/* ---------- stack, big ---------- */
.sv { position: fixed; inset: 0; z-index: 41; display: grid; place-items: center; overflow: hidden; overscroll-behavior: contain; visibility: hidden; pointer-events: none; transition: visibility 0s linear 0.55s; }
.sv.open { visibility: visible; pointer-events: auto; transition-delay: 0s; }
.sv-bg { position: absolute; inset: 0; background: rgba(255, 255, 255, 0.96); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); opacity: 0; transition: opacity 0.3s var(--ease); }
.sv.open .sv-bg { opacity: var(--o, 1); }
.sv .lb-btn { opacity: 0; }
.sv.open .lb-btn { opacity: 1; }
.sv-card { position: relative; will-change: transform; }
.sv-peek { position: absolute; border-radius: 22px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06); }
.sv-peek.p1 { left: 14px; right: 14px; top: -10px; bottom: 10px; }
.sv-peek.p2 { left: 28px; right: 28px; top: -20px; bottom: 20px; }
.sv-frame { position: relative; width: 100%; height: 100%; border-radius: 22px; overflow: hidden; touch-action: none; background: #ececef; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.16); cursor: grab; }
.sv-slide { position: absolute; inset: 0; }
.sv-slide img { display: block; width: 100%; height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.sv-dots { position: absolute; left: 50%; bottom: calc(30px + var(--bottom)); transform: translateX(-50%); display: flex; }
.sv-dot { width: 17px; height: 24px; display: grid; place-items: center; cursor: pointer; }
.sv-dot::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: rgba(0, 0, 0, 0.2); transition: transform 0.3s var(--drawer), background-color 0.2s var(--ease); }
.sv-dot.on::after { background: var(--ink); transform: scale(1.3); }
@media (hover: none) { .sv .lb-nav { display: none; } }

/* ---------- stack: photos fanned out behind, a little ---------- */
.sl, .st-strip { left: 0; right: 0; top: 0; bottom: 0; }
.sl img { opacity: 1; }
.sl2 { transform: rotate(-2.6deg); }
.sl1 { transform: rotate(2.2deg); }
.sl { transition: transform 0.55s var(--drawer); }
.tile:hover .t-in.stack-in .sl0 { transform: none; }
.t-in.stack-in .st-slide img { transform: none !important; }
@media (hover: hover) and (pointer: fine) {
  .tile:hover .t-in.stack-in .sl2 { transform: rotate(-4.4deg); }
  .tile:hover .t-in.stack-in .sl1 { transform: rotate(3.8deg); }
  .tile:hover .t-in.stack-in img { transform: none; }
}

/* dragging a photo onto another: cards fan out behind it, exactly like the finished stack */
.tile::before, .tile::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; bottom: 0; z-index: -1; border-radius: 22px; pointer-events: none;
  background: var(--pc, #e4e4e8); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06); opacity: 0;
  transition: transform 0.55s var(--drawer), opacity 0.3s var(--ease);
}
.tile.is-stack::before, .tile.is-stack::after { display: none; }
.tile.stack-hint:not(.is-stack)::before { opacity: 0.5; transform: rotate(-1deg); }
.tile.stack-hint:not(.is-stack)::after { opacity: 0.5; transform: rotate(0.9deg); }
.tile.stack-target:not(.is-stack)::before { opacity: 1; transform: rotate(-2.6deg); }
.tile.stack-target:not(.is-stack)::after { opacity: 1; transform: rotate(2.2deg); }
.tile.stack-hint .t-in, .tile.stack-target .t-in { transform: none; box-shadow: none; }
.tile.stack-target.is-stack .sl2 { transform: rotate(-4.4deg); }
.tile.stack-target.is-stack .sl1 { transform: rotate(3.8deg); }
.tile.dragging.will-stack .t-in { transform: scale(0.94); opacity: 0.95; transition: transform 0.45s var(--drawer), opacity 0.3s var(--ease); }
.tile.settle .t-in { animation: none; }

/* big view */
.sv-peek { left: 0; right: 0; top: 0; bottom: 0; overflow: hidden; }
.sv-peek img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.sv-peek.p2 { transform: rotate(-2.6deg); }
.sv-peek.p1 { transform: rotate(2.2deg); }
.sv-slide.cover img { object-fit: cover; }

.sv-frame { isolation: isolate; transform: translateZ(0); }
.sv-slide { backface-visibility: hidden; }

/* ---------- deck (stack cards) ---------- */
@property --fan { syntax: '<number>'; inherits: true; initial-value: 1; }
@property --cr { syntax: '<length>'; inherits: true; initial-value: 22px; }
.dk { position: absolute; left: 0; right: 0; top: 0; bottom: 0; isolation: isolate; --fan: 1; transition: --fan 0.45s var(--drawer); }
.dk-card {
  position: absolute; left: 0; right: 0; top: 0; bottom: 0; overflow: hidden; border-radius: var(--cr, 22px);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06); background: #ececef;
  transform: translate3d(var(--x, 0px), 0, 0) rotate(calc(var(--d, 0) * var(--fan) * 1deg));
  will-change: transform, opacity; backface-visibility: hidden;
}
.dk-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity 0.35s var(--ease); user-select: none; -webkit-user-drag: none; transform: none !important; }
.dk-card.loaded img { opacity: 1; }
.dk-card.instant img { transition: none; }
.dk-card.contain img { object-fit: contain; }
@media (hover: hover) and (pointer: fine) { .tile:hover .dk { --fan: 1.7; } }
.tile.stack-target .dk { --fan: 1.9; }
.sv-card .dk-card { box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05), 0 18px 50px rgba(0, 0, 0, 0.14); }
.sv-card .dk { touch-action: none; cursor: grab; }

.gbtn.glass.on { background: rgba(29, 29, 31, 0.92); color: #fff; }

/* word: a hairline edge like the photos, and the same soft zoom on hover */
.t-in.word-in::after { content: ""; display: block; position: absolute; inset: 0; border-radius: inherit; border: 0; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08); pointer-events: none; }
.t-in.word-in > .w-word, .t-in.word-in > .w-pron, .t-in.word-in > .w-def { transition: transform 0.55s var(--ease); transform-origin: 0 50%; }
@media (hover: hover) and (pointer: fine) {
  .tile:hover .t-in.word-in { transform: none; box-shadow: none; }
  .tile:hover .t-in.word-in > .w-word, .tile:hover .t-in.word-in > .w-pron, .tile:hover .t-in.word-in > .w-def { transform: scale(1.045); }
}
.d-poster::after { display: none; }
.d-poster { box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08); }

.own-prev { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 16px; background: var(--surface); font-size: 14px; font-weight: 600; }
.own-prev img { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; }

/* any tile can sit in a stack: its face fills the card and stays calm */
.dk-card .t-in { transform: none !important; transition: none !important; box-shadow: none; }
.dk-card .t-in::after { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06); }

/* caption under the photo */
.lb-cap { position: absolute; left: 0; right: 0; bottom: calc(80px + var(--bottom)); display: flex; justify-content: center; opacity: 0; transition: opacity 0.25s var(--ease); z-index: 2; }
.lb.open .lb-cap { opacity: 1; }
.lb-cap input { width: min(520px, calc(100vw - 48px)); box-sizing: border-box; padding: 9px 14px; border: 0; border-radius: 14px; background: transparent; outline: none; text-align: center; font: inherit; font-size: 17px; letter-spacing: -0.01em; color: var(--ink); transition: background-color 0.2s var(--ease); }
.lb-cap input::placeholder { color: #b4b4b9; }
.lb-cap input:focus { background: rgba(0, 0, 0, 0.045); }

/* a board opens with its first photos rising in one after the other */
.tile.intro .t-in { animation: rise 0.5s var(--drawer) both; animation-delay: calc(var(--i, 0) * 38ms); }
@keyframes rise { from { opacity: 0; transform: translate3d(0, 16px, 0) scale(0.985); } }
@media (prefers-reduced-motion: reduce) { .tile.intro .t-in { animation: none; } }

/* ---------- wallpaper ---------- */
.dialog:has(.wp) { width: min(720px, calc(100vw - 32px)); }
.wp { margin-top: 18px; gap: 18px; }
.wp-stage { position: relative; width: 100%; border-radius: 16px; overflow: hidden; background: #f2f2f4; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08), 0 14px 36px rgba(0, 0, 0, 0.1); aspect-ratio: 16 / 10; transition: aspect-ratio 0.3s var(--ease); }
.wp-canvas { display: block; width: 100%; height: 100%; }
.wp-status { position: absolute; inset: 0; display: grid; place-items: center; font-size: 14px; color: var(--ink2); }
.wp-row { display: flex; gap: 20px; align-items: flex-end; flex-wrap: wrap; }
.wp-row > .field:first-child { flex: 1; min-width: 240px; }
.wp-sws { display: flex; gap: 10px; height: 44px; align-items: center; }
.wp-sw { appearance: none; width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.14); cursor: pointer; transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease); }
.wp-sw:active { transform: scale(0.92); }
.wp-sw[aria-pressed="true"] { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.14), 0 0 0 2px #fff, 0 0 0 4px var(--ink); }
.wp-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dialog:has(.wp) { max-height: calc(100vh - 32px); overflow-y: auto; }
.wp-stage { margin: 0 auto; }

/* ---------- feel: lean while dragging, spring on landing, blur to sharp, light in glass ---------- */
.tile.spring { transition: transform 0.5s cubic-bezier(0.3, 1.4, 0.5, 1); }

.t-in img { transition: opacity 0.4s var(--ease), transform 0.55s var(--ease); }
.t-in.instant img { transition: transform 0.55s var(--ease); }
.dk-card .t-in img, .t-in.stack-in img { filter: none; }

.gbtn { position: relative; }
.gbtn .spot { position: absolute; left: 0; top: 0; right: 0; bottom: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity 0.35s var(--ease);
  background: radial-gradient(circle 46px at var(--mx, 50%) var(--my, 30%), rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0) 70%); }
@media (hover: hover) and (pointer: fine) { .gbtn:hover .spot { opacity: 1; } }

.tile.first .t-in { animation: first 0.7s cubic-bezier(0.3, 1.25, 0.5, 1) both; }
@keyframes first { from { opacity: 0; transform: translate3d(0, 46px, 0) scale(0.84); } 60% { opacity: 1; } }

@keyframes fan { from { --fan: 0; } }
.tile.fan-in .dk { animation: fan 0.6s cubic-bezier(0.3, 1.5, 0.6, 1) both; }


@media (prefers-reduced-motion: reduce) {
  .tile.first .t-in, .tile.fan-in .dk { animation: none; }
  .tile.spring { transition: none; }
}

/* a pinned list leaves room for its pin in the first lines */
.tile.pinned .note-body::before { content: ""; float: right; width: 30px; height: 26px; }

/* ---------- smoother everywhere ---------- */
.menu { transition: opacity 0.18s var(--ease), transform 0.42s cubic-bezier(0.2, 1.1, 0.3, 1); }
.menu.open .menu-item { animation: item-in 0.45s var(--drawer) both; animation-delay: calc(var(--k, 0) * 26ms + 40ms); }
@keyframes item-in { from { opacity: 0; transform: translateY(-6px); } }
.dialog { transition: opacity 0.25s var(--ease), transform 0.46s cubic-bezier(0.2, 1.1, 0.3, 1); }
.tabs { transition: opacity 0.3s var(--ease), transform 0.5s var(--drawer); }
.tabs.away { opacity: 0; transform: translateX(-50%) translateY(22px) scale(0.95); pointer-events: none; }

/* pinching and changing a tile's shape: size and place glide together */
.grid.morph .tile { transition: none; }


/* every touch answers at once: a small press on everything you can tap */
.card, .choice, .res, .cap-pill { transition: transform 0.14s var(--ease), background-color 0.2s var(--ease); }
.card:active, .choice:active, .res:active { transform: scale(0.97); }
.row { transition: transform 0.14s var(--ease), background-color 0.25s var(--ease), box-shadow 0.4s var(--ease); }

/* reduced motion: one rule for the CSS, the code checks it for the rest */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* the goal badge and the name chips need room: on small tiles they would show a single letter, so they step aside */
.tile { container-type: inline-size; }
@container (max-width: 132px) { .t-goal, .t-label { display: none; } }

/* ---------- Plek: kiezen en inrichten ---------- */
.dialog.wide { width: min(460px, 100%); padding: 24px 22px 20px; }
.pl-root { transition: opacity 0.15s var(--ease), transform 0.15s var(--ease); }
.pl-root.out { opacity: 0; transform: translateY(6px); }
.pl-rise { animation: plrise 0.45s var(--drawer) both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes plrise { from { opacity: 0; transform: translate3d(0, 10px, 0); } }
.res-pin { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--ink2); }
.res-pin svg { width: 17px; height: 17px; }

.pl { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.pl-save { display: flex; gap: 10px; }
.pl-save .input { padding: 13px 16px; font-size: 16px; flex: 1; min-width: 0; }
.pl-save .btn { flex: none; padding-inline: 24px; }
.pl-stage {
  position: relative; height: clamp(230px, 36vh, 330px); border-radius: 30px; overflow: hidden; background: #f1f1f3;
  touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; isolation: isolate;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06); animation: plstage 0.7s var(--drawer) both;
}
@keyframes plstage { from { opacity: 0; transform: scale(0.97); } }
.pl-stage.drag { cursor: grabbing; }
.pl-ghost { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 1; }
.pl-ghost { transition: opacity 0.5s var(--ease); pointer-events: none; }
.pl-frame {
  position: absolute; z-index: 2; border-radius: 22px; pointer-events: none;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.14), 0 0 0 700px rgba(255, 255, 255, 0.82);
  transition: left 0.5s var(--drawer), top 0.5s var(--drawer), width 0.5s var(--drawer), height 0.5s var(--drawer), border-radius 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.pl-frame::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1); pointer-events: none; z-index: 3; }
.pl-frame[data-view="kaartje"] { border-radius: 22px 22px 0 0; }
.pl-frame[data-view="poster"], .pl-frame[data-view="foto"] { box-shadow: 0 12px 34px rgba(0, 0, 0, 0.14), 0 0 0 700px rgba(255, 255, 255, 0.9); }
.pl-face { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; opacity: 0; transition: opacity 0.3s var(--ease); }
.pl-frame[data-view="poster"] .pl-face, .pl-frame[data-view="foto"] .pl-face { opacity: 1; }
.pl-face img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pl-frame .t-label { transition: opacity 0.25s var(--ease); }
.pl-frame .t-label[hidden] { display: inline-flex; opacity: 0; }
.pl-cap {
  position: absolute; z-index: 2; height: 66px; border-radius: 0 0 22px 22px; opacity: 0; transform: translateY(-8px); pointer-events: none;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.14), inset 0 0 0 1px rgba(0, 0, 0, 0.1);
  transition: opacity 0.3s var(--ease), transform 0.5s var(--drawer), left 0.5s var(--drawer), top 0.5s var(--drawer), width 0.5s var(--drawer);
}
.pl-cap.on { opacity: 1; transform: none; }
.pl-ctl {
  position: absolute; z-index: 4; right: 12px; bottom: 12px; display: flex; flex-direction: column; border-radius: 16px; overflow: hidden;
  background: rgba(255, 255, 255, 0.92); box-shadow: 0 2px 14px rgba(0, 0, 0, 0.16), inset 0 0 0 1px rgba(255, 255, 255, 0.7);
  -webkit-backdrop-filter: blur(12px) saturate(1.8); backdrop-filter: blur(12px) saturate(1.8);
  transition: opacity 0.3s var(--ease), transform 0.4s var(--drawer);
}
.pl-stage.flat .pl-ctl { opacity: 0; transform: scale(0.9); pointer-events: none; }
.pl-cb { appearance: none; border: 0; background: none; width: 40px; height: 40px; display: grid; place-items: center; color: var(--ink); cursor: pointer; transition: background-color 0.15s var(--ease), transform 0.15s var(--ease); }
.pl-cb + .pl-cb { box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.07); }
.pl-cb:hover { background: rgba(0, 0, 0, 0.05); }
.pl-cb:active { background: rgba(0, 0, 0, 0.1); transform: scale(0.92); }
.pl-credit { position: absolute; z-index: 3; left: 14px; right: 66px; bottom: 2px; font-size: 8.5px; line-height: 11px; color: rgba(60, 60, 67, 0.5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; transition: opacity 0.3s var(--ease); pointer-events: none; }
.pl-credit.on { opacity: 1; }

.seg { position: relative; display: grid; grid-template-columns: repeat(var(--n, 3), 1fr); padding: 4px; border-radius: 20px; background: var(--surface); }
.seg::before {
  content: ""; position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / var(--n, 3)); border-radius: 16px; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(0, 0, 0, 0.05);
  transform: translateX(calc(var(--i, 0) * 100%)); transition: transform 0.5s var(--drawer);
}
.seg button {
  position: relative; appearance: none; border: 0; background: none; padding: 8px 4px 7px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  font: inherit; font-size: 12px; font-weight: 600; color: var(--ink2); cursor: pointer; transition: color 0.25s var(--ease), transform 0.18s var(--ease);
}
.seg button:active { transform: scale(0.95); }
.seg button[aria-pressed="true"] { color: var(--ink); }

.pl-opts { display: flex; flex-direction: column; gap: 14px; }
.pl-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.pl-lab { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sw-row { display: flex; justify-content: space-between; gap: 8px; }
.sw-row.few { justify-content: flex-start; gap: 22px; }
.sw { appearance: none; border: 0; padding: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 7px; font: inherit; font-size: 11.5px; font-weight: 500; color: var(--ink2); cursor: pointer; transition: color 0.2s var(--ease); }
.sw i { position: relative; display: block; width: 50px; height: 50px; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1); transition: transform 0.4s var(--drawer), box-shadow 0.25s var(--ease); }
.sw canvas { display: block; width: 100%; height: 100%; }
.sw[aria-pressed="true"] { color: var(--ink); }
.sw[aria-pressed="true"] i { box-shadow: 0 0 0 2.5px #fff, 0 0 0 4.5px var(--ink); transform: scale(0.94); }
.sw:active i { transform: scale(0.9); }
.tone-dot.tone-papier { background: #F4F1EA; }
.tone-dot.tone-wit { background: #fff; }
.tone-dot.tone-inkt { background: #1C1C1E; }
.pin-row, .shape-row { display: flex; gap: 8px; }
.pin-dot { appearance: none; border: 0; padding: 0; width: 34px; height: 34px; border-radius: 50%; background: var(--c); cursor: pointer; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.14); transition: transform 0.4s var(--drawer), box-shadow 0.25s var(--ease); }
.pin-dot[aria-pressed="true"] { box-shadow: 0 0 0 2.5px #fff, 0 0 0 4.5px var(--ink); transform: scale(0.9); }
.pin-dot:active { transform: scale(0.84); }
.shape { appearance: none; border: 0; width: 44px; height: 34px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); color: var(--ink2); cursor: pointer; transition: background-color 0.25s var(--ease), color 0.25s var(--ease), transform 0.18s var(--ease); }
.shape svg { width: 22px; height: 22px; }
.shape[aria-pressed="true"] { background: var(--ink); color: #fff; }
.shape:active { transform: scale(0.92); }

/* the poster tile */
.pl-poster { container-type: inline-size; display: flex; flex-direction: column; justify-content: space-between; padding: 7cqi 7.5cqi 7.5cqi; text-align: left; cursor: pointer; background: #F4F1EA; color: #1C1C1E; }
.pl-poster.tone-wit { background: #fff; }
.pl-poster.tone-inkt { background: #1C1C1E; color: #F5F5F7; }
.pl-poster::after { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.07); }
.pl-poster.tone-inkt::after { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08); }
.pp-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.pp-coord { font-size: max(8.5px, 3.3cqi); font-weight: 600; letter-spacing: 0.06em; font-variant-numeric: tabular-nums; white-space: pre; opacity: 0.5; text-transform: uppercase; }
.pp-ic { display: inline-flex; opacity: 0.55; }
.pp-ic svg { width: max(12px, 5cqi); height: max(12px, 5cqi); }
.pp-bottom { display: flex; flex-direction: column; gap: 1.4cqi; }
.pp-name { font-family: ui-serif, "New York", "Iowan Old Style", Georgia, serif; font-weight: 600; letter-spacing: -0.035em; line-height: 1.02; text-wrap: balance; overflow-wrap: anywhere; }
.pp-sub { font-size: max(10px, 3.9cqi); font-weight: 500; letter-spacing: -0.005em; opacity: 0.55; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-poster:has(.t-goal) .pp-ic { display: none; }
.t-in.pl-poster .t-goal { bottom: auto; top: 10px; left: auto; right: 10px; }
@media (hover: hover) and (pointer: fine) { .tile:hover .t-in.pl-poster { transform: translateY(-3px); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06), 0 16px 36px rgba(0, 0, 0, 0.1); } }
.d-poster { border-radius: 22px; overflow: hidden; position: relative; min-height: 220px; max-height: 46vh; cursor: default; }
.d-credit { margin: -4px 0 2px; text-align: center; font-size: 10.5px; color: #a1a1a6; }
@media (prefers-reduced-motion: reduce) {
  .pl-stage, .pl-rise { animation-name: fade; }
  .pl-frame, .pl-cap, .seg::before { transition-duration: 0.01s; }
}
.pl-stage .pl-map, .pl-stage .pl-map.maplibregl-map { position: absolute; inset: 0; width: 100%; height: 100%; }
.pl-pin { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.pl-stage .maplibregl-canvas { outline: none; }
.pl-stage .maplibregl-canvas-container.maplibregl-interactive { cursor: grab; }
.pl-stage.drag .maplibregl-canvas-container.maplibregl-interactive { cursor: grabbing; }
.pl-pin { transition: opacity 0.3s var(--ease); }
.pl-stage.flat .pl-pin { opacity: 0; }

.stack-cover { width:100%; height:100%; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:2px; overflow:hidden; background:white; }
.stack-cover[data-layout="sheet"] { gap:4px; padding:4px; background:#f4f1ea; }
.stack-cover[data-count="3"] .stack-cell:first-child { grid-row:span 2; }
.stack-cell { display:block; overflow:hidden; min-height:0; min-width:0; }
.stack-cell img { position:static; width:100%; height:100%; display:block; object-fit:cover; opacity:1; }
.stack-preview { width:min(100%,260px); aspect-ratio:1; margin:auto; overflow:hidden; border-radius:16px; }
.crop-slider { display:grid; grid-template-columns:1fr 1fr; align-items:center; font-size:14px; }
.sv-cover-edit { position:absolute; z-index:3; left:16px; top:calc(16px + var(--top)); }
.dialog .shape-row .btn { padding:10px 12px; }
.dialog .shape-row .btn[aria-pressed="true"] { background:var(--ink); color:white; }

/* Quiet board surfaces; manipulation feedback takes precedence over hover. */
@media (hover:hover) and (pointer:fine) {
  .tile:not(:active):not(.dragging):hover .t-in,
  .tile:hover .t-in img, .tile:hover .t-in.word-in > *, .tile:hover .t-in .play { transform:none; }
  .tile:not(:active):hover .t-in { box-shadow:inset 0 0 0 1px rgba(0,0,0,.12); }
  .tile:hover .dk { --fan:1; }
  .tile:hover .t-in.pal-in i:hover { flex:1; }
}
.tile.stack-hint::before,.tile.stack-hint::after { opacity:0; }
.tile.stack-target::before { display:block; opacity:1; transform:rotate(-3deg); }
.tile.stack-target::after,.tile.stack-target:not(.is-stack)::after { opacity:0; }
.tile.stack-hint:not(.stack-target):not(.is-stack)::before,.tile.stack-hint:not(.stack-target):not(.is-stack)::after { opacity:0; }
.tile.dragging.will-stack .t-in { transform:none; opacity:1; }
.menu.open .menu-item { animation:none; }
.stack3:empty { display:none; }
.stack3:has(.sp:only-child) .sp { width:100%; transform:none; }
.mosaic:has(.cell:only-child) { grid-template:1fr / 1fr; }
.mosaic:has(.cell:nth-child(2):last-child) { grid-template-rows:1fr; }
.mosaic:has(.cell:nth-child(3):last-child) .cell:first-child { grid-row:span 2; }
.stack-index { font-size:13px; color:var(--ink2); font-variant-numeric:tabular-nums; }
.caption-toggle { appearance:none; background:none; border:0; color:var(--ink2); min-height:44px; min-width:44px; cursor:pointer; font:inherit; overflow-wrap:anywhere; max-width:min(90%,520px); }
.wp-locks { position:absolute; inset:0; pointer-events:none; }
.wp-lock { position:absolute; pointer-events:auto; border:0; background:transparent; border-radius:8px; cursor:pointer; }
.wp-lock[aria-pressed="true"] { outline:2px solid white; outline-offset:-4px; }
.palette-source,.palette-origin img { display:block; width:100%; height:auto; }
.palette-source { cursor:crosshair; }
.palette-origin { position:relative; }
.palette-point { position:absolute; width:14px; height:14px; border:2px solid white; border-radius:50%; box-shadow:0 0 0 1px #333; transform:translate(-50%,-50%); pointer-events:none; }
.caption-more { display:none; }
@media (pointer:coarse) {
  .caption-toggle.blank { display:none; }
  .lb-cap:has(input[hidden]) .caption-more { display:block; border:0; background:var(--surface); color:var(--ink); border-radius:50%; width:44px; height:44px; cursor:pointer; }
}
