/* CalorieLens — warm/appetite palette, mobile-first, refined minimal */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700;9..144,800&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  color-scheme: dark;

  /* Brand — warm orange/terracotta with red accent */
  --brand: #ff6a3d;          /* primary action */
  --brand-2: #ff3d6a;        /* secondary / heat */
  --brand-soft: rgba(255, 106, 61, 0.14);
  --brand-glow: rgba(255, 106, 61, 0.28);

  /* Semantic */
  --ok: #4ad295;
  --warn: #ffb547;
  --danger: #ff5d6c;

  /* Surfaces — dark mode (warm, not cold gray) */
  --bg: #120e0c;
  --bg-2: #1a1410;
  --bg-3: #221a15;
  --panel: rgba(34, 26, 21, 0.72);
  --panel-solid: #1a1410;
  --panel-2: #221a15;
  --line: rgba(255, 220, 200, 0.10);
  --line-strong: rgba(255, 220, 200, 0.18);

  /* Text */
  --text: #f7eee6;
  --text-2: #e0d3c6;
  --muted: #a89789;

  /* Effects */
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.18);
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.42);
  --shadow-brand: 0 12px 36px rgba(255, 106, 61, 0.22);

  /* Geometry */
  --r-xs: 10px;
  --r-sm: 14px;
  --r-md: 18px;
  --r-lg: 24px;
  --r-xl: 32px;

  /* Type */
  --font-display: 'Fraunces', ui-serif, Georgia, serif;
  --font-body: 'Plus Jakarta Sans', ui-sans-serif, system-ui, -apple-system, sans-serif;

  /* Layout */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --bottom-nav-h: 76px;
}

body.light {
  color-scheme: light;
  --bg: #fbf6f0;
  --bg-2: #f5ede2;
  --bg-3: #efe4d5;
  --panel: rgba(255, 252, 247, 0.86);
  --panel-solid: #fffdf9;
  --panel-2: #f9f1e5;
  --line: rgba(60, 30, 10, 0.10);
  --line-strong: rgba(60, 30, 10, 0.18);
  --text: #2b1c12;
  --text-2: #4a3525;
  --muted: #826b58;
  --shadow-sm: 0 4px 14px rgba(80, 40, 10, 0.06);
  --shadow: 0 14px 44px rgba(80, 40, 10, 0.10);
  --shadow-lg: 0 26px 70px rgba(80, 40, 10, 0.14);
  --shadow-brand: 0 14px 36px rgba(255, 106, 61, 0.18);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-body);
  font-feature-settings: 'ss01', 'cv11';
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -0.005em;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, var(--brand-soft), transparent 70%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(255, 61, 106, 0.08), transparent 60%),
    radial-gradient(ellipse 60% 50% at 0% 100%, rgba(255, 181, 71, 0.06), transparent 60%);
  background-attachment: fixed;
  overflow-x: hidden;
}

/* Subtle noise overlay for warmth */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1  0 0 0 0 0.6  0 0 0 0 0.3  0 0 0 0.04 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

/* Headings — Fraunces display */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0;
}

h1 { font-size: clamp(28px, 6vw, 44px); font-weight: 700; }
h2 { font-size: clamp(20px, 3.5vw, 26px); }
h3 { font-size: 17px; }

p { margin: 0 0 8px; }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* App shell */
.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
  min-height: 100dvh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  padding: 22px 16px;
  border-right: 1px solid var(--line);
  background: rgba(18, 14, 12, 0.55);
  backdrop-filter: blur(28px) saturate(140%);
  -webkit-backdrop-filter: blur(28px) saturate(140%);
}
body.light .sidebar { background: rgba(255, 252, 247, 0.62); }

.brand {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 28px;
  padding: 4px 6px;
}

.brand-mark {
  width: 46px; height: 46px;
  border-radius: 14px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.02em;
  box-shadow: var(--shadow-brand);
}

.brand strong {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.02em;
}

.brand span { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; }

.nav { display: grid; gap: 4px; }

.nav-btn {
  width: 100%;
  border: 0;
  color: var(--muted);
  background: transparent;
  padding: 11px 12px;
  border-radius: 12px;
  display: flex; align-items: center; gap: 12px;
  text-align: left;
  font-weight: 500;
  font-size: 14px;
  transition: background .18s ease, color .18s ease, transform .12s ease;
}
.nav-btn:hover {
  color: var(--text);
  background: var(--panel-2);
}
.nav-btn.active {
  color: var(--text);
  background: var(--brand-soft);
  box-shadow: inset 0 0 0 1px var(--brand-glow);
}

