/* Shard plugin preview. Scoped to .shard-product-demo and sd-* classes.
   Plugin colors come from Config.Themes; geometry from the ChatGui and SettingsGui dumps.
   The Studio chrome (title bars, dock tabs, Explorer) keeps Studio's own dark colors in every plugin theme. */

.shard-product-demo {
  /* Classic */
  --sd-bg1: #18191e;
  --sd-bg2: #202127;
  --sd-bg3: #2d2f37;
  --sd-bg4: #3c3e48;
  --sd-border: #0f1116;
  --sd-text: #ffffff;
  --sd-muted: #b4b6be;
  --sd-scrollbar: #78797f;
  --sd-on-accent: #14161c;
  --sd-accent: #08d3f4;
  --sd-accent-dark: #259ae9;
  --sd-error: #e75750;
  --sd-success: #2cc88c;
  --sd-stroke: rgba(52, 53, 59, 0.55);

  /* Studio */
  --sd-chrome: #202227;
  --sd-chrome-strip: #353741;
  --sd-chrome-text: #bcbec8;
  --sd-explorer-bg: #1d1e22;
  --sd-explorer-text: #d4d6dc;
  --sd-explorer-select: #2b5585;

  /* Page */
  --sd-page-line: #2a2c34;
  --sd-page-text: #f0f4f8;
  --sd-page-muted: #8d909b;
  --sd-sun: #fabd2f;

  --sd-dock-height: 640px;
  --sd-font: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --sd-code: "Source Code Pro", ui-monospace, Consolas, monospace;

  display: block;
  width: 100%;
  min-width: 0;
  color: var(--sd-text);
  font-family: var(--sd-font);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 0;
  text-align: left;
  container: sd-stage / inline-size;
}

.shard-product-demo[data-demo-theme="neon"] {
  --sd-bg1: #16161e; --sd-bg2: #1a1b26; --sd-bg3: #24283b; --sd-bg4: #3b4261; --sd-border: #101014;
  --sd-text: #c0caf5; --sd-muted: #8f98c4; --sd-scrollbar: #646e96; --sd-on-accent: #1a1b26;
  --sd-accent: #7aa2f7; --sd-accent-dark: #bb9af7; --sd-error: #f7768e; --sd-success: #9ece6a;
  --sd-stroke: rgba(16, 16, 20, 0.6);
}
.shard-product-demo[data-demo-theme="slate"] {
  --sd-bg1: #242933; --sd-bg2: #2e3440; --sd-bg3: #3b4252; --sd-bg4: #434c5e; --sd-border: #1f232b;
  --sd-text: #eceff4; --sd-muted: #a3acbf; --sd-scrollbar: #6e798e; --sd-on-accent: #2e3440;
  --sd-accent: #88c0d0; --sd-accent-dark: #81a1c1; --sd-error: #e2868e; --sd-success: #a3be8c;
  --sd-stroke: rgba(31, 35, 43, 0.6);
}
.shard-product-demo[data-demo-theme="wood"] {
  --sd-bg1: #1d2021; --sd-bg2: #282828; --sd-bg3: #3c3836; --sd-bg4: #504945; --sd-border: #141617;
  --sd-text: #ebdbb2; --sd-muted: #a89984; --sd-scrollbar: #7d7361; --sd-on-accent: #1d2021;
  --sd-accent: #fabd2f; --sd-accent-dark: #fe8019; --sd-error: #fb4934; --sd-success: #b8bb26;
  --sd-stroke: rgba(20, 22, 23, 0.6);
}
.shard-product-demo[data-demo-theme="classic-light"] {
  --sd-bg1: #f3f4f6; --sd-bg2: #ffffff; --sd-bg3: #e5e7eb; --sd-bg4: #d1d5db; --sd-border: #d6dae0;
  --sd-text: #1f2328; --sd-muted: #656d76; --sd-scrollbar: #8c939d; --sd-on-accent: #ffffff;
  --sd-accent: #0ea5c8; --sd-accent-dark: #2578be; --sd-error: #dc3545; --sd-success: #28a745;
  --sd-stroke: rgba(214, 218, 224, 0.9);
}
.shard-product-demo[data-demo-theme="sandstone"] {
  --sd-bg1: #f0ece2; --sd-bg2: #faf7f0; --sd-bg3: #e8e3d6; --sd-bg4: #d6cfbf; --sd-border: #ddd6c7;
  --sd-text: #332d26; --sd-muted: #756a5c; --sd-scrollbar: #9b917d; --sd-on-accent: #faf7f0;
  --sd-accent: #c96d30; --sd-accent-dark: #a0522d; --sd-error: #c0392b; --sd-success: #3e7a3c;
  --sd-stroke: rgba(221, 214, 199, 0.95);
}

.shard-product-demo *,
.shard-product-demo *::before,
.shard-product-demo *::after {
  box-sizing: border-box;
}

.shard-product-demo [hidden] {
  display: none !important;
}

.shard-product-demo :is(p, pre, ol, ul) {
  margin: 0;
}

.shard-product-demo :is(button, input, textarea) {
  margin: 0;
  font: inherit;
  letter-spacing: inherit;
  color: inherit;
}

.shard-product-demo button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  text-align: left;
  text-transform: none;
  box-shadow: none;
  cursor: pointer;
}

.shard-product-demo :is(button, input, textarea, pre, [tabindex]):focus {
  outline: none;
}

.shard-product-demo :is(button, input, textarea, pre, [tabindex]):focus-visible {
  outline: 2px solid var(--sd-accent);
  outline-offset: 1px;
  border-radius: 5px;
}

.shard-product-demo .sd-icon {
  display: block;
  flex: none;
  width: 16px;
  height: 16px;
}

.shard-product-demo .sd-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.shard-product-demo ::-webkit-scrollbar {
  width: 3px;
  height: 3px;
}

.shard-product-demo ::-webkit-scrollbar-track {
  background: transparent;
}

.shard-product-demo ::-webkit-scrollbar-thumb {
  border-radius: 2px;
  background: var(--sd-scrollbar);
}

/* ---------- Stage and Studio docks ---------- */

.sd-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.shard-product-demo[data-layout="wide"] .sd-stage {
  grid-template-columns: minmax(0, 1fr) 288px;
}

.sd-dock {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border-radius: 8px;
  background: var(--sd-chrome);
  box-shadow: 0 0 0 1px #2e3038, 0 32px 80px -36px rgba(0, 0, 0, 0.85);
}

.sd-dock-shard {
  height: var(--sd-dock-height);
  container: sd-dock / inline-size;
}

.sd-titlebar {
  position: relative;
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  height: 26px;
  padding: 0 28px;
  background: var(--sd-chrome);
  color: var(--sd-chrome-text);
  font-size: 13px;
  white-space: nowrap;
  user-select: none;
}

.sd-titlebar-close {
  position: absolute;
  top: 50%;
  right: 7px;
  color: var(--sd-chrome-text);
  transform: translateY(-50%);
}

.sd-titlebar-close .sd-icon {
  width: 13px;
  height: 13px;
}

.sd-dock-body {
  position: relative;
  flex: 1;
  min-height: 0;
  background: var(--sd-bg1);
}

