:root {
  /* Dark is the default look (like How We Feel); light is defined below. */
  --bg: #000;
  --surface: #1c1c1e;
  --surface-2: #2c2c2d;
  --text: #fff;
  --text-2: #d2d2d7;
  --muted: #8f8f8f;
  --line: #2e2e33;
  --glass: rgba(255, 255, 255, .1);
  --glass-hover: rgba(255, 255, 255, .18);
  --glass-edge: inset 0 1px 0 rgba(255, 255, 255, .25), inset 0 0 0 1px rgba(255, 255, 255, .08);
  --bar: rgba(0, 0, 0, .82);
  --bar-line: rgba(255, 255, 255, .06);
  --scrim: rgba(0, 0, 0, .78);
  --shadow: rgba(0, 0, 0, .55);
  --hover: rgba(255, 255, 255, .05);
  --danger: #ff5a4f;
  --red: #FF4C40;
  --yellow: #FFD04B;
  --blue: #799FFF;
  --green: #4CE39B;
  --radius: 26px;
  --serif: "Newsreader", "Tiempos Headline", Georgia, "Times New Roman", serif;
  --sans: "Inter", "Söhne", -apple-system, system-ui, sans-serif;
  --tabbar-h: 64px;
  --nav: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  color-scheme: dark;
}
/* Light theme: when the device prefers it (and no explicit choice), or when chosen in Settings. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f5f4f0; --surface: #fff; --surface-2: #e9e8e3; --text: #121212; --text-2: #3d3d42;
    --muted: #6c6c70; --line: #e0dfda; --glass: rgba(0, 0, 0, .06); --glass-hover: rgba(0, 0, 0, .1);
    --glass-edge: inset 0 0 0 1px rgba(0, 0, 0, .06); --bar: rgba(245, 244, 240, .88); --bar-line: rgba(0, 0, 0, .08);
    --scrim: rgba(245, 244, 240, .85); --shadow: rgba(0, 0, 0, .14); --hover: rgba(0, 0, 0, .04); --danger: #d93025;
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f5f4f0; --surface: #fff; --surface-2: #e9e8e3; --text: #121212; --text-2: #3d3d42;
  --muted: #6c6c70; --line: #e0dfda; --glass: rgba(0, 0, 0, .06); --glass-hover: rgba(0, 0, 0, .1);
  --glass-edge: inset 0 0 0 1px rgba(0, 0, 0, .06); --bar: rgba(245, 244, 240, .88); --bar-line: rgba(0, 0, 0, .08);
  --scrim: rgba(245, 244, 240, .85); --shadow: rgba(0, 0, 0, .14); --hover: rgba(0, 0, 0, .04); --danger: #d93025;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); transition: background-color .25s; }
body {
  color: var(--text);
  font: 400 16px/1.45 var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
#app {
  max-width: 560px;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 16px calc(var(--nav) + 24px);
  min-height: 100dvh;
}
a { color: inherit; }
button { font-family: inherit; }
h1, h2 { font-family: var(--serif); font-weight: 500; margin: 0; letter-spacing: -.01em; }
h1 { font-size: 1.75rem; line-height: 1.15; }
.sub { color: var(--muted); margin: 6px 0 0; font-size: .95rem; }
.empty { color: var(--muted); }

/* "*I'm feeling* Word": italic serif lead-in, emotion word upright serif in its color */
.feel { font-family: var(--serif); }
.feel em { font-style: italic; font-weight: 400; }
.word { font-family: var(--serif); font-weight: 500; }

