/* =========================================================================
   AAC Pro Estimator - Redesign Coat (2026-06-07, Claude Code Mac session)
   Houzz-Pro-grade premium polish, applied ADDITIVELY. Loads LAST so it wins.
   Presentation only: colors, type, spacing, shadows, radii. No layout
   restructure, no id changes, no logic. Matches the approved prototype at
   _redesign_prototype/index.html. Reversible: remove the one <link> tag.
   Brand: navy #19195F, gold #C9A84C, Playfair Display + Montserrat.
   ========================================================================= */

:root {
  --rd-navy: #19195F;
  --rd-navy-2: #0d0a3e;
  --rd-gold: #C9A84C;
  --rd-gold-soft: #e3cd86;
  --rd-ink: #2D2D2D;
  --rd-muted: #6B7280;
  --rd-line: #e7e7ef;
  --rd-bg: #f4f4f8;
  --rd-card: #ffffff;
  --rd-green: #16a34a;
  --rd-radius: 16px;
  --rd-shadow: 0 6px 24px rgba(25, 25, 95, .08);
  --rd-shadow-sm: 0 2px 8px rgba(25, 25, 95, .07);
}

/* ---- page canvas: soft neutral so white cards read as premium ---------- */
body.aac-redesign,
body.aac-redesign .page,
body.aac-redesign .aac-mode-section {
  background: var(--rd-bg);
}

/* ===================== PREMIUM CARD (shared, all 5 modes) ================ */
body.aac-redesign .card {
  background: var(--rd-card);
  border: 1px solid var(--rd-line);
  border-radius: var(--rd-radius);
  box-shadow: var(--rd-shadow);
  overflow: hidden;
}
body.aac-redesign .card + .card { margin-top: 14px; }

body.aac-redesign .card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 16px;
  cursor: pointer;
  background: transparent;
}
body.aac-redesign .card-icon {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 10px;
  background: rgba(25, 25, 95, .07);
  color: var(--rd-navy);
  display: flex;
  align-items: center;
  justify-content: center;
}
body.aac-redesign .card-icon svg { width: 18px; height: 18px; }
body.aac-redesign .card-title {
  margin: 0;
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--rd-ink);
  letter-spacing: .1px;
}
body.aac-redesign .card-subtitle {
  margin: 1px 0 0;
  font-size: 11.5px;
  color: var(--rd-muted);
  font-weight: 500;
}
body.aac-redesign .card-chevron {
  margin-left: auto;
  width: 18px;
  height: 18px;
  color: var(--rd-muted);
  transition: transform .25s cubic-bezier(.32, 1, .55, 1);
}
/* respect the existing collapse mechanism (toggleCard adds .collapsed on body) */
body.aac-redesign .card:has(.card-body.collapsed) .card-chevron { transform: rotate(-90deg); }
body.aac-redesign .card-body { padding: 0 16px 16px; }

/* ===================== ESTIMATE TOP BAR (the hero) ====================== */
/* prototype's signature: navy gradient bar, project meta, one gold Send,
   secondary actions quiet. Scoped to the estimate toolbar only. */
body.aac-redesign .aac-estimate-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: linear-gradient(135deg, var(--rd-navy), var(--rd-navy-2));
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 14px;
  box-shadow: 0 8px 26px rgba(13, 10, 62, .22);
}
body.aac-redesign .aac-estimate-topbar-meta {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-width: 0;
  flex: 1;
}
body.aac-redesign .aac-estimate-topbar-title {
  font-family: 'Playfair Display', serif;
  font-size: 17px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.aac-redesign .aac-estimate-topbar-id,
body.aac-redesign .aac-estimate-topbar-revision {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--rd-gold-soft);
  letter-spacing: .3px;
}
body.aac-redesign .aac-estimate-topbar-divider { color: rgba(255, 255, 255, .4); }

body.aac-redesign .aac-estimate-topbar-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
/* base action button: quiet glass chip on the navy bar */
body.aac-redesign .aac-est-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 12.5px;
  padding: 9px 13px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .1);
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
  transition: background .18s, transform .12s;
}
body.aac-redesign .aac-est-btn:hover { background: rgba(255, 255, 255, .2); }
body.aac-redesign .aac-est-btn:active { transform: translateY(1px); }
body.aac-redesign .aac-est-btn-ghost { background: rgba(255, 255, 255, .08); }
/* Send: the one primary action, gold */
body.aac-redesign .aac-est-btn-primary {
  background: var(--rd-gold);
  color: #1a1530;
  border: none;
  font-weight: 700;
  padding: 10px 18px;
  box-shadow: 0 4px 14px rgba(201, 168, 76, .4);
}
body.aac-redesign .aac-est-btn-primary:hover { background: var(--rd-gold-soft); }
/* Create Schedule AI button keeps a subtle gold edge */
body.aac-redesign .aac-est-btn-ai { border-color: rgba(201, 168, 76, .5); }
body.aac-redesign .aac-ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 9px;
  font-weight: 700;
  background: rgba(201, 168, 76, .9);
  color: #1a1530;
  padding: 2px 5px;
  border-radius: 5px;
}
/* the Actions dropdown menu stays a clean white surface */
body.aac-redesign .aac-est-menu {
  background: #fff;
  color: var(--rd-ink);
  border: 1px solid var(--rd-line);
  border-radius: 12px;
  box-shadow: var(--rd-shadow);
  padding: 6px;
}
body.aac-redesign .aac-est-menu-item {
  color: var(--rd-ink);
  border-radius: 8px;
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
}
body.aac-redesign .aac-est-menu-item:hover { background: var(--rd-bg); }

