/*
  AAC Pro Estimator V104.1 — Right Rail (Tier 3.1)
  Extracted from V104.1_PATCH_PACK/12_RIGHT_RAIL/right-rail.html
  Brand Identity Lock: light cream surfaces, navy #19195F accent, gold #C9A84C highlights.
*/

  :root {
    --aac-navy: #19195F;
    --aac-gold: #C9A84C;
    --aac-cream: #fbfbf6;
    --aac-bg: #f8f9fa;
    --aac-border: #e5e7eb;
    --aac-text: #1a1a1a;
    --aac-text-muted: #6b7280;
    --aac-hover-gold: rgba(201, 168, 76, 0.08);
    --aac-active-gold: rgba(201, 168, 76, 0.15);
  }

  * { box-sizing: border-box; }

  body {
    font-family: 'Montserrat', sans-serif;
    background: #ffffff;
    color: var(--aac-text);
    margin: 0;
    padding: 0;
  }

  /* ===== RAIL CONTAINER ===== */
  .aac-right-rail {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    z-index: 200;
    display: flex;
    flex-direction: row;
    transition: width 0.22s cubic-bezier(0.32,1,0.55,1);
    width: 56px;
  }

  .aac-right-rail.is-expanded {
    width: 416px; /* 56 icon strip + 360 panel */
  }

  /* ===== ICON STRIP ===== */
  .aac-rail-strip {
    width: 56px;
    background: var(--aac-cream);
    border-left: 1px solid var(--aac-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 16px;
    gap: 4px;
    flex-shrink: 0;
  }

  .aac-rail-tab {
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    border-left: 3px solid transparent;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--aac-text-muted);
    position: relative;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
  }

  .aac-rail-tab:hover {
    background: var(--aac-hover-gold);
    color: var(--aac-navy);
  }

  .aac-rail-tab.is-active {
    background: var(--aac-active-gold);
    color: var(--aac-navy);
    border-left-color: var(--aac-gold);
  }

  .aac-rail-tab .aac-tab-tooltip {
    position: absolute;
    right: 52px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--aac-navy);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
  }

  .aac-rail-tab:hover .aac-tab-tooltip {
    opacity: 1;
  }

  /* AI tabs sparkle */
  .aac-rail-tab.is-ai::after {
    content: '';
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background: var(--aac-gold);
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(201, 168, 76, 0.6);
  }

  /* ===== PANEL ===== */
  .aac-rail-panel {
    width: 360px;
    background: var(--aac-cream);
    border-left: 1px solid var(--aac-border);
    overflow-y: auto;
    display: none;
    flex-direction: column;
  }

  .aac-right-rail.is-expanded .aac-rail-panel {
    display: flex;
  }

  .aac-panel-header {
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--aac-border);
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 2;
  }

  .aac-panel-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 18px;
    color: var(--aac-navy);
    margin: 0;
  }

  .aac-panel-close {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--aac-text-muted);
    font-size: 18px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .aac-panel-close:hover {
    background: var(--aac-hover-gold);
    color: var(--aac-navy);
  }

  .aac-panel-body {
    padding: 16px 20px 24px;
  }

  .aac-panel-search {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--aac-border);
    border-radius: 6px;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    margin-bottom: 14px;
    background: #ffffff;
  }

  .aac-panel-search:focus {
    outline: none;
    border-color: var(--aac-gold);
  }

  /* ===== LIST ITEMS ===== */
  .aac-rail-item {
    background: #ffffff;
    border: 1px solid var(--aac-border);
    border-radius: 6px;
    padding: 12px 14px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
  }

  .aac-rail-item:hover {
    border-color: var(--aac-gold);
    box-shadow: 0 1px 3px rgba(201, 168, 76, 0.15);
  }

  .aac-rail-item-title {
    font-weight: 600;
    font-size: 13px;
    color: var(--aac-text);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .aac-rail-item-meta {
    font-size: 11px;
    color: var(--aac-text-muted);
  }

  .aac-rail-item-price {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    color: var(--aac-navy);
    font-size: 13px;
    margin-left: auto;
  }

  .aac-rail-item-row {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .aac-ai-pill {
    display: inline-block;
    background: var(--aac-gold);
    color: #ffffff;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  /* ===== AI ACTION CARD ===== */
  .aac-ai-action-card {
    background: linear-gradient(135deg, #ffffff 0%, var(--aac-cream) 100%);
    border: 2px dashed var(--aac-gold);
    border-radius: 10px;
    padding: 22px 18px;
    text-align: center;
    margin-bottom: 14px;
  }

  .aac-ai-action-card-icon {
    width: 48px;
    height: 48px;
    background: var(--aac-gold);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    margin-bottom: 10px;
  }

  .aac-ai-action-card-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 16px;
    color: var(--aac-navy);
    margin: 0 0 6px;
  }

  .aac-ai-action-card-desc {
    font-size: 12px;
    color: var(--aac-text-muted);
    margin: 0 0 14px;
    line-height: 1.4;
  }

  .aac-ai-action-btn {
    background: var(--aac-navy);
    color: #ffffff;
    border: 2px solid var(--aac-navy);
    padding: 9px 18px;
    border-radius: 6px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s ease;
  }

  .aac-ai-action-btn:hover {
    background: var(--aac-gold);
    border-color: var(--aac-gold);
  }

  .aac-section-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--aac-text-muted);
    margin: 14px 0 8px;
  }

  /* ===== MOBILE FAB ===== */
  .aac-rail-fab {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    background: var(--aac-navy);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(25, 25, 95, 0.3);
    cursor: pointer;
    z-index: 199;
    align-items: center;
    justify-content: center;
  }

  @media (max-width: 768px) {
    .aac-right-rail { display: none; }
    .aac-right-rail.is-mobile-open {
      display: flex;
      width: 100vw;
    }
    .aac-right-rail.is-mobile-open .aac-rail-panel {
      display: flex;
      width: calc(100vw - 56px);
    }
    .aac-rail-fab { display: flex; }
  }


/* (Demo .demo-page rules removed — only host page content uses the rail) */
