/*
 * Star World
 * File: frontend/styles/app.css
 * Version: 1.62.3
 * Build: Floating Profile Drag Polish
 */
    :root {
      --bg: #f8f7fa;
      --surface: #ffffff;
      --surface-soft: #f2f0f5;
      --text: #12192b;
      --muted: #737987;
      --border: #dedfe6;
      --accent: #7a55a3;
      --danger: #b44949;
      --success: #3e8459;
      --shadow: 0 2px 8px rgba(31, 37, 54, .055);
      --radius: 12px;
    }

    * { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
    html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
    body { overscroll-behavior-y: none; }
    button, input, textarea, select { font: inherit; }
    button { cursor: pointer; }

    .app {
      width: min(100%, 820px);
      margin: 0 auto;
      padding: max(18px, env(safe-area-inset-top)) 18px max(28px, env(safe-area-inset-bottom));
    }

    .topbar {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 16px;
      margin-bottom: 16px;
    }

    .eyebrow { color: #656b79; font-size: .78rem; font-weight: 780; text-transform: uppercase; letter-spacing: .11em; }
    h1 { margin: 5px 0 0; font-size: clamp(2rem, 6.3vw, 2.8rem); line-height: 1; letter-spacing: -.045em; font-weight: 780; }
    h2 { margin: 0; font-size: 1.24rem; line-height: 1.08; letter-spacing: -.025em; font-weight: 780; }
    p { margin: 0; }

    .adult-button {
      border: 1px solid #d8d9e0;
      background: rgba(255,255,255,.86);
      border-radius: 11px;
      padding: 10px 14px;
      box-shadow: 0 1px 4px rgba(31,37,54,.04);
      color: var(--text);
      font-weight: 720;
      white-space: nowrap;
      display: inline-flex; align-items: center; gap: 8px;
    }
    .adult-button .ui-icon { width: 20px; height: 20px; color: #343a48; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }

    .profiles {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 12px;
      margin-bottom: 24px;
    }

    .profile-card {
      border: 1.5px solid var(--profile-border, var(--border));
      background: var(--profile-bg, var(--surface));
      color: var(--text);
      border-radius: 12px;
      padding: 12px 14px;
      min-width: 0;
      min-height: 106px;
      box-shadow: var(--shadow);
      transition: transform .14s ease, border-color .14s ease, background .14s ease;
      position: relative;
      display: grid;
      grid-template-columns: 76px minmax(0, 1fr);
      align-items: center;
      gap: 12px;
      text-align: left;
    }
    .profile-card:active { transform: scale(.988); }
    .profile-card.selected {
      border-color: var(--profile-color, var(--accent));
      background: var(--profile-selected-bg, var(--profile-bg, var(--surface)));
      box-shadow: 0 2px 8px rgba(31,37,54,.06);
    }
    .profile-card.selected::after {
      content: ''; position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%);
      width: 0; height: 0; border-left: 10px solid transparent; border-right: 10px solid transparent;
      border-bottom: 0; border-top: 9px solid var(--profile-color, var(--accent));
    }
    .profile-avatar {
      width: 72px; height: 72px; margin: 0;
      display: grid; place-items: center; overflow: visible;
      background: transparent;
      font-size: 3.35rem;
      line-height: 1;
      position: relative;
      isolation: isolate;
    }
    .profile-avatar::before {
      content: ''; position: absolute; inset: 9px; border-radius: 50%;
      background: var(--profile-halo, rgba(122,85,163,.09)); z-index: -1;
      filter: blur(.2px);
    }
    .profile-avatar img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 3px 5px rgba(31,37,54,.16)); }
    .profile-avatar .emoji-sticker { font-size: 1em; }
    .profile-copy { min-width: 0; }
    .profile-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; font-size: 1.18rem; line-height: 1.08; font-weight: 790; color: var(--profile-color, var(--text)); letter-spacing: -.018em; }
    .profile-stars { text-align: left; margin-top: 8px; font-size: 1rem; font-weight: 720; color: #394052; display:flex; align-items:center; gap:5px; }

    @media (max-width: 620px) {
      .profile-card { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 11px 8px 13px; }
      .profile-avatar { width: 58px; height: 58px; font-size: 2.7rem; }
      .profile-name, .profile-stars { text-align:center; justify-content:center; }
    }

    .section { margin-top: 28px; }
    .section-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
    .section-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
    .section-icon {
      width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
      color: white; flex: 0 0 auto; background: var(--section-color, var(--accent));
      box-shadow: 0 1px 4px rgba(31,37,54,.08);
    }
    .section-icon svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
    .ui-icon { display:inline-block; flex:0 0 auto; }
    .section-note { color: #777d8b; font-size: .82rem; font-weight: 520; text-align: right; }
    .tasks-section { --section-color: #7a55a3; }
    .grabs-section { --section-color: #d99a0b; }
    .rewards-section { --section-color: #3F8F88; }

    .task-list { display: grid; gap: 10px; }
    .task-card {
      display: grid;
      grid-template-columns: 64px minmax(0, 1fr) auto;
      align-items: center;
      gap: 13px;
      background: var(--task-bg, var(--surface));
      border: 1px solid var(--task-border, var(--border));
      border-left: 4px solid var(--task-accent, var(--border));
      border-radius: 11px;
      padding: 11px 13px 11px 10px;
      box-shadow: none;
      position: relative;
      overflow: visible;
      transition: transform .18s ease, opacity .18s ease;
    }
    .task-card.completed { opacity: .58; }
    .task-card.missed { border-color: #e1baba; border-left-color: #c95656; background: #fff8f8; }
    .task-card.no-visual { grid-template-columns: minmax(0, 1fr) auto; }
    .task-card.completing { animation: taskTap .5s cubic-bezier(.2,.9,.2,1); }
    @keyframes taskTap { 0%{transform:scale(1)} 45%{transform:scale(.975)} 72%{transform:scale(1.012)} 100%{transform:scale(1)} }

    .visual, .reward-visual, .grab-visual {
      background: transparent;
      display: grid; place-items: center; overflow: visible;
      border: 0; box-shadow: none; transform: none;
      line-height: 1;
    }
    .visual { width: 60px; height: 60px; font-size: 2.35rem; }
    .reward-visual { width: 64px; height: 64px; font-size: 2.45rem; flex: 0 0 auto; }
    .grab-visual { width: 52px; height: 52px; font-size: 2.1rem; }
    .sticker-img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(1px 0 0 #fff) drop-shadow(-1px 0 0 #fff) drop-shadow(0 1px 0 #fff) drop-shadow(0 -1px 0 #fff) drop-shadow(0 4px 5px rgba(31,37,54,.15)); }
    .emoji-sticker { display:inline-block; line-height:1; filter: drop-shadow(0 3px 3px rgba(31,37,54,.14)); text-shadow: 1px 0 #fff, -1px 0 #fff, 0 1px #fff, 0 -1px #fff; }
    .task-title { font-weight: 760; font-size: 1.03rem; line-height: 1.18; letter-spacing: -.012em; }
    .meta { margin-top: 6px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; color: #777d8b; font-size: .77rem; }
    .pill { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 3px 7px; background: var(--surface-soft); font-weight: 750; }
    .star-pill { color: #77590b; background: #fff5ca; }
    .missed-pill { color: #8e3333; background: #fbe1e1; }


    .grab-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
    .grab-card {
      min-width: 0; border: 1px solid #eadfbf; border-left: 4px solid #e3a612;
      border-radius: 11px; background: #fffdf7; padding: 11px 12px 11px 10px;
      display: grid; grid-template-columns: 54px minmax(0,1fr); align-items: center; gap: 11px;
      text-align: left; color: var(--text); box-shadow: none; transition: transform .14s ease, background .14s ease;
    }
    .grab-card.no-visual { grid-template-columns: minmax(0,1fr); }
    .grab-card:active { transform: scale(.985); background: #fff9e9; }
    .grab-card.completed, .grab-card.missed { opacity: .58; }
    .grab-card.missed { border-color: #e1baba; border-left-color: #c95656; background: #fff8f8; }
    .grab-card.completing { animation: taskTap .5s cubic-bezier(.2,.9,.2,1); }
    .grab-title { font-weight: 750; line-height: 1.15; letter-spacing: -.01em; overflow-wrap: anywhere; }
    .grab-meta { margin-top: 5px; display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: .78rem; font-weight: 750; }

    @media (min-width: 680px) and (orientation: portrait) {
      .grab-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
      .grab-card { grid-template-columns: 54px minmax(0,1fr); min-height: 86px; }
    }

    .reward-scroll {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 12px;
      overflow: visible;
      padding: 2px;
    }
    .reward-card {
      min-width: 0;
      border: 1px solid var(--reward-border, var(--border));
      border-radius: 11px;
      padding: 13px;
      background: linear-gradient(
        to top,
        var(--reward-progress-color, var(--surface-soft)) 0%,
        var(--reward-progress-color, var(--surface-soft)) var(--reward-progress, 0%),
        var(--surface) var(--reward-progress, 0%),
        var(--surface) 100%
      );
      box-shadow: none;
      min-height: 164px;
      text-align: left;
      display: flex;
      flex-direction: column;
      gap: 9px;
      overflow: hidden;
      transition: background .25s ease, transform .14s ease;
    }
    .reward-card:active { transform: scale(.985); }
    .reward-card.unavailable { opacity: 1; }
    .reward-name { font-weight: 760; line-height: 1.15; letter-spacing: -.012em; overflow-wrap: anywhere; word-break: break-word; }
    .reward-desc { font-size: .78rem; font-weight: 430; color: #868b98; line-height: 1.32; overflow-wrap: anywhere; word-break: break-word; }
    .reward-cost { font-weight: 760; color:#283044; margin-top: auto; overflow-wrap: anywhere; }

    @media (min-width: 680px) and (orientation: portrait) {
      .reward-scroll { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    }

    .empty-state { color: var(--muted); background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); padding: 24px 18px; text-align: center; }

    .loading {
      min-height: 70vh; display: grid; place-items: center; text-align: center; color: var(--muted);
    }
    .loading[hidden], #dashboard[hidden] { display: none !important; }
    .loading-error { max-width: 520px; margin: 0 auto; padding: 18px; text-align: center; color: var(--danger); }
    .loading-error strong { display:block; margin-bottom:6px; color:var(--text); }
    .loading-error small { display:block; margin-top:8px; color:var(--muted); line-height:1.35; overflow-wrap:anywhere; }
    .loading-star { font-size: 3.4rem; animation: pulse 1s ease-in-out infinite alternate; }
    @keyframes pulse { from { transform: scale(.92) rotate(-4deg); opacity: .55; } to { transform: scale(1.08) rotate(4deg); opacity: 1; } }

    .overlay {
      position: fixed; inset: 0; padding: 18px; background: rgba(35, 29, 41, .42);
      display: none; align-items: flex-end; justify-content: center; z-index: 50;
      backdrop-filter: blur(5px);
    }
    .overlay.show { display: flex; }
    .sheet {
      width: min(100%, 560px); max-height: 90vh; overflow-y: auto;
      background: var(--surface); border-radius: 20px 20px 14px 14px; padding: 20px;
      box-shadow: 0 25px 70px rgba(0,0,0,.25);
    }
    .sheet-header { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 16px; }
    .close { width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--surface-soft); font-weight: 900; }
    .form-grid { display: grid; gap: 12px; }
    label { display: grid; gap: 6px; font-size: .82rem; color: var(--muted); font-weight: 750; }
    input, select, textarea { width: 100%; border: 1px solid var(--border); border-radius: 10px; background: white; color: var(--text); padding: 12px; outline: none; }
    input::placeholder, textarea::placeholder { color: #aaa3b3; font-style: italic; opacity: 1; }
    input:focus, select:focus, textarea:focus { border-color: var(--accent); }
    .primary { border: 0; border-radius: 10px; padding: 13px 16px; background: var(--accent); color: white; font-weight: 850; }
    .secondary { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; background: var(--surface); color: var(--text); font-weight: 800; }

    .grownup-intro { color: var(--muted); font-size: .86rem; margin-bottom: 14px; }
    .admin-card { border: 1px solid var(--border); border-radius: 16px; padding: 13px; background: var(--surface-soft); display: grid; gap: 8px; }
    .admin-card-title { font-weight: 850; }
    .admin-card-meta { color: var(--muted); font-size: .8rem; line-height: 1.35; }
    .danger-button { border: 1px solid #e0b7b7; border-radius: 14px; padding: 11px 13px; background: #fff7f7; color: var(--danger); font-weight: 850; }
    .danger-button:disabled { opacity: .45; cursor: default; }
    .activity-list { display: grid; gap: 8px; }
    .activity-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; align-items: center; border-bottom: 1px solid var(--border); padding: 8px 0; }
    .activity-row:last-child { border-bottom: 0; }
    .activity-title { font-size: .88rem; font-weight: 800; }
    .activity-meta { color: var(--muted); font-size: .75rem; margin-top: 2px; }
    .activity-stars { font-weight: 850; white-space: nowrap; }
    .activity-stars.negative { color: var(--danger); }
    .activity-stars.positive { color: var(--success); }

    .profile-choice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
    .choice { border: 2px solid var(--border); background: white; border-radius: 16px; padding: 12px 7px; font-weight: 800; text-align: center; }

    .toast {
      position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translate(-50%, 25px);
      background: #28242f; color: white; border-radius: 999px; padding: 10px 16px; z-index: 90;
      opacity: 0; pointer-events: none; transition: .2s ease; max-width: calc(100vw - 36px); text-align: center;
    }
    .toast.show { opacity: 1; transform: translate(-50%, 0); }

    .busy-cover { position: fixed; inset: 0; z-index: 80; display: none; background: rgba(247,245,251,.3); }
    .busy-cover.show { display: block; }

    .star-rain { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 100; }
    .falling-star { position: absolute; top: -40px; font-size: 1.5rem; animation: fall 1.5s ease-in forwards; }
    @keyframes fall { to { transform: translateY(110vh) rotate(420deg); opacity: .25; } }

    @media (orientation: landscape) and (min-width: 800px) {
      .app { width: min(1180px, 100%); }
      .reward-scroll { grid-template-columns: repeat(4, minmax(0,1fr)); overflow: visible; }
      .grab-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
    }
  

    /* v1.7.9 CSS-only compatibility layer
       Keep the proven v1.6.1 JavaScript renderer unchanged while reproducing
       the v1.7 profile/sticker/no-visual presentation from the existing DOM. */

    /* The working renderer outputs avatar, name, and stars as direct children. */
    .profile-card {
      grid-template-columns: 76px minmax(0, 1fr);
      grid-template-rows: 1fr 1fr;
      column-gap: 12px;
      row-gap: 0;
      background: var(--surface);
      border-color: var(--border);
    }
    .profile-avatar {
      grid-column: 1;
      grid-row: 1 / 3;
      align-self: center;
    }
    .profile-name {
      grid-column: 2;
      grid-row: 1;
      align-self: end;
      min-width: 0;
    }
    .profile-stars {
      grid-column: 2;
      grid-row: 2;
      align-self: start;
      margin-top: 6px;
      min-width: 0;
    }
    .profile-card.selected {
      background: var(--surface);
    }

    /* Use the existing --profile-color without adding any JS-generated variables. */
    @supports (background: color-mix(in srgb, white 50%, black)) {
      .profile-card {
        background: color-mix(in srgb, var(--profile-color, var(--accent)) 5%, white);
        border-color: color-mix(in srgb, var(--profile-color, var(--accent)) 24%, white);
      }
      .profile-card.selected {
        background: color-mix(in srgb, var(--profile-color, var(--accent)) 9%, white);
      }
      .profile-avatar::before {
        background: color-mix(in srgb, var(--profile-color, var(--accent)) 10%, white);
      }
    }

    /* Plain emoji text from the proven renderer gets the sticker treatment here. */
    .profile-avatar,
    .visual,
    .grab-visual,
    .reward-visual {
      text-shadow: 1px 0 #fff, -1px 0 #fff, 0 1px #fff, 0 -1px #fff;
    }

    /* Drive images keep alpha-aware sticker depth without requiring a JS class. */
    .profile-avatar img,
    .visual img,
    .grab-visual img,
    .reward-visual img {
      width: 100%;
      height: 100%;
      object-fit: contain;
      filter: drop-shadow(1px 0 0 #fff)
              drop-shadow(-1px 0 0 #fff)
              drop-shadow(0 1px 0 #fff)
              drop-shadow(0 -1px 0 #fff)
              drop-shadow(0 4px 5px rgba(31,37,54,.15));
    }

    /* The proven renderer emits an empty placeholder div for blank UFG visuals. */
    .grab-card > div:empty:first-child { display: none; }
    .grab-card > div:empty:first-child + div { grid-column: 1 / -1; }

    @media (max-width: 620px) {
      .profile-card {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        row-gap: 4px;
      }
      .profile-avatar {
        grid-column: 1;
        grid-row: 1;
      }
      .profile-name {
        grid-column: 1;
        grid-row: 2;
        align-self: center;
      }
      .profile-stars {
        grid-column: 1;
        grid-row: 3;
        align-self: center;
        margin-top: 2px;
      }
    }

    /* v1.8.0 visual refinement
       CSS-only: preserves the proven v1.7.9 JavaScript renderer exactly. */

    /* Typography: softer humanist system face on Apple hardware. */
    html, body {
      font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
      font-weight: 400;
      letter-spacing: 0;
    }
    .eyebrow { font-weight: 600; letter-spacing: .095em; }
    h1 { font-weight: 700; letter-spacing: -.035em; }
    h2 { font-weight: 650; letter-spacing: -.018em; }
    .adult-button { font-weight: 600; }
    .section-note { font-weight: 450; }

    /* Profiles: airy white cards, subtle elevation, no exterior caret or halo. */
    .profiles {
      gap: 16px;
      margin-left: 10px;
      margin-right: 10px;
      margin-bottom: 26px;
    }
    .profile-card {
      min-height: 118px;
      padding: 14px 16px;
      grid-template-columns: 82px minmax(0, 1fr);
      border: 1px solid #e2e0e6;
      background: #fff !important;
      box-shadow: 0 5px 16px rgba(31,37,54,.075);
    }
    .profile-card.selected {
      border: 2px solid var(--profile-color, var(--accent));
      background: #fff !important;
      box-shadow: 0 7px 20px rgba(31,37,54,.10);
    }
    .profile-card.selected::after { display: none !important; }
    .profile-avatar::before { display: none !important; }
    .profile-avatar {
      width: 80px;
      height: 80px;
      font-size: 3.8rem;
      overflow: visible;
    }
    .profile-name {
      font-size: 1.16rem;
      font-weight: 650;
      letter-spacing: -.008em;
    }
    .profile-stars {
      margin-top: 6px;
      font-size: 1rem;
      font-weight: 500;
      color: #3f4655;
      gap: 6px;
    }

    /* Stronger sticker treatment for color emoji without adding DOM wrappers. */
    .profile-avatar,
    .visual,
    .grab-visual,
    .reward-visual {
      text-shadow:
        -2px -2px 0 #fff, 0 -2px 0 #fff, 2px -2px 0 #fff,
        -2px  0   0 #fff,                 2px  0   0 #fff,
        -2px  2px 0 #fff, 0  2px 0 #fff, 2px  2px 0 #fff,
        0 4px 5px rgba(31,37,54,.18);
    }
    .profile-avatar img,
    .visual img,
    .grab-visual img,
    .reward-visual img {
      filter:
        drop-shadow(2px 0 0 #fff)
        drop-shadow(-2px 0 0 #fff)
        drop-shadow(0 2px 0 #fff)
        drop-shadow(0 -2px 0 #fff)
        drop-shadow(1.5px 1.5px 0 #fff)
        drop-shadow(-1.5px 1.5px 0 #fff)
        drop-shadow(0 4px 5px rgba(31,37,54,.18));
    }

    /* Tasks: white surface, profile color stays on the accent edge and assignee pill. */
    .task-card {
      background: #fff !important;
      border-color: #e2e0e6;
      border-left-color: var(--task-accent, var(--border));
      box-shadow: 0 2px 8px rgba(31,37,54,.035);
      padding: 12px 14px 12px 11px;
      gap: 14px;
    }
    .task-card.missed {
      background: #fff !important;
      border-color: #ead5d5;
      border-left-color: #cf6666;
      opacity: .58;
    }
    .task-card.completed { opacity: .58; }
    .task-title {
      font-size: 1.02rem;
      font-weight: 650;
      letter-spacing: -.004em;
    }
    .meta { margin-top: 7px; font-size: .78rem; font-weight: 450; }
    .pill {
      font-weight: 600;
      background: #f5f4f7;
      border: 1px solid #ebe8ef;
      padding: 3px 8px;
    }
    .task-card .meta > .pill:first-child {
      color: var(--task-accent, #606776);
    }
    @supports (background: color-mix(in srgb, white 50%, black)) {
      .task-card .meta > .pill:first-child {
        background: color-mix(in srgb, var(--task-accent, #737987) 10%, white);
        border-color: color-mix(in srgb, var(--task-accent, #737987) 24%, white);
      }
    }
    .star-pill {
      color: #7a5b0c;
      background: #fff8dc !important;
      border-color: #f4e6ad !important;
    }
    .missed-pill {
      color: #ad4242;
      background: #fff3f3 !important;
      border-color: #efc5c5 !important;
    }
    .missed-pill::before {
      content: '✕';
      display: inline-grid;
      place-items: center;
      width: 15px;
      height: 15px;
      border-radius: 50%;
      margin-right: 2px;
      background: #d95a5a;
      color: #fff;
      font-size: .62rem;
      line-height: 1;
      font-weight: 700;
    }

    /* Up for Grabs: keep the gold accent, but return to a clean white card. */
    .grab-card {
      background: #fff;
      border-color: #e4e1e7;
      border-left-color: #e3a612;
      box-shadow: 0 2px 7px rgba(31,37,54,.03);
      padding: 12px 13px 12px 11px;
    }
    .grab-card:active { background: #fffdf8; }
    .grab-card.missed {
      background: #fff;
      border-color: #ead5d5;
      border-left-color: #cf6666;
      opacity: .58;
    }
    .grab-title { font-weight: 650; letter-spacing: 0; }
    .grab-meta { font-weight: 550; }
    .grab-card.missed .grab-meta span:last-child { color: #ad4242; }

    /* Rewards: dedicated sticker area left, text/progress right, restrained color. */
    .reward-scroll { gap: 14px; }
    .reward-card {
      position: relative;
      min-height: 154px;
      padding: 15px 16px 15px 14px;
      display: grid;
      grid-template-columns: 96px minmax(0, 1fr);
      grid-template-rows: auto auto 1fr auto;
      column-gap: 14px;
      row-gap: 5px;
      align-items: start;
      background: #fff !important;
      border-color: #dfdbe5;
      box-shadow: 0 3px 10px rgba(31,37,54,.045);
      overflow: visible;
    }
    @supports (background: color-mix(in srgb, white 50%, black)) {
      .reward-card {
        background: color-mix(in srgb, var(--reward-progress-color, #efe9f6) 9%, white) !important;
        border-color: color-mix(in srgb, var(--reward-border, #cfc5dd) 34%, #e7e3eb);
      }
    }
    .reward-visual {
      grid-column: 1;
      grid-row: 1 / 5;
      align-self: center;
      justify-self: center;
      width: 88px;
      height: 88px;
      font-size: 3.45rem;
      transform-origin: 50% 55%;
    }
    .reward-card:nth-child(3n+1) .reward-visual { transform: rotate(-4deg); }
    .reward-card:nth-child(3n+2) .reward-visual { transform: rotate(3deg); }
    .reward-card:nth-child(3n) .reward-visual { transform: rotate(-2deg); }
    .reward-name {
      grid-column: 2;
      grid-row: 1;
      font-size: 1rem;
      font-weight: 650;
      letter-spacing: -.003em;
      line-height: 1.18;
    }
    .reward-desc {
      grid-column: 2;
      grid-row: 2;
      font-size: .77rem;
      font-weight: 400;
      color: #858b98;
      line-height: 1.38;
    }
    .reward-cost {
      grid-column: 2;
      grid-row: 4;
      margin-top: 18px;
      font-weight: 600;
      color: #353c4a;
    }
    .reward-card::before {
      content: '';
      position: absolute;
      left: 124px;
      right: 16px;
      bottom: 42px;
      height: 7px;
      border-radius: 999px;
      background: linear-gradient(
        to right,
        var(--reward-progress-color, #bfa8dc) 0%,
        var(--reward-progress-color, #bfa8dc) var(--reward-progress, 0%),
        #ebe8ef var(--reward-progress, 0%),
        #ebe8ef 100%
      );
      opacity: .92;
    }
    .reward-card:has(.reward-visual) .reward-name,
    .reward-card:has(.reward-visual) .reward-desc,
    .reward-card:has(.reward-visual) .reward-cost { min-width: 0; }
    .reward-card:not(:has(.reward-visual)) {
      grid-template-columns: 1fr;
    }
    .reward-card:not(:has(.reward-visual)) .reward-name,
    .reward-card:not(:has(.reward-visual)) .reward-desc,
    .reward-card:not(:has(.reward-visual)) .reward-cost { grid-column: 1; }
    .reward-card:not(:has(.reward-visual))::before { left: 16px; }

    /* Secondary/admin typography follows the softer visual language too. */
    label { font-weight: 600; }
    .primary { font-weight: 650; }
    .secondary { font-weight: 600; }
    .admin-card-title { font-weight: 650; }
    .danger-button { font-weight: 650; }
    .activity-title { font-weight: 600; }
    .activity-stars { font-weight: 650; }
    .choice { font-weight: 600; }

    @media (max-width: 620px) {
      .profiles { margin-left: 2px; margin-right: 2px; gap: 10px; }
      .profile-card { min-height: 110px; padding: 12px 8px 14px; }
      .profile-avatar { width: 64px; height: 64px; font-size: 3rem; }
      .reward-card {
        grid-template-columns: 78px minmax(0, 1fr);
        column-gap: 10px;
      }
      .reward-visual { width: 72px; height: 72px; font-size: 2.9rem; }
      .reward-card::before { left: 102px; }
    }



    /* v1.8.1 iOS polish + responsive reward/missed-state refinement */

    /* Profile content: center the artwork/name group inside each card. */
    .profiles {
      margin-left: 18px;
      margin-right: 18px;
    }
    .profile-card {
      grid-template-columns: 84px auto;
      justify-content: center;
      column-gap: 18px;
    }
    .profile-name {
      font-size: 1.32rem;
      font-weight: 600;
    }
    .profile-stars {
      font-size: 1.04rem;
    }

    /* Sticker effect: white cut edge, subtle dark edge around the full silhouette,
       then a small depth shadow below. */
    .profile-avatar,
    .visual,
    .grab-visual,
    .reward-visual {
      text-shadow:
        -2px -2px 0 #fff, 0 -2px 0 #fff, 2px -2px 0 #fff,
        -2px  0   0 #fff,                 2px  0   0 #fff,
        -2px  2px 0 #fff, 0  2px 0 #fff, 2px  2px 0 #fff,
        -3px -3px 3px rgba(35,39,51,.24), 3px -3px 3px rgba(35,39,51,.24),
        -3px  3px 3px rgba(35,39,51,.24), 3px  3px 3px rgba(35,39,51,.24),
        0 5px 5px rgba(31,37,54,.16);
    }
    .profile-avatar img,
    .visual img,
    .grab-visual img,
    .reward-visual img {
      filter:
        drop-shadow(2px 0 0 #fff)
        drop-shadow(-2px 0 0 #fff)
        drop-shadow(0 2px 0 #fff)
        drop-shadow(0 -2px 0 #fff)
        drop-shadow(1.5px 1.5px 0 #fff)
        drop-shadow(-1.5px -1.5px 0 #fff)
        drop-shadow(0 0 2px rgba(35,39,51,.42))
        drop-shadow(0 4px 4px rgba(31,37,54,.16));
    }

    /* Up for Grabs: active cards first; the first missed card starts a fresh row. */
    .grab-card.first-missed {
      grid-column: 1;
    }
    .grab-card.missed {
      position: relative;
      padding-right: 96px;
    }
    .grab-card.missed .grab-meta span:last-child {
      display: none;
    }
    .grab-card.missed::before {
      content: '✕';
      position: absolute;
      right: 67px;
      top: 50%;
      transform: translateY(-50%);
      width: 18px;
      height: 18px;
      border-radius: 50%;
      display: grid;
      place-items: center;
      background: #d95a5a;
      color: #fff;
      font-size: .65rem;
      line-height: 1;
      font-weight: 700;
    }
    .grab-card.missed::after {
      content: 'Missed';
      position: absolute;
      right: 13px;
      top: 50%;
      transform: translateY(-50%);
      color: #b44949;
      font-size: .76rem;
      font-weight: 600;
      white-space: nowrap;
      text-align: right;
    }

    /* Reward buttons should never inherit iOS control tint. */
    .reward-card {
      -webkit-appearance: none;
      appearance: none;
      color: var(--text) !important;
      text-align: left;
      min-height: 142px;
      grid-template-columns: 98px minmax(0, 1fr);
      grid-template-rows: auto auto auto auto;
      align-content: center;
      row-gap: 7px;
      padding: 14px 16px 14px 14px;
      overflow: visible;
    }
    .reward-name,
    .reward-desc,
    .reward-cost {
      color: inherit;
    }
    .reward-name {
      color: var(--text) !important;
    }
    .reward-desc {
      color: #858b98 !important;
    }
    .reward-visual {
      width: 92px;
      height: 92px;
      font-size: 3.6rem;
    }
    .reward-cost {
      grid-column: 2;
      grid-row: 4;
      margin-top: 0;
      padding-top: 1px;
    }

    /* Progress bar now participates in the grid so descriptions can never collide with it. */
    .reward-card::before {
      position: static;
      grid-column: 2;
      grid-row: 3;
      align-self: center;
      width: 100%;
      height: 7px;
      border-radius: 999px;
      background: linear-gradient(
        to right,
        var(--profile-color, #8b5cc4) 0%,
        var(--profile-color, #8b5cc4) var(--reward-progress, 0%),
        #ebe8ef var(--reward-progress, 0%),
        #ebe8ef 100%
      );
      opacity: .95;
    }
    .reward-card:not(:has(.reward-visual)) {
      grid-template-columns: 1fr;
    }
    .reward-card:not(:has(.reward-visual)) .reward-name,
    .reward-card:not(:has(.reward-visual)) .reward-desc,
    .reward-card:not(:has(.reward-visual)) .reward-cost,
    .reward-card:not(:has(.reward-visual))::before {
      grid-column: 1;
    }

    /* Affordable rewards get an obvious but restrained payoff state. */
    .reward-card:not(.unavailable) {
      border-color: var(--reward-border, #b9a8cf);
      box-shadow: 0 4px 14px rgba(122,85,163,.12);
      animation: rewardReadyGlow 2.8s ease-in-out infinite;
    }
    .reward-card:not(.unavailable)::after {
      content: 'Ready!';
      position: absolute;
      top: 10px;
      right: 10px;
      padding: 4px 8px;
      border-radius: 999px;
      background: var(--reward-progress-color, #bfa8dc);
      color: #2f2340;
      font-size: .68rem;
      font-weight: 650;
      letter-spacing: .01em;
      box-shadow: 0 2px 7px rgba(31,37,54,.12);
    }
    @keyframes rewardReadyGlow {
      0%, 100% { box-shadow: 0 4px 14px rgba(122,85,163,.10); }
      50% { box-shadow: 0 5px 19px rgba(122,85,163,.20); }
    }

    @media (max-width: 620px) {
      .profiles {
        margin-left: 6px;
        margin-right: 6px;
      }
      .profile-card {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        justify-items: center;
        text-align: center;
      }
      .profile-name {
        font-size: 1.08rem;
        text-align: center;
      }
      .profile-stars {
        justify-self: center;
        text-align: center;
      }
      .reward-card {
        grid-template-columns: 86px minmax(0, 1fr);
        grid-template-rows: auto auto auto auto;
        min-height: 148px;
        column-gap: 12px;
      }
      .reward-visual {
        width: 80px;
        height: 80px;
        font-size: 3.1rem;
      }
      .reward-card::before,
      .reward-card:not(:has(.reward-visual))::before {
        left: auto;
        right: auto;
        bottom: auto;
      }
      .reward-card:not(.unavailable)::after {
        top: 8px;
        right: 8px;
      }
    }


    /* v1.8.3 sticker breathing room + reward-ready sparkle polish
       CSS-only. JavaScript remains byte-for-byte identical to v1.8.2. */

    /* Give sticker shadows a few pixels of paint room without changing their
       layout footprint, then use an alpha-aware full-silhouette gray edge. */
    .profile-avatar,
    .visual,
    .grab-visual,
    .reward-visual {
      box-sizing: content-box;
      padding: 3px;
      margin: -3px;
      overflow: visible;
      text-shadow:
        -2px -2px 0 #fff, 0 -2px 0 #fff, 2px -2px 0 #fff,
        -2px  0   0 #fff,                 2px  0   0 #fff,
        -2px  2px 0 #fff, 0  2px 0 #fff, 2px  2px 0 #fff;
      filter:
        drop-shadow(0 0 1.35px rgba(45,49,61,.34))
        drop-shadow(0 4px 4px rgba(31,37,54,.14));
    }
    .profile-avatar img,
    .visual img,
    .grab-visual img,
    .reward-visual img {
      filter:
        drop-shadow(2px 0 0 #fff)
        drop-shadow(-2px 0 0 #fff)
        drop-shadow(0 2px 0 #fff)
        drop-shadow(0 -2px 0 #fff)
        drop-shadow(1.5px 1.5px 0 #fff)
        drop-shadow(-1.5px 1.5px 0 #fff)
        drop-shadow(1.5px -1.5px 0 #fff)
        drop-shadow(-1.5px -1.5px 0 #fff);
    }

    /* Reward-ready state: no badge and no dark selected-card treatment.
       Keep the card stable while the surrounding aura and tiny sparkles pulse. */
    .reward-card:not(.unavailable) {
      border-color: #dfdbe5;
      box-shadow: 0 3px 10px rgba(31,37,54,.045);
      animation: rewardReadyAura 2.9s ease-in-out infinite;
    }
    .reward-card:not(.unavailable)::after {
      content: none !important;
      display: none !important;
    }
    .reward-visual {
      position: relative;
    }
    .reward-card:not(.unavailable) .reward-visual::before,
    .reward-card:not(.unavailable) .reward-visual::after {
      position: absolute;
      z-index: 2;
      pointer-events: none;
      color: #efb625;
      line-height: 1;
      text-shadow: 0 1px 3px rgba(145,101,0,.14);
      animation: rewardSparkle 2.4s ease-in-out infinite;
    }
    .reward-card:not(.unavailable) .reward-visual::before {
      content: '✦';
      top: -1px;
      right: 1px;
      font-size: .9rem;
    }
    .reward-card:not(.unavailable) .reward-visual::after {
      content: '✧';
      left: 0;
      bottom: 3px;
      font-size: .78rem;
      animation-delay: -1.2s;
    }

    @supports (color: color-mix(in srgb, white 50%, black)) {
      .reward-card:not(.unavailable) {
        border-color: color-mix(in srgb, var(--reward-border, #cfc5dd) 34%, #dfdbe5);
      }
      @keyframes rewardReadyAura {
        0%, 100% {
          box-shadow:
            0 3px 10px rgba(31,37,54,.045),
            0 0 10px 0 color-mix(in srgb, var(--reward-border, #cfc5dd) 20%, transparent);
        }
        50% {
          box-shadow:
            0 3px 10px rgba(31,37,54,.045),
            0 0 19px 2px color-mix(in srgb, var(--reward-border, #cfc5dd) 38%, transparent);
        }
      }
    }
    @keyframes rewardReadyAura {
      0%, 100% {
        box-shadow: 0 3px 10px rgba(31,37,54,.045), 0 0 10px rgba(122,85,163,.08);
      }
      50% {
        box-shadow: 0 3px 10px rgba(31,37,54,.045), 0 0 18px rgba(122,85,163,.16);
      }
    }
    @keyframes rewardSparkle {
      0%, 100% { opacity: .28; transform: scale(.72) rotate(-8deg); }
      48% { opacity: .95; transform: scale(1.12) rotate(7deg); }
      62% { opacity: .7; transform: scale(.94) rotate(2deg); }
    }

  

    /* v1.9.2 Manage Household shell. Isolated from the known-good dashboard script. */
    .sheet.management-sheet {
      width: min(100%, 680px);
      height: min(760px, 90vh);
      max-height: 90vh;
      overflow: hidden;
      display: flex;
      flex-direction: column;
    }
    .sheet.management-sheet .sheet-header {
      flex: 0 0 auto;
      margin-bottom: 12px;
    }
    .sheet.management-sheet #modalBody {
      flex: 1 1 auto;
      min-height: 0;
      overflow: hidden;
      display: flex;
      flex-direction: column;
    }
    .management-shell {
      flex: 1 1 auto;
      min-height: 0;
      display: flex;
      flex-direction: column;
    }
    .management-intro {
      flex: 0 0 auto;
      color: var(--muted);
      font-size: .82rem;
      line-height: 1.35;
      margin: 0 0 8px;
    }
    .management-nav {
      flex: 0 0 auto;
      display: grid;
      grid-template-columns: repeat(5, minmax(0, 1fr));
      gap: 5px;
      padding: 4px;
      margin: 0 0 12px;
      border-radius: 12px;
      background: #f1eff4;
    }
    .management-tab {
      min-height: 44px;
      border: 0;
      border-radius: 9px;
      padding: 7px 5px;
      background: transparent;
      color: #686e7c;
      font-size: .72rem;
      line-height: 1.15;
      font-weight: 550;
    }
    .management-tab.active {
      background: #fff;
      color: var(--text);
      box-shadow: 0 1px 5px rgba(31,37,54,.08);
      font-weight: 650;
    }
    .management-scroll {
      flex: 1 1 auto;
      min-height: 0;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
      padding: 2px 2px 18px;
    }
    .management-panel-title {
      margin: 0 0 12px;
      font-size: 1rem;
      font-weight: 650;
    }
    .management-list {
      z-index: 1;
      display: grid;
      gap: 9px;
    }
    .management-row {
      display: grid;
      grid-template-columns: 52px minmax(0,1fr);
      align-items: center;
      gap: 11px;
      padding: 11px 12px;
      border: 1px solid #e4e1e7;
      border-radius: 11px;
      background: #fff;
      box-shadow: 0 2px 7px rgba(31,37,54,.025);
    }
    .management-row-emoji {
      width: 48px;
      height: 48px;
      display: grid;
      place-items: center;
      font-size: 2rem;
      line-height: 1;
    }
    .management-row-main { min-width: 0; }
    .management-row-name {
      font-size: .96rem;
      line-height: 1.18;
      font-weight: 650;
      overflow-wrap: anywhere;
    }
    .management-row-meta {
      margin-top: 4px;
      color: #7b818d;
      font-size: .75rem;
      line-height: 1.35;
      font-weight: 450;
      overflow-wrap: anywhere;
    }
    .management-row.profile-row {
      grid-template-columns: 52px minmax(0,1fr) 20px;
    }
    .management-profile-name-badge {
      display: inline-block;
      max-width: 100%;
      padding: 4px 9px;
      border-radius: 999px;
      background: color-mix(in srgb, var(--management-profile-color, var(--accent)) 14%, white);
      color: color-mix(in srgb, var(--management-profile-color, var(--accent)) 76%, #182033);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      vertical-align: middle;
    }
    .management-count {
      color: #858a96;
      font-size: .76rem;
      margin-bottom: 10px;
    }
    .management-activity-details {
      margin-top: 14px;
      border-top: 1px solid var(--border);
      padding-top: 4px;
    }
    .management-activity-details summary {
      list-style: none;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      padding: 12px 2px 10px;
      font-size: 1rem;
      font-weight: 650;
      color: var(--text);
    }
    .management-activity-details summary::-webkit-details-marker { display: none; }
    .management-activity-caret {
      display: inline-block;
      color: var(--muted);
      font-size: 1.25rem;
      line-height: 1;
      transform: rotate(0deg);
      transition: transform .18s ease;
    }
    .management-activity-details[open] .management-activity-caret { transform: rotate(90deg); }
    .management-activity-body { padding-bottom: 8px; }
    @media (max-width: 560px) {
      .management-tab { font-size: .67rem; padding-left: 3px; padding-right: 3px; }
    }

    /* v1.10.0 Task management editor */
    .management-list-header {
      min-height: 38px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 10px;
    }
    .management-list-header .management-count { margin: 0; }
    .management-add-button {
      border: 0;
      border-radius: 10px;
      padding: 9px 12px;
      background: var(--accent);
      color: #fff;
      font-size: .78rem;
      font-weight: 650;
      white-space: nowrap;
    }
    .management-row-action {
      width: 100%;
      grid-template-columns: 52px minmax(0,1fr) 20px;
      color: var(--text);
      text-align: left;
      cursor: pointer;
      font: inherit;
    }
    .management-row-action:active { transform: scale(.995); }
    .management-row-caret {
      justify-self: end;
      color: #a6a2ad;
      font-size: 1.5rem;
      line-height: 1;
    }

    .profile-sort-helper {
      margin: -2px 2px 10px;
      color: #7b818d;
      font-size: .73rem;
      line-height: 1.35;
    }
    .management-row.profile-sort-row {
      grid-template-columns: 38px minmax(0,1fr);
      gap: 0;
      padding: 0;
      overflow: hidden;
      transition: border-color .12s ease, background-color .12s ease;
    }
    .profile-sort-open {
      min-width: 0;
      width: 100%;
      display: grid;
      grid-template-columns: 52px minmax(0,1fr) 20px;
      align-items: center;
      gap: 11px;
      padding: 11px 12px 11px 8px;
      border: 0;
      background: transparent;
      color: var(--text);
      text-align: left;
      font: inherit;
      cursor: pointer;
    }
    .profile-sort-open:active { background: #faf9fb; }
    .profile-sort-handle {
      align-self: stretch;
      min-height: 70px;
      display: grid;
      place-items: center;
      border: 0;
      border-right: 1px solid #ece9ef;
      background: #faf9fb;
      color: #9a95a2;
      font: inherit;
      font-size: 1rem;
      font-weight: 800;
      letter-spacing: -4px;
      cursor: grab;
      touch-action: none;
      user-select: none;
      -webkit-user-select: none;
    }
    .profile-sort-handle:active { cursor: grabbing; background: #f4f1f7; }
    .profile-sort-list.sorting-profiles { position: relative; }
    .profile-sort-row.sort-placeholder {
      border-style: dashed;
      border-color: color-mix(in srgb, var(--management-profile-color, var(--accent)) 30%, #dedee7);
      background: color-mix(in srgb, var(--management-profile-color, var(--accent)) 4%, #fbfafc);
      box-shadow: inset 0 0 0 1px rgba(255,255,255,.62);
    }
    .profile-sort-row.sort-placeholder > * {
      opacity: 0;
      pointer-events: none;
    }
    .profile-sort-floating {
      position: fixed !important;
      z-index: 1400;
      margin: 0 !important;
      pointer-events: none !important;
      overflow: hidden;
      border-color: color-mix(in srgb, var(--management-profile-color, var(--accent)) 54%, #dedee7) !important;
      background: #fff;
      box-shadow: 0 14px 34px rgba(31,37,54,.20), 0 3px 9px rgba(31,37,54,.10);
      transform: scale(1.018);
      transform-origin: center;
      will-change: top, left, transform;
      transition: box-shadow .12s ease, transform .12s ease;
    }
    .profile-sort-floating .profile-sort-handle {
      cursor: grabbing;
      background: #f5f2f8;
    }
    .profile-sort-floating.sort-settling {
      transform: scale(1);
      box-shadow: 0 4px 12px rgba(31,37,54,.10);
      transition: top .14s cubic-bezier(.2,.72,.2,1), left .14s cubic-bezier(.2,.72,.2,1), width .14s cubic-bezier(.2,.72,.2,1), transform .14s ease, box-shadow .14s ease;
    }
    .profile-sort-row.sort-dragging { cursor: grabbing; }
    @media (prefers-reduced-motion: reduce) {
      .profile-sort-floating,
      .profile-sort-floating.sort-settling { transition: none; }
    }
    .management-editor { padding-bottom: 8px; }
    .management-back-button {
      border: 0;
      background: transparent;
      color: var(--accent);
      padding: 2px 0 8px;
      font-size: .82rem;
      font-weight: 650;
    }
    .management-editor-heading {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 14px;
    }
    .management-editor-heading h3 {
      margin: 0;
      font-size: 1.12rem;
      font-weight: 700;
    }
    .management-editor-heading p {
      margin: 4px 0 0;
      color: var(--muted);
      font-size: .76rem;
      line-height: 1.35;
    }
    .management-editor-section {
      padding: 14px 0;
      border-top: 1px solid var(--border);
    }
    .management-editor-section:first-of-type { border-top: 0; padding-top: 4px; }
    .management-editor-section-title {
      margin-bottom: 9px;
      font-size: .86rem;
      font-weight: 700;
      color: var(--text);
    }
    .management-editor-grid {
      display: grid;
      grid-template-columns: minmax(0,1fr) 110px 110px;
      gap: 10px;
    }
    .management-editor-grid .wide-field { grid-column: 1 / -1; }
    .management-editor label {
      display: grid;
      gap: 6px;
      font-size: .76rem;
      font-weight: 650;
      color: #5f6470;
    }
    .management-editor input,
    .management-editor select,
    .management-editor textarea {
      font-weight: 500;
      color: var(--text);
    }
    .management-editor textarea { resize: vertical; min-height: 64px; }
    .management-editor .emoji-input { text-align: center; font-size: 1.25rem; }
    .management-optional { font-weight: 450; color: var(--muted); }
    .management-choice-grid {
      display: grid;
      gap: 8px;
    }
    .management-choice-grid.two { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .management-choice-grid.three { grid-template-columns: repeat(3, minmax(0,1fr)); }
    .management-choice {
      min-height: 54px;
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      justify-content: center;
      gap: 3px;
      padding: 9px 11px;
      border: 1px solid #ddd9e2;
      border-radius: 10px;
      background: #fff;
      color: var(--text);
      text-align: left;
    }
    .management-choice.selected {
      border-color: var(--accent);
      background: #f8f4fb;
      box-shadow: inset 0 0 0 1px var(--accent);
    }
    .management-choice-title { font-size: .8rem; font-weight: 650; }
    .management-choice-subtitle { color: var(--muted); font-size: .68rem; line-height: 1.25; font-weight: 450; }
    .management-choice-grid.compact .management-choice { min-height: 44px; align-items: center; text-align: center; }
    .management-person-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(0,1fr));
      gap: 8px;
    }
    .management-person-button {
      min-height: 48px;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      padding: 8px;
      border: 1px solid #ddd9e2;
      border-radius: 10px;
      background: #fff;
      color: var(--text);
      font-size: .76rem;
      font-weight: 600;
    }
    .management-person-button.selected {
      border-color: var(--accent);
      background: #f8f4fb;
      box-shadow: inset 0 0 0 1px var(--accent);
    }
    .management-person-emoji { font-size: 1.05rem; }
    .management-helper {
      margin-top: 7px;
      color: var(--muted);
      font-size: .68rem;
      line-height: 1.35;
    }
    .management-locked-value {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      gap: 12px;
      padding: 11px 12px;
      border: 1px solid #e4e1e7;
      border-radius: 10px;
      background: #f7f6f8;
      font-size: .8rem;
    }
    .management-locked-value span { color: var(--muted); font-size: .7rem; text-align: right; }
    .management-subsection { margin-top: 12px; }
    .management-subsection-label {
      margin-bottom: 7px;
      color: #696e79;
      font-size: .72rem;
      font-weight: 650;
    }
    .management-day-grid {
      display: grid;
      grid-template-columns: repeat(7, minmax(0,1fr));
      gap: 6px;
    }
    .management-day-button {
      aspect-ratio: 1;
      min-height: 40px;
      border: 1px solid #ddd9e2;
      border-radius: 50%;
      background: #fff;
      color: #656a75;
      font-size: .76rem;
      font-weight: 650;
    }
    .management-day-button.selected {
      border-color: var(--accent);
      background: var(--accent);
      color: #fff;
    }
    .management-inline-field {
      display: grid !important;
      grid-template-columns: auto 82px minmax(110px, 150px);
      align-items: center;
      justify-content: start;
      gap: 8px !important;
    }
    .management-inline-field input,
    .management-inline-field select { min-width: 0; }
    .management-editor-actions {
      display: grid;
      grid-template-columns: minmax(0,1fr) minmax(0,1fr);
      gap: 8px;
      padding-top: 14px;
      border-top: 1px solid var(--border);
    }
    .management-editor-actions .management-archive-button {
      grid-column: 1 / -1;
      margin-top: 4px;
    }
    @media (max-width: 560px) {
      .management-editor-grid { grid-template-columns: minmax(0,1fr) 92px 92px; }
      .management-person-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
      .management-choice-grid.three { grid-template-columns: 1fr; }
      .management-choice-grid.three.compact { grid-template-columns: repeat(3, minmax(0,1fr)); }
    }


    /* v1.12.0 Profile management editor */
    .management-color-input {
      min-height: 44px;
      padding: 4px !important;
      cursor: pointer;
    }
    .management-color-input::-webkit-color-swatch-wrapper { padding: 0; }
    .management-color-input::-webkit-color-swatch {
      border: 0;
      border-radius: 9px;
    }


    /* v1.13 dashboard behavior + reward fanfare */
    .task-heading-tools {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 9px;
      flex: 0 0 auto;
    }
    .task-view-toggle {
      -webkit-appearance: none;
      appearance: none;
      border: 1px solid #dedbe4;
      background: #fff;
      color: #5f6572;
      border-radius: 999px;
      padding: 5px 10px;
      font: inherit;
      font-size: .76rem;
      font-weight: 650;
      line-height: 1;
      white-space: nowrap;
    }
    .task-view-toggle.active {
      border-color: #c9bfd8;
      background: #f2eef8;
      color: #654786;
    }
    .profile-task-pill {
      color: var(--pill-color, #606776) !important;
      background: var(--pill-bg, #f5f4f7) !important;
      border-color: var(--pill-border, #ebe8ef) !important;
    }
    .assignee-pill { padding: 3px 7px; font-size: .74rem; }
    .completed-by-pill { padding: 3px 8px; font-size: .75rem; }
    .grab-meta .profile-task-pill {
      font-size: .72rem;
      padding: 3px 7px;
    }

    /* Reward cards stay clean white. Color is reserved for border, progress and ready-state glow. */
    .reward-card { background: #fff !important; }
    @supports (background: color-mix(in srgb, white 50%, black)) {
      .reward-card { background: #fff !important; }
    }
    .reward-card::before {
      background: linear-gradient(
        to right,
        var(--profile-color, #3F8F88) 0%,
        var(--profile-color, #3F8F88) var(--reward-progress, 0%),
        #ebe8ef var(--reward-progress, 0%),
        #ebe8ef 100%
      );
    }
    .reward-card:not(.unavailable) {
      border-color: var(--reward-border, #b8d4d1);
      animation: rewardReadyAuraTeal 2.9s ease-in-out infinite;
    }
    @keyframes rewardReadyAuraTeal {
      0%, 100% { box-shadow: 0 3px 10px rgba(31,37,54,.045), 0 0 10px rgba(63,143,136,.07); }
      50% { box-shadow: 0 3px 10px rgba(31,37,54,.045), 0 0 18px rgba(63,143,136,.15); }
    }

    .reward-fanfare {
      position: fixed;
      inset: 0;
      z-index: 140;
      display: grid;
      place-items: center;
      overflow: hidden;
      pointer-events: none;
      background: rgba(255,255,255,.34);
      backdrop-filter: blur(2px);
      -webkit-backdrop-filter: blur(2px);
      animation: fanfareBackdrop .25s ease-out both;
    }
    .reward-fanfare.leaving { animation: fanfareLeave .38s ease-in both; }
    .reward-fanfare-card {
      position: relative;
      z-index: 2;
      width: min(74vw, 420px);
      min-height: 330px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      text-align: center;
      border-radius: 34px;
      padding: 34px 30px 30px;
      background: rgba(255,255,255,.96);
      border: 2px solid color-mix(in srgb, var(--fanfare-color, #3F8F88) 34%, white);
      box-shadow:
        0 20px 54px rgba(31,37,54,.18),
        0 0 44px color-mix(in srgb, var(--fanfare-color, #3F8F88) 24%, transparent);
      animation: fanfareCardPop .72s cubic-bezier(.18,.9,.25,1.2) both;
    }
    .reward-fanfare-visual {
      position: relative;
      z-index: 3;
      width: 126px;
      height: 126px;
      display: grid;
      place-items: center;
      font-size: 6.4rem;
      line-height: 1;
      margin-bottom: 18px;
      filter: drop-shadow(0 8px 9px rgba(31,37,54,.18));
      animation: fanfareHero 1s cubic-bezier(.16,.9,.25,1.25) both;
    }
    .reward-fanfare-visual .emoji-sticker { font-size: 1em; }
    .reward-fanfare-visual img { width: 100%; height: 100%; object-fit: contain; }
    .reward-fanfare-kicker {
      font-size: .92rem;
      font-weight: 800;
      letter-spacing: .08em;
      text-transform: uppercase;
      color: var(--fanfare-color, #3F8F88);
      margin-bottom: 6px;
      animation: fanfareText .48s .3s ease-out both;
    }
    .reward-fanfare-name {
      font-size: clamp(1.75rem, 5vw, 2.45rem);
      line-height: 1.08;
      font-weight: 760;
      letter-spacing: -.025em;
      color: #252a36;
      animation: fanfareText .5s .38s ease-out both;
    }
    .reward-fanfare-profile {
      margin-top: 13px;
      padding: 6px 12px;
      border-radius: 999px;
      font-size: .84rem;
      font-weight: 700;
      color: color-mix(in srgb, var(--fanfare-color, #3F8F88) 82%, #1f2733);
      background: color-mix(in srgb, var(--fanfare-color, #3F8F88) 12%, white);
      border: 1px solid color-mix(in srgb, var(--fanfare-color, #3F8F88) 28%, white);
      animation: fanfareText .5s .48s ease-out both;
    }
    .reward-fanfare-ring {
      position: absolute;
      left: 50%;
      top: 42%;
      width: 160px;
      height: 160px;
      border-radius: 50%;
      border: 3px solid color-mix(in srgb, var(--fanfare-color, #3F8F88) 42%, transparent);
      transform: translate(-50%,-50%) scale(.35);
      opacity: 0;
      animation: fanfareRing 1s .1s ease-out both;
    }
    .reward-fanfare-ring.ring-two { animation-delay: .28s; }
    .reward-fanfare-burst {
      position: absolute;
      left: 50%;
      top: 50%;
      width: 1px;
      height: 1px;
      z-index: 3;
    }
    .reward-fanfare-particle {
      position: absolute;
      left: 0;
      top: 0;
      opacity: 0;
      transform: translate(-50%,-50%) scale(.25);
      animation: fanfareParticle 1.18s var(--delay, 0s) cubic-bezier(.16,.76,.3,1) both;
      filter: drop-shadow(0 2px 2px rgba(31,37,54,.12));
    }
    @keyframes fanfareBackdrop { from { opacity:0; } to { opacity:1; } }
    @keyframes fanfareLeave { to { opacity:0; transform:scale(1.015); } }
    @keyframes fanfareCardPop {
      0% { opacity:0; transform:scale(.72) translateY(22px); }
      58% { opacity:1; transform:scale(1.045) translateY(-4px); }
      100% { opacity:1; transform:scale(1) translateY(0); }
    }
    @keyframes fanfareHero {
      0% { opacity:0; transform:scale(.25) rotate(-18deg); }
      55% { opacity:1; transform:scale(1.18) rotate(8deg); }
      76% { transform:scale(.96) rotate(-3deg); }
      100% { opacity:1; transform:scale(1) rotate(0); }
    }
    @keyframes fanfareText {
      from { opacity:0; transform:translateY(12px) scale(.96); }
      to { opacity:1; transform:translateY(0) scale(1); }
    }
    @keyframes fanfareRing {
      0% { opacity:.72; transform:translate(-50%,-50%) scale(.38); }
      100% { opacity:0; transform:translate(-50%,-50%) scale(2.15); }
    }
    @keyframes fanfareParticle {
      0% { opacity:0; transform:translate(-50%,-50%) scale(.2) rotate(0); }
      18% { opacity:1; }
      100% { opacity:0; transform:translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.05) rotate(var(--spin)); }
    }
    @media (max-width: 620px) {
      .task-heading-tools { gap: 6px; }
      .task-view-toggle { padding: 5px 8px; font-size: .72rem; }
      .reward-fanfare-card { width: min(82vw, 390px); min-height: 300px; padding: 30px 24px 26px; }
      .reward-fanfare-visual { width: 108px; height: 108px; font-size: 5.5rem; }
    }



    /* v1.14 reward type / redeemed-today / grouped Up for Grabs refinements */
    .grab-card.first-completed { grid-column: 1; }
    .redeemed-rewards-row {
      grid-column: 1 / -1;
      margin-top: 8px;
      padding-top: 14px;
      border-top: 1px solid #e8e5eb;
    }
    .redeemed-rewards-title {
      margin: 0 0 10px;
      font-size: .8rem;
      font-weight: 800;
      color: #737885;
      text-transform: uppercase;
      letter-spacing: .055em;
    }
    .redeemed-rewards-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 12px;
    }
    .redeemed-reward-card {
      min-width: 0;
      border: 1px solid var(--reward-border, #d9d7dc);
      border-radius: 11px;
      padding: 12px 13px;
      background: #f8f7f9;
      display: grid;
      grid-template-columns: auto minmax(0, 1fr);
      gap: 10px;
      align-items: center;
      opacity: .78;
    }
    .redeemed-reward-card .reward-visual { font-size: 2rem; }
    .redeemed-reward-name { font-weight: 760; line-height: 1.15; }
    .redeemed-reward-meta { margin-top: 4px; font-size: .75rem; color: var(--muted); font-weight: 700; }
    .reward-limit-label { margin-top: auto; font-size: .78rem; font-weight: 800; color: #8b6573; }
    .reward-card.out-of-screen-time { border-style: dashed; }
    @media (min-width: 680px) and (orientation: portrait) {
      .redeemed-rewards-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    }



    /* v1.16.2 milestone progression, completion timing, management exit lock */
    .routine-visual-wrap {
      position: relative;
      width: 60px;
      height: 60px;
      display: grid;
      place-items: center;
    }
    .routine-visual-wrap .visual { position: relative; z-index: 2; }
    .grab-card .routine-visual-wrap { width: 58px; height: 58px; }
    .grab-card .routine-visual-wrap .grab-visual { position: relative; z-index: 2; }
    .routine-orbit {
      position: absolute;
      inset: -7px;
      border-radius: 50%;
      pointer-events: none;
      z-index: 1;
      opacity: 0;
      color: var(--task-accent, #7a55a3);
      filter: drop-shadow(0 2px 3px color-mix(in srgb, var(--task-accent, #7a55a3) 24%, transparent));
    }
    .routine-orbit::before {
      content: '';
      position: absolute;
      inset: 0;
      border-radius: 50%;
      border: 2px solid color-mix(in srgb, var(--task-accent, #7a55a3) 40%, transparent);
      border-top-color: var(--task-accent, #7a55a3);
      border-right-color: transparent;
      box-shadow: inset 0 0 0 1px rgba(255,255,255,.72), 0 1px 3px rgba(31,37,54,.10);
    }
    .orbit-sparkle {
      position: absolute;
      display: none;
      z-index: 2;
      line-height: 1;
      color: var(--task-accent, #7a55a3);
      -webkit-text-stroke: .35px rgba(255,255,255,.9);
      text-shadow: 0 1px 0 white, 0 2px 5px color-mix(in srgb, var(--task-accent, #7a55a3) 32%, transparent);
    }
    .orbit-sparkle.one { top: -7px; left: 50%; transform: translateX(-50%); font-size: .78rem; }
    .orbit-sparkle.two { right: -6px; bottom: 7px; font-size: .62rem; }
    .orbit-sparkle.three { left: -5px; top: 13px; font-size: .52rem; }
    .routine-orbit.level-1 { opacity: .72; animation: routineOrbit 5.6s linear infinite; }
    .routine-orbit.level-1 .orbit-sparkle.one { display: block; animation: orbitSparkleSoft 2.3s ease-in-out infinite; }
    .routine-orbit.level-2 { opacity: 1; animation: routineOrbit 2.65s linear infinite; }
    .routine-orbit.level-2::before {
      border-width: 2.5px;
      border-color: color-mix(in srgb, var(--task-accent, #7a55a3) 62%, transparent);
      border-top-color: var(--task-accent, #7a55a3);
      border-right-color: transparent;
      box-shadow: inset 0 0 0 1px rgba(255,255,255,.8), 0 0 8px color-mix(in srgb, var(--task-accent, #7a55a3) 22%, transparent);
    }
    .routine-orbit.level-2 .orbit-sparkle { display: block; animation: orbitSparkleBright 1.25s ease-in-out infinite; }
    .routine-orbit.level-2 .orbit-sparkle.two { animation-delay: -.42s; }
    .routine-orbit.level-2 .orbit-sparkle.three { animation-delay: -.83s; }
    .routine-orbit.milestone-awaiting { opacity: 1; animation: routineOrbit 1.05s linear infinite; }
    .routine-orbit.milestone-awaiting::before {
      border-width: 3px;
      border-color: color-mix(in srgb, var(--task-accent, #7a55a3) 72%, transparent);
      border-right-color: transparent;
      box-shadow: inset 0 0 0 1px rgba(255,255,255,.9), 0 0 12px color-mix(in srgb, var(--task-accent, #7a55a3) 34%, transparent);
      animation: milestoneOrbitBreathe 1.25s ease-in-out infinite;
    }
    .routine-orbit.milestone-awaiting .orbit-sparkle { display: block; animation: orbitSparkleBright .78s ease-in-out infinite; }
    .routine-orbit.milestone-awaiting .orbit-sparkle.two { animation-delay: -.26s; }
    .routine-orbit.milestone-awaiting .orbit-sparkle.three { animation-delay: -.52s; }
    .routine-orbit.milestone-resolving { opacity: 1; animation: routineOrbitResolve .62s cubic-bezier(.2,.78,.2,1) forwards; }
    .routine-orbit.milestone-resolving .orbit-sparkle { display: block; animation: orbitSparkleResolve .62s ease-out forwards; }
    @keyframes routineOrbit { to { transform: rotate(360deg); } }
    @keyframes orbitSparkleSoft { 0%,100% { opacity:.55; scale:.9; } 50% { opacity:1; scale:1.18; } }
    @keyframes orbitSparkleBright { 0%,100% { opacity:.62; scale:.88; } 45% { opacity:1; scale:1.34; } }
    @keyframes milestoneOrbitBreathe { 0%,100% { transform:scale(.98); } 50% { transform:scale(1.06); } }
    @keyframes routineOrbitResolve {
      0% { transform: rotate(0deg) scale(1); opacity: 1; }
      68% { transform: rotate(300deg) scale(1.10); opacity: 1; }
      100% { transform: rotate(360deg) scale(.60); opacity: 0; }
    }
    @keyframes orbitSparkleResolve { 0% { opacity:1; scale:1; } 60% { opacity:1; scale:1.45; } 100% { opacity:0; scale:.35; } }
    .streak-pill { font-weight: 700; }

    .task-card.completion-awaiting, .grab-card.completion-awaiting {
      position: relative;
      z-index: 2;
      border-color: color-mix(in srgb, var(--completion-color, var(--task-accent, #7a55a3)) 54%, white);
      box-shadow: 0 0 0 1px color-mix(in srgb, var(--completion-color, var(--task-accent, #7a55a3)) 28%, white),
                  0 5px 18px color-mix(in srgb, var(--completion-color, var(--task-accent, #7a55a3)) 16%, transparent);
      animation: completionHold 1.45s ease-in-out infinite;
    }
    .completion-awaiting .visual, .completion-awaiting .grab-visual { animation: completionGlyphPulse 1.45s ease-in-out infinite; }
    @keyframes completionHold { 0%,100% { transform:scale(1); } 50% { transform:scale(1.008); } }
    @keyframes completionGlyphPulse { 0%,100% { transform:scale(1); } 50% { transform:scale(1.075); } }

    .task-completion-fanfare {
      position: fixed; inset: 0; z-index: 10020; display:grid; place-items:center; pointer-events:none;
      background: rgba(255,255,255,.18); backdrop-filter: blur(1.5px); -webkit-backdrop-filter: blur(1.5px);
      animation: taskCompletionBackdrop .22s ease-out both;
    }
    .task-completion-fanfare.leaving { animation: taskCompletionLeave .42s ease-in both; }
    .task-completion-rain { position:absolute; inset:0; overflow:hidden; pointer-events:none; z-index:0; }
    .task-completion-rain .falling-star { animation-timing-function:cubic-bezier(.24,.68,.35,1); }
    .task-completion-card {
      position:relative; z-index:1;
      min-width: min(72vw, 330px); padding: 26px 28px 24px; border-radius: 28px; text-align:center;
      background: rgba(255,255,255,.97);
      border: 2px solid color-mix(in srgb, var(--completion-color, #7a55a3) 42%, white);
      box-shadow: 0 18px 50px rgba(31,37,54,.16), 0 0 32px color-mix(in srgb, var(--completion-color, #7a55a3) 20%, transparent);
      animation: taskCompletionCardIn .62s cubic-bezier(.18,.9,.25,1.12) both;
    }
    .task-completion-visual { width:88px; height:88px; margin:0 auto 10px; display:grid; place-items:center; font-size:4.5rem; line-height:1; }
    .task-completion-stars { color:var(--completion-color, #7a55a3); font-size:2.65rem; font-weight:850; letter-spacing:-.04em; }
    .task-completion-profile { margin-top:7px; color:#6d6875; font-size:.92rem; font-weight:700; }
    @keyframes taskCompletionBackdrop { from { opacity:0; } to { opacity:1; } }
    @keyframes taskCompletionLeave { to { opacity:0; transform:scale(1.012); } }
    @keyframes taskCompletionCardIn { 0% { opacity:0; transform:scale(.72) translateY(12px); } 65% { opacity:1; transform:scale(1.045) translateY(-2px); } 100% { opacity:1; transform:scale(1); } }

    .management-milestone-toggle {
      display: flex;
      align-items: center;
      gap: 10px;
      font-weight: 650;
      margin-bottom: 12px;
    }
    .management-milestone-toggle input { width: 20px; height: 20px; }
    .management-routine-state {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      margin-top: 8px;
      padding: 5px 9px;
      border-radius: 999px;
      background: #f2eef7;
      font-size: .82rem;
      font-weight: 700;
      color: #62546f;
    }
    .management-routine-state.paused { background: #f3f1ee; color: #746c61; }
    .management-pause-button { border-color: #c9c1b8 !important; color: #5f574e !important; }

    .milestone-fanfare {
      position: fixed;
      inset: 0;
      z-index: 10000;
      display: grid;
      place-items: center;
      pointer-events: none;
      background: rgba(255,255,255,.18);
      animation: milestoneFanfareFade 3.05s ease forwards;
    }
    .milestone-fanfare-card {
      min-width: min(78vw, 360px);
      padding: 28px 32px 26px;
      border-radius: 28px;
      background: rgba(255,255,255,.96);
      box-shadow: 0 20px 60px color-mix(in srgb, var(--milestone-color, #7a55a3) 28%, rgba(31,37,54,.12));
      border: 2px solid color-mix(in srgb, var(--milestone-color, #7a55a3) 48%, white);
      text-align: center;
      animation: milestoneCardPop 2.72s cubic-bezier(.2,.8,.2,1) forwards;
    }
    .milestone-fanfare-glyph { font-size: 2.4rem; margin-bottom: 5px; }
    .milestone-fanfare-stars { font-size: 3.35rem; font-weight: 800; letter-spacing: -.05em; color: var(--milestone-color, #7a55a3); }
    .milestone-fanfare-label { margin-top: 4px; font-size: 1.15rem; font-weight: 750; }
    .milestone-fanfare-sub { margin-top: 3px; font-size: .95rem; color: #6d6875; font-weight: 600; }
    @keyframes milestoneCardPop {
      0% { transform: scale(.7) rotate(-3deg); opacity: 0; }
      18% { transform: scale(1.08) rotate(1deg); opacity: 1; }
      24%, 84% { transform: scale(1) rotate(0); opacity: 1; }
      100% { transform: scale(.98); opacity: 0; }
    }
    @keyframes milestoneFanfareFade {
      0%, 84% { opacity: 1; }
      100% { opacity: 0; }
    }


    /* v1.16.3 approved design-review polish */

    /* Preserve the exact chosen profile color. Readability comes from a neutral
       micro-keyline and tight shadow rather than changing the fill color. */
    .profile-name,
    .profile-task-pill,
    .management-profile-name-badge {
      text-shadow:
        -.35px 0 0 rgba(48,52,62,.28),
         .35px 0 0 rgba(48,52,62,.28),
         0 -.35px 0 rgba(48,52,62,.28),
         0  .35px 0 rgba(48,52,62,.28),
         0 1px 1.2px rgba(31,37,54,.10);
    }
    .management-profile-name-badge {
      color: var(--management-profile-color, var(--accent));
    }

    /* Completed-task metadata: profile stays pill-shaped, status/check and
       star/streak metadata stay lightweight and inline. */
    .task-inline-meta,
    .completion-check {
      display: inline-flex;
      align-items: center;
      padding: 0;
      border: 0;
      background: transparent;
      line-height: 1;
      white-space: nowrap;
    }
    .task-inline-meta {
      color: #777d8b;
      font-weight: 750;
    }
    .completion-check {
      color: #68707d;
      font-size: .82rem;
      font-weight: 900;
      transform: translateY(-.5px);
    }
    .grab-meta .completion-check { font-size: .78rem; }

    /* Affordable rewards: stable card, unsynchronized premium glints around
       the sticker. Sparkles are fully absent between flashes. */
    .reward-card:not(.unavailable) {
      animation: none !important;
      border-color: var(--reward-border, #d7d2de);
      box-shadow: 0 3px 10px rgba(31,37,54,.05), 0 0 13px rgba(63,143,136,.075);
    }
    .reward-card:not(.unavailable) .reward-visual::before,
    .reward-card:not(.unavailable) .reward-visual::after {
      content: none !important;
      display: none !important;
    }
    .reward-ready-effects {
      position: absolute;
      inset: -10px;
      z-index: 5;
      pointer-events: none;
      overflow: visible;
    }
    .reward-ready-sparkle {
      position: absolute;
      opacity: 0;
      color: #f1b92b;
      line-height: 1;
      filter: drop-shadow(0 1px 2px rgba(139,98,0,.16));
      transform-origin: center;
      animation-name: rewardReadyFlash;
      animation-timing-function: ease-in-out;
      animation-iteration-count: infinite;
    }
    .reward-ready-sparkle.main {
      top: -5px;
      right: -5px;
      font-size: 1.48rem;
      animation-duration: var(--ready-cycle, 4.8s);
      animation-delay: var(--ready-phase, 0s);
    }
    .reward-ready-sparkle.secondary-a {
      left: -2px;
      top: 18%;
      font-size: .64rem;
      animation-duration: calc(var(--ready-cycle, 4.8s) + .75s);
      animation-delay: calc(var(--ready-phase, 0s) - 1.15s);
    }
    .reward-ready-sparkle.secondary-b {
      right: 7%;
      bottom: 0;
      font-size: .78rem;
      animation-duration: calc(var(--ready-cycle, 4.8s) + 1.2s);
      animation-delay: calc(var(--ready-phase, 0s) - 2.35s);
    }
    .reward-ready-sparkle.secondary-c {
      left: 12%;
      bottom: -5px;
      font-size: .48rem;
      animation-duration: calc(var(--ready-cycle, 4.8s) + .35s);
      animation-delay: calc(var(--ready-phase, 0s) - 3.1s);
    }
    @keyframes rewardReadyFlash {
      0%, 62%, 100% { opacity: 0; transform: scale(.35) rotate(-14deg); }
      67% { opacity: .9; transform: scale(.86) rotate(-3deg); }
      71% { opacity: 1; transform: scale(1.22) rotate(5deg); }
      76% { opacity: 0; transform: scale(.72) rotate(12deg); }
    }
    .reward-ready-sheen {
      display: none;
      position: absolute;
      inset: 8px;
      z-index: 4;
      overflow: hidden;
      border-radius: 18px;
      pointer-events: none;
    }
    .reward-visual:has(img) .reward-ready-sheen { display: block; }
    .reward-ready-sheen::before {
      content: '';
      position: absolute;
      top: -30%;
      bottom: -30%;
      width: 28%;
      left: -50%;
      transform: skewX(-18deg);
      background: linear-gradient(90deg, transparent, rgba(255,255,255,.72), transparent);
      opacity: 0;
      animation: rewardStickerGlint calc(var(--ready-cycle, 4.8s) + 1.4s) ease-in-out infinite;
      animation-delay: calc(var(--ready-phase, 0s) - .55s);
    }
    @keyframes rewardStickerGlint {
      0%, 70%, 100% { left: -50%; opacity: 0; }
      73% { opacity: 0; }
      76% { opacity: .62; }
      81% { left: 122%; opacity: 0; }
    }

    /* Milestone proximity. Level 1 is deliberately partial and quiet. Level 2
       is nearly closed, brighter, faster, and carries multiple sparkles. */
    .routine-orbit::before {
      border: 0 !important;
      box-shadow: none;
      background: transparent;
      -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2.6px), #000 calc(100% - 2.6px));
      mask: radial-gradient(farthest-side, transparent calc(100% - 2.6px), #000 calc(100% - 2.6px));
    }
    .routine-orbit::after {
      content: '';
      position: absolute;
      inset: 5px;
      border-radius: 50%;
      opacity: 0;
      pointer-events: none;
    }
    .routine-orbit.level-1 {
      opacity: .68;
      animation: routineOrbit 6.4s linear infinite;
    }
    .routine-orbit.level-1::before {
      background: conic-gradient(
        from 205deg,
        transparent 0deg 36deg,
        color-mix(in srgb, var(--task-accent, #7a55a3) 54%, transparent) 36deg 194deg,
        transparent 194deg 360deg
      );
    }
    .routine-orbit.level-1 .orbit-sparkle.one {
      display: block;
      font-size: .72rem;
      animation: orbitSparkleSoft 2.8s ease-in-out infinite;
    }
    .routine-orbit.level-1 .orbit-sparkle.two,
    .routine-orbit.level-1 .orbit-sparkle.three { display: none; }

    .routine-orbit.level-2 {
      opacity: 1;
      animation: routineOrbit 2.2s linear infinite;
      filter: drop-shadow(0 2px 3px color-mix(in srgb, var(--task-accent, #7a55a3) 34%, transparent));
    }
    .routine-orbit.level-2::before {
      background: conic-gradient(
        from -34deg,
        color-mix(in srgb, var(--task-accent, #7a55a3) 78%, transparent) 0deg 318deg,
        transparent 318deg 347deg,
        color-mix(in srgb, var(--task-accent, #7a55a3) 78%, transparent) 347deg 360deg
      );
      -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3.25px), #000 calc(100% - 3.25px));
      mask: radial-gradient(farthest-side, transparent calc(100% - 3.25px), #000 calc(100% - 3.25px));
    }
    .routine-orbit.level-2::after {
      opacity: .8;
      box-shadow: 0 0 13px color-mix(in srgb, var(--task-accent, #7a55a3) 30%, transparent);
      animation: milestoneNearGlow 1.55s ease-in-out infinite;
    }
    .routine-orbit.level-2 .orbit-sparkle {
      display: block;
      animation: orbitSparkleBright 1.05s ease-in-out infinite;
    }
    .routine-orbit.level-2 .orbit-sparkle.one { font-size: .94rem; }
    .routine-orbit.level-2 .orbit-sparkle.two { font-size: .68rem; animation-delay: -.34s; }
    .routine-orbit.level-2 .orbit-sparkle.three { font-size: .58rem; animation-delay: -.71s; }
    @keyframes milestoneNearGlow {
      0%,100% { transform: scale(.92); opacity: .35; }
      50% { transform: scale(1.08); opacity: .9; }
    }

    /* Milestone bridge starts immediately on click. It visually closes the
       orbit and then loops gracefully while the server request finishes. It contains
       no award amount, so a failed request never falsely grants the milestone. */
    .routine-orbit.milestone-awaiting {
      opacity: 1;
      animation: milestoneBridgeLead .86s cubic-bezier(.2,.78,.2,1) both,
                 routineOrbit 1.45s .86s linear infinite;
    }
    .routine-orbit.milestone-awaiting::before {
      background: conic-gradient(from -34deg, var(--task-accent, #7a55a3) 0deg 360deg);
      -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3.5px), #000 calc(100% - 3.5px));
      mask: radial-gradient(farthest-side, transparent calc(100% - 3.5px), #000 calc(100% - 3.5px));
      filter: drop-shadow(0 0 5px color-mix(in srgb, var(--task-accent, #7a55a3) 38%, transparent));
    }
    .routine-orbit.milestone-awaiting::after {
      opacity: 1;
      inset: -2px;
      background: conic-gradient(from 0deg, transparent 0 80%, rgba(255,255,255,.92) 88%, transparent 96% 100%);
      -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 4px));
      mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 4px));
      animation: milestoneSweep 1.05s linear infinite;
    }
    .routine-orbit.milestone-awaiting .orbit-sparkle {
      display: block;
      animation: orbitSparkleBright .72s ease-in-out infinite;
    }
    .routine-orbit.milestone-awaiting .orbit-sparkle.two { animation-delay: -.24s; }
    .routine-orbit.milestone-awaiting .orbit-sparkle.three { animation-delay: -.48s; }
    @keyframes milestoneBridgeLead {
      0% { transform: rotate(0deg) scale(1); filter: brightness(1); }
      68% { transform: rotate(300deg) scale(1.09); filter: brightness(1.12); }
      100% { transform: rotate(360deg) scale(1.02); filter: brightness(1.06); }
    }
    @keyframes milestoneSweep { to { transform: rotate(360deg); } }

    .routine-orbit.milestone-resolving {
      opacity: 1;
      animation: milestoneResolveRing .72s cubic-bezier(.2,.78,.2,1) forwards;
    }
    .routine-orbit.milestone-resolving::before {
      background: conic-gradient(from 0deg, var(--task-accent, #7a55a3) 0deg 360deg);
      -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3.7px), #000 calc(100% - 3.7px));
      mask: radial-gradient(farthest-side, transparent calc(100% - 3.7px), #000 calc(100% - 3.7px));
      box-shadow: 0 0 12px color-mix(in srgb, var(--task-accent, #7a55a3) 38%, transparent);
    }
    .routine-orbit.milestone-resolving::after {
      opacity: 1;
      inset: -4px;
      background: conic-gradient(from 0deg, transparent 0 76%, rgba(255,255,255,.98) 86%, transparent 96% 100%);
      -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 4px));
      mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 4px));
      animation: milestoneResolveSweep .72s ease-out forwards;
    }
    .routine-orbit.milestone-resolving .orbit-sparkle { display:block; }
    .routine-orbit.milestone-resolving .orbit-sparkle.one { animation: milestoneSparkOutOne .72s ease-out forwards; }
    .routine-orbit.milestone-resolving .orbit-sparkle.two { animation: milestoneSparkOutTwo .72s ease-out forwards; }
    .routine-orbit.milestone-resolving .orbit-sparkle.three { animation: milestoneSparkOutThree .72s ease-out forwards; }
    @keyframes milestoneResolveRing {
      0% { transform: rotate(0deg) scale(1.02); opacity:1; }
      58% { transform: rotate(320deg) scale(1.13); opacity:1; }
      100% { transform: rotate(360deg) scale(.78); opacity:0; }
    }
    @keyframes milestoneResolveSweep {
      0% { transform:rotate(0deg) scale(.94); opacity:.35; }
      62% { transform:rotate(330deg) scale(1.12); opacity:1; }
      100% { transform:rotate(390deg) scale(1.35); opacity:0; }
    }
    @keyframes milestoneSparkOutOne {
      0% { opacity:1; transform:translateX(-50%) scale(1); }
      100% { opacity:0; transform:translate(-50%, -24px) scale(1.45); }
    }
    @keyframes milestoneSparkOutTwo {
      0% { opacity:1; transform:scale(1); }
      100% { opacity:0; transform:translate(22px, 16px) scale(1.35); }
    }
    @keyframes milestoneSparkOutThree {
      0% { opacity:1; transform:scale(1); }
      100% { opacity:0; transform:translate(-22px, -12px) scale(1.28); }
    }


    /* v1.16.4 reward motion, pale-profile readability, PIN entry polish */
    .profile-name,
    .profile-task-pill,
    .management-profile-name-badge {
      text-shadow:
        -.55px 0 0 rgba(43,47,57,.36),
         .55px 0 0 rgba(43,47,57,.36),
         0 -.55px 0 rgba(43,47,57,.36),
         0  .55px 0 rgba(43,47,57,.36),
         0 1px .9px rgba(31,37,54,.17);
    }

    .reward-card:not(.unavailable) .reward-visual {
      /* Keep the reward sticker treatment on the asset itself so the nearby
         readiness sparkles do not inherit a sticker-like outline/shadow. */
      filter: none;
      text-shadow: none;
    }
    .reward-card:not(.unavailable) .reward-visual > img {
      filter:
        drop-shadow(2px 0 0 #fff)
        drop-shadow(-2px 0 0 #fff)
        drop-shadow(0 2px 0 #fff)
        drop-shadow(0 -2px 0 #fff)
        drop-shadow(1.5px 1.5px 0 #fff)
        drop-shadow(-1.5px 1.5px 0 #fff)
        drop-shadow(1.5px -1.5px 0 #fff)
        drop-shadow(-1.5px -1.5px 0 #fff)
        drop-shadow(0 0 1.2px rgba(45,49,61,.30))
        drop-shadow(0 4px 4px rgba(31,37,54,.14));
    }
    .reward-ready-sparkle {
      text-shadow: none !important;
      filter: none !important;
    }
    .reward-card:not(.unavailable) .reward-visual > .emoji-sticker,
    .reward-card:not(.unavailable) .reward-visual > img {
      transform-origin: center;
      animation: rewardStickerIdle var(--idle-cycle, 5.8s) ease-in-out infinite;
      animation-delay: var(--idle-phase, 0s);
      will-change: transform;
    }
    @keyframes rewardStickerIdle {
      0%, 100% { transform: scale(1) rotate(0deg); }
      24% { transform: scale(1.012) rotate(-.7deg); }
      52% { transform: scale(1.026) rotate(.65deg); }
      76% { transform: scale(1.01) rotate(-.35deg); }
    }


    /* v1.16.5 routine assignment rules + reward/profile polish */
    .profile-task-pill,
    .management-profile-name-badge {
      text-shadow: none !important;
    }
    .profile-name {
      text-shadow:
        -.65px 0 0 rgba(43,47,57,.40),
         .65px 0 0 rgba(43,47,57,.40),
         0 -.65px 0 rgba(43,47,57,.40),
         0  .65px 0 rgba(43,47,57,.40),
         0 1px .9px rgba(31,37,54,.18);
    }
    .reward-ready-sticker {
      display: inline-grid;
      place-items: center;
      line-height: 1;
      transform-origin: center;
      text-shadow: 1px 0 #fff, -1px 0 #fff, 0 1px #fff, 0 -1px #fff;
      filter: drop-shadow(0 3px 3px rgba(31,37,54,.14));
    }
    .reward-ready-sticker:has(img) {
      text-shadow: none;
      filter: none;
    }
    .reward-ready-sticker > img {
      width: 100%;
      height: 100%;
      object-fit: contain;
      filter:
        drop-shadow(2px 0 0 #fff)
        drop-shadow(-2px 0 0 #fff)
        drop-shadow(0 2px 0 #fff)
        drop-shadow(0 -2px 0 #fff)
        drop-shadow(1.5px 1.5px 0 #fff)
        drop-shadow(-1.5px 1.5px 0 #fff)
        drop-shadow(1.5px -1.5px 0 #fff)
        drop-shadow(-1.5px -1.5px 0 #fff)
        drop-shadow(0 0 1.2px rgba(45,49,61,.30))
        drop-shadow(0 4px 4px rgba(31,37,54,.14));
    }
    .reward-card:not(.unavailable) .reward-ready-sticker {
      animation: rewardStickerIdleV165 var(--idle-cycle, 5.8s) ease-in-out infinite;
      animation-delay: var(--idle-phase, 0s);
      will-change: transform;
    }
    @keyframes rewardStickerIdleV165 {
      0%, 100% { transform: scale(1) rotate(0deg); }
      28% { transform: scale(1.018) rotate(-.55deg); }
      55% { transform: scale(1.042) rotate(.75deg); }
      78% { transform: scale(1.015) rotate(-.35deg); }
    }
    .management-completion-delay-field { margin-top: 14px; }

    .grownup-pin-entry {
      display: grid;
      gap: 9px;
      justify-items: center;
      margin-top: 2px;
    }
    .grownup-pin-slots {
      position: relative;
      display: grid;
      grid-template-columns: repeat(4, 54px);
      gap: 10px;
      cursor: text;
    }
    .grownup-pin-slot {
      width: 54px;
      height: 58px;
      display: grid;
      place-items: center;
      border: 1.5px solid #d8d6de;
      border-radius: 13px;
      background: #fff;
      color: #292532;
      font-size: 1.65rem;
      font-weight: 800;
      box-shadow: 0 2px 7px rgba(31,37,54,.035);
      transition: border-color .14s ease, box-shadow .14s ease, transform .14s ease;
    }
    .grownup-pin-slot.filled {
      border-color: #a996bf;
      box-shadow: 0 2px 8px rgba(122,85,163,.10);
    }
    .grownup-pin-input {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      opacity: .01;
      color: transparent;
      caret-color: transparent;
      border: 0;
      background: transparent;
      font-size: 16px;
      z-index: 3;
    }
    .grownup-pin-message {
      min-height: 18px;
      color: #a84d4d;
      font-size: .78rem;
      font-weight: 650;
    }
    .grownup-pin-slots.pin-error .grownup-pin-slot {
      border-color: #d48b8b;
      animation: grownupPinShake .34s ease;
    }
    @keyframes grownupPinShake {
      0%,100% { transform: translateX(0); }
      25% { transform: translateX(-4px); }
      50% { transform: translateX(4px); }
      75% { transform: translateX(-2px); }
    }



    /* v1.16.6 Today\'s Tasks card interaction + confirmation flow */
    .task-list {
      grid-template-columns: 1fr;
      gap: 10px;
    }
    .task-card.today-task-card {
      width: 100%;
      min-width: 0;
      min-height: 90px;
      grid-template-columns: 58px minmax(0, 1fr);
      align-items: center;
      gap: 11px;
      padding: 12px 13px 12px 10px;
      text-align: left;
      color: var(--text);
      font: inherit;
      cursor: default;
    }
    button.task-card.today-task-card {
      cursor: pointer;
      appearance: none;
      -webkit-appearance: none;
    }
    button.task-card.today-task-card:active {
      transform: scale(.985);
    }
    button.task-card.today-task-card:hover {
      box-shadow: 0 4px 14px rgba(31,37,54,.065);
    }
    .task-card.today-task-card.no-visual {
      grid-template-columns: minmax(0, 1fr);
    }
    .task-card.today-task-card .routine-visual-wrap {
      width: 56px;
      height: 56px;
    }
    .task-card.today-task-card .visual {
      width: 54px;
      height: 54px;
      font-size: 2.2rem;
    }
    .task-card.today-task-card .task-title {
      line-height: 1.16;
      overflow-wrap: anywhere;
    }
    .task-card.today-task-card .meta {
      gap: 6px;
    }
    .today-task-state {
      display: inline-flex;
      align-items: center;
      color: #8a8f9a;
      font-size: .76rem;
      font-weight: 700;
      white-space: nowrap;
    }
    .today-task-state.not-assigned { color: #9296a0; }

    @media (min-width: 680px) and (orientation: portrait) {
      .task-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    }
    @media (min-width: 900px) and (orientation: landscape) {
      .task-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    }

    .task-confirmation {
      display: grid;
      justify-items: center;
      gap: 13px;
      text-align: center;
      padding-top: 2px;
    }
    .task-confirmation-visual {
      width: 86px;
      height: 86px;
      display: grid;
      place-items: center;
      font-size: 4rem;
      line-height: 1;
      overflow: visible;
    }
    .task-confirmation-visual img {
      width: 100%;
      height: 100%;
      object-fit: contain;
      filter:
        drop-shadow(2px 0 0 #fff)
        drop-shadow(-2px 0 0 #fff)
        drop-shadow(0 2px 0 #fff)
        drop-shadow(0 -2px 0 #fff)
        drop-shadow(0 5px 6px rgba(31,37,54,.16));
    }
    .task-confirmation-name {
      font-size: 1.18rem;
      font-weight: 780;
      line-height: 1.15;
      color: var(--text);
      max-width: 420px;
    }
    .task-confirmation-description {
      max-width: 420px;
      color: var(--muted);
      font-size: .86rem;
      line-height: 1.35;
    }
    .task-confirmation-meta {
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      gap: 9px;
      color: #737987;
      font-size: .82rem;
      font-weight: 720;
    }
    .task-confirmation-actions {
      width: min(100%, 420px);
      display: grid;
      grid-template-columns: 1fr;
      gap: 10px;
      margin-top: 3px;
    }
    .task-confirmation-actions button {
      min-height: 46px;
      width: 100%;
    }

    /* v1.16.7 task completion visuals use the same sticker treatment as dashboard art. */
    .task-confirmation-visual .emoji-sticker,
    .task-completion-visual .emoji-sticker {
      display: inline-block;
      line-height: 1;
      filter: drop-shadow(0 3px 3px rgba(31,37,54,.14));
      text-shadow:
        1.5px 0 #fff, -1.5px 0 #fff,
        0 1.5px #fff, 0 -1.5px #fff,
        1px 1px #fff, -1px 1px #fff,
        1px -1px #fff, -1px -1px #fff;
    }
    .task-completion-visual img {
      width: 100%;
      height: 100%;
      object-fit: contain;
      filter:
        drop-shadow(2px 0 0 #fff)
        drop-shadow(-2px 0 0 #fff)
        drop-shadow(0 2px 0 #fff)
        drop-shadow(0 -2px 0 #fff)
        drop-shadow(0 5px 6px rgba(31,37,54,.16));
    }



    /* v1.17.0 Screen Time daily budget */
    .screen-time-budget-chip {
      grid-column: 1 / -1;
      display: inline-flex;
      align-items: center;
      width: fit-content;
      max-width: 100%;
      padding: 7px 10px;
      margin-bottom: 2px;
      border: 1px solid #dfe4ea;
      border-radius: 999px;
      background: #f7f9fb;
      color: #5f6878;
      font-size: .78rem;
      font-weight: 750;
    }
    .reward-screen-time-minutes { margin-top: 5px; color:#596577; font-size:.78rem; font-weight:800; }
    .reward-card.screen-time-unavailable { border-style: dashed; }
    .management-nav { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .screen-time-summary {
      display:grid;
      grid-template-columns:repeat(3,minmax(0,1fr));
      gap:8px;
      margin-bottom:14px;
    }
    .screen-time-stat { padding:11px 10px; border:1px solid #e3e1e7; border-radius:11px; background:#fff; text-align:center; }
    .screen-time-stat strong { display:block; font-size:1.15rem; }
    .screen-time-stat span { display:block; margin-top:3px; color:var(--muted); font-size:.7rem; font-weight:700; }
    .screen-time-profile-select { margin-bottom:14px; }
    .screen-time-limit-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
    .screen-time-limit-grid label { display:grid; gap:5px; font-size:.78rem; font-weight:700; color:#666d7a; }
    .screen-time-log { display:grid; gap:7px; margin-top:10px; }
    .screen-time-log-row { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; padding:9px 10px; border:1px solid #e6e3e9; border-radius:10px; background:#fff; }
    .screen-time-log-title { font-size:.82rem; font-weight:750; }
    .screen-time-log-meta { margin-top:3px; color:var(--muted); font-size:.7rem; line-height:1.3; }
    .screen-time-log-minutes { white-space:nowrap; font-size:.85rem; font-weight:850; }
    .screen-time-log-minutes.negative { color:#527466; }
    .screen-time-section { margin-top:16px; padding-top:14px; border-top:1px solid #e8e5eb; }
    @media (max-width:560px) {
      .management-nav { grid-template-columns:repeat(3,minmax(0,1fr)); }
      .screen-time-summary { grid-template-columns:repeat(3,minmax(0,1fr)); }
    }


    /* v1.17.1 Screen Time UX polish */
    .management-reward-type-row {
      display:grid;
      grid-template-columns:minmax(0,1fr) minmax(0,1fr);
      gap:10px;
      margin-top:10px;
    }
    .management-reward-description { margin-top:10px; }
    .management-reward-helper { margin-top:8px; }
    .reward-card { position:relative; }
    .reward-screen-time-meter {
      position:absolute;
      top:13px;
      right:13px;
      display:inline-flex;
      align-items:center;
      gap:3px;
      color:#697180;
      font-size:.76rem;
      font-weight:550;
      line-height:1;
      white-space:nowrap;
      background:rgba(255,255,255,.78);
      border-radius:999px;
      padding:5px 7px;
      backdrop-filter:blur(3px);
    }
    .reward-screen-time-meter .reward-time-amount { color:#596577; }
    .reward-screen-time-meter.not-enough .reward-time-amount { color:var(--danger); font-weight:800; }
    .reward-screen-time-meter .reward-time-x { color:var(--danger); font-weight:900; margin-left:2px; }
    .reward-card.screen-time-unavailable { border-style:solid; }
    @media (max-width:560px) {
      .management-reward-type-row { grid-template-columns:minmax(0,1fr) minmax(0,1fr); }
    }


    /* v1.17.2 reward-card Screen Time placement + redeemed layout */
    .reward-card {
      grid-template-rows: auto auto auto auto auto;
    }
    .reward-screen-time-meter {
      position: static;
      grid-column: 2;
      grid-row: 5;
      justify-self: start;
      margin-top: 1px;
      padding: 0;
      background: transparent;
      border-radius: 0;
      backdrop-filter: none;
      font-size: .76rem;
      line-height: 1.15;
    }
    .reward-card:not(:has(.reward-visual)) .reward-screen-time-meter {
      grid-column: 1;
    }
    .reward-card:not(.unavailable) {
      border-width: 1.5px;
    }
    @media (orientation: landscape) and (min-width: 800px) {
      .redeemed-rewards-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    }


    /* v1.17.6 iPad modal, PIN keypad, and viewport polish. */
    html, body {
      height: 100%;
      overflow: hidden;
    }
    body {
      min-height: 0;
    }
    .app {
      height: 100vh;
      height: 100dvh;
      overflow-y: auto;
      overscroll-behavior-y: none;
      -webkit-overflow-scrolling: touch;
    }

    .grownup-keypad {
      width: min(100%, 248px);
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 10px;
      margin-top: 2px;
    }
    .grownup-keypad-key {
      min-height: 54px;
      border: 1px solid #d8d6de;
      border-radius: 14px;
      background: #fff;
      color: #292532;
      font-size: 1.28rem;
      font-weight: 720;
      box-shadow: 0 2px 7px rgba(31,37,54,.04);
      touch-action: manipulation;
    }
    .grownup-keypad-key:active {
      transform: scale(.97);
      background: #f4f1f7;
    }
    .grownup-keypad-key.backspace {
      font-size: 1.2rem;
      color: #5f5967;
    }
    .grownup-keypad-spacer {
      min-height: 54px;
      pointer-events: none;
    }

    .sheet.management-sheet {
      width: min(92vw, 850px);
      height: min(860px, 90vh);
      max-height: 90vh;
    }

    @media (min-width: 680px) {
      .overlay {
        align-items: center;
      }
      .sheet {
        border-radius: 20px;
      }
    }


    /* v1.20.0 Immersive world stage + profile carousel.
       Dashboard styling stays scoped so Grown-Up management can retain its existing system. */
    html, body {
      height: auto;
      min-height: 100%;
      overflow-x: hidden;
      overflow-y: auto;
      background: #041026;
    }
    body {
      min-height: 100vh;
      min-height: 100dvh;
      overscroll-behavior-y: auto;
      background:
        radial-gradient(circle at 50% -12%, rgba(66,76,181,.20), transparent 32%),
        #041026;
    }
    .app {
      width: min(100%, 1180px);
      min-height: 100vh;
      min-height: 100dvh;
      height: auto;
      margin: 0 auto;
      padding: 0 clamp(14px, 2.6vw, 30px) max(34px, env(safe-area-inset-bottom));
      overflow: visible;
      background:
        linear-gradient(180deg, #07142d 0%, #051129 46%, #041026 100%);
      color: #f6f8ff;
    }
    #dashboard {
      --dash-text: #f6f8ff;
      --dash-muted: #aab5cf;
      --dash-soft: #8491ad;
      min-height: 100%;
      color: var(--dash-text);
      font-family: ui-rounded, "SF Pro Rounded", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    }

    #dashboard .world-stage {
      --hero-profile-color: #9d67ef;
      position: relative;
      min-height: clamp(455px, 56vw, 650px);
      margin: 0 calc(-1 * clamp(14px, 2.6vw, 30px));
      padding: max(18px, env(safe-area-inset-top)) clamp(18px, 3vw, 34px) 32px;
      overflow: visible;
      isolation: isolate;
      background-color: #07152f;
      background-repeat: no-repeat;
      background-size: cover;
      background-position: center center;
      transition: background-image .24s ease, background-color .24s ease;
    }
    #dashboard .world-stage::before {
      content: '';
      position: absolute;
      inset: 0;
      z-index: -1;
      pointer-events: none;
      background:
        linear-gradient(180deg, rgba(3,10,27,.12) 0%, rgba(3,10,27,.03) 27%, rgba(3,10,27,.12) 68%, #07142d 100%),
        linear-gradient(90deg, rgba(2,9,26,.08) 0%, rgba(2,9,26,0) 40%, rgba(2,9,26,.20) 72%, rgba(2,9,26,.30) 100%);
    }
    #dashboard .world-stage::after {
      content: '';
      position: absolute;
      left: 0;
      right: 0;
      bottom: -1px;
      height: 92px;
      z-index: -1;
      pointer-events: none;
      background: linear-gradient(180deg, transparent, #07142d 86%);
    }

    #dashboard .dashboard-topbar {
      position: relative;
      z-index: 4;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 14px;
      margin: 0;
      padding: 0;
      background: transparent;
    }
    #dashboard .dashboard-date {
      color: rgba(244,247,255,.88);
      font-size: clamp(.82rem, 2.3vw, .96rem);
      font-weight: 720;
      letter-spacing: -.01em;
      white-space: nowrap;
      text-shadow: 0 2px 10px rgba(0,0,0,.55);
    }
    #dashboard .topbar-actions {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 10px;
      min-width: 0;
    }
    #dashboard .adult-button {
      min-height: 42px;
      border: 1px solid rgba(208,219,248,.18);
      background: rgba(9,21,50,.32);
      color: #f6f8ff;
      border-radius: 14px;
      padding: 9px 12px;
      box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 8px 22px rgba(0,0,0,.12);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
    }
    #dashboard .adult-button .ui-icon { color: #eef2ff; }
    #dashboard .starworld-launch-button {
      width: 46px;
      min-width: 46px;
      height: 46px;
      min-height: 46px;
      padding: 0;
      display: grid;
      place-items: center;
      border-radius: 14px;
      background: rgba(9,21,50,.32);
      border-color: rgba(208,219,248,.18);
      box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 8px 22px rgba(0,0,0,.12);
    }
    #dashboard .starworld-launch-button .ui-icon { width: 24px; height: 24px; }

    #dashboard .profile-carousel {
      position: relative;
      z-index: 4;
      display: grid;
      grid-template-columns: 42px minmax(0, 1fr) 42px;
      align-items: center;
      gap: 4px;
      width: min(100%, 520px);
      margin: 24px auto 0;
      overflow: visible;
    }
    #dashboard .carousel-arrow {
      width: 38px;
      height: 52px;
      display: grid;
      place-items: center;
      border: 0;
      background: transparent;
      color: rgba(241,245,255,.84);
      font-size: 2rem;
      font-weight: 450;
      line-height: 1;
      text-shadow: 0 2px 10px rgba(0,0,0,.55);
      opacity: .86;
      transition: transform .14s ease, opacity .14s ease;
    }
    #dashboard .carousel-arrow:active { transform: scale(.92); }
    #dashboard .carousel-arrow:disabled { opacity: .22; }
    #dashboard .profiles {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      align-items: end;
      justify-items: center;
      gap: clamp(4px, 2.2vw, 18px);
      min-height: 134px;
      margin: 0;
      padding: 10px 4px 6px;
      overflow: visible;
    }
    #dashboard .profile-card {
      width: min(100%, 112px);
      min-height: 112px;
      display: grid;
      grid-template-columns: 1fr;
      grid-template-rows: auto auto auto;
      justify-items: center;
      align-content: end;
      gap: 4px;
      padding: 8px 2px 4px;
      border: 0;
      background: transparent !important;
      box-shadow: none;
      color: #f7f9ff;
      text-align: center;
      opacity: .62;
      transform: scale(.82);
      transform-origin: center bottom;
      transition: transform .20s ease, opacity .20s ease, filter .20s ease;
      overflow: visible;
    }
    #dashboard .profile-card::after { display: none; }
    #dashboard .profile-card.placeholder {
      pointer-events: none;
      opacity: 0;
    }
    #dashboard .profile-card.side:hover { opacity: .82; }
    #dashboard .profile-card.selected {
      opacity: 1;
      transform: scale(1.10);
      z-index: 2;
    }
    #dashboard .profile-card:active { transform: scale(.78); }
    #dashboard .profile-card.selected:active { transform: scale(1.04); }
    #dashboard .profile-avatar {
      width: 62px;
      height: 62px;
      margin: 0 auto 3px;
      display: grid;
      place-items: center;
      border-radius: 50%;
      overflow: hidden;
      font-size: 2.55rem;
      line-height: 1;
      background: rgba(7,19,46,.52);
      border: 2px solid rgba(214,223,248,.16);
      box-shadow: 0 5px 18px rgba(0,0,0,.25);
      text-shadow: none;
      transition: width .18s ease, height .18s ease, box-shadow .18s ease, border-color .18s ease;
    }
    #dashboard .profile-avatar::before { display: none; }
    #dashboard .profile-card.selected .profile-avatar {
      width: 76px;
      height: 76px;
      border-color: var(--profile-color, #9d67ef);
      box-shadow:
        0 0 0 2px rgba(5,15,37,.92),
        0 0 0 4px var(--profile-color, #9d67ef),
        0 0 17px color-mix(in srgb, var(--profile-color, #9d67ef) 74%, transparent),
        0 7px 22px rgba(0,0,0,.30);
    }
    #dashboard .profile-avatar img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      border-radius: 50%;
      filter: drop-shadow(0 2px 6px rgba(0,0,0,.18));
    }
    #dashboard .profile-name {
      max-width: 108px;
      color: var(--profile-color, #f7f8ff);
      font-size: .84rem;
      font-weight: 800;
      line-height: 1.05;
      letter-spacing: -.015em;
      text-align: center;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      text-shadow:
        -.45px 0 rgba(4,10,26,.88), .45px 0 rgba(4,10,26,.88),
        0 -.45px rgba(4,10,26,.88), 0 .45px rgba(4,10,26,.88),
        0 2px 8px rgba(0,0,0,.38);
    }
    #dashboard .profile-card.selected .profile-name { font-size: .91rem; }
    #dashboard .profile-stars {
      margin: 1px 0 0;
      color: #e9eefc;
      font-size: .74rem;
      font-weight: 760;
      line-height: 1;
      justify-content: center;
      text-align: center;
      text-shadow: 0 2px 8px rgba(0,0,0,.42);
    }

    #dashboard .profile-hero-copy {
      position: absolute;
      z-index: 3;
      left: 53%;
      right: clamp(24px, 5vw, 64px);
      bottom: clamp(94px, 13vw, 142px);
      display: grid;
      gap: 9px;
      justify-items: start;
      text-align: left;
      pointer-events: none;
    }
    #dashboard .profile-hero-name {
      max-width: 100%;
      color: var(--hero-profile-color, #fff);
      font-size: clamp(1.72rem, 4.9vw, 2.55rem);
      line-height: .98;
      font-weight: 820;
      letter-spacing: -.04em;
      overflow-wrap: anywhere;
      text-shadow:
        -.5px 0 rgba(4,10,26,.90), .5px 0 rgba(4,10,26,.90),
        0 -.5px rgba(4,10,26,.90), 0 .5px rgba(4,10,26,.90),
        0 3px 11px rgba(0,0,0,.46),
        0 0 14px color-mix(in srgb, var(--hero-profile-color, #fff) 36%, transparent);
    }
    #dashboard .profile-hero-stars {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      color: #f6f8ff;
      font-size: .92rem;
      font-weight: 760;
      text-shadow: 0 2px 8px rgba(0,0,0,.52);
    }

    #dashboard .content-grid {
      position: relative;
      z-index: 2;
      padding: 0 0 10px;
    }
    #dashboard .section { margin-top: 27px; }
    #dashboard .section-heading { margin-bottom: 12px; }
    #dashboard .section-title { gap: 10px; }
    #dashboard .section-title h2 {
      color: #f4f7ff;
      font-size: clamp(1.15rem, 3.2vw, 1.38rem);
      font-weight: 790;
      letter-spacing: -.025em;
      text-shadow: 0 2px 9px rgba(0,0,0,.20);
    }
    #dashboard .section-note { color: #aab5cf; font-size: .80rem; }
    #dashboard .section-icon {
      width: 30px;
      height: 30px;
      color: #f8fbff;
      background: rgba(12, 22, 46, .24);
      border: 1px solid rgba(248, 251, 255, .24);
      box-shadow:
        0 0 12px rgba(229, 238, 255, .11),
        inset 0 1px 0 rgba(255,255,255,.10);
      backdrop-filter: blur(7px);
      -webkit-backdrop-filter: blur(7px);
    }
    #dashboard .section-icon svg {
      width: 19px;
      height: 19px;
      stroke-width: 1.9;
    }
    #dashboard .task-heading-tools { align-items: center; }
    #dashboard .task-view-toggle {
      border-color: rgba(190,203,235,.18);
      background: rgba(20,34,68,.54);
      color: #c7d0e6;
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
    }
    #dashboard .task-view-toggle.active {
      border-color: rgba(185,148,240,.36);
      background: rgba(115,76,172,.20);
      color: #eadfff;
    }

    #dashboard .task-list,
    #dashboard .grab-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr));
      gap: 12px;
    }
    #dashboard .task-card.today-task-card,
    #dashboard .grab-card,
    #dashboard .redeemed-reward-card {
      backdrop-filter: blur(14px);
      -webkit-backdrop-filter: blur(14px);
    }
    #dashboard .task-card.today-task-card {
      background: linear-gradient(135deg, rgba(29,44,82,.68), rgba(15,28,59,.70)) !important;
      color: #f4f7ff;
      border-top-color: rgba(190,204,236,.15) !important;
      border-right-color: rgba(190,204,236,.15) !important;
      border-bottom-color: rgba(190,204,236,.15) !important;
      box-shadow:
        inset 0 1px 0 rgba(255,255,255,.035),
        0 0 20px color-mix(in srgb, var(--task-accent, #8b68cf) 10%, transparent);
      opacity: 1;
    }
    #dashboard .task-card.today-task-card.completed {
      opacity: .68;
      background: linear-gradient(135deg, rgba(25,38,72,.60), rgba(14,26,54,.64)) !important;
    }
    #dashboard button.task-card.today-task-card:hover {
      box-shadow:
        inset 0 1px 0 rgba(255,255,255,.05),
        0 7px 22px rgba(0,0,0,.16),
        0 0 22px color-mix(in srgb, var(--task-accent, #8b68cf) 14%, transparent);
    }
    #dashboard .task-card.missed {
      background: linear-gradient(135deg, rgba(73,34,50,.78), rgba(43,27,49,.80)) !important;
      border-color: rgba(210,109,123,.34) !important;
      border-left-color: #d66d7d !important;
    }
    #dashboard .grab-card {
      color: #f4f7ff;
      background: linear-gradient(135deg, rgba(37,47,78,.68), rgba(21,32,63,.72)) !important;
      border-color: rgba(229,174,52,.26) !important;
      border-left-color: #e4aa27 !important;
      box-shadow:
        inset 0 1px 0 rgba(255,255,255,.035),
        0 0 18px rgba(228,170,39,.07);
    }
    #dashboard .grab-card.completed { opacity: .68; }
    #dashboard .grab-card:active { background: rgba(42,52,84,.76) !important; }
    #dashboard .grab-card.missed {
      background: linear-gradient(135deg, rgba(73,34,50,.78), rgba(43,27,49,.80)) !important;
      border-color: rgba(210,109,123,.34) !important;
      border-left-color: #d66d7d !important;
    }

    #dashboard .task-title,
    #dashboard .grab-title,
    #dashboard .reward-name,
    #dashboard .redeemed-reward-name {
      color: #f5f8ff !important;
      font-weight: 760;
      text-shadow: 0 1px 4px rgba(0,0,0,.18);
    }
    #dashboard .meta,
    #dashboard .task-inline-meta,
    #dashboard .today-task-state,
    #dashboard .grab-meta { color: #aab5ca !important; }
    #dashboard .completion-check { color: #cdd6ea; }
    #dashboard .missed-pill { color: #ffc5cd; background: rgba(168,63,79,.22); }
    #dashboard .profile-task-pill {
      background: rgba(7,16,38,.42) !important;
      border-color: var(--pill-color, rgba(255,255,255,.20)) !important;
      color: #edf2ff !important;
    }

    #dashboard .visual,
    #dashboard .grab-visual,
    #dashboard .reward-visual,
    #dashboard .task-confirmation-visual {
      text-shadow: 0 0 10px rgba(255,255,255,.20), 0 4px 9px rgba(0,0,0,.24) !important;
    }
    #dashboard .visual img,
    #dashboard .grab-visual img,
    #dashboard .reward-visual img,
    #dashboard .task-confirmation-visual img,
    #dashboard .task-completion-visual img,
    #dashboard .reward-fanfare-visual img {
      filter:
        drop-shadow(0 0 5px rgba(255,255,255,.26))
        drop-shadow(0 5px 9px rgba(0,0,0,.28)) !important;
    }
    #dashboard .emoji-sticker,
    #dashboard .reward-ready-sticker {
      text-shadow: 0 0 7px rgba(255,255,255,.20), 0 4px 8px rgba(0,0,0,.24) !important;
      filter: drop-shadow(0 0 4px rgba(255,255,255,.14)) !important;
    }

    #dashboard .reward-scroll {
      display: grid;
      grid-template-columns: repeat(2, minmax(0,1fr));
      gap: 13px;
      overflow: visible;
      padding: 2px;
    }
    #dashboard .reward-card {
      background: linear-gradient(145deg, rgba(29,44,82,.66), rgba(16,29,61,.70)) !important;
      color: #f5f8ff;
      border-color: var(--reward-border, rgba(117,177,190,.34)) !important;
      box-shadow:
        inset 0 1px 0 rgba(255,255,255,.045),
        0 0 20px color-mix(in srgb, var(--profile-color, #72c9d4) 8%, transparent);
      backdrop-filter: blur(14px);
      -webkit-backdrop-filter: blur(14px);
    }
    #dashboard .reward-card::before {
      background: linear-gradient(
        to right,
        var(--profile-color, #72c9d4) 0%,
        var(--profile-color, #72c9d4) var(--reward-progress, 0%),
        rgba(255,255,255,.11) var(--reward-progress, 0%),
        rgba(255,255,255,.11) 100%
      ) !important;
      box-shadow: 0 0 10px color-mix(in srgb, var(--profile-color, #72c9d4) 24%, transparent);
    }
    #dashboard .reward-desc { color: #a4aec4 !important; }
    #dashboard .reward-cost { color: #f0f4ff !important; }
    #dashboard .reward-screen-time-meter { color: #aeb8cf !important; }
    #dashboard .reward-screen-time-meter .reward-time-amount { color: #e0e6f5 !important; }
    #dashboard .redeemed-reward-card {
      background: rgba(18,31,62,.66) !important;
      color: #f5f8ff;
      border-color: rgba(175,193,229,.16) !important;
    }
    #dashboard .redeemed-reward-meta,
    #dashboard .redeemed-rewards-title { color: #a4aec4 !important; }
    #dashboard .empty-state {
      color: #aeb8cf;
      background: rgba(20,34,66,.54);
      border-color: rgba(182,197,230,.18);
      backdrop-filter: blur(12px);
    }

    /* Child-facing/general modals stay in the dark world. Management explicitly
       opts back into the established light system through .management-sheet. */
    .overlay {
      background: rgba(1,7,20,.66);
      backdrop-filter: blur(9px);
      -webkit-backdrop-filter: blur(9px);
    }
    .sheet:not(.management-sheet) {
      background: linear-gradient(155deg, rgba(20,34,68,.98), rgba(9,20,46,.99));
      color: #f4f7ff;
      border: 1px solid rgba(188,204,240,.18);
      box-shadow: 0 26px 80px rgba(0,0,0,.52), inset 0 1px 0 rgba(255,255,255,.045);
    }
    .sheet:not(.management-sheet) .sheet-header h2 { color: #f4f7ff; }
    .sheet:not(.management-sheet) .close {
      background: rgba(255,255,255,.08);
      color: #eff3ff;
    }
    .sheet:not(.management-sheet) .grownup-intro,
    .sheet:not(.management-sheet) label { color: #aeb8cf; }
    .sheet:not(.management-sheet) input,
    .sheet:not(.management-sheet) select,
    .sheet:not(.management-sheet) textarea {
      background: rgba(5,15,37,.74);
      border-color: rgba(182,198,234,.18);
      color: #f4f7ff;
    }
    .sheet:not(.management-sheet) .secondary,
    .sheet:not(.management-sheet) .choice,
    .sheet:not(.management-sheet) .grownup-keypad-key {
      background: rgba(255,255,255,.065);
      border-color: rgba(184,199,235,.18);
      color: #f1f5ff;
    }
    .sheet:not(.management-sheet) .secondary:active,
    .sheet:not(.management-sheet) .choice:active,
    .sheet:not(.management-sheet) .grownup-keypad-key:active { background: rgba(255,255,255,.11); }
    .busy-cover {
      background: rgba(2,8,22,.30);
      backdrop-filter: blur(1.5px);
      -webkit-backdrop-filter: blur(1.5px);
    }

    @media (min-width: 900px) {
      #dashboard .task-list,
      #dashboard .grab-grid {
        grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
      }
      #dashboard .reward-scroll {
        grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
      }
    }

    @media (max-width: 620px) {
      .app {
        padding-left: 14px;
        padding-right: 14px;
      }
      #dashboard .world-stage {
        min-height: 430px;
        margin-left: -14px;
        margin-right: -14px;
        padding-left: 15px;
        padding-right: 15px;
        background-size: 100% auto;
        background-position: center top;
        background-repeat: no-repeat;
        background-color: #07152f;
      }
      #dashboard .world-stage::before {
        background:
          linear-gradient(180deg, rgba(3,10,27,.08) 0%, rgba(3,10,27,.02) 42%, rgba(3,10,27,.34) 73%, #07142d 100%),
          linear-gradient(90deg, rgba(2,9,26,.04), rgba(2,9,26,.06));
      }
      #dashboard .dashboard-date {
        max-width: calc(100vw - 84px);
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: .78rem;
      }
      #dashboard .adult-button {
        width: 42px;
        height: 42px;
        min-height: 42px;
        padding: 0;
        justify-content: center;
      }
      #dashboard .adult-button span { display: none; }
      #dashboard .profile-carousel {
        grid-template-columns: 32px minmax(0,1fr) 32px;
        width: 100%;
        margin-top: 15px;
      }
      #dashboard .carousel-arrow { width: 32px; font-size: 1.8rem; }
      #dashboard .profiles {
        min-height: 124px;
        gap: 0;
        padding-top: 8px;
      }
      #dashboard .profile-card { width: 88px; min-height: 106px; }
      #dashboard .profile-avatar { width: 52px; height: 52px; font-size: 2.25rem; }
      #dashboard .profile-card.selected .profile-avatar { width: 68px; height: 68px; }
      #dashboard .profile-name { max-width: 86px; font-size: .76rem; }
      #dashboard .profile-card.selected .profile-name { font-size: .84rem; }
      #dashboard .profile-stars { font-size: .69rem; }
      #dashboard .profile-hero-copy {
        left: 53%;
        right: 15px;
        bottom: 63px;
        gap: 7px;
      }
      #dashboard .profile-hero-name { font-size: clamp(1.38rem, 7vw, 1.82rem); }
      #dashboard .profile-hero-stars { font-size: .80rem; }
      #dashboard .section { margin-top: 24px; }
      #dashboard .section-title h2 { font-size: 1.12rem; }
      #dashboard .section-icon { width: 28px; height: 28px; }
      #dashboard .task-list,
      #dashboard .grab-grid { grid-template-columns: 1fr; }
      #dashboard .reward-scroll { gap: 11px; }
      #dashboard .reward-card { padding: 12px 10px; }
    }

    @media (max-width: 390px) {
      #dashboard .dashboard-date { font-size: .73rem; }
      #dashboard .profile-card { width: 78px; }
      #dashboard .profile-avatar { width: 48px; height: 48px; }
      #dashboard .profile-card.selected .profile-avatar { width: 64px; height: 64px; }
      #dashboard .profile-name { max-width: 76px; }
      #dashboard .profile-hero-copy { left: 54%; }
    }


    /* v1.21.0 profile worlds + atmosphere polish */
    #dashboard .world-stage {
      background:
        radial-gradient(circle at 25% 68%, color-mix(in srgb, var(--hero-profile-color, #8f70e8) 18%, transparent), transparent 30%),
        radial-gradient(circle at 15% 15%, rgba(255,255,255,.82) 0 1px, transparent 1.7px),
        radial-gradient(circle at 74% 17%, rgba(182,203,255,.76) 0 1px, transparent 1.6px),
        radial-gradient(circle at 91% 31%, rgba(255,255,255,.68) 0 1.2px, transparent 1.8px),
        radial-gradient(circle at 56% 9%, rgba(194,173,255,.66) 0 1px, transparent 1.6px),
        radial-gradient(circle at 36% 30%, rgba(138,166,255,.54) 0 1px, transparent 1.7px),
        linear-gradient(165deg, #0a1c48 0%, #081635 48%, #041026 100%);
    }
    #dashboard .world-stage-image {
      position: absolute;
      inset: 0;
      z-index: 0;
      width: 100%;
      height: 100%;
      object-fit: cover;
      object-position: center center;
      opacity: 0;
      pointer-events: none;
      transition: opacity .28s ease;
    }
    #dashboard .world-stage-image.loaded { opacity: 1; }
    #dashboard .world-stage::before,
    #dashboard .world-stage::after { z-index: 1; }
    #dashboard .dashboard-topbar,
    #dashboard .profile-carousel,
    #dashboard .profile-hero-copy { z-index: 3; }

    /* Force carousel labels beneath each avatar on every viewport. */
    #dashboard .profile-card,
    #dashboard .profile-card.side,
    #dashboard .profile-card.center,
    #dashboard .profile-card.selected {
      display: flex !important;
      flex-direction: column !important;
      align-items: center !important;
      justify-content: flex-end !important;
      text-align: center !important;
      gap: 4px !important;
    }
    #dashboard .profile-name,
    #dashboard .profile-stars {
      width: 100%;
      text-align: center !important;
      justify-content: center !important;
    }

    /* Thin bright edge and soft light around emoji glyphs, without restoring the old sticker outline. */
    #dashboard .emoji-sticker {
      display: inline-block;
      filter:
        drop-shadow(.45px 0 0 rgba(255,255,255,.92))
        drop-shadow(-.45px 0 0 rgba(255,255,255,.92))
        drop-shadow(0 .45px 0 rgba(255,255,255,.92))
        drop-shadow(0 -.45px 0 rgba(255,255,255,.92))
        drop-shadow(0 0 6px rgba(193,211,255,.28)) !important;
      text-shadow: 0 3px 8px rgba(0,0,0,.28) !important;
    }
    #dashboard .profile-avatar .emoji-sticker {
      filter:
        drop-shadow(.5px 0 0 rgba(255,255,255,.94))
        drop-shadow(-.5px 0 0 rgba(255,255,255,.94))
        drop-shadow(0 .5px 0 rgba(255,255,255,.94))
        drop-shadow(0 -.5px 0 rgba(255,255,255,.94))
        drop-shadow(0 0 8px rgba(196,215,255,.32)) !important;
    }

    /* Card illumination is now shared Star World atmosphere. Profile color remains only as a slim personal accent. */
    #dashboard .task-card.today-task-card {
      border-color: rgba(157,180,230,.17) !important;
      border-left-color: var(--task-accent, #8b68cf) !important;
      background:
        radial-gradient(circle at 82% 8%, rgba(124,150,255,.12), transparent 34%),
        linear-gradient(135deg, rgba(27,43,80,.72), rgba(12,26,57,.78)) !important;
      box-shadow:
        inset 0 1px 0 rgba(255,255,255,.055),
        inset 18px 0 28px -30px color-mix(in srgb, var(--task-accent, #8b68cf) 58%, transparent),
        0 9px 24px rgba(0,0,0,.16),
        0 0 22px rgba(95,118,225,.075) !important;
    }
    #dashboard .task-card.today-task-card.completed {
      background:
        radial-gradient(circle at 82% 8%, rgba(116,140,235,.08), transparent 34%),
        linear-gradient(135deg, rgba(23,37,70,.62), rgba(11,24,52,.70)) !important;
    }
    #dashboard .grab-card {
      background:
        radial-gradient(circle at 82% 8%, rgba(118,145,247,.10), transparent 34%),
        linear-gradient(135deg, rgba(29,43,76,.72), rgba(14,27,58,.79)) !important;
      border-color: rgba(177,191,224,.16) !important;
      border-left-color: #e4aa27 !important;
      box-shadow:
        inset 0 1px 0 rgba(255,255,255,.05),
        inset 18px 0 28px -30px rgba(228,170,39,.60),
        0 9px 24px rgba(0,0,0,.15),
        0 0 20px rgba(99,120,218,.065) !important;
    }
    #dashboard .reward-card {
      border-color: rgba(167,185,226,.17) !important;
      border-left: 3px solid var(--profile-color, #72c9d4) !important;
      background:
        radial-gradient(circle at 80% 7%, rgba(122,148,255,.14), transparent 35%),
        linear-gradient(145deg, rgba(27,42,79,.74), rgba(12,26,57,.81)) !important;
      box-shadow:
        inset 0 1px 0 rgba(255,255,255,.055),
        inset 18px 0 30px -31px color-mix(in srgb, var(--profile-color, #72c9d4) 54%, transparent),
        0 9px 24px rgba(0,0,0,.16),
        0 0 22px rgba(96,119,226,.075) !important;
    }
    #dashboard .reward-card:not(.unavailable) {
      border-color: rgba(181,197,233,.20) !important;
    }
    #dashboard .reward-visual {
      border-radius: 50%;
      background: radial-gradient(circle at 50% 46%, rgba(153,169,255,.22) 0%, rgba(92,116,225,.10) 46%, transparent 72%);
      box-shadow: 0 0 24px rgba(104,126,238,.11);
    }
    #dashboard .reward-visual img {
      filter:
        drop-shadow(.55px 0 0 rgba(255,255,255,.88))
        drop-shadow(-.55px 0 0 rgba(255,255,255,.88))
        drop-shadow(0 .55px 0 rgba(255,255,255,.88))
        drop-shadow(0 -.55px 0 rgba(255,255,255,.88))
        drop-shadow(0 0 7px rgba(191,210,255,.27))
        drop-shadow(0 5px 9px rgba(0,0,0,.24)) !important;
    }

    /* Reward success is a luminous bubble, not a white modal card. */
    .reward-fanfare {
      background: rgba(2,8,24,.56) !important;
      backdrop-filter: blur(6px) !important;
      -webkit-backdrop-filter: blur(6px) !important;
    }
    .reward-fanfare-card {
      width: min(78vw, 390px) !important;
      min-height: 330px !important;
      padding: 34px 28px 30px !important;
      border: 0 !important;
      background:
        radial-gradient(circle at 50% 46%, rgba(151,169,255,.20) 0%, rgba(112,91,214,.12) 39%, rgba(18,31,65,.08) 62%, transparent 74%) !important;
      box-shadow: none !important;
    }
    .reward-fanfare-visual {
      border-radius: 50%;
      background: radial-gradient(circle, rgba(255,255,255,.11), rgba(120,142,255,.08) 48%, transparent 72%);
      box-shadow: 0 0 34px rgba(142,159,255,.14);
      filter: none !important;
    }
    .reward-fanfare-visual .emoji-sticker {
      filter:
        drop-shadow(.6px 0 0 rgba(255,255,255,.92))
        drop-shadow(-.6px 0 0 rgba(255,255,255,.92))
        drop-shadow(0 .6px 0 rgba(255,255,255,.92))
        drop-shadow(0 -.6px 0 rgba(255,255,255,.92))
        drop-shadow(0 0 10px rgba(209,219,255,.32)) !important;
    }
    .reward-fanfare-kicker {
      color: #ffd95b !important;
      text-shadow: 0 0 10px rgba(255,205,66,.46), 0 3px 10px rgba(0,0,0,.36);
    }
    .reward-fanfare-name {
      color: #f7f9ff !important;
      text-shadow: 0 0 16px rgba(177,193,255,.26), 0 4px 14px rgba(0,0,0,.44);
    }
    .reward-fanfare-profile {
      color: #f2f5ff !important;
      background: rgba(255,255,255,.035) !important;
      border: 1px solid rgba(213,222,255,.12) !important;
      box-shadow: 0 0 16px color-mix(in srgb, var(--fanfare-color, #3F8F88) 16%, transparent);
      text-shadow: 0 2px 8px rgba(0,0,0,.34);
    }

    @media (prefers-reduced-motion: reduce) {
      #dashboard .profile-card,
      #dashboard .profile-avatar { transition: opacity .12s ease; }
      #dashboard .reward-card:not(.unavailable) .reward-ready-sticker,
      #dashboard .reward-ready-sparkle,
      #dashboard .reward-ready-sheen { animation: none !important; }
    }


    /* v1.22.0 hero reliability + celebration/reward polish */

    /* Open Today items carry a restrained profile-color light wash. Completed and
       missed states remain visually quieter and keep their existing overrides. */
    #dashboard .task-card.today-task-card.open {
      background:
        radial-gradient(circle at 4% 50%, color-mix(in srgb, var(--task-accent, #8b68cf) 15%, transparent) 0%, transparent 30%),
        radial-gradient(circle at 82% 8%, rgba(124,150,255,.12), transparent 34%),
        linear-gradient(135deg, rgba(28,43,80,.74), rgba(12,26,57,.80)) !important;
      box-shadow:
        inset 0 1px 0 rgba(255,255,255,.06),
        inset 26px 0 34px -34px color-mix(in srgb, var(--task-accent, #8b68cf) 78%, transparent),
        0 9px 24px rgba(0,0,0,.16),
        0 0 24px rgba(95,118,225,.075) !important;
    }

    /* Rewards use a shared atmospheric card treatment. Profile identity is expressed
       through progress/readiness, not a task-like colored strip on the left edge. */
    #dashboard .reward-card,
    #dashboard .reward-card:not(.unavailable) {
      border-left: 1px solid rgba(167,185,226,.17) !important;
    }

    /* Give reward art bubbles a clearer glassy perimeter without returning to the
       old sticker border treatment. */
    #dashboard .reward-visual {
      box-shadow:
        inset 0 0 0 1px rgba(218,226,255,.18),
        inset 0 0 12px rgba(190,204,255,.035),
        0 0 24px rgba(104,126,238,.12) !important;
    }

    /* Redeemable reward cards get an intermittent premium edge shimmer. */
    #dashboard .reward-card:not(.unavailable) {
      position: relative;
      isolation: isolate;
      animation: rewardReadyCardBreath 4.8s ease-in-out infinite !important;
    }
    #dashboard .reward-card:not(.unavailable)::after {
      content: '' !important;
      display: block !important;
      position: absolute !important;
      inset: -1px !important;
      border-radius: inherit !important;
      padding: 1.5px !important;
      pointer-events: none !important;
      z-index: 3 !important;
      background:
        linear-gradient(112deg,
          transparent 0%,
          transparent 30%,
          rgba(230,236,255,.18) 39%,
          rgba(255,255,255,.94) 47%,
          rgba(208,221,255,.34) 53%,
          transparent 63%,
          transparent 100%) border-box !important;
      background-size: 260% 100% !important;
      background-position: 135% 0 !important;
      -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0) !important;
      -webkit-mask-composite: xor !important;
      mask-composite: exclude !important;
      opacity: 0;
      animation: rewardEdgeShimmer 5.4s var(--ready-phase, 0s) ease-in-out infinite !important;
    }
    @keyframes rewardReadyCardBreath {
      0%, 100% {
        box-shadow:
          inset 0 1px 0 rgba(255,255,255,.055),
          0 9px 24px rgba(0,0,0,.16),
          0 0 15px rgba(130,151,247,.07);
      }
      50% {
        box-shadow:
          inset 0 1px 0 rgba(255,255,255,.075),
          0 10px 26px rgba(0,0,0,.17),
          0 0 24px rgba(151,171,255,.14);
      }
    }
    @keyframes rewardEdgeShimmer {
      0%, 58% { opacity: 0; background-position: 135% 0; }
      64% { opacity: .28; }
      73% { opacity: .88; }
      84% { opacity: .18; background-position: -45% 0; }
      100% { opacity: 0; background-position: -45% 0; }
    }

    /* Task completion gets its own dark-world celebration language. */
    .task-completion-fanfare {
      background: rgba(2,8,24,.56) !important;
      backdrop-filter: blur(5px) !important;
      -webkit-backdrop-filter: blur(5px) !important;
    }
    .task-completion-card {
      min-width: min(76vw, 350px) !important;
      padding: 34px 26px 30px !important;
      border: 0 !important;
      background:
        radial-gradient(circle at 50% 46%, color-mix(in srgb, var(--completion-color, #7a55a3) 22%, transparent) 0%, rgba(103,122,214,.12) 35%, rgba(14,29,64,.05) 62%, transparent 76%) !important;
      box-shadow: none !important;
      overflow: visible;
    }
    .task-completion-card::before,
    .task-completion-card::after {
      content: '';
      position: absolute;
      left: 50%;
      top: 44%;
      translate: -50% -50%;
      border-radius: 50%;
      pointer-events: none;
      z-index: -1;
    }
    .task-completion-card::before {
      width: 210px;
      height: 210px;
      border: 1px solid color-mix(in srgb, var(--completion-color, #7a55a3) 52%, rgba(255,255,255,.30));
      box-shadow: 0 0 28px color-mix(in srgb, var(--completion-color, #7a55a3) 24%, transparent);
      animation: taskCompletionRing 1.8s ease-out infinite;
    }
    .task-completion-card::after {
      width: 152px;
      height: 152px;
      background: radial-gradient(circle, rgba(255,255,255,.10), color-mix(in srgb, var(--completion-color, #7a55a3) 12%, transparent) 48%, transparent 72%);
      filter: blur(1px);
    }
    .task-completion-visual {
      width: 104px !important;
      height: 104px !important;
      margin: 0 auto 14px !important;
      border-radius: 50%;
      background: radial-gradient(circle, rgba(255,255,255,.12), color-mix(in srgb, var(--completion-color, #7a55a3) 12%, transparent) 48%, transparent 74%);
      box-shadow:
        inset 0 0 0 1px rgba(222,229,255,.15),
        0 0 30px color-mix(in srgb, var(--completion-color, #7a55a3) 20%, transparent);
    }
    .task-completion-visual img {
      filter:
        drop-shadow(.5px 0 0 rgba(255,255,255,.86))
        drop-shadow(-.5px 0 0 rgba(255,255,255,.86))
        drop-shadow(0 .5px 0 rgba(255,255,255,.86))
        drop-shadow(0 -.5px 0 rgba(255,255,255,.86))
        drop-shadow(0 0 7px rgba(210,220,255,.24))
        drop-shadow(0 6px 11px rgba(0,0,0,.28)) !important;
    }
    .task-completion-kicker {
      margin-bottom: 2px;
      color: #eef3ff;
      font-size: .78rem;
      font-weight: 850;
      letter-spacing: .12em;
      text-transform: uppercase;
      text-shadow: 0 0 10px color-mix(in srgb, var(--completion-color, #7a55a3) 34%, transparent), 0 2px 8px rgba(0,0,0,.35);
    }
    .task-completion-stars {
      color: #ffd85a !important;
      font-size: 2.8rem !important;
      text-shadow: 0 0 14px rgba(255,208,61,.42), 0 4px 12px rgba(0,0,0,.36);
    }
    .task-completion-profile {
      display: inline-flex;
      margin-top: 10px !important;
      padding: 6px 13px;
      border-radius: 999px;
      color: #f2f5ff !important;
      background: rgba(255,255,255,.045);
      border: 1px solid color-mix(in srgb, var(--completion-color, #7a55a3) 30%, rgba(215,224,255,.14));
      box-shadow: 0 0 16px color-mix(in srgb, var(--completion-color, #7a55a3) 13%, transparent);
      text-shadow: 0 2px 8px rgba(0,0,0,.34);
    }
    @keyframes taskCompletionRing {
      0% { opacity: .16; transform: scale(.86); }
      45% { opacity: .70; }
      100% { opacity: 0; transform: scale(1.18); }
    }

    /* The emoji halo is intentionally stronger on handheld displays. On desktop,
       keep the same edge definition but dramatically reduce the surrounding bloom. */
    @media (min-width: 800px) {
      #dashboard .emoji-sticker {
        filter:
          drop-shadow(.35px 0 0 rgba(255,255,255,.82))
          drop-shadow(-.35px 0 0 rgba(255,255,255,.82))
          drop-shadow(0 .35px 0 rgba(255,255,255,.82))
          drop-shadow(0 -.35px 0 rgba(255,255,255,.82))
          drop-shadow(0 0 2.5px rgba(193,211,255,.15)) !important;
      }
      #dashboard .profile-avatar .emoji-sticker {
        filter:
          drop-shadow(.4px 0 0 rgba(255,255,255,.86))
          drop-shadow(-.4px 0 0 rgba(255,255,255,.86))
          drop-shadow(0 .4px 0 rgba(255,255,255,.86))
          drop-shadow(0 -.4px 0 rgba(255,255,255,.86))
          drop-shadow(0 0 3px rgba(196,215,255,.18)) !important;
      }
      #dashboard .reward-visual {
        background: radial-gradient(circle at 50% 46%, rgba(153,169,255,.13) 0%, rgba(92,116,225,.055) 44%, transparent 66%);
        box-shadow:
          inset 0 0 0 1px rgba(218,226,255,.12),
          0 0 11px rgba(104,126,238,.065) !important;
      }
      #dashboard .reward-visual img {
        filter:
          drop-shadow(.45px 0 0 rgba(255,255,255,.76))
          drop-shadow(-.45px 0 0 rgba(255,255,255,.76))
          drop-shadow(0 .45px 0 rgba(255,255,255,.76))
          drop-shadow(0 -.45px 0 rgba(255,255,255,.76))
          drop-shadow(0 0 3px rgba(191,210,255,.14))
          drop-shadow(0 4px 7px rgba(0,0,0,.22)) !important;
      }
    }

    @media (prefers-reduced-motion: reduce) {
      #dashboard .reward-card:not(.unavailable),
      #dashboard .reward-card:not(.unavailable)::after,
      .task-completion-card::before { animation: none !important; }
      #dashboard .reward-card:not(.unavailable)::after { opacity: .22; background-position: 50% 0 !important; }
    }

  

    /* v1.23.0 focused celebration + reward readiness polish */

    /* Task completion is intentionally distinct from reward redemption: no orbit,
       no individual visual bubble. One broad profile-color glow anchors the moment. */
    .task-completion-card {
      min-width: min(78vw, 370px) !important;
      padding: 42px 26px 34px !important;
      background:
        radial-gradient(ellipse at 50% 46%,
          color-mix(in srgb, var(--completion-color, #7a55a3) 30%, transparent) 0%,
          color-mix(in srgb, var(--completion-color, #7a55a3) 18%, rgba(84,107,207,.08)) 30%,
          rgba(32,51,96,.07) 49%,
          transparent 74%) !important;
      box-shadow: none !important;
    }
    .task-completion-card::before,
    .task-completion-card::after {
      display: none !important;
      content: none !important;
    }
    .task-completion-visual {
      width: 110px !important;
      height: 110px !important;
      margin: 0 auto 16px !important;
      border-radius: 0 !important;
      background: none !important;
      box-shadow: none !important;
    }
    .task-completion-visual .emoji-sticker,
    .task-completion-visual img {
      filter:
        drop-shadow(.45px 0 0 rgba(255,255,255,.82))
        drop-shadow(-.45px 0 0 rgba(255,255,255,.82))
        drop-shadow(0 .45px 0 rgba(255,255,255,.82))
        drop-shadow(0 -.45px 0 rgba(255,255,255,.82))
        drop-shadow(0 0 13px color-mix(in srgb, var(--completion-color, #7a55a3) 34%, transparent))
        drop-shadow(0 7px 12px rgba(0,0,0,.28)) !important;
    }

    /* Reward redemption keeps its particle/radiating celebration, but the reward
       art itself floats freely instead of sitting inside another bubble/ring. */
    .reward-fanfare-ring {
      display: none !important;
    }
    .reward-fanfare-visual {
      border-radius: 0 !important;
      background: none !important;
      box-shadow: none !important;
    }
    .reward-fanfare-visual .emoji-sticker,
    .reward-fanfare-visual img {
      filter:
        drop-shadow(.5px 0 0 rgba(255,255,255,.88))
        drop-shadow(-.5px 0 0 rgba(255,255,255,.88))
        drop-shadow(0 .5px 0 rgba(255,255,255,.88))
        drop-shadow(0 -.5px 0 rgba(255,255,255,.88))
        drop-shadow(0 0 14px rgba(204,216,255,.24))
        drop-shadow(0 8px 14px rgba(0,0,0,.30)) !important;
    }

    /* Rewards never inherit the task-style profile-color left accent. Remove both
       the border and the old inset profile-color glow that could still read as trim. */
    #dashboard .reward-card,
    #dashboard .reward-card.unavailable,
    #dashboard .reward-card:not(.unavailable) {
      border-left-width: 1px !important;
      border-left-style: solid !important;
      border-left-color: rgba(167,185,226,.18) !important;
      box-shadow:
        inset 0 1px 0 rgba(255,255,255,.055),
        0 9px 24px rgba(0,0,0,.16),
        0 0 18px rgba(96,119,226,.07) !important;
    }

    /* Ready rewards must read instantly as available. Use an always-visible pale
       luminous edge plus a slow breathing bloom. This does not rely on mask-composite,
       which was too subtle/inconsistent in Mobile Safari. */
    #dashboard .reward-card:not(.unavailable) {
      border-color: rgba(219,230,255,.78) !important;
      box-shadow:
        inset 0 1px 0 rgba(255,255,255,.13),
        inset 0 0 18px rgba(155,184,255,.055),
        0 9px 24px rgba(0,0,0,.15),
        0 0 8px rgba(190,211,255,.30),
        0 0 24px rgba(124,163,255,.28) !important;
      animation: rewardReadyVisibleGlow var(--ready-cycle, 4.8s) ease-in-out infinite !important;
    }
    #dashboard .reward-card:not(.unavailable)::after {
      content: '' !important;
      display: block !important;
      position: absolute !important;
      inset: -2px !important;
      border-radius: inherit !important;
      border: 2px solid rgba(232,239,255,.58) !important;
      background: transparent !important;
      padding: 0 !important;
      pointer-events: none !important;
      z-index: 3 !important;
      opacity: .42 !important;
      -webkit-mask: none !important;
      mask: none !important;
      box-shadow:
        0 0 7px rgba(220,232,255,.26),
        0 0 19px rgba(132,174,255,.24) !important;
      animation: rewardReadyOutlineGlow calc(var(--ready-cycle, 4.8s) + .8s) ease-in-out infinite !important;
      animation-delay: var(--ready-phase, 0s) !important;
    }
    @keyframes rewardReadyVisibleGlow {
      0%, 100% {
        border-color: rgba(211,224,255,.62);
        box-shadow:
          inset 0 1px 0 rgba(255,255,255,.10),
          inset 0 0 16px rgba(155,184,255,.04),
          0 9px 24px rgba(0,0,0,.15),
          0 0 6px rgba(190,211,255,.22),
          0 0 17px rgba(124,163,255,.18);
      }
      48% {
        border-color: rgba(244,248,255,.94);
        box-shadow:
          inset 0 1px 0 rgba(255,255,255,.18),
          inset 0 0 22px rgba(174,199,255,.08),
          0 9px 24px rgba(0,0,0,.15),
          0 0 10px rgba(225,236,255,.44),
          0 0 30px rgba(133,174,255,.38);
      }
    }
    @keyframes rewardReadyOutlineGlow {
      0%, 100% { opacity: .28; transform: scale(.997); }
      44% { opacity: .86; transform: scale(1.004); }
      62% { opacity: .52; transform: scale(1.001); }
    }

    @media (prefers-reduced-motion: reduce) {
      #dashboard .reward-card:not(.unavailable),
      #dashboard .reward-card:not(.unavailable)::after {
        animation: none !important;
      }
      #dashboard .reward-card:not(.unavailable)::after { opacity: .60 !important; }
    }



    /* v1.24.0 targeted completion, reward-art, and milestone polish */

    /* Nudge the task-completion visual slightly lower into the center of the
       broad glow without reintroducing an individual bubble or orbit. */
    .task-completion-visual {
      position: relative !important;
      top: 10px !important;
      margin-bottom: 24px !important;
    }

    /* Reward art now floats directly on the card. The surrounding card design and
       redeemable-state lighting provide enough hierarchy without a separate bubble. */
    #dashboard .reward-visual,
    #dashboard .redeemed-reward-card .reward-visual {
      border: 0 !important;
      outline: 0 !important;
      border-radius: 0 !important;
      background: none !important;
      box-shadow: none !important;
    }
    #dashboard .reward-visual::before,
    #dashboard .reward-visual::after,
    #dashboard .redeemed-reward-card .reward-visual::before,
    #dashboard .redeemed-reward-card .reward-visual::after {
      content: none !important;
      display: none !important;
    }

    /* Complete Task confirmation stays within the dark visual system. */
    .task-confirmation-name {
      color: #f3f6ff !important;
      text-shadow: 0 2px 10px rgba(0,0,0,.34) !important;
    }
    .task-confirmation-description {
      color: #b8c2d9 !important;
    }
    .task-confirmation-meta {
      color: #c2caDC !important;
    }

    /* Milestones use their own orbit/energy language rather than the old white card. */
    .milestone-fanfare {
      background: rgba(2,8,24,.60) !important;
      backdrop-filter: blur(6px) !important;
      -webkit-backdrop-filter: blur(6px) !important;
    }
    .milestone-fanfare-card {
      position: relative !important;
      min-width: min(80vw, 390px) !important;
      padding: 36px 28px 32px !important;
      border: 0 !important;
      border-radius: 0 !important;
      background:
        radial-gradient(ellipse at 50% 46%,
          rgba(255,215,84,.12) 0%,
          color-mix(in srgb, var(--milestone-color, #7a55a3) 20%, rgba(93,108,219,.08)) 34%,
          rgba(24,41,83,.06) 56%,
          transparent 75%) !important;
      box-shadow: none !important;
      color: #f4f7ff !important;
    }
    .milestone-fanfare-glyph {
      position: relative !important;
      width: 112px !important;
      height: 112px !important;
      display: grid !important;
      place-items: center !important;
      margin: 0 auto 18px !important;
      border-radius: 50% !important;
      font-size: 3.15rem !important;
      background: radial-gradient(circle, rgba(255,221,104,.12), rgba(108,122,224,.06) 50%, transparent 72%) !important;
      border: 1px solid rgba(255,220,102,.26) !important;
      box-shadow:
        0 0 22px rgba(255,207,74,.14),
        0 0 42px color-mix(in srgb, var(--milestone-color, #7a55a3) 18%, transparent) !important;
      text-shadow: 0 0 14px rgba(255,217,90,.34) !important;
      animation: milestoneGlyphBreathe 1.65s ease-in-out infinite !important;
    }
    .milestone-fanfare-glyph::after {
      content: '' !important;
      position: absolute !important;
      inset: -11px !important;
      border-radius: 50% !important;
      border: 1px solid rgba(255,226,124,.16) !important;
      border-top-color: rgba(255,225,111,.70) !important;
      border-right-color: rgba(255,225,111,.05) !important;
      box-shadow: 0 0 15px rgba(255,214,90,.09) !important;
      animation: milestoneFanfareOrbit 2.4s linear infinite !important;
    }
    .milestone-fanfare-stars {
      color: #ffd85a !important;
      font-size: 3.2rem !important;
      text-shadow: 0 0 16px rgba(255,207,61,.42), 0 4px 12px rgba(0,0,0,.34) !important;
    }
    .milestone-fanfare-label {
      color: #f4f7ff !important;
      font-size: 1.08rem !important;
      font-weight: 850 !important;
      letter-spacing: .08em !important;
      text-transform: uppercase !important;
      text-shadow: 0 2px 10px rgba(0,0,0,.32) !important;
    }
    .milestone-fanfare-sub {
      margin-top: 7px !important;
      color: #b7c1d8 !important;
      font-size: .95rem !important;
      font-weight: 650 !important;
      text-shadow: 0 2px 9px rgba(0,0,0,.28) !important;
    }
    @keyframes milestoneGlyphBreathe {
      0%, 100% { transform: scale(.98); filter: brightness(.98); }
      50% { transform: scale(1.045); filter: brightness(1.08); }
    }
    @keyframes milestoneFanfareOrbit {
      to { transform: rotate(360deg); }
    }

    @media (prefers-reduced-motion: reduce) {
      .milestone-fanfare-glyph,
      .milestone-fanfare-glyph::after {
        animation: none !important;
      }
    }



    /* v1.25.0 Your World management */
    .hero-world-editor { display:grid; gap:14px; }
    .hero-world-current, .hero-world-preview {
      position:relative; overflow:hidden; border-radius:18px;
      border:1px solid rgba(122,85,163,.18); background:#eef0f6;
      min-height:150px;
    }
    .hero-world-current img, .hero-world-preview img {
      display:block; width:100%; aspect-ratio:3/2; object-fit:cover;
    }
    .hero-world-current-label, .hero-world-preview-label {
      position:absolute; left:12px; top:12px; z-index:2;
      padding:6px 9px; border-radius:999px; background:rgba(12,20,42,.74);
      color:#fff; font-size:.72rem; font-weight:800; letter-spacing:.03em;
      backdrop-filter:blur(8px); -webkit-backdrop-filter:blur(8px);
    }
    .hero-world-question { display:grid; gap:7px; }
    .hero-world-question > label { font-weight:760; color:#242b3b; }
    .hero-world-question input {
      width:100%; min-height:45px; border:1px solid #d8dce6; border-radius:12px;
      background:#fff; color:#151b2b; padding:10px 12px; outline:none;
    }
    .hero-world-question input:focus { border-color:#8d72ad; box-shadow:0 0 0 3px rgba(122,85,163,.10); }
    .hero-suggestions { display:flex; flex-wrap:wrap; gap:7px; }
    .hero-suggestion-chip {
      border:1px solid #d9dce7; background:#f7f7fa; color:#4a5060; border-radius:999px;
      padding:6px 9px; font-size:.76rem; font-weight:690; box-shadow:none;
    }
    .hero-suggestion-chip:active { transform:scale(.98); }
    .hero-world-actions { display:flex; flex-wrap:wrap; gap:9px; align-items:center; }
    .hero-world-actions .primary, .hero-world-actions .secondary { width:auto; min-width:0; }
    .hero-world-note { color:#747b8b; font-size:.82rem; line-height:1.4; }
    @media (max-width:560px) {
      .hero-world-actions { display:grid; grid-template-columns:1fr 1fr; }
      .hero-world-actions .primary, .hero-world-actions .secondary { width:100%; }
      .hero-world-actions .primary:first-child:last-child { grid-column:1/-1; }
    }

    #modal.context-starworld {
      padding: 0;
      align-items: stretch;
      background: #03091a;
      backdrop-filter: none;
      -webkit-backdrop-filter: none;
    }
    #modal.context-starworld .sheet {
      width: 100vw;
      max-width: none;
      height: 100vh;
      max-height: none;
      margin: 0;
      padding: 0;
      overflow: hidden;
      border: 0;
      border-radius: 0;
      background: transparent;
      box-shadow: none;
    }
    #modal.context-starworld .sheet-header { display: none; }
    #modal.context-starworld .sheet-body { height: 100%; }
    .star-world-shell {
      position: relative;
      width: 100%;
      height: 100%;
      overflow: hidden;
      color: #f5f7ff;
      background:
        radial-gradient(circle at 18% 22%, rgba(76, 75, 176, .32), transparent 31%),
        radial-gradient(circle at 82% 28%, rgba(31, 102, 171, .28), transparent 29%),
        radial-gradient(circle at 50% 78%, rgba(91, 46, 130, .25), transparent 38%),
        linear-gradient(145deg, #08132f 0%, #071126 46%, #030919 100%);
    }
    .star-world-shell::before,
    .star-world-shell::after {
      content: '';
      position: absolute;
      inset: 0;
      pointer-events: none;
    }
    .star-world-shell::before {
      opacity: .72;
      background-image:
        radial-gradient(circle at 7% 16%, rgba(255,255,255,.82) 0 1px, transparent 1.8px),
        radial-gradient(circle at 17% 68%, rgba(213,225,255,.68) 0 1.1px, transparent 1.9px),
        radial-gradient(circle at 28% 29%, rgba(255,255,255,.88) 0 1px, transparent 1.8px),
        radial-gradient(circle at 39% 83%, rgba(207,220,255,.70) 0 1.2px, transparent 2px),
        radial-gradient(circle at 51% 18%, rgba(255,255,255,.80) 0 1px, transparent 1.8px),
        radial-gradient(circle at 63% 64%, rgba(228,236,255,.75) 0 1px, transparent 1.8px),
        radial-gradient(circle at 77% 14%, rgba(255,255,255,.86) 0 1px, transparent 1.8px),
        radial-gradient(circle at 88% 52%, rgba(218,230,255,.70) 0 1.1px, transparent 1.9px),
        radial-gradient(circle at 95% 85%, rgba(255,255,255,.76) 0 1px, transparent 1.8px);
    }
    .star-world-shell::after {
      background: radial-gradient(circle at 50% 44%, transparent 0 36%, rgba(1,4,13,.14) 60%, rgba(0,2,9,.56) 100%);
    }
    .star-world-close {
      position: absolute;
      top: max(22px, env(safe-area-inset-top));
      right: max(22px, env(safe-area-inset-right));
      z-index: 8;
      width: 44px;
      height: 44px;
      display: grid;
      place-items: center;
      border-radius: 50%;
      border: 1px solid rgba(220,228,255,.18);
      background: rgba(8,18,42,.52);
      color: #f4f7ff;
      box-shadow: 0 12px 32px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.06);
      backdrop-filter: blur(14px);
      -webkit-backdrop-filter: blur(14px);
      font-size: 1.35rem;
      line-height: 1;
      font-weight: 650;
    }
    .star-world-shell-scroll {
      position: relative;
      z-index: 2;
      width: 100%;
      height: 100%;
      overflow-y: auto;
      padding: clamp(76px, 9vh, 112px) clamp(24px, 5vw, 76px) clamp(34px, 6vh, 70px);
      scrollbar-width: thin;
    }
    .star-world-profile-switcher {
      width: min(720px, calc(100% - 104px));
      margin: 0 auto 20px;
      display: flex;
      align-items: flex-end;
      justify-content: center;
      gap: clamp(10px, 2vw, 20px);
      overflow-x: auto;
      padding: 4px 8px 8px;
      scrollbar-width: none;
    }
    .star-world-profile-switcher::-webkit-scrollbar { display: none; }
    .star-world-profile-switch {
      flex: 0 0 auto;
      display: grid;
      justify-items: center;
      gap: 6px;
      min-width: 70px;
      padding: 4px 6px;
      border: 0;
      background: transparent;
      color: rgba(234,240,255,.72);
      box-shadow: none;
    }
    .star-world-profile-switch-avatar {
      width: 50px;
      height: 50px;
      display: grid;
      place-items: center;
      overflow: hidden;
      border-radius: 50%;
      border: 2px solid rgba(214,225,255,.22);
      background: rgba(8,18,42,.66);
      box-shadow: 0 8px 22px rgba(0,0,0,.24);
      font-size: 1.8rem;
      transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
    }
    .star-world-profile-switch-avatar > img,
    .star-world-profile-switch-avatar > .profile-identity-crop { width:100%; height:100%; object-fit:cover; border-radius:50%; }
    .star-world-profile-switch-name {
      max-width: 92px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      font-size: .72rem;
      line-height: 1;
      font-weight: 760;
      color: inherit;
    }
    .star-world-profile-switch.active { color: #fff; }
    .star-world-profile-switch.active .star-world-profile-switch-avatar {
      transform: scale(1.08);
      border-color: color-mix(in srgb, var(--switch-profile-color) 82%, white);
      box-shadow: 0 0 0 3px rgba(4,10,26,.62), 0 0 0 5px color-mix(in srgb, var(--switch-profile-color) 76%, transparent), 0 10px 28px rgba(0,0,0,.32);
    }
    .star-world-profile-list {
      width: min(1100px, 100%);
      min-height: calc(100vh - 190px);
      margin: 0 auto;
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
      align-content: center;
      gap: clamp(18px, 2.4vw, 30px);
    }
    .star-world-profile-card {
      position: relative;
      min-height: 250px;
      overflow: hidden;
      border-radius: 26px;
      border: 1px solid rgba(207,219,251,.16);
      background:
        radial-gradient(circle at 30% 24%, color-mix(in srgb, var(--management-profile-color) 24%, transparent), transparent 42%),
        linear-gradient(150deg, rgba(24,43,83,.78), rgba(8,17,40,.92));
      box-shadow: 0 22px 55px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.05);
      color: #fff;
      padding: 0;
      text-align: left;
      transform: translateY(0);
      transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
    }
    .star-world-profile-card:hover { transform: translateY(-3px); border-color: rgba(225,233,255,.30); box-shadow: 0 28px 65px rgba(0,0,0,.34); }
    .star-world-profile-card:active { transform: translateY(0) scale(.992); }
    .star-world-profile-card-bg,
    .star-world-profile-card-bg img {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
    }
    .star-world-profile-card-bg img { object-fit: cover; filter: saturate(.9) brightness(.78); transform: scale(1.035); }
    .star-world-profile-card::after {
      content: '';
      position: absolute;
      inset: 0;
      background: linear-gradient(180deg, rgba(5,11,29,.06) 12%, rgba(4,10,25,.20) 45%, rgba(3,8,21,.91) 100%);
    }
    .star-world-profile-card-content {
      position: absolute;
      z-index: 2;
      left: 18px;
      right: 18px;
      bottom: 18px;
      display: flex;
      align-items: center;
      gap: 12px;
    }
    .star-world-profile-avatar {
      flex: 0 0 54px;
      width: 54px;
      height: 54px;
      display: grid;
      place-items: center;
      overflow: hidden;
      border-radius: 50%;
      background: rgba(9,19,43,.82);
      border: 2px solid color-mix(in srgb, var(--management-profile-color) 78%, white);
      box-shadow: 0 0 0 4px rgba(5,12,29,.28), 0 8px 22px rgba(0,0,0,.25);
      font-size: 2rem;
    }
    .star-world-profile-avatar > img,
    .star-world-profile-avatar > .profile-identity-crop { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
    .star-world-profile-name { min-width: 0; font-size: 1.05rem; font-weight: 820; letter-spacing: -.015em; text-shadow: 0 2px 12px rgba(0,0,0,.48); }
    .star-world-detail {
      width: min(1180px, 100%);
      min-height: calc(100vh - 154px);
      margin: 0 auto;
      display: grid;
      align-content: center;
      gap: 18px;
    }
    .star-world-detail-nav { display: flex; align-items: center; justify-content: flex-start; }
    .star-world-back {
      width: 44px;
      height: 44px;
      display: grid;
      place-items: center;
      border-radius: 50%;
      border: 1px solid rgba(220,228,255,.16);
      background: rgba(8,18,42,.46);
      color: #f4f7ff;
      font-size: 1.65rem;
      line-height: 1;
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
    }
    .star-world-current-stage {
      position: relative;
      width: 100%;
      min-height: min(68vh, 720px);
      overflow: hidden;
      border-radius: 30px;
      border: 1px solid rgba(210,221,251,.16);
      background: rgba(5,12,29,.72);
      box-shadow: 0 28px 78px rgba(0,0,0,.38);
    }
    .star-world-current-backdrop,
    .star-world-current-backdrop img {
      position: absolute;
      inset: -4%;
      width: 108%;
      height: 108%;
    }
    .star-world-current-backdrop img { object-fit: cover; filter: blur(30px) brightness(.52) saturate(.86); transform: scale(1.08); }
    .star-world-current-image {
      position: absolute;
      inset: 0;
      display: grid;
      place-items: center;
      padding: clamp(18px, 3vw, 34px);
    }
    .star-world-current-image img {
      width: 100%;
      height: 100%;
      object-fit: contain;
      border-radius: 20px;
      filter: drop-shadow(0 18px 35px rgba(0,0,0,.30));
    }
    .star-world-current-actions {
      position: absolute;
      z-index: 3;
      left: 50%;
      bottom: 24px;
      transform: translateX(-50%);
      display: flex;
      justify-content: center;
      gap: 10px;
      width: min(calc(100% - 36px), 520px);
    }
    .star-world-current-actions .primary,
    .star-world-current-actions .secondary {
      min-width: 0;
      border-radius: 14px;
      padding: 13px 18px;
      box-shadow: 0 12px 28px rgba(0,0,0,.24);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
    }
    .star-world-current-actions .secondary {
      background: rgba(6,15,36,.62);
      border-color: rgba(220,228,255,.18);
      color: #f4f7ff;
    }
    .star-world-no-world {
      min-height: min(62vh, 620px);
      display: grid;
      place-items: center;
      border-radius: 30px;
      border: 1px solid rgba(210,221,251,.14);
      background:
        radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--star-world-profile-color) 20%, transparent), transparent 28%),
        linear-gradient(145deg, rgba(17,34,73,.62), rgba(5,13,31,.80));
      box-shadow: 0 28px 78px rgba(0,0,0,.34);
    }
    .star-world-no-world .primary { border-radius: 14px; padding: 14px 20px; }
    #modal.context-starworld .hero-world-editor,
    #modal.context-starworld .star-world-questions-after-preview {
      width: min(760px, 100%);
      margin: 0 auto;
      display: grid;
      gap: 18px;
      padding: clamp(20px, 4vw, 34px);
      border: 1px solid rgba(207,219,251,.14);
      border-radius: 28px;
      background: rgba(7,17,40,.54);
      box-shadow: 0 24px 68px rgba(0,0,0,.30);
      backdrop-filter: blur(18px);
      -webkit-backdrop-filter: blur(18px);
    }
    #modal.context-starworld .hero-world-generator-intro { display: none; }
    #modal.context-starworld .hero-world-question > label { color: #f3f6ff; font-size: .92rem; font-weight: 760; }
    #modal.context-starworld .hero-world-question input {
      min-height: 50px;
      border-radius: 14px;
      border-color: rgba(193,207,242,.18);
      background: rgba(3,11,28,.66);
      color: #f5f7ff;
      box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
    }
    #modal.context-starworld .hero-world-question input:focus { border-color: color-mix(in srgb, var(--star-world-profile-color) 62%, white); box-shadow: 0 0 0 3px color-mix(in srgb, var(--star-world-profile-color) 20%, transparent); }
    #modal.context-starworld .hero-suggestion-chip {
      border-color: rgba(196,209,242,.16);
      background: rgba(255,255,255,.065);
      color: #dce4f8;
    }
    #modal.context-starworld .hero-world-actions { justify-content: center; padding-top: 2px; }
    #modal.context-starworld .hero-world-actions .primary { border-radius: 14px; padding: 14px 20px; }
    #modal.context-starworld .hero-world-preview,
    #modal.context-starworld .hero-world-current { border-color: rgba(207,219,251,.14); background: rgba(5,13,31,.70); }
    #modal.context-starworld .star-world-questions-after-preview { border-top: 1px solid rgba(207,219,251,.12); }
    @media (max-width: 720px) {
      .star-world-shell-scroll { padding: 74px 16px 26px; }
      .star-world-profile-switcher { width: calc(100% - 58px); justify-content: flex-start; margin-bottom: 14px; }
      .star-world-profile-switch { min-width: 62px; }
      .star-world-profile-switch-avatar { width: 46px; height: 46px; }
      .star-world-profile-list { grid-template-columns: repeat(2, minmax(0, 1fr)); min-height: calc(100vh - 130px); gap: 14px; }
      .star-world-profile-card { min-height: 210px; border-radius: 22px; }
      .star-world-current-stage { min-height: 66vh; border-radius: 24px; }
      .star-world-current-actions { display: grid; grid-template-columns: 1fr; }
    }

    /* Desktop browsers have less usable vertical space once browser chrome is present.
       Keep the full current-world frame visible without changing touch/iOS sizing. */
    @media (min-width: 900px) and (hover: hover) and (pointer: fine) {
      .star-world-current-stage {
        min-height: 0;
        height: min(60vh, 620px);
      }
    }

    /* v1.26.0 profile avatar crop */
    .profile-identity-crop {
      position:relative; display:block; width:100%; height:100%; overflow:hidden; border-radius:inherit;
      background:rgba(11,22,48,.20);
    }
    .profile-identity-crop .profile-identity-fallback {
      position:absolute; inset:0; display:grid; place-items:center; font-size:inherit; line-height:1;
    }
    .profile-identity-crop img {
      position:absolute !important; inset:0 !important; width:100% !important; height:100% !important; max-width:none !important;
      object-fit:cover !important; object-position:var(--avatar-x, 50%) var(--avatar-y, 50%) !important;
      transform:scale(var(--avatar-zoom, 1)) !important; transform-origin:var(--avatar-x, 50%) var(--avatar-y, 50%) !important;
      border-radius:inherit !important; filter:none !important;
    }
    .management-row-emoji { overflow:hidden; border-radius:50%; }
    .management-row-emoji > img,
    .management-row-emoji > .profile-identity-crop,
    .management-person-visual > img,
    .management-person-visual > .profile-identity-crop,
    .profile-choice-avatar > img,
    .profile-choice-avatar > .profile-identity-crop { width:100%; height:100%; object-fit:cover; border-radius:50%; }
    .management-person-visual {
      flex:0 0 26px; width:26px; height:26px; display:grid; place-items:center; overflow:hidden; border-radius:50%; font-size:1rem;
      background:#f0eef4;
    }
    .profile-choice-avatar {
      width:44px; height:44px; margin:0 auto 7px; display:grid; place-items:center; overflow:hidden; border-radius:50%;
      background:#f0eef4; font-size:1.7rem;
    }
    .hero-avatar-control {
      display:grid; gap:10px; padding:13px; border:1px solid #dde1ea; border-radius:16px; background:#f8f8fb;
    }
    .hero-avatar-control-head { display:flex; align-items:center; justify-content:space-between; gap:12px; }
    .hero-avatar-control-copy { min-width:0; }
    .hero-avatar-control-title { color:#242b3b; font-size:.84rem; font-weight:780; }
    .hero-avatar-control-note { margin-top:3px; color:#747b8b; font-size:.72rem; line-height:1.35; }
    .hero-avatar-current {
      flex:0 0 58px; width:58px; height:58px; display:grid; place-items:center; overflow:hidden; border-radius:50%;
      background:#101b38; border:2px solid rgba(122,85,163,.28); font-size:2rem;
    }
    .hero-avatar-actions { display:flex; flex-wrap:wrap; gap:8px; }
    .hero-avatar-actions .primary, .hero-avatar-actions .secondary { width:auto; min-width:0; }
    .hero-avatar-editor { display:grid; gap:12px; padding-top:3px; }
    .hero-avatar-crop-stage {
      width:min(280px, 76vw); aspect-ratio:1; justify-self:center; position:relative; overflow:hidden; border-radius:50%;
      background:#0a1733; border:4px solid #fff; box-shadow:0 0 0 2px #c9cedb, 0 14px 32px rgba(26,32,50,.20);
      cursor:grab; touch-action:none; user-select:none; -webkit-user-select:none;
    }
    .hero-avatar-crop-stage.dragging { cursor:grabbing; }
    .hero-avatar-crop-stage .profile-identity-crop { border-radius:50%; }
    .hero-avatar-crop-guide {
      position:absolute; inset:12%; z-index:3; pointer-events:none; border:1px solid rgba(255,255,255,.36); border-radius:50%;
      box-shadow:0 0 0 999px rgba(4,10,25,.06);
    }
    .hero-avatar-zoom { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:10px; }
    .hero-avatar-zoom span { color:#687082; font-size:.74rem; font-weight:700; }
    .hero-avatar-zoom input { padding:0; accent-color:#7a55a3; }
    .hero-avatar-editor-note { text-align:center; color:#747b8b; font-size:.72rem; line-height:1.35; }
    @media (max-width:560px) {
      .hero-avatar-control-head { align-items:flex-start; }
      .hero-avatar-actions { display:grid; grid-template-columns:1fr 1fr; }
      .hero-avatar-actions .primary, .hero-avatar-actions .secondary { width:100%; }
      .hero-avatar-actions .primary:first-child:last-child { grid-column:1/-1; }
    }



    /* v1.27.0 Star Behavior recognition */
    #dashboard .profile-hero-title {
      display:none;
      margin-top:4px;
      color:rgba(242,245,255,.92);
      font-size:clamp(.78rem, 2vw, .92rem);
      font-weight:760;
      letter-spacing:.015em;
      text-shadow:0 2px 12px rgba(0,0,0,.6);
    }
    #dashboard .profile-hero-title.show { display:block; }
    #dashboard .hero-recognition-zone {
      position:absolute;
      z-index:4;
      right:clamp(18px, 4vw, 54px);
      bottom:56px;
      display:flex;
      align-items:flex-end;
      gap:12px;
    }
    #dashboard .hero-badge-token,
    #dashboard .hero-recognition-pending {
      border:1px solid rgba(211,221,255,.18);
      background:rgba(8,20,48,.46);
      color:#f7f8ff;
      box-shadow:inset 0 1px 0 rgba(255,255,255,.08), 0 14px 35px rgba(0,0,0,.23);
      backdrop-filter:blur(14px);
      -webkit-backdrop-filter:blur(14px);
    }
    #dashboard .hero-badge-token {
      width:82px;
      min-height:82px;
      border-radius:22px;
      padding:10px 8px 8px;
      display:grid;
      place-items:center;
      gap:3px;
      text-align:center;
    }
    #dashboard .hero-badge-token-icon { font-size:2rem; line-height:1; filter:drop-shadow(0 5px 11px rgba(0,0,0,.3)); }
    #dashboard .hero-badge-token-name { max-width:100%; font-size:.62rem; line-height:1.1; color:#d7def1; font-weight:720; }
    #dashboard .hero-recognition-pending {
      min-width:118px;
      border-radius:24px;
      padding:9px 12px 9px 9px;
      display:flex;
      align-items:center;
      gap:8px;
      animation:recognitionFloat 2.8s ease-in-out infinite;
    }
    #dashboard .hero-recognition-pending-orb {
      width:46px; height:46px; flex:0 0 46px; border-radius:50%; display:grid; place-items:center;
      background:radial-gradient(circle at 45% 40%, #fff7c7 0 8%, #efc765 20%, #9c6cf0 46%, rgba(71,58,154,.1) 72%);
      box-shadow:0 0 18px rgba(242,203,103,.72), 0 0 42px color-mix(in srgb, var(--hero-profile-color, #9d67ef) 60%, transparent);
    }
    #dashboard .hero-recognition-pending-orb span { font-size:1.35rem; color:#fff; text-shadow:0 0 10px #fff; }
    #dashboard .hero-recognition-pending-copy { font-size:.66rem; line-height:1.12; font-weight:800; text-align:left; }
    @keyframes recognitionFloat { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-4px)} }
    @media (max-width:560px) {
      #dashboard .hero-recognition-zone { right:16px; bottom:42px; gap:8px; }
      #dashboard .hero-badge-token { width:68px; min-height:68px; border-radius:19px; padding:8px 6px 6px; }
      #dashboard .hero-badge-token-icon { font-size:1.65rem; }
      #dashboard .hero-badge-token-name { font-size:.55rem; }
      #dashboard .hero-recognition-pending { min-width:0; width:64px; height:64px; padding:8px; border-radius:21px; justify-content:center; }
      #dashboard .hero-recognition-pending-orb { width:44px; height:44px; flex-basis:44px; }
      #dashboard .hero-recognition-pending-copy { display:none; }
    }
    @media (prefers-reduced-motion:reduce) { #dashboard .hero-recognition-pending { animation:none; } }

    .management-nav { display:flex; overflow-x:auto; scrollbar-width:none; }
    .management-nav::-webkit-scrollbar { display:none; }
    .management-tab { flex:0 0 auto; min-width:92px; }

    .recognition-profile-select { display:grid; gap:6px; margin-bottom:14px; font-size:.78rem; font-weight:720; }
    .recognition-profile-select select { min-height:44px; }
    .recognition-award-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
    .recognition-award-button {
      min-height:74px; border:1px solid #dedee7; border-radius:16px; background:#fff; padding:10px 12px;
      display:grid; grid-template-columns:42px minmax(0,1fr) auto; align-items:center; gap:9px; text-align:left; color:#202536;
      box-shadow:0 2px 8px rgba(31,37,54,.04);
    }
    .recognition-award-button:active { transform:scale(.985); background:#f8f6fb; }
    .recognition-award-icon { font-size:1.7rem; text-align:center; }
    .recognition-award-copy { display:grid; gap:2px; min-width:0; }
    .recognition-award-copy strong { font-size:.8rem; line-height:1.1; }
    .recognition-award-copy small { color:#7a7484; font-size:.65rem; }
    .recognition-award-stars { font-size:.7rem; font-weight:800; white-space:nowrap; color:#775b1c; }
    .recognition-adjust-stars { margin-top:20px; }
    .recognition-selected-behavior { width:100%; cursor:default; margin-bottom:16px; }
    .recognition-behavior-actions { justify-content:flex-start; }
    @media (max-width:560px) { .recognition-award-grid { grid-template-columns:1fr; } }

    .recognition-fanfare {
      position:fixed; inset:0; z-index:1200; display:grid; place-items:center; overflow:hidden;
      background:radial-gradient(circle at 50% 48%, rgba(105,77,190,.22), rgba(3,8,24,.72) 52%, rgba(3,8,24,.88));
      backdrop-filter:blur(6px); -webkit-backdrop-filter:blur(6px);
      animation:recognitionFadeIn .22s ease-out both;
    }
    .recognition-fanfare-glow { position:absolute; width:min(76vw,520px); aspect-ratio:1; border-radius:50%; background:radial-gradient(circle, rgba(255,223,132,.28), rgba(129,87,224,.16) 35%, transparent 68%); filter:blur(12px); animation:recognitionPulse 1.9s ease-in-out infinite; }
    .recognition-fanfare-card { position:relative; z-index:2; width:min(88vw,420px); text-align:center; color:#fff; padding:34px 24px; }
    .recognition-fanfare-kicker { font-size:clamp(1.45rem,5vw,2rem); font-weight:900; letter-spacing:-.03em; text-shadow:0 4px 22px rgba(0,0,0,.4); }
    .recognition-fanfare-icon { margin:18px auto 11px; font-size:clamp(4.2rem,18vw,6.6rem); line-height:1; filter:drop-shadow(0 0 25px rgba(255,221,126,.58)); }
    .recognition-fanfare-name { font-size:clamp(1.25rem,4vw,1.65rem); font-weight:860; }
    .recognition-fanfare-title { margin-top:5px; color:#decfff; font-size:.92rem; font-weight:730; }
    .recognition-fanfare-stars { margin-top:16px; color:#ffe59a; font-size:1.55rem; font-weight:900; text-shadow:0 0 18px rgba(255,218,112,.35); }
    .recognition-fanfare-praise { margin-top:8px; color:#d5ddf2; font-size:.8rem; font-weight:600; }
    @keyframes recognitionFadeIn { from{opacity:0} to{opacity:1} }
    @keyframes recognitionPulse { 0%,100%{transform:scale(.94);opacity:.74} 50%{transform:scale(1.06);opacity:1} }

    .recognition-history {
      display:grid;
      grid-template-columns:repeat(3, minmax(0,1fr));
      gap:12px 10px;
      max-height:58vh;
      overflow-y:auto;
      padding:1px 2px 4px;
      scrollbar-width:thin;
    }
    .recognition-history-profile {
      grid-column:1 / -1;
      color:rgba(218,226,246,.70);
      font-size:.72rem;
      font-weight:760;
      margin:0 0 2px;
      letter-spacing:.02em;
    }
    .recognition-history-row {
      min-width:0;
      min-height:104px;
      display:grid;
      align-content:center;
      justify-items:center;
      gap:7px;
      padding:12px 7px 10px;
      border:1px solid rgba(184,201,239,.08);
      border-radius:16px;
      background:rgba(255,255,255,.025);
      box-shadow:inset 0 1px 0 rgba(255,255,255,.025);
    }
    .recognition-history-icon { font-size:2rem; line-height:1; text-align:center; filter:drop-shadow(0 3px 8px rgba(0,0,0,.26)); }
    .recognition-history-date { color:rgba(194,204,228,.66); font-size:.63rem; line-height:1; }
    .recognition-history-stars { color:#f3cd63; font-size:.72rem; font-weight:850; line-height:1; white-space:nowrap; text-shadow:0 0 9px rgba(242,201,76,.14); }



    /* v1.29.0 centered hero stats + diffused recognition atmosphere */
    #dashboard .profile-hero-copy {
      position: static;
      display: contents;
      pointer-events: none;
    }
    #dashboard .profile-hero-identity {
      position: absolute;
      z-index: 3;
      left: 53%;
      right: clamp(22px, 4.5vw, 60px);
      bottom: 154px;
      isolation: isolate;
      display: grid;
      gap: 4px;
      justify-items: start;
      max-width: 100%;
      pointer-events: none;
    }
    #dashboard .profile-hero-identity::before {
      content: '';
      position: absolute;
      z-index: -1;
      left: -28px;
      right: -46px;
      top: -22px;
      bottom: -19px;
      border-radius: 48%;
      pointer-events: none;
      background:
        radial-gradient(ellipse at 32% 48%, color-mix(in srgb, var(--hero-profile-color, #9d67ef) 14%, transparent), transparent 55%),
        radial-gradient(ellipse at 38% 54%, rgba(2,8,24,.42), transparent 74%);
      filter: blur(18px);
      opacity: .76;
    }
    #dashboard .profile-hero-name {
      text-shadow:
        -.5px 0 rgba(4,10,26,.90), .5px 0 rgba(4,10,26,.90),
        0 -.5px rgba(4,10,26,.90), 0 .5px rgba(4,10,26,.90),
        0 3px 12px rgba(0,0,0,.54),
        0 0 15px color-mix(in srgb, var(--hero-profile-color, #fff) 36%, transparent),
        0 0 28px color-mix(in srgb, var(--hero-profile-color, #fff) 13%, transparent);
    }
    #dashboard .profile-hero-title {
      margin-top: 0;
      color: rgba(247,249,255,.96);
      text-shadow:
        0 2px 10px rgba(0,0,0,.68),
        0 0 12px color-mix(in srgb, var(--hero-profile-color, #fff) 20%, transparent);
    }
    #dashboard .profile-hero-stats-row {
      position: absolute;
      z-index: 3;
      left: 50%;
      bottom: 28px;
      width: min(calc(100% - 40px), 390px);
      transform: translateX(-50%);
      display: grid;
      grid-template-columns: repeat(3, minmax(0,1fr));
      gap: 8px;
      pointer-events: auto;
    }
    #dashboard .profile-hero-stat {
      --stat-accent: var(--hero-profile-color, #8f70e8);
      min-width: 0;
      min-height: 64px;
      padding: 8px 7px 7px;
      border: 1px solid color-mix(in srgb, var(--hero-profile-color, #8f70e8) 68%, rgba(215,225,247,.28));
      border-radius: 17px;
      display: grid;
      align-content: center;
      justify-items: center;
      gap: 4px;
      color: #f6f8ff;
      text-align: center;
      background: linear-gradient(135deg,
        color-mix(in srgb, var(--hero-profile-color, #8f70e8) 7%, transparent),
        rgba(255,255,255,.018) 50%,
        color-mix(in srgb, var(--hero-profile-color, #8f70e8) 4%, transparent) 100%);
      box-shadow:
        inset 0 1px 0 rgba(255,255,255,.05),
        0 6px 18px rgba(0,0,0,.10),
        0 0 12px color-mix(in srgb, var(--hero-profile-color, #8f70e8) 9%, transparent);
      backdrop-filter: blur(3px) saturate(106%);
      -webkit-backdrop-filter: blur(3px) saturate(106%);
    }
    #dashboard button.profile-hero-stat {
      font: inherit;
      cursor: pointer;
    }
    #dashboard button.profile-hero-stat:disabled {
      cursor: default;
      opacity: .84;
    }
    #dashboard button.profile-hero-stat:not(:disabled):active { transform: scale(.97); }
    #dashboard .profile-hero-stat-value {
      min-width: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      color: #fff;
      font-size: clamp(1.42rem, 2.7vw, 1.68rem);
      line-height: 1;
      font-weight: 880;
      text-shadow: 0 2px 9px rgba(0,0,0,.44), 0 0 12px color-mix(in srgb, var(--stat-accent) 24%, transparent);
    }
    #dashboard .profile-hero-stat-label {
      width: 100%;
      color: rgba(237,241,252,.94);
      font-size: .65rem;
      line-height: 1.08;
      font-weight: 760;
      overflow: hidden;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
    }
    #dashboard .profile-hero-stat-badge-icon { font-size: 1.58rem; line-height: 1; }

    /* Pending recognition is atmosphere around the hero plus a separate bottom-left prompt. */
    #dashboard .hero-recognition-zone {
      position: absolute;
      inset: 0;
      z-index: 2;
      pointer-events: none;
    }
    #dashboard .hero-recognition-pending {
      position: absolute;
      left: var(--hero-glow-x, 25%);
      top: var(--hero-glow-y, 54%);
      width: clamp(255px, 31vw, 410px);
      height: clamp(255px, 32vw, 410px);
      min-width: 0;
      padding: 0;
      border: 0;
      border-radius: 50%;
      background: transparent;
      box-shadow: none;
      backdrop-filter: none;
      -webkit-backdrop-filter: none;
      transform: translate(-50%, -50%);
      animation: none;
      pointer-events: auto;
      overflow: visible;
      color: #fff;
    }
    #dashboard .hero-recognition-pending::before,
    #dashboard .hero-recognition-pending::after {
      content: '';
      position: absolute;
      border-radius: 50%;
      pointer-events: none;
    }
    #dashboard .hero-recognition-pending::before {
      inset: 0;
      background:
        radial-gradient(circle,
          rgba(255,247,198,.12) 0%,
          color-mix(in srgb, var(--hero-profile-color, #9d67ef) 22%, transparent) 28%,
          color-mix(in srgb, var(--hero-profile-color, #9d67ef) 11%, transparent) 52%,
          transparent 78%);
      filter: blur(26px);
      animation: heroRecognitionAura 2.7s ease-in-out infinite;
    }
    #dashboard .hero-recognition-pending::after {
      inset: 15%;
      background: radial-gradient(circle, rgba(255,243,178,.13), color-mix(in srgb, var(--hero-profile-color, #9d67ef) 15%, transparent) 45%, transparent 76%);
      filter: blur(31px);
      animation: heroRecognitionCore 2.7s ease-in-out infinite;
    }
    #dashboard .hero-recognition-sparkles {
      position: absolute;
      inset: 6%;
      border-radius: 50%;
      pointer-events: none;
      opacity: .28;
      background:
        radial-gradient(circle at 23% 33%, rgba(255,255,230,.74) 0 1.1px, transparent 2.1px),
        radial-gradient(circle at 68% 24%, rgba(255,241,177,.58) 0 1.2px, transparent 2.3px),
        radial-gradient(circle at 78% 59%, rgba(235,224,255,.55) 0 1px, transparent 2px),
        radial-gradient(circle at 36% 75%, rgba(255,249,218,.58) 0 1.2px, transparent 2.2px),
        radial-gradient(circle at 52% 45%, rgba(255,255,255,.34) 0 1px, transparent 2px);
      filter: blur(.2px) drop-shadow(0 0 5px rgba(255,242,180,.34));
      animation: heroRecognitionSparkle 3.8s ease-in-out infinite;
    }
    #dashboard .hero-recognition-pending-copy {
      position: absolute;
      left: clamp(22px, 4vw, 54px);
      bottom: 110px;
      width: max-content;
      max-width: min(46%, 260px);
      padding: 8px 11px;
      border: 0;
      background: transparent;
      color: #fff6d2;
      font: inherit;
      font-size: clamp(.82rem, 1.7vw, 1.02rem);
      line-height: 1;
      font-weight: 880;
      letter-spacing: .01em;
      text-align: left;
      text-shadow:
        0 2px 10px rgba(0,0,0,.76),
        0 0 10px rgba(255,235,153,.44),
        0 0 19px color-mix(in srgb, var(--hero-profile-color, #9d67ef) 38%, transparent);
      pointer-events: auto;
      cursor: pointer;
      appearance:none;
      -webkit-appearance:none;
      isolation: isolate;
      animation: heroRecognitionCopy 2.7s ease-in-out infinite;
    }
    #dashboard .hero-recognition-pending-copy::before {
      content: '';
      position: absolute;
      z-index: -1;
      left: -18px;
      right: -26px;
      top: -13px;
      bottom: -14px;
      border-radius: 50%;
      background: radial-gradient(ellipse at 38% 50%, rgba(3,10,28,.56), color-mix(in srgb, var(--hero-profile-color, #9d67ef) 14%, rgba(3,10,28,.28)) 48%, transparent 76%);
      filter: blur(10px);
      opacity: .88;
      pointer-events: none;
    }
    @keyframes heroRecognitionAura {
      0%,100% { transform:scale(.94); opacity:.34; }
      50% { transform:scale(1.08); opacity:.78; }
    }
    @keyframes heroRecognitionCore {
      0%,100% { transform:scale(.91); opacity:.24; }
      50% { transform:scale(1.11); opacity:.62; }
    }
    @keyframes heroRecognitionSparkle {
      0%,100% { opacity:.16; transform:scale(.96) rotate(-1deg); }
      45% { opacity:.32; }
      60% { opacity:.24; transform:scale(1.035) rotate(1deg); }
    }
    @keyframes heroRecognitionCopy {
      0%,100% { opacity:.80; filter:brightness(.98); }
      50% { opacity:1; filter:brightness(1.08); }
    }

    @media (max-width: 620px) {
      #dashboard .profile-carousel {
        width: 85%;
        grid-template-columns: 28px minmax(0,1fr) 28px;
        margin-top: 9px;
      }
      #dashboard .carousel-arrow { width:28px; height:44px; font-size:1.55rem; }
      #dashboard .profiles { min-height:106px; padding-top:5px; }
      #dashboard .profile-card { width:75px; min-height:90px; }
      #dashboard .profile-avatar { width:44px; height:44px; font-size:1.92rem; }
      #dashboard .profile-card.selected .profile-avatar { width:58px; height:58px; }
      #dashboard .profile-name { max-width:74px; font-size:.68rem; }
      #dashboard .profile-card.selected .profile-name { font-size:.75rem; }
      #dashboard .profile-stars { font-size:.61rem; }

      #dashboard .profile-hero-identity {
        left: 52%;
        right: 12px;
        bottom: 143px;
      }
      #dashboard .profile-hero-stats-row {
        bottom: 24px;
        width: min(calc(100% - 34px), 326px);
        gap: 6px;
      }
      #dashboard .profile-hero-stat { min-height:58px; padding:6px 4px 5px; border-radius:14px; gap:3px; }
      #dashboard .profile-hero-stat-value { font-size:1.34rem; }
      #dashboard .profile-hero-stat-label { font-size:.54rem; }
      #dashboard .profile-hero-stat-badge-icon { font-size:1.38rem; }
      #dashboard .profile-hero-identity::before { left:-18px; right:-23px; top:-16px; bottom:-15px; filter:blur(13px); }
      #dashboard .hero-recognition-pending { width:270px; height:270px; }
      #dashboard .hero-recognition-pending-copy {
        display:block;
        left:18px;
        bottom:94px;
        max-width:48%;
        padding:7px 9px;
        font-size:.76rem;
      }
    }
    @media (max-width: 390px) {
      #dashboard .profile-carousel { width:86%; }
      #dashboard .profile-hero-identity { left:51%; right:9px; bottom:138px; }
      #dashboard .profile-hero-stats-row { width:calc(100% - 34px); gap:5px; bottom:22px; }
      #dashboard .profile-hero-stat { min-height:56px; }
      #dashboard .profile-hero-stat-label { font-size:.52rem; }
      #dashboard .hero-recognition-pending-copy { left:14px; bottom:90px; font-size:.72rem; }
    }
    @media (prefers-reduced-motion: reduce) {
      #dashboard .hero-recognition-pending::before,
      #dashboard .hero-recognition-pending::after,
      #dashboard .hero-recognition-sparkles,
      #dashboard .hero-recognition-pending-copy { animation:none; opacity:.78; }
    }

    /* v1.33.0 Star World generator + cosmic travel */
    .hero-world-generator-intro {
      display:grid;
      gap:4px;
      padding:4px 0 1px;
    }
    .hero-world-generator-title {
      color:#242b3b;
      font-size:1.06rem;
      line-height:1.15;
      font-weight:820;
      letter-spacing:-.012em;
    }
    .hero-world-generator-copy {
      color:#747b8b;
      font-size:.81rem;
      line-height:1.35;
    }

    body.star-world-traveling { overflow:hidden; }
    body.star-world-traveling > .app,
    body.star-world-traveling > #modal {
      transition:opacity .48s ease, filter .48s ease, transform .48s ease;
      opacity:.12;
      filter:blur(7px) saturate(.82);
      transform:scale(.985);
    }

    .star-world-travel {
      --star-world-profile-color:#9d67ef;
      position:fixed;
      inset:0;
      z-index:260;
      overflow:hidden;
      opacity:0;
      visibility:hidden;
      pointer-events:none;
      background:#040a1b;
      color:#f8f9ff;
      transition:opacity .42s ease, visibility 0s linear .42s;
      isolation:isolate;
    }
    .star-world-travel.active {
      opacity:1;
      visibility:visible;
      pointer-events:auto;
      transition:opacity .42s ease, visibility 0s;
    }
    .star-world-travel.leaving {
      opacity:0;
      pointer-events:none;
    }
    .star-world-arrival-backdrop,
    .star-world-arrival-image {
      position:absolute;
      opacity:0;
      transition:opacity 1.05s ease, transform 1.75s cubic-bezier(.2,.72,.2,1), filter 1.4s ease;
    }
    .star-world-arrival-backdrop {
      inset:-5%;
      z-index:0;
      width:110%;
      height:110%;
      object-fit:cover;
      transform:scale(1.08);
      filter:blur(30px) saturate(.9) brightness(.46);
    }
    .star-world-arrival-image {
      inset:0;
      z-index:1;
      width:100%;
      height:100%;
      object-fit:contain;
      transform:scale(1.035);
      filter:saturate(.96) brightness(.9) drop-shadow(0 20px 50px rgba(0,0,0,.26));
    }
    .star-world-travel.revealing .star-world-arrival-backdrop {
      opacity:.82;
      transform:scale(1.02);
      filter:blur(26px) saturate(.98) brightness(.54);
    }
    .star-world-travel.revealing .star-world-arrival-image {
      opacity:1;
      transform:scale(1);
      filter:saturate(1) brightness(1) drop-shadow(0 20px 50px rgba(0,0,0,.20));
    }
    /* Once the reveal has settled, keep only the actual image and controls composited.
       This reduces iOS Safari memory pressure during pinch-zoom. */
    .star-world-travel.decision-ready .star-world-arrival-backdrop,
    .star-world-travel.decision-ready .star-world-cosmos {
      display:none;
    }
    .star-world-travel.decision-ready .star-world-arrival-image {
      --star-world-decision-reserve: 132px;
      height: calc(100% - var(--star-world-decision-reserve));
      object-fit: contain;
      object-position: center center;
      filter:none;
      transition:none;
    }
    body.star-world-decision > .app,
    body.star-world-decision > #modal {
      visibility:hidden;
    }

    .star-world-cosmos {
      position:absolute;
      inset:-10%;
      z-index:2;
      overflow:hidden;
      background:
        radial-gradient(ellipse at 52% 48%, rgba(74,78,155,.34) 0%, rgba(33,37,92,.34) 25%, transparent 57%),
        radial-gradient(ellipse at 20% 74%, rgba(83,51,132,.36) 0%, transparent 49%),
        radial-gradient(ellipse at 84% 28%, rgba(31,73,129,.30) 0%, transparent 48%),
        linear-gradient(145deg, #07102a 0%, #090d25 44%, #05091a 100%);
      transform:scale(1.02);
      transition:opacity 1.32s ease, transform 1.55s cubic-bezier(.25,.8,.25,1), filter 1.2s ease;
    }
    .star-world-cosmos::after {
      content: ;
      position: absolute;
      inset: -4%;
      pointer-events: none;
      background: radial-gradient(circle at 50% 46%, rgba(0,0,0,0) 0 18%, rgba(6,10,23,.10) 30%, rgba(4,8,19,.38) 58%, rgba(2,5,14,.76) 82%, rgba(1,3,10,.94) 100%);
      z-index: 5;
    }
    .star-world-travel.entering .star-world-cosmos {
      animation:starWorldLaunch 1.6s cubic-bezier(.2,.72,.15,1) both;
    }
    .star-world-travel.looping .star-world-cosmos {
      animation:starWorldDrift 11s ease-in-out infinite alternate;
    }
    .star-world-travel.revealing .star-world-cosmos {
      opacity:0;
      transform:scale(1.13);
      filter:blur(7px) brightness(1.12);
    }

    .star-world-cloud {
      position:absolute;
      border-radius:48% 52% 44% 56%;
      filter:blur(34px);
      mix-blend-mode:screen;
      opacity:.54;
      will-change:transform, opacity;
      transition:transform 1.28s cubic-bezier(.2,.78,.2,1), opacity 1.08s ease;
    }
    .star-world-cloud.cloud-a {
      width:72vw; height:56vw; left:-19vw; top:2vh;
      background:radial-gradient(ellipse at 58% 54%, rgba(103,73,169,.66), rgba(68,63,141,.28) 48%, transparent 73%);
      animation:starWorldCloudA 9.6s ease-in-out infinite alternate;
    }
    .star-world-cloud.cloud-b {
      width:69vw; height:62vw; right:-17vw; top:21vh;
      background:radial-gradient(ellipse at 38% 42%, rgba(58,111,174,.58), rgba(57,62,143,.22) 52%, transparent 76%);
      animation:starWorldCloudB 12.4s ease-in-out infinite alternate;
    }
    .star-world-cloud.cloud-c {
      width:76vw; height:45vw; left:13vw; bottom:-18vw;
      background:radial-gradient(ellipse at 48% 38%, rgba(119,61,144,.42), rgba(49,69,135,.26) 50%, transparent 75%);
      animation:starWorldCloudC 10.8s ease-in-out infinite alternate;
    }
    .star-world-cloud.cloud-d {
      width:44vw; height:34vw; left:8vw; top:42vh;
      background:radial-gradient(ellipse at 48% 46%, rgba(81,102,196,.38), rgba(77,88,171,.16) 54%, transparent 76%);
      animation:starWorldCloudB 14.8s ease-in-out infinite alternate;
      opacity:.42;
    }
    .star-world-cloud.cloud-e {
      width:36vw; height:30vw; right:10vw; top:10vh;
      background:radial-gradient(ellipse at 52% 44%, rgba(153,92,204,.34), rgba(74,71,151,.14) 52%, transparent 77%);
      animation:starWorldCloudA 13.2s ease-in-out infinite alternate;
      opacity:.38;
    }
    .star-world-travel.revealing .star-world-cloud { animation:none; }
    .star-world-travel.revealing .cloud-a { transform:translate3d(-34vw,-9vh,0) scale(.9); opacity:0; }
    .star-world-travel.revealing .cloud-b { transform:translate3d(34vw,7vh,0) scale(.92); opacity:0; }
    .star-world-travel.revealing .cloud-c { transform:translate3d(0,29vh,0) scale(.95); opacity:0; }
    .star-world-travel.revealing .cloud-d { transform:translate3d(-22vw,8vh,0) scale(.88); opacity:0; }
    .star-world-travel.revealing .cloud-e { transform:translate3d(18vw,-7vh,0) scale(.90); opacity:0; }

    .star-world-stars {
      position:absolute;
      inset:0;
      opacity:.78;
      background-image:
        radial-gradient(circle at 8% 16%, rgba(255,255,255,.92) 0 1px, transparent 1.8px),
        radial-gradient(circle at 18% 67%, rgba(219,228,255,.76) 0 1px, transparent 1.7px),
        radial-gradient(circle at 27% 31%, rgba(255,255,255,.88) 0 1.2px, transparent 1.9px),
        radial-gradient(circle at 37% 81%, rgba(196,215,255,.70) 0 .9px, transparent 1.7px),
        radial-gradient(circle at 46% 19%, rgba(255,255,255,.82) 0 1px, transparent 1.8px),
        radial-gradient(circle at 56% 58%, rgba(226,235,255,.72) 0 1.1px, transparent 1.8px),
        radial-gradient(circle at 65% 35%, rgba(255,255,255,.90) 0 1px, transparent 1.8px),
        radial-gradient(circle at 73% 76%, rgba(204,221,255,.74) 0 1.2px, transparent 1.9px),
        radial-gradient(circle at 84% 13%, rgba(255,255,255,.88) 0 1px, transparent 1.8px),
        radial-gradient(circle at 92% 54%, rgba(219,228,255,.74) 0 1px, transparent 1.8px),
        radial-gradient(circle at 12% 89%, rgba(255,255,255,.78) 0 1px, transparent 1.8px),
        radial-gradient(circle at 95% 89%, rgba(255,255,255,.82) 0 1.2px, transparent 1.9px);
      animation:starWorldStarsFloat 8s ease-in-out infinite alternate;
      transition:opacity .7s ease, transform 1.1s ease;
    }
    .star-world-stars.near {
      inset:-5%;
      opacity:.52;
      transform:scale(1.12);
      background-image:
        radial-gradient(circle at 15% 25%, rgba(255,255,255,.92) 0 1.7px, transparent 2.5px),
        radial-gradient(circle at 31% 57%, rgba(239,243,255,.88) 0 1.4px, transparent 2.2px),
        radial-gradient(circle at 43% 12%, rgba(255,255,255,.90) 0 1.5px, transparent 2.3px),
        radial-gradient(circle at 58% 78%, rgba(231,238,255,.84) 0 1.7px, transparent 2.5px),
        radial-gradient(circle at 72% 43%, rgba(255,255,255,.94) 0 1.5px, transparent 2.3px),
        radial-gradient(circle at 88% 69%, rgba(226,236,255,.82) 0 1.6px, transparent 2.4px);
      animation-duration:6.4s;
    }
    .star-world-travel.revealing .star-world-stars { animation:none; opacity:0; transform:scale(1.2); }

    .star-world-streak { display:none; /* retired streak formation */
      position:absolute;
      left:var(--sx,50%);
      top:var(--sy,50%);
      width:2px;
      height:18vh;
      border-radius:999px;
      opacity:0;
      transform:rotate(var(--sr,0deg)) scaleY(.2);
      transform-origin:50% 0;
      background:linear-gradient(to bottom, rgba(255,255,255,.04), rgba(231,237,255,.9), transparent);
      filter:drop-shadow(0 0 4px rgba(193,210,255,.58));
    }
    .star-world-travel.entering .star-world-streak {
      animation:starWorldStreak 1.05s ease-out var(--sd,0s) both;
    }

    .star-world-accent-flare,
    .star-world-accent-shot {
      position:absolute;
      z-index:4;
      opacity:0;
      pointer-events:none;
    }
    .star-world-accent-flare {
      width:210px;
      height:150px;
      left:50%;
      top:50%;
      border-radius:50%;
      transform:translate(-50%,-50%) scale(.7);
      background:radial-gradient(ellipse at center,
        color-mix(in srgb, var(--star-world-profile-color) 52%, white) 0%,
        color-mix(in srgb, var(--star-world-profile-color) 32%, transparent) 32%,
        transparent 72%);
      filter:blur(13px);
      mix-blend-mode:screen;
    }
    .star-world-accent-flare.flash { animation:starWorldAccentFlash 1.25s ease-out both; }
    .star-world-accent-shot {
      width:155px;
      height:2px;
      left:50%;
      top:50%;
      border-radius:999px;
      transform:translate(-50%,-50%) rotate(-28deg);
      background:linear-gradient(90deg, transparent 0%, color-mix(in srgb, var(--star-world-profile-color) 78%, white) 57%, rgba(255,255,255,.95) 100%);
      box-shadow:0 0 9px color-mix(in srgb, var(--star-world-profile-color) 55%, transparent);
    }
    .star-world-accent-shot.shoot { animation:starWorldAccentShot .92s ease-out both; }

    .star-world-arrival-pulse {
      position:absolute;
      z-index:5;
      left:50%; top:50%;
      width:min(78vw,680px); aspect-ratio:1;
      border-radius:50%;
      transform:translate(-50%,-50%) scale(.35);
      opacity:0;
      background:radial-gradient(circle,
        color-mix(in srgb, var(--star-world-profile-color) 28%, white) 0%,
        color-mix(in srgb, var(--star-world-profile-color) 20%, transparent) 32%,
        transparent 68%);
      filter:blur(10px);
      mix-blend-mode:screen;
      pointer-events:none;
    }
    .star-world-travel.arriving .star-world-arrival-pulse {
      animation:starWorldArrivalPulse .9s cubic-bezier(.2,.75,.2,1) both;
    }

    .star-world-travel-copy {
      position:absolute;
      z-index:8;
      left:50%;
      bottom:max(52px, calc(env(safe-area-inset-bottom) + 34px));
      transform:translateX(-50%);
      width:min(calc(100% - 40px), 480px);
      padding:13px 18px;
      border:1px solid rgba(255,255,255,.14);
      border-radius:999px;
      background:rgba(6,13,34,.34);
      box-shadow:0 12px 35px rgba(0,0,0,.20), inset 0 1px 0 rgba(255,255,255,.05);
      backdrop-filter:blur(13px) saturate(1.08);
      -webkit-backdrop-filter:blur(13px) saturate(1.08);
      color:#f5f7ff;
      text-align:center;
      font-size:clamp(.88rem,2.2vw,1.02rem);
      line-height:1.2;
      font-weight:720;
      letter-spacing:.01em;
      text-shadow:0 2px 11px rgba(0,0,0,.42);
      transition:opacity .45s ease, transform .55s ease;
    }
    .star-world-travel.revealing .star-world-travel-copy {
      opacity:0;
      transform:translate(-50%,14px);
    }
    .star-world-travel-message {
      display:block;
      animation:starWorldMessageIn .42s ease both;
    }
    .star-world-travel-controls {
      position:absolute;
      left:50%;
      bottom:max(42px, calc(env(safe-area-inset-bottom) + 20px));
      transform:translate(-50%, 24px);
      z-index:9;
      width:min(calc(100% - 40px), 640px);
      opacity:0;
      pointer-events:none;
      transition:opacity .42s ease, transform .42s ease;
    }
    .star-world-travel.decision-ready .star-world-travel-controls {
      opacity:1;
      transform:translate(-50%, 0);
      pointer-events:auto;
    }
    .star-world-travel.decision-ready .star-world-travel-copy {
      opacity:0;
      transform:translate(-50%,14px);
    }
    .star-world-travel-controls-card {
      display:flex;
      flex-wrap:wrap;
      gap:12px;
      justify-content:center;
      align-items:center;
      padding:16px 18px;
      border-radius:22px;
      background:rgba(7,12,28,.56);
      border:1px solid rgba(230,235,255,.16);
      box-shadow:0 18px 46px rgba(0,0,0,.34);
      backdrop-filter:blur(16px);
      -webkit-backdrop-filter:blur(16px);
    }
    .star-world-travel-controls-card .primary,
    .star-world-travel-controls-card .secondary { min-width:148px; }
    .star-world-travel-controls-card button:disabled {
      opacity: .62;
      cursor: default;
      transform: none;
      filter: saturate(.72);
    }
    @media (max-width: 620px) {
      .star-world-travel-controls-card { display:grid; grid-template-columns:1fr; }
      .star-world-travel-controls-card .primary,
      .star-world-travel-controls-card .secondary { width:100%; }
      .star-world-travel.decision-ready .star-world-arrival-image {
        --star-world-decision-reserve: 228px;
      }
    }

    @keyframes starWorldLaunch {
      0% { transform:scale(.9); filter:blur(0); }
      52% { transform:scale(1.08); filter:blur(.6px) brightness(1.08); }
      100% { transform:scale(1.02); filter:blur(0) brightness(1); }
    }
    @keyframes starWorldDrift {
      0% { transform:scale(1.02) translate3d(-.8%,.5%,0) rotate(-.35deg); }
      100% { transform:scale(1.06) translate3d(.9%,-.7%,0) rotate(.4deg); }
    }
    @keyframes starWorldCloudA {
      0% { transform:translate3d(-2vw,-1vh,0) rotate(-3deg) scale(.98); opacity:.46; }
      100% { transform:translate3d(6vw,4vh,0) rotate(5deg) scale(1.08); opacity:.62; }
    }
    @keyframes starWorldCloudB {
      0% { transform:translate3d(4vw,-3vh,0) rotate(4deg) scale(1.04); opacity:.43; }
      100% { transform:translate3d(-6vw,5vh,0) rotate(-5deg) scale(.96); opacity:.59; }
    }
    @keyframes starWorldCloudC {
      0% { transform:translate3d(-3vw,4vh,0) rotate(-2deg) scale(1); opacity:.37; }
      100% { transform:translate3d(5vw,-3vh,0) rotate(4deg) scale(1.09); opacity:.52; }
    }
    @keyframes starWorldStarsFloat {
      0% { transform:translate3d(-.5%,.3%,0) scale(1); opacity:.62; }
      100% { transform:translate3d(.7%,-.5%,0) scale(1.025); opacity:.9; }
    }
    @keyframes starWorldStreak {
      0% { opacity:0; transform:rotate(var(--sr,0deg)) scaleY(.15) translateY(0); }
      24% { opacity:.82; }
      100% { opacity:0; transform:rotate(var(--sr,0deg)) scaleY(1.85) translateY(24vh); }
    }
    @keyframes starWorldAccentFlash {
      0%,100% { opacity:0; transform:translate(-50%,-50%) scale(.7); }
      28% { opacity:.14; }
      50% { opacity:.34; transform:translate(-50%,-50%) scale(1.03); }
      72% { opacity:.13; }
    }
    @keyframes starWorldAccentShot {
      0% { opacity:0; transform:translate(-95%,-95%) rotate(-28deg) scaleX(.3); }
      22% { opacity:.88; }
      100% { opacity:0; transform:translate(130%,110%) rotate(-28deg) scaleX(1.2); }
    }
    @keyframes starWorldArrivalPulse {
      0% { opacity:0; transform:translate(-50%,-50%) scale(.35); }
      42% { opacity:.82; }
      100% { opacity:0; transform:translate(-50%,-50%) scale(1.22); }
    }
    @keyframes starWorldMessageIn {
      from { opacity:0; transform:translateY(5px); }
      to { opacity:1; transform:translateY(0); }
    }

    @media (max-width:620px) {
      .star-world-cloud { filter:blur(25px); }
      .star-world-cloud.cloud-a { width:105vw; height:82vw; left:-40vw; }
      .star-world-cloud.cloud-b { width:104vw; height:92vw; right:-38vw; top:18vh; }
      .star-world-cloud.cloud-c { width:112vw; height:66vw; left:-3vw; bottom:-22vw; }
      .star-world-travel-copy { bottom:max(38px, calc(env(safe-area-inset-bottom) + 24px)); }
    }
    @media (prefers-reduced-motion: reduce) {
      .star-world-cosmos,
      .star-world-cloud,
      .star-world-stars,
      .star-world-streak,
      .star-world-accent-flare,
      .star-world-accent-shot,
      .star-world-arrival-pulse,
      .star-world-travel-message { animation:none !important; }
      .star-world-travel.entering .star-world-cosmos { transform:scale(1.02); }
      .star-world-travel.revealing .star-world-cosmos { opacity:0; transform:scale(1.04); }
    }


    /* v1.34.0 Star World studio + deeper cosmic travel */
    .star-world-profile-list { display:grid; gap:10px; }
    .star-world-profile-row { --management-profile-color:#7a55a3; }
    .star-world-profile-row .management-row-emoji {
      border:2px solid #dfe3ec;
      border-color:color-mix(in srgb, var(--management-profile-color) 34%, #dfe3ec);
      background:#0d1834;
    }
    .star-world-profile-status {
      display:inline-flex; align-items:center; gap:5px; margin-top:2px;
      color:#747b8b; font-size:.76rem; font-weight:620;
    }
    .star-world-profile-status.ready { color:#596174; }
    .star-world-profile-status .status-spark { color:var(--management-profile-color); }
    .star-world-detail { display:grid; gap:15px; }
    .star-world-detail-heading {
      display:flex; align-items:center; gap:12px; padding:2px 1px 1px;
    }
    .star-world-detail-avatar {
      width:56px; height:56px; flex:0 0 56px; border-radius:50%; overflow:hidden;
      display:grid; place-items:center; background:#0d1834;
      border:2px solid #dfe3ec;
      border-color:color-mix(in srgb, var(--star-world-profile-color, #7a55a3) 38%, #dfe3ec);
      font-size:2rem;
    }
    .star-world-detail-copy { min-width:0; }
    .star-world-detail-name { color:#202738; font-size:1.18rem; line-height:1.08; font-weight:820; letter-spacing:-.018em; }
    .star-world-detail-sub { margin-top:4px; color:#777e8e; font-size:.79rem; line-height:1.35; }
    .star-world-overview-actions { display:flex; flex-wrap:wrap; gap:9px; }
    .star-world-overview-actions .primary, .star-world-overview-actions .secondary { width:auto; min-width:0; }
    .star-world-empty {
      display:grid; place-items:center; text-align:center; min-height:150px; padding:24px 18px;
      border:1px dashed #d7dbe5; border-radius:18px;
      background:linear-gradient(145deg, rgba(13,25,54,.035), rgba(122,85,163,.045));
      color:#72798a; font-size:.84rem; line-height:1.4;
    }
    .star-world-preview-copy {
      color:#747b8b; font-size:.78rem; line-height:1.4; margin-top:-4px;
    }
    .star-world-questions-after-preview {
      display:grid; gap:14px; padding-top:3px;
      border-top:1px solid #e3e5eb;
    }
    .star-world-questions-after-preview .hero-world-generator-copy { margin-bottom:1px; }
    @media (max-width:560px) {
      .star-world-overview-actions { display:grid; grid-template-columns:1fr; }
      .star-world-overview-actions .primary, .star-world-overview-actions .secondary { width:100%; }
    }

    /* The center is a destination, while soft foreground nebula layers rush outward
       toward the viewer. This creates motion without turning the scene into a black hole. */
    .star-world-destination { display:none; /* retired destination bubble */
      position:absolute; z-index:1; left:50%; top:46%; width:min(36vw,300px); aspect-ratio:1;
      transform:translate(-50%,-50%); border-radius:50%; pointer-events:none;
      background:radial-gradient(circle,
        rgba(230,235,255,.15) 0%, rgba(133,137,207,.08) 22%, rgba(82,86,161,.035) 42%, transparent 70%);
      filter:blur(1px); animation:starWorldDestinationBreathe 3.8s ease-in-out infinite alternate;
    }
    .star-world-destination::after {
      content:''; position:absolute; inset:23%; border-radius:50%;
      border:1px solid rgba(216,224,255,.08); box-shadow:0 0 35px rgba(137,143,219,.08);
    }
    .star-world-wisp {
      position:absolute; z-index:3; left:50%; top:46%; width:44vw; height:27vw;
      min-width:280px; min-height:170px; border-radius:50%; opacity:0;
      background:radial-gradient(ellipse at center,
        rgba(115,91,178,.42) 0%, rgba(69,82,157,.28) 38%, rgba(43,62,131,.10) 58%, transparent 75%);
      filter:blur(27px); mix-blend-mode:screen; pointer-events:none;
      will-change:transform,opacity;
      animation:starWorldWispRush var(--wd,5.4s) cubic-bezier(.3,.08,.58,1) var(--wdelay,0s) infinite;
    }
    .star-world-wisp.cool {
      background:radial-gradient(ellipse at center,
        rgba(65,119,178,.38) 0%, rgba(63,78,157,.24) 40%, rgba(42,57,126,.09) 60%, transparent 76%);
    }
    .star-world-wisp.violet {
      background:radial-gradient(ellipse at center,
        rgba(129,71,164,.38) 0%, rgba(86,64,151,.24) 42%, rgba(51,55,121,.09) 61%, transparent 76%);
    }
    .star-world-travel.revealing .star-world-wisp { animation:none; opacity:0; transition:opacity .62s ease; }

    /* Existing broad clouds remain atmospheric edge mass while the foreground wisps
       provide the stronger sense of moving through the scene. */
    .star-world-cloud.cloud-a { animation-duration:7.8s; }
    .star-world-cloud.cloud-b { animation-duration:9.4s; }
    .star-world-cloud.cloud-c { animation-duration:8.6s; }
    .star-world-travel.looping .star-world-cosmos { animation:starWorldTravelDrift 8.5s ease-in-out infinite alternate; }
    .star-world-stars { animation:starWorldStarsRush 5.8s ease-in-out infinite; transform-origin:50% 46%; }
    .star-world-stars.near { animation:starWorldStarsRushNear 4.4s ease-in-out -2.2s infinite; transform-origin:50% 46%; }

    /* Shooting stars now favor a downward path. */
    .star-world-streak { height:20vh; }
    .star-world-accent-shot {
      width:2px; height:115px; left:50%; top:-18vh;
      transform:translateX(-50%) rotate(var(--shot-angle, 5deg));
      background:linear-gradient(to bottom,
        rgba(255,255,255,.96) 0%,
        color-mix(in srgb, var(--star-world-profile-color) 72%, white) 22%,
        color-mix(in srgb, var(--star-world-profile-color) 42%, transparent) 68%,
        transparent 100%);
      box-shadow:0 0 9px color-mix(in srgb, var(--star-world-profile-color) 48%, transparent);
    }
    .star-world-accent-shot.shoot { animation:starWorldAccentShotDown 1.08s cubic-bezier(.24,.68,.3,1) both; }

    @keyframes starWorldDestinationBreathe {
      from { opacity:.55; transform:translate(-50%,-50%) scale(.92); }
      to { opacity:.92; transform:translate(-50%,-50%) scale(1.08); }
    }
    @keyframes starWorldWispRush {
      0% { opacity:0; transform:translate(-50%,-50%) translate3d(0,0,0) scale(.18) rotate(var(--wr,0deg)); }
      15% { opacity:.12; }
      48% { opacity:.48; }
      78% { opacity:.36; }
      100% { opacity:0; transform:translate(-50%,-50%) translate3d(var(--wx,0),var(--wy,0),0) scale(2.65) rotate(var(--wr,0deg)); }
    }
    @keyframes starWorldTravelDrift {
      from { transform:scale(1.02) translate3d(-.35%,.2%,0); }
      to { transform:scale(1.045) translate3d(.35%,-.25%,0); }
    }
    @keyframes starWorldStarsRush {
      0% { transform:scale(.94); opacity:.20; }
      18% { opacity:.72; }
      82% { opacity:.72; }
      100% { transform:scale(1.22); opacity:.08; }
    }
    @keyframes starWorldStarsRushNear {
      0% { transform:scale(.9); opacity:.10; }
      20% { opacity:.48; }
      78% { opacity:.52; }
      100% { transform:scale(1.34); opacity:.04; }
    }
    @keyframes starWorldAccentShotDown {
      0% { opacity:0; transform:translate3d(-50%,0,0) rotate(var(--shot-angle,5deg)) scaleY(.35); }
      16% { opacity:.92; }
      100% { opacity:0; transform:translate3d(calc(-50% + var(--shot-drift, 0px)),125vh,0) rotate(var(--shot-angle,5deg)) scaleY(1.1); }
    }

    @media (max-width:620px) {
      .star-world-wisp { width:72vw; height:46vw; min-width:0; min-height:0; filter:blur(22px); }
      .star-world-destination { width:48vw; }
    }
    @media (prefers-reduced-motion: reduce) {
      .star-world-wisp, .star-world-destination { animation:none !important; opacity:.18; }
    }



    /* Session experience */
    .session-experience {
      --session-color: #8d78d8;
      position: fixed;
      inset: 0;
      z-index: 45;
      display: none;
      min-height: 100vh;
      min-height: 100dvh;
      overflow: hidden;
      color: #f7f5ff;
      background:
        radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--session-color) 22%, transparent) 0, transparent 32%),
        radial-gradient(circle at 18% 15%, rgba(118,102,189,.18), transparent 30%),
        radial-gradient(circle at 82% 82%, rgba(45,71,126,.20), transparent 34%),
        linear-gradient(180deg, #11172b 0%, #0b1020 56%, #080c18 100%);
      isolation: isolate;
    }
    .session-experience.show { display: flex; }
    .session-experience::before,
    .session-experience::after {
      content: '';
      position: absolute;
      inset: -12%;
      pointer-events: none;
      z-index: -1;
    }
    .session-experience::before {
      opacity: .74;
      background-image:
        radial-gradient(circle at 12% 22%, rgba(255,255,255,.72) 0 1px, transparent 1.6px),
        radial-gradient(circle at 73% 18%, rgba(255,255,255,.54) 0 1px, transparent 1.7px),
        radial-gradient(circle at 35% 74%, rgba(255,255,255,.44) 0 1px, transparent 1.6px),
        radial-gradient(circle at 84% 67%, rgba(255,255,255,.62) 0 1.2px, transparent 1.8px),
        radial-gradient(circle at 54% 42%, rgba(255,255,255,.30) 0 1px, transparent 1.7px);
      background-size: 190px 180px, 230px 215px, 250px 235px, 210px 205px, 175px 165px;
    }
    .session-experience::after {
      background: radial-gradient(ellipse at center, transparent 44%, rgba(3,7,16,.46) 78%, rgba(3,6,14,.88) 100%);
    }
    .session-close {
      position: absolute;
      top: max(16px, env(safe-area-inset-top));
      right: max(16px, env(safe-area-inset-right));
      z-index: 3;
      width: 44px;
      height: 44px;
      border: 1px solid rgba(255,255,255,.16);
      border-radius: 50%;
      background: rgba(12,18,35,.58);
      backdrop-filter: blur(15px);
      -webkit-backdrop-filter: blur(15px);
      color: #fff;
      font-size: 1.75rem;
      line-height: 1;
      cursor: pointer;
    }
    .session-stage {
      width: min(720px, 100%);
      min-height: 100%;
      margin: 0 auto;
      padding: max(68px, calc(env(safe-area-inset-top) + 58px)) max(24px, env(safe-area-inset-right)) max(24px, calc(env(safe-area-inset-bottom) + 18px)) max(24px, env(safe-area-inset-left));
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      text-align: center;
    }
    .session-task-visual {
      width: 84px;
      height: 84px;
      display: grid;
      place-items: center;
      margin-bottom: 10px;
      font-size: 3.4rem;
      filter: drop-shadow(0 10px 24px rgba(0,0,0,.28));
    }
    .session-task-visual img { width:100%; height:100%; object-fit:contain; }
    .session-task-name {
      margin: 0;
      max-width: 90%;
      font-size: clamp(1.65rem, 5vw, 2.4rem);
      line-height: 1.08;
      letter-spacing: -.02em;
      text-shadow: 0 3px 18px rgba(0,0,0,.32);
    }
    .session-task-description {
      min-height: 1.25em;
      margin-top: 8px;
      max-width: 520px;
      color: rgba(239,240,255,.70);
      font-size: .98rem;
    }
    .session-timer-wrap {
      position: relative;
      width: min(54vw, 280px);
      aspect-ratio: 1;
      margin: clamp(22px, 5vh, 40px) auto 18px;
      display: grid;
      place-items: center;
    }
    .session-timer-ring {
      position: absolute;
      inset: 0;
      border-radius: 50%;
      background: conic-gradient(var(--session-color) var(--session-progress, 0%), rgba(255,255,255,.09) 0);
      box-shadow: 0 0 38px color-mix(in srgb, var(--session-color) 27%, transparent), inset 0 0 24px rgba(255,255,255,.05);
    }
    .session-timer-ring::after {
      content: '';
      position: absolute;
      inset: 9px;
      border-radius: 50%;
      background: radial-gradient(circle at 45% 35%, rgba(38,46,79,.94), rgba(12,18,34,.98) 65%);
      border: 1px solid rgba(255,255,255,.09);
    }
    .session-time {
      position: relative;
      z-index: 1;
      font-variant-numeric: tabular-nums;
      font-size: clamp(3rem, 12vw, 5rem);
      line-height: 1;
      font-weight: 800;
      letter-spacing: -.055em;
      text-shadow: 0 4px 26px rgba(0,0,0,.36);
    }
    .session-status-message {
      min-height: 1.4em;
      margin: 0;
      font-size: clamp(1.1rem, 3.8vw, 1.4rem);
      font-weight: 750;
      color: rgba(246,245,255,.82);
    }
    .session-checkin-button {
      display: none;
      min-width: min(320px, 86vw);
      margin-top: 18px;
      box-shadow: 0 12px 34px color-mix(in srgb, var(--session-color) 25%, transparent);
    }
    .session-experience.time-up .session-checkin-button { display: inline-flex; justify-content:center; }
    .session-experience.time-up .session-status-message { color:#fff; font-size:clamp(1.35rem,4.6vw,1.8rem); }
    .session-experience.time-up .session-timer-ring { animation: sessionRingPulse 2.4s ease-in-out infinite; }
    @keyframes sessionRingPulse {
      0%,100% { box-shadow:0 0 30px color-mix(in srgb, var(--session-color) 24%, transparent), inset 0 0 24px rgba(255,255,255,.05); }
      50% { box-shadow:0 0 64px color-mix(in srgb, var(--session-color) 46%, transparent), inset 0 0 30px rgba(255,255,255,.08); }
    }
    .session-cancel-area {
      width: min(420px, 92vw);
      margin-top: clamp(26px, 6vh, 48px);
    }
    .session-cancel-link {
      border: 0;
      background: transparent;
      color: rgba(220,224,241,.46);
      font: inherit;
      font-size: .88rem;
      padding: 10px 14px;
      cursor: pointer;
      text-decoration: underline;
      text-decoration-color: rgba(220,224,241,.20);
      text-underline-offset: 3px;
    }
    .session-cancel-confirm {
      display: none;
      gap: 9px;
      padding: 12px;
      border: 1px solid rgba(255,255,255,.10);
      border-radius: 18px;
      background: rgba(7,11,24,.52);
      backdrop-filter: blur(13px);
      -webkit-backdrop-filter: blur(13px);
    }
    .session-cancel-confirm.show { display:grid; }
    .session-cancel-confirm .secondary,
    .session-cancel-confirm .danger-button { width:100%; }
    .session-running-pill {
      display:inline-flex;
      align-items:center;
      gap:5px;
      border:1px solid color-mix(in srgb, var(--task-accent, #8d78d8) 52%, white 10%);
      background:color-mix(in srgb, var(--task-accent, #8d78d8) 15%, transparent);
      color:#f5f2ff;
      border-radius:999px;
      padding:4px 9px;
      font-weight:750;
      font-size:.76rem;
      white-space:nowrap;
    }
    @media (max-height: 690px) and (orientation: landscape) {
      .session-stage { padding-top:54px; padding-bottom:14px; }
      .session-task-visual { width:58px; height:58px; font-size:2.5rem; margin-bottom:4px; }
      .session-task-name { font-size:1.55rem; }
      .session-task-description { margin-top:4px; }
      .session-timer-wrap { width:min(34vh,220px); margin:12px auto 8px; }
      .session-time { font-size:3rem; }
      .session-cancel-area { margin-top:12px; }
    }

  

    /* v1.42.0 Today HUD + inclusive recognition */
    #dashboard .dashboard-topbar-actions-only { justify-content: flex-end; }

    #dashboard .profile-carousel {
      width: min(100%, 460px);
      margin-top: 6px;
      grid-template-columns: 36px minmax(0,1fr) 36px;
    }
    #dashboard .carousel-arrow { width:34px; height:44px; font-size:1.72rem; }
    #dashboard .profiles {
      min-height: 92px;
      padding: 2px 4px 2px;
      gap: clamp(4px, 1.5vw, 14px);
      align-items: center;
    }
    #dashboard .profile-card {
      width: min(100%, 96px);
      min-height: 76px;
      grid-template-rows: auto;
      align-content: center;
      padding: 3px 2px;
      gap: 0;
      transform-origin: center center;
    }
    #dashboard .profile-card.selected { transform:scale(1.06); }
    #dashboard .profile-card:active { transform:scale(.78); }
    #dashboard .profile-card.selected:active { transform:scale(1); }
    #dashboard .profile-avatar { width:53px; height:53px; margin:0; font-size:2.16rem; }
    #dashboard .profile-card.selected .profile-avatar { width:65px; height:65px; }
    #dashboard .profile-name,
    #dashboard .profile-stars { display:none !important; }

    #dashboard .profile-hero-hud {
      position:absolute;
      z-index:3;
      top:clamp(150px, 18vw, 188px);
      right:clamp(20px, 4.2vw, 54px);
      width:min(38%, 420px);
      min-width:280px;
      padding:clamp(15px, 2vw, 21px);
      border:1px solid rgba(211,222,248,.13);
      border-radius:22px;
      color:#f6f8ff;
      background:
        linear-gradient(145deg, rgba(6,17,42,.48), rgba(5,15,38,.22) 58%, rgba(7,18,43,.14)),
        radial-gradient(circle at 16% 14%, color-mix(in srgb, var(--hero-profile-color, #9d67ef) 12%, transparent), transparent 46%);
      box-shadow:inset 0 1px 0 rgba(255,255,255,.045), 0 16px 36px rgba(0,0,0,.12);
      backdrop-filter:blur(7px) saturate(110%);
      -webkit-backdrop-filter:blur(7px) saturate(110%);
      text-align:left;
      pointer-events:auto;
    }
    #dashboard .hero-hud-date {
      color:rgba(228,235,251,.76);
      font-size:clamp(.68rem, 1.25vw, .79rem);
      line-height:1;
      font-weight:790;
      letter-spacing:.085em;
      text-transform:uppercase;
      text-shadow:0 2px 9px rgba(0,0,0,.54);
    }
    #dashboard .profile-hero-hud .profile-hero-identity {
      position:static;
      display:grid;
      gap:3px;
      justify-items:start;
      margin-top:8px;
      max-width:100%;
      pointer-events:none;
      isolation:auto;
    }
    #dashboard .profile-hero-hud .profile-hero-identity::before { display:none; }
    #dashboard .profile-hero-hud .profile-hero-name {
      max-width:100%;
      font-size:clamp(1.58rem, 3.5vw, 2.22rem);
      line-height:.98;
      font-weight:850;
      letter-spacing:-.04em;
      text-shadow:0 3px 12px rgba(0,0,0,.50), 0 0 14px color-mix(in srgb, var(--hero-profile-color, #fff) 23%, transparent);
    }
    #dashboard .profile-hero-hud .profile-hero-title {
      min-height:0;
      margin:1px 0 0;
      color:rgba(242,246,255,.87);
      font-size:clamp(.72rem, 1.25vw, .84rem);
      line-height:1.15;
      font-weight:700;
      text-shadow:0 2px 8px rgba(0,0,0,.55);
    }
    #dashboard .hero-hud-today {
      display:grid;
      gap:6px;
      margin-top:17px;
    }
    #dashboard .hero-hud-section-label {
      color:rgba(190,202,229,.70);
      font-size:.61rem;
      line-height:1;
      font-weight:850;
      letter-spacing:.15em;
      text-transform:uppercase;
    }
    #dashboard .hero-hud-today-text {
      color:#f7f9ff;
      font-size:clamp(.82rem, 1.55vw, .96rem);
      line-height:1.15;
      font-weight:760;
      text-shadow:0 2px 8px rgba(0,0,0,.42);
    }
    #dashboard .hero-hud-progress {
      position:relative;
      width:100%;
      height:5px;
      overflow:hidden;
      border-radius:999px;
      background:rgba(214,225,248,.13);
      box-shadow:inset 0 1px 2px rgba(0,0,0,.20);
    }
    #dashboard .hero-hud-progress > span {
      display:block;
      width:0;
      height:100%;
      border-radius:inherit;
      background:linear-gradient(90deg, color-mix(in srgb, var(--hero-profile-color, #9d67ef) 76%, #fff 8%), var(--hero-profile-color, #9d67ef));
      box-shadow:0 0 10px color-mix(in srgb, var(--hero-profile-color, #9d67ef) 45%, transparent);
      transition:width .28s ease;
    }
    #dashboard .hero-hud-stats {
      display:flex;
      align-items:center;
      flex-wrap:wrap;
      gap:7px;
      margin-top:13px;
    }
    #dashboard .hero-hud-stat {
      min-width:0;
      min-height:30px;
      display:inline-flex;
      align-items:center;
      gap:5px;
      padding:6px 8px;
      border:1px solid rgba(206,218,246,.10);
      border-radius:10px;
      color:rgba(245,248,255,.94);
      background:rgba(255,255,255,.035);
      font:inherit;
      font-size:clamp(.66rem, 1.15vw, .75rem);
      line-height:1;
      font-weight:760;
      white-space:nowrap;
      text-shadow:0 2px 7px rgba(0,0,0,.40);
      box-shadow:inset 0 1px 0 rgba(255,255,255,.025);
    }
    #dashboard .hero-hud-stat[hidden] { display:none !important; }
    #dashboard button.hero-hud-stat {
      cursor:pointer;
      appearance:none;
      -webkit-appearance:none;
    }
    #dashboard button.hero-hud-stat:not(:disabled):active { transform:scale(.97); }
    #dashboard .hero-hud-dynamic {
      min-height:58px;
      margin-top:14px;
      display:flex;
      align-items:flex-start;
    }
    #dashboard .hero-hud-recognition,
    #dashboard .hero-hud-message {
      width:100%;
      min-width:0;
      display:grid;
      gap:4px;
      padding:10px 11px;
      border:1px solid rgba(255,232,145,.14);
      border-radius:13px;
      color:#f7f9ff;
      text-align:left;
      background:linear-gradient(135deg, rgba(255,229,132,.065), color-mix(in srgb, var(--hero-profile-color, #9d67ef) 7%, rgba(255,255,255,.018)));
      box-shadow:inset 0 1px 0 rgba(255,255,255,.03);
    }
    #dashboard .hero-hud-recognition {
      font:inherit;
      cursor:pointer;
      appearance:none;
      -webkit-appearance:none;
    }
    #dashboard .hero-hud-recognition:active { transform:scale(.985); }
    #dashboard .hero-hud-recognition strong,
    #dashboard .hero-hud-message strong {
      color:#fff3bd;
      font-size:.82rem;
      line-height:1.05;
      font-weight:880;
      letter-spacing:-.01em;
      text-shadow:0 0 10px rgba(255,231,142,.20), 0 2px 8px rgba(0,0,0,.48);
    }
    #dashboard .hero-hud-message strong { color:#f5f8ff; }
    #dashboard .hero-hud-recognition span,
    #dashboard .hero-hud-message span {
      color:rgba(225,232,248,.78);
      font-size:.69rem;
      line-height:1.3;
      font-weight:650;
    }
    #dashboard .hero-hud-complete strong { color:#f8f6d7; }

    #dashboard .hero-recognition-sparkles {
      position:absolute;
      inset:3%;
      border-radius:50%;
      pointer-events:none;
      opacity:1;
      background:none;
      filter:drop-shadow(0 0 5px rgba(255,241,177,.28));
      animation:none;
    }
    #dashboard .hero-recognition-twinkle {
      position:absolute;
      display:block;
      color:rgba(255,249,214,.88);
      font-size:12px;
      line-height:1;
      opacity:0;
      text-shadow:0 0 7px rgba(255,239,161,.48), 0 0 12px color-mix(in srgb, var(--hero-profile-color, #9d67ef) 30%, transparent);
      animation:heroRecognitionTwinkle 4.6s ease-in-out infinite;
      transform-origin:center;
    }
    #dashboard .hero-recognition-twinkle.twinkle-1 { left:21%; top:22%; font-size:10px; animation-delay:-.4s; animation-duration:4.9s; }
    #dashboard .hero-recognition-twinkle.twinkle-2 { left:64%; top:16%; font-size:13px; animation-delay:-2.2s; animation-duration:5.6s; }
    #dashboard .hero-recognition-twinkle.twinkle-3 { left:78%; top:42%; font-size:9px; animation-delay:-1.1s; animation-duration:4.4s; }
    #dashboard .hero-recognition-twinkle.twinkle-4 { left:70%; top:71%; font-size:12px; animation-delay:-3.3s; animation-duration:5.2s; }
    #dashboard .hero-recognition-twinkle.twinkle-5 { left:34%; top:78%; font-size:10px; animation-delay:-1.8s; animation-duration:5.8s; }
    #dashboard .hero-recognition-twinkle.twinkle-6 { left:13%; top:57%; font-size:8px; animation-delay:-3.9s; animation-duration:4.8s; }
    #dashboard .hero-recognition-twinkle.twinkle-7 { left:48%; top:35%; font-size:8px; animation-delay:-2.8s; animation-duration:6.1s; }
    @keyframes heroRecognitionTwinkle {
      0%, 18%, 100% { opacity:0; transform:scale(.42) rotate(-8deg); }
      26% { opacity:.68; transform:scale(1) rotate(0deg); }
      34% { opacity:.18; transform:scale(.72) rotate(5deg); }
      44% { opacity:0; transform:scale(.5) rotate(8deg); }
    }
    #dashboard .hero-recognition-pending-copy { display:none !important; }

    @media (max-width:620px) {
      #dashboard .profile-carousel {
        width:78%;
        grid-template-columns:26px minmax(0,1fr) 26px;
        margin-top:0;
      }
      #dashboard .carousel-arrow { width:26px; height:38px; font-size:1.45rem; }
      #dashboard .profiles { min-height:72px; padding-top:0; }
      #dashboard .profile-card { width:66px; min-height:64px; padding:1px; }
      #dashboard .profile-avatar { width:37px; height:37px; font-size:1.62rem; }
      #dashboard .profile-card.selected .profile-avatar { width:49px; height:49px; }

      #dashboard .profile-hero-hud {
        top:122px;
        right:12px;
        width:47%;
        min-width:0;
        padding:12px;
        border-radius:17px;
      }
      #dashboard .hero-hud-date { font-size:.57rem; letter-spacing:.07em; }
      #dashboard .profile-hero-hud .profile-hero-identity { margin-top:6px; }
      #dashboard .profile-hero-hud .profile-hero-name { font-size:clamp(1.22rem, 5.8vw, 1.62rem); }
      #dashboard .profile-hero-hud .profile-hero-title { font-size:.63rem; }
      #dashboard .hero-hud-today { margin-top:11px; gap:5px; }
      #dashboard .hero-hud-section-label { font-size:.52rem; }
      #dashboard .hero-hud-today-text { font-size:.71rem; }
      #dashboard .hero-hud-progress { height:4px; }
      #dashboard .hero-hud-stats { margin-top:10px; gap:5px; }
      #dashboard .hero-hud-stat { min-height:26px; padding:5px 6px; border-radius:9px; font-size:.58rem; gap:4px; }
      #dashboard .hero-hud-dynamic { min-height:48px; margin-top:10px; }
      #dashboard .hero-hud-recognition,
      #dashboard .hero-hud-message { padding:8px 9px; border-radius:11px; gap:3px; }
      #dashboard .hero-hud-recognition strong,
      #dashboard .hero-hud-message strong { font-size:.70rem; }
      #dashboard .hero-hud-recognition span,
      #dashboard .hero-hud-message span { font-size:.57rem; }
      #dashboard .hero-recognition-pending { width:245px; height:245px; }
    }
    @media (max-width:390px) {
      #dashboard .profile-carousel { width:80%; }
      #dashboard .profile-hero-hud { top:116px; right:9px; width:49%; padding:10px; border-radius:15px; }
      #dashboard .hero-hud-date { font-size:.53rem; }
      #dashboard .profile-hero-hud .profile-hero-name { font-size:1.18rem; }
      #dashboard .hero-hud-stat { padding:5px; font-size:.54rem; }
      #dashboard .hero-hud-dynamic { min-height:43px; }
    }
    @media (prefers-reduced-motion: reduce) {
      #dashboard .hero-recognition-twinkle { animation:none; opacity:.46; transform:none; }
      #dashboard .hero-hud-progress > span { transition:none; }
    }


    /* v1.56.0 Mobile Hero Framing + compact HUD */
    #dashboard .hero-hud-identity-panel,
    #dashboard .hero-hud-lower {
      display: contents;
    }
    #dashboard .hero-hud-wilds-slot[hidden] { display:none !important; }

    @media (max-width:620px) {
      #dashboard .world-stage {
        --mobile-world-visual-height:310px;
        display:grid;
        grid-template-columns:1fr;
        grid-template-rows:auto auto auto;
        min-height:0;
        padding-bottom:17px;
      }
      #dashboard .world-stage-image {
        inset:0 0 auto 0;
        height:var(--mobile-world-visual-height);
        object-fit:cover;
        object-position:left center;
      }

      /* Utility actions keep full tap targets but visually recede into the scene. */
      #dashboard .topbar-actions { gap:5px; }
      #dashboard .dashboard-topbar .adult-button,
      #dashboard .dashboard-topbar .starworld-launch-button {
        width:42px;
        min-width:42px;
        height:42px;
        min-height:42px;
        padding:0;
        border-color:rgba(211,222,248,.085);
        border-radius:13px;
        background:rgba(7,18,43,.11);
        box-shadow:none;
        backdrop-filter:blur(5px);
        -webkit-backdrop-filter:blur(5px);
      }
      #dashboard .dashboard-topbar .adult-button .ui-icon {
        width:19px;
        height:19px;
        opacity:.90;
      }
      #dashboard .dashboard-topbar .starworld-launch-button .ui-icon {
        width:20px;
        height:20px;
      }

      /* Tighter carousel: selected profile stays prominent while neighbors recede. */
      #dashboard .profile-carousel {
        width:72%;
        grid-template-columns:28px minmax(0,1fr) 28px;
        margin-top:0;
        justify-self:center;
      }
      #dashboard .carousel-arrow {
        width:28px;
        height:38px;
        font-size:1.28rem;
        opacity:.70;
      }
      #dashboard .profiles {
        min-height:60px;
        padding:0 2px;
        gap:2px;
      }
      #dashboard .profile-card {
        width:58px;
        min-height:56px;
        padding:0;
      }
      #dashboard .profile-avatar {
        width:32px;
        height:32px;
        font-size:1.42rem;
      }
      #dashboard .profile-card.selected .profile-avatar {
        width:49px;
        height:49px;
      }

      /* On phone the HUD becomes two layers: identity over the art, status below it. */
      #dashboard .profile-hero-hud {
        position:relative;
        top:auto;
        left:auto;
        right:auto;
        bottom:auto;
        width:100%;
        min-width:0;
        padding:0;
        border:0;
        border-radius:0;
        background:none;
        box-shadow:none;
        backdrop-filter:none;
        -webkit-backdrop-filter:none;
        display:grid;
        grid-template-rows:180px auto;
        pointer-events:none;
      }
      #dashboard .hero-hud-identity-panel {
        grid-row:1;
        align-self:start;
        justify-self:end;
        width:min(43%, 158px);
        display:grid;
        gap:0;
        margin:8px 0 0;
        padding:7px 8px 8px;
        border:1px solid rgba(211,222,248,.085);
        border-radius:14px;
        background:
          linear-gradient(145deg, rgba(6,17,42,.31), rgba(5,15,38,.14) 64%, rgba(7,18,43,.08)),
          radial-gradient(circle at 16% 14%, color-mix(in srgb, var(--hero-profile-color, #9d67ef) 9%, transparent), transparent 46%);
        box-shadow:inset 0 1px 0 rgba(255,255,255,.025);
        backdrop-filter:blur(5px) saturate(105%);
        -webkit-backdrop-filter:blur(5px) saturate(105%);
        pointer-events:auto;
        z-index:3;
      }
      #dashboard .hero-hud-date {
        font-size:.52rem;
        letter-spacing:.065em;
      }
      #dashboard .profile-hero-hud .profile-hero-identity {
        margin-top:5px;
      }
      #dashboard .profile-hero-hud .profile-hero-name {
        font-size:clamp(1.12rem, 5.25vw, 1.44rem);
      }
      #dashboard .profile-hero-hud .profile-hero-title {
        font-size:.62rem;
      }
      #dashboard .hero-hud-wilds-slot:not([hidden]) {
        display:flex;
        align-items:center;
        gap:5px;
        margin-top:8px;
      }

      #dashboard .hero-hud-lower {
        grid-row:2;
        position:relative;
        z-index:3;
        display:grid;
        gap:7px;
        width:100%;
        margin:0;
        padding:0 4px;
        pointer-events:auto;
      }

      /* One shared status strip instead of separate Stars/Streak/Badge cards. */
      #dashboard .hero-hud-stats {
        order:1;
        display:flex;
        flex-wrap:nowrap;
        align-items:center;
        gap:2px;
        margin:0;
        padding:6px 8px;
        border:1px solid rgba(211,222,248,.075);
        border-radius:12px;
        background:rgba(7,19,45,.20);
        box-shadow:inset 0 1px 0 rgba(255,255,255,.018);
        backdrop-filter:blur(5px) saturate(105%);
        -webkit-backdrop-filter:blur(5px) saturate(105%);
      }
      #dashboard .hero-hud-stat {
        flex:1 1 0;
        min-width:0;
        min-height:24px;
        justify-content:center;
        gap:4px;
        padding:2px 5px;
        border:0;
        border-radius:0;
        background:none;
        box-shadow:none;
        font-size:.62rem;
        overflow:hidden;
        text-overflow:ellipsis;
      }
      #dashboard .hero-hud-stat-button {
        color:#fff3bd;
        background:none;
      }
      #dashboard .hero-hud-stat-button #heroBadgeName {
        overflow:hidden;
        text-overflow:ellipsis;
      }

      /* Today is a lightweight information row rather than another glass card. */
      #dashboard .hero-hud-today {
        order:2;
        gap:4px;
        margin:0;
        padding:1px 3px 0;
        border:0;
        border-radius:0;
        background:none;
        box-shadow:none;
        backdrop-filter:none;
        -webkit-backdrop-filter:none;
      }
      #dashboard .hero-hud-section-label { font-size:.51rem; }
      #dashboard .hero-hud-today-text { font-size:.72rem; }
      #dashboard .hero-hud-progress { height:3px; }

      /* Recognition/milestone notes remain available without becoming another large slab. */
      #dashboard .hero-hud-dynamic {
        order:3;
        min-height:0;
        margin:0;
      }
      #dashboard .hero-hud-dynamic:empty { display:none; }
      #dashboard .hero-hud-dynamic .hero-hud-complete { display:none; }
      #dashboard .hero-hud-recognition,
      #dashboard .hero-hud-message {
        padding:4px 3px 0;
        border:0;
        border-radius:0;
        background:none;
        box-shadow:none;
        backdrop-filter:none;
        -webkit-backdrop-filter:none;
        gap:2px;
      }
      #dashboard .hero-hud-recognition strong,
      #dashboard .hero-hud-message strong { font-size:.69rem; }
      #dashboard .hero-hud-recognition span,
      #dashboard .hero-hud-message span { font-size:.58rem; }

      #dashboard .hero-recognition-pending {
        width:220px;
        height:220px;
      }
    }

    @media (max-width:390px) {
      #dashboard .world-stage {
        --mobile-world-visual-height:296px;
        padding-bottom:15px;
      }
      #dashboard .profile-hero-hud {
        grid-template-rows:170px auto;
      }
      #dashboard .profile-carousel { width:70%; }
      #dashboard .profiles { min-height:58px; }
      #dashboard .profile-card { width:55px; min-height:54px; }
      #dashboard .profile-avatar { width:31px; height:31px; font-size:1.38rem; }
      #dashboard .profile-card.selected .profile-avatar { width:47px; height:47px; }
      #dashboard .hero-hud-identity-panel {
        width:42%;
        margin-top:6px;
        padding:7px 8px;
        border-radius:13px;
      }
      #dashboard .hero-hud-date { font-size:.50rem; }
      #dashboard .profile-hero-hud .profile-hero-name { font-size:1.12rem; }
      #dashboard .hero-hud-stats { padding:5px 6px; }
      #dashboard .hero-hud-stat { padding:2px 3px; font-size:.59rem; }
    }


    /* v1.57.0 Mobile Hierarchy + compact card grid */
    @media (max-width:620px) {
      /* Keep profile switching in the upper utility band instead of giving it
         a separate row that competes with the hero artwork. */
      #dashboard .profile-carousel {
        position:absolute;
        z-index:5;
        top:max(10px, env(safe-area-inset-top));
        left:8px;
        width:61%;
        margin:0;
        grid-template-columns:22px minmax(0,1fr) 22px;
        gap:1px;
      }
      #dashboard .carousel-arrow {
        width:22px;
        height:34px;
        font-size:1.08rem;
        opacity:.46;
        text-shadow:0 2px 8px rgba(0,0,0,.40);
      }
      #dashboard .profiles {
        min-height:48px;
        padding:0;
        gap:0;
      }
      #dashboard .profile-card {
        width:50px;
        min-height:46px;
      }
      #dashboard .profile-card.selected { transform:scale(1.02); }
      #dashboard .profile-avatar {
        width:28px;
        height:28px;
        font-size:1.22rem;
        border-width:1px;
        box-shadow:0 3px 10px rgba(0,0,0,.20);
      }
      #dashboard .profile-card.selected .profile-avatar {
        width:42px;
        height:42px;
        border-width:1.5px;
        box-shadow:
          0 0 0 1px rgba(5,15,37,.82),
          0 0 0 2px var(--profile-color, #9d67ef),
          0 0 10px color-mix(in srgb, var(--profile-color, #9d67ef) 50%, transparent),
          0 4px 12px rgba(0,0,0,.22);
      }

      /* Removing the carousel from normal flow gives that space back to the
         world. Keep the lower HUD at the bottom edge of the hero image. */
      #dashboard .profile-hero-hud {
        grid-template-rows:250px auto;
      }
      #dashboard .hero-hud-identity-panel {
        width:min(39%, 148px);
        margin-top:5px;
        padding:6px 7px 7px;
        border-color:rgba(211,222,248,.065);
        background:linear-gradient(145deg, rgba(6,17,42,.25), rgba(5,15,38,.10) 68%, rgba(7,18,43,.05));
        box-shadow:none;
      }

      /* Stats should read as small status information, not another major card. */
      #dashboard .hero-hud-lower { gap:5px; }
      #dashboard .hero-hud-stats {
        min-height:30px;
        padding:2px 6px;
        border-color:rgba(211,222,248,.05);
        border-radius:10px;
        background:rgba(7,19,45,.12);
        box-shadow:none;
      }
      #dashboard .hero-hud-stat {
        min-height:20px;
        padding:1px 4px;
        font-size:.59rem;
      }
      #dashboard .hero-hud-today {
        gap:3px;
        padding-top:0;
      }
      #dashboard .hero-hud-progress { height:2px; }
      #dashboard .hero-hud-dynamic { margin-top:0; }
      #dashboard .hero-hud-recognition,
      #dashboard .hero-hud-message { padding-top:2px; }

      /* Lower dashboard hierarchy: headings and cards support the world instead
         of visually overpowering it. */
      #dashboard .section { margin-top:20px; }
      #dashboard .section-heading {
        margin-bottom:8px;
        gap:8px;
      }
      #dashboard .section-title { gap:7px; }
      #dashboard .section-title h2 {
        font-size:1.01rem;
        font-weight:760;
      }
      #dashboard .section-icon {
        width:25px;
        height:25px;
      }
      #dashboard .section-icon svg {
        width:16px;
        height:16px;
      }
      #dashboard .section-note { font-size:.72rem; }
      #dashboard .task-view-toggle {
        padding:5px 9px;
        font-size:.72rem;
      }

      /* Phone cards use two stable columns. A lone item stays one-column wide
         instead of stretching into a full-width banner. */
      #dashboard .task-list,
      #dashboard .grab-grid,
      #dashboard .reward-scroll {
        grid-template-columns:repeat(2, minmax(0,1fr));
        gap:8px;
        align-items:start;
      }

      #dashboard .task-card.today-task-card {
        min-height:76px;
        grid-template-columns:44px minmax(0,1fr);
        gap:7px;
        padding:8px 8px 8px 7px;
        border-radius:10px;
      }
      #dashboard .task-card.today-task-card .routine-visual-wrap {
        width:43px;
        height:43px;
      }
      #dashboard .task-card.today-task-card .visual {
        width:41px;
        height:41px;
        font-size:1.72rem;
      }
      #dashboard .task-card.today-task-card .task-title {
        font-size:.82rem;
        line-height:1.10;
      }
      #dashboard .task-card.today-task-card .meta {
        gap:4px;
        row-gap:3px;
        margin-top:4px;
      }
      #dashboard .profile-task-pill {
        padding:2px 5px;
        font-size:.63rem;
      }
      #dashboard .task-inline-meta,
      #dashboard .today-task-state,
      #dashboard .session-running-pill {
        font-size:.65rem;
      }

      #dashboard .grab-card {
        min-height:74px;
        grid-template-columns:40px minmax(0,1fr);
        gap:7px;
        padding:8px 8px 8px 7px;
        border-radius:10px;
      }
      #dashboard .grab-visual {
        width:38px;
        height:38px;
        font-size:1.7rem;
      }
      #dashboard .grab-title {
        font-size:.82rem;
        line-height:1.10;
      }
      #dashboard .grab-meta {
        margin-top:4px;
        gap:4px;
        font-size:.65rem;
      }

      #dashboard .reward-scroll { padding:1px; }
      #dashboard .reward-card {
        min-height:106px;
        grid-template-columns:50px minmax(0,1fr);
        grid-template-rows:auto auto auto auto;
        column-gap:7px;
        row-gap:3px;
        padding:9px 8px;
        border-radius:10px;
      }
      #dashboard .reward-visual {
        width:48px;
        height:48px;
        font-size:1.95rem;
      }
      #dashboard .reward-name {
        font-size:.83rem;
        line-height:1.10;
      }
      #dashboard .reward-desc {
        font-size:.64rem;
        line-height:1.22;
        display:-webkit-box;
        -webkit-box-orient:vertical;
        -webkit-line-clamp:2;
        overflow:hidden;
      }
      #dashboard .reward-card::before {
        height:5px;
      }
      #dashboard .reward-cost {
        margin-top:0;
        padding-top:0;
        font-size:.69rem;
      }
      #dashboard .reward-card:not(.unavailable)::after {
        top:6px;
        right:6px;
        padding:3px 5px;
        font-size:.58rem;
      }
    }

    @media (max-width:390px) {
      #dashboard .profile-carousel {
        top:max(8px, env(safe-area-inset-top));
        left:6px;
        width:60%;
      }
      #dashboard .profile-card { width:48px; }
      #dashboard .profile-avatar { width:27px; height:27px; }
      #dashboard .profile-card.selected .profile-avatar { width:40px; height:40px; }
      #dashboard .profile-hero-hud { grid-template-rows:238px auto; }
      #dashboard .hero-hud-identity-panel { width:39%; }
      #dashboard .section-title h2 { font-size:.98rem; }
      #dashboard .task-card.today-task-card,
      #dashboard .grab-card { min-height:72px; }
    }

    /* v1.58.0 Tablet/Desktop fixed card columns + lighter carousel */
    @media (min-width:621px) {
      /* Keep a stable three-column grid so one or two cards do not stretch
         across the full section width on iPad or desktop. */
      #dashboard .task-list,
      #dashboard .grab-grid,
      #dashboard .reward-scroll {
        grid-template-columns:repeat(3, minmax(0,1fr));
        align-items:start;
      }

      /* Move the carousel slightly upward and reduce its visual scale by
         roughly five percent without changing any other hero/HUD behavior. */
      #dashboard .profile-carousel {
        width:min(95%, 437px);
        margin-top:0;
        grid-template-columns:34px minmax(0,1fr) 34px;
      }
      #dashboard .carousel-arrow {
        width:32px;
        height:42px;
        font-size:1.63rem;
      }
      #dashboard .profiles {
        min-height:87px;
        padding:1px 4px 2px;
      }
      #dashboard .profile-card {
        width:min(100%, 91px);
        min-height:72px;
      }
      #dashboard .profile-avatar {
        width:50px;
        height:50px;
        font-size:2.05rem;
      }
      #dashboard .profile-card.selected .profile-avatar {
        width:62px;
        height:62px;
      }
    }


    /* v1.59.0 Default Star World starter state */
    #dashboard .world-stage:not(.has-world-image) {
      background-image:url('/assets/system/default-world-background-v1.jpg');
      background-size:cover;
      background-position:46% center;
      background-repeat:no-repeat;
    }
    #dashboard .default-world-pedestal {
      position:absolute;
      z-index:2;
      left:clamp(34px, 9vw, 132px);
      bottom:clamp(42px, 6vw, 76px);
      width:min(38%, 430px);
      height:auto;
      opacity:0;
      visibility:hidden;
      pointer-events:none;
      filter:drop-shadow(0 18px 28px rgba(0,0,0,.18));
     transition:opacity .24s ease, visibility 0s linear .24s;
    }
    #dashboard .default-world-message {
      display:none;
      margin-top:10px;
      gap:4px;
      color:rgba(239,244,255,.90);
      text-shadow:0 2px 9px rgba(0,0,0,.50);
    }
    #dashboard .default-world-message strong {
      display:block;
      color:#fff;
      font-size:clamp(.78rem, 1.35vw, .94rem);
      line-height:1.12;
      font-weight:840;
      letter-spacing:-.012em;
    }
    #dashboard .default-world-message span {
      display:block;
      margin-top:3px;
      color:rgba(222,231,250,.78);
      font-size:clamp(.66rem, 1.05vw, .76rem);
      line-height:1.28;
      font-weight:650;
    }
    #dashboard .world-stage.has-default-world .default-world-pedestal {
      opacity:1;
      visibility:visible;
      transition-delay:0s;
    }
    #dashboard .world-stage.has-default-world .default-world-message {
      display:grid;
    }

    @media (max-width:620px) {
      #dashboard .world-stage:not(.has-world-image) {
        background-size:auto var(--mobile-world-visual-height);
        background-position:43% top;
        background-color:#07152f;
      }
      #dashboard .default-world-pedestal {
        top:102px;
        bottom:auto;
        left:5%;
        width:min(45vw, 190px);
        filter:drop-shadow(0 12px 20px rgba(0,0,0,.16));
      }
      #dashboard .default-world-message {
        margin-top:8px;
        gap:2px;
      }
      #dashboard .default-world-message strong {
        font-size:.72rem;
        line-height:1.12;
      }
      #dashboard .default-world-message span {
        margin-top:2px;
        font-size:.59rem;
        line-height:1.25;
      }
    }

    @media (max-width:390px) {
      #dashboard .default-world-pedestal {
        top:98px;
        left:4%;
        width:min(44vw, 174px);
      }
      #dashboard .default-world-message strong { font-size:.69rem; }
      #dashboard .default-world-message span { font-size:.57rem; }
    }


    /* v1.60.0 iPhone header + profile HUD balance */
    @media (max-width:620px) {
      #dashboard .world-stage {
        --mobile-header-height:48px;
        --mobile-identity-top:112px;
        --mobile-identity-width:min(44%, 170px);
        padding-top:0;
      }

      /* Utility actions sit in a quiet app-level header above the world portrait. */
      #dashboard .dashboard-topbar {
        position:absolute;
        z-index:8;
        top:0;
        left:0;
        right:0;
        height:var(--mobile-header-height);
        padding:0 12px;
        background:#07142d;
      }
      #dashboard .topbar-actions { gap:4px; }
      #dashboard .dashboard-topbar .adult-button,
      #dashboard .dashboard-topbar .starworld-launch-button {
        width:40px;
        min-width:40px;
        height:40px;
        min-height:40px;
        border-color:rgba(211,222,248,.07);
        background:rgba(255,255,255,.018);
      }
      #dashboard .dashboard-topbar .adult-button .ui-icon,
      #dashboard .dashboard-topbar .starworld-launch-button .ui-icon {
        width:18px;
        height:18px;
      }

      /* The world portrait begins below the app header. */
      #dashboard .world-stage-image {
        top:var(--mobile-header-height);
        height:var(--mobile-world-visual-height);
      }
      #dashboard .world-stage:not(.has-world-image) {
        background-position:43% var(--mobile-header-height);
      }

      /* Profile switching belongs to the world itself, centered at its top edge. */
      #dashboard .profile-carousel {
        top:calc(var(--mobile-header-height) + 5px);
        left:50%;
        width:min(50%, 202px);
        transform:translateX(-50%);
        grid-template-columns:19px minmax(0,1fr) 19px;
        gap:0;
      }
      #dashboard .carousel-arrow {
        width:19px;
        height:30px;
        font-size:.96rem;
        opacity:.42;
      }
      #dashboard .profiles {
        min-height:42px;
        padding:0;
        gap:0;
      }
      #dashboard .profile-card {
        width:43px;
        min-height:40px;
      }
      #dashboard .profile-avatar {
        width:24px;
        height:24px;
        font-size:1.06rem;
        box-shadow:0 2px 7px rgba(0,0,0,.16);
      }
      #dashboard .profile-card.selected { transform:scale(1.01); }
      #dashboard .profile-card.selected .profile-avatar {
        width:37px;
        height:37px;
        border-width:1px;
        box-shadow:
          0 0 0 1px rgba(5,15,37,.72),
          0 0 0 2px color-mix(in srgb, var(--profile-color, #9d67ef) 78%, transparent),
          0 0 7px color-mix(in srgb, var(--profile-color, #9d67ef) 30%, transparent),
          0 3px 9px rgba(0,0,0,.18);
      }

      /* Keep the lower Today area below the full portrait, including the new header. */
      #dashboard .profile-hero-hud {
        grid-template-rows:calc(var(--mobile-header-height) + var(--mobile-world-visual-height)) auto;
      }
      #dashboard .hero-hud-identity-panel {
        width:var(--mobile-identity-width);
        min-height:166px;
        margin-top:var(--mobile-identity-top);
        padding:8px 8px 37px;
      }
      #dashboard .hero-hud-date { font-size:.53rem; }
      #dashboard .profile-hero-hud .profile-hero-name {
        font-size:clamp(1.15rem, 5.35vw, 1.47rem);
      }

      /* Stars, streak and badge now live visually inside the profile panel. */
      #dashboard .hero-hud-lower {
        position:static;
      }
      #dashboard .hero-hud-stats {
        position:absolute;
        z-index:5;
        top:calc(var(--mobile-identity-top) + 127px);
        right:0;
        width:var(--mobile-identity-width);
        min-height:29px;
        display:grid;
        grid-template-columns:repeat(3, minmax(0,1fr));
        gap:2px;
        margin:0;
        padding:5px 7px 3px;
        border:0;
        border-top:1px solid rgba(211,222,248,.085);
        border-radius:0;
        background:none;
        box-shadow:none;
        backdrop-filter:none;
        -webkit-backdrop-filter:none;
      }
      #dashboard .hero-hud-stat {
        width:100%;
        min-height:20px;
        justify-content:center;
        gap:3px;
        padding:1px 2px;
        font-size:.54rem;
      }
      #dashboard .hero-hud-stat-stars span:last-child,
      #dashboard .hero-hud-stat-streak span:last-child {
        display:none;
      }
      #dashboard #heroBadgeButton[hidden] {
        display:inline-flex !important;
        visibility:hidden;
        pointer-events:none;
      }
      #dashboard .hero-hud-stat-button #heroBadgeName {
        min-width:0;
        overflow:hidden;
        text-overflow:ellipsis;
      }

      /* Today stays in the current location, but regains readable visual weight. */
      #dashboard .hero-hud-today {
        gap:4px;
        padding:2px 3px 0;
      }
      #dashboard .hero-hud-section-label {
        font-size:.59rem;
        letter-spacing:.14em;
      }
      #dashboard .hero-hud-today-text {
        font-size:.84rem;
        line-height:1.16;
        font-weight:780;
      }
      #dashboard .hero-hud-progress { height:3.5px; }

      /* Lower the starter pedestal slightly within the world portrait. */
      #dashboard .default-world-pedestal {
        top:calc(var(--mobile-header-height) + 112px);
      }
    }

    @media (max-width:390px) {
      #dashboard .world-stage {
        --mobile-identity-top:106px;
        --mobile-identity-width:min(44%, 164px);
      }
      #dashboard .profile-carousel {
        top:calc(var(--mobile-header-height) + 4px);
        width:min(51%, 194px);
      }
      #dashboard .profile-card { width:41px; }
      #dashboard .profile-avatar { width:23px; height:23px; }
      #dashboard .profile-card.selected .profile-avatar { width:35px; height:35px; }
      #dashboard .hero-hud-identity-panel {
        min-height:162px;
        padding-bottom:36px;
      }
      #dashboard .hero-hud-stats {
        top:calc(var(--mobile-identity-top) + 124px);
        padding-left:6px;
        padding-right:6px;
      }
      #dashboard .hero-hud-stat { font-size:.52rem; }
      #dashboard .hero-hud-section-label { font-size:.57rem; }
      #dashboard .hero-hud-today-text { font-size:.82rem; }
      #dashboard .default-world-pedestal {
        top:calc(var(--mobile-header-height) + 108px);
      }
    }


    /* v1.61.0 Final HUD polish + pedestal alignment */
    @media (min-width:621px) {
      /* Match the improved starter-world grounding from iPhone on larger screens. */
      #dashboard .default-world-pedestal {
        bottom:clamp(24px, 3.7vw, 48px);
      }
    }

    @media (max-width:620px) {
      /* Give Today a little more presence without changing its spacing. */
      #dashboard .hero-hud-section-label {
        font-size:.62rem;
      }
      #dashboard .hero-hud-today-text {
        font-size:.92rem;
        line-height:1.16;
      }
      #dashboard .hero-hud-recognition strong,
      #dashboard .hero-hud-message strong {
        font-size:.76rem;
      }
      #dashboard .hero-hud-recognition span,
      #dashboard .hero-hud-message span {
        font-size:.64rem;
      }

      /* Compact recognition to its emoji while keeping the full accessible label. */
      #dashboard .hero-hud-stat-button #heroBadgeName {
        display:none;
      }
      #dashboard .hero-hud-stat > span[aria-hidden="true"],
      #dashboard #heroBadgeIcon {
        font-size:.64rem;
        line-height:1;
      }
    }

    @media (max-width:390px) {
      #dashboard .hero-hud-section-label {
        font-size:.60rem;
      }
      #dashboard .hero-hud-today-text {
        font-size:.90rem;
      }
      #dashboard .hero-hud-stat > span[aria-hidden="true"],
      #dashboard #heroBadgeIcon {
        font-size:.62rem;
      }
    }


    /* v1.61.1 Celebration weight + tap to continue */
    .reward-fanfare,
    .task-completion-fanfare,
    .milestone-fanfare {
      pointer-events:auto;
      touch-action:manipulation;
    }

    /* Milestones keep the existing quick arrival, then hold long enough to read
       as the largest accomplishment before a short exit. */
    .milestone-fanfare {
      animation:milestoneFanfareHold 4.3s ease forwards !important;
    }
    .milestone-fanfare-card {
      animation:milestoneCardHold 4.3s cubic-bezier(.2,.8,.2,1) forwards !important;
    }
    .milestone-fanfare.leaving {
      animation:milestoneFanfareSkip .35s ease-in both !important;
    }
    .milestone-fanfare.leaving .milestone-fanfare-card {
      animation:milestoneCardSkip .35s ease-in both !important;
    }
    @keyframes milestoneFanfareHold {
      0%, 92% { opacity:1; }
      100% { opacity:0; }
    }
    @keyframes milestoneCardHold {
      0% { transform:scale(.7) rotate(-3deg); opacity:0; }
      11% { transform:scale(1.08) rotate(1deg); opacity:1; }
      15%, 92% { transform:scale(1) rotate(0); opacity:1; }
      100% { transform:scale(.98); opacity:0; }
    }
    @keyframes milestoneFanfareSkip {
      from { opacity:1; }
      to { opacity:0; }
    }
    @keyframes milestoneCardSkip {
      from { opacity:1; transform:scale(1); }
      to { opacity:0; transform:scale(.985); }
    }

  
