:root {
    --cream: #faf6f1;
    --cream2: #f3ece2;
    --cream3: #f5e0d4;
    --terracotta: #c4714a;
    --terracotta-light: #e8a07a;
    --terracotta-pale: #f5e0d4;
    --sage: #7a9e87;
    --sage-light: #a8c4b0;
    --sage-pale: #deeee3;
    --sage-lt: #a8c4b0;
    --lavender: #9b8bb4;
    --lavender-pale: #ede8f5;
    --mauve: #e8a07a;
    --text-dark: #2c2420;
    --text-mid: #6b5b52;
    --text-light: #a09080;
    --ink: #2c2420;
    --ink2: #5a4a44;
    --ink3: #6b5b52;
    --ink4: #a09080;
    --warm: #c4714a;
    --warm-lt: #e8a07a;
    --warm-dk: #7a9e87;
    --white: #ffffff;
    --shadow-soft: 0 4px 24px rgba(44,36,32,0.08);
    --shadow-card: 0 2px 12px rgba(44,36,32,0.06);
    --shadow: 0 8px 24px rgba(44,36,32,0.08);
    --shadow-md: 0 16px 40px rgba(44,36,32,0.12);
    --radius: 20px;
    --radius-sm: 12px;
    --r-sm: 10px;
    --r-md: 14px;
    --r-lg: 20px;
    --r-xl: 28px;
    --nav-h: 64px;
    --font-serif: 'Noto Serif SC', serif;
    --font-sans: 'Noto Sans SC', sans-serif;

    /* Digital World colors */
    --dw-blue: #4a7ec4;
    --dw-blue-light: #7aaae0;
    --dw-blue-pale: #e0ecfa;

    /* Physical World colors */
    --pw-teal: #4a9e8a;
    --pw-teal-light: #7ac4b0;
    --pw-teal-pale: #d4f0ea;

    /* New gradient colors */
    --gradient-primary: linear-gradient(135deg, #c4714a, #e8a07a);
    --gradient-secondary: linear-gradient(135deg, #7a9e87, #a8c4b0);
    --gradient-accent: linear-gradient(135deg, #4a7ec4, #9b8bb4);
  }

  * { box-sizing: border-box; margin: 0; padding: 0; }
  html { scroll-behavior: smooth; }
  body {
    font-family: var(--font-sans);
    background: var(--cream);
    color: var(--text-dark);
    min-height: 100vh;
  }

  /* ===== NAV ===== */
  .nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    background: rgba(250,246,241,0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(196,113,74,0.12);
    padding: 0 32px;
    display: flex; align-items: center; justify-content: space-between;
    height: 64px;
    transition: box-shadow 0.3s, background 0.3s;
  }
  .nav.scrolled { box-shadow: 0 4px 24px rgba(196,113,74,0.10), 0 1px 0 rgba(196,113,74,0.08); }
  .nav-logo {
    font-family: var(--font-serif);
    font-size: 22px; font-weight: 700;
    background: linear-gradient(135deg, #c4714a, #4a7ec4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 2px;
    cursor: pointer;
    transition: opacity 0.2s;
  }
  .nav-logo:hover { opacity: 0.85; }
  .nav-logo span { background: none; -webkit-text-fill-color: var(--text-mid); font-weight: 300; font-size: 13px; margin-left: 8px; }
  .nav-links { display: flex; gap: 4px; }
  .nav-links button {
    background: transparent; border: none;
    font-family: var(--font-sans); font-size: 14px;
    color: var(--text-mid); padding: 8px 14px; border-radius: 10px;
    cursor: pointer; transition: all 0.25s ease;
    display: flex; align-items: center; gap: 6px;
    position: relative; overflow: hidden;
  }
  .nav-links button::before {
    content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(196,113,74,0.08), transparent);
    transition: left 0.4s;
  }
  .nav-links button:hover::before { left: 100%; }
  .nav-links button:hover { background: rgba(196,113,74,0.08); color: var(--terracotta); transform: translateY(-1px); }
  .nav-links button.active {
    background: linear-gradient(135deg, #c4714a, #e8a07a);
    color: white;
    box-shadow: 0 4px 16px rgba(196,113,74,0.35);
  }
  .nav-links button.active::after {
    content: ''; position: absolute; bottom: -1px; left: 50%; transform: translateX(-50%);
    width: 60%; height: 2px;
    background: rgba(255,255,255,0.5);
    border-radius: 2px;
  }
  .nav-links button .nav-dot {
    width: 6px; height: 6px; border-radius: 50%;
  }
  /* domain color dots */
  .dot-spirit { background: var(--terracotta); }
  .dot-digital { background: var(--dw-blue); }
  .dot-physical { background: var(--pw-teal); }
  .dot-neutral { background: var(--sage); }

  /* ===== PAGE SYSTEM ===== */
  .page { display: none; padding-top: 64px; min-height: 100vh; opacity: 0; transform: translateY(20px); transition: opacity 0.4s ease, transform 0.4s ease; }
  .page.active { display: block; opacity: 1; transform: translateY(0); }

  /* ===== BUTTONS ===== */
  .btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 28px; border-radius: 40px;
    font-family: var(--font-sans); font-size: 15px; font-weight: 500;
    cursor: pointer; border: none; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none; position: relative; overflow: hidden;
  }
  .btn::before {
    content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
    transition: left 0.5s;
  }
  .btn:hover::before { left: 100%; }

  .btn-primary {
    background: linear-gradient(135deg, #c4714a, #e8a07a);
    color: white;
    box-shadow: 0 4px 16px rgba(196,113,74,0.3);
  }
  .btn-primary:hover {
    background: linear-gradient(135deg, #7a9e87, #c4714a);
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(196,113,74,0.45);
  }
  .btn-primary:active { transform: translateY(0); box-shadow: 0 2px 8px rgba(196,113,74,0.3); }
  .btn-outline {
    background: transparent; color: var(--terracotta);
    border: 1.5px solid var(--terracotta);
  }
  .btn-outline:hover {
    background: rgba(196,113,74,0.06);
    border-color: var(--sage-light);
    box-shadow: 0 4px 16px rgba(196,113,74,0.15);
    transform: translateY(-2px);
  }
  .btn-alert {
    width: calc(100% - 40px);
    margin: 12px 20px 12px;
    padding: 16px 24px;
    font-size: 15px;
    background: #fde2e4;
    color: #8b1f24;
    border: 1px solid #f5c2c7;
    box-shadow: 0 10px 22px rgba(245, 194, 199, 0.24);
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
  }
  .btn-alert:hover {
    background: #f8d0d5;
    transform: translateY(-2px);
  }
  .btn-alert.pulse {
    animation: pulse-red 1s ease-in-out infinite;
  }
  @keyframes pulse-red {
    0% { transform: translateY(0) scale(1); box-shadow: 0 0 0 0 rgba(248, 191, 196, 0.6); }
    50% { transform: translateY(-3px) scale(1.02); box-shadow: 0 0 0 16px rgba(248, 191, 196, 0); }
    100% { transform: translateY(0) scale(1); box-shadow: 0 0 0 0 rgba(248, 191, 196, 0); }
  }
  .btn-dw {
    background: linear-gradient(135deg, #4a7ec4, #e8a07a);
    color: white;
    box-shadow: 0 4px 16px rgba(74,126,196,0.3);
  }
  .btn-dw:hover { background: linear-gradient(135deg, #4a7ec4, #4a7ec4); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(74,126,196,0.4); }
  .btn-pw {
    background: linear-gradient(135deg, #c4714a, #a8c4b0);
    color: white;
    box-shadow: 0 4px 16px rgba(196,113,74,0.3);
  }
  .btn-pw:hover { background: linear-gradient(135deg, #7a9e87, #c4714a); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(196,113,74,0.4); }

  /* ===== LARGE COMPANION BUTTON ===== */
  .btn-companion {
    display: inline-flex; align-items: center; gap: 12px;
    padding: 20px 40px; border-radius: 50px;
    font-family: var(--font-sans); font-size: 18px; font-weight: 600;
    cursor: pointer; border: none; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none; position: relative; overflow: hidden;
    background: linear-gradient(135deg, #c4714a, #e8a07a);
    color: white;
    box-shadow: 0 8px 32px rgba(196,113,74,0.4);
    min-width: 300px;
    justify-content: center;
  }
  .btn-companion::before {
    content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(245,224,212,0.35), transparent);
    transition: left 0.5s;
  }
  .btn-companion:hover::before { left: 100%; }
  .btn-companion:hover {
    background: linear-gradient(135deg, #965f2a, #c4714a);
    transform: translateY(-4px);
    box-shadow: 0 12px 48px rgba(196,113,74,0.6);
  }
  .btn-companion:active { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(196,113,74,0.4); }

  /* ===== CARDS ===== */
  .card {
    background: white; border-radius: var(--radius);
    border: 1px solid rgba(196,113,74,0.1);
    box-shadow: 0 2px 12px rgba(196,113,74,0.06), 0 1px 3px rgba(0,0,0,0.04);
    padding: 24px; transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  }
  .card:hover {
    transform: translateY(-3px);
    border-color: rgba(196,113,74,0.22);
    box-shadow: 0 12px 32px rgba(196,113,74,0.12), 0 4px 8px rgba(0,0,0,0.04);
  }

  /* ===== BADGE ===== */
  .badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 12px; border-radius: 20px;
    font-size: 12px; font-weight: 500;
  }
  .badge-spirit { background: var(--terracotta-pale); color: var(--terracotta); }
  .badge-digital { background: var(--dw-blue-pale); color: var(--dw-blue); }
  .badge-physical { background: var(--pw-teal-pale); color: var(--pw-teal); }

  /* ===== BRIEF NEWS ===== */
  .brief-section {
    background: white;
  }
  .brief-header {
    margin-bottom: 40px;
    text-align: center;
  }
  
  /* Search Box */
  .search-box {
    max-width: 600px;
    margin: 0 auto 32px;
    position: relative;
  }
  .search-input {
    width: 100%;
    padding: 16px 60px 16px 20px;
    border: 1px solid rgba(196,113,74,0.1);
    border-radius: 25px;
    font-size: 14px;
    transition: all 0.2s;
  }
  .search-input:focus {
    outline: none;
    border-color: #c4714a;
    box-shadow: 0 0 0 3px rgba(196,113,74,0.1);
  }
  .search-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    padding: 12px 20px;
    border: none;
    border-radius: 20px;
    background: linear-gradient(135deg, #c4714a, #e8a07a);
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
  }
  .search-btn:hover {
    background: linear-gradient(135deg, #7a9e87, #c4714a);
    transform: translateY(-50%) scale(1.05);
  }

  /* Category Filter */
  .category-filter {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
  }
  .category-btn {
    padding: 8px 20px;
    border: 1px solid rgba(196,113,74,0.1);
    border-radius: 20px;
    background: white;
    color: var(--text-mid);
    cursor: pointer;
    transition: all 0.2s;
    position: relative; overflow: hidden;
  }
  .category-btn::before {
    content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(196,113,74,0.08), transparent);
    transition: left 0.4s;
  }
  .category-btn:hover::before {
    left: 100%;
  }
  .category-btn:hover {
    background: var(--cream2);
    color: var(--terracotta);
    transform: translateY(-1px);
  }
  .category-btn.active {
    background: linear-gradient(135deg, #c4714a, #e8a07a);
    color: white;
    border-color: var(--terracotta);
    box-shadow: 0 4px 16px rgba(196,113,74,0.3);
  }

  /* Brief List */
  .brief-list {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 24px;
  }
  .brief-card {
    background: white;
    border-radius: var(--radius);
    border: 1px solid rgba(196,113,74,0.1);
    box-shadow: 0 2px 12px rgba(196,113,74,0.06), 0 1px 3px rgba(0,0,0,0.04);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  }
  .brief-card:hover {
    transform: translateY(-6px);
    border-color: rgba(196,113,74,0.22);
    box-shadow: 0 12px 32px rgba(196,113,74,0.12), 0 4px 8px rgba(0,0,0,0.04);
  }
  .brief-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
  }
  .brief-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
  }
  .brief-content {
    padding: 20px;
  }
  .brief-date {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 12px;
  }
  .brief-title {
    font-family: var(--font-serif);
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 12px;
    line-height: 1.4;
  }
  .brief-desc {
    font-size: 14px;
    color: var(--text-mid);
    line-height: 1.6;
    margin-bottom: 16px;
  }
  .brief-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid var(--cream2);
  }
  .brief-source {
    font-size: 12px;
    color: var(--text-light);
  }
  .brief-category {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 500;
    background: var(--terracotta-pale);
    color: var(--terracotta);
  }

  /* ===================================================
     PAGE 1: HOME
  =================================================== */
  .home-hero {
    height: calc(100vh - 64px);
    display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    text-align: center;
    padding: 60px 40px;
    position: relative; overflow: hidden;
    background: url('../首页背景图.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
  }


   .hero-content { position: relative; z-index: 1; max-width: 800px; align-self: flex-start; margin-left: 20px; margin-top: 450px; }
  .hero-eyebrow {
    display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; justify-content: flex-start;
  }
  .hero-title {
    font-family: var(--font-serif);
    font-size: clamp(36px, 5vw, 60px);
    font-weight: 700; line-height: 1.25;
    color: var(--text-dark);
    margin-bottom: 30px;
    text-align: left;
  }
  .hero-title .accent { 
    color: var(--terracotta);
  }
  .hero-subtitle {
    font-size: 16px; color: var(--text-mid); line-height: 2;
    margin-bottom: 32px; max-width: 600px; text-align: left;
  }
  .hero-btns { display: flex; gap: 16px; flex-wrap: wrap; justify-content: flex-start; margin-bottom: 48px; }
  .hero-stats {
    display: flex; gap: 40px; margin-top: 0; justify-content: flex-start;
  }
  .hero-stat-num { font-family: var(--font-serif); font-size: 32px; font-weight: 700; color: var(--terracotta); }
  .hero-stat-label { font-size: 12px; color: var(--text-light); margin-top: 2px; }

  .hero-visual { position: relative; z-index: 1; display: flex; justify-content: center; margin-top: 20px; }
  .hero-extra-actions { position: absolute; top: 14px; right: 14px; display: flex; gap: 8px; z-index: 10; }
  .hero-extra-actions .btn { padding: 6px 10px; font-size: 12px; border-radius: 12px; }
  .hero-card-stack { position: relative; width: 360px; height: 480px; }
  .hero-main-card {
    position: absolute; top: 40px; left: 50%; transform: translateX(-50%);
    width: 300px;
    background: white; border-radius: 28px;
    border: 1px solid rgba(196,113,74,0.12);
    box-shadow: 0 20px 60px rgba(196,113,74,0.14), 0 4px 16px rgba(0,0,0,0.06);
    padding: 28px; overflow: hidden;
  }
  .hero-avatar-ring {
    width: 80px; height: 80px; border-radius: 50%;
    background: linear-gradient(135deg, #f5e0d4, #c4714a);
    display: flex; align-items: center; justify-content: center;
    font-size: 36px; margin: 0 auto 16px;
    box-shadow: 0 8px 24px rgba(196,113,74,0.3);
  }
  .hero-chat-bubble {
    background: var(--cream2); border-radius: 16px 16px 16px 4px;
    padding: 12px 16px; font-size: 13px; color: var(--text-mid);
    margin-bottom: 10px; line-height: 1.6;
  }
  .hero-typing { display: flex; gap: 4px; padding: 10px 16px; background: var(--terracotta); border-radius: 16px 16px 4px 16px; width: fit-content; margin-left: auto; }
  .hero-typing span { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,0.8); animation: typingBounce 1.2s ease-in-out infinite; }
  .hero-typing span:nth-child(2) { animation-delay: 0.2s; }
  .hero-typing span:nth-child(3) { animation-delay: 0.4s; }
  @keyframes typingBounce { 0%,60%,100% { transform: translateY(0); } 30% { transform: translateY(-6px); } }

  .hero-float-card {
    position: absolute; background: white; border-radius: 16px;
    border: 1px solid rgba(196,113,74,0.1);
    box-shadow: 0 8px 32px rgba(196,113,74,0.1), 0 2px 8px rgba(0,0,0,0.04);
    padding: 14px 18px; font-size: 13px;
  }
  .hfc-agent { top: 0; right: 0; display: flex; align-items: center; gap: 8px; }
  .hfc-agent .hfc-icon { width: 32px; height: 32px; background: var(--dw-blue-pale); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 16px; }
  .hfc-hw { bottom: 20px; left: 0; }
  .hw-pills { display: flex; gap: 6px; margin-top: 6px; }
  .hw-pill { padding: 3px 10px; border-radius: 20px; font-size: 11px; }
  .hw-pill-green { background: var(--pw-teal-pale); color: var(--pw-teal); }
  .hw-pill-orange { background: var(--terracotta-pale); color: var(--terracotta); }

  /* Three Worlds Section */
  .three-worlds {
    padding: 80px;
    background: linear-gradient(180deg, #ffffff 0%, #f3ece2 100%);
  }
  .section-header { text-align: center; margin-bottom: 56px; }
  .section-eyebrow {
    font-size: 12px; color: var(--terracotta); letter-spacing: 4px;
    text-transform: uppercase; margin-bottom: 12px;
    display: inline-flex; align-items: center; gap: 8px;
  }
  .section-eyebrow::before, .section-eyebrow::after {
    content: ''; flex: 1; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(196,113,74,0.3));
  }
  .section-eyebrow::after { background: linear-gradient(270deg, transparent, rgba(196,113,74,0.3)); }
  .section-title { font-family: var(--font-serif); font-size: 36px; font-weight: 700; color: var(--text-dark); margin-bottom: 16px; }
  .section-subtitle { font-size: 15px; color: var(--text-mid); max-width: 500px; margin: 0 auto; line-height: 1.8; }

  .worlds-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
  .world-card {
    border-radius: var(--radius); padding: 36px 28px;
    position: relative; overflow: hidden;
    cursor: pointer; transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .world-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(196,113,74,0.04), rgba(74,126,196,0.04));
    opacity: 0; transition: opacity 0.4s ease;
  }
  .world-card:hover { transform: translateY(-8px); }
  .world-card:hover::before { opacity: 1; }
  .wc-spirit {
    background: linear-gradient(135deg, #f3ece2, #f5e0d4);
    border: 1px solid rgba(196,113,74,0.18);
    box-shadow: 0 4px 20px rgba(196,113,74,0.08);
  }
  .wc-spirit:hover { box-shadow: 0 20px 48px rgba(196,113,74,0.18); border-color: rgba(196,113,74,0.3); }
  .wc-digital {
    background: linear-gradient(135deg, #f3ece2, #e0ecfa);
    border: 1px solid rgba(74,126,196,0.18);
    box-shadow: 0 4px 20px rgba(74,126,196,0.08);
  }
  .wc-digital:hover { box-shadow: 0 20px 48px rgba(74,126,196,0.18); border-color: rgba(74,126,196,0.3); }
  .wc-physical {
    background: linear-gradient(135deg, #deeee3, #deeee3);
    border: 1px solid rgba(196,113,74,0.2);
    box-shadow: 0 4px 20px rgba(196,113,74,0.08);
  }
  .wc-physical:hover { box-shadow: 0 20px 48px rgba(196,113,74,0.2); border-color: rgba(196,113,74,0.35); }
  .wc-icon { font-size: 48px; margin-bottom: 20px; }
  .wc-title { font-family: var(--font-serif); font-size: 22px; font-weight: 700; margin-bottom: 12px; }
  .wc-spirit .wc-title { color: var(--terracotta); }
  .wc-digital .wc-title { color: var(--dw-blue); }
  .wc-physical .wc-title { color: var(--pw-teal); }
  .wc-desc { font-size: 14px; color: var(--text-mid); line-height: 1.8; margin-bottom: 20px; }
  .wc-features { list-style: none; display: flex; flex-direction: column; gap: 8px; }
  .wc-features li { font-size: 13px; color: var(--text-mid); display: flex; align-items: center; gap: 8px; }
  .wc-features li::before { content: ''; width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
  .wc-spirit .wc-features li::before { background: var(--terracotta); }
  .wc-digital .wc-features li::before { background: var(--dw-blue); }
  .wc-physical .wc-features li::before { background: var(--pw-teal); }
  .wc-btn {
    margin-top: 24px; display: inline-flex; align-items: center; gap: 6px;
    font-size: 13px; font-weight: 500; padding: 8px 18px; border-radius: 20px;
    border: none; cursor: pointer; transition: all 0.25s; color: white;
    box-shadow: 0 4px 12px rgba(196,113,74,0.25);
  }
  .wc-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(196,113,74,0.35); }
  .wc-spirit .wc-btn { background: linear-gradient(135deg, #c4714a, #e8a07a); }
  .wc-digital .wc-btn { background: linear-gradient(135deg, #4a7ec4, #e8a07a); }
  .wc-physical .wc-btn { background: linear-gradient(135deg, #c4714a, #a8c4b0); }

  /* Home Features / Tech / CTA */
  .home-features { padding: 80px; background: var(--cream); }
  .features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
  .feat-card {
    background: white; border-radius: var(--radius-sm); padding: 28px;
    border: 1px solid rgba(196,113,74,0.1);
    box-shadow: 0 2px 12px rgba(196,113,74,0.06), 0 1px 3px rgba(0,0,0,0.03);
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
    position: relative; overflow: hidden;
  }
  .feat-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #c4714a, #e8a07a);
    opacity: 0; transition: opacity 0.3s;
  }
  .feat-card:hover { transform: translateY(-5px); border-color: rgba(196,113,74,0.22); box-shadow: 0 12px 32px rgba(196,113,74,0.12), 0 4px 8px rgba(0,0,0,0.04); }
  .feat-card:hover::after { opacity: 1; }
  .feat-icon { font-size: 32px; margin-bottom: 16px; }
  .feat-title { font-size: 16px; font-weight: 600; margin-bottom: 8px; color: var(--text-dark); }
  .feat-desc { font-size: 13px; color: var(--text-mid); line-height: 1.7; }

  .home-cta {
    padding: 80px; text-align: center;
    background: linear-gradient(135deg, #7a9e87 0%, #c4714a 50%, #e8a07a 100%);
    color: white; position: relative; overflow: hidden;
  }
  .home-cta::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.06)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 1;
  }
  .home-cta::after {
    content: ''; position: absolute;
    width: 600px; height: 600px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    top: -200px; right: -150px;
    pointer-events: none;
  }
  .home-cta > * { position: relative; z-index: 1; }
  .home-cta h2 { font-family: var(--font-serif); font-size: 40px; margin-bottom: 16px; text-shadow: 0 2px 12px rgba(0,0,0,0.1); }
  .home-cta p { font-size: 16px; opacity: 0.92; margin-bottom: 36px; }
  .cta-btns { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
  .btn-white {
    background: rgba(255,255,255,0.95); color: #7a9e87;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  }
  .btn-white:hover {
    background: white; transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(0,0,0,0.16);
  }
  .btn-outline-white { background: transparent; color: white; border: 1.5px solid rgba(255,255,255,0.7); }
  .btn-outline-white:hover { background: rgba(255,255,255,0.15); border-color: white; transform: translateY(-2px); }

  /* ===== FOOTER ===== */
  .site-footer {
    background: linear-gradient(135deg, #2c2420, #5a4a44);
    color: white;
    padding: 40px 80px; text-align: center; font-size: 13px;
    position: relative; overflow: hidden;
  }
  .site-footer::before {
    content: ''; position: absolute; inset: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="dots" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1" fill="rgba(255,255,255,0.04)"/></pattern></defs><rect width="100" height="100" fill="url(%23dots)"/></svg>');
  }
  .site-footer > * { position: relative; z-index: 1; }
  .site-footer .footer-logo { font-family: var(--font-serif); font-size: 24px; color: #a8c4b0; margin-bottom: 12px; }
  .site-footer p { opacity: 0.5; }
  .footer-links { display: flex; gap: 24px; justify-content: center; margin: 16px 0; }
  .footer-links a { color: rgba(255,255,255,0.6); text-decoration: none; font-size: 13px; transition: color 0.2s; }
  .footer-links a:hover { color: #a8c4b0; }

  /* ===== RESPONSIVE ===== */
  @media (max-width: 1100px) {
    .home-hero { padding: 60px 40px; gap: 32px; }
    .three-worlds { padding: 60px 40px; }
    .worlds-grid { grid-template-columns: 1fr; gap: 16px; }
    .home-features { padding: 60px 40px; }
    .features-grid { grid-template-columns: 1fr 1fr; }
  }
  @media (max-width: 768px) {
    .nav-links button span { display: none; }
    .home-hero { grid-template-columns: 1fr; padding: 40px 20px; }
    .hero-visual { display: none; }
    .three-worlds { padding: 40px 20px; }
    .home-features { padding: 40px 20px; }
    .features-grid { grid-template-columns: 1fr; }
    .home-cta { padding: 60px 20px; }
  }

  /* Modal Styles */
  .modal-overlay {
    display: none;
    position: fixed !important;
    inset: 0;
    background: rgba(44, 36, 32, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease both;
  }
  .modal-overlay.show,
  .modal-overlay.open {
    display: flex !important;
  }
  .modal-content {
    background: white;
    border-radius: var(--r-lg);
    box-shadow: 0 20px 60px rgba(44, 36, 32, 0.25);
    width: 90%;
    max-width: 420px;
    overflow: hidden;
    animation: slideUp 0.3s ease both;
  }
  @keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
  }
  .modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--cream2);
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .modal-header h3 {
    font-family: var(--font-serif);
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
  }
  .modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--cream2);
    border-radius: 8px;
    font-size: 18px;
    color: var(--text-mid);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
  }
  .modal-close:hover {
    background: var(--cream3);
    color: var(--text-dark);
  }
  .modal-body {
    padding: 24px;
  }
  .modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--cream2);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
  }
  .form-group {
    margin-bottom: 20px;
  }
  .form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-mid);
    margin-bottom: 8px;
  }
  .form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--cream3);
    border-radius: var(--r-sm);
    font-family: var(--font-sans);
    font-size: 14px;
    color: var(--text-dark);
    transition: all 0.2s;
    outline: none;
  }
  .form-group input:focus {
    border-color: var(--terracotta);
    box-shadow: 0 0 0 3px rgba(196, 113, 74, 0.08);
  }
  .form-group input::placeholder {
    color: var(--text-light);
  }
  .login-helper-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: -4px;
    margin-bottom: 8px;
  }
  .modal-helper-link {
    background: transparent;
    border: none;
    padding: 0;
    color: #6b3f2d;
    font-size: 13px;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
  }
  .modal-helper-link:hover {
    color: #5a3126;
  }
  .mode-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .mode-card {
    padding: 20px;
    border: 2px solid var(--cream3);
    border-radius: var(--r-md);
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
  }
  .mode-card:hover {
    border-color: var(--terracotta);
    background: rgba(196, 113, 74, 0.04);
    transform: translateY(-2px);
  }
  .mode-icon {
    font-size: 40px;
    margin-bottom: 12px;
  }
  .mode-card h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 6px;
  }
  .mode-card p {
    font-size: 12px;
    color: var(--text-light);
    line-height: 1.5;
  }

  /* Animations */
  .fade-in { animation: fadeIn 0.5s ease both; }
  @keyframes fadeIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

  /*PAGE 2: CHAT (COMPANION)*/
#page-chat {
  display: none;
  flex-direction: row;
  height: calc(100dvh - var(--nav-h));
  background: var(--cream2);
}
#page-chat.active { display: flex; overflow: hidden; }

/* History sidebar */
.chat-sidebar {
  width: 220px;
  flex-shrink: 0;
  border-right: 1px solid var(--cream3);
  background: var(--cream);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-head {
  padding: 16px 14px 12px;
  border-bottom: 1px solid var(--cream3);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sidebar-title { font-size: 13px; font-weight: 600; color: var(--ink2); }
.icon-btn {
  width: 28px; height: 28px;
  border-radius: 8px;
  border: none;
  background: var(--cream2);
  color: var(--ink2);
  font-size: 14px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.icon-btn:hover { background: var(--cream3); }

.history-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.history-list::-webkit-scrollbar { width: 3px; }
.history-list::-webkit-scrollbar-thumb { background: var(--cream3); border-radius: 99px; }

.hist-item {
  padding: 10px 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background .15s;
}
.hist-item:hover { background: var(--cream2); }
.hist-item.active { background: rgba(196,113,74,.1); border-left: 2px solid var(--terracotta); }
.hist-name { font-size: 12.5px; font-weight: 500; color: var(--ink2); margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-meta { display: flex; justify-content: space-between; align-items: center; }
.hist-time { font-size: 10.5px; color: var(--ink4); }
.hist-emo { font-size: 10px; padding: 1px 6px; border-radius: 99px; }

/* Digital human center */
.chat-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  gap: 12px;
  background: var(--cream2);
  min-width: 0;
}

.dh-label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink3);
  display: flex;
  align-items: center;
  gap: 6px;
}
.live-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--sage);
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.5;transform:scale(.8)} }

.dh-screen {
  /* 16:9 aspect ratio */
  width: min(2000px, calc((100dvh - var(--nav-h) - 200px) * 16/9));
  aspect-ratio: 16/9;
  background: #0F0F0F;
  border-radius: var(--r-lg);
  box-shadow: 0 8px 40px rgba(0,0,0,.35), 0 0 0 1px rgba(255,255,255,.06);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dh-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  padding: 20px;
}
.dh-icon { font-size: 36px; opacity: .4; }
.dh-placeholder p { font-size: 11px; color: rgba(255,255,255,.3); line-height: 1.5; }

.dh-corner-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(196,113,74,.15);
  border: 1px solid rgba(196,113,74,.35);
  color: #a8c4b0;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .12em;
  padding: 3px 8px;
  border-radius: 6px;

  color: var(--sage-lt);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .12em;
  padding: 3px 8px;
  border-radius: 6px;
}

.dh-scan {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.scan-line {
  position: absolute;
  left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(196,113,74,.5), transparent);
  animation: scan 4s linear infinite;
}
@keyframes scan { 0%{top:0%} 100%{top:100%} }

/* Emotion badge below screen */
.emo-badge-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.emo-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 500;
  background: var(--white);
  box-shadow: var(--shadow);
  color: var(--ink2);
  cursor: pointer;
  transition: box-shadow .15s;
}
.emo-badge:hover { box-shadow: var(--shadow-md); }

/* Chat right panel */
.chat-panel {
  width: 340px;
  flex-shrink: 0;
  border-left: 1px solid var(--cream3);
  background: var(--white);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--cream3);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.chat-head-title { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.chat-head-sub { font-size: 11px; color: var(--ink3); }

.chat-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chat-msgs::-webkit-scrollbar { width: 4px; }
  .chat-msgs::-webkit-scrollbar-track { background: rgba(196,113,74,0.04); border-radius: 10px; }
  .chat-msgs::-webkit-scrollbar-thumb { background: rgba(196,113,74,0.18); border-radius: 10px; transition: background 0.3s ease; }
  .chat-msgs::-webkit-scrollbar-thumb:hover { background: rgba(196,113,74,0.35); }

.msg { display: flex; gap: 8px; align-items: flex-end; animation: msgSlideIn 0.4s ease-out; }
  .msg.user { flex-direction: row-reverse; animation: msgSlideInRight 0.4s ease-out; }
  @keyframes msgSlideIn { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: translateX(0); } }
  @keyframes msgSlideInRight { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

.msg-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
}
.msg-avatar.ai { background: linear-gradient(135deg, var(--warm-lt), var(--warm)); }
.msg-avatar.user-av { background: linear-gradient(135deg, var(--sage-lt), var(--sage)); }

.msg-bubble {
  max-width: 210px;
  padding: 9px 12px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink);
}
.msg.ai .msg-bubble { background: var(--cream2); border-radius: 4px 14px 14px 14px; }
.msg.user .msg-bubble { background: var(--warm); color: #fff; border-radius: 14px 4px 14px 14px; }

.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
}
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink4); animation: bounce .9s infinite; }
.dot:nth-child(2) { animation-delay: .15s; }
.dot:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%,60%,100%{transform:translateY(0)} 30%{transform:translateY(-5px)} }

.quick-chips {
  padding: 8px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-top: 1px solid var(--cream2);
}
.chip {
  font-size: 11.5px;
  padding: 4px 10px;
  border-radius: 99px;
  background: var(--cream2);
  color: var(--ink2);
  border: none;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s;
}
.chip:hover { background: var(--cream3); }

.chat-input-row {
  padding: 10px 12px;
  border-top: 1px solid var(--cream2);
  display: flex;
  align-items: center;
  gap: 8px;
}
.chat-input {
  flex: 1;
  background: var(--cream2);
  border: none;
  border-radius: 20px;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  outline: none;
  resize: none;
}
.chat-input::placeholder { color: var(--ink4); }
  .chat-input:focus { background: white; box-shadow: 0 0 0 2px rgba(196,113,74,0.2); transform: scale(1.01); }
.mic-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--cream2);
  color: var(--ink3);
  font-size: 15px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all .2s;
}
.mic-btn:hover { background: var(--warm); color: #fff; }
.mic-btn.recording { background: var(--warm); color: #fff; animation: glow 1s infinite; }
@keyframes glow { 0%,100%{box-shadow:0 0 0 0 rgba(196,113,74,.4)} 50%{box-shadow:0 0 0 8px rgba(196,113,74,0)} }

.send-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--warm);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .2s;
}
.send-btn:hover { background: var(--warm-dk); }