.nav-ico {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  flex-shrink: 0;
  color: currentColor;
}
.nav-ico svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-btn.active .nav-ico { color: var(--brand); }

.main {
  padding: 22px 26px calc(88px + var(--safe-bottom));
  min-width: 0;
}

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 22px;
}

.topbar h1 { margin: 0; }

.eyebrow {
  margin: 0 0 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  color: var(--muted);
}

/* Buttons & controls */
.btn, .ghost-btn, .danger-btn, .icon-btn, .theme-toggle {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 16px;
  color: var(--text);
  background: var(--panel);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.005em;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
  min-height: 44px;
}

.btn {
  border: 0;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #fff;
  font-weight: 700;
  box-shadow: var(--shadow-brand);
}
.btn:hover, .btn:focus-visible { transform: translateY(-1px); box-shadow: 0 18px 46px rgba(255, 106, 61, 0.32); }
.btn:active { transform: translateY(0); }

.ghost-btn:hover { background: var(--panel-2); border-color: var(--line-strong); transform: translateY(-1px); }
.ghost-btn:active { transform: translateY(0); }

.danger-btn {
  border-color: rgba(255, 93, 108, 0.3);
  color: var(--danger);
  background: rgba(255, 93, 108, 0.08);
}
.danger-btn:hover { background: rgba(255, 93, 108, 0.14); }

.icon-btn {
  width: 44px; height: 44px;
  padding: 0;
  display: grid; place-items: center;
}
.icon-btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.theme-toggle { font-size: 13px; padding: 9px 14px; min-height: 40px; }

/* Views with smooth enter */
.view { display: none; animation: lift .32s cubic-bezier(0.2, 0.7, 0.25, 1) both; }
.view.active { display: block; }

@keyframes lift {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* Grid */
.grid { display: grid; gap: 14px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* Cards */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
}
.card.compact { padding: 14px; }
.card h2, .card h3 { margin: 0 0 12px; }

/* Hero */
.hero-card {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 22px;
  align-items: center;
  background:
    radial-gradient(ellipse 70% 100% at 0% 0%, var(--brand-soft), transparent 60%),
    var(--panel);
  border: 1px solid var(--line-strong);
}

.big-number {
  font-family: var(--font-display);
  font-size: clamp(44px, 9vw, 76px);
  line-height: 0.95;
  font-weight: 700;
  letter-spacing: -0.035em;
  margin: 12px 0 14px;
  background: linear-gradient(135deg, var(--text) 0%, var(--brand) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.big-number .muted {
  font-family: var(--font-body);
  font-size: 0.4em;
  font-weight: 500;
  -webkit-text-fill-color: var(--muted);
  letter-spacing: 0;
}

/* Stats */
.stat {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.025);
  transition: border-color .18s ease;
}
body.light .stat { background: rgba(0, 0, 0, 0.02); }
.stat:hover { border-color: var(--line-strong); }
.stat strong {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* Progress */
.progress {
  height: 10px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
body.light .progress { background: rgba(0, 0, 0, 0.06); }
.progress > span {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  border-radius: inherit;
  transition: width .5s cubic-bezier(0.2, 0.7, 0.25, 1);
  box-shadow: 0 0 16px var(--brand-glow);
}

/* Quick actions */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 18px;
}
.quick-actions button {
  min-height: 64px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -0.005em;
  padding: 8px 6px;
  border-radius: var(--r-sm);
}
.quick-actions button svg { width: 22px; height: 22px; stroke: var(--brand); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.quick-actions button:hover { border-color: var(--brand-glow); transform: translateY(-2px); }

/* Bars chart */
.bars { display: flex; align-items: end; gap: 8px; height: 170px; padding-top: 14px; }
.bar-wrap { flex: 1; min-width: 0; display: grid; gap: 6px; text-align: center; color: var(--muted); font-size: 11px; font-weight: 500; }
.bar { height: 124px; display: flex; align-items: end; background: rgba(255, 255, 255, 0.04); border-radius: 999px; overflow: hidden; }
body.light .bar { background: rgba(0, 0, 0, 0.04); }
.bar span {
  width: 100%; min-height: 4px;
  background: linear-gradient(180deg, var(--brand-2), var(--brand));
  border-radius: inherit;
  transition: height .6s cubic-bezier(0.2, 0.7, 0.25, 1);
}

/* Calendar */
.mini-cal, .calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}
.day, .weekday {
  min-height: 76px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 8px;
  background: rgba(255, 255, 255, 0.025);
  text-align: left;
  color: var(--text);
  cursor: pointer;
  transition: transform .12s ease, border-color .18s ease;
}
body.light .day { background: rgba(0, 0, 0, 0.018); }
.day:hover { transform: translateY(-1px); border-color: var(--line-strong); }
.weekday { min-height: auto; text-align: center; color: var(--muted); background: transparent; border: 0; cursor: default; font-weight: 600; font-size: 12px; padding: 4px 0; }
.day.empty { opacity: 0.32; cursor: default; }
.day.empty:hover { transform: none; }
.day.low    { border-color: rgba(74, 210, 149, 0.4);  background: rgba(74, 210, 149, 0.06); }
.day.near   { border-color: rgba(255, 106, 61, 0.45); background: rgba(255, 106, 61, 0.10); }
.day.high   { border-color: rgba(255, 181, 71, 0.45); background: rgba(255, 181, 71, 0.10); }
.day strong { font-family: var(--font-display); font-size: 16px; font-weight: 600; }
.day small { display: block; color: var(--muted); margin-top: 6px; font-size: 11px; font-weight: 500; }

/* Form */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field { display: grid; gap: 6px; }
.field.full { grid-column: 1 / -1; }
label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
  font-size: 15px;
  font-weight: 500;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
  min-height: 46px;
}
body.light input, body.light select, body.light textarea { background: rgba(0, 0, 0, 0.02); }
textarea { min-height: 90px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
  background: rgba(255, 106, 61, 0.04);
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 0.7; }
input[disabled] { opacity: 0.7; }

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23a89789' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}

.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; }

/* Lists & rows */
.list { display: grid; gap: 8px; }
.list-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.022);
  transition: border-color .18s ease, transform .12s ease;
}
body.light .list-row { background: rgba(0, 0, 0, 0.015); }
.list-row:hover { border-color: var(--line-strong); }
.list-row strong { font-family: var(--font-display); font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.005em;
  background: rgba(255, 255, 255, 0.02);
}
body.light .pill { background: rgba(0, 0, 0, 0.025); }

