/* =========================================================
   oliva — mobile app UI
   ========================================================= */

.device {
  --phone-w: 390px;
  position: relative;
  flex: none;
  width: var(--phone-w);
  height: 800px;
  padding: 9px;
  border-radius: 57px;
  background: linear-gradient(145deg, #244b3b 0%, #0a2119 32%, #06150f 100%);
  box-shadow:
    0 60px 95px -42px rgba(8, 35, 26, 0.55),
    0 20px 40px -30px rgba(8, 35, 26, 0.45),
    inset 0 0 0 1px rgba(255, 255, 255, 0.18),
    inset 0 0 0 2px rgba(0, 0, 0, 0.2);
}
.device::before,
.device::after {
  content: '';
  position: absolute;
  left: -2px;
  width: 3px;
  border-radius: 3px 0 0 3px;
  background: #1b382d;
}
.device::before {
  top: 140px;
  height: 66px;
}
.device::after {
  top: 224px;
  height: 88px;
}
.device-screen {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 49px;
  background: var(--cream);
  isolation: isolate;
}
.device-screen::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 55;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  pointer-events: none;
}
.device-island {
  position: absolute;
  top: 13px;
  left: 50%;
  z-index: 80;
  width: 103px;
  height: 27px;
  border-radius: 999px;
  background: #071912;
  transform: translateX(-50%);
  transition: background 0.3s ease;
}
.device-island::after {
  content: '';
  position: absolute;
  top: 8px;
  right: 14px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #0e2c22;
  box-shadow: inset 0 0 0 1.5px #183d30;
}
.device-status {
  position: relative;
  z-index: 70;
  display: flex;
  flex: none;
  align-items: flex-start;
  justify-content: space-between;
  height: 46px;
  padding: 16px 24px 0;
  color: var(--forest);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.01em;
  transition: color 0.3s ease;
}
.device-time {
  min-width: 44px;
}
.device-status__icons {
  display: flex;
  align-items: center;
  gap: 5px;
  padding-top: 1px;
}
.device-status__icons svg {
  height: 11px;
  width: auto;
}
.device.is-camera .device-screen {
  background: #091a13;
}
.device.is-camera .device-status {
  color: var(--white);
}
.device.is-camera .app-tabbar {
  opacity: 0;
  pointer-events: none;
  transform: translateY(24px);
}

.app-viewport {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.app-view {
  position: absolute;
  inset: 0;
  display: none;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0 18px 108px;
  scrollbar-width: none;
  overscroll-behavior: contain;
}
.app-view::-webkit-scrollbar {
  display: none;
}
.app-view.is-active {
  display: block;
  animation: appViewIn 0.4s var(--ease) both;
}
.app-view[data-view='assistant'] {
  display: none;
  overflow: hidden;
  padding: 0 16px 96px;
}
.app-view[data-view='assistant'].is-active {
  display: flex;
  flex-direction: column;
}
.app-view[data-view='scan'] {
  display: none;
  padding: 0;
  overflow: hidden;
  background: #091a13;
  color: var(--white);
}
.app-view[data-view='scan'].is-active {
  display: flex;
  flex-direction: column;
}
@keyframes appViewIn {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: none; }
}

/* ---------- app tab bar ---------- */

.app-tabbar {
  position: absolute;
  right: 13px;
  bottom: 13px;
  left: 13px;
  z-index: 60;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  height: 68px;
  padding: 6px 6px 4px;
  border: 1px solid rgba(23, 56, 44, 0.09);
  border-radius: 24px;
  background: rgba(255, 254, 250, 0.92);
  box-shadow: 0 16px 34px -18px rgba(14, 53, 40, 0.32);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  transition: opacity 0.3s ease, transform 0.4s var(--ease);
}
.app-tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 56px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #7d8d83;
  cursor: pointer;
  transition: color 0.22s ease;
}
.app-tab svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.75;
}
.app-tab span {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.app-tab.is-active {
  color: var(--forest);
}
.app-tab.is-active::after {
  content: '';
  position: absolute;
  bottom: 1px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--green);
}
.app-tab--scan {
  gap: 1px;
  color: var(--forest);
}
.app-tab--scan .tab-orb {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  margin-top: -28px;
  border: 4px solid rgba(255, 254, 250, 0.95);
  border-radius: 19px;
  background: var(--forest);
  color: var(--lime);
  box-shadow: 0 7px 17px -7px rgba(14, 53, 40, 0.6);
  transition: transform 0.25s var(--ease), background 0.25s ease;
}
.app-tab--scan .tab-orb svg {
  width: 21px;
  height: 21px;
  stroke-width: 1.8;
}
.app-tab--scan:hover .tab-orb {
  background: var(--forest-2);
  transform: translateY(-2px) rotate(-3deg);
}
.app-tab--scan.is-active::after {
  display: none;
}
.app-tab--scan span {
  color: #667a6e;
}
.app-tab--scan.is-active span {
  color: var(--forest);
}

