/* 2026-10-28 targeted fixes on top of the existing AgentDock shell. */

/* Page-enter animation blurs the whole page (filter: blur(4px) -> 0). On slow
   devices/networks the text stays visibly smeared; keep the fade, drop the blur. */
#root [style*="filter: blur"] {
  filter: none !important;
}

/* Rankings title sat under the floating header (title top 80px < header bottom 84px). */
body:has(header.pointer-events-none a[href="/rankings"][aria-current="page"]) #root > .bg-background > .relative > .max-w-\[1280px\] {
  padding-top: 7rem;
}

/* fix10: console cleanups (2026-10-28). */

/* Active tabs and sidebar items already have a tint and a fine rim; the extra
   2px marker on their left edge is redundant. */
html body:has([data-slot="sidebar-wrapper"]) [data-slot="tabs-trigger"]::before,
html body:has([data-slot="sidebar-wrapper"]) :is([data-slot="sidebar-menu-button"],[data-slot="sidebar-menu-sub-button"])::before {
  content: none !important;
}

/* Table row lines: the opaque sticky columns (model, actions) and the checkbox
   column covered the row border, so lines only showed in the middle columns.
   Draw the line on every cell instead. */
html body:has([data-slot="sidebar-wrapper"]) [data-slot="sidebar-inset"]:not(#ad-x) :is([data-slot="table-body"],[data-slot="table-header"]) > [data-slot="table-row"] {
  border-bottom-width: 0 !important;
}
html body:has([data-slot="sidebar-wrapper"]) [data-slot="sidebar-inset"]:not(#ad-x) [data-slot="table-body"] > [data-slot="table-row"]:not(:last-child) > [data-slot="table-cell"],
html body:has([data-slot="sidebar-wrapper"]) [data-slot="sidebar-inset"]:not(#ad-x) [data-slot="table-header"] > [data-slot="table-row"] > [data-slot="table-head"] {
  background-image: linear-gradient(to top, var(--ad-grid-edge, rgba(104,115,143,.24)) 1px, transparent 1px) !important;
}

/* Buttons that are just cell content (price summary etc.) lit up as a separate
   rounded tile on hover inside the already highlighted row. */
html body:has([data-slot="sidebar-wrapper"]) [data-slot="sidebar-inset"] [data-slot="table-cell"]:not(.sticky) button:not(.bg-primary):not(.bg-destructive):not([data-slot="checkbox"]):is(:hover,[aria-expanded="true"]) {
  background: transparent !important;
  box-shadow: none !important;
}

/* Toasts sat on top of the floating header and its links showed through them. */
[data-sonner-toaster][data-y-position="top"] {
  top: 92px !important;
}


/* fix11: API keys table. Native pins min-width max(100%,1800px) plus fixed column widths
   and percentage <col> widths (e.g. 180px for "default", 260px for "无限制 7.37"), so below 1800px the table overflowed
   and the sticky actions column sat on top of the time/expiry columns. Size columns by
   content instead. Below 1280px the columns cannot fit anyway, so keep native scrolling there. */
@media (min-width: 1280px) {
html body:has([data-slot="sidebar-menu-button"][href="/keys"][data-active]:not([data-active="false"])) [data-slot="sidebar-inset"] [data-slot="table"] {
  min-width: 100% !important;
}
html body:has([data-slot="sidebar-menu-button"][href="/keys"][data-active]:not([data-active="false"])) [data-slot="sidebar-inset"] [data-slot="table"] :is([data-slot="table-head"], col) {
  width: auto !important;
}
/* Cells and badges carry max-width:100% + truncate, which let auto layout squeeze columns down to "已…";
   keep each column at least as wide as its text. */
html body:has([data-slot="sidebar-menu-button"][href="/keys"][data-active]:not([data-active="false"])) [data-slot="sidebar-inset"] [data-slot="table"] :is([data-slot="table-cell"],[data-slot="table-head"]),
html body:has([data-slot="sidebar-menu-button"][href="/keys"][data-active]:not([data-active="false"])) [data-slot="sidebar-inset"] [data-slot="table"] :is([data-slot="table-cell"],[data-slot="table-head"]) * {
  white-space: nowrap !important;
  overflow: visible !important;
  text-overflow: clip !important;
  max-width: none !important;
}
}

/* fix13: overview uptime card. Unconfigured, it is a 320px empty placeholder in its own 22rem
   column, while the left grid's last row leaves an empty cell beside the 4th card (same height).
   Flatten both wrappers into the outer grid so the uptime card fills that cell. */
@media (min-width: 1024px) {
html body:has([data-slot="sidebar-wrapper"]) [data-slot="sidebar-inset"] div.grid:has(> div:nth-child(2) > div.rounded-2xl > div.text-muted-foreground.h-80.justify-center.items-center) {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}
html body:has([data-slot="sidebar-wrapper"]) [data-slot="sidebar-inset"] div.grid:has(> div:nth-child(2) > div.rounded-2xl > div.text-muted-foreground.h-80.justify-center.items-center) > div {
  display: contents !important;
}
}

/* fix14: layering (light theme). Primary console cards were a 58% grey-blue film
   (--ad-card-fill) on a grey-blue workspace, nested panels an 8-55% film and controls 20-60%,
   so surfaces dissolved into the background. Whiter fills, a firmer edge and a soft drop shadow.
   :not(#ad-x) outranks the inline console-material variable blocks that load later. */
html:not(.dark):not(#ad-x) body:has([data-slot="sidebar-wrapper"]) {
  --ad-inner: rgba(255,255,255,.55) !important;
  --ad-inner-edge: rgba(98,104,140,.2);
  --ad-inner-shadow: 0 4px 14px -6px rgba(46,57,86,.12), inset 0 1px 0 rgba(255,255,255,.85);
  --ad-control: rgba(255,255,255,.74) !important;
  --ad-card-fill: linear-gradient(145deg,rgba(255,255,255,.5),rgba(255,255,255,.18)),rgba(249,250,253,.66);
  --ad-card-shadow: 0 14px 32px -12px rgba(43,53,82,.2),0 2px 6px rgba(43,53,82,.045),inset 0 1px 0 rgba(255,255,255,.92);
  --ad-tile-fill: rgba(255,255,255,.7);
  --ad-tile-shadow: 0 4px 12px -4px rgba(43,53,82,.1),inset 0 1px 0 rgba(255,255,255,.9);
}

/* Default avatars: the console's muted-text rule (!important) turned the white initial grey
   on the indigo fill. */
html:not(#ad-x) body [data-slot="avatar-fallback"][style*="color: white"] {
  color: #fff !important;
}

/* Overview balance tiles: "近 24 小时消耗" was 1px wider than its tile and got clipped. */
[data-slot="sidebar-inset"] div[class*="--overview-accent"] .grid > div.rounded-lg {
  padding-inline: 8px !important;
}
[data-slot="sidebar-inset"] div[class*="--overview-accent"] .grid > div.rounded-lg .truncate {
  overflow: visible;
  text-overflow: clip;
}

/* Model square (light): filter chips and toolbar toggles were near-transparent on the glass,
   and selected toggles used a grey film instead of the site's violet selection. */
html:not(.dark) body:has(header.pointer-events-none a[href="/pricing"][aria-current="page"]) {
  --catalog-filter-surface: rgba(255,255,255,.66);
  --catalog-filter-border: rgba(110,114,148,.2);
  --catalog-filter-hover: rgba(255,255,255,.88);
  --catalog-filter-selected: rgba(99,86,221,.12);
  --catalog-filter-selected-border: rgba(99,86,221,.3);
  --catalog-filter-count: rgba(110,114,148,.1);
}
html:not(.dark) body:has(header.pointer-events-none a[href="/pricing"][aria-current="page"]) main [data-slot="toggle-group"]:not(:has(.lucide-grid-2x2)) {
  background: rgba(255,255,255,.6) !important;
  box-shadow: inset 0 0 0 1px rgba(110,114,148,.18), 0 1px 2px rgba(47,51,92,.04) !important;
}
html:not(.dark) body:has(header.pointer-events-none a[href="/pricing"][aria-current="page"]) main [data-slot="toggle-group"]:not(:has(.lucide-grid-2x2)) [data-slot="toggle-group-item"][aria-pressed="true"] {
  background: rgba(99,86,221,.12) !important;
  color: #5145b8 !important;
  box-shadow: inset 0 0 0 1px rgba(99,86,221,.28) !important;
}

/* fix15: table filter buttons (shared by every console table) were dashed outlines on the glass;
   use the model square's solid chip instead. */
html:not(#ad-x) body [data-slot="sidebar-inset"] button.border-dashed {
  border-style: solid !important;
}
html:not(.dark):not(#ad-x) body [data-slot="sidebar-inset"] button.border-dashed {
  background: rgba(255,255,255,.66) !important;
  border-color: rgba(110,114,148,.2) !important;
  box-shadow: 0 1px 2px rgba(47,51,92,.04) !important;
}
html:not(.dark):not(#ad-x) body [data-slot="sidebar-inset"] button.border-dashed:hover {
  background: rgba(255,255,255,.88) !important;
}

/* fix16: tables (light). Pinned cells and the sticky header were opaque grey (#eef0f6/#e9ebf3)
   on a 55% white panel, so tables read as a grey slab. Near-white panel, pinned cells the same
   colour so rows read as one surface, a lighter header and a faint violet hover. */
html:not(.dark):not(#ad-x) body:has([data-slot="sidebar-wrapper"]) {
  --ad-grid-pinned: #fafbfd !important;
  --ad-grid-pinned-head: #f2f4f8 !important;
  --ad-grid-pinned-active: #f3f1fc !important;
}
html:not(.dark):not(#ad-x) body [data-slot="sidebar-inset"] div.rounded-lg.border:has(> div > div > table[data-slot="table"]) {
  background: #fafbfd !important;
}
html:not(.dark):not(#ad-x) body [data-slot="sidebar-inset"] [data-slot="table-body"] > [data-slot="table-row"]:hover > [data-slot="table-cell"]:not(.sticky) {
  background-color: #f3f1fc !important;
}
