/* GrantPilot V2 component styles — layered on top of styles.css.
   Reuses the tan/olive/brown palette and font variables defined in :root there. */

/* ---------- Accessibility & utility ---------- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -60px;
  left: 12px;
  z-index: 300;
  background: var(--brown);
  color: #f7f0e6;
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 12px;
}

:focus-visible {
  outline: 2px solid var(--accent-dark);
  outline-offset: 2px;
  border-radius: 4px;
}

button {
  font-family: var(--font-body);
}

/* ---------- Sticky two-row header ---------- */

.site-header-v2 {
  position: sticky;
  top: 0;
  z-index: 80;
  background: rgba(239, 228, 212, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.header-top {
  display: flex;
  align-items: center;
  gap: 18px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 13px 28px;
}

.site-header-v2 .site-nav {
  max-width: 1440px;
  margin: 0 auto;
  padding: 2px 28px 10px;
  border-top: 1px solid rgba(212, 196, 176, 0.55);
  padding-top: 8px;
}

.global-search {
  position: relative;
  flex: 1 1 420px;
  max-width: 540px;
  display: flex;
  align-items: center;
}

.global-search-icon {
  position: absolute;
  left: 15px;
  font-size: 0.9rem;
  opacity: 0.55;
  pointer-events: none;
}

.global-search input {
  width: 100%;
  padding: 10px 16px 10px 38px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-solid);
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: var(--text);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.global-search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 111, 82, 0.16);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.header-actions-lite {
  gap: 4px;
  margin-left: auto;
}

.header-link {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 9px 12px;
  border-radius: 8px;
  transition: background 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}

.header-link:hover,
.header-link[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--brown);
  font-size: 1.05rem;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.65);
  border-color: var(--line);
  transform: translateY(-1px);
}

.icon-btn:active {
  transform: translateY(0);
}

.icon-btn.amber-trigger {
  background: linear-gradient(135deg, rgba(154, 107, 47, 0.16), rgba(79, 111, 82, 0.14));
}

.icon-btn-badge {
  overflow: visible;
}

.badge {
  position: absolute;
  top: 1px;
  right: 1px;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  border-radius: 999px;
  background: #b6482f;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  box-shadow: 0 0 0 2px rgba(239, 228, 212, 0.96);
}

.profile-btn {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: var(--brown);
  color: #f7f0e6;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.profile-btn:hover {
  background: var(--accent-dark);
}

/* ---------- Layout helpers ---------- */

.page-wide {
  max-width: 1200px;
}

.section-head-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  flex-wrap: wrap;
}

.new-app-btn {
  flex-shrink: 0;
}

.btn-ghost-dark {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--brown);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.btn-ghost-dark:hover {
  background: var(--panel2);
  border-color: var(--brown);
}

.stat-link {
  text-decoration: none;
  display: block;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-link:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

/* ---------- Dashboard priorities ---------- */

.dash-grid {
  display: grid;
  gap: 16px;
}

.priority-grid {
  grid-template-columns: repeat(3, 1fr);
}

.priority-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  border-left: 4px solid var(--line);
  background: var(--panel);
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.priority-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.priority-card h3 {
  margin: 2px 0 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--brown);
  line-height: 1.25;
}

.priority-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.priority-tag {
  align-self: flex-start;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--panel2);
  color: var(--muted);
}

.priority-urgent {
  border-left-color: #b6482f;
}
.priority-urgent .priority-tag {
  background: #f6dcd3;
  color: #96311b;
}

.priority-warn {
  border-left-color: var(--gold);
}
.priority-warn .priority-tag {
  background: var(--warn-bg);
  color: var(--warn);
}

.priority-ok {
  border-left-color: var(--accent);
}
.priority-ok .priority-tag {
  background: var(--ok-bg);
  color: var(--ok);
}

.priority-info {
  border-left-color: var(--accent-dark);
}
.priority-info .priority-tag {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.priority-cta {
  margin-top: auto;
  padding-top: 6px;
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--accent-dark);
}

.clickable-list li {
  padding: 0;
  border-bottom: 1px solid var(--line);
}
.clickable-list li:last-child {
  border-bottom: 0;
}

.clickable-list a {
  display: block;
  padding: 14px 6px;
  color: var(--muted);
  text-decoration: none;
  border-radius: 8px;
  transition: background 0.2s ease, padding-left 0.2s ease;
}

.clickable-list a:hover {
  background: rgba(217, 229, 214, 0.35);
  padding-left: 12px;
}

.clickable-list strong {
  color: var(--text);
}

