/* Scheduled-tasks page (row list + recommended templates + in-page editor) */

.atm-page {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 48px 32px;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.atm-header {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 16px;
}

.atm-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.atm-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.atm-toolbar .cloud-seg {
  height: 32px;
}

.atm-toolbar .cloud-seg button {
  padding: 5px 12px;
  font-size: 13px;
}

/* same height as the segment control so the toolbar reads as one line */
.atm-add {
  height: 32px;
  padding: 0 14px;
  font-size: 13px;
  border-radius: 8px;
}

.atm-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.atm-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.atm-row:hover {
  background: var(--hover);
}

.atm-row.paused .atm-row-name,
.atm-row.paused .atm-row-schedule {
  color: var(--text-tertiary);
}

.atm-row-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  text-align: start;
  cursor: pointer;
  color: inherit;
}

.atm-row-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--icon-muted);
  flex-shrink: 0;
}

.atm-row-dot.armed {
  background: var(--success);
}

.atm-row-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.atm-row-schedule {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.atm-row-cloud {
  flex-shrink: 0;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--text-tertiary);
}

.atm-row-next {
  font-size: 12px;
  color: var(--text-tertiary);
  white-space: nowrap;
}

.atm-row-actions {
  display: inline-flex;
  gap: 4px;
}

/* hover-only reveal is pointer-only: on iOS a tap whose hover changes
   content counts as a hover, so the row would need two taps */
@media (hover: hover) {
  .atm-row-actions {
    display: none;
  }

  .atm-row:hover .atm-row-actions {
    display: inline-flex;
  }
}

.atm-row-btn {
  border: none;
  background: none;
  padding: 4px 6px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1;
}

.atm-row-btn:hover {
  background: var(--bg-hover-strong);
  color: var(--text-primary);
}

.atm-row-del:hover {
  color: var(--danger);
}

.atm-run-status {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
  background: var(--surface-subtle);
  color: var(--text-secondary);
}

.atm-run-status.succeeded {
  background: var(--success-bg);
  color: var(--success);
}

.atm-run-status.failed,
.atm-run-status.interrupted {
  background: var(--danger-bg);
  color: var(--danger);
}

.atm-run-trigger {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--text-tertiary);
  white-space: nowrap;
}

.atm-run-time {
  font-size: 12px;
  color: var(--text-tertiary);
  white-space: nowrap;
}

.atm-run-error {
  font-size: 12px;
  color: var(--danger);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.atm-run-row .atm-row-name {
  flex: 0 1 auto;
}

.atm-row-open {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
}

.atm-row-open:hover {
  background: var(--hover);
  color: var(--text-primary);
}

.atm-offline-note {
  margin: 0 0 8px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--hover);
  color: var(--text-secondary);
  font-size: 13px;
}

.atm-empty {
  margin: 0;
  padding: 12px 12px 4px;
  color: var(--text-tertiary);
  font-size: 13px;
}

.atm-empty-runs {
  display: flex;
  justify-content: center;
  padding: 64px 0;
  font-size: 14px;
}

/* recommended templates */

.atm-rec {
  margin-top: 32px;
}

.atm-rec-title {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.atm-rec-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.atm-rec-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: pointer;
  transition:
    border-color 0.15s,
    background 0.15s;
}

.atm-rec-card:hover {
  border-color: var(--border-strong);
  background: var(--hover);
}

.atm-rec-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.atm-rec-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.atm-rec-desc {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.atm-rec-plus {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 16px;
  line-height: 1;
  color: var(--text-tertiary);
  transition: color 0.15s;
}

.atm-rec-card:hover .atm-rec-plus {
  color: var(--text-primary);
}

@media (max-width: 720px) {
  .atm-rec-grid {
    grid-template-columns: 1fr;
  }
}

.atm-hint {
  margin-top: auto;
  padding-top: 24px;
  font-size: 12px;
  color: var(--text-tertiary);
}

/* editor panel */

.atm-editor {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 640px;
}

.atm-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.atm-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.atm-input,
.atm-textarea,
.atm-select {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  padding: 8px 10px;
}

.atm-input:focus,
.atm-textarea:focus,
.atm-select:focus {
  outline: none;
  border-color: var(--border-strong);
}

.atm-textarea {
  resize: vertical;
}

.atm-schedule-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.atm-input-time,
.atm-input-datetime,
.atm-input-number {
  width: auto;
}

.atm-input-number {
  width: 64px;
}

.atm-inline-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.atm-monthdays .atm-input {
  width: 160px;
}

.atm-weekday-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.atm-weekday {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}

.atm-weekday.active {
  background: var(--color-btn-primary);
  border-color: var(--color-btn-primary);
  color: var(--color-btn-primary-text);
}

.atm-perm-options {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.atm-perm-option {
  flex: 1;
  min-width: 220px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  background: var(--surface);
}

.atm-perm-option.active {
  border-color: var(--border-strong);
  background: var(--surface-subtle);
}

.atm-perm-option input {
  margin-top: 3px;
}

.atm-perm-option strong {
  display: block;
  font-size: 13px;
  color: var(--text-primary);
}

.atm-perm-option em {
  display: block;
  font-style: normal;
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.atm-perm-ack {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  margin: 12px 0 4px;
}

.atm-notify {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}

.atm-form-error {
  color: var(--danger);
  font-size: 13px;
  margin: 0;
}

.atm-editor-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.atm-editor-delete {
  margin-inline-start: auto;
}
.images-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 28px 32px;
  overflow: auto;
}

.images-head h1 {
  margin: 0 0 4px;
  font-size: 20px;
}

.images-head p {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 13px;
}

.images-empty {
  margin-top: 48px;
  text-align: center;
  color: var(--color-text-secondary);
  font-size: 14px;
}

.images-grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.image-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
  padding: 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-content);
  cursor: pointer;
  text-align: left;
}

.image-card:hover {
  border-color: var(--accent);
}

.image-card-thumb {
  display: block;
  height: 130px;
  border-radius: 6px;
  background: var(--canvas);
  overflow: hidden;
}

.image-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-card-title {
  font-size: 14px;
  font-weight: 600;
}

.image-card-date {
  font-size: 12px;
  color: var(--color-text-secondary);
}

.images-detail {
  padding: 0;
  overflow: hidden;
}

.images-detail-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.images-detail-head h1 {
  font-size: 15px;
  margin: 0;
}

.images-back {
  border: none;
  background: none;
  color: var(--color-text-secondary);
  cursor: pointer;
  font-size: 13px;
  padding: 4px 6px;
}

.images-back:hover {
  color: inherit;
}

.images-viewer {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 16px;
  gap: 10px;
  overflow: auto;
}

/* the stage hugs the image: width-bound images leave the space below to the
   toolbar instead of letterboxing, height-bound ones shrink to fit */
.images-stage {
  position: relative;
  flex: 0 1 auto;
  min-height: 120px;
  display: flex;
  justify-content: center;
}

.images-stage-zoomed {
  min-width: 0;
  overflow: auto;
  justify-content: flex-start;
}

.images-stage-zoomed.images-stage-pan {
  cursor: grab;
}

.images-stage-zoomed.images-stage-pan:active {
  cursor: grabbing;
}

.images-stage-zoomed .images-frame {
  flex: none;
  max-width: none;
  max-height: none;
  margin: auto;
}

.images-stage-zoomed .images-frame img {
  width: 100%;
  height: 100%;
}

.images-frame {
  position: relative;
  display: flex;
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  box-sizing: border-box;
}

.images-frame img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  user-select: none;
}

.videos-frame video {
  display: block;
  max-width: 100%;
  max-height: 60vh;
  background: var(--canvas);
}

.images-stage-empty {
  align-self: center;
  color: var(--color-text-secondary);
  font-size: 13px;
}

/* ── draw-to-edit surface ── */
.images-frame-editing img {
  user-select: none;
}

.images-surface {
  position: absolute;
  inset: 0;
  overflow: visible;
  touch-action: none;
}

.images-surface-pen,
.images-surface-rect,
.images-surface-arrow {
  cursor: crosshair;
}

.images-surface-eraser {
  cursor: cell;
}

.images-surface-text {
  cursor: text;
}

.images-surface-svg {
  position: absolute;
  inset: 0;
  overflow: visible;
  pointer-events: none;
}

.images-surface-svg path,
.images-surface-svg line {
  stroke-linecap: round;
  stroke-linejoin: round;
}

.images-shape {
  position: absolute;
  transform-origin: center;
  white-space: pre;
  pointer-events: none;
  user-select: none;
}

.images-shape-picture img {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.images-shape-input {
  outline: none;
  min-width: 1ch;
  white-space: pre;
  pointer-events: auto;
  cursor: text;
  caret-color: var(--accent);
}

.images-surface-editing .images-shape-input {
  user-select: text;
}

/* selection: box-shadow so the outline never changes layout; handles 14px */
.images-sel {
  position: absolute;
  transform-origin: center;
  box-shadow: 0 0 0 2px var(--accent);
  pointer-events: none;
}

.images-handle {
  position: absolute;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 999px;
  background: var(--surface);
  border: 2px solid var(--accent);
  box-sizing: border-box;
  pointer-events: auto;
  transition: transform 0.1s;
}

.images-handle:hover {
  transform: scale(1.2);
}

.images-handle-c0 {
  left: 0;
  top: 0;
  cursor: nwse-resize;
}

.images-handle-c1 {
  left: 100%;
  top: 0;
  cursor: nesw-resize;
}

.images-handle-c2 {
  left: 100%;
  top: 100%;
  cursor: nwse-resize;
}

.images-handle-c3 {
  left: 0;
  top: 100%;
  cursor: nesw-resize;
}

.images-handle-end {
  cursor: move;
}

.images-rotate-line {
  position: absolute;
  left: 50%;
  top: -24px;
  width: 2px;
  height: 24px;
  margin-left: -1px;
  background: var(--accent);
}

.images-handle-rotate {
  left: 50%;
  top: -30px;
  cursor: grab;
}

.images-mark-hint {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 24px);
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 12px;
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* floating text style pill above the selected text (Canva-style) */
.images-textbar {
  position: absolute;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-menu);
}

.images-textbar-font {
  height: 28px;
  padding: 0 6px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 12px;
}

.images-textbar-btn {
  height: 28px;
  min-width: 30px;
  padding: 0 6px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
}

.images-textbar-bold {
  font-weight: 700;
}

.images-textbar-btn:hover,
.images-textbar-font:hover {
  background: var(--hover);
}

.images-textbar-on {
  background: var(--accent-soft);
  color: var(--accent);
}

/* edit-mode toolbar: icon-only tools */
.images-tool-icon {
  width: 32px;
  padding: 0;
  justify-content: center;
}

.images-tool:disabled {
  opacity: 0.4;
  cursor: default;
}

.images-tool-danger:not(:disabled):hover {
  color: var(--danger);
}

.images-tool-danger:not(:disabled):hover svg {
  color: var(--danger);
}

.images-color-dot {
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
}

.images-colors {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 8px;
}

.images-color {
  width: 20px;
  height: 20px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  cursor: pointer;
}

.images-menu .images-color {
  width: 20px;
}

.images-color-on {
  box-shadow:
    0 0 0 2px var(--surface),
    0 0 0 4px var(--accent);
}

.images-color-custom {
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
}

/* instruction row under the edit toolbar */
.images-askbar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.images-askbar .ai-ask-pop-input {
  flex: 1;
  min-width: 0;
}

.images-askbar .ai-ask-cancel,
.images-askbar .ai-ask-confirm {
  flex-shrink: 0;
  white-space: nowrap;
}

/* the html editor's AiAskPopover input / buttons, reused by the edit instruction row */
.ai-ask-pop-input {
  width: 100%;
  box-sizing: border-box;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-8);
  background: var(--color-bg-page);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  outline: none;
}

.ai-ask-pop-input:focus {
  border-color: var(--accent);
}

.ai-ask-cancel,
.ai-ask-confirm {
  padding: 5px 12px;
  border-radius: var(--radius-6);
  font-size: 12px;
  cursor: pointer;
}

.ai-ask-cancel {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--color-text-secondary);
}

.ai-ask-cancel:hover:not(:disabled) {
  background: var(--hover);
}

.ai-ask-confirm {
  border: 1px solid transparent;
  background: var(--color-ai-action);
  color: var(--color-ai-action-text);
}

.ai-ask-confirm:hover:not(:disabled) {
  background: var(--color-ai-action-hover);
}

.ai-ask-cancel:disabled,
.ai-ask-confirm:disabled {
  opacity: 0.45;
  cursor: default;
}

/* one card of icon+label tools right under the image */
.images-tools {
  align-self: center;
  max-width: 100%;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-btn-hover);
}

.images-tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 12.5px;
  white-space: nowrap;
  cursor: pointer;
}

.images-tool svg {
  color: var(--text-secondary);
  flex-shrink: 0;
}

.images-tool:hover {
  background: var(--hover);
}

.images-tool-on,
.images-tool-on:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.images-tool-on svg {
  color: var(--accent);
}

.images-tool-sep {
  width: 1px;
  height: 18px;
  margin: 0 4px;
  background: var(--border);
}

/* versions on the left, reveal on the right */
.images-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 12px;
}

.images-strip {
  display: flex;
  gap: 2px;
  align-items: center;
  flex-wrap: wrap;
  padding: 2px;
  border-radius: 8px;
  background: var(--surface-subtle);
}

.images-strip-item {
  height: 24px;
  padding: 0 10px;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
}

.images-strip-item:hover {
  color: var(--text);
}

.images-strip-on,
.images-strip-on:hover {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow-btn-hover);
}

.images-utils {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

.images-zoom {
  display: flex;
  align-items: center;
}

.images-zoom-pct {
  min-width: 48px;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}

.images-util-icon {
  padding: 0 6px;
}

.images-util {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 8px;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--color-text-secondary);
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
}

.images-util:hover:not(:disabled) {
  background: var(--hover);
  color: var(--text);
}

.images-util:disabled {
  opacity: 0.45;
  cursor: default;
}

.images-more {
  position: relative;
}

.images-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  min-width: 168px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-menu);
}

.images-menu button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 7px 9px;
  border: none;
  border-radius: 7px;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.images-menu button svg {
  color: var(--text-secondary);
}

.images-menu button:hover {
  background: var(--hover);
}