/* ---------- common app bits ---------- */

.app-home-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 3px 16px;
}
.app-date {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
}
.app-date .app-date__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
}
.app-date .app-date__flame {
  margin-left: 3px;
  color: var(--green);
  font-size: 10px;
}
.app-greeting {
  margin-top: 4px;
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.045em;
}
.app-greeting__spark {
  display: inline-block;
  margin-left: 6px;
  color: var(--green);
  font-family: var(--font-sans);
  font-size: 16px;
  vertical-align: 5px;
  animation: spark 5s ease-in-out infinite;
}
@keyframes spark {
  0%, 100% { transform: rotate(0) scale(1); opacity: 0.7; }
  50% { transform: rotate(45deg) scale(1.18); opacity: 1; }
}
.app-avatar {
  position: relative;
  flex: none;
  width: 43px;
  height: 43px;
  padding: 0;
  border: 2px solid var(--white);
  border-radius: 50%;
  background: var(--sage);
  box-shadow: 0 3px 10px rgba(23, 56, 44, 0.15);
  cursor: pointer;
}
.app-avatar img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}
.app-avatar::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: 1px;
  width: 9px;
  height: 9px;
  border: 2px solid var(--white);
  border-radius: 50%;
  background: #79c76d;
}
.app-view-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 3px 14px;
}
.app-view-head h2 {
  margin-top: 2px;
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.04em;
}
.app-mini-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.58);
  color: var(--forest);
  cursor: pointer;
}
.app-mini-btn svg {
  width: 16px;
  height: 16px;
}
.app-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 17px 2px 9px;
}
.app-section-head h3 {
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.app-section-head button,
.app-section-head a {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 700;
  cursor: pointer;
}
.app-section-head button:hover,
.app-section-head a:hover {
  color: var(--forest);
}
.app-section-head svg {
  width: 12px;
  height: 12px;
}

/* ---------- home: daily card ---------- */

.daily-card {
  position: relative;
  overflow: hidden;
  padding: 17px;
  border-radius: 27px;
  background:
    radial-gradient(circle at 110% -20%, rgba(201, 243, 109, 0.2), transparent 45%),
    linear-gradient(145deg, #164937 0%, #0d3528 55%, #0b2c21 100%);
  color: var(--white);
  box-shadow: 0 18px 28px -22px rgba(14, 53, 40, 0.6);
}
.daily-card::before {
  content: '';
  position: absolute;
  right: -40px;
  bottom: -80px;
  width: 190px;
  height: 190px;
  border: 1px solid rgba(201, 243, 109, 0.16);
  border-radius: 50%;
}
.daily-card__top {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.daily-card__label {
  display: block;
  font-size: 11.5px;
  font-weight: 800;
}
.daily-card__goal {
  display: block;
  margin-top: 1px;
  color: rgba(255, 255, 255, 0.48);
  font-size: 9.5px;
  font-weight: 500;
}
.daily-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border: 1px solid rgba(201, 243, 109, 0.2);
  border-radius: 999px;
  background: rgba(201, 243, 109, 0.09);
  color: var(--lime);
  font-size: 9.5px;
  font-weight: 800;
}
.daily-badge svg {
  width: 10px;
  height: 10px;
}
.daily-card__main {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 4px;
}
.calorie-ring {
  position: relative;
  flex: none;
  width: 126px;
  height: 126px;
}
.calorie-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.calorie-ring circle {
  fill: none;
  stroke-width: 8.5;
  stroke-linecap: round;
}
.ring-bg {
  stroke: rgba(255, 255, 255, 0.12);
}
.ring-value {
  stroke: var(--lime);
  stroke-dasharray: 320.44;
  stroke-dashoffset: 320.44;
  transition: stroke-dashoffset 1.2s var(--ease);
}
.calorie-ring__center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 2px;
}
.calorie-ring__center strong {
  font-size: 27px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.05em;
}
.calorie-ring__center span {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.48);
  font-size: 9.5px;
  font-weight: 600;
}
.daily-copy {
  min-width: 0;
}
.daily-copy__label {
  color: rgba(255, 255, 255, 0.5);
  font-size: 9.5px;
}
.daily-copy strong {
  display: block;
  margin-top: 2px;
  font-size: 31px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.055em;
}
.daily-copy strong small {
  margin-left: 2px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0;
}
.daily-copy__hint {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 9.5px;
  line-height: 1.3;
}
.daily-copy__hint svg {
  width: 11px;
  height: 11px;
  flex: none;
  color: var(--lime);
}
.macro-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-top: 8px;
}
.macro {
  padding: 8px 9px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
}
.macro__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  color: rgba(255, 255, 255, 0.52);
  font-size: 9.5px;
  font-weight: 600;
}
.macro__top strong {
  color: var(--white);
  font-size: 9.5px;
  font-weight: 700;
}
.macro-bar {
  height: 3px;
  margin-top: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.12);
}
.macro-bar i {
  display: block;
  width: var(--value, 50%);
  height: 100%;
  border-radius: inherit;
  background: var(--lime);
  transition: width 0.9s var(--ease);
}
.macro:nth-child(2) .macro-bar i {
  background: #a9e7c1;
}
.macro:nth-child(3) .macro-bar i {
  background: #f2d78f;
}

