/* ===== Nori site animations (shared across index.html and role pages) ===== */
    /* ===== Slack Mock (shared) ===== */
    .slack-mock {
      max-width: 560px;
      margin: 0 auto;
      border: 1px solid var(--border);
      border-radius: 10px;
      overflow: hidden;
      text-align: left;
      background: var(--surface);
    }
    .slack-mock-header {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 12px 16px;
      border-bottom: 1px solid var(--border);
      background: var(--surface-raised);
    }
    .slack-mock-hash {
      font-size: 16px;
      color: var(--text-muted);
      font-weight: 700;
    }
    .slack-mock-channel {
      font-size: 13px;
      font-weight: 600;
      color: var(--text-secondary);
    }
    .slack-mock-body {
      padding: 16px;
      display: flex;
      flex-direction: column;
      gap: 16px;
    }
    .slack-msg {
      display: flex;
      gap: 10px;
      align-items: flex-start;
    }
    .slack-avatar {
      width: 32px;
      height: 32px;
      border-radius: 6px;
      flex-shrink: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 14px;
      font-weight: 700;
      color: #fff;
    }
    .slack-avatar-nori { background: #42be65; }
    .slack-msg-content { flex: 1; min-width: 0; }
    .slack-msg-header {
      display: flex;
      align-items: baseline;
      gap: 8px;
      margin-bottom: 3px;
    }
    .slack-msg-name {
      font-size: 13px;
      font-weight: 700;
      color: var(--text);
    }
    .slack-msg-time {
      font-size: 11px;
      color: var(--text-muted);
    }
    .slack-msg-app {
      font-size: 10px;
      color: var(--text-muted);
      background: var(--surface);
      padding: 1px 5px;
      border-radius: 3px;
    }
    .slack-msg-text {
      font-size: 14px;
      color: var(--text-secondary);
      line-height: 1.55;
    }
    .slack-msg-text code {
      font-size: 12px;
      padding: 1px 5px;
    }
    .mention {
      color: #42be65;
      background: rgba(66, 190, 101, 0.15);
      padding: 1px 4px;
      border-radius: 3px;
      font-weight: 500;
    }
    .slack-progress {
      font-family: var(--mono);
      font-size: 12px;
      color: var(--text-muted);
      background: var(--surface);
      border-radius: 6px;
      padding: 10px 12px;
      margin-top: 8px;
      line-height: 1.7;
    }
    .slack-progress .done { color: #42be65; }
    .slack-pr-link {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      margin-top: 6px;
      padding: 6px 12px;
      background: rgba(120, 169, 255, 0.1);
      border: 1px solid rgba(120, 169, 255, 0.25);
      border-radius: 6px;
      font-size: 13px;
      color: #78a9ff;
      text-decoration: none;
      font-weight: 500;
    }
    .slack-file-link {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      margin-top: 6px;
      padding: 6px 12px;
      background: rgba(66, 190, 101, 0.1);
      border: 1px solid rgba(66, 190, 101, 0.25);
      border-radius: 6px;
      font-size: 13px;
      color: #42be65;
      text-decoration: none;
      font-weight: 500;
    }
    .slack-action-link {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      margin-top: 6px;
      padding: 6px 12px;
      background: rgba(190, 149, 255, 0.1);
      border: 1px solid rgba(190, 149, 255, 0.25);
      border-radius: 6px;
      font-size: 13px;
      color: #be95ff;
      text-decoration: none;
      font-weight: 500;
    }
    .slack-control-card {
      margin-top: 8px;
      border: 1px solid var(--border);
      border-radius: 8px;
      overflow: hidden;
    }
    .slack-control-status {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 10px 12px;
      background: var(--surface);
      font-size: 12px;
      color: var(--text-secondary);
    }
    .slack-control-dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: #42be65;
    }
    .slack-control-buttons {
      display: flex;
      border-top: 1px solid var(--border);
    }
    .slack-control-btn {
      flex: 1;
      padding: 8px;
      font-size: 12px;
      font-weight: 500;
      color: var(--text-secondary);
      text-align: center;
      background: transparent;
    }
    .slack-control-btn + .slack-control-btn {
      border-left: 1px solid var(--border);
    }

    /* ===== Hero Chat Animation ===== */
    .hero-animation-container {
      max-width: 560px;
      margin: 0 auto;
      border-radius: 10px;
    }
    /* The hero now holds the security denial animation, whose beats stack
       taller than a fixed clip; bound the message body and let it auto-scroll
       to the newest beat instead of clipping the card. */
    #security-chat-body {
      max-height: 360px;
      overflow: hidden;
    }
    #hero-chat-animation {
      transition: transform 0.8s cubic-bezier(0.25, 0.1, 0.25, 1);
    }
    #hero-chat-body {
      max-height: 240px;
      overflow: hidden;
      padding-bottom: 16px;
      transition: opacity 0.6s ease-out;
    }
    #hero-chat-body.fade-out { opacity: 0; }
    .hero-chat-msg {
      display: flex;
      gap: 10px;
      align-items: flex-start;
      opacity: 0;
      transform: translateY(20px);
      transition: opacity 0.4s ease-out, transform 0.4s ease-out;
      flex-shrink: 0;
      margin-bottom: 8px;
    }
    .hero-chat-msg:last-child {
      margin-bottom: 20px;
    }
    .hero-chat-msg.enter {
      opacity: 1;
      transform: translateY(0);
    }
    .hero-chat-avatar {
      width: 32px;
      height: 32px;
      border-radius: 6px;
      flex-shrink: 0;
      overflow: hidden;
    }
    .hero-chat-avatar img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }
    .hero-chat-avatar svg { display: block; }
    .hero-chat-avatar-fallback {
      width: 32px;
      height: 32px;
      border-radius: 6px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 14px;
      font-weight: 700;
      color: #fff;
    }
    .hero-chat-cursor {
      display: inline-block;
      width: 2px;
      height: 1em;
      background: var(--text-secondary);
      vertical-align: text-bottom;
      animation: hero-cursor-blink 0.7s step-end infinite;
      margin-left: 1px;
    }
    @keyframes hero-cursor-blink {
      0%, 100% { opacity: 1; }
      50% { opacity: 0; }
    }
    .hero-chat-spinner {
      display: flex;
      align-items: center;
      gap: 12px;
    }
    .hero-spinner-dots {
      display: flex;
      gap: 4px;
      align-items: center;
    }
    .hero-spinner-dot {
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: var(--accent);
      animation: hero-dot-bounce 1.4s infinite ease-in-out both;
    }
    .hero-spinner-dot:nth-child(1) { animation-delay: -0.32s; }
    .hero-spinner-dot:nth-child(2) { animation-delay: -0.16s; }
    .hero-spinner-dot:nth-child(3) { animation-delay: 0s; }
    @keyframes hero-dot-bounce {
      0%, 80%, 100% { transform: scale(0.4); opacity: 0.4; }
      40% { transform: scale(1); opacity: 1; }
    }
    .hero-spinner-status {
      font-size: 12px;
      color: var(--text-muted);
      font-style: italic;
    }
    .hero-chat-plan {
      font-family: var(--mono);
      font-size: 12px;
      color: var(--text-muted);
      background: var(--surface-raised);
      border-radius: 6px;
      padding: 10px 12px;
      margin-top: 8px;
      line-height: 1.7;
      max-height: 120px;
      overflow: hidden;
      -webkit-mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
      mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
    }
    .hero-int-pill {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 1px 6px 1px 4px;
      margin: 0 1px;
      border: 1px solid var(--border);
      border-radius: 5px;
      background: var(--surface-raised);
      font-size: 12px;
      font-weight: 500;
      color: var(--text-secondary);
      line-height: 1.4;
      white-space: nowrap;
      vertical-align: middle;
      transition: border-color 0.3s ease, background 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
    }
    .hero-int-pill-icon {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 13px;
      height: 13px;
      flex-shrink: 0;
      color: var(--text-muted);
    }
    .hero-int-pill-icon svg { width: 13px; height: 13px; display: block; }
    .hero-int-pill-mono {
      border-radius: 3px;
      color: #fff;
      font-size: 8px;
      font-weight: 700;
      line-height: 1;
    }
    .hero-int-pill--lit {
      border-color: var(--accent);
      background: rgba(66, 190, 101, 0.12);
      color: var(--text);
      box-shadow: 0 0 0 1px rgba(66, 190, 101, 0.35), 0 0 10px rgba(66, 190, 101, 0.25);
    }
    .hero-int-pill--lit .hero-int-pill-icon { color: var(--accent); }
    .hero-spinner-status .hero-int-pill { font-style: normal; }
    .hero-task-result {
      display: inline-flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 5px;
      margin-top: 2px;
      font-size: 14px;
      font-weight: 500;
      color: var(--text);
      line-height: 1.5;
    }
    .hero-task-check {
      color: var(--accent);
      font-weight: 700;
    }
    @media (prefers-reduced-motion: reduce) {
      .hero-chat-msg {
        transition: none !important;
        animation: none !important;
      }
      .hero-int-pill {
        transition: none !important;
      }
      .hero-spinner-dot {
        animation: none !important;
        opacity: 1;
        transform: scale(1);
      }
      .hero-chat-cursor {
        animation: none !important;
        opacity: 1;
      }
      #hero-chat-body {
        transition: none !important;
      }
      #hero-chat-animation {
        transition: none !important;
        transform: none !important;
      }
    }

    /* ===== Team Chat Animation ===== */
    .team-animation-container {
      max-width: 560px;
      height: 360px;
      margin: 0 auto;
      overflow: hidden;
      border-radius: 10px;
    }
    #team-chat-body {
      max-height: 320px;
      overflow: hidden;
      padding-bottom: 16px;
      transition: opacity 0.6s ease-out;
    }
    #team-chat-body.fade-out { opacity: 0; }
    .team-chat-msg {
      display: flex;
      gap: 10px;
      align-items: flex-start;
      opacity: 0;
      transform: translateY(20px);
      transition: opacity 0.4s ease-out, transform 0.4s ease-out;
      flex-shrink: 0;
      margin-bottom: 8px;
    }
    .team-chat-msg:last-child {
      margin-bottom: 20px;
    }
    .team-chat-msg.enter {
      opacity: 1;
      transform: translateY(0);
    }
    @media (prefers-reduced-motion: reduce) {
      .team-chat-msg {
        transition: none !important;
        animation: none !important;
      }
      #team-chat-body {
        transition: none !important;
      }
    }

    /* ===== Security Animation ===== */
    #security-chat-body {
      min-height: 320px;
      max-height: 320px;
      overflow: hidden;
      padding-bottom: 16px;
      transition: opacity 0.6s ease-out;
    }
    #security-chat-body.fade-out { opacity: 0; }
    .slack-perm {
      margin-top: 8px;
      border: 1px solid var(--border);
      border-radius: 8px;
      overflow: hidden;
      font-size: 13px;
    }
    .slack-perm-row {
      display: flex;
      align-items: center;
      gap: 9px;
      padding: 9px 12px;
      line-height: 1.4;
      color: var(--text-secondary);
    }
    .slack-perm-row + .slack-perm-row {
      border-top: 1px solid var(--border);
    }
    .slack-perm-deny { background: rgba(250, 68, 83, 0.06); }
    .slack-perm-allow { background: rgba(66, 190, 101, 0.06); }
    .slack-perm-icon {
      flex-shrink: 0;
      width: 16px;
      height: 16px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border-radius: 50%;
      font-size: 11px;
      font-weight: 700;
      line-height: 1;
    }
    .slack-perm-deny .slack-perm-icon { background: rgba(250, 68, 83, 0.18); color: #fa4453; }
    .slack-perm-allow .slack-perm-icon { background: rgba(66, 190, 101, 0.18); color: #42be65; }
    .slack-perm-deny .slack-perm-text { text-decoration: line-through; text-decoration-color: rgba(250, 68, 83, 0.55); }
    @media (prefers-reduced-motion: reduce) {
      #security-chat-body { transition: none !important; }
    }

    /* ===== Developer Animation ===== */
    #dev-chat-body {
      max-height: 360px;
      overflow: hidden;
      padding-bottom: 16px;
      transition: opacity 0.6s ease-out;
    }
    #dev-chat-body.fade-out { opacity: 0; }
    @media (prefers-reduced-motion: reduce) {
      #dev-chat-body { transition: none !important; }
    }