.images-prompt-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.images-prompt {
  font-size: 12px;
  line-height: 1.55;
  color: var(--color-text-secondary);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.images-prompt-clamped {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  white-space: normal;
}

.images-prompt-more {
  border: none;
  background: none;
  padding: 0;
  color: var(--accent);
  font-size: 12px;
  cursor: pointer;
}

.images-brief {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 0 2px;
}

.images-brief-hook {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.diff-tailwindcss-wrapper .\!container {
  width: 100% !important;
}
.diff-tailwindcss-wrapper .container {
  width: 100%;
}
@media (min-width: 640px) {
  .diff-tailwindcss-wrapper .\!container {
    max-width: 640px !important;
  }
  .diff-tailwindcss-wrapper .container {
    max-width: 640px;
  }
}
@media (min-width: 768px) {
  .diff-tailwindcss-wrapper .\!container {
    max-width: 768px !important;
  }
  .diff-tailwindcss-wrapper .container {
    max-width: 768px;
  }
}
@media (min-width: 1024px) {
  .diff-tailwindcss-wrapper .\!container {
    max-width: 1024px !important;
  }
  .diff-tailwindcss-wrapper .container {
    max-width: 1024px;
  }
}
@media (min-width: 1280px) {
  .diff-tailwindcss-wrapper .\!container {
    max-width: 1280px !important;
  }
  .diff-tailwindcss-wrapper .container {
    max-width: 1280px;
  }
}
@media (min-width: 1536px) {
  .diff-tailwindcss-wrapper .\!container {
    max-width: 1536px !important;
  }
  .diff-tailwindcss-wrapper .container {
    max-width: 1536px;
  }
}
.diff-tailwindcss-wrapper .invisible {
  visibility: hidden;
}
.diff-tailwindcss-wrapper .absolute {
  position: absolute;
}
.diff-tailwindcss-wrapper .relative {
  position: relative;
}
.diff-tailwindcss-wrapper .sticky {
  position: sticky;
}
.diff-tailwindcss-wrapper .left-0 {
  left: 0px;
}
.diff-tailwindcss-wrapper .left-\[100\%\] {
  left: 100%;
}
.diff-tailwindcss-wrapper .right-\[100\%\] {
  right: 100%;
}
.diff-tailwindcss-wrapper .top-0 {
  top: 0px;
}
.diff-tailwindcss-wrapper .top-\[50\%\] {
  top: 50%;
}
.diff-tailwindcss-wrapper .z-\[1\] {
  z-index: 1;
}
.diff-tailwindcss-wrapper .ml-\[-1\.5em\] {
  margin-left: -1.5em;
}
.diff-tailwindcss-wrapper .block {
  display: block;
}
.diff-tailwindcss-wrapper .inline-block {
  display: inline-block;
}
.diff-tailwindcss-wrapper .flex {
  display: flex;
}
.diff-tailwindcss-wrapper .table {
  display: table;
}
.diff-tailwindcss-wrapper .hidden {
  display: none;
}
.diff-tailwindcss-wrapper .h-\[50\%\] {
  height: 50%;
}
.diff-tailwindcss-wrapper .h-full {
  height: 100%;
}
.diff-tailwindcss-wrapper .min-h-\[28px\] {
  min-height: 28px;
}
.diff-tailwindcss-wrapper .w-\[1\%\] {
  width: 1%;
}
.diff-tailwindcss-wrapper .w-\[1\.5em\] {
  width: 1.5em;
}
.diff-tailwindcss-wrapper .w-\[1\.5px\] {
  width: 1.5px;
}
.diff-tailwindcss-wrapper .w-\[10px\] {
  width: 10px;
}
.diff-tailwindcss-wrapper .w-\[1px\] {
  width: 1px;
}
.diff-tailwindcss-wrapper .w-\[50\%\] {
  width: 50%;
}
.diff-tailwindcss-wrapper .w-full {
  width: 100%;
}
.diff-tailwindcss-wrapper .w-max {
  width: -moz-max-content;
  width: max-content;
}
.diff-tailwindcss-wrapper .min-w-\[100px\] {
  min-width: 100px;
}
.diff-tailwindcss-wrapper .min-w-\[40px\] {
  min-width: 40px;
}
.diff-tailwindcss-wrapper .min-w-full {
  min-width: 100%;
}
.diff-tailwindcss-wrapper .flex-shrink-0 {
  flex-shrink: 0;
}
.diff-tailwindcss-wrapper .shrink-0 {
  flex-shrink: 0;
}
.diff-tailwindcss-wrapper .basis-\[50\%\] {
  flex-basis: 50%;
}
.diff-tailwindcss-wrapper .table-fixed {
  table-layout: fixed;
}
.diff-tailwindcss-wrapper .border-collapse {
  border-collapse: collapse;
}
.diff-tailwindcss-wrapper .border-spacing-0 {
  --tw-border-spacing-x: 0px;
  --tw-border-spacing-y: 0px;
  border-spacing: var(--tw-border-spacing-x) var(--tw-border-spacing-y);
}
.diff-tailwindcss-wrapper .origin-center {
  transform-origin: center;
}
.diff-tailwindcss-wrapper .translate-x-\[-50\%\] {
  --tw-translate-x: -50%;
  transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
}
.diff-tailwindcss-wrapper .translate-x-\[50\%\] {
  --tw-translate-x: 50%;
  transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
}
.diff-tailwindcss-wrapper .translate-y-\[-50\%\] {
  --tw-translate-y: -50%;
  transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
}
.diff-tailwindcss-wrapper .transform {
  transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
}
.diff-tailwindcss-wrapper .cursor-pointer {
  cursor: pointer;
}
.diff-tailwindcss-wrapper .select-none {
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}
.diff-tailwindcss-wrapper .flex-col {
  flex-direction: column;
}
.diff-tailwindcss-wrapper .items-start {
  align-items: flex-start;
}
.diff-tailwindcss-wrapper .items-center {
  align-items: center;
}
.diff-tailwindcss-wrapper .justify-center {
  justify-content: center;
}
.diff-tailwindcss-wrapper .overflow-x-auto {
  overflow-x: auto;
}
.diff-tailwindcss-wrapper .overflow-y-hidden {
  overflow-y: hidden;
}
.diff-tailwindcss-wrapper .whitespace-nowrap {
  white-space: nowrap;
}
.diff-tailwindcss-wrapper .break-all {
  word-break: break-all;
}
.diff-tailwindcss-wrapper .rounded-\[2px\] {
  border-radius: 2px;
}
.diff-tailwindcss-wrapper .rounded-md {
  border-radius: 0.375rem;
}
.diff-tailwindcss-wrapper .border-l-\[1px\] {
  border-left-width: 1px;
}
.diff-tailwindcss-wrapper .fill-current {
  fill: currentColor;
}
.diff-tailwindcss-wrapper .p-0 {
  padding: 0px;
}
.diff-tailwindcss-wrapper .p-\[1px\] {
  padding: 1px;
}
.diff-tailwindcss-wrapper .px-\[10px\] {
  padding-left: 10px;
  padding-right: 10px;
}
.diff-tailwindcss-wrapper .py-\[2px\] {
  padding-top: 2px;
  padding-bottom: 2px;
}
.diff-tailwindcss-wrapper .py-\[6px\] {
  padding-top: 6px;
  padding-bottom: 6px;
}
.diff-tailwindcss-wrapper .pl-\[1\.5em\] {
  padding-left: 1.5em;
}
.diff-tailwindcss-wrapper .pl-\[10px\] {
  padding-left: 10px;
}
.diff-tailwindcss-wrapper .pl-\[2\.0em\] {
  padding-left: 2.0em;
}
.diff-tailwindcss-wrapper .pr-\[10px\] {
  padding-right: 10px;
}
.diff-tailwindcss-wrapper .text-right {
  text-align: right;
}
.diff-tailwindcss-wrapper .indent-\[0\.2em\] {
  text-indent: 0.2em;
}
.diff-tailwindcss-wrapper .align-top {
  vertical-align: top;
}
.diff-tailwindcss-wrapper .align-middle {
  vertical-align: middle;
}
.diff-tailwindcss-wrapper .text-\[1\.2em\] {
  font-size: 1.2em;
}
.diff-tailwindcss-wrapper .leading-\[1\.6\] {
  line-height: 1.6;
}
.diff-tailwindcss-wrapper .\!text-red-500 {
  --tw-text-opacity: 1 !important;
  color: rgb(239 68 68 / var(--tw-text-opacity, 1)) !important;
}
.diff-tailwindcss-wrapper .opacity-\[0\.5\] {
  opacity: 0.5;
}
.diff-tailwindcss-wrapper .transition-transform {
  transition-property: transform;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}
.diff-tailwindcss-wrapper * {
  box-sizing: border-box;
}
.diff-tailwindcss-wrapper[data-theme="light"] .diff-style-root {
  --diff-border--: #dedede;
  --diff-add-content--: #dafbe1;
  --diff-del-content--: #ffebe9;
  --diff-add-lineNumber--: #aceebb;
  --diff-del-lineNumber--: #ffcecb;
  --diff-plain-content--: #ffffff;
  --diff-expand-content--: #fafafa;
  --diff-plain-lineNumber--: #fafafa;
  --diff-expand-lineNumber--: #fafafa;
  --diff-plain-lineNumber-color--: #555555;
  --diff-expand-lineNumber-color--: #555555;
  --diff-hunk-content--: #ddf4ff;
  --diff-hunk-lineNumber--: #b6e3ff;
  --diff-hunk-lineNumber-hover--: #0969da;
  --diff-add-content-highlight--: #aceebb;
  --diff-del-content-highlight--: #ffcecb;
  --diff-add-widget--: #0969d2;
  --diff-add-widget-color--: #ffffff;
  --diff-empty-content--: #fafafa;
  --diff-hunk-content-color--: #777777;
}
.diff-tailwindcss-wrapper .diff-style-root .diff-line-syntax-raw *,
.diff-tailwindcss-wrapper[data-theme="light"] .diff-line-syntax-raw * {
  color: var(--diff-view-light, inherit);
  font-weight: var(--diff-view-light-font-weight, inherit);
}
.diff-tailwindcss-wrapper[data-theme="dark"] .diff-style-root {
  --diff-border--: #3d444d;
  --diff-add-content--: #18271f;
  --diff-del-content--: #23191c;
  --diff-add-lineNumber--: #284228;
  --diff-del-lineNumber--: #4f2828;
  --diff-plain-content--: #0d1117;
  --diff-expand-content--: #161b22;
  --diff-plain-lineNumber--: #161b22;
  --diff-expand-lineNumber--: #161b22;
  --diff-plain-lineNumber-color--: #a0aaab;
  --diff-expand-lineNumber-color--: #a0aaab;
  --diff-hunk-content--: #131d2e;
  --diff-hunk-lineNumber--: #0c2d6b;
  --diff-hunk-lineNumber-hover--: #1f6feb;
  --diff-add-content-highlight--: #2f5732;
  --diff-del-content-highlight--: #713431;
  --diff-add-widget--: #0969d2;
  --diff-add-widget-color--: #ffffff;
  --diff-empty-content--: #161b22;
  --diff-hunk-content-color--: #9298a0;
}
.diff-tailwindcss-wrapper[data-theme="dark"] [data-state="diff"],
.diff-tailwindcss-wrapper[data-theme="dark"] [data-state="plain"],
.diff-tailwindcss-wrapper[data-theme="dark"] [data-state="hunk"] {
  color: white;
}
.diff-tailwindcss-wrapper[data-theme="light"] [data-state="diff"],
.diff-tailwindcss-wrapper[data-theme="light"] [data-state="plain"],
.diff-tailwindcss-wrapper[data-theme="light"] [data-state="hunk"] {
  color: black;
}
.diff-tailwindcss-wrapper[data-theme="dark"] .diff-line-syntax-raw * {
  color: var(--diff-view-dark, inherit);
  font-weight: var(--diff-view-dark-font-weight, inherit);
}
.diff-tailwindcss-wrapper table,
.diff-tailwindcss-wrapper tr,
.diff-tailwindcss-wrapper td {
  border-color: transparent;
  border-width: 0px;
  text-align: left;
}
.diff-tailwindcss-wrapper td {
  padding: 0;
}
.diff-tailwindcss-wrapper .diff-line-old-num,
.diff-tailwindcss-wrapper .diff-line-new-num,
.diff-tailwindcss-wrapper .diff-line-num {
  text-align: right;
}
.diff-tailwindcss-wrapper .diff-style-root tr {
  content-visibility: auto;
}
.diff-tailwindcss-wrapper .diff-add-widget-wrapper {
  transform-origin: center;
  transform: translateX(-50%) !important;
}
.diff-tailwindcss-wrapper .diff-line-old-content .diff-add-widget-wrapper,
.diff-tailwindcss-wrapper .diff-line-new-content .diff-add-widget-wrapper {
  transform: translateX(50%) !important;
}
.diff-tailwindcss-wrapper .diff-add-widget-wrapper:hover {
  transform: translateX(-50%) scale(1.1) !important;
}
.diff-tailwindcss-wrapper .diff-line-old-content .diff-add-widget-wrapper:hover,
.diff-tailwindcss-wrapper .diff-line-new-content .diff-add-widget-wrapper:hover {
  transform: translateX(50%) scale(1.1) !important;
}
.diff-tailwindcss-wrapper .diff-widget-tooltip {
  position: relative;
}
.diff-tailwindcss-wrapper .diff-add-widget,
.diff-tailwindcss-wrapper .diff-widget-tooltip {
  font-family: inherit;
  font-feature-settings: inherit;
  font-variation-settings: inherit;
  font-size: 100%;
  font-weight: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  color: inherit;
  margin: 0;
  text-transform: none;
  border-width: 0px;
  background-color: transparent;
  background-image: none;
}
.diff-tailwindcss-wrapper .diff-widget-tooltip::after {
  display: none;
  box-sizing: border-box;
  background-color: #555555;
  position: absolute;
  content: attr(data-title);
  font-size: 11px;
  padding: 1px 2px;
  border-radius: 4px;
  overflow: hidden;
  top: 50%;
  white-space: nowrap;
  transform: translateY(-50%);
  left: calc(100% + 8px);
  color: #ffffff;
}
.diff-tailwindcss-wrapper .diff-widget-tooltip::before {
  display: none;
  box-sizing: border-box;
  content: "";
  position: absolute;
  top: 50%;
  left: calc(100% - 2px);
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-right-color: #555555;
}
.diff-tailwindcss-wrapper .diff-widget-tooltip:hover {
  background-color: var(--diff-hunk-lineNumber-hover--);
  color: white;
}
.diff-tailwindcss-wrapper .diff-widget-tooltip:hover::before {
  display: block;
}
.diff-tailwindcss-wrapper .diff-widget-tooltip:hover::after {
  display: block;
}
.diff-line-extend-wrapper,
.diff-line-widget-wrapper {
  display: flow-root;
}
/* Multi-select styles for line range selection */
.diff-tailwindcss-wrapper .diff-multi-select-active.diff-line-new-num,
.diff-tailwindcss-wrapper .diff-multi-select-active.diff-line-old-num,
.diff-tailwindcss-wrapper .diff-multi-select-active.diff-line-num {
  z-index: 2;
}
.diff-tailwindcss-wrapper .diff-multi-select-active.diff-line-content,
.diff-tailwindcss-wrapper .diff-multi-select-active.diff-line-new-content,
.diff-tailwindcss-wrapper .diff-multi-select-active.diff-line-old-content {
  position: relative;
}
.diff-tailwindcss-wrapper .diff-multi-select-active.diff-line-new-num::after,
.diff-tailwindcss-wrapper .diff-multi-select-active.diff-line-old-num::after,
.diff-tailwindcss-wrapper .diff-multi-select-active.diff-line-num::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  opacity: 0.15;
  background-color: var(--diff-multi-select-bg, #f0c000);
  pointer-events: none;
}
.diff-tailwindcss-wrapper .diff-multi-select-active.diff-line-new-num::before,
.diff-tailwindcss-wrapper .diff-multi-select-active.diff-line-old-num::before,
.diff-tailwindcss-wrapper .diff-multi-select-active.diff-line-num::before {
  content: "";
  z-index: 2;
  position: absolute;
  top: 0;
  bottom: 0;
  right: -2px;
  width: 4px;
  background-color: var(--diff-multi-select-border, #2588fa);
}
.diff-tailwindcss-wrapper .diff-multi-select-active.diff-line-new-content::after,
.diff-tailwindcss-wrapper .diff-multi-select-active.diff-line-old-content::after,
.diff-tailwindcss-wrapper .diff-multi-select-active.diff-line-content::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  opacity: 0.15;
  background-color: var(--diff-multi-select-bg, #f0c000);
  pointer-events: none;
}
/* Multi-select: ensure proper positioning for line number cells */
.diff-multi-selecting .diff-line-old-num,
.diff-multi-selecting .diff-line-new-num,
.diff-multi-selecting .diff-line-num {
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}
.diff-multi-selecting .diff-line-old-content,
.diff-multi-selecting .diff-line-new-content,
.diff-multi-selecting .diff-line-content {
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}
/* Prevent text selection during multi-line selection */
.diff-multi-selecting {
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}
.diff-multi-selecting * {
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}
/* Hide addWidget button during active dragging selection */
.diff-multi-selecting .diff-add-widget-wrapper {
  display: none;
}
/* Ensure addWidget button is above selection overlay */
.diff-multiselect-wrapper .diff-add-widget-wrapper {
  z-index: 10 !important;
}
/* Line number span should not interfere with click events */
.diff-tailwindcss-wrapper .diff-line-new-num span[data-line-num],
.diff-tailwindcss-wrapper .diff-line-old-num span[data-line-num] {
  pointer-events: none;
}
.diff-multiselect-wrapper .diff-line-old-num,
.diff-multiselect-wrapper .diff-line-new-num,
.diff-multiselect-wrapper .diff-line-num {
  cursor: pointer;
}
.diff-tailwindcss-wrapper[data-theme="light"] .diff-line-syntax-raw pre code.hljs {
  display: block;
  overflow-x: auto;
  padding: 1em
}
.diff-tailwindcss-wrapper[data-theme="light"] .diff-line-syntax-raw code.hljs {
  padding: 3px 5px
}
/*!
  Theme: GitHub
  Description: Light theme as seen on github.com
  Author: github.com
  Maintainer: @Hirse
  Updated: 2021-05-15

  Outdated base version: https://github.com/primer/github-syntax-light
  Current colors taken from GitHub's CSS
*/
.diff-tailwindcss-wrapper[data-theme="light"] .diff-line-syntax-raw .hljs {
  color: #24292e;
  background: #ffffff
}
.diff-tailwindcss-wrapper[data-theme="light"] .diff-line-syntax-raw .hljs-doctag,
.diff-tailwindcss-wrapper[data-theme="light"] .diff-line-syntax-raw .hljs-keyword,
.diff-tailwindcss-wrapper[data-theme="light"] .diff-line-syntax-raw .hljs-meta .hljs-keyword,
.diff-tailwindcss-wrapper[data-theme="light"] .diff-line-syntax-raw .hljs-template-tag,
.diff-tailwindcss-wrapper[data-theme="light"] .diff-line-syntax-raw .hljs-template-variable,
.diff-tailwindcss-wrapper[data-theme="light"] .diff-line-syntax-raw .hljs-type,
.diff-tailwindcss-wrapper[data-theme="light"] .diff-line-syntax-raw .hljs-variable.language_ {
  /* prettylights-syntax-keyword */
  color: #d73a49
}
.diff-tailwindcss-wrapper[data-theme="light"] .diff-line-syntax-raw .hljs-title,
.diff-tailwindcss-wrapper[data-theme="light"] .diff-line-syntax-raw .hljs-title.class_,
.diff-tailwindcss-wrapper[data-theme="light"] .diff-line-syntax-raw .hljs-title.class_.inherited__,
.diff-tailwindcss-wrapper[data-theme="light"] .diff-line-syntax-raw .hljs-title.function_ {
  /* prettylights-syntax-entity */
  color: #6f42c1
}
.diff-tailwindcss-wrapper[data-theme="light"] .diff-line-syntax-raw .hljs-attr,
.diff-tailwindcss-wrapper[data-theme="light"] .diff-line-syntax-raw .hljs-attribute,
.diff-tailwindcss-wrapper[data-theme="light"] .diff-line-syntax-raw .hljs-literal,
.diff-tailwindcss-wrapper[data-theme="light"] .diff-line-syntax-raw .hljs-meta,
.diff-tailwindcss-wrapper[data-theme="light"] .diff-line-syntax-raw .hljs-number,
.diff-tailwindcss-wrapper[data-theme="light"] .diff-line-syntax-raw .hljs-operator,
.diff-tailwindcss-wrapper[data-theme="light"] .diff-line-syntax-raw .hljs-variable,
.diff-tailwindcss-wrapper[data-theme="light"] .diff-line-syntax-raw .hljs-selector-attr,
.diff-tailwindcss-wrapper[data-theme="light"] .diff-line-syntax-raw .hljs-selector-class,
.diff-tailwindcss-wrapper[data-theme="light"] .diff-line-syntax-raw .hljs-selector-id {
  /* prettylights-syntax-constant */
  color: #005cc5
}
.diff-tailwindcss-wrapper[data-theme="light"] .diff-line-syntax-raw .hljs-regexp,
.diff-tailwindcss-wrapper[data-theme="light"] .diff-line-syntax-raw .hljs-string,
.diff-tailwindcss-wrapper[data-theme="light"] .diff-line-syntax-raw .hljs-meta .hljs-string {
  /* prettylights-syntax-string */
  color: #032f62
}
.diff-tailwindcss-wrapper[data-theme="light"] .diff-line-syntax-raw .hljs-built_in,
.diff-tailwindcss-wrapper[data-theme="light"] .diff-line-syntax-raw .hljs-symbol {
  /* prettylights-syntax-variable */
  color: #e36209
}
.diff-tailwindcss-wrapper[data-theme="light"] .diff-line-syntax-raw .hljs-comment,
.diff-tailwindcss-wrapper[data-theme="light"] .diff-line-syntax-raw .hljs-code,
.diff-tailwindcss-wrapper[data-theme="light"] .diff-line-syntax-raw .hljs-formula {
  /* prettylights-syntax-comment */
  color: #6a737d
}
.diff-tailwindcss-wrapper[data-theme="light"] .diff-line-syntax-raw .hljs-name,
.diff-tailwindcss-wrapper[data-theme="light"] .diff-line-syntax-raw .hljs-quote,
.diff-tailwindcss-wrapper[data-theme="light"] .diff-line-syntax-raw .hljs-selector-tag,
.diff-tailwindcss-wrapper[data-theme="light"] .diff-line-syntax-raw .hljs-selector-pseudo {
  /* prettylights-syntax-entity-tag */
  color: #22863a
}
.diff-tailwindcss-wrapper[data-theme="light"] .diff-line-syntax-raw .hljs-subst {
  /* prettylights-syntax-storage-modifier-import */
  color: #24292e
}
.diff-tailwindcss-wrapper[data-theme="light"] .diff-line-syntax-raw .hljs-section {
  /* prettylights-syntax-markup-heading */
  color: #005cc5;
  font-weight: bold
}
.diff-tailwindcss-wrapper[data-theme="light"] .diff-line-syntax-raw .hljs-bullet {
  /* prettylights-syntax-markup-list */
  color: #735c0f
}
.diff-tailwindcss-wrapper[data-theme="light"] .diff-line-syntax-raw .hljs-emphasis {
  /* prettylights-syntax-markup-italic */
  color: #24292e;
  font-style: italic
}
.diff-tailwindcss-wrapper[data-theme="light"] .diff-line-syntax-raw .hljs-strong {
  /* prettylights-syntax-markup-bold */
  color: #24292e;
  font-weight: bold
}
.diff-tailwindcss-wrapper[data-theme="light"] .diff-line-syntax-raw .hljs-addition {
  /* prettylights-syntax-markup-inserted */
  color: #22863a;
  background-color: #f0fff4
}
.diff-tailwindcss-wrapper[data-theme="light"] .diff-line-syntax-raw .hljs-deletion {
  /* prettylights-syntax-markup-deleted */
  color: #b31d28;
  background-color: #ffeef0
}
.diff-tailwindcss-wrapper[data-theme="light"] .diff-line-syntax-raw .hljs-char.escape_,
.diff-tailwindcss-wrapper[data-theme="light"] .diff-line-syntax-raw .hljs-link,
.diff-tailwindcss-wrapper[data-theme="light"] .diff-line-syntax-raw .hljs-params,
.diff-tailwindcss-wrapper[data-theme="light"] .diff-line-syntax-raw .hljs-property,
.diff-tailwindcss-wrapper[data-theme="light"] .diff-line-syntax-raw .hljs-punctuation,
.diff-tailwindcss-wrapper[data-theme="light"] .diff-line-syntax-raw .hljs-tag {
  /* purposely ignored */
  
}
.diff-tailwindcss-wrapper[data-theme="dark"] .diff-line-syntax-raw pre code.hljs {
  display: block;
  overflow-x: auto;
  padding: 1em
}
.diff-tailwindcss-wrapper[data-theme="dark"] .diff-line-syntax-raw code.hljs {
  padding: 3px 5px
}
/*!
  Theme: GitHub Dark
  Description: Dark theme as seen on github.com
  Author: github.com
  Maintainer: @Hirse
  Updated: 2021-05-15

  Outdated base version: https://github.com/primer/github-syntax-dark
  Current colors taken from GitHub's CSS
*/
.diff-tailwindcss-wrapper[data-theme="dark"] .diff-line-syntax-raw .hljs {
  color: #c9d1d9;
  background: #0d1117
}
.diff-tailwindcss-wrapper[data-theme="dark"] .diff-line-syntax-raw .hljs-doctag,
.diff-tailwindcss-wrapper[data-theme="dark"] .diff-line-syntax-raw .hljs-keyword,
.diff-tailwindcss-wrapper[data-theme="dark"] .diff-line-syntax-raw .hljs-meta .hljs-keyword,
.diff-tailwindcss-wrapper[data-theme="dark"] .diff-line-syntax-raw .hljs-template-tag,
.diff-tailwindcss-wrapper[data-theme="dark"] .diff-line-syntax-raw .hljs-template-variable,
.diff-tailwindcss-wrapper[data-theme="dark"] .diff-line-syntax-raw .hljs-type,
.diff-tailwindcss-wrapper[data-theme="dark"] .diff-line-syntax-raw .hljs-variable.language_ {
  /* prettylights-syntax-keyword */
  color: #ff7b72
}
.diff-tailwindcss-wrapper[data-theme="dark"] .diff-line-syntax-raw .hljs-title,
.diff-tailwindcss-wrapper[data-theme="dark"] .diff-line-syntax-raw .hljs-title.class_,
.diff-tailwindcss-wrapper[data-theme="dark"] .diff-line-syntax-raw .hljs-title.class_.inherited__,
.diff-tailwindcss-wrapper[data-theme="dark"] .diff-line-syntax-raw .hljs-title.function_ {
  /* prettylights-syntax-entity */
  color: #d2a8ff
}
.diff-tailwindcss-wrapper[data-theme="dark"] .diff-line-syntax-raw .hljs-attr,
.diff-tailwindcss-wrapper[data-theme="dark"] .diff-line-syntax-raw .hljs-attribute,
.diff-tailwindcss-wrapper[data-theme="dark"] .diff-line-syntax-raw .hljs-literal,
.diff-tailwindcss-wrapper[data-theme="dark"] .diff-line-syntax-raw .hljs-meta,
.diff-tailwindcss-wrapper[data-theme="dark"] .diff-line-syntax-raw .hljs-number,
.diff-tailwindcss-wrapper[data-theme="dark"] .diff-line-syntax-raw .hljs-operator,
.diff-tailwindcss-wrapper[data-theme="dark"] .diff-line-syntax-raw .hljs-variable,
.diff-tailwindcss-wrapper[data-theme="dark"] .diff-line-syntax-raw .hljs-selector-attr,
.diff-tailwindcss-wrapper[data-theme="dark"] .diff-line-syntax-raw .hljs-selector-class,
.diff-tailwindcss-wrapper[data-theme="dark"] .diff-line-syntax-raw .hljs-selector-id {
  /* prettylights-syntax-constant */
  color: #79c0ff
}
.diff-tailwindcss-wrapper[data-theme="dark"] .diff-line-syntax-raw .hljs-regexp,
.diff-tailwindcss-wrapper[data-theme="dark"] .diff-line-syntax-raw .hljs-string,
.diff-tailwindcss-wrapper[data-theme="dark"] .diff-line-syntax-raw .hljs-meta .hljs-string {
  /* prettylights-syntax-string */
  color: #a5d6ff
}
.diff-tailwindcss-wrapper[data-theme="dark"] .diff-line-syntax-raw .hljs-built_in,
.diff-tailwindcss-wrapper[data-theme="dark"] .diff-line-syntax-raw .hljs-symbol {
  /* prettylights-syntax-variable */
  color: #ffa657
}
.diff-tailwindcss-wrapper[data-theme="dark"] .diff-line-syntax-raw .hljs-comment,
.diff-tailwindcss-wrapper[data-theme="dark"] .diff-line-syntax-raw .hljs-code,
.diff-tailwindcss-wrapper[data-theme="dark"] .diff-line-syntax-raw .hljs-formula {
  /* prettylights-syntax-comment */
  color: #8b949e
}
.diff-tailwindcss-wrapper[data-theme="dark"] .diff-line-syntax-raw .hljs-name,
.diff-tailwindcss-wrapper[data-theme="dark"] .diff-line-syntax-raw .hljs-quote,
.diff-tailwindcss-wrapper[data-theme="dark"] .diff-line-syntax-raw .hljs-selector-tag,
.diff-tailwindcss-wrapper[data-theme="dark"] .diff-line-syntax-raw .hljs-selector-pseudo {
  /* prettylights-syntax-entity-tag */
  color: #7ee787
}
.diff-tailwindcss-wrapper[data-theme="dark"] .diff-line-syntax-raw .hljs-subst {
  /* prettylights-syntax-storage-modifier-import */
  color: #c9d1d9
}
.diff-tailwindcss-wrapper[data-theme="dark"] .diff-line-syntax-raw .hljs-section {
  /* prettylights-syntax-markup-heading */
  color: #1f6feb;
  font-weight: bold
}
.diff-tailwindcss-wrapper[data-theme="dark"] .diff-line-syntax-raw .hljs-bullet {
  /* prettylights-syntax-markup-list */
  color: #f2cc60
}
.diff-tailwindcss-wrapper[data-theme="dark"] .diff-line-syntax-raw .hljs-emphasis {
  /* prettylights-syntax-markup-italic */
  color: #c9d1d9;
  font-style: italic
}
.diff-tailwindcss-wrapper[data-theme="dark"] .diff-line-syntax-raw .hljs-strong {
  /* prettylights-syntax-markup-bold */
  color: #c9d1d9;
  font-weight: bold
}
.diff-tailwindcss-wrapper[data-theme="dark"] .diff-line-syntax-raw .hljs-addition {
  /* prettylights-syntax-markup-inserted */
  color: #aff5b4;
  background-color: #033a16
}
.diff-tailwindcss-wrapper[data-theme="dark"] .diff-line-syntax-raw .hljs-deletion {
  /* prettylights-syntax-markup-deleted */
  color: #ffdcd7;
  background-color: #67060c
}
.diff-tailwindcss-wrapper[data-theme="dark"] .diff-line-syntax-raw .hljs-char.escape_,
.diff-tailwindcss-wrapper[data-theme="dark"] .diff-line-syntax-raw .hljs-link,
.diff-tailwindcss-wrapper[data-theme="dark"] .diff-line-syntax-raw .hljs-params,
.diff-tailwindcss-wrapper[data-theme="dark"] .diff-line-syntax-raw .hljs-property,
.diff-tailwindcss-wrapper[data-theme="dark"] .diff-line-syntax-raw .hljs-punctuation,
.diff-tailwindcss-wrapper[data-theme="dark"] .diff-line-syntax-raw .hljs-tag {
  /* purposely ignored */
  
}
.diff-tailwindcss-wrapper .hover\:scale-110:hover {
  --tw-scale-x: 1.1;
  --tw-scale-y: 1.1;
  transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
}
.diff-tailwindcss-wrapper .group:hover .group-hover\:visible {
  visibility: visible;
}
/**
 * Copyright (c) 2014 The xterm.js authors. All rights reserved.
 * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
 * https://github.com/chjj/term.js
 * @license MIT
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 *
 * Originally forked from (with the author's permission):
 *   Fabrice Bellard's javascript vt100 for jslinux:
 *   http://bellard.org/jslinux/
 *   Copyright (c) 2011 Fabrice Bellard
 *   The original design remains. The terminal itself
 *   has been extended to include xterm CSI codes, among
 *   other features.
 */

/**
 *  Default styles for xterm.js
 */

.xterm {
    cursor: text;
    position: relative;
    user-select: none;
    -ms-user-select: none;
    -webkit-user-select: none;
}

.xterm.focus,
.xterm:focus {
    outline: none;
}

.xterm .xterm-helpers {
    position: absolute;
    top: 0;
    /**
     * The z-index of the helpers must be higher than the canvases in order for
     * IMEs to appear on top.
     */
    z-index: 5;
}

.xterm .xterm-helper-textarea {
    padding: 0;
    border: 0;
    margin: 0;
    /* Move textarea out of the screen to the far left, so that the cursor is not visible */
    position: absolute;
    opacity: 0;
    left: -9999em;
    top: 0;
    width: 0;
    height: 0;
    z-index: -5;
    /** Prevent wrapping so the IME appears against the textarea at the correct position */
    white-space: nowrap;
    overflow: hidden;
    resize: none;
}

.xterm .composition-view {
    /* TODO: Composition position got messed up somewhere */
    background: #000;
    color: #FFF;
    display: none;
    position: absolute;
    white-space: nowrap;
    z-index: 1;
}

.xterm .composition-view.active {
    display: block;
}

.xterm .xterm-viewport {
    /* On OS X this is required in order for the scroll bar to appear fully opaque */
    background-color: #000;
    overflow-y: scroll;
    cursor: default;
    position: absolute;
    right: 0;
    left: 0;
    top: 0;
    bottom: 0;
}

.xterm .xterm-screen {
    position: relative;
}

.xterm .xterm-screen canvas {
    position: absolute;
    left: 0;
    top: 0;
}

.xterm-char-measure-element {
    display: inline-block;
    visibility: hidden;
    position: absolute;
    top: 0;
    left: -9999em;
    line-height: normal;
}

.xterm.enable-mouse-events {
    /* When mouse events are enabled (eg. tmux), revert to the standard pointer cursor */
    cursor: default;
}

.xterm.xterm-cursor-pointer,
.xterm .xterm-cursor-pointer {
    cursor: pointer;
}

.xterm.column-select.focus {
    /* Column selection mode */
    cursor: crosshair;
}

.xterm .xterm-accessibility:not(.debug),
.xterm .xterm-message {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    right: 0;
    z-index: 10;
    color: transparent;
    pointer-events: none;
}

.xterm .xterm-accessibility-tree:not(.debug) *::selection {
  color: transparent;
}

.xterm .xterm-accessibility-tree {
  font-family: monospace;
  user-select: text;
  white-space: pre;
}

.xterm .xterm-accessibility-tree > div {
  transform-origin: left;
  width: fit-content;
}

.xterm .live-region {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.xterm-dim {
    /* Dim should not apply to background, so the opacity of the foreground color is applied
     * explicitly in the generated class and reset to 1 here */
    opacity: 1 !important;
}

.xterm-underline-1 { text-decoration: underline; }
.xterm-underline-2 { text-decoration: double underline; }
.xterm-underline-3 { text-decoration: wavy underline; }
.xterm-underline-4 { text-decoration: dotted underline; }
.xterm-underline-5 { text-decoration: dashed underline; }

.xterm-overline {
    text-decoration: overline;
}

.xterm-overline.xterm-underline-1 { text-decoration: overline underline; }
.xterm-overline.xterm-underline-2 { text-decoration: overline double underline; }
.xterm-overline.xterm-underline-3 { text-decoration: overline wavy underline; }
.xterm-overline.xterm-underline-4 { text-decoration: overline dotted underline; }
.xterm-overline.xterm-underline-5 { text-decoration: overline dashed underline; }

.xterm-strikethrough {
    text-decoration: line-through;
}

.xterm-screen .xterm-decoration-container .xterm-decoration {
	z-index: 6;
	position: absolute;
}

.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer {
	z-index: 7;
}

.xterm-decoration-overview-ruler {
    z-index: 8;
    position: absolute;
    top: 0;
    right: 0;
    pointer-events: none;
}

.xterm-decoration-top {
    z-index: 2;
    position: relative;
}



/* Derived from vs/base/browser/ui/scrollbar/media/scrollbar.css */

/* xterm.js customization: Override xterm's cursor style */
.xterm .xterm-scrollable-element > .scrollbar {
    cursor: default;
}

/* Arrows */
.xterm .xterm-scrollable-element > .scrollbar > .scra {
	cursor: pointer;
	font-size: 11px !important;
}

.xterm .xterm-scrollable-element > .visible {
	opacity: 1;

	/* Background rule added for IE9 - to allow clicks on dom node */
	background:rgba(0,0,0,0);

	transition: opacity 100ms linear;
	/* In front of peek view */
	z-index: 11;
}
.xterm .xterm-scrollable-element > .invisible {
	opacity: 0;
	pointer-events: none;
}
.xterm .xterm-scrollable-element > .invisible.fade {
	transition: opacity 800ms linear;
}

/* Scrollable Content Inset Shadow */
.xterm .xterm-scrollable-element > .shadow {
	position: absolute;
	display: none;
}
.xterm .xterm-scrollable-element > .shadow.top {
	display: block;
	top: 0;
	left: 3px;
	height: 3px;
	width: 100%;
	box-shadow: var(--vscode-scrollbar-shadow, #000) 0 6px 6px -6px inset;
}
.xterm .xterm-scrollable-element > .shadow.left {
	display: block;
	top: 3px;
	left: 0;
	height: 100%;
	width: 3px;
	box-shadow: var(--vscode-scrollbar-shadow, #000) 6px 0 6px -6px inset;
}
.xterm .xterm-scrollable-element > .shadow.top-left-corner {
	display: block;
	top: 0;
	left: 0;
	height: 3px;
	width: 3px;
}
.xterm .xterm-scrollable-element > .shadow.top.left {
	box-shadow: var(--vscode-scrollbar-shadow, #000) 6px 0 6px -6px inset;
}
/* genWork unified-stream tool rows & step groups (shared by Home + app panels).
 * Chrome colors only — semantic tokens from @genoffice/ui/tokens.css. */

.gw-step {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  font-size: 13px;
  color: var(--text-secondary);
}

.gw-step-head {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 3px 2px;
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: default;
  min-width: 0;
}

.gw-step-head[aria-expanded] {
  cursor: pointer;
  border-radius: 6px;
}

.gw-step-head[aria-expanded]:hover {
  background: var(--hover);
}

/* deliberate soft ring for keyboard focus; pointer clicks blur (SAS rule) so
   the OS-accent default ring never paints across the row */
.gw-step-head:focus-visible,
.gw-steps-head:focus-visible,
.gw-ws-head:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--accent-soft, var(--hover));
}

/* status node: muted dot, accent pulse while running; a failed step keeps the
   dot — red is for the outcome of the run, not for a step along the way */
.gw-step-icon {
  flex: none;
  align-self: center;
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.gw-step-icon::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-tertiary);
}

.gw-step-running .gw-step-icon::before {
  background: var(--accent);
  animation: gw-step-pulse 1.4s ease-in-out infinite;
}

.gw-step-reason {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  color: var(--text-tertiary);
}

/* a user stop: neutral square, never the failure cross */
.gw-step-cancelled .gw-step-icon::before {
  border-radius: 1px;
}

.gw-step-title {
  flex: none;
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gw-step-chip {
  flex: 0 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  color: var(--text-tertiary);
}

.gw-step-duration,
.gw-step-count {
  flex: none;
  font-size: 10px;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}

/* live argument-size ticker on a still-streaming call */
.gw-step-size {
  flex: none;
  font-size: 10px;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}

/* fold carets appear on hover/keyboard focus only (SAS rule) and point down while expanded */
.gw-step-caret {
  flex: none;
  color: var(--text-tertiary);
  font-size: 10px;
  opacity: 0;
  transition: transform 0.15s ease;
}

.gw-step-head[aria-expanded]:hover .gw-step-caret,
.gw-step-head:focus-visible .gw-step-caret {
  opacity: 1;
}

.gw-step-open .gw-step-caret {
  transform: rotate(90deg);
}

.gw-step-detail {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 6px;
  background: var(--surface-subtle);
  border-radius: 0 0 8px 8px;
  padding: 2px 10px 10px 22px;
}

/* the open row fuses with its detail into one card (SAS pill+panel shape) */
.gw-step-open > .gw-step-head,
.gw-step-open > .gw-step-head[aria-expanded]:hover {
  background: var(--surface-subtle);
  border-radius: 8px 8px 0 0;
}

.gw-step-block {
  background: none;
  border-radius: 0;
  padding: 0;
}

.gw-step-block-error {
  background: var(--danger-bg);
  border-radius: 6px;
  padding: 6px 8px;
}

.gw-step-block-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-tertiary);
  margin-bottom: 4px;
}

.gw-step-block-error .gw-step-block-label {
  color: var(--danger);
}

/* human prose inside a detail (instructions, long string params): body font, real wrapping */
.gw-step-prose {
  font-size: 12px;
  line-height: 1.55;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 300px;
  overflow: auto;
}

/* label+value rows for structured input — never raw JSON (SAS plain-renderer shape) */
.gw-step-kv-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gw-step-kv {
  display: flex;
  gap: 8px;
  align-items: baseline;
  font-size: 12px;
  line-height: 1.5;
}

.gw-step-kv-label {
  flex-shrink: 0;
  min-width: 90px;
  font-weight: 500;
  color: var(--text-tertiary);
}

.gw-step-kv-value {
  color: var(--text);
  word-break: break-word;
}

.gw-step-kv .gw-step-prose,
.gw-step-kv-pre {
  flex: 1;
  min-width: 0;
}

.gw-step-kv-pre {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
  max-height: 300px;
  overflow: auto;
}

/* inline progress bar on a running long tool (page-by-page deck feedback) */
.gw-step-progress {
  flex: none;
  width: 72px;
  height: 4px;
  border-radius: 999px;
  background: var(--hover);
  overflow: hidden;
  align-self: center;
}

.gw-step-progress-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.4s ease;
}

/* generate_deck input as a deck outline: numbered pages, tag chips, clamped briefs */
.gw-deck-plan {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
}

.gw-deck-pages {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gw-deck-page {
  display: flex;
  gap: 8px;
  min-width: 0;
}

.gw-deck-num {
  flex-shrink: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  color: var(--text-tertiary);
  padding-top: 2px;
}

.gw-deck-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.gw-deck-head {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.gw-deck-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.gw-deck-tag {
  font-size: 10px;
  color: var(--text-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 0 6px;
}

.gw-deck-brief {
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gw-deck-queries {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.gw-deck-query {
  font-size: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--text-tertiary);
  background: var(--hover);
  border-radius: 4px;
  padding: 0 5px;
}

/* search results: one link row per hit — favicon, title, host (Claude shape;
   snippets stay in the raw output the LLM read, the user clicks through) */
.gw-search-results {
  display: flex;
  flex-direction: column;
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface);
}

.gw-search-hit {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 6px 10px;
  color: inherit;
  text-decoration: none;
}

.gw-search-hit + .gw-search-hit {
  border-top: 1px solid var(--border-subtle);
}

.gw-search-hit:hover {
  background: var(--hover);
}

.gw-search-favicon {
  flex: none;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  object-fit: contain;
}

.gw-search-favicon-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  line-height: 1;
  color: var(--icon-muted);
}

.gw-search-title {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gw-search-hit:hover .gw-search-title {
  text-decoration: underline;
}

.gw-search-host {
  flex: none;
  max-width: 40%;
  font-size: 11px;
  color: var(--text-tertiary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* image_plan: the project's visual anchor, visible without expanding the row */
.gw-brief-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 4px 0 2px 22px;
  padding: 8px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface);
  max-width: 520px;
}

.gw-brief-hook {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.5;
}

.gw-brief-direction {
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.gw-brief-palette {
  display: flex;
  gap: 4px;
  margin-top: 2px;
}

.gw-brief-palette i {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
}

/* saved scheduled task: the turn's deliverable, with edit / try-once actions */
.gw-automation-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 4px 0 2px 22px;
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface);
  max-width: 520px;
}

.gw-automation-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gw-automation-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.gw-automation-meta {
  font-size: 11px;
  color: var(--text-secondary);
}

.gw-automation-prompt {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-wrap;
}

.gw-automation-actions {
  display: flex;
  gap: 6px;
  margin-top: 2px;
}

.gw-automation-btn {
  padding: 4px 10px;
  font-size: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.gw-automation-btn:hover {
  background: var(--hover);
}

.gw-automation-btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--color-ai-action-text);
}

.gw-automation-btn-primary:hover {
  background: var(--accent-dark);
}

/* generated media: always-visible deliverable card under the tool row */
.gw-media-card {
  margin: 6px 0 2px;
}

.gw-media-open {
  display: block;
  width: fit-content;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: none;
  cursor: zoom-in;
}

/* same deliberate soft keyboard ring as the row heads; pointer clicks blur,
   so the OS-accent default ring never paints around the image */
.gw-media-open:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--accent-soft, var(--hover));
}

.gw-media-img img {
  display: block;
  max-width: min(360px, 100%);
  max-height: 260px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.gw-media-pending {
  display: block;
  background: var(--hover);
  animation: gw-media-pulse 1.4s ease-in-out infinite;
}

.gw-media-img.gw-media-pending {
  width: 220px;
  height: 140px;
  border-radius: 10px;
}

@keyframes gw-media-pulse {
  50% {
    opacity: 0.55;
  }
}

.gw-media-video {
  display: block;
  max-width: min(420px, 100%);
  max-height: 280px;
  border-radius: 10px;
}

/* image-search thumbnails inside the collapsed detail */
.gw-media-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 320px;
  overflow: auto;
}

.gw-media-thumb img {
  display: block;
  width: 96px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.gw-media-thumb.gw-media-pending {
  width: 96px;
  height: 72px;
  border-radius: 8px;
}

/* markdown-embedded image (assistant prose citing a tool-produced URL) */
.ai-md-img img {
  display: block;
  max-width: 100%;
  max-height: 300px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.ai-md-img.gw-media-pending {
  width: 220px;
  height: 140px;
  border-radius: 10px;
}

/* click-to-enlarge overlay shared by every inline image */
.gw-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-overlay);
  cursor: zoom-out;
}

.gw-lightbox img {
  max-width: 92vw;
  max-height: 92vh;
  border-radius: 8px;
  cursor: default;
  user-select: none;
  touch-action: none;
  transform-origin: center;
}

.gw-lightbox img.gw-lightbox-pan {
  cursor: grab;
}

.gw-lightbox img.gw-lightbox-pan:active {
  cursor: grabbing;
}

/* delegation summaries render as markdown in body font (the protocol envelope is stripped) */
.gw-step-md {
  font-size: 12px;
  line-height: 1.55;
  color: var(--text);
  max-height: 300px;
  overflow: auto;
}

.gw-step-md p,
.gw-step-md ul,
.gw-step-md ol {
  margin: 0 0 6px;
}

.gw-step-md :last-child {
  margin-bottom: 0;
}

.gw-step-clip {
  cursor: pointer;
}

.gw-step-clip:hover {
  background: var(--hover);
  border-radius: 6px;
}

.gw-clip-less {
  align-self: flex-start;
  padding: 2px 8px;
  border: none;
  border-radius: 6px;
  background: none;
  font: inherit;
  font-size: 11px;
  color: var(--text-tertiary);
  cursor: pointer;
}

.gw-clip-less:hover {
  background: var(--hover);
  color: var(--text);
}

/* folded model-thinking row: muted header, expandable muted body */
.gw-think {
  align-self: stretch;
  display: flex;
  flex-direction: column;
}

.gw-think-head {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 3px 2px;
  border: none;
  background: none;
  font: inherit;
  font-size: 13px;
  color: var(--text-tertiary);
  text-align: left;
  cursor: pointer;
  border-radius: 6px;
}

.gw-think-head:hover {
  background: var(--hover);
}

.gw-think-head:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--accent-soft, var(--hover));
}

.gw-think-open > .gw-think-head .gw-steps-caret {
  transform: rotate(90deg);
}

.gw-think-body {
  margin: 2px 0 6px 2px;
  padding-left: 10px;
  border-left: 2px solid var(--border-subtle);
  font-size: 12px;
  color: var(--text-tertiary);
}

.gw-think-body :last-child {
  margin-bottom: 0;
}

.gw-step-block pre {
  margin: 0;
  max-height: 300px;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
}

.gw-steps {
  align-self: stretch;
  display: flex;
  flex-direction: column;
}

.gw-steps-head {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 3px 2px;
  border: none;
  background: none;
  font: inherit;
  font-size: 13px;
  color: var(--text-tertiary);
  text-align: left;
  cursor: pointer;
  border-radius: 6px;
}

.gw-steps-head:hover {
  background: var(--hover);
}

.gw-steps-dot {
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: gw-step-pulse 1.4s ease-in-out infinite;
}

.gw-steps-running .gw-steps-head {
  color: var(--text-secondary);
}

/* ── inline Plan card: the brain's todowrite step plan as a live checklist ── */

.gw-plan {
  align-self: flex-start;
  min-width: min(70%, 420px);
  max-width: min(92%, 560px);
  padding: 10px 14px 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  font-size: 13px;
}

.gw-plan-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}

.gw-plan-label {
  font-weight: 600;
  color: var(--text-primary, var(--text));
}

.gw-plan-progress {
  font-size: 11px;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}

.gw-plan-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gw-plan-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  line-height: 1.45;
}

.gw-plan-icon {
  flex: none;
  width: 14px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 11px;
}

.gw-plan-in_progress .gw-plan-icon {
  color: var(--accent);
  animation: gw-step-pulse 1.4s ease-in-out infinite;
}

.gw-plan-completed .gw-plan-text {
  color: var(--text-tertiary);
}

.gw-plan-cancelled .gw-plan-text {
  color: var(--text-tertiary);
  text-decoration: line-through;
}

/* every step done: the whole card steps back */
.gw-plan-muted {
  opacity: 0.72;
}

@media (prefers-reduced-motion: reduce) {
  .gw-plan-in_progress .gw-plan-icon {
    animation: none;
  }
}

/* ── turn + activity pills: prose is a paragraph, work is a bordered pill
   with a glyph (Claude.ai tool-use block) ── */

