  :root {
    /* ── Design tokens — dark theme ── */
    --bg:             #0B0F1A;
    --surface:        #151823;
    --surface2:       #1c2235;
    --surface3:       #232b42;
    --text:           rgba(255,255,255,0.88);
    --text2:          rgba(255,255,255,0.62);
    --text3:          rgba(255,255,255,0.35);
    --gold:           #9a6f35;
    --gold-hover:     #b8863f;
    --gold-dim:       rgba(154,111,53,0.15);
    --border:         rgba(255,255,255,0.09);
    --border2:        rgba(255,255,255,0.06);
    --green:          #a8c5a0;
    --danger:         #ff6358;
    --danger-dim:     rgba(255,99,88,0.10);
    --danger-border:  rgba(255,99,88,0.28);
    --record:         #ff4040;
    --safe-bottom:    env(safe-area-inset-bottom, 0px);
    --fs-body:        15px;
  }

  * { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
  html, body { height: 100%; min-height: 100vh; overflow: hidden; }

  body {
    background-color: var(--bg);
    color: #ffffff;
    font-family: 'Google Sans', sans-serif;
    display: flex;
    flex-direction: column;
    width: 100%;
    position: relative;
  }


  /* ===================== */
  /* PAGES                 */
  /* ===================== */
  .page { display: none !important; flex-direction: column; height: 100vh; height: 100dvh; width: 100%; position: fixed; top: 0; left: 0; z-index: 1; background: transparent; }
  .page.active { display: flex !important; z-index: 2; }

  .pillars-center-wrap { display: flex; flex-direction: column; flex: 1; min-height: 0; }

  /* ===================== */
  /* AUTH PAGE             */
  /* ===================== */
  #page-auth {
    align-items: center;
    justify-content: center;
    padding: 40px 32px;
    gap: 0;
    height: 100vh;
    min-height: 100%;
    background-image: url('Hero.jpg?v=4');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
  }
  #page-auth::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(160deg, rgba(6,6,26,0.88) 0%, rgba(4,4,16,0.78) 55%, rgba(8,6,4,0.85) 100%);
    z-index: 0;
  }
  #page-auth > * { position: relative; z-index: 1; }

  .auth-logo {
    font-family: 'Caveat', cursive;
    font-size: 52px;
    font-style: italic;
    color: #ffffff;
    margin-bottom: 8px;
    animation: fadeDown 0.8s ease both;
  }

  .auth-tagline {
    font-size: 13px;
    color: rgba(255,255,255,0.55);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 48px;
    animation: fadeDown 0.8s ease 0.1s both;
  }

  .auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    border: none;
    border-radius: 24px;
    padding: 32px 28px;
    animation: fadeUp 0.8s ease 0.2s both;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  .auth-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255,255,255,0.10);
    margin-bottom: 28px;
    gap: 24px;
  }

  .auth-tab {
    font-family: 'Google Sans', sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: rgba(255,255,255,0.35);
    padding-bottom: 12px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    margin-bottom: -1px;
  }

  .auth-tab.active { color: #ffffff; border-bottom-color: #ffffff; }

  .form-group { margin-bottom: 16px; }

  .form-label {
    display: block;
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.55);
    margin-bottom: 8px;
  }

  .form-input {
    width: 100%;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    padding: 14px 16px;
    font-family: 'Google Sans', sans-serif;
    font-size: 15px;
    color: #ffffff;
    outline: none;
    transition: border-color 0.2s ease;
  }

  .form-input:focus { border-color: rgba(255,255,255,0.35); background: rgba(255,255,255,0.10); }
  .form-input::placeholder { color: rgba(255,255,255,0.35); }

  .btn-primary {
    width: 100%;
    background: #3B82F6;
    color: white;
    border: none;
    border-radius: 32px;
    padding: 16px;
    font-family: 'Google Sans', sans-serif;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 8px;
    transition: all 0.2s ease;
  }

  .btn-primary:hover { background: #2563eb; transform: translateY(-1px); }
  .btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

  .auth-error {
    font-size: 13px;
    color: var(--danger);
    text-align: center;
    margin-top: 12px;
    min-height: 20px;
  }

  .forgot-link {
    text-align: right;
    margin-top: 6px;
    margin-bottom: 4px;
  }
  .forgot-link span {
    font-size: 12px;
    color: var(--text3);
    cursor: pointer;
    transition: color 0.2s;
  }
  .forgot-link span:hover { color: var(--text2); }

  .auth-back-link {
    font-size: 12px;
    color: var(--text3);
    cursor: pointer;
    transition: color 0.2s;
  }
  .auth-back-link:hover { color: var(--text2); }

  /* ===================== */
  /* TOP BAR               */
  /* ===================== */
  .top-bar {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    height: 60px;
    min-height: 60px;
    max-height: 60px;
    border-bottom: 1px solid rgba(255,255,255,0.10);
    flex-shrink: 0 !important;
    background: var(--bg);
    position: relative;
    z-index: 10;
    width: 100%;
  }

  /* Journal page: avatar floats top-right, no block space reserved */
  #page-journal .top-bar {
    position: absolute;
    top: 0;
    right: 0;
    left: auto;
    width: auto;
    background: transparent;
    border-bottom: none;
    height: auto;
    min-height: unset;
    max-height: unset;
    padding: 16px 20px;
    z-index: 10;
  }

  .avatar-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    position: relative;
  }

  .avatar-wrapper .pro-badge {
    margin-top: -8px;
    font-size: 10px;
    letter-spacing: 0;
    text-transform: none;
    padding: 3px 8px;
    border-radius: 20px;
    background: rgba(15,17,28,0.95);
    border: 1px solid rgba(255,255,255,0.18);
    color: rgba(255,255,255,0.85);
    white-space: nowrap;
    position: relative;
    z-index: 1;
  }

  .app-name {
    font-family: 'Caveat', cursive;
    font-size: 22px;
    font-style: italic;
    font-weight: 500;
    letter-spacing: -0.02em;
    color: #ffffff;
  }

  .top-bar-actions { display: flex; align-items: center; gap: 10px; }

  .pro-badge {
    font-size: 9px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #ffffff;
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.16);
    border-radius: 12px;
    padding: 4px 12px;
  }

  .avatar-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.16);
    background: rgba(255,255,255,0.10);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .avatar-btn:hover { background: rgba(255,255,255,0.14); }

  /* ===================== */
  /* PILLAR LIST           */
  /* ===================== */
  #page-pillars { overflow: hidden; display: flex; flex-direction: column; height: 100%; background: transparent; position: relative; }

  /* Fade out pillars at bottom where input bar sits */
  #page-pillars::after {
    content: '';
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 180px;
    background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.3) 50%, transparent 100%);
    pointer-events: none;
    z-index: 45;
  }

  .pillar-scroll {
    flex: 1;
    overflow-y: scroll;
    -webkit-overflow-scrolling: touch;
    padding: 16px 12px 200px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scrollbar-width: none;
    min-height: 0;
  }

  .pillar-scroll::-webkit-scrollbar { display: none; }

  .pillar-row {
    background: #12121F;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.09);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    filter: url(#liquid-glass);
    padding: 18px 16px;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    overflow: hidden;
    flex-shrink: 0;
  }

  .pillar-row:hover {
    background: #1e1e2e;
    border-color: rgba(255,255,255,0.14);
    transform: translateY(-2px);
  }

  .pillar-row::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    border-radius: 0 2px 2px 0;
    background: rgba(255,255,255,0.55);
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  .pillar-row.has-entries::before { opacity: 1; }
  .pillar-row:active { transform: scale(0.98); }

  .pillar-icon-wrap { position: relative; flex-shrink: 0; }
  .pillar-emoji { font-size: 30px; display: block; }

  .update-dot {
    position: absolute;
    top: -2px; right: -4px;
    width: 9px; height: 9px;
    border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 8px rgba(154,111,53,0.8);
    border: 2px solid var(--surface2);
    animation: dotPulse 2s ease-in-out infinite;
  }

  .update-dot.green { background: var(--green); box-shadow: 0 0 8px rgba(168,197,160,0.8); }

  @keyframes dotPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
  }

  .pillar-info { flex: 1; min-width: 0; }

  .pillar-name-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 5px;
  }

  .pillar-title {
    font-family: 'Google Sans', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #ffffff;
  }

  .pillar-count { font-size: 10px; color: rgba(255,255,255,0.55); letter-spacing: 1px; }

  .pillar-preview {
    font-size: 13px;
    color: rgba(255,255,255,0.55);
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 6px;
    line-height: 1.4;
  }

  .pillar-empty { font-style: italic; color: rgba(255,255,255,0.35); }

  .pillar-meta { display: flex; align-items: center; gap: 10px; }
  .pillar-time { font-size: 11px; font-weight: 400; color: rgba(255,255,255,0.35); letter-spacing: 0.06em; text-transform: uppercase; }
  .pillar-streak { font-size: 11px; font-weight: 400; color: var(--gold); letter-spacing: 0.06em; }
  .pillar-chevron { font-size: 20px; color: rgba(255,255,255,0.35); flex-shrink: 0; transition: all 0.2s ease; }

  /* ===================== */
  /* PRO GLOBAL INPUT BAR  */
  /* ===================== */
  /* Mobile: input bar fixed at very bottom */
  .global-input-bar {
    position: fixed;
    bottom: 20px;
    left: 0;
    right: 0;
    padding: 0 12px;
    background: transparent;
    flex-direction: column;
    gap: 0;
    z-index: 100;
    transition: bottom 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .global-input-bar.pinned-bottom {
    bottom: 20px;
    padding: 0 12px;
  }

  .input-idle-row {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .input-idle {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #151823;
    border: 1px solid rgba(255,255,255,0.13);
    border-radius: 32px;
    padding: 12px 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    min-width: 0;
    overflow: hidden;
  }

  .input-idle:hover { background: rgba(255,255,255,0.09); border-color: rgba(255,255,255,0.20); }
  .input-idle.hidden { display: none; }

  .input-placeholder {
    flex: 1;
    font-size: 14px;
    color: rgba(255,255,255,0.55);
    font-weight: 300;
    font-style: normal;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .input-icons { display: flex; gap: 8px; align-items: center; }

  .icon-btn {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: transparent;
    border: none;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.8;
  }

  .icon-btn:hover { opacity: 1; }
  .icon-btn svg { width: 20px; height: 20px; }

  .send-circle svg { width: 20px; height: 20px; }

  .avatar-btn svg { width: 20px; height: 20px; }

  .upload-btn svg { width: 14px; height: 14px; vertical-align: middle; }

  .pillar-send-btn svg { width: 20px; height: 20px; }

  .send-circle {
    width: 48px; height: 48px;
    border-radius: 50%;
    background: var(--gold);
    border: none;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  }

  .send-circle:hover { transform: scale(1.12); box-shadow: 0 8px 28px rgba(0,0,0,0.25); }

  /* Recording state — pulse animation on mic circle */
  @keyframes mic-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,80,80,0.5), 0 4px 16px rgba(0,0,0,0.15); }
    50%       { box-shadow: 0 0 0 10px rgba(255,80,80,0), 0 4px 16px rgba(0,0,0,0.15); }
  }
  .send-circle.recording {
    background: var(--record);
    animation: mic-pulse 1.2s ease-in-out infinite;
  }
  .send-circle.recording svg path,
  .send-circle.recording svg rect,
  .send-circle.recording svg line { stroke: white; fill: white; }

  /* Upload progress bar */
  .upload-progress-track {
    height: 3px; background: rgba(255,255,255,0.10);
    border-radius: 2px; overflow: hidden;
  }
  .upload-progress-fill {
    height: 100%; background: var(--gold); width: 0%;
    transition: width 0.15s ease; border-radius: 2px;
  }
  .upload-progress-label {
    font-size: 11px; color: rgba(255,255,255,0.35);
    text-align: right; margin-top: 3px;
  }
  .upload-cancel-btn {
    background: none; border: none; color: rgba(255,255,255,0.35);
    font-size: 11px; cursor: pointer; padding: 0; line-height: 1;
    flex-shrink: 0; transition: color 0.15s;
  }
  .upload-cancel-btn:hover { color: #ffffff; }
  /* Voice recording word counter */
  .voice-word-count {
    font-size: 11px; color: rgba(255,255,255,0.35);
    text-align: right; padding: 2px 2px 0;
  }

  /* Media preview chips in the composer */
  #journal-media-preview {
    display: none; flex-wrap: wrap; gap: 8px; padding: 6px 4px 2px;
  }
  .media-chip {
    position: relative; border-radius: 10px; overflow: hidden;
    border: 1px solid rgba(255,255,255,0.11); flex-shrink: 0;
  }
  .media-chip-thumb {
    width: 64px; height: 64px; object-fit: cover; display: block;
  }
  .media-chip-file {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 10px; background: rgba(255,255,255,0.07);
    max-width: 160px;
  }
  .media-chip-file span {
    font-size: 11px; color: rgba(255,255,255,0.55);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .media-chip-remove {
    position: absolute; top: 3px; right: 3px;
    width: 18px; height: 18px; border-radius: 50%;
    background: rgba(0,0,0,0.6); border: none; color: #ffffff;
    font-size: 9px; cursor: pointer; display: flex; align-items: center; justify-content: center;
    line-height: 1;
  }
  .media-chip-file .media-chip-remove { position: static; margin-left: 4px; flex-shrink: 0; }

  /* Attachments rendered inside journal entries */
  .entry-attachments {
    display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px;
  }
  .entry-att-img {
    max-width: 100%; max-height: 320px; border-radius: 10px;
    object-fit: cover; cursor: pointer; display: block;
  }
  .entry-att-video {
    max-width: 100%; max-height: 280px; border-radius: 10px; display: block;
  }
  .entry-att-audio {
    width: 100%; border-radius: 10px;
    accent-color: rgba(255,255,255,0.55);
  }

  /* Expanded state - same pill, textarea inside */
  .input-expanded {
    display: none;
    flex-direction: row;
    align-items: flex-end;
    gap: 12px;
  }

  .input-expanded.active { display: flex; }

  .input-expanded-pill {
    flex: 1;
    background: #151823;
    border: 1px solid rgba(255,255,255,0.13);
    border-radius: 24px;
    padding: 12px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .input-textarea {
    width: 100%;
    background: transparent;
    border: none;
    padding: 0;
    font-family: 'Google Sans', sans-serif;
    font-size: 15px;
    color: #ffffff;
    resize: none;
    min-height: 44px;
    max-height: 120px;
    line-height: 1.5;
    outline: none;
  }

  .input-textarea::placeholder { color: rgba(255,255,255,0.35); font-style: normal; }

  .input-actions-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .upload-btns { display: flex; gap: 8px; }

  .upload-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 12px;
    color: rgba(255,255,255,0.55);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Google Sans', sans-serif;
  }

  .upload-btn:hover { background: rgba(255,255,255,0.11); border-color: rgba(255,255,255,0.20); }

  /* Attachment chips */
  .idle-attachment-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
    align-items: center;
  }

  .attachment-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 12px;
    color: #ffffff;
    font-family: 'Google Sans', sans-serif;
    max-width: 160px;
    white-space: nowrap;
    overflow: hidden;
  }

  .attachment-chip span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .attachment-remove {
    cursor: pointer;
    font-size: 14px;
    opacity: 0.7;
    flex-shrink: 0;
    line-height: 1;
  }

  .attachment-remove:hover { opacity: 1; }

  .btn-send { display: none; }

  .processing-row {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(154,111,53,0.06);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 13px;
    color: var(--gold);
  }

  .processing-row.active { display: flex; }

  .dots span {
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--gold);
    display: inline-block;
    margin-right: 3px;
    animation: bounce 1.2s ease-in-out infinite;
  }

  .dots span:nth-child(2) { animation-delay: 0.2s; }
  .dots span:nth-child(3) { animation-delay: 0.4s; }

  @keyframes bounce {
    0%, 80%, 100% { transform: scale(0.5); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
  }

  /* ===================== */
  /* PILLAR DETAIL         */
  /* ===================== */
  #page-detail { overflow: hidden; display: flex; flex-direction: column; z-index: 10; height: 100%; min-height: 0; }

  .detail-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
    height: 60px;
    min-height: 60px;
    border-bottom: none;
    flex-shrink: 0;
    background: var(--bg);
  }

  .back-btn {
    font-size: 22px;
    color: #ffffff;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px 4px 0;
  }

  .detail-icon { font-size: 20px; }

  .detail-info { flex: 1; display: flex; align-items: baseline; gap: 8px; }

  .detail-name {
    font-family: 'Google Sans', sans-serif;
    font-size: 15px;
    font-weight: 500;
    line-height: 1;
    color: #ffffff;
    letter-spacing: -0.02em;
  }

  .detail-count { font-size: 11px; font-weight: 400; color: rgba(255,255,255,0.35); letter-spacing: 0.06em; text-transform: uppercase; }

  .detail-stream {
    flex: 1;
    overflow-y: auto;
    padding: 16px 16px 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
  }

  .detail-stream::-webkit-scrollbar { display: none; }

  .empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px;
    text-align: center;
  }

  .empty-icon { font-size: 48px; opacity: 0.4; }

  .empty-title {
    font-family: 'Google Sans', sans-serif;
    font-size: 20px;
    font-weight: 400;
    color: var(--text3);
  }

  .empty-body { font-size: 14px; color: var(--text3); font-weight: 300; line-height: 1.6; }

  /* Chat entry */
  .date-badge {
    font-size: 12px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.35);
    text-align: center;
    margin: 12px 0 6px;
    font-family: 'Google Sans', sans-serif;
    font-weight: 500;
  }

  .chat-entry { display: flex; flex-direction: column; gap: 8px; }

  .user-bubble {
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.11);
    border-radius: 16px 16px 4px 16px;
    padding: 16px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
  }

  .user-bubble:hover { background: var(--surface2); }

  .bubble-text {
    font-size: var(--fs-body);
    color: var(--text);
    line-height: 1.5;
    font-weight: 300;
  }

  .bubble-preview {
    font-size: 14px;
    color: rgba(255,255,255,0.55);
    font-weight: 300;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .bubble-preview { display: none; }

  /* Plain AI response — no box, just flowing text */
  .entry-ai-text {
    font-size: var(--fs-body);
    color: var(--text2);
    line-height: 1.85;
    font-weight: 300;
    padding: 2px 4px 0;
  }

  .entry-view-original { padding: 6px 4px 4px; }
  .view-link {
    font-size: 12px;
    color: rgba(255,255,255,0.35);
    letter-spacing: 0.4px;
    cursor: pointer;
    transition: color 0.2s ease;
    font-family: 'Google Sans', sans-serif;
  }
  .view-link:hover { color: rgba(255,255,255,0.55); }

  /* Pillar write input bar */
  .pillar-input-bar {
    display: none;
  }

  .pillar-input-row {
    display: flex;
    gap: 12px;
    align-items: center;
  }

  .pillar-textarea {
    flex: 1;
    background: #151823;
    border: 1px solid rgba(255,255,255,0.13);
    border-radius: 32px;
    padding: 14px 20px;
    font-family: 'Google Sans', sans-serif;
    font-size: 15px;
    color: #ffffff;
    resize: none;
    min-height: 48px;
    max-height: 120px;
    line-height: 1.5;
    outline: none;
    overflow-y: auto;
  }

  .pillar-textarea::placeholder { color: rgba(255,255,255,0.35); font-style: italic; }
  .pillar-textarea:focus { border-color: rgba(255,255,255,0.20); outline: none; }

  .pillar-send-btn {
    width: 48px; height: 48px;
    border-radius: 50%;
    background: var(--gold);
    border: none;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    color: white;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  }

  .pillar-send-btn:hover { transform: scale(1.08); box-shadow: 0 6px 24px rgba(0,0,0,0.2); }
  .pillar-send-btn:disabled { opacity: 0.5; cursor: not-allowed; }

  /* ===================== */
  /* PROFILE PAGE          */
  /* ===================== */
  #page-profile {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  #page-profile .top-bar { border-bottom: none; }
  #page-profile .app-name { font-size: 33px; }

  .profile-signout-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 50px;
    color: var(--text2);
    font-size: 12px;
    font-family: 'Google Sans', sans-serif;
    padding: 4px 12px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
  }
  .profile-signout-btn:hover { background: rgba(255,255,255,0.05); }

  .profile-content { padding: 24px 16px 40px; flex: 1; overflow-y: auto; scrollbar-width: none; }
  .profile-content::-webkit-scrollbar { display: none; }

  .profile-section { margin-bottom: 32px; }

  .section-label {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.35);
    margin-bottom: 14px;
  }

  .profile-card {
    background: #151823;
    border-radius: 28px;
    overflow: hidden;
  }

  .profile-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s ease;
  }

  .profile-item:not(:last-child)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20px;
    right: 20px;
    height: 1px;
    background: var(--border2);
  }

  .profile-item:last-child { border-bottom: none; }
  .profile-item:hover { background: rgba(255,255,255,0.04); }

  .profile-item-left { display: flex; align-items: center; gap: 12px; }
  .profile-item-icon { font-size: 16px; width: 24px; text-align: center; }
  .profile-item-label { font-size: 14px; font-weight: 300; color: #ffffff; }
  .profile-item-value { font-size: 13px; font-weight: 400; color: rgba(255,255,255,0.55); }
  .profile-item-chevron { font-size: 16px; color: var(--text3); }

  .plan-badge-free {
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text3);
    background: var(--surface);
    border: 1px solid var(--border2);
    border-radius: 10px;
    padding: 3px 10px;
  }

  .plan-badge-pro {
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #93c5fd;
    background: rgba(59,130,246,0.12);
    border: 1px solid rgba(59,130,246,0.30);
    border-radius: 10px;
    padding: 3px 10px;
  }

  .btn-logout {
    width: 100%;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: 14px;
    font-family: 'Google Sans', sans-serif;
    font-size: 15px;
    color: var(--text2);
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 1px;
  }

  .btn-logout:hover { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.13); }

  .btn-delete-account {
    width: 100%;
    background: transparent;
    border: 1px solid var(--danger-border);
    border-radius: 28px;
    padding: 14px 20px;
    color: var(--danger);
    font-size: 14px;
    font-family: 'Google Sans', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.5px;
    margin-top: 8px;
  }
  .btn-delete-account:hover { background: var(--danger-dim); border-color: var(--danger-border); }

  /* ===================== */
  /* UPGRADE MODAL         */
  /* ===================== */
  .modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    z-index: 300;
    align-items: flex-end;
    justify-content: center;
    backdrop-filter: blur(4px);
  }

  .modal-overlay.active { display: flex; }

  .modal-sheet {
    width: 100%;
    max-width: 480px;
    background: #12121F;
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border-radius: 28px 28px 0 0;
    border: 1px solid rgba(255,255,255,0.09);
    border-bottom: none;
    padding: 28px 28px calc(32px + var(--safe-bottom));
    animation: slideUp 0.3s ease both;
  }

  @keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }

  .modal-handle {
    width: 40px; height: 4px;
    background: rgba(255,255,255,0.12);
    border-radius: 2px;
    margin: 0 auto 24px;
  }

  .modal-title {
    font-family: 'Google Sans', sans-serif;
    font-size: 28px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 8px;
  }

  .modal-title em { font-style: italic; color: rgba(255,255,255,0.55); font-weight: 400; }

  .modal-sub { font-size: 14px; color: rgba(255,255,255,0.35); font-weight: 300; margin-bottom: 28px; line-height: 1.65; }

  .modal-features { display: flex; flex-direction: column; gap: 13px; margin-bottom: 28px; }

  .modal-feature {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 14px;
    color: rgba(255,255,255,0.55);
    font-weight: 300;
    line-height: 1.5;
  }

  .modal-feature-icon { font-size: 18px; flex-shrink: 0; }

  .modal-price {
    text-align: center;
    margin-bottom: 20px;
  }

  .modal-price-num {
    font-family: 'Google Sans', sans-serif;
    font-size: 52px;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
  }

  .modal-price-num sup { font-size: 22px; vertical-align: top; margin-top: 12px; display: inline-block; }
  .modal-price-period { font-size: 13px; color: rgba(255,255,255,0.35); margin-top: 4px; }

  .btn-upgrade {
    width: 100%;
    background: #3B82F6;
    color: white;
    border: none;
    border-radius: 50px;
    padding: 16px;
    font-family: 'Google Sans', sans-serif;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 12px;
    transition: background 0.2s ease;
    box-shadow: 0 8px 32px rgba(59,130,246,0.25);
  }

  .btn-upgrade:hover { background: #2563eb; }

  /* Billing toggle inside upgrade modal */
  .modal-billing-toggle {
    display: flex;
    background: var(--surface2);
    border-radius: 50px;
    padding: 4px;
    gap: 2px;
    margin-bottom: 20px;
  }
  .modal-billing-btn {
    flex: 1;
    padding: 9px 16px;
    border-radius: 40px;
    border: none;
    cursor: pointer;
    background: transparent;
    color: var(--text2);
    font-family: 'Google Sans', sans-serif;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
    white-space: nowrap;
  }
  .modal-billing-btn.active { background: #3B82F6; color: white; }
  .modal-billing-save {
    display: inline-block;
    background: #16a34a;
    color: white;
    font-size: 9px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 6px;
    margin-left: 4px;
    vertical-align: middle;
  }

  .modal-cancel {
    text-align: center;
    font-size: 13px;
    color: rgba(255,255,255,0.20);
    cursor: pointer;
    padding: 8px;
  }
  .modal-cancel:hover { color: rgba(255,255,255,0.55); }

  /* ===================== */
  /* TOAST                 */
  /* ===================== */
  .toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 20px;
    font-size: 13px;
    color: var(--ink);
    z-index: 200;
    opacity: 0;
    transition: all 0.3s ease;
    white-space: nowrap;
    pointer-events: none;
  }

  .toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

  /* ===================== */
  /* LOADING               */
  /* ===================== */
  .loading-screen {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
    z-index: 300;
    transition: opacity 0.5s ease;
  }

  .loading-screen.hidden { opacity: 0; pointer-events: none; }

  .loading-logo { display: flex; align-items: center; justify-content: center; }
  .loading-icon { width: 64px; height: 64px; object-fit: contain; }

  .loading-dots { display: flex; gap: 6px; }
  .loading-dots span { width: 6px; height: 6px; border-radius: 50%; background: rgba(59,130,246,0.5); animation: bounce 1.2s ease-in-out infinite; }
  .loading-dots span:nth-child(2) { animation-delay: 0.2s; }
  .loading-dots span:nth-child(3) { animation-delay: 0.4s; }

  .session-saving-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 20px 16px;
    gap: 10px;
  }
  .session-saving-logo {
    font-family: 'Caveat', cursive;
    font-size: 80px;
    font-style: italic;
    color: #ffffff;
    line-height: 1;
  }

  /* Animations */
  @keyframes fadeDown { from { opacity: 0; transform: translateY(-16px); } to { opacity: 1; transform: translateY(0); } }
  @keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
  @keyframes flashBorder { 0% { border-color: var(--border2); } 50% { border-color: rgba(154,111,53,0.7); box-shadow: 0 0 20px rgba(154,111,53,0.15); } 100% { border-color: var(--border2); } }
  .pillar-row.flash { animation: flashBorder 1.2s ease forwards; }

  @media (min-width: 768px) {
    .top-bar { padding: 0 48px; height: 64px; }

    #page-pillars {
      overflow: hidden;
      display: flex;
      flex-direction: column;
      justify-content: flex-start;
    }

    .pillars-center-wrap {
      flex: 1;
      display: flex;
      flex-direction: column;
      justify-content: center;
      gap: 100px;
    }

    .pillar-scroll {
      flex: 0 0 auto;
      flex-direction: row;
      flex-wrap: nowrap;
      padding: 0 32px;
      gap: 16px;
      justify-content: center;
      align-items: stretch;
      overflow: visible;
    }

    .pillar-row {
      flex: 1;
      max-width: 220px;
      min-width: 140px;
      flex-direction: column;
      align-items: flex-start;
      padding: 24px 20px;
      border-radius: 20px;
      gap: 12px;
      min-height: 160px;
      max-height: 200px;
      justify-content: flex-start;
    }

    .pillar-row::before {
      width: 100%;
      height: 2px;
      top: 0; left: 0; right: 0; bottom: auto;
      border-radius: 20px 20px 0 0;
    }

    .pillar-emoji { font-size: 28px; }
    .pillar-info { width: 100%; }
    .pillar-chevron { display: none; }
    .pillar-preview { display: block; white-space: normal; font-size: 13px; }
    .pillar-meta { display: none; }
    .pillar-count { display: none; }

    .global-input-bar {
      bottom: 22%;
      padding: 0 32%;
    }

    .global-input-bar.pinned-bottom {
      bottom: 24px;
      padding: 0 32%;
    }

    /* No fade on desktop */
    #page-pillars::after { display: none; }

    .chat-list { padding: 32px 32%; }
    .chat-scroll { padding: 32px 32%; }
    .pillar-input-bar { padding: 16px 25% 32px; }
  }

  /* ===================== */
  /* TOP BAR BTN           */
  /* ===================== */
  .top-bar-btn {
    width: 36px; height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.16);
    background: rgba(255,255,255,0.07);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
  }
  .top-bar-btn:hover { background: rgba(255,255,255,0.12); }
  .top-bar-btn svg { width: 18px; height: 18px; }

  /* ===================== */
  /* JOURNAL PAGE          */
  /* ===================== */
  #page-journal { overflow: hidden; display: flex; flex-direction: column; }

  .journal-stream {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 16px 140px;
    scroll-padding-top: 0;
    display: flex;
    flex-direction: column;
    gap: 32px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .journal-stream::-webkit-scrollbar { display: none; }

  /* ── Weekly horizontal scroller ── */
  .weekly-horizontal {
    display: flex;
    flex-direction: row;
    gap: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
    overscroll-behavior: none;
    flex: 1 1 0;
    min-height: 0;
  }
  .weekly-horizontal::-webkit-scrollbar { display: none; }

  /* ── Weekly feed sections — each card fills 100% of the scroller ── */
  .week-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
    padding: 18px 8px 24px;
    flex: 0 0 100%;
    width: 100%;
    background: transparent;
    border: none;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }
  .week-label {
    font-size: 13px;
    letter-spacing: 0.2px;
    color: rgba(255,255,255,0.45);
    font-family: 'Google Sans', sans-serif;
    font-weight: 400;
    text-align: center;
    width: 100%;
  }
  .week-emotions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 20px 18px;
    /* Top + bottom padding absorbs the translateY floats of the large emojis
       (up to ±12px) so they never overlap the label above or summary below. */
    padding: 20px 4px 20px;
    min-height: 88px;
    width: 100%;
  }
  .week-emotion {
    --emotion-scale: 1;
    --emotion-offset: 0px;
    display: inline-block;
    line-height: 1;
    filter: saturate(1.05);
    transform: translateY(var(--emotion-offset)) scale(var(--emotion-scale));
    transform-origin: center;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }
  .week-emotion.size-small  { font-size: 22px; opacity: 0.75; }
  .week-emotion.size-medium { font-size: 38px; opacity: 0.9; }
  .week-emotion.size-large  { font-size: 58px; opacity: 1; }
  .week-emotion.positive.size-small  { --emotion-offset: -4px; }
  .week-emotion.negative.size-small  { --emotion-offset: 4px; }
  .week-emotion.positive.size-medium { --emotion-offset: -8px; }
  .week-emotion.negative.size-medium { --emotion-offset: 8px; }
  .week-emotion.positive.size-large  { --emotion-offset: -12px; }
  .week-emotion.negative.size-large  { --emotion-offset: 12px; }
  .week-summary {
    font-size: 15px;
    line-height: 1.55;
    color: rgba(255,255,255,0.82);
    font-family: 'Google Sans', sans-serif;
    font-weight: 300;
    text-align: center;
    width: 100%;
    /* Reserve ~3 lines to avoid layout jump when summary loads */
    min-height: calc(1.55em * 3);
  }
  .week-summary.loading {
    color: rgba(255,255,255,0.35);
    font-style: italic;
  }
  .week-entries-toggle {
    background: none;
    border: none;
    color: rgba(255,255,255,0.42);
    font-size: 13px;
    font-family: 'Google Sans', sans-serif;
    cursor: pointer;
    padding: 0;
    align-self: center;
    transition: color 0.15s;
  }
  .week-entries-toggle:hover { color: rgba(255,255,255,0.65); }

  /* ── Pillar sections inside the entries panel ── */
  .pillar-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }
  .pillar-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }
  .pillar-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
  }
  .pillar-section-label {
    font-size: 13px;
    color: rgba(255,255,255,0.5);
    font-family: 'Google Sans', sans-serif;
    font-weight: 500;
    white-space: nowrap;
  }
  .pillar-section-emos {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
  }
  .pillar-emo { display: inline-block; line-height: 1; }
  .pillar-emo.pemo-sm { font-size: 14px; }
  .pillar-emo.pemo-md { font-size: 18px; }
  .pillar-emo.pemo-lg { font-size: 22px; }
  .pillar-summary {
    font-size: 14px;
    line-height: 1.5;
    color: rgba(255,255,255,0.72);
    font-family: 'Google Sans', sans-serif;
    font-weight: 300;
    padding-left: 0;
    text-align: left;
    min-height: calc(1.5em * 2);
  }
  .pillar-summary.loading {
    color: rgba(255,255,255,0.3);
    font-style: italic;
  }

  /* ── Week detail page ── */
  .week-detail-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 20px 40px;
    display: flex;
    flex-direction: column;
    gap: 28px;
  }

  /* ── Scroller wrapper with desktop arrows ── */
  .weekly-scroller-wrap {
    display: flex;
    align-items: center;
    flex: 1 1 0;
    min-height: 0;
    position: relative;
  }
  .week-arrow {
    display: none; /* hidden on mobile */
    background: none;
    border: none;
    color: rgba(255,255,255,0.35);
    font-size: 32px;
    cursor: pointer;
    padding: 8px;
    flex-shrink: 0;
    transition: color 0.15s, visibility 0.15s;
    line-height: 1;
    visibility: hidden; /* shown by JS when navigable */
  }
  .week-arrow:hover { color: rgba(255,255,255,0.7); }

  .week-empty-prompt {
    font-size: 16px;
    color: rgba(255,255,255,0.4);
    font-family: 'Google Sans', sans-serif;
    font-weight: 300;
    text-align: center;
    padding: 40px 0;
  }

  /* Journal entry - user words */
  .journal-entry {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .journal-entry-header {
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.35);
    padding: 0 0 12px 0;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
  }

  /* Entry action menu */
  .entry-menu-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.35);
    font-size: 16px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 6px;
    line-height: 1;
    letter-spacing: 1px;
    transition: color 0.2s ease, background 0.2s ease;
    text-transform: none;
    font-family: 'Google Sans', sans-serif;
  }
  .entry-menu-btn:hover { color: rgba(255,255,255,0.55); background: #12121F; }

  .entry-menu-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: var(--surface);
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 10px;
    backdrop-filter: blur(12px);
    min-width: 130px;
    z-index: 100;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  }
  .entry-menu-dropdown.open { display: block; }

  .entry-menu-item {
    padding: 11px 16px;
    font-size: 14px;
    color: rgba(255,255,255,0.55);
    cursor: pointer;
    font-family: 'Google Sans', sans-serif;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    transition: background 0.15s ease;
  }
  .entry-menu-item:hover { background: #12121F; }
  .entry-menu-item.danger { color: var(--danger); }
  .entry-menu-item.danger:hover { background: var(--danger-dim); }

  /* Inline edit mode */
  .journal-edit-textarea {
    width: 100%;
    background: transparent;
    border: none;
    font-family: 'Google Sans', sans-serif;
    font-size: 15px;
    font-weight: 300;
    color: #ffffff;
    resize: none;
    min-height: 80px;
    line-height: 1.75;
    outline: none;
  }
  .journal-edit-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
  }
  .journal-edit-save {
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.14);
    color: #ffffff;
    border-radius: 20px;
    padding: 5px 16px;
    font-size: 13px;
    font-family: 'Google Sans', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
  }
  .journal-edit-save:hover { background: rgba(255,255,255,0.13); }
  .journal-edit-cancel {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.09);
    color: rgba(255,255,255,0.35);
    border-radius: 20px;
    padding: 5px 16px;
    font-size: 13px;
    font-family: 'Google Sans', sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
  }
  .journal-edit-cancel:hover { color: rgba(255,255,255,0.55); }

  .journal-entry-body {
    background: #151823;
    border: none;
    border-radius: 28px;
    padding: 18px 20px;
    transition: background 0.2s ease;
    position: relative;
  }
  .journal-entry-body.clamped {
    max-height: 240px;
    overflow: hidden;
    padding-bottom: 56px;
  }
  .journal-entry-body.clamped::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to bottom, transparent, #151823 55%);
    border-radius: 0 0 28px 28px;
    pointer-events: none;
  }
  .journal-entry-body.clamped.expanded {
    max-height: none;
    overflow: visible;
    padding-bottom: 18px;
  }
  .journal-entry-body.clamped.expanded::after {
    display: none;
  }
  .journal-entry-body.clamped.expanded .read-more-btn {
    position: static;
    margin-top: 12px;
  }

  /* Question shown above the user's answer when entry came from a prompt */
  .journal-entry-question {
    font-size: 14px;
    color: rgba(255,255,255,0.35);
    font-style: italic;
    line-height: 1.6;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }

  .journal-entry-text {
    font-size: var(--fs-body);
    color: var(--text);
    line-height: 1.5;
    font-weight: 300;
    white-space: pre-wrap;
  }
  .journal-entry-text.truncated {
    /* Truncation now handled by .journal-entry-body max-height + fade */
  }
  .journal-entry-text.truncated.expanded {
  }
  .read-more-btn {
    position: absolute;
    bottom: 16px;
    left: 20px;
    z-index: 2;
    background: none;
    border: none;
    color: #3B82F6;
    font-size: 13px;
    font-family: 'Google Sans', sans-serif;
    font-weight: 600;
    letter-spacing: 0.4px;
    cursor: pointer;
    padding: 0;
    text-align: left;
    transition: color 0.2s ease;
  }
  .read-more-btn:hover { color: #60A5FA; }

  /* AI response (legacy wrapper — kept for pillar detail stream compat) */
  .journal-ai-response {
    margin-top: 10px;
    margin-left: 0;
    padding: 2px 0 0 16px;
    border-left: 2px solid #12121F;
  }

  .journal-ai-text {
    font-size: var(--fs-body);
    color: rgba(255,255,255,0.55);
    line-height: 1.5;
    font-weight: 300;
  }
  .journal-ai-text p { margin: 0; }
  .journal-ai-text p + p { margin-top: 12px; }

  /* Pillar pills after AI response */
  .journal-pillar-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
  }

  .pillar-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #12121F;
    border: 1px solid rgba(255,255,255,0.11);
    border-radius: 20px;
    padding: 10px 20px;
    font-size: 12px;
    color: rgba(255,255,255,0.55);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Google Sans', sans-serif;
  }
  .pillar-pill:hover { background: rgba(255,255,255,0.10); border-color: rgba(255,255,255,0.16); }
  .pillar-pill-dim { background: transparent; border-color: transparent; color: rgba(255,255,255,0.35); opacity: 1; }
  .pillar-pill-dim:hover { background: rgba(255,255,255,0.05); border-color: transparent; color: rgba(255,255,255,0.55); }

  /* Pillar pill loading / resolved states */
  .pillar-pill.loading {
    animation: pill-pulse 1.5s ease-in-out infinite;
    opacity: 0.5;
    pointer-events: none;
  }
  @keyframes pill-pulse {
    0%, 100% { opacity: 0.35; }
    50% { opacity: 0.65; }
  }
  .pillar-pill.matched {
    opacity: 1;
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.4);
    animation: none;
    pointer-events: auto;
  }
  .pillar-pill.unmatched {
    opacity: 0.2;
    animation: none;
    pointer-events: auto;
  }

  /* Per-pillar gradients — placed after .matched/.unmatched so they always win the cascade */
  .pillar-pill[data-pillar="relationships"] {
    background: linear-gradient(135deg, rgba(251,191,36,0.12) 0%, rgba(217,119,6,0.05) 100%);
    border-color: rgba(251,191,36,0.18);
    color: rgba(255,255,255,0.92);
  }
  .pillar-pill[data-pillar="purpose"] {
    background: linear-gradient(135deg, rgba(239,68,68,0.11) 0%, rgba(185,28,28,0.04) 100%);
    border-color: rgba(239,68,68,0.18);
    color: rgba(255,255,255,0.92);
  }
  .pillar-pill[data-pillar="mindbody"] {
    background: linear-gradient(135deg, rgba(34,197,94,0.10) 0%, rgba(21,128,61,0.04) 100%);
    border-color: rgba(34,197,94,0.17);
    color: rgba(255,255,255,0.92);
  }
  .pillar-pill[data-pillar="growth"] {
    background: linear-gradient(135deg, rgba(59,130,246,0.10) 0%, rgba(29,78,216,0.04) 100%);
    border-color: rgba(59,130,246,0.17);
    color: rgba(255,255,255,0.92);
  }
  .pillar-pill[data-pillar="finances"] {
    background: linear-gradient(135deg, rgba(234,179,8,0.11) 0%, rgba(161,98,7,0.04) 100%);
    border-color: rgba(234,179,8,0.18);
    color: rgba(255,255,255,0.92);
  }
  .pillar-pill[data-pillar="joy"] {
    background: linear-gradient(135deg, rgba(167,139,250,0.12) 0%, rgba(124,58,237,0.05) 100%);
    border-color: rgba(167,139,250,0.19);
    color: rgba(255,255,255,0.92);
  }

  /* Dim pills (unmatched in renderJournal) — keep pill shape but fade right out */
  .pillar-pill.pillar-pill-dim[data-pillar="relationships"],
  .pillar-pill.pillar-pill-dim[data-pillar="purpose"],
  .pillar-pill.pillar-pill-dim[data-pillar="mindbody"],
  .pillar-pill.pillar-pill-dim[data-pillar="growth"],
  .pillar-pill.pillar-pill-dim[data-pillar="finances"],
  .pillar-pill.pillar-pill-dim[data-pillar="joy"] { opacity: 0.25; background: transparent; border-color: transparent; }

  /* Onboarding page */
  .onboarding-stream {
    flex: 1;
    overflow-y: auto;
    padding: 20px 16px 40px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scrollbar-width: none;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
  }
  .onboarding-stream::-webkit-scrollbar { display: none; }
  .onboarding-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 20px 22px;
    font-size: 15px;
    font-weight: 400;
    color: var(--text2);
    line-height: 1.75;
  }
  .onboarding-card-title {
    font-family: 'Google Sans', sans-serif;
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
  }
  .onboarding-nav {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 8px 0 4px;
  }
  .onboarding-btn {
    background: transparent;
    border: 1.5px solid var(--border);
    border-radius: 24px;
    padding: 10px 24px;
    font-family: 'Google Sans', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: var(--text2);
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease;
  }
  .onboarding-btn:hover { border-color: var(--text); color: var(--text); }
  .onboarding-btn.primary { border-color: var(--gold); color: var(--gold); font-weight: 600; }
  .onboarding-btn.primary:hover { background: var(--gold); color: #fff; }
  /* Step 3 pillar pills */
  .onboarding-pillars-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 4px 0 8px;
  }
  .onboarding-pill { cursor: pointer; opacity: 0.7; transition: opacity 0.2s ease; }
  .onboarding-pill:hover { opacity: 1; }
  .onboarding-pill.visited { opacity: 1; border-color: var(--gold); color: var(--gold); }
  /* Visited pillar highlight during onboarding */
  .pillar-row.onboarding-visited::before { opacity: 1; background: var(--gold); }
  /* Onboarding — pillar detail description card */
  .onboarding-ir-card {
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 16px;
    padding: 20px 24px;
    font-size: 15px;
    font-weight: 400;
    color: var(--text2);
    line-height: 1.75;
    background: transparent;
  }

  /* Pagination load-more indicator */
  .journal-load-more {
    text-align: center;
    padding: 12px;
    font-size: 13px;
    color: rgba(255,255,255,0.3);
    font-family: 'Google Sans', sans-serif;
  }

  /* Empty journal state */
  .journal-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px 32px;
    text-align: center;
  }
  .journal-empty-title {
    font-family: 'Google Sans', sans-serif;
    font-size: 28px;
    color: rgba(255,255,255,0.55);
  }
  .journal-skeleton-entry {
    padding: 16px 20px;
    margin-bottom: 12px;
    border-radius: 14px;
    background: rgba(255,255,255,0.03);
  }
  .skeleton-line {
    height: 11px;
    border-radius: 6px;
    background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.09) 50%, rgba(255,255,255,0.04) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.4s ease-in-out infinite;
    margin-bottom: 9px;
    width: 100%;
  }
  .skeleton-line-short { width: 28%; }
  .skeleton-line-medium { width: 55%; margin-bottom: 0; }
  @keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
  }
  .journal-empty-sub {
    font-size: 14px;
    color: rgba(255,255,255,0.35);
    font-weight: 300;
    line-height: 1.6;
  }

  /* ===================== */
  /* PROMPT SUGGESTIONS    */
  /* ===================== */
  .prompt-suggestions {
    padding: 0 16px 10px;
    animation: fadeUp 0.3s ease both;
  }

  .prompt-chips {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .prompt-chip {
    background: #12121F;
    border: 1px solid rgba(255,255,255,0.11);
    border-radius: 14px;
    padding: 12px 14px;
    font-size: 12px;
    font-weight: 400;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Google Sans', sans-serif;
    line-height: 1.4;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .prompt-chip:hover { background: var(--surface2); border-color: rgba(255,255,255,0.16); }
  .prompt-chip-emoji { font-size: 18px; flex-shrink: 0; }

  /* Step 2: pillar header + full-width option chips */
  .prompt-pillar-header {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    padding: 2px 2px 4px;
  }
  .prompt-back-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.35);
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px 0 0;
    line-height: 1;
    transition: color 0.2s ease;
    font-family: 'Google Sans', sans-serif;
  }
  .prompt-back-btn:hover { color: rgba(255,255,255,0.55); }
  .prompt-chip-option {
    grid-column: 1 / -1;
    justify-content: center;
    font-weight: 600;
    letter-spacing: 0.2px;
  }

  /* ===================== */
  /* JOURNAL INPUT BAR     */
  /* ===================== */
  .journal-input-bar {
    padding: 6px 0 var(--safe-bottom);
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
    background: linear-gradient(to top, var(--bg) 60%, transparent 100%);
  }

  .journal-not-sure {
    align-self: center;
    font-size: 12px;
    color: rgba(255,255,255,0.35);
    cursor: pointer;
    padding: 4px 12px;
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 20px;
    transition: all 0.2s ease;
    letter-spacing: 0.5px;
  }
  .journal-not-sure:hover { color: rgba(255,255,255,0.55); border-color: rgba(255,255,255,0.14); }

  .journal-input-row {
    display: flex;
    align-items: stretch;
  }

  .journal-input-pill {
    flex: 1;
    background: #151823;
    border: none;
    border-radius: 28px;
    padding: 12px 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .journal-textarea {
    width: 100%;
    background: transparent;
    border: none;
    font-family: 'Google Sans', sans-serif;
    font-size: 15px;
    font-weight: 400;
    color: #ffffff;
    resize: none;
    min-height: 36px;
    line-height: 1.5;
    outline: none;
    overflow: hidden;
    padding-left: 11px;
    padding-top: 11px;
  }
  .journal-textarea::placeholder { color: rgba(255,255,255,0.35); font-weight: 400; }

  /* Fix 1 & 3: shared color on row; mic pinned to right via margin-left: auto */
  .journal-actions-row { display: flex; align-items: center; gap: 4px; color: var(--text2); }
  .journal-actions-row .icon-btn { height: 46px; width: 46px; display: flex; align-items: center; justify-content: center; opacity: 0.75; }
  .journal-actions-row .icon-btn:hover { opacity: 1; }
  .journal-actions-row .send-circle {
    margin-left: auto;
    background: #0d0d1a;
    border: none;
    box-shadow: none;
  }

  /* Send/mic button when inside the journal pill — icon-sized */
  .journal-input-pill .send-circle {
    width: 50px; height: 50px;
    background: #0d0d1a;
    border-radius: 50%;
    box-shadow: none;
    opacity: 0.9;
    flex-shrink: 0;
  }
  .journal-input-pill .send-circle:hover { transform: none; box-shadow: none; background: rgba(255,255,255,0.07); opacity: 1; }
  .journal-input-pill .send-circle.recording { background: var(--record); color: white; opacity: 1; }

  /* Mic icon — white */
  #journal-icon-mic { color: rgba(255,255,255,0.9); }
  /* Send icon — stays neutral */
  #journal-icon-send { color: var(--text2); }

  /* ===================== */
  /* PILLAR INPUT BAR      */
  /* ===================== */
  .ir-prompt-suggestions {
    padding: 20px 16px 10px;
    animation: fadeUp 0.3s ease both;
  }

  .ir-suggestion-chips {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .ir-chip {
    background: #12121F;
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 14px;
    padding: 11px 16px;
    font-size: 14px;
    color: rgba(255,255,255,0.55);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Google Sans', sans-serif;
    line-height: 1.4;
  }
  .ir-chip:hover { background: rgba(255,255,255,0.09); border-color: rgba(255,255,255,0.14); }

  .ir-input-bar {
    padding: 6px 0 var(--safe-bottom);
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
    background: linear-gradient(to top, var(--bg) 60%, transparent 100%);
  }

  .ir-not-sure {
    align-self: center;
    font-size: 12px;
    color: rgba(255,255,255,0.35);
    cursor: pointer;
    padding: 4px 12px;
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 20px;
    transition: all 0.2s ease;
    letter-spacing: 0.5px;
  }
  .ir-not-sure:hover { color: rgba(255,255,255,0.55); border-color: rgba(255,255,255,0.14); }

  /* Free-user upgrade gate replacing IR input bar */
  .ir-upgrade-gate {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px 24px 32px;
    background: linear-gradient(to top, #0b0f1a 70%, transparent 100%);
    text-align: center;
  }
  .ir-gate-icon { font-size: 18px; color: rgba(255,255,255,0.20); }
  .ir-gate-text {
    font-size: 13px;
    color: rgba(255,255,255,0.35);
    line-height: 1.5;
  }
  .ir-gate-btn {
    background: #3B82F6;
    color: white;
    border: none;
    border-radius: 24px;
    padding: 10px 24px;
    font-family: 'Google Sans', sans-serif;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s;
  }
  .ir-gate-btn:hover { opacity: 0.88; }

  .ir-input-row { display: flex; align-items: center; }

  .ir-input-pill {
    flex: 1;
    background: #151823;
    border: none;
    border-radius: 28px;
    padding: 12px 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .ir-textarea {
    display: block;
    width: 100%;
    background: transparent;
    border: none;
    font-family: 'Google Sans', sans-serif;
    font-size: 15px;
    color: #ffffff;
    resize: none;
    min-height: 36px;
    line-height: 1.5;
    outline: none;
    overflow: hidden;
    padding-left: 11px;
    padding-top: 11px;
  }
  .ir-textarea::placeholder { color: rgba(255,255,255,0.35); }

  .ir-actions-row {
    display: flex;
    align-items: center;
  }
  .ir-input-pill .send-circle {
    width: 50px; height: 50px;
    background: #0d0d1a;
    border-radius: 50%;
    box-shadow: none;
    opacity: 0.9;
    flex-shrink: 0;
    margin-left: auto;
  }
  .ir-input-pill .send-circle:hover {
    transform: none;
    box-shadow: none;
    background: rgba(255,255,255,0.07);
    opacity: 1;
  }

  /* IR conversation messages — styled to match journal prompt/answer format */
  .ir-user-msg {
    position: relative;
    background: #12121F;
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 16px;
    padding: 12px 36px 12px 16px;
    font-size: 15px;
    color: #ffffff;
    line-height: 1.6;
    font-weight: 400;
    backdrop-filter: blur(8px);
  }
  .ir-delete-btn {
    position: absolute;
    top: 9px;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255,255,255,0.14);
    font-size: 13px;
    line-height: 1;
    padding: 2px 4px;
    border-radius: 6px;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s;
  }
  .ir-user-msg:hover .ir-delete-btn { opacity: 1; }
  .ir-delete-btn:hover { color: rgba(255,100,100,0.9); }

  .ir-ai-msg {
    padding: 4px 4px 4px 16px;
    border-left: 2px solid rgba(255,255,255,0.10);
    font-size: 15px;
    color: rgba(255,255,255,0.55);
    line-height: 1.6;
    font-weight: 300;
  }
  .ir-ai-msg.ir-collapsed {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .ir-chevron {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: none;
    border: none;
    color: rgba(255,255,255,0.3);
    cursor: pointer;
    padding: 2px;
    transition: transform 0.2s;
  }
  .ir-chevron.ir-chevron-open {
    transform: rotate(180deg);
  }

  .ir-thinking {
    padding: 4px 0 4px 14px;
    border-left: 2px solid rgba(255,255,255,0.07);
    display: flex;
    gap: 4px;
    align-items: center;
  }
  .ir-thinking span {
    width: 5px; height: 5px;
    border-radius: 50%;
    background: rgba(255,255,255,0.35);
    animation: bounce 1.2s ease-in-out infinite;
  }
  .ir-thinking span:nth-child(2) { animation-delay: 0.2s; }
  .ir-thinking span:nth-child(3) { animation-delay: 0.4s; }

  /* ===================== */
  /* DESKTOP JOURNAL       */
  /* ===================== */
  @media (min-width: 768px) {
    .journal-stream { padding: 0 33% 120px; scroll-padding-top: 0; }
    .week-arrow { display: block; }
    .week-detail-content { padding: 20px 33% 40px; }
    .journal-input-bar { padding: 8px 33% 28px; }
    .prompt-suggestions { padding: 0 33% 10px; }
    .detail-stream { padding: 24px 33% 24px; }
    .ir-input-bar { padding: 8px 33% 28px; }
    .ir-prompt-suggestions { padding: 20px 33% 10px; }
    .profile-content { padding: 24px 33% 40px; }
    .onboarding-stream { padding: 24px 33% 16px; }
    .onboarding-nav { padding: 20px 0 32px; }
  }

  /* Typewriter cursor */
  .journal-typewriter::after {
    content: '|';
    animation: blink 0.7s step-end infinite;
    opacity: 0.7;
    margin-left: 1px;
  }
  @keyframes blink { 0%, 100% { opacity: 0.7; } 50% { opacity: 0; } }

  /* Static variant — no blinking cursor (used when restoring a question on refresh) */
  .journal-typewriter.journal-typewriter-static::after { display: none; }

  /* Prompt bubble styling - slightly distinct from regular entry */
  .journal-prompt-bubble {
    border-color: rgba(255,255,255,0.12) !important;
    background: #12121F !important;
    font-style: italic;
  }

  /* ===================== */
  /* APP QUESTION BUBBLE   */
  /* ===================== */
  .journal-app-question {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
  }

  .journal-app-question-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px;
  }

  .journal-app-question-label {
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.35);
  }

  .journal-app-question-cancel {
    background: none;
    border: none;
    color: rgba(255,255,255,0.20);
    font-size: 15px;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    transition: color 0.2s ease;
    font-family: 'Google Sans', sans-serif;
  }
  .journal-app-question-cancel:hover { color: rgba(255,255,255,0.55); }

  /* Matches journal-entry-body visually */
  .journal-app-question-bubble {
    background: #151823;
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 16px;
    padding: 12px 16px;
    width: 100%;
    box-sizing: border-box;
    backdrop-filter: blur(8px);
  }

  .journal-app-question-bubble .journal-typewriter {
    font-size: 15px;
    color: #ffffff;
    line-height: 1.6;
    font-weight: 400;
  }

  /* User answer embedded below the question in the same bubble */
  .journal-prompt-answer {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.07);
    font-size: 15px;
    color: var(--text2);
    line-height: 1.7;
    font-weight: 300;
  }

  /* Input bar — ensure never pre-expanded */

/* ─── Reflect with me ──────────────────────── */
#reflect-btn {
  display: block;
  margin: 0 auto 8px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 20px;
  padding: 4px 12px;
  font-family: 'Google Sans', sans-serif;
  font-size: 12px;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s ease;
}
#reflect-btn:hover {
  color: rgba(255,255,255,0.55);
  border-color: rgba(255,255,255,0.14);
}
#reflect-btn.active {
  border-color: color-mix(in srgb, var(--green) 55%, transparent);
  color: var(--green);
}