/* ---------- home: nudge ---------- */

.ai-nudge {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  margin-top: 11px;
  padding: 12px;
  border: 1px solid #dcecbc;
  border-radius: 19px;
  background: linear-gradient(135deg, #f0f9df, #e8f5d4);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: transform 0.25s var(--ease), border-color 0.25s ease, box-shadow 0.25s ease;
}
.ai-nudge:hover {
  transform: translateY(-2px);
  border-color: #c8e399;
  box-shadow: 0 9px 20px -15px rgba(54, 113, 84, 0.4);
}
.ai-nudge__avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 11px;
  background: var(--forest);
  color: var(--lime);
}
.ai-nudge__avatar svg {
  width: 17px;
  height: 17px;
}
.ai-nudge__body {
  flex: 1;
  min-width: 0;
}
.ai-nudge__body strong {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 800;
}
.ai-nudge__body strong i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #6dab57;
}
.ai-nudge__body p {
  margin-top: 2px;
  color: #516b5b;
  font-size: 9.5px;
  line-height: 1.4;
}
.ai-nudge__arrow {
  display: grid;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  margin-top: 3px;
  border-radius: 50%;
  background: rgba(14, 53, 40, 0.08);
  color: var(--forest);
}
.ai-nudge__arrow svg {
  width: 12px;
  height: 12px;
}

/* ---------- home: meals ---------- */

.meal-scroll {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 151px;
  gap: 9px;
  overflow-x: auto;
  padding: 1px 1px 5px;
  margin: 0 -2px;
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
}
.meal-scroll::-webkit-scrollbar {
  display: none;
}
.meal-card {
  position: relative;
  overflow: hidden;
  min-width: 0;
  padding: 6px;
  border: 1px solid rgba(23, 56, 44, 0.08);
  border-radius: 18px;
  background: var(--white);
  box-shadow: 0 8px 20px -18px rgba(14, 53, 40, 0.3);
  scroll-snap-align: start;
}
.meal-card__photo {
  position: relative;
  height: 82px;
  overflow: hidden;
  border-radius: 13px;
  background: var(--sage);
}
.meal-card__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.65s var(--ease);
}
.meal-card:hover .meal-card__photo img {
  transform: scale(1.05);
}
.meal-card__type {
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(255, 254, 250, 0.9);
  color: var(--forest);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.meal-card__body {
  padding: 7px 3px 3px;
}
.meal-card__body h4 {
  overflow: hidden;
  color: var(--ink);
  font-size: 9.5px;
  font-weight: 700;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.meal-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 600;
}
.meal-card__meta strong {
  color: var(--forest);
  font-size: 9.5px;
  font-weight: 800;
}

/* ---------- home: water & progress ---------- */

.water-card {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--white);
}
.water-card__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 33px;
  height: 33px;
  border-radius: 11px;
  background: #e8f3f7;
  color: #4c8ca1;
}
.water-card__icon svg {
  width: 16px;
  height: 16px;
}
.water-card__body {
  flex: 1;
  min-width: 0;
}
.water-card__top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 9.5px;
  font-weight: 700;
}
.water-card__top span {
  color: var(--muted);
  font-weight: 600;
}
.water-bar {
  height: 4px;
  margin-top: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: #e8eee7;
}
.water-bar i {
  display: block;
  width: var(--value, 70%);
  height: 100%;
  border-radius: inherit;
  background: #8bc4d4;
  transition: width 0.5s var(--ease);
}
.water-plus {
  display: grid;
  place-items: center;
  flex: none;
  width: 29px;
  height: 29px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--forest);
  color: var(--white);
  cursor: pointer;
  transition: transform 0.22s var(--ease), background 0.22s ease;
}
.water-plus:hover {
  background: var(--forest-2);
  transform: scale(1.06);
}
.water-plus svg {
  width: 13px;
  height: 13px;
}
.app-progress-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.6);
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.app-progress-link:hover {
  border-color: var(--line-strong);
  background: var(--white);
}
.app-progress-link__value {
  color: var(--green);
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.04em;
}
.app-progress-link__text {
  flex: 1;
  min-width: 0;
}
.app-progress-link__text strong {
  display: block;
  font-size: 9.5px;
  font-weight: 800;
}
.app-progress-link__text span {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 9.5px;
}
.app-progress-link > svg {
  width: 13px;
  height: 13px;
  color: var(--muted);
}

/* ---------- diary ---------- */