.gw-turn {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* activity block (Claude.ai tool-use block): the counted summary is a plain
   text line flush with the prose, chevron inline; open, a bordered card below
   lists the rows hairline-separated */
.gw-act {
  --gw-act-chevron: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6.5 4 4 4-4'/%3E%3C/svg%3E");
  --gw-act-cross: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 4l8 8M12 4l-8 8'/%3E%3C/svg%3E");
  align-self: stretch;
  min-width: 0;
}

.gw-act > .gw-steps > .gw-steps-headrow > .gw-steps-head,
.gw-act > .gw-ws > .gw-ws-headrow > .gw-ws-head,
.gw-act > .gw-step > .gw-step-head {
  flex: 0 1 auto;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-width: 0;
  margin-left: -6px;
  padding: 4px 6px;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 18px;
}

.gw-act > .gw-steps > .gw-steps-headrow > .gw-steps-head:hover,
.gw-act > .gw-ws > .gw-ws-headrow > .gw-ws-head:hover,
.gw-act > .gw-step > .gw-step-head[aria-expanded]:hover {
  background: var(--hover);
}

/* grey at rest; hover, focus and open read in body ink (Claude.ai) */
.gw-act > .gw-steps > .gw-steps-headrow > .gw-steps-head:hover,
.gw-act > .gw-steps > .gw-steps-headrow > .gw-steps-head:focus-visible,
.gw-act > .gw-steps-open > .gw-steps-headrow > .gw-steps-head,
.gw-act > .gw-ws > .gw-ws-headrow > .gw-ws-head:hover,
.gw-act > .gw-ws > .gw-ws-headrow > .gw-ws-head:focus-visible,
.gw-act > .gw-ws-open > .gw-ws-headrow > .gw-ws-head,
.gw-act > .gw-step > .gw-step-head[aria-expanded]:hover,
.gw-act > .gw-step > .gw-step-head:focus-visible,
.gw-act > .gw-step-open > .gw-step-head {
  color: var(--text);
}

.gw-act .gw-step-title {
  flex: 0 1 auto;
  max-width: none;
}

/* a settled bar has no leading glyph; running pulses, failure crosses */
.gw-act .gw-steps-dot,
.gw-act > .gw-step > .gw-step-head > .gw-step-icon {
  display: none;
}

.gw-act-running > .gw-step > .gw-step-head > .gw-step-icon,
.gw-act-error > .gw-step > .gw-step-head > .gw-step-icon {
  display: inline-flex;
}

.gw-act-running > .gw-steps > .gw-steps-headrow > .gw-steps-head::before,
.gw-act-running > .gw-ws > .gw-ws-headrow > .gw-ws-head::before {
  content: '';
  flex: none;
  width: 6px;
  height: 6px;
  margin-right: 2px;
  border-radius: 50%;
  background: var(--accent);
  animation: gw-step-pulse 1.4s ease-in-out infinite;
}

.gw-act-error > .gw-steps > .gw-steps-headrow > .gw-steps-head::before,
.gw-act-error > .gw-ws > .gw-ws-headrow > .gw-ws-head::before {
  content: '';
  flex: none;
  width: 12px;
  height: 12px;
  background: var(--danger, #c0392b);
  -webkit-mask: var(--gw-act-cross) center / contain no-repeat;
  mask: var(--gw-act-cross) center / contain no-repeat;
}

.gw-act-error > .gw-steps > .gw-steps-headrow .gw-steps-title,
.gw-act-error > .gw-ws > .gw-ws-headrow .gw-ws-done,
.gw-act-error > .gw-step > .gw-step-head > .gw-step-title {
  color: var(--danger, #c0392b);
}

/* chevron rides right after the text, always visible: right closed, down open */
.gw-act > .gw-steps > .gw-steps-headrow > .gw-steps-head > .gw-steps-caret,
.gw-act > .gw-ws > .gw-ws-headrow > .gw-ws-head > .gw-steps-caret,
.gw-act .gw-step > .gw-step-head > .gw-step-caret {
  flex: none;
  width: 12px;
  height: 12px;
  opacity: 1;
  font-size: 0;
  background: var(--text-tertiary);
  -webkit-mask: var(--gw-act-chevron) center / contain no-repeat;
  mask: var(--gw-act-chevron) center / contain no-repeat;
  transform: rotate(-90deg);
}

.gw-act > .gw-steps-open > .gw-steps-headrow > .gw-steps-head > .gw-steps-caret,
.gw-act > .gw-ws-open > .gw-ws-headrow > .gw-ws-head > .gw-steps-caret,
.gw-act .gw-step-open > .gw-step-head > .gw-step-caret {
  transform: none;
}

/* expanded: the row list is a bordered card under the line */
.gw-act .gw-fold-inner > .gw-steps-list,
.gw-act .gw-fold-inner > .gw-ws-list {
  margin: 6px 0 0;
  padding: 0;
  border: 1px solid var(--border);
  border-left: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  overflow: hidden;
}

.gw-act .gw-steps-list > * + *,
.gw-act .gw-ws-list > * + * {
  border-top: 1px solid var(--border-subtle);
}

.gw-act .gw-steps-list > .gw-step > .gw-step-head,
.gw-act .gw-ws-list > .gw-step > .gw-step-head {
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 0;
  font-size: 13px;
  line-height: 18px;
}

.gw-act .gw-ws-list > :not(.gw-step) {
  padding: 8px 14px;
}

/* rows carry no bullet; only the running pulse stays */
.gw-act .gw-steps-list .gw-step-icon,
.gw-act .gw-ws-list .gw-step-icon {
  display: none;
}

.gw-act .gw-steps-list .gw-step-running > .gw-step-head > .gw-step-icon,
.gw-act .gw-ws-list .gw-step-running > .gw-step-head > .gw-step-icon {
  display: inline-flex;
}

/* the file / query chip reads as the row's object: body type, full ink */
.gw-act .gw-step-chip {
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
}

.gw-act .gw-step-duration {
  display: none;
}

.gw-act .gw-step-running .gw-step-duration {
  display: inline;
}

.gw-act .gw-steps-list .gw-step-open > .gw-step-head,
.gw-act .gw-ws-list .gw-step-open > .gw-step-head {
  border-radius: 0;
}

.gw-act .gw-steps-list .gw-step-detail,
.gw-act .gw-ws-list .gw-step-detail {
  margin: 0;
  padding: 4px 14px 12px;
  border-radius: 0;
}

/* a lone row opens the same way: its detail becomes a card under the line */
.gw-act > .gw-step-open > .gw-step-head,
.gw-act > .gw-step-open > .gw-step-head[aria-expanded]:hover {
  border-radius: 6px;
  background: none;
}

.gw-act > .gw-step-open > .gw-step-head[aria-expanded]:hover {
  background: var(--hover);
}

.gw-act > .gw-step-open > .gw-step-detail {
  margin: 6px 0 0;
  padding: 10px 14px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

/* ── bash command highlighting in the step detail (hljs, bash-only) ── */

.gw-step-detail .gw-hl .hljs-comment,
.gw-perm-code .gw-hl .hljs-comment,
.gw-step-detail .gw-hl .hljs-quote,
.gw-perm-code .gw-hl .hljs-quote {
  color: var(--text-tertiary);
  font-style: italic;
}

.gw-step-detail .gw-hl .hljs-keyword,
.gw-perm-code .gw-hl .hljs-keyword,
.gw-step-detail .gw-hl .hljs-built_in,
.gw-perm-code .gw-hl .hljs-built_in,
.gw-step-detail .gw-hl .hljs-name,
.gw-perm-code .gw-hl .hljs-name {
  color: var(--accent, #7c4dff);
}

.gw-step-detail .gw-hl .hljs-string,
.gw-perm-code .gw-hl .hljs-string,
.gw-step-detail .gw-hl .hljs-number,
.gw-perm-code .gw-hl .hljs-number {
  color: var(--success, #2e7d32);
}

.gw-step-detail .gw-hl .hljs-variable,
.gw-perm-code .gw-hl .hljs-variable,
.gw-step-detail .gw-hl .hljs-subst,
.gw-perm-code .gw-hl .hljs-subst,
.gw-step-detail .gw-hl .hljs-params,
.gw-perm-code .gw-hl .hljs-params {
  color: var(--warning, #b26b00);
}

/* long summaries / activity headlines stay one scannable line; the full
   text rides the title attribute */
.gw-steps-title,
.gw-ws-working,
.gw-ws-done {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* inline delegated-task block: skill badge + stalled-state attention, all on
   the fold header — the conversation is the only task surface (no panel) */
.gw-steps-headrow,
.gw-ws-headrow {
  display: flex;
  align-items: center;
  gap: 6px;
}

.gw-steps-headrow .gw-steps-head,
.gw-ws-headrow .gw-ws-head {
  flex: 1 1 auto;
  min-width: 0;
}

.gw-steps-caret {
  font-size: 10px;
  opacity: 0;
  transition: transform 0.15s ease;
}

.gw-steps-head:hover .gw-steps-caret,
.gw-steps-head:focus-visible .gw-steps-caret,
.gw-ws-head:hover .gw-steps-caret,
.gw-ws-head:focus-visible .gw-steps-caret,
.gw-think-head:hover .gw-steps-caret,
.gw-think-head:focus-visible .gw-steps-caret {
  opacity: 1;
}

.gw-steps-open .gw-steps-caret {
  transform: rotate(90deg);
}

.gw-steps-list {
  display: flex;
  flex-direction: column;
  margin-left: 13px;
  padding-left: 8px;
  border-left: 1px solid var(--border-subtle);
}

.gw-ws {
  align-self: stretch;
  display: flex;
  flex-direction: column;
}

.gw-ws-head {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 3px 2px;
  border: none;
  background: none;
  font: inherit;
  font-size: 12px;
  color: var(--text-tertiary);
  text-align: left;
  cursor: pointer;
  border-radius: 6px;
}

.gw-ws-head:hover {
  background: var(--hover);
}

.gw-ws-open > .gw-ws-head .gw-steps-caret {
  transform: rotate(90deg);
}

.gw-ws-working {
  background: linear-gradient(
    90deg,
    var(--text-tertiary) 0%,
    var(--text) 50%,
    var(--text-tertiary) 100%
  );
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gw-ws-shimmer 2s linear infinite;
}

.gw-ws-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-left: 13px;
  padding-left: 8px;
  border-left: 1px solid var(--border-subtle);
}

@keyframes gw-ws-shimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

@keyframes gw-step-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gw-step-running .gw-step-icon::before,
  .gw-steps-dot {
    animation: none;
    opacity: 0.65;
  }

  .gw-ws-working {
    animation: none;
    background: none;
    color: var(--text-secondary);
  }
}

/* shared conversation-viewport empty state (GenworkEmptyState) */
.gwx-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  text-align: center;
}
.gwx-empty-hint {
  margin: 0;
  max-width: 420px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-secondary, var(--text));
  opacity: 0.75;
}

/* muted in-stream notice after the user stops a run */
/* message wrapper: keeps the bubble's own alignment and hangs the hover
   action row (copy + clock) below it without shifting on hover */
.gw-msg-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-self: stretch;
  min-width: 0;
}

.gw-msg-wrap-user {
  align-items: flex-end;
}

/* query container for .ai-md-row; must sit on a stretched box, not the
   shrink-to-fit bubble, or inline-size containment collapses it to 0 */
.gw-msg-wrap-assistant {
  container-type: inline-size;
}

/* floats under the user bubble: reserving its height pushed the next block
   ~20px away and made a tool group read as attached to the message after it */
.gw-msg-actions {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 1px;
  padding-right: 6px;
  border-radius: 6px;
  line-height: 1;
  background: var(--bg-content, var(--surface));
  visibility: hidden;
}

/* fits the 8px stream gap without covering the next row's text */
.gw-msg-actions .gw-copy,
.gw-msg-actions .gw-msg-ts {
  font-size: 10px;
  line-height: 1;
  padding-top: 0;
  padding-bottom: 0;
}

.gw-msg-wrap-user .gw-msg-actions {
  left: auto;
  right: 0;
}

/* nothing follows turn-final prose inside its turn, so it can sit in flow */
.gw-msg-wrap-assistant .gw-msg-actions {
  position: static;
  margin-top: 4px;
}

/* hover-only reveals are gated on (hover: hover): iOS treats a tap whose
   hover changes page content as a hover, not a click, so every button inside
   the message (next-step actions, links) would need two taps */
.gw-msg-actions:focus-within {
  visibility: visible;
}

@media (hover: hover) {
  .gw-msg-wrap:hover .gw-msg-actions {
    visibility: visible;
  }
}

@media (hover: none) {
  .gw-msg-actions {
    visibility: visible;
  }
}

.gw-copy {
  border: none;
  background: none;
  padding: 1px 6px;
  border-radius: 6px;
  font: inherit;
  font-size: 11px;
  color: var(--text-tertiary);
  cursor: pointer;
}

.gw-copy:hover {
  background: var(--hover);
  color: var(--text);
}

.gw-copy-done {
  color: var(--success, var(--text));
}

.gw-msg-ts {
  font-size: 11px;
  color: var(--text-tertiary);
}

/* output block header row: label + hover copy */
.gw-step-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

@media (hover: hover) {
  .gw-step-block-head .gw-copy {
    visibility: hidden;
  }

  .gw-step-block:hover .gw-step-block-head .gw-copy {
    visibility: visible;
  }
}

/* failed-run notice: localized header, raw error body, tail-only retry */
.gw-run-failed {
  align-self: stretch;
  padding: 8px 10px;
  border: 1px solid var(--danger-border, var(--border));
  border-radius: 8px;
  background: var(--danger-bg, var(--surface-subtle));
}

.gw-run-failed-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.gw-run-failed-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--danger, var(--text));
}

.gw-run-failed-retry {
  flex: none;
  padding: 3px 10px;
  border: 1px solid var(--danger-border, var(--border));
  border-radius: 6px;
  background: var(--surface);
  font: inherit;
  font-size: 12px;
  color: var(--danger, var(--text));
  cursor: pointer;
}

.gw-run-failed-retry:hover {
  background: var(--hover);
}

.gw-run-failed-body {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 120px;
  overflow-y: auto;
}

/* edit-tool line diff (deletions before additions per hunk) */
.gw-diff {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 11px;
  line-height: 1.5;
  border-radius: 6px;
  overflow-x: auto;
}

.gw-diff-line {
  display: flex;
  white-space: pre-wrap;
  word-break: break-word;
  padding: 0 6px;
}

.gw-diff-sign {
  flex: none;
  width: 14px;
  user-select: none;
}

.gw-diff-del {
  background: var(--danger-bg, transparent);
  color: var(--danger, var(--text-muted));
}

.gw-diff-add {
  background: var(--success-bg, transparent);
  color: var(--success, var(--text));
}

.gw-diff-ctx {
  color: var(--text-tertiary);
}

.gw-cancelled-notice {
  align-self: stretch;
  padding: 4px 2px;
  font-size: 12px;
  color: var(--text-tertiary);
}

/* ── expert questionnaire card (ask_clarification via the document runner) ── */

.gw-clarify {
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: min(92%, 480px);
  max-height: min(560px, 62vh);
  padding: 12px 16px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  animation: gw-clarify-rise 220ms cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes gw-clarify-rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* header band bleeding to the card edges */
.gw-clarify-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -12px -16px 14px;
  padding: 10px 16px;
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--border);
  border-radius: 12px 12px 0 0;
}

.gw-clarify-done .gw-clarify-head {
  margin-bottom: 10px;
}

.gw-clarify-head-label {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.35;
  word-break: break-word;
}

.gw-clarify-head-progress {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  text-align: center;
}

.gw-clarify-head-arrows {
  display: inline-flex;
  gap: 4px;
}

.gw-clarify-head-arrow {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-tertiary);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.gw-clarify-head-arrow:hover:not(:disabled) {
  background: var(--hover);
  color: var(--text);
}

.gw-clarify-head-arrow:disabled {
  opacity: 0.3;
  cursor: default;
}

/* one question at a time; directional slide */
.gw-clarify-q {
  flex: 1 1 auto;
  overflow-y: auto;
  margin-bottom: 12px;
}

.gw-clarify-q.slide-next {
  animation: gw-clarify-slide-next 240ms cubic-bezier(0.16, 1, 0.3, 1);
}

.gw-clarify-q.slide-prev {
  animation: gw-clarify-slide-prev 240ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes gw-clarify-slide-next {
  from {
    opacity: 0;
    transform: translateX(16px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes gw-clarify-slide-prev {
  from {
    opacity: 0;
    transform: translateX(-16px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.gw-clarify-label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 8px;
  line-height: 1.4;
}

.gw-clarify-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0 0 8px;
  line-height: 1.5;
}

.gw-clarify-opts {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}

.gw-clarify-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}

.gw-clarify-opt:hover {
  background: var(--hover);
}

.gw-clarify-opt-label {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text);
}

/* 16px checkbox glyph (multi only); single-select reads from the row fill */
.gw-clarify-opt-box {
  flex-shrink: 0;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-strong);
  border-radius: 4px;
  background: var(--surface);
  color: var(--color-btn-primary-text);
}

.gw-clarify-opt:not(.multi) .gw-clarify-opt-box {
  display: none;
}

.gw-clarify-opt-arrow {
  margin-left: auto;
  align-self: center;
  color: var(--text-secondary);
  opacity: 0;
}

.gw-clarify-opt:hover .gw-clarify-opt-arrow {
  opacity: 1;
}

.gw-clarify-opt-on {
  background: var(--hover);
  border-color: var(--border-strong);
}

.gw-clarify-opt-on.multi .gw-clarify-opt-box {
  border-color: var(--color-btn-primary);
  background: var(--color-btn-primary);
}

/* free-text answer input */
.gw-clarify-other {
  width: 100%;
  min-height: 34px;
  padding: 6px 12px;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-sizing: border-box;
}

.gw-clarify-other::placeholder {
  color: var(--text-tertiary);
}

.gw-clarify-other:focus {
  outline: none;
  border-color: var(--accent);
}

/* footer actions */
.gw-clarify-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.gw-clarify-actions.multi {
  justify-content: space-between;
  flex-wrap: nowrap;
}

.gw-clarify-count {
  font-size: 12px;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}

.gw-clarify-actions-btns {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.gw-clarify-next {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: var(--color-btn-primary);
  color: var(--color-btn-primary-text);
  border: none;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
}

.gw-clarify-next:hover {
  opacity: 0.85;
}

.gw-clarify-skip {
  height: 28px;
  padding: 0 14px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}

.gw-clarify-skip:hover:not(:disabled) {
  border-color: var(--border-strong);
  color: var(--text);
}

.gw-clarify-submit {
  height: 28px;
  padding: 0 14px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--color-btn-primary-text);
  background: var(--color-btn-primary);
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
}

.gw-clarify-submit:hover:not(:disabled) {
  opacity: 0.85;
}

.gw-clarify-skip:disabled,
.gw-clarify-submit:disabled {
  opacity: 0.45;
  cursor: default;
}

/* answered / skipped record */
.gw-clarify-result {
  font-size: 12px;
  color: var(--text-secondary);
}

.gw-clarify-answers {
  white-space: pre-wrap;
  line-height: 1.6;
}

/* answered questionnaire: question over its muted answer (GenOffice record card) */
.gw-clarify-qa {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gw-clarify-qa-q {
  margin-bottom: 2px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text);
}

.gw-clarify-qa-a {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-secondary);
}

/* blinking caret pinned after the streaming tail message's last block */
.gw-streaming .ai-md > :last-child::after {
  content: '';
  display: inline-block;
  width: 7px;
  height: 1em;
  margin-left: 3px;
  vertical-align: -0.15em;
  background: var(--text);
  border-radius: 1px;
  animation: gw-caret-blink 1s step-end infinite;
}

@keyframes gw-caret-blink {
  50% {
    opacity: 0;
  }
}

/* ── stacked stage-progress card (GenOffice DeckProgressCard analog) ── */

.gw-stageprog {
  margin: 6px 0 4px 24px;
  padding: 10px 14px;
  max-width: min(92%, 440px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.gw-stageprog-steps {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.gw-stageprog-step,
.gw-stageprog-page {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--text-secondary);
}

.gw-stageprog-icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  font-size: 11px;
  color: var(--text-tertiary);
}

.gw-stageprog-done > .gw-stageprog-icon,
.gw-stageprog-page-done > .gw-stageprog-icon {
  color: var(--text-secondary);
}

.gw-stageprog-error > .gw-stageprog-icon,
.gw-stageprog-page-error > .gw-stageprog-icon,
.gw-stageprog-page-err {
  color: var(--danger);
}

.gw-stageprog-running > .gw-stageprog-icon::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent, var(--text-tertiary));
  animation: gw-stageprog-pulse 1.2s ease-in-out infinite;
}

@keyframes gw-stageprog-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.35;
    transform: scale(0.72);
  }
}

.gw-stageprog-running > .gw-stageprog-label {
  color: var(--text);
}

.gw-stageprog-pages {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 180px;
  overflow-y: auto;
}

.gw-stageprog-page {
  font-size: 12px;
}

.gw-stageprog-page-running {
  color: var(--text);
}

.gw-stageprog-page-err {
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* narration folded into a session card reads as a grey row, not prose */
.gw-act .gw-ws-list > :not(.gw-step) {
  padding: 9px 14px;
}

.gw-act .gw-ws-list .gw-msg,
.gw-act .gw-ws-list .ai-md {
  font-size: 13px;
  line-height: 18px;
  color: var(--text-secondary);
}

.gw-act .gw-ws-list .ai-md > * {
  margin: 0;
}

.gw-act .gw-ws-list .ai-md > * + * {
  margin-top: 4px;
}

/* fold body: grid-row tween so a closing card shrinks instead of vanishing */
.gw-fold {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.22s ease;
}

.gw-fold-open {
  grid-template-rows: 1fr;
}

.gw-fold-inner {
  min-height: 0;
  overflow: hidden;
}

/* input-type questionnaire fields (text / number / date) */
.gw-clarify-field {
  display: flex;
  align-items: center;
  gap: 8px;
}
.gw-clarify-field .gw-clarify-other {
  flex: 1 1 auto;
}
.gw-clarify-unit {
  flex: 0 0 auto;
  font-size: 12.5px;
  color: var(--text-secondary);
}
/* Block-level markdown in AI chat bubbles (tables, fenced code); inline chips stay per-app */
.ai-md-table-wrap {
  overflow-x: auto;
  margin: 0 0 16px;
}
.ai-md-table {
  border-collapse: collapse;
  font-size: 0.95em;
  line-height: 1.45;
}
.ai-md-table th,
.ai-md-table td {
  border: 1px solid var(--border);
  padding: 4px 10px;
  text-align: left;
  vertical-align: top;
}
.ai-md-table th {
  background: var(--surface-subtle);
  font-weight: 600;
  white-space: nowrap;
}
/* row-label column: keep short labels on one line instead of one glyph per row */
.ai-md-table td:first-child {
  min-width: 5em;
}
.ai-md small {
  color: var(--text-secondary);
}
.ai-md mark {
  padding: 0 2px;
  border-radius: 2px;
  background: var(--search-hit-bg);
  color: inherit;
}
.ai-md kbd {
  padding: 0 4px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: var(--surface-subtle);
  font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.85em;
}
.ai-md-pre {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: 6px;
  background: var(--color-bg-subtle);
  overflow-x: auto;
  line-height: 1.5;
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
}
.ai-md .ai-md-pre code {
  padding: 0;
  border-radius: 0;
  background: none;
  color: inherit;
  font-size: inherit;
  white-space: pre;
}

.ai-md-code {
  margin: 0 0 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--color-bg-subtle);
}
.ai-md-code .ai-md-pre {
  margin: 0;
  border-radius: 0;
  background: none;
}
.ai-md-code-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 10px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 11.5px;
  color: var(--text-tertiary);
  font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
}
.ai-md-code-copy {
  border: 0;
  background: none;
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-secondary);
  font: inherit;
  cursor: pointer;
}
.ai-md-code-copy:hover {
  background: var(--hover);
  color: var(--text);
}

.ai-md .hljs-comment,
.ai-md .hljs-quote {
  color: var(--text-tertiary);
  font-style: italic;
}
.ai-md .hljs-keyword,
.ai-md .hljs-built_in,
.ai-md .hljs-name,
.ai-md .hljs-tag,
.ai-md .hljs-selector-tag,
.ai-md .hljs-doctag {
  color: var(--accent, var(--color-brand-secondary));
}
.ai-md .hljs-string,
.ai-md .hljs-number,
.ai-md .hljs-literal,
.ai-md .hljs-regexp,
.ai-md .hljs-addition {
  color: var(--success);
}
.ai-md .hljs-variable,
.ai-md .hljs-subst,
.ai-md .hljs-params,
.ai-md .hljs-attr,
.ai-md .hljs-attribute,
.ai-md .hljs-title,
.ai-md .hljs-section,
.ai-md .hljs-type,
.ai-md .hljs-deletion {
  color: var(--warning);
}

.ai-md ul.ai-md-tasks {
  list-style: none;
  padding-left: 4px;
}
.ai-md-task {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.ai-md-task input {
  margin: 0;
  pointer-events: none;
  accent-color: var(--accent, var(--color-brand-secondary));
  transform: translateY(1px);
}
.ai-md li > p,
.ai-md li > ul,
.ai-md li > ol {
  margin: 2px 0 0;
}

.ai-md-task-done > span {
  color: var(--text-tertiary);
  text-decoration: line-through;
}

.ai-md-quote {
  margin: 0 0 12px;
  padding: 2px 0 2px 12px;
  border-left: 3px solid var(--border-strong);
  color: var(--text-secondary);
}
.ai-md-quote.ai-md-tone-info,
.ai-md-quote.ai-md-tone-success,
.ai-md-quote.ai-md-tone-warning,
.ai-md-quote.ai-md-tone-danger {
  padding: 8px 12px;
  border-radius: 0 6px 6px 0;
  border-left-color: var(--md-tone);
  background: var(--md-tone-bg);
  color: var(--text);
}
.ai-md-tone-info {
  --md-tone: var(--color-brand-secondary);
  --md-tone-bg: var(--surface-subtle);
}
.ai-md-tone-success {
  --md-tone: var(--success);
  --md-tone-bg: var(--success-bg);
}
.ai-md-tone-warning {
  --md-tone: var(--warning);
  --md-tone-bg: var(--surface-subtle);
}
.ai-md-tone-danger {
  --md-tone: var(--danger);
  --md-tone-bg: var(--danger-bg);
}

.ai-md-row {
  display: grid;
  grid-template-columns: repeat(var(--md-cols, 2), minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 12px;
}
.ai-md-col {
  min-width: 0;
}
.ai-md-col > :last-child {
  margin-bottom: 0;
}
@container (max-width: 520px) {
  .ai-md-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

.ai-md-details {
  margin: 0 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}
.ai-md-details > summary {
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  list-style-position: inside;
}
.ai-md-details > summary:hover {
  background: var(--hover);
}
.ai-md-details-body {
  padding: 4px 12px 0;
  border-top: 1px solid var(--border-subtle);
}

.ai-md-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  margin: 0 0 12px;
}
.ai-md-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  min-width: 0;
}
.ai-md-stat.ai-md-tone-success,
.ai-md-stat.ai-md-tone-warning,
.ai-md-stat.ai-md-tone-danger {
  border-color: var(--md-tone);
}
.ai-md-stat.ai-md-tone-success .ai-md-stat-value,
.ai-md-stat.ai-md-tone-warning .ai-md-stat-value,
.ai-md-stat.ai-md-tone-danger .ai-md-stat-value {
  color: var(--md-tone);
}
.ai-md-stat-label {
  font-size: 12px;
  color: var(--text-secondary);
}
.ai-md-stat-value {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.ai-md-stat-hint {
  font-size: 12px;
  color: var(--text-tertiary);
}
.ai-md-stats-skeleton .ai-md-stat i,
.ai-md-stats-skeleton .ai-md-stat b {
  display: block;
  height: 10px;
  border-radius: 3px;
  background: var(--border);
  animation: ai-md-chart-pulse 1.2s ease-in-out infinite;
}
.ai-md-stats-skeleton .ai-md-stat i {
  width: 50%;
}
.ai-md-stats-skeleton .ai-md-stat b {
  height: 20px;
  width: 70%;
  margin-top: 6px;
}
.ai-md-hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 14px 0;
}
.ai-md-h3 {
  font-size: 1.1em;
}
.ai-md-h2 {
  font-size: 1.25em;
}
.ai-md-h1 {
  font-size: 1.35em;
}

.ai-md-math {
  overflow-x: auto;
  margin: 0 0 12px;
  padding: 4px 0;
}
.ai-md-math-inline .katex {
  font-size: 1.05em;
}

.ai-md-chart {
  --chart-1: #3b82f6;
  --chart-2: #f59e0b;
  --chart-3: #10b981;
  --chart-4: #ef4444;
  --chart-5: #8b5cf6;
  --chart-6: #14b8a6;
  --chart-7: #ec4899;
  --chart-8: #64748b;
  margin: 0 0 16px;
  padding: 12px 12px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  max-width: 100%;
}
[data-theme='dark'] .ai-md-chart {
  --chart-1: #60a5fa;
  --chart-2: #fbbf24;
  --chart-3: #34d399;
  --chart-4: #f87171;
  --chart-5: #a78bfa;
  --chart-6: #2dd4bf;
  --chart-7: #f472b6;
  --chart-8: #94a3b8;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .ai-md-chart {
    --chart-1: #60a5fa;
    --chart-2: #fbbf24;
    --chart-3: #34d399;
    --chart-4: #f87171;
    --chart-5: #a78bfa;
    --chart-6: #2dd4bf;
    --chart-7: #f472b6;
    --chart-8: #94a3b8;
  }
}
.ai-md-chart-title {
  font-weight: 600;
  font-size: 13px;
  margin: 0 0 6px 2px;
  color: var(--text);
}
.ai-md-chart-svg {
  display: block;
  width: 100%;
  height: auto;
  font-size: 11px;
}
.ai-md-chart-grid {
  stroke: var(--border-subtle);
}
.ai-md-chart-axis {
  stroke: var(--border-strong);
}
.ai-md-chart-tick,
.ai-md-chart-val {
  fill: var(--text-tertiary);
  font-size: 11px;
}
.ai-md-chart-val {
  font-size: 10.5px;
}
.ai-md-chart-slice {
  stroke: var(--surface);
  stroke-width: 1.5;
}
.ai-md-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 6px 2px 0;
  font-size: 12px;
  color: var(--text-secondary);
}
.ai-md-chart-key i,
.ai-md-chart-pie-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: -1px;
}
.ai-md-chart-pie {
  display: flex;
  align-items: center;
  gap: 16px;
}
.ai-md-chart-pie-svg {
  width: 180px;
  flex: 0 0 auto;
}
.ai-md-chart-pie-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 12.5px;
  color: var(--text-secondary);
}
.ai-md-chart-pie-legend li {
  display: flex;
  align-items: center;
  padding: 2px 0;
}
.ai-md-chart-pie-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ai-md-chart-pie-pct {
  flex: 0 0 auto;
  margin-left: 8px;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}
.ai-md-chart-skeleton {
  height: 140px;
}
.ai-md-chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 100%;
  padding: 0 8px;
}
.ai-md-chart-bars i {
  flex: 1 1 0;
  background: var(--border);
  border-radius: 3px 3px 0 0;
}
.ai-md-chart-pending .ai-md-chart-bars i {
  animation: ai-md-chart-pulse 1.2s ease-in-out infinite;
}
@keyframes ai-md-chart-pulse {
  50% {
    opacity: 0.45;
  }
}

