/* 字体已改由 index.html 的 <link rel="stylesheet"> + preconnect 加载，避免 @import 的渲染阻塞 */

@layer reset, base, theme, components, utilities;

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

  body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
  }

  button, input, select, textarea {
    font: inherit;
    color: inherit;
    background: none;
    border: none;
    outline: none;
  }
}

@layer base {
  :root {
    /* Base HSL values representing the starting/default Focuszen calming color theme (Warm Coral) */
    --theme-h: 16;
    --theme-s: 100%;
    --theme-l: 70%;

    /* Primary Accent (Default: Focuszen Warm Coral) */
    --accent: #FF8A65;
    --accent-light: #FFA185;
    --accent-glow: rgba(255, 138, 101, 0.08);
    /* 实心填充专用色（按钮等）：保底鲜艳，浅色主题下也不会变成发白方块 */
    --accent-fill: hsl(16, 100%, 62%);
    --accent-fill-light: hsl(16, 100%, 70%);

    /* Typography matching Focuszen branding */
    --font-title: 'Playfair Display', 'Noto Serif SC', 'Georgia', serif;
    --font-body: 'Inter', -apple-system, sans-serif;
    --font-serif: 'Noto Serif SC', 'Georgia', serif;
    --font-handwritten: 'Ma Shan Zheng', 'Caveat', cursive, sans-serif;

    /* UI Sizing & Spacing */
    --max-w-content: 600px;
    --border-radius-card: 16px;
    --border-radius-pill: 50px;
    --transition-easing: cubic-bezier(0.16, 1, 0.3, 1);

    /* Background and Surfaces (Clean Deep Charcoal palette) */
    --bg-gradient-start: #111418;
    --bg-gradient-end: #0c0e12;
    --surface-glass: #1A1D24;
    --surface-glass-border: rgba(255, 255, 255, 0.05);
    --text-primary: #FFFFFF;
    --text-muted: #8E95A1;
  }

  body {
    font-family: var(--font-body);
    background-color: #0A0B0E;
    background-image:
      radial-gradient(circle at center, rgba(16, 18, 24, 0.98) 30%, rgba(8, 9, 12, 1) 100%),
      url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.02'/%3E%3C/svg%3E");
    color: var(--text-primary);
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
  }

}

@layer theme {
  body {
    scrollbar-color: var(--accent) transparent;
    scrollbar-width: thin;
  }

  ::selection {
    background-color: var(--accent-glow);
    color: var(--text-primary);
  }
}