/* phone: keep the bar to one tidy row, Send always visible, the quiet
   actions scroll horizontally instead of stacking into a tall block. */
@media (max-width: 600px) {
  /* two clean rows on phone: title line, then a Send-led scrollable chip row */
  body.aac-redesign .aac-estimate-topbar { flex-direction: column; align-items: stretch; gap: 10px; }
  body.aac-redesign .aac-estimate-topbar-meta { width: 100%; }
  body.aac-redesign .aac-estimate-topbar-actions {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 6px;
  }
  body.aac-redesign .aac-estimate-topbar-actions::-webkit-scrollbar { display: none; }
  body.aac-redesign .aac-est-btn { padding: 8px 12px; font-size: 12px; flex: 0 0 auto; }
  body.aac-redesign .aac-est-btn-primary { order: -1; }  /* Send leads the row */
  /* the primary CTA must read "Send" on phones, not be a bare icon.
     aac-tier2.css:453 hides labels with higher specificity than its own
     :456 re-show, so the live Send is icon-only. Force the label back. */
  body.aac-redesign .aac-estimate-topbar .aac-est-btn-primary span:not(.aac-ic):not([class*="aac-ic-"]) {
    display: inline !important;
  }
}

/* desktop: keep the navy bar clear of the fixed right icon rail (~56px strip) */
@media (min-width: 921px) {
  body.aac-redesign .aac-estimate-topbar { margin-right: 64px; }
  /* the mobile sticky totals bar is a phone-only element; it leaks into the
     top-left on desktop. Hide it on wide screens. */
  body.aac-redesign .results-box-mobile-sticky-totals { display: none !important; }
}

/* ===================== READINESS BAR (tighten) ========================== */
body.aac-redesign .progress-container.card {
  padding: 13px 16px;
  box-shadow: var(--rd-shadow-sm);
}
body.aac-redesign .progress-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--rd-muted);
  font-weight: 700;
}
body.aac-redesign .progress-bar {
  background: var(--rd-line);
  border-radius: 20px;
  height: 6px;
  overflow: hidden;
  margin-top: 8px;
}
body.aac-redesign .progress-fill {
  background: linear-gradient(90deg, var(--rd-navy), var(--rd-gold));
  height: 100%;
  border-radius: 20px;
}

/* ===================== ADD-ITEM FORM + LINE ITEMS ======================= */
body.aac-redesign #addItemForm label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--rd-muted);
  font-weight: 600;
}
body.aac-redesign #addItemForm input {
  border: 1px solid var(--rd-line);
  border-radius: 10px;
  font-size: 16px;            /* keep 16px so iOS does not zoom on focus */
  padding: 11px 12px;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
body.aac-redesign #addItemForm input:focus {
  outline: none;
  border-color: var(--rd-navy);
  box-shadow: 0 0 0 3px rgba(25, 25, 95, .1);
}
body.aac-redesign #addItemForm .btn-primary,
body.aac-redesign #projectItemsCard .btn-primary {
  background: var(--rd-navy);
  color: #fff;
  border: none;
  border-radius: 11px;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 14px;
  padding: 12px 16px;
  box-shadow: var(--rd-shadow-sm);
}
body.aac-redesign #addItemForm .btn-primary:hover { background: var(--rd-navy-2); }

body.aac-redesign .list-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0 10px;
}
body.aac-redesign .list-title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 13.5px;
  color: var(--rd-ink);
}
body.aac-redesign .item-count { font-size: 11.5px; color: var(--rd-muted); }

/* clean table-like rows (matches prototype's grouped item rows) */
body.aac-redesign .list-items .item-row {
  border-top: 1px dashed var(--rd-line);
  padding: 11px 2px;
}
body.aac-redesign .list-items .item-row:first-child { border-top: none; }

/* compact totals summary */
body.aac-redesign .results-box {
  margin-top: 8px;
  border-top: 2px solid var(--rd-navy);
  padding-top: 12px;
}
body.aac-redesign .results-row { display: flex; justify-content: space-between; align-items: baseline; }
body.aac-redesign .results-label {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--rd-navy);
}
body.aac-redesign .results-total {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 22px;
  color: var(--rd-navy);
}

/* ===================== PAGE HEADERS (Home/Pipeline/Cockpit/Books) ======= */
body.aac-redesign .page-header { padding-bottom: 6px; }
body.aac-redesign .text-mode-title,
body.aac-redesign .page-header__title {
  font-family: 'Playfair Display', serif;
  font-weight: 600;
  color: var(--rd-navy);
  letter-spacing: .2px;
}
body.aac-redesign .page-header__subtitle,
body.aac-redesign .aac-mode-subtitle {
  color: var(--rd-muted);
  font-size: 13px;
}

/* pills: consistent quiet chips with the gold/navy thread */
body.aac-redesign .pill {
  border-radius: 20px;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .2px;
}
body.aac-redesign .pill--accent { background: rgba(201, 168, 76, .16); color: #8a6d1f; }

/* ===================== MODE NAV (top tabs) ============================== */
body.aac-redesign .app-shell__nav-item.is-active,
body.aac-redesign .aac-mode-link[aria-current="true"] {
  color: var(--rd-navy);
}

/* ===================== ADD/TOOLS SHEET HARMONY ========================== */
/* the overlay already styles the sheet; just align the launcher to brand */
body.aac-redesign .aac-rd-fab {
  background: var(--rd-navy);
  box-shadow: 0 8px 24px rgba(25, 25, 95, .4);
}

/* ===================== MISC POLISH ====================================== */
body.aac-redesign .results-box,
body.aac-redesign .list-section { font-family: 'Montserrat', sans-serif; }
body.aac-redesign ::selection { background: rgba(201, 168, 76, .3); }
