  :root {
    --green: #2d7a4f;
    --green-light: #4caf78;
    --green-pale: #e8f5ee;
    --blue: #2563a8;
    --blue-light: #4a90d9;
    --blue-pale: #e8f0fb;
    --pink: #f4b8c8;
    --pink-deep: #e07a9a;
    --pink-pale: #fdf0f4;
    --white: #ffffff;
    --off-white: #fafbfc;
    --text-dark: #1a2332;
    --text-mid: #4a5568;
    --text-light: #8a9ab0;
    --border: #e2e8f0;
    --shadow: 0 4px 24px rgba(45,122,79,0.10);
    --shadow-blue: 0 4px 24px rgba(37,99,168,0.12);
    --shadow-pink: 0 4px 24px rgba(224,122,154,0.12);
    --radius: 18px;
    --radius-sm: 10px;
  }

  * { margin: 0; padding: 0; box-sizing: border-box; }

  body {
    font-family: 'DM Sans', sans-serif;
    background: var(--off-white);
    color: var(--text-dark);
    overflow-x: hidden;
  }

  /* ===== SCROLLBAR ===== */
  ::-webkit-scrollbar { width: 6px; }
  ::-webkit-scrollbar-track { background: var(--green-pale); }
  ::-webkit-scrollbar-thumb { background: var(--green); border-radius: 3px; }

  /* ===== OVERLAY / MODAL ===== */
  .overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(26,35,50,0.55);
    backdrop-filter: blur(6px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
  }
  .overlay.active { display: flex; }

  .modal {
    background: white;
    border-radius: var(--radius);
    padding: 40px;
    width: 90%;
    max-width: 460px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    position: relative;
    animation: slideUp 0.3s ease;
  }
  @keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
  }

  .modal-close {
    position: absolute; top: 16px; right: 20px;
    background: none; border: none; font-size: 22px;
    cursor: pointer; color: var(--text-light);
    transition: color 0.2s;
  }
  .modal-close:hover { color: var(--text-dark); }

  .modal h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    color: var(--text-dark);
    margin-bottom: 6px;
  }
  .modal p.sub { color: var(--text-light); font-size: 0.9rem; margin-bottom: 28px; }

  .tab-row {
    display: flex;
    border-radius: var(--radius-sm);
    background: var(--green-pale);
    padding: 4px;
    margin-bottom: 24px;
    gap: 4px;
  }
  .tab-btn {
    flex: 1; padding: 10px;
    border: none; background: none;
    border-radius: 8px; cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500; font-size: 0.92rem;
    color: var(--text-mid);
    transition: all 0.2s;
  }
  .tab-btn.active {
    background: white;
    color: var(--green);
    box-shadow: 0 2px 8px rgba(45,122,79,0.1);
  }

  .tab-content { display: none; }
  .tab-content.active { display: block; }

  .form-group { margin-bottom: 16px; }
  .form-group label {
    display: block; font-size: 0.85rem;
    font-weight: 500; color: var(--text-mid);
    margin-bottom: 6px;
  }
  .form-group input {
    width: 100%; padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    color: var(--text-dark);
    background: var(--off-white);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
  }
  .form-group input:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(45,122,79,0.1);
  }

  .btn-primary {
    width: 100%; padding: 14px;
    background: linear-gradient(135deg, var(--green), var(--green-light));
    color: white; border: none;
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-weight: 600; font-size: 1rem;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 4px 16px rgba(45,122,79,0.25);
    margin-top: 8px;
  }
  .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(45,122,79,0.3);
  }

  .error-msg {
    background: #fff0f3; border: 1px solid #fbbbc8;
    color: #c0394f; padding: 10px 14px;
    border-radius: 8px; font-size: 0.88rem;
    margin-bottom: 14px; display: none;
  }

  /* ===== NAV ===== */
  nav {
    position: sticky; top: 0; z-index: 500;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 0 40px;
    display: flex; align-items: center;
    justify-content: space-between;
    height: 70px;
  }
  .nav-logo {
    display: flex; align-items: center; gap: 12px;
    text-decoration: none;
  }
  .logo-icon {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, var(--green), var(--blue-light));
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
  }
  .logo-text {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem; font-weight: 700;
    color: var(--text-dark);
  }
  .logo-text span { color: var(--green); }

  .nav-links {
    display: flex; gap: 32px; list-style: none;
  }
  .nav-links a {
    text-decoration: none; color: var(--text-mid);
    font-size: 0.92rem; font-weight: 500;
    transition: color 0.2s;
  }
  .nav-links a:hover { color: var(--green); }

  .nav-right { display: flex; gap: 12px; align-items: center; }

  .btn-nav {
    padding: 10px 22px;
    border-radius: 50px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 600; font-size: 0.9rem;
    cursor: pointer; transition: all 0.2s;
    border: none;
  }
  .btn-outline {
    background: none;
    border: 2px solid var(--green);
    color: var(--green);
  }
  .btn-outline:hover { background: var(--green-pale); }
  .btn-filled {
    background: linear-gradient(135deg, var(--green), var(--green-light));
    color: white;
    box-shadow: 0 4px 14px rgba(45,122,79,0.25);
  }
  .btn-filled:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(45,122,79,0.3); }

  /* User badge */
  #userBadge {
    display: none;
    align-items: center; gap: 10px;
    padding: 6px 16px 6px 6px;
    background: var(--green-pale);
    border-radius: 50px;
    cursor: pointer;
    transition: background 0.2s;
  }
  #userBadge:hover { background: #d4eddf; }
  .avatar {
    width: 34px; height: 34px;
    background: linear-gradient(135deg, var(--green), var(--blue-light));
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; color: white; font-size: 0.85rem;
  }
  #userBadge span { font-weight: 600; font-size: 0.88rem; color: var(--green); }

  /* ===== HERO ===== */
  .hero {
    min-height: clamp(600px, 86vh, 820px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    justify-items: stretch;
    gap: clamp(36px, 5vw, 88px);
    padding: 84px clamp(24px, 5vw, 72px) 72px;
    max-width: 1380px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
  }
  .hero::before {
    content: '';
    position: absolute; inset: 0;
    background:
      radial-gradient(120% 90% at 60% 40%, #f1faf3 0%, #eef4fb 45%, #fbf2f5 100%);
    z-index: -2;
  }
  .hero::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0) 70%, rgba(31,42,36,0.04) 100%);
    pointer-events: none;
    z-index: -2;
  }

  .hero-bg {
    position: absolute; inset: 0; z-index: -1;
    overflow: hidden; pointer-events: none;
  }
  .blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.22;
    animation: float 14s ease-in-out infinite;
    will-change: transform;
  }
  .blob-1 { width: 520px; height: 520px; background: var(--green-light); top: -120px; right: -120px; animation-delay: 0s; }
  .blob-2 { width: 420px; height: 420px; background: var(--blue-light); bottom: -80px; left: 25%; animation-delay: -4s; }
  .blob-3 { width: 320px; height: 320px; background: var(--pink); top: 30%; left: -100px; animation-delay: -7s; }

  @keyframes float {
    0%, 100% { transform: translate(0,0) scale(1); }
    33% { transform: translate(18px,-16px) scale(1.04); }
    66% { transform: translate(-14px,14px) scale(0.98); }
  }

  .hero-content {
    position: relative; z-index: 1;
    max-width: 600px;
    width: 100%;
    justify-self: end;
    margin-left: auto;
    padding-inline-start: 0;
  }

  .hero-badge {
    display: inline-flex; align-items: center; gap: 8px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 8px 18px;
    font-size: 0.85rem; font-weight: 500;
    color: var(--green);
    margin-bottom: 28px;
    box-shadow: var(--shadow);
  }
  .hero-badge::before { content: '🌿'; }

  .hero h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.4rem, 5vw, 3.9rem);
    font-weight: 900;
    line-height: 1.08;
    letter-spacing: -0.5px;
    color: var(--text-dark);
    margin-bottom: 22px;
  }
  .hero h1 em {
    font-style: normal;
  }
  .hero h1 .type-em {
    font-style: normal;
    display: inline-grid;
    grid-template-areas: "stack";
    vertical-align: baseline;
    line-height: inherit;
  }
  .hero h1 .type-em > .type-static,
  .hero h1 .type-em > .type-anim {
    grid-area: stack;
    min-width: 0;
  }
  .hero h1 .type-em .type-static {
    visibility: hidden;
    pointer-events: none;
    user-select: none;
    white-space: nowrap;
  }
  .hero h1 .type-em .type-anim {
    display: inline-flex;
    align-items: baseline;
    white-space: nowrap;
  }
  .hero h1 .type-em .type-static,
  .hero h1 .type-em .type-text {
    background: linear-gradient(135deg, var(--green), var(--blue-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
  }
  .hero h1 .type-em .type-caret {
    display: inline-block;
    width: 3px;
    height: 0.95em;
    margin-left: 4px;
    background: var(--green);
    border-radius: 2px;
    transform: translateY(0.08em);
    animation: caretBlink 1s steps(1) infinite;
  }
  @keyframes caretBlink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
  }

  .hero p {
    font-size: 1.1rem; color: var(--text-mid);
    line-height: 1.7; margin-bottom: 36px;
    max-width: 520px;
  }

  .hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }

  .btn-hero-main {
    padding: 16px 32px;
    background: linear-gradient(135deg, var(--green), var(--green-light));
    color: white; border: none;
    border-radius: 50px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 600; font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 6px 24px rgba(45,122,79,0.3);
    transition: all 0.25s;
  }
  .btn-hero-main:hover { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(45,122,79,0.35); }

  .btn-hero-sec {
    padding: 16px 32px;
    background: white;
    color: var(--text-dark); border: 1.5px solid var(--border);
    border-radius: 50px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 600; font-size: 1rem;
    cursor: pointer;
    transition: all 0.25s;
  }
  .btn-hero-sec:hover { border-color: var(--green); color: var(--green); }

  .hero-visual {
    position: relative;
    z-index: 1;
    display: flex; flex-direction: column; gap: 16px;
    width: 100%;
    max-width: 540px;
    justify-self: start;
    margin-right: auto;
    padding: 22px 22px 20px;
    border-radius: 32px;
    background: linear-gradient(160deg, rgba(255,255,255,.55), rgba(255,255,255,.18));
    border: 1px solid rgba(255,255,255,.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 30px 80px -42px rgba(31,42,36,.28), 0 2px 6px rgba(31,42,36,.04);
  }
  .hero-visual::before {
    content: '';
    position: absolute;
    inset: -50px -40px;
    background: conic-gradient(from 200deg at 60% 40%, rgba(76,175,120,.22), rgba(78,160,224,.18), rgba(244,170,180,.14), rgba(76,175,120,.22));
    filter: blur(60px);
    border-radius: 40% 60% 55% 45% / 50% 50% 50% 50%;
    z-index: -1;
    opacity: .55;
    animation: float 18s ease-in-out infinite;
  }

  /* Live status pill on hero visual */
  .hero-visual-pill {
    align-self: flex-start;
    display: inline-flex; align-items: center; gap: 8px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 6px 14px 6px 12px;
    font-size: .78rem; font-weight: 600;
    color: var(--text-dark);
    box-shadow: 0 6px 20px -10px rgba(31,42,36,.18);
    margin-bottom: 2px;
  }
  .hvp-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #2bb673;
    box-shadow: 0 0 0 0 rgba(43,182,115,.55);
    animation: hvpPulse 1.8s ease-out infinite;
  }
  @keyframes hvpPulse {
    0%   { box-shadow: 0 0 0 0 rgba(43,182,115,.55); }
    70%  { box-shadow: 0 0 0 10px rgba(43,182,115,0); }
    100% { box-shadow: 0 0 0 0 rgba(43,182,115,0); }
  }

  /* Hero card offsets for richer composition */
  .hc-offset-a { margin-left: 0;     margin-right: 28px; }
  .hc-offset-b { margin-left: 36px;  margin-right: 0;    }
  .hc-offset-c { margin-left: 12px;  margin-right: 18px; }

  /* Status tag chip on hero card */
  .hc-tag {
    position: absolute;
    top: 10px; right: 12px;
    font-size: .7rem; font-weight: 700;
    padding: 3px 9px;
    border-radius: 50px;
    letter-spacing: .3px;
  }
  .hc-tag-green { background: #e6f5ec; color: #1f7a4a; }
  .hc-tag-amber { background: #fdf2da; color: #8a5a10; }
  .hc-tag-blue  { background: #e4f1fb; color: #1d5a87; }

  /* Mini stats row */
  .hero-mini-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 4px;
  }
  .hero-mini {
    background: white;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 10px 12px;
    text-align: center;
    box-shadow: 0 8px 24px -16px rgba(31,42,36,.18);
  }
  .hm-l { font-size: .68rem; color: var(--text-light); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 2px; }
  .hm-v { font-weight: 800; color: var(--text-dark); font-size: 1.02rem; font-family: 'Playfair Display', serif; }

  /* Hero trust row under CTAs */
  .hero-trust {
    list-style: none; padding: 0; margin: 28px 0 0;
    display: flex; flex-wrap: wrap; gap: 18px;
    color: var(--text-light); font-size: .82rem; font-weight: 500;
  }
  .hero-trust li { display: inline-flex; align-items: center; gap: 8px; }
  .ht-dot { width: 8px; height: 8px; border-radius: 50%; background: #2bb673; }
  .ht-dot.ht-blue { background: #4ea0e0; }
  .ht-dot.ht-pink { background: #e98aa0; }

  /* Subtle grid overlay behind hero */
  .hero-grid-overlay {
    position: absolute; inset: 0;
    background-image:
      linear-gradient(rgba(31,42,36,.045) 1px, transparent 1px),
      linear-gradient(90deg, rgba(31,42,36,.045) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(80% 60% at 50% 40%, #000 30%, transparent 75%);
    -webkit-mask-image: radial-gradient(80% 60% at 50% 40%, #000 30%, transparent 75%);
    opacity: .55;
    pointer-events: none;
  }

  .hero-card {
    --cardX: 0px;
    --mx: 0px;
    --my: 0px;
    background: white;
    border-radius: var(--radius);
    padding: 20px 24px;
    box-shadow: 0 14px 40px -18px rgba(31,42,36,0.20);
    display: flex; align-items: center; gap: 14px;
    min-width: 260px;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    transition: box-shadow .25s ease, border-color .25s ease;
    will-change: transform;
  }
  .hero-card:hover {
    box-shadow: 0 22px 50px -18px rgba(31,42,36,0.28);
    border-color: rgba(76,175,120,.4);
  }
  .hero-card:hover .card-icon { transform: scale(1.08) rotate(-3deg); }
  .card-icon { transition: transform .3s cubic-bezier(.2,.7,.2,1); }
  .hero-card::after {
    content: '';
    position: absolute; top: 0; left: -120%;
    width: 60%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(76,175,120,.10), transparent);
    animation: heroScan 7s ease-in-out infinite;
    pointer-events: none;
  }
  @keyframes heroScan {
    0%, 60% { transform: translateX(0); opacity: 0; }
    65% { opacity: 1; }
    100% { transform: translateX(380%); opacity: 0; }
  }
  /* Stable selectors — independent of card position in the DOM. */
  .hero-visual .hero-card.hc-offset-a { --cardX: -8px; animation: floatCardA 6.5s ease-in-out infinite; animation-delay: 0s; }
  .hero-visual .hero-card.hc-offset-b { --cardX: 18px; animation: floatCardB 8.2s ease-in-out infinite; animation-delay: -1.6s; }
  .hero-visual .hero-card.hc-offset-c { --cardX: -2px; animation: floatCardC 7.4s ease-in-out infinite; animation-delay: -3.4s; }
  /* Legacy nth-child fallbacks kept only as a safety net for older markup. */
  .hero-card:nth-child(1) { animation-name: floatCardA; }
  .hero-card:nth-child(2) { animation-name: floatCardB; }
  .hero-card:nth-child(3) { animation-name: floatCardC; }

  @keyframes floatCardA {
    0%, 100% { transform: translate(calc(var(--cardX) + var(--mx)), calc(0px + var(--my))) rotate(0deg); }
    50%      { transform: translate(calc(var(--cardX) + var(--mx) + 6px), calc(-22px + var(--my))) rotate(-0.8deg); }
  }
  @keyframes floatCardB {
    0%, 100% { transform: translate(calc(var(--cardX) + var(--mx)), calc(0px + var(--my))) rotate(0.2deg); }
    50%      { transform: translate(calc(var(--cardX) + var(--mx) - 8px), calc(-30px + var(--my))) rotate(0.8deg); }
  }
  @keyframes floatCardC {
    0%, 100% { transform: translate(calc(var(--cardX) + var(--mx)), calc(0px + var(--my))) rotate(0deg); }
    50%      { transform: translate(calc(var(--cardX) + var(--mx) + 7px), calc(-20px + var(--my))) rotate(0.55deg); }
  }

  .card-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; flex-shrink: 0;
  }
  .ci-green { background: var(--green-pale); }
  .ci-blue { background: var(--blue-pale); }
  .ci-pink { background: var(--pink-pale); }

  .card-info { flex: 1; }
  .card-label { font-size: 0.78rem; color: var(--text-light); margin-bottom: 3px; }
  .card-val { font-weight: 700; font-size: 1rem; color: var(--text-dark); }

  .confidence-bar {
    height: 6px; background: var(--border);
    border-radius: 3px; margin-top: 6px; overflow: hidden;
  }
  .confidence-fill {
    height: 100%; border-radius: 3px;
    background: linear-gradient(90deg, var(--green), var(--green-light));
    animation: fillBar 2s ease-out forwards;
  }
  @keyframes fillBar {
    from { width: 0; }
    to { width: var(--w); }
  }

  /* ===== STATS ===== */
  .stats-bar {
    background: var(--text-dark);
    padding: 28px 40px;
    display: flex; justify-content: center; gap: 60px; flex-wrap: wrap;
  }
  .stat-item { text-align: center; }
  .stat-num {
    font-family: 'Playfair Display', serif;
    font-size: 2rem; font-weight: 900;
    background: linear-gradient(135deg, var(--green-light), var(--pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }
  .stat-label { font-size: 0.82rem; color: rgba(255,255,255,0.5); margin-top: 4px; }

  /* ===== SECTIONS ===== */
  section { padding: 90px 40px; }

  .section-header { text-align: center; max-width: 600px; margin: 0 auto 60px; }
  .section-tag {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.8rem; font-weight: 600;
    letter-spacing: 0.05em; text-transform: uppercase;
    margin-bottom: 16px;
  }
  .tag-green { background: var(--green-pale); color: var(--green); }
  .tag-blue { background: var(--blue-pale); color: var(--blue); }
  .tag-pink { background: var(--pink-pale); color: var(--pink-deep); }

  .section-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 14px;
  }
  .section-header p { color: var(--text-mid); line-height: 1.7; }

  /* ===== DIAGNOSTIC SECTION ===== */
  #diagnostic { background: white; }

  .diag-layout {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 40px; max-width: 1100px; margin: 0 auto;
    align-items: start;
  }

  .upload-panel {
    background: var(--off-white);
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 40px;
    text-align: center;
    transition: border-color 0.2s, background 0.2s;
    cursor: pointer;
  }
  .upload-panel:hover {
    border-color: var(--green);
    background: var(--green-pale);
  }
  .upload-icon { font-size: 3.5rem; margin-bottom: 16px; }
  .upload-panel h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 8px; }
  .upload-panel p { color: var(--text-light); font-size: 0.9rem; margin-bottom: 24px; }

  .upload-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
  .upload-btn {
    padding: 11px 22px;
    border-radius: 50px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 600; font-size: 0.9rem;
    cursor: pointer; border: none;
    transition: all 0.2s;
  }
  .ub-green {
    background: var(--green);
    color: white;
    box-shadow: 0 4px 14px rgba(45,122,79,0.25);
  }
  .ub-green:hover { background: var(--green-light); transform: translateY(-1px); }
  .ub-blue {
    background: var(--blue);
    color: white;
    box-shadow: 0 4px 14px rgba(37,99,168,0.25);
  }
  .ub-blue:hover { background: var(--blue-light); transform: translateY(-1px); }
  .ub-outline {
    background: white;
    color: var(--text-mid);
    border: 1.5px solid var(--border);
  }
  .ub-outline:hover { border-color: var(--green); color: var(--green); }

  #imagePreview {
    max-width: 100%; border-radius: 12px;
    margin-top: 20px; display: none;
    box-shadow: var(--shadow);
  }

  .result-panel {
    display: flex; flex-direction: column; gap: 20px;
  }

  .result-card {
    background: white;
    border-radius: var(--radius);
    padding: 28px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
  }

  .result-header {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 20px;
  }
  .result-status {
    width: 12px; height: 12px;
    border-radius: 50%;
    background: #ccc;
    flex-shrink: 0;
  }
  .status-healthy { background: var(--green-light); }
  .status-diseased { background: #e07a5f; }
  .status-warning { background: #f6b93b; }

  .disease-name {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem; font-weight: 700;
  }
  .disease-crop { font-size: 0.82rem; color: var(--text-light); }

  .confidence-row {
    display: flex; justify-content: space-between;
    align-items: center; margin-bottom: 6px;
  }
  .conf-label { font-size: 0.85rem; color: var(--text-mid); }
  .conf-pct { font-weight: 700; color: var(--green); }

  .prog-bar {
    height: 8px; background: var(--border);
    border-radius: 4px; overflow: hidden;
    margin-bottom: 14px;
  }
  .prog-fill {
    height: 100%; border-radius: 4px;
    background: linear-gradient(90deg, var(--green), var(--green-light));
    transition: width 0.8s cubic-bezier(0.4,0,0.2,1);
  }

  .treatment-section h4 {
    font-weight: 600; margin-bottom: 12px;
    display: flex; align-items: center; gap: 8px;
  }

  .treatment-list { list-style: none; }
  .treatment-list li {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 8px 0; border-bottom: 1px solid var(--border);
    font-size: 0.9rem; color: var(--text-mid);
    line-height: 1.5;
  }
  .treatment-list li:last-child { border-bottom: none; }
  .treatment-list li::before {
    content: '✓';
    color: var(--green);
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 1px;
  }

  .med-chip {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--pink-pale);
    color: var(--pink-deep);
    border: 1px solid var(--pink);
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 0.82rem; font-weight: 500;
    margin: 4px;
  }

  .severity-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.78rem; font-weight: 600;
  }
  .sev-low { background: #e8f5e9; color: #2d7a4f; }
  .sev-med { background: #fff3e0; color: #e67e22; }
  .sev-high { background: #fde8e8; color: #c0392b; }

  .placeholder-state {
    text-align: center; padding: 50px 20px;
    color: var(--text-light);
  }
  .placeholder-state .ps-icon { font-size: 3rem; margin-bottom: 12px; }
  .placeholder-state p { font-size: 0.95rem; }

  /* ===== ZONES / CAMERAS ===== */
  #zones { background: var(--off-white); }

  .zones-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px; max-width: 1100px; margin: 0 auto 40px;
  }

  .zone-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
  }
  .zone-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 36px rgba(45,122,79,0.15);
  }

  .zone-img {
    height: 160px;
    display: flex; align-items: center; justify-content: center;
    font-size: 3rem;
    position: relative;
  }
  .zi-green { background: linear-gradient(135deg, #c8f0d8, #a8e6bf); }
  .zi-blue { background: linear-gradient(135deg, #c8dff5, #a8ccee); }
  .zi-pink { background: linear-gradient(135deg, #f9d4e2, #f4b8c8); }
  .zi-mix { background: linear-gradient(135deg, #d4ecf7, #c8f0d8); }

  .zone-status {
    position: absolute; top: 12px; right: 12px;
    padding: 4px 12px;
    border-radius: 50px; font-size: 0.75rem; font-weight: 600;
  }
  .zs-ok { background: var(--green); color: white; }
  .zs-alert { background: #e07a5f; color: white; }
  .zs-warn { background: #f6b93b; color: white; }
  .zs-off { background: #ccc; color: white; }

  .zone-body { padding: 20px; }
  .zone-name { font-weight: 700; font-size: 1rem; margin-bottom: 4px; }
  .zone-meta { font-size: 0.82rem; color: var(--text-light); margin-bottom: 14px; }

  .zone-stats {
    display: flex; gap: 12px;
    border-top: 1px solid var(--border);
    padding-top: 14px;
  }
  .zs-item { flex: 1; text-align: center; }
  .zs-val { font-weight: 700; font-size: 1rem; color: var(--text-dark); }
  .zs-lbl { font-size: 0.74rem; color: var(--text-light); }

  /* ===== KPI STRIP ===== */
  .kpi-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 18px;
    max-width: 1100px;
    margin: 0 auto 32px;
  }
  .kpi-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 18px 20px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--green);
  }
  .kpi-card.k-blue { border-left-color: var(--blue-light); }
  .kpi-card.k-pink { border-left-color: var(--pink-deep); }
  .kpi-card.k-amber { border-left-color: #f6b93b; }
  .kpi-label { font-size: 0.78rem; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
  .kpi-val { font-size: 1.8rem; font-weight: 700; color: var(--text-dark); font-family: 'Playfair Display', serif; }
  .kpi-sub { font-size: 0.78rem; color: var(--text-mid); margin-top: 2px; }

  /* ===== WEATHER ===== */
  #weather { background: linear-gradient(150deg, #eaf3fb, #f0faf5); }
  .weather-card {
    max-width: 1000px; margin: 0 auto;
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-blue);
    padding: 26px;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 28px;
    align-items: center;
  }
  @media (max-width: 700px) { .weather-card { grid-template-columns: 1fr; } }
  .weather-now { display: flex; align-items: center; gap: 18px; }
  .weather-icon { font-size: 4rem; line-height: 1; }
  .weather-temp { font-family: 'Playfair Display', serif; font-size: 2.8rem; font-weight: 700; color: var(--text-dark); }
  .weather-label { font-size: 0.95rem; color: var(--text-mid); }
  .weather-stats { display: flex; gap: 16px; margin-top: 8px; flex-wrap: wrap; }
  .weather-stats span { font-size: 0.82rem; color: var(--text-light); }
  .weather-forecast { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .forecast-item { background: var(--off-white); border-radius: var(--radius-sm); padding: 14px; text-align: center; border: 1px solid var(--border); }
  .forecast-item .fi-icon { font-size: 1.6rem; }
  .forecast-item .fi-label { font-size: 0.78rem; color: var(--text-light); margin-top: 4px; }
  .forecast-item .fi-temp { font-weight: 700; font-size: 1rem; color: var(--text-dark); margin-top: 2px; }
  .weather-refresh {
    background: var(--blue-pale); color: var(--blue);
    border: 1px solid var(--blue-light); border-radius: 50px;
    padding: 8px 16px; cursor: pointer; font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem; font-weight: 500; margin-left: auto;
  }
  .weather-refresh:hover { background: var(--blue-light); color: white; }

  /* ===== IRRIGATION ===== */
  #irrigation { background: white; }
  .irrig-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 18px; max-width: 1100px; margin: 0 auto;
  }
  .irrig-card {
    background: var(--off-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  }
  .irrig-name { font-weight: 600; font-size: 0.95rem; margin-bottom: 8px; }
  .irrig-bar { height: 8px; background: var(--border); border-radius: 50px; overflow: hidden; margin-bottom: 8px; }
  .irrig-fill { height: 100%; background: linear-gradient(90deg, var(--blue-light), var(--green-light)); transition: width 0.4s; }
  .irrig-fill.low { background: linear-gradient(90deg, #f6b93b, #e07a5f); }
  .irrig-meta { font-size: 0.8rem; color: var(--text-mid); display: flex; justify-content: space-between; }
  .irrig-chip {
    display: inline-block; padding: 3px 10px; border-radius: 50px;
    font-size: 0.74rem; font-weight: 600; margin-top: 8px;
  }
  .ic-active { background: var(--blue-pale); color: var(--blue); }
  .ic-ok { background: var(--green-pale); color: var(--green); }
  .ic-need { background: #fff3d6; color: #b87a00; }
  .ic-watch { background: #eaf3fb; color: var(--blue); }
  .ic-soon { background: #fff3d6; color: #b87a00; }
  .ic-high { background: #ffe2d2; color: #b8530a; }
  .ic-critical { background: #fde0d6; color: #b8331a; }
  .irrig-reco { font-size: 0.82rem; color: var(--text-mid); margin-top: 8px; line-height: 1.35; min-height: 32px; }
  .irrig-watering { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; color: var(--blue); font-weight: 600; margin-top: 6px; }
  .irrig-watering .pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); animation: pulse 1.1s infinite; }
  @keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: 0.3 } }
  .weather-banner {
    grid-column: 1 / -1;
    margin-top: 8px; padding: 10px 14px; border-radius: var(--radius-sm);
    font-size: 0.85rem; font-weight: 500; display: flex; align-items: center; gap: 10px;
  }
  .wb-warn { background: #fde0d6; color: #b8331a; border: 1px solid #f3b6a6; }
  .wb-info { background: #eaf3fb; color: var(--blue); border: 1px solid #c6dff5; }
  .wb-ok   { background: var(--green-pale); color: var(--green); border: 1px solid var(--green-light); }

  /* ===== ZONE ENRICHMENTS ===== */
  .zone-card.flash { box-shadow: 0 0 0 3px var(--green-light); transition: box-shadow 0.5s; }
  .zone-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
  .zone-badges .zb {
    font-size: 0.72rem; padding: 3px 8px; border-radius: 50px;
    background: var(--off-white); border: 1px solid var(--border); color: var(--text-mid);
  }
  .zb-cam-on { background: var(--green-pale); color: var(--green); border-color: var(--green-light); }
  .zb-cam-off { background: #fff3d6; color: #b87a00; border-color: #f6b93b; }
  .zb-irrig-on { background: var(--blue-pale); color: var(--blue); border-color: var(--blue-light); }
  .zb-irrig-need { background: #fff3d6; color: #b87a00; border-color: #f6b93b; }

  /* ===== RECOMMANDATIONS ===== */
  #recommendations { background: var(--off-white); }
  .reco-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px; max-width: 1100px; margin: 0 auto;
  }
  .reco-card {
    background: white; border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 18px 20px;
    box-shadow: var(--shadow); border-left: 4px solid var(--green);
  }
  .reco-card.urgent { border-left-color: #e07a5f; }
  .reco-card.warn { border-left-color: #f6b93b; }
  .reco-card.info { border-left-color: var(--blue-light); }
  .reco-title { font-weight: 700; font-size: 0.98rem; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
  .reco-desc { font-size: 0.86rem; color: var(--text-mid); line-height: 1.5; }
  .reco-meta { font-size: 0.76rem; color: var(--text-light); margin-top: 8px; }

  /* ===== HISTORY ===== */
  #history { background: white; }

  .history-filters {
    display: flex; gap: 12px; flex-wrap: wrap;
    justify-content: center; margin-bottom: 40px;
  }
  .filter-btn {
    padding: 9px 20px;
    border-radius: 50px; border: 1.5px solid var(--border);
    background: white; color: var(--text-mid);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.88rem; font-weight: 500;
    cursor: pointer; transition: all 0.2s;
  }
  .filter-btn.active, .filter-btn:hover {
    border-color: var(--green);
    background: var(--green-pale);
    color: var(--green);
  }

  .history-table-wrap {
    max-width: 1000px; margin: 0 auto;
    background: white; border-radius: var(--radius);
    border: 1px solid var(--border); overflow: hidden;
    box-shadow: var(--shadow);
  }
  table { width: 100%; border-collapse: collapse; }
  thead { background: linear-gradient(135deg, var(--green-pale), var(--blue-pale)); }
  th {
    padding: 16px 20px;
    text-align: left;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-mid);
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
  td { padding: 16px 20px; font-size: 0.9rem; color: var(--text-dark); }
  tbody tr { border-top: 1px solid var(--border); transition: background 0.15s; }
  tbody tr:hover { background: var(--off-white); }

  /* ===== NOTIFICATIONS PANEL ===== */
  #notifications { background: var(--off-white); }

  .notif-wrap { max-width: 700px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }

  .notif-item {
    background: white;
    border-radius: var(--radius-sm);
    padding: 18px 22px;
    display: flex; align-items: flex-start; gap: 14px;
    border: 1px solid var(--border);
    border-left: 4px solid;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  }
  .notif-alert { border-left-color: #e07a5f; }
  .notif-ok { border-left-color: var(--green); }
  .notif-info { border-left-color: var(--blue-light); }

  .notif-icon { font-size: 1.4rem; flex-shrink: 0; }
  .notif-content { flex: 1; }
  .notif-title { font-weight: 600; font-size: 0.95rem; margin-bottom: 4px; }
  .notif-desc { font-size: 0.85rem; color: var(--text-mid); margin-bottom: 6px; }
  .notif-time { font-size: 0.78rem; color: var(--text-light); }


  /* ===== PHASE 3 — CONTROL CENTER ===== */
  .farm-status-section { background: linear-gradient(150deg, #f6fbf8, #eef4fb); }
  .farm-status-card {
    max-width: 1100px; margin: 0 auto 24px;
    background: white; border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 22px 26px;
    display: grid; grid-template-columns: auto 1fr;
    gap: 24px; align-items: center;
  }
  @media (max-width: 720px) { .farm-status-card { grid-template-columns: 1fr; } }
  .fs-status {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 18px 24px; border-radius: var(--radius-sm);
    min-width: 180px;
  }
  .fs-status .fs-pill {
    font-family: 'Playfair Display', serif; font-size: 1.6rem; font-weight: 700;
    line-height: 1;
  }
  .fs-status .fs-pill-sub { font-size: 0.78rem; margin-top: 6px; opacity: 0.85; }
  .fs-tone-ok    { background: var(--green-pale); color: var(--green); }
  .fs-tone-watch { background: #eaf3fb; color: var(--blue); }
  .fs-tone-warn  { background: #fff3d6; color: #b87a00; }
  .fs-tone-crit  { background: #fde0d6; color: #b8331a; animation: pulse 2s infinite; }
  .fs-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
  }
  .fs-cell { display: flex; flex-direction: column; gap: 2px; }
  .fs-cell .fs-lbl { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-light); }
  .fs-cell .fs-val { font-size: 1rem; font-weight: 600; color: var(--text-dark); }

  .kpi-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 16px; max-width: 1100px; margin: 0 auto;
  }
  .kpi-grid .kpi-card { transition: transform 0.18s, box-shadow 0.18s; }
  .kpi-grid .kpi-card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(45,122,79,0.12); }

  /* ===== TIMELINE ===== */
  .activity-section { background: white; }
  .timeline-wrap {
    max-width: 760px; margin: 0 auto;
    background: var(--off-white); border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 22px;
    max-height: 420px; overflow-y: auto;
  }
  .tl-item {
    display: flex; gap: 14px; padding: 12px 0;
    border-bottom: 1px dashed var(--border);
    animation: tlIn 0.35s ease;
  }
  .tl-item:last-child { border-bottom: none; }
  @keyframes tlIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
  .tl-icon {
    width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: white; border: 1px solid var(--border); flex-shrink: 0; font-size: 1rem;
  }
  .tl-icon.tl-crit { background: #fde0d6; border-color: #f3b6a6; }
  .tl-icon.tl-warn { background: #fff3d6; border-color: #f6b93b; }
  .tl-icon.tl-info { background: #eaf3fb; border-color: #c6dff5; }
  .tl-icon.tl-ok   { background: var(--green-pale); border-color: var(--green-light); }
  .tl-body { flex: 1; min-width: 0; }
  .tl-title { font-weight: 600; font-size: 0.92rem; color: var(--text-dark); }
  .tl-desc { font-size: 0.82rem; color: var(--text-mid); margin-top: 2px; }
  .tl-meta { font-size: 0.74rem; color: var(--text-light); margin-top: 4px; }

  /* ===== ALERTS TABS ===== */
  .alerts-tabs {
    display: flex; gap: 8px; flex-wrap: wrap; justify-content: center;
    max-width: 760px; margin: 0 auto 18px;
  }
  .alerts-tab {
    background: white; border: 1.5px solid var(--border);
    border-radius: 50px; padding: 8px 14px;
    font-family: 'DM Sans', sans-serif; font-size: 0.85rem; font-weight: 500;
    color: var(--text-mid); cursor: pointer; transition: all 0.15s;
    display: inline-flex; align-items: center; gap: 8px;
  }
  .alerts-tab:hover { border-color: var(--green-light); color: var(--green); }
  .alerts-tab.active { background: var(--green-pale); border-color: var(--green); color: var(--green); }
  .alerts-tab .atc {
    background: white; color: var(--text-mid);
    border-radius: 50px; padding: 1px 8px; font-size: 0.75rem; font-weight: 700;
    min-width: 22px; text-align: center;
  }
  .alerts-tab.active .atc { background: var(--green); color: white; }

  /* ===== RECO ACTION CARDS ===== */
  .reco-card .reco-actions {
    display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px;
  }
  .reco-btn {
    background: white; border: 1px solid var(--border); border-radius: 50px;
    padding: 6px 12px; font-family: 'DM Sans', sans-serif; font-size: 0.78rem;
    font-weight: 500; color: var(--text-mid); cursor: pointer; transition: all 0.15s;
  }
  .reco-btn:hover { border-color: var(--green); color: var(--green); background: var(--green-pale); }
  .reco-btn.primary { background: var(--green); color: white; border-color: var(--green); }
  .reco-btn.primary:hover { background: #245f3d; }
  .reco-card.is-treated { opacity: 0.55; }
  .reco-card.is-treated .reco-title::after { content: ' ✓'; color: var(--green); }

  /* ===== ZONE MODAL ===== */
  #zoneOverlay {
    position: fixed; inset: 0; background: rgba(20,30,25,0.55);
    z-index: 1000; display: flex; align-items: center; justify-content: center;
    padding: 20px; animation: fadeIn 0.2s ease;
  }
  @keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
  .zone-modal {
    background: white; border-radius: var(--radius);
    width: 100%; max-width: 640px; max-height: 90vh;
    overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    animation: zoneIn 0.25s ease;
  }
  @keyframes zoneIn { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
  .zm-head {
    padding: 20px 24px; display: flex; align-items: center; gap: 14px;
    border-bottom: 1px solid var(--border);
  }
  .zm-icon { font-size: 2rem; }
  .zm-title { flex: 1; }
  .zm-title h3 { margin: 0; font-family: 'Playfair Display', serif; font-size: 1.4rem; }
  .zm-title .zm-sub { font-size: 0.85rem; color: var(--text-light); margin-top: 2px; }
  .zm-close {
    background: var(--off-white); border: 1px solid var(--border); border-radius: 50%;
    width: 34px; height: 34px; cursor: pointer; font-size: 1.1rem; line-height: 1;
  }
  .zm-body { padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; }
  .zm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  @media (max-width: 540px) { .zm-grid { grid-template-columns: 1fr; } }
  .zm-stat { background: var(--off-white); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; }
  .zm-stat .zm-lbl { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-light); }
  .zm-stat .zm-val { font-size: 0.95rem; font-weight: 600; color: var(--text-dark); margin-top: 4px; }
  .zm-events { border-top: 1px solid var(--border); padding-top: 14px; }
  .zm-events h4 { margin: 0 0 8px; font-size: 0.9rem; color: var(--text-mid); }
  .zm-event { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 0.85rem; }
  .zm-event:last-child { border-bottom: none; }
  .zm-event .zme-time { color: var(--text-light); font-size: 0.75rem; margin-left: auto; white-space: nowrap; }
  .zm-reco { background: var(--green-pale); border: 1px solid var(--green-light); color: var(--green);
    padding: 12px 14px; border-radius: var(--radius-sm); font-size: 0.88rem; }
  .zm-reco.warn { background: #fff3d6; border-color: #f6b93b; color: #8a5a00; }
  .zm-reco.crit { background: #fde0d6; border-color: #f3b6a6; color: #b8331a; }

  /* ===== HOW IT WORKS ===== */
  #how { background: linear-gradient(150deg, #f0faf5, #e8f0fb); }

  .steps-grid {
    display: grid; grid-template-columns: repeat(4,1fr);
    gap: 24px; max-width: 1000px; margin: 0 auto;
  }
  .step-card {
    background: white;
    border-radius: var(--radius);
    padding: 32px 24px;
    text-align: center;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    position: relative;
  }
  .step-num {
    position: absolute; top: -16px; left: 50%; transform: translateX(-50%);
    width: 32px; height: 32px;
    background: var(--green);
    color: white;
    border-radius: 50%;
    font-weight: 700; font-size: 0.85rem;
    display: flex; align-items: center; justify-content: center;
  }
  .step-icon { font-size: 2.5rem; margin-bottom: 16px; }
  .step-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 8px; }
  .step-card p { font-size: 0.85rem; color: var(--text-mid); line-height: 1.6; }

  /* ===== FOOTER ===== */
  footer {
    background: var(--text-dark);
    color: rgba(255,255,255,0.7);
    padding: 60px 40px 40px;
  }
  .footer-grid {
    display: grid; grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px; max-width: 1100px; margin: 0 auto 50px;
  }
  .footer-brand .logo-text { color: white; }
  .footer-brand p { font-size: 0.88rem; line-height: 1.7; margin-top: 12px; color: rgba(255,255,255,0.5); }
  .footer-col h4 { color: white; font-weight: 600; margin-bottom: 16px; font-size: 0.92rem; }
  .footer-col ul { list-style: none; }
  .footer-col ul li { margin-bottom: 10px; }
  .footer-col ul li a { color: rgba(255,255,255,0.5); text-decoration: none; font-size: 0.88rem; transition: color 0.2s; }
  .footer-col ul li a:hover { color: var(--green-light); }

  .footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 30px;
    max-width: 1100px; margin: 0 auto;
    display: flex; justify-content: space-between;
    align-items: center; flex-wrap: gap;
    gap: 16px;
  }
  .footer-credits { font-size: 0.85rem; line-height: 1.6; }
  .footer-credits strong { color: white; }
  .footer-credits .enset { color: var(--green-light); font-weight: 600; }
  .footer-copy { font-size: 0.82rem; color: rgba(255,255,255,0.3); }

  /* ===== PROFILE MODAL ===== */
  .profile-header {
    display: flex; align-items: center; gap: 20px;
    padding: 24px;
    background: linear-gradient(135deg, var(--green-pale), var(--blue-pale));
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
  }
  .profile-avatar {
    width: 64px; height: 64px;
    background: linear-gradient(135deg, var(--green), var(--blue-light));
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; font-weight: 700; color: white;
  }
  .profile-info h3 { font-size: 1.15rem; font-weight: 700; }
  .profile-info p { font-size: 0.85rem; color: var(--text-mid); }

  .profile-fields { display: flex; flex-direction: column; gap: 12px; }
  .profile-row {
    display: flex; justify-content: space-between;
    padding: 12px 0; border-bottom: 1px solid var(--border);
  }
  .profile-row:last-child { border-bottom: none; }
  .pr-label { font-size: 0.82rem; color: var(--text-light); }
  .pr-val { font-size: 0.9rem; font-weight: 500; }

  .btn-logout {
    width: 100%; padding: 13px;
    background: var(--pink-pale);
    color: var(--pink-deep);
    border: 1.5px solid var(--pink);
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-weight: 600; font-size: 0.95rem;
    cursor: pointer; margin-top: 20px;
    transition: all 0.2s;
  }
  .btn-logout:hover { background: var(--pink); color: white; }

  /* ===== TOAST ===== */
  #toast {
    position: fixed; bottom: 30px; right: 30px;
    background: var(--text-dark);
    color: white;
    padding: 14px 22px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    z-index: 2000;
    display: none;
    animation: slideInRight 0.3s ease;
  }
  #toast.show { display: block; }
  @keyframes slideInRight {
    from { transform: translateX(80px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
  }

  /* ===== RESPONSIVE ===== */
  @media (max-width: 980px) {
    nav { padding: 0 20px; }
    .nav-links { display: none; }
    /* Hide top-nav auth UI on mobile/tablet — they live in the mobile menu */
    .nav-right #guestButtons,
    .nav-right #userBadge { display: none !important; }
    .nav-right { gap: 8px; }
    body { overflow-x: hidden; }
    .hero {
      grid-template-columns: 1fr;
      text-align: center;
      padding: 48px 24px 36px;
      min-height: auto;
      gap: 28px;
      max-width: 100%;
    }
    .hero h1 { font-size: clamp(2rem, 4.2vw, 2.6rem); line-height: 1.15; }
    .hero p { font-size: 1.02rem; line-height: 1.6; margin-left: auto; margin-right: auto; }
    .hero-content { justify-self: center; max-width: 620px; margin-left: 0; padding-inline-start: 0; }
    .hero-cta { justify-content: center; }
    .hero-visual {
      justify-self: stretch;
      width: 100%;
      max-width: 100%;
      flex-direction: row;
      overflow-x: auto;
      overflow-y: hidden;
      gap: 14px;
      padding: 4px 16px 16px;
      background: transparent;
      border: 0;
      box-shadow: none;
      backdrop-filter: none;
      -webkit-backdrop-filter: none;
      scroll-snap-type: x mandatory;
      -webkit-overflow-scrolling: touch;
      touch-action: pan-x;
      scrollbar-width: none;
      -webkit-mask-image: linear-gradient(90deg, #000 0, #000 88%, transparent 100%);
              mask-image: linear-gradient(90deg, #000 0, #000 88%, transparent 100%);
    }
    .hero-visual::-webkit-scrollbar { display: none; }
    .hero-visual::before { display: none; }
    .hero-card { min-width: 220px; flex: 0 0 auto; scroll-snap-align: start; --cardX: 0px !important; --mx: 0px !important; --my: 0px !important; animation: none !important; }
    .hc-offset-a, .hc-offset-b, .hc-offset-c { margin-left: 0 !important; margin-right: 0 !important; }
    .hero-mini-row { display: none; }
    .hero-visual-pill { display: none; }
    .hero-trust { justify-content: center; }
    .hero-grid-overlay { display: none; }
    .diag-layout { grid-template-columns: 1fr; }
    .steps-grid { grid-template-columns: repeat(2,1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    section { padding: 60px 20px; }
    .stats-bar { gap: 30px; }
  }
  @media (max-width: 600px) {
    .hero { padding: 36px 16px 24px; gap: 22px; }
    .hero h1 { font-size: clamp(1.7rem, 7vw, 2.1rem); line-height: 1.18; margin-bottom: 16px; }
    .hero p { font-size: .98rem; line-height: 1.55; margin-bottom: 26px; }
    .hero-badge { font-size: .76rem; padding: 6px 14px; }
    .hero h1 .type-em { display: inline; }
    .hero h1 .type-em .type-static { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
    .hero h1 .type-em .type-anim { white-space: normal; }
    .hero-cta { flex-direction: column; width: 100%; gap: 10px; }
    .hero-cta .btn-hero-main, .hero-cta .btn-hero-sec {
      width: 100%; padding: 14px 18px; font-size: .98rem; justify-content: center; display: inline-flex; align-items: center;
    }
    .hero-visual { padding: 4px 14px 14px; gap: 12px; }
    .hero-card { min-width: 200px; padding: 14px; }
    .hero-card .card-icon { transform: scale(.92); }
    .hero-card p, .hero-card .card-body { font-size: .85rem; }
    .steps-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .footer-bottom { flex-direction: column; text-align: center; }
  }
  @media (max-width: 380px) {
    .hero-cta .btn-hero-main, .hero-cta .btn-hero-sec { font-size: .94rem; padding: 13px 14px; }
    .hero-badge { font-size: .72rem; padding: 5px 12px; }
  }

  /* ============================================================ */
  /* ===== PHASE 4 — MODERN UI/UX POLISH ======================== */
  /* Additive only. Reverting = delete this block.                */
  /* ============================================================ */

  :root {
    /* Severity tokens */
    --sev-ok-bg:#e8f5ee;       --sev-ok-fg:#2d7a4f;       --sev-ok-bd:#bfe3cd;
    --sev-watch-bg:#eaf3fb;    --sev-watch-fg:#2563a8;    --sev-watch-bd:#c6dff5;
    --sev-warn-bg:#fff3d6;     --sev-warn-fg:#b87a00;     --sev-warn-bd:#f6dc8a;
    --sev-crit-bg:#fde0d6;     --sev-crit-fg:#b8331a;     --sev-crit-bd:#f3b6a6;
    --sev-irrig-bg:#e0f2fb;    --sev-irrig-fg:#0f6c97;    --sev-irrig-bd:#b8def0;
    --sev-wx-bg:#ecebff;       --sev-wx-fg:#4338ca;       --sev-wx-bd:#cdcbf5;

    /* Elevation */
    --shadow-sm:0 1px 2px rgba(15,23,42,.04), 0 2px 8px rgba(15,23,42,.04);
    --shadow-md:0 4px 12px rgba(15,23,42,.06), 0 8px 24px rgba(15,23,42,.06);
    --shadow-lg:0 12px 28px rgba(15,23,42,.10), 0 24px 48px rgba(15,23,42,.08);
    --ring-focus:0 0 0 3px rgba(45,122,79,.18);

    /* Surfaces */
    --surface:#ffffff;
    --surface-2:#f7faf8;
    --surface-glass:rgba(255,255,255,.78);

    /* Motion */
    --ease-out:cubic-bezier(.22,.61,.36,1);
    --dur-fast:160ms;
    --dur-base:260ms;
  }

  /* ===== Severity chip (unified) ===== */
  .p4-sev-chip {
    display:inline-flex; align-items:center; gap:6px;
    padding:4px 10px; border-radius:999px;
    font-size:.74rem; font-weight:600; letter-spacing:.01em;
    border:1px solid transparent; line-height:1; white-space:nowrap;
  }
  .p4-sev-ok    { background:var(--sev-ok-bg);    color:var(--sev-ok-fg);    border-color:var(--sev-ok-bd); }
  .p4-sev-watch { background:var(--sev-watch-bg); color:var(--sev-watch-fg); border-color:var(--sev-watch-bd); }
  .p4-sev-warn  { background:var(--sev-warn-bg);  color:var(--sev-warn-fg);  border-color:var(--sev-warn-bd); }
  .p4-sev-crit  { background:var(--sev-crit-bg);  color:var(--sev-crit-fg);  border-color:var(--sev-crit-bd); animation:p4PulseSoft 2.4s ease-in-out infinite; }
  .p4-sev-irrig { background:var(--sev-irrig-bg); color:var(--sev-irrig-fg); border-color:var(--sev-irrig-bd); }
  .p4-sev-wx    { background:var(--sev-wx-bg);    color:var(--sev-wx-fg);    border-color:var(--sev-wx-bd); }

  /* ===== Polish: Farm status header ===== */
  .farm-status-section { background: linear-gradient(155deg,#f4faf6 0%,#eef4fb 60%,#f6f0fb 100%); }
  .farm-status-card { box-shadow: var(--shadow-md); }
  .fs-status { transition: transform var(--dur-fast) var(--ease-out); }
  .fs-status:hover { transform: translateY(-1px); }
  .fs-tone-crit { animation: p4PulseSoft 2.4s ease-in-out infinite; }

  /* ===== Polish: KPI cards ===== */
  .kpi-grid .kpi-card {
    position:relative; min-height:104px;
    display:flex; flex-direction:column; justify-content:center;
    border-radius:14px; box-shadow: var(--shadow-sm);
    transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
  }
  .kpi-grid .kpi-card::before {
    content:""; position:absolute; left:0; top:0; bottom:0; width:4px;
    background: var(--green); border-radius:14px 0 0 14px;
  }
  .kpi-grid .kpi-card.k-blue::before  { background: var(--blue-light); }
  .kpi-grid .kpi-card.k-pink::before  { background: var(--pink-deep); }
  .kpi-grid .kpi-card.k-amber::before { background:#f6b93b; }
  .kpi-grid .kpi-card { border-left: none; padding-left: 22px; }
  .kpi-grid .kpi-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

  /* ===== Polish: Zone cards ===== */
  .zone-card { box-shadow: var(--shadow-sm); transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out); }
  .zone-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
  .zone-card .zone-status { box-shadow: 0 2px 6px rgba(0,0,0,.10); backdrop-filter: blur(2px); }
  .zone-card .zone-body { display:flex; flex-direction:column; min-width:0; }
  .zone-card .zone-name, .zone-card .zone-meta { min-width:0; }

  /* ===== Polish: Weather card ===== */
  .weather-card { box-shadow: var(--shadow-md); }
  .forecast-item { transition: transform var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out); }
  .forecast-item:hover { transform: translateY(-2px); border-color: var(--blue-light); }
  .weather-banner { animation: p4FadeIn var(--dur-base) var(--ease-out); }
  .wb-warn { animation: p4FadeIn var(--dur-base) var(--ease-out), p4PulseSoft 3s ease-in-out infinite 1s; }

  /* ===== Polish: Irrigation cards ===== */
  .irrig-card { box-shadow: var(--shadow-sm); transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out); }
  .irrig-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
  .irrig-bar { background:#eef2f5; }
  .irrig-fill { position: relative; overflow: hidden; }
  .irrig-card .irrig-watering { color: var(--sev-irrig-fg); }
  .irrig-card .irrig-watering .pulse { background: var(--sev-irrig-fg); box-shadow: 0 0 0 4px rgba(15,108,151,.15); }
  /* Active irrigation shimmer */
  .irrig-card .irrig-fill::after {
    content:""; position:absolute; inset:0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
    transform: translateX(-100%);
  }
  .irrig-card:has(.irrig-watering) .irrig-fill::after {
    animation: p4Shimmer 1.6s linear infinite;
  }

  /* ===== Polish: Timeline ===== */
  .timeline-wrap { box-shadow: var(--shadow-sm); }
  .tl-item:hover { background: rgba(0,0,0,.015); border-radius: 8px; }
  .tl-icon { transition: transform var(--dur-fast) var(--ease-out); }
  .tl-item:hover .tl-icon { transform: scale(1.06); }

  /* ===== Polish: Alerts tabs ===== */
  .alerts-tabs { gap: 10px; }
  .alerts-tab { box-shadow: var(--shadow-sm); transition: all var(--dur-fast) var(--ease-out); }
  .alerts-tab:hover { transform: translateY(-1px); }
  .alerts-tab[data-group="urgent"].active        { background:var(--sev-crit-bg); border-color:var(--sev-crit-bd); color:var(--sev-crit-fg); }
  .alerts-tab[data-group="urgent"].active .atc   { background:var(--sev-crit-fg); color:#fff; }
  .alerts-tab[data-group="surveillance"].active  { background:var(--sev-warn-bg); border-color:var(--sev-warn-bd); color:var(--sev-warn-fg); }
  .alerts-tab[data-group="surveillance"].active .atc { background:var(--sev-warn-fg); color:#fff; }
  .alerts-tab[data-group="irrigation"].active    { background:var(--sev-irrig-bg); border-color:var(--sev-irrig-bd); color:var(--sev-irrig-fg); }
  .alerts-tab[data-group="irrigation"].active .atc { background:var(--sev-irrig-fg); color:#fff; }
  .alerts-tab[data-group="weather"].active       { background:var(--sev-wx-bg); border-color:var(--sev-wx-bd); color:var(--sev-wx-fg); }
  .alerts-tab[data-group="weather"].active .atc  { background:var(--sev-wx-fg); color:#fff; }
  .alerts-tab[data-group="sensor"].active        { background:var(--sev-watch-bg); border-color:var(--sev-watch-bd); color:var(--sev-watch-fg); }
  .alerts-tab[data-group="sensor"].active .atc   { background:var(--sev-watch-fg); color:#fff; }
  .notif-item { box-shadow: var(--shadow-sm); transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out); }
  .notif-item:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }

  /* ===== Polish: Recommendation cards ===== */
  .reco-card { box-shadow: var(--shadow-sm); transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out); }
  .reco-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
  .reco-btn { transition: all var(--dur-fast) var(--ease-out); }
  .reco-btn:active { transform: translateY(1px); }

  /* ===== Polish: History table ===== */
  .history-table-wrap { box-shadow: var(--shadow-md); }
  thead th { position: sticky; top: 0; background: linear-gradient(135deg,var(--green-pale),var(--blue-pale)); z-index: 1; }
  tbody tr:nth-child(even) { background: rgba(247,250,248,.6); }
  tbody tr:hover { background: var(--green-pale); }

  /* ===== Polish: Zone modal ===== */
  .zone-modal { box-shadow: var(--shadow-lg); }
  .zm-head { background: linear-gradient(135deg,var(--green-pale),var(--blue-pale)); border-radius: var(--radius) var(--radius) 0 0; }
  .zm-stat { transition: border-color var(--dur-fast) var(--ease-out); }
  .zm-stat:hover { border-color: var(--green-light); }
  .zm-close { transition: all var(--dur-fast) var(--ease-out); }
  .zm-close:hover { background: var(--green-pale); border-color: var(--green-light); color: var(--green); transform: rotate(90deg); }

  /* ===== Polish: Auth/Profile modals + Toast + Buttons ===== */
  .modal { box-shadow: var(--shadow-lg); }
  .form-group input:focus { box-shadow: var(--ring-focus); }
  .btn-primary, .btn-nav, .reco-btn, .filter-btn, .alerts-tab, .modal-close, .zm-close, .weather-refresh {
    min-height: 40px;
  }
  .btn-primary:active, .btn-filled:active, .btn-outline:active { transform: translateY(0); }
  #toast { box-shadow: var(--shadow-lg); }

  /* ============================================================ */
  /* ===== A11Y — Focus-visible polish ========================== */
  /* ============================================================ */
  :where(a, button, [role="button"], input, select, textarea, summary, .hero-card, .zone-card, .reco-btn):focus { outline: none; }
  :where(a, button, [role="button"], input, select, textarea, summary):focus-visible {
    outline: none;
    box-shadow: var(--ring-focus), 0 0 0 1px var(--green);
    border-radius: 8px;
  }
  .btn-hero-main:focus-visible { box-shadow: var(--ring-focus), 0 6px 24px rgba(45,122,79,0.3); }
  .btn-hero-sec:focus-visible  { box-shadow: var(--ring-focus); border-color: var(--green); color: var(--green); }
  .btn-nav:focus-visible, .btn-filled:focus-visible { box-shadow: var(--ring-focus), 0 4px 14px rgba(45,122,79,0.25); }
  .btn-outline:focus-visible { box-shadow: var(--ring-focus); background: var(--green-pale); }
  .modal-close:focus-visible, .zm-close:focus-visible, .weather-refresh:focus-visible,
  .reco-btn:focus-visible, .filter-btn:focus-visible, .alerts-tab:focus-visible {
    box-shadow: var(--ring-focus);
  }
  .nav-links a:focus-visible, .mobile-menu a:focus-visible {
    background: var(--green-pale); color: var(--green);
    border-radius: 6px; padding-inline: 8px;
    box-shadow: var(--ring-focus);
  }
  .hero-card:focus-visible, .zone-card:focus-visible {
    box-shadow: var(--ring-focus), 0 12px 28px rgba(15,23,42,.10);
    transform: translateY(-2px);
  }

  /* Skip-to-content link */
  .skip-link {
    position: absolute; left: 12px; top: -100px;
    background: var(--green); color: #fff;
    padding: 10px 16px; border-radius: 999px;
    font-weight: 600; font-size: .9rem;
    text-decoration: none; z-index: 9999;
    transition: top .2s ease;
    box-shadow: 0 6px 18px rgba(45,122,79,.3);
  }
  .skip-link:focus { top: 12px; outline: none; }

  /* ============================================================ */
  /* ===== MOBILE NAV — Hamburger + slide-down panel ============ */
  /* ============================================================ */
  .nav-burger {
    display: none;
    width: 44px; height: 44px;
    border: 0; background: transparent;
    cursor: pointer; padding: 0;
    align-items: center; justify-content: center;
    border-radius: 10px;
    transition: background .2s ease;
  }
  .nav-burger:hover { background: var(--green-pale); }
  .nav-burger .bars { position: relative; width: 22px; height: 16px; display: block; }
  .nav-burger .bars span {
    position: absolute; left: 0; right: 0; height: 2px;
    background: var(--text-dark); border-radius: 2px;
    transition: transform .25s var(--ease-out), opacity .2s ease, top .25s var(--ease-out);
  }
  .nav-burger .bars span:nth-child(1) { top: 0; }
  .nav-burger .bars span:nth-child(2) { top: 7px; }
  .nav-burger .bars span:nth-child(3) { top: 14px; }
  .nav-burger[aria-expanded="true"] .bars span:nth-child(1) { top: 7px; transform: rotate(45deg); }
  .nav-burger[aria-expanded="true"] .bars span:nth-child(2) { opacity: 0; }
  .nav-burger[aria-expanded="true"] .bars span:nth-child(3) { top: 7px; transform: rotate(-45deg); }

  /* Phase 14c — overlay-only mobile menu.
     Closed state MUST NOT occupy any layout space on any viewport.
     We use display:none when closed and display:block only when .is-open is added.
     position:fixed already removes from flow, but display:none is the strongest guarantee
     so no parent flex/grid/contain context can ever reserve space for it. */
  .mobile-menu {
    position: fixed; top: 70px; left: 0; right: 0;
    z-index: 1000;
    background: var(--surface-glass);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    padding: 12px 16px 18px;
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: transform var(--dur-base) var(--ease-out), opacity var(--dur-base) var(--ease-out);
    display: none;
    max-height: calc(100vh - 70px);
    overflow-y: auto;
    margin: 0;
  }
  .mobile-menu.is-open {
    display: block;
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .mobile-menu ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
  .mobile-menu li a {
    display: block; padding: 12px 12px; min-height: 48px;
    color: var(--text-dark); text-decoration: none;
    font-weight: 500; font-size: 1rem; border-radius: 8px;
    transition: background .2s ease, color .2s ease;
  }
  .mobile-menu li a:hover { background: var(--green-pale); color: var(--green); }
  .mobile-menu hr { border: 0; border-top: 1px solid var(--border); margin: 10px 0; }
  /* Phase 12 — both auth buttons sit on a single row so neither can be pushed below the inner-scroll fold */
  .mobile-menu-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 4px 4px 0; }
  .mobile-menu-actions .btn-nav { width: 100%; padding: 12px 14px; min-height: 46px; }
  @media (max-width: 360px) {
    .mobile-menu-actions { grid-template-columns: 1fr; }
  }
  .mobile-menu-user {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; background: var(--green-pale);
    border-radius: 12px; cursor: pointer;
    border: 0; width: 100%; text-align: left;
    font-family: inherit;
  }
  .mobile-menu-user .avatar { width: 38px; height: 38px; }
  .mobile-menu-user .mm-name { font-weight: 600; color: var(--green); font-size: .95rem; display:block; }
  .mobile-menu-user .mm-sub { font-size: .78rem; color: var(--text-mid); display:block; }

  @media (max-width: 980px) {
    .nav-burger { display: inline-flex; }
    /* Phase 14c — do NOT force .mobile-menu to display:block on mobile.
       It must stay display:none until .is-open is added by JS, otherwise
       even a position:fixed panel can confuse parent flex/contain layouts. */
  }
  @media (min-width: 981px) {
    .mobile-menu { display: none !important; }
    .mobile-menu.is-open { display: none !important; }
  }
  body.menu-open { overflow: hidden; }

  /* ===== Polish: Empty states ===== */
  .p4-empty {
    text-align:center; padding:28px 18px;
    background: var(--surface-2); border:1px dashed var(--border);
    border-radius: var(--radius-sm); color: var(--text-mid);
    animation: p4FadeIn var(--dur-base) var(--ease-out);
  }
  .p4-empty .p4-empty-icon { font-size:1.8rem; margin-bottom:6px; }
  .p4-empty .p4-empty-title { font-weight:600; color: var(--text-dark); margin-bottom:4px; }
  .p4-empty .p4-empty-sub { font-size:.85rem; color: var(--text-light); }

  /* ===== Section reveal animation (gated by JS so content stays visible without JS) ===== */
  html.js-anim section[data-anim] { opacity: 0; transform: translateY(14px); transition: opacity .65s var(--ease-out), transform .65s var(--ease-out); }
  html.js-anim section[data-anim].is-in { opacity: 1; transform: none; }

  /* ===== Keyframes ===== */
  @keyframes p4FadeIn   { from { opacity:0; transform: translateY(4px); } to { opacity:1; transform:none; } }
  @keyframes p4PulseSoft{ 0%,100% { box-shadow: 0 0 0 0 rgba(184,51,26,.0); } 50% { box-shadow: 0 0 0 6px rgba(184,51,26,.10); } }
  @keyframes p4Shimmer  { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

  /* ===== Responsive Phase 4 ===== */
  @media (max-width: 1024px) {
    .kpi-grid { grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); }
    .zones-grid { grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); }
  }
  @media (max-width: 640px) {
    section { padding: 48px 16px; }
    .farm-status-card { padding: 18px; }
    .kpi-grid { grid-template-columns: repeat(2,1fr); gap: 12px; }
    .kpi-grid .kpi-card { min-height: 92px; padding: 14px 14px 14px 18px; }
    .kpi-val { font-size: 1.4rem; }
    .zones-grid { grid-template-columns: 1fr; gap: 16px; }
    .irrig-grid { grid-template-columns: 1fr; }
    .reco-grid { grid-template-columns: 1fr; }
    .alerts-tabs {
      flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start;
      scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
      padding: 4px 4px 10px; margin-left:-4px; margin-right:-4px;
    }
    .alerts-tab { flex: 0 0 auto; scroll-snap-align: start; }
    .modal { padding: 24px 20px; max-width: 92%; }
    .zm-head, .zm-body { padding: 16px 18px; }
    .weather-card { padding: 18px; gap: 18px; }
    .weather-now { flex-wrap: wrap; }
    .weather-refresh { margin-left: 0; }
    .weather-forecast { grid-template-columns: repeat(3,1fr); gap: 8px; }
    .forecast-item { padding: 10px 6px; }
    /* History → stacked cards on mobile */
    .history-table-wrap { border: none; box-shadow: none; background: transparent; }
    table, thead, tbody, tr, td { display: block; width: 100%; }
    thead { display: none; }
    tbody tr {
      background: var(--surface) !important;
      border: 1px solid var(--border); border-radius: var(--radius-sm);
      padding: 12px 14px; margin-bottom: 12px; box-shadow: var(--shadow-sm);
    }
    tbody td {
      padding: 6px 0; border: none; font-size: .88rem;
      display: flex; justify-content: space-between; gap: 12px; align-items: center;
    }
    tbody td::before {
      content: attr(data-label); font-weight: 600; color: var(--text-light);
      font-size: .74rem; text-transform: uppercase; letter-spacing: .04em;
    }
    .timeline-wrap { padding: 14px 16px; }
    #toast { left: 16px; right: 16px; bottom: 16px; text-align: center; }
  }
  @media (max-width: 380px) {
    .kpi-grid { grid-template-columns: 1fr; }
    .kpi-val { font-size: 1.6rem; }
    .fs-status .fs-pill { font-size: 1.35rem; }
    h2 { font-size: 1.5rem !important; }
  }

  /* ===== Reduced motion ===== */
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    section[data-anim] { opacity: 1 !important; transform: none !important; }
  }

  /* ============================================================ */
  /* ===== END PHASE 4 ========================================== */
  /* ============================================================ */

  /* ============================================================ */
  /* ===== PHASE 6 — PUBLIC HOMEPAGE POLISH ===================== */
  /* ============================================================ */

  /* Hero badge live pulse */
  .hero-badge { display:inline-flex; align-items:center; gap:8px; }
  .hero-badge::before {
    content:''; width:8px; height:8px; border-radius:50%;
    background:#4caf78; box-shadow:0 0 0 0 rgba(76,175,120,.7);
    animation: hbPulse 2s infinite;
  }
  @keyframes hbPulse {
    0%   { box-shadow: 0 0 0 0   rgba(76,175,120,.7); }
    70%  { box-shadow: 0 0 0 10px rgba(76,175,120,0); }
    100% { box-shadow: 0 0 0 0   rgba(76,175,120,0); }
  }

  /* Section: Aperçu plateforme */
  .preview-grid {
    display:grid; gap:18px;
    grid-template-columns: repeat(3, 1fr);
    max-width:1200px; margin:0 auto; padding:0 24px;
  }
  .preview-card {
    background:#fff; border:1px solid #e6efe9; border-radius:18px;
    padding:22px; box-shadow:0 4px 14px rgba(45,122,79,.06);
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
    display:flex; flex-direction:column; gap:12px;
  }
  .preview-card:hover {
    transform: translateY(-4px);
    box-shadow:0 14px 32px rgba(45,122,79,.12);
    border-color:#cfe5d6;
  }
  .preview-card .pc-head {
    display:flex; align-items:center; gap:12px;
  }
  .preview-card .pc-icon {
    width:44px; height:44px; border-radius:12px;
    background:linear-gradient(135deg,#eaf6ee,#d6ecdd);
    display:flex; align-items:center; justify-content:center;
    font-size:1.4rem;
  }
  .preview-card h3 { font-size:1.02rem; margin:0; color:#1f3d2a; font-weight:700; }
  .preview-card p  { font-size:.88rem; color:#5a6e62; margin:0; line-height:1.5; }
  .preview-card .pc-chip {
    align-self:flex-start; font-size:.72rem; font-weight:600;
    padding:4px 10px; border-radius:999px;
    background:#eaf6ee; color:#2d7a4f;
  }
  .preview-card .pc-bars {
    display:flex; gap:4px; align-items:flex-end; height:36px; margin-top:4px;
  }
  .preview-card .pc-bars span {
    flex:1; background:linear-gradient(180deg,#4caf78,#2d7a4f);
    border-radius:3px; opacity:.85;
  }
  .preview-card .pc-pills {
    display:flex; gap:6px; flex-wrap:wrap;
  }
  .preview-card .pc-pills span {
    font-size:.72rem; padding:4px 9px; border-radius:999px;
    background:#f3f8f5; color:#2d7a4f; font-weight:600;
  }
  .preview-card .pc-prog {
    height:6px; background:#eef3f0; border-radius:99px; overflow:hidden;
  }
  .preview-card .pc-prog > i {
    display:block; height:100%; width:68%;
    background:linear-gradient(90deg,#4ea0e0,#2d7a4f); border-radius:99px;
  }
  .preview-card .pc-dot {
    display:inline-flex; align-items:center; gap:6px;
    font-size:.78rem; color:#b8431c; font-weight:600;
  }
  .preview-card .pc-dot::before {
    content:''; width:8px; height:8px; border-radius:50%;
    background:#e0613a; box-shadow:0 0 0 0 rgba(224,97,58,.6);
    animation: hbPulse 1.6s infinite;
  }

  /* Section: Features grid */
  .feature-grid {
    display:grid; gap:18px;
    grid-template-columns: repeat(3, 1fr);
    max-width:1200px; margin:0 auto; padding:0 24px;
  }
  .feature-card {
    background:#fff; border:1px solid #ecf2ee; border-radius:16px;
    padding:22px; transition: transform .25s ease, box-shadow .25s ease;
  }
  .feature-card:hover {
    transform: translateY(-3px);
    box-shadow:0 10px 26px rgba(45,122,79,.10);
  }
  .feature-card .fi {
    width:42px; height:42px; border-radius:12px;
    background:linear-gradient(135deg,#eaf6ee,#cde6d4);
    display:flex; align-items:center; justify-content:center;
    font-size:1.25rem; margin-bottom:12px;
  }
  .feature-card h3 { font-size:1rem; margin:0 0 6px; color:#1f3d2a; font-weight:700; }
  .feature-card p  { font-size:.87rem; color:#5a6e62; margin:0; line-height:1.55; }

  /* Section: Dashboard teaser */
  .dash-teaser-wrap {
    max-width:1200px; margin:0 auto; padding:0 24px;
  }
  .dash-teaser {
    background:linear-gradient(180deg,#ffffff,#f5faf6);
    border:1px solid #e3eee7; border-radius:24px;
    padding:26px; box-shadow:0 18px 40px -18px rgba(45,122,79,.25);
    display:grid; gap:18px;
    grid-template-columns: repeat(4, 1fr);
  }
  .dt-tile {
    background:#fff; border:1px solid #eef3f0; border-radius:14px;
    padding:14px 16px; display:flex; flex-direction:column; gap:6px;
  }
  .dt-tile .dt-l { font-size:.74rem; text-transform:uppercase; letter-spacing:.5px; color:#7a8c81; font-weight:600; }
  .dt-tile .dt-v { font-size:1.4rem; font-weight:700; color:#1f3d2a; }
  .dt-tile .dt-sub { font-size:.78rem; color:#5a6e62; }
  .dt-tile.dt-alert { background:linear-gradient(135deg,#fff2ec,#ffe6da); border-color:#f5c9b3; }
  .dt-tile.dt-alert .dt-v { color:#b8431c; font-size:1rem; }
  .dt-strip {
    grid-column: span 4;
    display:grid; gap:12px;
    grid-template-columns: 1fr 1fr 1fr;
  }
  .dt-strip > div {
    background:#fff; border:1px solid #eef3f0; border-radius:14px; padding:14px 16px;
  }
  .dt-strip .dt-l { font-size:.74rem; text-transform:uppercase; letter-spacing:.5px; color:#7a8c81; font-weight:600; margin-bottom:6px; }
  .dt-strip .dt-bar { height:8px; background:#eef3f0; border-radius:99px; overflow:hidden; margin-top:8px; }
  .dt-strip .dt-bar > i { display:block; height:100%; background:linear-gradient(90deg,#4ea0e0,#2d7a4f); border-radius:99px; }
  .dt-strip .dt-zone { display:flex; align-items:center; gap:8px; font-size:.85rem; color:#1f3d2a; font-weight:600; }
  .dt-strip .dt-zone::before {
    content:''; width:10px; height:10px; border-radius:50%;
    background:#4caf78; box-shadow:0 0 0 4px rgba(76,175,120,.18);
  }
  .dash-teaser-cta {
    text-align:center; margin-top:22px;
  }

  /* Journey */
  .journey {
    max-width:1200px; margin:0 auto; padding:0 24px;
    display:grid; gap:14px;
    grid-template-columns: repeat(5, 1fr);
    position:relative;
  }
  .journey-step {
    background:#fff; border:1px solid #ecf2ee; border-radius:16px;
    padding:18px 16px; text-align:center; position:relative;
    transition: transform .25s ease;
  }
  .journey-step:hover { transform: translateY(-3px); }
  .journey-step .js-num {
    width:34px; height:34px; border-radius:50%;
    background:linear-gradient(135deg,#2d7a4f,#4caf78);
    color:#fff; font-weight:700; display:flex; align-items:center; justify-content:center;
    margin:0 auto 10px;
  }
  .journey-step h4 { font-size:.95rem; margin:0 0 6px; color:#1f3d2a; }
  .journey-step p  { font-size:.8rem; color:#5a6e62; margin:0; line-height:1.5; }

  /* CTA band */
  .cta-band {
    margin:60px auto 40px; max-width:1200px;
    background: linear-gradient(135deg,#2d7a4f 0%,#4caf78 100%);
    color:#fff; padding:42px 32px; border-radius:24px;
    display:flex; align-items:center; justify-content:space-between; gap:24px;
    box-shadow:0 24px 50px -20px rgba(45,122,79,.45);
  }
  .cta-band h3 { margin:0; font-size:1.5rem; font-weight:700; }
  .cta-band p  { margin:6px 0 0; opacity:.92; font-size:.95rem; }
  .cta-band .btn-cta {
    background:#fff; color:#2d7a4f; padding:14px 26px; border-radius:12px;
    font-weight:700; border:none; cursor:pointer; font-size:.95rem;
    transition: transform .2s ease, box-shadow .2s ease;
    white-space:nowrap;
  }
  .cta-band .btn-cta:hover {
    transform: translateY(-2px);
    box-shadow:0 10px 22px rgba(0,0,0,.18);
  }

  /* Responsive */
  @media (max-width: 980px) {
    .preview-grid, .feature-grid { grid-template-columns: repeat(2, 1fr); }
    .dash-teaser { grid-template-columns: repeat(2, 1fr); }
    .dt-strip { grid-column: span 2; grid-template-columns: 1fr; }
    .journey { grid-template-columns: repeat(2, 1fr); }
  }
  @media (max-width: 640px) {
    .preview-grid, .feature-grid { grid-template-columns: 1fr; }
    .dash-teaser { grid-template-columns: 1fr; padding:18px; }
    .dt-strip { grid-column: span 1; }
    .journey { grid-template-columns: 1fr; }
    .cta-band { flex-direction:column; text-align:center; padding:32px 22px; }
  }

  /* ============================================================ */
  /* ===== END PHASE 6 ========================================== */
  /* ============================================================ */

  /* ============================================================ */
  /* ===== PHASE 7 — HOMEPAGE ANIMATION POLISH ================== */
  /* ============================================================ */

  /* Shared keyframes */
  @keyframes p7Up   { from { opacity:0; transform: translateY(14px); } to { opacity:1; transform:none; } }
  @keyframes p7In   { from { opacity:0; transform: translateY(8px) scale(.985); } to { opacity:1; transform:none; } }
  @keyframes p7Right{ from { opacity:0; transform: translateX(-14px); } to { opacity:1; transform:none; } }
  @keyframes p7Scan { 0% { transform: translateX(-110%); } 100% { transform: translateX(110%); } }
  @keyframes p7Dot  { 0%,100% { transform: scale(1); opacity:.55; } 50% { transform: scale(1.35); opacity:1; } }
  @keyframes p7Glow { 0%,100% { box-shadow: 0 0 0 0 rgba(184,51,26,.0); } 50% { box-shadow: 0 0 0 10px rgba(184,51,26,.10); } }
  @keyframes p7CtaShift { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

  /* ---- Hero entrance: JS-driven via .reveal-init / .reveal-in ---- */
  html.js-anim .reveal-init:not(.hero-card) {
    opacity: 0;
    transform: translateY(16px);
    will-change: opacity, transform;
  }
  html.js-anim .reveal-in:not(.hero-card) {
    opacity: 1 !important;
    transform: none !important;
    transition:
      opacity .7s cubic-bezier(.2,.7,.2,1),
      transform .8s cubic-bezier(.2,.7,.2,1);
  }
  /* Hero cards: keep float keyframe driving transform; only fade in.
     IMPORTANT: do NOT set `transform: none !important` — it kills floatCardA/B/C. */
  html.js-anim .hero-visual .hero-card.reveal-init { opacity: 0; transition: opacity .7s cubic-bezier(.2,.7,.2,1); }
  html.js-anim .hero-visual .hero-card.reveal-in   { opacity: 1; transition: opacity .7s cubic-bezier(.2,.7,.2,1); }
  html.js-anim .hero-visual .hero-card { animation-play-state: running !important; }

  /* Hero buttons micro press */
  .btn-hero-main, .btn-hero-sec {
    transition: transform .18s ease, box-shadow .25s ease, background .25s ease, color .25s ease;
  }
  .btn-hero-main:hover, .btn-hero-sec:hover { transform: translateY(-2px); }
  .btn-hero-main:active, .btn-hero-sec:active { transform: translateY(1px) scale(.99); }

  /* ---- Section reveal: stagger children (JS-gated) ---- */
  html.js-anim #preview.is-in .preview-card,
  html.js-anim #features.is-in .feature-card,
  html.js-anim #how.is-in .journey-step,
  html.js-anim #dashboardTeaser.is-in .dt-tile,
  html.js-anim #dashboardTeaser.is-in .dt-strip > * {
    opacity: 0;
    animation: p7In .65s ease-out both;
  }
  html.js-anim #preview.is-in .preview-card:nth-child(1)  { animation-delay: 60ms; }
  html.js-anim #preview.is-in .preview-card:nth-child(2)  { animation-delay: 140ms; }
  html.js-anim #preview.is-in .preview-card:nth-child(3)  { animation-delay: 220ms; }
  html.js-anim #preview.is-in .preview-card:nth-child(4)  { animation-delay: 300ms; }
  html.js-anim #preview.is-in .preview-card:nth-child(5)  { animation-delay: 380ms; }
  html.js-anim #preview.is-in .preview-card:nth-child(6)  { animation-delay: 460ms; }

  html.js-anim #features.is-in .feature-card:nth-child(1) { animation-delay: 60ms; }
  html.js-anim #features.is-in .feature-card:nth-child(2) { animation-delay: 130ms; }
  html.js-anim #features.is-in .feature-card:nth-child(3) { animation-delay: 200ms; }
  html.js-anim #features.is-in .feature-card:nth-child(4) { animation-delay: 270ms; }
  html.js-anim #features.is-in .feature-card:nth-child(5) { animation-delay: 340ms; }
  html.js-anim #features.is-in .feature-card:nth-child(6) { animation-delay: 410ms; }
  html.js-anim #features.is-in .feature-card:nth-child(7) { animation-delay: 480ms; }
  html.js-anim #features.is-in .feature-card:nth-child(8) { animation-delay: 540ms; }
  html.js-anim #features.is-in .feature-card:nth-child(9) { animation-delay: 600ms; }

  html.js-anim #how.is-in .journey-step { animation-name: p7Right; }
  html.js-anim #how.is-in .journey-step:nth-child(1) { animation-delay: 60ms; }
  html.js-anim #how.is-in .journey-step:nth-child(2) { animation-delay: 180ms; }
  html.js-anim #how.is-in .journey-step:nth-child(3) { animation-delay: 300ms; }
  html.js-anim #how.is-in .journey-step:nth-child(4) { animation-delay: 420ms; }
  html.js-anim #how.is-in .journey-step:nth-child(5) { animation-delay: 540ms; }

  html.js-anim #dashboardTeaser.is-in .dt-tile:nth-child(1) { animation-delay: 60ms; }
  html.js-anim #dashboardTeaser.is-in .dt-tile:nth-child(2) { animation-delay: 140ms; }
  html.js-anim #dashboardTeaser.is-in .dt-tile:nth-child(3) { animation-delay: 220ms; }
  html.js-anim #dashboardTeaser.is-in .dt-tile:nth-child(4) { animation-delay: 300ms; }
  html.js-anim #dashboardTeaser.is-in .dt-strip > *:nth-child(1) { animation-delay: 380ms; }
  html.js-anim #dashboardTeaser.is-in .dt-strip > *:nth-child(2) { animation-delay: 460ms; }
  html.js-anim #dashboardTeaser.is-in .dt-strip > *:nth-child(3) { animation-delay: 540ms; }

  /* ---- Generic reveal-on-scroll system (premium homepage polish) ---- */
  html.js-anim [data-reveal] {
    opacity: 0;
    transform: translateY(22px);
    transition:
      opacity .75s cubic-bezier(.2,.7,.2,1),
      transform .85s cubic-bezier(.2,.7,.2,1);
    transition-delay: calc(var(--reveal-i, 0) * 70ms);
    will-change: opacity, transform;
  }
  html.js-anim [data-reveal].in-view {
    opacity: 1;
    transform: none;
  }
  html.js-anim [data-reveal-style="zoom"]   { transform: translateY(14px) scale(.97); }
  html.js-anim [data-reveal-style="left"]   { transform: translateX(-26px); }
  html.js-anim [data-reveal-style="right"]  { transform: translateX(26px); }
  html.js-anim [data-reveal-style="zoom"].in-view,
  html.js-anim [data-reveal-style="left"].in-view,
  html.js-anim [data-reveal-style="right"].in-view { transform: none; }

  /* ---- Card micro-interactions (icons) ---- */
  .preview-card .pc-icon, .feature-card .fc-icon, .preview-card [class*="icon"], .feature-card [class*="icon"] {
    transition: transform .3s ease, filter .3s ease;
  }
  .preview-card:hover .pc-icon, .preview-card:hover [class*="icon"],
  .feature-card:hover .fc-icon, .feature-card:hover [class*="icon"] {
    transform: scale(1.08);
    filter: brightness(1.05);
  }

  /* ---- Dashboard teaser smart-platform feel ---- */
  .dash-teaser { position: relative; overflow: hidden; }
  .dash-teaser::after {
    content: '';
    position: absolute; top: 0; left: 0;
    width: 35%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(76,175,120,.08), transparent);
    transform: translateX(-110%);
    animation: p7Scan 6s ease-in-out infinite;
    pointer-events: none;
    will-change: transform;
  }
  .dash-teaser .dt-alert { animation: p7Glow 3.4s ease-in-out infinite; }
  .dash-teaser .dt-bar i {
    position: relative; overflow: hidden;
    background-image: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.45) 50%, rgba(255,255,255,0) 100%);
    background-size: 200% 100%;
    animation: p7CtaShift 2.6s linear infinite;
  }
  .dt-sensor {
    display:inline-block; width:8px; height:8px; border-radius:50%;
    background:#4caf78; margin-right:6px;
    animation: p7Dot 2s ease-in-out infinite;
  }
  .dt-sensor.s2 { animation-delay: .3s; background:#4ea0e0; }
  .dt-sensor.s3 { animation-delay: .6s; background:#e0a64e; }

  /* ---- CTA band gradient shift ---- */
  .cta-band {
    background-size: 200% 200% !important;
    animation: p7CtaShift 9s ease-in-out infinite;
  }
  .cta-band .btn-cta { transition: transform .2s ease, box-shadow .25s ease; }
  .cta-band .btn-cta:hover { box-shadow: 0 10px 28px rgba(0,0,0,.18); }
  .cta-band .btn-cta:active { transform: translateY(1px) scale(.99); }

  /* ---- Footer fade ---- */
  html.js-anim footer { animation: p7Up .7s ease-out both; animation-delay: 80ms; }

  /* Mobile: tighten stagger & pause heavy loops */
  @media (max-width: 640px) {
    [class*="animation-delay"] { animation-delay: 0ms !important; }
    .dash-teaser::after { animation: none; display:none; }
  }

  /* Reduced motion: kill all P7 motion */
  @media (prefers-reduced-motion: reduce) {
    html.js-anim .hero .hero-badge,
    html.js-anim .hero .hero-content h1,
    html.js-anim .hero .hero-content > p,
    html.js-anim .hero .hero-cta,
    html.js-anim .hero .hero-visual .hero-card,
    html.js-anim #preview.is-in .preview-card,
    html.js-anim #features.is-in .feature-card,
    html.js-anim #how.is-in .journey-step,
    html.js-anim #dashboardTeaser.is-in .dt-tile,
    html.js-anim #dashboardTeaser.is-in .dt-strip > *,
    html.js-anim [data-reveal],
    html.js-anim .reveal-init,
    html.js-anim footer {
      animation: none !important;
      opacity: 1 !important;
      transform: none !important;
      transition: opacity .15s linear !important;
    }
    .dash-teaser::after,
    .dash-teaser .dt-alert,
    .dash-teaser .dt-bar i,
    .cta-band,
    .dt-sensor,
    .blob,
    .hero-visual::before,
    .hero-card,
    .hero-card::after { animation: none !important; transform: none !important; }
    .hero h1 .type-em .type-anim { display: none !important; }
    .hero h1 .type-em .type-static { visibility: visible !important; position: static; clip-path: none; width: auto; height: auto; }
  }

  /* ============================================================ */
  /* ===== END PHASE 7 ========================================== */
  /* ============================================================ */

/* ===== PWA Install Prompt ===== */
  #pwaInstall{
    position:fixed; right:20px; bottom:20px; z-index:9000;
    width:360px; max-width:calc(100vw - 32px);
    background:#ffffff; color:#1a2b22;
    border:1px solid rgba(45,122,79,.18);
    border-radius:16px;
    box-shadow:0 18px 50px -12px rgba(20,60,40,.28), 0 4px 14px rgba(20,60,40,.08);
    padding:16px 18px 14px;
    transform:translateY(20px); opacity:0; pointer-events:none;
    transition:transform .42s cubic-bezier(.22,.9,.32,1), opacity .35s ease;
    font-family:inherit;
  }
  #pwaInstall.is-visible{ transform:translateY(0); opacity:1; pointer-events:auto; }
  #pwaInstall .pwa-row{ display:flex; align-items:flex-start; gap:12px; }
  #pwaInstall .pwa-icon{
    flex:0 0 44px; width:44px; height:44px; border-radius:12px;
    background:linear-gradient(135deg,#2d7a4f,#52b788);
    display:flex; align-items:center; justify-content:center;
    color:#fff; font-size:22px; line-height:1;
    box-shadow:0 6px 16px -6px rgba(45,122,79,.6);
  }
  #pwaInstall .pwa-body{ flex:1; min-width:0; }
  #pwaInstall .pwa-title{ font-weight:700; font-size:15px; margin:0 0 2px; color:#1a2b22; }
  #pwaInstall .pwa-text{ font-size:13px; line-height:1.45; color:#4a5b52; margin:0; }
  #pwaInstall .pwa-hint{ font-size:12.5px; line-height:1.5; color:#2d7a4f; margin:8px 0 0; font-weight:500; }
  #pwaInstall .pwa-close{
    position:absolute; top:8px; right:10px; width:28px; height:28px;
    background:transparent; border:0; border-radius:8px; cursor:pointer;
    color:#7a8a82; font-size:18px; line-height:1;
    display:flex; align-items:center; justify-content:center;
    transition:background .2s, color .2s;
  }
  #pwaInstall .pwa-close:hover{ background:rgba(0,0,0,.05); color:#1a2b22; }
  #pwaInstall .pwa-actions{ display:flex; gap:8px; margin-top:12px; }
  #pwaInstall .pwa-btn{
    flex:1; padding:9px 12px; border-radius:10px;
    font-size:13.5px; font-weight:600; cursor:pointer;
    border:0; transition:transform .15s, box-shadow .2s, background .2s;
  }
  #pwaInstall .pwa-btn-primary{
    background:linear-gradient(135deg,#2d7a4f,#3e9d6a); color:#fff;
    box-shadow:0 4px 12px -4px rgba(45,122,79,.5);
  }
  #pwaInstall .pwa-btn-primary:hover{ box-shadow:0 6px 16px -4px rgba(45,122,79,.6); }
  #pwaInstall .pwa-btn-primary:active{ transform:translateY(1px) scale(.99); }
  #pwaInstall .pwa-btn-secondary{
    background:#f1f4ef; color:#3a4a42;
  }
  #pwaInstall .pwa-btn-secondary:hover{ background:#e6ebe2; }
  @media (max-width:640px){
    #pwaInstall{
      left:12px; right:12px; bottom:12px; width:auto;
      border-radius:18px;
      backdrop-filter:saturate(140%) blur(8px);
    }
  }
  @media (prefers-reduced-motion: reduce){
    #pwaInstall{ transition:opacity .25s ease; transform:none; }
    #pwaInstall.is-visible{ transform:none; }
  }

  /* ============================================================
     === Public pages (Phase 3) — Agriculture / Irrigation /
     === Weather / Livestock — premium AI showcase pages
     ============================================================ */
  .public-page { padding-top: 0; }
  .public-page main { display: block; }

  /* Theme accents per page */
  body[data-page="agriculture"] { --accent: #2d7a4f; --accent-soft: #4caf78; --accent-pale: #e8f5ee; --accent-shadow: 0 18px 50px -20px rgba(45,122,79,.45); }
  body[data-page="irrigation"]  { --accent: #2563a8; --accent-soft: #4a90d9; --accent-pale: #e8f0fb; --accent-shadow: 0 18px 50px -20px rgba(37,99,168,.45); }
  body[data-page="weather"]     { --accent: #1e7a9e; --accent-soft: #4ec1e6; --accent-pale: #e6f4fa; --accent-shadow: 0 18px 50px -20px rgba(30,122,158,.45); }
  body[data-page="livestock"]   { --accent: #b8741b; --accent-soft: #e0a04c; --accent-pale: #fbf1e3; --accent-shadow: 0 18px 50px -20px rgba(184,116,27,.45); }

  /* Active nav link */
  .nav-links a[data-nav-key].is-active,
  .mobile-menu a[data-nav-key].is-active { color: var(--accent, var(--green)); font-weight: 600; }
  .nav-links a[data-nav-key].is-active::after {
    content: ""; display: block; height: 2px; margin-top: 4px;
    background: var(--accent, var(--green)); border-radius: 2px;
  }

  /* ===== HERO ===== */
  .pp-hero {
    position: relative; overflow: hidden;
    padding: clamp(56px, 9vw, 120px) 6vw clamp(48px, 7vw, 96px);
    background:
      radial-gradient(900px 500px at 85% -10%, var(--accent-pale) 0%, transparent 60%),
      radial-gradient(700px 400px at 0% 100%, var(--accent-pale) 0%, transparent 55%),
      linear-gradient(180deg, #fff 0%, var(--off-white) 100%);
  }
  .pp-hero-inner {
    max-width: 1180px; margin: 0 auto;
    display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center;
  }
  .pp-eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 7px 14px; border-radius: 999px;
    background: var(--accent-pale); color: var(--accent);
    font-size: .82rem; font-weight: 600; letter-spacing: .02em;
    border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
  }
  .pp-eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
  .pp-hero h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.1rem, 4.6vw, 3.6rem); line-height: 1.05;
    color: var(--text-dark); margin: 18px 0 14px; letter-spacing: -.01em;
  }
  .pp-hero h1 em { font-style: normal; color: var(--accent); }
  .pp-hero .pp-sub { color: var(--text-mid); font-size: clamp(1rem, 1.4vw, 1.12rem); line-height: 1.6; max-width: 560px; }
  .pp-hero-cta { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
  .pp-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 13px 22px; border-radius: 12px; border: none; cursor: pointer;
    font-family: inherit; font-size: .95rem; font-weight: 600;
    text-decoration: none; transition: transform .2s, box-shadow .2s, background .2s;
  }
  .pp-btn-primary { background: var(--accent); color: #fff; box-shadow: var(--accent-shadow); }
  .pp-btn-primary:hover { transform: translateY(-2px); }
  .pp-btn-ghost { background: #fff; color: var(--accent); border: 1.5px solid color-mix(in srgb, var(--accent) 25%, transparent); }
  .pp-btn-ghost:hover { background: var(--accent-pale); }

  .pp-hero-visual {
    position: relative; aspect-ratio: 1/1; max-width: 460px; justify-self: end; width: 100%;
    border-radius: 28px; padding: 28px;
    background: linear-gradient(160deg, #fff 0%, var(--accent-pale) 100%);
    box-shadow: 0 30px 80px -30px color-mix(in srgb, var(--accent) 40%, transparent);
    overflow: hidden;
  }
  .pp-hero-visual::before {
    content: ""; position: absolute; inset: -2px;
    background: conic-gradient(from 180deg, transparent, color-mix(in srgb, var(--accent) 35%, transparent), transparent 30%);
    animation: ppRing 8s linear infinite; opacity: .35; filter: blur(2px);
  }
  @keyframes ppRing { to { transform: rotate(360deg); } }
  .pp-hero-visual-inner {
    position: relative; height: 100%; border-radius: 22px; background: #fff;
    display: flex; flex-direction: column; padding: 22px; gap: 14px;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 10%, transparent);
  }
  .pp-visual-header { display: flex; align-items: center; justify-content: space-between; }
  .pp-visual-tag { font-size: .78rem; color: var(--text-light); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
  .pp-visual-emoji { font-size: clamp(3.5rem, 7vw, 5.5rem); align-self: center; line-height: 1; margin: 6px 0; }
  .pp-visual-bars { display: flex; flex-direction: column; gap: 10px; margin-top: auto; }
  .pp-visual-bar { display: flex; align-items: center; gap: 10px; font-size: .82rem; color: var(--text-mid); }
  .pp-visual-bar .lbl { width: 90px; }
  .pp-visual-bar .track { flex: 1; height: 6px; border-radius: 999px; background: var(--accent-pale); overflow: hidden; }
  .pp-visual-bar .fill { display: block; height: 100%; background: linear-gradient(90deg, var(--accent-soft), var(--accent)); border-radius: 999px; width: 0; transition: width 1.2s cubic-bezier(.2,.8,.2,1); }
  .pp-visual-bar .val { width: 38px; text-align: right; font-weight: 600; color: var(--accent); font-variant-numeric: tabular-nums; }

  /* ===== SECTION wrapper ===== */
  .pp-section { padding: clamp(56px, 8vw, 100px) 6vw; max-width: 1180px; margin: 0 auto; }
  .pp-section-head { max-width: 720px; margin: 0 auto clamp(28px, 4vw, 48px); text-align: center; }
  .pp-section-head .pp-eyebrow { margin-bottom: 14px; }
  .pp-section-head h2 { font-family: 'Playfair Display', serif; font-size: clamp(1.7rem, 3vw, 2.4rem); color: var(--text-dark); line-height: 1.15; margin-bottom: 12px; }
  .pp-section-head p { color: var(--text-mid); line-height: 1.65; font-size: 1rem; }

  /* ===== KPI strip ===== */
  .pp-kpi-strip {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px;
    max-width: 1180px; margin: -56px auto 0; padding: 0 6vw; position: relative; z-index: 2;
  }
  .pp-kpi {
    background: #fff; border-radius: 18px; padding: 22px;
    border: 1px solid var(--border);
    box-shadow: 0 12px 40px -22px rgba(26,35,50,.18);
    transition: transform .25s, box-shadow .25s;
  }
  .pp-kpi:hover { transform: translateY(-4px); box-shadow: 0 20px 50px -22px color-mix(in srgb, var(--accent) 35%, rgba(26,35,50,.18)); }
  .pp-kpi .pp-kpi-icon { width: 38px; height: 38px; border-radius: 10px; background: var(--accent-pale); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; font-size: 1.15rem; margin-bottom: 12px; }
  .pp-kpi .pp-kpi-value { font-family: 'Playfair Display', serif; font-size: 2rem; color: var(--text-dark); line-height: 1; font-variant-numeric: tabular-nums; }
  .pp-kpi .pp-kpi-value .suf { font-size: 1.1rem; color: var(--accent); margin-left: 2px; }
  .pp-kpi .pp-kpi-label { color: var(--text-mid); font-size: .85rem; margin-top: 6px; }

  /* ===== Card grid ===== */
  .pp-grid { display: grid; gap: 18px; }
  .pp-grid-3 { grid-template-columns: repeat(3, 1fr); }
  .pp-grid-2 { grid-template-columns: repeat(2, 1fr); }
  .pp-grid-4 { grid-template-columns: repeat(4, 1fr); }

  .pp-card {
    background: #fff; border: 1px solid var(--border); border-radius: 18px;
    padding: 22px; transition: transform .25s, box-shadow .25s, border-color .25s;
  }
  .pp-card.hover-lift:hover { transform: translateY(-4px); box-shadow: 0 18px 44px -24px color-mix(in srgb, var(--accent) 30%, rgba(26,35,50,.18)); border-color: color-mix(in srgb, var(--accent) 25%, var(--border)); }
  .pp-card h3 { font-family: 'Playfair Display', serif; font-size: 1.2rem; color: var(--text-dark); margin-bottom: 8px; }
  .pp-card p { color: var(--text-mid); font-size: .92rem; line-height: 1.55; }
  .pp-card .pp-card-icon {
    width: 44px; height: 44px; border-radius: 12px;
    background: var(--accent-pale); color: var(--accent);
    display: inline-flex; align-items: center; justify-content: center; font-size: 1.3rem;
    margin-bottom: 14px;
  }

  /* Insight cards (3-up) */
  .pp-insight-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
  .pp-insight {
    position: relative; padding: 26px; border-radius: 20px;
    background: linear-gradient(180deg, #fff 0%, var(--accent-pale) 100%);
    border: 1px solid color-mix(in srgb, var(--accent) 12%, var(--border));
  }
  .pp-insight .pp-card-icon { background: #fff; box-shadow: var(--accent-shadow); }
  .pp-insight h3 { color: var(--text-dark); }
  .pp-insight ul { list-style: none; margin-top: 12px; padding: 0; }
  .pp-insight ul li { font-size: .88rem; color: var(--text-mid); padding: 6px 0 6px 22px; position: relative; }
  .pp-insight ul li::before { content: "→"; color: var(--accent); position: absolute; left: 0; font-weight: 700; }

  /* Zone / barn / forecast tile */
  .pp-tile {
    background: #fff; border: 1px solid var(--border); border-radius: 18px;
    padding: 20px; display: flex; flex-direction: column; gap: 14px;
    transition: transform .25s, box-shadow .25s;
  }
  .pp-tile:hover { transform: translateY(-3px); box-shadow: 0 16px 40px -22px rgba(26,35,50,.2); }
  .pp-tile-head { display: flex; align-items: center; gap: 12px; }
  .pp-tile-emoji { width: 46px; height: 46px; border-radius: 12px; background: var(--accent-pale); display: inline-flex; align-items: center; justify-content: center; font-size: 1.4rem; }
  .pp-tile-title { font-weight: 600; color: var(--text-dark); font-size: 1rem; }
  .pp-tile-sub { font-size: .8rem; color: var(--text-light); }
  .pp-tile-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 14px; font-size: .85rem; }
  .pp-tile-stat .lbl { color: var(--text-light); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; }
  .pp-tile-stat .val { font-weight: 600; color: var(--text-dark); font-variant-numeric: tabular-nums; }

  /* Progress bar */
  .pp-progress { display: flex; align-items: center; gap: 10px; font-size: .82rem; color: var(--text-mid); }
  .pp-progress .lbl { min-width: 88px; }
  .pp-progress .track { flex: 1; height: 8px; border-radius: 999px; background: var(--accent-pale); overflow: hidden; }
  .pp-progress .fill { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent-soft), var(--accent)); border-radius: 999px; transition: width 1.1s cubic-bezier(.2,.8,.2,1); }
  .pp-progress .val { min-width: 42px; text-align: right; font-weight: 600; color: var(--accent); font-variant-numeric: tabular-nums; }
  .pp-progress.is-low .fill { background: linear-gradient(90deg, #f0b86c, #d97c2b); }
  .pp-progress.is-critical .fill { background: linear-gradient(90deg, #ec7878, #c0392b); }

  /* Pulse dot for AI / camera / alerts */
  .pulse-dot { position: relative; display: inline-flex; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
  .pulse-dot::after {
    content: ""; position: absolute; inset: -4px; border-radius: 50%;
    background: color-mix(in srgb, var(--accent) 60%, transparent);
    animation: pulseRing 1.8s cubic-bezier(.2,.8,.2,1) infinite; opacity: .6;
  }
  .pulse-dot.is-alert { background: #d9534f; }
  .pulse-dot.is-alert::after { background: rgba(217,83,79,.45); }
  @keyframes pulseRing { 0% { transform: scale(.6); opacity: .7; } 100% { transform: scale(1.6); opacity: 0; } }

  /* Severity chips */
  .pp-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: .74rem; font-weight: 600; }
  .pp-chip-ok { background: #e7f6ec; color: #1e7a3a; }
  .pp-chip-warn { background: #fff3e0; color: #b56a00; }
  .pp-chip-crit { background: #fdecea; color: #b21f1f; }
  .pp-chip-ai { background: var(--accent-pale); color: var(--accent); }

  /* Two-column alerts + recommendations */
  .pp-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
  .pp-list-card { background: #fff; border: 1px solid var(--border); border-radius: 20px; padding: 24px; }
  .pp-list-card h3 { font-family: 'Playfair Display', serif; font-size: 1.25rem; margin-bottom: 4px; color: var(--text-dark); }
  .pp-list-card .pp-list-sub { color: var(--text-light); font-size: .85rem; margin-bottom: 16px; }
  .pp-list-item {
    display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: flex-start;
    padding: 12px 0; border-top: 1px dashed var(--border);
  }
  .pp-list-item:first-of-type { border-top: 0; }
  .pp-list-item .pp-li-icon { width: 36px; height: 36px; border-radius: 10px; background: var(--accent-pale); color: var(--accent); display:flex; align-items:center; justify-content:center; font-size: 1rem; }
  .pp-list-item .pp-li-title { font-weight: 600; color: var(--text-dark); font-size: .95rem; }
  .pp-list-item .pp-li-desc { color: var(--text-mid); font-size: .85rem; line-height: 1.5; margin-top: 2px; }
  .pp-list-item .pp-li-time { color: var(--text-light); font-size: .75rem; white-space: nowrap; }

  /* Timeline */
  .pp-timeline { position: relative; padding-left: 24px; }
  .pp-timeline::before { content: ""; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px; background: var(--accent-pale); border-radius: 2px; }
  .pp-tl-item { position: relative; padding: 10px 0 14px; }
  .pp-tl-item::before { content: ""; position: absolute; left: -20px; top: 16px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-pale); }
  .pp-tl-time { font-size: .75rem; color: var(--text-light); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
  .pp-tl-title { font-weight: 600; color: var(--text-dark); margin: 2px 0 4px; font-size: .95rem; }
  .pp-tl-desc { color: var(--text-mid); font-size: .86rem; line-height: 1.5; }

  /* CTA block */
  .pp-cta {
    margin: 0 6vw clamp(56px,8vw,96px); max-width: 1180px;
    margin-left: auto; margin-right: auto;
    border-radius: 28px; padding: clamp(36px,6vw,64px);
    background:
      radial-gradient(700px 320px at 110% -10%, color-mix(in srgb, var(--accent) 35%, transparent) 0%, transparent 60%),
      linear-gradient(135deg, var(--accent) 0%, color-mix(in srgb, var(--accent) 70%, #1a2332) 100%);
    color: #fff; display: grid; grid-template-columns: 1.4fr .8fr; gap: 28px; align-items: center;
    box-shadow: var(--accent-shadow);
  }
  .pp-cta h2 { font-family: 'Playfair Display', serif; font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.15; margin-bottom: 10px; }
  .pp-cta p { opacity: .92; line-height: 1.6; }
  .pp-cta-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
  .pp-cta-actions .pp-btn-primary { background: #fff; color: var(--accent); box-shadow: 0 12px 30px -12px rgba(0,0,0,.35); }
  .pp-cta-actions .pp-btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
  .pp-cta-actions .pp-btn-ghost:hover { background: rgba(255,255,255,.12); }

  /* ===== Reveal / count-up animation utilities ===== */
  [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.8,.2,1); }
  [data-reveal].is-in { opacity: 1; transform: translateY(0); }

  /* ===== Weather page specifics ===== */
  .pp-weather-now {
    display: grid; grid-template-columns: 1.2fr .8fr; gap: 28px;
    background: linear-gradient(160deg, #fff 0%, var(--accent-pale) 100%);
    border-radius: 24px; padding: 32px; border: 1px solid color-mix(in srgb, var(--accent) 14%, var(--border));
  }
  .pp-weather-temp { display: flex; align-items: baseline; gap: 6px; }
  .pp-weather-temp .pp-temp-val {
    font-family: 'Playfair Display', serif; font-size: clamp(4rem, 9vw, 6.5rem); line-height: 1;
    color: var(--text-dark); font-variant-numeric: tabular-nums;
  }
  .pp-weather-temp .pp-temp-unit { font-size: 2rem; color: var(--accent); }
  .pp-weather-cond { display: flex; align-items: center; gap: 12px; margin-top: 6px; font-size: 1.1rem; color: var(--text-mid); }
  .pp-weather-cond .ico { font-size: 1.7rem; }
  .pp-weather-meta { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-top: 22px; }
  .pp-weather-meta div { background: #fff; border-radius: 12px; padding: 12px; border: 1px solid var(--border); text-align: center; }
  .pp-weather-meta .lbl { font-size: .72rem; color: var(--text-light); text-transform: uppercase; letter-spacing: .06em; }
  .pp-weather-meta .val { font-size: 1.15rem; font-weight: 600; color: var(--text-dark); margin-top: 4px; font-variant-numeric: tabular-nums; }

  .pp-hourly { display: grid; grid-template-columns: repeat(12, 1fr); gap: 8px; overflow-x: auto; padding-bottom: 4px; }
  .pp-hour {
    background: #fff; border: 1px solid var(--border); border-radius: 14px;
    padding: 12px 6px; text-align: center; transition: transform .2s, box-shadow .2s;
  }
  .pp-hour:hover { transform: translateY(-3px); box-shadow: 0 10px 24px -16px color-mix(in srgb, var(--accent) 40%, rgba(0,0,0,.2)); }
  .pp-hour .h { font-size: .78rem; color: var(--text-light); font-weight: 600; }
  .pp-hour .ico { font-size: 1.3rem; margin: 4px 0; }
  .pp-hour .t { font-size: 1rem; color: var(--text-dark); font-weight: 600; font-variant-numeric: tabular-nums; }

  /* ===== Live status pill in hero ===== */
  .pp-live { display: inline-flex; align-items: center; gap: 8px; margin-top: 18px; font-size: .82rem; color: var(--text-mid); background: #fff; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border); }
  .pp-live strong { color: var(--text-dark); }

  /* ===== Responsive ===== */
  @media (max-width: 980px) {
    .pp-hero-inner { grid-template-columns: 1fr; text-align: left; }
    .pp-hero-visual { justify-self: center; max-width: 380px; }
    .pp-kpi-strip { grid-template-columns: repeat(2, 1fr); margin-top: -36px; }
    .pp-grid-3, .pp-grid-4, .pp-insight-grid { grid-template-columns: repeat(2, 1fr); }
    .pp-two-col { grid-template-columns: 1fr; }
    .pp-cta { grid-template-columns: 1fr; text-align: left; }
    .pp-cta-actions { justify-content: flex-start; }
    .pp-weather-now { grid-template-columns: 1fr; }
    .pp-hourly { grid-template-columns: repeat(6, minmax(78px,1fr)); }
  }
  @media (max-width: 600px) {
    .pp-kpi-strip { grid-template-columns: repeat(2, 1fr); padding: 0 4vw; gap: 12px; }
    .pp-kpi { padding: 16px; }
    .pp-kpi .pp-kpi-value { font-size: 1.6rem; }
    .pp-grid-3, .pp-grid-4, .pp-insight-grid, .pp-grid-2 { grid-template-columns: 1fr; }
    .pp-section { padding: 56px 5vw; }
    .pp-hero { padding: 56px 5vw 56px; }
    .pp-hourly { grid-template-columns: repeat(4, minmax(72px,1fr)); }
    .pp-weather-meta { grid-template-columns: repeat(3, 1fr); }
    .pp-weather-temp .pp-temp-val { font-size: 4rem; }
  }

  @media (prefers-reduced-motion: reduce) {
    [data-reveal] { opacity: 1; transform: none; transition: none; }
    .pulse-dot::after { animation: none; }
    .pp-hero-visual::before { animation: none; }
    .pp-progress .fill, .pp-visual-bar .fill { transition: none; }
  }

/* =====================================================================
   PHASE 4 — Public pages polish (append-only, scoped to .public-page)
   ===================================================================== */

/* Section rhythm */
.public-page .pp-section + .pp-section { padding-top: clamp(40px, 6vw, 72px); }
.public-page .pp-section-soft {
  background: linear-gradient(180deg, transparent, var(--accent-pale) 55%, transparent);
}

/* Hero baseline */
.public-page .pp-hero { min-height: clamp(420px, 56vh, 620px); }
.public-page .pp-hero-visual-inner { min-height: 280px; }

/* Eyebrow */
.public-page .pp-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px;
  font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}

/* KPI strip parity */
.public-page .pp-kpi-strip {
  display: grid; gap: 14px; grid-template-columns: repeat(4, 1fr);
  max-width: 1180px; margin: -24px auto 0; padding: 0 6vw; position: relative; z-index: 2;
}
.public-page .pp-kpi { min-height: 132px; display: flex; flex-direction: column; justify-content: center; }
.public-page .pp-kpi .pp-kpi-value { display: inline-flex; align-items: baseline; gap: 2px; }

/* Cards parity */
.public-page .pp-card,
.public-page .pp-tile,
.public-page .pp-list-card,
.public-page .pp-insight {
  border-radius: 20px;
}
.public-page .pp-tile { display: flex; flex-direction: column; gap: 14px; padding: 20px; }
.public-page .pp-tile.is-alert {
  border-color: color-mix(in srgb, #d9534f 35%, var(--border));
  box-shadow: 0 14px 36px -22px rgba(217,83,79,.45);
}
.public-page .pp-tile-cam {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .8rem; color: var(--text-mid);
}
.public-page .pp-tile-last {
  font-size: .82rem; color: var(--text-mid);
  padding-top: 10px; border-top: 1px dashed var(--border); margin-top: auto;
}
.public-page .pp-tile-decision {
  display: flex; align-items: center; gap: 10px;
  font-size: .82rem; color: var(--text-mid); line-height: 1.5;
}

/* Chip rows */
.public-page .pp-chip-row { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.public-page .pp-treat {
  margin-top: 10px; color: var(--accent); font-weight: 600; font-size: .85rem;
}

/* Pipeline strip */
.public-page .pp-pipeline {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  flex-wrap: wrap; margin: 0 auto 36px; max-width: 920px;
}
.public-page .pp-pipe-step {
  display: inline-flex; flex-direction: column; gap: 2px;
  padding: 12px 16px; border-radius: 14px;
  background: #fff; border: 1px solid var(--border);
  min-width: 132px; box-shadow: 0 8px 22px -18px color-mix(in srgb, var(--accent) 50%, transparent);
}
.public-page .pp-pipe-step .n { font-size: .7rem; color: var(--accent); font-weight: 700; letter-spacing: .12em; }
.public-page .pp-pipe-step .t { font-size: .95rem; color: var(--text-dark); font-weight: 600; }
.public-page .pp-pipe-step .d { font-size: .76rem; color: var(--text-light); }
.public-page .pp-pipe-arrow { color: var(--accent); font-size: 1.1rem; opacity: .6; }

/* Camera strip (livestock) */
.public-page .pp-cam-strip {
  display: flex; gap: 10px; flex-wrap: wrap; justify-content: center;
}
.public-page .pp-cam-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px;
  background: #fff; border: 1px solid var(--border);
  font-size: .82rem; color: var(--text-mid); font-weight: 500;
}

/* Hourly forecast: scroll-snap on overflow */
.public-page .pp-hourly-title {
  font-size: .78rem; color: var(--text-light); text-transform: uppercase;
  letter-spacing: .06em; margin-bottom: 10px; font-weight: 600;
}
.public-page .pp-hourly {
  display: grid; grid-template-columns: repeat(12, minmax(56px, 1fr));
  gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory;
  -ms-overflow-style: none; scrollbar-width: none;
  padding-bottom: 4px;
}
.public-page .pp-hourly::-webkit-scrollbar { display: none; }
.public-page .pp-hour { scroll-snap-align: start; }

/* CTA equality */
.public-page .pp-cta { margin: clamp(48px, 6vw, 80px) auto; max-width: 1100px; }

/* Hero entrance (premium) */
html.js-anim .public-page .pp-hero [data-reveal] {
  opacity: 0; transform: translateY(14px);
  transition: opacity .8s cubic-bezier(.2,.8,.2,1), transform .8s cubic-bezier(.2,.8,.2,1);
  transition-delay: calc(var(--hero-i, 0) * 90ms);
}
html.js-anim .public-page .pp-hero [data-reveal].is-in { opacity: 1; transform: none; }

/* Generic reveal for public pages (additive, parallel to homepage system) */
html.js-anim .public-page [data-reveal] {
  opacity: 0; transform: translateY(16px);
  transition: opacity .7s cubic-bezier(.2,.8,.2,1), transform .7s cubic-bezier(.2,.8,.2,1);
}
html.js-anim .public-page [data-reveal].is-in { opacity: 1; transform: none; }

/* List items reveal */
html.js-anim .public-page .pp-list-item,
html.js-anim .public-page .pp-tl-item {
  opacity: 0; transform: translateX(-8px);
  transition: opacity .55s ease-out, transform .55s ease-out;
}
html.js-anim .public-page .pp-list-item.is-in,
html.js-anim .public-page .pp-tl-item.is-in { opacity: 1; transform: none; }

/* Hover micro */
.public-page .pp-card.hover-lift,
.public-page .pp-tile,
.public-page .pp-kpi {
  transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s cubic-bezier(.2,.8,.2,1), border-color .35s ease;
}

/* Mobile responsiveness */
@media (max-width: 980px) {
  /* Drop the 56vh hero floor and vertical centering on mobile/tablet so
     short hero blocks (e.g. weather) don't leave a huge empty band under nav. */
  .public-page .pp-hero {
    min-height: 0;
    padding-top: clamp(28px, 6vw, 48px);
    padding-bottom: clamp(32px, 7vw, 56px);
  }
  .public-page .pp-hero-inner { grid-template-columns: 1fr; gap: 28px; align-items: start; }
  .public-page .pp-hero-visual { max-width: 480px; margin: 0 auto; }
  .public-page .pp-two-col { grid-template-columns: 1fr; }
  .public-page .pp-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .public-page .pp-grid-3 { grid-template-columns: repeat(2, 1fr); }
  .public-page .pp-insight-grid { grid-template-columns: 1fr; }
  .public-page .pp-kpi-strip { grid-template-columns: repeat(2, 1fr); }
  .public-page .pp-pipeline { gap: 6px; }
  .public-page .pp-pipe-arrow { display: none; }
}
@media (max-width: 640px) {
  .public-page .pp-grid-4,
  .public-page .pp-grid-3,
  .public-page .pp-grid-2 { grid-template-columns: 1fr; }
  .public-page .pp-hero h1 { font-size: clamp(1.7rem, 7vw, 2.2rem); }
  .public-page .pp-section { padding: clamp(40px, 9vw, 64px) 5vw; }
  .public-page .pp-cta { padding: 28px 20px; flex-direction: column; align-items: stretch; text-align: center; }
  .public-page .pp-cta-actions { flex-direction: column; }
  .public-page .pp-cta-actions .pp-btn { width: 100%; }
  .public-page .pp-hourly { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 64px; }
  .public-page .pp-weather-now { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .public-page .pp-kpi-strip { grid-template-columns: 1fr; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html.js-anim .public-page [data-reveal],
  html.js-anim .public-page .pp-list-item,
  html.js-anim .public-page .pp-tl-item {
    opacity: 1 !important; transform: none !important; transition: none !important;
  }
}

/* ============================================================
   Phase 6 — Modular Dashboard Control Center
   Scoped under body[data-page="dashboard"] so it never leaks to public.
   ============================================================ */
body[data-page="dashboard"] {
  --cc-agri:   #2d7a4f;
  --cc-irrig:  #1f6feb;
  --cc-weather:#0ea5e9;
  --cc-live:   #a855f7;
}
body[data-page="dashboard"] .cc-wrap { padding: 32px 5% 24px; max-width: 1320px; margin: 0 auto; }

/* ----- Module selector ----- */
body[data-page="dashboard"] .cc-modules{
  display:flex; gap:14px; padding:6px; margin: 18px 0 26px;
  background: linear-gradient(180deg,#fff,#fafbfc);
  border:1px solid #eef0f2; border-radius:18px;
  box-shadow: 0 6px 24px -16px rgba(15,23,42,.18);
  overflow-x:auto; scroll-snap-type:x mandatory; -webkit-overflow-scrolling:touch;
}
body[data-page="dashboard"] .cc-modules::-webkit-scrollbar{ display:none; }
body[data-page="dashboard"] .cc-mod{
  flex: 1 1 0; min-width: 160px; scroll-snap-align:start;
  display:flex; align-items:center; justify-content:center; gap:10px;
  padding:14px 18px; border:0; cursor:pointer; border-radius:14px;
  background: transparent; color:#475569; font-weight:600; font-size:.98rem;
  transition: all .25s cubic-bezier(.2,.7,.2,1);
}
body[data-page="dashboard"] .cc-mod-ic{ font-size:1.35rem; line-height:1; }
body[data-page="dashboard"] .cc-mod:hover{ background:#f3f5f7; color:#0f172a; transform:translateY(-1px); }
body[data-page="dashboard"] .cc-mod.is-active{
  background: linear-gradient(135deg, var(--cc-c, #2d7a4f), color-mix(in srgb, var(--cc-c,#2d7a4f) 70%, #ffffff));
  color:#fff; box-shadow: 0 12px 24px -12px color-mix(in srgb, var(--cc-c,#2d7a4f) 60%, transparent);
}
body[data-page="dashboard"] .cc-mod[data-mod="agri"].is-active   { --cc-c: var(--cc-agri); }
body[data-page="dashboard"] .cc-mod[data-mod="irrig"].is-active  { --cc-c: var(--cc-irrig); }
body[data-page="dashboard"] .cc-mod[data-mod="weather"].is-active{ --cc-c: var(--cc-weather); }
body[data-page="dashboard"] .cc-mod[data-mod="live"].is-active   { --cc-c: var(--cc-live); }

/* ----- Module container ----- */
body[data-page="dashboard"] .cc-module{ display:none; animation: ccFade .35s ease both; }
body[data-page="dashboard"] .cc-module.is-active{ display:block; }
@keyframes ccFade{ from{opacity:0; transform:translateY(8px);} to{opacity:1; transform:none;} }

body[data-page="dashboard"] .cc-module[data-accent="agri"]   { --cc-c: var(--cc-agri); }
body[data-page="dashboard"] .cc-module[data-accent="irrig"]  { --cc-c: var(--cc-irrig); }
body[data-page="dashboard"] .cc-module[data-accent="weather"]{ --cc-c: var(--cc-weather); }
body[data-page="dashboard"] .cc-module[data-accent="live"]   { --cc-c: var(--cc-live); }

body[data-page="dashboard"] .cc-module-head{
  display:flex; align-items:center; gap:14px; flex-wrap:wrap;
  padding:18px 22px; margin-bottom:14px;
  background:#fff; border-radius:18px; border:1px solid #eef0f2;
  box-shadow: 0 4px 18px -14px rgba(15,23,42,.18);
}
body[data-page="dashboard"] .cc-module-title{
  font-size:1.1rem; font-weight:700; color:#0f172a; display:flex; align-items:center; gap:10px;
}
body[data-page="dashboard"] .cc-mod-dot{
  width:10px; height:10px; border-radius:50%; background: var(--cc-c, #2d7a4f);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--cc-c,#2d7a4f) 25%, transparent);
}
body[data-page="dashboard"] .cc-module-sub{ color:#64748b; font-size:.92rem; flex:1 1 240px; }

/* ----- Sub-tabs ----- */
body[data-page="dashboard"] .cc-tabs{
  display:flex; gap:6px; padding:6px; background:#fff;
  border:1px solid #eef0f2; border-radius:14px; margin-bottom:18px;
  overflow-x:auto; scroll-snap-type:x mandatory; -webkit-overflow-scrolling:touch;
}
body[data-page="dashboard"] .cc-tabs::-webkit-scrollbar{ display:none; }
body[data-page="dashboard"] .cc-tab{
  flex: 0 0 auto; scroll-snap-align:start; min-height:44px;
  padding:10px 16px; border:0; background:transparent; color:#475569;
  font-weight:600; font-size:.92rem; border-radius:10px; cursor:pointer;
  transition: all .2s ease; white-space:nowrap;
}
body[data-page="dashboard"] .cc-tab:hover{ background:#f3f5f7; color:#0f172a; }
body[data-page="dashboard"] .cc-tab.is-active{
  background: color-mix(in srgb, var(--cc-c,#2d7a4f) 12%, #ffffff);
  color: var(--cc-c, #2d7a4f);
  box-shadow: inset 0 -2px 0 var(--cc-c, #2d7a4f);
}

/* ----- Panes ----- */
body[data-page="dashboard"] .cc-pane{ display:none; animation: ccFade .3s ease both; }
body[data-page="dashboard"] .cc-pane.is-active{ display:block; }

/* Generic cards / lists / grids inside panes */
body[data-page="dashboard"] .cc-grid-2{ display:grid; grid-template-columns:1fr 1fr; gap:18px; }
body[data-page="dashboard"] .cc-grid-3{ display:grid; grid-template-columns:repeat(3,1fr); gap:18px; }
body[data-page="dashboard"] .cc-card{
  background:#fff; border:1px solid #eef0f2; border-radius:20px;
  padding:24px; box-shadow: 0 6px 22px -16px rgba(15,23,42,.18);
}
body[data-page="dashboard"] .cc-card h3{ margin:6px 0 6px; color:#0f172a; }
body[data-page="dashboard"] .cc-card p { color:#64748b; font-size:.92rem; }
body[data-page="dashboard"] .cc-card-icon{ font-size:1.6rem; }
body[data-page="dashboard"] .cc-mini-list{ list-style:none; padding:0; margin:14px 0 0; }
body[data-page="dashboard"] .cc-mini-list li{
  padding:10px 12px; border-radius:10px; background:#f8fafc;
  margin-bottom:8px; font-size:.9rem; color:#334155;
}
body[data-page="dashboard"] .cc-list{ display:flex; flex-direction:column; gap:10px; margin-top:12px; }
body[data-page="dashboard"] .cc-list-item{
  display:flex; align-items:center; gap:12px; padding:12px 14px;
  background:#f8fafc; border-radius:12px; border-left:3px solid var(--cc-c,#a855f7);
}
body[data-page="dashboard"] .cc-list-item .ic{ font-size:1.3rem; }
body[data-page="dashboard"] .cc-list-item .tt{ font-weight:600; color:#0f172a; font-size:.92rem; }
body[data-page="dashboard"] .cc-list-item .ds{ color:#64748b; font-size:.85rem; }
body[data-page="dashboard"] .cc-list-item .tm{ margin-left:auto; color:#94a3b8; font-size:.78rem; white-space:nowrap; }
body[data-page="dashboard"] .cc-list-item.is-crit{ border-left-color:#dc2626; background: #fef2f2; }
body[data-page="dashboard"] .cc-list-item.is-warn{ border-left-color:#f59e0b; background: #fffbeb; }

body[data-page="dashboard"] .cc-btn{
  display:inline-block; padding:10px 16px; border-radius:10px; font-weight:600;
  text-decoration:none; transition: all .2s ease; margin-top:10px;
}
body[data-page="dashboard"] .cc-btn-primary{
  background: var(--cc-c, #2d7a4f); color:#fff;
}
body[data-page="dashboard"] .cc-btn-primary:hover{ filter: brightness(1.08); transform: translateY(-1px); }

/* KPI strip inside livestock barns tab */
body[data-page="dashboard"] .cc-kpi-strip{
  display:grid; grid-template-columns:repeat(4,1fr); gap:14px; margin-bottom:18px;
}
body[data-page="dashboard"] .cc-kpi{
  background:#fff; border:1px solid #eef0f2; border-radius:16px; padding:16px;
  text-align:center; box-shadow: 0 4px 14px -10px rgba(15,23,42,.18);
  transition: transform .2s ease;
}
body[data-page="dashboard"] .cc-kpi:hover{ transform: translateY(-2px); }
body[data-page="dashboard"] .cc-kpi-ic{ font-size:1.5rem; }
body[data-page="dashboard"] .cc-kpi-val{ font-size:1.7rem; font-weight:700; color:#0f172a; font-variant-numeric: tabular-nums; }
body[data-page="dashboard"] .cc-kpi-lbl{ color:#64748b; font-size:.82rem; margin-top:4px; }

/* Livestock barn cards */
body[data-page="dashboard"] .dash-barn{
  background:#fff; border:1px solid #eef0f2; border-radius:18px; padding:18px;
  box-shadow: 0 6px 22px -16px rgba(15,23,42,.18); transition: all .25s ease;
}
body[data-page="dashboard"] .dash-barn:hover{ transform: translateY(-3px); box-shadow: 0 14px 28px -16px rgba(168,85,247,.25); }
body[data-page="dashboard"] .dash-barn.is-alert{ border-color:#fca5a5; box-shadow: 0 0 0 3px rgba(252,165,165,.18); }
body[data-page="dashboard"] .dash-barn .b-head{ display:flex; align-items:center; gap:10px; }
body[data-page="dashboard"] .dash-barn .b-emoji{ font-size:2rem; }
body[data-page="dashboard"] .dash-barn .b-name{ font-weight:700; color:#0f172a; }
body[data-page="dashboard"] .dash-barn .b-count{ color:#64748b; font-size:.82rem; }
body[data-page="dashboard"] .dash-barn .b-stats{ display:grid; grid-template-columns:repeat(2,1fr); gap:8px; margin-top:12px; }
body[data-page="dashboard"] .dash-barn .b-stat{ background:#f8fafc; border-radius:10px; padding:8px 10px; }
body[data-page="dashboard"] .dash-barn .b-stat .lb{ color:#64748b; font-size:.74rem; }
body[data-page="dashboard"] .dash-barn .b-stat .vl{ color:#0f172a; font-weight:700; font-size:1rem; font-variant-numeric: tabular-nums; }
body[data-page="dashboard"] .dash-barn .b-last{ margin-top:12px; padding:10px; background:#f3f5f7; border-radius:10px; font-size:.82rem; color:#475569; }

/* Weather impact / history mini blocks */
body[data-page="dashboard"] .cc-weather-impact, body[data-page="dashboard"] .cc-irrig-summary{
  display:grid; grid-template-columns:repeat(auto-fit, minmax(200px,1fr)); gap:12px; margin-top:14px;
}
body[data-page="dashboard"] .cc-impact-item{
  padding:12px 14px; background:#f8fafc; border-radius:12px; border-left:3px solid var(--cc-weather);
}
body[data-page="dashboard"] .cc-impact-item .lb{ color:#64748b; font-size:.78rem; }
body[data-page="dashboard"] .cc-impact-item .vl{ color:#0f172a; font-weight:600; font-size:.92rem; margin-top:2px; }
body[data-page="dashboard"] .cc-weather-hist{
  display:grid; grid-template-columns:repeat(auto-fit, minmax(120px,1fr)); gap:10px; margin-top:12px;
}
body[data-page="dashboard"] .cc-weather-hist .h-cell{
  padding:10px; background:#f8fafc; border-radius:10px; text-align:center; font-size:.82rem;
}

/* Hide the old anchor sections we removed (defensive) */
body[data-page="dashboard"] #weather:not(.cc-pane):not(.cc-card):not(.cc-wrap),
body[data-page="dashboard"] #zones:not(.cc-pane):not(.cc-wrap),
body[data-page="dashboard"] #irrigation:not(.cc-pane):not(.cc-wrap),
body[data-page="dashboard"] #activity:not(.cc-pane):not(.cc-wrap),
body[data-page="dashboard"] #history:not(.cc-pane):not(.cc-wrap),
body[data-page="dashboard"] #recommendations:not(.cc-pane):not(.cc-wrap),
body[data-page="dashboard"] #notifications:not(.cc-pane):not(.cc-wrap){ display:none; }

/* Responsive */
@media (max-width: 1100px){
  body[data-page="dashboard"] .cc-grid-3{ grid-template-columns: repeat(2,1fr); }
  body[data-page="dashboard"] .cc-kpi-strip{ grid-template-columns: repeat(4,1fr); }
}
@media (max-width: 820px){
  body[data-page="dashboard"] .cc-grid-2,
  body[data-page="dashboard"] .cc-grid-3{ grid-template-columns: 1fr; }
  body[data-page="dashboard"] .cc-kpi-strip{ grid-template-columns: repeat(2,1fr); }
  body[data-page="dashboard"] .cc-mod{ min-width: 140px; padding: 12px 14px; font-size:.92rem; }
  body[data-page="dashboard"] .cc-mod-lb{ display:none; }
  body[data-page="dashboard"] .cc-mod.is-active .cc-mod-lb{ display:inline; }
}
@media (max-width: 480px){
  body[data-page="dashboard"] .cc-wrap{ padding: 22px 4% 18px; }
  body[data-page="dashboard"] .cc-modules{ gap:8px; padding:4px; }
  body[data-page="dashboard"] .cc-mod{ min-width: 96px; padding: 10px 12px; }
  body[data-page="dashboard"] .cc-mod-lb{ display:none !important; }
  body[data-page="dashboard"] .cc-tabs{ gap:4px; padding:4px; }
  body[data-page="dashboard"] .cc-tab{ padding:9px 12px; font-size:.85rem; }
  body[data-page="dashboard"] .cc-card{ padding:18px; }
}

@media (prefers-reduced-motion: reduce){
  body[data-page="dashboard"] .cc-module,
  body[data-page="dashboard"] .cc-pane{ animation: none !important; }
}

/* ============================================================
   Phase 7 — Final dashboard polish (additive only)
   Scoped under body[data-page="dashboard"].
   ============================================================ */

/* Subtle accent border on active module title row */
body[data-page="dashboard"] .cc-module.is-active .cc-module-head{
  border-left: 4px solid var(--cc-c, #2d7a4f);
}

/* Active tab: stronger underline + lift */
body[data-page="dashboard"] .cc-tab.is-active{
  transform: translateY(-1px);
}
body[data-page="dashboard"] .cc-tab:focus-visible,
body[data-page="dashboard"] .cc-mod:focus-visible{
  outline: 2px solid var(--cc-c, #2d7a4f);
  outline-offset: 2px;
}

/* Module pill icon scale on hover */
body[data-page="dashboard"] .cc-mod:hover .cc-mod-ic{ transform: scale(1.08); }
body[data-page="dashboard"] .cc-mod-ic{ transition: transform .25s ease; }
body[data-page="dashboard"] .cc-mod.is-active .cc-mod-ic{ transform: scale(1.05); }

/* Pane min-height to avoid layout jumps when switching tabs */
body[data-page="dashboard"] .cc-pane{ min-height: 220px; }

/* Improve cc-card hover */
body[data-page="dashboard"] .cc-card{ transition: transform .25s ease, box-shadow .25s ease; }
body[data-page="dashboard"] .cc-card:hover{
  transform: translateY(-2px);
  box-shadow: 0 16px 32px -20px rgba(15,23,42,.22);
}

/* cc-mini-list: subtle hover + accent dot */
body[data-page="dashboard"] .cc-mini-list li{
  transition: background .2s ease, transform .2s ease;
  border-left: 3px solid transparent;
}
body[data-page="dashboard"] .cc-mini-list li:hover{
  background:#eef2f7; transform: translateX(2px);
  border-left-color: var(--cc-c, #2d7a4f);
}

/* List items reveal on render */
body[data-page="dashboard"] .cc-pane.is-active .cc-list-item,
body[data-page="dashboard"] .cc-pane.is-active .cc-card,
body[data-page="dashboard"] .cc-pane.is-active .dash-barn{
  animation: ccItemIn .35s ease both;
}
body[data-page="dashboard"] .cc-pane.is-active .cc-list-item:nth-child(2){ animation-delay:.04s; }
body[data-page="dashboard"] .cc-pane.is-active .cc-list-item:nth-child(3){ animation-delay:.08s; }
body[data-page="dashboard"] .cc-pane.is-active .cc-list-item:nth-child(4){ animation-delay:.12s; }
body[data-page="dashboard"] .cc-pane.is-active .cc-list-item:nth-child(5){ animation-delay:.16s; }
@keyframes ccItemIn{
  from{ opacity:0; transform: translateY(6px); }
  to{ opacity:1; transform: none; }
}

/* Scroll fade hints on horizontal rows */
body[data-page="dashboard"] .cc-modules,
body[data-page="dashboard"] .cc-tabs{
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
}

/* CC button secondary variant */
body[data-page="dashboard"] .cc-btn-ghost{
  background: transparent; color: var(--cc-c, #2d7a4f);
  border: 1px solid color-mix(in srgb, var(--cc-c,#2d7a4f) 30%, #e2e8f0);
}
body[data-page="dashboard"] .cc-btn-ghost:hover{
  background: color-mix(in srgb, var(--cc-c,#2d7a4f) 8%, #ffffff);
}

/* Empty pane fallback (used by JS when content is empty) */
body[data-page="dashboard"] .cc-empty{
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  text-align:center; padding: 36px 18px;
  background: linear-gradient(180deg,#fff,#fafbfc);
  border: 1px dashed #e2e8f0; border-radius: 18px;
  color:#64748b;
}
body[data-page="dashboard"] .cc-empty .ic{ font-size: 2rem; margin-bottom: 8px; }
body[data-page="dashboard"] .cc-empty .tt{ font-weight: 700; color:#0f172a; margin-bottom: 4px; }
body[data-page="dashboard"] .cc-empty .ds{ font-size: .9rem; max-width: 420px; }

/* Mobile fine-tuning */
@media (max-width: 640px){
  body[data-page="dashboard"] .cc-module-head{ padding: 14px 16px; }
  body[data-page="dashboard"] .cc-module-title{ font-size: 1rem; }
  body[data-page="dashboard"] .cc-module-sub{ font-size: .85rem; }
  body[data-page="dashboard"] .cc-kpi-val{ font-size: 1.4rem; }
  body[data-page="dashboard"] .cc-kpi-ic{ font-size: 1.2rem; }
}
@media (max-width: 420px){
  body[data-page="dashboard"] .cc-modules{ gap:6px; }
  body[data-page="dashboard"] .cc-mod{ min-width: 84px; padding: 9px 10px; gap: 6px; }
  body[data-page="dashboard"] .cc-mod-ic{ font-size: 1.2rem; }
  body[data-page="dashboard"] .cc-kpi-strip{ gap: 8px; }
  body[data-page="dashboard"] .cc-kpi{ padding: 12px 8px; }
}

@media (prefers-reduced-motion: reduce){
  body[data-page="dashboard"] .cc-pane.is-active .cc-list-item,
  body[data-page="dashboard"] .cc-pane.is-active .cc-card,
  body[data-page="dashboard"] .cc-pane.is-active .dash-barn{ animation: none !important; }
  body[data-page="dashboard"] .cc-mod-ic,
  body[data-page="dashboard"] .cc-card,
  body[data-page="dashboard"] .cc-mini-list li{ transition: none !important; }
}

/* =====================================================================
   PHASE 8 — FINAL POLISH (append-only)
   - Full-fold homepage hero
   - Stronger reveal animations (blur + translate)
   - Card hover shine + glow
   - Button shimmer + glow
   - Weather hourly forecast overflow fix
   - Floating cards
   ===================================================================== */

/* ---------- 1. FULL-FOLD HOMEPAGE HERO ---------- */
.hero.is-fullfold {
  display: block;
  padding: 0;
  max-width: none;
  min-height: 100vh;
  min-height: 100svh;
  position: relative;
  overflow: hidden;
}
.hero.is-fullfold::before {
  background:
    radial-gradient(140% 100% at 70% 30%, #e8f6ec 0%, #eaf2fb 45%, #fdf2f5 100%);
  inset: 0;
}
.hero.is-fullfold .hero-bg {
  position: absolute; inset: 0;
}
.hero.is-fullfold .blob {
  filter: blur(120px); opacity: .35;
}
.hero.is-fullfold .blob-1 { width: 720px; height: 720px; top: -200px; right: -160px; }
.hero.is-fullfold .blob-2 { width: 580px; height: 580px; bottom: -180px; left: 18%; opacity: .28; }
.hero.is-fullfold .blob-3 { width: 460px; height: 460px; top: 22%; left: -180px; opacity: .25; }

.hero.is-fullfold .hero-grid-overlay {
  background-size: 64px 64px;
  mask-image: radial-gradient(90% 70% at 50% 45%, #000 25%, transparent 80%);
  -webkit-mask-image: radial-gradient(90% 70% at 50% 45%, #000 25%, transparent 80%);
  opacity: .42;
  animation: gridDrift 30s linear infinite;
}
@keyframes gridDrift {
  from { transform: translate(0,0); }
  to   { transform: translate(64px, 64px); }
}

.hero-aurora {
  position: absolute; inset: -10% -5% auto -5%; height: 70%;
  background:
    radial-gradient(40% 60% at 25% 40%, rgba(76,175,120,.30), transparent 70%),
    radial-gradient(45% 55% at 75% 30%, rgba(78,160,224,.25), transparent 70%),
    radial-gradient(35% 50% at 55% 60%, rgba(244,170,180,.22), transparent 70%);
  filter: blur(40px);
  animation: auroraDrift 18s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 0;
}
@keyframes auroraDrift {
  0%   { transform: translate(0,0) scale(1); }
  100% { transform: translate(20px,-15px) scale(1.06); }
}

.hero-noise {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(rgba(31,42,36,.045) 1px, transparent 1px);
  background-size: 3px 3px;
  opacity: .35;
  mix-blend-mode: multiply;
}

.hero.is-fullfold .hero-fold-inner {
  position: relative; z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(40px, 5vw, 88px);
  align-items: center;
  max-width: 1440px;
  margin: 0 auto;
  padding: clamp(96px, 12vh, 140px) clamp(28px, 6vw, 84px) clamp(80px, 10vh, 120px);
  min-height: 100vh;
  min-height: 100svh;
}

/* Reduced typography (smaller, more balanced) */
.hero.is-fullfold .hero-content {
  max-width: 600px;
  justify-self: end;
  margin-left: auto;
}
.hero.is-fullfold .hero-content h1 {
  font-size: clamp(2.2rem, 4.2vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.5px;
  margin-bottom: 18px;
}
.hero.is-fullfold .hero-content p {
  font-size: clamp(1rem, 1.15vw, 1.08rem);
  line-height: 1.65;
  max-width: 520px;
  margin-bottom: 30px;
  color: var(--text-mid);
}
.hero.is-fullfold .hero-badge {
  margin-bottom: 22px;
  font-size: .82rem;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Visual column — bigger, glowing */
.hero.is-fullfold .hero-visual {
  max-width: 580px;
  padding: 26px;
  border-radius: 36px;
  background: linear-gradient(160deg, rgba(255,255,255,.72), rgba(255,255,255,.30));
  border: 1px solid rgba(255,255,255,.65);
  box-shadow:
    0 50px 110px -50px rgba(31,80,55,.45),
    0 0 0 1px rgba(76,175,120,.10),
    inset 0 1px 0 rgba(255,255,255,.6);
}
.hero.is-fullfold .hero-visual::before {
  inset: -80px -60px;
  opacity: .75;
}

/* Scroll cue at bottom of hero */
.hero-scroll-cue {
  position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
  width: 26px; height: 42px; border: 2px solid rgba(45,122,79,.45);
  border-radius: 14px; z-index: 3;
  display: flex; justify-content: center; padding-top: 6px;
  text-decoration: none; transition: opacity .3s, border-color .3s;
}
.hero-scroll-cue:hover { border-color: var(--green); }
.hero-scroll-cue span {
  display: block; width: 4px; height: 8px; border-radius: 2px;
  background: var(--green);
  animation: scrollCue 1.6s ease-in-out infinite;
}
@keyframes scrollCue {
  0% { transform: translateY(0); opacity: 0; }
  35% { opacity: 1; }
  70% { transform: translateY(14px); opacity: 0; }
  100% { transform: translateY(14px); opacity: 0; }
}

/* ---------- 2. PREMIUM REVEAL (stronger, blur+lift) ---------- */
html.js-anim [data-reveal]:not(.is-in) {
  opacity: 0;
  transform: translateY(28px);
  filter: blur(6px);
}
html.js-anim [data-reveal].is-in {
  opacity: 1;
  transform: none;
  filter: blur(0);
  transition:
    opacity .85s cubic-bezier(.2,.8,.2,1),
    transform .85s cubic-bezier(.2,.8,.2,1),
    filter .65s ease-out;
}

/* Hero entrance stagger override */
html.js-anim .hero.is-fullfold [data-reveal] {
  transition-delay: calc(var(--hero-i, 0) * 110ms);
}

/* ---------- 3. FLOATING HERO CARDS (stronger float) ---------- */
.hero.is-fullfold [data-float] {
  animation: cardFloat var(--float-dur, 7s) ease-in-out infinite;
  animation-delay: var(--float-delay, 0s);
}
.hero.is-fullfold [data-float]:nth-child(2) { --float-dur: 8s;  --float-delay: -1.8s; }
.hero.is-fullfold [data-float]:nth-child(3) { --float-dur: 9s;  --float-delay: -3.6s; }
.hero.is-fullfold [data-float]:nth-child(4) { --float-dur: 7.5s;--float-delay: -2.2s; }

@keyframes cardFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-12px) rotate(-0.4deg); }
}

/* ---------- 4. CARD SHINE + GLOW (premium hover) ---------- */
.preview-card,
.feature-card,
.dt-tile,
.journey-step {
  position: relative;
  overflow: hidden;
  transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s ease, border-color .35s ease;
}
.preview-card::before,
.feature-card::before {
  content: ""; position: absolute; top: 0; left: -75%;
  width: 50%; height: 100%;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.55) 50%, transparent 70%);
  transform: skewX(-18deg);
  transition: left .9s cubic-bezier(.2,.8,.2,1);
  pointer-events: none;
  z-index: 1;
}
.preview-card:hover::before,
.feature-card:hover::before { left: 130%; }
.preview-card:hover,
.feature-card:hover {
  transform: translateY(-6px);
  box-shadow:
    0 24px 50px -22px rgba(45,122,79,.30),
    0 0 0 1px rgba(76,175,120,.20);
  border-color: rgba(76,175,120,.35);
}
.preview-card > *,
.feature-card > * { position: relative; z-index: 2; }

/* Public-page cards: shine + glow */
.public-page .pp-card,
.public-page .pp-tile,
.public-page .pp-list-card,
.public-page .pp-insight,
.public-page .pp-kpi {
  position: relative;
  overflow: hidden;
}
.public-page .pp-card::before,
.public-page .pp-tile::before,
.public-page .pp-kpi::before,
.public-page .pp-insight::before {
  content: ""; position: absolute; top: 0; left: -75%;
  width: 45%; height: 100%;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.5) 50%, transparent 70%);
  transform: skewX(-18deg);
  transition: left .9s cubic-bezier(.2,.8,.2,1);
  pointer-events: none; z-index: 1;
}
.public-page .pp-card:hover::before,
.public-page .pp-tile:hover::before,
.public-page .pp-kpi:hover::before,
.public-page .pp-insight:hover::before { left: 130%; }
.public-page .pp-card > *,
.public-page .pp-tile > *,
.public-page .pp-kpi > *,
.public-page .pp-insight > * { position: relative; z-index: 2; }

.public-page .pp-card.hover-lift:hover,
.public-page .pp-tile:hover,
.public-page .pp-kpi:hover {
  box-shadow:
    0 26px 60px -28px color-mix(in srgb, var(--accent) 45%, rgba(26,35,50,.20)),
    0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent);
}
.public-page .pp-card-icon,
.public-page .pp-tile-emoji,
.public-page .pp-kpi-icon {
  transition: transform .35s cubic-bezier(.2,.8,.2,1);
}
.public-page .pp-card:hover .pp-card-icon,
.public-page .pp-tile:hover .pp-tile-emoji,
.public-page .pp-kpi:hover .pp-kpi-icon {
  transform: scale(1.12) rotate(-4deg);
}

/* ---------- 5. SHINY GLOWING BUTTONS ---------- */
.btn-shine,
.public-page .pp-btn-primary {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.btn-shine::after,
.public-page .pp-btn-primary::after {
  content: ""; position: absolute; top: 0; left: -120%;
  width: 60%; height: 100%;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.55) 50%, transparent 70%);
  transform: skewX(-20deg);
  transition: left .8s cubic-bezier(.2,.8,.2,1);
  pointer-events: none;
}
.btn-shine:hover::after,
.public-page .pp-btn-primary:hover::after { left: 140%; }

.btn-hero-main.btn-shine,
.btn-cta.btn-shine {
  background: linear-gradient(135deg, var(--green), #4caf78);
  box-shadow:
    0 10px 32px -10px rgba(45,122,79,.55),
    0 0 0 0 rgba(76,175,120,.0);
  transition: transform .25s, box-shadow .35s;
}
.btn-hero-main.btn-shine:hover,
.btn-cta.btn-shine:hover {
  transform: translateY(-3px);
  box-shadow:
    0 18px 42px -12px rgba(45,122,79,.65),
    0 0 0 6px rgba(76,175,120,.18);
}
.btn-hero-main.btn-shine:active,
.btn-cta.btn-shine:active { transform: translateY(0) scale(.98); }

.bhm-arrow {
  display: inline-block;
  margin-left: 4px;
  transition: transform .25s cubic-bezier(.2,.8,.2,1);
}
.btn-shine:hover .bhm-arrow { transform: translateX(5px); }

.public-page .pp-btn-primary {
  box-shadow:
    var(--accent-shadow),
    0 0 0 0 color-mix(in srgb, var(--accent) 40%, transparent);
  transition: transform .25s, box-shadow .35s;
}
.public-page .pp-btn-primary:hover {
  transform: translateY(-3px);
  box-shadow:
    var(--accent-shadow),
    0 0 0 6px color-mix(in srgb, var(--accent) 18%, transparent);
}
.public-page .pp-btn-ghost {
  transition: transform .25s, background .25s, border-color .25s, box-shadow .25s;
}
.public-page .pp-btn-ghost:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px -10px color-mix(in srgb, var(--accent) 35%, transparent);
}

/* ---------- 6. WEATHER HOURLY FORECAST FIX (overflow contained) ---------- */
.public-page .pp-weather-now {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 28px;
  align-items: stretch;
}
.public-page .pp-weather-now > * { min-width: 0; }

.public-page .pp-hourly {
  display: flex !important;
  flex-wrap: nowrap;
  grid-template-columns: none !important;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--accent) 40%, transparent) transparent;
  padding: 4px 2px 10px;
  max-width: 100%;
  width: 100%;
}
.public-page .pp-hourly::-webkit-scrollbar { height: 6px; }
.public-page .pp-hourly::-webkit-scrollbar-track { background: transparent; }
.public-page .pp-hourly::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: 999px;
}
.public-page .pp-hour {
  flex: 0 0 auto;
  min-width: 76px;
  scroll-snap-align: start;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 8px;
  text-align: center;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.public-page .pp-hour:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
  box-shadow: 0 12px 26px -16px color-mix(in srgb, var(--accent) 50%, rgba(0,0,0,.2));
}

@media (max-width: 980px) {
  .public-page .pp-weather-now {
    grid-template-columns: 1fr;
  }
}

/* ---------- 7. RESPONSIVE — full-fold hero ---------- */
@media (max-width: 980px) {
  .hero.is-fullfold .hero-fold-inner {
    grid-template-columns: 1fr;
    padding: 96px 24px 80px;
    gap: 36px;
    text-align: center;
  }
  .hero.is-fullfold .hero-content {
    justify-self: center;
    margin: 0 auto;
  }
  .hero.is-fullfold .hero-content p { margin-left: auto; margin-right: auto; }
  .hero.is-fullfold .hero-cta { justify-content: center; }
  .hero.is-fullfold .hero-trust { justify-content: center; }
  .hero.is-fullfold .hero-visual {
    max-width: 480px; margin: 0 auto;
  }
  .hero-scroll-cue { display: none; }
}

/* Fix 1 — breathing room around 1024px */
@media (max-width: 1200px) and (min-width: 981px) {
  .hero.is-fullfold .hero-fold-inner {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: clamp(28px, 3.5vw, 56px);
    padding: clamp(80px, 10vh, 120px) clamp(24px, 4vw, 56px) clamp(64px, 8vh, 96px);
  }
  .hero.is-fullfold .hero-content { max-width: 540px; }
  .hero.is-fullfold .hero-content h1 { font-size: clamp(2rem, 3.6vw, 2.9rem); }
  .hero.is-fullfold .hero-visual { max-width: 500px; padding: 22px; }
  .hero.is-fullfold .hero-card { min-width: 240px; padding: 16px 18px; }
}

@media (max-width: 600px) {
  .hero.is-fullfold .hero-fold-inner {
    padding: 84px 18px 60px;
    /* Fix 4 — never clip mobile hero content */
    min-height: 88svh;
    height: auto;
  }
  .hero.is-fullfold {
    min-height: 88svh;
    height: auto;
  }
  .hero.is-fullfold .hero-content h1 {
    font-size: clamp(1.7rem, 6.5vw, 2.2rem);
    /* Fix 3 — reserve vertical space so typed phrase swaps don't reflow */
    min-height: 2.4em;
  }
  .hero.is-fullfold .hero-visual {
    padding: 18px;
    border-radius: 24px;
    /* Fix 5 — fade edge as swipe affordance */
    -webkit-mask-image: linear-gradient(90deg, #000 0, #000 88%, transparent 100%);
            mask-image: linear-gradient(90deg, #000 0, #000 88%, transparent 100%);
    position: relative;
  }
  .hero.is-fullfold .hero-visual::after {
    content: '→';
    position: absolute;
    right: 10px; top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
    color: var(--green);
    background: rgba(255,255,255,.92);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 6px 14px -6px rgba(31,42,36,.25);
    animation: heroSwipeHint 1.8s ease-in-out infinite;
    pointer-events: none;
    z-index: 3;
  }
  @keyframes heroSwipeHint {
    0%, 100% { transform: translateY(-50%) translateX(0); opacity: .85; }
    50%      { transform: translateY(-50%) translateX(6px); opacity: 1; }
  }

  /* Fix 2 — strengthen mobile typing rule (override base inline-grid + nowrap) */
  .hero.is-fullfold h1 .type-em {
    display: inline !important;
  }
  .hero.is-fullfold h1 .type-em .type-static {
    position: absolute !important;
    width: 1px !important; height: 1px !important;
    overflow: hidden !important;
    clip-path: inset(50%) !important;
    white-space: normal !important;
  }
  .hero.is-fullfold h1 .type-em .type-anim {
    display: inline !important;
    white-space: normal !important;
  }
  .hero.is-fullfold h1 .type-em .type-text {
    white-space: normal !important;
    word-break: break-word;
  }
}


/* ---------- 8. REDUCED MOTION GUARDS ---------- */
@media (prefers-reduced-motion: reduce) {
  .hero.is-fullfold [data-float],
  .hero-aurora,
  .hero-grid-overlay,
  .hero-scroll-cue span {
    animation: none !important;
  }
  html.js-anim [data-reveal]:not(.is-in),
  html.js-anim [data-reveal].is-in {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
  }
  .preview-card::before, .feature-card::before,
  .public-page .pp-card::before, .public-page .pp-tile::before,
  .public-page .pp-kpi::before, .public-page .pp-insight::before,
  .btn-shine::after, .public-page .pp-btn-primary::after { display: none !important; }
}

/* ============================================================
   PUBLIC LIVE — animations for live AI simulation (Phase live)
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
  @keyframes agriDigitPulse {
    0%   { transform: scale(1);    color: inherit; }
    40%  { transform: scale(1.08); color: var(--brand-2, #4caf78); }
    100% { transform: scale(1);    color: inherit; }
  }
  .is-updating { display: inline-block; animation: agriDigitPulse .6s ease-out; }

  @keyframes agriCardFlash {
    0%   { box-shadow: 0 0 0 0 rgba(76,175,120,.0), inset 0 0 0 0 rgba(76,175,120,.0); }
    30%  { box-shadow: 0 0 22px 2px rgba(76,175,120,.35), inset 0 0 0 1px rgba(76,175,120,.55); }
    100% { box-shadow: 0 0 0 0 rgba(76,175,120,.0), inset 0 0 0 0 rgba(76,175,120,.0); }
  }
  .card-flash { animation: agriCardFlash .9s ease-out; }

  @keyframes agriAlertEnter {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .alert-enter { animation: agriAlertEnter .35s ease-out; }

  @keyframes agriEventEnter {
    from { opacity: 0; transform: translateX(-12px); }
    to   { opacity: 1; transform: translateX(0); }
  }
  .event-enter { animation: agriEventEnter .4s ease-out; }

  @keyframes agriRecoGlow {
    0%   { box-shadow: 0 0 0 0 rgba(78,160,224,.0); }
    30%  { box-shadow: 0 0 18px 3px rgba(78,160,224,.35); }
    100% { box-shadow: 0 0 0 0 rgba(78,160,224,.0); }
  }
  .reco-glow { animation: agriRecoGlow 1.2s ease-out; }
}

/* =========================================================================
   FX ENGINE — page-level animations for public pages (public-fx.js)
   Namespaced under .fx-* / data-fx-* so it doesn't clash with existing rules.
   ========================================================================= */

/* ---- Background layers ---- */
.fx-bg{position:fixed;inset:0;z-index:0;pointer-events:none;overflow:hidden}
.public-page,.hero,section,main,footer{position:relative;z-index:1}
/* Sticky nav must always win — keep visible during scroll on every page. */
nav, .public-page > nav, body > nav { position: sticky !important; top: 0 !important; z-index: 600 !important; }
html.is-scrolled nav { box-shadow: 0 6px 24px -10px rgba(31,42,36,.18); border-bottom-color: rgba(76,175,120,.35); }

.fx-bg-mesh{
  position:absolute;inset:-20%;
  background:
    radial-gradient(60% 50% at 20% 30%, rgba(76,175,120,.18), transparent 60%),
    radial-gradient(50% 45% at 80% 20%, rgba(78,160,224,.16), transparent 60%),
    radial-gradient(55% 50% at 60% 85%, rgba(124,196,240,.14), transparent 60%);
  filter:blur(20px);
  animation:fx-mesh-drift 38s ease-in-out infinite alternate;
}
[data-fx-page="irrigation"] .fx-bg-mesh{
  background:
    radial-gradient(60% 50% at 20% 30%, rgba(78,160,224,.22), transparent 60%),
    radial-gradient(55% 50% at 80% 70%, rgba(124,196,240,.18), transparent 60%),
    radial-gradient(50% 50% at 50% 100%, rgba(45,122,79,.10), transparent 60%);
}
[data-fx-page="weather"] .fx-bg-mesh{
  background:
    radial-gradient(55% 50% at 30% 20%, rgba(124,196,240,.22), transparent 60%),
    radial-gradient(55% 50% at 75% 75%, rgba(255,180,80,.16), transparent 60%);
}
[data-fx-page="livestock"] .fx-bg-mesh{
  background:
    radial-gradient(55% 50% at 25% 30%, rgba(220,160,80,.20), transparent 60%),
    radial-gradient(55% 50% at 80% 70%, rgba(160,120,200,.14), transparent 60%);
}
@keyframes fx-mesh-drift{
  0%  {transform:translate3d(0,0,0) scale(1)}
  50% {transform:translate3d(-2%,1%,0) scale(1.04)}
  100%{transform:translate3d(2%,-1%,0) scale(1.02)}
}

.fx-bg-grid{
  position:absolute;inset:-50%;
  background-image:
    linear-gradient(rgba(45,122,79,.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(45,122,79,.08) 1px, transparent 1px);
  background-size:48px 48px;
  mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, #000 30%, transparent 80%);
  animation:fx-grid-drift 70s linear infinite;
  opacity:.5;
}
@keyframes fx-grid-drift{
  from{transform:translate3d(0,0,0)}
  to  {transform:translate3d(48px,48px,0)}
}

.fx-particles{position:absolute;inset:0;width:100%;height:100%;display:block}

/* Page-themed accents */
.fx-water{position:absolute;left:0;right:0;bottom:0;width:100%;height:140px;opacity:.55}
.fx-wave{fill:none;stroke-width:0}
.fx-wave-1{fill:rgba(78,160,224,.30);animation:fx-water-wave 9s ease-in-out infinite alternate}
.fx-wave-2{fill:rgba(124,196,240,.22);animation:fx-water-wave 13s ease-in-out infinite alternate-reverse}
@keyframes fx-water-wave{
  0%  {transform:translate3d(0,0,0)}
  100%{transform:translate3d(-40px,6px,0)}
}

.fx-strip{position:absolute;top:74px;left:0;right:0;height:40px;overflow:hidden;opacity:.55;mask-image:linear-gradient(90deg,transparent,#000 10%,#000 90%,transparent)}
.fx-strip-track{display:flex;gap:42px;align-items:center;height:100%;font-size:1.4rem;white-space:nowrap;animation:fx-marquee 38s linear infinite;will-change:transform}
.fx-strip-track > span{filter:drop-shadow(0 2px 6px rgba(0,0,0,.12))}
@keyframes fx-marquee{
  from{transform:translate3d(0,0,0)}
  to  {transform:translate3d(-50%,0,0)}
}

.fx-cam-band{
  position:absolute;left:0;right:0;top:0;height:100%;
  background:linear-gradient(180deg, transparent 0%, rgba(220,160,80,.10) 50%, transparent 100%);
  background-size:100% 30%;
  background-repeat:no-repeat;
  animation:fx-cam-sweep 6s ease-in-out infinite;
}
@keyframes fx-cam-sweep{
  0%  {background-position:0 -10%}
  100%{background-position:0 110%}
}

.fx-scan-y{
  position:absolute;left:0;right:0;top:0;height:2px;
  background:linear-gradient(90deg,transparent,rgba(76,175,120,.55),transparent);
  box-shadow:0 0 24px rgba(76,175,120,.5);
  animation:fx-scan-y 4.2s ease-in-out infinite;
}
@keyframes fx-scan-y{
  0%  {transform:translateY(0);opacity:0}
  10% {opacity:1}
  90% {opacity:1}
  100%{transform:translateY(100vh);opacity:0}
}

/* ---- Hero entrance ---- */
.fx-hero .fx-hero-el{
  opacity:0;
  transform:translate3d(0,28px,0);
  filter:blur(6px);
  transition:opacity .9s cubic-bezier(.22,.8,.28,1),
             transform .9s cubic-bezier(.22,.8,.28,1),
             filter .9s ease;
  transition-delay:calc(var(--fx-i,0) * 90ms + 80ms);
  will-change:opacity,transform,filter;
}
.fx-hero.fx-hero-in .fx-hero-el{
  opacity:1;
  transform:translate3d(0,0,0);
  filter:blur(0);
}

/* ---- Scroll reveals ---- */
[data-fx-reveal]{
  opacity:0;
  transform:translate3d(0,40px,0);
  filter:blur(8px);
  transition:opacity .85s cubic-bezier(.22,.8,.28,1),
             transform .85s cubic-bezier(.22,.8,.28,1),
             filter .85s ease;
  transition-delay:calc(var(--fx-i,0) * 80ms);
  will-change:opacity,transform,filter;
}
[data-fx-reveal].fx-in,
.fx-reduce [data-fx-reveal]{
  opacity:1;transform:none;filter:blur(0);
}

/* ---- List/timeline reveal ---- */
.pp-list-item,.pp-tl-item,.preview-card,.feature-card,.journey-step{
  transition:opacity .55s ease, transform .55s cubic-bezier(.22,.8,.28,1);
}
/* Only hide cards while the FX engine is confirmed alive (html.fx-ready).
   If the engine never boots (script blocked, error, etc.), cards stay visible
   instead of disappearing forever on desktop. */
html.fx-ready .pp-list-item:not(.fx-list-in),
html.fx-ready .pp-tl-item:not(.fx-list-in),
html.fx-ready .preview-card:not(.fx-list-in),
html.fx-ready .feature-card:not(.fx-list-in),
html.fx-ready .journey-step:not(.fx-list-in){
  opacity:0;transform:translate3d(-14px,12px,0);
}
.fx-reduce .pp-list-item,
.fx-reduce .pp-tl-item,
.fx-reduce .preview-card,
.fx-reduce .feature-card,
.fx-reduce .journey-step{opacity:1!important;transform:none!important}

/* Auto scan-line sweep on preview/feature cards once revealed */
.preview-card,.feature-card{position:relative;overflow:hidden}
.preview-card.fx-list-in::after,
.feature-card.fx-list-in::after{
  content:"";position:absolute;inset:0;
  background:linear-gradient(115deg,transparent 25%,rgba(76,175,120,.22) 50%,transparent 75%);
  transform:translateX(-120%);
  animation:fx-card-sweep 1.6s ease-out .15s 1 forwards;
  pointer-events:none;
}
@keyframes fx-card-sweep{
  to{transform:translateX(120%)}
}

/* ---- Live-update visual feedback ---- */
@keyframes fx-pulse{
  0%  {transform:scale(1);color:inherit;text-shadow:none}
  40% {transform:scale(1.22);color:#1f8a55;text-shadow:0 0 18px rgba(76,175,120,.85), 0 0 4px rgba(76,175,120,.6)}
  100%{transform:scale(1);color:inherit;text-shadow:none}
}
.fx-pulse{animation:fx-pulse .75s cubic-bezier(.22,.8,.28,1); display:inline-block}

@keyframes fx-ring{
  0%  {box-shadow:0 0 0 0 rgba(76,175,120,.7), inset 0 0 0 0 rgba(76,175,120,0)}
  60% {box-shadow:0 0 0 16px rgba(76,175,120,0), inset 0 0 0 2px rgba(76,175,120,.65)}
  100%{box-shadow:0 0 0 0 rgba(76,175,120,0), inset 0 0 0 0 rgba(76,175,120,0)}
}
.fx-ring{animation:fx-ring 1s ease-out;border-radius:inherit;position:relative}

@keyframes fx-flash{
  0%  {background-color:rgba(76,175,120,.32); box-shadow:inset 0 0 0 1px rgba(76,175,120,.55)}
  100%{background-color:transparent; box-shadow:inset 0 0 0 0 rgba(76,175,120,0)}
}
.fx-flash{animation:fx-flash .85s ease-out}

@keyframes fx-glow{
  0%  {box-shadow:0 0 0 0 rgba(78,160,224,.55)}
  60% {box-shadow:0 0 30px 8px rgba(78,160,224,.55)}
  100%{box-shadow:0 0 0 0 rgba(78,160,224,0)}
}
.fx-glow{animation:fx-glow 1.4s ease-out}

@keyframes fx-slide-in-left{
  0%  {opacity:0;transform:translate3d(-22px,0,0);filter:blur(6px)}
  100%{opacity:1;transform:none;filter:blur(0)}
}
@keyframes fx-slide-in-right{
  0%  {opacity:0;transform:translate3d(22px,0,0);filter:blur(6px)}
  100%{opacity:1;transform:none;filter:blur(0)}
}
.fx-slide-in-left{animation:fx-slide-in-left .5s cubic-bezier(.22,.8,.28,1)}
.fx-slide-in-right{animation:fx-slide-in-right .5s cubic-bezier(.22,.8,.28,1)}

@keyframes fx-event-in{
  0%  {opacity:0;transform:translate3d(-16px,4px,0);filter:blur(4px)}
  100%{opacity:1;transform:none;filter:blur(0)}
}
.fx-event-in{animation:fx-event-in .55s cubic-bezier(.22,.8,.28,1)}

/* Progress bar shimmer (fills in agriculture/irrigation/livestock) */
.pp-progress .fill{position:relative;overflow:hidden}
.pp-progress .fill::after{
  content:"";position:absolute;inset:0;
  background:linear-gradient(90deg,transparent,rgba(255,255,255,.55),transparent);
  transform:translateX(-100%);
  animation:fx-shimmer 2.4s ease-in-out infinite;
}
@keyframes fx-shimmer{
  0%  {transform:translateX(-100%)}
  60% {transform:translateX(100%)}
  100%{transform:translateX(100%)}
}

/* Irrigation: water ripple in active tiles */
[data-fx-page="irrigation"] .pp-tile.is-alert::before,
[data-fx-page="irrigation"] .pp-tile .pp-progress.is-critical::before{
  content:"";position:absolute;inset:0;border-radius:inherit;
  box-shadow:inset 0 0 0 2px rgba(78,160,224,.5);
  animation:fx-ripple 2s ease-out infinite;
  pointer-events:none;
}
@keyframes fx-ripple{
  0%  {opacity:.7;transform:scale(.985)}
  100%{opacity:0;transform:scale(1.01)}
}
[data-fx-page="irrigation"] .pp-tile{position:relative}

/* Livestock: REC dot pulse on camera tiles */
[data-fx-page="livestock"] .pp-tile{position:relative}
[data-fx-page="livestock"] .pp-tile::after{
  content:"● REC";position:absolute;top:10px;right:12px;
  font-size:.7rem;font-weight:700;letter-spacing:.06em;color:#d63b3b;
  animation:fx-rec-pulse 1.4s ease-in-out infinite;
}
@keyframes fx-rec-pulse{
  0%,100%{opacity:.4}
  50%{opacity:1;text-shadow:0 0 12px rgba(214,59,59,.8)}
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce){
  .fx-bg, .fx-bg *, .preview-card::after, .feature-card::after,
  .pp-progress .fill::after, .fx-cam-band, .fx-scan-y, .fx-strip-track, .fx-wave{
    animation:none!important;
  }
  .fx-hero .fx-hero-el,[data-fx-reveal]{
    transition:none!important;opacity:1!important;transform:none!important;filter:none!important;
  }
}

/* ---- Mobile lighter ---- */
@media (max-width: 768px){
  .fx-bg-grid{opacity:.35}
  .fx-scan-y{display:none}
  [data-fx-reveal]{transform:translate3d(0,24px,0);filter:blur(4px)}
}

/* ============================================================ */
/* PHASE 8 — Hero typing on subpages + Weather FX + Irrigation  */
/* ============================================================ */

/* ---- Typing on .pp-hero (mirror of .hero rules) ---- */
.pp-hero h1 em { font-style: normal; }
.pp-hero h1 .type-em {
  font-style: normal;
  display: inline-grid;
  grid-template-areas: "stack";
  vertical-align: baseline;
  line-height: inherit;
}
.pp-hero h1 .type-em > .type-static,
.pp-hero h1 .type-em > .type-anim { grid-area: stack; min-width: 0; }
.pp-hero h1 .type-em .type-static {
  visibility: hidden;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}
.pp-hero h1 .type-em .type-anim {
  display: inline-flex;
  align-items: baseline;
  white-space: nowrap;
}
.pp-hero h1 .type-em .type-static,
.pp-hero h1 .type-em .type-text {
  background: linear-gradient(135deg, var(--green, #4caf78), var(--blue-light, #7cc4f0));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}
.pp-hero h1 .type-em .type-caret {
  display: inline-block;
  width: 3px;
  height: 0.95em;
  margin-left: 4px;
  background: var(--green, #4caf78);
  border-radius: 2px;
  transform: translateY(0.08em);
  animation: caretBlink 1s steps(1) infinite;
}
@keyframes caretBlink { 50% { opacity: 0; } }

@media (max-width: 600px) {
  .pp-hero h1 .type-em { display: inline; }
  .pp-hero h1 .type-em .type-static { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
  .pp-hero h1 .type-em .type-anim { white-space: normal; }
}
@media (prefers-reduced-motion: reduce) {
  .pp-hero h1 .type-em .type-anim { display: none !important; }
  .pp-hero h1 .type-em .type-static { visibility: visible !important; position: static; clip-path: none; width: auto; height: auto; }
  .pp-hero h1 .type-em .type-caret { animation: none; }
}

/* ============================================================ */
/* WEATHER FX — condition-driven layers                         */
/* ============================================================ */
.wfx {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  contain: strict;
}
/* Make sure page content always sits above the fixed FX layer.
   .public-page creates an isolated stacking context so headings,
   sections and cards can never be hidden behind weather FX. */
/* Weather page: keep FX behind content WITHOUT creating an isolated
   stacking context (isolation:isolate breaks position:sticky descendants like nav). */
body[data-page="weather"] .public-page { position: relative; z-index: 1; }
body[data-page="weather"] .public-page > * { position: relative; z-index: 1; }
body[data-page="weather"] .wfx { z-index: 0 !important; }
body[data-page="weather"] main,
body[data-page="weather"] .pp-section,
body[data-page="weather"] .pp-hero,
body[data-page="weather"] .pp-section-head,
body[data-page="weather"] .pp-card,
body[data-page="weather"] .pp-list-card,
body[data-page="weather"] .pp-tile,
body[data-page="weather"] .pp-weather-now { position: relative; z-index: 1; }
.wfx > * { position: absolute; inset: 0; opacity: 0; transition: opacity .8s ease; }
.wfx[data-cond="rain"]   .wfx-rain,
.wfx[data-cond="storm"]  .wfx-rain,
.wfx[data-cond="storm"]  .wfx-lightning,
.wfx[data-cond="storm"]  .wfx-storm-tint,
.wfx[data-cond="rain"]   .wfx-rain-tint,
.wfx[data-cond="cloudy"] .wfx-cloud-a,
.wfx[data-cond="cloudy"] .wfx-cloud-b,
.wfx[data-cond="cloudy"] .wfx-cloud-tint,
.wfx[data-cond="sunny"]  .wfx-sun-glow,
.wfx[data-cond="sunny"]  .wfx-rays { opacity: 1; }

.wfx-rain { width: 100%; height: 100%; }
.wfx-rain canvas { width: 100%; height: 100%; display: block; }
.wfx-rain-tint   { background: radial-gradient(ellipse at top, rgba(70,130,200,.18), transparent 60%); }
.wfx-storm-tint  { background: radial-gradient(ellipse at top, rgba(40,60,110,.32), transparent 65%); }
.wfx-cloud-tint  { background: linear-gradient(180deg, rgba(140,160,180,.12), transparent 50%); }

.wfx-cloud-a, .wfx-cloud-b {
  height: 240px;
  background-repeat: repeat-x;
  background-size: 1200px 240px;
  background-image:
    radial-gradient(120px 60px at 200px 120px, rgba(255,255,255,.55), transparent 70%),
    radial-gradient(160px 70px at 500px 100px, rgba(255,255,255,.45), transparent 70%),
    radial-gradient(140px 60px at 850px 130px, rgba(255,255,255,.5), transparent 70%),
    radial-gradient(100px 50px at 1100px 110px, rgba(255,255,255,.4), transparent 70%);
  filter: blur(2px);
  mix-blend-mode: screen;
}
.wfx-cloud-a { top: 60px; animation: wfxCloudA 80s linear infinite; }
.wfx-cloud-b { top: 160px; opacity: .6; animation: wfxCloudB 120s linear infinite; }
@keyframes wfxCloudA { from { transform: translateX(-1200px); } to { transform: translateX(0); } }
@keyframes wfxCloudB { from { transform: translateX(0); } to { transform: translateX(-1200px); } }

.wfx-lightning {
  background: rgba(220, 230, 255, 0);
  animation: wfxBolt 9s linear infinite;
}
@keyframes wfxBolt {
  0%, 92%, 100% { background: rgba(220,230,255,0); }
  93% { background: rgba(220,230,255,.85); }
  94% { background: rgba(220,230,255,0); }
  95% { background: rgba(220,230,255,.55); }
  96% { background: rgba(220,230,255,0); }
}

.wfx-sun-glow {
  background: radial-gradient(circle at 85% 12%, rgba(255,210,120,.45), rgba(255,180,80,.18) 25%, transparent 55%);
}
.wfx-rays {
  background:
    conic-gradient(from 0deg at 85% 12%,
      rgba(255,220,140,0) 0deg,
      rgba(255,220,140,.10) 12deg,
      rgba(255,220,140,0) 24deg,
      rgba(255,220,140,.08) 60deg,
      rgba(255,220,140,0) 90deg,
      rgba(255,220,140,.10) 140deg,
      rgba(255,220,140,0) 180deg);
  mix-blend-mode: screen;
  transform-origin: 85% 12%;
  animation: wfxRays 90s linear infinite;
}
@keyframes wfxRays { to { transform: rotate(360deg); } }

/* Weather card glass / wet effect */
body[data-page="weather"][data-weather-cond="rain"] .pp-card,
body[data-page="weather"][data-weather-cond="storm"] .pp-card {
  position: relative;
  overflow: hidden;
}
body[data-page="weather"][data-weather-cond="rain"] .pp-card::after,
body[data-page="weather"][data-weather-cond="storm"] .pp-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, rgba(140,180,220,.08), transparent 50%, rgba(140,180,220,.06));
  mix-blend-mode: screen;
}
body[data-page="weather"][data-weather-cond="storm"] #wAlertList .pp-list-item:first-child {
  animation: wfxAlertPulse 1.6s ease-in-out infinite;
}
@keyframes wfxAlertPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 80, 80, 0); }
  50%      { box-shadow: 0 0 0 8px rgba(220, 80, 80, .18); }
}

/* Sun warm sweep on weather card when sunny */
body[data-page="weather"][data-weather-cond="sunny"] .pp-card {
  position: relative;
  overflow: hidden;
}
body[data-page="weather"][data-weather-cond="sunny"] .pp-card::before {
  content: "";
  position: absolute;
  top: 0; left: -60%;
  width: 60%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,220,140,.18), transparent);
  animation: wfxWarmSweep 9s linear infinite;
  pointer-events: none;
}
@keyframes wfxWarmSweep { to { left: 120%; } }

/* ============================================================ */
/* IRRIGATION FX — water shimmer on bars + active tile ripple   */
/* ============================================================ */
body[data-page="irrigation"] .pp-bar .fill,
body[data-page="irrigation"] .pp-visual-bar .fill,
body[data-page="irrigation"] [data-progress] .fill {
  position: relative;
  overflow: hidden;
}
body[data-page="irrigation"] .pp-bar .fill::after,
body[data-page="irrigation"] .pp-visual-bar .fill::after,
body[data-page="irrigation"] [data-progress] .fill::after {
  content: "";
  position: absolute;
  top: 0; left: -40%;
  width: 40%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
  animation: fxWaterShimmer 2.4s linear infinite;
  pointer-events: none;
}
@keyframes fxWaterShimmer { to { left: 120%; } }

body[data-page="irrigation"] .fx-irrig-active {
  position: relative;
  box-shadow: 0 0 0 0 rgba(80, 170, 230, .35);
  animation: fxIrrigGlow 2.2s ease-in-out infinite;
}
@keyframes fxIrrigGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(80, 170, 230, 0); }
  50%      { box-shadow: 0 0 0 10px rgba(80, 170, 230, .18); }
}
body[data-page="irrigation"] .fx-irrig-active::before {
  content: "";
  position: absolute;
  top: 14px; right: 14px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: rgba(80,170,230,.7);
  box-shadow: 0 0 0 0 rgba(80,170,230,.6);
  animation: fxDroplet 2.6s ease-out infinite;
  pointer-events: none;
}
@keyframes fxDroplet {
  0%   { box-shadow: 0 0 0 0    rgba(80,170,230,.6); opacity: .9; }
  80%  { box-shadow: 0 0 0 26px rgba(80,170,230,0);  opacity: 0; }
  100% { box-shadow: 0 0 0 0    rgba(80,170,230,0);  opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .wfx-cloud-a, .wfx-cloud-b, .wfx-rays, .wfx-lightning,
  body[data-page="irrigation"] .pp-bar .fill::after,
  body[data-page="irrigation"] .pp-visual-bar .fill::after,
  body[data-page="irrigation"] [data-progress] .fill::after,
  body[data-page="irrigation"] .fx-irrig-active,
  body[data-page="irrigation"] .fx-irrig-active::before,
  body[data-page="weather"][data-weather-cond="sunny"] .pp-card::before,
  body[data-page="weather"][data-weather-cond="storm"] #wAlertList .pp-list-item:first-child {
    animation: none !important;
  }
}

/* ============================================================ */
/* AGRICULTURE — clickable zone tiles + zone detail modal       */
/* ============================================================ */
button.pp-tile.is-clickable {
  text-align: left;
  font: inherit;
  color: inherit;
  border: 1px solid rgba(45, 122, 79, .12);
  background: #fff;
  cursor: pointer;
  width: 100%;
  display: block;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
button.pp-tile.is-clickable:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 40px -22px rgba(45, 122, 79, .35);
  border-color: rgba(45, 122, 79, .35);
}
button.pp-tile.is-clickable:focus-visible {
  outline: 2px solid #2d7a4f;
  outline-offset: 3px;
}
.pp-tile-cta {
  margin-top: 14px;
  font-size: 13px;
  font-weight: 600;
  color: #2d7a4f;
  letter-spacing: .01em;
}
button.pp-tile.is-clickable.is-alert .pp-tile-cta { color: #c0392b; }

.zone-modal {
  position: fixed; inset: 0;
  z-index: 9000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.zone-modal.is-open { display: flex; animation: zmFade .25s ease; }
@keyframes zmFade { from { opacity: 0; } to { opacity: 1; } }
.zone-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(20, 35, 28, .55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.zone-modal-panel {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .35);
  padding: 32px 32px 24px;
  animation: zmRise .42s cubic-bezier(.2,.85,.2,1);
}
@keyframes zmRise { from { transform: translateY(36px) scale(.94); opacity: 0; filter: blur(6px); } to { transform: none; opacity: 1; filter: blur(0); } }
.zone-modal-close {
  position: absolute; top: 14px; right: 16px;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,.08);
  background: #fff;
  font-size: 22px; line-height: 1;
  cursor: pointer;
  color: #333;
}
.zone-modal-close:hover { background: #f4f4f4; }
.zm-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(0,0,0,.06);
  margin-bottom: 20px;
}
.zm-emoji { font-size: 44px; line-height: 1; }
.zm-eyebrow {
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #6b7d72;
  display: inline-flex; align-items: center; gap: 6px;
}
.zm-eyebrow .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #2d7a4f;
  display: inline-block;
}
.zm-head-text h3 {
  margin: 4px 0 6px;
  font-family: 'Playfair Display', serif;
  font-size: 26px;
}
.zm-status {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.zm-status.is-ok   { background: rgba(45,122,79,.12);  color: #1f5d3b; }
.zm-status.is-warn { background: rgba(230,160,40,.18); color: #8a5a10; }
.zm-status.is-crit { background: rgba(200,60,60,.16);  color: #a02525; }
.zm-health { text-align: center; }
.zm-health-ring { position: relative; width: 84px; height: 84px; margin: 0 auto; }
.zm-health-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.zm-health-ring circle { fill: none; stroke-width: 3.4; }
.zm-health-ring circle.bg { stroke: rgba(0,0,0,.07); }
.zm-health-ring circle.fg {
  stroke: #2d7a4f;
  stroke-linecap: round;
  transition: stroke-dasharray .9s cubic-bezier(.2,.7,.2,1);
}
.zm-health-ring circle.fg[data-kind="warn"] { stroke: #d39226; }
.zm-health-ring circle.fg[data-kind="crit"] { stroke: #c0392b; }
.zm-health-val {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px;
}
.zm-health-lbl { font-size: 11px; color: #6b7d72; margin-top: 4px; }
.zm-section { margin-bottom: 22px; }
.zm-section h4 { margin: 0 0 10px; font-size: 14px; letter-spacing: .04em; text-transform: uppercase; color: #2d7a4f; }
.zm-section p  { margin: 0; line-height: 1.55; color: #2c3a32; }
.zm-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}
.zm-stat {
  background: #f5f8f5;
  border: 1px solid rgba(45,122,79,.08);
  border-radius: 12px;
  padding: 12px 14px;
}
.zm-stat .lbl { font-size: 11px; color: #6b7d72; text-transform: uppercase; letter-spacing: .05em; }
.zm-stat .val { font-size: 18px; font-weight: 700; color: #1c2a22; margin-top: 2px; }
.zm-list { display: grid; gap: 8px; }
.zm-li {
  background: #f7f9f7;
  border-left: 3px solid #2d7a4f;
  border-radius: 8px;
  padding: 10px 14px;
}
.zm-li.is-alert { border-left-color: #c0392b; background: #fdf3f1; }
.zm-li-title { font-weight: 600; color: #1c2a22; }
.zm-li-desc { font-size: 13px; color: #6b7d72; margin-top: 2px; }
.zm-recos { margin: 0; padding-left: 20px; }
.zm-recos li { margin: 6px 0; line-height: 1.5; color: #2c3a32; }
.zm-tl { display: grid; gap: 10px; }
.zm-tl-item {
  border-left: 2px solid rgba(45,122,79,.25);
  padding: 4px 0 4px 14px;
}
.zm-tl-time { font-size: 11px; color: #6b7d72; text-transform: uppercase; letter-spacing: .05em; }
.zm-tl-title { font-weight: 600; color: #1c2a22; margin-top: 2px; }
.zm-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding-top: 14px;
  border-top: 1px solid rgba(0,0,0,.06);
}
@media (max-width: 600px) {
  .zone-modal { padding: 12px; }
  .zone-modal-panel { padding: 24px 18px 18px; border-radius: 18px; }
  .zm-head { grid-template-columns: auto 1fr; }
  .zm-health { grid-column: 1 / -1; }
  .zm-foot { flex-direction: column-reverse; }
  .zm-foot .pp-btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .zone-modal.is-open, .zone-modal-panel { animation: none; }
}

/* =========================================================================
   PHASE 5 — Diagnostic IA (manual upload) + stronger UI motion
   Restores the legacy upload/result block on agriculture.php and adds
   visible shimmer/wave to progress fills + page-level water motion.
   ========================================================================= */

/* ---- Diagnostic IA layout ---- */
.public-page #diagnostic .diag-layout {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 32px; max-width: 1100px; margin: 0 auto;
  align-items: start;
}
@media (max-width: 900px) {
  .public-page #diagnostic .diag-layout { grid-template-columns: 1fr; }
}

.public-page #diagnostic .upload-panel {
  background: #fafbfc;
  border: 2px dashed #d6dde6;
  border-radius: 18px;
  padding: 36px 28px;
  text-align: center;
  transition: border-color .25s ease, background .25s ease, transform .25s ease;
  cursor: pointer;
  outline: none;
}
.public-page #diagnostic .upload-panel:hover,
.public-page #diagnostic .upload-panel:focus-visible {
  border-color: #4caf78;
  background: #e8f5ee;
  transform: translateY(-2px);
}
.public-page #diagnostic .upload-icon { font-size: 3.4rem; margin-bottom: 14px; }
.public-page #diagnostic .upload-panel h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem; font-weight: 700; margin-bottom: 8px; color: #1a2332;
}
.public-page #diagnostic .upload-panel p {
  color: #6b7a8c; font-size: .9rem; margin-bottom: 22px; line-height: 1.5;
}
.public-page #diagnostic .upload-btns {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
}
.public-page #diagnostic .upload-btn {
  padding: 10px 20px;
  border-radius: 50px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600; font-size: .88rem;
  cursor: pointer; border: none;
  transition: transform .2s ease, box-shadow .25s ease, background .2s ease;
}
.public-page #diagnostic .ub-green {
  background: #2d7a4f; color: #fff;
  box-shadow: 0 6px 18px -6px rgba(45,122,79,.55);
}
.public-page #diagnostic .ub-green:hover { background: #4caf78; transform: translateY(-2px); }
.public-page #diagnostic .ub-blue {
  background: #2563a8; color: #fff;
  box-shadow: 0 6px 18px -6px rgba(37,99,168,.55);
}
.public-page #diagnostic .ub-blue:hover { background: #4a90d9; transform: translateY(-2px); }
.public-page #diagnostic .ub-outline {
  background: #fff; color: #4a5568;
  border: 1.5px solid #d6dde6;
}
.public-page #diagnostic .ub-outline:hover { border-color: #2d7a4f; color: #2d7a4f; transform: translateY(-2px); }

.public-page #diagnostic #imagePreview {
  max-width: 100%; border-radius: 12px;
  margin-top: 18px; display: none;
  box-shadow: 0 10px 28px -10px rgba(31,42,36,.25);
}

.public-page #diagnostic .result-card {
  background: #fff;
  border-radius: 18px;
  padding: 26px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 8px 28px -14px rgba(31,42,36,.18);
  min-height: 240px;
}
.public-page #diagnostic .result-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 18px;
}
.public-page #diagnostic .result-status {
  width: 12px; height: 12px; border-radius: 50%; background: #ccc; flex-shrink: 0;
}
.public-page #diagnostic .status-healthy  { background: #4caf78; box-shadow: 0 0 0 4px rgba(76,175,120,.20); }
.public-page #diagnostic .status-diseased { background: #e07a5f; box-shadow: 0 0 0 4px rgba(224,122,95,.20); }
.public-page #diagnostic .status-warning  { background: #f6b93b; box-shadow: 0 0 0 4px rgba(246,185,59,.20); }

.public-page #diagnostic .disease-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem; font-weight: 700; color: #1a2332;
}
.public-page #diagnostic .disease-crop { font-size: .82rem; color: #8a9ab0; }

.public-page #diagnostic .confidence-row {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px;
}
.public-page #diagnostic .conf-label { font-size: .85rem; color: #4a5568; }
.public-page #diagnostic .conf-pct { font-weight: 700; color: #2d7a4f; }

.public-page #diagnostic .prog-bar {
  height: 10px; background: #e2e8f0; border-radius: 6px; overflow: hidden;
  margin-bottom: 16px; position: relative;
}
.public-page #diagnostic .prog-fill {
  height: 100%; border-radius: 6px;
  background: linear-gradient(90deg, #2d7a4f, #4caf78);
  transition: width .8s cubic-bezier(.4,0,.2,1);
  position: relative; overflow: hidden;
}
.public-page #diagnostic .prog-fill::after {
  content:''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
  transform: translateX(-100%);
  animation: barShimmer 1.8s linear infinite;
}

.public-page #diagnostic .severity-badge {
  display: inline-block; padding: 4px 12px; border-radius: 50px;
  font-size: .78rem; font-weight: 600;
}
.public-page #diagnostic .sev-low  { background: #e8f5e9; color: #2d7a4f; }
.public-page #diagnostic .sev-med  { background: #fff3e0; color: #e67e22; }
.public-page #diagnostic .sev-high { background: #fde8e8; color: #c0392b; }

.public-page #diagnostic .treatment-section h4 {
  font-weight: 600; margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
  color: #1a2332;
}
.public-page #diagnostic .treatment-list { list-style: none; padding: 0; margin: 0; }
.public-page #diagnostic .treatment-list li {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid #eef2f5;
  font-size: .9rem; color: #4a5568; line-height: 1.5;
}
.public-page #diagnostic .treatment-list li:last-child { border-bottom: none; }
.public-page #diagnostic .treatment-list li::before {
  content: '✓'; color: #2d7a4f; font-weight: 700; flex-shrink: 0; margin-top: 1px;
}
.public-page #diagnostic .med-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fdf0f4; color: #c64273; border: 1px solid #f4b8c8;
  padding: 6px 12px; border-radius: 50px;
  font-size: .82rem; font-weight: 500; margin: 4px 4px 0 0;
}
.public-page #diagnostic .placeholder-state {
  text-align: center; padding: 50px 20px; color: #8a9ab0;
}
.public-page #diagnostic .placeholder-state .ps-icon { font-size: 3rem; margin-bottom: 12px; opacity: .7; }
.public-page #diagnostic .placeholder-state p { font-size: .95rem; }

/* ---- Universal progress-fill shimmer + smooth tween ---- */
.pp-visual-bar .track,
.pp-progress .track,
.confidence-bar,
.dt-bar,
.pc-prog {
  position: relative; overflow: hidden;
}
.pp-visual-bar .fill,
.pp-progress .fill,
.confidence-fill,
.dt-bar i,
.pc-prog i {
  position: relative;
  transition: width .9s cubic-bezier(.4,0,.2,1);
}
.pp-visual-bar .fill::after,
.pp-progress .fill::after,
.confidence-fill::after,
.dt-bar i::after,
.pc-prog i::after {
  content:''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
  transform: translateX(-100%);
  animation: barShimmer 2.2s linear infinite;
  pointer-events: none;
}
@keyframes barShimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(220%); }
}

/* ---- Stronger scroll reveals on content ---- */
html.js-anim [data-reveal] {
  opacity: 0;
  transform: translateY(28px) scale(.985);
  transition: opacity .65s cubic-bezier(.2,.7,.2,1), transform .65s cubic-bezier(.2,.7,.2,1);
  transition-delay: calc(var(--fx-i, 0) * 60ms);
}
html.js-anim [data-reveal].fx-in,
html.js-anim [data-reveal].is-in {
  opacity: 1; transform: none;
}

/* ---- Hero CTA: continuous glow halo ---- */
@keyframes ctaGlow {
  0%, 100% { box-shadow: 0 8px 24px -10px rgba(45,122,79,.55), 0 0 0 0 rgba(76,175,120,.0); }
  50%      { box-shadow: 0 14px 32px -10px rgba(45,122,79,.7),  0 0 0 8px rgba(76,175,120,.18); }
}
.btn-hero-main, .public-page .pp-btn-primary {
  animation: ctaGlow 3.2s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .btn-hero-main, .public-page .pp-btn-primary { animation: none; }
}

/* ---- Weather: rain canvas mask + condition isolation ---- */
.wfx-rain {
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 18%, #000 78%, transparent 100%);
          mask-image: linear-gradient(180deg, transparent 0, #000 18%, #000 78%, transparent 100%);
}
.wfx[data-cond="sunny"]  .wfx-rain,
.wfx[data-cond="cloudy"] .wfx-rain,
.wfx[data-cond="sunny"]  .wfx-lightning,
.wfx[data-cond="cloudy"] .wfx-lightning,
.wfx[data-cond="rain"]   .wfx-sun-glow,
.wfx[data-cond="rain"]   .wfx-rays,
.wfx[data-cond="storm"]  .wfx-sun-glow,
.wfx[data-cond="storm"]  .wfx-rays {
  opacity: 0 !important;
}
.wfx[data-cond="rain"] .wfx-rain,
.wfx[data-cond="storm"] .wfx-rain { opacity: 1; }

/* Card-anchored droplets on weather block (visual integration). */
body[data-page="weather"] .pp-weather-now {
  position: relative; overflow: hidden;
}
body[data-page="weather"][data-weather-cond="rain"] .pp-weather-now::before,
body[data-page="weather"][data-weather-cond="storm"] .pp-weather-now::before {
  content: ''; position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 12% 18%, rgba(120,160,210,.35) 1.4px, transparent 2px),
    radial-gradient(circle at 78% 42%, rgba(120,160,210,.30) 1.2px, transparent 2px),
    radial-gradient(circle at 34% 78%, rgba(120,160,210,.25) 1.6px, transparent 2.4px),
    radial-gradient(circle at 88% 88%, rgba(120,160,210,.30) 1.2px, transparent 2px);
  background-size: 220px 220px;
  animation: dropFall 3.4s linear infinite;
  pointer-events: none; opacity: .55;
}
@keyframes dropFall {
  0%   { background-position: 0 -220px, 0 -120px, 0 -180px, 0 -90px; }
  100% { background-position: 0 220px,  0 320px,  0 260px,  0 350px; }
}

/* ---- Irrigation: water wave inside fills + hero drop motion ---- */
body[data-page="irrigation"] .pp-progress .fill {
  background: linear-gradient(90deg,#4ea0e0,#7cc4f0,#4ea0e0);
  background-size: 200% 100%;
  animation: irrigWave 2.4s linear infinite;
}
@keyframes irrigWave {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}
body[data-page="irrigation"] .pp-tile.fx-irrig-active::before {
  content:''; position: absolute; inset: 0; border-radius: inherit;
  border: 2px solid rgba(78,160,224,.45);
  animation: irrigRipple 1.8s ease-out infinite;
  pointer-events: none;
}
@keyframes irrigRipple {
  0%   { transform: scale(.98); opacity: .9; }
  100% { transform: scale(1.04); opacity: 0;  }
}
body[data-page="irrigation"] .pp-hero-visual .pp-visual-emoji {
  animation: dropBob 2.6s ease-in-out infinite;
}
@keyframes dropBob {
  0%, 100% { transform: translateY(0)    scale(1);    filter: drop-shadow(0 4px 8px rgba(78,160,224,.35)); }
  50%      { transform: translateY(-8px) scale(1.06); filter: drop-shadow(0 14px 18px rgba(78,160,224,.5)); }
}
body[data-page="irrigation"] .pp-section { position: relative; overflow: hidden; }
body[data-page="irrigation"] .pp-section::after {
  content:''; position: absolute; left: 0; right: 0; bottom: 0; height: 60px;
  background: linear-gradient(180deg, transparent, rgba(78,160,224,.10));
  animation: waterSheen 9s ease-in-out infinite;
  pointer-events: none;
}
@keyframes waterSheen {
  0%, 100% { opacity: .25; transform: translateY(8px); }
  50%      { opacity: .65; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .pp-visual-bar .fill::after, .pp-progress .fill::after,
  .confidence-fill::after, .dt-bar i::after, .pc-prog i::after,
  body[data-page="irrigation"] .pp-progress .fill,
  body[data-page="irrigation"] .pp-tile.fx-irrig-active::before,
  body[data-page="irrigation"] .pp-hero-visual .pp-visual-emoji,
  body[data-page="irrigation"] .pp-section::after,
  body[data-page="weather"][data-weather-cond="rain"] .pp-weather-now::before,
  body[data-page="weather"][data-weather-cond="storm"] .pp-weather-now::before {
    animation: none !important;
  }
}

/* ============================================================ */
/* PHASE 9 — Final correction pass (2026-05-02e)                */
/* ============================================================ */

/* ---- Hero typing on its own dedicated line (no jump) ---- */
.hero h1 .type-line {
  display: block;
  margin-top: 6px;
  min-height: 1.2em;
  line-height: 1.15;
}
.hero h1 .type-line .type-em {
  display: inline-grid;
  grid-template-areas: "stack";
  vertical-align: baseline;
  line-height: inherit;
  max-width: 100%;
}
.hero h1 .type-line .type-em > .type-static,
.hero h1 .type-line .type-em > .type-anim { grid-area: stack; min-width: 0; }
@media (max-width: 600px) {
  .hero h1 .type-line { min-height: 1.3em; margin-top: 4px; }
}

/* ---- Progress bars: hard floor at 0 — even before JS runs ---- */
[data-progress] > .track > .fill,
.pp-progress .fill,
.pp-visual-bar .fill {
  width: 0;
  transition: width 1.1s cubic-bezier(.2,.8,.2,1);
}
@media (prefers-reduced-motion: reduce) {
  [data-progress] > .track > .fill,
  .pp-progress .fill,
  .pp-visual-bar .fill { transition: none; }
}

/* ---- Agriculture: extra-large premium zone tiles ---- */
body[data-page="agriculture"] .zones-xl-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}
@media (max-width: 760px) {
  body[data-page="agriculture"] .zones-xl-grid { grid-template-columns: 1fr; gap: 16px; }
}
body[data-page="agriculture"] .zone-tile-lg {
  position: relative;
  width: 100%;
  text-align: left;
  background: #fff;
  border: 1px solid var(--border, #e5e9e7);
  border-radius: 18px;
  padding: 22px 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  cursor: pointer;
  transition: transform .25s cubic-bezier(.2,.7,.2,1),
              box-shadow .25s ease,
              border-color .25s ease;
  box-shadow: 0 8px 26px -20px rgba(31,42,36,.18);
  overflow: hidden;
}
body[data-page="agriculture"] .zone-tile-lg::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--green, #4caf78), var(--blue-light, #7cc4f0));
  opacity: .85;
}
body[data-page="agriculture"] .zone-tile-lg.is-alert::before {
  background: linear-gradient(180deg, #ec7878, #c0392b);
}
body[data-page="agriculture"] .zone-tile-lg:hover {
  transform: translateY(-4px);
  border-color: rgba(76,175,120,.45);
  box-shadow: 0 22px 50px -22px rgba(31,42,36,.28);
}
body[data-page="agriculture"] .zone-tile-lg:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--green, #4caf78) 55%, transparent);
  outline-offset: 3px;
}
body[data-page="agriculture"] .zone-tile-lg .pp-tile-head { display: flex; align-items: center; gap: 14px; }
body[data-page="agriculture"] .zone-tile-lg .pp-tile-emoji {
  font-size: 2rem;
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #f4faf6, #eaf4f0);
  border-radius: 14px;
  flex-shrink: 0;
}
body[data-page="agriculture"] .zone-tile-lg .pp-tile-title {
  font-size: 1.05rem; font-weight: 700; color: var(--text-dark, #1f2a24);
}
body[data-page="agriculture"] .zone-tile-lg .pp-tile-sub {
  font-size: .82rem; color: var(--text-mid, #5a6b62);
}
body[data-page="agriculture"] .zone-tile-lg .pp-progress { margin: 4px 0 0; }
body[data-page="agriculture"] .zone-tile-lg .pp-tile-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  background: #f7faf8; border: 1px solid #eaf0ec; border-radius: 12px;
  padding: 10px 12px;
}
body[data-page="agriculture"] .zone-tile-lg .pp-tile-stat .lbl { font-size: .72rem; color: var(--text-mid, #5a6b62); text-transform: uppercase; letter-spacing: .04em; }
body[data-page="agriculture"] .zone-tile-lg .pp-tile-stat .val { font-size: .95rem; font-weight: 600; color: var(--text-dark, #1f2a24); }
body[data-page="agriculture"] .zone-tile-lg .pp-tile-cta {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: auto;
  align-self: flex-start;
  padding: 8px 14px;
  background: var(--green, #4caf78);
  color: #fff;
  border-radius: 999px;
  font-size: .85rem; font-weight: 600;
  transition: transform .2s ease, background .2s ease;
}
body[data-page="agriculture"] .zone-tile-lg:hover .pp-tile-cta {
  background: #2d7a4f;
  transform: translateX(2px);
}
body[data-page="agriculture"] .zone-tile-lg .zone-scan-chip {
  position: absolute;
  top: 14px; right: 14px;
  font-size: .7rem;
  background: rgba(255,255,255,.9);
  border: 1px solid #e5e9e7;
  color: var(--text-mid, #5a6b62);
  padding: 4px 9px;
  border-radius: 999px;
  display: inline-flex; align-items: center; gap: 5px;
}
body[data-page="agriculture"] .zone-tile-lg .zone-scan-chip .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green, #4caf78);
  animation: zoneScanDot 1.8s ease-out infinite;
}
body[data-page="agriculture"] .zone-tile-lg.is-alert .zone-scan-chip .dot {
  background: #c0392b;
  animation: zoneScanDotAlert 1.4s ease-out infinite;
}
@keyframes zoneScanDot {
  0%   { box-shadow: 0 0 0 0 rgba(76,175,120,.6); }
  80%  { box-shadow: 0 0 0 8px rgba(76,175,120,0); }
  100% { box-shadow: 0 0 0 0 rgba(76,175,120,0); }
}
@keyframes zoneScanDotAlert {
  0%   { box-shadow: 0 0 0 0 rgba(192,57,43,.6); }
  80%  { box-shadow: 0 0 0 10px rgba(192,57,43,0); }
  100% { box-shadow: 0 0 0 0 rgba(192,57,43,0); }
}

/* ---- Polished zone modal ---- */
body[data-page="agriculture"] #zoneModal.is-open .zone-modal-card {
  max-width: min(720px, 94vw);
  width: 100%;
  border-radius: 18px;
  box-shadow: 0 30px 80px -30px rgba(0,0,0,.35);
}
body[data-page="agriculture"] #zoneModal .zm-head {
  position: sticky; top: 0;
  background: linear-gradient(135deg, #f7fbf9, #eef6f1);
  border-bottom: 1px solid #e5e9e7;
  z-index: 2;
}
body[data-page="agriculture"] #zoneModal .zm-stats {
  display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px;
}
@media (min-width: 600px) {
  body[data-page="agriculture"] #zoneModal .zm-stats { grid-template-columns: repeat(4, minmax(0,1fr)); }
}
body[data-page="agriculture"] #zoneModal .zm-stat {
  background: #f7faf8; border: 1px solid #eaf0ec; border-radius: 12px;
  padding: 10px 12px;
}
body[data-page="agriculture"] #zoneModal .zm-status.is-ok    { background: #e8f5ee; color: #2d7a4f; }
body[data-page="agriculture"] #zoneModal .zm-status.is-warn  { background: #fff3d6; color: #b87a00; }
body[data-page="agriculture"] #zoneModal .zm-status.is-crit  { background: #fde0d6; color: #b8331a; }

/* ---- Weather background cleanup ---- */
body[data-page="weather"] .fx-strip,
body[data-page="weather"] .fx-bg-grid { display: none !important; }
body[data-page="weather"] .wfx-cloud-a { top: -60px !important; opacity: .55; }
body[data-page="weather"] .wfx-cloud-b { top: 20px !important;  opacity: .35; }
body[data-page="weather"] .wfx-cloud-a,
body[data-page="weather"] .wfx-cloud-b {
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 55%, transparent 100%);
          mask-image: linear-gradient(180deg, #000 0%, #000 55%, transparent 100%);
}
body[data-page="weather"] .wfx { pointer-events: none !important; z-index: 0 !important; }
body[data-page="weather"] main { position: relative; z-index: 2; }


/* ============================================================ */
/* PHASE 9 — Desktop animation safety + guest zone modal hard   */
/* ============================================================ */

/* No-JS / FX-blocked safety: never leave content invisible. */
html:not(.js-anim) [data-reveal],
html:not(.js-anim) [data-fx-reveal],
html:not(.fx-ready) .preview-card,
html:not(.fx-ready) .feature-card,
html:not(.fx-ready) .journey-step,
html:not(.fx-ready) .pp-list-item,
html:not(.fx-ready) .pp-tl-item {
  opacity: 1 !important;
  transform: none !important;
  filter: none !important;
}

/* Agriculture: zone tile buttons must always be visible & clickable
   for guests, regardless of any reveal/intersection state. */
body[data-page="agriculture"] [data-zone] {
  opacity: 1 !important;
  transform: none !important;
  pointer-events: auto !important;
  cursor: pointer;
}
body[data-page="agriculture"] [data-zone] * {
  pointer-events: none; /* let clicks bubble straight to the button */
}

/* Guarantee the public zone modal sits above every other layer and
   actually displays when .is-open is added. */
body[data-page="agriculture"] .zone-modal {
  z-index: 10000 !important;
}
body[data-page="agriculture"] .zone-modal.is-open {
  display: flex !important;
}

/* ============================================================ */
/* PHASE 10 — Narrow correction pass (2026-05-02f)              */
/*   - Reveal class normalization                               */
/*   - Weather mobile/tablet hero spacing                       */
/*   - Typing line stability                                    */
/*   - Agriculture modal safety                                 */
/* ============================================================ */

/* ---- Reveal: any of is-in / in-view / fx-in / fx-list-in counts as visible. ---- */
[data-reveal].is-in,
[data-reveal].in-view,
[data-reveal].fx-in {
  opacity: 1 !important;
  transform: none !important;
  filter: none !important;
}
.preview-card.is-in, .preview-card.in-view, .preview-card.fx-in, .preview-card.fx-list-in,
.feature-card.is-in, .feature-card.in-view, .feature-card.fx-in, .feature-card.fx-list-in,
.journey-step.is-in, .journey-step.in-view, .journey-step.fx-in, .journey-step.fx-list-in,
.pp-list-item.is-in, .pp-list-item.in-view, .pp-list-item.fx-in, .pp-list-item.fx-list-in,
.pp-tl-item.is-in,   .pp-tl-item.in-view,   .pp-tl-item.fx-in,   .pp-tl-item.fx-list-in {
  opacity: 1 !important;
  transform: none !important;
}

/* ---- Weather mobile/tablet hero: kill the empty band. ---- */
@media (max-width: 980px) {
  body[data-page="weather"] .pp-hero,
  body[data-page="weather"].public-page .pp-hero {
    min-height: 0 !important;
    padding-top: clamp(20px, 5vw, 40px) !important;
    padding-bottom: clamp(28px, 6vw, 48px) !important;
  }
  body[data-page="weather"] .pp-hero-inner {
    align-items: start !important;
    gap: 22px !important;
  }
  body[data-page="weather"] .pp-hero-visual { margin-top: 0 !important; }
}
@media (max-width: 600px) {
  body[data-page="weather"] .pp-hero {
    padding-top: 16px !important;
    padding-bottom: 24px !important;
  }
  body[data-page="weather"] .pp-hero-inner { gap: 16px !important; }
}

/* ---- Typing line stability (home + subpages) ---- */
@media (min-width: 600px) {
  .hero h1 .type-line,
  .pp-hero h1 .type-line {
    display: block;
  }
  .hero h1 .type-em,
  .pp-hero h1 .type-em {
    min-height: 1.15em;
  }
  .hero h1 .type-em .type-anim,
  .pp-hero h1 .type-em .type-anim {
    white-space: nowrap;
  }
}

/* ---- Agriculture modal safety: always above FX layers, always clickable. ---- */
#zoneModal.is-open {
  display: flex !important;
  pointer-events: auto !important;
  z-index: 10000 !important;
}
#zoneModal .zone-modal-panel,
#zoneModal .zone-modal-content {
  pointer-events: auto !important;
}
body.zm-open { overflow: hidden !important; }

/* ================================================================
   Phase 11 — Keep section headers fixed; only list bodies update
   ================================================================ */
.pp-list-card > .pp-list-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pp-list-card > h3,
.pp-list-card > .pp-list-sub {
  transform: none !important;
  opacity: 1 !important;
  animation: none !important;
}

/* ============================================================
   PHASE 13 — Unified .anim-in animation system (final override)
   One reliable visible class for all public pages. CSS owns
   the motion; JS only adds .anim-in when an element enters view.
   This block is appended LAST so it wins over earlier rules.
   ============================================================ */
html.anim-ready .anim-target{
  opacity:0;
  transform: translateY(40px) scale(.96);
  filter: blur(6px);
  transition:
    opacity 1.1s cubic-bezier(.2,.8,.2,1),
    transform 1.1s cubic-bezier(.2,.8,.2,1),
    filter .8s cubic-bezier(.2,.8,.2,1);
  transition-delay: calc(var(--anim-i, 0) * 120ms);
  will-change: opacity, transform, filter;
}
html.anim-ready .anim-target.anim-in{
  opacity:1;
  transform:none;
  filter:none;
}

/* Section/list-card headers must NEVER move with their dynamic body. */
.public-page .pp-list-card > h3,
.public-page .pp-list-card > .pp-list-sub,
.public-page .pp-section-head > h2,
.public-page .pp-section-head > .pp-sub{
  /* Headers are allowed to fade in once via their own .anim-target,
     but their inner text is never re-animated by list/data updates. */
}
.public-page .pp-list-card > h3.anim-target,
.public-page .pp-list-card > .pp-list-sub.anim-target{
  /* Force-stable: headers reveal but never re-hide. */
  transition-duration: .5s;
}

/* Lighter motion on small screens. */
@media (max-width: 640px){
  html.anim-ready .anim-target{
    transform: translateY(24px) scale(.98);
    filter: blur(4px);
    transition:
      opacity .75s cubic-bezier(.2,.8,.2,1),
      transform .75s cubic-bezier(.2,.8,.2,1),
      filter .55s cubic-bezier(.2,.8,.2,1);
    transition-delay: calc(var(--anim-i, 0) * 80ms);
  }
}

/* Reduced motion: show everything immediately. */
@media (prefers-reduced-motion: reduce){
  html.anim-ready .anim-target{
    opacity:1 !important;
    transform:none !important;
    filter:none !important;
    transition:none !important;
  }
}

/* ============================================================
   PHASE 13 — Weather mobile/tablet hero spacing (final override)
   Removes the large blank area above the Weather hero on phones
   and tablets. Desktop layout untouched.
   ============================================================ */
@media (max-width: 980px){
  body[data-page="weather"] .pp-hero{
    min-height: auto !important;
    padding-top: clamp(16px, 4vw, 32px) !important;
    padding-bottom: clamp(24px, 5vw, 40px) !important;
  }
  body[data-page="weather"] .pp-hero-inner{
    align-items: start !important;
    gap: 18px !important;
    padding-top: 0 !important;
  }
  body[data-page="weather"] .pp-hero-visual,
  body[data-page="weather"] .pp-hero-visual-inner{
    min-height: 0 !important;
  }
  body[data-page="weather"] .pp-hero h1{
    margin-top: 0 !important;
  }
  body[data-page="weather"] .pp-hero .pp-eyebrow{
    margin-top: 0 !important;
  }
}
@media (max-width: 600px){
  body[data-page="weather"] .pp-hero{
    padding-top: 12px !important;
    padding-bottom: 18px !important;
  }
  body[data-page="weather"] .pp-hero-inner{
    gap: 14px !important;
  }
  body[data-page="weather"] .pp-hero h1{
    font-size: clamp(1.6rem, 6.4vw, 2rem) !important;
    line-height: 1.18 !important;
  }
  body[data-page="weather"] .pp-hero .pp-sub{
    margin-top: 8px !important;
  }
  body[data-page="weather"] .pp-hero-cta{
    margin-top: 18px !important;
  }
  body[data-page="weather"] .pp-live{
    margin-top: 12px !important;
  }
}

/* Phase 13 — slower, more visible progress fill (overrides earlier rules). */
.public-page .pp-progress .fill,
.public-page .pp-visual-bar .fill{
  transition: width 1.3s cubic-bezier(.2,.8,.2,1);
}
@media (prefers-reduced-motion: reduce){
  .public-page .pp-progress .fill,
  .public-page .pp-visual-bar .fill{ transition: none !important; }
}

/* ================================================================
   PHASE 14 — UNIFIED PUBLIC REVEAL SYSTEM (final, dominant)
   One reliable visible class for all public pages.
   - initial:  .reveal-item
   - visible:  .reveal-visible
   This block is appended LAST so it wins over every earlier rule.
   It also neutralizes old reveal classes so they cannot force
   .reveal-item visible before .reveal-visible is applied by JS.
   ================================================================ */

/* Base hidden state — desktop. */
html.reveal-ready .reveal-item{
  opacity: 0;
  transform: translateY(55px) scale(0.94);
  filter: blur(8px);
  transition:
    opacity 1.35s cubic-bezier(.2,.8,.2,1),
    transform 1.35s cubic-bezier(.2,.8,.2,1),
    filter 1.05s cubic-bezier(.2,.8,.2,1);
  transition-delay: calc(var(--reveal-i, 0) * 160ms);
  will-change: opacity, transform, filter;
}
html.reveal-ready .reveal-item.reveal-visible{
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
}

/* Mobile: slightly faster + smaller distance, but never abrupt. */
@media (max-width: 640px){
  html.reveal-ready .reveal-item{
    transform: translateY(36px) scale(0.96);
    filter: blur(5px);
    transition:
      opacity 1.0s cubic-bezier(.2,.8,.2,1),
      transform 1.0s cubic-bezier(.2,.8,.2,1),
      filter .8s cubic-bezier(.2,.8,.2,1);
    transition-delay: calc(var(--reveal-i, 0) * 110ms);
  }
}

/* Hero cards: keep their continuous floatCardA/B/C transform driving the
   movement. Reveal them via opacity + filter only — never overwrite their
   transform. */
html.reveal-ready .hero.is-fullfold .hero-card.reveal-item{
  transform: none;
  filter: blur(8px);
  opacity: 0;
  transition:
    opacity 1.35s cubic-bezier(.2,.8,.2,1),
    filter 1.05s cubic-bezier(.2,.8,.2,1);
  transition-delay: calc(var(--reveal-i, 0) * 160ms);
}
html.reveal-ready .hero.is-fullfold .hero-card.reveal-item.reveal-visible{
  opacity: 1;
  filter: blur(0);
  /* transform is handled by floatCardA/B/C keyframes — do not touch. */
}
@media (max-width: 980px){
  html.reveal-ready .hero.is-fullfold .hero-card.reveal-item{ filter: blur(5px); }
}

/* Reduced motion: show everything immediately, no animation. */
@media (prefers-reduced-motion: reduce){
  html.reveal-ready .reveal-item,
  html.reveal-ready .reveal-item.reveal-visible{
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
  }
}

/* ---- Neutralize OLD reveal systems so they cannot override the new one ----
   Once .reveal-item is on the element, its hidden state must be respected
   regardless of any legacy .is-in / .in-view / .fx-in / .fx-list-in /
   .reveal-in / .anim-in classes the older controllers may also have added. */
html.reveal-ready .reveal-item:not(.reveal-visible),
html.reveal-ready .reveal-item:not(.reveal-visible).is-in,
html.reveal-ready .reveal-item:not(.reveal-visible).in-view,
html.reveal-ready .reveal-item:not(.reveal-visible).fx-in,
html.reveal-ready .reveal-item:not(.reveal-visible).fx-list-in,
html.reveal-ready .reveal-item:not(.reveal-visible).reveal-in,
html.reveal-ready .reveal-item:not(.reveal-visible).anim-in,
html.reveal-ready .reveal-item:not(.reveal-visible).anim-target{
  opacity: 0 !important;
  transform: translateY(55px) scale(0.94) !important;
  filter: blur(8px) !important;
}
@media (max-width: 640px){
  html.reveal-ready .reveal-item:not(.reveal-visible),
  html.reveal-ready .reveal-item:not(.reveal-visible).is-in,
  html.reveal-ready .reveal-item:not(.reveal-visible).in-view,
  html.reveal-ready .reveal-item:not(.reveal-visible).fx-in,
  html.reveal-ready .reveal-item:not(.reveal-visible).fx-list-in,
  html.reveal-ready .reveal-item:not(.reveal-visible).reveal-in,
  html.reveal-ready .reveal-item:not(.reveal-visible).anim-in,
  html.reveal-ready .reveal-item:not(.reveal-visible).anim-target{
    transform: translateY(36px) scale(0.96) !important;
    filter: blur(5px) !important;
  }
}
/* Hero cards exception so the floatCard keyframes still run while hidden. */
html.reveal-ready .hero.is-fullfold .hero-card.reveal-item:not(.reveal-visible),
html.reveal-ready .hero.is-fullfold .hero-card.reveal-item:not(.reveal-visible).is-in,
html.reveal-ready .hero.is-fullfold .hero-card.reveal-item:not(.reveal-visible).in-view,
html.reveal-ready .hero.is-fullfold .hero-card.reveal-item:not(.reveal-visible).fx-in,
html.reveal-ready .hero.is-fullfold .hero-card.reveal-item:not(.reveal-visible).fx-list-in,
html.reveal-ready .hero.is-fullfold .hero-card.reveal-item:not(.reveal-visible).reveal-in,
html.reveal-ready .hero.is-fullfold .hero-card.reveal-item:not(.reveal-visible).anim-in,
html.reveal-ready .hero.is-fullfold .hero-card.reveal-item:not(.reveal-visible).anim-target{
  transform: none !important;
}

/* Progress bars: visible-only fill, slow & clearly visible. */
html.reveal-ready .public-page .pp-progress .fill,
html.reveal-ready .public-page .pp-visual-bar .fill,
html.reveal-ready .pc-prog i,
html.reveal-ready .confidence-fill{
  width: 0;
  transition: width 1.5s cubic-bezier(.2,.8,.2,1);
}
@media (prefers-reduced-motion: reduce){
  html.reveal-ready .public-page .pp-progress .fill,
  html.reveal-ready .public-page .pp-visual-bar .fill,
  html.reveal-ready .pc-prog i,
  html.reveal-ready .confidence-fill{ transition: none !important; }
}

/* Hero cards: force continuous CSS keyframe motion to play, regardless of any
   legacy rule that may try to pause it. */
@media (min-width: 981px){
  .hero.is-fullfold .hero-card,
  .hero-visual .hero-card{
    animation-play-state: running !important;
  }
}

/* ================================================================
   PHASE 14 — Weather mobile/tablet hero spacing (final override)
   Removes the big blank gap above Weather hero on phones/tablets.
   Desktop layout is intentionally untouched.
   ================================================================ */
@media (max-width: 980px){
  body[data-page="weather"] .pp-hero,
  body[data-page="weather"].public-page .pp-hero,
  body[data-page="weather"] .public-page .pp-hero{
    min-height: 0 !important;
    padding-top: clamp(12px, 3vw, 24px) !important;
    padding-bottom: clamp(20px, 4vw, 36px) !important;
  }
  body[data-page="weather"] .pp-hero-inner{
    align-items: start !important;
    gap: 16px !important;
    padding-top: 0 !important;
    margin-top: 0 !important;
  }
  body[data-page="weather"] .pp-hero-visual,
  body[data-page="weather"] .pp-hero-visual-inner{
    min-height: 0 !important;
    margin-top: 0 !important;
  }
  body[data-page="weather"] .pp-hero h1,
  body[data-page="weather"] .pp-hero .pp-eyebrow{
    margin-top: 0 !important;
  }
}
@media (max-width: 600px){
  body[data-page="weather"] .pp-hero{
    padding-top: 8px !important;
    padding-bottom: 16px !important;
  }
  body[data-page="weather"] .pp-hero-inner{ gap: 12px !important; }
  body[data-page="weather"] .pp-hero h1{
    font-size: clamp(1.55rem, 6.2vw, 1.95rem) !important;
    line-height: 1.18 !important;
  }
}

/* ================================================================
   PHASE 14b — Weather mobile/tablet hero first-paint safety net
   If anything still tags the Weather hero with .reveal-item on
   small screens, force it visible in final position immediately.
   Desktop (>980px) is intentionally untouched.
   ================================================================ */
@media (max-width: 980px){
  body[data-page="weather"] .public-page .pp-hero .reveal-item,
  body[data-page="weather"] .public-page .pp-hero-visual.reveal-item,
  body[data-page="weather"] .public-page .pp-hero .reveal-item:not(.reveal-visible),
  body[data-page="weather"] .public-page .pp-hero-visual.reveal-item:not(.reveal-visible){
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
  }
  body[data-page="weather"] .pp-hero-visual-inner{
    min-height: 0 !important;
  }
}

/* =======================================================================
   PHASE 19 — Desktop-first manual public animation system
   One controller: assets/js/agrismart-public.js
   One animated attribute: [data-animate]
   One visible class: .is-animated
   Manual getBoundingClientRect() scanner is the reliable desktop path.
   ======================================================================= */

/* 1. Legacy reveal class reset: old systems no longer control visibility. */
[data-reveal],
[data-fx-reveal],
.reveal-item,
.reveal-init,
.reveal-in,
.in-view,
.is-in,
.fx-in,
.fx-list-in,
.anim-in,
.anim-target,
section[data-anim],
html.reveal-ready .reveal-item,
html.reveal-ready .reveal-item:not(.reveal-visible),
html.reveal-ready .reveal-item:not(.reveal-visible).is-in,
html.reveal-ready .reveal-item:not(.reveal-visible).in-view,
html.reveal-ready .reveal-item:not(.reveal-visible).fx-in,
html.reveal-ready .reveal-item:not(.reveal-visible).fx-list-in,
html.reveal-ready .reveal-item:not(.reveal-visible).reveal-in,
html.reveal-ready .reveal-item:not(.reveal-visible).anim-in,
html.reveal-ready .reveal-item:not(.reveal-visible).anim-target {
  opacity: 1 !important;
  transform: none !important;
  filter: none !important;
}

/* 2. New hidden state. Only this controller may hide public reveal items. */
html.public-anim-ready [data-animate]:not(.is-animated) {
  opacity: 0 !important;
  transform: translateY(30px) !important;
  filter: none !important;
  transition:
    opacity .72s cubic-bezier(.2,.7,.2,1),
    transform .72s cubic-bezier(.2,.7,.2,1) !important;
  transition-delay: calc(var(--animate-i, 0) * 65ms) !important;
  will-change: opacity, transform;
}

/* 3. The single visible state. */
html.public-anim-ready [data-animate].is-animated {
  opacity: 1 !important;
  transform: translateY(0) !important;
  filter: none !important;
  transition:
    opacity .72s cubic-bezier(.2,.7,.2,1),
    transform .72s cubic-bezier(.2,.7,.2,1) !important;
  transition-delay: calc(var(--animate-i, 0) * 65ms) !important;
}

/* 4. Old visible classes cannot bypass the new visible class. */
html.public-anim-ready [data-animate]:not(.is-animated).reveal-visible,
html.public-anim-ready [data-animate]:not(.is-animated).reveal-in,
html.public-anim-ready [data-animate]:not(.is-animated).in-view,
html.public-anim-ready [data-animate]:not(.is-animated).is-in,
html.public-anim-ready [data-animate]:not(.is-animated).fx-in,
html.public-anim-ready [data-animate]:not(.is-animated).fx-list-in,
html.public-anim-ready [data-animate]:not(.is-animated).anim-in,
html.public-anim-ready [data-animate]:not(.is-animated).anim-target {
  opacity: 0 !important;
  transform: translateY(30px) !important;
  filter: none !important;
}

html.public-manual-anim-ready [data-animate].is-animated,
html.public-manual-anim-ready [data-reveal].is-animated,
html.public-manual-anim-ready section[data-anim].is-animated {
  opacity: 1 !important;
  transform: translateY(0) !important;
  filter: none !important;
}

@media (max-width: 900px) {
  html.public-anim-ready [data-animate]:not(.is-animated),
  html.public-anim-ready [data-animate].is-animated {
    transition-duration: .9s, .9s !important;
    transition-delay: calc(var(--animate-i, 0) * 70ms) !important;
  }
  html.public-anim-ready [data-animate]:not(.is-animated) {
    transform: translateY(24px) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.public-anim-ready [data-animate],
  html.public-anim-ready [data-animate].is-animated,
  html.public-anim-ready [data-animate]:not(.is-animated) {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
  }
}

/* 5. Continuous desktop Hero card float. */
@keyframes heroFloatA { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
@keyframes heroFloatB { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes heroFloatC { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-18px); } }

.hero-visual .hero-card {
  will-change: transform;
  animation-play-state: running !important;
}
.hero-visual .hero-card.hc-offset-a,
.hero-visual .hero-card:nth-of-type(1) { animation: heroFloatA 6.5s ease-in-out infinite 0s !important; }
.hero-visual .hero-card.hc-offset-b,
.hero-visual .hero-card:nth-of-type(2) { animation: heroFloatB 7.8s ease-in-out infinite .6s !important; }
.hero-visual .hero-card.hc-offset-c,
.hero-visual .hero-card:nth-of-type(3) { animation: heroFloatC 9.2s ease-in-out infinite 1.2s !important; }
.hero-mini { animation: heroFloatB 7s ease-in-out infinite .9s; }

@media (prefers-reduced-motion: reduce) {
  .hero-visual .hero-card,
  .hero-mini { animation: none !important; }
}

/* 6. Progress bars: one baseline, one smooth fill path. */
.public-page .pp-progress .fill,
.public-page .pp-visual-bar .fill,
[data-progress] > .fill,
[data-progress] > .track > .fill,
.confidence-fill,
.pc-prog i,
.dt-bar i {
  width: 0;
  transition: width 1.35s cubic-bezier(.2,.8,.2,1);
}

.public-page .pp-progress.is-animated .fill,
.public-page .pp-visual-bar.is-animated .fill,
.confidence-bar.is-animated .confidence-fill,
.pc-prog.is-animated i,
.dt-bar.is-animated i {
  transition-duration: 1.35s;
}

@media (prefers-reduced-motion: reduce) {
  .public-page .pp-progress .fill,
  .public-page .pp-visual-bar .fill,
  [data-progress] > .fill,
  [data-progress] > .track > .fill,
  .confidence-fill,
  .pc-prog i,
  .dt-bar i { transition: none !important; }
}

@keyframes liveBump {
  0% { transform: scale(1); text-shadow: none; }
  40% { transform: scale(1.06); text-shadow: 0 0 12px rgba(45,122,79,.45); }
  100% { transform: scale(1); text-shadow: none; }
}
.live-bump { animation: liveBump .9s ease-out; }

/* 7. Weather mobile menu remains overlay-only. */
body[data-page="weather"] #mobileMenu,
body[data-page="weather"] .public-page > #mobileMenu {
  position: fixed !important;
  top: 70px !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 1000 !important;
}

@media (max-width: 980px) {
  body[data-page="weather"] .pp-hero,
  body[data-page="weather"].public-page .pp-hero,
  body[data-page="weather"] .public-page .pp-hero {
    min-height: 0 !important;
    padding-top: clamp(12px, 3vw, 24px) !important;
    padding-bottom: clamp(20px, 4vw, 36px) !important;
  }
  body[data-page="weather"] .pp-hero-inner {
    align-items: start !important;
    gap: 16px !important;
    padding-top: 0 !important;
    margin-top: 0 !important;
  }
  body[data-page="weather"] .pp-hero-visual,
  body[data-page="weather"] .pp-hero-visual-inner {
    min-height: 0 !important;
    margin-top: 0 !important;
  }
  body[data-page="weather"] .pp-hero h1,
  body[data-page="weather"] .pp-hero .pp-eyebrow { margin-top: 0 !important; }
}

@media (max-width: 600px) {
  body[data-page="weather"] .pp-hero {
    padding-top: 8px !important;
    padding-bottom: 16px !important;
  }
  body[data-page="weather"] .pp-hero-inner { gap: 12px !important; }
  body[data-page="weather"] .pp-hero h1 {
    font-size: clamp(1.55rem, 6.2vw, 1.95rem) !important;
    line-height: 1.18 !important;
  }
}


/* ============================================================
   Dashboard shell — module switcher, profile dropdown, etc.
   ============================================================ */

/* Hide non-active dash modules */
body[data-page="dashboard"] .dash-module { display:none; }
body[data-page="dashboard"] .dash-module.is-active { display:block; }

/* Dashboard top nav links: pill buttons */
body[data-page="dashboard"] nav .nav-links.dash-modnav {
  display:flex; gap:6px; flex-wrap:nowrap; overflow-x:auto;
  scrollbar-width:none; padding:0; margin:0;
}
body[data-page="dashboard"] nav .nav-links.dash-modnav::-webkit-scrollbar { display:none; }
body[data-page="dashboard"] .dash-modlink {
  display:inline-flex; align-items:center; gap:6px;
  padding:9px 14px; border:1px solid transparent; background:transparent;
  color:#475569; font-weight:600; font-size:.9rem; border-radius:999px;
  cursor:pointer; white-space:nowrap; text-decoration:none; font-family:inherit;
  transition: background .15s ease, color .15s ease, transform .15s ease;
}
body[data-page="dashboard"] .dash-modlink:hover {
  background:#f1f5f9; color:#0f172a;
}
body[data-page="dashboard"] .dash-modlink.is-active {
  background:linear-gradient(135deg,#2d7a4f,#3a9967);
  color:#fff; box-shadow:0 4px 14px rgba(45,122,79,.28);
}

/* Profile dropdown */
body[data-page="dashboard"] .profile-menu { position:relative; }
body[data-page="dashboard"] .profile-trigger {
  display:inline-flex; align-items:center; gap:8px;
  padding:6px 14px 6px 6px; border:1px solid #e2e8f0; background:#fff;
  border-radius:999px; cursor:pointer; font-family:inherit; font-weight:600;
  color:#0f172a; transition:background .15s ease, border-color .15s ease;
}
body[data-page="dashboard"] .profile-trigger:hover { background:#f8fafc; border-color:#cbd5e1; }
body[data-page="dashboard"] .profile-trigger .avatar {
  width:32px; height:32px; border-radius:50%;
  background:linear-gradient(135deg,#2d7a4f,#3a9967);
  color:#fff; display:flex; align-items:center; justify-content:center;
  font-weight:700; font-size:.78rem;
}
body[data-page="dashboard"] .profile-caret { color:#94a3b8; font-size:.7rem; }

body[data-page="dashboard"] .profile-dropdown {
  position:absolute; right:0; top:calc(100% + 8px);
  min-width:220px; background:#fff; border:1px solid #e2e8f0;
  border-radius:14px; box-shadow:0 18px 40px rgba(15,23,42,.12);
  padding:8px; z-index:1000; display:flex; flex-direction:column; gap:2px;
}
body[data-page="dashboard"] .profile-dropdown[hidden] { display:none; }
body[data-page="dashboard"] .profile-dropdown button {
  display:flex; align-items:center; gap:10px; padding:10px 12px;
  background:transparent; border:none; border-radius:9px; cursor:pointer;
  text-align:left; font-family:inherit; font-size:.9rem; color:#0f172a;
  font-weight:500;
}
body[data-page="dashboard"] .profile-dropdown button:hover { background:#f1f5f9; }
body[data-page="dashboard"] .profile-dropdown hr {
  border:none; border-top:1px solid #e2e8f0; margin:4px 0;
}
body[data-page="dashboard"] .profile-dropdown .pd-logout { color:#dc2626; }
body[data-page="dashboard"] .profile-dropdown .pd-logout:hover { background:#fef2f2; }

/* Hide the default user badge styles when on dashboard (we restyled it) */
body[data-page="dashboard"] .profile-menu { display:none; }
body[data-page="dashboard"] .profile-menu.is-logged { display:block; }

/* Recent diagnostics list */
body[data-page="dashboard"] .diag-recent {
  max-width:1320px; margin:32px auto 0; padding:0 5%;
}
body[data-page="dashboard"] .diag-recent-head {
  display:flex; align-items:center; justify-content:space-between;
  gap:14px; margin-bottom:14px; flex-wrap:wrap;
}
body[data-page="dashboard"] .diag-recent-head h3 {
  margin:0; color:#0f172a; font-size:1.15rem;
}
body[data-page="dashboard"] .diag-recent-list {
  display:grid; gap:10px;
}
body[data-page="dashboard"] .diag-recent-empty {
  background:#f8fafc; border:1px dashed #cbd5e1; padding:24px;
  border-radius:12px; color:#64748b; text-align:center; margin:0;
}
body[data-page="dashboard"] .diag-recent-item {
  display:flex; align-items:center; gap:14px; padding:14px 16px;
  background:#fff; border:1px solid #e2e8f0; border-left:4px solid #cbd5e1;
  border-radius:12px; transition:transform .15s ease, box-shadow .15s ease;
}
body[data-page="dashboard"] .diag-recent-item:hover { transform:translateY(-1px); box-shadow:0 6px 18px rgba(15,23,42,.06); }
body[data-page="dashboard"] .diag-recent-item.is-ok   { border-left-color:#22c55e; }
body[data-page="dashboard"] .diag-recent-item.is-warn { border-left-color:#f59e0b; }
body[data-page="dashboard"] .diag-recent-item.is-crit { border-left-color:#dc2626; background:#fef2f2; }
body[data-page="dashboard"] .diag-recent-item .dr-ic { font-size:1.6rem; }
body[data-page="dashboard"] .diag-recent-item .dr-body { flex:1; min-width:0; }
body[data-page="dashboard"] .diag-recent-item .dr-title { font-weight:600; color:#0f172a; }
body[data-page="dashboard"] .diag-recent-item .dr-sub   { color:#64748b; font-size:.85rem; }
body[data-page="dashboard"] .diag-recent-item .dr-meta  { text-align:right; }
body[data-page="dashboard"] .diag-recent-item .dr-conf  { font-weight:700; color:#0f172a; }
body[data-page="dashboard"] .diag-recent-item .dr-date  { color:#94a3b8; font-size:.78rem; }

/* Settings rows in profile module */
body[data-page="dashboard"] .set-row {
  display:flex; align-items:center; justify-content:space-between;
  gap:10px; padding:10px 0; border-top:1px solid #f1f5f9;
  color:#0f172a; font-size:.9rem;
}
body[data-page="dashboard"] .set-row:first-of-type { border-top:none; }
body[data-page="dashboard"] .set-row select {
  padding:6px 10px; border:1px solid #e2e8f0; border-radius:8px;
  background:#fff; color:#0f172a; font-family:inherit;
}
body[data-page="dashboard"] .set-row input[type="checkbox"] { transform:scale(1.15); }

/* Mobile menu user block (logged-in) */
body[data-page="dashboard"] .mobile-menu-user-block {
  display:flex; flex-direction:column; gap:6px; padding:12px 0;
}
body[data-page="dashboard"] .mobile-menu-user-block .mm-user-head {
  display:flex; align-items:center; gap:10px; padding:10px 12px;
  background:#f8fafc; border-radius:10px; margin-bottom:8px;
}
body[data-page="dashboard"] .mobile-menu-user-block button {
  text-align:left; padding:12px 14px; border:none; background:transparent;
  border-radius:8px; font-family:inherit; font-size:.95rem; color:#0f172a;
  cursor:pointer; font-weight:500;
}
body[data-page="dashboard"] .mobile-menu-user-block button:hover { background:#f1f5f9; }
body[data-page="dashboard"] .mobile-menu-user-block .mm-logout { color:#dc2626; }

body[data-page="dashboard"] .mobile-menu ul li button[data-mm-link] {
  display:flex; width:100%; text-align:left; padding:12px 14px;
  border:none; background:transparent; border-radius:8px; cursor:pointer;
  font-family:inherit; font-size:.95rem; color:#0f172a; font-weight:500;
}
body[data-page="dashboard"] .mobile-menu ul li button[data-mm-link]:hover { background:#f1f5f9; }

/* Responsive */
@media (max-width: 768px) {
  body[data-page="dashboard"] nav .nav-links.dash-modnav { display:none; }
  body[data-page="dashboard"] .profile-trigger span:not(.profile-caret):not(.avatar) { display:none; }
}

/* ============ Final pre-presentation overrides ============ */

/* No flicker: hide guest buttons on dashboard until proven guest. */
body[data-page="dashboard"] #guestButtons { display: none !important; }
body[data-page="dashboard"] #profileMenu { visibility: hidden; }
body[data-page="dashboard"].is-authed #profileMenu { visibility: visible; }

/* Empty-state cards inside CC panes */
.cc-empty {
  text-align: center;
  border: 1px dashed rgba(45, 122, 79, 0.25);
  background: rgba(255,255,255,0.6);
  padding: 36px 24px;
}
.cc-empty .cc-card-icon { font-size: 40px; opacity: 0.7; margin-bottom: 8px; }
.cc-empty h3 { margin: 6px 0 8px; color: var(--green, #2d7a4f); }
.cc-empty p { color: #5b6b62; max-width: 540px; margin: 0 auto; }

/* Demo badge in diagnostic results */
.demo-badge {
  background: linear-gradient(90deg, #fff8e1, #ffecb3);
  color: #7a5b00;
  border: 1px solid #f1c40f;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 0.92rem;
  line-height: 1.4;
}
.demo-badge strong { color: #5b4400; }

/* Footer buttons styled like links */
.footer-link {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: inherit; font: inherit; text-align: left;
}
.footer-link:hover { text-decoration: underline; opacity: 0.85; }

/* Settings rows */
.set-row { display:flex; align-items:center; gap:10px; margin:10px 0; font-size:.95rem; }
.set-row select { margin-left:auto; padding:6px 10px; border:1px solid #d6dcd2; border-radius:8px; background:#fff; }
.set-row input[type="checkbox"] { width:18px; height:18px; accent-color: var(--green, #2d7a4f); }

/* === Animation system v2 — single controller (agrismart-public.js) === */
/* Hidden initial state for the canonical reveal attribute. */
[data-animate]{
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s ease, transform .6s ease;
  will-change: opacity, transform;
}
[data-animate].is-animated{
  opacity: 1;
  transform: none;
}
/* Stagger via --animate-i set by the controller */
[data-animate]{ transition-delay: calc(var(--animate-i, 0) * 60ms); }

/* Progress bars: smooth width transition handled by controller */
.prog-fill,
.confidence-fill,
.pp-progress .fill,
.pp-visual-bar .fill,
.pc-prog .fill,
.dt-bar .fill,
.fill,
.prog-bar .prog-fill {
  transition: width 1.2s cubic-bezier(.2,.8,.2,1);
}

/* Safety net for legacy/orphan reveal classes that no longer have a controller.
   Excludes [data-animate]/.is-animated so the new controller stays authoritative. */
[data-reveal]:not([data-animate]),
[data-reveal-group] > *:not([data-animate]),
[data-float],
.reveal-init,
.reveal-in,
.anim-target,
.anim-in,
.fx-in,
.fx-list-in > *,
.in-view,
.is-in {
  opacity: 1 !important;
  transform: none !important;
  visibility: visible !important;
}

/* Reduced motion: snap everything visible */
@media (prefers-reduced-motion: reduce){
  [data-animate]{ opacity: 1 !important; transform: none !important; transition: none !important; }
  .prog-fill, .confidence-fill, .pp-progress .fill, .pp-visual-bar .fill,
  .pc-prog .fill, .dt-bar .fill, .fill { transition: none !important; }
}

/* ===== Dashboard demo cards (Phase 20 — realistic farm content) ===== */
.dd-card { display:flex; flex-direction:column; gap:8px; }
.dd-row  { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.dd-pill { font-size:.72rem; font-weight:600; padding:4px 10px; border-radius:999px;
           letter-spacing:.02em; text-transform:uppercase; }
.dd-pill-ok   { background:#e7f6ec; color:#1f6b3a; }
.dd-pill-info { background:#eaf2fb; color:#1d4f8a; }
.dd-pill-warn { background:#fff3df; color:#8a5b1d; }
.dd-pill-crit { background:#fde7ec; color:#a02438; }
.dd-meta { display:flex; flex-wrap:wrap; gap:14px; font-size:.82rem; color:#5b6b62;
           margin-top:6px; padding-top:8px; border-top:1px dashed #e3e8e1; }
.dd-meta span { display:inline-flex; align-items:center; gap:4px; }
.dd-row-list { display:flex; flex-direction:column; gap:6px; }
.dd-row-list .dd-li { display:flex; justify-content:space-between; gap:12px;
           padding:10px 12px; background:#f5f8f3; border-radius:8px; font-size:.88rem;
           border:1px solid #e8efe3; }
.dd-row-list .dd-li strong { color:#2d7a4f; }
.dd-row-list .dd-li .dd-li-r { color:#5b6b62; font-size:.82rem; }
.dd-timeline { display:flex; flex-direction:column; gap:8px; }
.dd-timeline .dd-tl-item { display:flex; gap:12px; padding:10px 12px;
           background:#fff; border:1px solid #e8efe3; border-radius:10px; }
.dd-timeline .dd-tl-ic { font-size:1.2rem; }
.dd-timeline .dd-tl-body { flex:1; }
.dd-timeline .dd-tl-title { font-weight:600; color:#1f3a2a; font-size:.92rem; }
.dd-timeline .dd-tl-sub   { font-size:.8rem; color:#5b6b62; margin-top:2px; }
.dd-timeline .dd-tl-time  { font-size:.75rem; color:#8a978d; white-space:nowrap; }