@layer components {
  /* Container for the app viewport to feel like a premium mobile app on desktop, but fill screen on mobile */
  .app-viewport {
    width: 100%;
    max-width: var(--max-w-content);
    height: 100dvh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    background: transparent;
    backdrop-filter: saturate(140%) blur(4px);
  }

  /* Screens/Views within the SPA */
  .view-screen {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2.5rem 1.5rem;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.98) translateY(10px);
    transition: opacity 0.5s var(--transition-easing),
                visibility 0.5s var(--transition-easing),
                transform 0.5s var(--transition-easing);
    overflow-y: auto;
    overflow-x: hidden;
  }

  .view-screen.active {
    opacity: 1;
    visibility: visible;
    transform: scale(1) translateY(0);
    z-index: 10;
  }

  /* 1. NARRATIVE SCREEN (Poetic Paper Feeling) */
  .narrative-paper {
    background-color: #12131a;
    background-image:
      radial-gradient(circle at center, rgba(28, 30, 43, 0.98), rgba(8, 8, 12, 1)),
      url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.016'/%3E%3C/svg%3E");
    font-family: var(--font-serif);
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem 2rem;
    z-index: 100;
  }

  .narrative-content {
    width: 100%;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 3rem;
    position: relative;
    z-index: 2;
  }

  .narrative-line {
    font-size: 1.15rem;
    line-height: 1.8;
    font-weight: 300;
    color: rgba(226, 232, 240, 0.85);
    text-wrap: pretty;
    opacity: 0;
    transform: translateY(15px);
    transition: all 0.9s var(--transition-easing);
  }

  .narrative-line.visible {
    opacity: 1;
    transform: translateY(0);
  }

  .typing-cursor::after {
    content: '|';
    animation: blink 1s infinite steps(2, start);
  }

  .skip-narrative-btn {
    position: absolute;
    top: 2rem;
    right: 2rem;
    font-size: 0.8rem;
    font-family: var(--font-body);
    color: rgba(255, 255, 255, 0.35);
    cursor: pointer;
    padding: 0.4rem 0.8rem;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.3s ease;
    z-index: 2;
  }

  .skip-narrative-btn:hover {
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.06);
  }

  /* 2. GLASS CARDS */
  .glass-card {
    background: rgba(18, 20, 27, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--border-radius-card);
    padding: 2.2rem 1.8rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  }


  /* Forms & Inputs */
  .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
  }

  .input-label {
    font-family: var(--font-title);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
  }

  .text-input {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 1rem 1.2rem;
    font-size: 1rem;
    color: var(--text-primary);
    transition: all 0.3s var(--transition-easing);
  }

  .text-input:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 15px var(--accent-glow);
  }

  select.text-input {
    cursor: pointer;
    background-color: rgb(15, 17, 26);
  }

  /* 3. MBTI QUIZ ELEMENTS */
  .quiz-option-btn {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 1.2rem 1.5rem;
    text-align: left;
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.4;
    cursor: pointer;
    margin-bottom: 0.75rem;
    transition: all 0.25s var(--transition-easing);
  }

  .quiz-option-btn:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--accent);
    transform: translateX(4px);
  }

  .quiz-option-btn:active {
    transform: translateX(2px);
  }

  .quiz-progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 2rem;
  }

  .quiz-progress-fill {
    height: 100%;
    background: var(--accent);
    width: 0%;
    transition: width 0.4s var(--transition-easing);
  }

  /* Quiz Visual Selection Cards (A/B) */
  .quiz-visual-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
    margin-top: 1rem;
  }

  .quiz-visual-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s var(--transition-easing);
  }

  .quiz-visual-card:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--accent);
    transform: translateY(-4px);
  }

  .quiz-visual-card.active {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent);
    box-shadow: 0 0 15px var(--accent-glow);
  }

  /* 4. FLOWER LEAF COLOR WREATH (Apple Style Glassmorphism) */
  .wreath-container {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    margin: 2rem 0;
  }

  .wreath-svg {
    width: 100%;
    height: 100%;
    max-width: 320px;
    max-height: 320px;
    overflow: visible;
  }

  .leaf-node {
    cursor: pointer;
    transition: transform 0.45s var(--transition-easing), filter 0.45s var(--transition-easing);
  }

  .leaf-node .leaf-path-outer {
    fill: var(--leaf-color-border, rgba(255, 192, 192, 0.2));
    transition: fill 0.3s ease;
  }

  .leaf-node .leaf-path-inner {
    fill: var(--leaf-color, #ffb3b3);
    transition: fill 0.3s ease;
  }

  .leaf-node:hover {
    transform: scale(1.18) translate(var(--hover-dx, 0), var(--hover-dy, 0)) rotate(var(--rotate-deg, 0deg));
    filter: drop-shadow(0 0 14px var(--leaf-glow, rgba(255, 180, 180, 0.6)));
  }

  .leaf-node.active {
    transform: scale(1.24) translate(var(--hover-dx, 0), var(--hover-dy, 0)) rotate(var(--rotate-deg, 0deg));
    filter: drop-shadow(0 0 22px var(--leaf-glow, rgba(255, 255, 255, 0.95)));
  }

  .leaf-node.active .leaf-path-outer {
    fill: #ffffff;
  }

  /* Leaf veins styles */
  .leaf-vein {
    stroke: rgba(255, 255, 255, 0.4);
    stroke-width: 1.2px;
    stroke-linecap: round;
    transition: stroke 0.3s ease;
  }

  .leaf-node.active .leaf-vein {
    stroke: #ffffff;
    stroke-width: 1.5px;
  }

  .wreath-center-mandala {
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1.5px dashed rgba(255, 255, 255, 0.15);
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
  }

  .wreath-center-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 15px var(--accent);
    transition: background 0.4s ease, box-shadow 0.4s ease;
  }

  /* Micro HSL Slider center overlay popover */
  .wreath-slider-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    background: rgba(15, 17, 28, 0.85);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 12px 35px rgba(0,0,0,0.5);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 14px;
    padding: 0.8rem;
    display: none;
    flex-direction: column;
    align-items: center;
    z-index: 100;
  }

  /* 5. GOAL COACH CARD */
  .goal-popup-card {
    background: rgba(15, 17, 26, 0.8);
    border: 1px solid var(--surface-glass-border);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .goal-suggest-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-top: 0.5rem;
  }

  .goal-suggest-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    padding: 0.6rem;
    font-size: 0.75rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    text-wrap: balance;
  }

  .goal-suggest-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent);
  }

  /* App Dock Grid Styling */
  .app-dock-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: 18px;
    min-height: 100px;
  }

  .dock-app-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: all 0.25s var(--transition-easing);
  }

  .dock-app-item:hover {
    transform: translateY(-4px);
  }

  .dock-app-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 1.1rem;
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.25);
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.03));
    border: 1px solid rgba(255,255,255,0.08);
    transition: border-color 0.25s ease;
  }

  .dock-app-item:hover .dock-app-icon {
    border-color: var(--accent);
  }

  /* 品牌 SVG 图标：撑满圆角容器，留一点内边距呼吸感 */
  .dock-app-icon.brand-icon {
    padding: 8px;
  }
  .dock-app-icon.brand-icon svg {
    width: 100%;
    height: 100%;
    display: block;
  }

  /* 官方图标图片：贴合容器，圆角裁切 */
  .dock-app-icon.brand-icon.has-img {
    padding: 6px;
    overflow: hidden;
  }
  .dock-app-icon.brand-icon.has-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    border-radius: 6px;
  }

  .dock-app-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
    text-align: center;
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Edit Mode Overlays */
  .dock-app-delete-btn {
    position: absolute;
    top: -5px;
    left: -5px;
    width: 18px;
    height: 18px;
    background: #ef4444;
    color: #ffffff;
    font-size: 0.65rem;
    border-radius: 50%;
    display: none;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    z-index: 10;
  }

  .dock-app-nav-btns {
    position: absolute;
    bottom: -8px;
    width: 100%;
    display: none;
    justify-content: space-between;
    padding: 0 4px;
    z-index: 10;
  }

  .dock-nav-btn {
    width: 15px;
    height: 15px;
    background: rgba(0,0,0,0.7);
    border: 1px solid rgba(255,255,255,0.15);
    color: var(--accent);
    font-size: 0.5rem;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
  }

  .dock-app-item.edit-mode .dock-app-delete-btn,
  .dock-app-item.edit-mode .dock-app-nav-btns {
    display: flex;
  }

  .floating-desk-pet-container {
    position: fixed;
    bottom: 90px;
    right: 30px;
    width: 100px;
    height: 100px;
    cursor: grab;
    z-index: 1000;
    animation: float-pet 4.5s ease-in-out infinite;
    transition: filter 0.3s ease;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
  }

  .floating-desk-pet-container.is-dragging {
    cursor: grabbing;
    animation: none;
    filter: brightness(1.08);
    transition: none;
  }

  .floating-desk-pet-container:hover {
    filter: brightness(1.1);
  }

  @keyframes float-pet {
    0%, 100% {
      transform: translateY(0);
    }
    50% {
      transform: translateY(-8px);
    }
  }

  .pet-mini-console {
    position: absolute;
    bottom: -32px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 17, 26, 0.85);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 50px;
    padding: 0.2rem 0.4rem;
    display: none;
    gap: 0.3rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    z-index: 100;
  }

  .pet-mini-console button {
    font-size: 0.55rem;
    padding: 0.15rem 0.3rem;
    border-radius: 50px;
    cursor: pointer;
    background: rgba(255,255,255,0.03);
  }

  .pet-mini-console button:hover {
    background: rgba(255,255,255,0.08);
  }

  .floating-desk-pet-container:hover .pet-mini-console {
    display: flex;
  }

  /* 6. TOAST INTERACTION ALERTS */
  .alert-blocking-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 5, 8, 0.94);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s var(--transition-easing), visibility 0.5s var(--transition-easing);
  }

  .alert-blocking-overlay.active {
    opacity: 1;
    visibility: visible;
  }

  .alert-blocking-card {
    background: rgba(20, 22, 33, 0.75);
    border: 1.5px solid rgba(239, 68, 68, 0.25);
    border-radius: 28px;
    padding: 2.5rem 2rem;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.5s var(--transition-easing);
  }

  .alert-blocking-overlay.active .alert-blocking-card {
    transform: scale(1);
  }

  .blocking-warning-title {
    font-family: var(--font-title);
    font-size: 1.6rem;
    font-weight: 800;
    color: #f87171;
    margin-bottom: 1rem;
    letter-spacing: 0.02em;
  }

  .blocking-warning-body {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 2rem;
  }

  .blocking-warning-body strong {
    color: var(--text-primary);
  }

  /* Buttons */
  .btn-primary {
    background: var(--accent-fill);
    color: #111418;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.9rem 2rem;
    border-radius: var(--border-radius-pill);
    cursor: pointer;
    box-shadow: none;
    transition: all 0.25s var(--transition-easing);
    text-align: center;
  }

  .btn-primary:hover {
    background: var(--accent-fill-light);
    transform: translateY(-1.5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  }

  .btn-primary:active {
    transform: translateY(1px);
  }

  .btn-sec {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    font-family: var(--font-title);
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.8rem 1.5rem;
    border-radius: var(--border-radius-pill);
    cursor: pointer;
    transition: all 0.3s var(--transition-easing);
  }

  .btn-sec:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
  }

  /* Headings & Text */
  .title-lg {
    font-family: var(--font-title);
    font-size: clamp(1.8rem, 1.2rem + 3vw, 2.4rem);
    font-weight: 500;
    line-height: 1.2;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
  }

  .desc-md {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-muted);
    text-wrap: pretty;
  }

  /* Search Bar (Chrome-style) */
  .search-wrapper {
    position: relative;
    width: 100%;
    margin-top: 1.5rem;
  }

  .search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--border-radius-pill);
    padding: 1.1rem 1.5rem 1.1rem 3.5rem;
    font-size: 1rem;
    color: var(--text-primary);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    transition: all 0.3s var(--transition-easing);
  }

  .search-input:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 20px var(--accent-glow);
  }

  .search-icon {
    position: absolute;
    left: 1.4rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    transition: color 0.3s ease;
  }

  .search-wrapper:focus-within .search-icon {
    color: var(--accent);
  }

  /* Canvas Walk Cycles (Visual Avatar) */
  .avatar-canvas-container {
    width: 100%;
    aspect-ratio: 1.7;
    margin: 1rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
  }

  .avatar-canvas {
    width: 100%;
    height: 100%;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.01);
  }

  .avatar-state-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    padding: 0.3rem 0.8rem;
    font-size: 0.75rem;
    font-family: var(--font-title);
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 0.4rem;
  }

  /* State indicator dot */
  .badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
  }

  .state-black .badge-dot { background-color: #ef4444; }
  .state-gray .badge-dot { background-color: var(--accent); }
  .state-white .badge-dot { background-color: #10b981; }

  /* Reborn Warning Banner overlay */
  .reborn-banner {
    position: absolute;
    bottom: 0.5rem;
    left: 5%;
    width: 90%;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    padding: 0.6rem 1rem;
    text-align: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s var(--transition-easing);
    pointer-events: none;
  }

  .reborn-banner.active {
    opacity: 1;
    transform: translateY(0);
  }

  .reborn-banner-title {
    font-family: var(--font-title);
    color: #f87171;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.3;
  }

  .reborn-banner-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 0.1rem;
  }

  /* Bottom Meditation circular trigger */
  .meditation-trigger-box {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem 0 0.5rem 0;
  }

  .circle-pulse-trigger {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: #1A1D24;
    border: 1.5px solid var(--accent);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    position: relative;
    box-shadow: none;
    transition: all 0.35s var(--transition-easing);
  }

  .circle-pulse-trigger::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 1.5px solid var(--accent);
    opacity: 0.3;
    animation: pulse-ring 2.5s infinite var(--transition-easing);
  }

  .circle-pulse-trigger:hover {
    transform: scale(1.08);
    box-shadow: 0 12px 40px var(--accent-glow);
    border-color: rgba(255, 255, 255, 0.25);
  }

  .circle-pulse-trigger:active {
    transform: scale(0.96);
  }

  .meditation-trigger-icon {
    width: 28px;
    height: 28px;
    color: var(--text-primary);
  }

  /* Galaxy Meditation Space Elements */
  .galaxy-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    height: 100%;
  }

  .galaxy-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    border-radius: var(--border-radius-card);
  }

  .galaxy-ui {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    pointer-events: none; /* Make overlay click-through */
  }

  .galaxy-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2.5rem 1.5rem 0 1.5rem;
    pointer-events: auto; /* Re-enable clicks for headers */
  }

  .meditation-timer {
    font-family: var(--font-title);
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  /* Bubble Prompts container */
  .bubble-prompts-area {
    position: absolute;
    inset: 15% 5% 30% 5%;
    pointer-events: none;
    overflow: hidden;
  }

  .thought-bubble {
    position: absolute;
    left: 50%;
    max-width: 14em;
    font-family: var(--font-serif);
    font-size: 1.3rem;
    font-weight: 300;
    line-height: 1.95;
    letter-spacing: 0.04em;
    text-align: center;
    color: rgba(246, 248, 252, 0.94);
    /* 仅一层柔和光晕，不再有边框/底色方块 */
    text-shadow:
      0 0 22px var(--bubble-glow, rgba(190, 205, 255, 0.38)),
      0 0 2px rgba(0, 0, 0, 0.35);
    pointer-events: none;
    white-space: normal;
    word-break: keep-all;
    overflow-wrap: break-word;
    opacity: 0;
    will-change: opacity, transform, filter;
    /* 从模糊聚焦浮现，停留，再轻轻上飘虚化 */
    animation: thought-surface 12s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  }

  /* Breathing Circle Guidance */
  .breathing-sanctuary {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2;
    pointer-events: none;
  }

  .breath-circle-outer {
    width: 210px;
    height: 210px;
    border-radius: 50%;
    border: 1px dashed rgba(255, 255, 255, 0.06);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
  }

  .breath-circle-inner {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: transparent;
    border: 1px dashed rgba(255, 255, 255, 0.12);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    box-shadow: none;
    transition: transform 4.0s cubic-bezier(0.4, 0, 0.2, 1);
  }


  .breathing-text {
    margin-top: 1.5rem;
    font-family: var(--font-title);
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--text-primary);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
    text-align: center;
  }

  /* Glass modal dialog styling */
  .dialog-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1500;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
  }

  .dialog-overlay.active {
    opacity: 1;
    visibility: visible;
  }

  .dialog-content {
    background: var(--surface-glass);
    border: 1px solid var(--surface-glass-border);
    border-radius: var(--border-radius-card);
    width: 100%;
    max-width: 420px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 2rem 1.5rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    transform: scale(0.92);
    transition: transform 0.35s var(--transition-easing);
  }

  .dialog-overlay.active .dialog-content {
    transform: scale(1);
  }

  .ai-service-status {
    margin-bottom: 0;
  }

  .ai-service-ready {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 44px;
    padding: 0.7rem 0.85rem;
    border: 1px solid rgba(52, 211, 153, 0.18);
    border-radius: 12px;
    background: rgba(52, 211, 153, 0.055);
    color: rgba(236, 253, 245, 0.88);
    font-size: 0.78rem;
    line-height: 1.45;
  }

  .ai-service-ready > span {
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.1);
  }

  .intercept-search-group {
    margin-top: 0.85rem;
    margin-bottom: 0;
  }

  .intercept-search-group[hidden] {
    display: none;
  }

  .intercept-search-row {
    display: flex;
    align-items: stretch;
    gap: 0.65rem;
    width: 100%;
  }

  .intercept-search-row .text-input {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 54px;
  }

  .intercept-search-confirm {
    flex: 0 0 88px;
    min-height: 54px;
    padding: 0.75rem 1rem;
    font-size: 0.86rem;
    border-radius: 14px;
    white-space: nowrap;
  }

  .intercept-search-confirm:disabled {
    cursor: wait;
  }

  .intercept-search-row .text-input[aria-invalid="true"] {
    border-color: rgba(220, 38, 38, 0.58);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
  }

  .field-helper {
    color: rgba(255, 255, 255, 0.58);
    font-size: 0.72rem;
    line-height: 1.45;
  }

  .plan-step-editor {
    padding: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.065);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.025);
  }

  .step-minutes-editor {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.72rem;
  }

  .step-minutes-editor > span:last-child {
    display: flex;
    align-items: center;
    gap: 0.35rem;
  }

  .step-minutes-editor input {
    width: 62px;
    min-height: 34px;
    padding: 0.35rem 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 9px;
    background: rgba(0, 0, 0, 0.18);
    color: var(--text-primary);
    text-align: center;
  }

  .step-minutes-editor input:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent);
    outline-offset: 2px;
  }

  .plan-total-time {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 54px;
    cursor: text;
    color: var(--accent-light);
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    -moz-appearance: textfield;
    background: color-mix(in srgb, var(--accent) 7%, rgba(0, 0, 0, 0.18));
  }

  .plan-total-time-row {
    display: flex;
    align-items: stretch;
    gap: 0.65rem;
    width: 100%;
  }

  .plan-total-confirm {
    flex: 0 0 88px;
    min-height: 54px;
    padding: 0.75rem 1rem;
    font-size: 0.86rem;
    white-space: nowrap;
  }

  .plan-total-confirm.is-confirmed {
    filter: brightness(1.08);
    transform: scale(0.98);
  }

  .plan-total-time::-webkit-inner-spin-button,
  .plan-total-time::-webkit-outer-spin-button {
    margin: 0;
    -webkit-appearance: none;
  }

  .plan-total-time:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent);
    outline-offset: 2px;
  }

  .dialog-title {
    font-family: var(--font-title);
    font-size: 1.3rem;
    font-weight: 600;
  }

  .dialog-body {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-muted);
  }
}