.tag-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }

/* Filters */
.filters {
  display: grid;
  grid-template-columns: 1.3fr repeat(3, minmax(140px, 0.7fr));
  gap: 10px;
  margin-bottom: 16px;
}

/* Catalog */
.catalog {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.catalog-card {
  min-height: 230px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform .18s ease, border-color .2s ease, box-shadow .25s ease;
}
.catalog-card:hover {
  transform: translateY(-3px);
  border-color: var(--brand-glow);
  box-shadow: var(--shadow-lg);
}
.catalog-card h3 { font-size: 16px; }

/* Photo / camera */
.photo-preview {
  width: 100%;
  min-height: 240px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-md);
  display: grid; place-items: center;
  overflow: hidden;
  background:
    radial-gradient(ellipse 60% 50% at 50% 50%, var(--brand-soft), transparent 70%),
    rgba(255, 255, 255, 0.02);
}
.photo-preview img { width: 100%; height: 100%; max-height: 360px; object-fit: cover; display: block; }

.camera-box {
  min-height: 220px;
  display: grid; place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-md);
  overflow: hidden;
  background: rgba(0, 0, 0, 0.18);
}
video { width: 100%; max-height: 320px; object-fit: cover; }

/* Notice / loader */
.notice {
  border-left: 4px solid var(--brand);
  padding: 13px 16px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
}