.week-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  margin-top: 2px;
}
.week-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 8px 2px 7px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.week-day span {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
}
.week-day strong {
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
}
.week-day.is-past {
  opacity: 0.62;
}
.week-day.is-active {
  border-color: var(--forest);
  background: var(--forest);
  color: rgba(255, 255, 255, 0.6);
}
.week-day.is-active strong {
  color: var(--lime);
}
.day-summary {
  margin-top: 12px;
  padding: 15px;
  border-radius: 21px;
  background: var(--forest);
  color: var(--white);
}
.day-summary__top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}
.day-summary__top span {
  color: rgba(255, 255, 255, 0.55);
  font-size: 9.5px;
  font-weight: 600;
}
.day-summary__top strong {
  display: block;
  margin-top: 3px;
  font-size: 23px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
}
.day-summary__top strong small {
  margin-left: 4px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 9.5px;
  font-weight: 600;
}
.day-summary__right {
  text-align: right;
}
.day-summary__right b {
  display: block;
  color: var(--lime);
  font-size: 12px;
  font-weight: 800;
}
.day-summary__right span {
  display: block;
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.46);
  font-size: 9.5px;
}
.day-summary__bar {
  height: 5px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.13);
}
.day-summary__bar i {
  display: block;
  width: var(--value, 64%);
  height: 100%;
  border-radius: inherit;
  background: var(--lime);
  transition: width 0.7s var(--ease);
}
.diary-meals {
  margin-top: 11px;
}
.diary-group {
  margin-bottom: 9px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: var(--white);
}
.diary-group__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.diary-group__title {
  display: flex;
  align-items: center;
  gap: 7px;
}
.diary-group__title span:first-child {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 8px;
  background: var(--sage-light);
  color: var(--green);
}
.diary-group__title svg {
  width: 13px;
  height: 13px;
}
.diary-group__title strong {
  font-size: 10.5px;
  font-weight: 800;
}
.diary-group__title small {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 9.5px;
}
.diary-group__kcal {
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 700;
}
.diary-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid rgba(23, 56, 44, 0.08);
}
.diary-item__photo {
  flex: none;
  width: 34px;
  height: 34px;
  overflow: hidden;
  border-radius: 10px;
  background: var(--sage);
}
.diary-item__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.diary-item__body {
  flex: 1;
  min-width: 0;
}
.diary-item__body strong {
  display: block;
  overflow: hidden;
  font-size: 9.5px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.diary-item__body span {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 9.5px;
}
.diary-item__cal {
  color: var(--forest);
  font-size: 9.5px;
  font-weight: 800;
}
.diary-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  margin-top: 8px;
  padding: 9px;
  border: 1px dashed rgba(54, 113, 84, 0.28);
  border-radius: 12px;
  background: transparent;
  color: var(--green);
  font-size: 9.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.diary-add:hover {
  border-color: var(--green);
  background: var(--sage-light);
}
.diary-add svg {
  width: 11px;
  height: 11px;
}
.diary-tip {
  display: flex;
  gap: 8px;
  margin-top: 3px;
  padding: 11px 12px;
  border-radius: 15px;
  background: var(--sage-light);
  color: #55705f;
  font-size: 9.5px;
  line-height: 1.45;
}
.diary-tip svg {
  flex: none;
  width: 13px;
  height: 13px;
  color: var(--green);
}

/* ---------- scanner ---------- */

.scan-top {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 18px 10px;
}
.scan-top h2 {
  font-size: 12px;
  font-weight: 800;
}
.scan-top__btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
  cursor: pointer;
}
.scan-top__btn svg {
  width: 16px;
  height: 16px;
}
.scan-frame {
  position: relative;
  flex: 1;
  min-height: 0;
  margin: 0 14px;
  overflow: hidden;
  border-radius: 27px;
  background: #102c20;
}
.scan-frame > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.92) brightness(0.78);
  transition: filter 0.4s ease, transform 6s ease;
  transform: scale(1.02);
}
.scan-frame.is-scanning > img {
  filter: saturate(0.9) brightness(0.86);
  transform: scale(1.07);
}
.scan-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(5, 20, 14, 0.35), transparent 30%, transparent 65%, rgba(5, 20, 14, 0.62));
}
.scan-corner {
  position: absolute;
  z-index: 2;
  width: 28px;
  height: 28px;
  border-color: rgba(255, 255, 255, 0.8);
  border-style: solid;
}
.scan-corner--tl {
  top: 23px;
  left: 23px;
  border-width: 1.5px 0 0 1.5px;
  border-radius: 10px 0 0;
}
.scan-corner--tr {
  top: 23px;
  right: 23px;
  border-width: 1.5px 1.5px 0 0;
  border-radius: 0 10px 0 0;
}
.scan-corner--bl {
  bottom: 23px;
  left: 23px;
  border-width: 0 0 1.5px 1.5px;
  border-radius: 0 0 0 10px;
}
.scan-corner--br {
  right: 23px;
  bottom: 23px;
  border-width: 0 1.5px 1.5px 0;
  border-radius: 0 0 10px;
}
.scan-line {
  position: absolute;
  top: 20%;
  left: 18px;
  right: 18px;
  z-index: 3;
  height: 1.5px;
  background: var(--lime);
  box-shadow: 0 0 18px 2px rgba(201, 243, 109, 0.55);
  opacity: 0.7;
  animation: scanMove 4.4s var(--ease-in-out) infinite;
}
.scan-frame.is-scanning .scan-line {
  opacity: 1;
  animation: scanMove 0.9s ease-in-out infinite;
}
.scan-line::before {
  content: '';
  position: absolute;
  inset: -35px 0 auto;
  height: 35px;
  background: linear-gradient(to top, rgba(201, 243, 109, 0.12), transparent);
}
@keyframes scanMove {
  0%, 100% { top: 18%; }
  50% { top: 78%; }
}
.scan-hint {
  position: absolute;
  right: 20px;
  bottom: 24px;
  left: 20px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 9.5px;
  font-weight: 600;
  text-align: center;
}
.scan-hint span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--lime);
}
.scan-frame-badge {
  position: absolute;
  top: 24px;
  left: 50%;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(8, 26, 18, 0.55);
  color: var(--white);
  font-size: 9.5px;
  font-weight: 700;
  transform: translateX(-50%);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.scan-frame-badge svg {
  width: 9px;
  height: 9px;
  color: var(--lime);
}
.scan-controls {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  padding: 17px 30px 20px;
}
.scan-side-btn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}
.scan-side-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: scale(1.04);
}
.scan-side-btn svg {
  width: 17px;
  height: 17px;
}
.scan-shutter {
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}
.scan-shutter span {
  display: block;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--white);
  transition: transform 0.18s ease, background 0.2s ease;
}
.scan-shutter:hover span {
  background: var(--lime);
  transform: scale(0.94);
}
.scan-shutter.is-busy span {
  background: var(--lime);
  animation: shutterPulse 0.65s ease-in-out infinite alternate;
}
@keyframes shutterPulse {
  to { transform: scale(0.82); opacity: 0.7; }
}
.scan-bottom-note {
  position: absolute;
  bottom: 103px;
  left: 0;
  right: 0;
  z-index: 5;
  color: rgba(255, 255, 255, 0.44);
  font-size: 9.5px;
  font-weight: 600;
  text-align: center;
  pointer-events: none;
}
.scan-result {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  max-height: 65%;
  padding: 12px 19px 24px;
  border-radius: 30px 30px 0 0;
  background: var(--cream);
  color: var(--ink);
  box-shadow: 0 -20px 50px -25px rgba(0, 0, 0, 0.55);
  transform: translateY(105%);
  transition: transform 0.6s var(--ease);
  overflow-y: auto;
}
.scan-result.is-visible {
  transform: none;
}
.scan-result__handle {
  width: 37px;
  height: 4px;
  margin: 0 auto 12px;
  border-radius: 99px;
  background: rgba(23, 56, 44, 0.18);
}
.scan-result__tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  border-radius: 999px;
  background: #e6f4d2;
  color: var(--green);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.scan-result__tag svg {
  width: 9px;
  height: 9px;
}
.scan-result__title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-top: 9px;
}
.scan-result__title h3 {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.07;
  letter-spacing: -0.045em;
}
.scan-result__title span {
  display: inline-block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9.5px;
}
.scan-result__cal {
  flex: none;
  text-align: right;
}
.scan-result__cal strong {
  display: block;
  color: var(--forest);
  font-size: 23px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
}
.scan-result__cal span {
  color: var(--muted);
  font-size: 9.5px;
}
.scan-result__macros {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 13px;
}
.scan-result__macro {
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--white);
}
.scan-result__macro span {
  display: block;
  color: var(--muted);
  font-size: 9.5px;
}
.scan-result__macro strong {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 800;
}
.scan-confidence {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 11px;
  color: var(--muted);
  font-size: 9.5px;
}
.scan-confidence__bar {
  flex: 1;
  height: 3px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--sage);
}
.scan-confidence__bar i {
  display: block;
  width: 94%;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}