@layer utilities {
  /* Animation Keyframes */
  @keyframes pulse-ring {
    0% {
      transform: scale(1);
      opacity: 0.4;
    }
    50% {
      transform: scale(1.15);
      opacity: 0.15;
    }
    100% {
      transform: scale(1);
      opacity: 0.4;
    }
  }

  @keyframes thought-surface {
    0% {
      opacity: 0;
      filter: blur(9px);
      transform: translate(-50%, 30px) scale(0.96);
    }
    16% {
      opacity: 0.95;
      filter: blur(0);
      transform: translate(-50%, 0) scale(1);
    }
    76% {
      opacity: 0.95;
      filter: blur(0);
      transform: translate(-50%, -12px) scale(1);
    }
    100% {
      opacity: 0;
      filter: blur(7px);
      transform: translate(calc(-50% + var(--drift, 0px)), -46px) scale(1.03);
    }
  }

  @keyframes cloud-morph {
    0%, 100% {
      border-radius: 42% 58% 70% 30% / 45% 45% 55% 55%;
    }
    33% {
      border-radius: 70% 30% 52% 48% / 60% 40% 60% 40%;
    }
    66% {
      border-radius: 50% 60% 40% 60% / 50% 40% 60% 50%;
    }
  }

  @keyframes blink {
    from, to { color: transparent; }
    50% { color: inherit; }
  }

  @keyframes slide-down-fade {
    from {
      opacity: 0;
      transform: translateY(-20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

/* Reduced Motion Settings */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .circle-pulse-trigger::after {
    animation: none !important;
  }
}

.preset-app-badge {
  font-size: 0.72rem;
  padding: 0.35rem 0.7rem;
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.25s var(--transition-easing);
}

.preset-app-badge:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px var(--accent-glow);
}

/* Sleek premium scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  transition: background 0.3s ease;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* 无障碍：尊重系统“减少动态效果”偏好。本应用面向焦虑用户，更应避免感官过载 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ═══ 平台直达选择器（搜索栏内右侧，tryrevive 核心交互） ═══ */
.search-platform-select {
  position: absolute;
  right: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  color: var(--text-muted, rgba(255,255,255,0.55));
  font-size: 0.78rem;
  font-family: inherit;
  padding: 0.42rem 1.7rem 0.42rem 0.9rem;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  outline: none;
  transition: color 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='rgba(255,255,255,0.45)' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  z-index: 2;
}
.search-platform-select:hover,
.search-platform-select:focus {
  color: var(--text-primary, #fff);
  border-color: rgba(255, 255, 255, 0.2);
  background-color: rgba(255, 255, 255, 0.1);
}
.search-platform-select option {
  background: #14161f;
  color: #eaeaea;
}
/* 给右侧选择器留出空间 */
.search-wrapper .search-input { padding-right: 8.4rem; }
@media (max-width: 520px) {
  .search-platform-select { font-size: 0.7rem; padding: 0.36rem 1.5rem 0.36rem 0.7rem; }
  .search-wrapper .search-input { padding-right: 7.2rem; }
}

/* ═══ AI 心语对话：高透明气泡，催促而不压迫 ═══ */
.ai-chat-toggle {
  position: fixed;
  right: 26px;
  bottom: 26px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  cursor: pointer;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease, background 0.3s ease;
}
.ai-chat-toggle:hover { transform: scale(1.08); background: rgba(255,255,255,0.1); }
.ai-chat-orb {
  width: 18px; height: 18px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, var(--accent, #8ab4ff) 70%);
  box-shadow: 0 0 14px var(--accent-glow, rgba(138,180,255,0.5));
  animation: chat-orb-breathe 3s ease-in-out infinite;
}
@keyframes chat-orb-breathe {
  0%,100% { transform: scale(1); opacity: .8; }
  50%     { transform: scale(1.15); opacity: 1; }
}

/* ☁️ 云朵心语：定时飘出来的状态问候 */
.cloud-checkin {
  position: fixed;
  right: 90px;
  bottom: 32px;
  max-width: 260px;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 1rem;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 22px 22px 6px 22px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255,255,255,0.12);
  cursor: pointer;
  z-index: 95;
  opacity: 0;
  transform: translateX(24px) translateY(6px) scale(0.92);
  pointer-events: none;
  transition: opacity 0.6s var(--transition-easing), transform 0.6s var(--transition-easing);
}
.cloud-checkin.show {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.cloud-checkin:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: var(--accent, #8ab4ff);
}
.cloud-checkin-emoji {
  font-size: 1.35rem;
  line-height: 1;
  animation: cloud-drift 4.5s ease-in-out infinite;
  filter: drop-shadow(0 0 8px rgba(255,255,255,0.35));
}
@keyframes cloud-drift {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-5px); }
}
.cloud-checkin-text {
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text-primary, #eee);
}
.cloud-checkin-close {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(30, 32, 45, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-muted, #999);
  font-size: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.cloud-checkin-close:hover { color: #fff; }

.ai-chat-panel {
  position: fixed;
  right: 26px;
  bottom: 92px;
  width: min(340px, calc(100vw - 40px));
  max-height: 480px;
  display: none;
  flex-direction: column;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 12, 20, 0.55);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  z-index: 95;
  overflow: hidden;
  animation: chat-panel-in 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.ai-chat-panel.open { display: flex; }
@keyframes chat-panel-in {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.ai-chat-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.85rem 1.1rem 0.6rem;
  font-size: 0.78rem; letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.5);
}
.ai-chat-close { color: rgba(255,255,255,0.4); cursor: pointer; font-size: 0.8rem; }
.ai-chat-close:hover { color: #fff; }

.ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.4rem 1rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-height: 160px;
  max-height: 330px;
}

.chat-bubble {
  max-width: 85%;
  padding: 0.6rem 0.9rem;
  border-radius: 16px;
  font-size: 0.85rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  animation: bubble-float-in 0.4s ease;
}
@keyframes bubble-float-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.chat-ai {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.88);
  border-bottom-left-radius: 5px;
}
.chat-user {
  align-self: flex-end;
  background: color-mix(in srgb, var(--accent, #8ab4ff) 22%, transparent);
  color: rgba(255, 255, 255, 0.92);
  border-bottom-right-radius: 5px;
}

.ai-chat-inputrow {
  display: flex; gap: 0.5rem;
  padding: 0.7rem 0.9rem 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.goal-step-time {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.15rem 0.15rem 0;
  color: var(--text-muted);
  font-size: 0.7rem;
}

.goal-step-time strong,
.goal-time-pill {
  padding: 0.22rem 0.55rem;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  color: var(--accent-light);
  font-size: 0.68rem;
  font-weight: 600;
  white-space: nowrap;
}

.goal-plan-steps-display {
  padding-top: 0.7rem;
  margin-top: 0.25rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
}

.goal-plan-step-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.48rem 0;
}

.goal-plan-step-row + .goal-plan-step-row {
  border-top: 1px solid rgba(255, 255, 255, 0.045);
}

.goal-plan-step-row > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.goal-plan-step-row strong {
  color: var(--accent);
  font-size: 0.7rem;
}

.goal-plan-step-row > div > span {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.76rem;
  line-height: 1.4;
}

.ai-plan-action {
  padding: 0 0.9rem 0.7rem;
}

.ai-generate-plan {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid color-mix(in srgb, var(--accent, #8ab4ff) 38%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent, #8ab4ff) 10%, transparent);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms var(--transition-easing);
}

.ai-generate-plan:hover {
  background: color-mix(in srgb, var(--accent, #8ab4ff) 17%, transparent);
  border-color: color-mix(in srgb, var(--accent, #8ab4ff) 58%, transparent);
  transform: translateY(-1px);
}

.ai-generate-plan:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent, #8ab4ff) 35%, transparent);
  outline-offset: 2px;
}

.ai-generate-plan:disabled {
  cursor: wait;
  opacity: 0.62;
  transform: none;
}

.goal-popup-card.plan-updated {
  animation: plan-confirm 900ms var(--transition-easing);
}

@keyframes plan-confirm {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 0%, transparent); }
  35% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 28%, transparent), 0 14px 40px rgba(0, 0, 0, 0.28); }
  100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 0%, transparent); }
}

@media (prefers-reduced-motion: reduce) {
  .ai-generate-plan,
  .goal-popup-card.plan-updated {
    transition: none;
    animation: none;
  }
}
.ai-chat-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 0.55rem 1rem;
  font-size: 0.85rem;
  color: var(--text-primary, #fff);
  outline: none;
}
.ai-chat-input:focus { border-color: var(--accent, #8ab4ff); }
.ai-chat-send {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--accent, #8ab4ff);
  color: #0a0c14; font-size: 1rem; font-weight: 700;
  cursor: pointer; border: none;
  transition: transform 0.2s ease;
}
.ai-chat-send:hover { transform: scale(1.08); }

/* ═══════════════════════════════════════════════════════════════════════
   Local Liquid Glass Skin · 2026-07-11
   参考 C:/Users/10300/Desktop/liquid-glass 的浅色液态玻璃方向。
   这层只改视觉，不改产品流程与跳转逻辑。
   ═══════════════════════════════════════════════════════════════════════ */
:root {
  color-scheme: light;
  --theme-h: 7;
  --theme-s: 100%;
  --theme-l: 68%;

  --accent: #ff6f61;
  --accent-light: #ff9a88;
  --accent-glow: rgba(255, 111, 97, 0.2);
  --accent-fill: #ff6f61;
  --accent-fill-light: #ff917f;
  --accent-violet: #8069ff;
  --accent-cyan: #3ec6e0;

  --font-title: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;

  --bg-gradient-start: #f9fbff;
  --bg-gradient-end: #f8f2ff;
  --surface-glass: rgba(255, 255, 255, 0.58);
  --surface-glass-strong: rgba(255, 255, 255, 0.78);
  --surface-glass-soft: rgba(255, 255, 255, 0.34);
  --surface-glass-border: rgba(255, 255, 255, 0.76);
  --surface-hairline: rgba(78, 94, 129, 0.13);
  --text-primary: #142033;
  --text-muted: #68758a;
  --text-soft: #7d879a;

  --border-radius-card: 24px;
  --border-radius-pill: 999px;
  --glass-shadow:
    0 24px 70px rgba(59, 75, 110, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --glass-shadow-quiet:
    0 14px 42px rgba(59, 75, 110, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

html {
  background: #edf6ff;
}

body {
  color: var(--text-primary);
  background:
    radial-gradient(circle at 12% 20%, rgba(255, 194, 178, 0.78), transparent 29%),
    radial-gradient(circle at 82% 10%, rgba(171, 223, 255, 0.82), transparent 31%),
    radial-gradient(circle at 76% 86%, rgba(205, 188, 255, 0.72), transparent 32%),
    linear-gradient(145deg, #f9fbff 0%, #edf6ff 42%, #f8f2ff 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: 0;
  border-radius: 999px;
}

body::before {
  width: min(58vw, 520px);
  height: min(58vw, 520px);
  left: max(-150px, -12vw);
  top: 14vh;
  background: linear-gradient(140deg, rgba(255, 132, 111, 0.34), rgba(255, 211, 164, 0.18));
  filter: blur(16px);
  animation: liquid-orb-drift 17s ease-in-out infinite alternate;
}

body::after {
  width: min(68vw, 620px);
  height: min(68vw, 620px);
  right: max(-210px, -18vw);
  top: -8vh;
  background: conic-gradient(from 210deg, rgba(255, 128, 111, 0.22), rgba(90, 195, 255, 0.25), rgba(153, 121, 255, 0.24), rgba(255, 128, 111, 0.22));
  filter: blur(18px);
  animation: liquid-orb-drift 20s ease-in-out -6s infinite alternate;
}

@keyframes liquid-orb-drift {
  to {
    transform: translate3d(34px, -24px, 0) scale(1.06);
  }
}

.app-viewport {
  z-index: 1;
  max-width: min(600px, calc(100vw - 18px));
  height: min(100dvh, 940px);
  margin: auto;
  border-left: 1px solid rgba(255, 255, 255, 0.38);
  border-right: 1px solid rgba(255, 255, 255, 0.38);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.08)),
    rgba(255, 255, 255, 0.08);
  box-shadow: 0 30px 110px rgba(58, 72, 105, 0.12);
  backdrop-filter: blur(8px) saturate(1.12);
  -webkit-backdrop-filter: blur(8px) saturate(1.12);
}

.app-viewport::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.028;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.view-screen {
  z-index: 1;
  padding: 2.1rem 1.35rem;
}

.view-screen.active {
  z-index: 10;
}

.narrative-paper {
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 194, 178, 0.48), transparent 31%),
    radial-gradient(circle at 78% 16%, rgba(126, 201, 255, 0.36), transparent 34%),
    radial-gradient(circle at 70% 82%, rgba(205, 188, 255, 0.45), transparent 34%),
    linear-gradient(150deg, rgba(255, 255, 255, 0.72), rgba(242, 248, 255, 0.58));
  color: var(--text-primary);
}

.narrative-paper::before,
.glass-card::before,
.goal-popup-card::before,
.dialog-content::before,
.ai-chat-panel::before {
  content: "";
  position: absolute;
  inset: 1px;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.42), transparent 36%, rgba(255, 255, 255, 0.1) 62%, rgba(255, 255, 255, 0.28));
}

.narrative-content {
  padding: 1.45rem;
  border: 1px solid var(--surface-glass-border);
  border-radius: 30px;
  background:
    radial-gradient(240px circle at 18% 12%, rgba(255, 255, 255, 0.72), transparent 66%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.2));
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(26px) saturate(1.35) brightness(1.04);
  -webkit-backdrop-filter: blur(26px) saturate(1.35) brightness(1.04);
}

.narrative-line {
  color: rgba(20, 32, 51, 0.82);
  font-family: var(--font-serif);
}

.skip-narrative-btn {
  color: rgba(20, 32, 51, 0.62);
  border-color: rgba(255, 255, 255, 0.74);
  background: rgba(255, 255, 255, 0.42);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.78), 0 10px 30px rgba(58,72,105,0.08);
}

.skip-narrative-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.72);
}