.row-link {
  color: var(--accent-dark);
  font-weight: 700;
  text-decoration: none;
  font-size: 0.85rem;
  white-space: nowrap;
}

.row-link:hover {
  text-decoration: underline;
}

.see-all-link {
  margin-top: 18px;
  display: inline-flex;
}

.trust-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--panel2);
  border: 1px solid var(--line);
}

.trust-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.trust-item strong {
  display: block;
  font-size: 0.88rem;
  color: var(--brown);
}

.trust-item span {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
}

.trust-strip-large .trust-item {
  padding: 18px 20px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.trust-strip-large .trust-icon {
  font-size: 1.6rem;
}

.footer-trust-line {
  max-width: 1100px;
  margin: 24px auto 0;
  padding: 0 28px;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

/* ---------- Find Grants (discover) ---------- */

.discover-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 28px;
  align-items: start;
}

.discover-results {
  min-width: 0;
}

.filter-rail {
  position: sticky;
  top: 150px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.filter-rail-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.filter-rail-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--brown);
}

.filter-clear {
  background: none;
  border: none;
  color: var(--accent-dark);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.filter-clear:hover {
  text-decoration: underline;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
  border: none;
  padding: 0;
  margin: 0;
}

.filter-group label:not(.filter-check) {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.filter-group legend {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  padding: 0;
  margin-bottom: 4px;
}

.filter-group select {
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-solid);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.88rem;
}

.filter-group select:focus {
  outline: none;
  border-color: var(--accent);
}

.filter-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--text);
  font-weight: 500;
  cursor: pointer;
}

.filter-check input {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
}

.discover-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.discover-count {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.discover-count strong {
  color: var(--brown);
}

.discover-sort {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
}

.discover-sort select {
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-solid);
  font-family: var(--font-body);
}

.grant-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.grant-grid-compact {
  grid-template-columns: repeat(3, 1fr);
}

.grant-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.grant-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.grant-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.grant-card-top h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--brown);
  line-height: 1.25;
}

.grant-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.grant-stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.grant-stat-row span {
  font-size: 0.76rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--panel2);
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

.grant-amber {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: linear-gradient(120deg, rgba(217, 229, 214, 0.55), rgba(240, 224, 196, 0.4));
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.45;
}

.grant-amber strong {
  color: var(--accent-dark);
}

.grant-docs {
  font-size: 0.85rem;
  color: var(--muted);
}

.grant-docs summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--brown);
}

.grant-docs ul {
  margin: 8px 0 0;
  padding-left: 1.1rem;
  line-height: 1.55;
}

.grant-card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  flex-wrap: wrap;
  padding-top: 4px;
}

/* ---------- Applications ---------- */

.app-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.app-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 4px solid var(--line);
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.app-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.app-card-risk-high {
  border-top-color: #b6482f;
}
.app-card-risk-medium {
  border-top-color: var(--gold);
}
.app-card-risk-low {
  border-top-color: var(--accent);
}

.app-card-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.app-card-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--brown);
  line-height: 1.25;
}

.app-card-sub {
  margin: 2px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.app-card-risk {
  margin-left: auto;
  align-self: flex-start;
  white-space: nowrap;
}

.progress-ring {
  --pct: 0;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--accent) calc(var(--pct) * 1%), var(--panel2) 0);
  position: relative;
}

.progress-ring::before {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: var(--panel-solid);
}

.progress-ring span {
  position: relative;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--brown);
}

.app-card-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
}

.app-card-meta-grid div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.app-card-meta-grid span {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 700;
}

.app-card-meta-grid strong {
  font-size: 0.88rem;
  color: var(--text);
}

.app-card-tasks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.app-card-tasks li {
  position: relative;
  padding-left: 20px;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.4;
}

.app-card-tasks li::before {
  content: "○";
  position: absolute;
  left: 0;
  color: var(--gold);
}

.app-card-next {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.app-card-deadline {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}

.countdown {
  color: var(--accent-dark);
}

.countdown-urgent {
  color: #b6482f;
}

.app-card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  flex-wrap: wrap;
  padding-top: 4px;
}

.app-card-compact {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border-radius: 12px;
  border-top-width: 3px;
  text-decoration: none;
  color: var(--text);
}

.app-card-compact .app-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.app-card-compact h4 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--brown);
}

.app-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

/* ---------- My Grants pipeline board ---------- */

.pipeline-board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  align-items: start;
}

.pipeline-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pipeline-col-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--brown);
}

.pipeline-col-head span {
  background: var(--panel2);
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
}

/* ---------- Grant Budget charts ---------- */

