/**
 * Shared Greenways agent sidebar — Ask starters, then Quick links.
 * Flat sections (no boxed "Ask about" panel) so the column is not squeezed.
 *
 * Default agents: Ask about → Quick links → status-bar
 * Edwardo (systems-agent): Ops verify → Quick links → Ask about
 */
.guide-sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.guide-sidebar .sidebar-section {
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.08));
}

/* Ask + Quick links share remaining height ~50/50 (scroll inside each list) */
.guide-sidebar .sidebar-section--helpers,
.guide-sidebar .sidebar-section--links {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Edwardo ops block — fixed height, not a grow pane */
.guide-sidebar .sidebar-section:not(.sidebar-section--helpers):not(.sidebar-section--links) {
  flex-shrink: 0;
}

.guide-sidebar > .status-bar {
  flex-shrink: 0;
}

.guide-sidebar .sidebar-label {
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-lt, var(--accent));
  margin-bottom: 4px;
}

.guide-sidebar .sidebar-hint {
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.45;
  margin: 0 0 8px;
  flex-shrink: 0;
}

/* Matched cue: Quick links hint + composer Tools ▾ (light blue) — only when Tools tray is present */
:root {
  --gw-tools-cue: #7dd3fc;
}

body:has(#gw-composer-tools) #gw-sidebar-links-hint {
  color: var(--gw-tools-cue);
  font-weight: 500;
}

.guide-sidebar .sidebar-section--helpers > .sidebar-label,
.guide-sidebar .sidebar-section--links > .sidebar-label {
  flex-shrink: 0;
}

.guide-sidebar .sidebar-section--highlight {
  flex-shrink: 0;
  border-bottom: 1px solid rgba(201, 169, 97, 0.22);
}

.guide-sidebar .sidebar-section--highlight[hidden] {
  display: none !important;
}

.gw-highlight-week {
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: none;
}

.gw-sidebar-highlight-card {
  padding: 10px 11px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.24);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
}

.gw-sidebar-highlight-title {
  margin: 0 0 6px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text, #e8f5ec);
}

.gw-sidebar-highlight-teaser {
  margin: 0 0 8px;
  font-size: 0.66rem;
  line-height: 1.45;
  color: var(--muted);
}

.gw-sidebar-highlight-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.gw-sidebar-highlight-ask,
.gw-sidebar-highlight-open {
  font: inherit;
  font-size: 0.6rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
}

.gw-sidebar-highlight-ask {
  color: #e0f2fe;
  border: 1px solid rgba(96, 165, 250, 0.4);
  background: rgba(15, 40, 72, 0.45);
}

.gw-sidebar-highlight-open {
  color: #bbf7d0;
  border: 1px solid rgba(74, 222, 128, 0.35);
  background: rgba(16, 48, 32, 0.4);
}

.gw-sidebar-deadline-chip {
  margin-top: 8px;
  padding: 9px 10px;
  border-radius: 10px;
  background: rgba(48, 32, 8, 0.35);
  border: 1px solid rgba(251, 191, 36, 0.35);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gw-sidebar-deadline-label {
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fde68a;
}

.gw-sidebar-deadline-title {
  font-size: 0.68rem;
  line-height: 1.35;
  color: var(--text, #fef3c7);
}

.gw-sidebar-deadline-date {
  font-size: 0.62rem;
  color: #fcd34d;
}

.gw-sidebar-deadline-open {
  align-self: flex-start;
  margin-top: 4px;
  font: inherit;
  font-size: 0.58rem;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 999px;
  cursor: pointer;
  color: #fef3c7;
  border: 1px solid rgba(251, 191, 36, 0.4);
  background: rgba(68, 48, 12, 0.45);
}

.guide-sidebar .gw-sidebar-ql-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  margin-top: 4px;
  padding-right: 8px;
  scrollbar-gutter: stable;
  scrollbar-width: auto;
  scrollbar-color: color-mix(in srgb, var(--accent) 78%, #fff 12%)
    color-mix(in srgb, var(--accent) 18%, transparent);
}

.guide-sidebar .gw-sidebar-ql-list::-webkit-scrollbar {
  width: 9px;
}

.guide-sidebar .gw-sidebar-ql-list::-webkit-scrollbar-track {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border-radius: 999px;
  margin: 2px 0;
  box-shadow: inset 0 0 6px color-mix(in srgb, var(--accent) 22%, transparent);
}

.guide-sidebar .gw-sidebar-ql-list::-webkit-scrollbar-thumb {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--accent-lt, var(--accent)) 92%, #fff),
    color-mix(in srgb, var(--accent) 75%, transparent)
  );
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
  box-shadow:
    0 0 6px color-mix(in srgb, var(--accent) 55%, transparent),
    0 0 14px color-mix(in srgb, var(--accent) 40%, transparent);
  animation: gw-sidebar-scroll-pulse 2.4s ease-in-out infinite;
}