.glass-card,
.goal-popup-card,
.dialog-content,
.alert-blocking-card,
.app-dock-grid,
.wreath-slider-overlay,
.pet-mini-console,
.ai-chat-panel,
.cloud-checkin,
.ai-chat-toggle {
  position: relative;
  isolation: isolate;
  border: 1px solid var(--surface-glass-border);
  background:
    radial-gradient(220px circle at 18% 10%, rgba(255, 255, 255, 0.7), transparent 66%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.52), rgba(255, 255, 255, 0.18));
  color: var(--text-primary);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(26px) saturate(1.32) brightness(1.04);
  -webkit-backdrop-filter: blur(26px) saturate(1.32) brightness(1.04);
}

.glass-card,
.goal-popup-card {
  border-radius: 26px;
}

.glass-card {
  padding: 2rem 1.55rem;
}

.title-lg {
  color: var(--text-primary);
  font-family: var(--font-title);
  font-weight: 720;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.desc-md,
.dialog-body,
.blocking-warning-body,
.dock-app-label,
.field-helper,
.step-minutes-editor,
.goal-step-time {
  color: var(--text-muted);
}

.input-label {
  color: #6f5cf0;
  font-family: var(--font-body);
  font-weight: 720;
  letter-spacing: 0.075em;
}

.text-input,
.search-input,
.ai-chat-input,
.step-minutes-editor input,
.plan-total-time {
  border: 1px solid rgba(255, 255, 255, 0.78);
  background:
    radial-gradient(180px circle at 18% 10%, rgba(255, 255, 255, 0.72), transparent 70%),
    rgba(255, 255, 255, 0.42);
  color: var(--text-primary);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.82), 0 8px 24px rgba(58, 72, 105, 0.08);
  backdrop-filter: blur(16px) saturate(1.18);
  -webkit-backdrop-filter: blur(16px) saturate(1.18);
}

