/* Layout: a 393×852 phone screen, centered on a quiet backdrop on desktop, full-bleed on phones.
   Single light look by design (it is a phone mock of a white app), so every color is set explicitly.
   Motion follows the Figma prototype: 0.3s ease-out dissolves between screens, sheets move in from the bottom,
   onboarding slides left, the second hand ticks with a 0.15s ease-out. */
:root {
  color-scheme: light;
  --green: #2f8456;
  --green-ink: #1f5f3c;
  --green-soft: #d9ebe0;
  --pink: #f2849a;
  --pink-soft: #fde4ea;
  --red: #c2334f;
  --ink: #1b1d1b;
  --muted: #8b8f8c;
  --card: #eeefee;
  --line: #e3e5e3;
  --white: #ffffff;
  --backdrop: #e7ece8;
  --face: #f7f7f5;
  --wedge: #d4d6d4;
  --font: "Instrument Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ease-out: cubic-bezier(0, 0, .2, 1);
  --t-screen: .3s;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--backdrop);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
img { max-width: 100%; }

.stage { height: 100%; display: grid; place-items: center; overflow: hidden; }

.device {
  position: relative;
  width: 393px;
  height: 852px;
  background: var(--white);
  border-radius: 48px;
  box-shadow: 0 0 0 10px #151816, 0 30px 80px rgba(20, 40, 28, .28);
  overflow: hidden;
  transform-origin: center center;
  flex: none;
  container-type: size;
}
@media (max-width: 520px) {
  .stage { place-items: stretch; }
  .device { width: 100%; height: 100%; border-radius: 0; box-shadow: none; transform: none !important; }
}

/* ---------- Status bar ---------- */
.statusbar {
  position: absolute; z-index: 30; top: 0; left: 0; right: 0;
  height: 50px; padding: 14px 32px 0 48px;
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 600; font-size: 16px; pointer-events: none; color: var(--ink);
}
.sb-icons { display: flex; gap: 6px; align-items: center; }
@media (max-width: 520px) { .statusbar { display: none; } }