/* Emotion pills row */
.reflect-emotion-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.reflect-emotion-pill {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 20px;
  padding: 6px 14px;
  font-family: 'Google Sans', sans-serif;
  font-size: 13px;
  color: rgba(255,255,255,0.55);
  cursor: pointer;
  transition: all 0.18s ease;
}
.reflect-emotion-pill.selected {
  background: var(--pill-color);
  border-color: var(--pill-color);
  color: #fff;
}
.reflect-next-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 24px;
  padding: 10px 24px;
  font-family: 'Google Sans', sans-serif;
  font-size: 14px;
  color: rgba(255,255,255,0.9);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 16px;
  display: block;
}
.reflect-next-btn:hover { background: rgba(255,255,255,0.07); }

/* Question bubble — dark card, matches journal entry */
.reflect-question-bubble {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 4px 16px 16px 16px;
  padding: 18px 20px;
  margin: 12px 0;
  background: #12121F;
  font-family: 'Google Sans', sans-serif;
  font-size: 15px;
  color: rgba(255,255,255,0.9);
  line-height: 1.7;
}
.reflect-question-text {
  margin-bottom: 2px;
}

/* Swap question link */
.reflect-swap-btn {
  display: block;
  margin-top: 10px;
  font-size: 12px;
  color: rgba(255,255,255,0.35);
  cursor: pointer;
  transition: color 0.2s ease;
}
.reflect-swap-btn:hover { color: rgba(255,255,255,0.6); }