.text-input::placeholder,
.search-input::placeholder,
.ai-chat-input::placeholder {
  color: #6f7a90;
}

.text-input:focus,
.search-input:focus,
.ai-chat-input:focus,
.step-minutes-editor input:focus {
  border-color: rgba(128, 105, 255, 0.56);
  background: rgba(255, 255, 255, 0.66);
  box-shadow:
    0 0 0 4px rgba(128, 105, 255, 0.12),
    0 12px 32px rgba(58, 72, 105, 0.12),
    inset 0 1px 0 rgba(255,255,255,0.92);
}

select.text-input,
.search-platform-select option {
  background-color: #f6f9ff;
  color: var(--text-primary);
}

.quiz-option-btn,
.quiz-visual-card,
.goal-suggest-btn,
.preset-app-badge {
  border: 1px solid rgba(255, 255, 255, 0.74);
  background: rgba(255, 255, 255, 0.38);
  color: var(--text-primary);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.68);
}

.quiz-option-btn:hover,
.quiz-visual-card:hover,
.quiz-visual-card.active,
.goal-suggest-btn:hover,
.preset-app-badge:hover {
  border-color: rgba(128, 105, 255, 0.5);
  background: rgba(255, 255, 255, 0.66);
  box-shadow: 0 12px 32px rgba(58, 72, 105, 0.12), inset 0 1px 0 rgba(255,255,255,0.92);
}

.quiz-progress-bar {
  background: rgba(92, 111, 145, 0.12);
}

.quiz-progress-fill {
  background: linear-gradient(90deg, var(--accent), var(--accent-violet));
}

.wreath-center-mandala,
.avatar-canvas,
.dock-panel {
  border-color: rgba(255, 255, 255, 0.62);
  background: rgba(255, 255, 255, 0.18);
}

.wreath-slider-overlay {
  color: var(--text-primary);
}

.btn-primary,
.ai-chat-send {
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.46);
  background: linear-gradient(145deg, #ff8779, #ff6258 52%, #9a62ec);
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.64), 0 12px 28px rgba(255, 95, 88, 0.25);
}

.btn-primary:hover,
.ai-chat-send:hover {
  background: linear-gradient(145deg, #ff9b8f, #ff6f61 52%, #a878ff);
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.7), 0 16px 36px rgba(255, 95, 88, 0.3);
}

.btn-sec,
.btn-sec[style],
.preset-app-badge {
  color: var(--text-primary) !important;
  border-color: rgba(255, 255, 255, 0.72) !important;
  background: rgba(255, 255, 255, 0.38) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.72), 0 8px 24px rgba(58,72,105,0.08);
}

.btn-sec:hover,
.preset-app-badge:hover {
  background: rgba(255, 255, 255, 0.7) !important;
  border-color: rgba(128, 105, 255, 0.48) !important;
}

.dialog-overlay {
  position: fixed;
  background:
    radial-gradient(circle at 16% 20%, rgba(255, 194, 178, 0.34), transparent 30%),
    radial-gradient(circle at 82% 12%, rgba(171, 223, 255, 0.4), transparent 32%),
    rgba(238, 245, 255, 0.66);
  backdrop-filter: blur(20px) saturate(1.15);
  -webkit-backdrop-filter: blur(20px) saturate(1.15);
}

.dialog-content {
  border-radius: 28px;
  box-shadow: 0 30px 90px rgba(58, 72, 105, 0.18), inset 0 1px 0 rgba(255,255,255,0.9);
}

.dialog-title {
  font-family: var(--font-title);
  color: #6f5cf0;
}

.plan-step-editor,
.ai-service-ready,
.goal-plan-steps-display,
.ai-chat-inputrow {
  border-color: rgba(78, 94, 129, 0.12);
  background: rgba(255, 255, 255, 0.34);
  color: var(--text-muted);
}

.plan-total-time,
.ai-service-ready,
.goal-time-pill,
.goal-step-time strong {
  color: #6f5cf0;
}

