:root {
  --bg: #f3f2ee;
  --surface: #ffffff;
  --surface-2: #f6f5f1;
  --text: #1a1a1a;
  --text-2: #5f5e5a;
  --text-3: #888780;
  --border: rgba(0,0,0,0.08);
  --border-strong: rgba(0,0,0,0.14);
  --accent: #378ADD;
  --accent-soft: #E6F1FB;
  --accent-deep: #185FA5;
  --carb: #378ADD;
  --protein: #BA7517;
  --fat: #D85A30;
  --success: #1D9E75;
  --danger: #A32D2D;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --tabbar-h: 70px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; }
html, body {
  margin: 0; padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Roboto", "Inter", sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100%;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
.app { width: 100%; height: 100%; display: flex; flex-direction: column; position: relative; background: var(--surface); }
.safe-top { padding-top: calc(12px + var(--safe-top)); }
.safe-bottom { padding-bottom: calc(8px + var(--safe-bottom)); }

.screen {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding: 0 20px;
  display: none; -webkit-overflow-scrolling: touch;
}
.screen.active { display: block; }
.screen::-webkit-scrollbar { display: none; }
.bottom-pad { height: calc(var(--tabbar-h) + var(--safe-bottom) + 20px); }

.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 16px; background: var(--surface);
  position: sticky; top: 0; z-index: 5;
}
.topbar h1 { font-size: 24px; font-weight: 600; margin: 0; letter-spacing: -0.4px; }
.topbar .sub { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%;
  border: none; background: var(--surface-2);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.icon-btn:active { background: #e8e7e1; transform: scale(0.94); }
.icon-btn svg { width: 17px; height: 17px; stroke: var(--text); }

.ring-wrap { display: flex; align-items: center; justify-content: center; padding: 8px 0 18px; }
.ring-wrap svg { width: min(220px, 60vw); height: min(220px, 60vw); }
.ring-bg { stroke: #ecebe5; }
.ring-fg { stroke: var(--accent); transition: stroke-dashoffset .6s ease; }

.macros { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.macro { background: var(--surface-2); border-radius: var(--radius); padding: 14px 10px; text-align: center; }
.macro .lbl { font-size: 11px; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.4px; }
.macro .val { font-size: 19px; font-weight: 600; margin-top: 4px; }
.macro .val small { font-size: 11px; font-weight: 400; color: var(--text-3); }
.macro .bar { height: 4px; background: rgba(0,0,0,0.06); border-radius: 999px; margin-top: 8px; overflow: hidden; }
.macro .fill { height: 100%; transition: width .4s; }

.section-title {
  font-size: 12px; color: var(--text-2);
  text-transform: uppercase; letter-spacing: 0.5px;
  margin: 18px 0 10px;
  display: flex; justify-content: space-between; align-items: center;
}
.section-title .link { color: var(--accent); cursor: pointer; text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 500; }

.water-row { display: flex; gap: 6px; }
.glass {
  flex: 1; height: 36px; border-radius: 8px;
  border: 1.5px solid var(--border-strong); background: transparent;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.glass.full { background: var(--accent-soft); border-color: var(--accent); }
.glass:active { transform: scale(0.92); }
.glass svg { width: 16px; height: 16px; opacity: 0.5; stroke: var(--text-2); }
.glass.full svg { stroke: var(--accent-deep); opacity: 1; }

.quick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.quick-card {
  background: var(--surface-2); border-radius: var(--radius);
  padding: 14px; cursor: pointer;
  display: flex; align-items: center; gap: 12px;
}
.quick-card:active { background: #ecebe5; transform: scale(0.98); }
.quick-card .ico {
  width: 40px; height: 40px; border-radius: 50%; background: var(--surface);
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.quick-card .ico svg { width: 18px; height: 18px; stroke: var(--accent); }
.quick-card .lbl { font-size: 14px; font-weight: 500; }
.quick-card .meta { font-size: 11px; color: var(--text-2); margin-top: 2px; }

.meal { background: var(--surface-2); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; }
.meal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.meal-name { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.meal-name .dot { width: 8px; height: 8px; border-radius: 50%; }
.meal-cal { font-size: 13px; color: var(--text-2); font-weight: 500; }
.food-line {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px;
}
.food-line:last-of-type { border-bottom: none; }
.food-line .meta { font-size: 11px; color: var(--text-2); margin-top: 2px; }
.food-line .cal { color: var(--text-2); font-size: 13px; font-weight: 500; }
.food-line .del {
  width: 28px; height: 28px; border-radius: 50%;
  background: transparent; border: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-3); margin-left: 8px;
}
.food-line .del:active { background: rgba(163,45,45,0.1); color: var(--danger); }
.add-food-btn {
  background: transparent; border: none;
  color: var(--accent); font-size: 14px; font-weight: 500;
  padding: 10px 0 0; cursor: pointer;
}

.search-box {
  background: var(--surface-2); border-radius: var(--radius);
  padding: 12px 16px; display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px;
}
.search-box svg { width: 16px; height: 16px; stroke: var(--text-3); flex-shrink: 0; }
.search-box input {
  flex: 1; border: none; outline: none; background: transparent;
  font-size: 15px; color: var(--text); font-family: inherit;
}
.chip-row { display: flex; gap: 6px; flex-wrap: nowrap; margin-bottom: 14px; overflow-x: auto; padding-bottom: 4px; }
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  font-size: 13px; padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--border-strong); color: var(--text-2);
  background: transparent; cursor: pointer; white-space: nowrap; flex-shrink: 0;
}
.chip.active { background: var(--accent-soft); color: var(--accent-deep); border-color: transparent; font-weight: 500; }

.food-result {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 0; border-bottom: 1px solid var(--border); cursor: pointer;
}
.food-result:active { background: var(--surface-2); }
.food-result .name { font-size: 14px; font-weight: 500; }
.food-result .meta { font-size: 12px; color: var(--text-2); margin-top: 3px; }
.plus-btn {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-deep);
  border: none; cursor: pointer; font-size: 20px; font-weight: 500;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.plus-btn:active { background: var(--accent); color: white; transform: scale(0.92); }

.scanner-vp {
  background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
  border-radius: var(--radius-lg);
  height: 280px;
  display: flex; align-items: center; justify-content: center;
  position: relative; margin: 8px 0 16px; overflow: hidden;
}
.scan-frame {
  width: 75%; height: 140px;
  border: 2px solid var(--accent); border-radius: 12px;
  position: relative; background: rgba(55,138,221,0.05);
}
.scan-corner { position: absolute; width: 18px; height: 18px; border-color: var(--accent); border-style: solid; border-width: 0; }
.sc-tl { top: -3px; left: -3px; border-top-width: 3px; border-left-width: 3px; border-top-left-radius: 8px; }
.sc-tr { top: -3px; right: -3px; border-top-width: 3px; border-right-width: 3px; border-top-right-radius: 8px; }
.sc-bl { bottom: -3px; left: -3px; border-bottom-width: 3px; border-left-width: 3px; border-bottom-left-radius: 8px; }
.sc-br { bottom: -3px; right: -3px; border-bottom-width: 3px; border-right-width: 3px; border-bottom-right-radius: 8px; }
.scan-line { position: absolute; left: 6%; right: 6%; top: 8%; height: 2px; background: #D85A30; box-shadow: 0 0 8px rgba(216,90,48,0.6); animation: scanline 2s ease-in-out infinite; }
@keyframes scanline { 0%, 100% { top: 8%; } 50% { top: 92%; } }
.scan-tip { font-size: 13px; color: var(--text-2); text-align: center; margin: 8px 0 14px; }

.scan-action { display: flex; gap: 10px; }
.btn {
  flex: 1; padding: 14px; border-radius: var(--radius);
  font-size: 14px; font-weight: 500; text-align: center;
  border: 1px solid var(--border-strong); background: var(--surface);
  cursor: pointer; color: var(--text); font-family: inherit;
}
.btn:active { background: var(--surface-2); transform: scale(0.98); }
.btn-primary { background: var(--accent); color: white; border: none; }
.btn-primary:active { background: var(--accent-deep); }

.weight-card { background: var(--surface-2); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; display: flex; justify-content: space-between; align-items: flex-end; }
.weight-num { font-size: 32px; font-weight: 600; line-height: 1; }
.weight-num small { font-size: 14px; font-weight: 400; color: var(--text-2); }
.weight-lbl { font-size: 12px; color: var(--text-2); margin-bottom: 4px; }
.delta { font-size: 13px; color: var(--success); font-weight: 500; }

.chart-card { background: var(--surface-2); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.chart-card .head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.chart-card .title { font-size: 14px; font-weight: 600; }
.chart-card .legend { font-size: 11px; color: var(--text-2); display: flex; gap: 10px; }
.legend-dot { width: 8px; height: 8px; border-radius: 2px; display: inline-block; margin-right: 4px; vertical-align: middle; }

.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: var(--surface-2); border-radius: var(--radius); padding: 14px 10px; text-align: center; }
.stat .num { font-size: 22px; font-weight: 600; line-height: 1; }
.stat .lbl { font-size: 11px; color: var(--text-2); margin-top: 6px; }

.profile-head { display: flex; align-items: center; gap: 14px; padding: 8px 0 18px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-deep); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 18px; }
.profile-name { font-size: 16px; font-weight: 600; }
.profile-meta { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.badge-premium { display: inline-block; background: linear-gradient(135deg, #BA7517, #EF9F27); color: white; font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 999px; margin-right: 4px; }
.goal-row { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--border); font-size: 15px; cursor: pointer; }
.goal-row:active { color: var(--accent); }
.goal-row:last-child { border-bottom: none; }
.goal-val { color: var(--text-2); }

.tabbar {
  position: absolute; bottom: 0; left: 0; right: 0;
  display: flex; justify-content: space-around; align-items: center;
  padding-top: 8px; background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 10;
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 10px; color: var(--text-3);
  background: transparent; border: none; cursor: pointer;
  padding: 6px 12px; border-radius: var(--radius-sm);
  flex: 1; font-family: inherit;
}
.tab svg { width: 24px; height: 24px; stroke: currentColor; fill: none; }
.tab.active { color: var(--accent); }
.tab.active svg { fill: var(--accent-soft); stroke: var(--accent); }
.tab.fab {
  background: var(--accent); color: white;
  width: 56px; height: 56px; border-radius: 50%;
  margin-top: -20px; flex: 0 0 auto;
  box-shadow: 0 4px 16px rgba(55,138,221,0.4);
}
.tab.fab svg { width: 26px; height: 26px; }
.tab.fab:active { transform: scale(0.92); }

.toast {
  position: absolute; bottom: calc(var(--tabbar-h) + 20px + var(--safe-bottom));
  left: 50%; transform: translateX(-50%) translateY(20px);
  background: rgba(0,0,0,0.9); color: white; padding: 11px 20px;
  border-radius: 999px; font-size: 14px; font-weight: 500;
  opacity: 0; pointer-events: none; transition: all .25s; z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.modal-bg {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.5);
  display: none; align-items: flex-end; justify-content: center; z-index: 50;
}
.modal-bg.show { display: flex; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--surface); width: 100%;
  border-radius: 24px 24px 0 0; padding: 20px 20px calc(28px + var(--safe-bottom));
  max-height: 75%; overflow-y: auto;
  animation: slideUp .25s;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.modal-title { font-size: 19px; font-weight: 600; }
.modal-close { width: 36px; height: 36px; border-radius: 50%; background: var(--surface-2); border: none; cursor: pointer; font-size: 16px; }
.modal label { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 6px; margin-top: 14px; }
.modal input, .modal select {
  width: 100%; padding: 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface);
  font-size: 16px; font-family: inherit; outline: none;
}
.modal input:focus, .modal select:focus { border-color: var(--accent); }
.modal .btn-primary { width: 100%; margin-top: 20px; padding: 16px; }
.modal .grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.modal .grid-3 label { margin-top: 12px; }

/* ---------- Card / generic dashboard tile ---------- */
.card { background: var(--surface-2); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; }
.card .row-line { display: flex; justify-content: space-between; align-items: center; font-size: 14px; padding: 4px 0; }
.card .row-line.muted { color: var(--text-2); font-size: 12px; }
.card .bar { height: 6px; background: rgba(0,0,0,0.06); border-radius: 999px; overflow: hidden; margin: 8px 0; }
.card .bar .fill { height: 100%; transition: width .4s; border-radius: 999px; }
.card .link { color: var(--accent); cursor: pointer; font-weight: 500; }

/* Tag inline (e.g. "mine") */
.tag {
  display: inline-block; background: var(--accent-soft); color: var(--accent-deep);
  font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 999px;
  margin-left: 6px; vertical-align: middle; text-transform: uppercase; letter-spacing: 0.4px;
}

/* ---------- Workout cards ---------- */
.workout-card {
  background: var(--surface-2); border-radius: var(--radius);
  padding: 14px; margin-bottom: 10px;
}
.workout-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.workout-name { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.kind-pill {
  font-size: 10px; padding: 2px 8px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: 0.4px; font-weight: 600;
}
.kind-strength { background: rgba(186,117,23,0.12); color: var(--protein); }
.kind-cardio { background: rgba(216,90,48,0.12); color: var(--fat); }
.kind-flexibility { background: rgba(127,119,221,0.15); color: #5d54c0; }
.workout-detail { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.workout-notes { font-size: 12px; color: var(--text-3); margin-top: 6px; font-style: italic; }
.workout-card .del {
  width: 28px; height: 28px; border-radius: 50%;
  background: transparent; border: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-3);
}
.workout-card .del:active { background: rgba(163,45,45,0.1); color: var(--danger); }

/* History rows (fitness) */
.history-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 4px; border-bottom: 1px solid var(--border);
  gap: 10px;
}
.history-row:last-child { border-bottom: none; }
.history-date { font-size: 14px; font-weight: 500; }
.history-meta { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.history-names { font-size: 12px; color: var(--text-3); text-align: right; flex-shrink: 1; }

/* Sets editor */
.set-row {
  display: grid;
  grid-template-columns: 24px 1fr 16px 1fr 24px 32px;
  align-items: center; gap: 6px;
  margin-bottom: 6px;
}
.set-idx { color: var(--text-3); font-size: 13px; text-align: center; }
.set-x { color: var(--text-3); font-size: 13px; text-align: center; }
.set-unit { color: var(--text-3); font-size: 11px; }
.set-row input {
  padding: 10px; font-size: 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); outline: none; width: 100%;
}
.set-row input:focus { border-color: var(--accent); }
.set-del {
  width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid var(--border-strong); background: transparent;
  cursor: pointer; color: var(--text-2); font-size: 16px;
}
.set-del:active { background: var(--surface-2); }

/* ---------- Habits ---------- */
.habit-row {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--surface-2); border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 8px; cursor: pointer;
  transition: background .15s, transform .1s;
}
.habit-row:active { transform: scale(0.99); }
.habit-row.done { background: #eaf5ee; }
.habit-main { display: flex; align-items: center; gap: 12px; }
.habit-emoji {
  width: 40px; height: 40px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.habit-name { font-size: 15px; font-weight: 500; }
.habit-meta { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.habit-check {
  width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center;
  color: transparent; transition: all .2s;
  flex-shrink: 0;
}
.habit-check svg { width: 18px; height: 18px; }
.habit-check.on { background: var(--success); border-color: var(--success); color: white; }

/* 7-day grid */
.habits-grid { display: flex; flex-direction: column; gap: 4px; }
.grid-head, .grid-row {
  display: grid; grid-template-columns: 1.5fr repeat(7, 1fr); gap: 4px;
  align-items: center;
}
.grid-head { padding: 4px 0; }
.day-h { font-size: 11px; color: var(--text-3); text-align: center; }
.grid-name { font-size: 13px; padding: 4px 0; }
.grid-cell {
  height: 22px; border-radius: 4px;
  background: rgba(0,0,0,0.05);
}
.grid-cell.on { background: var(--accent); }

/* Habit color picker */
.color-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.color-dot {
  width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid transparent; cursor: pointer;
  padding: 0;
}
.color-dot.on { border-color: var(--text); transform: scale(1.08); }

/* ---------- Reminders ---------- */
.reminder-row {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--surface-2); border-radius: var(--radius);
  padding: 14px; margin-bottom: 8px;
}
.reminder-time { font-size: 22px; font-weight: 600; line-height: 1; }
.reminder-label { font-size: 14px; margin-top: 4px; }
.reminder-meta { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.reminder-actions { display: flex; align-items: center; gap: 8px; }
.reminder-actions .del {
  width: 32px; height: 32px; border-radius: 50%;
  background: transparent; border: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-3);
}
.reminder-actions .del:active { background: rgba(163,45,45,0.1); color: var(--danger); }

.status-banner {
  background: var(--accent-soft); color: var(--accent-deep);
  padding: 10px 14px; border-radius: var(--radius);
  font-size: 12px; margin-bottom: 12px;
}

/* iOS-style toggle */
.switch { position: relative; display: inline-block; width: 44px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; cursor: pointer; inset: 0;
  background: rgba(0,0,0,0.18); border-radius: 999px;
  transition: .2s;
}
.slider::before {
  content: ""; position: absolute;
  height: 22px; width: 22px; left: 2px; bottom: 2px;
  background: white; border-radius: 50%; transition: .2s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}
.switch input:checked + .slider { background: var(--success); }
.switch input:checked + .slider::before { transform: translateX(18px); }

/* Day-of-week picker */
.day-row { display: flex; gap: 6px; margin-top: 6px; }
.day-btn {
  flex: 1; padding: 10px 0; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface);
  font-size: 13px; font-weight: 500; cursor: pointer; color: var(--text-2);
  font-family: inherit;
}
.day-btn.on { background: var(--accent); color: white; border-color: var(--accent); }

/* ---------- Action sheet ---------- */
.action-sheet { padding-bottom: calc(20px + var(--safe-bottom)); }
.action-grip {
  width: 36px; height: 4px; border-radius: 2px;
  background: rgba(0,0,0,0.15); margin: 0 auto 16px;
}
.action-item {
  display: flex; align-items: center; gap: 14px; width: 100%;
  background: var(--surface-2); border: none; border-radius: var(--radius);
  padding: 14px; margin-bottom: 8px; cursor: pointer; text-align: left;
  font-family: inherit;
}
.action-item:active { background: #ecebe5; transform: scale(0.99); }
.action-emoji { font-size: 28px; flex-shrink: 0; }
.action-lbl { font-size: 15px; font-weight: 600; }
.action-meta { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.action-cancel {
  width: 100%; padding: 14px; margin-top: 8px;
  background: transparent; border: 1px solid var(--border-strong);
  border-radius: var(--radius); font-size: 14px; font-weight: 500;
  cursor: pointer; font-family: inherit; color: var(--text);
}
.action-cancel:active { background: var(--surface-2); }

/* ========================================================
   LAUNCHER (new home screen)
   ======================================================== */
.launcher { padding: 0 18px; }
.launcher-top {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 18px;
}
.hello { font-size: 26px; font-weight: 700; letter-spacing: -0.5px; }
.hello-sub { font-size: 13px; color: var(--text-2); margin-top: 2px; }

.launcher-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin-top: 4px;
}
.launcher-tile {
  background: var(--surface-2);
  border: none; border-radius: 18px;
  padding: 18px 14px; text-align: left;
  cursor: pointer; font-family: inherit;
  display: flex; flex-direction: column; gap: 8px;
  transition: transform .12s, background .15s;
  min-height: 130px;
}
.launcher-tile:active { transform: scale(0.97); background: #ecebe5; }
.tile-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 22px; color: white;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}
.tile-label { font-size: 15px; font-weight: 600; color: var(--text); margin-top: 4px; }
.tile-stat { font-size: 12px; color: var(--text-2); }

.launcher-foot {
  text-align: center; margin: 24px 0 8px;
}
.version-line { font-size: 11px; color: var(--text-3); }
.bottom-pad-sm { height: calc(20px + var(--safe-bottom)); }

/* OTA banner */
.ota-banner {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--accent-soft); color: var(--accent-deep);
  border-radius: var(--radius); padding: 10px 14px; margin-bottom: 14px;
  font-size: 13px; font-weight: 500;
}
.ota-btn {
  background: var(--accent); color: white;
  border: none; border-radius: 999px;
  padding: 6px 14px; font-size: 12px; font-weight: 600;
  cursor: pointer; font-family: inherit;
}
.ota-btn:active { background: var(--accent-deep); }

/* Back button in topbars */
.icon-btn.back { background: transparent; }
.icon-btn.back:active { background: var(--surface-2); }

/* ========================================================
   SUBSCRIPTIONS module
   ======================================================== */
.sub-row {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--surface-2); border-radius: var(--radius);
  padding: 14px; margin-bottom: 8px; cursor: pointer;
}
.sub-row:active { transform: scale(0.99); background: #ecebe5; }
.sub-name { font-size: 15px; font-weight: 600; }
.sub-meta { font-size: 12px; color: var(--text-2); margin-top: 3px; }
.sub-right { display: flex; align-items: center; gap: 8px; }
.sub-cost-stack { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.sub-cost { font-size: 16px; font-weight: 600; color: var(--text); text-align: right; }
.sub-cost-inr { font-size: 11px; color: var(--text-3); text-align: right; }
.conv-hint { font-size: 12px; color: var(--text-2); margin-top: 6px; min-height: 16px; }
.sub-row .del {
  width: 28px; height: 28px; border-radius: 50%;
  background: transparent; border: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-3);
}
.sub-row .del:active { background: rgba(163,45,45,0.1); color: var(--danger); }

.upcoming-row {
  display: grid; grid-template-columns: 1fr auto auto; gap: 12px;
  align-items: center; padding: 12px 4px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.upcoming-row:last-child { border-bottom: none; }
.up-name { font-weight: 500; }
.up-when {
  font-size: 12px; padding: 4px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-2);
}
.up-when.soon { background: rgba(216,90,48,0.12); color: var(--fat); font-weight: 600; }
.up-cost { font-weight: 600; }

.check-row {
  display: flex; align-items: center; gap: 10px;
  margin-top: 16px; font-size: 14px; color: var(--text);
  cursor: pointer;
}
.check-row input { width: auto; padding: 0; }

.empty { text-align: center; padding: 30px 20px; color: var(--text-3); font-size: 13px; }