.sd-dock-tabs {
  display: flex;
  flex: none;
  height: 24px;
  background: var(--sd-chrome-strip);
}

.shard-product-demo .sd-dock-tabs [role="tab"] {
  height: 100%;
  padding: 0 10px;
  color: var(--sd-chrome-text);
  font-size: 13px;
  white-space: nowrap;
}

.shard-product-demo .sd-dock-tabs [role="tab"]:hover {
  color: #ffffff;
}

.shard-product-demo .sd-dock-tabs [aria-selected="true"] {
  background: var(--sd-chrome);
  color: #f2f3f7;
}

.shard-product-demo .sd-dock-tabs [role="tab"]:focus-visible {
  outline-offset: -2px;
  border-radius: 0;
}

.sd-caption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 24px;
  margin-top: 14px !important;
  color: var(--sd-page-muted);
  font-size: 14px;
  line-height: 1.45;
}

.sd-caption-hint {
  color: var(--sd-page-text);
}


/* ---------- ChatGui ---------- */

.sd-chatgui {
  position: absolute;
  inset: 0;
  display: flex;
  background: var(--sd-bg1);
}

.sd-sidebar {
  display: none;
  flex: none;
  flex-direction: column;
  width: 30%;
  min-width: 125px;
  max-width: 250px;
  padding: 8px;
  background: var(--sd-bg1);
}

.is-sidebar-open .sd-sidebar {
  display: flex;
}

.sd-sidebar-line {
  display: none;
  flex: none;
  width: 3px;
  background: var(--sd-border);
}

.is-sidebar-open:not(.is-sidebar-overlay) .sd-sidebar-line {
  display: block;
}

.sd-sidebar-top {
  display: grid;
  gap: 12px;
  margin-bottom: 8px;
}

.sd-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 32px;
  padding-left: 8px;
}

.sd-brand {
  color: var(--sd-text);
  font-size: 20px;
  font-weight: 700;
}

.shard-product-demo .sd-icon-button {
  justify-content: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 5px;
  color: var(--sd-text);
}

.shard-product-demo .sd-icon-button:hover {
  background: var(--sd-bg3);
}

.shard-product-demo .sd-icon-button .sd-icon {
  width: 20px;
  height: 20px;
}

.shard-product-demo .sd-new-chat {
  width: 100%;
  height: 32px;
  gap: 10px;
  padding: 0 10px;
  border-radius: 5px;
  color: var(--sd-text);
  font-size: 16px;
}

.shard-product-demo .sd-new-chat:hover,
.shard-product-demo .sd-chat-entry:hover {
  background: var(--sd-bg2);
}

.sd-chats-title {
  height: 28px;
  padding-left: 8px;
  color: var(--sd-muted);
  font-size: 13px;
  line-height: 28px;
}

.sd-old-chats {
  display: grid;
  align-content: start;
  gap: 2px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--sd-scrollbar) transparent;
}

.shard-product-demo .sd-chat-entry {
  width: 100%;
  height: 30px;
  padding: 0 8px;
  border-radius: 6px;
  color: var(--sd-text);
  font-size: 16px;
}

.shard-product-demo .sd-chat-entry[aria-current="page"] {
  background: var(--sd-bg3);
}

.sd-chat-entry span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.sd-chat-container {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 8px 12px 12px;
}

/* Header: title at y 4, provider/model/reasoning at y 34, count on the right. */
.sd-chat-header {
  flex: none;
  height: 72px;
  padding: 13px 12px 0;
  border-radius: 5px;
  background: var(--sd-bg2);
  container: sd-header / inline-size;
}

.sd-header-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 26px;
}

.shard-product-demo .sd-header-title-row .sd-icon-button {
  width: 28px;
  height: 28px;
}

.sd-chat-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--sd-text);
  font-size: 18px;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.shard-product-demo .sd-header-sidebar .sd-icon {
  transform: scaleX(-1);
}

.sd-header-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 20px;
  margin-top: 4px;
  color: var(--sd-muted);
  font-size: 14px;
  white-space: nowrap;
}

.sd-header-meta > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* The plugin's header cuts the reasoning label first, then the model down to 48px, then the provider. */
.sd-meta-provider,
.sd-meta-model {
  opacity: 0.55;
  flex: none;
}

.sd-meta-model {
  flex: 0 1 auto;
  min-width: 48px;
}

.sd-meta-reasoning {
  flex: 0 1000 auto;
}

.sd-meta-count {
  flex: none;
  margin-left: auto;
}

@container sd-header (max-width: 283px) {
  .sd-meta-count {
    display: none;
  }
}

.sd-transcript {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 14px 18px 18px 26px;
  border-radius: 5px;
  background: var(--sd-bg2);
  scrollbar-width: thin;
  scrollbar-color: var(--sd-scrollbar) transparent;
}

.sd-turn {
  display: grid;
  gap: 16px;
}

.sd-turn + .sd-turn {
  margin-top: 24px;
}

.sd-user-message {
  display: flex;
  justify-content: flex-end;
}

.sd-user-content {
  width: 59%;
  padding: 7px 13px 8px;
  border-radius: 5px;
  background: var(--sd-bg4);
}

.sd-user-content p,
.sd-assistant-message {
  color: var(--sd-text);
  font-size: 20px;
  line-height: 1.25;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.sd-assistant-message {
  display: grid;
  gap: 14px;
  width: 97%;
}

.sd-assistant-message code {
  font-family: var(--sd-code);
  font-size: 0.86em;
}

.sd-worked {
  display: grid;
}

.shard-product-demo .sd-worked-header {
  width: 100%;
  height: 34px;
  gap: 6px;
  color: var(--sd-muted);
}

.sd-worked-label {
  font-size: 17px;
}

.sd-chevron {
  display: inline-block;
  flex: none;
  width: 14px;
  color: var(--sd-muted);
  font-size: 22px;
  line-height: 1;
  text-align: center;
  transform-origin: 50% 55%;
  transition: transform 140ms ease;
}

[aria-expanded="true"] > .sd-chevron {
  transform: rotate(90deg);
}

.sd-worked-status {
  margin-left: auto;
  padding-right: 20px;
  color: var(--sd-muted);
  font-size: 16px;
}

.sd-worked-status.is-error {
  color: var(--sd-error);
}

.sd-divider {
  width: calc(100% - 20px);
  height: 1px;
  background: var(--sd-border);
}

.sd-worked-details {
  display: grid;
  gap: 3px;
  padding-top: 6px;
}

.sd-worked-details > .sd-interim {
  margin: 4px 0 8px;
}

.sd-worked-details > .sd-user-message {
  margin: 8px 0;
}

/* Activity groups: icon, label and chevron, opening to the tool rows. */
.sd-group {
  display: grid;
}

.shard-product-demo .sd-group-header {
  min-height: 30px;
  gap: 6px;
  color: var(--sd-muted);
  font-size: 18px;
}

.sd-activity-icon {
  width: 18px !important;
  height: 18px !important;
}

.sd-group.is-error .sd-activity-icon {
  color: var(--sd-error);
}

.sd-group-details {
  padding: 4px 0 8px;
}

.sd-tool {
  width: calc(100% - 20px);
  overflow: hidden;
  border-radius: 6px;
  background: var(--sd-bg1);
}

.shard-product-demo .sd-tool-header {
  position: relative;
  width: 100%;
  height: 40px;
  gap: 0;
  padding: 0 8px;
}

.sd-tool-status {
  flex: none;
  width: 16px;
  margin-right: 6px;
  color: var(--sd-muted);
  font-size: 15px;
  text-align: center;
}

.sd-tool[data-status="running"] .sd-tool-status,
.sd-tool[data-status="running"] .sd-tool-state {
  color: var(--sd-accent);
}

.sd-tool[data-status="failed"] .sd-tool-status {
  color: var(--sd-error);
}

.sd-tool-summary {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--sd-text);
  font-size: 17px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.sd-tool-state {
  flex: none;
  margin-left: 8px;
  color: var(--sd-muted);
  font-size: 15px;
}

.sd-tool-expand {
  flex: none;
  width: 16px;
  margin-left: 8px;
  color: var(--sd-muted);
  font-size: 18px;
  text-align: center;
  transition: transform 140ms ease;
}

[aria-expanded="true"] > .sd-tool-expand {
  transform: rotate(90deg);
}

.sd-tool-details {
  display: grid;
  gap: 12px;
  padding: 0 12px 12px;
}

.sd-pane {
  display: grid;
  gap: 6px;
}

.sd-pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 24px;
  color: var(--sd-muted);
  font-size: 14px;
}