.scan-result .btn {
  min-height: 44px;
  margin-top: 13px;
  font-size: 11px;
}
.scan-result .btn svg {
  width: 14px;
  height: 14px;
}

/* ---------- assistant ---------- */

.phone-chat-head {
  display: flex;
  flex: none;
  align-items: center;
  gap: 10px;
  padding: 5px 2px 12px;
  border-bottom: 1px solid rgba(23, 56, 44, 0.08);
}
.phone-chat-head__back {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--forest);
  cursor: pointer;
}
.phone-chat-head__back svg {
  width: 17px;
  height: 17px;
}
.phone-chat-person {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 8px;
}
.phone-chat-person__avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  border-radius: 12px;
  background: var(--forest);
  color: var(--lime);
}
.phone-chat-person__avatar svg {
  width: 18px;
  height: 18px;
}
.phone-chat-person__avatar i {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 9px;
  height: 9px;
  border: 2px solid var(--cream);
  border-radius: 50%;
  background: #76c16b;
}
.phone-chat-person strong {
  display: block;
  font-size: 11px;
  font-weight: 800;
}
.phone-chat-person span {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 9.5px;
}
.phone-chat-head__more {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.phone-chat-head__more svg {
  width: 18px;
  height: 18px;
}
.phone-chat-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 1px 8px;
  scrollbar-width: none;
}
.phone-chat-body::-webkit-scrollbar {
  display: none;
}
.chat-day {
  width: fit-content;
  margin: 0 auto 12px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(23, 56, 44, 0.06);
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 700;
}
.chat-row {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  margin-bottom: 9px;
  animation: bubbleIn 0.35s var(--ease) both;
}
.chat-row--user {
  justify-content: flex-end;
}
.chat-row__avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--forest);
  color: var(--lime);
}
.chat-row__avatar svg {
  width: 11px;
  height: 11px;
}
.chat-bubble {
  max-width: 78%;
  padding: 9px 11px;
  border-radius: 15px 15px 15px 5px;
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 5px 15px -12px rgba(14, 53, 40, 0.3);
  font-size: 9.5px;
  line-height: 1.48;
}
.chat-bubble strong {
  font-weight: 800;
}
.chat-bubble em {
  color: var(--green);
  font-style: normal;
  font-weight: 700;
}
.chat-row--user .chat-bubble {
  border-radius: 15px 15px 5px;
  background: var(--forest);
  color: var(--white);
  box-shadow: none;
}
.chat-bubble__time {
  display: block;
  margin-top: 4px;
  color: rgba(23, 56, 44, 0.35);
  font-size: 9.5px;
  text-align: right;
}
.chat-row--user .chat-bubble__time {
  color: rgba(255, 255, 255, 0.45);
}
.chat-quick {
  display: flex;
  flex: none;
  gap: 5px;
  overflow-x: auto;
  padding: 5px 0 8px;
  scrollbar-width: none;
}
.chat-quick::-webkit-scrollbar {
  display: none;
}
.chat-quick button {
  flex: none;
  padding: 6px 9px;
  border: 1px solid rgba(54, 113, 84, 0.2);
  border-radius: 999px;
  background: transparent;
  color: var(--green);
  font-size: 9.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.chat-quick button:hover {
  border-color: var(--green);
  background: var(--sage-light);
}
.chat-compose {
  display: flex;
  flex: none;
  align-items: center;
  gap: 6px;
  padding: 6px 6px 6px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
  box-shadow: 0 8px 20px -18px rgba(14, 53, 40, 0.35);
}
.chat-compose input {
  flex: 1;
  min-width: 0;
  height: 30px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 9.5px;
}
.chat-compose input::placeholder {
  color: #96a49b;
}
.chat-compose button {
  display: grid;
  place-items: center;
  flex: none;
  width: 31px;
  height: 31px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: var(--forest);
  color: var(--lime);
  cursor: pointer;
}
.chat-compose button svg {
  width: 14px;
  height: 14px;
}
.chat-typing {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 10px 12px;
}
.chat-typing i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--green);
  animation: typingDot 1s ease-in-out infinite;
}
.chat-typing i:nth-child(2) { animation-delay: 0.15s; }
.chat-typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes typingDot {
  0%, 70%, 100% { transform: translateY(0); opacity: 0.35; }
  35% { transform: translateY(-3px); opacity: 1; }
}
@keyframes bubbleIn {
  from { opacity: 0; transform: translateY(6px) scale(0.98); }
}

