/* ============================================================================
   Oceanus — patch layer (formerly polish.css + polish2.css + polish3.css).
   ----------------------------------------------------------------------------
   Three chronological "polish round" sheets merged 2026-09-12 with their
   order preserved, so the cascade is unchanged. Rounds 2-4 below.

   These are cross-cutting patches, not a component: when a component gets
   its own sheet (see news_timeline.css), move its rules out of here.
   ============================================================================ */


/* ==== from polish.css ==== */
/* ============================================================================
   Oceanus — Polish, round 2.
   ----------------------------------------------------------------------------
   Three surgical tweaks loaded after the base stylesheets:
     1. Primary-button cohesion — .im-btn-primary picks up the same rich
        gradient + soft accent shadow + hover lift that .btn-primary already
        had. No new buttons styled; we're aligning existing variants.
     2. Smoother global ease — the --tr-fast / --tr-base / --tr-slow tokens
        switch from plain `ease` to a soft cubic-bezier ("snap-out") so every
        hover/focus transition app-wide feels more refined. Same curve was
        already used ad-hoc in a few places — now consistent.
     3. Focus-visible ring — replaces the browser-default outline with a
        soft 2-layer accent ring (page-colored spacer + accent halo). Better
        keyboard nav, no visual cost during mouse use.

   To revert: delete the <link> in base.html.
   ========================================================================== */

/* ----------------------------------------------------------------------------
   #2 — Smoother transition tokens.
   Same authoring curve as the ad-hoc uses already in style.css.
   -------------------------------------------------------------------------- */
:root {
  --tr-fast: var(--dur-press, 120ms) var(--ease-out, cubic-bezier(0.22, 1, 0.36, 1));
  --tr-base: var(--dur-ui, 200ms) var(--ease-out, cubic-bezier(0.22, 1, 0.36, 1));
  --tr-slow: var(--dur-sheet, 320ms) var(--ease-out, cubic-bezier(0.22, 1, 0.36, 1));
}

/* ----------------------------------------------------------------------------
   #1 — Bring .im-btn-primary in line with the gradient .btn-primary defined
   in tokens.css. Without this, the IM "Send" and "Create" buttons stayed
   flat solid-color while every other primary button felt elevated.
   -------------------------------------------------------------------------- */
.im-btn-primary {
  background: var(--accent) !important;
  color: var(--text-inverse) !important;
  border: 1px solid var(--accent) !important;
  box-shadow: none;
  transition: transform var(--tr-fast), background var(--tr-fast), border-color var(--tr-fast);
}
.im-btn-primary:hover:not(:disabled) {
  background: var(--accent-hover) !important;
  border-color: var(--accent-hover) !important;
  transform: none;
  box-shadow: none;
}
.im-btn-primary:active:not(:disabled) {
  transform: scale(0.98);
}
.im-btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

/* ----------------------------------------------------------------------------
   #3 — Focus-visible ring. Soft 2-layer accent halo replaces the harsh
   browser-default outline. `:focus-visible` only triggers for keyboard
   navigation (not mouse clicks), so the UI stays clean for pointer users.
   -------------------------------------------------------------------------- */
:focus-visible {
  outline: 1px solid color-mix(in srgb, var(--text-primary) 45%, transparent);
  outline-offset: 2px;
  box-shadow: none;
}


/* ==== from polish2.css ==== */
/* ============================================================================
   Oceanus — Polish, round 3.
   ----------------------------------------------------------------------------
   Three more surgical tweaks:
     4. Card hover lift — note-card, board-card, task-row, scout candidate
        cards get a 1px hover lift + soft shadow. Linear/Vercel-style.
     5. Typography rhythm — h1/h2 drop a weight (bold → semibold), tighten
        letter-spacing slightly. Reads as "modern app", not "doc".
     6. Chat assistant "thinking" dots — three bouncing dots in the empty
        assistant bubble while waiting for the first streamed token. The
        .is-thinking class is added/removed by chat.js (small wiring change).

   To revert: delete the <link> in base.html.
   ========================================================================== */

/* ----------------------------------------------------------------------------
   #4 — Card hover lift. Subtle: 1px translate + soft accent-tinted shadow.
   Excludes dashboard cards (kept tight + informational) and ticker page
   cards (already in the touching-border tabular style).
   -------------------------------------------------------------------------- */
.note-card,
.board-card,
.vtl-card,
.sc-card {
  transition:
    transform var(--tr-fast),
    border-color var(--tr-fast);
  will-change: transform;
}
.note-card:hover,
.board-card:hover,
.vtl-card:hover,
.sc-card:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--border-strong, var(--border-default));
}
/* Task rows — flatter list pattern, give a hairline left accent on hover
   instead of a full lift (preserves dense list scanning). */
.task-row {
  transition: background var(--tr-fast);
}
.task-row:hover {
  box-shadow: inset 2px 0 0 color-mix(in srgb, var(--accent) 60%, transparent);
}