.sd-pane-actions {
  display: flex;
  gap: 4px;
}

.shard-product-demo .sd-pane-button {
  height: 24px;
  padding: 0 8px;
  border-radius: 4px;
  color: var(--sd-muted);
  font-size: 14px;
}

.shard-product-demo .sd-pane-button:hover {
  background: var(--sd-bg3);
  color: var(--sd-text);
}

.sd-pane-text {
  max-height: 112px;
  overflow: auto;
  padding: 8px 10px;
  border-radius: 5px;
  background: var(--sd-bg2);
  color: var(--sd-text);
  font-family: var(--sd-font);
  font-size: 16px;
  line-height: 1.35;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  tab-size: 4;
  scrollbar-width: thin;
  scrollbar-color: var(--sd-scrollbar) transparent;
}

.sd-diff {
  font-family: var(--sd-code);
  font-size: 14px;
  white-space: pre;
  overflow-wrap: normal;
}

.sd-pane-error {
  display: grid;
  gap: 3px;
  padding: 8px 10px;
  border-radius: 5px;
  background: var(--sd-bg3);
}

.sd-pane-error span {
  color: var(--sd-error);
  font-size: 14px;
}

.sd-pane-error.is-quiet span {
  color: var(--sd-muted);
}

.sd-pane-error p {
  color: var(--sd-text);
  font-size: 16px;
}

/* Change card: framed edit icon, title and counts, then one row per changed object. */
.sd-result {
  display: grid;
  gap: 16px;
}

.sd-change-card {
  width: calc(100% - 20px);
  overflow: hidden;
  border: 1px solid var(--sd-border);
  border-radius: 6px;
  background: var(--sd-bg1);
}

.shard-product-demo .sd-change-header {
  width: 100%;
  gap: 10px;
  padding: 12px;
}

.sd-change-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border: 1px solid var(--sd-border);
  border-radius: 6px;
  background: var(--sd-bg2);
  color: var(--sd-text);
}

.sd-change-labels {
  display: grid;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.sd-change-title {
  color: var(--sd-text);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.2;
}

.sd-change-counts {
  color: var(--sd-muted);
  font-size: 16px;
}

.sd-review {
  flex: none;
  color: var(--sd-text);
  font-size: 17px;
}

.sd-change-details {
  display: grid;
  margin: 0 12px;
  padding: 6px 0 8px;
  border-top: 1px solid var(--sd-border);
}

.sd-change-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  padding: 9px 0;
}

.shard-product-demo button.sd-change-row {
  align-items: flex-start;
  gap: 8px;
}

.sd-kind-icon {
  margin-top: 3px;
  color: var(--sd-muted);
}

.sd-change-names {
  display: grid;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.sd-change-name {
  color: var(--sd-text);
  font-size: 17px;
  overflow-wrap: anywhere;
}

.sd-change-path {
  color: var(--sd-muted);
  font-size: 16px;
  overflow-wrap: anywhere;
}

.sd-change-delta {
  flex: none;
  max-width: 120px;
  color: var(--sd-muted);
  font-size: 16px;
  text-align: right;
}

.sd-change-row .sd-chevron {
  margin-top: -1px;
}

.sd-diff-frame {
  display: grid;
  gap: 6px;
  padding: 0 0 10px 24px;
}

.sd-diff-frame .sd-pane-text {
  max-height: 168px;
  background: var(--sd-bg2);
}

/* Live status under a running turn: the plugin's bouncing loader dots. */
.sd-live-status {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--sd-muted);
  font-size: 17px;
}

.sd-loader {
  display: inline-flex;
  gap: 2px;
}

.sd-loader i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.3;
  animation: sd-loader 1s infinite;
}

.sd-loader i:nth-child(2) {
  animation-delay: 0.25s;
}

.sd-loader i:nth-child(3) {
  animation-delay: 0.5s;
}

@keyframes sd-loader {
  0%, 60%, 100% { opacity: 0.3; }
  20% { opacity: 1; }
}

/* Queue: right-aligned queued bubbles with their own Steer, Send and Remove controls. */
.sd-queue {
  flex: none;
}

.sd-queue-list {
  display: grid;
  gap: 4px;
  max-height: 200px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.sd-queued {
  display: flex;
  justify-content: flex-end;
}

.sd-queued-content {
  display: grid;
  gap: 6px;
  width: 59%;
  padding: 7px 10px 8px 13px;
  border-radius: 5px;
  background: var(--sd-bg4);
}

.sd-queued-content p {
  color: var(--sd-text);
  font-size: 18px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.sd-steering {
  color: var(--sd-muted);
}

.sd-queued-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.shard-product-demo .sd-queued-button {
  justify-content: center;
  min-width: 64px;
  height: 26px;
  padding: 0 10px;
  border-radius: 6px;
  background: var(--sd-bg3);
  color: var(--sd-text);
  font-size: 15px;
}

.shard-product-demo .sd-queued-button:hover {
  background: var(--sd-bg2);
}

/* Composer: Background1 behind a 2px Border1 stroke, Send and Stop in the same slot. */
.sd-input {
  display: flex;
  flex: none;
  align-items: flex-end;
  gap: 5px;
  min-height: 44px;
  padding: 7px 8px 7px 12px;
  border: 2px solid var(--sd-border);
  border-radius: 5px;
  background: var(--sd-bg1);
}

.sd-input:focus-within {
  border-color: color-mix(in srgb, var(--sd-accent) 45%, var(--sd-border));
}

.shard-product-demo .sd-message-box {
  flex: 1;
  min-width: 0;
  height: 26px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--sd-text);
  font-size: 20px;
  line-height: 26px;
  resize: none;
  overflow-y: hidden;
  box-shadow: none;
  scrollbar-width: thin;
}

.shard-product-demo .sd-message-box:focus-visible {
  outline: none;
}

.sd-message-box::placeholder {
  color: var(--sd-muted);
  opacity: 1;
}

.shard-product-demo .sd-input-button {
  justify-content: center;
  flex: none;
  width: 28px;
  height: 26px;
  border-radius: 4px;
  color: var(--sd-bg4);
}

.shard-product-demo .sd-input-button .sd-icon {
  width: 20px;
  height: 20px;
}

.shard-product-demo .sd-send.has-text,
.shard-product-demo .sd-stop {
  color: var(--sd-text);
}

.shard-product-demo .sd-input-button:hover {
  background: var(--sd-bg3);
}

/* Autoplay presses Send the way a click would. */
.shard-product-demo .sd-send.is-autopressed {
  background: var(--sd-bg3);
  transform: scale(0.9);
  transition: transform 120ms ease, background-color 120ms ease;
}

/* Chat details: Subagents and Usage panels. */
.sd-details {
  display: flex;
  flex: none;
  flex-direction: column;
  width: clamp(150px, 24%, 236px);
  padding: 14px 14px 12px;
  background: var(--sd-bg2);
}

.sd-details-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 28px;
}