.ai-md-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 12px;
}
.ai-md-action {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.ai-md-action:hover:not(:disabled) {
  border-color: var(--accent, var(--color-brand-secondary));
  color: var(--accent, var(--color-brand-secondary));
  background: var(--hover);
}
.ai-md-action:disabled {
  color: var(--text-tertiary);
  cursor: default;
}

.ai-md-map {
  margin: 0 0 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}
.ai-md-map-frame {
  display: block;
  width: 100%;
  height: 420px;
  border: 0;
  background: var(--surface);
}
.ai-md-map-pending {
  background: var(--hover);
}
.ai-md-map-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
}
.ai-md-map-caption {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ai-md-map-toggle {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
}
.ai-md-map-toggle:hover {
  background: var(--hover);
  color: var(--text);
}
.ai-md-map-full {
  position: fixed;
  inset: 16px;
  z-index: 1000;
  margin: 0;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-modal-strong);
}
.ai-md-map-full .ai-md-map-frame {
  flex: 1;
  height: auto;
}
@font-face{font-display:block;font-family:KaTeX_AMS;font-style:normal;font-weight:400;src:url(./KaTeX_AMS-Regular-BQhdFMY1.woff2) format("woff2"),url(./KaTeX_AMS-Regular-DMm9YOAa.woff) format("woff"),url(./KaTeX_AMS-Regular-DRggAlZN.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:700;src:url(./KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2) format("woff2"),url(./KaTeX_Caligraphic-Bold-BEiXGLvX.woff) format("woff"),url(./KaTeX_Caligraphic-Bold-ATXxdsX0.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:400;src:url(./KaTeX_Caligraphic-Regular-Di6jR-x-.woff2) format("woff2"),url(./KaTeX_Caligraphic-Regular-CTRA-rTL.woff) format("woff"),url(./KaTeX_Caligraphic-Regular-wX97UBjC.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:700;src:url(./KaTeX_Fraktur-Bold-CL6g_b3V.woff2) format("woff2"),url(./KaTeX_Fraktur-Bold-BsDP51OF.woff) format("woff"),url(./KaTeX_Fraktur-Bold-BdnERNNW.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:400;src:url(./KaTeX_Fraktur-Regular-CTYiF6lA.woff2) format("woff2"),url(./KaTeX_Fraktur-Regular-Dxdc4cR9.woff) format("woff"),url(./KaTeX_Fraktur-Regular-CB_wures.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:700;src:url(./KaTeX_Main-Bold-Cx986IdX.woff2) format("woff2"),url(./KaTeX_Main-Bold-Jm3AIy58.woff) format("woff"),url(./KaTeX_Main-Bold-waoOVXN0.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:700;src:url(./KaTeX_Main-BoldItalic-DxDJ3AOS.woff2) format("woff2"),url(./KaTeX_Main-BoldItalic-SpSLRI95.woff) format("woff"),url(./KaTeX_Main-BoldItalic-DzxPMmG6.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:400;src:url(./KaTeX_Main-Italic-NWA7e6Wa.woff2) format("woff2"),url(./KaTeX_Main-Italic-BMLOBm91.woff) format("woff"),url(./KaTeX_Main-Italic-3WenGoN9.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:400;src:url(./KaTeX_Main-Regular-B22Nviop.woff2) format("woff2"),url(./KaTeX_Main-Regular-Dr94JaBh.woff) format("woff"),url(./KaTeX_Main-Regular-ypZvNtVU.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:700;src:url(./KaTeX_Math-BoldItalic-CZnvNsCZ.woff2) format("woff2"),url(./KaTeX_Math-BoldItalic-iY-2wyZ7.woff) format("woff"),url(./KaTeX_Math-BoldItalic-B3XSjfu4.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:400;src:url(./KaTeX_Math-Italic-t53AETM-.woff2) format("woff2"),url(./KaTeX_Math-Italic-DA0__PXp.woff) format("woff"),url(./KaTeX_Math-Italic-flOr_0UB.ttf) format("truetype")}@font-face{font-display:block;font-family:"KaTeX_SansSerif";font-style:normal;font-weight:700;src:url(./KaTeX_SansSerif-Bold-D1sUS0GD.woff2) format("woff2"),url(./KaTeX_SansSerif-Bold-DbIhKOiC.woff) format("woff"),url(./KaTeX_SansSerif-Bold-CFMepnvq.ttf) format("truetype")}@font-face{font-display:block;font-family:"KaTeX_SansSerif";font-style:italic;font-weight:400;src:url(./KaTeX_SansSerif-Italic-C3H0VqGB.woff2) format("woff2"),url(./KaTeX_SansSerif-Italic-DN2j7dab.woff) format("woff"),url(./KaTeX_SansSerif-Italic-YYjJ1zSn.ttf) format("truetype")}@font-face{font-display:block;font-family:"KaTeX_SansSerif";font-style:normal;font-weight:400;src:url(./KaTeX_SansSerif-Regular-DDBCnlJ7.woff2) format("woff2"),url(./KaTeX_SansSerif-Regular-CS6fqUqJ.woff) format("woff"),url(./KaTeX_SansSerif-Regular-BNo7hRIc.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Script;font-style:normal;font-weight:400;src:url(./KaTeX_Script-Regular-D3wIWfF6.woff2) format("woff2"),url(./KaTeX_Script-Regular-D5yQViql.woff) format("woff"),url(./KaTeX_Script-Regular-C5JkGWo-.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size1;font-style:normal;font-weight:400;src:url(./KaTeX_Size1-Regular-mCD8mA8B.woff2) format("woff2"),url(./KaTeX_Size1-Regular-C195tn64.woff) format("woff"),url(./KaTeX_Size1-Regular-Dbsnue_I.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size2;font-style:normal;font-weight:400;src:url(./KaTeX_Size2-Regular-Dy4dx90m.woff2) format("woff2"),url(./KaTeX_Size2-Regular-oD1tc_U0.woff) format("woff"),url(./KaTeX_Size2-Regular-B7gKUWhC.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size3;font-style:normal;font-weight:400;src:url(data:font/woff2;base64,d09GMgABAAAAAA4oAA4AAAAAHbQAAA3TAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAABmAAgRQIDgmcDBEICo1oijYBNgIkA14LMgAEIAWJAAeBHAyBHBvbGiMRdnO0IkRRkiYDgr9KsJ1NUAf2kILNxgUmgqIgq1P89vcbIcmsQbRps3vCcXdYOKSWEPEKgZgQkprQQsxIXUgq0DqpGKmIvrgkeVGtEQD9DzAO29fM9jYhxZEsL2FeURH2JN4MIcTdO049NCVdxQ/w9NrSYFEBKTDKpLKfNkCGDc1RwjZLQcm3vqJ2UW9Xfa3tgAHz6ivp6vgC2yD4/6352ndnN0X0TL7seypkjZlMsjmZnf0Mm5Q+JykRWQBKCVCVPbARPXWyQtb5VgLB6Biq7/Uixcj2WGqdI8tGSgkuRG+t910GKP2D7AQH0DB9FMDW/obJZ8giFI3Wg8Cvevz0M+5m0rTh7XDBlvo9Y4vm13EXmfttwI4mBo1EG15fxJhUiCLbiiyCf/ZA6MFAhg3pGIZGdGIVjtPn6UcMk9A/UUr9PhoNsCENw1APAq0gpH73e+M+0ueyHbabc3vkbcdtzcf/fiy+NxQEjf9ud/ELBHAXJ0nk4z+MXH2Ev/kWyV4k7SkvpPc9Qr38F6RPWnM9cN6DJ0AdD1BhtgABtmoRoFCvPsBAumNm6soZG2Gk5GyVTo2sJncSyp0jQTYoR6WDvTwaaEcHsxHfvuWhHA3a6bN7twRKtcGok6NsCi7jYRrM2jExsUFMxMQYuJbMhuWNOumEJy9hi29Dmg5zMp/A5+hhPG19j1vBrq8JTLr8ki5VLPmG/PynJHVul440bxg5xuymHUFPBshC+nA9I1FmwbRBTNHAcik3Oae0cxKoI3MOriM42UrPe51nsaGxJ+WfXubAsP84aabUlQSJ1IiE0iPETLUU4CATgfXSCSpuRFRmCGbO+wSpAnzaeaCYW1VNEysRtuXCEL1kUFUbbtMv3Tilt/1c11jt3Q5bbMa84cpWipp8Elw3MZhOHsOlwwVUQM3lAR35JiFQbaYCRnMF2lxAWoOg2gyoIV4PouX8HytNIfLhqpJtXB4vjiViUI8IJ7bkC4ikkQvKksnOTKICwnqWSZ9YS5f0WCxmpgjbIq7EJcM4aI2nmhLNY2JIUgOjXZFWBHb+x5oh6cwb0Tv1ackHdKi0I9OO2wE9aogIOn540CCCziyhN+IaejtgAONKznHlHyutPrHGwCx9S6B8kfS4Mfi4Eyv7OU730bT1SCBjt834cXsf43zVjPUqqJjgrjeGnBxSG4aYAKFuVbeCfkDIjAqMb6yLNIbCuvXhMH2/+k2vkNpkORhR59N1CkzoOENvneIosjYmuTxlhUzaGEJQ/iWqx4dmwpmKjrwTiTGTCVozNAYqk/zXOndWxuWSmJkQpJw3pK5KX6QrLt5LATMqpmPAQhkhK6PUjzHUn7E0gHE0kPE0iKkolgkUx9SZmVAdDgpffdyJKg3k7VmzYGCwVXGz/tXmkOIp+vcWs+EMuhhvN0h9uhfzWJziBQmCREGSIFmQIkgVpAnSBRmC//6hkLZwaVhwxlrJSOdqlFtOYxlau9F2QN5Y98xmIAsiM1HVp2VFX+DHHGg6Ecjh3vmqtidX3qHI2qycTk/iwxSt5UzTmEP92ZBnEWTk4Mx8Mpl78ZDokxg/KWb+Q0QkvdKVmq3TMW+RXEgrsziSAfNXFMhDc60N5N9jQzjfO0kBKpUZl0ZmwJ41j/B9Hz6wmRaJB84niNmQrzp9eSlQCDDzazGDdVi3P36VZQ+Jy4f9UBNp+3zTjqI4abaFAm+GShVaXlsGdF3FYzZcDI6cori4kMxUECl9IjJZpzkvitAoxKue+90pDMvcKRxLl53TmOKCmV/xRolNKSqqUxc6LStOETmFOiLZZptlZepcKiAzteG8PEdpnQpbOMNcMsR4RR2Bs0cKFEvSmIjAFcnarqwUL4lDhHmnVkwu1IwshbiCcgvOheZuYyOteufZZwlcTlLgnZ3o/WcYdzZHW/WGaqaVfmTZ1aWCceJjkbZqsfbkOtcFlUZM/jy+hXHDbaUobWqqXaeWobbLO99yG5N3U4wxco0rQGGcOLASFMXeJoham8M+/x6O2WywK2l4HGbq1CoUyC/IZikQhdq3SiuNrvAEj0AVu9x2x3lp/xWzahaxidezFVtdcb5uEnzyl0ZmYiuKI0exvCd4Xc9CV1KB0db00z92wDPde0kukbvZIWN6jUWFTmPIC/Y4UPCm8UfDTFZpZNon1qLFTkBhxzB+FjQRA2Q/YRJT8pQigslMaUpFyAG8TMlXigiqmAZX4xgijKjRlGpLE0GdplRfCaJo0JQaSxNBk6ZmMzcya0FmrcisDdn0Q3HI2sWSppYigmlM1XT/kLQZSNpMJG0WkjYbSZuDpM1F0uYhFc1HxU4m1QJjDK6iL0S5uSj5rgXc3RejEigtcRBtqYPQsiTskmO5vosV+q4VGIKbOkDg0jtRrq+Em1YloaTFar3EGr1EUC8R0kus1Uus00usL97ABr2BjXoDm/QGNhuWtMVBKOwg/i78lT7hBsAvDmwHc/ao3vmUbBmhjeYySZNWvGkfZAgISDSaDo1SVpzGDsAEkF8B+gEapViUoZgUWXcRIGFZNm6gWbAKk0bp0k1MHG9fLYtV4iS2SmLEQFARzRcnf9PUS0LVn05/J9MiRRBU3v2IrvW974v4N00L7ZMk0wXP1409CHo/an8zTRHD3eSJ6m8D4YMkZNl3M79sqeuAsr/m3f+8/yl7A50aiAEJgeBeMWzu7ui9UfUBCe2TIqZIoOd/3/udRBOQidQZUERzb2/VwZN1H/Sju82ew2H2Wfr6qvfVf3hqwDvAIpkQVFy4B9Pe9e4/XvPeceu7h3dvO56iJPf0+A6cqA2ip18ER+iFgggiuOkvj24bby0N9j2UHIkgqIt+sVgfodC4YghLSMjSZbH0VR/6dMDrYJeKHilKTemt6v6kvzvn3/RrdWtr0GoN/xL+Sex/cPYLUpepx9cz/D46UPU5KXgAQa+NDps1v6J3xP1i2HtaDB0M9aX2deA7SYff//+gUCovMmIK/qfsFcOk+4Y5ZN97XlG6zebqtMbKgeRFi51vnxTQYBUik2rS/Cn6PC8ADR8FGxsRPB82dzfND90gIcshOcYUkfjherBz53odpm6TP8txlwOZ71xmfHHOvq053qFF/MRlS3jP0ELudrf2OeN8DHvp6ZceLe8qKYvWz/7yp0u4dKPfli3CYq0O13Ih71mylJ80tOi10On8wi+F4+LWgDPeJ30msSQt9/vkmHq9/Lvo2b461mP801v3W4xTcs6CbvF9UDdrSt+A8OUbpSh55qAUFXWznBBfdeJ8a4d7ugT5tvxUza3h9m4H7ptTqiG4z0g5dc0X29OcGlhpGFMpQo9ytTS+NViZpNdvU4kWx+LKxNY10kQ1yqGXrhe4/1nvP7E+nd5A92TtaRplbHSqoIdOqtRWti+fkB5/n1+/VvCmz12pG1kpQWsfi1ftlBobm0bpngs16CHkbIwdLnParxtTV3QYRlfJ0KFskH7pdN/YDn+yRuSd7sNH3aO0DYPggk6uWuXrfOc+fa3VTxFVvKaNxHsiHmsXyCLIE5yuOeN3/Jdf8HBL/5M6shjyhxHx9BjB1O0+4NLOnjLLSxwO7ukN4jMbOIcD879KLSi6Pk61Oqm2377n8079PXEEQ7cy7OKEC9nbpet118fxweTafpt69x/Bt8UqGzNQt7aelpc44dn5cqhwf71+qKp/Zf/+a0zcizOUWpl/iBcSXip0pplkatCchoH5c5aUM8I7/dWxAej8WicPL1URFZ9BDJelUwEwTkGqUhgSlydVes95YdXvhh9Gfz/aeFWvgVb4tuLbcv4+wLdutVZv/cUonwBD/6eDlE0aSiKK/uoH3+J1wDE/jMVqY2ysGufN84oIXB0sPzy8ollX/LegY74DgJXJR57sn+VGza0x3DnuIgABFM15LmajjjsNlYj+JEZGbuRYcAMOWxFkPN2w6Wd46xo4gVWQR/X4lyI/R6K/YK0110GzudPRW7Y+UOBGTfNNzHeYT0fiH0taunBpq9HEW8OKSaBGj21L0MqenEmNRWBAWDWAk4CpNoEZJ2tTaPFgbQYj8HxtFilErs3BTRwT8uO1NXQaWfIotchmPkAF5mMBAliEmZiOGVgCG9LgRzpscMAOOwowlT3JhusdazXGSC/hxR3UlmWVwWHpOIKheqONvjyhSiTHIkVUco5bnji8m//zL7PKaT1Vl5I6UE609f+gkr6MZKVyKc7zJRmCahLsdlyA5fdQkRSan9LgnnLEyGSkaKJCJog0wAgvepWBt80+1yKln1bMVtCljfNWDueKLsWwaEbBSfSPTEmVRsUcYYMnEjcjeyCZzBXK9E9BYBXLKjOSpUDR+nEV3TFSUdQaz+ot98QxgXwx0GQ+EEUAKB2qZPkQQ0GqFD8UPFMqyaCHM24BZmSGic9EYMagKizOw9Hz50DMrDLrqqLkTAhplMictiCAx5S3BIUQdeJeLnBy2CNtMfz6cV4u8XKoFZQesbf9YZiIERiHjaNodDW6LgcirX/mPnJIkBGDUpTBhSa0EIr38D5hCIszhCM8URGBqImoWjpvpt1ebu/v3Gl3qJfMnNM+9V+kiRFyROTPHQWOcs1dNW94/ukKMPZBvDi55i5CttdeJz84DLngLqjcdwEZ87bFFR8CIG35OAkDVN6VRDZ7aq67NteYqZ2lpT8oYB2CytoBd6VuAx4WgiAsnuj3WohG+LugzXiQRDeM3XYXlULv4dp5VFYC) format("woff2"),url(./KaTeX_Size3-Regular-CTq5MqoE.woff) format("woff"),url(./KaTeX_Size3-Regular-DgpXs0kz.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size4;font-style:normal;font-weight:400;src:url(./KaTeX_Size4-Regular-Dl5lxZxV.woff2) format("woff2"),url(./KaTeX_Size4-Regular-BF-4gkZK.woff) format("woff"),url(./KaTeX_Size4-Regular-DWFBv043.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Typewriter;font-style:normal;font-weight:400;src:url(./KaTeX_Typewriter-Regular-CO6r4hn1.woff2) format("woff2"),url(./KaTeX_Typewriter-Regular-C0xS9mPB.woff) format("woff"),url(./KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf) format("truetype")}.katex{font:normal 1.21em KaTeX_Main,Times New Roman,serif;line-height:1.2;position:relative;text-indent:0;text-rendering:auto}.katex *{-ms-high-contrast-adjust:none!important;border-color:currentColor}.katex .katex-version:after{content:"0.16.47"}.katex .katex-mathml{border:0;-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.katex .katex-html>.newline{display:block}.katex .base{position:relative;white-space:nowrap;width:-webkit-min-content;width:-moz-min-content;width:min-content}.katex .base,.katex .strut{display:inline-block}.katex .textbf{font-weight:700}.katex .textit{font-style:italic}.katex .textrm{font-family:KaTeX_Main}.katex .textsf{font-family:KaTeX_SansSerif}.katex .texttt{font-family:KaTeX_Typewriter}.katex .mathnormal{font-family:KaTeX_Math;font-style:italic}.katex .mathit{font-family:KaTeX_Main;font-style:italic}.katex .mathrm{font-style:normal}.katex .mathbf{font-family:KaTeX_Main;font-weight:700}.katex .boldsymbol{font-family:KaTeX_Math;font-style:italic;font-weight:700}.katex .amsrm,.katex .mathbb,.katex .textbb{font-family:KaTeX_AMS}.katex .mathcal{font-family:KaTeX_Caligraphic}.katex .mathfrak,.katex .textfrak{font-family:KaTeX_Fraktur}.katex .mathboldfrak,.katex .textboldfrak{font-family:KaTeX_Fraktur;font-weight:700}.katex .mathtt{font-family:KaTeX_Typewriter}.katex .mathscr,.katex .textscr{font-family:KaTeX_Script}.katex .mathsf,.katex .textsf{font-family:KaTeX_SansSerif}.katex .mathboldsf,.katex .textboldsf{font-family:KaTeX_SansSerif;font-weight:700}.katex .mathitsf,.katex .mathsfit,.katex .textitsf{font-family:KaTeX_SansSerif;font-style:italic}.katex .mainrm{font-family:KaTeX_Main;font-style:normal}.katex .vlist-t{border-collapse:collapse;display:inline-table;table-layout:fixed}.katex .vlist-r{display:table-row}.katex .vlist{display:table-cell;position:relative;vertical-align:bottom}.katex .vlist>span{display:block;height:0;position:relative}.katex .vlist>span>span{display:inline-block}.katex .vlist>span>.pstrut{overflow:hidden;width:0}.katex .vlist-t2{margin-right:-2px}.katex .vlist-s{display:table-cell;font-size:1px;min-width:2px;vertical-align:bottom;width:2px}.katex .vbox{align-items:baseline;display:inline-flex;flex-direction:column}.katex .hbox{width:100%}.katex .hbox,.katex .thinbox{display:inline-flex;flex-direction:row}.katex .thinbox{max-width:0;width:0}.katex .msupsub{text-align:left}.katex .mfrac>span>span{text-align:center}.katex .mfrac .frac-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline,.katex .hline,.katex .mfrac .frac-line,.katex .overline .overline-line,.katex .rule,.katex .underline .underline-line{min-height:1px}.katex .mspace{display:inline-block}.katex .smash{display:inline;line-height:0}.katex .clap,.katex .llap,.katex .rlap{position:relative;width:0}.katex .clap>.inner,.katex .llap>.inner,.katex .rlap>.inner{position:absolute}.katex .clap>.fix,.katex .llap>.fix,.katex .rlap>.fix{display:inline-block}.katex .llap>.inner{right:0}.katex .clap>.inner,.katex .rlap>.inner{left:0}.katex .clap>.inner>span{margin-left:-50%;margin-right:50%}.katex .rule{border:0 solid;display:inline-block;position:relative}.katex .hline,.katex .overline .overline-line,.katex .underline .underline-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline{border-bottom-style:dashed;display:inline-block;width:100%}.katex .sqrt>.root{margin-left:.2777777778em;margin-right:-.5555555556em}.katex .fontsize-ensurer.reset-size1.size1,.katex .sizing.reset-size1.size1{font-size:1em}.katex .fontsize-ensurer.reset-size1.size2,.katex .sizing.reset-size1.size2{font-size:1.2em}.katex .fontsize-ensurer.reset-size1.size3,.katex .sizing.reset-size1.size3{font-size:1.4em}.katex .fontsize-ensurer.reset-size1.size4,.katex .sizing.reset-size1.size4{font-size:1.6em}.katex .fontsize-ensurer.reset-size1.size5,.katex .sizing.reset-size1.size5{font-size:1.8em}.katex .fontsize-ensurer.reset-size1.size6,.katex .sizing.reset-size1.size6{font-size:2em}.katex .fontsize-ensurer.reset-size1.size7,.katex .sizing.reset-size1.size7{font-size:2.4em}.katex .fontsize-ensurer.reset-size1.size8,.katex .sizing.reset-size1.size8{font-size:2.88em}.katex .fontsize-ensurer.reset-size1.size9,.katex .sizing.reset-size1.size9{font-size:3.456em}.katex .fontsize-ensurer.reset-size1.size10,.katex .sizing.reset-size1.size10{font-size:4.148em}.katex .fontsize-ensurer.reset-size1.size11,.katex .sizing.reset-size1.size11{font-size:4.976em}.katex .fontsize-ensurer.reset-size2.size1,.katex .sizing.reset-size2.size1{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size2.size2,.katex .sizing.reset-size2.size2{font-size:1em}.katex .fontsize-ensurer.reset-size2.size3,.katex .sizing.reset-size2.size3{font-size:1.1666666667em}.katex .fontsize-ensurer.reset-size2.size4,.katex .sizing.reset-size2.size4{font-size:1.3333333333em}.katex .fontsize-ensurer.reset-size2.size5,.katex .sizing.reset-size2.size5{font-size:1.5em}.katex .fontsize-ensurer.reset-size2.size6,.katex .sizing.reset-size2.size6{font-size:1.6666666667em}.katex .fontsize-ensurer.reset-size2.size7,.katex .sizing.reset-size2.size7{font-size:2em}.katex .fontsize-ensurer.reset-size2.size8,.katex .sizing.reset-size2.size8{font-size:2.4em}.katex .fontsize-ensurer.reset-size2.size9,.katex .sizing.reset-size2.size9{font-size:2.88em}.katex .fontsize-ensurer.reset-size2.size10,.katex .sizing.reset-size2.size10{font-size:3.4566666667em}.katex .fontsize-ensurer.reset-size2.size11,.katex .sizing.reset-size2.size11{font-size:4.1466666667em}.katex .fontsize-ensurer.reset-size3.size1,.katex .sizing.reset-size3.size1{font-size:.7142857143em}.katex .fontsize-ensurer.reset-size3.size2,.katex .sizing.reset-size3.size2{font-size:.8571428571em}.katex .fontsize-ensurer.reset-size3.size3,.katex .sizing.reset-size3.size3{font-size:1em}.katex .fontsize-ensurer.reset-size3.size4,.katex .sizing.reset-size3.size4{font-size:1.1428571429em}.katex .fontsize-ensurer.reset-size3.size5,.katex .sizing.reset-size3.size5{font-size:1.2857142857em}.katex .fontsize-ensurer.reset-size3.size6,.katex .sizing.reset-size3.size6{font-size:1.4285714286em}.katex .fontsize-ensurer.reset-size3.size7,.katex .sizing.reset-size3.size7{font-size:1.7142857143em}.katex .fontsize-ensurer.reset-size3.size8,.katex .sizing.reset-size3.size8{font-size:2.0571428571em}.katex .fontsize-ensurer.reset-size3.size9,.katex .sizing.reset-size3.size9{font-size:2.4685714286em}.katex .fontsize-ensurer.reset-size3.size10,.katex .sizing.reset-size3.size10{font-size:2.9628571429em}.katex .fontsize-ensurer.reset-size3.size11,.katex .sizing.reset-size3.size11{font-size:3.5542857143em}.katex .fontsize-ensurer.reset-size4.size1,.katex .sizing.reset-size4.size1{font-size:.625em}.katex .fontsize-ensurer.reset-size4.size2,.katex .sizing.reset-size4.size2{font-size:.75em}.katex .fontsize-ensurer.reset-size4.size3,.katex .sizing.reset-size4.size3{font-size:.875em}.katex .fontsize-ensurer.reset-size4.size4,.katex .sizing.reset-size4.size4{font-size:1em}.katex .fontsize-ensurer.reset-size4.size5,.katex .sizing.reset-size4.size5{font-size:1.125em}.katex .fontsize-ensurer.reset-size4.size6,.katex .sizing.reset-size4.size6{font-size:1.25em}.katex .fontsize-ensurer.reset-size4.size7,.katex .sizing.reset-size4.size7{font-size:1.5em}.katex .fontsize-ensurer.reset-size4.size8,.katex .sizing.reset-size4.size8{font-size:1.8em}.katex .fontsize-ensurer.reset-size4.size9,.katex .sizing.reset-size4.size9{font-size:2.16em}.katex .fontsize-ensurer.reset-size4.size10,.katex .sizing.reset-size4.size10{font-size:2.5925em}.katex .fontsize-ensurer.reset-size4.size11,.katex .sizing.reset-size4.size11{font-size:3.11em}.katex .fontsize-ensurer.reset-size5.size1,.katex .sizing.reset-size5.size1{font-size:.5555555556em}.katex .fontsize-ensurer.reset-size5.size2,.katex .sizing.reset-size5.size2{font-size:.6666666667em}.katex .fontsize-ensurer.reset-size5.size3,.katex .sizing.reset-size5.size3{font-size:.7777777778em}.katex .fontsize-ensurer.reset-size5.size4,.katex .sizing.reset-size5.size4{font-size:.8888888889em}.katex .fontsize-ensurer.reset-size5.size5,.katex .sizing.reset-size5.size5{font-size:1em}.katex .fontsize-ensurer.reset-size5.size6,.katex .sizing.reset-size5.size6{font-size:1.1111111111em}.katex .fontsize-ensurer.reset-size5.size7,.katex .sizing.reset-size5.size7{font-size:1.3333333333em}.katex .fontsize-ensurer.reset-size5.size8,.katex .sizing.reset-size5.size8{font-size:1.6em}.katex .fontsize-ensurer.reset-size5.size9,.katex .sizing.reset-size5.size9{font-size:1.92em}.katex .fontsize-ensurer.reset-size5.size10,.katex .sizing.reset-size5.size10{font-size:2.3044444444em}.katex .fontsize-ensurer.reset-size5.size11,.katex .sizing.reset-size5.size11{font-size:2.7644444444em}.katex .fontsize-ensurer.reset-size6.size1,.katex .sizing.reset-size6.size1{font-size:.5em}.katex .fontsize-ensurer.reset-size6.size2,.katex .sizing.reset-size6.size2{font-size:.6em}.katex .fontsize-ensurer.reset-size6.size3,.katex .sizing.reset-size6.size3{font-size:.7em}.katex .fontsize-ensurer.reset-size6.size4,.katex .sizing.reset-size6.size4{font-size:.8em}.katex .fontsize-ensurer.reset-size6.size5,.katex .sizing.reset-size6.size5{font-size:.9em}.katex .fontsize-ensurer.reset-size6.size6,.katex .sizing.reset-size6.size6{font-size:1em}.katex .fontsize-ensurer.reset-size6.size7,.katex .sizing.reset-size6.size7{font-size:1.2em}.katex .fontsize-ensurer.reset-size6.size8,.katex .sizing.reset-size6.size8{font-size:1.44em}.katex .fontsize-ensurer.reset-size6.size9,.katex .sizing.reset-size6.size9{font-size:1.728em}.katex .fontsize-ensurer.reset-size6.size10,.katex .sizing.reset-size6.size10{font-size:2.074em}.katex .fontsize-ensurer.reset-size6.size11,.katex .sizing.reset-size6.size11{font-size:2.488em}.katex .fontsize-ensurer.reset-size7.size1,.katex .sizing.reset-size7.size1{font-size:.4166666667em}.katex .fontsize-ensurer.reset-size7.size2,.katex .sizing.reset-size7.size2{font-size:.5em}.katex .fontsize-ensurer.reset-size7.size3,.katex .sizing.reset-size7.size3{font-size:.5833333333em}.katex .fontsize-ensurer.reset-size7.size4,.katex .sizing.reset-size7.size4{font-size:.6666666667em}.katex .fontsize-ensurer.reset-size7.size5,.katex .sizing.reset-size7.size5{font-size:.75em}.katex .fontsize-ensurer.reset-size7.size6,.katex .sizing.reset-size7.size6{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size7.size7,.katex .sizing.reset-size7.size7{font-size:1em}.katex .fontsize-ensurer.reset-size7.size8,.katex .sizing.reset-size7.size8{font-size:1.2em}.katex .fontsize-ensurer.reset-size7.size9,.katex .sizing.reset-size7.size9{font-size:1.44em}.katex .fontsize-ensurer.reset-size7.size10,.katex .sizing.reset-size7.size10{font-size:1.7283333333em}.katex .fontsize-ensurer.reset-size7.size11,.katex .sizing.reset-size7.size11{font-size:2.0733333333em}.katex .fontsize-ensurer.reset-size8.size1,.katex .sizing.reset-size8.size1{font-size:.3472222222em}.katex .fontsize-ensurer.reset-size8.size2,.katex .sizing.reset-size8.size2{font-size:.4166666667em}.katex .fontsize-ensurer.reset-size8.size3,.katex .sizing.reset-size8.size3{font-size:.4861111111em}.katex .fontsize-ensurer.reset-size8.size4,.katex .sizing.reset-size8.size4{font-size:.5555555556em}.katex .fontsize-ensurer.reset-size8.size5,.katex .sizing.reset-size8.size5{font-size:.625em}.katex .fontsize-ensurer.reset-size8.size6,.katex .sizing.reset-size8.size6{font-size:.6944444444em}.katex .fontsize-ensurer.reset-size8.size7,.katex .sizing.reset-size8.size7{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size8.size8,.katex .sizing.reset-size8.size8{font-size:1em}.katex .fontsize-ensurer.reset-size8.size9,.katex .sizing.reset-size8.size9{font-size:1.2em}.katex .fontsize-ensurer.reset-size8.size10,.katex .sizing.reset-size8.size10{font-size:1.4402777778em}.katex .fontsize-ensurer.reset-size8.size11,.katex .sizing.reset-size8.size11{font-size:1.7277777778em}.katex .fontsize-ensurer.reset-size9.size1,.katex .sizing.reset-size9.size1{font-size:.2893518519em}.katex .fontsize-ensurer.reset-size9.size2,.katex .sizing.reset-size9.size2{font-size:.3472222222em}.katex .fontsize-ensurer.reset-size9.size3,.katex .sizing.reset-size9.size3{font-size:.4050925926em}.katex .fontsize-ensurer.reset-size9.size4,.katex .sizing.reset-size9.size4{font-size:.462962963em}.katex .fontsize-ensurer.reset-size9.size5,.katex .sizing.reset-size9.size5{font-size:.5208333333em}.katex .fontsize-ensurer.reset-size9.size6,.katex .sizing.reset-size9.size6{font-size:.5787037037em}.katex .fontsize-ensurer.reset-size9.size7,.katex .sizing.reset-size9.size7{font-size:.6944444444em}.katex .fontsize-ensurer.reset-size9.size8,.katex .sizing.reset-size9.size8{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size9.size9,.katex .sizing.reset-size9.size9{font-size:1em}.katex .fontsize-ensurer.reset-size9.size10,.katex .sizing.reset-size9.size10{font-size:1.2002314815em}.katex .fontsize-ensurer.reset-size9.size11,.katex .sizing.reset-size9.size11{font-size:1.4398148148em}.katex .fontsize-ensurer.reset-size10.size1,.katex .sizing.reset-size10.size1{font-size:.2410800386em}.katex .fontsize-ensurer.reset-size10.size2,.katex .sizing.reset-size10.size2{font-size:.2892960463em}.katex .fontsize-ensurer.reset-size10.size3,.katex .sizing.reset-size10.size3{font-size:.337512054em}.katex .fontsize-ensurer.reset-size10.size4,.katex .sizing.reset-size10.size4{font-size:.3857280617em}.katex .fontsize-ensurer.reset-size10.size5,.katex .sizing.reset-size10.size5{font-size:.4339440694em}.katex .fontsize-ensurer.reset-size10.size6,.katex .sizing.reset-size10.size6{font-size:.4821600771em}.katex .fontsize-ensurer.reset-size10.size7,.katex .sizing.reset-size10.size7{font-size:.5785920926em}.katex .fontsize-ensurer.reset-size10.size8,.katex .sizing.reset-size10.size8{font-size:.6943105111em}.katex .fontsize-ensurer.reset-size10.size9,.katex .sizing.reset-size10.size9{font-size:.8331726133em}.katex .fontsize-ensurer.reset-size10.size10,.katex .sizing.reset-size10.size10{font-size:1em}.katex .fontsize-ensurer.reset-size10.size11,.katex .sizing.reset-size10.size11{font-size:1.1996142719em}.katex .fontsize-ensurer.reset-size11.size1,.katex .sizing.reset-size11.size1{font-size:.2009646302em}.katex .fontsize-ensurer.reset-size11.size2,.katex .sizing.reset-size11.size2{font-size:.2411575563em}.katex .fontsize-ensurer.reset-size11.size3,.katex .sizing.reset-size11.size3{font-size:.2813504823em}.katex .fontsize-ensurer.reset-size11.size4,.katex .sizing.reset-size11.size4{font-size:.3215434084em}.katex .fontsize-ensurer.reset-size11.size5,.katex .sizing.reset-size11.size5{font-size:.3617363344em}.katex .fontsize-ensurer.reset-size11.size6,.katex .sizing.reset-size11.size6{font-size:.4019292605em}.katex .fontsize-ensurer.reset-size11.size7,.katex .sizing.reset-size11.size7{font-size:.4823151125em}.katex .fontsize-ensurer.reset-size11.size8,.katex .sizing.reset-size11.size8{font-size:.578778135em}.katex .fontsize-ensurer.reset-size11.size9,.katex .sizing.reset-size11.size9{font-size:.6945337621em}.katex .fontsize-ensurer.reset-size11.size10,.katex .sizing.reset-size11.size10{font-size:.8336012862em}.katex .fontsize-ensurer.reset-size11.size11,.katex .sizing.reset-size11.size11{font-size:1em}.katex .delimsizing.size1{font-family:KaTeX_Size1}.katex .delimsizing.size2{font-family:KaTeX_Size2}.katex .delimsizing.size3{font-family:KaTeX_Size3}.katex .delimsizing.size4{font-family:KaTeX_Size4}.katex .delimsizing.mult .delim-size1>span{font-family:KaTeX_Size1}.katex .delimsizing.mult .delim-size4>span{font-family:KaTeX_Size4}.katex .nulldelimiter{display:inline-block;width:.12em}.katex .delimcenter,.katex .op-symbol{position:relative}.katex .op-symbol.small-op{font-family:KaTeX_Size1}.katex .op-symbol.large-op{font-family:KaTeX_Size2}.katex .accent>.vlist-t,.katex .op-limits>.vlist-t{text-align:center}.katex .accent .accent-body{position:relative}.katex .accent .accent-body:not(.accent-full){width:0}.katex .overlay{display:block}.katex .mtable .vertical-separator{display:inline-block;min-width:1px}.katex .mtable .arraycolsep{display:inline-block}.katex .mtable .col-align-c>.vlist-t{text-align:center}.katex .mtable .col-align-l>.vlist-t{text-align:left}.katex .mtable .col-align-r>.vlist-t{text-align:right}.katex .svg-align{text-align:left}.katex svg{fill:currentColor;stroke:currentColor;display:block;height:inherit;position:absolute;width:100%}.katex svg path{stroke:none}.katex svg{fill-rule:nonzero;fill-opacity:1;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1}.katex img{border-style:none;max-height:none;max-width:none;min-height:0;min-width:0}.katex .stretchy{display:block;overflow:hidden;position:relative;width:100%}.katex .stretchy:after,.katex .stretchy:before{content:""}.katex .hide-tail{overflow:hidden;position:relative;width:100%}.katex .halfarrow-left{left:0;overflow:hidden;position:absolute;width:50.2%}.katex .halfarrow-right{overflow:hidden;position:absolute;right:0;width:50.2%}.katex .brace-left{left:0;overflow:hidden;position:absolute;width:25.1%}.katex .brace-center{left:25%;overflow:hidden;position:absolute;width:50%}.katex .brace-right{overflow:hidden;position:absolute;right:0;width:25.1%}.katex .x-arrow-pad{padding:0 .5em}.katex .cd-arrow-pad{padding:0 .55556em 0 .27778em}.katex .mover,.katex .munder,.katex .x-arrow{text-align:center}.katex .boxpad{padding:0 .3em}.katex .fbox,.katex .fcolorbox{border:.04em solid;box-sizing:border-box}.katex .cancel-pad{padding:0 .2em}.katex .cancel-lap{margin-left:-.2em;margin-right:-.2em}.katex .sout{border-bottom-style:solid;border-bottom-width:.08em}.katex .angl{border-right:.049em solid;border-top:.049em solid;box-sizing:border-box;margin-right:.03889em}.katex .anglpad{padding:0 .03889em}.katex .eqn-num:before{content:"(" counter(katexEqnNo) ")";counter-increment:katexEqnNo}.katex .mml-eqn-num:before{content:"(" counter(mmlEqnNo) ")";counter-increment:mmlEqnNo}.katex .mtr-glue{width:50%}.katex .cd-vert-arrow{display:inline-block;position:relative}.katex .cd-label-left{display:inline-block;position:absolute;right:calc(50% + .3em);text-align:left}.katex .cd-label-right{display:inline-block;left:calc(50% + .3em);position:absolute;text-align:right}.katex-display{display:block;margin:1em 0;text-align:center}.katex-display>.katex{display:block;text-align:center;white-space:nowrap}.katex-display>.katex>.katex-html{display:block;position:relative}.katex-display>.katex>.katex-html>.tag{position:absolute;right:0}.katex-display.leqno>.katex>.katex-html>.tag{left:0;right:auto}.katex-display.fleqn>.katex{padding-left:2em;text-align:left}body{counter-reset:katexEqnNo mmlEqnNo}
/* genWork assistant embedded in Home — chrome colors via theme tokens */

:root {
  /* composer lift and chip-remove button, theme-invariant (same as the docs/slides panels) */
  --gw-shadow-composer: 0 6px 30px rgb(0 0 0 / 8%);
  --gw-chip-remove-bg: #000;
  --gw-chip-remove-hover: #4b4e51;
  --gw-chip-remove-ink: #fff;
  --gw-att-bg: #fafafa;
  --gw-att-border: #ececee;
  --gw-scroll-thumb: rgb(0 0 0 / 25%);
}

[data-theme='dark'] {
  --gw-att-bg: #2a2a2a;
  --gw-att-border: #3a3a3a;
  --gw-scroll-thumb: rgb(255 255 255 / 28%);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']):not([data-theme='dark']) {
    --gw-att-bg: #2a2a2a;
    --gw-att-border: #3a3a3a;
    --gw-scroll-thumb: rgb(255 255 255 / 28%);
  }
}

/* hero entry on the landing (new-task) view */
.gw-landing {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 4px 0 26px;
}

/* conversation workspace: chat column, plus the artifact preview panel when open */
.gw-workspace {
  display: flex;
  flex: 1;
  min-height: 0;
  min-width: 0;
  gap: 16px;
}

/* conversation view: fills the content area; alone it reads as a centered
   column (Claude-style), beside the preview it uses the full width */
.gw-home.gw-open {
  --gw-col-max: 760px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-height: 0;
  min-width: 0;
}

.gw-home.gw-open > .gw-header,
.gw-home.gw-open > .gw-error,
.gw-home.gw-open > .gw-queue,
.gw-home.gw-open > .gw-composer,
.gw-list-inner {
  width: 100%;
  max-width: var(--gw-col-max);
  margin-left: auto;
  margin-right: auto;
}

/* with the preview open the chat yields ~60% of the width to the document */
.gw-with-preview > .gw-home.gw-open {
  --gw-col-max: none;
  flex: 2 1 0;
  min-width: 300px;
}

.gw-with-preview {
  gap: 0;
}

/* user-dragged split: the preview keeps its width, the chat takes the rest */
.gw-preview-sized > .gw-home.gw-open {
  flex: 1 1 0;
}

.gw-preview-sized > .gw-preview {
  flex: 0 1 var(--gw-preview-w);
}

/* folded chat: a narrow rail with the expand button, the document takes the rest */
.gw-chat-collapsed > .gw-home.gw-open {
  display: none;
}

.gw-chat-collapsed > .gw-preview,
.gw-chat-collapsed.gw-preview-sized > .gw-preview {
  flex: 1 1 auto;
}

.gw-chat-rail {
  flex: none;
  width: 36px;
  padding-top: 7px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.gw-chat-fold {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  color: var(--text);
}

.gw-chat-fold-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.gw-chat-rail .gw-chat-fold-icon {
  transform: scaleX(-1);
}

.gw-chat-rail-dot {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.gw-chat-rail-busy {
  animation: gw-rail-pulse 1.2s ease-in-out infinite;
}

@keyframes gw-rail-pulse {
  50% {
    opacity: 0.3;
  }
}

/* chat header and preview head share one row height so their titles line up */
.gw-home.gw-open > .gw-header {
  min-height: 44px;
  padding-top: 0;
}

/* ── artifact preview panel (WorkBuddy-style: document beside the chat) ── */

.gw-preview {
  flex: 3 1 0;
  min-width: 380px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
}

.gw-splitter {
  position: relative;
  flex: none;
  width: 16px;
  cursor: col-resize;
  touch-action: none;
}

/* hint sits on the chat side: the document view is a native layer over the preview */
.gw-splitter::after {
  content: attr(data-hint);
  position: absolute;
  right: 100%;
  top: var(--gw-hint-y, 50%);
  transform: translateY(-50%);
  margin-right: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--text);
  color: var(--surface);
  font-size: 12px;
  line-height: 1.3;
  white-space: nowrap;
  box-shadow: var(--shadow-menu);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
}

.gw-splitter:hover::after {
  opacity: 1;
  transition-delay: 300ms;
}

.gw-resizing .gw-splitter::after {
  opacity: 0;
}

.gw-resizing {
  cursor: col-resize;
  user-select: none;
}

.gw-preview-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  min-height: 44px;
  box-sizing: border-box;
  border-bottom: 1px solid var(--border-subtle);
}

.gw-preview-head img {
  width: 16px;
  height: 16px;
  flex: none;
}

.gw-preview-title {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gw-preview-action {
  flex: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 12px;
  padding: 4px 10px;
  cursor: pointer;
  white-space: nowrap;
}

.gw-preview-action:hover {
  background: var(--hover);
  color: var(--text);
}

.gw-preview-doc-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.gw-preview-doc-action svg {
  width: 14px;
  height: 14px;
}

.gw-preview-doc-action.active {
  background: var(--hover);
  color: var(--accent);
  border-color: var(--accent);
}

.gw-preview-action.gw-preview-doc-action svg {
  margin-left: 0;
}

.gw-preview-action svg,
.gw-preview-title-btn svg {
  margin-left: 4px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.gw-preview-head .gw-head-menu {
  min-width: 0;
}

.gw-preview-switch {
  flex: 1;
  min-width: 0;
}

.gw-preview-title-btn {
  flex: 0 1 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 4px 6px;
  margin-left: -6px;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.gw-preview-title-btn:hover,
.gw-preview-title-btn[aria-expanded='true'] {
  background: var(--hover);
}

.gw-preview-title-btn img {
  width: 16px;
  height: 16px;
  flex: none;
}

.gw-preview-title-btn span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gw-preview-head .gw-head-menu-list {
  max-height: 60vh;
  overflow-y: auto;
}

.gw-preview-head .gw-preview-switch .gw-head-menu-list {
  left: 0;
  right: auto;
  width: 320px;
}

.gw-preview-switch .row-menu .gw-files-item {
  display: flex;
}

.gw-preview-head .gw-preview-more .gw-head-menu-list {
  min-width: 180px;
}

.gw-preview-version {
  display: flex;
  align-items: center;
}

.gw-preview-version .gw-preview-version-view {
  flex: 1;
  min-width: 0;
}

.row-menu .gw-preview-version-restore {
  flex: none;
  width: auto;
  padding: 4px 8px;
  font-size: 12px;
  color: var(--text-tertiary);
  opacity: 0;
}

.gw-preview-version:hover .gw-preview-version-restore,
.gw-preview-version-restore:focus-visible {
  opacity: 1;
}

.row-menu .gw-preview-version-restore:hover {
  color: var(--accent);
}

.gw-preview-head .gw-icon-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  vertical-align: middle;
}

/* the document's WebContentsView overlays this region (bounds reported over IPC) */
.gw-preview-body {
  flex: 1;
  min-height: 0;
  background: var(--surface-subtle);
}

.gw-preview-image {
  display: flex;
  flex-direction: column;
}

/* ── code panel (code scene: the project's uncommitted diff) ── */

.gw-code-body {
  display: flex;
  flex-direction: column;
  background: var(--surface);
}

.gw-code-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.gw-code-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 12px;
  color: var(--text-secondary);
}

.gw-code-toolbar > * {
  flex: none;
}

.gw-code-summary {
  flex: 1 1 auto;
  display: inline-flex;
  gap: 8px;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gw-code-comments-count {
  color: var(--accent);
}

.gw-code-add {
  color: var(--success);
}

.gw-code-del {
  color: var(--danger);
}

.gw-code-modes {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.gw-code-mode {
  border: 0;
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 12px;
  padding: 4px 10px;
  cursor: pointer;
  white-space: nowrap;
}

.gw-code-mode-on {
  background: var(--hover);
  color: var(--text);
}

.gw-code-files {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gw-code-empty {
  padding: 24px 12px;
  text-align: center;
  font-size: 13px;
  color: var(--text-tertiary);
}

.gw-code-more {
  align-self: center;
  margin: 4px 0 12px;
}

.gw-code-error {
  color: var(--danger);
}

.gw-code-norepo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.gw-code-file {
  flex: none;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  overflow: hidden;
}

.gw-code-file-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 0;
  background: var(--surface-subtle);
  color: var(--text);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.gw-code-file-head:hover {
  background: var(--hover);
}

.gw-code-file-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono, ui-monospace, monospace);
}

.gw-code-status {
  flex: none;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--hover);
}

.gw-code-status-added {
  color: var(--success);
  background: var(--success-bg);
}

.gw-code-status-deleted {
  color: var(--danger);
  background: var(--danger-bg);
}

.gw-code-caret {
  color: var(--text-tertiary);
}

.gw-code-tabs {
  display: flex;
  gap: 2px;
  padding: 6px 8px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.gw-code-tab {
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  padding: 6px 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.gw-code-tab:hover {
  color: var(--text);
}

.gw-code-tab-on {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.gw-code-tab-count {
  font-size: 11px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--hover);
  color: var(--text-secondary);
}

.gw-code-tabpane {
  display: flex;
  flex: 1;
  min-height: 0;
}

.gw-code-tabpane-hidden {
  display: none;
}

/* preview tab: the reported dev server in an iframe */
.gw-preview-tab {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
}

.gw-dev-summary {
  font-family: var(--font-mono, ui-monospace, monospace);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gw-dev-port {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-secondary);
}

.gw-dev-port input {
  width: 68px;
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 12px;
}

.gw-dev-open {
  text-decoration: none;
}

.gw-dev-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.gw-dev-errors {
  background: var(--danger-bg);
  border-bottom-color: var(--danger-border);
}

.gw-dev-errors .gw-code-banner-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gw-dev-frame {
  flex: 1;
  min-height: 0;
  width: 100%;
  border: 0;
  background: var(--surface);
}

.gw-dev-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}

/* files tab: tree on the left, read-only source on the right */
.gw-code-split {
  display: flex;
  flex: 1;
  min-height: 0;
}

.gw-tree {
  flex: 0 0 220px;
  min-width: 160px;
  overflow: auto;
  border-right: 1px solid var(--border-subtle);
  padding: 6px 0;
  font-size: 12px;
}

.gw-tree-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 4px;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 3px 8px;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
}

.gw-tree-row:hover {
  background: var(--hover);
}

.gw-tree-selected {
  background: var(--bg-hover-accent);
}

.gw-tree-ignored {
  color: var(--text-tertiary);
}

.gw-tree-caret {
  flex: none;
  width: 12px;
  color: var(--text-tertiary);
  font-size: 11px;
}

.gw-tree-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gw-tree-dot {
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.gw-tree-empty {
  padding: 3px 8px;
  font-size: 11px;
  color: var(--text-tertiary);
}

.gw-code-view {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.gw-code-view-head {
  padding: 6px 10px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 12px;
  color: var(--text-secondary);
  font-family: var(--font-mono, ui-monospace, monospace);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gw-code-source {
  flex: 1;
  min-height: 0;
  margin: 0;
  overflow: auto;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 12px;
  line-height: 1.6;
  tab-size: 4;
}

.gw-code-line {
  display: flex;
}

.gw-code-ln {
  flex: none;
  width: 44px;
  padding-right: 10px;
  text-align: right;
  color: var(--text-tertiary);
  user-select: none;
  background: var(--surface-subtle);
}

.gw-code-text {
  flex: 1;
  padding-left: 10px;
  white-space: pre;
}

/* terminal tab */
.gw-term {
  display: flex;
  flex: 1;
  min-height: 0;
  min-width: 0;
  flex-direction: column;
}

.gw-term-host {
  flex: 1;
  min-height: 0;
  background: var(--surface);
}

.gw-term-host-hidden {
  display: none;
}

.gw-term-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.gw-term-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
}

.gw-term-tab {
  display: inline-flex;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.gw-term-tab > button {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 3px 8px;
  cursor: pointer;
}

.gw-term-tab-input {
  width: 96px;
  border: 0;
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  padding: 2px 6px;
  outline: 1px solid var(--accent);
}

.gw-term-tab-on {
  background: var(--hover);
  color: var(--text);
  border-color: var(--border-subtle);
}

.gw-term-tab-x {
  padding: 3px 6px 3px 0 !important;
  color: var(--text-tertiary);
}

.gw-term-tab-x:hover {
  color: var(--text);
}

.gw-term-tab-add {
  border: 1px dashed var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1;
  padding: 3px 8px;
  cursor: pointer;
}

.gw-term-tab-add:hover {
  background: var(--hover);
  color: var(--text);
}

.gw-term-all {
  position: relative;
  margin-left: auto;
  flex: none;
}

.gw-term-all-btn {
  border-style: solid;
  font-size: 12px;
  white-space: nowrap;
}

.row-menu.gw-term-all-menu {
  min-width: 220px;
  max-width: 320px;
  max-height: 320px;
  overflow-y: auto;
}

.gw-term-all-empty,
.gw-term-all-conv {
  padding: 5px 10px;
  font-size: 12px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gw-term-all-group + .gw-term-all-group {
  border-top: 1px solid var(--border-subtle);
  margin-top: 4px;
  padding-top: 4px;
}

.gw-term-all-row {
  display: flex;
  align-items: center;
}

.gw-term-all-row > button:first-child {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gw-term-all-row .gw-term-tab-x {
  width: auto;
  padding: 2px 8px;
}

.gw-code-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-hover-accent);
  font-size: 12px;
  color: var(--text);
}

.gw-code-banner-text {
  flex: 1;
  min-width: 0;
}

.gw-code-source-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.gw-term-host .xterm {
  height: 100%;
  /* padding lives on .xterm, not the host: FitAddon subtracts only the
     terminal element's own padding from the border-box parent size */
  padding: 6px 0 0 8px;
}

/* xterm.css hardcodes #000 on the viewport, which spans the padding box */
.gw-term-host .xterm .xterm-viewport {
  background-color: transparent;
}

.gw-term-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  border-top: 1px solid var(--border-subtle);
  font-size: 12px;
  color: var(--text-secondary);
}

.gw-diff-widget {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  background: var(--surface-subtle);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.gw-diff-widget-input {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  padding: 6px 8px;
}

.gw-diff-widget-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.gw-diff-widget-send {
  border-color: var(--accent);
  color: var(--accent);
}

.gw-diff-comment {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--text);
  background: var(--bg-hover-accent);
  border-top: 1px solid var(--border-subtle);
}

.gw-diff-comment-text {
  flex: 1;
  min-width: 0;
  white-space: pre-wrap;
}

/* the diff viewer draws with its own variables; pin the neutral ones to
   chrome tokens so both themes read as part of the panel */
.gw-code-file .diff-tailwindcss-wrapper {
  --diff-border--: var(--border-subtle);
  --diff-plain-content--: var(--surface);
  --diff-plain-lineNumber--: var(--surface-subtle);
  --diff-plain-lineNumber-color--: var(--text-tertiary);
  --diff-hunk-content--: var(--surface-subtle);
  --diff-hunk-lineNumber--: var(--surface-subtle);
  --diff-hunk-content-color--: var(--text-secondary);
  --diff-empty-content--: var(--surface-subtle);
}

/* ── document artifact cards ── */

.gw-doc-card {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(92%, 480px);
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.gw-doc-card:hover {
  background: var(--hover);
}

/* write-tool deliverable card: rides inside its step row, indented under the
 * status icon; slightly tighter than the top-level artifact cards */
.gw-file-card {
  margin: 2px 0 4px 21px;
  padding: 7px 12px;
}

.gw-doc-card img {
  width: 22px;
  height: 22px;
  flex: none;
}

.gw-doc-title {
  flex: 1;
  min-width: 0;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gw-doc-format {
  flex: none;
  font-size: 10px;
  color: var(--text-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 0 6px;
}

.gw-doc-open {
  flex: none;
  color: var(--text-tertiary);
}

.gw-artifacts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

.gw-artifacts-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
}

.gw-artifacts-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gw-artifacts .gw-doc-card {
  align-self: auto;
  min-width: 200px;
  max-width: 320px;
}

.gw-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 2px 0;
}

.gw-title {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gw-title-input {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 0 4px;
  outline: none;
}

/* header menu: the conversation's artifacts + attached files */
.gw-files {
  position: relative;
  flex: none;
}

.gw-files-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  color: var(--text);
}

.gw-files-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.gw-files-btn-on {
  background: var(--active-bg);
}

.gw-more-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.gw-panel-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  color: var(--text);
}

.gw-panel-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.gw-panel-toggle-on .gw-panel-toggle-pane {
  fill: currentColor;
}

.gw-files-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 30;
  width: 320px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 4px 8px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-menu);
  animation: menu-in 0.1s ease;
}

.gw-files-group + .gw-files-group {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border-subtle);
}

.gw-files-label {
  padding: 8px 8px 4px;
  font-size: 12px;
  color: var(--text-tertiary);
}

.gw-files-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px;
  border: none;
  border-radius: 8px;
  background: none;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.gw-files-item:hover,
.gw-files-item-on {
  background: var(--hover);
}

.gw-files-item img {
  width: 18px;
  height: 18px;
  flex: none;
}

.gw-files-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gw-icon-btn {
  border: none;
  background: none;
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
}

.gw-icon-btn:hover {
  background: var(--hover);
}

.gw-list-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.gw-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  /* pinning is done by hand; browser anchoring would fight it while streaming */
  overflow-anchor: none;
  padding: 12px 2px;
}

.gw-list-inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* floating re-pin control while the user has scrolled up (SAS/Claude style) */
.gw-jump-bottom {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 15px;
  cursor: pointer;
  box-shadow: var(--shadow-btn-hover);
}

.gw-jump-bottom:hover {
  background: var(--bg-hover);
  color: var(--text);
}

/* steering queue: messages typed mid-run, sent in order as runs settle */
.gw-sendq {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.gw-sendq-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  max-width: 320px;
  padding: 3px 4px 3px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-subtle);
  font-size: 12px;
  color: var(--text-muted);
}

.gw-sendq-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: none;
  background: none;
  padding: 0 4px 0 0;
  font: inherit;
  color: inherit;
  cursor: text;
}

.gw-sendq-text:hover {
  color: var(--text);
}

.gw-sendq-act {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 999px;
  background: none;
  padding: 0;
  font: inherit;
  color: var(--text-tertiary);
  cursor: pointer;
}

.gw-sendq-act:hover {
  background: var(--hover);
  color: var(--text);
}

.gw-sendq-now {
  flex: none;
  border: none;
  background: none;
  padding: 0 4px;
  font: inherit;
  font-size: 12px;
  color: var(--accent);
  cursor: pointer;
}

.gw-sendq-now:hover {
  text-decoration: underline;
}

.gw-sendq-note {
  font-size: 11px;
  color: var(--text-tertiary);
}

.gw-msg {
  max-width: 100%;
  font-size: 15px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.gw-user {
  align-self: flex-end;
  max-width: 80%;
  background: var(--bg-hover-accent);
  border-radius: 12px 12px 4px 12px;
  padding: 8px 12px;
}

/* the brain's prose is a plain paragraph: only the user's turn is a bubble */
.gw-assistant {
  align-self: flex-start;
  padding: 2px 0;
  color: var(--text);
}

.gw-typing {
  padding-left: 4px;
}

.ai-typing {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 4px 0;
}

.ai-typing-label {
  font-size: 14px;
  line-height: 1;
  background: linear-gradient(
    90deg,
    var(--text-tertiary) 0%,
    var(--text) 50%,
    var(--text-tertiary) 100%
  );
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gw-ws-shimmer 2s linear infinite;
}

.ai-typing-elapsed {
  font-variant-numeric: tabular-nums;
}

.ai-typing-dots {
  height: 12px;
  display: flex;
  gap: 2px;
}

.ai-typing-dot-slot {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 12px;
}

.ai-typing-dot-grow,
.ai-typing-dot-shrink {
  background: var(--accent);
  border-radius: 50%;
}

.ai-typing-dot-grow {
  animation: gw-dot-grow 2s infinite;
}

.ai-typing-dot-shrink {
  animation: gw-dot-shrink 2s infinite;
}

@keyframes gw-dot-grow {
  0%,
  100% {
    width: 4px;
    height: 4px;
    opacity: 0.45;
  }
  50% {
    width: 12px;
    height: 12px;
    opacity: 1;
  }
}

@keyframes gw-dot-shrink {
  0%,
  100% {
    width: 12px;
    height: 12px;
    opacity: 1;
  }
  50% {
    width: 4px;
    height: 4px;
    opacity: 0.45;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ai-typing-label {
    animation: none;
    background: none;
    color: var(--text-secondary);
  }

  .ai-typing-dot-grow,
  .ai-typing-dot-shrink {
    animation: none;
    width: 8px;
    height: 8px;
  }
}

.gw-notice {
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--text-muted);
  background: var(--hover);
  font-size: 12px;
  max-width: 760px;
}

.gw-error {
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--danger);
  background: var(--danger-bg);
  font-size: 12px;
  max-width: 760px;
  animation: gw-error-in 0.15s ease-out;
}

@keyframes gw-error-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
}

/* ── selection-edit queue (mirrored from the bound document): chips over the composer ── */

.gw-queue {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
  max-width: 760px;
  padding: 6px 2px;
  font-size: 12px;
}

.gw-queue-title {
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.gw-queue-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.gw-queue-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  max-width: 240px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  padding: 2px 4px 2px 10px;
}

.gw-queue-chip-label {
  border: none;
  background: none;
  color: var(--text-secondary);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  padding: 0;
}

.gw-queue-chip-x {
  border: none;
  background: none;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 0 4px;
}

.gw-queue-chip-x:hover {
  color: var(--text);
}

.gw-queue-clear,
.gw-queue-send {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 12px;
  padding: 3px 10px;
  cursor: pointer;
  flex-shrink: 0;
}

.gw-queue-send {
  color: var(--accent);
  border-color: var(--accent);
}

.gw-queue-send:disabled {
  opacity: 0.5;
  cursor: default;
}

/* ── composer: shared AiComposer (.ai-input-box family), themed for the shell ── */

.gw-composer {
  width: 100%;
  max-width: 760px;
}

.gw-composer .ai-input-box {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--gw-shadow-composer);
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast);
}

/* Focus state: no colored highlight, just a one-step darker border as the cue
 * (same as the docs/slides panels) */
.gw-composer .ai-input-box:focus-within {
  border-color: var(--border-strong);
}

.gw-composer.gw-drop-over .ai-input-box {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.gw-composer .ai-input-box textarea {
  display: block;
  width: 100%;
  resize: none;
  border: none;
  background: none;
  border-radius: 16px 16px 0 0;
  /* vertical gaps live on margin, not padding: textarea padding scrolls away
   * with the content, so clipped lines would sit flush against chips/footer */
  padding: 0 14px;
  margin: 12px 0 4px;
  font-size: 16px;
  font-family: inherit;
  line-height: 24px;
  outline: none;
  color: var(--text);
  min-height: 48px;
  max-height: 168px;
  overflow-y: auto;
}

.gw-composer .ai-input-box textarea::placeholder {
  color: var(--text-tertiary);
}

/* scene tag sits on the textarea's first line (WorkBuddy inline tag); the
   anchor has no height so the textarea keeps its own metrics */
.gw-composer .ai-input-box textarea {
  text-indent: var(--gw-scene-indent, 0);
}

.gw-scene-anchor {
  position: relative;
  height: 0;
}

.gw-scene-tag {
  position: absolute;
  top: 12px;
  left: 14px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1;
  color: var(--accent);
  background: var(--accent-soft);
  white-space: nowrap;
}

.gw-scene-x {
  border: none;
  background: none;
  padding: 0 0 0 2px;
  font-size: 15px;
  line-height: 1;
  color: inherit;
  opacity: 0.7;
  cursor: pointer;
}

.gw-scene-x:hover {
  opacity: 1;
}

.gw-expert-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
}

.gw-connector-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 4px 2px 6px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-primary);
  background: var(--hover);
  white-space: nowrap;
}

.gw-plus-check {
  margin-left: auto;
  align-self: center;
  color: var(--accent);
}

.gw-expert-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
}

.gw-composer .ai-input-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 8px 10px;
}

.gw-composer .ai-input-footer .ai-send-btn {
  margin-left: auto;
}

/* narrow screens: the dropdown chips shrink and ellipsize instead of pushing the send key out */
.gw-composer .ai-input-footer .hf-anchor,
.gw-composer .ai-input-footer .hf-btn {
  flex: 0 1 auto;
  min-width: 0;
}

.gw-composer .ai-input-footer .hf-btn > svg,
.gw-composer .ai-input-footer .hf-btn > .set-provider-logo {
  flex-shrink: 0;
}

.gw-composer .ai-input-footer .hf-btn-label {
  min-width: 2ch;
}

/* icon-only enter key: transparent button chrome, visuals come from brand-supplied
 * PNGs (gray arrow = disabled, black arrow = enabled), 36×36, same as the app panels */
.gw-composer .ai-send-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  flex-shrink: 0;
  border: none;
  border-radius: 35%;
  background: transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.gw-composer .ai-send-btn img {
  display: block;
  width: 100%;
  height: 100%;
}

.gw-composer .ai-send-btn:hover:not(:disabled) {
  filter: brightness(0.92);
}

.gw-composer .ai-send-btn:active:not(:disabled) {
  filter: brightness(0.88);
  transform: scale(0.98);
}

.gw-composer .ai-send-btn:disabled {
  cursor: default;
}

/* "+" menu: add files / skills / connectors, opens upward with a right-hand flyout */
.gw-plus-anchor {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}

.gw-plus-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.gw-plus-btn:hover,
.gw-plus-btn[aria-expanded='true'] {
  background: var(--hover);
  color: var(--text);
}

.gw-composer .gw-plus-menu {
  top: auto;
  bottom: calc(100% + 8px);
  right: auto;
  left: 0;
  min-width: 200px;
}

.gw-plus-item {
  position: relative;
}

.gw-plus-menu .gw-plus-item > button {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gw-plus-menu .gw-plus-item.open > button {
  background: var(--surface-subtle);
}

.gw-plus-caret {
  margin-left: auto;
  padding-left: 16px;
  color: var(--text-tertiary);
}

.gw-composer .gw-plus-sub {
  top: auto;
  bottom: -6px;
  right: auto;
  left: calc(100% + 8px);
  min-width: 180px;
  max-width: 280px;
  max-height: 300px;
  overflow-y: auto;
}

.gw-composer .gw-plus-sub button {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* skills / connectors flyout: search on top, avatar + name + one-line
   description rows, "manage" link at the bottom */
.gw-composer .gw-plus-sub.rich {
  display: flex;
  flex-direction: column;
  min-width: 320px;
  max-width: 360px;
  max-height: 380px;
  overflow: hidden;
}

.gw-plus-list {
  overflow-y: auto;
  min-height: 0;
}

.gw-plus-search {
  width: 100%;
  margin-bottom: 6px;
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  background: var(--surface-subtle);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  outline: none;
}

.gw-plus-search:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 1px var(--border-strong);
}

.gw-plus-search::placeholder {
  color: var(--text-tertiary);
}

.gw-composer .gw-plus-sub.rich .gw-plus-list button {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
}

.gw-plus-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--bg-hover-accent);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
}

.gw-plus-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.gw-plus-name,
.gw-plus-desc {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gw-plus-desc {
  font-size: 12.5px;
  color: var(--text-secondary);
}

.gw-composer .gw-plus-sub .gw-plus-manage {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.gw-plus-empty {
  display: block;
  padding: 7px 10px;
  font-size: 13px;
  color: var(--text-secondary);
}

.gw-composer .ai-attach-notice {
  margin-bottom: 7px;
  font-size: 11.5px;
  color: var(--danger);
  white-space: pre-wrap;
}

/* attachment chips above the composer: single row inside the prompt box,
   overflowing chips scroll horizontally (Genspark composer style; the
   always-present 4px scrollbar lane doubles as the bottom padding, side
   insets are transparent borders so scrolled items never sit flush) */
.ai-attachments {
  display: flex;
  gap: 8px;
  overflow-x: scroll;
  padding: 13px 0 0;
  border-inline: 14px solid transparent;
  margin-bottom: -6px;
}

.ai-attachments > * {
  flex-shrink: 0;
}

.ai-attachments::-webkit-scrollbar {
  height: 4px;
}

.ai-attachments::-webkit-scrollbar-thumb {
  border-radius: 2px;
  background: var(--gw-scroll-thumb);
}

/* Image attachments: square thumbnail with a round dark remove button on its corner */
.ai-attachment-thumb {
  position: relative;
}

.ai-attachment-open {
  cursor: pointer;
}

.ai-attachment-open:hover {
  filter: brightness(0.94);
}

.ai-attachment-thumb img {
  display: block;
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 12px;
}

.ai-attachment-thumb-remove {
  position: absolute;
  top: -10px;
  right: -2px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--gw-chip-remove-bg);
  color: var(--gw-chip-remove-ink);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.ai-attachment-thumb-remove:hover {
  background: var(--gw-chip-remove-hover);
}

/* The card's 1px border shifts its absolutely-positioned button inward by 1px
   on both axes; land the borderless thumbs' button on the exact same spot */
.ai-attachment-thumb .ai-attachment-thumb-remove {
  top: -9px;
  right: -1px;
}

/* image thumb before its preview arrives (or when reading fails): neutral tile + type icon */
.ai-attachment-thumb-pending {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: var(--gw-att-bg);
}

.ai-attachment-thumb .ai-attachment-thumb-pending img {
  width: 26px;
  height: 26px;
}

/* Non-image attachments (pdf, xlsx, …): fixed-width bordered card — type icon
   in its own tile + truncated name and size, same height as the thumbs */
.ai-attachment-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 190px;
  height: 56px;
  padding: 0 14px 0 8px;
  border: 1px solid var(--gw-att-border);
  border-radius: 12px;
  background: var(--gw-att-bg);
}

.ai-attachment-card-icon {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--surface);
}

.ai-attachment-card-icon img {
  display: block;
  width: 26px;
  height: 26px;
}

.ai-attachment-card-meta {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.ai-attachment-card-name {
  overflow: hidden;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-attachment-card-size {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-tertiary);
}

.ai-attachment-uploading .ai-attachment-card-meta {
  opacity: 0.6;
}

.ai-attachment-upload-spinner {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--text-secondary);
  border-radius: 50%;
  animation: gw-upload-spin 0.8s linear infinite;
}

@keyframes gw-upload-spin {
  to {
    transform: rotate(360deg);
  }
}

/* attachments echoed on a sent user message (read-only: no remove button, smaller) */
.ai-msg-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.ai-msg-attachments .ai-attachment-thumb img {
  width: 44px;
  height: 44px;
  border-radius: 8px;
}

.ai-msg-attachments .ai-attachment-card {
  width: auto;
  max-width: 190px;
  height: 44px;
  background: var(--surface);
}

.ai-msg-attachments .ai-attachment-card-icon {
  width: 32px;
  height: 32px;
  background: var(--surface-subtle);
}

.ai-msg-attachments .ai-attachment-card-icon img {
  width: 22px;
  height: 22px;
}

/* ── sidebar task rail ── */

.gw-task-section {
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin: 0 8px 6px;
}

.gw-task-head {
  display: flex;
  align-items: center;
  padding: 2px 6px 6px 10px;
}

.gw-task-toggle {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.gw-task-menu-anchor {
  position: relative;
}

.gw-task-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--text-tertiary);
  cursor: pointer;
}

@media (hover: hover) {
  .gw-task-menu-btn {
    visibility: hidden;
  }

  .gw-task-head:hover .gw-task-menu-btn,
  .gw-task-menu-btn.on,
  .gw-task-menu-btn[aria-expanded='true'] {
    visibility: visible;
  }
}

.gw-task-menu-btn:hover,
.gw-task-menu-btn[aria-expanded='true'] {
  background: var(--hover);
  color: var(--text);
}

.gw-task-menu-anchor .row-menu.hf-menu {
  left: auto;
  right: 0;
  min-width: 140px;
}

.gw-task-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
}

.gw-task-chevron {
  color: var(--text-tertiary);
  transition: transform 0.15s ease;
}

.gw-task-chevron.collapsed {
  transform: rotate(-90deg);
}

.gw-task-more {
  display: block;
  width: 100%;
  padding: 6px 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--text-tertiary);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.gw-task-more:hover {
  background: var(--hover);
  color: var(--text-secondary);
}

.gw-task-list {
  overflow-y: auto;
  max-height: 32vh;
}

.gw-task-group-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px 2px;
  color: var(--text-tertiary);
  font-size: 12px;
}

.gw-task-group-head svg {
  width: 14px;
  height: 14px;
}

.gw-task-group-n {
  color: var(--text-tertiary);
  opacity: 0.7;
}

.gw-task-cat-head {
  cursor: pointer;
  user-select: none;
}

.gw-task-cat-head:hover {
  color: var(--text-secondary);
}

.gw-task-cat-head .gw-task-chevron {
  flex: none;
  transition: transform 0.15s;
}

.gw-task-cat-head .gw-task-chevron.collapsed {
  transform: rotate(-90deg);
}

.gw-task-cat-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-secondary);
}