.loader {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2.5px solid rgba(255, 106, 61, 0.18);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -3px;
  margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Modal */
.modal-root {
  position: fixed; inset: 0;
  z-index: 80;
  display: grid; place-items: center;
  background: rgba(10, 6, 4, 0.62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 18px;
  animation: fadeIn .2s ease both;
}
.modal-root[hidden] { display: none; }
.modal {
  width: min(760px, 100%);
  max-height: 88vh;
  overflow: auto;
  background: var(--panel-solid);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--shadow-lg);
  animation: modalIn .26s cubic-bezier(0.2, 0.7, 0.25, 1) both;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.modal-head strong { font-family: var(--font-display); font-size: 17px; font-weight: 600; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

/* Toasts */
.toast-stack {
  position: fixed;
  right: 16px;
  bottom: calc(16px + var(--safe-bottom));
  z-index: 100;
  display: grid; gap: 10px;
}
.toast {
  padding: 13px 16px;
  border-radius: var(--r-sm);
  background: var(--panel-solid);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-lg);
  max-width: 340px;
  font-size: 14px;
  font-weight: 500;
  animation: toastIn .3s cubic-bezier(0.2, 0.7, 0.25, 1) both;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

/* Mobile only / drawer */
.bottom-nav, .mobile-drawer, .mobile-only { display: none; }

.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.drawer-head strong { font-family: var(--font-display); font-size: 18px; font-weight: 700; }

.empty {
  padding: 28px 22px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: var(--r-md);
  font-size: 14px;
}

.two-pane { display: grid; grid-template-columns: 1fr 360px; gap: 16px; }
.danger-zone { border-color: rgba(255, 93, 108, 0.28); }

/* ============== MOBILE ============== */
@media (max-width: 1080px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main {
    padding: 12px 14px calc(var(--bottom-nav-h) + var(--safe-bottom) + 18px);
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    margin: -12px -14px 18px;
    padding: calc(12px + var(--safe-top)) 14px 12px;
    background: rgba(18, 14, 12, 0.78);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
  }
  body.light .topbar { background: rgba(251, 246, 240, 0.86); }
  .topbar h1 { font-size: 24px; }
  .eyebrow { font-size: 10px; }

  .mobile-only { display: grid; }

  .bottom-nav {
    position: fixed;
    left: 8px; right: 8px;
    bottom: calc(8px + var(--safe-bottom));
    z-index: 50;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    padding: 7px;
    background: rgba(26, 20, 16, 0.82);
    border: 1px solid var(--line-strong);
    border-radius: 22px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(28px) saturate(140%);
    -webkit-backdrop-filter: blur(28px) saturate(140%);
  }
  body.light .bottom-nav { background: rgba(255, 252, 247, 0.88); }

  .bottom-nav .nav-btn {
    justify-content: center;
    padding: 8px 4px;
    font-size: 10px;
    font-weight: 600;
    flex-direction: column;
    gap: 3px;
    border-radius: 14px;
    min-height: 56px;
  }
  .bottom-nav .nav-ico svg { width: 22px; height: 22px; }
  .bottom-nav .nav-btn span:last-child {
    max-width: 100%;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    letter-spacing: -0.01em;
  }
  .bottom-nav .nav-btn.active {
    background: var(--brand-soft);
    color: var(--brand);
    box-shadow: inset 0 0 0 1px var(--brand-glow);
  }
  .bottom-nav .nav-btn.active .nav-ico { color: var(--brand); }

  .mobile-drawer {
    position: fixed; inset: 0;
    z-index: 70;
    background: rgba(10, 6, 4, 0.6);
    backdrop-filter: blur(8px);
    padding: 14px;
  }
  .mobile-drawer.open { display: block; animation: fadeIn .2s ease both; }
  .drawer-panel {
    width: min(340px, 92vw);
    height: 100%;
    background: var(--panel-solid);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-lg);
    padding: 18px;
    box-shadow: var(--shadow-lg);
    overflow: auto;
    animation: drawerIn .28s cubic-bezier(0.2, 0.7, 0.25, 1) both;
  }
  @keyframes drawerIn {
    from { opacity: 0; transform: translateX(-30px); }
    to   { opacity: 1; transform: none; }
  }

  .hero-card, .two-pane { grid-template-columns: 1fr; }
  .grid.cols-3, .grid.cols-4, .quick-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 680px) {
  .topbar { align-items: flex-start; }
  .topbar h1 { font-size: 22px; }
  .eyebrow { font-size: 10px; }

  .grid.cols-2, .grid.cols-3, .grid.cols-4, .form-grid, .filters { grid-template-columns: 1fr; }
  .quick-actions { grid-template-columns: 1fr 1fr; }
  .quick-actions button { min-height: 60px; }

  .card { padding: 16px; border-radius: var(--r-sm); }
  .hero-card { gap: 16px; padding: 18px; }

  .day { min-height: 64px; padding: 6px; font-size: 12px; }
  .day strong { font-size: 14px; }
  .day small { font-size: 10px; }

  .list-row { grid-template-columns: 1fr; gap: 8px; }
  .list-row .actions { margin-top: 4px; }

  .bars { gap: 5px; }
  .bar-wrap { font-size: 10px; }

  .modal { padding: 18px; border-radius: var(--r-md); }
  .toast { max-width: calc(100vw - 32px); }

  /* Avoid iOS zoom on focus */
  input, select, textarea { font-size: 16px; }
}

/* Reduced motion respect */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