/* ----------------------------------------------------------------------------
   #5 — Typography rhythm. Tighter, slightly lighter weights for h1/h2;
   nothing changes for h3-h5 (those are already at semibold).
   -------------------------------------------------------------------------- */
h1 {
  font-weight: var(--fw-semibold);   /* 700 → 600 */
  letter-spacing: -0.01em;
}
h2 {
  font-weight: var(--fw-semibold);
  letter-spacing: -0.005em;
}
/* Section labels that already use the small-caps uppercase pattern
   (.dash-card-head h2, .mkt-card-head h3, .ao-tabs button, etc.) gain a
   touch more letter-spacing — that's the look modern apps converge on. */
.dash-card-head h2,
.mkt-card-head h3,
.adm-form label,
.ao-form label,
.adm-teams-list h3,
.adm-team-detail h3 {
  letter-spacing: 0.08em;
}

/* ----------------------------------------------------------------------------
   #6 — Chat assistant "thinking" dots. Pure CSS — chat.js just toggles the
   .is-thinking class on the assistant message div. Dots fade in/out so
   it's calm, not jittery.
   -------------------------------------------------------------------------- */
.chat-msg.assistant.is-thinking .body {
  min-height: 22px;
  display: flex;
  align-items: center;
}
.chat-msg.assistant.is-thinking .body::before {
  content: "";
  display: inline-block;
  width: 28px;
  height: 8px;
  background:
    radial-gradient(circle, var(--text-muted) 50%, transparent 51%) 0    50% / 6px 6px no-repeat,
    radial-gradient(circle, var(--text-muted) 50%, transparent 51%) 50%  50% / 6px 6px no-repeat,
    radial-gradient(circle, var(--text-muted) 50%, transparent 51%) 100% 50% / 6px 6px no-repeat;
  animation: oc-thinking 1.4s ease-in-out infinite;
  opacity: 0.7;
}
@keyframes oc-thinking {
  0%, 80%, 100% { opacity: 0.35; }
  40%           { opacity: 0.9;  }
}
/* Three dots take turns being brighter via a slight stagger. Cheap effect
   that uses background-position to "blink" each dot at a different phase. */
.chat-msg.assistant.is-thinking .body::after {
  display: none;
}
@keyframes oc-thinking-cursor {
  0%, 100% { transform: translateX(0); opacity: 1; }
  33%      { transform: translateX(11px); opacity: 1; }
  66%      { transform: translateX(22px); opacity: 1; }
}

/* Reduced-motion users: keep dots present but skip the moving cursor and
   the brighten animation. */
@media (prefers-reduced-motion: reduce) {
  .chat-msg.assistant.is-thinking .body::before,
  .chat-msg.assistant.is-thinking .body::after {
    animation: none;
  }
}


/* ==== from polish3.css ==== */
/* ============================================================================
   Oceanus — Polish, round 4.
   ----------------------------------------------------------------------------
   Four more surgical tweaks:
     7.  Empty states — consistent friendly treatment across the .*-empty
         classes scattered through the app (dashboard, IM, watchlist, chart,
         calendar, pipeline, news). Pads + centers + adds a subtle prefix
         glyph so empty surfaces look intentional, not broken.
     8.  Skeleton loaders — generic .sk-line / .sk-card classes producing a
         soft shimmer. Apply per-surface as we touch each page; the helper
         lives here so any future template can opt in.
     9.  Sidebar nav active state — replace flat accent-muted background
         with a softer gradient sliver, no bg fill (more "rail" than "tag").
     10. Custom scrollbars — thin, accent-tinted on hover only. App-wide.

   To revert: delete the <link> in base.html.
   ========================================================================== */

/* ----------------------------------------------------------------------------
   #7 — Empty states. Every existing `.*-empty` class in the app gets the
   same calm treatment: muted color, centered, generous padding, and a tiny
   "◌" glyph prefix that signals "intentionally empty, not broken." Each
   surface's specific empty CSS continues to apply on top.
   -------------------------------------------------------------------------- */
.dash-empty,
.im-empty,
.wl-empty,
.cal-empty,
.t-empty,
.news-empty,
.earn-empty,
.fund-empty,
.chart-empty,
.pp-empty,
.finder-empty,
.th-empty,
.sb-search-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: var(--fs-sm);
  padding: 18px 14px;
  line-height: 1.5;
}
.dash-empty::before,
.im-empty::before,
.wl-empty::before,
.cal-empty::before,
.t-empty::before,
.news-empty::before,
.earn-empty::before,
.fund-empty::before,
.pp-empty::before,
.finder-empty::before,
.th-empty::before {
  content: "◌";
  display: block;
  font-size: 18px;
  color: color-mix(in srgb, var(--text-muted) 60%, transparent);
  margin-bottom: 4px;
  letter-spacing: 0;
}
/* Empty-hint paragraph (e.g. "Ask an admin to add you.") sits below the
   main empty line — slightly dimmer. */