.gw-task-cat-input,
.gw-task-ctx-input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 13px;
}

.gw-task-ctx-input {
  margin: 4px 8px;
  width: calc(100% - 16px);
}

@media (hover: hover) {
  .gw-task-cat-head .gw-task-del {
    visibility: hidden;
  }
  .gw-task-cat-head:hover .gw-task-del {
    visibility: visible;
  }
}

.gw-task-ctx-back {
  color: var(--text-tertiary);
}

.gw-task-group + .gw-task-group {
  margin-top: 6px;
}

.gw-task-ico {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface-subtle);
  color: var(--text-tertiary);
}

.gw-task-ico.cloud {
  background: var(--accent-soft);
  color: var(--accent);
}

.gw-task-ico svg {
  width: 13px;
  height: 13px;
}

.gw-task-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
}

.gw-task-item:hover {
  background: var(--hover);
}

.gw-task-item.active {
  background: var(--hover);
  color: var(--text);
}

.gw-task-item.offline {
  opacity: 0.45;
  cursor: not-allowed;
}

.gw-task-item.offline:hover {
  background: transparent;
}

.gw-task-dot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border);
}

.gw-task-dot.running {
  background: var(--accent);
}

/* a run is blocked on user input (approval / questionnaire) */
.gw-task-dot.attention {
  background: var(--warning);
  animation: gw-step-pulse 1.4s ease-in-out infinite;
}

/* finished while the user was elsewhere; cleared on open */
.gw-task-dot.unseen {
  background: var(--accent);
}

.gw-task-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gw-task-tag {
  flex-shrink: 0;
  font-size: 10px;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--text-tertiary);
}

.gw-task-del {
  visibility: hidden;
  border: none;
  background: none;
  color: var(--text-secondary);
  font-size: 14px;
  padding: 0 4px;
  border-radius: 4px;
  cursor: pointer;
}

/* hover-only reveal: on touch screens iOS turns a tap that changes hovered
   content into a hover instead of a click, so the row would need two taps */
@media (hover: hover) {
  .gw-task-item:hover .gw-task-del {
    visibility: visible;
  }
}

@media (hover: none) {
  .gw-task-item.active .gw-task-del {
    visibility: visible;
  }
}

.gw-task-del:hover {
  color: var(--text);
}

/* ── permission approval card ─────────────────────────────── */

.gw-perm {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}

.gw-perm-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.gw-perm-badge {
  flex: none;
  font-size: 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 8px;
  color: var(--text-secondary);
}

.gw-perm-what {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

.gw-perm-kind {
  flex: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--surface-subtle);
  color: var(--text-secondary);
}

/* command / pattern previews: monospace, highlighted for bash asks */
.gw-perm-code {
  margin: 0;
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--surface-subtle);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 160px;
  overflow-y: auto;
}

.gw-perm-patterns {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gw-perm-pattern {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--surface-subtle);
  color: var(--text);
  word-break: break-all;
}

.gw-perm-file {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  color: var(--text-muted);
  word-break: break-all;
}

.gw-perm .gw-diff {
  max-height: 200px;
  overflow-y: auto;
  background: var(--surface-subtle);
  padding: 4px 0;
}

.gw-perm-actions {
  display: flex;
  gap: 8px;
}

.gw-perm-actions button {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  padding: 4px 10px;
  cursor: pointer;
}

.gw-perm-actions button:hover:not(:disabled) {
  background: var(--hover);
}

.gw-perm-actions button:disabled {
  opacity: 0.5;
  cursor: default;
}

.gw-perm-deny {
  color: var(--text-secondary);
}

.gw-perm-result {
  color: var(--text-secondary);
  font-size: 12px;
}

/* ── delegated-task list ──────────────────────────────────── */

.gw-tasks-toggle {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 12px;
  padding: 2px 10px;
  cursor: pointer;
  margin-left: auto;
  margin-right: 8px;
}

.gw-tasks-toggle:hover,
.gw-tasks-toggle-on {
  background: var(--hover);
  color: var(--text);
}

.gw-tasks {
  border-bottom: 1px solid var(--border-subtle);
  padding: 6px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 200px;
  overflow-y: auto;
}

.gw-task-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 4px 6px;
  border-radius: 8px;
}

.gw-task-row:hover {
  background: var(--hover);
}

.gw-task-icon {
  flex: none;
  width: 16px;
  text-align: center;
  color: var(--text-secondary);
}

.gw-task-main {
  display: flex;
  min-width: 0;
  flex: 1;
  gap: 8px;
  align-items: baseline;
}

.gw-task-title {
  color: var(--text);
  white-space: nowrap;
}

.gw-task-summary {
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gw-task-skill {
  flex: none;
  font-size: 11px;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 0 7px;
}

.gw-task-resume {
  flex: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 11.5px;
  padding: 2px 9px;
  cursor: pointer;
}

.gw-task-resume:hover {
  background: var(--hover);
}

/* quiet "peek at the draft" entries while a generation task is still running */
.gw-draft-peek-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.gw-draft-peek {
  border: 1px dashed var(--border);
  border-radius: 999px;
  background: none;
  color: var(--text-tertiary);
  font: inherit;
  font-size: 12px;
  padding: 2px 10px;
  cursor: pointer;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gw-draft-peek:hover {
  color: var(--text);
  background: var(--hover);
}

/* in-document selection chip on a user message (turn-scoped, not a file) */
.ai-attachment-selection {
  align-items: center;
  gap: 6px;
}

.ai-attachment-selection-mark {
  color: var(--text-tertiary);
  font-size: 16px;
  line-height: 1;
}

/* assistant bubbles in the shared stream render markdown */
.gw-assistant {
  white-space: normal;
}

.gw-assistant .ai-md > :first-child {
  margin-top: 0;
}

.gw-assistant .ai-md > :last-child {
  margin-bottom: 0;
}

/* markdown inside assistant bubbles (shared Markdown component base styles) */
.gw-assistant .ai-md p,
.gw-assistant .ai-md ul,
.gw-assistant .ai-md ol {
  margin: 0 0 0.9em;
}

.gw-assistant .ai-md ul,
.gw-assistant .ai-md ol {
  padding-left: 18px;
}

.gw-assistant .ai-md .ai-md-h {
  font-weight: 700;
  margin: 1.2em 0 0.4em;
}

.gw-assistant .ai-md code {
  border-radius: 4px;
  padding: 1px 5px;
  background: var(--surface-subtle);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.gw-assistant .ai-md .ai-md-link {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
}

.gw-assistant .ai-md .ai-md-link:hover {
  text-decoration-color: var(--accent);
}

.gw-assistant .ai-md .ai-md-nav {
  color: var(--accent);
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
}

/* code panel: file bar with its own git buttons, hunk bars, PR bar */
.gw-code-file-bar {
  display: flex;
  align-items: stretch;
  background: var(--surface-subtle);
}

.gw-code-file-bar .gw-code-file-head {
  flex: 1;
  min-width: 0;
}

.gw-code-file-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
  flex: none;
}

@media (hover: hover) {
  .gw-code-file-actions {
    display: none;
  }

  .gw-code-file-bar:hover .gw-code-file-actions,
  .gw-code-file-bar:focus-within .gw-code-file-actions {
    display: inline-flex;
  }
}

.gw-code-mini {
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.4;
  padding: 1px 7px;
  cursor: pointer;
  white-space: nowrap;
}

.gw-code-mini:hover:not(:disabled) {
  background: var(--hover);
  color: var(--text);
}

.gw-code-mini:disabled {
  opacity: 0.5;
  cursor: default;
}

.gw-code-mini-danger:hover:not(:disabled) {
  color: var(--danger);
  border-color: var(--danger-border);
}

.gw-code-staged-badge {
  flex: none;
  font-size: 10px;
  padding: 0 5px;
  border-radius: 4px;
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success-border);
}

.gw-code-staged-count {
  color: var(--success);
}

.gw-code-hunk + .gw-code-hunk {
  border-top: 1px solid var(--border-subtle);
}

.gw-code-hunk-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 11px;
  color: var(--text-tertiary);
}

.gw-code-hunk-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono, ui-monospace, monospace);
}

.gw-pr-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 12px;
  color: var(--text-secondary);
}

.gw-pr-link {
  flex: none;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.gw-pr-link:hover {
  text-decoration: underline;
}

.gw-pr-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gw-pr-state {
  flex: none;
}

.gw-pr-failed .gw-pr-state {
  color: var(--danger);
}

.gw-pr-passed .gw-pr-state {
  color: var(--success);
}

/* status dots: PR bar */
.gw-pr-dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-tertiary);
}

.gw-pr-dot-passed {
  background: var(--success);
}

.gw-pr-dot-pending {
  background: var(--warning);
}

.gw-pr-dot-failed {
  background: var(--danger);
}

/* files tab: spot edits */
.gw-code-view-head {
  display: flex;
  align-items: center;
  gap: 6px;
}

.gw-code-view-path {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gw-code-dirty {
  color: var(--accent);
}

.gw-code-editor {
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: 6px 10px;
  border: 0;
  outline: none;
  resize: none;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 12px;
  line-height: 1.6;
  tab-size: 4;
  white-space: pre;
}

/* code header: ⋯ menu */
.gw-head-menu {
  position: relative;
  display: inline-flex;
}

/* beats .row-menu's own min-width regardless of stylesheet order */
.gw-head-menu .gw-head-menu-list {
  left: auto;
  right: 0;
  min-width: 300px;
}

.gw-head-menu-item {
  display: flex !important;
  flex-direction: column;
  align-items: flex-start !important;
  gap: 2px;
}

.gw-head-menu-on {
  background: var(--bg-hover-accent);
}

.gw-head-menu-label {
  color: var(--text);
  font-size: 13px;
}

.gw-head-menu-hint {
  color: var(--text-tertiary);
  font-size: 11px;
  white-space: normal;
  text-align: left;
}

.gw-mono {
  font-family: var(--font-mono, ui-monospace, monospace);
}

/* plan-only mode: bar above the composer */
.gw-plan-bar {
  width: 100%;
  max-width: 760px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  margin-bottom: 6px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: var(--bg-hover-accent);
  font-size: 12px;
  color: var(--text);
}

.gw-plan-bar-text {
  flex: 1;
  min-width: 0;
}

/* @ mention picker over the composer */
.gw-composer {
  position: relative;
}

.gw-mention-pop {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(100% + 6px);
  z-index: 30;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-modal-strong);
  padding: 4px;
  max-height: 280px;
  overflow: auto;
}