/* ---------- progress ---------- */

.progress-hero {
  position: relative;
  overflow: hidden;
  margin-top: 3px;
  padding: 16px;
  border-radius: 24px;
  background: linear-gradient(150deg, #e6f3d2 0%, #d9edd7 100%);
}
.progress-hero::after {
  content: '';
  position: absolute;
  top: -55px;
  right: -40px;
  width: 160px;
  height: 160px;
  border: 1px solid rgba(54, 113, 84, 0.17);
  border-radius: 50%;
}
.progress-hero__label {
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 700;
}
.progress-hero__value {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-top: 2px;
  color: var(--forest);
}
.progress-hero__value strong {
  font-family: var(--font-serif);
  font-size: 38px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.06em;
}
.progress-hero__value span {
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
}
.progress-hero__chart {
  margin-top: 7px;
}
.progress-hero__chart svg {
  width: 100%;
  height: 79px;
  overflow: visible;
}
.progress-hero__legend {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 600;
}
.progress-card {
  margin-top: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--white);
}
.progress-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.progress-card__head h3 {
  font-size: 10.5px;
  font-weight: 800;
}
.progress-card__head span {
  color: var(--green);
  font-size: 9.5px;
  font-weight: 800;
}
.week-bars {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 9px;
  height: 103px;
  margin-top: 14px;
  padding-bottom: 19px;
  border-bottom: 1px solid var(--line);
}
.week-bar {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  height: 100%;
}
.week-bar__track {
  position: relative;
  width: 100%;
  max-width: 18px;
  height: 100%;
  border-radius: 999px;
  background: #edf1e9;
  overflow: hidden;
}
.week-bar__track i {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: var(--h, 50%);
  border-radius: inherit;
  background: #c4d9be;
  transition: height 0.8s var(--ease);
}
.week-bar.is-today .week-bar__track i {
  background: var(--lime);
}
.week-bar span {
  position: absolute;
  bottom: -17px;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 700;
}
.week-bar.is-today span {
  color: var(--forest);
}
.progress-macros {
  margin-top: 10px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--white);
}
.progress-macros__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.progress-macros__head h3 {
  font-size: 10px;
  font-weight: 800;
}
.progress-macros__head span {
  color: var(--muted);
  font-size: 9.5px;
}
.progress-macro {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 0;
}
.progress-macro > span {
  flex: none;
  width: 45px;
  color: var(--muted);
  font-size: 9.5px;
}
.progress-macro__bar {
  flex: 1;
  height: 4px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--sage-light);
}
.progress-macro__bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}
.progress-macro:nth-child(3) .progress-macro__bar i {
  background: #9fc99d;
}
.progress-macro:nth-child(4) .progress-macro__bar i {
  background: #d4b96f;
}
.progress-macro b {
  flex: none;
  width: 24px;
  color: var(--forest);
  font-size: 9.5px;
  font-weight: 800;
  text-align: right;
}
.achievement-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}
.achievement {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.62);
}
.achievement__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 29px;
  height: 29px;
  border-radius: 9px;
  background: var(--sage-light);
  color: var(--green);
}
.achievement__icon svg {
  width: 14px;
  height: 14px;
}
.achievement strong {
  display: block;
  font-size: 10px;
  font-weight: 800;
}
.achievement span {
  display: block;
  color: var(--muted);
  font-size: 9.5px;
}