.sd-details-title {
  color: var(--sd-text);
  font-size: 18px;
  font-weight: 700;
}

.shard-product-demo .sd-details-close {
  width: 28px;
  height: 28px;
  color: var(--sd-muted);
}

.shard-product-demo .sd-details-close .sd-icon {
  width: 14px;
  height: 14px;
}

.sd-details-tabs {
  display: flex;
  gap: 8px;
  margin: 8px 0 12px;
}

.shard-product-demo .sd-details-tab {
  justify-content: center;
  width: 36px;
  height: 34px;
  border-radius: 6px;
  color: var(--sd-muted);
}

.shard-product-demo .sd-details-tab[aria-selected="true"] {
  background: var(--sd-bg3);
  color: var(--sd-text);
}

.shard-product-demo .sd-details-tab .sd-icon {
  width: 20px;
  height: 20px;
}

.sd-details-content {
  display: grid;
  align-content: start;
  gap: 8px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: var(--sd-scrollbar) transparent;
}

.sd-usage-card {
  display: grid;
  gap: 5px;
  padding: 10px 12px;
  border-radius: 4px;
  background: var(--sd-bg3);
}

.sd-usage-title,
.sd-usage-detail {
  color: var(--sd-muted);
  font-size: 14px;
  line-height: 1.3;
}

.sd-usage-value {
  color: var(--sd-text);
  font-size: 18px;
  font-weight: 700;
}

.sd-context-bar {
  display: block;
  height: 4px;
  background: var(--sd-bg2);
}

.sd-context-bar i {
  display: block;
  height: 100%;
  background: var(--sd-accent-dark);
}

.sd-usage-notice,
.sd-subagents-empty {
  color: var(--sd-muted);
  font-size: 14px;
}

.sd-subagents-empty {
  padding-top: 8px;
  text-align: center;
}

.sd-scrim {
  position: absolute;
  inset: 0;
  z-index: 4;
  background: rgba(0, 0, 0, 0.45);
}

/* Narrow docks: the chat list opens over the chat; details stay beside it. */
.is-sidebar-overlay .sd-sidebar {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 6;
  width: min(250px, 82%);
  max-width: none;
  box-shadow: 18px 0 40px rgba(0, 0, 0, 0.45);
}

@container sd-dock (max-width: 599px) {
  .sd-chat-container {
    padding: 8px 8px 10px;
  }

  .sd-transcript {
    padding: 12px 12px 14px 14px;
  }

  .sd-user-content,
  .sd-queued-content {
    width: 82%;
  }

  .sd-user-content p,
  .sd-assistant-message {
    font-size: 18px;
  }

  .sd-group-header,
  .sd-worked-label,
  .sd-tool-summary,
  .sd-change-name {
    font-size: 16px !important;
  }

  .sd-change-title {
    font-size: 17px;
  }

  .sd-change-path,
  .sd-change-counts,
  .sd-change-delta {
    font-size: 14px;
  }

  .sd-tool,
  .sd-change-card,
  .sd-divider {
    width: 100%;
  }

  .sd-review {
    display: none;
  }

  .sd-diff-frame {
    padding-left: 0;
  }

  .shard-product-demo .sd-message-box {
    font-size: 18px;
  }
}


/* ---------- Notifications ---------- */

/* NotificationsButton sits left of DetailsToggleButton; it fills with Background3 while the inbox is open. */
.shard-product-demo .sd-header-bell {
  position: relative;
}

.shard-product-demo .sd-header-bell.is-open {
  background: var(--sd-bg3);
}

.sd-unread-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--sd-accent);
  color: var(--sd-on-accent);
  font-size: 11px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

/* Inbox and popup are children of ChatHeaderFrame: the inbox at the header's right, 36px down; the popup centered,
   60px down. Both stop 8px above the composer. */
.sd-notifications {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

.sd-inbox,
.sd-notice-popup {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 10px 12px 12px;
  border-radius: 6px;
  background: var(--sd-bg2);
  box-shadow: 0 0 0 1px var(--sd-border), 0 18px 44px -18px rgba(0, 0, 0, 0.7);
  pointer-events: auto;
}

.sd-inbox {
  top: 57px;
  right: 24px;
  width: min(360px, calc(100% - 48px));
  max-height: min(420px, calc(100% - 57px - 108px));
}

.sd-notice-popup {
  top: 68px;
  left: 50%;
  width: min(440px, calc(100% - 48px));
  max-height: min(460px, calc(100% - 68px - 108px));
  transform: translateX(-50%);
}

.sd-inbox-head,
.sd-popup-head {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 28px;
}

.sd-inbox-title {
  color: var(--sd-text);
  font-size: 18px;
  font-weight: 700;
}

.sd-popup-title {
  min-width: 0;
  color: var(--sd-text);
  font-size: 16px;
  font-weight: 700;
}

.shard-product-demo .sd-inbox-close {
  width: 28px;
  height: 28px;
  color: var(--sd-muted);
}

.shard-product-demo .sd-inbox-close .sd-icon {
  width: 14px;
  height: 14px;
}

.sd-inbox-filters {
  display: flex;
  flex: none;
  gap: 4px;
}

.shard-product-demo .sd-inbox-filter {
  height: 26px;
  padding: 0 10px;
  border-radius: 5px;
  color: var(--sd-muted);
  font-size: 14px;
}

.shard-product-demo .sd-inbox-filter[aria-pressed="true"] {
  background: var(--sd-bg3);
  color: var(--sd-text);
}

.sd-inbox-divider {
  flex: none;
  height: 1px;
  margin-right: 4px;
  background: var(--sd-border);
}

.sd-inbox-list,
.sd-popup-card {
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: var(--sd-scrollbar) transparent;
}

.sd-popup-card {
  gap: 8px;
}

.sd-inbox-empty {
  padding: 18px 0;
  color: var(--sd-muted);
  font-size: 15px;
  text-align: center;
}

/* NotificationCardTemplate: Background3, Background4 on hover; read titles turn TextSecondary. */
.sd-notice {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 5px;
  background: var(--sd-bg3);
}

.sd-notice:hover {
  background: var(--sd-bg4);
}

.sd-notice-title {
  color: var(--sd-text);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
}

.sd-notice.is-read .sd-notice-title {
  color: var(--sd-muted);
}

.sd-notice-body {
  color: var(--sd-muted);
  font-size: 14px;
  line-height: 1.4;
}

.sd-notice-popup .sd-notice-body {
  color: var(--sd-text);
}

.sd-notice-body.is-clamped {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

.shard-product-demo .sd-notice-link {
  justify-self: start;
  height: 22px;
  padding: 0 6px;
  margin-left: -6px;
  border-radius: 5px;
  color: var(--sd-muted);
  font-size: 13px;
}

.shard-product-demo .sd-notice-link:hover {
  color: var(--sd-text);
}

.sd-poll {
  display: grid;
  gap: 6px;
}

/* NotificationPollOptionTemplate: Background4 stroke, a 12px radio with a 6px AccentLight dot. */
.shard-product-demo .sd-poll-option {
  gap: 10px;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 5px;
  box-shadow: inset 0 0 0 1px var(--sd-bg4);
  color: var(--sd-text);
  font-size: 14px;
}

.shard-product-demo .sd-poll-option:hover {
  box-shadow: inset 0 0 0 1px var(--sd-muted);
}

.sd-radio {
  display: grid;
  flex: none;
  place-items: center;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--sd-muted);
}

.sd-poll-option[aria-pressed="true"] .sd-radio {
  box-shadow: inset 0 0 0 1px var(--sd-accent);
}

.sd-poll-option[aria-pressed="true"] .sd-radio::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sd-accent);
}