.gw-mention-item {
  width: 100%;
  display: flex;
  align-items: baseline;
  gap: 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  padding: 5px 8px;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  font-family: var(--font-mono, ui-monospace, monospace);
}

.gw-mention-on {
  background: var(--hover);
}

.gw-mention-dir {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-tertiary);
  font-size: 11px;
}

.gw-mention-hint {
  padding: 4px 8px 2px;
  font-size: 11px;
  color: var(--text-tertiary);
  border-top: 1px solid var(--border-subtle);
  margin-top: 2px;
}

/* right-click menu on project files */
.gw-ctx-menu {
  position: fixed;
  top: auto;
  right: auto;
  z-index: 60;
  min-width: 200px;
}

.gw-ctx-path {
  padding: 4px 10px 6px;
  font-size: 11px;
  color: var(--text-tertiary);
  font-family: var(--font-mono, ui-monospace, monospace);
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 4px;
}

.gw-code-toast {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 40;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--text);
  color: var(--surface);
  font-size: 12px;
  pointer-events: none;
}

.gw-code-panel {
  position: relative;
}

/* shortcuts sheet */
.gw-shortcuts {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin: 8px 0 12px;
}

.gw-shortcuts td {
  padding: 6px 4px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text);
}

.gw-shortcuts td:last-child {
  text-align: right;
}

.gw-shortcuts kbd {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 12px;
  padding: 1px 7px;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--surface-subtle);
  color: var(--text-secondary);
}

/* ---- phones: the document takes the whole viewport over the chat ---- */

@media (max-width: 760px) {
  .gw-with-preview > .gw-home.gw-open {
    min-width: 0;
  }

  .gw-splitter {
    display: none;
  }

  .gw-preview,
  .gw-preview-sized > .gw-preview {
    position: fixed;
    inset: 40px 0 0;
    /* under the document iframe layer (5), over the chat */
    z-index: 4;
    flex: none;
    min-width: 0;
    border: 0;
    border-radius: 0;
  }

  .gw-preview-head .gw-icon-btn {
    width: 36px;
    height: 36px;
    font-size: 22px;
  }
}

/* html artifact embedded in the conversation (scaled live preview) */
.gw-inline-art {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
}

.gw-inline-art-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 13px;
}

.gw-inline-art-head img {
  width: 18px;
  height: 18px;
  flex: none;
}

.gw-inline-art-title {
  flex: 1;
  min-width: 0;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gw-inline-art-btn {
  flex: none;
  padding: 3px 8px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--text-secondary);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.gw-inline-art-btn:hover {
  background: var(--hover);
  color: var(--text);
}

.gw-inline-art-stage {
  position: relative;
  min-height: 120px;
  border-top: 1px solid var(--border-subtle);
  overflow: hidden;
}

.gw-inline-art-frame {
  display: block;
  border: 0;
  transform-origin: 0 0;
}

/* ── sidebar task row menu (⋯ / right-click) ─────────────── */

.gw-task-del svg {
  display: block;
  width: 14px;
  height: 14px;
}

@media (hover: hover) {
  .gw-task-item.menu-open .gw-task-del {
    visibility: visible;
  }
}

.gw-task-ctx {
  position: fixed;
  top: auto;
  right: auto;
  width: max-content;
  min-width: 220px;
  max-width: 300px;
  z-index: 60;
}

.row-menu .gw-task-ctx-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 10px;
  border: none;
  border-radius: 6px;
  background: none;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.gw-task-ctx-item svg {
  flex: none;
  color: var(--text-secondary);
}

.gw-task-ctx-item:hover:not(:disabled) {
  background: var(--surface-subtle);
}

.gw-task-ctx-item:disabled {
  opacity: 0.45;
  cursor: default;
}

.gw-task-ctx-item.danger,
.gw-task-ctx-item.danger svg {
  color: var(--danger);
}

.gw-task-ctx-item.danger:hover:not(:disabled) {
  background: var(--danger-bg);
}

.gw-task-ctx-label {
  flex: 1;
}

.gw-task-ctx-keys {
  font: inherit;
  font-size: 12px;
  color: var(--text-tertiary);
}

.gw-task-archived-chip {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 2px 10px 6px;
  padding: 3px 8px;
  border: none;
  border-radius: 6px;
  background: var(--hover);
  color: var(--text-secondary);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.gw-task-archived-chip:hover {
  color: var(--text);
}

.gw-task-archived .gw-task-item {
  opacity: 0.7;
}

.gw-task-info {
  max-width: 560px;
}

.gw-task-info dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 16px;
  margin: 12px 0 0;
  font-size: 13px;
}

.gw-task-info dt {
  color: var(--text-secondary);
  white-space: nowrap;
}

.gw-task-info dd {
  margin: 0;
  overflow-wrap: anywhere;
  user-select: text;
}
/* workbench page: bar / stage, or bar / chat | splitter | stage in edit mode */

/* .content.wb-page: outrank .content's page padding regardless of stylesheet order */
.content.wb-page {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.wb-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface);
}

.wb-bar .wb-dot {
  width: 8px;
  height: 8px;
}

.wb-bar-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.wb-bar-desc,
.wb-bar-error {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: var(--text-secondary);
}

.wb-bar-error {
  color: var(--danger);
}

.wb-bar-spacer {
  flex: 1;
}

.wb-bar-btn {
  height: 30px;
  padding: 0 12px;
  font-size: 13px;
  border-radius: 8px;
}

.wb-bar-btn.wb-on {
  background: var(--hover);
  color: var(--text);
}

.wb-bar-ghost {
  border: none;
  background: none;
  color: var(--text-secondary);
}

.wb-bar-ghost:hover:not(:disabled) {
  background: var(--hover);
  color: var(--text);
}

.wb-bar-strong {
  color: var(--text);
  font-weight: 600;
}

.wb-menu-sep {
  height: 1px;
  margin: 4px 2px;
  background: var(--border-subtle);
}

.wb-bar-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.wb-bar-more {
  width: 30px;
  padding: 0;
  box-sizing: border-box;
  justify-content: center;
}

.wb-bar-more svg {
  flex: none;
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.wb-bar-hint {
  display: inline-flex;
}

.wb-menu-label {
  padding: 8px 10px 2px;
  font-size: 11px;
  color: var(--text-tertiary);
}

.wb-menu-stamp {
  font-variant-numeric: tabular-nums;
}

.wb-menu button:disabled {
  color: var(--text-tertiary);
  cursor: default;
}

.wb-history {
  position: relative;
  display: inline-flex;
}

.wb-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  min-width: 180px;
  max-height: 260px;
  overflow: auto;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-menu);
}

.wb-menu button {
  display: block;
  width: 100%;
  padding: 7px 10px;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--text);
  font:
    12px/1.3 ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
  text-align: left;
  cursor: pointer;
}

.wb-menu button:hover:not(:disabled) {
  background: var(--hover);
}

.wb-menu-text button {
  font: inherit;
  font-size: 13px;
  white-space: nowrap;
}

.wb-remote {
  width: 280px;
  max-height: none;
  padding: 14px;
  cursor: default;
}

.wb-remote p {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
}

.wb-remote a {
  font-size: 13px;
  color: var(--accent);
}

.wb-remote-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}

.wb-remote-qr {
  /* a QR code must stay dark-on-white to scan, in both themes */
  --wb-qr-paper: #fff;
  width: 160px;
  height: 160px;
  margin: 12px auto 8px;
  padding: 8px;
  background: var(--wb-qr-paper);
  border-radius: 8px;
}

.wb-remote-qr svg {
  display: block;
  width: 100%;
  height: 100%;
}

.wb-remote-url {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  word-break: break-all;
  color: var(--text-secondary);
}

.wb-remote .wb-remote-hint {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--text-tertiary);
}

.wb-remote-error {
  color: var(--danger);
}

.wb-bar-note {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.wb-rail-import {
  margin-left: auto;
  padding: 0 6px;
  border: none;
  background: none;
  font-size: 11px;
  color: var(--text-tertiary);
  cursor: pointer;
}

.wb-rail-import:hover {
  color: var(--text);
}

.wb-rail-head {
  display: flex;
  align-items: center;
}

.wb-rail-error {
  padding: 2px 10px 6px;
  font-size: 11px;
  color: var(--danger);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wb-body {
  display: flex;
  flex: 1;
  min-height: 0;
}

.wb-stage {
  position: relative;
  flex: 1;
  min-width: 0;
  background: var(--bg-content);
}

.wb-frame-box {
  position: absolute;
  inset: 0;
  transform-origin: 0 0;
}

.wb-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: none;
  background: var(--surface);
}

.wb-placeholder {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-secondary);
}

.wb-placeholder h2 {
  margin: 0;
  font-size: 16px;
  color: var(--text);
}

.wb-placeholder p {
  margin: 0 0 8px;
  font-size: 13px;
}

.wb-logs {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  max-height: 40%;
  margin: 0;
  padding: 10px 12px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-secondary);
  font:
    12px/1.5 ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
  white-space: pre-wrap;
}

.wb-chat {
  display: flex;
  flex-direction: column;
  flex: 2 1 0;
  min-width: 300px;
  min-height: 0;
  padding: 8px 0 12px 12px;
}

.wb-chat > .gw-workspace {
  flex: 1;
  min-height: 0;
  --gw-col-max: none;
}

.wb-editing .wb-stage {
  flex: 3 1 0;
  min-width: 380px;
  margin: 12px 12px 12px 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

/* user-dragged split: the stage keeps its width, the chat takes the rest */
.wb-editing[style*='--wb-stage-w'] .wb-chat {
  flex: 1 1 0;
}

.wb-editing[style*='--wb-stage-w'] .wb-stage {
  flex: 0 1 var(--wb-stage-w);
}

.wb-chat-empty {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  flex: 1;
  padding: 0 12px 4px 4px;
}

.wb-composer {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 12px 10px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}

.wb-composer:focus-within {
  border-color: var(--accent);
}

.wb-composer textarea {
  resize: none;
  min-height: 44px;
  max-height: 160px;
  padding: 4px 4px 0;
  border: none;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  outline: none;
}

.wb-send {
  align-self: flex-end;
  padding: 6px 12px;
}

/* edit mode: element picking over the app frame */
.wb-bar-tools {
  display: inline-flex;
  gap: 2px;
  margin-right: 6px;
  padding-right: 8px;
  border-right: 1px solid var(--border-subtle);
}

.wb-bar-tools .wb-bar-btn {
  gap: 6px;
}

.wb-bar-tools svg {
  flex: none;
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wb-draw {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 6;
  cursor: crosshair;
  touch-action: none;
}

.wb-draw path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.85;
}

.wb-ask {
  position: fixed;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 340px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-menu);
}

.wb-ask-target {
  display: flex;
  gap: 6px;
  min-width: 0;
  font-size: 12px;
  color: var(--text-secondary);
}

.wb-ask-target code {
  flex: none;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--hover);
  color: var(--text);
  font-size: 11px;
}

.wb-ask-target span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wb-ask-close {
  margin-left: auto;
  padding: 0 4px;
  border: none;
  background: none;
  color: var(--text-tertiary);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.wb-ask-close:hover {
  color: var(--text);
}

.wb-chat-empty .gw-queue {
  margin-bottom: 8px;
}

.wb-ask textarea {
  resize: none;
  min-height: 56px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-content);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  outline: none;
}

.wb-ask textarea:focus {
  border-color: var(--border-hover);
}

.wb-ask-row {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}
/* Connector management page (catalog + custom MCP cards) */

.con-page {
  max-width: 920px;
  margin: 0 auto;
  padding: 40px 48px 32px;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.con-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.con-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 6px;
}

.con-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}

.con-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.con-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.con-card.off {
  background: var(--surface-subtle);
}

.con-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.con-card-avatar {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--bg-hover-accent);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.con-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.con-card-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--text-tertiary);
  white-space: nowrap;
}

.con-card-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0;
  min-height: 30px;
}

.con-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 11px;
  color: var(--text-tertiary);
}

.con-card-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.con-switch {
  width: 32px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface-subtle);
  position: relative;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.con-switch-thumb {
  position: absolute;
  top: 1px;
  left: 1px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--icon-muted);
  transition: transform 0.15s ease;
}

.con-switch.on {
  background: var(--success-bg);
  border-color: var(--success-border);
}

.con-switch.on .con-switch-thumb {
  transform: translateX(14px);
  background: var(--success);
}

.con-card-state {
  font-size: 12px;
  color: var(--text-tertiary);
  flex: 1;
  white-space: nowrap;
}

.con-card-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: auto;
}

.con-card-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 12px;
  white-space: nowrap;
  color: var(--text-secondary);
  cursor: pointer;
}

.con-card-btn:hover {
  background: var(--hover);
  color: var(--text-primary);
}

.con-card-btn.danger:hover {
  color: var(--danger);
  border-color: var(--danger-border);
}

.con-hint {
  margin-top: 20px;
  font-size: 12px;
  color: var(--text-tertiary);
}

.con-modal {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 380px;
}

.con-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.con-input {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 400;
  font-size: 13px;
  padding: 8px 10px;
}

.con-input:focus {
  outline: none;
  border-color: var(--border-strong);
}

.con-field-hint {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-tertiary);
}

.con-form-error {
  color: var(--danger);
  font-size: 13px;
  margin: 0;
}

.con-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.con-toolbar .skl-cats {
  flex: 1;
  min-width: 0;
  margin: 0;
  flex-wrap: wrap;
  row-gap: 4px;
}

.con-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.con-search {
  width: 200px;
}

.con-card-meta > span {
  white-space: nowrap;
}

.con-card-badge.setup {
  color: var(--warning);
  border-color: var(--warning);
}

.con-empty {
  padding: 40px 0;
  text-align: center;
  font-size: 13px;
  color: var(--text-tertiary);
}

.con-setup {
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-secondary);
  background: var(--surface-subtle);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 0;
}

.con-setup a {
  color: var(--accent);
  margin-left: 6px;
  white-space: nowrap;
}

.con-modal .con-params {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.con-card-badge.ok {
  color: var(--success);
  border-color: var(--success-border);
}

.con-card-badge.bad {
  color: var(--danger);
  border-color: var(--danger-border);
}

.con-card-btn.primary {
  background: var(--text-primary);
  border-color: var(--text-primary);
  color: var(--surface);
}

.con-card-btn.primary:hover {
  background: var(--text-primary);
  color: var(--surface);
  opacity: 0.85;
}

.con-card-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.con-card-error {
  margin: 0;
  font-size: 11px;
  color: var(--danger);
}

.con-section {
  margin-bottom: 28px;
}

.con-section-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.con-section-count {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-tertiary);
}
/* Third-party opencode plugin page: reuses the connector card styles */

.plg-spec {
  font-family: var(--font-mono, ui-monospace, monospace);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.plg-error {
  margin: 0;
  padding: 6px 8px;
  border: 1px solid var(--danger-border);
  border-radius: 6px;
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 11px;
  font-family: var(--font-mono, ui-monospace, monospace);
  text-align: left;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 180px;
  overflow: auto;
  cursor: pointer;
}

.plg-banner {
  margin: 0 0 20px;
  padding: 10px 12px;
  border: 1px solid var(--danger-border);
  border-radius: 8px;
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 12px;
}

.plg-trust-spec {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--surface-subtle);
  word-break: break-all;
}
/* Message channel page: catalog of channel kinds, each card listing its connections */

.ch-logo {
  --ch-brand-telegram: #27a7e7;
  --ch-brand-feishu: #3370ff;
  --ch-brand-feishu-2: #14c0ff;
  --ch-brand-slack-1: #e01e5a;
  --ch-brand-slack-2: #36c5f0;
  --ch-brand-slack-3: #2eb67d;
  --ch-brand-slack-4: #ecb22e;
  --ch-brand-wecom: #2b7bd6;
  --ch-brand-wecom-2: #12b76a;
  --ch-brand-whatsapp: #25d366;
  --ch-brand-hook: #6b7280;
  --ch-brand-wechat: #07c160;
  --ch-brand-discord: #5865f2;
  --ch-brand-dingtalk: #0089ff;
}

.ch-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.ch-section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.ch-section-desc {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

.ch-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

@media (max-width: 760px) {
  .ch-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.ch-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 124px;
}

.ch-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ch-logo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  display: block;
}

.ch-card-title {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ch-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ch-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.ch-tag {
  font-size: 10px;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--text-tertiary);
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ch-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--text-tertiary);
  white-space: nowrap;
}

.ch-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--icon-muted);
  flex-shrink: 0;
}

.ch-status.ok {
  color: var(--success);
}

.ch-status.ok::before {
  background: var(--success);
}

.ch-status.wait,
.ch-status.hold,
.ch-status.relogin {
  color: var(--accent);
}

.ch-status.relogin::before {
  background: var(--accent);
}

.ch-status.wait::before,
.ch-status.hold::before {
  background: var(--accent);
  animation: ch-pulse 1.4s ease-in-out infinite;
}

.ch-status.bad {
  color: var(--danger);
}

.ch-status.bad::before {
  background: var(--danger);
}

@keyframes ch-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

.ch-card-desc {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary);
  margin: 0;
}

.ch-connect {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  border-radius: 8px;
  padding: 5px 14px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.ch-connect:hover {
  background: var(--hover);
}

.ch-connect.primary {
  background: var(--text-primary);
  border-color: var(--text-primary);
  color: var(--surface);
}

.ch-connect.primary:hover {
  opacity: 0.85;
}

.ch-rows {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
  margin-top: 2px;
}

.ch-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}

.ch-row:last-child {
  border-bottom: 0;
}

.ch-row-main {
  flex: 1 1 160px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ch-row-name {
  font-size: 13px;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ch-row-name .ch-status {
  margin-left: 8px;
}

.ch-row-sub {
  font-size: 11.5px;
  color: var(--text-tertiary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ch-row-sub.bad {
  color: var(--danger);
}

.ch-row-sub.bad,
.ch-row-sub.relogin {
  white-space: normal;
}

.ch-row-actions {
  display: inline-flex;
  gap: 4px;
  flex-shrink: 0;
  margin-left: auto;
}

.ch-row-btn {
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}

.ch-row-btn:hover {
  background: var(--hover);
  color: var(--text-primary);
}

.ch-row-btn.danger:hover {
  color: var(--danger);
}

.ch-row-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.ch-more {
  align-self: flex-start;
  border: 0;
  background: transparent;
  color: var(--text-tertiary);
  font-size: 12px;
  padding: 0;
  cursor: pointer;
}

.ch-more:hover {
  color: var(--accent);
}

.ch-cmds {
  margin-top: 32px;
}

.ch-away {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

.ch-away-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ch-away-sub {
  padding-left: 24px;
}

.ch-away-select {
  margin-left: 4px;
  font-size: 12.5px;
}

.ch-cmd-table {
  margin-top: 6px;
  border-collapse: collapse;
  font-size: 13px;
}

.ch-cmd-table td {
  padding: 6px 20px 6px 0;
  vertical-align: top;
  color: var(--text-secondary);
  line-height: 1.5;
  border-bottom: 1px solid var(--border-subtle);
}

.ch-cmd-table tr:last-child td {
  border-bottom: none;
}

.ch-cmd-table code {
  white-space: nowrap;
  color: var(--text-primary);
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 12.5px;
}

.ch-dialog {
  width: 440px;
  max-width: calc(100vw - 48px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ch-dialog-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ch-dialog-head h3 {
  margin: 0;
  flex: 1;
}

.ch-guide {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-secondary);
  background: var(--surface-subtle);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 0;
  white-space: pre-line;
}

.ch-seg {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px;
  background: var(--surface-subtle);
  align-self: flex-start;
}

.ch-seg button {
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 12.5px;
  cursor: pointer;
}

.ch-seg button.on {
  background: var(--surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-btn-hover);
}

.ch-qr-dialog {
  width: 380px;
}

.ch-qr-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
}

.ch-qr {
  position: relative;
  width: 200px;
  height: 200px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 12px;
}

.ch-qr-svg,
.ch-qr-svg svg {
  width: 100%;
  height: 100%;
  display: block;
}

.ch-qr-mask {
  position: absolute;
  inset: 0;
  border: 0;
  border-radius: 12px;
  background: var(--color-bg-overlay);
  color: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
  padding: 12px;
  text-align: center;
}

.ch-qr-status {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.ch-qr-verify {
  display: flex;
  gap: 8px;
  width: 100%;
}

.ch-qr-verify .con-input {
  flex: 1;
}

.ch-row-sub-item {
  padding-left: 42px;
}

.ch-pending-count {
  font-size: 11.5px;
  color: var(--accent);
  align-self: center;
  padding: 0 6px;
}
/* Artifacts page: every file a task produced, newest first */

.ar-page {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 48px 32px;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.ar-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.ar-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.ar-subtitle {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.ar-filters {
  align-self: flex-start;
  margin-top: 8px;
  height: 36px;
}

.ar-filters button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 13px;
}

.ar-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.ar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.ar-row:hover {
  background: var(--hover);
}

.ar-row-main,
.ar-row-task,
.ar-row-reveal {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: start;
}

.ar-row-main {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.ar-row-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ar-row-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ar-row-meta {
  font-size: 12px;
  color: var(--text-tertiary);
  white-space: nowrap;
}

.ar-row-task {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  column-gap: 8px;
  row-gap: 2px;
  align-items: center;
  justify-items: end;
  max-width: 240px;
  min-width: 0;
  padding: 4px 8px;
  border-radius: 6px;
  flex-shrink: 0;
  color: var(--text-tertiary);
}

.ar-row-task svg {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.ar-row-task-bare {
  display: inline-flex;
  width: 28px;
  height: 28px;
  padding: 0;
  justify-content: center;
}

.ar-row-task:hover {
  color: var(--text);
}

.ar-row-task:hover {
  background: var(--bg-hover-strong);
}

.ar-row-task-label {
  font-size: 11px;
  color: var(--text-tertiary);
}

.ar-row-task-title {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.ar-row-reveal {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.ar-row-reveal:hover {
  background: var(--bg-hover-strong);
  color: var(--text);
}

.ar-empty {
  margin: 0;
  padding: 64px 0;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 14px;
}

.ar-more {
  display: flex;
  justify-content: center;
  padding: 12px 0;
}
/* Global search palette (⌘K): files on disk and past task conversations */

.sp-overlay {
  align-items: flex-start;
  padding-top: 12vh;
}

.sp-panel {
  width: min(680px, 92vw);
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-8);
  box-shadow: var(--shadow-modal-strong);
  animation: menu-in 0.12s ease;
  overflow: hidden;
}

.sp-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
}

.sp-input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-primary);
  font-size: 16px;
}

.sp-input:focus,
.sp-input:focus-visible {
  outline: none;
  box-shadow: none;
}

.sp-input::placeholder {
  color: var(--text-tertiary);
}

.sp-kbd,
.sp-keys kbd {
  font: inherit;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  color: var(--text-tertiary);
  background: var(--hover);
}

.sp-filters {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.sp-seg {
  height: 28px;
}

.sp-seg button {
  padding: 4px 10px;
  font-size: 12px;
}

.sp-exts {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.sp-ext {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-size: 12px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}

.sp-ext:hover {
  background: var(--hover);
}

.sp-ext.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.sp-body {
  flex: 1;
  min-height: 120px;
  overflow-y: auto;
}

.sp-hint {
  margin: 0;
  padding: 32px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-tertiary);
}

.sp-list {
  list-style: none;
  margin: 0;
  padding: 6px;
}

.sp-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.sp-row.active {
  background: var(--hover);
}

.sp-icon {
  flex: 0 0 22px;
  display: flex;
  justify-content: center;
  margin-top: 1px;
}

.sp-task-badge {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: var(--accent);
  background: var(--accent-soft);
}

.sp-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sp-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.sp-name {
  font-size: 14px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sp-sub {
  flex-shrink: 1;
  min-width: 0;
  font-size: 12px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sp-snippet {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sp-hit {
  background: transparent;
  color: var(--accent);
  font-weight: 600;
}

.sp-time {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.sp-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 16px;
  font-size: 12px;
  color: var(--text-tertiary);
  border-top: 1px solid var(--border-subtle);
}

.sp-keys {
  display: flex;
  gap: 4px;
}
/* Expert center (vertical expert packs; reuses .con-switch / .con-card-badge) */

.exp-page {
  max-width: 920px;
  margin: 0 auto;
  padding: 40px 48px 32px;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.exp-header {
  margin-bottom: 24px;
}

.exp-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 6px;
}

.exp-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}

.exp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.exp-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.exp-card.off {
  background: var(--surface-subtle);
}

.exp-card.off .exp-card-name,
.exp-card.off .exp-card-desc {
  color: var(--text-tertiary);
}

.exp-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.exp-card-avatar {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--bg-hover-accent);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.exp-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exp-summon {
  border: none;
  border-radius: 999px;
  background: var(--color-btn-primary);
  color: var(--color-btn-primary-text);
  font-size: 12px;
  padding: 5px 14px;
  cursor: pointer;
  flex-shrink: 0;
}

.exp-summon:hover:not(:disabled) {
  background: var(--color-btn-primary-hover);
}

.exp-summon:disabled {
  opacity: 0.4;
  cursor: default;
}

.exp-card-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0;
  min-height: 30px;
}

.exp-card-desc.error {
  color: var(--danger);
}

.exp-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.exp-card-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-tertiary);
}

.exp-card-quick {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.exp-card-quick-label {
  font-size: 11px;
  color: var(--text-tertiary);
}

.exp-card-quick-btn {
  text-align: start;
  border: 1px dashed var(--border);
  background: none;
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
}

.exp-card-quick-btn:hover:not(:disabled) {
  background: var(--hover);
  color: var(--text-primary);
}

.exp-card-quick-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.exp-card-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 6px;
}

.exp-card-state {
  font-size: 12px;
  color: var(--text-tertiary);
  flex: 1;
}

.exp-engines {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
}

.exp-engines-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 4px;
}

.exp-engines-hint {
  font-size: 12px;
  color: var(--text-tertiary);
  margin: 0 0 12px;
}

.exp-engine-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
}

.exp-engine-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--surface-subtle);
  padding: 12px;
}

.exp-engine-card img {
  width: 24px;
  height: 24px;
}

.exp-engine-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.exp-engine-desc {
  font-size: 11px;
  color: var(--text-tertiary);
  min-height: 28px;
}

.exp-engine-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--text-tertiary);
}

.exp-hint {
  margin-top: 20px;
  font-size: 12px;
  color: var(--text-tertiary);
}

/* skills tab (unified world-skill registry) */

.skl-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.skl-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--border-subtle);
}

.skl-row.off .skl-row-name {
  color: var(--text-tertiary);
}

.skl-row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.skl-row-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  font-family: var(--gs-font-sans);
}

.skl-row-desc {
  font-size: 12px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.skl-row-desc.error {
  color: var(--danger);
  white-space: normal;
}

.skl-row-actions {
  display: inline-flex;
  gap: 6px;
}

.skl-open-dir {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  color: var(--text-secondary);
  text-decoration: underline;
  cursor: pointer;
}

.skl-open-dir:hover {
  color: var(--text-primary);
}

/* market-style header, filters, skill cards, detail drawer */

.exp-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.exp-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.skl-search {
  width: 220px;
  height: 32px;
  font-size: 13px;
}

.skl-add {
  height: 32px;
  font-size: 13px;
  padding: 0 14px;
}

.skl-menu-anchor {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}

.skl-menu {
  top: calc(100% + 4px);
}

.skl-menu-btn {
  border: none;
  background: none;
  border-radius: 6px;
  width: 26px;
  height: 26px;
  font-size: 14px;
  color: var(--text-tertiary);
  cursor: pointer;
}

.skl-menu-btn:hover,
.skl-menu-btn[aria-expanded='true'] {
  background: var(--hover);
  color: var(--text-primary);
}

/* category tabs: plain text, active = dark pill, one line that scrolls
   sideways rather than wrapping; "my installs" is pinned to the right */
.skl-cats {
  display: flex;
  gap: 2px;
  margin: -2px 0 16px;
  overflow-x: auto;
  scrollbar-width: none;
}

.skl-cat-installed {
  margin-left: auto;
  flex-shrink: 0;
  padding-left: 25px;
  background: linear-gradient(var(--border), var(--border)) 6px 50% / 1px 14px no-repeat;
}

.skl-cats::-webkit-scrollbar {
  display: none;
}

.skl-cat {
  border: none;
  background: none;
  padding: 6px 13px;
  border-radius: 999px;
  font: inherit;
  font-size: 14px;
  color: var(--text-secondary);
  white-space: nowrap;
  cursor: pointer;
}

.skl-cat:hover {
  color: var(--text);
  background: var(--hover);
}

.skl-cat.active {
  background: var(--text-primary);
  color: var(--surface);
  font-weight: 600;
}

/* two large entry cards at the top of Featured: browser connector, cloud computer */
.skl-hero-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

.skl-hero {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 18px 20px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--surface-subtle);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.skl-hero:hover {
  border-color: var(--border);
  background: var(--hover);
}

.skl-hero-tag {
  font-size: 12px;
  color: var(--text-tertiary);
}

.skl-hero-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.skl-hero-desc {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.skl-notice {
  margin-bottom: 14px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  border: 1px solid var(--success-border);
  background: var(--success-bg);
  color: var(--text-primary);
}

.skl-notice.error {
  border-color: var(--danger-border);
  background: var(--danger-bg);
  color: var(--danger);
}

.skl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.skl-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: border-color var(--transition-fast);
}

.skl-card:hover {
  border-color: var(--border-hover);
}

.skl-card.off {
  background: var(--surface-subtle);
}

.skl-card.off .skl-card-name {
  color: var(--text-tertiary);
}

.skl-card.broken {
  border-color: var(--danger-border);
}

.skl-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.skl-card-title {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
}

.skl-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  font-family: var(--gs-font-sans);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.skl-pill {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--surface-subtle);
  color: var(--text-tertiary);
  white-space: nowrap;
}

.skl-card-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0;
  min-height: 34px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.skl-card-desc.error {
  color: var(--danger);
}

.skl-card-meta {
  display: flex;
  gap: 10px;
  font-size: 11px;
  color: var(--text-tertiary);
}

.skl-card-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 6px;
}

.skl-empty {
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 32px 24px;
  text-align: center;
}

.skl-empty h3 {
  margin: 0 0 6px;
  font-size: 15px;
  color: var(--text-primary);
}

.skl-empty p {
  margin: 0 0 14px;
  font-size: 12px;
  color: var(--text-tertiary);
}

.skl-empty-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.skl-fold {
  margin-top: 20px;
}

.skl-fold-head {
  display: flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: none;
  padding: 4px 0;
  margin-bottom: 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
}

.skl-fold-head::before {
  content: '';
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentcolor;
  border-bottom: 1.5px solid currentcolor;
  transform: rotate(-45deg);
  transition: transform 150ms;
}

.skl-fold-head[aria-expanded='true']::before {
  transform: rotate(45deg);
}

.skl-fold-head:hover {
  color: var(--text-primary);
}

.skl-empty-text {
  font-size: 13px;
  color: var(--text-tertiary);
  padding: 24px 0;
  text-align: center;
}

.skl-drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: var(--color-bg-overlay);
  display: flex;
  justify-content: flex-end;
}

.skl-drawer {
  width: min(520px, 92vw);
  height: 100%;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-modal-strong);
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: drawer-in 0.15s ease;
}

@keyframes drawer-in {
  from {
    transform: translateX(24px);
    opacity: 0;
  }
}

.skl-drawer-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.skl-drawer-title {
  flex: 1;
  min-width: 0;
}

.skl-drawer-title h2 {
  margin: 0 0 4px;
  font-size: 18px;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

.skl-drawer-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.skl-drawer-close {
  border: none;
  background: none;
  font-size: 20px;
  line-height: 1;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
}

.skl-drawer-close:hover {
  background: var(--hover);
  color: var(--text-primary);
}

.skl-drawer-desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.skl-drawer-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.skl-drawer-meta {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 14px;
  margin: 0;
  font-size: 12px;
}

.skl-drawer-meta dt {
  color: var(--text-tertiary);
}

.skl-drawer-meta dd {
  margin: 0;
  color: var(--text-secondary);
  min-width: 0;
}

.skl-path {
  overflow-wrap: anywhere;
  font-family: ui-monospace, monospace;
  font-size: 11px;
}

.skl-drawer-list {
  margin: 0;
  padding-left: 16px;
}

.skl-drawer-list.mono {
  font-family: ui-monospace, monospace;
  font-size: 11px;
}

.skl-drawer-section {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-primary);
}

.skl-drawer-body {
  margin: 0;
  padding: 12px;
  border-radius: 8px;
  background: var(--surface-subtle);
  border: 1px solid var(--border-subtle);
  font-family: ui-monospace, monospace;
  font-size: 11.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--text-secondary);
}

/* public skills: risk pills, catalog cards, url import, findings */

.skl-pill.risk-caution {
  background: var(--warning);
  color: var(--color-btn-primary-text);
}

.skl-pill.risk-dangerous {
  background: var(--danger);
  color: var(--color-btn-primary-text);
}

.skl-pill.unavailable {
  background: var(--hover);
  color: var(--text-muted);
}

.skl-origin {
  font-family: ui-monospace, monospace;
  font-size: 10.5px;
  color: var(--text-tertiary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.skl-catalog-card {
  cursor: default;
}

/* long publisher badges (owner/repo) yield to the skill name */
.skl-catalog-card .con-card-badge {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.skl-catalog-card .skl-card-title {
  flex: 1 0 auto;
  max-width: 70%;
}

.skl-update-note {
  margin: -6px 0 0;
  font-size: 12px;
  color: var(--success);
}

.skl-update-note.error {
  color: var(--danger);
}

.skl-meta-pair {
  display: contents;
}

.skl-url-input {
  width: 100%;
  margin-top: 8px;
}

.skl-url-hint,
.skl-risk-hint {
  margin-top: 8px !important;
  font-size: 12px !important;
  color: var(--text-tertiary) !important;
}

.skl-findings li {
  margin-bottom: 6px;
  overflow-wrap: anywhere;
}

.skl-findings code {
  display: block;
  font-size: 11px;
  color: var(--text-secondary);
}

.skl-finding-level {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  color: var(--color-btn-primary-text);
  background: var(--warning);
}

.skl-finding-level.dangerous {
  background: var(--danger);
}
/* Settings modal (opened from the account menu): two-pane dialog matched to
   GenMail's settings window (values read from its packaged CSS) — borderless
   header/nav, label-left / control-right rows with hairline dividers.
   Chrome colors use semantic tokens only (see CLAUDE.md theming rules). */

.set-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5vh 24px;
  background: var(--color-bg-overlay);
  backdrop-filter: blur(6px);
}

.set-dialog {
  display: flex;
  flex-direction: column;
  width: min(960px, 100%);
  height: min(720px, 90vh);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-modal-strong);
  overflow: hidden;
}

.set-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
}

.set-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.set-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 8px;
  background: none;
  color: var(--text-tertiary);
  cursor: pointer;
}

.set-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.set-body {
  flex: 1;
  min-height: 0;
  display: flex;
}

.set-nav {
  flex-shrink: 0;
  width: 232px;
  padding: 8px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.set-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  background: none;
  font: inherit;
  font-size: 14px;
  font-weight: 400;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
}

.set-nav-item svg {
  flex-shrink: 0;
  color: var(--text-secondary);
}

.set-nav-item:hover:not(.active) {
  background: var(--bg-content);
}

.set-nav-item.active {
  background: var(--bg-hover);
  font-weight: 600;
}

.set-nav-item.active svg {
  color: var(--text-primary);
}

.set-pane {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 8px 28px 24px;
  overflow-y: auto;
}

