@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;1,9..144,500&family=Karla:wght@400;500;600;700&display=swap');

:root{
  --bg: #EFE9DC;
  --panel: #F8F4E9;
  --panel-soft: #F2ECDD;
  --ink: #2E3527;
  --ink-soft: #6E735F;
  --ink-faint: #9A9C86;
  --moss: #4B5D3A;
  --moss-light: #7C8F5E;
  --moss-pale: #DCE3CC;
  --clay: #A9714F;
  --clay-pale: #E7D3BE;
  --honey: #C99A44;
  --honey-pale: #F0DFB8;
  --blush: #BD7F63;
  --blush-pale: #EFD9CB;
  --red: #C1443A;
  --red-pale: #F1D6D2;
  --line: rgba(46,53,39,0.11);
  --shadow: 0 2px 14px rgba(46,53,39,0.08), 0 1px 2px rgba(46,53,39,0.06);
}

*{ box-sizing:border-box; -webkit-tap-highlight-color: transparent; }
html,body{ height:100%; }
body{
  margin:0; background: var(--bg); color: var(--ink);
  font-family:'Karla', sans-serif; -webkit-font-smoothing:antialiased;
  background-image:
    radial-gradient(ellipse at 15% 0%, rgba(124,143,94,0.09), transparent 55%),
    radial-gradient(ellipse at 100% 20%, rgba(201,154,68,0.08), transparent 50%);
  background-attachment: fixed;
}
h1,h2,h3,.serif{ font-family:'Fraunces', serif; }
button{ font-family:'Karla', sans-serif; cursor:pointer; }
input, textarea, select{ font-family:'Karla', sans-serif; }

#app{ max-width: 480px; margin: 0 auto; min-height:100vh; position:relative; padding-bottom: 96px; }

.topbar{ padding: 22px 20px 6px; display:flex; align-items:center; justify-content:space-between; }
.topbar .brand{ display:flex; align-items:center; gap:9px; }
.brand-mark{ width:26px; height:26px; }
.brand-name{ font-family:'Fraunces', serif; font-weight:600; font-size:18px; letter-spacing:0.01em; }
.topbar-icons{ display:flex; gap:8px; }
.icon-btn{
  width:36px; height:36px; border-radius:50%; border:1px solid var(--line);
  background: var(--panel); display:flex; align-items:center; justify-content:center;
  color: var(--ink-soft); font-size:15px;
}
.admin-dot{
  position:absolute; top:-2px; right:-2px; width:9px; height:9px; border-radius:50%;
  background: var(--honey); border:1.5px solid var(--bg);
}

.search-bar{ padding: 4px 20px 10px; display:none; }
.search-bar.open{ display:block; }
.search-bar input{
  width:100%; padding: 11px 14px; border-radius: 12px; border:1px solid var(--line);
  background: var(--panel); font-size:14px; color: var(--ink); outline:none;
}
.search-bar input::placeholder{ color: var(--ink-faint); }

.view{ display:none; padding: 6px 20px 20px; animation: fadeUp 0.3s ease; }
.view.active{ display:block; }
@keyframes fadeUp{ from{opacity:0; transform:translateY(6px);} to{opacity:1; transform:translateY(0);} }

.page-head{ margin: 14px 0 16px; }
.page-head h1{ font-size: 22px; font-weight:500; margin:0 0 3px; }
.page-head p{ margin:0; color: var(--ink-soft); font-size:13px; }

/* ---------- HOME ---------- */
.greeting{ margin: 10px 0 18px; }
.greeting h1{ font-size: 28px; font-weight:500; margin: 0 0 4px; line-height:1.15; }
.greeting p{ margin:0; color: var(--ink-soft); font-size:14px; }