/* ModelRow: provider logo, model and provider names, then a 120px Switch model button. */
.sd-notice-model {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
}

.sd-notice-target {
  display: grid;
  flex: 1;
  min-width: 0;
}

.sd-notice-model-name {
  overflow: hidden;
  color: var(--sd-text);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.sd-notice-provider {
  color: var(--sd-muted);
  font-size: 13px;
}

.shard-product-demo .sd-notice-switch {
  justify-content: center;
  min-width: 120px;
  height: 28px;
  background: var(--sd-bg3);
  box-shadow: inset 0 0 0 1px var(--sd-stroke);
  color: var(--sd-accent);
  font-size: 14px;
  font-weight: 700;
}

.sd-notice .sd-notice-switch {
  background: var(--sd-bg2);
}

.shard-product-demo .sd-notice-switch[aria-disabled="true"] {
  color: var(--sd-muted);
  cursor: default;
}

.sd-notice-result {
  font-size: 14px;
}

.sd-notice-result.is-success {
  color: var(--sd-success);
}

.sd-notice-result.is-error {
  color: var(--sd-error);
}

@container sd-dock (max-width: 599px) {
  .sd-inbox {
    top: 57px;
    right: 8px;
    width: calc(100% - 16px);
  }

  .sd-notice-popup {
    width: calc(100% - 16px);
  }
}

/* ---------- SettingsGui ---------- */

/* Main is clamped to 580px and sits at the widget's top left; the rest of the dock stays Background1. */
.sd-settingsgui {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--sd-bg1);
}

.sd-settings-main {
  position: relative;
  max-width: 580px;
  height: 100%;
}

.sd-settings-main::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 176px;
  border-right: 1px solid var(--sd-border);
  background: var(--sd-bg2);
}

.sd-settings-header {
  position: absolute;
  top: 12px;
  left: 16px;
  height: 32px;
  color: var(--sd-text);
  font-size: 18px;
  font-weight: 700;
  line-height: 32px;
}

.sd-settings-nav {
  position: absolute;
  top: 60px;
  left: 8px;
  display: grid;
  gap: 4px;
  width: 160px;
}

.shard-product-demo .sd-nav-button {
  width: 100%;
  height: 32px;
  gap: 10px;
  padding: 0 8px;
  border-radius: 6px;
  color: var(--sd-muted);
  font-size: 16px;
  white-space: nowrap;
}

.shard-product-demo .sd-nav-button:hover {
  color: var(--sd-text);
}

.shard-product-demo .sd-nav-button[aria-current="page"] {
  background: var(--sd-bg3);
  color: var(--sd-text);
  font-weight: 700;
}

.sd-settings-container {
  position: absolute;
  top: 16px;
  right: 20px;
  bottom: 16px;
  left: 196px;
  display: grid;
  align-content: start;
  gap: 8px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0 4px 24px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--sd-scrollbar) transparent;
  container: sd-settings / inline-size;
}

.sd-set-title {
  height: 40px;
  color: var(--sd-text);
  font-size: 20px;
  font-weight: 700;
  line-height: 32px;
}

.sd-set-sublabel {
  display: flex;
  align-items: flex-end;
  height: 28px;
  color: var(--sd-muted);
  font-size: 14px;
  font-weight: 700;
}

/* Rows of at least 280px: an 88px label, the control from x 100. Narrower rows stack. */
.sd-set-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 32px;
}

.sd-set-label {
  color: var(--sd-text);
  font-size: 16px;
  line-height: 1.15;
}

/* Account and Usage rows use a 110px label (UpdateSettingsLayout). */
.sd-set-row.is-wide {
  grid-template-columns: 110px minmax(0, 1fr);
}

@container sd-settings (max-width: 279px) {
  .sd-set-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }
}

.sd-dropdown {
  position: relative;
  min-width: 0;
}

.shard-product-demo .sd-dropdown-button {
  justify-content: space-between;
  width: 100%;
  height: 32px;
  padding: 0 8px 0 10px;
  border-radius: 6px;
  background: var(--sd-bg2);
  box-shadow: inset 0 0 0 1px var(--sd-stroke);
  color: var(--sd-muted);
  font-size: 16px;
}

.shard-product-demo .sd-dropdown-button:hover:not(:disabled) {
  color: var(--sd-text);
}

.shard-product-demo .sd-dropdown-button:disabled {
  cursor: default;
  opacity: 0.7;
}

.sd-dropdown-value {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.sd-dropdown-button .sd-icon {
  color: #7f8189;
  transition: transform 140ms ease;
}

.sd-dropdown-button[aria-expanded="true"] .sd-icon {
  transform: rotate(180deg);
}

.sd-dropdown-list {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  left: 0;
  z-index: 20;
  display: grid;
  gap: 2px;
  max-height: 180px;
  overflow-y: auto;
  padding: 2px;
  border: 1.5px solid var(--sd-border);
  border-radius: 6px;
  background: var(--sd-bg2);
  box-shadow: 0 16px 32px -12px rgba(0, 0, 0, 0.6);
  scrollbar-width: thin;
  scrollbar-color: var(--sd-scrollbar) transparent;
}

.shard-product-demo .sd-option {
  justify-content: space-between;
  width: 100%;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 6px;
  color: var(--sd-text);
  font-size: 16px;
  font-weight: 400;
}

.shard-product-demo .sd-option[aria-selected="true"],
.shard-product-demo .sd-option:hover,
.shard-product-demo .sd-option:focus-visible {
  background: var(--sd-bg3);
}

.shard-product-demo .sd-option:focus-visible {
  outline: 1px solid var(--sd-muted);
  outline-offset: -2px;
}

.sd-swatches {
  display: flex;
  gap: 3px;
}

.sd-swatches i {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(127, 129, 137, 0.45);
}

.shard-product-demo .sd-set-button {
  justify-content: center;
  width: 100%;
  min-height: 32px;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--sd-bg2);
  box-shadow: inset 0 0 0 1px var(--sd-stroke);
  color: var(--sd-text);
  font-size: 16px;
  text-align: center;
}