.im-empty-hint,
.wl-empty-hint,
.finder-empty-hint {
  display: block;
  margin-top: 6px;
  font-size: var(--fs-xs);
  opacity: 0.7;
}

/* ----------------------------------------------------------------------------
   #8 — Skeleton loaders. Generic helpers; pages that want them can replace
   their "Loading…" text with `<div class="sk-line"></div>` etc.
   -------------------------------------------------------------------------- */
@keyframes oc-shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}
.sk-line,
.sk-card,
.sk-circle,
.sk-block {
  display: inline-block;
  background: linear-gradient(
    90deg,
    var(--bg-elevated-2) 0%,
    color-mix(in srgb, var(--accent) 8%, var(--bg-elevated-2)) 50%,
    var(--bg-elevated-2) 100%
  );
  background-size: 200% 100%;
  animation: oc-shimmer 1.6s ease-in-out infinite;
  border-radius: 4px;
}
.sk-line {
  height: 10px;
  width: 100%;
  margin: 6px 0;
}
.sk-line.sk-short { width: 40%; }
.sk-line.sk-mid   { width: 70%; }
.sk-circle {
  width: 24px; height: 24px;
  border-radius: 50%;
}
.sk-block {
  height: 80px;
  width: 100%;
}
.sk-card {
  height: 60px;
  width: 100%;
  margin: 4px 0;
}
/* Stack of three lines for a "loading row" pattern. */
.sk-row {
  display: flex; flex-direction: column; gap: 4px;
  padding: 10px 14px;
}

/* Reduced motion: keep skeletons present, kill the shimmer. */
@media (prefers-reduced-motion: reduce) {
  .sk-line, .sk-card, .sk-circle, .sk-block { animation: none; }
}

/* ----------------------------------------------------------------------------
   #9 — Sidebar nav active state. Soft gradient sliver instead of flat
   accent-muted background. Reads as a left-edge "rail indicator" rather
   than a tag. Plus the icon picks up a subtle gradient fill via background-
   clip: text.
   -------------------------------------------------------------------------- */
.nav-item.active {
  background: var(--bg-elevated-2) !important;
  border-left: none !important;
  border-image: none !important;
  color: var(--text-primary) !important;
}
.nav-item.active::before {
  display: none !important;
}
.nav-item { position: relative; }
.nav-item.active .icon {
  color: var(--nav-ico, var(--accent)) !important;
}
.nav-item.active .label {
  color: var(--text-primary) !important;
  font-weight: var(--fw-semibold);
}

/* ----------------------------------------------------------------------------
   #10 — Custom scrollbars. Thin rail; thumb only visible at rest in muted
   form, brightens on hover. Both WebKit and Firefox supported.
   -------------------------------------------------------------------------- */
:root {
  --scrollbar-thumb:        color-mix(in srgb, var(--text-muted) 50%, transparent);
  --scrollbar-thumb-hover:  color-mix(in srgb, var(--accent) 70%, transparent);
  --scrollbar-track:        transparent;
}

*::-webkit-scrollbar         { width: 10px; height: 10px; }
*::-webkit-scrollbar-track   { background: var(--scrollbar-track); }
*::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border: 2px solid transparent;
  background-clip: padding-box;
  border-radius: 999px;
  transition: background-color var(--tr-fast);
}
*::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
  background-clip: padding-box;
}
*::-webkit-scrollbar-corner  { background: transparent; }

/* Firefox: scrollbar-width + scrollbar-color. The thumb color is the
   "active/hover" tone; Firefox doesn't yet support per-state styling. */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

/* ----------------------------------------------------------------------------
   #9b — Sidebar rows as separate pills (2026-10-15).
   -------------------------------------------------------------------------- */
/* A 2px gutter stays. The row box is 10% under the 25.5px pill (22.9px).
   Vertical padding fits a 16px icon inside that box. The active row keeps
   its 1px left edge so nothing shifts, and hover is a lighter tint. */
.sidebar .nav-item {
  margin-top: 2px;
  margin-bottom: 2px;
  padding-top: 2.46px;
  padding-bottom: 2.46px;
  min-height: calc((24px * 1.2 - 2px) * 0.95 * 0.9);
}
.sidebar .nav-item.active {
  border-left: 1px solid transparent !important;
}
html body .sidebar .nav-item:hover:not(.active) {
  background: color-mix(in srgb, var(--bg-elevated-2) 55%, transparent);
}

/* A view-transition-name makes .main-content a stacking context, which
   trapped the floating chat (z 9000) under the sidebar (z 1310). Float and
   mini drop the name; the docked chat keeps the page slide. */
body:has(#chat-drawer.mode-float, #chat-drawer.mode-mini) .main-content {
  view-transition-name: none;
}