.step-minutes-editor input {
  color: var(--text-primary);
}

.search-wrapper {
  filter: drop-shadow(0 18px 42px rgba(58, 72, 105, 0.13));
}

.search-input {
  padding-top: 1.05rem;
  padding-bottom: 1.05rem;
}

.search-icon,
.ai-chat-close,
.cloud-checkin-close {
  color: var(--text-muted);
}

.search-platform-select {
  color: #4e5970;
  border-color: rgba(255, 255, 255, 0.78);
  background-color: rgba(255, 255, 255, 0.48);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='rgba(20,32,51,0.52)' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.72);
}

.search-platform-select:hover,
.search-platform-select:focus {
  color: var(--text-primary);
  border-color: rgba(128, 105, 255, 0.42);
  background-color: rgba(255, 255, 255, 0.76);
}

.app-dock-grid {
  min-height: 108px;
  border-radius: 24px;
}

.dock-app-icon {
  border-color: rgba(255, 255, 255, 0.58);
  box-shadow: 0 10px 24px rgba(58, 72, 105, 0.16), inset 0 1px 1px rgba(255,255,255,0.34);
}

.dock-app-item:hover .dock-app-icon {
  border-color: rgba(128, 105, 255, 0.62);
}

.dock-nav-btn,
.dock-app-delete-btn {
  box-shadow: 0 6px 16px rgba(58,72,105,0.16);
}

.dock-nav-btn {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(255, 255, 255, 0.8);
  color: #6f5cf0;
}

.floating-desk-pet-container {
  filter: drop-shadow(0 20px 28px rgba(58, 72, 105, 0.18));
}

.pet-mini-console {
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--glass-shadow-quiet);
}

.pet-mini-console button {
  color: var(--text-primary);
  background: rgba(255,255,255,0.44);
}

.pet-mini-console button:hover {
  background: rgba(255,255,255,0.74);
}

.ai-chat-toggle {
  width: 58px;
  height: 58px;
}

.ai-chat-toggle:hover {
  background: rgba(255,255,255,0.7);
}

.ai-chat-orb {
  background: radial-gradient(circle at 35% 30%, #fff, #ff7a6d 46%, #8069ff 86%);
  box-shadow: 0 0 20px rgba(255,111,97,0.38), 0 0 34px rgba(128,105,255,0.18);
}

.cloud-checkin {
  color: var(--text-primary);
  border-radius: 24px 24px 8px 24px;
}

.cloud-checkin:hover {
  border-color: rgba(128, 105, 255, 0.5);
  background: rgba(255, 255, 255, 0.72);
}

.cloud-checkin-text,
.chat-ai,
.chat-user,
.goal-plan-step-row > div > span,
.ai-generate-plan {
  color: var(--text-primary);
}

.cloud-checkin-close {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(255, 255, 255, 0.8);
}

.cloud-checkin-close:hover {
  color: var(--text-primary);
}

.ai-chat-panel {
  border-radius: 26px;
}

.ai-chat-head {
  color: rgba(20, 32, 51, 0.58);
}

.chat-bubble {
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.58);
}

.chat-ai {
  background: rgba(255, 255, 255, 0.58);
}

.chat-user {
  background: linear-gradient(145deg, rgba(255, 111, 97, 0.22), rgba(128, 105, 255, 0.18));
}

.ai-generate-plan,
.goal-time-pill,
.goal-step-time strong {
  border-color: rgba(128, 105, 255, 0.24);
  background: rgba(128, 105, 255, 0.08);
}

.ai-generate-plan:hover {
  border-color: rgba(128, 105, 255, 0.45);
  background: rgba(128, 105, 255, 0.14);
}

.goal-plan-steps-display,
.goal-plan-step-row + .goal-plan-step-row,
.ai-chat-inputrow {
  border-color: rgba(78, 94, 129, 0.12);
}

.goal-plan-step-row strong {
  color: #6f5cf0;
}

.alert-blocking-overlay {
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 111, 97, 0.22), transparent 34%),
    rgba(245, 248, 255, 0.72);
}

.alert-blocking-card {
  border-color: rgba(255, 111, 97, 0.28);
  background:
    radial-gradient(260px circle at 20% 0%, rgba(255, 255, 255, 0.78), transparent 68%),
    linear-gradient(145deg, rgba(255,255,255,0.72), rgba(255,255,255,0.28));
}

.blocking-warning-title,
.reborn-banner-title {
  color: #e24f48;
}

.circle-pulse-trigger {
  background:
    radial-gradient(circle at 35% 28%, rgba(255,255,255,0.9), rgba(255,255,255,0.32) 58%, rgba(128,105,255,0.18));
  border-color: rgba(128, 105, 255, 0.42);
  box-shadow: 0 16px 44px rgba(58, 72, 105, 0.14), inset 0 1px 0 rgba(255,255,255,0.86);
}

.circle-pulse-trigger:hover {
  border-color: rgba(128, 105, 255, 0.58);
  box-shadow: 0 18px 54px rgba(128, 105, 255, 0.18);
}

.meditation-trigger-icon,
.meditation-timer,
.breathing-text {
  color: var(--text-primary);
}

.meditation-timer,
.avatar-state-badge,
.reborn-banner {
  border-color: rgba(255, 255, 255, 0.68);
  background: rgba(255, 255, 255, 0.42);
  color: var(--text-primary);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.72);
}

.galaxy-header .btn-sec {
  color: var(--text-primary) !important;
}

.thought-bubble {
  color: rgba(20, 32, 51, 0.88);
  text-shadow: 0 0 24px rgba(255,255,255,0.8), 0 1px 1px rgba(255,255,255,0.45);
}

::-webkit-scrollbar-thumb {
  background: rgba(104, 117, 138, 0.22);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(128, 105, 255, 0.44);
}

@media (min-width: 760px) {
  body {
    padding: 18px;
  }

  .app-viewport {
    border-radius: 34px;
    overflow: hidden;
  }
}

@media (max-width: 520px) {
  .app-viewport {
    max-width: 100vw;
    height: 100dvh;
    border-left: 0;
    border-right: 0;
  }

  .view-screen {
    padding: 1.8rem 1.08rem;
  }

  .ai-chat-toggle {
    right: 18px;
    bottom: 18px;
  }

  .ai-chat-panel {
    right: 14px;
    bottom: 86px;
    width: calc(100vw - 28px);
  }

  .cloud-checkin {
    right: 78px;
    bottom: 24px;
    max-width: calc(100vw - 118px);
  }
}

@media (prefers-reduced-motion: reduce) {
  body::before,
  body::after {
    animation: none !important;
  }
}

/* ================================================================
   Local polish pass · 2026-07-11
   Tightens hierarchy, interaction states, and mobile behavior while
   preserving the existing product flow and Liquid Glass direction.
   ================================================================ */
:root {
  --font-serif: var(--font-body);
  --ui-accent: #6f5cf0;
  --ui-accent-strong: #5945de;
  --ui-accent-soft: rgba(111, 92, 240, 0.1);
  --ui-coral: #e95f56;
  --ui-success: #168a67;
  --ui-focus-ring: rgba(111, 92, 240, 0.2);
  --control-height: 44px;
  --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
  --app-edge-offset: max(20px, calc((100vw - min(600px, calc(100vw - 18px))) / 2 + 20px));
}

body {
  scrollbar-color: rgba(76, 91, 118, 0.32) transparent;
}

button,
input,
select,
textarea,
[role="button"] {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible {
  outline: 3px solid var(--ui-focus-ring);
  outline-offset: 2px;
}

button:active,
[role="button"]:active {
  transform: translateY(1px);
}

/* An identity transform still traps fixed descendants. Removing it on the
   active screen lets the AI chat and cloud prompt use the real viewport. */
.view-screen.active {
  transform: none;
}

.view-screen {
  scroll-behavior: smooth;
  scrollbar-color: rgba(76, 91, 118, 0.3) transparent;
}

.title-lg,
.dialog-title,
.blocking-warning-title,
.meditation-timer,
.breathing-text,
.input-label,
.btn-sec {
  font-family: var(--font-body);
}

.input-label {
  color: var(--ui-accent);
  text-transform: none;
  letter-spacing: 0.025em;
  line-height: 1.45;
}

.desc-md,
.dialog-body,
.field-helper,
.step-minutes-editor,
.goal-step-time {
  line-height: 1.6;
}

.btn-primary,
.btn-sec,
.goal-suggest-btn,
.preset-app-badge,
.ai-generate-plan {
  min-height: var(--control-height);
  transition:
    transform 180ms var(--ease-out-quint),
    background-color 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.btn-primary {
  font-weight: 700;
  letter-spacing: 0.01em;
}

.btn-primary:disabled,
.btn-sec:disabled,
.goal-suggest-btn:disabled,
.ai-generate-plan:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  box-shadow: none;
  transform: none;
}

.text-input,
.search-input,
.ai-chat-input {
  caret-color: var(--ui-accent);
}

/* Home hierarchy */
#view-home {
  justify-content: flex-start;
  padding-bottom: calc(2.2rem + env(safe-area-inset-bottom));
}