.shard-product-demo .sd-set-button.is-raised {
  background: var(--sd-bg3);
}

.shard-product-demo .sd-set-button.is-left {
  justify-content: flex-start;
  text-align: left;
}

.shard-product-demo .sd-set-button.is-danger-text {
  color: var(--sd-error);
}

.shard-product-demo .sd-set-button.is-accent-text {
  color: var(--sd-accent);
}

.shard-product-demo .sd-option-group {
  padding: 6px 10px 2px;
  color: var(--sd-muted);
  font-size: 13px;
  font-weight: 600;
}

.shard-product-demo .sd-provider-switch .sd-set-button {
  min-height: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  font-size: 15px;
}

.shard-product-demo .sd-set-button:hover:not([aria-disabled="true"]) {
  filter: brightness(1.12);
}

/* An unavailable toggle shows no hover, like the plugin's inactive button. */
.shard-product-demo .sd-set-button[aria-disabled="true"] {
  cursor: default;
}

.shard-product-demo .sd-search-logo {
  flex: none;
  width: 16px;
  height: 16px;
  object-fit: contain;
}

/* AI switches (Streaming, Prompt caching, Web search): label on the left, a short state word and one shared
   44 x 24 track on the right. The row is the click target; hover tints only the track, never by state. */
.shard-product-demo .sd-switch-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 32px;
  cursor: pointer;
}

.sd-switch-row .sd-set-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.sd-switch-state {
  color: var(--sd-muted);
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
}

.sd-switch-track {
  position: relative;
  display: block;
  flex: none;
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: var(--sd-bg2);
  box-shadow: inset 0 0 0 1px var(--sd-stroke);
  transition: background-color 160ms ease, box-shadow 160ms ease;
}

.sd-switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--sd-bg4);
  transition: transform 160ms cubic-bezier(0.2, 0.7, 0.2, 1), background-color 160ms ease;
}

/* Both icon layers occupy the same centred slot on the moving thumb. */
.sd-switch-thumb > * {
  position: absolute;
  top: 50%;
  left: 50%;
  opacity: 1;
  transform: translate(-50%, -50%);
  transition: opacity 160ms ease;
}

.shard-product-demo .sd-switch-thumb .sd-switch-icon {
  width: 12px;
  height: 12px;
  stroke-width: 2;
}

.shard-product-demo .sd-switch-thumb .sd-search-logo {
  width: 12px;
  height: 12px;
}

/* On / off: the thumb slides right and turns accent, the check fades in over the X. */
.sd-switch-row[aria-checked="true"] .sd-switch-track {
  background: color-mix(in srgb, var(--sd-accent) 28%, var(--sd-bg2));
}

.sd-switch-row[aria-checked="true"] .sd-switch-thumb {
  transform: translateX(20px);
  background: var(--sd-accent);
  color: var(--sd-on-accent);
}

.sd-switch-row[aria-checked="false"] .sd-switch-thumb {
  color: var(--sd-muted);
}

.sd-switch-row[aria-checked="true"] .is-off-icon,
.sd-switch-row[aria-checked="false"] .is-on-icon {
  opacity: 0;
}

/* Web search: two modes, so the track and thumb keep one neutral colour on either side. */
.sd-switch-row.is-mode .sd-switch-thumb {
  z-index: 1;
  color: var(--sd-text);
  cursor: pointer;
}

.sd-switch-row.is-mode[data-mode="provider"] .sd-switch-thumb {
  transform: translateX(20px);
}

.sd-switch-row.is-mode[data-mode="shard"] .sd-switch-thumb .is-provider-logo,
.sd-switch-row.is-mode[data-mode="provider"] .sd-switch-thumb .is-shard-logo {
  opacity: 0;
}

/* The two radios are transparent halves of the track, so either end can be clicked or focused directly. */
.shard-product-demo .sd-mode-option {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  border-radius: 12px;
}

.shard-product-demo .sd-mode-option.is-shard {
  left: 0;
}

.shard-product-demo .sd-mode-option.is-provider {
  right: 0;
}

.shard-product-demo .sd-mode-option[aria-disabled="true"] {
  cursor: default;
}

/* One focus ring for every switch: around the track, whether the row or one of its radios has focus. */
.shard-product-demo .sd-switch-row:focus-visible,
.shard-product-demo .sd-mode-option:focus-visible {
  outline: none;
}

.sd-switch-row:focus-visible .sd-switch-track,
.sd-switch-track:has(.sd-mode-option:focus-visible) {
  outline: 2px solid var(--sd-accent);
  outline-offset: 2px;
}

.sd-switch-row:hover .sd-switch-track {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sd-accent) 55%, var(--sd-stroke));
}

/* Provider search unavailable: the switch is unclickable, and the reason is shown below. */
.shard-product-demo .sd-switch-row[aria-disabled="true"] {
  cursor: default;
}

.sd-switch-row[aria-disabled="true"]:hover .sd-switch-track {
  box-shadow: inset 0 0 0 1px var(--sd-stroke);
}

.sd-switch-reason {
  margin: -6px 0 0;
}

.shard-product-demo .sd-set-input {
  width: 100%;
  height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: var(--sd-bg2);
  box-shadow: inset 0 0 0 1px var(--sd-stroke);
  color: var(--sd-text);
  font-size: 16px;
}

.shard-product-demo .sd-set-input::placeholder {
  color: var(--sd-muted);
  opacity: 1;
}

.shard-product-demo .sd-set-input[readonly] {
  cursor: default;
}

.shard-product-demo .sd-set-input[aria-invalid="true"] {
  box-shadow: inset 0 0 0 1px var(--sd-error);
}

.sd-account {
  display: grid;
  gap: 8px;
}

.sd-account-text {
  color: var(--sd-text);
  font-size: 16px;
  line-height: 1.3;
}

.sd-note-slot:empty {
  display: none;
}

.sd-set-note {
  font-size: 14px;
  line-height: 1.35;
}

.sd-set-note.is-status {
  color: var(--sd-muted);
}

.sd-set-note.is-error {
  color: var(--sd-error);
}

.sd-set-note.is-success {
  color: var(--sd-success);
}

.sd-set-row + div > .sd-note-slot .sd-set-note,
.sd-set-row + .sd-note-slot .sd-set-note {
  margin-left: 100px;
}

.sd-set-row.is-wide + .sd-note-slot .sd-set-note,
.sd-set-note.sd-row-note {
  margin-left: 122px;
}

