.home-shell {
      width: min(100%, 760px);
      min-height: 100dvh;
      margin: 0 auto;
      padding: calc(22px + env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
      display: flex;
      flex-direction: column;
      position: relative;
      isolation: isolate;
      overflow-x: clip;
    }

    .home-shell::before {
      content: "";
      position: absolute;
      width: min(76vw, 540px);
      height: min(76vw, 540px);
      right: -40%;
      top: 15%;
      border: 1px solid rgba(18,18,18,.05);
      border-radius: 50%;
      z-index: -1;
    }

    .topbar {
      min-height: 32px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      color: var(--muted);
      font-size: 11px;
      font-weight: 650;
      letter-spacing: .13em;
      text-transform: uppercase;
    }

    .topbar-brand { color: var(--ink); letter-spacing: .08em; }
    .topbar-action {
      width: 30px;
      height: 30px;
      display: grid;
      place-items: center;
      border: 1px solid var(--line);
      border-radius: 50%;
      color: var(--ink);
      background: transparent;
    }

    .profile-wrap { width: 100%; max-width: 480px; margin: clamp(14px, 3.5vh, 32px) auto 0; }
    .profile-heading { margin: 0 0 20px; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }

    .profile-card {
      width: 100%;
      position: relative;
      overflow: hidden;
      padding: 26px 28px 18px;
      border: 1px solid #e8e8e4;
      border-radius: 28px;
      background: rgba(255,255,255,.92);
      box-shadow: 0 16px 38px rgba(31,31,29,.07);
    }

    .profile-card::before {
      content: "";
      position: absolute;
      inset: 0;
      pointer-events: none;
      opacity: .4;
      background-image: radial-gradient(circle at 14% 18%, #d8d8d4 0 1px, transparent 1.8px), radial-gradient(circle at 73% 27%, #e3e3df 0 1.2px, transparent 2px), radial-gradient(circle at 90% 74%, #d8d8d4 0 1px, transparent 1.8px), radial-gradient(circle at 28% 88%, #e5e5e1 0 1.4px, transparent 2.2px);
      background-size: 41px 37px, 53px 49px, 47px 43px, 61px 57px;
    }

    .profile-card.has-background { background-size: cover; background-position: center; border-color: rgba(255,255,255,.45); }
    .profile-card.has-background::before { opacity: 1; background: linear-gradient(110deg, rgba(255,255,255,.46), rgba(255,255,255,.1)); }
    .profile-card.has-background.background-dark::before { background: linear-gradient(110deg, rgba(0,0,0,.42), rgba(0,0,0,.12)); }
    .profile-background-button { display: none; }
    .profile-card { cursor: pointer; }
    .profile-card button, .profile-card [contenteditable="true"] { cursor: auto; }
    .profile-card.background-dark .profile-name, .profile-card.background-dark .profile-handle, .profile-card.background-dark .bio, .profile-card.background-dark .profile-decor { color: #fff; text-shadow: 0 1px 8px rgba(0,0,0,.42); }
    .profile-card.background-dark .week-strip { border-color: rgba(255,255,255,.38); background: rgba(0,0,0,.23); }
    .profile-card.background-dark .day { color: rgba(255,255,255,.82); }
    .profile-card.background-dark .day.active { color: #fff; background: rgba(255,255,255,.25); }
    .profile-card.has-background:not(.background-dark) .profile-name { color: #20201e; }
    .profile-card.has-background:not(.background-dark) .profile-handle, .profile-card.has-background:not(.background-dark) .bio, .profile-card.has-background:not(.background-dark) .profile-decor { color: #454541; }
    .profile-background-dialog { width: min(calc(100% - 36px), 400px); }

    .profile-main { position: relative; z-index: 1; display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 18px; align-items: center; }
    .avatar-button {
      position: relative;
      width: 84px;
      height: 84px;
      padding: 0;
      overflow: hidden;
      border: 1px solid #d6d6d1;
      border-radius: 50%;
      background: #ededeb;
      color: #676762;
      cursor: pointer;
    }

    .avatar-button:hover .avatar-overlay,
    .avatar-button:focus-visible .avatar-overlay { opacity: 1; }
    .avatar-button:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
    .avatar-fallback { display: grid; place-items: center; width: 100%; height: 100%; font-size: 23px; font-weight: 300; letter-spacing: -.05em; }
    .avatar-image { display: none; width: 100%; height: 100%; object-fit: cover; }
    .avatar-image.has-image { display: block; }
    .avatar-image.has-image + .avatar-fallback { display: none; }
    .avatar-overlay { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; background: rgba(0,0,0,.44); color: var(--white); transition: opacity .2s ease; }
    .avatar-overlay svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

    .profile-meta { min-width: 0; overflow: hidden; }
    .profile-handle { display: inline-block; min-width: 80px; max-width: 100%; margin: 8px 0 0; overflow-wrap: anywhere; color: var(--muted); font-size: 12px; cursor: text; }
    .profile-handle:focus { outline: 1px solid #bdbdb8; outline-offset: 4px; border-radius: 4px; }

    .name-line { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
    .profile-name { display: inline-block; min-width: 42px; max-width: 100%; margin: 0; overflow-wrap: anywhere; font-size: 23px; font-weight: 650; letter-spacing: -.04em; cursor: text; }
    .profile-name:focus { outline: 1px solid #bdbdb8; outline-offset: 4px; border-radius: 4px; }
    .profile-decor { color: #a1a19d; font-size: 16px; letter-spacing: .1em; white-space: nowrap; }
    .profile-stats { display: none; }
    .bio-block { position: relative; z-index: 1; margin-top: 22px; padding-top: 0; border-top: 0; }
    .bio { display: inline-block; min-width: 80px; margin: 0; color: #62625d; font-size: 14px; line-height: 1.45; cursor: text; }
    .bio:focus { outline: 1px solid #bdbdb8; outline-offset: 4px; border-radius: 4px; }
    .week-strip { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: 27px; padding: 5px; border: 1px solid #d8d8d4; border-radius: 999px; background: rgba(255,255,255,.72); }
    .day { min-width: 0; min-height: 37px; padding: 0 3px; border: 0; border-radius: 999px; background: transparent; color: #777772; font-size: 12px; font-weight: 600; cursor: pointer; }
    .day:hover { color: var(--ink); }
    .day.active { background: #e7e7e4; color: #5a5a56; box-shadow: 0 2px 7px rgba(20,20,20,.08); }
    .day:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

    .quick-apps { width: max-content; display: grid; grid-template-columns: repeat(2, 72px); gap: 28px; margin: 22px 0 0 auto; }
    .quick-apps .app { justify-self: center; }
    .bottom { margin-top: auto; margin-bottom: 0; padding-bottom: 4px; display: flex; align-items: end; justify-content: center; }
    .apps { display: flex; align-items: end; gap: 28px; }
    .app { width: 72px; padding: 0; border: 0; background: transparent; color: var(--ink); text-align: center; cursor: pointer; transition: transform .2s ease; }
    .app:hover { transform: translateY(-3px); }
    .app:active { transform: translateY(0); }
    .app:focus-visible { outline: 2px solid var(--ink); outline-offset: 5px; border-radius: 18px; }
    .app-icon { width: 64px; height: 64px; display: grid; place-items: center; border: 1px solid #d8d8d3; border-radius: 16px; background: var(--white); box-shadow: 0 6px 15px rgba(15,15,14,.08); }
    .app:nth-child(2) .app-icon { background: #ededeb; }
    .app-icon svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; }
    .app-icon.has-custom-icon svg { opacity: 0; }
    .app-name { display: block; margin-top: 8px; font-size: 12px; font-weight: 600; }

    .panel {
      position: fixed;
      left: 50%;
      bottom: calc(16px + env(safe-area-inset-bottom));
      width: min(calc(100% - 32px), 560px);
      padding: 22px;
      border: 1px solid rgba(20,20,20,.08);
      border-radius: 24px;
      background: var(--panel);
      box-shadow: var(--shadow);
      transform: translate(-50%, calc(100% + 32px + env(safe-area-inset-bottom)));
      transition: transform .32s cubic-bezier(.2,.8,.2,1);
      z-index: 5;
      backdrop-filter: blur(20px);
    }


    .panel.open { transform: translate(-50%, 0); }
    .panel-head { display: flex; align-items: center; justify-content: space-between; }
    .panel-title { margin: 0; font-size: 17px; font-weight: 650; }
    .close { padding: 0; border: 0; background: transparent; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; }
    .close:hover { color: var(--ink); }
    .panel-copy { margin: 13px 0 0; color: #6e6e69; font-size: 12px; line-height: 1.7; }
    .panel-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 19px; padding-top: 15px; border-top: 1px solid var(--line); font-size: 12px; }
    .toggle { width: 39px; height: 23px; padding: 3px; border: 0; border-radius: 14px; background: #d3d3ce; cursor: pointer; transition: background .2s ease; }
    .toggle span { display: block; width: 17px; height: 17px; border-radius: 50%; background: var(--white); box-shadow: 0 1px 3px rgba(0,0,0,.12); transition: transform .2s ease; }
    .toggle.on { background: var(--ink); }
    .toggle.on span { transform: translateX(16px); }

    @media (min-width: 600px) {
      .home-shell { padding-left: 42px; padding-right: 42px; }
      .profile-wrap { margin-top: 32px; }
      .profile-card { padding: 26px 28px 18px; }
      .quick-apps { grid-template-columns: repeat(2, 80px); gap: 32px; }
      .apps { gap: 32px; }
      .app { width: 80px; }
      .app-icon { width: 72px; height: 72px; }
    }

    @media (max-height: 660px) {
      .profile-wrap { margin-top: 14px; }
      .profile-card { padding: 16px 16px 12px; }
      .profile-main { grid-template-columns: 70px 1fr; gap: 15px; }
      .avatar-button { width: 70px; height: 70px; }
      .profile-name { font-size: 20px; }
      .week-strip { margin-top: 20px; }
    }