/* User answer inside question bubble */
.reflect-user-answer {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.07);
}
.reflect-answer-text {
  flex: 1;
  font-size: 14px;
  color: rgba(255,255,255,0.65);
  line-height: 1.6;
  white-space: pre-wrap;
}
.reflect-edit-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  background: none;
  border: none;
  border-radius: 6px;
  color: rgba(255,255,255,0.28);
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}
.reflect-edit-btn:hover {
  color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.07);
}

/* Selected emotion summary shown after submitting check-in */
.reflect-emotion-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.reflect-emotion-summary-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 13px;
  font-family: 'Google Sans', sans-serif;
  background: color-mix(in srgb, var(--pill-color) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--pill-color) 40%, transparent);
  color: rgba(255,255,255,0.8);
}

/* ── Pillar Pivot Card ── */
.reflect-pivot-card {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 4px 16px 16px 16px;
  padding: 20px;
  margin: 12px 0;
  background: #12121F;
  font-family: 'Google Sans', sans-serif;
}
.reflect-pivot-prompt {
  font-size: 15px;
  color: rgba(255,255,255,0.9);
  line-height: 1.5;
  margin-bottom: 16px;
}
.reflect-pivot-observation {
  font-size: 13px;
  color: rgba(255,255,255,0.45);
  margin-bottom: 14px;
  line-height: 1.5;
  font-style: italic;
}
.reflect-pillar-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}
.reflect-pillar-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  color: rgba(255,255,255,0.8);
  cursor: pointer;
  font-family: 'Google Sans', sans-serif;
  transition: background 0.18s ease, border-color 0.18s ease;
}
.reflect-pillar-btn:hover {
  background: rgba(255,255,255,0.09);
  border-color: rgba(255,255,255,0.18);
}
.reflect-pillar-btn:disabled {
  opacity: 0.4;
  pointer-events: none;
}
.reflect-pillar-btn.neglected {
  border-color: rgba(201,169,110,0.35);
  animation: pillarPulse 2.4s ease-in-out infinite;
}
@keyframes pillarPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201,169,110,0); }
  50%       { box-shadow: 0 0 0 5px rgba(201,169,110,0.15); }
}
.reflect-pillar-emoji {
  font-size: 22px;
  line-height: 1;
}
.reflect-pillar-name {
  font-size: 12px;
  color: rgba(255,255,255,0.65);
  text-align: center;
}
.reflect-keep-talking-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.35);
  font-size: 13px;
  font-family: 'Google Sans', sans-serif;
  cursor: pointer;
  padding: 6px 0;
  transition: color 0.18s ease;
  display: block;
  width: 100%;
  text-align: left;
}
.reflect-keep-talking-btn:hover { color: rgba(255,255,255,0.6); }
.reflect-pivot-loading {
  display: flex;
  gap: 6px;
  padding: 8px 4px;
  justify-content: center;
}
.reflect-pivot-loading span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  animation: dotPulse 1.2s ease-in-out infinite;
}
.reflect-pivot-loading span:nth-child(2) { animation-delay: 0.2s; }
.reflect-pivot-loading span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotPulse {
  0%, 80%, 100% { transform: scale(0.7); opacity: 0.4; }
  40%           { transform: scale(1); opacity: 1; }
}