#view-home > header {
  position: sticky;
  top: -0.5rem;
  z-index: 30;
  min-height: 48px;
  padding: 0.35rem 0.15rem 0.55rem !important;
  background: linear-gradient(180deg, rgba(246, 250, 255, 0.72), rgba(246, 250, 255, 0));
  backdrop-filter: blur(12px) saturate(1.12);
  -webkit-backdrop-filter: blur(12px) saturate(1.12);
}

#view-home > header .btn-sec {
  min-height: 40px;
  padding: 0.45rem 0.82rem !important;
  font-size: 0.75rem !important;
  color: #344158 !important;
}

.google-home-container {
  flex: 0 0 auto !important;
  justify-content: flex-start !important;
  align-items: stretch !important;
  padding: 0.9rem 0 0.8rem !important;
}

.google-home-container > div:first-child {
  margin-bottom: 1.35rem !important;
  padding: 0 0.45rem;
}

#dashboard-welcome-title {
  margin-bottom: 0.45rem !important;
  font-family: var(--font-body) !important;
  font-size: 2rem !important;
  font-weight: 760 !important;
  line-height: 1.18;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

#dashboard-mbti-label {
  max-width: 52ch;
  margin-inline: auto;
  color: #55647c !important;
  font-size: 0.82rem !important;
  font-weight: 520 !important;
  line-height: 1.6;
  letter-spacing: 0 !important;
  text-wrap: pretty;
}

.google-search-wrapper {
  margin-bottom: 1.35rem !important;
}

.search-wrapper {
  filter: drop-shadow(0 15px 30px rgba(58, 72, 105, 0.11));
}

.search-input {
  min-height: 56px;
  padding-left: 3.25rem;
  font-size: 0.92rem;
  border-color: rgba(255, 255, 255, 0.86);
  background: rgba(255, 255, 255, 0.58);
}

.search-icon {
  left: 1.25rem;
  width: 19px;
  height: 19px;
  color: #728097;
}

.search-wrapper:focus-within .search-icon {
  color: var(--ui-accent);
}

.search-platform-select {
  min-height: 40px;
  color: #425068;
  font-weight: 600;
}

.dock-panel {
  margin-inline: auto;
}

.dock-panel > div:first-child {
  margin-bottom: 0.65rem !important;
  padding-inline: 0.35rem !important;
}

.dock-panel .input-label {
  color: #536078 !important;
  font-size: 0.73rem !important;
  font-weight: 650 !important;
  letter-spacing: 0.035em;
}

#edit-dock-btn {
  min-width: 44px;
  min-height: 40px;
  justify-content: center;
  color: var(--ui-accent) !important;
  border-radius: 999px;
}

#edit-dock-btn:hover {
  background: var(--ui-accent-soft);
}

.app-dock-grid {
  min-height: 112px;
  padding: 1rem 0.85rem;
  column-gap: 0.7rem;
  row-gap: 1rem;
  border-color: rgba(255, 255, 255, 0.82);
  background:
    radial-gradient(260px circle at 18% 0%, rgba(255, 255, 255, 0.74), transparent 72%),
    rgba(255, 255, 255, 0.4);
  box-shadow: var(--glass-shadow-quiet);
}

.dock-app-item {
  min-width: 0;
  min-height: 72px;
  justify-content: flex-start;
  padding: 0.15rem 0;
  border-radius: 15px;
}

.dock-app-item:hover {
  transform: translateY(-2px);
}

.dock-app-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
}

.dock-app-label {
  margin-top: 0.45rem;
  color: #55637a;
  font-size: 0.73rem;
}

/* The existing inline dark style is intentionally replaced for the light UI. */
#goal-coach-popup {
  margin-top: 0.55rem;
  margin-bottom: 1.15rem !important;
  padding: 1.25rem;
  gap: 0.85rem;
  border-color: rgba(255, 255, 255, 0.82) !important;
  background:
    radial-gradient(260px circle at 12% 0%, rgba(255, 255, 255, 0.8), transparent 70%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.62), rgba(246, 244, 255, 0.36)) !important;
  box-shadow: var(--glass-shadow-quiet);
}

#goal-coach-popup > div:first-child > button {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #65728a !important;
}

#goal-coach-popup > div:first-child > button:hover {
  background: rgba(82, 96, 124, 0.08);
}

#goal-plan-title {
  color: var(--ui-accent) !important;
  font-size: 0.76rem !important;
  font-weight: 750 !important;
}

#goal-coach-popup > div:nth-child(2) {
  color: #344158;
  line-height: 1.55;
}

#goal-first-step-input {
  min-height: 46px;
  border-radius: 14px !important;
  background: rgba(255, 255, 255, 0.56);
}

.goal-step-time,
.goal-plan-step-row > div > span {
  color: #5d6a80;
}

.goal-step-time strong,
.goal-time-pill,
.goal-plan-step-row strong {
  color: var(--ui-accent-strong);
}

.goal-suggest-list {
  gap: 0.6rem;
}

.goal-suggest-btn {
  min-width: 0;
  padding: 0.55rem 0.4rem !important;
  border-radius: 14px;
  color: #3e4a60;
  font-size: 0.72rem !important;
}

.goal-plan-steps-display {
  margin-top: 0.35rem;
  padding-top: 0.35rem;
  border-top-style: solid;
  background: transparent;
}

.goal-plan-step-row {
  min-height: 58px;
  padding: 0.62rem 0.15rem;
}

.goal-plan-step-row strong {
  font-size: 0.72rem;
}

.goal-plan-step-row > div > span {
  font-size: 0.79rem;
}

.goal-time-pill,
.goal-step-time strong,
.ai-generate-plan {
  border-color: rgba(111, 92, 240, 0.2);
  background: var(--ui-accent-soft);
}

.reborn-banner {
  padding: 0.8rem 1rem;
  border-color: rgba(233, 95, 86, 0.18);
  background: rgba(255, 255, 255, 0.42);
}

.reborn-banner-title {
  color: #b8443e;
  font-size: 0.8rem;
}

.meditation-trigger-box {
  padding: 0.75rem 0 0.25rem;
}

.circle-pulse-trigger {
  width: 62px;
  height: 62px;
}

