:root {
  color-scheme: light;
  /* Sky / paper palette */
  --sky-0: #f6fbff;
  --sky-1: #eaf4fc;
  --sky-2: #d9ecf9;
  --sky-3: #c2e0f5;
  --sky-4: #a7d1ee;
  --paper: #ffffff;
  --paper-tint: #f7fbfe;

  /* Ink */
  --ink: #1c3a55;
  --ink-soft: #2b4d6c;
  --muted: #7c95a8;
  --muted-soft: #a3b5c2;

  /* Brand blue (buttons / accents) */
  --blue-grad-top: #6cb1e6;
  --blue-grad-bot: #3d89cf;
  --blue-grad-line: #2f78bd;
  --blue-soft: #e5f1fb;
  --blue-tint: #f1f7fd;
  --blue-pill: #dceaf6;
  --blue-pill-ink: #3a72a5;

  /* Greens / supports */
  --check: #4fb27a;

  /* Lines / shadows */
  --line: rgba(122, 168, 205, 0.22);
  --line-soft: rgba(122, 168, 205, 0.14);
  --shadow-card: 0 12px 32px rgba(60, 110, 160, 0.10);
  --shadow-soft: 0 8px 24px rgba(80, 130, 175, 0.08);
  --shadow-lift: 0 18px 46px rgba(50, 110, 165, 0.18);

  /* Radii */
  --r-card: 22px;
  --r-card-lg: 26px;
  --r-button: 18px;
  --r-pill: 999px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(120% 70% at 70% -10%, #ffffff 0%, rgba(255,255,255,0) 55%),
    radial-gradient(120% 80% at 0% 110%, #e8f4ff 0%, rgba(232,244,255,0) 50%),
    linear-gradient(180deg, #e6f1fb 0%, #f4faff 45%, #e9f3fc 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  cursor: pointer;
  background: transparent;
}

/* ---------- App shell / phone frame ---------- */

.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: start center;
  padding: 0;
}

.phone-frame {
  position: relative;
  width: min(100vw, 430px);
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(140% 60% at 50% -10%, #ffffff 0%, rgba(255,255,255,0) 55%),
    linear-gradient(180deg, #e9f3fc 0%, #f5fbff 40%, #e7f2fc 100%);
}

/* Soft cloud / floral atmosphere behind everything */
.phone-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(80px 60px at 14% 12%, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0) 70%),
    radial-gradient(120px 80px at 92% 22%, rgba(255,255,255,0.85) 0%, rgba(255,255,255,0) 70%),
    radial-gradient(140px 90px at 18% 88%, rgba(255,255,255,0.75) 0%, rgba(255,255,255,0) 75%);
  pointer-events: none;
}

.screen {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  padding: max(18px, env(safe-area-inset-top)) 20px calc(120px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* The last visible piece of content needs to clear the fixed nav.
   Push interactive trailing elements above the nav band. */
.screen > :last-child {
  margin-bottom: 8px;
}

/* ---------- LOCK screen ---------- */

.lock-screen {
  justify-content: center;
  padding-bottom: max(22px, env(safe-area-inset-bottom));
}

.lock-mascots {
  position: relative;
  width: 188px;
  height: 126px;
  margin: 0 auto -18px;
  z-index: 2;
  pointer-events: none;
}

.lock-mascots .m-shiba,
.lock-mascots .m-cat {
  position: absolute;
  filter: drop-shadow(0 8px 14px rgba(50, 110, 165, 0.12));
}

.lock-mascots .m-shiba {
  left: 10px;
  bottom: 0;
  width: 108px;
  height: 108px;
}

.lock-mascots .m-cat {
  right: 12px;
  bottom: 0;
  width: 82px;
  height: 82px;
}

.lock-mascots img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.lock-card {
  padding: 28px 22px 22px;
  text-align: center;
}

.lock-card h1 {
  margin: 6px 0 6px;
  font-family: ui-serif, "New York", "Iowan Old Style", Georgia, serif;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: 0;
}

.lock-copy {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
}

.lock-form {
  display: grid;
  gap: 12px;
  text-align: left;
}

.lock-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.lock-form input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0 14px;
  background: #ffffff;
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
  box-shadow: var(--shadow-soft);
}

.lock-form input:focus {
  outline: 2px solid rgba(108, 177, 230, 0.28);
  border-color: rgba(61, 137, 207, 0.45);
}

.lock-error {
  margin: 0;
  color: #b84d61;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

/* ---------- Typography helpers ---------- */

.serif {
  font-family: ui-serif, "New York", "Iowan Old Style", "Cormorant Garamond", Georgia, "Times New Roman", serif;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.eyebrow {
  margin: 0;
  color: var(--blue-pill-ink);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.subtle {
  color: var(--muted);
}

/* ---------- TODAY: hero ---------- */

.today-hero {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 122px;
  align-items: end;
  gap: 12px;
  padding: 6px 4px 0;
  min-height: 116px;
}

.today-hero h1 {
  margin: 0;
  font-family: ui-serif, "New York", "Iowan Old Style", Georgia, serif;
  font-weight: 500;
  font-size: 30px;
  line-height: 1.08;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.today-hero h1 .accent {
  display: block;
  color: #3f7fb9;
  font-style: italic;
  font-weight: 500;
}

.today-hero .heart {
  display: inline-block;
  margin-left: 4px;
  color: #ef9aa8;
  font-size: 18px;
  vertical-align: middle;
}

.today-hero .date {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.mascot-pair {
  position: relative;
  width: 140px;
  height: 116px;
  align-self: end;
}

.mascot-pair .m-shiba,
.mascot-pair .m-cat {
  position: absolute;
  display: block;
  filter: drop-shadow(0 8px 14px rgba(50, 110, 165, 0.12));
}

.mascot-pair .m-shiba img,
.mascot-pair .m-cat img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.mascot-pair .m-shiba {
  left: -6px;
  bottom: 0;
  width: 96px;
  height: 96px;
}

.mascot-pair .m-cat {
  right: -4px;
  bottom: -4px;
  width: 74px;
  height: 74px;
  transform: rotate(2deg);
}

/* tiny floating flower flecks around hero */
.hero-flecks {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero-flecks span {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: radial-gradient(circle at center, #ffd97a 0 30%, #9ec7ef 32% 60%, transparent 62%);
  opacity: 0.55;
}

.hero-flecks span:nth-child(1) { left: 38%; top: 10%; }
.hero-flecks span:nth-child(2) { left: 70%; top: 6%; opacity: 0.45; }
.hero-flecks span:nth-child(3) { left: 88%; top: 38%; opacity: 0.55; }
.hero-flecks span:nth-child(4) { left: 58%; top: 70%; opacity: 0.5; }

/* ---------- Card primitives ---------- */

.card {
  position: relative;
  background: linear-gradient(180deg, #ffffff 0%, var(--paper-tint) 100%);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.card.flat {
  box-shadow: var(--shadow-soft);
}

/* small decorative flower tucked into a card corner */
.card-flower {
  position: absolute;
  width: 56px;
  height: 56px;
  pointer-events: none;
  opacity: 0.85;
  filter: drop-shadow(0 4px 10px rgba(80, 130, 175, 0.10));
}

.card-flower.tr {
  right: -8px;
  top: -10px;
  transform: rotate(18deg);
}

.card-flower.bl {
  left: -10px;
  bottom: -10px;
  transform: rotate(-12deg);
}

/* ---------- TODAY: progress / summary card ---------- */

.summary-card {
  display: grid;
  grid-template-columns: 92px 1fr;
  align-items: center;
  gap: 16px;
  padding: 18px 18px 18px 16px;
}

.progress-ring {
  position: relative;
  width: 88px;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, #ffffff 0 58%, transparent 59%),
    conic-gradient(#5fa9e5 var(--progress, 0%), #e0eef8 0);
  box-shadow:
    0 0 0 6px #ffffff,
    0 8px 18px rgba(70, 130, 180, 0.12);
}

.progress-ring strong {
  font-family: ui-serif, "New York", Georgia, serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1;
}

.progress-ring span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.summary-text {
  min-width: 0;
}

.summary-text h2 {
  margin: 0;
  font-family: ui-serif, "New York", Georgia, serif;
  font-weight: 600;
  font-size: 18px;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.summary-text p {
  margin: 4px 0 10px;
  color: var(--muted);
  font-size: 13px;
}

.summary-checks {
  display: flex;
  gap: 6px;
}

.summary-checks span {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #cfe6f7;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.summary-checks span.on {
  background: linear-gradient(180deg, #79bbe9, #4f95d4);
  box-shadow: 0 4px 10px rgba(70, 130, 180, 0.25);
}

/* ---------- TODAY: section header ---------- */

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 4px 2px;
}

.section-head h2 {
  margin: 0;
  font-family: ui-serif, "New York", Georgia, serif;
  font-weight: 600;
  font-size: 17px;
  color: var(--ink);
  letter-spacing: -0.005em;
}

.section-head h2 .star {
  color: #f3c659;
  margin-left: 4px;
}

.pill {
  padding: 5px 11px;
  border-radius: var(--r-pill);
  background: var(--blue-pill);
  color: var(--blue-pill-ink);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.pill.green {
  background: #dff2e6;
  color: #2f8a59;
}

.pill.muted {
  background: #eef3f7;
  color: var(--muted);
}

/* ---------- Task cards ---------- */

.task-stack {
  display: grid;
  gap: 12px;
}

.task-card {
  position: relative;
  display: grid;
  grid-template-columns: 26px 78px 1fr 92px;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 12px 10px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfe 100%);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-soft);
}

.task-card.done {
  background: linear-gradient(180deg, #ffffff 0%, #eff7fd 100%);
}

.task-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #c9dceb;
  background: #ffffff;
  display: grid;
  place-items: center;
  color: transparent;
  font-size: 14px;
  font-weight: 800;
}

.task-card.done .task-check {
  background: linear-gradient(180deg, #79bbe9, #4f95d4);
  border-color: #4f95d4;
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(70, 130, 180, 0.22);
}

.task-thumb {
  width: 84px;
  height: 84px;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 4px 10px rgba(60, 110, 160, 0.12));
  overflow: visible;
}

.task-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.task-info {
  min-width: 0;
}

.task-info h3 {
  margin: 0 0 4px;
  font-family: ui-serif, "New York", Georgia, serif;
  font-weight: 600;
  font-size: 16px;
  color: var(--ink);
  letter-spacing: -0.005em;
}

.task-meta {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.task-meta .ico {
  display: inline-grid;
  place-items: center;
  width: 14px;
  height: 14px;
  color: #8aa6b6;
}

.task-status {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #d8932f;
  font-size: 12px;
  font-weight: 600;
}

.task-status .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f0a637;
}

.task-card.done .task-status {
  color: var(--check);
}

.task-card.done .task-status .dot {
  background: var(--check);
}

/* Right action area (Upload Proof / Logged pill) */
.task-action {
  display: grid;
  justify-items: stretch;
}

.btn-proof {
  height: 78px;
  padding: 8px 8px;
  border-radius: 16px;
  color: #ffffff;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.01em;
  background: linear-gradient(180deg, var(--blue-grad-top) 0%, var(--blue-grad-bot) 100%);
  border: 1px solid var(--blue-grad-line);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.35),
    0 8px 18px rgba(60, 130, 190, 0.28);
  display: grid;
  place-items: center;
  gap: 4px;
  text-align: center;
  line-height: 1.15;
}

.btn-proof .ico-up {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
}

.btn-proof.done {
  background: linear-gradient(180deg, #eaf5fc, #d8e9f5);
  border-color: #c3d8e8;
  color: var(--blue-pill-ink);
  box-shadow: none;
}

/* ---------- Sleep card ---------- */

.sleep-card {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
}

.sleep-card .moon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #f0f6fc, #dde9f4);
  color: #5e8caf;
  font-size: 18px;
}

.sleep-card .body h3 {
  margin: 0;
  font-family: ui-serif, "New York", Georgia, serif;
  font-weight: 600;
  font-size: 16px;
  color: var(--ink);
}

.sleep-card .body p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.sleep-card .pill-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sleep-card .check-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: var(--r-pill);
  background: #dff2e6;
  color: #2f8a59;
  font-size: 11px;
  font-weight: 700;
}

.sleep-card .check-pill .ico {
  width: 12px;
  height: 12px;
}

.sleep-card .edit {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f0f6fc;
  color: var(--muted);
  font-size: 14px;
  display: grid;
  place-items: center;
}

/* ---------- Footer flowers + sync ---------- */

.footer-block {
  position: relative;
  margin-top: auto;
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ---- Backdrop flora — decorative, doesn't take layout space ---- */
.page-flora {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.page-flora .ff {
  position: absolute;
  filter: drop-shadow(0 6px 12px rgba(80, 130, 175, 0.08));
}

.page-flora .ff img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* bottom corners — peek from behind the nav */
.page-flora .ff-bl {
  left: -42px;
  bottom: 56px;
  width: 150px;
  height: 150px;
  opacity: 0.85;
  transform: rotate(-10deg);
}

.page-flora .ff-br {
  right: -42px;
  bottom: 56px;
  width: 150px;
  height: 150px;
  opacity: 0.85;
  transform: rotate(8deg);
}

/* side peeks at the task-card band */
.page-flora .ff-ml {
  left: -54px;
  top: 38%;
  width: 130px;
  height: 130px;
  opacity: 0.5;
  transform: rotate(-22deg);
}

.page-flora .ff-mr {
  right: -54px;
  top: 52%;
  width: 130px;
  height: 130px;
  opacity: 0.5;
  transform: rotate(16deg);
}

/* tiny top-left accent above the cards */
.page-flora .ff-tl {
  left: -38px;
  top: 28%;
  width: 96px;
  height: 96px;
  opacity: 0.35;
  transform: rotate(-30deg);
}

.sync-line {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted-soft);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.sync-line .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #9ec7ef;
  box-shadow: 0 0 0 3px rgba(158, 199, 239, 0.25);
}

/* ---------- Bottom nav (3 tabs) ---------- */

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 10;
  width: min(calc(100vw - 28px), 402px);
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 40px rgba(50, 110, 165, 0.16);
}

.bottom-nav button {
  display: grid;
  grid-template-rows: 22px auto;
  justify-items: center;
  align-content: center;
  gap: 2px;
  height: 54px;
  border-radius: 16px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.bottom-nav button .nav-ico {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
}

.bottom-nav button.active {
  color: var(--blue-pill-ink);
  background: linear-gradient(180deg, #eaf5fd, #d9ebf8);
}

.bottom-nav button.capture {
  position: relative;
}

.bottom-nav button.capture.active {
  color: #ffffff;
  background: linear-gradient(180deg, var(--blue-grad-top), var(--blue-grad-bot));
  box-shadow: 0 10px 22px rgba(60, 130, 190, 0.30);
}

/* ---------- PROOF screen ---------- */

.proof-header {
  display: grid;
  grid-template-columns: 52px 1fr 56px;
  align-items: center;
  gap: 12px;
  padding: 4px 4px 0;
}

.proof-header .badge-shiba {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 6px 12px rgba(60, 110, 160, 0.14));
}

.proof-header .badge-shiba img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.proof-header h1 {
  margin: 0;
  font-family: ui-serif, "New York", Georgia, serif;
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.005em;
  color: var(--ink);
}

.proof-header .status {
  margin: 4px 0 0;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #3f7fb9;
  font-size: 12px;
  font-weight: 700;
}

.proof-header .status .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #5fa9e5;
  box-shadow: 0 0 0 3px rgba(95, 169, 229, 0.2);
}

.proof-header .badge-flower {
  width: 70px;
  height: 70px;
  opacity: 0.95;
  transform: rotate(6deg);
  filter: drop-shadow(0 4px 10px rgba(80, 130, 175, 0.10));
}

.proof-header .badge-flower img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Viewfinder */
.viewfinder-wrap {
  position: relative;
  border-radius: var(--r-card-lg);
  overflow: hidden;
  background: #e8f1f9;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
}

.viewfinder {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 4.35;
  background: linear-gradient(160deg, #e3eef7, #cfdfee);
  overflow: hidden;
}

.viewfinder img,
.viewfinder video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.viewfinder video {
  display: none;
}

.viewfinder video.is-live {
  display: block;
}

.viewfinder .placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  color: var(--muted);
  text-align: center;
  padding: 24px;
}

.viewfinder .placeholder.is-hidden {
  display: none;
}

.viewfinder .placeholder .cam {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff, #e3eef7);
  display: grid;
  place-items: center;
  color: #5e8caf;
  font-size: 24px;
  box-shadow: 0 8px 18px rgba(60, 110, 160, 0.14);
}

.viewfinder .placeholder strong {
  color: var(--ink);
  font-family: ui-serif, "New York", Georgia, serif;
  font-weight: 600;
  font-size: 15px;
}

.viewfinder .placeholder small {
  color: var(--muted);
  font-size: 12px;
}

/* corner brackets */
.viewfinder .corner {
  position: absolute;
  width: 28px;
  height: 28px;
  border: 2px solid rgba(255, 255, 255, 0.95);
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.25));
}

.viewfinder .corner.tl { top: 12px; left: 12px; border-right: 0; border-bottom: 0; border-top-left-radius: 8px; }
.viewfinder .corner.tr { top: 12px; right: 12px; border-left: 0; border-bottom: 0; border-top-right-radius: 8px; }
.viewfinder .corner.bl { bottom: 12px; left: 12px; border-right: 0; border-top: 0; border-bottom-left-radius: 8px; }
.viewfinder .corner.br { bottom: 12px; right: 12px; border-left: 0; border-top: 0; border-bottom-right-radius: 8px; }

.viewfinder .timestamp {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 6px 14px rgba(0,0,0,0.10);
}

.capture-canvas {
  display: none;
}

.camera-input {
  display: none;
}

.proof-primary {
  margin-top: -4px;
}

.proof-retake {
  margin-top: -6px;
}

/* Task info row under viewfinder */
.proof-task {
  position: relative;
  display: grid;
  grid-template-columns: 44px 1fr 56px;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
}

.proof-task .icon-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(180deg, #6fb3e7, #3f88cf);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 18px;
  box-shadow: 0 6px 14px rgba(60, 130, 190, 0.30);
}

.proof-task .info h3 {
  margin: 0;
  font-family: ui-serif, "New York", Georgia, serif;
  font-weight: 600;
  font-size: 16px;
  color: var(--ink);
}

.proof-task .info p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.proof-task .info .required {
  margin-top: 4px;
  color: #d8932f;
  font-weight: 600;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.proof-task .info .required .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f0a637;
}

.proof-task .cat-decor {
  position: relative;
  width: 68px;
  height: 68px;
  filter: drop-shadow(0 6px 12px rgba(80, 130, 175, 0.12));
}

.proof-task .cat-decor img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Note field */
.note-field {
  display: grid;
  gap: 6px;
}

.note-field .label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
}

.note-field .label-row label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.note-field .label-row .note-flower {
  width: 28px;
  height: 28px;
  opacity: 0.9;
  transform: rotate(-10deg);
}

.note-field .label-row .note-flower img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.note-field textarea {
  min-height: 56px;
  max-height: 96px;
  resize: none;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  background: #ffffff;
  color: var(--ink);
  font-size: 14px;
  box-shadow: var(--shadow-soft);
}

.note-field textarea::placeholder {
  color: var(--muted-soft);
}

/* Big submit / retake */
.btn-primary {
  width: 100%;
  min-height: 56px;
  border-radius: var(--r-button);
  color: #ffffff;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.01em;
  background: linear-gradient(180deg, var(--blue-grad-top), var(--blue-grad-bot));
  border: 1px solid var(--blue-grad-line);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.30),
    0 14px 28px rgba(60, 130, 190, 0.28);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-primary[disabled] {
  filter: grayscale(0.2);
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-primary .cam-bubble {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.22);
  display: grid;
  place-items: center;
  font-size: 14px;
}

.btn-retake {
  margin: 6px auto 0;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--blue-pill-ink);
  font-size: 22px;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-soft);
}

/* ---------- HISTORY screen ---------- */

.history-hero {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 96px;
  align-items: end;
  gap: 12px;
  padding: 4px 4px 0;
}

.history-hero h1 {
  margin: 0;
  font-family: ui-serif, "New York", Georgia, serif;
  font-weight: 600;
  font-size: 32px;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.history-hero p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.history-hero .hero-shiba {
  width: 100px;
  height: 100px;
  filter: drop-shadow(0 8px 14px rgba(50, 110, 165, 0.14));
}

.history-hero .hero-shiba img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0 4px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.chip.active {
  background: linear-gradient(180deg, #eaf5fd, #d9ebf8);
  border-color: #c3d8e8;
  color: var(--blue-pill-ink);
}

.chip .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.chip .dot.meals { background: #f0a637; }
.chip .dot.sleep { background: #8caee0; }

.legend {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--muted);
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.legend .sw {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend .sw.on { background: #5fa9e5; }
.legend .sw.off { background: #dbe6ef; }

.history-section-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 4px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.history-list {
  display: grid;
  gap: 10px;
}

.history-row {
  display: grid;
  grid-template-columns: 56px 1fr 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  background: linear-gradient(180deg, #ffffff, #f8fbfe);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
  min-height: 76px;
}

.history-row .date {
  text-align: center;
  color: var(--ink-soft);
}

.history-row .date strong {
  display: block;
  font-family: ui-serif, "New York", Georgia, serif;
  font-weight: 600;
  font-size: 16px;
  line-height: 1;
}

.history-row .date span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.history-row.empty .meal-cell {
  color: var(--muted-soft);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 56px;
}

.history-row.empty .meal-cell::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #dbe6ef;
}

.meal-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}

.meal-cell .label {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
  margin-right: 2px;
}

.thumb-stack {
  display: flex;
  align-items: center;
}

.thumb-stack .meal-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 2px 6px rgba(60, 110, 160, 0.12));
}

.thumb-stack .meal-icon + .meal-icon {
  margin-left: -12px;
}

.thumb-stack .meal-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.thumb-stack .more {
  margin-left: -10px;
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  border-radius: 13px;
  background: #ffffff;
  border: 2px solid #ffffff;
  color: var(--blue-pill-ink);
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 6px rgba(60, 110, 160, 0.14);
}

.sleep-cell {
  display: grid;
  gap: 4px;
}

.sleep-cell .label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.sleep-cell .hours {
  color: var(--ink);
  font-family: ui-serif, "New York", Georgia, serif;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.005em;
}

.sleep-cell .wave {
  height: 14px;
}

.history-footer {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 96px;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  background: linear-gradient(180deg, #ffffff, #f1f7fd);
  border: 1px solid var(--line);
  border-radius: var(--r-card-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.history-footer .stats {
  display: grid;
  gap: 4px;
}

.history-footer .stats .label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.history-footer .stats .row {
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.history-footer .stats .row .item {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.history-footer .stats .row .item .v {
  font-family: ui-serif, "New York", Georgia, serif;
  font-weight: 600;
  font-size: 18px;
  color: var(--ink);
}

.history-footer .stats .row .item .u {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.history-footer .pals {
  position: relative;
  width: 96px;
  height: 72px;
}

.history-footer .pals .p-shiba,
.history-footer .pals .p-cat {
  position: absolute;
  filter: drop-shadow(0 6px 12px rgba(80, 130, 175, 0.14));
}

.history-footer .pals .p-shiba {
  left: -8px;
  bottom: -6px;
  width: 76px;
  height: 76px;
}

.history-footer .pals .p-cat {
  right: -8px;
  bottom: 2px;
  width: 60px;
  height: 60px;
  transform: rotate(3deg);
}

.history-footer .pals img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* ---------- Misc ---------- */

.hidden {
  display: none !important;
}

/* small viewport tweaks */
@media (max-width: 380px) {
  .task-card {
    grid-template-columns: 22px 64px 1fr 80px;
  }

  .task-thumb {
    width: 64px;
    height: 64px;
  }

  .btn-proof {
    height: 64px;
    font-size: 12px;
  }

  .today-hero h1 {
    font-size: 26px;
  }
}