@container sd-settings (max-width: 279px) {
  .sd-set-row + div > .sd-note-slot .sd-set-note,
  .sd-set-row + .sd-note-slot .sd-set-note,
  .sd-set-row.is-wide + .sd-note-slot .sd-set-note,
  .sd-set-note.sd-row-note {
    margin-left: 0;
  }

  .sd-set-row.is-wide {
    grid-template-columns: minmax(0, 1fr);
  }
}

.sd-account-frame {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  height: 32px;
  padding: 0 4px 0 10px;
  border-radius: 6px;
  background: var(--sd-bg2);
  box-shadow: inset 0 0 0 1.5px var(--sd-stroke);
}

.sd-account-value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--sd-muted);
  font-size: 16px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.sd-account-value.is-primary {
  color: var(--sd-text);
}

/* Account: RobloxCard, a centred column (Avatar, Title, StatusBox, Hint, LinkBox, Note, GuestButtons). */
.sd-roblox-card {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin-bottom: 8px;
  text-align: center;
}

.sd-roblox-avatar {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--sd-bg3);
}

.sd-roblox-avatar > svg {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  fill: var(--sd-muted);
}

.sd-roblox-lock {
  position: absolute;
  right: -4px;
  bottom: -2px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--sd-bg2);
}

.sd-roblox-lock svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--sd-text);
  stroke-width: 1.8;
}

.sd-roblox-title {
  color: var(--sd-text);
  font-size: 17px;
  font-weight: 700;
}

.sd-roblox-status,
.sd-roblox-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 36px;
  border-radius: 6px;
  background: var(--sd-bg2);
  box-shadow: inset 0 0 0 1.5px var(--sd-stroke);
  color: var(--sd-muted);
  font-size: 16px;
}

.sd-roblox-link {
  gap: 8px;
  padding: 0 5px 0 10px;
}

.sd-roblox-url {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  color: var(--sd-text);
  font: inherit;
  text-overflow: ellipsis;
}

.sd-roblox-link .sd-chip-button {
  width: 68px;
  height: 26px;
  justify-content: center;
  background: var(--sd-border);
}

.sd-roblox-hint,
.sd-roblox-note {
  color: var(--sd-muted);
  font-size: 15px;
  line-height: 1.3;
}

.sd-roblox-note {
  font-size: 14px;
}

.sd-roblox-hint.is-primary {
  color: var(--sd-text);
}

.sd-roblox-guest {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
}

.shard-product-demo .sd-set-button.is-accent-fill {
  background: var(--sd-accent);
  box-shadow: none;
  color: var(--sd-on-accent, #18191e);
}

.shard-product-demo .sd-account-input {
  flex: 1;
  min-width: 0;
  height: 26px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--sd-text);
  font-size: 16px;
}

.shard-product-demo .sd-chip-button {
  flex: none;
  height: 24px;
  padding: 0 8px;
  border-radius: 4px;
  background: var(--sd-border);
  color: var(--sd-text);
  font-size: 16px;
}

.shard-product-demo .sd-chip-button:hover {
  background: var(--sd-bg4);
}

.sd-support-box {
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--sd-bg2);
  box-shadow: inset 0 0 0 1.5px var(--sd-stroke);
}

.shard-product-demo .sd-support-input {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--sd-text);
  font-size: 16px;
  line-height: 1.3;
  resize: vertical;
}

.sd-support-input::placeholder {
  color: var(--sd-muted);
  opacity: 1;
}

/* Introductions and hints on Usage, Chat and Help & updates: TextSecondary, wrapped. */
.sd-set-intro,
.sd-set-hint {
  color: var(--sd-muted);
  font-size: 14px;
  line-height: 1.4;
}

.sd-set-intro {
  margin-bottom: 4px !important;
  font-size: 15px;
}

.sd-switch-row + .sd-set-hint {
  margin: -4px 0 6px !important;
}

.sd-set-note a,
.sd-set-hint a {
  color: var(--sd-accent);
}

.shard-product-demo .sd-account-frame .sd-chip-button {
  margin-left: auto;
}

.sd-shards-icon {
  flex: none;
  width: 16px;
  height: 16px;
  margin-left: 6px;
}

/* Usage limit rows: BarBackground with BarFill, and the used / limit text on the right. */
.sd-usage-limit {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.sd-limit-bar {
  flex: 1;
  height: 6px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--sd-bg3);
}

.sd-limit-bar i {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--sd-accent);
}

