/* =================================================================
   Contribution Review AI, FY26
   Styles faithful to the Claude Design files (AI Tool + Statement of
   Value). The brand font is Good Headline Pro; it is not bundled, so
   the stacks below degrade gracefully to system fonts.
   Two scopes: .cc-* for the chat app, .sov-* for the invoice.
   ================================================================= */

:root {
  --cc-red: #DC241E;
  --cc-red-dark: #B01D18;
  --cc-green: #2D7A4A;
  --cc-ink: #222;
  --cc-paper: #FBFAF7;
  --cc-line: #ece7dd;
  /* Brand display font with graceful system fallback */
  --cc-display: 'Good Headline Pro', 'Arial Black', 'Helvetica Neue', Arial, sans-serif;
  --cc-body: Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--cc-paper);
  font-family: var(--cc-body);
  color: var(--cc-ink);
}

.cc-visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Brand wordmark (stands in for the 99 Bikes logo image) ---- */
.cc-wordmark {
  display: inline-flex;
  align-items: baseline;
  font-family: var(--cc-display);
  font-weight: 900;
  letter-spacing: .04em;
  line-height: 1;
}
.cc-wordmark b {
  color: var(--cc-red);
  font-weight: 900;
  margin-right: .12em;
}
.cc-wordmark--light { font-size: 19px; color: #fff; }
.cc-wordmark--dark { font-size: 24px; color: var(--cc-ink); }

/* =================================================================
   APP SHELL
   ================================================================= */
.ccApp {
  height: 100dvh;
  min-height: 600px;
  width: 100%;
  display: flex;
  background: var(--cc-paper);
  overflow: hidden;
  color: var(--cc-ink);
}

/* ---------------------- SIDEBAR ---------------------- */
.cc-sidebar {
  width: 288px;
  flex: none;
  background: #1c1916;
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
}
.cc-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 6px 0;
}
.cc-brand-label {
  font-family: var(--cc-display);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: .14em;
  color: #7f7a70;
  line-height: 1.3;
  text-transform: uppercase;
}
.cc-review-card {
  margin: 18px 0 4px;
  padding: 13px 14px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 6px;
}
.cc-review-label {
  font-family: var(--cc-display);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: .16em;
  color: #8a8478;
  line-height: 1;
  text-transform: uppercase;
}
.cc-review-name-row { display: flex; align-items: center; gap: 8px; margin-top: 9px; }
.cc-dot-live {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #3FB071;
  flex: none;
  box-shadow: 0 0 0 3px rgba(63,176,113,.22);
}
.cc-review-name {
  font-family: var(--cc-display);
  font-weight: 900;
  font-size: 16px;
  letter-spacing: .01em;
  color: #fff;
  line-height: 1;
}
.cc-review-role { font-size: 11.5px; color: #8a8478; margin-top: 6px; line-height: 1.35; }
.cc-recent-label {
  font-family: var(--cc-display);
  font-weight: 700;
  font-size: 9.5px;
  letter-spacing: .16em;
  color: #6e685e;
  text-transform: uppercase;
  margin: 22px 6px 9px;
}
.cc-recent {
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow-y: auto;
  flex: 1;
  margin: 0 -4px;
  padding: 0 4px;
}
.cc-recent-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  color: #8f897d;
  font-family: var(--cc-body);
  font-size: 12.5px;
  padding: 8px 11px;
  border-radius: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cc-recent-item svg { flex: none; opacity: .6; }
.cc-recent-item span { overflow: hidden; text-overflow: ellipsis; }
.cc-sidebar-foot {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,.09);
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.cc-sov-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  background: var(--cc-red);
  color: #fff;
  border: 0;
  cursor: pointer;
  font-family: var(--cc-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .02em;
  padding: 12px 14px;
  border-radius: 3px;
  transition: background .2s cubic-bezier(.25,.1,.25,1);
}
.cc-sov-btn:hover { background: var(--cc-red-dark); }
.cc-bcorp-row { display: flex; align-items: center; gap: 8px; padding: 0 2px; }
.cc-bcorp {
  font-family: var(--cc-display);
  font-weight: 700;
  font-size: 9.5px;
  letter-spacing: .1em;
  color: #9c9588;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px;
  padding: 5px 10px;
  white-space: nowrap;
}
.cc-bcorp-note { font-size: 10px; color: #6e685e; line-height: 1.3; }

/* ---------------------- MAIN ---------------------- */
.cc-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--cc-paper);
  position: relative;
}
.cc-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 28px;
  border-bottom: 1px solid var(--cc-line);
  background: rgba(251,250,247,.92);
  flex: none;
}
.cc-avatar {
  border-radius: 50%;
  background: var(--cc-red);
  color: #fff;
  font-family: var(--cc-display);
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.cc-avatar--header { width: 30px; height: 30px; font-size: 11.5px; }
.cc-avatar--msg { width: 32px; height: 32px; font-size: 12px; margin-top: 2px; }
.cc-header-text { min-width: 0; }
.cc-header-title {
  font-family: var(--cc-display);
  font-weight: 900;
  font-size: 15px;
  letter-spacing: .01em;
  color: var(--cc-ink);
  line-height: 1.05;
}
.cc-header-sub { font-size: 11.5px; color: #9a9384; margin-top: 2px; line-height: 1; }

/* ---------------------- THREAD ---------------------- */
.cc-thread { flex: 1; overflow-y: auto; }
.cc-thread-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 30px 28px 12px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.cc-msg { animation: ccRise .3s cubic-bezier(.25,.1,.25,1); }
.cc-msg--user { display: flex; justify-content: flex-end; }
.cc-msg--user .cc-bubble {
  background: var(--cc-ink);
  color: #fff;
  border-radius: 16px 4px 16px 16px;
  padding: 11px 15px;
  font-size: 13.5px;
  line-height: 1.5;
  max-width: 78%;
  font-weight: 500;
}
.cc-msg--bot { display: flex; gap: 13px; align-items: flex-start; }
.cc-msg--bot .cc-bubble {
  background: #fff;
  border: 1px solid var(--cc-line);
  border-radius: 4px 16px 16px 16px;
  padding: 15px 18px;
  font-size: 13.5px;
  line-height: 1.55;
  color: #2a2a2a;
  max-width: 100%;
  box-shadow: 0 1px 3px rgba(40,34,24,.05);
}
.cc-bubble p { margin: 0 0 10px; }
.cc-bubble p:last-child { margin-bottom: 0; }
.cc-bubble p.cc-tight { margin-bottom: 4px; }
.cc-em {
  font-family: var(--cc-display);
  font-style: italic;
  font-weight: 700;
  color: var(--cc-red);
}
.cc-green { color: var(--cc-green); }

/* typing indicator */
.cc-typing {
  background: #fff;
  border: 1px solid var(--cc-line);
  border-radius: 4px 16px 16px 16px;
  padding: 16px 18px;
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.cc-typing span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #c9c2b4;
  animation: ccDot 1.2s infinite ease-in-out;
}
.cc-typing span:nth-child(2) { animation-delay: .18s; }
.cc-typing span:nth-child(3) { animation-delay: .36s; }

/* projects list */
.cc-list { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.cc-list li { display: flex; gap: 11px; }
.cc-bullet { width: 7px; height: 7px; background: var(--cc-red); flex: none; margin-top: 6px; }
.cc-item-name {
  font-family: var(--cc-display);
  font-weight: 900;
  font-size: 13.5px;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--cc-ink);
}
.cc-item-desc { color: #555; line-height: 1.45; margin-top: 1px; font-size: 13.5px; }

/* stat grid */
.cc-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; margin: 13px 0 11px; }
.cc-stat { background: #F6F2EA; border: 1px solid var(--cc-line); border-radius: 4px; padding: 13px; }
.cc-stat--green { background: #EAF3ED; border-color: #cfe3d6; }
.cc-stat-num { font-family: var(--cc-display); font-weight: 900; font-size: 32px; line-height: .85; color: var(--cc-ink); }
.cc-stat-num--red { color: var(--cc-red); }
.cc-stat-num--green { color: var(--cc-green); }
.cc-stat-label { font-size: 11px; color: #8a857c; margin-top: 7px; line-height: 1.2; }
.cc-stat-label--green { color: #6b8c78; }

/* testimonial cards */
.cc-quotes { display: flex; flex-direction: column; gap: 10px; margin: 11px 0; }
.cc-quote {
  margin: 0;
  background: #F6F2EA;
  border-left: 3px solid #d6cfbe;
  padding: 12px 14px;
  font-style: italic;
  color: #9a9384;
  font-size: 13.5px;
  line-height: 1.45;
}
.cc-quote--filled { color: #444; font-style: normal; border-left-color: var(--cc-red); }
.cc-quote cite { display: block; margin-top: 7px; font-style: normal; font-size: 11px; color: #b3ac9d; font-weight: 700; }
.cc-note {
  margin: 0;
  font-size: 12px;
  color: #8a857c;
  background: #FBF4E1;
  border: 1px solid #efe3c0;
  border-radius: 4px;
  padding: 9px 12px;
  line-height: 1.45;
}

/* ---------------------- COMPOSER ---------------------- */
.cc-composer {
  padding: 10px 28px 22px;
  background: linear-gradient(180deg, rgba(251,250,247,0), var(--cc-paper) 30%);
  flex: none;
}
.cc-chips { max-width: 760px; margin: 0 auto 11px; display: flex; flex-wrap: wrap; gap: 8px; }
.cc-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid #e3ddd2;
  color: var(--cc-ink);
  cursor: pointer;
  font-family: var(--cc-display);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: .01em;
  padding: 7px 13px;
  border-radius: 999px;
  transition: all .2s cubic-bezier(.25,.1,.25,1);
}
.cc-chip:hover { border-color: var(--cc-red); color: var(--cc-red-dark); }
.cc-chip-caret { color: var(--cc-red); font-weight: 900; font-size: 13px; line-height: 1; }
.cc-inputbar {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  gap: 10px;
  align-items: center;
  background: #fff;
  border: 1px solid #e3ddd2;
  border-radius: 4px;
  padding: 6px 6px 6px 18px;
  box-shadow: 0 2px 12px rgba(40,34,24,.06);
}
.cc-inputbar input {
  flex: 1;
  border: 0;
  outline: 0;
  font-family: var(--cc-body);
  font-size: 13.5px;
  color: var(--cc-ink);
  background: transparent;
  min-width: 0;
}
.cc-send {
  border: 0;
  cursor: pointer;
  background: var(--cc-red);
  color: #fff;
  border-radius: 2px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  transition: background .2s cubic-bezier(.25,.1,.25,1);
}
.cc-send:hover { background: var(--cc-red-dark); }
.cc-disclaimer { max-width: 760px; margin: 9px auto 0; text-align: center; font-size: 11px; color: #b3ac9d; }

/* =================================================================
   INVOICE OVERLAY
   ================================================================= */
.ccOvl {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(34,30,22,.55);
  overflow: auto;
  padding: 26px 14px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  animation: ccOvl .2s ease;
}
.ccOvl[hidden] { display: none; }
.cc-ovl-card { width: 210mm; max-width: 100%; }
.ccBar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--cc-ink);
  color: #fff;
  padding: 12px 16px;
  border-radius: 6px 6px 0 0;
}
.cc-ovl-title {
  font-family: var(--cc-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.cc-ovl-actions { display: flex; gap: 8px; }
.cc-ovl-print, .cc-ovl-close {
  border: 0;
  cursor: pointer;
  font-family: var(--cc-display);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .02em;
  padding: 8px 13px;
  border-radius: 2px;
}
.cc-ovl-print { display: inline-flex; align-items: center; gap: 7px; background: var(--cc-red); color: #fff; }
.cc-ovl-print:hover { background: var(--cc-red-dark); }
.cc-ovl-close { background: rgba(255,255,255,.14); color: #fff; }
.cc-ovl-close:hover { background: rgba(255,255,255,.26); }
.ccDoc {
  background: #FCFBF8;
  border-radius: 0 0 6px 6px;
  overflow: hidden;
  animation: ccDoc .3s cubic-bezier(.25,.1,.25,1);
}

/* ---- the A4 document ---- */
.sov-page { padding: 15mm 15mm 13mm; position: relative; font-family: var(--cc-body); color: var(--cc-ink); }
.sov-rule { position: absolute; left: 0; top: 0; right: 0; height: 5px; background: var(--cc-red); }
.sov-masthead { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; }
.sov-logo { margin-bottom: 8px; }
.sov-org { font-size: 9px; color: #a09a8e; text-transform: uppercase; letter-spacing: .14em; font-weight: 700; }
.sov-kicker { font-family: var(--cc-display); font-weight: 700; font-size: 10px; color: var(--cc-red); text-transform: uppercase; letter-spacing: .2em; margin-top: 18px; }
.sov-doctitle { font-family: var(--cc-display); font-weight: 900; font-size: 30px; color: var(--cc-ink); letter-spacing: -.01em; text-transform: uppercase; line-height: .95; margin-top: 5px; }
.sov-meta { border: 1px solid #d8d2c6; min-width: 255px; }
.sov-meta-row { display: grid; grid-template-columns: 1fr 1.15fr; border-bottom: 1px solid #e7e1d6; }
.sov-meta-row--last { border-bottom: 0; }
.sov-meta-k { background: #F4F0E8; padding: 6px 10px; font-size: 8.5px; text-transform: uppercase; letter-spacing: .08em; color: #a09a8e; font-weight: 700; border-right: 1px solid #e7e1d6; }
.sov-meta-v { padding: 6px 10px; font-size: 11px; font-weight: 600; }
.sov-tag { display: inline-block; background: var(--cc-ink); color: #fff; font-family: var(--cc-display); font-size: 8.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 3px 8px; border-radius: 2px; }
.sov-status { font-weight: 800; color: var(--cc-green); }

.sov-parties { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid #d8d2c6; margin-top: 16px; }
.sov-party { padding: 10px 12px; }
.sov-party--right { border-left: 1px solid #d8d2c6; }
.sov-party-k { font-size: 8.5px; text-transform: uppercase; letter-spacing: .1em; color: #a09a8e; font-weight: 700; margin-bottom: 5px; }
.sov-party-name { font-size: 12.5px; font-weight: 700; color: var(--cc-ink); }
.sov-party-sub { font-size: 10.5px; color: #8a857c; }
.sov-party-name + .sov-party-sub { margin-top: 2px; }
.sov-strip { display: flex; flex-wrap: wrap; border: 1px solid #d8d2c6; border-top: 0; }
.sov-strip-cell { flex: 1 1 25%; padding: 7px 12px; border-right: 1px solid #e7e1d6; }
.sov-strip-cell--last { border-right: 0; }
.sov-strip-k { font-size: 7.8px; text-transform: uppercase; letter-spacing: .08em; color: #a09a8e; font-weight: 700; }
.sov-strip-v { font-size: 10px; font-weight: 600; margin-top: 1px; }

.sov-table { width: 100%; border-collapse: collapse; margin-top: 18px; }
.sov-th { background: var(--cc-ink); color: #fff; font-family: var(--cc-display); font-size: 8.6px; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; text-align: left; padding: 8px 10px; }
.sov-th--item { width: 22%; }
.sov-th--desc { width: 52%; }
.sov-th--impact { width: 26%; }
.sov-row-alt { background: #F7F3EB; }
.sov-td { padding: 9px 10px; font-size: 10px; vertical-align: top; border-bottom: 1px solid var(--cc-line); }
.sov-td--item { font-family: var(--cc-display); font-weight: 900; font-size: 9.4px; letter-spacing: .04em; color: var(--cc-red); white-space: nowrap; text-transform: uppercase; }
.sov-td--desc { color: #333; line-height: 1.4; }
.sov-td--impact { font-weight: 600; color: var(--cc-ink); line-height: 1.35; }

.sov-foot { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-top: 16px; }
.sov-memo { flex: 1; }
.sov-memo-k { font-size: 8.5px; text-transform: uppercase; letter-spacing: .1em; color: #a09a8e; font-weight: 700; }
.sov-memo-v { font-size: 11px; font-style: italic; color: #333; margin-top: 5px; line-height: 1.45; max-width: 330px; }
.sov-totals { min-width: 262px; border: 1px solid #d8d2c6; }
.sov-total-row { display: grid; grid-template-columns: 1fr auto; padding: 7px 12px; border-bottom: 1px solid #e7e1d6; gap: 10px; }
.sov-total-k { font-size: 9.5px; color: #8a857c; font-weight: 600; }
.sov-total-v { font-size: 10px; font-weight: 700; text-align: right; }
.sov-total-v--green { color: var(--cc-green); }
.sov-total-row--due { background: var(--cc-ink); border-bottom: 0; padding: 9px 12px; }
.sov-total-k--due { color: #cdbfae; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.sov-total-v--due { font-family: var(--cc-display); font-size: 11px; font-weight: 900; color: #fff; }

/* AI-VALIDATED stamp, sits inline on the Freight Validation line item */
.sov-stamp { display: inline-block; margin-top: 7px; transform: rotate(-4deg); border: 2px solid var(--cc-green); border-radius: 6px; color: var(--cc-green); padding: 5px 9px; text-align: center; }
.sov-stamp b { display: block; font-family: var(--cc-display); font-size: 11px; font-weight: 900; letter-spacing: .08em; line-height: 1; }
.sov-stamp span { display: block; font-size: 6.5px; letter-spacing: .1em; text-transform: uppercase; margin-top: 2px; font-weight: 700; }

.sov-sign { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-top: 30px; padding-top: 18px; }
.sov-sign-name { font-family: var(--cc-display); font-size: 13px; font-weight: 700; color: var(--cc-ink); margin-bottom: 3px; }
.sov-sign-line { border-top: 1px solid var(--cc-ink); width: 210px; padding-top: 5px; font-size: 9px; color: #8a857c; text-transform: uppercase; letter-spacing: .08em; }
.sov-sign-note { font-size: 8.2px; color: #8a857c; line-height: 1.5; max-width: 330px; text-align: right; }

/* =================================================================
   ANIMATIONS
   ================================================================= */
@keyframes ccRise { from { transform: translateY(10px); } to { transform: none; } }
@keyframes ccDot { 0%,80%,100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@keyframes ccOvl { from { opacity: 0; } to { opacity: 1; } }
@keyframes ccDoc { from { transform: translateY(14px); } to { transform: none; } }

/* =================================================================
   ACCESSIBILITY: visible focus
   ================================================================= */
.cc-sov-btn:focus-visible,
.cc-chip:focus-visible,
.cc-send:focus-visible,
.cc-ovl-print:focus-visible,
.cc-ovl-close:focus-visible,
.cc-inputbar input:focus-visible {
  outline: 3px solid #1a73c7;
  outline-offset: 2px;
}
.cc-inputbar:focus-within { border-color: var(--cc-red); }

/* =================================================================
   RESPONSIVE: holds from ~360px up
   ================================================================= */
@media (max-width: 820px) {
  .ccApp { flex-direction: column; height: auto; min-height: 100dvh; overflow: visible; }
  .cc-sidebar { width: 100%; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 14px 16px; }
  .cc-brand { padding: 0; }
  .cc-review-card { margin: 0; flex: 1 1 auto; }
  .cc-recent-label, .cc-recent { display: none; }
  .cc-sidebar-foot { margin: 0; padding: 0; border: 0; flex-direction: row; align-items: center; gap: 12px; width: 100%; }
  .cc-sov-btn { width: auto; flex: 1 1 auto; }
  .cc-main { min-height: 70dvh; }
}
@media (max-width: 520px) {
  .cc-stats { grid-template-columns: 1fr 1fr; }
  .cc-thread-inner { padding: 20px 14px 8px; }
  .cc-composer { padding: 10px 14px 18px; }
  .cc-header { padding: 13px 16px; }
  .cc-bcorp-row { display: none; }
  .cc-sidebar-foot { flex-wrap: wrap; }
}

/* =================================================================
   PRINT: invoice only, single A4 page
   ================================================================= */
@media print {
  .ccApp { display: none !important; }
  .ccOvl { position: static !important; display: block !important; background: #fff !important; padding: 0 !important; overflow: visible !important; animation: none !important; }
  .ccOvl[hidden] { display: block !important; }
  .ccBar { display: none !important; }
  .cc-ovl-card { width: auto !important; max-width: none !important; }
  .ccDoc { box-shadow: none !important; border-radius: 0 !important; margin: 0 !important; animation: none !important; }
  html, body { background: #fff !important; }
  @page { size: A4; margin: 0; }
}

/* =================================================================
   REDUCED MOTION: disable all animation and transition
   ================================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
