
:root {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Segoe UI', system-ui, sans-serif;
  color: #17322b;
  background: #f4f7f5;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --green-950: #0d3c31;
  --green-800: #145642;
  --green-700: #176b55;
  --green-600: #208267;
  --green-100: #dff3eb;
  --green-50: #eff9f5;
  --cream: #fbfaf6;
  --ink: #17322b;
  --muted: #6f827b;
  --line: #dce5e1;
  --danger: #a93b3b;
  --danger-bg: #fff0ef;
  --warning: #986818;
  --warning-bg: #fff8e8;
  --blue: #2c6894;
  --blue-bg: #edf6fc;
  --card: #ffffff;
  --shadow: 0 12px 36px rgba(20, 55, 45, 0.08);
  --shadow-soft: 0 4px 16px rgba(20, 55, 45, 0.07);
  --radius-xl: 26px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --tap: 48px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: #f4f7f5; }
html.large-text { font-size: 18px; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: linear-gradient(145deg, #f7faf8 0%, #eef5f1 100%); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
svg { display: block; }

.skip-link { position: fixed; top: -80px; left: 16px; z-index: 999; padding: 12px 16px; background: var(--green-950); color: white; border-radius: 10px; }
.skip-link:focus { top: 16px; }

.app-loading { min-height: 100vh; display: grid; place-items: center; color: var(--muted); }
.spinner { width: 32px; height: 32px; border: 3px solid var(--green-100); border-top-color: var(--green-700); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.auth-page { min-height: 100vh; padding: 28px 18px; display: grid; place-items: center; position: relative; overflow: hidden; }
.auth-page::before, .auth-page::after { content: ''; position: fixed; border-radius: 50%; filter: blur(2px); pointer-events: none; }
.auth-page::before { width: 420px; height: 420px; top: -160px; right: -120px; background: rgba(32, 130, 103, .14); }
.auth-page::after { width: 360px; height: 360px; bottom: -180px; left: -100px; background: rgba(234, 182, 69, .13); }
.auth-shell { width: min(1050px, 100%); display: grid; grid-template-columns: 1.05fr .95fr; background: rgba(255,255,255,.88); backdrop-filter: blur(18px); border: 1px solid rgba(255,255,255,.8); border-radius: 32px; overflow: hidden; box-shadow: 0 30px 80px rgba(21,72,58,.14); position: relative; z-index: 1; }
.auth-brand { background: linear-gradient(150deg, var(--green-950), var(--green-700)); color: white; padding: clamp(32px, 6vw, 72px); min-height: 660px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-brand::after { content: ''; width: 320px; height: 320px; border: 1px solid rgba(255,255,255,.17); border-radius: 50%; position: absolute; right: -130px; bottom: -80px; box-shadow: 0 0 0 52px rgba(255,255,255,.04), 0 0 0 104px rgba(255,255,255,.025); }
.logo-lockup { display: flex; align-items: center; gap: 14px; font-size: 1.35rem; font-weight: 800; letter-spacing: -.03em; }
.logo-mark { width: 48px; height: 48px; display: grid; place-items: center; background: #fff; color: var(--green-700); border-radius: 16px; box-shadow: 0 10px 24px rgba(0,0,0,.12); }
.brand-copy { max-width: 520px; position: relative; z-index: 1; }
.brand-copy h1 { font-size: clamp(2.7rem, 5vw, 4.9rem); line-height: .98; letter-spacing: -.065em; margin: 0 0 22px; }
.brand-copy p { font-size: 1.12rem; line-height: 1.65; color: rgba(255,255,255,.78); margin: 0; max-width: 470px; }
.brand-points { display: grid; gap: 14px; margin-top: 34px; }
.brand-point { display: flex; align-items: center; gap: 12px; font-weight: 600; color: rgba(255,255,255,.9); }
.brand-point span:first-child { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: rgba(255,255,255,.12); }
.auth-panel { padding: clamp(28px, 5vw, 58px); display: flex; flex-direction: column; justify-content: center; background: rgba(255,255,255,.95); }
.auth-panel h2 { font-size: 2rem; letter-spacing: -.045em; margin: 0 0 8px; }
.auth-panel > p { color: var(--muted); margin: 0 0 28px; line-height: 1.55; }
.tab-switch { display: grid; grid-template-columns: 1fr 1fr; padding: 5px; border-radius: 14px; background: #eef3f0; margin-bottom: 24px; }
.tab-switch button { border: 0; min-height: 44px; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 700; }
.tab-switch button.active { background: white; color: var(--green-800); box-shadow: var(--shadow-soft); }
.form-grid { display: grid; gap: 17px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: grid; gap: 8px; }
.field label { font-size: .88rem; font-weight: 700; color: #38564c; }
.field input, .field select, .field textarea { width: 100%; min-height: var(--tap); padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 13px; background: white; color: var(--ink); outline: none; transition: .18s ease; }
.field textarea { min-height: 88px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--green-600); box-shadow: 0 0 0 4px rgba(32,130,103,.11); }
.field-help { font-size: .78rem; color: var(--muted); line-height: 1.4; }
.username-preview { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 13px; background: var(--green-50); border: 1px solid var(--green-100); color: var(--green-800); }
.username-preview strong { overflow-wrap: anywhere; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 50px; }
.password-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; display: grid; place-items: center; border: 0; background: transparent; color: var(--muted); border-radius: 10px; }

.btn { min-height: var(--tap); border: 0; border-radius: 13px; padding: 11px 17px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; font-weight: 750; transition: transform .16s ease, box-shadow .16s ease, background .16s ease; text-decoration: none; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--green-700); color: white; box-shadow: 0 8px 20px rgba(23,107,85,.2); }
.btn-primary:hover { background: var(--green-800); }
.btn-secondary { background: var(--green-50); color: var(--green-800); border: 1px solid var(--green-100); }
.btn-neutral { background: #f1f4f2; color: #375148; }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-danger { background: var(--danger-bg); color: var(--danger); }
.btn-full { width: 100%; }
.btn-small { min-height: 40px; padding: 8px 12px; border-radius: 11px; font-size: .88rem; }
.icon-btn { width: var(--tap); height: var(--tap); padding: 0; border: 0; border-radius: 14px; display: grid; place-items: center; background: white; color: var(--ink); box-shadow: var(--shadow-soft); }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 250px; background: #172554; color: white; padding: 24px 18px; display: flex; flex-direction: column; z-index: 30; }
.sidebar .logo-lockup { padding: 4px 8px 28px; }
.sidebar .logo-mark { width: 42px; height: 42px; border-radius: 14px; }
.nav-label { padding: 14px 12px 8px; text-transform: uppercase; font-size: .7rem; letter-spacing: .12em; color: rgba(255,255,255,.42); font-weight: 800; }
.nav-list { display: grid; gap: 5px; }
.nav-button { width: 100%; min-height: 48px; border: 0; border-radius: 13px; padding: 10px 13px; display: flex; align-items: center; gap: 12px; background: transparent; color: rgba(255,255,255,.67); font-weight: 650; text-align: left; }
.nav-button:hover, .nav-button.active { color: white; background: rgba(255,255,255,.1); }
.nav-button.active { box-shadow: inset 3px 0 0 #6ed4ac; }
.nav-badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center; background: #f0ba56; color: #3e3015; font-size: .72rem; font-weight: 800; }
.sidebar-footer { margin-top: auto; display: grid; gap: 10px; }
.mode-pill { display: flex; align-items: center; gap: 9px; padding: 11px 12px; border-radius: 12px; background: rgba(255,255,255,.07); color: rgba(255,255,255,.65); font-size: .74rem; line-height: 1.35; }
.mode-dot { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: #67d2a7; box-shadow: 0 0 0 4px rgba(103,210,167,.12); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; background: rgba(255,255,255,.08); }
.avatar { width: 42px; height: 42px; flex: 0 0 auto; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(145deg, #f1be64, #f8df9d); color: #5f481f; font-weight: 800; }
.avatar.small { width: 34px; height: 34px; border-radius: 11px; font-size: .78rem; }
.user-chip-copy { min-width: 0; }
.user-chip-copy strong, .user-chip-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip-copy strong { font-size: .84rem; }
.user-chip-copy span { font-size: .7rem; color: rgba(255,255,255,.55); margin-top: 2px; }
.user-chip .btn { margin-left: auto; color: rgba(255,255,255,.65); }

.main { grid-column: 2; min-width: 0; padding: 0 34px 40px; }
.topbar { min-height: 86px; display: flex; align-items: center; justify-content: space-between; gap: 18px; position: sticky; top: 0; z-index: 20; background: rgba(244,247,245,.84); backdrop-filter: blur(16px); }
.topbar-title { min-width: 0; }
.topbar-title h1 { margin: 0; font-size: clamp(1.45rem, 2.8vw, 2rem); letter-spacing: -.045em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-title p { margin: 5px 0 0; color: var(--muted); font-size: .86rem; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.notification-button { position: relative; }
.notification-dot { position: absolute; right: 8px; top: 8px; width: 10px; height: 10px; border-radius: 50%; background: #d95c4f; border: 2px solid white; }
.page { max-width: 1260px; margin: 0 auto; animation: pageIn .2s ease; }
@keyframes pageIn { from { opacity: .3; transform: translateY(6px); } }

.hero { padding: clamp(24px, 4vw, 42px); border-radius: var(--radius-xl); background: linear-gradient(135deg, #145642, #208267); color: white; box-shadow: 0 22px 50px rgba(20,86,66,.18); display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 28px; position: relative; overflow: hidden; }
.hero::after { content: ''; width: 260px; height: 260px; border-radius: 50%; position: absolute; right: -75px; top: -90px; border: 38px solid rgba(255,255,255,.07); box-shadow: 0 0 0 45px rgba(255,255,255,.035); }
.hero-copy { position: relative; z-index: 1; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 13px; color: rgba(255,255,255,.72); font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.hero h2 { margin: 0; max-width: 700px; font-size: clamp(2rem, 4vw, 3.55rem); line-height: 1.04; letter-spacing: -.06em; }
.hero p { margin: 14px 0 0; color: rgba(255,255,255,.74); max-width: 650px; line-height: 1.6; }
.hero-actions { display: flex; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
.hero .btn-primary { background: white; color: var(--green-800); box-shadow: 0 10px 24px rgba(0,0,0,.13); }
.hero .btn-secondary { background: rgba(255,255,255,.12); color: white; border-color: rgba(255,255,255,.18); }
.hero-art { width: 150px; height: 150px; border-radius: 38px; display: grid; place-items: center; background: rgba(255,255,255,.11); border: 1px solid rgba(255,255,255,.14); position: relative; z-index: 1; }
.hero-art span { font-size: 4.5rem; filter: drop-shadow(0 12px 14px rgba(0,0,0,.15)); }

.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 20px 0 28px; }
.stat-card { background: var(--card); border: 1px solid rgba(215,227,221,.86); border-radius: var(--radius-lg); padding: 19px; display: flex; gap: 14px; align-items: center; box-shadow: var(--shadow-soft); }
.stat-icon { width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; background: var(--green-50); color: var(--green-700); }
.stat-card:nth-child(2) .stat-icon { background: var(--warning-bg); color: var(--warning); }
.stat-card:nth-child(3) .stat-icon { background: var(--blue-bg); color: var(--blue); }
.stat-copy strong { display: block; font-size: 1.55rem; letter-spacing: -.04em; }
.stat-copy span { display: block; color: var(--muted); font-size: .8rem; margin-top: 3px; }

.section { margin-top: 28px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.section-head h2 { margin: 0; font-size: 1.35rem; letter-spacing: -.04em; }
.section-head p { margin: 5px 0 0; color: var(--muted); font-size: .84rem; }
.link-button { border: 0; background: transparent; color: var(--green-700); font-weight: 750; display: inline-flex; gap: 6px; align-items: center; padding: 8px 0; }

.lists-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.list-card { min-width: 0; background: var(--card); border: 1px solid rgba(215,227,221,.9); border-radius: var(--radius-lg); padding: 19px; box-shadow: var(--shadow-soft); transition: transform .18s ease, box-shadow .18s ease; }
.list-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.list-card-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.list-emoji { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 15px; background: #eff7f3; font-size: 1.5rem; }
.list-card h3 { margin: 16px 0 4px; font-size: 1.05rem; letter-spacing: -.025em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-meta { color: var(--muted); font-size: .78rem; display: flex; align-items: center; gap: 8px; }
.progress-bar { height: 7px; background: #edf1ef; border-radius: 99px; overflow: hidden; margin: 17px 0 12px; }
.progress-bar span { display: block; height: 100%; background: var(--green-600); border-radius: inherit; }
.list-card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mini-avatars { display: flex; }
.mini-avatar { width: 28px; height: 28px; margin-left: -7px; border-radius: 9px; display: grid; place-items: center; background: #e9efeC; border: 2px solid white; font-size: .65rem; font-weight: 800; }
.mini-avatar:first-child { margin-left: 0; }
.empty-card { border: 1.5px dashed #cddad4; border-radius: var(--radius-lg); padding: 30px; text-align: center; background: rgba(255,255,255,.54); color: var(--muted); }
.empty-card .empty-icon { width: 60px; height: 60px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 20px; background: var(--green-50); color: var(--green-700); }
.empty-card h3 { color: var(--ink); margin: 0 0 7px; }
.empty-card p { max-width: 430px; margin: 0 auto 18px; line-height: 1.55; }

.quick-products { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 10px; scrollbar-width: thin; }
.quick-product { flex: 0 0 auto; min-width: 150px; padding: 13px; border: 1px solid var(--line); border-radius: 16px; background: white; box-shadow: var(--shadow-soft); text-align: left; }
.quick-product span { font-size: 1.4rem; }
.quick-product strong { display: block; margin-top: 8px; font-size: .88rem; }
.quick-product small { color: var(--muted); }

.list-page-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.back-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.back-title h2 { margin: 0; font-size: clamp(1.55rem, 3vw, 2.35rem); letter-spacing: -.05em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.back-title p { color: var(--muted); margin: 4px 0 0; font-size: .82rem; }
.list-page-actions { display: flex; gap: 9px; }

.add-item-card { background: white; border: 1px solid var(--line); border-radius: var(--radius-xl); padding: 20px; box-shadow: var(--shadow-soft); margin-bottom: 20px; }
.add-item-title { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.add-item-title span { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--green-50); color: var(--green-700); }
.add-item-title h3 { margin: 0; font-size: 1rem; }
.add-grid { display: grid; grid-template-columns: minmax(180px, 1.7fr) 100px minmax(140px, .8fr) auto; gap: 11px; align-items: end; }
.add-grid .btn { min-width: 122px; }

.filter-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 20px 0 12px; }
.segmented { display: inline-flex; padding: 4px; border-radius: 13px; background: #e9efec; }
.segmented button { border: 0; min-height: 38px; border-radius: 10px; padding: 7px 13px; background: transparent; color: var(--muted); font-size: .82rem; font-weight: 750; }
.segmented button.active { background: white; color: var(--ink); box-shadow: var(--shadow-soft); }
.item-count { color: var(--muted); font-size: .82rem; }

.items-list { display: grid; gap: 10px; }
.item-card { background: white; border: 1px solid var(--line); border-radius: 18px; padding: 14px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; box-shadow: 0 3px 10px rgba(20,55,45,.045); }
.item-card.purchased { border-color: #d7e7f3; background: linear-gradient(90deg, #fff, #f6fbfe); }
.item-card.completed { opacity: .82; background: #fafbfa; }
.product-icon { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 16px; background: #f2f6f4; font-size: 1.55rem; }
.item-main { min-width: 0; }
.item-title-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.item-main h3 { margin: 0; font-size: .98rem; letter-spacing: -.018em; }
.quantity-pill { padding: 4px 8px; border-radius: 99px; background: var(--green-50); color: var(--green-800); font-size: .72rem; font-weight: 800; }
.status-pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 99px; font-size: .7rem; font-weight: 800; }
.status-pill.purchased { background: var(--blue-bg); color: var(--blue); }
.status-pill.completed { background: #edf0ef; color: #68766f; }
.item-sub { margin-top: 6px; color: var(--muted); font-size: .76rem; display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }
.item-sub .owner { color: #45645a; font-weight: 650; }
.item-note { margin-top: 7px; font-size: .78rem; color: #4f665e; }
.item-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.item-menu { position: relative; }
.menu-popover { position: absolute; right: 0; top: calc(100% + 7px); z-index: 40; width: 190px; padding: 7px; border-radius: 14px; background: white; border: 1px solid var(--line); box-shadow: var(--shadow); display: grid; }
.menu-popover button { border: 0; background: transparent; padding: 10px 11px; border-radius: 9px; display: flex; gap: 9px; align-items: center; color: var(--ink); text-align: left; font-size: .82rem; }
.menu-popover button:hover { background: #f2f5f3; }
.menu-popover button.danger { color: var(--danger); }

.history-group { margin-bottom: 24px; }
.history-group h3 { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; margin: 0 0 9px; }

.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 15px; background: var(--warning-bg); color: #76571e; border: 1px solid #f2e4bf; line-height: 1.5; font-size: .82rem; }
.notice.info { background: var(--blue-bg); color: #315d7d; border-color: #d4e7f5; }

.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.settings-card { background: white; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-soft); }
.settings-card h3 { margin: 0 0 6px; }
.settings-card > p { margin: 0 0 18px; color: var(--muted); line-height: 1.5; font-size: .83rem; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 0; border-top: 1px solid #edf1ef; }
.setting-row:first-of-type { border-top: 0; }
.setting-row-copy strong, .setting-row-copy span { display: block; }
.setting-row-copy strong { font-size: .88rem; }
.setting-row-copy span { color: var(--muted); font-size: .75rem; margin-top: 3px; }
.toggle { position: relative; width: 50px; height: 29px; border: 0; border-radius: 99px; padding: 3px; background: #dbe3df; transition: .2s; }
.toggle span { display: block; width: 23px; height: 23px; border-radius: 50%; background: white; box-shadow: 0 2px 6px rgba(0,0,0,.16); transition: transform .2s; }
.toggle.on { background: var(--green-600); }
.toggle.on span { transform: translateX(21px); }

.notification-list { display: grid; gap: 10px; }
.notification-card { display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 15px; border: 1px solid var(--line); background: white; border-radius: 17px; box-shadow: var(--shadow-soft); }
.notification-card.unread { border-color: #bcd9cc; background: var(--green-50); }
.notification-icon { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: white; color: var(--green-700); }
.notification-card h3 { margin: 0 0 4px; font-size: .9rem; }
.notification-card p { margin: 0; color: var(--muted); font-size: .8rem; line-height: 1.5; }
.notification-card time { display: block; margin-top: 7px; color: #94a29d; font-size: .7rem; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(11,31,26,.55); backdrop-filter: blur(5px); display: grid; place-items: center; padding: 18px; animation: fadeIn .16s ease; }
@keyframes fadeIn { from { opacity: 0; } }
.modal { width: min(520px, 100%); max-height: min(780px, 92vh); overflow-y: auto; background: white; border-radius: 25px; padding: 22px; box-shadow: 0 32px 80px rgba(0,0,0,.23); animation: modalIn .18s ease; }
@keyframes modalIn { from { transform: translateY(10px) scale(.98); opacity: .4; } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.modal-head h2 { margin: 0; font-size: 1.32rem; letter-spacing: -.035em; }
.modal-head p { margin: 5px 0 0; color: var(--muted); font-size: .8rem; line-height: 1.45; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; }
.share-link-box { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.share-link-box input { min-width: 0; }
.share-code { margin-top: 13px; text-align: center; padding: 17px; border-radius: 16px; background: var(--green-50); border: 1px dashed #9bcab8; }
.share-code small { display: block; color: var(--muted); margin-bottom: 4px; }
.share-code strong { font-size: 1.55rem; letter-spacing: .18em; color: var(--green-800); }

.toast-stack { position: fixed; right: 22px; bottom: 22px; z-index: 200; display: grid; gap: 9px; width: min(390px, calc(100vw - 36px)); }
.toast { display: flex; align-items: center; gap: 11px; padding: 13px 14px; background: #163b31; color: white; border-radius: 15px; box-shadow: 0 16px 40px rgba(0,0,0,.22); animation: toastIn .22s ease; }
@keyframes toastIn { from { transform: translateY(12px); opacity: 0; } }
.toast.error { background: #7c3131; }
.toast-copy { flex: 1; font-size: .82rem; line-height: 1.4; }
.toast button { border: 0; background: rgba(255,255,255,.14); color: white; border-radius: 9px; padding: 8px 10px; font-weight: 700; }

.mobile-nav { display: none; }
.mobile-only { display: none; }

@media (max-width: 1100px) {
  .lists-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .hero-art { display: none; }
  .add-grid { grid-template-columns: minmax(180px,1.5fr) 90px minmax(130px,.8fr); }
  .add-grid .btn { grid-column: 1 / -1; }
}

@media (max-width: 820px) {
  :root { --radius-xl: 22px; --tap: 50px; }
  .auth-shell { grid-template-columns: 1fr; max-width: 570px; }
  .auth-brand { min-height: auto; padding: 28px; }
  .auth-brand .brand-copy { margin-top: 56px; }
  .auth-brand .brand-points { display: none; }
  .brand-copy h1 { font-size: 2.8rem; }
  .brand-copy p { font-size: .98rem; }
  .auth-panel { padding: 30px 26px; }
  .app-shell { display: block; }
  .sidebar { display: none; }
  .main { padding: 0 18px 100px; }
  .topbar { min-height: 72px; }
  .desktop-only { display: none !important; }
  .mobile-only { display: initial; }
  .mobile-nav { position: fixed; z-index: 60; left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); height: 68px; padding: 7px; display: grid; grid-template-columns: repeat(4,1fr); background: rgba(16,47,39,.96); backdrop-filter: blur(16px); border-radius: 21px; box-shadow: 0 16px 44px rgba(13,47,39,.3); }
  .mobile-nav button { border: 0; background: transparent; color: rgba(255,255,255,.58); border-radius: 15px; display: grid; place-items: center; gap: 2px; align-content: center; font-size: .62rem; font-weight: 700; }
  .mobile-nav button.active { background: rgba(255,255,255,.11); color: white; }
  .hero { grid-template-columns: 1fr; padding: 28px 22px; }
  .hero h2 { font-size: 2.35rem; }
  .hero p { font-size: .9rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat-card:nth-child(3) { grid-column: 1 / -1; }
  .settings-grid { grid-template-columns: 1fr; }
  .item-card { grid-template-columns: auto minmax(0, 1fr); }
  .item-actions { grid-column: 1 / -1; justify-content: stretch; }
  .item-actions .btn { flex: 1; }
  .list-page-head { align-items: flex-start; }
  .list-page-actions .btn span { display: none; }
}

@media (max-width: 580px) {
  .auth-page { padding: 0; display: block; }
  .auth-shell { min-height: 100vh; border-radius: 0; }
  .auth-brand { padding: 22px 20px 28px; }
  .auth-brand .brand-copy { margin-top: 38px; }
  .brand-copy h1 { font-size: 2.3rem; }
  .brand-copy p { font-size: .88rem; }
  .auth-panel { padding: 27px 20px 34px; }
  .auth-panel h2 { font-size: 1.65rem; }
  .form-row { grid-template-columns: 1fr; }
  .main { padding-inline: 13px; }
  .topbar-title p { display: none; }
  .topbar-actions { gap: 6px; }
  .icon-btn { width: 46px; height: 46px; }
  .hero { border-radius: 20px; }
  .hero h2 { font-size: 2rem; }
  .stats-grid { gap: 9px; }
  .stat-card { padding: 14px 12px; gap: 10px; }
  .stat-icon { width: 42px; height: 42px; }
  .stat-copy strong { font-size: 1.25rem; }
  .stat-copy span { font-size: .68rem; }
  .lists-grid { grid-template-columns: 1fr; }
  .section-head { align-items: flex-start; }
  .add-item-card { padding: 15px; border-radius: 20px; }
  .add-grid { grid-template-columns: 1fr 1fr; }
  .add-grid .field:first-child { grid-column: 1 / -1; }
  .add-grid .btn { grid-column: 1 / -1; }
  .filter-row { align-items: flex-start; flex-direction: column; }
  .segmented { width: 100%; }
  .segmented button { flex: 1; }
  .item-card { gap: 10px; padding: 12px; }
  .product-icon { width: 44px; height: 44px; border-radius: 14px; }
  .item-actions { gap: 6px; }
  .item-actions .btn { font-size: .77rem; padding-inline: 8px; }
  .list-page-head { gap: 10px; }
  .back-title .icon-btn { width: 42px; height: 42px; }
  .back-title h2 { font-size: 1.35rem; }
  .list-page-actions { gap: 5px; }
  .list-page-actions .btn { width: 43px; padding: 0; }
  .modal { padding: 18px; border-radius: 22px; }
  .share-link-box { grid-template-columns: 1fr; }
  .toast-stack { right: 12px; bottom: 90px; width: calc(100vw - 24px); }
}

.description-field { grid-column: 1 / -1; }
.optional { font-weight: 500; color: var(--muted); }
.item-note { margin: 3px 0 0; color: var(--muted); font-size: .9rem; line-height: 1.35; }
.person-group { margin: 18px 0 26px; }
.person-group-head { display:flex; align-items:center; gap:12px; padding:0 4px 10px; border-bottom:2px solid #DBEAFE; }
.person-group-head h3 { margin:0; font-size:1.05rem; color:#1E3A8A; }
.person-group-head p { margin:2px 0 0; color:var(--muted); font-size:.82rem; }
.person-group-items { display:grid; gap:10px; margin-top:10px; }
.avatar-small { width:38px; height:38px; font-size:.78rem; }


/* ===== MitBring blue dark refresh ===== */
:root {
  color: #e7eefc;
  background: #08111f;
  --green-950: #0a1733;
  --green-800: #1d4ed8;
  --green-700: #2563eb;
  --green-600: #3b82f6;
  --green-100: #dbeafe;
  --green-50: #eff6ff;
  --cream: #0a1324;
  --ink: #e8eefc;
  --muted: #97a9c8;
  --line: #263657;
  --danger: #f87171;
  --danger-bg: #35161d;
  --warning: #f6c453;
  --warning-bg: #342916;
  --blue: #7cc4ff;
  --blue-bg: #10243f;
  --card: #101a2c;
  --shadow: 0 20px 60px rgba(2, 6, 23, 0.45);
  --shadow-soft: 0 10px 30px rgba(2, 6, 23, 0.34);
}

html { background: #08111f; }
body {
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.16), transparent 24%),
    linear-gradient(180deg, #08111f 0%, #0b1325 100%);
}

.skip-link { background: var(--green-700); }
.spinner { border-color: rgba(96, 165, 250, 0.22); border-top-color: var(--green-600); }

.auth-page::before { background: rgba(37, 99, 235, 0.14); }
.auth-page::after { background: rgba(96, 165, 250, 0.12); }
.auth-shell {
  background: rgba(8, 15, 30, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.14);
  box-shadow: 0 30px 80px rgba(2, 6, 23, 0.52);
}
.auth-brand { background: linear-gradient(155deg, #0b1736, #2563eb); }
.auth-panel { background: rgba(7, 13, 27, 0.96); }
.logo-mark { color: var(--green-700); }
.brand-copy p { color: rgba(255, 255, 255, 0.78); }
.brand-point span:first-child { background: rgba(255,255,255,.1); }
.tab-switch { background: #0f1a33; }
.tab-switch button.active { background: #152442; color: #dbeafe; box-shadow: none; }
.field label { color: #c7d4ec; }
.field input, .field select, .field textarea {
  background: #0b1324;
  border-color: #263657;
  color: #edf3ff;
}
.field input::placeholder, .field textarea::placeholder { color: #6f84aa; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--green-600);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.18);
}
.field-help { color: #89a0c2; }
.username-preview {
  background: #0d1d38;
  border-color: #204999;
  color: #d9e6ff;
}
.password-toggle { color: #90a6c9; }

.btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: white;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.28);
}
.btn-primary:hover { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.btn-secondary {
  background: #0f1a33;
  color: #dbeafe;
  border: 1px solid #20345a;
}
.btn-neutral { background: #0f1a33; color: #dbeafe; }
.btn-ghost { color: #9ab0d2; }
.btn-danger { background: #35161d; color: #ffb4b4; }
.icon-btn {
  background: #121d35;
  color: #e7eefc;
  border: 1px solid #243454;
  box-shadow: none;
}

.sidebar {
  background: linear-gradient(180deg, #0a1530 0%, #0f1c3f 100%);
  border-right: 1px solid rgba(148, 163, 184, 0.1);
}
.nav-button:hover, .nav-button.active { background: rgba(96, 165, 250, 0.14); }
.nav-button.active { box-shadow: inset 3px 0 0 #60a5fa; }
.nav-badge { background: #17325a; color: #d8e7ff; }
.mode-pill, .user-chip { background: rgba(255,255,255,.06); }
.mode-dot { background: #60a5fa; box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.12); }
.user-chip-copy span { color: rgba(255,255,255,.65); }

.main { background: transparent; }
.topbar { background: rgba(8, 14, 28, 0.74); }
.topbar-title h1, .back-title h2, .section-head h2, .auth-panel h2, .settings-card h3, .modal-head h2, .item-main h3, .list-card h3, .empty-card h3, .notification-card h3 { color: var(--ink); }
.topbar-title p, .back-title p, .section-head p, .list-meta, .item-count, .settings-card > p, .notification-card p, .notification-card time, .empty-card, .empty-card p { color: var(--muted); }

.hero {
  background: linear-gradient(135deg, #0f2552, #2563eb);
  box-shadow: 0 22px 50px rgba(15, 37, 82, 0.4);
}
.hero::after { border-color: rgba(255,255,255,.06); box-shadow: 0 0 0 45px rgba(255,255,255,.03); }
.hero .btn-primary { color: #15377f; }
.hero .btn-secondary { border-color: rgba(255,255,255,.16); }
.hero-art { background: rgba(255,255,255,.08); }

.stat-card,
.list-card,
.add-item-card,
.settings-card,
.notification-card,
.item-card,
.quick-product,
.modal,
.menu-popover {
  background: var(--card);
  border-color: var(--line);
}
.empty-card {
  background: rgba(16, 26, 44, 0.58);
  border-color: #32466f;
  color: var(--muted);
}
.list-emoji, .product-icon, .add-item-title span, .empty-card .empty-icon, .stat-icon {
  background: #0f203f;
  color: #7cc4ff;
}
.stat-card:nth-child(2) .stat-icon { background: #332711; color: #f6c453; }
.stat-card:nth-child(3) .stat-icon { background: #0f203f; color: #7cc4ff; }
.link-button { color: #7cc4ff; }
.progress-bar { background: #17233c; }
.progress-bar span { background: var(--green-600); }
.mini-avatar { background: #162440; border-color: #0f172a; color: #dbeafe; }

.segmented { background: #0f1a33; }
.segmented button.active { background: #17253f; color: #eff6ff; box-shadow: none; }
.item-card { box-shadow: 0 3px 10px rgba(2, 6, 23, 0.25); }
.item-card.purchased { border-color: #31559b; background: linear-gradient(90deg, #101a2c, #112444); }
.item-card.completed { background: #0f1627; opacity: 0.9; }
.quantity-pill { background: #10254a; color: #dbeafe; }
.status-pill.completed { background: #182235; color: #9db0d0; }
.item-sub .owner, .item-note { color: #bfd1f5; }
.menu-popover button { color: var(--ink); }
.menu-popover button:hover { background: #111d35; }

.notice { background: #342916; color: #f5d797; border-color: #5a4317; }
.notice.info { background: #10243f; color: #b6d9ff; border-color: #274f93; }
.setting-row { border-top-color: #1e2a43; }
.toggle { background: #223654; }
.toggle.on { background: var(--green-600); }
.notification-card.unread { background: #0f203f; border-color: #31559b; }
.notification-icon { background: #121f38; color: #7cc4ff; }

.modal-backdrop { background: rgba(2, 6, 23, 0.68); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #243454; border-radius: 999px; }
::-webkit-scrollbar-track { background: transparent; }

/* =========================================================
   MitBring UI Polishing V2 — Apple-inspired blue dark system
   ========================================================= */
:root {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", Inter, "Segoe UI", sans-serif;
  --green-950: #07142f;
  --green-800: #1d4ed8;
  --green-700: #2563eb;
  --green-600: #3b82f6;
  --green-100: #193565;
  --green-50: #0e2346;
  --ink: #f3f7ff;
  --muted: #98a9c7;
  --line: rgba(148, 163, 184, 0.16);
  --card: rgba(18, 29, 51, 0.78);
  --blue: #75baff;
  --blue-bg: rgba(37, 99, 235, 0.15);
  --radius-xl: 30px;
  --radius-lg: 23px;
  --radius-md: 16px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  --shadow-soft: 0 12px 34px rgba(0, 0, 0, 0.22);
}

@supports (font: -apple-system-body) {
  :root { font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif; }
}

html { color-scheme: dark; }
body {
  letter-spacing: -0.012em;
  background:
    radial-gradient(1000px 620px at 86% -10%, rgba(43, 104, 255, 0.16), transparent 62%),
    radial-gradient(740px 520px at -6% 106%, rgba(35, 82, 180, 0.15), transparent 60%),
    #070e1d;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.012) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.012) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.34), transparent 60%);
  z-index: -1;
}
body.is-busy::before {
  content: "";
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  height: 3px;
  width: 34%;
  border-radius: 99px;
  background: linear-gradient(90deg, transparent, #60a5fa, #2563eb, transparent);
  animation: busy-track 1.05s ease-in-out infinite;
}
@keyframes busy-track { from { transform: translateX(-110%); } to { transform: translateX(400%); } }

button, input, select, textarea { letter-spacing: -0.01em; }
button { -webkit-tap-highlight-color: transparent; }

/* Loading */
.app-loading {
  background:
    radial-gradient(circle at center, rgba(37,99,235,.16), transparent 36%),
    #070e1d;
}
.launch-loader { width: min(360px, calc(100vw - 44px)); text-align: center; }
.launch-loader-mark {
  width: 76px;
  height: 76px;
  margin: 0 auto 20px;
  display: grid;
  place-items: center;
  color: white;
  border-radius: 23px;
  background: linear-gradient(145deg, #5aa2ff, #1d4ed8);
  box-shadow: 0 20px 54px rgba(37,99,235,.38), inset 0 1px rgba(255,255,255,.35);
  animation: loader-float 1.8s ease-in-out infinite;
}
.launch-loader-copy strong { display: block; font-size: 1.35rem; color: #f8fbff; }
.launch-loader-copy span { display: block; margin-top: 6px; font-size: .88rem; color: #8fa5c7; }
.launch-loader-bar { width: 180px; height: 4px; margin: 22px auto 0; overflow: hidden; border-radius: 99px; background: rgba(148,163,184,.14); }
.launch-loader-bar span { display: block; width: 48%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #60a5fa, #2563eb); animation: loader-bar 1.15s ease-in-out infinite alternate; }
@keyframes loader-float { 50% { transform: translateY(-7px) scale(1.025); } }
@keyframes loader-bar { from { transform: translateX(-10%); } to { transform: translateX(116%); } }

.page-loader-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  background: rgba(3, 8, 19, 0);
  backdrop-filter: blur(0);
  opacity: 0;
  pointer-events: none;
  transition: .18s ease;
}
.page-loader-overlay.visible { opacity: 1; background: rgba(3, 8, 19, .36); backdrop-filter: blur(8px); }
.page-loader-card {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px 18px;
  border: 1px solid rgba(148,163,184,.17);
  border-radius: 18px;
  background: rgba(15, 25, 45, .9);
  color: #eaf1ff;
  box-shadow: 0 24px 70px rgba(0,0,0,.38);
  transform: scale(.96) translateY(6px);
  transition: .18s ease;
}
.page-loader-overlay.visible .page-loader-card { transform: scale(1) translateY(0); }
.page-loader-spinner { width: 19px; height: 19px; border: 2px solid rgba(96,165,250,.22); border-top-color: #60a5fa; border-radius: 50%; animation: spin .75s linear infinite; }
.page-loader-card strong { font-size: .84rem; }

/* Auth */
.auth-page { padding: 28px; }
.auth-shell {
  width: min(1080px, 100%);
  border: 1px solid rgba(148,163,184,.15);
  border-radius: 34px;
  background: rgba(9, 16, 31, .72);
  box-shadow: 0 34px 100px rgba(0,0,0,.48);
}
.auth-brand {
  background:
    radial-gradient(circle at 92% 92%, rgba(96,165,250,.24), transparent 36%),
    linear-gradient(155deg, #081a42, #164eb7 64%, #2563eb);
}
.auth-panel { background: rgba(8, 14, 27, .9); }
.logo-mark { border-radius: 15px; box-shadow: 0 12px 34px rgba(0,0,0,.2); }
.brand-copy h1 { letter-spacing: -.072em; }
.tab-switch { padding: 4px; border: 1px solid rgba(148,163,184,.1); }
.tab-switch button { transition: .2s ease; }
.tab-switch button.active { box-shadow: inset 0 1px rgba(255,255,255,.07), 0 6px 18px rgba(0,0,0,.2); }

/* Controls */
.field input,
.field select,
.field textarea {
  border: 1px solid rgba(148,163,184,.18);
  border-radius: 14px;
  background: rgba(7, 14, 29, .72);
  box-shadow: inset 0 1px rgba(255,255,255,.025);
}
.field input:hover, .field select:hover, .field textarea:hover { border-color: rgba(125, 173, 255, .34); }
.field input:focus, .field select:focus, .field textarea:focus { background: #0a1428; }
.field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%239bb4db' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
}
.field select option { background: #101a2d; color: #eef4ff; }
.username-preview { border-radius: 14px; background: rgba(37,99,235,.13); border-color: rgba(96,165,250,.25); }

.btn { border-radius: 14px; font-weight: 700; }
.btn-primary { box-shadow: 0 12px 26px rgba(37,99,235,.26), inset 0 1px rgba(255,255,255,.22); }
.btn-secondary, .btn-neutral { box-shadow: inset 0 1px rgba(255,255,255,.04); }
.btn-neutral { border: 1px solid rgba(148,163,184,.13); }
.icon-btn { border-radius: 15px; backdrop-filter: blur(12px); }

/* App frame and sidebar */
.app-shell { grid-template-columns: 264px minmax(0, 1fr); }
.sidebar {
  width: 264px;
  padding: 22px 16px 16px;
  background: rgba(7, 16, 38, .88);
  backdrop-filter: blur(24px) saturate(135%);
  border-right: 1px solid rgba(148,163,184,.12);
  box-shadow: 18px 0 60px rgba(0,0,0,.13);
}
.sidebar .logo-lockup { padding: 5px 7px 24px; }
.nav-label { color: #61779e; }
.nav-button { border: 1px solid transparent; border-radius: 15px; }
.nav-button:hover { background: rgba(96,165,250,.08); border-color: rgba(96,165,250,.08); }
.nav-button.active {
  background: linear-gradient(135deg, rgba(37,99,235,.24), rgba(96,165,250,.11));
  border-color: rgba(96,165,250,.17);
  box-shadow: inset 3px 0 #60a5fa, 0 10px 28px rgba(0,0,0,.16);
}
.sidebar-footer { min-width: 0; width: 100%; }
.mode-pill, .user-chip {
  width: 100%;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(148,163,184,.09);
  background: rgba(255,255,255,.045);
}
.mode-pill span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip { padding: 9px; }
.user-chip-copy { flex: 1 1 auto; min-width: 0; }
.user-chip .btn { flex: 0 0 38px; width: 38px; min-width: 38px; height: 38px; min-height: 38px; padding: 0; }
.avatar { background: linear-gradient(145deg, #6daeff, #235cc8); color: white; box-shadow: inset 0 1px rgba(255,255,255,.25); }

.main { grid-column: 2; padding: 0 38px 52px; }
.topbar { min-height: 92px; background: rgba(7, 14, 29, .64); border-bottom: 1px solid rgba(148,163,184,.055); }
.page { max-width: 1280px; }

/* Dashboard */
.hero {
  border: 1px solid rgba(96,165,250,.16);
  border-radius: 30px;
  background:
    radial-gradient(circle at 92% 30%, rgba(147,197,253,.18), transparent 29%),
    linear-gradient(135deg, #0c2558, #1555c8 58%, #2563eb);
  box-shadow: 0 28px 80px rgba(5,22,58,.35), inset 0 1px rgba(255,255,255,.1);
}
.hero-art { border-radius: 36px; backdrop-filter: blur(12px); }
.stat-card, .list-card, .add-item-card, .settings-card, .notification-card, .item-card, .quick-product {
  border: 1px solid rgba(148,163,184,.13);
  background: linear-gradient(145deg, rgba(20,32,55,.88), rgba(13,22,39,.82));
  box-shadow: 0 14px 40px rgba(0,0,0,.19), inset 0 1px rgba(255,255,255,.035);
}
.stat-card { border-radius: 22px; }
.stat-icon { border-radius: 15px; }
.list-card { border-radius: 24px; }
.list-card:hover { transform: translateY(-4px); border-color: rgba(96,165,250,.28); box-shadow: 0 22px 60px rgba(0,0,0,.27); }
.list-emoji { border-radius: 16px; }
.link-button { color: #8ec5ff; }
.empty-card { border-radius: 25px; }

/* Quick add */
.quick-products { gap: 12px; padding-bottom: 14px; }
.quick-product {
  position: relative;
  min-width: 205px;
  min-height: 96px;
  padding: 14px;
  display: grid;
  grid-template-columns: 48px minmax(0,1fr) 30px;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  border-radius: 21px;
  overflow: hidden;
  transition: .2s ease;
}
.quick-product:hover { transform: translateY(-3px); border-color: rgba(96,165,250,.3); background: linear-gradient(145deg, rgba(27,44,76,.92), rgba(14,25,45,.88)); }
.quick-product-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 15px; background: rgba(37,99,235,.14); font-size: 1.5rem; }
.quick-product-copy { min-width: 0; text-align: left; }
.quick-product strong { display: block; margin: 0; color: #f2f6ff; font-size: .94rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quick-product small { display: block; margin-top: 5px; color: #8fb3e8; }
.quick-product-add { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 10px; background: rgba(96,165,250,.12); color: #8ec5ff; }

/* List page */
.list-header-card {
  position: relative;
  padding: 20px 20px;
  border: 1px solid rgba(96,165,250,.17);
  border-radius: 26px;
  background:
    radial-gradient(circle at 85% 10%, rgba(96,165,250,.12), transparent 36%),
    linear-gradient(145deg, rgba(20,38,76,.92), rgba(12,24,48,.9));
  box-shadow: 0 18px 54px rgba(0,0,0,.24), inset 0 1px rgba(255,255,255,.055);
}
.back-title { flex: 1; }
.list-back-button { flex: 0 0 auto; }
.list-title-icon { width: 52px; height: 52px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 17px; background: linear-gradient(145deg, rgba(96,165,250,.24), rgba(37,99,235,.16)); color: #b6d9ff; border: 1px solid rgba(96,165,250,.18); }
.list-title-copy { min-width: 0; }
.list-kicker { display: block; margin-bottom: 4px; color: #76aaf0; font-size: .67rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.back-title h2 { font-size: clamp(1.45rem, 2.8vw, 2.15rem); letter-spacing: -.045em; }
.list-page-actions { flex: 0 0 auto; }
.add-item-card { border-radius: 25px; padding: 22px; }
.add-item-title span { border-radius: 13px; }
.segmented { border: 1px solid rgba(148,163,184,.1); }
.person-group {
  padding: 16px;
  border: 1px solid rgba(148,163,184,.1);
  border-radius: 24px;
  background: rgba(10, 18, 34, .42);
}
.person-group-head { padding: 0 3px 13px; border-bottom: 1px solid rgba(96,165,250,.16); }
.person-group-head h3 { color: #eaf2ff; }
.person-group-items { margin-top: 13px; }
.item-card { border-radius: 20px; }
.product-icon { border-radius: 15px; }
.quantity-pill { border: 1px solid rgba(96,165,250,.12); }

/* Popovers and modals */
.modal-backdrop { background: rgba(1,5,14,.68); backdrop-filter: blur(12px); }
.modal {
  border: 1px solid rgba(148,163,184,.16);
  border-radius: 28px;
  background: linear-gradient(155deg, rgba(19,31,53,.98), rgba(9,17,32,.98));
  box-shadow: 0 36px 120px rgba(0,0,0,.58), inset 0 1px rgba(255,255,255,.05);
}
.menu-popover { border-radius: 17px; backdrop-filter: blur(18px); }

/* Toasts */
.toast-stack { right: 24px; bottom: 24px; }
.toast {
  border: 1px solid rgba(96,165,250,.2);
  border-radius: 18px;
  background: rgba(13, 27, 51, .94);
  color: #ecf4ff;
  backdrop-filter: blur(18px);
  box-shadow: 0 20px 55px rgba(0,0,0,.38);
}
.toast.error { background: rgba(55,20,28,.96); border-color: rgba(248,113,113,.28); }

/* Mobile bar */
.mobile-nav {
  background: rgba(8,18,40,.9) !important;
  border: 1px solid rgba(148,163,184,.13);
  box-shadow: 0 18px 52px rgba(0,0,0,.38) !important;
}
.mobile-nav button.active { background: rgba(59,130,246,.18); }

@media (max-width: 1020px) {
  .app-shell { grid-template-columns: 226px minmax(0,1fr); }
  .sidebar { width: 226px; }
  .main { padding-inline: 25px; }
  .quick-product { min-width: 190px; }
}

@media (max-width: 760px) {
  .auth-page { padding: 0; }
  .auth-shell { border-radius: 0; border: 0; min-height: 100vh; }
  .main { padding: 0 16px 104px; }
  .topbar { min-height: 76px; }
  .list-header-card { padding: 15px; border-radius: 22px; align-items: flex-start; }
  .list-title-icon { display: none; }
  .list-kicker { display: none; }
  .list-page-actions .btn { border-radius: 13px; }
  .add-item-card { padding: 17px; border-radius: 22px; }
  .quick-product { min-width: 184px; }
  .toast-stack { right: 12px; bottom: 92px; }
}

@media (max-width: 480px) {
  .list-header-card { gap: 11px; }
  .back-title { gap: 9px; }
  .list-back-button { width: 42px; height: 42px; }
  .back-title h2 { font-size: 1.35rem; }
  .list-page-actions .btn { width: 42px; height: 42px; min-height: 42px; }
  .quick-product { min-width: 174px; grid-template-columns: 44px minmax(0,1fr) 28px; }
}

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

/* Final color consistency */
.stat-card:nth-child(2) .stat-icon,
.stat-card:nth-child(3) .stat-icon { background: rgba(37,99,235,.14); color: #8ec5ff; }
.share-code { background: rgba(37,99,235,.12); border-color: rgba(96,165,250,.32); }
.share-code strong { color: #9dcbff; }
.quick-product-copy { font-size: 1rem !important; }
.quick-product small { font-size: .78rem; line-height: 1.35; }
.grouped-items { display: grid; gap: 16px; }


/* ===== Install & Push onboarding V3 ===== */
.onboarding-backdrop {
  position: fixed;
  inset: 0;
  z-index: 240;
  display: grid;
  place-items: end center;
  padding: 22px;
  background: rgba(1, 5, 14, .66);
  backdrop-filter: blur(18px) saturate(120%);
  animation: fadeIn .2s ease;
}
.onboarding-sheet {
  width: min(520px, 100%);
  padding: 26px;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 30px;
  background: linear-gradient(155deg, rgba(20, 32, 58, .98), rgba(9, 17, 34, .99));
  box-shadow: 0 34px 90px rgba(0, 0, 0, .5);
  animation: onboardingIn .28s cubic-bezier(.22,.8,.25,1);
}
@keyframes onboardingIn {
  from { opacity: 0; transform: translateY(28px) scale(.97); }
}
.onboarding-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(145deg, #3b82f6, #1d4ed8);
  box-shadow: 0 16px 34px rgba(37, 99, 235, .3);
}
.onboarding-icon.notification { background: linear-gradient(145deg, #60a5fa, #2563eb); }
.onboarding-copy .eyebrow { color: #8fc3ff; }
.onboarding-copy h2 {
  margin: 8px 0 10px;
  color: #f7faff;
  font-size: clamp(1.65rem, 5vw, 2.1rem);
  letter-spacing: -.045em;
}
.onboarding-copy p {
  margin: 0;
  color: #aebddb;
  line-height: 1.62;
}
.onboarding-benefits {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 22px 0;
}
.onboarding-benefits span {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-height: 82px;
  padding: 14px 8px;
  border: 1px solid #26395e;
  border-radius: 16px;
  background: rgba(21, 38, 70, .62);
  color: #dce9ff;
  text-align: center;
  font-size: .75rem;
  font-weight: 700;
}
.install-steps {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 22px 0;
  list-style: none;
}
.install-steps li {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px;
  border: 1px solid #26395e;
  border-radius: 17px;
  background: rgba(21, 38, 70, .5);
}
.install-steps li > span {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: white;
  background: #2563eb;
  font-weight: 800;
}
.install-steps strong, .install-steps small { display: block; }
.install-steps strong { color: #eef5ff; font-size: .9rem; }
.install-steps small { margin-top: 3px; color: #94a8c8; line-height: 1.4; }
.push-example {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 22px 0;
  padding: 15px;
  border: 1px solid #2b4473;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(37, 99, 235, .2), rgba(15, 28, 53, .78));
}
.push-example-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: #dceaff;
  background: rgba(59, 130, 246, .24);
}
.push-example strong, .push-example small { display: block; }
.push-example strong { color: #f4f8ff; font-size: .9rem; }
.push-example small { margin-top: 4px; color: #9eb1d0; line-height: 1.4; }
.onboarding-actions {
  display: grid;
  grid-template-columns: .8fr 1.5fr;
  gap: 10px;
  margin-top: 22px;
}
@media (min-width: 761px) {
  .onboarding-backdrop { place-items: center; }
}
@media (max-width: 560px) {
  .onboarding-backdrop { padding: 10px; }
  .onboarding-sheet { padding: 21px; border-radius: 26px; }
  .onboarding-benefits { grid-template-columns: 1fr; }
  .onboarding-benefits span { min-height: 52px; flex-direction: row; justify-content: center; }
  .onboarding-actions { grid-template-columns: 1fr; }
  .onboarding-actions .btn-primary { grid-row: 1; }
}


/* ===== Mobile safe-area & startup polish V4 ===== */
.app-loading {
  min-height: 100dvh;
  padding: max(28px, env(safe-area-inset-top)) 24px max(28px, env(safe-area-inset-bottom));
}
.launch-loader-mark {
  position: relative;
  isolation: isolate;
}
.launch-loader-mark::after {
  content: '';
  position: absolute;
  inset: -10px;
  z-index: -1;
  border: 1px solid rgba(96,165,250,.22);
  border-radius: 30px;
  animation: launch-pulse 1.8s ease-out infinite;
}
.launch-loader-spinner {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin-top: 24px;
}
.launch-loader-spinner i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #60a5fa;
  animation: launch-dot 1.05s ease-in-out infinite;
}
.launch-loader-spinner i:nth-child(2) { animation-delay: .14s; }
.launch-loader-spinner i:nth-child(3) { animation-delay: .28s; }
@keyframes launch-dot { 0%, 60%, 100% { opacity: .35; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-6px); } }
@keyframes launch-pulse { from { opacity: .65; transform: scale(.9); } to { opacity: 0; transform: scale(1.22); } }

@media (max-width: 760px) {
  .main {
    padding-top: 0;
  }
  .topbar {
    box-sizing: border-box;
    min-height: calc(72px + env(safe-area-inset-top));
    padding-top: max(env(safe-area-inset-top), 12px);
    padding-bottom: 10px;
    top: 0;
  }
  .topbar-title h1 {
    line-height: 1.08;
  }
  .topbar-actions {
    align-self: flex-end;
    padding-bottom: 1px;
  }
}

@media (max-width: 430px) {
  .topbar {
    min-height: calc(78px + env(safe-area-inset-top));
    padding-top: max(env(safe-area-inset-top), 16px);
  }
  .topbar-title h1 { font-size: 1.75rem; }
  .topbar-actions .icon-btn { width: 44px; height: 44px; }
}

/* ===== Session restore & smooth sync V5 ===== */
.launch-loader-copy span {
  font-size: 1rem;
  font-weight: 700;
  color: #d9e6ff;
}
.launch-loader-copy small {
  display: block;
  max-width: 290px;
  margin: 8px auto 0;
  color: #7f94b7;
  font-size: .78rem;
  line-height: 1.5;
}

.section-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}
.sync-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid rgba(96,165,250,.2);
  border-radius: 999px;
  background: rgba(37,99,235,.1);
  color: #9fc8ff;
  font-size: .72rem;
  font-weight: 750;
  white-space: nowrap;
}
.sync-chip i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #60a5fa;
  box-shadow: 0 0 0 4px rgba(96,165,250,.12);
  animation: sync-chip-pulse 1.15s ease-in-out infinite;
}
@keyframes sync-chip-pulse {
  50% { opacity: .42; transform: scale(.78); }
}

.skeleton-card {
  min-height: 190px;
  pointer-events: none;
  overflow: hidden;
  position: relative;
}
.skeleton-card::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.055), transparent);
  animation: skeleton-sweep 1.35s ease-in-out infinite;
}
@keyframes skeleton-sweep { to { transform: translateX(100%); } }
.skeleton-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.skeleton-block {
  display: block;
  border-radius: 12px;
  background: #182641;
  border: 1px solid rgba(148,163,184,.055);
}
.skeleton-icon { width: 48px; height: 48px; border-radius: 16px; }
.skeleton-action { width: 38px; height: 38px; }
.skeleton-title { width: 58%; height: 19px; margin-top: 20px; }
.skeleton-meta { width: 42%; height: 12px; margin-top: 11px; }
.skeleton-progress { width: 100%; height: 7px; margin-top: 24px; border-radius: 999px; }

@media (max-width: 760px) {
  .section-head-actions { gap: 8px; }
  .sync-chip { padding: 6px 9px; font-size: .67rem; }
}

@media (max-width: 430px) {
  .section-head-actions {
    align-items: flex-end;
    flex-direction: column-reverse;
    gap: 4px;
  }
  .sync-chip { min-height: 28px; }
}


/* ===== Native-feel performance update V6 ===== */
.app-loading {
  background:
    radial-gradient(circle at 50% 38%, rgba(59, 130, 246, .16), transparent 30%),
    #07101f;
}
.launch-loader {
  will-change: transform, opacity;
  animation: nativeLaunchIn .34s cubic-bezier(.2,.8,.2,1) both;
}
.launch-loader-mark {
  box-shadow: 0 14px 40px rgba(37, 99, 235, .3);
  animation: nativeLogoBreathe 1.7s ease-in-out infinite;
}
@keyframes nativeLaunchIn {
  from { opacity: 0; transform: translateY(8px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes nativeLogoBreathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.045); }
}

.list-items-loading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0 10px;
  padding: 13px 15px;
  border: 1px solid rgba(96, 165, 250, .18);
  border-radius: 16px;
  background: rgba(15, 32, 63, .62);
  color: #dbeafe;
}
.list-items-loading strong,
.list-items-loading small { display: block; }
.list-items-loading strong { font-size: .82rem; }
.list-items-loading small { color: #8fa7cc; margin-top: 2px; font-size: .72rem; }
.native-pulse {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #60a5fa;
  box-shadow: 0 0 0 0 rgba(96, 165, 250, .42);
  animation: nativePulse 1.35s infinite;
}
@keyframes nativePulse {
  70% { box-shadow: 0 0 0 9px rgba(96, 165, 250, 0); }
  100% { box-shadow: 0 0 0 0 rgba(96, 165, 250, 0); }
}
.native-item-skeletons { margin-top: 10px; }
.skeleton-item { pointer-events: none; }
.skeleton-product-icon { width: 50px; height: 50px; border-radius: 16px; }
.skeleton-item-copy { display: grid; gap: 9px; min-width: 0; }
.skeleton-item-title { width: min(210px, 70%); height: 15px; }
.skeleton-item-meta { width: min(150px, 52%); height: 10px; }
.skeleton-item-button { width: 92px; height: 38px; border-radius: 12px; }

/* Keep interactions on their own compositor layer on mobile. */
.btn, .icon-btn, .nav-button, .mobile-nav button, .list-card, .quick-product {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
@media (hover: none) {
  .btn:hover, .list-card:hover { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .launch-loader, .launch-loader-mark, .native-pulse, .skeleton-block { animation: none !important; }
}


/* ===== Push dedupe & invite handoff V7 ===== */
.invite-browser-note {
  margin: -10px 0 20px;
  align-items: center;
  flex-wrap: wrap;
}
.invite-browser-note > div { flex: 1 1 230px; }
.invite-browser-note .btn { flex: 0 0 auto; }
.invite-fallback-note { align-items: flex-start; }
.share-code {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 12px;
}
.share-code small { grid-column: 1 / -1; }
.share-code strong { min-width: 0; }
@media (max-width: 560px) {
  .share-code { grid-template-columns: 1fr; }
  .share-code small { grid-column: auto; }
  .share-code .btn { width: 100%; }
  .invite-browser-note .btn { width: 100%; }
}


/* ===== In-app update prompt V8 ===== */
.app-update-prompt {
  position: fixed;
  z-index: 260;
  left: max(18px, env(safe-area-inset-left));
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  width: min(650px, calc(100% - 36px));
  margin-inline: auto;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(125, 169, 255, .24);
  border-radius: 22px;
  background: rgba(13, 25, 48, .94);
  color: #eef5ff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .46), inset 0 1px 0 rgba(255,255,255,.04);
  -webkit-backdrop-filter: blur(22px) saturate(1.25);
  backdrop-filter: blur(22px) saturate(1.25);
  opacity: 0;
  transform: translateY(18px) scale(.985);
  transition: opacity .2s ease, transform .25s cubic-bezier(.2,.8,.2,1);
}
.app-update-prompt.visible { opacity: 1; transform: none; }
.app-update-prompt.leaving { opacity: 0; transform: translateY(12px) scale(.985); }
.app-update-prompt.updating { border-color: rgba(96,165,250,.42); }
.app-update-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: linear-gradient(145deg, #2563eb, #1d4ed8);
  color: white;
  box-shadow: 0 10px 24px rgba(37,99,235,.28);
}
.app-update-copy { min-width: 0; }
.app-update-copy strong,
.app-update-copy span { display: block; }
.app-update-copy strong { font-size: .92rem; letter-spacing: -.015em; }
.app-update-copy span { margin-top: 3px; color: #94a9cb; font-size: .75rem; line-height: 1.4; }
.app-update-actions { display: flex; align-items: center; gap: 7px; }
.update-button-spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: update-button-spin .7s linear infinite;
}
@keyframes update-button-spin { to { transform: rotate(360deg); } }

@media (max-width: 620px) {
  .app-update-prompt {
    bottom: calc(88px + env(safe-area-inset-bottom));
    grid-template-columns: auto minmax(0, 1fr);
    gap: 11px 12px;
    padding: 13px;
    border-radius: 20px;
  }
  .app-update-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
  .app-update-actions .btn-primary { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .app-update-prompt { transition: none; }
  .update-button-spinner { animation-duration: 1.2s; }
}

/* ===== Rendering Stability V9 ===== */
.page {
  min-height: calc(100dvh - 120px);
  animation: none !important;
  overflow-anchor: none;
}

.page.stable-patch,
.page.stable-patch *,
#list-items-region.stable-patch,
#list-items-region.stable-patch * {
  animation: none !important;
  transition: none !important;
}

#list-items-region {
  min-height: 132px;
  overflow-anchor: none;
}

.quick-add-section[hidden] { display: none !important; }

.hero { min-height: 300px; }
.stat-card { min-height: 88px; }
.list-card { min-height: 190px; }
.item-card { min-height: 80px; }
.settings-card { min-height: 180px; }

/* Fixed UI surfaces stay composited while the page content updates below them. */
.topbar,
.mobile-nav {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(0);
}

@media (max-width: 820px) {
  body {
    background: #07101f;
  }

  body::after { display: none; }

  .page {
    min-height: calc(100dvh - 170px);
    contain: layout style;
  }

  .topbar {
    background: rgba(7, 14, 29, .97);
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }

  .mobile-nav {
    background: rgba(10, 21, 43, .98);
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }

  .icon-btn,
  .hero-art,
  .page-loader-overlay,
  .modal-backdrop,
  .menu-popover,
  .onboarding-backdrop,
  .app-update-prompt {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }

  .hero,
  .stat-card,
  .list-card,
  .add-item-card,
  .settings-card,
  .notification-card,
  .item-card,
  .quick-product {
    box-shadow: 0 10px 28px rgba(0, 0, 0, .2), inset 0 1px rgba(255, 255, 255, .025);
  }

  .hero { min-height: 0; }
  .list-card { min-height: 178px; }
  .item-card { min-height: 76px; }
}

@media (max-width: 430px) {
  .page { min-height: calc(100dvh - 150px); }
  .stat-card { min-height: 112px; }
}