/* ---------- Screens + dissolve ---------- */
.screen {
  position: absolute; inset: 0; background: var(--white);
  display: flex; flex-direction: column;
  padding: 62px 32px 34px;
}
@media (max-width: 520px) {
  .screen { padding-top: max(20px, env(safe-area-inset-top, 0px)); padding-bottom: max(18px, env(safe-area-inset-bottom, 0px)); }
}
.screen.entering { z-index: 2; animation: dissolve var(--t-screen) var(--ease-out) both; }
.screen.leaving { z-index: 1; pointer-events: none; }
@keyframes dissolve { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Splash ---------- */
.screen-splash { align-items: center; justify-content: center; padding: 0; }
.splash-art { position: relative; width: min(317px, 80cqw); }
.splash-art > img { display: block; width: 100%; }
.spin-hands { position: absolute; left: 38.98%; top: 43.02%; width: 22.74%; aspect-ratio: 1; }
.spin-hands i { position: absolute; left: 45.8%; width: 8.4%; border-radius: 3px; background: #348759; transform-origin: 50% 100%; }
.sh-hour { top: 18%; height: 32%; transform: rotate(-60deg); animation: spin-h 2.88s steps(24) infinite; }
.sh-min { top: 4%; height: 46%; transform: rotate(60deg); animation: spin-m .96s steps(8) infinite; }
.spin-hands img { position: absolute; left: 43%; top: 43%; width: 14%; }
@keyframes spin-h { from { transform: rotate(-60deg); } to { transform: rotate(300deg); } }
@keyframes spin-m { from { transform: rotate(60deg); } to { transform: rotate(420deg); } }
@keyframes pop { from { transform: scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Sound on ---------- */
.screen-sound { padding: 0; }
.sound-tap {
  flex: 1; border: 0; background: none; padding: 0 40px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; text-align: center; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.sound-ico { width: min(170px, 46cqw); overflow: visible; margin-bottom: 10px; }
.sound-title { color: var(--green); font-size: 22px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.sound-sub { max-width: 260px; font-size: 14px; line-height: 1.45; color: var(--ink); text-wrap: balance; }
.sound-hint { margin-top: 18px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.sound-tap:focus-visible { outline-offset: -8px; }

/* ---------- Onboarding ask ---------- */
.screen-ask { justify-content: center; overflow: hidden; }
.doodles { position: absolute; width: 108%; max-width: none; pointer-events: none; }
/* anchored to the centered form, so the doodles frame it at any screen height without covering it */
.doodles-top { left: -3.7%; top: calc(50% - 600px); }
.doodles-bottom { left: -1.4%; top: calc(50% + 100px); }
.ask { position: relative; display: flex; flex-direction: column; align-items: center; gap: 22px; margin-top: 30px; background: rgba(255,255,255,.85); border-radius: 24px; padding: 8px 0; }
.ask-label { color: var(--green); font-weight: 500; font-size: 16px; text-transform: uppercase; letter-spacing: .02em; text-align: center; }
.field {
  width: 100%; height: 52px; border: 0; border-radius: 26px;
  background: #e2e2e2; padding: 0 20px; font-size: 15px; outline: none;
}
.field::placeholder { color: #8e8e8e; }
.field:focus { box-shadow: inset 0 0 0 2px var(--green); }
.field-wrap { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.field.invalid { background: var(--pink-soft); box-shadow: inset 0 0 0 2px var(--pink); }
.field.invalid::placeholder { color: #c77a8b; }
.field.shake { animation: shake .4s var(--ease-out); }
@keyframes shake { 20% { transform: translateX(-6px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
.field-error { margin: 0 0 0 14px; display: flex; align-items: center; gap: 8px; font-size: 12px; color: #c54866; animation: drop .25s var(--ease-out) both; }
.fe-dot { width: 16px; height: 16px; flex: none; border-radius: 50%; background: var(--pink); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.text-btn.text-btn-muted { color: var(--muted); font-size: 13px; font-weight: 400; align-self: center; }
#sh-doc .handle { display: none; }
.sheet.nudge-up { animation: nudge .35s var(--ease-out); }
@keyframes nudge { 40% { transform: translateY(-10px); } }
.slide-art.art-low { place-items: end center; padding-bottom: 6px; }

/* ---------- Buttons ---------- */
.btn {
  border: 0; border-radius: 16px; height: 52px; padding: 0 20px; flex: none;
  font-size: 16px; font-weight: 500; letter-spacing: .02em; text-transform: uppercase;
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  transition: transform .12s ease, background-color .2s ease, color .2s;
}
.btn:active { transform: scale(.97); }
.btn-green { background: var(--green); color: var(--white); }
.btn-pink { background: var(--pink); color: var(--white); }
.btn-outline { background: var(--white); color: var(--green); box-shadow: inset 0 0 0 1.5px var(--green); }
.btn-small { height: 30px; min-width: 180px; border-radius: 8px; font-size: 11px; }
.btn-wide { width: 100%; }
.btn-grow { flex: 1; min-width: 0; }
.btn-square { width: 62px; padding: 0; }
.btn-icon-left { justify-content: flex-start; padding-left: 18px; }
.btn-icon-left span { flex: 1; text-align: center; padding-right: 30px; }
.btn:disabled { background: #dcdcdc; color: #f7f7f7; cursor: not-allowed; transform: none; box-shadow: none; }
.bottom-actions { margin-top: auto; display: flex; gap: 10px; flex: none; padding-top: 12px; }
.screen-timer .bottom-actions .btn-square { width: 56px; }

.eyebrow { margin: 0; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; text-align: center; }
.eyebrow-left { text-align: left; }

/* ---------- Intro carousel ---------- */
.screen-intro { padding-left: 0; padding-right: 0; }
.intro-track {
  flex: 1 1 auto; min-height: 0; display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none; overscroll-behavior-x: contain;
}
.intro-track::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; min-width: 0; min-height: 0; overflow: hidden; scroll-snap-align: center; display: flex; flex-direction: column; padding: 8px 32px 0; }
.slide-art { flex: 1 1 auto; min-height: 0; display: grid; place-items: center; container-type: size; }
.slide-text { flex: none; margin: 16px 0 0; text-align: center; font-size: 15px; line-height: 1.4; text-wrap: balance; }
.intro-foot { flex: none; padding: 16px 32px 0; display: flex; flex-direction: column; gap: 20px; }
.dots { display: flex; justify-content: center; gap: 9px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: #b9bbb9; transition: background .2s, transform .2s; }
.dots i.on { background: var(--ink); transform: scale(1.1); }

/* boxes that keep Figma's proportions and shrink to the space left above the text */
.art-box { position: relative; container-type: inline-size; }
.art-box > img, .art-box > figure { position: absolute; margin: 0; }
.art-meals { width: min(100cqw, 100cqh * .6267); aspect-ratio: 302.68 / 483; }
.art-intervals { width: min(100cqw, 100cqh * .649); aspect-ratio: 305 / 470; }
.iv-lines { position: absolute; inset: 0; width: 100%; height: 100%; }
.iv-lines { pointer-events: none; }
.iv-lines .jl, .iv-lines .jr { fill: none; stroke: var(--green); stroke-width: 1.6; stroke-linecap: round; }
.iv { display: flex; flex-direction: column; align-items: center; gap: 3cqw; width: 37.7cqw; }
.iv-ring { width: 37.7cqw; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; }
.iv-ring img { width: 92%; }
.iv figcaption { font-weight: 600; font-size: 6.6cqw; letter-spacing: .04em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.art-stack { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: min(44px, 6cqh); height: 100%; width: 100%; }
.art-house { width: min(214px, 70cqw); height: auto; max-height: 55cqh; }
.mini-row { display: flex; gap: 12px; }
.mini-time { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.mini-time span { width: 68px; height: 48px; display: grid; place-items: center; background: #e2e2e2; border-radius: 10px; color: var(--muted); font-size: 15px; }
.mini-time small { font-size: 10px; color: var(--muted); }
.hungry { margin: 0; font-size: 14px; font-weight: 500; }
.art-utensils { width: min(274px, 80cqw); max-height: 75cqh; transform: rotate(-7.43deg); }
.art-cards { width: 100%; max-height: 100cqh; display: flex; flex-direction: column; gap: min(16px, 2.5cqh); justify-content: center; }
.intro-card { background: var(--card); border-radius: 20px; padding: min(24px, 3.5cqh) 0; display: flex; flex-direction: column; align-items: center; gap: 12px; font-size: 13px; }
.ic-icons { display: flex; gap: 20px; }
.ic-icons img { width: min(96px, 14cqh); height: min(96px, 14cqh); }
.art-review { gap: min(10px, 1.6cqh); }
.mini-meal { background: var(--card); border-radius: 18px; padding: min(14px, 2cqh) 12px; display: flex; flex-direction: column; gap: min(10px, 1.4cqh); }
.mm-head { display: flex; justify-content: space-between; align-items: flex-start; }
.mm-head b { display: block; font-weight: 500; font-size: 13px; }
.mm-head small { font-size: 10px; color: var(--muted); }
.mm-head img { width: min(36px, 5.5cqh); height: min(36px, 5.5cqh); }
.mm-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.mm-grid i { height: min(52px, 7cqh); border-radius: 10px; background: #d9d9d9; }
.mini-meal p { margin: 0; font-size: 11px; line-height: 1.35; }

/* ---------- Meal tracker ---------- */
.tracker { display: flex; align-items: flex-start; justify-content: space-between; flex: none; }
.meal { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 64px; flex: none; }
.meal-ring { position: relative; width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; }
.meal-ring > svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.meal-ring .base { fill: var(--white); stroke: #c9ddd0; stroke-width: 2; }
.meal-ring .arc { fill: none; stroke: var(--green); stroke-width: 3; stroke-linecap: round; transition: stroke-dashoffset .4s linear; }
.meal-ring > img { width: 42px; height: 42px; object-fit: contain; position: relative; opacity: 0; transform: scale(.6); transition: .35s cubic-bezier(.2, .9, .3, 1.3); }
.meal-ring .inner { position: absolute; inset: 8px; border-radius: 50%; background: linear-gradient(135deg, #fff 30%, #e7f0ea); }
.meal.active .meal-ring > img, .meal.done .meal-ring > img { opacity: 1; transform: none; }
.meal.done .meal-ring .base { stroke: var(--green); }
.meal.done .meal-ring .inner { background: var(--green-soft); }
.meal-name { font-size: 14px; font-weight: 500; color: #9a9d9b; }
.meal.active .meal-name, .meal.done .meal-name { color: var(--ink); }
.meal-time { font-size: 11px; color: var(--green); font-variant-numeric: tabular-nums; min-height: 13px; }
.meal-check { position: absolute; right: -2px; bottom: -2px; width: 20px; height: 20px; border-radius: 50%; background: var(--green); display: none; place-items: center; box-shadow: 0 0 0 2px var(--white); }
.meal-check svg { display: block; }
.meal.done .meal-check { display: grid; animation: pop .35s cubic-bezier(.2, .9, .3, 1.3) both; }
.tracker-line { flex: 1; height: 2px; margin-top: 29px; background: #c9ddd0; position: relative; overflow: hidden; border-radius: 2px; }
.tracker-line i { position: absolute; inset: 0; background: var(--green); transform: scaleX(0); transform-origin: left; transition: transform .4s var(--ease-out); }
.tracker-line.done i { transform: scaleX(1); }

/* ---------- Clock ---------- */
.clock-wrap { position: relative; margin: 0 auto; aspect-ratio: 318 / 277; max-width: 100%; flex: none; }
.clock-wrap > img, .clock-wrap > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
/* clock shrinks on short screens so nothing below it gets pushed into the buttons */
.clock-home { width: min(345px, calc(100cqw - 30px), max(190px, calc((100cqh - 420px) * 1.148))); margin-top: clamp(4px, 2.5cqh, 30px); }
.clock-timer { width: min(330px, calc(100cqw - 40px), max(190px, calc((100cqh - 400px) * 1.148))); margin-top: auto; }
@media (max-width: 520px) {
  /* phones: less chrome around the screen, so the clock gets that room back */
  .clock-home { width: min(345px, calc(100cqw - 30px), max(200px, calc((100cqh - 400px) * 1.148))); }
  .clock-timer { width: min(330px, calc(100cqw - 40px), max(200px, calc((100cqh - 345px) * 1.148))); }
}
.clock .tick { stroke: #b8bcb9; stroke-width: 1.6; stroke-linecap: round; }
.clock .wedge { fill: var(--wedge); }
.clock .h-hour, .clock .h-min { stroke: var(--green-ink); stroke-linecap: round; }
.clock .h-hour { stroke-width: 4.5; }
.clock .h-min { stroke-width: 3; }
.clock .h-sec { stroke: var(--pink); stroke-width: 1.4; stroke-linecap: round; transform-box: view-box; transform-origin: 161.5px 130.4px; transition: transform .15s var(--ease-out); }
.clock .hub { fill: var(--green-ink); }
.clock.paused .wedge { fill: #e2c4cb; }
.clock-wrap.ringing { animation: ring .9s ease-in-out 3; transform-origin: 50% 20%; }
@keyframes ring {
  0%, 100% { transform: rotate(0); }
  15% { transform: rotate(-6deg); } 30% { transform: rotate(5deg); }
  45% { transform: rotate(-4deg); } 60% { transform: rotate(3deg); } 75% { transform: rotate(-1deg); }
}

/* ---------- Home ---------- */
.screen-home { padding-left: 27px; padding-right: 27px; }
.screen-home .tracker { padding: 14px 10px 0; }
.home-name {
  margin: 10px auto 0; border: 0; background: none; padding: 4px 10px; flex: none;
  font-size: 16px; font-weight: 500; letter-spacing: .02em; text-transform: uppercase; text-align: center;
}
.recent { margin-top: 6px; display: flex; flex-direction: column; gap: 6px; flex: 0 1 auto; min-height: 0; padding-bottom: 4px; margin-bottom: auto; }
.dial { position: relative; flex: none; height: 96px; display: flex; gap: 4px; }
.dial-list {
  flex: 1; min-width: 0; overflow-y: auto; scroll-snap-type: y mandatory; display: flex; flex-direction: column; align-items: center; gap: 5px;
  scrollbar-width: none; overscroll-behavior: contain;
  -webkit-mask-image: linear-gradient(transparent, #000 18%, #000 82%, transparent);
  mask-image: linear-gradient(transparent, #000 18%, #000 82%, transparent);
}
.dial-list::-webkit-scrollbar { display: none; }
.dial-pad { flex: none; width: 1px; }
.dial-scale { flex: none; width: 14px; height: 100%; object-fit: fill; }
.recent-item {
  flex: none; scroll-snap-align: center; height: 40px; width: 92%; border-radius: 15px;
  border: 1.25px solid transparent; background: var(--card); text-align: left;
  display: flex; align-items: center; gap: 10px; padding: 0 8px 0 15px;
  transition: width .2s var(--ease-out), background-color .2s, border-color .2s, opacity .2s;
}
.recent-item.center { width: 100%; background: var(--white); border-color: var(--green); }
.recent-item b { font-weight: 400; font-size: 13px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-item small { font-size: 10px; color: var(--muted); font-weight: 500; }
.recent-item > span { min-width: 0; }
.recent-item img { width: 30px; height: 30px; object-fit: contain; margin-left: auto; flex: none; }
.recent-empty { margin: auto 0; text-align: center; font-size: 13px; color: var(--muted); }

/* ---------- Timer ---------- */
.countdown-block { text-align: center; margin-bottom: auto; padding-top: 4px; flex: none; }
.cd-pre, .cd-post { margin: 0; font-size: 13px; color: var(--muted); }
.cd-time { margin: 2px 0 4px; font-size: clamp(40px, 13.7cqw, 54px); font-weight: 500; letter-spacing: -.01em; line-height: 1.12; font-variant-numeric: tabular-nums; }
.screen-timer.is-paused .cd-time { color: #b0b3b1; }
.screen-timer.is-chime .cd-pre { color: var(--green); font-weight: 500; }
.paused-tag { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 10px; background: var(--pink-soft); color: #c54866; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; vertical-align: 1px; }

/* ---------- Loading ---------- */
.screen-loading { align-items: center; justify-content: center; }
.loading-art { width: min(305px, 76cqw); animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-8px) rotate(-2deg); } }
.loading-text { font-size: 16px; margin: 20px 0 22px; text-align: center; }
.loading-dots { display: flex; gap: 10px; }
.loading-dots i { width: 14px; height: 14px; border-radius: 3px; background: #cfe2d5; animation: dot 1.2s infinite; }
.loading-dots i:nth-child(2) { animation-delay: .2s; }
.loading-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes dot { 0%, 60%, 100% { background: #cfe2d5; } 20% { background: var(--green); } }

/* ---------- List screens ---------- */
.screen-list { padding-left: 24px; padding-right: 24px; }
.list-head { padding: 12px 0; flex: none; }
.list-head.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.head-actions { display: flex; align-items: center; gap: 4px; }
.h-title { margin: 2px 0; font-size: 16px; font-weight: 500; text-transform: uppercase; letter-spacing: .02em; }
.meta { margin: 0; font-size: 11px; color: var(--muted); line-height: 1.4; }
.icon-btn { border: 0; background: none; color: var(--green); padding: 6px; border-radius: 10px; display: grid; place-items: center; }
.icon-btn-danger { color: var(--red); background: #fbe9ec; width: 40px; height: 40px; }
.text-btn { border: 0; background: none; color: var(--green); font-size: 14px; font-weight: 500; padding: 6px 10px; border-radius: 10px; }
.scroll { flex: 1 1 auto; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding-bottom: 12px; scrollbar-width: thin; min-height: 0; }

.meal-card { background: var(--card); border-radius: 20px; padding: 16px 13px; display: flex; flex-direction: column; gap: 12px; flex: none; }
.mc-head { display: flex; justify-content: space-between; align-items: flex-start; }
.mc-head b { font-weight: 500; font-size: 15px; display: block; }
.mc-head small { font-size: 11px; color: var(--muted); }
.mc-head img { width: 44px; height: 44px; object-fit: contain; }
.media-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.media-tile { position: relative; aspect-ratio: 94 / 52; border-radius: 12px; background: #d9d9d9; overflow: hidden; border: 0; padding: 0; }
.media-tile img, .media-tile video { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-tile .play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; background: rgba(0,0,0,.18); }
.media-tile .dur { position: absolute; right: 6px; bottom: 4px; font-size: 10px; color: #fff; font-weight: 600; }
.mc-note { margin: 0; font-size: 13px; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; }
.mc-empty { margin: 0; font-size: 12px; color: var(--muted); }

.proj-row { display: flex; align-items: center; gap: 0; flex: none; transition: gap .25s var(--ease-out); }
.proj-del {
  width: 0; height: 32px; flex: none; border: 0; border-radius: 50%; background: var(--red); color: #fff;
  display: grid; place-items: center; overflow: hidden; padding: 0; opacity: 0; transform: scale(.4);
  transition: width .25s var(--ease-out), opacity .2s, transform .25s var(--ease-out);
}
.editing .proj-row { gap: 12px; }
.editing .proj-del { width: 32px; opacity: 1; transform: none; }
.proj-row.removing { animation: collapse .3s var(--ease-out) forwards; }
@keyframes collapse { to { opacity: 0; transform: translateX(-30px); height: 0; margin-top: -12px; } }
.proj {
  flex: 1; min-width: 0; border: 0; background: var(--card); border-radius: 22px; min-height: 68px; padding: 14px 16px 14px 22px;
  display: flex; align-items: center; gap: 12px; text-align: left;
}
.proj > span { min-width: 0; }
.proj b { font-weight: 500; font-size: 14px; display: block; overflow-wrap: anywhere; }
.proj small { font-size: 11px; color: var(--muted); }
.proj img { width: 46px; height: 46px; object-fit: contain; margin-left: auto; flex: none; }
.proj .live { display: inline-block; margin-left: 6px; font-size: 10px; color: var(--white); background: var(--green); border-radius: 8px; padding: 1px 7px; vertical-align: 1px; letter-spacing: .04em; text-transform: uppercase; }
.trash-link { flex: none; margin: 4px auto 0; border: 0; background: none; color: var(--muted); font-size: 13px; display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 10px; }
.empty-state { margin: 30px 20px; text-align: center; color: var(--muted); font-size: 14px; line-height: 1.45; }
.empty-state img { width: 140px; display: block; margin: 0 auto 12px; }

.trash-item { flex: none; background: var(--card); border-radius: 20px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.trash-item b { font-weight: 500; font-size: 14px; display: block; overflow-wrap: anywhere; }
.trash-item small { font-size: 11px; color: var(--muted); }
.trash-actions { display: flex; gap: 8px; }
.trash-actions button { flex: 1; height: 36px; border-radius: 12px; border: 0; font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .03em; }
.btn-restore { background: var(--white); color: var(--green); box-shadow: inset 0 0 0 1.5px var(--green); }
.btn-forever { background: #fbe9ec; color: var(--red); }
.btn-forever.armed { background: var(--red); color: #fff; }

/* ---------- Profile ---------- */
.profile-top { padding-top: 6px; flex: none; }
.back-btn { width: 42px; height: 42px; border-radius: 12px; border: 0; background: var(--card); display: grid; place-items: center; }
.profile-head { display: flex; gap: 16px; margin: 22px 0 28px; align-items: flex-start; flex: none; }
.avatar { position: relative; width: 105px; height: 105px; flex: none; border-radius: 16px; background: #d9d9d9; color: var(--white); display: grid; place-items: center; }
.avatar-edit { position: absolute; top: -6px; right: -6px; width: 30px; height: 30px; border-radius: 50%; background: var(--pink); display: grid; place-items: center; }
.profile-id { min-width: 0; }
.profile-name { margin: 0 0 12px; font-size: 24px; font-weight: 500; line-height: 1.12; text-wrap: balance; overflow-wrap: anywhere; }
.stats { display: flex; gap: 18px; margin: 0; flex-wrap: wrap; }
.stats dt { font-size: 13px; font-variant-numeric: tabular-nums; }
.stats dd { margin: 0; font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.pill-project {
  margin: 8px 0 24px; height: 44px; border-radius: 22px; border: 0; background: var(--green); color: var(--white); flex: none;
  display: flex; align-items: center; justify-content: space-between; padding: 0 16px; font-size: 13px; font-weight: 500;
}
.pill-project small { font-size: 10px; letter-spacing: .06em; text-transform: uppercase; opacity: .9; }
.pill-project.none { background: var(--card); color: var(--muted); }
.settings { margin-top: 8px; background: var(--card); border-radius: 20px; padding: 6px 12px; display: flex; flex-direction: column; flex: none; }
.setting { display: flex; align-items: center; gap: 12px; height: 54px; border: 0; background: none; text-align: left; padding: 0; }
.setting + .setting { border-top: 1px solid var(--line); }
.set-ico { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.set-ico.pink { background: var(--pink-soft); color: #b94a63; }
.set-ico.green { background: var(--green-soft); color: var(--green-ink); }
.set-ico.grey { background: #e0e0e0; color: #666; }
.set-ico.red { background: #fbe9ec; color: var(--red); }
.set-label { flex: 1; font-size: 13px; }
.chev { color: #8d8d8d; }
.switch { width: 40px; height: 24px; border-radius: 12px; background: #c9c9c9; position: relative; transition: background .2s; }
.switch i { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch.on { background: var(--green); }
.switch.on i { transform: translateX(16px); }
#setReset.armed .set-label { color: var(--red); font-weight: 600; }

/* ---------- Sheets: move in from the bottom, dissolve between sheets ---------- */
.sheet-layer { position: absolute; inset: 0; z-index: 20; }
.scrim { position: absolute; inset: 0; background: rgba(40, 40, 40, .38); animation: fade var(--t-screen) var(--ease-out) both; }
.sheet-layer.closing .scrim { animation: fade-out .25s var(--ease-out) forwards; }
@keyframes fade { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; background: var(--white);
  border-radius: 34px 34px 0 0; padding: 30px 32px 34px;
  display: flex; flex-direction: column; max-height: calc(100% - 12px); overflow-y: auto; overscroll-behavior: contain;
}
.sheet > * { flex-shrink: 0; }
.sheet.move-in { animation: up var(--t-screen) var(--ease-out) both; }
.sheet.swap-in { animation: dissolve var(--t-screen) var(--ease-out) both; }
.sheet-layer.closing .sheet { animation: down .25s cubic-bezier(.4, 0, 1, 1) forwards; }
@keyframes up { from { transform: translateY(100%); } }
@keyframes down { to { transform: translateY(100%); } }
.sheet-full { top: 56px; }
@media (max-width: 520px) { .sheet-full { top: max(16px, env(safe-area-inset-top, 0px)); } .sheet { padding-bottom: max(24px, env(safe-area-inset-bottom, 0px)); } }
.handle { position: absolute; top: 12px; left: 50%; width: 40px; height: 5px; margin-left: -20px; border-radius: 3px; background: #dcdcdc; cursor: pointer; }
.sheet-title { margin: 6px 0 0; font-size: 16px; font-weight: 500; text-transform: uppercase; letter-spacing: .01em; text-align: center; }
.sheet-sub { margin: 6px 0 24px; text-align: center; color: var(--muted); font-size: 13px; line-height: 1.4; }
.sheet-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; padding-top: 12px; }
.sheet-setup .sheet-title { margin-bottom: 22px; }
.sheet-setup .field { margin-bottom: 24px; }
.sheet-setup .eyebrow { margin-bottom: 8px; }
.confirm-actions { display: flex; flex-direction: column; gap: 10px; }

.picker {
  position: relative; height: 150px; border-radius: 20px; background: var(--card);
  display: grid; grid-template-columns: 1fr auto 1fr auto 1fr auto; align-items: center; column-gap: 2px; padding: 0 22px 0 6px; overflow: hidden;
}
.picker-band { position: absolute; left: 16px; right: 16px; top: 55px; height: 40px; background: var(--white); border-radius: 12px; }
.wheel {
  position: relative; height: 150px; overflow-y: auto; scroll-snap-type: y mandatory; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent);
  mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent);
  outline: none; cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none;
}
.wheel.dragging { cursor: grabbing; scroll-snap-type: none; }
.wheel::-webkit-scrollbar { display: none; }
.wheel .pad { height: 55px; }
.wheel .opt { height: 40px; display: grid; place-items: center; scroll-snap-align: center; font-size: 17px; color: #9da09e; font-variant-numeric: tabular-nums; transition: color .15s, font-size .15s; cursor: pointer; }
.wheel .opt.sel { color: var(--green); font-size: 21px; font-weight: 500; }
.wheel:focus-visible { box-shadow: inset 0 0 0 2px var(--green); border-radius: 12px; }
.picker-unit { position: relative; font-size: 11px; color: var(--muted); }
.chime-calc { margin-top: 16px; border: 1.5px solid var(--green); border-radius: 16px; padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.chime-calc .eyebrow { margin-bottom: 2px; }
.calc-main { margin: 0; color: var(--green); font-size: 17px; font-weight: 500; }
.calc-side { font-size: 11px; color: var(--muted); flex: none; }
.hint { margin: 12px 0 20px; text-align: center; font-size: 11px; color: var(--muted); line-height: 1.4; }
.hint.warn { color: var(--red); }

/* Doc cards */
.doc-card {
  position: relative; height: 200px; border-radius: 20px; border: 0; background: var(--card);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; margin-bottom: 16px;
  transition: box-shadow .2s, transform .12s;
}
.doc-card:active { transform: scale(.98); }
.doc-card img { width: 128px; height: 128px; object-fit: contain; }
.doc-label { font-size: 13px; display: inline-flex; gap: 8px; align-items: center; }
.doc-card.saved { box-shadow: inset 0 0 0 1.5px var(--green); }
.doc-card.saved .doc-label { color: var(--green); }
.doc-label .tick { width: 18px; height: 18px; border-radius: 50%; background: var(--green); display: grid; place-items: center; }
.ready-line { margin: 0; text-align: center; color: var(--green); font-size: 13px; }
@media (max-height: 760px) { .doc-card { height: 160px; } .doc-card img { width: 96px; height: 96px; } }

/* Camera */
.cam { position: relative; height: min(320px, 40cqh); border-radius: 22px; overflow: hidden; background: #2a2d2b; }
.cam video { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam video.mirror { transform: scaleX(-1); }
.cam-fallback { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 30px 30px 90px; color: #e9ece9; text-align: center; font-size: 13px; line-height: 1.45; }
.cam-fallback p { margin: 0; max-width: 240px; }
.cam.no-live .focus-box, .cam.no-live .zoom-pill, .cam.no-live .flip-btn, .cam.no-live .rec-pill { display: none; }
.cam-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.cam-flash.go { animation: flash .35s ease-out; }
@keyframes flash { 0% { opacity: .9; } 100% { opacity: 0; } }
.corner { position: absolute; width: 22px; height: 22px; border: 2.5px solid #fff; pointer-events: none; }
.corner.tl { top: 20px; left: 20px; border-right: 0; border-bottom: 0; }
.corner.tr { top: 20px; right: 20px; border-left: 0; border-bottom: 0; }
.corner.bl { bottom: 20px; left: 20px; border-right: 0; border-top: 0; }
.corner.br { bottom: 20px; right: 20px; border-left: 0; border-top: 0; }
.focus-box { position: absolute; left: 50%; top: 46%; width: 72px; height: 72px; margin: -36px 0 0 -36px; border: 2px solid #fff; border-radius: 10px; pointer-events: none; opacity: .9; }
.rec-pill { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; align-items: center; padding: 4px 12px; border-radius: 12px; background: rgba(0,0,0,.45); color: #fff; font-size: 11px; font-variant-numeric: tabular-nums; }
.rec-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--pink); }
.rec-pill b { font-weight: 600; }
.rec-pill em { font-style: normal; opacity: .7; }
.cam.recording .rec-pill i { animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.zoom-pill { position: absolute; left: 70px; bottom: 36px; width: 30px; height: 22px; border-radius: 11px; background: rgba(0,0,0,.35); color: #fff; font-size: 10px; display: grid; place-items: center; }
.shutter { position: absolute; left: 50%; bottom: 16px; width: 60px; height: 60px; margin-left: -30px; border: 0; background: none; padding: 0; z-index: 3; }
.shutter-ring { position: absolute; inset: 0; transform: rotate(-90deg); }
.shutter-ring circle { fill: none; stroke: #fff; stroke-width: 3.5; }
.shutter-ring .prog { stroke: var(--pink); stroke-dasharray: 169.6; stroke-dashoffset: 169.6; }
.shutter-core { position: absolute; inset: 7px; border-radius: 50%; background: rgba(255,255,255,.18); transition: all .2s; }
.cam.video .shutter-core { background: var(--pink); }
.cam.recording .shutter-core { inset: 18px; border-radius: 6px; }
.flip-btn { position: absolute; right: 64px; bottom: 30px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(0,0,0,.35); color: #fff; display: grid; place-items: center; }

.mode-toggle { margin: 18px auto 0; display: flex; gap: 4px; padding: 4px; border-radius: 22px; background: var(--card); }
.mode { width: 92px; height: 88px; border: 0; border-radius: 18px; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-size: 11px; color: var(--muted); transition: background-color .2s, box-shadow .2s, color .2s, transform .12s; }
.mode:active { transform: scale(.96); }
.mode img { width: 44px; height: 44px; object-fit: contain; }
.mode[aria-pressed="true"] { background: var(--white); box-shadow: inset 0 0 0 1.5px var(--green); color: var(--green); }
#modeVideo[aria-pressed="true"] { box-shadow: inset 0 0 0 1.5px var(--pink); color: var(--pink); }
.cam.recording ~ .mode-toggle #modeVideo { background: var(--pink); color: #fff; }
.shots { display: flex; gap: 8px; justify-content: center; margin-top: 14px; min-height: 44px; flex-wrap: wrap; }
.shots .media-tile { width: 56px; height: 44px; aspect-ratio: auto; border-radius: 10px; animation: pop .3s cubic-bezier(.2, .9, .3, 1.3) both; }
.shots-label { width: 100%; text-align: center; font-size: 11px; color: var(--muted); margin: 0; }

/* Note */
.sheet-head-x { position: relative; }
.sheet-head-x .x-btn { position: absolute; right: -6px; top: 0; }
.x-btn { width: 34px; height: 34px; border: 0; background: none; display: grid; place-items: center; border-radius: 50%; }
.note-field { position: relative; flex: 1 1 auto !important; min-height: 220px; border-radius: 22px; background: var(--card); display: flex; flex-direction: column; padding: 20px; margin-bottom: 24px; }
.note-field textarea { flex: 1; min-height: 0; resize: none; border: 0; background: none; outline: none; font-size: 14px; line-height: 1.5; padding: 0 52px 0 0; }
.note-field textarea::placeholder { color: var(--muted); }
.note-ico { position: absolute; top: 14px; right: 16px; width: 44px; }
.nudge { display: flex; flex-direction: column; gap: 10px; padding-top: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 0; background: var(--white); color: var(--green); border-radius: 14px; height: 28px; padding: 0 13px; font-size: 11px; }
.chip:active { background: var(--green-soft); }

/* Viewer + toast */
.viewer { position: absolute; inset: 0; z-index: 40; background: rgba(12, 14, 13, .92); display: grid; place-items: center; padding: 60px 16px; animation: fade .25s var(--ease-out) both; }
.viewer-body { max-width: 100%; max-height: 100%; }
.viewer-body img, .viewer-body video { max-width: 100%; max-height: 640px; border-radius: 16px; display: block; }
.viewer-x { position: absolute; top: 56px; right: 18px; color: #fff; background: rgba(255,255,255,.12); }
.toast {
  position: absolute; z-index: 50; left: 24px; right: 24px; top: 58px; padding: 10px 12px 10px 16px; border-radius: 14px;
  background: var(--ink); color: #fff; font-size: 13px; display: flex; align-items: center; justify-content: center; gap: 12px; animation: drop .3s var(--ease-out) both;
}
.toast button { border: 0; background: rgba(255,255,255,.14); color: #fff; border-radius: 10px; padding: 6px 12px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
@media (max-width: 520px) { .toast { top: max(14px, env(safe-area-inset-top, 0px)); } }
@keyframes drop { from { transform: translateY(-14px); opacity: 0; } }

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