.budget-export-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.budget-chart-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 18px;
}

.chart-pie {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.chart-pie svg {
  flex-shrink: 0;
  transform: rotate(-90deg);
}

.chart-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chart-legend li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--muted);
}

.chart-legend .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.chart-bars {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chart-bar-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  align-items: center;
  gap: 12px;
}

.chart-bar-label {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}

.chart-bar-track {
  background: var(--panel2);
  border-radius: 999px;
  overflow: hidden;
  height: 30px;
}

.chart-bar-fill {
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: linear-gradient(90deg, var(--gold), #c98f3f);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
  border-radius: 999px;
  transition: width 0.4s ease;
}

.chart-bar-fill.chart-bar-approved {
  background: linear-gradient(90deg, var(--accent), var(--accent-dark));
}

.validation-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.validation-list li {
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 0.88rem;
  line-height: 1.45;
}

.validation-warn {
  background: var(--warn-bg);
  color: #6b4a1c;
}

.validation-ok {
  background: var(--ok-bg);
  color: var(--accent-dark);
}

/* ---------- Document Vault ---------- */

.vault-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  align-items: start;
}

.folder-list {
  position: sticky;
  top: 150px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.folder-list h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--brown);
}

.folder-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.88rem;
}

.folder-item:hover {
  background: rgba(255, 255, 255, 0.65);
}

.folder-item-active {
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 700;
}

.folder-count {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.folder-checklist {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.folder-checklist h3 {
  margin: 0 0 8px;
  font-size: 0.95rem;
}

.folder-checklist ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.folder-checklist li {
  font-size: 0.82rem;
  line-height: 1.4;
}

.checklist-done {
  color: var(--accent-dark);
}
.checklist-warn {
  color: var(--warn);
}
.checklist-missing {
  color: #b6482f;
}

.vault-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.dropzone {
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 36px 20px;
  text-align: center;
  background: rgba(247, 240, 230, 0.6);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.dropzone:hover,
.dropzone:focus-visible {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.dropzone-icon {
  font-size: 1.8rem;
  display: block;
  margin-bottom: 8px;
}

.dropzone p {
  margin: 4px 0 0;
  color: var(--muted);
}

.dropzone p strong {
  color: var(--brown);
}

.ocr-search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-solid);
}

.ocr-search input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: var(--text);
}

.ocr-search input:focus {
  outline: none;
}

.duplicate-note {
  margin: 14px 0 0;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--warn-bg);
  color: #6b4a1c;
  font-size: 0.85rem;
}

.warn-cell {
  color: var(--warn);
  font-weight: 600;
}

/* ---------- Reviews & Approvals ---------- */

.approval-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  align-items: start;
}

.timeline {
  display: flex;
  flex-direction: column;
}

.timeline-item {
  display: flex;
  gap: 16px;
  padding-bottom: 26px;
  position: relative;
}

.timeline-item:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 32px;
  bottom: -4px;
  width: 2px;
  background: var(--line);
}

.timeline-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--panel2);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
  border: 2px solid var(--line);
}

.timeline-done .timeline-dot {
  background: var(--accent-soft);
  color: var(--accent-dark);
  border-color: var(--accent);
}

.timeline-current .timeline-dot {
  background: var(--warn-bg);
  color: var(--warn);
  border-color: var(--gold);
}

.timeline-future .timeline-dot {
  opacity: 0.6;
}

.timeline-body {
  flex: 1;
  padding-top: 3px;
}

.timeline-head {
  font-size: 0.92rem;
  color: var(--text);
  font-weight: 500;
}

.timeline-head time {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.82rem;
  margin-left: 6px;
}

.timeline-muted {
  color: var(--muted);
}

.timeline-comment {
  margin: 8px 0 0;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.45;
}

.timeline-amber {
  margin: 8px 0 0;
  font-size: 0.84rem;
  color: var(--accent-dark);
  font-style: italic;
}

.timeline-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.mention {
  color: var(--accent-dark);
  font-weight: 700;
  background: var(--accent-soft);
  padding: 1px 6px;
  border-radius: 6px;
}

.approval-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.approval-side .card h3 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--brown);
}

/* ---------- Team ---------- */

.team-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.team-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.team-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.team-card-pending {
  border-style: dashed;
}

.team-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.team-card-top h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--brown);
}

.team-role {
  margin: 2px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--avatar-color, var(--accent));
  color: #f7f0e6;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
  position: relative;
}

.avatar-online::after {
  content: "";
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #4f6f52;
  border: 2px solid var(--panel-solid);
}