.set-pane-title {
  margin: 0 0 18px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.set-field {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 52px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.set-field:last-child {
  border-bottom: none;
}

.set-field-text {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.set-field-label {
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 400;
  color: var(--text-primary);
}

.set-field-value {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: right;
  user-select: text;
  word-break: break-all;
}

/* stacked label + secondary description (analytics toggle row) */
.set-field-stack {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.set-field-desc {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-secondary);
}

/* on/off switch (analytics toggle) */
.set-switch {
  position: relative;
  flex-shrink: 0;
  width: 40px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 11px;
  background: var(--bg-hover-strong);
  cursor: pointer;
  transition: background 0.15s ease;
}

.set-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow-modal-strong);
  transition: left 0.15s ease;
}

.set-switch[aria-checked='true'] {
  background: var(--color-btn-primary);
}

.set-switch[aria-checked='true']::after {
  left: 20px;
}

.set-switch:disabled {
  opacity: 0.55;
  cursor: default;
}

/* GenMail-style select pill: the visible layer is just the current value +
   chevron (width hugs the content); the real <select> sits on top invisibly
   and only supplies the click target and the native popup. */
.set-select-wrap {
  position: relative;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
}

.set-select-wrap:hover,
.set-select-wrap:focus-within {
  background: var(--bg-hover);
}

.set-select-text {
  font-size: 14px;
  color: var(--text-primary);
  white-space: nowrap;
}

.set-select-wrap::after {
  content: '';
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  margin-top: -4px;
  border-right: 1.5px solid var(--text-primary);
  border-bottom: 1.5px solid var(--text-primary);
  transform: rotate(45deg);
}

.set-select {
  position: absolute;
  inset: 0;
  opacity: 0;
  font: inherit;
  cursor: pointer;
  /* the element is invisible, but the OS popup that opens on click reads its
     computed color/background to render the option list */
  color: var(--text-primary);
  background: var(--surface);
}

.set-select option {
  color: var(--text-primary);
  background: var(--surface);
}

/* Shared dropdown (@genoffice/ui gs-dd) in settings rows: borderless text
 * trigger matching the old .set-select-wrap look */
.set-dd {
  flex-shrink: 0;
}

.set-dd .gs-dd-btn {
  height: auto;
  gap: 6px;
  padding: 4px 8px;
  border: none;
  border-radius: 6px;
  background: none;
  font-size: 14px;
  color: var(--text-primary);
}

.set-dd .gs-dd-btn:hover,
.set-dd .gs-dd-btn:focus-visible {
  background: var(--bg-hover);
}

.set-dd .gs-dd-pop {
  min-width: 180px;
}

.set-dd .gs-dd-item {
  font-size: 13px;
}

/* brand mark in the AI provider dropdown (trigger value + option rows are
   flex containers from gs-dd); monochrome marks follow the text color */
.set-provider-logo {
  flex-shrink: 0;
  display: inline-flex;
  width: 16px;
  height: 16px;
  margin-right: 8px;
  color: var(--text-primary);
}

.set-provider-logo svg {
  width: 100%;
  height: 100%;
}

.set-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  border: none;
  border-radius: 8px;
  background: var(--bg-hover);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  cursor: pointer;
}

.set-btn:hover {
  background: var(--bg-hover-strong);
}

.set-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.set-btn.primary {
  border-color: var(--color-btn-primary);
  background: var(--color-btn-primary);
  color: var(--color-btn-primary-text);
}

.set-btn.primary:hover {
  background: var(--color-btn-primary-hover);
}

.set-btn.danger {
  color: var(--danger);
}

.set-pane-footer {
  margin-top: auto;
  padding-top: 20px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

/* ── AI model pane ── */

.set-input {
  flex-shrink: 0;
  width: 46%;
  min-width: 200px;
  padding: 6px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  font: inherit;
  font-size: 13px;
  color: var(--text-primary);
  background: var(--surface);
}

.set-num-input {
  width: 64px;
  min-width: 0;
  text-align: right;
}

.set-input:focus {
  outline: none;
  border-color: var(--accent, var(--text-primary));
}

.set-input::placeholder {
  color: var(--text-tertiary);
}

.set-ai-note {
  padding: 8px 0 2px;
  line-height: 1.5;
}

/* footer feedback pill: spinner while testing, green on success/saved, red on failure */
.set-ai-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin-right: auto; /* status hugs the left edge, action buttons stay right */
  padding: 4px 10px 4px 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--surface-subtle);
}

.set-ai-status.ok {
  color: var(--success);
  border-color: var(--success-border);
  background: var(--success-bg);
}

.set-ai-status.err {
  color: var(--danger);
  border-color: var(--danger-border);
  background: var(--danger-bg);
}

.set-ai-status-icon {
  flex-shrink: 0;
}

.set-ai-status-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.set-ai-spin {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--text-secondary);
  border-radius: 50%;
  animation: set-ai-spin 0.8s linear infinite;
}

@keyframes set-ai-spin {
  to {
    transform: rotate(360deg);
  }
}

.set-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.set-account-form {
  align-items: flex-start;
}

.set-account-inputs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 280px;
  flex-shrink: 0;
}

.set-account-inputs .set-actions {
  justify-content: flex-end;
}

.set-account-error {
  color: var(--danger, var(--text));
}

@media (max-width: 760px) {
  .set-overlay {
    padding: 0;
    align-items: stretch;
  }

  .set-dialog {
    width: 100%;
    height: 100%;
    border-radius: 0;
  }

  .set-body {
    flex-direction: column;
  }

  .set-nav {
    width: auto;
    flex-direction: row;
    gap: 4px;
    padding: 0 12px 8px;
    overflow-x: auto;
  }

  .set-nav-item {
    width: auto;
    white-space: nowrap;
  }

  .set-pane {
    padding: 8px 16px 24px;
  }

  .set-field,
  .set-field-text {
    flex-wrap: wrap;
    gap: 8px 12px;
  }
}

.set-memory-bar,
.set-memory-add {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}
.set-memory-bar .set-input,
.set-memory-add .set-input {
  flex: 1;
  width: auto;
  min-width: 0;
}
.set-memory-count {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}
.set-memory-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 4px;
}
.set-memory-tab {
  padding: 6px 12px;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--text-secondary);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.set-memory-tab.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
}
.set-knowledge-group {
  margin-top: 8px;
}
.set-knowledge-cat {
  display: flex;
  align-items: center;
  border-radius: 6px;
}
.set-knowledge-cat:hover {
  background: var(--hover);
}
.set-knowledge-fold {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  padding: 7px 6px;
  border: none;
  background: none;
  color: var(--text-secondary);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  text-align: start;
  cursor: pointer;
}
.set-knowledge-n {
  font-weight: 500;
  color: var(--text-tertiary);
}
.set-knowledge-chevron {
  width: 0;
  height: 0;
  border-left: 5px solid currentColor;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform 0.15s;
}
.set-knowledge-group.open .set-knowledge-chevron {
  transform: rotate(90deg);
}
.set-knowledge-cat-actions {
  display: flex;
  gap: 4px;
  padding-right: 6px;
  opacity: 0;
}
.set-knowledge-cat:hover .set-knowledge-cat-actions,
.set-knowledge-cat:focus-within .set-knowledge-cat-actions {
  opacity: 1;
}
.set-knowledge-group .set-memory-list {
  margin-top: 0;
  border-top: none;
}
.set-knowledge-row {
  padding: 0;
  border-radius: 6px;
}
.set-knowledge-row:hover {
  background: var(--hover);
}
.set-knowledge-row.open {
  background: var(--accent-soft);
}
.set-knowledge-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px 7px 24px;
  cursor: pointer;
}
.set-knowledge-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-primary);
}
.set-knowledge-row.open .set-knowledge-title {
  white-space: normal;
  font-weight: 600;
}
.set-knowledge-date {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.set-knowledge-summary {
  padding: 0 10px 0 24px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary);
}
.set-knowledge-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.set-knowledge-move {
  position: relative;
}
.set-knowledge-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 8px 16px;
}
.set-knowledge-bar-date {
  margin-left: auto;
}
.set-knowledge-versions {
  margin: 0 10px 8px 24px;
  padding: 4px 0 4px 10px;
  list-style: none;
  border-left: 2px solid var(--border-subtle);
}
.set-knowledge-version {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}
.set-knowledge-version-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
}
.set-knowledge-version-text {
  max-height: 240px;
  margin: 4px 0 8px;
  padding: 8px 10px;
  overflow: auto;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.set-knowledge-trash {
  margin: 8px 0;
  padding: 8px 0 0;
}
.set-knowledge-trash .set-knowledge-versions {
  margin-left: 0;
}
.set-ghost-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 8px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.set-ghost-btn svg {
  width: 13px;
  height: 13px;
}
.set-ghost-btn:hover,
.set-ghost-btn.active {
  background: var(--hover);
  color: var(--text-primary);
}
.set-ghost-icon {
  width: 26px;
  padding: 0;
  justify-content: center;
}
.set-ghost-danger:hover {
  background: var(--danger-bg);
  color: var(--danger);
}
.set-ghost-caret {
  width: 5px;
  height: 5px;
  margin: -3px 0 0 1px;
  border-right: 1.2px solid currentColor;
  border-bottom: 1.2px solid currentColor;
  transform: rotate(45deg);
}
.set-knowledge-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 5;
  min-width: 160px;
  max-height: 280px;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-menu);
}
.set-knowledge-menu-item {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 6px 10px;
  border: none;
  border-radius: 5px;
  background: none;
  color: var(--text-primary);
  font: inherit;
  font-size: 12px;
  text-align: start;
  cursor: pointer;
}
.set-knowledge-menu-item:hover:not(:disabled) {
  background: var(--hover);
}
.set-knowledge-menu-item:disabled {
  color: var(--text-secondary);
  cursor: default;
}
.set-knowledge-menu-item svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  color: var(--text-tertiary);
}
.set-knowledge-menu-item[aria-checked='true'] svg {
  color: var(--accent);
}
.set-knowledge-menu-new {
  margin-top: 4px;
  border-top: 1px solid var(--border-subtle);
  border-radius: 0 0 5px 5px;
}
.set-knowledge-menu-input {
  width: 100%;
  margin-top: 4px;
}
.set-knowledge-name-input {
  flex: 1;
  min-width: 0;
  max-width: 220px;
}
.set-knowledge-menu-new svg {
  width: 13px;
  height: 13px;
}
.set-memory-empty {
  margin-top: 16px;
}
.set-memory-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  border-top: 1px solid var(--border-subtle);
}
.set-memory-row {
  padding: 10px 2px;
  border-bottom: 1px solid var(--border-subtle);
}
.set-memory-text {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-primary);
  cursor: text;
  border-radius: 4px;
}
.set-memory-text:hover {
  background: var(--hover);
}
.set-memory-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-secondary);
}
.set-memory-badge {
  padding: 0 6px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
}
.set-memory-del {
  margin-left: auto;
  border: none;
  background: none;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
}
.set-memory-row:hover .set-memory-del {
  opacity: 1;
}
.set-memory-del:hover {
  color: var(--text-primary);
}
.set-memory-edit {
  width: 100%;
  min-height: 64px;
  padding: 6px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  font: inherit;
  font-size: 13px;
  color: var(--text-primary);
  background: var(--surface);
  resize: vertical;
}
.set-memory-row .set-actions {
  justify-content: flex-end;
  margin-top: 6px;
}

.set-share-row .set-memory-text {
  color: var(--text-primary);
  text-decoration: none;
}
.set-share-row .set-memory-text:hover {
  text-decoration: underline;
}
.set-share-path {
  max-width: 50%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.set-share-revoke {
  margin-left: auto;
}

/* multi-line variant for header / model-declaration blobs; same chrome as .set-input */
.set-input-multiline {
  flex-shrink: 0;
  width: 46%;
  min-width: 200px;
  min-height: 56px;
  padding: 6px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--surface);
  resize: vertical;
}

.set-input-multiline:focus {
  outline: none;
  border-color: var(--accent, var(--text-primary));
}

.set-input-multiline::placeholder {
  color: var(--text-tertiary);
}

.set-input-multiline.set-input-invalid {
  border-color: var(--danger, var(--accent, var(--text-primary)));
}

.set-ai-endpoint-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.set-ai-endpoint-row .set-dd {
  flex: 1;
  min-width: 0;
}

/* ── custom endpoint profile pane ── */

.set-ai-profile-field,
.set-ai-profile-blob {
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}

.set-ai-profile-field .set-field-text,
.set-ai-profile-blob .set-field-text {
  flex: initial;
}

.set-ai-profile-blob .set-input-multiline {
  width: 100%;
  min-width: 0;
}

.set-ai-profile-switches {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
  width: 100%;
  min-width: 0;
}

.set-ai-profile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.set-ai-profile-label {
  min-width: 0;
  overflow-wrap: anywhere;
}

.set-ai-profile-tri {
  display: inline-flex;
  flex-shrink: 0;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  overflow: hidden;
}

.set-ai-profile-tri-btn {
  padding: 4px 10px;
  border: none;
  background: var(--surface);
  font: inherit;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
}

.set-ai-profile-tri-btn + .set-ai-profile-tri-btn {
  border-left: 1px solid var(--border-subtle);
}

.set-ai-profile-tri-btn:hover {
  background: var(--hover);
}

.set-ai-profile-tri-btn.is-active {
  background: var(--accent-soft);
  color: var(--text-primary);
}

.set-memory-group {
  margin-top: 16px;
}
.set-memory-group-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}
.set-memory-group .set-memory-list {
  margin-top: 6px;
}
.set-memory-badge.muted {
  border-style: dashed;
}
.set-memory-link {
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  color: var(--text-secondary);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.set-memory-link:hover {
  color: var(--text-primary);
}
.set-memory-history {
  margin: 6px 0 0;
  padding: 6px 10px;
  list-style: none;
  border-left: 2px solid var(--border-subtle);
}
.set-memory-history li {
  display: flex;
  gap: 10px;
  padding: 2px 0;
  font-size: 12px;
}
.set-memory-history-text {
  flex: 1;
  min-width: 0;
  color: var(--text-secondary);
  text-decoration: line-through;
}
.set-memory-history-meta {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
}
.set-memory-cat-dd {
  margin-right: auto;
}
.set-memory-proposal {
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface);
}
.set-memory-proposal ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.set-memory-op {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 4px 0;
  font-size: 13px;
  color: var(--text-primary);
}
.set-memory-op.delete .set-memory-op-text {
  color: var(--text-secondary);
  text-decoration: line-through;
}
.set-memory-op-text {
  flex: 1;
  min-width: 0;
}
.set-memory-op-was {
  display: block;
  font-size: 11px;
  color: var(--text-secondary);
  text-decoration: line-through;
}
.set-memory-op-cat {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
}
.set-memory-proposal .set-actions {
  justify-content: flex-end;
  margin-top: 8px;
}
/* First-run onboarding: full-window overlay above the home screen.
 * Layout follows the design spec: 540×420 white
 * card, left-aligned content column, slide-2 credits offer panel, and a
 * dots-left / Skip-Back-Next-right footer. Genspark tokens: black pill primary,
 * gray ramp, brand blue #0f7fff only on the credits line. */

.onb-overlay {
  /* Genspark tokens, scoped to the overlay (home.css keeps its own --accent) */
  --onb-font-sans:
    'Arial', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue',
    sans-serif;
  --onb-btn-primary: #232425;
  --onb-btn-primary-hover: #393a3b;
  --onb-btn-primary-text: #fff;
  --onb-brand: #0f7fff;
  --onb-text-primary: #232425;
  --onb-text-secondary: #606366;
  --onb-text-tertiary: #909499;
  --onb-bg-subtle: #f6f7f8;
  /* offer panel: a whisper of the brand blue instead of neutral gray */
  --onb-bg-panel: #f0f7ff;
  --onb-border-default: #eaeaea;
  --onb-border-strong: #d0d3d8;
  /* outline-CTA seat (shared by the GenTeam join and GitHub star buttons) */
  --onb-cta-bg: #fff;
  --onb-cta-hover-text: #fff;
  --onb-cta-shadow: 0 1px 3px rgba(15, 127, 255, 0.18);
  --onb-overlay-bg: rgba(35, 36, 37, 0.4);
  --onb-card-bg: #fff;
  --onb-card-shadow: 0 24px 64px rgba(35, 36, 37, 0.22), 0 2px 8px rgba(35, 36, 37, 0.08);
  --onb-transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);

  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--onb-overlay-bg);
  backdrop-filter: blur(4px);
  font-family: var(--onb-font-sans);
}

.onb-card {
  position: relative;
  outline: none; /* receives initial focus as the dialog container */
  display: flex;
  flex-direction: column;
  width: 540px;
  /* 420px is the design-spec height for the anchor languages; longer locales
   * (de/ru/ar wrap the slide-2 copy to 3 lines) grow the card instead of
   * overflowing the fixed box and eating the bottom padding */
  min-height: 420px;
  max-width: calc(100vw - 48px);
  max-height: calc(100vh - 48px);
  border-radius: 20px;
  background: var(--onb-card-bg);
  box-shadow: var(--onb-card-shadow);
  padding: 41px 32px 25px;
}

/* all slides render stacked in one grid cell; the tallest one sets the card
 * height for the language, so the footer never moves between steps */
.onb-stage {
  flex: 1;
  display: grid;
}

.onb-slide {
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: start;
}

.onb-slide.active {
  animation: onb-slide-in 0.25s ease-out;
}

.onb-slide:not(.active) {
  visibility: hidden;
}

@keyframes onb-slide-in {
  from {
    opacity: 0;
    transform: translateX(16px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.onb-art {
  display: block;
  margin-bottom: 15px;
  color: var(--onb-text-primary);
}

.onb-art-logo {
  width: 60px;
  height: 60px;
  border-radius: 13.5px;
}

/* decorative glyphs: exact design-spec vectors — 60px box, 4px strokes, bare
 * black line art matching the app icon's visual mass */
.onb-art-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  color: var(--onb-text-primary);
}

/* glyph drawn a notch smaller inside the fixed 60px slot (box size unchanged,
 * so the text rhythm below stays put) */
.onb-art-badge svg {
  width: 58px;
  height: 58px;
}

/* each glyph carries different padding inside its canvas; pull it out so the
 * visible left edge of the artwork sits on the text axis below */
.onb-art-gift {
  margin-left: -6px;
}

.onb-art-check {
  margin-left: -4px;
}

.onb-title {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.5;
  color: var(--onb-text-primary);
}

.onb-subtitle {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.24px;
  line-height: 1.5;
  color: var(--onb-text-primary);
}

.onb-body {
  margin: 10px 0 0;
  font-size: 16px;
  letter-spacing: -0.154px;
  line-height: 1.5;
  color: var(--onb-text-secondary);
}

/* slide 3's credits disclaimer reads as a footnote */
.onb-body-dim {
  color: var(--onb-text-tertiary);
}

.onb-consent {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--onb-border-default);
  border-radius: 12px;
  background: var(--onb-bg-subtle);
}

.onb-consent-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.onb-consent-title {
  color: var(--onb-text-primary);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}

.onb-consent-desc {
  color: var(--onb-text-secondary);
  font-size: 12px;
  line-height: 1.4;
}

/* slide 3's star ask: same panel treatment as the offer, but low-key — a
 * one-line hint plus an outline CTA that opens the GitHub repo */
.onb-star {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--onb-bg-panel);
}

.onb-star-hint {
  margin: 0;
  font-size: 14px;
  letter-spacing: -0.154px;
  line-height: 1.5;
  color: var(--onb-text-secondary);
}

.onb-star-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.154px;
  color: var(--onb-brand);
  background: var(--onb-cta-bg);
  border: 1.5px solid var(--onb-brand);
  border-radius: 12px;
  box-shadow: var(--onb-cta-shadow);
  cursor: pointer;
  transition: all var(--onb-transition);
}

.onb-star-btn:hover {
  color: var(--onb-cta-hover-text);
  background: var(--onb-brand);
}

/* slide 2's offer: quiet gray lead-in, then the amount in large brand-blue
 * type, grouped with the Join CTA in one panel so the page reads as
 * info / offer / navigation */
.onb-offer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  margin-top: 14px;
  padding: 17px 16px;
  border-radius: 12px;
  background: var(--onb-bg-panel);
}

.onb-credits {
  margin: 0;
  font-size: 16px;
  letter-spacing: -0.154px;
  line-height: 1.5;
  color: var(--onb-text-secondary);
}

.onb-credits strong {
  display: block;
  margin-top: 4px;
  color: var(--onb-brand);
  font-size: 22px;
  font-weight: 700;
  font-style: italic;
  letter-spacing: -0.3px;
  line-height: normal;
}

/* the offer CTA is the dialog's standout action: a weighted blue outline —
 * 1.5px border + semibold + a faint blue seat-shadow so it doesn't float on
 * the tinted panel — inverting to solid blue on hover */
.onb-join {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  padding: 10.5px 22.5px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.154px;
  color: var(--onb-brand);
  background: var(--onb-cta-bg);
  border: 1.5px solid var(--onb-brand);
  border-radius: 12px;
  box-shadow: var(--onb-cta-shadow);
  cursor: pointer;
  transition: all var(--onb-transition);
}

.onb-join:hover {
  color: var(--onb-cta-hover-text);
  background: var(--onb-brand);
}

/* footer: progress dots on the start side, Skip / Back / Next grouped on the end side */
.onb-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
}

.onb-dots {
  display: flex;
  gap: 6px;
}

.onb-dot {
  width: 6px;
  height: 6px;
  padding: 0;
  border: none;
  border-radius: 3px;
  background: var(--onb-border-strong);
  cursor: pointer;
  transition: background var(--onb-transition);
}

.onb-dot.active {
  background: var(--onb-btn-primary);
}

.onb-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.onb-skip {
  border: none;
  background: none;
  padding: 10px 6px;
  font-size: 14px;
  letter-spacing: -0.154px;
  color: var(--onb-text-tertiary);
  cursor: pointer;
  transition: color var(--onb-transition);
}

.onb-skip:hover {
  color: var(--onb-text-secondary);
}

.onb-skip:disabled,
.onb-back:disabled,
.onb-next:disabled,
.onb-consent-switch:disabled {
  opacity: 0.55;
  cursor: default;
}

.onb-back {
  min-width: 76px;
  padding: 11px 21px;
  border: none;
  border-radius: 12px;
  background: var(--onb-bg-subtle);
  color: var(--onb-text-primary);
  font-size: 14px;
  letter-spacing: -0.154px;
  text-align: center;
  cursor: pointer;
  transition: background var(--onb-transition);
}

.onb-back:hover {
  background: var(--onb-border-default);
}

.onb-next {
  min-width: 84px;
  padding: 11px 20px;
  border: none;
  border-radius: 12px;
  background: var(--onb-btn-primary);
  color: var(--onb-btn-primary-text);
  font-size: 14px;
  letter-spacing: -0.154px;
  text-align: center;
  cursor: pointer;
  transition: background var(--onb-transition);
}

.onb-next:hover {
  background: var(--onb-btn-primary-hover);
}

/* replace the UA default focus ring (tinted by the OS accent color) with the
 * brand ring, and only for keyboard focus — clicks stay ring-free */
.onb-next:focus,
.onb-back:focus,
.onb-skip:focus,
.onb-join:focus,
.onb-star-btn:focus,
.onb-consent-switch:focus,
.onb-dot:focus {
  outline: none;
}

.onb-next:focus-visible,
.onb-back:focus-visible,
.onb-skip:focus-visible,
.onb-join:focus-visible,
.onb-star-btn:focus-visible,
.onb-consent-switch:focus-visible,
.onb-dot:focus-visible {
  outline: 2px solid var(--onb-brand);
  outline-offset: 2px;
}

/* ── Dark mode onboarding overrides ──────────────────────── */

[data-theme='dark'] .onb-overlay {
  --onb-btn-primary: #e4e4e4;
  --onb-btn-primary-hover: #ccc;
  --onb-btn-primary-text: #1a1a1a;
  --onb-text-primary: #e4e4e4;
  --onb-text-secondary: #a0a0a0;
  --onb-text-tertiary: #777;
  --onb-bg-subtle: #333;
  --onb-bg-panel: #1a2a3a;
  --onb-border-default: #444;
  --onb-border-strong: #555;
  --onb-card-bg: #2a2a2a;
  --onb-card-shadow: 0 24px 64px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.3);
  --onb-cta-bg: #2a2a2a;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']):not([data-theme='dark']) .onb-overlay {
    --onb-btn-primary: #e4e4e4;
    --onb-btn-primary-hover: #ccc;
    --onb-btn-primary-text: #1a1a1a;
    --onb-text-primary: #e4e4e4;
    --onb-text-secondary: #a0a0a0;
    --onb-text-tertiary: #777;
    --onb-bg-subtle: #333;
    --onb-bg-panel: #1a2a3a;
    --onb-border-default: #444;
    --onb-border-strong: #555;
    --onb-card-bg: #2a2a2a;
    --onb-card-shadow: 0 24px 64px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.3);
    --onb-cta-bg: #2a2a2a;
  }
}
/* Motion accessibility: suppress all animation for users who opt out */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
/* "Star us on GitHub" invitation card: non-modal, bottom-right over home.
 * Chrome-colored via semantic tokens (light/dark follow the UI theme). */

.star-prompt {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  width: 320px;
  padding: 16px 16px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-modal-strong);
  animation: star-prompt-in 0.25s ease-out;
}

@keyframes star-prompt-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.star-prompt-close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
}

.star-prompt-close:hover {
  background: var(--hover);
  color: var(--text);
}

.star-prompt-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.star-prompt-icon {
  display: inline-flex;
  color: var(--accent);
}

.star-prompt-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.star-prompt-body {
  margin: 0 0 12px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-secondary);
}

.star-prompt-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.star-prompt-go {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: var(--color-btn-primary-text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.star-prompt-go:hover {
  background: var(--accent-hover);
}

.star-prompt-go svg {
  width: 14px;
  height: 14px;
}

.star-prompt-done {
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: none;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
}

.star-prompt-done:hover {
  background: var(--hover);
  color: var(--text);
}
/* Office-style ScreenTip — themed via the shared tokens (light/dark automatic).
 * The element is a singleton created by installScreenTips(); visibility is
 * driven inline by the script, everything visual lives here. */

.ui-screentip {
  position: fixed;
  z-index: 100000;
  max-width: 280px;
  padding: 5px 10px;
  border-radius: var(--radius-6);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-primary);
  font: 12px/1.45 var(--gs-font-sans);
  box-shadow: 0 4px 14px rgb(0 0 0 / 18%);
  pointer-events: none;
  visibility: hidden;
  /* some tips carry embedded newlines (e.g. pdf note pins: contents + hint) */
  white-space: pre-line;
}

.ui-screentip-kbd {
  margin-left: 6px;
  color: var(--text-tertiary);
}

.ui-screentip-detail {
  margin-top: 2px;
  color: var(--text-secondary);
}
/* Shared select-replacement dropdown (Dropdown in dropdown.tsx): themed
 * trigger + anchored popover. Colors are chrome tokens only; apps size the
 * control via a class on the .gs-dd wrapper. */

.gs-dd {
  position: relative;
  display: inline-flex;
  anchor-name: --gs-dd;
  anchor-scope: --gs-dd;
}

.gs-dd-btn {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
  height: 26px;
  /* right 5px: caret glyph right edge lands 6px from the outer edge, matching
   * the format-pane caret alignment line */
  padding: 0 5px 0 6px;
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.gs-dd-btn:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.gs-dd-btn:disabled {
  color: var(--text-dim);
  cursor: default;
}

.gs-dd-value {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  overflow: hidden;
  white-space: nowrap;
}

.gs-dd-caret {
  flex-shrink: 0;
  display: flex;
  color: var(--text-dim);
}

/* fixed + anchored so scroll-container overflow never clips the popover or
 * its shadow; flips above the trigger near the viewport bottom */
.gs-dd-pop {
  position: fixed;
  position-anchor: --gs-dd;
  top: calc(anchor(bottom) + 2px);
  left: anchor(left);
  min-width: anchor-size(width);
  /* flip-inline: a popover wider than its trigger near the window's right edge would
   * otherwise run offscreen and clip (fixed positioning clips at the viewport) —
   * flipping right-aligns it to the trigger so it grows leftwards instead */
  position-try-fallbacks:
    flip-block,
    flip-inline,
    flip-block flip-inline;
  position-visibility: anchors-visible;
  z-index: 80;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 320px;
  overflow-y: auto;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  box-shadow: var(--shadow-menu);
}

/* with a filter box the popover stops scrolling itself: the box stays put
 * above an inner scroller, so it never rides out of view with the list */
.gs-dd-pop.has-search {
  overflow: hidden;
}

.gs-dd-list {
  display: contents;
}

.gs-dd-pop.has-search .gs-dd-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 0;
  overflow-y: auto;
}

.gs-dd-search {
  box-sizing: border-box;
  flex-shrink: 0;
  margin: 0 0 2px;
  padding: 4px 6px;
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  outline: none;
}

.gs-dd-search:focus {
  border-color: var(--accent);
}

.gs-dd-item {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  border: none;
  background: none;
  color: var(--text);
  border-radius: 3px;
  padding: 5px 6px;
  font-family: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.gs-dd-item.active {
  background: var(--hover);
}

.gs-dd-item:disabled {
  color: var(--text-dim);
  cursor: default;
}

.gs-dd-item.selected {
  background: var(--accent-soft);
}
/* Shared chrome/AI-panel tokens come from @genoffice/ui/tokens.css (imported
 * before this file in main.tsx); only shell-specific tokens live here. */
:root {
  /* Genspark DS v4.1: guide/onboarding accent is the brand blue */
  --accent: #0f7fff;
  --accent-hover: #0e72e5;
  /* selected-option tint for the shared dropdown (gs-dd) */
  --accent-soft: #eaf0fd;
  --modal-width-sm: 480px;
  --avatar-bg: #e8ebef;
  --badge-bg: #eaf0fd;
  --checkbox-bg: #ececec;
  --timeline-user-bg: #eef1f5;
  --timeline-user-text: #5a6170;
  /* lift for the active segment in gray-track tab pills */
  --shadow-pill: 0 1px 2px rgb(0 0 0 / 8%);
  --focus-ring: 0 0 0 3px rgb(35 36 37 / 20%);
  /* brand-fixed colors, identical in both themes */
  --on-accent: #fff;
  --star: #f5a623;
  --avatar-brand: linear-gradient(135deg, #3d7ff5, #1b58cf);
}

/* ── Dark mode overrides ─────────────────────────────────── */

/* Explicit dark: [data-theme="dark"] on <html> */
[data-theme='dark'] {
  --accent: #3f99ff;
  --accent-hover: #5ba5ff;
  --accent-soft: #24354d;
  --avatar-bg: #333;
  --badge-bg: #2a3a4a;
  --checkbox-bg: #333;
  --timeline-user-bg: #2a2a3a;
  --timeline-user-text: #b0b0c0;
  --shadow-pill: 0 1px 2px rgb(0 0 0 / 40%);
  --focus-ring: 0 0 0 3px rgb(255 255 255 / 25%);
}

/* System dark: no data-theme or data-theme="system" — follow OS preference */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']):not([data-theme='dark']) {
    --accent: #3f99ff;
    --accent-hover: #5ba5ff;
    --accent-soft: #24354d;
    --avatar-bg: #333;
    --badge-bg: #2a3a4a;
    --checkbox-bg: #333;
    --timeline-user-bg: #2a2a3a;
    --timeline-user-text: #b0b0c0;
    --shadow-pill: 0 1px 2px rgb(0 0 0 / 40%);
    --focus-ring: 0 0 0 3px rgb(255 255 255 / 25%);
  }
}

* {
  box-sizing: border-box;
}

/* replace the UA default ring (OS accent color) with the app accent */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* UI CJK fonts per language (documentElement.lang is set at bootstrap and on switch);
 * the zh expansion must keep the historical stack byte-identical */
:root {
  --ui-cjk: 'PingFang SC';
}

:root:lang(ja) {
  --ui-cjk: 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic UI', 'Yu Gothic', 'Meiryo';
}

:root:lang(ko) {
  --ui-cjk: 'Apple SD Gothic Neo', 'Malgun Gothic';
}

:root:lang(zh-TW) {
  --ui-cjk: 'PingFang TC', 'Microsoft JhengHei';
}

body {
  margin: 0;
  font-family: -apple-system, var(--ui-cjk), 'Segoe UI', 'Microsoft YaHei', sans-serif;
  background: var(--surface);
  color: var(--text);
}

/* macOS vibrancy (body.vib set at bootstrap): the window background stays
 * transparent so editor views can punch through to the vibrancy material;
 * the Home surface paints itself instead of relying on the body. */
body.vib {
  background: transparent;
}

body.vib .home {
  background: var(--surface);
}

/* ---- two-pane frame (below the 40px tab bar) ---- */

.home {
  position: relative;
  display: flex;
  height: calc(var(--app-height, 100vh) - 40px);
}

.home.side-resizing {
  cursor: col-resize;
  user-select: none;
}

.home.side-hidden .sidebar,
.home.side-hidden .sidebar-edge {
  display: none;
}

/* the drag strip straddles the sidebar border */
.sidebar-edge {
  position: relative;
  flex: none;
  width: 0;
  z-index: 3;
  cursor: col-resize;
  touch-action: none;
}

.sidebar-edge::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -4px;
  width: 8px;
}

.sidebar-edge::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -1px;
  width: 2px;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.12s;
}

.sidebar-edge:hover::after,
.home.side-resizing .sidebar-edge::after {
  opacity: 1;
}

.sidebar-toggle,
.sidebar-reveal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}

.sidebar-toggle:hover,
.sidebar-reveal:hover {
  background: var(--hover);
  color: var(--text);
}

.sidebar-search {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-left: auto;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}

.sidebar-search:hover {
  background: var(--hover);
  color: var(--text);
}

.sidebar-toggle {
  opacity: 0;
  transition: opacity 0.12s;
}

.sidebar:hover .sidebar-toggle,
.sidebar-toggle:focus-visible {
  opacity: 1;
}

.sidebar-reveal {
  position: absolute;
  top: 22px;
  left: 14px;
  z-index: 3;
}

/* the collapsed-state button sits where the content headers start */
.home.side-hidden .content:not(.gw-active) {
  padding-left: 52px;
}

.home.side-hidden .gw-header {
  padding-left: 34px;
}

.sidebar {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  width: var(--sidebar-w, 280px);
  padding: 18px 12px 16px;
  border-right: 1px solid var(--border);
  overflow-y: auto;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  padding: 0 8px;
  margin-bottom: 20px;
}

.logo-wordmark {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1;
  color: var(--text);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: none;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.nav-item:hover {
  background: var(--bg-hover);
}

.nav-item.active {
  background: var(--bg-hover);
  font-weight: 600;
}

.nav-item svg {
  flex-shrink: 0;
  color: var(--text-primary);
}

.nav-item.nav-primary {
  margin-bottom: 6px;
}

.nav-label {
  flex-shrink: 0;
}

.nav-label-fit {
  flex-shrink: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* hub entry: hovering shows the three sub-pages beside the sidebar. The panel
   is position:fixed (the sidebar scrolls, so an absolute child would be
   clipped) and the wrapper's mouseenter supplies the coordinates. */
.nav-flyout {
  position: fixed;
  z-index: 30;
  padding-left: 8px;
}

.nav-flyout-panel {
  min-width: 176px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-menu);
  animation: menu-in 0.1s ease;
}

.nav-flyout-panel button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: none;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
}

.nav-flyout-panel button svg {
  color: var(--text-primary);
}

.nav-flyout-panel button:hover,
.nav-flyout-panel button.active {
  background: var(--bg-hover);
}

/* ---- bottom-left account entry (today = Genspark login, later = signup/account system) ---- */
/* clicking it opens the settings modal (settings.css) directly, which hosts
   login/logout plus preferences (language / theme / save location / update channel) */

.account-entry {
  position: relative;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.account-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 7px 8px;
  border: none;
  border-radius: 10px;
  background: none;
  font: inherit;
  cursor: pointer;
  text-align: left;
}

.account-btn:hover {
  background: var(--surface-subtle);
}

.account-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--avatar-bg);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 700;
}

.account-avatar.logged-in {
  background: var(--avatar-brand);
  color: var(--on-accent);
}

.account-avatar.waiting {
  color: var(--accent);
}