#page-message {
  display: none;
  min-height: calc(100dvh - var(--nav-h));
  padding: 24px 32px 32px;
  background: var(--cream2);
}
#page-message.active { display: block; }

.message-page {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.message-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
#page-message .page-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
}
#page-message .page-subtitle {
  font-size: 14px;
  color: var(--ink3);
  max-width: 640px;
}
.message-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 18px;
  align-items: start;
}
.message-right-col {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.message-chat {
  background: var(--white);
  border-radius: var(--r-xl);
  padding: 20px;
  box-shadow: 0 18px 50px rgba(196,113,74,0.08);
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: calc(100vh - 260px);
  min-height: 560px;
  width: 100%;
  overflow-y: auto;
}
.message-chat::-webkit-scrollbar {
  width: 10px;
}
.message-chat::-webkit-scrollbar-track {
  background: rgba(196,113,74,0.05);
  border-radius: 999px;
}
.message-chat::-webkit-scrollbar-thumb {
  background: rgba(196,113,74,0.2);
  border-radius: 999px;
}
.message-summary-card,
.message-side-card {
  width: 100%;
  min-width: 0;
  background: linear-gradient(180deg, #fffdf8, #f7f0e8);
  border: 1px solid rgba(196,113,74,0.12);
  border-radius: 22px;
  padding: 14px;
  box-shadow: 0 12px 30px rgba(196,113,74,0.07);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.message-side-card {
  background: rgba(255,255,255,0.95);
}
.message-summary-card h4,
.message-side-card h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}
.message-summary-card p {
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink3);
}
.message-summary-card .summary-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(122,158,135,0.12);
  color: var(--sage);
  font-weight: 700;
}
.message-summary-card .summary-item {
  font-size: 13px;
  color: var(--ink3);
  line-height: 1.75;
  padding: 14px 16px;
  background: rgba(255,255,255,0.75);
  border-radius: 16px;
}
.quick-reply {
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(196,113,74,0.14);
  background: #fffdf8;
  color: var(--ink);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.25s ease;
}
.quick-reply:hover {
  background: rgba(196,113,74,0.08);
  transform: translateY(-1px);
}
.message-bubble {
  max-width: 64%;
  padding: 10px 14px;
  line-height: 1.45;
  border-radius: 14px;
  position: relative;
  box-shadow: 0 6px 14px rgba(196,113,74,0.07);
  font-size: 13px;
}
.message-bubble.family {
  align-self: flex-end;
  background: linear-gradient(180deg, #f3fbf6, #deeee3);
  color: var(--sage);
  border-radius: 22px 22px 8px 22px;
  border: 1px solid rgba(122,158,135,0.16);
}
.message-bubble.family::after {
  content: '';
  position: absolute;
  right: -8px;
  bottom: 8px;
  width: 12px;
  height: 12px;
  background: #f3fbf6;
  border-radius: 50% 50% 50% 0;
  transform: rotate(45deg);
}
.message-bubble.dh {
  align-self: flex-start;
  background: linear-gradient(180deg, #f9f5ef, #fff9f3);
  color: var(--ink);
  border-radius: 22px 22px 22px 8px;
  border: 1px solid rgba(196,113,74,0.12);
}
.message-bubble.dh::after {
  content: '';
  position: absolute;
  left: -8px;
  bottom: 8px;
  width: 12px;
  height: 12px;
  background: #f9f5ef;
  border-radius: 50% 50% 0 50%;
  transform: rotate(45deg);
}
.message-from {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--ink2);
}
.message-meta {
  margin-top: 6px;
  font-size: 11px;
  color: var(--ink4);
}
.message-input-row {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 12px 0 8px;
  border-top: 1px solid rgba(196,113,74,0.12);
  width: 100%;
}
.message-input-wrapper {
  position: relative;
  flex: 1;
  min-width: 0;
}
.message-textarea {
  width: 100%;
  min-width: 0;
  height: 75px;
  min-height: 75px;
  padding: 12px 90px 12px 18px;
  border-radius: 20px;
  border: 1.5px solid rgba(196,113,74,0.14);
  background: #fffdf8;
  color: var(--ink);
  resize: none;
  font-family: inherit;
  font-size: 14px;
  box-sizing: border-box;
}
.message-textarea:focus {
  border-color: var(--terracotta);
  outline: none;
  box-shadow: none;
}
.message-textarea:disabled {
  opacity: 0.8;
}
.message-send-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  padding: 10px 20px;
  border-radius: 14px;
  font-size: 13px;
  height: auto;
  align-self: auto;
}
.message-send-btn:hover,
.message-send-btn:active {
  transform: translateY(-50%);
}
.message-send-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: translateY(-50%);
}
.message-input-row .mic-btn {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #c4714a, #e8a07a);
  color: white;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(196,113,74,0.3);
}
.message-input-row .mic-btn:hover {
  background: linear-gradient(135deg, #a66b4a, #c4714a);
  color: white;
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(196,113,74,0.4);
}
.message-input-row .mic-btn:disabled,
.message-input-row .voice-stop-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}
.message-input-row.voice-mode {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  min-height: 75px;
  padding: 8px 10px;
  background: var(--cream);
  border-radius: 14px;
}
.message-input-row.voice-mode .message-input-wrapper,
.message-input-row.voice-mode .mic-btn {
  display: none;
}
.message-input-row.voice-mode .wave-container {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 52px;
}
.message-input-row.voice-mode .wave-bar {
  width: 4px;
  height: 20px;
  background: var(--terracotta);
  border-radius: 2px;
  animation: messageWave 0.6s ease-in-out infinite;
}
.message-input-row.voice-mode .wave-bar:nth-child(1) { animation-delay: 0s; }
.message-input-row.voice-mode .wave-bar:nth-child(2) { animation-delay: 0.1s; }
.message-input-row.voice-mode .wave-bar:nth-child(3) { animation-delay: 0.2s; }
.message-input-row.voice-mode .wave-bar:nth-child(4) { animation-delay: 0.3s; }
.message-input-row.voice-mode .wave-bar:nth-child(5) { animation-delay: 0.4s; }
.message-input-row.voice-mode .wave-bar:nth-child(6) { animation-delay: 0.5s; }
.message-input-row.voice-mode .wave-bar:nth-child(7) { animation-delay: 0.6s; }
.message-input-row.voice-mode .wave-bar:nth-child(8) { animation-delay: 0.7s; }
.message-input-row.voice-mode .wave-bar:nth-child(9) { animation-delay: 0.8s; }
.message-input-row.voice-mode .wave-bar:nth-child(10) { animation-delay: 0.9s; }
@keyframes messageWave {
  0%, 100% { height: 10px; }
  50% { height: 45px; }
}
.message-input-row.voice-mode .voice-stop-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  padding: 14px 24px;
  border-radius: 18px;
  background: linear-gradient(135deg, #c4714a, #e8a07a);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(196,113,74,0.3);
  transition: all 0.3s ease;
}
.message-input-row.voice-mode .voice-stop-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(196,113,74,0.45);
}
.message-bubble.pending {
  opacity: 0.75;
}
.message-bubble.message-error {
  color: #8b1f24;
}
@media (max-width: 900px) {
  #page-message { padding: 18px 18px 24px; }
  .message-page { gap: 16px; }
  .message-grid { grid-template-columns: 1fr; gap: 12px; }
  .message-summary-card,
  .message-right-col {
    width: 100%;
    max-width: none;
  }
  .message-chat {
    max-height: calc(100vh - 320px);
    min-height: 420px;
  }
  .message-bubble { max-width: 100%; }
  .message-input-row {
    grid-template-columns: 1fr auto;
    gap: 8px;
    padding: 8px 0;
  }
  .message-textarea {
    height: 54px;
    min-height: 54px;
    padding: 10px 76px 10px 12px;
    font-size: 13px;
  }
  .message-send-btn {
    padding: 8px 12px;
    min-width: 64px;
    border-radius: 12px;
  }
}