/* Emotion dots on saved entries */
/* Emotion pills on entry cards */
.entry-emotions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.entry-emotion-pill {
  font-size: 13px;
  color: var(--text2);
  background: rgba(255,255,255,0.06);
  padding: 4px 10px;
  border-radius: 50px;
}


  /* ===================== */
  /* NEW JOURNAL FLOW      */
  /* ===================== */

  /* Pillar chips row — empty state only, 3-per-row wrapping grid */
  .pillar-chips-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 16px;
    flex-shrink: 0;
  }
  .pillar-chip {
    flex: 1 1 calc(33.33% - 8px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 8px;
    border-radius: 20px;
    background: var(--surface2);
    border: 1px solid var(--border);
    font-size: 13px;
    color: var(--text2);
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.2s;
  }
  .pillar-chip:hover { border-color: rgba(255,255,255,0.18); }
  .pillar-chip-unused {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #3B82F6;
    display: inline-block;
    flex-shrink: 0;
  }

  /* New Journal button */
  .new-journal-btn {
    position: fixed;
    bottom: max(env(safe-area-inset-bottom, 0px), 16px);
    left: 50%;
    transform: translateX(-50%);
    background: #3B82F6;
    color: #fff;
    padding: 14px 36px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Google Sans', sans-serif;
    border: none;
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(59,130,246,0.4);
    white-space: nowrap;
  }
  .new-journal-btn:active { opacity: 0.85; }

  /* Flow overlay */
  .journal-flow-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .flow-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    flex-shrink: 0;
  }
  .flow-back-btn, .flow-close-btn {
    background: none;
    border: none;
    color: var(--text2);
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    line-height: 1;
  }
  .flow-dots { display: flex; gap: 6px; align-items: center; }
  .flow-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--surface3);
    transition: background 0.3s;
  }
  .flow-dot.active { background: #3B82F6; }

  .flow-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 24px 16px max(env(safe-area-inset-bottom, 0px), 40px);
    overflow-y: auto;
  }
  /* Input step: no padding — chat fills all space */
  #flow-step-input {
    padding: 0;
  }
  /* Flow input bar: transparent — no gradient mask */
  .flow-input-bar {
    background: transparent !important;
  }
  .flow-heading {
    font-family: 'Google Sans', 'Poppins', sans-serif;
    font-size: 24px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 28px;
    line-height: 1.2;
  }

  /* Emotion grid */
  .flow-emotion-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 32px;
  }
  .flow-emotion-pill {
    padding: 16px 12px;
    border-radius: 16px;
    background: #151823;
    border: 1px solid transparent;
    color: var(--text2);
    font-size: 15px;
    font-family: 'Google Sans', sans-serif;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
  }
  .flow-emotion-pill.selected {
    background: rgba(59,130,246,0.15);
    border-color: rgba(59,130,246,0.5);
    color: var(--text);
  }
  .flow-continue-btn {
    margin-top: auto;
    align-self: center;
    padding: 14px 36px;
    border-radius: 50px;
    background: #3B82F6;
    color: #fff;
    border: none;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Google Sans', sans-serif;
    cursor: pointer;
    transition: opacity 0.2s;
  }
  .flow-continue-btn:disabled { opacity: 0.35; cursor: default; }

  /* Mode cards */
  .flow-mode-cards { display: flex; flex-direction: column; gap: 16px; }
  .flow-mode-card {
    padding: 24px 20px;
    border-radius: 20px;
    background: #151823;
    border: 1px solid transparent;
    cursor: pointer;
    transition: border-color 0.2s;
  }
  .flow-mode-card:hover { border-color: rgba(59,130,246,0.4); }
  .flow-mode-card:active { border-color: rgba(59,130,246,0.6); }
  .flow-mode-card.flow-mode-locked { opacity: 0.6; cursor: default; }
  .flow-mode-card.flow-mode-locked:hover { border-color: transparent; }
  .flow-mode-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
  .flow-mode-card-header .flow-mode-icon { margin-bottom: 0; }
  .flow-mode-pro-badge {
    font-size: 11px; font-weight: 700; letter-spacing: 0.05em;
    background: rgba(59,130,246,0.15); color: #3B82F6;
    border: 1px solid rgba(59,130,246,0.3);
    border-radius: 50px; padding: 3px 10px;
  }
  .flow-mode-upgrade-btn {
    margin-top: 14px; padding: 10px 16px;
    background: #3B82F6; color: #fff; border: none;
    border-radius: 50px; font-size: 14px; font-weight: 600;
    font-family: 'Google Sans', sans-serif; cursor: pointer; width: 100%;
  }
  .flow-mode-icon { font-size: 24px; margin-bottom: 10px; }
  .flow-mode-title {
    font-family: 'Google Sans', 'Poppins', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
  }
  .flow-mode-desc { font-size: 14px; color: var(--text2); line-height: 1.5; }

  /* AI bubble in step 3 */
  .flow-ai-bubble {
    margin-bottom: 12px;
  }

  /* Response screen */
  .flow-response-card {
    background: var(--surface2);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 24px;
    flex: 1;
    overflow-y: auto;
  }
  .flow-response-text {
    font-size: calc(var(--fs-body) + 1px);
    color: var(--text);
    line-height: 1.7;
    margin: 0;
  }
  .flow-response-thinking {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 0;
  }
  .flow-response-thinking span {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--text3);
    border-radius: 50%;
    animation: ir-bounce 1.4s infinite;
  }
  .flow-response-thinking span:nth-child(2) { animation-delay: 0.2s; }
  .flow-response-thinking span:nth-child(3) { animation-delay: 0.4s; }
  .flow-done-btn {
    padding: 16px;
    border-radius: 50px;
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 16px;
    font-family: 'Google Sans', sans-serif;
    cursor: pointer;
    width: 100%;
    transition: border-color 0.2s;
  }
  .flow-done-btn:hover { border-color: rgba(255,255,255,0.18); }

  /* Flow conversation stream */
  .flow-convo-stream {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1;
    overflow-y: auto;
    padding: 16px 16px 16px;
  }
  .flow-msg-user {
    align-self: flex-end;
    background: #151823;
    border: none;
    border-radius: 18px 18px 4px 18px;
    padding: 10px 14px;
    font-size: var(--fs-body);
    color: var(--text);
    max-width: 85%;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
  }
  .flow-msg-ai {
    max-width: 95%;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: var(--fs-body);
    line-height: 1.5;
  }
  .flow-msg-ai.ir-ai-msg {
    border-left: none;
    padding-left: 4px;
  }

  /* Finish button */
  .flow-finish-btn {
    background: rgba(255,255,255,0.07);
    border: none;
    border-radius: 50px;
    color: var(--text2);
    font-size: 15px;
    font-family: 'Google Sans', sans-serif;
    cursor: pointer;
    padding: 8px 16px;
    margin-left: auto;
  }
  .flow-finish-btn:hover { background: rgba(255,255,255,0.11); color: var(--text); }

  /* Session response screen */
  .flow-session-convo {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
  }
  .flow-session-divider {
    height: 1px;
    background: var(--border);
    margin: 16px 0;
  }

  /* Session entry in feed */
  .session-convo-feed {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
  }
  .session-msg-ai {
    font-size: var(--fs-body);
    color: var(--text2);
    font-style: italic;
    line-height: 1.5;
    padding: 2px 0;
  }
  .session-msg-user {
    font-size: var(--fs-body);
    color: var(--text);
    line-height: 1.5;
    padding: 2px 0;
  }

  /* Detail tabs — segmented control */
  .detail-tabs {
    display: flex;
    flex-shrink: 0;
    align-self: center;
    background: var(--surface2);
    border-radius: 50px;
    padding: 4px;
    margin: 12px auto;
  }
  .detail-tab {
    padding: 7px 22px;
    background: none;
    border: none;
    border-radius: 50px;
    color: var(--text3);
    font-size: 14px;
    font-weight: 500;
    font-family: 'Google Sans', sans-serif;
    cursor: pointer;
    transition: all 0.18s;
    white-space: nowrap;
  }
  .detail-tab.active {
    background: var(--surface3);
    color: var(--text);
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  }

  /* Goals panel */
  .goals-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px 0;
    gap: 0;
    overflow-y: auto;
  }
  .goals-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
  }
  /* ── Goal cards: shared ── */
  .goal-item {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #151823;
    border-radius: 20px;
    padding: 18px 20px;
    margin-bottom: 12px;
  }
  .goal-item-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
  }
  .goal-text {
    flex: 1;
    font-size: var(--fs-body);
    color: var(--text);
    line-height: 1.5;
    font-weight: 400;
  }
  .goal-pillar-tag {
    font-size: 11px;
    color: var(--text2);
    margin-top: 2px;
  }
  /* ··· menu button reuses entry-menu pattern */
  .goal-menu-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.35);
    font-size: 16px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 6px;
    line-height: 1;
    letter-spacing: 1px;
    flex-shrink: 0;
    transition: color 0.2s, background 0.2s;
  }
  .goal-menu-btn:hover { color: rgba(255,255,255,0.55); background: #12121F; }
  .goal-menu-dropdown {
    display: none;
    position: absolute;
    top: 42px;
    right: 16px;
    background: var(--surface);
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 10px;
    backdrop-filter: blur(12px);
    min-width: 150px;
    z-index: 100;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  }
  .goal-menu-dropdown.open { display: block; }
  .goal-menu-item {
    padding: 11px 16px;
    font-size: 14px;
    color: rgba(255,255,255,0.55);
    cursor: pointer;
    font-family: 'Google Sans', sans-serif;
    font-weight: 500;
    transition: background 0.15s;
  }
  .goal-menu-item:hover { background: #12121F; }
  .goal-menu-item.danger { color: var(--danger); }
  .goal-menu-item.danger:hover { background: var(--danger-dim); }

  /* ── State 1: Unplanned (needs attention) ── */
  .goal-item-unplanned {
    border: 1px solid rgba(59,130,246,0.4);
    animation: goalPulse 2.5s ease-in-out infinite;
    cursor: default;
  }
  @keyframes goalPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(59,130,246,0); }
    50% { box-shadow: 0 0 16px 2px rgba(59,130,246,0.15); }
  }
  .goal-needs-plan-label {
    font-size: 11px;
    font-weight: 600;
    color: #3B82F6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }
  .goal-plan-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #3B82F6;
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Google Sans', sans-serif;
    cursor: pointer;
    transition: background 0.2s;
    align-self: flex-start;
  }
  .goal-plan-btn:hover { background: #2563EB; }

  /* ── State 2: Active (planned) ── */
  .goal-item-active {
    border: 1px solid rgba(255,255,255,0.06);
    transition: box-shadow 0.3s;
  }
  .goal-item-active.goal-glow {
    box-shadow: 0 0 12px 2px rgba(59,130,246,0.1);
  }
  .goal-item-active.goal-dim {
    box-shadow: none;
    opacity: 0.7;
  }
  .goal-task-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0 2px;
    border-top: 1px solid rgba(255,255,255,0.06);
  }
  .goal-task-label {
    font-size: 12px;
    color: var(--text3);
    margin-bottom: 2px;
  }
  .goal-task-text {
    flex: 1;
    font-size: 13px;
    color: var(--text2);
    line-height: 1.4;
  }
  .goal-check-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.15);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s;
  }
  .goal-check-btn:hover { border-color: rgba(255,255,255,0.3); background: rgba(255,255,255,0.05); }
  .goal-check-btn.checked {
    background: transparent;
    border-color: transparent;
    cursor: default;
    opacity: 0.7;
  }
  .goal-check-info {
    font-size: 11px;
    color: var(--text3);
    padding: 6px 0 0;
    opacity: 0.6;
  }
  .goal-next-step-prompt {
    padding: 8px 0 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .goal-celebrate-text {
    font-size: 12px;
    color: var(--text3);
  }
  .goal-next-step-btn {
    background: rgba(59,130,246,0.12);
    border: none;
    border-radius: 12px;
    color: #3B82F6;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 16px;
    cursor: pointer;
    font-family: inherit;
    align-self: flex-start;
    transition: background 0.2s;
  }
  .goal-next-step-btn:hover {
    background: rgba(59,130,246,0.2);
  }
  .goal-item-completed {
    opacity: 0.6;
  }
  .goal-completed-date {
    font-size: 12px;
    color: var(--text3);
    margin-top: 4px;
  }
  .goals-completed-section {
    margin-top: 24px;
  }
  .goals-history-btn {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text3);
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s;
  }
  .goals-history-btn:hover, .goals-history-btn.active { color: var(--text); }
  .goals-history-panel {
    flex: 1;
    overflow-y: auto;
    padding: 16px 16px 120px;
  }
  .goals-history-empty {
    text-align: center;
    color: var(--text3);
    font-size: 14px;
    margin-top: 60px;
  }
  .history-goal-item {
    background: var(--card-bg, rgba(255,255,255,0.05));
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 10px;
  }
  .history-goal-item-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
  }
  .history-goal-text {
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
    flex: 1;
  }
  .history-goal-type {
    font-size: 11px;
    color: var(--text3);
    background: rgba(255,255,255,0.07);
    border-radius: 6px;
    padding: 2px 7px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .history-goal-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
  }
  .history-goal-date {
    font-size: 12px;
    color: var(--text3);
  }
  .goals-completed-header {
    font-size: 13px;
    color: var(--text3);
    font-weight: 600;
    padding: 10px 0;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  /* ── Bottom sheet ── */
  .goal-sheet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
  }
  .goal-sheet-overlay.active { opacity: 1; }
  .goal-sheet {
    background: var(--surface2, #1a1d2e);
    border-radius: 20px 20px 0 0;
    padding: 24px 20px 32px;
    width: 100%;
    max-width: 480px;
    transform: translateY(100%);
    transition: transform 0.25s ease;
  }
  .goal-sheet-overlay.active .goal-sheet { transform: translateY(0); }
  .goal-sheet-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
    text-align: center;
  }
  .goal-sheet-opt {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 14px 16px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    background: rgba(255,255,255,0.04);
    cursor: pointer;
    margin-bottom: 10px;
    font-family: inherit;
    text-align: left;
    transition: background 0.15s;
  }
  .goal-sheet-opt:hover { background: rgba(255,255,255,0.08); }
  .goal-sheet-opt-icon {
    font-size: 20px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(255,255,255,0.06);
    flex-shrink: 0;
  }
  .goal-sheet-opt-done .goal-sheet-opt-icon {
    background: rgba(34,197,94,0.15);
    color: #22C55E;
    font-weight: 700;
    font-size: 18px;
  }
  .goal-sheet-opt-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
  }
  .goal-sheet-opt-desc {
    font-size: 12px;
    color: var(--text3);
    margin-top: 2px;
  }

  /* ── Celebration screen ── */
  .goal-celebration-screen {
    position: fixed;
    inset: 0;
    background: var(--bg, #0d0f1a);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
  }
  .goal-celebration-screen.active { opacity: 1; }
  .goal-celebration-content {
    text-align: center;
    padding: 24px;
    max-width: 320px;
  }
  .goal-celebration-check {
    margin-bottom: 20px;
    animation: celPop 0.4s ease;
  }
  @keyframes celPop {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
  }
  .goal-celebration-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    line-height: 1.4;
  }
  .goal-celebration-subtitle {
    font-size: 15px;
    color: var(--text2);
    margin-bottom: 4px;
  }
  .goal-celebration-date {
    font-size: 13px;
    color: var(--text3);
    margin-bottom: 32px;
  }
  .goal-celebration-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .goal-celebration-btn {
    padding: 14px 24px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: background 0.15s;
  }
  .goal-celebration-btn-primary {
    background: #3B82F6;
    color: #fff;
  }
  .goal-celebration-btn-primary:hover { background: #2563EB; }
  .goal-celebration-btn-secondary {
    background: rgba(255,255,255,0.06);
    color: var(--text2);
    border: 1px solid rgba(255,255,255,0.1);
  }
  .goal-celebration-btn-secondary:hover { background: rgba(255,255,255,0.1); }
  .goals-add-goal-btn {
    position: fixed;
    bottom: max(env(safe-area-inset-bottom, 0px), 16px);
    left: 50%;
    transform: translateX(-50%);
    background: #3B82F6;
    color: #fff;
    padding: 14px 36px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Google Sans', sans-serif;
    border: none;
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(59,130,246,0.4);
    white-space: nowrap;
    display: none;
  }
  .goals-add-goal-btn:active { opacity: 0.85; }

  .plan-dismiss-row {
    display: flex;
    gap: 10px;
    padding: 12px 0 4px;
    justify-content: center;
  }
  .plan-dismiss-btn {
    padding: 8px 18px;
    border-radius: 50px;
    border: none;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Google Sans', sans-serif;
    cursor: pointer;
    transition: background 0.2s;
  }
  .plan-dismiss-remove {
    background: rgba(239,68,68,0.15);
    color: #EF4444;
  }
  .plan-dismiss-remove:hover { background: rgba(239,68,68,0.25); }
  .plan-dismiss-keep {
    background: rgba(255,255,255,0.08);
    color: var(--text2);
  }
  .plan-dismiss-keep:hover { background: rgba(255,255,255,0.14); }

  .plan-set-confirm {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 0 4px;
  }
  .plan-set-label {
    font-size: 15px;
    font-weight: 600;
    color: var(--text2);
  }
  .plan-set-done-btn {
    background: #3B82F6;
    color: #fff;
    padding: 10px 28px;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Google Sans', sans-serif;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(59,130,246,0.3);
    transition: background 0.2s;
  }
  .plan-set-done-btn:active { opacity: 0.85; }

  .notif-prompt-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 18px 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 14px;
  }
  .notif-prompt-q {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
  }
  .notif-prompt-btns {
    display: flex;
    gap: 10px;
  }
  .notif-prompt-btn {
    padding: 9px 20px;
    border-radius: 50px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Google Sans', sans-serif;
    cursor: pointer;
    transition: opacity 0.2s;
  }
  .notif-prompt-btn:active { opacity: 0.75; }
  .notif-yes {
    background: #3B82F6;
    color: #fff;
    box-shadow: 0 2px 10px rgba(59,130,246,0.3);
  }
  .notif-no {
    background: rgba(255,255,255,0.07);
    color: var(--text2);
  }
  .notif-time-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .notif-time-input {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-size: 15px;
    font-family: 'Google Sans', sans-serif;
    padding: 8px 12px;
    flex: 1;
    min-width: 0;
    outline: none;
  }
  .notif-time-input:focus { border-color: #3B82F6; }

  .goals-add-row {
    flex: 1;
    background: #151823;
    border: none;
    border-radius: 28px;
    padding: 12px 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .goals-input {
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 15px;
    font-family: 'Google Sans', sans-serif;
    padding: 11px 0 0 11px;
    line-height: 1.5;
  }
  .goals-input:focus { outline: none; }
  .goals-input::placeholder { color: rgba(255,255,255,0.35); }
  /* Add Goal input bar at bottom of goals page */
  .goals-add-bar {
    padding: 8px 16px;
    padding-bottom: max(env(safe-area-inset-bottom, 12px), 12px);
    background: var(--bg);
    flex-shrink: 0;
  }

  /* Add Goal page */
  #page-add-goal {
    flex-direction: column;
  }
  .add-goal-content {
    flex: 1;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 20px;
  }
  .add-goal-textarea {
    background: #151823;
    border: none;
    border-radius: 20px;
    padding: 18px 20px;
    color: var(--text);
    font-size: 16px;
    font-family: 'Google Sans', sans-serif;
    line-height: 1.5;
    resize: none;
    min-height: 120px;
  }
  .add-goal-textarea::placeholder { color: var(--text3); }
  .add-goal-textarea:focus { outline: none; }
  .add-goal-submit-btn {
    background: #3B82F6;
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Google Sans', sans-serif;
    cursor: pointer;
  }

  /* Top bar icons row */
  .top-bar-icons {
    display: flex;
    align-items: flex-start;
    gap: 12px;
  }
  .goals-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.16);
    background: rgba(255,255,255,0.10);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text2);
    transition: all 0.2s ease;
  }
  .goals-icon-btn:hover { background: rgba(255,255,255,0.14); }

  .goals-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #EF4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
  }

  .goal-action-dot {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #EF4444;
    box-shadow: 0 0 6px rgba(239,68,68,0.6);
    pointer-events: none;
  }

  /* Goals page */
  .goals-page-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    flex-shrink: 0;
  }
  .goals-page-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
  }
  .goals-page-content {
    flex: 1;
    overflow-y: auto;
    padding: 8px 16px 120px;
  }
  .goal-pillar-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text3);
    padding: 2px 8px;
    border-radius: 8px;
    background: rgba(255,255,255,0.06);
    flex-shrink: 0;
  }
  .goals-pillar-select {
    background: rgba(255,255,255,0.08);
    border: none;
    border-radius: 12px;
    color: var(--text);
    font-family: 'Google Sans', sans-serif;
    font-size: 13px;
    padding: 6px 10px;
    cursor: pointer;
    outline: none;
  }
  .goals-pillar-select option {
    background: var(--bg);
    color: var(--text);
  }
  .consistency-tracker {
    background: #151823;
    border-radius: 28px;
    padding: 24px 20px;
    margin-bottom: 20px;
    text-align: center;
  }
  .streak-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 16px;
  }
  .streak-right {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
  .streak-flame { line-height: 1; display: flex; }
  .streak-number { font-size: 56px; font-weight: 700; color: var(--text); line-height: 1; font-family: 'Google Sans', sans-serif; }
  .streak-subtitle { font-size: 13px; color: var(--text3); font-weight: 500; }
  .consistency-label {
    font-size: 12px;
    color: var(--text3);
    font-weight: 500;
    margin-top: 14px;
  }
  .consistency-dots {
    display: flex;
    justify-content: space-between;
    max-width: 320px;
    margin: 0 auto;
  }
  .consistency-day-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
  }
  .consistency-day-label { font-size: 10px; font-weight: 600; color: var(--text3); }
  .consistency-day {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: transparent;
    border: 2px solid rgba(255,255,255,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .consistency-day.active {
    background: #3B82F6;
    border-color: #3B82F6;
    color: #fff;
  }
  .goals-pillar-group {
    margin-bottom: 24px;
  }
  .goals-pillar-heading {
    font-size: 13px;
    font-weight: 600;
    color: var(--text3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 4px 8px;
  }

  /* Desktop flow overlay — match main content 33% side padding */
  @media (min-width: 768px) {
    .flow-header {
      padding: 16px 33%;
    }
    .flow-step {
      padding: 24px 33% 40px;
    }
    .flow-input-bar {
      padding: 8px 33% 28px;
    }
    .flow-convo-stream {
      padding: 16px 33% 16px;
    }
    .goals-panel {
      padding: 16px 33%;
    }
    .goals-page-content {
      padding: 8px 33% 120px;
    }
    .goals-history-panel {
      padding: 16px 33% 120px;
    }
    .detail-header {
      padding: 0 33%;
    }
    .new-journal-btn,
    .goals-add-goal-btn {
      bottom: 32px;
    }
  }

  /* ── Font size picker (profile) ── */
  .font-size-picker {
    display: flex;
    background: var(--surface2);
    border-radius: 50px;
    padding: 4px;
    gap: 2px;
  }
  .font-size-opt {
    padding: 6px 18px;
    background: none;
    border: none;
    border-radius: 50px;
    color: var(--text3);
    font-family: 'Google Sans', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    line-height: 1;
  }
  .font-size-opt.active {
    background: var(--surface3);
    color: var(--text);
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  }
  .font-size-opt:nth-child(1) { font-size: 13px; }
  .font-size-opt:nth-child(2) { font-size: 16px; }
  .font-size-opt:nth-child(3) { font-size: 19px; }

  /* ── PWA Install Banner ── */
  .pwa-install-banner {
    position: fixed;
    bottom: -80px;
    left: 0;
    right: 0;
    z-index: 9998;
    padding: 12px 16px;
    transition: bottom 0.3s ease;
  }
  .pwa-install-banner.visible { bottom: 0; }
  .pwa-install-content {
    background: var(--surface2);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 480px;
    margin: 0 auto;
  }
  .pwa-install-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  .pwa-install-text strong {
    font-size: 14px;
    color: var(--text);
  }
  .pwa-install-text span {
    font-size: 12px;
    color: var(--text3);
  }
  .pwa-install-btn {
    background: #3B82F6;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    flex-shrink: 0;
  }
  .pwa-install-btn:hover { background: #2563EB; }
  .pwa-install-dismiss {
    background: none;
    border: none;
    color: var(--text3);
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
  }

  /* ── Flow Pillar Pivot Card ── */
  .flow-pivot-card {
    padding: 8px 0 16px;
    width: 100%;
  }
  .flow-pivot-prompt {
    font-size: 13px;
    color: rgba(255,255,255,0.45);
    margin-bottom: 16px;
    line-height: 1.4;
  }
  .flow-pivot-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
  }
  .flow-pivot-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 14px;
    border-radius: 16px;
    background: #151823;
    border: 1px solid transparent;
    color: var(--text);
    font-size: 15px;
    font-family: 'Google Sans', sans-serif;
    cursor: pointer;
    transition: border-color 0.15s;
    text-align: left;
  }
  .flow-pivot-pill:hover { border-color: rgba(255,255,255,0.18); }
  .flow-pivot-pill:disabled { opacity: 0.35; pointer-events: none; }
  /* Per-pillar tint — same as emotion pills on hover */
  .flow-pivot-pill[data-pillar="relationships"] { border-color: rgba(251,191,36,0.18); }
  .flow-pivot-pill[data-pillar="purpose"]       { border-color: rgba(239,68,68,0.18); }
  .flow-pivot-pill[data-pillar="mindbody"]      { border-color: rgba(34,197,94,0.16); }
  .flow-pivot-pill[data-pillar="growth"]        { border-color: rgba(59,130,246,0.18); }
  .flow-pivot-pill[data-pillar="finances"]      { border-color: rgba(234,179,8,0.18); }
  .flow-pivot-pill[data-pillar="joy"]           { border-color: rgba(167,139,250,0.18); }
  /* Neglected: identical look but subtle border pulse — no dimming, no size change */
  .flow-pivot-pill.neglected { animation: flowPivotPulse 2.6s ease-in-out infinite; }
  @keyframes flowPivotPulse {
    0%, 100% { box-shadow: none; }
    50%       { box-shadow: 0 0 0 2px rgba(255,255,255,0.07); }
  }
  .flow-pivot-keep-talking {
    background: none;
    border: none;
    color: rgba(255,255,255,0.35);
    font-size: 14px;
    font-family: 'Google Sans', sans-serif;
    cursor: pointer;
    padding: 4px 0;
    transition: color 0.15s;
  }
  .flow-pivot-keep-talking:hover { color: rgba(255,255,255,0.6); }

  /* ── Standalone PWA adjustments ── */
  @media (display-mode: standalone) {
    body { padding-top: env(safe-area-inset-top); }
    .pwa-install-banner { display: none !important; }
  }
