/* ════════════════════════════════════════════════════════════════
   dashboard.css — Member dashboard styles
   ════════════════════════════════════════════════════════════════
   TRANSITIONAL: this file currently holds the entire v455 inline
   <style> block. Each Cohortz frontend port turn extracts one
   view's styles into its own file (chat.css, daily.css,
   coworking.css, cohort.css, connections.css, lifecycle.css,
   badges.css, ask.css). When that's done, this file holds only
   layout / topbar / nav / shared chrome styles.

   See: docs/PORTING_PLAN.md Milestone 8.
   ════════════════════════════════════════════════════════════════ */

    :root {
      --accent:#0d9488;--accent-light:#e6f4f3;--accent-dark:#0b7d73;
      --bg:#fff;--surface:#f8f8f8;--border:#e8e8e8;
      --text:#111;--muted:#777;--danger:#dc2626;--vibe:#f59e0b;--fire:#f97316;
    }
    *{box-sizing:border-box;margin:0;padding:0;}
    body.auth-pending{visibility:hidden;}
    body{font-family:"DM Sans",sans-serif;background:var(--bg);color:var(--text);height:100vh;height:100dvh;display:flex;flex-direction:column;overflow:hidden;overflow-x:hidden;width:100%;max-width:100vw;}

    /* NAV */
    .nav{display:flex;align-items:center;justify-content:space-between;padding:0 24px;height:56px;border-bottom:1px solid var(--border);flex-shrink:0;background:#fff;gap:16px;}
    .nav-logo{height:26px;display:block;flex-shrink:0;}
    .nav-links{display:flex;align-items:center;gap:2px;flex:1;justify-content:center;}
    .nav-link{padding:6px 13px;border-radius:6px;font-size:13px;font-weight:500;color:var(--muted);cursor:pointer;border:none;background:none;font-family:inherit;transition:all .15s;white-space:nowrap;text-decoration:none;display:inline-block;}
    .nav-link:hover{color:var(--text);background:var(--surface);}
    .nav-link.active{color:var(--accent);background:var(--accent-light);font-weight:600;}
    .nav-link.russellbot{border:1px solid var(--accent);color:var(--accent);}
    .nav-link.russellbot.active{background:var(--accent);color:white;border-color:var(--accent);}
    .nav-right{display:flex;align-items:center;gap:8px;flex-shrink:0;position:relative;}

    /* FIRE DROPDOWN */
    .fire-btn{background:none;border:none;cursor:pointer;font-size:20px;padding:4px 6px;border-radius:6px;transition:background .15s;position:relative;}
    .fire-btn:hover{background:var(--surface);}
    .fire-dropdown{position:absolute;top:calc(100% + 8px);right:0;background:#fff;border:1px solid var(--border);border-radius:10px;box-shadow:0 8px 24px rgba(0,0,0,.12);width:200px;padding:6px;z-index:200;display:none;flex-direction:column;gap:2px;}
    .fire-dropdown.open{display:flex;}
    .fire-item{display:flex;align-items:center;gap:10px;padding:10px 12px;border-radius:7px;cursor:pointer;font-size:13px;font-weight:500;color:var(--text);text-decoration:none;border:none;background:none;font-family:inherit;width:100%;text-align:left;transition:background .12s;}
    .fire-item:hover{background:var(--surface);}
    .fire-item .fi{font-size:16px;width:20px;text-align:center;}
    .fire-item.active{color:var(--accent);background:var(--accent-light);}
    .fire-sep{height:1px;background:var(--border);margin:4px 0;}

    /* PROFILE ICON */
    .nav-icon{height:34px;width:34px;border-radius:50%;overflow:hidden;cursor:pointer;border:2px solid var(--border);transition:border-color .15s;flex-shrink:0;}
    .nav-icon:hover{border-color:var(--accent);}
    .nav-icon img{width:100%;height:100%;object-fit:cover;}

    /* VIEWS */
    .view{display:none;flex:1;overflow:hidden;}
    .view.active{display:flex;}

    /* ── MESSAGES — modern messaging app layout ────────────────────────── */
    /* Conversation row — avatar + content + meta, like every messaging app */
    /* Unread state — bolder name + visible dot. Cohort/pinned rooms also
       use this when they have unread activity. */
    /* Main panel — header, body, footer */
    /* Overflow menu for cohort actions — looks like every messaging app's "..." button */
    /* Inline AI privacy banner — slimmer, less shouty */
    /* Body — message bubbles */
    /* Footer — input + send */
    /* Message footer — input + send button. Sized explicitly so we don't
       rely on flex's behavior with textareas (which have intrinsic widths
       from their cols attribute that can override flex shrink). */
    /* Empty state in main */

    /* ── CONNECTIONS ── */

    /* ── GOALS ── */
    .goals-layout{flex:1;overflow-y:auto;padding:40px 52px;}
    .goals-header{display:flex;align-items:flex-start;justify-content:space-between;margin-bottom:28px;}
    .goals-title-block .goals-label{font-size:11px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:var(--fire);margin-bottom:8px;}
    .goals-title-block h1{font-size:26px;font-weight:700;}
    .goals-add-btn{padding:9px 18px;background:var(--accent);color:white;border:none;border-radius:7px;font-family:inherit;font-size:13px;font-weight:700;cursor:pointer;white-space:nowrap;}
    .goals-add-btn:hover{background:var(--accent-dark);}
    .goals-body{display:grid;grid-template-columns:1fr 280px;gap:20px;align-items:start;}
    .goals-list-card{border:1px solid var(--border);border-radius:10px;overflow:hidden;}
    .goal-row{display:flex;align-items:center;gap:12px;padding:16px 18px;border-bottom:1px solid var(--border);background:#fff;}
    .goal-row:last-child{border-bottom:none;}
    .goal-emoji{font-size:20px;flex-shrink:0;}
    .goal-info{flex:1;min-width:0;}
    .goal-name{font-size:14px;font-weight:600;margin-bottom:4px;}
    .goal-meta{font-size:11px;color:var(--muted);margin-bottom:8px;}
    .goal-bar-track{height:6px;background:var(--border);border-radius:3px;overflow:hidden;}
    .goal-bar-fill{height:100%;border-radius:3px;background:var(--accent);transition:width .3s;}
    .goal-pct{font-size:12px;font-weight:700;color:var(--accent);margin-left:10px;flex-shrink:0;}
    .goal-update-btn{font-size:11px;padding:3px 10px;border:1px solid var(--border);border-radius:4px;cursor:pointer;background:#fff;font-family:inherit;margin-top:6px;}
    .goal-del-btn{background:none;border:none;font-size:18px;color:var(--muted);cursor:pointer;flex-shrink:0;padding:2px 4px;}
    .goal-del-btn:hover{color:var(--danger);}
    .goal-add-row{display:flex;align-items:center;gap:8px;padding:14px 18px;border-top:1px solid var(--border);background:var(--surface);}
    .goal-add-row input{flex:1;border:1px solid var(--border);border-radius:6px;padding:8px 10px;font-family:inherit;font-size:13px;outline:none;}
    .goal-add-row input:focus{border-color:var(--accent);}
    .goal-add-row button{padding:8px 14px;background:var(--accent);color:white;border:none;border-radius:6px;font-family:inherit;font-size:12px;font-weight:600;cursor:pointer;}
    .goals-empty{padding:40px;text-align:center;color:var(--muted);font-size:13px;}
    /* Streak card */
    .streak-card{border:1px solid var(--border);border-radius:10px;padding:24px;text-align:center;}
    .streak-num{font-size:48px;font-weight:700;color:var(--fire);line-height:1;}
    .streak-label{font-size:11px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:var(--muted);margin-top:4px;margin-bottom:20px;}
    .streak-days{display:flex;gap:6px;justify-content:center;}
    .streak-day{display:flex;flex-direction:column;align-items:center;gap:4px;}
    .streak-day-circle{width:32px;height:32px;border-radius:50%;border:2px solid var(--border);display:flex;align-items:center;justify-content:center;font-size:12px;color:var(--muted);}
    .streak-day-circle.done{border-color:var(--accent);background:var(--accent-light);color:var(--accent);}
    .streak-day-circle.today{border-color:var(--fire);background:#fff7ed;color:var(--fire);}
    .streak-day-name{font-size:10px;color:var(--muted);}

    /* ── DAILY PRACTICE ── */
    /* Card pull area */
    @keyframes card-pulse{0%,100%{transform:scale(1)}50%{transform:scale(1.02)}}
    /* Today one thing */

    /* DATE | GOAL | MET | EDIT — one row per day, compact and table-like */
    @media (max-width:580px){
      .dp-ot-row{grid-template-columns:64px 1fr auto auto;gap:8px;}
      .dp-ot-met-btn,.dp-ot-edit{padding:3px 7px;font-size:10px;}
    }
    /* Past pulls */
    .tag-heart{background:#fce7f3;color:#be185d;}
    .tag-audience{background:#ede9fe;color:#6d28d9;}
    .tag-priorities{background:#e0f2fe;color:#0369a1;}
    .tag-income{background:#dcfce7;color:#166534;}
    details.dp-ot-month .dp-ot-month-heading::after{content:"▸";float:right;transition:transform .15s;}
    details.dp-ot-month[open] .dp-ot-month-heading::after{transform:rotate(90deg);}

    /* ── ASK RUSSELLBOT ── */
    /* ── AI ADVISING ── */
    /* ── ADVISING VIEW ───────────────────────────────────────────────────────── */
    /* Roster */
    .advisor-roster{flex:1;overflow-y:auto;padding:16px;}
    .advisor-roster-title{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.08em;color:var(--muted);margin:0 4px 10px;}
    .advisor-card{display:flex;align-items:center;gap:12px;padding:12px 14px;border-radius:10px;border:1px solid var(--border);margin-bottom:8px;cursor:pointer;background:#fff;transition:all .15s;}
    .advisor-card:hover{border-color:var(--accent);background:var(--accent-light);}
    .advisor-card.active{border-color:var(--accent);background:var(--accent-light);}
    .advisor-card.advisor-recommended{border-color:var(--accent);border-width:2px;background:var(--accent-light);}

    /* ── Advisor list — messaging-app contacts style, not a marketplace ────── */
    .coach-roster{padding:0;}
    .coach-intro{padding:18px 18px 14px;border-bottom:1px solid var(--border);}
    .coach-intro-title{font-size:17px;font-weight:800;color:var(--text);margin-bottom:4px;}
    .coach-intro-sub{font-size:13px;color:var(--muted);line-height:1.5;}
    .coach-section-label{font-size:11px;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);padding:14px 18px 8px;}
    .coach-list{display:flex;flex-direction:column;}
    .coach-row{display:flex;align-items:center;gap:14px;padding:14px 18px;border-bottom:1px solid var(--border);cursor:pointer;transition:background .12s;background:#fff;}
    .coach-row:hover{background:var(--surface);}
    .coach-row:last-child{border-bottom:none;}
    .coach-row.coach-recommended{background:linear-gradient(90deg,var(--accent-light) 0%,#fff 60%);}
    .coach-row-avatar{flex-shrink:0;width:48px;height:48px;border-radius:50%;background:var(--accent-light);border:2px solid var(--accent);display:flex;align-items:center;justify-content:center;font-size:22px;color:var(--accent);overflow:hidden;position:relative;}
    .coach-row-avatar img{width:100%;height:100%;border-radius:50%;object-fit:cover;}
    .coach-row-ai-dot{position:absolute;bottom:-1px;right:-1px;background:var(--accent);color:#fff;font-size:8px;font-weight:800;padding:1px 4px;border-radius:3px;letter-spacing:.04em;border:1.5px solid #fff;}
    .coach-row-body{flex:1;min-width:0;}
    .coach-row-line1{display:flex;align-items:baseline;justify-content:space-between;gap:8px;margin-bottom:2px;}
    .coach-row-name{font-size:15px;font-weight:700;color:var(--text);line-height:1.2;}
    .coach-row-recommended-tag{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.04em;color:var(--accent);flex-shrink:0;}
    .coach-row-specialty{font-size:13px;color:var(--muted);line-height:1.4;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;}
    .coach-row-chevron{flex-shrink:0;color:var(--muted);font-size:18px;line-height:1;}
    .coach-love-btn{flex-shrink:0;width:36px;height:36px;display:flex;align-items:center;justify-content:center;background:transparent;border:none;border-radius:50%;cursor:pointer;font-size:18px;line-height:1;padding:0;transition:transform .12s, background-color .12s;}
    .coach-love-btn:hover{background:#fef3f3;transform:scale(1.08);}
    .coach-love-btn.loved{filter:none;}
    .coach-love-btn.pop{animation:lovePop .35s ease-out;}
    @keyframes lovePop{0%{transform:scale(1);}40%{transform:scale(1.4);}70%{transform:scale(.92);}100%{transform:scale(1);}}
    .advisor-match-badge{font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.06em;padding:2px 7px;border-radius:999px;background:var(--accent);color:white;}
    .advisor-avatar-wrap{position:relative;flex-shrink:0;}
    .advisor-avatar{width:44px;height:44px;border-radius:50%;background:var(--accent-light);border:2px solid var(--accent);display:flex;align-items:center;justify-content:center;font-size:22px;}
    .advisor-ai-badge{position:absolute;bottom:-2px;right:-2px;background:var(--accent);color:white;font-size:8px;font-weight:800;padding:1px 4px;border-radius:4px;letter-spacing:.04em;border:1.5px solid #fff;}
    .advisor-info{flex:1;min-width:0;}
    .advisor-name{font-size:14px;font-weight:700;color:var(--text);}
    .advisor-specialty{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.06em;color:var(--accent);margin-bottom:2px;}
    .advisor-tagline{font-size:12px;color:var(--muted);font-style:italic;}
    .advisor-arrow{color:var(--muted);font-size:16px;flex-shrink:0;}
    /* Chat */
    .advisor-chat{flex:1;display:flex;flex-direction:column;overflow:hidden;}
    .advisor-chat-header{padding:10px 16px;border-bottom:1px solid var(--border);display:flex;align-items:center;gap:10px;flex-shrink:0;}
    .advisor-back{background:none;border:none;cursor:pointer;color:var(--muted);font-size:18px;padding:2px 6px;border-radius:6px;transition:background .12s;}
    .advisor-back:hover{background:var(--surface);}
    .advisor-header-avatar{width:32px;height:32px;border-radius:50%;background:var(--accent-light);border:1.5px solid var(--accent);display:flex;align-items:center;justify-content:center;font-size:16px;flex-shrink:0;}
    .advisor-header-info{flex:1;}
    .advisor-header-name{font-size:14px;font-weight:700;}
    .advisor-header-sub{font-size:11px;color:var(--muted);}
    .advisor-header-actions{display:flex;gap:6px;}
    .advisor-action-btn{padding:5px 10px;border-radius:6px;border:1px solid var(--border);background:#fff;font-size:11px;font-weight:600;cursor:pointer;color:var(--text);font-family:inherit;transition:all .12s;white-space:nowrap;}
    .advisor-action-btn:hover{border-color:var(--accent);color:var(--accent);background:var(--accent-light);}
    .advisor-action-btn.primary{background:var(--accent);color:white;border-color:var(--accent);}
    .advisor-action-btn.primary:hover{background:#0b7a6e;}
    @keyframes typing-bounce{0%,60%,100%{transform:translateY(0)}30%{transform:translateY(-6px)}}
    @keyframes spin{to{transform:rotate(360deg);}}

    /* PROFILE PANEL */
    #avatar-upload{display:none;}

    /* MODALS */
    .modal-overlay{position:fixed;inset:0;background:rgba(0,0,0,.4);display:flex;align-items:center;justify-content:center;z-index:200;opacity:0;pointer-events:none;transition:opacity .2s;}
    .modal-overlay.open{opacity:1;pointer-events:all;}
    .modal{background:#fff;border-radius:14px;padding:28px;width:420px;max-width:92vw;box-shadow:0 20px 60px rgba(0,0,0,.15);}
    .modal h2{font-size:18px;font-weight:700;margin-bottom:4px;}
    .modal p{font-size:13px;color:var(--muted);margin-bottom:20px;line-height:1.5;}
    .modal textarea{width:100%;border:1px solid var(--border);border-radius:7px;padding:10px 12px;font-family:inherit;font-size:13px;resize:none;height:80px;outline:none;margin-bottom:14px;}
    .modal textarea:focus{border-color:var(--accent);}
    .modal-actions{display:flex;gap:8px;justify-content:flex-end;}
    .modal-cancel{padding:8px 16px;border:1px solid var(--border);border-radius:7px;background:#fff;font-family:inherit;font-size:13px;cursor:pointer;}
    .modal-submit{padding:8px 18px;background:var(--accent);color:white;border:none;border-radius:7px;font-family:inherit;font-size:13px;font-weight:600;cursor:pointer;}
    /* Goal modal */
    .goal-modal-fields{display:flex;flex-direction:column;gap:12px;margin-bottom:16px;}
    .goal-modal-label{font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);margin-bottom:4px;}
    .goal-modal-input{width:100%;padding:9px 12px;border:1px solid var(--border);border-radius:7px;font-family:inherit;font-size:13px;outline:none;}
    .goal-modal-input:focus{border-color:var(--accent);}
    .goal-emojis{display:flex;gap:8px;flex-wrap:wrap;}
    .goal-emoji-btn{font-size:22px;padding:6px;border-radius:6px;border:2px solid transparent;cursor:pointer;background:none;transition:border-color .1s;}
    .goal-emoji-btn.selected{border-color:var(--accent);background:var(--accent-light);}

    /* APP LOADING */
    .app-loading{position:fixed;inset:0;background:#fff;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:14px;z-index:300;transition:opacity .3s;}
    .app-loading img{height:32px;}
    .app-spinner{width:26px;height:26px;border:3px solid var(--border);border-top-color:var(--accent);border-radius:50%;animation:spin .8s linear infinite;}

    /* TOGGLE */
    .toggle-row{display:flex;align-items:center;justify-content:space-between;padding:12px 0;border-top:1px solid var(--border);}
    .toggle-info{}
    .toggle-label{font-size:13px;font-weight:600;color:var(--text);}
    .toggle-sub{font-size:11px;color:var(--muted);margin-top:2px;}
    .toggle-switch{position:relative;width:44px;height:24px;flex-shrink:0;}
    .toggle-switch input{opacity:0;width:0;height:0;}
    .toggle-track{position:absolute;inset:0;background:var(--border);border-radius:999px;cursor:pointer;transition:background .2s;}
    .toggle-switch input:checked+.toggle-track{background:var(--accent);}
    .toggle-thumb{position:absolute;top:3px;left:3px;width:18px;height:18px;background:white;border-radius:50%;transition:transform .2s;pointer-events:none;}
    .toggle-switch input:checked~.toggle-thumb{transform:translateX(20px);}
    /* SYSTEM QUESTION MESSAGES */
    /* COHORT WIN GOAL */
    /* BADGES + NUDGES */
    /* NUDGE */
    .nudge-card{background:#fff7ed;border:1px solid #fed7aa;border-radius:10px;padding:12px 14px;margin-bottom:8px;display:flex;align-items:center;gap:10px;}
    .nudge-icon{font-size:18px;flex-shrink:0;}
    .nudge-text{font-size:12px;color:#92400e;line-height:1.5;flex:1;}
    .nudge-text strong{color:#78350f;}
    .nudge-btn{padding:6px 12px;background:#f59e0b;color:white;border:none;border-radius:6px;font-family:"DM Sans",sans-serif;font-size:11px;font-weight:600;cursor:pointer;white-space:nowrap;}
    /* JOURNAL */
    /* WIN CELEBRATION */
    .win-celebration{position:fixed;inset:0;background:rgba(0,0,0,.5);display:flex;align-items:center;justify-content:center;z-index:500;opacity:0;pointer-events:none;transition:opacity .3s;}
    .win-celebration.show{opacity:1;pointer-events:all;}
    .win-card{background:#fff;border-radius:16px;padding:32px;max-width:400px;width:90%;text-align:center;}
    .win-emoji{font-size:52px;margin-bottom:16px;display:block;}
    .win-title{font-size:22px;font-weight:700;margin-bottom:8px;}
    .win-sub{font-size:14px;color:var(--muted);line-height:1.6;margin-bottom:24px;}
    .win-share-btn{width:100%;padding:12px;background:var(--accent);color:white;border:none;border-radius:8px;font-family:"DM Sans",sans-serif;font-size:14px;font-weight:700;cursor:pointer;margin-bottom:8px;}
    .win-dismiss{font-size:13px;color:var(--muted);cursor:pointer;border:none;background:none;font-family:"DM Sans",sans-serif;}
    /* MONTHLY RECAP */
    /* PENDING BADGES */
    /* RECAP APP-OPEN CARD */
    /* DAILY PRACTICE RECAP BANNER */
    /* RECAP SHARE CARD */
    /* YOUR STORY — monthly recap history in profile */
    /* MY JOURNEY */
    .journey-section{display:flex;flex-direction:column;gap:12px;margin-bottom:16px;}
    .journey-card{background:#fff;border:1px solid var(--border);border-radius:12px;overflow:hidden;transition:box-shadow .15s;cursor:pointer;}
    .journey-card:hover{box-shadow:0 2px 16px rgba(0,0,0,.08);}
    .journey-card-header{padding:14px 16px;display:flex;align-items:center;gap:12px;border-bottom:1px solid var(--border);}
    .journey-card-icon{width:36px;height:36px;border-radius:50%;border:2px solid var(--accent-light);overflow:hidden;flex-shrink:0;}
    .journey-card-icon img{width:100%;height:100%;object-fit:cover;}
    .journey-card-title{font-size:16px;font-weight:700;color:var(--text);}
    .journey-card-sub{font-size:11px;color:var(--muted);margin-top:1px;}
    .journey-card-month{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.08em;color:var(--accent);margin-left:auto;flex-shrink:0;}
    .journey-card-body{padding:14px 16px;}
    .journey-card-recap{font-size:13px;color:var(--text);line-height:1.7;margin-bottom:12px;}
    .journey-card-win{display:flex;align-items:center;gap:8px;padding:8px 12px;background:var(--surface);border-radius:7px;margin-bottom:10px;}
    .journey-card-win-label{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);}
    .journey-card-win-text{font-size:12px;color:var(--text);font-weight:500;}
    .journey-card-win-pct{font-size:13px;font-weight:700;color:var(--accent);margin-left:auto;}
    .journey-card-badges{display:flex;flex-direction:column;gap:6px;}
    .journey-badge-row{display:flex;align-items:flex-start;gap:8px;padding:7px 10px;background:var(--surface);border-radius:7px;}
    .journey-badge-emoji{font-size:16px;flex-shrink:0;}
    .journey-badge-info{flex:1;min-width:0;}
    .journey-badge-name{font-size:11px;font-weight:600;color:var(--text);}
    .journey-badge-reason{font-size:10px;color:var(--muted);margin-top:1px;}
    .journey-badge-from{font-size:10px;color:var(--accent);margin-top:1px;}
    .journey-card-footer{padding:10px 16px;border-top:1px solid var(--border);display:flex;justify-content:flex-end;}
    .journey-share-btn{font-size:11px;font-weight:600;padding:5px 12px;border-radius:6px;border:1px solid var(--accent);color:var(--accent);background:#fff;cursor:pointer;font-family:"DM Sans",sans-serif;}
    .journey-share-btn:hover{background:var(--accent);color:white;}
    .journey-empty{text-align:center;padding:32px;color:var(--muted);font-size:13px;}
    /* COMMUNITY SWITCHER */
    .switcher-btn{position:relative;display:flex;align-items:center;gap:6px;padding:5px 10px;border:1px solid var(--border);border-radius:8px;background:#fff;cursor:pointer;font-family:inherit;font-size:12px;font-weight:600;color:var(--text);transition:all .15s;}
    .switcher-btn:hover{border-color:var(--accent);color:var(--accent);}
    .switcher-dot{width:7px;height:7px;border-radius:50%;background:var(--accent);flex-shrink:0;}
    .switcher-dropdown{position:absolute;top:calc(100% + 8px);right:0;background:#fff;border:1px solid var(--border);border-radius:10px;box-shadow:0 8px 24px rgba(0,0,0,.12);min-width:200px;padding:6px;z-index:200;display:none;flex-direction:column;gap:2px;}
    .switcher-dropdown.open{display:flex;}
    .switcher-item{display:flex;align-items:center;gap:10px;padding:9px 12px;border-radius:7px;cursor:pointer;font-size:13px;font-weight:500;color:var(--text);text-decoration:none;border:none;background:none;font-family:inherit;width:100%;text-align:left;transition:background .12s;}
    .switcher-item:hover{background:var(--surface);}
    .switcher-item.current{color:var(--accent);background:var(--accent-light);}
    .switcher-item-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0;}
    .switcher-item-name{flex:1;}

    /* TOAST */'

    @keyframes confetti-fall{to{transform:translateY(110vh) rotate(720deg);opacity:0;}}
    .toast{position:fixed;bottom:20px;left:50%;transform:translateX(-50%);background:#1a1a1a;color:#fff;padding:10px 18px;border-radius:8px;font-size:13px;font-weight:500;opacity:0;pointer-events:none;transition:opacity .2s;z-index:999;white-space:nowrap;}
    .toast.show{opacity:1;}

    .show-mobile { display: none; }

    /* Hamburger */
    .hamburger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 6px; border-radius: 6px; flex-shrink: 0; }
    @media (orientation: portrait), (max-width: 768px) { .hamburger { display: flex !important; } .nav-desktop-links { display: none !important; } }
    .hamburger span { display: block; width: 20px; height: 2px; background: var(--text); border-radius: 2px; transition: all .2s; }
    .hamburger:hover { background: var(--surface); }
    /* Mobile menu */
    .mobile-menu { position: fixed; top: 0; right: -280px; width: 280px; height: 100vh; background: #fff; box-shadow: -4px 0 24px rgba(0,0,0,.12); z-index: 300; display: flex; flex-direction: column; padding: 60px 0 20px; transition: right .25s ease; overflow-y: auto; }
    .mobile-menu.open { right: 0; }
    .mobile-menu-item { display: flex; align-items: center; gap: 12px; padding: 14px 24px; font-size: 15px; font-weight: 500; color: var(--text); background: none; border: none; cursor: pointer; font-family: inherit; text-align: left; text-decoration: none; transition: background .12s; width: 100%; }
    .mobile-menu-item:hover { background: var(--surface); }
    .mobile-menu-sep { height: 1px; background: var(--border); margin: 6px 0; }
    .mobile-menu-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.3); z-index: 299; display: none; }
    .mobile-menu-overlay.open { display: block; }
    /* ── MOBILE ── */
    @media (max-width: 768px) {
      /* Nav */
      .nav { padding: 0 14px; height: 52px; }
      .nav-logo { height: 22px; }
      .nav-desktop-links { display: none !important; }
      .hamburger { display: flex !important; }
      .nav-icon { display: none; }
      .nav-right { gap: 6px; }
      #nav-streak-pill { padding: 4px 10px; font-size: 12px; }

      /* Messages — full-screen single-pane on mobile (like iMessage/Slack)
         Use dvh so the keyboard opening doesn't push the input below the
         visible area. 100vh on iOS Safari = full viewport including the
         area covered by the keyboard, which leaves the send button hidden. */
      .msg-layout { flex-direction: column; height: calc(100vh - 52px); height: calc(100dvh - 52px); position: relative; }
      .msg-sidebar { width: 100%; height: 100%; border-right: none; border-bottom: none; flex-shrink: 0; }
      .msg-sidebar-header { padding: 14px 16px 10px; }
      .msg-sidebar-title { font-size: 17px; }
      .msg-rooms { flex: 1; max-height: none; overflow-y: auto; }
      /* When a room is open, the main pane covers the whole screen */
      .msg-main { position: absolute; inset: 0; z-index: 5; transform: translateX(100%); transition: transform .25s ease; display: flex; flex-direction: column; }
      .msg-layout.show-main .msg-main { transform: translateX(0); }
      .msg-layout.show-main .msg-sidebar { display: none; }
      .msg-header-back { display: flex; }
      .msg-body { flex: 1; padding: 14px; gap: 6px; min-height: 0; overflow-y: auto; }
      .msg-footer { padding: 10px 12px; gap: 8px; }
      /* font-size 16px prevents iOS Safari from auto-zooming on focus,
         which would shift the layout and push the send button out of view */
      .msg-input { font-size: 16px; min-height: 40px; }
      .msg-bubble-wrap { max-width: 85%; }
      .msg-bubble { font-size: 14px; padding: 9px 13px; }
      .msg-header { padding: 10px 14px; gap: 10px; }
      .msg-header-name { font-size: 15px; }
      .msg-header-actions { gap: 4px; }

      /* Connections */
      .conn-layout { padding: 24px 16px; }
      .conn-title { font-size: 20px; }
      .conn-toolbar { flex-direction: column; align-items: stretch; gap: 10px; }
      .conn-search { max-width: 100%; margin-left: 0; }
      .conn-grid { grid-template-columns: 1fr; }

      /* Goals */
      .goals-layout { padding: 24px 16px; }
      .goals-header { flex-direction: column; gap: 12px; align-items: stretch; }
      .goals-add-btn { width: 100%; }
      .goals-body { grid-template-columns: 1fr; }
      .streak-card { padding: 16px; }
      .streak-num { font-size: 36px; }

      /* Daily Practice */
      .dp-layout { padding: 20px 16px; }
      .dp-topbar { flex-direction: column; align-items: flex-start; gap: 8px; }
      .dp-pull-inner { flex-direction: column; align-items: center; gap: 16px; }
      .dp-card-back, .dp-card-img { width: 140px; height: 245px; }
      .dp-card-content { width: 100%; }
      .dp-hapi-tabs { flex-wrap: wrap; }

      /* Profile panel */
      .profile-panel { width: 100%; right: -100%; }
      .profile-panel.open { right: 0; }

      /* Modals */
      .modal { width: 95vw; padding: 20px; }

      /* Goals body on mobile - single column */
      .goals-body { display: flex; flex-direction: column; gap: 16px; }

      /* Fire dropdown */
      .fire-dropdown { right: -60px; width: 180px; }
    }

    @media (max-width: 480px) {
      .nav-link span, .nav-link { font-size: 11px; padding: 4px 7px; }
      .conn-filters { gap: 4px; }
      .conn-filter { padding: 5px 10px; font-size: 11px; }
      .dp-card-back, .dp-card-img { width: 120px; height: 210px; }
    }
  
    /* ── TOGGLE SWITCH (replaces native checkbox) ──────────────────────── */
    input[type="checkbox"].switch,
    input[type="checkbox"][data-toggle] {
      appearance: none;
      -webkit-appearance: none;
      width: 40px;
      height: 24px;
      background: #cbd5e1;
      border-radius: 12px;
      position: relative;
      cursor: pointer;
      transition: background 0.2s;
      flex-shrink: 0;
      margin: 0;
    }
    input[type="checkbox"].switch::before,
    input[type="checkbox"][data-toggle]::before {
      content: "";
      position: absolute;
      top: 2px; left: 2px;
      width: 20px; height: 20px;
      background: white;
      border-radius: 50%;
      transition: transform 0.2s;
      box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    }
    input[type="checkbox"].switch:checked,
    input[type="checkbox"][data-toggle]:checked {
      background: var(--accent);
    }
    input[type="checkbox"].switch:checked::before,
    input[type="checkbox"][data-toggle]:checked::before {
      transform: translateX(16px);
    }
    input[type="checkbox"].switch:disabled,
    input[type="checkbox"][data-toggle]:disabled {
      opacity: 0.5;
      cursor: not-allowed;
    }