/* PAGE 3: AGENT*/
#page-agent {
  display: none;
  height: calc(100dvh - var(--nav-h));
}
#page-agent.active { display: grid; grid-template-columns: 280px 1fr; overflow: hidden; }

.agent-sidebar {
  background: linear-gradient(180deg, #2c2420 0%, #5a4a44 100%);
  color: white;
  display: flex; flex-direction: column;
  border-right: 1px solid rgba(196,113,74,0.2);
  box-shadow: 2px 0 12px rgba(196,113,74,0.08);
}

.agent-sidebar-head {
  padding: 28px 24px; border-bottom: 1px solid rgba(255,255,255,0.1);
}
.agent-sidebar-title {
  font-family: var(--font-serif); font-size: 20px; font-weight: 700; margin-bottom: 4px; color: white;
}
.agent-sidebar-sub { font-size: 13px; opacity: 0.6; color: white; }

.task-list {
  overflow-y: auto; flex: 1; padding: 0 12px 12px;
}
.task-list::-webkit-scrollbar { width: 3px; }
.task-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 99px; }

.task-item {
  padding: 12px 14px; border-radius: 12px; cursor: pointer;
  transition: background 0.2s; margin-bottom: 4px;
  border: 1px solid transparent;
}
.task-item:hover { background: rgba(196,113,74,0.12); }
.task-item.active { background: rgba(196,113,74,0.2); border-color: rgba(196,113,74,0.5); }
.task-name { font-size: 13px; font-weight: 500; margin-bottom: 6px; color: white; }
.task-meta { display: flex; align-items: center; gap: 8px; font-size: 11px; opacity: 0.5; }
.task-time { font-size: 11px; opacity: 0.5; color: #ffffff; }
.task-status { padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 500; }
.status-done { background: rgba(122,158,135,0.2); color: #a8c4b0; }
.status-run { background: rgba(232,160,122,0.2); color: #e8a07a; }
.status-wait { background: rgba(160,144,128,0.2); color: #a09080; }

.agent-main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--cream);
}

.agent-head {
  padding: 18px 24px 14px;
  border-bottom: 1px solid var(--cream3);
  background: var(--white);
}
.agent-head-title { font-size: 14.5px; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.agent-head-sub { font-size: 12px; color: var(--ink3); }

.agent-input-area {
  padding: 16px 20px;
  background: var(--white);
  border-bottom: 1px solid var(--cream3);
}
.agent-input-wrap {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.agent-input {
  flex: 1;
  background: var(--cream2);
  border: 1.5px solid var(--cream3);
  border-radius: var(--r-md);
  padding: 10px 14px;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--ink);
  outline: none;
  resize: none;
  transition: border-color .15s;
  height: 44px;
}
.agent-input:focus { border-color: var(--warm-lt); }
.agent-input::placeholder { color: var(--ink4); }

.shortcut-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.stag {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 99px;
  background: var(--cream2);
  color: var(--ink2);
  border: none;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s;
}
.stag:hover { background: var(--cream3); }

.agent-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.agent-body::-webkit-scrollbar { width: 4px; }
.agent-body::-webkit-scrollbar-thumb { background: var(--cream3); border-radius: 99px; }

.exec-card {
  background: var(--white);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.exec-card-head {
  padding: 14px 18px;
  background: linear-gradient(135deg,#2c2420,#2c2420);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.exec-task-name { font-size: 13px; font-weight: 600; color: rgba(255,255,255,.9); }
.exec-badge { font-size: 10px; padding: 3px 8px; border-radius: 99px; }

.exec-steps {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.step-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.step-num {
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.step-done { background: rgba(196,113,74,.15); color: var(--sage); }
.step-run { background: rgba(196,113,74,.15); color: var(--warm); animation: stepPulse 1s infinite; }
.step-pending { background: var(--cream2); color: var(--ink4); }
@keyframes stepPulse { 0%,100%{opacity:1} 50%{opacity:.5} }

.step-body {}
.step-name { font-size: 13px; font-weight: 500; color: var(--ink); margin-bottom: 2px; }
.step-desc { font-size: 11.5px; color: var(--ink3); }

.log-area {
  margin: 0 18px 16px;
  max-height: 220px;
  overflow: auto;
  background:
    radial-gradient(circle at top right, rgba(196,113,74,.08), transparent 28%),
    linear-gradient(180deg,#140f0c,#2c2420 48%,#5a4a44);
  border: 1px solid rgba(196,113,74,.18);
  border-radius: 10px;
  padding: 12px 14px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: rgba(224,236,250,.82);
  line-height: 1.7;
  box-shadow: inset 0 0 0 1px rgba(196,113,74,.06);
}
.log-line {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  animation: fadeIn .25s ease both;
}
.log-time { color: rgba(155,139,180,.52); flex-shrink: 0; }
.log-badge {
  min-width: 46px;
  display: inline-flex;
  justify-content: center;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid currentColor;
  font-size: 10px;
  line-height: 1.4;
  letter-spacing: .04em;
}
.log-text {
  flex: 1;
  color: rgba(224,236,250,.92);
  word-break: break-word;
}
.log-ok { color: #7a9e87; }
.log-run { color: #9b8bb4; }
.log-trace { color: #a8c4b0; }
.log-url { color: #e8a07a; }
.log-dom { color: #7aaae0; }
.log-data { color: #f5e0d4; }
.log-hit { color: #9b8bb4; }
.log-warn { color: #e8a07a; }
.exec-card-success {
  background: linear-gradient(180deg, rgba(245,224,212,.80), rgba(255,255,255,.98) 38%);
  border: 1px solid rgba(196,113,74,.20);
  box-shadow: 0 18px 42px rgba(196,113,74,.12);
}
.exec-card-success .exec-card-head {
  background: linear-gradient(135deg,#2c2420,#5a4a44 70%,#7a9e87);
}
.status-ticket-success {
  background: rgba(245,224,212,.95);
  color: #2c2420;
  box-shadow: inset 0 0 0 1px rgba(196,113,74,.15);
}
.exec-receipt {
  margin: 0 18px 18px;
  padding: 16px 18px;
  border-radius: 16px;
  background:
    radial-gradient(circle at top right, rgba(196,113,74,.12), transparent 30%),
    linear-gradient(135deg, rgba(255,255,255,.98), rgba(245,224,212,.90));
  border: 1px solid rgba(196,113,74,.15);
  box-shadow: 0 12px 28px rgba(196,113,74,.10);
  animation: fadeIn .45s ease both;
}
.exec-receipt-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.exec-receipt-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}
.exec-receipt-subtitle {
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--ink3);
}
.exec-receipt-price {
  font-size: 20px;
  font-weight: 800;
  color: var(--pw-teal);
  white-space: nowrap;
}
.exec-receipt-route {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(243,236,226,.92);
  border: 1px dashed rgba(196,113,74,.20);
}
.exec-receipt-station {
  flex: 1;
}
.exec-receipt-station strong {
  display: block;
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
}
.exec-receipt-station span {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: var(--ink3);
}
.exec-receipt-arrow {
  font-size: 18px;
  color: var(--pw-teal);
  opacity: .8;
}
.exec-receipt-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.exec-receipt-item {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(243,236,226,.88);
}
.exec-receipt-label {
  font-size: 10.5px;
  letter-spacing: .08em;
  color: var(--ink3);
  text-transform: uppercase;
}
.exec-receipt-value {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.exec-receipt-foot {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed rgba(196,113,74,.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.exec-receipt-note {
  font-size: 11px;
  color: var(--ink3);
}
.exec-receipt-order {
  font-size: 11px;
  font-weight: 700;
  color: var(--pw-teal);
}

/* PAGE 4: HEALTH*/
#page-health {
  padding: 24px;
  background: linear-gradient(135deg, #ffffff, #9b8bb4);
}

.health-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  grid-template-rows: auto 1fr;
  gap: 16px;
  max-width: 1200px;
  margin: 20px auto 0;
  min-height: calc(100dvh - var(--nav-h) - 48px);
}

.camera-card {
  grid-column: 1;
  grid-row: 1 / 3;
  background: var(--white);
  border-radius: var(--r-xl);
  box-shadow: 0 8px 32px rgba(196,113,74,0.2);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.camera-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--cream3);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.camera-title { font-size: 14px; font-weight: 600; color: var(--ink); }

.live-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(196,113,74,.08);
  color: #c4714a;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .08em;
  padding: 4px 10px;
  border-radius: 99px;
}
.live-badge-dot { width: 6px; height: 6px; border-radius: 50%; background: #c4714a; animation: liveblink .8s infinite; }
@keyframes liveblink { 0%,100%{opacity:1} 50%{opacity:.2} }

.camera-screen {
  flex: 0 0 auto;
  width: 100%;
  aspect-ratio: 13 / 9;
  background: #0A0A0A;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.camera-screen video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}
.cam-icon { font-size: 40px; opacity: .25; }
.camera-placeholder p { font-size: 12px; color: rgba(255,255,255,.25); line-height: 1.5; }

/* Corner brackets */
.cam-corner {
  position: absolute;
  width: 24px; height: 24px;
  opacity: .35;
}
.cam-corner::before, .cam-corner::after { content:''; position:absolute; background: var(--sage-lt); }
.cam-corner.tl { top: 16px; left: 16px; }
.cam-corner.tl::before { top:0;left:0;width:2px;height:100%; }
.cam-corner.tl::after { top:0;left:0;width:100%;height:2px; }
.cam-corner.tr { top: 16px; right: 16px; }
.cam-corner.tr::before { top:0;right:0;width:2px;height:100%; }
.cam-corner.tr::after { top:0;right:0;width:100%;height:2px; }
.cam-corner.bl { bottom: 16px; left: 16px; }
.cam-corner.bl::before { bottom:0;left:0;width:2px;height:100%; }
.cam-corner.bl::after { bottom:0;left:0;width:100%;height:2px; }
.cam-corner.br { bottom: 16px; right: 16px; }
.cam-corner.br::before { bottom:0;right:0;width:2px;height:100%; }
.cam-corner.br::after { bottom:0;right:0;width:100%;height:2px; }

.cam-scan { display:none; }
.cam-scan-line { display:none; }

.cam-status-bar {
  padding: 10px 16px;
  background: rgba(0,0,0,.6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: absolute;
  bottom: 0; left: 0; right: 0;
}
.cam-status-text { font-size: 11px; color: rgba(255,255,255,.6); display: flex; align-items: center; gap: 6px; }
.cam-ok-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--sage-lt); animation: pulse 2s infinite; }

.alert-card {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.alert-stat-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.mini-stat {
  background: var(--white);
  border-radius: var(--r-md);
  padding: 16px;
  box-shadow: 0 6px 24px rgba(196,113,74,0.18);
  text-align: center;
}
.mini-stat-num { font-size: 26px; font-weight: 700; color: var(--warm); font-family: 'DM Sans', sans-serif; }
.mini-stat-label { font-size: 11px; color: var(--ink3); margin-top: 2px; }

.alert-list-card {
  background: var(--white);
  border-radius: var(--r-lg);
  box-shadow: 0 6px 24px rgba(196,113,74,0.18);
  padding: 16px 18px;
}

.alert-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.alert-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--cream2);
}
.alert-icon { font-size: 16px; flex-shrink: 0; }
.alert-body { flex: 1; }
.alert-name { font-size: 12.5px; font-weight: 500; color: var(--ink2); }
.alert-time { font-size: 11px; color: var(--ink4); }
.alert-level {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
}
.level-high { background: rgba(196,113,74,.1); color: #c4714a; }
.level-med { background: rgba(232,160,122,.1); color: #965f2a; }
.level-low { background: rgba(122,158,135,.1); color: var(--sage); }

.tongue-card {
  grid-column: 2;
  grid-row: 2;
  background: var(--white);
  border-radius: var(--r-lg);
  box-shadow: 0 6px 24px rgba(196,113,74,0.18);
  padding: 16px 18px;
  overflow: hidden;
}

.tongue-video-wrap {
  margin-top: 12px;
  border-radius: var(--r-md);
  overflow: hidden;
  background: linear-gradient(180deg, #2c2420, #5a4a44);
  border: 1px solid rgba(196,113,74,0.12);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
}
.tongue-video-player {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #000;
}
.tongue-video-tip {
  margin-top: 10px;
  font-size: 12px;
  color: var(--ink3);
  line-height: 1.6;
}

/* PAGE 5: REPORT*/
#page-report {
  padding: 24px;
}

.report-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 40px;
  margin-bottom: 18px;
}

.report-title-block h2 {
  font-size: 20px;
  font-weight: 600;
  font-family: 'Noto Serif SC', serif;
  color: var(--ink);
  margin-bottom: 2px;
}
.report-title-block p { font-size: 12px; color: var(--ink3); }



.report-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.kpi-card {
  background: var(--white);
  border-radius: var(--r-lg);
  padding: 18px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.kpi-icon { font-size: 22px; flex-shrink: 0; margin-top: 2px; }
.kpi-num {
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
  font-family: 'DM Sans', sans-serif;
  line-height: 1;
  margin-bottom: 3px;
}
.kpi-label { font-size: 12px; color: var(--ink3); }
.kpi-delta { font-size: 11px; margin-top: 4px; }
.delta-up { color: var(--sage); }
.delta-dn { color: var(--warm); }

.report-charts {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 14px;
  margin-bottom: 14px;
}

.chart-card {
  background: var(--white);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}
.chart-card-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 16px;
}

.trend-wrap {
  width: 100%;
  height: 180px;
  position: relative;
}

.donut-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.donut-canvas-wrap {
  width: 160px;
  height: 160px;
  flex-shrink: 0;
  position: relative;
}
.donut-legend {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.legend-name { flex: 1; color: var(--ink2); }
.legend-pct { color: var(--ink3); font-weight: 600; }

.report-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.insights-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}
.insight-item {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--cream2);
  align-items: flex-start;
}
.insight-icon { font-size: 18px; flex-shrink: 0; }
.insight-text { font-size: 12.5px; color: var(--ink2); line-height: 1.5; }
.insight-details {
  display: none;
  margin-top: 8px;
  width: 665px;
  background: white;
  border-radius: var(--r-sm);
  padding: 10px 14px;
  box-shadow: var(--shadow);
  font-size: 12.5px;
  color: var(--ink2);
  line-height: 1.5;
}
.insight-details-content {
  display: flex;
  align-items: center;
  gap: 20px;
}
.insight-details-content span {
  white-space: nowrap;
}
.insight-item {
  cursor: pointer;
  transition: all 0.2s;
}
.insight-item:hover {
  background: var(--cream3);
}

.conv-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.conv-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--cream2);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background 0.2s;
}
.conv-row:hover {
  background: var(--cream3);
}
.conv-emo { font-size: 16px; }
.conv-body { flex: 1; }
.conv-title { font-size: 12.5px; font-weight: 500; color: var(--ink2); }
.conv-meta { font-size: 11px; color: var(--ink4); display: flex; gap: 8px; }
.conv-score {
  font-size: 13px;
  font-weight: 700;
  color: var(--warm);
  font-family: 'DM Sans', sans-serif;
}

/*PAGE 6: PROFILE*/
#page-profile {
  padding: 24px;
  background: linear-gradient(135deg, #faf6f1, #f3ece2);
}

.profile-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px;
  max-width: 1100px;
  margin: 60px auto 0;
  min-height: calc(100dvh - var(--nav-h) - 48px);
}

.profile-sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-avatar-card {
  background: var(--white);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow);
  padding: 28px 20px 20px;
  text-align: center;
}
.pf-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--warm-lt), var(--warm));
  font-size: 28px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
  box-shadow: 0 4px 16px rgba(196,113,74,.28);
}
.pf-name { font-size: 15px; font-weight: 600; color: var(--ink); }
.pf-sub { font-size: 12px; color: var(--ink3); margin-top: 2px; }
.pf-badges { display: flex; justify-content: center; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.pf-badge { font-size: 14px; }

.profile-nav-list {
  background: var(--white);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.pf-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background .15s;
  border-bottom: 1px solid var(--cream2);
  font-size: 13px;
  color: var(--ink2);
}
.pf-nav-item:last-child { border-bottom: none; }
.pf-nav-item:hover { background: var(--cream2); }
.pf-nav-item.active { background: rgba(196,113,74,.08); color: var(--warm); font-weight: 500; }
.pf-nav-icon { font-size: 15px; }

.profile-content {}

.pf-panel { display: none; }
.pf-panel.active { display: block; }

.info-form {
  background: var(--white);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: 22px;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-field {}
.form-label { font-size: 11.5px; color: var(--ink3); margin-bottom: 5px; font-weight: 500; }
.form-input {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--cream3);
  border-radius: 10px;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  background: var(--cream2);
  outline: none;
  transition: border-color .15s;
}
.form-input:focus { border-color: var(--warm-lt); }

.radar-wrap {
  width: 180px; height: 180px;
  margin: 16px auto 0;
}

.achievement-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.ach-item {
  background: var(--white);
  border-radius: var(--r-md);
  padding: 16px 12px;
  text-align: center;
  box-shadow: var(--shadow);
}
.ach-item.locked { opacity: .4; filter: grayscale(1); }
.ach-icon { font-size: 26px; margin-bottom: 6px; }
.ach-name { font-size: 11px; color: var(--ink2); font-weight: 500; }

.toggle-list {
  background: var(--white);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.toggle-row {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--cream2);
}
.toggle-row:last-child { border-bottom: none; }
.toggle-label { flex: 1; }
.toggle-name { font-size: 13.5px; color: var(--ink); }
.toggle-desc { font-size: 11.5px; color: var(--ink3); margin-top: 2px; }

.toggle-sw {
  position: relative;
  width: 38px; height: 22px;
  flex-shrink: 0;
}
.toggle-sw input { opacity: 0; width: 0; height: 0; }
.toggle-track {
  position: absolute;
  inset: 0;
  border-radius: 99px;
  background: var(--cream3);
  cursor: pointer;
  transition: background .2s;
}
.toggle-track::after {
  content:'';
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform .2s;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.toggle-sw input:checked + .toggle-track { background: var(--warm); }
.toggle-sw input:checked + .toggle-track::after { transform: translateX(16px); }

/*EMOTION MODAL*/
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(44,36,32,.35);
  backdrop-filter: blur(6px);
  z-index: 200;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }

.modal-box {
  background: var(--white);
  border-radius: var(--r-xl);
  padding: 24px;
  width: min(360px, 90vw);
  box-shadow: var(--shadow-md);
}
.modal-title { font-size: 15px; font-weight: 600; color: var(--ink); margin-bottom: 16px; }
.modal-radar-wrap { width: 200px; height: 200px; margin: 0 auto 16px; }
.modal-close-btn {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: var(--r-md);
  background: var(--cream2);
  color: var(--ink2);
  font-family: inherit;
  font-size: 13.5px;
  cursor: pointer;
}
.modal-close-btn:hover { background: var(--cream3); }

/*RESPONSIVE*/
@media (max-width: 900px) {
  .home-hero { grid-template-columns: 1fr; padding: 40px 28px 32px; }
  .hero-right { display: none; }
  .home-features { padding: 40px 24px; }
  .features-grid { grid-template-columns: 1fr 1fr; }
  .home-stats { grid-template-columns: 1fr 1fr; }
  .report-kpis { grid-template-columns: 1fr 1fr; }
  .report-charts { grid-template-columns: 1fr; }
  .report-bottom { grid-template-columns: 1fr; }
  .health-grid { grid-template-columns: 1fr; }
  .camera-card { grid-row: auto; }
  .profile-layout { grid-template-columns: 1fr; }
  .profile-sidebar { display: none; }
  .achievement-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 640px) {
  #nav { overflow-x: auto; gap: 2px; padding: 0 10px; }
  .nav-logo { font-size: 15px; margin-right: 8px; }
  .nav-btn { font-size: 12px; padding: 6px 10px; }
  .nav-btn .icon { display: none; }
  #page-chat.active { flex-direction: column; }
  .chat-sidebar { display: none; }
  .chat-center { padding: 12px; }
  .chat-panel { width: 100%; border-left: none; border-top: 1px solid var(--cream3); height: 50vh; }
  .features-grid { grid-template-columns: 1fr; }
  .home-stats { grid-template-columns: 1fr 1fr; }
  .achievement-grid { grid-template-columns: repeat(2, 1fr); }
  #page-agent.active { grid-template-columns: 1fr; }
  .agent-sidebar { display: none; }
}