.add-prompt{
  background: var(--panel); border:1px solid var(--line); border-radius:18px;
  padding: 16px 18px; display:flex; align-items:center; gap:12px; box-shadow: var(--shadow);
  margin-bottom: 22px;
}
.add-prompt .leaf{ font-size:20px; }
.add-prompt span{ color: var(--ink-faint); font-size:14.5px; flex:1; }
.add-prompt-btn{ background: var(--moss); color:#fff; border:none; border-radius:12px; padding: 9px 14px; font-size:13px; font-weight:600; }

.stat-row{ display:flex; gap:10px; margin-bottom: 24px; }
.stat-card{ flex:1; background: var(--panel-soft); border-radius:14px; padding: 13px 10px; text-align:center; border:1px solid var(--line); }
.stat-card .num{ font-family:'Fraunces', serif; font-size:20px; font-weight:600; color: var(--moss); display:block; }
.stat-card .lbl{ font-size:10.5px; color: var(--ink-soft); margin-top:2px; display:block; line-height:1.3; }

.milestone-block{
  background: linear-gradient(160deg, var(--panel), var(--panel-soft));
  border:1px solid var(--line); border-radius:20px; padding: 20px; margin-bottom:24px;
  display:flex; align-items:center; gap:18px; box-shadow: var(--shadow);
}
.milestone-text{ flex:1; }
.milestone-text .count{ font-family:'Fraunces', serif; font-size:17px; font-weight:600; margin-bottom:3px; }
.milestone-text .note{ font-size:12px; color: var(--ink-soft); line-height:1.45; }

.section-head{ display:flex; align-items:baseline; justify-content:space-between; margin: 22px 0 12px; }
.section-head h2{ font-size:17px; font-weight:600; margin:0; }
.section-head .see-all{ font-size:12px; color: var(--moss); font-weight:600; background:none; border:none; }

.help-wanted-strip{ display:flex; gap:10px; overflow-x:auto; padding-bottom:6px; }
.hw-card{ flex-shrink:0; width: 168px; background: var(--blush-pale); border-radius:14px; padding:12px 13px; border:1px solid rgba(189,127,99,0.25); }
.hw-card .who{ font-size:11px; color: var(--clay); font-weight:700; margin-bottom:4px; }
.hw-card .what{ font-size:12.5px; line-height:1.4; margin-bottom:10px; color: var(--ink); }
.hw-card button{ width:100%; border:none; background: var(--clay); color:#fff; border-radius:9px; padding:6px 0; font-size:11.5px; font-weight:600; }
.hw-card button.helping{ background: var(--moss-light); }

/* ---------- CARDS ---------- */
.task-card{
  background: var(--panel); border:1px solid var(--line); border-radius:16px;
  padding: 15px 16px; margin-bottom: 12px; box-shadow: var(--shadow); transition: opacity 0.2s;
  border-left: 4px solid transparent;
}
.task-card.urgent-glow{ box-shadow: var(--shadow), 0 0 0 1px var(--glow-color, transparent), 0 0 14px -2px var(--glow-color, transparent); border-left-color: var(--glow-color, transparent); }
.task-card.completed{ opacity:0.7; }
.task-top{ display:flex; justify-content:space-between; align-items:flex-start; gap:10px; }
.task-title{ font-family:'Fraunces', serif; font-size:16px; font-weight:500; line-height:1.35; }
.task-title.done{ text-decoration: line-through; text-decoration-color: var(--ink-faint); }
.tag-row{ display:flex; gap:6px; flex-wrap:wrap; align-items:center; }
.priority-tag{ font-size:9.5px; font-weight:700; letter-spacing:0.04em; text-transform:uppercase; padding:3px 7px; border-radius:6px; white-space:nowrap; color:#fff; }
.location-tag{ font-size:10px; font-weight:600; background: var(--panel-soft); color: var(--ink-soft); padding:3px 8px; border-radius:7px; border:1px solid var(--line); }
.deadline-tag{ font-size:10px; font-weight:700; padding:3px 8px; border-radius:7px; }
.task-desc{ font-size:12.5px; color: var(--ink-soft); margin-top:6px; line-height:1.45; }
.task-meta{ display:flex; align-items:center; justify-content:space-between; margin-top:12px; flex-wrap:wrap; gap:8px; }
.added-by{ font-size:11px; color: var(--ink-faint); }
.added-by b{ color: var(--ink-soft); font-weight:600; }
.helpers{ display:flex; align-items:center; gap:4px; }
.avatar{ width:20px; height:20px; border-radius:50%; background: var(--moss-pale); color: var(--moss); font-size:9.5px; font-weight:700; display:flex; align-items:center; justify-content:center; border: 1.5px solid var(--panel); margin-left:-6px; }
.helpers .avatar:first-child{ margin-left:0; }

.task-actions{ display:flex; gap:8px; margin-top:12px; }
.btn-mini{ flex:1; border:1px solid var(--line); background: var(--panel-soft); color: var(--ink); border-radius:10px; padding: 8px 0; font-size:12px; font-weight:600; }
.btn-mini.primary{ background: var(--moss); color:#fff; border-color: var(--moss); }
.btn-mini.active{ background: var(--moss-pale); color: var(--moss); border-color: transparent; }

.completed-banner{ display:flex; align-items:center; gap:8px; margin-top:12px; padding-top:12px; border-top:1px dashed var(--line); }
.completed-banner .check{ color: var(--moss); font-size:14px; }
.completed-banner .txt{ font-size:12px; color: var(--ink-soft); flex:1; }
.completed-banner .txt b{ color: var(--ink); }
.gratitude-btn{ border:none; background: var(--honey-pale); color:#8a6a1f; border-radius:20px; padding: 6px 11px; font-size:12px; font-weight:700; display:flex; align-items:center; gap:4px; }
.gratitude-btn.given{ background: var(--honey); color:#fff; }

.chip-row{ display:flex; gap:8px; margin-bottom:16px; overflow-x:auto; padding-bottom:2px; }
.chip{ flex-shrink:0; padding:7px 13px; border-radius:20px; border:1px solid var(--line); background: var(--panel); font-size:12.5px; color: var(--ink-soft); font-weight:600; white-space:nowrap; }
.chip.active{ background: var(--moss); color:#fff; border-color: var(--moss); }

/* ---------- MY SPACE ---------- */
.privacy-badge{ font-size:9.5px; font-weight:700; padding:3px 7px; border-radius:6px; letter-spacing:0.03em; }
.privacy-badge.private{ background: var(--panel-soft); color: var(--ink-faint); }
.privacy-badge.community{ background: var(--moss-pale); color: var(--moss); }
.privacy-badge.help{ background: var(--blush-pale); color: var(--clay); }

/* ---------- IDEAS ---------- */
.idea-card{ background: var(--honey-pale); border:1px solid rgba(201,154,68,0.28); border-radius:18px; padding:16px 17px; margin-bottom:12px; }
.idea-card .idea-text{ font-family:'Fraunces', serif; font-size:15.5px; font-style:italic; line-height:1.45; color:#5a4520; }
.idea-card .idea-meta{ font-size:11px; color:#8a7343; margin-top:8px; }
.reaction-row{ display:flex; gap:8px; margin-top:12px; }
.reaction{ border:1px solid rgba(201,154,68,0.3); background: rgba(255,255,255,0.4); border-radius:14px; padding: 6px 10px; font-size:12px; font-weight:600; color:#8a6a1f; display:flex; gap:5px; align-items:center; }
.reaction.active{ background:#8a6a1f; color:#fff; border-color:#8a6a1f; }

/* ---------- CELEBRATIONS ---------- */
.celebration-card{ background: var(--panel); border:1px solid var(--line); border-radius:16px; padding:15px 16px; margin-bottom:12px; display:flex; align-items:center; gap:12px; }
.celebration-card .txt{ flex:1; font-size:14px; }
.celebration-card .txt .by{ font-size:11px; color: var(--ink-faint); margin-top:2px; }
.vote-btn{ border:1px solid var(--line); background: var(--panel-soft); border-radius:14px; padding:8px 12px; font-size:12px; font-weight:700; color: var(--ink-soft); white-space:nowrap; }
.vote-btn.active{ background: var(--honey); color:#fff; border-color: var(--honey); }

/* ---------- MONEY ---------- */
.money-summary{ background: linear-gradient(160deg, var(--panel), var(--panel-soft)); border:1px solid var(--line); border-radius:18px; padding:20px; margin-bottom:20px; box-shadow: var(--shadow); }
.money-summary .big{ font-family:'Fraunces', serif; font-size:26px; font-weight:600; color: var(--moss); }
.money-summary .cap{ font-size:11px; color: var(--ink-soft); text-transform:uppercase; letter-spacing:0.04em; margin-bottom:4px; }
.invest-row{ display:flex; align-items:center; justify-content:space-between; padding:11px 0; border-bottom:1px solid var(--line); }
.invest-row:last-child{ border:none; }
.invest-row .name{ font-weight:700; font-size:13.5px; }
.invest-bar-track{ height:6px; background: var(--panel-soft); border-radius:4px; margin-top:6px; overflow:hidden; }
.invest-bar-fill{ height:100%; background: var(--moss-light); border-radius:4px; }
.invest-amt{ font-size:13px; font-weight:700; color: var(--ink); white-space:nowrap; margin-left:12px; }
.income-card{ background: var(--panel); border:1px solid var(--line); border-radius:14px; padding:14px 15px; margin-bottom:10px; }
.income-top{ display:flex; justify-content:space-between; align-items:center; }
.income-title{ font-weight:700; font-size:13.5px; }
.income-status{ font-size:9.5px; font-weight:700; text-transform:uppercase; padding:3px 8px; border-radius:7px; }
.income-status.active{ background: var(--moss-pale); color: var(--moss); }
.income-status.exploring{ background: var(--honey-pale); color:#8a6a1f; }
.income-status.idea{ background: var(--panel-soft); color: var(--ink-faint); }
.income-price{ font-size:12px; color: var(--ink-soft); margin-top:4px; }
.equal-note{ font-size:11.5px; color: var(--ink-soft); margin-top:10px; line-height:1.5; font-style:italic; }

/* ---------- SEASON BANNER ---------- */
.season-banner{ display:flex; align-items:center; gap:12px; background: var(--panel-soft); border:1px solid var(--line); border-radius:14px; padding:13px 15px; margin-bottom:18px; }
.season-emoji{ font-size:24px; }
.season-label{ font-family:'Fraunces', serif; font-weight:600; font-size:14px; }
.season-prompt{ font-size:11.5px; color: var(--ink-soft); margin-top:1px; line-height:1.4; }

/* ---------- ADD SHEET: VOICE + PHOTO ---------- */
.textarea-wrap{ position:relative; }
.mic-btn{ position:absolute; right:9px; bottom:9px; width:34px; height:34px; border-radius:50%; border:1px solid var(--line); background: var(--panel-soft); font-size:15px; display:flex; align-items:center; justify-content:center; }
.mic-btn.listening{ background: var(--red); border-color: var(--red); animation: pulse 1.1s infinite; }
@keyframes pulse{ 0%,100%{ box-shadow: 0 0 0 0 rgba(193,68,58,0.4); } 50%{ box-shadow: 0 0 0 8px rgba(193,68,58,0); } }
.photo-add-btn{ margin-top:10px; width:100%; border:1px dashed var(--line); background: var(--panel-soft); color: var(--ink-soft); border-radius:12px; padding:10px 0; font-size:12.5px; font-weight:600; }
#photoPreviewWrap{ margin-top:10px; position:relative; }
#photoPreviewWrap img{ width:100%; max-height:160px; object-fit:cover; border-radius:12px; display:block; }
#removePhotoBtn{ position:absolute; top:8px; right:8px; background: rgba(46,53,39,0.7); color:#fff; border:none; border-radius:16px; padding:5px 10px; font-size:10.5px; font-weight:600; }
.task-photo{ width:100%; max-height:160px; object-fit:cover; border-radius:12px; margin-top:8px; display:block; }

/* ---------- MAP VIEW ---------- */
.view-toggle{ display:flex; border:1px solid var(--line); border-radius:11px; overflow:hidden; flex-shrink:0; }
.vt-btn{ background: var(--panel); border:none; padding:8px 12px; font-size:14px; color: var(--ink-faint); }
.vt-btn.active{ background: var(--moss); color:#fff; }
#communityMapHolder{ background: var(--panel-soft); border:1px solid var(--line); border-radius:18px; padding:18px 8px; }

/* ---------- TEMPLATE PRESETS ---------- */
.preset-grid{ display:flex; flex-direction:column; gap:10px; margin-bottom:24px; }
.preset-card{ text-align:left; border:1px solid var(--line); background: var(--panel); border-radius:14px; padding:13px 15px; }
.preset-card.selected{ background: var(--moss-pale); border-color: var(--moss-light); }
.preset-label{ font-weight:700; font-size:13.5px; }
.preset-zones{ font-size:15px; margin-top:4px; letter-spacing:0.05em; }

/* ---------- LOGIN ---------- */
.login-overlay{ position:fixed; align-items:center; z-index:500; background: var(--bg); display:none; }
.login-overlay.open{ display:flex; }
.login-card{ max-width:340px; width:100%; margin:0 auto; text-align:center; padding:0 28px; }
.login-card input{ width:100%; padding:13px 15px; border-radius:13px; border:1px solid var(--line); background: var(--panel); font-size:14.5px; color: var(--ink); outline:none; text-align:center; }

/* ---------- GRATITUDE ---------- */
.glow-msg{ background: var(--moss-pale); border-radius:14px; padding:13px 15px; font-size:13px; color: var(--moss); margin-bottom:16px; display:flex; gap:8px; align-items:center; line-height:1.4; }
.member-row{ display:flex; align-items:center; gap:12px; padding:11px 0; border-bottom:1px solid var(--line); }
.member-row:last-child{ border:none; }
.avatar-lg{ width:38px; height:38px; border-radius:50%; background: var(--moss-pale); color: var(--moss); font-family:'Fraunces',serif; font-weight:600; font-size:14px; display:flex; align-items:center; justify-content:center; position:relative; }
.admin-badge{ position:absolute; bottom:-2px; right:-2px; font-size:10px; background: var(--honey); border-radius:50%; width:15px; height:15px; display:flex; align-items:center; justify-content:center; border:1.5px solid var(--bg); }
.member-info{ flex:1; }
.member-info .name{ font-weight:700; font-size:13.5px; }
.member-info .sub{ font-size:11.5px; color: var(--ink-soft); margin-top:2px; }

/* ---------- ADMIN / INVITE ---------- */
.invite-box{ background: var(--panel); border:1px solid var(--line); border-radius:16px; padding:18px; margin-bottom:20px; }
.invite-box input{ width:100%; padding:11px 13px; border-radius:11px; border:1px solid var(--line); background: var(--panel-soft); font-size:13.5px; margin-bottom:10px; outline:none; }
.invite-box button{ width:100%; background: var(--moss); color:#fff; border:none; border-radius:11px; padding:11px 0; font-size:13.5px; font-weight:700; }
.pending-badge{ font-size:10px; background: var(--honey-pale); color:#8a6a1f; padding:3px 8px; border-radius:7px; font-weight:700; }

/* ---------- BOTTOM NAV ---------- */
.bottom-nav{
  position:fixed; bottom:0; left:50%; transform:translateX(-50%); width:100%; max-width:480px;
  background: rgba(248,244,233,0.94); backdrop-filter: blur(10px);
  border-top:1px solid var(--line); display:flex; justify-content:space-around; align-items:center;
  padding: 9px 4px calc(9px + env(safe-area-inset-bottom)); z-index:40; overflow-x:auto;
}
.nav-btn{ background:none; border:none; display:flex; flex-direction:column; align-items:center; gap:3px; color: var(--ink-faint); font-size:9px; font-weight:600; padding:4px 6px; flex-shrink:0; }
.nav-btn .ic{ font-size:17px; }
.nav-btn.active{ color: var(--moss); }

.fab{
  position:fixed; bottom: 68px; left:50%; transform:translateX(-50%);
  width:58px; height:58px; border-radius: 42% 58% 55% 45% / 55% 45% 58% 42%;
  background: linear-gradient(150deg, var(--moss), var(--moss-light));
  border:none; color:#fff; font-size:26px; box-shadow: 0 8px 20px rgba(75,93,58,0.35);
  z-index:45; display:flex; align-items:center; justify-content:center;
}

/* ---------- MODALS ---------- */
.overlay{ position:fixed; inset:0; background: rgba(46,53,39,0.45); display:none; align-items:flex-end; justify-content:center; z-index:100; }
.overlay.open{ display:flex; animation: fadeIn 0.2s ease; }
@keyframes fadeIn{ from{opacity:0;} to{opacity:1;} }
.sheet{ background: var(--bg); width:100%; max-width:480px; border-radius:26px 26px 0 0; padding: 22px 20px calc(24px + env(safe-area-inset-bottom)); max-height:88vh; overflow-y:auto; animation: slideUp 0.3s cubic-bezier(.2,.8,.2,1); }
@keyframes slideUp{ from{ transform: translateY(30px); opacity:0;} to{ transform:translateY(0); opacity:1;} }
.sheet-handle{ width:36px; height:4px; background: var(--line); border-radius:3px; margin: 0 auto 18px; }
.sheet h3{ font-size:20px; font-weight:500; margin:0 0 4px; }
.sheet .hint{ font-size:12.5px; color: var(--ink-soft); margin-bottom:16px; }
.sheet textarea{ width:100%; min-height:78px; border-radius:14px; border:1px solid var(--line); background: var(--panel); padding:13px 14px; font-size:14.5px; color: var(--ink); outline:none; resize:none; line-height:1.5; }
.sheet textarea::placeholder{ color: var(--ink-faint); }

.type-grid{ display:grid; grid-template-columns: 1fr 1fr; gap:10px; margin-top:16px; }
.type-opt{ border:1px solid var(--line); background: var(--panel); border-radius:14px; padding:14px 12px; text-align:left; display:flex; flex-direction:column; gap:6px; }
.type-opt .ic{ font-size:19px; }
.type-opt .lbl{ font-size:13px; font-weight:700; }
.type-opt .desc{ font-size:10.5px; color: var(--ink-soft); line-height:1.3; }
.type-opt:active{ background: var(--moss-pale); }

.field-label{ font-size:11.5px; font-weight:700; color: var(--ink-soft); margin: 14px 0 6px; text-transform:uppercase; letter-spacing:0.03em; }
.select-row{ display:flex; gap:8px; flex-wrap:wrap; }
.select-opt{ border:1px solid var(--line); background: var(--panel); border-radius:11px; padding:8px 12px; font-size:12px; font-weight:600; color: var(--ink-soft); }
.select-opt.selected{ background: var(--moss); color:#fff; border-color: var(--moss); }
.date-input{ width:100%; padding:11px 13px; border-radius:12px; border:1px solid var(--line); background: var(--panel); font-size:13.5px; color: var(--ink); }

.sheet-submit{ width:100%; margin-top:18px; background: var(--moss); color:#fff; border:none; border-radius:14px; padding:14px 0; font-size:14.5px; font-weight:700; }
.sheet-submit:disabled{ opacity:0.4; }
.sheet-cancel{ width:100%; margin-top:8px; background:none; border:none; color: var(--ink-soft); padding:6px 0; font-size:13px; }

.celebrate-sheet{ text-align:center; }
.celebrate-emoji{ font-size:42px; margin-bottom:6px; }
.celebrate-sheet h3{ font-size:22px; }
.celebrate-sheet p{ color: var(--ink-soft); font-size:13.5px; line-height:1.5; }
.celebrate-opts{ display:flex; flex-direction:column; gap:9px; margin-top:18px; text-align:left; }
.cel-opt{ border:1px solid var(--line); background: var(--panel); border-radius:13px; padding:12px 15px; font-size:13.5px; font-weight:600; display:flex; align-items:center; gap:10px; }
.cel-opt.selected{ background: var(--honey-pale); border-color: var(--honey); color:#7a5c1c; }

.toast{
  position:fixed; top:18px; left:50%; transform:translateX(-50%) translateY(-40px);
  background: var(--ink); color: var(--bg); padding:11px 18px; border-radius:30px; font-size:13px;
  font-weight:600; z-index:200; opacity:0; transition: all 0.35s cubic-bezier(.2,.8,.2,1); pointer-events:none;
  box-shadow: 0 8px 20px rgba(0,0,0,0.2); white-space:nowrap; max-width: 90vw; overflow:hidden; text-overflow:ellipsis;
}
.toast.show{ opacity:1; transform:translateX(-50%) translateY(0); }

.empty-state{ text-align:center; padding: 30px 10px; color: var(--ink-faint); }
.empty-state .em{ font-size:28px; margin-bottom:8px; }
.empty-state p{ font-size:13px; }

@media (max-width:380px){
  .brand-name{ font-size:16px; }
  .nav-btn{ font-size:8.5px; }
}

/* ============================================================
   DESKTOP / WIDE LAYOUT (≥900px)
   Everything above this point is the mobile design, untouched.
   These rules only kick in on a laptop-sized viewport: the bottom
   nav becomes a left sidebar, content gets more breathing room,
   sheets become centered modals instead of bottom sheets, and
   card lists lay out in a grid.
   ============================================================ */
@media (min-width:900px){
  body{ background-attachment: fixed; }

  #app{
    max-width: 820px;
    margin: 0 auto 0 240px;
    padding-bottom: 40px;
  }

  .topbar{ padding: 28px 0 6px; max-width: 780px; margin: 0 auto; justify-content: flex-end; }
  .topbar .brand{ display: none; } /* brand now lives at the top of the sidebar instead */
  .search-bar{ padding: 4px 0 10px; max-width: 780px; margin: 0 auto; }
  .view{ padding: 6px 0 20px; max-width: 780px; margin: 0 auto; }
  .view.active{ display:block; }

  /* ---- sidebar nav replaces bottom nav ---- */
  .bottom-nav{
    position: fixed; top:0; left:0; bottom:auto; transform:none;
    width: 220px; height: 100vh; max-width: none;
    flex-direction: column; justify-content: flex-start; align-items: stretch;
    gap: 4px; padding: 28px 14px; border-top:none; border-right: 1px solid var(--line);
    background: var(--panel-soft); backdrop-filter: none; overflow-x: visible;
  }
  .nav-btn{
    flex-direction: row; justify-content: flex-start; align-items:center; gap: 12px;
    padding: 11px 14px; border-radius: 12px; font-size: 13.5px;
  }
  .nav-btn .ic{ font-size: 18px; }
  .nav-btn.active{ background: var(--moss-pale); }
  .nav-btn:hover{ background: var(--panel); }

  /* sidebar brand mark at the top */
  .bottom-nav::before{
    content: '🌱 CommYOUnity';
    font-family: 'Fraunces', serif; font-weight: 600; font-size: 16px; color: var(--ink);
    padding: 4px 14px 20px; display:block;
  }

  /* ---- floating add button moves to bottom-right, not centered over a bottom bar ---- */
  .fab{
    left: auto; right: 40px; bottom: 40px; transform: none;
    width: 60px; height: 60px;
  }
  .fab:hover{ filter: brightness(1.05); }

  /* ---- sheets become centered modals instead of bottom sheets ---- */
  .overlay{ align-items: center; }
  .sheet{
    max-width: 440px; border-radius: 22px; max-height: 82vh;
    box-shadow: 0 24px 60px rgba(46,53,39,0.25);
  }
  .login-overlay .sheet, .login-card{ max-width: 380px; }

  /* ---- card grids for browsing on a wider screen ---- */
  #communityList, #ideasList, #mySpaceList{
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; align-items: start;
  }
  #communityList .task-card, #ideasList .idea-card, #mySpaceList .task-card{ margin-bottom: 0; }

  .stat-row{ max-width: 780px; }
  .help-wanted-strip{ overflow-x: visible; flex-wrap: wrap; }
  .hw-card{ width: calc(33% - 8px); }

  .toast{ top: 24px; }
}

@media (min-width:1200px){
  #app{ max-width: 900px; }
  .topbar, .search-bar, .view{ max-width: 860px; }
  #communityList, #ideasList, #mySpaceList{ grid-template-columns: repeat(3, 1fr); }
}