/* AI chat */
.ai-chat-toggle {
  position: fixed;
  right: var(--app-edge-offset);
  bottom: max(20px, env(safe-area-inset-bottom));
  width: 54px;
  height: 54px;
  z-index: 120;
  box-shadow: 0 16px 38px rgba(75, 68, 130, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.ai-chat-panel {
  position: fixed;
  right: var(--app-edge-offset);
  bottom: calc(max(20px, env(safe-area-inset-bottom)) + 68px);
  width: min(380px, calc(100vw - 40px));
  max-height: min(610px, calc(100dvh - 120px));
  z-index: 121;
  border-color: rgba(255, 255, 255, 0.88);
  background:
    radial-gradient(300px circle at 15% 0%, rgba(255, 255, 255, 0.82), transparent 72%),
    rgba(246, 248, 255, 0.78);
  box-shadow: 0 28px 80px rgba(54, 62, 94, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.ai-chat-head {
  min-height: 48px;
  padding: 0.8rem 1rem 0.65rem;
  color: #526078;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.ai-chat-close {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
}

.ai-chat-close:hover {
  color: var(--text-primary);
  background: rgba(82, 96, 124, 0.08);
}

.ai-chat-messages {
  min-height: 210px;
  max-height: min(360px, 46dvh);
  padding: 0.45rem 1rem 0.85rem;
}

.chat-bubble {
  max-width: 88%;
  padding: 0.68rem 0.9rem;
  line-height: 1.6;
}

.chat-ai {
  border: 1px solid rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.64);
}

.chat-user {
  border: 1px solid rgba(111, 92, 240, 0.12);
  background: linear-gradient(145deg, rgba(255, 111, 97, 0.15), rgba(111, 92, 240, 0.14));
}

.ai-plan-action {
  padding: 0 0.9rem 0.65rem;
}

.ai-generate-plan {
  color: var(--ui-accent-strong);
}

.ai-chat-inputrow {
  padding: 0.7rem 0.8rem 0.8rem;
  background: rgba(255, 255, 255, 0.28);
}

.ai-chat-input {
  min-height: 42px;
  background: rgba(255, 255, 255, 0.64);
}

.ai-chat-send {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
}

.cloud-checkin {
  position: fixed;
  right: calc(var(--app-edge-offset) + 66px);
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 122;
  max-width: min(270px, calc(100vw - 118px));
}

.ai-chat-toggle[hidden],
.ai-chat-panel[hidden],
.cloud-checkin[hidden] {
  display: none !important;
}

/* Dialogs and planning editors */
.dialog-overlay {
  padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
}

.dialog-content {
  max-width: 480px;
  max-height: min(88dvh, 820px);
  padding: 1.5rem;
  gap: 1rem;
  overscroll-behavior: contain;
}

.dialog-title {
  color: var(--ui-accent) !important;
  font-size: 1.18rem;
  font-weight: 760;
  line-height: 1.4;
}

.dialog-body {
  color: #59667c;
}

.plan-step-editor,
.ai-service-ready {
  border-color: rgba(79, 94, 124, 0.11);
  background: rgba(255, 255, 255, 0.32);
}

.plan-step-editor {
  padding: 0.9rem;
  border-radius: 16px;
}

.plan-total-time {
  color: var(--ui-accent-strong);
  background: rgba(111, 92, 240, 0.08);
}

.step-minutes-editor input {
  min-height: 38px;
  border-color: rgba(79, 94, 124, 0.14);
  background: rgba(255, 255, 255, 0.56);
}

.ai-service-ready {
  color: #286e5c;
}

.ai-service-ready > span {
  background: var(--ui-success);
  box-shadow: 0 0 0 4px rgba(22, 138, 103, 0.1);
}

.floating-desk-pet-container {
  width: 108px;
  height: 108px;
  filter: drop-shadow(0 16px 25px rgba(58, 72, 105, 0.15));
}

.floating-desk-pet-container .avatar-canvas {
  width: 108px !important;
  height: 108px !important;
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 24px;
  background:
    radial-gradient(circle at 48% 38%, rgba(255, 255, 255, 0.42), transparent 38%),
    linear-gradient(145deg, rgba(128, 105, 255, 0.2), rgba(62, 198, 224, 0.15));
  box-shadow:
    0 14px 34px rgba(66, 72, 116, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
  filter: contrast(1.07) saturate(1.12) drop-shadow(0 5px 8px rgba(61, 66, 104, 0.2));
}

#state-badge-container {
  top: 2px !important;
  right: 0 !important;
}

::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-thumb {
  background: rgba(76, 91, 118, 0.28);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(111, 92, 240, 0.42);
}

@media (max-width: 520px) {
  .view-screen {
    padding: max(1.15rem, env(safe-area-inset-top)) 1rem calc(1.6rem + env(safe-area-inset-bottom));
  }

  #view-home > header {
    top: -0.25rem;
  }

  #view-home > header .btn-sec {
    min-height: 42px;
    padding-inline: 0.72rem !important;
  }

  .google-home-container {
    padding-top: 0.55rem !important;
  }

  .google-home-container > div:first-child {
    margin-bottom: 1.1rem !important;
  }

  #dashboard-welcome-title {
    font-size: 1.78rem !important;
  }

  #dashboard-mbti-label {
    font-size: 0.79rem !important;
  }

  .google-search-wrapper {
    margin-bottom: 1.1rem !important;
  }

  .search-input {
    min-height: 54px;
    padding-left: 3rem;
    font-size: 0.88rem;
  }

  .search-wrapper .search-input {
    padding-right: 6.8rem;
  }

  .search-platform-select {
    right: 0.42rem;
    min-height: 38px;
    padding-left: 0.65rem;
    padding-right: 1.45rem;
  }

  .app-dock-grid {
    padding: 0.9rem 0.55rem;
    column-gap: 0.35rem;
  }

  .dock-app-icon {
    width: 46px;
    height: 46px;
  }

  #goal-coach-popup {
    padding: 1.05rem;
    border-radius: 22px;
  }

  .goal-suggest-list {
    gap: 0.4rem;
  }

  .goal-suggest-btn {
    padding-inline: 0.25rem !important;
  }

  .ai-chat-toggle {
    right: max(14px, env(safe-area-inset-right));
    bottom: max(14px, env(safe-area-inset-bottom));
  }

  .ai-chat-panel {
    left: 12px;
    right: 12px;
    bottom: calc(max(14px, env(safe-area-inset-bottom)) + 66px);
    width: auto;
    max-height: calc(100dvh - 96px);
    border-radius: 24px;
  }

  .ai-chat-messages {
    min-height: 180px;
    max-height: 42dvh;
  }

  .cloud-checkin {
    right: 76px;
    bottom: max(19px, env(safe-area-inset-bottom));
    max-width: calc(100vw - 112px);
  }

  .dialog-content {
    max-height: calc(100dvh - 2rem);
    padding: 1.15rem;
    border-radius: 24px;
  }

  .dialog-content > div:last-child {
    position: sticky;
    bottom: -1.15rem;
    z-index: 4;
    margin: 0 -0.25rem -0.15rem;
    padding: 0.75rem 0.25rem 0.15rem;
    background: linear-gradient(180deg, rgba(246, 248, 255, 0), rgba(246, 248, 255, 0.94) 34%);
  }

  .dialog-content > div:last-child > button {
    min-width: 0;
    padding-inline: 0.75rem !important;
    white-space: nowrap;
  }

  #link-intercept-modal .dialog-content > div:last-child > .btn-sec {
    flex: 0 0 34% !important;
  }

  #intercept-confirm-btn {
    flex: 1 1 auto !important;
    font-size: 0.84rem !important;
  }

  .intercept-search-row {
    gap: 0.5rem;
  }

  .intercept-search-confirm {
    flex-basis: 76px;
    padding-inline: 0.7rem;
  }

  .floating-desk-pet-container {
    width: 102px;
    height: 102px;
  }

  .floating-desk-pet-container .avatar-canvas {
    width: 102px !important;
    height: 102px !important;
  }
}

@media (max-width: 360px) {
  .goal-suggest-list {
    grid-template-columns: 1fr;
  }

  .goal-suggest-btn {
    text-align: left;
    padding-inline: 0.8rem !important;
  }

  .dialog-content > div:last-child {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .view-screen {
    transform: none !important;
  }

  .ai-chat-panel,
  .chat-bubble,
  .dock-app-item,
  .circle-pulse-trigger,
  .floating-desk-pet-container {
    animation: none !important;
  }
}

/* Mobile performance mode keeps the color system while avoiding continuous
   full-screen blur, filters, and decorative animation on small devices. */
@media (max-width: 520px), (pointer: coarse) {
  body {
    background: #eff5fb;
  }

  body::before,
  body::after {
    display: none;
  }

  .app-viewport {
    background: rgba(247, 251, 255, 0.96);
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .narrative-content,
  .glass-card,
  .goal-popup-card,
  .dialog-content,
  .alert-blocking-card,
  .app-dock-grid,
  .wreath-slider-overlay,
  .pet-mini-console,
  .ai-chat-panel,
  .cloud-checkin,
  .ai-chat-toggle,
  .text-input,
  .search-input,
  .ai-chat-input,
  .step-minutes-editor input,
  .plan-total-time,
  .dialog-overlay,
  #meditation-setup-overlay {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  .narrative-content,
  .glass-card,
  .goal-popup-card,
  .dialog-content,
  .alert-blocking-card,
  .app-dock-grid,
  .wreath-slider-overlay,
  .pet-mini-console,
  .ai-chat-panel,
  .cloud-checkin,
  .ai-chat-toggle {
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 8px 22px rgba(58, 72, 105, 0.1);
  }

  .text-input,
  .search-input,
  .ai-chat-input,
  .step-minutes-editor input,
  .plan-total-time {
    background: rgba(255, 255, 255, 0.96);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
  }

  .search-wrapper,
  .floating-desk-pet-container,
  .floating-desk-pet-container .avatar-canvas {
    filter: none;
  }

  .floating-desk-pet-container,
  .ai-chat-orb,
  .cloud-checkin-emoji,
  .chat-bubble,
  .ai-chat-panel.open,
  .circle-pulse-trigger,
  .thought-bubble {
    animation: none !important;
  }
}