/* ---------- profile ---------- */

.profile-card {
  position: relative;
  overflow: hidden;
  margin-top: 2px;
  padding: 16px;
  border-radius: 24px;
  background: var(--forest);
  color: var(--white);
}
.profile-card::after {
  content: '';
  position: absolute;
  top: -80px;
  right: -60px;
  width: 180px;
  height: 180px;
  border: 1px solid rgba(201, 243, 109, 0.17);
  border-radius: 50%;
}
.profile-card__top {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}
.profile-card__avatar {
  width: 48px;
  height: 48px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 15px;
}
.profile-card__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-card__name {
  flex: 1;
  min-width: 0;
}
.profile-card__name strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 500;
  letter-spacing: -0.03em;
}
.profile-card__name span {
  display: block;
  margin-top: 1px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.45);
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-plan {
  flex: none;
  padding: 4px 7px;
  border: 1px solid rgba(201, 243, 109, 0.24);
  border-radius: 999px;
  background: rgba(201, 243, 109, 0.1);
  color: var(--lime);
  font-size: 9.5px;
  font-weight: 800;
}
.profile-card__stats {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.profile-stat strong {
  display: block;
  font-size: 13px;
  font-weight: 800;
}
.profile-stat span {
  display: block;
  margin-top: 1px;
  color: rgba(255, 255, 255, 0.45);
  font-size: 9.5px;
}
.profile-goal {
  margin-top: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: var(--white);
}
.profile-goal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.profile-goal__head h3 {
  font-size: 10.5px;
  font-weight: 800;
}
.profile-goal__head button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--green);
  font-size: 9.5px;
  font-weight: 700;
  cursor: pointer;
}
.profile-macro-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 10px;
}
.profile-macro {
  padding: 9px;
  border-radius: 10px;
  background: var(--sage-light);
}
.profile-macro span {
  display: block;
  color: var(--muted);
  font-size: 9.5px;
}
.profile-macro strong {
  display: block;
  margin-top: 1px;
  font-size: 12px;
  font-weight: 800;
}
.settings-list {
  margin-top: 10px;
  padding: 4px 13px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: var(--white);
}
.settings-row {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 11px 0;
  border: 0;
  border-bottom: 1px solid rgba(23, 56, 44, 0.07);
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.settings-row:last-child {
  border-bottom: 0;
}
.settings-row__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: var(--sage-light);
  color: var(--green);
}
.settings-row__icon svg {
  width: 14px;
  height: 14px;
}
.settings-row__text {
  flex: 1;
  min-width: 0;
}
.settings-row__text strong {
  display: block;
  font-size: 9.5px;
  font-weight: 700;
}
.settings-row__text span {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 9.5px;
}
.settings-row__chevron {
  width: 13px;
  height: 13px;
  color: #9aaba0;
}
.toggle {
  position: relative;
  flex: none;
  width: 32px;
  height: 19px;
  border: 0;
  border-radius: 999px;
  background: #dfe6dc;
  cursor: pointer;
  transition: background 0.25s ease;
}
.toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  transition: transform 0.25s var(--ease);
}
.toggle.is-on {
  background: var(--green);
}
.toggle.is-on::after {
  transform: translateX(13px);
}
.app-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin-top: 10px;
  padding: 11px;
  border: 1px solid rgba(167, 67, 62, 0.17);
  border-radius: 13px;
  background: rgba(167, 67, 62, 0.05);
  color: var(--danger);
  font-size: 9.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease;
}
.app-logout:hover {
  background: rgba(167, 67, 62, 0.1);
}
.app-logout svg {
  width: 12px;
  height: 12px;
}