.avatar-pending {
  background: var(--panel2);
  color: var(--muted);
  border: 2px dashed var(--line);
}

.team-status {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.workload {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.workload-row {
  display: grid;
  grid-template-columns: 1fr 2fr auto;
  align-items: center;
  gap: 10px;
}

.workload-row span {
  font-size: 0.8rem;
  color: var(--muted);
}

.workload-row strong {
  font-size: 0.8rem;
  color: var(--text);
  text-align: right;
}

.workload-bar {
  background: var(--panel2);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}

.workload-bar div {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
}

.workload-bar.workload-high div {
  background: #b6482f;
}

.workload-bar.workload-ok div {
  background: var(--accent);
}

.team-activity {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  font-style: italic;
}

.team-tasks {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

/* ---------- Pricing extras ---------- */

.roi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.faq {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 52rem;
}

.faq-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 20px;
  background: var(--panel);
}

.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--brown);
  font-family: var(--font-display);
  font-size: 1.08rem;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  float: right;
  color: var(--accent-dark);
  font-weight: 700;
  font-family: var(--font-body);
}

.faq-item[open] summary::after {
  content: "\2212";
}

.faq-item p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.yes-cell {
  color: var(--accent-dark);
  font-weight: 700;
  text-align: center;
}

/* ---------- Empty state guide ---------- */

.empty-guide {
  padding: 34px 24px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(247, 240, 230, 0.5);
}

.empty-guide h3 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  color: var(--brown);
}

/* ---------- Amber assistant widget ---------- */

.amber-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 22px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, var(--gold), var(--brown));
  color: #f7f0e6;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(90, 64, 48, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.amber-fab::before {
  content: "\2728";
}

.amber-fab:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 36px rgba(90, 64, 48, 0.4);
}

.amber-panel {
  position: fixed;
  bottom: 96px;
  right: 24px;
  z-index: 95;
  width: 340px;
  max-width: calc(100vw - 32px);
  max-height: 480px;
  display: flex;
  flex-direction: column;
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: amber-pop 0.22s ease;
}

@keyframes amber-pop {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.amber-panel[hidden] {
  display: none;
}

.amber-panel > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: linear-gradient(120deg, var(--gold), var(--brown));
  color: #f7f0e6;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
}

.amber-close {
  background: none;
  border: none;
  color: #f7f0e6;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

.amber-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.amber-msg {
  margin: 0;
  padding: 10px 14px;
  border-radius: 14px 14px 14px 4px;
  background: var(--accent-soft);
  color: var(--text);
  font-size: 0.88rem;
  line-height: 1.5;
  max-width: 92%;
}

.amber-ask {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.amber-ask input {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-family: var(--font-body);
  font-size: 0.85rem;
  background: var(--panel-solid);
  color: var(--text);
}

.amber-ask input:focus {
  outline: none;
  border-color: var(--accent);
}

.amber-ask button {
  padding: 9px 16px;
  border-radius: 999px;
  border: none;
  background: var(--accent);
  color: #f7f0e6;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.amber-ask button:hover {
  background: var(--accent-dark);
}

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
  .priority-grid,
  .grant-grid-compact,
  .app-grid,
  .team-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .pipeline-board {
    grid-template-columns: repeat(3, 1fr);
  }
  .budget-chart-grid {
    grid-template-columns: 1fr;
  }
  .roi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .discover-layout,
  .vault-layout,
  .approval-layout {
    grid-template-columns: 1fr;
  }
  .filter-rail,
  .folder-list {
    position: static;
  }
  .grant-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .header-top {
    flex-wrap: wrap;
    padding: 12px 16px;
    row-gap: 10px;
  }
  .global-search {
    order: 3;
    flex-basis: 100%;
    max-width: none;
  }
  .header-actions {
    order: 2;
    flex-wrap: wrap;
    margin-left: auto;
  }
  .header-actions-lite {
    margin-left: 0;
  }
  .site-header-v2 .site-nav {
    padding: 0 16px 8px;
  }
  .priority-grid,
  .grant-grid-compact,
  .app-grid,
  .team-grid,
  .pipeline-board,
  .trust-strip,
  .roi-grid {
    grid-template-columns: 1fr;
  }
  .app-card-meta-grid {
    grid-template-columns: 1fr;
  }
  .amber-panel {
    right: 12px;
    left: 12px;
    width: auto;
    bottom: 84px;
  }
  .amber-fab {
    right: 16px;
    bottom: 16px;
    padding: 12px 18px;
  }
  .chart-bar-row {
    grid-template-columns: 90px 1fr;
  }
}