.guide-sidebar .gw-sidebar-ql-list::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--accent-lt, var(--accent)) 95%, #fff);
  box-shadow:
    0 0 8px color-mix(in srgb, var(--accent) 70%, transparent),
    0 0 18px color-mix(in srgb, var(--accent) 50%, transparent);
}

.guide-sidebar .gw-sidebar-ql-card {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 7px;
  padding: 7px 8px;
  min-height: 34px;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
  background: rgba(18, 24, 16, 0.96);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, background 0.15s;
  box-sizing: border-box;
  width: 100%;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.guide-sidebar a.gw-sidebar-ql-card:hover,
.guide-sidebar button.gw-sidebar-ql-card:hover {
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
  background: rgba(28, 36, 22, 0.98);
}

.guide-sidebar .gw-sidebar-ql-card:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: 1px;
}

.guide-sidebar .gw-sidebar-ql-icon {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  line-height: 1;
  grid-column: 1;
  grid-row: 1;
}

.guide-sidebar .gw-sidebar-ql-label {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  display: block;
  font-size: 0.68rem;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.guide-sidebar .gw-sidebar-ql-label strong {
  font-weight: 600;
  color: #fff;
}

.guide-sidebar .gw-sidebar-ql-label em {
  font-style: normal;
  font-weight: 400;
  color: var(--muted);
}

.guide-sidebar .gw-sidebar-ql-action {
  grid-column: 3;
  grid-row: 1;
  font-size: 0.56rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 3px 7px;
  border-radius: 6px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent-lt, var(--accent));
  line-height: 1.2;
  white-space: nowrap;
}

.guide-sidebar .gw-sidebar-ql-card.is-agent .gw-sidebar-ql-action {
  border-color: color-mix(in srgb, var(--send) 55%, transparent);
  background: color-mix(in srgb, var(--send) 24%, transparent);
  color: #fff;
}

.guide-sidebar .gw-sidebar-ql-card.is-agent .gw-sidebar-ql-icon {
  background: color-mix(in srgb, var(--send) 20%, transparent);
}

.guide-sidebar .helper-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 8px 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scrollbar-gutter: stable;
  scrollbar-width: auto;
  scrollbar-color: color-mix(in srgb, var(--accent) 78%, #fff 12%)
    color-mix(in srgb, var(--accent) 18%, transparent);
}

.guide-sidebar .helper-list::-webkit-scrollbar {
  width: 9px;
}

.guide-sidebar .helper-list::-webkit-scrollbar-track {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border-radius: 999px;
  margin: 2px 0;
  box-shadow: inset 0 0 6px color-mix(in srgb, var(--accent) 22%, transparent);
}

.guide-sidebar .helper-list::-webkit-scrollbar-thumb {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--accent-lt, var(--accent)) 92%, #fff),
    color-mix(in srgb, var(--accent) 75%, transparent)
  );
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
  box-shadow:
    0 0 6px color-mix(in srgb, var(--accent) 55%, transparent),
    0 0 14px color-mix(in srgb, var(--accent) 40%, transparent);
  animation: gw-sidebar-scroll-pulse 2.4s ease-in-out infinite;
}

.guide-sidebar .helper-list::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--accent-lt, var(--accent)) 95%, #fff);
  box-shadow:
    0 0 8px color-mix(in srgb, var(--accent) 70%, transparent),
    0 0 18px color-mix(in srgb, var(--accent) 50%, transparent);
}

@keyframes gw-sidebar-scroll-pulse {
  0%,
  100% {
    box-shadow:
      0 0 5px color-mix(in srgb, var(--accent) 45%, transparent),
      0 0 10px color-mix(in srgb, var(--accent) 28%, transparent);
    filter: brightness(1);
  }
  50% {
    box-shadow:
      0 0 10px color-mix(in srgb, var(--accent) 80%, transparent),
      0 0 22px color-mix(in srgb, var(--accent) 55%, transparent),
      0 0 32px color-mix(in srgb, var(--accent-lt, var(--accent)) 35%, transparent);
    filter: brightness(1.18);
  }
}