/* ---------- quick add sheet ---------- */

.app-sheet {
  position: absolute;
  inset: 0;
  z-index: 90;
  display: none;
}
.app-sheet.is-open {
  display: block;
}
.app-sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 17, 12, 0.45);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.app-sheet.is-open .app-sheet__backdrop {
  opacity: 1;
}
.app-sheet__panel {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  max-height: 74%;
  padding: 11px 17px 22px;
  border-radius: 28px 28px 0 0;
  background: var(--cream);
  transform: translateY(100%);
  transition: transform 0.4s var(--ease);
  overflow-y: auto;
}
.app-sheet.is-open .app-sheet__panel {
  transform: none;
}
.sheet-handle {
  width: 35px;
  height: 4px;
  margin: 0 auto 13px;
  border-radius: 99px;
  background: rgba(23, 56, 44, 0.16);
}
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.sheet-head h3 {
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.04em;
}
.sheet-close {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(23, 56, 44, 0.06);
  color: var(--forest);
  cursor: pointer;
}
.sheet-close svg {
  width: 14px;
  height: 14px;
}
.sheet-hint {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9.5px;
}
.sheet-options {
  display: grid;
  gap: 7px;
  margin-top: 13px;
}
.sheet-option {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s var(--ease);
}
.sheet-option:hover {
  border-color: var(--green);
  transform: translateY(-1px);
}
.sheet-option__photo {
  flex: none;
  width: 42px;
  height: 42px;
  overflow: hidden;
  border-radius: 10px;
}
.sheet-option__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.sheet-option__body {
  flex: 1;
  min-width: 0;
}
.sheet-option__body strong {
  display: block;
  font-size: 9.5px;
  font-weight: 700;
}
.sheet-option__body span {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 9.5px;
}
.sheet-option__cal {
  color: var(--forest);
  font-size: 9.5px;
  font-weight: 800;
}

/* ---------- app toast ---------- */

.app-toast {
  position: absolute;
  top: 55px;
  left: 50%;
  z-index: 95;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: calc(100% - 36px);
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(14, 53, 40, 0.95);
  color: var(--white);
  box-shadow: 0 12px 25px -14px rgba(14, 53, 40, 0.6);
  font-size: 9.5px;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -8px);
  transition: opacity 0.3s ease, transform 0.3s var(--ease);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.app-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
.app-toast svg {
  width: 11px;
  height: 11px;
  color: var(--lime);
}

/* ---------- landing phone placement ---------- */

.hero-phone-stage {
  position: relative;
  display: flex;
  justify-content: center;
  width: 390px;
  height: 690px;
}
.hero-phone-stage .device {
  transform: scale(0.855);
  transform-origin: top center;
}

/* ---------- small height / width adjustments ---------- */

@media (max-height: 760px) {
  .app-view {
    padding-bottom: 100px;
  }
  .app-home-head {
    padding-top: 1px;
    padding-bottom: 10px;
  }
  .app-greeting {
    font-size: 23px;
  }
  .daily-card {
    padding: 14px;
  }
  .calorie-ring {
    width: 112px;
    height: 112px;
  }
  .daily-copy strong {
    font-size: 27px;
  }
  .meal-card__photo {
    height: 70px;
  }
  .ai-nudge {
    padding: 10px;
  }
  .water-card {
    padding: 9px 10px;
  }
}

@media (max-width: 360px) {
  .macro__top {
    display: block;
  }
  .macro__top span,
  .macro__top strong {
    display: block;
  }
  .macro__top strong {
    margin-top: 2px;
    font-size: 9.5px;
  }
  .macro {
    padding-inline: 6px;
  }
}

@media (max-width: 460px) {
  .device {
    --phone-w: min(390px, calc(100vw - 18px));
    height: min(800px, calc(100dvh - 114px));
    border-radius: 44px;
    padding: 7px;
  }
  .device-screen {
    border-radius: 38px;
  }
  .device-island {
    top: 11px;
    width: 90px;
    height: 24px;
  }
  .device-status {
    height: 42px;
    padding: 14px 21px 0;
    font-size: 10.5px;
  }
  .app-view {
    padding-right: 15px;
    padding-left: 15px;
  }
  .app-tabbar {
    bottom: 9px;
    height: 63px;
    border-radius: 21px;
  }
  .app-tab span {
    font-size: 9.5px;
  }
  .app-tab--scan .tab-orb {
    width: 46px;
    height: 46px;
    margin-top: -25px;
  }
}