.account-spinner {
  animation: account-spin 0.9s linear infinite;
}

@keyframes account-spin {
  to {
    transform: rotate(360deg);
  }
}

.account-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
  flex: 1;
}

.account-chevron {
  flex-shrink: 0;
  margin-left: auto;
  color: var(--text-muted);
}

.account-name {
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-sub {
  font-size: 12px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-sub.error {
  color: var(--danger);
}

/* one-line rescue hint while waiting for the browser sign-in (auto-open may have failed) */
.login-hint {
  position: absolute;
  left: -8px;
  bottom: calc(100% + 4px);
  width: calc(100% + 16px);
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-menu);
  z-index: 30;
}

.login-hint button {
  border: none;
  background: none;
  font: inherit;
  cursor: pointer;
}

.login-hint button:hover {
  background: var(--bg-hover);
}

.login-hint button.login-hint-open {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  font-size: 9px;
  line-height: 13px;
  padding: 3px 29px 3px 6px;
  color: var(--accent);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.login-hint-copy {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  align-self: center;
  width: 25px;
  height: 25px;
  padding: 0;
  border-radius: 7px;
  color: var(--text-muted);
}

.login-hint-copy:hover {
  color: var(--text-primary);
}

.login-hint-copy.copied {
  color: var(--accent);
}

/* ---- main content ---- */

.content {
  flex: 1;
  min-width: 0;
  padding: 28px 36px 40px;
  overflow-y: auto;
  background: var(--bg-content);
}

/* genWork conversation open: chat fills the viewport, its list scrolls internally */
.content.gw-active {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* the 44px title rows centre on the sidebar wordmark (18px pad + 21px line) */
  padding-top: 9px;
  padding-bottom: 24px;
}

.content.gw-active .quick-start {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-label {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-tertiary);
}

.home-hero {
  margin: 28px 0 20px;
}

.hero-title {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--text-primary);
}

.hero-ask {
  display: block;
  margin-top: 0;
  color: var(--text-primary);
  font-weight: 500;
}

/* ---- centered landing (WorkBuddy-style): hero + composer in the middle of the viewport ---- */

.content.home-center {
  display: flex;
  flex-direction: column;
}

.content.home-center .quick-start {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* optically balanced: slightly above true center */
  padding-bottom: 9vh;
}

/* an open image viewer owns the page: bounded so its stage can scroll instead of growing */
.content.home-center .hs-scene-full {
  flex: 1;
  min-height: 0;
  min-width: 0;
  align-self: stretch;
  display: flex;
  flex-direction: column;
}

.content.home-center .home-hero {
  margin: 0 0 30px;
  text-align: center;
}

.content.home-center .hero-title {
  font-size: 32px;
  line-height: 1.35;
}

.content.home-center .hero-ask {
  margin-top: 4px;
  font-size: 24px;
  font-weight: 500;
  color: var(--text-muted);
}

.content.home-center .gw-landing {
  width: 100%;
  max-width: 660px;
  margin: 0;
  gap: 12px;
}

/* scene chips above the landing composer (WorkBuddy): one scrollable row */
.hs-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.hs-bar::-webkit-scrollbar {
  display: none;
}

.hs-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  color: var(--text-primary);
  background: var(--surface);
  white-space: nowrap;
  cursor: pointer;
}

.hs-chip:hover {
  background: var(--hover);
  border-color: var(--accent);
}

.hs-chip-icon {
  display: inline-flex;
  color: var(--text-secondary);
}

.hs-chip-active,
.hs-chip-active:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

/* composer footer controls: project and permission dropdowns */
.hf-anchor {
  position: relative;
  display: inline-flex;
}

.hf-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 220px;
  height: 28px;
  padding: 0 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.hf-btn:hover,
.hf-btn[aria-expanded='true'] {
  background: var(--hover);
  color: var(--text);
}

.hf-btn-set {
  color: var(--text);
}

.hf-btn:disabled {
  color: var(--text-secondary);
  background: transparent;
  cursor: progress;
}

.hf-spin {
  flex: none;
  animation: account-spin 0.9s linear infinite;
}

.hf-btn-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hf-branch {
  cursor: default;
}

.hf-branch .hf-btn-label {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 12px;
}

.row-menu.hf-menu {
  left: 0;
  right: auto;
  min-width: min(280px, calc(100vw - 40px));
  max-width: min(380px, calc(100vw - 40px));
}

.hf-menu .hf-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 8px;
  white-space: normal;
  border: none;
  border-radius: 6px;
  background: none;
  font: inherit;
  font-size: 13px;
  text-align: left;
  color: var(--text);
  cursor: pointer;
}

.hf-menu .hf-item:hover,
.hf-menu .hf-item-row:hover {
  background: var(--surface-subtle);
}

.hf-menu .hf-item-current,
.hf-menu .hf-item-current:hover {
  background: none;
  cursor: default;
}

.hf-menu .hf-item-elsewhere {
  color: var(--text-muted);
}

.hf-menu .hf-item-row {
  padding: 0;
}

.hf-menu .hf-item-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  padding: 7px 8px;
  border: none;
  background: none;
  font: inherit;
  font-size: 13px;
  text-align: left;
  color: var(--text);
  cursor: pointer;
}

.hf-menu .hf-item-icon {
  display: inline-flex;
  width: 14px;
  flex-shrink: 0;
  justify-content: center;
  color: var(--text-secondary);
}

.hf-menu .hf-item-on .hf-item-icon {
  color: var(--accent);
}

.hf-menu .hf-item-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}

.hf-menu .hf-item-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hf-menu .hf-item-desc {
  font-size: 11.5px;
  color: var(--text-tertiary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hf-pin-mark {
  margin-right: 4px;
  color: var(--accent);
}

.hf-menu .hf-item-acts {
  display: inline-flex;
  flex-shrink: 0;
  padding-right: 4px;
}

@media (hover: hover) {
  .hf-menu .hf-item-acts {
    display: none;
  }

  .hf-menu .hf-item-row:hover .hf-item-acts {
    display: inline-flex;
  }
}

.row-menu .hf-item-act {
  width: auto;
  padding: 2px 5px;
  font-size: 12px;
  color: var(--text-tertiary);
}

.row-menu .hf-item-act:hover {
  color: var(--text);
}

.row-menu .hf-item-act[aria-pressed='true'] {
  color: var(--accent);
}

.modal.hf-dialog {
  width: min(480px, 90vw);
  padding: 20px 24px 22px;
}

.hf-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.hf-dialog-head h3 {
  margin: 0;
}

.hf-dialog-close {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: none;
  font-size: 20px;
  line-height: 1;
  color: var(--text-tertiary);
  cursor: pointer;
}

.hf-dialog-close:hover {
  background: var(--hover);
  color: var(--text);
}

.hf-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-muted);
}

.hf-field-box {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font: inherit;
  font-size: 14px;
  color: var(--text);
  text-align: left;
}

.hf-field-box:focus-within {
  border-color: var(--border-strong);
}

.hf-field-box svg {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

.hf-field-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
  outline: none;
}

.hf-field-pick {
  cursor: pointer;
}

.hf-field-pick:hover:not(:disabled) {
  background: var(--hover);
}

.hf-field-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hf-field-empty .hf-field-value {
  color: var(--text-tertiary);
}

.hf-dialog .modal-buttons {
  margin-top: 22px;
}

.hf-dialog .btn {
  font-size: 14px;
}

.hf-dialog .btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.hf-error {
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--danger);
}

.hf-note {
  padding: 6px 8px 2px;
  font-size: 11.5px;
  color: var(--text-tertiary);
}

/* model picker: opens upward like the + menu, lists one provider's ids */
.hf-mono {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 12.5px;
}

.hf-model-btn .set-provider-logo {
  display: inline-flex;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.hf-model-btn .set-provider-logo svg {
  width: 14px;
  height: 14px;
}

.gw-composer .row-menu.hf-model-menu,
.gw-composer .row-menu.hf-mode-menu {
  top: auto;
  bottom: calc(100% + 8px);
  min-width: 240px;
}

/* phones: footer dropdowns anchor to the whole input box so they never leave the viewport */
@media (max-width: 760px) {
  .gw-composer .ai-input-box {
    position: relative;
  }

  .gw-composer .ai-input-footer .hf-anchor {
    position: static;
  }

  .gw-composer .ai-input-footer .row-menu.hf-menu {
    left: 0;
    right: 0;
    min-width: 0;
    max-width: none;
    max-height: min(60vh, 420px);
    overflow-y: auto;
  }
}

.hf-model-provider {
  padding-bottom: 4px;
  font-weight: 600;
}

.hf-menu .hf-model-settings {
  justify-content: space-between;
}

.hf-model-arrow {
  margin-left: auto;
  padding-right: 2px;
  color: var(--text-tertiary);
}

/* project status under the code composer */
.hps-strip {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 14px;
  font-size: 12px;
  color: var(--text-tertiary);
}

.hps-line {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hps-tasks {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hps-task {
  max-width: 180px;
  padding: 1px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  font: inherit;
  font-size: 12px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.hps-task:hover {
  background: var(--hover);
  color: var(--text);
}

/* no outer shell around the landing composer: the padded/rounded/shadowed
 * wrapper read as a second box behind the input card (user feedback) —
 * the ai-input-box border alone draws the composer */
.content.home-center .gw-composer {
  max-width: none;
}

.content.home-center .gw-input {
  min-height: 56px;
  font-size: 15px;
  padding: 6px 6px 2px;
}

.quick-cards {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.quick-card {
  position: relative;
  flex: 1;
  min-width: 0;
  max-width: 280px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 18px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.12s,
    box-shadow 0.12s;
}

.quick-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-btn-hover);
}

.quick-card svg {
  flex-shrink: 0;
}

.quick-text {
  flex: 1;
  min-width: 0;
  /* cap at the card's content box: long ext lists ellipsize inside the padding
     instead of stretching the wrapper and getting clipped at the card border */
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.quick-title-row {
  max-width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.quick-title {
  min-width: 0;
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-sub {
  display: block;
  width: 100%;
  overflow: hidden;
  font-size: 12px;
  color: var(--text-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-folder {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
}

.ai-chip {
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--badge-bg);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

@media (max-width: 1100px) {
  .quick-cards {
    flex-wrap: wrap;
  }

  .quick-card {
    flex: 1 1 calc(50% - 5px);
    max-width: none;
  }
}

/* ---- recents ---- */

.recents {
  margin-top: 24px;
}

/* sticks to the top of the .content scrollport while the list scrolls under;
   the gap below is padding (not margin) so the background paints over rows.
   z-index stays under the sort dropdown (z-index: 5). */
.recents-toolbar {
  position: sticky;
  /* offsets .content's 28px padding-top so the bar hugs the visible top edge */
  top: -28px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0 14px;
  background: var(--bg-content);
}

/* "RECENT · N files" on one baseline */
.recents-heading {
  display: flex;
  align-items: baseline;
  gap: 10px;
  /* optical: geometrically the label is dead level with the tab text (glyph
     boxes coincide), but naked bold text beside the gray pill track reads
     high — compensate down */
  transform: translateY(2px);
}

/* matches .section-label so "Recent · N files" reads as one label */
.file-count {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-tertiary);
}

/* segmented filter control: gray track, active segment = white card.
   One shared 40px rail for the recents filter and the experts / automation tabs. */
.filter-pills,
.cloud-seg {
  display: flex;
  align-items: center;
  height: 40px;
  padding: 0 3px;
  border-radius: 10px;
  background: var(--checkbox-bg);
  flex-shrink: 0;
}

.filter-pill,
.cloud-seg button {
  padding: 7px 15px;
  border: none;
  border-radius: 8px;
  background: none;
  font: inherit;
  /* same size as the toolbar's heading text ("Recent · N files") so the two
     sit on one optical line — a 13px/14px mix reads as misaligned */
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
}

.filter-pill:hover,
.cloud-seg button:hover {
  color: var(--text);
}

.filter-pill.active,
.cloud-seg button.active {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow-pill);
}

/* experts / skills / connectors share one segmented bar above the page */
.hub-bar {
  max-width: 920px;
  margin: 0 auto;
  padding: 12px 48px 0;
}

.hub-tabs {
  display: inline-flex;
}

.hub-tabs button {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hub-content .exp-page,
.hub-content .con-page {
  padding-top: 24px;
}

.empty {
  color: var(--text-muted);
  font-size: 14px;
}

/* pagination sentinel: the spinner shown when scrolled to the bottom */
.load-more {
  display: flex;
  justify-content: center;
  padding: 14px 0;
}

.load-more-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--text-muted);
  border-radius: 50%;
  animation: load-more-spin 0.8s linear infinite;
}

@keyframes load-more-spin {
  to {
    transform: rotate(360deg);
  }
}

.selection-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  /* keeps the toolbar the same height as the 40px filter pills it replaces */
  min-height: 40px;
}

/* matches .selection-action's text (14px, body text color) */
.selection-count {
  font-size: 14px;
  color: var(--text);
  margin-right: 4px;
}

.selection-action {
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.selection-action:hover {
  background: var(--surface-subtle);
}

.selection-action.danger {
  color: var(--danger);
  border-color: var(--danger-border);
}

.selection-action.danger:hover {
  background: var(--danger-bg);
}

/* ---- file table ---- */

/* no overflow clipping: row menus must be able to escape the card */
.recent-table {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.recent-columns,
.recent-item {
  display: grid;
  grid-template-columns: 18px 24px minmax(0, 1fr) 120px 110px 76px 24px 28px;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
}

.recent-columns {
  padding-top: 11px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}

/* header label starts at the icon column so it lines up with the file badges */
.recent-columns .col-name {
  grid-column: 2 / 4;
}

.col-size {
  text-align: right;
}

.recent-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.recent-list li + li {
  border-top: 1px solid var(--border-subtle);
}

.recent-item {
  width: 100%;
  padding-top: 14px;
  padding-bottom: 14px;
  cursor: pointer;
  text-align: left;
}

.recent-list li:last-child .recent-item {
  border-radius: 0 0 12px 12px;
}

.recent-row:hover .recent-item {
  background: var(--surface-subtle);
}

/* checked rows keep the same gray as the sidebar's active item */
.recent-row:has(.row-check:checked) .recent-item {
  background: var(--bg-hover);
}

.recent-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.col-check {
  display: flex;
  align-items: center;
}

.col-check input {
  width: 14px;
  height: 14px;
  margin: 0;
  appearance: none;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: var(--surface);
  cursor: pointer;
}

.col-check input:checked {
  border-color: var(--accent);
  background: var(--accent)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2l2.4 2.4 4.6-5' stroke='%23fff' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center / 10px 10px no-repeat;
}

/* checkboxes are always visible (mock: every row shows its checkbox) */
.recent-item .row-check {
  opacity: 1;
}

.recent-icon {
  display: flex;
  align-items: center;
}

.recent-name {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.star-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--icon-muted);
  cursor: pointer;
}

.star-btn:hover {
  background: var(--bg-hover-subtle);
}

.recent-item:hover .star-btn,
.star-btn.starred {
  opacity: 1;
}

.star-btn:hover {
  color: var(--star);
}

.rename-input {
  min-width: 0;
  padding: 3px 7px;
  border: 1.5px solid var(--accent);
  border-radius: 6px;
  font: inherit;
  font-size: 14px;
  outline: none;
  background: var(--surface);
}

.recent-path {
  font-size: 12px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-time {
  font-size: 12px;
  color: var(--text-tertiary);
  white-space: nowrap;
}

.recent-size {
  font-size: 12px;
  color: var(--text-tertiary);
  white-space: nowrap;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.recent-actions {
  position: relative;
  display: flex;
  justify-content: flex-end;
}

.more-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 8px;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.1s;
}

.more-btn:hover,
.more-btn[aria-expanded='true'] {
  background: var(--bg-hover-strong);
  color: var(--text);
}

.row-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  min-width: 160px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-menu);
  animation: menu-in 0.1s ease;
}

@keyframes menu-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}

.row-menu button {
  display: block;
  width: 100%;
  padding: 7px 10px;
  border: none;
  border-radius: 6px;
  background: none;
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
}

.row-menu button:hover {
  background: var(--surface-subtle);
}

.row-menu button.danger {
  color: var(--danger);
}

.row-menu button.danger:hover {
  background: var(--danger-bg);
}

.hf-menu-group {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 2px;
  color: var(--text-tertiary);
  font-size: 12px;
}

.hf-menu-group svg {
  width: 14px;
  height: 14px;
}

.row-menu-divider {
  height: 1px;
  margin: 5px 6px;
  background: var(--border-subtle);
}

/* ---- buttons + modal ---- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-6);
  font: inherit;
  font-size: 16px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* design-system interaction states; hover fills live on each variant below */
.btn:active:not(:disabled) {
  transform: scale(0.98);
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.btn-primary {
  background: var(--color-btn-primary);
  border: none;
  color: var(--color-btn-primary-text);
}

.btn-primary:hover:not(:disabled) {
  background: var(--color-btn-primary-hover);
}

.btn-secondary {
  background: var(--surface);
  border: 1px solid var(--color-border-default);
  color: var(--text);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--border-hover);
}

.btn-danger {
  background: var(--color-error);
  border: none;
  color: var(--on-accent);
}

.btn-danger:hover:not(:disabled) {
  background: var(--color-error-hover);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-overlay);
  backdrop-filter: blur(4px);
}

/* ConfirmDialog per the design system: 8px container, 6px buttons */
.modal {
  min-width: min(var(--modal-width-sm), 90vw);
  max-width: 500px;
  padding: 24px;
  background: var(--surface);
  border-radius: var(--radius-8);
  box-shadow: var(--shadow-modal-strong);
  animation: menu-in 0.12s ease;
}

.modal h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.modal p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
}

.modal-file-list {
  margin: 10px 0 0;
  padding: 10px 12px;
  list-style: none;
  background: var(--surface-subtle);
  border-radius: 8px;
  font-size: 12px;
  color: var(--text-muted);
  max-height: 150px;
  overflow-y: auto;
}

.modal-file-list li {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.8;
}

.modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

/* ── Project sidebar (P1) ─────────────────────────────── */

.sidebar-divider {
  height: 1px;
  margin: 8px 0;
  background: var(--border-subtle);
}

/* ---- sidebar workbench group: local apps, one row each ---- */

.wb-rail .gw-task-item {
  padding: 5px 10px;
}

.wb-rail .gw-task-item[draggable] {
  position: relative;
  cursor: grab;
}

.wb-rail-list.expanded {
  max-height: 280px;
  overflow-y: auto;
}

.wb-grip {
  position: absolute;
  left: 2px;
  width: 6px;
  height: 14px;
  fill: var(--text-tertiary);
  visibility: hidden;
}

@media (hover: hover) {
  .wb-row:hover .wb-grip {
    visibility: visible;
  }
}

.wb-row.dragging {
  opacity: 0.4;
}

.wb-row.drop-before {
  box-shadow: 0 -2px 0 0 var(--accent);
}

.wb-rail .gw-task-more {
  padding: 4px 10px;
}

.wb-dot.stopped {
  background: none;
  box-shadow: inset 0 0 0 1.5px var(--text-muted);
}

.wb-dot.running {
  background: var(--success);
}

.wb-dot.starting {
  background: var(--warning);
}

.wb-dot.error {
  background: var(--danger);
}

.wb-row .gw-task-del:disabled {
  opacity: 0.5;
  cursor: default;
}

/* ---- sidebar file entries: a labeled group like the task rail ---- */

.side-actions {
  display: flex;
  flex-direction: column;
  margin: 0 8px 10px;
}

.side-actions-label {
  padding: 2px 10px 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
}

.side-actions-toggle {
  padding: 2px 10px 6px;
}

.side-action {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border: none;
  border-radius: 8px;
  background: none;
  font: inherit;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: left;
}

.side-action:hover {
  background: var(--hover);
  color: var(--text);
}

.side-action.active {
  background: var(--bg-hover);
  color: var(--text);
  font-weight: 600;
}

.side-action svg {
  flex-shrink: 0;
}

.side-new-chevron {
  margin-left: auto;
  color: var(--text-muted);
}

/* fixed-position (viewport coords) so it escapes the scrollable sidebar */
.side-new-menu {
  position: fixed;
  z-index: 30;
  min-width: 196px;
  padding: 5px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-menu);
}

.side-new-menu button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 7px 9px;
  border: none;
  border-radius: 7px;
  background: none;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  text-align: left;
  color: var(--text);
}

.side-new-menu button:hover {
  background: var(--bg-hover);
}

.side-new-title {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.side-new-ext {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--text-muted);
}

/* ---- sidebar recent/starred file list (the home page no longer shows the table) ---- */

.side-files {
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin-top: 14px;
}

.side-files-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px 6px 2px;
}

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

.side-files-tab {
  padding: 3px 8px;
  border: none;
  border-radius: 6px;
  background: none;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  cursor: pointer;
}

.side-files-tab:hover {
  background: var(--bg-hover);
}

.side-files-tab.active {
  color: var(--text-muted);
}

.side-files-count {
  font-size: 11px;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}

.side-files-empty {
  margin: 2px 0 0;
  padding: 0 10px;
  font-size: 12px;
  color: var(--text-tertiary);
}

.side-file-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  /* leave room for the project panel and account entry below */
  max-height: 38vh;
}

.side-file-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 10px;
  border: none;
  border-radius: 8px;
  background: none;
  cursor: pointer;
  font: inherit;
  text-align: left;
  color: var(--text);
}

.side-file-item:hover {
  background: var(--bg-hover);
}

.side-file-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.side-file-item img,
.side-file-item svg {
  flex-shrink: 0;
}

.side-file-name {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.side-file-more {
  display: flex;
  justify-content: center;
  padding: 6px 0;
}

.empty-hint {
  font-size: inherit;
  color: var(--text-secondary);
}

/* ── Project activity timeline (P1) ───────────────────── */

.timeline-section {
  margin-top: 28px;
}

.timeline-head {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  cursor: pointer;
  margin-bottom: 12px;
}

.timeline-head:hover .section-label {
  color: var(--text);
}

.timeline-chevron {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform 0.15s;
  transform: rotate(-90deg);
}

.timeline-chevron.open {
  transform: rotate(0deg);
}

.timeline-count {
  margin-left: 4px;
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.timeline-empty {
  color: var(--text-muted);
  font-size: 14px;
  padding-left: 2px;
}

.timeline-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
}

.timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.1s;
}

.timeline-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.timeline-list .timeline-item + .timeline-item {
  border-top: 1px solid var(--border-subtle);
}

.timeline-item:hover {
  background: var(--surface-subtle);
}

.timeline-role {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.timeline-role.user {
  background: var(--timeline-user-bg);
  color: var(--timeline-user-text);
}

.timeline-role.assistant {
  background: var(--badge-bg);
  color: var(--accent);
}

.timeline-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.timeline-filename {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.timeline-preview {
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.timeline-ts {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  padding-top: 1px;
}

/* Motion accessibility: suppress all animation for users who opt out */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* a conversation in its own window: the shell chrome stays in the main window */
.home-solo .sidebar {
  display: none;
}

/* the drag strip overlays the traffic-light band instead of stacking above the
   content, and the tab-strip offset does not apply: the header sits right
   under the window controls */
.app-frame-solo {
  position: relative;
}

.solo-drag {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 36px;
  z-index: 5;
  -webkit-app-region: drag;
}

.app-frame-solo .app-frame-content {
  flex: 1;
  min-height: 0;
  padding-top: 0;
}

.home-solo .content {
  padding-top: 36px;
}

.hf-ctx {
  flex-shrink: 0;
  padding: 0 6px;
  cursor: default;
}

.hf-ctx:hover {
  background: transparent;
}

.hf-ctx-ring {
  display: block;
  transform: rotate(-90deg);
}

.hf-ctx-track,
.hf-ctx-fill {
  fill: none;
  stroke-width: 2.5;
}

.hf-ctx-track {
  stroke: var(--border-strong);
}

.hf-ctx-fill {
  stroke: var(--text-secondary);
  stroke-linecap: round;
  transition: stroke-dasharray var(--transition-fast);
}

.hf-ctx-high .hf-ctx-fill {
  stroke: var(--danger);
}

.hf-ctx-handoff {
  flex-shrink: 0;
  padding: 0 7px;
}

/* ---- phones: sidebar as a drawer, content edge to edge ---- */

.sidebar-backdrop {
  display: none;
}

@media (max-width: 760px) {
  .sidebar {
    position: fixed;
    top: 40px;
    bottom: 0;
    left: 0;
    z-index: 20;
    width: min(85vw, 320px);
    box-shadow: var(--shadow-menu);
    background: var(--surface);
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 40px 0 0;
    z-index: 19;
    background: var(--color-bg-overlay);
  }

  .sidebar-edge {
    display: none;
  }

  .sidebar-toggle {
    opacity: 1;
  }

  .sidebar-reveal {
    top: 12px;
    left: 8px;
  }

  .content {
    padding: 16px 14px 24px;
  }

  .content.gw-active {
    padding-top: 16px;
  }

  .home.side-hidden .content:not(.gw-active) {
    padding-left: 48px;
  }

  .content.gw-active {
    padding: 8px 10px 10px;
  }

  .home.side-hidden .gw-header {
    padding-left: 36px;
  }

  /* management pages (tasks, experts, connectors, channels, artifacts): the
     desktop gutter plus the sidebar-toggle inset pushed content off-screen */
  .atm-page,
  .con-page,
  .exp-page,
  .ar-page {
    padding: 8px 0 24px;
  }

  .hub-bar {
    padding: 4px 0 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .hub-bar::-webkit-scrollbar {
    display: none;
  }

  .exp-header-row,
  .con-header {
    flex-direction: column;
    align-items: stretch;
  }

  .exp-header-actions,
  .con-header-actions {
    flex-wrap: wrap;
  }

  .skl-search,
  .con-search {
    flex: 1 1 160px;
    width: auto;
    min-width: 0;
  }

  .atm-toolbar {
    flex-wrap: wrap;
  }

  .ar-filters {
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .ar-filters::-webkit-scrollbar {
    display: none;
  }
}

/* transient feedback pill (shared ToastHost); colors are app-scoped like docs */
:root {
  --home-toast-bg: rgb(35 35 37 / 92%);
  --home-toast-error-bg: rgb(196 49 75 / 95%);
  --home-toast-ink: #fff;
  --home-toast-ok: #34c759;
}

.app-toast {
  position: fixed;
  top: 56px;
  left: 50%;
  transform: translate(-50%, -8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 8px;
  background: var(--home-toast-bg);
  color: var(--home-toast-ink);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.app-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.app-toast.error {
  background: var(--home-toast-error-bg);
}

.app-toast-icon {
  width: 16px;
  height: 16px;
  flex: none;
}

.app-toast.success .app-toast-icon {
  color: var(--home-toast-ok);
}

/* one window-wide notice while a call waits on the cloud sandbox to wake */
.cloud-waking-banner {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  box-shadow: var(--shadow-menu);
  pointer-events: none;
}

.cloud-waking-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: cloud-waking-pulse 1.2s ease-in-out infinite;
}

@keyframes cloud-waking-pulse {
  0%,
  100% {
    opacity: 0.35;
  }
  50% {
    opacity: 1;
  }
}
/* Chrome-style tab strip: tinted bar, white active tab with rounded top
 * corners + concave "feet" merging into the content area below.
 * Metrics copied from Chrome (macOS, light): 40px strip, 34px tabs that
 * shrink from 240px but never stretch, "+" hugging the last tab. */
.tab-bar {
  --tabstrip-bg: #ebebeb;
  --tabstrip-text: #454746;
  --tabstrip-text-active: #1f1f1f;
  --tab-separator: rgba(0, 0, 0, 0.22);
  --tab-plate-hover: rgba(255, 255, 255, 0.85);
  --tab-close-hover: rgba(0, 0, 0, 0.1);
  --tab-btn-hover: rgba(0, 0, 0, 0.08);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 40px;
  display: flex;
  align-items: stretch;
  background: var(--tabstrip-bg);
  -webkit-app-region: drag;
  z-index: 10;
}

/* While a Home popover is open the strip must deliver presses (drag regions
   swallow them), so outside-press dismissal can see presses on the blank band */
html.genoffice-popover-open .tab-bar {
  -webkit-app-region: no-drag;
}

/* room for the macOS traffic lights (titleBarStyle: hiddenInset) */
.tab-bar-drag-spacer {
  width: 78px;
  flex-shrink: 0;
}

/* scrollable middle section; empty space stays part of the window drag region.
 * Horizontal padding keeps the edge tabs' feet inside the scroll clip. */
.tab-strip {
  display: flex;
  align-items: stretch;
  flex: 1 1 auto;
  min-width: 0;
  padding: 0 10px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tab-strip::-webkit-scrollbar {
  display: none;
}

.tab-item {
  -webkit-app-region: no-drag;
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  /* tab body is 34px tall and sits flush with the bar bottom; the 6px
   * bottom padding centers content in the upper 28px band, on the same
   * line as the hover capsule — measured from Chrome, whose favicons sit
   * 3px above the tab's geometric center */
  margin-top: 6px;
  /* 12px left = 3px plate inset + 9px icon-to-plate, per Chrome @2x */
  padding: 0 8px 6px 12px;
  /* Chrome tabs shrink under pressure but never grow past 240px */
  flex: 0 1 240px;
  min-width: 104px;
  border-radius: 10px 10px 0 0;
  cursor: pointer;
  color: var(--tabstrip-text);
  font-size: 12.5px;
  user-select: none;
}

/* Home carries the product name and is never closable, so it hugs its own
 * content instead of sharing the document tabs' 240px flex basis — and it
 * never shrinks, so "MaxWork" stays whole however many tabs are open.
 * ("tab-home", not "home" — home.css owns `.home` for the home page
 * container living in this same document.) */
.tab-item.tab-home {
  flex: 0 0 auto;
  min-width: 0;
  /* 2px tighter icon-to-label gap than document tabs: the home glyph is an
   * outline (no solid plate), so the default 8px reads too loose */
  gap: 6px;
  /* 27px = 3px plate inset + 24px from "MaxWork" to the plate's edge, so the
   * label gets a real 24px of breathing room (the 9px the other tabs' icons
   * get reads too tight after a word) */
  padding-right: 27px;
}

/* thin separator between adjacent inactive tabs */
.tab-item:not(.active):not(:first-child)::before {
  content: '';
  position: absolute;
  left: 0;
  /* centered on the content line (3px above tab center, like the icons) */
  top: calc(50% - 3px);
  width: 1px;
  height: 16px;
  transform: translateY(-50%);
  background: var(--tab-separator);
}

/* separators vanish next to the active or hovered tab.
 * `:not(.active)` on the right-hand side is load-bearing: an active tab's
 * ::before is its left foot, not a separator — hiding it would cut the
 * rounded corner whenever the hovered/dragged tab sits just before it */
.tab-item:not(.active):hover::before,
.tab-item:hover + .tab-item:not(.active)::before,
.tab-item.active + .tab-item:not(.active)::before,
.tab-item.drag-source + .tab-item:not(.active)::before {
  opacity: 0;
}

/* trailing separator between the last tab and the "+" button, centered in
 * their 4px gap; same vanishing rules as the inter-tab separators */
.tab-new-btn::before {
  content: '';
  position: absolute;
  left: -2.5px;
  top: 50%;
  width: 1px;
  height: 16px;
  transform: translateY(-50%);
  background: var(--tab-separator);
}

.tab-item.active + .tab-new-btn::before,
.tab-item:hover + .tab-new-btn::before,
.tab-item.drag-source + .tab-new-btn::before,
.tab-new-btn:hover::before {
  opacity: 0;
}

/* The highlight "plate" — one element serves both states so hover and
 * active share the exact same left/right edges (measured from Chrome:
 * icon 18px@2x and × 30px@2x from the plate edges in BOTH states, and
 * every plate is inset ~3px from its tab box, giving adjacent plates
 * their constant 6px separation). Activating a hovered tab must not
 * change the plate's width — only its height/shape. */
.tab-plate {
  position: absolute;
  /* hover shape: flush with the tab top, 28px tall, 9px radius */
  inset: 0 3px 6px;
  border-radius: 9px;
  z-index: -1;
  pointer-events: none;
}

.tab-item:not(.active):hover .tab-plate {
  background: var(--tab-plate-hover);
}

.tab-item.active {
  color: var(--tabstrip-text-active);
  z-index: 1;
}

/* active shape: same side edges, full height, top corners only */
.tab-item.active .tab-plate {
  inset: 0 3px;
  border-radius: 10px 10px 0 0;
  background: var(--surface);
}

/* concave feet joining the active plate to the white content area below */
.tab-item.active .tab-plate::before,
.tab-item.active .tab-plate::after {
  content: '';
  position: absolute;
  bottom: 0;
  width: 10px;
  height: 10px;
}

.tab-item.active .tab-plate::before {
  left: -10px;
  background: radial-gradient(circle at 0 0, transparent 9.5px, var(--surface) 10px);
}

.tab-item.active .tab-plate::after {
  right: -10px;
  background: radial-gradient(circle at 100% 0, transparent 9.5px, var(--surface) 10px);
}

/* mid drag-to-reorder: the dragged tab's plate carries a lift shadow */
.tab-item.drag-source .tab-plate {
  box-shadow: var(--shadow-btn-hover);
}

/* ---- drag-to-reorder (Chrome-style: the grabbed tab follows the pointer, neighbours slide aside) ---- */

.tab-strip.dragging .tab-item {
  transition: transform 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-strip.dragging .tab-item.drag-source {
  transition: none;
  z-index: 2;
}

.tab-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.tab-title {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tab-close {
  -webkit-app-region: no-drag;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-size: 13px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

.tab-close:hover {
  background: var(--tab-close-hover);
}

/* "+" new tab button: lives inside the strip so it hugs the last tab, Chrome-style */
.tab-new-btn {
  margin-left: 4px;
}

.tab-overflow-btn {
  margin: 0 8px 0 2px;
}

/* divider between the tab strip and the tab-overview button */
.tab-overflow-btn::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 50%;
  width: 1px;
  height: 16px;
  transform: translateY(-50%);
  background: var(--tab-separator);
}

.tab-new-btn,
.tab-overflow-btn {
  -webkit-app-region: no-drag;
  position: relative;
  flex-shrink: 0;
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--tabstrip-text);
  cursor: pointer;
}

.tab-new-btn:hover,
.tab-overflow-btn:hover {
  background: var(--tab-btn-hover);
}

.app-frame-content {
  padding-top: 40px;
}

/* ── Dark mode tab bar overrides ─────────────────────────── */

[data-theme='dark'] .tab-bar {
  --tabstrip-bg: #2a2a2a;
  --tabstrip-text: #b0b0b0;
  --tabstrip-text-active: #e4e4e4;
  --tab-separator: rgba(255, 255, 255, 0.15);
  --tab-plate-hover: rgba(255, 255, 255, 0.08);
  --tab-close-hover: rgba(255, 255, 255, 0.12);
  --tab-btn-hover: rgba(255, 255, 255, 0.1);
}

[data-theme='dark'] .tab-item.active .tab-plate {
  background: var(--surface);
}

/* System dark: same overrides when following OS preference */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']):not([data-theme='dark']) .tab-bar {
    --tabstrip-bg: #2a2a2a;
    --tabstrip-text: #b0b0b0;
    --tabstrip-text-active: #e4e4e4;
    --tab-separator: rgba(255, 255, 255, 0.15);
    --tab-plate-hover: rgba(255, 255, 255, 0.08);
    --tab-close-hover: rgba(255, 255, 255, 0.12);
    --tab-btn-hover: rgba(255, 255, 255, 0.1);
  }
  :root:not([data-theme='light']):not([data-theme='dark']) .tab-item.active .tab-plate {
    background: var(--surface);
  }
}
/* Motion accessibility: suppress all animation for users who opt out */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* browser host: document iframes sit where Electron places its WebContentsViews */
.browser-doc-frame {
  position: absolute;
  top: 40px;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: calc(100% - 40px);
  border: 0;
  background: var(--surface);
}
