    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

    :root {
      --acc: #2dd46e; --acc2: #1a8a50; --glow: rgba(45,212,110,0.35);
      --bg1: #061a0c; --bg2: #0d4a24; --bg3: #061a0c;
      --glass: rgba(255,255,255,0.07); --glass-b: rgba(255,255,255,0.13);
      --glass-h: rgba(255,255,255,0.12);
      --text: #f0fff4; --muted: rgba(240,255,244,0.55);
      --checked: rgba(45,212,110,0.15); --current: rgba(45,212,110,0.2);
      --r: 14px; --r-sm: 10px;
      --trans: all 0.28s cubic-bezier(.4,0,.2,1);
    }
    body.degen {
      --acc: #c800ff; --acc2: #7a00aa; --glow: rgba(200,0,255,0.35);
      --bg1: #060008; --bg2: #180028; --bg3: #060008;
      --glass: rgba(100,0,160,0.1); --glass-b: rgba(200,0,255,0.18);
      --glass-h: rgba(100,0,160,0.2);
      --text: #eedeff; --muted: rgba(220,190,255,0.55);
      --checked: rgba(200,0,255,0.14); --current: rgba(200,0,255,0.2);
    }
    body.elder {
      --acc: #f59e0b; --acc2: #d97706; --glow: rgba(245,158,11,0.28);
      --bg1: #141210; --bg2: #231c10; --bg3: #141210;
      --glass: rgba(255,255,255,0.08); --glass-b: rgba(255,255,255,0.16);
      --glass-h: rgba(255,255,255,0.14);
      --text: #fef9ee; --muted: rgba(254,249,238,0.58);
      --checked: rgba(245,158,11,0.14); --current: rgba(245,158,11,0.2);
      animation: none;
    }
    body.elder #particles { display: none; }
    body.elder .ptcl { display: none; }
    body.elder .degen-label { animation: none; }
    body.elder .t-now { animation: none; }
    /* Larger text for readability */
    body.elder .hub-title   { font-size: clamp(2.2rem, 6vw, 3.4rem); }
    body.elder .hub-sub     { font-size: 1rem; }
    body.elder .stat-pill   { font-size: .98rem; padding: 7px 18px; }
    body.elder .sec-label   { font-size: .86rem; }
    body.elder .card-title  { font-size: 1.1rem; }
    body.elder .card-desc   { font-size: .9rem; }
    body.elder .card-pct    { font-size: .9rem; }
    body.elder .goal-card   { padding: 22px; gap: 16px; }
    body.elder .ring-wrap, body.elder .ring-wrap svg { width: 62px; height: 62px; }
    body.elder .ring-icon   { font-size: 1.6rem; }
    body.elder .sch-title   { font-size: clamp(1.65rem, 4.5vw, 2.2rem); }
    body.elder .sch-subtitle { font-size: .96rem; }
    body.elder .sch-stat    { font-size: .92rem; }
    body.elder .t-text      { font-size: 1rem; line-height: 1.65; }
    body.elder .t-time      { font-size: .88rem; }
    body.elder .t-why       { font-size: .86rem; }
    body.elder .task-card   { padding: 16px; gap: 14px; }
    body.elder .t-check     { width: 28px; height: 28px; }
    body.elder .dn-label    { font-size: 1rem; }
    body.elder .dn-btn      { font-size: .95rem; padding: 8px 16px; }
    body.elder .xp-meta     { font-size: .88rem; }
    body.elder .notif-item-name { font-size: 1rem; }
    body.elder #toast       { color: #000; }

    html { min-height: 100%; scroll-behavior: smooth; }
    body {
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
      background: linear-gradient(135deg, var(--bg1), var(--bg2), var(--bg3));
      background-size: 400% 400%;
      animation: gradShift 18s ease infinite;
      color: var(--text);
      min-height: 100vh;
      overflow-x: hidden;
    }
    @keyframes gradShift {
      0%,100% { background-position: 0% 50%; }
      50%      { background-position: 100% 50%; }
    }

    #particles { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
    .ptcl {
      position: absolute; pointer-events: none; user-select: none;
      animation: floatUp linear forwards;
    }
    @keyframes floatUp {
      0%   { transform: translateY(0) rotate(0deg); opacity: 0; }
      8%   { opacity: .55; }
      92%  { opacity: .55; }
      100% { transform: translateY(-130vh) rotate(520deg); opacity: 0; }
    }

    #app { position: relative; z-index: 1; }
    .view { display: none; }
    .view.active { display: block; animation: fadeIn .3s ease; }
    @keyframes fadeIn {
      from { opacity: 0; transform: translateY(10px); }
      to   { opacity: 1; transform: translateY(0); }
    }

    /* ── HUB ── */
    #hub { max-width: 880px; margin: 0 auto; padding: 32px 20px 80px; }

    .mode-toggle { display: flex; justify-content: center; margin-bottom: 28px; }
    .mode-btn {
      background: var(--glass); border: 1px solid var(--glass-b); color: var(--muted);
      padding: 9px 22px; font-size: .84rem; font-weight: 600; letter-spacing: .5px;
      cursor: pointer; transition: var(--trans); backdrop-filter: blur(8px);
    }
    .mode-btn:first-child { border-radius: 22px 0 0 22px; border-right: none; }
    .mode-btn:last-child  { border-radius: 0 22px 22px 0; }
    .mode-btn.active { background: var(--acc); color: #000; border-color: var(--acc); box-shadow: 0 0 16px var(--glow); }
    body.degen .mode-btn.active { color: #fff; }

    .guest-banner {
      display: flex; align-items: center; justify-content: space-between; gap: 12px;
      background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1);
      border-radius: 10px; padding: 11px 16px; margin-bottom: 20px;
      font-size: .8rem; color: var(--muted);
    }
    .guest-banner-btn {
      flex-shrink: 0; padding: 6px 14px; background: var(--acc); color: #000;
      border: none; border-radius: 8px; font-size: .78rem; font-weight: 800;
      cursor: pointer; transition: var(--trans);
    }
    .guest-banner-btn:hover { filter: brightness(1.1); }
    body.degen .guest-banner-btn { color: #fff; }

    .hub-header { text-align: center; margin-bottom: 36px; }
    .hub-title {
      font-size: clamp(1.8rem, 5vw, 2.8rem); font-weight: 900; letter-spacing: 1px;
      text-shadow: 0 0 50px var(--glow), 0 2px 12px rgba(0,0,0,.4);
      margin-bottom: 6px;
    }
    .hub-sub { color: var(--muted); font-size: .88rem; font-style: italic; margin-bottom: 22px; }
    .stats-row { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
    .stat-pill {
      background: var(--glass); border: 1px solid var(--glass-b); border-radius: 20px;
      padding: 5px 14px; font-size: .82rem; font-weight: 600; backdrop-filter: blur(8px);
      display: flex; align-items: center; gap: 5px;
    }
    .stat-pill .lbl { color: var(--muted); font-weight: 400; }
    .stat-pill-lvl { cursor: pointer; transition: var(--trans); }
    .stat-pill-lvl:hover { border-color: var(--acc); box-shadow: 0 0 10px var(--glow); }

    .lvl-list { display: flex; flex-direction: column; gap: 8px; }
    .lvl-row {
      display: flex; align-items: center; gap: 12px;
      padding: 11px 14px; border-radius: 10px;
      background: var(--glass); border: 1px solid var(--glass-b);
      opacity: .45;
    }
    .lvl-row.lvl-done { opacity: .75; }
    .lvl-row.lvl-cur {
      opacity: 1; border-color: var(--acc);
      background: var(--checked); box-shadow: 0 0 14px var(--glow);
    }
    .lvl-num { width: 20px; font-size: .76rem; font-weight: 800; color: var(--muted); flex-shrink: 0; text-align: center; }
    .lvl-info { flex: 1; }
    .lvl-name { font-size: .9rem; font-weight: 700; }
    .lvl-xp { font-size: .72rem; color: var(--muted); margin-top: 2px; }
    .lvl-badge { font-size: .72rem; font-weight: 800; color: var(--acc); flex-shrink: 0; }
    .lvl-badge-done { color: var(--muted); }

    .xp-wrap { max-width: 380px; margin: 10px auto 0; }
    .xp-meta { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted); margin-bottom: 5px; }
    .xp-track { height: 7px; background: var(--glass); border-radius: 4px; overflow: hidden; border: 1px solid var(--glass-b); }
    .xp-fill  { height: 100%; background: linear-gradient(90deg, var(--acc2), var(--acc)); border-radius: 4px; transition: width .7s ease; box-shadow: 0 0 8px var(--glow); }

    .sec-label { font-size: .72rem; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; padding-left: 2px; }

    .goal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px,1fr)); gap: 14px; margin-bottom: 14px; }

    .goal-card {
      background: var(--glass); border: 1px solid var(--glass-b); border-radius: var(--r);
      padding: 18px; cursor: pointer; transition: var(--trans); backdrop-filter: blur(12px);
      display: flex; align-items: center; gap: 14px;
    }
    .goal-card:hover {
      background: var(--glass-h); border-color: var(--acc);
      transform: translateY(-3px); box-shadow: 0 8px 32px rgba(0,0,0,.3), 0 0 20px var(--glow);
    }

    .ring-wrap { flex-shrink: 0; position: relative; width: 54px; height: 54px; }
    .ring-wrap svg { width: 54px; height: 54px; transform: rotate(-90deg); }
    .r-track { fill: none; stroke: rgba(255,255,255,.1); stroke-width: 5; }
    .r-fill  { fill: none; stroke: var(--acc); stroke-width: 5; stroke-linecap: round; transition: stroke-dashoffset .8s ease; filter: drop-shadow(0 0 3px var(--acc)); }
    .ring-icon { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; }

    .card-info { flex: 1; min-width: 0; }
    .card-title { font-size: .96rem; font-weight: 700; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .card-desc  { font-size: .76rem; color: var(--muted); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: calc(1.4em * 2); }
    .card-pct   { font-size: .76rem; font-weight: 700; color: var(--acc); margin-top: 5px; }

    .degen-div { text-align: center; margin: 8px 0 28px; position: relative; }
    .degen-div::before { content:''; position:absolute; top:50%; left:0; right:0; height:1px; background: linear-gradient(90deg,transparent,var(--glass-b),transparent); }
    .degen-label {
      position: relative; display: inline-block; padding: 0 18px;
      font-size: 1.2rem; font-weight: 900; letter-spacing: 5px; text-transform: uppercase;
      color: #c800ff; text-shadow: 0 0 8px #c800ff, 0 0 24px #7a00aa;
      animation: flicker 5s infinite;
    }
    body.degen .degen-label { color: var(--acc); text-shadow: 0 0 12px var(--glow); }
    @keyframes flicker { 0%,95%,100%{opacity:1} 96%{opacity:.6} 97%{opacity:1} 98%{opacity:.3} 99%{opacity:1} }

    /* ── SCHEDULE VIEW ── */
    #sch-view-inner { max-width: 720px; margin: 0 auto; padding: 28px 20px 80px; }

    .sch-back {
      display: inline-flex; align-items: center; gap: 6px; background: none; border: none;
      color: var(--muted); font-size: .88rem; font-weight: 600; cursor: pointer;
      padding: 6px 0; margin-bottom: 22px; transition: color .2s;
    }
    .sch-back:hover { color: var(--acc); }

    .sch-head {
      display: flex; align-items: flex-start; gap: 20px; margin-bottom: 24px;
      padding: 22px; background: var(--glass); border: 1px solid var(--glass-b);
      border-radius: var(--r); backdrop-filter: blur(12px);
    }

    .sch-ring { flex-shrink: 0; position: relative; width: 88px; height: 88px; }
    .sch-ring svg { width: 88px; height: 88px; transform: rotate(-90deg); }
    .sch-ring-icon { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 2rem; }

    .sch-info { flex: 1; }
    .sch-title { font-size: clamp(1.4rem,4vw,1.9rem); font-weight: 900; margin-bottom: 4px; text-shadow: 0 0 30px var(--glow); }
    .sch-subtitle { color: var(--muted); font-size: .82rem; font-style: italic; margin-bottom: 12px; line-height: 1.45; }
    .sch-stats { display: flex; gap: 16px; flex-wrap: wrap; }
    .sch-stat { font-size: .8rem; font-weight: 700; color: var(--acc); }
    .sch-stat span { color: var(--muted); font-weight: 400; }

    .disclaimer {
      background: var(--glass); border: 1px solid var(--glass-b); border-left: 3px solid var(--acc);
      border-radius: var(--r-sm); padding: 13px 17px; margin-bottom: 18px;
      font-size: .86rem; color: var(--muted); line-height: 1.6; backdrop-filter: blur(8px);
    }

    /* ── DAY CHANGER (SPA) ── */
    .day-nav {
      display: flex; align-items: center; gap: 10px;
      background: var(--glass); border: 1px solid var(--glass-b);
      border-radius: var(--r-sm); padding: 10px 14px; margin-bottom: 16px;
      backdrop-filter: blur(8px);
    }
    .dn-btn {
      background: none; border: 1px solid var(--glass-b); color: var(--acc);
      padding: 6px 12px; border-radius: 8px; cursor: pointer; font-size: .85rem;
      transition: background .15s, color .15s; flex-shrink: 0; font-family: inherit;
    }
    .dn-btn:hover:not(:disabled) { background: var(--glass-h); color: var(--text); }
    .dn-btn:disabled { opacity: .3; cursor: not-allowed; }
    .dn-center { flex: 1; text-align: center; }
    .dn-label { font-size: .88rem; font-weight: 700; color: var(--text); margin-bottom: 5px; }
    .dn-bar-row { display: flex; align-items: center; gap: 8px; justify-content: center; }
    .dn-count { font-size: .76rem; color: var(--muted); white-space: nowrap; }
    .dn-track { flex: 1; max-width: 160px; height: 4px; background: rgba(255,255,255,.1); border-radius: 2px; overflow: hidden; }
    .dn-fill { height: 100%; background: var(--acc); border-radius: 2px; transition: width .35s ease; }

    .task-list { display: flex; flex-direction: column; gap: 7px; }

    .task-card {
      background: var(--glass); border: 1px solid var(--glass-b); border-radius: var(--r-sm);
      padding: 13px 15px; backdrop-filter: blur(8px);
      display: flex; gap: 12px; align-items: flex-start;
      position: relative; transition: var(--trans);
    }
    .task-card:hover { background: var(--glass-h); border-color: var(--acc); }
    .task-card.checked { background: var(--checked); border-color: var(--acc); opacity: .7; }
    .task-card.current {
      background: var(--current); border-color: var(--acc);
      box-shadow: 0 0 18px var(--glow);
    }
    .task-card.current::before {
      content: ''; position: absolute; left: 0; top: 0; bottom: 0;
      width: 3px; background: var(--acc); border-radius: 3px 0 0 3px; box-shadow: 0 0 8px var(--acc);
    }

    .tcol { flex-shrink: 0; width: 68px; }
    .t-time { font-size: .76rem; font-weight: 700; color: var(--acc); line-height: 1.2; }
    .t-now  { font-size: .62rem; font-weight: 700; color: var(--acc); margin-top: 2px; animation: pulse 2s infinite; letter-spacing: .3px; }
    @keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }

    .t-body { flex: 1; cursor: pointer; }
    .t-text { font-size: .88rem; line-height: 1.55; transition: opacity .2s; }
    .task-card.checked .t-text { text-decoration: line-through; opacity: .6; }
    .t-why {
      font-size: .76rem; color: #ff8c3a; font-style: italic; line-height: 1.45;
      margin-top: 7px; display: none;
      text-shadow: 0 0 8px rgba(255,120,0,.3);
    }
    .task-card.expanded .t-why { display: block; }
    .t-tap { font-size: .68rem; color: var(--muted); margin-top: 5px; opacity: 0; transition: opacity .2s; }
    .task-card:hover .t-tap { opacity: 1; }

    .t-check {
      flex-shrink: 0; width: 23px; height: 23px; border-radius: 50%;
      border: 2px solid var(--glass-b); background: var(--glass);
      display: flex; align-items: center; justify-content: center;
      transition: all .2s; cursor: pointer; margin-top: 1px;
    }
    .task-card.checked .t-check { background: var(--acc); border-color: var(--acc); box-shadow: 0 0 10px var(--glow); }
    .chk-icon { color: #000; font-size: .68rem; font-weight: 900; display: none; }
    .task-card.checked .chk-icon { display: block; }
    body.degen .chk-icon { color: #fff; }

    /* Toast */
    #toast {
      position: fixed; bottom: 26px; left: 50%;
      transform: translateX(-50%) translateY(200px);
      background: var(--acc); color: #000; padding: 9px 20px;
      border-radius: 22px; font-size: .86rem; font-weight: 700;
      transition: transform .4s cubic-bezier(.34,1.56,.64,1);
      z-index: 200; box-shadow: 0 4px 20px var(--glow);
      pointer-events: auto; white-space: nowrap; cursor: pointer;
    }
    #toast.toast-active { transform: translateX(-50%) translateY(calc(100% + 14px)); }
    #toast.show { transform: translateX(-50%) translateY(0); cursor: default; }
    #toast:not(.show) * { opacity: 0; }
    #toast.show * { opacity: 1; transition: opacity 0.15s 0.2s; }
    #toast.toast-ack { pointer-events: auto; display: flex; align-items: center; gap: 8px; white-space: nowrap; text-align: left; padding: 9px 20px; line-height: 1.5; border-radius: 16px; }
    #toast .toast-dismiss { background: rgba(0,0,0,0.2); border: none; color: inherit; font-size: .8rem; font-weight: 800; padding: 6px 14px; border-radius: 12px; cursor: pointer; flex-shrink: 0; }
    #toast .toast-dismiss:hover { background: rgba(0,0,0,0.35); }
    body.degen #toast { color: #fff; }

    @media (max-width: 560px) {
      .goal-grid { grid-template-columns: 1fr 1fr; }
      .sch-head { flex-direction: column; align-items: center; text-align: center; }
    }
    @media (max-width: 360px) {
      .goal-grid { grid-template-columns: 1fr; }
    }

    /* ── PROFILE BUTTON ── */
    #profile-btn {
      position: fixed; top: 16px; right: 16px; z-index: 50;
      width: 42px; height: 42px; border-radius: 50%;
      border: 2px solid var(--glass-b); background: var(--glass);
      display: flex; align-items: center; justify-content: center;
      cursor: pointer; font-size: .82rem; font-weight: 800;
      backdrop-filter: blur(10px); transition: var(--trans);
      box-shadow: 0 2px 14px rgba(0,0,0,.35); color: var(--muted);
      letter-spacing: -.5px;
    }
    #profile-btn:hover { border-color: var(--acc); box-shadow: 0 0 16px var(--glow); transform: scale(1.08); }

    /* ── DROPDOWN ── */
    .p-dropdown {
      position: fixed; top: 66px; right: 16px; z-index: 51;
      background: color-mix(in srgb, var(--bg2) 95%, transparent);
      border: 1px solid var(--glass-b); border-radius: var(--r);
      padding: 8px; min-width: 188px; backdrop-filter: blur(20px);
      box-shadow: 0 10px 40px rgba(0,0,0,.55); animation: fadeIn .15s ease;
    }
    .p-dd-name {
      padding: 8px 12px 10px; font-size: .88rem; font-weight: 700;
      color: var(--text); border-bottom: 1px solid var(--glass-b); margin-bottom: 6px;
    }
    .p-dd-item {
      display: flex; align-items: center; gap: 8px; padding: 8px 12px;
      border-radius: 8px; cursor: pointer; font-size: .83rem; color: var(--muted);
      transition: var(--trans);
    }
    .p-dd-item:hover { background: var(--glass-h); color: var(--text); }
    .p-dd-item.danger:hover { color: #ff5a5a; }

    /* ── MODAL OVERLAY ── */
    .modal-overlay {
      position: fixed; inset: 0; z-index: 100;
      background: rgba(0,0,0,.72); backdrop-filter: blur(7px);
      display: flex; align-items: center; justify-content: center;
      padding: 20px; animation: fadeIn .2s ease;
    }
    .modal {
      background: linear-gradient(145deg, var(--bg2), var(--bg1));
      border: 1px solid var(--glass-b); border-radius: 20px;
      padding: 36px 30px; max-width: 420px; width: 100%;
      box-shadow: 0 20px 60px rgba(0,0,0,.6), 0 0 40px var(--glow);
      position: relative; max-height: 90vh; overflow-y: auto;
    }
    .modal-close {
      position: absolute; top: 14px; right: 16px; background: none; border: none;
      color: var(--muted); font-size: 1.1rem; cursor: pointer; transition: color .2s; padding: 4px;
    }
    .modal-close:hover { color: var(--text); }
    .modal-icon  { font-size: 2.4rem; text-align: center; margin-bottom: 14px; }
    .modal-title { font-size: 1.45rem; font-weight: 900; text-align: center; margin-bottom: 6px; }
    .modal-sub   { font-size: .84rem; color: var(--muted); text-align: center; margin-bottom: 26px; line-height: 1.55; }
    .modal-input {
      width: 100%; padding: 12px 15px; background: var(--glass);
      border: 1px solid var(--glass-b); border-radius: 10px; color: var(--text);
      font-size: .95rem; outline: none; transition: border-color .2s, box-shadow .2s;
      margin-bottom: 12px;
    }
    .modal-input:focus { border-color: var(--acc); box-shadow: 0 0 0 3px var(--glow); }
    .modal-input::placeholder { color: var(--muted); }
    .modal-btn {
      width: 100%; padding: 13px; background: var(--acc); color: #000;
      font-size: .94rem; font-weight: 800; border: none; border-radius: 10px;
      cursor: pointer; transition: var(--trans); box-shadow: 0 4px 18px var(--glow);
    }
    .modal-btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
    body.degen .modal-btn { color: #fff; }
    .modal-btn-sec {
      width: 100%; padding: 11px; background: var(--glass); color: var(--text);
      font-size: .88rem; font-weight: 700; border: 1px solid var(--glass-b);
      border-radius: 10px; cursor: pointer; transition: var(--trans); margin-top: 8px;
    }
    .modal-btn-sec:hover { background: var(--glass-h); border-color: var(--acc); }
    .modal-btn-ghost {
      width: 100%; padding: 10px; background: none; color: var(--muted);
      font-size: .84rem; font-weight: 600; border: 1px dashed var(--glass-b);
      border-radius: 10px; cursor: pointer; transition: var(--trans); margin-top: 8px;
    }
    .modal-btn-ghost:hover { color: var(--text); border-color: var(--muted); }
    .modal-guest-note {
      font-size: .72rem; color: var(--muted); opacity: .6; text-align: center; margin-top: 6px;
    }
    .modal-divider {
      display: flex; align-items: center; gap: 12px;
      color: var(--muted); font-size: .76rem; margin: 18px 0;
    }
    .modal-divider::before, .modal-divider::after { content:''; flex:1; height:1px; background:var(--glass-b); }
    .profile-list { display: flex; flex-direction: column; gap: 8px; }
    .profile-item {
      display: flex; align-items: center; gap: 12px; padding: 10px 13px;
      background: var(--glass); border: 1px solid var(--glass-b); border-radius: 10px;
      cursor: pointer; transition: var(--trans);
    }
    .profile-item:hover { background: var(--glass-h); border-color: var(--acc); }
    .profile-item.active-profile { border-color: var(--acc); }
    .p-avatar {
      width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
      display: flex; align-items: center; justify-content: center;
      font-size: .82rem; font-weight: 800; color: #000;
    }
    .p-item-name { font-size: .88rem; font-weight: 700; }
    .p-item-meta { font-size: .72rem; color: var(--muted); margin-top: 1px; }
    .export-code {
      width: 100%; padding: 11px 13px; background: rgba(0,0,0,.35);
      border: 1px solid var(--glass-b); border-radius: 8px; color: var(--muted);
      font-family: monospace; font-size: .7rem; resize: none; height: 88px;
      outline: none; margin-bottom: 10px; line-break: anywhere;
    }
    .export-code:focus { border-color: var(--acc); }

    /* ── PROFILE PAGE ── */
    #profile-page { max-width: 620px; margin: 0 auto; padding: 28px 20px 80px; }

    .pf-hero {
      display: flex; flex-direction: column; align-items: center;
      padding: 32px 24px; margin-bottom: 24px;
      background: var(--glass); border: 1px solid var(--glass-b);
      border-radius: var(--r); backdrop-filter: blur(12px); text-align: center;
    }
    .pf-avatar-wrap { position: relative; margin-bottom: 16px; cursor: pointer; }
    .pf-avatar {
      width: 80px; height: 80px; border-radius: 50%;
      display: flex; align-items: center; justify-content: center;
      font-size: 1.8rem; font-weight: 900; color: #000;
      box-shadow: 0 0 24px var(--glow); transition: var(--trans);
    }
    .pf-avatar-wrap:hover .pf-avatar { transform: scale(1.06); }
    .pf-avatar-edit {
      position: absolute; bottom: 0; right: 0;
      width: 24px; height: 24px; border-radius: 50%;
      background: var(--acc); color: #000; font-size: .7rem;
      display: flex; align-items: center; justify-content: center;
      border: 2px solid var(--bg1); font-weight: 900;
    }
    .pf-name    { font-size: 1.5rem; font-weight: 900; margin-bottom: 4px; }
    .pf-since   { font-size: .78rem; color: var(--muted); }

    .pf-color-picker {
      display: flex; flex-direction: column; gap: 12px;
      margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--glass-b); width: 100%;
    }
    .pf-picker-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
    .pf-picker-label { font-size: .64rem; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); text-align: center; }
    .avatar-icon-wrap { position: relative; }
    .avatar-icon-btn {
      width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
      display: flex; align-items: center; justify-content: center;
      font-size: 1.5rem; background: var(--glass); border: 2px solid transparent;
      transition: var(--trans);
    }
    .avatar-icon-btn:hover { transform: scale(1.12); border-color: rgba(255,255,255,.2); }
    .avatar-icon-btn.active { border-color: #fff; box-shadow: 0 0 10px rgba(255,255,255,.4); transform: scale(1.1); }
    .avatar-icon-btn.locked { opacity: 0.25; cursor: not-allowed; filter: grayscale(1); }
    .avatar-icon-btn.locked:hover { transform: none; border-color: transparent; }
    .avatar-icon-tip {
      position: absolute; bottom: calc(100% + 7px); left: 50%; transform: translateX(-50%);
      background: rgba(5,10,15,0.95); color: rgba(255,255,255,0.88);
      font-size: .65rem; white-space: nowrap; padding: 5px 9px;
      border-radius: 7px; pointer-events: none;
      opacity: 0; transition: opacity .15s; z-index: 100;
      border: 1px solid var(--glass-b);
    }
    .avatar-icon-wrap:hover .avatar-icon-tip { opacity: 1; }
    .color-swatch {
      width: 28px; height: 28px; border-radius: 50%; cursor: pointer;
      transition: var(--trans); border: 2px solid transparent;
    }
    .color-swatch:hover  { transform: scale(1.2); }
    .color-swatch.active { border-color: #fff; box-shadow: 0 0 8px rgba(255,255,255,.5); transform: scale(1.15); }

    .pf-section { margin-bottom: 20px; overflow: visible; }
    .pf-section-label {
      font-size: .7rem; font-weight: 700; letter-spacing: 2px;
      text-transform: uppercase; color: var(--muted); margin-bottom: 10px; padding-left: 2px;
    }
    .pf-card {
      background: var(--glass); border: 1px solid var(--glass-b);
      border-radius: var(--r); overflow: hidden; backdrop-filter: blur(10px);
    }
    .pf-row {
      display: flex; align-items: center; gap: 14px;
      padding: 14px 18px; border-bottom: 1px solid var(--glass-b);
    }
    .pf-row:last-child { border-bottom: none; }
    .pf-row-icon  { font-size: 1.1rem; flex-shrink: 0; width: 22px; text-align: center; }
    .pf-row-label { font-size: .82rem; color: var(--muted); flex-shrink: 0; width: 110px; }
    .pf-row-input {
      flex: 1; background: none; border: none; color: var(--text);
      font-size: .9rem; outline: none; font-family: inherit;
    }
    .pf-row-input::placeholder { color: var(--muted); opacity: .6; }
    .pf-row-select {
      flex: 1; background: none; border: none; color: var(--text);
      font-size: .9rem; outline: none; font-family: inherit; cursor: pointer;
      -webkit-appearance: none; appearance: none;
    }
    .pf-row-select option { background: #1a0028; color: #fff; }

    .pf-stats-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; overflow: visible; }
    .pf-stat-card {
      background: var(--glass); border: 1px solid var(--glass-b);
      border-radius: var(--r-sm); padding: 14px 14px;
      backdrop-filter: blur(8px); position: relative;
      cursor: pointer; user-select: none; transition: border-color .2s, background .2s;
      display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 10px;
    }
    .pf-stat-card:active { transform: scale(.97); }
    .pf-stat-toggle { position: absolute; top: 6px; right: 7px; font-size: .65rem; color: var(--muted); opacity: .6; }
    .pf-stat-num { font-size: 1.2rem; font-weight: 900; color: var(--acc); line-height: 1.1; }
    .pf-stat-tip {
      display: none; position: absolute;
      top: 50%; left: calc(100% + 10px); transform: translateY(-50%);
      width: 210px; min-height: 110px; background: #0b1f12;
      border: 1px solid var(--acc); border-radius: 10px;
      padding: 14px 16px; z-index: 9999;
      font-size: .78rem; color: var(--text); line-height: 1.8;
      text-align: left; flex-direction: column; justify-content: center; gap: 6px;
      box-shadow: 0 6px 24px rgba(0,0,0,.7);
    }
    .pf-stats-grid > .pf-stat-card:nth-child(3n) .pf-stat-tip,
    .pf-stats-grid > .pf-stat-card:nth-child(3n+3) .pf-stat-tip {
      left: auto; right: calc(100% + 10px);
    }
    .pf-stat-card:hover { z-index: 9999; }
    .pf-stat-card:hover .pf-stat-tip { display: flex; }
    .pf-stat-val  { font-size: 1.6rem; line-height: 1; flex-shrink: 0; }
    .pf-stat-body { display: flex; flex-direction: column; align-items: center; gap: 3px; }
    .pf-stat-lbl  { font-size: .65rem; color: var(--muted); letter-spacing: .5px; text-transform: uppercase; line-height: 1; }

    .pf-save {
      width: 100%; padding: 14px; background: var(--acc); color: #000;
      font-size: .95rem; font-weight: 800; border: none; border-radius: 10px;
      cursor: pointer; transition: var(--trans); box-shadow: 0 4px 18px var(--glow);
      margin-top: 8px;
    }
    .pf-save:hover { filter: brightness(1.1); transform: translateY(-1px); }
    body.degen .pf-save { color: #fff; }

    /* ── DANGER ZONE ── */
    .pf-danger-zone { margin-top: 28px; }
    .pf-danger-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; }
    .pf-danger-title { font-size: .88rem; font-weight: 700; color: #ef4444; }
    .pf-danger-desc { font-size: .75rem; color: var(--muted); margin-top: 2px; }
    .pf-danger-desc strong { color: var(--text); }
    .pf-danger-divider { border: none; border-top: 1px solid rgba(239,68,68,.15); margin: 0; }
    .pf-danger-btn {
      flex-shrink: 0; padding: 7px 16px; background: none; border: 1px solid rgba(239,68,68,.4);
      color: #ef4444; border-radius: 8px; font-size: .8rem; font-weight: 700;
      cursor: pointer; transition: var(--trans);
    }
    .pf-danger-btn:hover { background: rgba(239,68,68,.12); border-color: #ef4444; }
    .pf-danger-btn--red { background: rgba(239,68,68,.15); }
    .pf-danger-btn--red:hover { background: rgba(239,68,68,.3); }

    /* ── DANGER MODAL ── */
    .modal-btn--danger {
      width: 100%; padding: 13px; background: #ef4444; color: #fff;
      font-size: .94rem; font-weight: 800; border: none; border-radius: 10px;
      cursor: pointer; transition: var(--trans); margin-top: 4px;
    }
    .modal-btn--danger:hover { background: #dc2626; transform: translateY(-1px); }
    .danger-confirm-box {
      background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.3);
      border-radius: 8px; padding: 10px 14px; font-size: .8rem; color: var(--muted);
      margin-bottom: 10px;
    }
    .danger-confirm-box strong { color: #ef4444; }

    /* ── PROFILE ITEM ACTIONS (switch modal) ── */
    .p-item-action {
      width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--glass-b);
      background: none; color: var(--muted); font-size: .85rem; cursor: pointer;
      transition: var(--trans); display: flex; align-items: center; justify-content: center;
    }
    .p-item-action:hover { background: var(--glass-h); color: var(--text); border-color: var(--muted); }
    .p-item-action--del:hover { background: rgba(239,68,68,.12); color: #ef4444; border-color: rgba(239,68,68,.4); }

    /* ── HEATMAP ── */
    .heatmap-scroll { padding-bottom: 6px; }
    .heatmap-months { display: flex; gap: 3px; margin-bottom: 5px; }
    .hm-mlbl { flex: 1; min-width: 0; font-size: .62rem; color: var(--muted); white-space: nowrap; overflow: visible; }
    .heatmap-grid { display: flex; gap: 3px; }
    .hm-week { display: flex; flex-direction: column; gap: 3px; flex: 1; }
    .hm-day {
      width: 100%; aspect-ratio: 1; border-radius: 2px;
      cursor: default; transition: transform .12s;
    }
    .hm-day:hover { transform: scale(1.5); z-index: 2; position: relative; }
    .hm-legend { display: flex; align-items: center; gap: 5px; margin-top: 10px; font-size: .7rem; color: var(--muted); }
    #hm-tooltip {
      position: fixed; z-index: 99999; pointer-events: none;
      background: rgba(10,10,20,.97); border: 1px solid var(--acc);
      border-radius: 8px; padding: 7px 12px;
      font-size: .78rem; color: var(--text); white-space: nowrap;
      box-shadow: 0 4px 16px rgba(0,0,0,.6);
      opacity: 0; transition: opacity .1s;
    }
    #hm-tooltip.show { opacity: 1; }
    .hm-lswatch { width: 11px; height: 11px; border-radius: 2px; flex-shrink: 0; }

    /* ── REMINDERS PANEL ── */
    .notif-count { font-size: .72rem; font-weight: 400; color: var(--muted); margin-left: 6px; }
    .notif-panel {
      background: var(--glass); border: 1px solid var(--glass-b);
      border-radius: var(--r); padding: 4px 16px;
      backdrop-filter: blur(8px); margin-bottom: 20px;
    }
    .notif-empty { color: var(--muted); font-size: .85rem; text-align: center; padding: 14px 0; }
    .notif-item {
      display: flex; align-items: center; gap: 10px;
      padding: 11px 0; border-bottom: 1px solid var(--glass-b);
    }
    .notif-item:last-child { border-bottom: none; }
    .notif-item-name { flex: 1; font-size: .88rem; color: var(--text); }
    .notif-item-link { cursor: pointer; transition: color .15s; }
    .notif-item-link:hover { color: var(--acc); }
    .notif-off-btn {
      background: rgba(248,113,113,0.08); border: 1px solid rgba(248,113,113,0.3);
      border-radius: 6px; color: rgba(248,113,113,0.8);
      cursor: pointer; font-size: .75rem; padding: 4px 10px; transition: all .15s;
    }
    .notif-off-btn:hover { background: rgba(248,113,113,0.18); color: #f87171; }

    /* ─── HUB WIDGET ROW ── */
    .hub-widget-row { display:grid; grid-template-columns:repeat(3,1fr); gap:14px; margin-bottom:36px; }
    .hub-widget-row .hub-widget-card .hww-open { display: inline-flex; }
    @media (max-width:560px) { .hub-widget-row { grid-template-columns:repeat(2,1fr); } }
    @media (max-width:360px) { .hub-widget-row { grid-template-columns:1fr; } }

    /* ─── HUB WIDGET GROUP (widget | 3-stack | 3-stack) ── */
    .hub-widget-group {
      display: grid;
      grid-template-columns: 1fr 1fr 1fr;
      gap: 14px;
      margin-bottom: 14px;
    }
    .hub-widget-group .hwg-cards {
      display: flex;
      flex-direction: column;
      gap: 14px;
    }
    .hub-widget-group .hub-widget-card { grid-column: span 1 !important; min-height: auto; }
    .hub-widget-group .hww-card-m { grid-column: span 2 !important; }
    @media (max-width: 700px) { .hub-widget-group { grid-template-columns: 1fr 1fr; } }
    @media (max-width: 460px) { .hub-widget-group { grid-template-columns: 1fr; } }

    /* ─── HUB WIDGET CARDS ── */
    .hub-widget-card {
      --hww-acc: #3ecfff;
      grid-column: span 1;
      min-height: 270px;
      display: flex; flex-direction: column;
      border-radius:var(--r); background:color-mix(in srgb,var(--hww-acc) 4%,transparent);
      border:1px solid var(--glass-b); border-left:3px solid var(--hww-acc);
      padding:20px 24px; margin-bottom:0;
    }
    .hub-widget-card[data-size="2"] { grid-column: span 2; }
    .hub-widget-card[data-size="3"] { grid-column: span 3; }
    @media (max-width: 560px) { .hub-widget-card[data-size="3"] { grid-column: span 2; } }
    @media (max-width: 360px) { .hub-widget-card[data-size="2"], .hub-widget-card[data-size="3"] { grid-column: span 1; } }
    .hww-body { flex:1; display:flex; flex-direction:column; }
    .hww-size-ctrl { display:flex; gap:4px; flex-shrink:0; }
    .hww-size-btn {
      background:var(--glass); border:1px solid var(--glass-b); color:var(--muted);
      border-radius:6px; width:26px; height:26px; font-size:.7rem; font-weight:800;
      cursor:pointer; transition:var(--trans); font-family:inherit;
      display:flex; align-items:center; justify-content:center;
    }
    .hww-size-btn:hover { border-color:var(--hww-acc); color:var(--hww-acc); }
    .hww-size-active { border-color:var(--hww-acc); color:var(--hww-acc); background:color-mix(in srgb,var(--hww-acc) 12%,transparent); }
    .hub-widget-card[data-widget="habits"]      { --hww-acc: var(--acc); }
    .hub-widget-card[data-widget="sleep"]       { --hww-acc: #818cf8; }
    .hub-widget-card[data-widget="supplements"] { --hww-acc: #fb923c; }
    .hww-header { display:flex; align-items:center; gap:10px; margin-bottom:16px; flex-wrap:wrap; }
    .hww-icon { font-size:1.6rem; flex-shrink:0; }
    .hww-info { flex:1; min-width:0; }
    .hww-title { font-size:1rem; font-weight:700; }
    .hww-sub { font-size:.72rem; color:var(--muted); }
    .hww-goal-ctrl { display:flex; align-items:center; gap:6px; flex-shrink:0; }
    .hww-goal-ctrl button {
      background:rgba(0,0,0,.25); border:1px solid var(--glass-b); color:var(--text);
      width:24px; height:24px; border-radius:6px; cursor:pointer; font-size:.85rem;
      line-height:1; display:flex; align-items:center; justify-content:center;
      transition:border-color .15s,background .15s; font-family:inherit;
    }
    .hww-goal-ctrl button:hover { border-color:var(--hww-acc); background:rgba(0,0,0,.4); }
    .hww-goal-val { font-size:.82rem; color:var(--muted); min-width:24px; text-align:center; }
    .hww-change {
      background:none; border:1px solid var(--glass-b); color:var(--muted);
      border-radius:20px; padding:4px 11px; font-size:.72rem; cursor:pointer;
      transition:var(--trans); font-family:inherit; flex-shrink:0;
    }
    .hww-change:hover { border-color:var(--hww-acc); color:var(--hww-acc); }
    .hww-open {
      background:none; border:1px solid var(--glass-b); color:var(--muted);
      border-radius:20px; padding:5px 14px; font-size:.75rem; cursor:pointer;
      transition:var(--trans); font-family:inherit; flex-shrink:0;
    }
    .hww-open:hover { border-color:var(--hww-acc); color:var(--hww-acc); }
    /* — Water — */
    .hww-dots { display:flex; gap:6px; flex-wrap:wrap; flex:1; align-content:center; margin-bottom:14px; }
    .hww-dot {
      width:36px; height:36px; border-radius:8px;
      border:2px solid var(--glass-b); background:rgba(0,0,0,.2);
      display:flex; align-items:center; justify-content:center;
      font-size:1rem; transition:all .25s; flex-shrink:0;
    }
    .hww-dot.filled {
      background:color-mix(in srgb,var(--hww-acc) 15%,transparent);
      border-color:var(--hww-acc); box-shadow:0 0 8px color-mix(in srgb,var(--hww-acc) 40%,transparent);
    }
    .hww-bar-wrap {
      position:relative; height:52px; border-radius:var(--r-sm);
      background:rgba(0,0,0,.28); border:1px solid var(--glass-b);
      overflow:hidden; margin-bottom:14px;
    }
    .hww-bar-fill {
      position:absolute; left:0; top:0; bottom:0;
      background:linear-gradient(90deg,color-mix(in srgb,var(--hww-acc) 45%,transparent),color-mix(in srgb,var(--hww-acc) 75%,transparent));
      transition:width .5s cubic-bezier(.34,1.56,.64,1);
    }
    .hww-bar-label {
      position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
      font-size:1.1rem; font-weight:900; z-index:1; text-shadow:0 1px 6px rgba(0,0,0,.7);
    }
    /* — Buttons — */
    .hww-btns { display:flex; gap:10px; }
    .hww-btn {
      flex:1; padding:11px; border-radius:var(--r-sm); border:none;
      font-size:.88rem; font-weight:700; cursor:pointer; transition:var(--trans); font-family:inherit;
    }
    .hww-btn-sec { background:var(--glass); border:1px solid var(--glass-b); color:var(--muted); }
    .hww-btn-sec:hover { border-color:rgba(255,100,100,.5); color:#ff8080; }
    .hww-btn-pri { background:color-mix(in srgb,var(--hww-acc) 15%,transparent); border:1px solid color-mix(in srgb,var(--hww-acc) 35%,transparent); color:var(--hww-acc); }
    .hww-btn-pri:hover { background:color-mix(in srgb,var(--hww-acc) 25%,transparent); box-shadow:0 0 12px color-mix(in srgb,var(--hww-acc) 30%,transparent); }
    /* — Check list (habits + supplements) — */
    .hww-check-list { display:flex; flex-direction:column; gap:6px; flex:1; overflow-y:auto; margin-bottom:14px; }
    .hww-check-item {
      display:flex; align-items:center; gap:10px; padding:9px 12px;
      background:rgba(0,0,0,.2); border-radius:var(--r-sm); border:1px solid var(--glass-b);
      cursor:pointer; transition:background .15s,border-color .15s; user-select:none;
    }
    .hww-check-item:hover { background:var(--glass-h); border-color:var(--hww-acc); }
    .hww-check-item.hww-checked { background:rgba(0,0,0,.1); opacity:.72; }
    .hww-check-box {
      width:20px; height:20px; border-radius:5px; flex-shrink:0;
      border:2px solid var(--glass-b); display:flex; align-items:center; justify-content:center;
      font-size:.75rem; font-weight:900; transition:all .15s;
    }
    .hww-checked .hww-check-box { background:var(--hww-acc); border-color:var(--hww-acc); color:rgba(0,0,0,.85); }
    .hww-check-text { font-size:.88rem; flex:1; }
    .hww-empty { color:var(--muted); font-size:.82rem; padding:16px 0; text-align:center; }
    .hww-link { color:var(--hww-acc); cursor:pointer; text-decoration:underline; }
    /* — Sleep — */
    .hww-sleep-row { display:flex; gap:14px; margin-bottom:14px; }
    .hww-sleep-field { flex:1; display:flex; flex-direction:column; gap:5px; }
    .hww-sleep-field label { font-size:.72rem; color:var(--muted); font-weight:700; text-transform:uppercase; letter-spacing:.5px; }
    .hww-sleep-field input {
      background:rgba(0,0,0,.25); border:1px solid var(--glass-b); border-radius:var(--r-sm);
      color:var(--text); padding:10px 12px; font-size:1rem; font-family:inherit;
      transition:border-color .15s; color-scheme:dark;
    }
    .hww-sleep-field input:focus { outline:none; border-color:var(--hww-acc); }
    .hww-sleep-result {
      display:flex; align-items:baseline; gap:12px; margin-bottom:14px;
      padding:14px; background:rgba(0,0,0,.2); border-radius:var(--r-sm); border:1px solid var(--glass-b);
    }
    .hww-sleep-dur { font-size:2rem; font-weight:900; color:var(--hww-acc); flex-shrink:0; line-height:1; }
    .hww-sleep-q { font-size:.82rem; color:var(--muted); }
    /* — Widget picker — */
    .hww-picker { display:flex; flex-direction:column; align-items:center; gap:16px; padding:6px 0; }
    .hww-picker-title { font-size:.72rem; font-weight:700; letter-spacing:2px; text-transform:uppercase; color:var(--muted); }
    .hww-picker-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:10px; width:100%; }
    .hww-pick-btn {
      display:flex; flex-direction:column; align-items:center; gap:8px; padding:18px 8px;
      background:var(--glass); border:1px solid var(--glass-b); border-radius:var(--r);
      color:var(--text); cursor:pointer; transition:var(--trans); font-family:inherit;
      font-size:1.6rem; line-height:1;
    }
    .hww-pick-btn span { font-size:.75rem; font-weight:700; color:var(--muted); }
    .hww-pick-btn:hover { border-color:var(--acc); background:var(--checked); }
    .hww-pick-btn:hover span { color:var(--text); }
    .hww-pick-active { border-color:var(--acc); background:var(--checked); box-shadow:0 0 10px var(--glow); }
    .hww-pick-active span { color:var(--text); }
    .hww-picker-cancel {
      background:none; border:1px solid var(--glass-b); color:var(--muted);
      border-radius:20px; padding:6px 20px; font-size:.78rem; cursor:pointer;
      transition:var(--trans); font-family:inherit;
    }
    .hww-picker-cancel:hover { border-color:rgba(255,100,100,.4); color:#ff8080; }

    /* ─── WIDGET SIZE ADAPTATIONS ── */

    /* S — compact, strip non-essentials */
    .hub-widget-card[data-size="1"] { padding: 16px 18px; min-height: 0; }
    .hub-widget-card[data-size="1"] .hww-header { margin-bottom: 10px; gap: 6px; }
    .hub-widget-card[data-size="1"] .hww-icon { font-size: 1.3rem; }
    .hub-widget-card[data-size="1"] .hww-title { font-size: .9rem; }
    .hub-widget-card[data-size="1"] .hww-sub,
    .hub-widget-card[data-size="1"] .hww-goal-ctrl,
    .hub-widget-card[data-size="1"] .hww-change,
    .hub-widget-card[data-size="1"] .hww-open { display: none; }
    .hub-widget-card[data-size="1"] .hww-btns { gap: 7px; }
    .hub-widget-card[data-size="1"] .hww-btn { padding: 9px 6px; font-size: .8rem; }
    .hub-widget-card[data-size="1"] .hww-check-item { padding: 7px 10px; }
    .hub-widget-card[data-size="1"] .hww-check-list { gap: 5px; margin-bottom: 0; }
    .hub-widget-card[data-size="1"] .hww-sleep-row { flex-direction: column; gap: 8px; }
    .hub-widget-card[data-size="1"] .hww-sleep-result { padding: 10px 14px; }
    .hub-widget-card[data-size="1"] .hww-sleep-dur { font-size: 1.5rem; }
    /* S water: bar is the hero — fills body height, larger label */
    .hub-widget-card[data-size="1"][data-widget="water"] .hww-bar-wrap { flex: 1; height: auto; min-height: 70px; }
    .hub-widget-card[data-size="1"][data-widget="water"] .hww-bar-label { font-size: 1.4rem; }

    /* M — remove change button, roomier check items */
    .hub-widget-card[data-size="2"] .hww-change { display: none; }
    .hub-widget-card[data-size="2"] .hww-check-item { padding: 11px 13px; }

    /* L — expand layouts for full-width use */
    .hub-widget-card[data-size="3"] .hww-check-list {
      display: grid; grid-template-columns: 1fr 1fr; gap: 8px; overflow-y: visible;
    }
    .hub-widget-card[data-size="3"] .hww-check-item { padding: 13px 16px; }
    .hub-widget-card[data-size="3"] .hww-check-box { width: 22px; height: 22px; }
    .hub-widget-card[data-size="3"] .hww-check-text { font-size: .92rem; }
    .hub-widget-card[data-size="3"] .hww-dot { width: 46px; height: 46px; font-size: 1.2rem; }
    .hub-widget-card[data-size="3"] .hww-dots { gap: 9px; }
    .hub-widget-card[data-size="3"] .hww-bar-wrap { height: 62px; }
    .hub-widget-card[data-size="3"] .hww-bar-label { font-size: 1.35rem; }
    .hub-widget-card[data-size="3"] .hww-btns { gap: 14px; }
    .hub-widget-card[data-size="3"] .hww-btn { padding: 14px 18px; font-size: .95rem; }

    /* Water M/L: dots at top, bar in middle, buttons at bottom — no flex growth on dots */
    .hub-widget-card[data-widget="water"]:not([data-size="1"]) .hww-body { justify-content: space-between; }
    .hub-widget-card[data-widget="water"]:not([data-size="1"]) .hww-dots { flex: none; margin-bottom: 0; }
    .hub-widget-card[data-widget="water"]:not([data-size="1"]) .hww-bar-wrap { margin-bottom: 0; }

    /* Sleep S/M: inputs+result grouped at top, save button pinned to bottom */
    .hub-widget-card[data-widget="sleep"]:not([data-size="3"]) .hww-body { gap: 14px; }
    .hub-widget-card[data-widget="sleep"]:not([data-size="3"]) .hww-body > .hww-btn { margin-top: auto; }
    .hub-widget-card[data-widget="sleep"]:not([data-size="3"]) .hww-sleep-row { margin-bottom: 0; }
    .hub-widget-card[data-widget="sleep"]:not([data-size="3"]) .hww-sleep-result { margin-bottom: 0; }

    /* Sleep L: horizontal split — inputs + save on left, big duration stat on right */
    .hww-sleep-wide { display: flex; gap: 22px; flex: 1; }
    .hww-sleep-wide-l { display: flex; flex-direction: column; justify-content: space-between; flex: 1; min-width: 0; }
    .hww-sleep-wide-l .hww-sleep-row { margin-bottom: 0; gap: 16px; }
    .hww-sleep-wide-r {
      flex: 0 0 220px; display: flex; flex-direction: column;
      align-items: center; justify-content: center; gap: 12px;
      background: rgba(0,0,0,.22); border-radius: var(--r-sm);
      border: 1px solid var(--glass-b); padding: 24px 18px;
    }
    .hww-sleep-wide-r .hww-sleep-dur { font-size: 4rem; line-height: 1; }
    .hww-sleep-wide-r .hww-sleep-q { font-size: .9rem; text-align: center; color: var(--muted); }

    /* ─── HUB ARRANGE ── */
    .hub-arrange-bar { display:flex; justify-content:flex-end; align-items:center; gap:8px; margin-bottom:12px; }
    .hub-arr-btn, .hub-arr-reset, .hub-arr-done {
      border:none; border-radius:20px; padding:6px 15px; font-size:.78rem; font-weight:700;
      cursor:pointer; transition:var(--trans); font-family:inherit;
    }
    .hub-arr-btn  { background:var(--glass); border:1px solid var(--glass-b); color:var(--muted); }
    .hub-arr-btn:hover  { border-color:var(--acc); color:var(--text); }
    .hub-arr-reset { background:none; border:1px solid var(--glass-b); color:var(--muted); }
    .hub-arr-reset:hover { border-color:rgba(255,100,100,.5); color:#ff8080; }
    .hub-arr-done  { background:var(--acc); color:#000; box-shadow:0 0 12px var(--glow); }
    .hub-arr-done:hover  { filter:brightness(1.1); }
    body.degen .hub-arr-done { color:#fff; }

    .hub-drag-handle {
      position:absolute; top:8px; right:10px; font-size:.85rem; color:var(--muted);
      pointer-events:none; opacity:.5; line-height:1; user-select:none;
    }
    .goal-card.hub-arrange-card { position:relative; cursor:grab; user-select:none; }
    .goal-card.hub-arrange-card:active { cursor:grabbing; }
    .hub-arr-unit { display:flex; flex-direction:column; gap:4px; cursor:grab; user-select:none; }
    .hub-arr-unit:active { cursor:grabbing; }
    .hub-arr-unit.hub-dragging { opacity:.25; transform:scale(.95); }
    .hub-arr-unit.hub-drop-before { box-shadow:-3px 0 0 var(--acc), 0 0 14px var(--glow); border-radius:var(--r); }
    .hub-arr-unit.hub-drop-after  { box-shadow: 3px 0 0 var(--acc), 0 0 14px var(--glow); border-radius:var(--r); }
    .hub-grp-card-badge {
      padding:3px 8px; font-size:.68rem; color:var(--acc);
      background:var(--checked); border:1px solid rgba(45,212,110,.3);
      border-radius:5px; cursor:pointer; text-align:center;
      transition:all .15s; user-select:none; white-space:nowrap;
      overflow:hidden; text-overflow:ellipsis;
    }
    .hub-grp-card-badge:hover { background:rgba(255,100,100,.1); border-color:rgba(255,100,100,.4); color:#ff8080; }
    .hub-grp-arrange.hub-drop-assign {
      border-color:var(--acc); background:var(--checked); box-shadow:0 0 16px var(--glow);
    }

    /* ─── CARD TYPE STYLES ── */
    .gc-health { border-left: 3px solid var(--acc); background: rgba(45,212,110,0.07); }
    .gc-tools  { border-left: 3px solid #3ecfff;   background: rgba(62,207,255,0.05); }
    .gc-custom { border-left: 3px solid #f5a623;   background: rgba(245,166,35,0.06); }
    .gc-tools .r-track  { stroke: rgba(62,207,255,0.3); }
    .gc-custom .r-track { stroke: rgba(245,166,35,0.3); }
    .gc-health .hub-drag-handle { color: var(--acc); opacity:.75; }
    .gc-tools  .hub-drag-handle { color: #3ecfff;   opacity:.75; }
    .gc-custom .hub-drag-handle { color: #f5a623;   opacity:.75; }

    /* ─── CARD VISIBILITY TOGGLE ── */
    .hub-vis-btn {
      position:absolute; top:7px; left:8px;
      width:20px; height:20px; border-radius:50%;
      border:1px solid; cursor:pointer; font-size:.7rem; font-weight:900;
      display:flex; align-items:center; justify-content:center;
      transition:all .15s; line-height:1; background:none; font-family:inherit;
      padding:0;
    }
    .hub-vis-hide { border-color:rgba(255,100,100,.3); color:rgba(255,100,100,.45); }
    .hub-vis-hide:hover { background:rgba(255,100,100,.15); border-color:#ff6060; color:#ff6060; }
    .hub-vis-show { border-color:rgba(45,212,110,.5); color:var(--acc); background:rgba(45,212,110,.1); }
    .hub-vis-show:hover { background:rgba(45,212,110,.22); }
    .goal-card.gc-hidden-card { opacity:.28; filter:saturate(0.15); }
    .goal-card.gc-hidden-card:hover { opacity:.45; filter:saturate(0.3); }

    /* ─── GROUP HEADERS (arrange mode only) ── */
    .hub-grp-hdr {
      grid-column: 1/-1;
      display:flex; align-items:center;
    }
    .hub-grp-hdr .hub-grp-name {
      font-size:.72rem; font-weight:700; letter-spacing:2px;
      text-transform:uppercase; color:var(--muted);
    }
    .hub-grp-arrange {
      display:flex; align-items:center; gap:8px;
      background:var(--glass); border:1px solid var(--acc);
      border-radius:var(--r-sm); padding:8px 12px;
      cursor:grab; user-select:none;
      margin-top: 28px; margin-bottom: 4px;
    }
    .hub-grp-arrange:active { cursor:grabbing; }
    .hub-grp-arrange .hub-grp-name {
      flex:1; outline:none; min-width:60px; letter-spacing:1.5px;
    }
    .hub-grp-arrange .hub-grp-name:focus { color:var(--text); }
    .hub-grp-del {
      background:none; border:none; color:var(--muted);
      font-size:1rem; cursor:pointer; padding:0 2px; line-height:1;
      transition:color .15s; flex-shrink:0;
    }
    .hub-grp-del:hover { color:#ff6060; }
    .hub-grp-toggle {
      background:none; border:none; color:var(--muted); cursor:pointer;
      font-size:.65rem; padding:0; line-height:1;
      transition:color .15s; flex-shrink:0; font-family:inherit;
    }
    .hub-grp-toggle:hover { color:var(--text); }
    .hub-grp-arrange.hub-dragging { opacity:.25; transform:scale(.97); }
    .hub-grp-arrange.hub-drop-before { box-shadow:-3px 0 0 var(--acc), 0 0 14px var(--glow); }
    .hub-grp-arrange.hub-drop-after  { box-shadow: 3px 0 0 var(--acc), 0 0 14px var(--glow); }
    .hub-arr-add-grp {
      border:none; border-radius:20px; padding:6px 15px; font-size:.78rem; font-weight:700;
      cursor:pointer; transition:var(--trans); font-family:inherit;
      background:none; border:1px solid rgba(62,207,255,.3); color:#3ecfff;
    }
    .hub-arr-add-grp:hover { background:rgba(62,207,255,.1); border-color:#3ecfff; }