@media (prefers-reduced-motion: reduce) {
  .guide-sidebar .gw-sidebar-ql-list::-webkit-scrollbar-thumb,
  .guide-sidebar .helper-list::-webkit-scrollbar-thumb {
    animation: none;
  }
}

.guide-sidebar .helper-card {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 10px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
  background: var(--panel2, rgba(20, 26, 34, 0.9));
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  text-align: left;
  width: 100%;
  font-family: inherit;
  color: inherit;
  min-height: 52px;
  box-sizing: border-box;
}

.guide-sidebar .helper-card:hover {
  border-color: color-mix(in srgb, var(--send, var(--accent)) 45%, transparent);
  background: rgba(28, 36, 44, 0.95);
}

.guide-sidebar .helper-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--send, var(--accent)) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--send, var(--accent)) 22%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
}

.guide-sidebar .helper-card-body {
  min-width: 0;
}

.guide-sidebar .helper-card-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.guide-sidebar .helper-card-name.is-compact {
  font-size: 0.72rem;
}

.guide-sidebar .helper-card-desc {
  font-size: 0.65rem;
  color: var(--muted);
  line-height: 1.25;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.guide-sidebar .helper-ask-btn {
  font-size: 0.58rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid color-mix(in srgb, var(--send, var(--accent)) 50%, transparent);
  background: color-mix(in srgb, var(--send, var(--accent)) 22%, transparent);
  color: #fff;
  white-space: nowrap;
  line-height: 1.2;
}

/* Under-composer Tools tray — overflow modules; collapsed by default */
.gw-composer-tools {
  margin-top: 8px;
}

.gw-composer-tools[hidden] {
  display: none !important;
}

.gw-composer-tools-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 4px 2px;
  border: none;
  background: transparent;
  color: var(--gw-tools-cue, #7dd3fc);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.gw-composer-tools-toggle:hover {
  color: #bae6fd;
}

.gw-composer-tools-toggle:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent, #f59e0b) 55%, transparent);
  outline-offset: 2px;
  border-radius: 4px;
}

.gw-composer-tools-chevron {
  font-size: 0.62rem;
  opacity: 0.85;
  transition: transform 0.15s ease;
}

.gw-composer-tools.is-open .gw-composer-tools-chevron {
  transform: rotate(180deg);
}

.gw-composer-tools-panel {
  margin-top: 6px;
}

.gw-composer-tools-panel[hidden] {
  display: none !important;
}

.gw-composer-tools-scroller {
  display: flex;
  flex-direction: row;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 2px 6px;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--accent, #f59e0b) 35%, transparent) transparent;
  -webkit-overflow-scrolling: touch;
}

.gw-composer-tools-scroller::-webkit-scrollbar {
  height: 5px;
}

.gw-composer-tools-scroller::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--accent, #f59e0b) 35%, transparent);
  border-radius: 999px;
}

.gw-composer-tools-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  max-width: 220px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent, #f59e0b) 28%, transparent);
  background: rgba(0, 0, 0, 0.28);
  color: var(--text, #e2e8f0);
  font: inherit;
  font-size: 0.68rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.gw-composer-tools-chip:hover {
  border-color: color-mix(in srgb, var(--accent, #f59e0b) 50%, transparent);
  background: rgba(0, 0, 0, 0.4);
}

.gw-composer-tools-chip:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent, #f59e0b) 55%, transparent);
  outline-offset: 2px;
}

.gw-composer-tools-chip.is-agent {
  border-color: rgba(148, 163, 184, 0.35);
  color: #e2e8f0;
}

.gw-composer-tools-chip-icon {
  font-size: 0.85rem;
  line-height: 1;
}

.gw-composer-tools-chip-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 900px) {
  .guide-sidebar {
    max-height: 220px;
  }
  .guide-sidebar .sidebar-section--helpers,
  .guide-sidebar .sidebar-section--links {
    flex: 1 1 0;
  }
  .guide-sidebar .helper-list {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 6px;
  }
  .guide-sidebar .helper-card {
    min-width: 200px;
    flex-shrink: 0;
  }
}