/* ---------- quadrant gradients (brand stops: bottom → mid → top) ---------- */
.q-yellow { --g: linear-gradient(0deg, #FFB218, #FFD04B 50%, #F8E46D); }
.q-green  { --g: linear-gradient(0deg, #40C786, #4CE39B 50%, #8BEFA2); }
.q-blue   { --g: linear-gradient(0deg, #717FFF, #799FFF 50%, #87C3FB); }
.q-red    { --g: linear-gradient(0deg, #F43760, #FF4C40 50%, #FF813F); }
.q-yellow { --q: var(--yellow); } .q-green { --q: var(--green); }
.q-blue { --q: var(--blue); } .q-red { --q: var(--red); }

/* ---------- glass icon buttons ---------- */
.icon-btn {
  flex: none; width: 44px; height: 44px; display: grid; place-items: center;
  border: 0; border-radius: 50%; color: var(--text); text-decoration: none; cursor: pointer;
  font: 600 1.1rem var(--sans);
  background: var(--surface);
}
.icon-btn.glass {
  background: var(--glass);
  backdrop-filter: blur(16px) saturate(1.6);
  -webkit-backdrop-filter: blur(16px) saturate(1.6);
  box-shadow: var(--glass-edge);
}
.icon-btn:active { transform: scale(.92); }
.top { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 22px; }
.top h1 { font-size: 1.6rem; padding-top: 4px; }

/* ---------- tab bar ---------- */
.tabbar {
  position: fixed; z-index: 10; left: 0; right: 0; bottom: 0; height: var(--nav);
  display: flex; justify-content: space-around; align-items: center;
  padding: 0 8px env(safe-area-inset-bottom);
  background: var(--bar);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--bar-line);
}
.tabbar a {
  flex: 1; max-width: 120px; display: flex; flex-direction: column; align-items: center; gap: 3px;
  text-decoration: none; color: var(--muted); font-size: .7rem; font-weight: 500;
}
.tabbar a.active { color: var(--text); }
.tabbar a.active svg { stroke: url(#tab-grad); }
.tabbar a:active svg { transform: scale(.9); }

/* ---------- home / Today ---------- */
.eyebrow { margin: 18px 0 2px; color: var(--muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; }
.title { font-size: 2.4rem; margin-bottom: 18px; }
.home { display: flex; flex-direction: column; gap: 12px; }
.hero-card {
  display: flex; align-items: center; gap: 16px; text-decoration: none;
  padding: 22px; border-radius: var(--radius);
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(255, 76, 64, .32), transparent 55%),
    radial-gradient(120% 140% at 100% 0%, rgba(255, 208, 75, .30), transparent 55%),
    radial-gradient(120% 140% at 0% 100%, rgba(121, 159, 255, .30), transparent 55%),
    radial-gradient(120% 140% at 100% 100%, rgba(76, 227, 155, .30), transparent 55%),
    var(--surface);
  transition: transform .15s;
}
.hero-card:active, .card.action:active { transform: scale(.97); }
.hero-card .feel { display: block; font-size: 1.6rem; }
.hero-card small, .card.action small { display: block; color: var(--text-2); font-size: .9rem; margin-top: 2px; }
.plus {
  flex: none; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  background: var(--text); color: var(--bg);
}
.card { background: var(--surface); border-radius: var(--radius); padding: 18px; }
.card.action { display: flex; align-items: center; gap: 16px; text-decoration: none; transition: transform .15s; }
.card.action strong { font-family: var(--serif); font-weight: 500; font-size: 1.3rem; }
.card.action small { color: var(--muted); }
.install-card { position: relative; display: flex; align-items: center; gap: 14px; padding-right: 40px; }
.install-card img { flex: none; border-radius: 11px; }
.install-card span { flex: 1; min-width: 0; }
.install-card strong { display: block; font-weight: 600; }
.install-card small { display: block; color: var(--muted); font-size: .85rem; margin-top: 2px; }
.install-card .btn { flex: none; }
.remind-slot { display: none; }
.install-close {
  position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; border: 0; border-radius: 50%;
  background: none; color: var(--muted); font-size: 1.3rem; line-height: 1; cursor: pointer;
}
.dots { flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; width: 56px; height: 56px; padding: 6px; }
.dots i { border-radius: 50%; }
.section { font-size: 1.3rem; margin: 14px 0 0; }
.recent { display: flex; flex-direction: column; }
.recent-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 2px; text-decoration: none;
  border-bottom: 1px solid var(--line); font-size: 1.15rem;
}
.recent-row .feel { flex: 1; }
.recent-row time { color: var(--muted); font-size: .8rem; }
.swatch { flex: none; width: 26px; height: 26px; border-radius: 50%; }
.note p { margin: 0 0 10px; } .note p:last-child { margin: 0; }

/* ---------- quadrant chooser ---------- */
.quad-screen { display: flex; flex-direction: column; gap: 22px; min-height: calc(100dvh - var(--nav) - 40px); }
.big { font-size: 2rem; text-align: center; padding: 0 8px; }
.quad-wrap { display: grid; grid-template-columns: 22px 1fr; grid-template-rows: 1fr 22px; gap: 6px; margin: auto 0; }
.quad-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.quad-orb {
  aspect-ratio: 1; border: 0; border-radius: 50%; cursor: pointer; background: var(--g);
  box-shadow: 0 0 44px color-mix(in srgb, var(--q) 40%, transparent);
  color: #111; font: 500 1.05rem/1.2 var(--serif);
  transition: transform .2s;
  animation: pop .5s cubic-bezier(.2, 1.4, .4, 1) both;
}
.quad-orb:nth-child(2) { animation-delay: .05s; } .quad-orb:nth-child(3) { animation-delay: .1s; }
.quad-orb:nth-child(4) { animation-delay: .15s; }
.quad-orb:active { transform: scale(.94); }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
.axis { color: var(--muted); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; }
.axis-y { writing-mode: vertical-rl; transform: rotate(180deg); text-align: center; grid-row: 1; }
.axis-x { grid-column: 2; text-align: center; }
.axis-y::after, .axis-x::after { content: " →"; }

.picker-toggle { align-self: center; margin-top: -8px; }
.grid-screen { gap: 14px; }
.grid-screen .big { font-size: 1.6rem; }
/* Sized so the grid and the card under it fit on a phone screen without scrolling. */
.grid-screen .quad-wrap {
  width: min(100%, max(240px, 100dvh - var(--nav) - 370px)); align-self: center; margin: 0; touch-action: none;
}
.mood-grid {
  position: relative; aspect-ratio: 1; cursor: crosshair;
  touch-action: none; user-select: none; -webkit-user-select: none;
  box-shadow: 0 0 44px color-mix(in srgb, var(--text) 8%, transparent);
  animation: pop .5s cubic-bezier(.2, 1.4, .4, 1) both;
}
.mood-grid:focus-visible { outline: 3px solid var(--text); outline-offset: 3px; }
.mood-grid canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
/* A line at every step from 0 to 10, stronger through the middle (5, 5). */
.mg-lines {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(rgb(0 0 0 / .22), rgb(0 0 0 / .22)) center / 1.5px 100% no-repeat,
    linear-gradient(rgb(0 0 0 / .22), rgb(0 0 0 / .22)) center / 100% 1.5px no-repeat,
    repeating-linear-gradient(90deg, rgb(0 0 0 / .08) 0 1px, transparent 1px 10%),
    repeating-linear-gradient(0deg, rgb(0 0 0 / .08) 0 1px, transparent 1px 10%);
}
.mg-thumb {
  position: absolute; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%;
  background: var(--c); border: 3px solid #fff; box-shadow: 0 4px 14px rgb(0 0 0 / .3);
  transition: left .08s ease-out, top .08s ease-out; pointer-events: none;
}
.mg-card {
  display: flex; align-items: center; gap: 14px; width: 100%; max-width: 536px; align-self: center; box-sizing: border-box;
  padding: 16px 12px 16px 22px; border-radius: 30px; background: var(--surface-2);
}
.mg-score { margin: 0 0 2px; color: var(--muted); font-size: .85rem; }
.mg-card .def-word:empty, .mg-card .def-line:empty { display: none; }
.next:disabled { opacity: .35; cursor: default; }

/* ---------- mood meter ---------- */
.meter-screen { position: fixed; inset: 0 0 var(--nav); background: var(--bg); overflow: hidden; }
.meter-view {
  position: absolute; inset: 0; overflow: auto; overscroll-behavior: contain;
  scrollbar-width: none; cursor: grab;
}
.meter-view::-webkit-scrollbar { display: none; }
.meter-view.dragging { cursor: grabbing; }
.meter { position: relative; animation: zoom-in .55s cubic-bezier(.2, .9, .3, 1) both; }
@keyframes zoom-in { from { transform: scale(.75); opacity: 0; } }
.bubble {
  position: absolute; width: var(--cell); height: var(--cell);
  border: 0; padding: 8px; cursor: pointer;
  background: var(--c); color: #111;
  font: 500 var(--fs, 15px)/1.05 var(--serif); letter-spacing: -.01em; overflow-wrap: normal; hyphens: none;
  clip-path: var(--circle);
  transition: transform .3s cubic-bezier(.2, .8, .2, 1), clip-path .12s ease-out, scale .12s ease-out;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
/* Like How We Feel: the shape snaps in almost at once with a small springy pop. */
.bubble.active {
  z-index: 2; font-weight: 600; clip-path: var(--shape);
  transition: transform .18s cubic-bezier(.3, 1.6, .6, 1), clip-path .12s ease-out, scale .12s ease-out;
}
/* Instant press feedback, separate from the JS-driven transform. */
.bubble:active { scale: .94; }
/* clip-path hides outlines, so keyboard focus shows as the shape plus an underline. */
.bubble:focus-visible { outline: none; text-decoration: underline 2px; text-underline-offset: 4px; }
/* Selected keeps its circle on hover-capable screens; a white rim marks it instead. */
.bubble.selected:not(.active) { background: radial-gradient(circle closest-side, var(--c) calc(100% - 4px), var(--text) calc(100% - 3px)); }
.meter-top {
  position: absolute; z-index: 3; top: 0; left: 0; right: 0;
  padding: max(12px, env(safe-area-inset-top)) 16px 26px;
  background: linear-gradient(color-mix(in srgb, var(--bg) 92%, transparent) 50%, transparent);
  pointer-events: none;
}
.meter-bar { display: flex; gap: 10px; align-items: center; }
.meter-bar > * { pointer-events: auto; }
.spacer { flex: 1; }
.meter-prompt { margin: 10px 0 0; text-align: center; font: italic 400 1.2rem var(--serif); color: var(--text-2); }
.minimap {
  position: absolute; z-index: 3; left: 16px; top: calc(max(12px, env(safe-area-inset-top)) + 96px);
  display: grid; grid-template-columns: 12px 12px; gap: 4px; padding: 7px; border-radius: 11px;
  background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.minimap button { width: 12px; height: 12px; border-radius: 50%; border: 0; padding: 0; background: var(--q); opacity: .3; cursor: pointer; }
.minimap button.active { opacity: 1; }

/* floating definition card */
.def-card {
  position: absolute; z-index: 4; left: 12px; right: 12px;
  bottom: 12px;
  max-width: 536px; margin: 0 auto;
  display: flex; align-items: center; gap: 14px;
  padding: 16px 12px 16px 22px; border-radius: 30px; background: var(--surface-2);
  box-shadow: 0 12px 40px var(--shadow);
  transform: translateY(calc(100% + 40px)); transition: transform .4s cubic-bezier(.2, .9, .3, 1.05);
}
.def-card.open { transform: none; }
.def-card::before {
  content: ""; position: absolute; top: 7px; left: 50%; width: 36px; height: 4px; margin-left: -18px;
  border-radius: 2px; background: var(--muted); opacity: .5;
}
.def-text { flex: 1; min-width: 0; }
.def-word { font: 600 1.1rem/1.2 var(--sans); margin: 0 0 3px; letter-spacing: 0; }
.def-line { margin: 0; color: var(--text); font-size: .95rem; line-height: 1.35; }
.next {
  flex: none; width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; background: var(--text); color: var(--bg);
}
.next:active { transform: scale(.92); }

/* search + help overlays */
.search-panel, .help-panel {
  position: absolute; z-index: 6; inset: 0;
  background: var(--scrim); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  animation: fade .2s ease-out;
}
@keyframes fade { from { opacity: 0; } }
.search-panel { padding: max(14px, env(safe-area-inset-top)) 16px 24px; overflow: auto; }
.search-row { display: flex; gap: 10px; align-items: center; max-width: 560px; margin: 0 auto 12px; }
.search-row input {
  flex: 1; padding: 13px 16px; border-radius: 999px; border: 0; outline: none;
  background: var(--surface-2); color: var(--text); font: 400 1rem var(--sans);
}
.text-btn { border: 0; background: none; color: var(--text); font: 500 1rem var(--sans); cursor: pointer; }
.results { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; }
.result {
  display: flex; gap: 14px; align-items: center; text-align: left; padding: 12px 4px;
  border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--text); cursor: pointer;
}
.result b { display: block; font: 500 1.2rem var(--serif); }
.result small { color: var(--text-2); font-size: .88rem; }
.help-panel { display: grid; place-items: end center; padding: 16px; }
.help-panel[hidden], .search-panel[hidden] { display: none; }
.help-card {
  width: 100%; max-width: 536px; padding: 24px; border-radius: 30px; background: var(--surface-2);
}
.help-card h2 { font-size: 1.6rem; margin-bottom: 10px; }
.help-card p { color: var(--text-2); margin: 0 0 12px; }
.help-card .btn { width: 100%; margin-top: 6px; }
.keys { font-size: .88rem; color: var(--muted) !important; line-height: 2; }
kbd {
  display: inline-block; min-width: 26px; padding: 1px 7px; margin-right: 3px; text-align: center;
  border-radius: 7px; background: var(--glass); box-shadow: inset 0 -1px 0 var(--line);
  color: var(--text); font: 600 .8rem var(--sans);
}

/* ---------- recording / playback ---------- */
.stage {
  position: relative; border-radius: var(--radius); overflow: hidden; background: #111;
  aspect-ratio: 3 / 4; box-shadow: 0 0 0 2px color-mix(in srgb, var(--q, #444) 85%, transparent);
}
.stage video { width: 100%; height: 100%; object-fit: cover; display: block; }
.stage video[controls] { object-fit: contain; }
.stage-msg { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 16px; color: #ccc; text-align: center; }
#preview { transform: scaleX(-1); }
.timer {
  position: absolute; top: 12px; left: 12px; padding: 4px 12px; border-radius: 999px;
  background: rgba(0, 0, 0, .6); color: #ff6b6b; font-variant-numeric: tabular-nums; font-weight: 600;
}
.cam-msg { position: absolute; inset: 0; margin: 0; display: grid; place-items: center; padding: 24px; text-align: center; color: #ccc; }
.from { color: var(--muted); margin: -8px 0 14px; }
.from .feel { color: var(--text); font-size: 1.1rem; }

.controls { display: flex; justify-content: center; margin-top: 20px; }
.controls.stack { flex-direction: column; align-items: stretch; gap: 10px; }
.controls .hint { margin: 0; }
.btn {
  /* Flex so the label stays centred when touch screens stretch buttons to 44px. */
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 1rem var(--sans); cursor: pointer; text-align: center; text-decoration: none;
  padding: 16px 22px; border-radius: 999px; border: 0;
  background: var(--surface-2); color: var(--text);
}
.btn.primary { background: var(--text); color: var(--bg); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.small { padding: 9px 14px; font-size: .88rem; }
.btn:disabled { opacity: .4; cursor: default; }
.btn.rec { min-width: 210px; background: var(--red); color: #fff; }
.btn.rec.recording { animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 12px color-mix(in srgb, var(--red) 25%, transparent); } }
.hint { color: var(--muted); font-size: .9rem; text-align: center; }
.link { text-decoration: underline; cursor: pointer; color: var(--text); }

/* ---------- library ---------- */
.lib-sub { margin: -12px 0 18px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip {
  font: 500 .92rem var(--sans); cursor: pointer; color: var(--text);
  padding: 8px 16px; border-radius: 999px; border: 0; background: var(--surface);
}
.filters .chip.active { background: var(--q, var(--text)); color: var(--q-text, #111); }
.filters .chip[data-f="all"].active { --q-text: var(--bg); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.item { background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.item video { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; background: #111; display: block; }
/* Not on this device yet: downloads when tapped. */
.item-load {
  width: 100%; aspect-ratio: 3 / 4; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; border: 0; cursor: pointer; color: #fff; font: 500 .92rem var(--sans);
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--q) 45%, #111), #111 75%);
}
.item-load .swatch { width: 44px; height: 44px; background: var(--q); }
.item-load:disabled { cursor: progress; opacity: .8; }
.item .meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 14px 0; }
.item .meta .feel { font-size: 1.15rem; }
.item time { color: var(--muted); font-size: .8rem; white-space: nowrap; }
.item .row { display: flex; gap: 8px; padding: 12px 14px 14px; }
.item .row .btn { flex: 1; }
.demo-badge {
  margin-left: 6px; padding: 2px 8px; border-radius: 999px; font: 600 .7rem var(--sans);
  background: var(--surface-2); color: var(--muted); vertical-align: middle;
}

/* Library tabs: My videos / By friends */
.segmented.lib-tabs { display: flex; margin: -6px 0 16px; }
.lib-tabs a {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; border-radius: 999px;
  color: var(--text-2); font: 500 .92rem var(--sans); text-decoration: none; transition: background-color .2s, color .2s;
}
.lib-tabs a[aria-current="page"] { background: var(--bg); color: var(--text); box-shadow: 0 1px 4px var(--shadow); }
.lib-tabs + .lib-sub { margin: 0 0 18px; }
.dot-count {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; display: inline-grid; place-items: center;
  background: var(--red); color: #fff; font: 700 .7rem var(--sans);
}
.meta-label { display: flex; flex-direction: column; min-width: 0; }
.from-name { font-size: .85rem; font-weight: 600; color: var(--text-2); }
.new-badge { margin-left: 4px; background: var(--red); color: #fff; }

/* ---------- friends ---------- */
.friends .group { margin-bottom: 12px; }
.add-card { display: flex; flex-direction: column; gap: 10px; }
.add-card strong { font: 500 1.2rem var(--serif); }
.add-card small { display: block; color: var(--muted); font-size: .85rem; margin-top: 2px; }
.add-row { display: flex; gap: 8px; }
.add-row input {
  flex: 1; min-width: 0; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--bg); color: var(--text); font: 400 1rem var(--sans);
}
.add-row input:focus { outline: none; border-color: var(--text); box-shadow: 0 0 0 3px var(--glass); }
.add-card .form-error { margin: 0; }
.request-card { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 8px; }
.request-card .row-btns { flex-basis: 100%; margin-top: 0; }
.sent-row .btn { flex: none; }
.request-alert { border: 1px solid var(--line); }
.request-alert strong { font-size: 1.15rem !important; }
.row-btns { display: flex; gap: 8px; margin-top: 10px; }
.row-btns .btn { flex: 1; }
.friend-list { display: flex; flex-direction: column; margin-top: 8px; }
.friend-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line);
  color: var(--text); text-decoration: none;
}
.friend-row > svg { flex: none; color: var(--muted); }
.friend-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.friend-text b { font: 500 1.15rem var(--serif); }
.friend-text small { color: var(--muted); font-size: .88rem; }
.friend-text small .feel { color: var(--text-2); font-size: 1rem; }
.now-card {
  background: radial-gradient(circle at 85% 0%, color-mix(in srgb, var(--q) 30%, transparent), transparent 70%), var(--surface);
}
.now-card .kicker { margin-bottom: 4px; }
.now-feel { margin: 0; font-size: 1.5rem; }
.now-card small { color: var(--muted); font-size: .85rem; }
.gift-card { border: 1px solid color-mix(in srgb, var(--q) 45%, transparent); }
.gift-card strong { font-size: 1.15rem !important; }
.btn.ghost.danger-text { color: var(--danger); }
.nudge-card { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.nudge-card > span { flex: 1; min-width: 0; }
.nudge-card strong { font: 500 1.2rem var(--serif); }
.nudge-card small { display: block; color: var(--muted); font-size: .85rem; margin-top: 2px; }
.nudge-card .btn { flex: none; }
.nudge-alert { position: relative; padding-right: 40px; border: 1px solid var(--line); }
.nudge-open { display: flex; align-items: center; gap: 14px; color: var(--text); text-decoration: none; }
.nudge-open strong { display: block; font: 500 1.15rem var(--serif); }
.nudge-open small { display: block; color: var(--muted); font-size: .85rem; margin-top: 2px; }


/* ---------- shared bits for the account screens ---------- */
.boot { color: var(--muted); text-align: center; margin-top: 30vh; }
.tabbar[hidden] { display: none; }
body.signed-out #app { padding-bottom: max(24px, env(safe-area-inset-bottom)); }
#app:has(.landing) { max-width: none; padding: 0; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 600 1.25rem var(--serif); text-decoration: none; letter-spacing: -.01em; }
.brand.small { font-size: 1.05rem; }
.brand-dots { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; width: 22px; height: 22px; }
.brand-dots i { border-radius: 50%; }
.brand-dots i:nth-child(1) { background: var(--red); } .brand-dots i:nth-child(2) { background: var(--yellow); }
.brand-dots i:nth-child(3) { background: var(--blue); } .brand-dots i:nth-child(4) { background: var(--green); }
.fine { color: var(--muted); font-size: .85rem; margin: 14px 0 0; }
.fine a { color: inherit; }
.center { text-align: center; }
.kicker { margin: 0 0 8px; color: var(--muted); font-size: .78rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.form-error {
  margin: 0; padding: 10px 14px; border-radius: 12px; font-size: .9rem; font-weight: 500;
  background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger);
}
.form-error[hidden] { display: none; }

/* A feeling bubble outside the meter; shows its shape with .on */
.orb {
  aspect-ratio: 1; display: grid; place-items: center; padding: 6px; text-align: center;
  background: var(--c); color: #111; font: 500 clamp(.6rem, 2.5vw, .95rem)/1.05 var(--serif);
  clip-path: var(--circle); min-width: 0; overflow: hidden; overflow-wrap: anywhere;
  transition: clip-path .45s cubic-bezier(.3, 1.4, .6, 1), transform .45s cubic-bezier(.3, 1.6, .6, 1);
}
.orb.on { clip-path: var(--shape); transform: scale(1.08); font-weight: 600; position: relative; z-index: 1; }

/* ---------- landing page ---------- */
.landing { --w: 1080px; }
.l-nav {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: max(12px, env(safe-area-inset-top)) max(16px, calc((100% - var(--w)) / 2 + 20px)) 12px;
  background: var(--bar); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-bottom: 1px solid var(--bar-line);
}
.l-nav-links { display: flex; align-items: center; gap: 6px; }
.l-link { text-decoration: none; font-weight: 500; padding: 10px 12px; border-radius: 999px; }
.l-hero, .l-section, .l-cta, .l-foot { max-width: var(--w); margin: 0 auto; padding-left: 20px; padding-right: 20px; }
.l-hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; align-items: center; padding-top: 44px; padding-bottom: 64px; }
.pill {
  display: inline-block; margin: 0 0 18px; padding: 6px 14px; border-radius: 999px;
  background: var(--glass); color: var(--text-2); font-size: .85rem; font-weight: 500;
}
.l-hero h1 { font-size: clamp(2.4rem, 7vw, 4.1rem); line-height: 1.03; letter-spacing: -.02em; }
.l-hero h1 em {
  font-style: italic; padding-right: .06em;
  background: linear-gradient(90deg, var(--red), var(--yellow) 38%, var(--green) 68%, var(--blue));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lede { font-size: 1.15rem; color: var(--text-2); max-width: 34em; margin: 20px 0 28px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; }
.l-hero-art { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; width: 100%; max-width: 460px; justify-self: center; }
.l-section { padding-top: 56px; padding-bottom: 56px; border-top: 1px solid var(--line); }
.l-section .kicker { margin-bottom: 18px; font-size: 1.05rem; color: var(--text-2); }
.kicker.keep-case { text-transform: none; letter-spacing: .02em; }
.l-section h2, .l-cta h2 { font-size: clamp(1.8rem, 4.5vw, 2.6rem); line-height: 1.1; margin-bottom: 24px; }
.steps, .features { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.steps { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.features { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.steps li, .features li { background: var(--surface); border-radius: var(--radius); padding: 22px; }
.steps h3, .features h3 { font: 600 1.08rem var(--sans); margin: 14px 0 6px; }
.steps p, .features p { margin: 0; color: var(--text-2); }
.step-n { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--text); color: var(--bg); font-weight: 700; }
.l-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; align-items: center; }
.l-split p { color: var(--text-2); font-size: 1.05rem; }
.l-quads, .art-quads { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; width: 100%; justify-self: center; }
.l-quads { max-width: 360px; }
.l-quads .quad-orb, .art-quads .quad-orb { display: grid; place-items: center; text-align: center; cursor: default; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 16px 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--muted); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 0 16px; color: var(--text-2); }
.l-cta { text-align: center; padding-top: 64px; padding-bottom: 64px; border-top: 1px solid var(--line); }
.l-foot {
  display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: center; color: var(--muted); font-size: .9rem;
  padding-top: 24px; padding-bottom: max(24px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line);
}
.l-foot a { color: inherit; }
@media (min-width: 860px) {
  .l-hero { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); padding-top: 80px; padding-bottom: 96px; }
  .l-split { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- log in / sign up ---------- */
.auth { max-width: 420px; margin: 0 auto; padding-top: 8px; display: flex; flex-direction: column; gap: 14px; }
.auth > .brand { margin-bottom: 14px; }
.auth h1 { font-size: 2.2rem; }
.auth .sub { margin-top: -8px; }
.google-wrap { display: flex; flex-direction: column; align-items: center; min-height: 44px; }
.google-slot { width: 100%; display: flex; flex-direction: column; align-items: center; transition: opacity .2s, filter .2s; }
.google-wrap.locked .google-slot { opacity: .4; filter: grayscale(1); }
/* Google's button is an iframe with a light colour scheme; matching it keeps the corners transparent in dark mode. */
.google-slot iframe { color-scheme: light; }
.google-wrap:not(.locked) .lock-note { display: none; }
.lock-note { margin-top: 8px; }
.btn.google { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .85rem; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-form, .row-form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: .9rem; font-weight: 500; }
.field small { color: var(--muted); font-weight: 400; }
.field input {
  width: 100%; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); outline: none;
  background: var(--surface); color: var(--text); font: 400 1rem var(--sans); transition: border-color .15s, box-shadow .15s;
}
.field input:focus { border-color: var(--text); box-shadow: 0 0 0 3px var(--glass); }
.field input[aria-invalid="true"] { border-color: var(--danger); }
.pw { position: relative; display: block; }
.pw input { padding-right: 52px; }
.pw-toggle {
  position: absolute; right: 4px; top: 50%; translate: 0 -50%; width: 44px; height: 44px; display: grid; place-items: center;
  border: 0; border-radius: 10px; background: none; color: var(--muted); cursor: pointer;
}
.check {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 14px; cursor: pointer;
  background: var(--surface); color: var(--text-2); font-size: .88rem; line-height: 1.45;
}
.check input { flex: none; width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--text); }
.check a { color: var(--text); }
.recovery-code {
  margin: 0; padding: 18px 14px; border-radius: 14px; background: var(--surface); text-align: center;
  font: 600 1.05rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .04em;
  color: var(--text); word-break: break-all; user-select: all;
}
.switch { text-align: center; color: var(--muted); margin: 6px 0 0; }
.switch a { color: var(--text); font-weight: 600; }

/* ---------- Today header, avatar ---------- */
.home-top { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }
.home-top .eyebrow { margin: 0; }
.avatar {
  flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; object-fit: cover;
  background: linear-gradient(135deg, var(--red), var(--yellow) 50%, var(--green)); color: #111; font: 600 1.05rem var(--sans);
}
.avatar.lg { width: 64px; height: 64px; font-size: 1.6rem; }
.title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }

/* Profile menu: the avatar opens a small dropdown */
.pmenu { position: relative; flex: none; }
.avatar-btn {
  display: block; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer;
  box-shadow: 0 0 0 2px transparent; transition: box-shadow .15s, transform .15s;
}
.avatar-btn:active { transform: scale(.94); }
.avatar-btn[aria-expanded="true"] { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--text); }
.menu {
  position: absolute; z-index: 15; top: calc(100% + 10px); right: 0; width: max-content; min-width: 240px; max-width: calc(100vw - 32px);
  padding: 6px; border-radius: 20px; background: var(--surface-2); box-shadow: 0 16px 48px var(--shadow), 0 0 0 1px var(--line);
  transform-origin: top right; animation: menu-in .16s cubic-bezier(.2, .9, .3, 1.1);
}
.menu[hidden] { display: none; }
@keyframes menu-in { from { opacity: 0; transform: scale(.94) translateY(-4px); } }
.menu-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.menu-who { display: flex; flex-direction: column; min-width: 0; }
.menu-head b { font: 500 1.1rem var(--serif); }
.menu-head small { color: var(--muted); font-size: .82rem; overflow: hidden; text-overflow: ellipsis; }
.menu [role="menuitem"] {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 46px; padding: 0 12px; border: 0; border-radius: 14px;
  background: none; color: var(--text); font: 500 .98rem var(--sans); text-align: left; text-decoration: none; cursor: pointer;
}
.menu [role="menuitem"] svg { flex: none; width: 20px; height: 20px; color: var(--muted); }
.menu [role="menuitem"]:focus-visible { outline: none; background: var(--hover); box-shadow: inset 0 0 0 2px var(--text); }
.menu [role="menuitem"]:active { background: var(--hover); }
.menu [role="menuitem"].danger, .menu [role="menuitem"].danger svg { color: var(--danger); }

/* Check in: the middle tab is a bigger, raised round button */
.tab-fab {
  display: grid; place-items: center; width: 52px; height: 52px; margin-top: -28px; border-radius: 50%; color: #111;
  background: conic-gradient(from 225deg, var(--red), var(--yellow), var(--green), var(--blue), var(--red));
  box-shadow: 0 0 0 5px var(--bg), 0 6px 18px var(--shadow); transition: transform .15s;
}
.tabbar a.active .tab-fab svg, .tab-fab svg { stroke: #111; stroke-width: 2.4; }
.tabbar a[data-tab="checkin"]:active .tab-fab { transform: scale(.92); }


/* ---------- settings ---------- */
.settings .title { margin-bottom: 16px; }
.profile { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--radius); background: var(--surface); }
.profile-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.avatar-edit { position: relative; flex: none; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.avatar-edit:active { transform: scale(.95); }
.avatar-cam {
  position: absolute; right: -2px; bottom: -2px; width: 26px; height: 26px; display: grid; place-items: center;
  border-radius: 50%; background: var(--text); color: var(--bg); box-shadow: 0 0 0 3px var(--surface);
}
.photo-actions { display: flex; gap: 14px; margin-top: 4px; }
.text-btn.small { padding: 0; font-size: .85rem; font-weight: 600; min-height: 0; }
.text-btn.muted { color: var(--muted); }
.text-btn:disabled { opacity: .5; cursor: default; }
@media (pointer: coarse) { .photo-actions .text-btn { min-height: 32px; } }
.p-name { font: 500 1.35rem var(--serif); }
.p-email { color: var(--muted); font-size: .9rem; overflow: hidden; text-overflow: ellipsis; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: var(--surface-2); font-size: .78rem; font-weight: 600; }
.badge svg { width: 14px; height: 14px; }
.group-title { font: 600 .78rem var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 26px 4px 8px; }
.group-note { color: var(--muted); font-size: .88rem; margin: -2px 4px 10px; }
.group { background: var(--surface); border-radius: 20px; overflow: hidden; }
.group > * + *, .row-details > form { border-top: 1px solid var(--line); }
.row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 56px; padding: 12px 16px;
  border: 0; background: none; color: var(--text); font: 400 1rem var(--sans); text-align: left; text-decoration: none;
}
.row.tap { cursor: pointer; }
.row > svg { flex: none; color: var(--muted); transition: transform .2s; }
.row-label { display: flex; flex-direction: column; gap: 2px; }
.row-label small { color: var(--muted); font-size: .82rem; }
.row.danger { color: var(--danger); font-weight: 600; }
.danger-zone { margin-top: 26px; }
.row-form { padding: 16px; }
.row-form .btn { align-self: flex-start; }
.row-details summary { list-style: none; }
.row-details summary::-webkit-details-marker { display: none; }
.row-details[open] summary > svg { transform: rotate(90deg); }
.segmented { flex: none; display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface-2); }
.segmented button {
  min-height: 36px; padding: 8px 14px; border: 0; border-radius: 999px; background: none; cursor: pointer;
  color: var(--text-2); font: 500 .88rem var(--sans); transition: background-color .2s, color .2s;
}
.segmented button[aria-checked="true"] { background: var(--bg); color: var(--text); box-shadow: 0 1px 4px var(--shadow); }
.toggle {
  flex: none; position: relative; width: 52px; height: 32px; padding: 0; border: 0; border-radius: 999px;
  background: var(--surface-2); cursor: pointer; transition: background-color .2s;
}
.toggle::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 4px var(--shadow); transition: translate .2s;
}
.toggle[aria-checked="true"] { background: var(--green); }
.toggle[aria-checked="true"]::after { translate: 20px 0; }
.toggle:disabled { opacity: .5; cursor: default; }
@media (max-width: 440px) {
  .row:has(.segmented) { flex-direction: column; align-items: stretch; }
  .segmented { display: flex; }
  .segmented button { flex: 1; }
}

/* ---------- dialog, toast, upload progress ---------- */
dialog.sheet {
  width: min(440px, calc(100% - 32px)); padding: 0; border: 0; border-radius: 26px;
  background: var(--surface-2); color: var(--text); box-shadow: 0 20px 60px var(--shadow);
}
dialog.sheet[open] { animation: rise .25s cubic-bezier(.2, .9, .3, 1.05); }
dialog.sheet::backdrop { background: var(--scrim); backdrop-filter: blur(6px); }
dialog.sheet form { display: flex; flex-direction: column; gap: 12px; padding: 24px; }
dialog.sheet h2 { font-size: 1.5rem; }
dialog.sheet p { margin: 0; color: var(--text-2); }
dialog.sheet p a { color: var(--text); }
.install-steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 10px; color: var(--text-2); line-height: 1.45; }
.install-steps b { color: var(--text); }
.install-steps svg { vertical-align: -3px; color: var(--text); }
.sheet-actions { display: flex; gap: 10px; margin-top: 8px; }
.sheet-actions .btn { flex: 1; }
@keyframes rise { from { transform: translateY(20px); opacity: 0; } }
.toast {
  position: fixed; z-index: 20; left: 50%; bottom: calc(var(--nav) + 16px); max-width: calc(100% - 32px);
  padding: 12px 18px; border-radius: 999px; background: var(--text); color: var(--bg); font-size: .92rem; font-weight: 500;
  box-shadow: 0 8px 30px var(--shadow); translate: -50% 20px; opacity: 0; pointer-events: none; transition: opacity .2s, translate .25s;
}
.toast.show { opacity: 1; translate: -50% 0; }
body.signed-out .toast { bottom: max(24px, env(safe-area-inset-bottom)); }
.progress { height: 6px; margin-top: 16px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.progress[hidden] { display: none; }
.progress i { display: block; height: 100%; width: calc(var(--p, 0) * 100%); background: var(--text); transition: width .2s; }
.migrate { margin-bottom: 14px; }
.migrate .btn { margin-top: 10px; }

/* ---------- introduction (onboarding) ---------- */
.onb {
  position: fixed; inset: 0; display: flex; flex-direction: column; background: var(--bg);
  padding: max(12px, env(safe-area-inset-top)) 0 max(20px, env(safe-area-inset-bottom));
}
.onb-top, .onb-actions { width: 100%; max-width: 560px; margin: 0 auto; padding: 0 16px; display: flex; gap: 10px; }
.onb-top { justify-content: space-between; align-items: center; min-height: 44px; }
.onb-viewport { flex: 1; width: 100%; max-width: 560px; margin: 0 auto; overflow: hidden; touch-action: pan-y; }
.onb-track { display: flex; height: 100%; transition: transform .45s cubic-bezier(.2, .9, .3, 1); }
.onb-slide { flex: 0 0 100%; display: flex; flex-direction: column; justify-content: center; padding: 12px 28px; text-align: center; }
.onb-slide h1 { font-size: clamp(1.8rem, 6vw, 2.3rem); line-height: 1.1; margin-bottom: 12px; }
.onb-body { margin: 0 auto; max-width: 30em; color: var(--text-2); font-size: 1.05rem; }
.onb-art { height: min(34vh, 280px); display: grid; place-items: center; margin-bottom: 18px; }
.onb-dots { display: flex; justify-content: center; gap: 2px; margin: 8px 0 14px; }
.onb-dots button { width: 26px; height: 26px; padding: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center; }
.onb-dots button::before { content: ""; width: 8px; height: 8px; border-radius: 4px; background: var(--muted); opacity: .4; transition: width .25s, opacity .25s; }
.onb-dots button[aria-current]::before { width: 22px; opacity: 1; background: var(--text); }
.onb-actions .btn { flex: 1; }
.onb-later { margin: 12px auto 0; color: var(--muted); }
.onb-later[hidden] { display: none; }
.art-quads { width: min(220px, 56vw); }
.art-quads.labelled { width: min(280px, 72vw); }
.art-quads .quad-orb { font-size: .8rem; }
.art-pair { display: flex; align-items: center; gap: 14px; }
.art-pair .orb { width: min(120px, 30vw); font-size: .95rem; }
.art-arrow { color: var(--muted); }
.art-split { display: flex; align-items: center; gap: min(14px, 3vw); }
.art-split .art-grid { width: min(170px, 42vw); gap: 3px; }
.art-split .orb { font-size: .5rem; padding: 0; overflow-wrap: normal; word-break: keep-all; hyphens: none; }
.art-or { color: var(--muted); font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; }
.art-mood-grid { position: relative; flex: none; width: min(120px, 28vw); aspect-ratio: 1; }
.art-mood-grid canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.art-mood-grid .mg-thumb { width: 26px; height: 26px; margin: -13px 0 0 -13px; }
.art-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; width: min(260px, 68vw); }
.art-cam { position: relative; width: min(160px, 42vw); aspect-ratio: 3 / 4; border-radius: 26px; background: linear-gradient(160deg, var(--surface-2), var(--surface)); box-shadow: 0 0 0 2px var(--yellow); }
.art-rec { position: absolute; top: 12px; left: 12px; padding: 3px 10px; border-radius: 999px; background: rgba(0, 0, 0, .6); color: #ff6b6b; font-size: .8rem; font-weight: 600; }
.art-dot { position: absolute; left: 50%; bottom: 14px; translate: -50% 0; width: 44px; height: 44px; border-radius: 50%; background: var(--red); animation: pulse 1.4s infinite; }
.art-friends { display: flex; align-items: center; gap: 14px; }
.art-friends .avatar { width: 84px; height: 84px; font-size: 2rem; }
.art-friends .avatar:last-child { background: var(--surface); color: var(--muted); }
.art-link { color: var(--muted); }
.art-link svg { width: 34px; height: 34px; }
.art-nudge {
  display: flex; align-items: center; gap: 12px; width: min(320px, 84vw); padding: 14px 16px; border-radius: 22px;
  background: var(--surface); box-shadow: 0 12px 32px var(--shadow); text-align: left;
  animation: pop .6s cubic-bezier(.2, 1.4, .4, 1) both;
}
.art-nudge img { flex: none; border-radius: 9px; }
.art-nudge b { display: block; font-size: .95rem; }
.art-nudge small { display: block; color: var(--muted); font-size: .85rem; margin-top: 2px; }
.art-lock { width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); }
.art-lock svg { width: 52px; height: 52px; }

/* ---------- privacy policy ---------- */
.policy { line-height: 1.6; }
.policy h2 { font-size: 1.35rem; margin: 26px 0 8px; }
.policy p, .policy li { color: var(--text-2); }
.policy ul { padding-left: 20px; }
.policy li { margin-bottom: 6px; }
.policy a, .policy b { color: var(--text); }

/* ---------- input-aware interaction ---------- */
/* Keyboard focus is always visible; mouse and touch clicks don't draw a ring. */
:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
:focus:not(:focus-visible) { outline: none; }
.result:focus-visible { outline-offset: -2px; border-radius: 12px; }
button, a, input, .bubble { touch-action: manipulation; }
.btn, .chip, .result, .recent-row, .item, .icon-btn, .next, .text-btn {
  transition: transform .15s, background-color .15s, filter .15s, box-shadow .2s;
}
.btn:active, .chip:active { transform: scale(.96); }

/* Mouse and trackpad: hover previews what a click will do. Gated so phones never get stuck hover. */
@media (hover: hover) and (pointer: fine) {
  .def-card::before { display: none; }
  .icon-btn.glass:hover { background: var(--glass-hover); }
  .hero-card:hover, .card.action:hover { transform: translateY(-2px); box-shadow: 0 10px 30px var(--shadow); }
  .card.action:hover { background: var(--surface-2); }
  .quad-orb:hover { transform: scale(1.04); box-shadow: 0 0 70px color-mix(in srgb, var(--q) 60%, transparent); }
  .btn:not(:disabled):hover { filter: brightness(1.15); }
  .btn.primary:hover { filter: brightness(.9); }
  .btn.ghost:hover { color: var(--text); }
  .chip:hover { background: var(--surface-2); }
  .filters .chip.active:hover { background: var(--q, var(--text)); }
  .tabbar a:hover { color: var(--text); }
  .tabbar a[data-tab="checkin"]:hover .tab-fab { transform: scale(1.06); }
  .menu [role="menuitem"]:hover { background: var(--hover); }
  .avatar-btn:hover { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--line); }
  .recent-row:hover, .result:hover, .row.tap:hover { background: var(--hover); }
  .next:hover { transform: scale(1.06); }
  .minimap button:hover { opacity: .7; }
  .text-btn:hover, .link:hover, .l-link:hover, .switch a:hover { opacity: .75; }
  .row.tap:hover { opacity: 1; }
  .faq summary:hover { color: var(--text-2); }
  .segmented button:not([aria-checked="true"]):hover { color: var(--text); }
  .pw-toggle:hover { color: var(--text); }
  .avatar-edit:hover .avatar { filter: brightness(.9); }
  .item:hover { box-shadow: 0 0 0 1px var(--line); }
  .hero-card:hover:active, .card.action:hover:active { transform: scale(.98); }
  .quad-orb:hover:active, .next:hover:active { transform: scale(.94); }
}

/* Fingers: targets of at least 44px (Apple HIG; Material is 48dp), bigger minimap dots. */
@media (pointer: coarse) {
  .btn.small, .chip, .text-btn { min-height: 44px; }
  .minimap { grid-template-columns: 18px 18px; gap: 8px; padding: 9px; border-radius: 14px; }
  .minimap button { width: 18px; height: 18px; position: relative; }
  .minimap button::after { content: ""; position: absolute; inset: -5px; }
  .def-card { touch-action: none; padding-top: 22px; }
  .tabbar a { min-height: 48px; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
