/* Feature hints and What's new (frontend/hints/hints.js).
   The tip card is the Control UI's onboarding nudge card (ui/src/styles/custodian.css
   .custodian__nudge--channel-onboarding: copy, primary CTA, round dismiss), floated beside its control. */

.cc-hint.cc-hint--over-dialog { z-index: 2147483642; } /* the project sheet is 2147483641 (style.css) */

.cc-hint {
  position: fixed;
  z-index: 9000; /* above panels and dropdowns, below .cc-tip hover hints */
  display: flex;
  align-items: center;
  gap: 4px;
  width: min(320px, calc(100vw - 16px));
  padding: 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  color: var(--text);
  box-shadow: var(--overlay-shadow);
  animation: cc-hint-in 150ms ease;
}

/* Arrow toward the control (--cc-hint-arrow-x is set from the anchor's centre) */
.cc-hint::before {
  content: "";
  position: absolute;
  left: calc(var(--cc-hint-arrow-x, 50%) - 6px);
  width: 10px;
  height: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  transform: rotate(45deg);
}
.cc-hint[data-side="bottom"]::before { top: -6px; border-right: 0; border-bottom: 0; }
.cc-hint[data-side="top"]::before { bottom: -6px; border-left: 0; border-top: 0; }

@keyframes cc-hint-in {
  from { opacity: 0; transform: translateY(4px); }
}
.cc-hint[data-side="bottom"] { animation-name: cc-hint-in-below; }
@keyframes cc-hint-in-below {
  from { opacity: 0; transform: translateY(-4px); }
}

.cc-hint__copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 3px;
}

.cc-hint__copy strong {
  color: var(--text-strong);
  font-size: 13px;
}

.cc-hint__copy span {
  color: var(--text-secondary); /* --muted read 4.09:1 on the dark card; secondary text, as in What's new */
  font-size: 12px;
  line-height: 1.4;
}

.cc-hint__cta {
  flex: 0 0 auto;
  align-self: center;
  border: 1px solid transparent;
  border-radius: var(--radius-md, 10px);
  padding: 6px 10px;
  background: #0c7d61; /* the accent green, darker: white 12 px read 3.2:1 on --primary #10a37f, 5.1:1 here */
  color: var(--primary-foreground);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}
.cc-hint__cta:hover { background: #0a7058; } /* darker still: 6.1:1 */

.cc-hint__dismiss {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  align-self: flex-start;
  place-items: center;
  margin: -6px -6px 0 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.cc-hint__dismiss svg { width: 16px; height: 16px; }
.cc-hint__dismiss:hover { background: var(--bg-hover); color: var(--text-strong); }

.cc-hint__cta:focus-visible,
.cc-hint__dismiss:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* narrow screens, and cards with a command or link (.cc-hint--stacked): Got it goes under the copy */
.cc-hint--stacked { flex-wrap: wrap; }
.cc-hint--stacked .cc-hint__copy { flex-basis: calc(100% - 36px); }
.cc-hint--stacked .cc-hint__cta { order: 1; margin-left: auto; } /* after ×, which stays beside the title */
@media (max-width: 640px) {
  .cc-hint { flex-wrap: wrap; }
  .cc-hint__copy { flex-basis: calc(100% - 36px); }
  .cc-hint__cta { order: 1; margin-left: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .cc-hint { animation: none; }
}

/* Discovery: a small "new" dot on a control nobody would stumble into; cleared on first click */
[data-hint-dot] { position: relative; }
[data-hint-dot]::after {
  content: "";
  position: absolute;
  top: 3px;
  right: 3px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-color);
  box-shadow: 0 0 0 2px var(--bg-primary);
  pointer-events: none;
}

/* What's new: the bell dropdown's second tab. A green dot on the bell (when no notification count is
   showing) and on the tab while there are features the user hasn't looked at. */
.whats-new-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-color);
  box-shadow: 0 0 0 2px var(--bg-primary);
  pointer-events: none;
}
.whats-new-dot[hidden],
.whats-new-tab-dot[hidden] { display: none; }

.notification-tabs {
  display: flex;
  gap: 2px;
}

.notification-tab {
  position: relative;
  padding: 3px 8px;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--text-muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
/* light --text-muted read 4.33:1 on the dropdown's tint; the What's new date's darker shade (5.2:1) */
[data-theme="light"] .notification-tab { color: #625d55; }
.notification-tab:hover { color: var(--text-primary); background: var(--bg-tertiary); }
.notification-tab[aria-selected="true"] { color: var(--text-primary); background: var(--bg-tertiary); }
.notification-tab:focus-visible { outline: 1px solid var(--accent-color); outline-offset: 1px; }

.whats-new-tab-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 0 2px 5px;
  border-radius: 50%;
  background: var(--accent-color);
  vertical-align: middle;
}

/* the header row gets the tabs instead of a title: tighter left padding so they line up with the items */
.notification-dropdown-header:has(.notification-tabs) { padding: 6px 10px 6px 8px; }

.whats-new-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
}
.whats-new-item:last-child { border-bottom: none; }

.whats-new-item__head {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.whats-new-item__title {
  flex: 1;
  min-width: 0;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
}

.whats-new-item.unread .whats-new-item__title::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 6px 1px 0;
  border-radius: 50%;
  background: var(--accent-color);
  vertical-align: middle;
}

.whats-new-item__date {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 11px;
}
/* light --text-muted read 4.33:1 on the dropdown's tint; a shade darker for 11 px text (5.2:1) */
[data-theme="light"] .whats-new-item__date { color: #625d55; }

.whats-new-item__body {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.4;
}

.whats-new-item__show {
  align-self: flex-start;
  margin-top: 2px;
  padding: 2px 8px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: none;
  color: var(--text-primary);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.whats-new-item__show:hover { background: var(--bg-tertiary); }

/* An entry's command and docs link (registry `code` / `link`); dark link colour is the chat's (.message-content a) */
.cc-hint__code,
.whats-new-item__code {
  display: block;
  margin-top: 4px;
  padding: 6px 8px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  line-height: 1.4;
  overflow-wrap: anywhere; /* fallback; hints.js puts <wbr> after each dot */
  user-select: all;
}
.cc-hint__link,
.whats-new-item__link {
  align-self: flex-start;
  margin-top: 2px;
  color: #58a6ff;
  font-size: 12px;
  text-decoration: none;
  border-bottom: 1px solid rgba(88, 166, 255, 0.3);
}
.cc-hint__link:hover,
.whats-new-item__link:hover { border-bottom-color: currentColor; }
/* a shade darker than the chat's #0969da: 12px text on the dropdown's tinted background needs it for 4.5:1 */
[data-theme="light"] .cc-hint__link,
[data-theme="light"] .whats-new-item__link { color: #0550ae; border-bottom-color: rgba(5, 80, 174, 0.3); }
