/* Site Builder — Grok, the Claude panel's fourth tab (grok.js).
   Dressed as Grok Imagine: pure black, white type, graphite surfaces with
   hairline edges, everything round — pills, a composer docked at the bottom
   with a white send circle, a masonry gallery of what was made, and the Grok
   mark (white on black, like its app icon) on the tab. No accent colour:
   Grok's only "colour" is white, so the things to press are white with black
   words, and focus is a white ring. */

.chat { --gk-bg: #000000; --gk-s1: #0F0F0F; --gk-s2: #171717; --gk-s3: #222222; --gk-line: rgba(255, 255, 255, .09); --gk-line-hi: rgba(255, 255, 255, .18); --gk-ink: #FFFFFF; --gk-mute: rgba(255, 255, 255, .56); --gk-faint: rgba(255, 255, 255, .36); }

/* the panel header keeps one line: with Grok up, the chat's own controls step out */
.chat.is-gk :is(#chat-people, #chat-new) { display: none; }
.chat.is-gk > :is(#chat-tabs-wrap, #chat-feed, #chat-form, #ag-chatbar, #hf-chat-live) { display: none !important; }

/* ---- the mark on its black tile: the tab ---- */
.gk-badge {
  display: inline-grid; place-items: center; flex: none; width: 16px; height: 16px; border-radius: 5px;
  background: #000; color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14);
}
.ag-tab .gk-badge svg, .gk-badge svg { display: block; width: 11px; height: 11px; }
.ag-tab[data-tab="grok"] { padding-left: 5px; }
/* a narrow panel keeps the tile and drops the word, as Higgsfield's does */
@container cl-panel (max-width: 380px) {
  .ag-tab[data-tab="grok"] > span:not(.gk-badge) { display: none; }
  .ag-tab[data-tab="grok"] { padding: 0 6px; }
  .ag-tab .gk-badge svg { display: block; }
}

/* ---- the pane: Grok's black, inset in the panel ---- */
.gk-view.ag-view:not([hidden]) {
  color-scheme: dark;
  display: flex; flex-direction: column; position: relative; overflow: hidden;
  margin: 2px 8px 8px; padding: 0; border-radius: 18px;
  background: var(--gk-bg); color: var(--gk-ink);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .06), 0 12px 32px rgba(0, 0, 0, .25);
  font-family: var(--sans);
}
.gk-shell { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }
.gk-shell.is-hello { overflow-y: auto; }
.gk-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 12px 10px 10px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .16) transparent; }
.gk-dock { flex: none; position: relative; padding: 0 8px 8px; }
.gk-dock::before { content: ''; position: absolute; left: 0; right: 0; bottom: 100%; height: 22px; background: linear-gradient(to top, #000, transparent); pointer-events: none; }
.gk-spacer { flex: 1; }
.gk-loading { display: flex; align-items: center; justify-content: center; gap: 9px; padding: 48px 0; font-size: 12.5px; color: var(--gk-mute); }
.gk-spin {
  display: inline-block; flex: none; width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .2); border-top-color: #fff; animation: gk-turn .8s linear infinite;
}
.gk-spin.dark { border-color: rgba(0, 0, 0, .18); border-top-color: #000; }
@keyframes gk-turn { to { transform: rotate(360deg); } }
.gk-err { margin: 0; padding: 7px 11px; border-radius: 12px; font-size: 12px; line-height: 1.45; background: rgba(255, 82, 82, .1); color: #FF9C9C; box-shadow: inset 0 0 0 1px rgba(255, 82, 82, .25); }
.gk-link { border: none; background: none; padding: 0; cursor: pointer; font: 600 11px var(--sans); color: var(--gk-mute); text-decoration: underline; text-underline-offset: 2px; text-decoration-color: rgba(255, 255, 255, .25); }
.gk-link:hover { color: #fff; }

/* the wordmark: the mark, "Grok" bold, "Imagine" light */
.gk-word { display: inline-flex; align-items: center; gap: 7px; font: 700 15px/1 var(--sans); letter-spacing: -.02em; color: #fff; white-space: nowrap; }
.gk-word svg { width: 18px; height: 18px; flex: none; }
.gk-word i { font-style: normal; font-weight: 400; color: var(--gk-mute); }

/* ---- the top: wordmark, then All · Images · Videos ---- */
.gk-top { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 2px 2px 12px; }
.gk-filter { margin-left: auto; display: inline-flex; gap: 2px; padding: 2px; border-radius: 999px; background: var(--gk-s1); box-shadow: inset 0 0 0 1px var(--gk-line); min-width: 0; }
.gk-filter button {
  display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; border: none; border-radius: 999px; cursor: pointer;
  background: transparent; font: 600 11px var(--sans); color: var(--gk-mute); white-space: nowrap;
  transition: background .15s var(--ease-out), color .15s var(--ease-out);
}
.gk-filter button:hover { color: #fff; }
.gk-filter button[aria-pressed="true"] { background: #fff; color: #000; }
.gk-filter i { font-style: normal; font-weight: 500; opacity: .55; font-variant-numeric: tabular-nums; }
@container cl-panel (max-width: 330px) { .gk-filter i { display: none; } }
/* Imagine | Code sits beside the wordmark; what each mode shows goes on the row under it */
.gk-subtop { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 0 2px 12px; }
.gk-subtop .gk-filter { margin-left: 0; }

/* ---- Code: a chat with Grok on the site ---- */
.gkc-chat { flex: 1 1 auto; min-width: 0; max-width: 100%; }
.chat .gk-view.ag-view .gkc-chat select { flex: 1; min-width: 0; text-overflow: ellipsis; }
.gkc-bar .gk-chipbtn { flex: none; }
.gkc-feed { display: flex; flex-direction: column; gap: 8px; padding: 2px 2px 6px; }
.gkc-user { align-self: flex-end; max-width: 88%; padding: 8px 12px; border-radius: 18px 18px 6px 18px; background: var(--gk-s3); }
.gkc-user p { margin: 0; font-size: 13px; line-height: 1.5; color: #fff; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat .gkc-said.md { font-size: 13px; line-height: 1.6; color: rgba(255, 255, 255, .92); overflow-wrap: anywhere; }
.chat .gkc-said.md > :first-child { margin-top: 0; }
.chat .gkc-said.md > :last-child { margin-bottom: 0; }
.chat .gkc-said.md :is(h1, h2, h3, h4, h5, h6, b, strong) { color: #fff; }
.chat .gkc-said.md a { color: #fff; text-decoration-color: rgba(255, 255, 255, .45); }
.chat .gkc-said.md li::marker { color: var(--gk-faint); }
.chat .gkc-said.md code { background: var(--gk-s2); border-color: var(--gk-line); color: #fff; }
.chat .gkc-said.md pre { background: var(--gk-s1); border-color: var(--gk-line); box-shadow: none; }
.chat .gkc-said.md pre code { color: rgba(255, 255, 255, .9); background: none; }
.chat .gkc-said.md blockquote { border-color: var(--gk-line-hi); color: var(--gk-mute); }
.chat .gkc-said.md hr { border-top-color: var(--gk-line); }
.gkc-tool { display: flex; align-items: center; gap: 7px; min-width: 0; padding: 0 4px; font: 500 11px/1.4 var(--mono, ui-monospace, monospace); color: var(--gk-faint); }
.gkc-tool svg { width: 12px; height: 12px; flex: none; color: var(--gk-mute); }
.gkc-tool span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gkc-model { display: flex; align-items: center; gap: 6px; padding: 4px 4px 0; font: 650 9.5px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--gk-faint); }
.gkc-model svg { width: 11px; height: 11px; flex: none; color: var(--gk-mute); }
.gkc-model span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gkc-done { align-self: flex-start; padding: 3px 9px; border-radius: 999px; background: var(--gk-s1); box-shadow: inset 0 0 0 1px var(--gk-line); font: 600 10.5px var(--sans); color: var(--gk-mute); }
.gkc-done.is-failed { color: #FF9C9C; box-shadow: inset 0 0 0 1px rgba(255, 82, 82, .25); }
.gkc-err { overflow-wrap: anywhere; white-space: pre-wrap; }
.gkc-working { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 2px 4px; font-size: 12px; color: var(--gk-mute); }
.gkc-working span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- the hello: before anything is made, and before the key ---- */
.gk-hero, .gk-hello { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 26px 8px 18px; }
.gk-hello { padding: 40px 18px 24px; gap: 12px; }
.gk-hero-mark {
  display: grid; place-items: center; width: 64px; height: 64px; border-radius: 20px; color: #fff;
  background: radial-gradient(circle at 50% 30%, #1E1E1E, #050505 70%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12), 0 0 40px rgba(255, 255, 255, .07);
  animation: gk-breathe 4.5s ease-in-out infinite;
}
.gk-hero-mark svg { width: 34px; height: 34px; }
.gk-hero-mark.lg { width: 76px; height: 76px; border-radius: 24px; }
.gk-hero-mark.lg svg { width: 40px; height: 40px; }
@keyframes gk-breathe { 50% { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18), 0 0 56px rgba(255, 255, 255, .13); } }
.gk-hero h2, .gk-hello h2 { margin: 6px 0 0; font: 700 22px/1.1 var(--sans); letter-spacing: -.03em; color: #fff; }
.gk-hero p, .gk-hello p { margin: 0; max-width: 300px; font-size: 12.5px; line-height: 1.55; color: var(--gk-mute); }
.gk-hero p b { color: #fff; font-weight: 600; }
.gk-ideas { display: flex; flex-direction: column; gap: 6px; width: 100%; margin-top: 10px; }
.gk-idea {
  display: block; width: 100%; text-align: left; padding: 9px 13px; border: none; border-radius: 14px; cursor: pointer;
  background: var(--gk-s1); box-shadow: inset 0 0 0 1px var(--gk-line); font: 400 12px/1.4 var(--sans); color: rgba(255, 255, 255, .78);
  transition: background .15s var(--ease-out), box-shadow .15s var(--ease-out), color .15s var(--ease-out), transform .3s var(--ease-spring);
}
.gk-idea:hover { background: var(--gk-s2); box-shadow: inset 0 0 0 1px var(--gk-line-hi); color: #fff; }
.gk-idea:active { transform: scale(.98); transition-duration: .06s; }
.gk-none { margin: 30px 0; text-align: center; font-size: 12px; color: var(--gk-mute); }
.gk-small { font-size: 11.5px !important; color: var(--gk-faint) !important; }
.gk-small a, .gk-hello a { color: #fff; }

/* the key form */
.gk-connect { display: flex; gap: 6px; width: 100%; max-width: 320px; margin-top: 6px; }
.chat .gk-view.ag-view .gk-connect input {
  flex: 1; min-width: 0; height: 40px; padding: 0 16px; border-radius: 999px; border: none; outline: none;
  background: var(--gk-s2); box-shadow: inset 0 0 0 1px var(--gk-line); font: 400 13px var(--mono, ui-monospace, monospace); color: #fff;
}
.chat .gk-view.ag-view .gk-connect input:focus { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5), 0 0 0 3px rgba(255, 255, 255, .08); }
.chat .gk-view.ag-view .gk-connect input::placeholder { color: var(--gk-faint); }
.gk-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px; padding: 0 18px; border: none; border-radius: 999px; cursor: pointer;
  background: var(--gk-s3); font: 650 13px var(--sans); color: #fff; white-space: nowrap;
  transition: background .15s var(--ease-out), transform .3s var(--ease-spring), opacity .15s;
}
.gk-btn.primary { background: #fff; color: #000; }
.gk-btn.primary:hover { background: #E6E6E6; }
.gk-btn:active { transform: scale(.96); transition-duration: .06s; }
.gk-btn[disabled] { cursor: default; opacity: .75; }
.gk-btn.primary .gk-spin { border-color: rgba(0, 0, 0, .18); border-top-color: #000; }

/* Sign in with Grok: one wide white pill with the mark, the API key folded under it */
.gk-btn.wide { width: 100%; max-width: 320px; height: 44px; margin-top: 8px; font-size: 14px; }
.gk-btn svg { width: 16px; height: 16px; flex: none; }
.gk-keyway { width: 100%; max-width: 320px; margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--gk-line); text-align: left; }
.gk-keyway summary {
  cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: center; gap: 6px;
  font: 600 12px var(--sans); color: var(--gk-mute); transition: color .15s var(--ease-out);
}
.gk-keyway summary::-webkit-details-marker { display: none; }
.gk-keyway summary::before { content: '›'; font-size: 14px; line-height: 1; transition: transform .2s var(--ease-out); }
.gk-keyway[open] summary::before { transform: rotate(90deg); }
.gk-keyway summary:hover { color: #fff; }
.gk-keyway .gk-connect { margin-top: 10px; }
.gk-keyway .gk-small { margin-top: 8px !important; text-align: center; }
/* …and once pressed: the code to approve on x.ai, big and monospaced, like Grok's own device screen */
.gk-hero-mark.is-waiting { animation: gk-breathe 1.8s ease-in-out infinite; }
.gk-code {
  margin: 4px 0 2px; padding: 12px 20px; border: none; border-radius: 16px; cursor: copy;
  background: var(--gk-s2); box-shadow: inset 0 0 0 1px var(--gk-line-hi);
  font: 700 26px/1 var(--mono, ui-monospace, monospace); letter-spacing: .14em; color: #fff;
  transition: background .15s var(--ease-out), transform .3s var(--ease-spring);
}
.gk-code:hover { background: var(--gk-s3); }
.gk-code:active { transform: scale(.97); transition-duration: .06s; }
.gk-sign-acts { display: flex; gap: 6px; margin-top: 4px; }
.gk-sign-acts .gk-btn { text-decoration: none; }
.gk-wait { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 4px !important; text-align: left; }
.gk-switch { display: block; margin: 8px auto 0; }
.gks-code { font-size: 13px; letter-spacing: .08em; }

/* ---- the gallery: a masonry of tiles ---- */
.gk-grid { columns: 2 116px; column-gap: 6px; }
.gk-tile {
  position: relative; break-inside: avoid; margin: 0 0 6px; border-radius: 14px; overflow: hidden;
  background: var(--gk-s1); box-shadow: inset 0 0 0 1px var(--gk-line);
  animation: gk-in .45s var(--ease-out) both;
}
@keyframes gk-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.gk-media-link { display: block; cursor: zoom-in; touch-action: manipulation; }
.gk-media { display: block; width: 100%; height: auto; background: #0A0A0A; }
video.gk-media { min-height: 80px; }
.gk-badge-v {
  position: absolute; top: 7px; left: 7px; display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 7px 0 6px; border-radius: 999px;
  background: rgba(0, 0, 0, .55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font: 650 10px var(--sans); color: #fff; letter-spacing: .01em; pointer-events: none;
}
.gk-badge-v svg { width: 9px; height: 9px; }
/* the caption and the actions come up over the picture under the pointer */
.gk-cap {
  position: absolute; left: 0; right: 0; bottom: 0; margin: 0; padding: 26px 9px 8px;
  background: linear-gradient(to top, rgba(0, 0, 0, .82), rgba(0, 0, 0, 0)); pointer-events: none;
  opacity: 0; transform: translateY(4px); transition: opacity .2s var(--ease-out), transform .2s var(--ease-out);
}
.gk-cap p { margin: 0; font-size: 11px; line-height: 1.35; color: rgba(255, 255, 255, .9); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gk-tile-acts {
  position: absolute; top: 6px; right: 6px; display: flex; flex-direction: column; gap: 4px; pointer-events: none;
  opacity: 0; transform: translateX(4px); transition: opacity .2s var(--ease-out), transform .2s var(--ease-out);
}
.gk-tile.is-done:hover .gk-cap, .gk-tile.is-done:focus-within .gk-cap,
.gk-tile.is-done:hover .gk-tile-acts, .gk-tile.is-done:focus-within .gk-tile-acts { opacity: 1; transform: none; }
.gk-tile.is-done:is(:hover, :focus-within) .gk-tile-acts { pointer-events: auto; }
/* touch screens have no hover: the actions stay, the caption stays off the picture */
@media (hover: none) { .gk-tile-acts { opacity: 1; transform: none; pointer-events: auto; } }
.gk-round {
  display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: none; border-radius: 50%; cursor: pointer; flex: none;
  background: rgba(0, 0, 0, .55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); color: #fff;
  transition: background .15s var(--ease-out), color .15s var(--ease-out), transform .3s var(--ease-spring);
}
.gk-round svg { width: 14px; height: 14px; }
.gk-round:hover { background: #fff; color: #000; }
.gk-round:active { transform: scale(.9); transition-duration: .06s; }
.gk-round[disabled] { opacity: .3; cursor: default; background: rgba(0, 0, 0, .55); color: #fff; }

/* one being made: a breathing black tile with the mark and a clock */
.gk-tile.is-working { box-shadow: inset 0 0 0 1px var(--gk-line-hi); }
.gk-blank {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  aspect-ratio: var(--ar, 1 / 1); min-height: 110px; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 40%, #161616, #050505);
}
.gk-blank::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .07) 48%, transparent 66%);
  background-size: 250% 100%; animation: gk-sheen 1.8s linear infinite;
}
@keyframes gk-sheen { from { background-position: 130% 0; } to { background-position: -130% 0; } }
.gk-orb { position: relative; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: #fff; animation: gk-pulse 1.6s ease-in-out infinite; }
.gk-orb svg { width: 24px; height: 24px; }
@keyframes gk-pulse { 50% { opacity: .45; transform: scale(.92); } }
.gk-blank-txt { position: relative; font: 600 11.5px var(--sans); color: rgba(255, 255, 255, .82); }
.gk-blank-clock { position: relative; font: 500 10.5px var(--mono, ui-monospace, monospace); color: var(--gk-faint); font-variant-numeric: tabular-nums; }
.gk-cap.is-static { opacity: 1; transform: none; }

/* one that did not come out */
.gk-fail { display: flex; flex-direction: column; gap: 4px; padding: 11px 11px 10px; }
.gk-fail b { font: 650 12px var(--sans); color: #fff; }
.gk-fail > span { font-size: 11px; line-height: 1.4; color: #FF9C9C; }
.gk-fail-prompt { margin: 2px 0 0; font-size: 11px; line-height: 1.35; color: var(--gk-faint); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gk-fail-acts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.gk-chipbtn {
  display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; border: none; border-radius: 999px; cursor: pointer;
  background: var(--gk-s3); font: 600 10.5px var(--sans); color: #fff; transition: background .15s var(--ease-out);
}
.gk-chipbtn svg { width: 11px; height: 11px; }
.gk-chipbtn:hover { background: #2E2E2E; }
.gk-chipbtn.is-quiet { width: 24px; padding: 0; justify-content: center; background: transparent; color: var(--gk-mute); margin-left: auto; }
.gk-chipbtn.is-quiet:hover { background: var(--gk-s3); color: #fff; }

/* the key, at the bottom of the gallery */
.gk-foot { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding: 10px 4px 2px; border-top: 1px solid var(--gk-line); font-size: 11px; color: var(--gk-faint); min-width: 0; }
.gk-foot > svg { width: 13px; height: 13px; flex: none; color: var(--gk-mute); }
.gk-foot > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- the composer: Grok's rounded box, docked at the bottom ---- */
.gk-composer {
  display: flex; flex-direction: column; gap: 6px; padding: 8px 8px 7px; border-radius: 24px;
  background: var(--gk-s2); box-shadow: inset 0 0 0 1px var(--gk-line), 0 10px 30px rgba(0, 0, 0, .5);
  transition: box-shadow .18s var(--ease-out);
}
.gk-composer:focus-within { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .26), 0 10px 30px rgba(0, 0, 0, .5); }
.chat .gk-view.ag-view .gk-composer textarea {
  display: block; width: 100%; box-sizing: border-box; min-height: 0; margin: 0; padding: 6px 8px 2px; border: none; border-radius: 0; outline: none; resize: none;
  background: transparent; box-shadow: none; font: 400 13.5px/1.45 var(--sans); color: #fff; max-height: 150px; overflow-y: auto;
}
.chat .gk-view.ag-view .gk-composer textarea:focus { border: none; box-shadow: none; background: transparent; }
.chat .gk-view.ag-view .gk-composer textarea::placeholder { color: var(--gk-faint); opacity: 1; }
.gk-composer .gk-err { margin: 0 2px; }
.gk-bar { display: flex; align-items: center; gap: 5px; }
.gk-icon {
  display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: none; border-radius: 50%; cursor: pointer; flex: none;
  background: transparent; box-shadow: inset 0 0 0 1px var(--gk-line-hi); color: rgba(255, 255, 255, .85);
  transition: background .15s var(--ease-out), color .15s var(--ease-out), transform .3s var(--ease-spring);
}
.gk-icon svg { width: 15px; height: 15px; }
.gk-icon:hover { background: var(--gk-s3); color: #fff; }
.gk-icon:active { transform: scale(.9); transition-duration: .06s; }
.gk-icon.is-on { background: #fff; color: #000; box-shadow: none; }
.gk-icon.is-busy svg { animation: gk-turn 1.4s linear infinite; }
.gk-icon[disabled] { cursor: default; }
.gk-send {
  display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: none; border-radius: 50%; cursor: pointer; flex: none;
  background: #fff; color: #000; transition: background .15s var(--ease-out), transform .3s var(--ease-spring), opacity .15s;
}
.gk-send svg { width: 17px; height: 17px; stroke-width: 2.4; }
.gk-send:hover { background: #E2E2E2; }
.gk-send:active { transform: scale(.9); transition-duration: .06s; }
.gk-send[disabled] { cursor: default; opacity: .7; }
:is(.gk-send, .gk-icon, .gk-round, .gk-idea, .gk-btn, .gk-pill, .gk-mode button, .gk-filter button, .gk-act):focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* Image | Video: a black track with a white thumb that glides */
.gk-mode { position: relative; display: inline-flex; padding: 2px; border-radius: 999px; background: #0A0A0A; box-shadow: inset 0 0 0 1px var(--gk-line); flex: none; }
.gk-mode-thumb {
  position: absolute; top: 2px; bottom: 2px; left: 2px; width: calc(50% - 2px); border-radius: 999px; background: #fff;
  transition: transform .34s var(--ease-out);
}
.gk-mode-thumb.is-video { transform: translateX(100%); }
.gk-mode button {
  position: relative; z-index: 1; flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; gap: 5px; height: 28px; padding: 0 11px; min-width: 0;
  border: none; border-radius: 999px; background: none; cursor: pointer; font: 650 12px var(--sans); color: var(--gk-mute);
  transition: color .2s var(--ease-out);
}
.gk-mode button svg { width: 13px; height: 13px; flex: none; }
.gk-mode button[aria-pressed="true"] { color: #000; }
.gk-mode button:not([aria-pressed="true"]):hover { color: #fff; }
@container cl-panel (max-width: 300px) { .gk-mode button span { display: none; } .gk-mode button { padding: 0 10px; } }

/* the choices under the box: small pills, one line that scrolls sideways */
.gk-opts { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: 1px 1px 0; }
.gk-opts::-webkit-scrollbar { display: none; }
.gk-pill {
  position: relative; flex: none; display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border-radius: 999px; cursor: pointer;
  background: #0E0E0E; box-shadow: inset 0 0 0 1px var(--gk-line); color: rgba(255, 255, 255, .78);
  transition: background .15s var(--ease-out), box-shadow .15s var(--ease-out);
}
.gk-pill:hover { background: var(--gk-s3); box-shadow: inset 0 0 0 1px var(--gk-line-hi); }
.gk-pill > svg { width: 11px; height: 11px; flex: none; color: var(--gk-mute); }
.gk-pill.is-model > svg { color: #fff; }
.gk-pill.is-still { cursor: default; font: 600 10.5px var(--sans); }
.chat .gk-view.ag-view .gk-pill select {
  appearance: none; -webkit-appearance: none; height: 22px; margin: 0; padding: 0 1px; border: none; outline: none; background: none; box-shadow: none; cursor: pointer;
  font: 600 10.5px var(--sans); color: inherit; width: auto;
}

/* the photo it starts from, and Claude's rewrite, ride inside the box */
.gk-src { display: flex; align-items: center; gap: 8px; padding: 4px; border-radius: 14px; background: #0C0C0C; box-shadow: inset 0 0 0 1px var(--gk-line); }
.gk-src img { width: 38px; height: 38px; border-radius: 10px; object-fit: cover; flex: none; background: #1A1A1A; }
.gk-src span { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 11px; line-height: 1.3; color: var(--gk-mute); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.gk-src span b { font-weight: 650; color: #fff; font-size: 11.5px; }
.gk-src-x, .gk-alt-x {
  display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: none; border-radius: 50%; cursor: pointer; flex: none;
  background: transparent; color: var(--gk-mute); transition: background .15s, color .15s;
}
.gk-src-x svg, .gk-alt-x svg { width: 13px; height: 13px; }
.gk-src-x:hover, .gk-alt-x:hover { background: var(--gk-s3); color: #fff; }
.gk-alt { padding: 6px 6px 4px; border-radius: 14px; background: #0C0C0C; box-shadow: inset 0 0 0 1px var(--gk-line); transition: box-shadow .18s var(--ease-out); }
.gk-alt.is-on { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .45); }
.gk-alt-head { display: flex; align-items: center; gap: 6px; }
.gk-alt-tag { flex: 1; display: inline-flex; align-items: center; gap: 5px; font: 700 10px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--gk-mute); }
.gk-alt-tag svg { width: 11px; height: 11px; color: #D97757; }
.gk-alt-pick { height: 22px; padding: 0 9px; border: none; border-radius: 999px; cursor: pointer; background: var(--gk-s3); font: 650 10.5px var(--sans); color: #fff; }
.gk-alt-pick[aria-pressed="true"] { background: #fff; color: #000; }
.chat .gk-view.ag-view .gk-alt textarea { padding: 4px 2px 0; font-size: 12.5px; }
.gk-alt-wait { display: flex; align-items: center; gap: 8px; margin: 6px 2px 4px; font-size: 12px; color: var(--gk-mute); }

/* the photo picker: a sheet over the composer */
.gk-picker {
  position: absolute; left: 8px; right: 8px; bottom: calc(100% - 4px); z-index: 3; max-height: 300px; display: flex; flex-direction: column;
  padding: 10px; border-radius: 20px; background: #121212; box-shadow: inset 0 0 0 1px var(--gk-line-hi), 0 -12px 40px rgba(0, 0, 0, .7);
  animation: gk-up .26s var(--ease-out) both;
}
@keyframes gk-up { from { opacity: 0; transform: translateY(8px); } }
.gk-pick-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; font-size: 11.5px; color: var(--gk-mute); }
.gk-pick-head b { color: #fff; font-weight: 650; font-size: 12.5px; }
.gk-pick-head .gk-alt-x { margin-left: auto; }
.gk-pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 5px; overflow-y: auto; min-height: 0; }
.gk-pick { position: relative; aspect-ratio: 1; padding: 0; border: none; border-radius: 10px; overflow: hidden; cursor: pointer; background: #1A1A1A; }
.gk-pick img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .25s var(--ease-out), opacity .2s; }
.gk-pick:hover img { transform: scale(1.06); }
.gk-pick.is-on { box-shadow: 0 0 0 2px #fff; }
.gk-pick-note { display: flex; align-items: center; gap: 8px; margin: 4px 2px 6px; font-size: 12px; color: var(--gk-mute); }

/* ---- the viewer: one up close, over the gallery ---- */
.gk-viewer-wrap:empty { display: none; }
.gk-viewer {
  position: absolute; inset: 0; z-index: 6; display: flex; flex-direction: column; background: #000; overflow-y: auto;
  animation: gk-fade .22s var(--ease-out) both;
}
@keyframes gk-fade { from { opacity: 0; } }
.gk-v-top { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 5px; padding: 9px 9px 6px; background: linear-gradient(#000 60%, rgba(0, 0, 0, 0)); }
.gk-v-count { margin-left: 4px; font: 500 11px var(--mono, ui-monospace, monospace); color: var(--gk-faint); font-variant-numeric: tabular-nums; }
.gk-v-stage { display: grid; place-items: center; padding: 0 10px; }
.gk-v-media { display: block; max-width: 100%; max-height: 52vh; border-radius: 14px; background: #0A0A0A; box-shadow: 0 0 0 1px var(--gk-line); animation: gk-zoom .3s var(--ease-out) both; cursor: grab; }
@keyframes gk-zoom { from { opacity: 0; transform: scale(.96); } }
.gk-v-info { display: flex; flex-direction: column; gap: 7px; padding: 12px 12px 14px; }
.gk-v-prompt { margin: 0; font-size: 13px; line-height: 1.5; color: #fff; user-select: text; white-space: pre-wrap; }
.gk-v-rev summary { cursor: pointer; font: 600 11px var(--sans); color: var(--gk-mute); list-style: none; }
.gk-v-rev summary::-webkit-details-marker { display: none; }
.gk-v-rev summary::before { content: '›'; display: inline-block; margin-right: 5px; transition: transform .2s var(--ease-out); }
.gk-v-rev[open] summary::before { transform: rotate(90deg); }
.gk-v-rev p { margin: 6px 0 0; font-size: 12px; line-height: 1.5; color: rgba(255, 255, 255, .72); user-select: text; }
.gk-v-meta { font-size: 11px; color: var(--gk-faint); }
.gk-v-path { font: 500 10.5px var(--mono, ui-monospace, monospace); color: var(--gk-mute); overflow-wrap: anywhere; }
.gk-v-acts { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.gk-act {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: none; border-radius: 999px; cursor: pointer; text-decoration: none;
  background: var(--gk-s2); box-shadow: inset 0 0 0 1px var(--gk-line); font: 600 12px var(--sans); color: #fff;
  transition: background .15s var(--ease-out), box-shadow .15s var(--ease-out), transform .3s var(--ease-spring);
}
.gk-act svg { width: 14px; height: 14px; flex: none; }
.gk-act:hover { background: var(--gk-s3); box-shadow: inset 0 0 0 1px var(--gk-line-hi); }
.gk-act:active { transform: scale(.95); transition-duration: .06s; }
.gk-act.is-primary { background: #fff; color: #000; box-shadow: none; }
.gk-act.is-primary:hover { background: #E4E4E4; }
.gk-act.is-danger { color: #FF9C9C; }
.gk-act.is-danger:hover { background: rgba(255, 82, 82, .14); }

/* the house dropdown (app.js, .dd-menu) opened from a pill in this pane:
   Grok's graphite with white type. It hangs off <body>, outside .chat, so
   the colours are spelled out. */
body .dd-menu.dd-gk {
  background: #141414; border: 1px solid rgba(255, 255, 255, .12); border-radius: 14px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, .6); color-scheme: dark;
}
body .dd-gk .dd-item { color: rgba(255, 255, 255, .82); font-size: 12.5px; border-radius: 9px; }
body .dd-gk .dd-item:hover, body .dd-gk .dd-item.focused { background: #262626; color: #FFFFFF; }
body .dd-gk .dd-item.selected { background: #FFFFFF; color: #000000; }
body .dd-gk .dd-item.selected:hover, body .dd-gk .dd-item.selected.focused { background: #E6E6E6; color: #000000; }
body .dd-gk .dd-group { color: rgba(255, 255, 255, .45); }

/* ---- Settings → Connections → Grok (grok.js, gkSetRender) ----
   The brand card wears Grok's black, as Higgsfield's wears its near-black. */
.gks-brand { background: #000; border-color: #000; }
.gks-brand .gk-word { font-size: 16px; }
.gks-brand .nf-summary { color: rgba(255, 255, 255, .7); }
#gks-body .set-row + .set-hint, #gks-body .set-status + .set-hint { margin-top: 10px; }
#gks-body .set-hint a { color: var(--accent-deep); font-weight: 600; }
.gks-actions { margin-top: 12px; }
.gks-err { color: var(--danger-ink); }

@media (prefers-reduced-motion: reduce) {
  .gk-tile, .gk-viewer, .gk-v-media, .gk-picker { animation: none; }
  .gk-hero-mark, .gk-hero-mark.is-waiting, .gk-orb, .gk-blank::before { animation: none; }
  .gk-mode-thumb, .gk-cap, .gk-tile-acts { transition: none; }
}