.sd-limit-text {
  flex: none;
  color: var(--sd-muted);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

/* ThemeButtonTemplate swatches: Background1, Background3, AccentLight, TextPrimary. */
.sd-swatches {
  display: inline-flex;
  flex: none;
  gap: 3px;
  margin-left: auto;
}

.sd-swatches i {
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(127, 129, 137, 0.45);
}

/* Help & updates */
.sd-help-updates {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.shard-product-demo a.sd-set-button {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.sd-help-version {
  color: var(--sd-muted);
  font-size: 14px;
  white-space: nowrap;
}

@container sd-settings (max-width: 339px) {
  .sd-help-updates {
    grid-template-columns: minmax(0, 1fr);
  }

  .sd-help-version {
    order: 3;
    text-align: center;
  }
}

.sd-tickets {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding: 12px;
  border-radius: 6px;
  background: var(--sd-bg2);
  box-shadow: inset 0 0 0 1px var(--sd-stroke);
}

.sd-tickets-title {
  color: var(--sd-text);
  font-size: 17px;
  font-weight: 700;
}

.sd-tickets-subtitle {
  color: var(--sd-text);
  font-size: 15px;
  font-weight: 700;
}

.sd-ticket-toolbar {
  display: flex;
  gap: 8px;
}

.sd-ticket-list {
  display: grid;
  gap: 4px;
  padding: 14px 8px;
  text-align: center;
}

.sd-ticket-empty {
  color: var(--sd-muted);
  font-size: 15px;
}

.sd-ticket-count {
  color: var(--sd-muted);
  font-size: 13px;
}

.sd-ticket-compose {
  display: grid;
  gap: 8px;
}

.sd-ticket-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.shard-product-demo .sd-ticket-category {
  height: 28px;
  padding: 0 10px;
  background: var(--sd-bg3);
  color: var(--sd-muted);
  font-size: 14px;
}

.shard-product-demo .sd-ticket-category[aria-pressed="true"] {
  background: var(--sd-accent);
  color: var(--sd-on-accent);
}

.shard-product-demo .sd-contact-email {
  margin-top: -2px;
}

/* Phones: the section list moves above the settings. */
@container sd-dock (max-width: 479px) {
  .sd-settings-main::before {
    display: none;
  }

  .sd-settings-header {
    position: static;
    padding: 10px 12px 0;
    height: auto;
  }

  .sd-settings-nav {
    position: static;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    width: auto;
    margin: 6px 8px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--sd-border);
  }

  .shard-product-demo .sd-nav-button {
    justify-content: center;
    gap: 0;
    padding: 0 2px;
    font-size: 14px;
  }

  .sd-nav-button .sd-icon {
    display: none;
  }

  .sd-settings-main {
    display: flex;
    flex-direction: column;
  }

  .sd-settings-container {
    position: static;
    flex: 1;
    min-height: 0;
    padding: 12px 12px 20px;
  }
}

/* ---------- Explorer ---------- */

.sd-side {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.shard-product-demo[data-layout="wide"] .sd-side {
  grid-template-rows: minmax(0, 1fr) auto;
  height: var(--sd-dock-height);
}

.sd-dock-explorer {
  min-height: 0;
}

.sd-explorer {
  flex: 1;
  min-height: 0;
  background: var(--sd-explorer-bg);
}

.sd-explorer-tree {
  height: 100%;
  overflow: auto;
  padding: 4px 0 8px;
  scrollbar-width: thin;
  scrollbar-color: #5a5d68 transparent;
}

.sd-node {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding-right: 8px;
  padding-left: calc(var(--level) * 14px - 8px);
  color: var(--sd-explorer-text);
  font-size: 13.5px;
  white-space: nowrap;
  cursor: default;
  user-select: none;
}

.sd-node:hover {
  background: #2a2c32;
}

.sd-node.is-selected {
  background: var(--sd-explorer-select);
  color: #ffffff;
}

.shard-product-demo .sd-node:focus-visible {
  outline-offset: -2px;
  border-radius: 0;
}

.sd-node-arrow {
  display: grid;
  place-items: center;
  flex: none;
  width: 14px;
  height: 14px;
  color: #8b8f9a;
  cursor: pointer;
}

.sd-node-arrow .sd-icon {
  width: 11px;
  height: 11px;
  transition: transform 120ms ease;
}

.sd-node-arrow.is-open .sd-icon {
  transform: rotate(90deg);
}

.sd-node-arrow.is-empty {
  cursor: default;
}

.sd-class-icon {
  display: block;
  flex: none;
  width: 16px;
  height: 16px;
}

.sd-node-name {
  overflow: hidden;
  text-overflow: ellipsis;
}

.sd-node-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px #3c3f49;
  color: #a7abb6;
  font-size: 11.5px;
  line-height: 16px;
}

.sd-node-tag .sd-icon {
  width: 10px;
  height: 10px;
}

.sd-node.is-flash-added {
  animation: sd-flash-added 1.8s ease-out;
}

.sd-node.is-flash-changed {
  animation: sd-flash-changed 1.8s ease-out;
}

@keyframes sd-flash-added {
  0%, 25% { background: rgba(44, 200, 140, 0.32); color: #ffffff; }
  100% { background: transparent; }
}

@keyframes sd-flash-changed {
  0%, 25% { background: rgba(250, 189, 47, 0.24); color: #ffffff; }
  100% { background: transparent; }
}

/* ---------- Undo history (page element beside Studio) ---------- */

.sd-history {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--sd-page-line);
  border-radius: 8px;
  color: var(--sd-page-text);
}

.sd-history-actions {
  display: grid;
  gap: 6px;
}

.shard-product-demo .sd-history-button {
  width: 100%;
  gap: 10px;
  min-height: 44px;
  padding: 6px 10px;
  border-radius: 6px;
  background: #18191e;
  box-shadow: inset 0 0 0 1px #30323b;
  color: var(--sd-page-text);
}

.shard-product-demo .sd-history-button:hover {
  background: #202127;
}

.shard-product-demo .sd-history-button[aria-disabled="true"] {
  opacity: 0.5;
  cursor: default;
}

.shard-product-demo .sd-history-button:focus-visible {
  outline-color: var(--sd-sun);
}

.sd-history-button > .sd-icon {
  color: var(--sd-sun);
}

.sd-history-text {
  display: grid;
  flex: 1;
  min-width: 0;
  font-size: 14px;
  line-height: 1.2;
}

.sd-history-text > span:first-child {
  font-weight: 700;
}

.sd-history-step {
  overflow: hidden;
  color: var(--sd-page-muted);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.sd-keys {
  display: flex;
  gap: 3px;
}

.sd-keys kbd {
  min-width: 22px;
  padding: 0 5px;
  border: 1px solid rgba(250, 189, 47, 0.5);
  border-bottom-width: 3px;
  border-radius: 5px;
  color: var(--sd-sun);
  font-family: var(--sd-font);
  font-size: 12px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

.sd-history-list {
  display: grid;
  gap: 2px;
  max-height: 132px;
  overflow-y: auto;
  padding: 0;
  list-style: none;
  scrollbar-width: thin;
}

.sd-history-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 2px;
  border-top: 1px solid #23252c;
  font-size: 13px;
}

.sd-history-name {
  flex: none;
}

.sd-history-touched {
  min-width: 0;
  overflow: hidden;
  color: var(--sd-page-muted);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.sd-history-list li.is-undone .sd-history-name {
  color: var(--sd-page-muted);
  text-decoration: line-through;
}

.sd-history-list li.is-empty {
  color: var(--sd-page-muted);
}

/* ---------- Stacked layout ---------- */

.shard-product-demo[data-layout="stacked"] {
  --sd-dock-height: 600px;
}

.shard-product-demo[data-layout="stacked"] .sd-side {
  grid-template-columns: minmax(0, 1fr);
}

.shard-product-demo[data-layout="stacked"] .sd-dock-explorer {
  height: 260px;
}

@container sd-stage (min-width: 640px) and (max-width: 979px) {
  .shard-product-demo[data-layout="stacked"] .sd-side {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .shard-product-demo[data-layout="stacked"] .sd-dock-explorer {
    height: auto;
    min-height: 260px;
  }
}

@container sd-stage (max-width: 479px) {
  .sd-stage {
    --sd-dock-height: 560px;
  }

  .sd-caption {
    font-size: 13px;
  }
}

/* ---------- Motion and touch ---------- */

/* Things that open answer the click: dropdowns drop, panels slide in, new rows fade in. */
@media (prefers-reduced-motion: no-preference) {
  .sd-dropdown-list {
    transform-origin: top center;
    animation: sd-drop 150ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }

  .is-sidebar-overlay .sd-sidebar {
    animation: sd-from-left 200ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }

  .sd-details {
    animation: sd-fade 180ms ease both;
  }

  .sd-scrim {
    animation: sd-fade 180ms ease both;
  }

  .sd-inbox {
    transform-origin: top right;
    animation: sd-drop 150ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }

  .sd-notice-popup {
    animation: sd-fade 220ms ease both;
  }

  /* Added by the script to the one section that was just expanded, so redraws don't replay it. */
  .sd-opening {
    animation: sd-reveal 200ms ease both;
  }
}

@keyframes sd-drop {
  from { opacity: 0; transform: translateY(-4px) scaleY(0.96); }
  to { opacity: 1; transform: none; }
}

@keyframes sd-from-left {
  from { opacity: 0.4; transform: translateX(-16px); }
  to { opacity: 1; transform: none; }
}

@keyframes sd-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes sd-reveal {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .shard-product-demo *,
  .shard-product-demo *::before,
  .shard-product-demo *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@media (pointer: coarse) {
  .shard-product-demo .sd-node {
    height: 30px;
  }

  .shard-product-demo .sd-dock-tabs {
    height: 32px;
  }

  .shard-product-demo .sd-queued-button,
  .shard-product-demo .sd-pane-button {
    min-height: 32px;
  }
}
